Commit 776605a3e29887f24e9e7addb19dde76d11ef2c3
1 parent
08ab28bf
商品结算页面
Showing
3 changed files
with
178 additions
and
60 deletions
pages/cart/cart2/cart2.js
... | ... | @@ -79,8 +79,6 @@ Page({ |
79 | 79 | |
80 | 80 | |
81 | 81 | is_express:0,//选中物流的属性 |
82 | - | |
83 | - express_name:"商家自配", | |
84 | 82 | expres_name:"",//点击选定 |
85 | 83 | isopen:0,//券的说明 |
86 | 84 | is_coupon:0,//选择券的控制属性 |
... | ... | @@ -1082,18 +1080,26 @@ Page({ |
1082 | 1080 | //--------立即购买时,选择自提和物流----------- |
1083 | 1081 | setexptype_w:function(t){ |
1084 | 1082 | var th=this; |
1085 | - var ty = t.currentTarget.dataset.t,txt = t.currentTarget.dataset.txt; | |
1083 | + | |
1084 | + var ty = t.currentTarget.dataset.t, txt = t.currentTarget.dataset.txt, ont = t.currentTarget.dataset.ont; | |
1086 | 1085 | th.setData({ [txt]: ty }); |
1087 | 1086 | var iszt=1; |
1087 | + | |
1088 | 1088 | if(ty==0){ |
1089 | + | |
1089 | 1090 | th.setData({ is_all_zt: 0 }); |
1090 | 1091 | }else{ |
1091 | 1092 | for(var i=0;i<th.data.cartlist.length;i++){ |
1092 | 1093 | var item = th.data.cartlist[i]; |
1093 | 1094 | if (item.exp_type==0){ iszt=0;break;} |
1094 | 1095 | } |
1096 | + | |
1095 | 1097 | th.setData({ is_all_zt: iszt }); |
1096 | 1098 | } |
1099 | + //判断是不是快递 | |
1100 | + if (ont == 66) { | |
1101 | + this.express_name(); | |
1102 | + } | |
1097 | 1103 | //----计算此时购物车的价格---- |
1098 | 1104 | th.calculatePrice(); |
1099 | 1105 | }, |
... | ... | @@ -1236,7 +1242,7 @@ Page({ |
1236 | 1242 | /*--点击选择券--*/ |
1237 | 1243 | sele_quan_item:function(e) { |
1238 | 1244 | var no_use=e.currentTarget.dataset.no, quanlist=this.data.selected_quan_list; |
1239 | - | |
1245 | + | |
1240 | 1246 | //---所有的券的显示红色选择都清理一遍--- |
1241 | 1247 | for(var ind in quanlist){ |
1242 | 1248 | quanlist[ind].show_red=0; |
... | ... | @@ -1247,14 +1253,16 @@ Page({ |
1247 | 1253 | var th=this; |
1248 | 1254 | |
1249 | 1255 | //---如果是不使用优惠券--- |
1256 | + | |
1250 | 1257 | if(no_use==1){ |
1258 | + console.log("有进来吗券", no_use); | |
1251 | 1259 | if(using_quan[th.data.selected_quan_pick]){ |
1252 | 1260 | using_quan[th.data.selected_quan_pick].is_nouse_red=1; |
1253 | 1261 | } |
1254 | 1262 | else{ |
1255 | 1263 | using_quan[th.data.selected_quan_pick] ={is_nouse_red:1}; |
1256 | 1264 | } |
1257 | - this.setData({using_quan:using_quan}); | |
1265 | + this.setData({ using_quan: using_quan, is_coupon:2222}); | |
1258 | 1266 | return; |
1259 | 1267 | } |
1260 | 1268 | |
... | ... | @@ -1349,7 +1357,7 @@ Page({ |
1349 | 1357 | } |
1350 | 1358 | return arr; |
1351 | 1359 | }, |
1352 | - // 开启物流的弹窗 | |
1360 | + // // 开启物流的弹窗 | |
1353 | 1361 | express_name:function(){ |
1354 | 1362 | this.setData({ open_express: 1}); |
1355 | 1363 | |
... | ... | @@ -1362,13 +1370,14 @@ Page({ |
1362 | 1370 | click_express_name:function(e){ |
1363 | 1371 | var express_name=e.currentTarget.dataset.name; |
1364 | 1372 | var index=e.currentTarget.dataset.idxe; |
1365 | - this.setData({ expres_name: express_name, is_express:index}); | |
1373 | + this.setData({ is_express: index, index: index}); | |
1366 | 1374 | }, |
1367 | 1375 | //点击确定物流 |
1368 | - determine_expres:function(){ | |
1369 | - | |
1376 | + determine_expres:function(e){ | |
1377 | + | |
1370 | 1378 | var name=this.data.expres_name |
1371 | - this.setData({ express_name: name, open_express: 0}); | |
1379 | + this.setData({ open_express: 0}); | |
1380 | + this.calculatePrice(); | |
1372 | 1381 | }, |
1373 | 1382 | //设置默认物流 |
1374 | 1383 | set_default:function(){ | ... | ... |
pages/cart/cart2/cart2.wxml
... | ... | @@ -4,7 +4,7 @@ |
4 | 4 | <wxs module="filters" src="../../../utils/filter.wxs"></wxs> |
5 | 5 | <form bindsubmit="submitForm"> |
6 | 6 | <view class="container"> |
7 | - <!--要进行判断地址是否显示----> | |
7 | + <!--要进行判断地址是否显示----> | |
8 | 8 | <view bindtap="enterAddressPage" class="user-mes" |
9 | 9 | hidden='{{(bn_exp_type==1 && is_b_now==1) || (is_all_zt==1 && is_b_now==0)}}'> |
10 | 10 | <!---默认地址显示------> |
... | ... | @@ -19,7 +19,8 @@ |
19 | 19 | </view> |
20 | 20 | </view> |
21 | 21 | <view class="update-logistics"> |
22 | - <image class="arrow-rigth" src="{{imgUrl}}/miniapp/images/new_position.png"></image> | |
22 | + <!-- <image class="arrow-rigth" src="{{imgUrl}}/miniapp/images/new_position.png"></image> --> | |
23 | + <view class="xc-right"></view> | |
23 | 24 | </view> |
24 | 25 | </block> |
25 | 26 | <!---先增地址------> |
... | ... | @@ -28,15 +29,16 @@ |
28 | 29 | <image class="addr_jia" src="{{imgUrl}}/miniapp/images/jia.png"></image>添加地址 |
29 | 30 | </view> |
30 | 31 | </block> |
31 | - <view class="border-img"><image class="wh100" src="{{imgUrl}}/miniapp/images/tt.png"></image></view> | |
32 | + <view class="border-img"><image class="wh100" src="{{imgUrl}}/miniapp/images/order/new_dividing_line.png"></image></view> | |
32 | 33 | </view> |
33 | 34 | |
34 | 35 | <!---------------------购物车进来,有可能多单----------------------> |
35 | 36 | <block wx:if="{{is_b_now==0}}"> |
37 | + <view class="xc-border main-top"></view> | |
36 | 38 | <view wx:for="{{cartlist}}" wx:for-index="pidx"> |
37 | 39 | <view class="use-item bfff"> |
38 | 40 | |
39 | - <image class="dp" src='{{imgUrl}}/miniapp/images/dianpu.png'> </image> <view>门店:{{item.pname}}</view></view> | |
41 | + <image class="dp" src='{{imgUrl}}/miniapp/images/goodscategory/new_store.png'> </image> <view>门店:{{item.pname}}</view></view> | |
40 | 42 | <view class="order-detail" wx:for="{{item.goods}}" wx:for-index="idx" wx:for-item="items"> |
41 | 43 | <!----商品图片-----> |
42 | 44 | <view class="goods-img"> |
... | ... | @@ -46,12 +48,12 @@ |
46 | 48 | <!----商品名称规格----> |
47 | 49 | <navigator class="order-cont" url="/pages/goods/goodsInfo/goodsInfo?goods_id={{items.goods_id}}"> |
48 | 50 | <view class="goods-name">{{items.goods_name}}</view> |
49 | - <view class="goods-color"> | |
50 | - <text wx:if="{{items.goods_spec!='' && items.goods_spec!=null }}">{{items.goods_spec}}/</text> | |
51 | - {{items.goods_color==null?"":items.goods_color}} | |
52 | - </view> | |
51 | + | |
53 | 52 | <!-- 商品属性 --> |
54 | - <view class="flex fs28 xc-ash">商品属性: <view></view></view> | |
53 | + <view class="flex-vertical fs28 xc-ash">商品属性: <view class="goods-color"> | |
54 | + <text wx:if="{{items.goods_spec!='' && items.goods_spec!=null }}"> {{items.goods_spec}}/</text> | |
55 | + {{items.goods_color==null?"":items.goods_color}} | |
56 | + </view></view> | |
55 | 57 | |
56 | 58 | |
57 | 59 | <!-----商品名称规格------> |
... | ... | @@ -67,57 +69,95 @@ |
67 | 69 | <view class="xc-coupon-frame flex-center" data-bn="0" bindtap="open_coupon_list" |
68 | 70 | wx:if="{{item.quan_list && item.quan_list.length>0 }}" data-cind="{{pidx}}" data-pickid="{{item.pickup_id}}"> |
69 | 71 | <view class="work-frame flex-space-between"> |
70 | - <view class="work">使用优惠券</view> | |
72 | + <view class="work">优惠券</view> | |
71 | 73 | <view class="xc-right-frame"> |
72 | 74 | <text wx:if="{{using_quan[item.pickup_id].is_nouse}}">不使用</text> |
73 | - <text wx:if="{{using_quan[item.pickup_id].money}}">{{using_quan[item.pickup_id].money}}元优惠券</text> | |
75 | + <text wx:if="{{using_quan[item.pickup_id].money}}">¥{{using_quan[item.pickup_id].money}}元优惠券</text> | |
74 | 76 | <view class="xc-right"></view> |
75 | 77 | </view> |
76 | 78 | </view> |
77 | 79 | </view> |
78 | 80 | |
81 | + | |
82 | + | |
83 | + | |
84 | + | |
79 | 85 | <view class="set-mes"> |
80 | - <view wx:if="{{order.store_prom}}"><icon color="#f23030" size="16" type="info"></icon>{{order.store_prom}} | |
86 | + <view wx:if="{{order.store_prom}}"> | |
87 | + <icon color="#f23030" size="16" type="info"></icon> | |
88 | + {{order.store_prom}} | |
81 | 89 | </view> |
82 | - <view class="use-item"> | |
83 | - <view data-t='1' style="display:{{item.distr_t==2?'none':'flex'}};"> | |
84 | - <icon bindtap='setexptype_w' data-t='1' data-txt='cartlist[{{pidx}}].exp_type' color="{{item.exp_type==1?'red':'gray'}}" size="16" type="success"></icon> | |
90 | + <view class="use-item flex-space-between"> | |
91 | + <view class="flex-vertical"> | |
92 | + <view bindtap='setexptype_w' data-t='1' data-txt='cartlist[{{pidx}}].exp_type'style="display:{{item.distr_t==2?'none':'flex;align-items: center'}};"> | |
93 | + <!-- <icon bindtap='setexptype_w' data-t='1' data-txt='cartlist[{{pidx}}].exp_type' color="{{item.exp_type==1?'red':'gray'}}" size="16" type="success"></icon> --> | |
94 | + | |
95 | + | |
96 | + | |
97 | + <block wx:if="{{item.exp_type==1}}"> | |
98 | + <!-- <view class="circle white xc-hookt fs20 red-b sn"><text>Γ</text></view> --> | |
99 | + <icon data-t='0' data-txt='cartlist[{{pidx}}].exp_type' color="red" size="16" type="success"></icon> | |
100 | + </block> | |
101 | + <block wx:else> | |
102 | + <view class="circle xc-hookts on"></view> | |
103 | + </block> | |
85 | 104 | <view bindtap='setexptype_w' data-t='1' data-txt='cartlist[{{pidx}}].exp_type' class="yu_er">门店自提</view> |
86 | 105 | </view> |
87 | 106 | |
88 | - <view data-t='0' style="display:{{item.distr_t==1?'none':'flex'}};"> | |
89 | - <icon bindtap='setexptype_w' data-t='0' data-txt='cartlist[{{pidx}}].exp_type' class="wuliu" color="{{item.exp_type==0?'red':'gray'}}" size="16" type="success"></icon> | |
107 | + <view data-t='0'data-ont="66"data-txt='cartlist[{{pidx}}].exp_type' bindtap="setexptype_w" style="display:{{item.distr_t==1?'none':'flex;align-items: center'}};"> | |
108 | + <!-- <icon bindtap='setexptype_w' data-t='0' data-txt='cartlist[{{pidx}}].exp_type' color="{{item.exp_type==0?'red':'gray'}}" size="16" type="success"></icon> --> | |
109 | + <block wx:if="{{item.exp_type==0}}"> | |
110 | + <!-- <view class="circle white xc-hookt fs20 red-b sn"><text>Γ</text></view> --> | |
111 | + <icon data-t='0' data-txt='cartlist[{{pidx}}].exp_type' color="red" size="16" type="success"></icon> | |
112 | + </block> | |
113 | + <block wx:else> | |
114 | + <view class="circle xc-hookts on"></view> | |
115 | + </block> | |
116 | + | |
90 | 117 | <view bindtap='setexptype_w' data-t='0' data-txt='cartlist[{{pidx}}].exp_type' class="yu_er">快递邮寄</view> |
91 | 118 | </view> |
119 | + </view> | |
120 | + <block wx:if="{{item.exp_type==0}}"> | |
121 | + <view class="flex-vertical"> | |
122 | + <view >{{wu_arr[index].name}}</view> | |
123 | + <view class="xc-right"></view> | |
124 | + </view> | |
125 | + </block> | |
92 | 126 | </view> |
93 | - <view bindtap="express_name" class="use-item" hidden='{{item.exp_type==1}}'> | |
94 | - <view>选择物流:</view> | |
95 | - <view >{{express_name}}</view> | |
127 | + | |
128 | + <!-- <view bindtap="express_name" class="use-item" hidden='{{item.exp_type==1}}'> | |
129 | + <view>选择物流:</view> --> | |
130 | + | |
96 | 131 | <!-- <picker bindchange="bindPickerChange_w" data-txt='cartlist[{{pidx}}].wind' value="{{item.wind}}" range="{{wu_arr}}" range-key="name"> |
97 | 132 | <view >{{wu_arr[item.wind].name}}</view> |
98 | 133 | </picker> --> |
99 | - </view> | |
100 | - </view> | |
101 | - <view class="coupon-mes flex-vertical"> | |
102 | - <view>留言</view> | |
103 | - <view class="leave-word"> | |
104 | - <textarea placeholder='给商家留言,最多100字'bindinput="keyUpChangeNum" disabled="{{disabled}}" class="word-box" maxlength="100" name="user_note_{{item.pickup_id}}"></textarea> | |
105 | - | |
106 | - </view> | |
134 | + <!-- </view> --> | |
107 | 135 | </view> |
108 | - </view> | |
109 | - <!-----使用余额------> | |
136 | + <!-----使用余额------> | |
110 | 137 | <view class="set-mes" wx:if="{{yuer>0}}"> |
111 | 138 | <view class="use-item" bindtap='set_js_useyuer'> |
112 | 139 | <icon color="{{js_use_money?'red':'gray'}}" size="16" type="success"></icon> |
113 | 140 | <view class="yu_er">使用余额 :¥{{yuer}} </view> |
114 | 141 | </view> |
115 | 142 | </view> |
143 | + | |
144 | + </view> | |
145 | + | |
146 | + <!-- 留言 --> | |
147 | + <view class="coupon-mes flex-vertical"> | |
148 | + <view>留言</view> | |
149 | + <view class="leave-word"> | |
150 | + <textarea placeholder-class="fs28" placeholder='给商家留言,最多100字'bindinput="keyUpChangeNum" disabled="{{disabled}}" class="word-box" maxlength="100" name="user_note_{{item.pickup_id}}"></textarea> | |
151 | + | |
152 | + </view> | |
153 | + </view> | |
154 | + | |
116 | 155 | </block> |
117 | 156 | |
118 | 157 | <!------立即购买--------> |
158 | + <view class="xc-border xc-border"></view> | |
119 | 159 | <block wx:if="{{is_b_now==1}}"> |
120 | - <view class="xc-border"></view> | |
160 | + | |
121 | 161 | <view class="use-item bfff"> |
122 | 162 | |
123 | 163 | <image class="dp" src='{{imgUrl}}/miniapp/images/dianpu.png'> </image> <view>门店:{{bn_pickname}}</view></view> |
... | ... | @@ -127,11 +167,10 @@ |
127 | 167 | </view> |
128 | 168 | <navigator class="order-cont" url="/pages/goods/goodsInfo/goodsInfo?goods_id={{bn_goods.goods_id}}"> |
129 | 169 | <view class="goods-name">{{bn_goods.goods_name}}</view> |
130 | - <view class="goods-color"> | |
131 | - <text wx:if="{{bn_goods.goods_spec!=''}}">{{bn_goods.goods_spec}}/</text>{{bn_goods.goods_color}} | |
132 | - </view> | |
170 | + | |
133 | 171 | <!-- 商品属性 --> |
134 | - <view class="flex fs28 xc-ash">商品属性: <view></view></view> | |
172 | + <view class="flex-vertical fs28 xc-ash">商品属性: <view class="goods-color"> | |
173 | + <text wx:if="{{bn_goods.goods_spec!=''}}"> {{bn_goods.goods_spec}}/</text>{{bn_goods.goods_color}}</view></view> | |
135 | 174 | |
136 | 175 | |
137 | 176 | <!-----商品名称规格------> |
... | ... | @@ -273,7 +312,22 @@ |
273 | 312 | <view class="xc-close">×</view> |
274 | 313 | </view> |
275 | 314 | </view> |
276 | - <view class="may_use_coupon fs28">可使用的优惠券</view> | |
315 | + <!-- <view class=""> --> | |
316 | + <view class="may_use_coupon fs28 flex"> | |
317 | + 可使用的优惠券 | |
318 | + <view class=" is_use_coupon flex-vertical" bindtap="sele_quan_item" data-no="1"> | |
319 | + 不使用优惠券 | |
320 | + | |
321 | + <block wx:if="{{using_quan[selected_quan_pick].is_nouse_red}}"> | |
322 | + <view class="circle white xc-hooka fs20 red-b sn"><text>Γ</text></view> | |
323 | + </block> | |
324 | + <block wx:else> | |
325 | + <view class="circle xc-hookst ons"></view> | |
326 | + </block> | |
327 | + | |
328 | + </view> | |
329 | + </view> | |
330 | + <!-- </view> --> | |
277 | 331 | <view class="xc-frame flex-level"> |
278 | 332 | <view class="list-frame"> |
279 | 333 | ... | ... |
pages/cart/cart2/cart2.wxss
... | ... | @@ -19,14 +19,14 @@ |
19 | 19 | .pos-icon { |
20 | 20 | position: absolute; |
21 | 21 | left: 30rpx; |
22 | - top: 0; | |
22 | + top: 9rpx; | |
23 | 23 | width: 32rpx; |
24 | - height: 32.5rpx; | |
24 | + height: 37.5rpx; | |
25 | 25 | } |
26 | 26 | |
27 | 27 | .border-img { |
28 | 28 | width: 100%; |
29 | - height: 16rpx; | |
29 | + height: 12rpx; | |
30 | 30 | } |
31 | 31 | |
32 | 32 | .update-logistics { |
... | ... | @@ -55,7 +55,7 @@ |
55 | 55 | padding: 30rpx 0; |
56 | 56 | border-bottom: 1px solid #ddd; |
57 | 57 | color: #777; |
58 | - min-height: 100rpx; | |
58 | + min-height: 240rpx; | |
59 | 59 | background-color: #fff; |
60 | 60 | |
61 | 61 | } |
... | ... | @@ -82,6 +82,8 @@ |
82 | 82 | |
83 | 83 | .goods-color { |
84 | 84 | font-size: 24rpx; |
85 | + margin-left: 15rpx; | |
86 | + | |
85 | 87 | } |
86 | 88 | |
87 | 89 | .order-num { |
... | ... | @@ -100,7 +102,6 @@ |
100 | 102 | width:95%; |
101 | 103 | margin:auto; |
102 | 104 | |
103 | - | |
104 | 105 | } |
105 | 106 | .use-item>view{ |
106 | 107 | display: flex;margin-right: 10rpx; |
... | ... | @@ -136,13 +137,13 @@ margin:auto; |
136 | 137 | } |
137 | 138 | |
138 | 139 | .coupon-mes { |
139 | - height:80rpx; | |
140 | + height:95rpx; | |
140 | 141 | padding: 0 20rpx; |
141 | 142 | background-color: #fff; |
142 | 143 | font-size: 30rpx; |
143 | 144 | color: #444; |
144 | 145 | width: 100%; |
145 | -border-bottom: 10rpx solid #eee; | |
146 | + | |
146 | 147 | |
147 | 148 | } |
148 | 149 | |
... | ... | @@ -276,7 +277,7 @@ border-bottom: 10rpx solid #eee; |
276 | 277 | .add_new{height: 60rpx; line-height: 60rpx;} |
277 | 278 | .addr_jia{width: 45rpx; height: 45rpx; border: 1rpx solid #ddd; |
278 | 279 | margin-right: 15rpx; margin-left: 20rpx; vertical-align: middle;} |
279 | -.yu_er{margin-left: 15rpx;} .wuliu{margin-left: 20rpx;} | |
280 | +.yu_er{margin-left: 10rpx;margin-right: 60rpx;} .wuliu{margin-left: 20rpx;} | |
280 | 281 | |
281 | 282 | |
282 | 283 | /*---- 优惠券列表 -----*/ |
... | ... | @@ -346,8 +347,6 @@ border-bottom: 10rpx solid #eee; |
346 | 347 | .xc-frame{ |
347 | 348 | width: 100%; |
348 | 349 | height:68.9%; |
349 | - margin-top:20rpx; | |
350 | - | |
351 | 350 | } |
352 | 351 | |
353 | 352 | .xc-frame .list-frame{ |
... | ... | @@ -731,8 +730,8 @@ height:42rpx; |
731 | 730 | } |
732 | 731 | .may_use_coupon{ |
733 | 732 | width: 95%; |
734 | - height: 40rpx; | |
735 | - line-height:68rpx; | |
733 | + height: 68rpx; | |
734 | + line-height:78rpx; | |
736 | 735 | margin: auto; |
737 | 736 | } |
738 | 737 | .determine-frame{ |
... | ... | @@ -758,8 +757,64 @@ margin: auto; |
758 | 757 | margin-right:20rpx; |
759 | 758 | } |
760 | 759 | .xc-border{ |
761 | - border-top:5rpx solid #eee; | |
762 | -margin-top:20rpx; | |
760 | + border-top:8rpx solid #eee; | |
763 | 761 | width: 100% |
762 | +} | |
763 | +.main-top{ | |
764 | +margin-top: 20rpx; | |
764 | 765 | |
765 | 766 | } |
767 | +.xc-hookts{ | |
768 | +border: 1rpx solid #999; | |
769 | + | |
770 | +} | |
771 | +.xc-hookts.on{ | |
772 | + width:30rpx; | |
773 | +height:30rpx; | |
774 | + | |
775 | +} | |
776 | +.xc-hookt.sn{ | |
777 | + width: 32rpx; | |
778 | +height: 32rpx; | |
779 | +font-size: 28rpx; | |
780 | +line-height: 34rpx; | |
781 | +} | |
782 | +.xc-hookt{ | |
783 | + transform: rotate(-135deg); | |
784 | +text-align: center; | |
785 | + | |
786 | +} | |
787 | +.main-bottom{ | |
788 | + margin-bottom: 20rpx; | |
789 | + | |
790 | +} | |
791 | +.xc-hookst{ | |
792 | + border: 1rpx solid #999; | |
793 | + | |
794 | +} | |
795 | +.xc-hookst.ons{ | |
796 | + width: 42rpx; | |
797 | +height: 42rpx; | |
798 | +margin-left: 20rpx; | |
799 | + | |
800 | +} | |
801 | +.is_use_coupon{ | |
802 | + width: 65%; | |
803 | +justify-content: flex-end; | |
804 | +padding-top: 10rpx; | |
805 | + | |
806 | + | |
807 | +} | |
808 | +.xc-hooka{ | |
809 | + transform: rotate(-135deg); | |
810 | +text-align: center; | |
811 | + | |
812 | +} | |
813 | +.xc-hooka.sn{ | |
814 | + width: 45rpx; | |
815 | +height: 45rpx; | |
816 | +font-size: 28rpx; | |
817 | +line-height: 44rpx; | |
818 | +margin-left: 20rpx; | |
819 | + | |
820 | +} | |
766 | 821 | \ No newline at end of file | ... | ... |