Commit e435c02e authored by Mac's avatar Mac

司导日历

parent 8e2d5bff
...@@ -325,6 +325,8 @@ ...@@ -325,6 +325,8 @@
"path":"guidedetails" "path":"guidedetails"
},{ },{
"path":"place_order" "path":"place_order"
},{
"path":"rili"
}] }]
}, },
{ {
......
This diff is collapsed.
...@@ -3,14 +3,14 @@ ...@@ -3,14 +3,14 @@
<view class="guide" v-if='type==1'> <view class="guide" v-if='type==1'>
<view class="guide-top"> <view class="guide-top">
<image :src="g.guide_photo" style="width: 60px; height: 60px;margin-right: 10px" mode="widthFix"></image> <image :src="guideModel.GuidePhoto" style="width: 60px; height: 60px;margin-right: 10px" mode="widthFix"></image>
<view class="column" style="height: 36px;justify-content: space-between;"> <view class="column" style="height: 36px;justify-content: space-between;">
<view class="row"> <view class="row">
<span>{{g.guide_name}}</span> <span>{{guideModel.Name}}</span>
</view> </view>
<view class="row"> <view class="row">
<u-rate <u-rate
:current="g.guide_score" :current="guideModel.Score"
active-color="#FF8C10" active-color="#FF8C10"
inactive-color="#b2b2b2" inactive-color="#b2b2b2"
active-icon="star" active-icon="star"
...@@ -25,16 +25,20 @@ ...@@ -25,16 +25,20 @@
<view class="guide-info"> <view class="guide-info">
<view class="guide-info-item"> <view class="guide-info-item">
<span class='info-text'>工龄:</span> <span class='info-text'>工龄:</span>
<span>{{g.guide_workyears}}</span> <span>{{guideModel.WorkYears}}</span>
</view> </view>
<!-- <view class="guide-info-item"> <view class="guide-info-item">
<span class='info-text'>电话:</span>
<span>{{guideModel.Telephone}}</span>
</view>
<view class="guide-info-item">
<span class='info-text'>服务人数:</span> <span class='info-text'>服务人数:</span>
<span>{{g.guide_workyears}}</span> <span>{{guideModel.OrderGuestNum}}</span>
</view> </view>
<view class="guide-info-item"> <view class="guide-info-item">
<span class='info-text'>出单:</span> <span class='info-text'>出单:</span>
<span>{{g.guide_workyears}}</span> <span>{{guideModel.OrderNum}}</span>
</view> --> </view>
</view> </view>
<view class="guide-info"> <view class="guide-info">
<view class="guide-info-item"> <view class="guide-info-item">
...@@ -66,11 +70,11 @@ ...@@ -66,11 +70,11 @@
</swiper> </swiper>
</view> </view>
<view style="margin-top: 15px ;font-size: 16px;" > <view style="margin-top: 15px ;font-size: 16px;" >
{{g.car_model!=''?g.car_model:'无'}} {{carModel.CarBrand!=''?carModel.CarBrand:'无'}}
</view> </view>
<view style="margin-top: 5px;" > <view style="margin-top: 5px;" >
<u-rate <u-rate
:current="g.car_score" :current="carModel.Score"
active-color="#FF8C10" active-color="#FF8C10"
inactive-color="#b2b2b2" inactive-color="#b2b2b2"
active-icon="star" active-icon="star"
...@@ -83,19 +87,19 @@ ...@@ -83,19 +87,19 @@
<view class="guide-info"> <view class="guide-info">
<view class="guide-info-item"> <view class="guide-info-item">
<span class='info-text'>购买年限:</span> <span class='info-text'>购买年限:</span>
<span>{{g.car_buyyear}}</span> <span>{{carModel.car_buyyear}}</span>
</view> </view>
<view class="guide-info-item"> <view class="guide-info-item">
<span class='info-text'>颜色:</span> <span class='info-text'>颜色:</span>
<span>{{g.carcolor_name}}</span> <span>{{carModel.carcolor_name}}</span>
</view> </view>
<view class="guide-info-item"> <view class="guide-info-item">
<span class='info-text'>座位数:</span> <span class='info-text'>座位数:</span>
<span>{{g.ride_num}}</span> <span>{{carModel.GuestNum}}</span>
</view> </view>
<view class="guide-info-item"> <view class="guide-info-item">
<span class='info-text'>分类:</span> <span class='info-text'>分类:</span>
<span>{{g.guide_workyears}}</span> <span>{{carModel.CarClassStr}}</span>
</view> </view>
</view> </view>
</view> </view>
...@@ -120,7 +124,9 @@ export default { ...@@ -120,7 +124,9 @@ export default {
type:1,//1为 type:1,//1为
g:{}, g:{},
detailContent:'', detailContent:'',
imgs:[] imgs:[],
carModel:{},
guideModel:{},
}; };
}, },
...@@ -135,19 +141,18 @@ export default { ...@@ -135,19 +141,18 @@ export default {
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
title: '导游详情', title: '导游详情',
}); });
this.getGuideCarGuideModel()
}else{ }else{
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
title: '车辆详情', title: '车辆详情',
}); });
this.getGuideCarModel()
} }
} }
this.g.pic_url.forEach((x) => { this.g.pic_url.forEach((x) => {
this.imgs.push(x.pic_url); this.imgs.push(x.pic_url);
}); });
let richtext = this.g.guide_introduction;
setTimeout(()=>{
this.detailContent = richtext;
},10)
...@@ -163,7 +168,41 @@ export default { ...@@ -163,7 +168,41 @@ export default {
}, },
methods: { methods: {
getGuideCarGuideModel(){//根据导游id获取导游信息
this.request2(
{
url: '/api/AppletGuideCar/GetGuideCarGuideModel',
data: {
ID:this.g.guide_id,
}
},
(res) => {
this.guideModel = res.data;
let richtext = this.guideModel.Introduction;
setTimeout(()=>{
this.detailContent = richtext;
},10)
console.log(this.guideModel)
}
);
},
getGuideCarModel(){
this.request2(
{
url: '/api/AppletGuideCar/GetGuideCarModel',
data: {
ID:this.g.car_id,
}
},
(res) => {
this.carModel = res.data;
console.log(this.guideModel)
}
);
},
clickDescription(e) { clickDescription(e) {
console.log(e); console.log(e);
}, },
......
...@@ -203,7 +203,6 @@ ...@@ -203,7 +203,6 @@
day: true, day: true,
hour: true, hour: true,
minute: true, minute: true,
}, },
amapPlugin:null, amapPlugin:null,
key: 'c785085c46d1eb41b1ebe8d1ec7fd945', key: 'c785085c46d1eb41b1ebe8d1ec7fd945',
......
<template>
<view class="rili">
<div class='g_top'>
<view class="topB" @click="">
<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;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" @click="">
<span class='ztext'>{{ETime.month}}{{ETime.day}}</span>
<span class='titext'>{{ETime.week+' '+ETime.hour+':'+ETime.minute}}</span>
</view>
</div>
<view>
<z-calendar ref="calendar"
:datePrice="datePrice"
howManyMonth="6"
mode="2"
@changeDate="changeDate"
@changeMonth="changeMonth"
:defaultSelect="defaultSelect"></z-calendar>
</view>
<view class="time">
<view class="time_item" @click="showStart=true,timeType=1,defaultTime = qutime">
<span>取车时间</span>
<span>{{qutime}}</span>
</view>
<view class="time_item" @click="showStart=true,timeType=2,defaultTime = stilltime">
<span>还车时间</span>
<span>{{stilltime}}</span>
</view>
</view>
<view class="btn" >确定</view>
<u-picker v-model="showStart" mode="time" :params="params" @confirm='btnStart' :default-time='defaultTime'></u-picker>
</view>
</template>
<script>
import zCalendar from "./components/njzz-calendar/njzz-calendar.vue"
export default {
components:{zCalendar},
data() {
return {
selectedData:{},
datePrice:[
],
STime:{},
ETime:{},
intervalDay:'',
defaultSelect:'',
qutime:'',
stilltime:'',
showStart:false,
defaultTime:'',//默认取、还车时间
params: {//时间的配置
hour: true,
minute: true,
},
};
},
mounted() {
let myDate = new Date();
let year = myDate.getFullYear(); //年
let month = myDate.getMonth() + 1; //月
let hour = myDate.getHours(); //时
let minute = myDate.getMinutes(); //分
if(month<10){
month = ('0' + month)
}
let Month = year+'-'+month
this.STime = this.getTime('2020-09-18 12:20',1)
this.ETime = this.getTime('2020-09-19 12:20',2)
let startTime = new Date('2020-09-18 12:20'); // 开始时间
let endTime = new Date('2020-09-19 12:20'); // 结束时间
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='半天'
}
}
this.getGoodsDateList(Month)
},
methods:{
changeDate(data){ //选择日期事件 可以将data绑定到此页面以用来提交等操作
console.log("日期:"+data);
this.selectedData = data;
this.STime = this.getTime(data+' '+this.qutime)
},
getTest(){
//上面那个是选择日期时自动绑定的方式,但默认赋值之后没有进行选择操作 如何拿到选中的值
//一般来说设置默认的值在此页面早就拿到了 但如果不想再次处理数据格式可以用以下方式获取组件已经处理好的数据 $refs或者$children请查看vue官方文档
console.log(this.$refs.calendar.getSelectData())
},
changeMonth(nowMonth){
let Month = nowMonth.year+'-'+nowMonth.month;
this.getGoodsDateList(Month)
},
getGoodsDateList(Month){
this.request2(
{
url: '/api/AppletGCOrder/GetAppletSDGoodsTargetDateList',
data: {
GoodsId:367468,
Month:Month
}
},
res => {
let data =res.data;
let datePrice=[];
data.forEach(x=>{
if(x.IsReserve==1 && x.SurplusNum>0){
let obj = {}
obj.date = x.Date;
obj.price = '剩'+x.SurplusNum+'座';
datePrice.push(obj)
}
})
this.datePrice = datePrice
}
);
},
btnStart(val){
console.log(val)
if(this.timeType==1){
this.qutime=val.hour+":"+val.minute
}
if(this.timeType==2){
this.stilltime=val.hour+":"+val.minute
}
},
getTime(time,type=0){
let myDate = new Date(time);
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)//星期几
if(type==1){
if(obj.month<10){
obj.month = ('0' + obj.month)
}
this.defaultSelect = obj.year+'-'+obj.month+'-'+obj.day;
this.qutime=obj.hour+':'+obj.minute//初始取车时间
}else if(type==2){
this.stilltime=obj.hour+':'+obj.minute//初始还车时间
}
return obj
},
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 '星期日'
}
},
}
}
</script>
<style>
.rili .time{
width: 100%;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-around;
margin-top: 20px;
}
.rili .time_item{
width: 50%;
display: flex;
flex-direction: column;
align-items: center;
}
.rili .btn{
width: 90%;
margin-left: 5% ;
height: 44px;
border-radius: 22px;
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
font-size: 16px;
margin-top: 30px;
color: #FFF;
background-image: linear-gradient(
to right,
#FF8585,
#EE4454
);
}
.rili .g_top{
width: 92%;
height: 45px;
border-radius: 22.5px;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-around;
padding: 0 20px;
margin-left: 4%;
margin-top: 10px;
margin-bottom: 10px;
}
.rili .topB{
display: flex;
flex-direction: column;
justify-content: space-between;
/* align-items: center; */
}
.rili .titext{
font-size: 22rpx;
color: #929292;
}
.rili .ztext{
font-size: 28rpx;
color: #1C1E1F;
}
</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