jump-to-miniapp.js
1.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
import wx from '../utils/wx';
import {stringify} from '../vendors/query-string';
const appData = {
yohobuy: {
appId: 'wx084ab813d88c594b',
page: {
productDetail: 'pages/goodsDetail/goodsDetail',
shopDetail: 'pages/goodsList/brandStore',
myOrders: 'pages/orders/orders'
}
},
yohobuyLimitChannel: {
appId: 'wxed31f9e8705fb8d1',
page: {
limitProductList: 'pages/index/index',
limitProductDetail: 'pages/product/detail/detail'
}
},
groupBuy: { // 拼团
appId: 'wx207f18be42db9028',
page: {
home: '/pages/group/home',
detail: '/pages/group/detail',
list: '/pages/group/list'
}
},
yoLuck: {
appId: 'wx7678b61d1e6702fe',
page: {
home: '/pages/zeroSell/index',
detail: '/pages/zeroSell/detail'
}
},
ufo: {
appId: 'wxc677c88385762287',
page: {
home: 'pages/index/index',
detail: 'pages/productDetail/index'
}
},
anotherApp: {
appId: 'wx084ab813d88c594b',
page: {
home: '/pages/product/detail/detail'
}
}
};
export default function(params) {
let navigateToMiniParams = {
appId: appData[params.app].appId,
path: params.path || `${appData[params.app].page[params.page]}?${stringify(params.data)}`
};
return wx.navigateToMiniProgram(navigateToMiniParams);
}