Commit a4acbec596fd7b7368d2038a03abe3623d408ca7
1 parent
7c7f22c4
1.测肤2期
2.多赠品
Showing
39 changed files
with
2201 additions
and
512 deletions
components/goods_list/goods_list.js
... | ... | @@ -70,7 +70,7 @@ Component({ |
70 | 70 | //--- 判断是等级会员,且在有效期范围内 --- |
71 | 71 | if (user.card_field && now < end) { |
72 | 72 | var card_name = ob.name_map.get(user.card_field); |
73 | - if (card_name.length > 4) card_name = card_name.substring(0, 8); | |
73 | + if (card_name && card_name.length > 4) card_name = card_name.substring(0, 8); | |
74 | 74 | th.setData({ |
75 | 75 | card_field: user.card_field, |
76 | 76 | card_name: card_name, | ... | ... |
packageA/pages/cart2_ser/cart2_ser.js
... | ... | @@ -478,7 +478,6 @@ Page({ |
478 | 478 | return false; |
479 | 479 | } |
480 | 480 | |
481 | - | |
482 | 481 | if (gg.prom_type == 1 && gg.is_pd_normal == 0) { |
483 | 482 | // 秒杀活动购买 |
484 | 483 | var goods = { |
... | ... | @@ -502,8 +501,11 @@ Page({ |
502 | 501 | 'pickup_keyid': list[i].keyid, |
503 | 502 | }; |
504 | 503 | } |
505 | - | |
506 | 504 | |
505 | + if(getApp().globalData.skinface_id){ | |
506 | + goods.skinface_id=getApp().globalData.skinface_id; | |
507 | + } | |
508 | + | |
507 | 509 | |
508 | 510 | //--导购分享过来的id-- |
509 | 511 | if (gg.guide_id) { |
... | ... | @@ -543,6 +545,10 @@ Page({ |
543 | 545 | goods.price = this.data.postdata.prom_price; |
544 | 546 | }; |
545 | 547 | |
548 | + if(getApp().globalData.skinface_id){ | |
549 | + goods.skinface_id=getApp().globalData.skinface_id; | |
550 | + } | |
551 | + | |
546 | 552 | //--导购分享过来的id-- |
547 | 553 | if (gg.guide_id) { |
548 | 554 | goods.guide_id = gg.guide_id; | ... | ... |
packageA/pages/goodsInfo/goodsInfo.js
... | ... | @@ -228,33 +228,9 @@ Page({ |
228 | 228 | th = ee, |
229 | 229 | gid = t.goods_id, |
230 | 230 | first_leader=t.first_leader; |
231 | - | |
232 | - | |
233 | - //-- 自定义海报 -- | |
234 | - // getApp().request.promiseGet("/api/weshop/goods/poster/page", { | |
235 | - // data:{store_id:os.stoid, type:1, is_use:1} | |
236 | - // }).then(res=>{ | |
237 | - // if(res.data.code==0 && res.data.data && res.data.data.pageData && res.data.data.pageData[0]){ | |
238 | - // var poster_data=res.data.data.pageData[0]; | |
239 | - // var json_str=poster_data.jsonStr; | |
240 | - // if(json_str){ | |
241 | - // var json_data=JSON.parse(json_str); | |
242 | - // if(json_data.bg_img){ | |
243 | - // //-- 把图片那到本地 -- | |
244 | - // wx.getImageInfo({ | |
245 | - // src:json_data.bg_img, | |
246 | - // success: function(res) { | |
247 | - // var path= res.path; | |
248 | - // th.setData({share_b_img:path}) | |
249 | - // }, | |
250 | - // fail: function(res) {} | |
251 | - // }); | |
252 | - // } | |
253 | - // th.setData({poster:json_data}) | |
254 | - // } | |
255 | - // } | |
256 | - // }) | |
257 | - | |
231 | + | |
232 | + //检查测肤 | |
233 | + getApp().check_skin_face(t,1,gid); | |
258 | 234 | |
259 | 235 | //---获取手机地址坐标-- |
260 | 236 | //--如果tg_id是空的话,分享回来-- |
... | ... | @@ -376,7 +352,7 @@ Page({ |
376 | 352 | }); |
377 | 353 | |
378 | 354 | //获取用户的默认门店 |
379 | - getApp().get_user_store(function(e) { | |
355 | + getApp().get_user_store(function(e) { | |
380 | 356 | if(!e) { |
381 | 357 | th.data.fir_def_store={}; //赋值空对象 |
382 | 358 | return false; |
... | ... | @@ -384,7 +360,9 @@ Page({ |
384 | 360 | var ee=JSON.parse(JSON.stringify(e)); |
385 | 361 | //--定时器推迟一下-- |
386 | 362 | setTimeout(function () { |
387 | - if(!th.data.data) return false; | |
363 | + if(!th.data.data){ | |
364 | + return false; | |
365 | + } | |
388 | 366 | var ser_card=th.data.data; |
389 | 367 | //--如果默认门店不在等级卡的默认们店以内 |
390 | 368 | if(ser_card.storageId!=null && ser_card.storageId!="" && ser_card.storageId.indexOf(ee.keyid)==-1){ |
... | ... | @@ -452,7 +430,7 @@ Page({ |
452 | 430 | } |
453 | 431 | } |
454 | 432 | }, 500) |
455 | - },700) | |
433 | + },1500) | |
456 | 434 | |
457 | 435 | }); |
458 | 436 | ... | ... |
packageA/pages/profile/profile.js
... | ... | @@ -684,6 +684,9 @@ Page({ |
684 | 684 | if(user){ |
685 | 685 | self.setData({user:user}) |
686 | 686 | } |
687 | + | |
688 | + var is_back=t.is_back; | |
689 | + if(is_back) this.data.is_back=1; | |
687 | 690 | |
688 | 691 | }, |
689 | 692 | |
... | ... | @@ -856,7 +859,15 @@ Page({ |
856 | 859 | success: function(res) { |
857 | 860 | if (res.data.code == 0) { |
858 | 861 | getApp().my_warnning("修改成功", 1, th); |
859 | - getApp().goto("/pages/user/index/index"); | |
862 | + | |
863 | + setTimeout(function () { | |
864 | + if(th.data.is_back){ | |
865 | + wx.navigateBack({ delta: 1}) //返回上一页 | |
866 | + }else{ | |
867 | + getApp().goto("/pages/user/index/index"); | |
868 | + } | |
869 | + },1000) | |
870 | + | |
860 | 871 | } else { |
861 | 872 | getApp().my_warnning("系统繁忙,请稍后再试", 0, th); |
862 | 873 | } |
... | ... | @@ -1152,8 +1163,12 @@ Page({ |
1152 | 1163 | data: data, |
1153 | 1164 | success: function(res) { |
1154 | 1165 | if (res.data.code == 0) { |
1155 | - getApp().my_warnning("保存成功", 1, self); | |
1156 | - getApp().goto("/pages/user/index/index"); | |
1166 | + getApp().my_warnning("保存成功", 1, self); | |
1167 | + if(th.data.is_back){ | |
1168 | + wx.navigateBack({ delta: 1}) //返回上一页 | |
1169 | + }else{ | |
1170 | + getApp().goto("/pages/user/index/index"); | |
1171 | + } | |
1157 | 1172 | } else { |
1158 | 1173 | getApp().my_warnning(res.data.msg, 0, self); |
1159 | 1174 | }; | ... | ... |
packageC/pages/luckyGo/luckyGo_cart/luckyGo_cart.js
... | ... | @@ -2234,6 +2234,10 @@ Page({ |
2234 | 2234 | 'prom_id': th.data.bn_goods.prom_id, //促销活动id |
2235 | 2235 | }; |
2236 | 2236 | |
2237 | + if(getApp().globalData.skinface_id){ | |
2238 | + goods.skinface_id=getApp().globalData.skinface_id; | |
2239 | + } | |
2240 | + | |
2237 | 2241 | //-- 把导购的信息填入-- |
2238 | 2242 | if (gg.guide_id) { |
2239 | 2243 | goods.guide_id = gg.guide_id; | ... | ... |
packageC/pages/luckyGo/luckyGo_cart_ct/luckyGo_cart_ct.js
... | ... | @@ -774,6 +774,9 @@ Page({ |
774 | 774 | 'prom_id': th.data.param.group_id, //促销活动id |
775 | 775 | }; |
776 | 776 | |
777 | + if(getApp().globalData.skinface_id){ | |
778 | + goods.skinface_id=getApp().globalData.skinface_id; | |
779 | + } | |
777 | 780 | //--导购分享过来的id-- |
778 | 781 | if (gg.guide_id) { |
779 | 782 | goods.guide_id = gg.guide_id; | ... | ... |
packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.js
... | ... | @@ -295,7 +295,6 @@ Page({ |
295 | 295 | }; |
296 | 296 | |
297 | 297 | |
298 | - | |
299 | 298 | var ee = this, |
300 | 299 | that = ee, |
301 | 300 | th = ee, |
... | ... | @@ -315,8 +314,8 @@ Page({ |
315 | 314 | }); |
316 | 315 | } |
317 | 316 | |
318 | - | |
319 | - | |
317 | + //检查测肤 | |
318 | + getApp().check_skin_face(t,0,gid); | |
320 | 319 | |
321 | 320 | //---获取手机地址坐标-- |
322 | 321 | //--如果tg_id是空的话,分享回来-- | ... | ... |
packageC/pages/presell/cart/cart2.js
... | ... | @@ -1044,6 +1044,10 @@ Page({ |
1044 | 1044 | 'prom_id': th.data.bn_goods.prom_id, //促销活动id |
1045 | 1045 | }; |
1046 | 1046 | |
1047 | + if(getApp().globalData.skinface_id){ | |
1048 | + goods.skinface_id=getApp().globalData.skinface_id; | |
1049 | + } | |
1050 | + | |
1047 | 1051 | //-- 把导购的信息填入-- |
1048 | 1052 | if (gg.guide_id) { |
1049 | 1053 | goods.guide_id = gg.guide_id; | ... | ... |
packageC/pages/presell/cart/cart2_pre.js
... | ... | @@ -497,6 +497,10 @@ Page({ |
497 | 497 | 'prom_id': th.data.bn_goods.prom_id, //促销活动id |
498 | 498 | }; |
499 | 499 | |
500 | + if(getApp().globalData.skinface_id){ | |
501 | + goods.skinface_id=getApp().globalData.skinface_id; | |
502 | + } | |
503 | + | |
500 | 504 | //--导购分享过来的id-- |
501 | 505 | if (gg.guide_id) { |
502 | 506 | goods.guide_id = gg.guide_id; | ... | ... |
packageC/pages/presell/goodsInfo/goodsInfo.js
... | ... | @@ -264,6 +264,8 @@ Page({ |
264 | 264 | first_leader = t.first_leader, |
265 | 265 | room_id = t.room_id, |
266 | 266 | room_user_share = t.room_user_share; //如果是会员分享带有room_id的话,那么接下来会员分享就不传room_id |
267 | + //检查测肤 | |
268 | + getApp().check_skin_face(t,0,gid); | |
267 | 269 | |
268 | 270 | //-- 自定义海报 -- |
269 | 271 | getApp().request.promiseGet("/api/weshop/goods/poster/page", { | ... | ... |
packageD/components/diy_login/login.js
0 → 100644
1 | +var t = require("../../../utils/common.js"); | |
2 | +const app=getApp(); | |
3 | +var os = app.globalData.setting; | |
4 | +var regeneratorRuntime = require('../../../utils/runtime.js'); | |
5 | + | |
6 | +Component({ | |
7 | + | |
8 | + properties: { | |
9 | + // 这里定义了innerText属性,属性值可以在组件使用时指定 | |
10 | + object:{ | |
11 | + type:Object, | |
12 | + value:null | |
13 | + }, | |
14 | + }, | |
15 | + | |
16 | + data: { | |
17 | + user:null, | |
18 | + show_bind:0, | |
19 | + imghots: os.imghost, | |
20 | + store_logo:'', | |
21 | + first_leader:'', //-- 邀请人 -- | |
22 | + config2:null, | |
23 | + show_no:1, | |
24 | + }, | |
25 | + ready: function () { | |
26 | + | |
27 | + var set=this.properties.object; | |
28 | + if(set && set.hasOwnProperty('show_no')){ | |
29 | + this.setData({show_no:set.show_no}); | |
30 | + } | |
31 | + | |
32 | + if (wx.getUserProfile) { | |
33 | + this.setData({ | |
34 | + canIUseGetUserProfile: true | |
35 | + }) | |
36 | + } | |
37 | + var th=this; | |
38 | + app.getConfig(function (e) { | |
39 | + var logo=th.data.imghots+e.store_logo; | |
40 | + th.setData({ store: e,store_logo:logo}); | |
41 | + }) | |
42 | + | |
43 | + //判断注册的条件 | |
44 | + app.getConfig2(function (e) { | |
45 | + if(e.reg_type==1){ | |
46 | + var arr=JSON.parse(e.reg_info); | |
47 | + if(arr['name_state']==1) th.data.name_need_go=1; | |
48 | + if(arr['birthday_state']==1) th.data.birth_need_go=1; | |
49 | + if(arr['idcard_state']==1) th.data.idcard_need_go=1; | |
50 | + if(arr['address_state']==1) th.data.address_need_go=1; | |
51 | + if(arr['pick_state']==1) th.data.pick_need_go=1; | |
52 | + if(arr['sex_state']==1) th.data.sex_need_go=1; | |
53 | + if(arr['introducer_state']==1) th.data.introducer_need_go=1; | |
54 | + } | |
55 | + },1) | |
56 | + | |
57 | + getApp().promiseGet("/api/wx/weappSendlist/page", { | |
58 | + data: { | |
59 | + store_id: os.stoid, | |
60 | + typeid: "1007" | |
61 | + }}).then(res=>{ | |
62 | + if (res.data.code == 0 && res.data.data.pageData.length > 0) { | |
63 | + var template_id = res.data.data.pageData[0].template_id; | |
64 | + th.setData({template_id:template_id}); | |
65 | + } | |
66 | + }) | |
67 | + }, | |
68 | + | |
69 | + methods: { | |
70 | + | |
71 | + //绑定手机号 | |
72 | + getphone: function (e) { | |
73 | + //接下来写业务代码登录 | |
74 | + e = e.detail; | |
75 | + if (e.encryptedData == undefined) { | |
76 | + this.setData({show_bind: 0}) | |
77 | + return app.my_warnning("登录需要授权手机号码!", 0, this); | |
78 | + return false; | |
79 | + } | |
80 | + var sessionKey = getApp().globalData.sessionKey; | |
81 | + var openid = getApp().globalData.openid; | |
82 | + var r = getApp().globalData.getu; | |
83 | + this.save_the_data(r, e, sessionKey, openid) | |
84 | + }, | |
85 | + | |
86 | + | |
87 | + //-- 会员授权 -- | |
88 | + bindGetUserInfo: function (ee) { | |
89 | + if (!this.data.isAgree) { | |
90 | + wx.showToast({ | |
91 | + title: '请您先阅读和勾选指定的内容', | |
92 | + icon: 'none', | |
93 | + }); | |
94 | + return false; | |
95 | + } | |
96 | + var that = this; | |
97 | + //-- 点击授权 -- | |
98 | + that.getUserProfile(function (res) { | |
99 | + var user = res; | |
100 | + //--拿下code-- | |
101 | + wx.login({ | |
102 | + success: function (o) { | |
103 | + var dd = { | |
104 | + js_code: o.code, | |
105 | + store_id: os.stoid, | |
106 | + nickname: app.clear_word(app.globalData.getu.nickName), | |
107 | + head_pic: app.clear_word(app.globalData.getu.avatarUrl) | |
108 | + }; | |
109 | + //-- 导购会员ID -- | |
110 | + if (getApp().globalData.guide_id) { | |
111 | + dd.guide_id = getApp().globalData.guide_id; | |
112 | + } | |
113 | + | |
114 | + getApp().request.get("/api/weshop/users/openidandkey", { | |
115 | + data: dd, | |
116 | + success: function (e) { | |
117 | + if (e.data.code == 0) { | |
118 | + that.setData({user: user}) | |
119 | + //如果有会员的话,没有sessionKey | |
120 | + if (!e.data.data.sessionKey) { | |
121 | + getApp().showWarning("登录成功"); | |
122 | + getApp().globalData.userInfo = e.data.data; | |
123 | + getApp().globalData.user_id = e.data.data.user_id; | |
124 | + getApp().globalData.openid = e.data.data.weapp_openid; | |
125 | + //把会员的信息存在内存 | |
126 | + wx.setStorageSync("userinfo", e.data.data); | |
127 | + | |
128 | + setTimeout(function () { | |
129 | + getApp().globalData.login_back = 1; | |
130 | + that.cancle_bind(); //关闭 | |
131 | + }, 1000) | |
132 | + } else { | |
133 | + getApp().globalData.sessionKey = e.data.data.sessionKey; | |
134 | + getApp().globalData.openid = e.data.data.openid; | |
135 | + that.setData({show_bind: 1}); | |
136 | + } | |
137 | + } else { | |
138 | + getApp().confirmBox(e.data.msg); | |
139 | + } | |
140 | + } | |
141 | + }); | |
142 | + } | |
143 | + }) | |
144 | + | |
145 | + }) | |
146 | + }, | |
147 | + | |
148 | + //-- 调整后的获取会员信息 -- | |
149 | + getUserProfile: function (func) { | |
150 | + var that = this; | |
151 | + wx.getUserProfile({ | |
152 | + desc: '获取用户相关信息', | |
153 | + success: res => { | |
154 | + console.log("getUserProfile", res); | |
155 | + //此处授权得到userInfo | |
156 | + getApp().globalData.getu = res.userInfo; | |
157 | + func(res.userInfo); | |
158 | + } | |
159 | + }); | |
160 | + }, | |
161 | + | |
162 | + //暂不登录,返回上一页 | |
163 | + cancle_bind: function () { | |
164 | + var item={}; | |
165 | + this.triggerEvent('cancle_lg',item)//通过triggerEvent将参数传给父组件 | |
166 | + }, | |
167 | + | |
168 | + close_pop: function () { | |
169 | + this.setData({show_bind: 0}) | |
170 | + }, | |
171 | + show_bind_mobile: function () { | |
172 | + let th = this; | |
173 | + th.sendsm(function () { | |
174 | + th.setData({show_bind: 1}) | |
175 | + }) | |
176 | + }, | |
177 | + | |
178 | + | |
179 | + save_the_data: async function (r, e, sessionKey, openid) { | |
180 | + var app = getApp(), a = app, th = this; | |
181 | + var dd = { | |
182 | + oauth: "miniapp", | |
183 | + nickname: a.clear_word(r.nickName), | |
184 | + head_pic: r.avatarUrl, | |
185 | + sex: r.gender, | |
186 | + terminal: "miniapp", | |
187 | + sessionKey: sessionKey, | |
188 | + openid: openid, | |
189 | + encryptedData: e.encryptedData, | |
190 | + iv: e.iv, | |
191 | + store_id: getApp().globalData.setting.stoid, | |
192 | + }; | |
193 | + //--如果有邀请人的时候-- | |
194 | + if (th.data.first_leader) { | |
195 | + //判断一下分享人是不是分享商 | |
196 | + await app.request.promiseGet("/api/weshop/users/get/" + os.stoid + "/" + th.data.first_leader, {}).then(res => { | |
197 | + if (res.data.code == 0) { | |
198 | + var user = res.data.data; | |
199 | + if (user.is_distribut == 1) { | |
200 | + dd.first_leader = th.data.first_leader; | |
201 | + } | |
202 | + } | |
203 | + }) | |
204 | + } | |
205 | + //-- 导购会员ID -- | |
206 | + if (getApp().globalData.guide_id) { | |
207 | + dd.guide_id = getApp().globalData.guide_id; | |
208 | + } | |
209 | + | |
210 | + //门店的扫描识别码 | |
211 | + if (getApp().globalData.store_number) { | |
212 | + dd.SunCode = encodeURIComponent(getApp().globalData.store_number.trim()); | |
213 | + } | |
214 | + | |
215 | + console.log("-----会员注册的信息-------"); | |
216 | + console.log(dd); | |
217 | + app.request.get("/api/weshop/users/thirdLogin", { | |
218 | + data: dd, | |
219 | + success: function (e) { | |
220 | + | |
221 | + if (e.data.code == 0) { | |
222 | + app.globalData.user_id = e.data.data.user_id; | |
223 | + } else { | |
224 | + return app.showWarning("授权登入失败!" + e.data.msg); | |
225 | + } | |
226 | + | |
227 | + | |
228 | + var need_go = 0; | |
229 | + var t_user = e.data.data; | |
230 | + | |
231 | + | |
232 | + getApp().globalData.login_back = 1; | |
233 | + wx.setStorageSync("userinfo", e.data.data); | |
234 | + wx.setStorageSync("isAuth", !0), app.globalData.userInfo = e.data.data, app.globalData.userInfo.head_pic = t.getFullUrl(a.globalData.userInfo.head_pic); | |
235 | + | |
236 | + //如果有需要完善的信息没有完善,就需要跳转 | |
237 | + if (!t_user['vipname'] && th.data.name_need_go) { | |
238 | + need_go = 1; | |
239 | + } | |
240 | + if (!t_user['birthday'] && th.data.birth_need_go) { | |
241 | + need_go = 1; | |
242 | + } | |
243 | + if (!t_user['idcard'] && th.data.idcard_need_go) { | |
244 | + need_go = 1; | |
245 | + } | |
246 | + if (!t_user['address'] && th.data.address_need_go) { | |
247 | + need_go = 1; | |
248 | + } | |
249 | + if (!t_user['pickup_id'] && th.data.pick_need_go) { | |
250 | + need_go = 1; | |
251 | + } | |
252 | + if (!t_user['sex'] && th.data.sex_need_go) { | |
253 | + need_go = 1; | |
254 | + } | |
255 | + if (!t_user['fromuser_id'] && th.data.introducer_need_go) { | |
256 | + need_go = 1; | |
257 | + } | |
258 | + | |
259 | + if (need_go) { | |
260 | + getApp().goto("/packageA/pages/profile/profile?is_back=1"); | |
261 | + } else { | |
262 | + that.cancle_bind();//关闭 | |
263 | + } | |
264 | + | |
265 | + }, | |
266 | + failStatus: function (t) { | |
267 | + return app.my_warnning("授权登入失败,请稍后再试!", 0, that); | |
268 | + }, | |
269 | + fail: function (t) { | |
270 | + return i.clearAuth(), i.alertLoginErrorAndGoHome(), !1; | |
271 | + } | |
272 | + }); | |
273 | + }, | |
274 | + | |
275 | + bind_bnerr: function (e) { | |
276 | + var _errImg = e.target.dataset.errorimg; | |
277 | + var _errObj = {}; | |
278 | + _errObj[_errImg] = this.data.imghots + "/miniapp/images/logo.png"; | |
279 | + this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ; | |
280 | + }, | |
281 | + | |
282 | + //-- 会员授权 -- | |
283 | + bindUserInfo: function (ee) { | |
284 | + var that = this; | |
285 | + var user = ee.detail.userInfo; | |
286 | + //此处授权得到userInfo | |
287 | + getApp().globalData.getu = user; | |
288 | + | |
289 | + //--拿下code-- | |
290 | + wx.login({ | |
291 | + success: function (o) { | |
292 | + var dd = { | |
293 | + js_code: o.code, | |
294 | + store_id: os.stoid, | |
295 | + nickname: app.clear_word(app.globalData.getu.nickName), | |
296 | + head_pic: app.clear_word(app.globalData.getu.avatarUrl) | |
297 | + }; | |
298 | + //-- 导购会员ID -- | |
299 | + if (getApp().globalData.guide_id) { | |
300 | + dd.guide_id = getApp().globalData.guide_id; | |
301 | + } | |
302 | + | |
303 | + getApp().request.get("/api/weshop/users/openidandkey", { | |
304 | + data: dd, | |
305 | + success: function (e) { | |
306 | + if (e.data.code == 0) { | |
307 | + that.setData({user: user}) | |
308 | + //如果有会员的话,没有sessionKey | |
309 | + if (!e.data.data.sessionKey) { | |
310 | + getApp().showWarning("登录成功"); | |
311 | + getApp().globalData.userInfo = e.data.data; | |
312 | + getApp().globalData.user_id = e.data.data.user_id; | |
313 | + getApp().globalData.openid = e.data.data.weapp_openid; | |
314 | + //把会员的信息存在内存 | |
315 | + wx.setStorageSync("userinfo", e.data.data); | |
316 | + | |
317 | + setTimeout(function () { | |
318 | + //getApp().globalData.login_back = 1; | |
319 | + that.cancle_bind(); //关闭 | |
320 | + }, 1000) | |
321 | + } else { | |
322 | + getApp().globalData.sessionKey = e.data.data.sessionKey; | |
323 | + getApp().globalData.openid = e.data.data.openid; | |
324 | + that.setData({show_bind: 1}); | |
325 | + } | |
326 | + } else { | |
327 | + getApp().confirmBox(e.data.msg); | |
328 | + } | |
329 | + } | |
330 | + }); | |
331 | + } | |
332 | + }) | |
333 | + | |
334 | + | |
335 | + }, | |
336 | + | |
337 | + | |
338 | + close_pop_back: function () { | |
339 | + this.close_pop(); | |
340 | + wx.navigateBack({delta: 1}) | |
341 | + }, | |
342 | + | |
343 | + | |
344 | + // 是否同意协议 | |
345 | + isAgree(e) { | |
346 | + let isAgree = null; | |
347 | + if (e.detail.value[0]) { | |
348 | + isAgree = true; | |
349 | + } else { | |
350 | + isAgree = false; | |
351 | + } | |
352 | + ; | |
353 | + // this.data.isAgree = isAgree; | |
354 | + this.setData({ | |
355 | + isAgree, | |
356 | + }); | |
357 | + }, | |
358 | + | |
359 | + | |
360 | + //通过路径跳转到其他页面 | |
361 | + goto: function (e) { | |
362 | + console.log('xxxx', e); | |
363 | + var url = e.currentTarget.dataset.url; | |
364 | + getApp().goto(url); | |
365 | + }, | |
366 | + | |
367 | + //订阅消息提醒 | |
368 | + sendsm: function (func) { | |
369 | + var template_id = this.data.template_id; | |
370 | + // //授权订阅 | |
371 | + wx.requestSubscribeMessage({ | |
372 | + tmplIds: [template_id], | |
373 | + success(res) { | |
374 | + func(); | |
375 | + }, | |
376 | + fail(res) { | |
377 | + func(); | |
378 | + } | |
379 | + }) | |
380 | + | |
381 | + }, | |
382 | + } | |
383 | + | |
384 | + | |
385 | +}) | ... | ... |
packageD/components/diy_login/login.json
0 → 100644
packageD/components/diy_login/login.wxml
0 → 100644
1 | +<view class="fir_view"> | |
2 | + | |
3 | + <!-- 登录图 --> | |
4 | + <view> | |
5 | + <view class="logins flex-center2 ali-c flex" style="padding-top: 120rpx;"> | |
6 | + <image mode="widthFix" bindtap="go_index" class="login_img_back" src="{{imghots}}/miniapp/images/loginbg.jpg"></image> | |
7 | + <view class="middle_view"> | |
8 | + <image bindtap="go_index" class="login_img" src="{{store_logo}}" binderror="bind_bnerr" lazy-load="true" data-errorimg="store_logo"></image> | |
9 | + <view>{{store.store_name}}</view> | |
10 | + </view> | |
11 | + </view> | |
12 | + </view> | |
13 | + | |
14 | + <!-- 登录按钮 --> | |
15 | + <view> | |
16 | + <view class="phones"> | |
17 | + | |
18 | + <view bindtap="" class="user-name flex-vertical fs24 jc-center"> | |
19 | + <checkbox-group bindchange="isAgree"> | |
20 | + <checkbox value="true"/> | |
21 | + </checkbox-group> | |
22 | + <view class="user-name-txt">我已阅读同意 <text class="gray" bindtap="goto" data-url="/packageA/pages/parseHtml/parseHtml?t=0">《用户使用协议》</text>与<text class="gray" bindtap="goto" data-url="/packageA/pages/parseHtml/parseHtml?t=1">《隐私政策》</text></view> | |
23 | + </view> | |
24 | + | |
25 | + <!-- 授权获取基础信息 --> | |
26 | + <block wx:if="{{canIUseGetUserProfile}}"> | |
27 | + <button hidden="{{user}}" class="getPhoneNumber" bindtap="bindGetUserInfo"> | |
28 | + <view class="flex flex-center ali-c"> | |
29 | + <image class="we_chat" src="{{imghots}}/miniapp/images/we_chat.png"></image> | |
30 | + <view>微信账号快捷登录</view> | |
31 | + </view> | |
32 | + </button> | |
33 | + </block> | |
34 | + | |
35 | + <block wx:else> | |
36 | + <!-- 授权获取基础信息 --> | |
37 | + <button hidden="{{user}}" class="getPhoneNumber" open-type="getUserInfo" bindgetuserinfo="bindUserInfo"> | |
38 | + <view class="flex flex-center ali-c"> | |
39 | + <image class="we_chat" src="{{imghots}}/miniapp/images/we_chat.png"></image> | |
40 | + <view>微信账号快捷登录</view> | |
41 | + </view> | |
42 | + </button> | |
43 | + </block> | |
44 | + | |
45 | + <!-- 点击显示绑定手机的对话框 --> | |
46 | + <button hidden="{{!user}}" class="getPhoneNumber" bindtap="show_bind_mobile"> | |
47 | + <view class="flex flex-center2 ali-c" > | |
48 | + <image class="we_chat" src="{{imghots}}/miniapp/images/we_chat.png"></image> | |
49 | + <view>微信账号快捷登录</view> | |
50 | + </view> | |
51 | + </button> | |
52 | + </view> | |
53 | + | |
54 | + <view wx:if="{{show_no}}" class="userlongin flex-center2 flex fs30 jc_sb" style="margin: 0 130rpx; "> | |
55 | + <view bindtap="cancle_bind">暂不登录</view> | |
56 | + </view> | |
57 | + | |
58 | + </view> | |
59 | + | |
60 | +</view> | |
61 | + | |
62 | + | |
63 | +<view wx:if="{{show_bind}}"> | |
64 | + <view class="cover-layer" bindtap="close_pop"></view> | |
65 | + <view class="p_content"> | |
66 | + <view class="p_title flex ali-c fs34"> | |
67 | + 登录手机号,同步会员信息以及订单记录 | |
68 | + </view> | |
69 | + <view class="flex btn_view"> | |
70 | + <view bindtap="close_pop_back" style="height: 100%; line-height:normal;" class="txt-center f2 flex ali-c flex-center2 fs36 b_right">暂不授权</view> | |
71 | + <button style="height: 100%;" class="g_mobile f2 flex ali-c flex-center2 fs36 txt-red" open-type="getPhoneNumber" bindgetphonenumber="getphone">立即授权</button> | |
72 | + </view> | |
73 | + </view> | |
74 | +</view> | |
75 | +<warn id="warn"></warn> | |
76 | + | |
77 | + | |
78 | + | |
79 | +<wxs module="filters" src="../../../utils/filter.wxs"></wxs> | |
80 | +<view class="container" wx:if="show_profile.js"> | |
81 | + | |
82 | + <!-- 头像,昵称,多个卡 --> | |
83 | + <view class="head flex-space-between"> | |
84 | + <view class="flex-center"> | |
85 | + | |
86 | + <view class="flex-center"> | |
87 | + <image class="Headportrait" src="{{user.head_pic}}"></image> | |
88 | + </view> | |
89 | + | |
90 | + <view class="flex-center vipmax"> | |
91 | + <view> | |
92 | + <view class="fs32"> | |
93 | + <view class="ellipsis-1 Nickname">{{user.nickname}} | |
94 | + </view> | |
95 | + </view> | |
96 | + </view> | |
97 | + </view> | |
98 | + | |
99 | + </view> | |
100 | + </view> | |
101 | + | |
102 | + <view class="user-container"> | |
103 | + <view class="Bbottom"> | |
104 | + | |
105 | + <!-- 如果需要接骚人信息 --> | |
106 | + <view class="user-name flex-vertical" data-type="nickname" wx:if="{{reg_info.introducer_state}}"> | |
107 | + <view class="user-name-txt">推荐人:</view> | |
108 | + <input bindinput="getReferee" bindblur="" value="{{user['fromuser_id']?user['fromuser_id']:''}}" data-name="推荐人" class="user-txt-right f1 pdl20 t-r" placeholder="请输入推荐人手机号码或卡号"/> | |
109 | + | |
110 | + <block wx:if="{{!user['fromuser_id']}}"> | |
111 | + <view class="c-red pdl20 fs24" wx:if="{{reg_info.introducer && (reg_info.introducer_type == 0)}}">+{{reg_info.introducer}}积分</view> | |
112 | + <view class="c-red pdl20 fs24" wx:elif="{{reg_info.introducer && (reg_info.introducer_type == 1)}}">+{{reg_info.introducer}}成长值</view> | |
113 | + </block> | |
114 | + </view> | |
115 | + | |
116 | + <!-- 如果需要接姓名信息 --> | |
117 | + <view class="user-name flex-vertical" data-type="nickname" wx:if="{{reg_info.name_state}}"> | |
118 | + <view class="user-name-txt">姓名:</view> | |
119 | + <input bindinput="getName" bindblur="" value="{{user['vipname']?user['vipname']:''}}" data-name="姓名" class="user-txt-right f1 pdl20 t-r" placeholder="请输入您的真实姓名"/> | |
120 | + <block wx:if="{{!user['vipname']}}"> | |
121 | + <view class="c-red pdl20 fs24" wx:if="{{reg_info.name && (reg_info.name_val_type == 0)}}">+{{reg_info.name}}积分</view> | |
122 | + <view class="c-red pdl20 fs24" wx:elif="{{reg_info.name && (reg_info.name_val_type == 1)}}">+{{reg_info.name}}成长值</view> | |
123 | + </block> | |
124 | + </view> | |
125 | + | |
126 | + <view class="user-name flex-vertical" data-type="sex" wx:if="{{reg_info.sex_state }}"> | |
127 | + <view>性别:</view> | |
128 | + <view class="flex f1 pdl20 jc_fe"> | |
129 | + <view class="flex-center {{isGender==1?'Gendercheck':'Gender'}}" data-sex="1" bindtap="getGender"> | |
130 | + <block wx:if="{{isGender==1}}"> | |
131 | + <image class="GenderImage" src="{{iurl}}/miniapp/images/userinfo/userinfo/malealready.png"></image> | |
132 | + </block> | |
133 | + <block wx:else> | |
134 | + <image class="GenderImage" src="{{iurl}}/miniapp/images/userinfo/userinfo/malenot.png"></image> | |
135 | + </block> | |
136 | + <view class="fs24">男</view> | |
137 | + </view> | |
138 | + <view class="flex-center {{isGender==2?'Gendercheck':'Gender'}} mgl20" data-sex="2" bindtap="getGender"> | |
139 | + <block wx:if="{{isGender==2}}"> | |
140 | + <image class="GenderImage" src="{{iurl}}/miniapp/images/userinfo/userinfo/femalealready.png"></image> | |
141 | + </block> | |
142 | + <block wx:else> | |
143 | + <image class="GenderImage" src="{{iurl}}/miniapp/images/userinfo/userinfo/femalenot.png"></image> | |
144 | + </block> | |
145 | + <view class="fs26">女</view> | |
146 | + </view> | |
147 | + </view> | |
148 | + | |
149 | + <block wx:if="{{!user['sex']}}"> | |
150 | + <view class="c-red pdl20 fs24" wx:if="{{reg_info.sex && (reg_info.sex_state_type == 0)}}">+{{reg_info.sex}}积分</view> | |
151 | + <view class="c-red pdl20 fs24" wx:elif="{{reg_info.sex && (reg_info.sex_state_type == 1)}}">+{{reg_info.sex}}成长值</view> | |
152 | + </block> | |
153 | + </view> | |
154 | + | |
155 | + <view class="user-name flex-vertical" data-type="birthday" wx:if="{{reg_info.birthday_state}}" style="justify-content: space-between;"> | |
156 | + <view class="shrink0">出生日期:</view> | |
157 | + <view class="flex fs28 Birth pdl20 jc_fe"> | |
158 | + <view class="user-txt-right pdl20 flex ai-center"> | |
159 | + <checkbox-group bindchange="isLunar"> | |
160 | + <label class="flex ai-center"> | |
161 | + <checkbox value="{{isLunar}}" checked="{{isLunar}}"/>农历 | |
162 | + </label> | |
163 | + </checkbox-group> | |
164 | + <picker class="pdl20" bindchange='bindChange' mode="date" start="{{year-70}}-1-1" end="{{year}}-12-31"> | |
165 | + <view class="flex ai-center">{{datet?datet:"请选择时间"}}<view class="angle">∟</view></view> | |
166 | + </picker> | |
167 | + | |
168 | + | |
169 | + </view> | |
170 | + </view> | |
171 | + | |
172 | + <block wx:if="{{!user['birthday']}}"> | |
173 | + <view class="c-red pdl20 fs24 shrink0" wx:if="{{reg_info.birthday && (reg_info.birthday_type == 0)}}">+{{reg_info.birthday}}积分</view> | |
174 | + <view class="c-red pdl20 fs24 shrink0" wx:elif="{{reg_info.birthday && (reg_info.birthday_type == 1)}}">+{{reg_info.birthday}}成长值</view> | |
175 | + </block> | |
176 | + </view> | |
177 | + | |
178 | + | |
179 | + <view class="user-name flex-vertical" data-type="nickname" wx:if="{{reg_info.idcard_state}}"> | |
180 | + <view class="user-name-txt shrink0">身份证:</view> | |
181 | + <input bindinput="getId" bindblur="IdentityIDCard" value="{{user.idcard}}" class="user-txt-right pdl20 f1 t-r" placeholder="请输入身份证号码"></input> | |
182 | + <block wx:if="{{!user.idcard}}"> | |
183 | + <view class="c-red pdl20 fs24" wx:if="{{reg_info.idcard && (reg_info.idcard_type == 0)}}">+{{reg_info.idcard}}积分</view> | |
184 | + <view class="c-red pdl20 fs24" wx:elif="{{reg_info.idcard && (reg_info.idcard_type == 1)}}">+{{reg_info.idcard}}成长值</view> | |
185 | + </block> | |
186 | + </view> | |
187 | + | |
188 | + | |
189 | + <view class="user-name flex-vertical" data-type="mobile" wx:if="{{reg_info.address_state}}"> | |
190 | + <view class="user-name-txt">地址:</view> | |
191 | + <input bindinput="getAddress" bindblur="" value="{{user.address?user.address:''}}" data-name="姓名" class="user-txt-right f1" placeholder="请输入详细地址" style="text-align:right" /> | |
192 | + <block wx:if="{{!user.address}}"> | |
193 | + <view class="c-red pdl20 fs24" wx:if="{{reg_info.address && (reg_info.address_type == 0)}}">+{{reg_info.address}}积分</view> | |
194 | + <view class="c-red pdl20 fs24" wx:elif="{{reg_info.address && (reg_info.address_type == 1)}}">+{{reg_info.address}}成长值</view> | |
195 | + </block> | |
196 | + </view> | |
197 | + | |
198 | + | |
199 | + <!-- 选择门店 --> | |
200 | + <view bindtap="onclickstore" class="user-name flex-vertical" data-type="email" wx:if="{{reg_info.pick_state}}"> | |
201 | + <view class="user-name-txt">所属门店:</view> | |
202 | + <view class="user-txt-right f1 flex ai_c jc_fe"> | |
203 | + <view class="one-line">{{stoname?stoname:'请选择门店'}}</view> | |
204 | + <view class="angle">∟</view> | |
205 | + </view> | |
206 | + | |
207 | + <block wx:if="{{!user.pickup_id}}"> | |
208 | + <view class="c-red pdl20 fs24" wx:if="{{reg_info.pick && (reg_info.pick_type == 0)}}">+{{reg_info.pick}}积分</view> | |
209 | + <view class="c-red pdl20 fs24" wx:elif="{{reg_info.pick && (reg_info.pick_type == 1)}}">+{{reg_info.pick}}成长值</view> | |
210 | + </block> | |
211 | + </view> | |
212 | + | |
213 | + <!-- 我的兴趣 --> | |
214 | + <view wx:if="{{ isBool==1 && is_lable_set==1}}" class="padding Bbottom"> | |
215 | + <!-- 我的兴趣 --> | |
216 | + <view wx:if="{{is_lable_set!=null && is_lable_set==1}}" class="Bbottom"> | |
217 | + <view class="interest fs28"> | |
218 | + <view class="flex-vertical-between" bindtap="goto" data-url="/pages/user/labels/labels"> | |
219 | + <view class="fs30">我的兴趣</view> | |
220 | + <view class="angle">∟</view> | |
221 | + </view> | |
222 | + <!-- 选中的标签 --> | |
223 | + <view class="lables"> | |
224 | + <block wx:if="{{check_label.length>0}}"> | |
225 | + <view class="lable" wx:for="{{check_label}}" wx:for-item="label"> | |
226 | + <view class="ellipsis-1">{{label}}</view> | |
227 | + </view> | |
228 | + </block> | |
229 | + <!-- 添加标签按钮 --> | |
230 | + <view class="add_lable ib ellipsis-1" bindtap="goto" data-url="/pages/user/labels/labels"> | |
231 | + <text class="plus">+</text> | |
232 | + <text>标签</text> | |
233 | + </view> | |
234 | + </view> | |
235 | + </view> | |
236 | + </view> | |
237 | + </view> | |
238 | + | |
239 | + | |
240 | + <view bindtap="" class="user-name flex-vertical fs24"> | |
241 | + <checkbox-group bindchange="isAgree"> | |
242 | + <checkbox value="true"/> | |
243 | + </checkbox-group> | |
244 | + <view class="user-name-txt">我已阅读同意 <text class="red" bindtap="goto" data-url="/packageA/pages/parseHtml/parseHtml?t=0">《用户使用协议》</text>与<text class="red" bindtap="goto" data-url="/packageA/pages/parseHtml/parseHtml?t=1">《隐私政策》</text></view> | |
245 | + </view> | |
246 | + | |
247 | + </view> | |
248 | + </view> | |
249 | + | |
250 | + <!-- 保存按钮 --> | |
251 | + <view class="confirm"> | |
252 | + <view class="fs30 confirmtext" bindtap="save">保存</view> | |
253 | + <view class="star fs24 t-c pdt10 c9" wx:if="{{couponInfo}}">保存成功即可获得一张{{couponInfo}}</view> | |
254 | + </view> | |
255 | + | |
256 | + <!--弹出层内容,其中的“我知道”中绑定让弹出层消失的函数:bindtap="hide"--> | |
257 | + <view class="tc_view" hidden='{{tc_hide}}' bindtap='hide_tc'> | |
258 | + <view class="modal-box" hidden="{{flag}}" bindtap="hide"></view> | |
259 | + <view class="modal-body"> | |
260 | + <view class="modal-content"> | |
261 | + <view class="flex"> | |
262 | + <image src="{{user.head_pic}}" class="hd_img"></image> | |
263 | + <view class="ctent_txt"> | |
264 | + <view class='txt1'>{{user.nickname}} | |
265 | + <image wx:if="{{user.sex==2}}" class="arrow-right" src="{{iurl}}/miniapp/images/user/wum.png"></image> | |
266 | + <image wx:else class="arrow-right" src="{{iurl}}/miniapp/images/user/man.png"></image> | |
267 | + </view> | |
268 | + <view class='txt2' wx:if="{{user.address}}">{{user.address}}</view> | |
269 | + </view> | |
270 | + </view> | |
271 | + <view class="m_ta"> | |
272 | + <canvas class="g_img" canvas-id="qrcode" /> | |
273 | + </view> | |
274 | + <view class="s_sao">扫一扫上面的二维码图案,即可消费</view> | |
275 | + </view> | |
276 | + </view> | |
277 | + </view> | |
278 | + | |
279 | + <!-- 选择门店的弹框,1.1版最新的 --> | |
280 | + <block wx:if="{{store==1}}"> | |
281 | + <view class="mongolia-layer" bindtap="onclickstore"></view> | |
282 | + <view class="popup-frame"> | |
283 | + <block wx:if="{{sort_store==0}}"> | |
284 | + <!-- 头部 标题 --> | |
285 | + <view class="popup-top flex-space-between"> | |
286 | + <text class="fs32 nearby_store">{{choice_sort_store==0?'附近的门店':region_name}}</text> | |
287 | + <view> | |
288 | + <view> | |
289 | + <icon bindtap="onclickstore" class="modal-closes" color="black" size="22" type="cancel"></icon> | |
290 | + </view> | |
291 | + <view class="felx choose_more" bindtap="more_store" wx:if="{{is_show_sto_cat>0}}" > | |
292 | + <text class="fs26 red-co" >{{choice_sort_store==0?'更多门店':'返回'}}</text> | |
293 | + <view class="bg_rights"></view> | |
294 | + </view> | |
295 | + </view> | |
296 | + </view> | |
297 | + <!-- 门店列表,最外层的门店列表,一开始 --> | |
298 | + <view class="store-list"> | |
299 | + <!--如果还没有点击更多门店的时候 --> | |
300 | + <block wx:if="{{choice_sort_store==0}}"> | |
301 | + <!-- 需要for循环 --> | |
302 | + <block wx:if="{{is_show_sto_cat==1}}"> | |
303 | + <view class="store_choose flex" wx:for="{{def_pickpu_list}}" bindtap="choose_for_store_fir" data-ind="{{index}}"> | |
304 | + <view class="store flex-vertical"> | |
305 | + <!-- 需要点击事件 --> | |
306 | + <block wx:if="{{index==fir_pick_index}}"> | |
307 | + <view class="circle white xc-hook fs20 red-b">Г</view> | |
308 | + </block> | |
309 | + <block wx:else> | |
310 | + <view class="circle xc-hooks"></view> | |
311 | + </block> | |
312 | + <view class="address-frame xc-ash"> | |
313 | + <view class="flex-vertical-between butttem5"> | |
314 | + <view class="flex xc-ash"> | |
315 | + <view class="fs30 xc-black3 address_name">{{item.pickup_name}}</view> | |
316 | + </view> | |
317 | + <view> | |
318 | + <view class="distance fs24 address-val" wx:if="{{item.distance!=null}}"> | |
319 | + 距离:{{item.distance>1000?filters.toFix(item.distance/1000,2)+'km':filters.toFix(item.distance,0)+"m"}}</view> | |
320 | + </view> | |
321 | + </view> | |
322 | + <view class="fs24 xc-ash-9f">地址:{{item.fulladdress}}</view> | |
323 | + </view> | |
324 | + </view> | |
325 | + </view> | |
326 | + </block> | |
327 | + <block wx:else> | |
328 | + <view class="store_choose flex" wx:for="{{only_pk}}" bindtap="choose_for_store_fir" data-ind="{{index}}"> | |
329 | + <view class="store flex-vertical"> | |
330 | + <!-- 需要点击事件 --> | |
331 | + <block wx:if="{{index==fir_pick_index}}"> | |
332 | + <view class="circle white xc-hook fs20 red-b">Г</view> | |
333 | + </block> | |
334 | + <block wx:else> | |
335 | + <view class="circle xc-hooks"></view> | |
336 | + </block> | |
337 | + | |
338 | + <view class="address-frame xc-ash"> | |
339 | + <view class="flex-vertical-between "> | |
340 | + <view class="flex xc-ash"> | |
341 | + <view class="fs30 xc-black3 address_name">{{item.pickup_name}}</view> | |
342 | + </view> | |
343 | + <view> | |
344 | + <view class="distance fs24 address-val" wx:if="{{item.distance!=null}}">距离:{{item.distance>1000?filters.toFix(item.distance/1000,2)+"km":filters.toFix(item.distance,0)+"m"}} | |
345 | + </view> | |
346 | + </view> | |
347 | + </view> | |
348 | + <view class="fs24 xc-ash-9f">地址:{{item.fulladdress}}</view> | |
349 | + </view> | |
350 | + </view> | |
351 | + </view> | |
352 | + </block> | |
353 | + </block> | |
354 | + <block wx:else> | |
355 | + <!-- 如果是点击选择门店分类后显示分类下的门店 --> | |
356 | + <view class="store_choose flex" wx:for="{{sec_sto.s_arr}}" data-ind="{{index}}" bindtap="choose_for_store"> | |
357 | + <view class="store flex-vertical"> | |
358 | + <!-- 需要点击事件 --> | |
359 | + <block wx:if="{{index==sec_pick_index}}"> | |
360 | + <view class="circle white xc-hook fs20 red-b">Г</view> | |
361 | + </block> | |
362 | + <block wx:else> | |
363 | + <view class="circle xc-hooks"></view> | |
364 | + </block> | |
365 | + | |
366 | + <view class="address-frame xc-ash"> | |
367 | + <view class="flex-vertical-between "> | |
368 | + <view class="flex xc-ash"> | |
369 | + <view class="fs28 xc-black3 address_name">{{item.pickup_name}}</view> | |
370 | + </view> | |
371 | + <view> | |
372 | + <view class="distance fs24 address-val" wx:if="{{item.distance!=null}}"> 距离:{{item.distance>1000?filters.toFix(item.distance/1000,2)+"km":filters.toFix(item.distance,0)+"m"}}</view> | |
373 | + </view> | |
374 | + </view> | |
375 | + <view class="fs24 xc-ash-9f">地址:{{item.fulladdress}}</view> | |
376 | + </view> | |
377 | + </view> | |
378 | + </view> | |
379 | + </block> | |
380 | + | |
381 | + </view> | |
382 | + | |
383 | + <!-- 门店列表底部 --> | |
384 | + <view class="store-bottom-frame"> | |
385 | + <view class="store-bottom flex-center"> | |
386 | + <view class="determine red-b fs30 white t-c" bindtap="sure_pick" data-openindstore="{{open_ind_store}}">确定</view> | |
387 | + <!-- <view class="default t-c fs28" bindtap="set_def_pick" data-openindstore="{{open_ind_store}}">设为默认</view> --> | |
388 | + </view> | |
389 | + </view> | |
390 | + | |
391 | + </block> | |
392 | + | |
393 | + | |
394 | + <block wx:else> | |
395 | + <view class="popup-top flex-space-between"> | |
396 | + <text class="fs32 nearby_store">门店分类选择</text> | |
397 | + <view> | |
398 | + <view> | |
399 | + <icon bindtap="onclickstore" class="modal-closes" color="black" size="22" type="cancel"></icon> | |
400 | + </view> | |
401 | + </view> | |
402 | + </view> | |
403 | + <view class="sort_store_list"> | |
404 | + | |
405 | + <view class="sort-store-frame" wx:for="{{all_sto}}" data-index="{{index}}" bindtap="choice_sort_store" data-region="{{item.name}}"> | |
406 | + <view class="sort-store flex-vertical-between"> | |
407 | + <view class="fs30" di>{{item.name}}</view> | |
408 | + <view class="black_rights-frame"> | |
409 | + <view class="black_rights"></view> | |
410 | + </view> | |
411 | + </view> | |
412 | + </view> | |
413 | + | |
414 | + </view> | |
415 | + </block> | |
416 | + </view> | |
417 | + </block> | |
418 | +</view> | ... | ... |
packageD/components/diy_login/login.wxss
0 → 100644
1 | +@import '/app.wxss'; | |
2 | + | |
3 | +.fir_view{ | |
4 | + position: fixed;top:0;left:0; width: 100%; height: 100%; | |
5 | + background-color: #fff;z-index: 1000; | |
6 | +} | |
7 | +.logins { | |
8 | + width: 100%; | |
9 | + /* padding-bottom: 130rpx; */ | |
10 | + background-position: center; | |
11 | + background-repeat: no-repeat; | |
12 | + background-size: cover | |
13 | +} | |
14 | + | |
15 | +.login_img { | |
16 | + width: 192rpx; | |
17 | + height: 192rpx; | |
18 | + border-radius: 50%; | |
19 | +} | |
20 | +.phones{ | |
21 | + margin-bottom: 48rpx; | |
22 | +} | |
23 | +.getPhoneNumber { | |
24 | + width: 600rpx; | |
25 | + height: 94rpx; | |
26 | + line-height: 94rpx; | |
27 | + background-color: #57b837; | |
28 | + border-radius: 48rpx; | |
29 | + color: rgb(255,255,255); | |
30 | + font-size: 32rpx; | |
31 | + margin-top: 40rpx; | |
32 | +} | |
33 | +.we_chat{ | |
34 | + width: 55rpx; | |
35 | + height: 45rpx; | |
36 | + margin-right: 15rpx; | |
37 | +} | |
38 | +.userlongin{ | |
39 | + color: #767f8e; | |
40 | +} | |
41 | +button{ | |
42 | + border:none; | |
43 | +} | |
44 | +.login_img_back{ width: 100%;} | |
45 | +.p_content{ | |
46 | + margin: 10%; | |
47 | + width: 80%; | |
48 | + height:340rpx; | |
49 | + top:50%; | |
50 | + margin-top: -180rpx; | |
51 | + background-color: #fff; | |
52 | + z-index: 12; | |
53 | + position: fixed; | |
54 | +} | |
55 | + | |
56 | +.btn_view { height: 120rpx; line-height: 120rpx; border-top:1rpx solid #e9e9e9;} | |
57 | +.p_title{ height:220rpx; padding: 0 40rpx; line-height: 50rpx;} | |
58 | +.g_mobile{ background: none;line-height: normal;} | |
59 | +.b_right{border-right:1rpx solid #e9e9e9;} | |
60 | + | |
61 | +.ali-c{align-items: center;} | |
62 | +.flex-center2{ justify-content: center;} | |
63 | +.f2 { | |
64 | + flex: 2 0; | |
65 | +} | |
66 | + | |
67 | +.middle_view{ | |
68 | + position: absolute; left: 0; width: 100%; text-align: center; | |
69 | +} | |
70 | + | |
71 | +/*checkbox 选项框大小 */ | |
72 | +checkbox .wx-checkbox-input { | |
73 | + width: 30rpx; | |
74 | + height: 30rpx; | |
75 | +} | |
76 | + | |
77 | +.gray { | |
78 | + color: #767f8e; | |
79 | +} | ... | ... |
packageD/pages/AI-test-skin/success_result/acne/acne.js
... | ... | @@ -16,7 +16,7 @@ module.exports = { |
16 | 16 | }) |
17 | 17 | var re_word=set.join(','); |
18 | 18 | //-- 服务卡 -- |
19 | - var url="/api/weshop/serviceCard/page?orderField=RAND()&recommend_code="+r_code+"&store_id="+stoid+"&recommend_word="+re_word+"&pageSize=2"; | |
19 | + var url="/api/weshop/serviceCard/page?orderField=RAND()&recommend_code="+r_code+"&store_id="+stoid+"&recommend_word="+re_word+"&pageSize=2"+"&skinface_id="+th.data.id+"&user_id="+getApp().globalData.user_id; | |
20 | 20 | getApp().request.promiseGet(url, {}).then(res=>{ |
21 | 21 | if(res.data.code==0 && res.data.data && res.data.data.pageData && res.data.data.pageData.length>0){ |
22 | 22 | th.setData({acne_fuwu:res.data.data.pageData}) |
... | ... | @@ -24,7 +24,7 @@ module.exports = { |
24 | 24 | }) |
25 | 25 | |
26 | 26 | //-- 商品 -- |
27 | - var url="/api/weshop/goods/page?orderField=RAND()&recommend_code="+r_code+"&store_id="+stoid+"&recommend_word="+re_word+"&pageSize=2"; | |
27 | + var url="/api/weshop/goods/page?orderField=RAND()&recommend_code="+r_code+"&store_id="+stoid+"&recommend_word="+re_word+"&pageSize=2"+"&skinface_id="+th.data.id+"&user_id="+getApp().globalData.user_id; | |
28 | 28 | getApp().request.promiseGet(url, {}).then(res=>{ |
29 | 29 | if(res.data.code==0 && res.data.data && res.data.data.pageData && res.data.data.pageData.length>0){ |
30 | 30 | th.setData({acne_goods:res.data.data.pageData}) |
... | ... | @@ -32,7 +32,7 @@ module.exports = { |
32 | 32 | }) |
33 | 33 | |
34 | 34 | // 优惠券 |
35 | - var url="/api/weshop/prom/coupon/pageCouponList?orderField=RAND()&recommend_code="+r_code+"&store_id="+stoid+"&recommend_word="+re_word+"&pageSize=2"; | |
35 | + var url="/api/weshop/prom/coupon/pageCouponList?orderField=RAND()&recommend_code="+r_code+"&store_id="+stoid+"&recommend_word="+re_word+"&pageSize=2"+"&skinface_id="+th.data.id+"&user_id="+getApp().globalData.user_id; | |
36 | 36 | getApp().request.promiseGet(url, {}).then(res=>{ |
37 | 37 | if(res.data.code==0 && res.data.data && res.data.data.pageData && res.data.data.pageData.length>0){ |
38 | 38 | var arr=res.data.data.pageData; | ... | ... |
packageD/pages/AI-test-skin/success_result/blackhead/blackhead.js
... | ... | @@ -11,7 +11,8 @@ module.exports = { |
11 | 11 | }) |
12 | 12 | var re_word=set.join(','); |
13 | 13 | //-- 服务卡 -- |
14 | - var url="/api/weshop/serviceCard/page?orderField=RAND()&recommend_code="+r_code+"&store_id="+stoid+"&recommend_word="+re_word+"&pageSize=2"; | |
14 | + var url="/api/weshop/serviceCard/page?orderField=RAND()&recommend_code=" | |
15 | + +r_code+"&store_id="+stoid+"&recommend_word="+re_word+"&pageSize=2"+"&skinface_id="+th.data.id+"&user_id="+getApp().globalData.user_id; | |
15 | 16 | getApp().request.promiseGet(url, {}).then(res=>{ |
16 | 17 | if(res.data.code==0 && res.data.data && res.data.data.pageData && res.data.data.pageData.length>0){ |
17 | 18 | th.setData({blackhead_fuwu:res.data.data.pageData}) |
... | ... | @@ -19,7 +20,8 @@ module.exports = { |
19 | 20 | }) |
20 | 21 | |
21 | 22 | //-- 商品 -- |
22 | - var url="/api/weshop/goods/page?orderField=RAND()&recommend_code="+r_code+"&store_id="+stoid+"&recommend_word="+re_word+"&pageSize=2"; | |
23 | + var url="/api/weshop/goods/page?orderField=RAND()&recommend_code=" | |
24 | + +r_code+"&store_id="+stoid+"&recommend_word="+re_word+"&pageSize=2"+"&skinface_id="+th.data.id+"&user_id="+getApp().globalData.user_id; | |
23 | 25 | getApp().request.promiseGet(url, {}).then(res=>{ |
24 | 26 | if(res.data.code==0 && res.data.data && res.data.data.pageData && res.data.data.pageData.length>0){ |
25 | 27 | th.setData({blackhead_goods:res.data.data.pageData}) |
... | ... | @@ -27,7 +29,7 @@ module.exports = { |
27 | 29 | }) |
28 | 30 | |
29 | 31 | // 优惠券 |
30 | - var url="/api/weshop/prom/coupon/pageCouponList?orderField=RAND()&recommend_code="+r_code+"&store_id="+stoid+"&recommend_word="+re_word+"&pageSize=2"; | |
32 | + var url="/api/weshop/prom/coupon/pageCouponList?orderField=RAND()&recommend_code="+r_code+"&store_id="+stoid+"&recommend_word="+re_word+"&pageSize=2"+"&skinface_id="+th.data.id+"&user_id="+getApp().globalData.user_id; | |
31 | 33 | getApp().request.promiseGet(url, {}).then(res=>{ |
32 | 34 | if(res.data.code==0 && res.data.data && res.data.data.pageData && res.data.data.pageData.length>0){ |
33 | 35 | var arr=res.data.data.pageData; | ... | ... |
packageD/pages/AI-test-skin/success_result/dark/dark.js
... | ... | @@ -16,7 +16,7 @@ module.exports = { |
16 | 16 | //获取黑眼圈的类型 |
17 | 17 | var re_word= arr.join(',') |
18 | 18 | //-- 服务卡 -- |
19 | - var url="/api/weshop/serviceCard/page?orderField=RAND()&recommend_code="+r_code+"&store_id="+stoid+"&recommend_word="+re_word+"&pageSize=2"; | |
19 | + var url="/api/weshop/serviceCard/page?orderField=RAND()&recommend_code="+r_code+"&store_id="+stoid+"&recommend_word="+re_word+"&pageSize=2"+"&skinface_id="+th.data.id+"&user_id="+getApp().globalData.user_id; | |
20 | 20 | getApp().request.promiseGet(url, {}).then(res=>{ |
21 | 21 | if(res.data.code==0 && res.data.data && res.data.data.pageData && res.data.data.pageData.length>0){ |
22 | 22 | th.setData({dark_fuwu:res.data.data.pageData}) |
... | ... | @@ -24,14 +24,14 @@ module.exports = { |
24 | 24 | }) |
25 | 25 | |
26 | 26 | //-- 商品 -- |
27 | - var url="/api/weshop/goods/page?orderField=RAND()&recommend_code="+r_code+"&store_id="+stoid+"&recommend_word="+re_word+"&pageSize=2"; | |
27 | + var url="/api/weshop/goods/page?orderField=RAND()&recommend_code="+r_code+"&store_id="+stoid+"&recommend_word="+re_word+"&pageSize=2"+"&skinface_id="+th.data.id+"&user_id="+getApp().globalData.user_id; | |
28 | 28 | getApp().request.promiseGet(url, {}).then(res=>{ |
29 | 29 | if(res.data.code==0 && res.data.data && res.data.data.pageData && res.data.data.pageData.length>0){ |
30 | 30 | th.setData({dark_goods:res.data.data.pageData}) |
31 | 31 | } |
32 | 32 | }) |
33 | 33 | // 优惠券 |
34 | - var url="/api/weshop/prom/coupon/pageCouponList?orderField=RAND()&recommend_code="+r_code+"&store_id="+stoid+"&recommend_word="+re_word+"&pageSize=2"; | |
34 | + var url="/api/weshop/prom/coupon/pageCouponList?orderField=RAND()&recommend_code="+r_code+"&store_id="+stoid+"&recommend_word="+re_word+"&pageSize=2"+"&skinface_id="+th.data.id+"&user_id="+getApp().globalData.user_id; | |
35 | 35 | getApp().request.promiseGet(url, {}).then(res=>{ |
36 | 36 | if(res.data.code==0 && res.data.data && res.data.data.pageData && res.data.data.pageData.length>0){ |
37 | 37 | var arr=res.data.data.pageData; | ... | ... |
packageD/pages/AI-test-skin/success_result/fuwu.wxml
1 | -<view class="shoushu" style="margin-bottom: 20rpx" bindtap="go_url" data-url="/packageA/pages/goodsInfo/goodsInfo?goods_id={{item.id}}"> | |
1 | +<view class="shoushu" style="margin-bottom: 20rpx" bindtap="go_url" data-url="/packageA/pages/goodsInfo/goodsInfo?goods_id={{item.id}}&skinface_id={{id}}"> | |
2 | 2 | <view> |
3 | 3 | <image class="img" src="{{iurl}}{{item.imgUrl?item.imgUrl:'/miniapp/images/default_g_img.gif'}}"></image> |
4 | 4 | </view> | ... | ... |
packageD/pages/AI-test-skin/success_result/goods.wxml
1 | -<view class="product_item" data-url="{{s_filter.get_goods_url(item)}}" bindtap="go_url"> | |
1 | +<view class="product_item" data-url="{{s_filter.get_goods_url(item,id)}}" bindtap="go_url"> | |
2 | 2 | <view> |
3 | 3 | <image src="{{iurl+item.original_img}}" style="width: 100%;height: 200rpx;"></image> |
4 | 4 | </view> | ... | ... |
packageD/pages/AI-test-skin/success_result/pore/pore.js
... | ... | @@ -13,7 +13,7 @@ module.exports = { |
13 | 13 | }) |
14 | 14 | var re_word=set.join(','); |
15 | 15 | //-- 服务卡 -- |
16 | - var url="/api/weshop/serviceCard/page?orderField=RAND()&recommend_code="+r_code+"&store_id="+stoid+"&recommend_word="+re_word+"&pageSize=2"; | |
16 | + var url="/api/weshop/serviceCard/page?orderField=RAND()&recommend_code="+r_code+"&store_id="+stoid+"&recommend_word="+re_word+"&pageSize=2"+"&skinface_id="+th.data.id+"&user_id="+getApp().globalData.user_id; | |
17 | 17 | getApp().request.promiseGet(url, {}).then(res=>{ |
18 | 18 | if(res.data.code==0 && res.data.data && res.data.data.pageData && res.data.data.pageData.length>0){ |
19 | 19 | th.setData({pore_fuwu:res.data.data.pageData}); |
... | ... | @@ -21,7 +21,7 @@ module.exports = { |
21 | 21 | }) |
22 | 22 | |
23 | 23 | //-- 商品 -- |
24 | - var url="/api/weshop/goods/page?orderField=RAND()&recommend_code="+r_code+"&store_id="+stoid+"&recommend_word="+re_word+"&pageSize=2"; | |
24 | + var url="/api/weshop/goods/page?orderField=RAND()&recommend_code="+r_code+"&store_id="+stoid+"&recommend_word="+re_word+"&pageSize=2"+"&skinface_id="+th.data.id+"&user_id="+getApp().globalData.user_id; | |
25 | 25 | getApp().request.promiseGet(url, {}).then(res=>{ |
26 | 26 | if(res.data.code==0 && res.data.data && res.data.data.pageData && res.data.data.pageData.length>0){ |
27 | 27 | th.setData({pore_goods:res.data.data.pageData}); |
... | ... | @@ -29,7 +29,7 @@ module.exports = { |
29 | 29 | }) |
30 | 30 | |
31 | 31 | // 优惠券 |
32 | - var url="/api/weshop/prom/coupon/pageCouponList?orderField=RAND()&recommend_code="+r_code+"&store_id="+stoid+"&recommend_word="+re_word+"&pageSize=2"; | |
32 | + var url="/api/weshop/prom/coupon/pageCouponList?orderField=RAND()&recommend_code="+r_code+"&store_id="+stoid+"&recommend_word="+re_word+"&pageSize=2"+"&skinface_id="+th.data.id+"&user_id="+getApp().globalData.user_id; | |
33 | 33 | getApp().request.promiseGet(url, {}).then(res=>{ |
34 | 34 | if(res.data.code==0 && res.data.data && res.data.data.pageData && res.data.data.pageData.length>0){ |
35 | 35 | var arr=res.data.data.pageData; | ... | ... |
packageD/pages/AI-test-skin/success_result/s_filter.wxs
... | ... | @@ -9,17 +9,17 @@ var get_dark_type = function(column) { |
9 | 9 | } |
10 | 10 | |
11 | 11 | //跳转的接口 |
12 | -var get_goods_url=function(item){ | |
13 | - var url1="/pages/goods/goodsInfo/goodsInfo?goods_id="+item.goods_id | |
12 | +var get_goods_url=function(item,skinface_id){ | |
13 | + var url1="/pages/goods/goodsInfo/goodsInfo?goods_id="+item.goods_id+"&skinface_id="+skinface_id; | |
14 | 14 | |
15 | 15 | if(item.prom_type == 9) { |
16 | - url1 = '/packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo?goods_id=' + item.goods_id + '&group_id=' + item.prom_id; | |
16 | + url1 = '/packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo?goods_id=' + item.goods_id + '&group_id=' + item.prom_id+"&skinface_id="+skinface_id; | |
17 | 17 | } |
18 | 18 | if(item.prom_type==8){ |
19 | - url1="/packageC/pages/presell/goodsInfo/goodsInfo?goods_id="+item.goods_id+"&prom_id="+item.prom_id | |
19 | + url1="/packageC/pages/presell/goodsInfo/goodsInfo?goods_id="+item.goods_id+"&prom_id="+item.prom_id+"&skinface_id="+skinface_id; | |
20 | 20 | } |
21 | 21 | if(item.prom_type==1 && item.prom_id>0 ){ |
22 | - url1="/pages/goods/goodsInfo/goodsInfo?goods_id="+item.goods_id+"&prom_id="+item.prom_id+"&prom_type=1"; | |
22 | + url1="/pages/goods/goodsInfo/goodsInfo?goods_id="+item.goods_id+"&prom_id="+item.prom_id+"&prom_type=1&skinface_id="+skinface_id; | |
23 | 23 | } |
24 | 24 | return url1; |
25 | 25 | } |
... | ... | @@ -42,6 +42,7 @@ var dryoil_check=function(skin_dryoil_check){ |
42 | 42 | case 0:return '干性'; |
43 | 43 | case 1:return '中性'; |
44 | 44 | case 2:return '油性'; |
45 | + case 3:return '混合性'; | |
45 | 46 | } |
46 | 47 | return ''; |
47 | 48 | } | ... | ... |
packageD/pages/AI-test-skin/success_result/sensitive/sensitive.js
... | ... | @@ -11,7 +11,7 @@ module.exports = { |
11 | 11 | }) |
12 | 12 | var re_word = set.join(','); |
13 | 13 | //-- 服务卡 -- |
14 | - var url = "/api/weshop/serviceCard/page?orderField=RAND()&recommend_code=" + r_code + "&store_id=" + stoid + "&recommend_word=" + re_word + "&pageSize=2"; | |
14 | + var url = "/api/weshop/serviceCard/page?orderField=RAND()&recommend_code=" + r_code + "&store_id=" + stoid + "&recommend_word=" + re_word + "&pageSize=2"+"&skinface_id="+th.data.id; | |
15 | 15 | getApp().request.promiseGet(url, {}).then(res => { |
16 | 16 | if (res.data.code == 0 && res.data.data && res.data.data.pageData && res.data.data.pageData.length > 0) { |
17 | 17 | th.setData({ sensitive_fuwu: res.data.data.pageData }) |
... | ... | @@ -19,14 +19,14 @@ module.exports = { |
19 | 19 | }) |
20 | 20 | |
21 | 21 | //-- 商品 -- |
22 | - var url = "/api/weshop/goods/page?orderField=RAND()&recommend_code=" + r_code + "&store_id=" + stoid + "&recommend_word=" + re_word + "&pageSize=2"; | |
22 | + var url = "/api/weshop/goods/page?orderField=RAND()&recommend_code=" + r_code + "&store_id=" + stoid + "&recommend_word=" + re_word + "&pageSize=2"+"&skinface_id="+th.data.id; | |
23 | 23 | getApp().request.promiseGet(url, {}).then(res => { |
24 | 24 | if (res.data.code == 0 && res.data.data && res.data.data.pageData && res.data.data.pageData.length > 0) { |
25 | 25 | th.setData({ sensitive_goods: res.data.data.pageData }) |
26 | 26 | } |
27 | 27 | }) |
28 | 28 | // 优惠券 |
29 | - var url = "/api/weshop/prom/coupon/pageCouponList?orderField=RAND()&recommend_code=" + r_code + "&store_id=" + stoid + "&recommend_word=" + re_word + "&pageSize=2"; | |
29 | + var url = "/api/weshop/prom/coupon/pageCouponList?orderField=RAND()&recommend_code=" + r_code + "&store_id=" + stoid + "&recommend_word=" + re_word + "&pageSize=2"+"&skinface_id="+th.data.id+"&user_id="+getApp().globalData.user_id; | |
30 | 30 | getApp().request.promiseGet(url, {}).then(res => { |
31 | 31 | if (res.data.code == 0 && res.data.data && res.data.data.pageData && res.data.data.pageData.length > 0) { |
32 | 32 | var arr=res.data.data.pageData; | ... | ... |
packageD/pages/AI-test-skin/success_result/speckle/speckle.js
... | ... | @@ -17,7 +17,7 @@ module.exports = { |
17 | 17 | }) |
18 | 18 | var re_word=set.join(','); |
19 | 19 | //-- 服务卡 -- |
20 | - var url="/api/weshop/serviceCard/page?orderField=RAND()&recommend_code="+r_code+"&store_id="+stoid+"&recommend_word="+re_word+"&pageSize=2"; | |
20 | + var url="/api/weshop/serviceCard/page?orderField=RAND()&recommend_code="+r_code+"&store_id="+stoid+"&recommend_word="+re_word+"&pageSize=2"+"&skinface_id="+th.data.id+"&user_id="+getApp().globalData.user_id; | |
21 | 21 | getApp().request.promiseGet(url, {}).then(res=>{ |
22 | 22 | if(res.data.code==0 && res.data.data && res.data.data.pageData && res.data.data.pageData.length>0){ |
23 | 23 | th.setData({speckle_fuwu:res.data.data.pageData}) |
... | ... | @@ -25,7 +25,7 @@ module.exports = { |
25 | 25 | }) |
26 | 26 | |
27 | 27 | //-- 商品 -- |
28 | - var url="/api/weshop/goods/page?orderField=RAND()&recommend_code="+r_code+"&store_id="+stoid+"&recommend_word="+re_word+"&pageSize=2"; | |
28 | + var url="/api/weshop/goods/page?orderField=RAND()&recommend_code="+r_code+"&store_id="+stoid+"&recommend_word="+re_word+"&pageSize=2"+"&skinface_id="+th.data.id+"&user_id="+getApp().globalData.user_id; | |
29 | 29 | getApp().request.promiseGet(url, {}).then(res=>{ |
30 | 30 | if(res.data.code==0 && res.data.data && res.data.data.pageData && res.data.data.pageData.length>0){ |
31 | 31 | th.setData({speckle_goods:res.data.data.pageData}) |
... | ... | @@ -33,7 +33,7 @@ module.exports = { |
33 | 33 | }) |
34 | 34 | |
35 | 35 | // 优惠券 |
36 | - var url="/api/weshop/prom/coupon/pageCouponList?orderField=RAND()&recommend_code="+r_code+"&store_id="+stoid+"&recommend_word="+re_word+"&pageSize=2"; | |
36 | + var url="/api/weshop/prom/coupon/pageCouponList?orderField=RAND()&recommend_code="+r_code+"&store_id="+stoid+"&recommend_word="+re_word+"&pageSize=2"+"&skinface_id="+th.data.id+"&user_id="+getApp().globalData.user_id; | |
37 | 37 | getApp().request.promiseGet(url, {}).then(res=>{ |
38 | 38 | if(res.data.code==0 && res.data.data && res.data.data.pageData && res.data.data.pageData.length>0){ |
39 | 39 | var arr=res.data.data.pageData; | ... | ... |
packageD/pages/AI-test-skin/success_result/success_result.js
... | ... | @@ -60,6 +60,9 @@ Page({ |
60 | 60 | acne_num2: 0, //痘印 |
61 | 61 | acne_num3: 0, //脓包 |
62 | 62 | acne_num4: 0, //结节 |
63 | + | |
64 | + | |
65 | + login_set:{show_no:0} | |
63 | 66 | }, |
64 | 67 | |
65 | 68 | onReady: function () { |
... | ... | @@ -95,7 +98,8 @@ Page({ |
95 | 98 | } |
96 | 99 | } |
97 | 100 | |
98 | - this.data.id=id; | |
101 | + //this.data.id=id; | |
102 | + this.setData({id:id}) | |
99 | 103 | if (first_leader) { |
100 | 104 | console.log("log---".first_leader); |
101 | 105 | getApp().globalData.first_leader = first_leader; |
... | ... | @@ -123,6 +127,7 @@ Page({ |
123 | 127 | |
124 | 128 | var bi1 = (th.data.cHeight * 0.8 * 0.8) / (th.data.cWidth * 0.8); |
125 | 129 | th.get_data(function (json, json1, img) { |
130 | + var key_arr=[]; | |
126 | 131 | //-- 数据先存着 -- |
127 | 132 | var face_data = th.data.face_data = json.face_list[0]; |
128 | 133 | var face_data1 = th.data.face_data1 = json1.face_list[0]; |
... | ... | @@ -146,7 +151,14 @@ Page({ |
146 | 151 | if (dark_type1 > dark_type) { |
147 | 152 | dark_type = dark_type1; |
148 | 153 | } |
154 | + | |
155 | + key_arr.push(35); | |
149 | 156 | var skin_sensitive_check = parseInt(face_data.skinquality.skin_sensitive_check[0]); |
157 | + switch(skin_sensitive_check){ | |
158 | + case 0: key_arr.push(36); break;//耐受 | |
159 | + case 1: key_arr.push(37); break;//中性 | |
160 | + case 2: key_arr.push(38); break;//敏感 | |
161 | + } | |
150 | 162 | var skin_dryoil_check = face_data.skinquality.skin_dryoil_check; |
151 | 163 | |
152 | 164 | var location = face_data.location; |
... | ... | @@ -176,6 +188,7 @@ Page({ |
176 | 188 | else if (skin_dryoil_check_arr.length == 1) skin_dryoil_check_type = parseInt(skin_dryoil_check_arr[0]); |
177 | 189 | else skin_dryoil_check_type = 3; |
178 | 190 | |
191 | + | |
179 | 192 | var wrinkle_types = face_data.wrinkle.wrinkle_types; |
180 | 193 | var w_arr = wrinkle_types.filter(function (e) { |
181 | 194 | return e == 1; |
... | ... | @@ -222,26 +235,63 @@ Page({ |
222 | 235 | return e.type == 3; |
223 | 236 | }) |
224 | 237 | th.data.acne_num4 = a_arr.length; |
238 | + | |
225 | 239 | let tab_arr = [{ id: 'zong_he', name: '综合肤质' }]; |
226 | 240 | if (pore_num) { |
227 | 241 | tab_arr.push({ id: 'mao_kong', name: '毛孔' }); |
242 | + key_arr.push(30); | |
228 | 243 | } |
229 | 244 | if (blackhead_num) { |
230 | 245 | tab_arr.push({ id: 'hei_tou', name: '黑头' }); |
246 | + key_arr.push(26); | |
231 | 247 | } |
232 | 248 | if (speckle_num) { |
233 | 249 | tab_arr.push({ id: 'se_ban', name: '色斑' }); |
250 | + key_arr.push(13); | |
234 | 251 | } |
235 | 252 | if (wrinkle_num) { |
236 | 253 | tab_arr.push({ id: 'zhou_wen', name: '皱纹' }); |
254 | + key_arr.push(2); | |
237 | 255 | } |
238 | 256 | if (dark_type > -1) { |
239 | 257 | tab_arr.push({ id: 'hei_yan_quan', name: '黑眼圈' }); |
258 | + key_arr.push(18); | |
259 | + | |
260 | + switch(dark_type){ | |
261 | + case 0: key_arr.push(19); break;//黑眼圈-色素型 | |
262 | + case 1: key_arr.push(20); break;//黑眼圈-阴影型 | |
263 | + case 2: key_arr.push(21); break;//黑眼圈-血管型 | |
264 | + } | |
265 | + | |
240 | 266 | } |
241 | 267 | if (acne_num) { |
242 | 268 | tab_arr.push({ id: 'cuo_chuang', name: '痤疮' }); |
269 | + key_arr.push(9); | |
243 | 270 | } |
244 | 271 | tab_arr.push({ id: 'min_gan_du', name: '敏感度' }); |
272 | + | |
273 | + if(th.data.wrinkle_num1){ key_arr.push(3); } //抬头纹 | |
274 | + if(th.data.wrinkle_num2){ key_arr.push(4); } //川字纹 | |
275 | + if(th.data.wrinkle_num3){ key_arr.push(5); } //眼周细纹 | |
276 | + if(th.data.wrinkle_num4){ key_arr.push(6); } //鱼尾纹 | |
277 | + if(th.data.wrinkle_num5){ key_arr.push(7); } //法令纹 | |
278 | + if(th.data.wrinkle_num6){ key_arr.push(8); } //口周纹 | |
279 | + if(th.data.acne_num1) { key_arr.push(10); } //粉刺 | |
280 | + if(th.data.acne_num2) { key_arr.push(11); } //痘印 | |
281 | + if(th.data.acne_num3) { key_arr.push(12); } //脓包 | |
282 | + if(th.data.acne_num4) { key_arr.push(39); } //结节 | |
283 | + | |
284 | + if(!th.data.skin_key){ | |
285 | + getApp().request.promisePut('/api/weshop/face/storeSkinface/update', { | |
286 | + is_json:1, | |
287 | + data: { | |
288 | + id:th.data.id, | |
289 | + skin_key:key_arr.join(","), | |
290 | + store_id:setting.stoid | |
291 | + }, | |
292 | + }); | |
293 | + } | |
294 | + | |
245 | 295 | th.setData({ |
246 | 296 | acne_num: acne_num, |
247 | 297 | speckle_num: speckle_num, |
... | ... | @@ -279,29 +329,10 @@ Page({ |
279 | 329 | acne_num3: th.data.acne_num3, //脓包 |
280 | 330 | acne_num4: th.data.acne_num4, //结节 |
281 | 331 | }) |
282 | - var sort = 1; | |
283 | - //-- 调用毛孔的推荐函数 -- | |
284 | - if (pore_num > 0) | |
285 | - pore.get_goods(th, setting.stoid, sort++); | |
286 | - //-- 调用黑头的推荐函数 -- | |
287 | - if (blackhead_num > 0) | |
288 | - blackhead.get_goods(th, setting.stoid, sort++); | |
289 | - //-- 调用色斑的推荐函数 -- | |
290 | - if (speckle_num > 0) | |
291 | - speckle.get_goods(th, setting.stoid, sort++); | |
292 | - //-- 调用皱纹的推荐函数 -- | |
293 | - if (wrinkle_num > 0) | |
294 | - wrinkle.get_goods(th, setting.stoid, sort++); | |
295 | - //-- 黑眼圈 -- | |
296 | - if (dark_type > -1) | |
297 | - dark.get_goods(th, setting.stoid, sort++); | |
298 | - //-- 黑眼圈 -- | |
299 | - if (acne_num > -0) | |
300 | - acne.get_goods(th, setting.stoid, sort++); | |
301 | - sensitive.get_goods(th, setting.stoid, sort++); | |
302 | - //-- 获取一下分享要用的图片 -- | |
303 | - th.set_share_img(); | |
304 | - acne.get_goods(th, setting.stoid); | |
332 | + | |
333 | + //调用推荐 | |
334 | + if(getApp().globalData.user_id) th.recommend(); | |
335 | + | |
305 | 336 | |
306 | 337 | // let { heightRecord, tab } = th.data; |
307 | 338 | // tab.forEach(item => { |
... | ... | @@ -342,9 +373,50 @@ Page({ |
342 | 373 | }) |
343 | 374 | } |
344 | 375 | }) |
376 | + | |
377 | + //未登陆要显示登陆 | |
378 | + if(!getApp().globalData.user_id){ | |
379 | + wx.showToast({ | |
380 | + title: "您还未登陆,请先登陆", | |
381 | + icon: 'none', | |
382 | + duration: 3000 | |
383 | + }) | |
384 | + setTimeout(function () { | |
385 | + th.setData({show_login:1}) | |
386 | + },1000) | |
387 | + | |
388 | + } | |
389 | + | |
345 | 390 | }, |
346 | 391 | |
347 | 392 | |
393 | + recommend:function () { | |
394 | + var th=this; | |
395 | + var sort = 1; | |
396 | + //-- 调用毛孔的推荐函数 -- | |
397 | + if (th.data.pore_num > 0) | |
398 | + pore.get_goods(th, setting.stoid, sort++); | |
399 | + //-- 调用黑头的推荐函数 -- | |
400 | + if (th.data.blackhead_num > 0) | |
401 | + blackhead.get_goods(th, setting.stoid, sort++); | |
402 | + //-- 调用色斑的推荐函数 -- | |
403 | + if (th.data.speckle_num > 0) | |
404 | + speckle.get_goods(th, setting.stoid, sort++); | |
405 | + //-- 调用皱纹的推荐函数 -- | |
406 | + if (th.data.wrinkle_num > 0) | |
407 | + wrinkle.get_goods(th, setting.stoid, sort++); | |
408 | + //-- 黑眼圈 -- | |
409 | + if (th.data.dark_type > -1) | |
410 | + dark.get_goods(th, setting.stoid, sort++); | |
411 | + //-- 黑眼圈 -- | |
412 | + if (th.data.acne_num > -0) | |
413 | + acne.get_goods(th, setting.stoid, sort++); | |
414 | + sensitive.get_goods(th, setting.stoid, sort++); | |
415 | + //-- 获取一下分享要用的图片 -- | |
416 | + th.set_share_img(); | |
417 | + //acne.get_goods(th, setting.stoid); | |
418 | + }, | |
419 | + | |
348 | 420 | //-- 初始等级卡 -- |
349 | 421 | init: function () { |
350 | 422 | var th = this; |
... | ... | @@ -398,12 +470,14 @@ Page({ |
398 | 470 | }, |
399 | 471 | //-- 获取json数据 -- |
400 | 472 | get_data: function (func) { |
473 | + var th=this; | |
401 | 474 | var url = "/api/weshop/face/storeSkinface/get/" + setting.stoid + "/" + this.data.id; |
402 | 475 | getApp().request.promiseGet(url, {}).then(res => { |
403 | 476 | if (res.data.code == 0) { |
404 | 477 | var json = JSON.parse(res.data.data.resultjson); |
405 | 478 | var json1 = JSON.parse(res.data.data.detectjson); |
406 | 479 | func(json, json1, res.data.data.img) |
480 | + if(res.data.data.skin_key) th.data.skin_key=res.data.data.skin_key; | |
407 | 481 | } else { |
408 | 482 | getApp().showWarning("获取数据失败"); |
409 | 483 | } |
... | ... | @@ -428,6 +502,17 @@ Page({ |
428 | 502 | } |
429 | 503 | }) |
430 | 504 | |
505 | + var path4= th.data.iurl + "/miniapp/images/skinimg/m_logo.png"; | |
506 | + wx.getImageInfo({ | |
507 | + src: path4, | |
508 | + success: function (res) { | |
509 | + //获取到二维码的图片 | |
510 | + th.data.share_logo = res.path; | |
511 | + } | |
512 | + }) | |
513 | + | |
514 | + | |
515 | + | |
431 | 516 | }, |
432 | 517 | scroll_view(e) { |
433 | 518 | let scrollTop = e.detail.scrollTop; |
... | ... | @@ -756,7 +841,7 @@ Page({ |
756 | 841 | //--定义的保存图片方法,分享团--- |
757 | 842 | saveImageToPhotosAlbum: function () { |
758 | 843 | var th = this; |
759 | - var rpx = this.data.cWidth / 750 * 1.35; //基础单位, | |
844 | + var rpx = this.data.cWidth / 750 * 4; //基础单位, | |
760 | 845 | //--先判断会员状态-- |
761 | 846 | var user_info = getApp().globalData.userInfo; |
762 | 847 | if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) { |
... | ... | @@ -788,7 +873,7 @@ Page({ |
788 | 873 | src: path3, |
789 | 874 | success: function (res) { |
790 | 875 | |
791 | - var b = 1.1; | |
876 | + var b = 0.9; | |
792 | 877 | //获取到二维码的图片 |
793 | 878 | var vpath = res.path; |
794 | 879 | var context = wx.createCanvasContext('share'); |
... | ... | @@ -796,59 +881,61 @@ Page({ |
796 | 881 | context.fillStyle = '#ebf6f8'; |
797 | 882 | // 灰色实心矩形 |
798 | 883 | // 1. 语法: x坐标, y坐标, 宽度, 高度 |
799 | - context.fillRect(0, 0, 750 * rpx, 1320 * rpx); | |
884 | + context.fillRect(0, 0, 750 * rpx, 1093 * rpx); | |
885 | + | |
886 | + context.drawImage(th.data.share_logo, 31 * b * rpx, 20 * b * rpx, 242 * b * rpx, 34 * b * rpx); | |
800 | 887 | |
801 | - context.setFontSize(20 * rpx) | |
802 | 888 | context.setFillStyle("#00d8e9") |
803 | - context.fillText("官方检测认证", 32 * b * rpx, 80 * b * rpx); | |
889 | + context.setFontSize(12 * rpx) | |
890 | + context.fillText("官方检测认证", 32 * b * rpx, 90 * b * rpx); | |
804 | 891 | |
805 | 892 | //两个底部颜色 |
806 | 893 | context.fillStyle = '#a7ecf5'; |
807 | - context.fillRect(32 * b * rpx, 136 * b * rpx, 262 * b * rpx, 18 * b * rpx); | |
808 | - context.fillRect(32 * b * rpx, 194 * b * rpx, 262 * b * rpx, 18 * b * rpx); | |
894 | + context.fillRect(31 * b * rpx, 130 * b * rpx, 196 * b * rpx, 18 * b * rpx); | |
895 | + context.fillRect(31 * b * rpx, 174 * b * rpx, 196 * b * rpx, 18 * b * rpx); | |
809 | 896 | |
810 | - context.setFontSize(42 * b * rpx) | |
897 | + context.setFontSize(31 * b * rpx) | |
811 | 898 | context.setFillStyle("#070609") |
812 | - context.fillText("我的肌底强韧", 32 * b * rpx, 140 * b * rpx); | |
813 | - context.fillText("肌肤鲜活润泽", 32 * b * rpx, 196 * b * rpx); | |
899 | + context.fillText("我的肌底强韧", 32 * b * rpx, 134 * b * rpx); | |
900 | + context.fillText("肌肤鲜活润泽", 32 * b * rpx, 180 * b * rpx); | |
814 | 901 | |
815 | 902 | //先画一个圆形 |
816 | - th.circle(context, 110 * b * rpx, 280 * b * rpx, 140 * b * rpx, "#e7f3f8"); | |
817 | - th.circle(context, 130 * b * rpx, 300 * b * rpx, 120 * b * rpx, "#c8f2fa"); | |
903 | + th.circle(context, 98 * b * rpx, 230 * b * rpx, 140 * b * rpx, "#e7f3f8"); | |
904 | + th.circle(context, 118 * b * rpx, 250 * b * rpx, 120 * b * rpx, "#c8f2fa"); | |
818 | 905 | //绘制人脸 |
819 | - context.drawImage(th.data.share_head, 132 * b * rpx, 310 * b * rpx, 230 * b * rpx, 230 * b * rpx); | |
906 | + context.drawImage(th.data.share_head, 122 * b * rpx, 266 * b * rpx, 225 * b * rpx, 225 * b * rpx); | |
820 | 907 | |
821 | 908 | //左右俩个框并填充文字 |
822 | - th.darwRoundRect(38 * b * rpx, 340 * b * rpx, 120 * b * rpx, 34 * b * rpx, 17 * b * rpx, context); | |
823 | - th.darwRoundRect(324 * b * rpx, 340 * b * rpx, 120 * b * rpx, 34 * b * rpx, 17 * b * rpx, context); | |
909 | + th.darwRoundRect(38 * b * rpx, 290 * b * rpx, 120 * b * rpx, 34 * b * rpx, 17 * b * rpx, context); | |
910 | + th.darwRoundRect(324 * b * rpx, 290 * b * rpx, 120 * b * rpx, 34 * b * rpx, 17 * b * rpx, context); | |
824 | 911 | context.setFontSize(18 * b * rpx) |
825 | 912 | context.setFillStyle("black") |
826 | - context.fillText("黑眼圈 重度", 50 * b * rpx, 363 * b * rpx); | |
827 | - context.fillText("毛孔 " + th.data.pore_num, 340 * b * rpx, 363 * b * rpx); | |
913 | + context.fillText("黑眼圈 重度", 50 * b * rpx, 313 * b * rpx); | |
914 | + context.fillText("毛孔 " + th.data.pore_num, 340 * b * rpx, 313 * b * rpx); | |
828 | 915 | |
829 | 916 | //左右俩个框并填充文字 |
830 | - th.darwRoundRect(40 * b * rpx, 412 * b * rpx, 116 * b * rpx, 34 * b * rpx, 17 * b * rpx, context); | |
831 | - th.darwRoundRect(348 * b * rpx, 412 * b * rpx, 116 * b * rpx, 34 * b * rpx, 17 * b * rpx, context); | |
917 | + th.darwRoundRect(40 * b * rpx, 362 * b * rpx, 90 * b * rpx, 34 * b * rpx, 17 * b * rpx, context); | |
918 | + th.darwRoundRect(348 * b * rpx, 362 * b * rpx, 100 * b * rpx, 34 * b * rpx, 17 * b * rpx, context); | |
832 | 919 | context.setFillStyle("black") |
833 | - context.fillText("黑头 " + th.data.blackhead_num, 60 * b * rpx, 434 * b * rpx); | |
834 | - context.fillText("色斑 " + th.data.speckle_num, 362 * b * rpx, 434 * b * rpx); | |
920 | + context.fillText("黑头 " + th.data.blackhead_num, 60 * b * rpx, 384 * b * rpx); | |
921 | + context.fillText("色斑 " + th.data.speckle_num, 362 * b * rpx, 384 * b * rpx); | |
835 | 922 | |
836 | 923 | //左右俩个框并填充文字 |
837 | - th.darwRoundRect(60 * b * rpx, 484 * b * rpx, 116 * b * rpx, 34 * b * rpx, 17 * b * rpx, context); | |
838 | - th.darwRoundRect(328 * b * rpx, 484 * b * rpx, 116 * b * rpx, 34 * b * rpx, 17 * b * rpx, context); | |
924 | + th.darwRoundRect(50 * b * rpx, 440 * b * rpx, 116 * b * rpx, 34 * b * rpx, 17 * b * rpx, context); | |
925 | + th.darwRoundRect(318 * b * rpx, 440 * b * rpx, 116 * b * rpx, 34 * b * rpx, 17 * b * rpx, context); | |
839 | 926 | context.setFillStyle("black") |
840 | - context.fillText("皱纹 " + th.data.wrinkle_num, 74 * b * rpx, 506 * b * rpx); | |
841 | - context.fillText("痤疮 " + th.data.acne_num, 350 * b * rpx, 506 * b * rpx); | |
927 | + context.fillText("皱纹 " + th.data.wrinkle_num, 74 * b * rpx, 462 * b * rpx); | |
928 | + context.fillText("痤疮 " + th.data.acne_num, 350 * b * rpx, 462 * b * rpx); | |
842 | 929 | |
843 | 930 | //底部的绘制 |
844 | - th.darwRoundRect(38 * b * rpx, 650 * b * rpx, 430 * b * rpx, 160 * b * rpx, 10 * b * rpx, context); | |
931 | + th.darwRoundRect(38 * b * rpx, 532 * b * rpx, 412 * b * rpx, 150 * b * rpx, 10 * b * rpx, context); | |
845 | 932 | //绘制二维码 |
846 | - context.drawImage(vpath, 60 * b * rpx, 672 * b * rpx, 120 * b * rpx, 120 * b * rpx); | |
933 | + context.drawImage(vpath, 60 * b * rpx, 547 * b * rpx, 116 * b * rpx, 116 * b * rpx); | |
847 | 934 | context.setFillStyle("black") |
848 | 935 | context.setFontSize(27 * b * rpx) |
849 | - context.fillText("美肤管家AI测肤", 200 * b * rpx, 726 * b * rpx); | |
936 | + context.fillText("美肤管家AI测肤", 200 * b * rpx, 600 * b * rpx); | |
850 | 937 | context.setFontSize(19 * b * rpx) |
851 | - context.fillText("科学了解皮肤的真实状态", 200 * b * rpx, 766 * b * rpx); | |
938 | + context.fillText("科学了解皮肤的真实状态", 200 * b * rpx, 640 * b * rpx); | |
852 | 939 | |
853 | 940 | //把画板内容绘制成图片,并回调 画板图片路径 |
854 | 941 | context.draw(false, function () { |
... | ... | @@ -857,9 +944,9 @@ Page({ |
857 | 944 | x: 0, |
858 | 945 | y: 0, |
859 | 946 | width: 750, |
860 | - height: 1320, | |
861 | - destWidth: 1.4 * 750 * 750 / th.data.screenWidth, | |
862 | - destHeight: 1.4 * 750 * 750 / th.data.screenWidth, | |
947 | + height: 1093, | |
948 | + destWidth: 5 * 750, | |
949 | + destHeight: 5 * 1093, | |
863 | 950 | canvasId: 'share', |
864 | 951 | success: function (res) { |
865 | 952 | that.setData({ |
... | ... | @@ -1093,6 +1180,19 @@ Page({ |
1093 | 1180 | wx.hideLoading(); |
1094 | 1181 | if (res.data.code == 0) { |
1095 | 1182 | app.my_warnning("领取成功", 1, th); |
1183 | + | |
1184 | + //点击量的保存 | |
1185 | + getApp().request.promisePost("/api/weshop/face/skinGoodsBrowse/save",{ | |
1186 | + data:{ | |
1187 | + store_id:setting.stoid, | |
1188 | + goods_id:cid, | |
1189 | + user_id:getApp().globalData.user_id, | |
1190 | + addtime:ut.gettimestamp(), | |
1191 | + skinface_id:th.data.id, | |
1192 | + goods_type:2 | |
1193 | + } | |
1194 | + }).then(res=>{}) | |
1195 | + | |
1096 | 1196 | lq_num++; |
1097 | 1197 | var text = q_word + "[" + index + "].lqnum"; |
1098 | 1198 | var text2 = q_word + "[" + index + "].linging"; |
... | ... | @@ -1112,5 +1212,12 @@ Page({ |
1112 | 1212 | }, |
1113 | 1213 | |
1114 | 1214 | |
1215 | + clos_login:function () { | |
1216 | + this.setData({show_login:0}); | |
1217 | + //调用推荐 | |
1218 | + if(getApp().globalData.user_id) this.recommend(); | |
1219 | + } | |
1220 | + | |
1221 | + | |
1115 | 1222 | |
1116 | 1223 | }) |
1117 | 1224 | \ No newline at end of file | ... | ... |
packageD/pages/AI-test-skin/success_result/success_result.json
packageD/pages/AI-test-skin/success_result/success_result.wxml
... | ... | @@ -378,12 +378,12 @@ |
378 | 378 | |
379 | 379 | |
380 | 380 | <!-- 二维码显示页面 --> |
381 | -<canvas canvas-id='share' style='width:750rpx;height:1320rpx;background-color:white;' wx:if='{{!canvasHidden}}'></canvas> | |
381 | +<canvas canvas-id='share' style='width:750px;height:1093px;background-color:white;' wx:if='{{!canvasHidden}}'></canvas> | |
382 | 382 | <!-- 展示分享图 --> |
383 | 383 | <view id="share_show" wx:if="{{share_show}}"> |
384 | 384 | <view class="cover-layer" bindtap="close_share" style="z-index: 77777"></view> |
385 | 385 | <view class="share_content"> |
386 | - <view class="sh_close" bindtap="close_share"><text class="iconfont icon-guan" style="font-size: 22rpx;"></text></view> | |
386 | + <view class="sh_close" bindtap="close_share"><text class="iconfont icon-guan" style="font-size: 30rpx;"></text></view> | |
387 | 387 | <image src="{{shareImgPath}}" style="width: 100%" mode="widthFix"></image> |
388 | 388 | <view class="share_save_btn" bindtap="savePic">保存到相册</view> |
389 | 389 | </view> |
... | ... | @@ -416,4 +416,7 @@ |
416 | 416 | </view> |
417 | 417 | </view> |
418 | 418 | <!-- 提示 --> |
419 | -<warn id="warn"></warn> | |
420 | 419 | \ No newline at end of file |
420 | +<warn id="warn"></warn> | |
421 | + | |
422 | +<!-- 登陆框 --> | |
423 | +<login wx:if="{{show_login}}" class="{{show_login?'up_login':''}}}" object="{{login_set}}" id="login" bind:cancle_lg="clos_login"></login> | |
421 | 424 | \ No newline at end of file | ... | ... |
packageD/pages/AI-test-skin/success_result/success_result.wxss
... | ... | @@ -744,15 +744,15 @@ page { |
744 | 744 | .sh_close { |
745 | 745 | position: absolute; |
746 | 746 | right: 34rpx; |
747 | - top: 36rpx; | |
748 | - width: 65rpx; | |
749 | - height: 65rpx; | |
747 | + top: 28rpx; | |
748 | + width: 60rpx; | |
749 | + height: 60rpx; | |
750 | 750 | display: flex; |
751 | 751 | justify-content: center; |
752 | 752 | align-items: center; |
753 | - font-size: 26rpx; | |
753 | + font-size: 32rpx; | |
754 | 754 | border-radius: 50%; |
755 | - background-color: grey; | |
755 | + background-color: #B1B9BB; | |
756 | 756 | color: #fff |
757 | 757 | } |
758 | 758 | ... | ... |
packageD/pages/AI-test-skin/success_result/wrinkle/wrinkle.js
... | ... | @@ -17,7 +17,7 @@ module.exports = { |
17 | 17 | }) |
18 | 18 | var re_word=set.join(','); |
19 | 19 | //-- 服务卡 -- |
20 | - var url="/api/weshop/serviceCard/page?orderField=RAND()&recommend_code="+r_code+"&store_id="+stoid+"&recommend_word="+re_word+"&pageSize=2"; | |
20 | + var url="/api/weshop/serviceCard/page?orderField=RAND()&recommend_code="+r_code+"&store_id="+stoid+"&recommend_word="+re_word+"&pageSize=2"+"&skinface_id="+th.data.id+"&user_id="+getApp().globalData.user_id; | |
21 | 21 | getApp().request.promiseGet(url, {}).then(res=>{ |
22 | 22 | if(res.data.code==0 && res.data.data && res.data.data.pageData && res.data.data.pageData.length>0){ |
23 | 23 | th.setData({wrinkle_fuwu:res.data.data.pageData}) |
... | ... | @@ -25,7 +25,7 @@ module.exports = { |
25 | 25 | }) |
26 | 26 | |
27 | 27 | //-- 商品 -- |
28 | - var url="/api/weshop/goods/page?orderField=RAND()&recommend_code="+r_code+"&store_id="+stoid+"&recommend_word="+re_word+"&pageSize=2"; | |
28 | + var url="/api/weshop/goods/page?orderField=RAND()&recommend_code="+r_code+"&store_id="+stoid+"&recommend_word="+re_word+"&pageSize=2"+"&skinface_id="+th.data.id+"&user_id="+getApp().globalData.user_id; | |
29 | 29 | getApp().request.promiseGet(url, {}).then(res=>{ |
30 | 30 | if(res.data.code==0 && res.data.data && res.data.data.pageData && res.data.data.pageData.length>0){ |
31 | 31 | th.setData({wrinkle_goods:res.data.data.pageData}) |
... | ... | @@ -33,7 +33,7 @@ module.exports = { |
33 | 33 | }) |
34 | 34 | |
35 | 35 | // 优惠券 |
36 | - var url="/api/weshop/prom/coupon/pageCouponList?orderField=RAND()&recommend_code="+r_code+"&store_id="+stoid+"&recommend_word="+re_word+"&pageSize=2"; | |
36 | + var url="/api/weshop/prom/coupon/pageCouponList?orderField=RAND()&recommend_code="+r_code+"&store_id="+stoid+"&recommend_word="+re_word+"&pageSize=2"+"&skinface_id="+th.data.id+"&user_id="+getApp().globalData.user_id; | |
37 | 37 | getApp().request.promiseGet(url, {}).then(res=>{ |
38 | 38 | if(res.data.code==0 && res.data.data && res.data.data.pageData && res.data.data.pageData.length>0){ |
39 | 39 | var arr=res.data.data.pageData; | ... | ... |
pages/cart/cart/cart.js
... | ... | @@ -43,6 +43,9 @@ Page({ |
43 | 43 | |
44 | 44 | ladder_map:{}, //阶梯促销需要的map |
45 | 45 | |
46 | + promgoods_map:{}, | |
47 | + promgoods_list:{} | |
48 | + | |
46 | 49 | }, |
47 | 50 | onLoad: function () { |
48 | 51 | var a = this, |
... | ... | @@ -161,6 +164,8 @@ Page({ |
161 | 164 | |
162 | 165 | onHide() { |
163 | 166 | this.data.zuhe_map = {}; |
167 | + this.data.promgoods_map={}; | |
168 | + this.data.promgoods_list={}; | |
164 | 169 | }, |
165 | 170 | onUnLoad() { |
166 | 171 | getApp().globalData.cart_zh_act = null; |
... | ... | @@ -226,7 +231,7 @@ Page({ |
226 | 231 | th.data.in_zhact_gdmap={}; |
227 | 232 | th.data.ladder_map={}; |
228 | 233 | var rd = Math.random().toString(36).substr(2, 15); |
229 | - var user_id = getApp().globalData.userInfo.user_id; | |
234 | + var user_id = getApp().globalData.user_id; | |
230 | 235 | getApp().request.get("/api/weshop/cart/list", { |
231 | 236 | data: { |
232 | 237 | user_id: app.globalData.user_id, |
... | ... | @@ -2828,6 +2833,7 @@ Page({ |
2828 | 2833 | //检查莫个门店下的商品是不是优惠活动,有的话,看要不要送礼品,同时有没有倍增 |
2829 | 2834 | check_prom_activity: async function (cindex) { |
2830 | 2835 | var make_up_arr = new Array(); |
2836 | + var send_gift_arr = new Array(); | |
2831 | 2837 | var th = this; |
2832 | 2838 | var map = new Map(); |
2833 | 2839 | var list = JSON.parse(JSON.stringify(this.data.requestData[cindex])); |
... | ... | @@ -2888,33 +2894,25 @@ Page({ |
2888 | 2894 | [rq_text2]:null, |
2889 | 2895 | }) |
2890 | 2896 | |
2897 | + var gift_text = "requestData[" + cindex + "].send_gift_arr"; | |
2898 | + this.setData({ | |
2899 | + [gift_text]:null, | |
2900 | + }) | |
2901 | + return false; | |
2891 | 2902 | } |
2892 | - /*-- | |
2893 | - var map2=new Map(); | |
2894 | - //请那些是赠品,但是优惠活动并没有被选中的商品要删除,同时满足条件的要放到map2, | |
2895 | - for(var i in list.goods){ | |
2896 | - var item=list.goods[i]; | |
2897 | - if(item.is_gift){ | |
2898 | - if(map.has(item.prom_id+"")){ | |
2899 | - if(!map2.has(item.prom_id+"")){ | |
2900 | - map2.set(item.prom_id+"",i) | |
2901 | - } | |
2902 | - }else{ | |
2903 | - var url = '/api/weshop/cart/del/' + oo.stoid + '/' + item.id; | |
2904 | - list.goods.splice(i,1); | |
2905 | - getApp().request.delete(url, {}); | |
2906 | - } | |
2907 | - } | |
2908 | - }--*/ | |
2909 | - | |
2910 | - var t_prom_list = new Array(); | |
2903 | + //-- 循环判断活动 -- | |
2911 | 2904 | for (let p_item of map.entries()) { |
2912 | 2905 | var prom = null; |
2913 | - await getApp().request.promiseGet("/api/weshop/promgoods/get/" + os.stoid + "/" + p_item[0], {}).then(res => { | |
2914 | - if (res.data.code == 0) { | |
2915 | - prom = res.data.data; | |
2916 | - } | |
2917 | - }) | |
2906 | + //使用缓存,减少接口的调用 | |
2907 | + if(th.data.promgoods_map[p_item[0]]){ | |
2908 | + prom=th.data.promgoods_map[p_item[0]]; | |
2909 | + }else{ | |
2910 | + await getApp().request.promiseGet("/api/weshop/promgoods/get/" + os.stoid + "/" + p_item[0], {}).then(res => { | |
2911 | + if (res.data.code == 0) { | |
2912 | + prom = res.data.data; | |
2913 | + } | |
2914 | + }) | |
2915 | + } | |
2918 | 2916 | //如果活动已经结束 |
2919 | 2917 | if (!prom || prom.is_end || prom.end_time < ut.gettimestamp()) { |
2920 | 2918 | for (var ii in list.goods) { |
... | ... | @@ -2928,89 +2926,182 @@ Page({ |
2928 | 2926 | continue; |
2929 | 2927 | } |
2930 | 2928 | |
2931 | - t_prom_list.push(prom); | |
2929 | + if(!th.data.promgoods_map[p_item[0]]) th.data.promgoods_map[p_item[0]]=prom; | |
2932 | 2930 | //---读取打折的详情--- |
2933 | 2931 | var ob = p_item[1]; |
2934 | 2932 | var discount = null; |
2935 | - await getApp().request.promiseGet("/api/weshop/goods/getDiscount", { | |
2936 | - data: { | |
2937 | - price: ob.price, | |
2938 | - prom_id: p_item[0], | |
2939 | - goods_num: ob.num, | |
2940 | - user_id: getApp().globalData.user_id, | |
2941 | - is_bz: prom.is_bz | |
2942 | - } | |
2943 | - }).then(res => { | |
2944 | - if (res.data.code == 0) discount = res.data.data; | |
2945 | - }) | |
2946 | 2933 | |
2947 | - //---如果有打折的信息,赠送的信息,赠送的时候要判断是不是限购数量--- | |
2948 | - if (discount && discount['goods_id'] && discount.limit_num >= discount.bs && discount.gift_storecount >= discount.bs) { | |
2949 | - //如果这礼品超了情况下 | |
2950 | - if (no_gift_arr.indexOf(discount.gift_id) != -1) continue; | |
2951 | - var o = discount.goodsinfo; | |
2952 | - var newd = { | |
2953 | - goods_id: o.goods_id, | |
2954 | - goods_num: discount.bs, | |
2955 | - pick_id: list.pid, | |
2956 | - user_id: app.globalData.user_id, | |
2957 | - store_id: os.stoid, | |
2958 | - goods_price: 0, | |
2959 | - guide_id:ob.guide_id?ob.guide_id:0, | |
2960 | - guide_type:ob.guide_type?ob.guide_type:0, | |
2961 | - member_goods_price: 0, | |
2962 | - goods_name: o.goods_name, | |
2963 | - goods_sn: o.goods_sn, | |
2964 | - sku: o.sku, | |
2965 | - is_gift: 1, | |
2966 | - prom_id: p_item[0], | |
2967 | - prom_type: 3, | |
2968 | - selected: 1, | |
2969 | - gift_id: discount.gift_id, | |
2970 | - original_img: th.data.imgUrl + o.original_img | |
2971 | - }; | |
2934 | + //看一下是不是多赠品,如果是多赠品 | |
2935 | + var promgoods_list=null; | |
2936 | + if(th.data.promgoods_list[p_item[0]]){ | |
2937 | + promgoods_list=th.data.promgoods_list[p_item[0]]; | |
2938 | + }else{ | |
2939 | + //-- 获取凑单提示 -- | |
2940 | + await getApp().request.promiseGet("/api/weshop/promgoodslist/list", { | |
2941 | + data: { | |
2942 | + prom_id: prom.id | |
2943 | + } | |
2944 | + }).then(res => { | |
2945 | + if (res.data.code == 0) { | |
2946 | + promgoods_list = res.data.data; | |
2947 | + } | |
2948 | + }) | |
2949 | + if(!promgoods_list) continue; | |
2950 | + th.data.promgoods_list[p_item[0]]=promgoods_list; | |
2951 | + } | |
2972 | 2952 | |
2973 | - list2.goods.push(newd); | |
2974 | - var all_num = 0; | |
2975 | - var all_limit_num = 0; | |
2976 | - | |
2977 | - for (var i in alllist) { | |
2978 | - var list_item = alllist[i]; | |
2979 | - for (var j in list_item.goods) { | |
2980 | - //如果赠品的ID一样,要进行统计数量 | |
2981 | - if (list_item.goods[j].is_gift == 1 && list_item.goods[j].gift_id == newd.gift_id) { | |
2982 | - all_num += list_item.goods[j].goods_num; | |
2953 | + var is_duo_gift=0; | |
2954 | + for (var i in promgoods_list) { | |
2955 | + var item = promgoods_list[i]; | |
2956 | + if (item.prom_type == 0) { | |
2957 | + if (ob.price < item.condition) { | |
2958 | + var elem = { | |
2959 | + prom_id: prom.id, | |
2960 | + diff_type: item.prom_type, | |
2961 | + diff: (item.condition - ob.price).toFixed(2), | |
2962 | + content: JSON.parse(item.preferential_type) | |
2983 | 2963 | } |
2984 | - if (list_item.goods[j].is_gift == 1 && list_item.goods[j].gift_id == newd.gift_id && list_item.goods[j].prom_id == p_item[0]) { | |
2985 | - all_limit_num += list_item.goods[j].goods_num; | |
2964 | + make_up_arr.push(elem); | |
2965 | + break; | |
2966 | + }else{ | |
2967 | + var json=JSON.parse(item.preferential_type); | |
2968 | + json.prom_id=prom.id; | |
2969 | + json.prom_name=prom.name; | |
2970 | + if(json.is_gift){ | |
2971 | + | |
2972 | + var idx=send_gift_arr.findIndex(function (e) { | |
2973 | + return e.prom_id==prom.id; | |
2974 | + }) | |
2975 | + if(idx!=-1){ | |
2976 | + send_gift_arr[idx]=json; | |
2977 | + }else { | |
2978 | + send_gift_arr.push(json); | |
2979 | + } | |
2980 | + } | |
2981 | + } | |
2982 | + } else { | |
2983 | + if (ob.num < item.condition) { | |
2984 | + var elem = { | |
2985 | + prom_id: prom.id, | |
2986 | + diff_type: item.prom_type, | |
2987 | + diff: (item.condition - ob.num).toFixed(2), | |
2988 | + content: JSON.parse(item.preferential_type) | |
2989 | + } | |
2990 | + make_up_arr.push(elem); | |
2991 | + break; | |
2992 | + }else{ | |
2993 | + var json=JSON.parse(item.preferential_type); | |
2994 | + json.prom_id=prom.id; | |
2995 | + json.prom_name=prom.name; | |
2996 | + if(json.is_gift){ | |
2997 | + var idx=send_gift_arr.findIndex(function (e) { | |
2998 | + return e.prom_id==prom.id; | |
2999 | + }) | |
3000 | + if(idx!=-1){ | |
3001 | + send_gift_arr[idx]=json; | |
3002 | + }else { | |
3003 | + send_gift_arr.push(json); | |
3004 | + } | |
2986 | 3005 | } |
2987 | - | |
2988 | 3006 | } |
2989 | 3007 | } |
3008 | + } | |
2990 | 3009 | |
2991 | - //-- 赠品的数量超出库存数量和会员的限制,这里是保证所有的赠品部会超出 -- | |
2992 | - if (discount.gift_storecount < all_num || discount.limit_num < all_limit_num) { | |
2993 | - no_gift_arr.push(discount.gift_id); | |
2994 | - //--进入下一个循环 -- | |
2995 | - continue; | |
2996 | - } | |
3010 | + //找到要送的活动 | |
3011 | + var idx=send_gift_arr.findIndex(function (e) { | |
3012 | + return e.prom_id==prom.id; | |
3013 | + }) | |
3014 | + if(idx!=-1){ | |
3015 | + var cur_json=send_gift_arr[idx]; | |
3016 | + if(parseInt(cur_json.zp_mode)==1) is_duo_gift=1; | |
3017 | + } | |
3018 | + | |
3019 | + //-- 只有在单赠品的时候,才要进行计算 -- | |
3020 | + if(!is_duo_gift && idx>-1) { | |
3021 | + await getApp().request.promiseGet("/api/weshop/goods/getDiscount", { | |
3022 | + data: { | |
3023 | + price: ob.price, | |
3024 | + prom_id: p_item[0], | |
3025 | + goods_num: ob.num, | |
3026 | + user_id: getApp().globalData.user_id, | |
3027 | + is_bz: prom.is_bz | |
3028 | + } | |
3029 | + }).then(res => { | |
3030 | + if (res.data.code == 0) discount = res.data.data; | |
3031 | + }) | |
2997 | 3032 | |
3033 | + if(!discount.zp_num || parseInt(discount.zp_num)==0) discount.zp_num=1; | |
3034 | + //---如果有打折的信息,赠送的信息,赠送的时候要判断是不是限购数量--- | |
3035 | + if (discount && discount['goods_id'] && discount.limit_num >= discount.bs*discount.zp_num | |
3036 | + && discount.gift_storecount >= discount.bs*discount.zp_num) { | |
3037 | + //如果这礼品超了情况下 | |
3038 | + if (no_gift_arr.indexOf(discount.gift_id) != -1) continue; | |
3039 | + var o = discount.goodsinfo; | |
3040 | + //-- 默认等于1,兼容旧的活动 -- | |
3041 | + | |
3042 | + var newd = { | |
3043 | + goods_id: o.goods_id, | |
3044 | + goods_num: discount.bs*discount.zp_num, //是赠品的翻倍 | |
3045 | + pick_id: list.pid, | |
3046 | + user_id: app.globalData.user_id, | |
3047 | + store_id: os.stoid, | |
3048 | + goods_price: 0, | |
3049 | + guide_id: ob.guide_id ? ob.guide_id : 0, | |
3050 | + guide_type: ob.guide_type ? ob.guide_type : 0, | |
3051 | + member_goods_price: 0, | |
3052 | + goods_name: o.goods_name, | |
3053 | + goods_sn: o.goods_sn, | |
3054 | + sku: o.sku, | |
3055 | + is_gift: 1, | |
3056 | + prom_id: p_item[0], | |
3057 | + prom_type: 3, | |
3058 | + selected: 1, | |
3059 | + gift_id: discount.gift_id, | |
3060 | + original_img: th.data.imgUrl + o.original_img | |
3061 | + }; | |
2998 | 3062 | |
2999 | - var url = "/api/weshop/cart/delGift?store_id=" + newd.store_id + "&user_id=" + | |
3000 | - newd.user_id + "&goods_id=" + newd.goods_id + "&is_gift=1&pick_id=" + newd.pick_id + "&prom_id=" + newd.prom_id | |
3001 | - await getApp().request.promiseDelete(url, {}) | |
3063 | + list2.goods.push(newd); | |
3064 | + var all_num = 0; | |
3065 | + var all_limit_num = 0; | |
3002 | 3066 | |
3003 | - var add_data = null; | |
3004 | - await getApp().request.promisePost("/api/weshop/cart/save", { | |
3005 | - data: newd | |
3006 | - }).then(res => { | |
3007 | - if (res.data.code == 0) { | |
3008 | - add_data = res.data.data; | |
3067 | + for (var i in alllist) { | |
3068 | + var list_item = alllist[i]; | |
3069 | + for (var j in list_item.goods) { | |
3070 | + //如果赠品的ID一样,要进行统计数量 | |
3071 | + if (list_item.goods[j].is_gift == 1 && list_item.goods[j].gift_id == newd.gift_id) { | |
3072 | + all_num += list_item.goods[j].goods_num; | |
3073 | + } | |
3074 | + if (list_item.goods[j].is_gift == 1 && list_item.goods[j].gift_id == newd.gift_id && list_item.goods[j].prom_id == p_item[0]) { | |
3075 | + all_limit_num += list_item.goods[j].goods_num; | |
3076 | + } | |
3077 | + | |
3078 | + } | |
3079 | + } | |
3080 | + | |
3081 | + //-- 赠品的数量超出库存数量和会员的限制,这里是保证所有的赠品部会超出 -- | |
3082 | + if (discount.gift_storecount < all_num || discount.limit_num < all_limit_num) { | |
3083 | + no_gift_arr.push(discount.gift_id); | |
3084 | + //--进入下一个循环 -- | |
3085 | + continue; | |
3086 | + } | |
3087 | + | |
3088 | + | |
3089 | + var url = "/api/weshop/cart/delGift?store_id=" + newd.store_id + "&user_id=" + | |
3090 | + newd.user_id + "&goods_id=" + newd.goods_id + "&is_gift=1&pick_id=" + newd.pick_id + "&prom_id=" + newd.prom_id | |
3091 | + await getApp().request.promiseDelete(url, {}) | |
3092 | + | |
3093 | + var add_data = null; | |
3094 | + await getApp().request.promisePost("/api/weshop/cart/save", { | |
3095 | + data: newd | |
3096 | + }).then(res => { | |
3097 | + if (res.data.code == 0) { | |
3098 | + add_data = res.data.data; | |
3099 | + } | |
3100 | + }) | |
3101 | + if (add_data) { | |
3102 | + newd.id = add_data.id; | |
3103 | + list.goods.push(newd); | |
3009 | 3104 | } |
3010 | - }) | |
3011 | - if (add_data) { | |
3012 | - newd.id = add_data.id; | |
3013 | - list.goods.push(newd); | |
3014 | 3105 | } |
3015 | 3106 | } |
3016 | 3107 | |
... | ... | @@ -3021,50 +3112,6 @@ Page({ |
3021 | 3112 | [rq_text]: list |
3022 | 3113 | }); |
3023 | 3114 | |
3024 | - if (!t_prom_list || t_prom_list.length == 0) return false; | |
3025 | - | |
3026 | - //-- 提示凑单的,放在最后显示 -- | |
3027 | - for (let prid in t_prom_list) { | |
3028 | - var prom = t_prom_list[prid]; | |
3029 | - //-- 获取凑单提示 -- | |
3030 | - await getApp().request.promiseGet("/api/weshop/promgoodslist/list", { | |
3031 | - data: { | |
3032 | - prom_id: prom.id | |
3033 | - } | |
3034 | - }).then(res => { | |
3035 | - if (res.data.code == 0) { | |
3036 | - var list = res.data.data; | |
3037 | - for (var i in list) { | |
3038 | - var item = list[i]; | |
3039 | - if (item.prom_type == 0) { | |
3040 | - if (ob.price < item.condition) { | |
3041 | - var elem = { | |
3042 | - prom_id: prom.id, | |
3043 | - diff_type: item.prom_type, | |
3044 | - diff: (item.condition - ob.price).toFixed(2), | |
3045 | - content: JSON.parse(item.preferential_type) | |
3046 | - } | |
3047 | - make_up_arr.push(elem); | |
3048 | - break; | |
3049 | - } | |
3050 | - } else { | |
3051 | - if (ob.num < item.condition) { | |
3052 | - var elem = { | |
3053 | - prom_id: prom.id, | |
3054 | - diff_type: item.prom_type, | |
3055 | - diff: (item.condition - ob.num).toFixed(2), | |
3056 | - content: JSON.parse(item.preferential_type) | |
3057 | - } | |
3058 | - make_up_arr.push(elem); | |
3059 | - break; | |
3060 | - } | |
3061 | - } | |
3062 | - } | |
3063 | - } | |
3064 | - }) | |
3065 | - } | |
3066 | - | |
3067 | - | |
3068 | 3115 | var diff_text = "requestData[" + cindex + "].make_up_arr"; |
3069 | 3116 | //-- 如果有凑单的话 -- |
3070 | 3117 | if (make_up_arr.length > 0) { |
... | ... | @@ -3076,8 +3123,23 @@ Page({ |
3076 | 3123 | [diff_text]: null |
3077 | 3124 | }); |
3078 | 3125 | } |
3079 | - }, | |
3080 | 3126 | |
3127 | + send_gift_arr=send_gift_arr.filter(function (e) { | |
3128 | + return e.zp_mode==="1"; | |
3129 | + }) | |
3130 | + var gift_text = "requestData[" + cindex + "].send_gift_arr"; | |
3131 | + //-- 如果有凑单的话 -- | |
3132 | + if (send_gift_arr.length > 0) { | |
3133 | + this.setData({ | |
3134 | + [gift_text]: send_gift_arr | |
3135 | + }); | |
3136 | + } else { | |
3137 | + this.setData({ | |
3138 | + [gift_text]: null | |
3139 | + }); | |
3140 | + } | |
3141 | + | |
3142 | + }, | |
3081 | 3143 | //去凑单 |
3082 | 3144 | go_cou_dang: function (e) { |
3083 | 3145 | var prom_id = e.currentTarget.dataset.prom_id; |
... | ... | @@ -3152,13 +3214,14 @@ Page({ |
3152 | 3214 | } |
3153 | 3215 | }) |
3154 | 3216 | }, |
3155 | - | |
3156 | - | |
3157 | 3217 | |
3158 | - | |
3159 | - | |
3160 | - | |
3161 | - | |
3162 | - | |
3218 | + //赠品提示 | |
3219 | + show_gift_toast:function () { | |
3220 | + wx.showToast({ | |
3221 | + title: "请点击结算至提交订单页选择赠品", | |
3222 | + icon: 'none', | |
3223 | + duration: 2000 | |
3224 | + }); | |
3225 | + } | |
3163 | 3226 | |
3164 | 3227 | }); |
3165 | 3228 | \ No newline at end of file | ... | ... |
pages/cart/cart/cart.wxml
1 | 1 | <wxs module="g_filter" src="g_filter.wxs"></wxs> |
2 | -<!-- <import src="../../tabbar/tabbar.wxml" /> | |
3 | -<template is="tabBar" data="{{tabBar}}" /> | |
4 | - --> | |
5 | -<!-- 广告图片 --> | |
6 | - | |
7 | -<!-- <navigator class="picture" url="/pages/activity/seckill_list/seckill_list" wx:if="{{is_has_flash}}"> | |
8 | - <image mode="widthFix" class="picture" src="{{iurl}}miniapp/images/stores/Seckill.png"></image> | |
9 | -</navigator> --> | |
10 | 2 | |
11 | 3 | <block wx:if="{{ad_data}}"> |
12 | 4 | <swiper class="swiper" circular="true" autoplay="true" |
... | ... | @@ -31,10 +23,6 @@ |
31 | 23 | </block> |
32 | 24 | |
33 | 25 | |
34 | - | |
35 | - | |
36 | - | |
37 | - | |
38 | 26 | <view class="container" wx:if="{{(requestData && requestData.length>0) || (service_data && service_data.length>0) }}"> |
39 | 27 | <!-- 购物车商品框架 --> |
40 | 28 | <view class="login-in"> |
... | ... | @@ -55,7 +43,6 @@ |
55 | 43 | <view class="store"> |
56 | 44 | <view class="shmd_m"> |
57 | 45 | <!-- 门店 --> |
58 | - <!--<radio color="red" bindtap="check_th_all_item" class="order-raido flex-center" checked="{{checkAllToggle||item.selected}}" data-pitems="{{pidx}}"></radio>--> | |
59 | 46 | <icon wx:if="{{checkAllToggle||item.selected}}" class="order-raido flex-center" bindtap="check_th_all_item" data-pitems="{{pidx}}" |
60 | 47 | color="red" size="20" type="success"></icon> |
61 | 48 | <view wx:else class="icon_no_sele2" bindtap="check_th_all_item" data-pitems="{{pidx}}"></view> |
... | ... | @@ -172,18 +159,16 @@ |
172 | 159 | <text data-url="/pages/goods/goodsList/goodsList?ladder_id={{item.id}}" bindtap="go_url">去凑单></text> |
173 | 160 | </view> |
174 | 161 | </block> |
175 | - | |
176 | - <!-- <block wx:if="{{item.make_up_arr}}"> | |
177 | - <view wx:if="{{total_fee > 0 && freight_free - total_fee > 0}}" class="fs28 pdr20 pdl20 c-red2 flex jc_sb weight_free"> | |
178 | - <text>再买{{freight_free - total_fee}}元可享全场包邮({{weight_free}}kg内)</text> | |
179 | - </view> | |
180 | - </block> | |
181 | - <block wx:else=""> | |
182 | - <view wx:if="{{total_fee > 0 && freight_free - total_fee > 0}}" class="fs28 pdr20 pdl20 c-red2 flex jc_sb weight_free"> | |
183 | - <text>再买{{freight_free - total_fee}}元可享全场包邮({{weight_free}}kg内)</text> | |
184 | - </view> | |
185 | - </block> --> | |
186 | 162 | |
163 | + <!-- 赠品的提示 --> | |
164 | + <block wx:if="{{item.send_gift_arr}}"> | |
165 | + <view bindtap="show_gift_toast" wx:for="{{item.send_gift_arr}}" wx:if="{{item.zp_mode}}" | |
166 | + class="fs28 pdr20 pdl20 pdb20 c-red2 flex jc_sb" style="padding: 10rpx 30rpx"> | |
167 | + <text style="color: #333333">送赠品</text> | |
168 | + <text bindtap="tishi_gift">{{item.prom_name}}></text> | |
169 | + </view> | |
170 | + </block> | |
171 | + | |
187 | 172 | |
188 | 173 | <!-- 线下取价 --> |
189 | 174 | <view style="margin:10rpx 0; padding: 0 30rpx;color: #999" wx:if="{{item.offline_price}}" class="fs28"> | ... | ... |
pages/cart/cart2/cart2.js
... | ... | @@ -130,6 +130,8 @@ Page({ |
130 | 130 | ladder_map: {}, //阶梯促销的map表 |
131 | 131 | is_no_past: 1, |
132 | 132 | state: 0, //阶梯促销的的立即购买也走购物车流程state=1 |
133 | + show_duo_gift:0, | |
134 | + send_gf:{}, //多赠品的计算 | |
133 | 135 | }, |
134 | 136 | onLoad: function (t) { |
135 | 137 | wx.setNavigationBarTitle({ title: "填写订单", }) |
... | ... | @@ -168,7 +170,8 @@ Page({ |
168 | 170 | this.setData({ |
169 | 171 | isget_by_quan: {}, |
170 | 172 | is_no_by: {}, |
171 | - is_by: {} | |
173 | + is_by: {}, | |
174 | + send_gf:{} | |
172 | 175 | }) |
173 | 176 | }, |
174 | 177 | |
... | ... | @@ -188,7 +191,6 @@ Page({ |
188 | 191 | |
189 | 192 | console.log("getuser_addr") |
190 | 193 | console.log(ie) |
191 | - | |
192 | 194 | //地址切换要把包邮券清空 |
193 | 195 | if (!th.data.user_addr || !ie || th.data.user_addr.address_id != ie.address_id) { |
194 | 196 | var using_quan = th.data.using_quan; |
... | ... | @@ -323,11 +325,7 @@ Page({ |
323 | 325 | a.get("/api/weshop/useraddress/page", { |
324 | 326 | data: { user_id: to.globalData.user_id, store_id: oo.stoid, pageSize: 600, t: Math.random() }, |
325 | 327 | success: function (su) { |
326 | - /*--- | |
327 | - var user_addr=[ | |
328 | - { 'address_id': 882, 'user_id': 2661, 'consignee': '测试测试测', 'province': 3102, 'city': 3431, 'district': 3466, | |
329 | - 'address': 'ed', 'more_address': '山西-长治市-襄垣县-虎(音si)亭镇', 'mobile': 13012345678,'is_default':1}, | |
330 | - ];---*/ | |
328 | + | |
331 | 329 | var item = null; |
332 | 330 | if (su.data.code == 0 && su.data.data && su.data.data.pageData) { |
333 | 331 | var user_addr = su.data.data.pageData; |
... | ... | @@ -356,7 +354,6 @@ Page({ |
356 | 354 | //----------------展示页面,是再获取用户信息之后-------------- |
357 | 355 | show_page: function () { |
358 | 356 | var th = this, ta = this.data.param; |
359 | - //th.setData({ userinfo: getApp().globalData.userInfo,}); //这个余额被缓存了 | |
360 | 357 | |
361 | 358 | //会员的信息,要获取最新 |
362 | 359 | var user = getApp().globalData.userInfo; |
... | ... | @@ -920,10 +917,10 @@ Page({ |
920 | 917 | //如果是优惠活动,就要调用活动,计算价格 |
921 | 918 | th.buy_now_prom_goods(gg.prom_id, t.data.data, function (data) { |
922 | 919 | //判断一下购买商品的数量是不是超过 |
923 | - if (data.gift_goods_id) { | |
924 | - var num = 1; | |
920 | + if (data.gift_goods_id && (!data.zp_mode || parseInt(data.zp_mode)==0) ) { | |
921 | + var num =data.zp_num?data.zp_num:1; | |
925 | 922 | if (data.is_bz == 1) { |
926 | - num = data.bs; | |
923 | + num = num*data.bs; | |
927 | 924 | if (num > data.gift_limit_num) num = 0; |
928 | 925 | } |
929 | 926 | //如果赠品数量超出礼品库存,就取消 |
... | ... | @@ -946,7 +943,9 @@ Page({ |
946 | 943 | ob.exp_sum_type = data.gift_exp_sum_type; //商品的物流计算方式 |
947 | 944 | ob.uniform_exp_sum = data.gift_uniform_exp_sum //统一运费的金额 |
948 | 945 | |
949 | - th.setData({ buy_now_gift_goods: ob }); | |
946 | + var arr_gf=[]; | |
947 | + arr_gf.push(ob); | |
948 | + th.setData({ buy_now_gift_goods: arr_gf}); | |
950 | 949 | } |
951 | 950 | } |
952 | 951 | |
... | ... | @@ -1175,6 +1174,7 @@ Page({ |
1175 | 1174 | }, |
1176 | 1175 | |
1177 | 1176 | calc_per: async function (c_arr) { |
1177 | + var send_gf={}; | |
1178 | 1178 | var th = this; |
1179 | 1179 | //-- 循环处理 -- |
1180 | 1180 | for (var i in c_arr) { |
... | ... | @@ -1230,6 +1230,13 @@ Page({ |
1230 | 1230 | //专享礼包 |
1231 | 1231 | item_map.zx_libao = get_data.zxlibao; |
1232 | 1232 | item_map.zx_lb_num = get_data.zxlb_num; |
1233 | + | |
1234 | + if(parseInt(get_data.zp_mode)==1){ | |
1235 | + if(!send_gf[pickid]) send_gf[pickid]=[]; | |
1236 | + send_gf[pickid].push({ | |
1237 | + pickup_id:pickid,giftsinfo:get_data.giftsinfo,zp_num:get_data.zp_num, | |
1238 | + gf_pr_name:item_map.name,prom_id:item_map.prom_id}); | |
1239 | + } | |
1233 | 1240 | } |
1234 | 1241 | }) |
1235 | 1242 | } |
... | ... | @@ -1349,6 +1356,18 @@ Page({ |
1349 | 1356 | } |
1350 | 1357 | } |
1351 | 1358 | } |
1359 | + | |
1360 | + | |
1361 | + var arr = Object.keys(send_gf); | |
1362 | + var arr2 = Object.keys(th.data.send_gf); | |
1363 | + if(arr2.length>0) return false; | |
1364 | + | |
1365 | + if(arr.length>0){ | |
1366 | + th.setData({send_gf:send_gf}) | |
1367 | + }else{ | |
1368 | + th.setData({send_gf:{}}) | |
1369 | + } | |
1370 | + | |
1352 | 1371 | }, |
1353 | 1372 | |
1354 | 1373 | //-------------------计算订单价格------------------- |
... | ... | @@ -1356,10 +1375,7 @@ Page({ |
1356 | 1375 | var th = this; |
1357 | 1376 | to.getConfig2(function (ee) { |
1358 | 1377 | to.getwuliuprice(async function (rs) { |
1359 | - wx.showLoading({ | |
1360 | - title: "处理中." | |
1361 | - }) | |
1362 | - | |
1378 | + wx.showLoading({ title: "处理中." }) | |
1363 | 1379 | //是不是区域包邮 |
1364 | 1380 | th.data.is_area_by=0; |
1365 | 1381 | //当不是区域不包邮的时候,没有不包邮商品的时候 |
... | ... | @@ -1383,7 +1399,6 @@ Page({ |
1383 | 1399 | var freight_free = ee.freight_free; //全场满多少包邮 |
1384 | 1400 | var free1=freight_free; |
1385 | 1401 | |
1386 | - | |
1387 | 1402 | var weight_free = ee.weight_free; //多少kg内包邮 |
1388 | 1403 | var no_ex_id = ee.no_ex_id; |
1389 | 1404 | var no_ex_good = null; |
... | ... | @@ -1573,7 +1588,6 @@ Page({ |
1573 | 1588 | |
1574 | 1589 | |
1575 | 1590 | |
1576 | - | |
1577 | 1591 | var is_in_no_ex_goods_arr=0; |
1578 | 1592 | var by_g_weight=0; |
1579 | 1593 | //--------循环计算商品总物流----------- |
... | ... | @@ -1710,11 +1724,7 @@ Page({ |
1710 | 1724 | if (no_ex_good) { |
1711 | 1725 | is_good_no_by = th.check_by_goods(no_ex_good, item[j].goods_id); |
1712 | 1726 | } |
1713 | - //如果达到全场包邮的条件,同时,没有地区不包邮,或者商品不包邮 并且没有超出重量 | |
1714 | - /*-- | |
1715 | - if (o_price - quan_price >= freight_free && freight_free > 0 && !is_good_no_by && th.data.is_no_by[pickid] != 1 && out_of_weight >=0 ) { | |
1716 | - continue; | |
1717 | - }--*/ | |
1727 | + | |
1718 | 1728 | //--如果是包邮券使用的情况下,如果商品是包邮的,那么就不进行计算-- |
1719 | 1729 | if (th.data.using_quan[pickid] && th.data.using_quan[pickid].isby == 1 && !is_good_no_by) { |
1720 | 1730 | continue; |
... | ... | @@ -2335,10 +2345,17 @@ Page({ |
2335 | 2345 | success(res) { |
2336 | 2346 | let itemSettings = res.subscriptionsSetting.itemSettings; |
2337 | 2347 | if (itemSettings && itemSettings[template_id] == "accept") { |
2338 | - th.submit_func(); | |
2348 | + //要检查一下赠品有可以足够 | |
2349 | + th.sub_check_gift(function () { | |
2350 | + th.submit_func(); | |
2351 | + }) | |
2352 | + | |
2339 | 2353 | } else { |
2340 | 2354 | th.sendsm(function () { |
2341 | - th.submit_func(); | |
2355 | + //要检查一下赠品有可以足够 | |
2356 | + th.sub_check_gift(function () { | |
2357 | + th.submit_func(); | |
2358 | + }) | |
2342 | 2359 | }) |
2343 | 2360 | } |
2344 | 2361 | } |
... | ... | @@ -2479,6 +2496,10 @@ Page({ |
2479 | 2496 | 'prom_id': th.data.bn_goods.prom_id, //促销活动id |
2480 | 2497 | }; |
2481 | 2498 | |
2499 | + if(getApp().globalData.skinface_id){ | |
2500 | + goods.skinface_id=getApp().globalData.skinface_id; | |
2501 | + } | |
2502 | + | |
2482 | 2503 | //-- 把导购的信息填入-- |
2483 | 2504 | if (gg.guide_id) { |
2484 | 2505 | goods.guide_id = gg.guide_id; |
... | ... | @@ -2756,6 +2777,10 @@ Page({ |
2756 | 2777 | 'store_id': oo.stoid, |
2757 | 2778 | }; |
2758 | 2779 | |
2780 | + if(getApp().globalData.skinface_id){ | |
2781 | + goods.skinface_id=getApp().globalData.skinface_id; | |
2782 | + } | |
2783 | + | |
2759 | 2784 | //-- 线下取价也要写入,组合购的商品不能去线下价格 -- |
2760 | 2785 | if (g_item.offline_price && t_item.is_offline == 1 && g_item.prom_type != 7) { |
2761 | 2786 | goods.goods_price = g_item.offline_price; |
... | ... | @@ -3992,8 +4017,10 @@ Page({ |
3992 | 4017 | }, |
3993 | 4018 | //立即购买获取优惠活动的内容 |
3994 | 4019 | buy_now_prom_goods: function (prom_id, arr, func) { |
4020 | + var th=this; | |
3995 | 4021 | var price = arr.shop_price * arr.goods_num; |
3996 | 4022 | var prom = null; |
4023 | + var gg = to.get_b_now(); | |
3997 | 4024 | getApp().request.promiseGet("/api/weshop/promgoods/get/" + os.stoid + "/" + prom_id, {}).then(res => { |
3998 | 4025 | if (res.data.code == 0) { |
3999 | 4026 | prom = res.data.data; |
... | ... | @@ -4020,8 +4047,11 @@ Page({ |
4020 | 4047 | arr.s_intValue = get_data.intValue; |
4021 | 4048 | arr.s_coupon_id = get_data.coupon_id; |
4022 | 4049 | arr.s_coupon_num = get_data.coupon_num; |
4050 | + arr.zp_mode = get_data.zp_mode; | |
4051 | + arr.zp_num = get_data.zp_num; | |
4052 | + | |
4023 | 4053 | //-- 看是不是有赠品 -- |
4024 | - if (get_data.gift_id) { | |
4054 | + if (get_data.gift_id && parseInt(get_data.zp_mode)!=1){ | |
4025 | 4055 | arr.gift_id = get_data.gift_id; |
4026 | 4056 | arr.gift_goods_id = get_data.goods_id; |
4027 | 4057 | arr.gift_goods_name = get_data.goods_name; |
... | ... | @@ -4042,6 +4072,16 @@ Page({ |
4042 | 4072 | arr.zx_lb_num = get_data.zxlb_num; |
4043 | 4073 | |
4044 | 4074 | arr.prom_id = prom_id; |
4075 | + | |
4076 | + var send_gf={}; | |
4077 | + var pickid=gg.pick_id; | |
4078 | + if(parseInt(get_data.zp_mode)==1){ | |
4079 | + if(!send_gf[pickid]) send_gf[pickid]=[]; | |
4080 | + send_gf[pickid].push({ | |
4081 | + pickup_id:pickid,giftsinfo:get_data.giftsinfo,zp_num:get_data.zp_num, | |
4082 | + gf_pr_name:prom.name,prom_id:prom.prom_id}); | |
4083 | + th.setData({send_gf:send_gf}); | |
4084 | + } | |
4045 | 4085 | } |
4046 | 4086 | func(arr); |
4047 | 4087 | }) |
... | ... | @@ -4085,6 +4125,7 @@ Page({ |
4085 | 4125 | }) |
4086 | 4126 | var ob = {}; |
4087 | 4127 | ob.prom_id = item.prom_id; |
4128 | + ob.name = prom.name; | |
4088 | 4129 | ob.price = item.goods_price * item.goods_num; |
4089 | 4130 | ob.goods_num = item.goods_num; |
4090 | 4131 | ob.is_bz = prom.is_bz; |
... | ... | @@ -4102,6 +4143,7 @@ Page({ |
4102 | 4143 | } |
4103 | 4144 | }) |
4104 | 4145 | ob.prom_id = item.prom_id; |
4146 | + ob.name = prom.name; | |
4105 | 4147 | ob.price = item.goods_price * item.goods_num; |
4106 | 4148 | ob.goods_num = item.goods_num; |
4107 | 4149 | ob.is_bz = prom.is_bz; |
... | ... | @@ -4118,8 +4160,9 @@ Page({ |
4118 | 4160 | |
4119 | 4161 | //计算立即购买赠品的物流费用 |
4120 | 4162 | get_now_gift_goods_wuliu: function (code, o_shipping_price, user_addr, gift_freight_free, out_of_weight, allpice, rs, shipping_price, no_by_data, goods_weight1, goods_piece1) { |
4121 | - var good = this.data.buy_now_gift_goods; | |
4163 | + var good_arr = this.data.buy_now_gift_goods; | |
4122 | 4164 | var goods_weight = -1, goods_piece = -1; |
4165 | + | |
4123 | 4166 | var gift_shipping_price = 0; |
4124 | 4167 | if (shipping_price) |
4125 | 4168 | { |
... | ... | @@ -4127,31 +4170,6 @@ Page({ |
4127 | 4170 | } |
4128 | 4171 | var th = this; |
4129 | 4172 | var out_of_weight = null; |
4130 | - switch (good['exp_sum_type']) { | |
4131 | - case 1: | |
4132 | - //统一运费 | |
4133 | - gift_shipping_price += good['uniform_exp_sum']; | |
4134 | - gift_shipping_price += o_shipping_price; | |
4135 | - break; | |
4136 | - case 2: | |
4137 | - if (goods_weight < 0) goods_weight = 0; | |
4138 | - //累积商品重量 每种商品的重量 * 数量 | |
4139 | - goods_weight += good['weight'] * parseInt(good['buynum']); | |
4140 | - if (goods_weight1 > 0) { | |
4141 | - out_of_weight = gift_weight_free - goods_weight; | |
4142 | - //不能调换位置 下面goods_weight会变大 | |
4143 | - goods_weight += goods_weight1; | |
4144 | - } | |
4145 | - break; | |
4146 | - case 3: | |
4147 | - if (goods_piece < 0) goods_piece = 0; | |
4148 | - //累积商品数量 | |
4149 | - goods_piece += parseInt(good['buynum']); | |
4150 | - if (goods_piece1) { | |
4151 | - goods_piece += goods_piece1; | |
4152 | - } | |
4153 | - break; | |
4154 | - } | |
4155 | 4173 | |
4156 | 4174 | |
4157 | 4175 | //如果有设置不包邮区域的时候 |
... | ... | @@ -4162,12 +4180,42 @@ Page({ |
4162 | 4180 | th.data.is_no_by[th.data.bn_pick] = 1; |
4163 | 4181 | } |
4164 | 4182 | } |
4165 | - //如果有设置不包邮商品 | |
4166 | - if (no_by_data && no_by_data.goods_list && gift_freight_free) { | |
4167 | - if (th.check_by_goods(no_by_data.goods_list, good.goods_id)) { | |
4168 | - gift_freight_free = 0; | |
4169 | - // out_of_weight = 0 | |
4170 | - th.data.is_no_by[th.data.bn_pick]=1; | |
4183 | + | |
4184 | + for(var i in good_arr) { | |
4185 | + var good=good_arr[i]; | |
4186 | + switch (good['exp_sum_type']) { | |
4187 | + case 1: | |
4188 | + //统一运费 | |
4189 | + gift_shipping_price += parseFloat(good['uniform_exp_sum']); | |
4190 | + gift_shipping_price += o_shipping_price; | |
4191 | + break; | |
4192 | + case 2: | |
4193 | + if (goods_weight < 0) goods_weight = 0; | |
4194 | + //累积商品重量 每种商品的重量 * 数量 | |
4195 | + goods_weight += good['weight'] * parseInt(good['buynum']); | |
4196 | + if (goods_weight1 > 0) { | |
4197 | + out_of_weight = gift_weight_free - goods_weight; | |
4198 | + //不能调换位置 下面goods_weight会变大 | |
4199 | + goods_weight += goods_weight1; | |
4200 | + } | |
4201 | + break; | |
4202 | + case 3: | |
4203 | + if (goods_piece < 0) goods_piece = 0; | |
4204 | + //累积商品数量 | |
4205 | + goods_piece += parseInt(good['buynum']) ; | |
4206 | + if (goods_piece1) { | |
4207 | + goods_piece += goods_piece1; | |
4208 | + } | |
4209 | + break; | |
4210 | + } | |
4211 | + | |
4212 | + //如果有设置不包邮商品 | |
4213 | + if (no_by_data && no_by_data.goods_list && gift_freight_free) { | |
4214 | + if (th.check_by_goods(no_by_data.goods_list, good.goods_id)) { | |
4215 | + gift_freight_free = 0; | |
4216 | + // out_of_weight = 0 | |
4217 | + th.data.is_no_by[th.data.bn_pick]=1; | |
4218 | + } | |
4171 | 4219 | } |
4172 | 4220 | } |
4173 | 4221 | |
... | ... | @@ -4293,18 +4341,6 @@ Page({ |
4293 | 4341 | }); |
4294 | 4342 | }, |
4295 | 4343 | |
4296 | - // set_hid_inp:function (e) { | |
4297 | - // var index = e.currentTarget.dataset.index; | |
4298 | - // var txt = "cartlist[" + index + "].focus"; | |
4299 | - // this.setData({[txt]:1}) | |
4300 | - // }, | |
4301 | - // | |
4302 | - // clear_hid_inp:function (e) { | |
4303 | - // var index = e.currentTarget.dataset.index; | |
4304 | - // var txt = "cartlist[" + index + "].focus"; | |
4305 | - // this.setData({[txt]:0}) | |
4306 | - // }, | |
4307 | - | |
4308 | 4344 | go_url: function (e) { |
4309 | 4345 | var url = e.currentTarget.dataset.url; |
4310 | 4346 | getApp().goto(url); |
... | ... | @@ -4398,9 +4434,7 @@ Page({ |
4398 | 4434 | }) |
4399 | 4435 | |
4400 | 4436 | }, |
4401 | - | |
4402 | - | |
4403 | - | |
4437 | + | |
4404 | 4438 | setexptype2: function(e) { |
4405 | 4439 | this.debounce(this.setexptype.bind(this, e),400)(); |
4406 | 4440 | }, |
... | ... | @@ -4418,4 +4452,361 @@ Page({ |
4418 | 4452 | }, |
4419 | 4453 | |
4420 | 4454 | |
4455 | + //-- 判断是不是选中 -- | |
4456 | + check_th_item:function (e) { | |
4457 | + var th=this; | |
4458 | + var idx=e.currentTarget.dataset.item; | |
4459 | + var check=e.currentTarget.dataset.check; | |
4460 | + var txt="giftsinfo["+idx+"].selected"; | |
4461 | + var gift_item=this.data.giftsinfo[idx]; | |
4462 | + | |
4463 | + if(check){ | |
4464 | + th.setData({[txt]:0}); | |
4465 | + }else{ | |
4466 | + | |
4467 | + var is_true=th.check_out_num_cart(gift_item,this.data.gift_pkid,gift_item.goods_num); | |
4468 | + if(!is_true){ return false; } | |
4469 | + | |
4470 | + th.setData({[txt]:1}); | |
4471 | + } | |
4472 | + }, | |
4473 | + | |
4474 | + addNum:function (e) { | |
4475 | + var th=this; | |
4476 | + var idx=e.currentTarget.dataset.item; | |
4477 | + var txt="giftsinfo["+idx+"].goods_num"; | |
4478 | + var num=th.data.giftsinfo[idx].goods_num+1; | |
4479 | + var gift_item=this.data.giftsinfo[idx]; | |
4480 | + var is_true=th.check_out_num_cart(gift_item,this.data.gift_pkid,num); | |
4481 | + if(!is_true){ return false; } | |
4482 | + th.setData({[txt]:num}); | |
4483 | + }, | |
4484 | + | |
4485 | + subNum:function (e) { | |
4486 | + var th=this; | |
4487 | + var idx=e.currentTarget.dataset.item; | |
4488 | + var txt="giftsinfo["+idx+"].goods_num"; | |
4489 | + var num=th.data.giftsinfo[idx].goods_num-1; | |
4490 | + var gift_item=this.data.giftsinfo[idx]; | |
4491 | + var is_true=th.check_out_num_cart(gift_item,this.data.gift_pkid,num); | |
4492 | + if(!is_true){ | |
4493 | + return false; | |
4494 | + } | |
4495 | + if(num<1) return false; | |
4496 | + th.setData({[txt]:num}); | |
4497 | + }, | |
4498 | + | |
4499 | + //-- 点击选中赠品 -- | |
4500 | + show_sele_gift:function (e) { | |
4501 | + var index=e.currentTarget.dataset.index; | |
4502 | + var pk=e.currentTarget.dataset.pk; | |
4503 | + var giftsinfo=this.data.send_gf[pk][index].giftsinfo; | |
4504 | + | |
4505 | + for(let i in giftsinfo){ | |
4506 | + let item=giftsinfo[i]; | |
4507 | + if(!item.goods_num) giftsinfo[i].goods_num=1; | |
4508 | + } | |
4509 | + | |
4510 | + this.setData({ | |
4511 | + show_duo_gift:1, | |
4512 | + giftsinfo:giftsinfo, | |
4513 | + gf_pr_name:this.data.send_gf[pk][index].gf_pr_name, | |
4514 | + zp_num:this.data.send_gf[pk][index].zp_num, | |
4515 | + gift_pkid:pk, | |
4516 | + gf_prom_id:this.data.send_gf[pk][index].prom_id, | |
4517 | + send_gf_index:index | |
4518 | + }) | |
4519 | + }, | |
4520 | + | |
4521 | + close_sele_gift:function () { | |
4522 | + this.setData({show_duo_gift:0}) | |
4523 | + }, | |
4524 | + | |
4525 | + //购物车赠品有咩有超出库存。有灭有超出限购 | |
4526 | + check_out_num_cart:function(discount,pick_id,num) { | |
4527 | + var prom_id= discount.prom_id; | |
4528 | + var alllist=this.data.cartlist; | |
4529 | + var all_num=num; | |
4530 | + var all_limit_num=num; | |
4531 | + var gift_id=discount.gift_id; | |
4532 | + for (var i in alllist) { | |
4533 | + var list_item = alllist[i]; | |
4534 | + //-- 门店相同,活动相同的时候 -- | |
4535 | + if(pick_id==list_item.pickup_id && prom_id==list_item.prom_id) continue; | |
4536 | + for (var j in list_item.goods) { | |
4537 | + //如果赠品的ID一样,要进行统计数量 | |
4538 | + if (list_item.goods[j].is_gift == 1 && | |
4539 | + list_item.goods[j].gift_id == gift_id) { | |
4540 | + all_num += list_item.goods[j].goods_num; | |
4541 | + } | |
4542 | + if (list_item.goods[j].is_gift == 1 && list_item.goods[j].gift_id ==gift_id && list_item.goods[j].prom_id == prom_id) { | |
4543 | + all_limit_num += list_item.goods[j].goods_num; | |
4544 | + } | |
4545 | + } | |
4546 | + } | |
4547 | + //-- 赠品的数量超出库存数量和会员的限制, | |
4548 | + // 这里是保证所有的赠品部会超出 -- | |
4549 | + if (discount.gift_storecount < all_num ) { | |
4550 | + wx.showToast({ | |
4551 | + title: "礼包库存不足", | |
4552 | + icon: 'none', | |
4553 | + duration: 2000 | |
4554 | + }); | |
4555 | + return false; | |
4556 | + } | |
4557 | + if (discount.limit_num < all_limit_num) { | |
4558 | + wx.showToast({ | |
4559 | + title:"超出赠品限购", | |
4560 | + icon: 'none', | |
4561 | + duration: 2000 | |
4562 | + }); | |
4563 | + return false; | |
4564 | + } | |
4565 | + return true; | |
4566 | + }, | |
4567 | + | |
4568 | + //-- 确定赠品 -- | |
4569 | + sure_this_gift:async function () { | |
4570 | + var th = this; | |
4571 | + var gf_pickup_id = this.data.gift_pkid; | |
4572 | + | |
4573 | + var zp_num = this.data.zp_num; | |
4574 | + var giftsinfo = this.data.giftsinfo; | |
4575 | + var all_num = 0; | |
4576 | + for (let i in giftsinfo) { | |
4577 | + let item = giftsinfo[i]; | |
4578 | + if (!item.selected) continue; | |
4579 | + all_num += item.goods_num; | |
4580 | + } | |
4581 | + if (all_num > zp_num) { | |
4582 | + wx.showToast({ | |
4583 | + title: "超出活动赠品赠送的数量" + zp_num + "件", | |
4584 | + icon: 'none', | |
4585 | + duration: 2000 | |
4586 | + }); | |
4587 | + return false; | |
4588 | + } | |
4589 | + if (all_num < zp_num) { | |
4590 | + wx.showToast({ | |
4591 | + title: "您还可以加" + (zp_num - all_num) + "件", | |
4592 | + icon: 'none', | |
4593 | + duration: 2000 | |
4594 | + }); | |
4595 | + return false; | |
4596 | + } | |
4597 | + | |
4598 | + //-- 当是购物车购买的时候 -- | |
4599 | + if(this.data.cartlist && this.data.cartlist.length>0){ | |
4600 | + var alllist = this.data.cartlist; | |
4601 | + var index = alllist.findIndex(function (e) { | |
4602 | + return e.pickup_id == gf_pickup_id | |
4603 | + }); | |
4604 | + var pk_list_goods = alllist[index].goods; | |
4605 | + | |
4606 | + var url = "/api/weshop/cart/delGift?store_id=" + os.stoid + "&user_id=" | |
4607 | + + getApp().globalData.user_id + "&is_gift=1&pick_id=" + this.data.gift_pkid + "&prom_id=" + this.data.prom_id; | |
4608 | + await getApp().request.promiseDelete(url, {}); | |
4609 | + | |
4610 | + var new_pk_list_goods = []; | |
4611 | + for (let i in pk_list_goods) { | |
4612 | + let item = pk_list_goods[i]; | |
4613 | + if (item.is_gift && item.prom_id == this.data.gf_prom_id) { | |
4614 | + continue; | |
4615 | + } | |
4616 | + new_pk_list_goods.push(item) | |
4617 | + } | |
4618 | + | |
4619 | + //-- 循环把赠品添加进去 -- | |
4620 | + for (var i = 0; i < giftsinfo.length; i++) { | |
4621 | + var gf_item = giftsinfo[i]; | |
4622 | + if (!gf_item.selected) continue; | |
4623 | + var add_data = null; | |
4624 | + var newd = { | |
4625 | + goods_id: gf_item.goodsinfo.goods_id, | |
4626 | + goods_num: gf_item.goods_num, | |
4627 | + pick_id: gf_pickup_id, | |
4628 | + user_id: app.globalData.user_id, | |
4629 | + store_id: os.stoid, | |
4630 | + goods_price: 0, | |
4631 | + member_goods_price: 0, | |
4632 | + goods_name: gf_item.goodsinfo.goods_name, | |
4633 | + goods_sn: gf_item.goodsinfo.goods_sn, | |
4634 | + sku: gf_item.goodsinfo.sku, | |
4635 | + is_gift: 1, | |
4636 | + prom_id: th.data.gf_prom_id, | |
4637 | + prom_type: 3, | |
4638 | + selected: 1, | |
4639 | + gift_id: gf_item.gift_id, | |
4640 | + original_img: th.data.imgUrl + gf_item.goodsinfo.original_img, | |
4641 | + exp_sum_type: gf_item.goodsinfo.exp_sum_type, | |
4642 | + is_free_shipping: gf_item.goodsinfo.is_free_shipping, | |
4643 | + weight: gf_item.goodsinfo.weight, | |
4644 | + uniform_exp_sum: gf_item.goodsinfo.uniform_exp_sum, | |
4645 | + goods_spec: gf_item.goodsinfo.goods_spec, | |
4646 | + goods_color: gf_item.goodsinfo.goods_color, | |
4647 | + }; | |
4648 | + | |
4649 | + await getApp().request.promisePost("/api/weshop/cart/save", { | |
4650 | + data: newd | |
4651 | + }).then(res => { | |
4652 | + if (res.data.code == 0) { | |
4653 | + add_data = res.data.data; | |
4654 | + } | |
4655 | + }) | |
4656 | + if (add_data) { | |
4657 | + newd.id = add_data.id; | |
4658 | + new_pk_list_goods.push(newd); | |
4659 | + } | |
4660 | + } | |
4661 | + | |
4662 | + var set_data = this.data.send_gf[gf_pickup_id][this.data.send_gf_index]; | |
4663 | + set_data.selected = 1; | |
4664 | + var txt9 = "cartlist[" + index + "].goods"; | |
4665 | + var txt1 = "send_gf[" + gf_pickup_id + "][" + this.data.send_gf_index + "]"; | |
4666 | + th.setData({[txt9]: new_pk_list_goods, [txt1]: set_data}); | |
4667 | + this.data.old_cartlist[index].goods = new_pk_list_goods; | |
4668 | + | |
4669 | + th.calculatePrice(); | |
4670 | + }else{ | |
4671 | + var new_pk_list_goods=[]; | |
4672 | + //-- 当是立即购买的时候 -- | |
4673 | + for (var i = 0; i < giftsinfo.length; i++) { | |
4674 | + var gf_item = giftsinfo[i]; | |
4675 | + if (!gf_item.selected) continue; | |
4676 | + var newd = { | |
4677 | + goods_id: gf_item.goodsinfo.goods_id, | |
4678 | + buynum: gf_item.goods_num, | |
4679 | + pick_id: gf_pickup_id, | |
4680 | + user_id: app.globalData.user_id, | |
4681 | + store_id: os.stoid, | |
4682 | + goods_price: 0, | |
4683 | + member_goods_price: 0, | |
4684 | + goods_name: gf_item.goodsinfo.goods_name, | |
4685 | + goods_sn: gf_item.goodsinfo.goods_sn, | |
4686 | + sku: gf_item.goodsinfo.sku, | |
4687 | + is_gift: 1, | |
4688 | + prom_id: th.data.gf_prom_id, | |
4689 | + prom_type: 3, | |
4690 | + selected: 1, | |
4691 | + gift_id: gf_item.gift_id, | |
4692 | + original_img: th.data.imgUrl + gf_item.goodsinfo.original_img, | |
4693 | + exp_sum_type: gf_item.goodsinfo.exp_sum_type, | |
4694 | + is_free_shipping: gf_item.goodsinfo.is_free_shipping, | |
4695 | + weight: gf_item.goodsinfo.weight, | |
4696 | + uniform_exp_sum: gf_item.goodsinfo.uniform_exp_sum, | |
4697 | + uniform_exp_sum: gf_item.goodsinfo.uniform_exp_sum, | |
4698 | + goods_spec: gf_item.goodsinfo.goods_spec, | |
4699 | + goods_color: gf_item.goodsinfo.goods_color, | |
4700 | + }; | |
4701 | + new_pk_list_goods.push(newd); | |
4702 | + } | |
4703 | + var set_data = this.data.send_gf[th.data.bn_pick][this.data.send_gf_index]; | |
4704 | + set_data.selected = 1; | |
4705 | + var txt1 = "send_gf[" + gf_pickup_id + "][" + this.data.send_gf_index + "]"; | |
4706 | + | |
4707 | + th.setData({buy_now_gift_goods:new_pk_list_goods,[txt1]:set_data}); | |
4708 | + th.calculatePrice2(); | |
4709 | + | |
4710 | + } | |
4711 | + th.close_sele_gift(); | |
4712 | + }, | |
4713 | + | |
4714 | + //获取输入 | |
4715 | + getInput:function (e) { | |
4716 | + this.data.gift_sear=e.detail.value; | |
4717 | + }, | |
4718 | + //-- 搜索赠品 -- | |
4719 | + submitSearch:function () { | |
4720 | + var giftsinfo=this.data.giftsinfo; | |
4721 | + if(!this.data.gift_sear){ | |
4722 | + for(let i in giftsinfo){ | |
4723 | + let item=giftsinfo[i]; | |
4724 | + item.hide_div=0; | |
4725 | + } | |
4726 | + }else{ | |
4727 | + for(let i in giftsinfo){ | |
4728 | + let item=giftsinfo[i]; | |
4729 | + item.hide_div=0; | |
4730 | + if(item.goods_name.indexOf(this.data.gift_sear)==-1){ | |
4731 | + item.hide_div=1; | |
4732 | + } | |
4733 | + } | |
4734 | + } | |
4735 | + this.setData({giftsinfo:giftsinfo}) | |
4736 | + | |
4737 | + }, | |
4738 | + | |
4739 | + //-- 赠品的验证 -- | |
4740 | + sub_check_gift(func){ | |
4741 | + var th=this; | |
4742 | + if(th.data.send_gf){ | |
4743 | + var error_arr=[]; | |
4744 | + for(let io in th.data.send_gf){ | |
4745 | + let item_arr=th.data.send_gf[io]; | |
4746 | + for(let ip in item_arr){ | |
4747 | + var gf_pr_name=item_arr[ip].gf_pr_name; | |
4748 | + var zp_num=item_arr[ip].zp_num; | |
4749 | + var giftsinfo=item_arr[ip].giftsinfo; | |
4750 | + var limit_all=0; | |
4751 | + var stock_all=0; | |
4752 | + for(let iu in giftsinfo){ | |
4753 | + let gf_item=giftsinfo[iu]; | |
4754 | + limit_all+=gf_item.limit_num; | |
4755 | + stock_all+=gf_item.gift_storecount; | |
4756 | + } | |
4757 | + if(limit_all<zp_num){ | |
4758 | + error_arr.push(gf_pr_name+"限购不足"); | |
4759 | + } | |
4760 | + if(stock_all<zp_num){ | |
4761 | + error_arr.push(gf_pr_name+"赠品库存不足"); | |
4762 | + } | |
4763 | + } | |
4764 | + } | |
4765 | + | |
4766 | + //-- 有赠品错误的时候,是不是继续下单 -- | |
4767 | + if(error_arr.length){ | |
4768 | + var err=error_arr.join(","); | |
4769 | + wx.showModal({ | |
4770 | + title: '提示', | |
4771 | + content: err+',无法赠送赠品,是否继续下单', | |
4772 | + success (res) { | |
4773 | + if (res.confirm) { | |
4774 | + func(); | |
4775 | + } else if (res.cancel) { | |
4776 | + console.log('用户点击取消') | |
4777 | + } | |
4778 | + } | |
4779 | + }) | |
4780 | + }else { | |
4781 | + | |
4782 | + var is_ok = 1; | |
4783 | + var error_arr = []; | |
4784 | + for (let io in th.data.send_gf) { | |
4785 | + let item_arr1 = th.data.send_gf[io]; | |
4786 | + for (let ip1 in item_arr1) { | |
4787 | + var item_b = item_arr1[ip1]; | |
4788 | + if (!item_b.selected) { | |
4789 | + is_ok = 0; | |
4790 | + break; | |
4791 | + } | |
4792 | + } | |
4793 | + if (!is_ok) break; | |
4794 | + } | |
4795 | + | |
4796 | + if (!is_ok) { | |
4797 | + getApp().confirmBox("请选择赠品"); | |
4798 | + return false; | |
4799 | + } | |
4800 | + func(); | |
4801 | + } | |
4802 | + | |
4803 | + | |
4804 | + }else{ | |
4805 | + func(); | |
4806 | + } | |
4807 | + } | |
4808 | + | |
4809 | + | |
4810 | + | |
4811 | + | |
4421 | 4812 | }); | ... | ... |
pages/cart/cart2/cart2.wxml
... | ... | @@ -4,7 +4,6 @@ |
4 | 4 | |
5 | 5 | <form> |
6 | 6 | <view class="container"> |
7 | - | |
8 | 7 | <!-- 立即购买的时候 --> |
9 | 8 | <block wx:if="{{is_b_now==1}}"> |
10 | 9 | <view class="tab-container"> |
... | ... | @@ -32,7 +31,6 @@ |
32 | 31 | </view> |
33 | 32 | </block> |
34 | 33 | |
35 | - | |
36 | 34 | <!--要进行判断地址是否显示----> |
37 | 35 | <view bindtap="enterAddressPage" class="user-mes mgt20" hidden='{{(bn_exp_type==1 && is_b_now==1) || (is_all_zt==1 && is_b_now==0)}}'> |
38 | 36 | <!---默认地址显示------> |
... | ... | @@ -160,9 +158,8 @@ |
160 | 158 | </view> |
161 | 159 | |
162 | 160 | <view data-t='0' data-txt='cartlist[{{pidx}}].exp_type' data-ind="{{pidx}}" bindtap="setexptype_w2" style="display:{{item.distr_t==1?'none':'flex;align-items: center'}};"> |
163 | - <!-- <icon bindtap='setexptype_w' data-t='0' data-txt='cartlist[{{pidx}}].exp_type' color="{{item.exp_type==0?'red':'gray'}}" size="16" type="success"></icon> --> | |
161 | + | |
164 | 162 | <block wx:if="{{item.exp_type==0}}"> |
165 | - <!-- <view class="circle white xc-hookt fs20 red-b sn"><text>Γ</text></view> --> | |
166 | 163 | <icon data-t='0' data-txt='cartlist[{{pidx}}].exp_type' color="red" size="16" type="success"></icon> |
167 | 164 | </block> |
168 | 165 | <block wx:else> |
... | ... | @@ -195,10 +192,32 @@ |
195 | 192 | </view> |
196 | 193 | </view> |
197 | 194 | </block> |
195 | + </view> | |
196 | + | |
198 | 197 | |
198 | + <!-- 赠品的显示 --> | |
199 | + <view wx:if="{{send_gf[item.pickup_id]}}"> | |
200 | + <block wx:for="{{send_gf[item.pickup_id]}}" wx:for-item="iter"> | |
201 | + <view class="coupon-mes flex jc_sb" style="margin: 10rpx 0; padding-right: 35rpx" | |
202 | + data-pk="{{item.pickup_id}}" data-index="{{index}}" | |
203 | + bindtap="show_sele_gift" > | |
204 | + <view class="flex ai_c"> | |
205 | + <view class="circle">赠</view>{{iter.name}} 可选赠品{{iter.zp_num}}个 | |
206 | + </view> | |
199 | 207 | |
208 | + <view class="flex ai_c" wx:if="{{iter.selected}}"> | |
209 | + 已选择<text class="bg_jj"></text> | |
210 | + </view> | |
211 | + | |
212 | + <view class="flex ai_c" wx:else="{{}}"> | |
213 | + 未选择<text class="bg_jj"></text> | |
214 | + </view> | |
215 | + | |
216 | + </view> | |
217 | + </block> | |
200 | 218 | </view> |
201 | 219 | |
220 | + | |
202 | 221 | <!-- 留言 --> |
203 | 222 | <view class="coupon-mes flex-vertical"> |
204 | 223 | <view>留言</view> |
... | ... | @@ -207,10 +226,6 @@ |
207 | 226 | data-index="{{pidx}}" value="{{user_note[pidx]}}" |
208 | 227 | class="word-box" maxlength="100" name="user_note_{{item.pickup_id}}" /> |
209 | 228 | |
210 | -<!-- <view class="{{user_note[index]?'':'c-a'}}" style="width: 80%;font-size: 26rpx" data-index="{{index}}"--> | |
211 | -<!-- bindtap="set_hid_inp" wx:if="{{!item.focus}}">--> | |
212 | -<!-- {{user_note[index]?user_note[index]:}}--> | |
213 | -<!-- </view>--> | |
214 | 229 | </view> |
215 | 230 | </view> |
216 | 231 | |
... | ... | @@ -243,12 +258,10 @@ |
243 | 258 | </block> |
244 | 259 | |
245 | 260 | <!-- ----立即购买------ --> |
246 | - <!-- <view class="xc-border xc-border"></view> --> | |
247 | 261 | <block wx:if="{{is_b_now==1}}"> |
248 | 262 | <view class="use-item bfff bdr_t-14 mgt20"> |
249 | 263 | <image class="dp" src='{{imgUrl}}/miniapp/images/goodscategory/new_store.png'> </image> |
250 | 264 | <view>{{bn_pickname}}</view> |
251 | - <!-- <view>门店:{{bn_pickname}}</view> --> | |
252 | 265 | </view> |
253 | 266 | <view class="order-detail"> |
254 | 267 | <view class="goods-img" bindtap="go_url" data-url="/pages/goods/goodsInfo/goodsInfo?goods_id={{bn_goods.goods_id}}&prom_type={{bn_goods.prom_type}}&prom_id={{bn_goods.prom_id}}"> |
... | ... | @@ -260,11 +273,6 @@ |
260 | 273 | <view class="flex-vertical fs28 xc-ash color-gray n_guige"> |
261 | 274 | <view class="goods-color"> |
262 | 275 | <block><text>{{filters.show_gui_ge(bn_goods.goods_spec,bn_goods.goods_color)}}</text></block> |
263 | - <!--<block wx:if="{{!bn_goods.goods_spec && !bn_goods.goods_color}}"><text>规格1</text></block>--> | |
264 | - <!--<block wx:else>--> | |
265 | - <!--<text wx:if="{{bn_goods.goods_spec!=''}}">{{bn_goods.goods_spec}}<text wx:if="{{bn_goods.goods_color}}">/</text></text>--> | |
266 | - <!--<text wx:if="{{bn_goods.goods_color}}">{{bn_goods.goods_color}}</text>--> | |
267 | - <!--</block>--> | |
268 | 276 | </view> |
269 | 277 | </view> |
270 | 278 | |
... | ... | @@ -277,27 +285,29 @@ |
277 | 285 | |
278 | 286 | </view> |
279 | 287 | <!-- 赠品的显示 --> |
280 | - <view class="order-detail" wx:if="{{buy_now_gift_goods}}"> | |
288 | + <block wx:if="{{buy_now_gift_goods}}"> | |
289 | + <view class="order-detail" wx:for="{{buy_now_gift_goods}}" > | |
281 | 290 | <view class="goods-img" style="position: relative"> |
282 | 291 | <image src="{{imgUrl}}/miniapp/images/giveaway.png" class="gift_image"></image> |
283 | 292 | |
284 | - <image class="wh100 bdr14" src="{{buy_now_gift_goods.original_img}}" binderror='cart_set_err' data-err="buy_now_gift_goods.original_img"></image> | |
293 | + <image class="wh100 bdr14" src="{{item.original_img}}" binderror='cart_set_err' data-err="item.original_img"></image> | |
285 | 294 | </view> |
286 | - <navigator class="order-cont" url="/pages/goods/goodsInfo/goodsInfo?goods_id={{buy_now_gift_goods.goods_id}}"> | |
287 | - <view class="goods-name ellipsis-2">{{buy_now_gift_goods.goods_name}}</view> | |
295 | + <navigator class="order-cont" url="/pages/goods/goodsInfo/goodsInfo?goods_id={{item.goods_id}}"> | |
296 | + <view class="goods-name ellipsis-2">{{item.goods_name}}</view> | |
288 | 297 | <!-- 商品属性 --> |
289 | 298 | <view class="flex-vertical fs28 xc-ash color-gray n_guige"> |
290 | 299 | <view class="goods-color"> |
291 | - <block><text>{{filters.show_gui_ge(buy_now_gift_goods.goods_spec,buy_now_gift_goods.goods_color)}}</text></block> | |
300 | + <block><text>{{filters.show_gui_ge(item.goods_spec,item.goods_color)}}</text></block> | |
292 | 301 | </view> |
293 | 302 | </view> |
294 | 303 | <!-- ---商品名称规格---- --> |
295 | 304 | <view class="order-num flex-space-between"> |
296 | 305 | <view class="co-red">¥<text class="fs36">0</text></view> |
297 | - <view class="goods-num">x{{buy_now_gift_goods.buynum}}</view> | |
306 | + <view class="goods-num">x{{item.buynum}}</view> | |
298 | 307 | </view> |
299 | 308 | </navigator> |
300 | 309 | </view> |
310 | + </block> | |
301 | 311 | |
302 | 312 | |
303 | 313 | <block wx:if="{{collocation_goods}}"> |
... | ... | @@ -373,6 +383,29 @@ |
373 | 383 | </view> |
374 | 384 | </view> |
375 | 385 | </view> |
386 | + | |
387 | + <!-- 赠品的显示 --> | |
388 | + <view wx:if="{{send_gf[bn_pick]}}"> | |
389 | + <block wx:for="{{send_gf[bn_pick]}}" wx:for-item="iter"> | |
390 | + <view class="coupon-mes flex jc_sb" style="margin: 10rpx 0; padding-right: 35rpx" | |
391 | + data-pk="{{bn_pick}}" data-index="{{index}}" | |
392 | + bindtap="show_sele_gift" > | |
393 | + <view class="flex ai_c"> | |
394 | + <view class="circle">赠</view>{{iter.name}} 可选赠品{{iter.zp_num}}个 | |
395 | + </view> | |
396 | + | |
397 | + <view class="flex ai_c" wx:if="{{iter.selected}}"> | |
398 | + 已选择<text class="bg_jj"></text> | |
399 | + </view> | |
400 | + | |
401 | + <view class="flex ai_c" wx:else="{{}}"> | |
402 | + 未选择<text class="bg_jj"></text> | |
403 | + </view> | |
404 | + | |
405 | + </view> | |
406 | + </block> | |
407 | + </view> | |
408 | + | |
376 | 409 | <!-- 留言 --> |
377 | 410 | <view class="coupon-mes flex-vertical"> |
378 | 411 | <view>留言</view> |
... | ... | @@ -398,7 +431,6 @@ |
398 | 431 | <view class="xc-right" style="margin-right: 12rpx; border-color: #d7642b;"></view> |
399 | 432 | </view> |
400 | 433 | |
401 | - | |
402 | 434 | <!-----使用余额------> |
403 | 435 | <view class="set-mes bdr_t-14" wx:if="{{yuer>0}}"> |
404 | 436 | <view class="use-item" bindtap='set_bn_useyuer'> |
... | ... | @@ -678,3 +710,68 @@ |
678 | 710 | </view> |
679 | 711 | </view> |
680 | 712 | </view> |
713 | + | |
714 | +<!-- 多赠品 --> | |
715 | +<view class="duo_gift_sele" wx:if="{{show_duo_gift}}"> | |
716 | + <!-- top search --> | |
717 | + <view class="flex gift_top_v ai_c"> | |
718 | + <text bindtap="close_sele_gift" class="bg_jj1"></text> | |
719 | + <view class="pdh20 pdv10 flex ai_c jc_sb"> | |
720 | + <view class="input-box" style="width: 580rpx;display: flex; padding-left: 20rpx"> | |
721 | + <view class="sear_box" bindtap="submitSearch"></view> | |
722 | + <input autoFocus class="input-search" name="word" placeholder="搜索关键字" bindconfirm="submitSearch" bindinput="getInput" bindfocus="inputFocus" value="{{keyword}}"/> | |
723 | + </view> | |
724 | + </view> | |
725 | + | |
726 | + </view> | |
727 | + <!-- top act_name --> | |
728 | + <view class="flex gift_top_v ai_c fs30" style="padding-left: 70rpx"> | |
729 | + {{gf_pr_name}},可以获赠一下任意{{zp_num}}件商品 | |
730 | + </view> | |
731 | + <!-- 赠品选择 --> | |
732 | + <view class="order-item" hidden="{{items.hide_div}}" data-item="{{idx}}" wx:for="{{giftsinfo}}" wx:for-item="items" wx:for-index="idx"> | |
733 | + | |
734 | + <view bindtap="check_th_item" class="order-raido flex-vertical " data-check="{{items.selected?items.selected:0}}" data-item="{{idx}}"> | |
735 | + <icon wx:if="{{items.selected}}" color="red" size="20" type="success"></icon> | |
736 | + <text wx:else class="icon_no_sele"></text> | |
737 | + </view> | |
738 | + | |
739 | + <navigator class="goods-img rel" bindtap="go_gd" data-gd="{{items.goods_id}}"> | |
740 | + <image class="wh100" src="{{imgUrl+items.goodsinfo.original_img}}" binderror="bind_bnerr2" data-errorimg="gift_goods[{{idx}}].goodsinfo.original_img"></image> | |
741 | + </navigator> | |
742 | + <view class="goods-cont"> | |
743 | + <view class="goods-name"> | |
744 | + <navigator bindtap="go_gd" class="ellipsis-2 fs30" data-gd="{{items.goods_id}}">{{items.goods_name}}</navigator> | |
745 | + | |
746 | + <view class="specifications ellipsis-1"> | |
747 | + <view wx:if="{{items.goodsinfo.goods_color || items.goodsinfo.goods_spec}}"> | |
748 | + {{items.goodsinfo.goods_color}}{{items.goodsinfo.goods_color?"/":''}}{{items.goodsinfo.goods_spec}}</view> | |
749 | + <view wx:else>规格1</view> | |
750 | + </view> | |
751 | + </view> | |
752 | + | |
753 | + <view class="flex alend jc_sb"> | |
754 | + <view class="goods-price co-red baseline ellipsis-1"> | |
755 | + <view class="fs20">¥</view> | |
756 | + <view class="fs28">{{items.goodsinfo.shop_price}}</view> | |
757 | + </view> | |
758 | + <view class="count"> | |
759 | + <view bindtap="{{items.goods_num <= 1 ? '':'subNum'}}" class="sub fs28 {{items.goods_num <= 1 ? 'active':''}}" data-pitems="{{pidx}}" data-item="{{idx}}">一</view> | |
760 | + <input class="goodadd" bindblur="valueToNum" data-item="{{idx}}" | |
761 | + bindinput="refresh_input" type="number" value="{{items.goods_num}}"></input> | |
762 | + <view class="add" bindtap="addNum" data-item="{{idx}}">+</view> | |
763 | + </view> | |
764 | + </view> | |
765 | + | |
766 | + </view> | |
767 | + </view> | |
768 | + <!-- 确认选择 --> | |
769 | + <view class="pay-for flex-vertical-between" style="bottom: 0"> | |
770 | + <view></view> | |
771 | + <view> | |
772 | + <button bindtap="sure_this_gift" class="pay-btn">确定</button> | |
773 | + </view> | |
774 | + </view> | |
775 | + | |
776 | +</view> | |
777 | + | ... | ... |
pages/cart/cart2/cart2.wxss
... | ... | @@ -20,14 +20,12 @@ |
20 | 20 | } |
21 | 21 | |
22 | 22 | page { |
23 | - /* background-color: #FAFAFA; */ | |
24 | 23 | background-color: #F0F0F0; |
25 | 24 | padding: 0 22rpx; |
26 | 25 | box-sizing: border-box; |
27 | 26 | } |
28 | 27 | .container { |
29 | 28 | background-color: #F0F0F0; |
30 | - /* padding-top: 28rpx; */ | |
31 | 29 | padding-bottom: 120rpx; |
32 | 30 | } |
33 | 31 | |
... | ... | @@ -61,24 +59,17 @@ page { |
61 | 59 | background-color: #fff; |
62 | 60 | font-size: 32rpx; |
63 | 61 | color: #444; |
64 | - /* margin-top: 28rpx; */ | |
65 | 62 | border-radius: 14rpx; |
66 | 63 | padding: 20rpx 70rpx 20rpx 20rpx; |
67 | 64 | } |
68 | -.user-contact { | |
69 | - /* padding: 24rpx 26rpx; | |
70 | - font-weight: 600; */ | |
71 | -} | |
65 | +.user-contact { } | |
72 | 66 | |
73 | 67 | .location { |
74 | 68 | position: relative; |
75 | - /* padding: 0 70rpx 24rpx; */ | |
69 | + | |
76 | 70 | } |
77 | 71 | |
78 | 72 | .pos-icon { |
79 | - /* position: absolute; */ | |
80 | - /* left: 28rpx; | |
81 | - top: 6rpx; */ | |
82 | 73 | width: 20rpx; |
83 | 74 | height: 24rpx; |
84 | 75 | display: inline-block; |
... | ... | @@ -154,21 +145,15 @@ page { |
154 | 145 | |
155 | 146 | .set-mes{ |
156 | 147 | background-color: #fff; |
157 | - /* margin-top: 20rpx; */ | |
158 | 148 | } |
159 | 149 | .use-item{ |
160 | 150 | display: flex; |
161 | 151 | align-items: center; |
162 | - /* height: 80rpx; */ | |
163 | - /* border-bottom: 1px solid #ddd; */ | |
164 | 152 | font-size: 26rpx; |
165 | - /* width:95%; | |
166 | -margin:auto; */ | |
167 | 153 | padding: 20rpx; |
168 | 154 | } |
169 | 155 | .use-item>view{ |
170 | 156 | display: flex; |
171 | - /* margin-right: 12rpx; */ | |
172 | 157 | } |
173 | 158 | .use-item.bfff{ |
174 | 159 | background-color: #fff; |
... | ... | @@ -176,8 +161,7 @@ margin:auto; */ |
176 | 161 | .use-item .dp{ |
177 | 162 | display: block; |
178 | 163 | width: 40rpx; |
179 | - height: 40rpx; | |
180 | - /* margin-left: -6rpx; */ | |
164 | + height: 40rpx; | |
181 | 165 | } |
182 | 166 | |
183 | 167 | .set-item { |
... | ... | @@ -208,13 +192,9 @@ margin:auto; */ |
208 | 192 | } |
209 | 193 | |
210 | 194 | .coupon-mes { |
211 | - /* box-sizing: border-box; */ | |
212 | - /* height:95rpx; */ | |
213 | 195 | padding: 20rpx; |
214 | 196 | background-color: #fff; |
215 | 197 | font-size: 30rpx; |
216 | - /* color: #444; */ | |
217 | - /* width: 100%; */ | |
218 | 198 | border-radius: 14rpx; |
219 | 199 | margin-top: 20rpx; |
220 | 200 | margin-bottom: 20rpx; |
... | ... | @@ -250,17 +230,9 @@ margin:auto; */ |
250 | 230 | flex-grow: 1; |
251 | 231 | align-items: center; |
252 | 232 | height: 50rpx; |
253 | - /* width: 500rpx; */ | |
254 | 233 | } |
255 | 234 | |
256 | -.word-box { | |
257 | - font-size: 26rpx; | |
258 | - width: 100%; | |
259 | - /* width: 600rpx; */ | |
260 | - /* padding: 10rpx; | |
261 | - height: 28rpx; | |
262 | - line-height: 40rpx; */ | |
263 | -} | |
235 | +.word-box { font-size: 26rpx;width: 100%;} | |
264 | 236 | |
265 | 237 | .max-word { |
266 | 238 | position: absolute; |
... | ... | @@ -268,20 +240,13 @@ margin:auto; */ |
268 | 240 | bottom: 0; |
269 | 241 | } |
270 | 242 | |
271 | -.information { | |
272 | - /* padding: 20rpx; */ | |
273 | - background-color: #fff; | |
274 | - /* margin-bottom: 120rpx; */ | |
275 | -} | |
243 | +.information { background-color: #fff; } | |
276 | 244 | |
277 | 245 | .information .item { |
278 | 246 | display: flex; |
279 | 247 | justify-content: space-between; |
280 | - /* height: 60rpx; | |
281 | - line-height: 60rpx; */ | |
282 | 248 | font-size: 24rpx; |
283 | - /* color: #333; */ | |
284 | - padding: 20rpx; | |
249 | + padding: 20rpx; | |
285 | 250 | } |
286 | 251 | |
287 | 252 | .btn-wrap { |
... | ... | @@ -299,14 +264,6 @@ margin:auto; */ |
299 | 264 | } |
300 | 265 | |
301 | 266 | .tips-btn { |
302 | - /* float: right; | |
303 | - width: 200rpx; | |
304 | - height: 100rpx; | |
305 | - line-height: 100rpx; | |
306 | - text-align: center; | |
307 | - font-size: 30rpx; | |
308 | - color: #fff; | |
309 | - background-color: #f23030; */ | |
310 | 267 | color: white; |
311 | 268 | background-color: #FE4445; |
312 | 269 | height: 72rpx; |
... | ... | @@ -317,14 +274,7 @@ margin:auto; */ |
317 | 274 | margin-right: 0; |
318 | 275 | } |
319 | 276 | |
320 | -.pay-amount { | |
321 | - /* float: right; | |
322 | - display: flex; | |
323 | - align-items: center; | |
324 | - height: 100rpx; | |
325 | - font-size: 26rpx; | |
326 | - margin-right: 40rpx; */ | |
327 | -} | |
277 | +.pay-amount { } | |
328 | 278 | |
329 | 279 | .payable { |
330 | 280 | color: #444; |
... | ... | @@ -378,7 +328,6 @@ margin:auto; */ |
378 | 328 | margin-right: 15rpx;vertical-align: middle;} |
379 | 329 | .yu_er{ |
380 | 330 | margin-left: 10rpx; |
381 | - /* margin-right: 60rpx; */ | |
382 | 331 | } |
383 | 332 | .wuliu{margin-left: 20rpx;} |
384 | 333 | |
... | ... | @@ -420,7 +369,6 @@ margin:auto; */ |
420 | 369 | position:fixed; |
421 | 370 | bottom:0; |
422 | 371 | left: 0; |
423 | - /* padding-bottom: 25rpx; */ | |
424 | 372 | } |
425 | 373 | |
426 | 374 | .cx-popup .top{ |
... | ... | @@ -681,10 +629,8 @@ width:100%; |
681 | 629 | top:-37rpx; |
682 | 630 | } |
683 | 631 | .coupon-right{ |
684 | - /* width:490rpx; */ | |
685 | 632 | height: 99%; |
686 | 633 | border-top: 1rpx solid #eaeaea; |
687 | - /* //border-bottom: 1rpx solid #eaeaea; */ | |
688 | 634 | border-right: 1rpx solid #eaeaea; |
689 | 635 | flex-grow: 1; |
690 | 636 | } |
... | ... | @@ -763,17 +709,11 @@ display: flex; |
763 | 709 | align-items: center; |
764 | 710 | } |
765 | 711 | .xc-jiantou{ |
766 | - /* width: 9rpx; | |
767 | - height: 9rpx; */ | |
768 | - /* border-top: 2rpx solid #fff; | |
769 | - border-right: 2rpx solid #fff; */ | |
770 | 712 | transform: rotate(-90deg); |
771 | 713 | color: #fff; |
772 | 714 | font-size: 15rpx; |
773 | - /* display:inline-block; | |
774 | - margin-top: 6.5rpx; */ | |
775 | 715 | text-align: center; |
776 | -width: 24rpx; | |
716 | + width: 24rpx; | |
777 | 717 | } |
778 | 718 | .xc-buttom{ |
779 | 719 | box-sizing: border-box; |
... | ... | @@ -964,13 +904,6 @@ margin-left: 20rpx; |
964 | 904 | margin-right: 8rpx; |
965 | 905 | } |
966 | 906 | |
967 | -/* .card_bg .card_name { | |
968 | - max-width: 76rpx; | |
969 | - width: auto; | |
970 | - overflow: hidden; | |
971 | - white-space: nowrap; | |
972 | -} */ | |
973 | - | |
974 | 907 | .card_name { |
975 | 908 | position: relative; |
976 | 909 | top: -4rpx; |
... | ... | @@ -1005,3 +938,207 @@ margin-left: 20rpx; |
1005 | 938 | color: #fff; |
1006 | 939 | line-height: 37rpx; |
1007 | 940 | } |
941 | + | |
942 | +.duo_gift_sele{ | |
943 | + position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: #fff; z-index: 10000; | |
944 | +} | |
945 | +.gift_top_v{ height:100rpx; padding: 0 40rpx; padding-right: 10rpx; } | |
946 | + | |
947 | + | |
948 | +.bg_jj{ | |
949 | + width: 14rpx; | |
950 | + height: 14rpx; | |
951 | + border-top: 2rpx solid #363b42; | |
952 | + border-right: 2rpx solid #363b42; | |
953 | + transform: rotateZ(45deg); | |
954 | + display: inline-block; | |
955 | +} | |
956 | + | |
957 | +.bg_jj1{ | |
958 | + width: 20rpx; | |
959 | + height: 20rpx; | |
960 | + border-top: 2rpx solid #363b42; | |
961 | + border-right: 2rpx solid #363b42; | |
962 | + transform: rotateZ(-135deg); | |
963 | + display: inline-block; | |
964 | +} | |
965 | + | |
966 | +.input-search { | |
967 | + position: relative; | |
968 | + padding: 10rpx; | |
969 | + font-size: 28rpx; | |
970 | +} | |
971 | +.input-box { | |
972 | + position: relative; | |
973 | + background-color: #f0f0f0; | |
974 | + border-radius: 60rpx; | |
975 | +} | |
976 | + | |
977 | +.input-box .sear_box { | |
978 | + | |
979 | +} | |
980 | +.input-search { | |
981 | + position: relative; | |
982 | + padding: 10rpx; | |
983 | + font-size: 28rpx; | |
984 | +} | |
985 | + | |
986 | +.icon-guan { | |
987 | + font-size: 20rpx; | |
988 | + padding: 10rpx; | |
989 | + position: absolute; | |
990 | + right: 20rpx; | |
991 | + top: 50%; | |
992 | + transform: translateY(-50%); | |
993 | +} | |
994 | + | |
995 | + | |
996 | + | |
997 | +.order-item { | |
998 | + display: flex; | |
999 | + height: 246rpx; | |
1000 | + border-top: 3rpx solid rgb(245, 245, 245); | |
1001 | + align-items: center; | |
1002 | + padding-right: 30rpx; | |
1003 | +} | |
1004 | + | |
1005 | + | |
1006 | +.pay-for { | |
1007 | + width: 100%; | |
1008 | + height: 110rpx; | |
1009 | + position: fixed; | |
1010 | + left: 0; | |
1011 | + bottom: 100rpx; | |
1012 | + font-size: 28rpx; | |
1013 | + color: #666; | |
1014 | + background-color: rgb(255, 255, 255); | |
1015 | + z-index: 1999; | |
1016 | + border-top: 1rpx solid rgb(236, 236, 236); | |
1017 | + border-bottom: 1rpx solid rgb(236, 236, 236); | |
1018 | + | |
1019 | +} | |
1020 | + | |
1021 | +.pay-for .pay-btn { | |
1022 | + width: 220rpx; height: 112rpx; line-height: 112rpx; | |
1023 | + background-color: rgb(219, 27, 52); | |
1024 | + color: #fff; | |
1025 | + border-radius: 0; | |
1026 | + font-size: 31rpx; | |
1027 | +} | |
1028 | + | |
1029 | +.pay-for .consumer { | |
1030 | + margin-right: 23rpx; | |
1031 | + color: rgb(0, 0, 0); | |
1032 | + letter-spacing: 1rpx; | |
1033 | +} | |
1034 | + | |
1035 | +.pay-for .consumer .total { | |
1036 | + color: rgb(0, 0, 0); | |
1037 | +} | |
1038 | + | |
1039 | +.pay-for .consumer .tips { | |
1040 | + color: rgb(153, 153, 153); | |
1041 | +} | |
1042 | + | |
1043 | +.pay-for .checkbox { | |
1044 | + float: left; | |
1045 | + padding-left: 40rpx; | |
1046 | + line-height: 100rpx; | |
1047 | + display: flex; | |
1048 | + align-items: center; | |
1049 | +} | |
1050 | + | |
1051 | +.pay-for .ico-check { | |
1052 | + display: flex; | |
1053 | + align-items: center; | |
1054 | + margin-right: 20rpx; | |
1055 | +} | |
1056 | +.order-raido { | |
1057 | + height: 100%; | |
1058 | + padding-left: 30rpx; | |
1059 | + padding-right: 25rpx; | |
1060 | +} | |
1061 | +.icon_no_sele{ display: inline-block; width: 39rpx; height: 39rpx; border: 1rpx solid #ddd; border-radius: 50%} | |
1062 | +.icon_no_sele2{width: 39rpx; height: 39rpx; border: 1rpx solid #ddd; border-radius: 50%; margin-top: 20rpx; | |
1063 | + margin-left: 30rpx; margin-right: 25rpx} | |
1064 | +.baseline { | |
1065 | + display: flex; | |
1066 | + align-items: baseline; | |
1067 | +} | |
1068 | +.specifications { | |
1069 | + padding: 3rpx 8rpx; | |
1070 | + margin-top: 8rpx; | |
1071 | + font-size: 22rpx; | |
1072 | + max-width: 356rpx; | |
1073 | + width: auto; | |
1074 | + height: 30rpx; | |
1075 | + line-height: 29rpx; | |
1076 | + background-color: rgb(236, 236, 236); | |
1077 | + border-radius: 8rpx; | |
1078 | + white-space: nowrap; | |
1079 | + color: rgb(63, 63, 63); | |
1080 | + display: inline-block; | |
1081 | +} | |
1082 | + | |
1083 | +.count { | |
1084 | + display: flex; | |
1085 | + bottom: 5rpx; | |
1086 | + /* border: 2rpx solid rgb(236, 236, 236); */ | |
1087 | + margin-bottom: 3rpx; | |
1088 | +} | |
1089 | + | |
1090 | +.count>view, .count>input { | |
1091 | + width: 50rpx; | |
1092 | + height: 40rpx; | |
1093 | + line-height: 40rpx; | |
1094 | + text-align: center; | |
1095 | + display: flex; | |
1096 | + font-size: 18rpx; | |
1097 | + justify-content: center; | |
1098 | + min-height: 35rpx; | |
1099 | + align-items: center; | |
1100 | +} | |
1101 | + | |
1102 | +.count>.goodadd { | |
1103 | + width: 67rpx; | |
1104 | + font-size: 24rpx; | |
1105 | +} | |
1106 | + | |
1107 | +.count>.add { | |
1108 | + font-size: 32rpx; | |
1109 | +} | |
1110 | + | |
1111 | +.sub, .add, .count>input { | |
1112 | + /* border-right: 1px solid #000; */ | |
1113 | + background-color: #f0f0f0; | |
1114 | + border-radius: 8rpx; | |
1115 | +} | |
1116 | +.sub.active { | |
1117 | + /* background-color: #ddd; */ | |
1118 | + color: #ccc; | |
1119 | +} | |
1120 | +.count>input { | |
1121 | + margin: 0 14rpx; | |
1122 | + line-height: normal; | |
1123 | +} | |
1124 | +.alend { | |
1125 | + align-items: flex-end; | |
1126 | +} | |
1127 | +.goods-cont { | |
1128 | + width: 420rpx; | |
1129 | + height: 165rpx; | |
1130 | + font-size: 28rpx; | |
1131 | + margin-left: 35rpx; | |
1132 | + padding-top: 7rpx; | |
1133 | + padding-bottom: 5rpx; | |
1134 | +} | |
1135 | + | |
1136 | +.circle{ width: 50rpx;height: 50rpx; border-radius: 50%; margin-right: 10rpx; | |
1137 | + border: 3rpx solid #c8162c;color: #c8162c;text-align: center; line-height: 50rpx} | |
1138 | + | |
1139 | +.sear_box::before{ | |
1140 | + font-family: iconfont; | |
1141 | + content: '\e618'; | |
1142 | + font-size: 28rpx; | |
1143 | +} | |
1144 | + | ... | ... |
pages/cart/cart2_inte/cart2_inte.js
... | ... | @@ -658,6 +658,10 @@ Page({ |
658 | 658 | 'prom_id': th.data.bn_goods.prom_id, //促销活动id |
659 | 659 | }; |
660 | 660 | |
661 | + if(getApp().globalData.skinface_id){ | |
662 | + goods.skinface_id=getApp().globalData.skinface_id; | |
663 | + } | |
664 | + | |
661 | 665 | //-- 把导购的信息填入-- |
662 | 666 | if (gg.guide_id) { |
663 | 667 | goods.guide_id = gg.guide_id; | ... | ... |
pages/cart/cart2_pt/cart2_pt.js
... | ... | @@ -619,6 +619,9 @@ Page({ |
619 | 619 | 'prom_id': th.data.bn_goods.prom_id, //促销活动id |
620 | 620 | }; |
621 | 621 | |
622 | + if(getApp().globalData.skinface_id){ | |
623 | + goods.skinface_id=getApp().globalData.skinface_id; | |
624 | + } | |
622 | 625 | //--导购分享过来的id-- |
623 | 626 | if (gg.guide_id) { |
624 | 627 | goods.guide_id = gg.guide_id; | ... | ... |
pages/goods/goodsInfo/filter.wxs
... | ... | @@ -20,8 +20,16 @@ function act_type(ty){ |
20 | 20 | } |
21 | 21 | } |
22 | 22 | |
23 | +function repl(str){ | |
24 | + var str_arr=str.split("^"); | |
25 | + return str_arr.join(","); | |
26 | +} | |
27 | + | |
28 | + | |
29 | + | |
23 | 30 | module.exports = { |
24 | 31 | is_has: is_has, |
25 | 32 | format_tt:format_tt, |
26 | - act_type:act_type | |
33 | + act_type:act_type, | |
34 | + repl:repl | |
27 | 35 | } | ... | ... |
pages/goods/goodsInfo/goodsInfo.js
... | ... | @@ -272,9 +272,8 @@ Page({ |
272 | 272 | |
273 | 273 | self = this; |
274 | 274 | |
275 | - | |
276 | - console.log("gd onload"); | |
277 | - console.log(t); | |
275 | + //检查测肤 | |
276 | + getApp().check_skin_face(t,0,gid); | |
278 | 277 | |
279 | 278 | //-- 自定义海报 -- |
280 | 279 | getApp().request.promiseGet("/api/weshop/goods/poster/page", { |
... | ... | @@ -2051,7 +2050,6 @@ Page({ |
2051 | 2050 | }); |
2052 | 2051 | }, |
2053 | 2052 | |
2054 | - | |
2055 | 2053 | openSpecModel: function (t) { |
2056 | 2054 | var th = this; |
2057 | 2055 | var open_store = t.currentTarget.dataset.ind; |
... | ... | @@ -2501,17 +2499,17 @@ Page({ |
2501 | 2499 | console.log('get_sku'); |
2502 | 2500 | var tt = this, arrdata = null; |
2503 | 2501 | var now = ut.gettimestamp(); |
2504 | - await getApp().request.promiseGet("/api/weshop/goods/page", { | |
2505 | - data: { | |
2506 | - store_id: o.stoid, | |
2507 | - sku: gd.sku, | |
2508 | - more_spec: gd.more_spec, | |
2509 | - isonsale: 1, | |
2510 | - is_on_sale: 1, | |
2511 | - pageSize: 500, | |
2512 | - orderField: 'gg_ordid,goods_spec,sort' | |
2513 | - } | |
2514 | - }).then(res => { | |
2502 | + await getApp().request.promiseGet("/api/weshop/goods/page", { | |
2503 | + data: { | |
2504 | + store_id: o.stoid, | |
2505 | + sku: gd.sku, | |
2506 | + more_spec: gd.more_spec, | |
2507 | + isonsale: 1, | |
2508 | + is_on_sale: 1, | |
2509 | + pageSize: 500, | |
2510 | + orderField: 'gg_ordid,goods_spec,sort' | |
2511 | + } | |
2512 | + }).then(res => { | |
2515 | 2513 | var e = res; |
2516 | 2514 | if (e.data.code == 0) arrdata = e.data.data.pageData; |
2517 | 2515 | }) |
... | ... | @@ -2830,8 +2828,9 @@ Page({ |
2830 | 2828 | } |
2831 | 2829 | clearInterval(timer_get); |
2832 | 2830 | |
2833 | - //如果会员是有默认的门店话 | |
2834 | - if (!th.data.def_pick_store && th.data.fir_def_store && Object.keys(th.data.fir_def_store).length>0) { | |
2831 | + | |
2832 | + //如果会员是有默认的门店话 | |
2833 | + if (!th.data.def_pick_store && th.data.fir_def_store && Object.keys(th.data.fir_def_store).length>0) { | |
2835 | 2834 | th.setData({def_pick_store: th.data.fir_def_store}); |
2836 | 2835 | } |
2837 | 2836 | wx.showLoading({ | ... | ... |
pages/goods/goodsInfo/goodsInfo.wxml
... | ... | @@ -413,18 +413,11 @@ |
413 | 413 | <view class="word-line fs24">零售价¥{{filters.toFix(data.market_price,2)}}</view> |
414 | 414 | </view> |
415 | 415 | <!-- 这个是分享按钮 --> |
416 | - <!-- <view class="xc-share-frame {{prom_type==1?'s_ms_bth':''}} t-c" bindtap="saveImageToPhotosAlbum"> --> | |
417 | 416 | <view class="xc-share-frame t-c shrink0" bindtap="clickShare"> |
418 | - <!-- <image class="share-frame" src="{{iurl}}/miniapp/images/share.png"></image> --> | |
419 | 417 | <view class="iconfont icon-share"></view> |
420 | - <!-- <view class="share-font">1分享</view> --> | |
421 | 418 | <view class="fs22 c-7b">分享</view> |
422 | 419 | </view> |
423 | - <!-- <view class="xc-val-price"> | |
424 | - <view class="fs30" style='padding-left:13rpx;' wx:if="{{prom_st==1}}" >已抢:{{prom_act.buy_num+prom_act.virtual}}件</view> | |
425 | - <view class="fs30" style='padding-left:13rpx;' wx:else >已抢:0件</view> | |
426 | - <view class="fs30 save t-c">秒杀立省¥{{filters.toFix(data.market_price-prom_price,2)}}</view> | |
427 | - </view> --> | |
420 | + | |
428 | 421 | </view> |
429 | 422 | </view> |
430 | 423 | |
... | ... | @@ -491,11 +484,10 @@ |
491 | 484 | </view> |
492 | 485 | </block> |
493 | 486 | |
494 | - | |
487 | + | |
495 | 488 | <!-- 要判断是不是有促销活动 --> |
496 | 489 | <block wx:if="{{prom_goods}}"> |
497 | 490 | <view class="cx-frame flex" style="position: relative; height: auto" hidden="{{prom_type==4 || prom_type==6}}"> |
498 | - <!-- <view class="cx-sizs fs30">促销</view> --> | |
499 | 491 | <!-- 中间显示层 --> |
500 | 492 | <block> |
501 | 493 | <view class="cx-sizs fs30 pdr20">促销</view> |
... | ... | @@ -504,20 +496,16 @@ |
504 | 496 | <view> |
505 | 497 | <text class="prom_condition"> |
506 | 498 | <text class="fill-box">消费满{{item.condition}}{{item.prom_type==1 ? '件':'元'}}</text>享优惠 |
507 | - <!-- <text wx:if="{{item.prom_type==1}}">件,</text> | |
508 | - <text wx:else>元,</text> --> | |
509 | 499 | </text> |
510 | - <!-- <text>可享以下优惠:</text> --> | |
511 | 500 | </view> |
512 | - | |
513 | - <!-- <view class="word {{is_more_cx?'':'ellipsis-1'}}"> --> | |
501 | + | |
514 | 502 | <view class="word f1 fs26"> |
515 | 503 | <text class="tick lh2 pdr20" wx:if="{{item.money>0}}">减价{{item.money}}元</text> |
516 | 504 | <text class="tick lh2 pdr20" wx:if="{{item.sale>0}}">打{{item.sale}}折</text> |
517 | 505 | <text class="tick lh2 pdr20" wx:if="{{item.past==1}}">包邮</text> |
518 | 506 | <text class="tick lh2 pdr20" wx:if="{{item.intValue>0}}">送{{item.intValue}}积分</text> |
519 | 507 | <view class="tick lh2 pdr20" wx:if="{{item.couponId>0}}">送{{item.couponMoney}}元优惠券</view> |
520 | - <view class="tick ellipsis-1x lh2" wx:if="{{item.gift_id>0}}">送商品{{item.goods_name}}</view> | |
508 | + <view class="tick ellipsis-1x lh2" wx:if="{{item.gift_id}}">送商品{{tool.repl(item.goods_name)}}</view> | |
521 | 509 | <view class="tick ellipsis-1x lh2 details pdr40" wx:if="{{item.lb_id>0}}" data-id="{{item.lb_id}}" bindtap="viewLbDetails">送{{item.lbtitle}}</view> |
522 | 510 | <view class="tick ellipsis-1x lh2 details pdr40" wx:if="{{item.zxlb_id>0}}" data-id="{{item.zxlb_id}}" data-flag="1" bindtap="viewLbDetails">送{{item.zxlbtitle}}</view> |
523 | 511 | </view> |
... | ... | @@ -525,9 +513,6 @@ |
525 | 513 | </view> |
526 | 514 | |
527 | 515 | </block> |
528 | - <!-- <view data-coupon="1" bindtap="show_more_cx" class="cx-obtain-coupon wsize"> | |
529 | - <text class="bg_jj {{is_more_cx?'down1':''}}"></text> | |
530 | - </view> --> | |
531 | 516 | </view> |
532 | 517 | </block> |
533 | 518 | |
... | ... | @@ -1177,7 +1162,7 @@ |
1177 | 1162 | </view> |
1178 | 1163 | </block> |
1179 | 1164 | </block> |
1180 | - <!-- -<view bindtap="openSpecModel" class="buy-btn cart-btn cart-btn-lg" wx:else>立即兑换</view> --> | |
1165 | + | |
1181 | 1166 | </view> |
1182 | 1167 | <!-- 制作一个圆球导航 --> |
1183 | 1168 | <nav_box></nav_box> |
... | ... | @@ -1352,7 +1337,7 @@ |
1352 | 1337 | <block wx:else> |
1353 | 1338 | <block wx:if="{{sele_g.store_count<=0}}"> |
1354 | 1339 | <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999"> |
1355 | - 库存不足 | |
1340 | + 库存不足5 | |
1356 | 1341 | </view> |
1357 | 1342 | </block> |
1358 | 1343 | <block wx:else> | ... | ... |
pages/goods/search/search.js
... | ... | @@ -103,7 +103,7 @@ Page({ |
103 | 103 | //--- 判断是等级会员,且在有效期范围内 --- |
104 | 104 | if(user.card_field && now<end){ |
105 | 105 | var card_name=ob.name_map.get(user.card_field); |
106 | - if(card_name.length>7) card_name=card_name.substring(0,8); | |
106 | + if(card_name && card_name.length>7) card_name=card_name.substring(0,8); | |
107 | 107 | th.setData({card_field:user.card_field,card_name:card_name,card_list:ob.card_list}); |
108 | 108 | } |
109 | 109 | } | ... | ... |