Commit 5225039d authored by Mac's avatar Mac

包车修改

parent 1876351a
......@@ -362,6 +362,8 @@
"path":"pickcarcity2"//出发和到达选择的地址
},{
"path":"bookaCarList"//定制车页面
},{
"path":"returncarList"//定制车返程
},{
"path": "orderList"
},{
......
......@@ -16,14 +16,14 @@
.box-top {
width: 100%;
height: 50px;
height: 60px;
display: flex;
align-items: center;
padding: 0 15px;
.box-top-b {
width: 100%;
height: 45px;
height: 55px;
background: #ECF1F4;
border-radius: 23px;
display: flex;
......@@ -321,16 +321,19 @@
<view class="box-top-b-l">
{{carMsg.StartCityName}}
</view>
<image src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/CustomizedCar/zhuanghuan.png"
mode="aspectFill" style="width: 20px;height: 20px;"></image>
<view style="display: flex;flex-direction: column;align-items: center;">
<image src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/CustomizedCar/gocar.png"
mode="aspectFill" style="width: 18px;height: 18px;"></image>
<span style='margin-top: 3px;font-size: 10px;color:#1B1D1E ;'>去程</span>
</view>
<view class="box-top-b-l">
{{carMsg.ArriveCityName}}
</view>
</view>
</view>
<view class="box-rili">
<view class="box-rili-scroll">
<view class="box-rili-scroll" v-if="carMsg.returnId==1">
<scroll-view :scroll-x='true' style="width: 100%;" @scroll='getscroll' :scroll-left="scrollleft">
<view style="display: flex;align-items: center;">
<view class="box-rili-item" :class="{'box-rili-item2':msg.Q_Date == x.date}"
......@@ -341,6 +344,18 @@
</view>
</scroll-view>
</view>
<view class="box-rili-scroll" v-if="carMsg.returnId==2">
<scroll-view :scroll-x='true' style="width: 100%;" @scroll='getscroll' :scroll-left="scrollleft">
<view style="display: flex;align-items: center;">
<view class="box-rili-item" :style="{'color':x.show==true && msg.Q_Date != x.date? '#111111':'#e2e2e2'}" :class="{'box-rili-item2':msg.Q_Date == x.date}"
v-for="(x,y) in topdateList" :key='y' @click="choicedatelist(x)">
<span style='width: 50px;display: inline-block;text-align: center;'>{{x.showdate}}</span>
<span>{{x.week}}</span>
</view>
</view>
</scroll-view>
</view>
<view class="porili" @click="showcalendar = true">
<image
......@@ -355,7 +370,7 @@
<span style='margin-top: 20px;'>真遗憾,没有相关数据</span>
</view>
<view style="height: calc(100% - 130px);" v-if="g.length > 0">
<view style="height: calc(100% - 140px);" v-if="g.length > 0">
<scroll-view :scroll-y="true" :enable-back-to-top="true" :enable-flex="true" @scrolltolower="lower"
style="height: 100%;width: 100%">
<view style="padding: 0 15px;">
......@@ -436,8 +451,8 @@
<view style='margin-left: 3px;width: calc(100vw - 60px - 80px);'>{{x.Description}}
</view>
</view>
<view class="s-b-box-r" v-if="x.ProductState==1" @click="yuding(x)">
预定
<view class="s-b-box-r" v-if="x.ProductState==1" @click="yuding(x)">
{{carMsg.returnId==1?'预定':'选定'}}
</view>
</view>
......@@ -470,7 +485,7 @@
</view>
</view>
<view class="mask" v-if="showcalendar"></view>
<calendar :is-show="showcalendar" :start-date='msg.Q_Date' @callback="getDate" @closeback='getclose'
<calendar :is-show="showcalendar" :start-date='msg.Q_Date' @callback="getDate" @closeback='getclose' :between-start='betweenStart' :between-end='betweenEnd'
:init-month='3' />
<u-popup v-model="screenshow" mode='bottom' ref="onlyhover">
<view class="popup-box">
......@@ -553,7 +568,8 @@
page_count: 1,
status: "loadmore",
g: [],
topdateList: [],
topdateList: [],
xuandateList:[],
DepartList: [], //出发点数组
ArriveList: [], //到达点数组
alltime: [],//时间数组
......@@ -573,7 +589,9 @@
},
scrollleft:0,
carMsgobj:'',
Up:0
Up:0,
betweenStart:'',//日期可选开始
betweenEnd:'',//日期可选结束
}
......@@ -584,7 +602,7 @@
//对象解码
this.carMsg = JSON.parse(decodeURIComponent(options.carMsg))
this.carMsgobj = options.carMsg;//保存原始的用于分享
console.log(this.carMsg)
this.msg.StartCityId = this.carMsg.StartCityId;
this.msg.StartCityType = this.carMsg.StartCityType;
this.msg.ArriveCityId = this.carMsg.ArriveCityId;
......@@ -603,7 +621,6 @@
this.$nextTick(function() {
this.scrollleft = 0
});
console.log(options)
this.mainColor = this.$uiConfig.mainColor;
this.gettimeList()
this.init();
......@@ -664,11 +681,20 @@
avatarUrl: ""
};
this.showAuth = true;
} else{
uni.navigateTo({
url: '/pages/guidecar/specialCarReserve?Id='+x.Id +'&Date='+this.msg.Q_Date
})
} else{
if(this.carMsg.returnId == 1){
uni.navigateTo({
url: '/pages/guidecar/specialCarReserve?Id='+x.Id +'&Date='+this.msg.Q_Date
})
}else{
this.carMsg.Q_Date = this.msg.Q_Date
let obj = encodeURIComponent(JSON.stringify(this.carMsg))
let data = encodeURIComponent(JSON.stringify(x))
uni.navigateTo({
url: '/pages/guidecar/returncarList?carMsg='+obj +'&data='+data
})
}
}
},
......@@ -684,11 +710,24 @@
},
gettimeList() {
var date1 = new Date();
var date2 = new Date(date1);
var date2 = new Date(date1);
date2.setDate(date1.getDate() + 60);
let nowtime = date1.getFullYear() + "-" + (date1.getMonth() + 1) + "-" + date1.getDate();
let htime = date2.getFullYear() + "-" + (date2.getMonth() + 1) + "-" + date2.getDate();
this.topdateList = this.getDayAll(nowtime, htime)
let htime = date2.getFullYear() + "-" + (date2.getMonth() + 1) + "-" + date2.getDate();
this.topdateList = this.getDayAll(nowtime, htime)
this.betweenStart = this.carMsg.Q_Date;
this.betweenEnd = this.carMsg.F_Date;
if(this.carMsg.returnId==2){
this.xuandateList = this.getDayAll(this.carMsg.Q_Date, this.carMsg.F_Date)
this.topdateList.forEach((x)=>{
this.xuandateList.map(j=>{
if(x.date == j.date){
x.show = true;
return
}
})
})
}
this.startDate = nowtime;
this.getscollwz()
......@@ -727,7 +766,8 @@
let obj = {
showdate: mouth + '/' + day,
date: YYMMDD,
week: week
week: week,
show:false
}
dates.push(obj)
}
......@@ -767,7 +807,7 @@
this.topdateList.map((x,i)=>{
if(x.date == this.msg.Q_Date){
index = i;
console.log(index)
return
}
})
......@@ -802,8 +842,21 @@
return '周日'
}
},
choicedatelist(x) {
this.msg.Q_Date = x.date;
choicedatelist(x) {
if(this.carMsg.returnId == 1){
this.msg.Q_Date = x.date;
}else{
if(x.show == false){
uni.showToast({
title:'不在往返时间内',
icon:'none'
})
return
}else{
this.msg.Q_Date = x.date;
}
}
this.msg.pageIndex = 1;
this.g = [];
this.init()
......
......@@ -457,7 +457,7 @@ export default {
width:100%;
height:100%;
left:0;
top:113px;
top:122px;
z-index: 900;
}
.sjx{
......
This diff is collapsed.
......@@ -19,6 +19,13 @@
</view>
<view v-if="active==1" style="width: 100%;padding: 10px 0;">
<view class="dingzhitop">
<view style="font-size: 11px;color: #919191;">出行类型</view>
<view class="dingzhitop_r">
<view class="dingzhitop_r_item" @click="carMsg.returnId=1" :class="carMsg.returnId==1?'xuanzhong':'weixuan'">单程</view>
<view class="dingzhitop_r_item" @click="carMsg.returnId=2" :class="carMsg.returnId==2?'xuanzhong':'weixuan'" style="margin-left: 15px;">往返</view>
</view>
</view>
<view class="c_row" v-if="info.IsShowDate==1" style="justify-content: space-between;border-bottom: 1px solid #E2E2E2;">
<view class="ac_o" @click="goaddressx(1)">
<span class='ac_o_h' v-if="carMsg.StartCityName =='' ">出发地</span>
......@@ -32,15 +39,31 @@
<span class='ztext2' v-else >{{carMsg.ArriveCityName}}</span>
</view>
</view>
<view style="width: 100%;color: #919191;font-size: 11px;height: 30px;line-height: 30px;border: none;">
<view style="width: 100%;color: #919191;font-size: 11px;height: 30px;line-height: 30px;border: none;" v-if='carMsg.returnId==1'>
时间
</view>
<view style="width: 100%;height: 50px;display: flex;align-items: center;border-bottom: 1px solid #E2E2E2;font-size: 14px;color: #1B1D1E;font-weight: 800;">
<view v-if='carMsg.returnId==1' style="width: 100%;height: 50px;display: flex;align-items: center;border-bottom: 1px solid #E2E2E2;font-size: 14px;color: #1B1D1E;font-weight: 800;">
<picker mode="date" :value="cardate" :start="startDate" @change="bindDateChange">
<span>{{showcardate}}</span>
<span style='margin-left: 5px;'>{{showweek}}</span>
</picker>
</view>
<view style="width: 100%;display: flex;align-items: center;justify-content: space-between;border: none;height: 30px;color: #919191;font-size: 11px" v-if='carMsg.returnId==2'>
<span>去程时间</span>
<span>返程时间</span>
</view>
<view v-if='carMsg.returnId==2' style="width: 100%;height: 50px;display: flex;align-items: center;border-bottom: 1px solid #E2E2E2;font-size: 14px;color: #1B1D1E;font-weight: 800;
display: flex;align-items: center;justify-content: space-between;" @click="showTimePopup=true">
<view>
<span>{{showcardate2}}</span>
<span style='margin-left: 5px;'>{{showweek2}}</span>
</view>
<view>
<span>{{showcardate3}}</span>
<span style='margin-left: 5px;'>{{showweek3}}</span>
</view>
</view>
<view class="carbtn" @click="godingche">
去订车
</view>
......@@ -166,15 +189,25 @@
</view>
</u-popup>
<u-picker v-model="showStart" mode="time" :params="params" @confirm='btnStart' :default-time='defaultTime'></u-picker>
<!-- 定制包车的往返时间选择 -->
<u-popup v-model="showTimePopup" mode="bottom" border-radius="20" length="85%" :safe-area-inset-bottom="true">
<canlendar @finish="chosenDateResult"></canlendar>
</u-popup>
</div>
</template>
<script>
import AddressParse from '../address/zh-address-parse.min.js'
import amap from './components/amap-wx.js'
import canlendar from './components/time/index.vue'
export default {
components: {
canlendar
},
data() {
return {
showTimePopup:false,
info: {},
contentHeight: 0,
navs:[{Name:'司导专车'},{Name:'景区专车'}],
......@@ -231,12 +264,20 @@
StartCityName:'',
ArriveCityName:'',
Q_Date:'',
returnId:1,//暂定1位单程 2为往返
F_Date:'',//返程时间
day:1,//间歇几天
},
cardate:'',
startDate:'',
showcardate:'',
showweek:''
showweek:'',
showcardate2:'',
showweek2:'',
showcardate3:'',
showweek3:'',
qDate:'',
fDate:'',
}
},
created() {
......@@ -279,6 +320,7 @@
this.intervalDay = '半天'
}
}
//获取景区专车的 单程的出发时间
let carDate = new Date();
let carMonth = (carDate.getMonth() + 1)<10?'0'+(carDate.getMonth() + 1):(carDate.getMonth() + 1);
let carDays = (carDate.getDate() )<10?'0'+(carDate.getDate() ):(carDate.getDate());
......@@ -287,6 +329,17 @@
this.startDate = carDate.getFullYear() +'-'+carMonth+'-'+carDays;//从啥时候开始
this.showcardate = carMonth+'-'+carDays;
this.showweek = this.getweek(carday) //得到定制专车的周几
//获取景区专车的 往返情况下的 出发和到达时间
this.qDate = carDate.getFullYear() +'-'+carMonth+'-'+carDays;
this.showcardate2 = carMonth+'-'+carDays//定制专车的返程出发时间
this.showweek2 = this.getweek(carday) //定制专车的返程出发周几
let qcarMonth = (myDate.getMonth() + 1)<10?'0'+(myDate.getMonth() + 1):(myDate.getMonth() + 1);
let fcarDays = (myDate.getDate() )<10?'0'+(myDate.getDate() ):(myDate.getDate());
let fcarday = myDate.getDay();
this.fDate = myDate.getFullYear() +'-'+qcarMonth+'-'+fcarDays;
this.showcardate3 = qcarMonth+'-'+fcarDays//定制专车的返程返程时间
this.showweek3 = this.getweek(fcarday) //定制专车的返程 返程周几
},
onLoad(options) {
......@@ -308,6 +361,15 @@
}
},
methods: {
//获取明天的日期
getDefaultDate() {
var dd = new Date();
dd.setDate(dd.getDate() + AddDayCount); //获取AddDayCount天后的日期
var year = dd.getFullYear();
var mon = dd.getMonth() + 1; //获取当前月份的日期
var day = dd.getDate();
return year + '-' + mon + '-' + day;
},
godingche(){//跳入订车页面
if(this.carMsg.StartCityName==''){
uni.showToast({
......@@ -323,8 +385,19 @@
})
return
}
if(this.carMsg.returnId == 2){
if(this.qDate=='' || this.fDate == ''){
uni.showToast({
title:'请选择往返时间',
icon:'none'
})
return
}
this.carMsg.Q_Date = this.qDate;
this.carMsg.F_Date = this.fDate;
}
//对象编码
console.log(this.carMsg)
let obj = encodeURIComponent(JSON.stringify(this.carMsg))
uni.navigateTo({
url: '/pages/guidecar/bookaCarList?carMsg='+obj
......@@ -354,6 +427,7 @@
url: '/pages/guidecar/pickcarcity2?type='+type
})
}else{
if(this.carMsg.StartCityName==''){
uni.showToast({
title:'请先选择出发地',
......@@ -371,7 +445,7 @@
bindDateChange(e){
let value = e.detail.value;
console.log(value)
let carDate = new Date(value);
if(carDate>=(new Date())){
this.carMsg.Q_Date = value;
......@@ -385,8 +459,17 @@
icon:'none'
})
}
},
chosenDateResult(obj) {//往返的日期
this.qDate = obj.start;
this.carMsg.day = obj.day;
this.fDate = obj.end;
this.showcardate2 = obj.startDay;
this.showweek2 = obj.startWeek
this.showcardate3 = obj.endDay;
this.showweek3 = obj.endWeek
this.showTimePopup = false
},
changeHandler2(e){
this.active = e
......@@ -870,6 +953,38 @@
color: #FFF;
margin-bottom: 20px;
}
.guidecar .dingzhitop{
width: 100%;
height: 58px;
display: flex;
align-items: center;
justify-content: space-between;
border-bottom: 1px solid #E2E2E2;
}
.guidecar .dingzhitop_r{
display: flex;
align-items: center;
}
.guidecar .dingzhitop_r_item{
width: 50px;
height: 28px;
font-size: 12px;
border-radius: 5px;
background: #FFFFFF;
display: flex;
align-items: center;
justify-content: center;
}
.guidecar .weixuan{
border: 1px solid #888888;
color: #888888;
}
.guidecar .xuanzhong{
border: 1px solid #111111;
color: #111111;
font-weight: 500;
}
</style>
This diff is collapsed.
......@@ -138,9 +138,9 @@
</style>
<template>
<view class="specialCarReserve">
<view class="box-top">
<view class="box-top" v-if="addMsg.BackPlanId==0">
<div class='onetext'>
{{details.StartCityName}}
{{GoModel.StartCityName}}
</div>
<view class="box-top-c">
<view class="box-top-ct">
......@@ -149,9 +149,48 @@
<image src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/sanjiao.png" mode="aspectFill" style="width: 55px;height: 4px;"></image>
</view>
<div class='onetext'>
{{details.ArriveCityName}}
{{GoModel.ArriveCityName}}
</div>
</view>
<view class="box-top" style="height: 130px;" v-if="addMsg.BackPlanId>0">
<div class='onetext'>
{{GoModel.StartCityName}}
</div>
<view class="box-top-c">
<view class="box-top-ct">
{{showtime}}
</view>
<image src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/CustomizedCar/zhuanghuan.png" mode="aspectFill" style="width: 20px;height: 20px;margin: 2px 0;"></image>
<view class="box-top-ct" style="margin-bottom: 0;margin-top: 4px;">
{{backtime}}
</view>
</view>
<div class='onetext'>
{{GoModel.ArriveCityName}}
</div>
</view>
<view class="addresStyle" style="padding: 0 15px;height: 40px;">
<image src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/CustomizedCar/gocar.png" mode="aspectFill" style="width: 20px;height: 20px;"></image>
<span>去程</span>
</view>
<view class="addresStyle">
<view class="address-l-h"></view>
<view class="addresStyle-text" @click="shijiup(1)">
<span v-if="addMsg.DepartAddress==''">请选择实际上车点</span>
<span v-else style='color: #111;'>{{addMsg.DepartAddress}}</span>
</view>
</view>
<view class="addresStyle">
<view class="address-l-h2"></view>
<view class="addresStyle-text" @click="shijiup(2)">
<span v-if="addMsg.ArriveAddress==''">请选择实际下车点</span>
<span v-else style='color: #111;'>{{addMsg.ArriveAddress}}</span>
</view>
</view>
<view class="addresStyle" style="padding: 0 15px;height: 40px;">
<image src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/CustomizedCar/returncar.png" mode="aspectFill" style="width: 20px;height: 20px;"></image>
<span>返程</span>
</view>
<view class="addresStyle">
<view class="address-l-h"></view>
<view class="addresStyle-text" @click="shijiup(1)">
......@@ -245,7 +284,8 @@
return{
pageTitle: "订单填写",
mainColor: '',
details:{},
GoModel:{},
BackModel:{},
showtime:'',
addMsg:{
PlanId:0,
......@@ -260,20 +300,41 @@
BuyerMessage:'',
Consignee:'',
ConsigneeMobile:'',
BackPlanId:0,
BackDate:'',
BackDepartureTime:'',
BackDepartAddress:'',
BackArriveAddress:'',
},
upcar:[],
downcar:[],
Backupcar:[],
Backdowncar:[],
upid:0,
downid:0,
orderInfo:{},
showtime2:'',
backtime:'',
backtime2:'',
}
},
onLoad(options) {
if(options && options.Id){
this.addMsg.PlanId = options.Id;
if(options && options.BackPlanId && options.BackDate){
this.addMsg.BackPlanId = options.BackPlanId;
this.addMsg.BackDate = options.BackDate;
var time = new Date(options.BackDate);
let showweek = time.getDay()
let week = this.getweek(showweek)
this.backtime = options.BackDate.split('-')[1] + '月' + options.BackDate.split('-')[2] + '日'+' '+week;
this.backtime2 = options.BackDate.split('-')[1] + '月' + options.BackDate.split('-')[2] + '日'
}
this.getCarPlanInfo()//获取定制包车结算页面
}
if(options && options.Date){
this.addMsg.Date = options.Date;
var time = new Date(options.Date);
......@@ -297,7 +358,7 @@
}
let obj = {
type:type,//上车点
SiteList:this.details.SiteList,
SiteList:this.GoModel.SiteList,
SelectID:SelectID
}
obj = encodeURIComponent(JSON.stringify(obj))
......@@ -375,7 +436,7 @@
let that= this
uni.requestSubscribeMessage({
tmplIds: that.details.template_message_list,
tmplIds: that.GoModel.template_message_list,
complete(_res) {
console.log(_res)
uni.showLoading({
......@@ -401,7 +462,7 @@
},
queren(OrderId){
let url='/api/WeChatPay/GetDmcPayInfo'
let GoodsName = this.showtime2+this.details.StartCityName+'-'+this.details.ArriveCityName
let GoodsName = this.showtime2+this.GoModel.StartCityName+'-'+this.GoModel.ArriveCityName
GoodsName = GoodsName.slice(0, 10)
this.request2({
url: url,
......@@ -463,25 +524,38 @@
title: '加载中...'
})
this.request2({
url: '/api/AppletCar/GetAppletCarPlanSettlementInfo',
data: {PlanId:this.addMsg.PlanId}
url: '/api/AppletCar/GetAppletCarPlanSettlementInfo_V2',
data: {PlanId:this.addMsg.PlanId,BackPlanId:this.addMsg.BackPlanId}
},
res => {
uni.hideLoading()
if (res.resultCode == 1) {
this.details = res.data
this.addMsg.DepartureTime = this.details.StartDate;
this.addMsg.Unit_Price = (this.$utils.getretailer()==true ? this.details.Price :this.details.B2CPrice) ;
this.GoModel = res.data.GoModel
this.BackModel = res.data.BackModel
this.addMsg.DepartureTime = this.GoModel.StartDate;
this.addMsg.Unit_Price = (this.$utils.getretailer()==true ? this.GoModel.Price :this.GoModel.B2CPrice) ;
this.addMsg.BackDepartureTime = this.BackModel.StartDate?this.BackModel.StartDate:'';
// this.addMsg.Unit_Price = (this.$utils.getretailer()==true ? this.GoModel.Price :this.GoModel.B2CPrice) ;
this.upcar = [];
this.downcar = []
this.details.SiteList.forEach(x=>{
this.GoModel.SiteList.forEach(x=>{
if(x.Type == 1){
this.upcar.push(x)
}else{
this.downcar.push(x)
}
})
if(this.BackModel.SiteList && this.BackModel.SiteList.length >0 ){
this.BackModel.SiteList.forEach(x=>{
if(x.Type == 1){
this.Backupcar.push(x)
}else{
this.Backdowncar.push(x)
}
})
}
//出发点默认第一个
this.addMsg.DepartAddress = this.upcar[0].Name;
this.upid = this.upcar[0].Id;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment