Browse Source

添加频道优化

test
Enzo 5 years ago
parent
commit
df35571c81
  1. 27
      pages/channel/index.vue
  2. 2
      pages/index/index.vue

27
pages/channel/index.vue

@ -14,7 +14,7 @@
</view> </view>
<!-- 机票酒店 --> <!-- 机票酒店 -->
<view v-for="(item,index) of channel_list"> <view v-for="(item,index) of channel_list">
<view class="title lf-m-t-40">
<view class="title lf-m-t-40" v-if="!item.showTitle">
<image src="../../static/images/plane_ticket.png" class="icon-img"></image> <image src="../../static/images/plane_ticket.png" class="icon-img"></image>
<text class="lf-m-l-10">{{item.name}}</text> <text class="lf-m-l-10">{{item.name}}</text>
</view> </view>
@ -42,8 +42,14 @@
}, },
onLoad(){ onLoad(){
this.getMyChancel() this.getMyChancel()
},
computed: {
}, },
methods: { methods: {
verfiyCheck(value) {
return value.checked == true;
},
// //
getMyChancel(){ getMyChancel(){
this.$http(this.API.API_MYCHANNEL).then(res => { this.$http(this.API.API_MYCHANNEL).then(res => {
@ -112,6 +118,15 @@
this.select_list[item2.name] = {p_index: index, c_index: index2}; this.select_list[item2.name] = {p_index: index, c_index: index2};
this.chanel_id.push(item2.id); this.chanel_id.push(item2.id);
this.channel_list[index].content[index2].checked = true; this.channel_list[index].content[index2].checked = true;
this.channel_list.forEach((item,index) => {
var valueContent = item.content.every(this.verfiyCheck);
if(valueContent) {
this.$set(item,'showTitle',true)
}else {
this.$set(item,'showTitle',false)
}
})
} }
} }
if(type != 1) { if(type != 1) {
@ -134,6 +149,14 @@
}); });
// //
delete this.select_list[key]; delete this.select_list[key];
this.channel_list.forEach((item,index) => {
var valueContent = item.content.every(this.verfiyCheck);
if(valueContent) {
this.$set(item,'showTitle',true)
}else {
this.$set(item,'showTitle',false)
}
})
this.updateChannel(2); this.updateChannel(2);
} }
} }
@ -181,7 +204,7 @@
// margin-top: -2rpx; // margin-top: -2rpx;
box-sizing: border-box; box-sizing: border-box;
margin: 6rpx; margin: 6rpx;
border-radius: 20rpx;
border-radius: 5rpx;
} }
.active{ .active{
border: 1rpx solid #FF0000; border: 1rpx solid #FF0000;

2
pages/index/index.vue

@ -1,6 +1,6 @@
<template> <template>
<view> <view>
<swiper class="head" :current="banner_current" >
<swiper class="head" :current="banner_current" autoplay interval="3000">
<swiper-item @click="clickBanner(item.type,item.url)" v-for="(item,index) of banner" :key="index"> <swiper-item @click="clickBanner(item.type,item.url)" v-for="(item,index) of banner" :key="index">
<image :src="item.picture" class="swipe-img" mode="aspectFill"></image> <image :src="item.picture" class="swipe-img" mode="aspectFill"></image>
</swiper-item> </swiper-item>

Loading…
Cancel
Save