jufubao-base 1.0.366-beta3 → 1.0.367

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.
@@ -0,0 +1,22 @@
1
+ 'use strict';
2
+
3
+ /**
4
+ * @description 第三方库
5
+ * @param threePackagePath {String} 第三方库所在项目路径存放路径路
6
+ * @param packname {String} 包名字
7
+ * @returns {string|*}
8
+ */
9
+ const getPackagePath = (threePackagePath, packname = 'gxd-commands-bussiness')=>{
10
+ if(packname === 'gxd-commands-bussiness') {
11
+ return `/Users/shiyonggao/Desktop/code/BASE/UNIAPP/xd-commands-bussiness/${threePackagePath}`;
12
+ }
13
+
14
+ if (packname === 'gxd-uni-library-editx') {
15
+ return `/Users/shiyonggao/Desktop/code/BASE/UNIAPP/xd-uni-library-editx/${threePackagePath}`;
16
+ }
17
+
18
+ };
19
+
20
+ module.exports = {
21
+ getPackagePath
22
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jufubao-base",
3
- "version": "1.0.366-beta3",
3
+ "version": "1.0.367",
4
4
  "private": false,
5
5
  "description": "聚福宝业务组件基础插件包",
6
6
  "main": "index.js",
@@ -17,48 +17,50 @@
17
17
  class="jfb-base-chose-company__body"
18
18
  :style="{ minHeight: layoutInfo.bodyMinHeightRpx + 'rpx' }"
19
19
  >
20
- <view :style="[contentPaddingCompStyle]">
21
- <view class="jfb-base-chose-company__body-title"
22
- >企业信息({{ companyList.length }}家)</view
23
- >
24
- <view class="jfb-base-chose-company__body-notice">{{ title }}</view>
25
- <view :style="{ '--main-color': mainColor }">
26
- <view
27
- v-for="(item, index) in companyList"
28
- :key="index"
29
- @click="handleChoseCompany(item)"
30
- :style="[listPaddingCompStyle]"
31
- :class="[
32
- 'jfb-base-chose-company__body-company',
33
- item.is_select ? 'active' : '',
34
- ]"
20
+ <template v-if="isLoading">
21
+ <view :style="[contentPaddingCompStyle]">
22
+ <view class="jfb-base-chose-company__body-title"
23
+ >企业信息({{ companyList.length }}家)</view
35
24
  >
25
+ <view class="jfb-base-chose-company__body-notice">{{ title }}</view>
26
+ <view :style="{ '--main-color': mainColor }">
36
27
  <view
37
- v-if="item.is_select"
38
- class="jfb-base-chose-company__body-company-active"
39
- :style="{
40
- background: mainColor,
41
- borderRadius: `0 ${listRadius}rpx 0 30rpx`,
42
- }"
28
+ v-for="(item, index) in companyList"
29
+ :key="index"
30
+ @click="handleChoseCompany(item)"
31
+ :style="[listPaddingCompStyle]"
32
+ :class="[
33
+ 'jfb-base-chose-company__body-company',
34
+ item.is_select ? 'active' : '',
35
+ ]"
43
36
  >
44
- <XdFontIcon
45
- size="20"
46
- icon="iconduigou-xian"
47
- color="#fff"
48
- ></XdFontIcon>
49
- </view>
50
- {{ item.company_name }}
51
- </view></view
52
- >
53
- </view>
54
- <view :style="[addCoMpStyle]" class="jfb-base-chose-company__body-add"
55
- >{{ addTitle
56
- }}<view v-if="addCompanyPath" @click="handleToAdd" :style="{color:mainColor}"
57
- >去添加<XdFontIcon
58
- size="28"
59
- icon="iconxiangyou_xian"
60
- ></XdFontIcon></view
61
- ></view>
37
+ <view
38
+ v-if="item.is_select"
39
+ class="jfb-base-chose-company__body-company-active"
40
+ :style="{
41
+ background: mainColor,
42
+ borderRadius: `0 ${listRadius}rpx 0 30rpx`,
43
+ }"
44
+ >
45
+ <XdFontIcon
46
+ size="20"
47
+ icon="iconduigou-xian"
48
+ color="#fff"
49
+ ></XdFontIcon>
50
+ </view>
51
+ {{ item.company_name }}
52
+ </view></view
53
+ >
54
+ </view>
55
+ <view :style="[addCoMpStyle]" class="jfb-base-chose-company__body-add"
56
+ >{{ addTitle
57
+ }}<view v-if="addCompanyPath" @click="handleToAdd" :style="{color:mainColor}"
58
+ >去添加<XdFontIcon
59
+ size="28"
60
+ icon="iconxiangyou_xian"
61
+ ></XdFontIcon></view
62
+ ></view>
63
+ </template>
62
64
  </view>
63
65
  </view>
64
66
  </template>
@@ -93,6 +95,8 @@ export default {
93
95
  addCompanyPath: "",
94
96
  companyList: [],
95
97
  redirect_url: "",
98
+
99
+ isLoading: false,//页面加载完成
96
100
  };
97
101
  },
98
102
  watch: {
@@ -127,25 +131,12 @@ export default {
127
131
  },
128
132
  created() {
129
133
  this.init(this.container);
130
-
131
- //todo
132
134
  },
133
135
  methods: {
134
136
  onJfbLoad(options) {
135
137
  if (options.redirect_url) {
136
138
  this.redirect_url = Base64.decode(options.redirect_url);
137
139
  }
138
- jfbRootExec("getChoseCompanyList", {
139
- vm: this,
140
- data: {},
141
- }).then((res) => {
142
- console.log(res, "resgetChoseCompanyList");
143
- //如果只有一个企业,直接选择该企业
144
- if(res.list.length === 1) {
145
- this.handleChoseCompany(res.list[0]);
146
- }
147
- this.companyList = res.list;
148
- });
149
140
 
150
141
  //判断应用是否开启了强制选择企业功能
151
142
  let isCustomer = false;
@@ -155,7 +146,6 @@ export default {
155
146
 
156
147
  //预览模式不显示强制选择企业功能提示
157
148
  if (this.$configProject['isPreview']) isCustomer = true;
158
-
159
149
  if(!isCustomer) {
160
150
  this.$xdAlert({
161
151
  title:'配置错误',
@@ -164,7 +154,26 @@ export default {
164
154
  contentColor: '#333',
165
155
  background: '#fff',
166
156
  });
157
+ return
167
158
  }
159
+
160
+ jfbRootExec("getChoseCompanyList", {
161
+ vm: this,
162
+ data: {},
163
+ }).then((res) => {
164
+ //如果只有一个企业,直接选择该企业(非预览模式)
165
+ if(res.list.length === 1) {
166
+ if(!this.$configProject["isPreview"]){
167
+ this.handleChoseCompany(res.list[0]);
168
+ return
169
+ }
170
+ }
171
+
172
+ //多个企业或者预览模式时候处理
173
+ this.isLoading = true;
174
+ this.companyList = res.list;
175
+ });
176
+
168
177
  },
169
178
  /**
170
179
  * @description 监听事件变化
@@ -267,8 +276,9 @@ export default {
267
276
  },
268
277
  handleChoseCompany(item) {
269
278
  if(this.$configProject["isPreview"]){
270
- return;
279
+ return;
271
280
  }
281
+
272
282
  jfbRootExec("switchChoseCompany", {
273
283
  vm: this,
274
284
  data: {
@@ -277,7 +287,6 @@ export default {
277
287
  company_source_from: item.company_source_from,
278
288
  },
279
289
  }).then((res) => {
280
-
281
290
  //#ifdef MP-WEIXIN
282
291
  if (this.jfbAuthorize !== null) {
283
292
  this.jfbAuthorize.setAllToken(res);//只返回用户登陆信息,无卡登陆信息
@@ -290,10 +299,12 @@ export default {
290
299
  real_index_url = jsonData['app']['frontPath'];
291
300
  } catch (error) {
292
301
  real_index_url = item.index_url;
293
- }
302
+ }
294
303
  this.$xdUniHelper.redirectTo({
295
304
  url: this.redirect_url || real_index_url || this.settings.index,
296
305
  });
306
+ }).catch(err=>{
307
+ console.error(err);
297
308
  });
298
309
  },
299
310
  handleToAdd() {
@@ -301,27 +312,6 @@ export default {
301
312
  url: this.addCompanyPath,
302
313
  });
303
314
  },
304
- onJfbScroll(options) {
305
- console.log("event.onJfbScroll", options);
306
- },
307
- onJfbReachBottom(options) {
308
- console.log("event.onJfbReachBottom", options);
309
- },
310
- onJfbShow(options) {
311
- console.log("event.onJfbShow", options);
312
- },
313
- onJfbHide(options) {
314
- console.log("event.onJfbHide", options);
315
- },
316
- onJfbBack(options) {
317
- console.log("event.onJfbBack", options);
318
- },
319
- onJfbUpdate(...data) {
320
- console.log("event.onJfbUpdate", data);
321
- },
322
- onJfbCustomEvent(options) {
323
- console.log("event.onJfbReachBottom", options);
324
- },
325
315
  },
326
316
  };
327
317
  </script>
@@ -75,7 +75,7 @@
75
75
  @click="toSearch"
76
76
  :placeholder-style="'color:' + inputTextColor"
77
77
  />
78
- <view v-else class="search_placeholder">{{placeholder}}</view>
78
+ <view v-else class="search_placeholder">{{keyword || placeholder}}</view>
79
79
  <xd-font-icon v-if="searchIconPosition==='right'" :icon="icon" :color="iconColor" size="32"/>
80
80
  <view v-if="showSearchBtn==='Y' && searchBtnPosition==='in'"
81
81
  class="search_btn_in"
@@ -79,7 +79,7 @@
79
79
  @click="toSearch"
80
80
  :placeholder-style="'color:' + inputTextColor"
81
81
  />
82
- <view v-else class="search_placeholder">{{placeholder}}</view>
82
+ <view v-else class="search_placeholder">{{keyword || placeholder}}</view>
83
83
  <xd-font-icon v-if="searchIconPosition==='right'" :icon="icon" :color="iconColor" size="32"/>
84
84
  <view v-if="showSearchBtn==='Y' && searchBtnPosition==='in'"
85
85
  class="search_btn_in"
@@ -74,15 +74,4 @@ module.exports = [
74
74
  isConsole: true,
75
75
  disabled: true,
76
76
  },
77
- {
78
- title: "再来一单",
79
- path: "/cart/v1/cart/reorder",
80
- mapFnName: "reCartOrder",
81
- isRule: false,
82
- data: {
83
- main_order_id: ['订单ID', 'String', true],
84
- },
85
- isConsole: true,
86
- disabled: true,
87
- }
88
77
  ];
@@ -183,7 +183,7 @@
183
183
  v-for="(Sitem, Sindex) in item.products"
184
184
  :key="Sindex"
185
185
  >
186
- <view class="jfb-base-order-detail__body-delivery-content" @click="handleToProduct(Sitem)">
186
+ <view class="jfb-base-order-detail__body-delivery-content">
187
187
  <xd-jfb-image
188
188
  width="200"
189
189
  height="200"
@@ -1037,17 +1037,6 @@ export default {
1037
1037
  dialogCode: null,
1038
1038
 
1039
1039
  showApplyAfter: "",
1040
- actionBtns: [
1041
- 'view_logistics', //包裹列表
1042
- 'cancel_unpaid', //取消订单
1043
- 'delete', //删除订单
1044
- 'service_process_list', //服务进度
1045
- 'pay', //支付
1046
- 'apply_refund', //申请退款
1047
- 'invoice', //发票申请
1048
- 'viewInvoice', //查看发票
1049
- 'reorder' //重新下单
1050
- ],
1051
1040
 
1052
1041
  //基础
1053
1042
  radius: 0,
@@ -1402,7 +1391,6 @@ export default {
1402
1391
  if(pay.length === 1) del = []
1403
1392
  res.buttons = del.concat(res.buttons || [])
1404
1393
  }
1405
- res.buttons = res.buttons.filter(btn => this.actionBtns.includes(btn.action))
1406
1394
 
1407
1395
  if (res.product) {
1408
1396
  try {
@@ -1673,73 +1661,20 @@ export default {
1673
1661
  }).catch(err => {
1674
1662
  this.$xdHideLoading();
1675
1663
  })
1676
- }else if (item.action === "invoice") {
1664
+ }if (item.action === "invoice") {
1677
1665
  this.$xdUniHelper.navigateTo({
1678
1666
  url: `${this.invoicePath}?main_order_id=${this.main_order_id}&pay_order_id=${this.info.pay_info.pay_order_id}`,
1679
1667
  });
1680
- }else if (item.action === "viewInvoice") {
1668
+ }if (item.action === "viewInvoice") {
1681
1669
  this.$xdUniHelper.navigateTo({
1682
1670
  url: `${this.viewInvoicePath}?main_order_id=${this.main_order_id}&pay_order_id=${this.info.pay_info.pay_order_id}`,
1683
1671
  });
1684
- }else if(item.action === 'reorder'){
1685
- //再来一单
1686
- this.$xdShowLoading({});
1687
- jfbRootExec("reCartOrder", {
1688
- vm: this,
1689
- data: {
1690
- main_order_id: this.main_order_id
1691
- }
1692
- }).then(res => {
1693
- this.$xdHideLoading();
1694
- if(item.extras){
1695
- let reOrderPath = {};
1696
- try{
1697
- let extras = JSON.parse(item.extras);
1698
- let urlObj = JSON.parse(extras.place_order_url);
1699
- if(this.$xdUniHelper.checkVarType(urlObj) === 'object'){
1700
- reOrderPath = {
1701
- url: urlObj['page_value'],
1702
- 'jfb-platform': urlObj
1703
- }
1704
- }else{
1705
- throw new Error('不合法的extras');
1706
- }
1707
- }catch(err){
1708
- reOrderPath = {
1709
- url: item.extras
1710
- }
1711
- }
1712
- this.$xdUniHelper.navigateTo(reOrderPath);
1713
- }
1714
- }).catch(err => {
1715
- this.$xdHideLoading();
1716
- })
1717
1672
  }
1718
1673
  else {
1719
1674
  console.error(`item.action=${item.action}, 此action不可用`)
1720
1675
  }
1721
1676
  },
1722
- handleToProduct(item){
1723
- let productPath = {};
1724
- if(item.product_detail_url){
1725
- try{
1726
- let urlObj = JSON.parse(item.product_detail_url);
1727
- if(this.$xdUniHelper.checkVarType(urlObj) === 'object'){
1728
- productPath = {
1729
- url: urlObj['page_value'] + "?product_id=" + item.product_id,
1730
- 'jfb-platform': urlObj
1731
- }
1732
- }else{
1733
- throw new Error('不合法的product_detail_url');
1734
- }
1735
- }catch(err){
1736
- productPath = {
1737
- url: item.product_detail_url
1738
- }
1739
- }
1740
- this.$xdUniHelper.navigateTo(productPath);
1741
- }
1742
- },
1677
+
1743
1678
  handleDeleteOrder(){
1744
1679
  jfbRootExec("deleteBaseOrder", {
1745
1680
  vm: this,
@@ -45,16 +45,5 @@ module.exports = [
45
45
  },
46
46
  isConsole: true,
47
47
  disabled: true,
48
- },
49
- {
50
- title: "再来一单",
51
- path: "/cart/v1/cart/reorder",
52
- mapFnName: "reCartOrder",
53
- isRule: false,
54
- data: {
55
- main_order_id: ['订单ID', 'String', true],
56
- },
57
- isConsole: true,
58
- disabled: true,
59
48
  }
60
49
  ];
@@ -287,7 +287,6 @@ export default {
287
287
  refundFastPath: "",
288
288
 
289
289
  noticeBgc:'',
290
- actionBtns: ['cancel_unpaid', 'pay', 'apply_refund', 'reorder']
291
290
  };
292
291
  },
293
292
 
@@ -472,41 +471,8 @@ export default {
472
471
  }).catch(err => {
473
472
  this.$xdHideLoading();
474
473
  })
475
- }else if(action === 'reorder'){
476
- //重新下单
477
- this.$xdShowLoading({});
478
- jfbRootExec("reCartOrder", {
479
- vm: this,
480
- data: {
481
- main_order_id: item.main_order_id
482
- }
483
- }).then(res => {
484
- this.$xdHideLoading();
485
- let btnReOrder = item.buttons.find(item => item.action === 'reorder');
486
- if(btnReOrder.extras){
487
- let reOrderPath = {};
488
- try{
489
- let extras = JSON.parse(btnReOrder.extras);
490
- let urlObj = JSON.parse(extras.place_order_url);
491
- if(this.$xdUniHelper.checkVarType(urlObj) === 'object'){
492
- reOrderPath = {
493
- url: urlObj['page_value'],
494
- 'jfb-platform': urlObj
495
- }
496
- }else{
497
- throw new Error('不合法的extras');
498
- }
499
- }catch(err){
500
- reOrderPath = {
501
- url: btnReOrder.extras
502
- }
503
- }
504
- this.$xdUniHelper.navigateTo(reOrderPath);
505
- }
506
474
 
507
- }).catch(err => {
508
- this.$xdHideLoading();
509
- })
475
+
510
476
  }
511
477
  },
512
478
 
@@ -536,7 +502,6 @@ export default {
536
502
  : "";
537
503
  return prod;
538
504
  });
539
- item.buttons = item.buttons.filter(btn => this.actionBtns.includes(btn.action));
540
505
  item.buttons = item.buttons.map((btn, i) => {
541
506
  btn["key"] = btn.action + i;
542
507
  return btn;