This commit is contained in:
2021-10-29 10:47:43 +08:00
parent e79bb6df78
commit efdd8e61cb
3 changed files with 1094 additions and 1062 deletions

View File

@@ -1,4 +1,3 @@
/**
* Web唐明明
* 匆匆数载恍如梦,岁月迢迢华发增。
@@ -6,7 +5,9 @@
* moduleName: 会员
*/
import { request } from '../index'
import {
request
} from '../index'
// 会员身份信息
const identities = () => {
@@ -16,11 +17,11 @@ const identities = () => {
}
// 提交开通订单
const vipOrder = (id, data) =>{
const vipOrder = (id, data) => {
return request({
url : 'user/identities/create/' + id,
method : 'POST',
data : data
url: 'user/identities/create/' + id,
method: 'POST',
data: data
})
}
@@ -33,44 +34,44 @@ const vipWechatPay = (order_id, data) => {
}
// 开通身份内容
const vipCont = (id, data) =>{
const vipCont = (id, data) => {
return request({
url : 'user/identities/create/' + id,
data : data
url: 'user/identities/create/' + id,
data: data
})
}
// 上传打款凭证
const vipVoucher = (data) =>{
const vipVoucher = (data) => {
return request({
url : 'user/voucher/store',
method : 'POST',
data : data
url: 'user/voucher/store',
method: 'POST',
data: data
})
}
// 编辑凭证
const vipVoucherUpdate = (id,data) =>{
const vipVoucherUpdate = (id, data) => {
return request({
url : 'user/voucher/'+id+'/update',
method : 'POST',
data : data
url: 'user/voucher/' + id + '/update',
method: 'POST',
data: data
})
}
// 用户协议
const userAgree = (apiUrl) => {
return request({
url: apiUrl
})
return request({
url: apiUrl
})
}
export {
identities,
vipOrder,
vipWechatPay,
vipCont,
vipVoucher,
userAgree,
vipCont,
vipVoucher,
userAgree,
vipVoucherUpdate
}

View File

@@ -98,7 +98,8 @@
<block v-else>
<view class="privilege-label" v-if="openCondition.certification"
:class="{ active: openCondition.certification.finish }">
{{ openCondition.certification.message }}</view>
{{ openCondition.certification.message }}
</view>
</block>
</view>
</view>
@@ -128,7 +129,8 @@
: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>
{{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="ios-bottom"></view>
</view>
@@ -136,10 +138,23 @@
</template>
<script>
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 {
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() {
@@ -166,7 +181,7 @@
},
created() {
// 获取当前用户信息
this.idenInfo('cre')
this.idenInfo('cre')
},
methods: {
// 当前用户信息
@@ -224,7 +239,7 @@
},
// 开通会员
openOrder() {
openOrder() {
let can = this.canBtn,
identitiesId = this.identitie[this.tabsIndex].identity_id;
if (this.selected == false) {
@@ -233,60 +248,60 @@
icon: 'none'
});
return;
}
if (can.on_line) {
uni.showActionSheet({
itemList: ['微信支付', '支付宝支付'],
success : res => {
this.payAppConfig(res.tapIndex)
}
})
//
}
if (can.on_line) {
uni.showActionSheet({
itemList: ['微信支付', '支付宝支付'],
success: res => {
this.payAppConfig(res.tapIndex)
}
})
//
} else {
this.canClick()
}
},
},
// 创建订单
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=>{
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"
})
})
},
// 支付宝支付
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)
cashierPay.pay('wxpay', payConfig).then(payRes=> {
this.idenInfo()
})
}).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"

File diff suppressed because one or more lines are too long