|
|
import config from '../../config';
|
|
|
import { verify } from '../../common/api';
|
|
|
import commonModel from '../../models/common';
|
|
|
|
|
|
Page({
|
|
|
data: {
|
|
|
url: '',
|
...
|
...
|
@@ -5,8 +9,19 @@ Page({ |
|
|
},
|
|
|
|
|
|
onLoad: function(options) {
|
|
|
this.loadElement(options);
|
|
|
if (options && options.scene && options.scene.length > 0) {
|
|
|
let code = options.scene;
|
|
|
|
|
|
return commonModel.getMiniAppRealParam(code)
|
|
|
.then(json => {
|
|
|
if (json) {
|
|
|
this.load(json);
|
|
|
}
|
|
|
})
|
|
|
.catch(() => {});
|
|
|
}
|
|
|
|
|
|
this.load(options);
|
|
|
},
|
|
|
|
|
|
onShareAppMessage: function() {
|
...
|
...
|
@@ -16,11 +31,28 @@ Page({ |
|
|
};
|
|
|
},
|
|
|
|
|
|
loadElement: function(options) {
|
|
|
load: function(options) {
|
|
|
let app = getApp();
|
|
|
let url = options.url;
|
|
|
|
|
|
if (options && options.url) {
|
|
|
let params = {};
|
|
|
let sys = wx.getSystemInfoSync();
|
|
|
|
|
|
params.uid = app.getUid();
|
|
|
params.udid = app._getSync('udid');
|
|
|
params.session_key = app._getSync('sessionKey');
|
|
|
params.app_version = config.apiParams.app_version;
|
|
|
params.client_type = config.apiParams.client_type;
|
|
|
params.screen_size = `${sys.windowWidth}x${sys.windowHeight}`;
|
|
|
params.os_version = sys.version;
|
|
|
|
|
|
verify.sign(params);
|
|
|
|
|
|
this.setData({
|
|
|
title: options.title,
|
|
|
url: decodeURIComponent(options.url)
|
|
|
url: decodeURIComponent(`${url}`)
|
|
|
});
|
|
|
}
|
|
|
},
|
|
|
|
|
|
bindGetMsg: function(e) {
|
...
|
...
|
|