This commit is contained in:
tx 2024-10-25 18:05:22 +08:00
parent 9e54529535
commit a87979d20f
7 changed files with 292 additions and 124 deletions

View File

@ -93,9 +93,12 @@
<view class="price">
日租<span>{{item.price}}</span>
</view>
<view class="btn" @click="" @click="toOrdder(storeInfo,item)">
<view class="btn" @click="" @click="toOrdder(storeInfo,item)" :style="{ background: item.rentalCar < 1 ? '#ccc' : ''}">
立即租
</view>
<!-- <view class="red1" :style="{ color: item.rentalCar < 1 ? '#ccc' : 'inherit', whiteSpace: 'nowrap' }">
<span>{{ item.rentalCar }}</span>
</view> -->
</view>
</view>
</view>
@ -196,10 +199,19 @@
},
methods: {
toOrdder(item,items){
console.log(items,'toOrdder');
uni.navigateTo({
url:'/page_user/ordder?storeId='+item.storeId+'&modelId='+items.modelId
})
if(items.rentalCar>0){
console.log(items,'toOrdder');
uni.navigateTo({
url:'/page_user/ordder?storeId='+item.storeId+'&modelId='+items.modelId
})
}else{
uni.showToast({
title: '改车型已没货,请查看其他车型',
icon: 'none',
duration: 2000
});
}
},
mapFun() {
console.log('点击了');

View File

@ -222,7 +222,7 @@
</view>
</view>
<view class="lines"></view>
<view class="car" v-if="item.models[1]">
<view class="car" v-if="item.models[1]" style="padding-left: 20rpx;">
<view class="imgs">
<image src="https://lxnapi.ccttiot.com/bike/img/static/ugqn6cdklXtHgERyLHMq"
mode=""></image>
@ -289,7 +289,7 @@
</view>
<view class="right">
日租 <span>{{item.price}}</span>
<view class="btn" @click="toOrdder(choseStore,item)">
<view class="btn" @click="toOrdder(choseStore,item)" :style="{ background: item.rentalCar < 1 ? '#ccc' : ''}">
立即租
</view>
</view>
@ -476,9 +476,19 @@
methods: {
toOrdder(item,items){
console.log(items,'toOrdder');
uni.navigateTo({
url:'/page_user/ordder?storeId='+item.storeId+'&modelId='+items.modelId
})
if(items.rentalCar>0){
console.log(items,'toOrdder');
uni.navigateTo({
url:'/page_user/ordder?storeId='+item.storeId+'&modelId='+items.modelId
})
}else{
uni.showToast({
title: '改车型已没货,请查看其他车型',
icon: 'none',
duration: 2000
});
}
},
toStore(item){
console.log(item,'itemitemitem');
@ -700,6 +710,7 @@
chooseData(item, index) {
this.dataInfo = item
this.dataIndex = index
this.showdata=false
},
closeData() {
this.showdata = false

View File

@ -35,7 +35,7 @@
<view class="delivery_right" :class="typeidx==1? 'rightact':''" @click="changeType(1)">
<view class="cont">
自行前往门店
<image src="https://lxnapi.ccttiot.com/bike/img/static/uH4UHjLW8QlIRyrroLpi" mode=""
<image src="https://lxnapi.ccttiot.com/bike/img/static/uH4UHjLW8QlIRyrroLpi" mode=""
v-if="typeidx==1"></image>
</view>
</view>
@ -118,7 +118,7 @@
</view>
<view class="txt"
style="width: 100%;display: flex;flex-wrap: nowrap;justify-content: space-between;">
2024年09月04日 16:00 <view
{{time}} <view
style="color:#808080 ;margin-left: 80rpx;font-size: 28rpx;display: flex;align-items: center;"
@click="time1=true">
更改时间 <image src="https://lxnapi.ccttiot.com/bike/img/static/uqQXXl6pKLlJDYAFrxFI"
@ -355,6 +355,7 @@
我知道了
</view>
</view>
<u-mask :show="showmx" :z-index='100' @click="showmx=false"/>
<view class="sub_box">
<view class="detail" v-if="showmx">
@ -472,62 +473,30 @@
}
console.log(e, 'eee');
},
onShow() {
// this.getToken()
let that = this
uni.getLocation({
type: 'gcj02',
success: function(lb) {
that.gps.latitude = lb.latitude;
that.gps.longitude = lb.longitude;
that.getKm()
},
fail: function(error) {
uni.showToast({
title: '未获取到定位信息,请点击设置勾选允许位置信息,即可使用全部功能',
icon: 'none',
duration: 2000
});
// that.getmarks()
//
}
})
this.$nextTick(() => {
const query = uni.createSelectorQuery().in(this);
query.select('.getcar').boundingClientRect(data => {
this.height = data.height + 45
console.log('ips_box height:', this.height);
}).exec();
}, 300);
this.calculateDistance(0);
this.getmodelInfo()
this.getstoreInfo()
const now = new Date();
const year = now.getFullYear();
const month = now.getMonth() + 1; // 01
const day = now.getDate();
//
let hour = now.getHours() + 1;
let nextDay = day;
let nextMonth = month;
// hour 23
if (hour >= 24) {
hour = 0;
nextDay += 1;
//
const daysInMonth = new Date(year, month, 0).getDate();
if (nextDay > daysInMonth) {
nextDay = 1;
nextMonth += 1;
// 12
if (nextMonth > 12) {
nextMonth = 1;
@ -543,6 +512,41 @@
`${year}${nextMonth < 10 ? '0' : ''}${nextMonth}${nextDay < 10 ? '0' : ''}${nextDay}${hour < 10 ? '0' : ''}${hour}:${minute < 10 ? '0' : ''}${minute}`;
// pickertime
this.pickertime = this.startDate;
let that = this
uni.getLocation({
type: 'gcj02',
success: function(lb) {
that.gps.latitude = lb.latitude;
that.gps.longitude = lb.longitude;
that.getKm()
},
fail: function(error) {
uni.showToast({
title: '未获取到定位信息,请点击设置勾选允许位置信息,即可使用全部功能',
icon: 'none',
duration: 2000
});
// that.getmarks()
//
}
})
this.$nextTick(() => {
const query = uni.createSelectorQuery().in(this);
query.select('.getcar').boundingClientRect(data => {
this.height = data.height + 45
console.log('ips_box height:', this.height);
}).exec();
}, 300);
},
onShow() {
// this.getToken()
console.log('startDate:', this.startDate);
console.log('time:', this.time);
@ -1153,7 +1157,7 @@
.sub_box {
position: fixed;
z-index: 110;
bottom: 0;
.detail {

View File

@ -1,8 +1,8 @@
<template>
<view class="page">
<view class="fixed">
<u-navbar :custom-back='back' title=" " :border-bottom="false" :background="background" title-color='#fff' title-size='36'
height='45' back-icon-color='#000'></u-navbar>
<u-navbar :custom-back='back' title=" " :border-bottom="false" :background="background" title-color='#fff'
title-size='36' height='45' back-icon-color='#000'></u-navbar>
</view>
<view class="backimg">
@ -13,7 +13,7 @@
<view class="tit" v-else>
{{typeReturn(orderInfo.status)}}
</view>
<view class="tips" v-if="orderInfo.isOverdue">
已超时请点击续租按钮进行续租
</view>
@ -59,6 +59,9 @@
<view class="type">
还车方式
</view>
<view class="txt" v-if="orderInfo.returnMethod==null">
请选择还车方式
</view>
<view class="txt" v-if="orderInfo.returnMethod==1">
自行前往门店还车
</view>
@ -66,14 +69,20 @@
上门取车
</view>
</view>
<view class="li" @click="handleClick" v-if="choosetype==2">
<view class="li" v-if="choosetype==2">
<view style="width: 130rpx;color: #3D3D3D;font-size: 28rpx;font-weight: 600;margin-left: 8rpx;">
取车地址
</view>
<input type="text" v-model="address" placeholder="请输入您的详细地址或点击右侧进行定位" class="input"
placeholder-style="color:#C7CDD3" @click="handleInputClick" />
<image src="https://lxnapi.ccttiot.com/bike/img/static/ubBrE0P90fPYvhvbdzHy" mode="">
placeholder-style="color:#C7CDD3" @click="handleInputClick" @input="cheekaddress()" />
<image src="https://lxnapi.ccttiot.com/bike/img/static/ubBrE0P90fPYvhvbdzHy" mode="" @click="getMapLocation">
</image>
</view>
<view class="li" style="align-items: center;justify-content: center;" @click="method2" v-if="choosetype==2">
<view class="txt" style="color: #0D75E5;">
保存并使用
</view>
</view>
<view class="info_box">
<view class="car_info">
@ -212,24 +221,24 @@
</view>
<view class="code_li" v-if='orderInfo.deliveryOrder'>
<view class="code">
配送状态 {{typeReturns(orderInfo.deliveryOrder.status).text}}
配送状态 {{typeReturns(orderInfo.deliveryOrder.status).text}}
</view>
</view>
<view class="code_li">
<view class="code">
配送人员 {{orderInfo.deliveryOrder.deliveryman?orderInfo.deliveryOrder.deliveryman:'--'}}
配送人员 {{orderInfo.deliveryOrder.deliveryman?orderInfo.deliveryOrder.deliveryman:'--'}}
</view>
</view>
<view class="code_li">
<view class="code">
联系电话 {{orderInfo.deliveryOrder.deliverymanPhone?orderInfo.deliveryOrder.deliverymanPhone:'--'}}
联系电话 {{orderInfo.deliveryOrder.deliverymanPhone?orderInfo.deliveryOrder.deliverymanPhone:'--'}}
</view>
</view>
</view>
<view class="bot_btn" >
<view class="bot_btn">
<view class="btn_li" v-if="orderInfo.status==0">
<view class="txt2" @click="orderCancel">
取消订单
@ -253,15 +262,18 @@
<view class="btn" @click="qecodelock()">
扫码用车
</view>
<!-- <view class="btn" style="background-color: #4297F3;">
<!-- <view class="btn" style="background-color: #4297F3;">
待送车
</view> -->
</view>
<view class="btn_li2" v-if="orderInfo.status==4">
<view class="btn3" @click="showBack=true" v-if="!orderInfo.returnMethod">
去还车
</view>
<view class="btn3" @click="getStoreList()" v-if="orderInfo.returnMethod==1">
去还车
</view>
<view class="btn3" @click="subback()" v-if="orderInfo.returnMethod==2">
<view class="btn3" v-if="orderInfo.returnMethod==2">
确认上门
</view>
<view class="btn3" @click="topage(0)">
@ -271,20 +283,22 @@
续租
</view>
</view>
<view class="btn_li3" v-if="orderInfo.status==8||orderInfo.status==5||orderInfo.status==6">
<view class="btn_li3"
v-if="orderInfo.status==8||orderInfo.status==5||orderInfo.status==6||orderInfo.status==7">
<view class="btn3" style="width: 1rpx;"></view>
<view class="btn5" @click="tosubOrder()">
重新下单
</view>
</view>
</view>
<u-mask :show="showaddress" :z-index='100' duration='0' />
<view class="address_box" v-if="showaddress">
<view class="close">
<image src="https://lxnapi.ccttiot.com/bike/img/static/uBhLz9V8ZDw6PfEfQHL9" mode="" @click="showaddress=false"></image>
<image src="https://lxnapi.ccttiot.com/bike/img/static/uBhLz9V8ZDw6PfEfQHL9" mode=""
@click="showaddress=false"></image>
</view>
<view class="tit5">
支持多店还车
@ -328,7 +342,7 @@
联系门店
</view>
<view class="store_btn" @click.stop="mapFuns(item)">
<image src="https://lxnapi.ccttiot.com/bike/img/static/uolYZ4dLvxxI2n2WzZ4J" mode="" >
<image src="https://lxnapi.ccttiot.com/bike/img/static/uolYZ4dLvxxI2n2WzZ4J" mode="">
</image>
导航到店
</view>
@ -339,7 +353,8 @@
确认还车
</view>
</view>
<u-mask :show="showsub" :z-index='100' duration='0' @click="closeSub()"/>
<u-mask :show="showsub" :z-index='100' duration='0' @click="closeSub()" />
<view class="sub_car" v-if="showsub">
<view class="tit3">
确认用车
@ -374,11 +389,18 @@
</view>
</view>
<u-select v-model="showList" :list="list" title='选择换车方式' @confirm="confirm"></u-select>
<u-mask :show="showBack" :z-index='100' duration='0' @click="showBack=false" />
<view class="backtip" v-if="showBack">
<image src="https://lxnapi.ccttiot.com/bike/img/static/ubcBvAyCGMtKxPyKgg9w" mode=""></image>
<view class="qsBtn" @click="showBack=false">
我知道了
</view>
</view>
</view>
</template>
<script>
let timerId;
export default {
data() {
return {
@ -411,7 +433,8 @@
deviceInfo: {},
storeList: [],
addchoose: -1,
chooseBackInfo: {}
chooseBackInfo: {},
showBack: false
}
},
@ -419,27 +442,29 @@
if (e.orderNo) {
this.orderNo = e.orderNo
}
const pages = getCurrentPages(); //
if (pages.length > 1) {
const previousPage = pages[pages.length - 2]; //
console.log('上一个页面路径:', previousPage.route); //
console.log('上一个页面参数:', previousPage.options); //
}
},
onShow() {
const pages = getCurrentPages(); //
if (pages.length > 1) {
const previousPage = pages[pages.length - 2]; //
console.log('上一个页面路径:', previousPage.route); //
console.log('上一个页面参数:', previousPage.options); //
}
this.getOrderInfo()
},
onShow() {
},
methods: {
closeSub(){
this.showsub=false
closeSub() {
this.showsub = false
},
typeReturns(num) {
console.log(num,'aaaaaaaaaaaa');
console.log(num, 'aaaaaaaaaaaa');
let result = {
text: '',
color: '#4297F3' //
};
if (num == 0) {
result.text = '待接单';
result.color = '#F14C4C'; //
@ -456,24 +481,24 @@
result.text = '已取消';
result.color = '#ccc'; //
}
return result;
},
back(){
back() {
uni.redirectTo({
url:'/pages/my'
url: '/pages/my'
})
},
callPhone(phone){
callPhone(phone) {
uni.makePhoneCall({
phoneNumber:phone
phoneNumber: phone
})
// setTimeout(()=>{
// this.showkf=false
// },500)
},
mapFuns(item){
mapFuns(item) {
console.log('点击了');
uni.openLocation({
latitude: item.lat,
@ -486,7 +511,7 @@
},
subBack() {
if (!this.chooseBackInfo.storeId) {
uni.showToast({
uni.showToast({
title: '请选择换车店铺',
icon: 'none',
duration: 1000
@ -502,8 +527,8 @@
type: 'gcj02',
success: (lb) => {
let data = {
returnType:this.orderInfo.returnMethod,
returnStoreId:this.chooseBackInfo.storeId,
returnType: this.orderInfo.returnMethod,
returnStoreId: this.chooseBackInfo.storeId,
orderNo: this.orderInfo.orderNo,
returnLon: lb.longitude,
returnLat: lb.latitude
@ -512,14 +537,14 @@
uni.hideLoading();
if (res.code == 200) {
uni.redirectTo({
url:'/pages/my'
url: '/pages/my'
})
} else {
uni.showToast({
title: res.msg,
icon: 'none',
duration: 2000
});
});
}
});
},
@ -549,11 +574,11 @@
topage(num) {
if (num == 0) {
uni.navigateTo({
url: '/pages_device/carInfo?sn='+this.orderInfo.sn
url: '/pages_device/carInfo?sn=' + this.orderInfo.sn
})
} else if (num == 1) {
uni.navigateTo({
url: '/page_user/renewCar?orderNo='+this.orderInfo.orderNo
url: '/page_user/renewCar?orderNo=' + this.orderInfo.orderNo
})
}
},
@ -667,15 +692,37 @@
handleClick() {
if (!this.address) {
this.getMapLocation();
// this.$u.get('app/getDeviceBySn?sn=' + this.sn).then((res) => {
// console.log(res, 'rererer');
// if (res.code === 200) {
// // console.log(this.areaId,);
// this.deviceInfo = res.data
// this.showsub = true
// } else {
// uni.showToast({
// title: res.msg,
// icon: 'none',
// duration: 2000
// });
// }
// })
}
},
handleInputClick(event) {
if (!this.address) {
// address
event.stopPropagation();
// event.stopPropagation();
this.getMapLocation();
}
},
// cheekaddress(){
// clearTimeout(timerId);
// // 500ms getmarks
// timerId = setTimeout(() => {
// if(this.address!='')
// }, 700);
// },
getMapLocation() {
uni.chooseLocation({
success: (res) => {
@ -750,19 +797,76 @@
}
});
},
confirm(e){
method2() {
if (!this.addlon) {
uni.showToast({
title: '请选择地址',
icon: 'none',
duration: 2000
});
return;
}
if (!this.address) {
uni.showToast({
title: '请输入地址',
icon: 'none',
duration: 2000
});
return;
}
let data = {
orderNo: this.orderInfo.orderNo,
returnMethod: 2,
returnLon: this.addlon,
returnLat: this.addlat,
returnAddress: this.address
}
this.$u.put('appVerify/returnAddress', data).then((res) => {
console.log(res, 'rererer');
if (res.code === 200) {
// console.log(this.areaId,);
this.getOrderInfo()
} else {
uni.showToast({
title: res.msg,
icon: 'none',
duration: 2000
});
}
})
},
method1() {
let data = {
orderNo: this.orderInfo.orderNo,
returnMethod: 1
}
this.$u.put('appVerify/returnAddress', data).then((res) => {
console.log(res, 'rererer');
if (res.code === 200) {
// console.log(this.areaId,);
this.getOrderInfo()
} else {
uni.showToast({
title: res.msg,
icon: 'none',
duration: 2000
});
}
})
},
confirm(e) {
console.log(e);
if(e.value==1){
this.orderInfo.returnMethod=1
this.choosetype=1
}else{
this.orderInfo.returnMethod=2
this.choosetype=2
if (e[0].value == 1) {
this.orderInfo.returnMethod = 1
this.choosetype = 1
this.method1()
} else {
this.orderInfo.returnMethod = 2
this.choosetype = 2
}
},
changeBack() {
this.showList=true
this.showList = true
},
subPay() {
if (this.paid) {
@ -903,7 +1007,7 @@
} else if (time == 'year') {
return '年'
}
},
typeReturn(num) {
if (num == 0) {
@ -920,7 +1024,7 @@
return '超时取消'
} else if (num == 6) {
return '已取消'
}else if (num == 7) {
} else if (num == 7) {
return '订单审核中'
} else if (num == 8) {
return '订单已结束'
@ -988,8 +1092,8 @@
}
});
},
backDedu(info) {
if (info == 0) {
return '免费取消'
@ -1072,6 +1176,37 @@
.page {
padding-bottom: 200rpx;
.backtip {
position: fixed;
top: 450rpx;
left: 110rpx;
z-index: 110;
width: 532rpx;
height: 580rpx;
image {
width: 532rpx;
height: 580rpx;
}
.qsBtn {
display: flex;
align-items: center;
justify-content: center;
position: absolute;
left: 118rpx;
bottom: 62rpx;
width: 292rpx;
height: 68rpx;
background: #4C97E7;
border-radius: 42rpx 42rpx 42rpx 42rpx;
font-weight: 500;
font-size: 32rpx;
color: #FFFFFF;
}
}
.address_box {
z-index: 110;
position: fixed;
@ -1434,8 +1569,8 @@
}
}
.tab_box {
width: 696rpx;
margin: 0 auto;
@ -1672,7 +1807,11 @@
padding: 20rpx 10rpx;
background: #FFFFFF;
border-radius: 20rpx 20rpx 20rpx 20rpx;
.txt{
font-weight: 500;
font-size: 36rpx;
color: #0D75E5;
}
.input {
width: 480rpx;
}

View File

@ -354,6 +354,7 @@
// index,index
// }
// uni.setStorageSync('data', item);
this.showdata=false
this.dataInfo = item
this.dataIndex = index
},

View File

@ -392,7 +392,7 @@
}
this.$u.post("/appCodeLogin", data).then((res) => {
this.$u.post("/app/appCodeLogin", data).then((res) => {
if (res.code == 200) {
//
wx.setStorageSync('token', res.token);
@ -451,7 +451,7 @@
return;
}
this.isCodeButtonDisabled = true;
this.$u.get("/appCaptcha?type=1&phone=" + this.phone).then((res) => {
this.$u.get("/app/appCaptcha?type=1&phone=" + this.phone).then((res) => {
if (res.code == 200) {
this.uuid = res.uuid
this.startCountdown();
@ -484,7 +484,7 @@
return;
}
this.isCodeButtonDisabled2 = true;
this.$u.get("/appCaptcha?type=1&phone=" + this.phone2).then((res) => {
this.$u.get("/app/appCaptcha?type=1&phone=" + this.phone2).then((res) => {
if (res.code == 200) {
this.uuid = res.uuid
this.startCountdown2();
@ -553,7 +553,7 @@
uuid: this.uuid,
openid:this.openCode
}
this.$u.post("/appCodeLogin", data).then((res) => {
this.$u.post("/app/appCodeLogin", data).then((res) => {
if (res.code == 200) {
//
wx.setStorageSync('token', res.token);

View File

@ -34,9 +34,9 @@
</view>
</view>
<view class="info_li">
<view class="txt" v-if="item.returnMethod==1">取车方式自行前往门店</view>
<view class="txt" v-if="item.returnMethod==2">取车方式自行前往门店</view>
<view class="txt" v-if="item.returnMethod==3">取车方式自行前往门店</view>
<view class="txt" v-if="item.deliveryMethod==1">取车方式自行前往门店</view>
<view class="txt" v-if="item.deliveryMethod==2">取车方式免费送车上门</view>
<view class="txt" v-if="item.deliveryMethod==3">取车方式收费送车上门</view>
</view>
<view class="info_li">
<view class="txt">还车时间{{item.expiryTime}}</view>
@ -48,7 +48,8 @@
</view>
<view class="info_li">
<view class="txt">用户地址福鼎市太姥山镇秦屿大道2号</view>
<view class="txt" v-if="item.deliveryMethod!=1||item.returnMethod==2" style="width: 80%;">用户地址{{item.pickupLoc}}</view>
<view class="txt" v-else > </view>
<view class="txt2">{{item.payFee}}</view>
</view>
<view class="line"></view>