jufubao-base 1.0.366-beta1 → 1.0.366-beta101
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/get.package.path.js +22 -0
- package/package.json +1 -1
- package/src/components/JfbBaseChoseCompany/JfbBaseChoseCompany.vue +67 -77
- package/src/components/JfbBaseOrderDetail/Api.js +0 -11
- package/src/components/JfbBaseOrderDetail/JfbBaseOrderDetail.vue +4 -68
- package/src/components/JfbBaseOrderList/Api.js +0 -11
- package/src/components/JfbBaseOrderList/JfbBaseOrderList.vue +1 -35
|
@@ -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
|
@@ -17,48 +17,50 @@
|
|
|
17
17
|
class="jfb-base-chose-company__body"
|
|
18
18
|
:style="{ minHeight: layoutInfo.bodyMinHeightRpx + 'rpx' }"
|
|
19
19
|
>
|
|
20
|
-
<
|
|
21
|
-
<view
|
|
22
|
-
|
|
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-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
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
|
-
<
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
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>
|
|
@@ -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"
|
|
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,72 +1661,20 @@ export default {
|
|
|
1673
1661
|
}).catch(err => {
|
|
1674
1662
|
this.$xdHideLoading();
|
|
1675
1663
|
})
|
|
1676
|
-
}
|
|
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
|
-
}
|
|
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 urlObj = JSON.parse(item.extras);
|
|
1698
|
-
if(this.$xdUniHelper.checkVarType(urlObj) === 'object'){
|
|
1699
|
-
reOrderPath = {
|
|
1700
|
-
url: urlObj['page_value'],
|
|
1701
|
-
'jfb-platform': urlObj
|
|
1702
|
-
}
|
|
1703
|
-
}else{
|
|
1704
|
-
throw new Error('不合法的extras');
|
|
1705
|
-
}
|
|
1706
|
-
}catch(err){
|
|
1707
|
-
reOrderPath = {
|
|
1708
|
-
url: item.extras
|
|
1709
|
-
}
|
|
1710
|
-
}
|
|
1711
|
-
this.$xdUniHelper.navigateTo(reOrderPath);
|
|
1712
|
-
}
|
|
1713
|
-
}).catch(err => {
|
|
1714
|
-
this.$xdHideLoading();
|
|
1715
|
-
})
|
|
1716
1672
|
}
|
|
1717
1673
|
else {
|
|
1718
1674
|
console.error(`item.action=${item.action}, 此action不可用`)
|
|
1719
1675
|
}
|
|
1720
1676
|
},
|
|
1721
|
-
|
|
1722
|
-
let productPath = {};
|
|
1723
|
-
if(item.product_detail_url){
|
|
1724
|
-
try{
|
|
1725
|
-
let urlObj = JSON.parse(item.product_detail_url);
|
|
1726
|
-
if(this.$xdUniHelper.checkVarType(urlObj) === 'object'){
|
|
1727
|
-
productPath = {
|
|
1728
|
-
url: urlObj['page_value'] + "?product_id=" + item.product_id,
|
|
1729
|
-
'jfb-platform': urlObj
|
|
1730
|
-
}
|
|
1731
|
-
}else{
|
|
1732
|
-
throw new Error('不合法的product_detail_url');
|
|
1733
|
-
}
|
|
1734
|
-
}catch(err){
|
|
1735
|
-
productPath = {
|
|
1736
|
-
url: item.product_detail_url
|
|
1737
|
-
}
|
|
1738
|
-
}
|
|
1739
|
-
this.$xdUniHelper.navigateTo(productPath);
|
|
1740
|
-
}
|
|
1741
|
-
},
|
|
1677
|
+
|
|
1742
1678
|
handleDeleteOrder(){
|
|
1743
1679
|
jfbRootExec("deleteBaseOrder", {
|
|
1744
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,40 +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 urlObj = JSON.parse(btnReOrder.extras);
|
|
490
|
-
if(this.$xdUniHelper.checkVarType(urlObj) === 'object'){
|
|
491
|
-
reOrderPath = {
|
|
492
|
-
url: urlObj['page_value'],
|
|
493
|
-
'jfb-platform': urlObj
|
|
494
|
-
}
|
|
495
|
-
}else{
|
|
496
|
-
throw new Error('不合法的extras');
|
|
497
|
-
}
|
|
498
|
-
}catch(err){
|
|
499
|
-
reOrderPath = {
|
|
500
|
-
url: btnReOrder.extras
|
|
501
|
-
}
|
|
502
|
-
}
|
|
503
|
-
this.$xdUniHelper.navigateTo(reOrderPath);
|
|
504
|
-
}
|
|
505
474
|
|
|
506
|
-
|
|
507
|
-
this.$xdHideLoading();
|
|
508
|
-
})
|
|
475
|
+
|
|
509
476
|
}
|
|
510
477
|
},
|
|
511
478
|
|
|
@@ -535,7 +502,6 @@ export default {
|
|
|
535
502
|
: "";
|
|
536
503
|
return prod;
|
|
537
504
|
});
|
|
538
|
-
item.buttons = item.buttons.filter(btn => this.actionBtns.includes(btn.action));
|
|
539
505
|
item.buttons = item.buttons.map((btn, i) => {
|
|
540
506
|
btn["key"] = btn.action + i;
|
|
541
507
|
return btn;
|