jufubao-takeorder 1.0.2-beta8 → 1.0.2-beta9

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-takeorder",
3
- "version": "1.0.2-beta8",
3
+ "version": "1.0.2-beta9",
4
4
  "private": false,
5
5
  "description": "聚福宝业务组件基础插件包",
6
6
  "main": "index.js",
@@ -23,13 +23,19 @@
23
23
  <view class="menu_wrap" :style="[menuWrapBoxStyle]">
24
24
  <view class="jfb-takeorder-index__body-filter">
25
25
  <view
26
- :style="{ color: (filterType === 'province' || selectedProvs.length > 0) ? mainColor : '' }"
26
+ :style="{
27
+ color:
28
+ filterType === 'province' || selectedProvs.length > 0
29
+ ? mainColor
30
+ : '',
31
+ }"
27
32
  @click="handleSwitchFilter('province')"
28
33
  class="jfb-takeorder-index__body-filter-item"
29
- >
30
- <view v-if="selectedProvs.length===0">省份</view
31
- >
32
- <view v-else class="jfb-takeorder-index__body-filter-text">{{ selectedProvsName.join('') }}</view>
34
+ >
35
+ <view v-if="selectedProvs.length === 0">省份</view>
36
+ <view v-else class="jfb-takeorder-index__body-filter-text">{{
37
+ selectedProvsName.join("")
38
+ }}</view>
33
39
  <XdFontIcon
34
40
  style="font-weight: bolder"
35
41
  size="20"
@@ -37,11 +43,18 @@
37
43
  ></XdFontIcon
38
44
  ></view>
39
45
  <view
40
- :style="{ color: (filterType === 'city' || selectedCity.length > 0) ? mainColor : '' }"
46
+ :style="{
47
+ color:
48
+ filterType === 'city' || selectedCity.length > 0
49
+ ? mainColor
50
+ : '',
51
+ }"
41
52
  @click="handleSwitchFilter('city')"
42
53
  class="jfb-takeorder-index__body-filter-item"
43
- ><view v-if="selectedCity.length===0">城市</view
44
- ><view v-else class="jfb-takeorder-index__body-filter-text">{{ selectedCityName.join('') }}</view>
54
+ ><view v-if="selectedCity.length === 0">城市</view
55
+ ><view v-else class="jfb-takeorder-index__body-filter-text">{{
56
+ selectedCityName.join("")
57
+ }}</view>
45
58
  <XdFontIcon
46
59
  style="font-weight: bolder"
47
60
  size="20"
@@ -49,11 +62,18 @@
49
62
  ></XdFontIcon
50
63
  ></view>
51
64
  <view
52
- :style="{ color: (filterType === 'brand' || selectedBrands.length > 0) ? mainColor : '' }"
65
+ :style="{
66
+ color:
67
+ filterType === 'brand' || selectedBrands.length > 0
68
+ ? mainColor
69
+ : '',
70
+ }"
53
71
  @click="handleSwitchFilter('brand')"
54
72
  class="jfb-takeorder-index__body-filter-item"
55
- ><view v-if="selectedBrands.length===0">品牌</view
56
- ><view v-else class="jfb-takeorder-index__body-filter-text">{{ selectedBrandsName.join('') }}</view>
73
+ ><view v-if="selectedBrands.length === 0">品牌</view
74
+ ><view v-else class="jfb-takeorder-index__body-filter-text">{{
75
+ selectedBrandsName.join("")
76
+ }}</view>
57
77
  <XdFontIcon
58
78
  style="font-weight: bolder"
59
79
  size="20"
@@ -228,7 +248,7 @@ export default {
228
248
  page_token: 1,
229
249
  hasNext: true,
230
250
  next_page_token: "",
231
- max_id: null,
251
+ max_id: 0,
232
252
  order_detail_path: "",
233
253
  isPreview: false,
234
254
  isOpenNew: "N",
@@ -343,7 +363,9 @@ export default {
343
363
  // 只有当有选择时,才添加筛选参数,如果选择了 'all' 则不传
344
364
  if (this.selectedProvs && this.selectedProvs.length > 0) {
345
365
  // 如果只有一个选项且为 'all',则不传 province_codes
346
- if (!(this.selectedProvs.length === 1 && this.selectedProvs[0] === 'all')) {
366
+ if (
367
+ !(this.selectedProvs.length === 1 && this.selectedProvs[0] === "all")
368
+ ) {
347
369
  params.province_codes = this.selectedProvs;
348
370
  }
349
371
  }
@@ -496,13 +518,16 @@ export default {
496
518
  * 处理子组件派发的 'expire' 事件
497
519
  * 订单倒计时结束后,从列表中删除该订单
498
520
  */
499
- handleOrderExpire(orderId) {
521
+ handleOrderExpire(order) {
500
522
  if (this.isPreview) return;
501
523
  const orderIndex = this.orderList.findIndex(
502
- (item) => item.order_id === orderId
524
+ (item) => item.order_id === order.order_id
503
525
  );
504
526
  if (orderIndex === -1) return;
505
-
527
+ if (order.user_quotation_status === "quoted") {
528
+ this.handleRefresh();
529
+ return;
530
+ }
506
531
  // 从列表中删除该订单
507
532
  this.orderList.splice(orderIndex, 1);
508
533
  },
@@ -574,7 +599,7 @@ export default {
574
599
  vm: this,
575
600
  data: {
576
601
  order_type: this.order_type,
577
- max_id: this.max_id || 0,
602
+ max_id: this.max_id,
578
603
  },
579
604
  })
580
605
  .then((res) => {
@@ -608,7 +633,9 @@ export default {
608
633
  });
609
634
  }
610
635
  }
611
- this.max_id = res.new_order_max_id;
636
+ if (res.new_order_max_id > this.max_id) {
637
+ this.max_id = res.new_order_max_id;
638
+ }
612
639
  this.showNew = res.is_exist_new_order;
613
640
  })
614
641
  .catch((err) => {
@@ -82,7 +82,7 @@ export default {
82
82
  isPreview: false,
83
83
  isOpenNew: "N",
84
84
  isOpenWin: "N",
85
- max_id: null,
85
+ max_id: 0,
86
86
  };
87
87
  },
88
88
  watch: {
@@ -185,13 +185,17 @@ export default {
185
185
  * 处理子组件派发的 'expire' 事件
186
186
  * 订单倒计时结束后,从列表中删除该订单
187
187
  */
188
- handleOrderExpire(orderId) {
188
+ handleOrderExpire(order) {
189
189
  if (this.isPreview) return;
190
190
  const orderIndex = this.orderList.findIndex(
191
- (item) => item.order_id === orderId || item.id === orderId
191
+ (item) => item.order_id === order.order_id
192
192
  );
193
193
  if (orderIndex === -1) return;
194
-
194
+ //如果用户状态为已报价,倒计时结束后则刷新列表,并return
195
+ if (order.user_quotation_status === "quoted") {
196
+ this.handleRefresh();
197
+ return;
198
+ }
195
199
  // 从列表中删除该订单
196
200
  this.orderList.splice(orderIndex, 1);
197
201
  },
@@ -215,28 +219,42 @@ export default {
215
219
  vm: this,
216
220
  data: {
217
221
  order_type: this.order_type,
218
- max_id: this.max_id || 0,
222
+ max_id: this.max_id,
219
223
  },
220
224
  }).then((res) => {
221
225
  if (res.is_exist_new_order && res.is_exist_win_order) {
222
226
  if (this.isOpenNew === "Y") {
223
- this.voiceAlert({ type: "new",filePath: 'https://img.jufubao.cn/takeorder/new_order.mp3' });
227
+ this.voiceAlert({
228
+ type: "new",
229
+ filePath: "https://img.jufubao.cn/takeorder/new_order.mp3",
230
+ });
224
231
  }
225
232
  if (this.isOpenWin === "Y") {
226
233
  setTimeout(() => {
227
- this.voiceAlert({ type: "win",filePath: 'https://img.jufubao.cn/takeorder/wait_order.mp3' });
234
+ this.voiceAlert({
235
+ type: "win",
236
+ filePath: "https://img.jufubao.cn/takeorder/wait_order.mp3",
237
+ });
228
238
  }, 1000);
229
239
  }
230
240
  } else if (res.is_exist_new_order) {
231
241
  if (this.isOpenNew === "Y") {
232
- this.voiceAlert({ type: "new",filePath: 'https://img.jufubao.cn/takeorder/new_order.mp3' });
242
+ this.voiceAlert({
243
+ type: "new",
244
+ filePath: "https://img.jufubao.cn/takeorder/new_order.mp3",
245
+ });
233
246
  }
234
247
  } else if (res.is_exist_win_order) {
235
248
  if (this.isOpenWin === "Y") {
236
- this.voiceAlert({ type: "win",filePath: 'https://img.jufubao.cn/takeorder/wait_order.mp3' });
249
+ this.voiceAlert({
250
+ type: "win",
251
+ filePath: "https://img.jufubao.cn/takeorder/wait_order.mp3",
252
+ });
237
253
  }
238
254
  }
239
- this.max_id = res.new_order_max_id;
255
+ if (res.new_order_max_id > this.max_id) {
256
+ this.max_id = res.new_order_max_id;
257
+ }
240
258
  this.showNew = res.is_exist_new_order;
241
259
  });
242
260
  },
@@ -270,7 +288,7 @@ export default {
270
288
  }
271
289
  },
272
290
  onJfbShow(options) {
273
- this.onJfbLoad(options);
291
+ this.onJfbLoad(options);
274
292
  },
275
293
  onJfbHide(options) {
276
294
  // 页面隐藏时暂停轮询