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="">
|
2022-09-27 17:08:43 +08:00
|
|
|
<p class="money"><span class="sign">¥</span>{{money}}</p>
|
2022-09-21 17:30:39 +08:00
|
|
|
<p class="title">选择支付方式</p>
|
|
|
|
<div class="list">
|
2022-09-22 11:40:16 +08:00
|
|
|
<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>
|
2022-09-22 11:40:16 +08:00
|
|
|
<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>
|
2022-09-29 14:14:05 +08:00
|
|
|
<div class="list-children" @click='active=5'>
|
2022-09-21 17:30:39 +08:00
|
|
|
<div>
|
|
|
|
<img class="icon" src="./img/zfb.png" alt="">
|
|
|
|
<span>支付宝支付</span>
|
|
|
|
</div>
|
2022-09-22 11:40:16 +08:00
|
|
|
<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-22 14:08:22 +08:00
|
|
|
/* 弹窗状态 */
|
2022-09-21 17:30:39 +08:00
|
|
|
show: {
|
2022-09-27 15:53:39 +08:00
|
|
|
type: Boolean,
|
2022-09-22 11:40:16 +08:00
|
|
|
default: false
|
2022-09-21 17:30:39 +08:00
|
|
|
},
|
|
|
|
|
2022-09-23 11:19:55 +08:00
|
|
|
/* 支付方式 1:微信 2:支付宝 */
|
2022-09-22 11:40:16 +08:00
|
|
|
active: {
|
|
|
|
type: Number,
|
|
|
|
default: 1
|
2022-09-27 17:08:43 +08:00
|
|
|
},
|
|
|
|
money: {
|
|
|
|
type: Number || String,
|
|
|
|
default: "88.88"
|
2022-09-22 11:40:16 +08:00
|
|
|
}
|
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:不支持当前环境 */
|
2022-09-29 14:14:05 +08:00
|
|
|
if (!!us.match(/DingTalk/gi) && this.active !== 5) isSupport = true
|
2022-09-23 11:48:51 +08:00
|
|
|
if (!!us.match(/weiXin/gi) && this.active !== 1) isSupport = true
|
2022-09-28 11:32:32 +08:00
|
|
|
this.$emit("payfunction", { payType: this.active, isSupport })
|
2022-09-22 11:40:16 +08:00
|
|
|
},
|
|
|
|
|
2022-09-23 11:48:51 +08:00
|
|
|
/* 关闭 */
|
|
|
|
colesFunction() {
|
2022-09-23 12:10:46 +08:00
|
|
|
this.$emit("update:show", false)
|
2022-09-22 11:40:16 +08:00
|
|
|
}
|
2022-09-21 17:30:39 +08:00
|
|
|
}
|
|
|
|
}
|