306132416@qq.com лет назад: 4
Родитель
Сommit
5f81f938e4
3 измененных файлов с 18 добавлено и 34 удалено
  1. 3 1
      components/artical-deatil/index.vue
  2. 15 32
      pages/attract/index.vue
  3. 0 1
      pages/index/index.vue

+ 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();
         },
       });
     },

+ 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%;

+ 0 - 1
pages/index/index.vue

@@ -612,7 +612,6 @@ export default {
         },
         data: postData,
         success: (res) => {
-          console.log(res);
           if (res.data.code === 200) {
 			  res.data.data.list.forEach((item) => {
 			    item.pic_url = getApp().globalData.shareUrl + item.pic_url;