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

View File

@@ -98,7 +98,8 @@
<block v-else> <block v-else>
<view class="privilege-label" v-if="openCondition.certification" <view class="privilege-label" v-if="openCondition.certification"
:class="{ active: openCondition.certification.finish }"> :class="{ active: openCondition.certification.finish }">
{{ openCondition.certification.message }}</view> {{ openCondition.certification.message }}
</view>
</block> </block>
</view> </view>
</view> </view>
@@ -128,7 +129,8 @@
:src="identitie[tabsIndex].button_cover" mode="widthFix" @click="openOrder" /> :src="identitie[tabsIndex].button_cover" mode="widthFix" @click="openOrder" />
<view class="current-btn-sh" v-if="identitie[tabsIndex].can.show_button && voucher !== ''" <view class="current-btn-sh" v-if="identitie[tabsIndex].can.show_button && voucher !== ''"
@click="openOrder"> @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="current-btn-sh" v-if="!identitie[tabsIndex].can.show_button && voucher === ''">已开通</view> -->
<view class="ios-bottom"></view> <view class="ios-bottom"></view>
</view> </view>
@@ -136,10 +138,23 @@
</template> </template>
<script> <script>
import { identities, vipOrder, vipWechatPay, vipCont, vipVoucherUpdate, vipVoucher } from '@/apis/interfaces/vip'; import {
import { wxConfig } from '@/apis/interfaces/wx'; identities,
import { getAliPayConfig } from '@/apis/interfaces/alipay' vipOrder,
import { uploads } from '@/apis/interfaces/uploading'; 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' import cashierPay from '@/public/cashierPay'
export default { export default {
data() { data() {
@@ -237,7 +252,7 @@
if (can.on_line) { if (can.on_line) {
uni.showActionSheet({ uni.showActionSheet({
itemList: ['微信支付', '支付宝支付'], itemList: ['微信支付', '支付宝支付'],
success : res => { success: res => {
this.payAppConfig(res.tapIndex) this.payAppConfig(res.tapIndex)
} }
}) })
@@ -247,14 +262,14 @@
} }
}, },
// 创建订单 // 创建订单
payAppConfig(payType){ payAppConfig(payType) {
let identity = this.identitie[this.tabsIndex].identity_id let identity = this.identitie[this.tabsIndex].identity_id
vipOrder(identity,{ vipOrder(identity, {
year:1, year: 1,
}).then(res=>{ }).then(res => {
if(payType === 0) this.wechatAppPay(res.id) if (payType === 0) this.wechatAppPay(res.id)
if(payType === 1) this.aliPayConfig(res.id) if (payType === 1) this.aliPayConfig(res.id)
}).catch(err=>{ }).catch(err => {
uni.showToast({ uni.showToast({
title: err.message, title: err.message,
icon: "none" icon: "none"
@@ -263,30 +278,30 @@
}, },
// 支付宝支付 // 支付宝支付
aliPayConfig(orderId){ aliPayConfig(orderId) {
getAliPayConfig(orderId, { getAliPayConfig(orderId, {
type: 'app' type: 'app'
}).then(res => { }).then(res => {
cashierPay.pay('alipay', res.wechat).then(payRes=> { cashierPay.pay('alipay', res.wechat).then(payRes => {
this.idenInfo() this.idenInfo()
}) })
}).catch(err => { }).catch(err => {
uni.showToast({ uni.showToast({
title:err.message, title: err.message,
icon:"none" icon: "none"
}) })
}) })
}, },
// 微信支付 APP // 微信支付 APP
wechatAppPay(orderId){ wechatAppPay(orderId) {
vipWechatPay(orderId,{ vipWechatPay(orderId, {
type: 'app' type: 'app'
}).then(res=>{ }).then(res => {
let payConfig = JSON.parse(res) let payConfig = JSON.parse(res)
cashierPay.pay('wxpay', payConfig).then(payRes=> { cashierPay.pay('wxpay', payConfig).then(payRes => {
this.idenInfo() this.idenInfo()
}) })
}).catch(err=>{ }).catch(err => {
uni.showToast({ uni.showToast({
title: err.message, title: err.message,
icon: "none" icon: "none"

File diff suppressed because one or more lines are too long