jufubao-base 1.0.376 → 1.0.377-beta2

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-base",
3
- "version": "1.0.376",
3
+ "version": "1.0.377-beta2",
4
4
  "private": false,
5
5
  "description": "聚福宝业务组件基础插件包",
6
6
  "main": "index.js",
@@ -314,6 +314,21 @@ export default {
314
314
  { label: '隐藏', value: 'N' },
315
315
  ]
316
316
  },
317
+ {
318
+ label: "影院电话",
319
+ ele: 'xd-radio',
320
+ valueKey: "isSHowPhone",
321
+ value: data['isSHowPhone'] || 'N',
322
+ groupKey: 'content',
323
+ placeholder: '请选择是否显示影院电话',
324
+ multiple: false,
325
+ className: 'input80',
326
+ list: [
327
+ { label: '显示', value: 'Y' },
328
+ { label: '隐藏', value: 'N' },
329
+ ]
330
+ },
331
+
317
332
  {
318
333
  label: '外填充:',
319
334
  ele: 'xd-margin-padding',
@@ -536,10 +536,18 @@
536
536
  <view :class="{top: ['top'].includes(code_location)}" class="jfb-base-order-detail__body-shop-name">{{ info.shop.shop_name }}</view>
537
537
  <view class="jfb-base-order-detail__body-shop-address">地址: {{ info.shop.shop_address }}</view>
538
538
  </view>
539
- <view
540
- @click="handleLocation(info.shop)"
541
- v-if="['top'].includes(code_location)"
542
- ><xd-font-icon icon="iconfabu" :color="mainColor" size="30"></xd-font-icon></view>
539
+ <view>
540
+ <view
541
+ @click="handleLocation(info.shop)"
542
+ v-if="['top'].includes(code_location)"
543
+ ><xd-font-icon icon="iconfabu" :color="mainColor" size="30"></xd-font-icon></view>
544
+ <view
545
+ class="show-phone"
546
+ @click="handleCallTo(info.shop['shop_phone'])"
547
+ v-if="isSHowPhone === 'Y' && info.shop['shop_phone'] && isPhoneReg.test(info.shop['shop_phone'])"
548
+ ><xd-font-icon icon="icondianhua" color="#333" size="30"></xd-font-icon></view>
549
+ </view>
550
+
543
551
  </view>
544
552
 
545
553
  </view>
@@ -866,7 +874,7 @@
866
874
  </view>
867
875
  <view>
868
876
  <xd-button
869
- @click="handleToPay"
877
+ @click="handleToPay(item)"
870
878
  size="small"
871
879
  type="primary"
872
880
  :style="{
@@ -1116,6 +1124,10 @@ export default {
1116
1124
  showReorderDialog: false,
1117
1125
  reorderTips: [],
1118
1126
  reorderBtnItem: null,
1127
+
1128
+ //是否显示电话
1129
+ isSHowPhone:'N', //是否显示手机号码
1130
+ isPhoneReg: /^[\d-]+$/
1119
1131
  };
1120
1132
  },
1121
1133
  watch: {
@@ -1177,6 +1189,11 @@ export default {
1177
1189
  isPlusSite(){
1178
1190
  return this.projectAttr.headers['X-Site-Group']==="vip";
1179
1191
  },
1192
+ // #ifdef H5
1193
+ isMpInH5Comp(){
1194
+ return navigator.userAgent.match(/miniprogram/i)
1195
+ },
1196
+ //#endif
1180
1197
  },
1181
1198
  created() {
1182
1199
  this.noticeBgc = Color(this.warningColor).alpha(0.2).toString();
@@ -1201,6 +1218,12 @@ export default {
1201
1218
  },()=>{})
1202
1219
  },
1203
1220
 
1221
+ handleCallTo(phone){
1222
+ if(this.isPhoneReg.test(phone)) {
1223
+ uni.makePhoneCall({phoneNumber:phone.replace(/[-]/g,'')})
1224
+ }
1225
+ },
1226
+
1204
1227
  getAmount(price) {
1205
1228
  return this.$xdUniHelper.divisionFloatNumber(price,100)
1206
1229
  },
@@ -1470,7 +1493,7 @@ export default {
1470
1493
  */
1471
1494
  init(container) {
1472
1495
  this.showApplyAfter = getContainerPropsValue(container, "content.showApplyAfter", "N");
1473
-
1496
+ this.isSHowPhone = getContainerPropsValue(container, "content.isSHowPhone", "N");
1474
1497
  this.bgColor = this.$colorChange(this.mainColor).alpha(0.1).toString();
1475
1498
  this.brandPath = getContainerPropsValue(container, "content.brandPath", {value: "",}).value;
1476
1499
  this.payPath = getContainerPropsValue(container, "content.payPath", {value: "",}).value;
@@ -1601,12 +1624,9 @@ export default {
1601
1624
  });
1602
1625
  }
1603
1626
  },
1604
- handleToPay() {
1627
+ handleToPay(item) {
1628
+ //餐饮固定逻辑
1605
1629
  if (this.$configProject.type === "food") {
1606
- console.log(
1607
- getApp().globalData.$xd.brandInfo,
1608
- "getApp().globalData.$xd.brandInfo"
1609
- );
1610
1630
  let callbackUrl = `${window.location.protocol}//${window.location.host}/system/pay/success?order_id=${this.info.pay_info.pay_order_id}`;
1611
1631
  this.$xdUniHelper.navigateTo({
1612
1632
  url: `${getApp().globalData.$xd.brandInfo.pay_url}?order_id=${
@@ -1615,6 +1635,26 @@ export default {
1615
1635
  });
1616
1636
  return;
1617
1637
  }
1638
+
1639
+ // #ifdef H5
1640
+ //判断是否为微信小程序宿主
1641
+ if(item['extras']) {
1642
+ try {
1643
+ const { pay_jump_type, pay_url } = JSON.parse(item['extras']);
1644
+ if(pay_url) {
1645
+ let url = pay_url
1646
+ if(this.isMpInH5Comp && pay_jump_type === 'wx_mini') {
1647
+ url = `/pages/jumptomp/jumptomp?callback=${Base64.encodeURI(url)}&isThird=1`
1648
+ }
1649
+ this.$xdUniHelper.redirectTo({ url }, false, true);
1650
+ return;
1651
+ }
1652
+ }catch (e) {
1653
+ console.error('支付跳转解析失败:', e);
1654
+ }
1655
+ }
1656
+ //#endif
1657
+
1618
1658
  this.$xdUniHelper.navigateTo({
1619
1659
  url: `${this.payPath}?order_id=${this.info.pay_info.pay_order_id}&main_order_id=${this.main_order_id}`,
1620
1660
  });
@@ -1693,15 +1733,18 @@ export default {
1693
1733
  }).catch(err => {
1694
1734
  this.$xdHideLoading();
1695
1735
  })
1696
- }else if (item.action === "invoice") {
1736
+ }
1737
+ else if (item.action === "invoice") {
1697
1738
  this.$xdUniHelper.navigateTo({
1698
1739
  url: `${this.invoicePath}?main_order_id=${this.main_order_id}&pay_order_id=${this.info.pay_info.pay_order_id}`,
1699
1740
  });
1700
- }else if (item.action === "viewInvoice") {
1741
+ }
1742
+ else if (item.action === "viewInvoice") {
1701
1743
  this.$xdUniHelper.navigateTo({
1702
1744
  url: `${this.viewInvoicePath}?main_order_id=${this.main_order_id}&pay_order_id=${this.info.pay_info.pay_order_id}`,
1703
1745
  });
1704
- }else if(item.action === 'reorder'){
1746
+ }
1747
+ else if(item.action === 'reorder'){
1705
1748
  //再来一单
1706
1749
  this.$xdShowLoading({});
1707
1750
  jfbRootExec("reCartOrder", {
@@ -1917,15 +1960,26 @@ export default {
1917
1960
  &:nth-child(1) {
1918
1961
  flex: 1;
1919
1962
  }
1963
+
1964
+
1920
1965
  &:nth-child(2) {
1921
1966
  flex-shrink: 0;
1922
- width: 80rpx;
1923
- height: 80rpx;
1924
1967
  display: flex;
1925
1968
  justify-content: flex-end;
1926
1969
  align-items: center;
1970
+ & > view {
1971
+ width: 80rpx;
1972
+ height: 80rpx;
1973
+ display: flex;
1974
+ justify-content: center;
1975
+ align-items: center;
1976
+ }
1927
1977
  }
1928
1978
  }
1979
+
1980
+ .show-phone {
1981
+ transform: rotate(180deg);
1982
+ }
1929
1983
  }
1930
1984
 
1931
1985
 
@@ -160,14 +160,14 @@
160
160
  v-if="showApplyAfter === 'Y'"
161
161
  type="default"
162
162
  size="mini"
163
- @click="handleBtnEvent(btn.action, item)"
163
+ @click="handleBtnEvent(btn.action, item,btn)"
164
164
  >{{ btn.text }}</xd-button>
165
165
  </template>
166
166
  <xd-button
167
167
  v-else
168
168
  :type="getBtnType(btn.action)"
169
169
  size="mini"
170
- @click="handleBtnEvent(btn.action, item)"
170
+ @click="handleBtnEvent(btn.action, item , btn)"
171
171
  >{{ btn.text }}</xd-button>
172
172
  </view>
173
173
  </view>
@@ -193,7 +193,7 @@
193
193
  :brandTextColor="brandTextColor"
194
194
  :showApplyAfter="showApplyAfter"
195
195
  :item="item"
196
- @handleBtnEvent="action => handleBtnEvent(action, item)"
196
+ @handleBtnEvent="({action, btn}) => handleBtnEvent(action, item , btn)"
197
197
  ></xd-tfk-order-item>
198
198
  </view>
199
199
  </template>
@@ -331,6 +331,11 @@ export default {
331
331
  // else return "0";
332
332
  return this.sectionBorder;
333
333
  },
334
+ // #ifdef H5
335
+ isMpInH5Comp(){
336
+ return navigator.userAgent.match(/miniprogram/i)
337
+ },
338
+ //#endif
334
339
  },
335
340
  watch: {
336
341
  container(value,oldValue) {
@@ -446,11 +451,32 @@ export default {
446
451
  if(this.showApplyAfter === 'Y') return buttons.length > 0;
447
452
  else return buttons.filter(item => item.action !== 'apply_refund').length > 0;
448
453
  },
449
- handleBtnEvent(action, item) {
454
+ handleBtnEvent(action, item, btn) {
450
455
  if (action === "cancel_unpaid") {
451
456
  //取消订单
452
457
  this.cancelUnPayOrder(item.main_order_id);
453
- } else if (action === "pay") {
458
+ }
459
+ else if (action === "pay") {
460
+ //throw new Error(JSON.stringify({item,btn}))
461
+ // #ifdef H5
462
+ //判断是否为微信小程序宿主
463
+ if(btn['extras']) {
464
+ try {
465
+ const { pay_jump_type, pay_url } = JSON.parse(btn['extras']);
466
+ if(pay_url) {
467
+ let url = pay_url
468
+ if(this.isMpInH5Comp && pay_jump_type === 'wx_mini') {
469
+ url = `/pages/jumptomp/jumptomp?callback=${Base64.encodeURI(url)}&isThird=1`
470
+ }
471
+ this.$xdUniHelper.redirectTo({ url }, false, true);
472
+ return;
473
+ }
474
+ }catch (e) {
475
+ console.error('支付跳转解析失败:', e);
476
+ }
477
+ }
478
+ //#endif
479
+
454
480
  //去支付
455
481
  if (this.$configProject.type === "food") {
456
482
  console.log(
@@ -465,10 +491,13 @@ export default {
465
491
  });
466
492
  return;
467
493
  }
494
+
468
495
  this.$xdUniHelper.navigateTo({
469
496
  url: `${this.payPath}?order_id=${item.pay_order_id}&main_order_id=${item.main_order_id}`,
470
497
  });
471
- } else if( action === 'apply_refund'){
498
+ }
499
+
500
+ else if( action === 'apply_refund'){
472
501
 
473
502
  this.$xdShowLoading({});
474
503
  jfbRootExec("getSupportQuickRefund", {
@@ -492,7 +521,8 @@ export default {
492
521
  }).catch(err => {
493
522
  this.$xdHideLoading();
494
523
  })
495
- }else if(action === 'reorder'){
524
+ }
525
+ else if(action === 'reorder'){
496
526
  //重新下单
497
527
  this.$xdShowLoading({});
498
528
  jfbRootExec("reCartOrder", {
@@ -78,7 +78,7 @@
78
78
  :color="mainColor"
79
79
  :fontSize="28"></xd-unit>
80
80
  </template>
81
-
81
+
82
82
  </view>
83
83
  </view>
84
84
  <view v-if="item.buttons.length" class="prod_footer">
@@ -88,16 +88,16 @@
88
88
  <view class="btn"
89
89
  v-if="showApplyAfter === 'Y'"
90
90
  :key="btn.key"
91
- @click="handleBtnEvent(btn.action, item)"
91
+ @click="handleBtnEvent(btn.action, item, btn )"
92
92
  >{{btn.text}}</view>
93
93
  </template>
94
94
  <view class="btn"
95
95
  v-else
96
96
  :key="btn.key"
97
- @click="handleBtnEvent(btn.action, item)"
97
+ @click="handleBtnEvent(btn.action, item, btn)"
98
98
  >{{btn.text}}</view>
99
99
  </template>
100
-
100
+
101
101
  </view>
102
102
  </view>
103
103
  </template>
@@ -125,8 +125,8 @@
125
125
  }
126
126
  },
127
127
  methods:{
128
- handleBtnEvent(action){
129
- this.$emit('handleBtnEvent', action)
128
+ handleBtnEvent(action, btn){
129
+ this.$emit('handleBtnEvent', {action,btn})
130
130
  },
131
131
  }
132
132
  }
@@ -276,4 +276,4 @@
276
276
  }
277
277
  }
278
278
  }
279
- </style>
279
+ </style>