dingdong-master/pages/order-manage/modal/pay-qrcode.vue

77 lines
1.7 KiB
Vue
Raw Normal View History

2022-05-09 10:00:16 +08:00
<template>
<!-- 报价/客户支付模态框 -->
<view class="cu-modal" :class="show?'show':''">
2022-06-22 17:40:50 +08:00
<view class="cu-dialog bg-white">
2022-05-09 10:00:16 +08:00
<view class="cu-bar bg-white justify-end">
2022-06-18 02:03:07 +08:00
<view class="content">支付宝扫码支付</view>
<view class="action" data-modal="showPayQrcodeModal" @click="finishQrPay">
2022-05-09 10:00:16 +08:00
<text class="cuIcon-close text-red"></text>
</view>
</view>
2022-06-22 17:40:50 +08:00
<view class="bg-white">
<view class="padding-tb-sm" style="width: 300px; margin: 0 auto;" v-show="modal_qr">
2022-05-09 10:00:16 +08:00
<ayQrcode ref="qrcode" :modal="modal_qr" :url="url" @hideQrcode="hideQrcode" :height="300"
:width="300" />
2022-06-18 02:03:07 +08:00
</view>
</view>
2022-06-22 17:40:50 +08:00
<view class="text-center padding-bottom-xl">
2022-05-09 10:00:16 +08:00
<view>请客户扫描码付款后方能提交完单</view>
2022-06-18 02:03:07 +08:00
<view class="text-red">必须按二维码生成金额支付</view>
2022-06-22 17:40:50 +08:00
</view>
2022-05-09 10:00:16 +08:00
</view>
</view>
</template>
<script>
import ayQrcode from "@/components/ay-qrcode/ay-qrcode.vue";
export default {
2022-06-18 02:03:07 +08:00
nama: 'pay-qrcode',
emits: ['finishQrPay'],
2022-05-09 10:00:16 +08:00
components: {
ayQrcode
},
props: {
show: {
type: Boolean,
default: false
},
data: {
type: Object,
default: {}
}
},
data() {
return {
//二维码相关参数
modal_qr: false,
url: ''
}
},
methods: {
2022-06-18 02:03:07 +08:00
finishQrPay(e) {
2022-06-22 17:40:50 +08:00
this.$emit('finishQrPay', e);
this.hideQrcode();
2022-05-09 10:00:16 +08:00
},
// 展示二维码
showQrcode(url) {
2022-06-22 17:40:50 +08:00
this.url = url;
2022-05-09 10:00:16 +08:00
let _this = this;
this.modal_qr = true;
// uni.showLoading()
setTimeout(function() {
// uni.hideLoading()
_this.$refs.qrcode.crtQrCode()
}, 50)
},
//传入组件的方法
hideQrcode() {
this.modal_qr = false;
}
}
}
</script>
<style>
</style>