|
@@ -6,54 +6,63 @@
|
|
|
</view>
|
|
</view>
|
|
|
<view class="width-100">
|
|
<view class="width-100">
|
|
|
<u-search :clearabled="true" height="35px" placeholder="请输入搜索关键字" v-model="keyword" shape="round"
|
|
<u-search :clearabled="true" height="35px" placeholder="请输入搜索关键字" v-model="keyword" shape="round"
|
|
|
- search="doSearch" @custom="doSearch" :showAction="false" bg-color="#e9f0f8"
|
|
|
|
|
|
|
+ search="doSearch" @custom="doSearch" :showAction="true" bg-color="#e9f0f8"
|
|
|
placeholder-color="#65371b"></u-search>
|
|
placeholder-color="#65371b"></u-search>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
- <u-swiper height="185" :list="bannerList" @click="clickInfo" keyName="cover"></u-swiper>
|
|
|
|
|
- <view class="p-l-r-30 p-t-30 dis-flex flex-x-around nav-btns">
|
|
|
|
|
- <view class="nav-btn">
|
|
|
|
|
- <view class="nav-btn-icon icon-circle">
|
|
|
|
|
- <u-image width="32px" height="32px" mode="aspectFit" src="@/static/images/home/professional.png"></u-image>
|
|
|
|
|
|
|
+ <u-list @scrolltolower="scrolltolower" height="calc(100% - 47px)" lowerThreshold="10">
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ <u-swiper height="185" :list="bannerList" @click="goBannerDetail" keyName="cover" :radius="0"></u-swiper>
|
|
|
|
|
+ <view class="p-l-r-30 p-t-30 dis-flex flex-x-around nav-btns">
|
|
|
|
|
+ <view class="nav-btn" @click="navTo('professional_style')">
|
|
|
|
|
+ <view class="nav-btn-icon icon-circle">
|
|
|
|
|
+ <u-image width="32px" height="32px" mode="aspectFit" src="@/static/images/home/professional.png"></u-image>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <view class="nav-btn-text">专业风采</view>
|
|
|
</view>
|
|
</view>
|
|
|
- <view class="nav-btn-text">专业风采</view>
|
|
|
|
|
- </view>
|
|
|
|
|
- <view class="nav-btn">
|
|
|
|
|
- <view class="nav-btn-icon icon-circle">
|
|
|
|
|
- <u-image width="28px" height="28px" mode="aspectFit" src="@/static/images/home/dish.png"></u-image>
|
|
|
|
|
|
|
+ <view class="nav-btn" @click="navTo('restaurant')">
|
|
|
|
|
+ <view class="nav-btn-icon icon-circle">
|
|
|
|
|
+ <u-image width="28px" height="28px" mode="aspectFit" src="@/static/images/home/restaurant.png"></u-image>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <view class="nav-btn-text">名店</view>
|
|
|
</view>
|
|
</view>
|
|
|
- <view class="nav-btn-text">名菜</view>
|
|
|
|
|
- </view>
|
|
|
|
|
- <view class="nav-btn">
|
|
|
|
|
- <view class="nav-btn-icon icon-circle">
|
|
|
|
|
- <u-image width="28px" height="28px" mode="aspectFit" src="@/static/images/home/snacks.png"></u-image>
|
|
|
|
|
|
|
+ <view class="nav-btn" @click="navTo('dish')">
|
|
|
|
|
+ <view class="nav-btn-icon icon-circle">
|
|
|
|
|
+ <u-image width="28px" height="28px" mode="aspectFit" src="@/static/images/home/dish.png"></u-image>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <view class="nav-btn-text">名菜</view>
|
|
|
</view>
|
|
</view>
|
|
|
- <view class="nav-btn-text">名点</view>
|
|
|
|
|
- </view>
|
|
|
|
|
- <view class="nav-btn">
|
|
|
|
|
- <view class="nav-btn-icon icon-circle">
|
|
|
|
|
- <u-image width="28px" height="28px" mode="aspectFit" src="@/static/images/home/restaurant.png"></u-image>
|
|
|
|
|
|
|
+ <view class="nav-btn" @click="navTo('snacks')">
|
|
|
|
|
+ <view class="nav-btn-icon icon-circle">
|
|
|
|
|
+ <u-image width="28px" height="28px" mode="aspectFit" src="@/static/images/home/snacks.png"></u-image>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <view class="nav-btn-text">名点</view>
|
|
|
</view>
|
|
</view>
|
|
|
- <view class="nav-btn-text">名店</view>
|
|
|
|
|
|
|
+
|
|
|
</view>
|
|
</view>
|
|
|
- </view>
|
|
|
|
|
- <view class="info-list">
|
|
|
|
|
- <view class="dis-flex flex-x-between info-item" v-for="item in 10">
|
|
|
|
|
- <view class="info-pic"></view>
|
|
|
|
|
- <view class="info-view">
|
|
|
|
|
- <view class="info-title">
|
|
|
|
|
- 标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题
|
|
|
|
|
|
|
+ <view class="info-list">
|
|
|
|
|
+ <view class="dis-flex flex-x-between info-item" v-for="(item, index) in list" :key="index">
|
|
|
|
|
+ <view class="info-pic">
|
|
|
|
|
+ <u-image width="96px" height="96px" mode="aspectFill" :src="item.cover"></u-image>
|
|
|
</view>
|
|
</view>
|
|
|
- <view class="dis-flex info-bottom">
|
|
|
|
|
- <view style="margin-right: 20rpx;">10月07日</view>
|
|
|
|
|
- <u-icon name="thumb-up" color="#7f7f7f" size="18"></u-icon>
|
|
|
|
|
- <view style="margin-right: 20rpx;">点赞</view>
|
|
|
|
|
- <u-icon name="eye" color="#7f7f7f" size="18"></u-icon>
|
|
|
|
|
- <view>阅读量</view>
|
|
|
|
|
|
|
+ <view class="info-view" @click="goDetail(item.id)">
|
|
|
|
|
+ <view class="info-title">
|
|
|
|
|
+ {{item.subTitle}}
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <view class="dis-flex info-bottom">
|
|
|
|
|
+ <view style="margin-right: 20rpx;">{{item.createTime?item.createTime.substring(0,10):''}}</view>
|
|
|
|
|
+ <u-icon name="thumb-up" color="#7f7f7f" size="18"></u-icon>
|
|
|
|
|
+ <view style="margin-right: 20rpx;">{{item.likeNum || 0}}点赞</view>
|
|
|
|
|
+ <u-icon name="eye" color="#7f7f7f" size="18"></u-icon>
|
|
|
|
|
+ <view>{{item.views || 0}}阅读量</view>
|
|
|
|
|
+ </view>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
- </view>
|
|
|
|
|
|
|
+ <u-loadmore :status="page.status" :loading-text="page.loadingText" :loadmore-text="page.loadmoreText"
|
|
|
|
|
+ :nomore-text="page.nomoreText" />
|
|
|
|
|
+ </u-list>
|
|
|
</view>
|
|
</view>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
@@ -66,24 +75,107 @@
|
|
|
chartOption: {
|
|
chartOption: {
|
|
|
|
|
|
|
|
},
|
|
},
|
|
|
- keyword: '',
|
|
|
|
|
bannerList: [],
|
|
bannerList: [],
|
|
|
- page: {},
|
|
|
|
|
|
|
+ //
|
|
|
|
|
+ page: {
|
|
|
|
|
+ current: 1,
|
|
|
|
|
+ size: 10,
|
|
|
|
|
+ total: 0,
|
|
|
|
|
+ // loadmore loading nomore
|
|
|
|
|
+ status: 'loadmore',
|
|
|
|
|
+ loadingText: '正在加载中',
|
|
|
|
|
+ loadmoreText: '上拉加载更多',
|
|
|
|
|
+ nomoreText: '没有更多了'
|
|
|
|
|
+ },
|
|
|
keyword: '',
|
|
keyword: '',
|
|
|
list: []
|
|
list: []
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
onLoad(options) {},
|
|
onLoad(options) {},
|
|
|
onShow() {
|
|
onShow() {
|
|
|
- this.getBanners()
|
|
|
|
|
|
|
+ this.getBanners();
|
|
|
|
|
+ this.doRefresh();
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
|
|
+ navTo(type = '') {
|
|
|
|
|
+ if (!type) {
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (type == 'professional_style') {
|
|
|
|
|
+ uni.navigateTo({
|
|
|
|
|
+ url: "/pages/yuecai/professional_style/index?type=" + type,
|
|
|
|
|
+ })
|
|
|
|
|
+ } else {
|
|
|
|
|
+ uni.navigateTo({
|
|
|
|
|
+ url: "/pages/yuecai/dish/index?type=" + type,
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // switch (type) {
|
|
|
|
|
+ // case 'restaurant':
|
|
|
|
|
+ // uni.navigateTo({
|
|
|
|
|
+ // url: "/pages/yuecai/restaurant/index?type=" + type,
|
|
|
|
|
+ // })
|
|
|
|
|
+ // break;
|
|
|
|
|
+ // case 'snacks':
|
|
|
|
|
+ // uni.navigateTo({
|
|
|
|
|
+ // url: "/pages/yuecai/snacks/index?type=" + type,
|
|
|
|
|
+ // })
|
|
|
|
|
+ // break;
|
|
|
|
|
+ // case 'dish':
|
|
|
|
|
+ // uni.navigateTo({
|
|
|
|
|
+ // url: "/pages/yuecai/dish/index?type=" + type,
|
|
|
|
|
+ // })
|
|
|
|
|
+ // break;
|
|
|
|
|
+ // default:
|
|
|
|
|
+ // break;
|
|
|
|
|
+ // }
|
|
|
|
|
+ },
|
|
|
getBanners() {
|
|
getBanners() {
|
|
|
this.$u.api.getInformationList(0, 6, {}).then(res => {
|
|
this.$u.api.getInformationList(0, 6, {}).then(res => {
|
|
|
this.bannerList = res.data.records || []
|
|
this.bannerList = res.data.records || []
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
- clickInfo(index) {
|
|
|
|
|
|
|
+ scrolltolower() {
|
|
|
|
|
+ this.loadmore()
|
|
|
|
|
+ },
|
|
|
|
|
+ loadmore() {
|
|
|
|
|
+ this.page.current++;
|
|
|
|
|
+ this.getList();
|
|
|
|
|
+ },
|
|
|
|
|
+ doRefresh() {
|
|
|
|
|
+ this.page.current = 1;
|
|
|
|
|
+ this.page.status = 'loadmore'
|
|
|
|
|
+ this.list = [];
|
|
|
|
|
+ this.getList();
|
|
|
|
|
+ },
|
|
|
|
|
+ getList() {
|
|
|
|
|
+ if (this.page.status == 'loading' || this.page.status == 'nomore') {
|
|
|
|
|
+ // 防止重复下拉
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ this.page.status = 'loading';
|
|
|
|
|
+ this.$u.api.getInformationList(this.page.current, this.page.size, {}).then(res => {
|
|
|
|
|
+ if (res.data.records && res.data.records.length > 0) {
|
|
|
|
|
+ this.list.push(...res.data.records)
|
|
|
|
|
+ }
|
|
|
|
|
+ this.page.total = res.data.total || 0;
|
|
|
|
|
+ if (this.page.size * this.page.current >= res.data.total) {
|
|
|
|
|
+ this.page.status = 'nomore'
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.page.status = 'loadmore'
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
|
|
+ goDetail(id) {
|
|
|
|
|
+ if (id <= 0) {
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ uni.navigateTo({
|
|
|
|
|
+ url: "/pages/yuecai/information/detail/index?id=" + id,
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
|
|
+ goBannerDetail(index) {
|
|
|
if (index < 0) {
|
|
if (index < 0) {
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
@@ -92,7 +184,9 @@
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
doSearch() {
|
|
doSearch() {
|
|
|
-
|
|
|
|
|
|
|
+ uni.navigateTo({
|
|
|
|
|
+ url: "/pages/yuecai/search/index2?keyword=" + this.keyword
|
|
|
|
|
+ })
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
}
|
|
}
|
|
@@ -153,6 +247,8 @@
|
|
|
width: calc(100% - 195rpx);
|
|
width: calc(100% - 195rpx);
|
|
|
|
|
|
|
|
.info-title {
|
|
.info-title {
|
|
|
|
|
+ height: 75px;
|
|
|
|
|
+ word-break: break-all;
|
|
|
color: #65371b;
|
|
color: #65371b;
|
|
|
font-size: 24rpx;
|
|
font-size: 24rpx;
|
|
|
font-weight: 300;
|
|
font-weight: 300;
|