Commit ca4defb7efa7b67f940e4b144fc4834f4f3f38ae
Merge branch 'dev' of http://git.vipzhuang.cn/wxd/MShopWeApp into dev
Showing
4 changed files
with
46 additions
and
12 deletions
pages/cart/cart2/cart2.js
pages/goods/goodsInfo/goodsInfo.wxml
| ... | ... | @@ -274,6 +274,7 @@ |
| 274 | 274 | </view> |
| 275 | 275 | </view> |
| 276 | 276 | <view class="goods-title"> |
| 277 | + <image wx:if="{{data.commission > 0}}" style="width: 25rpx;height: 25rpx;margin-right: 6rpx;" src="https://mshop-lib.yolipai.net/template/mobile/new/static/images/addmoney.png"></image> | |
| 277 | 278 | <view class="goods-name elli">{{data.goods_name}}</view> |
| 278 | 279 | </view> |
| 279 | 280 | <view class="goods-num"> |
| ... | ... | @@ -388,9 +389,11 @@ |
| 388 | 389 | </view> |
| 389 | 390 | </view> |
| 390 | 391 | </block> |
| 392 | + | |
| 391 | 393 | <!-- 许程商品名字 --> |
| 392 | 394 | <view wx:if="{{prom_type!=1 && prom_type!=2 }}"> |
| 393 | 395 | <view class="goods-title"> |
| 396 | + <image wx:if="{{data.commission > 0}}" style="width: 25rpx;height: 25rpx;margin-right: 6rpx;" src="https://mshop-lib.yolipai.net/template/mobile/new/static/images/addmoney.png"></image> | |
| 394 | 397 | <view class="goods-name elli">{{data.goods_name}}</view> |
| 395 | 398 | </view> |
| 396 | 399 | </view> |
| ... | ... | @@ -1707,9 +1710,9 @@ |
| 1707 | 1710 | </view> |
| 1708 | 1711 | </view> |
| 1709 | 1712 | <view class="pdt40"> |
| 1710 | - <view class="pdb20">活动内容</view> | |
| 1713 | + <view class="pdb20">活动内容:</view> | |
| 1711 | 1714 | <view class="popup-content"> |
| 1712 | - <text class="pdb10">{{prom_act.remark}}</text> | |
| 1715 | + <text class="pdb10">{{prom_act.remark?prom_act.remark:'暂无'}}</text> | |
| 1713 | 1716 | </view> |
| 1714 | 1717 | </view> |
| 1715 | 1718 | ... | ... |
pages/goods/goodsInfo/goodsInfo.wxss
pages/index/index/index.js
| ... | ... | @@ -382,19 +382,46 @@ Page({ |
| 382 | 382 | flash_data.forEach(function (val, ind) { |
| 383 | 383 | |
| 384 | 384 | if(val.user_price) val.price=val.user_price; |
| 385 | - if (val.start_time > nt) flash_data[ind].status = 0; | |
| 386 | - else if (val.end_time > nt) flash_data[ind].status = 1; | |
| 387 | - if (val.buy_num >= val.goods_num) flash_data[ind].status = 2; | |
| 385 | + if (val.start_time > nt) { | |
| 386 | + flash_data[ind].status = 0; | |
| 387 | + } else if (val.end_time > nt) { | |
| 388 | + flash_data[ind].status = 1; | |
| 389 | + } | |
| 390 | + | |
| 391 | + if (val.buy_num >= val.goods_num){ | |
| 392 | + flash_data[ind].status = 2; | |
| 393 | + } | |
| 388 | 394 | }); |
| 389 | 395 | |
| 390 | - var arr = new Array(); | |
| 391 | - //--三个三个一组--- | |
| 392 | - for (var i = 0; i < flash_data.length; i += 3) { | |
| 393 | - arr.push(flash_data.slice(i, i + 3)); | |
| 396 | + var promisies = []; | |
| 397 | + for (const key in flash_data) { | |
| 398 | + if (Object.hasOwnProperty.call(flash_data, key)) { | |
| 399 | + const val = flash_data[key]; | |
| 400 | + promisies[key] = getApp().request.promiseGet("/api/weshop/activitylist/getActLen/" + | |
| 401 | + os.stoid + "/1/" + val.id, | |
| 402 | + {} | |
| 403 | + ).then(res => { | |
| 404 | + if (res.data.code == 0) { | |
| 405 | + if (res.data.data <= 0) flash_data[key].status = 2; | |
| 406 | + }; | |
| 407 | + }); | |
| 408 | + } | |
| 394 | 409 | } |
| 395 | - th.setData({ | |
| 396 | - saleGoods: arr | |
| 410 | + | |
| 411 | + Promise.all(promisies).then((values) => { | |
| 412 | + var arr = new Array(); | |
| 413 | + //--三个三个一组--- | |
| 414 | + for (var i = 0; i < flash_data.length; i += 3) { | |
| 415 | + arr.push(flash_data.slice(i, i + 3)); | |
| 416 | + } | |
| 417 | + | |
| 418 | + th.setData({ | |
| 419 | + saleGoods: arr | |
| 420 | + }); | |
| 397 | 421 | }); |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 398 | 425 | } |
| 399 | 426 | }); |
| 400 | 427 | |
| ... | ... | @@ -1179,6 +1206,8 @@ Page({ |
| 1179 | 1206 | var url=e.currentTarget.dataset.url; |
| 1180 | 1207 | getApp().goto(url); |
| 1181 | 1208 | }, |
| 1209 | + | |
| 1210 | + | |
| 1182 | 1211 | |
| 1183 | 1212 | |
| 1184 | 1213 | ... | ... |