Browse Source

添加首页轮播跳转

306132416@qq.com 4 years ago
parent
commit
450995ecaa
2 changed files with 54 additions and 21 deletions
  1. 1 1
      components/gaoyia-parse/parse.vue
  2. 53 20
      pages/index/index.vue

+ 1 - 1
components/gaoyia-parse/parse.vue

@@ -65,7 +65,7 @@ import wxParseTemplate from './components/wxParseTemplate0';
 			},
 			noData: {
 				type: String,
-				default: '<div style="color: red;">数据不能为空</div>'
+				default: '<div style="color: red;"></div>'
 			},
 			startHandler: {
 				type: Function,

+ 53 - 20
pages/index/index.vue

@@ -24,6 +24,7 @@
             :src="item.pic_path"
             mode="aspectFill"
             style="width: 100%; height: 100%"
+			@click="swiperNavGoPage(item)"
           ></image>
         </swiper-item>
       </swiper>
@@ -272,26 +273,27 @@
             item.title
           }}</view>
           <view class="display-flex-start" style="margin-top: 20rpx">
-            <view
-              class="notice-content-time display-flex-start color-a7adba"
-              v-show="item.isOnline"
-              ><view class="online-box"></view>线上</view
-            >
-            <view
-              class="notice-content-time display-flex-start color-a7adba"
-              v-show="!item.isOnline"
-              ><view class="offline-box"></view>线下</view
-            >
-            <view class="notice-content-time color-a7adba">{{
-              item.department
-            }}</view>
-            <view class="notice-content-time color-a7adba">{{
-              item.time
-            }}</view>
+            <view class="notice-content-time display-flex-start color-a7adba"
+              v-show="item.isOnline" style="width: 15%;">
+			  <view class="online-box"></view>线上</view>
+            <view class="notice-content-time display-flex-start color-a7adba"
+              v-show="!item.isOnline" style="width: 15%;">
+			  <view class="offline-box"></view>线下</view>
+            <view class="notice-content-time color-a7adba" style="overflow: hidden;text-overflow: ellipsis;white-space: nowrap;">
+				{{item.department}}
+			</view>
+<!--            <view class="notice-content-time color-a7adba">
+				{{item.time}}
+			</view> -->
           </view>
-          <view class="display-flex-end" style="margin-top: 20rpx">
-            <view class="notice-content-time">浏览 {{ item.browe }}</view>
-            <view class="notice-content-time">分享 {{ item.share }}</view>
+          <view class="display-between" style="margin-top: 20rpx">
+			<view class="notice-content-time color-a7adba">
+				{{item.time}}
+			</view>  
+			<view class="display-flex-start">
+				<view class="notice-content-time">浏览 {{ item.browe }}</view>
+				<view class="notice-content-time">分享 {{ item.share }}</view>
+			</view>
           </view>
         </view>
       </view>
@@ -445,7 +447,6 @@ export default {
     this.getActive();
   },
   onLoad() {
-	  
     uni.showLoading({
       title: "加载中",
       mask: true,
@@ -462,6 +463,38 @@ export default {
     swiperChange(e) {
       this.swiperCurrent = e.detail.current;
     },
+	swiperNavGoPage(info){
+	  let pageObj = {
+		  'consult':'/pages/appeal/index',
+		  'policy':'/pages/policy/index',
+		  'park':'/pages/park/index',
+		  'activity':'/pages/activity/index',
+		  'notice':'/pages/notice/index',
+		  'company':'/pages/enterprise/index',
+	  }
+	  let pageDetailObj = {
+		  'consult':'/pages/appeal/appeal_detail?id=',
+		  'policy':'/pages/policy/policy_deatil?id=',
+		  'park':'/pages/park/park_detail?id=',
+		  'activity':'/pages/activity/activity_detail?id=',
+		  'notice':'/pages/notice/notice_detail?id=',
+		  'company':'/pages/enterprise/enterprise_detail?id=',
+	  }
+	  console.log(info.link_table,info.link_id)
+	  if(info.link_table){
+		if(info.link_id && info.link_id != '0'){
+			  uni.navigateTo({
+				url:pageDetailObj[info.link_table] + info.link_id
+			  })
+		}else {
+			  uni.navigateTo({
+				url:pageObj[info.link_table]
+			  })
+		}  
+	  }else {
+		  return
+	  }
+	},
     getSwiperList() {
       let md5Sign = md5(
         "method=" +