Explorar el Código

处理冲突问题

306132416@qq.com hace 4 años
padre
commit
6a67fcd8ef
Se han modificado 1 ficheros con 3 adiciones y 7 borrados
  1. 3 7
      pages/index/index.vue

+ 3 - 7
pages/index/index.vue

@@ -107,7 +107,7 @@
           @click="goParkDetailFn(item.id)"
         >
           <image
-            :src="item.park_pics[0].pic_path"
+            :src="item.park_pics[0].pic_path || '/static/park/1.png'"
             mode="aspectFill"
             style="
               width: 452rpx;
@@ -481,13 +481,9 @@ export default {
           // page_size:7
         },
         success: (res) => {
-          console.log(res);
           if (res.data.code === 200) {
-            res.data.data.list.forEach((item) => {
-              item.park_pics[0].pic_path =
-                getApp().globalData.shareUrl + item.park_pics[0].pic_path;
-            });
-            this.parkList = res.data.data.list;
+			res.data.data.list.forEach((item)=>{if(item.park_pics.length){item.park_pics[0].pic_path = getApp().globalData.shareUrl + item.park_pics[0].pic_path}});
+			this.parkList = res.data.data.list;
           }
         },
         fail: () => {