Commit 2bc07acea6175b4ea7b2f38ae93f2adc5eac4a4e

Authored by yvan.ni
1 parent bf48a0f6

商品分组的自定义组件的修改

components/diy_goodsGroup/diy_goodsGroup.js
... ... @@ -90,6 +90,9 @@ Component({
90 90 index = 0,
91 91 gdata = [];
92 92  
  93 + //--初始化卡类--
  94 + th.card_init();
  95 +
93 96 classstyle_id = classstyle_id + "";
94 97 switch (classstyle_id) {
95 98 case "1":
... ... @@ -135,7 +138,7 @@ Component({
135 138 var prom = res.data.data;
136 139 var now=ut.gettimestamp();
137 140 if (prom != null && prom.is_end==0 && prom.end_time>now && prom.show_time<now) {
138   - item.shop_price = res.data.data.price;
  141 + item.prom_price = res.data.data.price;
139 142 }
140 143 th.data.requestData.push(item);
141 144 th.setData({
... ... @@ -200,7 +203,7 @@ Component({
200 203 await app.request.promiseGet(url, {}).then(res => {
201 204 var prom = res.data.data;
202 205 if (prom != null && prom.is_end==0 && prom.end_time>now && prom.show_time<now) {
203   - item.shop_price = res.data.data.price;
  206 + item.prom_price = res.data.data.price;
204 207 }
205 208 th.data.requestData.push(item);
206 209 th.setData({
... ... @@ -268,7 +271,7 @@ Component({
268 271 await app.request.promiseGet(url, {}).then(res => {
269 272 var prom = res.data.data;
270 273 if (prom != null && prom.is_end==0 && prom.end_time>now && prom.show_time<now) {
271   - item.shop_price = res.data.data.price;
  274 + item.prom_price = res.data.data.price;
272 275 }
273 276 th.data.requestData.push(item);
274 277 th.setData({
... ... @@ -304,7 +307,7 @@ Component({
304 307 },
305 308  
306 309 //---卡的初始化----
307   - card_init: function(func) {
  310 + card_init: function() {
308 311 var th = this;
309 312 getApp().request.get("/api/weshop/users/get/" + os.stoid + "/" + getApp().globalData.user_id, {
310 313 success: function(e) {
... ... @@ -343,11 +346,9 @@ Component({
343 346 card_list: ob.card_list
344 347 });
345 348 }
346   - //---回调----
347   - if(func) func()
  349 +
348 350 }
349   - //---回调----
350   - if(func) func()
  351 +
351 352 }, 500)
352 353 })
353 354  
... ...