fix:修改维修页面样式及功能

This commit is contained in:
5g0Wp7Zy 2025-07-29 16:02:45 +08:00
parent 59f3f8c908
commit 0ea119cd1d
4 changed files with 857 additions and 759 deletions

File diff suppressed because it is too large Load Diff

View File

@ -1,163 +1,178 @@
<template>
<view class="uni-common-mt container">
<view class="title">欢迎使用景上运维</view>
<view class="uni-common-mt container">
<view class="title">欢迎使用景上运维</view>
<!-- 用户名输入框 -->
<view class="input-group">
<uni-easyinput v-model="userName" placeholder="请输入用户名"></uni-easyinput>
</view>
<!-- 用户名输入框 -->
<view class="input-group">
<uni-easyinput
v-model="userName"
placeholder="请输入用户名"
></uni-easyinput>
</view>
<!-- 密码输入框-->
<view class="input-group">
<uni-easyinput type="password" v-model="passWord" placeholder="请输入密码"></uni-easyinput>
</view>
<!-- 登录按钮 -->
<button type="primary" class="login-button" @click="login"><span>立即登录</span></button>
</view>
<!-- 密码输入框-->
<view class="input-group">
<uni-easyinput
type="password"
v-model="passWord"
placeholder="请输入密码"
></uni-easyinput>
</view>
<!-- 登录按钮 -->
<button
type="primary"
class="login-button"
:disabled="isLogin"
@click="login"
>
<span>立即登录</span>
</button>
</view>
</template>
<script>
import {
getCurrentInstance,
ref
} from 'vue';
import {
login as reqLogin,
getUserZone,
getUserOperation,
getUserRegion
} from '../../utils/api';
export default {
setup() {
const userName = ref('');
const passWord = ref('');
//
const login = () => {
if (!userName.value || !passWord.value) {
uni.showToast({
title: '请输入完整信息',
icon: 'none',
});
return;
}
const param = {
"username": userName.value,
"password": passWord.value
};
// uni.switchTab({
// url: '/pages/home/home', // Tab
// });
// return;
// 使
reqLogin(param).then(
(res) => {
if (res.code==200) {
//
uni.setStorageSync('token', res.data.token);
uni.setStorageSync('userInfo', res.data.staff);
uni.setStorageSync('permCodes', res.data.permCodes);
if(res.data.permCodes.length == 0){
uni.showToast({
title: '该用户没有权限',
icon: 'none',
});
}
else if (res.data.permCodes.includes('maintenance.applet') === -1) {
uni.showToast({
title: '该用户没有权限',
icon: 'none',
});
}
else
{
uni.showToast({
title: '登录成功',
icon: 'success',
});
getUserZone().then(res => {
if(res.code == 200){
uni.setStorageSync('userZone', res.data);
getUserOperation().then(res => {
if(res.code == 200){
uni.setStorageSync('userOperation', res.data);
if(res.data.length > 0){
uni.setStorageSync('userDefultOperation', res.data[0]);
}
// Home Tab
uni.switchTab({
url: '/pages/mine/mine', // Tab
});
}
else
{
uni.showToast({
title: '获取用户区域信息失败',
icon: 'none',
});
}
});
}
else
{
uni.showToast({
title: '获取用户区域信息失败',
icon: 'none',
});
}
});
}
} else {
console.log('OK3--user/login登录失败');
uni.showToast({
title: '登录失败',
icon: 'none',
});
}
},
(error) => {
console.log('登录异常--user/login');
uni.showToast({
title: '登录失败',
icon: 'none',
});
}
);
};
import { getCurrentInstance, ref } from "vue";
import {
login as reqLogin,
getUserZone,
getUserOperation,
getUserRegion,
} from "../../utils/api";
export default {
setup() {
const userName = ref("");
const passWord = ref("");
const isLogin = ref(false);
//
const login = () => {
uni.showLoading({
title: "登录中...",
});
isLogin.value = true;
if (!userName.value || !passWord.value) {
uni.showToast({
title: "请输入完整信息",
icon: "none",
});
return;
}
const param = {
username: userName.value,
password: passWord.value,
};
// uni.switchTab({
// url: '/pages/home/home', // Tab
// });
// return;
// 使
reqLogin(param).then(
(res) => {
uni.hideLoading();
isLogin.value = false;
if (res.code == 200) {
//
uni.setStorageSync("token", res.data.token);
uni.setStorageSync("userInfo", res.data.staff);
uni.setStorageSync("permCodes", res.data.permCodes);
if (res.data.permCodes.length == 0) {
uni.showToast({
title: "该用户没有权限",
icon: "none",
});
} else if (
res.data.permCodes.includes("maintenance.applet") === -1
) {
uni.showToast({
title: "该用户没有权限",
icon: "none",
});
} else {
uni.showToast({
title: "登录成功",
icon: "success",
});
getUserZone().then((res) => {
if (res.code == 200) {
uni.setStorageSync("userZone", res.data);
getUserOperation().then((res) => {
if (res.code == 200) {
uni.setStorageSync("userOperation", res.data);
if (res.data.length > 0) {
uni.setStorageSync("userDefultOperation", res.data[0]);
}
// Home Tab
uni.switchTab({
url: "/pages/mine/mine", // Tab
});
} else {
uni.showToast({
title: "获取用户区域信息失败",
icon: "none",
});
}
});
} else {
uni.showToast({
title: "获取用户区域信息失败",
icon: "none",
});
}
});
}
} else {
console.log("OK3--user/login登录失败");
uni.showToast({
title: "登录失败",
icon: "none",
});
}
},
(error) => {
console.log("登录异常--user/login");
uni.hideLoading();
isLogin.value = false;
uni.showToast({
title: "登录失败",
icon: "none",
});
}
);
};
return {
userName,
passWord,
login
};
},
};
return {
userName,
passWord,
login,
isLogin,
};
},
};
</script>
<style scoped>
.container {
padding: 10px;
}
.container {
padding: 10px;
}
.container .title {
font-size: 20px;
font-weight: 600;
letter-spacing: 3px;
margin-top: 20%;
margin-bottom: 30%;
}
.container .title {
font-size: 20px;
font-weight: 600;
letter-spacing: 3px;
margin-top: 20%;
margin-bottom: 30%;
}
.input-group {
margin-bottom: 30px;
}
.input-group {
margin-bottom: 30px;
}
.input-container {
display: flex;
width: 100%;
}
.input-container {
display: flex;
width: 100%;
}
.login-button {
margin-top: 80px;
background-color: #007aff;
}
.login-button {
margin-top: 80px;
background-color: #007aff;
}
</style>

View File

@ -1,85 +1,83 @@
.divLowerLeft {
position: absolute;
z-index: 100;
left: 10px;
bottom: 30vh;
position: absolute;
z-index: 100;
left: 10px;
bottom: 30vh;
}
.divBtn {
background-color: white;
font-size: 12px;
border-radius: 5px;
margin-bottom: 5px;
text-align: center;
border: 1px solid #80808061;
padding: 0px 5px;
background-color: white;
font-size: 12px;
border-radius: 5px;
margin-bottom: 5px;
text-align: center;
border: 1px solid #80808061;
padding: 0px 5px;
}
.divBtnTitle {
padding-top: 10px;
padding-top: 10px;
}
.lbWorn {
color: red;
font-size: 14px;
color: red;
font-size: 14px;
}
.divBottom {
position: absolute;
z-index: 100;
bottom: 0px;
background: white;
width: 100vw;
padding: 15px;
font-size: 14px;
position: absolute;
z-index: 100;
bottom: 0px;
background: white;
width: 100vw;
padding: 15px;
font-size: 14px;
}
.divSiteInfo {
z-index: 100;
position: absolute;
bottom: 0px;
background: white;
width: 100vw;
padding: 10px;
border-radius: 15px;
z-index: 100;
position: absolute;
bottom: 0px;
background: white;
width: 100vw;
padding: 10px;
border-radius: 15px;
}
.divClose {
position: absolute;
right: 3px;
top: -10px;
position: absolute;
right: 3px;
top: -10px;
}
.divName {
display: flex;
font-size: 16px;
font-weight: bold;
line-height: 20px;
margin-top: 15px;
display: flex;
font-size: 16px;
font-weight: bold;
line-height: 20px;
margin-top: 15px;
}
.divAdrress {
margin-top: 5px;
font-size: 12px;
font-weight: 300;
margin-top: 5px;
font-size: 12px;
font-weight: 300;
}
.divCountRow {
display: flex;
justify-content: space-between;
margin-bottom: 10px;
text-align: center;
margin-top: 10px;
display: flex;
justify-content: space-between;
margin-bottom: 10px;
text-align: center;
margin-top: 10px;
}
.divCountRow .divCount {
font-size: 20px;
font-weight: bold;
font-size: 20px;
font-weight: bold;
}
.divCountRow .divTitle {
font-size: 14px;
font-weight: 300;
font-size: 14px;
font-weight: 300;
}

View File

@ -359,35 +359,55 @@ const onRingClick = (bikeCode) => {
title: "指令下发中...",
mask: true,
});
api.callEbikeInfo("getBikeINfoData?bikeCode=" + bikeCode).then((res) => {
if (res.code == 200) {
const ecuId = res.data.ecuId;
const bikeId = res.data.bikeId;
//
api
.callCoreApi(
"findEbike?ecuId=" + ecuId + "&bikeId=" + bikeId,
{},
"get"
)
.then((res) => {
uni.hideLoading();
var title = res.data.message;
var icon = "";
if (res.data.code == 200) {
icon = "success";
} else {
icon = "error";
}
uni.showToast({
title: title,
icon: icon,
duration: 1000,
mask: true,
console.log(1111);
api
.callEbikeInfo("getBikeINfoData?bikeCode=" + bikeCode)
.then((res) => {
console.log(res);
if (res.code == 200) {
const ecuId = res.data.ecuId;
const bikeId = res.data.bikeId;
//
api
.callCoreApi(
"findEbike?ecuId=" + ecuId + "&bikeId=" + bikeId,
{},
"get"
)
.then((res) => {
uni.hideLoading();
var title = res.data.message;
var icon = "";
if (res.data.code == 200) {
icon = "success";
} else {
icon = "error";
}
uni.showToast({
title: title,
icon: icon,
duration: 1000,
mask: true,
});
})
.catch((err) => {
console.log(err);
uni.hideLoading();
});
} else {
uni.showToast({
title: res.message,
icon: "error",
duration: 1000,
mask: true,
});
}
});
uni.hideLoading();
}
})
.catch((err) => {
uni.hideLoading();
});
};
</script>