jufubao-takeorder 1.0.2-beta3 → 1.0.2-beta5

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.
Files changed (31) hide show
  1. package/package.json +1 -1
  2. package/src/components/JfbTakeorderFilterOrderList/Api.js +16 -31
  3. package/src/components/JfbTakeorderFilterOrderList/Attr.js +9 -41
  4. package/src/components/JfbTakeorderFilterOrderList/JfbTakeorderFilterOrderList.vue +319 -79
  5. package/src/components/JfbTakeorderFilterOrderList/Mock.js +1 -1
  6. package/src/components/JfbTakeorderFilterOrderList/cusAttr/advanced.js +26 -0
  7. package/src/components/JfbTakeorderFilterOrderList/cusAttr/content.js +9 -0
  8. package/src/components/JfbTakeorderFilterOrderList/cusAttr/style.js +11 -0
  9. package/src/components/JfbTakeorderIndex/Api.js +47 -1
  10. package/src/components/JfbTakeorderIndex/JfbTakeorderIndex.vue +218 -129
  11. package/src/components/JfbTakeorderIndex/Mock.js +4 -4
  12. package/src/components/JfbTakeorderIndex/components/cityPicker.vue +29 -21
  13. package/src/components/JfbTakeorderOrderDetail/Api.js +91 -24
  14. package/src/components/JfbTakeorderOrderDetail/Attr.js +9 -41
  15. package/src/components/JfbTakeorderOrderDetail/JfbTakeorderOrderDetail.vue +1174 -77
  16. package/src/components/JfbTakeorderOrderDetail/Mock.js +9 -9
  17. package/src/components/JfbTakeorderOrderDetail/components/CusEditQuote.vue +150 -0
  18. package/src/components/JfbTakeorderOrderDetail/components/products.vue +141 -0
  19. package/src/components/JfbTakeorderOrderDetail/cusAttr/advanced.js +12 -0
  20. package/src/components/JfbTakeorderOrderDetail/cusAttr/content.js +233 -0
  21. package/src/components/JfbTakeorderOrderDetail/cusAttr/style.js +11 -0
  22. package/src/components/JfbTakeorderOrderList/Api.js +16 -31
  23. package/src/components/JfbTakeorderOrderList/JfbTakeorderOrderList.vue +259 -122
  24. package/src/components/JfbTakeorderOrderList/Mock.js +1 -1
  25. package/src/components/JfbTakeorderOrderList/cusAttr/content.js +14 -0
  26. package/src/components/JfbTakeorderVoiceSwitch/Api.js +14 -33
  27. package/src/components/JfbTakeorderVoiceSwitch/Attr.js +1 -37
  28. package/src/components/JfbTakeorderVoiceSwitch/JfbTakeorderVoiceSwitch.vue +159 -81
  29. package/src/components/JfbTakeorderVoiceSwitch/Mock.js +2 -10
  30. package/src/components/JfbTakeorderIndex/components/order.vue +0 -273
  31. package/src/components/JfbTakeorderOrderList/components/order.vue +0 -273
@@ -2,112 +2,1209 @@
2
2
  <view
3
3
  class="jfb-takeorder-order-detail"
4
4
  @click="handleEditxSelect"
5
- :class="{ editx : isEditx && active }"
5
+ :class="{ editx: isEditx && active }"
6
6
  >
7
7
  <!--#ifdef H5-->
8
8
  <view
9
9
  class="jfb-takeorder-order-detail__edit"
10
- :class="{ editx : isEditx && active }"
10
+ :class="{ editx: isEditx && active }"
11
11
  v-if="isEditx && active"
12
12
  >
13
13
  <view class="jfb-takeorder-order-detail__edit-icon" @click.stop="delEdit">
14
- <xd-font-icon icon="iconshanchu-01" color="#fff" size="30"></xd-font-icon>
14
+ <xd-font-icon
15
+ icon="iconshanchu-01"
16
+ color="#fff"
17
+ size="30"
18
+ ></xd-font-icon>
15
19
  </view>
16
20
  </view>
17
21
  <!-- #endif -->
18
- <view class="jfb-takeorder-order-detail__body">
19
- <view>测试插件( {{containerId}} )</view>
22
+ <!-- 待上报状态倒计时横幅 -->
23
+ <view
24
+ class="jfb-takeorder-order-detail__body"
25
+ :style="{ minHeight: layoutInfo.bodyMinHeight }"
26
+ v-if="info"
27
+ >
28
+ <view
29
+ v-if="
30
+ (info.user_quotation_status === 'received' ||
31
+ info.user_quotation_status === 'win_order') &&
32
+ info.order_status !== 'close'
33
+ "
34
+ class="jfb-takeorder-order-detail__countdown-banner"
35
+ :style="{ backgroundColor: mainColor }"
36
+ >
37
+ <xd-font-icon
38
+ style="margin-right: 10rpx"
39
+ icon="iconshijian-01"
40
+ color="#fff"
41
+ size="36"
42
+ ></xd-font-icon>
43
+ <view
44
+ v-if="info.user_quotation_status === 'received'"
45
+ class="jfb-takeorder-order-detail__countdown-text"
46
+ >
47
+ 订单剩余完成时间: {{ formatCountdownTime(reportCountdownSeconds) }}
48
+ </view>
49
+ <view
50
+ v-if="info.user_quotation_status === 'win_order'"
51
+ class="jfb-takeorder-order-detail__countdown-text"
52
+ >
53
+ 订单剩余完成时间: {{ formatCountdownTime(receiveCountdownSeconds) }}
54
+ </view>
55
+ </view>
56
+ <Products :info="info"></Products>
57
+ <view
58
+ v-if="
59
+ info.user_quotation_status === 'wait_quote' ||
60
+ info.user_quotation_status === 'quoted' ||
61
+ info.order_status === 'close' ||
62
+ info.user_quotation_status === 'cancel_quotation'
63
+ "
64
+ class="wrap"
65
+ >
66
+ <view
67
+ class="other-info-item"
68
+ v-if="
69
+ step === 1 ||
70
+ info.user_quotation_status === 'quoted' ||
71
+ info.order_status === 'close'
72
+ "
73
+ >
74
+ <view>市场原价(仅供参考)</view>
75
+ <view :style="{ color: mainColor }"
76
+ ><text>¥ </text
77
+ >{{
78
+ $xdUniHelper.divisionFloatNumber(info.market_amount, 100)
79
+ }}</view
80
+ >
81
+ </view>
82
+ <view class="other-info-item">
83
+ <view>商品总数</view>
84
+ <view style="display: flex; align-items: center"
85
+ ><xd-font-icon size="28" icon="iconguanbi"></xd-font-icon
86
+ >{{ info.product_total }}</view
87
+ >
88
+ </view>
89
+ <view
90
+ class="other-info-item"
91
+ v-if="
92
+ step === 1 ||
93
+ info.user_quotation_status === 'quoted' ||
94
+ info.order_status === 'close'
95
+ "
96
+ >
97
+ <view>报价人数</view>
98
+ <view>{{ info.quotation_person_count }}人</view>
99
+ </view>
100
+ <view
101
+ class="other-info-item"
102
+ v-if="
103
+ step === 1 ||
104
+ info.user_quotation_status === 'quoted' ||
105
+ info.order_status === 'close'
106
+ "
107
+ >
108
+ <view>报价倒计时</view>
109
+ <view :style="{ color: mainColor }">{{
110
+ !isCountdownEnd ? formatTime(info.rest_quotation_time) : "报价结束"
111
+ }}</view>
112
+ </view>
113
+ <view class="other-info-item" v-if="step === 2">
114
+ <view>您的报价</view>
115
+ <view :style="{ color: mainColor }"
116
+ ><text>¥ </text>{{ quotePrice }}</view
117
+ >
118
+ </view>
119
+ <view class="other-info-item" v-if="step === 2">
120
+ <view>预计结算</view>
121
+ <view :style="{ color: mainColor }"
122
+ ><text>¥ </text>{{ quotePriceTotal }}</view
123
+ >
124
+ </view>
125
+ </view>
126
+ <view v-else class="wrap">
127
+ <view class="other-info-item">
128
+ <view>订单编号</view>
129
+ <view>{{ info.order_id }}</view>
130
+ </view>
131
+ <view class="other-info-item">
132
+ <view>商品总数</view>
133
+ <view style="display: flex; align-items: center"
134
+ ><xd-font-icon size="28" icon="iconguanbi"></xd-font-icon
135
+ >{{ info.product_total }}</view
136
+ >
137
+ </view>
138
+ <view class="other-info-item">
139
+ <view>订购电话</view>
140
+ <view>{{ info.buyer_phone_number }}</view>
141
+ </view>
142
+ <view class="other-info-item">
143
+ <view>订单结算价</view>
144
+ <view :style="{ color: mainColor }"
145
+ ><text>¥ </text>
146
+ {{
147
+ $xdUniHelper.divisionFloatNumber(
148
+ info.receive_user_settle_amount,
149
+ 100
150
+ )
151
+ }}</view
152
+ >
153
+ </view>
154
+ </view>
155
+ <view
156
+ class="wrap"
157
+ v-if="
158
+ (info.user_quotation_status === 'cancel_quotation' ||
159
+ info.user_quotation_status === 'wait_quote' ||
160
+ info.user_quotation_status === 'quoted') &&
161
+ step !== 2 &&
162
+ info.order_status !== 'reported' &&
163
+ info.order_status !== 'close'
164
+ "
165
+ >
166
+ <view class="quote-title">订单报价</view>
167
+ <view class="quote-input">
168
+ <view class="quote-input-unit">¥</view>
169
+ <input
170
+ :disabled="quoteDisabled"
171
+ v-model="quotePrice"
172
+ placeholder="请输入单张报价金额"
173
+ />
174
+ </view>
175
+ <view class="quote-advice"
176
+ >建议报价:<text :style="{ color: mainColor }"
177
+ >¥{{
178
+ $xdUniHelper.divisionFloatNumber(info.suggest_min_quotation, 100)
179
+ }}~ ¥{{
180
+ $xdUniHelper.divisionFloatNumber(info.suggest_max_quotation, 100)
181
+ }}</text
182
+ ></view
183
+ >
184
+ </view>
185
+ <view
186
+ class="wrap upload"
187
+ v-if="
188
+ info.user_quotation_status === 'received' &&
189
+ info.order_status !== 'close'
190
+ "
191
+ >
192
+ <view class="voucher" v-if="voucherImages && voucherImages.length > 0">
193
+ <view
194
+ class="voucher-item"
195
+ v-for="(item, index) in voucherImages"
196
+ :key="index"
197
+ >
198
+ <view class="voucher-item-image">
199
+ <image :src="item.report_voucher" />
200
+ <view>凭证图</view>
201
+ </view>
202
+ <view>
203
+ <view
204
+ class="voucher-item-info"
205
+ v-for="(code, index) in item.code_list"
206
+ :key="index"
207
+ >
208
+ <view
209
+ v-if="code.show_type === 'text'"
210
+ class="voucher-item-info-number"
211
+ >
212
+ <text class="voucher-item-info-label">凭证号</text>
213
+ <view>{{ code.code }}</view>
214
+ </view>
215
+ <view
216
+ v-if="code.show_type === 'qrcode'"
217
+ class="voucher-item-info-qrcode"
218
+ >
219
+ <text class="voucher-item-info-label">二维码</text>
220
+ <image :src="code.code_preview_url"></image>
221
+ </view>
222
+ </view>
223
+ </view>
224
+ </view>
225
+ </view>
226
+ <view style="display: flex; justify-content: center">
227
+ <xd-upload
228
+ @on-done="handleUploadDone"
229
+ selectType="image"
230
+ :selectSource="['album']"
231
+ ossType="private"
232
+ borderWidth="2rpx"
233
+ borderRadius="4rpx"
234
+ :backgroundColor="uploadBackground"
235
+ :borderColor="mainColor"
236
+ borderStyle="solid"
237
+ width="654"
238
+ height="88"
239
+ >
240
+ <view :style="{ color: mainColor, fontSize: '28rpx' }"
241
+ >上传凭证</view
242
+ >
243
+ </xd-upload>
244
+ </view>
245
+ <view class="upload-notice">
246
+ <text>请务必按真实报单并仔细校对取餐码正确无误,</text>
247
+ <text :style="{ color: mainColor }"
248
+ >取餐码错误或未上报真实取餐码造成客诉产生损失将由您承担!</text
249
+ >
250
+ </view>
251
+ </view>
252
+ <view
253
+ v-if="
254
+ (info.order_status === 'close' || info.order_status === 'quoting') &&
255
+ notice &&
256
+ info.user_quotation_status !== 'received'
257
+ "
258
+ class="special-tip wrap"
259
+ style="padding: 24rpx 32rpx"
260
+ >
261
+ <view>特别提示</view>
262
+ <XdContentXss
263
+ v-if="
264
+ (info.user_quotation_status === 'wait_quote' && step !== 2) ||
265
+ info.user_quotation_status === 'quoted'
266
+ "
267
+ :html="notice"
268
+ ></XdContentXss>
269
+ <view v-else :style="{ color: mainColor }"
270
+ >因各平台市场价有出入,建议报价前自主核实价格,避免因价格出入问题弃单导致的纠纷!</view
271
+ >
272
+ </view>
273
+ <view v-if="!isCountdownEnd" :style="{ height: '100rpx' }"></view>
274
+ <view
275
+ :key="info.user_quotation_status"
276
+ v-if="info.order_status !== 'close' && info.order_status !== 'reported'"
277
+ class="fixe_bottom"
278
+ :style="prod_bottom"
279
+ >
280
+ <XdButton
281
+ v-if="
282
+ step === 1 &&
283
+ (info.user_quotation_status === 'wait_quote' ||
284
+ info.user_quotation_status === 'cancel_quotation')
285
+ "
286
+ width="680rpx"
287
+ @click="toConfirmQuote"
288
+ size="small"
289
+ type="primary"
290
+ >确认报价</XdButton
291
+ >
292
+ <XdButton
293
+ v-if="
294
+ step === 2 &&
295
+ (info.user_quotation_status === 'wait_quote' ||
296
+ info.user_quotation_status === 'cancel_quotation')
297
+ "
298
+ width="320rpx"
299
+ @click="step = 1"
300
+ size="small"
301
+ :cusStyle="[btnStyle]"
302
+ >再想想</XdButton
303
+ >
304
+ <XdButton
305
+ v-if="
306
+ step === 2 &&
307
+ (info.user_quotation_status === 'wait_quote' ||
308
+ info.user_quotation_status === 'cancel_quotation')
309
+ "
310
+ width="320rpx"
311
+ @click="handleSubmitQuote"
312
+ size="small"
313
+ type="primary"
314
+ >提交报价</XdButton
315
+ >
316
+ <XdButton
317
+ v-if="info.user_quotation_status === 'quoted'"
318
+ width="320rpx"
319
+ @click="showCancelDialog = true"
320
+ size="small"
321
+ :cusStyle="[btnStyle]"
322
+ >取消报价</XdButton
323
+ >
324
+ <XdButton
325
+ v-if="info.user_quotation_status === 'quoted'"
326
+ width="320rpx"
327
+ @click="showEditQuoteDialog = true"
328
+ size="small"
329
+ type="primary"
330
+ >修改报价</XdButton
331
+ >
332
+ <XdButton
333
+ v-if="
334
+ info.user_quotation_status === 'received' ||
335
+ info.user_quotation_status === 'win_order'
336
+ "
337
+ width="320rpx"
338
+ @click="showDiscardDialog = true"
339
+ size="small"
340
+ :cusStyle="[btnStyle]"
341
+ >放弃订单</XdButton
342
+ >
343
+ <XdButton
344
+ v-if="info.user_quotation_status === 'received'"
345
+ width="320rpx"
346
+ size="small"
347
+ type="primary"
348
+ @click="handleReportOrder"
349
+ >上报订单</XdButton
350
+ >
351
+ <XdButton
352
+ v-if="info.user_quotation_status === 'win_order'"
353
+ width="320rpx"
354
+ @click="handleAcceptOrder"
355
+ size="small"
356
+ type="primary"
357
+ >接单</XdButton
358
+ >
359
+ </view>
360
+ <XdDailog width="70%" :showClose="false" :show.sync="showMsgDialog">
361
+ <template slot="title">
362
+ <view class="dialog-title">{{ msgTitle }}</view>
363
+ </template>
364
+ <view style="font-size: 28rpx">{{ msg }}</view>
365
+ <template slot="btn">
366
+ <XdButton
367
+ width="180rpx"
368
+ size="small"
369
+ type="primary"
370
+ @click="showMsgDialog = false"
371
+ >确定</XdButton
372
+ >
373
+ </template>
374
+ </XdDailog>
375
+ <XdDailog width="70%" :showClose="false" :show.sync="showCancelDialog">
376
+ <template slot="title">
377
+ <view class="dialog-title">提示</view>
378
+ </template>
379
+ <view style="font-size: 28rpx">是否确认取消报价</view>
380
+ <template slot="btn">
381
+ <XdButton
382
+ width="180rpx"
383
+ size="small"
384
+ bgColor="#EEE"
385
+ color="#999"
386
+ type="primary"
387
+ @click="showCancelDialog = false"
388
+ >取消</XdButton
389
+ >
390
+ <XdButton
391
+ width="180rpx"
392
+ size="small"
393
+ type="primary"
394
+ @click="handleCancelQuote"
395
+ >确定</XdButton
396
+ >
397
+ </template>
398
+ </XdDailog>
399
+ <XdDailog width="70%" :showClose="false" :show.sync="showDiscardDialog">
400
+ <template slot="title">
401
+ <view class="dialog-title">提示</view>
402
+ </template>
403
+ <view style="font-size: 28rpx">是否确认放弃订单</view>
404
+ <template slot="btn">
405
+ <XdButton
406
+ width="180rpx"
407
+ size="small"
408
+ bgColor="#EEE"
409
+ color="#999"
410
+ type="primary"
411
+ @click="showDiscardDialog = false"
412
+ >取消</XdButton
413
+ >
414
+ <XdButton
415
+ width="180rpx"
416
+ size="small"
417
+ type="primary"
418
+ @click="handleDiscardOrder"
419
+ >确定</XdButton
420
+ >
421
+ </template>
422
+ </XdDailog>
423
+ <CusEditQuote
424
+ v-if="showEditQuoteDialog"
425
+ :mainColor="mainColor"
426
+ :info="info"
427
+ @close="showEditQuoteDialog = false"
428
+ @confirm="handleConfirmEditQuote"
429
+ ></CusEditQuote>
20
430
  </view>
21
431
  </view>
22
432
  </template>
23
433
 
24
434
  <script>
25
- import XdFontIcon from "@/components/XdFontIcon/XdFontIcon";
26
- import { jfbRootExec } from "@/utils/xd.event";
27
- import JfbTakeorderOrderDetailMixin from "./JfbTakeorderOrderDetailMixin";
28
- import { getContainerPropsValue } from "@/utils/xd.base";
29
- import componentsMixins from "@/mixins/componentsMixins";
30
- import extsMixins from "@/mixins/extsMixins";
31
- export default {
32
- name: "JfbTakeorderOrderDetail",
33
- components: {
34
- XdFontIcon
35
- },
36
- mixins: [
37
- componentsMixins, extsMixins, JfbTakeorderOrderDetailMixin
38
- ],
39
- data() {
435
+ import XdFontIcon from "@/components/XdFontIcon/XdFontIcon";
436
+ import XdContentXss from "@/components/XdContentXss/XdContentXss";
437
+ import XdDailog from "@/components/XdDailog/XdDailog";
438
+ import XdButton from "@/components/XdButton/XdButton";
439
+ import XdUpload from "@/components/XdUpload/XdUpload";
440
+ import Products from "./components/products.vue";
441
+ import CusEditQuote from "./components/CusEditQuote.vue";
442
+ import { jfbRootExec } from "@/utils/xd.event";
443
+ import JfbTakeorderOrderDetailMixin from "./JfbTakeorderOrderDetailMixin";
444
+ import { getContainerPropsValue } from "@/utils/xd.base";
445
+ import getServiceUrl from "@/common/getServiceUrl";
446
+ import componentsMixins from "@/mixins/componentsMixins";
447
+ import extsMixins from "@/mixins/extsMixins";
448
+ const Color = require("color");
449
+ import { mapState } from "vuex";
450
+ export default {
451
+ name: "JfbTakeorderOrderDetail",
452
+ components: {
453
+ XdFontIcon,
454
+ XdContentXss,
455
+ XdDailog,
456
+ XdButton,
457
+ Products,
458
+ CusEditQuote,
459
+ XdUpload,
460
+ },
461
+ mixins: [componentsMixins, extsMixins, JfbTakeorderOrderDetailMixin],
462
+ data() {
463
+ return {
464
+ info: null,
465
+ notice: "",
466
+ // 报价倒计时是否结束
467
+ isCountdownEnd: false,
468
+ // 报价倒计时定时器标识(用于清除定时器)
469
+ countdownTimer: null,
470
+ // 接单倒计时是否结束
471
+ isReceiveCountdownEnd: false,
472
+ // 接单倒计时定时器标识
473
+ receiveCountdownTimer: null,
474
+ // 接单倒计时剩余秒数(3分钟 = 180秒)
475
+ receiveCountdownSeconds: 180,
476
+ // 上报倒计时是否结束
477
+ isReportCountdownEnd: false,
478
+ // 上报倒计时定时器标识
479
+ reportCountdownTimer: null,
480
+ // 上报倒计时剩余秒数(10分钟 = 600秒)
481
+ reportCountdownSeconds: 600,
482
+ quotePrice: "",
483
+ closeMask: true,
484
+ showConfirmDialog: false,
485
+ quoteDisabled: false,
486
+ showMsgDialog: false,
487
+ step: 1,
488
+ showCancelDialog: false,
489
+ msg: "",
490
+ msgTitle: "",
491
+ showEditQuoteDialog: false,
492
+ status: "daishangbao",
493
+ uploadBackground: "",
494
+ order_id: "",
495
+ showDiscardDialog: false,
496
+ // 上传的凭证图片列表
497
+ voucherImages: [],
498
+ };
499
+ },
500
+ computed: {
501
+ ...mapState(["brandInfo"]),
502
+ prod_bottom() {
503
+ return this.fixedStyle({ height: 0, zIndex: 111 });
504
+ },
505
+ btnStyle() {
40
506
  return {
41
-
42
- //todo
43
- }
507
+ color: this.mainColor,
508
+ border: `1px solid ${this.mainColor}`,
509
+ };
44
510
  },
45
- watch: {
46
- container(value, oldValue) {
47
- if (JSON.stringify(value) === JSON.stringify(oldValue)) return;
48
- if (this.$configProject['isPreview']) this.init(value)
49
- },
511
+ quotePriceTotal() {
512
+ return this.quotePrice * this.info.product_total;
50
513
  },
51
- created() {
52
- this.init(this.container);
53
-
54
- //todo
514
+ },
515
+ watch: {
516
+ container(value, oldValue) {
517
+ if (JSON.stringify(value) === JSON.stringify(oldValue)) return;
518
+ if (this.$configProject["isPreview"]) this.init(value);
55
519
  },
56
- methods: {
57
- onJfbLoad(options) {
520
+ },
521
+ created() {
522
+ this.init(this.container);
58
523
 
59
- // jfbRootExec('baiduUserLogin', {
60
-
61
- // vm: this,// data: {
524
+ //todo
525
+ },
526
+ methods: {
527
+ onJfbLoad(options) {
528
+ this.order_id = options.order_id;
529
+ this.getOrderDetail();
530
+ this.getContent();
531
+ },
532
+ getContent() {
533
+ jfbRootExec("getListOrderNewsContent", {
534
+ vm: this,
535
+ data: {
536
+ page_id: this.pageAttr["page_id"], //页面ID
537
+ container_id: this.containerId, //组件ID
538
+ limit: 1,
539
+ },
540
+ })
541
+ .then((res) => {
542
+ if (res.list.length > 0) {
543
+ if (res.list && res.list.length > 0) {
544
+ this.notice = this.$xdUniHelper.filterHtml(res.list[0].content);
545
+ }
546
+ }
547
+ })
548
+ .catch((error) => {
549
+ this.$xdLog.catch(err);
550
+ });
551
+ },
552
+ getOrderDetail() {
553
+ jfbRootExec("getTakeorderOrderDetail", {
554
+ vm: this,
555
+ data: {
556
+ order_id: this.order_id,
557
+ },
558
+ })
559
+ .then((res) => {
560
+ this.info = res;
561
+ if (this.info.user_quotation_status === "quoted") {
562
+ this.quotePrice = this.$xdUniHelper.divisionFloatNumber(
563
+ this.info.user_quotation,
564
+ 100
565
+ );
566
+ this.quoteDisabled = true;
567
+ }
568
+ if (
569
+ (this.info.user_quotation_status === "cancel_quotation" ||
570
+ this.info.user_quotation_status === "wait_quote" ||
571
+ this.info.user_quotation_status === "quoted") &&
572
+ this.info.order_status !== "reported" &&
573
+ this.info.order_status !== "close"
574
+ ) {
575
+ this.startCountdown();
576
+ }
577
+ if (this.info.user_quotation_status === "win_order") {
578
+ //如果中标,则显示接单按钮,并开启三分钟接单倒计时
579
+ this.startReceiveCountdown();
580
+ }
581
+ if (this.info.user_quotation_status === "received") {
582
+ //如果已接单,开启十分钟上报订单倒计时
583
+ this.startReportCountdown();
584
+ }
585
+ if (this.info.order_status === "close") {
586
+ //如果订单已关闭,则隐藏所有按钮,并且清除倒计时
587
+ this.isCountdownEnd = true;
588
+ this.clearReceiveCountdown();
589
+ this.clearReportCountdown();
590
+ }
591
+ })
592
+ .catch((error) => {
593
+ this.$xdLog.catch(err);
594
+ });
595
+ },
596
+ /**
597
+ * @description 监听事件变化
598
+ * @param container {object} 业务组件对象自己
599
+ */
600
+ init(container) {
601
+ this.uploadBackground = Color(this.mainColor).alpha(0.15).toString();
602
+ //this.bgcolor = getContainerPropsValue(container, 'content.bgcolor', '#fff');
62
603
 
63
- // account: 'gaoshiyong',// password: '123456789',// type: 3,// ...options
604
+ //this.height = getContainerPropsValue(container, 'content.height', 10);
605
+ },
606
+ toConfirmQuote() {
607
+ if (!this.quotePrice) {
608
+ this.$xdAlert({ content: "请输入报价" });
609
+ return;
610
+ }
611
+ // 校验报价范围
612
+ const min = this.$xdUniHelper.divisionFloatNumber(
613
+ this.info.suggest_min_quotation,
614
+ 100
615
+ );
616
+ const max = this.$xdUniHelper.divisionFloatNumber(
617
+ this.info.suggest_max_quotation,
618
+ 100
619
+ );
620
+ const price = parseFloat(this.quotePrice);
621
+ if (price < min || price > max) {
622
+ this.$xdAlert({ content: `报价价格只能在建议报价区间内` });
623
+ return;
624
+ }
625
+ this.step = 2;
626
+ },
627
+ handleSubmitQuote() {
628
+ this.$xdShowLoading({});
629
+ jfbRootExec("createQuotation", {
630
+ vm: this,
631
+ data: {
632
+ order_id: this.order_id,
633
+ amount: this.$xdUniHelper.multiplyFloatNumber(this.quotePrice, 100),
634
+ },
635
+ })
636
+ .then((res) => {
637
+ this.$xdHideLoading();
638
+ this.step = "";
639
+ // 提交创建报价之后重新刷新订单详情
640
+ this.getOrderDetail();
641
+ })
642
+ .catch((error) => {
643
+ this.$xdHideLoading();
644
+ });
645
+ },
646
+ handleCancelQuote() {
647
+ //请求接口,判断是否可以取消报价
648
+ jfbRootExec("cancelQuotation", {
649
+ vm: this,
650
+ data: {
651
+ order_id: this.order_id,
652
+ },
653
+ }).then((res) => {
654
+ this.$xdUniHelper.navigateBack();
655
+ });
656
+ },
657
+ handleConfirmEditQuote(price) {
658
+ jfbRootExec("updateQuotation", {
659
+ vm: this,
660
+ data: {
661
+ order_id: this.order_id,
662
+ amount: this.$xdUniHelper.multiplyFloatNumber(price, 100),
663
+ },
664
+ })
665
+ .then((res) => {
666
+ if (res.msg) {
667
+ this.msg = "报价已结束";
668
+ this.msgTitle = "提示";
669
+ this.showMsgDialog = true;
670
+ }
671
+ this.showEditQuoteDialog = false;
672
+ this.getOrderDetail();
673
+ })
674
+ .catch((error) => {
675
+ this.$xdLog.catch(err);
676
+ });
677
+ },
678
+ startCountdown() {
679
+ // 先清除可能存在的旧定时器,防止重复计时
680
+ this.clearCountdown();
681
+ // 创建每秒执行的定时器
682
+ this.countdownTimer = setInterval(() => {
683
+ if (this.info.rest_quotation_time > 0) {
684
+ // 剩余秒数减1
685
+ this.info.rest_quotation_time--;
686
+ } else {
687
+ // 倒计时结束:清除定时器 + 标记结束状态
688
+ this.clearCountdown();
689
+ if (this.isPreview) return;
690
+ this.getOrderDetail();
691
+ console.log("报价倒计时结束");
692
+ }
693
+ }, 1000);
694
+ },
695
+ /**
696
+ * 格式化秒数为 分:秒 格式(比如 60秒 → 01:00,5秒 → 00:05)
697
+ * @param {Number} seconds 待格式化的秒数
698
+ * @returns {String} 格式化后的时间字符串
699
+ */
700
+ formatTime(seconds) {
701
+ // 计算分钟
702
+ const minutes = Math.floor(seconds / 60);
703
+ // 计算剩余秒数
704
+ const secs = seconds % 60;
705
+ // 补零处理(确保两位数显示)
706
+ const formatMinutes = minutes.toString().padStart(2, "0");
707
+ const formatSecs = secs.toString().padStart(2, "0");
708
+ return `${formatMinutes}:${formatSecs}`;
709
+ },
710
+ /**
711
+ * 格式化秒数为 XX分XX秒 格式(用于待上报状态倒计时显示)
712
+ * @param {Number} seconds 待格式化的秒数
713
+ * @returns {String} 格式化后的时间字符串,如 "02分59秒"
714
+ */
715
+ formatCountdownTime(seconds) {
716
+ // 计算分钟
717
+ const minutes = Math.floor(seconds / 60);
718
+ // 计算剩余秒数
719
+ const secs = seconds % 60;
720
+ // 补零处理(确保两位数显示)
721
+ const formatMinutes = minutes.toString().padStart(2, "0");
722
+ const formatSecs = secs.toString().padStart(2, "0");
723
+ return `${formatMinutes}分${formatSecs}秒`;
724
+ },
725
+ /**
726
+ * 清除报价倒计时定时器
727
+ */
728
+ clearCountdown() {
729
+ if (this.countdownTimer) {
730
+ clearInterval(this.countdownTimer);
731
+ this.countdownTimer = null;
732
+ }
733
+ },
734
+ /**
735
+ * 启动接单倒计时(3分钟)
736
+ */
737
+ startReceiveCountdown() {
738
+ // 先清除可能存在的旧定时器,防止重复计时
739
+ this.clearReceiveCountdown();
740
+ // 初始化倒计时秒数(3分钟 = 180秒)
741
+ this.receiveCountdownSeconds = this.info.rest_receive_time;
742
+ this.isReceiveCountdownEnd = false;
64
743
 
65
- // }
744
+ // 创建每秒执行的定时器
745
+ this.receiveCountdownTimer = setInterval(() => {
746
+ if (this.receiveCountdownSeconds > 0) {
747
+ // 剩余秒数减1
748
+ this.receiveCountdownSeconds--;
749
+ } else {
750
+ // 倒计时结束:清除定时器 + 标记结束状态
751
+ this.clearReceiveCountdown();
752
+ this.isReceiveCountdownEnd = true;
753
+ // 倒计时结束请求详情接口
754
+ this.getOrderDetail();
755
+ console.log("接单倒计时结束");
756
+ }
757
+ }, 1000);
758
+ },
759
+ /**
760
+ * 清除接单倒计时定时器
761
+ */
762
+ clearReceiveCountdown() {
763
+ if (this.receiveCountdownTimer) {
764
+ clearInterval(this.receiveCountdownTimer);
765
+ this.receiveCountdownTimer = null;
766
+ }
767
+ },
768
+ /**
769
+ * 启动上报倒计时(10分钟)
770
+ */
771
+ startReportCountdown() {
772
+ // 先清除可能存在的旧定时器,防止重复计时
773
+ this.clearReportCountdown();
774
+ // 初始化倒计时秒数(10分钟 = 600秒),如果有接口返回的时间则使用接口返回的时间
775
+ this.reportCountdownSeconds = this.info.rest_report_time || 600;
776
+ this.isReportCountdownEnd = false;
66
777
 
67
- // }).then().catch()
68
- },
69
- /**
70
- * @description 监听事件变化
71
- * @param container {object} 业务组件对象自己
72
- */
73
- init(container) {
778
+ // 创建每秒执行的定时器
779
+ this.reportCountdownTimer = setInterval(() => {
780
+ if (this.reportCountdownSeconds > 0) {
781
+ // 剩余秒数减1
782
+ this.reportCountdownSeconds--;
783
+ } else {
784
+ // 倒计时结束:清除定时器 + 标记结束状态
785
+ this.clearReportCountdown();
786
+ this.isReportCountdownEnd = true;
787
+ // 倒计时结束请求详情接口
788
+ this.getOrderDetail();
789
+ console.log("上报倒计时结束");
790
+ }
791
+ }, 1000);
792
+ },
793
+ /**
794
+ * 清除上报倒计时定时器
795
+ */
796
+ clearReportCountdown() {
797
+ if (this.reportCountdownTimer) {
798
+ clearInterval(this.reportCountdownTimer);
799
+ this.reportCountdownTimer = null;
800
+ }
801
+ },
802
+ /**
803
+ * 处理放弃订单
804
+ */
805
+ handleDiscardOrder() {
806
+ this.$xdShowLoading({});
807
+ jfbRootExec("discardOrder", {
808
+ vm: this,
809
+ data: {
810
+ order_id: this.order_id,
811
+ },
812
+ })
813
+ .then((res) => {
814
+ this.$xdHideLoading();
815
+ this.showDiscardDialog = false;
816
+ // 接口成功后重新请求订单详情
817
+ this.getOrderDetail();
818
+ })
819
+ .catch((error) => {
820
+ this.$xdHideLoading();
821
+ this.$xdLog.catch(error);
822
+ });
823
+ },
824
+ /**
825
+ * 处理接受订单
826
+ */
827
+ handleAcceptOrder() {
828
+ this.$xdShowLoading({});
829
+ jfbRootExec("acceptOrder", {
830
+ vm: this,
831
+ data: {
832
+ order_id: this.order_id,
833
+ },
834
+ })
835
+ .then((res) => {
836
+ this.$xdHideLoading();
837
+ // 清除接单倒计时
838
+ this.clearReceiveCountdown();
839
+ // 接口成功后重新请求订单详情
840
+ this.getOrderDetail();
841
+ })
842
+ .catch((error) => {
843
+ this.$xdHideLoading();
844
+ this.$xdLog.catch(error);
845
+ });
846
+ },
847
+ handleUploadDone(files) {
848
+ console.log("event.handleUploadDone", files);
849
+ this.$xdShowLoading({});
850
+ jfbRootExec("imageRecognition", {
851
+ vm: this,
852
+ data: {
853
+ image_url: files[0].url,
854
+ },
855
+ })
856
+ .then((res) => {
857
+ console.log("event.handleUploadDone", res);
858
+ jfbRootExec("getImagePreview", {
859
+ vm: this,
860
+ data: {
861
+ image_url: files[0].url,
862
+ },
863
+ })
864
+ .then((res1) => {
865
+ console.log("event.getImagePreview", res);
866
+ let obj = {
867
+ report_voucher: res1.preview_url,
868
+ code_list: res.list.map((item) => {
869
+ if (item.show_type === "qrcode") {
870
+ let reg = /^(http:\/\/|https:\/\/|\/\/)+.+$/;
871
+ item.code_preview_url = reg.test(item.preview_url)
872
+ ? item.preview_url
873
+ : `${this.brandInfo["api_host"]}${item.preview_url}`;
874
+ } else {
875
+ item.code = item.code;
876
+ }
877
+ return item;
878
+ }),
879
+ };
880
+ this.voucherImages.push(obj);
881
+ this.$xdHideLoading();
882
+ })
883
+ .catch((error) => {
884
+ this.$xdHideLoading();
885
+ this.$xdLog.catch(error);
886
+ });
887
+ })
888
+ .catch((error) => {
889
+ this.$xdHideLoading();
890
+ this.$xdLog.catch(error);
891
+ });
892
+ },
893
+ /**
894
+ * 处理上报订单
895
+ */
896
+ handleReportOrder() {
897
+ // 检查是否上传了凭证
898
+ if (!this.voucherImages || this.voucherImages.length === 0) {
899
+ this.$xdAlert({ content: "请先上传凭证" });
900
+ return;
901
+ }
902
+ this.$xdShowLoading({});
903
+ jfbRootExec("reportOrder", {
904
+ vm: this,
905
+ data: {
906
+ order_id: this.order_id,
907
+ report_voucher_list: this.voucherImages,
908
+ },
909
+ })
910
+ .then((res) => {
911
+ this.$xdHideLoading();
912
+ // 清除上报倒计时
913
+ this.clearReportCountdown();
914
+ // 接口成功后重新请求订单详情
915
+ this.getOrderDetail();
916
+ })
917
+ .catch((error) => {
918
+ this.$xdHideLoading();
919
+ this.$xdLog.catch(error);
920
+ });
921
+ },
922
+ onJfbScroll(options) {
923
+ console.log("event.onJfbScroll", options);
924
+ },
925
+ onJfbReachBottom(options) {
926
+ console.log("event.onJfbReachBottom", options);
927
+ },
928
+ onJfbShow(options) {
929
+ console.log("event.onJfbShow", options);
930
+ },
931
+ onJfbHide(options) {
932
+ console.log("event.onJfbHide", options);
933
+ },
934
+ onJfbBack(options) {
935
+ console.log("event.onJfbBack", options);
936
+ },
937
+ onJfbUpdate(...data) {
938
+ console.log("event.onJfbUpdate", data);
939
+ },
940
+ onJfbCustomEvent(options) {
941
+ console.log("event.onJfbReachBottom", options);
942
+ },
943
+ onJfbUnload() {
944
+ this.clearCountdown();
945
+ this.clearReceiveCountdown();
946
+ this.clearReportCountdown();
947
+ },
948
+ },
949
+ };
950
+ </script>
74
951
 
75
- //this.bgcolor = getContainerPropsValue(container, 'content.bgcolor', '#fff');
952
+ <style scoped lang="less">
953
+ @import "./JfbTakeorderOrderDetailLess.less";
76
954
 
77
- //this.height = getContainerPropsValue(container, 'content.height', 10);
78
- },
79
- onJfbScroll(options) {
80
- console.log('event.onJfbScroll', options)
81
- },
82
- onJfbReachBottom(options) {
83
- console.log('event.onJfbReachBottom', options)
84
- },
85
- onJfbShow(options) {
86
- console.log('event.onJfbShow', options)
87
- },
88
- onJfbHide(options) {
89
- console.log('event.onJfbHide', options)
90
- },
91
- onJfbBack(options) {
92
- console.log('event.onJfbBack', options)
93
- },
94
- onJfbUpdate(...data) {
95
- console.log('event.onJfbUpdate', data)
96
- },
97
- onJfbCustomEvent(options) {
98
- console.log('event.onJfbReachBottom', options)
99
- },
955
+ .jfb-takeorder-order-detail {
956
+ &__countdown-banner {
957
+ display: flex;
958
+ align-items: center;
959
+ padding: 24rpx 32rpx;
960
+ margin: 16rpx 16rpx 0 16rpx;
961
+ border-radius: 16rpx 16rpx 0 0;
962
+ background: #e5010e;
963
+ & > xd-font-icon {
964
+ margin-right: 16rpx;
100
965
  }
101
966
  }
967
+ &__countdown-text {
968
+ color: #fff;
969
+ font-size: 28rpx;
970
+ flex: 1;
971
+ }
972
+ &__body {
973
+ .wrap {
974
+ background: #fff;
975
+ margin: 16rpx;
976
+ border-radius: 16rpx;
977
+ }
978
+ .special-tip {
979
+ padding: 24rpx 32rpx;
980
+ color: #333;
981
+ & > view:first-child {
982
+ font-size: 28rpx;
983
+ color: #333;
984
+ margin-bottom: 20rpx;
985
+ }
986
+ & > view:last-child {
987
+ font-size: 24rpx;
988
+ }
989
+ }
990
+ .order-info {
991
+ &-title {
992
+ display: flex;
993
+ justify-content: space-between;
994
+ padding: 24rpx 32rpx;
995
+ border-bottom: 1px solid #f4f4f4;
996
+ &-left {
997
+ display: flex;
998
+ align-items: center;
999
+ }
1000
+ &-right {
1001
+ font-weight: 500;
1002
+ }
1003
+ }
1004
+ &-product {
1005
+ display: flex;
1006
+ padding: 16rpx 32rpx;
1007
+ border-bottom: 1px solid #f4f4f4;
1008
+ & > image {
1009
+ width: 180rpx;
1010
+ height: 180rpx;
1011
+ flex-shrink: 0;
1012
+ border: 10rpx;
1013
+ }
1014
+ &-info {
1015
+ margin-left: 24rpx;
1016
+ &-name {
1017
+ .uni-max-cut(2,80);
1018
+ margin-bottom: 10rpx;
1019
+ }
1020
+ &-sku {
1021
+ font-size: 24rpx;
1022
+ color: #999;
1023
+ }
1024
+ &-price {
1025
+ margin-top: 10rpx;
1026
+ display: flex;
1027
+ justify-content: space-between;
1028
+ align-items: center;
1029
+ &-left {
1030
+ color: #ff2c18;
1031
+ font-size: 32rpx;
1032
+ font-weight: 500;
1033
+ & > text {
1034
+ font-size: 24rpx;
1035
+ margin-right: 10rpx;
1036
+ }
1037
+ .range {
1038
+ margin: 0 10rpx;
1039
+ }
1040
+ }
1041
+ &-right {
1042
+ color: #999;
1043
+ display: flex;
1044
+ align-items: baseline;
1045
+ & > view {
1046
+ margin-left: 10rpx;
1047
+ }
1048
+ }
1049
+ }
1050
+ }
1051
+ }
1052
+ }
1053
+ .other-info-item {
1054
+ display: flex;
1055
+ justify-content: space-between;
1056
+ padding: 20rpx 32rpx;
1057
+ color: #333;
1058
+ font-size: 28rpx;
1059
+ border-bottom: 2rpx solid #f8f8f8;
1060
+ }
1061
+ .quote {
1062
+ &-title {
1063
+ font-size: 28rpx;
1064
+ color: #333;
1065
+ padding: 24rpx 0 24rpx 32rpx;
1066
+ }
1067
+ &-input {
1068
+ position: relative;
1069
+ padding: 0 32rpx 24rpx 32rpx;
1070
+ &-unit {
1071
+ position: absolute;
1072
+ left: 55rpx;
1073
+ top: 50%;
1074
+ transform: translateY(-80%);
1075
+ font-size: 28rpx;
1076
+ color: #333;
1077
+ font-weight: 700;
1078
+ }
1079
+ & > input {
1080
+ background: #f8f8f8;
1081
+ font-size: 28rpx;
1082
+ padding: 20rpx 46rpx 20rpx 60rpx;
1083
+ border-radius: 16rpx;
1084
+ }
1085
+ }
1086
+ &-advice {
1087
+ font-size: 24rpx;
1088
+ color: #666666;
1089
+ padding: 0 0 24rpx 32rpx;
1090
+ }
1091
+ }
1092
+ .fixe_bottom {
1093
+ display: flex;
1094
+ align-items: center;
1095
+ justify-content: space-around;
1096
+ height: unit(100, rpx);
1097
+ padding: 0 unit(40, rpx);
1098
+ flex-flow: nowrap;
1099
+ background: #fff;
1100
+ box-shadow: 0 0 unit(16, rpx) rgba(0, 0, 0, 0.05);
1101
+ .flex_l {
1102
+ display: flex;
1103
+ align-items: center;
1104
+ font-size: unit(32, rpx);
1105
+ }
102
1106
 
103
- </script>
104
-
105
- <style scoped lang="less">
106
- @import "./JfbTakeorderOrderDetailLess.less";
107
-
108
- .jfb-takeorder-order-detail {
109
- &__body{
1107
+ & > view {
1108
+ flex: 1;
1109
+ padding: 0 unit(15, rpx);
1110
+ }
1111
+ }
1112
+ .dialog-title {
1113
+ color: #666666;
1114
+ font-size: 28rpx;
1115
+ }
1116
+ .confirm-info {
1117
+ display: flex;
1118
+ flex-direction: column;
1119
+ align-items: center;
1120
+ justify-content: center;
1121
+ margin-bottom: 32rpx;
110
1122
 
1123
+ &-item {
1124
+ display: flex;
1125
+ justify-content: center;
1126
+ margin-bottom: 16rpx;
1127
+ font-size: 28rpx;
1128
+ color: #333;
1129
+ &-label {
1130
+ width: 140rpx;
1131
+ flex-shrink: 0;
1132
+ }
1133
+ &-value {
1134
+ margin-left: 48rpx;
1135
+ width: 120rpx;
1136
+ flex: 1;
1137
+ flex-wrap: wrap;
1138
+ display: flex;
1139
+ justify-content: flex-start;
1140
+ }
1141
+ }
1142
+ }
1143
+ .upload-title {
1144
+ border-radius: 4rpx;
1145
+ background: #e5010e;
1146
+ border: 1px solid #e5010e;
1147
+ padding: 24rpx 0;
1148
+ text-align: center;
1149
+ }
1150
+ .upload {
1151
+ padding: 24rpx 32rpx;
1152
+ }
1153
+ .upload-notice {
1154
+ color: #999999;
1155
+ font-size: 24rpx;
1156
+ margin-top: 24rpx;
1157
+ }
1158
+ .voucher {
1159
+ &-item {
1160
+ display: flex;
1161
+ margin-bottom: 26rpx;
1162
+ &-image {
1163
+ flex-shrink: 0;
1164
+ display: flex;
1165
+ flex-direction: column;
1166
+ align-items: center;
1167
+ justify-content: center;
1168
+ & > image {
1169
+ width: 180rpx;
1170
+ height: 180rpx;
1171
+ border-radius: 4rpx;
1172
+ }
1173
+ & > view {
1174
+ color: #666;
1175
+ font-size: 24rpx;
1176
+ }
1177
+ }
1178
+ &-info {
1179
+ &-label {
1180
+ color: #666;
1181
+ font-size: 24rpx;
1182
+ margin-left: 24rpx;
1183
+ }
1184
+ &-number {
1185
+ display: flex;
1186
+ align-items: center;
1187
+ margin-bottom: 24rpx;
1188
+ & > view {
1189
+ font-size: 28rpx;
1190
+ color: #999;
1191
+ background: #f8f8f8;
1192
+ padding: 20rpx;
1193
+ border-radius: 16rpx;
1194
+ }
1195
+ }
1196
+ &-qrcode {
1197
+ display: flex;
1198
+ align-items: flex-start;
1199
+ & > image {
1200
+ width: 120rpx;
1201
+ height: 120rpx;
1202
+ border-radius: 4rpx;
1203
+ }
1204
+ }
1205
+ }
1206
+ }
111
1207
  }
112
1208
  }
1209
+ }
113
1210
  </style>