diff --git a/common/js/api.js b/common/js/api.js index 9f3ea91..90c3576 100644 --- a/common/js/api.js +++ b/common/js/api.js @@ -16,6 +16,7 @@ export default { accountPay(data) { return uni.api.get("/pay/accountPay", data); }, + // 下单 creatGroupOrder(data) { return uni.api.post("/groupOrderInfo/creatGroupOrder", data); @@ -142,7 +143,7 @@ export default { return uni.api.get("/distirict/comShopList", data); }, loginOut(data) { //退出登录 - return uni.api.post("/loginOut", data); + return uni.api.post("/login /loginOut", data); }, productqueryShopIdByTableCode(data) { //通过桌码获取shopId return uni.api.get("/product/queryShopIdByTableCode", data); diff --git a/pages/login/login.vue b/pages/login/login.vue index 1f10dec..ca1a4a0 100644 --- a/pages/login/login.vue +++ b/pages/login/login.vue @@ -51,12 +51,14 @@ 其他手机号登录/注册 + 阅读并同意零点八零 《用户协议》《隐私政策》 + diff --git a/pages/member/index.vue b/pages/member/index.vue index 26abab1..a815054 100644 --- a/pages/member/index.vue +++ b/pages/member/index.vue @@ -49,7 +49,7 @@ } }, onLoad(e) { - console.log(e) + console.log(e,'调试') if (e.type == 'list') {//从列表进来的 this.paygetShopByMember(e.shopId_id) }else{ diff --git a/pages/member/list.vue b/pages/member/list.vue index 77c64aa..2756d75 100644 --- a/pages/member/list.vue +++ b/pages/member/list.vue @@ -11,9 +11,10 @@ {{item.chainName}} + - {{item.is_vip}} + 余额:{{item.amount}} {{item.shopName}} diff --git a/pages/order_detail/order_detail.vue b/pages/order_detail/order_detail.vue index 328b037..17c59b7 100644 --- a/pages/order_detail/order_detail.vue +++ b/pages/order_detail/order_detail.vue @@ -222,8 +222,7 @@ // }) }, onLoad(e) { - // 获取用户信息 - this.loginwxuserInfo() + // console.log(e, 140) let res = JSON.parse(e.tableId) this.listinfo.detailList = res @@ -256,14 +255,7 @@ }) }, 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() { let res = await this.api.userCoupon({ "orderNum": this.listinfo.amount, diff --git a/pages/product/placeOrder.vue b/pages/product/placeOrder.vue index b9a5e31..c9e5042 100644 --- a/pages/product/placeOrder.vue +++ b/pages/product/placeOrder.vue @@ -122,13 +122,14 @@ vipId: null, ispws: false, amountVIP: null, + listinfoid: null } }, methods: { async getAount() { let res = await this.api.shopUserInfo({ // shopId:店铺ID - "shopId":this.info.shopId, + "shopId": this.info.shopId, "userId": uni.cache.get('userInfo').id }) if (res.code == 0) { @@ -138,10 +139,10 @@ // 余额支付 async accountPayevent(pwd) { this.ispws = false - let res = await this.api.accountPay({ + let res = await this.api.payOrderPay({ orderId: this.listinfoid, - memberId: this.amountVIP.id, - pwd: pwd + payType: "deposit", + pwd }) if (res.code == 0) { uni.showToast({ @@ -166,49 +167,40 @@ }, goRecharge() { uni.pro.navigateTo('/pages/member/index', { - shopId_id: uni.cache.get('shopUser') + shopId_id: this.info.shopId }) }, async sumbitFrom() { - // radiovalue1:为1的时候微信支付,为2是会员卡,需要输入支付密码 - if (this.radiovalue1 == 1) { - let payMoney = this.info.salePrice * this.Quantity - let res = await this.api.creatGroupOrder({ - num: this.Quantity, - proId: this.info.proId, - shopId: this.info.shopId, - payAmount: payMoney, - orderAmount: payMoney - }) - if (res.code == 0) { + let payMoney = this.info.salePrice * this.Quantity + let res = await this.api.creatGroupOrder({ + num: this.Quantity, + proId: this.info.proId, + shopId: this.info.shopId, + payAmount: payMoney, + orderAmount: payMoney + }) + if (res.code == 0) { + this.listinfoid = res.data.id + // radiovalue1:为1的时候微信支付,为2是会员卡,需要输入支付密码 + if (this.radiovalue1 == 1) { // 调用支付接口 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 { - this.ispws = true - this.$nextTick(() => { - this.$refs.payPwd.onPayUp(); - }) + // 先判断是否设置支付密码。0是没设置。没设置的情况下跳转到设置页面。有的话输入支付密码 + let isVip = uni.cache.get('userInfo').isPwd + 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) { let res = await this.api.payOrderPay({ @@ -217,7 +209,6 @@ orderType: 'group' }) if (res) { - console.log(res, '调试1') uni.requestPayment({ provider: 'wxpay', //支付类型-固定值 partnerid: res.data.appId, // 微信支付商户号 diff --git a/pages/user/information.vue b/pages/user/information.vue index 9e260ed..442100d 100644 --- a/pages/user/information.vue +++ b/pages/user/information.vue @@ -10,7 +10,7 @@ --> @@ -223,8 +223,6 @@ border-radius: 100%; padding: 0; >view{ - width: 200rpx; - height: 200rpx; border-radius: 100%; } } diff --git a/pages/user/repairpassword.vue b/pages/user/repairpassword.vue index 0e9ce5c..6b400ba 100644 --- a/pages/user/repairpassword.vue +++ b/pages/user/repairpassword.vue @@ -52,6 +52,7 @@ }; }, onLoad() { + if (uni.cache.get('userInfo').isPwd != 0) { uni.setNavigationBarTitle({ title: '忘记支付密码', // 标题文本,必须是字符串 @@ -84,6 +85,14 @@ }, 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() { if (this.form.mobile.length != 11 && this.isPwd == 0) { @@ -145,6 +154,8 @@ icon: 'none' }); } + // 获取用户信息 + this.loginwxuserInfo() setTimeout(() => { uni.navigateBack(); }, 1000); diff --git a/pages/user/user.vue b/pages/user/user.vue index c3fd150..e67be35 100644 --- a/pages/user/user.vue +++ b/pages/user/user.vue @@ -23,7 +23,7 @@ - + @@ -33,7 +33,7 @@ 去登录 - @@ -99,6 +99,11 @@ } }, methods: { + clickphone() { + uni.makePhoneCall({ + phoneNumber: uni.cache.get('userInfo').custPhone + }); + }, clickinformation() { uni.pro.navigateTo('user/information') },