jufubao-takeorder 1.0.2-beta4 → 1.0.2-beta6

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 (27) hide show
  1. package/package.json +1 -1
  2. package/src/components/JfbTakeorderFilterOrderList/Api.js +16 -31
  3. package/src/components/JfbTakeorderFilterOrderList/Attr.js +10 -6
  4. package/src/components/JfbTakeorderFilterOrderList/JfbTakeorderFilterOrderList.vue +304 -161
  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 +221 -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 +102 -0
  14. package/src/components/JfbTakeorderOrderDetail/JfbTakeorderOrderDetail.vue +1031 -665
  15. package/src/components/JfbTakeorderOrderDetail/Mock.js +9 -9
  16. package/src/components/JfbTakeorderOrderDetail/components/CusEditQuote.vue +2 -13
  17. package/src/components/JfbTakeorderOrderDetail/components/products.vue +16 -13
  18. package/src/components/JfbTakeorderOrderList/Api.js +16 -31
  19. package/src/components/JfbTakeorderOrderList/JfbTakeorderOrderList.vue +259 -123
  20. package/src/components/JfbTakeorderOrderList/Mock.js +1 -1
  21. package/src/components/JfbTakeorderOrderList/cusAttr/content.js +5 -5
  22. package/src/components/JfbTakeorderVoiceSwitch/Api.js +14 -33
  23. package/src/components/JfbTakeorderVoiceSwitch/JfbTakeorderVoiceSwitch.vue +154 -105
  24. package/src/components/JfbTakeorderVoiceSwitch/Mock.js +2 -10
  25. package/src/components/JfbTakeorderFilterOrderList/components/order.vue +0 -277
  26. package/src/components/JfbTakeorderIndex/components/order.vue +0 -273
  27. package/src/components/JfbTakeorderOrderList/components/order.vue +0 -273
@@ -1,13 +1,13 @@
1
1
  'use strict';
2
2
 
3
3
  module.exports = {
4
-
5
- getOrderByIdFilmSquate:{},
6
-
7
- updateOrderFilmPaiqiDate:{},
8
-
9
- removeOrderFilmAddress:{},
10
-
11
- addOrderFilmcart:{},
12
-
4
+ getTakeorderOrderDetail: { "id": 80, "order_id": "h866697758749884417", "shop_name": "星巴克(平谷国泰店)", "shop_address": "平谷区文化北街13号国泰商场一层", "brand_name": "星巴克", "province_name": "平谷区", "market_amount": 525, "suggest_min_quotation": 116, "suggest_max_quotation": 171, "rest_quotation_time": 259, "rest_receive_time": 0, "rest_report_time": 0, "buyer_phone_number": "18232189788", "receive_user_settle_amount": 100, "quotation_person_count": 0, "user_quotation": 0, "order_status": "quoting", "user_quotation_status": "wait_quote", "product_list": [{ "product_name": "星巴克经典咖啡", "product_sku_name": "大杯\/特别热\/经典糖\/标准\/全脂牛奶", "product_thumb": "https:\/\/www.shuomingshu.cn\/wp-content\/uploads\/images\/2023\/01\/07\/dc0bdf6bfedb4038911ec6550fd31d62_5t1vcuagbok.jpg", "product_num": 5, "market_price": 382, "suggest_min_quotation": 23, "suggest_max_quotation": 34, "user_quotation": 0 }], "product_total": 5, "report_voucher_list": [], "request_id": "dd0ae89273941292" },
5
+ createQuotation: {},
6
+ cancelQuotation: {},
7
+ updateQuotation: {},
8
+ discardOrder: {},
9
+ acceptOrder: {},
10
+ reportOrder: {},
11
+ imageRecognition: {},
12
+ getImagePreview: {}
13
13
  }
@@ -2,7 +2,7 @@
2
2
  <view class="dialog">
3
3
  <view class="dialog-body">
4
4
  <view class="dialog-title">修改报价</view>
5
- <view class="current-quote"> 当前报价:¥{{ info.currentQuote }} </view>
5
+ <view class="current-quote"> 当前报价:¥{{ $xdUniHelper.divisionFloatNumber(info.user_quotation,100) }} </view>
6
6
  <!-- 报价输入框(带¥前缀) -->
7
7
  <view class="quote-input">
8
8
  <view class="quote-input-unit">¥</view>
@@ -12,7 +12,7 @@
12
12
  <view class="suggest-wrap">
13
13
  建议报价:
14
14
  <text :style="{ color: mainColor }" class="suggest-range"
15
- >¥{{ info.suggestMin }} ~ ¥{{ info.suggestMax }}</text
15
+ >¥{{ $xdUniHelper.divisionFloatNumber(info.suggest_min_quotation,100) }} ~ ¥{{ $xdUniHelper.divisionFloatNumber(info.suggest_max_quotation,100) }}</text
16
16
  >
17
17
  </view>
18
18
  <!-- 备注说明 -->
@@ -62,17 +62,6 @@ export default {
62
62
  };
63
63
  },
64
64
  methods: {
65
- // 过滤输入:只允许数字+小数点(最多两位小数)
66
- filterInput(e) {
67
- let val = e.detail.value;
68
- // 只保留数字和小数点
69
- val = val.replace(/[^\d.]/g, "");
70
- // 去重小数点
71
- val = val.replace(/\.{2,}/g, ".");
72
- // 限制小数点后最多两位
73
- val = val.replace(/^(\-)*(\d+)\.(\d\d).*$/, "$1$2.$3");
74
- this.inputQuote = val;
75
- },
76
65
  handleClose() {
77
66
  this.$emit("close");
78
67
  },
@@ -1,15 +1,18 @@
1
1
  <template>
2
- <view class="wrap order-info" :class="{'no-margin-top': status==='daishangbao'}">
2
+ <view
3
+ class="wrap order-info"
4
+ :class="{ 'no-margin-top': info.user_quotation_status === 'received' }"
5
+ >
3
6
  <view class="order-info-title">
4
7
  <view class="order-info-title-left">
5
8
  <view>{{ info.shop_name }}</view>
6
9
  <text>|</text>
7
10
  <view>{{ info.brand_name }}</view>
8
11
  </view>
9
- <view class="order-info-title-right">{{ info.city }}</view>
12
+ <view class="order-info-title-right">{{ info.province_name }}</view>
10
13
  </view>
11
14
  <view
12
- v-for="(Pitem, Pindex) in info.products"
15
+ v-for="(Pitem, Pindex) in info.product_list"
13
16
  :key="Pindex"
14
17
  class="order-info-product"
15
18
  >
@@ -19,12 +22,13 @@
19
22
  Pitem.product_name
20
23
  }}</view>
21
24
  <view class="order-info-product-info-sku"
22
- >规格:{{ Pitem.product_sku }}</view
25
+ >规格:{{ Pitem.product_sku_name }}</view
23
26
  >
24
27
  <view class="order-info-product-info-price">
25
28
  <view class="order-info-product-info-price-left"
26
- ><text>¥ </text>{{ Pitem.minPrice }}<text class="range">~</text
27
- ><text>¥ </text>{{ Pitem.maxPrice }}</view
29
+ ><text>¥ </text>{{ $xdUniHelper.divisionFloatNumber(Pitem.suggest_min_quotation,100)
30
+ }}<text class="range">~</text><text>¥ </text
31
+ >{{ $xdUniHelper.divisionFloatNumber(Pitem.suggest_max_quotation,100) }}</view
28
32
  >
29
33
  <view class="order-info-product-info-price-right"
30
34
  ><XdFontIcon
@@ -32,7 +36,7 @@
32
36
  color="#999"
33
37
  size="14"
34
38
  ></XdFontIcon
35
- ><view>{{ Pitem.num }}</view></view
39
+ ><view>{{ Pitem.product_num }}</view></view
36
40
  >
37
41
  </view>
38
42
  </view>
@@ -47,11 +51,7 @@ export default {
47
51
  type: Object,
48
52
  default: () => ({}),
49
53
  },
50
- status: {
51
- type: String,
52
- default: '',
53
- },
54
- }
54
+ },
55
55
  };
56
56
  </script>
57
57
 
@@ -61,7 +61,7 @@ export default {
61
61
  margin: 16rpx;
62
62
  border-radius: 16rpx;
63
63
  &.no-margin-top {
64
- margin-top: 0;
64
+ margin-top: 0 !important;
65
65
  }
66
66
  }
67
67
  .order-info {
@@ -73,9 +73,11 @@ export default {
73
73
  &-left {
74
74
  display: flex;
75
75
  align-items: center;
76
+ font-size: 28rpx;
76
77
  }
77
78
  &-right {
78
79
  font-weight: 500;
80
+ font-size: 28rpx;
79
81
  }
80
82
  }
81
83
  &-product {
@@ -90,6 +92,7 @@ export default {
90
92
  }
91
93
  &-info {
92
94
  margin-left: 24rpx;
95
+ font-size: 28rpx;
93
96
  &-name {
94
97
  .uni-max-cut(2,80);
95
98
  margin-bottom: 10rpx;
@@ -6,52 +6,37 @@
6
6
  */
7
7
  module.exports = [
8
8
  {
9
- //设置方法名字当别忘记加上【模块名字】:Order
10
- mapFnName: 'getOrderByIdFilmSquate',
11
- title: '获取电影广场列表',
12
- path: '/api/account/film/list-film-square',
9
+ mapFnName: 'getOrderList',
10
+ title: '订单列表',
11
+ path: '/takeorder/v1/order',
13
12
  isRule: false,
14
13
  params: {
15
- last_key: ['当前页', 'Number', '必选'],
16
- page_size: ['每页数量', 'Number', '必选'],
14
+ tab: ['tab', 'String', '必选'],
15
+ order_type: ['订单类型', 'Number', '必选'],
16
+ page_token: ['page_token', 'Number', ''],
17
+ page_size: ['page_size', 'Number', ''],
17
18
  },
18
19
  isConsole: true,
19
20
  disabled: true,
20
21
  },
21
22
  {
22
- //设置方法名字当别忘记加上【模块名字】:Order
23
- mapFnName: 'updateOrderFilmPaiqiDate',
24
- title: '更新排期',
25
- path: '/api/account/film/paiqi-date',
23
+ mapFnName: 'getNewOrderNotify',
24
+ title: '新订单通知-轮询(5s轮询一次)',
25
+ path: '/takeorder/v1/new-order/notify',
26
26
  isRule: false,
27
27
  params: {
28
- film_id: ['电影id', 'Number', '必选'],
29
- cinema_id: ['影院id', 'Number', '必选'],
28
+ order_type: ['订单类型', 'Number', '必选'],
29
+ max_id: ['订单列表的最大ID,如果不存在,直接传递 0', 'Number', ''],
30
30
  },
31
31
  isConsole: true,
32
32
  disabled: true,
33
33
  },
34
34
  {
35
- //设置方法名字当别忘记加上【模块名字】:Order
36
- mapFnName: 'removeOrderFilmAddress',
37
- title: '删除我的配送地址',
38
- path: '/api/account/film/paiqi-date',
35
+ mapFnName: 'getUserConfig',
36
+ title: '获取用户配置',
37
+ path: '/takeorder/v1/user-config',
39
38
  isRule: false,
40
- params: {
41
- film_id: ['电影id', 'Number', '必选'],
42
- },
43
- isConsole: true,
44
- disabled: true,
45
- },
46
- {
47
- //设置方法名字当别忘记加上【模块名字】:Order
48
- mapFnName: 'addOrderFilmcart',
49
- title: '添加购物车',
50
- path: '/api/account/film/paiqi-date',
51
- isRule: false,
52
- params: {
53
- film_id: ['电影id', 'Number', '必选'],
54
- },
39
+ params: {},
55
40
  isConsole: true,
56
41
  disabled: true,
57
42
  },
@@ -2,168 +2,304 @@
2
2
  <view
3
3
  class="jfb-takeorder-order-list"
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-list__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-list__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
22
  <view class="jfb-takeorder-order-list__body">
19
- <view
23
+ <!-- <view
20
24
  v-if="showNew"
21
25
  @click="handleRefresh"
22
26
  :style="{ color: warningColor, background: newBackgroundColor }"
23
27
  class="jfb-takeorder-quoted-list__body-new"
24
28
  ><XdFontIcon size="24" icon="iconIM"></XdFontIcon>
25
29
  <view>新的订单来了,点我立即刷新</view></view
26
- >
30
+ > -->
27
31
  <view v-for="(item, index) in orderList" :key="index">
28
- <Order
32
+ <CusTakeorder
29
33
  :item="item"
30
34
  :mainColor="mainColor"
31
35
  @expire="handleOrderExpire"
32
36
  @btnEvent="handleBtnEvent"
33
- ></Order>
37
+ ></CusTakeorder>
34
38
  </view>
39
+ <xd-no-data
40
+ icon-type="order"
41
+ :scale-size="2"
42
+ v-if="orderList && orderList.length === 0"
43
+ >暂无订单</xd-no-data
44
+ >
35
45
  </view>
36
46
  </view>
37
47
  </template>
38
48
 
39
49
  <script>
40
- import XdFontIcon from "@/components/XdFontIcon/XdFontIcon";
41
- import { jfbRootExec } from "@/utils/xd.event";
42
- import JfbTakeorderOrderListMixin from "./JfbTakeorderOrderListMixin";
43
- import { getContainerPropsValue } from "@/utils/xd.base";
44
- import componentsMixins from "@/mixins/componentsMixins";
50
+ import XdFontIcon from "@/components/XdFontIcon/XdFontIcon";
51
+ import { jfbRootExec } from "@/utils/xd.event";
52
+ import JfbTakeorderOrderListMixin from "./JfbTakeorderOrderListMixin";
53
+ import { getContainerPropsValue } from "@/utils/xd.base";
54
+ import componentsMixins from "@/mixins/componentsMixins";
45
55
  import extsMixins from "@/mixins/extsMixins";
46
- import Order from "./components/order.vue";
56
+ import CusTakeorder from "@/components/CusTakeorder/CusTakeorder";
57
+ import getServiceUrl from "@/common/getServiceUrl";
58
+ import XdNoData from "@/components/XdNoData/XdNoData";
59
+ import { mapActions } from "vuex";
47
60
  const Color = require("color");
48
- export default {
49
- name: "JfbTakeorderOrderList",
50
- components: {
51
- XdFontIcon,
52
- Order,
53
- },
54
- mixins: [
55
- componentsMixins, extsMixins, JfbTakeorderOrderListMixin
56
- ],
57
- data() {
58
- return {
59
- newBackgroundColor: "",
60
- showNew: false,
61
- orderList: [
62
- {
63
- id: 1,
64
- num: 15,
65
- people: 30,
66
- remainingTime: 10,
67
- shop_name: "味多美(北京西单大悦城店)",
68
- brand_name: "味多美",
69
- city: "北京市",
70
- products: [
71
- {
72
- product_thumb:
73
- "https://img.js.design/assets/img/68b554c9c3a1ea02642d7d2f.png#afa2b9b9d50bcd2f1394619ecc488a99",
74
- product_name:
75
- "贝欧宝 BIOBOR贝欧宝维生素C+叶黄素酯软糖118g多重营养3D小熊造型糖果Q弹维生素C+叶黄素酯软糖",
76
- product_sku: "118g",
77
- minPrice: 132,
78
- maxPrice: 1232,
79
- num: 15,
80
- },
81
- {
82
- product_thumb:
83
- "https://img.js.design/assets/img/68b554c9c3a1ea02642d7d2f.png#afa2b9b9d50bcd2f1394619ecc488a99",
84
- product_name:
85
- "贝欧宝 BIOBOR贝欧宝维生素C+叶黄素酯软糖118g多重营养3D小熊造型糖果Q弹维生素C+叶黄素酯软糖",
86
- product_sku: "450g",
87
- minPrice: 456,
88
- maxPrice: 1546,
89
- num: 16,
90
- },
91
- ],
92
- market_price: 4000,
93
- minPrice: 456,
94
- maxPrice: 1546,
95
- order_status: 1,
96
- },
97
- ],
98
- orderType: ""
61
+ export default {
62
+ name: "JfbTakeorderOrderList",
63
+ components: {
64
+ XdFontIcon,
65
+ CusTakeorder,
66
+ XdNoData,
67
+ },
68
+ mixins: [componentsMixins, extsMixins, JfbTakeorderOrderListMixin],
69
+ data() {
70
+ return {
71
+ newBackgroundColor: "",
72
+ showNew: false,
73
+ pollTimer: null, // 轮询定时器
74
+ orderList: [],
75
+ order_type: "hourdash",
76
+ orderTab: "index",
77
+ page_size: 10,
78
+ page_token: 1,
79
+ hasNext: true,
80
+ next_page_token: "",
81
+ order_detail_path: "",
82
+ isPreview: false,
83
+ isOpenNew: "N",
84
+ isOpenWin: "N",
85
+ max_id: null,
86
+ };
87
+ },
88
+ watch: {
89
+ container(value, oldValue) {
90
+ if (JSON.stringify(value) === JSON.stringify(oldValue)) return;
91
+ if (this.$configProject["isPreview"]) this.init(value);
92
+ },
93
+ },
94
+ created() {
95
+ this.init(this.container);
96
+ },
97
+ destroyed() {
98
+ this.stopPolling();
99
+ },
100
+ methods: {
101
+ ...mapActions(["voiceAlert", "playWebSpeech", "playAudioFile"]),
102
+ onJfbLoad(options) {
103
+ // 获取订单列表
104
+ this.getList();
105
+ if (!this.isPreview) {
106
+ jfbRootExec("getUserConfig", {
107
+ vm: this,
108
+ data: {},
109
+ }).then((configRes) => {
110
+ this.isOpenNew = configRes.is_open_new_order_notify_audio;
111
+ this.isOpenWin = configRes.is_open_win_order_audio;
112
+ // 立即调用一次
113
+ this.handleGetNew();
114
+ // 启动定时器,每5秒调用一次
115
+ this.startPolling();
116
+ });
99
117
  }
100
118
  },
101
- watch: {
102
- container(value, oldValue) {
103
- if (JSON.stringify(value) === JSON.stringify(oldValue)) return;
104
- if (this.$configProject['isPreview']) this.init(value)
105
- },
119
+ /**
120
+ * @description 监听事件变化
121
+ * @param container {object} 业务组件对象自己
122
+ */
123
+ init(container) {
124
+ this.newBackgroundColor = Color(this.warningColor).alpha(0.15).toString();
125
+ this.orderTab = getContainerPropsValue(
126
+ container,
127
+ "content.orderTab",
128
+ "index"
129
+ );
130
+ this.order_detail_path = getContainerPropsValue(
131
+ container,
132
+ "content.order_detail_path",
133
+ { value: "" }
134
+ ).value;
135
+ if (this.$configProject["isPreview"]) {
136
+ this.isPreview = true;
137
+ }
106
138
  },
107
- created() {
108
- this.init(this.container);
139
+ /**
140
+ * 获取订单列表
141
+ */
142
+ getList() {
143
+ // 构建请求参数
144
+ const params = {
145
+ tab: this.orderTab,
146
+ order_type: this.order_type,
147
+ page_token: this.page_token,
148
+ page_size: this.page_size,
149
+ };
109
150
 
110
- //todo
151
+ return jfbRootExec("getOrderList", {
152
+ vm: this,
153
+ data: params,
154
+ })
155
+ .then((res) => {
156
+ // 设置订单列表数据
157
+ let list = res.list.map((item) => {
158
+ item.product_list = item.product_list.map((prod, i) => {
159
+ prod["product_thumb"] = prod.product_thumb
160
+ ? getServiceUrl(prod.product_thumb, "size3")
161
+ : "";
162
+ return prod;
163
+ });
164
+ return item;
165
+ });
166
+ if (this.page_token === 1) {
167
+ this.orderList = list;
168
+ } else {
169
+ this.orderList = this.orderList.concat(list);
170
+ }
171
+ this.hasNext = res.next_page_token !== "";
172
+ this.next_page_token = res.next_page_token;
173
+ })
174
+ .catch((err) => {
175
+ console.error("获取订单列表失败:", err);
176
+ });
111
177
  },
112
- methods: {
113
- onJfbLoad(options) {
114
-
115
- // jfbRootExec('baiduUserLogin', {
116
-
117
- // vm: this,// data: {
118
-
119
- // account: 'gaoshiyong',// password: '123456789',// type: 3,// ...options
120
-
121
- // }
122
-
123
- // }).then().catch()
124
- },
125
- /**
126
- * @description 监听事件变化
127
- * @param container {object} 业务组件对象自己
128
- */
129
- init(container) {
130
- this.newBackgroundColor = Color(this.warningColor).alpha(0.15).toString();
131
- this.orderType = getContainerPropsValue(container, 'content.orderType', '');
132
-
133
- //this.height = getContainerPropsValue(container, 'content.height', 10);
134
- },
135
- onJfbScroll(options) {
136
- console.log('event.onJfbScroll', options)
137
- },
138
- onJfbReachBottom(options) {
139
- console.log('event.onJfbReachBottom', options)
140
- },
141
- onJfbShow(options) {
142
- console.log('event.onJfbShow', options)
143
- },
144
- onJfbHide(options) {
145
- console.log('event.onJfbHide', options)
146
- },
147
- onJfbBack(options) {
148
- console.log('event.onJfbBack', options)
149
- },
150
- onJfbUpdate(...data) {
151
- console.log('event.onJfbUpdate', data)
152
- },
153
- onJfbCustomEvent(options) {
154
- console.log('event.onJfbReachBottom', options)
155
- },
156
- }
157
- }
178
+ handleBtnEvent({ item, btn }) {
179
+ // 跳转到订单详情页
180
+ this.$xdUniHelper.navigateTo({
181
+ url: `${this.order_detail_path}?order_id=${item.order_id}`,
182
+ });
183
+ },
184
+ /**
185
+ * 处理子组件派发的 'expire' 事件
186
+ * 订单倒计时结束后,从列表中删除该订单
187
+ */
188
+ handleOrderExpire(orderId) {
189
+ if (this.isPreview) return;
190
+ const orderIndex = this.orderList.findIndex(
191
+ (item) => item.order_id === orderId || item.id === orderId
192
+ );
193
+ if (orderIndex === -1) return;
158
194
 
195
+ // 从列表中删除该订单
196
+ this.orderList.splice(orderIndex, 1);
197
+ },
198
+ /**
199
+ * 刷新列表
200
+ */
201
+ handleRefresh() {
202
+ // 重置分页
203
+ this.page_token = 1;
204
+ this.hasNext = true;
205
+ this.next_page_token = "";
206
+ // 重新获取列表
207
+ this.getList();
208
+ this.showNew = false;
209
+ },
210
+ /**
211
+ * 获取新订单通知
212
+ */
213
+ handleGetNew() {
214
+ jfbRootExec("getNewOrderNotify", {
215
+ vm: this,
216
+ data: {
217
+ order_type: this.order_type,
218
+ max_id: this.max_id || 0,
219
+ },
220
+ }).then((res) => {
221
+ if (res.is_exist_new_order && res.is_exist_win_order) {
222
+ if (this.isOpenNew === "Y") {
223
+ this.voiceAlert({ type: "new",filePath: 'https://img.jufubao.cn/takeorder/new_order.mp3' });
224
+ }
225
+ if (this.isOpenWin === "Y") {
226
+ setTimeout(() => {
227
+ this.voiceAlert({ type: "win",filePath: 'https://img.jufubao.cn/takeorder/wait_order.mp3' });
228
+ }, 1000);
229
+ }
230
+ } else if (res.is_exist_new_order) {
231
+ if (this.isOpenNew === "Y") {
232
+ this.voiceAlert({ type: "new",filePath: 'https://img.jufubao.cn/takeorder/new_order.mp3' });
233
+ }
234
+ } else if (res.is_exist_win_order) {
235
+ if (this.isOpenWin === "Y") {
236
+ this.voiceAlert({ type: "win",filePath: 'https://img.jufubao.cn/takeorder/wait_order.mp3' });
237
+ }
238
+ }
239
+ this.max_id = res.new_order_max_id;
240
+ this.showNew = res.is_exist_new_order;
241
+ });
242
+ },
243
+ /**
244
+ * 启动轮询定时器
245
+ */
246
+ startPolling() {
247
+ // 如果已经存在定时器,先清除
248
+ if (this.pollTimer) {
249
+ clearInterval(this.pollTimer);
250
+ }
251
+ // 每5秒调用一次接口
252
+ this.pollTimer = setInterval(() => {
253
+ this.handleGetNew();
254
+ }, 5000);
255
+ },
256
+ /**
257
+ * 停止轮询定时器
258
+ */
259
+ stopPolling() {
260
+ if (this.pollTimer) {
261
+ clearInterval(this.pollTimer);
262
+ this.pollTimer = null;
263
+ }
264
+ },
265
+ onJfbScroll(options) {},
266
+ onJfbReachBottom(options) {
267
+ if (this.hasNext) {
268
+ this.page_token = this.next_page_token;
269
+ this.getList();
270
+ }
271
+ },
272
+ onJfbShow(options) {
273
+ // 页面显示时恢复轮询
274
+ if (!this.pollTimer) {
275
+ this.startPolling();
276
+ }
277
+ },
278
+ onJfbHide(options) {
279
+ // 页面隐藏时暂停轮询
280
+ this.stopPolling();
281
+ console.log("event.onJfbHide", options);
282
+ },
283
+ onJfbBack(options) {
284
+ console.log("event.onJfbBack", options);
285
+ },
286
+ onJfbUpdate(...data) {
287
+ console.log("event.onJfbUpdate", data);
288
+ },
289
+ onJfbCustomEvent(options) {
290
+ console.log("event.onJfbReachBottom", options);
291
+ },
292
+ },
293
+ };
159
294
  </script>
160
295
 
161
296
  <style scoped lang="less">
162
- @import "./JfbTakeorderOrderListLess.less";
163
-
164
- .jfb-takeorder-order-list {
165
- &__body{
297
+ @import "./JfbTakeorderOrderListLess.less";
166
298
 
167
- }
299
+ .jfb-takeorder-order-list {
300
+ &__body {
301
+ // 订单列表容器样式
302
+ padding: 0;
168
303
  }
304
+ }
169
305
  </style>
@@ -2,7 +2,7 @@
2
2
 
3
3
  module.exports = {
4
4
 
5
- getOrderByIdFilmSquate:{},
5
+ getOrderList: { "list": [{ "order_id": "h867336984252252161", "order_status": "quoting", "shop_name": "星巴克(平谷国泰店)", "brand_name": "星巴克", "province_name": "平谷区", "market_amount": 525, "suggest_min_quotation": 116, "suggest_max_quotation": 171, "rest_quotation_time": 12, "rest_receive_time": 0, "rest_report_time": 0, "quotation_person_count": 0, "user_quotation": 0, "user_quotation_status": "wait_quote", "product_list": [{ "product_name": "星巴克经典咖啡", "product_sku_name": "大杯\/特别热\/经典糖\/标准\/全脂牛奶", "product_thumb": "https:\/\/www.shuomingshu.cn\/wp-content\/uploads\/images\/2023\/01\/07\/dc0bdf6bfedb4038911ec6550fd31d62_5t1vcuagbok.jpg", "product_num": 5, "market_price": 382, "suggest_min_quotation": 23, "suggest_max_quotation": 34, "user_quotation": 0 }], "button_list": [] }], "next_page_token": "", "request_id": "c1dfb0423e9c83df" },
6
6
 
7
7
  updateOrderFilmPaiqiDate:{},
8
8