mobileclient/v1_5_0_C/payPop.js

64 lines
2.3 KiB
JavaScript
Raw Normal View History

2022-09-21 17:30:39 +08:00
const payPop = {
template: `
<div class="mask model" @touchmove.prevent @mousewheel.prevent v-if="show">
<div class="model-box">
2022-09-23 11:48:51 +08:00
<img class="coles" @click='colesFunction' src="./img/coles.png" alt="">
<p class="money"><span class="sign"></span>{{money}}</p>
2022-09-21 17:30:39 +08:00
<p class="title">选择支付方式</p>
<div class="list">
<div class="list-children" @click='active=1'>
2022-09-21 17:30:39 +08:00
<div>
<img class="icon" src="./img/wx.png" alt="">
<span>微信支付</span>
</div>
<img class="icon-select" v-if="active===1" src="./img/active.png" alt="">
2022-09-21 17:30:39 +08:00
<img class="icon-select" v-else src="./img/no-active.png" alt="">
</div>
<div class="list-children" @click='active=2'>
2022-09-21 17:30:39 +08:00
<div>
<img class="icon" src="./img/zfb.png" alt="">
<span>支付宝支付</span>
</div>
<img class="icon-select" v-if="active===2" src="./img/active.png" alt="">
2022-09-21 17:30:39 +08:00
<img class="icon-select" v-else src="./img/no-active.png" alt="">
</div>
</div>
2022-09-23 12:10:46 +08:00
<button @click='payFunctions' class="pay">确认付款</button>
2022-09-21 17:30:39 +08:00
</div>
</div>
`,
props: {
/* 弹窗状态 */
2022-09-21 17:30:39 +08:00
show: {
2022-09-27 15:53:39 +08:00
type: Boolean,
default: false
2022-09-21 17:30:39 +08:00
},
2022-09-23 11:19:55 +08:00
/* 支付方式 1:微信 2:支付宝 */
active: {
type: Number,
default: 1
},
money: {
type: Number || String,
default: "88.88"
}
2022-09-21 17:30:39 +08:00
},
2022-09-23 11:48:51 +08:00
methods: {
/* 支付 */
2022-09-23 12:10:46 +08:00
payFunctions() {
2022-09-23 11:48:51 +08:00
const us = navigator.userAgent
let isSupport = false /* false:支持当前环境 true:不支持当前环境 */
if (!!us.match(/DingTalk/gi) && this.active !== 2) isSupport = true
if (!!us.match(/weiXin/gi) && this.active !== 1) isSupport = true
2022-09-23 12:10:46 +08:00
this.$emit("payfunction", { active: this.active, isSupport })
},
2022-09-23 11:48:51 +08:00
/* 关闭 */
colesFunction() {
2022-09-23 12:10:46 +08:00
this.$emit("update:show", false)
}
2022-09-21 17:30:39 +08:00
}
}