优化团购 - 商品详情页面代码

This commit is contained in:
赵毅 2025-11-12 08:51:39 +08:00
parent 36b69c31b1
commit da61b6ca53

View File

@ -430,76 +430,77 @@
<view class="verify-code-section"> <view class="verify-code-section">
<view v-if="verifyCode">核销码{{ verifyCode }}</view> <view v-if="verifyCode">核销码{{ verifyCode }}</view>
</view> </view>
<view class="welfare-container"> <view class="welfare-container">
<view class="welfare-header"> <view class="welfare-header">
<view class="welfare-title"> <view class="welfare-title">
<image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/groupPurchase/welfare.png"></image> <image
下单福利 src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/groupPurchase/welfare.png">
</view>
<view class="welfare-action">已获得</view>
</view>
<view class="welfare-box">
<view class="welfare-item welfare-item-points">
<view class="welfare-item-top">
<image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/activity_fen.png" mode="aspectFit">
</image> </image>
<view>石榴分</view> 下单福利
</view> </view>
<view> <view class="welfare-action">已获得</view>
{{ slFen }} </view>
<view class="welfare-box">
<view class="welfare-item welfare-item-points">
<view class="welfare-item-top">
<image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/activity_fen.png" mode="aspectFit">
</image>
<view>石榴分</view>
</view>
<view>
{{ slFen }}
</view>
<view class="welfare-item-bottom">
可抵扣 {{ slFen }}
</view>
</view> </view>
<view class="welfare-item-bottom"> <view class="welfare-item welfare-item-coupon">
可抵扣 {{ slFen }} <view class="welfare-item-top">
<image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/activity_zi.png" mode="aspectFit">
</image>
<view>石榴籽</view>
</view>
<view>
{{ slZi }}
</view>
<view class="welfare-item-bottom">
可抵扣 {{ slZi }}
</view>
</view>
<view class="welfare-item welfare-item-beans">
<view class="welfare-item-top">
<image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/activity_jin.png" mode="aspectFit" />
<view>石榴金</view>
</view>
<view>
{{ slJin }}
</view>
<view class="welfare-item-bottom">
可抵扣 {{ slJin }}
</view>
</view> </view>
</view> </view>
<view class="welfare-item welfare-item-coupon"> <view class="bottom2">
<view class="welfare-item-top"> <view class="invite-section">
<image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/activity_zi.png" mode="aspectFit"> <view class="invite-text">
</image> <view class="invite-line1"></view>
<view>石榴籽</view> 赶快邀请好友来下单吧
</view> <view class="invite-line2"></view>
<view> </view>
{{ slZi }} <view @click.stop="changeShadow2">
</view> <view class="share-buttons">
<view class="welfare-item-bottom"> <button class="share-btn-wechat" open-type="share" bindtap="onShareButtonClick" />
可抵扣 {{ slZi }} <view class="share-item">
</view> <image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/shop_WX.png"
</view> mode="aspectFill"></image>
<view class="welfare-item welfare-item-beans"> 微信好友
<view class="welfare-item-top"> </view>
<image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/activity_jin.png" mode="aspectFit"/> <button class="share-btn-miniprogram" open-type="share" bindtap="onShareButtonClick" />
<view>石榴金</view> <view class="share-item" @click="shareFriend">
</view> <image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/shop_WX.png"
<view> mode="aspectFill"></image>
{{ slJin }} 小程序链接
</view> </view>
<view class="welfare-item-bottom">
可抵扣 {{ slJin }}
</view>
</view>
</view>
<view class="bottom2">
<view class="invite-section">
<view class="invite-text">
<view class="invite-line1"></view>
赶快邀请好友来下单吧
<view class="invite-line2"></view>
</view>
<view @click.stop="changeShadow2">
<view class="share-buttons">
<button class="share-btn-wechat" open-type="share" bindtap="onShareButtonClick" />
<view class="share-item">
<image
src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/shop_WX.png"
mode="aspectFill"></image>
微信好友
</view>
<button class="share-btn-miniprogram" open-type="share" bindtap="onShareButtonClick" />
<view class="share-item" @click="shareFriend">
<image
src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/shop_WX.png"
mode="aspectFill"></image>
小程序链接
</view> </view>
</view> </view>
</view> </view>
@ -754,42 +755,42 @@ export default {
}, },
// //
closePurchase() { closePurchase() {
this.showPurchase = false; this.showPurchase = false;
}, },
// //
changeShadow2() { changeShadow2() {
this.boxshadow5 = false; this.boxshadow5 = false;
}, },
// //
shareFriend() { shareFriend() {
this.boxshadow5 = false; // this.boxshadow5 = false; //
// API // API
if (typeof uni.share !== 'undefined') { if (typeof uni.share !== 'undefined') {
uni.share({ uni.share({
provider: 'weixin', provider: 'weixin',
scene: 'WXSceneSession', scene: 'WXSceneSession',
type: 0, type: 0,
title: this.currentGG.goods_name || '商品分享', title: this.currentGG.goods_name || '商品分享',
summary: this.currentGG.commodity_brief || '快来看看这款商品吧', summary: this.currentGG.commodity_brief || '快来看看这款商品吧',
href: `${window.location.origin}/pages/goodsDetail/index?id=${this.id}`, href: `${window.location.origin}/pages/goodsDetail/index?id=${this.id}`,
imageUrl: this.picUrl + (this.currentGG.goods_carousel && this.currentGG.goods_carousel[0] || ''), imageUrl: this.picUrl + (this.currentGG.goods_carousel && this.currentGG.goods_carousel[0] || ''),
success: () => { success: () => {
uni.showToast({ uni.showToast({
title: '分享成功', title: '分享成功',
icon: 'success', icon: 'success',
duration: 2000 duration: 2000
}); });
}, },
fail: (err) => { fail: (err) => {
console.error('分享失败', err); console.error('分享失败', err);
} }
}); });
} }
}, },
// //
goSubmit() { goSubmit() {