From f7034f535b85264e0c5b18e82fc295dab2052304 Mon Sep 17 00:00:00 2001
From: Jacob <hlnie@tohours.com>
Date: 星期五, 23 十月 2026 20:19:01 +0800
Subject: [PATCH] fix: 临时关闭悦养豆第三方小程序跳转入口
---
pages/goods_details/index.vue | 15 ++++++++++++---
1 files changed, 12 insertions(+), 3 deletions(-)
diff --git a/pages/goods_details/index.vue b/pages/goods_details/index.vue
index 38cb238..770c02a 100644
--- a/pages/goods_details/index.vue
+++ b/pages/goods_details/index.vue
@@ -191,7 +191,7 @@
</view>
<view>璐墿杞�</view>
</view>
- <view class="bnt acea-row" v-if="attr.productSelect && attr.productSelect.stock <= 0">
+ <view class="bnt acea-row" v-if="isStockEmpty">
<form @submit="joinCart" report-submit="true"><button class="joinCart bnts" form-type="submit"
:class="(seckillId || (zoneId && zoneType == 2) || (couponMoneyType && couponMoneyType > 0) || productInfo.isVisual || birthdayGift) ? 'disable' : ''">鍔犲叆璐墿杞�</button>
</form>
@@ -208,7 +208,7 @@
</view>
</block>
<view class="bnt bntVideo acea-row"
- v-if="attr.productSelect && attr.productSelect.stock <= 0 && type === 'video'">
+ v-if="isStockEmpty && type === 'video'">
<form report-submit="true"><button class="buy bnts bg-color-hui" form-type="submit">宸插敭缃�</button></form>
</view>
<view class="bnt bntVideo acea-row" v-if="attr.productSelect.stock > 0 && type === 'video'">
@@ -475,7 +475,16 @@
priceName: null,
};
},
- computed: mapGetters(['isLogin', 'uid', 'chatUrl']),
+ computed: {
+ ...mapGetters(['isLogin', 'uid', 'chatUrl']),
+ // 搴撳瓨瀛楁鏈姞杞斤紙undefined/null锛夋椂涓嶈涓� 0锛岄伩鍏嶈鎯呮帴鍙h繑鍥炲墠璇樉绀哄凡鍞絼
+ isStockEmpty() {
+ if (!this.productInfo.id) return false;
+ const stock = this.attr.productSelect && this.attr.productSelect.stock;
+ if (stock === undefined || stock === null || stock === '') return false;
+ return Number(stock) <= 0;
+ }
+ },
watch: {
isLogin: {
handler: function (newV, oldV) {
--
Gitblit v1.4.0