提交 4ac03861 编写于 作者: G gongfuxiang

修复小程序海报参数错误

上级 51fe237f
...@@ -60,19 +60,12 @@ ...@@ -60,19 +60,12 @@
* 启动参数处理 * 启动参数处理
*/ */
launch_params_handle(params) { launch_params_handle(params) {
// 启动参数处理
if ((params.query || null) != null) { if ((params.query || null) != null) {
params = params.query; params = params.query;
} }
if ((params.scene || null) != null) { if ((params.scene || null) != null) {
params = this.url_params_to_json(decodeURIComponent(params.scene)); params = this.url_params_to_json(decodeURIComponent(params.scene));
} }
// 缓存启动参数
uni.setStorage({
key: this.data.cache_launch_info_key,
data: params
});
return params; return params;
}, },
...@@ -303,8 +296,7 @@ ...@@ -303,8 +296,7 @@
*/ */
get_user_login_info(object, method, login_data, auth_data) { get_user_login_info(object, method, login_data, auth_data) {
// 邀请人参数 // 邀请人参数
var params = uni.getStorageSync(this.data.cache_launch_info_key) || null; var params = uni.getStorageSync(this.data.cache_launch_info_key) || null;
console.log(params);
var referrer = params == null ? 0 : params.referrer || 0; var referrer = params == null ? 0 : params.referrer || 0;
// 请求数据 // 请求数据
...@@ -1018,8 +1010,12 @@ ...@@ -1018,8 +1010,12 @@
* 小程序初始化 * 小程序初始化
*/ */
onLaunch(params) { onLaunch(params) {
// 启动参数处理 // 启动参数处理+缓存
params = this.globalData.launch_params_handle(params); params = this.globalData.launch_params_handle(params);
uni.setStorage({
key: this.globalData.data.cache_launch_info_key,
data: params
});
// 设置设备信息 // 设置设备信息
this.globalData.set_system_info(); this.globalData.set_system_info();
......
...@@ -625,7 +625,7 @@ ...@@ -625,7 +625,7 @@
onLoad(params) { onLoad(params) {
var system_info = app.globalData.get_system_info(); var system_info = app.globalData.get_system_info();
this.setData({ this.setData({
params: params, params: app.globalData.launch_params_handle(params),
system_info: system_info, system_info: system_info,
photo_height: (system_info || null) == null ? '55vh' : (system_info.windowWidth || system_info.screenWidth) + 'px' photo_height: (system_info || null) == null ? '55vh' : (system_info.windowWidth || system_info.screenWidth) + 'px'
}); });
......
...@@ -79,7 +79,7 @@ ...@@ -79,7 +79,7 @@
onLoad(params) { onLoad(params) {
this.setData({ this.setData({
params: params params: app.globalData.launch_params_handle(params)
}); });
this.init(); this.init();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册