Files
lucky_shop/components-diy/diy-payment-qrcode.vue
ZF sun 0dc4dec616 refactor(diy-components): 统一使用@tap.stop替换@click事件处理
将组件中的@click事件统一替换为@tap.stop,避免在小程序环境中可能出现的点击事件冒泡问题,提升交互体验的一致性。同时移除冗余的@tap事件绑定,保持代码简洁。

主要修改包括:
- 表单提交按钮
- 分享功能
- 热区点击
- 富文本点击
- 视频播放
- 直播入口
- 商品品牌
- 客服功能
- 快捷导航
- 公告弹窗
- 文章列表
- 底部导航
- 商品列表
- 浮动按钮
- 优惠券
- 搜索功能
- 店铺相关
- 文本组件
- 分类页面
- 魔方组件
- 秒杀功能
- 拼团功能
- 预售功能
- 砍价功能
- 分销商品
- 图片广告
- 支付二维码
- 图片导航
- 音频控制
- 地图导航
- 笔记功能
- 商户列表
- 图片组件
- 会员订单
- 图文导航
- 首页分类
- 商品推荐
- 团购功能
- 限时折扣
- 商品分类
- 商品列表
- 优惠券
- 搜索功能
- 店铺相关
- 文本组件
- 分类页面
- 魔方组件
- 秒杀功能
- 拼团功能
- 预售功能
- 砍价功能
- 分销商品
- 图片广告
- 支付二维码
- 图片导航
- 音频控制
- 地图导航
- 笔记功能
- 商户列表
- 图片组件
- 会员订单
- 图文导航
- 首页分类
- 商品推荐
- 团购功能
- 限时折扣
- 商品分类
2026-01-26 15:05:36 +08:00

223 lines
4.5 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<template>
<view data-component-name="diy-payment-qrcode" class="payment-qrocde-wrap" :style="warpCss">
<view class="payment-qrocde-box">
<view class="qrocde-left">
<view class="qrocde-desc">
<text>门店消费时使用支付时点击下方展示付款码</text>
<!-- <text class="iconfont icon-shuaxin"></text> -->
</view>
<view class="qrocde-action">
<button type="primary" @tap.stop="toLink">
<text class="iconfont icon-fukuanma"></text>
<text class="action-name">付款码</text>
</button>
<button type="primary" @tap.stop="openPaymentPopup">
<text class="iconfont icon-saomafu"></text>
<text class="action-name">扫码付</text>
</button>
</view>
</view>
<view class="qrocde-right">
<text class="iconfont icon-zhifu"></text>
<text class="name">门店支付</text>
</view>
</view>
<view @touchmove.prevent.stop>
<uni-popup ref="paymentPopup" type="center">
<view class="payment-popup">
<view class="head-wrap" @tap.stop="closePaymentPopup">
<text>提示</text>
<text class="iconfont icon-close"></text>
</view>
<view class="content-wrap">扫码付请退出程序后直接使用微信扫一扫或返回上一页使用付款码进行支付</view>
<button type="primary" @tap.stop="closePaymentPopup">我知道了</button>
</view>
</uni-popup>
</view>
</view>
</template>
<script>
// 付款码展示
import DiyMinx from './minx.js'
export default {
name: 'diy-payment-qrcode',
props: {
value: {
type: Object
}
},
mixins: [DiyMinx],
data() {
return {};
},
created() { },
computed: {
warpCss() {
var obj = '';
return obj;
}
},
watch: {
// 组件刷新监听
componentRefresh: function (nval) { }
},
methods: {
toLink() {
this.$util.redirectTo('/pages_tool/store/payment_qrcode');
},
scanCodeFn() {
// #ifdef APP-PLUS
this.toLink();
// #endif
// #ifndef H5
// 允许从相机和相册扫码,h5端不起作用
uni.scanCode({
success: function (res) {
console.log('条码类型:' + res.scanType);
console.log('条码内容:' + res.result);
}
});
// #endif
},
openPaymentPopup() {
this.$refs.paymentPopup.open();
},
closePaymentPopup() {
this.$refs.paymentPopup.close();
}
}
};
</script>
<style lang="scss">
.payment-qrocde-box {
overflow: hidden;
display: flex;
background-color: #fff;
border-radius: 16rpx;
.qrocde-left {
flex: 1;
.qrocde-desc {
margin-top: 20rpx;
margin-bottom: 26rpx;
display: flex;
align-items: center;
justify-content: center;
color: $color-tip;
font-size: $font-size-tag;
.iconfont {
margin-left: 10rpx;
font-size: $font-size-tag;
font-weight: bold;
}
}
.qrocde-action {
padding-bottom: 36rpx;
display: flex;
justify-content: center;
button {
display: flex;
align-items: center;
justify-content: center;
margin: 0;
width: 230rpx;
height: 86rpx;
border-radius: 50rpx;
&:first-of-type {
margin-right: 46rpx;
background-color: $base-color;
}
&:last-of-type {
background-color: #999;
}
.iconfont {
margin-right: 10rpx;
}
.action-name {
font-size: 30rpx;
}
}
}
}
.qrocde-right {
position: relative;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding-left: 16rpx;
width: 90rpx;
z-index: 2;
box-sizing: border-box;
.name {
font-size: $font-size-sub;
writing-mode: tb-rl;
color: #fff;
letter-spacing: 6rpx;
}
.iconfont {
color: #fff;
}
&::after {
content: '';
position: absolute;
top: 50%;
left: 0;
width: 500rpx;
height: 500rpx;
border-radius: 50%;
background-color: $base-color;
transform: translateY(-50%);
z-index: -1;
}
}
}
.payment-popup {
padding: 0 30rpx 40rpx;
background-color: #fff;
.head-wrap {
font-size: $font-size-toolbar;
line-height: 100rpx;
height: 100rpx;
display: block;
text-align: center;
position: relative;
border-bottom: 2rpx solid $color-line;
margin-bottom: 20rpx;
.iconfont {
position: absolute;
float: right;
right: 0;
font-size: $font-size-toolbar;
}
}
.content-wrap {
max-height: 600rpx;
overflow-y: auto;
}
button {
margin-top: 40rpx;
}
}
</style>