|
@@ -6,9 +6,9 @@
|
|
<view class="leftView"></view>
|
|
<view class="leftView"></view>
|
|
<view class="navTitle">门店学院</view>
|
|
<view class="navTitle">门店学院</view>
|
|
<view class="rightView">
|
|
<view class="rightView">
|
|
- <image src="../../static/mobile/icona_fenlei@2x.png" mode="" class="rightImg"></image>
|
|
|
|
|
|
+ <image src="../../static/mobile/icona_fenlei@2x.png" mode="" class="rightImg" @click="goSift"></image>
|
|
<image src="../../static/mobile/icon_search@2x.png" mode="" class="rightImg"
|
|
<image src="../../static/mobile/icon_search@2x.png" mode="" class="rightImg"
|
|
- style="margin-left: 40rpx;"></image>
|
|
|
|
|
|
+ style="margin-left: 40rpx;" @click="goSearch"></image>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
|
|
|
|
@@ -25,9 +25,9 @@
|
|
<scroll-view scroll-x="true" @scroll="scroll">
|
|
<scroll-view scroll-x="true" @scroll="scroll">
|
|
<view class="itemBg">
|
|
<view class="itemBg">
|
|
<view v-for="(item,index) in bannerArr" :key="index" class="item">
|
|
<view v-for="(item,index) in bannerArr" :key="index" class="item">
|
|
- <image src="../../static/logo.png" mode="" class="swpImg"></image>
|
|
|
|
- <view class="title">文字标题</view>
|
|
|
|
- <view class="title2">小标题</view>
|
|
|
|
|
|
+ <image :src="item.logoImg" mode="" class="swpImg"></image>
|
|
|
|
+ <view class="title">{{item.title}}</view>
|
|
|
|
+ <view class="title2" @click="goTopTab(item)">{{item.categoryName}}</view>
|
|
|
|
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
@@ -42,11 +42,11 @@
|
|
<!-- 头 -->
|
|
<!-- 头 -->
|
|
<view class="fenTop">
|
|
<view class="fenTop">
|
|
<view class="leftTop">
|
|
<view class="leftTop">
|
|
- <view class="tuijian">天空飘来5个字</view>
|
|
|
|
- <view class="sum">共9999篇文章</view>
|
|
|
|
|
|
+ <view class="tuijian">{{item.name}}</view>
|
|
|
|
+ <view class="sum">共{{item.count}}篇文章</view>
|
|
</view>
|
|
</view>
|
|
<view class="rightTop">
|
|
<view class="rightTop">
|
|
- <view class="">查看全部
|
|
|
|
|
|
+ <view class="" @click="goTopTab(item)">查看全部
|
|
<image src="../../static/mobile/icon_arrow@2x.png" mode=""
|
|
<image src="../../static/mobile/icon_arrow@2x.png" mode=""
|
|
style="width: 11rpx; height: 18rpx; margin-left: 10rpx;"></image>
|
|
style="width: 11rpx; height: 18rpx; margin-left: 10rpx;"></image>
|
|
</view>
|
|
</view>
|
|
@@ -54,9 +54,9 @@
|
|
</view>
|
|
</view>
|
|
<!-- item -->
|
|
<!-- item -->
|
|
<view class="itemBg">
|
|
<view class="itemBg">
|
|
- <view v-for="(item,index) in bannerArr" :key="index" class="twoItem">
|
|
|
|
- <image src="../../static/logo.png" mode="" class="img2"></image>
|
|
|
|
- <view class="title">文字标题</view>
|
|
|
|
|
|
+ <view v-for="(item2,index2) in item.children" :key="index2" class="twoItem" @click="goList(item)">
|
|
|
|
+ <image :src="item.logoImg" mode="" class="img2"></image>
|
|
|
|
+ <view class="title">{{item2.title}}</view>
|
|
|
|
|
|
|
|
|
|
</view>
|
|
</view>
|
|
@@ -66,10 +66,18 @@
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
|
|
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ <!-- 下拉菜单 -->
|
|
|
|
+ <view class="sift" v-show="showSift">
|
|
|
|
+ <view class="siftItemBg">
|
|
|
|
+ <view v-for="(item,index) in siftData" :key="index" class="siftItem">
|
|
|
|
+ <view @click="goTopTab(item)">{{item.name}}</view>
|
|
|
|
+ </view>
|
|
|
|
+ </view>
|
|
|
|
+ </view>
|
|
|
|
+
|
|
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
</view>
|
|
</view>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
@@ -77,22 +85,134 @@
|
|
export default {
|
|
export default {
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
- bannerArr: [1, 2, 3, 4, 5],
|
|
|
|
|
|
+ bannerArr: [],
|
|
scrollTop: 0,
|
|
scrollTop: 0,
|
|
old: {
|
|
old: {
|
|
scrollTop: 0
|
|
scrollTop: 0
|
|
},
|
|
},
|
|
- itemArr: [1, 2, 3, 4, 5, 6],
|
|
|
|
|
|
+ itemArr: [],
|
|
|
|
+ showSift:false,
|
|
|
|
+ siftData:[],
|
|
}
|
|
}
|
|
},
|
|
},
|
|
onLoad() {
|
|
onLoad() {
|
|
-
|
|
|
|
|
|
+ this.getDetailData()
|
|
|
|
+ this.getSiftData()
|
|
},
|
|
},
|
|
- methods: {
|
|
|
|
|
|
+ methods: {
|
|
|
|
+ goList(item){
|
|
|
|
+
|
|
|
|
+ // 1分类2文章
|
|
|
|
+ if (item.type == 1) {
|
|
|
|
+ uni.navigateTo({
|
|
|
|
+ url:'list?topCode=' + item.Code + '&comment=' + item.Comment + '&topName=' + item.Title
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ if (item.type == 2) {
|
|
|
|
+ // uni.navigateTo({
|
|
|
|
+ // url:''
|
|
|
|
+ // })
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ goTopTab(item){
|
|
|
|
+
|
|
|
|
+ this.showSift = false
|
|
|
|
+ uni.navigateTo({
|
|
|
|
+ url:'topTab?topCode=' + item.code + '&comment=' + item.comment + '&topName=' + item.name
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ goSift(){
|
|
|
|
+ this.showSift = !this.showSift
|
|
|
|
+ },
|
|
|
|
+ goSearch(){
|
|
|
|
+ uni.navigateTo({
|
|
|
|
+ url:'search'
|
|
|
|
+ })
|
|
|
|
+ },
|
|
scroll: function(e) {
|
|
scroll: function(e) {
|
|
console.log(e)
|
|
console.log(e)
|
|
this.old.scrollTop = e.detail.scrollTop
|
|
this.old.scrollTop = e.detail.scrollTop
|
|
- },
|
|
|
|
|
|
+ },
|
|
|
|
+ goNav(urlStr){
|
|
|
|
+ uni.navigateTo({
|
|
|
|
+ url:urlStr
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ getDetailData() {
|
|
|
|
+ uni.showLoading({
|
|
|
|
+ title: '加载中'
|
|
|
|
+ })
|
|
|
|
+ let url = '/trainingOpenApi/indexData',
|
|
|
|
+ params = {
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ this.$http(url, params, 'GET').then(res => {
|
|
|
|
+ uni.hideLoading();
|
|
|
|
+ var data = res.data
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ // 处理 undefined和null转为空白字符串
|
|
|
|
+
|
|
|
|
+ for (const key in data) {
|
|
|
|
+ data[key] = this.$praseStrEmpty(data[key])
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ this.detailData = data
|
|
|
|
+
|
|
|
|
+ this.bannerArr = this.detailData.recommendList
|
|
|
|
+ this.itemArr = this.detailData.categoryList
|
|
|
|
+
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ getSiftData() {
|
|
|
|
+ uni.showLoading({
|
|
|
|
+ title: '加载中'
|
|
|
|
+ })
|
|
|
|
+ let url = '/trainingOpenApi/allCategory',
|
|
|
|
+ params = {
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ this.$http(url, params, 'GET').then(res => {
|
|
|
|
+ uni.hideLoading();
|
|
|
|
+ var data = res.data
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ // 处理 undefined和null转为空白字符串
|
|
|
|
+
|
|
|
|
+ for (const key in data) {
|
|
|
|
+ data[key] = this.$praseStrEmpty(data[key])
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ this.siftData = data
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ // 下拉刷新 上拉加载更多
|
|
|
|
+ onPullDownRefresh() {
|
|
|
|
+ // this.page = 1;
|
|
|
|
+ // this.getItemData()
|
|
|
|
+
|
|
|
|
+ this.getDetailData()
|
|
|
|
+ setTimeout(function() {
|
|
|
|
+ uni.stopPullDownRefresh();
|
|
|
|
+ }, 1000);
|
|
|
|
+ },
|
|
|
|
+ // onReachBottom() {
|
|
|
|
+ // this.page++;
|
|
|
|
+
|
|
|
|
+ // this.getItemData()
|
|
|
|
+
|
|
|
|
+ // },
|
|
|
|
+
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
</script>
|
|
@@ -105,7 +225,7 @@
|
|
padding-bottom: 20rpx;
|
|
padding-bottom: 20rpx;
|
|
|
|
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
.nav {
|
|
.nav {
|
|
position: fixed;
|
|
position: fixed;
|
|
left: 0;
|
|
left: 0;
|
|
@@ -208,7 +328,12 @@
|
|
padding: 3rpx 14rpx;
|
|
padding: 3rpx 14rpx;
|
|
width: 138rpx;
|
|
width: 138rpx;
|
|
margin-bottom: 10rpx;
|
|
margin-bottom: 10rpx;
|
|
- /* text-align: center; */
|
|
|
|
|
|
+ text-align: center;
|
|
|
|
+ /* 隐藏文字显示 ...不换行 */
|
|
|
|
+ overflow: hidden;
|
|
|
|
+ text-overflow: ellipsis;
|
|
|
|
+ white-space: nowrap;
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
.fenleiBg {
|
|
.fenleiBg {
|
|
@@ -243,5 +368,28 @@
|
|
.img2 {
|
|
.img2 {
|
|
width: calc((100vw - 75rpx) / 2);
|
|
width: calc((100vw - 75rpx) / 2);
|
|
height: 226rpx;
|
|
height: 226rpx;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .sift{
|
|
|
|
+
|
|
|
|
+ position: fixed;
|
|
|
|
+ left: 0;
|
|
|
|
+ top: 88rpx;
|
|
|
|
+ width: 100vw;
|
|
|
|
+ min-height: 100vh;
|
|
|
|
+ background-color: rgba(0, 0, 0, 0.4);
|
|
|
|
+ }
|
|
|
|
+ .siftItemBg{
|
|
|
|
+ background-color: #FFFFFF;
|
|
|
|
+ width: 100%;
|
|
|
|
+ height: 500rpx;
|
|
|
|
+ overflow-y: scroll;
|
|
|
|
+ }
|
|
|
|
+ .siftItem{
|
|
|
|
+ background-color: #FFFFFF;
|
|
|
|
+ color: #333333;
|
|
|
|
+ font-size: 30rpx;
|
|
|
|
+ text-align: center;
|
|
|
|
+ padding: 30rpx 0;
|
|
}
|
|
}
|
|
</style>
|
|
</style>
|