Commit 09149c2e3bb250494f7388808fe9be5df510e695
1 parent
4006285e
fix去除多余文字
Showing
1 changed file
with
4 additions
and
2 deletions
pages/cart/cart/cart.js
@@ -2077,7 +2077,9 @@ Page({ | @@ -2077,7 +2077,9 @@ Page({ | ||
2077 | wx.showModal({ | 2077 | wx.showModal({ |
2078 | title: '超出活动限购', | 2078 | title: '超出活动限购', |
2079 | }); | 2079 | }); |
2080 | - th.setData({[txt]: buylimit}); | 2080 | + let num = buylimit - gd_buy_num; |
2081 | + if (num <= 0) num = 1; | ||
2082 | + th.setData({[txt]: num}); | ||
2081 | return false; | 2083 | return false; |
2082 | }; | 2084 | }; |
2083 | 2085 | ||
@@ -2085,7 +2087,7 @@ Page({ | @@ -2085,7 +2087,7 @@ Page({ | ||
2085 | 2087 | ||
2086 | if(t.goods_num > redis_num) { | 2088 | if(t.goods_num > redis_num) { |
2087 | wx.showModal({ | 2089 | wx.showModal({ |
2088 | - title: '超出活动库存2', | 2090 | + title: '超出活动库存', |
2089 | }); | 2091 | }); |
2090 | th.setData({[txt]: redis_num}); | 2092 | th.setData({[txt]: redis_num}); |
2091 | return false; | 2093 | return false; |