jufubao-food 1.0.15-beta3 → 1.0.15-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-food",
3
- "version": "1.0.15-beta3",
3
+ "version": "1.0.15-beta4",
4
4
  "private": false,
5
5
  "description": "聚福宝业务组件餐饮插件包",
6
6
  "main": "index.js",
@@ -31,23 +31,25 @@
31
31
  </xd-swiper>
32
32
  <view class="xd-store-product__swiper-tips">{{swiperCurrent + 1}}/{{images.length}}</view>
33
33
  </view>
34
-
35
- <view class="prod_title_number">
36
- <view class="prod_title">{{ baseInfo.product_name }}</view>
37
- <view class="prod_number">
38
- <xd-number v-model="number" :min="1" :max="99" circle></xd-number>
34
+ <view :style="[contBodyStyleComp]">
35
+ <view class="prod_title_number">
36
+ <view class="prod_title">{{ baseInfo.product_name }}</view>
37
+ <view class="prod_number">
38
+ <xd-number v-model="number" :min="1" :max="99" circle></xd-number>
39
+ </view>
39
40
  </view>
40
- </view>
41
41
 
42
- <view v-if="skus.length" class="sku_wrap">
43
- <!-- <xd-sku @change="handleSkuChange"></xd-sku> -->
44
- <xd-sku :skus="skus" @change="handleSkuChange"></xd-sku>
45
- </view>
42
+ <view v-if="skus.length" class="sku_wrap">
43
+ <!-- <xd-sku @change="handleSkuChange"></xd-sku> -->
44
+ <xd-sku :skus="skus" @change="handleSkuChange"></xd-sku>
45
+ </view>
46
46
 
47
- <view v-if="spuList.length" class="attr_wrap">
48
- <!-- <xd-spu ref="mySpu" @change="handleSpuChange"></xd-spu> -->
49
- <xd-spu ref="mySpu" :list="spuList" @change="handleSpuChange"></xd-spu>
47
+ <view v-if="spuList.length" class="attr_wrap">
48
+ <!-- <xd-spu ref="mySpu" @change="handleSpuChange"></xd-spu> -->
49
+ <xd-spu ref="mySpu" :list="spuList" @change="handleSpuChange"></xd-spu>
50
+ </view>
50
51
  </view>
52
+
51
53
 
52
54
  <view style="height: 120rpx;"></view>
53
55
  <view class="fixed_bottom" :style="prod_bottom">
@@ -125,8 +127,10 @@
125
127
 
126
128
  is_plus_site: false,
127
129
  //面板
128
- isShowDiscount: "Y", //是否展示划线价
130
+ showDiscount: "Y", //是否展示划线价
129
131
  differ: 1, //原价与现价的差值
132
+ bodyPadding: "",
133
+ contentColor: "",
130
134
 
131
135
  shopBtnBgColor: "",
132
136
  bottomBtnRadius: "100",
@@ -150,6 +154,7 @@
150
154
  '--main-color': this.mainColor,
151
155
  '--bg-color': this.mainColorAlpha,
152
156
  '--bg-main-color': this.mainColorAlpha,
157
+ backgroundColor: this.contentColor
153
158
  }
154
159
  },
155
160
  prod_bottom() {
@@ -185,6 +190,11 @@
185
190
  item.p = p;
186
191
  return item;
187
192
  })
193
+ },
194
+ contBodyStyleComp(){
195
+ return {
196
+ padding: this.getMarginAndPadding(this.bodyPadding, 0)
197
+ }
188
198
  }
189
199
  },
190
200
  watch: {
@@ -214,6 +224,11 @@
214
224
  init(container) {
215
225
  this.foodProductListPath = getContainerPropsValue(container, 'content.foodProductListPath', {value: ""}).value;
216
226
  this.shopBtnBgColor = gCPVal(container, 'shopBtnBgColor', this.mainColor, {sKey:'cartBtnStatus',fields:['shopBtnBgColor']});
227
+ this.showDiscount = gCPVal(container, 'showDiscount', "Y");
228
+ this.differ = gCPVal(container, 'differ', 1);
229
+ this.bodyPadding = gCPVal(container, 'bodyPadding', [16], {sKey:'bodyPaddingStatus',fields:['bodyPadding'], isPMR:true});
230
+ this.contentColor = gCPVal(container,'contentColor', '#f8f8f8', {sKey:'contentColorStatus',fields:['contentColor']});
231
+ console.log("this.bodyPadding", this.bodyPadding)
217
232
  },
218
233
  handleSkuChange(sku){
219
234
  console.log('handleSkuChange', sku);
@@ -241,7 +256,7 @@
241
256
  category_id: this.category_id,
242
257
  consume_mode: this.consume_mode,
243
258
  shop_id: this.shop_id,
244
- is_show_uprice: this.isShowDiscount !== 'Y' ? 0 : this.multiply(this.differ),
259
+ is_show_uprice: this.showDiscount !== 'Y' ? 0 : this.multiply(this.differ),
245
260
  }
246
261
  }).then(res => {
247
262
  this.$xdHideLoading()
@@ -333,7 +348,6 @@
333
348
 
334
349
  .jfb-food-product-info {
335
350
  &__body{
336
- background-color: #f8f8f8;
337
351
  .xd-store-product {
338
352
  color: #333;
339
353
  &__swiper {
@@ -358,7 +372,7 @@
358
372
  .prod_title_number{
359
373
  background-color: #FFFFFF;
360
374
  padding: 24rpx 32rpx;
361
- margin: 20rpx;
375
+ margin: 20rpx 0;
362
376
  border-radius: 16rpx;
363
377
  display: flex;
364
378
  align-items: center;
@@ -378,13 +392,13 @@
378
392
  .sku_wrap{
379
393
  background-color: #FFFFFF;
380
394
  padding: 24rpx;
381
- margin: 16rpx;
395
+ margin: 16rpx 0;
382
396
  border-radius: 16rpx;
383
397
  }
384
398
  .attr_wrap{
385
399
  background-color: #FFFFFF;
386
400
  padding: 24rpx;
387
- margin: 16rpx;
401
+ margin: 16rpx 0;
388
402
  border-radius: 16rpx;
389
403
  }
390
404
  .fixed_bottom{
@@ -213,7 +213,7 @@ export default {
213
213
  margin-bottom: 20rpx;
214
214
  flex-wrap: wrap;
215
215
  &.img_list{
216
- justify-content: space-between;
216
+ // justify-content: space-between;
217
217
  }
218
218
 
219
219
  .specs_img_item{
@@ -229,6 +229,10 @@ export default {
229
229
  position: relative;
230
230
  margin-bottom: 16rpx;
231
231
  overflow: hidden;
232
+ margin-right: 16rpx;
233
+ &:nth-of-type(3n){
234
+ margin-right: 0;
235
+ }
232
236
 
233
237
  &.active{
234
238
  border-color: var(--main-color);
@@ -36,5 +36,40 @@ export default function (data, gValue,gColor,oldData){
36
36
  .catch();
37
37
  }
38
38
  },
39
+ {
40
+ ele: 'title',
41
+ label: '展示内容',
42
+ size: 'small',
43
+ groupKey:'content',
44
+ },
45
+ {
46
+ label: '划线价',
47
+ ele: 'xd-cus-switch',
48
+ valueKey: 'showDiscount',
49
+ value: dataVal({ data, key: 'showDiscount', dValue: 'Y', gValue }),
50
+ className: 'input100',
51
+ labelInline: true,
52
+ groupKey: 'content',
53
+ setting: {
54
+ tips: ['显示', '不显示'],
55
+ isBackType: 'string'
56
+ },
57
+ },
58
+ { ele: 'group_start' },
59
+ {
60
+ label: '差值',
61
+ ele: 'el-input',
62
+ type: 'number',
63
+ valueKey: 'differ',
64
+ labelInline: true,
65
+ value: dataVal({ data, key: 'differ', dValue: '', gValue }),
66
+ hidden: data.showDiscount !== 'Y',
67
+ groupKey: 'content',
68
+ placeholder: '价差,默认值:1',
69
+ className: 'input80',
70
+ notice: '划线价取市场价,市场价-售价差值大于等于设置值时展示',
71
+ inline: false
72
+ },
73
+ { ele: 'group_end' },
39
74
  ]
40
75
  }
@@ -21,11 +21,11 @@ export default function (data={},gValue={},gColor={},oldData) {
21
21
  groupKey:'style',
22
22
  },
23
23
  {
24
- label: '外边距',
24
+ label: '内容区边距',
25
25
  ele: 'xd-radio',
26
26
  groupKey: 'style',
27
27
  valueKey: 'bodyPaddingStatus',
28
- value: statusDataVal({data, key:'bodyPaddingStatus', fields:['bodyPadding'],gValue}),
28
+ value: statusDataVal({data, key:'bodyPaddingStatus', dValue: 'D', gValue}),
29
29
  labelInline:true,
30
30
  list: [
31
31
  {label: '默认', value: 'D'},
@@ -42,7 +42,7 @@ export default function (data={},gValue={},gColor={},oldData) {
42
42
  value: dataVal({
43
43
  data,
44
44
  key:'bodyPadding',
45
- dValue:[0],
45
+ dValue:[16],
46
46
  gValue,
47
47
  isPM: true,
48
48
  isCPM: true,
@@ -52,5 +52,34 @@ export default function (data={},gValue={},gColor={},oldData) {
52
52
  },
53
53
  },
54
54
  {ele: 'group_end'},
55
+
56
+ {
57
+ label: '背景色',
58
+ ele: 'xd-radio',
59
+ groupKey: 'style',
60
+ valueKey: 'contentColorStatus',
61
+ value: statusDataVal({data, key: 'contentColorStatus', fields:['contentColor'], gValue}),
62
+ labelInline:true,
63
+ list: [
64
+ {label: '默认', value: 'D'},
65
+ {label: '自定义', value: 'C'},
66
+ ]
67
+ },
68
+ {ele: 'group_start'},
69
+ {
70
+ label: '',
71
+ ele: 'xd-color',
72
+ groupKey:'style',
73
+ valueKey: 'contentColor',
74
+ value: dataVal({data, key:'contentColor', dValue: '#f8f8f8', gValue}),
75
+ hidden: !statusShow({data, key: 'contentColorStatus', fields:['contentColor'], gValue}),
76
+ placeholder: '请选择背景颜色',
77
+ classNmae: 'input80',
78
+ setting: {
79
+ showAlpha: true
80
+ },
81
+ inline: false,
82
+ },
83
+ {ele: 'group_end'},
55
84
  ]
56
85
  }
@@ -43,6 +43,7 @@
43
43
  >
44
44
  {{ item.category_name }}
45
45
  <view v-if="item.cart_num" class="cate_num">{{ item.cart_num }}</view>
46
+ <view v-if="index === cateIndex" :style="[navActiveBarStyle]" class="nav_active_bar"></view>
46
47
  </view>
47
48
  <view style="height: 80rpx;"></view>
48
49
  </scroll-view>
@@ -80,15 +81,16 @@
80
81
  <view style="display:flex;align-items:center">
81
82
  <CusPrice :isPlus="is_plus_site" :isShowIcon="false" salePriceFontSize="32" :showPrice="item.show_prices"></CusPrice>
82
83
  </view>
83
- <view class="p_r" style="font-size: 28rpx;color:#999" @click.stop>
84
- <view v-if="item.has_choose" class="chose_spu" @click="handleChoseProduct(item)">
85
- 选规格
84
+ <view v-if="isAddCart==='Y'" class="p_r" style="font-size: 28rpx;color:#999" @click.stop>
85
+ <view v-if="item.has_choose" class="chose_spu" :style="[choseSpuStyleComp]" @click="handleChoseProduct(item)">
86
+ <!-- 选规格 -->
87
+ {{ cartName }}
86
88
  <view v-if="item.num" class="cart_edg">{{ item.num }}</view>
87
89
  </view>
88
90
  <view v-else>
89
- <xd-number v-if="item.num" v-model="item.num" circle @change="val => handleCartNumChange(val, item)"></xd-number>
91
+ <xd-number v-if="item.num" v-model="item.num" circle :pointCusStyle="pointCusStyle" @change="val => handleCartNumChange(val, item)"></xd-number>
90
92
  <!-- <xd-font-icon v-else icon="iconaddcart" :color="mainColor" size="46"></xd-font-icon> -->
91
- <view class="icon_add_cart" v-else @click="handleChoseProduct(item)">+</view>
93
+ <view class="icon_add_cart" :style="[choseSpuStyleComp]" v-else @click="handleChoseProduct(item)">+</view>
92
94
  </view>
93
95
  </view>
94
96
  </view>
@@ -289,6 +291,10 @@
289
291
  //导航
290
292
  titleBgcColor: '#FFFFFF',
291
293
  titleStyle: {},
294
+ navStyle: "",
295
+ isAddCart: "Y",
296
+ cartStyle: "",
297
+ cartName: "",
292
298
 
293
299
  //面板
294
300
  showDiscount: "Y", //是否展示划线价
@@ -351,6 +357,54 @@
351
357
 
352
358
  }
353
359
  },
360
+ navActiveBarStyle(){
361
+ if(this.navStyle === 'long'){
362
+ return {
363
+ top: 0,
364
+ bottom: 0
365
+ }
366
+ }else if(this.navStyle === 'no'){
367
+ return {
368
+ display: 'none'
369
+ }
370
+ }
371
+ },
372
+ choseSpuStyleComp(){
373
+ if(this.cartStyle === 'btn_cartCFull'){}
374
+ else if(this.cartStyle === 'btn_cartCPlain'){
375
+ return {
376
+ border: '1px solid ' + this.mainColor,
377
+ color: this.mainColor,
378
+ backgroundColor: 'transparent'
379
+ }
380
+ }
381
+ else if(this.cartStyle === 'btn_cartFFull'){
382
+ return {
383
+ borderRadius: 0,
384
+ }
385
+ }else if(this.cartStyle === 'btn_cartFPlain'){
386
+ return {
387
+ border: '1px solid ' + this.mainColor,
388
+ color: this.mainColor,
389
+ backgroundColor: 'transparent',
390
+ borderRadius: 0,
391
+ }
392
+ }
393
+ },
394
+ pointCusStyle(){
395
+ if(this.cartStyle === 'btn_cartFFull'){
396
+ return {
397
+ borderRadius: 0,
398
+ }
399
+ }else if(this.cartStyle === 'btn_cartFPlain'){
400
+ return {
401
+ // border: '1px solid ' + this.mainColor,
402
+ // color: this.mainColor,
403
+ // backgroundColor: 'transparent',
404
+ borderRadius: 0,
405
+ }
406
+ }
407
+ },
354
408
  fixed_bottom() {
355
409
  return this.fixedStyle({height: 30, zIndex: 111});
356
410
  },
@@ -435,7 +489,11 @@
435
489
  }],
436
490
  {sKey:'titleStyleStatus',fields:['titleStyle'],isMerge: true}
437
491
  );
438
- console.log("this.z titleStyle", this.titleStyle)
492
+ this.navStyle = gCPVal(container, 'navStyle', 'short');
493
+ this.isAddCart = gCPVal(container, 'isAddCart', 'Y');
494
+ this.cartStyle = gCPVal(container, 'cartStyle', 'btn_cartCFull')
495
+ this.cartName = gCPVal(container, 'cartName', '选规格');
496
+ console.log("this.z cartStyle", this.cartStyle)
439
497
 
440
498
  //预览mock数据
441
499
  if (this.$configProject['isPreview']) {
@@ -1045,6 +1103,15 @@
1045
1103
  padding: 24rpx;
1046
1104
  text-align: center;
1047
1105
  position: relative;
1106
+ .nav_active_bar{
1107
+ position: absolute;
1108
+ left: 0;
1109
+ top: 28rpx;
1110
+ bottom: 28rpx;
1111
+ width: 12rpx;
1112
+ background-color: var(--main-color);
1113
+ border-radius: 0 4rpx 4rpx 0;
1114
+ }
1048
1115
 
1049
1116
  .cate_num{
1050
1117
  position: absolute;
@@ -1062,15 +1129,16 @@
1062
1129
  // color: var(--main-color);
1063
1130
  font-weight: 500;
1064
1131
  background-color: #FFFFFF;
1065
- &::after{
1066
- content: '';
1067
- position: absolute;
1068
- left: 0;
1069
- top: 28rpx;
1070
- bottom: 28rpx;
1071
- width: 12rpx;
1072
- background-color: var(--main-color);
1073
- }
1132
+ // &::after{
1133
+ // content: '';
1134
+ // position: absolute;
1135
+ // left: 0;
1136
+ // top: 28rpx;
1137
+ // bottom: 28rpx;
1138
+ // width: 12rpx;
1139
+ // background-color: var(--main-color);
1140
+ // border-radius: 0 4rpx 4rpx 0;
1141
+ // }
1074
1142
  }
1075
1143
  }
1076
1144
  }
@@ -80,12 +80,106 @@ export default function (data, gValue,gColor,oldData){
80
80
  });
81
81
  },
82
82
  },
83
+ {
84
+ label: "分类样式",
85
+ ele: "xd-style-image",
86
+ groupKey: 'content',
87
+ valueKey: "navStyle",
88
+ value: data['navStyle'] || 'short',
89
+ value: customVal({
90
+ data,
91
+ key: 'navStyle',
92
+ gValue,
93
+ sValue:"short",
94
+ }),
95
+ labelInline:true,
96
+ className: 'input100',
97
+ handleCustom(cusRes) {
98
+ XdBus.getParentApi('getCompStylesOptions')({
99
+ layout_ids: 'xdDbJ4IOirUK0lljEPIkF',
100
+ key: Date.now()
101
+ })
102
+ .then(res => {
103
+ cusRes.data.cb(res)
104
+ })
105
+ .catch(error => {
106
+ console.error(error);
107
+ });
108
+ },
109
+ },
83
110
  {
84
111
  ele: 'title',
85
112
  label: '展示内容',
86
113
  size: 'small',
87
114
  groupKey:'content',
88
115
  },
116
+ {
117
+ label: '加购按钮',
118
+ ele: 'xd-cus-switch',
119
+ valueKey: 'isAddCart',
120
+ value: data['isAddCart'] || 'Y',
121
+ className: 'input100',
122
+ groupKey:'content',
123
+ labelInline:true,
124
+ cusStyle:{marginBottom: '10px'},
125
+ setting: {
126
+ isBackType: 'string'
127
+ },
128
+ },
129
+ {ele: 'group_start'},
130
+ data['isAddCart'] === 'Y' && {
131
+ label: "",
132
+ ele: "xd-style-image",
133
+ groupKey: 'content',
134
+ valueKey: "cartStyle",
135
+ value: dataVal({data, key:'cartStyle', dValue:'btn_cartCFull', gValue}),
136
+ labelInline:true,
137
+ //isTplRef:true, //内容引用模版被禁用
138
+ className: 'input100',
139
+ handleCustom(cusRes) {
140
+ XdBus.getParentApi('getCompStylesOptions')({
141
+ layout_ids: 'wF0WmvAM3SB0t9cymnx0b',
142
+ key: Date.now()
143
+ })
144
+ .then(res => {
145
+ cusRes.data.cb(res)
146
+ })
147
+ .catch(error => {
148
+ console.error(error);
149
+ });
150
+ },
151
+ },
152
+ data['isAddCart'] === 'Y' && {
153
+ label: '按钮文字',
154
+ ele: 'el-input',
155
+ type: 'text',
156
+ valueKey: 'cartName',
157
+ value: dataVal({data, key:'cartName', dValue:'', gValue}),
158
+ placeholder: '请输入按钮文字,默认值:选规格',
159
+ className: 'input100',
160
+ labelInline: true,
161
+ groupKey:'content',
162
+ rules:[
163
+ {
164
+ required: false,
165
+ validator: (rule, value, callback) => {
166
+ if(typeof value === "string") value = value.trim();
167
+ // if(value.length === 0){
168
+ // callback('按钮文字不能为空');
169
+ // return
170
+ // }
171
+ if(value.length > 3) {
172
+ callback('按钮文字长度为:1-3字符');
173
+ return
174
+ }
175
+ callback();
176
+ },
177
+ trigger: ['blur', 'change']
178
+ }
179
+ ]
180
+ },
181
+ {ele: 'group_end'},
182
+ { ele:'xd-line', groupKey:'content' },
89
183
  {
90
184
  label: '划线价',
91
185
  ele: 'xd-cus-switch',