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": {
|
||||
"navigationBarTitleText": "常见问题"
|
||||
}
|
||||
}, {
|
||||
"path": "BillingRules",
|
||||
"style": {
|
||||
"navigationBarTitleText": "计费规则"
|
||||
}
|
||||
}]
|
||||
},
|
||||
{
|
||||
|
||||
@ -28,7 +28,7 @@
|
||||
</view>
|
||||
</uni-card>
|
||||
<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>
|
||||
<you-touchbox initTop="500" minTop="220" maxTop="5" @get-end-detail="getEndDetail">
|
||||
<scroll-view class="scroll-container" :scroll-y="isScrollY" :style="{ height: scrollHeight + 'px' }">
|
||||
@ -568,7 +568,7 @@
|
||||
|
||||
.divmap {
|
||||
width: 100%;
|
||||
height: 300px;
|
||||
height: 500px;
|
||||
margin-top: -15px;
|
||||
}
|
||||
</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>
|
||||
<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="content flex">
|
||||
<view class="content flex" @click="goToBillingRules">
|
||||
<text class="text-black text-bold">计费规则</text>
|
||||
</view>
|
||||
</view>
|
||||
@ -20,9 +20,16 @@
|
||||
</view>
|
||||
<!-- 普通弹窗 -->
|
||||
<uni-popup ref="popup" background-color="#fff" @change="change">
|
||||
<view>popup 内容</view>
|
||||
</uni-popup>
|
||||
<view class="popys">
|
||||
<view class="contact-title">
|
||||
客服电话
|
||||
</view>
|
||||
<view class="phone-number">
|
||||
400-888-88888
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</uni-popup>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
@ -35,6 +42,11 @@
|
||||
url: '/pages/user/HelpPage/HelpFaq'
|
||||
});
|
||||
}
|
||||
const goToBillingRules = () => {
|
||||
uni.navigateTo({
|
||||
url: '/pages/user/HelpPage/BillingRules'
|
||||
});
|
||||
}
|
||||
const popup = ref(null);
|
||||
const openPhone = () => {
|
||||
popup.value.open("center");
|
||||
@ -46,4 +58,33 @@
|
||||
background-color: white;
|
||||
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>
|
||||
@ -182,15 +182,13 @@
|
||||
}
|
||||
arrBikeData=data||[];
|
||||
const arrData=markers.value||[];
|
||||
debugger;
|
||||
arrBikeData.map((item) => {
|
||||
const{longitude,latitude}=item;
|
||||
let index=findIndex(arrData,{longitude,latitude});
|
||||
index==index==-1?arrData.length:index;
|
||||
arrData[index]=addMarker(index, item[1], item[0], "mapbike.png",true);
|
||||
index=index==-1?arrData.length:index;
|
||||
arrData[index]=addMarker(index, longitude, latitude, "mapbike.png",true);
|
||||
})
|
||||
markers.value =arrData ;
|
||||
console.log("555555555555555555555555555",arrData)
|
||||
|
||||
})
|
||||
|
||||
@ -246,48 +244,9 @@
|
||||
uni.navigateTo({
|
||||
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) {
|
||||
@ -352,7 +311,7 @@
|
||||
orderData = data;
|
||||
if(status==2){
|
||||
completeRiding();
|
||||
// hasOrder.value = true;
|
||||
hasOrder.value = true;
|
||||
return;
|
||||
}
|
||||
else if(status!=0){
|
||||
|
||||
@ -15,7 +15,8 @@
|
||||
</view>
|
||||
<view class="cu-form-group align-start">
|
||||
<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 class="cu-form-group align-start">
|
||||
<view class="titlele">拍摄照片</view>
|
||||
@ -73,11 +74,10 @@
|
||||
background-color: white;
|
||||
}
|
||||
|
||||
.cu-form-group uni-input {
|
||||
text-align: right;
|
||||
.cu-form-group input {
|
||||
text-align: right !important;
|
||||
}
|
||||
.titlele{
|
||||
|
||||
font-size: 13px;
|
||||
font-weight: bold;
|
||||
}
|
||||
@ -97,6 +97,7 @@
|
||||
line-height: 1.2em;
|
||||
flex: 1;
|
||||
font-size: 0.875rem;
|
||||
padding-left: 10px;
|
||||
padding-left: 10px;
|
||||
}
|
||||
|
||||
</style>
|
||||
@ -1,20 +1,20 @@
|
||||
<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="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" />
|
||||
</div>
|
||||
<div class="divData">
|
||||
<input v-for="(item,index) in inputData" :key="index" :focus="index==focus" @input="(e)=>{changeInput(index,e)}"
|
||||
adjust-position="false"
|
||||
type="number" cursor-color="#61D246" maxlength="1"/>
|
||||
<div class="divDataTab" v-for="(item,index) in inputData" :key="index" @click="clickTab">{{item}}</div>
|
||||
</div>
|
||||
|
||||
<div class="divBottom">
|
||||
<image style="width: 60px;height: 60px;" src="/static/userui/scan/light.png" />
|
||||
<div style="font-size: 12px;color: gray;">轻触点亮</div>
|
||||
<div :class="(btnDis?'divBtnDis ':'')+'divBtn'" @click="clickBtn">确认</div>
|
||||
<div style="font-size: 12px;color: gray;" @click="onTorch">轻触点亮</div>
|
||||
<div :class="(btnDis?'divBtnDis ':'')+'divBtn'" @click="addRide">确认</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -23,53 +23,139 @@
|
||||
|
||||
<script setup>
|
||||
import {
|
||||
ref,onMounted,getCurrentInstance
|
||||
ref,
|
||||
onMounted
|
||||
} from 'vue';
|
||||
import {
|
||||
showModelMessage,
|
||||
getUrlParams
|
||||
} from "@/utils/tools.js";
|
||||
import {
|
||||
callOrdereApi
|
||||
} from "@/utils/api.js";
|
||||
const len = 6;
|
||||
const arrData = [];
|
||||
for (let i = 0; i < 6; i++) {
|
||||
arrData.push("")
|
||||
}
|
||||
const inputData = ref(arrData);
|
||||
const focus=ref(0);
|
||||
const btnDis=ref(true);
|
||||
|
||||
const instance = getCurrentInstance();
|
||||
const oUser = uni.getStorageSync("wechat_user");
|
||||
const inputData = ref(new Array(len).fill(""));
|
||||
const focus = ref(true);
|
||||
const btnDis = ref(true);
|
||||
let data = null;
|
||||
|
||||
|
||||
function changeInput(index,e){
|
||||
// inputData.value[index]=e.detail.value;
|
||||
console.log("555555555555555",instance)
|
||||
debugger;
|
||||
// if(index<len-1){
|
||||
// focus.value=index+1;
|
||||
// }
|
||||
// else{
|
||||
// btnDis.value=false;
|
||||
// }
|
||||
console.log("3333333333333333",e,index);
|
||||
|
||||
// focus.value=index;
|
||||
// if(index==len-1){
|
||||
// btnDis.value=false;
|
||||
// }
|
||||
|
||||
function changeInput(e) {
|
||||
const {
|
||||
value
|
||||
} = e.detail;
|
||||
const arrVal = value.split("");
|
||||
const arrData = [];
|
||||
for (let i = 0; i < len; i++) {
|
||||
arrData[i] = arrVal[i] || '';
|
||||
};
|
||||
data = value;
|
||||
inputData.value = arrData;
|
||||
if (arrVal.length == 6) {
|
||||
btnDis.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
function clickBtn() {
|
||||
console.log("555555555555555", inputData)
|
||||
|
||||
function clickTab() {
|
||||
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>
|
||||
|
||||
<style scoped>
|
||||
.divInfo {}
|
||||
.divInfo {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.divTitle {
|
||||
margin-top: 60px;
|
||||
margin-top: 40px;
|
||||
font-size: 14px;
|
||||
color: #000;
|
||||
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 {
|
||||
width: 220px;
|
||||
height: 100px;
|
||||
@ -79,34 +165,38 @@
|
||||
.divData {
|
||||
display: flex;
|
||||
justify-content: space-evenly;
|
||||
position: relative;
|
||||
top: 130px;
|
||||
}
|
||||
|
||||
.divData input {
|
||||
.divDataTab {
|
||||
width: 28px;
|
||||
height: 40px;
|
||||
border: 1px solid #80808038;
|
||||
border-radius: 5px;
|
||||
background: #f5f2f2b8;
|
||||
text-align: center;
|
||||
font-size: 16px;
|
||||
font-weight: bold;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.divBottom {
|
||||
margin-top: 30px;
|
||||
position: relative;
|
||||
margin-top: 150px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.divBtnDis {
|
||||
|
||||
pointer-events: none;
|
||||
background: #b9b7b7 !important;
|
||||
opacity: 0.3;
|
||||
|
||||
|
||||
}
|
||||
|
||||
.divBtn {
|
||||
background: #61D246 ;
|
||||
background: #61D246;
|
||||
margin-top: 10px;
|
||||
line-height: 35px;
|
||||
border-radius: 5px;
|
||||
|
||||
@ -44,6 +44,14 @@
|
||||
import {
|
||||
onLoad
|
||||
} from "@dcloudio/uni-app";
|
||||
import {
|
||||
showModelMessage,
|
||||
getUrlParams
|
||||
} from "@/utils/tools.js";
|
||||
|
||||
import {
|
||||
callOrdereApi
|
||||
} from "@/utils/api.js";
|
||||
|
||||
let bikeCode = null;
|
||||
const openLight = ref("off");
|
||||
@ -51,17 +59,15 @@
|
||||
const oUser = uni.getStorageSync("wechat_user");
|
||||
let type = null;
|
||||
|
||||
onLoad((options)=>{
|
||||
onLoad((options) => {
|
||||
type = options["type"];
|
||||
});
|
||||
|
||||
function openCode(){
|
||||
|
||||
function openCode() {
|
||||
uni.navigateTo({
|
||||
url:"/pages/user/scan/inputcode"
|
||||
url: "/pages/user/scan/inputcode"
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
function scanCode(res) {
|
||||
const {
|
||||
@ -71,45 +77,49 @@
|
||||
showModelMessage("无效的车辆二维码");
|
||||
return;
|
||||
}
|
||||
if(bikeCode) return;
|
||||
const options = getUrlParams(result);
|
||||
bikeCode = options["number"];
|
||||
|
||||
if(type=="ride"){
|
||||
addRide(bikeCode)
|
||||
showModelMessage(bikeCode)
|
||||
if (type == "ride") {
|
||||
addRide()
|
||||
}
|
||||
console.log("11111111111111111111", "scanCode", options);
|
||||
}
|
||||
|
||||
|
||||
//订单
|
||||
function addRide(bikeId){
|
||||
function addRide() {
|
||||
const {
|
||||
userId
|
||||
} = oUser;
|
||||
const params = {
|
||||
userId,
|
||||
bikeId
|
||||
bikeCode
|
||||
}
|
||||
callOrdereApi("userOrders/saveRide", params, "post").then(res => {
|
||||
const {
|
||||
code,
|
||||
message
|
||||
} = res;
|
||||
console.log("11111111111111111111", "addRide", res);
|
||||
if (code != 200) {
|
||||
showModelMessage(message);
|
||||
} else {
|
||||
showWorn.value = true;
|
||||
setTimeout(()=>{
|
||||
uni.navigateTo({
|
||||
url:"/pages/user/home/home"
|
||||
})
|
||||
},1000)
|
||||
}
|
||||
bikeCode=null;
|
||||
},1000);
|
||||
|
||||
return;
|
||||
}
|
||||
showWorn.value = true;
|
||||
setTimeout(() => {
|
||||
uni.navigateTo({
|
||||
url: "/pages/user/home/home"
|
||||
})
|
||||
}, 1000);
|
||||
})
|
||||
}
|
||||
|
||||
function clickLight() {
|
||||
openLight.value = !openLight.value;
|
||||
openLight.value = openLight.value === "off" ? "on" : "off";
|
||||
uni.vibrateShort();
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user