This commit is contained in:
Sliverber 2024-06-24 17:59:49 +08:00
parent c5e0df3081
commit 31dd8af5ac
11 changed files with 990 additions and 825 deletions

View File

@ -19,12 +19,13 @@ const install = (Vue, vm) => {
// }, // },
// }); // });
uni.setStorageSync('deptId', 101);
Vue.prototype.$u.http.setConfig({ Vue.prototype.$u.http.setConfig({
// baseUrl: 'http://61.174.243.28:15861', // baseUrl: 'http://61.174.243.28:15861',
// baseUrl: 'http://192.168.2.14:8080', // baseUrl: 'http://192.168.2.14:8080',
// baseUrl: 'http://124.221.246.124:2289', // baseUrl: 'http://124.221.246.124:2289',
// baseUrl: 'https://dianche.chuantewulian.cn/prod-api', baseUrl: 'https://dianche.chuantewulian.cn/prod-api',
baseUrl: 'https://dche.ccttiot.com/prod-api', // baseUrl: 'https://dche.ccttiot.com/prod-api',
loadingText: '努力加载中~', loadingText: '努力加载中~',
// loadingTime: 2000, // loadingTime: 2000,
// 设置自定义头部content-type // 设置自定义头部content-type

View File

@ -51,7 +51,7 @@
/* */ /* */
"mp-weixin" : { "mp-weixin" : {
"libVersion" : "latest", "libVersion" : "latest",
"appid" : "wx3428c498d5061192", "appid" : "wx4d178f8c80348214",
"setting" : { "setting" : {
"urlCheck" : false "urlCheck" : false
}, },

View File

@ -1,13 +1,20 @@
<template> <template>
<view class="page"> <view class="page">
<u-navbar :is-back='false' title=" " :border-bottom="false" :background="bgc" title-color='#000' <u-navbar :is-back="false" title=" " :border-bottom="false" :background="bgc" title-color="#000" title-size="36" height="45"></u-navbar>
title-size='36' height='45'></u-navbar>
<view class="cont" v-html="info.content"></view> <view class="cont" v-html="info.content"></view>
<view class="bottom"> <view class="xy" @click="showxy = !showxy">
<view class="yuans">
<image src="https://lxnapi.ccttiot.com/bike/img/static/u7F851ikY9rkASzNSNkO" v-if="showxy" mode=""></image>
</view>
<view class="txt" v-if="isread">
我已同意并阅读 <span @click.stop="toxy()">{{ info.title }}</span>
</view>
</view>
<view class="bottom" v-if="showbot">
<view class="btn" @click="quit()"> <view class="btn" @click="quit()">
不同意 不同意
</view> </view>
<view class="btn1" @click="ok()"> <view class="btn1" :class="{ 'act1': isread && showxy }" @click="ok()">
同意 同意
</view> </view>
</view> </view>
@ -23,25 +30,52 @@
}, },
info: {}, info: {},
userinfo: {}, userinfo: {},
areaInfo: {} areaInfo: {},
qParam:'',
isread:false,
showxy:false,
showbot:false
} }
}, },
onLoad(e) { onLoad(e) {
console.log(e, 'eee'); console.log(e, 'eee');
if (e.needback) { if (e.needback) {
this.showbot = true this.showbot = true
this.qParam=e.qParam
} }
},
onReachBottom() {
//
console.log('到达了页面底部');
this.isread=true
}, },
onShow() { onShow() {
this.getagree() this.getagree()
}, },
methods: { methods: {
ok() { ok() {
if(this.isread==false){
uni.showToast({
title: '请先阅读完协议',
icon: 'none',
duration: 700
});
} else if(this.showxy==false){
uni.showToast({
title: '请勾选同意',
icon: 'none',
duration: 1000
});
} else if(this.isread&&this.showxy){
this.$store.commit('SET_SHOWAGRE',false); this.$store.commit('SET_SHOWAGRE',false);
console.log( this.$store.getters.showagre); console.log( this.$store.getters.showagre);
uni.redirectTo({ uni.redirectTo({
url:'/pages/index/index' url:'/pages/index/index?qParam='+this.qParam
}) })
}
}, },
quit() { quit() {
uni.exitMiniProgram({ uni.exitMiniProgram({
@ -55,8 +89,15 @@
}, },
getagree() { getagree() {
let id = 15 let ids = 0
this.$u.get(`/app/article/list?areaId=${id}&tag=agreement`).then((res) => { let id= uni.getStorageSync('deptId');
if(id==100){
ids=15
}else if(id==101){
ids=14
}
this.$u.get(`/app/article/list?areaId=${ids}&tag=agreement`).then((res) => {
if (res.code === 200) { if (res.code === 200) {
this.info = res.rows[0]; this.info = res.rows[0];
this.insertPhoneNumberAndDate(); this.insertPhoneNumberAndDate();
@ -69,28 +110,7 @@
} }
}); });
}, },
// insertPhoneNumberAndDate() {
// const currentDate = new Date();
// const formattedDate = `${currentDate.getFullYear()}${currentDate.getMonth() + 1}${currentDate.getDate()}${currentDate.getHours()}`;
// const simpleDate = `${currentDate.getFullYear()}${currentDate.getMonth() + 1}${currentDate.getDate()}`;
// //
// if (this.userinfo.phonenumber) {
// const phonePattern = /(<p>)(<\/p>)/;
// this.info.content = this.info.content.replace(phonePattern, `$1${this.userinfo.phonenumber}$2`);
// }
// //
// const rentTimePattern = /<u>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/u><u>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/u><u>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/u><u>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/u>/;
// this.info.content = this.info.content.replace(rentTimePattern, `<u>\u00A0\u00A0\u00A0\u00A0\u00A0\u00A0${formattedDate}</u>`);
// //
// const bottomDatePattern = /<p>&nbsp;<\/p>/g;
// this.info.content = this.info.content.replace(bottomDatePattern, `<p>${simpleDate}\u00A0\u00A0\u00A0\u00A0\u00A0\u00A0\u00A0\u00A0\u00A0\u00A0\u00A0\u00A0\u00A0\u00A0\u00A0\u00A0\u00A0\u00A0${simpleDate}</p>`);
// // &nbsp; \u00A0
// this.info.content = this.info.content.replace(/&nbsp;/g, '\u00A0');
// },
insertPhoneNumberAndDate() { insertPhoneNumberAndDate() {
// &nbsp; \u00A0 // &nbsp; \u00A0
@ -108,7 +128,45 @@
.page { .page {
width: 750rpx; width: 750rpx;
padding-bottom: 250rpx;
.xy {
margin-top: 50rpx;
width: 100%;
display: flex;
flex-wrap: nowrap;
align-items: center;
justify-content: center;
.yuans {
margin-top: 2rpx;
display: flex;
align-items: center;
justify-content: center;
width: 27rpx;
height: 27rpx;
border-radius: 50%;
border: #808080 solid 2rpx;
image {
width: 100%;
height: 100%;
border-radius: 50%;
}
}
.txt {
margin-left: 10rpx;
font-weight: 400;
font-size: 24rpx;
color: #979797;
span {
color: #3D3D3D;
}
}
}
.bottom { .bottom {
position: fixed; position: fixed;
background: #fff; background: #fff;
@ -120,6 +178,9 @@
align-items: center; align-items: center;
justify-content: space-around; justify-content: space-around;
// box-shadow: 12rpx 16rpx 40rpx 0rpx rgba(42,130,228,0.1); // box-shadow: 12rpx 16rpx 40rpx 0rpx rgba(42,130,228,0.1);
.act1{
background: #4C97E7 !important;
}
.btn { .btn {
width: 250rpx; width: 250rpx;
height: 80rpx; height: 80rpx;
@ -143,11 +204,12 @@
justify-content: center; justify-content: center;
// border: 2rpx solid #000; // border: 2rpx solid #000;
border-radius: 40rpx; border-radius: 40rpx;
background: #4C97E7; background: #ccc;
color: #fff; color: #fff;
font-size: 28rpx; font-size: 28rpx;
font-weight: 600; font-weight: 600;
} }
} }
.cont { .cont {

File diff suppressed because it is too large Load Diff

View File

@ -1,16 +1,18 @@
<template> <template>
<view class="page"> <view class="page">
<u-navbar title="个人中心" :border-bottom="false" :background="bgc" title-color='#fff' title-size='36' height='45'></u-navbar> <u-navbar title="个人中心" :border-bottom="false" :background="bgc" title-color='#fff' title-size='36'
height='45'></u-navbar>
<view class="topbg"> <view class="topbg">
<view class="topbox"> <view class="topbox">
<view class="info" > <view class="info">
<image v-if="info.avatar!=''" :src='info.avatar' mode=""></image> <image v-if="info.avatar!=''" :src='info.avatar' mode=""></image>
<image v-if="info.avatar==''" src="https://lxnapi.ccttiot.com/bike/img/static/uSRzzLXhnbnWLB8jMKmr" mode=""></image> <image v-if="info.avatar==''" src="https://lxnapi.ccttiot.com/bike/img/static/uSRzzLXhnbnWLB8jMKmr"
mode=""></image>
<view class="cont"> <view class="cont">
<view class="name" v-if="info.realName!=null"> <view class="name" v-if="info.realName!=null">
{{maskedName}} {{maskedName}}
</view> </view>
<view class="name" v-if="info.realName==null" > <view class="name" v-if="info.realName==null">
未实名 未实名
</view> </view>
<view class="phone"> <view class="phone">
@ -24,7 +26,8 @@
<view class="btncard"> <view class="btncard">
<view class="card_li" @click="topage(1)"> <view class="card_li" @click="topage(1)">
<view class="card_left"> <view class="card_left">
<image src="https://api.ccttiot.com/smartmeter/img/static/u3ILM6aE0MdFo3ZKiYPH" mode=""></image> <image src="https://api.ccttiot.com/smartmeter/img/static/u3ILM6aE0MdFo3ZKiYPH" mode="">
</image>
<view class="text"> <view class="text">
押金 押金
</view> </view>
@ -32,43 +35,46 @@
未充值 未充值
</view> </view>
</view> </view>
<view class="iconfont icon-xiangyou1" > <view class="iconfont icon-xiangyou1">
</view> </view>
</view> </view>
<view class="card_li" @click="topage(2)"> <view class="card_li" @click="topage(2)">
<view class="card_left"> <view class="card_left">
<image src="https://api.ccttiot.com/smartmeter/img/static/u4Y4UAai9GLSaCBMMIsv" mode=""></image> <image src="https://api.ccttiot.com/smartmeter/img/static/u4Y4UAai9GLSaCBMMIsv" mode="">
</image>
<view class="text"> <view class="text">
我的订单 我的订单
</view> </view>
</view> </view>
<view class="iconfont icon-xiangyou1" > <view class="iconfont icon-xiangyou1">
</view> </view>
</view> </view>
<view class="card_li" @click="topage(3)"> <view class="card_li" @click="topage(3)">
<view class="card_left"> <view class="card_left">
<image src="https://api.ccttiot.com/smartmeter/img/static/u245BAqGOvTbYYGXJcrC" mode=""></image> <image src="https://api.ccttiot.com/smartmeter/img/static/u245BAqGOvTbYYGXJcrC" mode="">
</image>
<view class="text"> <view class="text">
问题上报记录 问题上报记录
</view> </view>
</view> </view>
<view class="iconfont icon-xiangyou1" > <view class="iconfont icon-xiangyou1">
</view> </view>
</view> </view>
<view class="card_li" @click="topage(4)"> <view class="card_li" @click="topage(4)">
<view class="card_left"> <view class="card_left">
<image src="https://api.ccttiot.com/smartmeter/img/static/ufD1uFe0pknx00weXJaU" mode=""></image> <image src="https://api.ccttiot.com/smartmeter/img/static/ufD1uFe0pknx00weXJaU" mode="">
</image>
<view class="text"> <view class="text">
用车指南 用车指南
</view> </view>
</view> </view>
<view class="iconfont icon-xiangyou1" > <view class="iconfont icon-xiangyou1">
</view> </view>
</view> </view>
@ -84,39 +90,42 @@
</view> </view>
</view> --> </view> -->
<view class="card_li" @click="topage(10)" > <view class="card_li" @click="topage(10)">
<view class="card_left"> <view class="card_left">
<image src="https://lxnapi.ccttiot.com/bike/img/static/uk7i80QWz02cAfbbC518" mode=""></image> <image src="https://lxnapi.ccttiot.com/bike/img/static/uk7i80QWz02cAfbbC518" mode="">
</image>
<view class="text"> <view class="text">
客户服务 客户服务
</view> </view>
</view> </view>
<view class="iconfont icon-xiangyou1" > <view class="iconfont icon-xiangyou1">
</view> </view>
</view> </view>
<view class="card_li" @click="topage(8)" v-if="info.role==3||info.role==2"> <view class="card_li" @click="topage(8)" v-if="info.role==3||info.role==2">
<view class="card_left"> <view class="card_left">
<image src="https://lxnapi.ccttiot.com/bike/img/static/unIGXFEhvTgtXVcfPH33" mode=""></image> <image src="https://lxnapi.ccttiot.com/bike/img/static/unIGXFEhvTgtXVcfPH33" mode="">
</image>
<view class="text"> <view class="text">
维护入口 维护入口
</view> </view>
</view> </view>
<view class="iconfont icon-xiangyou1" > <view class="iconfont icon-xiangyou1">
</view> </view>
</view> </view>
<view class="card_li" @click="topage(9)" v-if="info.role==3"> <view class="card_li" @click="topage(9)" v-if="info.role==3">
<view class="card_left"> <view class="card_left">
<image src="https://lxnapi.ccttiot.com/bike/img/static/unIGXFEhvTgtXVcfPH33" mode=""></image> <image src="https://lxnapi.ccttiot.com/bike/img/static/unIGXFEhvTgtXVcfPH33" mode="">
</image>
<view class="text"> <view class="text">
管理入口 管理入口
</view> </view>
</view> </view>
<view class="iconfont icon-xiangyou1" > <view class="iconfont icon-xiangyou1">
</view> </view>
</view> </view>
@ -124,38 +133,41 @@
<view class="btncard" style="margin-top: 36rpx;" v-if="false"> <view class="btncard" style="margin-top: 36rpx;" v-if="false">
<view class="card_li" @click="topage(5)"> <view class="card_li" @click="topage(5)">
<view class="card_left"> <view class="card_left">
<image src="https://api.ccttiot.com/smartmeter/img/static/utp8xohLmuvcTiYZdGCL" mode=""></image> <image src="https://api.ccttiot.com/smartmeter/img/static/utp8xohLmuvcTiYZdGCL" mode="">
</image>
<view class="text"> <view class="text">
用户协议 用户协议
</view> </view>
</view> </view>
<view class="iconfont icon-xiangyou1" > <view class="iconfont icon-xiangyou1">
</view> </view>
</view> </view>
<view class="card_li" @click="topage(6)"> <view class="card_li" @click="topage(6)">
<view class="card_left"> <view class="card_left">
<image src="https://api.ccttiot.com/smartmeter/img/static/um7bn51NCkfnuQbP0toj" mode=""></image> <image src="https://api.ccttiot.com/smartmeter/img/static/um7bn51NCkfnuQbP0toj" mode="">
</image>
<view class="text"> <view class="text">
隐私政策 隐私政策
</view> </view>
</view> </view>
<view class="iconfont icon-xiangyou1" > <view class="iconfont icon-xiangyou1">
</view> </view>
</view> </view>
<view class="card_li" style="border-bottom:2rpx solid #fff ;" @click="topage(7)" > <view class="card_li" style="border-bottom:2rpx solid #fff ;" @click="topage(7)">
<view class="card_left"> <view class="card_left">
<image src="https://api.ccttiot.com/smartmeter/img/static/uJ1TRgb6xURsKZo5GUj8" mode=""></image> <image src="https://api.ccttiot.com/smartmeter/img/static/uJ1TRgb6xURsKZo5GUj8" mode="">
</image>
<view class="text"> <view class="text">
关于我们 关于我们
</view> </view>
</view> </view>
<view class="iconfont icon-xiangyou1" > <view class="iconfont icon-xiangyou1">
</view> </view>
</view> </view>
@ -164,18 +176,24 @@
</view> </view>
</view> </view>
</view> </view>
<u-select v-model="show" :list="list" title='选择运营区' @confirm="confirm"></u-select>
</view> </view>
</template> </template>
<script> <script>
import {
info
} from 'autoprefixer';
export default { export default {
data() { data() {
return { return {
bgc: { bgc: {
backgroundColor: "#4C97E7", backgroundColor: "#4C97E7",
}, },
info:{} info: {},
totype: 0,
list: [],
show: false
} }
@ -194,58 +212,92 @@
} }
}, },
methods: { methods: {
topage(num){ topage(num) {
if(num==0){ if (num == 0) {
// uni.navigateTo({ // uni.navigateTo({
// url:'' // url:''
// }) // })
}else if(num==1){ } else if (num == 1) {
uni.navigateTo({ uni.navigateTo({
url:'/page_user/yj' url: '/page_user/yj'
}) })
}else if(num==2){ } else if (num == 2) {
uni.navigateTo({ uni.navigateTo({
url:'/page_user/good_list' url: '/page_user/good_list'
}) })
}else if(num==3){ } else if (num == 3) {
uni.navigateTo({ uni.navigateTo({
url:'/page_user/qsrecord' url: '/page_user/qsrecord'
}) })
}else if(num==4){ } else if (num == 4) {
uni.navigateTo({ uni.navigateTo({
url:'/page_user/yczn' url: '/page_user/yczn'
}) })
} } else if (num == 5) {
else if(num==5){
uni.navigateTo({ uni.navigateTo({
url:'/page_user/jfgz' url: '/page_user/jfgz'
}) })
}else if(num==8){ } else if (num == 8) {
this.totype = 1
if(this.list.length<2){
uni.setStorageSync('adminAreaid', this.list[0].value);
uni.navigateTo({ uni.navigateTo({
url:'/page_fix/fix_index' url:'/page_fix/fix_index'
}) })
}else if(num==9){
}else{
this.show = true
}
} else if (num == 9) {
this.totype = 2
if(this.list.length<2){
uni.setStorageSync('adminAreaid', this.list[0].value);
uni.navigateTo({ uni.navigateTo({
url:'/pages_admin/admin_index' url:'/pages_admin/admin_index'
}) })
}else if(num==10){ }else{
this.show = true
}
} else if (num == 10) {
uni.navigateTo({ uni.navigateTo({
url:'/page_user/khfw/khfw' url: '/page_user/khfw/khfw'
}) })
} }
}, },
getuserInfo(){ getareaList(){
this.$u.get('/appVerify/getAreaList').then((res) => {
if(res.code==200){
this.list = res.data.map(item => ({
value: item.areaId,
label: item.areaName
}));
}
}).catch(error => {
console.error("Error fetching area data:", error);
});
},
getuserInfo() {
uni.showLoading({ uni.showLoading({
title:'加载中' title: '加载中'
}) })
this.$u.get("/getAppInfo").then((res) => { this.$u.get("/getAppInfo").then((res) => {
if (res.code == 200) { if (res.code == 200) {
uni.hideLoading() uni.hideLoading()
this.$store.commit('SET_USERID', res.user.userId); this.$store.commit('SET_USERID', res.user.userId);
this.info=res.user this.info = res.user
if (info.role != 1) {
this.getareaList()
}
// if( res.user.role==2){ // if( res.user.role==2){
// uni.navigateTo({ // uni.navigateTo({
// url:'/page_fix/fix_index' // url:'/page_fix/fix_index'
@ -253,9 +305,9 @@
// } // }
} else { } else {
let areaId=uni.getStorageSync('areaId'); let areaId = uni.getStorageSync('areaId');
if(areaId){ if (areaId) {
let that =this let that = this
wx.login({ wx.login({
success(res) { success(res) {
if (res.code) { if (res.code) {
@ -265,7 +317,8 @@
}; };
let areaId = uni.getStorageSync('areaId'); let areaId = uni.getStorageSync('areaId');
that.$u.post('/loginByopenid?jsCode=' + res.code + '&areaId=' + areaId).then( that.$u.post('/loginByopenid?jsCode=' + res.code + '&areaId=' +
areaId).then(
res => { res => {
uni.hideLoading(); uni.hideLoading();
if (res.code == 200) { if (res.code == 200) {
@ -290,7 +343,7 @@
}, },
}); });
}else{ } else {
uni.showToast({ uni.showToast({
title: '请授权位置信息后再尝试', title: '请授权位置信息后再尝试',
icon: 'none', icon: 'none',
@ -317,32 +370,38 @@
width: 750rpx; width: 750rpx;
background: #fff; background: #fff;
height: 184rpx; height: 184rpx;
.topbox{
.topbox {
width: 750rpx; width: 750rpx;
background: #4C97E7; background: #4C97E7;
height: 184rpx; height: 184rpx;
border-radius: 0 0 100rpx 0; border-radius: 0 0 100rpx 0;
.info{
.info {
padding-top: 40rpx; padding-top: 40rpx;
margin-left: 100rpx; margin-left: 100rpx;
display: flex; display: flex;
flex-wrap: nowrap; flex-wrap: nowrap;
align-items: center; align-items: center;
image{
image {
width: 90rpx; width: 90rpx;
height: 90rpx; height: 90rpx;
border-radius: 50%; border-radius: 50%;
} }
.cont{
.cont {
margin-left: 40rpx; margin-left: 40rpx;
width: 70%; width: 70%;
.name{
.name {
font-weight: 400; font-weight: 400;
font-size: 32rpx; font-size: 32rpx;
color: #FFFFFF; color: #FFFFFF;
width: 100%; width: 100%;
} }
.phone{
.phone {
margin-top: 4rpx; margin-top: 4rpx;
width: 100%; width: 100%;
font-weight: 400; font-weight: 400;
@ -353,26 +412,29 @@
} }
} }
} }
.btnbg{
.btnbg {
width: 750rpx; width: 750rpx;
background: #4C97E7; background: #4C97E7;
.btnbox{
.btnbox {
padding-top: 36rpx; padding-top: 36rpx;
width: 750rpx; width: 750rpx;
background: #fff; background: #fff;
border-radius: 100rpx 0 0 0; border-radius: 100rpx 0 0 0;
.btncard{ .btncard {
padding: 0 54rpx; padding: 0 54rpx;
margin: 0 auto; margin: 0 auto;
width: 680rpx; width: 680rpx;
// height: 438rpx; // height: 438rpx;
padding: 0 56rpx; padding: 0 56rpx;
background: #FFFFFF; background: #FFFFFF;
box-shadow: 0rpx 10rpx 64rpx 0rpx rgba(0,0,0,0.08); box-shadow: 0rpx 10rpx 64rpx 0rpx rgba(0, 0, 0, 0.08);
border-radius: 34rpx 34rpx 34rpx 34rpx; border-radius: 34rpx 34rpx 34rpx 34rpx;
.card_li{
.card_li {
padding-top: 18rpx; padding-top: 18rpx;
width: 100%; width: 100%;
display: flex; display: flex;
@ -381,24 +443,27 @@
justify-content: space-between; justify-content: space-between;
border-bottom: 2rpx solid #D8D8D8; border-bottom: 2rpx solid #D8D8D8;
padding-bottom: 26rpx; padding-bottom: 26rpx;
.card_left{
.card_left {
// width: 100%; // width: 100%;
display: flex; display: flex;
flex-wrap: nowrap; flex-wrap: nowrap;
// align-items: center; // align-items: center;
image{ image {
margin-right: 28rpx; margin-right: 28rpx;
width: 40rpx; width: 40rpx;
height: 40rpx; height: 40rpx;
} }
.text{
.text {
margin-right: 24rpx; margin-right: 24rpx;
font-weight: 400; font-weight: 400;
font-size: 28rpx; font-size: 28rpx;
color: #3D3D3D; color: #3D3D3D;
} }
.tip{
.tip {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
@ -411,7 +476,8 @@
color: #FA5F5F; color: #FA5F5F;
} }
} }
.icon-xiangyou1{
.icon-xiangyou1 {
font-size: 42rpx; font-size: 42rpx;
color: #3D3D3D; color: #3D3D3D;
} }

View File

@ -164,10 +164,20 @@
}); });
this.getareaid() // this.getareaid()
if(uni.getStorageSync('adminAreaid')){
this.areaId = uni.getStorageSync('adminAreaid')
this.getArea()
this.allVehicleNum()
}
// this.getmarks();
},
onLoad() {
let that = this let that = this
uni.getLocation({ uni.getLocation({
type: 'wgs84', type: 'wgs84',
@ -194,11 +204,6 @@
} }
}) })
// this.getmarks();
},
onLoad() {
}, },
computed: { computed: {
userId() { userId() {
@ -216,8 +221,8 @@
latitude: parseFloat(item.latitude), latitude: parseFloat(item.latitude),
longitude: parseFloat(item.longitude), longitude: parseFloat(item.longitude),
width: 20, width: 20,
height: 40, height: 28.95,
iconPath: 'https://lxnapi.ccttiot.com/bike/img/static/u9yz0bKCWKyev0JYpTne', iconPath: item.type == 1 ?'https://lxnapi.ccttiot.com/bike/img/static/up2xXqAgwCX5iER600k3':item.type == 2 ?'https://lxnapi.ccttiot.com/bike/img/static/u53BAQcFIX3vxsCzEZ7t' :' https://lxnapi.ccttiot.com/bike/img/static/uDNY5Q4zOiZTCBTA2Jdq',
callout: { callout: {
content: item.parkingName, content: item.parkingName,
color: '#ffffff', color: '#ffffff',
@ -243,10 +248,7 @@
if (res.code == 200) { if (res.code == 200) {
// 线 // 线
// this.areaId=res.data // this.areaId=res.data
this.areaId = 14
this.getArea()
this.allVehicleNum()
// console.log(this.polyline); // console.log(this.polyline);
} else { } else {
this.areaId = 14 this.areaId = 14
@ -500,7 +502,7 @@
powerStart: this.rangeValue[0], powerStart: this.rangeValue[0],
powerEnd: this.rangeValue[1], powerEnd: this.rangeValue[1],
sort: 'desc', sort: 'desc',
areaId: this.areaId
} }
if (this.statusidx != 7 && this.statusidx != 9) { if (this.statusidx != 7 && this.statusidx != 9) {
data.status = this.statusidx data.status = this.statusidx
@ -662,24 +664,22 @@
getArea() { getArea() {
//
let data = {
areaId: this.areaId
}
this.$u.get('/app/area/list?', data).then((res) => {
if (res.code === 200) {
// 线
const polylines = res.rows
.filter(area => area.boundaryStr) // boundary
.map(area => this.convertBoundaryToPolyline(area.boundaryStr));
// 线
this.polyline = polylines;
let id = this.areaId
this.$u.get("/app/area/" + id).then((res) => {
if (res.code == 200) {
// this.areaInfo = res.data
const polylines = this.convertBoundaryToPolyline(res.data.boundaryStr)
this.polyline.push(polylines)
this.getmarks() this.getmarks()
// console.log(this.polyline); } else {
uni.showToast({
title: res.msg,
icon: 'none',
duration: 2000
});
} }
}).catch(error => {
console.error("Error fetching area data:", error);
}); });
}, },
convertBoundaryToPolylines(boundaries, num) { convertBoundaryToPolylines(boundaries, num) {
@ -770,7 +770,11 @@
}, },
getParking() { getParking() {
// //
this.$u.get('/app/parking/list').then((res) => { let data = {
areaId: this.areaId
}
this.$u.get('/app/parking/list?',data).then((res) => {
if (res.code === 200) { if (res.code === 200) {
// //
const type1Data = []; const type1Data = [];

View File

@ -1,6 +1,6 @@
<template> <template>
<view class="page"> <view class="page">
<u-navbar :is-back="false" title="设备管理" :border-bottom="false" :background="bgc" title-color='#2E4975' <u-navbar :is-back="false" title="订单管理" :border-bottom="false" :background="bgc" title-color='#2E4975'
title-size='36' height='45'></u-navbar> title-size='36' height='45'></u-navbar>
<view class="top_box"> <view class="top_box">
<view class="left_text"> <view class="left_text">
@ -80,12 +80,10 @@
<view class="half_info_li"> <view class="half_info_li">
车辆编号{{item.sn}} 车辆编号{{item.sn}}
</view> </view>
<view class="half_info_li" v-if="item.returnTime"> <view class="half_info_li" >
租赁时长{{computedList(item)}} 租赁时长{{computedList(item)}}
</view> </view>
<view class="half_info_li" v-else>
租赁时长--
</view>
</view> </view>
<view class="info_li"> <view class="info_li">
订单费用{{item.totalFee}} 订单费用{{item.totalFee}}
@ -150,12 +148,10 @@
<view class="half_info_li"> <view class="half_info_li">
车辆编号{{item.sn}} 车辆编号{{item.sn}}
</view> </view>
<view class="half_info_li" v-if="item.returnTime"> <view class="half_info_li" >
租赁时长{{computedList(item)}} 租赁时长{{computedList(item)}}
</view> </view>
<view class="half_info_li" v-else>
租赁时长--
</view>
</view> </view>
<view class="info_li"> <view class="info_li">
订单费用{{item.totalFee}} 订单费用{{item.totalFee}}
@ -218,12 +214,9 @@
<view class="half_info_li"> <view class="half_info_li">
车辆编号{{item.sn}} 车辆编号{{item.sn}}
</view> </view>
<view class="half_info_li" v-if="item.returnTime"> <view class="half_info_li" >
租赁时长{{computedList(item)}} 租赁时长{{computedList(item)}}
</view> </view>
<view class="half_info_li" v-else>
租赁时长--
</view>
</view> </view>
<view class="info_li"> <view class="info_li">
订单费用{{item.totalFee}} 订单费用{{item.totalFee}}
@ -287,12 +280,9 @@
<view class="half_info_li"> <view class="half_info_li">
车辆编号{{item.sn}} 车辆编号{{item.sn}}
</view> </view>
<view class="half_info_li" v-if="item.returnTime"> <view class="half_info_li" >
租赁时长{{computedList(item)}} 租赁时长{{computedList(item)}}
</view> </view>
<view class="half_info_li" v-else>
租赁时长--
</view>
</view> </view>
<view class="info_li"> <view class="info_li">
订单费用{{item.totalFee}} 订单费用{{item.totalFee}}
@ -503,7 +493,8 @@
loading: false, loading: false,
initialValues: { initialValues: {
} },
areaId:false
} }
}, },
@ -512,10 +503,12 @@
// ... // ...
}); });
if(uni.getStorageSync('adminAreaid')){
this.areaId = uni.getStorageSync('adminAreaid')
this.orderList() this.orderList()
// this.orderList1() }
// this.orderList2()
// this.orderList3()
}, },
watch: { watch: {
curtitidx(newValue, oldValue) { curtitidx(newValue, oldValue) {
@ -542,6 +535,26 @@
}, },
methods: { methods: {
computedList(item) { computedList(item) {
if(item.status==0||item.status==2){
const createTime = new Date(item.createTime);
const payTime = Date.now();
const timeDifference = Math.abs(createTime - payTime);
const hours = Math.floor(timeDifference / (1000 * 60 * 60));
const minutes = Math.floor((timeDifference % (1000 * 60 * 60)) / (1000 * 60));
const seconds = Math.floor((timeDifference % (1000 * 60)) / 1000);
let result = '';
if (hours > 0) {
result += `${hours}小时`;
}
if (minutes > 0 || hours > 0) { //
result += `${minutes}`;
}
// result += `${seconds}`; //
return result;
}else{
const createTime = new Date(item.createTime); const createTime = new Date(item.createTime);
const payTime = new Date(item.returnTime); const payTime = new Date(item.returnTime);
const timeDifference = Math.abs(createTime - payTime); const timeDifference = Math.abs(createTime - payTime);
@ -550,7 +563,18 @@
const minutes = Math.floor((timeDifference % (1000 * 60 * 60)) / (1000 * 60)); const minutes = Math.floor((timeDifference % (1000 * 60 * 60)) / (1000 * 60));
const seconds = Math.floor((timeDifference % (1000 * 60)) / 1000); const seconds = Math.floor((timeDifference % (1000 * 60)) / 1000);
return `${minutes}分钟${seconds}` let result = '';
if (hours > 0) {
result += `${hours}小时`;
}
if (minutes > 0 || hours > 0) { //
result += `${minutes}`;
}
// result += `${seconds}`; //
return result;
}
}, },
toOrderDetail(id) { toOrderDetail(id) {
uni.navigateTo({ uni.navigateTo({
@ -703,7 +727,7 @@
status: '', status: '',
startTime: this.firsTime, startTime: this.firsTime,
endTime: this.lasTime, endTime: this.lasTime,
areaId:this.areaId
} }
@ -728,7 +752,7 @@
statusList: '0,2', statusList: '0,2',
startTime: this.firsTime, startTime: this.firsTime,
endTime: this.lasTime, endTime: this.lasTime,
areaId:this.areaId
} }
this.loading = false this.loading = false
this.$u.get('/appVerify/order/list?', data).then((res) => { this.$u.get('/appVerify/order/list?', data).then((res) => {
@ -750,7 +774,7 @@
statusList: '1,3', statusList: '1,3',
startTime: this.firsTime, startTime: this.firsTime,
endTime: this.lasTime, endTime: this.lasTime,
areaId:this.areaId
} }
this.loading = false this.loading = false
@ -773,7 +797,7 @@
status: '4', status: '4',
startTime: this.firsTime, startTime: this.firsTime,
endTime: this.lasTime, endTime: this.lasTime,
areaId:this.areaId

View File

@ -2,8 +2,17 @@
<view class="page"> <view class="page">
<u-navbar title="设备详情" :border-bottom="false" :background="bgc" title-color='#2E4975' title-size='36' <u-navbar title="设备详情" :border-bottom="false" :background="bgc" title-color='#2E4975' title-size='36'
height='45'></u-navbar> height='45'></u-navbar>
<!-- <view class="map">
</view> -->
<map class="map" id="map" ref="map" :scale="zoomSize" :latitude="latitude" :longitude="longitude" <map class="map" id="map" ref="map" :scale="zoomSize" :latitude="latitude" :longitude="longitude"
:show-location="true" :markers="markers" :polygons="polyline" ></map> :show-location="true" :markers="markers" :polygons="polyline" >
<cover-view class="park" @click="toggleIconAndCallout">
<cover-image class="img" src="https://lxnapi.ccttiot.com/bike/img/static/uRiYQZQEb3l2LsltEsyW" mode=""></cover-image>
</cover-view>
</map>
<view class="info_card"> <view class="info_card">
<view class="info_tit"> <view class="info_tit">
设备信息 设备信息
@ -644,24 +653,6 @@
this.tishiflag = false this.tishiflag = false
}, },
btn(num){ btn(num){
if(num==0){ if(num==0){
this.$u.post('/appVerify/admin/unlocking?sn='+this.sn).then((res) => { this.$u.post('/appVerify/admin/unlocking?sn='+this.sn).then((res) => {
@ -976,6 +967,38 @@
}).filter(polyline => polyline !== null); // 线 }).filter(polyline => polyline !== null); // 线
} }
},
toggleIconAndCallout() {
this.showIconAndCallout = !this.showIconAndCallout;
if (this.showIconAndCallout) {
const newMarkers = [];
this.parkingList.forEach(item => {
newMarkers.push({
id: parseFloat(item.parkingId),
latitude: parseFloat(item.latitude),
longitude: parseFloat(item.longitude),
width: 20,
height: 28.95,
iconPath: item.type == 1 ?'https://lxnapi.ccttiot.com/bike/img/static/up2xXqAgwCX5iER600k3':item.type == 2 ?'https://lxnapi.ccttiot.com/bike/img/static/u53BAQcFIX3vxsCzEZ7t' :' https://lxnapi.ccttiot.com/bike/img/static/uDNY5Q4zOiZTCBTA2Jdq',
callout: {
content: item.parkingName,
color: '#ffffff',
fontSize: 14,
borderRadius: 10,
bgColor: item.type == 1 ? '#3A7EDB' : item.type == 2 ? '#FFC107' :
'#FF473E',
padding: 6,
display: 'ALWAYS'
},
isCalloutVisible: true //
});
});
this.$set(this, 'markers', [...this.markers, ...newMarkers]);
} else {
//
this.$set(this, 'markers', this.markers.filter(marker => !marker.isCalloutVisible));
}
}, },
getParking() { getParking() {
// //
@ -1011,65 +1034,9 @@
this.polyline = this.polyline.concat(polylines2); this.polyline = this.polyline.concat(polylines2);
this.polyline = this.polyline.concat(polylines1); this.polyline = this.polyline.concat(polylines1);
this.polyline = this.polyline.concat(polylines); this.polyline = this.polyline.concat(polylines);
this.parkingList = res.rows
// console.log(this.polyline); // console.log(this.polyline);
res.rows.forEach(item => {
if(item.type==1){
this.markers.push({
id: parseFloat(item.parkingId),
latitude: parseFloat(item.latitude),
longitude: parseFloat(item.longitude),
width: 20,
height: 40,
iconPath: 'https://lxnapi.ccttiot.com/bike/img/static/u9yz0bKCWKyev0JYpTne',
callout: {
content: item.parkingName, //
color: '#ffffff', //
fontSize: 14, //
borderRadius: 10, //
bgColor: '#3A7EDB', //
padding: 6, //
display: 'ALWAYS' //
}
});
}else if(item.type==2){
this.markers.push({
id: parseFloat(item.parkingId),
latitude: parseFloat(item.latitude),
longitude: parseFloat(item.longitude),
width: 20,
height: 40,
iconPath: 'https://lxnapi.ccttiot.com/bike/img/static/u9yz0bKCWKyev0JYpTne',
callout: {
content: item.parkingName, //
color: '#ffffff', //
fontSize: 14, //
borderRadius: 10, //
bgColor: '#FFC107', //
padding: 6, //
display: 'ALWAYS' //
}
});
}else if(item.type==3){
this.markers.push({
id: parseFloat(item.parkingId),
latitude: parseFloat(item.latitude),
longitude: parseFloat(item.longitude),
width: 20,
height: 40,
iconPath: 'https://lxnapi.ccttiot.com/bike/img/static/u9yz0bKCWKyev0JYpTne',
callout: {
content: item.parkingName, //
color: '#ffffff', //
fontSize: 14, //
borderRadius: 10, //
bgColor: '#FF473E', //
padding: 6, //
display: 'ALWAYS' //
}
});
}
})
} }
}).catch(error => { }).catch(error => {
console.error("Error fetching parking data:", error); console.error("Error fetching parking data:", error);
@ -1107,9 +1074,29 @@
width: 750rpx; width: 750rpx;
.map { .map {
position: relative;
width: 750rpx; width: 750rpx;
height: 752rpx; height: 752rpx;
.park {
position: absolute;
display: flex;
align-items: center;
justify-content: center;
right: 30rpx;
bottom: 40rpx;
// background-color: #fff;
border-radius: 50%;
width: 82rpx;
height: 82rpx;
z-index: 10;
.img {
width: 82rpx;
height: 82rpx;
} }
}
}
.tip_box { .tip_box {
position: fixed; position: fixed;
left: 72rpx; left: 72rpx;

View File

@ -13,9 +13,21 @@
<view class="info_li"> <view class="info_li">
订单编号<span>{{orderInfo.orderNo}}</span> 订单编号<span>{{orderInfo.orderNo}}</span>
</view> </view>
<!-- <view class="info_li">
</view> -->
<view class="info_li"> <view class="info_li">
<view class="half_infoli " @click="callPhone">
租赁用户<span style="color:#4C97E7 ;">{{orderInfo.phonenumber}}</span> 租赁用户<span style="color:#4C97E7 ;">{{orderInfo.phonenumber}}</span>
</view> </view>
<view class="half_infoli">
用户姓名<span v-if="orderInfo.realName">{{orderInfo.realName}}</span>
<span v-else>--</span>
</view>
</view>
<view class="info_li">
订单状态<span>{{status()}}</span>
</view>
<view class="info_li"> <view class="info_li">
<view class="half_infoli"> <view class="half_infoli">
租赁时长<span>{{ computedList(orderInfo)}}</span> 租赁时长<span>{{ computedList(orderInfo)}}</span>
@ -224,7 +236,32 @@
}, },
methods: { methods: {
callPhone(){
uni.makePhoneCall({
phoneNumber:this.orderInfo.phonenumber
})
},
computedList(item) { computedList(item) {
if(item.status==0||item.status==2){
const createTime = new Date(item.createTime);
const payTime = Date.now();
const timeDifference = Math.abs(createTime - payTime);
const hours = Math.floor(timeDifference / (1000 * 60 * 60));
const minutes = Math.floor((timeDifference % (1000 * 60 * 60)) / (1000 * 60));
const seconds = Math.floor((timeDifference % (1000 * 60)) / 1000);
let result = '';
if (hours > 0) {
result += `${hours}小时`;
}
if (minutes > 0 || hours > 0) { //
result += `${minutes}`;
}
// result += `${seconds}`; //
return result;
}else{
const createTime = new Date(item.createTime); const createTime = new Date(item.createTime);
const payTime = new Date(item.returnTime); const payTime = new Date(item.returnTime);
const timeDifference = Math.abs(createTime - payTime); const timeDifference = Math.abs(createTime - payTime);
@ -233,7 +270,19 @@
const minutes = Math.floor((timeDifference % (1000 * 60 * 60)) / (1000 * 60)); const minutes = Math.floor((timeDifference % (1000 * 60 * 60)) / (1000 * 60));
const seconds = Math.floor((timeDifference % (1000 * 60)) / 1000); const seconds = Math.floor((timeDifference % (1000 * 60)) / 1000);
return `${minutes}分钟${seconds}` let result = '';
if (hours > 0) {
result += `${hours}小时`;
}
if (minutes > 0 || hours > 0) { //
result += `${minutes}`;
}
// result += `${seconds}`; //
return result;
}
}, },
convertBoundaryToPolyline(boundary) { convertBoundaryToPolyline(boundary) {
if (!boundary) return null; if (!boundary) return null;
@ -463,7 +512,7 @@
} else if (this.orderInfo.status == 1) { } else if (this.orderInfo.status == 1) {
return '取消预约' return '取消预约'
} else if (this.orderInfo.status == 2) { } else if (this.orderInfo.status == 2) {
return '开始骑行' return '骑行'
} else if (this.orderInfo.status == 3) { } else if (this.orderInfo.status == 3) {
return '骑行结束' return '骑行结束'
} else if (this.orderInfo.status == 4) { } else if (this.orderInfo.status == 4) {
@ -711,13 +760,17 @@
} }
.info_lis { .info_lis {
width: 90%;
display: inline-block; display: inline-block;
// flex-wrap: nowrap; // flex-wrap: nowrap;
font-weight: 400; font-weight: 400;
font-size: 28rpx; font-size: 28rpx;
color: #808080; color: #808080;
white-space: nowrap;
/* 禁止换行 */
overflow: hidden;
/* 超出部分隐藏 */
text-overflow: ellipsis;
.text { .text {
display: inline; display: inline;
// width: 70%; // width: 70%;

View File

@ -79,7 +79,14 @@
typeindex:0, typeindex:0,
show:false, show:false,
searchKeyword:'', searchKeyword:'',
searchList:[] searchList:[],
areaId:null
}
},
onShow() {
if(uni.getStorageSync('adminAreaid')){
this.areaId = uni.getStorageSync('adminAreaid')
} }
}, },
methods: { methods: {
@ -91,9 +98,10 @@
getSearch(){ getSearch(){
let data={ let data={
type:this.typeidx, type:this.typeidx,
key:this.searchKeyword key:this.searchKeyword,
areaId:this.areaId
} }
this.$u.get(`/appVerify/device/search?`, data).then((res) => { this.$u.get(`/app/device/search?`, data).then((res) => {
if (res.code == 200) { if (res.code == 200) {
this.searchList=res.data this.searchList=res.data

View File

@ -333,7 +333,8 @@
powerStart: '', powerStart: '',
powerEnd: '', powerEnd: '',
sort: this.scidx, sort: this.scidx,
status: this.typeidx status: this.typeidx,
} }
this.selectedItems = []; this.selectedItems = [];