Prechádzať zdrojové kódy

发现页面推荐栏目配置

xhj 2 rokov pred
rodič
commit
63889d63f8
2 zmenil súbory, kde vykonal 25 pridanie a 5 odobranie
  1. 5 0
      pages/found/found.css
  2. 20 5
      pages/found/found.vue

+ 5 - 0
pages/found/found.css

@@ -85,6 +85,11 @@
 	width: 220rpx;
 	height: 141rpx;
 	border-radius: 15rpx 15rpx 15rpx 15rpx;
+	display: inline-block;
+	margin-right: 14rpx;
+}
+.image-nav image:last-child{
+	margin-right: 0rpx;
 }
 
 ::-webkit-scrollbar {

+ 20 - 5
pages/found/found.vue

@@ -8,10 +8,12 @@
 						placeholder="请输入关键词" />
 				</view>
 			</view>
-			<view class="image-nav ddflex">
-				<image src="/static/images/xbrm.png" @click="jumpUrl('/topic/contentList/contentList?code='+xbrmCode+'&title=小白入门')"></image>
-				<image src="/static/images/tbal.png" @click="jumpUrl('/topic/contentList/contentList?code='+tbalCode+'&title=投保案例')"></image>
-				<image src="/static/images/lpal.png" @click="jumpUrl('/topic/contentList/contentList?code='+lpalCode+'&title=理赔案例')"></image>
+			<view class="image-nav ddflex" v-if="recommendList&&recommendList.length>0">
+				<scroll-view scroll-x="true" class="map-acs ddflex" style="height: 141rpx;">
+					<image v-for="item,index in recommendList" :key="index" :src="item.icon" @click="jumpUrl('/topic/contentList/contentList?code='+item.code+'&title='+item.name)"></image>
+					<!-- <image src="/static/images/tbal.png" @click="jumpUrl('/topic/contentList/contentList?code='+tbalCode+'&title=投保案例')"></image>
+					<image src="/static/images/lpal.png" @click="jumpUrl('/topic/contentList/contentList?code='+lpalCode+'&title=理赔案例')"></image> -->
+				</scroll-view>
 			</view>
 			<view class="map-ac">
 				<scroll-view scroll-x="true" class="map-acs ddflex" style="height: 70rpx;">
@@ -85,7 +87,9 @@
 				
 				xbrmCode:req.public.xbrmCode,
 				tbalCode:req.public.tbalCode,
-				lpalCode:req.public.lpalCode
+				lpalCode:req.public.lpalCode,
+				
+				recommendList:[]
 			};
 		},
 
@@ -97,6 +101,7 @@
 		async onLoad() { // this.getList()
 			await this.getConfig()
 			this.getFx()
+			this.getRecommendList()
 		},
 
 		onShow() {
@@ -111,6 +116,16 @@
 		},
 
 		methods: {
+			// 获取文章栏目推荐列表
+			getRecommendList(){
+				return new Promise((r,j)=>{
+					req.getRequest('/api/content/category/list',{isRecommend:1},res=>{
+						this.recommendList = res?res:[]
+						// this.recommendList = this.fxList
+						r(res?res:[])
+					})
+				})
+			},
 			getConfig() {
 				return new Promise((resolve, reject) => {
 					req.getRequest('/api/other/config', {}, (res)=> {