Merge branch 'main' of http://47.109.71.130:3000/attiya/ebike-ui into main
This commit is contained in:
commit
59f716d9d8
@ -309,6 +309,11 @@
|
|||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "常见问题"
|
"navigationBarTitleText": "常见问题"
|
||||||
}
|
}
|
||||||
|
}, {
|
||||||
|
"path": "BillingRules",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "计费规则"
|
||||||
|
}
|
||||||
}]
|
}]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@ -28,7 +28,7 @@
|
|||||||
</view>
|
</view>
|
||||||
</uni-card>
|
</uni-card>
|
||||||
<view v-if="ebikeInfo.latitude & ebikeInfo.longitude" class="divmap">
|
<view v-if="ebikeInfo.latitude & ebikeInfo.longitude" class="divmap">
|
||||||
<map-location height="300px" :lng="ebikeInfo.longitude" :lat="ebikeInfo.latitude" @change="changePoint" />
|
<map-location height="500px" :lng="ebikeInfo.longitude" :lat="ebikeInfo.latitude" @change="changePoint" />
|
||||||
</view>
|
</view>
|
||||||
<you-touchbox initTop="500" minTop="220" maxTop="5" @get-end-detail="getEndDetail">
|
<you-touchbox initTop="500" minTop="220" maxTop="5" @get-end-detail="getEndDetail">
|
||||||
<scroll-view class="scroll-container" :scroll-y="isScrollY" :style="{ height: scrollHeight + 'px' }">
|
<scroll-view class="scroll-container" :scroll-y="isScrollY" :style="{ height: scrollHeight + 'px' }">
|
||||||
@ -568,7 +568,7 @@
|
|||||||
|
|
||||||
.divmap {
|
.divmap {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 300px;
|
height: 500px;
|
||||||
margin-top: -15px;
|
margin-top: -15px;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
53
ebike-maintenance/pages/user/HelpPage/BillingRules.vue
Normal file
53
ebike-maintenance/pages/user/HelpPage/BillingRules.vue
Normal file
@ -0,0 +1,53 @@
|
|||||||
|
<template>
|
||||||
|
<view class="billing-rules">
|
||||||
|
<view class="billing-header">计费规则</view>
|
||||||
|
|
||||||
|
<view class="billing-item">
|
||||||
|
<view class="item-title">起步价</view>
|
||||||
|
<view class="item-value">¥1.50元</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="billing-item">
|
||||||
|
<view class="item-title">包含时长</view>
|
||||||
|
<view class="item-value">30分钟以内</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import {
|
||||||
|
ref
|
||||||
|
} from 'vue';
|
||||||
|
|
||||||
|
const message = ref("这里是计费规则的详细描述");
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.billing-rules {
|
||||||
|
height: 100vh;
|
||||||
|
background-color: white;
|
||||||
|
padding: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.billing-header {
|
||||||
|
font-size: 16px;
|
||||||
|
font-weight: bold;
|
||||||
|
margin-bottom: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.billing-item {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
margin-bottom: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.item-title {
|
||||||
|
font-size: 13px;
|
||||||
|
color: #333;
|
||||||
|
}
|
||||||
|
|
||||||
|
.item-value {
|
||||||
|
font-size: 13px;
|
||||||
|
color: #666;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@ -1,8 +1,8 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="container">
|
<view class="container">
|
||||||
<view class="cu-list menu card-menu margin-top-xl margin-bottom-xl shadow-lg radius">
|
<view class="cu-list menu card-menu margin-bottom-xl shadow-lg radius">
|
||||||
<view class="cu-item arrow">
|
<view class="cu-item arrow">
|
||||||
<view class="content flex">
|
<view class="content flex" @click="goToBillingRules">
|
||||||
<text class="text-black text-bold">计费规则</text>
|
<text class="text-black text-bold">计费规则</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@ -20,9 +20,16 @@
|
|||||||
</view>
|
</view>
|
||||||
<!-- 普通弹窗 -->
|
<!-- 普通弹窗 -->
|
||||||
<uni-popup ref="popup" background-color="#fff" @change="change">
|
<uni-popup ref="popup" background-color="#fff" @change="change">
|
||||||
<view>popup 内容</view>
|
<view class="popys">
|
||||||
</uni-popup>
|
<view class="contact-title">
|
||||||
|
客服电话
|
||||||
|
</view>
|
||||||
|
<view class="phone-number">
|
||||||
|
400-888-88888
|
||||||
|
</view>
|
||||||
|
|
||||||
|
</view>
|
||||||
|
</uni-popup>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
@ -35,6 +42,11 @@
|
|||||||
url: '/pages/user/HelpPage/HelpFaq'
|
url: '/pages/user/HelpPage/HelpFaq'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
const goToBillingRules = () => {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/pages/user/HelpPage/BillingRules'
|
||||||
|
});
|
||||||
|
}
|
||||||
const popup = ref(null);
|
const popup = ref(null);
|
||||||
const openPhone = () => {
|
const openPhone = () => {
|
||||||
popup.value.open("center");
|
popup.value.open("center");
|
||||||
@ -46,4 +58,33 @@
|
|||||||
background-color: white;
|
background-color: white;
|
||||||
height: 100vh;
|
height: 100vh;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.uni-popup .uni-popup__wrapper {
|
||||||
|
border-radius: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.popys {
|
||||||
|
text-align: center;
|
||||||
|
width: 260px;
|
||||||
|
height: 140px;
|
||||||
|
background: linear-gradient(180deg, rgb(220 248 218), rgb(255, 255, 255));
|
||||||
|
border-radius: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 设置客服电话标题样式 */
|
||||||
|
.contact-title {
|
||||||
|
font-size: 14px;
|
||||||
|
font-weight: bold;
|
||||||
|
letter-spacing: 3px;
|
||||||
|
color: #333;
|
||||||
|
padding-top: 40px;
|
||||||
|
margin-bottom: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 设置客服电话号码样式 */
|
||||||
|
.phone-number {
|
||||||
|
font-size: 16px;
|
||||||
|
font-weight: bold;
|
||||||
|
color: rgb(59,183,55);
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
@ -182,15 +182,13 @@
|
|||||||
}
|
}
|
||||||
arrBikeData=data||[];
|
arrBikeData=data||[];
|
||||||
const arrData=markers.value||[];
|
const arrData=markers.value||[];
|
||||||
debugger;
|
|
||||||
arrBikeData.map((item) => {
|
arrBikeData.map((item) => {
|
||||||
const{longitude,latitude}=item;
|
const{longitude,latitude}=item;
|
||||||
let index=findIndex(arrData,{longitude,latitude});
|
let index=findIndex(arrData,{longitude,latitude});
|
||||||
index==index==-1?arrData.length:index;
|
index=index==-1?arrData.length:index;
|
||||||
arrData[index]=addMarker(index, item[1], item[0], "mapbike.png",true);
|
arrData[index]=addMarker(index, longitude, latitude, "mapbike.png",true);
|
||||||
})
|
})
|
||||||
markers.value =arrData ;
|
markers.value =arrData ;
|
||||||
console.log("555555555555555555555555555",arrData)
|
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -246,48 +244,9 @@
|
|||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url:"/pages/user/scan/scancode?type=ride"
|
url:"/pages/user/scan/scancode?type=ride"
|
||||||
})
|
})
|
||||||
/*
|
|
||||||
uni.scanCode({
|
|
||||||
onlyFromCamera: true, //只能扫码
|
|
||||||
scanType: ["qrCode"],
|
|
||||||
success: function(res) {
|
|
||||||
const {
|
|
||||||
result
|
|
||||||
} = res;
|
|
||||||
if (!result || result.indexOf("number") == -1) {
|
|
||||||
showModelMessage("无效的车辆二维码");
|
|
||||||
return
|
|
||||||
}
|
|
||||||
const options = getUrlParams(result);
|
|
||||||
console.log("11111111111111111111","scanBike",options);
|
|
||||||
const bikeId = options["number"];
|
|
||||||
addRide(bikeId)
|
|
||||||
}
|
|
||||||
}) */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* //订单
|
|
||||||
function addRide(bikeId){
|
|
||||||
const {
|
|
||||||
userId
|
|
||||||
} = oUser;
|
|
||||||
const params = {
|
|
||||||
userId,
|
|
||||||
bikeId
|
|
||||||
}
|
|
||||||
callOrdereApi("userOrders/saveRide", params, "post").then(res => {
|
|
||||||
const {
|
|
||||||
code,
|
|
||||||
message
|
|
||||||
} = res;
|
|
||||||
console.log("11111111111111111111", "addRide", res);
|
|
||||||
if (code != 200) {
|
|
||||||
showModelMessage(message);
|
|
||||||
} else {
|
|
||||||
|
|
||||||
}
|
|
||||||
})
|
|
||||||
} */
|
|
||||||
|
|
||||||
//添加点
|
//添加点
|
||||||
function addMarker (id, longitude, latitude, icon,joinCluster) {
|
function addMarker (id, longitude, latitude, icon,joinCluster) {
|
||||||
@ -352,7 +311,7 @@
|
|||||||
orderData = data;
|
orderData = data;
|
||||||
if(status==2){
|
if(status==2){
|
||||||
completeRiding();
|
completeRiding();
|
||||||
// hasOrder.value = true;
|
hasOrder.value = true;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else if(status!=0){
|
else if(status!=0){
|
||||||
|
|||||||
@ -15,7 +15,8 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="cu-form-group align-start">
|
<view class="cu-form-group align-start">
|
||||||
<view class="titlele">问题描述</view>
|
<view class="titlele">问题描述</view>
|
||||||
<textarea maxlength="-1" :disabled="true" v-model="ebikeInfo.wtms"></textarea>
|
<textarea style="width: 80%; margin-left: 20px; text-align: right !important;" v-model="ebikeInfo.wtms"></textarea>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
<view class="cu-form-group align-start">
|
<view class="cu-form-group align-start">
|
||||||
<view class="titlele">拍摄照片</view>
|
<view class="titlele">拍摄照片</view>
|
||||||
@ -73,11 +74,10 @@
|
|||||||
background-color: white;
|
background-color: white;
|
||||||
}
|
}
|
||||||
|
|
||||||
.cu-form-group uni-input {
|
.cu-form-group input {
|
||||||
text-align: right;
|
text-align: right !important;
|
||||||
}
|
}
|
||||||
.titlele{
|
.titlele{
|
||||||
|
|
||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
@ -97,6 +97,7 @@
|
|||||||
line-height: 1.2em;
|
line-height: 1.2em;
|
||||||
flex: 1;
|
flex: 1;
|
||||||
font-size: 0.875rem;
|
font-size: 0.875rem;
|
||||||
padding-left: 10px;
|
padding-left: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
@ -1,20 +1,20 @@
|
|||||||
<template>
|
<template>
|
||||||
<div style="width:100vw;height:100vh;display: flex;justify-content: center;">
|
<div style="width:100vw;height:100vh;display: flex;justify-content: center;background: white;">
|
||||||
<div class="divInfo">
|
<div class="divInfo">
|
||||||
<div class="divTitle">请输入车辆二维码下方6位编号开锁</div>
|
<div class="divTitle">请输入车辆二维码下方6位编号开锁</div>
|
||||||
<div>
|
<div><input :focus="focus" @input="changeInput" type="number" maxlength="6" style="height: 0;width: 0;" />
|
||||||
|
</div>
|
||||||
|
<div class="divImgP">
|
||||||
<image class="divImg" src="/static/userui/scan/bike.png" />
|
<image class="divImg" src="/static/userui/scan/bike.png" />
|
||||||
</div>
|
</div>
|
||||||
<div class="divData">
|
<div class="divData">
|
||||||
<input v-for="(item,index) in inputData" :key="index" :focus="index==focus" @input="(e)=>{changeInput(index,e)}"
|
<div class="divDataTab" v-for="(item,index) in inputData" :key="index" @click="clickTab">{{item}}</div>
|
||||||
adjust-position="false"
|
|
||||||
type="number" cursor-color="#61D246" maxlength="1"/>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="divBottom">
|
<div class="divBottom">
|
||||||
<image style="width: 60px;height: 60px;" src="/static/userui/scan/light.png" />
|
<image style="width: 60px;height: 60px;" src="/static/userui/scan/light.png" />
|
||||||
<div style="font-size: 12px;color: gray;">轻触点亮</div>
|
<div style="font-size: 12px;color: gray;" @click="onTorch">轻触点亮</div>
|
||||||
<div :class="(btnDis?'divBtnDis ':'')+'divBtn'" @click="clickBtn">确认</div>
|
<div :class="(btnDis?'divBtnDis ':'')+'divBtn'" @click="addRide">确认</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -23,53 +23,139 @@
|
|||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import {
|
import {
|
||||||
ref,onMounted,getCurrentInstance
|
ref,
|
||||||
|
onMounted
|
||||||
} from 'vue';
|
} from 'vue';
|
||||||
|
import {
|
||||||
|
showModelMessage,
|
||||||
|
getUrlParams
|
||||||
|
} from "@/utils/tools.js";
|
||||||
|
import {
|
||||||
|
callOrdereApi
|
||||||
|
} from "@/utils/api.js";
|
||||||
const len = 6;
|
const len = 6;
|
||||||
const arrData = [];
|
const oUser = uni.getStorageSync("wechat_user");
|
||||||
for (let i = 0; i < 6; i++) {
|
const inputData = ref(new Array(len).fill(""));
|
||||||
arrData.push("")
|
const focus = ref(true);
|
||||||
}
|
const btnDis = ref(true);
|
||||||
const inputData = ref(arrData);
|
let data = null;
|
||||||
const focus=ref(0);
|
|
||||||
const btnDis=ref(true);
|
|
||||||
|
|
||||||
const instance = getCurrentInstance();
|
|
||||||
|
|
||||||
|
|
||||||
function changeInput(index,e){
|
|
||||||
// inputData.value[index]=e.detail.value;
|
function changeInput(e) {
|
||||||
console.log("555555555555555",instance)
|
const {
|
||||||
debugger;
|
value
|
||||||
// if(index<len-1){
|
} = e.detail;
|
||||||
// focus.value=index+1;
|
const arrVal = value.split("");
|
||||||
// }
|
const arrData = [];
|
||||||
// else{
|
for (let i = 0; i < len; i++) {
|
||||||
// btnDis.value=false;
|
arrData[i] = arrVal[i] || '';
|
||||||
// }
|
};
|
||||||
console.log("3333333333333333",e,index);
|
data = value;
|
||||||
|
inputData.value = arrData;
|
||||||
// focus.value=index;
|
if (arrVal.length == 6) {
|
||||||
// if(index==len-1){
|
btnDis.value = false;
|
||||||
// btnDis.value=false;
|
}
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function clickBtn() {
|
function clickTab() {
|
||||||
console.log("555555555555555", inputData)
|
focus.value = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 打开闪光灯
|
||||||
|
function onTorch() {
|
||||||
|
try {
|
||||||
|
var os = plus.os.name;
|
||||||
|
if ('iOS' == os) {
|
||||||
|
// 获取iOS设备的默认摄像头设备
|
||||||
|
var device = plus.ios.invoke('AVCaptureDevice', 'defaultDeviceWithMediaType:', 'vide');
|
||||||
|
// 锁定设备配置
|
||||||
|
plus.ios.invoke(device, 'lockForConfiguration:', null);
|
||||||
|
// 设置手电筒模式为打开
|
||||||
|
plus.ios.invoke(device, 'setTorchMode:', 1);
|
||||||
|
// 设置闪光灯模式为打开
|
||||||
|
plus.ios.invoke(device, 'setFlashMode:', 1);
|
||||||
|
// 解锁设备配置
|
||||||
|
plus.ios.invoke(device, 'unlockForConfiguration');
|
||||||
|
} else {
|
||||||
|
// 获取安卓系统的主Activity
|
||||||
|
var main = plus.android.runtimeMainActivity();
|
||||||
|
// 获取摄像头服务
|
||||||
|
var camera = main.getSystemService('camera');
|
||||||
|
// 获取摄像头ID列表
|
||||||
|
var ids = plus.android.invoke(camera, 'getCameraIdList');
|
||||||
|
for (var i = 0; i < ids.length; i++) {
|
||||||
|
// 获取摄像头特性
|
||||||
|
var c = plus.android.invoke(camera, 'getCameraCharacteristics', ids[i]);
|
||||||
|
// 检查闪光灯是否可用
|
||||||
|
var available = plus.android.invoke(c, 'get', plus.android.getAttribute(c, 'FLASH_INFO_AVAILABLE'));
|
||||||
|
// 检查摄像头是否为后置摄像头
|
||||||
|
var facing = plus.android.invoke(c, 'get', plus.android.getAttribute(c, 'LENS_FACING'));
|
||||||
|
if (null != facing && 1 == facing) {
|
||||||
|
// 打开后置摄像头的手电筒
|
||||||
|
plus.android.invoke(camera, 'setTorchMode', ids[i], true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
console.error('error @onTorch!!', e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//订单
|
||||||
|
function addRide() {
|
||||||
|
const {
|
||||||
|
userId
|
||||||
|
} = oUser;
|
||||||
|
const params = {
|
||||||
|
userId,
|
||||||
|
bikeCode: data
|
||||||
|
}
|
||||||
|
console.log("44444444444444444",params)
|
||||||
|
callOrdereApi("userOrders/saveRide", params, "post").then(res => {
|
||||||
|
const {
|
||||||
|
code,
|
||||||
|
message
|
||||||
|
} = res;
|
||||||
|
if (code != 200) {
|
||||||
|
showModelMessage(message);
|
||||||
|
} else {
|
||||||
|
showWorn.value = true;
|
||||||
|
setTimeout(() => {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: "/pages/user/home/home"
|
||||||
|
})
|
||||||
|
}, 1000)
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.divInfo {}
|
.divInfo {
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
.divTitle {
|
.divTitle {
|
||||||
margin-top: 60px;
|
margin-top: 40px;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
color: #000;
|
color: #000;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.divImgP {
|
||||||
|
position: absolute;
|
||||||
|
left: 0px;
|
||||||
|
right: 0px;
|
||||||
|
height: 120px;
|
||||||
|
top: 60px;
|
||||||
|
background: white;
|
||||||
|
z-index: 100000;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
.divImg {
|
.divImg {
|
||||||
width: 220px;
|
width: 220px;
|
||||||
height: 100px;
|
height: 100px;
|
||||||
@ -79,34 +165,38 @@
|
|||||||
.divData {
|
.divData {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-evenly;
|
justify-content: space-evenly;
|
||||||
|
position: relative;
|
||||||
|
top: 130px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.divData input {
|
.divDataTab {
|
||||||
width: 28px;
|
width: 28px;
|
||||||
height: 40px;
|
height: 40px;
|
||||||
border: 1px solid #80808038;
|
border: 1px solid #80808038;
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
background: #f5f2f2b8;
|
background: #f5f2f2b8;
|
||||||
text-align: center;
|
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.divBottom {
|
.divBottom {
|
||||||
margin-top: 30px;
|
position: relative;
|
||||||
|
margin-top: 150px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.divBtnDis {
|
.divBtnDis {
|
||||||
|
|
||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
background: #b9b7b7 !important;
|
background: #b9b7b7 !important;
|
||||||
opacity: 0.3;
|
opacity: 0.3;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.divBtn {
|
.divBtn {
|
||||||
background: #61D246 ;
|
background: #61D246;
|
||||||
margin-top: 10px;
|
margin-top: 10px;
|
||||||
line-height: 35px;
|
line-height: 35px;
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
|
|||||||
@ -44,6 +44,14 @@
|
|||||||
import {
|
import {
|
||||||
onLoad
|
onLoad
|
||||||
} from "@dcloudio/uni-app";
|
} from "@dcloudio/uni-app";
|
||||||
|
import {
|
||||||
|
showModelMessage,
|
||||||
|
getUrlParams
|
||||||
|
} from "@/utils/tools.js";
|
||||||
|
|
||||||
|
import {
|
||||||
|
callOrdereApi
|
||||||
|
} from "@/utils/api.js";
|
||||||
|
|
||||||
let bikeCode = null;
|
let bikeCode = null;
|
||||||
const openLight = ref("off");
|
const openLight = ref("off");
|
||||||
@ -51,17 +59,15 @@
|
|||||||
const oUser = uni.getStorageSync("wechat_user");
|
const oUser = uni.getStorageSync("wechat_user");
|
||||||
let type = null;
|
let type = null;
|
||||||
|
|
||||||
onLoad((options)=>{
|
onLoad((options) => {
|
||||||
type = options["type"];
|
type = options["type"];
|
||||||
});
|
});
|
||||||
|
|
||||||
function openCode(){
|
function openCode() {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url:"/pages/user/scan/inputcode"
|
url: "/pages/user/scan/inputcode"
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function scanCode(res) {
|
function scanCode(res) {
|
||||||
const {
|
const {
|
||||||
@ -71,45 +77,49 @@
|
|||||||
showModelMessage("无效的车辆二维码");
|
showModelMessage("无效的车辆二维码");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if(bikeCode) return;
|
||||||
const options = getUrlParams(result);
|
const options = getUrlParams(result);
|
||||||
bikeCode = options["number"];
|
bikeCode = options["number"];
|
||||||
|
showModelMessage(bikeCode)
|
||||||
if(type=="ride"){
|
if (type == "ride") {
|
||||||
addRide(bikeCode)
|
addRide()
|
||||||
}
|
}
|
||||||
console.log("11111111111111111111", "scanCode", options);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//订单
|
//订单
|
||||||
function addRide(bikeId){
|
function addRide() {
|
||||||
const {
|
const {
|
||||||
userId
|
userId
|
||||||
} = oUser;
|
} = oUser;
|
||||||
const params = {
|
const params = {
|
||||||
userId,
|
userId,
|
||||||
bikeId
|
bikeCode
|
||||||
}
|
}
|
||||||
callOrdereApi("userOrders/saveRide", params, "post").then(res => {
|
callOrdereApi("userOrders/saveRide", params, "post").then(res => {
|
||||||
const {
|
const {
|
||||||
code,
|
code,
|
||||||
message
|
message
|
||||||
} = res;
|
} = res;
|
||||||
console.log("11111111111111111111", "addRide", res);
|
|
||||||
if (code != 200) {
|
if (code != 200) {
|
||||||
showModelMessage(message);
|
showModelMessage(message);
|
||||||
} else {
|
|
||||||
showWorn.value = true;
|
|
||||||
setTimeout(()=>{
|
setTimeout(()=>{
|
||||||
uni.navigateTo({
|
bikeCode=null;
|
||||||
url:"/pages/user/home/home"
|
},1000);
|
||||||
})
|
|
||||||
},1000)
|
return;
|
||||||
}
|
}
|
||||||
|
showWorn.value = true;
|
||||||
|
setTimeout(() => {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: "/pages/user/home/home"
|
||||||
|
})
|
||||||
|
}, 1000);
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
function clickLight() {
|
function clickLight() {
|
||||||
openLight.value = !openLight.value;
|
openLight.value = openLight.value === "off" ? "on" : "off";
|
||||||
|
uni.vibrateShort();
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user