jufubao-mall 1.0.0 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jufubao-mall",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "private": false,
5
5
  "description": "聚福宝商城业务组件插件包",
6
6
  "main": "index.js",
@@ -284,7 +284,7 @@
284
284
  }
285
285
  else this.prodList = this.prodList.concat(list);
286
286
  }).catch(err => {
287
-
287
+ this.$xdLog.catch(err);
288
288
  console.error(err);
289
289
  })
290
290
  },
@@ -271,13 +271,15 @@
271
271
  })
272
272
  },
273
273
  toBrand(brand){
274
+ let { brand_icon, brand_name, params, ...otherParams } = brand;
275
+ let otherP = this.$xdUniHelper.jsonToParams(Object.assign(otherParams, params || {}));
274
276
  if(brand.brand_type === 'sell'){
275
277
  this.$xdUniHelper.navigateTo({
276
- url: this.offlineBrandPath + `?brand_id=${brand.brand_id}`
278
+ url: this.offlineBrandPath + `?consume_mode=SELL&${otherP}`
277
279
  })
278
280
  }else{
279
281
  this.$xdUniHelper.navigateTo({
280
- url: this.onlineBrandPath + `?brand_id=${brand.brand_id}&brand_type=${brand.brand_type}`
282
+ url: this.onlineBrandPath + `?${otherP}`
281
283
  })
282
284
  }
283
285
  },
@@ -451,6 +451,7 @@ export default {
451
451
  console.log(this.originCartList);
452
452
  })
453
453
  .catch((err) => {
454
+ this.$xdLog.catch(err);
454
455
  this.loaded = true;
455
456
  this.originCartList = [];
456
457
  this.cartList = [];
@@ -523,6 +523,8 @@
523
523
  else this.addressList = [res];
524
524
  resolve(res);
525
525
  }).catch(err => {
526
+ this.$xdLog.catch(err);
527
+ this.$xdHideLoading();
526
528
  reject(err);
527
529
  })
528
530
  })
@@ -101,7 +101,7 @@ export default {
101
101
  }).then(res => {
102
102
  cb(res.list)
103
103
  this.cardList = res.list
104
- }).catch()
104
+ }).catch(this.$xdLog.catch)
105
105
  },
106
106
  setSettleSelectCard(options, successCb, errCb) {
107
107
  this.$xdShowLoading({})
@@ -116,8 +116,9 @@ export default {
116
116
  successCb(res)
117
117
  this.$xdHideLoading()
118
118
  }).catch(err => {
119
- errCb(err)
119
+ if(errCb) errCb(err)
120
120
  this.$xdHideLoading()
121
+ this.$xdLog.catch(err);
121
122
  })
122
123
  },
123
124
  createSettleOrder(options, successCb, errCb) {
@@ -144,6 +145,7 @@ export default {
144
145
  // this.$xdHideLoading()
145
146
  }).catch(err => {
146
147
  this.$xdHideLoading()
148
+ this.$xdLog.catch(err);
147
149
  })
148
150
  },
149
151
  p_getOrderInfo(options, cb){
@@ -191,7 +193,8 @@ export default {
191
193
  }).catch(err => {
192
194
  console.log(err, 'err')
193
195
  this.$xdHideLoading();
194
- errCb();
196
+ if(errCb) errCb();
197
+ this.$xdLog.catch(err);
195
198
  })
196
199
  },
197
200
  handleCreateSuccess(val) {
@@ -226,6 +229,7 @@ export default {
226
229
  }).catch(err => {
227
230
  console.error(err);
228
231
  this.$xdHideLoading();
232
+ this.$xdLog.catch(err);
229
233
  })
230
234
  },
231
235
  getOrderStatus(request_order_id){
@@ -167,7 +167,10 @@ export default {
167
167
  this.navList = this.navList.splice(0,3);
168
168
  this.getList();
169
169
  })
170
- .catch((err) => console.log(err, "err"));
170
+ .catch((err) => {
171
+ console.log(err, "err")
172
+ this.$xdLog.catch(err);
173
+ });
171
174
  },
172
175
  getList() {
173
176
  const { navList, activeIndex, page_token, page_size } = this;
@@ -192,6 +195,7 @@ export default {
192
195
  .catch((err) => {
193
196
  console.log("err", err);
194
197
  this.$xdHideLoading();
198
+ this.$xdLog.catch(err);
195
199
  });
196
200
  },
197
201
  handleToList(item) {
@@ -185,6 +185,7 @@ export default {
185
185
  .catch((err) => {
186
186
  console.log("err", err);
187
187
  this.$xdHideLoading();
188
+ this.$xdLog.catch(err);
188
189
  });
189
190
  },
190
191
  handleToList(item) {
@@ -344,6 +344,8 @@
344
344
  margin-top: unit(44, rpx);
345
345
  color: #242424;
346
346
  font-size: unit(24, rpx);
347
+ overflow: hidden;
348
+ text-overflow: ellipsis;
347
349
  }
348
350
  }
349
351
  }
@@ -284,7 +284,10 @@
284
284
  return item;
285
285
  });
286
286
  r(res);
287
- }).catch(err => j(err))
287
+ }).catch(err => {
288
+ this.$xdLog.catch(err);
289
+ j(err)
290
+ })
288
291
  })
289
292
  },
290
293
  getList(isTabLoading=false){
@@ -320,13 +323,18 @@
320
323
  //首次加载成功计算最大滚动高度进行吸顶操作
321
324
  if(this.loading === false) {
322
325
  this.$nextTick(() => {
323
- this.getEleTop()
326
+ this.$xdUniHelper.getWindowHeight(['.jfb-mall-home-product-list__body'], this)
327
+ .then(res => {
328
+ this.fixedTop = (res['.jfb-mall-home-product-list__body'].top - this.layoutInfo.top * this.$rpxNum);
329
+ this.loading = true
330
+ })
331
+ .catch()
324
332
  });
325
333
  }
326
334
  this.$nextTick(()=>{
327
335
  if(isTabLoading && this.scrollTop >= this.fixedTop){
328
336
  uni.pageScrollTo({
329
- scrollTop: this.fixedTop + 2,
337
+ scrollTop: this.fixedTop,
330
338
  duration: 0
331
339
  });
332
340
  }
@@ -338,6 +346,7 @@
338
346
  }).catch(err => {
339
347
  console.log("err", err);
340
348
  this.$xdHideLoading();
349
+ this.$xdLog.catch(err);
341
350
  })
342
351
  },
343
352
  toDetail(item){
@@ -353,12 +362,15 @@
353
362
  if(this.isPreview || this.loading === false) return;
354
363
  //#ifdef H5
355
364
  this.scrollTop = e.scrollTop;
356
- if (e.scrollTop > this.fixedTop) {
357
- this.fixed = true;
358
- }
359
- else {
360
- this.fixed = false;
361
- }
365
+ this.$xdUniHelper.getWindowHeight(['.jfb-mall-home-product-list__body'], this)
366
+ .then(res => {
367
+ let top = (res['.jfb-mall-home-product-list__body'].top - this.layoutInfo.top * this.$rpxNum);
368
+ if(this.fixedTop < top) {
369
+ this.fixedTop = top
370
+ }
371
+ this.fixed = (top+2) < 0;
372
+ })
373
+ .catch()
362
374
  // #endif
363
375
  },
364
376
  onJfbReachBottom(options) {
@@ -435,6 +435,7 @@
435
435
  this.buyButton = res;
436
436
  }).catch(err => {
437
437
  this.$xdHideLoading();
438
+ this.$xdLog.catch(err);
438
439
  })
439
440
  },
440
441
  p_getAddressList(){
@@ -477,6 +478,7 @@
477
478
  cb(res);
478
479
  }).catch(err => {
479
480
  this.$xdHideLoading();
481
+ this.$xdLog.catch(err);
480
482
  })
481
483
  },
482
484
  //点击加入购物车
@@ -526,7 +528,10 @@
526
528
  url: this.orderConfirmPath + `?order_id=${res.cart_order_id}`
527
529
  })
528
530
  })
529
- }).catch(() => this.$xdHideLoading())
531
+ }).catch((err) => {
532
+ this.$xdHideLoading()
533
+ this.$xdLog.catch(err);
534
+ })
530
535
  },
531
536
  toChooseSkus(){
532
537
  this.action = "";
@@ -408,6 +408,7 @@
408
408
 
409
409
  }).catch(err => {
410
410
  if (!this.isFirst) this.$xdHideLoading();
411
+ this.$xdLog.catch(err);
411
412
  })
412
413
  }, 100)
413
414
  },
@@ -432,6 +433,7 @@
432
433
  this.loaded = true;
433
434
  }).catch(err => {
434
435
  //this.$xdHideLoading();
436
+ this.$xdLog.catch(err);
435
437
  })
436
438
  },
437
439
  getSearchFilterList(){
@@ -580,6 +582,7 @@
580
582
  }).catch(err => {
581
583
  this.$xdHideLoading();
582
584
  this.subCategory = [];
585
+ this.$xdLog.catch(err);
583
586
  reject();
584
587
  })
585
588
  })
@@ -118,6 +118,7 @@
118
118
  this.allNavList = items;
119
119
  resolve(items)
120
120
  }).catch(err => {
121
+ this.$xdLog.catch(err);
121
122
  resolve([])
122
123
  })
123
124
  },
@@ -165,6 +166,7 @@
165
166
  })
166
167
  resolve(items)
167
168
  }).catch(err => {
169
+ this.$xdLog.catch(err);
168
170
  this.$xdHideLoading();
169
171
  resolve([]);
170
172
  })
@@ -256,6 +256,7 @@
256
256
  if(this.page_token == 1) this.prodList = res.list;
257
257
  else this.prodList = this.prodList.concat(list);
258
258
  }).catch(err => {
259
+ this.$xdLog.catch(err);
259
260
  console.log(err);
260
261
  })
261
262
  }else{
@@ -153,6 +153,7 @@
153
153
  else throw new Error('数据错误')
154
154
  }).catch(error=>{
155
155
  console.error(error);
156
+ this.$xdLog.catch(error);
156
157
  this.$xdHideLoading();
157
158
  })
158
159
  },