-
Status changed to merged
-
mentioned in commit 5c01726b9d84ae028ce652e18924f3c62ea67d27
Showing
26 changed files
app.json
@@ -168,6 +168,7 @@ | @@ -168,6 +168,7 @@ | ||
168 | "pages/goods/goodsList/goodsList", | 168 | "pages/goods/goodsList/goodsList", |
169 | "pages/payForAnother/payForAnother", | 169 | "pages/payForAnother/payForAnother", |
170 | "pages/luckyGo/luckyGo_cart/luckyGo_cart", | 170 | "pages/luckyGo/luckyGo_cart/luckyGo_cart", |
171 | + "pages/luckyGo/luckyGo_cart_ct/luckyGo_cart_ct", | ||
171 | "pages/luckyGo/luckyGo_list/luckyGo_list", | 172 | "pages/luckyGo/luckyGo_list/luckyGo_list", |
172 | "pages/luckyGo/luckyGo_order/luckyGo_order", | 173 | "pages/luckyGo/luckyGo_order/luckyGo_order", |
173 | "pages/luckyGo/luckyGo_details/luckyGo_details", | 174 | "pages/luckyGo/luckyGo_details/luckyGo_details", |
components/diy_goodsGroup/diy_goodsGroup.wxml
@@ -208,7 +208,7 @@ | @@ -208,7 +208,7 @@ | ||
208 | </view> | 208 | </view> |
209 | 209 | ||
210 | <view class='zs_center_2l'> | 210 | <view class='zs_center_2l'> |
211 | - <view class='zs_wz1_2l' wx:if="{{object.goodstit}}">{{item.goods_name}}</view> | 211 | + <view class='zs_wz1_2l ellipsis-2' wx:if="{{object.goodstit}}">{{item.goods_name}}</view> |
212 | <view class='zs_wz2_2l' wx:if="{{object.goodsprice}}"> | 212 | <view class='zs_wz2_2l' wx:if="{{object.goodsprice}}"> |
213 | 213 | ||
214 | <block wx:if="{{item.prom_price || item.prom_integral}}"> | 214 | <block wx:if="{{item.prom_price || item.prom_integral}}"> |
@@ -498,9 +498,15 @@ | @@ -498,9 +498,15 @@ | ||
498 | </block> | 498 | </block> |
499 | 499 | ||
500 | <block wx:else> | 500 | <block wx:else> |
501 | - <image class="zs_t_img_x {{object.big_order_type==0?'zj':''}}{{object.big_order_type==1?'yj':''}}" | 501 | + <!-- 原来的 --> |
502 | + <!-- <image class="zs_t_img_x {{object.big_order_type==0?'zj':''}}{{object.big_order_type==1?'yj':''}}" | ||
503 | + src="{{item.goods_img}}" data-errorimg="goods_array[{{index}}].goods_img" lazy-load="true" | ||
504 | + binderror="bind_bnerr3" mode="widthFix" style='max-height:290rpx'></image> --> | ||
505 | + | ||
506 | + <!-- 2021.11.27修改 --> | ||
507 | + <image class="block zs_t_img_x {{object.big_order_type==0?'zj':''}}{{object.big_order_type==1?'yj':''}}" | ||
502 | src="{{item.goods_img}}" data-errorimg="goods_array[{{index}}].goods_img" lazy-load="true" | 508 | src="{{item.goods_img}}" data-errorimg="goods_array[{{index}}].goods_img" lazy-load="true" |
503 | - binderror="bind_bnerr3" mode="widthFix" style='max-height:290rpx'></image> | 509 | + binderror="bind_bnerr3" mode="widthFix"></image> |
504 | </block> | 510 | </block> |
505 | 511 | ||
506 | <block wx:if="{{object.goodicon==3}}"> | 512 | <block wx:if="{{object.goodicon==3}}"> |
@@ -523,7 +529,7 @@ | @@ -523,7 +529,7 @@ | ||
523 | </view> | 529 | </view> |
524 | 530 | ||
525 | <view class='zs_center_x'> | 531 | <view class='zs_center_x'> |
526 | - <view class='zs_wz1_x' wx:if="{{object.goodstit}}">{{item.goods_name}}</view> | 532 | + <view class='zs_wz1_x ellipsis-2' wx:if="{{object.goodstit}}">{{item.goods_name}}</view> |
527 | <view class='zs_wz2_x' wx:if="{{object.goodsprice}}"> | 533 | <view class='zs_wz2_x' wx:if="{{object.goodsprice}}"> |
528 | 534 | ||
529 | <block wx:if="{{item.prom_price || item.prom_integral}}"> | 535 | <block wx:if="{{item.prom_price || item.prom_integral}}"> |
components/diy_goodsGroup/diy_goodsGroup.wxss
@@ -123,12 +123,15 @@ | @@ -123,12 +123,15 @@ | ||
123 | } | 123 | } |
124 | 124 | ||
125 | .zs_goods_xiao_bottom { | 125 | .zs_goods_xiao_bottom { |
126 | - width: 100%; | ||
127 | - min-height: 300rpx; | 126 | + /* width: 100%; */ |
127 | + /* min-height: 300rpx; */ | ||
128 | display: flex; | 128 | display: flex; |
129 | border-bottom: 2rpx #eee solid; | 129 | border-bottom: 2rpx #eee solid; |
130 | - padding: 10rpx; | 130 | + /* padding: 10rpx; */ |
131 | background-color: white; | 131 | background-color: white; |
132 | + padding: 20rpx; | ||
133 | + /* background-color: pink; */ | ||
134 | + box-sizing: border-box; | ||
132 | } | 135 | } |
133 | 136 | ||
134 | .zs_goods_xiao { | 137 | .zs_goods_xiao { |
@@ -141,17 +144,17 @@ | @@ -141,17 +144,17 @@ | ||
141 | } | 144 | } |
142 | 145 | ||
143 | .zs_top_x { | 146 | .zs_top_x { |
144 | - width: 400rpx; | ||
145 | - height: 318rpx; | ||
146 | - margin-top: 20rpx; | ||
147 | - display: flex; | 147 | + /* width: 400rpx; |
148 | + height: 318rpx; */ | ||
149 | + /* margin-top: 20rpx; */ | ||
150 | + /* display: flex; */ | ||
148 | position: relative; | 151 | position: relative; |
149 | } | 152 | } |
150 | 153 | ||
151 | .zs_t_img_x { | 154 | .zs_t_img_x { |
152 | width: 290rpx; | 155 | width: 290rpx; |
153 | height: 290rpx; | 156 | height: 290rpx; |
154 | - margin-left: 20rpx; | 157 | + /* margin-left: 20rpx; */ |
155 | } | 158 | } |
156 | 159 | ||
157 | .zs_t_img_x.zj{ border: 1rpx solid #eee;} | 160 | .zs_t_img_x.zj{ border: 1rpx solid #eee;} |
@@ -159,22 +162,24 @@ | @@ -159,22 +162,24 @@ | ||
159 | 162 | ||
160 | 163 | ||
161 | .zs_center_x { | 164 | .zs_center_x { |
162 | - width: 100%; | ||
163 | - min-height: 200rpx; | 165 | + /* width: 100%; |
166 | + min-height: 200rpx; */ | ||
164 | font-size: 28rpx; | 167 | font-size: 28rpx; |
165 | color: #333; | 168 | color: #333; |
166 | - text-align: left; | ||
167 | - margin-top: 30rpx; | ||
168 | - padding: 0 10rpx; | 169 | + padding-left: 20rpx; |
170 | + /* text-align: left; */ | ||
171 | + /* margin-top: 30rpx; | ||
172 | + padding: 0 10rpx; */ | ||
169 | } | 173 | } |
170 | 174 | ||
171 | .zs_wz1_x { | 175 | .zs_wz1_x { |
172 | - overflow: hidden; | ||
173 | - text-overflow: ellipsis; | 176 | + /* overflow: hidden; |
177 | + text-overflow: ellipsis; */ | ||
178 | + height: 90rpx; | ||
174 | margin-bottom: 10rpx; | 179 | margin-bottom: 10rpx; |
175 | font-size: 28rpx; | 180 | font-size: 28rpx; |
176 | - white-space: nowrap; | ||
177 | - width: 80%; | 181 | + /* white-space: nowrap; |
182 | + width: 80%; */ | ||
178 | } | 183 | } |
179 | 184 | ||
180 | .zs_wz2_x { | 185 | .zs_wz2_x { |
@@ -229,11 +234,12 @@ | @@ -229,11 +234,12 @@ | ||
229 | } | 234 | } |
230 | 235 | ||
231 | .zs_t1_x1 { | 236 | .zs_t1_x1 { |
237 | + position: absolute; | ||
232 | width: 56rpx; | 238 | width: 56rpx; |
233 | height: 56rpx; | 239 | height: 56rpx; |
234 | - position: relative; | ||
235 | - right: 285rpx; | ||
236 | - top: 6rpx; | 240 | + /* position: relative; */ |
241 | + left: 10rpx; | ||
242 | + top: 10rpx; | ||
237 | } | 243 | } |
238 | 244 | ||
239 | .zs_t1_x2 { | 245 | .zs_t1_x2 { |
@@ -302,16 +308,16 @@ | @@ -302,16 +308,16 @@ | ||
302 | font-size: 28rpx; | 308 | font-size: 28rpx; |
303 | color: #333; | 309 | color: #333; |
304 | text-align: left; | 310 | text-align: left; |
305 | - padding: 0 10rpx; | 311 | + /* padding: 0 10rpx; */ |
306 | } | 312 | } |
307 | 313 | ||
308 | .zs_wz1_2l { | 314 | .zs_wz1_2l { |
309 | - overflow: hidden; | ||
310 | - text-overflow: ellipsis; | 315 | + /* overflow: hidden; |
316 | + text-overflow: ellipsis; */ | ||
311 | font-size: 28rpx; | 317 | font-size: 28rpx; |
312 | - white-space: nowrap; | ||
313 | - height: 40rpx; | ||
314 | - line-height: 40rpx; | 318 | + /* white-space: nowrap; */ |
319 | + height: 90rpx; | ||
320 | + /* line-height: 40rpx; */ | ||
315 | margin-top: 10rpx; | 321 | margin-top: 10rpx; |
316 | } | 322 | } |
317 | 323 | ||
@@ -825,4 +831,16 @@ top: 10rpx; | @@ -825,4 +831,16 @@ top: 10rpx; | ||
825 | bottom: 10rpx; | 831 | bottom: 10rpx; |
826 | } | 832 | } |
827 | 833 | ||
828 | -.n_box{ position: absolute !important;z-index: 10} | ||
829 | \ No newline at end of file | 834 | \ No newline at end of file |
835 | +.n_box{ position: absolute !important;z-index: 10} | ||
836 | + | ||
837 | +.block { | ||
838 | + display: block; | ||
839 | +} | ||
840 | + | ||
841 | +.ellipsis-2 { | ||
842 | + overflow: hidden; | ||
843 | + text-overflow: ellipsis; | ||
844 | + display: -webkit-box; | ||
845 | + -webkit-box-orient: vertical; | ||
846 | + -webkit-line-clamp: 2; | ||
847 | +} | ||
830 | \ No newline at end of file | 848 | \ No newline at end of file |
components/diy_seckill/diy_seckill.wxml
@@ -62,7 +62,7 @@ | @@ -62,7 +62,7 @@ | ||
62 | </view> | 62 | </view> |
63 | 63 | ||
64 | <view class='sp_wz'> | 64 | <view class='sp_wz'> |
65 | - <view class='sp_wzi'>{{aitem.goods_name}}</view> | 65 | + <view class='sp_wzi ellipsis-2'>{{aitem.goods_name}}</view> |
66 | <view class='sp_jg'>¥{{aitem.price}}</view> | 66 | <view class='sp_jg'>¥{{aitem.price}}</view> |
67 | <view class='sp_jgx'>¥{{aitem.market_price}}</view> | 67 | <view class='sp_jgx'>¥{{aitem.market_price}}</view> |
68 | </view> | 68 | </view> |
@@ -85,7 +85,7 @@ | @@ -85,7 +85,7 @@ | ||
85 | </view> | 85 | </view> |
86 | 86 | ||
87 | <view class="o1_right"> | 87 | <view class="o1_right"> |
88 | - <view class="sp_wzi">{{aitem.title}}</view> | 88 | + <view class="sp_wzi ellipsis-2">{{aitem.title}}</view> |
89 | <view class="o1_sj_kill"> | 89 | <view class="o1_sj_kill"> |
90 | <text>{{aitem.djs.day}}</text> 天 | 90 | <text>{{aitem.djs.day}}</text> 天 |
91 | <text>{{aitem.djs.hou}}</text> : | 91 | <text>{{aitem.djs.hou}}</text> : |
components/diy_seckill/diy_seckill.wxss
@@ -112,13 +112,13 @@ swiper { | @@ -112,13 +112,13 @@ swiper { | ||
112 | font-size: 30rpx; | 112 | font-size: 30rpx; |
113 | border-bottom: 2rpx solid #dcdcdc; | 113 | border-bottom: 2rpx solid #dcdcdc; |
114 | width: 100%; | 114 | width: 100%; |
115 | - text-align: left; | 115 | + /* text-align: left; */ |
116 | padding: 4rpx 0; | 116 | padding: 4rpx 0; |
117 | - overflow: hidden; | ||
118 | - height: 48rpx; | ||
119 | - text-overflow: ellipsis; | 117 | + /* overflow: hidden; */ |
118 | + height: 90rpx; | ||
119 | + /* text-overflow: ellipsis; | ||
120 | white-space: nowrap; | 120 | white-space: nowrap; |
121 | - line-height: 48rpx; | 121 | + line-height: 48rpx; */ |
122 | } | 122 | } |
123 | 123 | ||
124 | .sp_wz .sp_jg { | 124 | .sp_wz .sp_jg { |
@@ -222,12 +222,12 @@ swiper { | @@ -222,12 +222,12 @@ swiper { | ||
222 | .o1_right .sp_wzi { | 222 | .o1_right .sp_wzi { |
223 | font-size: 30rpx; | 223 | font-size: 30rpx; |
224 | margin-bottom: 6rpx; | 224 | margin-bottom: 6rpx; |
225 | - text-align: left; | 225 | + /* text-align: left; */ |
226 | padding: 4rpx 0; | 226 | padding: 4rpx 0; |
227 | - height: 48rpx; | ||
228 | - overflow: hidden; | 227 | + height: 90rpx; |
228 | + /* overflow: hidden; | ||
229 | white-space: nowrap; | 229 | white-space: nowrap; |
230 | - text-overflow: ellipsis; | 230 | + text-overflow: ellipsis; */ |
231 | } | 231 | } |
232 | 232 | ||
233 | .o1_right .o1_sj_kill { | 233 | .o1_right .o1_sj_kill { |
@@ -287,4 +287,13 @@ swiper { | @@ -287,4 +287,13 @@ swiper { | ||
287 | align-items: center; | 287 | align-items: center; |
288 | } | 288 | } |
289 | 289 | ||
290 | -.sp .sp_top .s_top_kill.gray{background-color:#bdbdc1;color: #fff;font-weight: normal} | ||
291 | \ No newline at end of file | 290 | \ No newline at end of file |
291 | +.sp .sp_top .s_top_kill.gray{background-color:#bdbdc1;color: #fff;font-weight: normal} | ||
292 | + | ||
293 | + | ||
294 | +.ellipsis-2 { | ||
295 | + overflow: hidden; | ||
296 | + text-overflow: ellipsis; | ||
297 | + display: -webkit-box; | ||
298 | + -webkit-box-orient: vertical; | ||
299 | + -webkit-line-clamp: 2; | ||
300 | +} | ||
292 | \ No newline at end of file | 301 | \ No newline at end of file |
components/qr_code/qr_code.js
@@ -24,6 +24,7 @@ Component({ | @@ -24,6 +24,7 @@ Component({ | ||
24 | //关闭 | 24 | //关闭 |
25 | close: function (e) { | 25 | close: function (e) { |
26 | this.setData({q_show: 0,barcode_canvas:null,qrcode_canvas:null }); | 26 | this.setData({q_show: 0,barcode_canvas:null,qrcode_canvas:null }); |
27 | + this.triggerEvent('close',{},{bubbles: true}); | ||
27 | }, | 28 | }, |
28 | 29 | ||
29 | //打开 | 30 | //打开 |
packageC/pages/luckyGo/luckyGo_cart/luckyGo_cart.js
@@ -139,10 +139,7 @@ Page({ | @@ -139,10 +139,7 @@ Page({ | ||
139 | success: function (s) { | 139 | success: function (s) { |
140 | } | 140 | } |
141 | }); | 141 | }); |
142 | - | ||
143 | - // console.log('t=======================>', t); | ||
144 | - | ||
145 | - | 142 | + |
146 | 143 | ||
147 | }, | 144 | }, |
148 | onUnload: function () { | 145 | onUnload: function () { |
@@ -808,13 +805,12 @@ Page({ | @@ -808,13 +805,12 @@ Page({ | ||
808 | } | 805 | } |
809 | } | 806 | } |
810 | 807 | ||
811 | - | 808 | + |
812 | gd.prom_type=gg.prom_type; | 809 | gd.prom_type=gg.prom_type; |
813 | gd.prom_id=gg.prom_id; | 810 | gd.prom_id=gg.prom_id; |
814 | - | 811 | + |
815 | switch (gd.prom_type) { | 812 | switch (gd.prom_type) { |
816 | case 0: | 813 | case 0: |
817 | - case 2: | ||
818 | case 3: | 814 | case 3: |
819 | case 4: | 815 | case 4: |
820 | case 5: | 816 | case 5: |
@@ -987,6 +983,7 @@ Page({ | @@ -987,6 +983,7 @@ Page({ | ||
987 | //t.data.data.shop_price = tt.data.data.prom_price; | 983 | //t.data.data.shop_price = tt.data.data.prom_price; |
988 | t.data.data.shop_price = tt.data.data.prom_user_price; | 984 | t.data.data.shop_price = tt.data.data.prom_user_price; |
989 | th.data.ckeck_quan_price=0; | 985 | th.data.ckeck_quan_price=0; |
986 | + gd.is_xz_yh=1; | ||
990 | } else { | 987 | } else { |
991 | t.data.data.prom_id = 0; | 988 | t.data.data.prom_id = 0; |
992 | t.data.data.prom_type = 0; | 989 | t.data.data.prom_type = 0; |
@@ -1013,6 +1010,45 @@ Page({ | @@ -1013,6 +1010,45 @@ Page({ | ||
1013 | }); | 1010 | }); |
1014 | 1011 | ||
1015 | break; | 1012 | break; |
1013 | + | ||
1014 | + case 2: //--- 团购 --- | ||
1015 | + var quanlist = null; | ||
1016 | + getApp().request.get("/api/weshop/goods/groupBuy/getActInfo/" +os.stoid + "/" +gd.goods_id+"/"+ gd.prom_id, { | ||
1017 | + success: async function (tt) { | ||
1018 | + if (tt.data.code == 0) { | ||
1019 | + //t.data.data.shop_price = tt.data.data.prom_price; | ||
1020 | + t.data.data.shop_price = tt.data.data.price; | ||
1021 | + } else { | ||
1022 | + t.data.data.prom_id = 0; | ||
1023 | + t.data.data.prom_type = 0; | ||
1024 | + } | ||
1025 | + | ||
1026 | + if(tt.data.data.isQuan){ | ||
1027 | + th.data.ckeck_quan_price = t.data.data.shop_price * gg.goods_num; | ||
1028 | + th.data.check_quan_price_list = t.data.data.shop_price * gg.goods_num + ""; | ||
1029 | + th.data.check_quan_ware_list = t.data.data.erpwareid + ""; | ||
1030 | + }else{ | ||
1031 | + gd.is_xz_yh=1; | ||
1032 | + } | ||
1033 | + | ||
1034 | + th.setData({ | ||
1035 | + bn_goods: gd, | ||
1036 | + bn_pickname: gg.pick_name, | ||
1037 | + bn_exp_type: et, | ||
1038 | + index: m_wind, | ||
1039 | + bn_pick: gg.pick_id, | ||
1040 | + bn_t_exp_t: distr_t, | ||
1041 | + bn_exp_type: et | ||
1042 | + }); | ||
1043 | + | ||
1044 | + //-- 计算价格 -- | ||
1045 | + th.calculatePrice2(); | ||
1046 | + //获取优惠券,如果有券的钱,就调用 | ||
1047 | + if(th.data.ckeck_quan_price>0) th.get_buy_now_quan(); | ||
1048 | + } | ||
1049 | + }); | ||
1050 | + | ||
1051 | + break; | ||
1016 | } | 1052 | } |
1017 | }, | 1053 | }, |
1018 | }); | 1054 | }); |
@@ -1389,7 +1425,7 @@ Page({ | @@ -1389,7 +1425,7 @@ Page({ | ||
1389 | } | 1425 | } |
1390 | 1426 | ||
1391 | //--如果是物流,且选择了地址,就要开始显示包邮券,且包邮券也已经优惠了优惠活动的金额-- | 1427 | //--如果是物流,且选择了地址,就要开始显示包邮券,且包邮券也已经优惠了优惠活动的金额-- |
1392 | - if (cart_item.exp_type == 0 && th.data.user_addr != null) { | 1428 | + if (cart_item.exp_type == 0 && th.data.user_addr != null && !cart_item.is_xz_yh) { |
1393 | //看是不是有调用过包邮券 | 1429 | //看是不是有调用过包邮券 |
1394 | if (!th.data.isget_by_quan[pickid]) { | 1430 | if (!th.data.isget_by_quan[pickid]) { |
1395 | //--判断要不要显示包邮券,调用接口,因为有for循环--- | 1431 | //--判断要不要显示包邮券,调用接口,因为有for循环--- |
@@ -1397,7 +1433,8 @@ Page({ | @@ -1397,7 +1433,8 @@ Page({ | ||
1397 | data: { | 1433 | data: { |
1398 | store_id: os.stoid, | 1434 | store_id: os.stoid, |
1399 | isuse: 0, | 1435 | isuse: 0, |
1400 | - condition: q_conditin, | 1436 | + //condition: q_conditin, |
1437 | + condition:cart_item.ckeck_quan_price, | ||
1401 | user_id: getApp().globalData.user_id, | 1438 | user_id: getApp().globalData.user_id, |
1402 | pageSize: 2000 | 1439 | pageSize: 2000 |
1403 | } | 1440 | } |
@@ -1422,10 +1459,10 @@ Page({ | @@ -1422,10 +1459,10 @@ Page({ | ||
1422 | } | 1459 | } |
1423 | if (arr) { | 1460 | if (arr) { |
1424 | th.data.get_by_quan_list_cart[pickid] = arr; | 1461 | th.data.get_by_quan_list_cart[pickid] = arr; |
1425 | - //th.setData({get_by_quan_list_cart:th.data.get_by_quan_list_cart}); | ||
1426 | - if (th.data.is_b_now) { | ||
1427 | - th.setData({get_by_quan_list: arr}); | ||
1428 | - } | 1462 | + th.setData({get_by_quan_list_cart:th.data.get_by_quan_list_cart}); |
1463 | + //if (th.data.is_b_now) { | ||
1464 | + // th.setData({get_by_quan_list: arr}); | ||
1465 | + //} | ||
1429 | } | 1466 | } |
1430 | th.data.isget_by_quan[pickid] = 1; | 1467 | th.data.isget_by_quan[pickid] = 1; |
1431 | } | 1468 | } |
@@ -2030,29 +2067,9 @@ Page({ | @@ -2030,29 +2067,9 @@ Page({ | ||
2030 | }); | 2067 | }); |
2031 | }); | 2068 | }); |
2032 | }, | 2069 | }, |
2033 | - | ||
2034 | - | ||
2035 | - submitConfirm(e) { | ||
2036 | - var th = this; | ||
2037 | - wx.showModal({ | ||
2038 | - title: '温馨提示', | ||
2039 | - content: this.data.param.alert, | ||
2040 | - success (res) { | ||
2041 | - if (res.confirm) { | ||
2042 | - console.log('用户点击确定'); | ||
2043 | - th.submitForm(e); | ||
2044 | - } else if (res.cancel) { | ||
2045 | - console.log('用户点击取消') | ||
2046 | - } | ||
2047 | - } | ||
2048 | - }) | ||
2049 | - }, | ||
2050 | 2070 | ||
2051 | //--------------------提交订单----------------------- | 2071 | //--------------------提交订单----------------------- |
2052 | - async submitForm(t) { | ||
2053 | - | ||
2054 | - | ||
2055 | - | 2072 | + async submitForm(t){ |
2056 | var sub_value = t; | 2073 | var sub_value = t; |
2057 | 2074 | ||
2058 | if (this.data.is_summit_ing == 1) return false; //--提交中退出-- | 2075 | if (this.data.is_summit_ing == 1) return false; //--提交中退出-- |
@@ -2178,10 +2195,8 @@ Page({ | @@ -2178,10 +2195,8 @@ Page({ | ||
2178 | 'goods_price': th.data.bn_goods.shop_price, | 2195 | 'goods_price': th.data.bn_goods.shop_price, |
2179 | 'member_goods_price': th.data.bn_goods.shop_price, | 2196 | 'member_goods_price': th.data.bn_goods.shop_price, |
2180 | 'store_id': oo.stoid, | 2197 | 'store_id': oo.stoid, |
2181 | - //'prom_type': th.data.bn_goods.prom_type, //促销活动类型 | ||
2182 | - 'prom_type': 9, //促销活动类型 | ||
2183 | - 'prom_id': th.data.param.group_id, //促销活动id | ||
2184 | - // 'prom_id': 118, | 2198 | + 'prom_type': th.data.bn_goods.prom_type, //促销活动类型 |
2199 | + 'prom_id': th.data.bn_goods.prom_id, //促销活动id | ||
2185 | }; | 2200 | }; |
2186 | 2201 | ||
2187 | //-- 把导购的信息填入-- | 2202 | //-- 把导购的信息填入-- |
@@ -2445,6 +2460,7 @@ Page({ | @@ -2445,6 +2460,7 @@ Page({ | ||
2445 | //--判断活动的类型-- | 2460 | //--判断活动的类型-- |
2446 | switch (g_item.prom_type) { | 2461 | switch (g_item.prom_type) { |
2447 | case 1: | 2462 | case 1: |
2463 | + case 2: | ||
2448 | goods.prom_type = g_item.prom_type; | 2464 | goods.prom_type = g_item.prom_type; |
2449 | goods.prom_id = g_item.prom_id; | 2465 | goods.prom_id = g_item.prom_id; |
2450 | break; | 2466 | break; |
@@ -2583,42 +2599,19 @@ Page({ | @@ -2583,42 +2599,19 @@ Page({ | ||
2583 | var dd = { | 2599 | var dd = { |
2584 | parent_sn: data.data, | 2600 | parent_sn: data.data, |
2585 | store_id: oo.stoid, | 2601 | store_id: oo.stoid, |
2586 | - type: 1, | 2602 | + type: 2, |
2587 | }; | 2603 | }; |
2588 | - wx.showLoading({ | ||
2589 | - title: '支付中', | ||
2590 | - mask: true, | ||
2591 | - }); | ||
2592 | a.post("/api/weshop/order/pay/createOrder", { | 2604 | a.post("/api/weshop/order/pay/createOrder", { |
2593 | data: dd, | 2605 | data: dd, |
2594 | - isShowLoading: false, | ||
2595 | success: function (t) { | 2606 | success: function (t) { |
2596 | //console.log(t); | 2607 | //console.log(t); |
2597 | - wx.hideLoading(); | ||
2598 | if (t.data.code == 0) { | 2608 | if (t.data.code == 0) { |
2599 | //app.my_warnning("支付成功",1,th); | 2609 | //app.my_warnning("支付成功",1,th); |
2600 | //setTimeout(function () { | 2610 | //setTimeout(function () { |
2601 | th.setData({isclose: 0}); | 2611 | th.setData({isclose: 0}); |
2602 | - | ||
2603 | - wx.showToast({ | ||
2604 | - title: '支付成功', | ||
2605 | - icon: 'success', | ||
2606 | - duration: 2000, | ||
2607 | - success: function() { | ||
2608 | - // 幸运购 | ||
2609 | - setTimeout(function() { | ||
2610 | - wx.redirectTo({ | ||
2611 | - url: "/packageC/pages/luckyGo/luckyGo_details/luckyGo_details?type=1&ordersn=" + data.data + "&group_id=" + th.data.param.group_id + "&goods_id=" + th.data.param.goods_id + "&goods_name=" + th.data.bn_goods.goods_name, | ||
2612 | - }); | ||
2613 | - }, 0); | ||
2614 | - | ||
2615 | - }, | ||
2616 | - }) | ||
2617 | - | ||
2618 | - // wx.redirectTo({ | ||
2619 | - // url: "/pages/payment/pay_success/pay_success?type=1&order_sn=" + data.data, | ||
2620 | - // }) | ||
2621 | - | 2612 | + wx.redirectTo({ |
2613 | + url: "/pages/payment/pay_success/pay_success?type=2&order_sn=" + data.data, | ||
2614 | + }) | ||
2622 | //}, 1000) | 2615 | //}, 1000) |
2623 | } | 2616 | } |
2624 | }, | 2617 | }, |
@@ -3441,6 +3434,19 @@ Page({ | @@ -3441,6 +3434,19 @@ Page({ | ||
3441 | if (gd.prom_type == 1 || gd.is_gift || gd.prom_type == 7) { | 3434 | if (gd.prom_type == 1 || gd.is_gift || gd.prom_type == 7) { |
3442 | continue; | 3435 | continue; |
3443 | } | 3436 | } |
3437 | + | ||
3438 | + //--如果是团购,要判断有没有限制使用优惠券 | ||
3439 | + if(gd.prom_type == 2){ | ||
3440 | + var prom1=null; | ||
3441 | + await getApp().request.promiseGet("/api/weshop/goods/groupBuy/getActInfo/" + os.stoid + "/" + gd.goods_id + "/" + gd.prom_id, { | ||
3442 | + }).then(res => { | ||
3443 | + if (res.data.code == 0) prom1 = res.data.data; | ||
3444 | + }) | ||
3445 | + if(!prom1.isQuan){ | ||
3446 | + continue; | ||
3447 | + } | ||
3448 | + } | ||
3449 | + | ||
3444 | //如果有限制使用优惠券,就要返回 | 3450 | //如果有限制使用优惠券,就要返回 |
3445 | if (gd.prom_type == 3) { | 3451 | if (gd.prom_type == 3) { |
3446 | if (th.data.prom_goods_map[pickup_id][gd.prom_id].is_xz_yh) continue; | 3452 | if (th.data.prom_goods_map[pickup_id][gd.prom_id].is_xz_yh) continue; |
@@ -3479,6 +3485,7 @@ Page({ | @@ -3479,6 +3485,7 @@ Page({ | ||
3479 | arr[ind].ckeck_quan_price = ckeck_quan_price - cut_price; | 3485 | arr[ind].ckeck_quan_price = ckeck_quan_price - cut_price; |
3480 | arr[ind].check_quan_ware_list = check_quan_ware_list; | 3486 | arr[ind].check_quan_ware_list = check_quan_ware_list; |
3481 | arr[ind].check_quan_price_list = check_quan_price_list; | 3487 | arr[ind].check_quan_price_list = check_quan_price_list; |
3488 | + arr[ind].is_xz_yh = is_xz_yh; | ||
3482 | 3489 | ||
3483 | //是否关闭使用优惠券 | 3490 | //是否关闭使用优惠券 |
3484 | if (th.data.is_close_quan != 1 && !is_xz_yh) { | 3491 | if (th.data.is_close_quan != 1 && !is_xz_yh) { |
@@ -3488,7 +3495,7 @@ Page({ | @@ -3488,7 +3495,7 @@ Page({ | ||
3488 | data: { | 3495 | data: { |
3489 | storeId: oo.stoid, | 3496 | storeId: oo.stoid, |
3490 | userId: app.globalData.user_id, | 3497 | userId: app.globalData.user_id, |
3491 | - BuySum: ckeck_quan_price, | 3498 | + BuySum: arr[ind].ckeck_quan_price, |
3492 | WareIds: check_quan_ware_list, | 3499 | WareIds: check_quan_ware_list, |
3493 | pageSize: 100 | 3500 | pageSize: 100 |
3494 | } | 3501 | } |
@@ -3843,7 +3850,6 @@ Page({ | @@ -3843,7 +3850,6 @@ Page({ | ||
3843 | } | 3850 | } |
3844 | }, | 3851 | }, |
3845 | 3852 | ||
3846 | - | ||
3847 | //取消使用线下取价 | 3853 | //取消使用线下取价 |
3848 | cancle_offline: function () { | 3854 | cancle_offline: function () { |
3849 | //判断是不是立即购买 | 3855 | //判断是不是立即购买 |
packageC/pages/luckyGo/luckyGo_cart/luckyGo_cart.json
packageC/pages/luckyGo/luckyGo_cart/luckyGo_cart.wxml
@@ -2,7 +2,7 @@ | @@ -2,7 +2,7 @@ | ||
2 | <wxs src="filter.wxs" module="util"></wxs> | 2 | <wxs src="filter.wxs" module="util"></wxs> |
3 | <wxs module="filters" src="../../../../utils/filter.wxs"></wxs> | 3 | <wxs module="filters" src="../../../../utils/filter.wxs"></wxs> |
4 | 4 | ||
5 | -<form bindsubmit="submitConfirm"> | 5 | +<form bindsubmit="submitForm"> |
6 | <view class="container"> | 6 | <view class="container"> |
7 | 7 | ||
8 | <!-- 立即购买的时候 --> | 8 | <!-- 立即购买的时候 --> |
@@ -268,6 +268,7 @@ | @@ -268,6 +268,7 @@ | ||
268 | </view> | 268 | </view> |
269 | 269 | ||
270 | <!-- ---商品名称规格---- --> | 270 | <!-- ---商品名称规格---- --> |
271 | + <!-- 幸运购 --> | ||
271 | <view class="order-num flex-space-between"> | 272 | <view class="order-num flex-space-between"> |
272 | <view class="co-red">¥<text class="fs36">{{filters.toFix(bn_goods.shop_price,2)}}</text></view> | 273 | <view class="co-red">¥<text class="fs36">{{filters.toFix(bn_goods.shop_price,2)}}</text></view> |
273 | <view class="goods-num">x{{bn_goods.buynum}}</view> | 274 | <view class="goods-num">x{{bn_goods.buynum}}</view> |
@@ -426,6 +427,7 @@ | @@ -426,6 +427,7 @@ | ||
426 | <view>优惠活动</view> | 427 | <view>优惠活动</view> |
427 | <view class="co-red">- ¥ {{filters.toFix(formData.cut_price,2)}}元</view> | 428 | <view class="co-red">- ¥ {{filters.toFix(formData.cut_price,2)}}元</view> |
428 | </view> | 429 | </view> |
430 | + | ||
429 | <!-- 组合购优惠金额 --> | 431 | <!-- 组合购优惠金额 --> |
430 | <view class="item" wx:if="{{formData.zh_cut_price>0 || formData.zh_cut_price<0}}"> | 432 | <view class="item" wx:if="{{formData.zh_cut_price>0 || formData.zh_cut_price<0}}"> |
431 | <view>组合购优惠</view> | 433 | <view>组合购优惠</view> |
packageC/pages/luckyGo/luckyGo_cart_ct/luckyGo_cart_ct.js
0 → 100644
1 | +var t = getApp(), | ||
2 | + app = t, | ||
3 | + a = t.request, | ||
4 | + e = require("../../../../utils/common.js"), | ||
5 | + s = require("../../../../utils/util.js"), | ||
6 | + o = require("../../../../utils/md5.js"), | ||
7 | + to = getApp(); | ||
8 | +var oo = t.globalData.setting, | ||
9 | + os = oo; | ||
10 | +var regeneratorRuntime = require('../../../../utils/runtime.js'); | ||
11 | +var util_pay = require("../../../../utils/pay.js"); | ||
12 | +let self = null; | ||
13 | + | ||
14 | +Page({ | ||
15 | + data: { | ||
16 | + prom_type: 9, | ||
17 | + | ||
18 | + url: t.globalData.setting.url, | ||
19 | + resourceUrl: t.globalData.setting.resourceUrl, | ||
20 | + imgUrl: t.globalData.setting.imghost, | ||
21 | + goods: null, | ||
22 | + order: null, | ||
23 | + orderPrices: null, | ||
24 | + coupons: null, | ||
25 | + coupon: null, | ||
26 | + invoiceToggle: !0, | ||
27 | + payWithUserMoney: !0, | ||
28 | + payWithPoints: !0, | ||
29 | + maxWord: 0, | ||
30 | + enterAddressPage: !1, | ||
31 | + firstEnter: !0, | ||
32 | + //页面获取的参数 | ||
33 | + param: null, | ||
34 | + postdata: null, | ||
35 | + //提交订单的格式 | ||
36 | + formData: { | ||
37 | + order_amount: 0, //支付金额 | ||
38 | + total_amount: 0, //总价 | ||
39 | + all_price: 0, //商品卖的总价 | ||
40 | + pay_points: 0, //使用积分 | ||
41 | + user_money: 0, //使用余额 | ||
42 | + couponCode: "", //使用优惠券(多单就用逗号隔开) | ||
43 | + shipping_price: 0, //物流费用 | ||
44 | + }, | ||
45 | + | ||
46 | + /*----------------立即购买---------------------*/ | ||
47 | + is_b_now: 0, //0是购物车结算 1立即购买 | ||
48 | + bn_goods: null, //立即购买时候的调用商品 | ||
49 | + bn_use_money: 0, //是否使用余额 | ||
50 | + bn_exp_type: 1, //0是物流 1自提 | ||
51 | + bn_pick: 0, //选择的门店 | ||
52 | + bn_pickname: "", //选择的门店名称 | ||
53 | + bn_t_exp_t: 0, //判断商品和门店一起决定的物流自提的方式0 都可以 1自提 2物流 | ||
54 | + /*------------------------*/ | ||
55 | + user_addr: null, //物流 | ||
56 | + userinfo: null, //获取会员 | ||
57 | + /*----------物流选择--------*/ | ||
58 | + wu_arr: null, | ||
59 | + index: 0, | ||
60 | + | ||
61 | + //判断页面是返回回来的还是 首次进入的 | ||
62 | + isclose: 1, | ||
63 | + kt_type: 0, //开团类型 | ||
64 | + is_pt_tz: 0, //是否开团团长 | ||
65 | + qh: '', //期号 | ||
66 | + pt_listno: '', //期号 | ||
67 | + is_normal: 0, | ||
68 | + is_express: 0, //选择物流的控制器 | ||
69 | + yuer: 0, | ||
70 | + | ||
71 | + rank_switch: 0, //是不是开同等级卡 | ||
72 | + show_card: null, //显示的等级卡 | ||
73 | + card_name: '', //显示的卡的名称 | ||
74 | + card_cut_price: null, //减价多少钱 | ||
75 | + }, | ||
76 | + | ||
77 | + onLoad: function(t) { | ||
78 | + self = this; | ||
79 | + this.setData({ | ||
80 | + is_b_now: t.is_bnow == undefined ? 0 : t.is_bnow, | ||
81 | + param: t, | ||
82 | + }); | ||
83 | + | ||
84 | + var appD = getApp().get_b_now(); | ||
85 | + | ||
86 | + this.data.postdata = appD; | ||
87 | + | ||
88 | + //如果期号有值01 | ||
89 | + // if (appD.qh) { | ||
90 | + // th.data.qh = appD.qh; | ||
91 | + // th.data.pt_listno = appD.qh; | ||
92 | + // } | ||
93 | + | ||
94 | + | ||
95 | + | ||
96 | + this.setData({//01 | ||
97 | + // kt_type: appD.kt_type | ||
98 | + }); | ||
99 | + | ||
100 | + // 01 | ||
101 | + // if (appD.is_pt_tz) th.data.is_pt_tz = appD.is_pt_tz; | ||
102 | + | ||
103 | + | ||
104 | + //先获取物流,再获取用户信息,再展示页面 | ||
105 | + //th.get_wuliu(th.get_info(th.show_page)); | ||
106 | + }, | ||
107 | + | ||
108 | + onUnload: function() { | ||
109 | + this.setData({ | ||
110 | + isclose: 1 | ||
111 | + }) | ||
112 | + }, | ||
113 | + | ||
114 | + //------获取会员信息-----先获取用户信息,在进行下一步--- | ||
115 | + get_info: function(func) { | ||
116 | + var user_id = t.globalData.user_id; | ||
117 | + to.auth.get_u(func); | ||
118 | + }, | ||
119 | + | ||
120 | + //-------------------获取物流--------------- | ||
121 | + get_wuliu(func) { | ||
122 | + var th = this; | ||
123 | + // console.log("getwuliu4545"); | ||
124 | + to.getwuliu(function(e) { | ||
125 | + if (th.data.is_default_logistics) { | ||
126 | + //如果第一个不是开启默认,说明要让用户自己选 | ||
127 | + if (!e[0].is_default) { | ||
128 | + th.setData({ | ||
129 | + is_default_logistics: 0 | ||
130 | + }); | ||
131 | + } | ||
132 | + } | ||
133 | + th.setData({ | ||
134 | + wu_arr: e | ||
135 | + }) | ||
136 | + typeof func == "function" && func(); | ||
137 | + }) | ||
138 | + }, | ||
139 | + | ||
140 | + //------获取会员收货地址----- | ||
141 | + getuser_addr: function(func) { | ||
142 | + if (to.globalData.baddr != null) { | ||
143 | + var user_addr = to.globalData.baddr; | ||
144 | + to.globalData.baddr = null; | ||
145 | + func(user_addr); | ||
146 | + } else { | ||
147 | + a.get("/api/weshop/useraddress/page", { | ||
148 | + data: { | ||
149 | + user_id: to.globalData.user_id, | ||
150 | + store_id: oo.stoid, | ||
151 | + pageSize: 600 | ||
152 | + }, | ||
153 | + success: function(su) { | ||
154 | + | ||
155 | + var user_addr = su.data.data.pageData; | ||
156 | + var item = null; | ||
157 | + var def_item = null; | ||
158 | + for (var i = 0; i < user_addr.length; i++) { | ||
159 | + if (user_addr[i]['is_default'] == 1) { | ||
160 | + def_item = user_addr[i]; | ||
161 | + } | ||
162 | + if (user_addr[i]['is_pickup'] == 1) { | ||
163 | + item = user_addr[i]; | ||
164 | + } | ||
165 | + } | ||
166 | + if (item == null) item = def_item; | ||
167 | + if (item == null) item = user_addr[0]; | ||
168 | + if (item == undefined) item = null; | ||
169 | + func(item); | ||
170 | + } | ||
171 | + }); | ||
172 | + } | ||
173 | + }, | ||
174 | + //----------------展示页面,是再获取用户信息之后-------------- | ||
175 | + show_page: function() { | ||
176 | + var th = this; | ||
177 | + //th.setData({ userinfo: to.globalData.userInfo}); 会员信息要时时获取 | ||
178 | + var user = getApp().globalData.userInfo; | ||
179 | + getApp().request.get("/api/weshop/users/get/" + oo.stoid + "/" + user.user_id, { | ||
180 | + data: { | ||
181 | + r: Math.random() | ||
182 | + }, | ||
183 | + success: function(e) { | ||
184 | + | ||
185 | + getApp().globalData.userInfo = e.data.data; | ||
186 | + th.setData({ | ||
187 | + userinfo: e.data.data | ||
188 | + }); | ||
189 | + //获取立即购买的商品信息 | ||
190 | + th.get_buy_goods(); | ||
191 | + | ||
192 | + //获取提现金额 | ||
193 | + getApp().request.get("/api/weshop/withdrawals/summoney", { | ||
194 | + data: { | ||
195 | + user_id: to.globalData.user_id, | ||
196 | + store_id: oo.stoid, | ||
197 | + status: 0 | ||
198 | + }, | ||
199 | + success: function(su) { | ||
200 | + if (su.data.code == 0) { | ||
201 | + var yuer = parseFloat(th.data.userinfo.user_money - | ||
202 | + (th.data.userinfo.frozen_money > 0 ? th.data.userinfo.frozen_money : 0) - su.data.data.summoney).toFixed( | ||
203 | + 2); | ||
204 | + if (yuer < 0) yuer = 0; | ||
205 | + th.setData({ | ||
206 | + txmon: su.data.data.summoney, | ||
207 | + yuer: yuer | ||
208 | + }); | ||
209 | + } | ||
210 | + } | ||
211 | + }); | ||
212 | + } | ||
213 | + }); | ||
214 | + }, | ||
215 | + | ||
216 | + //-----获取立即购买的商品信息---- | ||
217 | + get_buy_goods: function() { | ||
218 | + var th = this, | ||
219 | + a = getApp().request; | ||
220 | + var gg = th.data.postdata; | ||
221 | + //调用商品 | ||
222 | + a.get("/api/weshop/goods/get/" + oo.stoid + "/" + gg.goods_id, { | ||
223 | + success: function(t) { | ||
224 | + var gd = t.data.data; | ||
225 | + if (!gd) return false; | ||
226 | + | ||
227 | + t.data.data.original_img = oo.imghost + t.data.data.original_img; | ||
228 | + t.data.data['buynum'] = gg.goods_num; | ||
229 | + // console.log(t.data.data); | ||
230 | + var distr_t = 0, | ||
231 | + et = 0 | ||
232 | + if (t.data.data.distr_type == 0) { | ||
233 | + distr_t = gg.pick_dis; | ||
234 | + } else { | ||
235 | + //distr_type配送方式 0=用户自选 1=自提 2=物流 | ||
236 | + distr_t = t.data.data.distr_type; | ||
237 | + } | ||
238 | + switch (distr_t) { | ||
239 | + case 0: | ||
240 | + et = 1; | ||
241 | + //-- 系统后台有设置要默认的 -- | ||
242 | + if (th.data.json_d.pickupway && th.data.json_d.pickupway == 1) et = 0; | ||
243 | + break; | ||
244 | + case 1: | ||
245 | + et = 1; | ||
246 | + break; | ||
247 | + case 2: | ||
248 | + et = 0; | ||
249 | + break; | ||
250 | + } | ||
251 | + | ||
252 | + t.data.data.shop_price = gg.goods_price; | ||
253 | + //--如果是普通购买的时候-- | ||
254 | + if (gg.is_normal == 1) { | ||
255 | + t.data.data.prom_id = 0; | ||
256 | + t.data.data.prom_type = 0; | ||
257 | + t.data.data.is_normal = 0; | ||
258 | + | ||
259 | + var gd = t.data.data; | ||
260 | + //-- 用商品的手店价来显示 -- | ||
261 | + gg.goods_price = gd.shop_price; | ||
262 | + //---是不是购买等级卡成功的返回---等级卡显示的判断--- | ||
263 | + var is_card_back = getApp().globalData.is_card_back; | ||
264 | + if (is_card_back) { | ||
265 | + gg.goods_price = gd[th.data.card_name]; | ||
266 | + t.data.data.shop_price = gg.goods_price; | ||
267 | + getApp().globalData.is_card_back = 0; | ||
268 | + th.setData({ | ||
269 | + card_cut_price: 0 | ||
270 | + }); | ||
271 | + } else { | ||
272 | + //--- 商品不能是搭配购,商家等级卡开通的情况下, 会员不是等级会员的情况, 商品有设置等级卡价格,同时等级卡价格小于商品的价格 | ||
273 | + if (th.data.card_name && gd[th.data.card_name] > 0 && gg.goods_price > gd[th.data.card_name] && !th.data.userinfo | ||
274 | + .card_field) { | ||
275 | + var cut_p = gg.goods_price - gd[th.data.card_name]; | ||
276 | + th.setData({ | ||
277 | + card_cut_price: cut_p | ||
278 | + }); | ||
279 | + } | ||
280 | + } | ||
281 | + | ||
282 | + if (th.data.bn_goods) { | ||
283 | + et = th.data.bn_exp_type; | ||
284 | + } | ||
285 | + | ||
286 | + | ||
287 | + th.setData({ | ||
288 | + bn_goods: t.data.data, | ||
289 | + bn_pickname: gg.pick_name, | ||
290 | + bn_pick: gg.pick_id, | ||
291 | + bn_t_exp_t: distr_t, | ||
292 | + is_normal: 1, | ||
293 | + bn_exp_type: et | ||
294 | + }); | ||
295 | + | ||
296 | + | ||
297 | + | ||
298 | + th.calculatePrice2(); | ||
299 | + } | ||
300 | + | ||
301 | + else { //01 | ||
302 | + | ||
303 | + //--阶梯团很特殊,不能用总表来拿价格-- | ||
304 | + getApp().request.get("/api/weshop/teamlist/get/" + oo.stoid + "/" + gd.prom_id, { | ||
305 | + success: function(tt) { | ||
306 | + | ||
307 | + if (tt.data.code == 0) { | ||
308 | + var pt_data = tt.data.data; | ||
309 | + var now = s.gettimestamp(); | ||
310 | + | ||
311 | + if (pt_data.is_end == 1) { | ||
312 | + t.data.data.prom_id = 0; | ||
313 | + t.data.data.prom_type = 0; | ||
314 | + // t.data.data.is_normal=1; | ||
315 | + } else if (now > pt_data.end_time) { | ||
316 | + t.data.data.prom_id = 0; | ||
317 | + t.data.data.prom_type = 0; | ||
318 | + // t.data.data.is_normal=1; | ||
319 | + } else { | ||
320 | + t.data.data.shop_price = tt.data.data.price; //活动价格 | ||
321 | + t.data.data.is_normal = 0; | ||
322 | + if (pt_data.kttype == 3) { | ||
323 | + t.data.data.shop_price = tt.data.data.yf_price; //用定金来购买 | ||
324 | + } | ||
325 | + } | ||
326 | + } else { | ||
327 | + t.data.data.prom_id = 0; | ||
328 | + t.data.data.prom_type = 0; | ||
329 | + // t.data.data.is_normal=1; | ||
330 | + } | ||
331 | + | ||
332 | + if (th.data.bn_goods) { | ||
333 | + et = th.data.bn_exp_type; | ||
334 | + } | ||
335 | + | ||
336 | + th.setData({ | ||
337 | + bn_goods: t.data.data, | ||
338 | + bn_pickname: gg.pick_name, | ||
339 | + bn_pick: gg.pick_id, | ||
340 | + bn_t_exp_t: distr_t, | ||
341 | + bn_exp_type: et | ||
342 | + }); | ||
343 | + | ||
344 | + | ||
345 | + //计算价格 | ||
346 | + th.calculatePrice2(); | ||
347 | + } | ||
348 | + }); | ||
349 | + } | ||
350 | + | ||
351 | + } | ||
352 | + }); | ||
353 | + }, | ||
354 | + | ||
355 | + //----------子页返回父页触发---------- | ||
356 | + onShow: function() { | ||
357 | + var th = this; | ||
358 | + | ||
359 | + if (th.data.isclose == 0) { | ||
360 | + wx.navigateTo({ | ||
361 | + url: "/pages/index/index/index" | ||
362 | + }) | ||
363 | + } else { | ||
364 | + this.getuser_addr(function(ie) { | ||
365 | + //更换地址回来要重新调用计算价钱的接口 | ||
366 | + th.setData({ | ||
367 | + user_addr: ie | ||
368 | + }); | ||
369 | + if (!th.data.user_addr || th.data.user_addr.address_id != ie.address_id) { | ||
370 | + th.setData({ | ||
371 | + add_back: 1 | ||
372 | + }); | ||
373 | + if (this.data.bn_goods) th.calculatePrice2(); | ||
374 | + } | ||
375 | + }) | ||
376 | + //--更新默认地址--,看一下是不是跳到地址页面 | ||
377 | + if (!getApp().globalData.is_cart_old) { | ||
378 | + this.update_code(); | ||
379 | + } else { | ||
380 | + getApp().globalData.is_cart_old = 0; | ||
381 | + } | ||
382 | + } | ||
383 | + | ||
384 | + | ||
385 | + //先获取是否有关闭使用优惠券 | ||
386 | + getApp().getConfig2(function(ee) { | ||
387 | + var json_d = JSON.parse(ee.switch_list); | ||
388 | + th.data.json_d = json_d; | ||
389 | + th.data.ispt_goods = json_d.ispt_goods; //是不是平摊到单品的控制参数赋值 | ||
390 | + var is_default_logistics = json_d.is_default_logistics; | ||
391 | + | ||
392 | + th.setData({ | ||
393 | + is_close_quan: json_d.is_close_quan, | ||
394 | + sales_rules: ee.sales_rules, | ||
395 | + rank_switch: json_d.rank_switch, | ||
396 | + is_default_logistics: is_default_logistics | ||
397 | + }); | ||
398 | + | ||
399 | + var rank_switch = json_d.rank_switch; | ||
400 | + var max_price = -1; | ||
401 | + var show_card = null; | ||
402 | + var name = ""; | ||
403 | + //如果有开等级卡的时候, | ||
404 | + //因为都是调接口,要返回在计算 | ||
405 | + if (rank_switch == 2) { | ||
406 | + //-- 获取所有的等级卡, -- | ||
407 | + getApp().request.promiseGet("/api/weshop/plus/vip/mem/bership/list?storeId=" + os.stoid, {}).then(res => { | ||
408 | + if (res.data.code == 0) { | ||
409 | + var plusCard = res.data.data; | ||
410 | + //-- 循环判断,拿到最贵的那张卡 -- | ||
411 | + for (var ih in plusCard) { | ||
412 | + if (plusCard[ih].IsStopBuy == true) { | ||
413 | + continue; | ||
414 | + } | ||
415 | + if (max_price < 0) { | ||
416 | + max_price = plusCard[ih].CardFee; | ||
417 | + name = 'card' + plusCard[ih]['CorrPrice']; | ||
418 | + show_card = plusCard[ih]; | ||
419 | + } else { | ||
420 | + if (max_price < plusCard[ih].CardFee) { | ||
421 | + max_price = plusCard[ih].CardFee; | ||
422 | + name = 'card' + plusCard[ih]['CorrPrice']; | ||
423 | + show_card = plusCard[ih]; | ||
424 | + } | ||
425 | + } | ||
426 | + } | ||
427 | + | ||
428 | + if (show_card) { | ||
429 | + name = name.toLowerCase(); | ||
430 | + th.setData({ | ||
431 | + card_name: name, | ||
432 | + show_card: show_card | ||
433 | + }) | ||
434 | + } | ||
435 | + } | ||
436 | + //-----先获取物流,再获取用户信息,再展示页面----- | ||
437 | + th.get_wuliu(th.get_info(th.show_page)); | ||
438 | + }) | ||
439 | + } else { | ||
440 | + //-----先获取物流,再获取用户信息,再展示页面----- | ||
441 | + th.get_wuliu(th.get_info(th.show_page)); | ||
442 | + } | ||
443 | + }, 1) | ||
444 | + | ||
445 | + }, | ||
446 | + //---------------检查是否有收货地址------------------- | ||
447 | + checkAddressList: function() { | ||
448 | + var t = this; | ||
449 | + return !(!this.data.order || null == this.data.order.userAddress) || (wx.showModal({ | ||
450 | + title: "请先填写或选择收货地址~", | ||
451 | + success: function(a) { | ||
452 | + a.confirm ? t.enterAddressPage() : wx.navigateBack(); | ||
453 | + }, | ||
454 | + fail: function() { | ||
455 | + wx.navigateBack(); | ||
456 | + } | ||
457 | + }), !1); | ||
458 | + }, | ||
459 | + showInvoice: function() { | ||
460 | + this.setData({ | ||
461 | + invoiceToggle: !this.data.invoiceToggle | ||
462 | + }); | ||
463 | + }, | ||
464 | + keyUpChangePay1: function(t) { | ||
465 | + this.setData({ | ||
466 | + payWithUserMoney: !(t.detail.value.length > 0) | ||
467 | + }); | ||
468 | + }, | ||
469 | + keyUpChangePay2: function(t) { | ||
470 | + this.setData({ | ||
471 | + payWithPoints: !(t.detail.value.length > 0) | ||
472 | + }); | ||
473 | + }, | ||
474 | + keyUpChangeNum: function(t) { | ||
475 | + this.setData({ | ||
476 | + maxWord: t.detail.value.length | ||
477 | + }); | ||
478 | + }, | ||
479 | + //---------计算立即购买---------- | ||
480 | + calculatePrice2: function() { | ||
481 | + console.log('calculatePrice2'); | ||
482 | + var th = this, | ||
483 | + good = this.data.bn_goods; | ||
484 | + //-----------计算商品总价-------------- | ||
485 | + var allpice = good.shop_price * good.buynum; | ||
486 | + allpice = parseFloat(allpice).toFixed(2); | ||
487 | + var txt = "formData.all_price"; | ||
488 | + th.setData({ | ||
489 | + [txt]: allpice, | ||
490 | + }); | ||
491 | + console.log(th.data.formData); | ||
492 | + | ||
493 | + to.getConfig2(function(ee) { | ||
494 | + to.getwuliuprice(function(rs) { | ||
495 | + console.log('calculatePrice2222'); | ||
496 | + console.log(rs); | ||
497 | + var o_shipping_price = 0, | ||
498 | + goods_weight = -1, | ||
499 | + goods_piece = -1; | ||
500 | + //-----------当地址不为空,且是物流时,计算物流费用,同时阶梯团不计算拼团价格---------- | ||
501 | + if (th.data.user_addr != null && th.data.bn_exp_type == 0 && good.is_free_shipping == 0 && (th.data.kt_type != | ||
502 | + 3 || th.data.bn_goods.is_normal == 1)) { | ||
503 | + switch (good['exp_sum_type']) { | ||
504 | + case 1: | ||
505 | + //统一运费 | ||
506 | + o_shipping_price += good['uniform_exp_sum']; | ||
507 | + break; | ||
508 | + case 2: | ||
509 | + if (goods_weight < 0) goods_weight = 0; | ||
510 | + //累积商品重量 每种商品的重量 * 数量 | ||
511 | + goods_weight += good['weight'] * good['buynum']; | ||
512 | + break; | ||
513 | + case 3: | ||
514 | + if (goods_piece < 0) goods_piece = 0; | ||
515 | + //累积商品数量 | ||
516 | + goods_piece += good['buynum']; | ||
517 | + break; | ||
518 | + } | ||
519 | + | ||
520 | + console.log(o_shipping_price + ":" + goods_weight + ":" + goods_piece); | ||
521 | + console.log(th.data.wu_arr); | ||
522 | + var code = th.data.wu_arr[th.data.index].code; | ||
523 | + var freight_free = ee.freight_free; //全场满多少包邮 | ||
524 | + var shipping_price = | ||
525 | + th.calculatewuliu(code, o_shipping_price, goods_weight, | ||
526 | + goods_piece, th.data.user_addr, freight_free, allpice, rs); | ||
527 | + | ||
528 | + shipping_price = parseFloat(shipping_price).toFixed(2); | ||
529 | + var wl_txt = "formData.shipping_price"; | ||
530 | + th.setData({ | ||
531 | + [wl_txt]: shipping_price, | ||
532 | + }) | ||
533 | + | ||
534 | + } else { | ||
535 | + var wl_txt = "formData.shipping_price"; | ||
536 | + th.setData({ | ||
537 | + [wl_txt]: 0, | ||
538 | + }) | ||
539 | + } | ||
540 | + //-----------------总价----------------- | ||
541 | + // 幸运购 01 | ||
542 | + // var total_m = parseFloat(allpice) + parseFloat( th.data.formData.shipping_price); | ||
543 | + var total_m = parseFloat(th.data.param.goods_price) + parseFloat(th.data.formData.shipping_price); | ||
544 | + total_m = parseFloat(total_m).toFixed(2); | ||
545 | + | ||
546 | + var atxt = "formData.total_amount"; | ||
547 | + th.setData({ | ||
548 | + [atxt]: total_m, | ||
549 | + }) | ||
550 | + var order_m = total_m; | ||
551 | + | ||
552 | + var txt = "formData.user_money"; | ||
553 | + var txt2 = "formData.order_amount"; | ||
554 | + //--------------如果使用余额--------------------- | ||
555 | + if (th.data.bn_use_money == 1 && th.data.yuer > 0) { | ||
556 | + if (parseFloat(th.data.yuer) > total_m) { | ||
557 | + th.setData({ | ||
558 | + [txt]: total_m, | ||
559 | + [txt2]: 0 | ||
560 | + }) | ||
561 | + } else { | ||
562 | + order_m = parseFloat(order_m) - parseFloat(th.data.yuer); | ||
563 | + order_m = order_m.toFixed(2); | ||
564 | + th.setData({ | ||
565 | + [txt]: th.data.yuer, | ||
566 | + [txt2]: order_m | ||
567 | + }) | ||
568 | + } | ||
569 | + } else { | ||
570 | + th.setData({ | ||
571 | + [txt]: 0, | ||
572 | + [txt2]: order_m | ||
573 | + }) | ||
574 | + } | ||
575 | + | ||
576 | + }); | ||
577 | + }); | ||
578 | + }, | ||
579 | + | ||
580 | + | ||
581 | + // 提交订单前弹出确认对话框 | ||
582 | + submitConfirm(e) { | ||
583 | + wx.showModal({ | ||
584 | + title: '温馨提示', | ||
585 | + content: this.data.param.alert, | ||
586 | + success(res) { | ||
587 | + if (res.confirm) { | ||
588 | + console.log('用户点击确定'); | ||
589 | + self.submitForm(e); | ||
590 | + } else if (res.cancel) { | ||
591 | + console.log('用户点击取消'); | ||
592 | + } | ||
593 | + } | ||
594 | + }) | ||
595 | + }, | ||
596 | + | ||
597 | + | ||
598 | + //--------------------提交订单----------------------- | ||
599 | + submitForm: async function(t) { | ||
600 | + if (this.data.is_summit_ing == 1) return false; //--提交中退出-- | ||
601 | + this.data.is_summit_ing = 1; | ||
602 | + | ||
603 | + var th = this, | ||
604 | + pdata = new Array(); | ||
605 | + var ff = true; | ||
606 | + //------------立即购买------------- | ||
607 | + console.log("buy_new"); | ||
608 | + | ||
609 | + //如果不是阶梯团,或者是普通购买,商家选择了物流,以及地址为空的时候 | ||
610 | + if (th.data.bn_exp_type == 0 && th.data.user_addr == null && (th.data.kt_type != 3 || th.data.bn_goods.is_normal == | ||
611 | + 1)) { | ||
612 | + ff = false; | ||
613 | + getApp().my_warnning("请选择收货地址", 0, this); | ||
614 | + this.data.is_summit_ing = 0; | ||
615 | + } | ||
616 | + if (!ff) return false; | ||
617 | + var addr = th.data.user_addr; | ||
618 | + if (th.data.bn_exp_type == 1) addr = null; | ||
619 | + | ||
620 | + console.log(th.data.formData); | ||
621 | + console.log(th.data.wu_arr); | ||
622 | + console.log(th.data.bn_exp_type); | ||
623 | + | ||
624 | + if (th.data.bn_exp_type == 0 && (th.data.kt_type != 3 || th.data.bn_goods.is_normal == 1)) { | ||
625 | + if (th.data.wu_arr == null || th.data.wu_arr.length <= 0) { | ||
626 | + getApp().my_warnning("读取物流失败", 0, this); | ||
627 | + this.data.is_summit_ing = 0; | ||
628 | + return false; | ||
629 | + } | ||
630 | + } | ||
631 | + | ||
632 | + //阶梯团强制带1,自提~~~01 | ||
633 | + // if (th.data.kt_type == 3) { | ||
634 | + // th.data.bn_exp_type = 1; | ||
635 | + // } | ||
636 | + | ||
637 | + var item = { | ||
638 | + 'user_id': to.globalData.user_id, | ||
639 | + 'consignee': addr == null ? "" : addr.consignee, | ||
640 | + 'province': addr == null ? 0 : addr.province, | ||
641 | + 'city': addr == null ? 0 : addr.city, | ||
642 | + 'district': addr == null ? 0 : addr.district, | ||
643 | + 'twon': addr == null ? 0 : addr.twon, | ||
644 | + 'address': addr == null ? "" : addr.address, | ||
645 | + 'more_address': addr == null ? "" : addr.more_address, | ||
646 | + 'mobile': addr == null ? th.data.userinfo.mobile : addr.mobile, | ||
647 | + 'email': '', | ||
648 | + 'invoice_title': '', | ||
649 | + 'goods_price': th.data.param.goods_price, //商品总价 | ||
650 | + //'goods_price': th.data.formData.all_price, //商品总价 | ||
651 | + 'shipping_price': th.data.formData.shipping_price, //物流金额 | ||
652 | + 'user_money': th.data.formData.user_money, //使用余额 | ||
653 | + 'total_amount': th.data.formData.total_amount, //订单总价 | ||
654 | + 'order_amount': th.data.formData.order_amount, //应付 | ||
655 | + 'user_note': t.detail.value.user_note, //用户备注 | ||
656 | + 'store_id': oo.stoid, //商家 | ||
657 | + 'pickup_id': th.data.bn_pick, //门店 | ||
658 | + 'exp_type': th.data.bn_exp_type, //配送方式 | ||
659 | + 'is_normal': th.data.bn_goods.is_normal, //是否是普通购买 | ||
660 | + //'pt_prom_id': th.data.bn_goods.prom_id, //拼单ID 01 | ||
661 | + //'is_pt_tz': th.data.is_pt_tz, //开团类型 01 | ||
662 | + 'order_goods': new Array(), | ||
663 | + }; | ||
664 | + | ||
665 | + //如果不是阶梯团,或者是普通购买,01 | ||
666 | + // if ((th.data.kt_type != 3 || th.data.bn_goods.is_normal == 1)) { | ||
667 | + if (th.data.bn_goods.is_normal == 1) { | ||
668 | + item['shipping_code'] = th.data.bn_exp_type == 1 ? 0 : th.data.wu_arr[th.data.index].code; | ||
669 | + item['shipping_name'] = th.data.bn_exp_type == 1 ? '' : th.data.wu_arr[th.data.index].name; | ||
670 | + } | ||
671 | + | ||
672 | + // if (!th.data.bn_goods.is_normal) { | ||
673 | + // item.is_zsorder = th.data.kt_type + 1; //开团类型 01 | ||
674 | + // } | ||
675 | + | ||
676 | + | ||
677 | + //老会员成为分销下线需要的参数 | ||
678 | + if (getApp().globalData.first_leader && !getApp().globalData.userInfo.first_leader) { | ||
679 | + //判断一下分享人是不是分享商 | ||
680 | + await app.request.promiseGet("/api/weshop/users/get/" + os.stoid + "/" + getApp().globalData.first_leader, {}).then( | ||
681 | + res => { | ||
682 | + if (res.data.code == 0) { | ||
683 | + var user = res.data.data; | ||
684 | + if (user.is_distribut == 1) { | ||
685 | + item.first_leader = parseInt(getApp().globalData.first_leader); | ||
686 | + } | ||
687 | + } | ||
688 | + }) | ||
689 | + } | ||
690 | + | ||
691 | + if (th.data.qh != '') { | ||
692 | + item.team_qh = th.data.qh; | ||
693 | + item.pt_listno = th.data.qh; | ||
694 | + } | ||
695 | + | ||
696 | + | ||
697 | + var gg = to.get_b_now(); | ||
698 | + var goods = { | ||
699 | + 'goods_id': gg.goods_id, | ||
700 | + 'goods_name': gg.goods_name, | ||
701 | + 'goods_sn': gg.goods_sn, | ||
702 | + 'goods_num': gg.goods_num, | ||
703 | + 'market_price': th.data.bn_goods.market_price, | ||
704 | + 'goods_price': th.data.param.goods_price, | ||
705 | + // 'goods_price': th.data.bn_goods.shop_price, | ||
706 | + 'member_goods_price': th.data.bn_goods.shop_price, | ||
707 | + 'store_id': oo.stoid, | ||
708 | + // 'prom_type':th.data.bn_goods.prom_type, //促销活动类型 01 | ||
709 | + // 'prom_id': th.data.bn_goods.prom_id, //促销活动id 01 | ||
710 | + | ||
711 | + 'prom_type': 9, //促销活动类型 | ||
712 | + 'prom_id': th.data.param.group_id, //促销活动id | ||
713 | + }; | ||
714 | + | ||
715 | + //--导购分享过来的id-- | ||
716 | + if (gg.guide_id) { | ||
717 | + goods.guide_id = gg.guide_id; | ||
718 | + goods.guide_type = gg.guide_type; | ||
719 | + //调用接口判断是不是会员 | ||
720 | + await getApp().request.promiseGet("/api/weshop/shoppingGuide/getId/" + oo.stoid + "/" + gg.guide_id, {}).then(res => { | ||
721 | + if (res.data.code == 0) { | ||
722 | + goods.guide_name = res.data.data.salesman; | ||
723 | + goods.guide_sn = res.data.data.salesman_no; | ||
724 | + } | ||
725 | + }) | ||
726 | + } | ||
727 | + | ||
728 | + //--商品的房间号-- | ||
729 | + if (gg.room_id && gg.room_id > 0) { | ||
730 | + item.room_ids = gg.room_id; | ||
731 | + goods.room_id = gg.room_id; | ||
732 | + } | ||
733 | + | ||
734 | + // if (th.data.bn_goods.is_normal) { | ||
735 | + // goods.is_pd_normal = 0; | ||
736 | + // } | ||
737 | + | ||
738 | + item.order_goods.push(goods); | ||
739 | + pdata.push(item); | ||
740 | + | ||
741 | + if (pdata.length == 0) return; | ||
742 | + var str = JSON.stringify(pdata); | ||
743 | + console.log("支付数据"); | ||
744 | + console.log(str); | ||
745 | + //return false; | ||
746 | + wx.showLoading({ | ||
747 | + title: "加载中" | ||
748 | + }); | ||
749 | + wx.request({ | ||
750 | + url: oo.url + '/api/weshop/order/createWxdOrder', | ||
751 | + data: str, | ||
752 | + method: 'POST', | ||
753 | + header: { | ||
754 | + 'content-type': 'application/json' | ||
755 | + }, // 设置请求的 header | ||
756 | + success: function(res) { | ||
757 | + | ||
758 | + wx.hideLoading(); | ||
759 | + if (res.statusCode == 200) { | ||
760 | + var data = res.data; | ||
761 | + if (data.code == 0) { | ||
762 | + console.log(th.data.is_b_now); | ||
763 | + //如果是购物车结算,还要删除购物车 | ||
764 | + if (th.data.is_b_now == 0) { | ||
765 | + console.log(th.data.cartlist_y); | ||
766 | + var list = th.data.cartlist_y; | ||
767 | + for (var i = 0; i < list.length; i++) { | ||
768 | + //删除购物车 | ||
769 | + getApp().request.delete("/api/weshop/cart/del/" + oo.stoid + "/" + list[i].id, {}); | ||
770 | + } | ||
771 | + } | ||
772 | + var order_amount = 0; | ||
773 | + pdata.forEach(function(em, ind) { | ||
774 | + order_amount += em.order_amount; | ||
775 | + }) | ||
776 | + //要进行判断,如果是用微信支付,就要跳转到支付界面 | ||
777 | + if (order_amount > 0) { | ||
778 | + th.setData({ | ||
779 | + isclose: 0 | ||
780 | + }); | ||
781 | + //void e.jumpToCart4({ | ||
782 | + // order_sn: data.data, | ||
783 | + // type:1, | ||
784 | + // }, 1); | ||
785 | + util_pay.pay(data.data, function() { | ||
786 | + setTimeout(function() { | ||
787 | + wx.reLaunch({ | ||
788 | + //url: "/pages/payment/pay_success/pay_success?type=1&order_sn="+data.data, | ||
789 | + url: "/pages/team/team_success/team_success?ordersn=" + data.data, | ||
790 | + }) | ||
791 | + }, 1000) | ||
792 | + }, function() { | ||
793 | + //支付失败 | ||
794 | + setTimeout(function() { | ||
795 | + //wx.navigateBack({ delta: 1 }) | ||
796 | + wx.reLaunch({ | ||
797 | + url: "/pages/user/order_list/order_list", | ||
798 | + }) | ||
799 | + }, 1000) | ||
800 | + | ||
801 | + }, oo.stoid, 1); | ||
802 | + | ||
803 | + } else { | ||
804 | + var dd = { | ||
805 | + parent_sn: data.data, | ||
806 | + store_id: oo.stoid, | ||
807 | + type: 1, | ||
808 | + }; | ||
809 | + wx.showLoading({ | ||
810 | + title: '支付中', | ||
811 | + mask: true, | ||
812 | + }); | ||
813 | + //return false; | ||
814 | + getApp().request.post("/api/weshop/order/pay/createOrder", { | ||
815 | + data: dd, | ||
816 | + success: function(t) { | ||
817 | + // console.log(t); | ||
818 | + // app.my_warnning("支付成功",1,th); | ||
819 | + wx.hideLoading(); | ||
820 | + if (t.data.code == 0) { | ||
821 | + | ||
822 | + // setTimeout(function () { | ||
823 | + th.setData({ | ||
824 | + isclose: 0 | ||
825 | + }); | ||
826 | + | ||
827 | + wx.showToast({ | ||
828 | + title: '支付成功', | ||
829 | + icon: 'success', | ||
830 | + duration: 2000, | ||
831 | + success: function() { | ||
832 | + // 幸运购 | ||
833 | + setTimeout(function() { | ||
834 | + wx.redirectTo({ | ||
835 | + url: "/packageC/pages/luckyGo/luckyGo_details/luckyGo_details?type=1&ordersn=" + data.data + | ||
836 | + "&group_id=" + th.data.param.group_id + "&goods_id=" + th.data.param.goods_id + | ||
837 | + "&goods_name=" + th.data.bn_goods.goods_name, | ||
838 | + }); | ||
839 | + }, 0); | ||
840 | + | ||
841 | + }, | ||
842 | + }) | ||
843 | + | ||
844 | + | ||
845 | + // if(th.data.is_normal==1){ | ||
846 | + // /*-- | ||
847 | + // wx.navigateTo({ | ||
848 | + // url: "/pages/user/order_list/order_list", | ||
849 | + // })--*/ | ||
850 | + | ||
851 | + // // var url="/pages/payment/pay_success/pay_success?type=1&order_sn="+data.data; | ||
852 | + // // wx.reLaunch({ | ||
853 | + // // url: url | ||
854 | + // // }) | ||
855 | + | ||
856 | + // }else{ | ||
857 | + // // wx.reLaunch({ | ||
858 | + // // url: "/pages/team/team_success/team_success?ordersn=" + data.data, | ||
859 | + // // }) | ||
860 | + // } | ||
861 | + | ||
862 | + | ||
863 | + // }, 1000) | ||
864 | + | ||
865 | + } else { | ||
866 | + wx.showToast({ | ||
867 | + title: t.data.msg, | ||
868 | + icon: 'none', | ||
869 | + duration: 2000, | ||
870 | + success: function() { | ||
871 | + | ||
872 | + // wx.reLaunch({ | ||
873 | + // url: "/pages/user/order_list/order_list", | ||
874 | + // }) | ||
875 | + | ||
876 | + }, | ||
877 | + }) | ||
878 | + }; | ||
879 | + | ||
880 | + | ||
881 | + } | ||
882 | + }); | ||
883 | + } | ||
884 | + } else { | ||
885 | + th.data.is_summit_ing = 0; //是否提交中 | ||
886 | + getApp().confirmBox(data.msg); | ||
887 | + } | ||
888 | + } else { | ||
889 | + th.data.is_summit_ing = 0; //是否提交中 | ||
890 | + console.log("index.js wx.request CheckCallUser statusCode" + res.statusCode); | ||
891 | + } | ||
892 | + }, | ||
893 | + fail: function() { | ||
894 | + th.data.is_summit_ing = 0; //是否提交中 | ||
895 | + wx.hideLoading(); | ||
896 | + console.log("index.js wx.request CheckCallUser fail"); | ||
897 | + }, | ||
898 | + complete: function() {} | ||
899 | + }) | ||
900 | + }, | ||
901 | + | ||
902 | + | ||
903 | + | ||
904 | + | ||
905 | + | ||
906 | + useCoupon: function() { | ||
907 | + if (this.data.order.couponNum <= 0) { | ||
908 | + //return t.showWarning("无可用优惠券"); | ||
909 | + getApp().my_warnning("无可用优惠券", 0, this); | ||
910 | + return; | ||
911 | + } | ||
912 | + var a = { | ||
913 | + lid: this.data.coupon ? this.data.coupon.id : "0" | ||
914 | + }; | ||
915 | + wx.navigateTo({ | ||
916 | + url: "/pages/user/checkcoupon/checkcoupon?" + s.Obj2Str(a) | ||
917 | + }); | ||
918 | + }, | ||
919 | + | ||
920 | + | ||
921 | + | ||
922 | + | ||
923 | + enterAddressPage: function() { | ||
924 | + getApp().globalData.is_cart_old = 1; | ||
925 | + this.data.enterAddressPage = !0, wx.navigateTo({ | ||
926 | + url: "/pages/user/address_list/address_list" | ||
927 | + }); | ||
928 | + }, | ||
929 | + | ||
930 | + | ||
931 | + | ||
932 | + | ||
933 | + //--------立即购买时,选择自提和物流----------- | ||
934 | + setexptype_w: function(t) { | ||
935 | + var th = this; | ||
936 | + var ty = t.currentTarget.dataset.t, | ||
937 | + txt = t.currentTarget.dataset.txt; | ||
938 | + th.setData({ | ||
939 | + [txt]: ty | ||
940 | + }); | ||
941 | + var iszt = 1; | ||
942 | + if (ty == 0) { | ||
943 | + th.setData({ | ||
944 | + is_all_zt: 0 | ||
945 | + }); | ||
946 | + } else { | ||
947 | + for (var i = 0; i < th.data.cartlist.length; i++) { | ||
948 | + var item = th.data.cartlist[i]; | ||
949 | + if (item.exp_type == 0) { | ||
950 | + iszt = 0; | ||
951 | + break; | ||
952 | + } | ||
953 | + } | ||
954 | + th.setData({ | ||
955 | + is_all_zt: iszt | ||
956 | + }); | ||
957 | + } | ||
958 | + //----计算此时购物车的价格---- | ||
959 | + th.calculatePrice(); | ||
960 | + }, | ||
961 | + | ||
962 | + | ||
963 | + | ||
964 | + | ||
965 | + //--------立即购买时,选择自提和物流---------- | ||
966 | + setexptype: function(t) { | ||
967 | + var th = this; | ||
968 | + var ty = t.currentTarget.dataset.t; | ||
969 | + th.setData({ | ||
970 | + bn_exp_type: ty | ||
971 | + }); | ||
972 | + //当物流为空的时候。 | ||
973 | + if (ty == 0 && th.data.wu_arr == null) { | ||
974 | + return th.get_wuliu(th.calculatePrice2()); | ||
975 | + } | ||
976 | + th.calculatePrice2() | ||
977 | + console.log('setexptype'); | ||
978 | + }, | ||
979 | + | ||
980 | + | ||
981 | + | ||
982 | + | ||
983 | + //--------立即购买时,使用余额-------- | ||
984 | + set_bn_useyuer: function() { | ||
985 | + var th = this; | ||
986 | + th.setData({ | ||
987 | + bn_use_money: !th.data.bn_use_money | ||
988 | + }); | ||
989 | + th.calculatePrice2(); | ||
990 | + }, | ||
991 | + | ||
992 | + | ||
993 | + | ||
994 | + | ||
995 | + | ||
996 | + set_js_useyuer: function() { | ||
997 | + var th = this; | ||
998 | + th.setData({ | ||
999 | + js_use_money: !th.data.js_use_money | ||
1000 | + }); | ||
1001 | + th.calculatePrice(); | ||
1002 | + }, | ||
1003 | + | ||
1004 | + | ||
1005 | + | ||
1006 | + | ||
1007 | + //-------------------计算物流--------------- | ||
1008 | + calculatewuliu: function(code, o_shipping_price, goods_weight, | ||
1009 | + goods_piece, user_addr, freight_free, o_price, rs) { | ||
1010 | + var price = 0, | ||
1011 | + th = this; | ||
1012 | + price += parseFloat(o_shipping_price); | ||
1013 | + //如果是包邮 | ||
1014 | + if (freight_free > 0 && o_price > freight_free) { | ||
1015 | + return 0; | ||
1016 | + } | ||
1017 | + if (user_addr == null) { | ||
1018 | + return 0; | ||
1019 | + } | ||
1020 | + //计算物流的config item; | ||
1021 | + var item = null; | ||
1022 | + //先根据 镇 县 区找计算的config | ||
1023 | + item = th.get_wuliu_config(user_addr.district, code, rs); | ||
1024 | + if (item == null) item = th.get_wuliu_config(user_addr.city, code, rs); | ||
1025 | + if (item == null) item = th.get_wuliu_config(user_addr.province, code, rs); | ||
1026 | + if (item == null) item = th.get_wuliu_default(code, rs); | ||
1027 | + if (item == null) return o_shipping_price; | ||
1028 | + var fw_price = 0, | ||
1029 | + fp_price = 0; | ||
1030 | + item = item.config; | ||
1031 | + if (item == null) return o_shipping_price; | ||
1032 | + //------按重量---------- | ||
1033 | + if (goods_weight > 0) { | ||
1034 | + fw_price = parseFloat(item['money']); | ||
1035 | + if (goods_weight > item['first_weight']) { | ||
1036 | + var fw = goods_weight - item['first_weight']; | ||
1037 | + var n = Math.ceil(fw / item['second_weight']) | ||
1038 | + fw_price = fw_price + n * parseFloat(item['add_money']); | ||
1039 | + } | ||
1040 | + } | ||
1041 | + //------按件数---------- | ||
1042 | + if (goods_piece > 0) { | ||
1043 | + fp_price = parseFloat(item['piecemoney']); | ||
1044 | + if (goods_piece > item['first_piece']) { | ||
1045 | + var fp = goods_piece - item['first_piece']; | ||
1046 | + var m = Math.ceil(fp / item['second_piece']) | ||
1047 | + fp_price = fp_price + m * parseFloat(item['add_piecemoney']); | ||
1048 | + } | ||
1049 | + } | ||
1050 | + var rspice = parseFloat(price + fw_price + fp_price); | ||
1051 | + return rspice; | ||
1052 | + }, | ||
1053 | + | ||
1054 | + | ||
1055 | + | ||
1056 | + //------------循环获取config----------- | ||
1057 | + get_wuliu_config: function(region_id, code, rs) { | ||
1058 | + var item = null, | ||
1059 | + rslist = rs.pageData; | ||
1060 | + for (var i = 0; i < rslist.length; i++) { | ||
1061 | + if (rslist[i].code == code && rslist[i].region_id == region_id) { | ||
1062 | + item = rslist[i]; | ||
1063 | + } | ||
1064 | + } | ||
1065 | + return item; | ||
1066 | + }, | ||
1067 | + | ||
1068 | + | ||
1069 | + | ||
1070 | + | ||
1071 | + //-------循环获取config,code default------- | ||
1072 | + get_wuliu_default: function(code, rs) { | ||
1073 | + var item = null, | ||
1074 | + rslist = rs.pageData; | ||
1075 | + for (var i = 0; i < rslist.length; i++) { | ||
1076 | + if (rslist[i].shipping_code == code && rslist[i].is_default == 1) { | ||
1077 | + item = rslist[i]; | ||
1078 | + } | ||
1079 | + } | ||
1080 | + return item; | ||
1081 | + }, | ||
1082 | + | ||
1083 | + | ||
1084 | + | ||
1085 | + | ||
1086 | + | ||
1087 | + | ||
1088 | + //----------立即购买,选择物流------------- | ||
1089 | + bindPickerChange: function(e) { | ||
1090 | + var ind = e.detail.value | ||
1091 | + this.setData({ | ||
1092 | + index: ind | ||
1093 | + }); | ||
1094 | + this.calculatePrice2(); | ||
1095 | + }, | ||
1096 | + | ||
1097 | + | ||
1098 | + | ||
1099 | + | ||
1100 | + | ||
1101 | + //----------购物车结算,选择物流------------- 01 | ||
1102 | + // bindPickerChange_w: function(e) { | ||
1103 | + // var ind = e.detail.value, | ||
1104 | + // txt = e.currentTarget.dataset.txt; | ||
1105 | + // this.setData({ | ||
1106 | + // [txt]: ind | ||
1107 | + // }); | ||
1108 | + // this.calculatePrice(); | ||
1109 | + // }, | ||
1110 | + | ||
1111 | + | ||
1112 | + | ||
1113 | + | ||
1114 | + cart_set_err: function(e) { | ||
1115 | + var txt = e.currentTarget.dataset.err; | ||
1116 | + var ob = {}; | ||
1117 | + ob[txt] = this.data.imgUrl + "/miniapp/images/default_g_img.gif"; | ||
1118 | + this.setData(ob); | ||
1119 | + }, | ||
1120 | + | ||
1121 | + | ||
1122 | + | ||
1123 | + | ||
1124 | + // 开启物流的弹窗 | ||
1125 | + show_wu_arr: function(e) { | ||
1126 | + this.setData({ | ||
1127 | + open_express: 1 | ||
1128 | + }); | ||
1129 | + }, | ||
1130 | + | ||
1131 | + | ||
1132 | + | ||
1133 | + //更新下默认,在onshow里面 | ||
1134 | + update_code() { | ||
1135 | + var th = this, | ||
1136 | + m_wind = 0, | ||
1137 | + def_exp_code = getApp().globalData.userInfo.def_exp_code; | ||
1138 | + | ||
1139 | + var uii = setInterval(function() { | ||
1140 | + if (th.data.wu_arr) { | ||
1141 | + clearInterval(uii); | ||
1142 | + for (var k = 0; k < th.data.wu_arr.length; k++) { | ||
1143 | + var item = th.data.wu_arr[k]; | ||
1144 | + if (def_exp_code == item.code) { | ||
1145 | + m_wind = k; | ||
1146 | + } | ||
1147 | + } | ||
1148 | + //--如果是立即购买-- | ||
1149 | + th.setData({ | ||
1150 | + index: m_wind, | ||
1151 | + is_express: m_wind | ||
1152 | + }); | ||
1153 | + } | ||
1154 | + }, 500) | ||
1155 | + }, | ||
1156 | + | ||
1157 | + | ||
1158 | + | ||
1159 | + // 关闭物流的弹窗 | ||
1160 | + close_express: function() { | ||
1161 | + this.setData({ | ||
1162 | + open_express: 0 | ||
1163 | + }); | ||
1164 | + }, | ||
1165 | + | ||
1166 | + | ||
1167 | + | ||
1168 | + | ||
1169 | + // 选择物流 | ||
1170 | + click_express_name: function(e) { | ||
1171 | + var express_name = e.currentTarget.dataset.name, | ||
1172 | + shippingcode = e.currentTarget.dataset.shippingcode; | ||
1173 | + var index = e.currentTarget.dataset.idxe; | ||
1174 | + var ob = { | ||
1175 | + is_express: index, | ||
1176 | + is_shipping_code: shippingcode, | ||
1177 | + index: index | ||
1178 | + }; | ||
1179 | + this.setData(ob); | ||
1180 | + }, | ||
1181 | + | ||
1182 | + | ||
1183 | + | ||
1184 | + | ||
1185 | + //点击确定物流 | ||
1186 | + determine_expres: function(e) { | ||
1187 | + this.setData({ | ||
1188 | + open_express: 0 | ||
1189 | + }); | ||
1190 | + this.calculatePrice2(); | ||
1191 | + }, | ||
1192 | + | ||
1193 | + | ||
1194 | + | ||
1195 | + | ||
1196 | + //设置默认物流 | ||
1197 | + select_default_logistics: function() { | ||
1198 | + var th = this; | ||
1199 | + var is_shipping_code = this.data.is_shipping_code | ||
1200 | + getApp().request.put("/api/weshop/users/update", { | ||
1201 | + data: { | ||
1202 | + user_id: getApp().globalData.user_id, | ||
1203 | + store_id: oo.stoid, | ||
1204 | + def_exp_code: is_shipping_code | ||
1205 | + }, | ||
1206 | + success: function(rse) { | ||
1207 | + if (rse.data.code == 0) { | ||
1208 | + getApp().globalData.userInfo.def_exp_code = is_shipping_code; | ||
1209 | + th.setData({ | ||
1210 | + open_express: 0 | ||
1211 | + }); | ||
1212 | + //----计算此时购物车的价格,这个页面没有calculatePrice(),2021.7.19---- | ||
1213 | + //if(th.data.is_b_now==1) th.calculatePrice2(); | ||
1214 | + //else th.calculatePrice(); | ||
1215 | + th.calculatePrice2(); | ||
1216 | + } | ||
1217 | + } | ||
1218 | + }) | ||
1219 | + }, | ||
1220 | + | ||
1221 | + | ||
1222 | + | ||
1223 | + | ||
1224 | + //跳转到购买卡 | ||
1225 | + buycard: function() { | ||
1226 | + getApp().goto("/pages/user/plus/plus"); | ||
1227 | + getApp().globalData.plus_buy_back = 1; | ||
1228 | + }, | ||
1229 | + | ||
1230 | + | ||
1231 | + | ||
1232 | +}); |
packageC/pages/luckyGo/luckyGo_cart_ct/luckyGo_cart_ct.json
0 → 100644
packageC/pages/luckyGo/luckyGo_cart_ct/luckyGo_cart_ct.wxml
0 → 100644
1 | +<wxs module="filters" src="../../../../utils/filter.wxs"></wxs> | ||
2 | +<form bindsubmit="submitConfirm"> | ||
3 | + <view class="container"> | ||
4 | + | ||
5 | + <view class="tab-container" wx:if="{{kt_type!=3 || is_normal==1}}"> | ||
6 | + <view class="tab-wrapper"> | ||
7 | + <view hidden="{{bn_t_exp_t==2}}" bindtap='setexptype' data-t='1' class="tab {{bn_exp_type == 1? 'active':''}}" | ||
8 | + data-txt='cartlist[0].exp_type' data-wl_txt='cartlist[0].wind' data-index="{{index}}" >门店自提</view> | ||
9 | + | ||
10 | + <view hidden="{{bn_t_exp_t==1}}" bindtap='setexptype' data-t='0' class="tab {{bn_exp_type== 0 ? 'active':''}}" | ||
11 | + data-txt='cartlist[0].exp_type' data-wl_txt='cartlist[0].wind' data-index="{{index}}" >快递邮寄</view> | ||
12 | + | ||
13 | + </view> | ||
14 | + </view> | ||
15 | + | ||
16 | + | ||
17 | + <!--要进行判断地址是否显示----> | ||
18 | + <view bindtap="enterAddressPage" class="user-mes mgt20" hidden='{{bn_exp_type==1 || kt_type==3}}'> | ||
19 | + <!---默认地址显示------> | ||
20 | + <block wx:if="{{user_addr!=null}}"> | ||
21 | + <view class="user-contact">收货人:{{user_addr.consignee}}{{' '}}{{user_addr.mobile}}</view> | ||
22 | + <view class="location"> | ||
23 | + <view class="address">{{user_addr.more_address}}{{' '}}{{user_addr.address}}</view> | ||
24 | + <view class="pos-icon"> | ||
25 | + <image class="wh100 bdr14" src="{{imgUrl}}/miniapp/images/goodscategory/new_position.png"></image> | ||
26 | + </view> | ||
27 | + </view> | ||
28 | + <view class="update-logistics"> | ||
29 | + <image class="arrow-rigth" src="{{imgUrl}}/miniapp/images/icon-arrowdown.png"></image> | ||
30 | + </view> | ||
31 | + </block> | ||
32 | + <!---先增地址------> | ||
33 | + <block wx:else> | ||
34 | + <view class="add_new"> | ||
35 | + <image class="addr_jia" src="{{imgUrl}}/miniapp/images/jia.png"></image>添加地址 | ||
36 | + </view> | ||
37 | + </block> | ||
38 | + <!-- <view class="border-img"><image class="wh100 bdr14" src="{{imgUrl}}/miniapp/images/tt.png"></image></view> --> | ||
39 | + </view> | ||
40 | + | ||
41 | + | ||
42 | + <!------立即购买--------> | ||
43 | + <block> | ||
44 | + <!-- <view class="xc-border main-top"></view> --> | ||
45 | + <view class="use-item bfff bdr_t-14 mgt20"> | ||
46 | + <image class="dp" src='{{imgUrl}}/miniapp/images/goodscategory/new_store.png'> </image> <view>{{bn_pickname}}</view></view> | ||
47 | + <view class="order-detail"> | ||
48 | + <view class="goods-img"> | ||
49 | + <image class="wh100 bdr14" src="{{bn_goods.original_img}}" | ||
50 | + binderror='cart_set_err' data-err="bn_goods.original_img"></image> | ||
51 | + </view> | ||
52 | + <navigator class="order-cont" url="/pages/goods/goodsInfo/goodsInfo?goods_id={{bn_goods.goods_id}}"> | ||
53 | + <view class="goods-name ellipsis-2">{{bn_goods.goods_name}}</view> | ||
54 | + <!-- 商品属性 --> | ||
55 | + <view class="flex-vertical fs28 color-gray n_guige"> | ||
56 | + <view class="goods-color"><text>{{filters.show_gui_ge(bn_goods.goods_spec,bn_goods.goods_color)}}</text> | ||
57 | + </view></view> | ||
58 | + | ||
59 | + <!-----商品名称规格------> | ||
60 | + <view class="order-num flex-space-between"> | ||
61 | + <view class="co-red">¥<text class="fs36">{{filters.toFix(param.goods_price,2)}}</text></view> | ||
62 | + <view class="goods-num">x{{bn_goods.buynum}}</view> | ||
63 | + </view> | ||
64 | + </navigator> | ||
65 | + <!-- <view class="order-num"> | ||
66 | + <view class="co-red">¥{{bn_goods.shop_price}}</view> | ||
67 | + <view class="goods-num">x{{bn_goods.buynum}}</view> | ||
68 | + </view> --> | ||
69 | + </view> | ||
70 | + | ||
71 | + <!-- 如果是等级卡的商品,会员没有注册,要提醒注册 --> | ||
72 | + <view class="plus_buy fs28" wx:if="{{card_cut_price>0}}"> | ||
73 | + <view class="flex"> | ||
74 | + <view class="card_bg ellipsis-1" style="margin-right: 10rpx;"> | ||
75 | + <image src="{{imgUrl}}/miniapp/images/plus/dj_icon.png"></ image> | ||
76 | + <text class="card_name">{{show_card.CardName}}</text> | ||
77 | + </view> | ||
78 | + <view>立减 <text style="color:#f23030;">{{filters.toFix(card_cut_price,2) }}</text> 元</view> | ||
79 | + </view> | ||
80 | + <view> | ||
81 | + <text style="color: #999;margin-left: 4rpx;">vip超级会员仅需{{show_card.CardFee}}元</text> | ||
82 | + </view> | ||
83 | + <!-- 三角形 --> | ||
84 | + <view class="car_tri_up"></view> | ||
85 | + <!-- 立即开通跳转 --> | ||
86 | + <view bindtap="buycard" class="card_op">立即开通</view> | ||
87 | + </view> | ||
88 | + | ||
89 | + | ||
90 | + <view class="set-mes bdr_b-14"> | ||
91 | + <view wx:if="{{order.store_prom}}"><icon color="#f23030" size="16" type="info"></icon>{{order.store_prom}} | ||
92 | + </view> | ||
93 | + | ||
94 | + <!--阶梯团是不显示的--> | ||
95 | + <block wx:if="{{bn_exp_type==0 && !is_default_logistics}}"> | ||
96 | + <view class="use-item flex-space-between" wx:if="{{kt_type!=3 || is_normal==1}}"> | ||
97 | + <view>选择物流</view> | ||
98 | + <view class="flex-vertical" bindtap="show_wu_arr" data-txt='index' style="margin-right: 8rpx;"> | ||
99 | + <view class="logistics-name">{{wu_arr[index].name}}</view><view class="xc-right"></view> | ||
100 | + </view> | ||
101 | + </view> | ||
102 | + </block> | ||
103 | + | ||
104 | + <!--阶梯团是不显示的 | ||
105 | + <block wx:if="{{kt_type!=3 || is_normal==1 }}"> | ||
106 | + <view class="use-item" hidden='{{bn_exp_type==1}}'> | ||
107 | + <view>使用物流:</view> | ||
108 | + <picker bindchange="bindPickerChange" value="{{index}}" range="{{wu_arr}}" range-key="name"> | ||
109 | + <view >{{wu_arr[index].name}}</view> | ||
110 | + </picker> | ||
111 | + </view> | ||
112 | + </block>--> | ||
113 | + | ||
114 | + </view> | ||
115 | + | ||
116 | + | ||
117 | + <view class="coupon-mes flex-vertical"> | ||
118 | + <view>留言</view> | ||
119 | + <view class="leave-word"> | ||
120 | + <input placeholder-class="fs28" placeholder='给商家留言,最多100字'bindinput="keyUpChangeNum" disabled="{{disabled}}" class="word-box" maxlength="100" name="user_note"></input> | ||
121 | + | ||
122 | + </view> | ||
123 | + </view> | ||
124 | + </block> | ||
125 | + | ||
126 | + <view class="information bdr14"> | ||
127 | + <!-----使用余额------> | ||
128 | + <view class="set-mes" wx:if="{{userinfo.user_money>0 && yuer>0}}"> | ||
129 | + <view class="use-item" bindtap='set_bn_useyuer' style="padding-left:0;padding-right:0;"> | ||
130 | + <icon color="{{bn_use_money?'red':'gray'}}" size="16" type="success"></icon> | ||
131 | + <view class="yu_er">使用余额 :¥{{yuer}} </view> | ||
132 | + </view> | ||
133 | + </view> | ||
134 | + <view class="item" wx:if="{{kt_type<3 || is_normal==1}}"> | ||
135 | + <view>商品金额</view> | ||
136 | + <!-- <view class="co-red">¥ {{formData.all_price}}元</view> --> | ||
137 | + <view class="co-red">¥ {{param.goods_price}}元</view> | ||
138 | + </view> | ||
139 | + | ||
140 | + <view class="item" wx:else> | ||
141 | + <view>定金金额</view> | ||
142 | + <view class="co-red">¥ {{formData.all_price}}元</view> | ||
143 | + </view> | ||
144 | + | ||
145 | + <view class="item" wx:if="{{formData.shipping_price>0}}"> | ||
146 | + <view>配送费用</view> | ||
147 | + <view class="co-red">¥ {{formData.shipping_price}}元</view> | ||
148 | + </view> | ||
149 | + <view class="item" wx:if="{{formData.user_money>0}}"> | ||
150 | + <view>使用余额</view> | ||
151 | + <view class="co-red">- ¥ {{formData.user_money}}元</view> | ||
152 | + </view> | ||
153 | + | ||
154 | + </view> | ||
155 | + </view> | ||
156 | + | ||
157 | + <view class="btn-wrap"> | ||
158 | + <view class="pay-amount"> | ||
159 | + <view class="payable">应付金额:<text class="co-red">¥{{formData.order_amount}}</text></view> | ||
160 | + <!-- <view class="co-red big"></view> --> | ||
161 | + </view> | ||
162 | + <button class="tips-btn" formType="submit" id="submitOrder">提交订单</button> | ||
163 | + </view> | ||
164 | +</form> | ||
165 | + | ||
166 | +<!----弹起选择物流名的列表----> | ||
167 | +<view wx:if='{{open_express==1}}' > | ||
168 | + <view class="cover-layer flex-center " bindtap='close_express'> | ||
169 | + </view> | ||
170 | + | ||
171 | + <view class="cx-popup radius {{open_express==1?'up' : 'down'}}" > | ||
172 | + <view class="tops flex"> | ||
173 | + <view class="top-content fs32"> | ||
174 | + <view> | ||
175 | + 选择物流名字 | ||
176 | + </view> | ||
177 | + </view> | ||
178 | + <view class="close-frame" bindtap='close_express' > | ||
179 | + <view class="xc-close-express">×</view> | ||
180 | + </view> | ||
181 | + </view> | ||
182 | + <view class="express_list"> | ||
183 | + <view wx:for="{{wu_arr}}" wx:for-item="express_list" wx:for-index="idx"> | ||
184 | + <view class="express_list_frame" bindtap="click_express_name" | ||
185 | + data-shippingcode="{{express_list.shipping_code}}" | ||
186 | + data-name="{{express_list.name}}" data-idxe="{{idx}}"> | ||
187 | + | ||
188 | + <block wx:if="{{is_express==idx}}"> | ||
189 | + <view class="circle white xc-hook fs20 red-b"><text>Γ</text></view> | ||
190 | + </block> | ||
191 | + <block wx:else> | ||
192 | + <view class="circle xc-hooks"></view> | ||
193 | + </block> | ||
194 | + <view class="fs30">{{express_list.name}}</view> | ||
195 | + | ||
196 | + </view> | ||
197 | + </view> | ||
198 | + </view> | ||
199 | + <view class="flex click-buttem" > | ||
200 | + <view class="xc-determine flex-center" bindtap="determine_expres"> | ||
201 | + <view class="flex-vertical t-c">确定</view> | ||
202 | + </view> | ||
203 | + <view class="xc-confirms flex-center" bindtap="select_default_logistics"> | ||
204 | + <view class="flex-vertical t-c">设为默认</view> | ||
205 | + </view> | ||
206 | + </view> | ||
207 | + | ||
208 | + </view > | ||
209 | +</view> | ||
210 | + | ||
211 | +<warn id="warn"></warn> |
packageC/pages/luckyGo/luckyGo_cart_ct/luckyGo_cart_ct.wxss
0 → 100644
1 | +.bdr_t-14 { | ||
2 | + border-top-left-radius: 14rpx; | ||
3 | + border-top-right-radius: 14rpx; | ||
4 | +} | ||
5 | +.bdr_b-14 { | ||
6 | + border-bottom-left-radius: 14rpx; | ||
7 | + border-bottom-right-radius: 14rpx; | ||
8 | +} | ||
9 | +.bdr14 { | ||
10 | + border-radius: 14rpx; | ||
11 | +} | ||
12 | +.mgt20 { | ||
13 | + margin-top: 20rpx; | ||
14 | +} | ||
15 | +.shadow { | ||
16 | + box-shadow: 0 4rpx 12px #e7e9eb; | ||
17 | +} | ||
18 | +.shadow-1 { | ||
19 | + box-shadow: 16rpx 0px 12px #e7e9eb; | ||
20 | +} | ||
21 | + | ||
22 | + | ||
23 | +page { | ||
24 | + /* background-color: #FAFAFA; */ | ||
25 | + background-color: #F0F0F0; | ||
26 | + padding: 0 22rpx; | ||
27 | + box-sizing: border-box; | ||
28 | +} | ||
29 | +.container { | ||
30 | + background-color: #F0F0F0; | ||
31 | + /* padding-top: 28rpx; */ | ||
32 | + padding-bottom: 120rpx; | ||
33 | +} | ||
34 | +.user-mes { | ||
35 | + position: relative; | ||
36 | + background-color: #fff; | ||
37 | + font-size: 32rpx; | ||
38 | + color: #444; | ||
39 | + /* margin-top: 28rpx; */ | ||
40 | + border-radius: 14rpx; | ||
41 | +} | ||
42 | +.user-contact { | ||
43 | + padding: 24rpx 26rpx; | ||
44 | + font-weight: 600; | ||
45 | +} | ||
46 | + | ||
47 | +.location { | ||
48 | + position: relative; | ||
49 | + padding: 0 70rpx 24rpx; | ||
50 | +} | ||
51 | + | ||
52 | +.pos-icon { | ||
53 | + position: absolute; | ||
54 | + left: 28rpx; | ||
55 | + top: 6rpx; | ||
56 | + width: 30rpx; | ||
57 | + height: 36rpx; | ||
58 | +} | ||
59 | + | ||
60 | +.border-img { | ||
61 | + width: 100%; | ||
62 | + height: 12rpx; | ||
63 | +} | ||
64 | + | ||
65 | +.update-logistics { | ||
66 | + position: absolute; | ||
67 | + right: 0; | ||
68 | + top: 0; | ||
69 | + width: 80rpx; | ||
70 | + height: 100%; | ||
71 | + display: flex; | ||
72 | + align-items: center; | ||
73 | + justify-content: center; | ||
74 | +} | ||
75 | + | ||
76 | +.arrow-rigth { | ||
77 | + width: 32rpx; | ||
78 | + height: 32rpx; | ||
79 | +} | ||
80 | + | ||
81 | +.order-meg { | ||
82 | + margin-bottom: 20rpx; | ||
83 | + font-size: 28rpx; | ||
84 | + | ||
85 | +} | ||
86 | + | ||
87 | +.order-detail { | ||
88 | + padding: 30rpx 0; | ||
89 | + border-bottom: 2rpx solid #eee; | ||
90 | + color: #777; | ||
91 | + min-height: 190rpx; | ||
92 | + background-color: #fff; | ||
93 | + | ||
94 | +} | ||
95 | + | ||
96 | +.goods-img { | ||
97 | + float: left; | ||
98 | + width: 200rpx; | ||
99 | + height: 200rpx; | ||
100 | + margin: 0 20rpx; | ||
101 | +} | ||
102 | + | ||
103 | +.order-cont { | ||
104 | + float: left; | ||
105 | + width: 438rpx; | ||
106 | +} | ||
107 | + | ||
108 | +.goods-name { | ||
109 | + height: 74rpx; | ||
110 | + line-height: 40rpx; | ||
111 | + overflow: hidden; | ||
112 | + margin-bottom: 16rpx; | ||
113 | + font-size: 28rpx; | ||
114 | + color: #333; | ||
115 | + | ||
116 | +} | ||
117 | + | ||
118 | +.goods-color { | ||
119 | + font-size: 24rpx; | ||
120 | +} | ||
121 | + | ||
122 | +.order-num { | ||
123 | + margin-top: 25rpx; | ||
124 | + font-size: 24rpx; | ||
125 | + line-height: 42rpx; | ||
126 | +} | ||
127 | + | ||
128 | +.set-mes{ | ||
129 | + background-color: #fff; | ||
130 | + /* margin-top: 20rpx; */ | ||
131 | +} | ||
132 | +.use-item{ | ||
133 | + display: flex; | ||
134 | + align-items: center; | ||
135 | + height: 80rpx; | ||
136 | + /* border-bottom: 1px solid #ddd; */ | ||
137 | + font-size: 30rpx; | ||
138 | + /* width:95%; | ||
139 | +margin:auto; */ | ||
140 | + padding: 0 26rpx; | ||
141 | +} | ||
142 | +.use-item>view{ | ||
143 | + display: flex; | ||
144 | + /* margin-right: 12rpx; */ | ||
145 | +} | ||
146 | +.use-item.bfff{ | ||
147 | + background-color: #fff; | ||
148 | +} | ||
149 | +.use-item .dp{ | ||
150 | + display: block; | ||
151 | + width: 50rpx; | ||
152 | + height: 50rpx; | ||
153 | + margin-left: -6rpx; | ||
154 | +} | ||
155 | + | ||
156 | +.set-item { | ||
157 | + justify-content: space-between; | ||
158 | + background-color: #fff; | ||
159 | +} | ||
160 | + | ||
161 | +.set-btn { | ||
162 | + display: flex; | ||
163 | + font-size: 24rpx; | ||
164 | +} | ||
165 | + | ||
166 | +.set-mes input { | ||
167 | + width: 380rpx; | ||
168 | + height: 50rpx; | ||
169 | + line-height: 50rpx; | ||
170 | + border: 1px solid #ddd; | ||
171 | +} | ||
172 | + | ||
173 | +.use-btn { | ||
174 | + width: 100rpx; | ||
175 | + height: 50rpx; | ||
176 | + margin-left: 20rpx; | ||
177 | + line-height: 50rpx; | ||
178 | + text-align: center; | ||
179 | + background-color: #f23030; | ||
180 | + color: #fff; | ||
181 | +} | ||
182 | + | ||
183 | +.coupon-mes { | ||
184 | + /* box-sizing: border-box; */ | ||
185 | + height:95rpx; | ||
186 | + padding: 0 26rpx; | ||
187 | + background-color: #fff; | ||
188 | + font-size: 30rpx; | ||
189 | + color: #444; | ||
190 | + /* width: 100%; */ | ||
191 | + border-radius: 14rpx; | ||
192 | + margin-top: 20rpx; | ||
193 | + margin-bottom: 20rpx; | ||
194 | +} | ||
195 | + | ||
196 | +.coupon-title { | ||
197 | + display: flex; | ||
198 | + justify-content: space-between; | ||
199 | + align-items: center; | ||
200 | + height: 92rpx; | ||
201 | +} | ||
202 | + | ||
203 | +.coupon-title>view { | ||
204 | + display: flex; | ||
205 | +} | ||
206 | + | ||
207 | +.coupon-num { | ||
208 | + height: 36rpx; | ||
209 | + margin-left: 20rpx; | ||
210 | + padding: 0 16rpx; | ||
211 | + line-height: 36rpx; | ||
212 | + text-align: center; | ||
213 | + background-color: #f23030; | ||
214 | + color: #fff; | ||
215 | + font-size: 24rpx; | ||
216 | +} | ||
217 | + | ||
218 | +.leave-word { | ||
219 | + position: relative; | ||
220 | + font-size: 24rpx; | ||
221 | + margin-left: 20rpx; | ||
222 | + flex-grow: 1; | ||
223 | +} | ||
224 | + | ||
225 | +.word-box { | ||
226 | + font-size: 26rpx; | ||
227 | + /* width: 600rpx; */ | ||
228 | + padding: 10rpx; | ||
229 | + height: 28rpx; | ||
230 | + line-height: 40rpx; | ||
231 | +} | ||
232 | + | ||
233 | +.max-word { | ||
234 | + position: absolute; | ||
235 | + right: 0; | ||
236 | + bottom: 0; | ||
237 | +} | ||
238 | + | ||
239 | +.information { | ||
240 | + padding: 0 26rpx; | ||
241 | + background-color: #fff; | ||
242 | + /* margin-bottom: 120rpx; */ | ||
243 | +} | ||
244 | + | ||
245 | +.information .item { | ||
246 | + display: flex; | ||
247 | + justify-content: space-between; | ||
248 | + height: 60rpx; | ||
249 | + line-height: 60rpx; | ||
250 | + font-size: 26rpx; | ||
251 | + color: #777; | ||
252 | +} | ||
253 | + | ||
254 | +.btn-wrap { | ||
255 | + height: 94rpx; | ||
256 | + box-sizing: border-box; | ||
257 | + display: flex; | ||
258 | + justify-content: space-between; | ||
259 | + background-color: white; | ||
260 | + align-items: center; | ||
261 | + position: fixed; | ||
262 | + bottom: 0; | ||
263 | + left: 0; | ||
264 | + width: 100%; | ||
265 | + padding: 0 30rpx; | ||
266 | +} | ||
267 | + | ||
268 | +.tips-btn { | ||
269 | + /* float: right; | ||
270 | + width: 200rpx; | ||
271 | + height: 100rpx; | ||
272 | + line-height: 100rpx; | ||
273 | + text-align: center; | ||
274 | + font-size: 30rpx; | ||
275 | + color: #fff; | ||
276 | + background-color: #f23030; */ | ||
277 | + color: white; | ||
278 | + background-color: #FE4445; | ||
279 | + height: 72rpx; | ||
280 | + line-height: 72rpx; | ||
281 | + padding: 0 42rpx; | ||
282 | + border-radius: 36rpx; | ||
283 | + margin-left: 0; | ||
284 | + margin-right: 0; | ||
285 | +} | ||
286 | + | ||
287 | +.pay-amount { | ||
288 | + /* float: right; | ||
289 | + display: flex; | ||
290 | + align-items: center; | ||
291 | + height: 100rpx; | ||
292 | + font-size: 26rpx; | ||
293 | + margin-right: 40rpx; */ | ||
294 | +} | ||
295 | + | ||
296 | +.payable { | ||
297 | + color: #444; | ||
298 | + /* margin-right: 20rpx; */ | ||
299 | +} | ||
300 | + | ||
301 | +.shipping-modal { | ||
302 | + z-index: 20; | ||
303 | + position: fixed; | ||
304 | + bottom: 0; | ||
305 | + left: 0; | ||
306 | + right: 0; | ||
307 | + overflow-y: hidden; | ||
308 | + color: #666666; | ||
309 | + background-color: white; | ||
310 | +} | ||
311 | + | ||
312 | +.shipping-nav { | ||
313 | + text-align: center; | ||
314 | + font-size: 35rpx; | ||
315 | + padding-top: 30rpx; | ||
316 | +} | ||
317 | + | ||
318 | +.shipping-list { | ||
319 | + padding: 20rpx 30rpx 40rpx; | ||
320 | + font-size: 28rpx; | ||
321 | +} | ||
322 | + | ||
323 | +.shipping-item { | ||
324 | + display: block; | ||
325 | + padding: 20rpx 0; | ||
326 | +} | ||
327 | + | ||
328 | +.shipping-btn { | ||
329 | + width: 100%; | ||
330 | + color: white; | ||
331 | + background-color: #f23030; | ||
332 | + line-height: 90rpx; | ||
333 | + text-align: center; | ||
334 | + font-size: 40rpx; | ||
335 | +} | ||
336 | + | ||
337 | +/*----------nyf新增,地址---------*/ | ||
338 | +.add_new{ | ||
339 | + height: 90rpx; | ||
340 | + display: flex; | ||
341 | + align-items: center; | ||
342 | + padding: 0 26rpx; | ||
343 | +} | ||
344 | +.addr_jia{width: 45rpx; height: 45rpx; border: 1rpx solid #ddd; | ||
345 | + margin-right: 15rpx;vertical-align: middle;} | ||
346 | +.yu_er{ | ||
347 | + margin-left: 10rpx; | ||
348 | + /* margin-right: 60rpx; */ | ||
349 | +} | ||
350 | +.wuliu{margin-left: 20rpx;} | ||
351 | + | ||
352 | + | ||
353 | +/*---- 优惠券列表 -----*/ | ||
354 | +.xc-coupon-frame{ | ||
355 | + width: 100%; | ||
356 | + height: 92rpx; | ||
357 | + | ||
358 | +} | ||
359 | +.xc-coupon-frame .work-frame{ | ||
360 | + width: 100%; | ||
361 | + height: 100%; | ||
362 | + border-bottom:3rpx solid #eee; | ||
363 | + padding: 0 26rpx; | ||
364 | + background-color: white; | ||
365 | +} | ||
366 | +.xc-right{ | ||
367 | + width:20rpx; | ||
368 | + height:20rpx; | ||
369 | + border-top:2rpx solid #000; | ||
370 | + border-right:2rpx solid #000; | ||
371 | + transform:rotate(45deg); | ||
372 | + display:inline-block; | ||
373 | +} | ||
374 | + | ||
375 | +.xc-coupon-frame .work-frame .work{ font-size: 30rpx; line-height: 92rpx; } | ||
376 | +.xc-right-frame{font-size: 30rpx;line-height: 92rpx; margin-right: 10rpx } | ||
377 | + | ||
378 | +/* 自定义弹出窗口 */ | ||
379 | +.cx-popup{ | ||
380 | + width:100%; | ||
381 | + height:880rpx; | ||
382 | + background: #fff; | ||
383 | + z-index: 35; | ||
384 | + border-top-left-radius: 20rpx; | ||
385 | + border-top-right-radius: 20rpx; | ||
386 | + position:fixed; | ||
387 | + bottom:0; | ||
388 | + left: 0; | ||
389 | + /* padding-bottom: 25rpx; */ | ||
390 | +} | ||
391 | + | ||
392 | +.cx-popup .top{ | ||
393 | + width:95%; | ||
394 | + height:100rpx; | ||
395 | + border-bottom:3rpx solid #ddd; | ||
396 | + margin: auto; | ||
397 | + margin-top: 30rpx; | ||
398 | + | ||
399 | +} | ||
400 | +.xc-top-content{ | ||
401 | + width: 93%; | ||
402 | + height:85rpx; | ||
403 | + padding-top: 30rpx; | ||
404 | + font-size: 34rpx; | ||
405 | + font-weight: 600; | ||
406 | + | ||
407 | +} | ||
408 | + | ||
409 | + | ||
410 | +.xc-valid-coupon{ | ||
411 | + width: 90%; | ||
412 | + height:40rpx; | ||
413 | + padding-top: 24rpx; | ||
414 | + overflow: hidden; | ||
415 | +} | ||
416 | +.xc-frame{ | ||
417 | + width: 100%; | ||
418 | + height:60%; | ||
419 | +} | ||
420 | + | ||
421 | +.xc-frame .list-frame{ | ||
422 | + width: 95%; | ||
423 | + height: 100%; | ||
424 | + overflow-y:scroll; | ||
425 | + | ||
426 | +} | ||
427 | +.xc-close-frame{ | ||
428 | + margin-top:-10rpx; | ||
429 | + | ||
430 | +} | ||
431 | + | ||
432 | +.xc-close{ | ||
433 | + width: 37rpx; | ||
434 | +height: 37rpx; | ||
435 | +border-radius: 50%; | ||
436 | +border: 3rpx solid #333; | ||
437 | +text-align: center; | ||
438 | +line-height: 34rpx; | ||
439 | +font-size: 29rpx; | ||
440 | +color: #333; | ||
441 | + | ||
442 | +} | ||
443 | +.xc-money{ | ||
444 | + color: #af2346; | ||
445 | + font-size: 35rpx; | ||
446 | +} | ||
447 | + | ||
448 | +.xc-money-frame{ | ||
449 | + margin-left:35rpx; | ||
450 | + | ||
451 | +} | ||
452 | +.xc-coupon-effect{ | ||
453 | + width: 99%; | ||
454 | + min-height: 100rpx; | ||
455 | + border-bottom:3rpx solid #ddd; | ||
456 | + | ||
457 | + | ||
458 | +} | ||
459 | +.xc-goods-coupon{ | ||
460 | + width: 85%; | ||
461 | + height:100%; | ||
462 | + | ||
463 | +} | ||
464 | +.xc-title{ | ||
465 | + width:50%; | ||
466 | + margin-left:222rpx; | ||
467 | + | ||
468 | +} | ||
469 | +.xc-coupon-money0{ | ||
470 | + color: #c91e31; | ||
471 | + font-size: 35rpx; | ||
472 | + line-height: 40rpx; | ||
473 | + | ||
474 | +} | ||
475 | +.xc-coupon-money{ | ||
476 | + color: #c91e31; | ||
477 | + font-size: 35rpx; | ||
478 | + line-height: 40rpx; | ||
479 | + padding-top: 10px; | ||
480 | + | ||
481 | +} | ||
482 | +.xc-coupon-money1{ | ||
483 | + color: #444; | ||
484 | + font-size: 28rpx; | ||
485 | + line-height: 60rpx; | ||
486 | + | ||
487 | + | ||
488 | +} | ||
489 | +.xc-coupon-time{ | ||
490 | + height: 50rpx; | ||
491 | + font-size: 27rpx; | ||
492 | + color: #a4a4a4; | ||
493 | +} | ||
494 | +.xc-coupon-time .time{ | ||
495 | + margin-left: 15rpx; | ||
496 | + font-size: 27rpx; | ||
497 | +} | ||
498 | +.xc-coupon-selection{ | ||
499 | + height:100%; | ||
500 | +} | ||
501 | + | ||
502 | +.xc-confirm { | ||
503 | + width: 50%; | ||
504 | + border-radius: 50rpx; | ||
505 | + height: 80rpx; | ||
506 | + margin:0 auto; | ||
507 | + background:#d60021; | ||
508 | + color:#fff; | ||
509 | + font-size:28rpx; | ||
510 | + margin-top: 28rpx; | ||
511 | +} | ||
512 | + | ||
513 | +.up{ animation: up .7s; } | ||
514 | +.down{ animation: down 1s; } | ||
515 | +@keyframes up { 0% { transform: translateY(550rpx); } 100% { transform: translateY(0); } } | ||
516 | +@keyframes down { 0% { transform: translateY(0); } 100% { transform: translateY(550rpx); } } | ||
517 | + | ||
518 | +.xc-not-Selection{ | ||
519 | + width: 40rpx; | ||
520 | +height: 40rpx; | ||
521 | + background: #eeeeee; | ||
522 | +} | ||
523 | + | ||
524 | + | ||
525 | +.xc-close-express{ | ||
526 | + width: 40rpx; | ||
527 | +height: 40rpx; | ||
528 | +border-radius: 50%; | ||
529 | +border: 3rpx solid #333; | ||
530 | +text-align: center; | ||
531 | +font-size:32rpx; | ||
532 | +line-height: 38rpx; | ||
533 | +color: #333; | ||
534 | +margin-top: 5rpx; | ||
535 | +} | ||
536 | +.cx-popup .tops{ | ||
537 | + width: 100%; | ||
538 | +height: 145rpx; | ||
539 | +border-bottom: 3rpx solid #eee; | ||
540 | + | ||
541 | +} | ||
542 | +.top-content { | ||
543 | + width: 82%; | ||
544 | +padding-top: 33px; | ||
545 | +height: 100%; | ||
546 | +padding-left: 40rpx; | ||
547 | +} | ||
548 | +.close-frame{ | ||
549 | + margin-top: 30rpx; | ||
550 | + | ||
551 | +} | ||
552 | + | ||
553 | +.xc-hook { | ||
554 | +width: 33rpx; | ||
555 | +height: 33rpx; | ||
556 | +transform: rotate(-135deg); | ||
557 | +line-height: 35rpx; | ||
558 | +text-align: center; | ||
559 | +margin-right: 20rpx | ||
560 | + | ||
561 | + | ||
562 | +} | ||
563 | +.xc-hooks { | ||
564 | +width: 30rpx; | ||
565 | +height: 30rpx; | ||
566 | +border: 1rpx solid #999; | ||
567 | +margin-right: 20rpx; | ||
568 | +} | ||
569 | +.express_list_frame{ | ||
570 | + display: flex; | ||
571 | +height: 80rpx; | ||
572 | +align-items: center; | ||
573 | +padding-left: 40rpx; | ||
574 | +border-bottom: 1rpx solid #eee; | ||
575 | + | ||
576 | +} | ||
577 | +.express_list{ | ||
578 | + width: 100%; | ||
579 | + height: 65%; | ||
580 | + overflow-y: auto; | ||
581 | + margin-bottom: 40rpx; | ||
582 | + | ||
583 | +} | ||
584 | +.xc-confirms { | ||
585 | + box-sizing: border-box; | ||
586 | + width: 40%; | ||
587 | + border-radius: 50rpx; | ||
588 | + height: 80rpx; | ||
589 | + margin:0 auto; | ||
590 | + font-size:28rpx; | ||
591 | + background: #fff; | ||
592 | + color: #333; | ||
593 | + border: 2rpx solid #333; | ||
594 | +} | ||
595 | + | ||
596 | + | ||
597 | +/* 优惠券的改版样式 */ | ||
598 | +.xc-coupon-frame{ | ||
599 | + /* width: 710rpx; */ | ||
600 | + width: 100%; | ||
601 | + height:auto; | ||
602 | + margin: 0 auto; | ||
603 | + | ||
604 | +} | ||
605 | +.xc-coupon-frame .coupon-frame{ | ||
606 | + width: 100%; | ||
607 | + height: 200rpx; | ||
608 | + margin-top:10rpx; | ||
609 | + border-bottom: 1rpx solid #eee; | ||
610 | + | ||
611 | +} | ||
612 | +.xc-coupon-frame .coupon-frame .coupon-left{ | ||
613 | + width: 215rpx; | ||
614 | + height:100%; | ||
615 | + overflow: hidden; | ||
616 | +} | ||
617 | +.xc-money-frames{ | ||
618 | + width:96%; | ||
619 | + margin-top: -10px; | ||
620 | +} | ||
621 | + | ||
622 | +.xc-rmb-symbol{ | ||
623 | + font-size:40rpx; | ||
624 | + | ||
625 | +} | ||
626 | + | ||
627 | +.xc-rmb-val{ | ||
628 | + font-size:60rpx; | ||
629 | + | ||
630 | +} | ||
631 | +.coupon-explain{ | ||
632 | + font-size:25rpx; | ||
633 | +width:100%; | ||
634 | + | ||
635 | + | ||
636 | +} | ||
637 | +.xc-valuer{ | ||
638 | + margin-top:39rpx; | ||
639 | + margin-left:28rpx; | ||
640 | + font-size:25rpx; | ||
641 | +} | ||
642 | +.coupon-frame .oval{ | ||
643 | + width:155rpx; | ||
644 | + height:83rpx; | ||
645 | + border-radius: 50%; | ||
646 | + right:-78rpx; | ||
647 | + top:-37rpx; | ||
648 | +} | ||
649 | +.coupon-right{ | ||
650 | + /* width:490rpx; */ | ||
651 | + height: 99%; | ||
652 | + border-top: 1rpx solid #eaeaea; | ||
653 | + /* //border-bottom: 1rpx solid #eaeaea; */ | ||
654 | + border-right: 1rpx solid #eaeaea; | ||
655 | + flex-grow: 1; | ||
656 | +} | ||
657 | +.coupon-annotation{ | ||
658 | + width: 95%; | ||
659 | + height: 100%; | ||
660 | + | ||
661 | +} | ||
662 | +.xc-brand{ | ||
663 | + width:100rpx; | ||
664 | + height:35rpx; | ||
665 | + line-height: 35rpx; | ||
666 | + font-size:21rpx; | ||
667 | + border-radius:10rpx; position: relative; top:-1px; | ||
668 | + margin-right: 8rpx | ||
669 | +} | ||
670 | +.top-frame{ | ||
671 | + width:82%; | ||
672 | + height: 75rpx; | ||
673 | + margin-top:10rpx; | ||
674 | +} | ||
675 | +.top-frame .coupon-wode{ | ||
676 | + font-size: 25rpx; | ||
677 | + margin-left:10rpx; | ||
678 | + width:340rpx; | ||
679 | + height:88rpx; | ||
680 | +} | ||
681 | +.coupon-code{ | ||
682 | + width:60rpx; | ||
683 | + height:60rpx; | ||
684 | + margin-top:5rpx; | ||
685 | + | ||
686 | +} | ||
687 | +.frame{ | ||
688 | + width: 100% | ||
689 | +} | ||
690 | +.coupon-time{ | ||
691 | + font-size: 23rpx; | ||
692 | + line-height:33rpx; | ||
693 | + color: #333; | ||
694 | +} | ||
695 | + | ||
696 | +.clik-get{ | ||
697 | + width:125rpx; | ||
698 | + height:45rpx; | ||
699 | + border-radius: 25rpx; | ||
700 | + line-height: 45rpx; | ||
701 | + font-size:25rpx; | ||
702 | + bottom:67rpx; | ||
703 | + right:6px; | ||
704 | +} | ||
705 | + | ||
706 | +.code-img{ | ||
707 | + margin-left:20rpx; | ||
708 | +} | ||
709 | +.bottmo-explain{ | ||
710 | +top:145rpx; | ||
711 | +width:94%; | ||
712 | +border-top:1rpx dashed #eee; | ||
713 | +padding-top:8rpx; | ||
714 | +height:38rpx; | ||
715 | +line-height: 51rpx; | ||
716 | + | ||
717 | +} | ||
718 | +.font-word{ | ||
719 | + font-size: 22rpx; | ||
720 | +} | ||
721 | +.circle-size{ | ||
722 | + background: #a0a0a0; | ||
723 | + width: 27rpx; | ||
724 | + height: 27rpx; | ||
725 | + margin-top:13rpx; | ||
726 | +margin-left:8rpx; | ||
727 | +display: flex; | ||
728 | + | ||
729 | +align-items: center; | ||
730 | +} | ||
731 | +.xc-jiantou{ | ||
732 | + /* width: 9rpx; | ||
733 | + height: 9rpx; */ | ||
734 | + /* border-top: 2rpx solid #fff; | ||
735 | + border-right: 2rpx solid #fff; */ | ||
736 | + transform: rotate(-90deg); | ||
737 | + color: #fff; | ||
738 | + font-size: 15rpx; | ||
739 | + /* display:inline-block; | ||
740 | + margin-top: 6.5rpx; */ | ||
741 | + text-align: center; | ||
742 | +width: 24rpx; | ||
743 | +} | ||
744 | +.xc-buttom{ | ||
745 | + box-sizing: border-box; | ||
746 | + width:100%; | ||
747 | + min-height:76rpx; | ||
748 | + height:auto; | ||
749 | + line-height:40rpx; | ||
750 | + border-left:1rpx solid #eee; | ||
751 | + border-right:1rpx solid #eee; | ||
752 | + border-bottom:1rpx solid #eee; | ||
753 | +/* margin-left: 6rpx; */ | ||
754 | +} | ||
755 | + | ||
756 | +.goods-num{ | ||
757 | + font-size: 28rpx; | ||
758 | + color: #333; | ||
759 | +} | ||
760 | + | ||
761 | +.explain-coupon{ | ||
762 | + font-size:25rpx; | ||
763 | + padding: 10rpx 10rpx | ||
764 | +} | ||
765 | +.circle-frame{ | ||
766 | + width: 20rpx; | ||
767 | + height: auto; | ||
768 | + z-index:1; | ||
769 | + left:210rpx; | ||
770 | + | ||
771 | +} | ||
772 | +.circle-sawtooth{ | ||
773 | + width: 11rpx; | ||
774 | + height: 11rpx; | ||
775 | + background: #fff; | ||
776 | +} | ||
777 | + | ||
778 | +.red{background-color: #fe7496;} | ||
779 | +.green{ background-color: #22c7c1;} | ||
780 | +.blue{background-color:#5e82e3;} | ||
781 | +.g_gray{background-color: #aaaaaa} | ||
782 | + | ||
783 | +.f_text{text-align: center; height:96rpx; } | ||
784 | +.xc-hook.sn { | ||
785 | + margin-top:12%; | ||
786 | +width:45rpx; | ||
787 | +height:45rpx; | ||
788 | +font-size:28rpx; | ||
789 | +line-height:44rpx; | ||
790 | + | ||
791 | + | ||
792 | +} | ||
793 | +.xc-hooks.on{ | ||
794 | + margin-top:12%; | ||
795 | +width:42rpx; | ||
796 | +height:42rpx; | ||
797 | +} | ||
798 | +.may_use_coupon{ | ||
799 | + /* width: 95%; */ | ||
800 | + /* height: 68rpx; */ | ||
801 | + line-height:78rpx; | ||
802 | + padding: 0 26rpx; | ||
803 | + justify-content: space-between; | ||
804 | + align-items: center; | ||
805 | +} | ||
806 | +.determine-frame{ | ||
807 | + width: 100%; | ||
808 | + height: 130rpx; | ||
809 | + | ||
810 | +} | ||
811 | +.xc-determine{ | ||
812 | + height: 80rpx; | ||
813 | + width: 40%; | ||
814 | + border-radius: 50rpx; | ||
815 | +background: #d60021; | ||
816 | +color: #fff; | ||
817 | +font-size: 28rpx; | ||
818 | +margin: 0 auto; | ||
819 | + | ||
820 | +} | ||
821 | +.click-buttem{ | ||
822 | +width: 90%; | ||
823 | +margin: auto; | ||
824 | +} | ||
825 | +.logistics-name{ | ||
826 | + margin-right:20rpx; | ||
827 | +} | ||
828 | +.xc-border{ | ||
829 | + border-top:8rpx solid #eee; | ||
830 | +width: 100% | ||
831 | +} | ||
832 | +.main-top{ | ||
833 | +margin-top: 20rpx; | ||
834 | + | ||
835 | +} | ||
836 | +.xc-hookts{ | ||
837 | +border: 1rpx solid #999; | ||
838 | + | ||
839 | +} | ||
840 | +.xc-hookts.on{ | ||
841 | + width:30rpx; | ||
842 | +height:30rpx; | ||
843 | + | ||
844 | +} | ||
845 | +.xc-hookt.sn{ | ||
846 | + width: 32rpx; | ||
847 | +height: 32rpx; | ||
848 | +font-size: 28rpx; | ||
849 | +line-height: 34rpx; | ||
850 | +} | ||
851 | +.xc-hookt{ | ||
852 | + transform: rotate(-135deg); | ||
853 | +text-align: center; | ||
854 | + | ||
855 | +} | ||
856 | +.main-bottom{ | ||
857 | + margin-bottom: 20rpx; | ||
858 | + | ||
859 | +} | ||
860 | +.xc-hookst{ | ||
861 | + border: 1rpx solid #999; | ||
862 | + | ||
863 | +} | ||
864 | +.xc-hookst.ons{ | ||
865 | + width: 42rpx; | ||
866 | +height: 42rpx; | ||
867 | +margin-left: 20rpx; | ||
868 | + | ||
869 | +} | ||
870 | +.is_use_coupon{ | ||
871 | + width: 65%; | ||
872 | +justify-content: flex-end; | ||
873 | +padding-top: 10rpx; | ||
874 | + | ||
875 | + | ||
876 | +} | ||
877 | +.xc-hooka{ | ||
878 | + transform: rotate(-135deg); | ||
879 | +text-align: center; | ||
880 | + | ||
881 | +} | ||
882 | +.xc-hooka.sn{ | ||
883 | + width: 45rpx; | ||
884 | +height: 45rpx; | ||
885 | +font-size: 28rpx; | ||
886 | +line-height: 44rpx; | ||
887 | +margin-left: 20rpx; | ||
888 | + | ||
889 | +} | ||
890 | +.color-gray{ | ||
891 | + color: #808080; | ||
892 | +} | ||
893 | +.n_guige{ display: inline-block; background:rgb(236, 236, 236); color: rgb(63,63,63); padding: 3rpx 10rpx; border-radius: 3rpx } | ||
894 | +.gift_image{ width: 60rpx; height: 60rpx; position: absolute; top: 0; left: 0} | ||
895 | + | ||
896 | +.quan_num_show{ padding: 4rpx 6rpx; background-color:#ea5551; color:#fff; border-radius: 6rpx;margin-left:10rpx;font-size:24rpx;} | ||
897 | + | ||
898 | +.navigator-hover { | ||
899 | + background: none; | ||
900 | + opacity: 1; | ||
901 | +} | ||
902 | + | ||
903 | +.plus_buy{ | ||
904 | + background-color: #fff; | ||
905 | + margin:15rpx 0; | ||
906 | + padding: 20rpx 10rpx; | ||
907 | + position: relative; | ||
908 | +} | ||
909 | + | ||
910 | + | ||
911 | +.card_bg { | ||
912 | + box-sizing: border-box; | ||
913 | + padding: 2rpx 10rpx; | ||
914 | + height: 28rpx; | ||
915 | + border-radius: 26rpx; | ||
916 | + font-size: 18rpx; | ||
917 | + line-height: 28rpx; | ||
918 | + max-width: 210rpx; | ||
919 | + background: #333; | ||
920 | + color: #fff; | ||
921 | + margin-left: 8rpx; | ||
922 | + position:relative; | ||
923 | + top:7rpx; | ||
924 | +} | ||
925 | + | ||
926 | +.card_bg image { | ||
927 | + width: 19rpx; | ||
928 | + height: 19rpx; | ||
929 | + margin-right: 8rpx; | ||
930 | +} | ||
931 | + | ||
932 | +/* .card_bg .card_name { | ||
933 | + max-width: 76rpx; | ||
934 | + width: auto; | ||
935 | + overflow: hidden; | ||
936 | + white-space: nowrap; | ||
937 | +} */ | ||
938 | + | ||
939 | +.card_name { | ||
940 | + position: relative; | ||
941 | + top: -4rpx; | ||
942 | + margin-left: 6px; | ||
943 | +} | ||
944 | + | ||
945 | +.car_tri_up { | ||
946 | + width: 0;height: 0; | ||
947 | + border-left: 20rpx solid transparent; | ||
948 | + border-right: 20rpx solid transparent; | ||
949 | + border-bottom: 20rpx solid #fff; | ||
950 | + position: absolute; | ||
951 | + right: 20rpx; | ||
952 | + top:-10rpx | ||
953 | +} | ||
954 | +.card_op{ | ||
955 | + position: absolute; | ||
956 | + right: 20rpx; | ||
957 | + top:36rpx | ||
958 | +} | ||
959 | + | ||
960 | + | ||
961 | +.tab-container { | ||
962 | + font-size: 28rpx; | ||
963 | + margin-top: 20rpx; | ||
964 | + display: flex; | ||
965 | +} | ||
966 | + | ||
967 | +.tab-wrapper { | ||
968 | + background-color: #ccc; | ||
969 | + display: flex; | ||
970 | + border-radius: 40rpx; | ||
971 | + overflow: hidden; | ||
972 | +} | ||
973 | + | ||
974 | +.tab { | ||
975 | + padding: 20rpx 30rpx; | ||
976 | + | ||
977 | +} | ||
978 | + | ||
979 | + | ||
980 | +.tab.active { | ||
981 | + background-color: white; | ||
982 | + border-radius: 40rpx; | ||
983 | +} |
packageC/pages/luckyGo/luckyGo_details/luckyGo_details.js
@@ -343,9 +343,9 @@ Page({ | @@ -343,9 +343,9 @@ Page({ | ||
343 | 343 | ||
344 | wx.hideLoading(); | 344 | wx.hideLoading(); |
345 | 345 | ||
346 | - wx.setNavigationBarTitle({ | ||
347 | - title: "拼团详情", | ||
348 | - }); | 346 | + // wx.setNavigationBarTitle({ |
347 | + // title: "拼团详情", | ||
348 | + // }); | ||
349 | 349 | ||
350 | // ee.countDown2(); | 350 | // ee.countDown2(); |
351 | 351 |
packageC/pages/luckyGo/luckyGo_goodsInfo/buy_pt.wxml
@@ -195,7 +195,7 @@ | @@ -195,7 +195,7 @@ | ||
195 | <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999">库存不足</view> | 195 | <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999">库存不足</view> |
196 | </block> | 196 | </block> |
197 | <block wx:else> | 197 | <block wx:else> |
198 | - <view bindtap="addCart" class="spec-cart-btn spec-buy" data-action="buy">立即购买</view> | 198 | + <view bindtap="addCart_pt" class="spec-cart-btn spec-buy" data-action="buy">立即购买</view> |
199 | </block> | 199 | </block> |
200 | 200 | ||
201 | </block> | 201 | </block> |
@@ -212,7 +212,7 @@ | @@ -212,7 +212,7 @@ | ||
212 | <view class="spec-cart-btn spec-buy w100" style="background-color: #dcdcdc;color: #999;">配送不匹配</view> | 212 | <view class="spec-cart-btn spec-buy w100" style="background-color: #dcdcdc;color: #999;">配送不匹配</view> |
213 | </block> | 213 | </block> |
214 | <block wx:else> | 214 | <block wx:else> |
215 | - <view bindtap="addCart" class="spec-cart-btn spec-buy w100" data-action="buy">确定</view> | 215 | + <view bindtap="addCart_pt" class="spec-cart-btn spec-buy w100" data-action="buy">确定</view> |
216 | </block> | 216 | </block> |
217 | </block> | 217 | </block> |
218 | 218 |
packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.js
@@ -303,7 +303,7 @@ Page({ | @@ -303,7 +303,7 @@ Page({ | ||
303 | prom_id, | 303 | prom_id, |
304 | }); | 304 | }); |
305 | } | 305 | } |
306 | - console.log('type********>>',this.data.prom_type); | 306 | + // console.log('type********>>',this.data.prom_type); |
307 | //-- 自定义海报 -- | 307 | //-- 自定义海报 -- |
308 | // getApp().request.promiseGet("/api/weshop/goods/poster/page", { | 308 | // getApp().request.promiseGet("/api/weshop/goods/poster/page", { |
309 | // data: { store_id: os.stoid, type: 1, is_use: 1 } | 309 | // data: { store_id: os.stoid, type: 1, is_use: 1 } |
@@ -448,7 +448,6 @@ Page({ | @@ -448,7 +448,6 @@ Page({ | ||
448 | var user = getApp().globalData.userInfo; | 448 | var user = getApp().globalData.userInfo; |
449 | if (!user) return false; | 449 | if (!user) return false; |
450 | clearInterval(ti); | 450 | clearInterval(ti); |
451 | - | ||
452 | if (user.card_field && user['card_expiredate']) { | 451 | if (user.card_field && user['card_expiredate']) { |
453 | var str = user['card_expiredate'].replace(/-/g, '/'); | 452 | var str = user['card_expiredate'].replace(/-/g, '/'); |
454 | var end = new Date(str); | 453 | var end = new Date(str); |
@@ -1198,18 +1197,20 @@ Page({ | @@ -1198,18 +1197,20 @@ Page({ | ||
1198 | open_ind_store: ind | 1197 | open_ind_store: ind |
1199 | }); | 1198 | }); |
1200 | //如果是秒杀的话,要看redis够不够 | 1199 | //如果是秒杀的话,要看redis够不够 |
1201 | - if (this.data.prom_type == 1) { | ||
1202 | - this.getactLen(function (num) { | ||
1203 | - if (num < th.data.goodsInputNum) { | ||
1204 | - getApp().my_warnning("秒杀库存不足!", 0, th); | ||
1205 | - return false; | ||
1206 | - } else { | ||
1207 | - th.add_cart_func(t); | ||
1208 | - } | ||
1209 | - }); | ||
1210 | - } else { | ||
1211 | - th.add_cart_func(t); | ||
1212 | - } | 1200 | + // if (this.data.prom_type == 1) { |
1201 | + // this.getactLen(function (num) { | ||
1202 | + // if (num < th.data.goodsInputNum) { | ||
1203 | + // getApp().my_warnning("秒杀库存不足!", 0, th); | ||
1204 | + // return false; | ||
1205 | + // } else { | ||
1206 | + // th.add_cart_func(t); | ||
1207 | + // } | ||
1208 | + // }); | ||
1209 | + // } else { | ||
1210 | + // th.add_cart_func(t); | ||
1211 | + // } | ||
1212 | + | ||
1213 | + th.add_cart_func(t); | ||
1213 | }, | 1214 | }, |
1214 | 1215 | ||
1215 | 1216 | ||
@@ -1662,13 +1663,13 @@ Page({ | @@ -1662,13 +1663,13 @@ Page({ | ||
1662 | switch (condition_t) { | 1663 | switch (condition_t) { |
1663 | case 0: //按钱 | 1664 | case 0: //按钱 |
1664 | if (newd.goods_price >= condition_t) { | 1665 | if (newd.goods_price >= condition_t) { |
1665 | - newd.prom_type = 3; | 1666 | + newd.prom_type = 9; |
1666 | newd.prom_id = prom_d[i].prom_id; | 1667 | newd.prom_id = prom_d[i].prom_id; |
1667 | } | 1668 | } |
1668 | break | 1669 | break |
1669 | case 1://按购买数量 | 1670 | case 1://按购买数量 |
1670 | if (newd.goods_num >= condition_t) { | 1671 | if (newd.goods_num >= condition_t) { |
1671 | - newd.prom_type = 3; | 1672 | + newd.prom_type = 9; |
1672 | newd.prom_id = prom_d[i].prom_id; | 1673 | newd.prom_id = prom_d[i].prom_id; |
1673 | } | 1674 | } |
1674 | break; | 1675 | break; |
@@ -1707,6 +1708,7 @@ Page({ | @@ -1707,6 +1708,7 @@ Page({ | ||
1707 | // this.data.shippingCost < 0 || this.data.select.stock <= 0 || (Object.assign(e, { | 1708 | // this.data.shippingCost < 0 || this.data.select.stock <= 0 || (Object.assign(e, { |
1708 | // action: "buy_now" | 1709 | // action: "buy_now" |
1709 | // }), | 1710 | // }), |
1711 | + var th = this; | ||
1710 | this.setData({ | 1712 | this.setData({ |
1711 | openSpecModal: 0, | 1713 | openSpecModal: 0, |
1712 | openSpecModal_inte: 0, | 1714 | openSpecModal_inte: 0, |
@@ -1714,34 +1716,42 @@ Page({ | @@ -1714,34 +1716,42 @@ Page({ | ||
1714 | openSpecModal_pt: 0, | 1716 | openSpecModal_pt: 0, |
1715 | }) | 1717 | }) |
1716 | 1718 | ||
1717 | - if (e.prom_type == 9) { | ||
1718 | - s.set_b_now(e); | ||
1719 | - var url = "/packageC/pages/luckyGo/luckyGo_cart/luckyGo_cart?is_bnow=1&goods_id=" + e.goods_id; | ||
1720 | - getApp().goto(url); | ||
1721 | - } else { | 1719 | + // if (e.prom_type == 9) { |
1720 | + // s.set_b_now(e); | ||
1721 | + // // var url = ''; | ||
1722 | + // var url = "/pages/cart/cart2/cart2?is_bnow=1&goods_id=" + e.goods_id; | ||
1723 | + // getApp().goto(url); | ||
1724 | + // } else | ||
1725 | + | ||
1726 | + // if(e.prom_type == 9){ | ||
1727 | + if(true){ | ||
1722 | //要判断积分购的普通购买有没有参加优惠活动 | 1728 | //要判断积分购的普通购买有没有参加优惠活动 |
1723 | - if (e.is_integral_normal == 1) { | 1729 | + if (e.is_normal == 1) { |
1724 | this.check_nor_promgood(e.goods_id, function (res) { | 1730 | this.check_nor_promgood(e.goods_id, function (res) { |
1725 | if (res && res.cat_id) { | 1731 | if (res && res.cat_id) { |
1726 | - e.prom_type = 3; | ||
1727 | - e.prom_id = res.cat_id | 1732 | + e.prom_type = 0; |
1733 | + e.prom_id = res.cat_id; | ||
1728 | } | 1734 | } |
1729 | s.set_b_now(e); | 1735 | s.set_b_now(e); |
1730 | /*-- | 1736 | /*-- |
1731 | wx.redirectTo({ | 1737 | wx.redirectTo({ |
1732 | url: "/pages/cart/cart2/cart2?is_bnow=1&goods_id=" + e.goods_id, | 1738 | url: "/pages/cart/cart2/cart2?is_bnow=1&goods_id=" + e.goods_id, |
1733 | });--*/ | 1739 | });--*/ |
1734 | - getApp().goto("/packageC/pages/luckyGo/luckyGo_cart/luckyGo_cart?is_bnow=1&goods_id=" + e.goods_id) | 1740 | + |
1741 | + console.log('11111111111111111111111111======》'); | ||
1742 | + getApp().goto("/packageC/pages/luckyGo/luckyGo_cart/luckyGo_cart?is_bnow=1&goods_id=" + e.goods_id); | ||
1743 | + // getApp().goto("/packageC/pages/luckyGo/luckyGo_cart/luckyGo_cart?is_bnow=1&group_id=" + th.data.group_id +"&goods_id=" + e.goods_id + "&alert=" + th.data.luckGoInfo.lc_alert); | ||
1735 | 1744 | ||
1736 | }) | 1745 | }) |
1737 | } else { | 1746 | } else { |
1738 | - // console.log('xxxxxxxxxxxxx======》', this.data.prom_id); | ||
1739 | - s.set_b_now(e); | 1747 | + //console.log('222222222222222222222222222222======》'); |
1748 | + //s.set_b_now(e); | ||
1740 | /*-- | 1749 | /*-- |
1741 | wx.redirectTo({ | 1750 | wx.redirectTo({ |
1742 | url: "/pages/cart/cart2/cart2?is_bnow=1&goods_id=" + e.goods_id, | 1751 | url: "/pages/cart/cart2/cart2?is_bnow=1&goods_id=" + e.goods_id, |
1743 | });--*/ | 1752 | });--*/ |
1744 | - getApp().goto("/packageC/pages/luckyGo/luckyGo_cart/luckyGo_cart?is_bnow=1&group_id=" + this.data.group_id +"&goods_id=" + e.goods_id + "&alert=" + this.data.luckGoInfo.lc_alert); | 1753 | + //getApp().goto("/packageC/pages/luckyGo/luckyGo_cart_ct/luckyGo_cart_ct?is_bnow=1&goods_id=" + e.goods_id) |
1754 | + // getApp().goto("/packageC/pages/luckyGo/luckyGo_cart_ct/luckyGo_cart_ct?is_bnow=1&group_id=" + this.data.group_id +"&goods_id=" + e.goods_id + "&alert=" + this.data.luckGoInfo.lc_alert); | ||
1745 | } | 1755 | } |
1746 | 1756 | ||
1747 | } | 1757 | } |
@@ -3756,6 +3766,9 @@ Page({ | @@ -3756,6 +3766,9 @@ Page({ | ||
3756 | 3766 | ||
3757 | var th = this; | 3767 | var th = this; |
3758 | var ind = parseInt(e.currentTarget.dataset.ind); | 3768 | var ind = parseInt(e.currentTarget.dataset.ind); |
3769 | + | ||
3770 | + console.log('当前ind========>>>>', ind); | ||
3771 | + | ||
3759 | //ind == 1是普通购买 | 3772 | //ind == 1是普通购买 |
3760 | if (ind == 1) { | 3773 | if (ind == 1) { |
3761 | //如果拼单的sku data是空的,就要先获取一下 | 3774 | //如果拼单的sku data是空的,就要先获取一下 |
@@ -3845,18 +3858,17 @@ Page({ | @@ -3845,18 +3858,17 @@ Page({ | ||
3845 | 3858 | ||
3846 | //-----------------拼单生成方法--------------------- | 3859 | //-----------------拼单生成方法--------------------- |
3847 | addCart_pt: function () { | 3860 | addCart_pt: function () { |
3848 | - var th = this; | ||
3849 | if (this.data.is_normal == 0) { | 3861 | if (this.data.is_normal == 0) { |
3850 | //看一下有没有起购数,如果有起购数,要计算起购数 | 3862 | //看一下有没有起购数,如果有起购数,要计算起购数 |
3851 | - var qnum = parseFloat(th.data.prom_act.minbuynum); | ||
3852 | - if (qnum > 0 && th.data.goodsInputNum < qnum) { | ||
3853 | - getApp().confirmBox("拼团商品至少要买" + qnum + "件!"); | ||
3854 | - return false; | ||
3855 | - } | 3863 | + // var qnum = parseFloat(th.data.prom_act.minbuynum); |
3864 | + // if (qnum > 0 && th.data.goodsInputNum < qnum) { | ||
3865 | + // getApp().confirmBox("拼团商品至少要买" + qnum + "件!"); | ||
3866 | + // return false; | ||
3867 | + // } | ||
3856 | 3868 | ||
3857 | - th.addcart_pt_func(); | 3869 | + this.addcart_pt_func(); |
3858 | } else { | 3870 | } else { |
3859 | - th.addcart_pt_func(); | 3871 | + this.addcart_pt_func(); |
3860 | } | 3872 | } |
3861 | }, | 3873 | }, |
3862 | 3874 | ||
@@ -3868,73 +3880,75 @@ Page({ | @@ -3868,73 +3880,75 @@ Page({ | ||
3868 | var e = this, | 3880 | var e = this, |
3869 | th = e, | 3881 | th = e, |
3870 | o = this.data.sele_g; | 3882 | o = this.data.sele_g; |
3871 | - if (o.store_count <= 0) return s.my_warnning("库存已为空!", 0, th); | 3883 | + // if (o.store_count <= 0) return s.my_warnning("库存已为空!", 0, th); |
3872 | 3884 | ||
3873 | //----------添加到购物车时,要判断限购数量,-------- | 3885 | //----------添加到购物车时,要判断限购数量,-------- |
3874 | e.get_buy_num(o, async function (ee) { | 3886 | e.get_buy_num(o, async function (ee) { |
3875 | 3887 | ||
3876 | //---判断商品是否超出限购--- | 3888 | //---判断商品是否超出限购--- |
3877 | - if (th.data.g_buy_num != null && th.data.sele_g.viplimited > 0) { | ||
3878 | - if (th.data.goodsInputNum + th.data.g_buy_num.get(th.data.sele_g.goods_id) > th.data.sele_g.viplimited) { | ||
3879 | - wx.showModal({ | ||
3880 | - title: '提示', | ||
3881 | - content: '超出商品限购' | ||
3882 | - }); | ||
3883 | - | ||
3884 | - var num = th.data.prom_buy_limit - th.data.prom_buy_num; | ||
3885 | - if (num < 0) num = 0; | ||
3886 | - th.setData({ goodsInputNum: num }) | ||
3887 | - return false; | ||
3888 | - } | ||
3889 | - } | 3889 | + // if (th.data.g_buy_num != null && th.data.sele_g.viplimited > 0) { |
3890 | + // if (th.data.goodsInputNum + th.data.g_buy_num.get(th.data.sele_g.goods_id) > th.data.sele_g.viplimited) { | ||
3891 | + // wx.showModal({ | ||
3892 | + // title: '提示', | ||
3893 | + // content: '超出商品限购' | ||
3894 | + // }); | ||
3895 | + | ||
3896 | + // var num = th.data.prom_buy_limit - th.data.prom_buy_num; | ||
3897 | + // if (num < 0) num = 0; | ||
3898 | + // th.setData({ goodsInputNum: num }) | ||
3899 | + // return false; | ||
3900 | + // } | ||
3901 | + // } | ||
3902 | + | ||
3890 | //---判断商品是否超出活动限购,拼团的普通购买不计算活动的限购--- | 3903 | //---判断商品是否超出活动限购,拼团的普通购买不计算活动的限购--- |
3891 | - if (th.data.prom_buy_num != -1 && th.data.prom_buy_limit > 0 && th.data.is_normal != 1) { | ||
3892 | - if (th.data.goodsInputNum + th.data.prom_buy_num > th.data.prom_buy_limit) { | ||
3893 | - wx.showModal({ | ||
3894 | - title: '提示', | ||
3895 | - content: '超出商品活动限购' | ||
3896 | - }); | ||
3897 | - | ||
3898 | - var num = th.data.prom_buy_limit - th.data.prom_buy_num; | ||
3899 | - if (num < 0) num = 0; | ||
3900 | - th.setData({ goodsInputNum: num }) | ||
3901 | - return false; | ||
3902 | - } | ||
3903 | - } | 3904 | + // if (th.data.prom_buy_num != -1 && th.data.prom_buy_limit > 0 && th.data.is_normal != 1) { |
3905 | + // if (th.data.goodsInputNum + th.data.prom_buy_num > th.data.prom_buy_limit) { | ||
3906 | + // wx.showModal({ | ||
3907 | + // title: '提示', | ||
3908 | + // content: '超出商品活动限购' | ||
3909 | + // }); | ||
3910 | + | ||
3911 | + // var num = th.data.prom_buy_limit - th.data.prom_buy_num; | ||
3912 | + // if (num < 0) num = 0; | ||
3913 | + // th.setData({ goodsInputNum: num }) | ||
3914 | + // return false; | ||
3915 | + // } | ||
3916 | + // } | ||
3904 | 3917 | ||
3905 | var redis_num = 0 | 3918 | var redis_num = 0 |
3906 | //不是普通购买的时候 | 3919 | //不是普通购买的时候 |
3907 | - if (th.data.is_normal != 1) { | ||
3908 | - //-------判断活动是否抢光--------- | ||
3909 | - await getApp().request.promiseGet("/api/weshop/activitylist/getActLen/" + os.stoid + "/6/" + th.data.sele_g.prom_id, { | ||
3910 | - 1: 1 | ||
3911 | - }).then(res => { | ||
3912 | - redis_num = res.data.data; | ||
3913 | - }) | ||
3914 | - | ||
3915 | - if (th.data.goodsInputNum > redis_num) { | ||
3916 | - wx.showModal({ | ||
3917 | - title: '提示', | ||
3918 | - content: '超出商品活动库存' | ||
3919 | - }); | 3920 | + // if (th.data.is_normal != 1) { |
3921 | + // //-------判断活动是否抢光--------- | ||
3922 | + // await getApp().request.promiseGet("/api/weshop/activitylist/getActLen/" + os.stoid + "/6/" + th.data.sele_g.prom_id, { | ||
3923 | + // 1: 1 | ||
3924 | + // }).then(res => { | ||
3925 | + // redis_num = res.data.data; | ||
3926 | + // }) | ||
3927 | + | ||
3928 | + // if (th.data.goodsInputNum > redis_num) { | ||
3929 | + // wx.showModal({ | ||
3930 | + // title: '提示', | ||
3931 | + // content: '超出商品活动库存' | ||
3932 | + // }); | ||
3933 | + | ||
3934 | + // th.setData({ goodsInputNum: redis_num }) | ||
3935 | + | ||
3936 | + // return false; | ||
3937 | + // } | ||
3938 | + // } | ||
3920 | 3939 | ||
3921 | - th.setData({ goodsInputNum: redis_num }) | ||
3922 | - | ||
3923 | - return false; | ||
3924 | - } | ||
3925 | - } | ||
3926 | - | ||
3927 | - if (th.data.goodsInputNum <= 0) return s.my_warnning("商品数量不能为0", 0, th); | ||
3928 | - if (th.data.goodsInputNum > o.store_count) { | ||
3929 | - th.setData({ goodsInputNum: o.store_count }) | ||
3930 | - return s.my_warnning("超出商品库存", 0, th); | ||
3931 | - } | 3940 | + // if (th.data.goodsInputNum <= 0) return s.my_warnning("商品数量不能为0", 0, th); |
3941 | + // if (th.data.goodsInputNum > o.store_count) { | ||
3942 | + // th.setData({ goodsInputNum: o.store_count }) | ||
3943 | + // return s.my_warnning("超出商品库存", 0, th); | ||
3944 | + // } | ||
3932 | 3945 | ||
3933 | if (th.data.sto_sele_name == null || th.data.sto_sele_name == undefined) | 3946 | if (th.data.sto_sele_name == null || th.data.sto_sele_name == undefined) |
3934 | this.setData({ | 3947 | this.setData({ |
3935 | sto_sele_name: "" | 3948 | sto_sele_name: "" |
3936 | }); | 3949 | }); |
3937 | if (th.data.sto_sele_name == "") return s.my_warnning("请选择门店", 0, th); | 3950 | if (th.data.sto_sele_name == "") return s.my_warnning("请选择门店", 0, th); |
3951 | + | ||
3938 | //--------------此时操作的数据------------ | 3952 | //--------------此时操作的数据------------ |
3939 | var newd = { | 3953 | var newd = { |
3940 | goods_id: o.goods_id, | 3954 | goods_id: o.goods_id, |
@@ -4006,10 +4020,12 @@ Page({ | @@ -4006,10 +4020,12 @@ Page({ | ||
4006 | th.data.sto_sele_distr = 1; | 4020 | th.data.sto_sele_distr = 1; |
4007 | } | 4021 | } |
4008 | 4022 | ||
4009 | - } else if (th.data.prom_type == 3) { | ||
4010 | - newd.prom_type = 0; | ||
4011 | - newd.prom_id = 0; | ||
4012 | } | 4023 | } |
4024 | + | ||
4025 | + // else if (th.data.prom_type == 3) { | ||
4026 | + // newd.prom_type = 0; | ||
4027 | + // newd.prom_id = 0; | ||
4028 | + // } | ||
4013 | 4029 | ||
4014 | newd['pick_name'] = th.data.sto_sele_name; | 4030 | newd['pick_name'] = th.data.sto_sele_name; |
4015 | newd['pick_dis'] = th.data.sto_sele_distr; | 4031 | newd['pick_dis'] = th.data.sto_sele_distr; |
@@ -4020,21 +4036,27 @@ Page({ | @@ -4020,21 +4036,27 @@ Page({ | ||
4020 | //判断一下有没有全局优惠活动 | 4036 | //判断一下有没有全局优惠活动 |
4021 | th.check_nor_promgood(newd.goods_id, function (e) { | 4037 | th.check_nor_promgood(newd.goods_id, function (e) { |
4022 | if (e && e.act_id) { | 4038 | if (e && e.act_id) { |
4023 | - newd['prom_type'] = 3; | 4039 | + newd['prom_type'] = 0; |
4024 | newd['prom_id'] = e.act_id; | 4040 | newd['prom_id'] = e.act_id; |
4025 | } | 4041 | } |
4026 | - th.buyNow(newd) | ||
4027 | - }) | 4042 | + console.log('aaaaa'); |
4043 | + th.buyNow(newd); | ||
4044 | + }); | ||
4028 | } | 4045 | } |
4029 | - else th.buyNow_pt(newd); | 4046 | + else { |
4047 | + console.log('bbbb'); | ||
4048 | + th.buyNow_pt(newd); | ||
4049 | + }; | ||
4030 | }) | 4050 | }) |
4031 | }, | 4051 | }, |
4032 | //----------立即购买_pt----------- | 4052 | //----------立即购买_pt----------- |
4033 | buyNow_pt: function (e) { | 4053 | buyNow_pt: function (e) { |
4034 | s.set_b_now(e); | 4054 | s.set_b_now(e); |
4035 | wx.navigateTo({ | 4055 | wx.navigateTo({ |
4036 | - url: "/packageC/pages/luckyGo_cart/luckyGo_cart/luckyGo_cart?is_bnow=1&goods_id=" + e.goods_id, | 4056 | + url: "/packageC/pages/luckyGo/luckyGo_cart_ct/luckyGo_cart_ct?is_bnow=1&group_id=" + this.data.group_id +"&goods_id=" + e.goods_id + "&alert=" + this.data.luckGoInfo.lc_alert + '&goods_price=' + this.data.luckGoInfo.group_price/100, |
4037 | }); | 4057 | }); |
4058 | + | ||
4059 | + // getApp().goto("/packageC/pages/luckyGo/luckyGo_cart/luckyGo_cart?is_bnow=1&group_id=" + th.data.group_id +"&goods_id=" + e.goods_id + "&alert=" + th.data.luckGoInfo.lc_alert); | ||
4038 | }, | 4060 | }, |
4039 | 4061 | ||
4040 | //-------跳转pt商品------- | 4062 | //-------跳转pt商品------- |
packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.wxml
@@ -5,7 +5,7 @@ | @@ -5,7 +5,7 @@ | ||
5 | 5 | ||
6 | 6 | ||
7 | <!-- 商品内容区域,普通商品,秒杀,拼团 --> | 7 | <!-- 商品内容区域,普通商品,秒杀,拼团 --> |
8 | -<block> | 8 | +<block wx:if="{{isshow}}"> |
9 | <view class="container"> | 9 | <view class="container"> |
10 | <!-- 幸运购规则 --> | 10 | <!-- 幸运购规则 --> |
11 | <view class="rules" bindtap="showRules">规则</view> | 11 | <view class="rules" bindtap="showRules">规则</view> |
@@ -71,7 +71,35 @@ | @@ -71,7 +71,35 @@ | ||
71 | </block> | 71 | </block> |
72 | </view> | 72 | </view> |
73 | </view> | 73 | </view> |
74 | - <!-- --显示秒杀价,团购,积分购-- --> | 74 | + |
75 | + <!-- --显示秒杀价 --> | ||
76 | + <view class="prom_show rel" wx:if="{{prom_type==1}}"> | ||
77 | + <image class="secondkill-img" src='{{prom_st==1? iurl+"/miniapp/images/red_jx.png":iurl+"/miniapp/images/blue_ks.png"}}'></image> | ||
78 | + <image class="abs spike-img" src="{{iurl}}/miniapp/images/xsmiaosha.png"></image> | ||
79 | + <view class="stop fs26 abs" wx:if="{{prom_st==1}}">距活动结束还有</view> | ||
80 | + <view class="start fs26 abs" wx:if="{{prom_st==2}}">距活动开始还有</view> | ||
81 | + <view class="secview flex abs fs24 xc-miaosha-time"> | ||
82 | + <block wx:if="djs.day"> | ||
83 | + <view class='day-val' style="color:{{prom_st==1?'#d40022':'#0097e0'}}"> | ||
84 | + {{djs.day}} | ||
85 | + </view> | ||
86 | + <view class="day white" style="color: {{prom_st==1?'#d40022':'#0097e0'}}">天</view> | ||
87 | + </block> | ||
88 | + <view class='time-val white t-c' style=" background:{{prom_st==1?'#d40022':'#0097e0'}}"> | ||
89 | + {{djs.hou}} | ||
90 | + </view> | ||
91 | + <view class="time" style="color: {{prom_st==1?'#d40022':'#0097e0'}}">时</view> | ||
92 | + <view class='time-val white t-c' style=" background:{{prom_st==1?'#d40022':'#0097e0'}}"> | ||
93 | + {{djs.min}} | ||
94 | + </view> | ||
95 | + <view class="time" style="color: {{prom_st==1?'#d40022':'#0097e0'}}">分</view> | ||
96 | + <view class='time-val white t-c' style=";background:{{prom_st==1?'#d40022':'#0097e0'}}"> | ||
97 | + {{djs.sec}} | ||
98 | + </view> | ||
99 | + <view class="time" style="color: {{prom_st==1?'#d40022':'#0097e0'}}">秒</view> | ||
100 | + </view> | ||
101 | + </view> | ||
102 | + | ||
75 | 103 | ||
76 | 104 | ||
77 | <!-- --拼单-- --> | 105 | <!-- --拼单-- --> |
@@ -82,22 +110,15 @@ | @@ -82,22 +110,15 @@ | ||
82 | <view class="abs xc-qt-price"> | 110 | <view class="abs xc-qt-price"> |
83 | <view class="flex" style='height:40rpx; margin-top:5rpx'> | 111 | <view class="flex" style='height:40rpx; margin-top:5rpx'> |
84 | <view class="flex fs35 xc-qtsign">¥</view> | 112 | <view class="flex fs35 xc-qtsign">¥</view> |
85 | - <view class="fs50 val">{{filters.toFix(data.shop_price,2)}}</view> | 113 | + <!-- <view class="fs50 val">{{filters.toFix(data.shop_price,2)}}</view> --> |
114 | + <view class="fs50 val">{{filters.toFix(luckGoInfo.group_price/100,2)}}</view> | ||
86 | </view> | 115 | </view> |
87 | <view class="word-line fs20 xc-qtunit-price"> | 116 | <view class="word-line fs20 xc-qtunit-price"> |
88 | - 零售价¥{{filters.toFix(data.market_price,2)}} | 117 | + 手店价¥{{filters.toFix(data.shop_price,2)}} |
89 | </view> | 118 | </view> |
90 | </view> | 119 | </view> |
91 | 120 | ||
92 | - <!-- <view class="abs white xc-nanber"> | ||
93 | - <text class="fs22">已拼{{prom_act.buy_num}}件</text> | ||
94 | - <view class="flex" style='margin-top:-34rpx'> | ||
95 | - <view class="xc-people-img"> | ||
96 | - <image class="imgs" src="{{prom_st==1? iurl+'/miniapp/images/r_logo_red.png':iurl+'/miniapp/images/r_logo.png'}}"></image> | ||
97 | - </view> | ||
98 | - <view class="t-s fs20 xc-people-val">{{prom_act.ct_num}}人拼</view> | ||
99 | - </view> | ||
100 | - </view> --> | 121 | + |
101 | 122 | ||
102 | <!-- 幸运购 --> | 123 | <!-- 幸运购 --> |
103 | <view class="abs white xc-nanber"> | 124 | <view class="abs white xc-nanber"> |
@@ -883,13 +904,13 @@ | @@ -883,13 +904,13 @@ | ||
883 | <!-- 线上销售的时候,要判断库存量, 线下库存的时候不用判断 --> | 904 | <!-- 线上销售的时候,要判断库存量, 线下库存的时候不用判断 --> |
884 | <block wx:if="{{(sele_g.store_count>0 && sales_rules==1) || sales_rules==2 }}"> | 905 | <block wx:if="{{(sele_g.store_count>0 && sales_rules==1) || sales_rules==2 }}"> |
885 | <view class="btn-container f1"> | 906 | <view class="btn-container f1"> |
886 | - <view bindtap="openSpecModel_pt" data-ind="1" class="btn-yellow flex f1 fdc jc-center"> | ||
887 | - <view class="lh1"><text class="rmb lh1">{{filters.toFix(data.market_price,2)}}</text></view> | 907 | + <view bindtap="openSpecModel_pt" data-ind="1" data-it="1" class="btn-yellow flex f1 fdc jc-center"> |
908 | + <view class="lh1"><text class="rmb lh1">{{filters.toFix(data.shop_price,2)}}</text></view> | ||
888 | <view class="lh1 fs pdt4">单独购买</view> | 909 | <view class="lh1 fs pdt4">单独购买</view> |
889 | </view> | 910 | </view> |
890 | <!-- data-ind="2" --> | 911 | <!-- data-ind="2" --> |
891 | <!-- openSpecModel_pt --> | 912 | <!-- openSpecModel_pt --> |
892 | - <view class="btn-red f1 flex ai-center jc-center" bindtap="openSpecModel_pt" data-openSpecModal_ind="{{openSpecModal_ind}}" data-action="buy" data-ind="0">立即参团</view> | 913 | + <view class="btn-red f1 flex ai-center jc-center" bindtap="openSpecModel_pt"data-it="0">立即参团</view> |
893 | <!-- <view class="btn-red f1 flex ai-center jc-center" bindtap="addCart" data-openSpecModal_ind="{{openSpecModal_ind}}" data-action="buy">立即参团</view> --> | 914 | <!-- <view class="btn-red f1 flex ai-center jc-center" bindtap="addCart" data-openSpecModal_ind="{{openSpecModal_ind}}" data-action="buy">立即参团</view> --> |
894 | </view> | 915 | </view> |
895 | <!-- <view bindtap="openSpecModel" data-ind="1" class="btn-buy flex fdc jc-center"> | 916 | <!-- <view bindtap="openSpecModel" data-ind="1" class="btn-buy flex fdc jc-center"> |
@@ -919,27 +940,26 @@ | @@ -919,27 +940,26 @@ | ||
919 | </block> | 940 | </block> |
920 | </block> --> | 941 | </block> --> |
921 | <!-- -----拼单------ --> | 942 | <!-- -----拼单------ --> |
922 | - <block wx:if="{{prom_type == 6}}"> | 943 | + <!-- <block wx:if="{{prom_type == 6}}"> |
923 | <view bindtap="openSpecModel_pt" data-it="1" data-ind="1" class="join-btn cart-btn line-h"> | 944 | <view bindtap="openSpecModel_pt" data-it="1" data-ind="1" class="join-btn cart-btn line-h"> |
924 | <view class="fir-v"> | 945 | <view class="fir-v"> |
925 | - <!-- ¥{{data.shop_price,2)}} --> | ||
926 | <block wx:if="{{card_field && sele_g[card_field]>0}}"> | 946 | <block wx:if="{{card_field && sele_g[card_field]>0}}"> |
927 | {{filters.toFix(sele_g[card_field],2)}} | 947 | {{filters.toFix(sele_g[card_field],2)}} |
928 | </block> | 948 | </block> |
929 | <block wx:else>{{filters.toFix(sele_g.shop_price,2)}}</block> | 949 | <block wx:else>{{filters.toFix(sele_g.shop_price,2)}}</block> |
930 | </view> | 950 | </view> |
931 | <view>单独购买</view> | 951 | <view>单独购买</view> |
932 | - </view> | ||
933 | - <block wx:if="{{user_order_pt_state==0}}"> | 952 | + </view> --> |
953 | + <!-- <block wx:if="{{user_order_pt_state==0}}"> --> | ||
934 | <!-- --商家团-- --> | 954 | <!-- --商家团-- --> |
935 | - <view bindtap="openSpecModel_pt" data-it="0" wx:if="{{prom_st==1 && !prom_r_null && prom_act.kttype==1}}" class="buy-btn cart-btn line-h"> | 955 | + <!-- <view bindtap="openSpecModel_pt" data-it="0" wx:if="{{prom_st==1 && !prom_r_null && prom_act.kttype==1}}" class="buy-btn cart-btn line-h"> |
936 | <view class="fir-v">¥{{prom_act.price}}</view> | 956 | <view class="fir-v">¥{{prom_act.price}}</view> |
937 | <view>去参团</view> | 957 | <view>去参团</view> |
938 | - </view> | 958 | + </view> --> |
939 | <!-- --会员团-- --> | 959 | <!-- --会员团-- --> |
940 | - <view bindtap="openSpecModel_pt" data-it="0" wx:if="{{prom_st==1 && !prom_r_null && prom_act.kttype==2}}" class="buy-btn cart-btn line-h"> | 960 | + <!-- <view bindtap="openSpecModel_pt" data-it="0" wx:if="{{prom_st==1 && !prom_r_null && prom_act.kttype==2}}" class="buy-btn cart-btn line-h"> --> |
941 | <!-- <view class="fir-v">¥{{prom_act.price}}</view> --> | 961 | <!-- <view class="fir-v">¥{{prom_act.price}}</view> --> |
942 | - <view class="pd_top1" wx:if="{{prom_act.tz_yhjgtype>1}}"> | 962 | + <!-- <view class="pd_top1" wx:if="{{prom_act.tz_yhjgtype>1}}"> |
943 | <view>一键开团</view> | 963 | <view>一键开团</view> |
944 | <view wx:if="{{prom_act.tz_yhjgtype==3}}"> | 964 | <view wx:if="{{prom_act.tz_yhjgtype==3}}"> |
945 | 佣金 | 965 | 佣金 |
@@ -952,17 +972,17 @@ | @@ -952,17 +972,17 @@ | ||
952 | <view class="fir-v">¥{{ filters.toFix(prom_act.price,2)}}</view> | 972 | <view class="fir-v">¥{{ filters.toFix(prom_act.price,2)}}</view> |
953 | <view>一键开团</view> | 973 | <view>一键开团</view> |
954 | </view> | 974 | </view> |
955 | - </view> | 975 | + </view> --> |
956 | <!-- -阶梯团-- --> | 976 | <!-- -阶梯团-- --> |
957 | - <view bindtap="openSpecModel_pt" data-it="0" wx:if="{{prom_st==1 && !prom_r_null && prom_act.kttype==3 && user_order_pt_state!=3 }}" class="buy-btn cart-btn line-h"> | 977 | + <!-- <view bindtap="openSpecModel_pt" data-it="0" wx:if="{{prom_st==1 && !prom_r_null && prom_act.kttype==3 && user_order_pt_state!=3 }}" class="buy-btn cart-btn line-h"> |
958 | <view class="fir-v">¥{{filters.toFix(prom_act.yf_price,2)}}</view> | 978 | <view class="fir-v">¥{{filters.toFix(prom_act.yf_price,2)}}</view> |
959 | <view>支付定金</view> | 979 | <view>支付定金</view> |
960 | </view> | 980 | </view> |
961 | <view wx:if="{{prom_st==0}}" class="buy-btn cart-btn lanse">即将开始</view> | 981 | <view wx:if="{{prom_st==0}}" class="buy-btn cart-btn lanse">即将开始</view> |
962 | <view wx:if="{{prom_r_null}}" class="buy-btn cart-btn huise">已抢光</view> | 982 | <view wx:if="{{prom_r_null}}" class="buy-btn cart-btn huise">已抢光</view> |
963 | - <view wx:if="{{prom_st==3 && !prom_r_null}}" class="buy-btn cart-btn lanse">活动已经结束</view> | ||
964 | - </block> | ||
965 | - <block wx:else> | 983 | + <view wx:if="{{prom_st==3 && !prom_r_null}}" class="buy-btn cart-btn lanse">活动已经结束</view> --> |
984 | + <!-- </block> --> | ||
985 | + <!-- <block wx:else> | ||
966 | <view bindtap="go_to_nopay" wx:if="{{user_order_pt_state==1}}" class="buy-btn cart-btn huise"> | 986 | <view bindtap="go_to_nopay" wx:if="{{user_order_pt_state==1}}" class="buy-btn cart-btn huise"> |
967 | 您还未支付 | 987 | 您还未支付 |
968 | </view> | 988 | </view> |
@@ -972,10 +992,10 @@ | @@ -972,10 +992,10 @@ | ||
972 | <view wx:if="{{user_order_pt_state==3}}" bindtap="go_pay_wk" class="buy-btn cart-btn"> | 992 | <view wx:if="{{user_order_pt_state==3}}" bindtap="go_pay_wk" class="buy-btn cart-btn"> |
973 | 支付尾款 | 993 | 支付尾款 |
974 | </view> | 994 | </view> |
975 | - </block> | ||
976 | - </block> | 995 | + </block> --> |
996 | + <!-- </block> --> | ||
977 | <!-- -----积分购------ --> | 997 | <!-- -----积分购------ --> |
978 | - <block wx:if="{{prom_type == 4}}"> | 998 | + <!-- <block wx:if="{{prom_type == 4}}"> |
979 | <block wx:if="{{is_shopbuy}}"> | 999 | <block wx:if="{{is_shopbuy}}"> |
980 | <view bindtap="go_pay_integral_normal" class="join-btn cart-btn line-h"> | 1000 | <view bindtap="go_pay_integral_normal" class="join-btn cart-btn line-h"> |
981 | <view class="fir-v"> | 1001 | <view class="fir-v"> |
@@ -999,7 +1019,7 @@ | @@ -999,7 +1019,7 @@ | ||
999 | 积分不足 | 1019 | 积分不足 |
1000 | </view> | 1020 | </view> |
1001 | </block> | 1021 | </block> |
1002 | - </block> | 1022 | + </block> --> |
1003 | <!-- -<view bindtap="openSpecModel" class="buy-btn cart-btn cart-btn-lg" wx:else>立即兑换</view> --> | 1023 | <!-- -<view bindtap="openSpecModel" class="buy-btn cart-btn cart-btn-lg" wx:else>立即兑换</view> --> |
1004 | </view> | 1024 | </view> |
1005 | <!-- 制作一个圆球导航 --> | 1025 | <!-- 制作一个圆球导航 --> |
pages/cart/cart2_pt/cart2_pt.js
@@ -793,7 +793,7 @@ Page({ | @@ -793,7 +793,7 @@ Page({ | ||
793 | item=item.config; | 793 | item=item.config; |
794 | if (item == null) return o_shipping_price; | 794 | if (item == null) return o_shipping_price; |
795 | //------按重量---------- | 795 | //------按重量---------- |
796 | - if (goods_weight>0) { | 796 | + if (goods_weight>=0) { |
797 | fw_price =parseFloat(item['money']); | 797 | fw_price =parseFloat(item['money']); |
798 | if (goods_weight > item['first_weight']){ | 798 | if (goods_weight > item['first_weight']){ |
799 | var fw = goods_weight - item['first_weight']; | 799 | var fw = goods_weight - item['first_weight']; |
pages/giftpack/buygiftpack/giftpackbuy.js
@@ -25,7 +25,8 @@ Page({ | @@ -25,7 +25,8 @@ Page({ | ||
25 | curpage: 1, //当前分页数 | 25 | curpage: 1, //当前分页数 |
26 | pageSize: 10, //页大小 | 26 | pageSize: 10, //页大小 |
27 | total: 0, //总数量 | 27 | total: 0, //总数量 |
28 | - ad_data:null, | 28 | + ad_data:null, |
29 | + first_leader: e.globalData.first_leader || 0, // 推荐人ID | ||
29 | }, | 30 | }, |
30 | onLoad: function(options) { | 31 | onLoad: function(options) { |
31 | 32 | ||
@@ -91,7 +92,8 @@ Page({ | @@ -91,7 +92,8 @@ Page({ | ||
91 | "giftBagId": id, //礼包Id | 92 | "giftBagId": id, //礼包Id |
92 | "storeId": that.getStorageID, //商家Id | 93 | "storeId": that.getStorageID, //商家Id |
93 | "userId": that.getUserID, //用户ID | 94 | "userId": that.getUserID, //用户ID |
94 | - "buyFrom": 2 | 95 | + "buyFrom": 2, |
96 | + "first_leader": that.first_leader | ||
95 | }; | 97 | }; |
96 | 98 | ||
97 | //-- 分享导购要记录 -- | 99 | //-- 分享导购要记录 -- |
@@ -141,11 +143,13 @@ Page({ | @@ -141,11 +143,13 @@ Page({ | ||
141 | 143 | ||
142 | 144 | ||
143 | }, | 145 | }, |
146 | + // 积分兑换 | ||
144 | GetBuyIntegral: function(e) { | 147 | GetBuyIntegral: function(e) { |
145 | var that = this.data; | 148 | var that = this.data; |
146 | var th = this; | 149 | var th = this; |
147 | var id = e.currentTarget.dataset.id; //活动id | 150 | var id = e.currentTarget.dataset.id; //活动id |
148 | var my_confirm = th.selectComponent("#my_confirm"); //组件的id | 151 | var my_confirm = th.selectComponent("#my_confirm"); //组件的id |
152 | + | ||
149 | my_confirm.open( | 153 | my_confirm.open( |
150 | "是否确定兑换该礼包", | 154 | "是否确定兑换该礼包", |
151 | "取消", | 155 | "取消", |
@@ -162,9 +166,11 @@ Page({ | @@ -162,9 +166,11 @@ Page({ | ||
162 | "giftBagId": id, //礼包Id | 166 | "giftBagId": id, //礼包Id |
163 | "storeId": that.getStorageID, //商家Id | 167 | "storeId": that.getStorageID, //商家Id |
164 | "userId": that.getUserID, //用户ID | 168 | "userId": that.getUserID, //用户ID |
165 | - "buyFrom": 2 | 169 | + "buyFrom": 2, |
170 | + "first_leader": that.first_leader | ||
166 | }; | 171 | }; |
167 | - | 172 | + |
173 | + | ||
168 | //-- 分享导购要记录 -- | 174 | //-- 分享导购要记录 -- |
169 | if(getApp().globalData.guide_id){ | 175 | if(getApp().globalData.guide_id){ |
170 | json.guide_id=getApp().globalData.guide_id; | 176 | json.guide_id=getApp().globalData.guide_id; |
@@ -309,7 +315,8 @@ Page({ | @@ -309,7 +315,8 @@ Page({ | ||
309 | path:pagePath, | 315 | path:pagePath, |
310 | } | 316 | } |
311 | }, | 317 | }, |
312 | - | 318 | + |
319 | + // 分享朋友圈 | ||
313 | onShareTimeline() { | 320 | onShareTimeline() { |
314 | var curPage=this; | 321 | var curPage=this; |
315 | var pagePath = curPage.route; //当前页面url | 322 | var pagePath = curPage.route; //当前页面url |
pages/user/index/index.js
@@ -652,7 +652,8 @@ Page({ | @@ -652,7 +652,8 @@ Page({ | ||
652 | getApp().goto("/pages/user/user_fw/user_fw?gradeId=" + th.data.gradeId + "&FormId=" + item.Id); | 652 | getApp().goto("/pages/user/user_fw/user_fw?gradeId=" + th.data.gradeId + "&FormId=" + item.Id); |
653 | break; | 653 | break; |
654 | case "03": | 654 | case "03": |
655 | - getApp().goto("/pages/user/user_spsy/user_spsy"); | 655 | + getApp().goto("/pages/user/user_spsy/user_spsy?img=" + |
656 | + url + "&gradeId=" + th.data.gradeId + "&FormId=" + item.Id); | ||
656 | break; | 657 | break; |
657 | case "10": | 658 | case "10": |
658 | getApp().request.get("/api/weshop/users/grade/vipprivilegelist/other/get", { | 659 | getApp().request.get("/api/weshop/users/grade/vipprivilegelist/other/get", { |
pages/user/plus/plus.js
1 | var t = getApp(), | 1 | var t = getApp(), |
2 | a = t.request, | 2 | a = t.request, |
3 | - o = t.globalData.setting, | 3 | + o = t.globalData.setting, |
4 | os = o, | 4 | os = o, |
5 | i = require("../../../utils/util.js"), | 5 | i = require("../../../utils/util.js"), |
6 | ut = i, | 6 | ut = i, |
7 | s = require("../../../utils/common.js"), | 7 | s = require("../../../utils/common.js"), |
8 | - w = require("../../../utils/wxParse/wxParse.js"),t_pay = require("../../../utils/pay2.js"); | ||
9 | - var regeneratorRuntime = require('../../../utils/runtime.js'); | 8 | + w = require("../../../utils/wxParse/wxParse.js"), |
9 | + t_pay = require("../../../utils/pay2.js"); | ||
10 | +var regeneratorRuntime = require('../../../utils/runtime.js'); | ||
10 | 11 | ||
11 | Page({ | 12 | Page({ |
12 | /** | 13 | /** |
@@ -19,24 +20,24 @@ Page({ | @@ -19,24 +20,24 @@ Page({ | ||
19 | screenheight: 0, | 20 | screenheight: 0, |
20 | canvasHidden: true, | 21 | canvasHidden: true, |
21 | shareImgPath: null, | 22 | shareImgPath: null, |
22 | - is_plusCard: "",//卡的列表 | 23 | + is_plusCard: "", //卡的列表 |
23 | imagePath: "", | 24 | imagePath: "", |
24 | - is_pulscardname: "",//plus会员的名字 | ||
25 | - is_card: 0,//用于判断是否是续费页和购买页面 0不是PLUS会员 | ||
26 | - content: "",//等级卡规则 | ||
27 | - is_card_rule: "",//等级卡规则判断用 | ||
28 | - is_show: 0, //页面要加载完才能显示 | ||
29 | - open_yq: 0, //显示打开邀请码的弹窗 | ||
30 | - by_index:null, //购买卡的下班 | 25 | + is_pulscardname: "", //plus会员的名字 |
26 | + is_card: 0, //用于判断是否是续费页和购买页面 0不是PLUS会员 | ||
27 | + content: "", //等级卡规则 | ||
28 | + is_card_rule: "", //等级卡规则判断用 | ||
29 | + is_show: 0, //页面要加载完才能显示 | ||
30 | + open_yq: 0, //显示打开邀请码的弹窗 | ||
31 | + by_index: null, //购买卡的下班 | ||
31 | 32 | ||
32 | - isyaoqingma:0, //是否邀请码 | ||
33 | - is_salesman:0, //是否营业员 | ||
34 | - inp_recommon: null, //输入的邀请码 | 33 | + isyaoqingma: 0, //是否邀请码 |
34 | + is_salesman: 0, //是否营业员 | ||
35 | + inp_recommon: null, //输入的邀请码 | ||
35 | inp_serviceman: null, //输入的营业员 | 36 | inp_serviceman: null, //输入的营业员 |
36 | - is_fengxiang: 0, //是不是分享过来的 | ||
37 | - def_recommon: null, //分享人的手机号 | ||
38 | - def_serviceman: null, //分享人的营业员 | ||
39 | - fir_leader:0, //分享人的ID | 37 | + is_fengxiang: 0, //是不是分享过来的 |
38 | + def_recommon: null, //分享人的手机号 | ||
39 | + def_serviceman: null, //分享人的营业员 | ||
40 | + fir_leader: 0, //分享人的ID | ||
40 | }, | 41 | }, |
41 | swiperChange: function (e) { | 42 | swiperChange: function (e) { |
42 | var currentId = e.detail.current; | 43 | var currentId = e.detail.current; |
@@ -48,34 +49,41 @@ Page({ | @@ -48,34 +49,41 @@ Page({ | ||
48 | * 生命周期函数--监听页面加载 | 49 | * 生命周期函数--监听页面加载 |
49 | */ | 50 | */ |
50 | onLoad: function (options) { | 51 | onLoad: function (options) { |
51 | - var that = this,th=that; | ||
52 | - var store_id=getApp().globalData.setting.stoid; | 52 | + var that = this, |
53 | + th = that; | ||
54 | + var store_id = getApp().globalData.setting.stoid; | ||
53 | //获取用户设备信息,屏幕宽度 | 55 | //获取用户设备信息,屏幕宽度 |
54 | wx.getSystemInfo({ | 56 | wx.getSystemInfo({ |
55 | success: res => { | 57 | success: res => { |
56 | - that.setData({screenWidth: res.screenWidth}) | 58 | + that.setData({ |
59 | + screenWidth: res.screenWidth | ||
60 | + }) | ||
57 | } | 61 | } |
58 | }) | 62 | }) |
59 | var fir_leader = options.scene; | 63 | var fir_leader = options.scene; |
60 | - if (fir_leader) that.setData({fir_leader:fir_leader}) | 64 | + if (fir_leader) that.setData({ |
65 | + fir_leader: fir_leader | ||
66 | + }) | ||
61 | //--先判断会员状态-- | 67 | //--先判断会员状态-- |
62 | var user_info = getApp().globalData.userInfo; | 68 | var user_info = getApp().globalData.userInfo; |
63 | if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) { | 69 | if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) { |
64 | - wx.navigateTo({ url: '/pages/togoin/togoin?first_leader=' + fir_leader, }) | ||
65 | - return false; | ||
66 | - } | 70 | + wx.navigateTo({ |
71 | + url: '/pages/togoin/togoin?first_leader=' + fir_leader, | ||
72 | + }) | ||
73 | + return false; | ||
74 | + } | ||
67 | //-----------商家配置信息----- 等级卡规则,是否又开邀请码,营业员------------ | 75 | //-----------商家配置信息----- 等级卡规则,是否又开邀请码,营业员------------ |
68 | getApp().request.get("/api/weshop/storeconfig/get/" + store_id, { | 76 | getApp().request.get("/api/weshop/storeconfig/get/" + store_id, { |
69 | success: function (res) { | 77 | success: function (res) { |
70 | var is_cardrule = res.data.data.cardrules; | 78 | var is_cardrule = res.data.data.cardrules; |
71 | - var switch_list= res.data.data.switch_list; | ||
72 | - var swi_arr=JSON.parse(switch_list); | 79 | + var switch_list = res.data.data.switch_list; |
80 | + var swi_arr = JSON.parse(switch_list); | ||
73 | 81 | ||
74 | w.wxParse("content", "html", is_cardrule, that, 6); | 82 | w.wxParse("content", "html", is_cardrule, that, 6); |
75 | that.setData({ | 83 | that.setData({ |
76 | - is_card_rule: is_cardrule, | ||
77 | - isyaoqingma:parseInt(swi_arr.isyaoqingma), | ||
78 | - is_salesman:parseInt(swi_arr.is_staffno) | 84 | + is_card_rule: is_cardrule, |
85 | + isyaoqingma: parseInt(swi_arr.isyaoqingma), | ||
86 | + is_salesman: parseInt(swi_arr.is_staffno) | ||
79 | }); | 87 | }); |
80 | } | 88 | } |
81 | }); | 89 | }); |
@@ -85,12 +93,14 @@ Page({ | @@ -85,12 +93,14 @@ Page({ | ||
85 | * 生命周期函数--监听页面显示 | 93 | * 生命周期函数--监听页面显示 |
86 | */ | 94 | */ |
87 | onShow: function () { | 95 | onShow: function () { |
88 | - var user_info = getApp().globalData.userInfo; | ||
89 | - if(!user_info) return false; | ||
90 | - | ||
91 | - var th=this,that=th,app_d=getApp().globalData; | ||
92 | - var store_id=os.stoid; | ||
93 | - var fir_leader=this.data.fir_leader; | 96 | + var user_info = getApp().globalData.userInfo; |
97 | + if (!user_info) return false; | ||
98 | + | ||
99 | + var th = this, | ||
100 | + that = th, | ||
101 | + app_d = getApp().globalData; | ||
102 | + var store_id = os.stoid; | ||
103 | + var fir_leader = this.data.fir_leader; | ||
94 | 104 | ||
95 | if (fir_leader != null && fir_leader != undefined && fir_leader != "") { | 105 | if (fir_leader != null && fir_leader != undefined && fir_leader != "") { |
96 | var r_url = "/api/weshop/plus/vip/mem/list?storeId=" + store_id + "&userId=" + fir_leader | 106 | var r_url = "/api/weshop/plus/vip/mem/list?storeId=" + store_id + "&userId=" + fir_leader |
@@ -126,8 +136,12 @@ Page({ | @@ -126,8 +136,12 @@ Page({ | ||
126 | } | 136 | } |
127 | if (is_ok == 1) { | 137 | if (is_ok == 1) { |
128 | //--保存或者更新会员信息-- | 138 | //--保存或者更新会员信息-- |
129 | - that.setData({ def_recommon: user_information.MobileTel, def_serviceman: user_information.StaffNo, is_fengxiang: 1 }) | ||
130 | - th.save_th_plus_user(); | 139 | + that.setData({ |
140 | + def_recommon: user_information.MobileTel, | ||
141 | + def_serviceman: user_information.StaffNo, | ||
142 | + is_fengxiang: 1 | ||
143 | + }) | ||
144 | + th.save_th_plus_user(); | ||
131 | } | 145 | } |
132 | } | 146 | } |
133 | }); | 147 | }); |
@@ -138,14 +152,16 @@ Page({ | @@ -138,14 +152,16 @@ Page({ | ||
138 | getApp().request.get("/api/weshop/users/get/" + os.stoid + "/" + app_d.user_id, { | 152 | getApp().request.get("/api/weshop/users/get/" + os.stoid + "/" + app_d.user_id, { |
139 | success: function (e) { | 153 | success: function (e) { |
140 | var userInfo = e.data.data; | 154 | var userInfo = e.data.data; |
141 | - if(userInfo['card_field'] && !getApp().globalData.is_card_back){ | ||
142 | - var u_url = "/pages/user/cardinfo/cardinfo"; | ||
143 | - wx.reLaunch({url: u_url}) | 155 | + if (userInfo['card_field'] && !getApp().globalData.is_card_back) { |
156 | + var u_url = "/pages/user/cardinfo/cardinfo"; | ||
157 | + wx.reLaunch({ | ||
158 | + url: u_url | ||
159 | + }) | ||
144 | } | 160 | } |
145 | }, | 161 | }, |
146 | }); | 162 | }); |
147 | 163 | ||
148 | - this.getPlusCardType(); | 164 | + this.getPlusCardType(); |
149 | }, | 165 | }, |
150 | 166 | ||
151 | /** | 167 | /** |
@@ -170,18 +186,23 @@ Page({ | @@ -170,18 +186,23 @@ Page({ | ||
170 | var plusCard = res.data.data; | 186 | var plusCard = res.data.data; |
171 | var arr = [1219, 2089, 3031]; | 187 | var arr = [1219, 2089, 3031]; |
172 | var new_arr = new Array(); | 188 | var new_arr = new Array(); |
173 | - var parr=[]; | 189 | + var parr = []; |
174 | for (var i = 0; i < plusCard.length; i++) { | 190 | for (var i = 0; i < plusCard.length; i++) { |
175 | - //plusCard[i].free=arr[i]; | ||
176 | - if(plusCard[i].IsStopBuy) { continue; } | ||
177 | - if (plusCard[i].CardImg == "") plusCard[i].CardImg = th.data.url + "/miniapp/images/plus/bg"+(i + 1)+ ".jpg?v=1"; | ||
178 | - var item = {"fee": plusCard[i].CardFee, 'index': i} | ||
179 | - new_arr.push(item); | ||
180 | - parr.push(plusCard[i]); | 191 | + //plusCard[i].free=arr[i]; |
192 | + if (plusCard[i].IsStopBuy) { | ||
193 | + continue; | ||
194 | + } | ||
195 | + if (plusCard[i].CardImg == "") plusCard[i].CardImg = th.data.url + "/miniapp/images/plus/bg" + (i + 1) + ".jpg?v=1"; | ||
196 | + var item = { | ||
197 | + "fee": plusCard[i].CardFee, | ||
198 | + 'index': i | ||
199 | + } | ||
200 | + new_arr.push(item); | ||
201 | + parr.push(plusCard[i]); | ||
181 | } | 202 | } |
182 | 203 | ||
183 | //看是不是还有卡项是可以购买的 | 204 | //看是不是还有卡项是可以购买的 |
184 | - if(new_arr && new_arr.length>0){ | 205 | + if (new_arr && new_arr.length > 0) { |
185 | //根據距離遠近排序,越近在前面,升序 | 206 | //根據距離遠近排序,越近在前面,升序 |
186 | new_arr.sort(function (a, b) { | 207 | new_arr.sort(function (a, b) { |
187 | if (a.fee < b.fee) { | 208 | if (a.fee < b.fee) { |
@@ -195,39 +216,48 @@ Page({ | @@ -195,39 +216,48 @@ Page({ | ||
195 | 216 | ||
196 | //里面和外面要显示统一 | 217 | //里面和外面要显示统一 |
197 | switch (new_arr.length) { | 218 | switch (new_arr.length) { |
198 | - case 1:arr=[3031]; break; | ||
199 | - case 2: arr = [2089, 3031]; break; | ||
200 | - case 3: arr = [1219, 2089, 3031];break; | 219 | + case 1: |
220 | + arr = [3031]; | ||
221 | + break; | ||
222 | + case 2: | ||
223 | + arr = [2089, 3031]; | ||
224 | + break; | ||
225 | + case 3: | ||
226 | + arr = [1219, 2089, 3031]; | ||
227 | + break; | ||
201 | } | 228 | } |
202 | 229 | ||
203 | //---给数组添加立省多少钱--- | 230 | //---给数组添加立省多少钱--- |
204 | for (i = 0; i < parr.length; i++) { | 231 | for (i = 0; i < parr.length; i++) { |
205 | - //判断是否停用 | ||
206 | - for (var j = 0; j < new_arr.length; j++) { | ||
207 | - if (i == new_arr[j].index) { | ||
208 | - parr[i].free = arr[j]; | ||
209 | - break; | ||
210 | - } | 232 | + //判断是否停用 |
233 | + for (var j = 0; j < new_arr.length; j++) { | ||
234 | + if (i == new_arr[j].index) { | ||
235 | + parr[i].free = arr[j]; | ||
236 | + break; | ||
237 | + } | ||
211 | } | 238 | } |
212 | } | 239 | } |
213 | th.setData({ | 240 | th.setData({ |
214 | - is_plusCard: parr, is_show: 1 | 241 | + is_plusCard: parr, |
242 | + is_show: 1 | ||
215 | }) | 243 | }) |
216 | 244 | ||
217 | - }else{ | ||
218 | - th.setData({is_show: 1}); | ||
219 | - wx.showToast({ | ||
220 | - title: "暂无可购买的等级卡项", | ||
221 | - icon: 'none', | ||
222 | - duration: 4000 | ||
223 | - }) | 245 | + } else { |
246 | + th.setData({ | ||
247 | + is_show: 1 | ||
248 | + }); | ||
249 | + wx.showToast({ | ||
250 | + title: "暂无可购买的等级卡项", | ||
251 | + icon: 'none', | ||
252 | + duration: 4000 | ||
253 | + }) | ||
224 | 254 | ||
225 | - } | ||
226 | - setTimeout(function(){ | ||
227 | - var goods_list = th.selectComponent("#goods_list"); //组件的id | ||
228 | - goods_list.init(); | ||
229 | - goods_list.get_list(); | ||
230 | - },1000) | 255 | + } |
256 | + setTimeout(function () { | ||
257 | + var goods_list = th.selectComponent("#goods_list"); //组件的id | ||
258 | + goods_list.init(); | ||
259 | + goods_list.get_list(); | ||
260 | + }, 1000) | ||
231 | 261 | ||
232 | }) | 262 | }) |
233 | }, | 263 | }, |
@@ -241,33 +271,57 @@ Page({ | @@ -241,33 +271,57 @@ Page({ | ||
241 | th.buy_card(); | 271 | th.buy_card(); |
242 | } else { | 272 | } else { |
243 | //--如果后台都没有勾邀请码,营业员,立即购买-- | 273 | //--如果后台都没有勾邀请码,营业员,立即购买-- |
244 | - if (!th.data.isyaoqingma && !th.data.is_salesman) {th.buy_card(); return false;} | ||
245 | - th.setData({open_yq: 1}) | 274 | + if (!th.data.isyaoqingma && !th.data.is_salesman) { |
275 | + th.buy_card(); | ||
276 | + return false; | ||
277 | + } | ||
278 | + th.setData({ | ||
279 | + open_yq: 1 | ||
280 | + }) | ||
246 | } | 281 | } |
247 | }, | 282 | }, |
248 | - | 283 | + //--绑定邀请码的输入-- |
284 | + b_input: function (e) { | ||
285 | + var value = e.detail.value.trim(); | ||
286 | + // let { isyaoqingma, is_salesman }=this.data; | ||
287 | + var name = e.currentTarget.dataset.name; | ||
288 | + // if((name=="isyaoqingma" && isyaoqingma) || (name=="is_salesman" && is_salesman) ){ | ||
289 | + // if(!value){ | ||
290 | + // wx.showToast({ | ||
291 | + // title: '不能为空', | ||
292 | + // }) | ||
293 | + // return false; | ||
294 | + // } | ||
295 | + // } | ||
296 | + var ob = {}; | ||
297 | + ob[name] = value; | ||
298 | + this.setData(ob); | ||
299 | + }, | ||
249 | //--立即购买卡-- | 300 | //--立即购买卡-- |
250 | buy_card: async function () { | 301 | buy_card: async function () { |
251 | var th = this; | 302 | var th = this; |
252 | var is_card = 0; | 303 | var is_card = 0; |
253 | //--商家是不是有等级卡功能,开通的人数是不是够用,开通是时间是不是到期-- | 304 | //--商家是不是有等级卡功能,开通的人数是不是够用,开通是时间是不是到期-- |
254 | - await getApp().request.promiseGet("/api/weshop/plus/plus/card/register", | ||
255 | - {data: {storeId: os.stoid}}).then(res => { | 305 | + await getApp().request.promiseGet("/api/weshop/plus/plus/card/register", { |
306 | + data: { | ||
307 | + storeId: os.stoid | ||
308 | + } | ||
309 | + }).then(res => { | ||
256 | if (res.data.code == 0) is_card = 1; | 310 | if (res.data.code == 0) is_card = 1; |
257 | }) | 311 | }) |
258 | if (is_card == 0) { | 312 | if (is_card == 0) { |
259 | - getApp().my_warnning("请联系商家升级plus功能", 0, th); | ||
260 | - return false; | ||
261 | - } | ||
262 | - | 313 | + getApp().my_warnning("请联系商家升级plus功能", 0, th); |
314 | + return false; | ||
315 | + } | ||
316 | + | ||
263 | var item = th.data.is_plusCard[th.data.by_index]; | 317 | var item = th.data.is_plusCard[th.data.by_index]; |
264 | var req = {}; | 318 | var req = {}; |
265 | req.cardId = item.CardId; | 319 | req.cardId = item.CardId; |
266 | req.rechargeType = 3; | 320 | req.rechargeType = 3; |
267 | //如果不是你导购,也不是等级会员分享 | 321 | //如果不是你导购,也不是等级会员分享 |
268 | if (th.data.is_fengxiang == 1) { | 322 | if (th.data.is_fengxiang == 1) { |
269 | - if (th.data.def_recommon) req.recommon = th.data.def_recommon | ||
270 | - if (th.data.def_serviceman) req.serviceman = th.data.def_serviceman | 323 | + if (th.data.def_recommon) req.recommon = th.data.def_recommon |
324 | + if (th.data.def_serviceman) req.serviceman = th.data.def_serviceman | ||
271 | } else { | 325 | } else { |
272 | //---后台要求要输入邀请码--- | 326 | //---后台要求要输入邀请码--- |
273 | if (th.data.isyaoqingma) { | 327 | if (th.data.isyaoqingma) { |
@@ -275,13 +329,12 @@ Page({ | @@ -275,13 +329,12 @@ Page({ | ||
275 | getApp().my_warnning("请输入邀请码", 0, th); | 329 | getApp().my_warnning("请输入邀请码", 0, th); |
276 | return false; | 330 | return false; |
277 | } | 331 | } |
278 | - | ||
279 | - //--邀请人不能是自己的手机号-- | ||
280 | - if(th.data.inp_recommon==getApp().globalData.userInfo.mobile){ | ||
281 | - getApp().my_warnning("邀请人不能填自已", 0, th); | ||
282 | - return false; | ||
283 | - } | ||
284 | - | 332 | + |
333 | + //--邀请人不能是自己的手机号-- | ||
334 | + if (th.data.inp_recommon == getApp().globalData.userInfo.mobile) { | ||
335 | + getApp().my_warnning("邀请人不能填自已", 0, th); | ||
336 | + return false; | ||
337 | + } | ||
285 | req.recommon = th.data.inp_recommon | 338 | req.recommon = th.data.inp_recommon |
286 | } | 339 | } |
287 | //--后台要求要输入营业员-- | 340 | //--后台要求要输入营业员-- |
@@ -296,137 +349,166 @@ Page({ | @@ -296,137 +349,166 @@ Page({ | ||
296 | req.storeId = os.stoid; | 349 | req.storeId = os.stoid; |
297 | req.userId = getApp().globalData.user_id; | 350 | req.userId = getApp().globalData.user_id; |
298 | //--如果有邀请码,和营业员的情况下-- | 351 | //--如果有邀请码,和营业员的情况下-- |
299 | - if(req.recommon || req.serviceman ) { | ||
300 | - var req_data = {storeId: os.stoid, userId: req.userId}; | ||
301 | - if(req.recommon) req_data.inviteCode=req.recommon; | ||
302 | - if(req.serviceman) req_data.staffNo=req.serviceman; | 352 | + if (req.recommon || req.serviceman) { |
353 | + var req_data = { | ||
354 | + storeId: os.stoid, | ||
355 | + userId: req.userId | ||
356 | + }; | ||
357 | + if (req.recommon) req_data.inviteCode = req.recommon; | ||
358 | + if (req.serviceman) req_data.staffNo = req.serviceman; | ||
303 | getApp().request.get("/api/weshop/plus/vip/mem/referee/code/check", { | 359 | getApp().request.get("/api/weshop/plus/vip/mem/referee/code/check", { |
304 | - data:req_data, | ||
305 | - success:function(res){ | ||
306 | - if(res.data.code==0) { | ||
307 | - t_pay.pay(req, th.success, function () { | ||
308 | - getApp().my_warnning("支付失败", 0, th); | ||
309 | - }); | ||
310 | - }else{ | ||
311 | - getApp().my_warnning(res.data.msg, 0, th); | ||
312 | - } | ||
313 | - } | 360 | + data: req_data, |
361 | + success: function (res) { | ||
362 | + if (res.data.code == 0) { | ||
363 | + t_pay.pay(req, th.success, function () { | ||
364 | + getApp().my_warnning("支付失败", 0, th); | ||
365 | + }); | ||
366 | + } else { | ||
367 | + getApp().my_warnning(res.data.msg, 0, th); | ||
368 | + } | ||
369 | + } | ||
314 | }) | 370 | }) |
315 | - }else{ | 371 | + } else { |
316 | t_pay.pay(req, th.success, function () { | 372 | t_pay.pay(req, th.success, function () { |
317 | getApp().my_warnning("支付失败", 0, th); | 373 | getApp().my_warnning("支付失败", 0, th); |
318 | }); | 374 | }); |
319 | } | 375 | } |
320 | }, | 376 | }, |
321 | //返回会员页面 | 377 | //返回会员页面 |
322 | - OpeningClose: function() { | ||
323 | - this.setData({open_yq:0}); | 378 | + OpeningClose: function () { |
379 | + this.setData({ | ||
380 | + open_yq: 0 | ||
381 | + }); | ||
324 | }, | 382 | }, |
325 | 383 | ||
326 | //返回会员中心 | 384 | //返回会员中心 |
327 | - back_user:function () { | 385 | + back_user: function () { |
328 | setTimeout(function () { | 386 | setTimeout(function () { |
329 | - wx.reLaunch({url:"/pages/user/index/index"}); | ||
330 | - },1000) | 387 | + wx.reLaunch({ |
388 | + url: "/pages/user/index/index" | ||
389 | + }); | ||
390 | + }, 1000) | ||
331 | }, | 391 | }, |
332 | - | 392 | + |
333 | //--支付成功,跳转到等级卡续费页面-- | 393 | //--支付成功,跳转到等级卡续费页面-- |
334 | - success:function () { | ||
335 | - //调一次就不再调用了 | ||
336 | - if(getApp().globalData.is_card_back) return false; | ||
337 | - if(getApp().globalData.plus_buy_back){ | ||
338 | - //值在这里换 | ||
339 | - getApp().globalData.is_card_back=1; | ||
340 | - getApp().globalData.plus_buy_back=0; | ||
341 | - //返回购物车购买 | ||
342 | - wx.navigateBack({ delta: 1,}); | ||
343 | - return false; | ||
344 | - }else{ | ||
345 | - var u_url = "/pages/user/cardinfo/cardinfo"; | ||
346 | - wx.reLaunch({url: u_url}) | ||
347 | - } | ||
348 | - | ||
349 | - }, | 394 | + success: function () { |
395 | + //调一次就不再调用了 | ||
396 | + if (getApp().globalData.is_card_back) return false; | ||
397 | + if (getApp().globalData.plus_buy_back) { | ||
398 | + //值在这里换 | ||
399 | + getApp().globalData.is_card_back = 1; | ||
400 | + getApp().globalData.plus_buy_back = 0; | ||
401 | + //返回购物车购买 | ||
402 | + wx.navigateBack({ | ||
403 | + delta: 1, | ||
404 | + }); | ||
405 | + return false; | ||
406 | + } else { | ||
407 | + var u_url = "/pages/user/cardinfo/cardinfo"; | ||
408 | + wx.reLaunch({ | ||
409 | + url: u_url | ||
410 | + }) | ||
411 | + } | ||
350 | 412 | ||
351 | - //--绑定邀请码的输入-- | ||
352 | - b_input:function (e) { | ||
353 | - var value=e.detail.value; | ||
354 | - var name=e.currentTarget.dataset.name; | ||
355 | - var ob={}; | ||
356 | - ob[name]=value | ||
357 | - this.setData(ob); | ||
358 | }, | 413 | }, |
359 | 414 | ||
360 | - get_user_plus:async function(){ | ||
361 | - var user_id=getApp().globalData.user_id; | ||
362 | - var fuser=null; | ||
363 | - var user_information =null; | ||
364 | - var store_id = os.stoid; | ||
365 | - var that=this; | ||
366 | - //--获取登记卡邀请信息-- | ||
367 | - await getApp().request.promiseGet("/api/weshop/usersPlus/get/" + os.stoid + "/" + user_id,{1:1}).then(res=>{ | ||
368 | - if (res.data.code==0){ | ||
369 | - fuser=res.data.data; | ||
370 | - } | ||
371 | - }) | ||
372 | - if (!fuser) return false; | ||
373 | - var r_url = "/api/weshop/plus/vip/mem/list?storeId=" + store_id + "&userId=" + fuser.plus_user_id; | ||
374 | - //--获取等级卡信息-- | ||
375 | - await getApp().request.promiseGet(r_url,{1:1}).then(res=>{ | ||
376 | - if (res.data.code == 0) { | ||
377 | - user_information = res.data.data[0]; | ||
378 | - } | ||
379 | - }) | ||
380 | - if (user_information){ | ||
381 | - var now = ut.gettimestamp(); | ||
382 | - var is_ok = 1; | ||
383 | - if (user_information['ExpiryDate']) { | ||
384 | - var str = user_information['ExpiryDate'].replace(/-/g, '/'); | ||
385 | - var end = new Date(str); | ||
386 | - end = Date.parse(end) / 1000; | ||
387 | - if (end < now) { is_ok = 0;} | ||
388 | - } else { | 415 | + |
416 | + | ||
417 | + get_user_plus: async function () { | ||
418 | + var user_id = getApp().globalData.user_id; | ||
419 | + var fuser = null; | ||
420 | + var user_information = null; | ||
421 | + var store_id = os.stoid; | ||
422 | + var that = this; | ||
423 | + //--获取登记卡邀请信息-- | ||
424 | + await getApp().request.promiseGet("/api/weshop/usersPlus/get/" + os.stoid + "/" + user_id, { | ||
425 | + 1: 1 | ||
426 | + }).then(res => { | ||
427 | + if (res.data.code == 0) { | ||
428 | + fuser = res.data.data; | ||
429 | + } | ||
430 | + }) | ||
431 | + if (!fuser) return false; | ||
432 | + var r_url = "/api/weshop/plus/vip/mem/list?storeId=" + store_id + "&userId=" + fuser.plus_user_id; | ||
433 | + //--获取等级卡信息-- | ||
434 | + await getApp().request.promiseGet(r_url, { | ||
435 | + 1: 1 | ||
436 | + }).then(res => { | ||
437 | + if (res.data.code == 0) { | ||
438 | + user_information = res.data.data[0]; | ||
439 | + } | ||
440 | + }) | ||
441 | + if (user_information) { | ||
442 | + var now = ut.gettimestamp(); | ||
443 | + var is_ok = 1; | ||
444 | + if (user_information['ExpiryDate']) { | ||
445 | + var str = user_information['ExpiryDate'].replace(/-/g, '/'); | ||
446 | + var end = new Date(str); | ||
447 | + end = Date.parse(end) / 1000; | ||
448 | + if (end < now) { | ||
389 | is_ok = 0; | 449 | is_ok = 0; |
390 | } | 450 | } |
451 | + } else { | ||
452 | + is_ok = 0; | ||
453 | + } | ||
391 | 454 | ||
392 | - if (is_ok == 1) { | ||
393 | - var fir_leader=fuser.plus_user_id | ||
394 | - that.setData({ def_recommon: user_information.MobileTel, def_serviceman: user_information.StaffNo, is_fengxiang: 1,fir_leader:fir_leader }) | ||
395 | - //--先判断会员状态-- | ||
396 | - var user_info = getApp().globalData.userInfo; | ||
397 | - if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) { | ||
398 | - wx.navigateTo({ url: '/pages/togoin/togoin?first_leader=' + fir_leader, }) | ||
399 | - return false; | ||
400 | - } | 455 | + if (is_ok == 1) { |
456 | + var fir_leader = fuser.plus_user_id | ||
457 | + that.setData({ | ||
458 | + def_recommon: user_information.MobileTel, | ||
459 | + def_serviceman: user_information.StaffNo, | ||
460 | + is_fengxiang: 1, | ||
461 | + fir_leader: fir_leader | ||
462 | + }) | ||
463 | + //--先判断会员状态-- | ||
464 | + var user_info = getApp().globalData.userInfo; | ||
465 | + if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) { | ||
466 | + wx.navigateTo({ | ||
467 | + url: '/pages/togoin/togoin?first_leader=' + fir_leader, | ||
468 | + }) | ||
469 | + return false; | ||
470 | + } | ||
401 | } | 471 | } |
402 | - } | 472 | + } |
403 | }, | 473 | }, |
404 | - | ||
405 | - save_th_plus_user:async function(){ | ||
406 | - var f_user_id=this.data.fir_leader; | ||
407 | - if (f_user_id){ | 474 | + |
475 | + save_th_plus_user: async function () { | ||
476 | + var f_user_id = this.data.fir_leader; | ||
477 | + if (f_user_id) { | ||
408 | var user_id = getApp().globalData.user_id; | 478 | var user_id = getApp().globalData.user_id; |
409 | var user_plus = null; | 479 | var user_plus = null; |
410 | - var now=ut.gettimestamp(); | 480 | + var now = ut.gettimestamp(); |
411 | //--获取登记卡邀请信息-- | 481 | //--获取登记卡邀请信息-- |
412 | - await getApp().request.promiseGet("/api/weshop/usersPlus/get/" + os.stoid + "/" + user_id, { 1: 1 }).then(res => { | 482 | + await getApp().request.promiseGet("/api/weshop/usersPlus/get/" + os.stoid + "/" + user_id, { |
483 | + 1: 1 | ||
484 | + }).then(res => { | ||
413 | if (res.data.code == 0) { | 485 | if (res.data.code == 0) { |
414 | user_plus = res.data.data; | 486 | user_plus = res.data.data; |
415 | } | 487 | } |
416 | - }) | ||
417 | - | 488 | + }) |
489 | + | ||
418 | //--如果有值,要更新-- | 490 | //--如果有值,要更新-- |
419 | - if (!user_plus){ | ||
420 | - getApp().request.post("/api/weshop/usersPlus/save", { | ||
421 | - data: { store_id: os.stoid, user_id: user_id, plus_user_id: f_user_id, addtime: now }, | ||
422 | - success: function (res) { } | ||
423 | - }) | ||
424 | - }else{ | ||
425 | - getApp().request.put("/api/weshop/usersPlus/update",{ | ||
426 | - data: { store_id: os.stoid, user_id: user_id, plus_user_id: f_user_id, edittime: now}, | ||
427 | - success:function(res){ } | ||
428 | - }) | 491 | + if (!user_plus) { |
492 | + getApp().request.post("/api/weshop/usersPlus/save", { | ||
493 | + data: { | ||
494 | + store_id: os.stoid, | ||
495 | + user_id: user_id, | ||
496 | + plus_user_id: f_user_id, | ||
497 | + addtime: now | ||
498 | + }, | ||
499 | + success: function (res) {} | ||
500 | + }) | ||
501 | + } else { | ||
502 | + getApp().request.put("/api/weshop/usersPlus/update", { | ||
503 | + data: { | ||
504 | + store_id: os.stoid, | ||
505 | + user_id: user_id, | ||
506 | + plus_user_id: f_user_id, | ||
507 | + edittime: now | ||
508 | + }, | ||
509 | + success: function (res) {} | ||
510 | + }) | ||
429 | } | 511 | } |
430 | - } | 512 | + } |
431 | } | 513 | } |
432 | }) | 514 | }) |
433 | \ No newline at end of file | 515 | \ No newline at end of file |
pages/user/user_spsy/user_spsy.js
1 | // pages/user/usersy/usersy.js | 1 | // pages/user/usersy/usersy.js |
2 | -var e = getApp(),os = e.globalData.setting; | ||
3 | -var utils = require('../../../utils/util.js'); | 2 | +var e = getApp(), |
3 | + os = e.globalData.setting; | ||
4 | +var ut = require('../../../utils/util'); | ||
4 | var regeneratorRuntime = require('../../../utils/runtime.js'); | 5 | var regeneratorRuntime = require('../../../utils/runtime.js'); |
5 | 6 | ||
6 | Page({ | 7 | Page({ |
@@ -8,27 +9,100 @@ Page({ | @@ -8,27 +9,100 @@ Page({ | ||
8 | * 页面的初始数据 | 9 | * 页面的初始数据 |
9 | */ | 10 | */ |
10 | data: { | 11 | data: { |
11 | - qr_code_object:{val:"12121",content:"请将二维码展示给核销员,取货更快捷!"}, | ||
12 | - xp_list:null, | ||
13 | - iurl:os.imghost, | 12 | + qr_code_object: {}, |
13 | + xp_list: null, | ||
14 | + iurl: os.imghost, | ||
15 | + page: 1, | ||
16 | + isLoading: 0, | ||
17 | + no_more: 0, | ||
18 | + is_use:0 //领取状态 | ||
14 | }, | 19 | }, |
15 | /** | 20 | /** |
16 | * 生命周期函数--监听页面加载 | 21 | * 生命周期函数--监听页面加载 |
17 | */ | 22 | */ |
18 | - onLoad: function (options) { }, | 23 | + onLoad: function (options) { |
24 | + var h_pic = options.img; | ||
25 | + if (h_pic.indexOf("http") == -1) { | ||
26 | + h_pic = os.imghost + h_pic; | ||
27 | + } | ||
28 | + var FormId = options.FormId; | ||
29 | + var GradeId = options.gradeId; | ||
30 | + var now = ut.gettimestamp(); | ||
31 | + this.setData({ | ||
32 | + h_pic, | ||
33 | + GradeId, | ||
34 | + FormId, | ||
35 | + now, | ||
36 | + }); | ||
37 | + this.requestData() | ||
38 | + this.getQrCode(FormId) | ||
39 | + }, | ||
19 | /** | 40 | /** |
20 | * 生命周期函数--监听页面显示 | 41 | * 生命周期函数--监听页面显示 |
21 | */ | 42 | */ |
22 | - onShow:async function () { | ||
23 | - var th = this; | ||
24 | - var xp_list=null; | ||
25 | - //--获取列表-- | ||
26 | - await getApp().request.promiseGet("http://172.20.3.102:8080/api/user_qy/xp_list", { | ||
27 | - 1: 1 | ||
28 | - }).then(res => { | ||
29 | - xp_list = res.data; | ||
30 | - }) | ||
31 | - th.setData({xp_list:xp_list}); | 43 | + onShow: function () { |
44 | + | ||
45 | + | ||
46 | + }, | ||
47 | + async getQrCode(id) { | ||
48 | + const res = await getApp().request.promiseGet("/api/weshop/users/grade/wares/code/get", { | ||
49 | + data: { | ||
50 | + privilegeId: id, | ||
51 | + storeId: os.stoid, | ||
52 | + userId: getApp().globalData.user_id, | ||
53 | + }, | ||
54 | + }); | ||
55 | + if (res.data.code == 0 && res.data.data) { | ||
56 | + if(res.data.data.VerifyDate || res.data.data.VerifyNo){ | ||
57 | + this.setData({ | ||
58 | + is_use:1 | ||
59 | + }) | ||
60 | + }else{ | ||
61 | + this.setData({ | ||
62 | + qr_code_object: res.data.data, | ||
63 | + }) | ||
64 | + } | ||
65 | + } | ||
66 | + }, | ||
67 | + async requestData() { | ||
68 | + if (this.data.no_more) return false; | ||
69 | + if (this.data.isLoading) return false; | ||
70 | + this.data.isLoading = 1; | ||
71 | + let { | ||
72 | + GradeId, | ||
73 | + FormId, | ||
74 | + page, | ||
75 | + xp_list | ||
76 | + } = this.data; | ||
77 | + let req_data = { | ||
78 | + page, | ||
79 | + GradeId, | ||
80 | + FormId, | ||
81 | + storeId: os.stoid, | ||
82 | + userId: getApp().globalData.user_id, | ||
83 | + } | ||
84 | + const res = await getApp().request.promiseGet("/api/weshop/users/grade/wechat/wares/page", { | ||
85 | + data: req_data | ||
86 | + }); | ||
87 | + | ||
88 | + if (ut.ajax_ok(res)) { | ||
89 | + if (res.data.data.page > 1) { | ||
90 | + xp_list = xp_list.concat(res.data.data.pageData); | ||
91 | + } else { | ||
92 | + xp_list = res.data.data.pageData; | ||
93 | + } | ||
94 | + this.setData({ | ||
95 | + xp_list, | ||
96 | + isLoading: 0, | ||
97 | + no_more: 0, | ||
98 | + }) | ||
99 | + } else { | ||
100 | + this.setData({ | ||
101 | + xp_list: [], | ||
102 | + isLoading: 0, | ||
103 | + no_more: 0, | ||
104 | + }) | ||
105 | + } | ||
32 | }, | 106 | }, |
33 | /** | 107 | /** |
34 | * 页面上拉触底事件的处理函数 | 108 | * 页面上拉触底事件的处理函数 |
@@ -46,26 +120,36 @@ Page({ | @@ -46,26 +120,36 @@ Page({ | ||
46 | 120 | ||
47 | 121 | ||
48 | /*-- 打开服务项目 --*/ | 122 | /*-- 打开服务项目 --*/ |
49 | - open_xp:function (e) { | ||
50 | - var th=this; | 123 | + open_xp: function (e) { |
124 | + var th = this; | ||
51 | var qc_com = this.selectComponent("#qc_com"); //组件的id | 125 | var qc_com = this.selectComponent("#qc_com"); //组件的id |
52 | qc_com.open(th.data.qr_code_object) | 126 | qc_com.open(th.data.qr_code_object) |
53 | }, | 127 | }, |
54 | 128 | ||
55 | //--领取商品-- | 129 | //--领取商品-- |
56 | - get_xp:function (e) { | ||
57 | - var th=this,index=e.currentTarget.dataset.ind; | ||
58 | - getApp().request.post("http://172.20.3.102:8080/api/user_qy/get_gd",{ | ||
59 | - data:{}, | ||
60 | - success:function (e) { | ||
61 | - if(e.data.code==0){ | ||
62 | - var txt="xp_list["+index+"].is_get" | ||
63 | - var obj={};obj[txt]=1; | ||
64 | - th.setData(obj); | ||
65 | - } | ||
66 | - } | 130 | + async show_hxm(e) { |
131 | + let qr_code_object = this.data.qr_code_object; | ||
132 | + if (qr_code_object !== {}) { | ||
133 | + let { Number: val, BeginDate, EndDate} = qr_code_object; | ||
134 | + let qr_code = this.selectComponent("#qc_com"); | ||
135 | + let obj = { | ||
136 | + val, | ||
137 | + content: "请将二维码展示给核销员,抵券更快捷", | ||
138 | + now: BeginDate, | ||
139 | + validay: EndDate, | ||
140 | + is_quan: 1, | ||
141 | + }; | ||
142 | + qr_code.open(obj) | ||
143 | + }else{ | ||
144 | + wx.showToast({ | ||
145 | + title: "获取失败", | ||
146 | + icon: 'none', | ||
147 | + duration: 1000 | ||
67 | }) | 148 | }) |
68 | - } | ||
69 | - | 149 | + } |
150 | + }, | ||
70 | 151 | ||
152 | + close:function (){ | ||
153 | + this.getQrCode(this.data.FormId) | ||
154 | + } | ||
71 | }) | 155 | }) |
72 | \ No newline at end of file | 156 | \ No newline at end of file |
pages/user/user_spsy/user_spsy.json
pages/user/user_spsy/user_spsy.wxml
1 | -<view class="xc-page" > | ||
2 | - <view class="items" wx:for="{{xp_list}}"> | ||
3 | - <view class="rel"> | ||
4 | - <image class="new-product" src="{{iurl+item.img}}"></image> | ||
5 | - <image wx:if="{{item.is_get}}" class="abs zimg" src="{{iurl}}/miniapp//images/userqy/isgeted.png"></image> | ||
6 | - </view> | ||
7 | - | ||
8 | - <view class="product-explain three-level-word">{{item.goods_name}}</view> | ||
9 | - <view class="xc-bottom flex"> | ||
10 | - <view class="xc-goods-money three-level-word ">¥ | ||
11 | - </view> | ||
12 | - <view class="xc-money"> | ||
13 | - {{item.goods_price}} | ||
14 | - </view> | ||
15 | - <view class="xc-clike-get t-c white" data-ind="{{index}}" bindtap="open_xp" wx:if="{{item.is_get}}">立即使用</view> | ||
16 | - <view class="xc-clike-get t-c white" data-ind="{{index}}" bindtap="get_xp" wx:else>免费领取</view> | ||
17 | - </view> | ||
18 | -</view> | 1 | +<view> |
2 | + <image class="xc-coupon-img" src="{{h_pic}}"></image> | ||
3 | + <view class="flex pd20 jc_sb fs28"> | ||
4 | + <view>单品名称</view> | ||
5 | + <view>数量</view> | ||
6 | + </view> | ||
7 | + <view class="flex pd20 jc_sb fs26" wx:for="{{xp_list}}" wx:key="id"> | ||
8 | + <view>{{item.PrivilegeName}}</view> | ||
9 | + <view class="c-a4">x{{item.SecondNo}}</view> | ||
10 | + </view> | ||
11 | + <view class="btn-container"> | ||
12 | + <!-- <view wx:if="{{details.isget}}" data-type="1" class="btn" style="background-color:#aaa;color: #fff"> | ||
13 | + 已使用{{list[0].freebh}} | ||
14 | + </view> --> | ||
15 | + <view wx:if="{{is_use}}" class="btn">已使用</view> | ||
16 | + <view wx:else bindtap="show_hxm" data-type="1" class="btn">立即使用</view> | ||
17 | + <!-- <view bindtap="right_use" class="btn">立即使用</view></view> --> | ||
18 | + </view> | ||
19 | </view> | 19 | </view> |
20 | 20 | ||
21 | <!-- 弹出框扫描 --> | 21 | <!-- 弹出框扫描 --> |
22 | -<qr_code id="qc_com"></qr_code> | ||
23 | - | ||
24 | - | ||
25 | - | ||
26 | - | ||
27 | - | ||
28 | - | 22 | +<qr_code id="qc_com" bindclose="close"></qr_code> |
29 | \ No newline at end of file | 23 | \ No newline at end of file |
pages/user/user_spsy/user_spsy.wxss
@@ -3,66 +3,28 @@ page{ | @@ -3,66 +3,28 @@ page{ | ||
3 | height: 100%; | 3 | height: 100%; |
4 | background:#f4f5fa; | 4 | background:#f4f5fa; |
5 | } | 5 | } |
6 | -.xc-page{ | ||
7 | - width: 100%; | ||
8 | - height: 100%; | ||
9 | - background: #f4f5fa; | ||
10 | -} | ||
11 | -.xc-page .items{ | ||
12 | - display: inline-block; | ||
13 | - width: 345rpx; | ||
14 | - height:450rpx; | ||
15 | - margin-left:20rpx; | ||
16 | - margin-top: 25rpx; | ||
17 | - border-radius: 15rpx; | ||
18 | - background:#fff; | ||
19 | -} | ||
20 | - | ||
21 | -.xc-page .items .zimg{ | ||
22 | - width: 120rpx; | ||
23 | - height: 120rpx; | ||
24 | - left:50%; top:50%; | ||
25 | - margin-left: -60rpx; margin-top: -60rpx; | ||
26 | -} | ||
27 | - | ||
28 | 6 | ||
29 | -.new-product{ | ||
30 | - width:345rpx; | ||
31 | - height:325rpx; | ||
32 | - border-radius:15rpx 15rpx 0 0; | ||
33 | -} | ||
34 | -.product-explain{ | ||
35 | - width: 90%; | ||
36 | - word-break:break-all; | ||
37 | - height: 40rpx; | ||
38 | - margin-left:15rpx; | ||
39 | - | ||
40 | -} | ||
41 | -.xc-bottom{ | ||
42 | - margin-top: 13rpx; | 7 | +.xc-coupon-img{ |
43 | width: 100%; | 8 | width: 100%; |
44 | - margin-left: 15rpx; | ||
45 | -} | ||
46 | - | ||
47 | -.xc-bottom .xc-goods-money{ | ||
48 | -color: #ca4e59; | ||
49 | - padding-top: 12rpx; | ||
50 | -} | ||
51 | -.xc-bottom .xc-money{ | ||
52 | - color: #ca4e59; | ||
53 | - font-size: 40rpx; | ||
54 | - height: 100%; | ||
55 | - line-height:50rpx | 9 | + height: 330rpx; |
10 | +} | ||
11 | +.btn-container { | ||
12 | + position: fixed; | ||
13 | + left: 0; | ||
14 | + bottom: 0; | ||
15 | + width: 100%; | ||
16 | + /* padding: 20rpx 30rpx; */ | ||
17 | + box-sizing: border-box; | ||
18 | + background-color: white; | ||
19 | + border-top: 2rpx solid #f2f2f2; | ||
20 | + z-index: 1; | ||
56 | } | 21 | } |
57 | 22 | ||
58 | -.xc-clike-get{ | ||
59 | - width: 120rpx; | ||
60 | - height: 36rpx; | ||
61 | - border-radius: 20rpx; | ||
62 | - background: #ca4e59; | ||
63 | - line-height:28rpx; | ||
64 | - font-size:27rpx; | ||
65 | - margin-left: 120rpx; | ||
66 | -padding-top: 10rpx | 23 | +.btn { |
24 | + background-color: #FF6768; | ||
25 | + color: white; | ||
26 | + padding: 26rpx; | ||
27 | + text-align: center; | ||
28 | + /* border-radius: 8rpx; */ | ||
67 | } | 29 | } |
68 | 30 |
pages/user/userqy/userqy.js
@@ -197,7 +197,7 @@ Page({ | @@ -197,7 +197,7 @@ Page({ | ||
197 | getApp().goto("/pages/user/user_fw/user_fw?gradeId="+th.data.gradeId+"&FormId="+item.Id); | 197 | getApp().goto("/pages/user/user_fw/user_fw?gradeId="+th.data.gradeId+"&FormId="+item.Id); |
198 | break; | 198 | break; |
199 | case "03": | 199 | case "03": |
200 | - getApp().goto("/pages/user/user_spsy/user_spsy"); | 200 | + getApp().goto("/pages/user/user_spsy/user_spsy?img="+url+"&gradeId="+th.data.gradeId+"&FormId="+item.Id); |
201 | break; | 201 | break; |
202 | case "10": | 202 | case "10": |
203 | getApp().request.get("/api/weshop/users/grade/vipprivilegelist/other/get",{ | 203 | getApp().request.get("/api/weshop/users/grade/vipprivilegelist/other/get",{ |