Commit c822ef91a0127e4437c1e4fb22e2e3dc2a888e63
1 parent
72e43ad6
多活动的优化
Showing
3 changed files
with
27 additions
and
39 deletions
components/cart_collect_temp/cart_collect_temp.js
... | ... | @@ -71,46 +71,14 @@ Component({ |
71 | 71 | return false; |
72 | 72 | } |
73 | 73 | } |
74 | - //判断物流是否一致 | |
75 | - if(ob.selected){ | |
76 | - let distr_t=this.properties.distr_t | |
77 | - let distr_type=itr.distr_type | |
78 | - let all_collocation_list=this.properties.all_collocation_list | |
79 | - let disoff=0 | |
80 | - if(distr_t==0){ | |
81 | - all_collocation_list.map(item=>{ | |
82 | - if (distr_type!=0 && item.selected && item.distr_type !=0 && item.distr_type !=distr_type) { | |
83 | - disoff=1 | |
84 | - } | |
85 | - }) | |
86 | - }else{ | |
87 | - all_collocation_list.map(item=>{ | |
88 | - if (distr_type!=0 && item.selected && item.distr_type !=0 && item.distr_type !=distr_type) { | |
89 | - disoff=1 | |
90 | - } | |
91 | - }) | |
92 | - if(!disoff){ | |
93 | - if (distr_type !=distr_t) { | |
94 | - disoff=1 | |
95 | - } | |
96 | - } | |
97 | - } | |
98 | - if(disoff){ | |
99 | - wx.showToast({ | |
100 | - title: "商品的配送方式不一致", | |
101 | - icon: 'none', | |
102 | - duration: 2000 | |
103 | - }) | |
104 | - return false; | |
105 | - } | |
106 | - } | |
107 | - | |
108 | 74 | |
75 | + this.triggerEvent('childFun', ob); | |
109 | 76 | |
110 | - var txt = "all_collocation_list[" + index + "].selected" | |
77 | + if(!ob.selected) { | |
78 | + var txt = "all_collocation_list[" + index + "].selected" | |
79 | + this.setData({[txt]: ob.selected}) | |
111 | 80 | |
112 | - this.setData({[txt]: ob.selected}) | |
113 | - this.triggerEvent('childFun', ob); | |
81 | + } | |
114 | 82 | }, |
115 | 83 | |
116 | 84 | //图片失败,默认图片 |
... | ... | @@ -185,6 +153,20 @@ Component({ |
185 | 153 | func(isok); |
186 | 154 | }, |
187 | 155 | |
156 | + set_sele(index){ | |
157 | + var txt = "all_collocation_list[" + index + "].selected" | |
158 | + this.setData({[txt]: 1}) | |
159 | + }, | |
160 | + | |
161 | + //-- 清理所有的选择 -- | |
162 | + clear_sele(){ | |
163 | + var all_collocation_list=this.data.all_collocation_list; | |
164 | + for (let i = 0; i <all_collocation_list.length ; i++) { | |
165 | + all_collocation_list[i].selected=0; | |
166 | + } | |
167 | + this.setData({all_collocation_list}) | |
168 | + } | |
169 | + | |
188 | 170 | |
189 | 171 | } |
190 | 172 | }) |
191 | 173 | \ No newline at end of file | ... | ... |
pages/goods/goodsList/goodsList.js
... | ... | @@ -297,7 +297,6 @@ Page({ |
297 | 297 | } |
298 | 298 | |
299 | 299 | t +="&page=" + e.data.currentPage; |
300 | - | |
301 | 300 | wx.showLoading({}); |
302 | 301 | |
303 | 302 | getApp().request.promiseGet(t, {data:{is_mainshow: 1, isonsale: 1, store_id: oo.stoid}}).then(async res=>{ |
... | ... | @@ -371,6 +370,9 @@ Page({ |
371 | 370 | if(res && res.data) prom=res.data.data; |
372 | 371 | if (prom != null && prom.is_end==0 && prom.end_time>now && (prom.start_time<now || (prom_type!=2 && prom.show_time && prom.show_time<now)) ) { |
373 | 372 | item.prom_price = res.data.data.price; |
373 | + if(prom_type==4){ | |
374 | + item.prom_price= res.data.data.addmoney; | |
375 | + } | |
374 | 376 | if(res.data.data.user_price) item.prom_price=res.data.data.user_price; |
375 | 377 | // var vNum=res.data.data.virtual_num?res.data.data.virtual_num:0; |
376 | 378 | // var vNum1=res.data.data.virtualNum?res.data.data.virtualNum:0; | ... | ... |
pages/goods/search/search.js
... | ... | @@ -261,7 +261,7 @@ Page({ |
261 | 261 | }).then(res => { |
262 | 262 | if (res.data.code == 0 && res.data.data && res.data.data.length > 0) { |
263 | 263 | var arr = res.data.data[0]; |
264 | - item.prom_price = arr.luck_goods_price; | |
264 | + item.prom_price = arr.presell_price; | |
265 | 265 | item.sales_sum = arr.buy_goodnum + (arr.virtual_qty ? arr.virtual_qty : 0); |
266 | 266 | } |
267 | 267 | }) |
... | ... | @@ -277,6 +277,10 @@ Page({ |
277 | 277 | |
278 | 278 | if (prom != null && prom.is_end == 0 && prom.end_time > now && (prom.start_time < now || (prom_type!=2 && prom.show_time && prom.show_time < now))) { |
279 | 279 | item.prom_price = res.data.data.price; |
280 | + if(prom_type==4){ | |
281 | + item.prom_price= res.data.data.addmoney; | |
282 | + } | |
283 | + | |
280 | 284 | if (res.data.data.user_price) item.prom_price = res.data.data.user_price; |
281 | 285 | var vNum = prom.virtual_num ? prom.virtual_num : 0; |
282 | 286 | var vNum1 = prom.virtualNum ? prom.virtualNum : 0; | ... | ... |