微信支付

This commit is contained in:
唐明明
2021-10-19 10:06:44 +08:00
parent d363bb8cd7
commit 0fb9a41178
142 changed files with 141 additions and 61 deletions

View File

@@ -112,16 +112,8 @@
<image class="footer-btn" v-if="identitie[tabsIndex].can.show_button && voucher === ''"
:src="identitie[tabsIndex].button_cover" mode="widthFix" @click="openOrder" />
<view class="current-btn-sh" v-if="identitie[tabsIndex].can.show_button && voucher !== ''" @click="openOrder" >{{voucher.status.value === 1?'申请审核中':''}}{{voucher.status.value === 3?'申请被驳回查看原因':''}}</view>
<view class="current-btn-sh" v-if="!identitie[tabsIndex].can.show_button && voucher === ''">我要开通</view>
<!-- <view class="current-btn" v-if="currentInfo.identity.identity_id === identitie[tabsIndex].identity_id">当前身份</view> -->
<!-- <button class="footer-btn" type="default" >
<view class="footer-btn-num">
合计{{total}}
</view>
<view class="footer-btn-pay">
立即支付
</view>
</button> -->
<view class="current-btn-sh" v-if="!identitie[tabsIndex].can.show_button && voucher === ''">开通</view>
<view class="ios-bottom"></view>
</view>
</view>
</template>
@@ -171,9 +163,8 @@
},
methods: {
// 当前用户信息
idenInfo(type) {
idenInfo(type) {
identities().then(res => {
console.log(res, 'res。。。获取身份详情')
res.identities.map(item => {
item.obj_condition = new Object()
for (let val of item.get_condition) {
@@ -204,8 +195,6 @@
showpath:''
}
}
console.log(this.voucher,'voucher...')
console.log(this.canFromImg,'canFromImg...')
}).catch(err => {
uni.showToast({
title: err.message,
@@ -217,8 +206,6 @@
// 切换开通身份
swiperChange(e) {
this.tabsIndex = e.detail.current
// 获取当前用户信息
this.idenInfo()
},
// 开通会员
@@ -233,18 +220,17 @@
return;
}
if (can.on_line) {
console.log("微信pay")
this.wxPayAppConfig()
} else {
this.canClick()
}
return;
},
// 支付创建订单APP
wxPayAppConfig(){
let data = {year:1}
let identity = this.identitie[this.tabsIndex].identity_id
vipOrder(identity,data).then(res=>{
console.log(res)
let identity = this.identitie[this.tabsIndex].identity_id
vipOrder(identity,{
year:1,
}).then(res=>{
this.wechatAppPay(res.id)
}).catch(err=>{
uni.showToast({
@@ -254,14 +240,31 @@
})
},
// 微信支付 APP
wechatAppPay(orderid){
let data = {
type:'app'
}
let orderId = orderid
vipWechatPay(orderId,data).then(res=>{
console.log('-----------------')
console.log(res)
wechatAppPay(orderId){
vipWechatPay(orderId,{
type: 'app'
}).then(res=>{
let payConfig = JSON.parse(res)
uni.requestPayment({
provider: 'wxpay',
orderInfo: {...payConfig},
success: payRes => {
uni.showModal({
title : "开通提示",
content : "支付成功,已成功开通/升级节点身份",
showCancel : false,
success : ()=> {
this.idenInfo()
}
})
},
fail: payErr => {
uni.showToast({
title: '支付已被取消',
icon : 'none'
})
}
})
}).catch(err=>{
uni.showToast({
title:err.message,
@@ -306,7 +309,6 @@
},
// 预览图片
preImg(){
console.log('袁兰图片')
uni.previewImage({
current:this.voucher.cover.showpath,
urls:[this.voucher.cover.showpath]