Commit bc61693e10d14b6bb9acf1260d6ea113cb0b13ab
1 parent
d68beddc
秒杀优化,和组合购优化
Showing
5 changed files
with
28 additions
and
12 deletions
components/diy_seckill/diy_seckill.js
... | ... | @@ -76,9 +76,12 @@ Component({ |
76 | 76 | }) |
77 | 77 | goodsidlist = ut.sub_last(goodsidlist); |
78 | 78 | |
79 | + var user_id=getApp().globalData.user_id; | |
80 | + if(!user_id){ user_id=0;} | |
81 | + | |
79 | 82 | //--调用接口,读取秒杀-- |
80 | 83 | app.request.promiseGet("/api/ms/flash_sale/getGoodsList?store_id=" |
81 | - + os.stoid + "&goodsidlist=" + goodsidlist, {}).then(res => { | |
84 | + + os.stoid + "&goodsidlist=" + goodsidlist+"&user_id"+user_id, {}).then(res => { | |
82 | 85 | console.log(res); |
83 | 86 | //如果秒杀的数组为空的时候 |
84 | 87 | var goodslist = res.data.data; |
... | ... | @@ -118,6 +121,7 @@ Component({ |
118 | 121 | g_id.forEach(function (val, ind) { |
119 | 122 | goodslist.forEach(function (vy, indy) { |
120 | 123 | if (val.goodsid == vy.goods_id) { |
124 | + if(!vy.id) vy.id=vy.prom_id; | |
121 | 125 | all_array.push(vy); |
122 | 126 | } |
123 | 127 | }) | ... | ... |
pages/cart/cart2/cart2.wxml
... | ... | @@ -78,8 +78,11 @@ |
78 | 78 | </view> |
79 | 79 | <view class="order-detail" wx:for="{{item.goods}}" wx:for-index="idx" wx:for-item="items"> |
80 | 80 | <!----商品图片-----> |
81 | - <view class="goods-img" style="position: relative"> | |
81 | + <view class="goods-img" style="position: relative; overflow: hidden"> | |
82 | 82 | <image wx:if="{{items.is_gift}}" src="{{imgUrl}}/miniapp/images/giveaway.png" class="gift_image"></image> |
83 | + <text class="zuhe" wx:if="{{items.prom_type==7}}">组合购</text> | |
84 | + | |
85 | + | |
83 | 86 | <image class="wh100 bdr14" src="{{items.original_img}}" binderror='cart_set_err' data-err='cartlist[{{pidx}}].goods[{{idx}}].original_img'></image> |
84 | 87 | </view> |
85 | 88 | <!----商品名称规格----> |
... | ... | @@ -89,15 +92,9 @@ |
89 | 92 | <view class="flex-vertical fs28 color-gray n_guige"> |
90 | 93 | <view class="goods-color"> |
91 | 94 | <block><text>{{filters.show_gui_ge(items.goods_spec,items.goods_color)}}</text></block> |
92 | - <!--<block wx:if="{{!items.goods_spec && !items.goods_color}}"><text>规格1</text></block>--> | |
93 | - <!--<block wx:else>--> | |
94 | - <!--<text wx:if="{{items.goods_spec!=''}}">{{items.goods_spec}}<text wx:if="{{items.goods_color}}">/</text></text>--> | |
95 | - <!--<text wx:if="{{items.goods_color}}">{{items.goods_color}}</text>--> | |
96 | - <!--</block>--> | |
97 | 95 | </view> |
98 | 96 | </view> |
99 | 97 | |
100 | - | |
101 | 98 | <!-----商品名称规格------> |
102 | 99 | <view class="order-num flex-space-between"> |
103 | 100 | <view class="co-red">¥<text class="fs36">{{filters.toFix(items.goods_price,2)}}</text></view> | ... | ... |
pages/cart/cart2/cart2.wxss
... | ... | @@ -19,9 +19,6 @@ |
19 | 19 | box-shadow: 16rpx 0px 12px #e7e9eb; |
20 | 20 | } |
21 | 21 | |
22 | - | |
23 | - | |
24 | - | |
25 | 22 | page { |
26 | 23 | /* background-color: #FAFAFA; */ |
27 | 24 | background-color: #F0F0F0; |
... | ... | @@ -995,3 +992,16 @@ margin-left: 20rpx; |
995 | 992 | top:36rpx |
996 | 993 | } |
997 | 994 | |
995 | +.zuhe { | |
996 | + width: 140rpx; | |
997 | + text-align: center; | |
998 | + height:40rpx; | |
999 | + position: absolute; | |
1000 | + top: 15rpx; | |
1001 | + left: -37rpx; | |
1002 | + transform: rotate(-45deg); | |
1003 | + background-color: rgb(255,0,0); | |
1004 | + font-size:22rpx; | |
1005 | + color: #fff; | |
1006 | + line-height: 37rpx; | |
1007 | +} | ... | ... |
pages/cart/cart2/zh_calculate.js
pages/user/order_list/order_list.js