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

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

@@ -8,8 +8,8 @@
<image class="my_info_left_head" :src="userInfo.headImg" mode="aspectFill"></image>
<view class="name">{{userInfo.nickName || '无'}}</view>
</view>
<image class="my_info_right_qr" v-if="userInfo" :src="'https://czg-qr-order.oss-cn-beijing.aliyuncs.com/my/my_qRcode.png'" mode="aspectFill"></image>
<view class="my_info_right" v-else>
<image class="my_info_right_qr" @click="clickEvent" v-if="shopInfo.isVip!=0" :src="'https://czg-qr-order.oss-cn-beijing.aliyuncs.com/my/my_qRcode.png'" mode="aspectFill"></image>
<view class="my_info_right" @click="clickEvent" v-else>
<text>免费入会</text>
</view>
</view>
@@ -57,18 +57,19 @@
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: "", 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"}
// { name: "权益卡", type: "", num: 0, icon: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/my/equityCard.png"}
],
myFunList: [
{ name: "我的优惠券", type: "my_coupon", icon: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/my/my_coupon.png"},
{ name: "我的订单", type: "my_order", icon: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/my/my_order.png"},
{ name: "收货地址", type: "", icon: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/my/my_address.png"},
// { name: "收货地址", type: "", icon: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/my/my_address.png"},
{ name: "个人资料", type: "my_info", icon: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/my/personal.png"},
{ name: "我的会员卡", type: "my_member", icon: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/my/my_member.png"},
{ name: "关于", type: "", icon: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/my/inRegard.png"},
// { name: "关于", type: "", icon: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/my/inRegard.png"},
],
shopInfo: {},
};
},
onLoad() {},
@@ -82,13 +83,23 @@
},
onShow() {
if (uni.cache.get('token')) {
this.init_fn()
this.loginwxuserInfo()
this.tbPlatformDict()
this.init_fn()
this.loginwxuserInfo()
if (uni.cache.get('shopUser') ) {
this.getShopInfo();
} else{
}
},
methods: {
// 下面初始数据
init_fn() {
},
/**
* 获取用户信息
*/
async loginwxuserInfo() {
let res = await this.api.loginwxuserInfo({
userId: uni.cache.get('userInfo').id
@@ -98,6 +109,8 @@
this.userInfo = uni.cache.get('userInfo')
}
},
async tbPlatformDict() {
let res = await this.api.tbPlatformDict({
type: 'ownMenu'
@@ -107,10 +120,7 @@
this.teblist = res.data
}
},
// 下面初始数据
init_fn() {
},
clickphone() {
uni.makePhoneCall({
phoneNumber: uni.cache.get('userInfo').custPhone
@@ -123,8 +133,54 @@
url: '/pages/login/login'
});
},
/**
* 获取店铺信息
*/
async getShopInfo() {
let res = await this.api.shopUserInfo({
"shopId": uni.cache.get('shopUser'),
"userId": uni.cache.get('userInfo').id,
})
if (res.code == 0) {
this.shopInfo = res.data
}
if ( res.data.isVip == 0 ) {
this.memberOpen = true;
return;
}
},
/**
* 查看二维码
*/
clickEvent() {
if (uni.cache.get('shopUser') && uni.cache.get('token')) {
if ( this.shopInfo.isVip == 0 ) {
uni.pro.navigateTo('member/memberdetails', {
shopId_id: uni.cache.get('shopUser')
})
} else {
uni.navigateTo({
url: '/pages/pay_code/pay_code?shopInfo=' + JSON.stringify(this.shopInfo)
})
}
} else{
uni.pro.navigateTo('member/list', {
type: 'user_payCode'
})
}
},
clickTo(item, index) {
let shopId = null;
if (uni.cache.get('shopUser') && uni.cache.get('token')) {
shopId = uni.cache.get('shopUser');
} else{
}
switch (item.type) {
case 'my_order':
uni.switchTab({
@@ -132,14 +188,20 @@
});
break
case 'my_member':
if (uni.cache.get('token')) {
uni.pro.navigateTo('member/list')
} else {
this.loginClick()
}
uni.pro.navigateTo('member/list')
break
case 'recharge':
uni.pro.navigateTo('member/index')
if (uni.cache.get('shopUser') && uni.cache.get('token')) {
uni.pro.navigateTo('member/index', {
shopId: uni.cache.get('shopUser'),
type: 'index',
})
} else{
uni.pro.navigateTo('member/list', {
type: 'user_recharge'
})
}
break
case 'my_coupon': //内部页面
uni.pro.navigateTo('user/coupon')
@@ -238,7 +300,7 @@
}
.my_assets_list{
display: flex;
justify-content: space-between;
justify-content: space-around;
padding: 0 38rpx;
.my_list_item{
display: flex;