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