jufubao-food 1.0.15-beta8 → 1.0.15

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-beta8",
3
+ "version": "1.0.15",
4
4
  "private": false,
5
5
  "description": "聚福宝业务组件餐饮插件包",
6
6
  "main": "index.js",
@@ -455,7 +455,7 @@
455
455
  this.bgColor = this.$colorChange(this.warningColor).alpha(0.1).toString();
456
456
  this.bgColor2 = this.$colorChange(this.mainColor).alpha(0.1).toString();
457
457
 
458
- this.xnamespace = getContainerPropsValue(container, 'content.xnamespace', this.projectAttr.business_code);
458
+ this.xnamespace = getContainerPropsValue(container, 'content.xnamespace', "");
459
459
  this.showBuyer = getContainerPropsValue(container, 'content.showBuyer', "Y");
460
460
  this.showOrderComment = getContainerPropsValue(container, 'content.showOrderComment', "Y");
461
461
  this.payPath = getContainerPropsValue(container, 'content.payPath', { value: "/system/system/pay" }).value;
@@ -116,6 +116,7 @@
116
116
  consume_mode: "",
117
117
  category_id: "",
118
118
  specsPrice: 0,
119
+ xnamespace: "",
119
120
 
120
121
  baseInfo: null,
121
122
  images: [],
@@ -222,6 +223,7 @@
222
223
  * @param container {object} 业务组件对象自己
223
224
  */
224
225
  init(container) {
226
+ this.xnamespace = gCPVal(container, 'xnamespace', "");
225
227
  this.foodProductListPath = getContainerPropsValue(container, 'content.foodProductListPath', {value: ""}).value;
226
228
  this.shopBtnBgColor = gCPVal(container, 'shopBtnBgColor', this.mainColor, {sKey:'cartBtnStatus',fields:['shopBtnBgColor']});
227
229
  this.showDiscount = gCPVal(container, 'showDiscount', "Y");
@@ -28,7 +28,7 @@
28
28
  </view>
29
29
  <view style="height: 100rpx;"></view>
30
30
 
31
- <view class="section_main" :style="[sectionMainStyleComp]">
31
+ <view v-if="categoryList.length" class="section_main" :style="[sectionMainStyleComp]">
32
32
  <view class="left_nav" :style="[navStyleComp]">
33
33
  <scroll-view style="height:100%" scroll-y="true" class="nav_scroll">
34
34
  <view v-for="(item, index) in categoryList" :key="item.category_id"
@@ -109,6 +109,9 @@
109
109
  </scroll-view>
110
110
  </view>
111
111
  </view>
112
+ <view v-else class="section_main" :style="[sectionMainStyleComp]" style="display: flex;align-items: center;justify-content: center;">
113
+ <xd-no-data height="250rpx" :scaleSize="2">暂无商品</xd-no-data>
114
+ </view>
112
115
 
113
116
  <view style="height: 120rpx;"></view>
114
117
  <view class="fixed_bottom" :style="fixed_bottom">
@@ -183,7 +186,7 @@
183
186
  <text style="margin-right: 16rpx;">{{item.resource_shop_name}}</text>
184
187
  <view class="curr_active">正在预览</view>
185
188
  </view>
186
- <view class="more_r">详情 <xd-font-icon icon="iconxiangyou_xian" :size="24"></xd-font-icon></view>
189
+ <view class="more_r" @click.stop="toShopDetail(item)">详情 <xd-font-icon icon="iconxiangyou_xian" :size="24"></xd-font-icon></view>
187
190
  </view>
188
191
  <view class="shop_addr_bar">
189
192
  <view>{{item.address}}</view>
@@ -197,7 +200,7 @@
197
200
  </xd-down-drawer>
198
201
  <view v-if="showEmptyShop" class="empty_shop">
199
202
  <xd-no-data :scaleSize="2" iconType="shop">附近暂无门店</xd-no-data>
200
- <view class="empty_chose_btn" @click="handleSwitchShop">选择其他门店 <xd-font-icon icon="iconxiangyou_xian" :size="24"></xd-font-icon></view>
203
+ <view class="empty_chose_btn" @click="handleSwitchCity">选择其他城市 <xd-font-icon icon="iconxiangyou_xian" :size="24"></xd-font-icon></view>
201
204
  </view>
202
205
  </view>
203
206
  </view>
@@ -235,6 +238,7 @@
235
238
  ],
236
239
  data() {
237
240
  return {
241
+ pageOptions: {},
238
242
  closeMask: true,
239
243
  isPreview: false,
240
244
  resource_shop_id: "",
@@ -275,7 +279,7 @@
275
279
  column_num: 1,
276
280
  skeNumber:10,
277
281
  rowSpacing: 16,
278
- columnSpacing: 16,
282
+ columnSpacing: 32,
279
283
  listPadding:{},
280
284
  productConfig:{},
281
285
  itemPadding:{},
@@ -302,6 +306,8 @@
302
306
  foodDetailPath: "",
303
307
  confirmPath: "",
304
308
  switchStorePath: "",
309
+ switchCityPath: "",
310
+ shopDetailPath: "",
305
311
  }
306
312
  },
307
313
  computed: {
@@ -424,6 +430,11 @@
424
430
  if (JSON.stringify(value) === JSON.stringify(oldValue)) return;
425
431
  if (this.$configProject['isPreview']) this.init(value)
426
432
  },
433
+ stateCity(n, o) {
434
+ if(n && JSON.stringify(n) !== JSON.stringify(o)){
435
+ this.onJfbLoad(this.pageOptions);
436
+ }
437
+ }
427
438
  },
428
439
  created() {
429
440
  this.init(this.container);
@@ -433,6 +444,7 @@
433
444
  },
434
445
  methods: {
435
446
  onJfbLoad(options) {
447
+ this.pageOptions = options;
436
448
  this.setNameSpace(options);
437
449
  this.resource_shop_id = options.resource_shop_id;
438
450
  this.consume_mode = options.consume_mode || 'HDSELF';
@@ -441,6 +453,10 @@
441
453
  this.p_getFoodShopDetail(this.resource_shop_id);
442
454
  }else if(this.brand_id || this.$configProject['isPreview']){
443
455
  this.p_getFoodShopList();
456
+ }else{
457
+ this.$xdAlert({
458
+ content: '请配置品牌ID',
459
+ })
444
460
  }
445
461
  },
446
462
  /**
@@ -448,9 +464,12 @@
448
464
  * @param container {object} 业务组件对象自己
449
465
  */
450
466
  init(container) {
467
+ this.xnamespace = gCPVal(container, 'xnamespace', "");
451
468
  this.foodDetailPath = getContainerPropsValue(container, 'content.foodDetailPath', {value: ""}).value;
452
469
  this.confirmPath = getContainerPropsValue(container, 'content.confirmPath', {value: ""}).value;
453
470
  this.switchStorePath = getContainerPropsValue(container, 'content.switchStorePath', { value: ''}).value;
471
+ this.switchCityPath = getContainerPropsValue(container, 'content.switchCityPath', { value: ''}).value;
472
+ this.shopDetailPath = getContainerPropsValue(container, 'content.shopDetailPath', { value: ''}).value;
454
473
  this.showDiscount = gCPVal(container, 'showDiscount', "Y");
455
474
  this.differ = gCPVal(container, 'differ', 1);
456
475
 
@@ -474,7 +493,7 @@
474
493
  this.radius = gCPVal(container,'radius', [this.gStyleValue.radius,'0'], {sKey:'radiusStatus',fields:['radius']})||0;
475
494
  this.imageRadius = gCPVal(container,'imageRadius', [this.gStyleValue.radius/2,'0'], {sKey:'imageRadiusStatus',fields:['imageRadius']})||0;
476
495
  this.contShadow = gCPVal(container, 'contShadow', [this.gStyleValue.shadow,'none'], {isShadow:true});
477
- this.columnSpacing = gCPVal(container,'columnSpacing', [16,20], {sKey:'columnRowStatus',fields:['columnSpacing']});
496
+ this.columnSpacing = gCPVal(container,'columnSpacing', [32,20], {sKey:'columnRowStatus',fields:['columnSpacing']});
478
497
 
479
498
  //导航
480
499
  this.titleBgcColor = gCPVal(container,'titleBgcColor', '#f8f8f8', {sKey:'titleBgcColorStatus',fields:['titleBgcColor']});
@@ -506,6 +525,11 @@
506
525
  }
507
526
 
508
527
  },
528
+ toShopDetail(item){
529
+ this.$xdUniHelper.navigateTo({
530
+ url: this.shopDetailPath + "?resource_shop_id=" + item.resource_shop_id,
531
+ })
532
+ },
509
533
  handleCartNumChange(val, prod){
510
534
  console.log("handleCartNumChange", val, prod)
511
535
  let product = {
@@ -547,13 +571,21 @@
547
571
  }
548
572
  this.showTakeoutShop = true;
549
573
  },
574
+ handleSwitchCity(){
575
+ this.$xdUniHelper.navigateTo({
576
+ url: this.switchCityPath
577
+ })
578
+ },
550
579
  handleSwitchShop(){
551
580
  //切换门店
552
581
  let curPage = this.$xdUniHelper.getCurrentPages();
553
582
  let query = {...curPage.query};
554
583
  let callback= Base64.encode(curPage.path + '?' + this.$xdUniHelper.jsonToParams(query));
584
+ let linkQuery = '?brand_id=' + (this.brand_id || this.shopInfo.brand_id);
585
+ let rShopId = this.shopInfo.resource_shop_id || this.resource_shop_id;
586
+ linkQuery = rShopId ? linkQuery + '&resource_shop_id=' + rShopId : linkQuery;
555
587
  this.$xdUniHelper.redirectTo({
556
- url: this.switchStorePath + '?brand_id=' + this.brand_id + '&callback=' + callback
588
+ url: this.switchStorePath + linkQuery + '&callback=' + callback
557
589
  })
558
590
  // this.$xdUniHelper.navigateTo({
559
591
  // url: this.switchStorePath + "?brand_id=" + this.brand_id + "&resource_shop_id=" + this.resource_shop_id,
@@ -576,9 +608,12 @@
576
608
  city_code: this.stateCity.city_code,
577
609
  page_token: 1,
578
610
  page_size: 3,
611
+ consume_mode: this.consume_mode,
612
+ xnamespace: this.xnamespace
579
613
  }
580
614
  }).then(res => {
581
615
  if(res.list && res.list.length > 0){
616
+ this.showEmptyShop = false;
582
617
  this.shopList = res.list;
583
618
  if(loadFirstShop){
584
619
  this.curShopIndex = 0;
@@ -126,7 +126,7 @@ module.exports = {
126
126
  show_prices: [
127
127
  { p: 1875, n: "", t: "S" },
128
128
  { p: 1625, n: "PLUS价", t: "D" },
129
- { "p": 2000, "n": "原价", "t": "U" },
129
+ { p: 2000, n: "原价", t: "U" }
130
130
  ]
131
131
  },
132
132
  {
@@ -299,5 +299,119 @@ module.exports = {
299
299
  ],
300
300
  total_num: 1,
301
301
  request_id: "9c2bfb2c0f6817fd"
302
+ },
303
+ getFoodShopList: {
304
+ list: [
305
+ {
306
+ brand_id: 100021,
307
+ brand_name: "万象院线",
308
+ brand_type: "MC",
309
+ distance: "13.1km",
310
+ phone: "0316-8366949",
311
+ address: "大厂回族自治县大厂回族自治县鑫华商场三层盛世影城",
312
+ consume_mode: ["SEAT"],
313
+ shop_icon: "//sandbox-img.jufubao.cn/uploads/20230725/a343d6a8aab0bd9419ddad1030be7cd1.jpg",
314
+ shop_id: 0,
315
+ resource_shop_id: 8003557,
316
+ params: {
317
+ consume_mode: "SELL,CODE,SEAT,TRAVEL",
318
+ resource_shop:
319
+ "eyJyZXNvdXJjZV9zaG9wX2lkIjo2NzcxOTUzLCJzaG9wX2lkIjowfQ"
320
+ },
321
+ resource_shop_name: "廊坊盛世影城",
322
+ province_name: "",
323
+ city_name: "",
324
+ area_name: "",
325
+ street_name: "",
326
+ latitude: "39.89214964393913",
327
+ longitude: "116.99514574878383",
328
+ default_consume_type: "",
329
+ consume_type: [],
330
+ is_support_jhd: false,
331
+ time_slot_name: "",
332
+ business_time_name: "",
333
+ business_code: "cake",
334
+ consume_options: [
335
+ {
336
+ consume_mode: "SEAT",
337
+ desc: "在线订票选座",
338
+ icon: "iconzuo",
339
+ show_price: []
340
+ }
341
+ ]
342
+ },
343
+ {
344
+ brand_id: 14,
345
+ brand_name: "测试1111",
346
+ brand_type: "MA",
347
+ distance: "20.6km",
348
+ phone: "13152526323",
349
+ address: "三河市燕郊镇河北燕郊尚京广场",
350
+ consume_mode: ["SELL"],
351
+ shop_icon: "//sandbox-img.jufubao.cn/uploads/20230324/3265afeb6a1f2a94f25c968a09275574.png",
352
+ shop_id: 1220258,
353
+ resource_shop_id: 8005378,
354
+ params: {
355
+ consume_mode: "SELL,CODE,SEAT,TRAVEL",
356
+ resource_shop:
357
+ "eyJyZXNvdXJjZV9zaG9wX2lkIjo4MDA1Mzc4LCJzaG9wX2lkIjoxMjIwMjU4fQ"
358
+ },
359
+ resource_shop_name: "润旭商城-2号楼",
360
+ province_name: "",
361
+ city_name: "",
362
+ area_name: "",
363
+ street_name: "",
364
+ latitude: "39.960893804217115",
365
+ longitude: "116.84628655458927",
366
+ default_consume_type: "JHD",
367
+ consume_type: ["WB", "QP", "JHD", "CV", "POS"],
368
+ is_support_jhd: true,
369
+ time_slot_name: "",
370
+ business_time_name: "",
371
+ business_code: "cake",
372
+ consume_options: [
373
+ {
374
+ consume_mode: "JHD",
375
+ desc: "到店消费任意金额可用",
376
+ icon: "iconduihuan",
377
+ show_price: []
378
+ }
379
+ ]
380
+ },
381
+ {
382
+ brand_id: 7,
383
+ brand_name: "goodlike",
384
+ brand_type: "MA",
385
+ distance: "20.6km",
386
+ phone: "18710035161",
387
+ address: "三河市燕郊镇华地1",
388
+ consume_mode: ["SELF", "STOD", "CODE"],
389
+ shop_icon: "//sandbox-img.jufubao.cn/uploads/20230508/c33ccd6408e911f0334cc2b44b6d4470.jpg",
390
+ shop_id: 0,
391
+ resource_shop_id: 8000009,
392
+ params: {
393
+ consume_mode: "SELL,CODE,SEAT,TRAVEL",
394
+ resource_shop:
395
+ "eyJyZXNvdXJjZV9zaG9wX2lkIjo4MDAwMDA5LCJzaG9wX2lkIjowfQ"
396
+ },
397
+ resource_shop_name: "验门店周期A-关联后",
398
+ province_name: "",
399
+ city_name: "",
400
+ area_name: "",
401
+ street_name: "",
402
+ latitude: "39.96091751137191",
403
+ longitude: "116.84556045424561",
404
+ default_consume_type: "",
405
+ consume_type: [],
406
+ is_support_jhd: false,
407
+ time_slot_name: "",
408
+ business_time_name: "",
409
+ business_code: "cake",
410
+ consume_options: []
411
+ },
412
+ ],
413
+ total_size: 0,
414
+ next_page_token: 'a:3:{i:0;d:20725.13012367171;i:1;d:0;i:2;s:7:"8000003";}',
415
+ request_id: "ea411b018a2310c4"
302
416
  }
303
417
  };
@@ -15,6 +15,19 @@ export default (data)=>{
15
15
  groupKey:'advanced',
16
16
  className: 'input100',
17
17
  },
18
+ {
19
+ label: '门店详情页',
20
+ ele: 'xd-select-pages-path',
21
+ valueKey: 'shopDetailPath',
22
+ placeholder: '请选择门店详情页跳转地址',
23
+ value: data.shopDetailPath || null,
24
+ labelInline: true,
25
+ setting: {
26
+ router: XdBus.getParentApi('getPagesTree'),
27
+ },
28
+ groupKey:'advanced',
29
+ className: 'input100',
30
+ },
18
31
  {
19
32
  label: '订单确认页',
20
33
  ele: 'xd-select-pages-path',
@@ -41,6 +54,19 @@ export default (data)=>{
41
54
  groupKey:'advanced',
42
55
  className: 'input100',
43
56
  },
57
+ {
58
+ label: '切换城市',
59
+ ele: 'xd-select-pages-path',
60
+ valueKey: 'switchCityPath',
61
+ placeholder: '请选择切换城市跳转地址',
62
+ value: data.switchCityPath || null,
63
+ setting: {
64
+ router: XdBus.getParentApi('getPagesTree'),
65
+ },
66
+ labelInline: true,
67
+ groupKey:'advanced',
68
+ className: 'input100',
69
+ },
44
70
 
45
71
  {
46
72
  label: '版本号:',
@@ -319,7 +319,7 @@ export default function (data={},gValue={},gColor={},oldData) {
319
319
  labelInline: true,
320
320
  groupKey:'style',
321
321
  valueKey: 'columnSpacing',
322
- value: dataVal({data, key:'columnSpacing', dValue: 16, gValue}),
322
+ value: dataVal({data, key:'columnSpacing', dValue: 32, gValue}),
323
323
  hidden: !statusShow({data, key: 'columnRowStatus', fields:['columnSpacing'], gValue}),
324
324
  inline: false,
325
325
  append:'px',