Ver Fonte

首页真实数据

aleyds há 4 anos atrás
pai
commit
0bfbb33d0b
4 ficheiros alterados com 52 adições e 7 exclusões
  1. 2 0
      common/apiurl.js
  2. 4 1
      common/http.api.js
  3. 17 2
      manifest.json
  4. 29 4
      pages/index/index.vue

+ 2 - 0
common/apiurl.js

@@ -21,6 +21,8 @@ const apiurl = {
 	wxPayUrl:'/wechat/pay',
 	// 客户端首页
 	getIndexDataUrl:'/index',
+	//获取路段信息
+	roadInfoById:'/roadinfo/selectById/',
 	
 	// 用户车辆
 	mycarsUrl:'/membervehicle',

+ 4 - 1
common/http.api.js

@@ -23,6 +23,8 @@ const install = (Vue, vm) => {
 	
 	let getIndexData = (params = {}) => vm.$u.post(apiurl.getIndexDataUrl,params);
 	
+	let roadInfoById = (params = {}) => vm.$u.get(apiurl.roadInfoById+params.id);
+	
 	let getMycars = (params = {}) => vm.$u.get(apiurl.mycarsUrl,params);
 	let addCar = (params = {}) => vm.$u.post(apiurl.mycarsUrl,params);
 	let delCar = (params = {}) => vm.$u.delete(apiurl.mycarsUrl+'/'+params);
@@ -43,7 +45,8 @@ const install = (Vue, vm) => {
 		getMycars,
 		addCar,
 		delCar,
-		setDefaultCar
+		setDefaultCar,
+		roadInfoById
 	};
 }
 

+ 17 - 2
manifest.json

@@ -22,7 +22,9 @@
             "delay" : 0
         },
         /* 模块配置 */
-        "modules" : {},
+        "modules" : {
+            "Push" : {}
+        },
         /* 应用发布信息 */
         "distribute" : {
             /* android打包配置 */
@@ -55,7 +57,13 @@
             /* ios打包配置 */
             "ios" : {},
             /* SDK配置 */
-            "sdkConfigs" : {}
+            "sdkConfigs" : {
+                "maps" : {},
+                "geolocation" : {},
+                "push" : {
+                    "unipush" : {}
+                }
+            }
         }
     },
     /* 快应用特有相关 */
@@ -81,6 +89,13 @@
         "template" : "template.h5.html",
         "router" : {
             "mode" : "hash"
+        },
+        "sdkConfigs" : {
+            "maps" : {
+                "qqmap" : {
+                    "key" : "BOGBZ-2BZ33-O4L32-Y3QJR-PGN66-RFFEL"
+                }
+            }
         }
     }
 }

+ 29 - 4
pages/index/index.vue

@@ -46,7 +46,7 @@
 			<u-card :show-foot="false" border-radius="16" margin="20rpx 40rpx" padding="30">
 				<view class="pending-order-head" slot="head">
 					<view class="pending-order-head-left"><b>P</b>{{item.roadName}}</view>
-					<view class="pending-order-head-right" @click="orderDetails"><u-icon class="arrow-down" name="arrow-down" size="32"></u-icon></view>
+					<view class="pending-order-head-right" @click="onRoadInfo(item)"><u-icon class="arrow-down" name="arrow-down" size="32"></u-icon></view>
 				</view>
 				<view class="pending-order-body" slot="body">
 					<!-- <view class="pending-order-body-nav">
@@ -137,11 +137,25 @@
 		},
 		onLoad() {
 			this.handleGetIndexData();
+			// this.getLocation();
 			let locationLocaturl = window.location.search;
 			this.code = getUrlParams(locationLocaturl,"code");
 			if(this.code&&!this.$store.state.vuex_wxinfo.openId){this.handleGetWXInfo(this.code)};
 		},
 		methods: {
+			// getLocation(){
+			// 	console.log("请求定位")
+			// 	uni.getLocation({
+			// 		type:"gcj02",
+			// 		success : function (res) {
+			// 			console.log("定位返回信息:", res)
+			// 			alert(res.longitude + "," + res.latitude )
+			// 		},
+			// 		fail: function(res){
+			// 			console.log("请求错误:", res)
+			// 		}
+			// 	})
+			// },
 			handleSearch(){
 				console.log('this.keyword',this.keyword);
 				this.$u.route({
@@ -161,7 +175,6 @@
 			handleGetIndexData(){
 				this.$u.api.getIndexData()
 				.then(res=>{
-					console.log('getIndexData',res);
 					if(res.data.vehicleList.length<1){
 						this.bindCarShow = true;
 					}
@@ -237,8 +250,20 @@
 				});
 			},
 			//
-			orderDetails(){
-				this.showOrderDetails = true;
+			onRoadInfo(item){
+				this.$u.api.roadInfoById({id:item.roadId})
+				.then(res=>{
+					this.content = `
+				   <dl><dt>路段名称:</dt> <dd>` + res.data.roadName + `</dd></dl>`
+				+ `<dl><dt>路段编码:</dt><dd>` + res.data.roadNo + `</dd></dl>`
+				+ `<dl><dt>联系人:</dt><dd>` + res.data.manager + `</dd></dl>`
+				+ `<dl><dt>联系电话:</dt><dd>` + res.data.telephone + `</dd></dl>`;
+				
+					this.showOrderDetails = true;
+				}).catch(err=>{
+					alert(err.msg);
+					console.log('getIndexData err',err)
+				});
 			}
 
 		}