[下单微信支付处理及首页隐藏优惠券和更多]

This commit is contained in:
2021-10-27 17:31:29 +08:00
parent e4b1f33c6c
commit 58ec38837a
3 changed files with 159 additions and 169 deletions

View File

@@ -4,22 +4,29 @@
<view class="canBack" v-if="canForm"></view>
<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>
<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" />
<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>
<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>
<image class="canPop-cover" :src="canFromImg.showpath || require('@/static/icons/add-icon.png')"
@click="updImg()" mode="aspectFill"></image>
<view class="canPop-btn" @click="canSubmit">提交</view>
</block>
</view>
<swiper class="vip-container" previous-margin="55rpx" next-margin="55rpx" :current="tabsIndex" circular
@@ -34,8 +41,10 @@
src="../../static/user/vip_privilege_03.png" mode="widthFix"></image>
</view>
<view class="vip-number" v-if="item.count">
{{ item.count.stock > 0 ? '剩余名额:' + item.count.residue : '不限名数' }}</view>
<view class="currentInfo" v-if="currentInfo.identity.identity_id === item.identity_id">当前身份</view>
{{ item.count.stock > 0 ? '剩余名额:' + item.count.residue : '不限名数' }}
</view>
<view class="currentInfo" v-if="currentInfo.identity.identity_id === item.identity_id">当前身份
</view>
<view class="vip-tips">
<!-- 会员 -->
<view v-if="item.identity_id == 2" class="vip-tips-text vip-tips-color-01">{{ item.title }}
@@ -43,15 +52,18 @@
<!-- VIP节点 -->
<view v-else-if="item.identity_id == 3" class="vip-tips-text vip-tips-color-02">
{{ item.title }}</view>
{{ item.title }}
</view>
<!-- 主节点 -->
<view v-else-if="item.identity_id == 4" class="vip-tips-text vip-tips-color-03">
{{ item.title }}</view>
{{ item.title }}
</view>
<!-- 超级节点 -->
<view v-else-if="item.identity_id == 5" class="vip-tips-text vip-tips-color-04">
{{ item.title }}</view>
{{ item.title }}
</view>
</view>
</view>
</view>
@@ -74,16 +86,19 @@
<block v-if="openCondition.energy_shard">
<view class="privilege-label" :class="{ active: openCondition.energy_shard.finish }">
{{ openCondition.energy_shard.message }}
<uni-icons v-if="openCondition.energy_shard.finish" type="checkmarkempty" size="17" color="#f6b338"></uni-icons>
<uni-icons v-if="openCondition.energy_shard.finish" type="checkmarkempty" size="17"
color="#f6b338"></uni-icons>
</view>
<view class="privilege-label" :class="{ active: openCondition.price.finish }" v-if="!openCondition.energy_shard.finish">
<view class="privilege-label" :class="{ active: openCondition.price.finish }"
v-if="!openCondition.energy_shard.finish">
{{ openCondition.price.message }}
</view>
<view class="privilege-label" v-else>{{ openCondition.service_charge.message }}</view>
</block>
<block v-else>
<view class="privilege-label" v-if="openCondition.certification"
:class="{ active: openCondition.certification.finish }">{{ openCondition.certification.message }}</view>
:class="{ active: openCondition.certification.finish }">
{{ openCondition.certification.message }}</view>
</block>
</view>
</view>
@@ -108,11 +123,14 @@
</view>
<!-- 开通按钮 -->
<view class="footer" >
<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="ios-bottom"></view>
<view class="footer">
<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="ios-bottom"></view>
</view>
</view>
</template>
@@ -152,7 +170,7 @@
path: ''
},
openCondition: {},
voucher:'', //弹窗展示得内容
voucher: '', //弹窗展示得内容
}
},
created() {
@@ -162,7 +180,7 @@
},
methods: {
// 当前用户信息
idenInfo(type) {
idenInfo(type) {
identities().then(res => {
res.identities.map(item => {
item.obj_condition = new Object()
@@ -173,15 +191,16 @@
};
}
return item;
});
this.identitie = res.identities
if (type === 'cre') {
let Index = res.identities.findIndex(val => val.identity_id == this.$Route.query.identity_id)
if(Index+1 === res.identities.length){
let Index = res.identities.findIndex(val => val.identity_id == this.$Route.query
.identity_id)
if (Index + 1 === res.identities.length) {
this.tabsIndex = Index
}else{
this.tabsIndex = Index+1
} else {
this.tabsIndex = Index + 1
}
}
this.openCondition = res.identities[this.tabsIndex].obj_condition
@@ -190,13 +209,14 @@
this.canBtn = res.identities[this.tabsIndex].can
this.currentInfo = res.user
this.loding = false
this.voucher = this.identitie[this.tabsIndex].voucher?this.identitie[this.tabsIndex].voucher:''
if(this.voucher){
this.voucher = this.identitie[this.tabsIndex].voucher ? this.identitie[this.tabsIndex]
.voucher : ''
if (this.voucher) {
this.canFromImg = this.identitie[this.tabsIndex].voucher.cover
}else{
} else {
this.canFromImg = {
path:'',
showpath:''
path: '',
showpath: ''
}
}
}).catch(err => {
@@ -209,7 +229,7 @@
// 切换开通身份
swiperChange(e) {
this.tabsIndex = e.detail.current
this.tabsIndex = e.detail.current
this.idenInfo()
},
@@ -223,67 +243,69 @@
icon: 'none'
});
return;
}
if (can.on_line) {
this.wxPayAppConfig()
}
if (can.on_line) {
this.wxPayAppConfig()
} else {
this.canClick()
}
},
// 支付创建订单APP
wxPayAppConfig(){
let identity = this.identitie[this.tabsIndex].identity_id
vipOrder(identity,{
year:1,
}).then(res=>{
wxPayAppConfig() {
let identity = this.identitie[this.tabsIndex].identity_id
vipOrder(identity, {
year: 1,
}).then(res => {
this.wechatAppPay(res.id)
}).catch(err=>{
}).catch(err => {
uni.showToast({
title:err.message,
icon:"none"
title: err.message,
icon: "none"
})
})
},
// 微信支付 APP
wechatAppPay(orderId){
vipWechatPay(orderId,{
type: 'app'
}).then(res=>{
let payConfig = JSON.parse(res)
console.log(payConfig,'console.log(res)')
uni.requestPayment({
provider: 'wxpay',
orderInfo: {...payConfig},
success: payRes => {
uni.showModal({
title : "开通提示",
content : "支付成功,已成功开通/升级节点身份",
showCancel : false,
success : ()=> {
this.idenInfo()
}
})
},
wechatAppPay(orderId) {
vipWechatPay(orderId, {
type: 'app'
}).then(res => {
let payConfig = JSON.parse(res)
console.log(payConfig, 'console.log(res)')
uni.requestPayment({
provider: 'wxpay',
orderInfo: {
...payConfig
},
success: payRes => {
uni.showModal({
title: "开通提示",
content: "支付成功,已成功开通/升级节点身份",
showCancel: false,
success: () => {
this.idenInfo()
}
})
},
fail: payErr => {
console.log(payErr,'console.log(payErr)')
uni.showToast({
title: '支付失败,原因:' + payErr.errMsg,
icon : 'none'
})
}
})
}).catch(err=>{
console.log(payErr, 'console.log(payErr)')
uni.showToast({
title: '支付失败',
icon: 'none'
})
}
})
}).catch(err => {
uni.showToast({
title:err.message,
icon:"none"
title: err.message,
icon: "none"
})
})
},
// 勾选协议
agreeChange() {
this.selected = !this.selected;
},
},
// 会员权益介绍
showRemark(title, val) {
uni.showModal({
@@ -315,10 +337,10 @@
})
},
// 预览图片
preImg(){
preImg() {
uni.previewImage({
current:this.voucher.cover.showpath,
urls:[this.voucher.cover.showpath]
current: this.voucher.cover.showpath,
urls: [this.voucher.cover.showpath]
})
},
@@ -347,9 +369,9 @@
})
},
// 编辑凭证
canSubmitEdit(id){
canSubmitEdit(id) {
let newCover = this.canFromImg.path
vipVoucherUpdate(id,{
vipVoucherUpdate(id, {
cover: newCover
}).then(res => {
this.$Router.push({
@@ -415,11 +437,12 @@
height: 240rpx;
border: 2rpx solid #f3f3f3;
}
.canPop-remark{
.canPop-remark {
margin-bottom: 20rpx;
}
.canPop-status{
.canPop-status {
margin-bottom: 10rpx;
}
@@ -632,7 +655,8 @@
.footer-btn {
width: 74%;
}
.current-btn{
.current-btn {
width: 74%;
height: 80rpx;
background-image: linear-gradient(to right, #7c52fc, #976dff);
@@ -642,7 +666,8 @@
line-height: 80rpx;
font-size: 36rpx;
}
.current-btn-sh{
.current-btn-sh {
background-color: #cacaca;
width: 74%;
height: 80rpx;