优化功能

This commit is contained in:
duan
2024-05-24 13:48:51 +08:00
parent 7cea9eb628
commit 2e3061a967
9 changed files with 59 additions and 58 deletions

View File

@@ -16,6 +16,7 @@ export default {
accountPay(data) { accountPay(data) {
return uni.api.get("/pay/accountPay", data); return uni.api.get("/pay/accountPay", data);
}, },
// 下单 // 下单
creatGroupOrder(data) { creatGroupOrder(data) {
return uni.api.post("/groupOrderInfo/creatGroupOrder", data); return uni.api.post("/groupOrderInfo/creatGroupOrder", data);
@@ -142,7 +143,7 @@ export default {
return uni.api.get("/distirict/comShopList", data); return uni.api.get("/distirict/comShopList", data);
}, },
loginOut(data) { //退出登录 loginOut(data) { //退出登录
return uni.api.post("/loginOut", data); return uni.api.post("/login /loginOut", data);
}, },
productqueryShopIdByTableCode(data) { //通过桌码获取shopId productqueryShopIdByTableCode(data) { //通过桌码获取shopId
return uni.api.get("/product/queryShopIdByTableCode", data); return uni.api.get("/product/queryShopIdByTableCode", data);

View File

@@ -51,12 +51,14 @@
<view class="toLogins" @click="showbox = !showbox">其他手机号登录/注册</view> <view class="toLogins" @click="showbox = !showbox">其他手机号登录/注册</view>
<!-- #endif --> <!-- #endif -->
<view class="agreement flex-start"> <view class="agreement flex-start">
<!-- #ifdef APP-PLUS || H5 -->
<u-checkbox-group><u-checkbox shape="circle" @change="radioChange" <u-checkbox-group><u-checkbox shape="circle" @change="radioChange"
size="24"></u-checkbox></u-checkbox-group> size="24"></u-checkbox></u-checkbox-group>
<text>阅读并同意零点八零</text> <text>阅读并同意零点八零</text>
<view class="agreement-Item" @click="Privacy(1)">用户协议</view> <view class="agreement-Item" @click="Privacy(1)">用户协议</view>
<view class="agreement-Item" @click="Privacy(2)">隐私政策</view> <view class="agreement-Item" @click="Privacy(2)">隐私政策</view>
<!-- #endif -->
</view> </view>
</view> </view>
<!-- #ifdef APP-PLUS || H5 --> <!-- #ifdef APP-PLUS || H5 -->

View File

@@ -49,7 +49,7 @@
} }
}, },
onLoad(e) { onLoad(e) {
console.log(e) console.log(e,'调试')
if (e.type == 'list') {//从列表进来的 if (e.type == 'list') {//从列表进来的
this.paygetShopByMember(e.shopId_id) this.paygetShopByMember(e.shopId_id)
}else{ }else{

View File

@@ -11,9 +11,10 @@
<view class="towcontentitemone flex-start"> <view class="towcontentitemone flex-start">
<image class="towcontentitemoneimage" :src="item.logo" mode="aspectFill"></image> <image class="towcontentitemoneimage" :src="item.logo" mode="aspectFill"></image>
<text class="towcontentitemonetext" style="color: #333333;">{{item.chainName}}</text> <text class="towcontentitemonetext" style="color: #333333;">{{item.chainName}}</text>
<!-- 余额<text class="towcontentitemtheretext">{{userInfo.amount || '0.00'}}</text> -->
</view> </view>
<view class="towcontentitemtow flex-between"> <view class="towcontentitemtow flex-between">
<text class="towcontentitemtowetext" style="color:#333333;">{{item.is_vip}}</text> <text class="towcontentitemtowetext" style="color:#333333;">余额:{{item.amount}}</text>
<text>{{item.shopName}}</text> <text>{{item.shopName}}</text>
</view> </view>
</view> </view>

View File

@@ -222,8 +222,7 @@
// }) // })
}, },
onLoad(e) { onLoad(e) {
// 获取用户信息
this.loginwxuserInfo()
// console.log(e, 140) // console.log(e, 140)
let res = JSON.parse(e.tableId) let res = JSON.parse(e.tableId)
this.listinfo.detailList = res this.listinfo.detailList = res
@@ -256,14 +255,7 @@
}) })
}, },
methods: { methods: {
async loginwxuserInfo() {
let res = await this.api.loginwxuserInfo({
userId: uni.cache.get('userInfo').id
})
if (res.code == 0) {
uni.cache.set('userInfo', res.data);
}
},
async getcoupon() { async getcoupon() {
let res = await this.api.userCoupon({ let res = await this.api.userCoupon({
"orderNum": this.listinfo.amount, "orderNum": this.listinfo.amount,

View File

@@ -122,13 +122,14 @@
vipId: null, vipId: null,
ispws: false, ispws: false,
amountVIP: null, amountVIP: null,
listinfoid: null
} }
}, },
methods: { methods: {
async getAount() { async getAount() {
let res = await this.api.shopUserInfo({ let res = await this.api.shopUserInfo({
// shopId:店铺ID // shopId:店铺ID
"shopId":this.info.shopId, "shopId": this.info.shopId,
"userId": uni.cache.get('userInfo').id "userId": uni.cache.get('userInfo').id
}) })
if (res.code == 0) { if (res.code == 0) {
@@ -138,10 +139,10 @@
// 余额支付 // 余额支付
async accountPayevent(pwd) { async accountPayevent(pwd) {
this.ispws = false this.ispws = false
let res = await this.api.accountPay({ let res = await this.api.payOrderPay({
orderId: this.listinfoid, orderId: this.listinfoid,
memberId: this.amountVIP.id, payType: "deposit",
pwd: pwd pwd
}) })
if (res.code == 0) { if (res.code == 0) {
uni.showToast({ uni.showToast({
@@ -166,49 +167,40 @@
}, },
goRecharge() { goRecharge() {
uni.pro.navigateTo('/pages/member/index', { uni.pro.navigateTo('/pages/member/index', {
shopId_id: uni.cache.get('shopUser') shopId_id: this.info.shopId
}) })
}, },
async sumbitFrom() { async sumbitFrom() {
// radiovalue1:为1的时候微信支付,为2是会员卡,需要输入支付密码 let payMoney = this.info.salePrice * this.Quantity
if (this.radiovalue1 == 1) { let res = await this.api.creatGroupOrder({
let payMoney = this.info.salePrice * this.Quantity num: this.Quantity,
let res = await this.api.creatGroupOrder({ proId: this.info.proId,
num: this.Quantity, shopId: this.info.shopId,
proId: this.info.proId, payAmount: payMoney,
shopId: this.info.shopId, orderAmount: payMoney
payAmount: payMoney, })
orderAmount: payMoney if (res.code == 0) {
}) this.listinfoid = res.data.id
if (res.code == 0) { // radiovalue1:为1的时候微信支付,为2是会员卡,需要输入支付密码
if (this.radiovalue1 == 1) {
// 调用支付接口 // 调用支付接口
this.payEvent(res.data.id) this.payEvent(res.data.id)
}
} else {
// let res = await this.api.accountPay({
// orderId: this.orderIds,
// memberId:this.vipId
// })
// if (res.code == 0) {
// }
// 先判断是否设置支付密码。0是没设置。没设置的情况下跳转到设置页面。有的话输入支付密码
let isVip = uni.cache.get('userInfo').isPwd
if (isVip == 0) {
uni.pro.navigateTo('/pages/user/repairpassword', {
// shopId_id: uni.cache.get('shopUser')
})
} else { } else {
this.ispws = true // 先判断是否设置支付密码。0是没设置。没设置的情况下跳转到设置页面。有的话输入支付密码
this.$nextTick(() => { let isVip = uni.cache.get('userInfo').isPwd
this.$refs.payPwd.onPayUp(); if (isVip == 0) {
}) uni.pro.navigateTo('/pages/user/repairpassword', {
// shopId_id: uni.cache.get('shopUser')
})
} else {
this.ispws = true
this.$nextTick(() => {
this.$refs.payPwd.onPayUp();
})
}
} }
} }
}, },
async payEvent(id) { async payEvent(id) {
let res = await this.api.payOrderPay({ let res = await this.api.payOrderPay({
@@ -217,7 +209,6 @@
orderType: 'group' orderType: 'group'
}) })
if (res) { if (res) {
console.log(res, '调试1')
uni.requestPayment({ uni.requestPayment({
provider: 'wxpay', //支付类型-固定值 provider: 'wxpay', //支付类型-固定值
partnerid: res.data.appId, // 微信支付商户号 partnerid: res.data.appId, // 微信支付商户号

View File

@@ -10,7 +10,7 @@
</button> --> </button> -->
<!-- <image class="onecontentboximage" :src="userHeadImg" mode="" @click="uploadImg"></image> --> <!-- <image class="onecontentboximage" :src="userHeadImg" mode="" @click="uploadImg"></image> -->
<button type="default" class="btn" open-type="chooseAvatar" @chooseavatar="uploadImg"> <button type="default" class="btn" open-type="chooseAvatar" @chooseavatar="uploadImg">
<view class="" :style="'background-image:url('+userHeadImg+');'" style="width: 200rxp;height: 200rpx;"></view> <view class="" :style="'background-image:url('+userHeadImg+');'" style="width: 180rxp;height: 180rpx;"></view>
</button> </button>
@@ -223,8 +223,6 @@
border-radius: 100%; border-radius: 100%;
padding: 0; padding: 0;
>view{ >view{
width: 200rpx;
height: 200rpx;
border-radius: 100%; border-radius: 100%;
} }
} }

View File

@@ -52,6 +52,7 @@
}; };
}, },
onLoad() { onLoad() {
if (uni.cache.get('userInfo').isPwd != 0) { if (uni.cache.get('userInfo').isPwd != 0) {
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
title: '忘记支付密码', // 标题文本,必须是字符串 title: '忘记支付密码', // 标题文本,必须是字符串
@@ -84,6 +85,14 @@
}, 60000); }, 60000);
} }
}, },
async loginwxuserInfo() {
let res = await this.api.loginwxuserInfo({
userId: uni.cache.get('userInfo').id
})
if (res.code == 0) {
uni.cache.set('userInfo', res.data);
}
},
async userInfosavePayPassword() { async userInfosavePayPassword() {
if (this.form.mobile.length != 11 && this.isPwd == 0) { if (this.form.mobile.length != 11 && this.isPwd == 0) {
@@ -145,6 +154,8 @@
icon: 'none' icon: 'none'
}); });
} }
// 获取用户信息
this.loginwxuserInfo()
setTimeout(() => { setTimeout(() => {
uni.navigateBack(); uni.navigateBack();
}, 1000); }, 1000);

View File

@@ -23,7 +23,7 @@
<!-- #endif --> <!-- #endif -->
<view class="boxtop_top flex-between"> <view class="boxtop_top flex-between">
<view class="boxtop_topleft"> <view class="boxtop_topleft">
<view class="flex-start" v-if="userInfo.nickName"> <view class="flex-start" v-if="userInfo.nickName" @click="clickinformation">
<image style="width: 108rpx; height: 108rpx; border-radius: 50%;" v-if="userInfo.headImg" <image style="width: 108rpx; height: 108rpx; border-radius: 50%;" v-if="userInfo.headImg"
:src="userInfo.headImg" mode="aspectFill"> :src="userInfo.headImg" mode="aspectFill">
</image> </image>
@@ -33,7 +33,7 @@
<text>去登录</text> <text>去登录</text>
</view> </view>
</view> </view>
<image style="width: 44rpx; height: 42.26rpx;" <image style="width: 44rpx; height: 42.26rpx;" @click="clickphone()"
src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/user/kf.png" mode="aspectFill"> src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/user/kf.png" mode="aspectFill">
</view> </view>
@@ -99,6 +99,11 @@
} }
}, },
methods: { methods: {
clickphone() {
uni.makePhoneCall({
phoneNumber: uni.cache.get('userInfo').custPhone
});
},
clickinformation() { clickinformation() {
uni.pro.navigateTo('user/information') uni.pro.navigateTo('user/information')
}, },