|
|
@@ -28,7 +28,7 @@
|
|
|
|
|
|
<!-- 二维码区域 -->
|
|
|
<view class="qrcode-container">
|
|
|
- <image class="qrcode-img" :src="merchantInfo.merchantCodeUrl" mode="aspectFit"></image>
|
|
|
+ <image class="qrcode-img" :src="merchantInfo.merchantCodeUrl" mode="aspectFit" @click="previewQrCode"></image>
|
|
|
<view class="qrcode-tip">扫码进入商家店铺</view>
|
|
|
</view>
|
|
|
|
|
|
@@ -132,6 +132,34 @@ const makePhoneCall = () => {
|
|
|
}
|
|
|
});
|
|
|
};
|
|
|
+const previewQrCode = () => {
|
|
|
+ console.log('previewQrCode===')
|
|
|
+ if (!merchantInfo.value.merchantCodeUrl) {
|
|
|
+ uni.showToast({
|
|
|
+ title: '暂无二维码图片',
|
|
|
+ icon: 'none'
|
|
|
+ });
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ // 使用uni.previewImage预览图片
|
|
|
+ uni.previewImage({
|
|
|
+ urls: [merchantInfo.value.merchantCodeUrl], // 需要预览的图片链接列表
|
|
|
+ current: 0, // 当前显示图片的索引
|
|
|
+ indicator: 'default', // 图片指示器样式
|
|
|
+ loop: false, // 是否可循环预览
|
|
|
+ success: () => {
|
|
|
+ console.log('图片预览成功');
|
|
|
+ },
|
|
|
+ fail: (err) => {
|
|
|
+ console.log('图片预览失败:', err);
|
|
|
+ uni.showToast({
|
|
|
+ title: '预览失败',
|
|
|
+ icon: 'none'
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+};
|
|
|
</script>
|
|
|
|
|
|
<style scoped lang="scss">
|