Merge branch 'dev-sws' of gitee.com:zongzhige/shopxo-uniapp into dev
commit
01b85e7780
8
App.vue
8
App.vue
|
|
@ -7,12 +7,12 @@
|
|||
data: {
|
||||
// 基础配置
|
||||
// 数据接口请求地址
|
||||
//request_url: 'http://shopxo.com/',
|
||||
request_url:'https://new.shopxo.vip/',
|
||||
request_url: 'http://shopxo.com/',
|
||||
// request_url:'https://new.shopxo.vip/',
|
||||
|
||||
// 静态资源地址(如系统根目录不在public目录下面请在静态地址后面加public目录、如:https://d1.shopxo.vip/public/)
|
||||
//static_url: 'http://shopxo.com/',
|
||||
static_url:'https://new.shopxo.vip/',
|
||||
static_url: 'http://shopxo.com/',
|
||||
// static_url:'https://new.shopxo.vip/',
|
||||
|
||||
// 系统类型(默认default、如额外独立小程序、可与程序分身插件实现不同主体小程序及支付独立)
|
||||
system_type: 'default',
|
||||
|
|
|
|||
|
|
@ -105,7 +105,7 @@
|
|||
export default {
|
||||
props: {
|
||||
propValue: {
|
||||
type: [String,Number,Object],
|
||||
type: [String, Number, Object],
|
||||
default: '',
|
||||
},
|
||||
// 滚动距离
|
||||
|
|
@ -114,7 +114,7 @@
|
|||
default: 0,
|
||||
},
|
||||
propKey: {
|
||||
type: [String,Number],
|
||||
type: [String, Number],
|
||||
default: '',
|
||||
},
|
||||
},
|
||||
|
|
@ -215,11 +215,13 @@
|
|||
// 小程序下,获取小程序胶囊的宽度
|
||||
let menu_button_info = 'max-width:100%';
|
||||
let new_text_style = `font-weight:${new_style.header_background_title_typeface}; font-size: ${new_style.header_background_title_size * 2}rpx; color: ${new_style.header_background_title_color};`;
|
||||
// #ifndef MP-TOUTIAO
|
||||
// #ifdef MP
|
||||
const custom = uni.getMenuButtonBoundingClientRect();
|
||||
menu_button_info = `max-width:calc(100% - ${custom.width + 10}px);`;
|
||||
new_text_style += `right:-${custom.width + 10}px;`;
|
||||
// #endif
|
||||
// #endif
|
||||
this.setData({
|
||||
form: this.propValue,
|
||||
position: new_style.up_slide_display == '1' ? 'position:fixed;' : 'position:relative;',
|
||||
|
|
@ -288,7 +290,7 @@
|
|||
height: 66rpx;
|
||||
overflow: hidden;
|
||||
top: -1rpx;
|
||||
/* #ifdef H5 */
|
||||
/* #ifdef H5 || MP-TOUTIAO */
|
||||
top: 4rpx;
|
||||
/* #endif */
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
<view :class="theme_view">
|
||||
<block v-if="(data || null) != null">
|
||||
<!-- diy模块 -->
|
||||
<componentDiy :propValue="data.config" :propDataId="data.id" @onLocationBack="user_back_choice_location">
|
||||
<componentDiy :propValue="data.config" :propDataId="data.id" :propKey="random_value" @onLocationBack="user_back_choice_location">
|
||||
<!-- 底部内容 -->
|
||||
<template slot="diy-bottom-content">
|
||||
<!-- 结尾 -->
|
||||
|
|
@ -23,14 +23,14 @@
|
|||
const app = getApp();
|
||||
import componentCommon from '@/components/common/common';
|
||||
import componentDiy from '@/components/diy/diy';
|
||||
import componentNoData from "@/components/no-data/no-data";
|
||||
import componentBottomLine from "@/components/bottom-line/bottom-line";
|
||||
import componentNoData from '@/components/no-data/no-data';
|
||||
import componentBottomLine from '@/components/bottom-line/bottom-line';
|
||||
export default {
|
||||
components: {
|
||||
componentCommon,
|
||||
componentDiy,
|
||||
componentNoData,
|
||||
componentBottomLine
|
||||
componentBottomLine,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
|
@ -42,24 +42,26 @@
|
|||
params: null,
|
||||
data: null,
|
||||
// 自定义分享信息
|
||||
share_info: {}
|
||||
share_info: {},
|
||||
// 增加随机数,避免无法监听数据列表内部数据更新
|
||||
random_value: 0,
|
||||
};
|
||||
},
|
||||
|
||||
|
||||
onLoad(params) {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onload_handle(params);
|
||||
|
||||
|
||||
// 设置参数
|
||||
this.setData({
|
||||
params: app.globalData.launch_params_handle(params),
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
onShow() {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onshow_handle();
|
||||
|
||||
|
||||
// 加载数据
|
||||
this.get_data();
|
||||
|
||||
|
|
@ -71,7 +73,7 @@
|
|||
// 设置顶部导航的默认颜色
|
||||
this.set_navigation_bar_color();
|
||||
},
|
||||
|
||||
|
||||
// 下拉刷新
|
||||
onPullDownRefresh() {
|
||||
this.get_data();
|
||||
|
|
@ -81,7 +83,7 @@
|
|||
// 获取数据
|
||||
get_data(params = {}) {
|
||||
// 还没有数据则读取缓存
|
||||
var cache_key = app.globalData.data.cache_diy_page_data_key+(this.params.id || 0);
|
||||
var cache_key = app.globalData.data.cache_diy_page_data_key + (this.params.id || 0);
|
||||
if (this.load_status == 0) {
|
||||
// 本地缓存数据
|
||||
var upd_data = uni.getStorageSync(cache_key) || null;
|
||||
|
|
@ -100,11 +102,11 @@
|
|||
params['is_cache'] = 0;
|
||||
}
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url("index", "diy"),
|
||||
url: app.globalData.get_request_url('index', 'diy'),
|
||||
method: 'POST',
|
||||
data: {...this.params, ...params},
|
||||
data: { ...this.params, ...params },
|
||||
dataType: 'json',
|
||||
success: res => {
|
||||
success: (res) => {
|
||||
uni.stopPullDownRefresh();
|
||||
if (res.data.code == 0) {
|
||||
var data = res.data.data;
|
||||
|
|
@ -112,7 +114,8 @@
|
|||
data: data.data || null,
|
||||
data_list_loding_msg: '',
|
||||
data_list_loding_status: 0,
|
||||
data_bottom_line_status: true
|
||||
data_bottom_line_status: true,
|
||||
random_value: Math.random(),
|
||||
};
|
||||
this.setData(upd_data);
|
||||
// 存储缓存
|
||||
|
|
@ -130,33 +133,33 @@
|
|||
title: this.data.name,
|
||||
desc: this.data.describe,
|
||||
path: '/pages/diy/diy',
|
||||
query: 'id='+this.data.id,
|
||||
img: this.data.logo
|
||||
}
|
||||
query: 'id=' + this.data.id,
|
||||
img: this.data.logo,
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
// 标题名称
|
||||
uni.setNavigationBarTitle({
|
||||
title: this.data.name
|
||||
title: this.data.name,
|
||||
});
|
||||
|
||||
// 设置顶部导航的默认颜色
|
||||
this.set_navigation_bar_color();
|
||||
}
|
||||
|
||||
|
||||
// 分享菜单处理
|
||||
app.globalData.page_share_handle(this.share_info);
|
||||
} else {
|
||||
this.setData({
|
||||
data_bottom_line_status: false,
|
||||
data_list_loding_status: 2,
|
||||
data_list_loding_msg: res.data.msg
|
||||
data_list_loding_msg: res.data.msg,
|
||||
});
|
||||
}
|
||||
|
||||
// 非首次状态
|
||||
this.setData({
|
||||
load_status: 1
|
||||
load_status: 1,
|
||||
});
|
||||
},
|
||||
fail: () => {
|
||||
|
|
@ -165,9 +168,9 @@
|
|||
data_bottom_line_status: false,
|
||||
data_list_loding_status: 2,
|
||||
load_status: 1,
|
||||
data_list_loding_msg: this.$t('common.internet_error_tips')
|
||||
data_list_loding_msg: this.$t('common.internet_error_tips'),
|
||||
});
|
||||
}
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
|
|
@ -181,7 +184,7 @@
|
|||
// 重新刷新数据
|
||||
this.get_data();
|
||||
},
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style></style>
|
||||
<style></style>
|
||||
|
|
|
|||
Loading…
Reference in New Issue