优化功能
This commit is contained in:
@@ -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, // 微信支付商户号
|
||||
|
||||
Reference in New Issue
Block a user