diff --git a/App.vue b/App.vue index d3489717..8bc47ce1 100644 --- a/App.vue +++ b/App.vue @@ -2,7 +2,9 @@ import base64 from './common/js/lib/base64.js'; export default { globalData: { - data: { + data: { + // 场景值 + cache_scene_key: "cache_scene_key", // uuid缓存key cache_user_uuid_key: "cache_user_uuid_key", // 配置信息缓存key @@ -70,6 +72,29 @@ params = this.url_params_to_json(decodeURIComponent(params.scene)); } return params; + }, + + /** + * 当前是否单页模式 + */ + is_current_single_page() { + var scene = this.get_scene_data(); + return (scene == 1154 || scene == 1155) ? 1 : 0; + }, + + /** + * 场景值获取 + */ + get_scene_data() { + return uni.getStorageSync(this.data.cache_scene_key) || 0; + }, + + /** + * 场景值设置 + */ + set_scene_data(params) { + var scene = ((params.scene || null) == null) ? 0 : parseInt(params.scene); + uni.setStorageSync(this.data.cache_scene_key, scene); }, /** @@ -1207,7 +1232,7 @@ success: res => { uni.hideLoading(); if (res.data.code == 0) { - uni.setStorageSync(this.data.cache_user_info_key, res.data.data); + uni.setStorageSync(this.data.cache_sthis.data.cache_user_info_key, res.data.data); } else { this.showToast(res.data.msg); } @@ -1269,17 +1294,19 @@ */ onLaunch(params) { // 启动参数处理+缓存 - params = this.globalData.launch_params_handle(params); uni.setStorage({ key: this.globalData.data.cache_launch_info_key, - data: params + data: this.globalData.launch_params_handle(params) }); // 设置设备信息 this.globalData.set_system_info(); // 初始化配置 - this.globalData.init_config(); + this.globalData.init_config(); + + // 场景值 + this.globalData.set_scene_data(params); }, methods: {} diff --git a/common/css/page.css b/common/css/page.css index f83b4ce8..392fb1a1 100644 --- a/common/css/page.css +++ b/common/css/page.css @@ -713,4 +713,11 @@ button[disabled].bg-gray { height: 58rpx; line-height: 58rpx; display: inline-flex; +} + +/** + * 单页预览 + */ +.single-page-top { + padding-top: 110rpx; } \ No newline at end of file diff --git a/common/js/common/share.js b/common/js/common/share.js index 3d75795b..81f47ce7 100644 --- a/common/js/common/share.js +++ b/common/js/common/share.js @@ -32,7 +32,7 @@ export default { var share = app.globalData.share_content_handle(this.share_info || {}); return { title: share.title, - query: share.query, + query: ((share.query || null) != null && share.query.substr(0, 1) == '?') ? share.query.slice(1) : share.query, imageUrl: share.img }; } diff --git a/pages/goods-detail/goods-detail.vue b/pages/goods-detail/goods-detail.vue index da87d7cb..1bdf9ecb 100644 --- a/pages/goods-detail/goods-detail.vue +++ b/pages/goods-detail/goods-detail.vue @@ -1,48 +1,51 @@