feat:分享链接的问题

This commit is contained in:
2026-08-31 16:14:31 +08:00
parent 364b2b32f2
commit e9f07e8ede
5 changed files with 132 additions and 17 deletions
+80 -11
View File
@@ -7,14 +7,16 @@
<view class="share-btn-view">
<!-- #ifndef APP-PLUS || H5 -->
<block v-for="(item, index) in filteredBtnList" :key="index">
<button v-if="item.originalIndex === 0" open-type="share" hover-class="none" class="share-box share-btn-clean"
@click="onBtn(item.originalIndex)">
<image :src="`https://static.tbmall.xin/static/new/share_${item.originalIndex}.png`" class="share-img">
<button v-if="item.originalIndex === 0" open-type="share" hover-class="none"
class="share-box share-btn-clean" @click="onBtn(item.originalIndex)">
<image :src="`https://static.tbmall.xin/static/new/share_${item.originalIndex}.png`"
class="share-img">
</image>
<text class="text-24 text-gray">{{ item.name }}</text>
</button>
<view v-else class="share-box" @click="onBtn(item.originalIndex)">
<image :src="`https://static.tbmall.xin/static/new/share_${item.originalIndex}.png`" class="share-img">
<image :src="`https://static.tbmall.xin/static/new/share_${item.originalIndex}.png`"
class="share-img">
</image>
<text class="text-24 text-gray">{{ item.name }}</text>
</view>
@@ -22,8 +24,10 @@
<!-- #endif -->
<!-- #ifdef APP-PLUS || H5 -->
<view class="share-box" @click="onShare(item.originalIndex)" v-for="(item, index) in filteredAppBtnList" :key="index">
<image :src="`https://cex-pub.s3.ap-southeast-1.amazonaws.com/static/new/share_${item.originalIndex}.png`"
<view class="share-box" @click="onShare(item.originalIndex)" v-for="(item, index) in filteredAppBtnList"
:key="index">
<image
:src="`https://cex-pub.s3.ap-southeast-1.amazonaws.com/static/new/share_${item.originalIndex}.png`"
class="share-img"></image>
<text class="text-24 text-gray">{{ item.name }}</text>
</view>
@@ -31,6 +35,9 @@
</view>
<view class="share-line" style="margin-top:40rpx;"></view>
<view class="qr-view" v-if="qrvalue">
<tki-qrcode ref="qrcode" :val="qrvalue" :size="252" />
</view>
<view class="share-line" style="min-height:16rpx;height:16rpx">
</view>
@@ -38,12 +45,11 @@
<text class="text-32 text-fu1">取消</text>
</view>
<view class="share-top-image-view">
<image :src="tu" class="tu-img"></image>
<view class="image-view-bottom">
<view class="image-view-bottom-left" :style="{ borderRight: price ? '2rpx solid #EBEBEB' : 'none', flex: price ? 'none' : '1' }">
<view class="image-view-bottom-left"
:style="{ borderRight: price ? '2rpx solid #EBEBEB' : 'none', flex: price ? 'none' : '1' }">
<text class="text-24 text-gray text-overflow1">{{ text }}</text>
</view>
<view class="image-view-bottom-right" v-if="price">
@@ -57,15 +63,19 @@
<script>
import Func from '/utils/func'
import tkiQrcode from './tki-qrcode/tki-qrcode.vue'
import { SHARE_URL } from '@/utils/config.js'
export default {
data() {
return {
btnList: ['微信', '朋友圈'],
appBtnList: ['微信', '朋友圈', '复制链接', '保存图片', 'QQ'],
qrvalue: ''
}
},
components: { tkiQrcode },
props: {
show: {
type: Boolean,
@@ -92,6 +102,20 @@ export default {
default: false
}
},
mounted() {
// #ifdef APP-PLUS || H5
if (!this.isInvitePage) {
this.qrvalue = `${SHARE_URL}/#/pages/other_package/productInfo/productInfo?id=${this.id}`
this.$nextTick(() => {
if (this.qrvalue) {
this.creatQrcode();
}
})
}
// #endif
},
computed: {
isInvitePage() {
@@ -123,12 +147,57 @@ export default {
methods: {
creatQrcode() {
this.$refs.qrcode._makeCode();
},
onBtn(index) {
if (index == 2) {
let tmp = `【信任桥】消费共享数字化权益 ${this.qrvalue} ${this.text}`;
// #ifdef APP-PLUS
console.log("--11---", tmp)
uni.setClipboardData({
data: tmp,
success: function (res) {
uni.getClipboardData({
success: function (res) {
Func.myToast('复制成功')
}
})
}
})
// #endif
// #ifdef H5
this.$copyText(tmp).then(res => {
console.log('resresresres', res)
Func.myToast('复制成功')
})
// #endif
}
console.log('微信分享', index);
this.$emit('wxShare', index)
},
onShare(index) {
if (index == 2) {
let tmp = `【信任桥】消费共享数字化权益 ${this.qrvalue} ${this.text}`;
// #ifdef APP-PLUS
uni.setClipboardData({
data: tmp,
success: function (res) {
uni.getClipboardData({
success: function (res) {
Func.myToast('复制成功')
}
})
}
})
// #endif
// #ifdef H5
this.$copyText(tmp).then(res => {
console.log('resresresres', res)
Func.myToast('复制成功')
})
// #endif
}
this.$emit('share', index)
},
@@ -199,7 +268,7 @@ export default {
.share-popup-view {
width: 100%;
height: 400rpx;
// height: 400rpx;
display: flex;
flex-direction: column;
align-items: center;