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

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

@@ -70,11 +70,14 @@
<view class="rechargeBox">
<view class="agreement">
<u-checkbox-group>
<u-checkbox shape="circle" activeColor="#E3AD7F" @change="radioChange" size="30"></u-checkbox>
<u-checkbox shape="circle" activeColor="#E3AD7F" @change="radioChange" size="30">
<view style="width: 100rpx;height: 100rpx;"></view>
</u-checkbox>
</u-checkbox-group>
<text>已同意</text>
<text class="agreement_text" @click="Privacy(1)">用户储值协议</text>
<text class="agreement_text" @click="Privacy(3)">用户授权协议</text>
<text class="agreement_text" @click="viewProtocol">用户隐私协议</text>
<!-- <text class="agreement_text" @click="viewProtocol">用户储值协议</text> -->
<!-- <text class="agreement_text" @click="viewProtocol">用户授权协议</text> -->
</view>
<view class="recharge" @tap="$u.debounce(userbalancerechangesub, 500)">立即充值</view>
</view>
@@ -116,9 +119,9 @@
this.shopId = this.getQueryString(decodeURIComponent(e.q), 'shopId')
this.tokenShow = false;
// 等待登录结果返回
if (!uni.cache.get('token')) {
await this.$onLaunched;
}
// if (!uni.cache.get('token')) {
// await this.$onLaunched;
// }
this.init();
} else{
this.shopId = e.shopId;
@@ -173,25 +176,16 @@
uni.pro.navigateTo(item.url, this.userInfo)
},
async Privacy(e) {
if (e == 1) {
//用户协议
let res = await this.api.agreementgetAgreementOne({
discern: 0
});
uni.pro.navigateTo('my/about/agreement', {
discern: 0,
list: res.data.content
});
} else {
let res3 = await this.api.agreementgetAgreementOne({
discern: 3
});
uni.pro.navigateTo('my/about/agreement', {
discern: 3,
list: res3.data.content
});
}
/**
* 查看协议
*/
viewProtocol (){
wx.openPrivacyContract({
success: () => {}, // 打开成功
fail: () => {}, // 打开失败
complete: () => {}
})
},
/**
@@ -216,18 +210,26 @@
* 拉起地图
*/
openLocation () {
console.log('123');
uni.openLocation({
latitude: Number(this.userInfo.lat), // 目的地的纬度,浮点数,范围为-90~90
longitude: Number(this.userInfo.lng), // 目的地的经度,浮点数,范围为-180~180
latitude: Number(this.usershopUserinfo.lat), // 目的地的纬度,浮点数,范围为-90~90
longitude: Number(this.usershopUserinfo.lng), // 目的地的经度,浮点数,范围为-180~180
scale: 18, // 缩放比例范围5~18
name: this.userInfo.shopName, // 位置名
address: this.userInfo.address, // 地址的详细说明
name: this.usershopUserinfo.shopName, // 位置名
address: this.usershopUserinfo.address, // 地址的详细说明
success() {
console.log('导航启动成功');
},
fail(error) {
console.log('导航启动失败', error);
if ( error.errMsg == "openLocation:fail invalid_coordinate") {
uni.showToast({
title: "门店经纬度无效",
icon: 'none'
});
}
}
});
},
@@ -278,6 +280,13 @@
* 充值
*/
async userbalancerechangesub() {
if (!this.isProtocol) {
uni.showToast({
title: '请勾选协议',
icon: 'none'
});
return false;
}
if (this.amount == null || this.amount == '') {
uni.showToast({
title: '金额不能为空',
@@ -317,9 +326,7 @@
uni.hideLoading()
let pages = getCurrentPages()
if ( pages.length > 1) {
setTimeout(res => {
uni.navigateBack()
}, 500)
this.paygetShopByMember()
} else {
setTimeout(res => {
uni.switchTab({