Commit 119cdeb112537ed2bc33632cd9f4923d5e12ed59

Authored by taiyuan
1 parent 97f2464f

购物车修改

pages/cart/cart/cart.wxml
@@ -114,7 +114,7 @@ @@ -114,7 +114,7 @@
114 114
115 </view> 115 </view>
116 <view class="count"> 116 <view class="count">
117 - <view bindtap="subNum" class="sub fs28" data-pitems="{{pidx}}" data-item="{{idx}}">一</view> 117 + <view bindtap="{{items.goods_num <= 1 ? '':'subNum'}}" class="sub fs28 {{items.goods_num <= 1 ? 'active':''}}" data-pitems="{{pidx}}" data-item="{{idx}}">一</view>
118 <input class="goodadd" bindblur="valueToNum" data-pitems="{{pidx}}" data-item="{{idx}}" 118 <input class="goodadd" bindblur="valueToNum" data-pitems="{{pidx}}" data-item="{{idx}}"
119 bindinput="refresh_input" 119 bindinput="refresh_input"
120 type="number" value="{{items.goods_num}}"></input> 120 type="number" value="{{items.goods_num}}"></input>
pages/cart/cart/cart.wxss
@@ -362,3 +362,8 @@ page { @@ -362,3 +362,8 @@ page {
362 padding: 0; 362 padding: 0;
363 vertical-align: top; 363 vertical-align: top;
364 } 364 }
  365 +
  366 +.sub.active {
  367 + /* background-color: #ddd; */
  368 + color: #ccc;
  369 +}
pages/cart/cart2/cart2.js
@@ -108,14 +108,17 @@ Page({ @@ -108,14 +108,17 @@ Page({
108 order_prom_list_cart:null, 108 order_prom_list_cart:null,
109 109
110 ispt_goods:0, //是否平摊至单品,0要平摊 1不平摊 110 ispt_goods:0, //是否平摊至单品,0要平摊 1不平摊
111 - rank_switch:0, //是不是开同等级卡  
112 - show_card:null, //显示的等级卡  
113 - card_name:'', //显示的卡的名称  
114 - card_cut_price:null,//减价多少钱  
115 -  
116 - show_submit:0, //提交按钮变正常显示  
117 - is_get_offline:1, 111 +
  112 + rank_switch:0, //是不是开同等级卡
  113 + show_card:null, //显示的等级卡
  114 + card_name:'', //显示的卡的名称
  115 + card_cut_price:null,//减价多少钱
  116 +
  117 + show_submit:0, //提交按钮变正常显示
  118 + is_get_offline:1,
118 119
  120 + tabs: ['门店自提','快递邮寄'],
  121 + currentTabIndex: 1,
119 }, 122 },
120 onLoad: function(t) { 123 onLoad: function(t) {
121 wx.setNavigationBarTitle({ title: "填写订单",}) 124 wx.setNavigationBarTitle({ title: "填写订单",})
@@ -3423,7 +3426,17 @@ Page({ @@ -3423,7 +3426,17 @@ Page({
3423 //是不是线下 3426 //是不是线下
3424 var is_get_offline=item.is_offline; 3427 var is_get_offline=item.is_offline;
3425 this.setData({pop_offline_index:index,is_offline_show:1,show_off_price:off_price.toFixed(2),is_get_offline:is_get_offline}); 3428 this.setData({pop_offline_index:index,is_offline_show:1,show_off_price:off_price.toFixed(2),is_get_offline:is_get_offline});
3426 - } 3429 + },
  3430 +
  3431 +
  3432 + clickTab(e) {
  3433 + // console.log(e);
  3434 + let index = e.currentTarget.dataset.index;
  3435 + this.setData({
  3436 + currentTabIndex: index,
  3437 + });
  3438 + this.setexptype_w(e);
  3439 + },
3427 3440
3428 3441
3429 3442
pages/cart/cart2/cart2.wxml
@@ -4,18 +4,30 @@ @@ -4,18 +4,30 @@
4 4
5 <form bindsubmit="submitForm"> 5 <form bindsubmit="submitForm">
6 <view class="container"> 6 <view class="container">
  7 + <view class="tab-container">
  8 + <view class="tab-wrapper">
  9 + <block wx:for="{{tabs}}">
  10 + <view class="tab {{currentTabIndex == index ? 'active':''}}" data-t='{{!index ? 1:0}}' data-ind="0" data-txt='cartlist[0].exp_type' data-wl_txt='cartlist[0].wind' data-index="{{index}}" bindtap="clickTab">{{item}}</view>
  11 + </block>
  12 + </view>
  13 + </view>
7 <!--要进行判断地址是否显示----> 14 <!--要进行判断地址是否显示---->
8 <view bindtap="enterAddressPage" class="user-mes mgt20" hidden='{{(bn_exp_type==1 && is_b_now==1) || (is_all_zt==1 && is_b_now==0)}}'> 15 <view bindtap="enterAddressPage" class="user-mes mgt20" hidden='{{(bn_exp_type==1 && is_b_now==1) || (is_all_zt==1 && is_b_now==0)}}'>
9 <!---默认地址显示------> 16 <!---默认地址显示------>
10 <block wx:if="{{user_addr!=null}}"> 17 <block wx:if="{{user_addr!=null}}">
11 18
12 <view class="user-contact"> 19 <view class="user-contact">
13 - <text>收货人:</text>{{user_addr.consignee}}{{'  '}}{{user_addr.mobile}}</view> 20 + <text class="bold fs36 pdr20">{{user_addr.consignee}}</text>
  21 + <text class="fs28">{{user_addr.mobile}}</text>
  22 + </view>
14 <view class="location"> 23 <view class="location">
15 - <view class="address">{{user_addr.more_address}}{{' '}}{{user_addr.address}}</view>  
16 - <view class="pos-icon">  
17 - <image class="wh100 bdr14" src="{{imgUrl}}/miniapp/images/goodscategory/new_position.png"></image> 24 + <view class="address fs26 pdt20">
  25 + <view class="pos-icon">
  26 + <image class="wh100 bdr14" src="{{imgUrl}}/miniapp/images/goodscategory/new_position.png"></image>
  27 + </view>
  28 + {{user_addr.more_address}}{{' '}}{{user_addr.address}}
18 </view> 29 </view>
  30 +
19 </view> 31 </view>
20 <view class="update-logistics"> 32 <view class="update-logistics">
21 <!-- <image class="arrow-rigth" src="{{imgUrl}}/miniapp/images/new_position.png"></image> --> 33 <!-- <image class="arrow-rigth" src="{{imgUrl}}/miniapp/images/new_position.png"></image> -->
@@ -112,28 +124,31 @@ @@ -112,28 +124,31 @@
112 <icon color="#f23030" size="16" type="info"></icon> 124 <icon color="#f23030" size="16" type="info"></icon>
113 {{order.store_prom}} 125 {{order.store_prom}}
114 </view> 126 </view>
115 - <view class="use-item flex-space-between">  
116 - <view class="flex-vertical">  
117 - <view bindtap='setexptype_w' data-ind="{{pidx}}" data-t='1' data-txt='cartlist[{{pidx}}].exp_type' style="padding-right:26rpx;display:{{item.distr_t==2?'none':'flex;align-items: center'}};"> 127 +
  128 + <view class="use-item flex-space-between" wx:if="{{item.exp_type==0}}">
  129 + <!-- <view class="flex-vertical"> -->
  130 + <!-- <view bindtap='setexptype_w' data-ind="{{pidx}}" data-t='1' data-txt='cartlist[{{pidx}}].exp_type' style="padding-right:26rpx;display:none"> -->
  131 + <!-- <view bindtap='setexptype_w' data-ind="{{pidx}}" data-t='1' data-txt='cartlist[{{pidx}}].exp_type' style="padding-right:26rpx;display:{{item.distr_t==2?'none':'flex;align-items: center'}};"> -->
118 <!-- <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> --> 132 <!-- <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> -->
119 133
120 134
121 135
122 - <block wx:if="{{item.exp_type==1}}"> 136 + <!-- <block wx:if="{{item.exp_type==1}}">
123 <!-- <view class="circle white xc-hookt fs20 red-b sn"><text>Γ</text></view> --> 137 <!-- <view class="circle white xc-hookt fs20 red-b sn"><text>Γ</text></view> -->
124 - <icon data-t='0' data-txt='cartlist[{{pidx}}].exp_type' color="red" size="16" type="success"></icon>  
125 - </block>  
126 - <block wx:else> 138 + <!-- <icon data-t='0' data-txt='cartlist[{{pidx}}].exp_type' color="red" size="16" type="success"></icon> -->
  139 + <!-- </block> -->
  140 + <!-- <block wx:else>
127 <view class="circle xc-hookts on"></view> 141 <view class="circle xc-hookts on"></view>
128 - </block>  
129 - <view bindtap='setexptype_w' data-ind="{{pidx}}" data-t='1' data-txt='cartlist[{{pidx}}].exp_type' class="yu_er">门店自提</view>  
130 - </view> 142 + </block> -->
  143 + <!-- <view bindtap='setexptype_w' data-ind="{{pidx}}" data-t='1' data-txt='cartlist[{{pidx}}].exp_type' class="yu_er">门店自提</view> -->
  144 + <!-- </view> -->
131 145
132 - <view data-t='0' data-txt='cartlist[{{pidx}}].exp_type' data-ind="{{pidx}}" bindtap="setexptype_w" style="display:{{item.distr_t==1?'none':'flex;align-items: center'}};"> 146 + <!-- <view data-t='0' data-txt='cartlist[{{pidx}}].exp_type' data-ind="{{pidx}}" bindtap="setexptype_w" style="display:none;"> -->
  147 + <!-- <view data-t='0' data-txt='cartlist[{{pidx}}].exp_type' data-ind="{{pidx}}" bindtap="setexptype_w" style="display:{{item.distr_t==1?'none':'flex;align-items: center'}};"> -->
133 <!-- <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> --> 148 <!-- <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> -->
134 - <block wx:if="{{item.exp_type==0}}"> 149 + <!-- <block wx:if="{{item.exp_type==0}}">
135 <!-- <view class="circle white xc-hookt fs20 red-b sn"><text>Γ</text></view> --> 150 <!-- <view class="circle white xc-hookt fs20 red-b sn"><text>Γ</text></view> -->
136 - <icon data-t='0' data-txt='cartlist[{{pidx}}].exp_type' color="red" size="16" type="success"></icon> 151 + <!-- <icon data-t='0' data-txt='cartlist[{{pidx}}].exp_type' color="red" size="16" type="success"></icon>
137 </block> 152 </block>
138 <block wx:else> 153 <block wx:else>
139 <view class="circle xc-hookts on"></view> 154 <view class="circle xc-hookts on"></view>
@@ -141,16 +156,24 @@ @@ -141,16 +156,24 @@
141 156
142 <view bindtap='setexptype_w' data-t='0' data-ind="{{pidx}}" data-txt='cartlist[{{pidx}}].exp_type' data-wl_txt='cartlist[{{pidx}}].wind' 157 <view bindtap='setexptype_w' data-t='0' data-ind="{{pidx}}" data-txt='cartlist[{{pidx}}].exp_type' data-wl_txt='cartlist[{{pidx}}].wind'
143 class="yu_er">快递邮寄</view> 158 class="yu_er">快递邮寄</view>
144 - </view> 159 + </view> -->
  160 + <view>配送方式</view>
  161 + <block wx:if="{{item.exp_type==0}}">
  162 + <!-- 点击显示物流选择 -->
  163 + <view class="flex-vertical" bindtap="show_wu_arr" data-txt='cartlist[{{pidx}}].wind' data-w_sele_index="{{pidx}}" style="padding-right:6rpx;">
  164 + <view>{{wu_arr[item.wind].name}}</view>
  165 + <view class="xc-right"></view>
  166 + </view>
  167 + </block>
145 </view> 168 </view>
146 - <block wx:if="{{item.exp_type==0}}"> 169 + <!-- <block wx:if="{{item.exp_type==0}}"> -->
147 <!-- 点击显示物流选择 --> 170 <!-- 点击显示物流选择 -->
148 - <view class="flex-vertical" bindtap="show_wu_arr" data-txt='cartlist[{{pidx}}].wind' data-w_sele_index="{{pidx}}" style="padding-right:6rpx;"> 171 + <!-- <view class="flex-vertical" bindtap="show_wu_arr" data-txt='cartlist[{{pidx}}].wind' data-w_sele_index="{{pidx}}" style="padding-right:6rpx;">
149 <view>{{wu_arr[item.wind].name}}</view> 172 <view>{{wu_arr[item.wind].name}}</view>
150 <view class="xc-right"></view> 173 <view class="xc-right"></view>
151 </view> 174 </view>
152 - </block>  
153 - </view> 175 + </block> -->
  176 + <!-- </view> -->
154 177
155 <!-- <view bindtap="express_name" class="use-item" hidden='{{item.exp_type==1}}'> 178 <!-- <view bindtap="express_name" class="use-item" hidden='{{item.exp_type==1}}'>
156 <view>选择物流:</view> --> 179 <view>选择物流:</view> -->
@@ -321,14 +344,15 @@ @@ -321,14 +344,15 @@
321 344
322 <view class="use-item flex-space-between"> 345 <view class="use-item flex-space-between">
323 <view class="flex"> 346 <view class="flex">
324 - <view bindtap='setexptype' data-t='1' data-txt='cartlist[{{pidx}}].exp_type' style="padding-right:26rpx;display:{{bn_t_exp_t==2?'none':'flex;align-items:center;'}};"> 347 + <!-- <view bindtap='setexptype' data-t='1' data-txt='cartlist[{{pidx}}].exp_type' style="padding-right:26rpx;display:{{bn_t_exp_t==2?'none':'flex;align-items:center;'}};">
325 <icon color="{{bn_exp_type==1?'red':'gray'}}" size="16" type="success"></icon> 348 <icon color="{{bn_exp_type==1?'red':'gray'}}" size="16" type="success"></icon>
326 <view class="yu_er">门店自提</view> 349 <view class="yu_er">门店自提</view>
327 - </view>  
328 - <view bindtap='setexptype' data-t='0' data-txt='cartlist[{{pidx}}].exp_type' style="display:{{bn_t_exp_t==1?'none':'flex;align-items:center;'}};"> 350 + </view> -->
  351 + <!-- <view bindtap='setexptype' data-t='0' data-txt='cartlist[{{pidx}}].exp_type' style="display:{{bn_t_exp_t==1?'none':'flex;align-items:center;'}};">
329 <icon color="{{bn_exp_type==0?'red':'gray'}}" size="16" type="success"></icon> 352 <icon color="{{bn_exp_type==0?'red':'gray'}}" size="16" type="success"></icon>
330 <view class="yu_er">快递邮寄</view> 353 <view class="yu_er">快递邮寄</view>
331 - </view> 354 + </view> -->
  355 + <view>配送方式</view>
332 </view> 356 </view>
333 <block wx:if="{{bn_exp_type==0}}"> 357 <block wx:if="{{bn_exp_type==0}}">
334 <view class="flex-vertical" bindtap="show_wu_arr" data-txt='index'> 358 <view class="flex-vertical" bindtap="show_wu_arr" data-txt='index'>
@@ -406,7 +430,7 @@ @@ -406,7 +430,7 @@
406 430
407 <view class="btn-wrap shadow-1" wx:if="{{show_submit}}"> 431 <view class="btn-wrap shadow-1" wx:if="{{show_submit}}">
408 <view class="pay-amount"> 432 <view class="pay-amount">
409 - <view class="payable">应付金额:<text class="co-red">{{formData.order_amount}}</text></view> 433 + <view class="payable">应付金额:<text class="co-red"><text class="fs24">¥</text>{{formData.order_amount}}</text></view>
410 <!-- <view class="co-red big"></view> --> 434 <!-- <view class="co-red big"></view> -->
411 </view> 435 </view>
412 <button class="tips-btn" formType="submit" id="submitOrder">提交订单</button> 436 <button class="tips-btn" formType="submit" id="submitOrder">提交订单</button>
pages/cart/cart2/cart2.wxss
@@ -20,6 +20,8 @@ @@ -20,6 +20,8 @@
20 } 20 }
21 21
22 22
  23 +
  24 +
23 page { 25 page {
24 /* background-color: #FAFAFA; */ 26 /* background-color: #FAFAFA; */
25 background-color: #F0F0F0; 27 background-color: #F0F0F0;
@@ -31,6 +33,32 @@ page { @@ -31,6 +33,32 @@ page {
31 /* padding-top: 28rpx; */ 33 /* padding-top: 28rpx; */
32 padding-bottom: 120rpx; 34 padding-bottom: 120rpx;
33 } 35 }
  36 +
  37 +.tab-container {
  38 + font-size: 28rpx;
  39 + margin-top: 20rpx;
  40 + display: flex;
  41 +}
  42 +
  43 +.tab-wrapper {
  44 + background-color: #ccc;
  45 + display: flex;
  46 + border-radius: 40rpx;
  47 + overflow: hidden;
  48 +}
  49 +
  50 +.tab {
  51 + padding: 20rpx 30rpx;
  52 +
  53 +}
  54 +
  55 +
  56 +.tab.active {
  57 + background-color: white;
  58 + border-radius: 40rpx;
  59 +}
  60 +
  61 +
34 .user-mes { 62 .user-mes {
35 position: relative; 63 position: relative;
36 background-color: #fff; 64 background-color: #fff;
@@ -38,23 +66,25 @@ page { @@ -38,23 +66,25 @@ page {
38 color: #444; 66 color: #444;
39 /* margin-top: 28rpx; */ 67 /* margin-top: 28rpx; */
40 border-radius: 14rpx; 68 border-radius: 14rpx;
  69 + padding: 20rpx 70rpx 20rpx 20rpx;
41 } 70 }
42 .user-contact { 71 .user-contact {
43 - padding: 24rpx 26rpx;  
44 - font-weight: 600; 72 + /* padding: 24rpx 26rpx;
  73 + font-weight: 600; */
45 } 74 }
46 75
47 .location { 76 .location {
48 position: relative; 77 position: relative;
49 - padding: 0 70rpx 24rpx; 78 + /* padding: 0 70rpx 24rpx; */
50 } 79 }
51 80
52 .pos-icon { 81 .pos-icon {
53 - position: absolute;  
54 - left: 28rpx;  
55 - top: 6rpx;  
56 - width: 30rpx;  
57 - height: 36rpx; 82 + /* position: absolute; */
  83 + /* left: 28rpx;
  84 + top: 6rpx; */
  85 + width: 20rpx;
  86 + height: 24rpx;
  87 + display: inline-block;
58 } 88 }
59 89
60 .border-img { 90 .border-img {
@@ -132,12 +162,12 @@ page { @@ -132,12 +162,12 @@ page {
132 .use-item{ 162 .use-item{
133 display: flex; 163 display: flex;
134 align-items: center; 164 align-items: center;
135 - height: 80rpx; 165 + /* height: 80rpx; */
136 /* border-bottom: 1px solid #ddd; */ 166 /* border-bottom: 1px solid #ddd; */
137 - font-size: 30rpx; 167 + font-size: 26rpx;
138 /* width:95%; 168 /* width:95%;
139 margin:auto; */ 169 margin:auto; */
140 - padding: 0 26rpx; 170 + padding: 20rpx;
141 } 171 }
142 .use-item>view{ 172 .use-item>view{
143 display: flex; 173 display: flex;
@@ -148,9 +178,9 @@ margin:auto; */ @@ -148,9 +178,9 @@ margin:auto; */
148 } 178 }
149 .use-item .dp{ 179 .use-item .dp{
150 display: block; 180 display: block;
151 - width: 50rpx;  
152 - height: 50rpx;  
153 - margin-left: -6rpx; 181 + width: 40rpx;
  182 + height: 40rpx;
  183 + /* margin-left: -6rpx; */
154 } 184 }
155 185
156 .set-item { 186 .set-item {
@@ -182,11 +212,11 @@ margin:auto; */ @@ -182,11 +212,11 @@ margin:auto; */
182 212
183 .coupon-mes { 213 .coupon-mes {
184 /* box-sizing: border-box; */ 214 /* box-sizing: border-box; */
185 - height:95rpx;  
186 - padding: 0 26rpx; 215 + /* height:95rpx; */
  216 + padding: 20rpx;
187 background-color: #fff; 217 background-color: #fff;
188 font-size: 30rpx; 218 font-size: 30rpx;
189 - color: #444; 219 + /* color: #444; */
190 /* width: 100%; */ 220 /* width: 100%; */
191 border-radius: 14rpx; 221 border-radius: 14rpx;
192 margin-top: 20rpx; 222 margin-top: 20rpx;
@@ -225,9 +255,9 @@ margin:auto; */ @@ -225,9 +255,9 @@ margin:auto; */
225 .word-box { 255 .word-box {
226 font-size: 26rpx; 256 font-size: 26rpx;
227 /* width: 600rpx; */ 257 /* width: 600rpx; */
228 - padding: 10rpx; 258 + /* padding: 10rpx;
229 height: 28rpx; 259 height: 28rpx;
230 - line-height: 40rpx; 260 + line-height: 40rpx; */
231 } 261 }
232 262
233 .max-word { 263 .max-word {
@@ -237,7 +267,7 @@ margin:auto; */ @@ -237,7 +267,7 @@ margin:auto; */
237 } 267 }
238 268
239 .information { 269 .information {
240 - padding: 0 26rpx; 270 + /* padding: 20rpx; */
241 background-color: #fff; 271 background-color: #fff;
242 /* margin-bottom: 120rpx; */ 272 /* margin-bottom: 120rpx; */
243 } 273 }
@@ -245,10 +275,11 @@ margin:auto; */ @@ -245,10 +275,11 @@ margin:auto; */
245 .information .item { 275 .information .item {
246 display: flex; 276 display: flex;
247 justify-content: space-between; 277 justify-content: space-between;
248 - height: 60rpx;  
249 - line-height: 60rpx;  
250 - font-size: 26rpx;  
251 - color: #777; 278 + /* height: 60rpx;
  279 + line-height: 60rpx; */
  280 + font-size: 24rpx;
  281 + /* color: #333; */
  282 + padding: 20rpx;
252 } 283 }
253 284
254 .btn-wrap { 285 .btn-wrap {
@@ -364,12 +395,13 @@ margin:auto; */ @@ -364,12 +395,13 @@ margin:auto; */
364 background-color: white; 395 background-color: white;
365 } 396 }
366 .xc-right{ 397 .xc-right{
367 - width:20rpx;  
368 - height:20rpx; 398 + width:12rpx;
  399 + height:12rpx;
369 border-top:2rpx solid #000; 400 border-top:2rpx solid #000;
370 border-right:2rpx solid #000; 401 border-right:2rpx solid #000;
371 transform:rotate(45deg); 402 transform:rotate(45deg);
372 display:inline-block; 403 display:inline-block;
  404 + margin-left: 10rpx;
373 } 405 }
374 406
375 .xc-coupon-frame .work-frame .work{ font-size: 30rpx; line-height: 92rpx; } 407 .xc-coupon-frame .work-frame .work{ font-size: 30rpx; line-height: 92rpx; }
@@ -904,7 +936,7 @@ margin-left: 20rpx; @@ -904,7 +936,7 @@ margin-left: 20rpx;
904 .plus_buy{ 936 .plus_buy{
905 background-color: #fff; 937 background-color: #fff;
906 margin:15rpx 0; 938 margin:15rpx 0;
907 - padding: 20rpx 10rpx; 939 + padding: 20rpx;
908 position: relative; 940 position: relative;
909 } 941 }
910 942