Browse Source

Merge branch 'master' of http://121.40.40.223:3000/zizhong.wang/konggang-city-miniprogram

Jing-Jiu 4 years ago
parent
commit
54717f4304

+ 3 - 1
components/artical-deatil/index.vue

@@ -26,6 +26,7 @@
 </template>
 
 <script>
+import md5 from "@/common/md5.js";
 import FooterShare from "../footer-share/footer-share.vue";
 export default {
   props: {
@@ -54,6 +55,7 @@ export default {
   },
   methods: {
     sharePage() {
+		let that = this;
       uni.showShareMenu({
         title: this.model.title,
         path:
@@ -64,7 +66,7 @@ export default {
           "_detail?id=" +
           this.model.id,
         success(res) {
-          this.shareRequest();
+          that.shareRequest();
         },
       });
     },

+ 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,

+ 150 - 8
pages/activity/activity_deatil.vue

@@ -3,9 +3,9 @@
     <view class="header">
       <view class="title-read">
         <view class="title">
-          400场讲座,200多门课程,免费送上门!就等你来申请啦~
+          {{ model.title }}
         </view>
-        <view class="read">阅读量 123</view>
+        <view class="read">阅读量 {{ model.read }}</view>
       </view>
       <view class="header-image">
         <image src="/static/activity/u1104.png" alt="" />
@@ -15,15 +15,15 @@
       <ul>
         <li>
           <p class="name">活动时间</p>
-          <p class="deatil-content">2021.08.20 14:00 - 2021.08.30 17:00</p>
+          <p class="deatil-content">{{ model.date }}</p>
         </li>
         <li>
           <p class="name">活动类型</p>
-          <p class="deatil-content">线上</p>
+          <p class="deatil-content">{{ model.type == 1 ? "线上" : "线下" }}</p>
         </li>
         <li>
           <p class="name">主办方</p>
-          <p class="deatil-content">区人力资源局</p>
+          <p class="deatil-content">{{ model.way }}</p>
         </li>
       </ul>
     </view>
@@ -32,15 +32,30 @@
     </view>
     <view class="share-box">
       <view class="share">
-        <view class="shareCount">17</view>
+        <view class="shareCount">{{ model.share }}</view>
         <image src="../../static/share_icon.png"></image>
       </view>
-      <view class="button"><button>活动进行中</button></view>
+      <view class="button"
+        ><button
+          @click="signUpActivity"
+          :disabled="!(model.status == 0 && model.type == 2)"
+          :class="{
+            start: model.status == 0,
+            begun: model.status == 1,
+            ended: model.status == 2,
+          }"
+        >
+          {{ model.activiteState }}
+        </button></view
+      >
+      <!--         "status":"活动状态 0:待开始;1:已开始; 2:已结束
+        "type":"活动类型 1:线上;2 线下"} -->
     </view>
   </view>
 </template>
 
 <script>
+import md5 from "@/common/md5.js";
 import activity_rich_card from "../policy/policy_rich_card";
 export default {
   components: {
@@ -48,6 +63,18 @@ export default {
   },
   data() {
     return {
+      id: "",
+      model: {
+        title: "400场讲座,200多门课程,免费送上门!就等你来申请啦~",
+        read: 123,
+        url: "",
+        date: "2021.08.20 14:00 - 2021.08.30 17:00",
+        type: 1,
+        status: 0,
+        way: "区人力资源局",
+        share: 0,
+        activiteState: "活动进行中",
+      },
       textModel: {
         title: "活动内容",
         text:
@@ -55,6 +82,106 @@ export default {
       },
     };
   },
+  onLoad(op) {
+    this.id = op.id;
+    // this.getActivityDeatil();
+  },
+  methods: {
+    getActivityDeatil() {
+      let md5Sign = md5(
+        "method=" +
+          "common" +
+          "&timestamp=" +
+          getApp().globalData.globalTimestamp +
+          "&secret=" +
+          getApp().globalData.secret
+      );
+      let url =
+        getApp().globalData.shareUrl +
+        "api/api.php" +
+        "?method=common&source=activity&action=info_by_id&timestamp=" +
+        getApp().globalData.globalTimestamp +
+        "&sign=" +
+        md5Sign;
+      let postData = {
+        id: this.id,
+      };
+      //获取文章
+      uni.request({
+        url: url,
+        method: "POST",
+        header: {
+          "content-type": "application/x-www-form-urlencoded",
+        },
+        data: postData,
+        success: (res) => {
+          console.log(res);
+          if (res.data.code === 200) {
+            this.getRich();
+          }
+        },
+        fail: () => {
+          console.log("连接失败");
+        },
+      });
+    },
+    getRich() {
+      uni.request({
+        url:
+          getApp().globalData.shareUrl +
+          `content/business/${Math.floor(this.id / 1000)}/${this.id}.html`,
+        method: "GET",
+        header: {
+          "content-type": "application/x-www-form-urlencoded",
+        },
+
+        success: (res) => {
+          console.log(res);
+          if (res.statusCode === 200) {
+            this.model.artical = res.data;
+          }
+        },
+        fail: () => {
+          console.log("连接失败");
+        },
+      });
+    },
+    signUpActivity() {
+      let md5Sign = md5(
+        "method=" +
+          "common" +
+          "&timestamp=" +
+          getApp().globalData.globalTimestamp +
+          "&secret=" +
+          getApp().globalData.secret
+      );
+      let url =
+        getApp().globalData.shareUrl +
+        "api/api.php" +
+        "?method=common&source=activity&action=active&timestamp=" +
+        getApp().globalData.globalTimestamp +
+        "&sign=" +
+        md5Sign;
+      let postData = {
+        openId: getApp().globalData.open_id,
+        id: this.id,
+      };
+      uni.request({
+        url: url,
+        method: "POST",
+        header: {
+          "content-type": "application/x-www-form-urlencoded",
+        },
+        data: postData,
+        success: (res) => {
+          console.log(res);
+        },
+        fail: () => {
+          console.log("连接失败");
+        },
+      });
+    },
+  },
 };
 </script>
 
@@ -161,11 +288,26 @@ export default {
       button {
         width: 80%;
         height: 90%;
-        border: 1px solid #00a8ea;
+        border: 1px solid;
         outline: none;
         background: none;
+      }
+      .start {
+        //待开始
+        background-color: #00a8ea;
+        color: #ffffff;
+        border-color: none;
+      }
+      .begun {
+        //已开始
+        border-color: #00a8ea;
         color: #00a8ea;
       }
+      .ended {
+        //已结束
+        color: #aaaaaa;
+        border-color: #aaaaaa;
+      }
     }
   }
 }

+ 155 - 41
pages/activity/index.vue

@@ -30,7 +30,7 @@
     </div>
     <div class="actives">
       <div
-        v-for="(active, idx) in activeList"
+        v-for="(active, idx) in activeListCopy"
         :key="idx"
         class="actives-item"
         @click="goDeatil(active.id)"
@@ -40,14 +40,14 @@
           <div class="right">
             <div class="right-title">{{ active.title }}</div>
             <div class="right-inf">
-              <div class="inf-type">
+              <div class="inf-type" style="width: 17%;">
                 <div
                   :class="{ color: active.type == 1 }"
                   class="originColor"
                 ></div>
-                <div>{{ active.type === 1 ? "线下" : "线上" }}</div>
+                <div>{{ active.type == 1 ? "线上" : "线下" }}</div>
               </div>
-              <div class="inf-way">
+              <div class="inf-way" style="width: 24%;">
                 {{ active.way }}
               </div>
               <div class="inf-date">
@@ -57,6 +57,9 @@
           </div>
         </div>
         <div class="readShare">
+		  <div v-show="active.status == '0'" class="active-tips-box wait-color">活动待开始</div>
+		  <div v-show="active.status == '1'" class="active-tips-box ing-color">活动进行中</div>
+		  <div v-show="active.status == '2'" class="active-tips-box end-color">活动已结束</div>
           <div class="read">浏览 {{ active.read }}</div>
           <div class="share">分享 {{ active.share }}</div>
         </div>
@@ -66,6 +69,7 @@
 </template>
 
 <script>
+import md5 from "@/common/md5.js";
 export default {
   data() {
     return {
@@ -80,61 +84,64 @@ export default {
       pickerTypeArray: [
         {
           label: "全部",
-          value: 1,
+          value: 0,
         },
         {
           label: "线上",
-          value: 2,
+          value: 1,
         },
         {
           label: "线下",
-          value: 3,
+          value: 2,
         },
       ],
       pickerStateArray: [
         {
           label: "全部",
-          value: 1,
+          value: 3,
         },
         {
           label: "待开始",
-          value: 2,
+          value: 0,
         },
         {
           label: "已开始",
-          value: 3,
+          value: 1,
         },
         {
           label: "已结束",
-          value: 4,
+          value: 2,
         },
       ],
       activeList: [
-        {
-          url: "/static/activity/1.png",
-          title: "400场讲座,200门课程,免费送上门!就等你申请",
-          way: "区人力资源局",
-          date: "2021-08-08",
-          read: 322,
-          share: 1,
-          type: 1, //1线上
-        },
-        {
-          url: "/static/activity/2.png",
-          title: "智能制造商标品牌培育系列培训活动",
-          way: "市场监督管理局",
-          date: "2021-08-07",
-          read: 322,
-          share: 1,
-          type: 0, //0线下
-        },
+        // {
+        //   url: "/static/activity/1.png",
+        //   title: "400场讲座,200门课程,免费送上门!就等你申请",
+        //   way: "区人力资源局",
+        //   date: "2021-08-08",
+        //   read: 322,
+        //   share: 1,
+        //   type: 1, //1线上
+        // },
+        // {
+        //   url: "/static/activity/2.png",
+        //   title: "智能制造商标品牌培育系列培训活动",
+        //   way: "市场监督管理局",
+        //   date: "2021-08-07",
+        //   read: 322,
+        //   share: 1,
+        //   type: 2, //2线下
+        // },
       ],
+      activeListCopy: [],
     };
   },
-  onLoad() {},
+  onLoad() {
+    this.getActive();
+  },
   methods: {
     bindPickerChange(e, op) {
-      console.log(e);
+      console.log(e.detail.value);
       switch (op) {
         case "type":
           this.indexType = e.detail.value;
@@ -146,15 +153,101 @@ export default {
           this.pickerState = this.pickerStateArray[this.indexState].label;
           this.typeActive = false;
       }
-
-      this.index = e.detail.value;
+      /* 
+        {  label: "全部",  value: 1,   },   { label: "线上",  value: 2,   }, { label: "线下", value: 3, }, 
+      { label: "全部",   value: 1, }, { label: "待开始",value: 2,},{label: "已开始",value: 3, }, { label: "已结束",value: 4, },
+        "status":"活动状态 0:待开始;1:已开始; 2:已结束
+        "type":"活动类型 1:线上;2 线下"}
+        */
+      let type = this.indexType ;
+      let state = this.indexState;
+      this.activeListCopy = this.activeList.filter((item) => {
+        return (
+          ( type == 0 || item.type == type) &&
+          ( state == 0 || item.status == state - 1)
+        );
+      });
     },
-    goDeatil(id = 1) {
-      console.log(123);
+    goDeatil(id) {
       uni.navigateTo({
         url: "/pages/activity/activity_deatil?id=" + id,
       });
     },
+    getActive() {
+      let md5Sign = md5(
+        "method=" +
+          "common" +
+          "&timestamp=" +
+          getApp().globalData.globalTimestamp +
+          "&secret=" +
+          getApp().globalData.secret
+      );
+      let url =
+        getApp().globalData.shareUrl +
+        "api/api.php" +
+        "?method=common&source=activity&action=list&timestamp=" +
+        getApp().globalData.globalTimestamp +
+        "&sign=" +
+        md5Sign;
+      let postData = {
+        page: 1,
+        page_size: 15,
+      };
+      uni.request({
+        url: url,
+        method: "POST",
+        header: {
+          "content-type": "application/x-www-form-urlencoded",
+        },
+        data: postData,
+        success: (res) => {
+          // console.log(res);
+          if (res.data.code === 200) {
+            let list = res.data.data.list;
+            this.activeList = list.map((item) => {
+              /*
+                  url: "/static/activity/2.png",
+            title: "智能制造商标品牌培育系列培训活动",
+            way: "市场监督管理局",
+            date: "2021-08-07",
+            read: 322,
+            share: 1,
+            type: 0, //0线下
+             */
+              let ob = {
+                url: "",
+                title: "",
+                way: "",
+                date: "",
+                read: 0,
+                share: 0,
+                type: "",
+				status:'',
+                id: "",
+                status: 0,
+              };
+              ob.url = getApp().globalData.shareUrl + item.pic_url;
+              ob.title = item.name;
+              ob.way = item.sponsor;
+              let time = this.$options.filters["globalTime"](item.start_time);
+			  let timeSecond = this.$options.filters["globalTime"](item.end_time);
+			  ob.date = time + "至" + timeSecond;
+              ob.read = parseInt(item.base_read_count) + parseInt(item.real_read_count);
+              ob.share =parseInt(item.real_repost_count) +parseInt(item.base_repost_count);
+              ob.type = item.type;
+			  ob.status = item.status; 
+              ob.id = item.id;
+              ob.status = item.status;
+              return ob;
+            });
+            this.activeListCopy = this.activeList;
+          }
+        },
+        fail: () => {
+          console.log("连接失败");
+        },
+      });
+    },
   },
 };
 </script>
@@ -211,11 +304,11 @@ export default {
     display: flex;
     flex-direction: column;
     .actives-item {
-      height: 150rpx;
+      // height: 150rpx;
       box-shadow: 0px 4rpx 32rpx rgba(0, 0, 0, 0.1);
       border-radius: 32rpx;
       margin-top: 20px;
-      padding: 50rpx;
+      padding: 20rpx;
       display: flex;
       flex-direction: column;
       .active-content {
@@ -227,13 +320,16 @@ export default {
           img {
             width: 100%;
             height: 100%;
+            border-radius: 10%;
           }
         }
         .right {
+		  width: 80%;
           height: 120rpx;
           box-sizing: border-box;
           display: flex;
           flex-direction: column;
+          justify-content: space-between;
           .right-title {
             margin-bottom: 20rpx;
             font-size: 27rpx;
@@ -242,16 +338,17 @@ export default {
           }
           .right-inf {
             display: flex;
-            font-size: 22rpx;
+            font-size: 21rpx;
+			align-items: center;
             color: $uni-text-color-grey;
             .inf-type {
-              margin-right: 20rpx;
+              margin-right: 10rpx;
               display: flex;
               align-items: center;
               .originColor {
                 margin-right: 8rpx;
-                height: 25rpx;
-                width: 25rpx;
+                height: 20rpx;
+                width: 20rpx;
                 border-radius: 50%;
                 background-color: #ffcf86;
               }
@@ -268,6 +365,23 @@ export default {
         font-size: 20rpx;
         color: rgba(0, 0, 0, 0.3);
         margin-top: 20rpx;
+		align-items: center;
+		.active-tips-box {
+			font-size: 22rpx;
+			padding: 10rpx;
+			border-radius: 10rpx;
+			color: #fff;
+			margin-right: 50rpx;
+		}
+		.wait-color {
+			background-color: #AEE359;
+		}
+		.ing-color {
+			background-color: #00A8EA;
+		}
+		.end-color {
+			background-color: #d7d7d7;
+		}
         .read {
           margin-right: 60rpx;
         }

+ 4 - 3
pages/appeal/appealCard.vue

@@ -46,7 +46,8 @@ export default {
   height: 200rpx;
   .title {
     margin-bottom: 5%;
-    font-size: 28rpx;
+    font-size: 30rpx;
+	font-weight: 600;
   }
   .state {
     position: absolute;
@@ -59,11 +60,11 @@ export default {
   .details {
     position: relative;
     .name {
-      font-size: 25rpx;
+      font-size: 26rpx;
       color: red;
     }
     .msg {
-      font-size: 25rpx;
+      font-size: 26rpx;
       overflow: hidden;
       text-overflow: ellipsis;
       display: -webkit-box;

+ 1 - 0
pages/appeal/index.vue

@@ -26,6 +26,7 @@
         v-for="(otherAppeal, index) in otherAppealList"
         :key="index"
         @tap="toDetail(otherAppeal.id)"
+		style="border-bottom: 1rpx solid #e6e6e6;"
       >
         <appealCard :otherAppeal="otherAppeal" :isOther='true'></appealCard>
       </div>

+ 15 - 32
pages/attract/index.vue

@@ -13,16 +13,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>
@@ -76,8 +74,8 @@ export default {
         "&sign=" +
         md5Sign;
       let postData = {
-        page: 1,
-        page_size: 5,
+        // page: 1,
+        // page_size: 5,
       };
       uni.request({
         url: url,
@@ -87,28 +85,12 @@ export default {
         },
         data: postData,
         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;
-            });
-          }
+		  if (res.data.code === 200) {
+			  res.data.data.list.forEach((item) => {
+				item.pic_url = getApp().globalData.shareUrl + item.pic_url;
+			  });
+			 this.attractList = res.data.data.list;
+		  }
         },
         fail: () => {
           console.log("连接失败");
@@ -145,6 +127,7 @@ export default {
       padding-left: 20rpx;
       width: 100%;
       justify-items: start;
+	  margin-bottom: 10rpx;
     }
     .notice-content-box {
       width: 100%;

+ 145 - 64
pages/index/index.vue

@@ -1,6 +1,10 @@
 <template>
   <view class="content">
-	<top-title :titleValue="title" :pageScroll="scrollVal" style="width: 100%;"></top-title> 
+    <top-title
+      :titleValue="title"
+      :pageScroll="scrollVal"
+      style="width: 100%"
+    ></top-title>
     <view class="page-section-spacing" style="width: 100%; position: relative">
       <swiper
         class="swiper"
@@ -206,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>
@@ -224,7 +226,9 @@
       <view class="notice-title-box">
         <view class="notice-font">区内活动</view>
         <view class="notice-more-font">
-          <view style="margin-right: 8rpx; font-size: 22rpx">更多</view>
+          <view style="margin-right: 8rpx; font-size: 22rpx" @click="goActive"
+            >更多</view
+          >
           <image
             src="/static/right-arrow-blue.png"
             mode="aspectFill"
@@ -238,11 +242,16 @@
         v-for="(item, index) in activityList"
         :key="index"
         style="justify-content: start; padding: 30rpx 0 30rpx 30rpx"
+        @click="goActiveDeatil(item.id)"
       >
         <image
           :src="item.url"
-          mode="aspectFit"
-          style="width: 128rpx; height: 128rpx; margin-right: 20rpx"
+          style="
+            width: 112rpx;
+            height: 112rpx;
+            margin-right: 20rpx;
+            border-radius: 10%;
+          "
         ></image>
         <view class="notice-content" style="width: 70%">
           <view class="notice-content-font" style="white-space: break-spaces">{{
@@ -273,23 +282,24 @@
         </view>
       </view>
     </view>
-    <foot-tabs :selectedIndex="0"></foot-tabs>
+    <foot-tabs :selectedIndex="0" :isShow="footFlag"></foot-tabs>
   </view>
 </template>
 
 <script>
 import md5 from "@/common/md5.js";
-import topTitle from '@/components/top-title/top-title.vue';
-import footTabs from '@/components/foot-tabs/footTabs.vue';
+import topTitle from "@/components/top-title/top-title.vue";
+import footTabs from "@/components/foot-tabs/footTabs.vue";
 export default {
-	components: {
-		'foot-tabs': footTabs,
-		'top-title': topTitle
-	},
+  components: {
+    "foot-tabs": footTabs,
+    "top-title": topTitle,
+  },
   data() {
     return {
-	  title:"Air企通",
-	  scrollVal:Number,
+      title: "Air企通",
+      scrollVal: Number,
+	  footFlag:true,
       swiperList: [
         {
           img: "/static/swiper/swiper1.jpg",
@@ -380,38 +390,38 @@ 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: [
-        {
-          url: "/static/activity/2.png",
-          title: "400场讲座,200门课程,免费送上门!就等你申请",
-          isOnline: 1,
-          department: "区人力资源局",
-          time: "2021-09-05",
-          browe: "322",
-          share: "2",
-        },
-        {
-          url: "/static/activity/1.png",
-          title: "智能制造商标品牌培育系列培训活动",
-          isOnline: 0,
-          department: "市场监督管理局",
-          time: "2021-09-05",
-          browe: "322",
-          share: "2",
-        },
+        // {
+        //   url: "/static/activity/2.png",
+        //   title: "400场讲座,200门课程,免费送上门!就等你申请",
+        //   isOnline: 1,
+        //   department: "区人力资源局",
+        //   time: "2021-09-05",
+        //   browe: "322",
+        //   share: "2",
+        // },
+        // {
+        //   url: "/static/activity/1.png",
+        //   title: "智能制造商标品牌培育系列培训活动",
+        //   isOnline: 0,
+        //   department: "市场监督管理局",
+        //   time: "2021-09-05",
+        //   browe: "322",
+        //   share: "2",
+        // },
       ],
     };
   },
@@ -422,8 +432,8 @@ export default {
     this.getSwiperList();
     this.getPark();
     this.getNotice();
-	console.log(getApp().global)
-    //this.getAttract(); //招商接口
+    this.getActive();
+    this.getAttract(); //招商接口
   },
   onShareAppMessage() {
     url: "/pages/index/index";
@@ -592,7 +602,47 @@ export default {
         md5Sign;
       let postData = {
         page: 1,
-        page_size: 5,
+        page_size: 2,
+      };
+      uni.request({
+        url: url,
+        method: "POST",
+        header: {
+          "content-type": "application/x-www-form-urlencoded",
+        },
+        data: postData,
+        success: (res) => {
+          if (res.data.code === 200) {
+			  res.data.data.list.forEach((item) => {
+			    item.pic_url = getApp().globalData.shareUrl + item.pic_url;
+			  });
+             this.attractList = res.data.data.list;
+          }
+        },
+        fail: () => {
+          console.log("连接失败");
+        },
+      });
+    },
+    getActive() {
+      let md5Sign = md5(
+        "method=" +
+          "common" +
+          "&timestamp=" +
+          getApp().globalData.globalTimestamp +
+          "&secret=" +
+          getApp().globalData.secret
+      );
+      let url =
+        getApp().globalData.shareUrl +
+        "api/api.php" +
+        "?method=common&source=activity&action=list&timestamp=" +
+        getApp().globalData.globalTimestamp +
+        "&sign=" +
+        md5Sign;
+      let postData = {
+        page: 1,
+        page_size:2,
       };
       uni.request({
         url: url,
@@ -605,22 +655,37 @@ export default {
           console.log(res);
           if (res.data.code === 200) {
             let list = res.data.data.list;
-            this.attractList = list.map((item) => {
+            this.activityList = list.map((item) => {
               /*
-                  title: "生产性服务业",
-                  subtitle: "生产性服务业是指为保持工业生产过程的连续性...",
-                  time: "2021-09-05",
+                  url: "/static/activity/2.png",
+            title: "智能制造商标品牌培育系列培训活动",
+            way: "市场监督管理局",
+            date: "2021-08-07",
+            read: 322,
+            share: 1,
+            type: 0, //0线下
              */
               let ob = {
                 url: "",
-                subtitle: "",
-                id: "",
                 title: "",
+                department: "",
+                time: "",
+                browe: 0,
+                share: 0,
+                type: "",
+                id: "",
               };
-              ob.url = item.pic_url;
-              ob.subtitle = item.desc;
+              ob.url = getApp().globalData.shareUrl + item.pic_url;
+              ob.title = item.name;
+              ob.department = item.sponsor;
+              ob.time = this.$options.filters["globalTime"](item.start_time);
+              ob.browe =
+                parseInt(item.base_read_count) + parseInt(item.real_read_count);
+              ob.share =
+                parseInt(item.real_repost_count) +
+                parseInt(item.base_repost_count);
+              ob.isOnline = item.type == 1 ? 1 : 0;
               ob.id = item.id;
-              ob.title = item.title;
               return ob;
             });
           }
@@ -645,6 +710,11 @@ export default {
         url: "/pages/attract/attract_deatil?id=" + id,
       });
     },
+    goActiveDeatil(id) {
+      uni.navigateTo({
+        url: "/pages/activity/activity_deatil?id=" + id,
+      });
+    },
     goAttract() {
       uni.navigateTo({
         url: "/pages/attract/index",
@@ -655,9 +725,20 @@ export default {
         url: "/pages/notice/index",
       });
     },
+    goActive() {
+      uni.navigateTo({
+        url: "/pages/activity/index",
+      });
+    },
   },
   onPageScroll(e) {
-	this.scrollVal = e.scrollTop;
+    this.scrollVal = e.scrollTop;
+	if(e.scrollTop < uni.getSystemInfoSync().windowHeight){
+		this.footFlag = true;
+	}
+  },
+  onReachBottom() {
+	  this.footFlag = false;
   },
 };
 </script>

+ 3 - 3
pages/supply/index.vue

@@ -142,12 +142,12 @@ export default {
     z-index: 999;
     display: flex;
     justify-content: space-around;
-    width: 70%;
-    height: 6%;
+    width:80%;
+    // height: 6%;
     position: fixed;
     top: 85%;
     left: 50%;
-    padding: 3%;
+    padding:4%;
     border-radius: 40rpx;
     box-shadow: rgba(100, 100, 111, 0.2) 0rpx 14rpx 50rpx 0rpx;
     transform: translateX(-50%);

+ 0 - 1
pages/supply/supply_detail.vue

@@ -40,7 +40,6 @@
         <span>{{ info.tel }}</span>
       </view>
     </view>
-    <foot-tabs></foot-tabs>
   </view>
 </template>