|
@@ -2,7 +2,7 @@
|
|
|
<view class="i-h-v100 i-w-v100">
|
|
|
<!-- 背景图片 -->
|
|
|
<view class="i-pst-f i-z-index01">
|
|
|
- <image class="i-h-v100 i-w-v100" mode="scaleToFill" src="/static/image/homeBg.jpg"></image>
|
|
|
+ <image class="i-h-v100 i-w-v100" mode="scaleToFill" src="/static/image/homeBg.png"></image>
|
|
|
</view>
|
|
|
<!-- 内页按钮 -->
|
|
|
<pageButton :buttonData="buttonData" :isShow="showModel != 'default'" :nowTitle="nowTitle"
|
|
@@ -15,7 +15,7 @@
|
|
|
<homeDetails :itemInfo="detail_info" :isShow="showModel === 'model_detail'" :pageStatus="pageStatus">
|
|
|
</homeDetails>
|
|
|
<!-- 列表 -->
|
|
|
- <listModel :list="detail_list" :isShow="showModel === 'model_list'" :pageStatus="pageStatus"
|
|
|
+ <listModel :list="detail_list" :isShow="showModel === 'model_list'" :pageStatus="pageStatus" :styleType = "style_type"
|
|
|
@toDetailEvent="toDetailEvent"></listModel>
|
|
|
</view>
|
|
|
</template>
|
|
@@ -29,21 +29,23 @@
|
|
|
lastpage: ['default'],
|
|
|
lastpageIndex: 0 // 页面计数器
|
|
|
},
|
|
|
+ lastpageTitle: 'default',
|
|
|
nowTitle: '',
|
|
|
showModel: 'default',
|
|
|
- pageStatus: 2, //页面状态 动画效果 1进入 2正常 3退出
|
|
|
+ pageStatus: 2, //页面状态 组件通过监听控制动画效果
|
|
|
homeAnimation: {},
|
|
|
list: [], // 导航信息
|
|
|
detail_list: [], // 列表信息
|
|
|
detail_info: {
|
|
|
img: '/static/image/homeBg.jpg', // 详情信息
|
|
|
},
|
|
|
- resData: []
|
|
|
+ style_type:1
|
|
|
}
|
|
|
},
|
|
|
onLoad() {
|
|
|
- //加载字体
|
|
|
+ // 加载字体
|
|
|
uni.iCommon.getFontFamily()
|
|
|
+ // 获取数据
|
|
|
this.get_data()
|
|
|
},
|
|
|
watch: {
|
|
@@ -59,24 +61,32 @@
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ // 获取数据
|
|
|
get_data() {
|
|
|
data.get_home_list(this)
|
|
|
},
|
|
|
// 清除缓存并重新获取数据
|
|
|
clearCache(e) {
|
|
|
+ uni.removeStorageSync('list')
|
|
|
console.log('已清除缓存')
|
|
|
+ // 清空原有数据
|
|
|
+ this.list = []
|
|
|
+ this.detail_info = {}
|
|
|
+ // 重新获取数据
|
|
|
+ this.get_data()
|
|
|
},
|
|
|
// list导航组件传递
|
|
|
homeListEvent(e) {
|
|
|
- // console.log('ss',e)
|
|
|
this.pageStatus = 1
|
|
|
this.buttonData.lastpageIndex = 1
|
|
|
setTimeout(() => {
|
|
|
if (e.model_type != undefined) {
|
|
|
// 按钮组件title
|
|
|
this.nowTitle = e.title
|
|
|
+ this.lastpageTitle = e.title
|
|
|
// 当前显示组件
|
|
|
this.detail_list = e.list
|
|
|
+ this.style_type = e.style_type
|
|
|
if(e.list[0].have_detail === 1){
|
|
|
this.detail_info.img = e.list[0].inner_img
|
|
|
this.showModel = e.model_type
|
|
@@ -88,14 +98,14 @@
|
|
|
},
|
|
|
// 按钮组件回到首页传递
|
|
|
backEvent() {
|
|
|
- this.pageStatus = 3
|
|
|
+ this.pageStatus = 6
|
|
|
setTimeout(() => {
|
|
|
this.showModel = 'default'
|
|
|
}, 300);
|
|
|
},
|
|
|
// 按钮组件返回上一页
|
|
|
tolastEvent() {
|
|
|
- // 返回首页
|
|
|
+ // 返回到首页
|
|
|
if (this.buttonData.lastpage.length === 2) {
|
|
|
this.pageStatus = 2
|
|
|
this.buttonData.lastpage = ['default']
|
|
@@ -108,7 +118,8 @@
|
|
|
this.pageStatus = 3
|
|
|
this.buttonData.lastpageIndex -= 1
|
|
|
this.buttonData.lastpage.pop()
|
|
|
-
|
|
|
+ this.nowTitle = this.lastpageTitle
|
|
|
+ console.log('aa',this.lastpageTitle)
|
|
|
setTimeout(() => {
|
|
|
this.showModel = this.buttonData.lastpage[1]
|
|
|
}, 300);
|
|
@@ -129,7 +140,7 @@
|
|
|
</script>
|
|
|
|
|
|
<style>
|
|
|
- /* 基准大小 */
|
|
|
+ /* rem基准大小 */
|
|
|
html {
|
|
|
font-size: 9px;
|
|
|
}
|