adminthw 4 년 전
부모
커밋
70f4ab4b68
7개의 변경된 파일88개의 추가작업 그리고 64개의 파일을 삭제
  1. 2 1
      components/artical-deatil/index.vue
  2. 2 2
      pages/activity/activity_deatil.vue
  3. 10 5
      pages/activity/index.vue
  4. 17 3
      pages/attract/attract_deatil.vue
  5. 30 11
      pages/attract/index.vue
  6. 1 1
      pages/index/index.vue
  7. 26 41
      pages/notice/index.vue

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

@@ -4,7 +4,7 @@
       <view class="header">
         <view class="title">{{ model.title }}</view>
         <view class="way-time">
-          <view class="way">{{ model.way }}</view>
+          <view class="way" v-if="model.way">{{ model.way }}</view>
           <view class="time">{{ model.time }}</view>
         </view>
       </view>
@@ -134,6 +134,7 @@ export default {
         color: $uni-text-color-grey;
         display: flex;
         justify-content: space-between;
+        
       }
     }
     .artical {

+ 2 - 2
pages/activity/activity_deatil.vue

@@ -7,9 +7,9 @@
         </view>
         <view class="read">阅读量 {{ model.read }}</view>
       </view>
-      <view class="header-image">
+      <!-- <view class="header-image">
         <image :src="model.url" alt="" />
-      </view>
+      </view> -->
     </view>
     <view class="active-deatil">
       <ul>

+ 10 - 5
pages/activity/index.vue

@@ -40,17 +40,17 @@
           <div class="right">
             <div class="right-title">{{ active.title }}</div>
             <div class="right-inf">
-              <div class="inf-type" style="width: 17%">
+              <div class="inf-type right-item" style="width: 17%">
                 <div
                   :class="{ color: active.type == 1 }"
                   class="originColor"
                 ></div>
                 <div>{{ active.type == 1 ? "线上" : "线下" }}</div>
               </div>
-              <div class="inf-way" style="width: 24%">
+              <div class="inf-way right-item">
                 {{ active.way }}
               </div>
-              <div class="inf-date">
+              <div class="inf-date right-item">
                 {{ active.date }}
               </div>
             </div>
@@ -310,11 +310,11 @@ export default {
     }
   }
   .actives {
-    width:90%;
+    width: 90%;
     margin-top: 50rpx;
     display: flex;
     flex-direction: column;
-	align-items: center;
+    align-items: center;
     .actives-item {
       width: 100%;
       // height: 150rpx;
@@ -351,10 +351,15 @@ export default {
             letter-spacing: 3rpx;
           }
           .right-inf {
+            flex-wrap: wrap;
             display: flex;
             font-size: 21rpx;
             align-items: center;
+
             color: $uni-text-color-grey;
+            .right-item{
+              margin-bottom: 10rpx;
+            }
             .inf-type {
               margin-right: 10rpx;
               display: flex;

+ 17 - 3
pages/attract/attract_deatil.vue

@@ -27,6 +27,20 @@ export default {
     this.getAttractDeatil();
   },
   methods: {
+    replaceImg(html) {
+      let result = html.replace(
+        /<img [^>]*src=['"]([^'"]+)[^>]*>/gi,
+        function (match, capture) {
+          return (
+            "<img src=" +
+            getApp().globalData.shareUrl +
+            capture +
+            ' style="max-width:100%;height:auto;display:block;margin:10px 0;"/>'
+          );
+        }
+      );
+      return result;
+    },
     getAttractDeatil() {
       let md5Sign = md5(
         "method=" +
@@ -59,9 +73,9 @@ export default {
           if (res.data.code === 200) {
             let data = res.data.data;
             this.model.title = data.title;
-            let time = this.$options.filters["globalTime"](data.time);
+            let time = this.$options.filters["globalTime"](data.addtime);
             let timeSecond = this.$options.filters["globalTimeSecond"](
-              data.time
+              data.addtime
             );
             this.model.time = time + " " + timeSecond;
             this.getRich();
@@ -87,7 +101,7 @@ export default {
         success: (res) => {
           console.log(res);
           if (res.statusCode === 200) {
-            this.model.artical = res.data;
+            this.model.artical = this.replaceImg(res.data);
           }
         },
         fail: () => {

+ 30 - 11
pages/attract/index.vue

@@ -10,17 +10,31 @@
         v-for="(item, index) in attractList"
         :key="index"
         style="justify-content: start"
-        @click="goAttractDeatil(item.id)"
+        @click="goAttractDeatil(item.id, item.time_type)"
+        :class="{ unclick: item.time_type == 0 }"
       >
         <image
           :src="item.pic_url"
           mode="aspectFill"
-          style="width: 112rpx; height: 112rpx; margin-right: 20rpx;border-radius: 10rpx;"
+          style="
+            width: 112rpx;
+            height: 112rpx;
+            margin-right: 20rpx;
+            border-radius: 10rpx;
+          "
         ></image>
         <view class="notice-content" style="width: 75%">
           <view class="notice-content-font">{{ item.title }}</view>
           <view class="attract-content">{{ item.desc }}</view>
-          <view class="notice-content-time" style="margin-top: 20rpx">{{item.addtime | globalTime}}</view>
+          <view
+            class="notice-content-time"
+            style="margin-top: 20rpx"
+            v-if="item.time_type == 1"
+            >时间:{{ item.time | globalTime }}</view
+          >
+          <view class="notice-content-time" style="margin-top: 20rpx" v-else
+            >时间:待定</view
+          >
         </view>
       </view>
     </view>
@@ -52,7 +66,8 @@ export default {
     this.getAttract();
   },
   methods: {
-    goAttractDeatil(id) {
+    goAttractDeatil(id, type) {
+      if (type == 0) return;
       uni.navigateTo({
         url: "/pages/attract/attract_deatil?id=" + id,
       });
@@ -85,12 +100,13 @@ export default {
         },
         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;
-		  }
+          if (res.data.code === 200) {
+            console.log(res.data.data.list);
+            res.data.data.list.forEach((item) => {
+              item.pic_url = getApp().globalData.shareUrl + item.pic_url;
+            });
+            this.attractList = res.data.data.list;
+          }
         },
         fail: () => {
           console.log("连接失败");
@@ -102,6 +118,9 @@ export default {
 </script>
 
 <style lang="scss" scoped>
+.unclick {
+  background-color: #bfbfbf !important;
+}
 .content {
   box-sizing: border-box;
   display: flex;
@@ -127,7 +146,7 @@ export default {
       padding-left: 20rpx;
       width: 100%;
       justify-items: start;
-	  margin-bottom: 10rpx;
+      margin-bottom: 10rpx;
     }
     .notice-content-box {
       width: 100%;

+ 1 - 1
pages/index/index.vue

@@ -616,7 +616,7 @@ export default {
 			  res.data.data.list.forEach((item) => {
 			    item.pic_url = getApp().globalData.shareUrl + item.pic_url;
 			  });
-             this.attractList = res.data.data.list;
+        this.attractList = res.data.data.list;
           }
         },
         fail: () => {

+ 26 - 41
pages/notice/index.vue

@@ -1,10 +1,10 @@
 <template>
   <view class="content">
     <view class="input-box">
-      <image src="/static/policy/u377.png" alt="" />
+      <image src="/static/policy/u377.png" alt="" class="search-icon" />
       <input
         type="text"
-        placeholder="请输入政策关键词搜索"
+        placeholder="请输入关键字搜索"
         v-model="input"
         @confirm="getNotice"
       />
@@ -20,7 +20,8 @@
         <image
           :src="item.icon"
           mode="aspectFit"
-          style="width: 34px; height: 34px"
+          style="width: 100rpx; height: 100rpx"
+          class="type-icon"
         ></image>
         <view class="notice-content display-around-column">
           <view class="notice-content-font">{{ item.title }}</view>
@@ -38,23 +39,7 @@ import md5 from "@/common/md5.js";
 export default {
   data() {
     return {
-      noticeList: [
-        // {
-        //   url: "/static/navList/policy-icon.png",
-        //   title: "政策速览 | 小微企业、个体工商户税费...",
-        //   time: "2021-08-05",
-        // },
-        // {
-        //   url: "/static/navList/activity-icon.png",
-        //   title: "活动预告 | 想了解跨境电商?8月5日带...",
-        //   time: "2021-08-04",
-        // },
-        // {
-        //   url: "/static/navList/notice-icon.png",
-        //   title: "通知公告 | 2022年首批次重点新材料扶...",
-        //   time: "2021-08-03",
-        // },
-      ],
+      noticeList: [],
       input: "",
     };
   },
@@ -149,22 +134,13 @@ export default {
       box-shadow: 0px 4rpx 32rpx rgba(0, 0, 0, 0.1);
       border-radius: 32rpx;
       margin-top: 20rpx;
-      // justify-content: space-between;
-      image {
-        width: 34px;
-        height: 34px;
-      }
-      .notice-content-font {
-        margin-left: 40rpx;
-        font-size: 26rpx;
-        color: #0d1937;
-        font-weight: 600;
-        overflow: hidden;
-        text-overflow: ellipsis;
-        white-space: nowrap;
+      .type-icon {
+        display: block;
       }
+
       .notice-content {
         // flex: 1;
+        width: 100%;
         color: #697594;
         font-weight: 600;
         font-size: 20rpx;
@@ -172,13 +148,22 @@ export default {
         overflow: hidden;
         text-overflow: ellipsis;
         white-space: nowrap;
-      }
-      .notice-content-time {
-        margin-left: 40rpx;
-        font-size: 18rpx;
-        letter-spacing: 0.02em;
-        color: #cfcfcf;
-        margin-right: 14rpx;
+        .notice-content-time {
+          margin-left: 40rpx;
+          font-size: 18rpx;
+          letter-spacing: 0.02em;
+          color: #cfcfcf;
+          margin-right: 14rpx;
+        }
+        .notice-content-font {
+          margin-left: 40rpx;
+          font-size: 26rpx;
+          color: #0d1937;
+          font-weight: 600;
+          overflow: hidden;
+          text-overflow: ellipsis;
+          white-space: nowrap;
+        }
       }
     }
   }
@@ -189,7 +174,7 @@ export default {
     justify-content: center;
     align-items: center;
     position: relative;
-    image {
+    .search-icon {
       position: absolute;
       left: 72rpx;
       width: 40rpx;