jufubao-takeorder 1.0.2-beta2 → 1.0.2-beta4

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 (55) hide show
  1. package/package.json +1 -1
  2. package/src/components/{JfbTakeorderQuotedDetail → JfbTakeorderFilterOrderList}/Api.js +9 -9
  3. package/src/components/JfbTakeorderFilterOrderList/Attr.js +12 -0
  4. package/src/components/JfbTakeorderFilterOrderList/JfbTakeorderFilterOrderList.vue +210 -0
  5. package/src/components/{JfbTakeorderUnquotedDetail/JfbTakeorderUnquotedDetailLess.less → JfbTakeorderFilterOrderList/JfbTakeorderFilterOrderListLess.less} +2 -2
  6. package/src/components/{JfbTakeorderUnquotedDetail/JfbTakeorderUnquotedDetailMixin.js → JfbTakeorderFilterOrderList/JfbTakeorderFilterOrderListMixin.js} +1 -1
  7. package/src/components/JfbTakeorderFilterOrderList/Mock.js +13 -0
  8. package/src/components/JfbTakeorderFilterOrderList/components/order.vue +277 -0
  9. package/src/components/JfbTakeorderIndex/Api.js +9 -41
  10. package/src/components/JfbTakeorderIndex/Attr.js +9 -41
  11. package/src/components/JfbTakeorderIndex/JfbTakeorderIndex.vue +681 -85
  12. package/src/components/JfbTakeorderIndex/components/cityPicker.vue +299 -0
  13. package/src/components/JfbTakeorderIndex/components/order.vue +273 -0
  14. package/src/components/JfbTakeorderIndex/cusAttr/advanced.js +26 -0
  15. package/src/components/JfbTakeorderIndex/cusAttr/content.js +9 -0
  16. package/src/components/JfbTakeorderIndex/cusAttr/style.js +11 -0
  17. package/src/components/JfbTakeorderOrderDetail/Api.js +23 -0
  18. package/src/components/JfbTakeorderOrderDetail/Attr.js +16 -0
  19. package/src/components/JfbTakeorderOrderDetail/JfbTakeorderOrderDetail.vue +845 -0
  20. package/src/components/{JfbTakeorderUnquotedList/JfbTakeorderUnquotedListLess.less → JfbTakeorderOrderDetail/JfbTakeorderOrderDetailLess.less} +2 -2
  21. package/src/components/{JfbTakeorderQuotedDetail/JfbTakeorderQuotedDetailMixin.js → JfbTakeorderOrderDetail/JfbTakeorderOrderDetailMixin.js} +1 -1
  22. package/src/components/JfbTakeorderOrderDetail/Mock.js +13 -0
  23. package/src/components/JfbTakeorderOrderDetail/components/CusEditQuote.vue +161 -0
  24. package/src/components/JfbTakeorderOrderDetail/components/products.vue +138 -0
  25. package/src/components/JfbTakeorderOrderDetail/cusAttr/advanced.js +12 -0
  26. package/src/components/JfbTakeorderOrderDetail/cusAttr/content.js +233 -0
  27. package/src/components/JfbTakeorderOrderDetail/cusAttr/style.js +11 -0
  28. package/src/components/{JfbTakeorderQuotedList → JfbTakeorderOrderList}/Api.js +9 -9
  29. package/src/components/JfbTakeorderOrderList/Attr.js +16 -0
  30. package/src/components/JfbTakeorderOrderList/JfbTakeorderOrderList.vue +169 -0
  31. package/src/components/{JfbTakeorderQuotedList/JfbTakeorderQuotedListLess.less → JfbTakeorderOrderList/JfbTakeorderOrderListLess.less} +2 -2
  32. package/src/components/{JfbTakeorderQuotedList/JfbTakeorderQuotedListMixin.js → JfbTakeorderOrderList/JfbTakeorderOrderListMixin.js} +1 -1
  33. package/src/components/JfbTakeorderOrderList/Mock.js +13 -0
  34. package/src/components/JfbTakeorderOrderList/components/order.vue +273 -0
  35. package/src/components/JfbTakeorderOrderList/cusAttr/advanced.js +26 -0
  36. package/src/components/JfbTakeorderOrderList/cusAttr/content.js +23 -0
  37. package/src/components/JfbTakeorderOrderList/cusAttr/style.js +11 -0
  38. package/src/components/{JfbTakeorderUnquotedDetail → JfbTakeorderVoiceSwitch}/Api.js +9 -9
  39. package/src/components/JfbTakeorderVoiceSwitch/Attr.js +12 -0
  40. package/src/components/{JfbTakeorderQuotedList/JfbTakeorderQuotedList.vue → JfbTakeorderVoiceSwitch/JfbTakeorderVoiceSwitch.vue} +42 -13
  41. package/src/components/{JfbTakeorderQuotedDetail/JfbTakeorderQuotedDetailLess.less → JfbTakeorderVoiceSwitch/JfbTakeorderVoiceSwitchLess.less} +2 -2
  42. package/src/components/{JfbTakeorderUnquotedList/JfbTakeorderUnquotedListMixin.js → JfbTakeorderVoiceSwitch/JfbTakeorderVoiceSwitchMixin.js} +1 -1
  43. package/src/components/JfbTakeorderVoiceSwitch/Mock.js +13 -0
  44. package/src/components/JfbTakeorderQuotedDetail/Attr.js +0 -48
  45. package/src/components/JfbTakeorderQuotedDetail/JfbTakeorderQuotedDetail.vue +0 -113
  46. package/src/components/JfbTakeorderQuotedDetail/Mock.js +0 -13
  47. package/src/components/JfbTakeorderQuotedList/Attr.js +0 -48
  48. package/src/components/JfbTakeorderQuotedList/Mock.js +0 -13
  49. package/src/components/JfbTakeorderUnquotedDetail/Attr.js +0 -48
  50. package/src/components/JfbTakeorderUnquotedDetail/JfbTakeorderUnquotedDetail.vue +0 -113
  51. package/src/components/JfbTakeorderUnquotedDetail/Mock.js +0 -13
  52. package/src/components/JfbTakeorderUnquotedList/Api.js +0 -58
  53. package/src/components/JfbTakeorderUnquotedList/Attr.js +0 -48
  54. package/src/components/JfbTakeorderUnquotedList/JfbTakeorderUnquotedList.vue +0 -113
  55. package/src/components/JfbTakeorderUnquotedList/Mock.js +0 -13
@@ -0,0 +1,845 @@
1
+ <template>
2
+ <view
3
+ class="jfb-takeorder-order-detail"
4
+ @click="handleEditxSelect"
5
+ :class="{ editx : isEditx && active }"
6
+ >
7
+ <!--#ifdef H5-->
8
+ <view
9
+ class="jfb-takeorder-order-detail__edit"
10
+ :class="{ editx : isEditx && active }"
11
+ v-if="isEditx && active"
12
+ >
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>
15
+ </view>
16
+ </view>
17
+ <!-- #endif -->
18
+ <!-- 待上报状态倒计时横幅 -->
19
+ <view
20
+ v-if="status==='daishangbao' && !isOrderCountdownEnd"
21
+ class="jfb-takeorder-order-detail__countdown-banner"
22
+ :style="{backgroundColor: mainColor}"
23
+ >
24
+ <xd-font-icon icon="iconshijian-01" color="#fff" size="36"></xd-font-icon>
25
+ <view class="jfb-takeorder-order-detail__countdown-text">
26
+ 订单剩余完成时间: {{ formatCountdownTime(orderCountdownSeconds) }}
27
+ </view>
28
+ </view>
29
+ <view class="jfb-takeorder-order-detail__body">
30
+ <Products :info="info" :status="status"></Products>
31
+ <view v-if="status!=='daishangbao'" class="wrap">
32
+ <view class="other-info-item" v-if="step===1||step===3">
33
+ <view>市场原价(仅供参考)</view>
34
+ <view :style="{color:mainColor}"><text>¥ </text>145</view>
35
+ </view>
36
+ <view class="other-info-item">
37
+ <view>商品总数</view>
38
+ <view style="display:flex;align-items: center;"><xd-font-icon size="28" icon="iconguanbi"></xd-font-icon>9</view>
39
+ </view>
40
+ <view class="other-info-item" v-if="step===1||step===3">
41
+ <view>报价人数</view>
42
+ <view>78人</view>
43
+ </view>
44
+ <view class="other-info-item" v-if="step===1||step===3">
45
+ <view>报价倒计时</view>
46
+ <view :style="{color:mainColor}">{{ !isCountdownEnd?formatTime(remainingSeconds):'报价结束' }}</view>
47
+ </view>
48
+ <view class="other-info-item" v-if="step===2">
49
+ <view>您的报价</view>
50
+ <view :style="{color:mainColor}"><text>¥ </text>145</view>
51
+ </view>
52
+ <view class="other-info-item" v-if="step===2">
53
+ <view>预计结算</view>
54
+ <view :style="{color:mainColor}"><text>¥ </text>145</view>
55
+ </view>
56
+ </view>
57
+ <view v-else class="wrap">
58
+ <view class="other-info-item">
59
+ <view>订单编号</view>
60
+ <view>HJKYUYYU7878</view>
61
+ </view>
62
+ <view class="other-info-item">
63
+ <view>商品总数</view>
64
+ <view style="display:flex;align-items: center;"><xd-font-icon size="28" icon="iconguanbi"></xd-font-icon>9</view>
65
+ </view>
66
+ <view class="other-info-item">
67
+ <view>订购电话</view>
68
+ <view>18888888888</view>
69
+ </view>
70
+ <view class="other-info-item">
71
+ <view>订单结算价</view>
72
+ <view :style="{color:mainColor}"><text>¥ </text>145</view>
73
+ </view>
74
+ </view>
75
+ <view class="wrap" v-if="!isCountdownEnd&&step!==2&&status!=='daishangbao'">
76
+ <view class="quote-title">订单报价</view>
77
+ <view class="quote-input">
78
+ <view class="quote-input-unit">¥</view>
79
+ <input :disabled="quoteDisabled" v-model="quotePrice" placeholder="请输入单张报价金额" />
80
+ </view>
81
+ <view class="quote-advice">建议报价:<text :style="{color:mainColor}">¥16.96 ~ ¥36.96</text></view>
82
+ </view>
83
+ <view v-if="status!=='daishangbao'" class="wrap" style="padding: 24rpx 32rpx">
84
+ <XdContentXss v-if="notice" :html="notice"></XdContentXss>
85
+ </view>
86
+ <view class="wrap upload">
87
+ <view class="voucher">
88
+ <view class="voucher-item">
89
+ <view class="voucher-item-image">
90
+ <image />
91
+ <view>凭证图</view>
92
+ </view>
93
+ <view class="voucher-item-info">
94
+ <view class="voucher-item-info-number">
95
+ <text class="voucher-item-info-label">凭证号</text>
96
+ <view>202101020200110</view>
97
+ </view>
98
+ <view class="voucher-item-info-qrcode">
99
+ <text class="voucher-item-info-label">二维码</text>
100
+ <image></image>
101
+ </view>
102
+ </view>
103
+ </view>
104
+ </view>
105
+ <view style="display: flex;justify-content: center;">
106
+ <xd-upload
107
+ @onDone="handleUploadDone"
108
+ selectType="image"
109
+ :selectSource="['album']"
110
+ ossType="private"
111
+ borderWidth="2rpx"
112
+ borderRadius="4rpx"
113
+ :backgroundColor="uploadBackground"
114
+ :borderColor="mainColor"
115
+ borderStyle="solid"
116
+ width="654"
117
+ height="88">
118
+ <view :style="{color:mainColor}">上传凭证</view>
119
+ </xd-upload>
120
+ </view>
121
+ <view class="upload-notice">
122
+ <text>请务必按真实报单并仔细校对取餐码正确无误,</text>
123
+ <text :style="{color:mainColor}">取餐码错误或未上报真实取餐码造成客诉产生损失将由您承担!</text>
124
+ </view>
125
+ </view>
126
+ <view v-if="!isCountdownEnd" :style="{ height: '100rpx' }"></view>
127
+ <view v-if="!isCountdownEnd&&status!=='daishangbao'" class="fixe_bottom" :style="prod_bottom">
128
+ <XdButton
129
+ v-if="step===1"
130
+ width="680rpx"
131
+ @click="toConfirmQuote"
132
+ size="small"
133
+ type="primary"
134
+ >确认报价</XdButton
135
+ >
136
+ <XdButton
137
+ v-if="step===2"
138
+ width="320rpx"
139
+ @click="step=1"
140
+ size="small"
141
+ :cusStyle="[btnStyle]"
142
+ >再想想</XdButton
143
+ >
144
+ <XdButton
145
+ v-if="step===2"
146
+ width="320rpx"
147
+ @click="handleSubmitQuote"
148
+ size="small"
149
+ type="primary"
150
+ >提交报价</XdButton
151
+ >
152
+ <XdButton
153
+ v-if="step===3"
154
+ width="320rpx"
155
+ @click="showCancelDialog=true"
156
+ size="small"
157
+ :cusStyle="[btnStyle]"
158
+ >取消报价</XdButton
159
+ >
160
+ <XdButton
161
+ v-if="step===3"
162
+ width="320rpx"
163
+ @click="showEditQuoteDialog=true"
164
+ size="small"
165
+ type="primary"
166
+ >修改报价</XdButton
167
+ >
168
+ </view>
169
+ <view v-if="status==='daishangbao'" class="fixe_bottom" :style="prod_bottom">
170
+ <XdButton
171
+ width="320rpx"
172
+ @click="showCancelDialog=true"
173
+ size="small"
174
+ :cusStyle="[btnStyle]"
175
+ >放弃订单</XdButton
176
+ >
177
+ <XdButton
178
+ width="320rpx"
179
+ @click="showEditQuoteDialog=true"
180
+ size="small"
181
+ type="primary"
182
+ >上报订单</XdButton
183
+ >
184
+ </view>
185
+ <!-- <XdDailog
186
+ :showClose="false"
187
+ :show.sync="showConfirmDialog" >
188
+ <template slot="title">
189
+ <view class="dialog-title">确认报价</view>
190
+ </template>
191
+ <view class="confirm-info">
192
+ <view class="confirm-info-item">
193
+ <view class="confirm-info-item-label">购买名称:</view>
194
+ <view class="confirm-info-item-value">畅享套餐</view>
195
+ </view>
196
+ <view class="confirm-info-item">
197
+ <view class="confirm-info-item-label">购买数量:</view>
198
+ <view class="confirm-info-item-value">2</view>
199
+ </view>
200
+ <view class="confirm-info-item">
201
+ <view class="confirm-info-item-label">您的报价:</view>
202
+ <view class="confirm-info-item-value">¥35.11</view>
203
+ </view>
204
+ <view class="confirm-info-item">
205
+ <view class="confirm-info-item-label">预计结算:</view>
206
+ <view class="confirm-info-item-value">¥70.22</view>
207
+ </view>
208
+ </view>
209
+ <view :style="{ color: mainColor,textAlign: 'center',fontSize:'24rpx'}">因各平台市场价有出入,建议报价前自主核实价格,避免因价格出入问题弃单被扣分!</view>
210
+ <template slot="btn">
211
+ <XdButton
212
+ width="180rpx"
213
+ size="small"
214
+ type="default"
215
+ bgColor="#EEE"
216
+ color="#999"
217
+ @click="showConfirmDialog = false"
218
+ >取消</XdButton>
219
+ <XdButton
220
+ width="180rpx"
221
+ size="small"
222
+ type="primary"
223
+ @click="handleConfirmQuote"
224
+ >确定</XdButton>
225
+ </template>
226
+ </XdDailog> -->
227
+ <XdDailog width="70%" :showClose="false" :show.sync="showMsgDialog">
228
+ <template slot="title">
229
+ <view class="dialog-title">{{ msgTitle }}</view>
230
+ </template>
231
+ <view>{{ msg }}</view>
232
+ <template slot="btn">
233
+ <XdButton
234
+ width="180rpx"
235
+ size="small"
236
+ type="primary"
237
+ @click="showMsgDialog = false"
238
+ >确定</XdButton>
239
+ </template>
240
+ </XdDailog>
241
+ <XdDailog width="70%" :showClose="false" :show.sync="showCancelDialog">
242
+ <template slot="title">
243
+ <view class="dialog-title">提示</view>
244
+ </template>
245
+ <view>是否确认取消报价</view>
246
+ <template slot="btn">
247
+ <XdButton
248
+ width="180rpx"
249
+ size="small"
250
+ bgColor="#EEE"
251
+ color="#999"
252
+ type="primary"
253
+ @click="showCancelDialog = false"
254
+ >取消</XdButton>
255
+ <XdButton
256
+ width="180rpx"
257
+ size="small"
258
+ type="primary"
259
+ @click="handleCancelQuote"
260
+ >确定</XdButton>
261
+ </template>
262
+ </XdDailog>
263
+ <CusEditQuote
264
+ v-if="showEditQuoteDialog"
265
+ :mainColor="mainColor"
266
+ :info="info"
267
+ @close="showEditQuoteDialog=false"
268
+ @confirm="handleConfirmEditQuote"
269
+ ></CusEditQuote>
270
+ </view>
271
+ </view>
272
+ </template>
273
+
274
+ <script>
275
+ import XdFontIcon from "@/components/XdFontIcon/XdFontIcon";
276
+ import XdContentXss from "@/components/XdContentXss/XdContentXss";
277
+ import XdDailog from "@/components/XdDailog/XdDailog";
278
+ import XdButton from "@/components/XdButton/XdButton";
279
+ import XdUpload from "@/components/XdUpload/XdUpload";
280
+ import Products from './components/products.vue'
281
+ import CusEditQuote from "./components/CusEditQuote.vue";
282
+ import { jfbRootExec } from "@/utils/xd.event";
283
+ import JfbTakeorderOrderDetailMixin from "./JfbTakeorderOrderDetailMixin";
284
+ import { getContainerPropsValue } from "@/utils/xd.base";
285
+ import componentsMixins from "@/mixins/componentsMixins";
286
+ import extsMixins from "@/mixins/extsMixins";
287
+ const Color = require("color");
288
+
289
+ export default {
290
+ name: "JfbTakeorderOrderDetail",
291
+ components: {
292
+ XdFontIcon,
293
+ XdContentXss,
294
+ XdDailog,
295
+ XdButton,
296
+ Products,
297
+ CusEditQuote,
298
+ XdUpload
299
+ },
300
+ mixins: [
301
+ componentsMixins, extsMixins, JfbTakeorderOrderDetailMixin
302
+ ],
303
+ data() {
304
+ return {
305
+ info: {
306
+ id: 1,
307
+ num: 15,
308
+ people: 30,
309
+ remainingTime: 10,
310
+ shop_name: "味多美(北京西单大悦城店)",
311
+ brand_name: "味多美",
312
+ city: "北京市",
313
+ products: [
314
+ {
315
+ product_thumb:
316
+ "https://img.js.design/assets/img/68b554c9c3a1ea02642d7d2f.png#afa2b9b9d50bcd2f1394619ecc488a99",
317
+ product_name:
318
+ "贝欧宝 BIOBOR贝欧宝维生素C+叶黄素酯软糖118g多重营养3D小熊造型糖果Q弹维生素C+叶黄素酯软糖",
319
+ product_sku: "118g",
320
+ minPrice: 132,
321
+ maxPrice: 1232,
322
+ num: 15,
323
+ },
324
+ {
325
+ product_thumb:
326
+ "https://img.js.design/assets/img/68b554c9c3a1ea02642d7d2f.png#afa2b9b9d50bcd2f1394619ecc488a99",
327
+ product_name:
328
+ "贝欧宝 BIOBOR贝欧宝维生素C+叶黄素酯软糖118g多重营养3D小熊造型糖果Q弹维生素C+叶黄素酯软糖",
329
+ product_sku: "450g",
330
+ minPrice: 456,
331
+ maxPrice: 1546,
332
+ num: 16,
333
+ },
334
+ ],
335
+ market_price: 4000,
336
+ minPrice: 456,
337
+ maxPrice: 1546,
338
+ order_status: 1,
339
+ },
340
+ notice: '',
341
+ // 报价倒计时是否结束
342
+ isCountdownEnd: false,
343
+ // 报价倒计时定时器标识(用于清除定时器)
344
+ countdownTimer: null,
345
+ // 报价倒计时剩余秒数
346
+ remainingSeconds: 20,
347
+ // 待上报订单倒计时是否结束
348
+ isOrderCountdownEnd: false,
349
+ // 待上报订单倒计时定时器标识
350
+ orderCountdownTimer: null,
351
+ // 待上报订单倒计时剩余秒数
352
+ orderCountdownSeconds: 600,
353
+ quotePrice: '',
354
+ closeMask: true,
355
+ showConfirmDialog: false,
356
+ quoteDisabled: false,
357
+ showMsgDialog: false,
358
+ step: 1,
359
+ showCancelDialog: false,
360
+ msg: "",
361
+ msgTitle: "",
362
+ showEditQuoteDialog: false,
363
+ status: 'daishangbao',
364
+ uploadBackground: ""
365
+ }
366
+ },
367
+ computed: {
368
+ prod_bottom() {
369
+ return this.fixedStyle({ height: 0, zIndex: 111 });
370
+ },
371
+ btnStyle() {
372
+ return {
373
+ color: this.mainColor,
374
+ border: `1px solid ${this.mainColor}`,
375
+ };
376
+ },
377
+ },
378
+ watch: {
379
+ container(value, oldValue) {
380
+ if (JSON.stringify(value) === JSON.stringify(oldValue)) return;
381
+ if (this.$configProject['isPreview']) this.init(value)
382
+ },
383
+ status(newVal) {
384
+ // 当状态变为待上报时,启动10分钟倒计时
385
+ if (newVal === 'daishangbao') {
386
+ this.orderCountdownSeconds = 600; // 10分钟 = 600秒
387
+ this.isOrderCountdownEnd = false;
388
+ this.startOrderCountdown();
389
+ } else {
390
+ // 其他状态时清除待上报订单倒计时
391
+ this.clearOrderCountdown();
392
+ }
393
+ },
394
+ },
395
+ created() {
396
+ this.init(this.container);
397
+
398
+ //todo
399
+ },
400
+ methods: {
401
+ onJfbLoad(options) {
402
+ this.getContent()
403
+ // 如果是待上报状态,启动10分钟倒计时
404
+ if (this.status === 'daishangbao') {
405
+ this.orderCountdownSeconds = 600; // 10分钟 = 600秒
406
+ this.isOrderCountdownEnd = false;
407
+ this.startOrderCountdown();
408
+ }
409
+ },
410
+ getContent() {
411
+ jfbRootExec("getListBaseNewsContent", {
412
+ vm: this,
413
+ data: {
414
+ page_id: this.pageAttr["page_id"], //页面ID
415
+ container_id: this.containerId, //组件ID
416
+ limit: 1,
417
+ },
418
+ })
419
+ .then((res) => {
420
+ if (res.list.length > 0) {
421
+ if (res.list && res.list.length > 0) {
422
+ this.notice = this.$xdUniHelper.filterHtml(res.list[0].content);
423
+ }
424
+ }
425
+ })
426
+ .catch((error) => {
427
+ console.error(error);
428
+ });
429
+ },
430
+ /**
431
+ * @description 监听事件变化
432
+ * @param container {object} 业务组件对象自己
433
+ */
434
+ init(container) {
435
+ this.uploadBackground = Color(this.mainColor).alpha(0.15).toString();
436
+ //this.bgcolor = getContainerPropsValue(container, 'content.bgcolor', '#fff');
437
+
438
+ //this.height = getContainerPropsValue(container, 'content.height', 10);
439
+ },
440
+ toConfirmQuote() {
441
+ if (!this.quotePrice) {
442
+ this.$xdAlert({ content: "请输入报价" });
443
+ return
444
+ }
445
+ this.step=2
446
+ },
447
+ handleSubmitQuote() {
448
+ // this.showConfirmDialog = false;
449
+ this.step=3
450
+ this.quoteDisabled = true;
451
+
452
+ },
453
+ handleCancelQuote() {
454
+ //请求接口,判断是否可以取消报价
455
+ this.msg = '报价已结束'
456
+ this.msgTitle = '提示'
457
+ this.showCancelDialog = false
458
+ this.showMsgDialog = true
459
+ },
460
+ handleConfirmEditQuote() {
461
+ //调用接口
462
+ // 上报订单时停止待上报订单倒计时
463
+ if (this.status === 'daishangbao') {
464
+ this.clearOrderCountdown();
465
+ this.isOrderCountdownEnd = true;
466
+ }
467
+ },
468
+ startCountdown() {
469
+ // 先清除可能存在的旧定时器,防止重复计时
470
+ this.clearCountdown();
471
+
472
+ // 创建每秒执行的定时器
473
+ this.countdownTimer = setInterval(() => {
474
+ if (this.remainingSeconds > 0) {
475
+ // 剩余秒数减1
476
+ this.remainingSeconds--;
477
+ } else {
478
+ // 倒计时结束:清除定时器 + 标记结束状态
479
+ this.clearCountdown();
480
+ this.isCountdownEnd = true;
481
+ console.log("报价倒计时结束");
482
+ }
483
+ }, 1000);
484
+ },
485
+ /**
486
+ * 启动待上报订单倒计时
487
+ */
488
+ startOrderCountdown() {
489
+ // 先清除可能存在的旧定时器,防止重复计时
490
+ this.clearOrderCountdown();
491
+
492
+ // 创建每秒执行的定时器
493
+ this.orderCountdownTimer = setInterval(() => {
494
+ if (this.orderCountdownSeconds > 0) {
495
+ // 剩余秒数减1
496
+ this.orderCountdownSeconds--;
497
+ } else {
498
+ // 倒计时结束:清除定时器 + 标记结束状态
499
+ this.clearOrderCountdown();
500
+ this.isOrderCountdownEnd = true;
501
+ // 倒计时结束自动放弃订单
502
+ this.handleAutoCancelOrder();
503
+ console.log("待上报订单倒计时结束");
504
+ }
505
+ }, 1000);
506
+ },
507
+ /**
508
+ * 格式化秒数为 分:秒 格式(比如 60秒 → 01:00,5秒 → 00:05)
509
+ * @param {Number} seconds 待格式化的秒数
510
+ * @returns {String} 格式化后的时间字符串
511
+ */
512
+ formatTime(seconds) {
513
+ // 计算分钟
514
+ const minutes = Math.floor(seconds / 60);
515
+ // 计算剩余秒数
516
+ const secs = seconds % 60;
517
+ // 补零处理(确保两位数显示)
518
+ const formatMinutes = minutes.toString().padStart(2, "0");
519
+ const formatSecs = secs.toString().padStart(2, "0");
520
+ return `${formatMinutes}:${formatSecs}`;
521
+ },
522
+ /**
523
+ * 格式化秒数为 XX分XX秒 格式(用于待上报状态倒计时显示)
524
+ * @param {Number} seconds 待格式化的秒数
525
+ * @returns {String} 格式化后的时间字符串,如 "02分59秒"
526
+ */
527
+ formatCountdownTime(seconds) {
528
+ // 计算分钟
529
+ const minutes = Math.floor(seconds / 60);
530
+ // 计算剩余秒数
531
+ const secs = seconds % 60;
532
+ // 补零处理(确保两位数显示)
533
+ const formatMinutes = minutes.toString().padStart(2, "0");
534
+ const formatSecs = secs.toString().padStart(2, "0");
535
+ return `${formatMinutes}分${formatSecs}秒`;
536
+ },
537
+ /**
538
+ * 倒计时结束时自动放弃订单
539
+ */
540
+ handleAutoCancelOrder() {
541
+ // 自动放弃订单的逻辑
542
+ this.msg = '订单已自动放弃,倒计时结束前未进行操作';
543
+ this.msgTitle = '提示';
544
+ this.showMsgDialog = true;
545
+ // 这里可以调用放弃订单的接口
546
+ // TODO: 调用放弃订单接口
547
+ },
548
+ /**
549
+ * 清除报价倒计时定时器
550
+ */
551
+ clearCountdown() {
552
+ if (this.countdownTimer) {
553
+ clearInterval(this.countdownTimer);
554
+ this.countdownTimer = null;
555
+ }
556
+ },
557
+ /**
558
+ * 清除待上报订单倒计时定时器
559
+ */
560
+ clearOrderCountdown() {
561
+ if (this.orderCountdownTimer) {
562
+ clearInterval(this.orderCountdownTimer);
563
+ this.orderCountdownTimer = null;
564
+ }
565
+ },
566
+ handleUploadDone(files) {
567
+ console.log('event.handleUploadDone', files);
568
+ },
569
+ onJfbScroll(options) {
570
+ console.log('event.onJfbScroll', options)
571
+ },
572
+ onJfbReachBottom(options) {
573
+ console.log('event.onJfbReachBottom', options)
574
+ },
575
+ onJfbShow(options) {
576
+ console.log('event.onJfbShow', options)
577
+ },
578
+ onJfbHide(options) {
579
+ console.log('event.onJfbHide', options)
580
+ },
581
+ onJfbBack(options) {
582
+ console.log('event.onJfbBack', options)
583
+ },
584
+ onJfbUpdate(...data) {
585
+ console.log('event.onJfbUpdate', data)
586
+ },
587
+ onJfbCustomEvent(options) {
588
+ console.log('event.onJfbReachBottom', options)
589
+ },
590
+ onJfbUnload(){
591
+ this.clearCountdown();
592
+ this.clearOrderCountdown();
593
+ }
594
+ }
595
+ }
596
+
597
+ </script>
598
+
599
+ <style scoped lang="less">
600
+ @import "./JfbTakeorderOrderDetailLess.less";
601
+
602
+ .jfb-takeorder-order-detail {
603
+ &__countdown-banner {
604
+ display: flex;
605
+ align-items: center;
606
+ padding: 24rpx 32rpx;
607
+ margin: 16rpx 16rpx 0 16rpx;
608
+ border-radius: 16rpx 16rpx 0 0;
609
+ background: #E5010E;
610
+ & > xd-font-icon {
611
+ margin-right: 16rpx;
612
+ }
613
+ }
614
+ &__countdown-text {
615
+ color: #fff;
616
+ font-size: 28rpx;
617
+ flex: 1;
618
+ }
619
+ &__body{
620
+ .wrap{
621
+ background: #fff;
622
+ margin: 16rpx;
623
+ border-radius: 16rpx;
624
+ }
625
+ .order-info{
626
+ &-title {
627
+ display: flex;
628
+ justify-content: space-between;
629
+ padding: 24rpx 32rpx;
630
+ border-bottom: 1px solid #f4f4f4;
631
+ &-left {
632
+ display: flex;
633
+ align-items: center;
634
+ }
635
+ &-right {
636
+ font-weight: 500;
637
+ }
638
+ }
639
+ &-product {
640
+ display: flex;
641
+ padding: 16rpx 32rpx;
642
+ border-bottom: 1px solid #f4f4f4;
643
+ & > image {
644
+ width: 180rpx;
645
+ height: 180rpx;
646
+ flex-shrink: 0;
647
+ border: 10rpx;
648
+ }
649
+ &-info {
650
+ margin-left: 24rpx;
651
+ &-name {
652
+ .uni-max-cut(2,80);
653
+ margin-bottom: 10rpx;
654
+ }
655
+ &-sku {
656
+ font-size: 24rpx;
657
+ color: #999;
658
+ }
659
+ &-price {
660
+ margin-top: 10rpx;
661
+ display: flex;
662
+ justify-content: space-between;
663
+ align-items: center;
664
+ &-left {
665
+ color: #ff2c18;
666
+ font-size: 32rpx;
667
+ font-weight: 500;
668
+ & > text {
669
+ font-size: 24rpx;
670
+ margin-right: 10rpx;
671
+ }
672
+ .range {
673
+ margin: 0 10rpx;
674
+ }
675
+ }
676
+ &-right {
677
+ color: #999;
678
+ display: flex;
679
+ align-items: baseline;
680
+ & > view {
681
+ margin-left: 10rpx;
682
+ }
683
+ }
684
+ }
685
+ }
686
+ }
687
+ }
688
+ .other-info-item {
689
+ display: flex;
690
+ justify-content: space-between;
691
+ padding: 20rpx 32rpx;
692
+ color: #333;
693
+ font-size: 28rpx;
694
+ border-bottom: 2rpx solid #f8f8f8;
695
+ }
696
+ .quote {
697
+ &-title {
698
+ font-size: 28rpx;
699
+ color: #333;
700
+ padding: 24rpx 0 24rpx 32rpx;
701
+ }
702
+ &-input {
703
+ position: relative;
704
+ padding: 0 32rpx 24rpx 32rpx;
705
+ &-unit {
706
+ position: absolute;
707
+ left: 55rpx;
708
+ top: 50%;
709
+ transform: translateY(-80%);
710
+ font-size: 28rpx;
711
+ color: #333;
712
+ font-weight: 700;
713
+ }
714
+ &>input {
715
+ background:#F8F8F8;
716
+ font-size: 28rpx;
717
+ padding: 20rpx 46rpx 20rpx 60rpx;
718
+ border-radius: 16rpx;
719
+ }
720
+ }
721
+ &-advice{
722
+ font-size: 24rpx;
723
+ color: #666666;
724
+ padding: 0 0 24rpx 32rpx;
725
+ }
726
+ }
727
+ .fixe_bottom {
728
+ display: flex;
729
+ align-items: center;
730
+ justify-content: space-around;
731
+ height: unit(100, rpx);
732
+ padding: 0 unit(40, rpx);
733
+ flex-flow: nowrap;
734
+ background: #fff;
735
+ box-shadow: 0 0 unit(16, rpx) rgba(0, 0, 0, 0.05);
736
+ .flex_l {
737
+ display: flex;
738
+ align-items: center;
739
+ font-size: unit(32, rpx);
740
+ }
741
+
742
+ & > view {
743
+ flex: 1;
744
+ padding: 0 unit(15, rpx);
745
+ }
746
+ }
747
+ .dialog-title{
748
+ color: #666666;
749
+ font-size: 28rpx;
750
+ }
751
+ .confirm-info {
752
+ display: flex;
753
+ flex-direction: column;
754
+ align-items: center;
755
+ justify-content: center;
756
+ margin-bottom: 32rpx;
757
+
758
+ &-item {
759
+ display: flex;
760
+ justify-content: center;
761
+ margin-bottom: 16rpx;
762
+ font-size: 28rpx;
763
+ color: #333;
764
+ &-label {
765
+ width: 140rpx;
766
+ flex-shrink: 0;
767
+ }
768
+ &-value{
769
+ margin-left: 48rpx;
770
+ width: 120rpx;
771
+ flex: 1;
772
+ flex-wrap: wrap;
773
+ display: flex;
774
+ justify-content: flex-start;
775
+ }
776
+ }
777
+ }
778
+ .upload-title {
779
+ border-radius: 4rpx;
780
+ background: #E5010E;
781
+ border: 1px solid #E5010E;
782
+ padding: 24rpx 0;
783
+ text-align: center;
784
+ }
785
+ .upload {
786
+ padding: 24rpx 32rpx;
787
+ }
788
+ .upload-notice {
789
+ color: #999999;
790
+ font-size: 24rpx;
791
+ margin-top: 24rpx;
792
+ }
793
+ .voucher {
794
+ &-item {
795
+ display: flex;
796
+ margin-bottom: 26rpx;
797
+ &-image {
798
+ flex-shrink: 0;
799
+ display: flex;
800
+ flex-direction: column;
801
+ align-items: center;
802
+ justify-content: center;
803
+ & > image {
804
+ width: 180rpx;
805
+ height: 180rpx;
806
+ border-radius: 4rpx;
807
+ }
808
+ & > view {
809
+ color: #666;
810
+ font-size: 24rpx;
811
+ }
812
+ }
813
+ &-info {
814
+ &-label {
815
+ color: #666;
816
+ font-size: 24rpx;
817
+ margin-right: 24rpx;
818
+ }
819
+ &-number {
820
+ display: flex;
821
+ align-items: center;
822
+ margin-bottom: 24rpx;
823
+ & > view {
824
+ font-size: 28rpx;
825
+ color: #999;
826
+ background: #f8f8f8;
827
+ padding: 20rpx;
828
+ border-radius: 16rpx;
829
+ }
830
+ }
831
+ &-qrcode {
832
+ display: flex;
833
+ align-items: flex-start;
834
+ & > image {
835
+ width: 120rpx;
836
+ height: 120rpx;
837
+ border-radius: 4rpx;
838
+ }
839
+ }
840
+ }
841
+ }
842
+ }
843
+ }
844
+ }
845
+ </style>