Commit 52bdba26262c29446cfa0c1f73c8b88c90e92e75
1010版本合并
Showing
34 changed files
with
4431 additions
and
1528 deletions
app.js
@@ -9,8 +9,8 @@ App({ | @@ -9,8 +9,8 @@ App({ | ||
9 | setting: t, | 9 | setting: t, |
10 | wechatUser: null, | 10 | wechatUser: null, |
11 | userInfo: null, | 11 | userInfo: null, |
12 | - config: null, | ||
13 | - config2: null, | 12 | + config: null, //门店参数 |
13 | + config2: null, //门店配置 | ||
14 | code: null, | 14 | code: null, |
15 | heigth:0, | 15 | heigth:0, |
16 | user_id: null,// 4379287,// null,// 5682068, | 16 | user_id: null,// 4379287,// null,// 5682068, |
@@ -48,7 +48,6 @@ App({ | @@ -48,7 +48,6 @@ App({ | ||
48 | app.globalData.user_id= app.globalData.userInfo.user_id; | 48 | app.globalData.user_id= app.globalData.userInfo.user_id; |
49 | } | 49 | } |
50 | } | 50 | } |
51 | - | ||
52 | }, | 51 | }, |
53 | 52 | ||
54 | //---初始化第三方---- | 53 | //---初始化第三方---- |
@@ -59,6 +58,8 @@ App({ | @@ -59,6 +58,8 @@ App({ | ||
59 | var t = wx.getExtConfigSync(), o = this.globalData.setting; | 58 | var t = wx.getExtConfigSync(), o = this.globalData.setting; |
60 | console.log(t); | 59 | console.log(t); |
61 | t.appName ? (o.appName = t.appName, o.stoid = t.stoid) : tt=1; | 60 | t.appName ? (o.appName = t.appName, o.stoid = t.stoid) : tt=1; |
61 | + | ||
62 | + | ||
62 | }, | 63 | }, |
63 | 64 | ||
64 | //首页的第一次登录 | 65 | //首页的第一次登录 |
@@ -110,7 +111,7 @@ App({ | @@ -110,7 +111,7 @@ App({ | ||
110 | success: function (o) { | 111 | success: function (o) { |
111 | console.log('getConfig2'); | 112 | console.log('getConfig2'); |
112 | if (o.data.code == 0) { | 113 | if (o.data.code == 0) { |
113 | - e.globalData.config = o.data.data, "function" == typeof t && t(e.globalData.config); | 114 | + e.globalData.config2 = o.data.data, "function" == typeof t && t(e.globalData.config2); |
114 | } | 115 | } |
115 | } | 116 | } |
116 | }); | 117 | }); |
@@ -325,6 +326,27 @@ App({ | @@ -325,6 +326,27 @@ App({ | ||
325 | }else{ | 326 | }else{ |
326 | func(this.globalData.pk_store); | 327 | func(this.globalData.pk_store); |
327 | } | 328 | } |
328 | - } | 329 | + }, |
330 | + | ||
331 | + //-------获取购物车数量---------- | ||
332 | + requestCardNum: function() { | ||
333 | + var th = this; | ||
334 | + th.request.get("/api/weshop/cart/page", { | ||
335 | + data: { | ||
336 | + store_id: th.globalData.setting.stoid, | ||
337 | + user_id: th.globalData.user_id, | ||
338 | + }, | ||
339 | + success: function(e) { | ||
340 | + var num = 0; | ||
341 | + for (var i = 0; i < e.data.data.pageData.length; i++) { | ||
342 | + num += e.data.data.pageData[i].goods_num; | ||
343 | + } | ||
344 | + wx.setTabBarBadge({ //tabbar右上角添加文本 | ||
345 | + index: 2, ////tabbar下标 | ||
346 | + text: '' + num //显示的内容 | ||
347 | + }); | ||
348 | + } | ||
349 | + }); | ||
350 | + }, | ||
329 | 351 | ||
330 | }); | 352 | }); |
app.json
@@ -68,7 +68,8 @@ | @@ -68,7 +68,8 @@ | ||
68 | "pages/user/user_spsy/user_spsy", | 68 | "pages/user/user_spsy/user_spsy", |
69 | "pages/user/user_fw/user_fw", | 69 | "pages/user/user_fw/user_fw", |
70 | "pages/user/user_coupon/user_coupon", | 70 | "pages/user/user_coupon/user_coupon", |
71 | - "pages/user/grow_value/grow_value" | 71 | + "pages/user/grow_value/grow_value", |
72 | + "pages/payment/pay_success/pay_success" | ||
72 | 73 | ||
73 | ], | 74 | ], |
74 | "permission": { | 75 | "permission": { |
app.wxss
@@ -220,7 +220,7 @@ justify-content:space-around; | @@ -220,7 +220,7 @@ justify-content:space-around; | ||
220 | border-right: 2rpx solid ; | 220 | border-right: 2rpx solid ; |
221 | transform: rotate(45deg); | 221 | transform: rotate(45deg); |
222 | display:inline-block; | 222 | display:inline-block; |
223 | - width:18rpx;height:18rpx;border-color:#da0b31;margin-top:6rpx; | 223 | + width:18rpx;height:18rpx;border-color:#da0b31; |
224 | 224 | ||
225 | } | 225 | } |
226 | /*********************** 7.15 */ | 226 | /*********************** 7.15 */ |
@@ -372,8 +372,9 @@ background: #ffe3e2; | @@ -372,8 +372,9 @@ background: #ffe3e2; | ||
372 | .fs40 { | 372 | .fs40 { |
373 | font-size: 40rpx; | 373 | font-size: 40rpx; |
374 | } | 374 | } |
375 | - | ||
376 | .ai_end{ | 375 | .ai_end{ |
377 | align-items: flex-end; | 376 | align-items: flex-end; |
378 | } | 377 | } |
379 | - | 378 | +.flex-wrap{ |
379 | + flex-wrap:wrap; | ||
380 | +} | ||
380 | \ No newline at end of file | 381 | \ No newline at end of file |
components/qr_code/qr_code.js
@@ -37,7 +37,9 @@ Component({ | @@ -37,7 +37,9 @@ Component({ | ||
37 | barcode('barcode'+this.data.index,val, 620, 160,this); | 37 | barcode('barcode'+this.data.index,val, 620, 160,this); |
38 | qrcode('qrcode'+this.data.index, val, 520, 520,this); | 38 | qrcode('qrcode'+this.data.index, val, 520, 520,this); |
39 | } | 39 | } |
40 | - } | 40 | + }, |
41 | + | ||
42 | + | ||
41 | 43 | ||
42 | 44 | ||
43 | }) | 45 | }) |
44 | \ No newline at end of file | 46 | \ No newline at end of file |
components/qr_code/qr_code.wxml
1 | + | ||
1 | <view class="xc-pop-up" wx:if="{{q_show}}"> | 2 | <view class="xc-pop-up" wx:if="{{q_show}}"> |
2 | - <view class="xc-obscuration" bindtap='close'></view> | 3 | +<!-- <scroll-view scroll-y="false" style=" height: 100%;"> --> |
4 | + <view class="xc-obscuration" bindtap='close' catchtouchmove="ture"></view> | ||
3 | <view> | 5 | <view> |
4 | <view class="xc-qr-frame"> | 6 | <view class="xc-qr-frame"> |
7 | + | ||
5 | <view class="barqrcode"> | 8 | <view class="barqrcode"> |
6 | <view class="barcode" wx:if="{{!is_fw}}"> | 9 | <view class="barcode" wx:if="{{!is_fw}}"> |
7 | - <canvas canvas-id="barcode{{item.index}}" wx:for="{{barcode_canvas}}" /> | 10 | + <canvas canvas-id="barcode{{item.index}}" wx:for="{{barcode_canvas}}" /> |
8 | <view class="q_code">{{object.val}}</view> | 11 | <view class="q_code">{{object.val}}</view> |
9 | </view> | 12 | </view> |
10 | <view class="qrcode_rim {{is_fw==1?'mt':''}}"> | 13 | <view class="qrcode_rim {{is_fw==1?'mt':''}}"> |
11 | - <canvas class="qrcode" canvas-id="qrcode{{item.index}}" wx:for="{{barcode_canvas}}" /> | 14 | + <canvas class="qrcode" canvas-id="qrcode{{item.index}}" wx:for="{{barcode_canvas}}" /> |
12 | <view class="r-code">{{object.content}}</view> | 15 | <view class="r-code">{{object.content}}</view> |
13 | <view class="r-code flex" wx:if="{{object.is_quan}}">有效时间:{{object.now}} 至 <view>{{object.validay}}</view></view> | 16 | <view class="r-code flex" wx:if="{{object.is_quan}}">有效时间:{{object.now}} 至 <view>{{object.validay}}</view></view> |
14 | <block wx:if="{{object.is_quan}}"> | 17 | <block wx:if="{{object.is_quan}}"> |
@@ -18,7 +21,9 @@ | @@ -18,7 +21,9 @@ | ||
18 | <view></view> | 21 | <view></view> |
19 | </view> | 22 | </view> |
20 | </view> | 23 | </view> |
24 | + | ||
21 | </view> | 25 | </view> |
22 | <view class="shut" bindtap="close">ⅹ</view> | 26 | <view class="shut" bindtap="close">ⅹ</view> |
23 | </view> | 27 | </view> |
28 | +<!-- </scroll-view> --> | ||
24 | </view> | 29 | </view> |
25 | \ No newline at end of file | 30 | \ No newline at end of file |
components/qr_code/qr_code.wxss
@@ -6,7 +6,11 @@ | @@ -6,7 +6,11 @@ | ||
6 | display:flex; | 6 | display:flex; |
7 | justify-content:center; | 7 | justify-content:center; |
8 | align-items:center; | 8 | align-items:center; |
9 | + | ||
9 | } | 10 | } |
11 | +/* page{ | ||
12 | + overflow-y: hidden; | ||
13 | +} */ | ||
10 | 14 | ||
11 | .xc-obscuration{ | 15 | .xc-obscuration{ |
12 | position: fixed; | 16 | position: fixed; |
@@ -33,28 +37,36 @@ align-items:center; | @@ -33,28 +37,36 @@ align-items:center; | ||
33 | height: auto; | 37 | height: auto; |
34 | padding-bottom:20rpx; | 38 | padding-bottom:20rpx; |
35 | left:35rpx; | 39 | left:35rpx; |
40 | + overflow: hidden; | ||
41 | + | ||
42 | + | ||
36 | 43 | ||
37 | } | 44 | } |
38 | 45 | ||
39 | /* 二维码和条形码的边框 */ | 46 | /* 二维码和条形码的边框 */ |
40 | .barqrcode{ | 47 | .barqrcode{ |
41 | width: 100%; | 48 | width: 100%; |
42 | - height: auto; | 49 | + height: 100%; |
43 | margin-top:30rpx; | 50 | margin-top:30rpx; |
51 | +position: relative; | ||
52 | +top: 0rpx; | ||
53 | +left: 0rpx; | ||
44 | 54 | ||
45 | } | 55 | } |
46 | /* 点击条形 */ | 56 | /* 点击条形 */ |
47 | .barcode { | 57 | .barcode { |
48 | height:150rpx; | 58 | height:150rpx; |
49 | width: 620rpx; | 59 | width: 620rpx; |
50 | - padding-left:30rpx; | 60 | + |
51 | text-align:center; | 61 | text-align:center; |
62 | + position:absolute; | ||
63 | + left: 30rpx | ||
52 | } | 64 | } |
53 | canvas{ | 65 | canvas{ |
54 | width:100%; | 66 | width:100%; |
55 | height:55px; | 67 | height:55px; |
56 | display:block; | 68 | display:block; |
57 | -position:relative; | 69 | + |
58 | } | 70 | } |
59 | .q_code{ | 71 | .q_code{ |
60 | font-size:28rpx; | 72 | font-size:28rpx; |
@@ -66,10 +78,13 @@ letter-spacing:6rpx; | @@ -66,10 +78,13 @@ letter-spacing:6rpx; | ||
66 | /* 二维码边框*/ | 78 | /* 二维码边框*/ |
67 | .qrcode_rim { | 79 | .qrcode_rim { |
68 | width: 550rpx; | 80 | width: 550rpx; |
69 | - height:580rpx; | 81 | + height:520rpx; |
70 | display:flex; | 82 | display:flex; |
71 | flex-direction:column; | 83 | flex-direction:column; |
72 | -margin-left:74rpx; | 84 | + |
85 | +position: absolute; | ||
86 | +left: 74rpx; | ||
87 | +top: 130rpx; | ||
73 | 88 | ||
74 | 89 | ||
75 | } | 90 | } |
@@ -82,7 +97,8 @@ margin-left:74rpx; | @@ -82,7 +97,8 @@ margin-left:74rpx; | ||
82 | } | 97 | } |
83 | .r-code{ | 98 | .r-code{ |
84 | font-size:28rpx; | 99 | font-size:28rpx; |
85 | - text-align: center | 100 | + padding-left: 25rpx; |
101 | + | ||
86 | } | 102 | } |
87 | 103 | ||
88 | .shut{ | 104 | .shut{ |
pages/cart/cart/cart.js
1 | -var t = getApp(), a = t.request, oo = t.globalData.setting, app = getApp(), rq = t.request; | 1 | +var t = getApp(), |
2 | + a = t.request, | ||
3 | + oo = t.globalData.setting, | ||
4 | + app = getApp(), | ||
5 | + rq = t.request; | ||
2 | var regeneratorRuntime = require('../../../utils/runtime.js'); | 6 | var regeneratorRuntime = require('../../../utils/runtime.js'); |
3 | 7 | ||
4 | Page({ | 8 | Page({ |
5 | - data: { | ||
6 | - url: t.globalData.setting.url, | ||
7 | - resourceUrl: t.globalData.setting.resourceUrl, | ||
8 | - requestData: null, | ||
9 | - checkAllToggle: 0, | ||
10 | - total_fee:0, | ||
11 | - allsto:null, | ||
12 | - imgUrl:t.globalData.setting.imghost, | ||
13 | - }, | ||
14 | - onLoad: function() { | ||
15 | - | ||
16 | - wx.setNavigationBarTitle({ title: "购物车",}) | ||
17 | - | ||
18 | - var a = this; | ||
19 | - t.auth.hadAuth() && t.getUserInfo(function() { | ||
20 | - a.getCardList(); | 9 | + data: { |
10 | + url: t.globalData.setting.url, | ||
11 | + resourceUrl: t.globalData.setting.resourceUrl, | ||
12 | + iurl: t.globalData.setting.imghost, | ||
13 | + requestData: null, | ||
14 | + checkAllToggle: 0, | ||
15 | + total_fee: 0, //结算金额 | ||
16 | + total_num: 0, //结算数量 | ||
17 | + all_num: 0, //购物车中所有商品数量 | ||
18 | + allsto: null, | ||
19 | + imgUrl: t.globalData.setting.imghost, | ||
20 | + is_has_flash: 0, //是否又秒杀活动 | ||
21 | + is_edit: 0, //是否编辑 | ||
22 | + is_load: 0, //是否已加载 | ||
23 | + up_dating: 0, //更新中 | ||
24 | + isreduce: 0, //商品数量是否可减 | ||
25 | + isadd: 0, //是否可以加商品数量 | ||
26 | + }, | ||
27 | + | ||
28 | + onLoad: function() { | ||
29 | + wx.setNavigationBarTitle({ | ||
30 | + title: "购物车", | ||
31 | + }) | ||
32 | + var a = this; | ||
33 | + //判断是否有登陆 | ||
34 | + t.auth.hadAuth() && t.getUserInfo(function() { | ||
35 | + a.getCardList(); | ||
36 | + }); | ||
37 | + }, | ||
38 | + onShow: function() { | ||
39 | + var th = this; | ||
40 | + this.getCardList(); | ||
41 | + if(getApp().globalData.user_id) getApp().requestCardNum(); | ||
42 | + //--获取是否又秒杀活动-- | ||
43 | + getApp().request.promiseGet("/api/ms/flash_sale/spikepage", { | ||
44 | + data: { | ||
45 | + store_id: oo.stoid, | ||
46 | + timetype: 2, | ||
47 | + is_end: 0, | ||
48 | + is_show: 1, | ||
49 | + pageSize: 1 | ||
50 | + }, | ||
51 | + }).then(res => { | ||
52 | + if (res.data.code == 0 && res.data.data && res.data.data.pageData.length > 0) { | ||
53 | + th.setData({ | ||
54 | + is_has_flash: 1 | ||
55 | + }) | ||
56 | + } | ||
57 | + }); | ||
58 | + | ||
59 | + }, | ||
60 | + | ||
61 | + //-------------获取购物车列表,要安装门店进行分类订单----------- | ||
62 | + getCardList: function() { | ||
63 | + var th = this; | ||
64 | + //如果门店还未读出来的时候 | ||
65 | + if (th.data.allsto == null) { | ||
66 | + //读取门店 | ||
67 | + app.get_allsto(function(e) { | ||
68 | + th.setData({ | ||
69 | + allsto: e | ||
21 | }); | 70 | }); |
22 | - }, | ||
23 | - onShow: function() { | ||
24 | - this.getCardList(); | ||
25 | - }, | ||
26 | - | ||
27 | - //-------------获取购物车列表,要安装门店进行分类订单----------- | ||
28 | - getCardList: function () { | ||
29 | - var th = this; | ||
30 | - //如果门店还未读出来的时候 | ||
31 | - if (th.data.allsto==null){ | ||
32 | - //读取门店 | ||
33 | - app.get_allsto(function(e){ | ||
34 | - th.setData({ allsto: e}); | ||
35 | - th.get_cart(); | ||
36 | - }) | ||
37 | - }else{ th.get_cart();} | 71 | + th.get_cart(); |
72 | + }) | ||
73 | + } else { | ||
74 | + th.get_cart(); | ||
75 | + } | ||
38 | }, | 76 | }, |
39 | //-----真的获取购物车-------- | 77 | //-----真的获取购物车-------- |
40 | - get_cart:function(){ | ||
41 | - var th=this; | 78 | + get_cart: function() { |
79 | + var th = this; | ||
42 | var rd = Math.random().toString(36).substr(2, 15); | 80 | var rd = Math.random().toString(36).substr(2, 15); |
43 | getApp().request.get("/api/weshop/cart/list", { | 81 | getApp().request.get("/api/weshop/cart/list", { |
44 | data: { | 82 | data: { |
45 | - user_id: app.globalData.user_id, rd: rd, | ||
46 | - store_id: oo.stoid,pageSize:600}, | ||
47 | - success: function (su) { | ||
48 | - console.log("333"); | ||
49 | - console.log(th.data.allsto); | ||
50 | - | 83 | + user_id: app.globalData.user_id, |
84 | + rd: rd, | ||
85 | + store_id: oo.stoid, | ||
86 | + pageSize: 600 | ||
87 | + }, | ||
88 | + success: function(su) { | ||
51 | //按门店分类的数组 | 89 | //按门店分类的数组 |
52 | - var arr = new Array(); | ||
53 | - var carr = su.data.data.pageData; | 90 | + var arr = new Array(), |
91 | + carr = su.data.data.pageData; | ||
92 | + var all_num = 0; | ||
93 | + | ||
54 | for (var i = 0; i < carr.length; i++) { | 94 | for (var i = 0; i < carr.length; i++) { |
55 | var item = carr[i]; | 95 | var item = carr[i]; |
96 | + all_num += item.goods_num; | ||
56 | item.original_img = oo.imghost + item.original_img; | 97 | item.original_img = oo.imghost + item.original_img; |
98 | + item.selected = 0; | ||
57 | 99 | ||
58 | - item.selected=0; | ||
59 | - | ||
60 | var pcid = item.pick_id; | 100 | var pcid = item.pick_id; |
61 | var find = 0; | 101 | var find = 0; |
62 | //---------循环查找门店--- | 102 | //---------循环查找门店--- |
63 | - if (arr.length>0){ | ||
64 | - for (var j = 0; j < arr.length; j++) { | ||
65 | - if (arr[j].pid == pcid) { | ||
66 | - arr[j].goods.push(item); | ||
67 | - find = 1; | ||
68 | - break; | ||
69 | - } | 103 | + if (arr.length > 0) { |
104 | + for (var j = 0; j < arr.length; j++) { | ||
105 | + if (arr[j].pid == pcid) { | ||
106 | + arr[j].goods.push(item); | ||
107 | + find = 1; | ||
108 | + break; | ||
70 | } | 109 | } |
110 | + } | ||
71 | } | 111 | } |
72 | 112 | ||
73 | //------如果没有找到----- | 113 | //------如果没有找到----- |
74 | if (find == 0) { | 114 | if (find == 0) { |
75 | var pikname = ''; | 115 | var pikname = ''; |
76 | //找到门店名称 | 116 | //找到门店名称 |
77 | - for (var k=0;k<th.data.allsto.length;k++){ | ||
78 | - if (pcid == th.data.allsto[k].pickup_id){ | ||
79 | - pikname = th.data.allsto[k].pickup_name;break; | 117 | + for (var k = 0; k < th.data.allsto.length; k++) { |
118 | + if (pcid == th.data.allsto[k].pickup_id) { | ||
119 | + pikname = th.data.allsto[k].pickup_name; | ||
120 | + break; | ||
80 | } | 121 | } |
81 | } | 122 | } |
82 | - var narr = new Array(); narr.push(item); | ||
83 | - var ie = { pid: pcid, pname: pikname, goods: narr,selected:0}; | 123 | + var narr = new Array(); |
124 | + narr.push(item); | ||
125 | + var ie = { | ||
126 | + pid: pcid, | ||
127 | + pname: pikname, | ||
128 | + goods: narr, | ||
129 | + selected: 0 | ||
130 | + }; | ||
84 | arr.push(ie); | 131 | arr.push(ie); |
85 | } | 132 | } |
86 | } | 133 | } |
@@ -90,478 +137,654 @@ Page({ | @@ -90,478 +137,654 @@ Page({ | ||
90 | 137 | ||
91 | th.setData({ | 138 | th.setData({ |
92 | requestData: arr, | 139 | requestData: arr, |
93 | - }), | ||
94 | - th.doCheckAll(), wx.stopPullDownRefresh(); | 140 | + all_num: all_num, |
141 | + is_load: 1, | ||
142 | + is_edit: 0 | ||
143 | + }), | ||
144 | + th.doCheckAll(), wx.stopPullDownRefresh(); | ||
95 | } | 145 | } |
96 | }); | 146 | }); |
97 | }, | 147 | }, |
98 | //删除商品 | 148 | //删除商品 |
99 | delete_th_item: function(t) { | 149 | delete_th_item: function(t) { |
100 | - var e = this; | ||
101 | - var a=rq; | ||
102 | - console.log(a); | ||
103 | - wx.showModal({ | ||
104 | - title: "确定删除", | ||
105 | - success: function(s) { | ||
106 | - if (s.confirm) { | ||
107 | - var r =t.currentTarget.dataset.cartid; | ||
108 | - var url = '/api/weshop/cart/del/'+oo.stoid+'/'+r; | ||
109 | - a.delete(url, { | ||
110 | - success: function(t) { | ||
111 | - e.getCardList(); | ||
112 | - } | ||
113 | - }); | ||
114 | - } | 150 | + var e = this; |
151 | + var a = rq; | ||
152 | + console.log(a); | ||
153 | + wx.showModal({ | ||
154 | + title: "确定删除?", | ||
155 | + success: function(s) { | ||
156 | + if (s.confirm) { | ||
157 | + var r = t.currentTarget.dataset.cartid; | ||
158 | + var url = '/api/weshop/cart/del/' + oo.stoid + '/' + r; | ||
159 | + a.delete(url, { | ||
160 | + success: function(t) { | ||
161 | + e.getCardList(); | ||
115 | } | 162 | } |
116 | - }); | ||
117 | - }, | ||
118 | - | ||
119 | - //-----------------点击输入修改商品数量--------------- | ||
120 | - valueToNum: function(t) { | ||
121 | - var a = t.currentTarget.dataset.item; | ||
122 | - var b = t.currentTarget.dataset.pitems; | ||
123 | - a = this.data.requestData[b].goods[a]; | ||
124 | - var e=a; | ||
125 | - if (a = isNaN(t.detail.value) || t.detail.value < 1 ? 1 : parseInt(t.detail.value)) { | ||
126 | - var s = { | ||
127 | - goods_num: a, | ||
128 | - goods_id:e.goods_id, | ||
129 | - id: e.id, | ||
130 | - store_id:oo.stoid | ||
131 | - }; | ||
132 | - this.postCardList(s, t.currentTarget.dataset.item, t.currentTarget.dataset.pitems); | ||
133 | - } | ||
134 | - }, | ||
135 | - | ||
136 | - //-------------加数量--------------------- | ||
137 | - addNum: function(t) { | ||
138 | - var a = t.currentTarget.dataset.item; | ||
139 | - var b = t.currentTarget.dataset.pitems; | ||
140 | - a = this.data.requestData[b].goods[a]; | ||
141 | - | ||
142 | - if (!(a.goods_num >= a.store_count)) { | ||
143 | - var e = { | ||
144 | - goods_num: a.goods_num + 1, | ||
145 | - id: a.id, | ||
146 | - goods_id:a.goods_id, | ||
147 | - store_id:oo.stoid | ||
148 | - }; | ||
149 | - this.postCardList(e, t.currentTarget.dataset.item, t.currentTarget.dataset.pitems); | ||
150 | - } | ||
151 | - }, | ||
152 | - //-------------减数量--------------------- | ||
153 | - subNum: function(t) { | ||
154 | - var a = t.currentTarget.dataset.item; | ||
155 | - var b = t.currentTarget.dataset.pitems; | ||
156 | - a = this.data.requestData[b].goods[a]; | ||
157 | - | ||
158 | - if(a.goods_num - 1<0) return false; | ||
159 | - | ||
160 | - if (1 != a.goods_num) { | ||
161 | - var e = { | ||
162 | - goods_num: a.goods_num - 1, | ||
163 | - id: a.id, | ||
164 | - goods_id: a.goods_id, | ||
165 | - store_id:oo.stoid | ||
166 | - }; | ||
167 | - this.postCardList(e, t.currentTarget.dataset.item, t.currentTarget.dataset.pitems); | 163 | + }); |
168 | } | 164 | } |
169 | - }, | ||
170 | - //---------------全选,全选的时候要判断是否门店的匹配方式一致-------------- | ||
171 | - checkAll: function() { | ||
172 | - var e = this, dda = e.data.requestData, tfeel = 0,text_arr=""; | ||
173 | - for (var i = 0; i < dda.length; i++) { | ||
174 | - var item=dda[i].goods; | ||
175 | - if (!e.data.checkAllToggle){ | ||
176 | - var txt = "requestData[" +i+ "].selected"; | ||
177 | - e.setData({ [txt]:0,}); | 165 | + } |
166 | + }); | ||
167 | + }, | ||
168 | + | ||
169 | + //-----------------点击输入修改商品数量--------------- | ||
170 | + valueToNum: function(t) { | ||
171 | + var a = t.currentTarget.dataset.item; | ||
172 | + var b = t.currentTarget.dataset.pitems; | ||
173 | + a = this.data.requestData[b].goods[a]; | ||
174 | + var e = a; | ||
175 | + if (a = isNaN(t.detail.value) || t.detail.value < 1 ? 1 : parseInt(t.detail.value)) { | ||
176 | + var s = { | ||
177 | + goods_num: a, | ||
178 | + goods_id: e.goods_id, | ||
179 | + id: e.id, | ||
180 | + store_id: oo.stoid | ||
181 | + }; | ||
182 | + this.postCardList(s, t.currentTarget.dataset.item, t.currentTarget.dataset.pitems); | ||
183 | + } | ||
184 | + }, | ||
185 | + | ||
186 | + //-------------加数量--------------------- | ||
187 | + addNum: function(t) { | ||
188 | + if (this.data.up_dating == 1) return false; | ||
189 | + this.data.up_dating = 1; | ||
190 | + | ||
191 | + var a = t.currentTarget.dataset.item; | ||
192 | + var b = t.currentTarget.dataset.pitems; | ||
193 | + a = this.data.requestData[b].goods[a]; | ||
194 | + | ||
195 | + if (a.goods_num<a.store_count) { | ||
196 | + var e = { | ||
197 | + goods_num: a.goods_num + 1, | ||
198 | + id: a.id, | ||
199 | + goods_id: a.goods_id, | ||
200 | + store_id: oo.stoid | ||
201 | + }; | ||
202 | + isShowLoading: 0; | ||
203 | + this.postCardList(e, t.currentTarget.dataset.item, t.currentTarget.dataset.pitems); | ||
204 | + } else { | ||
205 | + wx.showModal({ | ||
206 | + title: '提示', | ||
207 | + content: '购买的数量不能超出库存数量', | ||
208 | + }); | ||
209 | + this.data.up_dating = 0; | ||
210 | + } | ||
211 | + }, | ||
212 | + //-------------减数量--------------------- | ||
213 | + subNum: function(t) { | ||
214 | + var a = t.currentTarget.dataset.item; | ||
215 | + var b = t.currentTarget.dataset.pitems; | ||
216 | + a = this.data.requestData[b].goods[a]; | ||
217 | + | ||
218 | + if (a.goods_num - 1 < 0) return false; | ||
219 | + | ||
220 | + if (1 != a.goods_num) { | ||
221 | + var e = { | ||
222 | + goods_num: a.goods_num - 1, | ||
223 | + id: a.id, | ||
224 | + goods_id: a.goods_id, | ||
225 | + store_id: oo.stoid | ||
226 | + }; | ||
227 | + this.postCardList(e, t.currentTarget.dataset.item, t.currentTarget.dataset.pitems); | ||
228 | + } | ||
229 | + }, | ||
230 | + //---------------全选,全选的时候要判断是否门店的匹配方式一致-------------- | ||
231 | + checkAll: function() { | ||
232 | + var e = this, | ||
233 | + dda = e.data.requestData, | ||
234 | + tfeel = 0, | ||
235 | + t_num = 0, | ||
236 | + text_arr = ""; | ||
237 | + for (var i = 0; i < dda.length; i++) { | ||
238 | + var item = dda[i].goods; | ||
239 | + if (!e.data.checkAllToggle) { | ||
240 | + var txt = "requestData[" + i + "].selected"; | ||
241 | + e.setData({ | ||
242 | + [txt]: 0, | ||
243 | + }); | ||
244 | + } | ||
245 | + var fir = 0; | ||
246 | + for (var j = 0; j < item.length; j++) { | ||
247 | + if (fir == 0) { | ||
248 | + fir = item[j].distr_type; | ||
249 | + } else { | ||
250 | + //如果同一门店有不同门店的商品,不能同一配送 | ||
251 | + if (fir != item[j].distr_type && !e.data.checkAllToggle && item[j].distr_type != 0) { | ||
252 | + text_arr += item[j].goods_name + " "; | ||
253 | + break; | ||
254 | + } | ||
178 | } | 255 | } |
179 | - var fir=0; | ||
180 | - for(var j=0;j<item.length;j++){ | ||
181 | - if (fir == 0) {fir=item[j].distr_type;} | ||
182 | - else{ | ||
183 | - //如果同一门店有不同门店的商品,不能同一配送 | ||
184 | - if (fir != item[j].distr_type && !e.data.checkAllToggle && item[j].distr_type!=0 ){ | ||
185 | - text_arr+=item[j].goods_name+" "; break; | ||
186 | - } | ||
187 | - } | ||
188 | - var txt = "requestData[" + i + "].goods["+j+"].selected" | ||
189 | - e.setData({ | ||
190 | - [txt]: !e.data.checkAllToggle, | ||
191 | - }) | ||
192 | - if (!e.data.checkAllToggle) | ||
193 | - tfeel += item[j].goods_num * item[j].goods_price; | 256 | + var txt = "requestData[" + i + "].goods[" + j + "].selected" |
257 | + e.setData({ | ||
258 | + [txt]: !e.data.checkAllToggle, | ||
259 | + }) | ||
260 | + if (!e.data.checkAllToggle) { | ||
261 | + tfeel += item[j].goods_num * item[j].goods_price; | ||
262 | + t_num += item[j].goods_num; | ||
194 | } | 263 | } |
195 | } | 264 | } |
265 | + } | ||
196 | 266 | ||
197 | - if (text_arr!=""){ | ||
198 | - wx.showModal({ title: '提示', content: text_arr+'不能与门店中其他商品一起结算,配送方式不一致' }); return false; | ||
199 | - e.setData({ | ||
200 | - total_fee: tfeel.toFixed(2), | ||
201 | - }); | ||
202 | - }else{ | ||
203 | - e.setData({ | ||
204 | - checkAllToggle: !e.data.checkAllToggle, | ||
205 | - total_fee: tfeel.toFixed(2), | ||
206 | - }); | ||
207 | - } | ||
208 | - }, | ||
209 | - | ||
210 | - //------门店全选按钮,要判断是否门店的匹配方式一致--------- | ||
211 | - check_th_all_item:function(ele){ | ||
212 | - var e=this,pitems = ele.currentTarget.dataset.pitems,item = this.data.requestData[pitems].goods; | ||
213 | - var sele = this.data.requestData[pitems].selected; | ||
214 | - | ||
215 | - var isok = 1, fir = 0, iarr = item; | ||
216 | - if (!sele && item.length > 0 ){ | ||
217 | - | ||
218 | - console.log(item); | ||
219 | - for (var i = 0; i < iarr.length; i++) { | ||
220 | - if (iarr[i].distr_type != 0) { | ||
221 | - if (fir == 0) { fir = iarr[i].distr_type; } | ||
222 | - else { | ||
223 | - if (fir != iarr[i].distr_type && iarr[i].distr_type!=0 ) { isok = 0; break; } | 267 | + if (text_arr != "") { |
268 | + wx.showModal({ | ||
269 | + title: '提示', | ||
270 | + content: text_arr + '不能与门店中其他商品一起结算,配送方式不一致' | ||
271 | + }); | ||
272 | + return false; | ||
273 | + } else { | ||
274 | + e.setData({ | ||
275 | + checkAllToggle: !e.data.checkAllToggle, | ||
276 | + total_fee: tfeel.toFixed(2), | ||
277 | + total_num: t_num, | ||
278 | + }); | ||
279 | + } | ||
280 | + }, | ||
281 | + | ||
282 | + //------门店全选按钮,要判断是否门店的匹配方式一致--------- | ||
283 | + check_th_all_item: function(ele) { | ||
284 | + var e = this, | ||
285 | + pitems = ele.currentTarget.dataset.pitems, | ||
286 | + item = this.data.requestData[pitems].goods, | ||
287 | + sele = this.data.requestData[pitems].selected; | ||
288 | + | ||
289 | + var isok = 1, | ||
290 | + fir = 0, | ||
291 | + iarr = item; | ||
292 | + if (!sele && item.length > 0) { | ||
293 | + for (var i = 0; i < iarr.length; i++) { | ||
294 | + if (iarr[i].distr_type != 0) { | ||
295 | + if (fir == 0) { | ||
296 | + fir = iarr[i].distr_type; | ||
297 | + } else { | ||
298 | + if (fir != iarr[i].distr_type && iarr[i].distr_type != 0) { | ||
299 | + isok = 0; | ||
300 | + break; | ||
224 | } | 301 | } |
225 | } | 302 | } |
226 | } | 303 | } |
227 | - } | 304 | + } |
305 | + } | ||
228 | 306 | ||
229 | - if (!isok) { | ||
230 | - wx.showModal({ title: '提示', content: '同一门店自提和物流的商品不能同时结算' }); return false; | ||
231 | - } | 307 | + if (!isok) { |
308 | + wx.showModal({ | ||
309 | + title: '提示', | ||
310 | + content: '同一门店自提和物流的商品不能同时结算' | ||
311 | + }); | ||
312 | + return false; | ||
313 | + } | ||
232 | 314 | ||
233 | - for(var i=0;i<item.length;i++){ | ||
234 | - var txt = "requestData[" + pitems + "].goods[" + i+ "].selected"; | ||
235 | - e.setData({ | ||
236 | - [txt]: Number(!sele), | ||
237 | - }); | ||
238 | - } | ||
239 | - var txt = "requestData[" + pitems + "].selected"; | ||
240 | - e.setData({ | ||
241 | - [txt]: Number(!sele), | ||
242 | - }); | ||
243 | - this.doCheckAll(); | ||
244 | - }, | ||
245 | - | ||
246 | - //---------------单选,也要判断门店的配送方式是否一致-------------- | ||
247 | - check_th_item: function(t) { | ||
248 | - var e=this, item = t.currentTarget.dataset.item,pitems = t.currentTarget.dataset.pitems; | ||
249 | - a = this.data.requestData[pitems].goods[item]; | ||
250 | - var isok=1,fir=0; | ||
251 | - var iarr = e.data.requestData[pitems].goods; | ||
252 | - | ||
253 | - | ||
254 | - //当数量大于1,且是选择的时候 | ||
255 | - if (iarr.length > 1 && !a.selected){ | ||
256 | - for (var i = 0; i < iarr.length;i++){ | ||
257 | - //---当不是本身选择项目---- | ||
258 | - var sel = iarr[i].selected; | ||
259 | - if (iarr[i].distr_type != 0 && (sel || iarr[i].id==a.id)) { | ||
260 | - if (fir == 0) { fir = iarr[i].distr_type; } | ||
261 | - else { | ||
262 | - if (fir != iarr[i].distr_type && iarr[i].distr_type != 0) { isok = 0; break; } | ||
263 | - } | ||
264 | - } | 315 | + for (var i = 0; i < item.length; i++) { |
316 | + var txt = "requestData[" + pitems + "].goods[" + i + "].selected"; | ||
317 | + e.setData({ | ||
318 | + [txt]: Number(!sele), | ||
319 | + }); | ||
320 | + } | ||
321 | + var txt = "requestData[" + pitems + "].selected"; | ||
322 | + e.setData({ | ||
323 | + [txt]: Number(!sele), | ||
324 | + }); | ||
325 | + this.doCheckAll(); | ||
326 | + }, | ||
327 | + | ||
328 | + //---------------单选,也要判断门店的配送方式是否一致-------------- | ||
329 | + check_th_item: function(t) { | ||
330 | + var e = this, | ||
331 | + item = t.currentTarget.dataset.item, | ||
332 | + pitems = t.currentTarget.dataset.pitems; | ||
333 | + a = this.data.requestData[pitems].goods[item]; | ||
334 | + var isok = 1, | ||
335 | + fir = 0; | ||
336 | + var iarr = e.data.requestData[pitems].goods; | ||
337 | + | ||
338 | + | ||
339 | + //当数量大于1,且是选择的时候 | ||
340 | + if (iarr.length > 1 && !a.selected) { | ||
341 | + for (var i = 0; i < iarr.length; i++) { | ||
342 | + //---当不是本身选择项目---- | ||
343 | + var sel = iarr[i].selected; | ||
344 | + if (iarr[i].distr_type != 0 && (sel || iarr[i].id == a.id)) { | ||
345 | + if (fir == 0) { | ||
346 | + fir = iarr[i].distr_type; | ||
347 | + } else { | ||
348 | + if (fir != iarr[i].distr_type && iarr[i].distr_type != 0) { | ||
349 | + isok = 0; | ||
350 | + break; | ||
351 | + } | ||
265 | } | 352 | } |
266 | } | 353 | } |
267 | - if(!isok){ | ||
268 | - wx.showModal({ title: '提示', content: '同一门店自提和物流的商品不能同时结算' }); | ||
269 | - }else{ | ||
270 | - var txt = "requestData[" + pitems + "].goods[" + item + "].selected"; | ||
271 | - e.setData({ | ||
272 | - [txt]: Number(!a.selected), | ||
273 | - }); | ||
274 | - this.doCheckAll(); | 354 | + } |
355 | + } | ||
356 | + if (!isok) { | ||
357 | + wx.showModal({ | ||
358 | + title: '提示', | ||
359 | + content: '同一门店自提和物流的商品不能同时结算' | ||
360 | + }); | ||
361 | + } else { | ||
362 | + var txt = "requestData[" + pitems + "].goods[" + item + "].selected"; | ||
363 | + e.setData({ | ||
364 | + [txt]: Number(!a.selected), | ||
365 | + }); | ||
366 | + this.doCheckAll(); | ||
367 | + } | ||
368 | + }, | ||
369 | + //----------检查是否全选--------- | ||
370 | + doCheckAll: function() { | ||
371 | + var th = this, | ||
372 | + tfeel = 0, | ||
373 | + t_num = 0, | ||
374 | + ischeck = 1, | ||
375 | + car = this.data.requestData, | ||
376 | + all_num = 0; | ||
377 | + | ||
378 | + for (var a = 0; a < car.length; a++) { | ||
379 | + var item = car[a].goods, | ||
380 | + is_s_sele = 1; | ||
381 | + for (var c = 0; c < item.length; c++) { | ||
382 | + all_num += item[c].goods_num; | ||
383 | + if (item[c].selected == 0) { | ||
384 | + ischeck = 0; | ||
385 | + is_s_sele = 0; | ||
386 | + } else { | ||
387 | + tfeel += item[c].goods_num * item[c].goods_price; | ||
388 | + t_num += item[c].goods_num; | ||
275 | } | 389 | } |
276 | - }, | ||
277 | - //----------检查是否全选--------- | ||
278 | - doCheckAll: function() { | ||
279 | - var th=this,tfeel=0,ischeck = 1,car = this.data.requestData; | ||
280 | - for (var a = 0; a < car.length; a++) { | ||
281 | - var item = car[a].goods; | ||
282 | - var is_s_sele=1; | ||
283 | - for (var c = 0; c < item.length;c++){ | ||
284 | - if(item[c].selected==0){ | ||
285 | - ischeck=0; | ||
286 | - is_s_sele=0; | ||
287 | - } | ||
288 | - else{ tfeel += item[c].goods_num * item[c].goods_price; } | ||
289 | - } | 390 | + } |
391 | + | ||
392 | + var txt = "requestData[" + a + "].selected"; | ||
393 | + th.setData({ | ||
394 | + [txt]: Number(is_s_sele) | ||
395 | + }); | ||
396 | + | ||
397 | + } | ||
398 | + this.setData({ | ||
399 | + checkAllToggle: ischeck, | ||
400 | + total_fee: tfeel.toFixed(2), | ||
401 | + all_num: all_num, | ||
402 | + total_num: t_num | ||
403 | + }); | ||
404 | + }, | ||
290 | 405 | ||
291 | - var txt = "requestData[" + a+ "].selected"; | ||
292 | - th.setData({ | ||
293 | - [txt]: Number(is_s_sele), | 406 | + //----------------------更新购物数量,加减,调用接口--------------------- |
407 | + postCardList: function(t, item, pitem) { | ||
408 | + var e = this; | ||
409 | + var user_id = getApp().globalData.user_id; | ||
410 | + console.log('update'); | ||
411 | + console.log(t); | ||
412 | + rq.get("/api/weshop/goods/get/" + oo.stoid + "/" + t.goods_id, { | ||
413 | + isShowLoading: 0, | ||
414 | + async success(d) { | ||
415 | + var limit = d.data.data.viplimited; | ||
416 | + var store_count = d.data.data.store_count; | ||
417 | + | ||
418 | + var goodsinfo = e.data.requestData[pitem].goods[item]; | ||
419 | + var promgoodsbuynum = 0; | ||
420 | + var goodsbuynum = 0; | ||
421 | + | ||
422 | + //--要获得商品,该用户买了多少件,同步应用-- | ||
423 | + await getApp().request.promiseGet("/api/weshop/ordergoods/getUserBuyGoodsNum", { | ||
424 | + data: { | ||
425 | + store_id: oo.stoid, | ||
426 | + user_id: user_id, | ||
427 | + goods_id: goodsinfo.goods_id, | ||
428 | + prom_type: goodsinfo.prom_type, | ||
429 | + prom_id: goodsinfo.prom_id | ||
430 | + }, | ||
431 | + }).then(res => { | ||
432 | + var buy_num_data = res.data.data; | ||
433 | + if (buy_num_data.promgoodsbuynum) promgoodsbuynum = buy_num_data.promgoodsbuynum; | ||
434 | + goodsbuynum = buy_num_data.goodsbuynum; | ||
435 | + }) | ||
436 | + | ||
437 | + var buyed_mum2 = t.goods_num + goodsbuynum; | ||
438 | + if (buyed_mum2 > limit && limit > 0) { | ||
439 | + wx.showModal({ | ||
440 | + title: '提示', | ||
441 | + content: '购买数量超出商品限购' | ||
294 | }); | 442 | }); |
443 | + var txt = "requestData[" + pitem + "].goods[" + item + "].goods_num"; | ||
444 | + var cbuy = limit - buyed_mum; | ||
445 | + e.setData({ | ||
446 | + [txt]: cbuy > 0 ? cbuy : 0, | ||
447 | + }); | ||
448 | + e.doCheckAll(); | ||
449 | + return false; | ||
450 | + } | ||
295 | 451 | ||
452 | + if (t.goods_num > store_count) { | ||
453 | + wx.showModal({ | ||
454 | + title: '提示', | ||
455 | + content: '购买数量超出商品库存' | ||
456 | + }); | ||
457 | + var txt = "requestData[" + pitem + "].goods[" + item + "].goods_num"; | ||
458 | + e.setData({ | ||
459 | + [txt]: store_count | ||
460 | + }); | ||
461 | + e.doCheckAll(); | ||
462 | + return false; | ||
296 | } | 463 | } |
297 | - this.setData({ | ||
298 | - checkAllToggle: ischeck, | ||
299 | - total_fee: tfeel.toFixed(2), | ||
300 | - }); | ||
301 | - }, | ||
302 | - | ||
303 | - //----------------------更新购物数量,加减,调用接口--------------------- | ||
304 | - postCardList: function (t, item, pitem) { | ||
305 | - var e = this; | ||
306 | - var user_id=getApp().globalData.user_id; | ||
307 | - console.log('update'); | ||
308 | - console.log(t); | ||
309 | - rq.get("/api/weshop/goods/get/" + oo.stoid + "/" + t.goods_id, { | ||
310 | - async success(d) { | ||
311 | - var limit = d.data.data.viplimited; | ||
312 | - var store_count = d.data.data.store_count; | ||
313 | - | ||
314 | - var goodsinfo=e.data.requestData[pitem ].goods[item]; | ||
315 | - var promgoodsbuynum=0; | ||
316 | - var goodsbuynum=0; | ||
317 | - //--要获得商品,该用户买了多少件,同步应用-- | ||
318 | - await getApp().request.promiseGet("/api/weshop/ordergoods/getUserBuyGoodsNum",{ | ||
319 | - data: { | ||
320 | - store_id: oo.stoid, | ||
321 | - user_id: user_id, | ||
322 | - goods_id: goodsinfo.goods_id, | ||
323 | - prom_type:goodsinfo.prom_type, | ||
324 | - prom_id:goodsinfo.prom_id | ||
325 | - }, | ||
326 | - }).then(res=>{ | ||
327 | - var buy_num_data=res.data.data; | ||
328 | - if(buy_num_data.promgoodsbuynum) promgoodsbuynum=buy_num_data.promgoodsbuynum; | ||
329 | - goodsbuynum=buy_num_data.goodsbuynum; | ||
330 | - }) | ||
331 | - | ||
332 | - var buyed_mum2 = t.goods_num + goodsbuynum; | ||
333 | - if (buyed_mum2>limit && limit>0){ | ||
334 | - wx.showModal({ title: '提示', content: '购买数量超出商品限购'}); | ||
335 | - var txt = "requestData[" + pitem + "].goods[" + item + "].goods_num"; | ||
336 | - var cbuy = limit - buyed_mum; | ||
337 | - e.setData({ [txt]: cbuy > 0 ? cbuy:0, }); | ||
338 | - return false; | ||
339 | - } | ||
340 | 464 | ||
341 | - if (t.goods_num > store_count) { | ||
342 | - wx.showModal({ title: '提示', content: '购买数量超出商品库存' }); | ||
343 | - var txt = "requestData[" + pitem + "].goods[" + item + "].goods_num"; | ||
344 | - e.setData({ [txt]: store_count }); | ||
345 | - return false; | ||
346 | - } | 465 | + if (goodsinfo.prom_type == 1) { |
466 | + //读取秒杀 | ||
467 | + rq.get("/api/ms/flash_sale/getFlashSaleOne/" + oo.stoid + "/" + goodsinfo.prom_id, { | ||
468 | + isShowLoading: 0, | ||
469 | + success: function(res_d) { | ||
470 | + var false_data = res_d.data.data; | ||
471 | + | ||
472 | + //--判断库存-- | ||
473 | + if (t.goods_num > false_data.goods_num - false_data.buy_num) { | ||
474 | + wx.showModal({ | ||
475 | + title: '提示', | ||
476 | + content: '购买数量超出活动库存' | ||
477 | + }); | ||
478 | + var txt = "requestData[" + pitem + "].goods[" + item + "].goods_num"; | ||
479 | + e.setData({ | ||
480 | + [txt]: false_data.goods_num - false_data.buy_num | ||
481 | + }); | ||
482 | + e.doCheckAll(); | ||
483 | + return false; | ||
484 | + } | ||
347 | 485 | ||
348 | - if(goodsinfo.prom_type==1){ | ||
349 | - //读取秒杀 | ||
350 | - rq.get("/api/ms/flash_sale/getFlashSaleOne/" + oo.stoid + "/" + goodsinfo.prom_id, { | ||
351 | - success: function (res_d) { | ||
352 | - var false_data=res_d.data.data; | ||
353 | - | ||
354 | - //--判断库存-- | ||
355 | - if (t.goods_num > false_data.goods_num-false_data.buy_num){ | ||
356 | - wx.showModal({ title: '提示', content: '购买数量超出活动库存' }); | ||
357 | - var txt = "requestData[" + pitem + "].goods[" + item + "].goods_num"; | ||
358 | - e.setData({ [txt]: false_data.goods_num-false_data.buy_num }); | ||
359 | - return false; | ||
360 | - } | ||
361 | - | ||
362 | - //--判断redis数量是否已经超出-- | ||
363 | - if(t.goods_num >false_data.redisnum){ | ||
364 | - wx.showModal({ title: '提示', content: '购买数量超出商品库存' }); | ||
365 | - var txt = "requestData[" + pitem + "].goods[" + item + "].goods_num"; | ||
366 | - e.setData({ [txt]: false_data.redisnum }); | ||
367 | - return false; | ||
368 | - } | ||
369 | - | ||
370 | - //--活动的限购是不是要判断-- | ||
371 | - if(t.goods_num+promgoodsbuynum >false_data.buy_limit && false_data.buy_limit>0){ | ||
372 | - wx.showModal({ title: '提示', content: '购买数量超出秒杀限购' }); | ||
373 | - var txt = "requestData[" + pitem + "].goods[" + item + "].goods_num"; | ||
374 | - e.setData({ [txt]: false_data.false_data.buy_limit }); | ||
375 | - return false; | ||
376 | - } | ||
377 | - | ||
378 | - e.update_cart(t,pitem,item); | ||
379 | - } | ||
380 | - }) | ||
381 | - }else{ | ||
382 | - e.update_cart(t,pitem,item); | ||
383 | - } | 486 | + //--判断redis数量是否已经超出-- |
487 | + if (t.goods_num > false_data.redisnum) { | ||
488 | + wx.showModal({ | ||
489 | + title: '提示', | ||
490 | + content: '购买数量超出商品库存' | ||
491 | + }); | ||
492 | + var txt = "requestData[" + pitem + "].goods[" + item + "].goods_num"; | ||
493 | + e.setData({ | ||
494 | + [txt]: false_data.redisnum | ||
495 | + }); | ||
496 | + e.doCheckAll(); | ||
497 | + return false; | ||
384 | } | 498 | } |
385 | - }); | ||
386 | - }, | ||
387 | - | ||
388 | - //更新购物车 | ||
389 | - update_cart:function(t,pitem,item){ | ||
390 | - var e=this; | ||
391 | - getApp().request.put("/api/weshop/cart/update", { | ||
392 | - data: t, | ||
393 | - success: function (ee) { | ||
394 | - var txt = "requestData[" + pitem + "].goods[" + item+"].goods_num"; | 499 | + |
500 | + //--活动的限购是不是要判断-- | ||
501 | + if (t.goods_num + promgoodsbuynum > false_data.buy_limit && false_data.buy_limit > 0) { | ||
502 | + wx.showModal({ | ||
503 | + title: '提示', | ||
504 | + content: '购买数量超出秒杀限购' | ||
505 | + }); | ||
506 | + var txt = "requestData[" + pitem + "].goods[" + item + "].goods_num"; | ||
395 | e.setData({ | 507 | e.setData({ |
396 | - [txt]: t.goods_num, | 508 | + [txt]: false_data.false_data.buy_limit |
397 | }); | 509 | }); |
398 | e.doCheckAll(); | 510 | e.doCheckAll(); |
511 | + return false; | ||
512 | + } | ||
513 | + e.update_cart(t, pitem, item); | ||
399 | } | 514 | } |
515 | + }) | ||
516 | + } else { | ||
517 | + e.update_cart(t, pitem, item); | ||
518 | + } | ||
519 | + } | ||
520 | + }); | ||
521 | + }, | ||
522 | + | ||
523 | + //更新购物车 | ||
524 | + update_cart: function(t, pitem, item) { | ||
525 | + var e = this; | ||
526 | + getApp().request.put("/api/weshop/cart/update", { | ||
527 | + data: t, | ||
528 | + success: function(ee) { | ||
529 | + var txt = "requestData[" + pitem + "].goods[" + item + "].goods_num"; | ||
530 | + e.data.up_dating = 0 | ||
531 | + e.setData({ | ||
532 | + [txt]: t.goods_num, | ||
400 | }); | 533 | }); |
401 | - }, | ||
402 | - | ||
403 | - //-------下拉刷新--------- | ||
404 | - onPullDownRefresh: function(t) { | ||
405 | - this.getCardList(); | ||
406 | - }, | ||
407 | - | ||
408 | - //--------------去结算------------ | ||
409 | - async checkout() { | ||
410 | - var glist=""; //用逗号隔开的 | ||
411 | - var map=new Map(); //使用map值键进行运算 | ||
412 | - var map_limit=new Map(); //使用map值键进行存储限购 | ||
413 | - var g_arr = new Array(); //已选的商品列表 | ||
414 | - var user_id=getApp().globalData.user_id; | ||
415 | - var th=this; | ||
416 | - | ||
417 | - var ab = 0;//选中 | ||
418 | - console.log('checkout'); | ||
419 | - for (var i=0;i<this.data.requestData.length;i++){ | ||
420 | - var i_arr = this.data.requestData[i].goods; | ||
421 | - for (var j = 0; j < i_arr.length;j++ ){ | ||
422 | - if (i_arr[j].selected){ | ||
423 | - //map 的key是不会重复,会覆盖,, | ||
424 | - var ie = { goods_id: i_arr[j].goods_id, id: i_arr[j].id, goods_price: i_arr[j].goods_price}; | ||
425 | - g_arr.push(ie); | ||
426 | - if(map.has(i_arr[j].goods_id + "")){ | ||
427 | - var num11 = map.get(i_arr[j].goods_id + ""); | ||
428 | - var num22 = parseInt(i_arr[j].goods_num)+parseInt(num11); | ||
429 | - map.set(i_arr[j].goods_id + "", num22); | ||
430 | - }else{ | ||
431 | - map.set(i_arr[j].goods_id + "", i_arr[j].goods_num); | ||
432 | - } | ||
433 | - glist += i_arr[j].goods_id+","; | ||
434 | - ab=1; | ||
435 | - }else{ | ||
436 | - rq.put("/api/weshop/cart/update", { | ||
437 | - data: { id: i_arr[j].id, selected: 0,store_id:oo.stoid }, | ||
438 | - success: function (ee) { | ||
439 | - console.log(ee); | ||
440 | - } | ||
441 | - }); | ||
442 | - } | 534 | + e.doCheckAll(); |
535 | + } | ||
536 | + }); | ||
537 | + }, | ||
538 | + | ||
539 | + //-------下拉刷新--------- | ||
540 | + onPullDownRefresh: function(t) { | ||
541 | + this.getCardList(); | ||
542 | + }, | ||
543 | + | ||
544 | + //--------------去结算------------ | ||
545 | + async checkout() { | ||
546 | + var glist = ""; //用逗号隔开的 | ||
547 | + var map = new Map(); //使用map值键进行运算 | ||
548 | + var map_limit = new Map(); //使用map值键进行存储限购 | ||
549 | + var g_arr = new Array(); //已选的商品列表 | ||
550 | + var user_id = getApp().globalData.user_id; | ||
551 | + var th = this; | ||
552 | + | ||
553 | + var ab = 0; //选中 | ||
554 | + console.log('checkout'); | ||
555 | + for (var i = 0; i < this.data.requestData.length; i++) { | ||
556 | + var i_arr = this.data.requestData[i].goods; | ||
557 | + for (var j = 0; j < i_arr.length; j++) { | ||
558 | + if (i_arr[j].selected) { | ||
559 | + //map 的key是不会重复,会覆盖,, | ||
560 | + var ie = { | ||
561 | + goods_id: i_arr[j].goods_id, | ||
562 | + id: i_arr[j].id, | ||
563 | + goods_price: i_arr[j].goods_price | ||
564 | + }; | ||
565 | + g_arr.push(ie); | ||
566 | + if (map.has(i_arr[j].goods_id + "")) { | ||
567 | + var num11 = map.get(i_arr[j].goods_id + ""); | ||
568 | + var num22 = parseInt(i_arr[j].goods_num) + parseInt(num11); | ||
569 | + map.set(i_arr[j].goods_id + "", num22); | ||
570 | + } else { | ||
571 | + map.set(i_arr[j].goods_id + "", i_arr[j].goods_num); | ||
443 | } | 572 | } |
573 | + glist += i_arr[j].goods_id + ","; | ||
574 | + ab = 1; | ||
575 | + } else { | ||
576 | + rq.put("/api/weshop/cart/update", { | ||
577 | + data: { | ||
578 | + id: i_arr[j].id, | ||
579 | + selected: 0, | ||
580 | + store_id: oo.stoid | ||
581 | + }, | ||
582 | + success: function(ee) { | ||
583 | + console.log(ee); | ||
584 | + } | ||
585 | + }); | ||
444 | } | 586 | } |
445 | - if (ab==0){t.my_warnning("未选择商品",0,th);return false; } | ||
446 | - | ||
447 | - glist = glist.substring(0, glist.length - 1); | ||
448 | - //--取一下商品的限购 以及活动的限购,redis数量-- | ||
449 | - rq.get("/api/weshop/goods/getGoodsListNum", { | ||
450 | - data: { goodsidlist: glist, store_id: oo.stoid }, | ||
451 | - async success(ee) { | ||
452 | - console.log(ee); | ||
453 | - if(ee.data.code==0){ | ||
454 | - var ddata = ee.data.data, isok = 1, gname="",err=""; | ||
455 | - //--组装-- | ||
456 | - for (var ij=0;ij<ddata.length;ij++){ | ||
457 | - var val=ddata[ij]; | ||
458 | - var obj = map_limit.get(val.goods_id+""); | ||
459 | - if(obj) continue; | ||
460 | - | ||
461 | - var promgoodsbuynum=0; | ||
462 | - var goodsbuynum=0; | ||
463 | - //--要获得商品,该用户买了多少件,同步应用-- | ||
464 | - await getApp().request.promiseGet("/api/weshop/ordergoods/getUserBuyGoodsNum",{ | ||
465 | - data: { | ||
466 | - store_id: oo.stoid, | ||
467 | - user_id: user_id, | ||
468 | - goods_id: val.goods_id, | ||
469 | - prom_type:val.prom_type, | ||
470 | - prom_id:val.prom_id | ||
471 | - }, | ||
472 | - }).then(res=>{ | ||
473 | - var buy_num_data=res.data.data; | ||
474 | - if(buy_num_data.promgoodsbuynum) promgoodsbuynum=buy_num_data.promgoodsbuynum; | ||
475 | - goodsbuynum=buy_num_data.goodsbuynum; | ||
476 | - }) | ||
477 | - var ie={promgoodsbuynum:promgoodsbuynum,goodsbuynum:goodsbuynum}; | ||
478 | - map_limit.set(val.goods_id + "", ie); | ||
479 | - } | ||
480 | - | ||
481 | - try{ | ||
482 | - ddata.forEach(function(val,ind){ | ||
483 | - var num = map.get(val.goods_id+""); | ||
484 | - if (num<=0) { | ||
485 | - isok = 0; gname = val.goods_name; | ||
486 | - throw "购买数量不能为0";return false; | ||
487 | - } | ||
488 | - if ( num>val.store_count) { | ||
489 | - isok = 0; gname = val.goods_name; | ||
490 | - throw "超出库存"; return false; | ||
491 | - } | ||
492 | - if ( num>val.redisnum && val.redisnum) { | ||
493 | - isok = 0; gname = val.goods_name; | ||
494 | - throw "超出活动库存"; return false; | ||
495 | - } | ||
496 | - if ( num>val.goods_num-val.buy_num && val.goods_num) { | ||
497 | - isok = 0; gname = val.goods_name; | ||
498 | - throw "超出活动库存";return false; | ||
499 | - } | ||
500 | - | ||
501 | - var buyed=map_limit.get(val.goods_id+""); | ||
502 | - if (num+buyed.goodsbuynum>val.viplimited && val.viplimited>0) { | ||
503 | - isok = 0; gname = val.goods_name; | ||
504 | - throw "超出商品限购";return false; | ||
505 | - } | ||
506 | - | ||
507 | - if (num+buyed.promgoodsbuynum>val.buy_limit && val.buy_limit>0) { | ||
508 | - isok = 0; gname = val.goods_name; | ||
509 | - throw "超出活动限购";return false; | ||
510 | - } | ||
511 | - | ||
512 | - for (var i = 0; i < g_arr.length;i++){ | ||
513 | - if (g_arr[i].goods_id==val.goods_id){ | ||
514 | - if(g_arr[i].goods_price != val.shop_price && g_arr[i].goods_price!=val.prom_price){ | ||
515 | - isok = 0; gname = val.goods_name; | ||
516 | - throw "商品价格已经变化"; | ||
517 | - } | ||
518 | - rq.put("/api/weshop/cart/update", { | ||
519 | - data: { id: g_arr[i].id, selected: 1,store_id:oo.stoid }, | ||
520 | - success: function (ee) { | ||
521 | - console.log(ee); | ||
522 | - } | ||
523 | - }); | ||
524 | - } | ||
525 | - } | ||
526 | - | ||
527 | - }) | ||
528 | - } catch (e) { err=e;} | ||
529 | - if (isok==0){ | ||
530 | - if (gname.length > 10) { | ||
531 | - gname = gname.substr(0, 10); gname+="..."; | ||
532 | - } | ||
533 | - t.confirmBox(gname+":"+ err); return false; | 587 | + } |
588 | + } | ||
589 | + if (ab == 0) { | ||
590 | + t.my_warnning("未选择商品", 0, th); | ||
591 | + return false; | ||
592 | + } | ||
593 | + | ||
594 | + glist = glist.substring(0, glist.length - 1); | ||
595 | + //--取一下商品的限购 以及活动的限购,redis数量-- | ||
596 | + rq.get("/api/weshop/goods/getGoodsListNum", { | ||
597 | + data: { | ||
598 | + goodsidlist: glist, | ||
599 | + store_id: oo.stoid | ||
600 | + }, | ||
601 | + async success(ee) { | ||
602 | + console.log(ee); | ||
603 | + if (ee.data.code == 0) { | ||
604 | + var ddata = ee.data.data, | ||
605 | + isok = 1, | ||
606 | + gname = "", | ||
607 | + err = ""; | ||
608 | + //--组装-- | ||
609 | + for (var ij = 0; ij < ddata.length; ij++) { | ||
610 | + var val = ddata[ij]; | ||
611 | + var obj = map_limit.get(val.goods_id + ""); | ||
612 | + if (obj) continue; | ||
613 | + | ||
614 | + var promgoodsbuynum = 0; | ||
615 | + var goodsbuynum = 0; | ||
616 | + //--要获得商品,该用户买了多少件,同步应用-- | ||
617 | + await getApp().request.promiseGet("/api/weshop/ordergoods/getUserBuyGoodsNum", { | ||
618 | + data: { | ||
619 | + store_id: oo.stoid, | ||
620 | + user_id: user_id, | ||
621 | + goods_id: val.goods_id, | ||
622 | + prom_type: val.prom_type, | ||
623 | + prom_id: val.prom_id | ||
624 | + }, | ||
625 | + }).then(res => { | ||
626 | + var buy_num_data = res.data.data; | ||
627 | + if (buy_num_data.promgoodsbuynum) promgoodsbuynum = buy_num_data.promgoodsbuynum; | ||
628 | + goodsbuynum = buy_num_data.goodsbuynum; | ||
629 | + }) | ||
630 | + var ie = { | ||
631 | + promgoodsbuynum: promgoodsbuynum, | ||
632 | + goodsbuynum: goodsbuynum | ||
633 | + }; | ||
634 | + map_limit.set(val.goods_id + "", ie); | ||
635 | + } | ||
636 | + | ||
637 | + try { | ||
638 | + ddata.forEach(function(val, ind) { | ||
639 | + var num = map.get(val.goods_id + ""); | ||
640 | + if (num <= 0) { | ||
641 | + isok = 0; | ||
642 | + gname = val.goods_name; | ||
643 | + throw "购买数量不能为0"; | ||
644 | + return false; | ||
645 | + } | ||
646 | + if (num > val.store_count) { | ||
647 | + isok = 0; | ||
648 | + gname = val.goods_name; | ||
649 | + throw "超出库存"; | ||
650 | + return false; | ||
651 | + } | ||
652 | + if (num > val.redisnum && val.redisnum) { | ||
653 | + isok = 0; | ||
654 | + gname = val.goods_name; | ||
655 | + throw "超出活动库存"; | ||
656 | + return false; | ||
657 | + } | ||
658 | + if (num > val.goods_num - val.buy_num && val.goods_num) { | ||
659 | + isok = 0; | ||
660 | + gname = val.goods_name; | ||
661 | + throw "超出活动库存"; | ||
662 | + return false; | ||
663 | + } | ||
664 | + | ||
665 | + var buyed = map_limit.get(val.goods_id + ""); | ||
666 | + if (num + buyed.goodsbuynum > val.viplimited && val.viplimited > 0) { | ||
667 | + isok = 0; | ||
668 | + gname = val.goods_name; | ||
669 | + throw "超出商品限购"; | ||
670 | + return false; | ||
671 | + } | ||
672 | + | ||
673 | + if (num + buyed.promgoodsbuynum > val.buy_limit && val.buy_limit > 0) { | ||
674 | + isok = 0; | ||
675 | + gname = val.goods_name; | ||
676 | + throw "超出活动限购"; | ||
677 | + return false; | ||
678 | + } | ||
679 | + | ||
680 | + for (var i = 0; i < g_arr.length; i++) { | ||
681 | + if (g_arr[i].goods_id == val.goods_id) { | ||
682 | + if (g_arr[i].goods_price != val.shop_price && g_arr[i].goods_price != val.prom_price) { | ||
683 | + isok = 0; | ||
684 | + gname = val.goods_name; | ||
685 | + throw "商品价格已经变化"; | ||
686 | + } | ||
687 | + rq.put("/api/weshop/cart/update", { | ||
688 | + data: { | ||
689 | + id: g_arr[i].id, | ||
690 | + selected: 1, | ||
691 | + store_id: oo.stoid | ||
692 | + }, | ||
693 | + success: function(ee) { | ||
694 | + console.log(ee); | ||
534 | } | 695 | } |
535 | - wx.navigateTo({ | ||
536 | - url: "/pages/cart/cart2/cart2" | ||
537 | - }); | 696 | + }); |
538 | } | 697 | } |
698 | + } | ||
699 | + | ||
700 | + }) | ||
701 | + } catch (e) { | ||
702 | + err = e; | ||
539 | } | 703 | } |
540 | - }); | ||
541 | - }, | ||
542 | - | ||
543 | - //结算到最后一个商品 | ||
544 | - set_last: function (ab, isok, gname){ | ||
545 | - if (isok == 0) { | ||
546 | - t.my_warnning(gname + "商品超出库存",0,this); | ||
547 | - } else { | ||
548 | - ab ? wx.navigateTo({ | ||
549 | - url: "/pages/cart/cart2/cart2" | ||
550 | - }) : t.my_warnning("还没有选中商品",0,this); | 704 | + if (isok == 0) { |
705 | + t.confirmBox(gname + ":" + err); | ||
706 | + return false; | ||
707 | + } | ||
708 | + wx.navigateTo({ | ||
709 | + url: "/pages/cart/cart2/cart2" | ||
710 | + }); | ||
711 | + } | ||
551 | } | 712 | } |
552 | - }, | 713 | + }); |
714 | + }, | ||
715 | + | ||
716 | + //结算到最后一个商品 | ||
717 | + set_last: function(ab, isok, gname) { | ||
718 | + if (isok == 0) { | ||
719 | + t.my_warnning(gname + "商品超出库存", 0, this); | ||
720 | + } else { | ||
721 | + ab ? wx.navigateTo({ | ||
722 | + url: "/pages/cart/cart2/cart2" | ||
723 | + }) : t.my_warnning("还没有选中商品", 0, this); | ||
724 | + } | ||
725 | + }, | ||
553 | 726 | ||
554 | 727 | ||
555 | //图片失败,默认图片 | 728 | //图片失败,默认图片 |
556 | - bind_bnerr2: function (e) { | 729 | + bind_bnerr2: function(e) { |
557 | var _errImg = e.target.dataset.errorimg; | 730 | var _errImg = e.target.dataset.errorimg; |
558 | var _errurl = e.target.dataset.url; | 731 | var _errurl = e.target.dataset.url; |
559 | var ii = _errurl.indexOf(oo.imghost); | 732 | var ii = _errurl.indexOf(oo.imghost); |
560 | if (ii != -1) { | 733 | if (ii != -1) { |
561 | this.setData({ | 734 | this.setData({ |
562 | - [_errImg]: oo.imghost+"/miniapp/images/default_g_img.gif", | 735 | + [_errImg]: oo.imghost + "/miniapp/images/default_g_img.gif", |
563 | }) | 736 | }) |
564 | } | 737 | } |
738 | + }, | ||
739 | + //设置点击按钮为true或者false | ||
740 | + radio_chick: function(checked, num) { | ||
741 | + var th = this; | ||
742 | + var requestData = th.data.requestData; | ||
743 | + }, | ||
744 | + | ||
745 | + //点击编辑后的效果 | ||
746 | + edit_cart: function(e) { | ||
747 | + var type = parseFloat(e.currentTarget.dataset.type); | ||
748 | + this.setData({ | ||
749 | + is_edit: type | ||
750 | + }); | ||
751 | + }, | ||
752 | + | ||
753 | + //--多个删除购物车商品--- | ||
754 | + check_del: function() { | ||
755 | + var glist = ""; //用逗号隔开的 | ||
756 | + var user_id = getApp().globalData.user_id; | ||
757 | + var th = this; | ||
758 | + | ||
759 | + var ab = 0; //选中 | ||
760 | + for (var i = 0; i < this.data.requestData.length; i++) { | ||
761 | + var i_arr = this.data.requestData[i].goods; | ||
762 | + for (var j = 0; j < i_arr.length; j++) { | ||
763 | + if (i_arr[j].selected) { | ||
764 | + glist += i_arr[j].id + ","; | ||
765 | + ab = 1; | ||
766 | + } | ||
767 | + } | ||
768 | + } | ||
769 | + | ||
770 | + if (ab == 0) { | ||
771 | + t.my_warnning("未选择商品", 0, th); | ||
772 | + return false; | ||
773 | + } | ||
774 | + glist = glist.substring(0, glist.length - 1); | ||
775 | + //要删除购物车中的商品 | ||
776 | + var url = '/api/weshop/cart/delIds/' + oo.stoid + '/' + user_id + "/" + glist; | ||
777 | + getApp().request.delete(url, { | ||
778 | + success: function(t) { | ||
779 | + th.getCardList(); | ||
780 | + } | ||
781 | + }); | ||
782 | + }, | ||
783 | + //跳到首页 | ||
784 | + goto: function(e) { | ||
785 | + wx.switchTab({ | ||
786 | + url: '/pages/index/index/index', | ||
787 | + }) | ||
565 | } | 788 | } |
566 | 789 | ||
567 | -}); | 790 | -}); |
791 | +}); | ||
568 | \ No newline at end of file | 792 | \ No newline at end of file |
pages/cart/cart/cart.wxml
1 | +<!-- 广告图片 --> | ||
2 | +<navigator class="picture" url="/pages/activity/seckill_list/seckill_list" wx:if="{{is_has_flash}}"> | ||
3 | + <image class="picture" src="{{iurl}}miniapp/images/stores/Seckill.png"></image> | ||
4 | +</navigator> | ||
1 | <view class="container" wx:if="{{requestData.length>0}}"> | 5 | <view class="container" wx:if="{{requestData.length>0}}"> |
2 | - <view class="login-in pd-bg-fff"> | ||
3 | - <block wx:for="{{requestData}}" wx:key="{{index}}" wx:for-index="pidx"> | ||
4 | - <view class="shmd_m"> | ||
5 | - <view bindtap="check_th_all_item" class="goods-ico" data-pitems="{{pidx}}" > | ||
6 | - <icon color="{{checkAllToggle||item.selected?'red':'gray'}}" size="16" type="success"></icon> | ||
7 | - </view> | ||
8 | - <view class="shmd">门店:{{item.pname}}</view> | 6 | + <!-- 购物车商品框架 --> |
7 | + <view class="login-in"> | ||
8 | + <!-- 编辑 --> | ||
9 | + <view class="padding flex-vertical-between fs30 Storenum store"> | ||
10 | + <view class="flex"> | ||
11 | + <view>商品数量:</view> | ||
12 | + <view class="goods_num">{{all_num}}</view> | ||
13 | + </view> | ||
14 | + <view wx:if="{{is_edit==0}}" bindtap="edit_cart" data-type="1">编辑</view> | ||
15 | + <view wx:else bindtap="edit_cart" data-type="0">完成</view> | ||
16 | + </view> | ||
17 | + <block wx:for="{{requestData}}" wx:key="{{index}}" wx:for-index="pidx"> | ||
18 | + <!-- 门店底下的商品 --> | ||
19 | + <view class="store"> | ||
20 | + <view class="shmd_m"> | ||
21 | + <!-- 门店 --> | ||
22 | + <!--<radio color="red" bindtap="check_th_all_item" class="order-raido flex-center" checked="{{checkAllToggle||item.selected}}" data-pitems="{{pidx}}"></radio>--> | ||
23 | + | ||
24 | + <icon wx:if="{{checkAllToggle||item.selected}}" class="order-raido flex-center" bindtap="check_th_all_item" data-pitems="{{pidx}}" | ||
25 | + color="red" size="20" type="success"></icon> | ||
26 | + <view wx:else class="icon_no_sele2" bindtap="check_th_all_item" data-pitems="{{pidx}}"></view> | ||
27 | + | ||
28 | + <view class="flex-center"> | ||
29 | + <image src="{{iurl}}miniapp/images/stores/store.png"></image> | ||
30 | + <view class="shmd fs30">{{item.pname}}</view> | ||
9 | </view> | 31 | </view> |
10 | - <view class="order-item" data-item="{{idx}}" wx:for="{{item.goods}}" | ||
11 | - wx:for-item="items" | ||
12 | - wx:for-index="idx" wx:key="{{index}}"> | ||
13 | - <view bindtap="check_th_item" class="goods-ico" data-check="{{items.selected}}" data-item="{{idx}}" data-pitems="{{pidx}}"> | ||
14 | - <icon color="{{checkAllToggle||items.selected?'red':'gray'}}" size="16" type="success"></icon> | 32 | + |
33 | + </view> | ||
34 | + <view class="order-item" data-item="{{idx}}" wx:for="{{item.goods}}" wx:for-item="items" wx:for-index="idx" wx:key="{{index}}"> | ||
35 | + <view bindtap="check_th_item" class="order-raido flex-vertical " data-check="{{items.selected}}" data-item="{{idx}}" data-pitems="{{pidx}}"> | ||
36 | + <!--<radio color="red" checked="{{checkAllToggle||items.selected}}"></radio>--> | ||
37 | + <icon wx:if="{{checkAllToggle||items.selected}}" color="red" size="20" type="success"></icon> | ||
38 | + <text wx:else class="icon_no_sele"></text> | ||
39 | + </view> | ||
40 | + <navigator class="goods-img rel" url="/pages/goods/goodsInfo/goodsInfo?goods_id={{items.goods_id}}"> | ||
41 | + <image class="wh100" src="{{items.original_img}}" binderror="bind_bnerr2" data-errorimg="requestData[{{pidx}}].goods[{{idx}}].original_img" data-url="{{items.original_img}}"></image> | ||
42 | + <view class="abs flex-center fs26" wx:if="{{items.distr_type==0}}">自选</view> | ||
43 | + <view class="abs flex-center fs26" wx:if="{{items.distr_type==1}}">自提</view> | ||
44 | + <view class="abs flex-center fs26" wx:if="{{items.distr_type==2}}">物流</view> | ||
45 | + | ||
46 | + </navigator> | ||
47 | + <view class="goods-cont"> | ||
48 | + <view class="goods-name"> | ||
49 | + <navigator class="ellipsis-2 fs30" url="/pages/goods/goodsInfo/goodsInfo?goods_id={{items.goods_id}}">{{items.goods_name}}</navigator> | ||
50 | + | ||
51 | + <view class="specifications ellipsis-1"> | ||
52 | + <view wx:if="{{items.goods_color || items.goods_spec}}"> | ||
53 | + {{items.goods_color}}{{items.goods_color?"/":''}}{{items.goods_spec}}</view> | ||
54 | + <view wx:else>规格1</view> | ||
55 | + </view> | ||
56 | + </view> | ||
57 | + | ||
58 | + <view class="flex alend jc_sb"> | ||
59 | + <view class="goods-price co-red baseline ellipsis-1"> | ||
60 | + <view class="fs20">¥</view> | ||
61 | + <view class="fs28">{{items.goods_price}}</view> | ||
15 | </view> | 62 | </view> |
16 | - <navigator class="goods-img" url="/pages/goods/goodsInfo/goodsInfo?goods_id={{items.goods_id}}"> | ||
17 | - <image class="wh100" src="{{items.original_img}}" | ||
18 | - binderror="bind_bnerr2" data-errorimg="requestData[{{pidx}}].goods[{{idx}}].original_img" | ||
19 | - data-url="{{items.original_img}}" ></image> | ||
20 | - </navigator> | ||
21 | - <view class="goods-cont"> | ||
22 | - <navigator class="goods-name ellipsis-2" url="/pages/goods/goodsInfo/goodsInfo?goods_id={{items.goods_id}}">{{items.goods_name}}</navigator> | ||
23 | - <view class="goods-attribute ellipsis-2">{{items.spec_key_name}}</view> | ||
24 | - <view class="goods-price co-red">¥{{items.goods_price}}</view> | ||
25 | - <view bindtap="delete_th_item" class="btn-del" data-cartid="{{items.id}}"> | ||
26 | - <image class="wh100" src="{{imgUrl}}/miniapp/images/dele.png"></image> | ||
27 | - </view> | ||
28 | - <view class="count"> | ||
29 | - <view bindtap="subNum" class="sub" data-pitems="{{pidx}}" data-item="{{idx}}">-</view> | ||
30 | - <input bindblur="valueToNum" data-pitems="{{pidx}}" data-item="{{idx}}" type="number" value="{{items.goods_num}}"></input> | ||
31 | - <view bindtap="addNum" class="add" data-pitems="{{pidx}}" data-item="{{idx}}">+</view> | ||
32 | - </view> | 63 | + <view class="count"> |
64 | + <view bindtap="subNum" class="sub fs28" data-pitems="{{pidx}}" data-item="{{idx}}">一</view> | ||
65 | + <input class="goodadd" bindblur="valueToNum" data-pitems="{{pidx}}" data-item="{{idx}}" type="number" value="{{items.goods_num}}"></input> | ||
66 | + <view class="add" bindtap="addNum" data-pitems="{{pidx}}" data-item="{{idx}}">+</view> | ||
33 | </view> | 67 | </view> |
68 | + </view> | ||
34 | </view> | 69 | </view> |
35 | - </block> | ||
36 | - </view> | 70 | + </view> |
71 | + </view> | ||
72 | + </block> | ||
73 | + </view> | ||
74 | + <view class="pay-for flex-vertical-between"> | ||
75 | + <view class="allradio flex-vertical-between"> | ||
76 | + <view class="flex-vertical mlr" bindtap="checkAll"> | ||
77 | + <!--<radio class="order-raido" color="red" checked="{{checkAllToggle}}"></radio>--> | ||
78 | + <icon wx:if="{{checkAllToggle}}" color="red" size="20" type="success"></icon> | ||
79 | + <text wx:else class="icon_no_sele"></text> | ||
80 | + <view class="all fs30" style="margin-left: 10rpx">全选</view> | ||
81 | + </view> | ||
37 | 82 | ||
38 | - <cover-view class="pay-for"> | ||
39 | - <label bindtap="checkAll" class="checkbox"> | ||
40 | - <icon class="ico-check" color="{{checkAllToggle?'red':'gray'}}" size="20" type="success"></icon>全选 | ||
41 | - </label> | ||
42 | - <button bindtap="checkout" class="pay-btn">去结算</button> | ||
43 | - <view class="consumer"> | ||
44 | - <view class="total">总计 : <text class="co-red">{{total_fee}}</text> | ||
45 | - </view> | ||
46 | - <text class="tips">不包含运费</text> | 83 | + <!-- 显示金额的多少 --> |
84 | + <view class="consumer" wx:if="{{is_edit==0}}"> | ||
85 | + <view class="fs30 baseline"> | ||
86 | + <view class="total">合计:</view> | ||
87 | + <text class="co-red">¥{{total_fee}}</text> | ||
88 | + </view> | ||
89 | + <view class="flex-level-right"> | ||
90 | + <text class="tips fs20">不含运费</text> | ||
47 | </view> | 91 | </view> |
48 | - </cover-view> | 92 | + </view> |
93 | + </view> | ||
94 | + <view> | ||
95 | + | ||
96 | + <button wx:if="{{is_edit}}" bindtap="check_del" class="pay-btn">删除</button> | ||
97 | + <button wx:else bindtap="checkout" class="pay-btn">结算({{total_num}})</button> | ||
98 | + </view> | ||
99 | + </view> | ||
49 | 100 | ||
50 | -</view> | ||
51 | -<view class="no-data" wx:if="{{!requestData||requestData.length==0}}"> | ||
52 | - <image class="cart-image" src="{{imgUrl}}/miniapp/images/cart-null.png"></image> | ||
53 | - <view class="no-data-title">购物车暂无商品</view> | ||
54 | - <navigator class="lookat" openType="switchTab" url="/pages/index/index/index"> 去逛逛 </navigator> | ||
55 | </view> | 101 | </view> |
56 | 102 | ||
103 | +<!-- 购物车为空 --> | ||
104 | +<view class="empty_order" wx:if="{{(!requestData|| requestData.length==0) && is_load}}"> | ||
105 | + <view class="flex-level"> | ||
106 | + <image src="{{iurl}}miniapp/images/stores/nocart.png"></image> | ||
107 | + </view> | ||
108 | + <view class="flex-level fs32 xc-ash">购物车竟然是空的</view> | ||
109 | + <view class="flex-level"> | ||
110 | + <navigator url="/pages/index/index/index" bindtap="goto"> | ||
111 | + <view class="flex-center fs30 white">去首页逛逛</view> | ||
112 | + </navigator> | ||
113 | + </view> | ||
114 | +</view> | ||
57 | 115 | ||
58 | <warn id="warn"></warn> | 116 | <warn id="warn"></warn> |
59 | \ No newline at end of file | 117 | \ No newline at end of file |
pages/cart/cart/cart.wxss
1 | page { | 1 | page { |
2 | - background-color: #fff; | 2 | + background-color: rgb(245, 245, 245); |
3 | + font-family: crosoft yahei; | ||
4 | +} | ||
5 | + | ||
6 | +.padding { | ||
7 | + padding: 0rpx 30rpx; | ||
8 | +} | ||
9 | + | ||
10 | +.alend { | ||
11 | + align-items: flex-end; | ||
12 | +} | ||
13 | + | ||
14 | +.goods-price { | ||
15 | + font-size: 18rpx; | ||
16 | +} | ||
17 | + | ||
18 | +.baseline { | ||
19 | + display: flex; | ||
20 | + align-items: baseline; | ||
21 | +} | ||
22 | + | ||
23 | +.picture { | ||
24 | + width: 100%; | ||
25 | + height: 220rpx; | ||
3 | } | 26 | } |
4 | 27 | ||
5 | .container { | 28 | .container { |
6 | - display: flex; | ||
7 | - height: 100%; | ||
8 | - align-items: center; | ||
9 | - justify-content: center; | ||
10 | - background-color: #fff; | ||
11 | - padding-bottom: 100rpx; | 29 | + display: flex; |
30 | + height: 100%; | ||
31 | + align-items: center; | ||
32 | + justify-content: center; | ||
33 | + background-color: rgb(255, 255, 255); | ||
34 | + margin-bottom: 99rpx; | ||
35 | +} | ||
36 | + | ||
37 | +radio { | ||
38 | + transform: scale(0.8); | ||
12 | } | 39 | } |
13 | 40 | ||
14 | .login-in { | 41 | .login-in { |
15 | - width: 100%; | ||
16 | - box-sizing: border-box; | 42 | + width: 100%; |
43 | + box-sizing: border-box; | ||
44 | + background-color: rgb(255, 255, 255); | ||
17 | } | 45 | } |
18 | 46 | ||
19 | .order-item { | 47 | .order-item { |
20 | - display: flex; | ||
21 | - justify-content: space-around; | ||
22 | - height: 200rpx; | ||
23 | - padding: 10rpx 0; | ||
24 | - border-bottom: 1px solid #ddd; | 48 | + display: flex; |
49 | + height: 246rpx; | ||
50 | + border-top: 3rpx solid rgb(245, 245, 245); | ||
51 | + align-items: center; | ||
52 | + padding-right: 30rpx; | ||
25 | } | 53 | } |
26 | 54 | ||
27 | .goods-ico { | 55 | .goods-ico { |
28 | - display: flex; | ||
29 | - align-items: center; | 56 | + display: flex; |
57 | + align-items: center; | ||
58 | + padding: 0rpx 30rpx; | ||
59 | +} | ||
60 | + | ||
61 | +.order-raido { | ||
62 | + height: 100%; | ||
63 | + padding-left: 30rpx; | ||
64 | + padding-right: 25rpx; | ||
30 | } | 65 | } |
31 | 66 | ||
32 | .goods-img { | 67 | .goods-img { |
33 | - width: 180rpx; | ||
34 | - height: 180rpx; | ||
35 | - font-size: 0; | ||
36 | - margin-top: 10rpx; | 68 | + width: 180rpx; |
69 | + height: 180rpx; | ||
70 | + font-size: 0; | ||
71 | + overflow: hidden; | ||
72 | + border: 2rpx solid rgb(236, 236, 236); | ||
37 | } | 73 | } |
38 | 74 | ||
39 | .goods-cont { | 75 | .goods-cont { |
40 | - position: relative; | ||
41 | - width: 430rpx; | ||
42 | - height: 200rpx; | ||
43 | - font-size: 28rpx; | 76 | + width: 385rpx; |
77 | + height: 165rpx; | ||
78 | + font-size: 28rpx; | ||
79 | + margin-left: 35rpx; | ||
80 | + padding-top: 7rpx; | ||
81 | + padding-bottom: 5rpx; | ||
44 | } | 82 | } |
45 | 83 | ||
46 | .goods-name { | 84 | .goods-name { |
47 | - width: 370rpx; | ||
48 | - height: 64rpx; | ||
49 | - margin: 8rpx 0; | ||
50 | - line-height: 32rpx; | ||
51 | - color: #333; | ||
52 | - | 85 | + line-height: 32rpx; |
86 | + color: #333; | ||
87 | + height: 125rpx; | ||
53 | } | 88 | } |
54 | 89 | ||
55 | .goods-attribute { | 90 | .goods-attribute { |
56 | - max-height: 52rpx; | ||
57 | - line-height: 26rpx; | ||
58 | - font-size: 24rpx; | ||
59 | - color: #999; | ||
60 | -} | ||
61 | - | ||
62 | -.goods-price { | ||
63 | - height: 40rpx; | ||
64 | - line-height: 40rpx; | ||
65 | - margin-top: 10rpx; | 91 | + max-height: 52rpx; |
92 | + line-height: 26rpx; | ||
93 | + font-size: 24rpx; | ||
94 | + color: #999; | ||
66 | } | 95 | } |
67 | 96 | ||
68 | .btn-del { | 97 | .btn-del { |
69 | - position: absolute; | ||
70 | - right: 0; | ||
71 | - top: 8rpx; | ||
72 | - width: 34rpx; | ||
73 | - height: 34rpx; | 98 | + position: absolute; |
99 | + right: 0; | ||
100 | + top: 8rpx; | ||
101 | + width: 34rpx; | ||
102 | + height: 34rpx; | ||
74 | } | 103 | } |
75 | 104 | ||
76 | .count { | 105 | .count { |
77 | - position: absolute; | ||
78 | - right: 0; | ||
79 | - bottom: 5rpx; | ||
80 | - width: 156rpx; | ||
81 | - height: 50rpx; | ||
82 | - border: 1px solid #ddd; | 106 | + display: flex; |
107 | + bottom: 5rpx; | ||
108 | + border: 2rpx solid rgb(236, 236, 236); | ||
109 | + margin-bottom: 3rpx; | ||
110 | +} | ||
111 | + | ||
112 | +.count>view, .count>input { | ||
113 | + width: 50rpx; | ||
114 | + height: 40rpx; | ||
115 | + line-height: 40rpx; | ||
116 | + text-align: center; | ||
117 | + display: flex; | ||
118 | + font-size: 18rpx; | ||
119 | + justify-content: center; | ||
120 | + min-height: 35rpx; | ||
83 | } | 121 | } |
84 | 122 | ||
85 | -.count>view,.count>input { | ||
86 | - float: left; | ||
87 | - width: 50rpx; | ||
88 | - height: 50rpx; | ||
89 | - line-height: 50rpx; | ||
90 | - text-align: center; | 123 | +.count>.goodadd { |
124 | + width: 67rpx; | ||
125 | + font-size: 24rpx; | ||
126 | +} | ||
127 | + | ||
128 | +.count>.add { | ||
129 | + font-size: 32rpx; | ||
91 | } | 130 | } |
92 | 131 | ||
93 | .sub { | 132 | .sub { |
94 | - border-right: 1px solid #ddd; | 133 | + border-right: 2rpx solid rgb(236, 236, 236); |
95 | } | 134 | } |
96 | 135 | ||
97 | .add { | 136 | .add { |
98 | - border-left: 1px solid #ddd; | 137 | + border-left: 2rpx solid rgb(236, 236, 236); |
99 | } | 138 | } |
100 | 139 | ||
101 | .pay-for { | 140 | .pay-for { |
102 | - width: 100%; | ||
103 | - height: 100rpx; | ||
104 | - position: fixed; | ||
105 | - left: 0; | ||
106 | - bottom: 0; | ||
107 | - font-size: 28rpx; | ||
108 | - color: #666; | ||
109 | - background-color: #f0f2f5; | ||
110 | - z-index: 9999999 | 141 | + |
142 | + width: 100%; | ||
143 | + height: 100rpx; | ||
144 | + position: fixed; | ||
145 | + left: 0; | ||
146 | + bottom: 0; | ||
147 | + font-size: 28rpx; | ||
148 | + color: #666; | ||
149 | + background-color: rgb(255, 255, 255); | ||
150 | + z-index: 2; | ||
151 | + border-top: 1rpx solid rgb(236, 236, 236); | ||
152 | + border-bottom: 1rpx solid rgb(236, 236, 236); | ||
153 | + | ||
111 | } | 154 | } |
112 | 155 | ||
113 | .pay-for .pay-btn { | 156 | .pay-for .pay-btn { |
114 | - float: right; | ||
115 | - width: 200rpx; | ||
116 | - height: 100rpx; | ||
117 | - line-height: 100rpx; | ||
118 | - text-align: center; | ||
119 | - background-color: #f23030; | ||
120 | - color: #fff; | ||
121 | - border-radius: 0; | 157 | + width: 220rpx; |
158 | + height: 100rpx; | ||
159 | + line-height: 100rpx; | ||
160 | + background-color: rgb(219, 27, 52); | ||
161 | + color: #fff; | ||
162 | + border-radius: 0; | ||
163 | + font-size: 31rpx; | ||
122 | } | 164 | } |
123 | 165 | ||
124 | .pay-for .consumer { | 166 | .pay-for .consumer { |
125 | - float: right; | ||
126 | - margin-right: 20rpx; | ||
127 | - line-height: 50rpx; | 167 | + margin-right: 23rpx; |
168 | + color: rgb(0, 0, 0); | ||
169 | + letter-spacing: 1rpx; | ||
170 | +} | ||
171 | + | ||
172 | +.pay-for .consumer .total { | ||
173 | + color: rgb(0, 0, 0); | ||
174 | +} | ||
175 | + | ||
176 | +.pay-for .consumer .tips { | ||
177 | + color: rgb(153, 153, 153); | ||
128 | } | 178 | } |
129 | 179 | ||
130 | .pay-for .checkbox { | 180 | .pay-for .checkbox { |
131 | - float: left; | ||
132 | - padding-left: 40rpx; | ||
133 | - line-height: 100rpx; | ||
134 | - display: flex; | ||
135 | - align-items: center; | 181 | + float: left; |
182 | + padding-left: 40rpx; | ||
183 | + line-height: 100rpx; | ||
184 | + display: flex; | ||
185 | + align-items: center; | ||
136 | } | 186 | } |
137 | 187 | ||
138 | .pay-for .ico-check { | 188 | .pay-for .ico-check { |
139 | - display: flex; | ||
140 | - align-items: center; | ||
141 | - margin-right: 20rpx; | 189 | + display: flex; |
190 | + align-items: center; | ||
191 | + margin-right: 20rpx; | ||
192 | +} | ||
193 | + | ||
194 | +.shmd_m { | ||
195 | + height: 80rpx; | ||
196 | + line-height: 80rpx; | ||
197 | + display: flex; | ||
198 | +} | ||
199 | + | ||
200 | +.shmd_m image { | ||
201 | + height: 50rpx; | ||
202 | + width: 55rpx; | ||
203 | + margin-left: -10rpx; | ||
142 | } | 204 | } |
143 | -.shmd_m{margin-left: 5rpx; height: 80rpx; line-height: 80rpx; display: flex;border-bottom: 1rpx solid #ddd} | ||
144 | -.shmd_m .goods-ico icon{margin-top: 26rpx;} | ||
145 | -.shmd{margin-left: 20rpx;} | ||
146 | \ No newline at end of file | 205 | \ No newline at end of file |
206 | + | ||
207 | +.shmd_m .goods-ico icon { | ||
208 | + margin-top: 26rpx; | ||
209 | +} | ||
210 | + | ||
211 | +.shmd { | ||
212 | + margin-left: 5rpx; | ||
213 | +} | ||
214 | + | ||
215 | +.store { | ||
216 | + border-bottom: 7rpx solid rgb(245, 245, 245); | ||
217 | +} | ||
218 | + | ||
219 | +.login-in .Storenum { | ||
220 | + height: 80rpx; | ||
221 | + color: rgb(51, 51, 51); | ||
222 | +} | ||
223 | + | ||
224 | +.login-in .goods_num { | ||
225 | + margin-left: 13rpx; | ||
226 | +} | ||
227 | + | ||
228 | +.allradio { | ||
229 | + width: 600rpx; | ||
230 | + height: 100%; | ||
231 | +} | ||
232 | + | ||
233 | +.allradio .all { | ||
234 | + color: rgb(0, 0, 0); | ||
235 | +} | ||
236 | + | ||
237 | +.specifications { | ||
238 | + padding: 3rpx 8rpx; | ||
239 | + margin-top: 8rpx; | ||
240 | + font-size: 22rpx; | ||
241 | + max-width: 356rpx; | ||
242 | + width: auto; | ||
243 | + height: 30rpx; | ||
244 | + line-height: 29rpx; | ||
245 | + background-color: rgb(236, 236, 236); | ||
246 | + border-radius: 8rpx; | ||
247 | + white-space: nowrap; | ||
248 | + color: rgb(63, 63, 63); | ||
249 | + display: inline-block; | ||
250 | + | ||
251 | +} | ||
252 | + | ||
253 | +.ellipsis-2 { | ||
254 | + max-height: 64rpx; | ||
255 | +} | ||
256 | + | ||
257 | +.abs { | ||
258 | + top: 15rpx; | ||
259 | + left: -39rpx; | ||
260 | + width: 154rpx; | ||
261 | + height: 40rpx; | ||
262 | + background-color: rgb(16, 202, 220); | ||
263 | + transform: rotate(320deg); | ||
264 | + color: rgb(255, 255, 255); | ||
265 | + line-height: 40rpx; | ||
266 | +} | ||
267 | + | ||
268 | +/* 购物车为空 */ | ||
269 | + | ||
270 | +.empty_order image { | ||
271 | + width: 329rpx; | ||
272 | + height: 229rpx; | ||
273 | + margin-top: 140rpx; | ||
274 | +} | ||
275 | + | ||
276 | +.empty_order .xc-ash { | ||
277 | + margin-top: 25rpx; | ||
278 | + font-weight: 600px; | ||
279 | +} | ||
280 | + | ||
281 | +.empty_order navigator { | ||
282 | + margin-top: 60rpx; | ||
283 | + border-radius: 40rpx; | ||
284 | +} | ||
285 | + | ||
286 | +.empty_order navigator view { | ||
287 | + width: 247rpx; | ||
288 | + height: 56rpx; | ||
289 | + background-color: rgb(255, 72, 72); | ||
290 | + border-radius: 40rpx; | ||
291 | +} | ||
292 | + | ||
293 | +.icon_no_sele{ display: inline-block; width: 39rpx; height: 39rpx; border: 1rpx solid #ddd; border-radius: 50%} | ||
294 | +.icon_no_sele2{width: 39rpx; height: 39rpx; border: 1rpx solid #ddd; border-radius: 50%; margin-top: 20rpx; | ||
295 | + margin-left: 30rpx; margin-right: 25rpx} | ||
296 | + | ||
297 | +.mlr{ margin-left: 25rpx; margin-right: 20rpx} |
pages/cart/cart2/c_filter.wxs
0 → 100644
1 | +var filters = { | ||
2 | + toFix:function(val,count){ | ||
3 | + return val.toFixed(count) | ||
4 | + }, | ||
5 | + format_time:function(ts,isFull) { | ||
6 | + var d = getDate(ts*1000) | ||
7 | + var fm=[d.getFullYear(), d.getMonth()+1, d.getDate()].join('-'); | ||
8 | + if(isFull==1) | ||
9 | + fm=fm + ' '+ [d.getHours(), d.getMinutes(), d.getSeconds()].join(':') | ||
10 | + return fm; | ||
11 | + }, | ||
12 | + setcolor:function(ind){ | ||
13 | + if (ind == 0 || ind ==null) return "red"; | ||
14 | + if(ind==1 ) return "green"; | ||
15 | + if(ind==2) return "blue"; | ||
16 | + if(ind==11) return "green"; | ||
17 | + if(ind==12) return "blue"; | ||
18 | + return ""; | ||
19 | + }, | ||
20 | + setbgcolor: function (ind) { | ||
21 | + if (ind == 0 || ind == null) return "#ffa1b9"; | ||
22 | + if (ind == 1) return "#59e1d2"; | ||
23 | + if (ind == 2) return "#a3bcff"; | ||
24 | + if (ind == 11) return "#59e1d2"; | ||
25 | + if (ind == 12) return "#a3bcff"; | ||
26 | + return ""; | ||
27 | + }, | ||
28 | + | ||
29 | + get_type:function(ind){ | ||
30 | + if (ind == 0 || ind == null) return "全场通用"; | ||
31 | + if (ind == 1) return "品牌"; | ||
32 | + if (ind == 2) return "品类"; | ||
33 | + if (ind == 11) return "用途"; | ||
34 | + if (ind == 12) return "分类1"; | ||
35 | + return ""; | ||
36 | + }, | ||
37 | + get_type_card:function(ind){ | ||
38 | + if (ind == 0 || ind == null) return "全场通用"; | ||
39 | + if (ind == 1) return "指定品牌"; | ||
40 | + if (ind == 2) return "指定品类"; | ||
41 | + if (ind == 11) return "指定用途"; | ||
42 | + if (ind == 12) return "指定分类1"; | ||
43 | + return ""; | ||
44 | + }, | ||
45 | + format_huiche:function (text) { | ||
46 | + if (!text) { | ||
47 | + return ""; | ||
48 | + } | ||
49 | + var reg = getRegExp('\\\\n', 'g') | ||
50 | + return text.replace(reg, '\n') | ||
51 | + } | ||
52 | +} | ||
53 | + | ||
54 | +module.exports = { | ||
55 | + toFix: filters.toFix, | ||
56 | + format_time:filters.format_time, | ||
57 | + setcolor:filters.setcolor, | ||
58 | + setbgcolor: filters.setbgcolor, | ||
59 | + get_type: filters.get_type, | ||
60 | + get_split_name: filters.get_split_name, | ||
61 | + get_type_card: filters.get_type_card, | ||
62 | + format_huiche: filters.format_huiche, | ||
63 | +} | ||
0 | \ No newline at end of file | 64 | \ No newline at end of file |
pages/cart/cart2/cart2.js
@@ -2,10 +2,11 @@ var t = getApp(),app=t, a = t.request, e = require("../../../utils/common.js"), | @@ -2,10 +2,11 @@ var t = getApp(),app=t, a = t.request, e = require("../../../utils/common.js"), | ||
2 | s = require("../../../utils/util.js"), o = require("../../../utils/md5.js"), to = getApp(); | 2 | s = require("../../../utils/util.js"), o = require("../../../utils/md5.js"), to = getApp(); |
3 | var oo=t.globalData.setting; | 3 | var oo=t.globalData.setting; |
4 | var regeneratorRuntime = require('../../../utils/runtime.js'); | 4 | var regeneratorRuntime = require('../../../utils/runtime.js'); |
5 | +var util_pay = require("../../../utils/pay.js"); | ||
5 | 6 | ||
6 | -Page({ | 7 | +Page({ |
7 | data: { | 8 | data: { |
8 | - url: t.globalData.setting.url, | 9 | + url: t.globalData.setting.url, |
9 | resourceUrl: t.globalData.setting.resourceUrl, | 10 | resourceUrl: t.globalData.setting.resourceUrl, |
10 | imgUrl: t.globalData.setting.imghost, | 11 | imgUrl: t.globalData.setting.imghost, |
11 | goods: null, | 12 | goods: null, |
@@ -51,6 +52,7 @@ Page({ | @@ -51,6 +52,7 @@ Page({ | ||
51 | /*----------物流选择--------*/ | 52 | /*----------物流选择--------*/ |
52 | wu_arr:null, | 53 | wu_arr:null, |
53 | index:0, | 54 | index:0, |
55 | + w_sele_index:0, | ||
54 | 56 | ||
55 | //判断页面是返回回来的还是 首次进入的 | 57 | //判断页面是返回回来的还是 首次进入的 |
56 | isclose:1, | 58 | isclose:1, |
@@ -71,10 +73,17 @@ Page({ | @@ -71,10 +73,17 @@ Page({ | ||
71 | //选择的券列表 | 73 | //选择的券列表 |
72 | selected_quan_list:null, | 74 | selected_quan_list:null, |
73 | //选择的券的门店 | 75 | //选择的券的门店 |
74 | - selected_quan_pick:null, | 76 | + selected_quan_pick:null, |
75 | is_close_quan:0, | 77 | is_close_quan:0, |
76 | disabled:0, | 78 | disabled:0, |
77 | - | 79 | + open_express:0,//控制选择物流名列表 的属性 |
80 | + | ||
81 | + is_express:0, //选中物流的属性 | ||
82 | + expres_name:"", //点击选定 | ||
83 | + isopen:0, //券的说明 | ||
84 | + is_coupon:null, //选择券的控制属性 | ||
85 | + is_shipping_code:"",//插入用户默认地址 | ||
86 | + wu_arr_txt:"", //要更新的物流的字段 | ||
78 | }, | 87 | }, |
79 | onLoad: function(t) { | 88 | onLoad: function(t) { |
80 | 89 | ||
@@ -89,21 +98,20 @@ Page({ | @@ -89,21 +98,20 @@ Page({ | ||
89 | } | 98 | } |
90 | }); | 99 | }); |
91 | 100 | ||
92 | - //先获取是否有关闭使用优惠券 | ||
93 | - getApp().getConfig2(function (ee) { | ||
94 | - var json_d = JSON.parse(ee.switch_list); | ||
95 | - th.setData({ is_close_quan: json_d.is_close_quan }); | ||
96 | - //-----先获取物流,再获取用户信息,再展示页面----- | ||
97 | - th.get_wuliu(th.get_info(th.show_page)); | ||
98 | - }) | 101 | + //先获取是否有关闭使用优惠券 |
102 | + getApp().getConfig2(function (ee) { | ||
103 | + var json_d = JSON.parse(ee.switch_list); | ||
104 | + th.setData({ is_close_quan: json_d.is_close_quan }); | ||
105 | + //-----先获取物流,再获取用户信息,再展示页面----- | ||
106 | + th.get_wuliu(th.get_info(th.show_page)); | ||
107 | + }) | ||
108 | + | ||
99 | }, | 109 | }, |
100 | onUnload: function () { this.setData({ isclose: 1 })}, | 110 | onUnload: function () { this.setData({ isclose: 1 })}, |
101 | 111 | ||
102 | //----------子页返回父页触发---------- | 112 | //----------子页返回父页触发---------- |
103 | onShow: function() { | 113 | onShow: function() { |
104 | - console.log('onshow'); | ||
105 | var th=this; | 114 | var th=this; |
106 | - console.log(th.data.isclose); | ||
107 | if (th.data.isclose==0){ | 115 | if (th.data.isclose==0){ |
108 | /*--- | 116 | /*--- |
109 | wx.navigateTo({ | 117 | wx.navigateTo({ |
@@ -115,7 +123,7 @@ Page({ | @@ -115,7 +123,7 @@ Page({ | ||
115 | }) | 123 | }) |
116 | 124 | ||
117 | }else{ | 125 | }else{ |
118 | - this.getuser_addr(function(ie){ | 126 | + this.getuser_addr(function(ie){ |
119 | 127 | ||
120 | console.log("getuser_addr") | 128 | console.log("getuser_addr") |
121 | console.log(ie) | 129 | console.log(ie) |
@@ -137,15 +145,20 @@ Page({ | @@ -137,15 +145,20 @@ Page({ | ||
137 | },500) | 145 | },500) |
138 | 146 | ||
139 | }); | 147 | }); |
148 | + //--更新默认地址--,看一下是不是跳到地址页面 | ||
149 | + if(!getApp().globalData.is_cart2_old){ | ||
150 | + this.update_code(); | ||
151 | + }else{ | ||
152 | + getApp().globalData.is_cart2_old=0; | ||
153 | + } | ||
140 | } | 154 | } |
141 | }, | 155 | }, |
142 | 156 | ||
143 | //-------------------获取物流--------------- | 157 | //-------------------获取物流--------------- |
144 | get_wuliu(func) { | 158 | get_wuliu(func) { |
159 | + | ||
145 | var th = this; | 160 | var th = this; |
146 | to.getwuliu(function (e) { | 161 | to.getwuliu(function (e) { |
147 | - console.log("ws"); | ||
148 | - console.log(e); | ||
149 | th.setData({ wu_arr: e }) | 162 | th.setData({ wu_arr: e }) |
150 | typeof func == "function" && func(); | 163 | typeof func == "function" && func(); |
151 | }) | 164 | }) |
@@ -223,7 +236,7 @@ Page({ | @@ -223,7 +236,7 @@ Page({ | ||
223 | }); | 236 | }); |
224 | }, | 237 | }, |
225 | 238 | ||
226 | - //-----真的获取购物车-------- | 239 | + //-----真的获取购物车,入口-------- |
227 | get_cart: function () { | 240 | get_cart: function () { |
228 | var th = this,app=getApp(); | 241 | var th = this,app=getApp(); |
229 | a.get("/api/weshop/cart/list", { | 242 | a.get("/api/weshop/cart/list", { |
@@ -277,9 +290,17 @@ Page({ | @@ -277,9 +290,17 @@ Page({ | ||
277 | //如果是物流的话,全部自提的控制要弄成0 | 290 | //如果是物流的话,全部自提的控制要弄成0 |
278 | if (e_t == 0) th.setData({ is_all_zt:0}); | 291 | if (e_t == 0) th.setData({ is_all_zt:0}); |
279 | var narr = new Array(); narr.push(item); | 292 | var narr = new Array(); narr.push(item); |
280 | - //-----------拼装购物车结算的数组----------------- | 293 | + |
294 | + //-----------拼装购物车结算的数组,如果有默认物流时要用默认物流编号----------------- | ||
295 | + var m_wind=0,def_exp_code=getApp().globalData.userInfo.def_exp_code; | ||
296 | + if(e_t==0 && def_exp_code){ | ||
297 | + for(var k=0;k<th.data.wu_arr.length;k++){ | ||
298 | + var item=th.data.wu_arr[k]; if(def_exp_code==item.code){ m_wind=k; } | ||
299 | + } | ||
300 | + } | ||
301 | + | ||
281 | var ie = { | 302 | var ie = { |
282 | - pickup_id: pcid, pname: pikname, goods: narr, exp_type: e_t, wind: 0, distr_t: dis_t, | 303 | + pickup_id: pcid, pname: pikname, goods: narr, exp_type: e_t, wind: m_wind, distr_t: dis_t, |
283 | goods_price: 0, shipping_price: 0, user_money: 0, total_amount: 0, order_amount: 0, user_note:0}; | 304 | goods_price: 0, shipping_price: 0, user_money: 0, total_amount: 0, order_amount: 0, user_note:0}; |
284 | arr.push(ie); | 305 | arr.push(ie); |
285 | } | 306 | } |
@@ -356,7 +377,7 @@ Page({ | @@ -356,7 +377,7 @@ Page({ | ||
356 | }); | 377 | }); |
357 | }, | 378 | }, |
358 | 379 | ||
359 | - //-----获取立即购买的商品信息---- | 380 | + //-----获取立即购买的商品信息,入口---- |
360 | get_buy_goods: function (e){ | 381 | get_buy_goods: function (e){ |
361 | var th=this; | 382 | var th=this; |
362 | var gg = to.get_b_now(); | 383 | var gg = to.get_b_now(); |
@@ -380,6 +401,14 @@ Page({ | @@ -380,6 +401,14 @@ Page({ | ||
380 | case 2: et = 0; break; | 401 | case 2: et = 0; break; |
381 | } | 402 | } |
382 | 403 | ||
404 | + var m_wind=0,def_exp_code=getApp().globalData.userInfo.def_exp_code; | ||
405 | + if(et==0 && def_exp_code){ | ||
406 | + for(var k=0;k<th.data.wu_arr.length;k++){ | ||
407 | + var item=th.data.wu_arr[k]; if(def_exp_code==item.code){ m_wind=k; } | ||
408 | + } | ||
409 | + } | ||
410 | + | ||
411 | + | ||
383 | switch (gd.prom_type){ | 412 | switch (gd.prom_type){ |
384 | case 0: | 413 | case 0: |
385 | case 6: | 414 | case 6: |
@@ -399,6 +428,8 @@ Page({ | @@ -399,6 +428,8 @@ Page({ | ||
399 | }).then(res=>{ | 428 | }).then(res=>{ |
400 | if(res.data.code==0) | 429 | if(res.data.code==0) |
401 | quanlist=res.data.data.pageData; | 430 | quanlist=res.data.data.pageData; |
431 | + | ||
432 | + | ||
402 | }) | 433 | }) |
403 | } | 434 | } |
404 | 435 | ||
@@ -416,9 +447,9 @@ Page({ | @@ -416,9 +447,9 @@ Page({ | ||
416 | 447 | ||
417 | t.data.data.prom_id = 0; | 448 | t.data.data.prom_id = 0; |
418 | t.data.data.prom_type = 0; | 449 | t.data.data.prom_type = 0; |
419 | - | 450 | + |
420 | th.setData({ | 451 | th.setData({ |
421 | - bn_goods: t.data.data, bn_pickname: gg.pick_name, bn_exp_type: et, | 452 | + bn_goods: t.data.data, bn_pickname: gg.pick_name, bn_exp_type: et,index:m_wind, |
422 | bn_pick: gg.pick_id, bn_t_exp_t: distr_t,selected_quan_list:quanlist | 453 | bn_pick: gg.pick_id, bn_t_exp_t: distr_t,selected_quan_list:quanlist |
423 | }); | 454 | }); |
424 | //计算价格 | 455 | //计算价格 |
@@ -462,8 +493,9 @@ Page({ | @@ -462,8 +493,9 @@ Page({ | ||
462 | } | 493 | } |
463 | } | 494 | } |
464 | } | 495 | } |
496 | + | ||
465 | th.setData({ | 497 | th.setData({ |
466 | - bn_goods: t.data.data, bn_pickname: gg.pick_name, bn_exp_type: et, | 498 | + bn_goods: t.data.data, bn_pickname: gg.pick_name, bn_exp_type: et,index:m_wind, |
467 | bn_pick: gg.pick_id, bn_t_exp_t: distr_t,selected_quan_list:quanlist | 499 | bn_pick: gg.pick_id, bn_t_exp_t: distr_t,selected_quan_list:quanlist |
468 | }); | 500 | }); |
469 | //计算价格 | 501 | //计算价格 |
@@ -574,8 +606,7 @@ Page({ | @@ -574,8 +606,7 @@ Page({ | ||
574 | th.data.cartlist[i].shipping_price=0; | 606 | th.data.cartlist[i].shipping_price=0; |
575 | } | 607 | } |
576 | 608 | ||
577 | - th.data.cartlist[i].shipping_price.toFixed(2); | ||
578 | - | 609 | + th.data.cartlist[i].shipping_price=th.data.cartlist[i].shipping_price.toFixed(2); |
579 | //---如果有选择优惠券的情况下--- | 610 | //---如果有选择优惠券的情况下--- |
580 | var quan_price=0; | 611 | var quan_price=0; |
581 | var coupon_price=0,bn_pick=th.data.bn_pick,pickid=cart_item.pickup_id; | 612 | var coupon_price=0,bn_pick=th.data.bn_pick,pickid=cart_item.pickup_id; |
@@ -627,7 +658,7 @@ Page({ | @@ -627,7 +658,7 @@ Page({ | ||
627 | } | 658 | } |
628 | }else{ | 659 | }else{ |
629 | th.data.cartlist[i].user_money=0; | 660 | th.data.cartlist[i].user_money=0; |
630 | - } | 661 | + } |
631 | 662 | ||
632 | th.data.cartlist[i].user_money = parseFloat(th.data.cartlist[i].user_money).toFixed(2); | 663 | th.data.cartlist[i].user_money = parseFloat(th.data.cartlist[i].user_money).toFixed(2); |
633 | 664 | ||
@@ -637,16 +668,17 @@ Page({ | @@ -637,16 +668,17 @@ Page({ | ||
637 | th.data.cartlist[i].goods_price = o_price.toFixed(2); | 668 | th.data.cartlist[i].goods_price = o_price.toFixed(2); |
638 | th.data.cartlist[i].order_amount= th.data.cartlist[i].order_amount- th.data.cartlist[i].user_money; //会员使用余额 | 669 | th.data.cartlist[i].order_amount= th.data.cartlist[i].order_amount- th.data.cartlist[i].user_money; //会员使用余额 |
639 | 670 | ||
640 | - all_price += parseFloat(o_price); | ||
641 | - all_total_m += parseFloat(th.data.cartlist[i].total_amount); | ||
642 | - all_shipping_m += parseFloat(th.data.cartlist[i].shipping_price); | ||
643 | - all_order_m += parseFloat(th.data.cartlist[i].order_amount); | ||
644 | - all_user_m += parseFloat(th.data.cartlist[i].user_money); | ||
645 | - all_coupon_price_m+= parseFloat(th.data.cartlist[i].coupon_price); | ||
646 | 671 | ||
672 | + all_price += parseFloat(o_price); | ||
673 | + all_total_m += parseFloat(th.data.cartlist[i].total_amount); | ||
674 | + all_shipping_m += parseFloat(th.data.cartlist[i].shipping_price); | ||
675 | + all_order_m += parseFloat(th.data.cartlist[i].order_amount); | ||
676 | + all_user_m += parseFloat(th.data.cartlist[i].user_money); | ||
677 | + all_coupon_price_m+= parseFloat(th.data.cartlist[i].coupon_price); | ||
647 | 678 | ||
648 | } | 679 | } |
649 | 680 | ||
681 | + all_shipping_m=parseFloat(all_shipping_m).toFixed(2); | ||
650 | all_total_m = parseFloat(all_total_m).toFixed(2); | 682 | all_total_m = parseFloat(all_total_m).toFixed(2); |
651 | all_order_m = parseFloat(all_order_m).toFixed(2); | 683 | all_order_m = parseFloat(all_order_m).toFixed(2); |
652 | all_price = parseFloat(all_price).toFixed(2); | 684 | all_price = parseFloat(all_price).toFixed(2); |
@@ -758,6 +790,7 @@ Page({ | @@ -758,6 +790,7 @@ Page({ | ||
758 | //--------------如果使用余额--------------------- | 790 | //--------------如果使用余额--------------------- |
759 | if (th.data.bn_use_money == 1) { | 791 | if (th.data.bn_use_money == 1) { |
760 | if (amoney> order_m) { | 792 | if (amoney> order_m) { |
793 | + order_m = order_m.toFixed(2); | ||
761 | th.setData({ [txt]: order_m, [txt2]:0,[txt3]:coupon_price }) | 794 | th.setData({ [txt]: order_m, [txt2]:0,[txt3]:coupon_price }) |
762 | }else{ | 795 | }else{ |
763 | order_m =parseFloat(order_m - amoney); | 796 | order_m =parseFloat(order_m - amoney); |
@@ -949,6 +982,7 @@ Page({ | @@ -949,6 +982,7 @@ Page({ | ||
949 | } | 982 | } |
950 | console.log(pdata); | 983 | console.log(pdata); |
951 | } | 984 | } |
985 | + | ||
952 | if (pdata.length==0) return; | 986 | if (pdata.length==0) return; |
953 | var str = JSON.stringify(pdata); | 987 | var str = JSON.stringify(pdata); |
954 | wx.showLoading({title: "加载中"}); | 988 | wx.showLoading({title: "加载中"}); |
@@ -983,9 +1017,24 @@ Page({ | @@ -983,9 +1017,24 @@ Page({ | ||
983 | //要进行判断,如果是用微信支付,就要跳转到支付界面 | 1017 | //要进行判断,如果是用微信支付,就要跳转到支付界面 |
984 | if (order_amount > 0) { | 1018 | if (order_amount > 0) { |
985 | th.setData({ isclose: 0 }); | 1019 | th.setData({ isclose: 0 }); |
986 | - void e.jumpToCart4({ | ||
987 | - order_sn: data.data, | ||
988 | - }, 1); | 1020 | + //void e.jumpToCart4({ |
1021 | + // order_sn: data.data, | ||
1022 | + //}, 1); | ||
1023 | + util_pay.pay(data.data, function() { | ||
1024 | + //app.my_warnning("支付成功",1,th); | ||
1025 | + //setTimeout(function () { | ||
1026 | + wx.navigateTo({ | ||
1027 | + url: "/pages/payment/pay_success/pay_success?type=2&order_sn="+data.data | ||
1028 | + }) | ||
1029 | + //},1000) | ||
1030 | + | ||
1031 | + }, function () { | ||
1032 | + //支付失败 | ||
1033 | + setTimeout(function () { | ||
1034 | + wx.navigateBack({ delta: 1 }) | ||
1035 | + },1000) | ||
1036 | + },oo.stoid); | ||
1037 | + | ||
989 | } else { | 1038 | } else { |
990 | var dd = { | 1039 | var dd = { |
991 | parent_sn: data.data, | 1040 | parent_sn: data.data, |
@@ -997,13 +1046,13 @@ Page({ | @@ -997,13 +1046,13 @@ Page({ | ||
997 | success: function (t) { | 1046 | success: function (t) { |
998 | //console.log(t); | 1047 | //console.log(t); |
999 | if(t.data.code==0){ | 1048 | if(t.data.code==0){ |
1000 | - app.my_warnning("支付成功",1,th); | ||
1001 | - setTimeout(function () { | 1049 | + //app.my_warnning("支付成功",1,th); |
1050 | + //setTimeout(function () { | ||
1002 | th.setData({ isclose: 0 }); | 1051 | th.setData({ isclose: 0 }); |
1003 | wx.navigateTo({ | 1052 | wx.navigateTo({ |
1004 | - url: "/pages/user/order_list/order_list" | 1053 | + url: "/pages/payment/pay_success/pay_success?type=2&order_sn="+data.data, |
1005 | }) | 1054 | }) |
1006 | - }, 1000) | 1055 | + //}, 1000) |
1007 | } | 1056 | } |
1008 | }, | 1057 | }, |
1009 | fail:function () { | 1058 | fail:function () { |
@@ -1049,17 +1098,22 @@ Page({ | @@ -1049,17 +1098,22 @@ Page({ | ||
1049 | }); | 1098 | }); |
1050 | }, | 1099 | }, |
1051 | enterAddressPage: function() { | 1100 | enterAddressPage: function() { |
1101 | + getApp().globalData.is_cart_old=1; | ||
1052 | this.data.enterAddressPage = !0, wx.navigateTo({ | 1102 | this.data.enterAddressPage = !0, wx.navigateTo({ |
1053 | - url: "/pages/user/address_list/address_list?is_back=1" | 1103 | + url: "/pages/user/address_list/address_list" |
1054 | }); | 1104 | }); |
1055 | }, | 1105 | }, |
1056 | 1106 | ||
1057 | - //--------立即购买时,选择自提和物流----------- | 1107 | + //--------购物车购买时,选择自提和物流----------- |
1058 | setexptype_w:function(t){ | 1108 | setexptype_w:function(t){ |
1059 | - var th=this; | ||
1060 | - var ty = t.currentTarget.dataset.t,txt = t.currentTarget.dataset.txt; | 1109 | + var def_exp_code= getApp().globalData.userInfo.def_exp_code,th=this; |
1110 | + var ty = t.currentTarget.dataset.t, txt = t.currentTarget.dataset.txt, | ||
1111 | + wl_txt = t.currentTarget.dataset.wl_txt, | ||
1112 | + ont = t.currentTarget.dataset.ont; | ||
1113 | + | ||
1061 | th.setData({ [txt]: ty }); | 1114 | th.setData({ [txt]: ty }); |
1062 | var iszt=1; | 1115 | var iszt=1; |
1116 | + | ||
1063 | if(ty==0){ | 1117 | if(ty==0){ |
1064 | th.setData({ is_all_zt: 0 }); | 1118 | th.setData({ is_all_zt: 0 }); |
1065 | }else{ | 1119 | }else{ |
@@ -1067,22 +1121,48 @@ Page({ | @@ -1067,22 +1121,48 @@ Page({ | ||
1067 | var item = th.data.cartlist[i]; | 1121 | var item = th.data.cartlist[i]; |
1068 | if (item.exp_type==0){ iszt=0;break;} | 1122 | if (item.exp_type==0){ iszt=0;break;} |
1069 | } | 1123 | } |
1124 | + | ||
1070 | th.setData({ is_all_zt: iszt }); | 1125 | th.setData({ is_all_zt: iszt }); |
1071 | } | 1126 | } |
1127 | + //判断有没有默认的物流地址值 | ||
1128 | + if (def_exp_code != "" && def_exp_code != null && def_exp_code !=undefined) { | ||
1129 | + var wu_arr=this.data.wu_arr; | ||
1130 | + if (wu_arr!= null && wu_arr!=""){ | ||
1131 | + for(var i=0;i<wu_arr.length;i++){ | ||
1132 | + if (wu_arr[i].shipping_code == def_exp_code){ | ||
1133 | + var set_txt="cartlist" | ||
1134 | + th.setData({wl_txt:i}); | ||
1135 | + } | ||
1136 | + } | ||
1137 | + } | ||
1138 | + } | ||
1072 | //----计算此时购物车的价格---- | 1139 | //----计算此时购物车的价格---- |
1073 | th.calculatePrice(); | 1140 | th.calculatePrice(); |
1074 | }, | 1141 | }, |
1142 | + | ||
1075 | //--------立即购买时,选择自提和物流---------- | 1143 | //--------立即购买时,选择自提和物流---------- |
1076 | setexptype:function(t){ | 1144 | setexptype:function(t){ |
1077 | var th=this; | 1145 | var th=this; |
1078 | - var ty = t.currentTarget.dataset.t; | 1146 | + var ty = t.currentTarget.dataset.t,def_exp_code= getApp().globalData.userInfo.def_exp_code; |
1079 | th.setData({ bn_exp_type:ty}); | 1147 | th.setData({ bn_exp_type:ty}); |
1080 | //当物流为空的时候。 | 1148 | //当物流为空的时候。 |
1081 | if (ty == 0 && th.data.wu_arr==null){ | 1149 | if (ty == 0 && th.data.wu_arr==null){ |
1082 | return th.get_wuliu(th.calculatePrice2()); | 1150 | return th.get_wuliu(th.calculatePrice2()); |
1083 | } | 1151 | } |
1084 | - th.calculatePrice2() | ||
1085 | - console.log('setexptype'); | 1152 | + |
1153 | + //判断有没有默认的物流地址值 | ||
1154 | + if (def_exp_code != "" && def_exp_code != null && def_exp_code !=undefined) { | ||
1155 | + var wu_arr=this.data.wu_arr; | ||
1156 | + if (wu_arr!= null && wu_arr!=""){ | ||
1157 | + for(var i=0;i<wu_arr.length;i++){ | ||
1158 | + if (wu_arr[i].shipping_code == def_exp_code){ | ||
1159 | + th.setData({index:i}); | ||
1160 | + } | ||
1161 | + } | ||
1162 | + } | ||
1163 | + } | ||
1164 | + th.calculatePrice2() | ||
1165 | + | ||
1086 | }, | 1166 | }, |
1087 | 1167 | ||
1088 | //--------立即购买时,使用余额-------- | 1168 | //--------立即购买时,使用余额-------- |
@@ -1184,6 +1264,7 @@ Page({ | @@ -1184,6 +1264,7 @@ Page({ | ||
1184 | var is_using= th.check_in_sele(quanlist[i].CashRepNo,pickid); | 1264 | var is_using= th.check_in_sele(quanlist[i].CashRepNo,pickid); |
1185 | if(is_using) quanlist[i].is_using=1; | 1265 | if(is_using) quanlist[i].is_using=1; |
1186 | } | 1266 | } |
1267 | + console.log("2222222券的列表", quanlist); | ||
1187 | th.setData({open_quan:1,selected_quan_pick:pickid,selected_quan_list:quanlist,disabled:1}); | 1268 | th.setData({open_quan:1,selected_quan_pick:pickid,selected_quan_list:quanlist,disabled:1}); |
1188 | } | 1269 | } |
1189 | }, | 1270 | }, |
@@ -1209,8 +1290,7 @@ Page({ | @@ -1209,8 +1290,7 @@ Page({ | ||
1209 | 1290 | ||
1210 | /*--点击选择券--*/ | 1291 | /*--点击选择券--*/ |
1211 | sele_quan_item:function(e) { | 1292 | sele_quan_item:function(e) { |
1212 | - var no_use=e.currentTarget.dataset.no, quanlist=this.data.selected_quan_list; | ||
1213 | - | 1293 | + var no_use=e.currentTarget.dataset.no, quanlist=this.data.selected_quan_list; |
1214 | //---所有的券的显示红色选择都清理一遍--- | 1294 | //---所有的券的显示红色选择都清理一遍--- |
1215 | for(var ind in quanlist){ | 1295 | for(var ind in quanlist){ |
1216 | quanlist[ind].show_red=0; | 1296 | quanlist[ind].show_red=0; |
@@ -1218,29 +1298,31 @@ Page({ | @@ -1218,29 +1298,31 @@ Page({ | ||
1218 | this.setData({selected_quan_list:quanlist}); | 1298 | this.setData({selected_quan_list:quanlist}); |
1219 | var using_quan=this.data.using_quan; | 1299 | var using_quan=this.data.using_quan; |
1220 | var th=this; | 1300 | var th=this; |
1221 | - | ||
1222 | //---如果是不使用优惠券--- | 1301 | //---如果是不使用优惠券--- |
1223 | if(no_use==1){ | 1302 | if(no_use==1){ |
1303 | + console.log("有进来吗券", no_use); | ||
1224 | if(using_quan[th.data.selected_quan_pick]){ | 1304 | if(using_quan[th.data.selected_quan_pick]){ |
1225 | using_quan[th.data.selected_quan_pick].is_nouse_red=1; | 1305 | using_quan[th.data.selected_quan_pick].is_nouse_red=1; |
1226 | } | 1306 | } |
1227 | else{ | 1307 | else{ |
1228 | using_quan[th.data.selected_quan_pick] ={is_nouse_red:1}; | 1308 | using_quan[th.data.selected_quan_pick] ={is_nouse_red:1}; |
1229 | } | 1309 | } |
1230 | - this.setData({using_quan:using_quan}); | 1310 | + this.setData({ using_quan: using_quan, is_coupon:2222}); |
1231 | return; | 1311 | return; |
1232 | } | 1312 | } |
1233 | 1313 | ||
1234 | var ind = e.currentTarget.dataset.ind; | 1314 | var ind = e.currentTarget.dataset.ind; |
1315 | + | ||
1235 | var quan_item = this.data.selected_quan_list[ind]; | 1316 | var quan_item = this.data.selected_quan_list[ind]; |
1236 | var txt = "selected_quan_list[" + ind + "].show_red"; | 1317 | var txt = "selected_quan_list[" + ind + "].show_red"; |
1318 | + | ||
1237 | var obj = {}; | 1319 | var obj = {}; |
1238 | obj[txt] = 1; | 1320 | obj[txt] = 1; |
1239 | if (quan_item.show_red) { | 1321 | if (quan_item.show_red) { |
1240 | obj[txt] = 0; | 1322 | obj[txt] = 0; |
1241 | } | 1323 | } |
1242 | this.setData(obj); | 1324 | this.setData(obj); |
1243 | - | 1325 | + console.log(this.data.selected_quan_list, "选中的券的下标", quan_item, "数据都在这里", txt); |
1244 | if(using_quan[th.data.selected_quan_pick]){ | 1326 | if(using_quan[th.data.selected_quan_pick]){ |
1245 | using_quan[th.data.selected_quan_pick].is_nouse_red=0; | 1327 | using_quan[th.data.selected_quan_pick].is_nouse_red=0; |
1246 | } | 1328 | } |
@@ -1253,14 +1335,18 @@ Page({ | @@ -1253,14 +1335,18 @@ Page({ | ||
1253 | 1335 | ||
1254 | //--确认使用券--- | 1336 | //--确认使用券--- |
1255 | confirm_quan:function () { | 1337 | confirm_quan:function () { |
1256 | - console.log(1111); | 1338 | + |
1257 | var using_quan=this.data.using_quan,pickid=this.data.selected_quan_pick; | 1339 | var using_quan=this.data.using_quan,pickid=this.data.selected_quan_pick; |
1258 | var th=this,selected_quan_list=this.data.selected_quan_list; | 1340 | var th=this,selected_quan_list=this.data.selected_quan_list; |
1259 | //选择了的券 | 1341 | //选择了的券 |
1260 | var sele_quan=null; | 1342 | var sele_quan=null; |
1343 | + console.log(selected_quan_list, "确认使用券"); | ||
1261 | for(var i in selected_quan_list){ | 1344 | for(var i in selected_quan_list){ |
1345 | + | ||
1262 | var item=selected_quan_list[i]; | 1346 | var item=selected_quan_list[i]; |
1347 | + console.log(item, "确认使用券",item.show_red); | ||
1263 | if(item.show_red) { | 1348 | if(item.show_red) { |
1349 | + console.log(item.show_red, "确定的券7"); | ||
1264 | th.insert_into_using_quan(item,using_quan,pickid); | 1350 | th.insert_into_using_quan(item,using_quan,pickid); |
1265 | return; | 1351 | return; |
1266 | } | 1352 | } |
@@ -1306,6 +1392,7 @@ Page({ | @@ -1306,6 +1392,7 @@ Page({ | ||
1306 | 1392 | ||
1307 | //--验证是否已经冻结-- | 1393 | //--验证是否已经冻结-- |
1308 | check_is_frozenQuan:function(quanlist,frozenQuan){ | 1394 | check_is_frozenQuan:function(quanlist,frozenQuan){ |
1395 | + console.log("券列表",quanlist); | ||
1309 | var arr=[]; | 1396 | var arr=[]; |
1310 | for(var i=0;i<quanlist.length;i++){ | 1397 | for(var i=0;i<quanlist.length;i++){ |
1311 | var item=quanlist[i]; | 1398 | var item=quanlist[i]; |
@@ -1321,6 +1408,111 @@ Page({ | @@ -1321,6 +1408,111 @@ Page({ | ||
1321 | 1408 | ||
1322 | } | 1409 | } |
1323 | return arr; | 1410 | return arr; |
1411 | + }, | ||
1412 | + | ||
1413 | + //// 开启物流的弹窗 | ||
1414 | + show_wu_arr:function(e){ | ||
1415 | + var wu_arr_txt=e.currentTarget.dataset.txt; | ||
1416 | + var w_sele_index=e.currentTarget.dataset.w_sele_index; | ||
1417 | + var is_express=null; | ||
1418 | + var ob={open_express: 1,wu_arr_txt:wu_arr_txt,disabled:1}; | ||
1419 | + | ||
1420 | + //--如果是多个门店的时候-- | ||
1421 | + if(w_sele_index!=undefined){ | ||
1422 | + is_express=this.data.cartlist[w_sele_index].wind; | ||
1423 | + ob['is_express']=is_express; | ||
1424 | + } | ||
1425 | + this.setData(ob); | ||
1426 | + }, | ||
1427 | + // 关闭物流的弹窗 | ||
1428 | + close_express:function(){ | ||
1429 | + this.setData({ open_express:0,disabled:0 }); | ||
1430 | + }, | ||
1431 | + // 选择物流 | ||
1432 | + click_express_name:function(e){ | ||
1433 | + var express_name = e.currentTarget.dataset.name, shippingcode = e.currentTarget.dataset.shippingcode; | ||
1434 | + var index=e.currentTarget.dataset.idxe; | ||
1435 | + var ob={ is_express: index, is_shipping_code: shippingcode,disabled:0}; | ||
1436 | + ob[this.data.wu_arr_txt]=index; | ||
1437 | + this.setData(ob); | ||
1438 | + }, | ||
1439 | + | ||
1440 | + //点击确定物流 | ||
1441 | + determine_expres:function(e){ | ||
1442 | + this.setData({ open_express: 0}); | ||
1443 | + if(this.data.is_b_now==1) | ||
1444 | + this.calculatePrice2(); | ||
1445 | + else | ||
1446 | + this.calculatePrice(); | ||
1447 | + }, | ||
1448 | + | ||
1449 | + //点击打开优惠券使用说明 | ||
1450 | + clik_coupons:function(e){ | ||
1451 | + var ind = e.currentTarget.dataset.idx; | ||
1452 | + var is_open = this.data.selected_quan_list[ind].is_open; | ||
1453 | + console.log(is_open,"是什么东西"); | ||
1454 | + if (is_open == 1) is_open = 0; | ||
1455 | + else is_open = 1; | ||
1456 | + | ||
1457 | + var txt = "selected_quan_list[" + ind + "].is_open" | ||
1458 | + var obj = {}; obj[txt] = is_open; | ||
1459 | + this.setData(obj); | ||
1460 | + this.setData({disabled:1}) | ||
1461 | + }, | ||
1462 | + //选择券 | ||
1463 | + sele_coupon:function(e){ | ||
1464 | + var ind = e.currentTarget.dataset.ind; | ||
1465 | + console.log("下标", ind); | ||
1466 | + this.setData({ is_coupon: ind}); | ||
1467 | + }, | ||
1468 | + | ||
1469 | + //设置默认物流 | ||
1470 | + select_default_logistics: function () { | ||
1471 | + var th=this; | ||
1472 | + var is_shipping_code=this.data.is_shipping_code | ||
1473 | + getApp().request.put("/api/weshop/users/update",{ | ||
1474 | + data: { user_id: getApp().globalData.user_id, store_id: oo.stoid, def_exp_code: is_shipping_code}, | ||
1475 | + success:function(rse){ | ||
1476 | + if (rse.data.code==0){ | ||
1477 | + getApp().globalData.userInfo.def_exp_code=is_shipping_code; | ||
1478 | + th.setData({ open_express: 0 }); | ||
1479 | + //----计算此时购物车的价格---- | ||
1480 | + if(th.data.is_b_now==1) th.calculatePrice2(); | ||
1481 | + else th.calculatePrice(); | ||
1482 | + } | ||
1483 | + } | ||
1484 | + }) | ||
1485 | + }, | ||
1486 | + | ||
1487 | + //更新下默认,在onshow里面 | ||
1488 | + update_code(){ | ||
1489 | + var th=this,m_wind=0,def_exp_code=getApp().globalData.userInfo.def_exp_code; | ||
1490 | + //--定时器,判断wu_arr不未空-- | ||
1491 | + var uii=setInterval(function () { | ||
1492 | + if(th.data.wu_arr) | ||
1493 | + { | ||
1494 | + clearInterval(uii); | ||
1495 | + for (var k = 0; k < th.data.wu_arr.length; k++) { | ||
1496 | + var item = th.data.wu_arr[k]; | ||
1497 | + if (def_exp_code == item.code) { m_wind = k; } | ||
1498 | + } | ||
1499 | + //--如果是立即购买-- | ||
1500 | + if (th.data.is_b_now == 1) { | ||
1501 | + th.setData({index: m_wind,is_express:m_wind}); | ||
1502 | + } else { | ||
1503 | + var ui = setInterval(function () { | ||
1504 | + if (th.data.cartlist) { | ||
1505 | + var c_arr = th.data.cartlist; | ||
1506 | + for (var i in c_arr) { | ||
1507 | + c_arr[i].wind = m_wind; | ||
1508 | + } | ||
1509 | + th.setData({cartlist: c_arr,is_express:m_wind}) | ||
1510 | + clearInterval(ui); | ||
1511 | + } | ||
1512 | + }, 500) | ||
1513 | + } | ||
1514 | + } | ||
1515 | + },500); | ||
1324 | } | 1516 | } |
1325 | 1517 | ||
1326 | 1518 |
pages/cart/cart2/cart2.wxml
1 | +<wxs module="filter" src="c_filter.wxs"></wxs> | ||
2 | +<wxs src="filter.wxs" module="util"></wxs> | ||
3 | +<wxs module="filters" src="../../../utils/filter.wxs"></wxs> | ||
1 | <wxs module="filters" src="../../../utils/filter.wxs"></wxs> | 4 | <wxs module="filters" src="../../../utils/filter.wxs"></wxs> |
2 | <form bindsubmit="submitForm"> | 5 | <form bindsubmit="submitForm"> |
3 | - <view class="container"> | ||
4 | - <!--要进行判断地址是否显示----> | 6 | + <view class="container"> |
7 | + <!--要进行判断地址是否显示----> | ||
5 | <view bindtap="enterAddressPage" class="user-mes" | 8 | <view bindtap="enterAddressPage" class="user-mes" |
6 | hidden='{{(bn_exp_type==1 && is_b_now==1) || (is_all_zt==1 && is_b_now==0)}}'> | 9 | hidden='{{(bn_exp_type==1 && is_b_now==1) || (is_all_zt==1 && is_b_now==0)}}'> |
7 | <!---默认地址显示------> | 10 | <!---默认地址显示------> |
8 | <block wx:if="{{user_addr!=null}}"> | 11 | <block wx:if="{{user_addr!=null}}"> |
9 | - <view class="user-contact">{{user_addr.consignee}}{{' '}}{{user_addr.mobile}}</view> | 12 | + |
13 | + <view class="user-contact"> | ||
14 | + <text>收货人:</text>{{user_addr.consignee}}{{' '}}{{user_addr.mobile}}</view> | ||
10 | <view class="location"> | 15 | <view class="location"> |
11 | <view class="address">{{user_addr.more_address}}{{' '}}{{user_addr.address}}</view> | 16 | <view class="address">{{user_addr.more_address}}{{' '}}{{user_addr.address}}</view> |
12 | <view class="pos-icon"> | 17 | <view class="pos-icon"> |
13 | - <image class="wh100" src="{{imgUrl}}/miniapp/images/iconfont-address.png"></image> | 18 | + <image class="wh100" src="{{imgUrl}}/miniapp/images/goodscategory/new_position.png"></image> |
14 | </view> | 19 | </view> |
15 | </view> | 20 | </view> |
16 | <view class="update-logistics"> | 21 | <view class="update-logistics"> |
17 | - <image class="arrow-rigth" src="{{imgUrl}}/miniapp/images/icon-arrowdown.png"></image> | 22 | + <!-- <image class="arrow-rigth" src="{{imgUrl}}/miniapp/images/new_position.png"></image> --> |
23 | + <view class="xc-right"></view> | ||
18 | </view> | 24 | </view> |
19 | </block> | 25 | </block> |
20 | <!---先增地址------> | 26 | <!---先增地址------> |
@@ -23,14 +29,16 @@ | @@ -23,14 +29,16 @@ | ||
23 | <image class="addr_jia" src="{{imgUrl}}/miniapp/images/jia.png"></image>添加地址 | 29 | <image class="addr_jia" src="{{imgUrl}}/miniapp/images/jia.png"></image>添加地址 |
24 | </view> | 30 | </view> |
25 | </block> | 31 | </block> |
26 | - <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> |
27 | </view> | 33 | </view> |
28 | 34 | ||
29 | <!---------------------购物车进来,有可能多单----------------------> | 35 | <!---------------------购物车进来,有可能多单----------------------> |
30 | <block wx:if="{{is_b_now==0}}"> | 36 | <block wx:if="{{is_b_now==0}}"> |
37 | + <view class="xc-border main-top"></view> | ||
31 | <view wx:for="{{cartlist}}" wx:for-index="pidx"> | 38 | <view wx:for="{{cartlist}}" wx:for-index="pidx"> |
32 | - <view class="use-item bfff"> | ||
33 | - <image class="dp" src='{{imgUrl}}/miniapp/images/dianpu.png'> </image> <view>门店:{{item.pname}}</view></view> | 39 | + <view class="use-item bfff"> |
40 | + | ||
41 | + <image class="dp" src='{{imgUrl}}/miniapp/images/goodscategory/new_store.png'> </image> <view>门店:{{item.pname}}</view></view> | ||
34 | <view class="order-detail" wx:for="{{item.goods}}" wx:for-index="idx" wx:for-item="items"> | 42 | <view class="order-detail" wx:for="{{item.goods}}" wx:for-index="idx" wx:for-item="items"> |
35 | <!----商品图片-----> | 43 | <!----商品图片-----> |
36 | <view class="goods-img"> | 44 | <view class="goods-img"> |
@@ -40,70 +48,116 @@ | @@ -40,70 +48,116 @@ | ||
40 | <!----商品名称规格----> | 48 | <!----商品名称规格----> |
41 | <navigator class="order-cont" url="/pages/goods/goodsInfo/goodsInfo?goods_id={{items.goods_id}}"> | 49 | <navigator class="order-cont" url="/pages/goods/goodsInfo/goodsInfo?goods_id={{items.goods_id}}"> |
42 | <view class="goods-name">{{items.goods_name}}</view> | 50 | <view class="goods-name">{{items.goods_name}}</view> |
43 | - <view class="goods-color"> | ||
44 | - <text wx:if="{{items.goods_spec!='' && items.goods_spec!=null }}">{{items.goods_spec}}/</text> | ||
45 | - {{items.goods_color==null?"":items.goods_color}} | 51 | + <!-- 商品属性 --> |
52 | + <view class="flex-vertical fs28 color-gray n_guige"> | ||
53 | + <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=='' ?"":"/"+items.goods_color}} | ||
56 | + </view> | ||
46 | </view> | 57 | </view> |
47 | - </navigator> | ||
48 | - <!-----商品名称规格------> | ||
49 | - <view class="order-num"> | ||
50 | - <view class="co-red">¥{{items.goods_price}}</view> | 58 | + |
59 | + | ||
60 | + <!-----商品名称规格------> | ||
61 | + <view class="order-num flex-space-between"> | ||
62 | + <view class="co-red">¥<text class="fs36">{{filters.toFix(items.goods_price,2)}}</text></view> | ||
51 | <view class="goods-num">x{{items.goods_num}}</view> | 63 | <view class="goods-num">x{{items.goods_num}}</view> |
52 | </view> | 64 | </view> |
65 | + </navigator> | ||
66 | + | ||
53 | </view> | 67 | </view> |
54 | 68 | ||
55 | <!-----使用优惠券------> | 69 | <!-----使用优惠券------> |
56 | <view class="xc-coupon-frame flex-center" data-bn="0" bindtap="open_coupon_list" | 70 | <view class="xc-coupon-frame flex-center" data-bn="0" bindtap="open_coupon_list" |
57 | wx:if="{{item.quan_list && item.quan_list.length>0 }}" data-cind="{{pidx}}" data-pickid="{{item.pickup_id}}"> | 71 | wx:if="{{item.quan_list && item.quan_list.length>0 }}" data-cind="{{pidx}}" data-pickid="{{item.pickup_id}}"> |
58 | <view class="work-frame flex-space-between"> | 72 | <view class="work-frame flex-space-between"> |
59 | - <view class="work">使用优惠券</view> | 73 | + <view class="work">优惠券</view> |
60 | <view class="xc-right-frame"> | 74 | <view class="xc-right-frame"> |
61 | <text wx:if="{{using_quan[item.pickup_id].is_nouse}}">不使用</text> | 75 | <text wx:if="{{using_quan[item.pickup_id].is_nouse}}">不使用</text> |
62 | - <text wx:if="{{using_quan[item.pickup_id].money}}">{{using_quan[item.pickup_id].money}}元优惠券</text> | 76 | + <text wx:if="{{using_quan[item.pickup_id].money}}">¥{{using_quan[item.pickup_id].money}}元优惠券</text> |
63 | <view class="xc-right"></view> | 77 | <view class="xc-right"></view> |
64 | </view> | 78 | </view> |
65 | </view> | 79 | </view> |
66 | </view> | 80 | </view> |
67 | 81 | ||
82 | + | ||
68 | <view class="set-mes"> | 83 | <view class="set-mes"> |
69 | - <view wx:if="{{order.store_prom}}"><icon color="#f23030" size="16" type="info"></icon>{{order.store_prom}} | 84 | + <view wx:if="{{order.store_prom}}"> |
85 | + <icon color="#f23030" size="16" type="info"></icon> | ||
86 | + {{order.store_prom}} | ||
70 | </view> | 87 | </view> |
71 | - <view class="use-item"> | ||
72 | - <view data-t='1' style="display:{{item.distr_t==2?'none':'flex'}};"> | ||
73 | - <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> | 88 | + <view class="use-item flex-space-between"> |
89 | + <view class="flex-vertical"> | ||
90 | + <view bindtap='setexptype_w' data-t='1' data-txt='cartlist[{{pidx}}].exp_type'style="display:{{item.distr_t==2?'none':'flex;align-items: center'}};"> | ||
91 | + <!-- <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> --> | ||
92 | + | ||
93 | + | ||
94 | + | ||
95 | + <block wx:if="{{item.exp_type==1}}"> | ||
96 | + <!-- <view class="circle white xc-hookt fs20 red-b sn"><text>Γ</text></view> --> | ||
97 | + <icon data-t='0' data-txt='cartlist[{{pidx}}].exp_type' color="red" size="16" type="success"></icon> | ||
98 | + </block> | ||
99 | + <block wx:else> | ||
100 | + <view class="circle xc-hookts on"></view> | ||
101 | + </block> | ||
74 | <view bindtap='setexptype_w' data-t='1' data-txt='cartlist[{{pidx}}].exp_type' class="yu_er">门店自提</view> | 102 | <view bindtap='setexptype_w' data-t='1' data-txt='cartlist[{{pidx}}].exp_type' class="yu_er">门店自提</view> |
75 | </view> | 103 | </view> |
76 | 104 | ||
77 | - <view data-t='0' style="display:{{item.distr_t==1?'none':'flex'}};"> | ||
78 | - <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> | ||
79 | - <view bindtap='setexptype_w' data-t='0' data-txt='cartlist[{{pidx}}].exp_type' class="yu_er">快递邮寄</view> | 105 | + <view data-t='0' data-txt='cartlist[{{pidx}}].exp_type' bindtap="setexptype_w" style="display:{{item.distr_t==1?'none':'flex;align-items: center'}};"> |
106 | + <!-- <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> --> | ||
107 | + <block wx:if="{{item.exp_type==0}}"> | ||
108 | + <!-- <view class="circle white xc-hookt fs20 red-b sn"><text>Γ</text></view> --> | ||
109 | + <icon data-t='0' data-txt='cartlist[{{pidx}}].exp_type' color="red" size="16" type="success"></icon> | ||
110 | + </block> | ||
111 | + <block wx:else> | ||
112 | + <view class="circle xc-hookts on"></view> | ||
113 | + </block> | ||
114 | + | ||
115 | + <view bindtap='setexptype_w' data-t='0' | ||
116 | + data-txt='cartlist[{{pidx}}].exp_type' | ||
117 | + data-wl_txt='cartlist[{{pidx}}].wind' | ||
118 | + class="yu_er">快递邮寄</view> | ||
80 | </view> | 119 | </view> |
120 | + </view> | ||
121 | + <block wx:if="{{item.exp_type==0}}"> | ||
122 | + <!-- 点击显示物流选择 --> | ||
123 | + <view class="flex-vertical" bindtap="show_wu_arr" data-txt='cartlist[{{pidx}}].wind' data-w_sele_index="{{pidx}}"> | ||
124 | + <view >{{wu_arr[item.wind].name}}</view><view class="xc-right"></view> | ||
125 | + </view> | ||
126 | + </block> | ||
81 | </view> | 127 | </view> |
82 | - <view class="use-item" hidden='{{item.exp_type==1}}'> | ||
83 | - <view>选择物流:</view> | ||
84 | - <picker bindchange="bindPickerChange_w" data-txt='cartlist[{{pidx}}].wind' value="{{item.wind}}" range="{{wu_arr}}" range-key="name"> | 128 | + |
129 | + <!-- <view bindtap="express_name" class="use-item" hidden='{{item.exp_type==1}}'> | ||
130 | + <view>选择物流:</view> --> | ||
131 | + <!-- <picker bindchange="bindPickerChange_w" data-txt='cartlist[{{pidx}}].wind' value="{{item.wind}}" range="{{wu_arr}}" range-key="name"> | ||
85 | <view >{{wu_arr[item.wind].name}}</view> | 132 | <view >{{wu_arr[item.wind].name}}</view> |
86 | - </picker> | ||
87 | - </view> | 133 | + </picker> --> |
134 | + <!-- </view> --> | ||
88 | </view> | 135 | </view> |
89 | - <view class="coupon-mes"> | ||
90 | - <view>用户备注(50字)</view> | 136 | + |
137 | + <!-- 留言 --> | ||
138 | + <view class="coupon-mes flex-vertical"> | ||
139 | + <view>留言</view> | ||
91 | <view class="leave-word"> | 140 | <view class="leave-word"> |
92 | - <textarea bindinput="keyUpChangeNum" disabled="{{disabled}}" class="word-box" maxlength="50" name="user_note_{{item.pickup_id}}"></textarea> | ||
93 | - <view class="max-word">{{maxWord}}/50</view> | 141 | + <input placeholder-class="fs28" placeholder='给商家留言,最多100字'bindinput="keyUpChangeNum" |
142 | + disabled="{{disabled}}" class="word-box" maxlength="100" name="user_note_{{item.pickup_id}}"></input> | ||
143 | + | ||
94 | </view> | 144 | </view> |
95 | </view> | 145 | </view> |
146 | + | ||
96 | </view> | 147 | </view> |
148 | + | ||
97 | <!-----使用余额------> | 149 | <!-----使用余额------> |
98 | <view class="set-mes" wx:if="{{yuer>0}}"> | 150 | <view class="set-mes" wx:if="{{yuer>0}}"> |
99 | - <view class="use-item" bindtap='set_js_useyuer'> | ||
100 | - <icon color="{{js_use_money?'red':'gray'}}" size="16" type="success"></icon> | ||
101 | - <view class="yu_er">使用余额 :¥{{yuer}} </view> | ||
102 | - </view> | 151 | + <view class="use-item" bindtap='set_js_useyuer'> |
152 | + <icon color="{{js_use_money?'red':'gray'}}" size="16" type="success"></icon> | ||
153 | + <view class="yu_er">使用余额 :¥{{yuer}} </view> | ||
154 | + </view> | ||
103 | </view> | 155 | </view> |
156 | + | ||
104 | </block> | 157 | </block> |
105 | 158 | ||
106 | <!------立即购买--------> | 159 | <!------立即购买--------> |
160 | + <view class="xc-border xc-border"></view> | ||
107 | <block wx:if="{{is_b_now==1}}"> | 161 | <block wx:if="{{is_b_now==1}}"> |
108 | <view class="use-item bfff"> | 162 | <view class="use-item bfff"> |
109 | <image class="dp" src='{{imgUrl}}/miniapp/images/dianpu.png'> </image> <view>门店:{{bn_pickname}}</view></view> | 163 | <image class="dp" src='{{imgUrl}}/miniapp/images/dianpu.png'> </image> <view>门店:{{bn_pickname}}</view></view> |
@@ -113,14 +167,18 @@ | @@ -113,14 +167,18 @@ | ||
113 | </view> | 167 | </view> |
114 | <navigator class="order-cont" url="/pages/goods/goodsInfo/goodsInfo?goods_id={{bn_goods.goods_id}}"> | 168 | <navigator class="order-cont" url="/pages/goods/goodsInfo/goodsInfo?goods_id={{bn_goods.goods_id}}"> |
115 | <view class="goods-name">{{bn_goods.goods_name}}</view> | 169 | <view class="goods-name">{{bn_goods.goods_name}}</view> |
116 | - <view class="goods-color"> | ||
117 | - <text wx:if="{{bn_goods.goods_spec!=''}}">{{bn_goods.goods_spec}}/</text>{{bn_goods.goods_color}} | ||
118 | - </view> | ||
119 | - </navigator> | ||
120 | - <view class="order-num"> | ||
121 | - <view class="co-red">¥{{bn_goods.shop_price}}</view> | 170 | + |
171 | + <!-- 商品属性 --> | ||
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> | ||
174 | + | ||
175 | + <!-----商品名称规格------> | ||
176 | + <view class="order-num flex-space-between"> | ||
177 | + <view class="co-red">¥<text class="fs36">{{filters.toFix(bn_goods.shop_price,2)}}</text></view> | ||
122 | <view class="goods-num">x{{bn_goods.buynum}}</view> | 178 | <view class="goods-num">x{{bn_goods.buynum}}</view> |
123 | </view> | 179 | </view> |
180 | + </navigator> | ||
181 | + | ||
124 | </view> | 182 | </view> |
125 | <view class="set-mes"> | 183 | <view class="set-mes"> |
126 | <view wx:if="{{order.store_prom}}"><icon color="#f23030" size="16" type="info"></icon>{{order.store_prom}} | 184 | <view wx:if="{{order.store_prom}}"><icon color="#f23030" size="16" type="info"></icon>{{order.store_prom}} |
@@ -130,48 +188,32 @@ | @@ -130,48 +188,32 @@ | ||
130 | wx:if="{{selected_quan_list && selected_quan_list.length>0}}"> | 188 | wx:if="{{selected_quan_list && selected_quan_list.length>0}}"> |
131 | <view class="work-frame flex-space-between"> | 189 | <view class="work-frame flex-space-between"> |
132 | <view class="work"> | 190 | <view class="work"> |
133 | - 使用优惠券 | 191 | + 优惠券 |
134 | </view> | 192 | </view> |
135 | <view class="xc-right-frame"> | 193 | <view class="xc-right-frame"> |
136 | <text wx:if="{{using_quan[bn_pick].is_nouse}}">不使用</text> | 194 | <text wx:if="{{using_quan[bn_pick].is_nouse}}">不使用</text> |
137 | - <text wx:if="{{using_quan[bn_pick].money}}">{{using_quan[bn_pick].money}}元优惠券</text> | 195 | + <text wx:if="{{using_quan[bn_pick].money}}">¥{{using_quan[bn_pick].money}}元优惠券</text> |
138 | <view class="xc-right"></view> | 196 | <view class="xc-right"></view> |
139 | </view> | 197 | </view> |
140 | </view> | 198 | </view> |
141 | </view> | 199 | </view> |
142 | 200 | ||
143 | - <view class="use-item"> | ||
144 | - <view bindtap='setexptype' data-t='1' style="display:{{bn_t_exp_t==2?'none':'flex'}};"> | 201 | + <view class="use-item flex-space-between"> |
202 | + <view class="flex"> | ||
203 | + <view bindtap='setexptype' data-t='1' data-txt='cartlist[{{pidx}}].exp_type' style="display:{{bn_t_exp_t==2?'none':'flex;align-items:center;'}};"> | ||
145 | <icon color="{{bn_exp_type==1?'red':'gray'}}" size="16" type="success"></icon> | 204 | <icon color="{{bn_exp_type==1?'red':'gray'}}" size="16" type="success"></icon> |
146 | <view class="yu_er">自提</view> | 205 | <view class="yu_er">自提</view> |
147 | </view> | 206 | </view> |
148 | - <view bindtap='setexptype' data-t='0' style="display:{{bn_t_exp_t==1?'none':'flex'}};"> | 207 | + <view bindtap='setexptype' data-t='0' data-txt='cartlist[{{pidx}}].exp_type' style="display:{{bn_t_exp_t==1?'none':'flex;align-items:center;'}};"> |
149 | <icon color="{{bn_exp_type==0?'red':'gray'}}" size="16" type="success"></icon> | 208 | <icon color="{{bn_exp_type==0?'red':'gray'}}" size="16" type="success"></icon> |
150 | <view class="yu_er">物流</view> | 209 | <view class="yu_er">物流</view> |
151 | </view> | 210 | </view> |
211 | +</view> | ||
212 | + <block wx:if="{{bn_exp_type==0}}"> | ||
213 | + <view class="flex-vertical" bindtap="show_wu_arr" data-txt='index'><view class="logistics-name">{{wu_arr[index].name}}</view><view class="xc-right"></view></view> | ||
214 | + </block> | ||
152 | </view> | 215 | </view> |
153 | 216 | ||
154 | - <view class="use-item" hidden='{{bn_exp_type==1}}'> | ||
155 | - <view>使用物流:</view> | ||
156 | - <picker bindchange="bindPickerChange" value="{{index}}" range="{{wu_arr}}" range-key="name"> | ||
157 | - <view >{{wu_arr[index].name}}</view> | ||
158 | - </picker> | ||
159 | - </view> | ||
160 | - | ||
161 | - <!-- <view class="use-item"> | ||
162 | - <view>使用积分 : </view> | ||
163 | - <input bindblur="keyUpChangePay2" maxlength="20" name="pay_points" placeholder="可用积分为:{{order.userInfo.pay_points}}" type="number"></input> | ||
164 | - <button class="use-btn" formType="submit">使用</button> | ||
165 | - </view> | ||
166 | - <view class="use-item"> | ||
167 | - <view>使用券码 : </view> | ||
168 | - <input name="couponCode" placeholder="请输入优惠券券码" type="text"></input> | ||
169 | - <button class="use-btn" formType="submit">使用</button> | ||
170 | - </view> | ||
171 | - <view class="use-item" style="display:{{payWithUserMoney&&payWithPoints?'none':'flex'}}"> | ||
172 | - <view>支付密码 : </view> | ||
173 | - <input password maxlength="20" name="paypwd" placeholder="请输入密码" type="text"></input> | ||
174 | - </view> --> | ||
175 | </view> | 217 | </view> |
176 | 218 | ||
177 | <!-----使用余额------> | 219 | <!-----使用余额------> |
@@ -179,14 +221,13 @@ | @@ -179,14 +221,13 @@ | ||
179 | <view class="use-item" bindtap='set_bn_useyuer'> | 221 | <view class="use-item" bindtap='set_bn_useyuer'> |
180 | <icon color="{{bn_use_money?'red':'gray'}}" size="16" type="success"></icon> | 222 | <icon color="{{bn_use_money?'red':'gray'}}" size="16" type="success"></icon> |
181 | <view class="yu_er">使用余额 :¥{{yuer}} </view> | 223 | <view class="yu_er">使用余额 :¥{{yuer}} </view> |
182 | - <!-- <input bindblur="keyUpChangePay1" maxlength="20" name="user_money" placeholder="可用余额:{{order.userInfo.user_money}}" type="digit"></input> <button class="use-btn" formType="submit">使用</button>--> | ||
183 | </view> | 224 | </view> |
184 | </view> | 225 | </view> |
185 | - <view class="coupon-mes"> | ||
186 | - <view>用户备注(50字)</view> | 226 | + <view class="coupon-mes flex-vertical"> |
227 | + <view>留言</view> | ||
187 | <view class="leave-word"> | 228 | <view class="leave-word"> |
188 | - <textarea bindinput="keyUpChangeNum" disabled="{{disabled}}" class="word-box" maxlength="50" name="user_note"></textarea> | ||
189 | - <view class="max-word">{{maxWord}}/50</view> | 229 | + <input placeholder-class="fs28" placeholder='给商家留言,最多100字' bindinput="keyUpChangeNum" disabled="{{disabled}}" class="word-box" maxlength="100" name="user_note"></input> |
230 | + | ||
190 | </view> | 231 | </view> |
191 | </view> | 232 | </view> |
192 | </block> | 233 | </block> |
@@ -238,53 +279,189 @@ | @@ -238,53 +279,189 @@ | ||
238 | <view class="top flex"> | 279 | <view class="top flex"> |
239 | <view class="xc-top-content t-c"> | 280 | <view class="xc-top-content t-c"> |
240 | <view class="xc-title"> | 281 | <view class="xc-title"> |
241 | - 选择优惠券 | 282 | + 优惠券使用 |
242 | </view> | 283 | </view> |
243 | </view> | 284 | </view> |
244 | <view class="xc-close-frame" bindtap='close_coupon' > | 285 | <view class="xc-close-frame" bindtap='close_coupon' > |
245 | <view class="xc-close">×</view> | 286 | <view class="xc-close">×</view> |
246 | </view> | 287 | </view> |
247 | </view> | 288 | </view> |
289 | + <!-- <view class=""> --> | ||
290 | + <view class="may_use_coupon fs28 flex"> | ||
291 | + 可使用的优惠券 | ||
292 | + <view class=" is_use_coupon flex-vertical" bindtap="sele_quan_item" data-no="1"> | ||
293 | + 不使用优惠券 | ||
294 | + | ||
295 | + <block wx:if="{{using_quan[selected_quan_pick].is_nouse_red}}"> | ||
296 | + <view class="circle white xc-hooka fs20 red-b sn"><text>Γ</text></view> | ||
297 | + </block> | ||
298 | + <block wx:else> | ||
299 | + <view class="circle xc-hookst ons"></view> | ||
300 | + </block> | ||
248 | 301 | ||
302 | + </view> | ||
303 | + </view> | ||
304 | + <!-- </view> --> | ||
249 | <view class="xc-frame flex-level"> | 305 | <view class="xc-frame flex-level"> |
250 | <view class="list-frame"> | 306 | <view class="list-frame"> |
251 | - <view class="xc-coupon-effect flex-vertical flex-space-between" bindtap="sele_quan_item" data-no="1"> | ||
252 | - <view class="xc-goods-coupon "> | ||
253 | - <view class="xc-coupon-money0">不使用优惠券</view> | ||
254 | - <view class="flex"></view> | ||
255 | - </view> | ||
256 | - <view class="xc-coupon-selection flex-right-vertical" > | ||
257 | - <icon color='red' size='20' type='success' wx:if="{{using_quan[selected_quan_pick].is_nouse_red}}"></icon> | ||
258 | - <view class="circle xc-not-Selection" wx:if="{{!using_quan[selected_quan_pick].is_nouse_red }}"></view> | ||
259 | - </view> | ||
260 | - </view> | ||
261 | - | ||
262 | - <!-- 循环那些还没有被其他门店选择的券 --> | ||
263 | - <view class="xc-coupon-effect flex-vertical flex-space-between" wx:for="{{selected_quan_list}}" wx:if="{{!item.is_using}}" bindtap="sele_quan_item" data-ind="{{index}}"> | ||
264 | - <view class="xc-goods-coupon "> | ||
265 | - <view class="xc-coupon-money">{{item.Sum}}元</view> | ||
266 | - <view class="xc-coupon-money1">订单满{{item.BuySum?item.BuySum:0}}元使用</view> | ||
267 | - <view class="flex xc-coupon-time">使用期限 | ||
268 | - <view class="time" wx:if="{{item.BeginDate && item.ValidDate}}" > | ||
269 | - {{filters.replace_time(item.BeginDate)}}至{{filters.replace_time(item.ValidDate)}} | ||
270 | - </view> | ||
271 | - <view wx:else>: 无限制</view> | ||
272 | - </view> | ||
273 | - </view> | ||
274 | - <view class="xc-coupon-selection flex-right-vertical" > | ||
275 | - <icon color='red' size='20' type='success' wx:if="{{item.show_red}}"></icon> | ||
276 | - <view class="circle xc-not-Selection" wx:if="{{!item.show_red }}"></view> | ||
277 | - </view> | 307 | + |
308 | + <view wx:for="{{selected_quan_list}}" bindtap="sele_quan_item" wx:if="{{!item.is_using}}" data-ind="{{q_index}}" wx:for-item="item"wx:for-index="q_index"> | ||
309 | + <view class="xc-coupon-frame flex-center" bindtap="sele_coupon" data-ind="{{q_index}}"> | ||
310 | + <view class="coupon-frame flex rel"> | ||
311 | + <!-- 锯齿 --> | ||
312 | + <view class="circle-frame abs"> | ||
313 | + <view class='circle circle-sawtooth'></view> | ||
314 | + <view class='circle circle-sawtooth'></view> | ||
315 | + <view class='circle circle-sawtooth'></view> | ||
316 | + <view class='circle circle-sawtooth'></view> | ||
317 | + <view class='circle circle-sawtooth'></view> | ||
318 | + <view class='circle circle-sawtooth'></view> | ||
319 | + <view class='circle circle-sawtooth'></view> | ||
320 | + <view class='circle circle-sawtooth'></view> | ||
321 | + <view class='circle circle-sawtooth'></view> | ||
322 | + <view class='circle circle-sawtooth'></view> | ||
323 | + <view class='circle circle-sawtooth'></view> | ||
324 | + <view class='circle circle-sawtooth'></view> | ||
325 | + <view class='circle circle-sawtooth'></view> | ||
326 | + <view class='circle circle-sawtooth'></view> | ||
327 | + <view class='circle circle-sawtooth'></view> | ||
328 | + <view class='circle circle-sawtooth'></view> | ||
329 | + <view class='circle circle-sawtooth'></view> | ||
330 | + <view class='circle circle-sawtooth'></view> | ||
331 | + <view class='circle circle-sawtooth'></view> | ||
332 | + <view class='circle circle-sawtooth'></view> | ||
333 | + </view> | ||
334 | + | ||
335 | + <view class="coupon-left rel {{filter.setcolor(item.UseObjectType)}} flex-center"> | ||
336 | + | ||
337 | + | ||
338 | + <view class="white xc-money-frames"> | ||
339 | + <view class="f_text"> | ||
340 | + <text class="xc-rmb-symbol">¥</text> | ||
341 | + <text class="xc-rmb-val">{{item.Sum}}</text> | ||
278 | </view> | 342 | </view> |
279 | - | 343 | + |
344 | + <view class="coupon-explain t-c" wx:if="{{item.BuySum==0}}"> | ||
345 | + 无使用门槛 | ||
346 | + </view> | ||
347 | + <view class="coupon-explain t-c" wx:if="{{item.BuySum>0}}"> | ||
348 | + {{UseObjectName}} | ||
280 | </view> | 349 | </view> |
350 | + | ||
351 | + </view> | ||
352 | + </view> | ||
353 | + <view class="coupon-right flex-center rel"> | ||
354 | + <view class="coupon-annotation flex"> | ||
355 | + | ||
356 | + <view class="flex top-frame"> | ||
357 | + | ||
358 | + <view class="frame"> | ||
359 | + <!-- <view class="flex"> --> | ||
360 | + <view class="coupon-wode ib flex ellipsis-2 "> | ||
361 | + <text class="xc-brand t-c ib white {{filter.setcolor(item.UseObjectType)}}">{{filter.get_type_card(item.UseObjectType)}} | ||
362 | + </text> | ||
363 | + <block wx:if="{{item.buy_sum>0}}">满{{item.buy_sum}}减{{item.Sum}}优惠券</block> | ||
364 | + <block wx:else>全场通用减{{item.Sum}}优惠券</block> | ||
365 | + <!-- </view> --> | ||
366 | + </view> | ||
367 | + <view class="coupon-time"> | ||
368 | + {{filters.replace_time2(item.BeginDate)}}至{{filters.replace_time2(item.BillDate)}}</view> | ||
369 | + </view> | ||
370 | + </view> | ||
371 | + <!-- <view wx:if="{{item.Obtain>0}}" class="code-img" bindtap="show_quan" data-ind="{{index}}" data-now="{{filter.format_time(now)}}"> | ||
372 | + <image class="coupon-code" src='{{iurl}}/miniapp/images/user_r_code.png'></image> | ||
373 | + </view> | ||
374 | + <view wx:else class="code-img"> | ||
375 | + <image class="coupon-code" src='{{iurl}}/miniapp/images/hui-ewm.png'></image> | ||
376 | + </view> --> | ||
377 | + | ||
378 | + <block wx:if="{{item.show_red}}"> | ||
379 | + <view class="circle white xc-hook fs20 red-b sn"><text>Γ</text></view> | ||
380 | + </block> | ||
381 | + <block wx:else> | ||
382 | + <view class="circle xc-hooks on"></view> | ||
383 | + </block> | ||
384 | + </view> | ||
385 | + | ||
386 | + | ||
387 | + | ||
388 | + <view class="abs flex-vertical-between bottmo-explain" catchtap='clik_coupons' data-idx="{{index}}"> | ||
389 | + <view></view> | ||
390 | + <view class="font-word flex">优惠券使用说明 | ||
391 | + <view class="circle circle-size flex t-c"> | ||
392 | + <view class="xc-jiantou">く</view> | ||
393 | + </view> | ||
394 | + </view> | ||
395 | + </view> | ||
281 | </view> | 396 | </view> |
397 | + </view> | ||
398 | + | ||
399 | + </view> | ||
400 | + <view class="xc-buttom "wx:if="{{item.is_open==1}}"> | ||
401 | + <text class="five-level-word explain-coupon">{{util.format(item.Remark)}}</text> | ||
402 | + </view> | ||
403 | + | ||
404 | +</view> | ||
405 | + | ||
406 | + | ||
282 | 407 | ||
408 | + | ||
409 | + | ||
410 | + </view> | ||
411 | + </view> | ||
412 | + <view class="determine-frame"> | ||
283 | <view class="xc-confirm flex-center" bindtap="confirm_quan"> | 413 | <view class="xc-confirm flex-center" bindtap="confirm_quan"> |
284 | - <view class="flex-vertical t-c">确定</view> | 414 | + 确定 |
415 | + </view> | ||
416 | + </view> | ||
417 | + </view > | ||
418 | +</view> | ||
419 | + | ||
420 | +<!----弹起选择物流名的列表----> | ||
421 | +<view wx:if='{{open_express==1}}' > | ||
422 | + <view class="cover-layer flex-center " bindtap='close_express'> | ||
423 | + </view> | ||
424 | + | ||
425 | + <view class="cx-popup radius {{open_express==1?'up' : 'down'}}" > | ||
426 | + <view class="tops flex"> | ||
427 | + <view class="top-content fs32"> | ||
428 | + <view> | ||
429 | + 选择物流名字 | ||
430 | + </view> | ||
431 | + </view> | ||
432 | + <view class="close-frame" bindtap='close_express' > | ||
433 | + <view class="xc-close-express">×</view> | ||
434 | + </view> | ||
285 | </view> | 435 | </view> |
436 | + <view class="express_list"> | ||
437 | + <view wx:for="{{wu_arr}}" wx:for-item="express_list" wx:for-index="idx"> | ||
438 | + <view class="express_list_frame" bindtap="click_express_name" | ||
439 | + data-shippingcode="{{express_list.shipping_code}}" | ||
440 | + data-name="{{express_list.name}}" data-idxe="{{idx}}"> | ||
441 | + | ||
442 | + <block wx:if="{{is_express==idx}}"> | ||
443 | + <view class="circle white xc-hook fs20 red-b"><text>Γ</text></view> | ||
444 | + </block> | ||
445 | + <block wx:else> | ||
446 | + <view class="circle xc-hooks"></view> | ||
447 | + </block> | ||
448 | + <view class="fs30">{{express_list.name}}</view> | ||
449 | + | ||
450 | + </view> | ||
451 | + </view> | ||
452 | + </view> | ||
453 | + <view class="flex click-buttem" > | ||
454 | + <view class="xc-determine flex-center" bindtap="determine_expres"> | ||
455 | + <view class="flex-vertical t-c">确定</view> | ||
456 | + </view> | ||
457 | + <view class="xc-confirms flex-center" bindtap="select_default_logistics"> | ||
458 | + <view class="flex-vertical t-c">设为默认</view> | ||
459 | + </view> | ||
460 | + </view> | ||
461 | + | ||
286 | </view > | 462 | </view > |
287 | </view> | 463 | </view> |
288 | 464 | ||
289 | 465 | ||
466 | + | ||
290 | <warn id="warn"></warn> | 467 | <warn id="warn"></warn> |
291 | \ No newline at end of file | 468 | \ No newline at end of file |
pages/cart/cart2/cart2.wxss
@@ -5,25 +5,26 @@ | @@ -5,25 +5,26 @@ | ||
5 | color: #444; | 5 | color: #444; |
6 | } | 6 | } |
7 | .user-contact { | 7 | .user-contact { |
8 | - padding: 24rpx 80rpx; | 8 | + padding: 24rpx 70rpx; |
9 | + font-weight: 600; | ||
9 | } | 10 | } |
10 | - | 11 | + |
11 | .location { | 12 | .location { |
12 | position: relative; | 13 | position: relative; |
13 | - padding: 0 80rpx 24rpx; | 14 | + padding: 0 70rpx 24rpx; |
14 | } | 15 | } |
15 | 16 | ||
16 | .pos-icon { | 17 | .pos-icon { |
17 | position: absolute; | 18 | position: absolute; |
18 | - left: 30rpx; | ||
19 | - top: 0; | 19 | + left: 22rpx; |
20 | + top: 9rpx; | ||
20 | width: 32rpx; | 21 | width: 32rpx; |
21 | - height: 32.5rpx; | 22 | + height: 37.5rpx; |
22 | } | 23 | } |
23 | 24 | ||
24 | .border-img { | 25 | .border-img { |
25 | width: 100%; | 26 | width: 100%; |
26 | - height: 16rpx; | 27 | + height: 12rpx; |
27 | } | 28 | } |
28 | 29 | ||
29 | .update-logistics { | 30 | .update-logistics { |
@@ -50,23 +51,23 @@ | @@ -50,23 +51,23 @@ | ||
50 | 51 | ||
51 | .order-detail { | 52 | .order-detail { |
52 | padding: 30rpx 0; | 53 | padding: 30rpx 0; |
53 | - border-bottom: 1px solid #ddd; | 54 | + border-bottom: 6rpx solid #eee; |
54 | color: #777; | 55 | color: #777; |
55 | - min-height: 100rpx; | 56 | + min-height: 190rpx; |
56 | background-color: #fff; | 57 | background-color: #fff; |
57 | 58 | ||
58 | } | 59 | } |
59 | 60 | ||
60 | .goods-img { | 61 | .goods-img { |
61 | float: left; | 62 | float: left; |
62 | - width: 100rpx; | ||
63 | - height: 100rpx; | 63 | + width: 191rpx; |
64 | + height: 191rpx; | ||
64 | margin: 0 20rpx; | 65 | margin: 0 20rpx; |
65 | } | 66 | } |
66 | 67 | ||
67 | .order-cont { | 68 | .order-cont { |
68 | float: left; | 69 | float: left; |
69 | - width: 400rpx; | 70 | + width: 438rpx; |
70 | } | 71 | } |
71 | 72 | ||
72 | .goods-name { | 73 | .goods-name { |
@@ -75,6 +76,8 @@ | @@ -75,6 +76,8 @@ | ||
75 | overflow: hidden; | 76 | overflow: hidden; |
76 | margin-bottom: 16rpx; | 77 | margin-bottom: 16rpx; |
77 | font-size: 28rpx; | 78 | font-size: 28rpx; |
79 | + color: #333; | ||
80 | + | ||
78 | } | 81 | } |
79 | 82 | ||
80 | .goods-color { | 83 | .goods-color { |
@@ -82,29 +85,27 @@ | @@ -82,29 +85,27 @@ | ||
82 | } | 85 | } |
83 | 86 | ||
84 | .order-num { | 87 | .order-num { |
85 | - float: right; | 88 | + margin-top: 25rpx; |
86 | font-size: 24rpx; | 89 | font-size: 24rpx; |
87 | - margin-top: 10rpx; | ||
88 | - margin-right: 20rpx; | ||
89 | - text-align: right; | ||
90 | line-height: 42rpx; | 90 | line-height: 42rpx; |
91 | } | 91 | } |
92 | 92 | ||
93 | -.set-mes{background-color: #fff; margin-bottom: 20rpx;} | 93 | +.set-mes{background-color: #fff; } |
94 | .use-item{ | 94 | .use-item{ |
95 | display: flex; | 95 | display: flex; |
96 | align-items: center; | 96 | align-items: center; |
97 | - height: 92rpx; | 97 | + height: 80rpx; |
98 | border-bottom: 1px solid #ddd; | 98 | border-bottom: 1px solid #ddd; |
99 | font-size: 30rpx; | 99 | font-size: 30rpx; |
100 | - padding-left: 20rpx; | ||
101 | - | 100 | + width:95%; |
101 | +margin:auto; | ||
102 | + | ||
102 | } | 103 | } |
103 | .use-item>view{ | 104 | .use-item>view{ |
104 | - display: flex;margin-right: 20rpx; | 105 | + display: flex;margin-right: 12rpx; |
105 | } | 106 | } |
106 | .use-item.bfff{ background-color: #fff;} | 107 | .use-item.bfff{ background-color: #fff;} |
107 | -.use-item .dp{width: 56rpx; height: 56rpx;} | 108 | +.use-item .dp{width: 56rpx; height: 56rpx; margin-left: -5rpx} |
108 | 109 | ||
109 | .set-item { | 110 | .set-item { |
110 | justify-content: space-between; | 111 | justify-content: space-between; |
@@ -134,11 +135,14 @@ | @@ -134,11 +135,14 @@ | ||
134 | } | 135 | } |
135 | 136 | ||
136 | .coupon-mes { | 137 | .coupon-mes { |
137 | - margin-bottom: 20rpx; | 138 | + height:95rpx; |
138 | padding: 0 20rpx; | 139 | padding: 0 20rpx; |
139 | background-color: #fff; | 140 | background-color: #fff; |
140 | font-size: 30rpx; | 141 | font-size: 30rpx; |
141 | color: #444; | 142 | color: #444; |
143 | + width: 100%; | ||
144 | + | ||
145 | + | ||
142 | } | 146 | } |
143 | 147 | ||
144 | .coupon-title { | 148 | .coupon-title { |
@@ -165,15 +169,17 @@ | @@ -165,15 +169,17 @@ | ||
165 | 169 | ||
166 | .leave-word { | 170 | .leave-word { |
167 | position: relative; | 171 | position: relative; |
168 | - margin: 20rpx 0; | 172 | + |
169 | font-size: 24rpx; | 173 | font-size: 24rpx; |
174 | + margin-left: 20rpx; | ||
175 | + | ||
170 | } | 176 | } |
171 | 177 | ||
172 | .word-box { | 178 | .word-box { |
173 | - border: 1px solid #ddd; | ||
174 | - width: 690rpx; | 179 | + |
180 | + width: 600rpx; | ||
175 | padding: 10rpx; | 181 | padding: 10rpx; |
176 | - height: 120rpx; | 182 | + height: 28rpx; |
177 | line-height: 40rpx; | 183 | line-height: 40rpx; |
178 | } | 184 | } |
179 | 185 | ||
@@ -271,18 +277,20 @@ | @@ -271,18 +277,20 @@ | ||
271 | .add_new{height: 60rpx; line-height: 60rpx;} | 277 | .add_new{height: 60rpx; line-height: 60rpx;} |
272 | .addr_jia{width: 45rpx; height: 45rpx; border: 1rpx solid #ddd; | 278 | .addr_jia{width: 45rpx; height: 45rpx; border: 1rpx solid #ddd; |
273 | margin-right: 15rpx; margin-left: 20rpx; vertical-align: middle;} | 279 | margin-right: 15rpx; margin-left: 20rpx; vertical-align: middle;} |
274 | -.yu_er{margin-left: 15rpx;} .wuliu{margin-left: 20rpx;} | 280 | +.yu_er{margin-left: 10rpx;margin-right: 60rpx;} .wuliu{margin-left: 20rpx;} |
275 | 281 | ||
276 | 282 | ||
277 | /*---- 优惠券列表 -----*/ | 283 | /*---- 优惠券列表 -----*/ |
278 | .xc-coupon-frame{ | 284 | .xc-coupon-frame{ |
279 | width: 100%; | 285 | width: 100%; |
280 | height: 92rpx; | 286 | height: 92rpx; |
281 | - border-bottom:1px solid #ddd; | 287 | + |
282 | } | 288 | } |
283 | .xc-coupon-frame .work-frame{ | 289 | .xc-coupon-frame .work-frame{ |
284 | - width: 94%; | 290 | + width: 100%; |
285 | height: 100%; | 291 | height: 100%; |
292 | + border-bottom:3rpx solid #eee; | ||
293 | + | ||
286 | 294 | ||
287 | } | 295 | } |
288 | .xc-right{ | 296 | .xc-right{ |
@@ -292,36 +300,41 @@ | @@ -292,36 +300,41 @@ | ||
292 | border-right:2rpx solid #000; | 300 | border-right:2rpx solid #000; |
293 | transform:rotate(45deg); | 301 | transform:rotate(45deg); |
294 | display:inline-block; | 302 | display:inline-block; |
295 | - margin-top:30rpx; | 303 | + |
296 | } | 304 | } |
297 | 305 | ||
298 | -.xc-coupon-frame .work-frame .work{ font-size: 30rpx; line-height: 92rpx; color: #d81e06;} | 306 | +.xc-coupon-frame .work-frame .work{ font-size: 30rpx; line-height: 92rpx; } |
299 | .xc-right-frame{font-size: 30rpx;line-height: 92rpx; margin-right: 10rpx } | 307 | .xc-right-frame{font-size: 30rpx;line-height: 92rpx; margin-right: 10rpx } |
300 | 308 | ||
301 | /* 自定义弹出窗口 */ | 309 | /* 自定义弹出窗口 */ |
302 | .cx-popup{ | 310 | .cx-popup{ |
303 | width:100%; | 311 | width:100%; |
304 | - height: 775rpx; | 312 | + height:920rpx; |
305 | background: #fff; | 313 | background: #fff; |
306 | z-index: 35; | 314 | z-index: 35; |
307 | - border-top-left-radius: 10rpx; | ||
308 | - border-top-right-radius: 10rpx; | 315 | + border-top-left-radius: 20rpx; |
316 | + border-top-right-radius: 20rpx; | ||
309 | position:fixed; | 317 | position:fixed; |
310 | bottom:0; | 318 | bottom:0; |
319 | + padding-bottom: 25rpx; | ||
320 | + | ||
311 | } | 321 | } |
312 | 322 | ||
313 | .cx-popup .top{ | 323 | .cx-popup .top{ |
314 | - width:100%; | 324 | + width:95%; |
315 | height:100rpx; | 325 | height:100rpx; |
316 | border-bottom:3rpx solid #ddd; | 326 | border-bottom:3rpx solid #ddd; |
317 | - | 327 | + margin: auto; |
328 | + margin-top: 30rpx; | ||
318 | 329 | ||
319 | } | 330 | } |
320 | .xc-top-content{ | 331 | .xc-top-content{ |
321 | - width: 88%; | 332 | + width: 93%; |
322 | height:85rpx; | 333 | height:85rpx; |
323 | - padding-top: 20rpx; | ||
324 | - font-size: 36rpx; | 334 | + padding-top: 30rpx; |
335 | + font-size: 34rpx; | ||
336 | + font-weight: 600; | ||
337 | + | ||
325 | } | 338 | } |
326 | 339 | ||
327 | 340 | ||
@@ -333,35 +346,29 @@ | @@ -333,35 +346,29 @@ | ||
333 | } | 346 | } |
334 | .xc-frame{ | 347 | .xc-frame{ |
335 | width: 100%; | 348 | width: 100%; |
336 | - height: 465rpx; | ||
337 | - margin-top:20rpx; | ||
338 | - | 349 | + height:68.9%; |
339 | } | 350 | } |
340 | 351 | ||
341 | .xc-frame .list-frame{ | 352 | .xc-frame .list-frame{ |
342 | - width: 90%; | 353 | + width: 95%; |
343 | height: 100%; | 354 | height: 100%; |
344 | overflow-y:scroll; | 355 | overflow-y:scroll; |
345 | 356 | ||
346 | } | 357 | } |
347 | .xc-close-frame{ | 358 | .xc-close-frame{ |
348 | - margin-top:10rpx; | ||
349 | - width:1%; | 359 | + margin-top:-10rpx; |
360 | + | ||
350 | } | 361 | } |
351 | 362 | ||
352 | .xc-close{ | 363 | .xc-close{ |
353 | - width: 46rpx; | ||
354 | -height: 46rpx; | 364 | + width: 37rpx; |
365 | +height: 37rpx; | ||
355 | border-radius: 50%; | 366 | border-radius: 50%; |
356 | -border: 5rpx solid #a5a5a7; | 367 | +border: 3rpx solid #333; |
357 | text-align: center; | 368 | text-align: center; |
358 | -line-height: 46rpx; | ||
359 | -font-size: 34rpx; | ||
360 | -font-weight: bolder; | ||
361 | -color: #a5a5a7; | ||
362 | -margin-top: 5rpx; | ||
363 | - | ||
364 | - | 369 | +line-height: 34rpx; |
370 | +font-size: 29rpx; | ||
371 | +color: #333; | ||
365 | 372 | ||
366 | } | 373 | } |
367 | .xc-money{ | 374 | .xc-money{ |
@@ -424,16 +431,14 @@ margin-top: 5rpx; | @@ -424,16 +431,14 @@ margin-top: 5rpx; | ||
424 | } | 431 | } |
425 | 432 | ||
426 | .xc-confirm { | 433 | .xc-confirm { |
427 | - width: 90%; | ||
428 | - height: 75rpx; | 434 | + width: 48%; |
435 | + border-radius: 50rpx; | ||
436 | + height: 50rpx; | ||
429 | margin:0 auto; | 437 | margin:0 auto; |
430 | - background:#c41830; | 438 | + background:#d60021; |
431 | color:#fff; | 439 | color:#fff; |
432 | - border-radius:10rpx; | ||
433 | - font-size:30rpx; | ||
434 | - margin-top: 50rpx; | ||
435 | - | ||
436 | - | 440 | + font-size:28rpx; |
441 | + margin-top: 28rpx; | ||
437 | } | 442 | } |
438 | 443 | ||
439 | .up{ animation: up .7s; } | 444 | .up{ animation: up .7s; } |
@@ -448,3 +453,373 @@ height: 40rpx; | @@ -448,3 +453,373 @@ height: 40rpx; | ||
448 | } | 453 | } |
449 | 454 | ||
450 | 455 | ||
456 | +.xc-close-express{ | ||
457 | + width: 40rpx; | ||
458 | +height: 40rpx; | ||
459 | +border-radius: 50%; | ||
460 | +border: 3rpx solid #333; | ||
461 | +text-align: center; | ||
462 | +font-size:32rpx; | ||
463 | +line-height: 38rpx; | ||
464 | +color: #333; | ||
465 | +margin-top: 5rpx; | ||
466 | +} | ||
467 | +.cx-popup .tops{ | ||
468 | + width: 100%; | ||
469 | +height: 145rpx; | ||
470 | +border-bottom: 3rpx solid #eee; | ||
471 | + | ||
472 | +} | ||
473 | +.top-content { | ||
474 | + width: 82%; | ||
475 | +padding-top: 33px; | ||
476 | +height: 100%; | ||
477 | +padding-left: 40rpx; | ||
478 | +} | ||
479 | +.close-frame{ | ||
480 | + margin-top: 30rpx; | ||
481 | + | ||
482 | +} | ||
483 | +.cx-popup.radius{ | ||
484 | + | ||
485 | +height: 650rpx; | ||
486 | + | ||
487 | +} | ||
488 | +.xc-hook { | ||
489 | +width: 33rpx; | ||
490 | +height: 33rpx; | ||
491 | +transform: rotate(-135deg); | ||
492 | +line-height: 35rpx; | ||
493 | +text-align: center; | ||
494 | +margin-right: 20rpx | ||
495 | + | ||
496 | + | ||
497 | +} | ||
498 | +.xc-hooks { | ||
499 | +width: 30rpx; | ||
500 | +height: 30rpx; | ||
501 | +border: 1rpx solid #999; | ||
502 | +margin-right: 20rpx; | ||
503 | +} | ||
504 | +.express_list_frame{ | ||
505 | + display: flex; | ||
506 | +height: 80rpx; | ||
507 | +align-items: center; | ||
508 | +padding-left: 40rpx; | ||
509 | +border-bottom: 1rpx solid #eee; | ||
510 | + | ||
511 | +} | ||
512 | +.express_list{ | ||
513 | + width: 100%; | ||
514 | + height: 65%; | ||
515 | + overflow-y: scroll; | ||
516 | + overflow: hidden; | ||
517 | +} | ||
518 | +.xc-confirms { | ||
519 | + width: 40%; | ||
520 | + border-radius: 50rpx; | ||
521 | + height: 55rpx; | ||
522 | + margin:0 auto; | ||
523 | + font-size:28rpx; | ||
524 | + background: #fff; | ||
525 | + color: #333; | ||
526 | + border: 2rpx solid #333; | ||
527 | + | ||
528 | +} | ||
529 | + | ||
530 | + | ||
531 | +/* 优惠券的改版样式 */ | ||
532 | +.xc-coupon-frame{ | ||
533 | + width: 710rpx; | ||
534 | + height:auto; | ||
535 | + margin: 0 auto; | ||
536 | + | ||
537 | +} | ||
538 | +.xc-coupon-frame .coupon-frame{ | ||
539 | + width: 99%; | ||
540 | + height: 200rpx; | ||
541 | + margin-top:10rpx; | ||
542 | + border-bottom: 1rpx solid #eee; | ||
543 | + | ||
544 | +} | ||
545 | +.xc-coupon-frame .coupon-frame .coupon-left{ | ||
546 | + width: 215rpx; | ||
547 | + height:100%; | ||
548 | + overflow: hidden; | ||
549 | +} | ||
550 | +.xc-money-frames{ | ||
551 | + width:96%; | ||
552 | + margin-top: -10px; | ||
553 | +} | ||
554 | + | ||
555 | +.xc-rmb-symbol{ | ||
556 | + font-size:40rpx; | ||
557 | + | ||
558 | +} | ||
559 | + | ||
560 | +.xc-rmb-val{ | ||
561 | + font-size:60rpx; | ||
562 | + | ||
563 | +} | ||
564 | +.coupon-explain{ | ||
565 | + font-size:25rpx; | ||
566 | +width:100%; | ||
567 | + | ||
568 | + | ||
569 | +} | ||
570 | +.xc-valuer{ | ||
571 | + margin-top:39rpx; | ||
572 | + margin-left:28rpx; | ||
573 | + font-size:25rpx; | ||
574 | +} | ||
575 | +.coupon-frame .oval{ | ||
576 | + width:155rpx; | ||
577 | + height:83rpx; | ||
578 | + border-radius: 50%; | ||
579 | + right:-78rpx; | ||
580 | + top:-37rpx; | ||
581 | +} | ||
582 | +.coupon-right{ | ||
583 | + width:490rpx; | ||
584 | + height: 99%; | ||
585 | + border-top: 1rpx solid #eaeaea; | ||
586 | + /* //border-bottom: 1rpx solid #eaeaea; */ | ||
587 | + border-right: 1rpx solid #eaeaea; | ||
588 | + | ||
589 | +} | ||
590 | +.coupon-annotation{ | ||
591 | + width: 95%; | ||
592 | + height: 100%; | ||
593 | + | ||
594 | +} | ||
595 | +.xc-brand{ | ||
596 | + width:100rpx; | ||
597 | + height:35rpx; | ||
598 | + line-height: 35rpx; | ||
599 | + font-size:21rpx; | ||
600 | + border-radius:10rpx; position: relative; top:-1px; | ||
601 | +} | ||
602 | +.top-frame{ | ||
603 | + width:82%; | ||
604 | + height: 75rpx; | ||
605 | + margin-top:10rpx; | ||
606 | + | ||
607 | +} | ||
608 | +.top-frame .coupon-wode{ | ||
609 | + font-size: 25rpx; | ||
610 | + margin-left:10rpx; | ||
611 | + width:340rpx; | ||
612 | + height:88rpx; | ||
613 | +} | ||
614 | +.coupon-code{ | ||
615 | + width:60rpx; | ||
616 | + height:60rpx; | ||
617 | + margin-top:5rpx; | ||
618 | + | ||
619 | +} | ||
620 | +.frame{ | ||
621 | + width: 100% | ||
622 | +} | ||
623 | +.coupon-time{ | ||
624 | + font-size: 23rpx; | ||
625 | + line-height:33rpx; | ||
626 | + color: #333; | ||
627 | +} | ||
628 | + | ||
629 | +.clik-get{ | ||
630 | + width:125rpx; | ||
631 | + height:45rpx; | ||
632 | + border-radius: 25rpx; | ||
633 | + line-height: 45rpx; | ||
634 | + font-size:25rpx; | ||
635 | + bottom:67rpx; | ||
636 | + right:6px; | ||
637 | +} | ||
638 | + | ||
639 | +.code-img{ | ||
640 | + margin-left:20rpx; | ||
641 | +} | ||
642 | +.bottmo-explain{ | ||
643 | +top:145rpx; | ||
644 | +width:94%; | ||
645 | +border-top:1rpx dashed #eee; | ||
646 | +padding-top:8rpx; | ||
647 | +height:38rpx; | ||
648 | +line-height: 51rpx; | ||
649 | + | ||
650 | +} | ||
651 | +.font-word{ | ||
652 | + font-size: 22rpx; | ||
653 | +} | ||
654 | +.circle-size{ | ||
655 | + background: #a0a0a0; | ||
656 | + width: 27rpx; | ||
657 | + height: 27rpx; | ||
658 | + margin-top:13rpx; | ||
659 | +margin-left:8rpx; | ||
660 | +display: flex; | ||
661 | + | ||
662 | +align-items: center; | ||
663 | +} | ||
664 | +.xc-jiantou{ | ||
665 | + /* width: 9rpx; | ||
666 | + height: 9rpx; */ | ||
667 | + /* border-top: 2rpx solid #fff; | ||
668 | + border-right: 2rpx solid #fff; */ | ||
669 | + transform: rotate(-90deg); | ||
670 | + color: #fff; | ||
671 | + font-size: 15rpx; | ||
672 | + /* display:inline-block; | ||
673 | + margin-top: 6.5rpx; */ | ||
674 | + text-align: center; | ||
675 | +width: 24rpx; | ||
676 | +} | ||
677 | +.xc-buttom{ | ||
678 | + width:99%; | ||
679 | +min-height:76rpx; | ||
680 | +height:auto; | ||
681 | +line-height:40rpx; | ||
682 | +border-left:1rpx solid #eee; | ||
683 | +border-right:1rpx solid #eee; | ||
684 | +border-bottom:1rpx solid #eee; | ||
685 | +margin-left: 6rpx; | ||
686 | + | ||
687 | +} | ||
688 | +.goods-num{ | ||
689 | + font-size: 28rpx; | ||
690 | +color: #333; | ||
691 | + | ||
692 | +} | ||
693 | +.explain-coupon{ | ||
694 | + | ||
695 | + font-size:25rpx; | ||
696 | + | ||
697 | +} | ||
698 | +.circle-frame{ | ||
699 | + width: 20rpx; | ||
700 | + height: auto; | ||
701 | + z-index:1; | ||
702 | + left:210rpx; | ||
703 | + | ||
704 | +} | ||
705 | +.circle-sawtooth{ | ||
706 | + width: 11rpx; | ||
707 | + height: 11rpx; | ||
708 | + background: #fff; | ||
709 | +} | ||
710 | + | ||
711 | +.red{background-color: #fe7496;} | ||
712 | +.green{ background-color: #22c7c1;} | ||
713 | +.blue{background-color:#5e82e3;} | ||
714 | +.g_gray{background-color: #aaaaaa} | ||
715 | + | ||
716 | +.f_text{text-align: center; height:96rpx; } | ||
717 | +.xc-hook.sn { | ||
718 | + margin-top:12%; | ||
719 | +width:45rpx; | ||
720 | +height:45rpx; | ||
721 | +font-size:28rpx; | ||
722 | +line-height:44rpx; | ||
723 | + | ||
724 | + | ||
725 | +} | ||
726 | +.xc-hooks.on{ | ||
727 | + margin-top:12%; | ||
728 | +width:42rpx; | ||
729 | +height:42rpx; | ||
730 | +} | ||
731 | +.may_use_coupon{ | ||
732 | + width: 95%; | ||
733 | + height: 68rpx; | ||
734 | + line-height:78rpx; | ||
735 | + margin: auto; | ||
736 | +} | ||
737 | +.determine-frame{ | ||
738 | + width: 100%; | ||
739 | + height: 130rpx; | ||
740 | + | ||
741 | +} | ||
742 | +.xc-determine{ | ||
743 | + height: 55rpx; | ||
744 | + width: 40%; | ||
745 | + border-radius: 50rpx; | ||
746 | +background: #d60021; | ||
747 | +color: #fff; | ||
748 | +font-size: 28rpx; | ||
749 | +margin: 0 auto; | ||
750 | + | ||
751 | +} | ||
752 | +.click-buttem{ | ||
753 | +width: 90%; | ||
754 | +margin: auto; | ||
755 | +} | ||
756 | +.logistics-name{ | ||
757 | + margin-right:20rpx; | ||
758 | +} | ||
759 | +.xc-border{ | ||
760 | + border-top:8rpx solid #eee; | ||
761 | +width: 100% | ||
762 | +} | ||
763 | +.main-top{ | ||
764 | +margin-top: 20rpx; | ||
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 | +} | ||
821 | +.color-gray{ | ||
822 | + color: #808080; | ||
823 | +} | ||
824 | + | ||
825 | +.n_guige{ display: inline-block; background:rgb(236, 236, 236); color: rgb(63,63,63); padding: 3rpx 10rpx; border-radius: 3rpx } | ||
451 | \ No newline at end of file | 826 | \ No newline at end of file |
pages/cart/cart2/filter.wxs
0 → 100644
pages/cart/cart2_pt/cart2_pt.js
@@ -2,6 +2,7 @@ var t = getApp(),app=t, a = t.request, e = require("../../../utils/common.js"), | @@ -2,6 +2,7 @@ var t = getApp(),app=t, a = t.request, e = require("../../../utils/common.js"), | ||
2 | s = require("../../../utils/util.js"), o = require("../../../utils/md5.js"), to = getApp(); | 2 | s = require("../../../utils/util.js"), o = require("../../../utils/md5.js"), to = getApp(); |
3 | var oo=t.globalData.setting; | 3 | var oo=t.globalData.setting; |
4 | var regeneratorRuntime = require('../../../utils/runtime.js'); | 4 | var regeneratorRuntime = require('../../../utils/runtime.js'); |
5 | +var util_pay = require("../../../utils/pay.js"); | ||
5 | 6 | ||
6 | Page({ | 7 | Page({ |
7 | data: { | 8 | data: { |
@@ -54,7 +55,8 @@ Page({ | @@ -54,7 +55,8 @@ Page({ | ||
54 | is_pt_tz:0,//是否开团团长 | 55 | is_pt_tz:0,//是否开团团长 |
55 | qh:'', //期号 | 56 | qh:'', //期号 |
56 | pt_listno:'',//期号 | 57 | pt_listno:'',//期号 |
57 | - is_normal:0 | 58 | + is_normal:0, |
59 | + is_express:0,//选择物流的控制器 | ||
58 | }, | 60 | }, |
59 | onLoad: function(t) { | 61 | onLoad: function(t) { |
60 | console.log("onLoad_pt_cart"); | 62 | console.log("onLoad_pt_cart"); |
@@ -212,18 +214,21 @@ Page({ | @@ -212,18 +214,21 @@ Page({ | ||
212 | 214 | ||
213 | //----------子页返回父页触发---------- | 215 | //----------子页返回父页触发---------- |
214 | onShow: function() { | 216 | onShow: function() { |
215 | - console.log('onshow'); | ||
216 | var th=this; | 217 | var th=this; |
217 | - console.log(th.data.isclose); | ||
218 | if (th.data.isclose==0){ | 218 | if (th.data.isclose==0){ |
219 | wx.switchTab({ | 219 | wx.switchTab({ |
220 | url: "/pages/index/index/index" | 220 | url: "/pages/index/index/index" |
221 | }) | 221 | }) |
222 | - | ||
223 | }else{ | 222 | }else{ |
224 | - this.getuser_addr(function(ie){ | ||
225 | - th.setData({user_addr: ie }); | ||
226 | - }) | 223 | + this.getuser_addr(function(ie){ |
224 | + th.setData({user_addr: ie }); | ||
225 | + }) | ||
226 | + //--更新默认地址--,看一下是不是跳到地址页面 | ||
227 | + if(!getApp().globalData.is_cart2_old){ | ||
228 | + this.update_code(); | ||
229 | + }else{ | ||
230 | + getApp().globalData.is_cart2_old=0; | ||
231 | + } | ||
227 | } | 232 | } |
228 | }, | 233 | }, |
229 | //---------------检查是否有收货地址------------------- | 234 | //---------------检查是否有收货地址------------------- |
@@ -336,7 +341,6 @@ Page({ | @@ -336,7 +341,6 @@ Page({ | ||
336 | 341 | ||
337 | //--------------------提交订单----------------------- | 342 | //--------------------提交订单----------------------- |
338 | submitForm:function(t){ | 343 | submitForm:function(t){ |
339 | - | ||
340 | if(this.data.is_summit_ing==1) return false; //--提交中退出-- | 344 | if(this.data.is_summit_ing==1) return false; //--提交中退出-- |
341 | this.data.is_summit_ing=1; | 345 | this.data.is_summit_ing=1; |
342 | 346 | ||
@@ -457,11 +461,25 @@ Page({ | @@ -457,11 +461,25 @@ Page({ | ||
457 | }) | 461 | }) |
458 | //要进行判断,如果是用微信支付,就要跳转到支付界面 | 462 | //要进行判断,如果是用微信支付,就要跳转到支付界面 |
459 | if (order_amount > 0) { | 463 | if (order_amount > 0) { |
460 | - th.setData({ isclose: 0 }); | ||
461 | - void e.jumpToCart4({ | ||
462 | - order_sn: data.data, | ||
463 | - type:1, | ||
464 | - }, 1); | 464 | + th.setData({ isclose: 0 }); |
465 | + //void e.jumpToCart4({ | ||
466 | + // order_sn: data.data, | ||
467 | + // type:1, | ||
468 | + // }, 1); | ||
469 | + util_pay.pay(data.data, function() { | ||
470 | + setTimeout(function () { | ||
471 | + wx.navigateTo({ | ||
472 | + url: "/pages/payment/pay_success/pay_success?type="+1+"&order_sn="+data.data, | ||
473 | + }) | ||
474 | + },1000) | ||
475 | + }, function () { | ||
476 | + //支付失败 | ||
477 | + setTimeout(function () { | ||
478 | + wx.navigateBack({ delta: 1 }) | ||
479 | + },1000) | ||
480 | + | ||
481 | + },oo.stoid,1); | ||
482 | + | ||
465 | } else { | 483 | } else { |
466 | var dd = { | 484 | var dd = { |
467 | parent_sn: data.data, | 485 | parent_sn: data.data, |
@@ -521,8 +539,9 @@ Page({ | @@ -521,8 +539,9 @@ Page({ | ||
521 | }); | 539 | }); |
522 | }, | 540 | }, |
523 | enterAddressPage: function() { | 541 | enterAddressPage: function() { |
542 | + getApp().globalData.is_cart_old=1; | ||
524 | this.data.enterAddressPage = !0, wx.navigateTo({ | 543 | this.data.enterAddressPage = !0, wx.navigateTo({ |
525 | - url: "/pages/user/address_list/address_list?operate=select" | 544 | + url: "/pages/user/address_list/address_list" |
526 | }); | 545 | }); |
527 | }, | 546 | }, |
528 | 547 | ||
@@ -646,6 +665,65 @@ Page({ | @@ -646,6 +665,65 @@ Page({ | ||
646 | var ob = {}; | 665 | var ob = {}; |
647 | ob[txt] = this.data.imgUrl + "/miniapp/images/default_g_img.gif"; | 666 | ob[txt] = this.data.imgUrl + "/miniapp/images/default_g_img.gif"; |
648 | this.setData(ob); | 667 | this.setData(ob); |
649 | - } | 668 | + }, |
669 | + | ||
670 | + //// 开启物流的弹窗 | ||
671 | + show_wu_arr:function(e){ | ||
672 | + this.setData({ open_express: 1}); | ||
673 | + }, | ||
674 | + | ||
675 | + //更新下默认,在onshow里面 | ||
676 | + update_code(){ | ||
677 | + var th=this,m_wind=0,def_exp_code=getApp().globalData.userInfo.def_exp_code; | ||
678 | + | ||
679 | + var uii=setInterval(function () { | ||
680 | + if(th.data.wu_arr){ | ||
681 | + clearInterval(uii); | ||
682 | + for (var k = 0; k < th.data.wu_arr.length; k++) { | ||
683 | + var item = th.data.wu_arr[k]; | ||
684 | + if (def_exp_code == item.code) { | ||
685 | + m_wind = k; | ||
686 | + } | ||
687 | + } | ||
688 | + //--如果是立即购买-- | ||
689 | + th.setData({ index: m_wind, is_express: m_wind}); | ||
690 | + } | ||
691 | + },500) | ||
692 | + }, | ||
693 | + | ||
694 | + // 关闭物流的弹窗 | ||
695 | + close_express:function(){ | ||
696 | + this.setData({ open_express:0 }); | ||
697 | + }, | ||
698 | + // 选择物流 | ||
699 | + click_express_name:function(e){ | ||
700 | + var express_name = e.currentTarget.dataset.name, shippingcode = e.currentTarget.dataset.shippingcode; | ||
701 | + var index=e.currentTarget.dataset.idxe; | ||
702 | + var ob={ is_express: index, is_shipping_code: shippingcode,index:index}; | ||
703 | + this.setData(ob); | ||
704 | + }, | ||
705 | + | ||
706 | + //点击确定物流 | ||
707 | + determine_expres:function(e){ | ||
708 | + this.setData({ open_express: 0}); | ||
709 | + this.calculatePrice2(); | ||
710 | + }, | ||
711 | + //设置默认物流 | ||
712 | + select_default_logistics: function () { | ||
713 | + var th=this; | ||
714 | + var is_shipping_code=this.data.is_shipping_code | ||
715 | + getApp().request.put("/api/weshop/users/update",{ | ||
716 | + data: { user_id: getApp().globalData.user_id, store_id: oo.stoid, def_exp_code: is_shipping_code}, | ||
717 | + success:function(rse){ | ||
718 | + if (rse.data.code==0){ | ||
719 | + getApp().globalData.userInfo.def_exp_code=is_shipping_code; | ||
720 | + th.setData({ open_express: 0 }); | ||
721 | + //----计算此时购物车的价格---- | ||
722 | + if(th.data.is_b_now==1) th.calculatePrice2(); | ||
723 | + else th.calculatePrice(); | ||
724 | + } | ||
725 | + } | ||
726 | + }) | ||
727 | + }, | ||
650 | 728 | ||
651 | }); | 729 | }); |
pages/cart/cart2_pt/cart2_pt.wxml
1 | +<wxs module="filters" src="../../../utils/filter.wxs"></wxs> | ||
1 | <form bindsubmit="submitForm"> | 2 | <form bindsubmit="submitForm"> |
2 | <view class="container"> | 3 | <view class="container"> |
3 | <!--要进行判断地址是否显示----> | 4 | <!--要进行判断地址是否显示----> |
4 | <view bindtap="enterAddressPage" class="user-mes" hidden='{{bn_exp_type==1 || kt_type==3}}'> | 5 | <view bindtap="enterAddressPage" class="user-mes" hidden='{{bn_exp_type==1 || kt_type==3}}'> |
5 | <!---默认地址显示------> | 6 | <!---默认地址显示------> |
6 | <block wx:if="{{user_addr!=null}}"> | 7 | <block wx:if="{{user_addr!=null}}"> |
7 | - <view class="user-contact">{{user_addr.consignee}}{{' '}}{{user_addr.mobile}}</view> | 8 | + <view class="user-contact">收货人:{{user_addr.consignee}}{{' '}}{{user_addr.mobile}}</view> |
8 | <view class="location"> | 9 | <view class="location"> |
9 | <view class="address">{{user_addr.more_address}}{{' '}}{{user_addr.address}}</view> | 10 | <view class="address">{{user_addr.more_address}}{{' '}}{{user_addr.address}}</view> |
10 | <view class="pos-icon"> | 11 | <view class="pos-icon"> |
11 | - <image class="wh100" src="{{imgUrl}}/miniapp/images/iconfont-address.png"></image> | 12 | + <image class="wh100" src="{{imgUrl}}/miniapp/images/goodscategory/new_position.png"></image> |
12 | </view> | 13 | </view> |
13 | </view> | 14 | </view> |
14 | <view class="update-logistics"> | 15 | <view class="update-logistics"> |
@@ -27,8 +28,9 @@ | @@ -27,8 +28,9 @@ | ||
27 | 28 | ||
28 | <!------立即购买--------> | 29 | <!------立即购买--------> |
29 | <block> | 30 | <block> |
31 | + <view class="xc-border main-top"></view> | ||
30 | <view class="use-item bfff"> | 32 | <view class="use-item bfff"> |
31 | - <image class="dp" src='{{imgUrl}}/miniapp/images/dianpu.png'> </image> <view>门店:{{bn_pickname}}</view></view> | 33 | + <image class="dp" src='{{imgUrl}}/miniapp/images/goodscategory/new_store.png'> </image> <view>门店:{{bn_pickname}}</view></view> |
32 | <view class="order-detail"> | 34 | <view class="order-detail"> |
33 | <view class="goods-img"> | 35 | <view class="goods-img"> |
34 | <image class="wh100" src="{{bn_goods.original_img}}" | 36 | <image class="wh100" src="{{bn_goods.original_img}}" |
@@ -36,32 +38,60 @@ | @@ -36,32 +38,60 @@ | ||
36 | </view> | 38 | </view> |
37 | <navigator class="order-cont" url="/pages/goods/goodsInfo/goodsInfo?goods_id={{bn_goods.goods_id}}"> | 39 | <navigator class="order-cont" url="/pages/goods/goodsInfo/goodsInfo?goods_id={{bn_goods.goods_id}}"> |
38 | <view class="goods-name">{{bn_goods.goods_name}}</view> | 40 | <view class="goods-name">{{bn_goods.goods_name}}</view> |
39 | - <view class="goods-color"> | ||
40 | - <text wx:if="{{bn_goods.goods_spec!=''}}">{{bn_goods.goods_spec}}/</text>{{bn_goods.goods_color}} | ||
41 | - </view> | 41 | + <!-- 商品属性 --> |
42 | + <view class="flex-vertical fs28 color-gray n_guige"> | ||
43 | + <view class="goods-color"> | ||
44 | + <text wx:if="{{bn_goods.goods_spec!=''}}"> {{bn_goods.goods_spec}}/</text>{{bn_goods.goods_color}} | ||
45 | + </view></view> | ||
46 | + | ||
47 | + | ||
48 | + <!-----商品名称规格------> | ||
49 | + <view class="order-num flex-space-between"> | ||
50 | + <view class="co-red">¥<text class="fs36">{{filters.toFix(bn_goods.shop_price,2)}}</text></view> | ||
51 | + <view class="goods-num">x{{bn_goods.buynum}}</view> | ||
52 | + </view> | ||
42 | </navigator> | 53 | </navigator> |
43 | - <view class="order-num"> | 54 | + <!-- <view class="order-num"> |
44 | <view class="co-red">¥{{bn_goods.shop_price}}</view> | 55 | <view class="co-red">¥{{bn_goods.shop_price}}</view> |
45 | <view class="goods-num">x{{bn_goods.buynum}}</view> | 56 | <view class="goods-num">x{{bn_goods.buynum}}</view> |
46 | - </view> | 57 | + </view> --> |
47 | </view> | 58 | </view> |
48 | <view class="set-mes"> | 59 | <view class="set-mes"> |
49 | <view wx:if="{{order.store_prom}}"><icon color="#f23030" size="16" type="info"></icon>{{order.store_prom}} | 60 | <view wx:if="{{order.store_prom}}"><icon color="#f23030" size="16" type="info"></icon>{{order.store_prom}} |
50 | </view> | 61 | </view> |
51 | 62 | ||
52 | <!--阶梯团是不显示的--> | 63 | <!--阶梯团是不显示的--> |
53 | - <view class="use-item" wx:if="{{kt_type!=3 || is_normal==1}}"> | ||
54 | - <view bindtap='setexptype' data-t='1' style="display:{{bn_t_exp_t==2?'none':'flex'}};"> | ||
55 | - <icon color="{{bn_exp_type==1?'red':'gray'}}" size="16" type="success"></icon> | 64 | + <view class="use-item flex-space-between" wx:if="{{kt_type!=3 || is_normal==1}}"> |
65 | + <view class="flex-vertical"> | ||
66 | + <view bindtap='setexptype' data-t='1' style="display:{{bn_t_exp_t==2?'none':'flex;align-items:center;'}};"> | ||
67 | + <!-- <icon color="{{bn_exp_type==1?'red':'gray'}}" size="16" type="success"></icon> --> | ||
68 | + <block wx:if="{{bn_exp_type==1}}"> | ||
69 | + | ||
70 | + <icon data-t='0' data-txt='cartlist[{{pidx}}].exp_type' color="red" size="16" type="success"></icon> | ||
71 | + </block> | ||
72 | + <block wx:else> | ||
73 | + <view class="circle xc-hookts on"></view> | ||
74 | + </block> | ||
56 | <view class="yu_er">自提</view> | 75 | <view class="yu_er">自提</view> |
57 | </view> | 76 | </view> |
58 | - <view bindtap='setexptype' data-t='0' style="display:{{bn_t_exp_t==1?'none':'flex'}};"> | ||
59 | - <icon color="{{bn_exp_type==0?'red':'gray'}}" size="16" type="success"></icon> | 77 | + <view class="{{bn_t_exp_t==2?'':'xc-left'}}" bindtap='setexptype' data-t='0' style="display:{{bn_t_exp_t==1?'none':'flex;align-items:center;'}};"> |
78 | + <!-- <icon color="{{bn_exp_type==0?'red':'gray'}}" size="16" type="success"></icon> --> | ||
79 | + <block wx:if="{{bn_exp_type==0}}"> | ||
80 | + | ||
81 | + <icon data-t='0' data-txt='cartlist[{{pidx}}].exp_type' color="red" size="16" type="success"></icon> | ||
82 | + </block> | ||
83 | + <block wx:else> | ||
84 | + <view class="circle xc-hookts on"></view> | ||
85 | + </block> | ||
60 | <view class="yu_er">物流</view> | 86 | <view class="yu_er">物流</view> |
61 | </view> | 87 | </view> |
62 | </view> | 88 | </view> |
89 | + <block wx:if="{{bn_exp_type==0}}"> | ||
90 | + <view class="flex-vertical" bindtap="show_wu_arr" data-txt='index'><view class="logistics-name">{{wu_arr[index].name}}</view><view class="xc-right"></view></view> | ||
91 | + </block> | ||
92 | + </view> | ||
63 | 93 | ||
64 | - <!--阶梯团是不显示的--> | 94 | + <!--阶梯团是不显示的 |
65 | <block wx:if="{{kt_type!=3 || is_normal==1 }}"> | 95 | <block wx:if="{{kt_type!=3 || is_normal==1 }}"> |
66 | <view class="use-item" hidden='{{bn_exp_type==1}}'> | 96 | <view class="use-item" hidden='{{bn_exp_type==1}}'> |
67 | <view>使用物流:</view> | 97 | <view>使用物流:</view> |
@@ -69,7 +99,7 @@ | @@ -69,7 +99,7 @@ | ||
69 | <view >{{wu_arr[index].name}}</view> | 99 | <view >{{wu_arr[index].name}}</view> |
70 | </picker> | 100 | </picker> |
71 | </view> | 101 | </view> |
72 | - </block> | 102 | + </block>--> |
73 | 103 | ||
74 | </view> | 104 | </view> |
75 | 105 | ||
@@ -81,11 +111,11 @@ | @@ -81,11 +111,11 @@ | ||
81 | 111 | ||
82 | </view> | 112 | </view> |
83 | </view> | 113 | </view> |
84 | - <view class="coupon-mes"> | ||
85 | - <view>用户备注(50字)</view> | 114 | + <view class="coupon-mes flex-vertical"> |
115 | + <view>留言</view> | ||
86 | <view class="leave-word"> | 116 | <view class="leave-word"> |
87 | - <textarea bindinput="keyUpChangeNum" class="word-box" maxlength="50" name="user_note"></textarea> | ||
88 | - <view class="max-word">{{maxWord}}/50</view> | 117 | + <textarea placeholder-class="fs28" placeholder='给商家留言,最多100字'bindinput="keyUpChangeNum" disabled="{{disabled}}" class="word-box" maxlength="100" name="user_note"></textarea> |
118 | + | ||
89 | </view> | 119 | </view> |
90 | </view> | 120 | </view> |
91 | </block> | 121 | </block> |
@@ -122,5 +152,49 @@ | @@ -122,5 +152,49 @@ | ||
122 | </view> | 152 | </view> |
123 | </form> | 153 | </form> |
124 | 154 | ||
155 | +<!----弹起选择物流名的列表----> | ||
156 | +<view wx:if='{{open_express==1}}' > | ||
157 | + <view class="cover-layer flex-center " bindtap='close_express'> | ||
158 | + </view> | ||
159 | + | ||
160 | + <view class="cx-popup radius {{open_express==1?'up' : 'down'}}" > | ||
161 | + <view class="tops flex"> | ||
162 | + <view class="top-content fs32"> | ||
163 | + <view> | ||
164 | + 选择物流名字 | ||
165 | + </view> | ||
166 | + </view> | ||
167 | + <view class="close-frame" bindtap='close_express' > | ||
168 | + <view class="xc-close-express">×</view> | ||
169 | + </view> | ||
170 | + </view> | ||
171 | + <view class="express_list"> | ||
172 | + <view wx:for="{{wu_arr}}" wx:for-item="express_list" wx:for-index="idx"> | ||
173 | + <view class="express_list_frame" bindtap="click_express_name" | ||
174 | + data-shippingcode="{{express_list.shipping_code}}" | ||
175 | + data-name="{{express_list.name}}" data-idxe="{{idx}}"> | ||
176 | + | ||
177 | + <block wx:if="{{is_express==idx}}"> | ||
178 | + <view class="circle white xc-hook fs20 red-b"><text>Γ</text></view> | ||
179 | + </block> | ||
180 | + <block wx:else> | ||
181 | + <view class="circle xc-hooks"></view> | ||
182 | + </block> | ||
183 | + <view class="fs30">{{express_list.name}}</view> | ||
184 | + | ||
185 | + </view> | ||
186 | + </view> | ||
187 | + </view> | ||
188 | + <view class="flex click-buttem" > | ||
189 | + <view class="xc-determine flex-center" bindtap="determine_expres"> | ||
190 | + <view class="flex-vertical t-c">确定</view> | ||
191 | + </view> | ||
192 | + <view class="xc-confirms flex-center" bindtap="select_default_logistics"> | ||
193 | + <view class="flex-vertical t-c">设为默认</view> | ||
194 | + </view> | ||
195 | + </view> | ||
196 | + | ||
197 | + </view > | ||
198 | +</view> | ||
125 | 199 | ||
126 | <warn id="warn"></warn> | 200 | <warn id="warn"></warn> |
pages/cart/cart2_pt/cart2_pt.wxss
@@ -5,20 +5,22 @@ | @@ -5,20 +5,22 @@ | ||
5 | color: #444; | 5 | color: #444; |
6 | } | 6 | } |
7 | .user-contact { | 7 | .user-contact { |
8 | - padding: 24rpx 80rpx; | 8 | + padding: 24rpx 70rpx; |
9 | + font-weight: 600; | ||
10 | + | ||
9 | } | 11 | } |
10 | 12 | ||
11 | .location { | 13 | .location { |
12 | position: relative; | 14 | position: relative; |
13 | - padding: 0 80rpx 24rpx; | 15 | + padding: 0 70rpx 24rpx; |
14 | } | 16 | } |
15 | 17 | ||
16 | .pos-icon { | 18 | .pos-icon { |
17 | position: absolute; | 19 | position: absolute; |
18 | - left: 30rpx; | ||
19 | - top: 0; | 20 | + left: 22rpx; |
21 | + top: 20rpx; | ||
20 | width: 32rpx; | 22 | width: 32rpx; |
21 | - height: 32.5rpx; | 23 | + height: 40rpx; |
22 | } | 24 | } |
23 | 25 | ||
24 | .border-img { | 26 | .border-img { |
@@ -50,17 +52,17 @@ | @@ -50,17 +52,17 @@ | ||
50 | 52 | ||
51 | .order-detail { | 53 | .order-detail { |
52 | padding: 30rpx 0; | 54 | padding: 30rpx 0; |
53 | - border-bottom: 1px solid #ddd; | 55 | + border-bottom: 7rpx solid #eee; |
54 | color: #777; | 56 | color: #777; |
55 | - min-height: 100rpx; | 57 | + min-height: 190rpx; |
56 | background-color: #fff; | 58 | background-color: #fff; |
57 | 59 | ||
58 | } | 60 | } |
59 | 61 | ||
60 | .goods-img { | 62 | .goods-img { |
61 | float: left; | 63 | float: left; |
62 | - width: 100rpx; | ||
63 | - height: 100rpx; | 64 | + width: 190rpx; |
65 | + height: 190rpx; | ||
64 | margin: 0 20rpx; | 66 | margin: 0 20rpx; |
65 | } | 67 | } |
66 | 68 | ||
@@ -75,6 +77,8 @@ | @@ -75,6 +77,8 @@ | ||
75 | overflow: hidden; | 77 | overflow: hidden; |
76 | margin-bottom: 16rpx; | 78 | margin-bottom: 16rpx; |
77 | font-size: 28rpx; | 79 | font-size: 28rpx; |
80 | + color: #333; | ||
81 | + | ||
78 | } | 82 | } |
79 | 83 | ||
80 | .goods-color { | 84 | .goods-color { |
@@ -90,21 +94,21 @@ | @@ -90,21 +94,21 @@ | ||
90 | line-height: 42rpx; | 94 | line-height: 42rpx; |
91 | } | 95 | } |
92 | 96 | ||
93 | -.set-mes{background-color: #fff; margin-bottom: 20rpx;} | 97 | +.set-mes{background-color: #fff; } |
94 | .use-item{ | 98 | .use-item{ |
95 | display: flex; | 99 | display: flex; |
96 | align-items: center; | 100 | align-items: center; |
97 | height: 92rpx; | 101 | height: 92rpx; |
98 | border-bottom: 1px solid #ddd; | 102 | border-bottom: 1px solid #ddd; |
99 | font-size: 30rpx; | 103 | font-size: 30rpx; |
100 | - padding-left: 20rpx; | ||
101 | - | 104 | + width: 95%; |
105 | + margin: auto; | ||
102 | } | 106 | } |
103 | .use-item>view{ | 107 | .use-item>view{ |
104 | - display: flex;margin-right: 20rpx; | 108 | + display: flex;margin-right: 10rpx; |
105 | } | 109 | } |
106 | .use-item.bfff{ background-color: #fff;} | 110 | .use-item.bfff{ background-color: #fff;} |
107 | -.use-item .dp{width: 56rpx; height: 56rpx;} | 111 | +.use-item .dp{width: 56rpx; height: 56rpx; margin-left: -5rpx} |
108 | 112 | ||
109 | .set-item { | 113 | .set-item { |
110 | justify-content: space-between; | 114 | justify-content: space-between; |
@@ -134,11 +138,15 @@ | @@ -134,11 +138,15 @@ | ||
134 | } | 138 | } |
135 | 139 | ||
136 | .coupon-mes { | 140 | .coupon-mes { |
137 | - margin-bottom: 20rpx; | 141 | + height:95rpx; |
138 | padding: 0 20rpx; | 142 | padding: 0 20rpx; |
139 | background-color: #fff; | 143 | background-color: #fff; |
140 | font-size: 30rpx; | 144 | font-size: 30rpx; |
141 | color: #444; | 145 | color: #444; |
146 | + width: 100%; | ||
147 | + border-bottom: 6rpx solid #eee; | ||
148 | + margin-bottom: 20rpx; | ||
149 | + | ||
142 | } | 150 | } |
143 | 151 | ||
144 | .coupon-title { | 152 | .coupon-title { |
@@ -165,15 +173,16 @@ | @@ -165,15 +173,16 @@ | ||
165 | 173 | ||
166 | .leave-word { | 174 | .leave-word { |
167 | position: relative; | 175 | position: relative; |
168 | - margin: 20rpx 0; | ||
169 | font-size: 24rpx; | 176 | font-size: 24rpx; |
177 | + margin-left: 20rpx; | ||
178 | + | ||
170 | } | 179 | } |
171 | 180 | ||
172 | .word-box { | 181 | .word-box { |
173 | - border: 1px solid #ddd; | ||
174 | - width: 690rpx; | 182 | + |
183 | + width: 600rpx; | ||
175 | padding: 10rpx; | 184 | padding: 10rpx; |
176 | - height: 120rpx; | 185 | + height: 28rpx; |
177 | line-height: 40rpx; | 186 | line-height: 40rpx; |
178 | } | 187 | } |
179 | 188 | ||
@@ -269,5 +278,291 @@ | @@ -269,5 +278,291 @@ | ||
269 | .add_new{height: 60rpx; line-height: 60rpx;} | 278 | .add_new{height: 60rpx; line-height: 60rpx;} |
270 | .addr_jia{width: 45rpx; height: 45rpx; border: 1rpx solid #ddd; | 279 | .addr_jia{width: 45rpx; height: 45rpx; border: 1rpx solid #ddd; |
271 | margin-right: 15rpx; margin-left: 20rpx; vertical-align: middle;} | 280 | margin-right: 15rpx; margin-left: 20rpx; vertical-align: middle;} |
272 | -.yu_er{margin-left: 15rpx;} .wuliu{margin-left: 20rpx;} | 281 | +.yu_er{margin-left: 15rpx;} .wuliu{margin-left: 20rpx;} |
282 | + | ||
283 | + | ||
284 | +/* 自定义弹出窗口 */ | ||
285 | +.cx-popup{ | ||
286 | + width:100%; | ||
287 | + height:920rpx; | ||
288 | + background: #fff; | ||
289 | + z-index: 35; | ||
290 | + border-top-left-radius: 20rpx; | ||
291 | + border-top-right-radius: 20rpx; | ||
292 | + position:fixed; | ||
293 | + bottom:0; | ||
294 | + padding-bottom: 25rpx; | ||
295 | + | ||
296 | +} | ||
297 | + | ||
298 | +.cx-popup .top{ | ||
299 | + width:95%; | ||
300 | + height:100rpx; | ||
301 | + border-bottom:3rpx solid #ddd; | ||
302 | + margin: auto; | ||
303 | + margin-top: 30rpx; | ||
304 | + | ||
305 | +} | ||
306 | +.xc-top-content{ | ||
307 | + width: 93%; | ||
308 | + height:85rpx; | ||
309 | + padding-top: 30rpx; | ||
310 | + font-size: 34rpx; | ||
311 | + font-weight: 600; | ||
312 | + | ||
313 | +} | ||
314 | + | ||
315 | + | ||
316 | +.xc-valid-coupon{ | ||
317 | + width: 90%; | ||
318 | + height:40rpx; | ||
319 | + padding-top: 24rpx; | ||
320 | + overflow: hidden; | ||
321 | +} | ||
322 | +.xc-frame{ | ||
323 | + width: 100%; | ||
324 | + height:68.9%; | ||
325 | +} | ||
326 | + | ||
327 | +.xc-frame .list-frame{ | ||
328 | + width: 95%; | ||
329 | + height: 100%; | ||
330 | + overflow-y:scroll; | ||
331 | + | ||
332 | +} | ||
333 | +.xc-close-frame{ | ||
334 | + margin-top:-10rpx; | ||
335 | + | ||
336 | +} | ||
337 | + | ||
338 | +.xc-close{ | ||
339 | + width: 37rpx; | ||
340 | + height: 37rpx; | ||
341 | + border-radius: 50%; | ||
342 | + border: 3rpx solid #333; | ||
343 | + text-align: center; | ||
344 | + line-height: 34rpx; | ||
345 | + font-size: 29rpx; | ||
346 | + color: #333; | ||
347 | + | ||
348 | +} | ||
349 | +.xc-money{ | ||
350 | + color: #af2346; | ||
351 | + font-size: 35rpx; | ||
352 | +} | ||
353 | + | ||
354 | +.xc-money-frame{ | ||
355 | + margin-left:35rpx; | ||
356 | + | ||
357 | +} | ||
358 | +.xc-coupon-effect{ | ||
359 | + width: 99%; | ||
360 | + min-height: 100rpx; | ||
361 | + border-bottom:3rpx solid #ddd; | ||
362 | + | ||
363 | + | ||
364 | +} | ||
365 | +.xc-goods-coupon{ | ||
366 | + width: 85%; | ||
367 | + height:100%; | ||
368 | + | ||
369 | +} | ||
370 | +.xc-title{ | ||
371 | + width:50%; | ||
372 | + margin-left:222rpx; | ||
373 | + | ||
374 | +} | ||
375 | +.xc-coupon-money0{ | ||
376 | + color: #c91e31; | ||
377 | + font-size: 35rpx; | ||
378 | + line-height: 40rpx; | ||
379 | + | ||
380 | +} | ||
381 | +.xc-coupon-money{ | ||
382 | + color: #c91e31; | ||
383 | + font-size: 35rpx; | ||
384 | + line-height: 40rpx; | ||
385 | + padding-top: 10px; | ||
386 | + | ||
387 | +} | ||
388 | +.xc-coupon-money1{ | ||
389 | + color: #444; | ||
390 | + font-size: 28rpx; | ||
391 | + line-height: 60rpx; | ||
392 | + | ||
393 | + | ||
394 | +} | ||
395 | +.xc-coupon-time{ | ||
396 | + height: 50rpx; | ||
397 | + font-size: 27rpx; | ||
398 | + color: #a4a4a4; | ||
399 | +} | ||
400 | +.xc-coupon-time .time{ | ||
401 | + margin-left: 15rpx; | ||
402 | + font-size: 27rpx; | ||
403 | +} | ||
404 | +.xc-coupon-selection{ | ||
405 | + height:100%; | ||
406 | +} | ||
407 | + | ||
408 | +.xc-confirm { | ||
409 | + width: 48%; | ||
410 | + border-radius: 50rpx; | ||
411 | + height: 50rpx; | ||
412 | + margin:0 auto; | ||
413 | + background:#d60021; | ||
414 | + color:#fff; | ||
415 | + font-size:28rpx; | ||
416 | + margin-top: 28rpx; | ||
417 | +} | ||
418 | + | ||
419 | +.up{ animation: up .7s; } | ||
420 | +.down{ animation: down 1s; } | ||
421 | +@keyframes up { 0% { transform: translateY(550rpx); } 100% { transform: translateY(0); } } | ||
422 | +@keyframes down { 0% { transform: translateY(0); } 100% { transform: translateY(550rpx); } } | ||
423 | + | ||
424 | +.xc-not-Selection{ | ||
425 | + width: 40rpx; | ||
426 | + height: 40rpx; | ||
427 | + background: #eeeeee; | ||
428 | +} | ||
429 | + | ||
430 | + | ||
431 | +.xc-close-express{ | ||
432 | + width: 40rpx; | ||
433 | + height: 40rpx; | ||
434 | + border-radius: 50%; | ||
435 | + border: 3rpx solid #333; | ||
436 | + text-align: center; | ||
437 | + font-size:32rpx; | ||
438 | + line-height: 38rpx; | ||
439 | + color: #333; | ||
440 | + margin-top: 5rpx; | ||
441 | +} | ||
442 | +.cx-popup .tops{ | ||
443 | + width: 100%; | ||
444 | + height: 145rpx; | ||
445 | + border-bottom: 3rpx solid #eee; | ||
446 | + | ||
447 | +} | ||
448 | +.top-content { | ||
449 | + width: 82%; | ||
450 | + padding-top: 33px; | ||
451 | + height: 100%; | ||
452 | + padding-left: 40rpx; | ||
453 | +} | ||
454 | +.close-frame{ | ||
455 | + margin-top: 30rpx; | ||
456 | + | ||
457 | +} | ||
458 | +.cx-popup.radius{ | ||
459 | + | ||
460 | + height: 650rpx; | ||
461 | + | ||
462 | +} | ||
463 | +.xc-hook { | ||
464 | + width: 33rpx; | ||
465 | + height: 33rpx; | ||
466 | + transform: rotate(-135deg); | ||
467 | + line-height: 35rpx; | ||
468 | + text-align: center; | ||
469 | + margin-right: 20rpx | ||
470 | + | ||
471 | + | ||
472 | +} | ||
473 | +.xc-hooks { | ||
474 | + width: 30rpx; | ||
475 | + height: 30rpx; | ||
476 | + border: 1rpx solid #999; | ||
477 | + margin-right: 20rpx; | ||
478 | +} | ||
479 | +.express_list_frame{ | ||
480 | + display: flex; | ||
481 | + height: 80rpx; | ||
482 | + align-items: center; | ||
483 | + padding-left: 40rpx; | ||
484 | + border-bottom: 1rpx solid #eee; | ||
485 | + | ||
486 | +} | ||
487 | +.express_list{ | ||
488 | + width: 100%; | ||
489 | + height: 65%; | ||
490 | + overflow-y: scroll; | ||
491 | + overflow: hidden; | ||
492 | +} | ||
493 | +.xc-confirms { | ||
494 | + width: 40%; | ||
495 | + border-radius: 50rpx; | ||
496 | + height: 55rpx; | ||
497 | + margin:0 auto; | ||
498 | + font-size:28rpx; | ||
499 | + background: #fff; | ||
500 | + color: #333; | ||
501 | + border: 2rpx solid #333; | ||
502 | + | ||
503 | +} | ||
504 | + | ||
505 | +.xc-right{ | ||
506 | + width:20rpx; | ||
507 | + height:20rpx; | ||
508 | + border-top:2rpx solid #000; | ||
509 | + border-right:2rpx solid #000; | ||
510 | + transform:rotate(45deg); | ||
511 | + display:inline-block; | ||
512 | + margin-right: 5rpx; | ||
513 | + margin-left: 10rpx; | ||
514 | + | ||
515 | +} | ||
516 | + | ||
517 | + | ||
518 | +.xc-left{ | ||
519 | + margin-left: 45rpx; | ||
520 | +} | ||
521 | +.xc-border{ | ||
522 | + border-top:8rpx solid #eee; | ||
523 | +width: 100% | ||
524 | +} | ||
525 | +.main-top{ | ||
526 | +margin-top: 20rpx; | ||
527 | + | ||
528 | +} | ||
529 | +.order-num { | ||
530 | + margin-top: 25rpx; | ||
531 | + font-size: 24rpx; | ||
532 | + line-height: 42rpx; | ||
533 | + width: 95%; | ||
534 | + | ||
535 | +} | ||
536 | +.goods-num{ | ||
537 | + font-size: 28rpx; | ||
538 | +color: #333; | ||
539 | + | ||
540 | +} | ||
541 | +.click-buttem{ | ||
542 | +width: 90%; | ||
543 | +margin: auto; | ||
544 | +} | ||
545 | +.xc-determine{ | ||
546 | + height: 55rpx; | ||
547 | + width: 40%; | ||
548 | + border-radius: 50rpx; | ||
549 | +background: #d60021; | ||
550 | +color: #fff; | ||
551 | +font-size: 28rpx; | ||
552 | +margin: 0 auto; | ||
553 | + | ||
554 | +} | ||
555 | +.xc-hookts{ | ||
556 | +border: 1rpx solid #999; | ||
557 | + | ||
558 | +} | ||
559 | +.xc-hookts.on{ | ||
560 | + width:30rpx; | ||
561 | +height:30rpx; | ||
562 | + | ||
563 | +} | ||
564 | +.color-gray{ | ||
565 | + color: #808080; | ||
566 | +} | ||
273 | 567 | ||
568 | +.n_guige{ display: inline-block; background:rgb(236, 236, 236); color: rgb(63,63,63); padding: 3rpx 10rpx; border-radius: 3rpx } | ||
274 | \ No newline at end of file | 569 | \ No newline at end of file |
pages/cart/cart_wk/cart_wk.js
@@ -541,7 +541,7 @@ Page({ | @@ -541,7 +541,7 @@ Page({ | ||
541 | //------支付成功页面-------- | 541 | //------支付成功页面-------- |
542 | jumpPaymentPage: function(order_sn,order_amount) { | 542 | jumpPaymentPage: function(order_sn,order_amount) { |
543 | wx.setStorageSync("order:order_list:update", !0), wx.redirectTo({ | 543 | wx.setStorageSync("order:order_list:update", !0), wx.redirectTo({ |
544 | - url: "/pages/payment/payment/payment?order_sn=" + order_sn + "&order_amount=" + order_amount | 544 | + url: "/pages/payment/pay_success/pay_success?order_sn=" + order_sn + "&type=1", |
545 | }); | 545 | }); |
546 | }, | 546 | }, |
547 | 547 |
pages/goods/categoryList/categoryList.js
@@ -22,14 +22,31 @@ Page({ | @@ -22,14 +22,31 @@ Page({ | ||
22 | // 导航字母 | 22 | // 导航字母 |
23 | letters: ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', | 23 | letters: ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', |
24 | 'U', 'V', 'W', 'X', 'Y', 'Z'], | 24 | 'U', 'V', 'W', 'X', 'Y', 'Z'], |
25 | + //控制新旧分类版本 | ||
26 | + is_used_share:0, | ||
27 | + //国家的控制属性 | ||
28 | + is_country:1, | ||
29 | + //品牌的控制属性 | ||
30 | + is_brand:1, | ||
25 | 31 | ||
32 | + //选择分类的控制属性 | ||
33 | + select_classify_on:223, | ||
34 | + index:223, | ||
35 | + classify_name:"国家",//项目类型 | ||
36 | + brand_list:null,//品牌列表 | ||
37 | + | ||
38 | + one_level_classify:[],// 新的版本左边的边分类1级 | ||
39 | + is_level_three:0,//判断有没有3级 | ||
40 | + cat_id:0, | ||
41 | + pl_timer: null,//只有品类的定时器 | ||
42 | + is_pl_time:0, | ||
26 | }, | 43 | }, |
27 | onLoad: function(tt) { | 44 | onLoad: function(tt) { |
28 | const res = wx.getSystemInfoSync(), | 45 | const res = wx.getSystemInfoSync(), |
29 | letters = this.data.letters; | 46 | letters = this.data.letters; |
30 | 47 | ||
31 | var that = this; | 48 | var that = this; |
32 | - this.requestFirstCategoris(); | 49 | + |
33 | this.setData({ | 50 | this.setData({ |
34 | abc: t.globalData.heigth-88-88-16, | 51 | abc: t.globalData.heigth-88-88-16, |
35 | windowHeight: res.windowHeight, | 52 | windowHeight: res.windowHeight, |
@@ -55,20 +72,58 @@ Page({ | @@ -55,20 +72,58 @@ Page({ | ||
55 | } | 72 | } |
56 | this.setData({ | 73 | this.setData({ |
57 | lettersPosition: temp | 74 | lettersPosition: temp |
58 | - }) | 75 | + }); |
76 | + | ||
77 | + if (this.data.is_used_share==0){ | ||
78 | + | ||
79 | + this.get_nation(); | ||
80 | + } | ||
59 | 81 | ||
60 | 82 | ||
61 | }, | 83 | }, |
62 | 84 | ||
63 | onShow:function(){ | 85 | onShow:function(){ |
64 | var that=this; | 86 | var that=this; |
87 | + this.requestFirstCategoris(); | ||
88 | + if(getApp().globalData.user_id) getApp().requestCardNum(); | ||
65 | 89 | ||
66 | getApp().getConfig2(function (e) { | 90 | getApp().getConfig2(function (e) { |
91 | + | ||
92 | + var data=e; | ||
93 | + var switch_list_data = data.switch_list; | ||
94 | + var switch_list = JSON.parse(switch_list_data); | ||
95 | + var is_newsgoodstype = switch_list.is_newsgoodstype; | ||
96 | + that.setData({ is_used_share :is_newsgoodstype}); | ||
67 | if (e.categoryset.indexOf("," + 1 + ",") != -1) { that.setData({ is_show_pl: 1 }); } | 97 | if (e.categoryset.indexOf("," + 1 + ",") != -1) { that.setData({ is_show_pl: 1 }); } |
68 | if (e.categoryset.indexOf("," + 3 + ",") != -1) { that.setData({ is_show_pp: 1 }); } | 98 | if (e.categoryset.indexOf("," + 3 + ",") != -1) { that.setData({ is_show_pp: 1 }); } |
69 | if (e.categoryset.indexOf("," + 2 + ",") != -1) { that.setData({ is_show_gb: 1 }); } | 99 | if (e.categoryset.indexOf("," + 2 + ",") != -1) { that.setData({ is_show_gb: 1 }); } |
70 | that.setData({ store_config: e,is_do:1 }); | 100 | that.setData({ store_config: e,is_do:1 }); |
101 | + if ( that.data.is_show_gb != 1 && that.data.is_show_pp != 1){ | ||
102 | + | ||
103 | + | ||
104 | + that.data.pl_timer = setInterval(function () { | ||
105 | + | ||
106 | + that.requestFirstCategoris(); | ||
107 | + console.log("8888888888888888888", that.data.one_level_classify.length); | ||
108 | + if (that.data.one_level_classify.length>0){ | ||
109 | + console.log("7777777777777777777777", that.data.one_level_classify); | ||
110 | + //清除定时器 | ||
111 | + clearInterval(that.data.pl_timer); | ||
112 | + } | ||
113 | + },1000); | ||
114 | + | ||
115 | + console.log(that.data.one_level_classify); | ||
116 | + that.setData({ select_classify_on: 0, index: 0, goodslist: one_level_classify[0]}); | ||
117 | + | ||
118 | + } else if (that.data.is_show_gb != 1 ){ | ||
119 | + | ||
120 | + | ||
121 | + that.setData({ select_classify_on: 220, classify_name: "品牌" }); | ||
122 | + } | ||
71 | 123 | ||
124 | + var one_level_classify = that.data.one_level_classify; | ||
125 | + | ||
126 | + | ||
72 | if (that.data.is_show_pl) that.setData({ currentTab: 0 }); | 127 | if (that.data.is_show_pl) that.setData({ currentTab: 0 }); |
73 | else if (that.data.is_show_gb){ that.setData({ currentTab: 1 });that.get_nation(); } | 128 | else if (that.data.is_show_gb){ that.setData({ currentTab: 1 });that.get_nation(); } |
74 | else if (that.data.is_show_pp) {that.setData({ currentTab: 2 });that.get_brand(); } | 129 | else if (that.data.is_show_pp) {that.setData({ currentTab: 2 });that.get_brand(); } |
@@ -98,13 +153,17 @@ Page({ | @@ -98,13 +153,17 @@ Page({ | ||
98 | success: function(e) { | 153 | success: function(e) { |
99 | var arr=new Array(); | 154 | var arr=new Array(); |
100 | var dda = e.data.data.pageData; | 155 | var dda = e.data.data.pageData; |
101 | - console.log(dda.length); | 156 | + if (dda != null && dda !=""&&dda!=undefined){ |
157 | + t.setData({is_pl_time:1}); | ||
158 | + } | ||
159 | + | ||
160 | + if (t.data.is_used_share == 0) {//is_used_share控制新旧版本 | ||
102 | for(var i=0;i<dda.length;i++){ | 161 | for(var i=0;i<dda.length;i++){ |
103 | if (parseInt(dda[i].level)==1){ | 162 | if (parseInt(dda[i].level)==1){ |
104 | var item = {items: dda[i], array: new Array()} | 163 | var item = {items: dda[i], array: new Array()} |
105 | arr.push(item); | 164 | arr.push(item); |
106 | } else if (parseInt(dda[i].level) == 2){ | 165 | } else if (parseInt(dda[i].level) == 2){ |
107 | - for (var j = 0; j < arr.length;j++ ){ | 166 | + for (var j = 0; j < arr.length;j++ ){ |
108 | if (parseInt(dda[i].parent_id) == parseInt(arr[j].items.id)){ | 167 | if (parseInt(dda[i].parent_id) == parseInt(arr[j].items.id)){ |
109 | arr[j].array.push(dda[i]); break; | 168 | arr[j].array.push(dda[i]); break; |
110 | } | 169 | } |
@@ -114,6 +173,52 @@ Page({ | @@ -114,6 +173,52 @@ Page({ | ||
114 | } | 173 | } |
115 | } | 174 | } |
116 | t.setData({ catelist: arr}); | 175 | t.setData({ catelist: arr}); |
176 | + }else{ | ||
177 | + | ||
178 | + //---------新的版本---------------- | ||
179 | + for (var i = 0; i < dda.length; i++) { | ||
180 | + //--要排队的元素--- | ||
181 | + var need_to_insert=dda[i]; | ||
182 | + if (parseInt(need_to_insert.level) == 1) { | ||
183 | + var item = { items: need_to_insert, array: new Array() }//判断数组的长度看看有没有2级菜单 | ||
184 | + arr.push(item); | ||
185 | + } else if (parseInt(need_to_insert.level) == 2) { | ||
186 | + | ||
187 | + for (var j = 0; j < arr.length; j++) { | ||
188 | + | ||
189 | + | ||
190 | + if (parseInt(need_to_insert.parent_id) == parseInt(arr[j].items.id)) { | ||
191 | + | ||
192 | + var ishaf_two = { items: need_to_insert, arrays: new Array() }; | ||
193 | + arr[j].array.push(ishaf_two); arr.ishaf_two = 0; | ||
194 | + } | ||
195 | + } | ||
196 | + } else if (parseInt(need_to_insert.level) == 3) {//判断有3级的时候在二级里添加一个数组 | ||
197 | + | ||
198 | + for (var dd = 0; dd < arr.length; dd++) { | ||
199 | + for (var pp = 0; pp < arr[dd].array.length; pp++) { | ||
200 | + //--判断二级-- | ||
201 | + var two_item = arr[dd].array; | ||
202 | + | ||
203 | + if (two_item && two_item.length>0){ | ||
204 | + | ||
205 | + if (parseInt(need_to_insert.parent_id) == parseInt(two_item[pp].items.id)) { | ||
206 | + | ||
207 | + arr[dd].array[pp].arrays.push(need_to_insert); arr.ishaf_three = 0; break; | ||
208 | + } | ||
209 | + | ||
210 | + } | ||
211 | + | ||
212 | + } | ||
213 | + } | ||
214 | + } | ||
215 | + | ||
216 | + } | ||
217 | + | ||
218 | + console.log("现在是1级与2级所有的数据", arr) | ||
219 | + t.setData({one_level_classify:arr}); | ||
220 | + | ||
221 | + } | ||
117 | } | 222 | } |
118 | }); | 223 | }); |
119 | }, | 224 | }, |
@@ -220,9 +325,10 @@ Page({ | @@ -220,9 +325,10 @@ Page({ | ||
220 | 325 | ||
221 | //跳转到分类的商品列表 | 326 | //跳转到分类的商品列表 |
222 | go_cate:function(t){ | 327 | go_cate:function(t){ |
223 | - var cid= t.currentTarget.dataset.cid; | ||
224 | - var pid = t.currentTarget.dataset.pid; | ||
225 | - var lurl = "/pages/goods/goodsList/goodsList?cat_id=" + cid + "&pid=" + pid; | 328 | + var cid= t.currentTarget.dataset.cid; |
329 | + var pid = t.currentTarget.dataset.pid; | ||
330 | + var lurl = "/pages/goods/goodsList/goodsList?cat_id=" + cid; | ||
331 | + lurl+="&pid="+pid; | ||
226 | wx.navigateTo({ url: lurl}); | 332 | wx.navigateTo({ url: lurl}); |
227 | }, | 333 | }, |
228 | 334 | ||
@@ -239,10 +345,6 @@ Page({ | @@ -239,10 +345,6 @@ Page({ | ||
239 | var lurl = "/pages/goods/goodsList/goodsList?nation_id=" + cid; | 345 | var lurl = "/pages/goods/goodsList/goodsList?nation_id=" + cid; |
240 | wx.navigateTo({ url: lurl }); | 346 | wx.navigateTo({ url: lurl }); |
241 | }, | 347 | }, |
242 | - | ||
243 | - | ||
244 | - | ||
245 | - | ||
246 | //获取国别 | 348 | //获取国别 |
247 | get_nation:function(){ | 349 | get_nation:function(){ |
248 | var s = this; | 350 | var s = this; |
@@ -254,6 +356,7 @@ Page({ | @@ -254,6 +356,7 @@ Page({ | ||
254 | }, | 356 | }, |
255 | success: function (e) { | 357 | success: function (e) { |
256 | var dda = e.data.data.pageData; | 358 | var dda = e.data.data.pageData; |
359 | + console.log("国家的数据", dda); | ||
257 | s.setData({ nationlist:dda}) | 360 | s.setData({ nationlist:dda}) |
258 | } | 361 | } |
259 | }); | 362 | }); |
@@ -284,6 +387,8 @@ Page({ | @@ -284,6 +387,8 @@ Page({ | ||
284 | success: function (e) { | 387 | success: function (e) { |
285 | var arr=new Array(); | 388 | var arr=new Array(); |
286 | var dda = e.data.data.pageData; | 389 | var dda = e.data.data.pageData; |
390 | + console.log("商品数据",dda); | ||
391 | + s.setData({brand_list:dda}); | ||
287 | for (var i = 0; i < dda.length; i++) { | 392 | for (var i = 0; i < dda.length; i++) { |
288 | 393 | ||
289 | dda[i].logo = oo.imghost+dda[i].logo; | 394 | dda[i].logo = oo.imghost+dda[i].logo; |
@@ -321,7 +426,14 @@ Page({ | @@ -321,7 +426,14 @@ Page({ | ||
321 | var _errImg = e.target.dataset.errorimg; | 426 | var _errImg = e.target.dataset.errorimg; |
322 | var _errObj = {}; | 427 | var _errObj = {}; |
323 | _errObj[_errImg] = this.data.iurl+"/miniapp/images/default_g_img.gif"; | 428 | _errObj[_errImg] = this.data.iurl+"/miniapp/images/default_g_img.gif"; |
324 | - this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ; | 429 | + this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ; |
430 | + }, | ||
431 | + //商品图片失败,默认图片 | ||
432 | + goods_bnerr: function (e) { | ||
433 | + var _errImg = e.target.dataset.err; | ||
434 | + var _errObj = {}; | ||
435 | + _errObj[_errImg] = this.data.iurl + "/miniapp/images/no_cate_def.png"; | ||
436 | + this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ; | ||
325 | }, | 437 | }, |
326 | 438 | ||
327 | goseach:function(){ | 439 | goseach:function(){ |
@@ -339,7 +451,86 @@ Page({ | @@ -339,7 +451,86 @@ Page({ | ||
339 | _errObj[_errImg] = "/public/images/category.png"; | 451 | _errObj[_errImg] = "/public/images/category.png"; |
340 | this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ; | 452 | this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ; |
341 | 453 | ||
342 | - } | 454 | + }, |
455 | + // 新的版本分类点击一级分类 | ||
456 | + click_classify:function(e){ | ||
457 | + this.data.ishaf_three=0; | ||
458 | + var indexs=e.currentTarget.dataset.index; | ||
459 | + var name = e.currentTarget.dataset.name; | ||
460 | + var cid = e.currentTarget.dataset.cid; | ||
461 | + var pid = e.currentTarget.dataset.pid; | ||
462 | + var arr = e.currentTarget.dataset.arr; | ||
463 | + console.log("数据是什么",arr); | ||
464 | + if (indexs==220){ | ||
465 | + this.get_brand(); | ||
466 | + } | ||
467 | + | ||
468 | + if (arr!="undefined" && arr!=undefined){ | ||
469 | + if (arr.length==0){ | ||
470 | + var lurl = "/pages/goods/goodsList/goodsList?cat_id=" + cid + "&pid=" + pid; | ||
471 | + wx.navigateTo({ url: lurl }); | ||
472 | + return false; | ||
473 | + } | ||
474 | + if (arr.length != 0){ | ||
475 | + | ||
476 | + for(var i=0;i<arr.length;i++){ | ||
477 | + if (arr[i].arrays.length>0) { | ||
478 | + | ||
479 | + this.setData({ is_level_three: 1 }); | ||
480 | + break; | ||
481 | + } | ||
482 | + this.setData({ is_level_three: 0 }); | ||
483 | + } | ||
484 | + if (this.data.is_level_three!=1) { | ||
485 | + | ||
486 | + | ||
487 | + this.setData({ select_classify_on: indexs, index: indexs, classify_name: name, goodslist: arr }); | ||
488 | + | ||
489 | + | ||
490 | + } else { | ||
491 | + this.setData({ select_classify_on: indexs, index: indexs, goodslist: arr }); | ||
492 | + | ||
343 | 493 | ||
494 | + } | ||
495 | + } | ||
496 | + } | ||
497 | + | ||
498 | + this.setData({ select_classify_on: indexs, index: indexs, classify_name: name, cat_id: cid}); | ||
499 | + | ||
500 | + }, | ||
501 | +// 图片失败 | ||
502 | + bind_bnerr_xc: function (e) { | ||
503 | + var _errImg = e.target.dataset.errorimg; | ||
504 | + var _errurl = e.target.dataset.url; | ||
505 | + | ||
506 | + var _errObj = {}; | ||
507 | + _errObj[_errImg] = "/miniapp/images/default_g_img.gif"; | ||
508 | + this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ; | ||
509 | + }, | ||
510 | + //选择更多 | ||
511 | + select_more:function(e){ | ||
512 | + var cid = e.currentTarget.dataset.cid; | ||
513 | + var pid = e.currentTarget.dataset.pid; | ||
514 | + console.log("选择更多"+cid); | ||
515 | + var lurl = "/pages/goods/goodsList/goodsList?cat_id=" + cid + "&pid=" + pid; | ||
516 | + wx.navigateTo({ url: lurl }); | ||
517 | + | ||
518 | + }, | ||
519 | +//扫一扫 | ||
520 | + getScancode:function(){ | ||
521 | + var _this = this; | ||
522 | + // 允许从相机和相册扫码 | ||
523 | + wx.scanCode({ | ||
524 | + success: (res) => { | ||
525 | + var result = res.result; | ||
526 | + wx.navigateTo({ | ||
527 | + url: "/pages/goods/search/search?s_key="+result, | ||
528 | + }); | ||
529 | + } | ||
530 | + }) | ||
531 | + }, | ||
532 | + onUnload: function () { | ||
533 | + this.destroyActivityTimer(); | ||
534 | + }, | ||
344 | 535 | ||
345 | }); | 536 | }); |
346 | \ No newline at end of file | 537 | \ No newline at end of file |
pages/goods/categoryList/categoryList.wxml
1 | - | 1 | +<block wx:if="{{is_used_share==0}}"> |
2 | <view class='top_view' wx:if="{{is_show_pl || is_show_gb || is_show_pp }}"> | 2 | <view class='top_view' wx:if="{{is_show_pl || is_show_gb || is_show_pp }}"> |
3 | <view class="swiper-tab" > | 3 | <view class="swiper-tab" > |
4 | <view wx:if="{{is_show_pl}}" class="swiper-tab-item {{currentTab==0?'active':''}}" | 4 | <view wx:if="{{is_show_pl}}" class="swiper-tab-item {{currentTab==0?'active':''}}" |
@@ -7,10 +7,11 @@ | @@ -7,10 +7,11 @@ | ||
7 | data-current="1" bindtap="clickTab">国家</view> | 7 | data-current="1" bindtap="clickTab">国家</view> |
8 | <view wx:if="{{is_show_pp}}" class="swiper-tab-item {{currentTab==2?'active':''}}" | 8 | <view wx:if="{{is_show_pp}}" class="swiper-tab-item {{currentTab==2?'active':''}}" |
9 | data-current="2" bindtap="clickTab">品牌</view> | 9 | data-current="2" bindtap="clickTab">品牌</view> |
10 | - </view> | 10 | + </view> |
11 | </view> | 11 | </view> |
12 | 12 | ||
13 | -<view class="search-box" bindtap="goseach"> | 13 | +<view class="search-box " bindtap="goseach"> |
14 | + | ||
14 | <view class="search-inner"> | 15 | <view class="search-inner"> |
15 | <view class="search-img"> | 16 | <view class="search-img"> |
16 | <image class="wh100" src="{{iurl}}/miniapp/images/search.png"></image> | 17 | <image class="wh100" src="{{iurl}}/miniapp/images/search.png"></image> |
@@ -28,7 +29,7 @@ | @@ -28,7 +29,7 @@ | ||
28 | 29 | ||
29 | <block wx:for="{{catelist}}" wx:for-item="fitem" > | 30 | <block wx:for="{{catelist}}" wx:for-item="fitem" > |
30 | <view class='f_item'> | 31 | <view class='f_item'> |
31 | - <view class="pic_view" bindtap="go_cate" data-cid="{{fitem.items.id}}" data-pid="0"><image class='fl_img' src='{{iurl}}{{fitem.items.image}}' binderror="bind_bnerr2" data-errorimg="catelist[{{index}}].items.image"></image> | 32 | + <view class="pic_view" bindtap="go_cate" data-cid="{{fitem.items.id}}" data-pid="0"><image class='fl_img' src='{{iurl}}{{fitem.items.image}}' binderror="bind_bnerr2" data-errorimg="catelist[{{index}}].items.image"></image> |
32 | <view class='over_view'></view> | 33 | <view class='over_view'></view> |
33 | <text class='f_item_over_t'>{{fitem.items.name}}</text></view> | 34 | <text class='f_item_over_t'>{{fitem.items.name}}</text></view> |
34 | <view class='fenlei_text_v'> | 35 | <view class='fenlei_text_v'> |
@@ -51,7 +52,7 @@ | @@ -51,7 +52,7 @@ | ||
51 | <view><image class='n_img' src='{{iurl}}{{bitem.logo}}'></image> | 52 | <view><image class='n_img' src='{{iurl}}{{bitem.logo}}'></image> |
52 | <view class='nation_box'> | 53 | <view class='nation_box'> |
53 | <view class='nt_1'><text class="nt_1_t">{{bitem.name}}</text></view> | 54 | <view class='nt_1'><text class="nt_1_t">{{bitem.name}}</text></view> |
54 | - <view class='nt_2'>enname</view> | 55 | + <view class='nt_2'>{{bitem.enname}}</view> |
55 | </view> | 56 | </view> |
56 | </view> | 57 | </view> |
57 | </view> | 58 | </view> |
@@ -67,8 +68,9 @@ | @@ -67,8 +68,9 @@ | ||
67 | <view class="group-users"> | 68 | <view class="group-users"> |
68 | <view wx:for="{{group.array}}" bindtap="go_brand" data-bid="{{user.id}}" | 69 | <view wx:for="{{group.array}}" bindtap="go_brand" data-bid="{{user.id}}" |
69 | wx:for-item="user" wx:for-index="idx" class="user box box-lr"> | 70 | wx:for-item="user" wx:for-index="idx" class="user box box-lr"> |
70 | - <image class="user-avatar-img" src="{{user.logo}}" | ||
71 | - binderror="bind_bnerr" data-errorimg="groups[{{pidx}}].array[{{idx}}].logo"></image> | 71 | + <image class="user-avatar-img" src="{{user.logo}}" |
72 | + data-errorimg="groups[{{pidx}}].array[{{idx}}].logo" | ||
73 | + binderror="bind_bnerr"></image> | ||
72 | </view> | 74 | </view> |
73 | </view> | 75 | </view> |
74 | </view> | 76 | </view> |
@@ -97,3 +99,169 @@ | @@ -97,3 +99,169 @@ | ||
97 | <navigator class="lookat" openType="switchTab" url="/pages/index/index/index"> 去逛逛 </navigator> | 99 | <navigator class="lookat" openType="switchTab" url="/pages/index/index/index"> 去逛逛 </navigator> |
98 | </view> | 100 | </view> |
99 | </block> | 101 | </block> |
102 | +</block> | ||
103 | +<block wx:else> | ||
104 | +<!-- 新版分类头部 --> | ||
105 | +<view class="xc-search-box flex-center white_b"> | ||
106 | + <view class="share-height t-c" bindtap="getScancode" > | ||
107 | + <image class="scanning_black-img"src="{{iurl}}/miniapp/images/goodscategory/scanning_black.png"></image> | ||
108 | + <view class="fs24"> | ||
109 | + 扫一扫 | ||
110 | + </view> | ||
111 | + </view> | ||
112 | + <view class="xc-search-inner "> | ||
113 | + <view class="search-img left"> | ||
114 | + <image class="wh100" src="{{iurl}}/miniapp/images/search.png"></image> | ||
115 | + </view> | ||
116 | + <input bindfocus="goseach" class="search-cont" placeholder="搜索你想要的生活" type="text"></input> | ||
117 | + </view> | ||
118 | +</view> | ||
119 | + | ||
120 | +<!-- 分类项目内容 --> | ||
121 | +<view class="flex project_height"> | ||
122 | +<!-- 分类项目的类型 --> | ||
123 | +<view class="project_type"> | ||
124 | + <view class="project_type-frame"> | ||
125 | + <view wx:if="{{is_show_gb}}"> | ||
126 | + <view bindtap="click_classify" class="share_type fs32 flex-space-between xc-letter-spacing {{select_classify_on==223?'select_classify':''}}"data-index="223"data-name="国家" wx:if="{{is_country}}"> | ||
127 | + <text>国</text><text>家</text> | ||
128 | + | ||
129 | + </view> | ||
130 | + </view> | ||
131 | + <view wx:if="{{is_show_pp}}"> | ||
132 | + <view bindtap="click_classify" class="{{select_classify_on==220?'select_classify':''}} share_type fs32 flex-space-between xc-letter-spacing" wx:if="{{is_brand}}"data-index="220"data-name="品牌"> | ||
133 | + <text>品</text><text>牌</text> | ||
134 | + </view> | ||
135 | + </view> | ||
136 | + <view wx:if="{{is_show_pl}}"> | ||
137 | + | ||
138 | + <view wx:for="{{one_level_classify}}" wx:for-item="ittms" > | ||
139 | + <view bindtap="click_classify" data-arr="{{ittms.array}}" data-cid="{{ittms.items.id}}" data-pid="0" class="{{select_classify_on==index?'select_classify width80':''}} share_type fs32 t-c {{ittms.items.name.length==2? 'world_sn':''}} {{select_classify_on==index&&ittms.items.name.length==2?'text-indent':''}} {{select_classify_on==index&&ittms.items.name.length==3?'text3':''}}"data-index="{{index}}"data-name="{{ittms.items.name}}"> | ||
140 | + <view class="{{ittms.items.name.length==3?'flex-center-around':'flex-space-between'}}" wx:if="{{ittms.items.name.length<4}}"> | ||
141 | + <view wx:for="{{ittms.items.name}}" wx:for-item="name"wx:for-index="index"> | ||
142 | + <view> | ||
143 | + {{name}} | ||
144 | + </view> | ||
145 | + </view> | ||
146 | + | ||
147 | + </view> | ||
148 | + <view wx:else class="sort-name ellipsis-1">{{ittms.items.name}} | ||
149 | + </view> | ||
150 | + </view> | ||
151 | + | ||
152 | + </view> | ||
153 | + | ||
154 | +</view> | ||
155 | + </view> | ||
156 | + | ||
157 | +</view> | ||
158 | + | ||
159 | + | ||
160 | + | ||
161 | + | ||
162 | +<!-- 分类项目的内容 --> | ||
163 | + | ||
164 | +<view class="classify_content"> | ||
165 | +<!-- 国家的样式 --> | ||
166 | +<block wx:if="{{select_classify_on==223&&is_show_gb}}"> | ||
167 | +<view class="classify_name fs32 flex-space-between"> | ||
168 | +<view>{{ishaf_three==1?good_list.name:classify_name}}</view> | ||
169 | + | ||
170 | +</view> | ||
171 | + <view class=" classify_content-frame flex-space-between" > | ||
172 | + <view bindtap="go_nation" class="country_img-frame rel outer_location"wx:for="{{nationlist}}" wx:for-item="bitem" wx:for-index="pidx" data-nid="{{bitem.id}}" > | ||
173 | + <image class="country_img" src="{{iurl}}{{bitem.logo}}"></image> | ||
174 | + <view class='nation_box abs box'> | ||
175 | + <view class='nt_1 t-c line-height'> | ||
176 | + <text class="nation_z_name ellipsis-1 nt_1_t height fs24">{{bitem.name}}</text> | ||
177 | + </view> | ||
178 | + <view class='nt_2 t-c line-height fs24'> | ||
179 | + <text class="nation_y_name ellipsis-1">{{bitem.enname}}</text> | ||
180 | + </view> | ||
181 | + </view> | ||
182 | + </view> | ||
183 | +</view> | ||
184 | +</block> | ||
185 | +<!-- 品牌 --> | ||
186 | +<block wx:if="{{select_classify_on==220&&is_show_pp}}"> | ||
187 | + | ||
188 | +<view class="classify_name fs32 flex-space-between"> | ||
189 | +<view>{{classify_name}}</view> | ||
190 | + | ||
191 | +</view> | ||
192 | + | ||
193 | +<view class="classify_content-frame flex flex-wrap"> | ||
194 | + | ||
195 | + <block wx:for="{{groups}}" wx:for-item="brand_list" wx:for-index="pidx"> | ||
196 | + <view class="brand_img_frame "wx:for="{{brand_list.array}}"wx:for-item="user" wx:for-index="idx" bindtap="go_brand" data-bid="{{user.id}}" > | ||
197 | + | ||
198 | + <view class="brand_img t-c"> | ||
199 | + <image class=" brand_img" src="{{user.logo}}"data-errorimg="groups[{{pidx}}].array[{{idx}}].logo" binderror="bind_bnerr"></image> | ||
200 | + <view class="brand_img_name ellipsis-2 fs24">{{user.name}}</view> | ||
201 | + </view> | ||
202 | + </view> | ||
203 | + | ||
204 | + | ||
205 | +</block> | ||
206 | +</view> | ||
207 | +</block> | ||
208 | +<!-- 只是2级的 品类--> | ||
209 | +<block wx:if="{{is_show_pl}}"> | ||
210 | +<block wx:if="{{select_classify_on!=220&&select_classify_on!=223&&is_level_three!=1}}"> | ||
211 | +<view> | ||
212 | +<view class="classify_name fs32 flex-space-between"data-pid="0"data-cid="{{cat_id}}" bindtap='select_more'> | ||
213 | +<view>{{classify_name}}</view> | ||
214 | + <view class="flex select_more" > | ||
215 | + <view class="red-co fs24" >更多</view> | ||
216 | + <view class="bg_right width_height"></view> | ||
217 | + </view> | ||
218 | +</view> | ||
219 | +<view class="classify_content-frame flex-wrap"> | ||
220 | +<block wx:for="{{goodslist}}"wx:for-item="goods"wx:for-index="indx"> | ||
221 | + | ||
222 | + <view class="type_img_frame t-c ib" data-cid="{{goods.items.id}}" data-pid="{{goods.items.parent_id}}" bindtap="go_cate"> | ||
223 | + <image class=" type_img" src="{{goods.items.icoimg==null||goods.items.icoimg==''?iurl+'/miniapp/images/no_cate_def.png':goods.items.icoimg}}"binderror="goods_bnerr" data-err="goodslist[{{index}}].logo"></image> | ||
224 | + <view class="brand_img_name fs24 ellipsis-2">{{goods.items.name}}</view> | ||
225 | + </view> | ||
226 | + | ||
227 | +</block> | ||
228 | + </view> | ||
229 | +</view> | ||
230 | +</block> | ||
231 | + | ||
232 | + | ||
233 | +<!-- 商品 含有3级的--> | ||
234 | +<block wx:if="{{select_classify_on!=220&&select_classify_on!=223&&is_level_three==1}}"> | ||
235 | +<block wx:for="{{goodslist}}"wx:for-item="goods"wx:for-index="inds"> | ||
236 | +<view> | ||
237 | + | ||
238 | + | ||
239 | +<view class="classify_name fs32 flex-space-between"data-pid="{{goods.items.parent_id}}" data-cid="{{goods.items.id}}" bindtap='select_more'> | ||
240 | +<view>{{goods.items.name}}</view> | ||
241 | +<view class="flex select_more" > | ||
242 | + <view class="red-co fs24" >更多</view> | ||
243 | + <view class="bg_right width_height"></view> | ||
244 | +</view> | ||
245 | +</view> | ||
246 | + | ||
247 | + | ||
248 | +<block wx:if="{{goods.arrays.length>0}}"> | ||
249 | +<view class="classify_content-frame flex-wrap"> | ||
250 | + <view class="type_img_frame t-c ib" data-cid="{{item.id}}" data-pid="three" wx:for="{{goods.arrays}}" wx:for-index="index" wx:for-item="item" bindtap="go_cate"> | ||
251 | + <image class=" type_img"src="{{item.icoimg==null||item.icoimg==''?iurl+'/miniapp/images/no_cate_def.png':item.icoimg}}"binderror="goods_bnerr" data-err="goodslist[{{index}}].logo"></image> | ||
252 | + <view class="brand_img_name fs24 ellipsis-2">{{item.name}}</view> | ||
253 | + </view> | ||
254 | +</view> | ||
255 | +<view class="divider_line"></view> | ||
256 | +</block> | ||
257 | + | ||
258 | +</view> | ||
259 | +</block> | ||
260 | +</block> | ||
261 | +</block> | ||
262 | +</view> | ||
263 | + | ||
264 | + | ||
265 | +</view> | ||
266 | + | ||
267 | +</block> | ||
100 | \ No newline at end of file | 268 | \ No newline at end of file |
pages/goods/categoryList/categoryList.wxss
@@ -10,6 +10,7 @@ page{height: 100%; background: #fff;} | @@ -10,6 +10,7 @@ page{height: 100%; background: #fff;} | ||
10 | flex-flow: row; | 10 | flex-flow: row; |
11 | justify-content: center; | 11 | justify-content: center; |
12 | margin-left: 15%; | 12 | margin-left: 15%; |
13 | + | ||
13 | } | 14 | } |
14 | .swiper-tab-item{ | 15 | .swiper-tab-item{ |
15 | width: 30%; | 16 | width: 30%; |
@@ -51,7 +52,7 @@ swiper{ | @@ -51,7 +52,7 @@ swiper{ | ||
51 | border-radius: 29rpx; | 52 | border-radius: 29rpx; |
52 | background-color: #fff; | 53 | background-color: #fff; |
53 | position: relative; | 54 | position: relative; |
54 | - top:15rpx; | 55 | + top: 15rpx; |
55 | } | 56 | } |
56 | 57 | ||
57 | .search-img { | 58 | .search-img { |
@@ -151,4 +152,236 @@ swiper{ | @@ -151,4 +152,236 @@ swiper{ | ||
151 | .user-name { | 152 | .user-name { |
152 | padding-left: 30rpx; | 153 | padding-left: 30rpx; |
153 | } | 154 | } |
154 | -.fenlei-list{z-index: -1;} | ||
155 | \ No newline at end of file | 155 | \ No newline at end of file |
156 | +.fenlei-list{z-index: -1;} | ||
157 | + | ||
158 | + | ||
159 | + | ||
160 | + | ||
161 | + | ||
162 | +/* 商品分类新的版本 */ | ||
163 | +/* 分享样式*/ | ||
164 | +.xc-search-box { | ||
165 | + width: 100%; | ||
166 | + height: 120rpx; | ||
167 | + z-index: 10; | ||
168 | + background: #fff; | ||
169 | + border-top: 4rpx solid #eee; | ||
170 | + border-bottom: 1rpx solid #eee; | ||
171 | + | ||
172 | +} | ||
173 | + | ||
174 | +.share-height{ | ||
175 | + line-height: 20rpx; | ||
176 | +margin-right: 15rpx; | ||
177 | +margin-top: 8rpx; | ||
178 | + | ||
179 | +} | ||
180 | +.scanning_black-img{ | ||
181 | + width:50rpx; | ||
182 | + height: 45rpx; | ||
183 | + margin-bottom: 5rpx; | ||
184 | + | ||
185 | +} | ||
186 | +.search-img.left{ | ||
187 | + margin-left: 35rpx; | ||
188 | +} | ||
189 | + | ||
190 | +.xc-search-inner { | ||
191 | + display: flex; | ||
192 | + align-items: center; | ||
193 | + | ||
194 | + width: 600rpx; | ||
195 | + height: 58rpx; | ||
196 | + border-radius: 29rpx; | ||
197 | + background-color: #f2f2f2; | ||
198 | +} | ||
199 | +.project_height{ | ||
200 | + height: 90%; | ||
201 | + | ||
202 | +} | ||
203 | +.project_type{ | ||
204 | + width: 33%; | ||
205 | + height: 100%; | ||
206 | + border-right: 1rpx solid #eee; | ||
207 | + white-space: nowrap; | ||
208 | +overflow: hidden; | ||
209 | +overflow-y: scroll; | ||
210 | + | ||
211 | +} | ||
212 | +.share_type{ | ||
213 | + margin: auto; | ||
214 | + width: 58%; | ||
215 | + margin-top: 40rpx; | ||
216 | +overflow: hidden; | ||
217 | + | ||
218 | +} | ||
219 | +.xc-letter-spacing{ | ||
220 | +padding-left: 29rpx; | ||
221 | +padding-right: 29rpx; | ||
222 | +width: 51%; | ||
223 | +margin: auto; | ||
224 | +margin-top: 40rpx; | ||
225 | + | ||
226 | + | ||
227 | +} | ||
228 | +.world_sn{ | ||
229 | +white-space: nowrap; | ||
230 | +overflow: hidden; | ||
231 | +width: 58%; | ||
232 | +/* letter-spacing: 60rpx; */ | ||
233 | +margin: auto; | ||
234 | +margin-top: 35rpx; | ||
235 | +} | ||
236 | +.select_classify{ | ||
237 | + background: #d60021; | ||
238 | +border-radius: 30rpx; | ||
239 | +color: #fff; | ||
240 | +height: 48rpx; | ||
241 | +line-height: 45rpx; | ||
242 | + | ||
243 | +} | ||
244 | +.select_classify.width80{ | ||
245 | + width: 74.5%; | ||
246 | +} | ||
247 | + .select_classify.width80.text-indent{ | ||
248 | + text-indent: 38rpx; | ||
249 | + padding-right: 20px; | ||
250 | +width: 60%; | ||
251 | + | ||
252 | + } | ||
253 | + .classify_name{ | ||
254 | + width: 90%; | ||
255 | + margin: auto; | ||
256 | + height: 70rpx; | ||
257 | + border-bottom: 1rpx solid #eee; | ||
258 | + line-height: 85rpx; | ||
259 | + font-weight: 600; | ||
260 | + | ||
261 | + | ||
262 | + } | ||
263 | + .classify_content{ | ||
264 | + width: 67% | ||
265 | + | ||
266 | + } | ||
267 | + .classify_content-frame{ | ||
268 | + width: 90%; | ||
269 | + margin: auto; | ||
270 | + flex-wrap:wrap; | ||
271 | + max-height: 90%; | ||
272 | + overflow-y:scroll; | ||
273 | + overflow: hidden scroll; | ||
274 | + padding-bottom: 25rpx; | ||
275 | + | ||
276 | + | ||
277 | + } | ||
278 | + .country_img-frame{ | ||
279 | + width: 48%; | ||
280 | + height: 140rpx; | ||
281 | + | ||
282 | + } | ||
283 | + .country_img{ | ||
284 | + width: 100%; | ||
285 | + height: 100%; | ||
286 | + } | ||
287 | + .outer_location{ | ||
288 | + top:0rpx; | ||
289 | + left: 0rpx; | ||
290 | + margin-top: 20rpx; | ||
291 | + | ||
292 | + } | ||
293 | + .nation_box.box{ | ||
294 | + top: 16%; | ||
295 | +width:80%; | ||
296 | +height:70%; | ||
297 | +left: 70.5%; | ||
298 | +overflow: hidden; | ||
299 | + | ||
300 | + } | ||
301 | + .nt_1.line-height{ | ||
302 | + line-height: 65rpx; | ||
303 | + height: 72rpx; | ||
304 | +margin-top: -5rpx; | ||
305 | + | ||
306 | + } | ||
307 | + .nt_1_t.height{ | ||
308 | + height: 54rpx; | ||
309 | + } | ||
310 | + .nt_1.height{ | ||
311 | + height: 56rpx; | ||
312 | +line-height: 65rpx; | ||
313 | + } | ||
314 | + .nt_2.line-height{ | ||
315 | + height: 0rpx; | ||
316 | + line-height: 0rpx; | ||
317 | + | ||
318 | + } | ||
319 | + .nt_1_t.fs24{ | ||
320 | + font-size: 24rpx; | ||
321 | + } | ||
322 | + .nt_2.fs24{ | ||
323 | + font-size: 24rpx; | ||
324 | + } | ||
325 | + .brand_img_frame{ | ||
326 | + width: 45%; | ||
327 | + margin-top: 18rpx; | ||
328 | + margin-right: 15rpx; | ||
329 | + height: 160rpx; | ||
330 | + } | ||
331 | + .brand_img{ | ||
332 | + width:200rpx; | ||
333 | + height:86rpx; | ||
334 | + margin-bottom: 10rpx; | ||
335 | + margin-top: 10rpx; | ||
336 | + | ||
337 | + } | ||
338 | + .type_img_frame{ | ||
339 | + width: 30%; | ||
340 | + height: 140rpx; | ||
341 | + margin-top: 18rpx; | ||
342 | + margin-right: 15rpx; | ||
343 | + | ||
344 | + | ||
345 | + } | ||
346 | + | ||
347 | + | ||
348 | + | ||
349 | + .type_img{ | ||
350 | + width:80rpx; | ||
351 | + height:80rpx; | ||
352 | + margin-bottom: 10rpx; | ||
353 | + margin-top: 10rpx; | ||
354 | + | ||
355 | + } | ||
356 | + .brand_img-name{ | ||
357 | + width: 100%; | ||
358 | + height: 80rpx; | ||
359 | + } | ||
360 | + .select_classify.width80.text3{ | ||
361 | +padding-right: 20rpx; | ||
362 | +padding-left: 20rpx; | ||
363 | +width: 62%; | ||
364 | + | ||
365 | + } | ||
366 | + .width_height{ | ||
367 | + width: 13rpx; | ||
368 | + height: 13rpx; | ||
369 | + margin-top:12rpx; | ||
370 | + } | ||
371 | + .select_more{ | ||
372 | +line-height: 37rpx; | ||
373 | +height: 35rpx; | ||
374 | +margin-top: 24rpx; | ||
375 | + } | ||
376 | + .divider_line{ | ||
377 | + width: 100%; | ||
378 | + border-bottom: 6rpx solid #eee; | ||
379 | + } | ||
380 | + .sort-name{ | ||
381 | + width: 132rpx; | ||
382 | +overflow: hidden; | ||
383 | +margin: auto; | ||
384 | + | ||
385 | +} | ||
386 | + | ||
387 | +.nation_z_name{ max-width: 130rpx} | ||
388 | +.nation_y_name{ max-width: 130rpx} | ||
156 | \ No newline at end of file | 389 | \ No newline at end of file |
pages/goods/goodsInfo/goodsInfo.js
@@ -876,7 +876,7 @@ Page({ | @@ -876,7 +876,7 @@ Page({ | ||
876 | // action: "buy_now" | 876 | // action: "buy_now" |
877 | // }), | 877 | // }), |
878 | s.set_b_now(e); | 878 | s.set_b_now(e); |
879 | - wx.navigateTo({ | 879 | + wx.redirectTo({ |
880 | url: "/pages/cart/cart2/cart2?is_bnow=1&goods_id=" + e.goods_id, | 880 | url: "/pages/cart/cart2/cart2?is_bnow=1&goods_id=" + e.goods_id, |
881 | }); | 881 | }); |
882 | }, | 882 | }, |
pages/goods/goodsList/goodsList.js
@@ -25,18 +25,16 @@ Page({ | @@ -25,18 +25,16 @@ Page({ | ||
25 | var url = this.data.baseUrl; | 25 | var url = this.data.baseUrl; |
26 | this.data.is_new=t.is_new; | 26 | this.data.is_new=t.is_new; |
27 | this.data.is_hot=t.is_hot; | 27 | this.data.is_hot=t.is_hot; |
28 | - | ||
29 | - console.log(t.cat_id); | ||
30 | - console.log(t.pid); | ||
31 | - | ||
32 | - if (0 != t.cat_id && t.cat_id != undefined) { | ||
33 | - url += "&cat_id=" + t.cat_id; | ||
34 | - if (t.pid == undefined || t.pid == null){ | ||
35 | - url += "&parent_id=0"; | ||
36 | - }else{ | ||
37 | - url += "&parent_id="+t.pid; | ||
38 | - } | ||
39 | - } | 28 | + if (0 != t.cat_id && t.cat_id != undefined) { |
29 | + url += "&cat_id=" + t.cat_id; | ||
30 | + if (t.pid == undefined || t.pid == null){ | ||
31 | + url += "&parent_id=0"; | ||
32 | + }else{ | ||
33 | + if(t.pid!="three"){ | ||
34 | + url += "&parent_id="+t.pid; | ||
35 | + } | ||
36 | + } | ||
37 | + } | ||
40 | 38 | ||
41 | if (0 != t.brand_id && t.brand_id != undefined) { url += "&brand_id=" + t.brand_id; } | 39 | if (0 != t.brand_id && t.brand_id != undefined) { url += "&brand_id=" + t.brand_id; } |
42 | if (0 != t.nation_id && t.nation_id != undefined) { url += "&nation_id=" + t.nation_id; } | 40 | if (0 != t.nation_id && t.nation_id != undefined) { url += "&nation_id=" + t.nation_id; } |
pages/index/index/index.js
@@ -64,22 +64,20 @@ Page({ | @@ -64,22 +64,20 @@ Page({ | ||
64 | //看一下商家是否开通了权益 | 64 | //看一下商家是否开通了权益 |
65 | //--初始化是否有打勾-- | 65 | //--初始化是否有打勾-- |
66 | getApp().request.promiseGet("/api/weshop/users/grade/vip/init/get", { | 66 | getApp().request.promiseGet("/api/weshop/users/grade/vip/init/get", { |
67 | - data: { storeId: os.stoid} | 67 | + data: { storeId: os.stoid } |
68 | }).then(res => { | 68 | }).then(res => { |
69 | - if(res.data.data){ | ||
70 | - var is_init=res.data.data.isBool; | ||
71 | - th.setData({is_boot:is_init}); | 69 | + if (res.data.data) { |
70 | + var is_init = res.data.data.isBool; | ||
71 | + th.setData({ is_boot: is_init }); | ||
72 | } | 72 | } |
73 | }) | 73 | }) |
74 | 74 | ||
75 | - | ||
76 | - | ||
77 | }, | 75 | }, |
78 | 76 | ||
79 | 77 | ||
80 | async onShow() { | 78 | async onShow() { |
81 | - var th=this; | ||
82 | - | 79 | + var th = this; |
80 | + if(getApp().globalData.user_id) getApp().requestCardNum(); | ||
83 | await this.init_load(); | 81 | await this.init_load(); |
84 | //显示的时候要开启计时器 | 82 | //显示的时候要开启计时器 |
85 | this.data.is_timer = 1; | 83 | this.data.is_timer = 1; |
pages/payment/pay_success/pay_success.js
0 → 100644
1 | +var e = getApp(); | ||
2 | +var regeneratorRuntime = require('../../../utils/runtime.js'); | ||
3 | +Page({ | ||
4 | + /** | ||
5 | + * 页面的初始数据 | ||
6 | + */ | ||
7 | + data: { | ||
8 | + url: e.globalData.setting.imghost, | ||
9 | + resourceUrl: e.globalData.setting.resourceUrl, | ||
10 | + iurl: e.globalData.setting.imghost, | ||
11 | + order:null, | ||
12 | + type:1, | ||
13 | + allmoney:0, | ||
14 | + user_money:0, | ||
15 | + order_sn:"", | ||
16 | + pick:null, | ||
17 | + }, | ||
18 | + | ||
19 | + /** | ||
20 | + * 生命周期函数--监听页面加载 | ||
21 | + */ | ||
22 | + onLoad:async function(options) { | ||
23 | + wx.setNavigationBarTitle({ | ||
24 | + title: '支付成功', | ||
25 | + }); | ||
26 | + | ||
27 | + var type=options.type,order_sn=options.order_sn; | ||
28 | + var th=this,order=null; | ||
29 | + //如果是等1,就是单个订单的订单号 | ||
30 | + if(type==1){ | ||
31 | + await getApp().request.promiseGet("/api/weshop/order/page", | ||
32 | + {data:{store_id:e.globalData.setting.stoid,order_sn:order_sn}}).then(res=>{ | ||
33 | + order=res.data.data.pageData[0]; | ||
34 | + th.setData({order:order,order_sn:order_sn}) | ||
35 | + }) | ||
36 | + }else{ | ||
37 | + await getApp().request.promiseGet("/api/weshop/order/page", | ||
38 | + {data:{store_id:e.globalData.setting.stoid,parent_sn:order_sn}}).then(res=>{ | ||
39 | + | ||
40 | + var allmoney=0; | ||
41 | + for(var i in res.data.data.pageData){ | ||
42 | + var item=res.data.data.pageData[i]; | ||
43 | + allmoney+=item.order_amount; | ||
44 | + user_money += item.user_money; | ||
45 | + } | ||
46 | + order=res.data.data.pageData[0]; | ||
47 | + th.setData({ order: order, type: 2, allmoney: allmoney, order_sn: order_sn, user_money: user_money}) | ||
48 | + }) | ||
49 | + } | ||
50 | + //--获取门店-- | ||
51 | + if(order.exp_type==1) { | ||
52 | + await getApp().request.promiseGet("/api/weshop/pickup/get/"+ e.globalData.setting.stoid+"/"+order.pickup_id, | ||
53 | + {1:1}).then(res => { | ||
54 | + th.setData({pick:res.data.data}) | ||
55 | + }); | ||
56 | + } | ||
57 | + }, | ||
58 | + | ||
59 | + goto: function() { | ||
60 | + var url= '/pages/index/index/index'; | ||
61 | + getApp().goto(url) | ||
62 | + }, | ||
63 | +}) | ||
0 | \ No newline at end of file | 64 | \ No newline at end of file |
pages/payment/pay_success/pay_success.json
0 → 100644
pages/payment/pay_success/pay_success.wxml
0 → 100644
1 | +<wxs module="filters" src="../../../utils/filter.wxs"></wxs> | ||
2 | +<view> | ||
3 | + <!-- 支付成功提示 --> | ||
4 | + <view class="payradio"> | ||
5 | + <!-- 提示框 --> | ||
6 | + <view class="Success_box flex-center"> | ||
7 | + <view> | ||
8 | + <view class="flex-center"> | ||
9 | + <image src="{{url}}miniapp/images/pay/paysuccess.png"></image> | ||
10 | + </view> | ||
11 | + <view class="Success_box_title fs32">订单支付成功!</view> | ||
12 | + </view> | ||
13 | + </view> | ||
14 | + | ||
15 | + <!-- 支付信息 --> | ||
16 | + <view class="payitem_max fs28"> | ||
17 | + <!-- 订单编号 --> | ||
18 | + <view class="payitem flex"> | ||
19 | + <view>订单编号 :</view> | ||
20 | + <text selectable="true">{{order_sn}}</text> | ||
21 | + </view> | ||
22 | + | ||
23 | + <!-- 实付金额 --> | ||
24 | + | ||
25 | + <view class="payitem flex"> | ||
26 | + <view>实付金额 :</view> | ||
27 | + <!-- {{filters.toFix()}} --> | ||
28 | + <view class="pay_money" wx:if="{{type==1}}">{{filters.toFix(order.order_amount+order.user_money+order.pt_tail_money)}}元</view> | ||
29 | + <view class="pay_money" wx:else>{{filters.toFix(allmoney+user_money,2) }}元</view> | ||
30 | + </view> | ||
31 | + | ||
32 | + <!-- 支付方式 --> | ||
33 | + <view class="payitem flex"> | ||
34 | + <view>支付方式 :</view> | ||
35 | + <view wx:if="{{allmoney>0 && user_money>0 }}">微信支付,余额支付</view> | ||
36 | + <view wx:elif="{{allmoney>0}}">微信支付,余额支付</view> | ||
37 | + <view wx:elif="{{user_money>0}}">微信支付,余额支付</view> | ||
38 | + <view wx:else>免单</view> | ||
39 | + </view> | ||
40 | + | ||
41 | + </view> | ||
42 | + </view> | ||
43 | + <view class="flex-level"> | ||
44 | + <view class="line"></view> | ||
45 | + </view> | ||
46 | + | ||
47 | + <!-- 跳转链接 --> | ||
48 | + <view> | ||
49 | + <!-- 个人收货信息 --> | ||
50 | + <view class="pay_User fs28" wx:if="{{order.exp_type==0}}"> | ||
51 | + <view class="payitem flex"> | ||
52 | + <view class="pay_Receiving">收货人 :</view> | ||
53 | + <view class="pay_name ellipsis-1">{{order.consignee}}</view> | ||
54 | + <view>{{order.mobile}}</view> | ||
55 | + </view> | ||
56 | + <view class="payitem flex"> | ||
57 | + <view class="pay_Receiving">收货地址 :</view> | ||
58 | + <view class="address ellipsis-2">{{order.more_address}}</view> | ||
59 | + </view> | ||
60 | + </view> | ||
61 | + | ||
62 | + <!-- 收货门店信息 --> | ||
63 | + <view class="pay_User fs28" wx:else> | ||
64 | + <view class="payitem flex"> | ||
65 | + <view class="pay_Receiving">门店 :</view> | ||
66 | + <view class="pay_name ellipsis-1">{{pick.pickup_name}}</view> | ||
67 | + </view> | ||
68 | + <view class="payitem flex"> | ||
69 | + <view class="pay_Receiving">门店地址 :</view> | ||
70 | + <view class="address ellipsis-2">{{pick.pickup_address}}</view> | ||
71 | + </view> | ||
72 | + </view> | ||
73 | + | ||
74 | + <!-- 链接 --> | ||
75 | + <view class="fs32"> | ||
76 | + <view class="flex-center"> | ||
77 | + <navigator class="pay_order flex-center" url="/pages/user/order_list/order_list"> | ||
78 | + <view>查看订单</view> | ||
79 | + </navigator> | ||
80 | + </view> | ||
81 | + <view class="flex-center"> | ||
82 | + <navigator class="pay_home flex-center" bindtap="goto"> | ||
83 | + <view>回到首页</view> | ||
84 | + </navigator> | ||
85 | + </view> | ||
86 | + </view> | ||
87 | + </view> | ||
88 | +</view> | ||
0 | \ No newline at end of file | 89 | \ No newline at end of file |
pages/payment/pay_success/pay_success.wxss
0 → 100644
1 | +page { | ||
2 | + border-top: 2rpx solid rgb(245, 245, 245); | ||
3 | +} | ||
4 | +.line { | ||
5 | + border-top: 2rpx solid rgb(245, 245, 245); | ||
6 | + width: 700rpx; | ||
7 | +} | ||
8 | + | ||
9 | +.payradio .Success_box { | ||
10 | + padding-top: 45rpx; | ||
11 | + padding-bottom: 45rpx; | ||
12 | +} | ||
13 | + | ||
14 | +.payradio .Success_box .Success_box_title { | ||
15 | + margin-top: 45rpx; | ||
16 | + color: rgb(8, 8, 8); | ||
17 | +} | ||
18 | + | ||
19 | +.payradio image { | ||
20 | + width: 140rpx; | ||
21 | + height: 140rpx; | ||
22 | + display: flex; | ||
23 | +} | ||
24 | + | ||
25 | +.payitem_max { | ||
26 | + padding: 0rpx 55rpx; | ||
27 | + color: rgb(104, 104, 104); | ||
28 | + padding-bottom: 30rpx; | ||
29 | +} | ||
30 | + | ||
31 | +.payitem_max .payitem { | ||
32 | + margin-top: 30rpx; | ||
33 | +} | ||
34 | + | ||
35 | +.payitem_max .payitem .pay_nam { | ||
36 | + width: 200rpx; | ||
37 | +} | ||
38 | + | ||
39 | +.payitem_max .payitem view { | ||
40 | + margin-right: 50rpx; | ||
41 | +} | ||
42 | +.pay_money{ | ||
43 | + color: rgb(219, 27, 52); | ||
44 | +} | ||
45 | + | ||
46 | +.pay_User { | ||
47 | + padding-left: 55rpx; | ||
48 | + color: rgb(104, 104, 104); | ||
49 | +} | ||
50 | + | ||
51 | +.pay_User .payitem { | ||
52 | + margin-top: 30rpx; | ||
53 | +} | ||
54 | + | ||
55 | +.pay_User .payitem .pay_Receiving { | ||
56 | + width: 128rpx; | ||
57 | + margin-right: 50rpx; | ||
58 | +} | ||
59 | + | ||
60 | +.pay_User .payitem .pay_name { | ||
61 | + margin-right: 38rpx; | ||
62 | + max-width: 250rpx; | ||
63 | +} | ||
64 | + | ||
65 | +.pay_order { | ||
66 | + margin-top: 115rpx; | ||
67 | + color: rgb(104, 104, 104); | ||
68 | + width: 560rpx; | ||
69 | + height: 62rpx; | ||
70 | + border-radius: 30rpx; | ||
71 | + border: 3rpx solid rgb(209, 209, 209); | ||
72 | +} | ||
73 | + | ||
74 | +.pay_home { | ||
75 | + margin-top: 35rpx; | ||
76 | + color: rgb(255, 255, 255); | ||
77 | + width: 566rpx; | ||
78 | + height: 68rpx; | ||
79 | + border-radius: 30rpx; | ||
80 | + background-color: rgb(219, 27, 52); | ||
81 | +} | ||
82 | +.address{ | ||
83 | + width: 470rpx; | ||
84 | +} | ||
0 | \ No newline at end of file | 85 | \ No newline at end of file |
pages/user/address_list/address_list.js
@@ -24,10 +24,11 @@ Page({ | @@ -24,10 +24,11 @@ Page({ | ||
24 | }); | 24 | }); |
25 | 25 | ||
26 | this.data.operate = e.operate; | 26 | this.data.operate = e.operate; |
27 | - var is_back=e.is_back; | ||
28 | - if (is_back) this.setData({ is_back: is_back}) | ||
29 | }, | 27 | }, |
30 | onShow: function () { | 28 | onShow: function () { |
29 | + var is_back=getApp().globalData.is_cart_old; | ||
30 | + if (is_back) this.setData({ is_back: is_back}) | ||
31 | + | ||
31 | this.data.curpage = 1; | 32 | this.data.curpage = 1; |
32 | this.data.addresses = []; | 33 | this.data.addresses = []; |
33 | this.requestAddressList(); | 34 | this.requestAddressList(); |
pages/user/index/index.js
@@ -44,6 +44,7 @@ Page({ | @@ -44,6 +44,7 @@ Page({ | ||
44 | var stoid = app_d.setting.stoid; | 44 | var stoid = app_d.setting.stoid; |
45 | var s = this,th=s,need_money=0,cur_g_num=0; | 45 | var s = this,th=s,need_money=0,cur_g_num=0; |
46 | getApp().get_isbuy(th.setappdata); | 46 | getApp().get_isbuy(th.setappdata); |
47 | + if(getApp().globalData.user_id) getApp().requestCardNum(); | ||
47 | 48 | ||
48 | /*------会员登录------*/ | 49 | /*------会员登录------*/ |
49 | app.getUserFir(async function(e){ | 50 | app.getUserFir(async function(e){ |
pages/user/order_list/order_list.js
1 | var t = function(t) { | 1 | var t = function(t) { |
2 | return t && t.__esModule ? t : { | 2 | return t && t.__esModule ? t : { |
3 | - default: t | 3 | + default: t |
4 | }; | 4 | }; |
5 | -}(require("../../../utils/LoadMore.js")), e = getApp(),os=e.globalData.setting,oo=e.globalData, | ||
6 | - r = e.request,rq=r, a = require("../../../utils/common.js"), s = new t.default(); | 5 | + }(require("../../../utils/LoadMore.js")), |
6 | + e = getApp(), | ||
7 | + os = e.globalData.setting, | ||
8 | + oo = e.globalData, | ||
9 | + r = e.request, | ||
10 | + rq = r, | ||
11 | + a = require("../../../utils/common.js"), | ||
12 | + s = new t.default(); | ||
7 | var regeneratorRuntime = require('../../../utils/runtime.js'); | 13 | var regeneratorRuntime = require('../../../utils/runtime.js'); |
8 | 14 | ||
9 | Page({ | 15 | Page({ |
10 | - data: { | ||
11 | - url: e.globalData.setting.url, | ||
12 | - resourceUrl: e.globalData.setting.imghost, | ||
13 | - iurl: e.globalData.setting.imghost, | ||
14 | - categories: [ { | ||
15 | - name: "全部订单",id: 0 | ||
16 | - }, { | ||
17 | - name: "待付款",id: 1 | ||
18 | - }, { | ||
19 | - name: "待发货",id: 2 | ||
20 | - }, { | ||
21 | - name: "待收货",id: 3 | ||
22 | - }, { | ||
23 | - name: "待评价",id: 4 | ||
24 | - } ], | ||
25 | - activeCategoryId: 0, | ||
26 | - orderList: null, | ||
27 | - currentPage: 1, | ||
28 | - | ||
29 | - //已经读取过接口 | ||
30 | - is_get:0, | ||
31 | - conf:null, | ||
32 | - }, | ||
33 | - onLoad: function(t) { | ||
34 | - var th=this; | ||
35 | - //var e = void 0 === t.type ? this.data.activeCategoryId : t.type; | ||
36 | - if(t.type!=undefined) this.setData({activeCategoryId:t.type}) | ||
37 | - s.init(this, "", "orderList"); | ||
38 | - //this.requestOrderList(e), wx.removeStorageSync("order:order_list:update"); | ||
39 | - getApp().getConfig2(function (e) { | ||
40 | - th.setData({conf:e}); | ||
41 | - }) | ||
42 | - }, | ||
43 | - onShow: function() { | ||
44 | - //wx.getStorageSync("order:order_list:update") && (wx.setStorageSync("order:order_list:update", !1), | ||
45 | - this.resetData(), this.requestOrderList(this.data.activeCategoryId); | ||
46 | - }, | ||
47 | - changeTab: function(t) { | ||
48 | - this.resetData(), this.requestOrderList(t.currentTarget.id); | ||
49 | - }, | ||
50 | - resetData: function() { | ||
51 | - s.resetConfig(), this.data.orderList = null, this.data.currentPage = 1; | ||
52 | - }, | ||
53 | - | ||
54 | - /*---------获取订单列表--------*/ | ||
55 | - requestOrderList: function(t) { | ||
56 | - var rd=Math.random()*100; | ||
57 | - var e = this,th=e, r = e.data.url + "/api/weshop/order/page?rd="+rd, a = ""; | ||
58 | - switch(t){ | ||
59 | - case "1": | ||
60 | - r += "&wait_status=0"; break; | ||
61 | - case "2": | ||
62 | - r += "&wait_status=1"; break; | ||
63 | - case "3": | ||
64 | - r += "&wait_status=2";break; | ||
65 | - case "4": | ||
66 | - r +="&order_status=2"; break; | ||
67 | - } | 16 | + data: { |
17 | + url: e.globalData.setting.url, | ||
18 | + resourceUrl: e.globalData.setting.imghost, | ||
19 | + iurl: e.globalData.setting.imghost, | ||
20 | + categories: [{ | ||
21 | + name: "全部订单", | ||
22 | + id: 0 | ||
23 | + }, { | ||
24 | + name: "待付款", | ||
25 | + id: 1 | ||
26 | + }, { | ||
27 | + name: "待发货", | ||
28 | + id: 2 | ||
29 | + }, { | ||
30 | + name: "待收货", | ||
31 | + id: 3 | ||
32 | + }, { | ||
33 | + name: "待评价", | ||
34 | + id: 4 | ||
35 | + }], | ||
36 | + activeCategoryId: 0, | ||
37 | + orderList: null, | ||
38 | + currentPage: 1, | ||
39 | + //已经读取过接口 | ||
40 | + is_get: 0, | ||
41 | + conf: null, | ||
42 | + iscodeall: null | ||
43 | + }, | ||
44 | + onLoad: function(t) { | ||
45 | + var th = this; | ||
46 | + if (t.type != undefined) this.setData({ | ||
47 | + activeCategoryId: t.type | ||
48 | + }) | ||
49 | + s.init(this, "", "orderList"); | ||
50 | + getApp().getConfig2(function(e) { | ||
51 | + th.setData({ | ||
52 | + conf: e | ||
53 | + }); | ||
54 | + }) | ||
55 | + }, | ||
56 | + onShow: function() { | ||
57 | + this.resetData(), this.requestOrderList(this.data.activeCategoryId); | ||
58 | + }, | ||
59 | + changeTab: function(t) { | ||
60 | + if (this.data.activeCategoryId == t.currentTarget.id) return false; | ||
61 | + this.resetData(), this.requestOrderList(t.currentTarget.id); | ||
62 | + }, | ||
63 | + resetData: function() { | ||
64 | + s.resetConfig(), this.data.orderList = null, this.data.currentPage = 1; | ||
65 | + }, | ||
68 | 66 | ||
69 | - this.setData({ activeCategoryId: t }); r = r + "&page=" + e.data.currentPage; | ||
70 | - s.request(r, function(t) { | ||
71 | 67 | ||
72 | - th.setData({is_get:1}); | ||
73 | - var data=e.data.orderList; | ||
74 | - data.forEach(async function (item,ind){ | ||
75 | - var tt =null; | ||
76 | - await getApp().request.promiseGet('/api/weshop/ordergoods/list',{ | ||
77 | - data: {order_id: item.order_id, store_id:os.stoid,pageSize:600}, | ||
78 | - }).then(res=>{ | ||
79 | - tt=res; | ||
80 | - }) | 68 | + /*---------获取订单列表--------*/ |
69 | + requestOrderList: function (t) { | ||
70 | + var rd = Math.random() * 100; | ||
71 | + var e = this, th = e, r = e.data.url + "/api/weshop/order/page?rd=" + rd, a = ""; | ||
72 | + switch (t) { | ||
73 | + case "1": | ||
74 | + r += "&wait_status=0"; break; | ||
75 | + case "2": | ||
76 | + r += "&wait_status=1"; break; | ||
77 | + case "3": | ||
78 | + r += "&wait_status=2"; break; | ||
79 | + case "4": | ||
80 | + r += "&order_status=2"; break; | ||
81 | + } | ||
82 | + this.setData({ activeCategoryId: t }); r = r + "&page=" + e.data.currentPage; | ||
83 | + s.request(r, function (t) { | ||
81 | 84 | ||
82 | - //------------对比一下有没有退款记录------------ | ||
83 | - await getApp().request.promiseGet("/api/weshop/order/returngoods/page",{ | ||
84 | - data: { order_id: item.order_id, store_id: os.stoid, | ||
85 | - user_id:oo.user_id, pageSize: 20 } | ||
86 | - }).then(rs=>{ | ||
87 | - var ttd=rs; | ||
88 | - //--看一下订单的总数量-- | ||
89 | - var gtype_num = tt.data.data.total; | ||
90 | - if(ttd.data.data.pageData == undefined) return false; | ||
91 | - var goodslist = tt.data.data.pageData; | 85 | + th.setData({ is_get: 1 }); |
86 | + var data = e.data.orderList; | ||
87 | + data.forEach(async function (item, ind) { | ||
88 | + var tt = null; | ||
89 | + await getApp().request.promiseGet('/api/weshop/ordergoods/list', { | ||
90 | + data: { order_id: item.order_id, store_id: os.stoid, pageSize: 600 }, | ||
91 | + }).then(res => { | ||
92 | + tt = res; | ||
93 | + }) | ||
92 | 94 | ||
93 | - //----没有相关的退款记录---- | ||
94 | - if (ttd.data.data.total==0){ | ||
95 | - data[ind]['is_all_return'] = 0; | ||
96 | - goodslist.forEach(function (ee, ii) { | ||
97 | - if (data[ind]['order_status'] == 1 && data[ind]['pay_status'] == 1 && gtype_num>1){ | 95 | + //------------对比一下有没有退款记录------------ |
96 | + await getApp().request.promiseGet("/api/weshop/order/returngoods/page", { | ||
97 | + data: { | ||
98 | + order_id: item.order_id, store_id: os.stoid, | ||
99 | + user_id: oo.user_id, pageSize: 20 | ||
100 | + } | ||
101 | + }).then(rs => { | ||
102 | + var ttd = rs; | ||
103 | + //--看一下订单的总数量-- | ||
104 | + var gtype_num = tt.data.data.total; | ||
105 | + if (ttd.data.data.pageData == undefined) return false; | ||
106 | + var goodslist = tt.data.data.pageData; | ||
98 | 107 | ||
99 | - //empty($list.coupon_no) && empty($list.order_prom_id) && $list.order_status lt 2 && empty($list.is_prom) | ||
100 | - //&& ($tpshop_config['refund_type'] eq 0 || ($tpshop_config['refund_type'] eq 1 && ($list['order_amount'] eq 0 | ||
101 | - // || $list['user_money'] eq 0))) | ||
102 | - item.goodslist=goodslist; | ||
103 | - if(th.check_for_return_btn(item) ) { | ||
104 | - goodslist[ii]['return_btn'] = 1; | ||
105 | - } | ||
106 | - } | 108 | + //----没有相关的退款记录---- |
109 | + if (ttd.data.data.total == 0) { | ||
110 | + data[ind]['is_all_return'] = 0; | ||
111 | + goodslist.forEach(function (ee, ii) { | ||
112 | + if (data[ind]['order_status'] == 1 && data[ind]['pay_status'] == 1 && gtype_num > 1) { | ||
113 | + item.goodslist = goodslist; | ||
114 | + if (th.check_for_return_btn(item)) { | ||
115 | + goodslist[ii]['return_btn'] = 1; | ||
116 | + } | ||
117 | + } | ||
107 | 118 | ||
108 | - }); | ||
109 | - }else{ | ||
110 | - //--------整单退-------- | ||
111 | - if (ttd.data.data.pageData[0]['goods_id_list'] != null | ||
112 | - && ttd.data.data.pageData[0]['goods_id_list'] != ''){ | ||
113 | - var eea = ttd.data.data.pageData[0]; | ||
114 | - //1.退款正在进行中, | ||
115 | - //2.退款被拒绝就要显示可以退款 | ||
116 | - //3.退款已经完成 | ||
117 | - data[ind]['is_all_return']=1; | ||
118 | - data[ind]['is_all_return_status'] = ttd.data.data.pageData[0].status; | 119 | + }); |
120 | + } else { | ||
121 | + //--------整单退-------- | ||
122 | + if (ttd.data.data.pageData[0]['goods_id_list'] != null | ||
123 | + && ttd.data.data.pageData[0]['goods_id_list'] != '') { | ||
124 | + var eea = ttd.data.data.pageData[0]; | ||
125 | + //1.退款正在进行中, | ||
126 | + //2.退款被拒绝就要显示可以退款 | ||
127 | + //3.退款已经完成 | ||
128 | + data[ind]['is_all_return'] = 1; | ||
129 | + data[ind]['is_all_return_status'] = ttd.data.data.pageData[0].status; | ||
119 | 130 | ||
120 | - if (data[ind]['order_status'] == 1 && data[ind]['pay_status'] == 1) { | ||
121 | - switch (eea.status) { | ||
122 | - case 0: | ||
123 | - case 1: | ||
124 | - data[ind]['return_btn'] = 2; break; | ||
125 | - case 2: | ||
126 | - data[ind]['return_btn'] = 4; break; | ||
127 | - case 3: | ||
128 | - data[ind]['return_btn'] = 3; break; | ||
129 | - default: | ||
130 | - data[ind]['return_btn'] = 0; | ||
131 | - } | ||
132 | - } | ||
133 | - }else{ | ||
134 | - //1.退款正在进行中, | ||
135 | - //2.退款被拒绝就要显示可以退款 | ||
136 | - //3.退款已经完成 | ||
137 | - data[ind]['is_all_return'] = 0; | ||
138 | - var rt_ok_num=0; | 131 | + if (data[ind]['order_status'] == 1 && data[ind]['pay_status'] == 1) { |
132 | + switch (eea.status) { | ||
133 | + case 0: | ||
134 | + case 1: | ||
135 | + data[ind]['return_btn'] = 2; break; | ||
136 | + case 2: | ||
137 | + data[ind]['return_btn'] = 4; break; | ||
138 | + case 3: | ||
139 | + data[ind]['return_btn'] = 3; break; | ||
140 | + default: | ||
141 | + data[ind]['return_btn'] = 0; | ||
142 | + } | ||
143 | + } | ||
144 | + } else { | ||
145 | + //1.退款正在进行中, | ||
146 | + //2.退款被拒绝就要显示可以退款 | ||
147 | + //3.退款已经完成 | ||
148 | + data[ind]['is_all_return'] = 0; | ||
149 | + var rt_ok_num = 0; | ||
150 | + //if(data[ind]['order_status'] == 1 && data[ind]['pay_status'] == 1) { | ||
151 | + goodslist.forEach(function (eeb, iii) { | ||
152 | + if (data[ind]['order_status'] == 1 && data[ind]['pay_status'] == 1) | ||
153 | + goodslist[iii]['return_btn'] = 1; //申请退款 | ||
154 | + ttd.data.data.pageData.forEach(function (eea, ii) { | ||
155 | + var st = eea.status; | ||
156 | + if (eea.goods_id == eeb.goods_id) { | ||
157 | + switch (eea.status) { | ||
158 | + case 0: | ||
159 | + case 1://退款处理中 | ||
160 | + data[ind]['has_rt'] = 1; //有部分退 | ||
161 | + goodslist[iii]['return_btn'] = 2; break; | ||
162 | + case 2://退款完成 | ||
163 | + goodslist[iii]['return_btn'] = 4; rt_ok_num++; break; | ||
164 | + case 3://已拒绝,重新退款 | ||
165 | + goodslist[iii]['return_btn'] = 3; break; | ||
166 | + default: | ||
167 | + if (data[ind]['order_status'] == 1 && data[ind]['pay_status'] == 1) | ||
168 | + goodslist[iii]['return_btn'] = 1; //申请退款 | ||
169 | + } | ||
170 | + return; | ||
171 | + } | ||
172 | + }); | ||
173 | + }); | ||
174 | + //} | ||
175 | + } | ||
176 | + } | ||
139 | 177 | ||
140 | - //if(data[ind]['order_status'] == 1 && data[ind]['pay_status'] == 1) { | ||
141 | - goodslist.forEach(function (eeb, iii) { | ||
142 | - if(data[ind]['order_status'] == 1 && data[ind]['pay_status'] == 1) | ||
143 | - goodslist[iii]['return_btn'] = 1; //申请退款 | ||
144 | - ttd.data.data.pageData.forEach(function (eea, ii) { | ||
145 | - var st = eea.status; | ||
146 | - if (eea.goods_id == eeb.goods_id){ | ||
147 | - switch (eea.status){ | ||
148 | - case 0: | ||
149 | - case 1://退款处理中 | ||
150 | - data[ind]['has_rt'] = 1; //有部分退 | ||
151 | - goodslist[iii]['return_btn'] = 2; break; | ||
152 | - case 2://退款完成 | ||
153 | - goodslist[iii]['return_btn'] = 4; rt_ok_num++; break; | ||
154 | - case 3://已拒绝,重新退款 | ||
155 | - goodslist[iii]['return_btn'] = 3; break; | ||
156 | - default: | ||
157 | - if(data[ind]['order_status'] == 1 && data[ind]['pay_status'] == 1) | ||
158 | - goodslist[iii]['return_btn'] = 1; //申请退款 | ||
159 | - } | ||
160 | - return; | ||
161 | - } | ||
162 | - }); | ||
163 | - }); | ||
164 | - //} | ||
165 | - } | ||
166 | - } | 178 | + //--如果是全部退款,也就可以删除-- |
179 | + if (rt_ok_num == goodslist.length) { | ||
180 | + data[ind]['is_all_return_status'] = 2; | ||
181 | + } | ||
167 | 182 | ||
168 | - //--如果是全部退款,也就可以删除-- | ||
169 | - if(rt_ok_num==goodslist.length){ | ||
170 | - data[ind]['is_all_return_status']=2; | ||
171 | - } | ||
172 | - | ||
173 | - data[ind]['order_goods'] = goodslist; | ||
174 | - var g_num = 0; | ||
175 | - goodslist.forEach(function (ee, ii) { | ||
176 | - if(ee.return_btn!=4) | ||
177 | - g_num += ee.goods_num; | ||
178 | - }); | ||
179 | - data[ind]['g_num'] = g_num; | ||
180 | - }) | ||
181 | - th.setData({ orderList: data, }); | ||
182 | 183 | ||
183 | - }); | ||
184 | - e.data.currentPage++, | ||
185 | - /*--- | ||
186 | - t.data.result.forEach(function(t, e, r) { | ||
187 | - t.goods_sum = t.order_goods.reduce(function(t, e) { | ||
188 | - return t + e.goods_num; | ||
189 | - }, 0); | ||
190 | - }),---*/ | ||
191 | - wx.stopPullDownRefresh(); | ||
192 | - },null,{store_id:os.stoid,user_id:oo.user_id}); | ||
193 | - }, | ||
194 | - onReachBottom: function() { | ||
195 | - s.canloadMore() && this.requestOrderList(this.data.activeCategoryId); | ||
196 | - }, | ||
197 | - onPullDownRefresh: function(t) { | ||
198 | - this.resetData(), this.requestOrderList(this.data.activeCategoryId); | ||
199 | - }, | 184 | + data[ind]['order_goods'] = goodslist; |
185 | + var g_num = 0; | ||
186 | + goodslist.forEach(function (ee, ii) { | ||
187 | + if (ee.return_btn != 4) | ||
188 | + g_num += ee.goods_num; | ||
189 | + }); | ||
190 | + data[ind]['g_num'] = g_num; | ||
191 | + }) | ||
192 | + th.setData({ orderList: data, }); | ||
200 | 193 | ||
201 | - /*-----------取消订单-----------*/ | ||
202 | - cancelOrder: function(t) { | ||
203 | - var e = this, a = t.currentTarget.dataset.id,th=this; | ||
204 | - var is_zsorder= parseFloat(t.currentTarget.dataset.zsorder); | ||
205 | - var index=t.currentTarget.dataset.orderindex; | ||
206 | - var order=th.data.orderList[index]; | ||
207 | - var is_skill=0; | ||
208 | - var order_goods=order.order_goods; | ||
209 | - //--判断是不是秒杀-- | ||
210 | - order_goods.forEach(function (val,ind) { | ||
211 | - if(val.prom_type==1){ | ||
212 | - is_skill=1; return false; | ||
213 | - } | 194 | + }); |
195 | + e.data.currentPage++ , | ||
196 | + wx.stopPullDownRefresh(); | ||
197 | + }, null, { store_id: os.stoid, user_id: oo.user_id }); | ||
198 | + }, | ||
199 | + //滑倒底部 | ||
200 | + onReachBottom: function() { | ||
201 | + if (s.data.goodsLoadFinishFlag) { | ||
202 | + this.setData({ | ||
203 | + iscodeall: 1 | ||
214 | }) | 204 | }) |
205 | + } | ||
206 | + s.canloadMore() && this.requestOrderList(this.data.activeCategoryId); | ||
207 | + }, | ||
208 | + onPullDownRefresh: function(t) { | ||
209 | + this.resetData(), this.requestOrderList(this.data.activeCategoryId); | ||
210 | + }, | ||
211 | + | ||
212 | + /*-----------取消订单-----------*/ | ||
213 | + cancelOrder: function(t) { | ||
214 | + var e = this, | ||
215 | + a = t.currentTarget.dataset.id, | ||
216 | + th = this; | ||
217 | + var is_zsorder = parseFloat(t.currentTarget.dataset.zsorder); | ||
218 | + var index = t.currentTarget.dataset.orderindex; | ||
219 | + var order = th.data.orderList[index]; | ||
220 | + var is_skill = 0; | ||
221 | + var order_goods = order.order_goods; | ||
222 | + //--判断是不是秒杀-- | ||
223 | + order_goods.forEach(function(val, ind) { | ||
224 | + if (val.prom_type == 1) { | ||
225 | + is_skill = 1; | ||
226 | + return false; | ||
227 | + } | ||
228 | + }) | ||
215 | 229 | ||
216 | - wx.showModal({ | ||
217 | - title: "是否取消订单?", | 230 | + wx.showModal({ |
231 | + title: "是否取消订单?", | ||
232 | + success: function(t) { | ||
233 | + //如果是秒杀和拼单的商品,取消订单要返回redis,并取消订单 | ||
234 | + if (t.confirm) { | ||
235 | + //if(is_skill==1 || is_zsorder>=2){ | ||
236 | + getApp().request.delete("/api/weshop/order/cancelTeamOrder/" + os.stoid + "/" + a, { | ||
237 | + data: {}, | ||
218 | success: function(t) { | 238 | success: function(t) { |
219 | - //如果是秒杀和拼单的商品,取消订单要返回redis,并取消订单 | ||
220 | - if(t.confirm){ | ||
221 | - //if(is_skill==1 || is_zsorder>=2){ | ||
222 | - getApp().request.delete("/api/weshop/order/cancelTeamOrder/"+os.stoid+"/"+a,{ | ||
223 | - data:{}, | ||
224 | - success: function(t) { | ||
225 | - if(t.data.code==0) | ||
226 | - { | ||
227 | - 0 == e.data.activeCategoryId ? | ||
228 | - (e.resetData(), e.requestOrderList(e.data.activeCategoryId)) : e.deleteOrderData2(a); | ||
229 | - } | ||
230 | - else | ||
231 | - { | ||
232 | - getApp().confirmBox(e.data.msg); | ||
233 | - } | ||
234 | - }, | ||
235 | - }) | ||
236 | - } | 239 | + if (t.data.code == 0) { |
240 | + 0 == e.data.activeCategoryId ? | ||
241 | + (e.resetData(), e.requestOrderList(e.data.activeCategoryId)) : e.deleteOrderData2(a); | ||
242 | + } else { | ||
243 | + getApp().confirmBox(e.data.msg); | ||
244 | + } | ||
245 | + }, | ||
246 | + }) | ||
247 | + } | ||
248 | + } | ||
249 | + }); | ||
250 | + }, | ||
251 | + | ||
252 | + /*-----------确认收货-----------*/ | ||
253 | + confirmOrder: function(t) { | ||
254 | + var e = this, | ||
255 | + a = t.currentTarget.dataset.id; | ||
256 | + var is_zsorder = t.currentTarget.dataset.zsorder; | ||
257 | + var th = this; | ||
258 | + | ||
259 | + wx.showModal({ | ||
260 | + title: "是否确认收货?", | ||
261 | + success: function(t) { | ||
262 | + t.confirm && rq.put("/api/weshop/order/updatebyId", { | ||
263 | + data: { | ||
264 | + order_id: a, | ||
265 | + order_status: 2 | ||
266 | + }, | ||
267 | + success: function(t) { | ||
268 | + e.deleteOrderData2(a); | ||
269 | + //如果是会员团订单 | ||
270 | + if (is_zsorder == 3) { | ||
271 | + getApp().request.post("/api/weshop/order/vipTuanTebate/" + os.stoid + "/" + a, { | ||
272 | + data: {}, | ||
273 | + success: function() {} | ||
274 | + }) | ||
237 | } | 275 | } |
276 | + } | ||
238 | }); | 277 | }); |
239 | - }, | ||
240 | - | ||
241 | - /*-----------确认收货-----------*/ | ||
242 | - confirmOrder: function(t) { | ||
243 | - var e = this, a = t.currentTarget.dataset.id; | ||
244 | - var is_zsorder=t.currentTarget.dataset.zsorder; | ||
245 | - var th=this; | 278 | + } |
279 | + }); | ||
280 | + }, | ||
246 | 281 | ||
247 | - wx.showModal({ | ||
248 | - title: "是否确认收货?", | ||
249 | - success: function(t) { | ||
250 | - t.confirm && rq.put("/api/weshop/order/updatebyId", { | ||
251 | - data: { | ||
252 | - order_id: a,order_status:2 | ||
253 | - }, | ||
254 | - success: function(t) { | ||
255 | - e.deleteOrderData2(a); | ||
256 | - //如果是会员团订单 | ||
257 | - if(is_zsorder==3){ | ||
258 | - getApp().request.post("/api/weshop/order/vipTuanTebate/"+os.stoid+"/"+a,{ | ||
259 | - data:{}, success:function () { }}) | ||
260 | - } | ||
261 | - } | 282 | + //-----删除订单----- |
283 | + deleteOrderData: function(t) { | ||
284 | + var th = this; | ||
285 | + var order_id = t.currentTarget.dataset.order_id; | ||
286 | + wx.showModal({ | ||
287 | + title: "是否删除订单?", | ||
288 | + success: function(tt) { | ||
289 | + tt.confirm && rq.put("/api/weshop/order/updatebyId", { | ||
290 | + data: { | ||
291 | + order_id: order_id, | ||
292 | + order_status: 5 | ||
293 | + }, | ||
294 | + success: function(t) { | ||
295 | + for (var e = 0; e < th.data.orderList.length; e++) | ||
296 | + if (th.data.orderList[e].order_id == order_id) { | ||
297 | + th.data.orderList.splice(e, 1), th.setData({ | ||
298 | + orderList: th.data.orderList | ||
262 | }); | 299 | }); |
263 | - } | ||
264 | - }); | ||
265 | - }, | 300 | + break; |
301 | + } | ||
302 | + } | ||
303 | + }) | ||
304 | + } | ||
305 | + }); | ||
306 | + }, | ||
266 | 307 | ||
267 | - //-----删除订单----- | ||
268 | - deleteOrderData: function(t) { | ||
269 | - var th=this; | ||
270 | - var order_id=t.currentTarget.dataset.order_id; | ||
271 | - wx.showModal({ | ||
272 | - title: "是否删除订单?", | ||
273 | - success: function(tt) { | ||
274 | - tt.confirm && rq.put("/api/weshop/order/updatebyId", { | ||
275 | - data: { | ||
276 | - order_id: order_id, order_status: 5 | ||
277 | - }, | ||
278 | - success: function (t) { | ||
279 | - for (var e = 0; e < th.data.orderList.length; e++) if (th.data.orderList[e].order_id == order_id) { | ||
280 | - th.data.orderList.splice(e, 1), th.setData({ | ||
281 | - orderList: this.data.orderList | ||
282 | - }); | ||
283 | - break; | ||
284 | - } | ||
285 | - } | ||
286 | - }) | ||
287 | - } | 308 | + deleteOrderData2: function(order_id) { |
309 | + var th = this; | ||
310 | + for (var e = 0; e < th.data.orderList.length; e++) | ||
311 | + if (th.data.orderList[e].order_id == order_id) { | ||
312 | + th.data.orderList.splice(e, 1), th.setData({ | ||
313 | + orderList: this.data.orderList | ||
288 | }); | 314 | }); |
289 | - }, | 315 | + break; |
316 | + } | ||
317 | + }, | ||
290 | 318 | ||
291 | - deleteOrderData2:function(order_id){ | ||
292 | - var th=this; | ||
293 | - for (var e = 0; e < th.data.orderList.length; e++) if (th.data.orderList[e].order_id == order_id) { | ||
294 | - th.data.orderList.splice(e, 1), th.setData({ | ||
295 | - orderList: this.data.orderList | 319 | + //---判断是不是有退款----- |
320 | + checkReturnGoodsStatus: function(t) { | ||
321 | + var e = t.currentTarget.dataset.recid; | ||
322 | + var oid = t.currentTarget.dataset.oid; | ||
323 | + r.get("/api/weshop/order/returngoods/page", { | ||
324 | + data: { | ||
325 | + goods_id: e, | ||
326 | + order_id: oid, | ||
327 | + store_id: os.stoid | ||
328 | + }, | ||
329 | + success: function(t) { | ||
330 | + if (t.data.code == 0) { | ||
331 | + var r = t.data.data.total; | ||
332 | + if (0 == r) return wx.navigateTo({ | ||
333 | + url: "/pages/user/return_goods/return_goods?rec_id=" + e + "&order_id=" + oid, | ||
334 | + }); | ||
335 | + //--如果拒绝,就重新申请退款-- | ||
336 | + if (t.data.data.pageData[0].status == 3) { | ||
337 | + return wx.navigateTo({ | ||
338 | + url: "/pages/user/return_goods/return_goods?rec_id=" + e + "&order_id=" + oid, | ||
296 | }); | 339 | }); |
297 | - break; | ||
298 | - } | ||
299 | - }, | ||
300 | - | ||
301 | - //---判断是不是有退款----- | ||
302 | - checkReturnGoodsStatus: function(t) { | ||
303 | - var e = t.currentTarget.dataset.recid; | ||
304 | - var oid = t.currentTarget.dataset.oid; | ||
305 | - r.get("/api/weshop/order/returngoods/page", { | ||
306 | - data: { | ||
307 | - goods_id: e, | ||
308 | - order_id:oid, | ||
309 | - store_id:os.stoid | ||
310 | - }, | ||
311 | - success: function(t) { | ||
312 | - if(t.data.code==0){ | ||
313 | - var r = t.data.data.total; | ||
314 | - if (0 == r) return wx.navigateTo({ | ||
315 | - url: "/pages/user/return_goods/return_goods?rec_id=" + e + "&order_id=" + oid, | ||
316 | - }); | ||
317 | - //--如果拒绝,就重新申请退款-- | ||
318 | - if (t.data.data.pageData[0].status==3){ | ||
319 | - return wx.navigateTo({ | ||
320 | - url: "/pages/user/return_goods/return_goods?rec_id=" + e + "&order_id=" + oid, | ||
321 | - }); | ||
322 | - } | 340 | + } |
323 | 341 | ||
324 | - wx.navigateTo({ | ||
325 | - url: "/pages/user/return_goods_info/return_goods_info?id=" + r | ||
326 | - }); | ||
327 | - } | ||
328 | - } | ||
329 | - }); | ||
330 | - }, | 342 | + wx.navigateTo({ |
343 | + url: "/pages/user/return_goods_info/return_goods_info?id=" + r | ||
344 | + }); | ||
345 | + } | ||
346 | + } | ||
347 | + }); | ||
348 | + }, | ||
331 | 349 | ||
332 | - /*----------跳转支付-----------*/ | ||
333 | - jumpToCart4: function(t) { | ||
334 | - var o_index=t.currentTarget.dataset.idx; | ||
335 | - var e = this.data.orderList[t.currentTarget.dataset.idx]; | ||
336 | - var th=this; | 350 | + /*----------跳转支付-----------*/ |
351 | + jumpToCart4: function(t) { | ||
352 | + var o_index = t.currentTarget.dataset.idx; | ||
353 | + var e = this.data.orderList[t.currentTarget.dataset.idx]; | ||
354 | + var th = this; | ||
337 | 355 | ||
338 | - console.log("jumpToCart4"); | ||
339 | - console.log(e); | 356 | + console.log("jumpToCart4"); |
357 | + console.log(e); | ||
340 | 358 | ||
341 | - if(e.order_amount==0){ | ||
342 | - var dd = { | ||
343 | - parent_sn: e.order_sn, | ||
344 | - store_id: e.store_id, | ||
345 | - type: 1, | ||
346 | - }; | ||
347 | - getApp().request.post("/api/weshop/order/pay/createOrder", { | ||
348 | - data: dd, | ||
349 | - success: function (t) { | ||
350 | - if(t.data.code==0){ | ||
351 | - th.onload(); | ||
352 | - }else{ | ||
353 | - getApp().confirmBox(t.data.msg+"请您取消该订单"); | ||
354 | - } | ||
355 | - } | ||
356 | - }) | ||
357 | - return false; | 359 | + if (e.order_amount == 0) { |
360 | + var dd = { | ||
361 | + parent_sn: e.order_sn, | ||
362 | + store_id: e.store_id, | ||
363 | + type: 1, | ||
364 | + }; | ||
365 | + getApp().request.post("/api/weshop/order/pay/createOrder", { | ||
366 | + data: dd, | ||
367 | + success: function(t) { | ||
368 | + if (t.data.code == 0) { | ||
369 | + th.onload(); | ||
370 | + } else { | ||
371 | + getApp().confirmBox(t.data.msg + "请您取消该订单"); | ||
372 | + } | ||
358 | } | 373 | } |
374 | + }) | ||
375 | + return false; | ||
376 | + } | ||
359 | 377 | ||
360 | - a.jumpToCart4({ | ||
361 | - order_sn: e.order_sn, | ||
362 | - order_amount: e.order_amount, | ||
363 | - type:1//正常单 | ||
364 | - }); | ||
365 | - }, | ||
366 | - | ||
367 | - //------图片失败,默认图片--------- | ||
368 | - bind_bnerr: function (e) { | ||
369 | - var _errImg = e.target.dataset.errorimg; | ||
370 | - var _errObj = {}; | ||
371 | - _errObj[_errImg] = "public/images/default_goods_image_240.gif"; | ||
372 | - this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ; | ||
373 | - }, | 378 | + a.jumpToCart4({ |
379 | + order_sn: e.order_sn, | ||
380 | + order_amount: e.order_amount, | ||
381 | + type: 1 //正常单 | ||
382 | + }); | ||
383 | + }, | ||
374 | 384 | ||
375 | - //--------跳转到退款详情----------- | ||
376 | - gotoreturn:function(t){ | ||
377 | - var e = t.currentTarget.dataset.recid; | ||
378 | - var oid = t.currentTarget.dataset.oid; | ||
379 | - var wh=""; | ||
380 | - if(e!=undefined && e!=null && e!=""){ | ||
381 | - wh="&goods_id="+e; | ||
382 | - } | ||
383 | - wx.navigateTo({ | ||
384 | - url: "/pages/user/return_goods_info/return_goods_info?order_id=" + oid+wh, | ||
385 | - }); | ||
386 | - }, | 385 | + //------图片失败,默认图片--------- |
386 | + bind_bnerr: function(e) { | ||
387 | + var _errImg = e.currentTarget.dataset.errorimg; | ||
388 | + var _errObj = {}; | ||
389 | + _errObj[_errImg] = "public/images/default_goods_image_240.gif"; | ||
390 | + this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ; | ||
391 | + }, | ||
387 | 392 | ||
388 | - //-----支付尾款------ | ||
389 | - pay_wk:function (ee) { | ||
390 | - console.log("pay_wk"); | ||
391 | - var order_id=ee.currentTarget.dataset.order_id; | ||
392 | - wx.navigateTo({ | ||
393 | - url: "/pages/cart/cart_wk/cart_wk?order_id=" + order_id, | ||
394 | - }); | 393 | + //--------跳转到退款详情----------- |
394 | + gotoreturn: function(t) { | ||
395 | + var e = t.currentTarget.dataset.recid; | ||
396 | + var oid = t.currentTarget.dataset.oid; | ||
397 | + var wh = ""; | ||
398 | + if (e != undefined && e != null && e != "") { | ||
399 | + wh = "&goods_id=" + e; | ||
400 | + } | ||
401 | + wx.navigateTo({ | ||
402 | + url: "/pages/user/return_goods_info/return_goods_info?order_id=" + oid + wh, | ||
403 | + }); | ||
404 | + }, | ||
395 | 405 | ||
396 | - }, | ||
397 | - | ||
398 | - //--判断是不是可以单个商品退-- | ||
399 | - check_for_return_btn:function (item) { | ||
400 | - if(item.coupon_no) return false; //有用优惠券 | ||
401 | - if(item.order_prom_id) return false; //有订单优惠 | ||
402 | - if(item.order_status>=2) return false; //订单状态>2 | ||
403 | - var istrue=true; | ||
404 | - //----判断是不是有优惠活动和赠送商品---- | ||
405 | - for (var g in item.goodslist) { | ||
406 | - var g_item=item.goodslist[g]; | ||
407 | - if ((g_item.prom_type == 3 && g_item.discount_amount> 0) | ||
408 | - || (g_item.prom_type== 3 && g_item.goods_price <= 0) | ||
409 | - ) { | ||
410 | - istrue=false; break | ||
411 | - } | ||
412 | - if (g_item.prom_type== 5) { | ||
413 | - istrue=false; break | ||
414 | - } | ||
415 | - } | ||
416 | - if(!istrue) return false; | ||
417 | - var conf=this.data.conf; | ||
418 | - //判断是不是原路退回 | ||
419 | - if(conf.refund_type==1) return true; | ||
420 | - else{ | ||
421 | - if(item.order_amount==0 || item.user_money==0) return true; | ||
422 | - } | ||
423 | - return false; | ||
424 | - } | 406 | + //-----支付尾款------ |
407 | + pay_wk: function(ee) { | ||
408 | + console.log("pay_wk"); | ||
409 | + var order_id = ee.currentTarget.dataset.order_id; | ||
410 | + wx.navigateTo({ | ||
411 | + url: "/pages/cart/cart_wk/cart_wk?order_id=" + order_id, | ||
412 | + }); | ||
425 | 413 | ||
414 | + }, | ||
426 | 415 | ||
416 | + //--判断是不是可以单个商品退-- | ||
417 | + check_for_return_btn: function(item) { | ||
418 | + if (item.coupon_no) return false; //有用优惠券 | ||
419 | + if (item.order_prom_id) return false; //有订单优惠 | ||
420 | + if (item.order_status >= 2) return false; //订单状态>2 | ||
421 | + var istrue = true; | ||
422 | + //----判断是不是有优惠活动和赠送商品---- | ||
423 | + for (var g in item.goodslist) { | ||
424 | + var g_item = item.goodslist[g]; | ||
425 | + if ((g_item.prom_type == 3 && g_item.discount_amount > 0) || | ||
426 | + (g_item.prom_type == 3 && g_item.goods_price <= 0) | ||
427 | + ) { | ||
428 | + istrue = false; | ||
429 | + break | ||
430 | + } | ||
431 | + if (g_item.prom_type == 5) { | ||
432 | + istrue = false; | ||
433 | + break | ||
434 | + } | ||
435 | + } | ||
436 | + if (!istrue) return false; | ||
437 | + var conf = this.data.conf; | ||
438 | + //判断是不是原路退回 | ||
439 | + if (conf.refund_type == 1) return true; | ||
440 | + else { | ||
441 | + if (item.order_amount == 0 || item.user_money == 0) return true; | ||
442 | + } | ||
443 | + return false; | ||
444 | + }, | ||
445 | + //跳到首页 | ||
446 | + goto: function(e) { | ||
447 | + wx.switchTab({ | ||
448 | + url: '/pages/index/index/index', | ||
449 | + }) | ||
450 | + }, | ||
427 | 451 | ||
452 | + //显示核销码 | ||
453 | + code_show: function(e) { | ||
454 | + var th = this; | ||
455 | + //--获取成功的时候-- | ||
456 | + var no = e.currentTarget.dataset.order_sn; | ||
457 | + var qc_com = th.selectComponent("#qc_com"); //组件的id | ||
458 | + var obj = { | ||
459 | + val: no, | ||
460 | + content: "请将二维码展示给核销员,收货更快捷" | ||
461 | + }; | ||
462 | + qc_com.open(obj) | ||
463 | + } | ||
428 | }); | 464 | }); |
429 | \ No newline at end of file | 465 | \ No newline at end of file |
pages/user/order_list/order_list.json
pages/user/order_list/order_list.wxml
1 | <wxs module="filters" src="../../../utils/filter.wxs"></wxs> | 1 | <wxs module="filters" src="../../../utils/filter.wxs"></wxs> |
2 | <view class="container"> | 2 | <view class="container"> |
3 | - <view class="type-navbar"> | ||
4 | - <view class="type-box" wx:for="{{categories}}" wx:key="{{index}}"> | ||
5 | - <view bindtap="changeTab" class="type-navbar-item {{activeCategoryId==item.id?'type-item-on':''}}" id="{{item.id}}"> | ||
6 | - {{item.name}} | ||
7 | - </view> | ||
8 | - </view> | 3 | + <view class="type-navbar padding fs30"> |
4 | + <view class="type-box flex-center" wx:for="{{categories}}" wx:key="{{index}}"> | ||
5 | + <view id="{{item.id}}" bindtap="changeTab" class="type-navbar-item {{activeCategoryId==item.id?'type-item-on':''}}"> | ||
6 | + {{item.name}} | ||
7 | + </view> | ||
9 | </view> | 8 | </view> |
10 | - <view class="goods-container"> | ||
11 | - <view class="goods-box" data-id="{{item.order_id}}" wx:for="{{orderList}}" wx:key="{{index}}"> | ||
12 | - <navigator url="/pages/user/order_detail/order_detail?order_id={{item.order_id}}"> | ||
13 | - <view class="goods-title"> | ||
14 | - <view class="order-number">订单编号:{{item.order_sn}}</view> | ||
15 | - <view class="pay-status">{{item.order_status_detail}}</view> | ||
16 | - </view> | ||
17 | - </navigator> | 9 | + </view> |
10 | +</view> | ||
11 | +<view class="stay_evaluate" data-id="{{item.order_id}}" wx:for="{{orderList}}" wx:key="{{index}}"> | ||
18 | 12 | ||
19 | - <view class="goods-cont" wx:for="{{item.order_goods}}" wx:for-item="goods" | ||
20 | - wx:if="{{goods.return_btn!=4}}" | ||
21 | - wx:for-index="pinx" | ||
22 | - wx:key="{{index}}"> | ||
23 | - <navigator class="img-box" url="/pages/user/order_detail/order_detail?order_id={{goods.order_id}}"> | ||
24 | - <image class="wh100" src="{{resourceUrl+goods.original_img}}" binderror="bind_bnerr" lazy-load="true" | ||
25 | - data-errorimg="orderList[{{index}}].order_goods[{{pinx}}].original_img"></image> | ||
26 | - </navigator> | ||
27 | - <navigator class="goods-mes" url="/pages/user/order_detail/order_detail?order_id={{goods.order_id}}"> | ||
28 | - <view class="goods-name" >{{goods.goods_name}}</view> | ||
29 | - <view class="goods-name" style="color:#999">{{goods.goods_color}} {{goods.goods_spec}}</view> | ||
30 | - <view class="goods-price">¥ {{goods.member_goods_price}}</view> | ||
31 | - <view class="goods-num">数量 {{goods.goods_num}}</view> | ||
32 | - </navigator> | 13 | + <!-- 商品编号和状态 --> |
14 | + <view class="Commodity_number flex-vertical-between fs30 padding border_bottom"> | ||
15 | + <!--商品编号 --> | ||
16 | + <text selectable='true'>订单编号:{{item.order_sn}}</text> | ||
17 | + <!-- 商品评价状态 --> | ||
18 | + <view class="flex-center xc-wc"> | ||
19 | + <!-- 订单状态 --> | ||
20 | + <view wx:if="{{item.pt_status==1}}">组团中</view> | ||
21 | + <view wx:if="{{(item.order_status==0&&item.pay_status==0)}}">未支付</view> | ||
22 | + <block wx:if="{{!(item.is_all_return_status==0 || item.is_all_return_status==1)}}"> | ||
23 | + <view wx:if="{{(item.order_status==1&&item.pay_status==1&&item.shipping_status==0)}}">待发货</view> | ||
24 | + <view wx:if="{{(item.order_status==1&&item.pay_status==1&&item.shipping_status==1)}}">待收货</view> | ||
25 | + <view wx:if="{{(item.order_status==2)}}">待评价</view> | ||
26 | + <view wx:if="{{item.order_status==4}}">已评价</view> | ||
27 | + <view wx:if="{{item.order_status==3}}">已取消</view> | ||
28 | + <view wx:if="{{item.pt_status==2 && item.pt_tail_money>0}}">待支付尾款</view> | ||
29 | + <view wx:if="{{item.order_status==6}}">退款成功</view> | ||
30 | + <view wx:if="{{item.pt_status==6}}">支付尾款失败</view> | ||
31 | + </block> | ||
32 | + <block wx:else>退款中</block> | ||
33 | + <view class="flex" wx:if="{{(item.order_status==0&&item.pay_status==0)}}"> | ||
34 | + <view class="lin"></view> | ||
35 | + <image src="{{iurl}}miniapp/images/trash.png" bindtap="deleteOrderData" data-order_id="{{item.order_id}}"></image> | ||
36 | + </view> | ||
37 | + </view> | ||
38 | + </view> | ||
33 | 39 | ||
40 | + <!-- 商品详情集合 --> | ||
41 | + <view class="detail_commoditys"> | ||
42 | + <!-- 单个商品 --> | ||
43 | + <view> | ||
44 | + <navigator class="detail_commodity flex-vertical padding border_bottom" wx:for="{{item.order_goods}}" wx:for-item="goods" wx:if="{{goods.return_btn!=4}}" wx:for-index="pinx" url="/pages/user/order_detail/order_detail?order_id={{item.order_id}}"> | ||
45 | + <!-- 商品图片 --> | ||
46 | + <navigator class="rel"> | ||
47 | + <image src="{{resourceUrl+goods.original_img}}" binderror="bind_bnerr" lazy-load="{{true}}" data-errorimg="orderList[{{index}}].order_goods[{{pinx}}].original_img"></image> | ||
48 | + <view class="abs flex-center fs26" wx:if="{{goods.prom_type==1}}">秒杀</view> | ||
49 | + <view class="abs flex-center fs26" wx:if="{{goods.prom_type==6}}">团购</view> | ||
50 | + </navigator> | ||
51 | + <!-- 商品内容 --> | ||
52 | + <view class="Commodity_content"> | ||
53 | + <view class="Commodity_goods"> | ||
54 | + <!-- 商品名称 --> | ||
55 | + <view class="goods_name ellipsis-2 fs30">{{goods.goods_name}}</view> | ||
56 | + <view class="flex-space-between"> | ||
57 | + <!-- 商品规格 --> | ||
58 | + <view class="Commodity_spec fs28 flex-center"> | ||
59 | + <text class="ellipsis-1" wx:if="{{goods.goods_color.length>1 && goods.goods_spec.length>1}}">{{goods.goods_color+"/"+goods.goods_spec}}</text> | ||
60 | + <text class="ellipsis-1" wx:elif="{{goods.goods_color.length>1 || goods.goods_spec.length>1}}">{{goods.goods_color==undefined?"":goods.goods_color}}{{goods.goods_spec==undefined?"":goods.goods_spec}}</text> | ||
61 | + <text class="ellipsis-1" wx:else>规格1</text> | ||
62 | + </view> | ||
63 | + <view class="flex-level-right fs26 refund"> | ||
34 | <!-- 不是整单退的时候 --> | 64 | <!-- 不是整单退的时候 --> |
35 | <block wx:if="{{item.is_all_return!=1}}"> | 65 | <block wx:if="{{item.is_all_return!=1}}"> |
36 | - <view bindtap="checkReturnGoodsStatus" class="return-btn" data-oid="{{goods.order_id}}" | ||
37 | - data-recid="{{goods.goods_id}}" wx:if="{{goods.return_btn==1}}">申请退款</view> | ||
38 | - <view bindtap="gotoreturn" class="return-btn" data-oid="{{goods.order_id}}" | ||
39 | - data-recid="{{goods.goods_id}}" wx:if="{{goods.return_btn==2}}">退款中</view> | ||
40 | - <view bindtap="checkReturnGoodsStatus" class="return-btn" data-oid="{{goods.order_id}}" | ||
41 | - data-recid="{{goods.goods_id}}" wx:if="{{goods.return_btn==3}}">重新退款</view> | ||
42 | - <view bindtap="gotoreturn" class="return-btn" data-oid="{{goods.order_id}}" | ||
43 | - data-recid="{{goods.goods_id}}" wx:if="{{goods.return_btn==4}}">退款完成</view> | ||
44 | - </block> | ||
45 | - | ||
46 | - <block wx:if="{{item.pt_status==1}}"> | ||
47 | - <view class="return-btn co-red">组团中</view> | ||
48 | - </block> | ||
49 | - <block wx:if="{{item.pt_status==2 && item.pt_tail_money>0}}"> | ||
50 | - <view class="return-btn co-red">待支付尾款</view> | 66 | + <view catchtap="checkReturnGoodsStatus" class="return-btn" data-oid="{{goods.order_id}}" data-recid="{{goods.goods_id}}" wx:if="{{goods.return_btn==1}}">申请退款</view> |
67 | + <view catchtap="gotoreturn" class="return-btn" data-oid="{{goods.order_id}}" data-recid="{{goods.goods_id}}" wx:if="{{goods.return_btn==2}}">退款中</view> | ||
68 | + <view catchtap="checkReturnGoodsStatus" class="return-btn" data-oid="{{goods.order_id}}" data-recid="{{goods.goods_id}}" wx:if="{{goods.return_btn==3}}">重新退款</view> | ||
69 | + <view catchtap="gotoreturn" class="return-btn" data-oid="{{goods.order_id}}" data-recid="{{goods.goods_id}}" wx:if="{{goods.return_btn==4}}">退款完成</view> | ||
51 | </block> | 70 | </block> |
71 | + </view> | ||
72 | + </view> | ||
73 | + </view> | ||
74 | + <!-- 商品价格数量 --> | ||
75 | + <view class="Commodity_money flex-vertical-between baseline"> | ||
76 | + <!-- 商品价格 --> | ||
77 | + <view class="flex-vertical xc-wc baseline"> | ||
78 | + <view class="fs24">¥</view> | ||
79 | + <view class="fs30">{{filters.toFix(goods.member_goods_price,2)}}</view> | ||
52 | </view> | 80 | </view> |
81 | + <view class="fs30">x{{goods.goods_num}}</view> | ||
82 | + </view> | ||
83 | + </view> | ||
84 | + </navigator> | ||
85 | + <!-- 去评价 --> | ||
86 | + <view class="commodity_evaluate jc_sb padding baseline fs26"> | ||
87 | + <!-- 商品数量 --> | ||
88 | + <view class="commodity_smy flex fs30"> | ||
89 | + <view class="order-total"> | ||
90 | + <view> | ||
91 | + 共{{item.g_num}}件商品 | ||
92 | + </view> | ||
93 | + <view class="goods-total flex"> | ||
94 | + <block wx:if="{{item.pt_status==4 || item.pt_status==5}}"> | ||
95 | + <view class="commodity_money flex baseline"> | ||
96 | + <view>合计:</view> | ||
97 | + <view class="fs24 xc-wc">¥</view> | ||
98 | + <view class="xc-wc">{{filters.toFix(item.order_amount+item.user_money+item.pt_tail_money,2)}} | ||
99 | + </view> | ||
53 | 100 | ||
54 | - <view class="goods-tips"> | ||
55 | - <view class="order-total"> | ||
56 | - 共{{item.g_num}}件,<view class="goods-total"> | ||
57 | - <block wx:if="{{item.pt_status==4 || item.pt_status==5 }}"> | ||
58 | - <view>金额:¥{{filters.toFix(item.order_amount+item.user_money+item.pt_tail_money,2)}}</view> | ||
59 | - </block> | ||
60 | - <block wx:else> | ||
61 | - <view wx:if="{{item.is_zsorder==4}}">定金:¥{{filters.toFix(item.order_amount+item.user_money,2)}}</view> | ||
62 | - <view wx:else>金额:¥{{filters.toFix(item.order_amount+item.user_money,2)}}</view> | ||
63 | - <view wx:if="{{item.pt_tail_money>0}}">尾款:¥{{filters.toFix(item.pt_tail_money-item.shipping_price,2)}}</view> | ||
64 | - </block> | ||
65 | - | ||
66 | - </view> | ||
67 | </view> | 101 | </view> |
68 | - | 102 | + </block> |
103 | + <block wx:else> | ||
104 | + <view wx:if="{{item.is_zsorder==4}}" class="commodity_money flex baseline"> | ||
105 | + <view>定金:</view> | ||
106 | + <view class="fs24 xc-wc">¥</view> | ||
107 | + <view class="xc-wc">{{filters.toFix(item.order_amount+item.user_money,2)}} | ||
108 | + </view> | ||
109 | + </view> | ||
110 | + <view class="commodity_money flex baseline" wx:else> | ||
111 | + <view>合计:</view> | ||
112 | + <view class="fs24 xc-wc">¥</view> | ||
113 | + <view class="xc-wc">{{filters.toFix(item.order_amount+item.user_money,2)}} | ||
114 | + </view> | ||
115 | + </view> | ||
116 | + <view wx:if="{{item.pt_tail_money>0}}" class="commodity_money flex baseline"> | ||
117 | + <view>待支付尾款:</view> | ||
118 | + <view class="fs24 xc-wc">¥</view> | ||
119 | + <view class="xc-wc">{{filters.toFix(item.pt_tail_money-item.shipping_price,2)}} | ||
120 | + </view> | ||
121 | + </view> | ||
122 | + </block> | ||
69 | </view> | 123 | </view> |
124 | + </view> | ||
125 | + </view> | ||
126 | + <view class="links flex-right-vertical fs30"> | ||
127 | + <image wx:if="{{(item.order_status==1&&item.pay_status==1 && item.shipping_status==0 && item.exp_type==1)}}" class="code" src="{{iurl}}miniapp/images/order/code.png" bindtap="code_show" data-order_sn="{{item.order_sn}}"></image> | ||
70 | 128 | ||
71 | - <view class="check-btn"> | ||
72 | - <navigator url="/pages/cart/cart_wk/cart_wk?order_id={{item.order_id}}" | ||
73 | - class="order-btn order-btn-pay" data-idx="{{index}}" wx:if="{{item.pt_status==2 && item.pt_tail_money>0}}">支付尾款</navigator> | ||
74 | - <navigator bindtap="jumpToCart4" class="order-btn order-btn-pay " data-idx="{{index}}" hidden="{{!(item.order_status==0&&item.pay_status==0)}}">立即付款</navigator> | ||
75 | - <view class="order-btn" data-id="{{item.order_id}}" wx:if="{{item.order_status==3 && item.pt_status!=3 }}">已取消</view> | ||
76 | - <view bindtap="cancelOrder" class="order-btn" data-id="{{item.order_id}}" data-zsorder="{{item.is_zsorder}}" data-orderindex="{{index}}" | ||
77 | - hidden="{{!(item.order_status==0 &&item.pay_status==0)}}">取消订单</view> | ||
78 | - <view class="order-btn" wx:if="{{item.pt_status==3}}">拼团失败</view> | ||
79 | - | ||
80 | - <!---has_rt部分退----> | ||
81 | - <block wx:if="{{item.return_btn==undefined && item.is_all_return!=1 && item.has_rt!=1}}"> | ||
82 | - <navigator class="order-btn" hidden="{{!(item.order_status==0&&item.pay_status==1)}}" url="/pages/order/refund_order/refund_order?order_id={{item.order_id}}">申请退款</navigator> | ||
83 | - <navigator class="order-btn" hidden="{{!(item.order_status==1&&item.pay_status==1)}}" url="/pages/order/refund_order/refund_order?order_id={{item.order_id}}">申请退款</navigator> | ||
84 | - </block> | ||
85 | - <block wx:else> | ||
86 | - <view class="order-btn" wx:if="{{item.is_all_return_status==2}}" bindtap="deleteOrderData" data-order_id="{{item.order_id}}" >删除订单</view> | ||
87 | - <navigator class="order-btn" wx:if="{{item.is_all_return_status==3}}" url="/pages/order/refund_order/refund_order?order_id={{item.order_id}}">重新退款</navigator> | ||
88 | - <navigator class="order-btn" wx:if="{{item.is_all_return_status==0 || item.is_all_return_status==1}}" | ||
89 | - url="/pages/user/return_goods_info/return_goods_info?order_id={{item.order_id}}">退款详情</navigator> | ||
90 | - </block> | ||
91 | - | ||
92 | - <block wx:if="{{!(item.has_rt || item.return_btn==2 || item.return_btn==4)}}"> | ||
93 | - <view bindtap="confirmOrder" data-zsorder="{{item.is_zsorder}}" class="order-btn white red-b" data-id="{{item.order_id}}" hidden="{{!(item.order_status==1&&item.pay_status==1&&item.shipping_status==1)}}">确认收货</view> | ||
94 | - <view bindtap="confirmOrder" data-zsorder="{{item.is_zsorder}}" class="order-btn white red-b" data-id="{{item.order_id}}" hidden="{{!(item.order_status==1&&item.pay_status==1&&item.shipping_status==2)}}">确认收货</view> | ||
95 | - </block> | ||
96 | - | ||
97 | - <navigator redirect class="order-btn white red-b" hidden="{{!(item.order_status==2)}}" url="/pages/user/comment/comment?status=0">评价</navigator> | ||
98 | - <navigator class="order-btn" hidden="{{!(item.exp_type==0&&item.pay_status==1&&item.shipping_status==1)}}" url="/pages/user/express/express?order_id={{item.order_id}}">查看物流</navigator> | ||
99 | - <navigator class="order-btn" hidden="{{!(item.exp_type==0&&item.pay_status==1&&item.shipping_status==2)}}" url="/pages/user/express/express?order_id={{item.order_id}}">查看物流</navigator> | ||
100 | - <navigator class="order-btn" url="/pages/user/order_detail/order_detail?order_id={{item.order_id}}">订单详情</navigator> | ||
101 | - </view> | 129 | + <view class="commodity_To_evaluate flex-level View_evaluation" data-id="{{item.order_id}}" wx:if="{{item.order_status==3 && item.pt_status!=3}}">已取消</view> |
130 | + <view bindtap="cancelOrder" class="commodity_To_evaluate flex-level View_evaluation" data-id="{{item.order_id}}" data-zsorder="{{item.is_zsorder}}" data-orderindex="{{index}}" wx:if="{{(item.order_status==0 &&item.pay_status==0)}}">取消订单</view> | ||
131 | + <view class="commodity_To_evaluate flex-level View_evaluation" wx:if="{{item.pt_status==3}}">拼团失败</view> | ||
132 | + <!---has_rt部分退----> | ||
133 | + <block wx:if="{{item.return_btn==undefined && item.is_all_return!=1 && item.has_rt!=1}}"> | ||
134 | + <navigator class="commodity_To_evaluate flex-level View_evaluation" hidden="{{!(item.order_status==0&&item.pay_status==1)}}" url="/pages/order/refund_order/refund_order?order_id={{item.order_id}}">申请退款</navigator> | ||
135 | + <navigator class="commodity_To_evaluate flex-level View_evaluation" hidden="{{!(item.order_status==1&&item.pay_status==1)}}" url="/pages/order/refund_order/refund_order?order_id={{item.order_id}}">申请退款</navigator> | ||
136 | + </block> | ||
137 | + <block wx:else> | ||
138 | + <view class="commodity_To_evaluate flex-level View_evaluation" wx:if="{{item.is_all_return_status==2}}" bindtap="deleteOrderData" data-order_id="{{item.order_id}}">删除订单</view> | ||
139 | + <navigator class="commodity_To_evaluate flex-level View_evaluation" wx:if="{{item.is_all_return_status==3}}" url="/pages/order/refund_order/refund_order?order_id={{item.order_id}}">重新退款</navigator> | ||
140 | + <navigator class="commodity_To_evaluate flex-level View_evaluation" wx:if="{{item.is_all_return_status==0 || item.is_all_return_status==1}}" url="/pages/user/return_goods_info/return_goods_info?order_id={{item.order_id}}">退款详情</navigator> | ||
141 | + </block> | ||
142 | + <navigator class="commodity_To_evaluate flex-level View_evaluation" hidden="{{!(item.exp_type==0&&item.pay_status==1&&item.shipping_status==1)}}" url="/pages/user/express/express?order_id={{item.order_id}}">查看物流</navigator> | ||
143 | + <navigator class="commodity_To_evaluate flex-level View_evaluation" hidden="{{!(item.exp_type==0&&item.pay_status==1&&item.shipping_status==2)}}" url="/pages/user/express/express?order_id={{item.order_id}}">查看物流</navigator> | ||
144 | + <navigator class="commodity_To_evaluate flex-level View_evaluation" url="/pages/user/order_detail/order_detail?order_id={{item.order_id}}">订单详情</navigator> | ||
102 | 145 | ||
146 | + <block wx:if="{{!(item.has_rt || item.return_btn==2 || item.return_btn==4)}}"> | ||
147 | + <view bindtap="confirmOrder" data-zsorder="{{item.is_zsorder}}" class="commodity_To_evaluate flex-level comment_go" data-id="{{item.order_id}}" hidden="{{!(item.order_status==1&&item.pay_status==1&&item.shipping_status==1)}}">确认收货</view> | ||
148 | + <view bindtap="confirmOrder" data-zsorder="{{item.is_zsorder}}" class="commodity_To_evaluate flex-level comment_go" data-id="{{item.order_id}}" hidden="{{!(item.order_status==1&&item.pay_status==1&&item.shipping_status==2)}}">确认收货</view> | ||
149 | + </block> | ||
150 | + <navigator class="commodity_To_evaluate flex-level comment_go" hidden="{{!(item.order_status==2)}}" url="/pages/user/comment/comment?status=0">去评价</navigator> | ||
151 | + <navigator class="commodity_To_evaluate flex-level comment_go" url="/pages/cart/cart_wk/cart_wk?order_id={{item.order_id}}" data-idx="{{index}}" wx:if="{{item.pt_status==2 && item.pt_tail_money>0}}">支付尾款</navigator> | ||
152 | + <navigator class="commodity_To_evaluate flex-level comment_go" bindtap="jumpToCart4" data-idx="{{index}}" wx:if="{{(item.order_status==0&&item.pay_status==0)}}">立即支付</navigator> | ||
103 | </view> | 153 | </view> |
104 | - <view class="no-data" wx:if="{{ (!orderList||orderList.length==0) && is_get}}"> | ||
105 | - <image class="cart-image" src="{{iurl}}/miniapp/images/cart-null.png"></image> | ||
106 | - <view class="no-data-title">暂无订单列表</view> | ||
107 | - <navigator class="lookat" openType="switchTab" url="/pages/index/index/index"> 去逛逛 </navigator> | ||
108 | - </view> | 154 | + </view> |
109 | </view> | 155 | </view> |
156 | + </view> | ||
157 | +</view> | ||
158 | + | ||
159 | +<!-- 没有数据 --> | ||
160 | +<view class="After_all flex-center" wx:if="{{iscodeall==1 && orderList.length>1}}"> | ||
161 | + <view class="Line"></view> | ||
162 | + <view class="end fs26 xc-black">到底了</view> | ||
163 | + <view class="Line"></view> | ||
164 | +</view> | ||
165 | + | ||
166 | +<!-- 无订单 --> | ||
167 | +<view class="empty_order" wx:if="{{(!orderList||orderList.length==0) && is_get}}"> | ||
168 | + <view class="flex-level"> | ||
169 | + <image src="{{iurl}}miniapp/images/order/empty_order.png"></image> | ||
170 | + </view> | ||
171 | + <view class="flex-level fs30 xc-ash">当前暂无订单</view> | ||
172 | + <view class="flex-level"> | ||
173 | + <navigator url="/pages/index/index/index" bindtap="goto"> | ||
174 | + <view class="flex-center fs28 white">去首页逛逛</view> | ||
175 | + </navigator> | ||
176 | + </view> | ||
110 | </view> | 177 | </view> |
178 | +<!-- 弹出框扫描 --> | ||
179 | +<qr_code id="qc_com"></qr_code> | ||
111 | \ No newline at end of file | 180 | \ No newline at end of file |
pages/user/order_list/order_list.wxss
1 | +page { | ||
2 | + font-family: microsoft yahei; | ||
3 | +} | ||
4 | + | ||
1 | .type-navbar { | 5 | .type-navbar { |
2 | - white-space: nowrap; | ||
3 | - display: flex; | ||
4 | - width: 100%; | ||
5 | - height: 80rpx; | ||
6 | - background-color: #fff; | 6 | + white-space: nowrap; |
7 | + display: flex; | ||
8 | + height: 88rpx; | ||
9 | + background-color: #fff; | ||
10 | + justify-content: space-between; | ||
11 | + border-top: 1rpx solid rgb(211, 211, 211); | ||
7 | } | 12 | } |
8 | 13 | ||
9 | .type-box { | 14 | .type-box { |
10 | - width: 25%; | ||
11 | - box-sizing: border-box; | ||
12 | - font-size: 32rpx; | ||
13 | - line-height: 76rpx; | ||
14 | - padding: 0 20rpx; | ||
15 | - text-align: center; | ||
16 | - display: inline-block; | ||
17 | - overflow: hidden; | 15 | + box-sizing: border-box; |
16 | + line-height: 84rpx; | ||
17 | + text-align: center; | ||
18 | + display: inline-block; | ||
19 | + overflow: hidden; | ||
18 | } | 20 | } |
19 | 21 | ||
20 | .type-navbar-item { | 22 | .type-navbar-item { |
21 | - border-bottom: 4rpx solid #fff; | 23 | + border-bottom: 4rpx solid #fff; |
22 | } | 24 | } |
23 | 25 | ||
24 | .type-item-on { | 26 | .type-item-on { |
25 | - border-bottom: 4rpx solid #e64340; | 27 | + border-bottom: 4rpx solid #e64340; |
26 | } | 28 | } |
27 | 29 | ||
30 | +/* 原 */ | ||
31 | + | ||
28 | .goods-container { | 32 | .goods-container { |
29 | - display: flex; | ||
30 | - justify-content: space-between; | ||
31 | - flex-wrap: wrap; | ||
32 | - box-sizing: content-box; | ||
33 | - padding: 20rpx 0; | 33 | + display: flex; |
34 | + justify-content: space-between; | ||
35 | + flex-wrap: wrap; | ||
36 | + box-sizing: content-box; | ||
37 | + padding: 20rpx 0; | ||
34 | } | 38 | } |
35 | 39 | ||
36 | .goods-box { | 40 | .goods-box { |
37 | - width: 100%; | ||
38 | - background-color: #fff; | ||
39 | - padding: 0 25rpx; | ||
40 | - margin-bottom: 20rpx; | ||
41 | - font-size: 28rpx; | ||
42 | - border-bottom: 1rpx solid #eee; | ||
43 | - padding-bottom: 25rpx; | ||
44 | - | 41 | + width: 100%; |
42 | + background-color: #fff; | ||
43 | + padding: 0 25rpx; | ||
44 | + margin-bottom: 20rpx; | ||
45 | + font-size: 28rpx; | ||
46 | + border-bottom: 1rpx solid #eee; | ||
47 | + padding-bottom: 25rpx; | ||
45 | } | 48 | } |
46 | 49 | ||
47 | .goods-title { | 50 | .goods-title { |
48 | - display: flex; | ||
49 | - justify-content: space-between; | ||
50 | - align-items: center; | ||
51 | - height: 100rpx; | 51 | + display: flex; |
52 | + justify-content: space-between; | ||
53 | + align-items: center; | ||
54 | + height: 100rpx; | ||
52 | } | 55 | } |
53 | 56 | ||
54 | .order-number { | 57 | .order-number { |
55 | - font-size: 32rpx; | ||
56 | - color: #666; | 58 | + font-size: 32rpx; |
59 | + color: #666; | ||
57 | } | 60 | } |
58 | 61 | ||
59 | .pay-status { | 62 | .pay-status { |
60 | - color: #f23030; | 63 | + color: #f23030; |
61 | } | 64 | } |
62 | 65 | ||
63 | .goods-cont { | 66 | .goods-cont { |
64 | - padding: 20rpx 0; | ||
65 | - display: flex; | ||
66 | - justify-content: space-between; | ||
67 | - position: relative; | 67 | + padding: 20rpx 0; |
68 | + display: flex; | ||
69 | + justify-content: space-between; | ||
70 | + position: relative; | ||
68 | } | 71 | } |
69 | 72 | ||
70 | .img-box { | 73 | .img-box { |
71 | - width: 180rpx; | ||
72 | - height: 180rpx; | 74 | + width: 180rpx; |
75 | + height: 180rpx; | ||
73 | } | 76 | } |
74 | 77 | ||
75 | .goods-mes { | 78 | .goods-mes { |
76 | - width: 490rpx; | 79 | + width: 490rpx; |
77 | } | 80 | } |
78 | 81 | ||
79 | .goods-name { | 82 | .goods-name { |
80 | - height: 30rpx; | ||
81 | - margin-bottom: 16rpx; | ||
82 | - overflow: hidden; | ||
83 | - line-height: 30rpx; | ||
84 | - color: #333; | ||
85 | - word-break: keep-all; | ||
86 | - white-space: nowrap; | ||
87 | - text-overflow: ellipsis; | ||
88 | - font-size: 30rpx; | 83 | + height: 30rpx; |
84 | + margin-bottom: 16rpx; | ||
85 | + overflow: hidden; | ||
86 | + line-height: 30rpx; | ||
87 | + color: #333; | ||
88 | + word-break: keep-all; | ||
89 | + white-space: nowrap; | ||
90 | + text-overflow: ellipsis; | ||
91 | + font-size: 30rpx; | ||
89 | } | 92 | } |
90 | 93 | ||
91 | .goods-price { | 94 | .goods-price { |
92 | - color: #f23030; | ||
93 | - padding-bottom: 20rpx; | ||
94 | - font-size: 30rpx; | 95 | + color: #f23030; |
96 | + padding-bottom: 20rpx; | ||
97 | + font-size: 30rpx; | ||
95 | } | 98 | } |
96 | 99 | ||
97 | .goods-num { | 100 | .goods-num { |
98 | - color: #999999; | ||
99 | - font-size: 30rpx; | ||
100 | -} | ||
101 | - | ||
102 | -.return-btn { | ||
103 | - color: #999999; | ||
104 | - position: absolute; | ||
105 | - right: 0; | ||
106 | - bottom: 0rpx; | ||
107 | - height: 80rpx; | ||
108 | - line-height: 80rpx; | 101 | + color: #999; |
102 | + font-size: 30rpx; | ||
109 | } | 103 | } |
110 | 104 | ||
111 | .goods-tips { | 105 | .goods-tips { |
112 | - height: 60rpx; | ||
113 | - padding: 10rpx 0; | ||
114 | - display: flex; | ||
115 | - justify-content: space-between; | ||
116 | - align-items: center; | 106 | + height: 60rpx; |
107 | + padding: 10rpx 0; | ||
108 | + display: flex; | ||
109 | + justify-content: space-between; | ||
110 | + align-items: center; | ||
117 | } | 111 | } |
118 | 112 | ||
119 | .order-total { | 113 | .order-total { |
120 | - display: flex; | ||
121 | - justify-content: flex-start; | ||
122 | - font-size: 31rpx; | ||
123 | - color: #333; | 114 | + display: flex; |
115 | + justify-content: flex-start; | ||
124 | } | 116 | } |
125 | 117 | ||
126 | .goods-total { | 118 | .goods-total { |
127 | - margin-right: 20rpx; | ||
128 | - color: #f23030; | 119 | + margin-right: 20rpx; |
129 | } | 120 | } |
130 | 121 | ||
131 | .order-btn { | 122 | .order-btn { |
132 | - width: 150rpx; | ||
133 | - height: 50rpx; | ||
134 | - line-height: 50rpx; | ||
135 | - text-align: center; | ||
136 | - border: 1px solid #eee; | ||
137 | - margin-left: 10rpx; | ||
138 | - float: right; | ||
139 | - border-radius: 15rpx; | 123 | + width: 150rpx; |
124 | + height: 50rpx; | ||
125 | + line-height: 50rpx; | ||
126 | + text-align: center; | ||
127 | + border: 1px solid #eee; | ||
128 | + margin-left: 10rpx; | ||
129 | + float: right; | ||
130 | + border-radius: 15rpx; | ||
140 | } | 131 | } |
141 | 132 | ||
142 | .order-btn-pay { | 133 | .order-btn-pay { |
143 | - color: #fff; | ||
144 | - background-color: #f23030; | ||
145 | - border-color: #f23030; | 134 | + color: #fff; |
135 | + background-color: #f23030; | ||
136 | + border-color: #f23030; | ||
137 | +} | ||
138 | + | ||
139 | +.return-btn.co-red { | ||
140 | + color: #e02e24; | ||
146 | } | 141 | } |
147 | -.return-btn.co-red{color: #e02e24} | ||
148 | -.check-btn{ | 142 | + |
143 | +.check-btn { | ||
149 | margin-bottom: 20rpx; | 144 | margin-bottom: 20rpx; |
145 | +} | ||
146 | + | ||
147 | +/* 新 */ | ||
148 | + | ||
149 | +.Commodity_number { | ||
150 | + height: 80rpx; | ||
151 | + border-top: 13rpx solid rgb(245, 245, 245); | ||
152 | +} | ||
153 | + | ||
154 | +.Commodity_number .lin { | ||
155 | + border-left: 2rpx solid rgb(129, 65, 81); | ||
156 | + margin: 0rpx 15rpx; | ||
157 | + height: 31rpx; | ||
158 | +} | ||
159 | + | ||
160 | +.Commodity_number image { | ||
161 | + width: 30rpx; | ||
162 | + height: 32rpx; | ||
163 | +} | ||
164 | + | ||
165 | +.padding { | ||
166 | + padding: 0rpx 27rpx; | ||
167 | +} | ||
168 | + | ||
169 | +/* 文字基线对齐 */ | ||
170 | + | ||
171 | +.baseline { | ||
172 | + align-items: baseline; | ||
173 | +} | ||
174 | + | ||
175 | +.border_bottom { | ||
176 | + border-bottom: 4rpx solid rgb(245, 245, 245); | ||
177 | +} | ||
178 | + | ||
179 | +/* 单个商品框架 */ | ||
180 | + | ||
181 | +.detail_commodity { | ||
182 | + height: 231rpx; | ||
183 | +} | ||
184 | + | ||
185 | +.detail_commodity image { | ||
186 | + width: 185rpx; | ||
187 | + height: 185rpx; | ||
188 | +} | ||
189 | + | ||
190 | +.detail_commodity .goods_name { | ||
191 | + width: 485rpx; | ||
192 | + /* height: 75rpx; */ | ||
193 | + line-height: 37rpx; | ||
194 | +} | ||
195 | + | ||
196 | +.Commodity_content { | ||
197 | + height: 185rpx; | ||
198 | + margin-left: 21rpx; | ||
199 | +} | ||
200 | + | ||
201 | +.Commodity_content .Commodity_goods { | ||
202 | + height: 150rpx; | ||
203 | +} | ||
204 | + | ||
205 | +.Commodity_content .Commodity_money { | ||
206 | + font-size: 16rpx; | ||
207 | + letter-spacing: 1rpx; | ||
208 | +} | ||
209 | + | ||
210 | +/* 商品评价按钮框架 */ | ||
211 | + | ||
212 | +.commodity_evaluate { | ||
213 | + padding-top: 15rpx; | ||
214 | + padding-bottom: 15rpx; | ||
215 | + border-bottom: 4rpx solid rgb(245, 245, 245); | ||
216 | +} | ||
217 | + | ||
218 | +.commodity_evaluate .commodity_smy .commodity_money { | ||
219 | + margin-left: 29rpx; | ||
220 | + letter-spacing: 1rpx; | ||
221 | +} | ||
222 | + | ||
223 | +.commodity_evaluate .links { | ||
224 | + height: 92rpx; | ||
225 | +} | ||
226 | + | ||
227 | +.commodity_evaluate .commodity_To_evaluate { | ||
228 | + width: 155rpx; | ||
229 | + height: 48rpx; | ||
230 | + border-radius: 10rpx; | ||
231 | + line-height: 48rpx; | ||
232 | +} | ||
233 | + | ||
234 | +.commodity_evaluate .commodity_To_evaluate view { | ||
235 | + height: 39rpx; | ||
236 | + line-height: 39rpx; | ||
237 | +} | ||
238 | + | ||
239 | +.commodity_evaluate .comment_go { | ||
240 | + background-color: rgb(211, 28, 52); | ||
241 | + color: rgb(255, 255, 255); | ||
242 | + margin-left: 18rpx; | ||
243 | + width: 155rpx; | ||
244 | + height: 48rpx; | ||
245 | + line-height: 48rpx; | ||
246 | +} | ||
247 | + | ||
248 | +.Commodity_spec { | ||
249 | + height: 37rpx; | ||
250 | + line-height: 37rpx; | ||
251 | + max-width: 160rpx; | ||
252 | + background-color: rgb(236, 236, 236); | ||
253 | + border-radius: 6rpx; | ||
254 | + font-size: 22rpx; | ||
255 | + margin-top: 10rpx; | ||
256 | + padding:0rpx 10rpx; | ||
257 | +} | ||
258 | + | ||
259 | +.Commodity_evaluation .Comment_content { | ||
260 | + color: rgb(153, 153, 153); | ||
261 | + letter-spacing: 1rpx; | ||
262 | +} | ||
263 | + | ||
264 | +.Commodity_evaluation .starss { | ||
265 | + height: 58rpx; | ||
266 | + /* // line-height: 58rpx; */ | ||
267 | + align-items: center; | ||
268 | +} | ||
269 | + | ||
270 | +.Commodity_evaluation .commen { | ||
271 | + height: 58rpx; | ||
272 | + line-height: 58rpx; | ||
273 | +} | ||
274 | + | ||
275 | +.Commodity_evaluation .starss .stars { | ||
276 | + line-height: 58rpx; | ||
277 | +} | ||
278 | + | ||
279 | +.Commodity_evaluation .starss .stars image { | ||
280 | + width: 29rpx; | ||
281 | + height: 26rpx; | ||
282 | + margin-right: 5rpx; | ||
283 | +} | ||
284 | + | ||
285 | +.Commodity_evaluation .Comment_images image { | ||
286 | + width: 100rpx; | ||
287 | + height: 100rpx; | ||
288 | + margin-right: 8rpx; | ||
289 | + margin-top: 18rpx; | ||
290 | + border-radius: 6rpx; | ||
291 | + border: 3rpx solid rgb(245, 245, 245); | ||
292 | +} | ||
293 | + | ||
294 | +.commodity_evaluate .View_evaluation { | ||
295 | + border: 1px solid #ddd; | ||
296 | + color: rgb(0, 0, 0); | ||
297 | + background-color: rgb(255, 255, 255); | ||
298 | + margin-left: 18rpx; | ||
299 | +} | ||
300 | + | ||
301 | +.comment_addtime { | ||
302 | + height: 50rpx; | ||
303 | +} | ||
304 | + | ||
305 | +.title_width { | ||
306 | + width: 146rpx; | ||
307 | + text-align: center; | ||
308 | +} | ||
309 | + | ||
310 | +.After_all { | ||
311 | + height: 80rpx; | ||
312 | + background-color: rgb(245, 245, 245); | ||
313 | +} | ||
314 | + | ||
315 | +.After_all .Line { | ||
316 | + border-top: 1rpx solid rgb(0, 0, 0); | ||
317 | + width: 130rpx; | ||
318 | +} | ||
319 | + | ||
320 | +.After_all .end { | ||
321 | + margin: 0rpx 15rpx; | ||
322 | +} | ||
323 | + | ||
324 | +/* 无订单 */ | ||
325 | + | ||
326 | +.empty_order image { | ||
327 | + width: 329rpx; | ||
328 | + height: 229rpx; | ||
329 | + margin-top: 202rpx; | ||
330 | +} | ||
331 | + | ||
332 | +.empty_order .xc-ash { | ||
333 | + margin-top: 10rpx; | ||
334 | + font-weight: 600px; | ||
335 | +} | ||
336 | + | ||
337 | +.empty_order navigator { | ||
338 | + margin-top: 60rpx; | ||
339 | + border-radius: 40rpx; | ||
340 | +} | ||
341 | + | ||
342 | +.empty_order navigator view { | ||
343 | + width: 247rpx; | ||
344 | + height: 56rpx; | ||
345 | + background-color: rgb(255, 72, 72); | ||
346 | + border-radius: 40rpx; | ||
347 | +} | ||
348 | + | ||
349 | +.rel { | ||
350 | + width: 185rpx; | ||
351 | + height: 185rpx; | ||
352 | + overflow: hidden; | ||
353 | + border: 2rpx solid rgb(236, 236, 236); | ||
354 | +} | ||
355 | + | ||
356 | +.abs { | ||
357 | + top: 15rpx; | ||
358 | + left: -39rpx; | ||
359 | + width: 154rpx; | ||
360 | + height: 40rpx; | ||
361 | + background-color: rgb(214, 1, 33); | ||
362 | + transform: rotate(320deg); | ||
363 | + color: rgb(255, 255, 255); | ||
364 | + line-height: 40rpx; | ||
365 | +} | ||
366 | +.code{ | ||
367 | + width: 55rpx; | ||
368 | + height: 55rpx; | ||
369 | +} | ||
370 | +.refund{ | ||
371 | + margin-top: 20rpx; | ||
150 | } | 372 | } |
151 | \ No newline at end of file | 373 | \ No newline at end of file |