|
|
1
|
+import config from '../../config';
|
|
|
2
|
+import { verify } from '../../common/api';
|
|
|
3
|
+import commonModel from '../../models/common';
|
|
|
4
|
+
|
1
|
Page({
|
5
|
Page({
|
2
|
data: {
|
6
|
data: {
|
3
|
url: '',
|
7
|
url: '',
|
|
@@ -5,8 +9,19 @@ Page({ |
|
@@ -5,8 +9,19 @@ Page({ |
5
|
},
|
9
|
},
|
6
|
|
10
|
|
7
|
onLoad: function(options) {
|
11
|
onLoad: function(options) {
|
8
|
- this.loadElement(options);
|
12
|
+ if (options && options.scene && options.scene.length > 0) {
|
|
|
13
|
+ let code = options.scene;
|
9
|
|
14
|
|
|
|
15
|
+ return commonModel.getMiniAppRealParam(code)
|
|
|
16
|
+ .then(json => {
|
|
|
17
|
+ if (json) {
|
|
|
18
|
+ this.load(json);
|
|
|
19
|
+ }
|
|
|
20
|
+ })
|
|
|
21
|
+ .catch(() => {});
|
|
|
22
|
+ }
|
|
|
23
|
+
|
|
|
24
|
+ this.load(options);
|
10
|
},
|
25
|
},
|
11
|
|
26
|
|
12
|
onShareAppMessage: function() {
|
27
|
onShareAppMessage: function() {
|
|
@@ -16,11 +31,28 @@ Page({ |
|
@@ -16,11 +31,28 @@ Page({ |
16
|
};
|
31
|
};
|
17
|
},
|
32
|
},
|
18
|
|
33
|
|
19
|
- loadElement: function(options) {
|
34
|
+ load: function(options) {
|
|
|
35
|
+ let app = getApp();
|
|
|
36
|
+ let url = options.url;
|
|
|
37
|
+
|
|
|
38
|
+ if (options && options.url) {
|
|
|
39
|
+ let params = {};
|
|
|
40
|
+ let sys = wx.getSystemInfoSync();
|
|
|
41
|
+
|
|
|
42
|
+ params.uid = app.getUid();
|
|
|
43
|
+ params.udid = app._getSync('udid');
|
|
|
44
|
+ params.session_key = app._getSync('sessionKey');
|
|
|
45
|
+ params.app_version = config.apiParams.app_version;
|
|
|
46
|
+ params.client_type = config.apiParams.client_type;
|
|
|
47
|
+ params.screen_size = `${sys.windowWidth}x${sys.windowHeight}`;
|
|
|
48
|
+ params.os_version = sys.version;
|
|
|
49
|
+
|
|
|
50
|
+ verify.sign(params);
|
|
|
51
|
+
|
20
|
this.setData({
|
52
|
this.setData({
|
21
|
- title: options.title,
|
|
|
22
|
- url: decodeURIComponent(options.url)
|
53
|
+ url: decodeURIComponent(`${url}`)
|
23
|
});
|
54
|
});
|
|
|
55
|
+ }
|
24
|
},
|
56
|
},
|
25
|
|
57
|
|
26
|
bindGetMsg: function(e) {
|
58
|
bindGetMsg: function(e) {
|