jufubao-base 1.0.197 → 1.0.199

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.
@@ -13,25 +13,29 @@
13
13
  <view class="jfb-base-user-order__edit-icon" @click="delEdit">删除</view>
14
14
  </view>
15
15
  <!-- #endif -->
16
- <view
17
- v-if="list.length > 0"
18
- class="jfb-base-user-order__body"
19
- :style="{ padding: outMargin}"
20
- >
21
- <view :style="{borderRadius: bodyRadius + 'rpx', backgroundColor:bodyBackgroundColor, padding:outPadding}">
22
- <view class="my-order__add">
23
- <view :style="{color:cardNameColor}">我的订单</view>
24
- <view @click="handleToLink(afterUrl)" :style="{borderColor:subColor || mainColor,color: subColor || mainColor}">售后订单</view>
16
+ <view class="jfb-base-user-order__body">
17
+ <view class="x-line"></view>
18
+ <view :style="[bodyStyleComp]" v-if="list.length > 0">
19
+ <view class="my-order__add" :style="[titleMarginComp]">
20
+ <view :style="[titleStyleComp]">{{myOrderName}}</view>
21
+ <view
22
+ v-if="isShowBtn === 'Y'"
23
+ @click="handleToLink(afterUrl)"
24
+ :style="[addBtnStyleComp]"
25
+ class="afterBuy"
26
+ >
27
+ <text>{{afterBuyName}}</text>
28
+ <view v-if="isShowICONBtn === 'Y'">
29
+ <xd-font-icon
30
+ icon="iconxiangyou_xian"
31
+ :color="addBtnStyleComp.color"
32
+ :size="20"
33
+ ></xd-font-icon>
34
+ </view>
35
+
36
+ </view>
25
37
  </view>
26
- <view
27
- class="my-order__content"
28
- :style="{
29
- borderRadius: radius + 'rpx',
30
- background: backgroundColor,
31
- marginTop: spacing + 'rpx',
32
- border: borderBox,
33
- }"
34
- >
38
+ <view class="my-order__content" :style="[contStyleComp]">
35
39
  <view class="my-order__content-type">
36
40
  <view
37
41
  class="my-order__content-type-item"
@@ -40,14 +44,16 @@
40
44
  @click="handleToLink(orderListUrl, item.status)"
41
45
  >
42
46
  <view class="my-order__content-type-item-icon">
47
+ <image v-if="item.image" :src="item.image"></image>
43
48
  <xd-font-icon
49
+ v-else
44
50
  :icon="item.icon"
45
51
  :color="iconColor"
46
52
  :size="item.size"
47
53
  ></xd-font-icon>
48
54
  <view
49
55
  v-if="item.num"
50
- :style="{backgroundColor: iconColor}"
56
+ :style="[popComp]"
51
57
  class="my-order__content-type-item-number"
52
58
  >{{item.num}}</view>
53
59
  </view>
@@ -67,6 +73,7 @@
67
73
  import componentsMixins from "@/mixins/componentsMixins";
68
74
  import extsMixins from "@/mixins/extsMixins"
69
75
  import { getContainerPropsValue } from "@/utils/xd.base";
76
+ import getServiceUrl from "@/common/getServiceUrl";
70
77
  export default {
71
78
  name: "JfbBaseUserOrder",
72
79
  components: {
@@ -74,23 +81,81 @@
74
81
  },
75
82
  mixins: [componentsMixins,extsMixins,JfbBaseUserOrderMixin],
76
83
  computed: {
77
- outPadding() {
78
- let str = `${this.checkValue(this.bodyPadding.top, 0)}rpx`;
79
- str = `${str} ${this.checkValue(this.bodyPadding.right, 0)}rpx`;
80
- str = `${str} ${this.checkValue(this.bodyPadding.bottom, 0)}rpx`;
81
- str = `${str} ${this.checkValue(this.bodyPadding.left, 0)}rpx`;
82
- return str
84
+ titleMarginComp(){
85
+ return {
86
+ padding: this.getMarginAndPadding(this.titleMargin, 0)
87
+ }
88
+ },
89
+ titleStyleComp(){
90
+ return {
91
+ fontSize: this.titleStyle.fontSize || '28rpx',
92
+ color: `${this.titleStyle.color || this.cardNameColor ||'#333'}`,
93
+ fontWeight: `${this.titleStyle.fontWeight || 'normal'}`,
94
+ }
83
95
  },
84
- outMargin() {
85
- let str = `${this.checkValue(this.bodyMargin.top, 20)}rpx`;
86
- str = `${str} ${this.checkValue(this.bodyMargin.right, 20)}rpx`;
87
- str = `${str} ${this.checkValue(this.bodyMargin.bottom, 20)}rpx`;
88
- str = `${str} ${this.checkValue(this.bodyMargin.left, 20)}rpx`;
89
- return str
96
+ bodyStyleComp(){
97
+ return {
98
+ margin: this.getMarginAndPadding(this.bodyMargin, 20),
99
+ padding: this.getMarginAndPadding(this.bodyPadding, 0),
100
+ borderRadius: this.bodyRadius + 'rpx',
101
+ backgroundColor: this.bodyBackgroundColor,
102
+ }
103
+ },
104
+ addBtnStyleComp(){
105
+ let border = {};
106
+ if(this.addBtnBorder && this.addBtnBorder.type === 'Y') {
107
+ let value = this.addBtnBorder.value ||{};
108
+ if(value.width) border['borderWidth'] = value.width + 'rpx';
109
+ if(value.color) border['borderColor'] = value.color;
110
+ if(value.style) border['borderStyle'] = value.style;
111
+ }
112
+ if(this.addBtnBorder && this.addBtnBorder.type === 'N') {
113
+ border['borderWidth'] = 0;
114
+ border['borderColor'] = '';
115
+ border['borderStyle'] = ''
116
+ }
117
+ let addBtnShadow = {};
118
+ if(this.addBtnShadow && this.addBtnShadow.type === 'Y') {
119
+ let value = this.addBtnShadow.value || {};
120
+ if(value.color && value.width) {
121
+ addBtnShadow['boxShadow'] = `0 0 ${value.width}rpx ${value.color}`
122
+ }
123
+ }
124
+ return {
125
+ color: this.addBtnStyle.color || this.mainColor,
126
+ fontSize: this.addBtnStyle.fontSize || '26rpx',
127
+ fontWeight: this.addBtnStyle.fontWeight || 'normal',
128
+ borderColor: this.mainColor,
129
+ borderWidth: '2rpx',
130
+ borderStyle:'solid',
131
+ backgroundColor: this.addBtnBgColor || 'rgba(0,0,0,0)',
132
+ borderRadius:this.addBtnRadius + 'rpx',
133
+ ...border,
134
+ ...addBtnShadow
135
+ }
90
136
  },
91
- borderBox() {
92
- if (this.is_border === 'Y') return `${this.is_border_w}rpx solid ${this.is_border_c}`;
93
- else return '0';
137
+ popComp(){
138
+ return {
139
+ backgroundColor: this.popBgColor,
140
+ color: this.popColor || '#f00',
141
+ }
142
+ },
143
+ contStyleComp(){
144
+ let border = this.getBorderCompatibleOldStyle(this.contBorder, {
145
+ color: this.is_border_c,
146
+ width: this.is_border_w,
147
+ type: this.is_border,
148
+ style: 'solid'
149
+ })
150
+
151
+ return {
152
+ borderRadius: this.radius + 'rpx',
153
+ backgroundColor: this.backgroundColor,
154
+ marginTop: this.spacing + 'rpx',
155
+ border: border,
156
+ boxShadow: this.contShadow,
157
+ padding: this.getMarginAndPadding(this.contPadding,{top:40, bottom: 34, left: 20, right: 20})
158
+ }
94
159
  }
95
160
  },
96
161
  data() {
@@ -98,14 +163,43 @@
98
163
  options: {},
99
164
  list: [],
100
165
 
101
- //基础
166
+ //整体
167
+ bodyPadding: {},
168
+ bodyRadius: 0,
169
+ bodyBackgroundColor: 'rgba(0,0,0,0)',
170
+ bodyMargin: { },
171
+ spacing:20,
172
+
173
+ //内容列表
102
174
  color: '#333',
103
- backgroundColor: 'rgba(0,0,0,0)',
104
- radius: 0,
105
175
  iconColor: '',
106
- spacing:20,
107
176
 
108
- //边框
177
+ //我的标题
178
+ myOrderName: '我的订单',
179
+ cardNameColor: '#333',
180
+ titleStyle: {},
181
+ titleMargin:{},
182
+
183
+ //售后订单
184
+ isShowBtn:'Y',
185
+ afterBuyName:'售后订单',
186
+ addBtnBgColor:'rgba(0,0,0,0)',
187
+ addBtnStyle:{},
188
+ addBtnBorder:{},
189
+ addBtnShadow:{},
190
+ addBtnRadius: '40',
191
+ isShowICONBtn:'N',
192
+
193
+ //数字气泡
194
+ popColor:'#fff',
195
+ popBgColor:'#f00',
196
+
197
+ //content
198
+ backgroundColor: 'rgba(0,0,0,0)',
199
+ radius: 0,
200
+ contPadding:{},
201
+ contShadow:{},
202
+ contBorder:{},
109
203
  is_border: 'Y',
110
204
  is_border_w: 0,
111
205
  is_border_c: '',
@@ -114,13 +208,6 @@
114
208
  afterUrl: null,
115
209
  orderListUrl: null,
116
210
 
117
- //整体
118
- bodyPadding: {top: 20, left: 20, right: 20, bottom: 20},
119
- bodyRadius: 0,
120
- bodyBackgroundColor: 'rgba(0,0,0,0)',
121
- bodyMargin: {top: 0, left: 0, right: 0, bottom: 0},
122
- cardNameColor: '#333',
123
- subColor:'',
124
211
  }
125
212
  },
126
213
  watch: {
@@ -178,6 +265,25 @@
178
265
  * @param container {object} 业务组件对象自己
179
266
  */
180
267
  init(container) {
268
+ this.isShowBtn = getContainerPropsValue(container, 'content.isShowBtn', 'Y');
269
+ this.afterBuyName = getContainerPropsValue(container, 'content.afterBuyName', '售后订单');
270
+
271
+ //数字气泡
272
+ this.popColor = getContainerPropsValue(container, 'content.popColor', '#fff');
273
+ this.popBgColor = getContainerPropsValue(container, 'content.popBgColor', '#f00');
274
+
275
+
276
+ //标题
277
+ this.myOrderName = getContainerPropsValue(container, 'content.myOrderName', '我的订单')
278
+ this.titleStyle = getContainerPropsValue(container, 'content.titleStyle', {});
279
+ this.titleMargin = getContainerPropsValue(container,'content.titleMargin', {})
280
+
281
+ //添加按钮
282
+ this.addBtnBgColor = getContainerPropsValue(container, 'content.addBtnBgColor', 'rgba(0,0,0,0)');
283
+ this.addBtnStyle = getContainerPropsValue(container, 'content.addBtnStyle', {});
284
+ this.addBtnBorder = getContainerPropsValue(container, 'content.addBtnBorder', {});
285
+ this.addBtnRadius = getContainerPropsValue(container, 'content.addBtnRadius', '40');
286
+ this.addBtnShadow = getContainerPropsValue(container, 'content.addBtnShadow', {});
181
287
 
182
288
  //整体
183
289
  this.bodyMargin = getContainerPropsValue(container, 'content.bodyMargin', {top: 0, left: 0, right: 0, bottom: 0});
@@ -192,26 +298,33 @@
192
298
  this.afterUrl = getContainerPropsValue(container, 'content.after_url', {value: ''}).value;
193
299
  this.orderListUrl = getContainerPropsValue(container, 'content.order_url', {value: ''}).value;
194
300
  this.margin = getContainerPropsValue(container, 'content.margin', {top: 0, left: 0, right: 0, bottom: 0});
301
+ this.isShowICONBtn = getContainerPropsValue(container, 'content.isShowICONBtn', 'N')
195
302
 
196
303
  //基础
197
304
  this.radius = getContainerPropsValue(container, 'content.radius', 0);
198
- this.color = getContainerPropsValue(container, 'content.textColor', '#333');
199
- this.iconColor = getContainerPropsValue(container, 'content.iconColor', this.mainColor);
200
305
  this.backgroundColor = getContainerPropsValue(container, 'content.backgroundColor', '#f8f8f8');
201
-
202
- //边框
306
+ this.contPadding = getContainerPropsValue(container, 'content.contPadding', '{}')
307
+ this.contShadow = this.getXdShadow({width:20, color:'rgba(0,0,0,0)'},getContainerPropsValue(container, 'content.contShadow', {}))
308
+ this.contBorder = getContainerPropsValue(container, 'content.contBorder', {});
203
309
  this.is_border = getContainerPropsValue(container, 'content.is_border', 'N');
204
310
  this.is_border_c = getContainerPropsValue(container, 'content.is_border_c', '#f8f8f8');
205
311
  this.is_border_w = getContainerPropsValue(container, 'content.is_border_w', '2');
206
312
 
207
-
313
+ //内容列表
208
314
  this.list = getContainerPropsValue(container, 'content.orderTypeList', []).map(item=>{
315
+ let image = '';
316
+ if(this.$xdUniHelper.checkVarType(item.image) === 'object') {
317
+ image = getServiceUrl(item.image.url, 'size1');
318
+ }
209
319
  return {
210
320
  ...item,
321
+ image,
211
322
  size: Number(item.size ? item.size: 18) * 2,
212
323
  num: 0
213
324
  }
214
- })
325
+ });
326
+ this.color = getContainerPropsValue(container, 'content.textColor', '#333');
327
+ this.iconColor = getContainerPropsValue(container, 'content.iconColor', this.mainColor);
215
328
  },
216
329
 
217
330
  onJfbShow(options) {
@@ -219,6 +332,7 @@
219
332
  },
220
333
 
221
334
  handleToLink(path, type) {
335
+ if (this.$configProject['isPreview']) return;
222
336
  this.$xdUniHelper.navigateTo({
223
337
  url: type ? `${path}?type=${type}` : path
224
338
  })
@@ -234,7 +348,15 @@
234
348
 
235
349
  .jfb-base-user-order {
236
350
  &__body{
351
+ & .afterBuy {
352
+ display: flex;
353
+ justify-content: center;
354
+ align-items: center;
237
355
 
356
+ & > view {
357
+ margin-left: 10rpx;
358
+ }
359
+ }
238
360
  }
239
361
  }
240
362
 
@@ -244,6 +366,7 @@
244
366
  justify-content: space-between;
245
367
  align-items: center;
246
368
  font-size: unit(28, rpx);
369
+ min-height: 62rpx;
247
370
 
248
371
  & > view:nth-child(2) {
249
372
  width: unit(200, rpx);
@@ -255,12 +378,12 @@
255
378
  text-align: center;
256
379
  }
257
380
  }
381
+
258
382
  &__content {
259
383
  &-type {
260
384
  display: flex;
261
385
  justify-content: space-around;
262
386
  align-items: center;
263
- padding: unit(40, rpx) unit(20, rpx) unit(35, rpx);
264
387
 
265
388
  &-item {
266
389
  font-size: unit(24, rpx);
@@ -268,13 +391,18 @@
268
391
  flex: 1;
269
392
 
270
393
  &-icon {
271
- height: unit(40, rpx);
272
- width: unit(40, rpx);
394
+ height: unit(54, rpx);
395
+ width: unit(54, rpx);
273
396
  display: flex;
274
397
  justify-content: center;
275
398
  align-items: center;
276
399
  margin: 0 auto;
277
400
  position: relative;
401
+
402
+ & > image {
403
+ max-width: 100%;
404
+ max-height: 100%;
405
+ }
278
406
  }
279
407
 
280
408
  &-text {