积分抵扣、霸王餐、优惠券分享新增
This commit is contained in:
@@ -3,10 +3,10 @@
|
||||
<view class="towcontent">
|
||||
<view class="towcontentlistxitem flex-start">
|
||||
<view class="towcontentlistxitembox flex-colum"
|
||||
:class="tabIndex == index?'towcontentlistxitemboxopacity':''"
|
||||
v-for="(item,index) in tabList" :key="index" @click="towcontentclick(index,item)">
|
||||
:class="tabIndex == item.type?'towcontentlistxitemboxopacity':''"
|
||||
v-for="(item,index) in tabList" :key="index" @click="towcontentclick(item)">
|
||||
<text class="title">{{item.name}}</text>
|
||||
<image v-if="tabIndex == index"
|
||||
<image v-if="tabIndex == item.type"
|
||||
src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/index/today/dg.png" mode="widthFix">
|
||||
</image>
|
||||
</view>
|
||||
@@ -74,10 +74,8 @@
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
tabList: [{
|
||||
name: '全部',
|
||||
type: ''
|
||||
},
|
||||
tabList: [
|
||||
|
||||
{
|
||||
name: '未使用',
|
||||
type: '1'
|
||||
@@ -87,13 +85,17 @@
|
||||
type: '2'
|
||||
}
|
||||
],
|
||||
tabIndex: 0,
|
||||
tabIndex: 1,
|
||||
list: [],
|
||||
status: "",
|
||||
status: 1,
|
||||
type: "",
|
||||
|
||||
};
|
||||
},
|
||||
onLoad() {
|
||||
onLoad(options) {
|
||||
if (options.type) {
|
||||
this.type = options.type;
|
||||
}
|
||||
this.getCouponList()
|
||||
},
|
||||
|
||||
@@ -101,11 +103,10 @@
|
||||
|
||||
/**
|
||||
* 切换类型
|
||||
* @param {Object} index
|
||||
* @param {Object} item
|
||||
*/
|
||||
towcontentclick(index, item) {
|
||||
this.tabIndex = index;
|
||||
towcontentclick(item) {
|
||||
this.tabIndex = item.type;
|
||||
this.status = item.type;
|
||||
this.getCouponList()
|
||||
},
|
||||
@@ -115,7 +116,7 @@
|
||||
*/
|
||||
async getCouponList() {
|
||||
try {
|
||||
let res = await this.api.getUserConpons({
|
||||
let res = await this.api.conponList({
|
||||
userId: uni.cache.get('userInfo').id,
|
||||
shopId: uni.cache.get('shopId'),
|
||||
status: this.status
|
||||
@@ -156,7 +157,7 @@
|
||||
margin-top: 32rpx;
|
||||
|
||||
.towcontentlistxitembox {
|
||||
width: 33%;
|
||||
width: 50%;
|
||||
font-family: PingFang SC, PingFang SC;
|
||||
font-weight: 500;
|
||||
font-size: 28rpx;
|
||||
@@ -170,8 +171,6 @@
|
||||
}
|
||||
|
||||
.towcontentlistxitemboxopacity {
|
||||
width: 33%;
|
||||
font-family: PingFang SC, PingFang SC;
|
||||
font-weight: bold;
|
||||
text{
|
||||
color: #E3AD7F;
|
||||
|
||||
@@ -57,7 +57,7 @@
|
||||
teblist: [],
|
||||
myAssetsList: [
|
||||
{ name: "储值", type: "recharge", num: 0, icon: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/my/storedValue.png"},
|
||||
// { name: "积分", type: "", num: 0, icon: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/my/points.png"},
|
||||
{ name: "积分", type: "points", num: 0, icon: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/my/points.png"},
|
||||
{ name: "优惠券", type: "my_coupon", num: 0, icon: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/my/coupon.png"},
|
||||
// { name: "权益卡", type: "", num: 0, icon: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/my/equityCard.png"}
|
||||
],
|
||||
@@ -121,6 +121,9 @@
|
||||
if (res.code == 0) {
|
||||
uni.cache.set('userInfo', res.data);
|
||||
this.userInfo = res.data;
|
||||
this.myAssetsList[0].num = res.data.balanceAll || "";
|
||||
this.myAssetsList[1].num = res.data.pointsAll || "";
|
||||
this.myAssetsList[2].num = res.data.couponAll || "";
|
||||
}
|
||||
},
|
||||
|
||||
@@ -180,9 +183,7 @@
|
||||
}
|
||||
switch (item.type) {
|
||||
case 'my_order':
|
||||
uni.switchTab({
|
||||
url: '/pages/order/order'
|
||||
});
|
||||
uni.pro.switchTab('order/order')
|
||||
break
|
||||
case 'my_member':
|
||||
uni.pro.navigateTo('member/list')
|
||||
@@ -200,7 +201,19 @@
|
||||
}
|
||||
|
||||
break
|
||||
case 'my_coupon': //内部页面
|
||||
case 'points': //积分
|
||||
if (uni.cache.get('shopId') && uni.cache.get('token')) {
|
||||
uni.pro.navigateTo('/pagesPoints/index/index', {
|
||||
shopId: uni.cache.get('shopId'),
|
||||
type: 'user',
|
||||
})
|
||||
} else{
|
||||
uni.pro.navigateTo('member/list', {
|
||||
type: 'user_points'
|
||||
})
|
||||
}
|
||||
break;
|
||||
case 'my_coupon': //优惠券
|
||||
uni.pro.navigateTo('user/coupon')
|
||||
break;
|
||||
case 'my_info': //内部页面
|
||||
|
||||
Reference in New Issue
Block a user