zhengkaixin 2 yıl önce
ebeveyn
işleme
6fe00e45cc
8 değiştirilmiş dosya ile 74 ekleme ve 45 silme
  1. 1 1
      .env.dev.js
  2. 1 1
      .env.js
  3. 8 8
      bobo-router/index.js
  4. 8 2
      components/Carmap.vue
  5. 10 11
      pages.json
  6. 30 19
      pages/route/index.js
  7. 3 3
      pages/route/index.vue
  8. 13 0
      utils/wxJsApi.js

+ 1 - 1
.env.dev.js

@@ -1,6 +1,6 @@
 const UNI_APP = {  
 	
-    BASE_URL: 'https://ykt-test.xiaoxinda.com/smart-bus-server/' ,
+    BASE_URL: 'http://192.168.77.199:8080/ds-gps/' ,
 	NODE_ENV :"dev",
 	SIMPLE_RUN:true,// 无视权限控制跳转页面   , 用于样式人员快速访问各种功能 ,快速测试等
 	//企业联合会微信appid

+ 1 - 1
.env.js

@@ -1,5 +1,5 @@
 (function() {  
-    const NODE_ENV = 'test'; // dev:开发环境 | test:测试环境  
+    const NODE_ENV = 'dev'; // dev:开发环境 | test:测试环境  
     let ENV_VAR = null;  
 	 
     if (process.env.NODE_ENV === "development") {  

+ 8 - 8
bobo-router/index.js

@@ -71,15 +71,15 @@ router.beforeEach(function(to, from, next) {
 		routerBeforeEach(to, from, next);
 	} else {
 		
-		if (!carhelp.getOpenId()) {
-			if (isWeiXin()) {
-				getOpenId();
-			}
-		} else {
+		// if (!carhelp.getOpenId()) {
+		// 	if (isWeiXin()) {
+		// 		getOpenId();
+		// 	}
+		// } else {
 			
-			routerBeforeEach(to, from, next);
-		}
-
+		// }
+		routerBeforeEach(to, from, next);
+		
 	}
 
 

+ 8 - 2
components/Carmap.vue

@@ -273,7 +273,12 @@
 						resizeEnable: true,
 						center: [this.longitude, this.latitude],
 						zoom: 14
-					});
+					});
+					if(document.getElementsByClassName("amap-logo").length){
+						document.getElementsByClassName("amap-logo")[0].setAttribute("class","amap-copyright" );
+						
+					}
+
 					this.$emit('onload')
 				}, e => {
 					//_this.mui.toast('地图加载失败');
@@ -355,9 +360,10 @@
 <style scoped>
 /*去除下标*/
 .amap-logo{
-display: none;
+display: none !important;
 }
 .amap-copyright{
+	display: none !important;
 opacity:0;
     font-size: 1px;
 }

+ 10 - 11
pages.json

@@ -3,7 +3,15 @@
 			"^u-(.*)": "uview-ui/components/u-$1/u-$1.vue"
 		},
 	"pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages	
-		
+		{
+			//路线详情
+		    "path" : "pages/route/index",
+		    "style" :                                                                                    
+		    {
+		       // "navigationBarTitleText": "路线详情",
+		        "enablePullDownRefresh": false
+		    }    
+		},
 		{
 			"name":"IndexIndex",
 			"path": "pages/index/index",
@@ -24,16 +32,7 @@
             }
             
         }
-        ,{
-			//路线详情
-            "path" : "pages/route/index",
-            "style" :                                                                                    
-            {
-               // "navigationBarTitleText": "路线详情",
-                "enablePullDownRefresh": false
-            }
-            
-        }
+    
        
         ,{
 			//添加乘车人

+ 30 - 19
pages/route/index.js

@@ -8,7 +8,7 @@ export default {
 	data() {
 		return {
 			wxinit:false,
-			mapopen:false,
+			mapopen:true,
 			initBl: false,
 			title: '乘车人',
 			show: false,
@@ -31,7 +31,8 @@ export default {
 			caritem:{
 				driverInfo:{}
 			},
-			caritemBl:false,
+			caritemBl:false,
+			caritemBl2:false,
 			stationList: [],
 			routeTimeTableList:[],
 			dis:'',
@@ -210,7 +211,7 @@ export default {
 			}
 			 
 			API.routeShiftList(obj).then((response) => {
-				this.carList=response.data;
+				this.carList=[response.data];
 				
 				if(!this.centerBl&&this.carList.length){
 					this.centerBl=this.$refs.amap.setCenter(this.carList[0]);
@@ -297,7 +298,7 @@ export default {
 				console.log("--------this.carList----------")
 				
 				this.$refs.amap.setCarList(this.carList);
-				this.vehicleStationDis();
+				//this.vehicleStationDis();
 			}).catch(error => {
 				console.log(error);
 				this.$refs.common.showLoading(false,error)
@@ -318,7 +319,7 @@ export default {
 			this.$refs.amap.setCenter(item);
 			this.downid=item.id;
 			this.downItem=item;
-			this.vehicleStationDis();
+			//this.vehicleStationDis();
 			this.$forceUpdate()
 		},
 		remindAdd(){
@@ -385,7 +386,7 @@ export default {
 	
 		},
 		carShow(item){
-			
+			return
 			var caritem =null;
 			for(var i in this.carList){
 				var car= this.carList[i]
@@ -417,7 +418,7 @@ export default {
 			this.centerBl=false;
 			this.stationList.reverse();
 			this.getCar()
-			 this.passengerShiftRemindList();
+			// this.passengerShiftRemindList();
 			
 			this.$refs.amap.setStartend(this.stationList);
 			document.getElementById('map-route-main').scrollLeft = 0
@@ -483,7 +484,7 @@ export default {
 						this.downItem=list[i];
 					}			
 				}
-				this.passengerShiftRemindList();
+				//this.passengerShiftRemindList();
 				
 				this.$refs.common.showLoading(false)
 				
@@ -534,16 +535,22 @@ export default {
 				}
 			if(this.downid){
 				this.downBtn(this.downItem)
+			}
+			if(this.mapopen){
+				this.$refs.amap.setMyStyle("width: 100%; height: 340px;")
+			}else{
+				this.$refs.amap.setMyStyle("width: 100%; height: 140px;")
+				
 			}
 			
 		},
 		getPoint() {
 			
 			if (!this.info.init) {
-				WxJsApi.getWxConfig([ 'getLocation','getSetting']).then(() => {
-					// this.$refs.common.showLoading(false)
-					this.getLocation()
-				});
+				// WxJsApi.getWxConfig([ 'getLocation','getSetting']).then(() => {
+				// 	// this.$refs.common.showLoading(false)
+				// 	this.getLocation()
+				// });
 			}else{
 					this.getLocation()
 			}
@@ -555,6 +562,7 @@ export default {
 			}
 		},
 		getLocation(){
+			return false;
 			WxJsApi.getLocation().then((res) => {
 				console.log("----getLocation ok-----")
 				var latitude = parseFloat(res.latitude);
@@ -577,9 +585,12 @@ export default {
 
 	},
 	onLoad(op) {
-		this.upid=op.upid;
-		this.id = op.id
-		this.downid=op.downid;
+		// this.upid=op.upid;
+		// this.id = op.id
+		// this.downid=op.downid;
+		
+		this.upid=1
+		this.id = 1
 	},
 	onUnload() {
 		if (this.myinterval) {
@@ -587,12 +598,12 @@ export default {
 		}
 	},
 	onReady() {
-		WxJsApi.getWxConfig([ 'getLocation','getSetting']).then(() => {
-					// this.$refs.common.showLoading(false)
-					this.wxinit=true;
+		// WxJsApi.getWxConfig([ 'getLocation','getSetting']).then(() => {
+		// 			// this.$refs.common.showLoading(false)
+		// 			this.wxinit=true;
 				
 					
-				});	
+		// 		});	
 		
 		this.getPassengerInfo()
 		

+ 3 - 3
pages/route/index.vue

@@ -38,13 +38,13 @@
 				</u-popup>
 			 
 				
-				<u-popup v-model="caritemBl" v-if="stationList.length" mode="center" closeable="true" border-radius="20">
+				<u-popup v-model="caritemBl2" v-if="stationList.length" mode="center" closeable="true" border-radius="20">
 					<view class="sitePopup">
 						<view class="sitePopup-head">
 							<h1>{{stationList[0].name}} → {{stationList[stationList.length-1].name}}</h1>
 							<p>首班:{{routeInfo.startTime}}  末班:{{routeInfo.endTime}}</p>
 						</view>
-						<view class="sitePopup-main">
+						<view class="sitePopup-main" v-if="false">
 							<view class="sitePopup-driver">				
 								<view class="driver-info">
 									<view class="driver-head">
@@ -212,7 +212,7 @@
 		
 		</view>
 		<view class="map-route-foot">
-			<view class="remind-btn" @click="show1 = true,popid=downItem.isRemind" v-show="!downItem.remindId">
+			<view class="remind-btn" v-if="false"   @click="show1 = true,popid=downItem.isRemind" v-show="!downItem.remindId">
 				 
 					<u-icon name="md-alarm" custom-prefix="custom-icon" color="#666" size="44"></u-icon>
 					<span>设置提醒</span>

+ 13 - 0
utils/wxJsApi.js

@@ -116,6 +116,19 @@ export function uploadPic(imgBase64) {
 
 //获取坐标
 export function getLocation() {
+	if(process.env.NODE_ENV === "development"){
+		
+		let promise =new Promise((resolve, reject) => {
+			var obj= {
+			
+			longitude:112.281100,
+			latitude:30.294000,
+			errMsg:"getLocation:ok"
+			}
+			resolve(obj);
+		})
+		return promise
+	}
 	let promise = new Promise((resolve, reject) => {
 		wx.ready(function() {
 			wx.getLocation({