Merge branch 'dev' into 'master'
Dev See merge request uniapp/yshop-uniapp!1
This commit is contained in:
@ -69,7 +69,7 @@ export function getHostProducts(page, limit) {
|
||||
* */
|
||||
export function getGroomList(type) {
|
||||
return request.get("/groom/list/" + type, {}, {
|
||||
login: false
|
||||
login: true
|
||||
});
|
||||
}
|
||||
|
||||
@ -158,4 +158,4 @@ export function postOrderComment(data) {
|
||||
return request.post("/order/comment", data, {
|
||||
login: true
|
||||
});
|
||||
}
|
||||
}
|
||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1,3 +1,6 @@
|
||||
page {
|
||||
background: #f5f5f5;
|
||||
}
|
||||
.newsList .newsSwitch .van-hairline--top-bottom::after {
|
||||
border: 0;
|
||||
}
|
||||
@ -1739,18 +1742,21 @@ flex: 0 2.4*100rpx;
|
||||
width: 100%;
|
||||
height: 0.86*100rpx;
|
||||
padding-left: 0.23*100rpx;
|
||||
padding-right: 0.23*100rpx;
|
||||
position: fixed;
|
||||
left: 0;
|
||||
top: 0;
|
||||
z-index: 5;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.productList .search .input {
|
||||
width: 6.4*100rpx;
|
||||
flex:1;
|
||||
height: 0.6*100rpx;
|
||||
background-color: #fff;
|
||||
border-radius: 0.5*100rpx;
|
||||
padding: 0 0.2*100rpx;
|
||||
margin-right: 0.23*100rpx;
|
||||
}
|
||||
|
||||
.productList .search .input input {
|
||||
@ -2548,7 +2554,7 @@ flex: 0 2.4*100rpx;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.product-con .product-intro .conter image{
|
||||
.product-con .product-intro .conter *{
|
||||
width: 100% !important;
|
||||
display: block !important;
|
||||
}
|
||||
@ -4494,7 +4500,7 @@ flex: 0 2.4*100rpx;
|
||||
transform: rotate(180deg);
|
||||
}
|
||||
|
||||
.bargain .bargainGang .title .pictrue img,
|
||||
.bargain .bargainGang .title .pictrue image,
|
||||
.bargain .goodsDetails .title .pictrue image{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
@ -6984,7 +6990,7 @@ flex: 0 2.4*100rpx;
|
||||
}
|
||||
|
||||
.product-con .footerRush .bnt {
|
||||
width: 86%;
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
line-height: 1*100rpx;
|
||||
height: 100%;
|
||||
@ -8425,3 +8431,17 @@ flex: 0 2.4*100rpx;
|
||||
}
|
||||
|
||||
.swiper-wrapper {}
|
||||
|
||||
.posterCanvasWarp{
|
||||
position: relative;
|
||||
width:0;
|
||||
height:0;
|
||||
overflow: hidden;
|
||||
.posterCanvas{
|
||||
position: absolute;
|
||||
left:0;
|
||||
top:0;
|
||||
width:747px !important;
|
||||
height:1326px !important;
|
||||
}
|
||||
}
|
||||
|
@ -1,62 +1,57 @@
|
||||
<template>
|
||||
<view class="time">
|
||||
{{ tipText }}
|
||||
<text class="styleAll" v-if="isDay === true">{{ day }}</text>
|
||||
<!-- <text class="timeTxt">{{ dayText }}</text> -->
|
||||
<text v-if="rtipText">{{ rtipText }}</text>
|
||||
<text class="styleAll" v-if="risDay === true">{{ rday }}</text>
|
||||
<text class="timeTxt" v-if="rdayText">{{ rdayText }}</text>
|
||||
<text class="styleAll">{{ hour }}</text>
|
||||
<text class="timeTxt">{{ hourText }}</text>
|
||||
<text class="timeTxt" v-if="rhourText">{{ rhourText }}</text>
|
||||
<text class="styleAll">{{ minute }}</text>
|
||||
<text class="timeTxt">{{ minuteText }}</text>
|
||||
<text class="timeTxt" v-if="rminuteText">{{ rminuteText }}</text>
|
||||
<text class="styleAll">{{ second }}</text>
|
||||
<!-- <text class="timeTxt">{{ secondText }}</text> -->
|
||||
<text class="timeTxt" v-if="rsecondText">{{ rsecondText }}</text>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
name: "CountDown",
|
||||
props: {
|
||||
props: [
|
||||
//距离开始提示文字
|
||||
tipText: {
|
||||
type: String,
|
||||
default: "倒计时"
|
||||
},
|
||||
dayText: {
|
||||
type: String,
|
||||
default: "天"
|
||||
},
|
||||
hourText: {
|
||||
type: String,
|
||||
default: "时"
|
||||
},
|
||||
minuteText: {
|
||||
type: String,
|
||||
default: "分"
|
||||
},
|
||||
secondText: {
|
||||
type: String,
|
||||
default: "秒"
|
||||
},
|
||||
datatime: {
|
||||
type: Number,
|
||||
default: 0
|
||||
},
|
||||
isDay: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
}
|
||||
},
|
||||
'tipText',
|
||||
'dayText',
|
||||
'hourText',
|
||||
'minuteText',
|
||||
'secondText',
|
||||
'datatime',
|
||||
'isDay'
|
||||
],
|
||||
data: function() {
|
||||
return {
|
||||
day: "00",
|
||||
hour: "00",
|
||||
minute: "00",
|
||||
second: "00"
|
||||
second: "00",
|
||||
rtipText: "倒计时",
|
||||
rdayText: "天",
|
||||
rhourText: "时",
|
||||
rminuteText: "分",
|
||||
rsecondText: "秒",
|
||||
rdatatime: 0,
|
||||
risDay: true
|
||||
};
|
||||
},
|
||||
created: function() {
|
||||
// this.show_time();
|
||||
},
|
||||
mounted: function() {
|
||||
console.log(this)
|
||||
this.rtipText = this.$props.tipText;
|
||||
this.rdayText = this.$props.dayText;
|
||||
this.rhourText = this.$props.hourText;
|
||||
this.rminuteText = this.$props.minuteText;
|
||||
this.rsecondText = this.$props.secondText;
|
||||
this.rdatatime = this.$props.datatime;
|
||||
this.risDay = this.$props.isDay;
|
||||
console.log(this.rdayText)
|
||||
this.show_time();
|
||||
},
|
||||
methods: {
|
||||
|
@ -16,11 +16,7 @@
|
||||
v-if="cart.productInfo.attrInfo"
|
||||
>{{ cart.productInfo.attrInfo.suk }}</view>
|
||||
<view class="money font-color-red">¥{{ cart.truePrice }}</view>
|
||||
<view
|
||||
class="evaluate"
|
||||
v-if="evaluate == 3"
|
||||
@click="routerGo(cart)"
|
||||
>评价</view>
|
||||
<view class="evaluate" v-if="evaluate == 3" @click="routerGo(cart)">评价</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@ -41,9 +37,12 @@ export default {
|
||||
},
|
||||
mounted: function() {},
|
||||
methods: {
|
||||
routerGo(item) {
|
||||
this.$yrouter.push({ path: '/pages/shop/GoodsEvaluate/index',query:{id:cart.unique} });
|
||||
},
|
||||
routerGo(cart) {
|
||||
this.$yrouter.push({
|
||||
path: "/pages/shop/GoodsEvaluate/index",
|
||||
query: { id: cart.unique }
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
@ -65,13 +65,8 @@ export default {
|
||||
data: function() {
|
||||
return {};
|
||||
},
|
||||
watch: {
|
||||
attr:function(ne){
|
||||
console.log(ne)
|
||||
}
|
||||
},
|
||||
mounted: function() {
|
||||
console.log(this.attr)
|
||||
console.log(this.attr);
|
||||
},
|
||||
methods: {
|
||||
closeAttr: function() {
|
||||
@ -84,16 +79,23 @@ export default {
|
||||
this.$emit("changeFun", { action: "ChangeCartNum", value: 1 });
|
||||
},
|
||||
tapAttr: function(indexw, indexn) {
|
||||
// 修改商品规格不生效的原因:
|
||||
// H5端下面写法,attr更新,但是除H5外其他端不支持,
|
||||
// 尽量避免下面的骚写法,不要在子组件内更新props
|
||||
// this.attr.productAttr[res.indexw].index = res.indexn;
|
||||
let that = this;
|
||||
console.log(that.attr.productAttr);
|
||||
console.log(that.attr.productAttr[indexw], indexw, indexn);
|
||||
that.attr.productAttr[indexw].index = indexn;
|
||||
let value = that
|
||||
.getCheckedValue()
|
||||
.sort()
|
||||
.join(",");
|
||||
console.log(value);
|
||||
that.$emit("changeFun", { action: "ChangeAttr", value: value });
|
||||
that.$emit("changeFun", {
|
||||
action: "ChangeAttr",
|
||||
value: {
|
||||
value,
|
||||
indexw,
|
||||
indexn
|
||||
}
|
||||
});
|
||||
},
|
||||
//获取被选中属性;
|
||||
getCheckedValue: function() {
|
||||
|
@ -1,6 +1,8 @@
|
||||
<template>
|
||||
<view v-if="posterImageStatus" class="poster-first">
|
||||
<canvas style="width:747px;height:1326px" canvas-id="myCanvas"></canvas>
|
||||
<div class="posterCanvasWarp">
|
||||
<canvas class="posterCanvas" canvas-id="myCanvas"></canvas>
|
||||
</div>
|
||||
<!-- <view class="poster-pop" v-show="!canvasStatus">
|
||||
<image
|
||||
src="@/static/images/poster-close.png"
|
||||
@ -25,7 +27,7 @@
|
||||
</view>
|
||||
</view>
|
||||
<view class="save-poster" @click="savePosterPath">生成图片</view>
|
||||
</view> -->
|
||||
</view>-->
|
||||
<view class="poster-pop" v-show="canvasStatus">
|
||||
<img
|
||||
src="@/static/images/poster-close.png"
|
||||
@ -33,7 +35,13 @@
|
||||
@click="posterImageClose"
|
||||
mode="widthFix"
|
||||
/>
|
||||
<image :src="posterImage" alt="tp" class="poster-image" show-menu-by-longpress mode="widthFix" />
|
||||
<image
|
||||
:src="posterImage"
|
||||
alt="tp"
|
||||
class="poster-image"
|
||||
show-menu-by-longpress
|
||||
mode="widthFix"
|
||||
/>
|
||||
<view class="keep">长按图片可以保存到手机</view>
|
||||
</view>
|
||||
<view class="mask"></view>
|
||||
@ -44,78 +52,78 @@
|
||||
overscroll-behavior: contain;
|
||||
}
|
||||
.poster-pop {
|
||||
width: 4.5*100rpx;
|
||||
height: 8*100rpx;
|
||||
width: 4.5 * 100rpx;
|
||||
height: 8 * 100rpx;
|
||||
position: fixed;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
z-index: 99;
|
||||
top: 50%;
|
||||
margin-top: -4.6*100rpx;
|
||||
margin-top: -4.6 * 100rpx;
|
||||
}
|
||||
.poster-pop .canvas {
|
||||
background-color: #ffffff;
|
||||
height: 8*100rpx;
|
||||
height: 8 * 100rpx;
|
||||
}
|
||||
.poster-pop .poster-image {
|
||||
width: 100%;
|
||||
height: auto;
|
||||
}
|
||||
.poster-pop .canvas .image {
|
||||
width: 4.5*100rpx;
|
||||
height: 4.5*100rpx;
|
||||
width: 4.5 * 100rpx;
|
||||
height: 4.5 * 100rpx;
|
||||
display: block;
|
||||
}
|
||||
.poster-pop .canvas .text {
|
||||
text-align: center;
|
||||
color: #000000;
|
||||
margin-top: 0.32*100rpx;
|
||||
margin-top: 0.32 * 100rpx;
|
||||
}
|
||||
.poster-pop .canvas .text.black {
|
||||
height: 0.68*100rpx;
|
||||
height: 0.68 * 100rpx;
|
||||
}
|
||||
.poster-pop .canvas .text.rad {
|
||||
color: #ff0000;
|
||||
}
|
||||
.poster-pop .canvas .code {
|
||||
height: 1.4*100rpx;
|
||||
height: 1.4 * 100rpx;
|
||||
display: flex;
|
||||
}
|
||||
.poster-pop .canvas .code .code-img {
|
||||
width: 33%;
|
||||
padding: 0.06*100rpx;
|
||||
padding: 0.06 * 100rpx;
|
||||
}
|
||||
.poster-pop .canvas .code .code-img image{
|
||||
.poster-pop .canvas .code .code-img image {
|
||||
width: 100%;
|
||||
}
|
||||
.poster-pop .canvas .code .code-text {
|
||||
width: 60%;
|
||||
font-size: 0.12*100rpx;
|
||||
line-height: 1.64*100rpx;
|
||||
font-size: 0.12 * 100rpx;
|
||||
line-height: 1.64 * 100rpx;
|
||||
}
|
||||
.poster-pop .close {
|
||||
width: 0.46*100rpx;
|
||||
height: 0.75*100rpx;
|
||||
width: 0.46 * 100rpx;
|
||||
height: 0.75 * 100rpx;
|
||||
position: fixed;
|
||||
right: 0;
|
||||
top: -0.73*100rpx;
|
||||
top: -0.73 * 100rpx;
|
||||
display: block;
|
||||
}
|
||||
.poster-pop .save-poster {
|
||||
background-color: #df2d0a;
|
||||
font-size: 0.22*100rpx;
|
||||
font-size: 0.22 * 100rpx;
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
height: 0.76*100rpx;
|
||||
line-height: 0.76*100rpx;
|
||||
height: 0.76 * 100rpx;
|
||||
line-height: 0.76 * 100rpx;
|
||||
width: 100%;
|
||||
margin-top: -0.04*100rpx;
|
||||
margin-top: -0.04 * 100rpx;
|
||||
}
|
||||
.poster-pop .keep {
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
font-size: 0.25*100rpx;
|
||||
margin-top: 0.1*100rpx;
|
||||
font-size: 0.25 * 100rpx;
|
||||
margin-top: 0.1 * 100rpx;
|
||||
}
|
||||
.mask {
|
||||
position: fixed;
|
||||
|
32
main.js
32
main.js
@ -31,12 +31,12 @@ Vue.prototype.$validator = function(rule) {
|
||||
return new schema(rule);
|
||||
};
|
||||
|
||||
const CACHE_KEY = "clear_0.0.1";
|
||||
// const CACHE_KEY = "clear_0.0.1";
|
||||
|
||||
if (!cookie.has(CACHE_KEY)) {
|
||||
cookie.clearAll();
|
||||
cookie.set(CACHE_KEY, 1);
|
||||
}
|
||||
// if (!cookie.has(CACHE_KEY)) {
|
||||
// cookie.clearAll();
|
||||
// cookie.set(CACHE_KEY, 1);
|
||||
// }
|
||||
|
||||
|
||||
Vue.config.productionTip = false
|
||||
@ -78,30 +78,30 @@ Vue.prototype.$VUE_APP_API_URL = VUE_APP_API_URL
|
||||
|
||||
// #ifdef H5
|
||||
// H5编译的代码
|
||||
Vue.prototype.$deviceType = 'h5'
|
||||
Vue.prototype.$deviceType = 'h5'
|
||||
store.commit('UPDATE_DEVICETYPE','h5')
|
||||
// #endif
|
||||
|
||||
// #ifdef APP-PLUS
|
||||
// App平台编译的代码
|
||||
// App平台编译的代码
|
||||
console.log('App平台编译的代码')
|
||||
Vue.prototype.$deviceType = 'app'
|
||||
Vue.prototype.$deviceType = 'app'
|
||||
store.commit('UPDATE_DEVICETYPE','app')
|
||||
Vue.prototype.$platform = uni.getSystemInfoSync().platform
|
||||
// #endif
|
||||
|
||||
// #ifdef MP-WEIXIN
|
||||
// 微信小程序编译的代码
|
||||
// 微信小程序编译的代码
|
||||
console.log('微信小程序编译的代码')
|
||||
Vue.prototype.$deviceType = 'weixin'
|
||||
Vue.prototype.$deviceType = 'weixin'
|
||||
store.commit('UPDATE_DEVICETYPE','weixin')
|
||||
// #endif
|
||||
|
||||
// !!! ps 不建议在 template 中使用 $deviceType 去判断当前环境,很有可能出现 $deviceType 为 undefined 导致判断出错的问题,可以在 script 模块中正常使用
|
||||
// 建议通过 store 去获取 $deviceType 可以保证 template 中取到的值有效
|
||||
// import { mapState, mapMutations, mapActions } from 'vuex';
|
||||
|
||||
// !!! ps 不建议在 template 中使用 $deviceType 去判断当前环境,很有可能出现 $deviceType 为 undefined 导致判断出错的问题,可以在 script 模块中正常使用
|
||||
// 建议通过 store 去获取 $deviceType 可以保证 template 中取到的值有效
|
||||
// import { mapState, mapMutations, mapActions } from 'vuex';
|
||||
// computed: {
|
||||
// ...mapState(['$deviceType'])
|
||||
// },
|
||||
|
||||
// },
|
||||
|
||||
app.$mount()
|
||||
|
@ -8,12 +8,12 @@
|
||||
<view class="text acea-row row-column-around">
|
||||
<view class="line1">{{ item.title }}</view>
|
||||
<count-down
|
||||
:is-day="true"
|
||||
:tip-text="'倒计时 '"
|
||||
:day-text="' 天 '"
|
||||
:hour-text="' 时 '"
|
||||
:minute-text="' 分 '"
|
||||
:second-text="' 秒'"
|
||||
:isDay="true"
|
||||
:tipText="'倒计时 '"
|
||||
:dayText="' 天 '"
|
||||
:hourText="' 时 '"
|
||||
:minuteText="' 分 '"
|
||||
:secondText="' 秒'"
|
||||
:datatime="item.datatime"
|
||||
></count-down>
|
||||
<view class="money font-color-red">
|
||||
|
@ -14,12 +14,12 @@
|
||||
</view>
|
||||
</view>
|
||||
<count-down
|
||||
:is-day="true"
|
||||
:tip-text="'倒计时 '"
|
||||
:day-text="' 天 '"
|
||||
:hour-text="' 时 '"
|
||||
:minute-text="' 分 '"
|
||||
:second-text="' 秒'"
|
||||
:isDay="true"
|
||||
:tipText="'倒计时 '"
|
||||
:dayText="' 天 '"
|
||||
:hourText="' 时 '"
|
||||
:minuteText="' 分 '"
|
||||
:secondText="' 秒'"
|
||||
:datatime="datatime"
|
||||
></count-down>
|
||||
</view>
|
||||
@ -84,9 +84,9 @@
|
||||
<image src="@/static/images/left.png" />
|
||||
</view>
|
||||
<view class="titleCon">砍价帮</view>
|
||||
<view class="pictrue on">
|
||||
<!-- <view class="pictrue on">
|
||||
<image src="@/static/images/left.png" />
|
||||
</view>
|
||||
</view> -->
|
||||
</view>
|
||||
<view class="list">
|
||||
<view
|
||||
@ -142,10 +142,10 @@
|
||||
<view class="conter" v-html="bargain.rule"></view>
|
||||
</view>
|
||||
<view class="bargainTip" :class="active === true ? 'on' : ''">
|
||||
<view class="pictrue">
|
||||
<!-- <view class="pictrue">
|
||||
<image src="@/static/images/bargainBg.jpg" />
|
||||
<view class="iconfont icon-guanbi" @click="close"></view>
|
||||
</view>
|
||||
</view> -->
|
||||
<view class="cutOff" v-if="bargainPartake === userInfo.uid">
|
||||
您已砍掉
|
||||
<text class="font-color-red" v-text="bargainHelpPrice"></text>元,听说分享次数越多砍价成功的机会越大哦!
|
||||
@ -507,6 +507,9 @@ export default {
|
||||
</script>
|
||||
|
||||
<style lang="less">
|
||||
.bargain{
|
||||
background: #00c17b;
|
||||
}
|
||||
.bargainBnts {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
@ -78,4 +78,7 @@ export default {
|
||||
</script>
|
||||
|
||||
<style >
|
||||
page{
|
||||
background: #00c17b;
|
||||
}
|
||||
</style>
|
||||
|
@ -1,238 +1,264 @@
|
||||
<template>
|
||||
<view class="flash-sale" ref="container">
|
||||
<view class="header" v-if="headerImg">
|
||||
<image :src="headerImg" />
|
||||
</view>
|
||||
<scroll-view scroll-y="false" scroll-x="true">
|
||||
<view class="timeScroll">
|
||||
<view class="" v-for="(item, index) in timeList" :key="index">
|
||||
<view :class="{'timeItem':true,'active':active==index}" @click="changeTime(index)">
|
||||
<view class="time">{{ item.time }}</view>
|
||||
<view class="state">{{ item.state }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
<view class="" v-for="(item, index) in timeList" :key="index">
|
||||
<view v-if="active == index">
|
||||
<view class="countDown font-color-red acea-row row-center-wrapper">
|
||||
<view v-if="item.status === 0" class="activity">活动已结束</view>
|
||||
<count-down :is-day="false" :tip-text="'距结束仅剩 '" :day-text="''" :hour-text="' : '" :minute-text="' : '"
|
||||
:second-text="''" :datatime="datatime" v-if="item.status === 1"></count-down>
|
||||
<view v-if="item.status === 2" class="activity">活动即将开始</view>
|
||||
</view>
|
||||
<view class="list">
|
||||
<view class="item acea-row row-between-wrapper" v-for="(itemSeckill, indexSeckill) in seckillList" :key="indexSeckill">
|
||||
<view class="pictrue">
|
||||
<image :src="itemSeckill.image" />
|
||||
</view>
|
||||
<view class="text acea-row row-column-around">
|
||||
<view class="line1" v-text="itemSeckill.title"></view>
|
||||
<view class="money">
|
||||
限时价
|
||||
<text class="num font-color-red" v-text="'¥' + itemSeckill.price"></text>
|
||||
</view>
|
||||
<view class="progress cart-color">
|
||||
<view class="bg-red" :style="{ width: loading ? itemSeckill.percent + '%' : '' }"></view>
|
||||
<view class="piece font-color-red" v-text="'仅剩' + itemSeckill.stock + '件'"></view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="grab bg-color-red" v-if="item.status === 1 && itemSeckill.stock > 0" @click="goDetail(itemSeckill.id)">马上抢</view>
|
||||
<view class="grab" v-if="item.status === 1 && itemSeckill.stock <= 0">已售磬</view>
|
||||
<view class="grab bg-color-red" v-if="item.status === 2">即将开始</view>
|
||||
<view class="grab bg-color-red" v-if="item.status === 0">已结束</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="noCommodity" style="background-color: #fff;" v-if="seckillList.length === 0 && page > 1">
|
||||
<view class="noPictrue">
|
||||
<image src="@/static/images/noGood.png" class="image" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!--
|
||||
<view class="flash-sale" ref="container">
|
||||
<view class="header" v-if="headerImg">
|
||||
<image :src="headerImg" />
|
||||
</view>
|
||||
<scroll-view scroll-y="false" scroll-x="true">
|
||||
<view class="timeScroll">
|
||||
<view class v-for="(item, index) in timeList" :key="index">
|
||||
<view :class="{'timeItem':true,'active':active==index}" @click="setTime(index)">
|
||||
<view class="time">{{ item.time }}</view>
|
||||
<view class="state">{{ item.state }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
<view class v-for="(item, index) in timeList" :key="index">
|
||||
<view v-if="active == index">
|
||||
<view class="countDown font-color-red acea-row row-center-wrapper">
|
||||
<view v-if="item.status === 0" class="activity">活动已结束</view>
|
||||
<count-down
|
||||
:isDay="false"
|
||||
:tipText="'距结束仅剩 '"
|
||||
:dayText="false"
|
||||
:hourText="' : '"
|
||||
:minuteText="' : '"
|
||||
:secondText="false"
|
||||
:datatime="datatime"
|
||||
v-if="item.status === 1"
|
||||
></count-down>
|
||||
<view v-if="item.status === 2" class="activity">活动即将开始</view>
|
||||
</view>
|
||||
<view class="list">
|
||||
<view
|
||||
class="item acea-row row-between-wrapper"
|
||||
v-for="(itemSeckill, indexSeckill) in seckillList"
|
||||
:key="indexSeckill"
|
||||
>
|
||||
<view class="pictrue">
|
||||
<image :src="itemSeckill.image" />
|
||||
</view>
|
||||
<view class="text acea-row row-column-around">
|
||||
<view class="line1" v-text="itemSeckill.title"></view>
|
||||
<view class="money">
|
||||
限时价
|
||||
<text class="num font-color-red" v-text="'¥' + itemSeckill.price"></text>
|
||||
</view>
|
||||
<view class="progress cart-color">
|
||||
<view class="bg-red" :style="{ width: loading ? itemSeckill.percent + '%' : '' }"></view>
|
||||
<view class="piece font-color-red" v-text="'仅剩' + itemSeckill.stock + '件'"></view>
|
||||
</view>
|
||||
</view>
|
||||
<view
|
||||
class="grab bg-color-red"
|
||||
v-if="item.status === 1 && itemSeckill.stock > 0"
|
||||
@click="goDetail(itemSeckill.id)"
|
||||
>马上抢</view>
|
||||
<view class="grab" v-if="item.status === 1 && itemSeckill.stock <= 0">已售磬</view>
|
||||
<view class="grab bg-color-red" v-if="item.status === 2">即将开始</view>
|
||||
<view class="grab bg-color-red" v-if="item.status === 0">已结束</view>
|
||||
</view>
|
||||
</view>
|
||||
<view
|
||||
class="noCommodity"
|
||||
style="background-color: #fff;"
|
||||
v-if="seckillList.length === 0 && page > 1"
|
||||
>
|
||||
<view class="noPictrue">
|
||||
<image src="@/static/images/noGood.png" class="image" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!--
|
||||
<vant-tabs :active="active" @change="setTime" :sticky="sticky" animated line-height="2" :ellipsis="false">
|
||||
<vant-tab :ellipsis="false" :title="[title[index]]">
|
||||
|
||||
</vant-tab>
|
||||
</vant-tabs> -->
|
||||
</view>
|
||||
</vant-tabs>-->
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
import {
|
||||
getSeckillConfig,
|
||||
getSeckillList
|
||||
} from '@/api/activity';
|
||||
import CountDown from '@/components/CountDown';
|
||||
// import { Tab, Tabs } from "vant-weapp";
|
||||
import Loading from '@/components/Loading';
|
||||
import { getSeckillConfig, getSeckillList } from "@/api/activity";
|
||||
import CountDown from "@/components/CountDown";
|
||||
// import { Tab, Tabs } from "vant-weapp";
|
||||
import Loading from "@/components/Loading";
|
||||
|
||||
export default {
|
||||
name: 'GoodsSeckill',
|
||||
components: {
|
||||
CountDown
|
||||
},
|
||||
props: {},
|
||||
data: function() {
|
||||
return {
|
||||
headerImg: '',
|
||||
timeList: [],
|
||||
sticky: false,
|
||||
loading: false,
|
||||
datatime: 0,
|
||||
active: 0,
|
||||
seckillList: [],
|
||||
status: false, //砍价列表是否获取完成 false 未完成 true 完成
|
||||
loadingList: false, //当前接口是否请求完成 false 完成 true 未完成
|
||||
page: 1, //页码
|
||||
limit: 5, //数量
|
||||
title: [],
|
||||
};
|
||||
},
|
||||
mounted: function() {
|
||||
this.mountedStart();
|
||||
},
|
||||
onReachBottom() {
|
||||
!this.loadingList && this.getSeckillList();
|
||||
},
|
||||
methods: {
|
||||
changeTime: function(index) {
|
||||
this.active = index
|
||||
},
|
||||
mountedStart: function() {
|
||||
var that = this;
|
||||
uni.showLoading();
|
||||
getSeckillConfig().then(res => {
|
||||
that.$set(that, 'headerImg', res.data.lovely);
|
||||
that.$set(that, 'timeList', res.data.seckillTime);
|
||||
that.$set(that, 'active', res.data.seckillTimeIndex);
|
||||
export default {
|
||||
name: "GoodsSeckill",
|
||||
components: {
|
||||
CountDown
|
||||
},
|
||||
props: {},
|
||||
data: function() {
|
||||
return {
|
||||
headerImg: "",
|
||||
timeList: [],
|
||||
sticky: false,
|
||||
loading: false,
|
||||
datatime: 0,
|
||||
active: 0,
|
||||
seckillList: [],
|
||||
status: false, //砍价列表是否获取完成 false 未完成 true 完成
|
||||
loadingList: false, //当前接口是否请求完成 false 完成 true 未完成
|
||||
page: 1, //页码
|
||||
limit: 5, //数量
|
||||
title: []
|
||||
};
|
||||
},
|
||||
mounted: function() {
|
||||
this.mountedStart();
|
||||
},
|
||||
onReachBottom() {
|
||||
!this.loadingList && this.getSeckillList();
|
||||
},
|
||||
methods: {
|
||||
changeTime: function(index) {
|
||||
console.log(index);
|
||||
this.active = index;
|
||||
this.getSeckillList();
|
||||
},
|
||||
mountedStart: function() {
|
||||
var that = this;
|
||||
uni.showLoading();
|
||||
getSeckillConfig().then(res => {
|
||||
that.$set(that, "headerImg", res.data.lovely);
|
||||
that.$set(that, "timeList", res.data.seckillTime);
|
||||
that.$set(that, "active", res.data.seckillTimeIndex);
|
||||
|
||||
let title = [];
|
||||
title = res.data.seckillTime.map((item, index) => {
|
||||
return {
|
||||
name: 'div',
|
||||
attrs: {
|
||||
class: 'timeItem'
|
||||
},
|
||||
children: [{
|
||||
name: 'div',
|
||||
attrs: {
|
||||
class: 'time'
|
||||
},
|
||||
children: [{
|
||||
type: 'text',
|
||||
text: item.time
|
||||
}]
|
||||
},
|
||||
{
|
||||
name: 'div',
|
||||
attrs: {
|
||||
class: 'state'
|
||||
},
|
||||
children: [{
|
||||
type: 'text',
|
||||
text: item.state
|
||||
}]
|
||||
}
|
||||
]
|
||||
};
|
||||
});
|
||||
that.$set(that, 'title', title);
|
||||
that.datatime = that.timeList[that.active].stop;
|
||||
that.getSeckillList();
|
||||
that.$nextTick(function() {
|
||||
that.sticky = true;
|
||||
uni.hideLoading();
|
||||
});
|
||||
});
|
||||
},
|
||||
setTime: function(event) {
|
||||
var that = this;
|
||||
that.active = event.mp.detail.index;
|
||||
that.datatime = that.timeList[that.active].stop;
|
||||
that.getSeckillList();
|
||||
},
|
||||
getSeckillList: function() {
|
||||
var that = this;
|
||||
if (that.loadingList) return;
|
||||
if (that.status) return;
|
||||
var time = that.timeList[that.active].id;
|
||||
getSeckillList(time, {
|
||||
page: that.page,
|
||||
limit: that.limit
|
||||
}).then(res => {
|
||||
that.status = res.data.length < that.limit;
|
||||
that.seckillList.push.apply(that.seckillList, res.data);
|
||||
that.page++;
|
||||
uni.hideLoading();
|
||||
});
|
||||
},
|
||||
goDetail: function(id) {
|
||||
var that = this;
|
||||
var time = that.timeList[that.active].stop;
|
||||
this.$yrouter.push({
|
||||
path: '/pages/activity/SeckillDetails/index',
|
||||
query: {
|
||||
id,
|
||||
time
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
let title = [];
|
||||
title = res.data.seckillTime.map((item, index) => {
|
||||
return {
|
||||
name: "div",
|
||||
attrs: {
|
||||
class: "timeItem"
|
||||
},
|
||||
children: [
|
||||
{
|
||||
name: "div",
|
||||
attrs: {
|
||||
class: "time"
|
||||
},
|
||||
children: [
|
||||
{
|
||||
type: "text",
|
||||
text: item.time
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "div",
|
||||
attrs: {
|
||||
class: "state"
|
||||
},
|
||||
children: [
|
||||
{
|
||||
type: "text",
|
||||
text: item.state
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
};
|
||||
});
|
||||
that.$set(that, "title", title);
|
||||
that.datatime = that.timeList[that.active].stop;
|
||||
that.getSeckillList();
|
||||
that.$nextTick(function() {
|
||||
that.sticky = true;
|
||||
uni.hideLoading();
|
||||
});
|
||||
});
|
||||
},
|
||||
setTime: function(index) {
|
||||
var that = this;
|
||||
that.page = 1;
|
||||
that.loadingList = false;
|
||||
that.status = false;
|
||||
that.active = index;
|
||||
that.datatime = that.timeList[that.active].stop;
|
||||
this.seckillList=[]
|
||||
that.getSeckillList();
|
||||
},
|
||||
getSeckillList: function() {
|
||||
var that = this;
|
||||
if (that.loadingList) return;
|
||||
if (that.status) return;
|
||||
var time = that.timeList[that.active].id;
|
||||
getSeckillList(time, {
|
||||
page: that.page,
|
||||
limit: that.limit
|
||||
}).then(res => {
|
||||
that.status = res.data.length < that.limit;
|
||||
that.seckillList.push.apply(that.seckillList, res.data);
|
||||
that.page++;
|
||||
uni.hideLoading();
|
||||
});
|
||||
},
|
||||
goDetail: function(id) {
|
||||
var that = this;
|
||||
var time = that.timeList[that.active].stop;
|
||||
this.$yrouter.push({
|
||||
path: "/pages/activity/SeckillDetails/index",
|
||||
query: {
|
||||
id,
|
||||
time
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style scoped lang="less">
|
||||
.timeScroll {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-direction: row;
|
||||
}
|
||||
.timeScroll {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-direction: row;
|
||||
}
|
||||
|
||||
.timeItem {
|
||||
font-size: 0.22 * 100rpx;
|
||||
color: #282828;
|
||||
width: 150rpx;
|
||||
text-align: center;
|
||||
padding: 0.11 * 100rpx 0;
|
||||
background-color: none;
|
||||
.timeItem {
|
||||
font-size: 0.22 * 100rpx;
|
||||
color: #282828;
|
||||
width: 150rpx;
|
||||
text-align: center;
|
||||
padding: 0.11 * 100rpx 0;
|
||||
background-color: none;
|
||||
|
||||
&.active {
|
||||
&.active {
|
||||
.time {
|
||||
color: #00c17b;
|
||||
}
|
||||
|
||||
.time {
|
||||
color: #00c17b
|
||||
}
|
||||
.state {
|
||||
background-color: #00c17b;
|
||||
color: #fff;
|
||||
opacity: 1;
|
||||
border-radius: 30rpx;
|
||||
padding: 0 0.2 * 100rpx;
|
||||
font-weight: 800;
|
||||
height: 0.37 * 100rpx;
|
||||
line-height: 0.37 * 100rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.state {
|
||||
background-color: #00c17b;
|
||||
color: #fff;
|
||||
opacity: 1;
|
||||
border-radius: 30rpx;
|
||||
padding: 0 .2*100rpx;
|
||||
font-weight: 800;
|
||||
height: .3*100rpx;
|
||||
line-height: .3*100rpx;
|
||||
}
|
||||
.timeItem .time {
|
||||
font-size: 0.32 * 100rpx;
|
||||
font-weight: bold;
|
||||
height: 0.37 * 100rpx;
|
||||
line-height: 0.37 * 100rpx;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
.timeItem .state {
|
||||
height: 0.37 * 100rpx;
|
||||
line-height: 0.37 * 100rpx;
|
||||
}
|
||||
|
||||
.timeItem .time {
|
||||
font-size: 0.32 * 100rpx;
|
||||
font-weight: bold;
|
||||
height: 0.37 * 100rpx;
|
||||
line-height: 0.37 * 100rpx;
|
||||
}
|
||||
.activity {
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.timeItem .state {
|
||||
height: 0.37 * 100rpx;
|
||||
line-height: 0.37 * 100rpx;
|
||||
}
|
||||
|
||||
.activity {
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.flash-sale .list .item .grab {
|
||||
background-color: #999;
|
||||
}
|
||||
.flash-sale .list .item .grab {
|
||||
background-color: #999;
|
||||
}
|
||||
</style>
|
||||
|
@ -50,12 +50,12 @@
|
||||
<text>人成团</text>
|
||||
</view>
|
||||
<count-down
|
||||
:is-day="false"
|
||||
:tip-text="'剩余 '"
|
||||
:day-text="''"
|
||||
:hour-text="':'"
|
||||
:minute-text="':'"
|
||||
:second-text="''"
|
||||
:isDay="false"
|
||||
:tipText="'剩余 '"
|
||||
:dayText="false"
|
||||
:hourText="':'"
|
||||
:minuteText="':'"
|
||||
:secondText="false"
|
||||
:datatime="item.stopTime"
|
||||
></count-down>
|
||||
</view>
|
||||
@ -104,12 +104,17 @@
|
||||
<view class="product-intro">
|
||||
<view class="title">产品介绍</view>
|
||||
<view class="conter" v-html="storeInfo.description"></view>
|
||||
<!-- <view class="conter" v-html=""></view> -->
|
||||
</view>
|
||||
<view style="height:100rpx;"></view>
|
||||
<view class="footer-group acea-row row-between-wrapper">
|
||||
<view class="customerSer acea-row row-center-wrapper row-column">
|
||||
<!-- <view class="customerSer acea-row row-center-wrapper row-column">
|
||||
<view class="iconfont icon-kefu"></view>
|
||||
<view>客服</view>
|
||||
</view>-->
|
||||
<view class="customerSer acea-row row-center-wrapper row-column" @click="setCollect">
|
||||
<view class="iconfont" :class="userCollect ? 'icon-shoucang1' : 'icon-shoucang'"></view>
|
||||
<text>收藏</text>
|
||||
</view>
|
||||
<view class="bnt bg-color-violet" @click="openAlone">单独购买</view>
|
||||
<view class="bnt bg-color-red" @click="openTeam">立即开团</view>
|
||||
@ -134,6 +139,12 @@ import StorePoster from "@/components/StorePoster";
|
||||
import { getCombinationDetail } from "@/api/activity";
|
||||
import { postCartAdd } from "@/api/store";
|
||||
import { imageBase64 } from "@/api/public";
|
||||
import {
|
||||
getCoupon,
|
||||
getCollectAdd,
|
||||
getCollectDel,
|
||||
getUserInfo
|
||||
} from "@/api/user";
|
||||
const NAME = "GroupDetails";
|
||||
|
||||
export default {
|
||||
@ -188,7 +199,8 @@ export default {
|
||||
cart_num: 1
|
||||
}
|
||||
},
|
||||
cartNum: 1
|
||||
cartNum: 1,
|
||||
userCollect: false
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
@ -206,11 +218,27 @@ export default {
|
||||
openAlone: function() {
|
||||
this.$yrouter.replace({ path: "/detail/" + this.storeInfo.productId });
|
||||
},
|
||||
//收藏商品
|
||||
setCollect: function() {
|
||||
let that = this,
|
||||
id = that.storeInfo.id,
|
||||
category = "product";
|
||||
if (that.userCollect) {
|
||||
getCollectDel(id, category).then(function() {
|
||||
that.userCollect = !that.userCollect;
|
||||
});
|
||||
} else {
|
||||
getCollectAdd(id, category).then(function() {
|
||||
that.userCollect = !that.userCollect;
|
||||
});
|
||||
}
|
||||
},
|
||||
mountedStart: function() {
|
||||
var that = this;
|
||||
console.log(that)
|
||||
console.log(that);
|
||||
let id = that.$yroute.query.id;
|
||||
getCombinationDetail(id).then(res => {
|
||||
that.userCollect = res.data.userCollect;
|
||||
that.$set(that, "storeInfo", res.data.storeInfo);
|
||||
that.$set(that, "imgUrls", res.data.storeInfo.sliderImageArr);
|
||||
that.$set(that, "itemNew", res.data.pinkOkList);
|
||||
@ -323,13 +351,14 @@ export default {
|
||||
</script>
|
||||
<style scoped lang="less">
|
||||
.product-con .wrapper {
|
||||
padding-bottom: 0.26*100rpx;
|
||||
padding-bottom: 0.26 * 100rpx;
|
||||
}
|
||||
.noscroll {
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
}
|
||||
.product-con .footer-group .bnt {
|
||||
// flex:1;
|
||||
width: 43%;
|
||||
}
|
||||
.product-con .footer-group .bnt.bg-color-violet {
|
||||
|
@ -1,220 +1,246 @@
|
||||
<template>
|
||||
<view class="group-con">
|
||||
<view class="header acea-row row-between-wrapper">
|
||||
<view class="pictrue">
|
||||
<image :src="storeCombination.image" />
|
||||
</view>
|
||||
<view class="text">
|
||||
<view class="line1" v-text="storeCombination.title"></view>
|
||||
<view class="money">
|
||||
<text>¥</text>
|
||||
<text class="num" v-text="storeCombination.price"></text>
|
||||
<text class="team cart-color" v-text="storeCombination.people + '人拼'"></text>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="pinkBool === -1" class="iconfont icon-pintuanshibai"></view>
|
||||
<view v-else-if="pinkBool === 1" class="iconfont icon-pintuanchenggong font-color-red"></view>
|
||||
</view>
|
||||
<view class="wrapper">
|
||||
<view class="title acea-row row-center-wrapper">
|
||||
<view class="line"></view>
|
||||
<view class="name acea-row row-center-wrapper">
|
||||
<text>剩余</text>
|
||||
<count-down :is-day="false" :tip-text="''" :day-text="''" :hour-text="' : '" :minute-text="' : '" :second-text="''"
|
||||
:datatime="pinkT.stopTime"></count-down>
|
||||
<text>结束</text>
|
||||
</view>
|
||||
<view class="line"></view>
|
||||
</view>
|
||||
<text class="tips font-color-red" v-if="pinkBool === 1">恭喜您拼团成功</text>
|
||||
<text class="tips" v-else-if="pinkBool === -1">还差{{ count }}人,拼团失败</text>
|
||||
<text class="tips font-color-red" v-else-if="pinkBool === 0">拼团中,还差{{ count }}人拼团成功</text>
|
||||
<view class="list acea-row row-middle" :class="[pinkBool === 1 || pinkBool === -1 ? 'result' : '',iShidden ? 'on' : '']">
|
||||
<view class="pictrue">
|
||||
<image :src="pinkT.avatar" />
|
||||
</view>
|
||||
<view class="acea-row row-middle" v-if="pinkAll.length > 0">
|
||||
<view class="pictrue" v-for="(item, pinkAllIndex) in pinkAll" :key="pinkAllIndex">
|
||||
<image :src="item.avatar" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="pictrue" v-for="countIndex in count" :key="countIndex">
|
||||
<image class="img-none" src="@/static/images/vacancy.png" />
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="(pinkBool === 1 || pinkBool === -1) && count > 9" class="lookAll acea-row row-center-wrapper" @click="lookAll">
|
||||
{{ iShidden ? "收起" : "查看全部" }}
|
||||
<text class="iconfont" :class="iShidden ? 'icon-xiangshang' : 'icon-xiangxia'"></text>
|
||||
</view>
|
||||
<view class="teamBnt bg-color-red" v-if="userBool === 1 && isOk == 0 && pinkBool === 0" @click="goPoster">邀请好友参团</view>
|
||||
<view class="teamBnt bg-color-red" v-else-if="userBool === 0 && pinkBool === 0 && count > 0" @click="pay">我要参团</view>
|
||||
<view class="teamBnt bg-color-red" v-if="pinkBool === 1 || pinkBool === -1" @click="goDetail(storeCombination.id)">再次开团</view>
|
||||
<view class="cancel" @click="getCombinationRemove" v-if="pinkBool === 0 && userBool === 1">
|
||||
<text class="iconfont icon-guanbi3"></text>
|
||||
<text>取消开团</text>
|
||||
</view>
|
||||
<view class="lookOrder" v-if="pinkBool === 1" @click="goOrder">
|
||||
<text>查看订单信息</text>
|
||||
<text class="iconfont icon-xiangyou"></text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="group-con">
|
||||
<view class="header acea-row row-between-wrapper">
|
||||
<view class="pictrue">
|
||||
<image :src="storeCombination.image" />
|
||||
</view>
|
||||
<view class="text">
|
||||
<view class="line1" v-text="storeCombination.title"></view>
|
||||
<view class="money">
|
||||
<text>¥</text>
|
||||
<text class="num" v-text="storeCombination.price"></text>
|
||||
<text class="team cart-color" v-text="storeCombination.people + '人拼'"></text>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="pinkBool === -1" class="iconfont icon-pintuanshibai"></view>
|
||||
<view v-else-if="pinkBool === 1" class="iconfont icon-pintuanchenggong font-color-red"></view>
|
||||
</view>
|
||||
<view class="wrapper">
|
||||
<view class="title acea-row row-center-wrapper">
|
||||
<view class="line"></view>
|
||||
<view class="name acea-row row-center-wrapper">
|
||||
<text>剩余</text>
|
||||
<count-down
|
||||
:isDay="false"
|
||||
:tipText="false"
|
||||
:dayText="false"
|
||||
:hourText="' : '"
|
||||
:minuteText="' : '"
|
||||
:secondText="false"
|
||||
:datatime="pinkT.stopTime"
|
||||
></count-down>
|
||||
<text>结束</text>
|
||||
</view>
|
||||
<view class="line"></view>
|
||||
</view>
|
||||
<view class="tips-warp">
|
||||
<text class="tips font-color-red" v-if="pinkBool === 1">恭喜您拼团成功</text>
|
||||
<text class="tips" v-else-if="pinkBool === -1">还差{{ count }}人,拼团失败</text>
|
||||
<text class="tips font-color-red" v-else-if="pinkBool === 0">拼团中,还差{{ count }}人拼团成功</text>
|
||||
</view>
|
||||
<view
|
||||
class="list acea-row row-middle"
|
||||
:class="[pinkBool === 1 || pinkBool === -1 ? 'result' : '',iShidden ? 'on' : '']"
|
||||
>
|
||||
<view class="pictrue">
|
||||
<image :src="pinkT.avatar" />
|
||||
</view>
|
||||
<view class="acea-row row-middle" v-if="pinkAll.length > 0">
|
||||
<view class="pictrue" v-for="(item, pinkAllIndex) in pinkAll" :key="pinkAllIndex">
|
||||
<image :src="item.avatar" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="pictrue" v-for="countIndex in count" :key="countIndex">
|
||||
<image class="img-none" src="@/static/images/vacancy.png" />
|
||||
</view>
|
||||
</view>
|
||||
<view
|
||||
v-if="(pinkBool === 1 || pinkBool === -1) && count > 9"
|
||||
class="lookAll acea-row row-center-wrapper"
|
||||
@click="lookAll"
|
||||
>
|
||||
{{ iShidden ? "收起" : "查看全部" }}
|
||||
<text class="iconfont" :class="iShidden ? 'icon-xiangshang' : 'icon-xiangxia'"></text>
|
||||
</view>
|
||||
<view
|
||||
class="teamBnt bg-color-red"
|
||||
v-if="userBool === 1 && isOk == 0 && pinkBool === 0"
|
||||
@click="goPoster"
|
||||
>邀请好友参团</view>
|
||||
<view
|
||||
class="teamBnt bg-color-red"
|
||||
v-else-if="userBool === 0 && pinkBool === 0 && count > 0"
|
||||
@click="pay"
|
||||
>我要参团</view>
|
||||
<view
|
||||
class="teamBnt bg-color-red"
|
||||
v-if="pinkBool === 1 || pinkBool === -1"
|
||||
@click="goDetail(storeCombination.id)"
|
||||
>再次开团</view>
|
||||
<view class="cancel" @click="getCombinationRemove" v-if="pinkBool === 0 && userBool === 1">
|
||||
<text class="iconfont icon-guanbi3"></text>
|
||||
<text>取消开团</text>
|
||||
</view>
|
||||
<view class="lookOrder" v-if="pinkBool === 1" @click="goOrder">
|
||||
<text>查看订单信息</text>
|
||||
<text class="iconfont icon-xiangyou"></text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
import CountDown from "@/components/CountDown";
|
||||
import {
|
||||
getCombinationPink,
|
||||
getCombinationRemove
|
||||
} from "@/api/activity";
|
||||
import {
|
||||
postCartAdd
|
||||
} from "@/api/store";
|
||||
import {
|
||||
isWeixin,
|
||||
parseQuery,
|
||||
handleQrCode
|
||||
} from "@/utils/index";
|
||||
import CountDown from "@/components/CountDown";
|
||||
import { getCombinationPink, getCombinationRemove } from "@/api/activity";
|
||||
import { postCartAdd } from "@/api/store";
|
||||
import { isWeixin, parseQuery, handleQrCode } from "@/utils/index";
|
||||
|
||||
const NAME = "GroupRule";
|
||||
export default {
|
||||
name: NAME,
|
||||
components: {
|
||||
CountDown
|
||||
},
|
||||
props: {},
|
||||
data: function() {
|
||||
return {
|
||||
currentPinkOrder: "", //当前拼团订单
|
||||
isOk: 0, //判断拼团是否完成
|
||||
pinkBool: 0, //判断拼团是否成功|0=失败,1=成功
|
||||
userBool: 0, //判断当前用户是否在团内|0=未在,1=在
|
||||
pinkAll: [], //团员
|
||||
pinkT: [], //团长信息
|
||||
storeCombination: [], //拼团产品
|
||||
pinkId: 0,
|
||||
count: 0, //拼团剩余人数
|
||||
iShidden: false
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
$yroute(n) {
|
||||
var that = this;
|
||||
if (n.name === NAME) {
|
||||
that.pinkId = that.$yroute.query.id;
|
||||
that.getCombinationPink();
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted: function() {
|
||||
var that = this;
|
||||
let url = handleQrCode();
|
||||
if (url) {
|
||||
that.pinkId = url.pinkId;
|
||||
} else {
|
||||
that.pinkId = that.$yroute.query.id;
|
||||
}
|
||||
that.getCombinationPink();
|
||||
},
|
||||
methods: {
|
||||
pay: function() {
|
||||
var that = this;
|
||||
var data = {};
|
||||
data.productId = that.storeCombination.productId;
|
||||
data.cartNum = that.pinkT.totalNum;
|
||||
data.uniqueId = "";
|
||||
data.combinationId = that.storeCombination.id;
|
||||
data.new = 1;
|
||||
postCartAdd(data)
|
||||
.then(res => {
|
||||
that.$yrouter.push({
|
||||
path: "/pages/order/OrderSubmission/index",
|
||||
query: {
|
||||
id: res.data.cartId,
|
||||
pinkid: that.pinkId
|
||||
}
|
||||
});
|
||||
})
|
||||
.catch(err => {
|
||||
uni.showToast({
|
||||
title: err.msg || err.response.data.msg,
|
||||
icon: 'none',
|
||||
duration: 2000
|
||||
});
|
||||
});
|
||||
},
|
||||
goPoster: function() {
|
||||
var that = this;
|
||||
this.$yrouter.push({
|
||||
path: "/pages/activity/Poster/index",
|
||||
query: {
|
||||
id: that.pinkId,
|
||||
type: 1
|
||||
}
|
||||
});
|
||||
},
|
||||
goOrder: function() {
|
||||
var that = this;
|
||||
this.$yrouter.push({
|
||||
path: "/pages/order/OrderDetails/index",
|
||||
query: {
|
||||
id: that.currentPinkOrder
|
||||
}
|
||||
});
|
||||
},
|
||||
//拼团列表
|
||||
goList: function() {
|
||||
this.$yrouter.push({
|
||||
path: "/pages/activity/GoodsGroup/index"
|
||||
});
|
||||
},
|
||||
//拼团详情
|
||||
goDetail: function(id) {
|
||||
this.$yrouter.push({
|
||||
path: "/pages/activity/GroupDetails/index",
|
||||
query: {
|
||||
id
|
||||
}
|
||||
});
|
||||
},
|
||||
//拼团信息
|
||||
getCombinationPink: function() {
|
||||
var that = this;
|
||||
getCombinationPink(that.pinkId).then(res => {
|
||||
that.$set(that, "storeCombination", res.data.storeCombination);
|
||||
that.$set(that, "pinkT", res.data.pinkT);
|
||||
that.$set(that, "pinkAll", res.data.pinkAll);
|
||||
that.$set(that, "count", res.data.count);
|
||||
that.$set(that, "userBool", res.data.userBool);
|
||||
that.$set(that, "pinkBool", res.data.pinkBool);
|
||||
that.$set(that, "isOk", res.data.isOk);
|
||||
that.$set(that, "currentPinkOrder", res.data.currentPinkOrder);
|
||||
});
|
||||
},
|
||||
//拼团取消
|
||||
getCombinationRemove: function() {
|
||||
var that = this;
|
||||
getCombinationRemove({
|
||||
id: that.pinkId,
|
||||
cid: that.storeCombination.id
|
||||
})
|
||||
.then(res => {
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
icon: "none",
|
||||
duration: 2000
|
||||
});
|
||||
})
|
||||
.catch(res => {
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
icon: "none",
|
||||
duration: 2000
|
||||
});
|
||||
});
|
||||
},
|
||||
lookAll: function() {
|
||||
this.iShidden = !this.iShidden;
|
||||
}
|
||||
}
|
||||
};
|
||||
const NAME = "GroupRule";
|
||||
export default {
|
||||
name: NAME,
|
||||
components: {
|
||||
CountDown
|
||||
},
|
||||
props: {},
|
||||
data: function() {
|
||||
return {
|
||||
currentPinkOrder: "", //当前拼团订单
|
||||
isOk: 0, //判断拼团是否完成
|
||||
pinkBool: 0, //判断拼团是否成功|0=失败,1=成功
|
||||
userBool: 0, //判断当前用户是否在团内|0=未在,1=在
|
||||
pinkAll: [], //团员
|
||||
pinkT: [], //团长信息
|
||||
storeCombination: [], //拼团产品
|
||||
pinkId: 0,
|
||||
count: 0, //拼团剩余人数
|
||||
iShidden: false
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
$yroute(n) {
|
||||
var that = this;
|
||||
if (n.name === NAME) {
|
||||
that.pinkId = that.$yroute.query.id;
|
||||
that.getCombinationPink();
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted: function() {
|
||||
var that = this;
|
||||
let url = handleQrCode();
|
||||
if (url) {
|
||||
that.pinkId = url.pinkId;
|
||||
} else {
|
||||
that.pinkId = that.$yroute.query.id;
|
||||
}
|
||||
that.getCombinationPink();
|
||||
},
|
||||
methods: {
|
||||
pay: function() {
|
||||
var that = this;
|
||||
var data = {};
|
||||
data.productId = that.storeCombination.productId;
|
||||
data.cartNum = that.pinkT.totalNum;
|
||||
data.uniqueId = "";
|
||||
data.combinationId = that.storeCombination.id;
|
||||
data.new = 1;
|
||||
postCartAdd(data)
|
||||
.then(res => {
|
||||
that.$yrouter.push({
|
||||
path: "/pages/order/OrderSubmission/index",
|
||||
query: {
|
||||
id: res.data.cartId,
|
||||
pinkid: that.pinkId
|
||||
}
|
||||
});
|
||||
})
|
||||
.catch(err => {
|
||||
uni.showToast({
|
||||
title: err.msg || err.response.data.msg,
|
||||
icon: "none",
|
||||
duration: 2000
|
||||
});
|
||||
});
|
||||
},
|
||||
goPoster: function() {
|
||||
var that = this;
|
||||
this.$yrouter.push({
|
||||
path: "/pages/activity/Poster/index",
|
||||
query: {
|
||||
id: that.pinkId,
|
||||
type: 1
|
||||
}
|
||||
});
|
||||
},
|
||||
goOrder: function() {
|
||||
var that = this;
|
||||
this.$yrouter.push({
|
||||
path: "/pages/order/OrderDetails/index",
|
||||
query: {
|
||||
id: that.currentPinkOrder
|
||||
}
|
||||
});
|
||||
},
|
||||
//拼团列表
|
||||
goList: function() {
|
||||
this.$yrouter.push({
|
||||
path: "/pages/activity/GoodsGroup/index"
|
||||
});
|
||||
},
|
||||
//拼团详情
|
||||
goDetail: function(id) {
|
||||
this.$yrouter.push({
|
||||
path: "/pages/activity/GroupDetails/index",
|
||||
query: {
|
||||
id
|
||||
}
|
||||
});
|
||||
},
|
||||
//拼团信息
|
||||
getCombinationPink: function() {
|
||||
var that = this;
|
||||
getCombinationPink(that.pinkId).then(res => {
|
||||
that.$set(that, "storeCombination", res.data.storeCombination);
|
||||
that.$set(that, "pinkT", res.data.pinkT);
|
||||
that.$set(that, "pinkAll", res.data.pinkAll);
|
||||
that.$set(that, "count", res.data.count);
|
||||
that.$set(that, "userBool", res.data.userBool);
|
||||
that.$set(that, "pinkBool", res.data.pinkBool);
|
||||
that.$set(that, "isOk", res.data.isOk);
|
||||
that.$set(that, "currentPinkOrder", res.data.currentPinkOrder);
|
||||
});
|
||||
},
|
||||
//拼团取消
|
||||
getCombinationRemove: function() {
|
||||
var that = this;
|
||||
getCombinationRemove({
|
||||
id: that.pinkId,
|
||||
cid: that.storeCombination.id
|
||||
})
|
||||
.then(res => {
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
icon: "none",
|
||||
duration: 2000
|
||||
});
|
||||
})
|
||||
.catch(res => {
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
icon: "none",
|
||||
duration: 2000
|
||||
});
|
||||
});
|
||||
},
|
||||
lookAll: function() {
|
||||
this.iShidden = !this.iShidden;
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="less">
|
||||
.tips-warp{
|
||||
text-align: center;
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
</style>
|
||||
|
@ -11,12 +11,12 @@
|
||||
<view class="times">
|
||||
<view>距秒杀结束仅剩</view>
|
||||
<count-down
|
||||
:is-day="false"
|
||||
:tip-text="''"
|
||||
:day-text="''"
|
||||
:hour-text="' : '"
|
||||
:minute-text="' : '"
|
||||
:second-text="''"
|
||||
:isDay="false"
|
||||
:tipText="false"
|
||||
:dayText="false"
|
||||
:hourText="' : '"
|
||||
:minuteText="' : '"
|
||||
:secondText="false"
|
||||
:datatime="datatime"
|
||||
></count-down>
|
||||
</view>
|
||||
@ -39,13 +39,13 @@
|
||||
</view>
|
||||
<view style="height:100rpx;"></view>
|
||||
<view class="footerRush acea-row row-between-wrapper">
|
||||
<view
|
||||
<!-- <view
|
||||
class="customerSer acea-row row-center-wrapper row-column"
|
||||
@click="routerGo()"
|
||||
>
|
||||
<view class="iconfont icon-kefu"></view>
|
||||
<view>客服</view>
|
||||
</view>
|
||||
</view> -->
|
||||
<view class="bnt bg-color-red" @click="tapBuy">立即购买</view>
|
||||
</view>
|
||||
<ProductWindow v-on:changeFun="changeFun" :attr="attr" :cartNum="cartNum"></ProductWindow>
|
||||
|
@ -43,7 +43,7 @@
|
||||
<image class="bg" src="../../static/images/index-bg.png" mode="widthFix"></image>
|
||||
<view class="title acea-row row-between-wrapper">
|
||||
<view class="text"><view class="name line1">热门榜单</view></view>
|
||||
<view @click="goHotNewGoods()" class="more">
|
||||
<view @click="goHotNewGoods(2)" class="more">
|
||||
更多
|
||||
<text class="iconfont icon-jiantou"></text>
|
||||
</view>
|
||||
@ -53,8 +53,8 @@
|
||||
<view class="newProductsScroll">
|
||||
<view @click="goGoodsCon(item)" class="newProductsItem" v-for="(item, likeInfoIndex) in likeInfo" :key="likeInfoIndex">
|
||||
<view class="img-box"><image :src="item.image" /></view>
|
||||
<view class="pro-info line1">{{ item.storeName }}</view>
|
||||
<view class="money font-color-red">¥{{ item.price }}</view>
|
||||
<view class="pro-info line1"><text>{{ item.storeName }}</text></view>
|
||||
<view class="money font-color-red"><text>¥{{ item.price }}</text></view>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
@ -99,7 +99,7 @@
|
||||
<view class="wrapper" v-if="benefit.length > 0">
|
||||
<view class="title acea-row row-between-wrapper">
|
||||
<view class="text"><view class="name line1">促销单品</view></view>
|
||||
<view @click="goGoodsPromotion()" class="more">
|
||||
<view @click="goGoodsPromotion(4)" class="more">
|
||||
更多
|
||||
<text class="iconfont icon-jiantou"></text>
|
||||
</view>
|
||||
|
@ -107,31 +107,18 @@
|
||||
</view>
|
||||
<view class="totalPrice">
|
||||
共{{ order.cartInfo.length || 0 }}件商品,总金额
|
||||
<text
|
||||
class="money font-color-red"
|
||||
>¥{{ order.payPrice }}</text>
|
||||
<text class="money font-color-red">¥{{ order.payPrice }}</text>
|
||||
</view>
|
||||
<view class="bottom acea-row row-right row-middle">
|
||||
<template v-if="order._status._type == 0">
|
||||
<view class="bnt cancelBnt" @click="cancelOrder(order)">取消订单</view>
|
||||
<view
|
||||
class="bnt bg-color-red"
|
||||
@click="goOrderDetails(order)"
|
||||
>立即付款</view>
|
||||
<view class="bnt bg-color-red" @click="goOrderDetails(order)">立即付款</view>
|
||||
</template>
|
||||
<template v-if="order._status._type == 1 || order._status._type == 9">
|
||||
<view
|
||||
class="bnt bg-color-red"
|
||||
@click="goOrderDetails(order)"
|
||||
>查看详情</view>
|
||||
<view class="bnt bg-color-red" @click="goOrderDetails(order)">查看详情</view>
|
||||
</template>
|
||||
<template v-if="order._status._type == 2">
|
||||
<view
|
||||
class="bnt default"
|
||||
@click="
|
||||
$yrouter.push({ path: '/pages/order/Logistics/index',query:{id:order.orderId}})
|
||||
"
|
||||
>查看物流</view>
|
||||
<view class="bnt default" @click="goLogistics(order)">查看物流</view>
|
||||
<view class="bnt bg-color-red" @click="takeOrder(order)">确认收货</view>
|
||||
</template>
|
||||
<template v-if="order._status._type == 3">
|
||||
@ -144,16 +131,10 @@
|
||||
<!-->-->
|
||||
<!--查看物流-->
|
||||
<!--</view>-->
|
||||
<view
|
||||
class="bnt bg-color-red"
|
||||
@click="goOrderDetails(order)"
|
||||
>去评价</view>
|
||||
<view class="bnt bg-color-red" @click="goOrderDetails(order)">去评价</view>
|
||||
</template>
|
||||
<template v-if="order._status._type === 4">
|
||||
<view
|
||||
class="bnt bg-color-red"
|
||||
@click="goOrderDetails(order)"
|
||||
>查看订单</view>
|
||||
<view class="bnt bg-color-red" @click="goOrderDetails(order)">查看订单</view>
|
||||
</template>
|
||||
</view>
|
||||
</view>
|
||||
@ -231,6 +212,12 @@ export default {
|
||||
type() {}
|
||||
},
|
||||
methods: {
|
||||
goLogistics(order) {
|
||||
this.$yrouter.push({
|
||||
path: "/pages/order/Logistics/index",
|
||||
query: { id: order.orderId }
|
||||
});
|
||||
},
|
||||
goOrderDetails(order) {
|
||||
this.$yrouter.push({
|
||||
path: "/pages/order/OrderDetails/index",
|
||||
@ -333,20 +320,21 @@ export default {
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
|
||||
.noCart {
|
||||
margin-top: 0.17*100rpx;
|
||||
padding-top: 0.1*100rpx;
|
||||
margin-top: 0.17 * 100rpx;
|
||||
padding-top: 0.1 * 100rpx;
|
||||
}
|
||||
|
||||
.noCart .pictrue {
|
||||
width: 4*100rpx;
|
||||
height: 3*100rpx;
|
||||
width: 4 * 100rpx;
|
||||
height: 3 * 100rpx;
|
||||
overflow: hidden;
|
||||
margin: 0.7*100rpx auto 0.5*100rpx auto;
|
||||
margin: 0.7 * 100rpx auto 0.5 * 100rpx auto;
|
||||
}
|
||||
|
||||
.noCart .pictrue image{
|
||||
width: 4*100rpx;
|
||||
height: 3*100rpx;
|
||||
.noCart .pictrue image {
|
||||
width: 4 * 100rpx;
|
||||
height: 3 * 100rpx;
|
||||
}
|
||||
</style>
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -58,7 +58,7 @@
|
||||
当前积分
|
||||
<text class="num font-color-red">{{ userInfo.integral || 0 }}</text>
|
||||
</text>
|
||||
<checkbox value :checked="useIntegral ? true : false"></checkbox>
|
||||
<checkbox value="true" :checked="useIntegral ? true : false"></checkbox>
|
||||
</label>
|
||||
</checkbox-group>
|
||||
</view>
|
||||
@ -345,6 +345,7 @@
|
||||
},
|
||||
changeUseIntegral: function(e) {
|
||||
// this.computedPrice();
|
||||
console.log(e)
|
||||
this.useIntegral = e.mp.detail.value[0];
|
||||
},
|
||||
computedPrice() {
|
||||
|
@ -17,7 +17,7 @@
|
||||
<view class="num">{{ census.orderCount.evaluatedCount }}</view>
|
||||
<view>待评价</view>
|
||||
</view>
|
||||
<view class="item" @click="goAdminOrderList(3)">
|
||||
<view class="item" @click="goAdminOrderList(4)">
|
||||
<view class="num">{{ census.orderCount.refundCount }}</view>
|
||||
<view>退款</view>
|
||||
</view>
|
||||
|
@ -20,8 +20,8 @@
|
||||
</view>
|
||||
</view>
|
||||
<view class="conter">
|
||||
<view class="listw" v-for="(item, eq) in category" :key="eq">
|
||||
<view v-if="eq === navActive">
|
||||
<view v-for="(item, eq) in category" :key="eq">
|
||||
<view class="listw" v-if="eq === navActive">
|
||||
<view class="title acea-row row-center-wrapper" ref="title">
|
||||
<view class="line"></view>
|
||||
<view class="name">{{ item.cateName }}</view>
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -56,7 +56,7 @@ export default {
|
||||
} else if (type === "2") {
|
||||
this.name = "热门榜单";
|
||||
this.icon = "icon-remen";
|
||||
document.title = "热门榜单";
|
||||
// document.title = "热门榜单";
|
||||
} else if (type === "3") {
|
||||
this.name = "首发新品";
|
||||
this.icon = "icon-xinpin";
|
||||
@ -71,11 +71,11 @@ export default {
|
||||
that.imgUrls = res.data.banner;
|
||||
that.goodsList = res.data.list;
|
||||
})
|
||||
.catch((err)=> {
|
||||
uni.showToast({
|
||||
title: err.msg || err.response.data.msg,
|
||||
icon: 'none',
|
||||
duration: 2000
|
||||
.catch((err)=> {
|
||||
uni.showToast({
|
||||
title: err.msg || err.response.data.msg,
|
||||
icon: 'none',
|
||||
duration: 2000
|
||||
});
|
||||
});
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<view class="shoppingCart">
|
||||
<view class v-if="userInfo.uid">
|
||||
<view v-if="$store.getters.token||userInfo.uid">
|
||||
<view class="labelNav acea-row row-around row-middle">
|
||||
<view class="item">
|
||||
<text class="iconfont icon-xuanzhong"></text>
|
||||
@ -130,7 +130,7 @@
|
||||
<view class="placeOrder bg-color-red" @click="placeOrder">立即下单</view>
|
||||
</view>
|
||||
<view class="button acea-row row-middle" v-else>
|
||||
<view class="bnt cart-color" @click="collectAll">收藏</view>
|
||||
<!-- <view class="bnt cart-color" @click="collectAll">收藏</view> -->
|
||||
<view class="bnt" @click="delgoods">删除</view>
|
||||
</view>
|
||||
</view>
|
||||
|
@ -1,364 +1,384 @@
|
||||
<template>
|
||||
<view class="user">
|
||||
<view v-if="userInfo.uid">
|
||||
<view class="header bg-color-red acea-row row-between-wrapper">
|
||||
<view class="picTxt acea-row row-between-wrapper">
|
||||
<view class="pictrue">
|
||||
<image :src="userInfo.avatar" />
|
||||
</view>
|
||||
<view class="text">
|
||||
<view class="acea-row row-middle">
|
||||
<view class="name line1">{{ userInfo.nickname }}</view>
|
||||
<view class="member acea-row row-middle" v-if="userInfo.vip">
|
||||
<image :src="userInfo.vipIcon" />
|
||||
<text>{{ userInfo.vipName }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view @click="goPersonalData()" class="id" v-if="userInfo.phone">
|
||||
<text>ID:{{ userInfo.uid || 0}}</text>
|
||||
<text class="iconfont icon-bianji1"></text>
|
||||
</view>
|
||||
<button open-type="getPhoneNumber" @getphonenumber="getPhoneNumber" class="binding" v-else>
|
||||
<text>绑定手机号</text>
|
||||
</button>
|
||||
</view>
|
||||
</view>
|
||||
<text class="iconfont icon-shezhi" @click="goPersonalData()"></text>
|
||||
</view>
|
||||
<view class="wrapper">
|
||||
<view class="nav acea-row row-middle">
|
||||
<view @click="goUserAccount()" class="item">
|
||||
<text>我的余额</text>
|
||||
<text class="num">{{ userInfo.nowMoney || 0 }}</text>
|
||||
</view>
|
||||
<view @click="goUserPromotion()" class="item" v-if="userInfo.isPromoter === 1 || userInfo.statu === 2">
|
||||
<text>当前佣金</text>
|
||||
<text class="num">{{ userInfo.brokeragePrice || 0 }}</text>
|
||||
</view>
|
||||
<view @click="goIntegral()" class="item" v-else>
|
||||
<text>当前积分</text>
|
||||
<text class="num">{{ userInfo.integral || 0 }}</text>
|
||||
</view>
|
||||
<view @click="goUserCoupon()" class="item">
|
||||
<text>优惠券</text>
|
||||
<text class="num">{{ userInfo.couponCount || 0 }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="myOrder">
|
||||
<view class="title acea-row row-between-wrapper">
|
||||
<text>我的订单</text>
|
||||
<text @click="goMyOrder()" class="allOrder">
|
||||
<text>全部订单</text>
|
||||
<text class="iconfont icon-jiantou"></text>
|
||||
</text>
|
||||
</view>
|
||||
<view class="orderState acea-row row-middle">
|
||||
<view @click="goMyOrder(0)" class="item">
|
||||
<view class="pictrue">
|
||||
<image src="@/static/images/dfk.png" />
|
||||
<text class="order-status-num" v-if="userInfo.orderStatusNum.unpaidCount > 0">{{ userInfo.orderStatusNum.unpaidCount }}</text>
|
||||
</view>
|
||||
<view>待付款</view>
|
||||
</view>
|
||||
<view @click="goMyOrder(1)" class="item">
|
||||
<view class="pictrue">
|
||||
<image src="@/static/images/dfh.png" />
|
||||
<text class="order-status-num" v-if="userInfo.orderStatusNum.unshippedCount > 0">{{ userInfo.orderStatusNum.unshippedCount }}</text>
|
||||
</view>
|
||||
<view>待发货</view>
|
||||
</view>
|
||||
<view @click="goMyOrder(2)" class="item">
|
||||
<view class="pictrue">
|
||||
<image src="@/static/images/dsh.png" />
|
||||
<text class="order-status-num" v-if="userInfo.orderStatusNum.receivedCount > 0">{{ userInfo.orderStatusNum.receivedCount }}</text>
|
||||
</view>
|
||||
<text>待收货</text>
|
||||
</view>
|
||||
<view @click="goMyOrder(3)" class="item">
|
||||
<view class="pictrue">
|
||||
<image src="@/static/images/dpj.png" />
|
||||
<text class="order-status-num" v-if="userInfo.orderStatusNum.evaluatedCount > 0">{{ userInfo.orderStatusNum.evaluatedCount }}</text>
|
||||
</view>
|
||||
<text>待评价</text>
|
||||
</view>
|
||||
<view @click="goReturnList()" class="item">
|
||||
<view class="pictrue">
|
||||
<image src="@/static/images/sh.png" />
|
||||
<text class="order-status-num" v-if="userInfo.orderStatusNum.refundCount > 0">{{ userInfo.orderStatusNum.refundCount }}</text>
|
||||
</view>
|
||||
<text>售后/退款</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="myService">
|
||||
<view class="title acea-row row-middle">
|
||||
<text>我的服务</text>
|
||||
</view>
|
||||
<view class="serviceList acea-row row-middle">
|
||||
<template v-for="(item, MyMenusIndex) in MyMenus">
|
||||
<view class="item" :key="MyMenusIndex" @click="goPages(MyMenusIndex)" v-if="item.url">
|
||||
<view class="pictrue">
|
||||
<image :src="item.pic" />
|
||||
</view>
|
||||
<view>{{ item.name }}</view>
|
||||
</view>
|
||||
</template>
|
||||
</view>
|
||||
</view>
|
||||
<!--<view -->
|
||||
<!--class="item"-->
|
||||
<!--@click="changeswitch(true)"-->
|
||||
<!--v-if="userInfo.phone && isWeixin"-->
|
||||
<!-->-->
|
||||
<!--<view class="pictrue"><image src="@/static/images/switch.png" /></view>-->
|
||||
<!--<view>账号切换</!--<view>-->
|
||||
<!--</!--<view>-->
|
||||
<!-- </view>
|
||||
<view class="user">
|
||||
<view v-if="$store.getters.token||userInfo.uid">
|
||||
<view class="header bg-color-red acea-row row-between-wrapper">
|
||||
<view class="picTxt acea-row row-between-wrapper">
|
||||
<view class="pictrue">
|
||||
<image :src="userInfo.avatar" />
|
||||
</view>
|
||||
<view class="text">
|
||||
<view class="acea-row row-middle">
|
||||
<view class="name line1">{{ userInfo.nickname }}</view>
|
||||
<view class="member acea-row row-middle" v-if="userInfo.vip">
|
||||
<image :src="userInfo.vipIcon" />
|
||||
<text>{{ userInfo.vipName }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view @click="goPersonalData()" class="id" v-if="userInfo.phone">
|
||||
<text>ID:{{ userInfo.uid || 0}}</text>
|
||||
<text class="iconfont icon-bianji1"></text>
|
||||
</view>
|
||||
<button
|
||||
open-type="getPhoneNumber"
|
||||
@getphonenumber="getPhoneNumber"
|
||||
class="binding"
|
||||
v-else
|
||||
>
|
||||
<text>绑定手机号</text>
|
||||
</button>
|
||||
</view>
|
||||
</view>
|
||||
<text class="iconfont icon-shezhi" @click="goPersonalData()"></text>
|
||||
</view>
|
||||
<view class="wrapper">
|
||||
<view class="nav acea-row row-middle">
|
||||
<view @click="goUserAccount()" class="item">
|
||||
<text>我的余额</text>
|
||||
<text class="num">{{ userInfo.nowMoney || 0 }}</text>
|
||||
</view>
|
||||
<view
|
||||
@click="goUserPromotion()"
|
||||
class="item"
|
||||
v-if="userInfo.isPromoter === 1 || userInfo.statu === 2"
|
||||
>
|
||||
<text>当前佣金</text>
|
||||
<text class="num">{{ userInfo.brokeragePrice || 0 }}</text>
|
||||
</view>
|
||||
<view @click="goIntegral()" class="item" v-else>
|
||||
<text>当前积分</text>
|
||||
<text class="num">{{ userInfo.integral || 0 }}</text>
|
||||
</view>
|
||||
<view @click="goUserCoupon()" class="item">
|
||||
<text>优惠券</text>
|
||||
<text class="num">{{ userInfo.couponCount || 0 }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="myOrder">
|
||||
<view class="title acea-row row-between-wrapper">
|
||||
<text>我的订单</text>
|
||||
<text @click="goMyOrder()" class="allOrder">
|
||||
<text>全部订单</text>
|
||||
<text class="iconfont icon-jiantou"></text>
|
||||
</text>
|
||||
</view>
|
||||
<view class="orderState acea-row row-middle">
|
||||
<view @click="goMyOrder(0)" class="item">
|
||||
<view class="pictrue">
|
||||
<image src="@/static/images/dfk.png" />
|
||||
<text
|
||||
class="order-status-num"
|
||||
v-if="userInfo.orderStatusNum.unpaidCount > 0"
|
||||
>{{ userInfo.orderStatusNum.unpaidCount }}</text>
|
||||
</view>
|
||||
<view>待付款</view>
|
||||
</view>
|
||||
<view @click="goMyOrder(1)" class="item">
|
||||
<view class="pictrue">
|
||||
<image src="@/static/images/dfh.png" />
|
||||
<text
|
||||
class="order-status-num"
|
||||
v-if="userInfo.orderStatusNum.unshippedCount > 0"
|
||||
>{{ userInfo.orderStatusNum.unshippedCount }}</text>
|
||||
</view>
|
||||
<view>待发货</view>
|
||||
</view>
|
||||
<view @click="goMyOrder(2)" class="item">
|
||||
<view class="pictrue">
|
||||
<image src="@/static/images/dsh.png" />
|
||||
<text
|
||||
class="order-status-num"
|
||||
v-if="userInfo.orderStatusNum.receivedCount > 0"
|
||||
>{{ userInfo.orderStatusNum.receivedCount }}</text>
|
||||
</view>
|
||||
<text>待收货</text>
|
||||
</view>
|
||||
<view @click="goMyOrder(3)" class="item">
|
||||
<view class="pictrue">
|
||||
<image src="@/static/images/dpj.png" />
|
||||
<text
|
||||
class="order-status-num"
|
||||
v-if="userInfo.orderStatusNum.evaluatedCount > 0"
|
||||
>{{ userInfo.orderStatusNum.evaluatedCount }}</text>
|
||||
</view>
|
||||
<text>待评价</text>
|
||||
</view>
|
||||
<view @click="goReturnList()" class="item">
|
||||
<view class="pictrue">
|
||||
<image src="@/static/images/sh.png" />
|
||||
<text
|
||||
class="order-status-num"
|
||||
v-if="userInfo.orderStatusNum.refundCount > 0"
|
||||
>{{ userInfo.orderStatusNum.refundCount }}</text>
|
||||
</view>
|
||||
<text>售后/退款</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="myService">
|
||||
<view class="title acea-row row-middle">
|
||||
<text>我的服务</text>
|
||||
</view>
|
||||
<view class="serviceList acea-row row-middle">
|
||||
<template v-for="(item, MyMenusIndex) in MyMenus">
|
||||
<view
|
||||
class="item"
|
||||
:key="MyMenusIndex"
|
||||
@click="goPages(MyMenusIndex)"
|
||||
v-if="item.url&&item.id!='230'"
|
||||
>
|
||||
<view class="pictrue">
|
||||
<image :src="item.pic" />
|
||||
</view>
|
||||
<view>{{ item.name }}</view>
|
||||
</view>
|
||||
</template>
|
||||
</view>
|
||||
</view>
|
||||
<!--<view -->
|
||||
<!--class="item"-->
|
||||
<!--@click="changeswitch(true)"-->
|
||||
<!--v-if="userInfo.phone && isWeixin"-->
|
||||
<!-->-->
|
||||
<!--<view class="pictrue"><image src="@/static/images/switch.png" /></view>-->
|
||||
<!--<view>账号切换</!--<view>-->
|
||||
<!--</!--<view>-->
|
||||
<!-- </view>
|
||||
</view>-->
|
||||
</view>
|
||||
<view class="by">
|
||||
<text class="by-text">By@意象</text>
|
||||
</view>
|
||||
<view class="by">
|
||||
<view>
|
||||
<text class="by-text">Copyright © 2020</text>
|
||||
</view>
|
||||
<view>
|
||||
<text class="by-text">漯河市大有前途网络科技有限公司</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="footer-line-height"></view>
|
||||
<!-- <SwitchWindow
|
||||
</view>
|
||||
<view class="by">
|
||||
<text class="by-text">By@意象</text>
|
||||
</view>
|
||||
<view class="by">
|
||||
<view>
|
||||
<text class="by-text">Copyright © 2020</text>
|
||||
</view>
|
||||
<view>
|
||||
<text class="by-text">漯河市大有前途网络科技有限公司</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="footer-line-height"></view>
|
||||
<!-- <SwitchWindow
|
||||
v-on:changeswitch="changeswitch"
|
||||
:switchActive="switchActive"
|
||||
:login_type="userInfo.login_type"
|
||||
></SwitchWindow> -->
|
||||
</view>
|
||||
<Authorization v-if="!$store.getters.token" />
|
||||
</view>
|
||||
></SwitchWindow>-->
|
||||
</view>
|
||||
<Authorization v-if="!$store.getters.token" />
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
import {
|
||||
getUser,
|
||||
getMenuUser,
|
||||
bindingPhone
|
||||
} from "@/api/user";
|
||||
import {
|
||||
isWeixin,
|
||||
VUE_APP_RESOURCES_URL
|
||||
} from "@/utils";
|
||||
import SwitchWindow from "@/components/SwitchWindow";
|
||||
import Authorization from "@/pages/authorization/index";
|
||||
import {
|
||||
mapGetters
|
||||
} from "vuex";
|
||||
import { getUser, getMenuUser, bindingPhone } from "@/api/user";
|
||||
import { isWeixin, VUE_APP_RESOURCES_URL } from "@/utils";
|
||||
import SwitchWindow from "@/components/SwitchWindow";
|
||||
import Authorization from "@/pages/authorization/index";
|
||||
import { mapGetters } from "vuex";
|
||||
|
||||
const NAME = "User";
|
||||
const NAME = "User";
|
||||
|
||||
export default {
|
||||
name: NAME,
|
||||
components: {
|
||||
SwitchWindow,
|
||||
Authorization
|
||||
},
|
||||
props: {},
|
||||
data: function() {
|
||||
return {
|
||||
MyMenus: [],
|
||||
switchActive: false,
|
||||
isWeixin: false
|
||||
};
|
||||
},
|
||||
computed: mapGetters(["userInfo"]),
|
||||
methods: {
|
||||
goReturnList() {
|
||||
this.$yrouter.push("/pages/order/ReturnList/index");
|
||||
},
|
||||
goMyOrder(type) {
|
||||
this.$yrouter.push({
|
||||
path: "/pages/order/MyOrder/index",
|
||||
query: {
|
||||
type
|
||||
}
|
||||
});
|
||||
},
|
||||
goUserCoupon() {
|
||||
this.$yrouter.push("/pages/user/coupon/UserCoupon/index");
|
||||
},
|
||||
goIntegral() {
|
||||
this.$yrouter.push("/pages/user/signIn/Integral/index");
|
||||
},
|
||||
goUserPromotion() {
|
||||
this.$yrouter.push("/pages/user/promotion/UserPromotion/index");
|
||||
},
|
||||
goUserAccount() {
|
||||
this.$yrouter.push({
|
||||
path: "/pages/user/UserAccount/index"
|
||||
});
|
||||
},
|
||||
goPersonalData() {
|
||||
this.$yrouter.push("/pages/user/PersonalData/index");
|
||||
},
|
||||
getPhoneNumber: function(e) {
|
||||
console.log(e.mp.detail);
|
||||
// 判断一下这里是不是小程序 如果是小程序,走获取微信手机号进行绑定
|
||||
if (e.mp.detail.errMsg == "getPhoneNumber:ok") {
|
||||
uni.showLoading({
|
||||
title: "绑定中"
|
||||
});
|
||||
// 获取当前环境的服务商
|
||||
uni.getProvider({
|
||||
service: "oauth",
|
||||
success: function(res) {
|
||||
console.log(res.provider);
|
||||
// 此处可以排除h5
|
||||
if (res.provider) {
|
||||
uni.login({
|
||||
success: loginRes => {
|
||||
bindingPhone({
|
||||
code: loginRes.code,
|
||||
encryptedData: e.mp.detail.encryptedData,
|
||||
iv: e.mp.detail.iv
|
||||
})
|
||||
.then(res => {
|
||||
this.User();
|
||||
uni.hideLoading();
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
icon: "success",
|
||||
duration: 2000
|
||||
});
|
||||
})
|
||||
.catch(error => {
|
||||
uni.showToast({
|
||||
title: error.msg || error.response.data.msg,
|
||||
icon: "none",
|
||||
duration: 2000
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: "已拒绝授权",
|
||||
icon: "none",
|
||||
duration: 2000
|
||||
});
|
||||
}
|
||||
},
|
||||
changeswitch: function(data) {
|
||||
this.switchActive = data;
|
||||
},
|
||||
User: function() {
|
||||
let that = this;
|
||||
// getUser().then(res => {
|
||||
// that.user = res.data;
|
||||
// that.orderStatusNum = res.data.orderStatusNum;
|
||||
// });
|
||||
},
|
||||
MenuUser: function() {
|
||||
let that = this;
|
||||
getMenuUser().then(res => {
|
||||
that.MyMenus = res.data.routine_my_menus;
|
||||
});
|
||||
},
|
||||
goPages: function(index) {
|
||||
let url = this.MyMenus[index].uniapp_url;
|
||||
if (
|
||||
url === "/pages/user/promotion/UserPromotion/index" &&
|
||||
this.userInfo.statu === 1
|
||||
) {
|
||||
if (!this.userInfo.isPromoter) {
|
||||
uni.showToast({
|
||||
title: "您还没有推广权限!!",
|
||||
icon: "none",
|
||||
duration: 2000
|
||||
});
|
||||
return;
|
||||
}
|
||||
}
|
||||
export default {
|
||||
name: NAME,
|
||||
components: {
|
||||
SwitchWindow,
|
||||
Authorization
|
||||
},
|
||||
props: {},
|
||||
data: function() {
|
||||
return {
|
||||
MyMenus: [],
|
||||
switchActive: false,
|
||||
isWeixin: false
|
||||
};
|
||||
},
|
||||
computed: mapGetters(["userInfo"]),
|
||||
methods: {
|
||||
goReturnList() {
|
||||
this.$yrouter.push("/pages/order/ReturnList/index");
|
||||
},
|
||||
goMyOrder(type) {
|
||||
this.$yrouter.push({
|
||||
path: "/pages/order/MyOrder/index",
|
||||
query: {
|
||||
type
|
||||
}
|
||||
});
|
||||
},
|
||||
goUserCoupon() {
|
||||
this.$yrouter.push("/pages/user/coupon/UserCoupon/index");
|
||||
},
|
||||
goIntegral() {
|
||||
this.$yrouter.push("/pages/user/signIn/Integral/index");
|
||||
},
|
||||
goUserPromotion() {
|
||||
this.$yrouter.push("/pages/user/promotion/UserPromotion/index");
|
||||
},
|
||||
goUserAccount() {
|
||||
this.$yrouter.push({
|
||||
path: "/pages/user/UserAccount/index"
|
||||
});
|
||||
},
|
||||
goPersonalData() {
|
||||
this.$yrouter.push("/pages/user/PersonalData/index");
|
||||
},
|
||||
getPhoneNumber: function(e) {
|
||||
console.log(e.mp.detail);
|
||||
// 判断一下这里是不是小程序 如果是小程序,走获取微信手机号进行绑定
|
||||
if (e.mp.detail.errMsg == "getPhoneNumber:ok") {
|
||||
uni.showLoading({
|
||||
title: "绑定中"
|
||||
});
|
||||
// 获取当前环境的服务商
|
||||
uni.getProvider({
|
||||
service: "oauth",
|
||||
success: function(res) {
|
||||
console.log(res.provider);
|
||||
// 此处可以排除h5
|
||||
if (res.provider) {
|
||||
uni.login({
|
||||
success: loginRes => {
|
||||
bindingPhone({
|
||||
code: loginRes.code,
|
||||
encryptedData: e.mp.detail.encryptedData,
|
||||
iv: e.mp.detail.iv
|
||||
})
|
||||
.then(res => {
|
||||
this.User();
|
||||
uni.hideLoading();
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
icon: "success",
|
||||
duration: 2000
|
||||
});
|
||||
})
|
||||
.catch(error => {
|
||||
uni.showToast({
|
||||
title: error.msg || error.response.data.msg,
|
||||
icon: "none",
|
||||
duration: 2000
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: "已拒绝授权",
|
||||
icon: "none",
|
||||
duration: 2000
|
||||
});
|
||||
}
|
||||
},
|
||||
changeswitch: function(data) {
|
||||
this.switchActive = data;
|
||||
},
|
||||
User: function() {
|
||||
let that = this;
|
||||
// getUser().then(res => {
|
||||
// that.user = res.data;
|
||||
// that.orderStatusNum = res.data.orderStatusNum;
|
||||
// });
|
||||
},
|
||||
MenuUser: function() {
|
||||
let that = this;
|
||||
getMenuUser().then(res => {
|
||||
that.MyMenus = res.data.routine_my_menus;
|
||||
});
|
||||
},
|
||||
goPages: function(index) {
|
||||
let url = this.MyMenus[index].uniapp_url;
|
||||
if (
|
||||
url === "/pages/user/promotion/UserPromotion/index" &&
|
||||
this.userInfo.statu === 1
|
||||
) {
|
||||
if (!this.userInfo.isPromoter) {
|
||||
uni.showToast({
|
||||
title: "您还没有推广权限!!",
|
||||
icon: "none",
|
||||
duration: 2000
|
||||
});
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (
|
||||
url === "/pages/orderAdmin/OrderIndex/index" &&
|
||||
!this.userInfo.adminid
|
||||
) {
|
||||
uni.showToast({
|
||||
title: "您还不是管理员!!",
|
||||
icon: "none",
|
||||
duration: 2000
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (
|
||||
url === "/pages/orderAdmin/OrderIndex/index" &&
|
||||
!this.userInfo.adminid
|
||||
) {
|
||||
uni.showToast({
|
||||
title: "您还不是管理员!!",
|
||||
icon: "none",
|
||||
duration: 2000
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
this.$yrouter.push({
|
||||
path: this.MyMenus[index].uniapp_url
|
||||
});
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
userInfo() {
|
||||
this.MenuUser();
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
console.log(this.$store.getters.token)
|
||||
console.log(this.userInfo);
|
||||
if (this.$store.getters.token) {
|
||||
this.User();
|
||||
this.MenuUser();
|
||||
this.isWeixin = isWeixin();
|
||||
}
|
||||
}
|
||||
};
|
||||
this.$yrouter.push({
|
||||
path: this.MyMenus[index].uniapp_url
|
||||
});
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
userInfo() {
|
||||
this.MenuUser();
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
console.log(this.$store.getters.token);
|
||||
console.log(this.userInfo);
|
||||
if (this.$store.getters.token) {
|
||||
this.User();
|
||||
this.MenuUser();
|
||||
this.isWeixin = isWeixin();
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="less">
|
||||
.footer-line-height {
|
||||
height: 1*100rpx;
|
||||
}
|
||||
.footer-line-height {
|
||||
height: 1 * 100rpx;
|
||||
}
|
||||
|
||||
.order-status-num {
|
||||
min-width: 0.33*100rpx;
|
||||
background-color: #fff;
|
||||
color: #00c17b;
|
||||
border-radius: 15px;
|
||||
position: absolute;
|
||||
right: -0.14*100rpx;
|
||||
top: -0.15*100rpx;
|
||||
font-size: 0.2*100rpx;
|
||||
padding: 0 0.08*100rpx;
|
||||
border: 1px solid #00c17b;
|
||||
}
|
||||
.order-status-num {
|
||||
min-width: 0.33 * 100rpx;
|
||||
background-color: #fff;
|
||||
color: #00c17b;
|
||||
border-radius: 15px;
|
||||
position: absolute;
|
||||
right: -0.14 * 100rpx;
|
||||
top: -0.15 * 100rpx;
|
||||
font-size: 0.2 * 100rpx;
|
||||
padding: 0 0.08 * 100rpx;
|
||||
border: 1px solid #00c17b;
|
||||
}
|
||||
|
||||
.pictrue {
|
||||
position: relative;
|
||||
}
|
||||
.pictrue {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.switch-h5 {
|
||||
margin-left: 0.2*100rpx;
|
||||
}
|
||||
.switch-h5 {
|
||||
margin-left: 0.2 * 100rpx;
|
||||
}
|
||||
|
||||
.binding {
|
||||
margin-top: 0.1*100rpx;
|
||||
display: inline-block;
|
||||
padding: 0.05*100rpx 0.2*100rpx;
|
||||
background-color: #ca1f10;
|
||||
border-radius: 50px;
|
||||
font-size: 0.22*100rpx;
|
||||
line-height: 1.5;
|
||||
border: 1px solid #e8695e;
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
.by{
|
||||
text-align:center;
|
||||
margin-top: 30rpx
|
||||
}
|
||||
.by-text{
|
||||
text-align:center;
|
||||
font-size: 30rpx;
|
||||
}
|
||||
.binding {
|
||||
margin-top: 0.1 * 100rpx;
|
||||
display: inline-block;
|
||||
padding: 0.05 * 100rpx 0.2 * 100rpx;
|
||||
background-color: #ca1f10;
|
||||
border-radius: 50px;
|
||||
font-size: 0.22 * 100rpx;
|
||||
line-height: 1.5;
|
||||
border: 1px solid #e8695e;
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
.by {
|
||||
text-align: center;
|
||||
margin-top: 30rpx;
|
||||
}
|
||||
.by-text {
|
||||
text-align: center;
|
||||
font-size: 30rpx;
|
||||
}
|
||||
</style>
|
||||
|
@ -62,8 +62,8 @@ export default {
|
||||
this.getActivity();
|
||||
},
|
||||
methods: {
|
||||
goUserBill(id) {
|
||||
this.$yrouter.push({ path: "/pages/user/UserBill/index", query: { id } });
|
||||
goUserBill(types) {
|
||||
this.$yrouter.push({ path: "/pages/user/UserBill/index", query: { types } });
|
||||
},
|
||||
getIndex: function() {
|
||||
let that = this;
|
||||
|
@ -12,7 +12,7 @@
|
||||
<view class="item acea-row row-between-wrapper">
|
||||
<view class="name">所在地区</view>
|
||||
<view class="picker acea-row row-between-wrapper select-value form-control">
|
||||
<view class="address">
|
||||
<view class="address" @tap="openAddres">
|
||||
<!-- <picker
|
||||
@columnchange="addRessColumnchange"
|
||||
@change="changeAddress"
|
||||
@ -23,7 +23,7 @@
|
||||
<text class="uni-input" v-if="model2">{{model2}}</text>
|
||||
<text class="uni-input" v-else>请选择地区</text>
|
||||
</picker>-->
|
||||
<text class="uni-input" @tap="openAddres2" >{{model2||'请选择'}}</text>
|
||||
<text class="uni-input">{{model2||'请选择'}}</text>
|
||||
<simple-address
|
||||
ref="simpleAddress"
|
||||
:pickerValueDefault="cityPickerValueDefault"
|
||||
@ -102,40 +102,40 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
openAddres() {
|
||||
this.cityPickerValueDefault = [0, 0, 1];
|
||||
this.$refs.simpleAddress.open();
|
||||
},
|
||||
openAddres2() {
|
||||
// 根据 label 获取
|
||||
|
||||
|
||||
if(this.address.province){
|
||||
if (this.address.province) {
|
||||
// 这个插件有个问题,直辖市的 city 必须得是 市辖区
|
||||
try {
|
||||
let str = "市";
|
||||
let city = this.address.city;
|
||||
if (this.address.province.indexOf(str) != -1) {
|
||||
city = "市辖区";
|
||||
}
|
||||
var index = this.$refs.simpleAddress.queryIndex(
|
||||
[this.address.province, city, this.address.district],
|
||||
"label"
|
||||
);
|
||||
this.cityPickerValueDefault = index.index;
|
||||
} catch (error) {}
|
||||
}
|
||||
this.$refs.simpleAddress.open();
|
||||
|
||||
var index = this.$refs.simpleAddress.queryIndex(
|
||||
[this.address.province, this.address.city, this.address.district],
|
||||
"label"
|
||||
);
|
||||
console.log(index);
|
||||
this.cityPickerValueDefault = index.index;
|
||||
}
|
||||
this.$refs.simpleAddress.open();
|
||||
},
|
||||
openAddres3() {
|
||||
// 根据value 获取
|
||||
var index = this.$refs.simpleAddress.queryIndex(
|
||||
[13, 1302, 130203],
|
||||
"value"
|
||||
);
|
||||
console.log(index);
|
||||
this.cityPickerValueDefault = index.index;
|
||||
this.$refs.simpleAddress.open();
|
||||
// var index = this.$refs.simpleAddress.queryIndex(
|
||||
// [13, 1302, 130203],
|
||||
// "value"
|
||||
// );
|
||||
// this.cityPickerValueDefault = index.index;
|
||||
// this.$refs.simpleAddress.open();
|
||||
},
|
||||
onConfirm(e) {
|
||||
this.pickerText = JSON.stringify(e);
|
||||
this.model2 = e.label;
|
||||
this.address.province = e.labelArr[0] || "";
|
||||
this.address.city = e.labelArr[1] || "";
|
||||
this.address.district = e.labelArr[2] || "";
|
||||
console.log(this.pickerText);
|
||||
},
|
||||
getUserAddress: function() {
|
||||
getUserAddress: function() {
|
||||
if (!this.id) return false;
|
||||
let that = this;
|
||||
getAddress(that.id).then(res => {
|
||||
@ -226,3 +226,12 @@ if(this.address.province){
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="less">
|
||||
.address {
|
||||
text {
|
||||
width: 100%;
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
@ -1,153 +1,160 @@
|
||||
<template>
|
||||
<view class="distribution-posters">
|
||||
<view class="slider-banner banner">
|
||||
<swiper indicatorDots="true">
|
||||
<block v-for="(item, infoIndex) in info" :key="infoIndex">
|
||||
<swiper-item>
|
||||
<image class="slide-image" :src="item.wap_poster" mode="widthFix" show-menu-by-longpress />
|
||||
</swiper-item>
|
||||
</block>
|
||||
</swiper>
|
||||
</view>
|
||||
<view class="keep bg-color-red" @click="saveImg">保存海报</view>
|
||||
</view>
|
||||
<view class="distribution-posters">
|
||||
<view class="slider-banner banner">
|
||||
<swiper indicatorDots="true">
|
||||
<block v-for="(item, infoIndex) in info" :key="infoIndex">
|
||||
<swiper-item>
|
||||
<image
|
||||
class="slide-image"
|
||||
:src="item.wap_poster"
|
||||
mode="widthFix"
|
||||
show-menu-by-longpress
|
||||
/>
|
||||
</swiper-item>
|
||||
</block>
|
||||
</swiper>
|
||||
</view>
|
||||
<view class="keep bg-color-red" @click="saveImg">保存海报</view>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
// import { swiper, swiperSlide } from "vue-awesome-swiper";
|
||||
import {
|
||||
getSpreadImg
|
||||
} from "@/api/user";
|
||||
// import { swiper, swiperSlide } from "vue-awesome-swiper";
|
||||
import { getSpreadImg } from "@/api/user";
|
||||
|
||||
export default {
|
||||
name: "Poster",
|
||||
components: {
|
||||
// swiper,
|
||||
// swiperSlide
|
||||
},
|
||||
props: {},
|
||||
data: function() {
|
||||
return {
|
||||
swiperPosters: {
|
||||
speed: 1000,
|
||||
effect: "coverflow",
|
||||
slidesPerView: "auto",
|
||||
centeredSlides: true,
|
||||
coverflowEffect: {
|
||||
rotate: 0, // 旋转的角度
|
||||
stretch: -20, // 拉伸 图片间左右的间距和密集度
|
||||
depth: 100, // 深度 切换图片间上下的间距和密集度
|
||||
modifier: 3, // 修正值 该值越大前面的效果越明显
|
||||
slideShadows: false // 页面阴影效果
|
||||
},
|
||||
observer: true,
|
||||
observeParents: true
|
||||
},
|
||||
info: [],
|
||||
activeIndex: 0
|
||||
};
|
||||
},
|
||||
mounted: function() {
|
||||
this.getIndex();
|
||||
let that = this;
|
||||
// this.swiper.on("slideChange", function() {
|
||||
// that.activeIndex = that.swiper.activeIndex;
|
||||
// });
|
||||
},
|
||||
computed: {
|
||||
swiper() {
|
||||
// return this.$refs.mySwiper.swiper;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getIndex: function() {
|
||||
let that = this;
|
||||
let form = {}
|
||||
if (this.$deviceType == 'app') {
|
||||
form.form = 'app'
|
||||
}
|
||||
getSpreadImg(form).then(
|
||||
res => {
|
||||
that.info = res.data;
|
||||
},
|
||||
err => {
|
||||
uni.showToast({
|
||||
title: err.msg || err.response.data.msg,
|
||||
icon: 'none',
|
||||
duration: 2000
|
||||
});
|
||||
}
|
||||
);
|
||||
},
|
||||
downloadIamge: function(imgsrc, name) {
|
||||
var that = this;
|
||||
this.isDown = true;
|
||||
var downloadUrl = imgsrc;
|
||||
export default {
|
||||
name: "Poster",
|
||||
components: {
|
||||
// swiper,
|
||||
// swiperSlide
|
||||
},
|
||||
props: {},
|
||||
data: function() {
|
||||
return {
|
||||
swiperPosters: {
|
||||
speed: 1000,
|
||||
effect: "coverflow",
|
||||
slidesPerView: "auto",
|
||||
centeredSlides: true,
|
||||
coverflowEffect: {
|
||||
rotate: 0, // 旋转的角度
|
||||
stretch: -20, // 拉伸 图片间左右的间距和密集度
|
||||
depth: 100, // 深度 切换图片间上下的间距和密集度
|
||||
modifier: 3, // 修正值 该值越大前面的效果越明显
|
||||
slideShadows: false // 页面阴影效果
|
||||
},
|
||||
observer: true,
|
||||
observeParents: true
|
||||
},
|
||||
info: [],
|
||||
activeIndex: 0
|
||||
};
|
||||
},
|
||||
mounted: function() {
|
||||
this.getIndex();
|
||||
let that = this;
|
||||
// this.swiper.on("slideChange", function() {
|
||||
// that.activeIndex = that.swiper.activeIndex;
|
||||
// });
|
||||
},
|
||||
computed: {
|
||||
swiper() {
|
||||
// return this.$refs.mySwiper.swiper;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getIndex: function() {
|
||||
let that = this;
|
||||
let form = {};
|
||||
if (this.$deviceType == "app") {
|
||||
form.form = "app";
|
||||
}
|
||||
getSpreadImg(form).then(
|
||||
res => {
|
||||
that.info = res.data;
|
||||
},
|
||||
err => {
|
||||
uni.showToast({
|
||||
title: err.msg || err.response.data.msg,
|
||||
icon: "none",
|
||||
duration: 2000
|
||||
});
|
||||
}
|
||||
);
|
||||
},
|
||||
downloadIamge: function(imgsrc, name) {
|
||||
var that = this;
|
||||
this.isDown = true;
|
||||
var downloadUrl = imgsrc;
|
||||
|
||||
if (!wx.saveImageToPhotosAlbum) {
|
||||
uni.showModal({
|
||||
title: "提示",
|
||||
content: "当前微信版本过低,无法使用该功能,请升级到最新微信版本后重试。"
|
||||
});
|
||||
that.openDialogVisible = true;
|
||||
if (!wx.saveImageToPhotosAlbum) {
|
||||
uni.showModal({
|
||||
title: "提示",
|
||||
content:
|
||||
"当前微信版本过低,无法使用该功能,请升级到最新微信版本后重试。"
|
||||
});
|
||||
that.openDialogVisible = true;
|
||||
|
||||
return;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// 可以通过 wx.getSetting 先查询一下用户是否授权了 "scope.writePhotosAlbum" 这个 scope
|
||||
wx.getSetting({
|
||||
success(res) {
|
||||
if (!res.authSetting["scope.writePhotosAlbum"]) {
|
||||
that.openDialogVisible = true;
|
||||
// 可以通过 wx.getSetting 先查询一下用户是否授权了 "scope.writePhotosAlbum" 这个 scope
|
||||
wx.getSetting({
|
||||
success(res) {
|
||||
if (!res.authSetting["scope.writePhotosAlbum"]) {
|
||||
that.openDialogVisible = true;
|
||||
|
||||
// 接口调用询问
|
||||
wx.authorize({
|
||||
scope: "scope.writePhotosAlbum",
|
||||
success() {
|
||||
that.downloadImage(downloadUrl);
|
||||
},
|
||||
fail() {
|
||||
// 用户拒绝了授权
|
||||
// 打开设置页面
|
||||
wx.openSetting({
|
||||
success: function(data) {},
|
||||
fail: function(data) {}
|
||||
});
|
||||
}
|
||||
});
|
||||
} else {
|
||||
that.downloadImage(downloadUrl);
|
||||
}
|
||||
},
|
||||
fail(res) {
|
||||
that.openDialogVisible = true;
|
||||
}
|
||||
});
|
||||
},
|
||||
saveImg: function() {
|
||||
this.downloadIamge(
|
||||
this.info[this.activeIndex].wap_poster,
|
||||
"poster" + this.activeIndex
|
||||
);
|
||||
}
|
||||
}
|
||||
};
|
||||
// 接口调用询问
|
||||
wx.authorize({
|
||||
scope: "scope.writePhotosAlbum",
|
||||
success() {
|
||||
that.downloadImage(downloadUrl);
|
||||
},
|
||||
fail() {
|
||||
// 用户拒绝了授权
|
||||
// 打开设置页面
|
||||
wx.openSetting({
|
||||
success: function(data) {},
|
||||
fail: function(data) {}
|
||||
});
|
||||
}
|
||||
});
|
||||
} else {
|
||||
that.downloadImage(downloadUrl);
|
||||
}
|
||||
},
|
||||
fail(res) {
|
||||
that.openDialogVisible = true;
|
||||
}
|
||||
});
|
||||
},
|
||||
saveImg: function() {
|
||||
this.downloadIamge(
|
||||
this.info[this.activeIndex].wap_poster,
|
||||
"poster" + this.activeIndex
|
||||
);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
.distribution-posters {
|
||||
height: 100%;
|
||||
}
|
||||
<style lang="less">
|
||||
page {
|
||||
height: 100%;
|
||||
}
|
||||
.distribution-posters {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.banenr {
|
||||
height: 100%;
|
||||
}
|
||||
.banenr {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.banner swiper {
|
||||
height: 100%;
|
||||
}
|
||||
.banner swiper {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.banner .slide-image {
|
||||
width: 100%;
|
||||
height: auto;
|
||||
}
|
||||
</style>
|
||||
.banner .slide-image {
|
||||
width: 100%;
|
||||
height: auto;
|
||||
}
|
||||
</style>
|
||||
|
@ -4,7 +4,7 @@ import Vuex from "vuex";
|
||||
Vue.use(Vuex);
|
||||
const debug = process.env.NODE_ENV !== "production";
|
||||
|
||||
import store from "@/utils/store/cookie";
|
||||
import cookie from "@/utils/store/cookie";
|
||||
import {
|
||||
getUserInfo
|
||||
} from "@/api/user";
|
||||
@ -18,8 +18,9 @@ const vuexStore = new Vuex.Store({
|
||||
isAuthorizationPage: false,
|
||||
// 是否授权
|
||||
isAuthorization: false,
|
||||
token: store.get(LOGIN_KEY) || null,
|
||||
userInfo: store.get('userInfo'),
|
||||
// 不建议从这里取 token,但是删除掉会影响其他的页面
|
||||
token: cookie.get(LOGIN_KEY) || null,
|
||||
userInfo: cookie.get('userInfo'),
|
||||
$deviceType: null,
|
||||
},
|
||||
mutations: {
|
||||
@ -46,18 +47,18 @@ const vuexStore = new Vuex.Store({
|
||||
},
|
||||
LOGIN(state, token, expires_time) {
|
||||
state.token = token;
|
||||
store.set(LOGIN_KEY, token, expires_time);
|
||||
cookie.set(LOGIN_KEY, token, expires_time);
|
||||
},
|
||||
LOGOUT(state) {
|
||||
state.token = null;
|
||||
state.userInfo = null
|
||||
store.clearAll()
|
||||
cookie.clearAll()
|
||||
},
|
||||
BACKGROUND_COLOR(state, color) {
|
||||
state.color = color;
|
||||
// document.body.style.backgroundColor = color;
|
||||
},
|
||||
UPDATE_USERINFO(state, userInfo) {
|
||||
UPDATE_USERINFO(state, userInfo) {
|
||||
state.userInfo = userInfo;
|
||||
},
|
||||
UPDATE_AUTHORIZATIONPAGE(state, isAuthorizationPage) {
|
||||
@ -99,9 +100,9 @@ const vuexStore = new Vuex.Store({
|
||||
}, user) {
|
||||
commit("UPDATE_USERINFO", user);
|
||||
if (user) {
|
||||
store.set('userInfo', user)
|
||||
cookie.set('userInfo', user)
|
||||
} else {
|
||||
store.set('userInfo', null)
|
||||
cookie.set('userInfo', null)
|
||||
}
|
||||
},
|
||||
changeAuthorizationPage({
|
||||
@ -127,4 +128,4 @@ const vuexStore = new Vuex.Store({
|
||||
strict: debug
|
||||
});
|
||||
|
||||
export default vuexStore
|
||||
export default vuexStore
|
||||
|
@ -122,13 +122,18 @@ export const replaceLogin = (msg) => {
|
||||
console.log(uni, 989)
|
||||
if (Vue.prototype.$deviceType == 'weixin') {
|
||||
// 如果是微信小程序,跳转到授权页
|
||||
replace({
|
||||
path: '/pages/authorization/index',
|
||||
query: {
|
||||
redirect: `/${getCurrentPageUrl()}`,
|
||||
...parseQuery()
|
||||
login({
|
||||
fail: () => {
|
||||
replace({
|
||||
path: '/pages/authorization/index',
|
||||
query: {
|
||||
redirect: `/${getCurrentPageUrl()}`,
|
||||
...parseQuery()
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
} else {
|
||||
// 如果不是小程序跳转到登录页
|
||||
push({
|
||||
@ -218,7 +223,7 @@ export const login = (option) => {
|
||||
console.log('登录成功4')
|
||||
store.commit("LOGIN", data.token, dayjs(data.expires_time));
|
||||
console.log('登录成功5')
|
||||
|
||||
console.log(store)
|
||||
handleGetUserInfo()
|
||||
|
||||
}).catch(error => {
|
||||
@ -259,6 +264,7 @@ export const login = (option) => {
|
||||
}
|
||||
|
||||
export const handleGetUserInfo = () => {
|
||||
console.log('登录后请求用户信息')
|
||||
getUser().then(res => {
|
||||
console.log(res.data, '登录后的样式')
|
||||
store.dispatch('setUserInfo', res.data)
|
||||
@ -296,10 +302,17 @@ export const handleGetUserInfo = () => {
|
||||
path: url,
|
||||
query
|
||||
})
|
||||
switchTab({
|
||||
path: `${url}`,
|
||||
query
|
||||
});
|
||||
if (url == '/pages/home/index' || url == '/pages/shop/GoodsClass/index' || url == '/pages/shop/ShoppingCart/index' || url == '/pages/user/User/index') {
|
||||
switchTab({
|
||||
path: `${url}`,
|
||||
query
|
||||
});
|
||||
} else {
|
||||
push({
|
||||
path: `${url}`,
|
||||
query
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@ -341,9 +354,25 @@ export function parseRoute($mp) {
|
||||
}
|
||||
}
|
||||
|
||||
export function auth() {
|
||||
/**
|
||||
* 如何判断权限?
|
||||
* 用户如果登录了系统,会留下两个东西,一个是token,一个是userInfo
|
||||
* token存在会过期的问题,如果长时间没有打开小程序,会导致登录失效,出现打开一个页面瞬间跳转到授权页面的问题
|
||||
* 解决办法,保存token的时候加上过期时间,每次请求都取一下缓存里的token
|
||||
* userInfo只是用来限时用户信息,作用并不是很大
|
||||
* ps:只需要判断 token 是否存在即可
|
||||
*/
|
||||
console.log(cookie.get('login_status'), 'token')
|
||||
if (cookie.get('login_status')) {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
|
||||
export const handleLoginStatus = (location, complete, fail, success) => {
|
||||
console.log(location, '开始健全')
|
||||
console.log(location, '开始检验权限')
|
||||
// 不登录可访问的页面
|
||||
let page = [{
|
||||
path: '/pages/Loading/index',
|
||||
@ -374,8 +403,7 @@ export const handleLoginStatus = (location, complete, fail, success) => {
|
||||
path = location.path
|
||||
}
|
||||
|
||||
console.log(store.getters.userInfo, '用户信息')
|
||||
if (!store.getters.token) {
|
||||
if (!auth()) {
|
||||
page.map((item) => {
|
||||
console.log(item.path == path)
|
||||
if (item.path == path) {
|
||||
@ -534,15 +562,16 @@ export const PosterCanvas = (store, successCallBack) => {
|
||||
mask: true
|
||||
});
|
||||
getImageInfo([store.image, store.code]).then(res => {
|
||||
console.log(res)
|
||||
let contentHh = 48 * 1.3
|
||||
const ctx = uni.createCanvasContext('myCanvas');
|
||||
const ctx = uni.createCanvasContext('myCanvas')
|
||||
ctx.clearRect(0, 0, 0, 0);
|
||||
const WIDTH = 747
|
||||
const HEIGHT = 1326;
|
||||
ctx.fillStyle = "#FFFFFF";
|
||||
ctx.fillRect(0, 0, WIDTH, HEIGHT);
|
||||
ctx.drawImage(res[1].path, 40, 1064, 200, 200);
|
||||
ctx.drawImage(res[0].path, 0, 0, WIDTH, WIDTH);
|
||||
ctx.drawImage(res[1].path, 40, 1064, 200, 200);
|
||||
ctx.save();
|
||||
let r = 90;
|
||||
let d = r * 2;
|
||||
@ -562,10 +591,10 @@ export const PosterCanvas = (store, successCallBack) => {
|
||||
ctx.setTextAlign('center')
|
||||
ctx.setFontSize(22);
|
||||
ctx.setFillStyle('#333333');
|
||||
console.log('长按识别二维码立即购买')
|
||||
ctx.fillText('长按识别二维码立即购买', WIDTH / 2, 1167);
|
||||
// ctx.drawImage(store.code, 199, 1064, 200, 200);
|
||||
ctx.save();
|
||||
ctx.draw(true, function (oi) {
|
||||
ctx.draw(true, () => {
|
||||
uni.canvasToTempFilePath({
|
||||
canvasId: 'myCanvas',
|
||||
fileType: 'png',
|
||||
@ -581,6 +610,7 @@ export const PosterCanvas = (store, successCallBack) => {
|
||||
|
||||
})
|
||||
});
|
||||
|
||||
})
|
||||
|
||||
// uni.getImageInfo({
|
||||
|
@ -2,6 +2,7 @@ import Fly from "flyio/dist/npm/wx";
|
||||
import $store from "../store";
|
||||
import toLogin from "@/libs/login";
|
||||
import { VUE_APP_API_URL } from "@/config";
|
||||
import cookie from "@/utils/store/cookie";
|
||||
|
||||
|
||||
const fly = new Fly()
|
||||
@ -28,28 +29,38 @@ fly.interceptors.response.use(
|
||||
const defaultOpt = { login: true };
|
||||
|
||||
function baseRequest(options) {
|
||||
const token = $store.state.token;
|
||||
const headers = options.headers || {};
|
||||
if (options.login) {
|
||||
headers["Authorization"] = "Bearer " + token;
|
||||
|
||||
// 从缓存中获取 token 防止 token 失效后还会继续请求的情况
|
||||
const token = cookie.get('login_status');
|
||||
|
||||
// 合并传参过来的 headers
|
||||
// 如果接口需要登录,携带 token 去请求
|
||||
options.headers = {
|
||||
...options.headers,
|
||||
Authorization: "Bearer " + token
|
||||
}
|
||||
|
||||
options.headers = headers;
|
||||
if (options.login && !token) {
|
||||
// 如果需要登录才可访问的接口没有拿到 token 视为登录失效
|
||||
if (options.login === true && !token) {
|
||||
// 跳转到登录或授权页面
|
||||
toLogin();
|
||||
// 提示错误信息
|
||||
return Promise.reject({ msg: "未登录", toLogin: true });
|
||||
}
|
||||
|
||||
// 结构请求需要的参数
|
||||
const { url, params, data, login, ...option } = options
|
||||
|
||||
// 发起请求
|
||||
return fly.request(url, params || data, {
|
||||
...option
|
||||
}).then(res => {
|
||||
console.log(res)
|
||||
// console.log(url,params,data, ...option)
|
||||
}).then(res => {
|
||||
console.log(res)
|
||||
// console.log(url,params,data, ...option)
|
||||
const data = res.data || {};
|
||||
if (res.status !== 200)
|
||||
if (res.status !== 200) {
|
||||
return Promise.reject({ msg: "请求失败", res, data });
|
||||
|
||||
}
|
||||
if ([410000, 410001, 410002].indexOf(data.status) !== -1) {
|
||||
toLogin();
|
||||
return Promise.reject({ msg: res.data.msg, res, data, toLogin: true });
|
||||
|
Reference in New Issue
Block a user