|
@@ -1,8 +1,8 @@
|
|
<template>
|
|
<template>
|
|
<view class="main">
|
|
<view class="main">
|
|
<view class="one">
|
|
<view class="one">
|
|
- <swiper class="swiper" circular :indicator-dots="true" indicator-color="#F5F5F5" :autoplay="true"
|
|
|
|
- :interval="3000" :duration="1000">
|
|
|
|
|
|
+ <swiper class="swiper" circular :indicator-dots="true" indicator-color="#F5F5F5"
|
|
|
|
+ indicator-active-color="#ffffff" :autoplay="true" :interval="3000" :duration="1000">
|
|
<swiper-item class="list" v-for="(item,index) in imgList" :key="index" @tap="toBanner(item)">
|
|
<swiper-item class="list" v-for="(item,index) in imgList" :key="index" @tap="toBanner(item)">
|
|
<image class="image" :src="item.url" mode="">
|
|
<image class="image" :src="item.url" mode="">
|
|
</image>
|
|
</image>
|
|
@@ -10,7 +10,8 @@
|
|
</swiper>
|
|
</swiper>
|
|
</view>
|
|
</view>
|
|
<view class="two">
|
|
<view class="two">
|
|
- <swiper class="swiper" circular :indicator-dots="true" indicator-color="#F5F5F5" :autoplay="false">
|
|
|
|
|
|
+ <swiper class="swiper" circular :indicator-dots="true" indicator-color="#F5F5F5"
|
|
|
|
+ indicator-active-color="#007AFF" :autoplay="false">
|
|
<swiper-item class="swiper-item" v-for="(item,index) in moduleList" :key="index">
|
|
<swiper-item class="swiper-item" v-for="(item,index) in moduleList" :key="index">
|
|
<view class="list" v-for="(as,index) in item" :key="indexs" @tap="toChange(as)">
|
|
<view class="list" v-for="(as,index) in item" :key="indexs" @tap="toChange(as)">
|
|
<image class="image" :src="as.url&&as.url.length>0?as.url[0].url:''" mode="aspectFill">
|
|
<image class="image" :src="as.url&&as.url.length>0?as.url[0].url:''" mode="aspectFill">
|
|
@@ -20,6 +21,26 @@
|
|
</swiper-item>
|
|
</swiper-item>
|
|
</swiper>
|
|
</swiper>
|
|
</view>
|
|
</view>
|
|
|
|
+ <view class="thr">
|
|
|
|
+ <uni-notice-bar speed='50' showGetMore='true' moreText='更多' @getmore="toMore" show-icon scrollable
|
|
|
|
+ :text="content" />
|
|
|
|
+ </view>
|
|
|
|
+ <view class="four">
|
|
|
|
+ <tabs :tabs="tabs" @tabsChange="tabsChange">
|
|
|
|
+ <view class="tabsList">
|
|
|
|
+ <scroll-view scroll-y="true" class="scroll-view" @scrolltolower="toPage" @scroll="toScroll">
|
|
|
|
+ <view class="list-scroll-view">
|
|
|
|
+ <view class="list" v-for="(item,index) in list" :key="index" @tap="toInfo(item)">
|
|
|
|
+ 1111
|
|
|
|
+ <view class="is_bottom" v-if="is_bottom">
|
|
|
|
+ <text>{{config.bottom_title}}</text>
|
|
|
|
+ </view>
|
|
|
|
+ </view>
|
|
|
|
+ </view>
|
|
|
|
+ </scroll-view>
|
|
|
|
+ </view>
|
|
|
|
+ </tabs>
|
|
|
|
+ </view>
|
|
</view>
|
|
</view>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
@@ -34,27 +55,85 @@
|
|
// 轮播图
|
|
// 轮播图
|
|
imgList: [],
|
|
imgList: [],
|
|
// 模块
|
|
// 模块
|
|
- moduleList: []
|
|
|
|
|
|
+ moduleList: [],
|
|
|
|
+ // 公告内容
|
|
|
|
+ content: '',
|
|
|
|
+ tabs: {
|
|
|
|
+ active: '0',
|
|
|
|
+ bgColor: '#ffffff',
|
|
|
|
+ menu: []
|
|
|
|
+ },
|
|
|
|
+ list: [],
|
|
|
|
+ total: 0,
|
|
|
|
+ skip: 0,
|
|
|
|
+ limit: 10,
|
|
|
|
+ page: 0,
|
|
|
|
+ // 数据是否触底
|
|
|
|
+ is_bottom: false,
|
|
|
|
+ scrollTop: 0,
|
|
}
|
|
}
|
|
},
|
|
},
|
|
onLoad: async function() {
|
|
onLoad: async function() {
|
|
const that = this;
|
|
const that = this;
|
|
- await that.searchConfig();
|
|
|
|
|
|
+ await that.searchOther();
|
|
|
|
+ await that.search();
|
|
|
|
+ },
|
|
|
|
+ onShow: async function(e) {
|
|
|
|
+ const that = this;
|
|
|
|
+ },
|
|
|
|
+ onPullDownRefresh: async function() {
|
|
|
|
+ const that = this;
|
|
|
|
+ that.clearPage();
|
|
await that.search();
|
|
await that.search();
|
|
|
|
+ uni.stopPullDownRefresh();
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
- // 查询基本设置
|
|
|
|
- async searchConfig() {
|
|
|
|
|
|
+ // 查询
|
|
|
|
+ async search() {
|
|
const that = this;
|
|
const that = this;
|
|
- let res = await that.$api(`/config`, 'GET', {});
|
|
|
|
|
|
+ let info = {
|
|
|
|
+ skip: that.skip,
|
|
|
|
+ limit: that.limit,
|
|
|
|
+ }
|
|
|
|
+ let res;
|
|
|
|
+ res = await that.$api(`/article`, 'GET', {
|
|
|
|
+ ...info,
|
|
|
|
+ });
|
|
if (res.errcode == '0') {
|
|
if (res.errcode == '0') {
|
|
- that.$set(that, `imgList`, res.data.file);
|
|
|
|
|
|
+ let list = [...that.list, ...res.data];
|
|
|
|
+ that.$set(that, `list`, list);
|
|
|
|
+ that.$set(that, `total`, res.total)
|
|
|
|
+ } else {
|
|
|
|
+ uni.showToast({
|
|
|
|
+ title: res.errmsg,
|
|
|
|
+ icon: 'none'
|
|
|
|
+ })
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- // 查询
|
|
|
|
- async search() {
|
|
|
|
|
|
+
|
|
|
|
+ // 点击轮播图图片
|
|
|
|
+ toBanner(item) {
|
|
|
|
+ console.log(item)
|
|
|
|
+ },
|
|
|
|
+ // 点击模块
|
|
|
|
+ toChange(item) {
|
|
|
|
+ console.log(item)
|
|
|
|
+ },
|
|
|
|
+ // 查看更多公告
|
|
|
|
+ toMore() {
|
|
|
|
+ console.log('公告')
|
|
|
|
+ },
|
|
|
|
+ // 查询其他信息
|
|
|
|
+ async searchOther() {
|
|
const that = this;
|
|
const that = this;
|
|
- let res = await that.$api(`/module`, 'GET', {
|
|
|
|
|
|
+ let res;
|
|
|
|
+ // 基本设置
|
|
|
|
+ res = await that.$api(`/config`, 'GET', {});
|
|
|
|
+ if (res.errcode == '0') {
|
|
|
|
+ that.$set(that, `imgList`, res.data.file);
|
|
|
|
+ }
|
|
|
|
+ //模块
|
|
|
|
+ res = await that.$api(`/module`, 'GET', {
|
|
is_use: '0'
|
|
is_use: '0'
|
|
});
|
|
});
|
|
if (res.errcode == '0') {
|
|
if (res.errcode == '0') {
|
|
@@ -65,15 +144,68 @@
|
|
}, []);
|
|
}, []);
|
|
that.$set(that, `moduleList`, data);
|
|
that.$set(that, `moduleList`, data);
|
|
}
|
|
}
|
|
|
|
+ // 公告
|
|
|
|
+ res = await that.$api(`/notice`, 'GET', {
|
|
|
|
+ is_use: '0',
|
|
|
|
+ limit: 1
|
|
|
|
+ });
|
|
|
|
+ if (res.errcode == '0') that.$set(that, `content`, res.data[0].name);
|
|
|
|
+ // 查询状态
|
|
|
|
+ res = await that.$api(`/dictData`, 'GET', {
|
|
|
|
+ type: 'home_tabs',
|
|
|
|
+ is_use: '0',
|
|
|
|
+ })
|
|
|
|
+ if (res.errcode == '0') {
|
|
|
|
+ const menu = res.data.map((item) => {
|
|
|
|
+ return {
|
|
|
|
+ title: item.label,
|
|
|
|
+ active: item.value
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ that.$set(that.tabs, `menu`, menu)
|
|
|
|
+ }
|
|
},
|
|
},
|
|
- // 点击轮播图图片
|
|
|
|
- toBanner(item) {
|
|
|
|
- console.log(item)
|
|
|
|
|
|
+ // 选择选项卡
|
|
|
|
+ tabsChange(e) {
|
|
|
|
+ const that = this;
|
|
|
|
+ that.$set(that.tabs, `active`, e.active)
|
|
|
|
+ that.clearPage();
|
|
|
|
+ that.search()
|
|
},
|
|
},
|
|
- // 点击模块
|
|
|
|
- toChange(item) {
|
|
|
|
- console.log(item, )
|
|
|
|
|
|
+ // 分页
|
|
|
|
+ toPage(e) {
|
|
|
|
+ const that = this;
|
|
|
|
+ let list = that.list;
|
|
|
|
+ let limit = that.limit;
|
|
|
|
+ if (that.total > list.length) {
|
|
|
|
+ uni.showLoading({
|
|
|
|
+ title: '加载中',
|
|
|
|
+ mask: true
|
|
|
|
+ })
|
|
|
|
+ let page = that.page + 1;
|
|
|
|
+ that.$set(that, `page`, page)
|
|
|
|
+ let skip = page * limit;
|
|
|
|
+ that.$set(that, `skip`, skip)
|
|
|
|
+ that.search();
|
|
|
|
+ uni.hideLoading();
|
|
|
|
+ } else that.$set(that, `is_bottom`, true)
|
|
},
|
|
},
|
|
|
|
+ // 触底
|
|
|
|
+ toScroll(e) {
|
|
|
|
+ const that = this;
|
|
|
|
+ let up = that.scrollTop;
|
|
|
|
+ that.$set(that, `scrollTop`, e.detail.scrollTop);
|
|
|
|
+ let num = Math.sign(up - e.detail.scrollTop);
|
|
|
|
+ if (num == 1) that.$set(that, `is_bottom`, false);
|
|
|
|
+ },
|
|
|
|
+ // 清空列表
|
|
|
|
+ clearPage() {
|
|
|
|
+ const that = this;
|
|
|
|
+ that.$set(that, `list`, [])
|
|
|
|
+ that.$set(that, `skip`, 0)
|
|
|
|
+ that.$set(that, `limit`, 10)
|
|
|
|
+ that.$set(that, `page`, 0)
|
|
|
|
+ }
|
|
},
|
|
},
|
|
}
|
|
}
|
|
</script>
|
|
</script>
|
|
@@ -98,7 +230,7 @@
|
|
.two {
|
|
.two {
|
|
|
|
|
|
.swiper {
|
|
.swiper {
|
|
- height: 45vw;
|
|
|
|
|
|
+ height: 50vw;
|
|
|
|
|
|
.swiper-item {
|
|
.swiper-item {
|
|
display: flex;
|
|
display: flex;
|
|
@@ -129,5 +261,56 @@
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ .thr {
|
|
|
|
+ padding: 0 2vw;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .four {
|
|
|
|
+ background-color: var(--footColor);
|
|
|
|
+
|
|
|
|
+ .tabsList {
|
|
|
|
+ position: relative;
|
|
|
|
+ width: 100vw;
|
|
|
|
+ height: 80vh;
|
|
|
|
+
|
|
|
|
+ .list {
|
|
|
|
+ background-color: var(--mainColor);
|
|
|
|
+ border: 1px solid var(--f5Color);
|
|
|
|
+ padding: 2vw;
|
|
|
|
+ margin: 0 2vw 2vw 2vw;
|
|
|
|
+ border-radius: 5px;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .list:first-child {
|
|
|
|
+ margin: 2vw 0 0 0;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .scroll-view {
|
|
|
|
+ position: absolute;
|
|
|
|
+ top: 0;
|
|
|
|
+ left: 0;
|
|
|
|
+ right: 0;
|
|
|
|
+ bottom: 0;
|
|
|
|
+
|
|
|
|
+ .list-scroll-view {
|
|
|
|
+ display: flex;
|
|
|
|
+ flex-direction: column;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .is_bottom {
|
|
|
|
+ width: 100%;
|
|
|
|
+ text-align: center;
|
|
|
|
+
|
|
|
|
+ text {
|
|
|
|
+ padding: 2vw 0;
|
|
|
|
+ display: inline-block;
|
|
|
|
+ color: var(--f85Color);
|
|
|
|
+ font-size: var(--font14Size);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
</style>
|
|
</style>
|