jufubao-takeorder 1.0.1 → 1.0.2-beta10

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 (46) hide show
  1. package/package.json +1 -1
  2. package/src/components/JfbTakeorderFilterOrderList/Api.js +43 -0
  3. package/src/components/JfbTakeorderFilterOrderList/Attr.js +16 -0
  4. package/src/components/JfbTakeorderFilterOrderList/JfbTakeorderFilterOrderList.vue +353 -0
  5. package/src/components/JfbTakeorderFilterOrderList/JfbTakeorderFilterOrderListLess.less +80 -0
  6. package/src/components/JfbTakeorderFilterOrderList/JfbTakeorderFilterOrderListMixin.js +30 -0
  7. package/src/components/JfbTakeorderFilterOrderList/Mock.js +13 -0
  8. package/src/components/JfbTakeorderFilterOrderList/cusAttr/advanced.js +26 -0
  9. package/src/components/JfbTakeorderFilterOrderList/cusAttr/content.js +9 -0
  10. package/src/components/JfbTakeorderFilterOrderList/cusAttr/style.js +11 -0
  11. package/src/components/JfbTakeorderIndex/Api.js +72 -0
  12. package/src/components/JfbTakeorderIndex/Attr.js +16 -0
  13. package/src/components/JfbTakeorderIndex/JfbTakeorderIndex.vue +851 -0
  14. package/src/components/JfbTakeorderIndex/JfbTakeorderIndexLess.less +80 -0
  15. package/src/components/JfbTakeorderIndex/JfbTakeorderIndexMixin.js +30 -0
  16. package/src/components/JfbTakeorderIndex/Mock.js +13 -0
  17. package/src/components/JfbTakeorderIndex/components/cityPicker.vue +307 -0
  18. package/src/components/JfbTakeorderIndex/cusAttr/advanced.js +26 -0
  19. package/src/components/JfbTakeorderIndex/cusAttr/content.js +9 -0
  20. package/src/components/JfbTakeorderIndex/cusAttr/style.js +11 -0
  21. package/src/components/JfbTakeorderOrderDetail/Api.js +125 -0
  22. package/src/components/JfbTakeorderOrderDetail/Attr.js +16 -0
  23. package/src/components/JfbTakeorderOrderDetail/JfbTakeorderOrderDetail.vue +1211 -0
  24. package/src/components/JfbTakeorderOrderDetail/JfbTakeorderOrderDetailLess.less +80 -0
  25. package/src/components/JfbTakeorderOrderDetail/JfbTakeorderOrderDetailMixin.js +30 -0
  26. package/src/components/JfbTakeorderOrderDetail/Mock.js +13 -0
  27. package/src/components/JfbTakeorderOrderDetail/components/CusEditQuote.vue +150 -0
  28. package/src/components/JfbTakeorderOrderDetail/components/products.vue +141 -0
  29. package/src/components/JfbTakeorderOrderDetail/cusAttr/advanced.js +12 -0
  30. package/src/components/JfbTakeorderOrderDetail/cusAttr/content.js +233 -0
  31. package/src/components/JfbTakeorderOrderDetail/cusAttr/style.js +11 -0
  32. package/src/components/JfbTakeorderOrderList/Api.js +43 -0
  33. package/src/components/JfbTakeorderOrderList/Attr.js +16 -0
  34. package/src/components/JfbTakeorderOrderList/JfbTakeorderOrderList.vue +320 -0
  35. package/src/components/JfbTakeorderOrderList/JfbTakeorderOrderListLess.less +80 -0
  36. package/src/components/JfbTakeorderOrderList/JfbTakeorderOrderListMixin.js +30 -0
  37. package/src/components/JfbTakeorderOrderList/Mock.js +13 -0
  38. package/src/components/JfbTakeorderOrderList/cusAttr/advanced.js +26 -0
  39. package/src/components/JfbTakeorderOrderList/cusAttr/content.js +23 -0
  40. package/src/components/JfbTakeorderOrderList/cusAttr/style.js +11 -0
  41. package/src/components/JfbTakeorderVoiceSwitch/Api.js +39 -0
  42. package/src/components/JfbTakeorderVoiceSwitch/Attr.js +12 -0
  43. package/src/components/JfbTakeorderVoiceSwitch/JfbTakeorderVoiceSwitch.vue +191 -0
  44. package/src/components/JfbTakeorderVoiceSwitch/JfbTakeorderVoiceSwitchLess.less +80 -0
  45. package/src/components/JfbTakeorderVoiceSwitch/JfbTakeorderVoiceSwitchMixin.js +30 -0
  46. package/src/components/JfbTakeorderVoiceSwitch/Mock.js +5 -0
@@ -0,0 +1,307 @@
1
+ <template>
2
+ <view class="wrap">
3
+ <!-- <xd-city
4
+ :top="80"
5
+ city-location-type="baidu"
6
+ @getCityList="handleGetCityList"
7
+ ></xd-city> -->
8
+ <view class="city-picker">
9
+ <!-- 热门城市 -->
10
+ <view class="hot-cities" v-if="hotCities.length > 0">
11
+ <view class="city-grid">
12
+ <view
13
+ class="city-item"
14
+ v-for="city in hotCities"
15
+ :key="city.city_code"
16
+ :style="{
17
+ color: isOptionSelected(city) ? mainColor : '',
18
+ border: isOptionSelected(city)
19
+ ? `1px solid ${filterBorderColor}`
20
+ : '',
21
+ backgroundColor: isOptionSelected(city) ? filterBackground : '',
22
+ }"
23
+ @click="handleCityClick(city)"
24
+ >
25
+ {{ city.city_name }}
26
+ </view>
27
+ </view>
28
+ </view>
29
+
30
+ <!-- 主要内容区:城市列表和字母索引 -->
31
+ <view class="content" v-if="scrollHeight !== null">
32
+ <!-- 城市列表 -->
33
+ <scroll-view
34
+ class="city-list"
35
+ scroll-y
36
+ :style="scrollHeight"
37
+ :scroll-with-animation="true"
38
+ :scroll-into-view="scrollToView"
39
+ @scroll="onScroll"
40
+ >
41
+ <view
42
+ v-for="group in cityGroups"
43
+ :key="group.letter"
44
+ :id="'group-' + group.letter"
45
+ class="city-group"
46
+ >
47
+ <view class="group-letter">{{ group.letter }}</view>
48
+ <view class="city-items">
49
+ <view
50
+ class="city-item"
51
+ v-for="city in group.cities"
52
+ :key="city.city_code"
53
+ :style="{
54
+ color: isOptionSelected(city) ? mainColor : '',
55
+ border: isOptionSelected(city)
56
+ ? `1px solid ${filterBorderColor}`
57
+ : '',
58
+ backgroundColor: isOptionSelected(city)
59
+ ? filterBackground
60
+ : '',
61
+ }"
62
+ @click="handleCityClick(city)"
63
+ >
64
+ {{ city.city_name }}
65
+ </view>
66
+ </view>
67
+ </view>
68
+ </scroll-view>
69
+ </view>
70
+ </view>
71
+
72
+ <!-- 右侧字母索引 -->
73
+ <view class="letter-index">
74
+ <view
75
+ class="letter-item"
76
+ v-for="letter in letters"
77
+ :key="letter"
78
+ @click="scrollToLetter(letter)"
79
+ :style="{
80
+ background: currentLetter === letter ? mainColor : '',
81
+ color: currentLetter === letter ? '#fff' : '',
82
+ }"
83
+ >
84
+ {{ letter }}
85
+ </view>
86
+ </view>
87
+ </view>
88
+ </template>
89
+
90
+ <script>
91
+
92
+ export default {
93
+ components: {
94
+ },
95
+ // 接收父组件传递的属性
96
+ props: {
97
+ // 热门城市数据
98
+ hotCities: {
99
+ type: Array,
100
+ default: () => [],
101
+ },
102
+ // 按字母分组的城市数据
103
+ cityGroups: {
104
+ type: Array,
105
+ default: () => [],
106
+ },
107
+ // 字母列表
108
+ letters: {
109
+ type: Array,
110
+ default: () => [],
111
+ },
112
+ // 当前选中的城市,由父组件控制
113
+ selectedCity: {
114
+ type: Array,
115
+ default: [],
116
+ },
117
+ // 主色调
118
+ mainColor: {
119
+ type: String,
120
+ default: "#ff6600",
121
+ },
122
+ // 过滤框边框颜色
123
+ filterBorderColor: {
124
+ type: String,
125
+ default: "#ff6600",
126
+ },
127
+ // 过滤框背景颜色
128
+ filterBackground: {
129
+ type: String,
130
+ default: "#ff6600",
131
+ },
132
+ },
133
+ data() {
134
+ return {
135
+ // 滚动相关
136
+ scrollToView: "",
137
+ currentLetter: "",
138
+ // 用于计算滚动位置的分组高度
139
+ groupHeights: {},
140
+ scrollHeight: ""
141
+ };
142
+ },
143
+ watch: {
144
+ // 当城市分组数据变化时,重新计算高度
145
+ cityGroups() {
146
+ this.$nextTick(() => {
147
+ this.calculateGroupHeights();
148
+ });
149
+ },
150
+ },
151
+ mounted() {
152
+ // 初始化时计算分组高度
153
+ this.$nextTick(() => {
154
+ this.calculateGroupHeights();
155
+ });
156
+ },
157
+ methods: {
158
+ // 计算每个字母分组的高度,用于滚动定位
159
+ calculateGroupHeights() {
160
+ this.scrollHeight = `height:calc(100vh - ${
161
+ 100 * this.$rpxNum
162
+ }px);`;
163
+ },
164
+ isOptionSelected(city) {
165
+ return this.selectedCity && this.selectedCity.includes(city.city_code);
166
+ },
167
+ // 处理城市点击事件
168
+ handleCityClick(city) {
169
+ // 向父组件发射城市选中事件
170
+ this.$emit("citySelect", city);
171
+ },
172
+
173
+ // 滚动到指定字母分组
174
+ scrollToLetter(letter) {
175
+ // 检查是否存在该字母的城市分组
176
+ const hasGroup = this.cityGroups.some((group) => group.letter === letter);
177
+ if (!hasGroup) return;
178
+
179
+ // 关键:先清空 scrollToView,再设置目标值,确保触发滚动
180
+ // 因为 uni-app 的 scroll-into-view 只有在值变化时才会触发滚动
181
+ this.scrollToView = "";
182
+
183
+ // 使用 $nextTick 确保 DOM 更新后再设置新值
184
+ this.$nextTick(() => {
185
+ this.scrollToView = `group-${letter}`;
186
+ this.currentLetter = letter;
187
+ });
188
+ },
189
+
190
+ // 监听滚动事件,更新当前字母
191
+ onScroll(e) {
192
+ const scrollTop = e.detail.scrollTop + 100; // 加一个偏移量
193
+
194
+ // 遍历所有分组高度,找到当前可见的分组
195
+ for (const letter in this.groupHeights) {
196
+ const { top, bottom } = this.groupHeights[letter];
197
+ if (scrollTop >= top && scrollTop < bottom) {
198
+ this.currentLetter = letter;
199
+ break;
200
+ }
201
+ }
202
+ },
203
+ },
204
+ };
205
+ </script>
206
+
207
+ <style scoped lang="less">
208
+ .city-picker {
209
+ display: flex;
210
+ flex-direction: column;
211
+ height: 100%;
212
+ background-color: #fff;
213
+ padding-right: 40rpx;
214
+ }
215
+
216
+ .wrap {
217
+ display: flex;
218
+ }
219
+
220
+ .hot-cities {
221
+ background-color: #fff;
222
+ }
223
+
224
+ .section-title {
225
+ font-size: 28rpx;
226
+ color: #666;
227
+ margin-bottom: 24rpx;
228
+ }
229
+
230
+ .city-grid {
231
+ display: flex;
232
+ flex-wrap: wrap;
233
+ gap: 24rpx;
234
+ }
235
+
236
+ .content {
237
+ display: flex;
238
+ flex: 1;
239
+ position: relative;
240
+ // overflow: hidden;
241
+ }
242
+
243
+ .city-list {
244
+ flex: 1;
245
+ height: 100%;
246
+ }
247
+
248
+ .city-group {
249
+ padding: 0;
250
+ }
251
+
252
+ .group-letter {
253
+ font-size: 28rpx;
254
+ color: #999999;
255
+ background-color: #fff;
256
+ padding-left: 20rpx;
257
+ }
258
+
259
+ .city-items {
260
+ display: flex;
261
+ flex-wrap: wrap;
262
+ gap: 24rpx;
263
+ padding: 24rpx 0 0 0;
264
+ background-color: #fff;
265
+ }
266
+
267
+ .city-item {
268
+ border-radius: 4rpx;
269
+ background: #fafafa;
270
+ display: flex;
271
+ justify-content: center;
272
+ align-items: center;
273
+ padding: 16rpx 0;
274
+ color: #666666;
275
+ font-size: 24rpx;
276
+ flex: 0 0 calc((100% - 3 * 24rpx) / 4); /* flex-grow: 0, flex-shrink: 0, flex-basis: ... */
277
+ box-sizing: border-box;
278
+ /* 强制文本在一行内显示 */
279
+ white-space: nowrap;
280
+ /* 超出容器部分隐藏 */
281
+ overflow: hidden;
282
+ /* 用省略号表示超出部分 */
283
+ text-overflow: ellipsis;
284
+ }
285
+
286
+ .letter-index {
287
+ width: 60rpx;
288
+ display: flex;
289
+ flex-direction: column;
290
+ align-items: baseline;
291
+ justify-content: flex-start;
292
+ background-color: transparent;
293
+ padding-right: 10rpx;
294
+ position: fixed;
295
+ right: -20rpx;
296
+ }
297
+
298
+ .letter-item {
299
+ width: 35rpx;
300
+ height: 35rpx;
301
+ line-height: 35rpx;
302
+ text-align: center;
303
+ font-size: 20rpx;
304
+ color: #333;
305
+ border-radius: 50%;
306
+ }
307
+ </style>
@@ -0,0 +1,26 @@
1
+ 'use strict';
2
+ import {
3
+ dataVal,
4
+ statusDataVal,
5
+ statusShow
6
+ } from "@/utils/AttrTools";
7
+ export default (data, gValue, gColor, oldData = {}) => {
8
+ return [
9
+ {
10
+ label: '订单详情',
11
+ ele: 'xd-select-pages-path',
12
+ labelInline: true,
13
+ valueKey: 'order_detail_path',
14
+ placeholder: '请选择订单详情页面',
15
+ className: 'input100',
16
+ value: dataVal({ data, key: 'order_detail_path', dValue: null, gValue }),
17
+ groupKey: 'advanced',
18
+ inline: false,
19
+ setting: {
20
+ mode: 'new',
21
+ router: XdBus.getParentApi('getPagesTree'),
22
+ },
23
+ },
24
+ ].filter(i => i)
25
+ }
26
+
@@ -0,0 +1,9 @@
1
+ 'use strict';
2
+
3
+ import { customVal, dataVal } from "@/utils/AttrTools";
4
+
5
+ export default (data, gValue, gColor, oldData = {}) => {
6
+ return [
7
+ ].filter(i => i)
8
+ }
9
+
@@ -0,0 +1,11 @@
1
+ 'use strict';
2
+ import {
3
+ dataVal,
4
+ statusShow,
5
+ statusDataVal,
6
+ } from "@/utils/AttrTools";
7
+
8
+ export default function (data, gValue, gColor, oldData) {
9
+ return [].filter(i => i)
10
+ }
11
+
@@ -0,0 +1,125 @@
1
+ 'use strict';
2
+ /**
3
+ * @description 接口配置,
4
+ * 在设置方法名字当时候,别忘记加上【模块名字】:Order
5
+ * @type {*[]}
6
+ */
7
+ module.exports = [
8
+ {
9
+ mapFnName: 'getListOrderNewsContent', //自定义方法名字(必选)
10
+ title: '获取内容',
11
+ path: '/cms/v1/news-content',
12
+ isRule: false,
13
+ params: {
14
+ scene: ['使用场景', 'String', '选填'],
15
+ container_id: ['插件ID', 'String', '必填'],
16
+ page_id: ['页面ID', 'String', '必填'],
17
+ page_size: ['记录条数', 'Number', '必填', 1],
18
+ code: ['业务线id', 'String', '选填'],
19
+ },
20
+ isConsole: true,
21
+ disabled: true,
22
+ },
23
+ {
24
+ mapFnName: 'getTakeorderOrderDetail', //自定义方法名字(必选)
25
+ title: '获取内容',
26
+ path: '/takeorder/v1/order/:order_id',
27
+ isRule: false,
28
+ params: {
29
+ order_id: ['订单ID', 'String', '必填'],
30
+ },
31
+ isConsole: true,
32
+ disabled: true,
33
+ },
34
+ {
35
+ mapFnName: 'createQuotation', //自定义方法名字(必选)
36
+ title: '报价创建',
37
+ path: '/takeorder/v1/quotation/:order_id/create',
38
+ isRule: false,
39
+ data: {
40
+ order_id: ['订单ID', 'String', '必填'],
41
+ },
42
+ isConsole: true,
43
+ disabled: true,
44
+ },
45
+ {
46
+ mapFnName: 'cancelQuotation', //自定义方法名字(必选)
47
+ title: '报价取消',
48
+ path: '/takeorder/v1/quotation/:order_id/cancel',
49
+ isRule: false,
50
+ data: {
51
+ order_id: ['订单ID', 'String', '必填'],
52
+ amount: ['报价金额', 'Number', '必填'],
53
+ },
54
+ isConsole: true,
55
+ disabled: true,
56
+ },
57
+ {
58
+ mapFnName: 'updateQuotation', //自定义方法名字(必选)
59
+ title: '报价修改',
60
+ path: '/takeorder/v1/quotation/:order_id/update',
61
+ isRule: false,
62
+ data: {
63
+ order_id: ['订单ID', 'String', '必填'],
64
+ amount: ['报价金额', 'Number', '必填'],
65
+ },
66
+ isConsole: true,
67
+ disabled: true,
68
+ },
69
+ {
70
+ mapFnName: 'discardOrder', //自定义方法名字(必选)
71
+ title: '放弃订单',
72
+ path: '/takeorder/v1/order/:order_id/discard',
73
+ isRule: false,
74
+ data: {
75
+ order_id: ['订单ID', 'String', '必填'],
76
+ },
77
+ isConsole: true,
78
+ disabled: true,
79
+ },
80
+ {
81
+ mapFnName: 'acceptOrder', //自定义方法名字(必选)
82
+ title: '接受订单',
83
+ path: '/takeorder/v1/order/:order_id/receive',
84
+ isRule: false,
85
+ data: {
86
+ order_id: ['订单ID', 'String', '必填'],
87
+ },
88
+ isConsole: true,
89
+ disabled: true,
90
+ },
91
+ {
92
+ mapFnName: 'reportOrder', //自定义方法名字(必选)
93
+ title: '上报订单',
94
+ path: '/takeorder/v1/order/:order_id/report',
95
+ isRule: false,
96
+ data: {
97
+ order_id: ['订单ID', 'String', '必填'],
98
+ report_voucher_list: ['上报凭证列表', 'Array', '必填'],
99
+ },
100
+ isConsole: true,
101
+ disabled: true,
102
+ },
103
+ {
104
+ mapFnName: 'imageRecognition', //自定义方法名字(必选)
105
+ title: '图像识别',
106
+ path: '/takeorder/v1/image/recognition',
107
+ isRule: false,
108
+ data: {
109
+ image_url: ['图片URL', 'String', '必填'],
110
+ },
111
+ isConsole: true,
112
+ disabled: true,
113
+ },
114
+ {
115
+ mapFnName: 'getImagePreview', //自定义方法名字(必选)
116
+ title: '获取图片预览',
117
+ path: '/takeorder/v1/image/preview',
118
+ isRule: false,
119
+ data: {
120
+ image_url: ['图片URL', 'String', '必填'],
121
+ },
122
+ isConsole: true,
123
+ disabled: true,
124
+ },
125
+ ];
@@ -0,0 +1,16 @@
1
+ 'use strict';
2
+ import Style from './cusAttr/style'
3
+ import Advanced from './cusAttr/advanced'
4
+ import Content from './cusAttr/content'
5
+
6
+ export default {
7
+ style: [],
8
+ content: (data, gValue, gColor, oldData) => {
9
+ return [
10
+ ...Content(data, gValue, gColor, oldData),
11
+ ...Style(data, gValue, gColor, oldData),
12
+ ...Advanced(data, gValue, gColor, oldData),
13
+ ].filter(i => i)
14
+ },
15
+ advanced: [],
16
+ }