[开通节点模块样式调整及底部按钮状态处理及申请状态处理及支未完付]

This commit is contained in:
2021-10-13 16:31:58 +08:00
parent 3bfa9a7e20
commit 50fb945707
5 changed files with 219 additions and 97 deletions

View File

@@ -49,6 +49,15 @@ const vipVoucher = (data) =>{
}) })
} }
// 编辑凭证
const vipVoucherUpdate = (id,data) =>{
return request({
url : 'user/voucher/'+id+'/update',
method : 'POST',
data : data
})
}
// 用户协议 // 用户协议
const userAgree = (apiUrl) => { const userAgree = (apiUrl) => {
return request({ return request({
@@ -62,5 +71,6 @@ export {
vipWechatPay, vipWechatPay,
vipCont, vipCont,
vipVoucher, vipVoucher,
userAgree userAgree,
vipVoucherUpdate
} }

View File

@@ -64,7 +64,8 @@
"name": "vipIndex", "name": "vipIndex",
"style": { "style": {
"navigationBarTitleText": "开通节点", "navigationBarTitleText": "开通节点",
"navigationBarBackgroundColor": "#774ffd" "navigationBarBackgroundColor": "#774ffd",
"navigationBarTextStyle":"white"
} }
}, { }, {
"path": "pages/vip/agree", "path": "pages/vip/agree",

View File

@@ -5,7 +5,7 @@
<view class="examine-name"> <view class="examine-name">
提交成功,请耐心等待~ 提交成功,请耐心等待~
</view> </view>
<view class="examine-cont" @click="$Router.push({name: 'User'})"> <view class="examine-cont" @click="toUser">
我知道了 我知道了
</view> </view>
</view> </view>
@@ -13,6 +13,16 @@
</template> </template>
<script> <script>
export default {
methods:{
toUser(){
console.log('trule')
uni.switchTab({
url:'/pages/user/index'
})
}
}
}
</script> </script>
<style> <style>

View File

@@ -3,11 +3,23 @@
<!-- 上传凭证弹出 --> <!-- 上传凭证弹出 -->
<view class="canBack" v-if="canForm"></view> <view class="canBack" v-if="canForm"></view>
<view class="canPop" v-if="canForm"> <view class="canPop" v-if="canForm">
<block v-if="voucher">
<image class="canPop-tips" @click="canClick" src="/static/user/order-cancelPay.png" mode="widthFix"></image>
<view class="canPop-cont">打款凭证</view>
<image class="canPop-cover" v-if="voucher.status.value === 3" :src="canFromImg.showpath || require('@/static/icons/add-icon.png')" @click="updImg()" mode="aspectFill" />
<image class="canPop-cover" v-else :src="canFromImg.showpath || require('@/static/icons/add-icon.png')" @click="preImg()" mode="aspectFill" />
<view class="canPop-status">状态{{voucher.status.text}}</view>
<view class="canPop-remark" v-if="voucher.remark && voucher.status.value === 3">驳回原因{{voucher.remark}}</view>
<view class="canPop-btn" v-if="voucher.status.value === 3" @click="canSubmitEdit(voucher.voucher_id)">重新提交</view>
</block>
<block v-else>
<image class="canPop-tips" @click="canClick" src="/static/user/order-cancelPay.png" mode="widthFix"></image> <image class="canPop-tips" @click="canClick" src="/static/user/order-cancelPay.png" mode="widthFix"></image>
<view class="canPop-cont">上传打款凭证</view> <view class="canPop-cont">上传打款凭证</view>
<image class="canPop-cover" :src="canFromImg.showpath || require('@/static/icons/add-icon.png')" <image class="canPop-cover" :src="canFromImg.showpath || require('@/static/icons/add-icon.png')"
@click="updImg()" mode="aspectFill"></image> @click="updImg()" mode="aspectFill"></image>
<view class="canPop-btn" @click="canSubmit">提交</view> <view class="canPop-btn" @click="canSubmit">提交</view>
</block>
</view> </view>
<swiper class="vip-container" previous-margin="55rpx" next-margin="55rpx" :current="tabsIndex" circular <swiper class="vip-container" previous-margin="55rpx" next-margin="55rpx" :current="tabsIndex" circular
@@ -86,18 +98,22 @@
</view> </view>
<!-- 用户协议 --> <!-- 用户协议 -->
<view class="agree"> <view class="agree" v-if="identitie[tabsIndex].can.show_button">
<view class="agree-tips" @click="$Router.push({ name: 'vipAgree', params: { type: 'vipAgree' } })"> <view class="agree-tips" @click="$Router.push({ name: 'vipAgree', params: { type: 'vipAgree' } })">
请仔细阅读并确认服务协议</view> 请仔细阅读并确认服务协议</view>
</view> </view>
<view class="agree-btn" @click="agreeChange"> <view class="agree-btn" @click="agreeChange" v-if="identitie[tabsIndex].can.show_button">
<radio :checked="selected" style="transform: scale(.7);" color="#7c52fc"></radio> <radio :checked="selected" style="transform: scale(.7);" color="#7c52fc"></radio>
会员服务协议 会员服务协议
</view> </view>
<!-- 开通按钮 --> <!-- 开通按钮 -->
<view class="footer" > <view class="footer" >
<image class="footer-btn" :src="identitie[tabsIndex].button_cover" mode="widthFix" @click="openOrder" /> <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" > <!-- <button class="footer-btn" type="default" >
<view class="footer-btn-num"> <view class="footer-btn-num">
合计{{total}} 合计{{total}}
@@ -116,6 +132,7 @@
vipOrder, vipOrder,
vipWechatPay, vipWechatPay,
vipCont, vipCont,
vipVoucherUpdate,
vipVoucher vipVoucher
} from '@/apis/interfaces/vip'; } from '@/apis/interfaces/vip';
import { import {
@@ -143,12 +160,13 @@
showpath: '', showpath: '',
path: '' path: ''
}, },
openCondition: {} openCondition: {},
}; voucher:'', //弹窗展示得内容
}
}, },
created() { created() {
// 获取当前用户信息 // 获取当前用户信息
this.idenInfo('cre'); this.idenInfo('cre')
}, },
methods: { methods: {
@@ -157,9 +175,7 @@
identities().then(res => { identities().then(res => {
console.log(res, 'res。。。获取身份详情') console.log(res, 'res。。。获取身份详情')
res.identities.map(item => { res.identities.map(item => {
item.obj_condition = new Object(); item.obj_condition = new Object()
console.log(item.get_condition.length > 0)
for (let val of item.get_condition) { for (let val of item.get_condition) {
item.obj_condition[val.name] = { item.obj_condition[val.name] = {
message: val.message, message: val.message,
@@ -168,32 +184,41 @@
} }
return item; return item;
}); });
this.identitie = res.identities; this.identitie = res.identities
if (type === 'cre') { if (type === 'cre') {
this.tabsIndex = res.identities.findIndex(val => val.identity_id == this.$Route.query this.tabsIndex = res.identities.findIndex(val => val.identity_id == this.$Route.query.identity_id)
.identity_id)
} }
this.openCondition = res.identities[this.tabsIndex].obj_condition; this.openCondition = res.identities[this.tabsIndex].obj_condition
this.rights = res.identities[this.tabsIndex].rights; this.rights = res.identities[this.tabsIndex].rights
this.total = res.identities[this.tabsIndex].price; this.total = res.identities[this.tabsIndex].price
this.canBtn = res.identities[this.tabsIndex].can; this.canBtn = res.identities[this.tabsIndex].can
this.currentInfo = res.user this.currentInfo = res.user
this.loding = false; this.loding = false
this.voucher = this.identitie[this.tabsIndex].voucher || ''
if(this.voucher){
this.canFromImg = this.identitie[this.tabsIndex].voucher.cover
}else{
this.canFromImg = {
path:'',
showpath:''
}
}
console.log(this.voucher,'voucher...')
console.log(this.canFromImg,'canFromImg...')
}).catch(err => { }).catch(err => {
uni.showToast({ uni.showToast({
title: err.message, title: err.message,
icon: 'none' icon: 'none'
}); })
}); })
}, },
// 切换开通身份 // 切换开通身份
swiperChange(e) { swiperChange(e) {
this.tabsIndex = e.detail.current; this.tabsIndex = e.detail.current
// 获取当前用户信息 // 获取当前用户信息
this.idenInfo(); this.idenInfo()
}, },
// 开通会员 // 开通会员
@@ -208,68 +233,59 @@
return; return;
} }
if (can.on_line) { if (can.on_line) {
if (can.buy) { // #ifdef H5
this.wxPayConfig(); this.wxPayH5Config()
// #endif
//#ifdef APP-PLUS
this.wxPayAppConfig()
//#endif
} else { } else {
uni.showToast({ this.canClick()
title: can.message,
icon: 'none'
});
}
} else {
if (can.buy) {
// 上传凭证
this.canClick();
} else {
uni.showToast({
title: can.message,
icon: 'none'
});
}
} }
return; return;
}, },
// 微信支付鉴权 // 微信支付鉴权H5
wxPayConfig() { wxPayH5Config() {
wxConfig({ wxConfig({
url: window.location.href, url: window.location.href,
jsApiList: ['chooseWXPay'] jsApiList: ['chooseWXPay']
}).then(res => { }).then(res => {
let payConfig = JSON.parse(res); let payConfig = JSON.parse(res)
let jweixin = require('jweixin-module'); let jweixin = require('jweixin-module')
jweixin.ready(() => { jweixin.ready(() => {
// res // res
}); })
jweixin.error(err => { jweixin.error(err => {
uni.showToast({ uni.showToast({
title: err, title: err,
icon: 'none' icon: 'none'
}); })
}); })
jweixin.config({ jweixin.config({
...payConfig ...payConfig
}); })
vipOrder(this.identitie[this.tabsIndex].identity_id, { vipOrder(this.identitie[this.tabsIndex].identity_id, {
year: this.sumNumber year: this.sumNumber
}).then(payId => { }).then(payId => {
this.wechatPay(payId.id, jweixin); this.wechatH5Pay(payId.id, jweixin);
}).catch(err => { }).catch(err => {
uni.showToast({ uni.showToast({
title: err.message, title: err.message,
icon: 'none' icon: 'none'
}); })
}); })
}).catch(err => { }).catch(err => {
uni.showToast({ uni.showToast({
title: err.message, title: err.message,
icon: 'none' icon: 'none'
}); })
}); })
}, },
// 微信支付 // 微信支付 H5
wechatPay(id, wx) { wechatH5Pay(id, wx) {
vipWechatPay(id, { vipWechatPay(id, {
type:'mp',
openid: this.$store.getters.getCode openid: this.$store.getters.getCode
}).then(payConfig => { }).then(payConfig => {
wx.chooseWXPay({ wx.chooseWXPay({
@@ -300,6 +316,38 @@
}) })
}, },
// 支付创建订单APP
wxPayAppConfig(){
let data = {year:1}
let identity = this.identitie[this.tabsIndex].identity_id
vipOrder(identity,data).then(res=>{
console.log(res)
this.wechatAppPay(res.id)
}).catch(err=>{
uni.showToast({
title:err.message,
icon:"none"
})
})
},
// 微信支付 APP
wechatAppPay(orderid){
let data = {
type:'app'
}
let orderId = orderid
console.log(orderId,data)
vipWechatPay(orderId,data).then(res=>{
console.log('-----------------')
console.log(res)
}).catch(err=>{
console.log(err)
uni.showToast({
title:err.message,
icon:"none"
})
})
},
// 勾选协议 // 勾选协议
agreeChange() { agreeChange() {
this.selected = !this.selected; this.selected = !this.selected;
@@ -311,7 +359,7 @@
title: title, title: title,
content: val, content: val,
showCancel: false showCancel: false
}); })
}, },
// 上传打款凭证图片 // 上传打款凭证图片
@@ -330,10 +378,18 @@
uni.showToast({ uni.showToast({
title: err.message, title: err.message,
icon: 'none' icon: 'none'
}); })
}); })
} }
}); })
},
// 预览图片
preImg(){
console.log('袁兰图片')
uni.previewImage({
current:this.voucher.cover.showpath,
urls:[this.voucher.cover.showpath]
})
}, },
// 打款凭证弹出状态 // 打款凭证弹出状态
@@ -351,16 +407,34 @@
}).then(res => { }).then(res => {
this.$Router.push({ this.$Router.push({
name: 'Examine' name: 'Examine'
}); })
this.canForm = !this.canForm
}).catch(err => { }).catch(err => {
uni.showToast({ uni.showToast({
title: err.message, title: err.message,
icon: 'none' icon: 'none'
}); })
}); })
},
// 编辑凭证
canSubmitEdit(id){
let newCover = this.canFromImg.path
vipVoucherUpdate(id,{
cover: newCover
}).then(res => {
this.$Router.push({
name: 'Examine'
})
this.canForm = !this.canForm
}).catch(err => {
uni.showToast({
title: err.message,
icon: 'none'
})
})
}
} }
} }
};
</script> </script>
<style> <style>
@@ -406,11 +480,18 @@
} }
.canPop-cover { .canPop-cover {
margin: 60rpx auto 40rpx; margin: 40rpx auto 20rpx auto;
width: 240rpx; width: 240rpx;
height: 240rpx; height: 240rpx;
border: 2rpx solid #f3f3f3; border: 2rpx solid #f3f3f3;
} }
.canPop-remark{
margin-bottom: 20rpx;
}
.canPop-status{
margin-bottom: 10rpx;
}
.canPop-btn { .canPop-btn {
text-align: center; text-align: center;
@@ -621,6 +702,26 @@
.footer-btn { .footer-btn {
width: 74%; width: 74%;
} }
.current-btn{
width: 74%;
height: 80rpx;
background-image: linear-gradient(to right, #7c52fc, #976dff);
color: #fff;
margin-left: 13%;
border-radius: 80rpx;
line-height: 80rpx;
font-size: 36rpx;
}
.current-btn-sh{
background-color: #cacaca;
width: 74%;
height: 80rpx;
color: #fff;
margin-left: 13%;
border-radius: 80rpx;
line-height: 80rpx;
font-size: 36rpx;
}
} }
// 会员权限 // 会员权限

View File