52 lines
1.0 KiB
Vue
52 lines
1.0 KiB
Vue
|
<template>
|
|||
|
<view>
|
|||
|
<button style="cursor: pointer;display:none;" :class="triggerName" :data-clipboard-text="alipayLink">
|
|||
|
</button>
|
|||
|
<!-- 支付宝支付界面 -->
|
|||
|
<u-modal :show="alipayShow" title="支付宝支付" @confirm="handleConfirm">
|
|||
|
<view class="slot-content">
|
|||
|
链接已复制,请到外部浏览器完成支付
|
|||
|
</view>
|
|||
|
</u-modal>
|
|||
|
</view>
|
|||
|
</template>
|
|||
|
|
|||
|
<script>
|
|||
|
import Clipboard from 'clipboard'
|
|||
|
export default {
|
|||
|
name: 'AlipayLinkCopy',
|
|||
|
props: {
|
|||
|
alipayLink: {
|
|||
|
type: String,
|
|||
|
default: ''
|
|||
|
},
|
|||
|
show: {
|
|||
|
type: Boolean,
|
|||
|
default: false
|
|||
|
},
|
|||
|
triggerName: {
|
|||
|
type: String,
|
|||
|
default: 'clipboard'
|
|||
|
}
|
|||
|
},
|
|||
|
data() {
|
|||
|
return {
|
|||
|
alipayShow: this.show
|
|||
|
}
|
|||
|
},
|
|||
|
mounted() {
|
|||
|
new Clipboard('.clipboard')
|
|||
|
},
|
|||
|
methods: {
|
|||
|
handleConfirm() {
|
|||
|
this.alipayShow = false
|
|||
|
this.$emit('update:show', false)
|
|||
|
this.$emit('confirm')
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
</script>
|
|||
|
|
|||
|
<style>
|
|||
|
</style>
|