jmash-core-mp 0.1.70 → 0.1.72
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/lib/utils/share.d.ts +11 -3
- package/lib/utils/share.js +133 -15
- package/package.json +1 -1
- package/src/components/organ/organ-selected-item.mpx +2 -1
- package/src/components/shop/shop-selected-item.mpx +2 -2
- package/src/packages/index.mpx +0 -3
- package/src/pages/tabbar/home.mpx +7 -3
- package/src/pages/tabbar/mall.mpx +7 -3
- package/src/pages/tabbar/organ.mpx +7 -3
- package/src/utils/share.ts +133 -15
- package/lib/app.mpx.d.ts +0 -1
- package/lib/components/auth-user/jmash-update-user.mpx.d.ts +0 -1
- package/lib/components/auth-user/jmash-user.mpx.d.ts +0 -1
- package/lib/components/cms/jmash-cms-activity-item.mpx.d.ts +0 -1
- package/lib/components/cms/jmash-cms-activity-list.mpx.d.ts +0 -1
- package/lib/components/cms/jmash-cms-article-item.mpx.d.ts +0 -1
- package/lib/components/cms/jmash-cms-article-list.mpx.d.ts +0 -1
- package/lib/components/cms/jmash-cms-article-view.mpx.d.ts +0 -1
- package/lib/components/cms/jmash-cms-article.mpx.d.ts +0 -1
- package/lib/components/cms/jmash-cms-like.mpx.d.ts +0 -1
- package/lib/components/cms/jmash-cms-location-list.mpx.d.ts +0 -1
- package/lib/components/cms/jmash-cms-location.mpx.d.ts +0 -1
- package/lib/components/cms/jmash-cms-product-item.mpx.d.ts +0 -1
- package/lib/components/cms/jmash-cms-product-list.mpx.d.ts +0 -1
- package/lib/components/common/jmash-none-data.mpx.d.ts +0 -1
- package/lib/components/common/jmash-search.mpx.d.ts +0 -1
- package/lib/components/common/jmash-stepper.mpx.d.ts +0 -1
- package/lib/components/common/jmash-top-navigation.mpx.d.ts +0 -1
- package/lib/components/core/jmash-login.mpx.d.ts +0 -1
- package/lib/components/organ/browser-organ-list.mpx.d.ts +0 -1
- package/lib/components/organ/my-organ-list.mpx.d.ts +0 -1
- package/lib/components/organ/organ-item.mpx.d.ts +0 -1
- package/lib/components/organ/organ-search.mpx.d.ts +0 -1
- package/lib/components/organ/organ-selected-item.mpx.d.ts +0 -1
- package/lib/components/shop/branch-item.mpx.d.ts +0 -1
- package/lib/components/shop/branch-search.mpx.d.ts +0 -1
- package/lib/components/shop/shop-item.mpx.d.ts +0 -1
- package/lib/components/shop/shop-search.mpx.d.ts +0 -1
- package/lib/components/shop/shop-selected-item.mpx.d.ts +0 -1
- package/lib/packages/pages/auth/setting-page.mpx.d.ts +0 -1
- package/lib/packages/pages/cms/cms-activity-list.mpx.d.ts +0 -1
- package/lib/packages/pages/cms/cms-article-list.mpx.d.ts +0 -1
- package/lib/packages/pages/cms/cms-location-list.mpx.d.ts +0 -1
- package/lib/packages/pages/cms/cms-product-list.mpx.d.ts +0 -1
- package/lib/packages/pages/share/share-mall.mpx.d.ts +0 -1
- package/lib/packages/pages/share/share-organ.mpx.d.ts +0 -1
- package/lib/packages/pages/share/share-user.mpx.d.ts +0 -1
- package/lib/pages/branch-search.mpx.d.ts +0 -1
- package/lib/pages/organ-search.mpx.d.ts +0 -1
- package/lib/pages/organ.mpx.d.ts +0 -1
- package/lib/pages/shop-search.mpx.d.ts +0 -1
- package/src/packages/pages/share/share-mall.mpx +0 -87
- package/src/packages/pages/share/share-organ.mpx +0 -75
- package/src/packages/pages/share/share-user.mpx +0 -62
package/lib/utils/share.d.ts
CHANGED
|
@@ -1,7 +1,15 @@
|
|
|
1
1
|
declare class ShareUtil {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
getCurrentPage(): string;
|
|
3
|
+
getCurrentQuery(): string;
|
|
4
|
+
shareUserPath(pagePath: string, query: string): string;
|
|
5
|
+
shareUserQuery(query: string): string;
|
|
6
|
+
shareUserLoad(options: Record<string, string>): Promise<boolean>;
|
|
7
|
+
shareOrganPath(pagePath: string, query: string): string;
|
|
8
|
+
shareOrganQuery(query: string): string;
|
|
9
|
+
shareOrganLoad(options: Record<string, string>): Promise<boolean>;
|
|
10
|
+
shareMallPath(pagePath: string, query: string): string;
|
|
11
|
+
shareMallQuery(query: string): string;
|
|
12
|
+
shareMallLoad(options: Record<string, string>): Promise<boolean>;
|
|
5
13
|
}
|
|
6
14
|
declare const share: ShareUtil;
|
|
7
15
|
export { share };
|
package/lib/utils/share.js
CHANGED
|
@@ -1,35 +1,153 @@
|
|
|
1
1
|
import { useUserStore } from "../store/user";
|
|
2
2
|
import { useOrganStore } from "../store/organ";
|
|
3
3
|
import { useShopStore } from "../store/shop";
|
|
4
|
+
import { shopApi } from "../api/shop";
|
|
4
5
|
// 分享工具类
|
|
5
6
|
class ShareUtil {
|
|
6
|
-
//
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
// 获取当前页面path
|
|
8
|
+
getCurrentPage() {
|
|
9
|
+
// 获取页面栈
|
|
10
|
+
const pages = getCurrentPages();
|
|
11
|
+
// 当前页实例
|
|
12
|
+
const currentPage = pages[pages.length - 1];
|
|
13
|
+
// 当前页面path
|
|
14
|
+
return currentPage.route;
|
|
15
|
+
}
|
|
16
|
+
// 获取当前页面query
|
|
17
|
+
getCurrentQuery() {
|
|
18
|
+
// 获取页面栈
|
|
19
|
+
const pages = getCurrentPages();
|
|
20
|
+
// 当前页实例
|
|
21
|
+
const currentPage = pages[pages.length - 1];
|
|
22
|
+
// 当前页面path
|
|
23
|
+
const options = currentPage.options;
|
|
24
|
+
return Object.keys(options)
|
|
25
|
+
.filter((key) => key !== "referee")
|
|
26
|
+
.filter((key) => key !== "organTenant")
|
|
27
|
+
.filter((key) => key !== "shopId")
|
|
28
|
+
.filter((key) => key !== "branchId")
|
|
29
|
+
.map((key) => `${key}=${options[key]}`)
|
|
30
|
+
.join("&");
|
|
31
|
+
}
|
|
32
|
+
// 分享用户页给好友
|
|
33
|
+
shareUserPath(pagePath, query) {
|
|
9
34
|
const userStore = useUserStore();
|
|
10
35
|
const referee = userStore.userInfo?.userId || "";
|
|
11
|
-
return
|
|
36
|
+
return `${pagePath}?referee=${referee}&${query}`;
|
|
12
37
|
}
|
|
13
|
-
//
|
|
14
|
-
|
|
15
|
-
const
|
|
38
|
+
// 分享用户页到朋友圈
|
|
39
|
+
shareUserQuery(query) {
|
|
40
|
+
const userStore = useUserStore();
|
|
41
|
+
const referee = userStore.userInfo?.userId || "";
|
|
42
|
+
return `referee=${referee}&${query}`;
|
|
43
|
+
}
|
|
44
|
+
// 分享用户页加载
|
|
45
|
+
shareUserLoad(options) {
|
|
46
|
+
//推荐人
|
|
47
|
+
const userStore = useUserStore();
|
|
48
|
+
if (options.referee) {
|
|
49
|
+
userStore.setReferee(options.referee);
|
|
50
|
+
}
|
|
51
|
+
//静默登录
|
|
52
|
+
return userStore.loginOnlyAC();
|
|
53
|
+
}
|
|
54
|
+
// 分享组织页给好友
|
|
55
|
+
shareOrganPath(pagePath, query) {
|
|
16
56
|
const userStore = useUserStore();
|
|
17
57
|
const referee = userStore.userInfo?.userId || "";
|
|
18
58
|
const organStore = useOrganStore();
|
|
19
59
|
const organTenant = organStore.organTenant || "";
|
|
20
|
-
return
|
|
60
|
+
return `${pagePath}?referee=${referee}&organTenant=${organTenant}&${query}`;
|
|
21
61
|
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
const pagePath = encodeURIComponent(`${path}`);
|
|
62
|
+
// 分享组织页给朋友圈
|
|
63
|
+
shareOrganQuery(query) {
|
|
25
64
|
const userStore = useUserStore();
|
|
26
65
|
const referee = userStore.userInfo?.userId || "";
|
|
27
|
-
const shopStore = useShopStore();
|
|
28
|
-
const shopId = shopStore.shopInfo?.shopId || "";
|
|
29
|
-
const branchId = shopStore.branchInfo?.branchId || "";
|
|
30
66
|
const organStore = useOrganStore();
|
|
31
67
|
const organTenant = organStore.organTenant || "";
|
|
32
|
-
return
|
|
68
|
+
return `referee=${referee}&organTenant=${organTenant}&${query}`;
|
|
69
|
+
}
|
|
70
|
+
// 分享组织页加载
|
|
71
|
+
shareOrganLoad(options) {
|
|
72
|
+
//推荐人
|
|
73
|
+
const userStore = useUserStore();
|
|
74
|
+
if (options.referee) {
|
|
75
|
+
userStore.setReferee(options.referee);
|
|
76
|
+
}
|
|
77
|
+
const organStore = useOrganStore();
|
|
78
|
+
console.log("组织租户", options.organTenant);
|
|
79
|
+
//组织Token
|
|
80
|
+
if (options.organTenant) {
|
|
81
|
+
return organStore.setOrganTenant(options.organTenant).then(() => {
|
|
82
|
+
//静默登录
|
|
83
|
+
return userStore.loginOnlyAC();
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
//静默登录
|
|
87
|
+
return userStore.loginOnlyAC();
|
|
88
|
+
}
|
|
89
|
+
// 分享电商页给好友
|
|
90
|
+
shareMallPath(pagePath, query) {
|
|
91
|
+
const userStore = useUserStore();
|
|
92
|
+
const referee = userStore.userInfo?.userId || "";
|
|
93
|
+
const shopStore = useShopStore();
|
|
94
|
+
if (shopStore.isShop) {
|
|
95
|
+
const shopId = shopStore.shopInfo?.shopId || "";
|
|
96
|
+
return `${pagePath}?referee=${referee}&shopId=${shopId}&${query}`;
|
|
97
|
+
}
|
|
98
|
+
else {
|
|
99
|
+
const organStore = useOrganStore();
|
|
100
|
+
const organTenant = organStore.organTenant || "";
|
|
101
|
+
const branchId = shopStore.branchInfo?.branchId || "";
|
|
102
|
+
return `${pagePath}?referee=${referee}&organTenant=${organTenant}&branchId=${branchId}&${query}`;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
// 分享电商页给朋友圈
|
|
106
|
+
shareMallQuery(query) {
|
|
107
|
+
const userStore = useUserStore();
|
|
108
|
+
const referee = userStore.userInfo?.userId || "";
|
|
109
|
+
const shopStore = useShopStore();
|
|
110
|
+
if (shopStore.isShop) {
|
|
111
|
+
const shopId = shopStore.shopInfo?.shopId || "";
|
|
112
|
+
return `referee=${referee}&shopId=${shopId}&${query}`;
|
|
113
|
+
}
|
|
114
|
+
else {
|
|
115
|
+
const organStore = useOrganStore();
|
|
116
|
+
const organTenant = organStore.organTenant || "";
|
|
117
|
+
const branchId = shopStore.branchInfo?.branchId || "";
|
|
118
|
+
return `referee=${referee}&organTenant=${organTenant}&branchId=${branchId}&${query}`;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
// 分享电商页加载
|
|
122
|
+
shareMallLoad(options) {
|
|
123
|
+
//推荐人
|
|
124
|
+
const userStore = useUserStore();
|
|
125
|
+
if (options.referee) {
|
|
126
|
+
userStore.setReferee(options.referee);
|
|
127
|
+
}
|
|
128
|
+
const shopStore = useShopStore();
|
|
129
|
+
//门店ID
|
|
130
|
+
if (options.branchId && options.organTenant) {
|
|
131
|
+
console.log("门店ID", options.branchId, options.organTenant);
|
|
132
|
+
return shopApi
|
|
133
|
+
.findShopBranchById(options.organTenant, options.branchId)
|
|
134
|
+
.then((res) => {
|
|
135
|
+
return shopStore.switchBranch(res.data).then(() => {
|
|
136
|
+
return userStore.loginOnlyAC();
|
|
137
|
+
});
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
else if (options.shopId) {
|
|
141
|
+
//商城ID
|
|
142
|
+
console.log("商城ID", options.shopId);
|
|
143
|
+
return shopApi.findShopInfoById(options.shopId).then((res) => {
|
|
144
|
+
return shopStore.switchShop(res.data).then(() => {
|
|
145
|
+
return userStore.loginOnlyAC();
|
|
146
|
+
});
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
//静默登录
|
|
150
|
+
return userStore.loginOnlyAC();
|
|
33
151
|
}
|
|
34
152
|
}
|
|
35
153
|
const share = new ShareUtil();
|
package/package.json
CHANGED
|
@@ -22,6 +22,7 @@
|
|
|
22
22
|
|
|
23
23
|
<script lang="ts">
|
|
24
24
|
import { createComponent } from "@mpxjs/core";
|
|
25
|
+
import { storeToRefs } from '@mpxjs/pinia'
|
|
25
26
|
import { useOrganStore } from "../../store/organ";
|
|
26
27
|
|
|
27
28
|
|
|
@@ -33,7 +34,7 @@ createComponent({
|
|
|
33
34
|
// 图片路径
|
|
34
35
|
let baseUrl = config.baseUrl + "/v1/file/image/resize/100/100/";
|
|
35
36
|
let organStore = useOrganStore();
|
|
36
|
-
|
|
37
|
+
const { organInfo } = storeToRefs(organStore)
|
|
37
38
|
return { resourceUrl, baseUrl, organInfo }
|
|
38
39
|
},
|
|
39
40
|
})
|
|
@@ -22,6 +22,7 @@
|
|
|
22
22
|
|
|
23
23
|
<script lang="ts">
|
|
24
24
|
import { createComponent } from "@mpxjs/core";
|
|
25
|
+
import { storeToRefs } from '@mpxjs/pinia'
|
|
25
26
|
import { useShopStore } from "../../store/shop";
|
|
26
27
|
|
|
27
28
|
createComponent({
|
|
@@ -32,8 +33,7 @@ createComponent({
|
|
|
32
33
|
// 图片路径
|
|
33
34
|
let baseUrl = config.baseUrl + "/v1/file/image/resize/100/100/";
|
|
34
35
|
const shopStore = useShopStore();
|
|
35
|
-
|
|
36
|
-
let shopInfo = shopStore.shopInfo;
|
|
36
|
+
const { branchInfo, shopInfo } = storeToRefs(shopStore);
|
|
37
37
|
//获取门店用户信息
|
|
38
38
|
shopStore.getMyBranchUserInfo();
|
|
39
39
|
return { resourceUrl, baseUrl, branchInfo, shopInfo, shopStore }
|
package/src/packages/index.mpx
CHANGED
|
@@ -35,8 +35,12 @@ createPage({
|
|
|
35
35
|
}
|
|
36
36
|
]
|
|
37
37
|
},
|
|
38
|
+
onLoad(options) {
|
|
39
|
+
share.shareUserLoad(options).then(() => {
|
|
40
|
+
this.userStore = useUserStore();
|
|
41
|
+
});
|
|
42
|
+
},
|
|
38
43
|
onShow() {
|
|
39
|
-
this.userStore = useUserStore();
|
|
40
44
|
if (typeof this.getTabBar === 'function' &&
|
|
41
45
|
this.getTabBar()) {
|
|
42
46
|
this.getTabBar().$refs.tabBar.activeTab("Home");
|
|
@@ -53,13 +57,13 @@ createPage({
|
|
|
53
57
|
onShareAppMessage() {
|
|
54
58
|
return {
|
|
55
59
|
title: '首页-分享给好友',
|
|
56
|
-
path: share.shareUserPath(
|
|
60
|
+
path: share.shareUserPath(share.getCurrentPage(), share.getCurrentQuery())
|
|
57
61
|
}
|
|
58
62
|
},
|
|
59
63
|
onShareTimeline() {
|
|
60
64
|
return {
|
|
61
65
|
title: '首页-分享给朋友圈',
|
|
62
|
-
query: share.
|
|
66
|
+
query: share.shareUserQuery(share.getCurrentQuery())
|
|
63
67
|
}
|
|
64
68
|
},
|
|
65
69
|
|
|
@@ -23,8 +23,12 @@ createPage({
|
|
|
23
23
|
}
|
|
24
24
|
]
|
|
25
25
|
},
|
|
26
|
+
onLoad(options) {
|
|
27
|
+
share.shareMallLoad(options).then(() => {
|
|
28
|
+
this.userStore = useUserStore();
|
|
29
|
+
});
|
|
30
|
+
},
|
|
26
31
|
onShow() {
|
|
27
|
-
this.userStore = useUserStore();
|
|
28
32
|
if (typeof this.getTabBar === 'function' &&
|
|
29
33
|
this.getTabBar()) {
|
|
30
34
|
this.getTabBar().$refs.tabBar.activeTab("Mall");
|
|
@@ -41,13 +45,13 @@ createPage({
|
|
|
41
45
|
onShareAppMessage() {
|
|
42
46
|
return {
|
|
43
47
|
title: '电商首页-分享给好友',
|
|
44
|
-
path: share.shareMallPath(
|
|
48
|
+
path: share.shareMallPath(share.getCurrentPage(), share.getCurrentQuery())
|
|
45
49
|
}
|
|
46
50
|
},
|
|
47
51
|
onShareTimeline() {
|
|
48
52
|
return {
|
|
49
53
|
title: '电商首页-分享给朋友圈',
|
|
50
|
-
query: share.
|
|
54
|
+
query: share.shareMallQuery(share.getCurrentQuery())
|
|
51
55
|
}
|
|
52
56
|
},
|
|
53
57
|
|
|
@@ -22,8 +22,12 @@ createPage({
|
|
|
22
22
|
}
|
|
23
23
|
]
|
|
24
24
|
},
|
|
25
|
+
onLoad(options) {
|
|
26
|
+
share.shareOrganLoad(options).then(() => {
|
|
27
|
+
this.userStore = useUserStore();
|
|
28
|
+
});
|
|
29
|
+
},
|
|
25
30
|
onShow() {
|
|
26
|
-
this.userStore = useUserStore();
|
|
27
31
|
if (typeof this.getTabBar === 'function' &&
|
|
28
32
|
this.getTabBar()) {
|
|
29
33
|
this.getTabBar().$refs.tabBar.activeTab("Organ");
|
|
@@ -40,13 +44,13 @@ createPage({
|
|
|
40
44
|
onShareAppMessage() {
|
|
41
45
|
return {
|
|
42
46
|
title: '组织首页-分享给好友',
|
|
43
|
-
path: share.shareOrganPath(
|
|
47
|
+
path: share.shareOrganPath(share.getCurrentPage(), share.getCurrentQuery())
|
|
44
48
|
}
|
|
45
49
|
},
|
|
46
50
|
onShareTimeline() {
|
|
47
51
|
return {
|
|
48
52
|
title: '组织首页-分享给朋友圈',
|
|
49
|
-
query: share.
|
|
53
|
+
query: share.shareOrganQuery(share.getCurrentQuery())
|
|
50
54
|
}
|
|
51
55
|
},
|
|
52
56
|
|
package/src/utils/share.ts
CHANGED
|
@@ -1,35 +1,153 @@
|
|
|
1
1
|
import { useUserStore } from "../store/user";
|
|
2
2
|
import { useOrganStore } from "../store/organ";
|
|
3
3
|
import { useShopStore } from "../store/shop";
|
|
4
|
+
import { shopApi } from "../api/shop";
|
|
4
5
|
// 分享工具类
|
|
5
6
|
class ShareUtil {
|
|
6
|
-
//
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
// 获取当前页面path
|
|
8
|
+
getCurrentPage(): string {
|
|
9
|
+
// 获取页面栈
|
|
10
|
+
const pages = getCurrentPages();
|
|
11
|
+
// 当前页实例
|
|
12
|
+
const currentPage = pages[pages.length - 1];
|
|
13
|
+
// 当前页面path
|
|
14
|
+
return currentPage.route;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
// 获取当前页面query
|
|
18
|
+
getCurrentQuery(): string {
|
|
19
|
+
// 获取页面栈
|
|
20
|
+
const pages = getCurrentPages();
|
|
21
|
+
// 当前页实例
|
|
22
|
+
const currentPage = pages[pages.length - 1];
|
|
23
|
+
// 当前页面path
|
|
24
|
+
const options = currentPage.options;
|
|
25
|
+
return Object.keys(options)
|
|
26
|
+
.filter((key) => key !== "referee")
|
|
27
|
+
.filter((key) => key !== "organTenant")
|
|
28
|
+
.filter((key) => key !== "shopId")
|
|
29
|
+
.filter((key) => key !== "branchId")
|
|
30
|
+
.map((key) => `${key}=${options[key]}`)
|
|
31
|
+
.join("&");
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
// 分享用户页给好友
|
|
35
|
+
shareUserPath(pagePath: string, query: string): string {
|
|
9
36
|
const userStore = useUserStore();
|
|
10
37
|
const referee = userStore.userInfo?.userId || "";
|
|
11
|
-
return
|
|
38
|
+
return `${pagePath}?referee=${referee}&${query}`;
|
|
12
39
|
}
|
|
13
|
-
//
|
|
14
|
-
|
|
15
|
-
const
|
|
40
|
+
// 分享用户页到朋友圈
|
|
41
|
+
shareUserQuery(query: string): string {
|
|
42
|
+
const userStore = useUserStore();
|
|
43
|
+
const referee = userStore.userInfo?.userId || "";
|
|
44
|
+
return `referee=${referee}&${query}`;
|
|
45
|
+
}
|
|
46
|
+
// 分享用户页加载
|
|
47
|
+
shareUserLoad(options: Record<string, string>): Promise<boolean> {
|
|
48
|
+
//推荐人
|
|
49
|
+
const userStore = useUserStore();
|
|
50
|
+
if (options.referee) {
|
|
51
|
+
userStore.setReferee(options.referee);
|
|
52
|
+
}
|
|
53
|
+
//静默登录
|
|
54
|
+
return userStore.loginOnlyAC();
|
|
55
|
+
}
|
|
56
|
+
// 分享组织页给好友
|
|
57
|
+
shareOrganPath(pagePath: string, query: string): string {
|
|
16
58
|
const userStore = useUserStore();
|
|
17
59
|
const referee = userStore.userInfo?.userId || "";
|
|
18
60
|
const organStore = useOrganStore();
|
|
19
61
|
const organTenant = organStore.organTenant || "";
|
|
20
|
-
return
|
|
62
|
+
return `${pagePath}?referee=${referee}&organTenant=${organTenant}&${query}`;
|
|
21
63
|
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
const pagePath = encodeURIComponent(`${path}`);
|
|
64
|
+
// 分享组织页给朋友圈
|
|
65
|
+
shareOrganQuery(query: string): string {
|
|
25
66
|
const userStore = useUserStore();
|
|
26
67
|
const referee = userStore.userInfo?.userId || "";
|
|
27
|
-
const shopStore = useShopStore();
|
|
28
|
-
const shopId = shopStore.shopInfo?.shopId || "";
|
|
29
|
-
const branchId = shopStore.branchInfo?.branchId || "";
|
|
30
68
|
const organStore = useOrganStore();
|
|
31
69
|
const organTenant = organStore.organTenant || "";
|
|
32
|
-
return
|
|
70
|
+
return `referee=${referee}&organTenant=${organTenant}&${query}`;
|
|
71
|
+
}
|
|
72
|
+
// 分享组织页加载
|
|
73
|
+
shareOrganLoad(options: Record<string, string>): Promise<boolean> {
|
|
74
|
+
//推荐人
|
|
75
|
+
const userStore = useUserStore();
|
|
76
|
+
if (options.referee) {
|
|
77
|
+
userStore.setReferee(options.referee);
|
|
78
|
+
}
|
|
79
|
+
const organStore = useOrganStore();
|
|
80
|
+
console.log("组织租户", options.organTenant);
|
|
81
|
+
//组织Token
|
|
82
|
+
if (options.organTenant) {
|
|
83
|
+
return organStore.setOrganTenant(options.organTenant).then(() => {
|
|
84
|
+
//静默登录
|
|
85
|
+
return userStore.loginOnlyAC();
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
//静默登录
|
|
89
|
+
return userStore.loginOnlyAC();
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
// 分享电商页给好友
|
|
93
|
+
shareMallPath(pagePath: string, query: string): string {
|
|
94
|
+
const userStore = useUserStore();
|
|
95
|
+
const referee = userStore.userInfo?.userId || "";
|
|
96
|
+
const shopStore = useShopStore();
|
|
97
|
+
if (shopStore.isShop) {
|
|
98
|
+
const shopId = shopStore.shopInfo?.shopId || "";
|
|
99
|
+
return `${pagePath}?referee=${referee}&shopId=${shopId}&${query}`;
|
|
100
|
+
} else {
|
|
101
|
+
const organStore = useOrganStore();
|
|
102
|
+
const organTenant = organStore.organTenant || "";
|
|
103
|
+
const branchId = shopStore.branchInfo?.branchId || "";
|
|
104
|
+
return `${pagePath}?referee=${referee}&organTenant=${organTenant}&branchId=${branchId}&${query}`;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
// 分享电商页给朋友圈
|
|
108
|
+
shareMallQuery(query: string): string {
|
|
109
|
+
const userStore = useUserStore();
|
|
110
|
+
const referee = userStore.userInfo?.userId || "";
|
|
111
|
+
const shopStore = useShopStore();
|
|
112
|
+
if (shopStore.isShop) {
|
|
113
|
+
const shopId = shopStore.shopInfo?.shopId || "";
|
|
114
|
+
return `referee=${referee}&shopId=${shopId}&${query}`;
|
|
115
|
+
} else {
|
|
116
|
+
const organStore = useOrganStore();
|
|
117
|
+
const organTenant = organStore.organTenant || "";
|
|
118
|
+
const branchId = shopStore.branchInfo?.branchId || "";
|
|
119
|
+
return `referee=${referee}&organTenant=${organTenant}&branchId=${branchId}&${query}`;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
// 分享电商页加载
|
|
123
|
+
shareMallLoad(options: Record<string, string>): Promise<boolean> {
|
|
124
|
+
//推荐人
|
|
125
|
+
const userStore = useUserStore();
|
|
126
|
+
if (options.referee) {
|
|
127
|
+
userStore.setReferee(options.referee);
|
|
128
|
+
}
|
|
129
|
+
const shopStore = useShopStore();
|
|
130
|
+
//门店ID
|
|
131
|
+
if (options.branchId && options.organTenant) {
|
|
132
|
+
console.log("门店ID", options.branchId, options.organTenant);
|
|
133
|
+
return shopApi
|
|
134
|
+
.findShopBranchById(options.organTenant, options.branchId)
|
|
135
|
+
.then((res) => {
|
|
136
|
+
return shopStore.switchBranch(res.data).then(() => {
|
|
137
|
+
return userStore.loginOnlyAC();
|
|
138
|
+
});
|
|
139
|
+
});
|
|
140
|
+
} else if (options.shopId) {
|
|
141
|
+
//商城ID
|
|
142
|
+
console.log("商城ID", options.shopId);
|
|
143
|
+
return shopApi.findShopInfoById(options.shopId).then((res) => {
|
|
144
|
+
return shopStore.switchShop(res.data).then(() => {
|
|
145
|
+
return userStore.loginOnlyAC();
|
|
146
|
+
});
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
//静默登录
|
|
150
|
+
return userStore.loginOnlyAC();
|
|
33
151
|
}
|
|
34
152
|
}
|
|
35
153
|
const share = new ShareUtil();
|
package/lib/app.mpx.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/lib/pages/organ.mpx.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<image wx:if="{{ resourceUrl }}" class="img" src="{{ resourceUrl + '/images/mall/img-1.png' }}" mode="widthFix" />
|
|
3
|
-
</template>
|
|
4
|
-
|
|
5
|
-
<script lang="ts">
|
|
6
|
-
import mpx, { createPage, onLoad } from "@mpxjs/core";
|
|
7
|
-
import { useUserStore } from '../../../store/user';
|
|
8
|
-
import { useShopStore } from '../../../store/shop';
|
|
9
|
-
import { shopApi } from '../../../api/shop';
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
createPage({
|
|
13
|
-
setup() {
|
|
14
|
-
let config = getApp().globalData.config;
|
|
15
|
-
let userStore = useUserStore();
|
|
16
|
-
let resourceUrl = config.resourceUrl;
|
|
17
|
-
|
|
18
|
-
function jumpPagePath(options: any) {
|
|
19
|
-
//分享页面(静默登录)
|
|
20
|
-
if (options.pagePath) {
|
|
21
|
-
const pagePath = decodeURIComponent(options.pagePath as string);
|
|
22
|
-
userStore.loginOnlyAC().then((res) => {
|
|
23
|
-
if (res) {
|
|
24
|
-
// 登录成功,加载业务
|
|
25
|
-
console.log("静默登录成功", res);
|
|
26
|
-
}
|
|
27
|
-
console.log("跳转", pagePath);
|
|
28
|
-
mpx.reLaunch({ url: pagePath });
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* 生命周期函数--监听页面显示
|
|
35
|
-
*/
|
|
36
|
-
onLoad((options) => {
|
|
37
|
-
//推荐人
|
|
38
|
-
if (options.referee) {
|
|
39
|
-
userStore.setReferee(options.referee);
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
const shopStore = useShopStore();
|
|
43
|
-
|
|
44
|
-
//门店ID
|
|
45
|
-
if (options.branchId && options.organTenant) {
|
|
46
|
-
console.log("门店ID", options.branchId, options.organTenant);
|
|
47
|
-
shopApi.findShopBranchById(options.organTenant, options.branchId).then((res) => {
|
|
48
|
-
shopStore.switchBranch(res.data).then(() => {
|
|
49
|
-
jumpPagePath(options);
|
|
50
|
-
});
|
|
51
|
-
});
|
|
52
|
-
} else if (options.shopId) {
|
|
53
|
-
//商城ID
|
|
54
|
-
console.log("商城ID", options.shopId);
|
|
55
|
-
shopApi.findShopInfoById(options.shopId).then((res) => {
|
|
56
|
-
shopStore.switchShop(res.data).then(() => {
|
|
57
|
-
jumpPagePath(options);
|
|
58
|
-
});
|
|
59
|
-
});
|
|
60
|
-
}
|
|
61
|
-
});
|
|
62
|
-
return { resourceUrl }
|
|
63
|
-
},
|
|
64
|
-
})
|
|
65
|
-
</script>
|
|
66
|
-
|
|
67
|
-
<style lang="scss">
|
|
68
|
-
page {
|
|
69
|
-
background-image: linear-gradient(to bottom, #ffdbdb, #fffbfb, #fff7f7);
|
|
70
|
-
display: flex;
|
|
71
|
-
justify-content: center;
|
|
72
|
-
flex-direction: column;
|
|
73
|
-
align-items: center;
|
|
74
|
-
height: 100%;
|
|
75
|
-
|
|
76
|
-
.img {
|
|
77
|
-
width: 291px;
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
</style>
|
|
81
|
-
|
|
82
|
-
<script type="application/json">
|
|
83
|
-
{
|
|
84
|
-
"usingComponents": {},
|
|
85
|
-
"navigationStyle": "custom"
|
|
86
|
-
}
|
|
87
|
-
</script>
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<image wx:if="{{ resourceUrl }}" class="img" src="{{ resourceUrl + '/images/mall/img-1.png' }}" mode="widthFix" />
|
|
3
|
-
</template>
|
|
4
|
-
|
|
5
|
-
<script lang="ts">
|
|
6
|
-
import mpx, { createPage, onLoad } from "@mpxjs/core";
|
|
7
|
-
import { useUserStore } from '../../../store/user';
|
|
8
|
-
import { useOrganStore } from '../../../store/organ';
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
createPage({
|
|
12
|
-
setup() {
|
|
13
|
-
let config = getApp().globalData.config;
|
|
14
|
-
let userStore = useUserStore();
|
|
15
|
-
let organStore = useOrganStore();
|
|
16
|
-
let resourceUrl = config.resourceUrl;
|
|
17
|
-
|
|
18
|
-
function jumpPagePath(options: any) {
|
|
19
|
-
//分享页面(静默登录)
|
|
20
|
-
if (options.pagePath) {
|
|
21
|
-
const pagePath = decodeURIComponent(options.pagePath as string);
|
|
22
|
-
userStore.loginOnlyAC().then((res) => {
|
|
23
|
-
if (res) {
|
|
24
|
-
// 登录成功,加载业务
|
|
25
|
-
console.log("静默登录成功", res);
|
|
26
|
-
}
|
|
27
|
-
console.log("跳转", pagePath);
|
|
28
|
-
mpx.reLaunch({ url: pagePath });
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* 生命周期函数--监听页面显示
|
|
35
|
-
*/
|
|
36
|
-
onLoad((options) => {
|
|
37
|
-
//推荐人
|
|
38
|
-
if (options.referee) {
|
|
39
|
-
userStore.setReferee(options.referee);
|
|
40
|
-
}
|
|
41
|
-
//组织Token
|
|
42
|
-
if (options.organTenant) {
|
|
43
|
-
organStore.setOrganTenant(options.organTenant).then(() => {
|
|
44
|
-
jumpPagePath(options);
|
|
45
|
-
});
|
|
46
|
-
} else {
|
|
47
|
-
jumpPagePath(options);
|
|
48
|
-
}
|
|
49
|
-
});
|
|
50
|
-
return { resourceUrl }
|
|
51
|
-
},
|
|
52
|
-
})
|
|
53
|
-
</script>
|
|
54
|
-
|
|
55
|
-
<style lang="scss">
|
|
56
|
-
page {
|
|
57
|
-
background-image: linear-gradient(to bottom, #ffdbdb, #fffbfb, #fff7f7);
|
|
58
|
-
display: flex;
|
|
59
|
-
justify-content: center;
|
|
60
|
-
flex-direction: column;
|
|
61
|
-
align-items: center;
|
|
62
|
-
height: 100%;
|
|
63
|
-
|
|
64
|
-
.img {
|
|
65
|
-
width: 291px;
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
</style>
|
|
69
|
-
|
|
70
|
-
<script type="application/json">
|
|
71
|
-
{
|
|
72
|
-
"usingComponents": {},
|
|
73
|
-
"navigationStyle": "custom"
|
|
74
|
-
}
|
|
75
|
-
</script>
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<image wx:if="{{ resourceUrl }}" class="img" src="{{ resourceUrl + '/images/mall/img-1.png' }}" mode="widthFix" />
|
|
3
|
-
</template>
|
|
4
|
-
|
|
5
|
-
<script lang="ts">
|
|
6
|
-
import mpx, { createPage, onLoad } from "@mpxjs/core";
|
|
7
|
-
import { useUserStore } from '../../../store/user';
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
createPage({
|
|
11
|
-
setup() {
|
|
12
|
-
let config = getApp().globalData.config;
|
|
13
|
-
let userStore = useUserStore();
|
|
14
|
-
let resourceUrl = config.resourceUrl;
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* 生命周期函数--监听页面显示
|
|
18
|
-
*/
|
|
19
|
-
onLoad((options) => {
|
|
20
|
-
//推荐人
|
|
21
|
-
if (options.referee) {
|
|
22
|
-
userStore.setReferee(options.referee);
|
|
23
|
-
}
|
|
24
|
-
//分享页面(静默登录)
|
|
25
|
-
if (options.pagePath) {
|
|
26
|
-
const pagePath = decodeURIComponent(options.pagePath as string);
|
|
27
|
-
userStore.loginOnlyAC().then((res) => {
|
|
28
|
-
if (res) {
|
|
29
|
-
// 登录成功,加载业务
|
|
30
|
-
console.log("静默登录成功", res);
|
|
31
|
-
}
|
|
32
|
-
console.log("跳转", pagePath);
|
|
33
|
-
mpx.reLaunch({ url: pagePath });
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
});
|
|
37
|
-
return { resourceUrl }
|
|
38
|
-
},
|
|
39
|
-
})
|
|
40
|
-
</script>
|
|
41
|
-
|
|
42
|
-
<style lang="scss">
|
|
43
|
-
page {
|
|
44
|
-
background-image: linear-gradient(to bottom, #ffdbdb, #fffbfb, #fff7f7);
|
|
45
|
-
display: flex;
|
|
46
|
-
justify-content: center;
|
|
47
|
-
flex-direction: column;
|
|
48
|
-
align-items: center;
|
|
49
|
-
height: 100%;
|
|
50
|
-
|
|
51
|
-
.img {
|
|
52
|
-
width: 291px;
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
</style>
|
|
56
|
-
|
|
57
|
-
<script type="application/json">
|
|
58
|
-
{
|
|
59
|
-
"usingComponents": {},
|
|
60
|
-
"navigationStyle": "custom"
|
|
61
|
-
}
|
|
62
|
-
</script>
|