[解决冲突]
This commit is contained in:
@@ -136,20 +136,11 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
identities,
|
||||
vipOrder,
|
||||
vipWechatPay,
|
||||
vipCont,
|
||||
vipVoucherUpdate,
|
||||
vipVoucher
|
||||
} from '@/apis/interfaces/vip';
|
||||
import {
|
||||
wxConfig
|
||||
} from '@/apis/interfaces/wx';
|
||||
import {
|
||||
uploads
|
||||
} from '@/apis/interfaces/uploading';
|
||||
import { identities, vipOrder, vipWechatPay, vipCont, vipVoucherUpdate, vipVoucher } from '@/apis/interfaces/vip';
|
||||
import { wxConfig } from '@/apis/interfaces/wx';
|
||||
import { getAliPayConfig } from '@/apis/interfaces/alipay'
|
||||
import { uploads } from '@/apis/interfaces/uploading';
|
||||
import cashierPay from '@/public/cashierPay'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
@@ -175,8 +166,7 @@
|
||||
},
|
||||
created() {
|
||||
// 获取当前用户信息
|
||||
this.idenInfo('cre')
|
||||
|
||||
this.idenInfo('cre')
|
||||
},
|
||||
methods: {
|
||||
// 当前用户信息
|
||||
@@ -234,7 +224,7 @@
|
||||
},
|
||||
|
||||
// 开通会员
|
||||
openOrder() {
|
||||
openOrder() {
|
||||
let can = this.canBtn,
|
||||
identitiesId = this.identitie[this.tabsIndex].identity_id;
|
||||
if (this.selected == false) {
|
||||
@@ -243,56 +233,60 @@
|
||||
icon: 'none'
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (can.on_line) {
|
||||
this.wxPayAppConfig()
|
||||
}
|
||||
if (can.on_line) {
|
||||
uni.showActionSheet({
|
||||
itemList: ['微信支付', '支付宝支付'],
|
||||
success : res => {
|
||||
this.payAppConfig(res.tapIndex)
|
||||
}
|
||||
})
|
||||
//
|
||||
} else {
|
||||
this.canClick()
|
||||
}
|
||||
},
|
||||
// 支付创建订单APP
|
||||
wxPayAppConfig() {
|
||||
let identity = this.identitie[this.tabsIndex].identity_id
|
||||
vipOrder(identity, {
|
||||
year: 1,
|
||||
}).then(res => {
|
||||
this.wechatAppPay(res.id)
|
||||
}).catch(err => {
|
||||
},
|
||||
// 创建订单
|
||||
payAppConfig(payType){
|
||||
let identity = this.identitie[this.tabsIndex].identity_id
|
||||
vipOrder(identity,{
|
||||
year:1,
|
||||
}).then(res=>{
|
||||
if(payType === 0) this.wechatAppPay(res.id)
|
||||
if(payType === 1) this.aliPayConfig(res.id)
|
||||
}).catch(err=>{
|
||||
uni.showToast({
|
||||
title: err.message,
|
||||
icon: "none"
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
// 支付宝支付
|
||||
aliPayConfig(orderId){
|
||||
getAliPayConfig(orderId, {
|
||||
type: 'app'
|
||||
}).then(res => {
|
||||
cashierPay.pay('alipay', res.wechat).then(payRes=> {
|
||||
this.idenInfo()
|
||||
})
|
||||
}).catch(err => {
|
||||
uni.showToast({
|
||||
title:err.message,
|
||||
icon:"none"
|
||||
})
|
||||
})
|
||||
},
|
||||
// 微信支付 APP
|
||||
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 => {
|
||||
wechatAppPay(orderId){
|
||||
vipWechatPay(orderId,{
|
||||
type: 'app'
|
||||
}).then(res=>{
|
||||
let payConfig = JSON.parse(res)
|
||||
cashierPay.pay('wxpay', payConfig).then(payRes=> {
|
||||
this.idenInfo()
|
||||
})
|
||||
}).catch(err=>{
|
||||
uni.showToast({
|
||||
title: err.message,
|
||||
icon: "none"
|
||||
|
||||
Reference in New Issue
Block a user