Commit e34ebeca93b0f19d6b268baad9e34987df2de208
1 parent
fd54712c
秒杀的商品加入了自定义模板~~要显示正在的秒杀价
Showing
3 changed files
with
13 additions
and
3 deletions
components/diy_goodsGroup/diy_goodsGroup.js
@@ -151,6 +151,9 @@ Component({ | @@ -151,6 +151,9 @@ Component({ | ||
151 | index = 0, | 151 | index = 0, |
152 | gdata = []; | 152 | gdata = []; |
153 | 153 | ||
154 | + var user_id=getApp().globalData.user_id; | ||
155 | + if(!user_id) user_id=0; | ||
156 | + | ||
154 | //--初始化卡类-- | 157 | //--初始化卡类-- |
155 | th.card_init(); | 158 | th.card_init(); |
156 | var os=getApp().globalData.setting; | 159 | var os=getApp().globalData.setting; |
@@ -162,8 +165,10 @@ Component({ | @@ -162,8 +165,10 @@ Component({ | ||
162 | for (var i = 0; i < g_id.length; i++) { | 165 | for (var i = 0; i < g_id.length; i++) { |
163 | str += g_id[i].goodsid + ","; | 166 | str += g_id[i].goodsid + ","; |
164 | } | 167 | } |
165 | - str=str.substring(0, str.length - 1); | 168 | + str=str.substring(0, str.length - 1); |
169 | + | ||
166 | await app.request.get("/api/weshop/goods/getgoodslistOrdby?store_id=" + os.stoid + "&goodsidlist=" + str, { | 170 | await app.request.get("/api/weshop/goods/getgoodslistOrdby?store_id=" + os.stoid + "&goodsidlist=" + str, { |
171 | + data:{user_id:user_id}, | ||
167 | isShowLoading:false, | 172 | isShowLoading:false, |
168 | success: function(res) { | 173 | success: function(res) { |
169 | th.data.loading=0; | 174 | th.data.loading=0; |
@@ -218,6 +223,10 @@ Component({ | @@ -218,6 +223,10 @@ Component({ | ||
218 | if(th.data.is_hot) r_data.is_hot=th.data.is_hot; | 223 | if(th.data.is_hot) r_data.is_hot=th.data.is_hot; |
219 | if(th.data.is_new) r_data.is_new=th.data.is_new; | 224 | if(th.data.is_new) r_data.is_new=th.data.is_new; |
220 | 225 | ||
226 | + var user_id=getApp().globalData.user_id; | ||
227 | + if(!user_id) user_id=0; | ||
228 | + r_data.user_id=user_id; | ||
229 | + | ||
221 | await app.request.promiseGet("/api/weshop/goods/page", { | 230 | await app.request.promiseGet("/api/weshop/goods/page", { |
222 | data:r_data | 231 | data:r_data |
223 | }).then(res => { | 232 | }).then(res => { |
@@ -245,6 +254,7 @@ Component({ | @@ -245,6 +254,7 @@ Component({ | ||
245 | isonsale: 1, | 254 | isonsale: 1, |
246 | orderField: "sort", | 255 | orderField: "sort", |
247 | orderType: 'asc', | 256 | orderType: 'asc', |
257 | + user_id:user_id | ||
248 | } | 258 | } |
249 | }).then(res => { | 259 | }).then(res => { |
250 | th.data.loading=0; | 260 | th.data.loading=0; |
packageB/pages/user/collect_list/collect_list.wxml
@@ -46,7 +46,7 @@ | @@ -46,7 +46,7 @@ | ||
46 | <!-- 优惠价 --> | 46 | <!-- 优惠价 --> |
47 | <view class="price flex xc-wc"> | 47 | <view class="price flex xc-wc"> |
48 | <view class="fs24">¥</view> | 48 | <view class="fs24">¥</view> |
49 | - <view class="fs40">{{item.shop_price}}</view> | 49 | + <view class="fs40">{{item.prom_price?item.prom_price:item.shop_price}}</view> |
50 | </view> | 50 | </view> |
51 | <!-- 原价 --> | 51 | <!-- 原价 --> |
52 | <view class="flex fs24 line through xc-ash"> | 52 | <view class="flex fs24 line through xc-ash"> |
pages/goods/goodsInfo/goodsInfo.js
@@ -605,7 +605,7 @@ Page({ | @@ -605,7 +605,7 @@ Page({ | ||
605 | }).then(res => { | 605 | }).then(res => { |
606 | var t = res; | 606 | var t = res; |
607 | var data = t.data.data.pageData; | 607 | var data = t.data.data.pageData; |
608 | - if (data.length > 0) { | 608 | + if (data && data.length > 0) { |
609 | //ee.setData({ is_collect: 1, collect_id: data[0].collect_id, }); | 609 | //ee.setData({ is_collect: 1, collect_id: data[0].collect_id, }); |
610 | is_collect = 1; | 610 | is_collect = 1; |
611 | collect_id = data[0].collect_id; | 611 | collect_id = data[0].collect_id; |