11
This commit is contained in:
parent
b9f702e309
commit
dee0b8868f
|
@ -1,16 +1,20 @@
|
|||
{ // launch.json 配置了启动调试时相关设置,configurations下节点名称可为 app-plus/h5/mp-weixin/mp-baidu/mp-alipay/mp-qq/mp-toutiao/mp-360/
|
||||
// launchtype项可配置值为local或remote, local代表前端连本地云函数,remote代表前端连云端云函数
|
||||
"version": "0.0",
|
||||
"configurations": [{
|
||||
"default" :
|
||||
{
|
||||
"launchtype" : "local"
|
||||
},
|
||||
"mp-weixin" :
|
||||
{
|
||||
"launchtype" : "local"
|
||||
},
|
||||
"type" : "uniCloud"
|
||||
}
|
||||
{
|
||||
// launch.json 配置了启动调试时相关设置,configurations下节点名称可为 app-plus/h5/mp-weixin/mp-baidu/mp-alipay/mp-qq/mp-toutiao/mp-360/
|
||||
// launchtype项可配置值为local或remote, local代表前端连本地云函数,remote代表前端连云端云函数
|
||||
"version" : "0.0",
|
||||
"configurations" : [
|
||||
{
|
||||
"default" : {
|
||||
"launchtype" : "local"
|
||||
},
|
||||
"mp-weixin" : {
|
||||
"launchtype" : "local"
|
||||
},
|
||||
"type" : "uniCloud"
|
||||
},
|
||||
{
|
||||
"openVueDevtools" : true,
|
||||
"type" : "uni-app:miniProgram"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
@ -54,7 +54,7 @@
|
|||
</view>
|
||||
</view>
|
||||
<view class="cardcont">
|
||||
<view v-for="(item,index) in orderList" :key="index" style="display: flex;flex-wrap: wrap;">
|
||||
<view v-for="(item,index) in orderList" :key="index" style="display: flex;flex-wrap: wrap;width: 100%;">
|
||||
<view class="cont_li" >
|
||||
<view class="cont_li_left">
|
||||
<view class="txt">
|
||||
|
@ -73,7 +73,7 @@
|
|||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="cont_li" v-if="item.etRefund!=null&&item.etRefund.refundResult=='SUEECSS'">
|
||||
<view class="cont_li" v-if="item.etRefund!=null&&item.etRefund.refundResult=='SUEECSS'" style="display: flex;flex-wrap: wrap;width: 100%;">
|
||||
<view class="cont_li_left">
|
||||
<view class="txt">
|
||||
押金提现
|
||||
|
@ -141,7 +141,7 @@
|
|||
// 执行其他操作...
|
||||
});
|
||||
this.getinfo()
|
||||
this.getlist()
|
||||
|
||||
},
|
||||
watch: {
|
||||
userId(newValue, oldValue) {
|
||||
|
@ -214,6 +214,7 @@
|
|||
if (res.code == 200) {
|
||||
this.$store.commit('SET_USERID', res.user.userId);
|
||||
this.userinfo = res.user
|
||||
this.getlist()
|
||||
} else {
|
||||
setTimeout(()=>{
|
||||
this.getinfo()
|
||||
|
|
|
@ -177,12 +177,12 @@
|
|||
可继续行驶53公里
|
||||
</view>
|
||||
<view class="speed">
|
||||
<view class="speeds">
|
||||
<view class="speeds" :style="{ width: OrderdeviceInfos.remainingPower + '%' }">
|
||||
|
||||
</view>
|
||||
</view>
|
||||
<view class="mac">
|
||||
NO.74001387
|
||||
NO.{{orderinfo.sn}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="right">
|
||||
|
@ -190,16 +190,29 @@
|
|||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="bot" style="margin-top: 20rpx;">
|
||||
<view class="bot" style="margin-top: 20rpx;" v-if="orderinfo.status==0">
|
||||
|
||||
|
||||
<view class="btn" style=" margin-right: 16rpx;">
|
||||
<view class="btn" style=" margin-right: 16rpx;" @click="unlockdevice()">
|
||||
解锁骑行
|
||||
</view>
|
||||
<view class="btn1" @click="cancel()" >
|
||||
取消预约
|
||||
</view>
|
||||
</view>
|
||||
<view class="bot" style="margin-top: 20rpx;" v-if="orderinfo.status==2">
|
||||
|
||||
|
||||
<view class="btn" style=" margin-right: 16rpx;" v-if="OrderdeviceInfos.status==3" @click="loackdevice()">
|
||||
临时锁车
|
||||
</view>
|
||||
<view class="btn" style=" margin-right: 16rpx;" v-if="OrderdeviceInfos.status==4" @click="unloackdevices()">
|
||||
解锁用车
|
||||
</view>
|
||||
<view class="btn1" @click="backDevice()" >
|
||||
还车
|
||||
</view>
|
||||
</view>
|
||||
<!-- <view class="bot" style="margin-top: 20rpx;">
|
||||
|
||||
<view class="btn1" >
|
||||
|
@ -214,15 +227,18 @@
|
|||
<view class="page4" v-if="deviceIndex==3">
|
||||
<view class="bot_btn" >
|
||||
<view class="time">
|
||||
骑行时间30分钟9秒
|
||||
使用时间:{{timeString}}
|
||||
</view>
|
||||
<view class="price">
|
||||
4.00<span>元</span>
|
||||
{{orderinfo.totalFee}}<span>元</span>
|
||||
</view>
|
||||
<view class="toinfo">
|
||||
查看骑行费明细 >
|
||||
</view>
|
||||
<view class="btn">
|
||||
<view class="btn" @click="topay()" v-if="orderinfo.status==1">
|
||||
去支付
|
||||
</view>
|
||||
<view class="btn" @click="topay1()" v-if="orderinfo.status==3">
|
||||
去支付
|
||||
</view>
|
||||
</view>
|
||||
|
@ -382,6 +398,7 @@
|
|||
areas: [],
|
||||
gps: {},
|
||||
deviceInfos: {},
|
||||
OrderdeviceInfos:{},
|
||||
showdevice: false,
|
||||
deviceIndex: 0,
|
||||
type: 0,
|
||||
|
@ -424,11 +441,7 @@
|
|||
}
|
||||
if(uni.getStorageSync('role')){
|
||||
let abb = uni.getStorageSync('role')
|
||||
if(abb==2){
|
||||
uni.navigateTo({
|
||||
url:'/page_fix/fix_index'
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
// this.eventKey = Math.floor(Math.random() * 100000);
|
||||
console.log(this.userId);
|
||||
|
@ -509,15 +522,74 @@
|
|||
}
|
||||
})
|
||||
},
|
||||
starTime() {
|
||||
backDevice(){
|
||||
this.$u.post('/appVerify/device/return?returnType=1&orderNo=' +this.orderinfo.orderNo ).then((res) => {
|
||||
if (res.code === 200) {
|
||||
this.getisInOrder()
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
icon: 'none',
|
||||
duration: 2000
|
||||
});
|
||||
}
|
||||
})
|
||||
},
|
||||
// 预约解锁骑行
|
||||
unlockdevice(){
|
||||
let data = {
|
||||
userId: this.userId,
|
||||
sn: this.orderinfo.sn,
|
||||
|
||||
// ruleId: this.freeInfo.ruleId,
|
||||
// money: this.freeInfo.fee,
|
||||
mark: "预约开锁",
|
||||
// type: '1',
|
||||
orderNo:this.orderinfo.orderNo
|
||||
|
||||
}
|
||||
this.$u.post('/appVerify/device/snSwitch', data).then((res) => {
|
||||
if (res.code === 200) {
|
||||
this.getisInOrder()
|
||||
} else {
|
||||
|
||||
}
|
||||
})
|
||||
},
|
||||
unloackdevices(){
|
||||
this.$u.post('/appVerify/device/unlock?sn='+this.OrderdeviceInfos.sn+'&orderNo='+this.orderinfo.orderNo).then((res) => {
|
||||
if (res.code === 200) {
|
||||
this.getisInOrder()
|
||||
} else {
|
||||
|
||||
}
|
||||
})
|
||||
},
|
||||
// ;临时锁车
|
||||
loackdevice(){
|
||||
this.$u.post('/appVerify/device/lock?sn='+this.OrderdeviceInfos.sn+'&orderNo='+this.orderinfo.orderNo).then((res) => {
|
||||
if (res.code === 200) {
|
||||
this.getisInOrder()
|
||||
} else {
|
||||
|
||||
}
|
||||
})
|
||||
},
|
||||
starTime() {
|
||||
clearInterval(this.timer)
|
||||
this.timer=null
|
||||
this.$u.get('/app/device/info?sn=' + this.orderinfo.sn).then((res) => {
|
||||
if (res.code === 200) {
|
||||
this.OrderdeviceInfos = res.data
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
|
||||
// 预约中
|
||||
if(this.orderinfo.status==0&&this.orderinfo.ruleId==null){
|
||||
this.showdevice = true
|
||||
this.deviceIndex=2
|
||||
const createTimeTimestamp = new Date(this.orderinfo.createTime).getTime();
|
||||
const createTimeTimestamp = new Date(this.orderinfo.appointmentStartTime).getTime();
|
||||
|
||||
// 定义定时器
|
||||
this.timer = setInterval(() => {
|
||||
|
@ -533,7 +605,7 @@
|
|||
const tenMinuteIntervals = Math.floor((hours * 60 + minutes) / 10)+1 ; // 加1是因为不满十分钟也算一个十分钟
|
||||
let money =0
|
||||
// 增加费用逻辑,假设每次增加10元
|
||||
this.money = this.appointmentServiceFee* tenMinuteIntervals;
|
||||
this.money = (this.appointmentServiceFee* tenMinuteIntervals )+this.startingPrice;
|
||||
// console.log("已经过去了:" + timeString);
|
||||
// console.log("增加了" +money+ "元费用");
|
||||
// 每隔十分钟增加费用
|
||||
|
@ -544,12 +616,13 @@
|
|||
// console.log("已经过去了:" + timeString);
|
||||
}, 1000);
|
||||
}else if(this.orderinfo.status==1&&this.orderinfo.ruleId==null){
|
||||
// 取消预约
|
||||
// this.topay()
|
||||
const createTimeTimestamp = new Date(this.orderinfo.createTime).getTime();
|
||||
const createTimeTimestamp = new Date(this.orderinfo.appointmentStartTime).getTime();
|
||||
|
||||
// 定义定时器
|
||||
|
||||
const currentTime = Date.now();
|
||||
const currentTime = new Date(this.orderinfo.appointmentEndTime).getTime();;
|
||||
const timePassed = currentTime - createTimeTimestamp;
|
||||
const secondsPassed = Math.floor(timePassed / 1000);
|
||||
|
||||
|
@ -559,13 +632,16 @@
|
|||
const seconds = secondsPassed % 60;
|
||||
const timeString = `${hours < 10 ? '0' : ''}${hours}:${minutes < 10 ? '0' : ''}${minutes}:${seconds < 10 ? '0' : ''}${seconds}`;
|
||||
const tenMinuteIntervals = Math.floor((hours * 60 + minutes) / 10)+1 ; // 加1是因为不满十分钟也算一个十分钟
|
||||
|
||||
let money =0
|
||||
// 增加费用逻辑,假设每次增加10元
|
||||
this.money = (this.appointmentServiceFee* tenMinuteIntervals )+this.startingPrice;
|
||||
this.timeString=timeString
|
||||
// console.log("已经过去了:" + timeString);
|
||||
|
||||
this.showdevice = true
|
||||
this.deviceIndex=3
|
||||
}else if(this.orderinfo.status==2&&this.orderinfo.ruleId==null){
|
||||
// 开始骑行
|
||||
// this.topay()
|
||||
this.showdevice = true
|
||||
this.deviceIndex=2
|
||||
|
@ -585,7 +661,7 @@
|
|||
const tenMinuteIntervals = Math.floor((hours * 60 + minutes) / 10)+1 ; // 加1是因为不满十分钟也算一个十分钟
|
||||
let money =0
|
||||
// 增加费用逻辑,假设每次增加10元
|
||||
this.money = this.appointmentServiceFee* tenMinuteIntervals;
|
||||
this.money = (this.appointmentServiceFee* tenMinuteIntervals )+this.startingPrice;
|
||||
// console.log("已经过去了:" + timeString);
|
||||
// console.log("增加了" +money+ "元费用");
|
||||
// 每隔十分钟增加费用
|
||||
|
@ -596,12 +672,13 @@
|
|||
// console.log("已经过去了:" + timeString);
|
||||
}, 1000);
|
||||
}else if(this.orderinfo.status==3&&this.orderinfo.ruleId==null){
|
||||
// 骑行结束
|
||||
// this.topay()
|
||||
const createTimeTimestamp = new Date(this.orderinfo.createTime).getTime();
|
||||
|
||||
// 定义定时器
|
||||
|
||||
const currentTime = Date.now();
|
||||
|
||||
// 定义定时器
|
||||
|
||||
const currentTime = Date.now();
|
||||
const timePassed = currentTime - createTimeTimestamp;
|
||||
const secondsPassed = Math.floor(timePassed / 1000);
|
||||
|
||||
|
@ -624,19 +701,21 @@
|
|||
// 将 createTime 转换为时间戳
|
||||
|
||||
},
|
||||
// 取消预约支付
|
||||
topay(){
|
||||
let data = {
|
||||
userId: this.userId,
|
||||
sn: this.sn,
|
||||
ruleId: this.freeInfo.ruleId,
|
||||
isAppointment:true,
|
||||
sn: this.orderinfo.sn,
|
||||
orderNo:this.orderinfo.orderNo,
|
||||
|
||||
// money: this.freeInfo.fee,
|
||||
mark: "预约购买套餐",
|
||||
type: '3'
|
||||
mark: "订单支付",
|
||||
type: '2'
|
||||
|
||||
|
||||
}
|
||||
console.log('点击了');
|
||||
let that =this
|
||||
this.$u.post('/appVerify/pre/order', data).then((res) => {
|
||||
if (res.code === 200) {
|
||||
// this.freList=res.rows
|
||||
|
@ -649,7 +728,55 @@
|
|||
paySign: res.data.paySign,
|
||||
success(res) {
|
||||
// 支付成功逻辑
|
||||
|
||||
that.getisInOrder()
|
||||
|
||||
},
|
||||
fail(err) {
|
||||
// 支付失败逻辑
|
||||
uni.showToast({
|
||||
title: '支付失败',
|
||||
icon: 'none',
|
||||
duration: 2000
|
||||
});
|
||||
}
|
||||
});
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
icon: 'none',
|
||||
duration: 2000
|
||||
});
|
||||
}
|
||||
})
|
||||
},
|
||||
// 骑行结束支付
|
||||
topay1(){
|
||||
let data = {
|
||||
userId: this.userId,
|
||||
sn: this.orderinfo.sn,
|
||||
orderNo:this.orderinfo.orderNo,
|
||||
|
||||
// money: this.freeInfo.fee,
|
||||
mark: "订单支付",
|
||||
type: '1'
|
||||
|
||||
|
||||
}
|
||||
console.log('点击了');
|
||||
let that =this
|
||||
this.$u.post('/appVerify/pre/order', data).then((res) => {
|
||||
if (res.code === 200) {
|
||||
// this.freList=res.rows
|
||||
uni.requestPayment({
|
||||
provider: 'wxpay',
|
||||
timeStamp: res.data.timeStamp,
|
||||
nonceStr: res.data.nonceStr,
|
||||
package: res.data.packageVal,
|
||||
signType: res.data.signType,
|
||||
paySign: res.data.paySign,
|
||||
success(res) {
|
||||
// 支付成功逻辑
|
||||
that.getisInOrder()
|
||||
|
||||
},
|
||||
fail(err) {
|
||||
|
@ -766,32 +893,7 @@
|
|||
}
|
||||
this.$u.post('/appVerify/device/snSwitch', data).then((res) => {
|
||||
if (res.code === 200) {
|
||||
// this.freList=res.rows
|
||||
// uni.requestPayment({
|
||||
// provider: 'wxpay',
|
||||
// timeStamp: res.data.timeStamp,
|
||||
// nonceStr: res.data.nonceStr,
|
||||
// package: res.data.packageVal,
|
||||
// signType: res.data.signType,
|
||||
// paySign: res.data.paySign,
|
||||
// success(res) {
|
||||
// // 支付成功逻辑
|
||||
// this.showdevice = false
|
||||
// this.deviceIndex = 0
|
||||
// this.mac = ''
|
||||
// this.type = 0
|
||||
// this.freeInfo = {}
|
||||
// this.freeListIndex = 0
|
||||
// },
|
||||
// fail(err) {
|
||||
// // 支付失败逻辑
|
||||
// uni.showToast({
|
||||
// title: '支付失败',
|
||||
// icon: 'none',
|
||||
// duration: 2000
|
||||
// });
|
||||
// }
|
||||
// });
|
||||
this.getisInOrder()
|
||||
} else {
|
||||
|
||||
}
|
||||
|
@ -928,7 +1030,11 @@
|
|||
// this.freList=res.rows
|
||||
if(res.data!=''){
|
||||
this.orderinfo=res.data[0]
|
||||
|
||||
this.starTime()
|
||||
}else{
|
||||
this.showdevice = false
|
||||
this.deviceIndex=0
|
||||
}
|
||||
} else {
|
||||
|
||||
|
@ -1624,7 +1730,7 @@
|
|||
background: #EFEFEF;
|
||||
border-radius: 16rpx 16rpx 16rpx 16rpx;
|
||||
.speeds{
|
||||
width: 90%;
|
||||
// width: 90%;
|
||||
height: 100%;
|
||||
background:#77B8FD ;
|
||||
border-radius: 16rpx 0rpx 0rpx 16rpx;
|
||||
|
|
Loading…
Reference in New Issue
Block a user