处理小程序 二维码不消失问题处理

This commit is contained in:
java110 2021-03-30 15:16:21 +08:00
parent d2463fcc93
commit 7aa0df1f4e
3 changed files with 70 additions and 29 deletions

View File

@ -281,6 +281,15 @@
"navigationBarTitleText": "空置房详情"
}
}
,{
"path" : "pages/payFeeByQrCode/payFeeByQrCode",
"style" :
{
"navigationBarTitleText": "请扫二维码支付",
"enablePullDownRefresh": false
}
}
],
"globalStyle": {
"navigationBarTextStyle": "white",

View File

@ -0,0 +1,41 @@
<template>
<view>
<view class="padding-xl margin-top">
<canvas style="width: 300upx;height: 300upx; margin: 0 auto;" canvas-id="oweFeeQrcode"></canvas>
</view>
<view class="padding flex flex-direction margin-top">
<button class="cu-btn bg-green margin-tb-sm lg" @tap="_closePayModal()">已支付</button>
</view>
</view>
</template>
<script>
const qrCode = require('@/lib/weapp-qrcode.js')
export default {
data() {
return {
}
},
onLoad(options) {
new qrCode('oweFeeQrcode', {
text: options.url,
width: 150,
height: 150,
colorDark: "#333333",
colorLight: "#FFFFFF",
correctLevel: qrCode.CorrectLevel.H
})
},
methods: {
_closePayModal: function() {
this.context.navigateBack();
},
}
}
</script>
<style>
</style>

View File

@ -55,17 +55,6 @@
</view>
</view>
<view class="cu-modal" :class="payModal==true?'show':''">
<view class="cu-dialog">
<view class="padding-xl">
<canvas style="width: 300upx;height: 300upx; margin: 0 auto;" canvas-id="oweFeeQrcode"></canvas>
</view>
<view class="cu-bar bg-white justify-end">
<view class="action margin-0 flex-sub solid-left" @tap="_closePayModal()">关闭</view>
</view>
</view>
</view>
</view>
</template>
@ -79,7 +68,6 @@
toPayOweFee
} from '../../api/fee/fee.js';
const qrCode = require('@/lib/weapp-qrcode.js')
export default {
data() {
return {
@ -94,7 +82,22 @@
fees: [],
receivableAmount: 0.0,
payModal: false,
payQrImg: ''
payQrImg: '',
roomInfo:{
ownerName:'',
link:""
}
}
},
onShow() {
if(this.context.isPageBack()){
this.roomInfo = {
ownerName:'',
link:""
};
this.fees = [];
this.roomInfo.roomId = '';
this.roomNum = '';
}
},
methods: {
@ -191,14 +194,7 @@
this.roomNum = _allNum[2];
this._loadRoomInfo();
},
_closePayModal: function() {
this.payModal = false;
this.roomInfo = {};
this.fees = [];
this.roomInfo.roomId = '';
this.roomNum = '';
},
_payOweFee: function() {
let _that = this;
let _data = {
@ -219,15 +215,10 @@
});
return;
}
_that.payModal = true;
new qrCode('oweFeeQrcode', {
text: _data.codeUrl,
width: 150,
height: 150,
colorDark: "#333333",
colorLight: "#FFFFFF",
correctLevel: qrCode.CorrectLevel.H
this.context.navigateTo({
url:"/pages/payFeeByQrCode/payFeeByQrCode?url="+_data.codeUrl
})
})
}