会员相关更新、商品列表更新

This commit is contained in:
GaoHao
2024-08-16 18:09:09 +08:00
26 changed files with 1891 additions and 2186 deletions

View File

@@ -23,13 +23,13 @@
<view class="card_cen_right" v-if="userInfo.isVip != 0">查看特权</view>
</view>
<view class="card_bom" v-if="userInfo.isVip != 0">
<view class="card_bom_item">
<view class="card_bom_item" @click="itemClick(1)">
<text>{{userInfo.amount || '0.00'}}</text><text>储值</text>
</view>
<view class="card_bom_item">
<text>0</text><text>积分</text>
</view>
<view class="card_bom_item">
<view class="card_bom_item" @click="itemClick(3)">
<text>0</text><text>优惠券</text>
</view>
<view class="card_bom_item">
@@ -93,39 +93,53 @@
list: ['鸿运当头',"财运亨通","时来运转","否极泰来","花逢时发"],
index: 0,
text: ""
}
},
usershopUserinfo:{},
}
},
onLoad(e) {
this.shopId_id = e.shopId_id
},
onShow() {
this.paygetShopByMember()
this.init();
},
methods: {
/**
* 获取会员卡信息
* 获取店铺信息
*/
async paygetShopByMember() {
let res = await this.api.paygetShopByMember({
page: 1,
pageSize: 10,
userId: uni.cache.get('userInfo').id,
shopId: this.shopId_id
async init() {
let res = await this.api.shopUserInfo({
"shopId": this.shopId_id,
"userId": uni.cache.get('userInfo').id,
})
this.userInfo = res.data.list[0];
if (res.code == 0) {
this.userInfo = res.data
}
if ( this.userInfo.isVip == 0 ) {
this.memberOpen = true;
return;
}
},
itemClick ( type ) {
if ( type == 1) {
uni.pro.navigateTo('member/index', {
shopId: this.userInfo.shopId,
type: 'index',
})
} else if ( type == 3 ) {
uni.pro.navigateTo('user/coupon')
}
},
/**
* 注册会员卡
* @param {Object} e
*/
getRegisterMember (e) {
this.memberOpen = e;
this.paygetShopByMember()
this.init()
},
clickEvent() {