jufubao-takeorder 1.0.2-beta3 → 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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jufubao-takeorder",
3
- "version": "1.0.2-beta3",
3
+ "version": "1.0.2-beta4",
4
4
  "private": false,
5
5
  "description": "聚福宝业务组件基础插件包",
6
6
  "main": "index.js",
@@ -6,43 +6,7 @@
6
6
  export default {
7
7
  style: [],
8
8
  content: (data) => {
9
- return [
10
- {
11
- label: '背景颜色:',
12
- ele: 'xd-color',
13
- valueKey: 'bgColor',
14
- value: data.bgColor || '',
15
- placeholder: '请输入占位框背景颜色',
16
- groupKey:'content',
17
- },
18
- {
19
- label: '选中路径:',
20
- groupKey:'advanced',
21
- className: 'input100',
22
- ele: 'xd-select-pages-path',
23
- valueKey: 'select-pages-path',
24
- value: data['select-pages-path'] || null,
25
- setting: {
26
- router: XdBus.getParentApi('getPagesTree')
27
- },
28
- },
29
- data.bgColor && {
30
- label: '高度:',
31
- ele: 'el-input',
32
- groupKey:'style',
33
- type: 'number',
34
- valueKey: 'height',
35
- value: data.height || 100,
36
- placeholder: '请输入占位框高度,单位像素,默认:10px',
37
- className: 'input60',
38
- },
39
- {
40
- label: '', //label
41
- groupKey:'advanced',
42
- ele: 'slot', //package 名称
43
- slot: 'is_reference',
44
- },
45
- ].filter(i=>i)
9
+ return [].filter(i=>i)
46
10
  },
47
11
  advanced: [],
48
12
  };
@@ -16,7 +16,27 @@
16
16
  </view>
17
17
  <!-- #endif -->
18
18
  <view class="jfb-takeorder-filter-order-list__body">
19
- <view>测试插件( {{containerId}} )</view>
19
+ <view class="fixed_top" :style="{top: (layoutInfo.top - 2)+'rpx'}">
20
+ <xd-tab
21
+ v-if="initStatus"
22
+ :tabIndex="tabIndex"
23
+ :list="tabList"
24
+ show-footer-line
25
+ fontSize="28"
26
+ actFontSize="28"
27
+ @onTab="handleChange"
28
+ ></xd-tab>
29
+ </view>
30
+ <view style="height: 100rpx;"></view>
31
+ <view v-for="(item, index) in orderList" :key="index">
32
+ <Order
33
+ :item="item"
34
+ :mainColor="mainColor"
35
+ :isNeedCutDown="false"
36
+ @expire="handleOrderExpire"
37
+ @btnEvent="handleBtnEvent"
38
+ ></Order>
39
+ </view>
20
40
  </view>
21
41
  </view>
22
42
  </template>
@@ -27,18 +47,70 @@
27
47
  import JfbTakeorderFilterOrderListMixin from "./JfbTakeorderFilterOrderListMixin";
28
48
  import { getContainerPropsValue } from "@/utils/xd.base";
29
49
  import componentsMixins from "@/mixins/componentsMixins";
50
+ import XdTab from "@/components/XdTab/XdTab";
30
51
  import extsMixins from "@/mixins/extsMixins";
52
+ import Order from "./components/order.vue";
31
53
  export default {
32
54
  name: "JfbTakeorderFilterOrderList",
33
55
  components: {
34
- XdFontIcon
56
+ XdFontIcon,
57
+ XdTab,
58
+ Order
35
59
  },
36
60
  mixins: [
37
61
  componentsMixins, extsMixins, JfbTakeorderFilterOrderListMixin
38
62
  ],
39
63
  data() {
40
64
  return {
41
-
65
+ initStatus: false,
66
+ tabIndex: 0,
67
+ tabList: [
68
+ {"name": "全部", "value": 'all'},
69
+ { "name": "待上报", "value": 'wait_report' },
70
+ { "name": "待结算", "value": 'wait_settle' },
71
+ {"name": "已完成", "value": 'com'},
72
+ { "name": "纠纷中", "value": 'dispute' },
73
+ ],
74
+ page_size: 10,
75
+ page_token: 1,
76
+ hasNext: true,
77
+ orderList: [
78
+ {
79
+ id: 1,
80
+ num: 15,
81
+ people: 30,
82
+ remainingTime: 10,
83
+ shop_name: "味多美(北京西单大悦城店)",
84
+ brand_name: "味多美",
85
+ city: "北京市",
86
+ products: [
87
+ {
88
+ product_thumb:
89
+ "https://img.js.design/assets/img/68b554c9c3a1ea02642d7d2f.png#afa2b9b9d50bcd2f1394619ecc488a99",
90
+ product_name:
91
+ "贝欧宝 BIOBOR贝欧宝维生素C+叶黄素酯软糖118g多重营养3D小熊造型糖果Q弹维生素C+叶黄素酯软糖",
92
+ product_sku: "118g",
93
+ minPrice: 132,
94
+ maxPrice: 1232,
95
+ num: 15,
96
+ },
97
+ {
98
+ product_thumb:
99
+ "https://img.js.design/assets/img/68b554c9c3a1ea02642d7d2f.png#afa2b9b9d50bcd2f1394619ecc488a99",
100
+ product_name:
101
+ "贝欧宝 BIOBOR贝欧宝维生素C+叶黄素酯软糖118g多重营养3D小熊造型糖果Q弹维生素C+叶黄素酯软糖",
102
+ product_sku: "450g",
103
+ minPrice: 456,
104
+ maxPrice: 1546,
105
+ num: 16,
106
+ },
107
+ ],
108
+ market_price: 4000,
109
+ minPrice: 456,
110
+ maxPrice: 1546,
111
+ order_status: 1,
112
+ },
113
+ ],
42
114
  //todo
43
115
  }
44
116
  },
@@ -55,16 +127,15 @@
55
127
  },
56
128
  methods: {
57
129
  onJfbLoad(options) {
58
-
59
- // jfbRootExec('baiduUserLogin', {
60
-
61
- // vm: this,// data: {
62
-
63
- // account: 'gaoshiyong',// password: '123456789',// type: 3,// ...options
64
-
65
- // }
66
-
67
- // }).then().catch()
130
+ let status = options.status || options.type;
131
+ //地址栏设置值
132
+ if (status) {
133
+ this.tabIndex = this.tabList.findIndex((item) => {
134
+ return item.status === status;
135
+ });
136
+ }
137
+ this.initStatus = true;
138
+ this.getList(status);
68
139
  },
69
140
  /**
70
141
  * @description 监听事件变化
@@ -76,6 +147,25 @@
76
147
 
77
148
  //this.height = getContainerPropsValue(container, 'content.height', 10);
78
149
  },
150
+ getList(status) {
151
+
152
+ },
153
+ handleChange(item, index) {
154
+ if (index === this.tabIndex) return;
155
+ this.tabIndex = index;
156
+ this.page_token = 1;
157
+ this.hasNext = true;
158
+ this.getList(item);
159
+ // #ifdef H5
160
+ let params = this.$xdUniHelper.parseURL().params;
161
+ params["type"] = item.status;
162
+ history.replaceState(
163
+ null,
164
+ null,
165
+ `?${this.$xdUniHelper.jsonToParams(params)}`
166
+ );
167
+ // #endif
168
+ },
79
169
  onJfbScroll(options) {
80
170
  console.log('event.onJfbScroll', options)
81
171
  },
@@ -107,7 +197,14 @@
107
197
 
108
198
  .jfb-takeorder-filter-order-list {
109
199
  &__body{
110
-
200
+ .fixed_top{
201
+ position: fixed;
202
+ top: 0;
203
+ left: 0;
204
+ width: 100%;
205
+ background: #FFFFFF;
206
+ z-index: 999;
207
+ }
111
208
  }
112
209
  }
113
210
  </style>
@@ -0,0 +1,277 @@
1
+ <template>
2
+ <view class="order-wrap">
3
+ <view v-if="isNeedCutDown" :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
+ isNeedCutDown: {
97
+ type: Boolean,
98
+ default: true,
99
+ }
100
+ },
101
+ computed: {},
102
+ watch: {
103
+ // 当父组件更新了 order.status 时,停止倒计时
104
+ 'item.status'(newVal) {
105
+ if (newVal !== 'pending') {
106
+ this.clearCountdownTimer();
107
+ this.isUpdating = false; // 重置更新状态
108
+ }
109
+ },
110
+ // 当父组件更新了 order.remainingTime 时(例如页面重新显示时的校准),重启倒计时
111
+ 'item.remainingTime'(newVal) {
112
+ if (this.item.status === 'pending' && newVal > 0) {
113
+ this.startCountdown();
114
+ }
115
+ }
116
+ },
117
+ created() {
118
+ // 组件创建时,如果是待支付状态,就启动倒计时
119
+ if (this.item.remainingTime > 0&&this.isNeedCutDown) {
120
+ this.startCountdown();
121
+ }
122
+ },
123
+ destroyed() {
124
+ // 组件销毁时,清理定时器
125
+ this.clearCountdownTimer();
126
+ },
127
+ methods: {
128
+ formatCountdown(seconds) {
129
+ const mins = Math.floor(seconds / 60);
130
+ const secs = seconds % 60;
131
+ return `${mins.toString().padStart(2, "0")}:${secs
132
+ .toString()
133
+ .padStart(2, "0")}`;
134
+ },
135
+ // 数字补零(小于10补前导零)
136
+ padZero(num) {
137
+ return num < 10 ? `0${num}` : num;
138
+ },
139
+ startCountdown() {
140
+ this.clearCountdownTimer();
141
+ this.countdownTimer = setInterval(() => {
142
+ // 这里我们不直接修改 props,而是在倒计时结束时通知父组件
143
+ if (this.item.remainingTime <= 1) {
144
+ // 当倒计时即将结束时
145
+ this.clearCountdownTimer();
146
+ this.isUpdating = true; // 显示“更新中”状态
147
+ this.$emit("expire", this.item.id); // 通知父组件:我过期了!
148
+ } else {
149
+ // 为了UI流畅,可以在这里更新本地倒计时显示,但最终数据以父组件为准
150
+ // 注意:这是一个小技巧,避免每秒都向父组件发送事件
151
+ this.$set(this.item, "remainingTime", this.item.remainingTime - 1);
152
+ }
153
+ }, 1000);
154
+ },
155
+ clearCountdownTimer() {
156
+ if (this.countdownTimer) {
157
+ clearInterval(this.countdownTimer);
158
+ this.countdownTimer = null;
159
+ }
160
+ },
161
+ handleClick() {
162
+ this.$emit("btnEvent", this.item);
163
+ },
164
+ },
165
+ };
166
+ </script>
167
+
168
+ <style lang="less" scoped>
169
+ .order {
170
+ &-wrap {
171
+ background: #fff;
172
+ color: #333;
173
+ margin: 16rpx;
174
+ border-radius: 20rpx;
175
+ }
176
+ &-time {
177
+ color: #fff;
178
+ font-size: 24rpx;
179
+ padding: 20rpx 0;
180
+ border-radius: 20rpx 20rpx 0 0;
181
+ display: flex;
182
+ align-items: center;
183
+ }
184
+ &-title {
185
+ display: flex;
186
+ justify-content: space-between;
187
+ padding: 24rpx 32rpx;
188
+ border-bottom: 1px solid #f4f4f4;
189
+ &-left {
190
+ display: flex;
191
+ align-items: center;
192
+ }
193
+ &-right {
194
+ font-weight: 500;
195
+ }
196
+ }
197
+ &-product {
198
+ display: flex;
199
+ padding: 16rpx 32rpx;
200
+ border-bottom: 1px solid #f4f4f4;
201
+ & > image {
202
+ width: 180rpx;
203
+ height: 180rpx;
204
+ flex-shrink: 0;
205
+ border: 10rpx;
206
+ }
207
+ &-info {
208
+ margin-left: 24rpx;
209
+ &-name {
210
+ .uni-max-cut(2,80);
211
+ margin-bottom: 10rpx;
212
+ }
213
+ &-sku {
214
+ font-size: 24rpx;
215
+ color: #999;
216
+ }
217
+ &-price {
218
+ margin-top: 10rpx;
219
+ display: flex;
220
+ justify-content: space-between;
221
+ align-items: center;
222
+ &-left {
223
+ color: #ff2c18;
224
+ font-size: 32rpx;
225
+ font-weight: 500;
226
+ & > text {
227
+ font-size: 24rpx;
228
+ margin-right: 10rpx;
229
+ }
230
+ .range {
231
+ margin: 0 10rpx;
232
+ }
233
+ }
234
+ &-right {
235
+ color: #999;
236
+ display: flex;
237
+ align-items: baseline;
238
+ & > view {
239
+ margin-left: 10rpx;
240
+ }
241
+ }
242
+ }
243
+ }
244
+ }
245
+ &-price {
246
+ display: flex;
247
+ justify-content: space-between;
248
+ align-items: center;
249
+ padding: 24rpx 32rpx;
250
+ border-radius: 0 0 20rpx 20rpx;
251
+ &-left {
252
+ &-market {
253
+ font-size: 24rpx;
254
+ color: #999;
255
+ margin-bottom: 10rpx;
256
+ }
257
+ &-settle {
258
+ font-size: 24rpx;
259
+ display: flex;
260
+ align-items: center;
261
+ & > view {
262
+ color: #ff2c18;
263
+ font-size: 32rpx;
264
+ font-weight: 500;
265
+ & > text {
266
+ font-size: 24rpx;
267
+ margin-right: 10rpx;
268
+ }
269
+ .range {
270
+ margin: 0 10rpx;
271
+ }
272
+ }
273
+ }
274
+ }
275
+ }
276
+ }
277
+ </style>
@@ -6,51 +6,16 @@
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: 'getListOrderNewsContent', //自定义方法名字(必选)
10
+ title: '获取内容',
11
+ path: '/cms/v1/news-content',
13
12
  isRule: false,
14
13
  params: {
15
- last_key: ['当前页', 'Number', '必选'],
16
- page_size: ['每页数量', 'Number', '必选'],
17
- },
18
- isConsole: true,
19
- disabled: true,
20
- },
21
- {
22
- //设置方法名字当别忘记加上【模块名字】:Order
23
- mapFnName: 'updateOrderFilmPaiqiDate',
24
- title: '更新排期',
25
- path: '/api/account/film/paiqi-date',
26
- isRule: false,
27
- params: {
28
- film_id: ['电影id', 'Number', '必选'],
29
- cinema_id: ['影院id', 'Number', '必选'],
30
- },
31
- isConsole: true,
32
- disabled: true,
33
- },
34
- {
35
- //设置方法名字当别忘记加上【模块名字】:Order
36
- mapFnName: 'removeOrderFilmAddress',
37
- title: '删除我的配送地址',
38
- path: '/api/account/film/paiqi-date',
39
- 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', '必选'],
14
+ scene: ['使用场景', 'String', '选填'],
15
+ container_id: ['插件ID', 'String', '必填'],
16
+ page_id: ['页面ID', 'String', '必填'],
17
+ page_size: ['记录条数', 'Number', '必填', 1],
18
+ code: ['业务线id', 'String', '选填'],
54
19
  },
55
20
  isConsole: true,
56
21
  disabled: true,
@@ -1,48 +1,16 @@
1
1
  'use strict';
2
+ import Style from './cusAttr/style'
3
+ import Advanced from './cusAttr/advanced'
4
+ import Content from './cusAttr/content'
2
5
 
3
- /**
4
- * @description 当表单组件中有联动操作时候,使用方法进行返回
5
- */
6
6
  export default {
7
7
  style: [],
8
- content: (data) => {
8
+ content: (data, gValue, gColor, oldData) => {
9
9
  return [
10
- {
11
- label: '背景颜色:',
12
- ele: 'xd-color',
13
- valueKey: 'bgColor',
14
- value: data.bgColor || '',
15
- placeholder: '请输入占位框背景颜色',
16
- groupKey:'content',
17
- },
18
- {
19
- label: '选中路径:',
20
- groupKey:'advanced',
21
- className: 'input100',
22
- ele: 'xd-select-pages-path',
23
- valueKey: 'select-pages-path',
24
- value: data['select-pages-path'] || null,
25
- setting: {
26
- router: XdBus.getParentApi('getPagesTree')
27
- },
28
- },
29
- data.bgColor && {
30
- label: '高度:',
31
- ele: 'el-input',
32
- groupKey:'style',
33
- type: 'number',
34
- valueKey: 'height',
35
- value: data.height || 100,
36
- placeholder: '请输入占位框高度,单位像素,默认:10px',
37
- className: 'input60',
38
- },
39
- {
40
- label: '', //label
41
- groupKey:'advanced',
42
- ele: 'slot', //package 名称
43
- slot: 'is_reference',
44
- },
45
- ].filter(i=>i)
10
+ ...Content(data, gValue, gColor, oldData),
11
+ ...Style(data, gValue, gColor, oldData),
12
+ ...Advanced(data, gValue, gColor, oldData),
13
+ ].filter(i => i)
46
14
  },
47
15
  advanced: [],
48
- };
16
+ }