|
@@ -15,8 +15,8 @@
|
|
<homeDetails :itemInfo="detail_info" :isShow="showModel === 'model_detail'" :pageStatus="pageStatus">
|
|
<homeDetails :itemInfo="detail_info" :isShow="showModel === 'model_detail'" :pageStatus="pageStatus">
|
|
</homeDetails>
|
|
</homeDetails>
|
|
<!-- 列表 -->
|
|
<!-- 列表 -->
|
|
- <listModel :list="detail_list" :isShow="showModel === 'model_list'" :pageStatus="pageStatus" :styleType = "style_type"
|
|
|
|
- @toDetailEvent="toDetailEvent"></listModel>
|
|
|
|
|
|
+ <listModel :list="detail_list" :isShow="showModel === 'model_list'" :pageStatus="pageStatus"
|
|
|
|
+ :styleType="style_type" @toDetailEvent="toDetailEvent"></listModel>
|
|
</view>
|
|
</view>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
@@ -32,14 +32,14 @@
|
|
lastpageTitle: 'default',
|
|
lastpageTitle: 'default',
|
|
nowTitle: '',
|
|
nowTitle: '',
|
|
showModel: 'default',
|
|
showModel: 'default',
|
|
- pageStatus: 2, //页面状态 组件通过监听控制动画效果
|
|
|
|
|
|
+ pageStatus: 1, //页面状态 1=进入,2=常态,3=退出
|
|
homeAnimation: {},
|
|
homeAnimation: {},
|
|
list: [], // 导航信息
|
|
list: [], // 导航信息
|
|
detail_list: [], // 列表信息
|
|
detail_list: [], // 列表信息
|
|
detail_info: {
|
|
detail_info: {
|
|
img: '/static/image/homeBg.jpg', // 详情信息
|
|
img: '/static/image/homeBg.jpg', // 详情信息
|
|
},
|
|
},
|
|
- style_type:1
|
|
|
|
|
|
+ style_type: 1
|
|
}
|
|
}
|
|
},
|
|
},
|
|
onLoad() {
|
|
onLoad() {
|
|
@@ -61,6 +61,20 @@
|
|
}
|
|
}
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
|
|
+ // 执行各组件动画
|
|
|
|
+ Animation_Controls(model_type) {
|
|
|
|
+ this.pageStatus = 3
|
|
|
|
+ setTimeout(() => {
|
|
|
|
+ // 导航切换状态2 进入切换页
|
|
|
|
+ // this.pageStatus = 2
|
|
|
|
+ // 导航切换状态3 常态化切换页
|
|
|
|
+ this.pageStatus = 1
|
|
|
|
+ this.showModel = model_type
|
|
|
|
+ setTimeout(() => {
|
|
|
|
+ // this.pageStatus = 2
|
|
|
|
+ }, 400)
|
|
|
|
+ }, 300)
|
|
|
|
+ },
|
|
// 获取数据
|
|
// 获取数据
|
|
get_data() {
|
|
get_data() {
|
|
data.get_home_list(this)
|
|
data.get_home_list(this)
|
|
@@ -77,63 +91,53 @@
|
|
},
|
|
},
|
|
// list导航组件传递
|
|
// list导航组件传递
|
|
homeListEvent(e) {
|
|
homeListEvent(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
|
|
|
|
- }else{
|
|
|
|
- this.showModel = 'model_list'
|
|
|
|
- }
|
|
|
|
|
|
+ this.buttonData.lastpageIndex = 1 //页面计数器
|
|
|
|
+ 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
|
|
|
|
+ this.Animation_Controls(e.model_type) // 执行动画
|
|
|
|
+ } else {
|
|
|
|
+ // this.showModel = 'model_list'
|
|
|
|
+ this.Animation_Controls('model_list') // 执行动画
|
|
}
|
|
}
|
|
- }, 300);
|
|
|
|
|
|
+ }
|
|
},
|
|
},
|
|
// 按钮组件回到首页传递
|
|
// 按钮组件回到首页传递
|
|
backEvent() {
|
|
backEvent() {
|
|
- this.pageStatus = 6
|
|
|
|
- setTimeout(() => {
|
|
|
|
- this.showModel = 'default'
|
|
|
|
- }, 300);
|
|
|
|
|
|
+ this.Animation_Controls('default')
|
|
},
|
|
},
|
|
// 按钮组件返回上一页
|
|
// 按钮组件返回上一页
|
|
tolastEvent() {
|
|
tolastEvent() {
|
|
// 返回到首页
|
|
// 返回到首页
|
|
if (this.buttonData.lastpage.length === 2) {
|
|
if (this.buttonData.lastpage.length === 2) {
|
|
- this.pageStatus = 2
|
|
|
|
|
|
+ // this.pageStatus = 2
|
|
this.buttonData.lastpage = ['default']
|
|
this.buttonData.lastpage = ['default']
|
|
-
|
|
|
|
- setTimeout(() => {
|
|
|
|
- this.showModel = this.buttonData.lastpage[0]
|
|
|
|
- }, 300);
|
|
|
|
|
|
+ this.Animation_Controls(this.buttonData.lastpage[0])
|
|
} else {
|
|
} else {
|
|
// 返回上一页
|
|
// 返回上一页
|
|
- this.pageStatus = 3
|
|
|
|
|
|
+ // this.pageStatus = 3
|
|
this.buttonData.lastpageIndex -= 1
|
|
this.buttonData.lastpageIndex -= 1
|
|
this.buttonData.lastpage.pop()
|
|
this.buttonData.lastpage.pop()
|
|
this.nowTitle = this.lastpageTitle
|
|
this.nowTitle = this.lastpageTitle
|
|
- console.log('aa',this.lastpageTitle)
|
|
|
|
- setTimeout(() => {
|
|
|
|
- this.showModel = this.buttonData.lastpage[1]
|
|
|
|
- }, 300);
|
|
|
|
|
|
+ this.Animation_Controls(this.buttonData.lastpage[1])
|
|
}
|
|
}
|
|
},
|
|
},
|
|
// 内页传递(到3级页面)
|
|
// 内页传递(到3级页面)
|
|
toDetailEvent(item) {
|
|
toDetailEvent(item) {
|
|
- this.pageStatus = 5
|
|
|
|
|
|
+ // this.pageStatus = 5
|
|
this.buttonData.lastpageIndex += 1
|
|
this.buttonData.lastpageIndex += 1
|
|
- this.nowTitle = item.title
|
|
|
|
- setTimeout(() => {
|
|
|
|
- this.showModel = 'model_detail'
|
|
|
|
- this.detail_info.img = item.inner_img
|
|
|
|
- }, 300)
|
|
|
|
|
|
+ setTimeout(()=>{
|
|
|
|
+ this.nowTitle = item.title
|
|
|
|
+ },400)
|
|
|
|
+ this.Animation_Controls('model_detail')
|
|
|
|
+ this.detail_info.img = item.inner_img
|
|
}
|
|
}
|
|
},
|
|
},
|
|
}
|
|
}
|