feat:优化上线后的改造
This commit is contained in:
@@ -6,26 +6,26 @@
|
||||
</view>
|
||||
<view class="share-btn-view">
|
||||
<!-- #ifndef APP-PLUS || H5 -->
|
||||
<block v-for="(item, index) in btnList" :key="index">
|
||||
<button v-if="index === 0" open-type="share" hover-class="none" class="share-box share-btn-clean"
|
||||
@click="onBtn(index)">
|
||||
<image :src="`https://static.tbmall.xin/static/new/share_${index}.png`" class="share-img">
|
||||
<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">
|
||||
</image>
|
||||
<text class="text-24 text-gray">{{ item }}</text>
|
||||
<text class="text-24 text-gray">{{ item.name }}</text>
|
||||
</button>
|
||||
<view v-else class="share-box" @click="onBtn(index)">
|
||||
<image :src="`https://static.tbmall.xin/static/new/share_${index}.png`" class="share-img">
|
||||
<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>
|
||||
<text class="text-24 text-gray">{{ item }}</text>
|
||||
<text class="text-24 text-gray">{{ item.name }}</text>
|
||||
</view>
|
||||
</block>
|
||||
<!-- #endif -->
|
||||
|
||||
<!-- #ifdef APP-PLUS || H5 -->
|
||||
<view class="share-box" @click="onShare(index)" v-for="(item, index) in appBtnList" :key="index">
|
||||
<image :src="`https://cex-pub.s3.ap-southeast-1.amazonaws.com/static/new/share_${index}.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 }}</text>
|
||||
<text class="text-24 text-gray">{{ item.name }}</text>
|
||||
</view>
|
||||
<!-- #endif -->
|
||||
|
||||
@@ -43,10 +43,10 @@
|
||||
<view class="share-top-image-view">
|
||||
<image :src="tu" class="tu-img"></image>
|
||||
<view class="image-view-bottom">
|
||||
<view class="image-view-bottom-left">
|
||||
<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">
|
||||
<view class="image-view-bottom-right" v-if="price">
|
||||
<text class="text-24 text-zi">¥{{ price }}</text>
|
||||
</view>
|
||||
</view>
|
||||
@@ -86,8 +86,39 @@ export default {
|
||||
text: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
hideCopyAndQQ: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
|
||||
computed: {
|
||||
isInvitePage() {
|
||||
if (this.hideCopyAndQQ) return true;
|
||||
try {
|
||||
const pages = getCurrentPages();
|
||||
const current = pages[pages.length - 1];
|
||||
const route = current?.route || current?.$page?.fullPath || '';
|
||||
return route.includes('invite_friends');
|
||||
} catch (e) {
|
||||
return false;
|
||||
}
|
||||
},
|
||||
filteredBtnList() {
|
||||
const items = this.btnList.map((name, originalIndex) => ({ name, originalIndex }));
|
||||
if (this.isInvitePage) {
|
||||
return items.filter(item => item.name !== '微信');
|
||||
}
|
||||
return items;
|
||||
},
|
||||
filteredAppBtnList() {
|
||||
const items = this.appBtnList.map((name, originalIndex) => ({ name, originalIndex }));
|
||||
if (this.isInvitePage) {
|
||||
return items.filter(item => item.name !== '复制链接' && item.name !== 'QQ');
|
||||
}
|
||||
return items;
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
|
||||
Reference in New Issue
Block a user