zkx 4 years ago
parent
commit
d54012b0d5
8 changed files with 142 additions and 96 deletions
  1. 1 1
      components/Carmap.vue
  2. 9 1
      pages.json
  3. 16 24
      pages/index/index.js
  4. 21 19
      pages/index/index.vue
  5. 5 1
      pages/my/index.js
  6. 24 19
      pages/my/index.vue
  7. 62 19
      pages/route/index.js
  8. 4 12
      pages/route/index.vue

+ 1 - 1
components/Carmap.vue

@@ -300,7 +300,7 @@
 						strokeWeight: 3, //线宽
 						//strokeStyle: "solid"  //线样式
 					});
-					
+					this.$emit('onload')
 				}, e => {
 					//_this.mui.toast('地图加载失败');
 					console.log('地图加载失败', e)

+ 9 - 1
pages.json

@@ -350,7 +350,15 @@
 		        "enablePullDownRefresh": false
 		    }
 		    
-		}
+		},{
+            "path" : "pages/my/platform/help",
+            "style" :                                                                                    
+            {
+                "navigationBarTitleText": "",
+                "enablePullDownRefresh": false
+            }
+            
+        }
     ],
 	"condition": { //模式配置,仅开发期间生效
 	        "current": 0, //当前激活的模式(list 的索引项)

+ 16 - 24
pages/index/index.js

@@ -54,6 +54,7 @@ export default {
 			
 		},
 		methods: {
+			
 			// 选中某个单选框时,由radio时触发
 			radioChange(e) {
 				// console.log(e);
@@ -103,14 +104,13 @@ export default {
 				 API.saveRemind(obj).then((res) => {
 				 	item.remindId=res.data.id
 					this.$refs.common.alert( "设置成功");
-				 	this.$forceUpdate()
+				 
 				 }).catch(error => {
 				 		this.$refs.common.alert( error);
 				 }) 
 			 },
 			radioGroupChange(item) {
-				this.rbool=true;
-				this.$forceUpdate()
+				this.remindHD();
 			},
 			
 			getRemindInfo(){
@@ -133,22 +133,7 @@ export default {
 			},
 			getBtn(){
 				
-				var btn = document.getElementById('subscribe-btn');
 				
-				if(btn&&btn.style){
-					console.log(btn.style.width)
-					if(btn.style.width=="120px"){
-						btn.style="width: 120.01px"
-							
-					}else if(btn.style.width=="120.01px"){
-						btn.style="width: 120px"
-					}else{
-						btn.style="width: 120.02px"
-						
-					}
-				}
-				
-				setTimeout(this.getBtn,1000)
 				
 				
 				
@@ -171,19 +156,23 @@ export default {
 				}
 				var data={
 						openId:this.carhelp.getOpenId()
-					};
+					};
+				
+					if(!this.carhelp.getOpenId()){
+						return
+					}
 				API.passengerMessageNoReadNum(data).then((res) => {
 					var num=res.data.num;
 					
 					
 					if(num){
 						uni.setTabBarBadge({
-						  index: 1,
+						  index: 2,
 						  text: num+''
 						})
 					}else{
 						 uni.removeTabBarBadge({
-								 index:1
+								 index:2
 						})
 					}
 				}).catch(error => {
@@ -216,9 +205,9 @@ export default {
 					url:'/pages/query/index?back=true'
 				})
 			},
-			gotoLine(item){
+			gotoLine(item,downid){
 				uni.navigateTo({
-					url:'/pages/route/index?id='+item.routeId+"&upid="+item.startStationId
+					url:'/pages/route/index?id='+item.routeId+"&upid="+item.startStationId+"&downid="+downid
 				})
 				
 			},
@@ -327,5 +316,8 @@ export default {
 			this.getBtn();
 			//清空缓存
 			this.carhelp.set("form",{});
-		}
+		},onShow(){
+				this.getPoint();
+				this.getRemindInfo();
+		},
 	}

+ 21 - 19
pages/index/index.vue

@@ -21,25 +21,27 @@
 			
 		</u-navbar>	
 		<view class="banner" v-show="list.length">
-			<u-swiper height="180" :list="list" @click="clickSwiper"></u-swiper>
+			<u-swiper height="200" :list="list" @click="clickSwiper"></u-swiper>
 		</view>
 		
-		<view class="remind">
-			<h3>玉桥 - 宿架转盘</h3>
-			<p>线路:19路 当前:玉桥小区</p>
-			<view class="remind-radio">
-				<span>到站提醒:</span>
-				<u-radio-group v-model="value" @change="radioGroupChange" active-color="#fff">		
-					<u-radio 
-						@change="radioChange" 
-						v-for="(item, index) in radiolist" :key="index" 
-						:name="item.name"
-						:disabled="item.disabled">
-						{{item.name}}
-					</u-radio>
-				</u-radio-group>
-			</view>
-		</view>
+	<view class="remind"   v-if="remindInfo">
+		<h3>{{remindInfo.currentStationName}} - {{remindInfo.ticketDownStationName}}</h3>
+		<p>线路:{{remindInfo.routeName}} 当前:{{remindInfo.currentStationName}}</p>
+		<view class="remind-radio">
+			<span>到站提醒:</span>
+			<u-radio-group v-model="remindInfo.isRemind" @change="radioGroupChange" active-color="#fff">		
+				<u-radio 
+					@change="radioChange" 
+					v-for="(dio, index) in radiolist" :key="index" 
+					:name="dio.isRemind"
+					>
+					{{dio.name}}
+				</u-radio>
+			</u-radio-group>
+		</view>
+	
+	</view>
+	
 		<view  v-if="!getPointBl"  style="text-align:center;margin-top: 40px;" >		
 			 <img src="static/img/getPointError.png" style="width: 50%;" alt="" >
 			 <view>打开手机定位功能,为您查询附近的站点</view>
@@ -61,10 +63,10 @@
 			</view>
 			<view class="content">
 				<view class="route">
-					<view class="route-item" v-for="li,i in item.nearbyShiftDTOList" :key="i" @click="gotoLine(li)">
+					<view class="route-item" v-for="li,i in item.nearbyShiftDTOList" :key="i" @click="gotoLine(li,item.stationId)">
 						<view class="route-text">
 							<h4>{{li.routeName}}</h4>
-							<p>开往 {{li.endStationName}}</p>
+							<p>开往:{{li.endStationName}} 当前:{{li.currentStationName}}</p>
 						</view>
 						<view class="route-gap" >
 							<view class="route-gap stop">

+ 5 - 1
pages/my/index.js

@@ -21,7 +21,11 @@ export default {
 				}
 				
 			},
-			
+			makePhoneCall(tel){
+				uni.makePhoneCall({
+				    phoneNumber: tel //仅为示例
+				});
+			},
 			showphone(phone){
 				if(!phone){
 					return "";

+ 24 - 19
pages/my/index.vue

@@ -1,5 +1,6 @@
 <template>
-	<view>
+	<view>
+		 <car-common   ref="common" ></car-common>
 		<!-- <car-common  mytitle="我的" :noback="false" ref="common" ></car-common> -->
 		<u-navbar :is-back="false" title="个人中心" :background="{backgroundColor: '#187aff',}" title-color="#fff" :border-bottom="false"></u-navbar>
 		<view class="u-flex user-box" v-if="user">
@@ -13,7 +14,7 @@
 				<u-button type="primary" plain size="mini" shape="circle"  @click="gotoUrl('/pages/my/user/updateinfo')">修改资料</u-button>
 			</view>
 		</view>
-		  <view class="u-flex user-box" v-if="!user">
+		  <view class="u-flex user-box" v-if="!user"  @click="gotoUrl('/pages/car/login',true)">
 			<view class="u-m-r-20">
 				<u-avatar :src="pic" size="100"></u-avatar>
 			</view>
@@ -24,7 +25,7 @@
 		</view>  
 		
 		<view class="user-cell">
-			<view class="user-cell-item">
+			<view class="user-cell-item" @click="gotoUrl('/pages/my/user/bybusList',true)" >
 				<view class="user-cell-title">
 					<u-icon name="ze-coupon" custom-prefix="custom-icon" size="40" color="#6eaaff"></u-icon>
 					<span>乘车记录</span>
@@ -33,26 +34,18 @@
 			</view>
 		</view>
 		<view class="user-cell">
-			<view class="user-cell-item">
+			<view class="user-cell-item"  @click="gotoUrl('/pages/my/user/updatephone/index')">
 				<view class="user-cell-title">
 					<u-icon name="antOutline-mobile" custom-prefix="custom-icon" size="40" color="#ee9a41"></u-icon>
 					<span>已绑定手机号</span>
 				</view>
 				<view class="user-cell-right">
-					<span>188****8888</span>
+					<span>{{showphone(user.phone)}}</span>
 					<u-icon name="arrow-right" color="#999" size="28"></u-icon>
 				</view>
 			</view>
-			<view class="user-cell-item">
-				<view class="user-cell-title">
-					<u-icon name="fasfa-shield-altCopy" custom-prefix="custom-icon" size="40" color="#9cb5ff"></u-icon>
-					<span>重置密码</span>
-				</view>
-				<view class="user-cell-right">
-					<u-icon name="arrow-right" color="#999" size="28"></u-icon>
-				</view>
-			</view>
-			<view class="user-cell-item">
+			 
+			<view class="user-cell-item" @click="gotoUrl('/pages/my/user/feedback')">
 				<view class="user-cell-title">
 					<u-icon name="riLine-feedback-line" custom-prefix="custom-icon" size="40" color="#8fbf7b"></u-icon>
 					<span>意见反馈</span>
@@ -61,17 +54,17 @@
 					<u-icon name="arrow-right" color="#999" size="28"></u-icon>
 				</view>
 			</view>
-			<view class="user-cell-item">
+			<view class="user-cell-item" @click="makePhoneCall('400-8899-619')">
 				<view class="user-cell-title">
 					<u-icon name="fasfa-headphonesCopy" custom-prefix="custom-icon" size="40" color="#9cdfff"></u-icon>
 					<span>联系客服</span>
 				</view>
 				<view class="user-cell-right">
-					<span>400-8888-8888</span>
+					<span>400-8899-619</span>
 					<u-icon name="arrow-right" color="#999" size="28"></u-icon>
 				</view>			
 			</view>
-			<view class="user-cell-item">
+			<view class="user-cell-item"  @click="gotoUrl('/pages/my/platform/about',true)">
 				<view class="user-cell-title">
 					<u-icon name="fasfa-exclamation-circleCopy" custom-prefix="custom-icon" size="40" color="#b0bdd0"></u-icon>
 					<span>关于车信达</span>
@@ -80,6 +73,18 @@
 					<span>当前版本 v1.1.10</span>
 					<u-icon name="arrow-right" color="#999" size="28"></u-icon>
 				</view>
+			</view>
+			
+			<view class="user-cell-item" @click="gotoUrl('/pages/my/platform/help',true)">
+				<view class="user-cell-title">
+					<u-icon name="fasfa-exclamation-circleCopy" custom-prefix="custom-icon" size="40" color="#b0bdd0"></u-icon>
+					<span>使用指南</span>
+				</view>
+				<!-- 当前版本V1.1.10 -->
+				<view class="user-cell-right">
+					<span></span>
+					<u-icon name="arrow-right" color="#999" size="28"></u-icon>
+				</view>
 			</view>
 		</view>
 		<!-- <u-cell-group>
@@ -99,7 +104,7 @@
 			<view class="signOut" @click="signOut">退出账号</view>
 		</view>
 		<view class="u-m-t-20" v-if="!user">
-			<view class="signOut" @click="gotoUrl('/pages/car/login')">登录</view>
+			<view class="signOut" @click="gotoUrl('/pages/car/login',true)">登录</view>
 		</view>
 	</view>
 </template>

+ 62 - 19
pages/route/index.js

@@ -1,4 +1,5 @@
  import * as API from '@/apis/route.js'
+  import * as API_index from '@/apis/index.js'
  import * as WxJsApi from '@/utils/wxJsApi.js'
  
 import Carmap from '@/components/Carmap.vue'
@@ -14,6 +15,7 @@ export default {
 			id: 0, // 使用 marker点击事件 需要填写id
 			upid:'',
 			downid:'',
+			downItem:{},
 			//地图居中后的位置
 			longitude: 112.276527,
 			latitude: 30.306427,
@@ -83,18 +85,43 @@ export default {
 			this.$refs.amap.setSite(item);
 			this.$refs.amap.setCenter(item);
 			this.downid=item.id;
+			this.downItem=item;
+		},
+		remindAdd(){
+			if(this.downItem.id){
+				var item= this.remindInfo
+				var obj={
+					startStationId:this.stationList[0].id,
+					remindStationId :this.downItem.id,
+					stopInAdvance:"1",
+					remindType:"1",
+					vehicleShiftId:this.routeInfo.id,
+					openId:this.carhelp.getOpenId()
+				}
+				API_index.saveRemind(obj).then((res) => {
+					this.downItem.remindId=res.data.id
+					this.$refs.common.alert( "设置成功");
+				
+				}).catch(error => {
+						this.$refs.common.alert( error);
+				}) 
+			}
 		},
-		
-  
 		drawing(point, startend) {
 			if (this.$refs.amap) {
 				this.$refs.amap.initMap(point, this.stationList,startend);
 			}
 		},
-		reverse(){
+		reverse(){
+			if(process.car.SIMPLE_RUN){
+				this.remindAdd();
+				return
+			}
+			
 			this.stationList.reverse();
 			this.getCar()
-			this.$refs.amap.setStartend(this.stationList);
+			this.$refs.amap.setStartend(this.stationList);
+			
 		},
 		 
 		getPassengerInfo() {
@@ -102,7 +129,7 @@ export default {
 			this.$refs.common.showLoading()
 
 			API.routeDetail(this.id).then((response) => {
-				
+				 
 				var  list=response.data.stationInfoList;
 				if(this.upid&&list.length){
 					
@@ -111,7 +138,13 @@ export default {
 					}
 					this.upid="";
 				}
-				this.stationList=list;
+				this.stationList=list;
+				for(var i in list){
+					if(list[i].id==this.downid){
+						this.downItem=list[i];
+					}			
+				}
+				
 				this.$refs.common.showLoading(false)
 				
 				var point = [];
@@ -143,17 +176,36 @@ export default {
 				this.$refs.common.showLoading(false)
 				
 				this.getPoint()
+				
+				this.$nextTick(function() {
+					const query = uni.createSelectorQuery().in(this);
+					query.select('.map-down').boundingClientRect(data => {
+						if(data){
+							document.getElementById('map-route-main').scrollLeft = data.left-20;
+						}
+						this.$refs.common.showLoading(false);
+						//this.downBtn()
+					}).exec();
+				});
+				
 			}).catch(error => {
 				this.$refs.common.showLoading(false,error)
 			})
 		},
+		mapdown(){
+			
+			if(this.downid){
+				this.downBtn(this.downItem)
+			}
+			
+		},
 		getPoint() {
 
 
 			
 		
 			if (!this.info.init) {
-				WxJsApi.getWxConfig(['addEventListener','getLocation','getSetting']).then(() => {
+				WxJsApi.getWxConfig([ 'getLocation','getSetting']).then(() => {
 					// this.$refs.common.showLoading(false)
 					this.getLocation()
 				});
@@ -192,6 +244,7 @@ export default {
 	onLoad(op) {
 		this.upid=op.upid;
 		this.id = op.id
+		this.downid=op.downid;
 	},
 	onUnload() {
 		if (this.myinterval) {
@@ -199,20 +252,10 @@ export default {
 		}
 	},
 	onReady() {
-		WxJsApi.getWxConfig(['addEventListener','getLocation','getSetting']).then(() => {
+		WxJsApi.getWxConfig([ 'getLocation','getSetting']).then(() => {
 					// this.$refs.common.showLoading(false)
 					this.wxinit=true;
-					this.$nextTick(function() {
-						var btn = document.getElementById('subscribe-btn');
-						btn.addEventListener('success', function (e) {            
-						  console.log('success', e.detail);
-						  alert("success")
-						});   
-						btn.addEventListener('error',function (e) {             
-						  console.log('fail', e.detail);
-						   alert("fail")
-						});
-					})
+				
 					
 				});	
 		

+ 4 - 12
pages/route/index.vue

@@ -10,7 +10,7 @@
 				<span v-if="mapopen">缩小地图</span>
 			</view>
 		</u-navbar>
-		<carmap ref="amap"></carmap>
+		<carmap ref="amap" @onload="mapdown"></carmap>
 		
 		<view class="map-info">
 			<view class="map-text" v-if="stationList.length">
@@ -27,11 +27,11 @@
 		<view class="map-route">
 			
 			 
-			<view class="map-route-main">
+			<view class="map-route-main" id="map-route-main">
 				
 				<template v-for="item,i in stationList">
 					<view   class="scroll-view-item" 
-					:class="{'map-route-origin map-geton ':i==0,'map-route-item':i!=0,'map-geton':downid==item.id}"
+					:class="{'map-route-origin map-geton ':i==0,'map-route-item':i!=0,'map-geton':downid==item.id,'map-down':downid==item.id}"
 					 @click="downBtn(item)">
 						
 						<view class="map-route-car" v-if="showCar(item)">
@@ -81,15 +81,7 @@
 		
 	</view>
 </template>
-<script>
-var btn = document.getElementById('subscribe-btn');
-btn.addEventListener('success', function (e) {            
-  console.log('success', e.detail);
-});   
-btn.addEventListener('error',function (e) {             
-  console.log('fail', e.detail);
-});
-</script>
+
 <script>
 	import api from './index.js'
 	export default   api