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,273 +0,0 @@
1
- <template>
2
- <view class="order-wrap">
3
- <view :style="{ background: mainColor }" class="order-time">
4
- <XdFontIcon
5
- style="margin: 0 24rpx 0 36rpx"
6
- icon="iconshijian-01"
7
- size="30"
8
- ></XdFontIcon>
9
- 剩余报价时间:<text v-if="item.remainingTime > 0">{{
10
- formatCountdown(item.remainingTime)
11
- }}</text
12
- >,参与报价<text style="color: #ffeb3b">{{ item.people }}</text
13
- >人</view
14
- >
15
- <view class="order-title">
16
- <view class="order-title-left">
17
- <view>{{ item.shop_name }}</view>
18
- <text>|</text>
19
- <view>{{ item.brand_name }}</view>
20
- </view>
21
- <view class="order-title-right">{{ item.city }}</view>
22
- </view>
23
- <view
24
- v-for="(Pitem, Pindex) in item.products"
25
- :key="Pindex"
26
- class="order-product"
27
- >
28
- <image :src="Pitem.product_thumb"></image>
29
- <view class="order-product-info">
30
- <view class="order-product-info-name">{{ Pitem.product_name }}</view>
31
- <view class="order-product-info-sku"
32
- >规格:{{ Pitem.product_sku }}</view
33
- >
34
- <view class="order-product-info-price">
35
- <view class="order-product-info-price-left"
36
- ><text>¥ </text>{{ Pitem.minPrice }}<text class="range">~</text
37
- ><text>¥ </text>{{ Pitem.maxPrice }}</view
38
- >
39
- <view class="order-product-info-price-right"
40
- ><XdFontIcon
41
- icon="icondanchuangguanbi_xian"
42
- color="#999"
43
- size="14"
44
- ></XdFontIcon
45
- ><view>{{ Pitem.num }}</view></view
46
- >
47
- </view>
48
- </view>
49
- </view>
50
- <view class="order-price">
51
- <view class="order-price-left">
52
- <view class="order-price-left-market"
53
- >市场原价:¥{{ item.market_price }}(仅供参考)</view
54
- >
55
- <view class="order-price-left-settle"
56
- >结算价格:<view
57
- ><text>¥ </text>{{ item.minPrice }}<text class="range">~</text
58
- ><text>¥ </text>{{ item.maxPrice }}</view
59
- ></view
60
- >
61
- </view>
62
- <view>
63
- <XdButton @click="handleClick" type="primary" size="small"
64
- >报价</XdButton
65
- >
66
- </view>
67
- </view>
68
- </view>
69
- </template>
70
-
71
- <script>
72
- import XdFontIcon from "@/components/XdFontIcon/XdFontIcon";
73
- import XdButton from "@/components/XdButton/XdButton";
74
-
75
- export default {
76
- name: "order",
77
- components: {
78
- XdFontIcon,
79
- XdButton,
80
- },
81
- data() {
82
- return {
83
- isUpdating: false,
84
- countdownTimer: null,
85
- };
86
- },
87
- props: {
88
- mainColor: {
89
- type: String,
90
- default: "",
91
- },
92
- item: {
93
- type: Object,
94
- default: () => {},
95
- },
96
- },
97
- computed: {},
98
- watch: {
99
- // 当父组件更新了 order.status 时,停止倒计时
100
- 'item.status'(newVal) {
101
- if (newVal !== 'pending') {
102
- this.clearCountdownTimer();
103
- this.isUpdating = false; // 重置更新状态
104
- }
105
- },
106
- // 当父组件更新了 order.remainingTime 时(例如页面重新显示时的校准),重启倒计时
107
- 'item.remainingTime'(newVal) {
108
- if (this.item.status === 'pending' && newVal > 0) {
109
- this.startCountdown();
110
- }
111
- }
112
- },
113
- created() {
114
- // 组件创建时,如果是待支付状态,就启动倒计时
115
- if (this.item.remainingTime > 0) {
116
- this.startCountdown();
117
- }
118
- },
119
- destroyed() {
120
- // 组件销毁时,清理定时器
121
- this.clearCountdownTimer();
122
- },
123
- methods: {
124
- formatCountdown(seconds) {
125
- const mins = Math.floor(seconds / 60);
126
- const secs = seconds % 60;
127
- return `${mins.toString().padStart(2, "0")}:${secs
128
- .toString()
129
- .padStart(2, "0")}`;
130
- },
131
- // 数字补零(小于10补前导零)
132
- padZero(num) {
133
- return num < 10 ? `0${num}` : num;
134
- },
135
- startCountdown() {
136
- this.clearCountdownTimer();
137
- this.countdownTimer = setInterval(() => {
138
- // 这里我们不直接修改 props,而是在倒计时结束时通知父组件
139
- if (this.item.remainingTime <= 1) {
140
- // 当倒计时即将结束时
141
- this.clearCountdownTimer();
142
- this.isUpdating = true; // 显示“更新中”状态
143
- this.$emit("expire", this.item.id); // 通知父组件:我过期了!
144
- } else {
145
- // 为了UI流畅,可以在这里更新本地倒计时显示,但最终数据以父组件为准
146
- // 注意:这是一个小技巧,避免每秒都向父组件发送事件
147
- this.$set(this.item, "remainingTime", this.item.remainingTime - 1);
148
- }
149
- }, 1000);
150
- },
151
- clearCountdownTimer() {
152
- if (this.countdownTimer) {
153
- clearInterval(this.countdownTimer);
154
- this.countdownTimer = null;
155
- }
156
- },
157
- handleClick() {
158
- this.$emit("btnEvent", this.item);
159
- },
160
- },
161
- };
162
- </script>
163
-
164
- <style lang="less" scoped>
165
- .order {
166
- &-wrap {
167
- background: #fff;
168
- color: #333;
169
- margin: 16rpx;
170
- border-radius: 20rpx;
171
- }
172
- &-time {
173
- color: #fff;
174
- font-size: 24rpx;
175
- padding: 20rpx 0;
176
- border-radius: 20rpx 20rpx 0 0;
177
- display: flex;
178
- align-items: center;
179
- }
180
- &-title {
181
- display: flex;
182
- justify-content: space-between;
183
- padding: 24rpx 32rpx;
184
- border-bottom: 1px solid #f4f4f4;
185
- &-left {
186
- display: flex;
187
- align-items: center;
188
- }
189
- &-right {
190
- font-weight: 500;
191
- }
192
- }
193
- &-product {
194
- display: flex;
195
- padding: 16rpx 32rpx;
196
- border-bottom: 1px solid #f4f4f4;
197
- & > image {
198
- width: 180rpx;
199
- height: 180rpx;
200
- flex-shrink: 0;
201
- border: 10rpx;
202
- }
203
- &-info {
204
- margin-left: 24rpx;
205
- &-name {
206
- .uni-max-cut(2,80);
207
- margin-bottom: 10rpx;
208
- }
209
- &-sku {
210
- font-size: 24rpx;
211
- color: #999;
212
- }
213
- &-price {
214
- margin-top: 10rpx;
215
- display: flex;
216
- justify-content: space-between;
217
- align-items: center;
218
- &-left {
219
- color: #ff2c18;
220
- font-size: 32rpx;
221
- font-weight: 500;
222
- & > text {
223
- font-size: 24rpx;
224
- margin-right: 10rpx;
225
- }
226
- .range {
227
- margin: 0 10rpx;
228
- }
229
- }
230
- &-right {
231
- color: #999;
232
- display: flex;
233
- align-items: baseline;
234
- & > view {
235
- margin-left: 10rpx;
236
- }
237
- }
238
- }
239
- }
240
- }
241
- &-price {
242
- display: flex;
243
- justify-content: space-between;
244
- align-items: center;
245
- padding: 24rpx 32rpx;
246
- border-radius: 0 0 20rpx 20rpx;
247
- &-left {
248
- &-market {
249
- font-size: 24rpx;
250
- color: #999;
251
- margin-bottom: 10rpx;
252
- }
253
- &-settle {
254
- font-size: 24rpx;
255
- display: flex;
256
- align-items: center;
257
- & > view {
258
- color: #ff2c18;
259
- font-size: 32rpx;
260
- font-weight: 500;
261
- & > text {
262
- font-size: 24rpx;
263
- margin-right: 10rpx;
264
- }
265
- .range {
266
- margin: 0 10rpx;
267
- }
268
- }
269
- }
270
- }
271
- }
272
- }
273
- </style>
@@ -1,273 +0,0 @@
1
- <template>
2
- <view class="order-wrap">
3
- <view :style="{ background: mainColor }" class="order-time">
4
- <XdFontIcon
5
- style="margin: 0 24rpx 0 36rpx"
6
- icon="iconshijian-01"
7
- size="30"
8
- ></XdFontIcon>
9
- 剩余报价时间:<text v-if="item.remainingTime > 0">{{
10
- formatCountdown(item.remainingTime)
11
- }}</text
12
- >,参与报价<text style="color: #ffeb3b">{{ item.people }}</text
13
- >人</view
14
- >
15
- <view class="order-title">
16
- <view class="order-title-left">
17
- <view>{{ item.shop_name }}</view>
18
- <text>|</text>
19
- <view>{{ item.brand_name }}</view>
20
- </view>
21
- <view class="order-title-right">{{ item.city }}</view>
22
- </view>
23
- <view
24
- v-for="(Pitem, Pindex) in item.products"
25
- :key="Pindex"
26
- class="order-product"
27
- >
28
- <image :src="Pitem.product_thumb"></image>
29
- <view class="order-product-info">
30
- <view class="order-product-info-name">{{ Pitem.product_name }}</view>
31
- <view class="order-product-info-sku"
32
- >规格:{{ Pitem.product_sku }}</view
33
- >
34
- <view class="order-product-info-price">
35
- <view class="order-product-info-price-left"
36
- ><text>¥ </text>{{ Pitem.minPrice }}<text class="range">~</text
37
- ><text>¥ </text>{{ Pitem.maxPrice }}</view
38
- >
39
- <view class="order-product-info-price-right"
40
- ><XdFontIcon
41
- icon="icondanchuangguanbi_xian"
42
- color="#999"
43
- size="14"
44
- ></XdFontIcon
45
- ><view>{{ Pitem.num }}</view></view
46
- >
47
- </view>
48
- </view>
49
- </view>
50
- <view class="order-price">
51
- <view class="order-price-left">
52
- <view class="order-price-left-market"
53
- >市场原价:¥{{ item.market_price }}(仅供参考)</view
54
- >
55
- <view class="order-price-left-settle"
56
- >结算价格:<view
57
- ><text>¥ </text>{{ item.minPrice }}<text class="range">~</text
58
- ><text>¥ </text>{{ item.maxPrice }}</view
59
- ></view
60
- >
61
- </view>
62
- <view>
63
- <XdButton @click="handleClick" type="primary" size="small"
64
- >报价</XdButton
65
- >
66
- </view>
67
- </view>
68
- </view>
69
- </template>
70
-
71
- <script>
72
- import XdFontIcon from "@/components/XdFontIcon/XdFontIcon";
73
- import XdButton from "@/components/XdButton/XdButton";
74
-
75
- export default {
76
- name: "order",
77
- components: {
78
- XdFontIcon,
79
- XdButton,
80
- },
81
- data() {
82
- return {
83
- isUpdating: false,
84
- countdownTimer: null,
85
- };
86
- },
87
- props: {
88
- mainColor: {
89
- type: String,
90
- default: "",
91
- },
92
- item: {
93
- type: Object,
94
- default: () => {},
95
- },
96
- },
97
- computed: {},
98
- watch: {
99
- // 当父组件更新了 order.status 时,停止倒计时
100
- 'item.status'(newVal) {
101
- if (newVal !== 'pending') {
102
- this.clearCountdownTimer();
103
- this.isUpdating = false; // 重置更新状态
104
- }
105
- },
106
- // 当父组件更新了 order.remainingTime 时(例如页面重新显示时的校准),重启倒计时
107
- 'item.remainingTime'(newVal) {
108
- if (this.item.status === 'pending' && newVal > 0) {
109
- this.startCountdown();
110
- }
111
- }
112
- },
113
- created() {
114
- // 组件创建时,如果是待支付状态,就启动倒计时
115
- if (this.item.remainingTime > 0) {
116
- this.startCountdown();
117
- }
118
- },
119
- destroyed() {
120
- // 组件销毁时,清理定时器
121
- this.clearCountdownTimer();
122
- },
123
- methods: {
124
- formatCountdown(seconds) {
125
- const mins = Math.floor(seconds / 60);
126
- const secs = seconds % 60;
127
- return `${mins.toString().padStart(2, "0")}:${secs
128
- .toString()
129
- .padStart(2, "0")}`;
130
- },
131
- // 数字补零(小于10补前导零)
132
- padZero(num) {
133
- return num < 10 ? `0${num}` : num;
134
- },
135
- startCountdown() {
136
- this.clearCountdownTimer();
137
- this.countdownTimer = setInterval(() => {
138
- // 这里我们不直接修改 props,而是在倒计时结束时通知父组件
139
- if (this.item.remainingTime <= 1) {
140
- // 当倒计时即将结束时
141
- this.clearCountdownTimer();
142
- this.isUpdating = true; // 显示“更新中”状态
143
- this.$emit("expire", this.item.id); // 通知父组件:我过期了!
144
- } else {
145
- // 为了UI流畅,可以在这里更新本地倒计时显示,但最终数据以父组件为准
146
- // 注意:这是一个小技巧,避免每秒都向父组件发送事件
147
- this.$set(this.item, "remainingTime", this.item.remainingTime - 1);
148
- }
149
- }, 1000);
150
- },
151
- clearCountdownTimer() {
152
- if (this.countdownTimer) {
153
- clearInterval(this.countdownTimer);
154
- this.countdownTimer = null;
155
- }
156
- },
157
- handleClick() {
158
- this.$emit("btnEvent", this.item);
159
- },
160
- },
161
- };
162
- </script>
163
-
164
- <style lang="less" scoped>
165
- .order {
166
- &-wrap {
167
- background: #fff;
168
- color: #333;
169
- margin: 16rpx;
170
- border-radius: 20rpx;
171
- }
172
- &-time {
173
- color: #fff;
174
- font-size: 24rpx;
175
- padding: 20rpx 0;
176
- border-radius: 20rpx 20rpx 0 0;
177
- display: flex;
178
- align-items: center;
179
- }
180
- &-title {
181
- display: flex;
182
- justify-content: space-between;
183
- padding: 24rpx 32rpx;
184
- border-bottom: 1px solid #f4f4f4;
185
- &-left {
186
- display: flex;
187
- align-items: center;
188
- }
189
- &-right {
190
- font-weight: 500;
191
- }
192
- }
193
- &-product {
194
- display: flex;
195
- padding: 16rpx 32rpx;
196
- border-bottom: 1px solid #f4f4f4;
197
- & > image {
198
- width: 180rpx;
199
- height: 180rpx;
200
- flex-shrink: 0;
201
- border: 10rpx;
202
- }
203
- &-info {
204
- margin-left: 24rpx;
205
- &-name {
206
- .uni-max-cut(2,80);
207
- margin-bottom: 10rpx;
208
- }
209
- &-sku {
210
- font-size: 24rpx;
211
- color: #999;
212
- }
213
- &-price {
214
- margin-top: 10rpx;
215
- display: flex;
216
- justify-content: space-between;
217
- align-items: center;
218
- &-left {
219
- color: #ff2c18;
220
- font-size: 32rpx;
221
- font-weight: 500;
222
- & > text {
223
- font-size: 24rpx;
224
- margin-right: 10rpx;
225
- }
226
- .range {
227
- margin: 0 10rpx;
228
- }
229
- }
230
- &-right {
231
- color: #999;
232
- display: flex;
233
- align-items: baseline;
234
- & > view {
235
- margin-left: 10rpx;
236
- }
237
- }
238
- }
239
- }
240
- }
241
- &-price {
242
- display: flex;
243
- justify-content: space-between;
244
- align-items: center;
245
- padding: 24rpx 32rpx;
246
- border-radius: 0 0 20rpx 20rpx;
247
- &-left {
248
- &-market {
249
- font-size: 24rpx;
250
- color: #999;
251
- margin-bottom: 10rpx;
252
- }
253
- &-settle {
254
- font-size: 24rpx;
255
- display: flex;
256
- align-items: center;
257
- & > view {
258
- color: #ff2c18;
259
- font-size: 32rpx;
260
- font-weight: 500;
261
- & > text {
262
- font-size: 24rpx;
263
- margin-right: 10rpx;
264
- }
265
- .range {
266
- margin: 0 10rpx;
267
- }
268
- }
269
- }
270
- }
271
- }
272
- }
273
- </style>