Commit b82ff51d22499f84af2a7e1e4bba816ee834a052
1 parent
be049639
1、拼团的订单列表的优化
2、拼团商品的优化
Showing
5 changed files
with
79 additions
and
29 deletions
packageA/pages/goodsInfo/filter.wxs
| ... | ... | @@ -8,7 +8,19 @@ function format_tt(ts) { |
| 8 | 8 | var fm=(d.getMonth()+1)+"月"+ d.getDate()+"日"; |
| 9 | 9 | return fm; |
| 10 | 10 | } |
| 11 | + | |
| 12 | +//拿来判断是不是在指定门店内 | |
| 13 | +function is_no_dis(text,val){ | |
| 14 | + if(text==undefined) return false; | |
| 15 | + if(text=='') return false; | |
| 16 | + if(!text) return false; | |
| 17 | + | |
| 18 | + if(text.indexOf(val)==-1) return true; | |
| 19 | + return false; | |
| 20 | +} | |
| 21 | + | |
| 11 | 22 | module.exports = { |
| 12 | 23 | is_has: is_has, |
| 13 | - format_tt:format_tt | |
| 24 | + format_tt:format_tt, | |
| 25 | + is_no_dis:is_no_dis | |
| 14 | 26 | } | ... | ... |
packageA/pages/goodsInfo/goodsInfo.js
| ... | ... | @@ -1714,7 +1714,7 @@ Page({ |
| 1714 | 1714 | } |
| 1715 | 1715 | e.his_cate_num=his_cate_num; |
| 1716 | 1716 | |
| 1717 | - //--普通门店排版-- | |
| 1717 | + //--普通门店排版,服务卡项有指定门店才能使用,所以要筛选一下-- | |
| 1718 | 1718 | setTimeout(function(){ |
| 1719 | 1719 | var sto_list=th.data.data.storageId; |
| 1720 | 1720 | if(sto_list){ |
| ... | ... | @@ -1922,7 +1922,7 @@ Page({ |
| 1922 | 1922 | }); |
| 1923 | 1923 | //-----如果没有默认门店,要取第一个门店作为默认店.此时没有门店分类的情况------ |
| 1924 | 1924 | if (!th.data.def_pick_store) { |
| 1925 | - th.setData({def_pick_store:e.data.data.pageData[0]}) | |
| 1925 | + th.setData({def_pick_store:e.data.data.pageData[0]}) | |
| 1926 | 1926 | } |
| 1927 | 1927 | |
| 1928 | 1928 | } | ... | ... |
packageA/pages/goodsInfo/goodsInfo.wxml
| ... | ... | @@ -820,7 +820,12 @@ |
| 820 | 820 | <view class="address-frame xc-ash"> |
| 821 | 821 | <view class="flex-vertical-between butttem5"> |
| 822 | 822 | <view class="flex xc-ash"> |
| 823 | - <view class="fs30 xc-black3 address_name">{{item.pickup_name}}</view> | |
| 823 | + <view class="fs30 xc-black3 address_name">{{item.pickup_name}} | |
| 824 | + <block wx:if="{{tool.is_no_dis(sele_g.storageId,item.keyid)}}"> | |
| 825 | + <text class="no_store">(配送不匹配)</text> | |
| 826 | + </block> | |
| 827 | + | |
| 828 | + </view> | |
| 824 | 829 | </view> |
| 825 | 830 | <view> |
| 826 | 831 | <view class="distance fs24 address-val" wx:if="{{item.distance!=null}}"> |
| ... | ... | @@ -846,7 +851,11 @@ |
| 846 | 851 | <view class="address-frame xc-ash"> |
| 847 | 852 | <view class="flex-vertical-between "> |
| 848 | 853 | <view class="flex xc-ash"> |
| 849 | - <view class="fs30 xc-black3 address_name">{{item.pickup_name}}</view> | |
| 854 | + <view class="fs30 xc-black3 address_name">{{item.pickup_name}} | |
| 855 | + <block wx:if="{{tool.is_no_dis(sele_g.storageId,item.keyid)}}"> | |
| 856 | + <text class="no_store">(配送不匹配)</text> | |
| 857 | + </block> | |
| 858 | + </view> | |
| 850 | 859 | </view> |
| 851 | 860 | <view> |
| 852 | 861 | <view class="distance fs24 address-val" wx:if="{{item.distance!=null}}">距离:{{item.distance>1000?filters.toFix(item.distance/1000,2)+"km":filters.toFix(item.distance,0)+"m"}} |
| ... | ... | @@ -874,7 +883,11 @@ |
| 874 | 883 | <view class="address-frame xc-ash"> |
| 875 | 884 | <view class="flex-vertical-between "> |
| 876 | 885 | <view class="flex xc-ash"> |
| 877 | - <view class="fs28 xc-black3 address_name">{{item.pickup_name}}</view> | |
| 886 | + <view class="fs28 xc-black3 address_name">{{item.pickup_name}} | |
| 887 | + <block wx:if="{{tool.is_no_dis(sele_g.storageId,item.keyid)}}"> | |
| 888 | + <text class="no_store">(配送不匹配)</text> | |
| 889 | + </block> | |
| 890 | + </view> | |
| 878 | 891 | </view> |
| 879 | 892 | <view> |
| 880 | 893 | <view class="distance fs24 address-val" wx:if="{{item.distance!=null}}"> | ... | ... |
pages/user/order_list/order_list.js
| ... | ... | @@ -2134,7 +2134,15 @@ Page({ |
| 2134 | 2134 | }; |
| 2135 | 2135 | if (currentIndex == 2) { // 卡项订单 |
| 2136 | 2136 | list = th.data.cardList; |
| 2137 | - list = list.concat(data); | |
| 2137 | + var new_data= data.map((item,index)=>{ | |
| 2138 | + item.pt_status=item.list[0].pt_status; | |
| 2139 | + item.pt_tail_money=item.list[0].pt_tail_money; | |
| 2140 | + item.prom_id=item.list[0].prom_id; | |
| 2141 | + item.prom_type=item.list[0].prom_type; | |
| 2142 | + return item; | |
| 2143 | + }) | |
| 2144 | + | |
| 2145 | + list = list.concat(new_data); | |
| 2138 | 2146 | th.setData({ cardList: list }); |
| 2139 | 2147 | console.log('currentCard', list); |
| 2140 | 2148 | }; |
| ... | ... | @@ -2716,12 +2724,7 @@ Page({ |
| 2716 | 2724 | }, |
| 2717 | 2725 | }); |
| 2718 | 2726 | |
| 2719 | - // let index = e.currentTarget.dataset.index; | |
| 2720 | - // let cardList = self.data.cardList; | |
| 2721 | - // cardList.splice(index, 1); | |
| 2722 | - // self.setData({ | |
| 2723 | - // cardList, | |
| 2724 | - // }); | |
| 2727 | + | |
| 2725 | 2728 | |
| 2726 | 2729 | //self.request_list(self.data.currentRequestData); |
| 2727 | 2730 | }, | ... | ... |
pages/user/order_list/order_list.wxml
| ... | ... | @@ -307,19 +307,36 @@ |
| 307 | 307 | <!--商品编号 --> |
| 308 | 308 | <text selectable='true'>订单编号:{{item.order_sn}}</text> |
| 309 | 309 | <!-- 订单状态 --> |
| 310 | - <view class="flex-center c-r"> | |
| 311 | - <view wx:if="{{item.order_status == 0}}">待支付</view> | |
| 312 | - <view wx:if="{{item.order_status == 1}}" class="flex-center">待评价 <view class="lin"></view> | |
| 313 | - <image src="{{iurl}}miniapp/images/trash.png" bindtap="deleteSerOrderData" data-index="{{index}}" data-orderid="{{item.order_id}}" data-ordersn="{{item.order_sn}}" ></image> | |
| 314 | - </view> | |
| 315 | - <view wx:if="{{item.order_status == 2}}" class="flex-center">已评价<view class="lin"></view> | |
| 316 | - <image src="{{iurl}}miniapp/images/trash.png" bindtap="deleteSerOrderData" data-index="{{index}}" data-orderid="{{item.order_id}}" data-ordersn="{{item.order_sn}}" ></image> | |
| 317 | - </view> | |
| 318 | - <view wx:if="{{item.order_status == 3}}" class="c-a9" class="flex-center">已取消<view class="lin"></view> | |
| 319 | - <image src="{{iurl}}miniapp/images/trash.png" bindtap="deleteSerOrderData" data-index="{{index}}" data-orderid="{{item.order_id}}" data-ordersn="{{item.order_sn}}" ></image> | |
| 320 | - </view> | |
| 321 | - <view wx:if="{{item.order_status == 5}}">已作废</view> | |
| 322 | - </view> | |
| 310 | + <view class="flex-center c-r"> | |
| 311 | + <view wx:if="{{item.pay_status == 0}}"> | |
| 312 | + <block wx:if="{{item.prom_type==6}}"> | |
| 313 | + <block wx:if="{{item.pt_status==0}}" >未支付</block> | |
| 314 | + <block wx:if="{{item.pt_status==1}}" >组团中</block> | |
| 315 | + <block wx:if="{{item.pt_status==2 && item.pt_tail_money>0}}">待支付尾款</block> | |
| 316 | + </block> | |
| 317 | + <block wx:else> | |
| 318 | + 待支付 | |
| 319 | + </block> | |
| 320 | + </view> | |
| 321 | + <view wx:if="{{item.order_status == 1 && item.pay_status==1}}" class="flex-center">待评价 | |
| 322 | + <view class="lin"></view> | |
| 323 | + <image src="{{iurl}}miniapp/images/trash.png" bindtap="deleteSerOrderData" | |
| 324 | + data-index="{{index}}" data-orderid="{{item.order_id}}" data-ordersn="{{item.order_sn}}"> | |
| 325 | + | |
| 326 | + </image> | |
| 327 | + </view> | |
| 328 | + <view wx:if="{{item.order_status == 2}}" class="flex-center">已评价 | |
| 329 | + <view class="lin"></view> | |
| 330 | + <image src="{{iurl}}miniapp/images/trash.png" bindtap="deleteSerOrderData" data-index="{{index}}" | |
| 331 | + data-orderid="{{item.order_id}}" data-ordersn="{{item.order_sn}}"></image> | |
| 332 | + </view> | |
| 333 | + <view wx:if="{{item.order_status == 3}}" class="c-a9" class="flex-center">已取消 | |
| 334 | + <view class="lin"></view> | |
| 335 | + <image src="{{iurl}}miniapp/images/trash.png" bindtap="deleteSerOrderData" data-index="{{index}}" | |
| 336 | + data-orderid="{{item.order_id}}" data-ordersn="{{item.order_sn}}"></image> | |
| 337 | + </view> | |
| 338 | + <view wx:if="{{item.order_status == 5}}">已作废</view> | |
| 339 | + </view> | |
| 323 | 340 | </view> |
| 324 | 341 | |
| 325 | 342 | <!-- 商品详情集合 --> |
| ... | ... | @@ -330,7 +347,8 @@ |
| 330 | 347 | <!-- 商品图片 --> |
| 331 | 348 | <navigator class="rel"> |
| 332 | 349 | <image src="{{resourceUrl+goods.img_url}}" binderror="bind_bnerr" lazy-load="{{true}}" data-errorimg="orderList[{{index}}].list[{{pinx}}].img_url"></image> |
| 333 | - <!-- <view class="abs flex-center fs26">服务卡</view> --> | |
| 350 | + <view class="abs flex-center fs26" wx:if="{{goods.prom_type==1}}">秒杀</view> | |
| 351 | + <view class="abs flex-center fs26" wx:if="{{goods.prom_type==6}}">团购</view> | |
| 334 | 352 | </navigator> |
| 335 | 353 | <!-- 商品内容 --> |
| 336 | 354 | <view class="Commodity_content"> |
| ... | ... | @@ -392,14 +410,18 @@ |
| 392 | 410 | <navigator class="commodity_To_evaluate flex-level View_evaluation" url="/packageA/pages/details_serviceCard/details_serviceCard?order_id={{item.order_id}}">订单详情</navigator> |
| 393 | 411 | |
| 394 | 412 | |
| 395 | - <block wx:if="{{item.order_status==1}}"> | |
| 413 | + <block wx:if="{{item.order_status==1 && item.pay_status==1}}"> | |
| 396 | 414 | <navigator wx:if="{{item.list.length > 1}}" class="order-btn white bg-orange" |
| 397 | 415 | url="/packageB/pages/user/comment/comment?card=1&status=0&order_id={{item.list[index].order_id}}">评价</navigator> |
| 398 | 416 | <navigator wx:else class="order-btn white bg-orange" |
| 399 | 417 | url="/packageB/pages/user/add_comment/add_comment?card=1&goods_id={{item.list[0].card_id}}&order_id={{item.list[0].order_id}}&price={{item.list[0].price}}">评价</navigator> |
| 400 | 418 | </block> |
| 401 | 419 | |
| 402 | - <navigator class="commodity_To_evaluate flex-level comment_go" bindtap="pay" data-index="{{index}}" wx:if="{{item.order_status==0}}">立即支付</navigator> | |
| 420 | + <navigator class="commodity_To_evaluate flex-level comment_go" | |
| 421 | + bindtap="pay" data-index="{{index}}" wx:if="{{item.prom_type!=6 && item.pay_status==0}}">立即支付</navigator> | |
| 422 | + | |
| 423 | + <navigator class="commodity_To_evaluate flex-level comment_go" | |
| 424 | + bindtap="pay" data-index="{{index}}" wx:if="{{item.prom_type==6 && item.pt_status==0}}">立即支付</navigator> | |
| 403 | 425 | |
| 404 | 426 | |
| 405 | 427 | ... | ... |