Commit 85734f416acce0543ce820413254dc35ad3caf1b
1 parent
434be1c8
cart2的优化
Showing
2 changed files
with
11 additions
and
46 deletions
packageE/pages/cart/cart2/cart2.js
| ... | ... | @@ -1019,41 +1019,6 @@ Page({ |
| 1019 | 1019 | } |
| 1020 | 1020 | } |
| 1021 | 1021 | |
| 1022 | - var car_item = item; | |
| 1023 | - /*----接口要弄出来的,先顶着-----*/ | |
| 1024 | - var pcid = car_item.pick_id; | |
| 1025 | - var find = 0; | |
| 1026 | - //----如果有就加进去,没有就新增一个---- | |
| 1027 | - //-----------循环查找门店------------- | |
| 1028 | - if (arr.length > 0) { | |
| 1029 | - for (var j = 0; j < arr.length; j++) { | |
| 1030 | - if (arr[j].pickup_id == pcid) { | |
| 1031 | - if (item.is_gift != 1) { | |
| 1032 | - //确定配送方式 | |
| 1033 | - if (arr[j].distr_t == 0) { | |
| 1034 | - arr[j].distr_t = car_item.distr_type; | |
| 1035 | - } | |
| 1036 | - var e_t = 0 | |
| 1037 | - switch (arr[j].distr_t) { | |
| 1038 | - case 0: | |
| 1039 | - e_t = 1; | |
| 1040 | - if (th.data.json_d.pickupway && th.data.json_d.pickupway == 1) e_t = 0; | |
| 1041 | - break; | |
| 1042 | - case 1: | |
| 1043 | - e_t = 1; | |
| 1044 | - break; | |
| 1045 | - case 2: | |
| 1046 | - e_t = 0; | |
| 1047 | - break; | |
| 1048 | - } | |
| 1049 | - arr[j].exp_type = e_t; | |
| 1050 | - //if (e_t == 0) th.setData({ is_all_zt: 0 }); | |
| 1051 | - //else if (e_t == 1) th.setData({ is_all_zt: 1 }); | |
| 1052 | - } | |
| 1053 | - | |
| 1054 | - //-- 把等级卡会优惠多少钱装进去 -- | |
| 1055 | - if (car_item.cut_price1) arr[j].card_cut_price += car_item.cut_price1; | |
| 1056 | - | |
| 1057 | 1022 | //在分组的时候,就不要再调用接口,await |
| 1058 | 1023 | for (var i = 0; i < carr.length; i++) { |
| 1059 | 1024 | var item = carr[i]; |
| ... | ... | @@ -1170,16 +1135,6 @@ Page({ |
| 1170 | 1135 | sto = th.data.allsto[k]; |
| 1171 | 1136 | break; |
| 1172 | 1137 | } |
| 1173 | - }else{ | |
| 1174 | - | |
| 1175 | - var is_a_zt =1; | |
| 1176 | - for (var ih in arr) { | |
| 1177 | - var ie = arr[ih]; | |
| 1178 | - //-- 是不是全部自提清空 -- | |
| 1179 | - if (ie.exp_type == 0 || ie.exp_type == 2) is_a_zt= 0; | |
| 1180 | - } | |
| 1181 | - th.setData({ is_all_zt: is_a_zt}); | |
| 1182 | - | |
| 1183 | 1138 | } |
| 1184 | 1139 | var e_t = 0, dis_t = 0;//物流方式,配送方式 |
| 1185 | 1140 | if (item.distr_type == 0) { |
| ... | ... | @@ -1267,6 +1222,16 @@ Page({ |
| 1267 | 1222 | } |
| 1268 | 1223 | } |
| 1269 | 1224 | } |
| 1225 | + else{ | |
| 1226 | + var is_a_zt =1; | |
| 1227 | + for (var ih in arr) { | |
| 1228 | + var ie = arr[ih]; | |
| 1229 | + //-- 是不是全部自提清空 -- | |
| 1230 | + if (ie.exp_type == 0 || ie.exp_type == 2) is_a_zt= 0; | |
| 1231 | + } | |
| 1232 | + th.setData({ is_all_zt: is_a_zt}); | |
| 1233 | + | |
| 1234 | + } | |
| 1270 | 1235 | |
| 1271 | 1236 | var cart_commission = 0; |
| 1272 | 1237 | //-- 循环计算一下线下取价 -- | ... | ... |
pages/goods/categoryList/categoryList.wxml
| ... | ... | @@ -15,7 +15,7 @@ |
| 15 | 15 | <view class="search-box " bindtap="goseach"> |
| 16 | 16 | <view class="search-inner"> |
| 17 | 17 | <view class="search-img"> |
| 18 | - <image class="wh100" src="{{iurl}}/miniapp/images/search.png"></image> | |
| 18 | + <image class="wh100" src="{{iurl}}/miniapp/images/search.png" style="vertical-align:text-top"></image> | |
| 19 | 19 | </view> |
| 20 | 20 | <input bindfocus="goseach" class="search-cont" placeholder="寻找好口碑" type="text"></input> |
| 21 | 21 | </view> | ... | ... |