浏览代码

添加找服务接口

306132416@qq.com 4 年之前
父节点
当前提交
cecca002c4
共有 2 个文件被更改,包括 21 次插入18 次删除
  1. 1 1
      pages/index/index.vue
  2. 20 17
      pages/service/index.vue

+ 1 - 1
pages/index/index.vue

@@ -165,7 +165,7 @@
                     class="park-footer-img"
                   ></image>
                   {{ item.cover_area
-                  }}<text style="font-size: 12rpx">万㎡</text></view
+                  }}<text style="font-size: 12rpx"></text></view
                 >
                 <view class="park-footer-font">占地面积</view>
               </view>

+ 20 - 17
pages/service/index.vue

@@ -5,7 +5,7 @@
     </view>
     <div class="menus">
       <div class="menu" v-for="(item,index) in miniProgramList" :key="index" @click="toDetail(item)">
-        <image :src="item.src" mode="aspectFit"/>
+        <image :src="item.pic_url" mode="aspectFill"/>
       </div>
     </div>
   </view>
@@ -18,21 +18,22 @@ export default {
     return {
       bannerSrc: "",
 	  miniProgramList:[
-		  {
-			  appId:'wxec4343871c957260',
-			  path:'pages/index/index',
-			  src:'/static/service/1.png'
-		  },
-		  {
-			  appId:'',
-			  path:'',
-			  src:'/static/service/2.png'
-		  },
+		  // {
+			 //  appId:'wxec4343871c957260',
+			 //  path:'pages/index/index',
+			 //  src:'/static/service/1.png'
+		  // },
+		  // {
+			 //  appId:'',
+			 //  path:'',
+			 //  src:'/static/service/2.png'
+		  // },
 	  ],
     };
   },
   onLoad() {
 	  this.getPageImg();
+	  this.getPageMiniProgram();
   },
   methods: {
 	  getPageImg() {
@@ -81,7 +82,7 @@ export default {
 		  let url =
 		    getApp().globalData.shareUrl +
 		    "api/api.php" +
-		    "?method=common&source=main_pics&action=list&timestamp=" +
+		    "?method=common&source=service&action=list&timestamp=" +
 		    getApp().globalData.globalTimestamp +
 		    "&sign=" +
 		    md5Sign;
@@ -92,12 +93,14 @@ export default {
 		      "content-type": "application/x-www-form-urlencoded",
 		    },
 		    data: {
-		      order_by: "weight desc",
-		      s_status: 1,
+		      s_show:1
 		    },
 		    success: (res) => {
 		      if (res.data.code === 200) {
-		        this.swiperBackground = getApp().globalData.shareUrl + res.data.data.list[0].pic_path;
+				  res.data.data.list.forEach((item) => {
+				    item.pic_url = getApp().globalData.shareUrl + item.pic_url;
+				  });
+				  this.miniProgramList = res.data.data.list;
 		      }
 		    },
 		    fail: () => {
@@ -107,8 +110,8 @@ export default {
 	  },
 	  toDetail(item) {
 		  uni.navigateToMiniProgram({
-		  	appId:item.appId,
-			path:item.path,
+		  	appId:item.app_id,
+			path:item.app_path,
 			success(res) {
 				console.log(res,'打开成功')
 			},