Merge branch 'dev-sws' into dev-yxl
commit
37792a2ea2
|
|
@ -135,7 +135,7 @@
|
|||
return `padding-top:${this.header_top}rpx;padding-bottom:${this.padding_footer_computer}rpx`;
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
created() {
|
||||
this.init();
|
||||
},
|
||||
methods: {
|
||||
|
|
@ -155,9 +155,10 @@
|
|||
this.padding_footer_computer = number * 2;
|
||||
},
|
||||
// 选项卡回调更新数据
|
||||
tabs_click_event(data) {
|
||||
tabs_click_event(data, bool) {
|
||||
this.setData({
|
||||
diy_data: data,
|
||||
is_tabs_type: bool,
|
||||
});
|
||||
},
|
||||
},
|
||||
|
|
|
|||
|
|
@ -4,13 +4,13 @@
|
|||
<view v-if="top_up == '1'" class="pf z-i-deep-must left-0 right-0 top-0">
|
||||
<view class="seize-seat" :style="'padding-top:' + tabs_top"></view>
|
||||
<view :style="style_container">
|
||||
<componentDiyModulesTabsView :value="value" isTabs @tabs-click="tabs_click_event"></componentDiyModulesTabsView>
|
||||
<componentDiyModulesTabsView :value="tabs_data" isTabs @tabs-click="tabs_click_event"></componentDiyModulesTabsView>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 占位 -->
|
||||
<view class="pr" :class="top_up == '1' ? 'vs-hide' : ''">
|
||||
<view :style="style_container">
|
||||
<componentDiyModulesTabsView :value="value" isTabs></componentDiyModulesTabsView>
|
||||
<componentDiyModulesTabsView :value="tabs_data" isTabs></componentDiyModulesTabsView>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
|
@ -43,6 +43,7 @@
|
|||
return {
|
||||
style_container: '',
|
||||
content: '',
|
||||
tabs_data: {},
|
||||
|
||||
// 是否滑动置顶
|
||||
top_up: 0,
|
||||
|
|
@ -56,13 +57,18 @@
|
|||
init() {
|
||||
const new_content = this.value.content || {};
|
||||
const new_style = this.value.style || {};
|
||||
let new_tabs_data = this.value;
|
||||
const new_tabs_list = new_content.tabs_list.unshift(new_content.home_data);
|
||||
new_tabs_data.tabs_list = new_tabs_list;
|
||||
this.setData({
|
||||
tabs_data: new_tabs_data,
|
||||
style_container: common_styles_computer(new_style.common_style),
|
||||
top_up: new_content.tabs_top_up,
|
||||
});
|
||||
},
|
||||
// 回调
|
||||
tabs_click_event(index, item) {
|
||||
console.log(item);
|
||||
// 调接口
|
||||
// 回调到上一级
|
||||
// 更新上一级的数据,渲染更新页面
|
||||
|
|
@ -75,27 +81,30 @@
|
|||
// 获取缓存数据
|
||||
new_data = uni.getStorageSync('diy-data-' + this.propId) || {};
|
||||
} else {
|
||||
params.id = item.id;
|
||||
new_data = uni.getStorageSync('diy-data-' + item.id) || {};
|
||||
}
|
||||
this.$emit('tabs-click', new_data);
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('diy', 'index'),
|
||||
method: 'POST',
|
||||
data: params,
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
// 数据处理
|
||||
var data = res.data.data;
|
||||
if (res.data.code == 0) {
|
||||
uni.setStorageSync('diy-data-' + item.id, data.config.diy_data);
|
||||
this.$emit('tabs-click', data.config.diy_data);
|
||||
} else {
|
||||
app.globalData.showToast(res.data.msg);
|
||||
}
|
||||
},
|
||||
fail: () => {},
|
||||
});
|
||||
this.$emit('tabs-click', new_data, true);
|
||||
if (item.data_type == '0') {
|
||||
if (index !== 0) params.id = item.classify.id;
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('index', 'diy'),
|
||||
method: 'POST',
|
||||
data: params,
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
// 数据处理
|
||||
var data = res.data.data;
|
||||
if (res.data.code == 0) {
|
||||
uni.setStorageSync('diy-data-' + item.id, data.config.diy_data);
|
||||
this.$emit('tabs-click', data.config.diy_data, true);
|
||||
} else {
|
||||
app.globalData.showToast(res.data.msg);
|
||||
}
|
||||
},
|
||||
});
|
||||
} else {
|
||||
console.log('123123123123123');
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in New Issue