Commit 83b6f712 authored by Mac's avatar Mac

1

parent cc673b29
......@@ -311,6 +311,8 @@
"style": {
"navigationStyle": "custom"
}
},{
"path":"pickcarcity"
}]
},
{
......
......@@ -21,19 +21,20 @@
<view class="content">
<view class="content_box">
<view class="c_row">
<view class="topB" v-if="info.IsShowCity==1">
<view class="topB" v-if="info.IsShowCity==1" @click="gocity">
<span class='titext'>取车城市</span>
<view style="display: flex;flex-direction: row;align-items: center;">
<span class='ztext'>成都</span><u-icon name="arrow-down" size="28" color="#C8C8C8"></u-icon>
</view>
</view>
<view class="topB" style="width: 150px;align-items: flex-start;" v-if="info.IsShowAddress==1">
<view class="topB" style="width: 150px;align-items: flex-start;" v-if="info.IsShowAddress==1" @click="openmap">
<span class='titext'>接送位置</span>
<span class='ztext' style='width: 100%;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;'>锦江区阳光新业2号楼是卡萨还打算打算的</span>
<span class='ztext' style='width: 100%;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;' v-if="address!=''">{{address}}</span>
<span class='ztext' style='color: #E2E2E2;' v-if="address==''">请选择</span>
</view>
<view class="topB" v-if="info.IsShowCarpooling==1">
<view class="topB" v-if="info.IsShowCarpooling==1&& msg.CarType==5" style="align-items: center;">
<span class='titext'>是否拼车</span>
<u-switch v-model="checked" size='30'></u-switch>
<u-switch v-model="iscarpool" size='30'></u-switch>
</view>
</view>
<view class="c_row">
......@@ -49,24 +50,24 @@
<span class='ztext' :style="{'color':msg.CarClass==''?'#E2E2E2':'#1C1E1F'}">{{carName}}</span><u-icon name="arrow-down" size="28" color="#C8C8C8"></u-icon>
</view>
</view>
<view class="topB" v-if="info.IsShowTravelGuestNum==1">
<view class="topB" v-if="info.IsShowTravelGuestNum==1" style="align-items: center;">
<span class='titext'>出行人数</span>
<input class="uni-input" v-model="msg.number" style="width: 50px;text-align: center;"/>
<input class="uni-input" v-model="msg.RideNum" style="width: 50px;text-align: center;"/>
</view>
</view>
<view class="c_row" v-if="info.IsShowDate==1">
<view class="topB">
<span class='ztext'>09月01</span>
<span class='titext'>周二 20:30</span>
<view class="topB" @click="showStart=true,timeType=1,defaultTime = msg.StartTime">
<span class='ztext'>{{STime.month}}{{STime.day}}</span>
<span class='titext'>{{STime.week+' '+STime.hour+':'+STime.minute}}</span>
</view>
<view class="topB" style="height: 20px;">
<span style='font-size: 11px;color: #1C1E1F;'>2tian</span>
<view class="topB" style="height: 20px;align-items: center;">
<span style='font-size: 11px;color: #1C1E1F;'>{{intervalDay}}</span>
<image src="../../static/images/sanjiao.png" mode="aspectFill" style="width: 55px;height: 4px;"></image>
</view>
<view class="topB">
<span class='ztext'>09月01</span>
<span class='titext'>周二 20:30</span>
<view class="topB" @click="showStart=true,timeType=2,defaultTime = msg.EndTime">
<span class='ztext'>{{ETime.month}}{{ETime.day}}</span>
<span class='titext'>{{ETime.week+' '+ETime.hour+':'+ETime.minute}}</span>
</view>
</view>
<view class="c_row_t">
......@@ -91,7 +92,7 @@
</view>
<scroll-view
:scroll-y="true"
style="height: 420px;">
style="max-height: 420px;">
<view class="txtype">
<view class="typeitem" v-for="(item, index) in classList" :key="index" >
<Text>{{item.Name}}</Text>
......@@ -111,6 +112,39 @@
</view>
</u-popup>
<u-popup v-model="show2"
mode="bottom"
border-radius="16"
>
<view class="popupBox">
<view class="popup_top">
<view></view>
<Text>出行类型</Text>
<u-icon name="cross" color='#9F9F9F' @click='show=false' size="40"></u-icon>
</view>
<scroll-view
:scroll-y="true"
style="max-height: 420px;">
<view class="txtype">
<view class="typeitem" v-for="(item, index) in EnumList" :key="index" >
<Text>{{item.Name}}</Text>
<u-radio-group v-model="value">
<u-radio
v-model = 'item.checked'
active-color="#EE4454"
shape="circle"
:name="item.Name"
@change="radioChange2(item)"
>
</u-radio>
</u-radio-group>
</view>
</view>
</scroll-view>
</view>
</u-popup>
<u-picker v-model="showStart" mode="time" :params="params" @confirm='btnStart' :default-time='defaultTime'></u-picker>
</div>
</template>
......@@ -125,7 +159,7 @@
scrollTop:0,
headStyle:{},
nav:0,
checked:true,
iscarpool:false,
classList:[],
EnumList:[],
EnumName:'请选择',
......@@ -133,6 +167,12 @@
show2:false,
carName:"请选择",
value:'',
defaultTime:'',
showStart:false,
STime:{},//显示的出行时间
ETime:{},//显示的结束时间
intervalDay:'',//间隔天数
address:'',//详情地址
msg:{
StartTime:'',//取车时间
EndTime:'',//还车时间
......@@ -142,7 +182,15 @@
RideNum:0,//出行人数
CarClass:'',//车辆类型
RegionIds:'',//地区(省市区:1,2,3)
}
},
params: {//时间的配置
year: true,
month: true,
day: true,
hour: true,
minute: true,
},
}
},
created() {
......@@ -150,7 +198,21 @@
this.mainColor = this.$uiConfig.mainColor;
this.nav = uni.getMenuButtonBoundingClientRect().top;
this.headStyle.paddingTop = this.nav +'px';
let myDate = new Date();
myDate=myDate.setDate(myDate.getDate()+1);
myDate=new Date(myDate);
let obj = {}
obj.year = myDate.getFullYear(); //年
obj.month = myDate.getMonth() + 1; //月
obj.day = myDate.getDate(); //日
obj.hour = myDate.getHours(); //时
obj.minute = myDate.getMinutes(); //分
let days = myDate.getDay();
obj.week = this.getweek(days)//星期几
this.STime = obj;
this.ETime = obj;
this.msg.StartTime = obj.year+'-'+obj.month+'-'+obj.day+' '+obj.hour+':'+obj.minute+':00';
this.msg.EndTime = obj.year+'-'+obj.month+'-'+obj.day+' '+obj.hour+':'+obj.minute+':00';
},
onLoad(options){
this.init()//获取司导首页配置
......@@ -203,12 +265,16 @@
}
);
},
radioChange(item){
console.log(item)
radioChange(item){//车辆类型
this.carName = item.Name;
this.msg.CarClass = item.Id;
this.show=false
},
radioChange2(item){//出行类型
this.EnumName = item.Name;
this.msg.CarType = item.Id;
this.show2=false
},
scrollHandler(e) {
this.scrollTop = e.detail.scrollTop;
//this.$forceUpdate();
......@@ -220,8 +286,86 @@
uni.navigateBack({
delta: 1,
});
},
btnStart(val){
if(this.timeType ==1){//出行时间的选择
this.msg.StartTime = val.year+'-'+val.month+'-'+val.day+' '+val.hour+':'+val.minute+':00';
this.STime = val
let myDate = new Date(this.msg.StartTime);
let days = myDate.getDay();
this.STime.week = this.getweek(days)
}else{//结束时间的选择
this.msg.EndTime = val.year+'-'+val.month+'-'+val.day+' '+val.hour+':'+val.minute+':00';
this.ETime = val
let myDate = new Date(this.msg.EndTime);
let days = myDate.getDay();
this.ETime.week = this.getweek(days)
}
let startTime = new Date(this.msg.StartTime); // 开始时间
let endTime = new Date(this.msg.EndTime); // 结束时间
if(startTime.getTime()>endTime.getTime()){//如果开始时间大于结束时间吧结束时间赋值和开始时间一样
this.msg.EndTime= val.year+'-'+val.month+'-'+val.day+' '+val.hour+':'+val.minute+':00';
this.ETime = val
let myDate = new Date(this.msg.EndTime);
let days = myDate.getDay();
this.ETime.week = this.getweek(days)
this.intervalDay =''
}else{
let usedTime = endTime - startTime; // 相差的毫秒数
let days = Math.floor(usedTime / (24 * 3600 * 1000)); // 计算出天数
let leavel = usedTime % (24 * 3600 * 1000); // 计算天数后剩余的时间
let hours = Math.floor(leavel / (3600 * 1000)); // 计算剩余的小时数
if(days>0){
if(leavel>0){
this.intervalDay=days+1+'天'
}else{
this.intervalDay=days+'天'
}
}else{
if(hours>=6){
this.intervalDay='1天'
}else{
this.intervalDay='半天'
}
}
}
},
getweek(day){//根据值返回当前时间的星期几
if(day==1){
return '星期一'
}else if(day==2){
return '星期二'
}else if(day==3){
return '星期三'
}else if(day==4){
return '星期四'
}else if(day==5){
return '星期五'
}else if(day==6){
return '星期六'
}else if(day==0){
return '星期日'
}
},
openmap(){//打开地图选择详情地址
let that = this
uni.chooseLocation({
success: function (res) {
console.log(res)
that.address = res.address
}
});
},
gocity(){
uni.navigateTo({
url:'/pages/guidecar/pickcarcity'
})
},
}
}
</script>
......@@ -294,7 +438,7 @@
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
padding: 15px 0;
}
.guidecar .topB{
......@@ -302,7 +446,7 @@
flex-direction: column;
height: 45px;
justify-content: space-between;
align-items: center;
/* align-items: center; */
}
.guidecar .titext{
font-size: 22rpx;
......
<template>
<view class="pickcarcity" :style="{'height':contentHeight}">
<view class="qcity">
<view class="ctrl-box">
<u-search
action-text="搜索"
:focus="true"
:clearabled="true"
:show-action="true"
radius="40"
v-model="searchKey"
@search="searchHandler"
@custom="searchHandler"
@change="changeHandler"
></u-search>
</view>
<view class="kaitong">
<div style='width: 100%;'><span style='color: #9A9A9A;font-size: 12px;'>已开通城市</span></div>
<view v-for="(item, index) in RegionList" :key="index" class="region" @click="goback(item)">
{{item.RegionName}}
</view>
</view>
<template>
<u-index-list :scrollTop="scrollTop">
<view v-for="(item, index) in indexList" :key="index">
<u-index-anchor :index="item.ti" />
<view class="list-cell" v-for="(x,y) in item.children" :key='y' @click="goback(x)">
{{x.Name}}
</view>
</view>
</u-index-list>
</template>
</view>
</view>
</template>
<script>
export default {
data() {
return {
pageTitle: "取车城市",
scrollTop:0,
contentHeight:0,
mainColor:'',
secondary:'',
RegionList:[],
cityList:[],
searchKey: "",
indexList: [{ti:"A"}, {ti:"B"}, {ti:"C"}, {ti:"D"}, {ti:"E"}, {ti:"F"}, {ti:"G"},{ ti:"H"}, {ti:"I"}, {ti:"J"}, {ti:"K"}, {ti:"L"},
{ti:"M"}, {ti:"N"}, {ti:"O"}, {ti:"P"},{ ti:"Q"}, {ti:"R"}, {ti:"S"}, {ti:"T"}, {ti:"U"},
{ti:"V"}, {ti:"W"}, {ti:"X"}, {ti:"Y"}, {ti:"Z"}
]
}
},
onLoad(option){
},
created(){
this.contentHeight = this.$utils.calcContentHeight(-40)+'px';
this.mainColor = this.$uiConfig.mainColor;
this.secondary = this.$uiConfig.secondary;
this.init()//城市列表
this.getSiteRegionList()
},
mounted() {
uni.setNavigationBarTitle({
title: this.pageTitle,
});
},
methods: {
init(){
uni.showLoading({
title: "加载中",
});
this.request2(
{
url: '/api/AppletGuideCar/GetAllList',
data: {}
},
(res) => {
this.cityList = res.data;
this.indexList.forEach(x=>{
x.children=[];
this.cityList.forEach(j=>{
let obj={}
if(x.ti==j.PinYin.substr(0,1)){
x.children.push(j)
}
})
})
uni.hideLoading();
}
);
},
getSiteRegionList(){
this.request2(
{
url: '/api/AppletGuideCar/GetSiteRegionList',
data: {}
},
(res) => {
this.RegionList = res.data
}
);
},
onPageScroll(e) {
this.scrollTop = e.scrollTop;
},
goback(item){
console.log(item)
},
searchHandler(val){
console.log(val)
},
changeHandler(val) {
},
}
}
</script>
<style>
.pickcarcity{
background: #FFFFFF;
}
.pickcarcity .qcity{
}
.pickcarcity .list-cell {
display: flex;
box-sizing: border-box;
width: 100%;
padding: 10px 24rpx;
overflow: hidden;
color: #323233;
font-size: 14px;
line-height: 24px;
background-color: #fff;
}
.pickcarcity .anchor-text {
color: red;
}
.pickcarcity .kaitong{
width: 100%;
padding: 15px;
background: #FAF8F9;
display: flex;
flex-direction: row;
align-items: center;
flex-wrap: wrap;
}
.pickcarcity .region{
width: 200rpx;
height: 68rpx;
background: #fff;
display: flex;
align-items: center;
justify-content: center;
margin-right: 30rpx;
margin-top: 30rpx;
}
.pickcarcity .ctrl-box {
padding: 5px 10px;
}
</style>
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