|
@@ -22,9 +22,15 @@ export default {
|
|
|
shiftInfo: {
|
|
|
|
|
|
},
|
|
|
+ remindList:[],
|
|
|
list: [{}, {}],
|
|
|
carList:[],
|
|
|
+ caritem:{
|
|
|
+ driverInfo:{}
|
|
|
+ },
|
|
|
+ caritemBl:false,
|
|
|
stationList: [],
|
|
|
+
|
|
|
//个人
|
|
|
info: {
|
|
|
obj: null,
|
|
@@ -32,8 +38,23 @@ export default {
|
|
|
longitude: '',
|
|
|
latitude: '',
|
|
|
},
|
|
|
+ reverseInit:false,
|
|
|
myinterval: '',
|
|
|
- routeInfo:{}
|
|
|
+ routeInfo:{},
|
|
|
+ radiolist: [
|
|
|
+ {
|
|
|
+ name: '不提醒',
|
|
|
+ isRemind: "0",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: '提前1站',
|
|
|
+ isRemind: "1",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: '提前2站',
|
|
|
+ isRemind: "2",
|
|
|
+ }
|
|
|
+ ]
|
|
|
|
|
|
}
|
|
|
},
|
|
@@ -41,10 +62,37 @@ export default {
|
|
|
Carmap
|
|
|
},
|
|
|
|
|
|
- methods: {
|
|
|
+ methods: {
|
|
|
+ radioGroupChange(){
|
|
|
+ var item= this.downItem
|
|
|
+
|
|
|
+ if(item.isRemind==0){
|
|
|
+ if(this.downItem.remindId){
|
|
|
+ this.del(item.remindId,item.isRemind!=0)
|
|
|
+ }
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if(item.remindId){
|
|
|
+ this.del(item.remindId,item.isRemind!=0)
|
|
|
+ }else{
|
|
|
+ this.remindAdd()
|
|
|
+ }
|
|
|
+
|
|
|
+ },del(id,bl){
|
|
|
+ API_index.cancelRemind(id).then((res) => {
|
|
|
+ this.downItem.remindId=""
|
|
|
+ if(bl){
|
|
|
+ this.remindAdd()
|
|
|
+ }else{
|
|
|
+ this.$refs.common.alert( "设置成功");
|
|
|
+ }
|
|
|
+ }).catch(error => {
|
|
|
+ this.$refs.common.alert( error);
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
remind(){
|
|
|
- var myBtn = document.getElementById("subscribe-btn").tap();
|
|
|
-
|
|
|
+ var myBtn = document.getElementById("subscribe-btn").tap();
|
|
|
myBtn.tap();
|
|
|
},
|
|
|
showCar(item){
|
|
@@ -86,14 +134,15 @@ export default {
|
|
|
this.$refs.amap.setCenter(item);
|
|
|
this.downid=item.id;
|
|
|
this.downItem=item;
|
|
|
+ this.$forceUpdate()
|
|
|
},
|
|
|
remindAdd(){
|
|
|
if(this.downItem.id){
|
|
|
- var item= this.remindInfo
|
|
|
+
|
|
|
var obj={
|
|
|
startStationId:this.stationList[0].id,
|
|
|
remindStationId :this.downItem.id,
|
|
|
- stopInAdvance:"1",
|
|
|
+ stopInAdvance:this.downItem.isRemind,
|
|
|
remindType:"1",
|
|
|
vehicleShiftId:this.routeInfo.id,
|
|
|
openId:this.carhelp.getOpenId()
|
|
@@ -112,22 +161,74 @@ export default {
|
|
|
this.$refs.amap.initMap(point, this.stationList,startend);
|
|
|
}
|
|
|
},
|
|
|
- reverse(){
|
|
|
- if(process.car.SIMPLE_RUN){
|
|
|
- this.remindAdd();
|
|
|
- return
|
|
|
+ carShow(item){
|
|
|
+
|
|
|
+ var caritem =null;
|
|
|
+ for(var i in this.carList){
|
|
|
+ var car= this.carList[i]
|
|
|
+ if(car.currentStationId==item.id){
|
|
|
+ var caritem=car;
|
|
|
+ break
|
|
|
+ }
|
|
|
}
|
|
|
+ this.caritem=caritem;
|
|
|
+ this.caritemBl=true;
|
|
|
+
|
|
|
+
|
|
|
+ },
|
|
|
+ reverse(){
|
|
|
|
|
|
this.stationList.reverse();
|
|
|
- this.getCar()
|
|
|
+ this.getCar()
|
|
|
+ this.passengerShiftRemindList();
|
|
|
+
|
|
|
this.$refs.amap.setStartend(this.stationList);
|
|
|
+ document.getElementById('map-route-main').scrollLeft = 0
|
|
|
+ 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();
|
|
|
+ });
|
|
|
|
|
|
},
|
|
|
-
|
|
|
+ setRemind(){
|
|
|
+ for(var i in this.stationList){
|
|
|
+ var item=this.stationList[i];
|
|
|
+ item.isRemind=0;
|
|
|
+ item.remindId="";
|
|
|
+ for(var j in this.remindList){
|
|
|
+ var obj=this.remindList[j];
|
|
|
+ if(this.stationList[0].id==obj.startStationId&&obj.remindType==1){
|
|
|
+ if(obj.remindStationId==item.id){
|
|
|
+ item.remindId=obj.id;
|
|
|
+ item.isRemind=obj.stopInAdvance;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ this.$forceUpdate()
|
|
|
+ },
|
|
|
+ passengerShiftRemindList(){
|
|
|
+ this.$refs.common.showLoading()
|
|
|
+ API.passengerShiftRemindList({
|
|
|
+ shiftId:this.id,
|
|
|
+ openId:this.carhelp.getOpenId(),
|
|
|
+ }).then((response) => {
|
|
|
+ this.remindList=response.data;
|
|
|
+ this.setRemind();
|
|
|
+ this.$refs.common.showLoading(false)
|
|
|
+ })
|
|
|
+ },
|
|
|
getPassengerInfo() {
|
|
|
|
|
|
this.$refs.common.showLoading()
|
|
|
-
|
|
|
+
|
|
|
API.routeDetail(this.id).then((response) => {
|
|
|
|
|
|
var list=response.data.stationInfoList;
|
|
@@ -140,10 +241,12 @@ export default {
|
|
|
}
|
|
|
this.stationList=list;
|
|
|
for(var i in list){
|
|
|
+ list[i].isRemind=0;
|
|
|
if(list[i].id==this.downid){
|
|
|
this.downItem=list[i];
|
|
|
}
|
|
|
}
|
|
|
+ this.passengerShiftRemindList();
|
|
|
|
|
|
this.$refs.common.showLoading(false)
|
|
|
|