This commit is contained in:
唐明明
2023-02-13 11:58:29 +08:00
parent da7b903547
commit 8d8c14ec66
33 changed files with 879 additions and 90 deletions

View File

@@ -1,20 +1,25 @@
<template>
<view class="introduce" v-if='loaded'>
<image class="richTxt" :src="base.cover" mode="widthFix" />
<view class="nowbuy" @click="nowBuy" v-if="!is_recharge"> <view class="btn">{{base.price}} 立即购买 </view> </view>
<view class="nowbuy nonebuy" v-else> <view class="btn"> 已开通 </view> </view>
<view class="nowbuy" @click="nowBuy" v-if="!is_recharge">
<view class="btn">{{base.price}}立即购买</view>
</view>
<view class="nowbuy nonebuy" v-else>
<view class="btn">已购买</view>
</view>
</view>
</template>
<script>
import {
recharge,zyPay
} from '@/apis/interfaces/index.js'
import { recharge } from '@/apis/interfaces/index.js'
import { umsFree } from '@/apis/interfaces/pay.js'
export default {
data() {
return {
loaded:false,
base: '',
is_recharge: true,
identity : false,
loaded : false,
base : '',
is_recharge : true,
parent : false,
}
},
onLoad(e) {
@@ -23,6 +28,8 @@
methods:{
getInfo(){
recharge().then(res => {
this.parent = res.parent
this.identity = res.identity
this.base = res.base
this.is_recharge = res.is_recharge
this.loaded = true
@@ -36,24 +43,37 @@
})
},
nowBuy(){
zyPay(this.base.service_id).then(res => {
uni.showToast({
title: '支付成功',
icon: 'none',
mask: true,
duration: 2000
})
this.is_recharge = true
}).catch(err => {
console.log(err)
uni.showToast({
title: err.message,
icon: 'none',
mask: true,
duration: 2000
})
})
if(!this.parent){
uni.showModal({
title : '提示',
content : '暂无推荐人无法购买自由服务包',
cancelText : '取消',
confirmText : '确定',
showCancel : false,
})
return
}
if(!this.identity){
uni.showModal({
title : '提示',
content : '当前身份暂时无法购买自由服务包,请开通业务员后重试',
cancelText : '取消',
confirmText : '去开通',
success : res => {
if(res.confirm){
this.$Router.pushTab({name: 'Work'})
}
}
})
return
}
this.$Router.replace({
name : 'Pay',
params : {
paytype : 'free',
serviceId : this.base.service_id,
}
})
}
}
}