Pārlūkot izejas kodu

更新首页招商

306132416@qq.com 4 gadi atpakaļ
vecāks
revīzija
ad162bc8d5
2 mainītis faili ar 43 papildinājumiem un 44 dzēšanām
  1. 11 2
      components/foot-tabs/footTabs.vue
  2. 32 42
      pages/index/index.vue

+ 11 - 2
components/foot-tabs/footTabs.vue

@@ -1,5 +1,5 @@
 <template>
-  <div class="hover_content">
+  <div class="hover_content" v-show="isShow">
     <div class="hover_menu flex">
       <div
         class="menu_icon"
@@ -47,7 +47,16 @@
 </style>
 <script>
 export default {
-	props: ['selectedIndex'],
+	props:{
+		selectedIndex: {
+		  type: Number,
+		  default: 0,
+		},
+		isShow:{
+			type:Boolean,
+			default:true
+		}
+	},
 	data() {
     return {
       // selectedIndex: 0,

+ 32 - 42
pages/index/index.vue

@@ -210,16 +210,14 @@
         @click="goAttractDeatil(item.id)"
       >
         <image
-          :src="item.url"
-          mode="aspectFit"
-          style="width: 112rpx; height: 112rpx; margin-right: 20rpx"
+          :src="item.pic_url"
+          mode="aspectFill"
+          style="width: 112rpx; height: 112rpx; margin-right: 20rpx;border-radius: 10rpx;"
         ></image>
-        <view class="notice-content">
+        <view class="notice-content" style="width: 75%">
           <view class="notice-content-font">{{ item.title }}</view>
-          <view class="attract-content">{{ item.subtitle }}</view>
-          <view class="notice-content-time" style="margin-top: 20rpx">{{
-            item.time
-          }}</view>
+          <view class="attract-content">{{ item.desc }}</view>
+          <view class="notice-content-time" style="margin-top: 20rpx">{{item.addtime | globalTime}}</view>
         </view>
       </view>
     </view>
@@ -284,7 +282,7 @@
         </view>
       </view>
     </view>
-    <foot-tabs :selectedIndex="0"></foot-tabs>
+    <foot-tabs :selectedIndex="0" :isShow="footFlag"></foot-tabs>
   </view>
 </template>
 
@@ -301,6 +299,7 @@ export default {
     return {
       title: "Air企通",
       scrollVal: Number,
+	  footFlag:true,
       swiperList: [
         {
           img: "/static/swiper/swiper1.jpg",
@@ -391,18 +390,18 @@ export default {
         // },
       ],
       attractList: [
-        {
-          url: "/static/attract/1.png",
-          title: "工业互联网",
-          subtitle: "工业互联网是全球工业系统与高级计算、分析、...",
-          time: "2021-09-05",
-        },
-        {
-          url: "/static/attract/2.png",
-          title: "生产性服务业",
-          subtitle: "生产性服务业是指为保持工业生产过程的连续性...",
-          time: "2021-09-05",
-        },
+        // {
+        //   url: "/static/attract/1.png",
+        //   title: "工业互联网",
+        //   subtitle: "工业互联网是全球工业系统与高级计算、分析、...",
+        //   time: "2021-09-05",
+        // },
+        // {
+        //   url: "/static/attract/2.png",
+        //   title: "生产性服务业",
+        //   subtitle: "生产性服务业是指为保持工业生产过程的连续性...",
+        //   time: "2021-09-05",
+        // },
       ],
       activityList: [
         // {
@@ -434,7 +433,7 @@ export default {
     this.getPark();
     this.getNotice();
     this.getActive();
-    //this.getAttract(); //招商接口
+    this.getAttract(); //招商接口
   },
   onShareAppMessage() {
     url: "/pages/index/index";
@@ -603,7 +602,7 @@ export default {
         md5Sign;
       let postData = {
         page: 1,
-        page_size: 5,
+        page_size: 2,
       };
       uni.request({
         url: url,
@@ -615,25 +614,10 @@ export default {
         success: (res) => {
           console.log(res);
           if (res.data.code === 200) {
-            let list = res.data.data.list;
-            this.attractList = list.map((item) => {
-              /*
-                  title: "生产性服务业",
-                  subtitle: "生产性服务业是指为保持工业生产过程的连续性...",
-                  time: "2021-09-05",
-             */
-              let ob = {
-                url: "",
-                subtitle: "",
-                id: "",
-                title: "",
-              };
-              ob.url = item.pic_url;
-              ob.subtitle = item.desc;
-              ob.id = item.id;
-              ob.title = item.title;
-              return ob;
-            });
+			  res.data.data.list.forEach((item) => {
+			    item.pic_url = getApp().globalData.shareUrl + item.pic_url;
+			  });
+             this.attractList = res.data.data.list;
           }
         },
         fail: () => {
@@ -750,6 +734,12 @@ export default {
   },
   onPageScroll(e) {
     this.scrollVal = e.scrollTop;
+	if(e.scrollTop < uni.getSystemInfoSync().windowHeight){
+		this.footFlag = true;
+	}
+  },
+  onReachBottom() {
+	  this.footFlag = false;
   },
 };
 </script>