Commit 92656b37b462e5b29fe73e9626652f328ac7371d
1 parent
1e57a799
团购测试返回
Showing
5 changed files
with
64 additions
and
18 deletions
components/diy_groupbuy/diy_groupbuy.js
| @@ -71,10 +71,10 @@ Component({ | @@ -71,10 +71,10 @@ Component({ | ||
| 71 | var user_id=getApp().globalData.user_id; | 71 | var user_id=getApp().globalData.user_id; |
| 72 | if(!user_id){ user_id=0;} | 72 | if(!user_id){ user_id=0;} |
| 73 | 73 | ||
| 74 | - //--调用接口,读取秒杀-- | 74 | + //--调用接口,读取团购-- |
| 75 | app.request.promiseGet("/api/weshop/goods/groupBuy/getGoodsList?store_id=" | 75 | app.request.promiseGet("/api/weshop/goods/groupBuy/getGoodsList?store_id=" |
| 76 | + os.stoid + "&aidlist=" + goodsidlist+"&user_id="+user_id, {}).then(res => { | 76 | + os.stoid + "&aidlist=" + goodsidlist+"&user_id="+user_id, {}).then(res => { |
| 77 | - console.log(res); | 77 | + console.log(res,100); |
| 78 | //如果秒杀的数组为空的时候 | 78 | //如果秒杀的数组为空的时候 |
| 79 | var goodslist = res.data.data; | 79 | var goodslist = res.data.data; |
| 80 | //就算是添加的活动已经过期,就要用最新的进行中活动 | 80 | //就算是添加的活动已经过期,就要用最新的进行中活动 |
| @@ -207,7 +207,7 @@ Component({ | @@ -207,7 +207,7 @@ Component({ | ||
| 207 | this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ; | 207 | this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ; |
| 208 | }, | 208 | }, |
| 209 | 209 | ||
| 210 | - //跳转到秒杀列表 | 210 | + //跳转到团购列表 |
| 211 | go_to_group: function () { | 211 | go_to_group: function () { |
| 212 | 212 | ||
| 213 | var url="/packageC/pages/group_list/group_list"; | 213 | var url="/packageC/pages/group_list/group_list"; |
components/diy_groupbuy/diy_groupbuy.wxml
| 1 | +<wxs module="filter" src="../../utils/filter.wxs" ></wxs> | ||
| 1 | <block wx:if="{{goods_array.length>0}}"> | 2 | <block wx:if="{{goods_array.length>0}}"> |
| 2 | <!--秒杀--> | 3 | <!--秒杀--> |
| 3 | <view class='top' bindtap="go_to_group"> | 4 | <view class='top' bindtap="go_to_group"> |
| @@ -20,13 +21,11 @@ | @@ -20,13 +21,11 @@ | ||
| 20 | class="s1_gk_a1"> | 21 | class="s1_gk_a1"> |
| 21 | <view class='one'> | 22 | <view class='one'> |
| 22 | <view class='sp_top'> | 23 | <view class='sp_top'> |
| 23 | - | ||
| 24 | <view class='s_img'> | 24 | <view class='s_img'> |
| 25 | <image src="{{imghost+aitem.original_img}}" | 25 | <image src="{{imghost+aitem.original_img}}" |
| 26 | data-errorimg="goods_array[{{index}}][{{aind}}].original_img" | 26 | data-errorimg="goods_array[{{index}}][{{aind}}].original_img" |
| 27 | binderror="bind_bnerr3"></image> | 27 | binderror="bind_bnerr3"></image> |
| 28 | </view> | 28 | </view> |
| 29 | - | ||
| 30 | <view class='s_foot_kill'> | 29 | <view class='s_foot_kill'> |
| 31 | <text>{{aitem.djs.day}}天</text> | 30 | <text>{{aitem.djs.day}}天</text> |
| 32 | <text>{{aitem.djs.hou}}时</text> | 31 | <text>{{aitem.djs.hou}}时</text> |
| @@ -42,11 +41,14 @@ | @@ -42,11 +41,14 @@ | ||
| 42 | <view class='sp_jg'>¥{{aitem.price}}</view> | 41 | <view class='sp_jg'>¥{{aitem.price}}</view> |
| 43 | <view class='sp_jgx'>¥{{aitem.market_price}}</view> | 42 | <view class='sp_jgx'>¥{{aitem.market_price}}</view> |
| 44 | </view> | 43 | </view> |
| 45 | - <view class="gorup_count"> | ||
| 46 | - <text class="leftred">已抢0件</text> | ||
| 47 | - <text class="rightwhite">0%</text> | 44 | + <view class="progress_box"> |
| 45 | + <text class="on_sale_list">已买:{{aitem.buy_num + aitem.virtual_num}}件</text> | ||
| 46 | + <progress class="progress_list" percent="{{(aitem.buy_num + aitem.virtual_num / aitem.goods_num + aitem.virtual_num)*100}}" border-radius="10" backgroundColor="#F1AAAB" activeColor="#E02E23" stroke-width="20" data-content="{{filter.toFix((aitem.buy_num / aitem.goods_num)*100)}}%" /> | ||
| 48 | </view> | 47 | </view> |
| 49 | - | 48 | + <!-- <view class="gorup_count"> |
| 49 | + <text class="leftred">已抢{{}}件</text> | ||
| 50 | + <text class="rightwhite">0%</text> | ||
| 51 | + </view> --> | ||
| 50 | </view> | 52 | </view> |
| 51 | </navigator> | 53 | </navigator> |
| 52 | </block> | 54 | </block> |
| @@ -60,8 +62,6 @@ | @@ -60,8 +62,6 @@ | ||
| 60 | <navigator | 62 | <navigator |
| 61 | url="/pages/goods/goodsInfo/goodsInfo?goods_id={{aitem.goods_id}}&prom_type=2&prom_id={{aitem.prom_id}}" | 63 | url="/pages/goods/goodsInfo/goodsInfo?goods_id={{aitem.goods_id}}&prom_type=2&prom_id={{aitem.prom_id}}" |
| 62 | class="s1_gk_a1"> | 64 | class="s1_gk_a1"> |
| 63 | - | ||
| 64 | - | ||
| 65 | <view class="flex jc_sb" style="padding: 0 20rpx; margin-top: 10rpx;"> | 65 | <view class="flex jc_sb" style="padding: 0 20rpx; margin-top: 10rpx;"> |
| 66 | <view> | 66 | <view> |
| 67 | 距结束时间 | 67 | 距结束时间 |
| @@ -75,7 +75,6 @@ | @@ -75,7 +75,6 @@ | ||
| 75 | </view> | 75 | </view> |
| 76 | 76 | ||
| 77 | <view class='one1'> | 77 | <view class='one1'> |
| 78 | - | ||
| 79 | <view class="o1_img"> | 78 | <view class="o1_img"> |
| 80 | <image src="{{imghost+aitem.original_img}}" | 79 | <image src="{{imghost+aitem.original_img}}" |
| 81 | data-errorimg="goods_array[{{index}}][{{aind}}].original_img" binderror="bind_bnerr3"> | 80 | data-errorimg="goods_array[{{index}}][{{aind}}].original_img" binderror="bind_bnerr3"> |
| @@ -85,15 +84,14 @@ | @@ -85,15 +84,14 @@ | ||
| 85 | <view class="o1_right"> | 84 | <view class="o1_right"> |
| 86 | <view class="sp_wzi">{{aitem.title}}</view> | 85 | <view class="sp_wzi">{{aitem.title}}</view> |
| 87 | <!-- 进度条 --> | 86 | <!-- 进度条 --> |
| 88 | - <view> | ||
| 89 | - | 87 | + <view class="progress_box"> |
| 88 | + <text class="on_sale">已买:{{aitem.buy_num + aitem.virtual_num}}件</text> | ||
| 89 | + <progress class="progress" percent="{{(aitem.buy_num/ aitem.goods_num)*100}}" border-radius="10" backgroundColor="#F1AAAB" activeColor="#E02E23" stroke-width="20" data-content="{{filter.toFix((aitem.buy_num / aitem.goods_num)*100)}}%"/> | ||
| 90 | </view> | 90 | </view> |
| 91 | <view> | 91 | <view> |
| 92 | <view class='sp_jg'>¥{{aitem.price}}</view> | 92 | <view class='sp_jg'>¥{{aitem.price}}</view> |
| 93 | <view class='sp_jgx'>¥{{aitem.market_price}}</view> | 93 | <view class='sp_jgx'>¥{{aitem.market_price}}</view> |
| 94 | </view> | 94 | </view> |
| 95 | - | ||
| 96 | - | ||
| 97 | </view> | 95 | </view> |
| 98 | </view> | 96 | </view> |
| 99 | </navigator> | 97 | </navigator> |
components/diy_groupbuy/diy_groupbuy.wxss
| @@ -83,7 +83,45 @@ swiper { | @@ -83,7 +83,45 @@ swiper { | ||
| 83 | color: #fff; | 83 | color: #fff; |
| 84 | text-align: center; | 84 | text-align: center; |
| 85 | } | 85 | } |
| 86 | +/* .ellipsis-1 { | ||
| 87 | + overflow: hidden; | ||
| 88 | + white-space: nowrap; | ||
| 89 | + text-overflow: ellipsis; | ||
| 90 | +} */ | ||
| 91 | +.progress_box{ | ||
| 92 | + position: relative; | ||
| 93 | +} | ||
| 94 | +.progress::after{ | ||
| 95 | + content: attr(data-content); | ||
| 96 | + position: absolute; | ||
| 97 | + right: 20px; | ||
| 98 | + font-size: 24rpx; | ||
| 99 | + color: #fff; | ||
| 100 | +} | ||
| 101 | +.on_sale{ | ||
| 102 | + position: absolute; | ||
| 103 | + font-size: 24rpx; | ||
| 104 | + left: 40%; | ||
| 105 | + top: 2rpx; | ||
| 106 | + color: #fff; | ||
| 107 | +} | ||
| 108 | +.progress_list::after{ | ||
| 109 | + content: attr(data-content); | ||
| 110 | + position: absolute; | ||
| 111 | + right: 6rpx; | ||
| 112 | + font-size: 22rpx; | ||
| 113 | + color: #fff; | ||
| 114 | +} | ||
| 115 | +.on_sale_list{ | ||
| 116 | + position: absolute; | ||
| 117 | + font-size: 22rpx; | ||
| 118 | + left: 30%; | ||
| 119 | + top: 4rpx; | ||
| 120 | + color: #fff; | ||
| 121 | +} | ||
| 122 | +/* .on_sale : hover{ | ||
| 86 | 123 | ||
| 124 | +} */ | ||
| 87 | .po { | 125 | .po { |
| 88 | position: absolute; | 126 | position: absolute; |
| 89 | } | 127 | } |
packageC/pages/group_list/group_list.wxml
| @@ -16,7 +16,7 @@ | @@ -16,7 +16,7 @@ | ||
| 16 | </view> | 16 | </view> |
| 17 | <view class="flex jc_sb ai-center c-7b"> | 17 | <view class="flex jc_sb ai-center c-7b"> |
| 18 | <view class="fs24"> | 18 | <view class="fs24"> |
| 19 | - <view>已售{{item.buy_num}}件</view> | 19 | + <view>已售{{item.buy_num+item.virtual_num}}件</view> |
| 20 | <view class=""><text class="iconfont icon-shizhong fs24"></text>{{goodlist[index].djs.day}}天{{goodlist[index].djs.hou}}时{{goodlist[index].djs.min}}分{{goodlist[index].djs.sec}}秒</view> | 20 | <view class=""><text class="iconfont icon-shizhong fs24"></text>{{goodlist[index].djs.day}}天{{goodlist[index].djs.hou}}时{{goodlist[index].djs.min}}分{{goodlist[index].djs.sec}}秒</view> |
| 21 | </view> | 21 | </view> |
| 22 | <view class="btn" >去团购</view> | 22 | <view class="btn" >去团购</view> |
pages/goods/goodsInfo/goodsInfo.wxml
| @@ -1182,7 +1182,8 @@ | @@ -1182,7 +1182,8 @@ | ||
| 1182 | <block wx:if="{{card_field && sele_g[card_field]>0}}">{{sele_g[card_field]}}</block> | 1182 | <block wx:if="{{card_field && sele_g[card_field]>0}}">{{sele_g[card_field]}}</block> |
| 1183 | <block wx:else>{{sele_g.shop_price}}</block> | 1183 | <block wx:else>{{sele_g.shop_price}}</block> |
| 1184 | </view> | 1184 | </view> |
| 1185 | - <view class="spec-goods-price" wx:elif="{{prom_type!=2}}"><text class="fs20">¥</text>{{prom_price}}</view> | 1185 | + <view class="spec-goods-price" wx:else><text class="fs20">¥</text>{{prom_price}}</view> |
| 1186 | + <!-- <view class="spec-goods-price" wx:elif="{{prom_type!=2}}"><text class="fs20">¥</text>{{prom_price}}</view> --> | ||
| 1186 | <!-- 显示线下价格 --> | 1187 | <!-- 显示线下价格 --> |
| 1187 | <view wx:if="{{sele_g.offline_price}}" class="quan_price flex ai-center jc-center"> | 1188 | <view wx:if="{{sele_g.offline_price}}" class="quan_price flex ai-center jc-center"> |
| 1188 | 券后¥ | 1189 | 券后¥ |
| @@ -1213,6 +1214,15 @@ | @@ -1213,6 +1214,15 @@ | ||
| 1213 | <view class="spec-goods-stock">可售:{{prom_act.goods_num-prom_act.buy_num}}</view> | 1214 | <view class="spec-goods-stock">可售:{{prom_act.goods_num-prom_act.buy_num}}</view> |
| 1214 | </view> | 1215 | </view> |
| 1215 | </block> | 1216 | </block> |
| 1217 | + <block wx:if="{{prom_type==2}}"> | ||
| 1218 | + <view class="flex"> | ||
| 1219 | + <view class="spec-goods-stock" wx:if="{{prom_st>0}}"> | ||
| 1220 | + 已售:{{prom_act.buy_num+prom_act.virtualNum}} | ||
| 1221 | + </view> | ||
| 1222 | + <view class="spec-goods-stock" wx:else>已售:{{prom_act.buy_num}}</view> | ||
| 1223 | + <view class="spec-goods-stock">可售:{{prom_act.goods_num-prom_act.buy_num}}</view> | ||
| 1224 | + </view> | ||
| 1225 | + </block> | ||
| 1216 | </view> | 1226 | </view> |
| 1217 | <!-- 选择门店模块 --> | 1227 | <!-- 选择门店模块 --> |
| 1218 | <view class="flex-space-between address ai_end xc-width "> | 1228 | <view class="flex-space-between address ai_end xc-width "> |