fix:修改维修页面样式及功能
This commit is contained in:
parent
59f3f8c908
commit
0ea119cd1d
File diff suppressed because it is too large
Load Diff
@ -1,163 +1,178 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="uni-common-mt container">
|
<view class="uni-common-mt container">
|
||||||
<view class="title">欢迎使用景上运维</view>
|
<view class="title">欢迎使用景上运维</view>
|
||||||
|
|
||||||
<!-- 用户名输入框 -->
|
<!-- 用户名输入框 -->
|
||||||
<view class="input-group">
|
<view class="input-group">
|
||||||
<uni-easyinput v-model="userName" placeholder="请输入用户名"></uni-easyinput>
|
<uni-easyinput
|
||||||
</view>
|
v-model="userName"
|
||||||
|
placeholder="请输入用户名"
|
||||||
|
></uni-easyinput>
|
||||||
|
</view>
|
||||||
|
|
||||||
<!-- 密码输入框-->
|
<!-- 密码输入框-->
|
||||||
<view class="input-group">
|
<view class="input-group">
|
||||||
<uni-easyinput type="password" v-model="passWord" placeholder="请输入密码"></uni-easyinput>
|
<uni-easyinput
|
||||||
</view>
|
type="password"
|
||||||
<!-- 登录按钮 -->
|
v-model="passWord"
|
||||||
<button type="primary" class="login-button" @click="login"><span>立即登录</span></button>
|
placeholder="请输入密码"
|
||||||
</view>
|
></uni-easyinput>
|
||||||
|
</view>
|
||||||
|
<!-- 登录按钮 -->
|
||||||
|
<button
|
||||||
|
type="primary"
|
||||||
|
class="login-button"
|
||||||
|
:disabled="isLogin"
|
||||||
|
@click="login"
|
||||||
|
>
|
||||||
|
<span>立即登录</span>
|
||||||
|
</button>
|
||||||
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import {
|
import { getCurrentInstance, ref } from "vue";
|
||||||
getCurrentInstance,
|
import {
|
||||||
ref
|
login as reqLogin,
|
||||||
} from 'vue';
|
getUserZone,
|
||||||
import {
|
getUserOperation,
|
||||||
login as reqLogin,
|
getUserRegion,
|
||||||
getUserZone,
|
} from "../../utils/api";
|
||||||
getUserOperation,
|
export default {
|
||||||
getUserRegion
|
setup() {
|
||||||
} from '../../utils/api';
|
const userName = ref("");
|
||||||
export default {
|
const passWord = ref("");
|
||||||
setup() {
|
const isLogin = ref(false);
|
||||||
const userName = ref('');
|
// 登录功能
|
||||||
const passWord = ref('');
|
const login = () => {
|
||||||
// 登录功能
|
uni.showLoading({
|
||||||
const login = () => {
|
title: "登录中...",
|
||||||
if (!userName.value || !passWord.value) {
|
});
|
||||||
uni.showToast({
|
isLogin.value = true;
|
||||||
title: '请输入完整信息',
|
if (!userName.value || !passWord.value) {
|
||||||
icon: 'none',
|
uni.showToast({
|
||||||
});
|
title: "请输入完整信息",
|
||||||
return;
|
icon: "none",
|
||||||
}
|
});
|
||||||
const param = {
|
return;
|
||||||
"username": userName.value,
|
}
|
||||||
"password": passWord.value
|
const param = {
|
||||||
};
|
username: userName.value,
|
||||||
// uni.switchTab({
|
password: passWord.value,
|
||||||
// url: '/pages/home/home', // 替换为你的Tab页面路径
|
};
|
||||||
// });
|
// uni.switchTab({
|
||||||
// return;
|
// url: '/pages/home/home', // 替换为你的Tab页面路径
|
||||||
// 使用请求方法
|
// });
|
||||||
reqLogin(param).then(
|
// return;
|
||||||
(res) => {
|
// 使用请求方法
|
||||||
if (res.code==200) {
|
reqLogin(param).then(
|
||||||
// 登录成功
|
(res) => {
|
||||||
uni.setStorageSync('token', res.data.token);
|
uni.hideLoading();
|
||||||
uni.setStorageSync('userInfo', res.data.staff);
|
isLogin.value = false;
|
||||||
uni.setStorageSync('permCodes', res.data.permCodes);
|
if (res.code == 200) {
|
||||||
if(res.data.permCodes.length == 0){
|
// 登录成功
|
||||||
uni.showToast({
|
uni.setStorageSync("token", res.data.token);
|
||||||
title: '该用户没有权限',
|
uni.setStorageSync("userInfo", res.data.staff);
|
||||||
icon: 'none',
|
uni.setStorageSync("permCodes", res.data.permCodes);
|
||||||
});
|
if (res.data.permCodes.length == 0) {
|
||||||
}
|
uni.showToast({
|
||||||
else if (res.data.permCodes.includes('maintenance.applet') === -1) {
|
title: "该用户没有权限",
|
||||||
uni.showToast({
|
icon: "none",
|
||||||
title: '该用户没有权限',
|
});
|
||||||
icon: 'none',
|
} else if (
|
||||||
});
|
res.data.permCodes.includes("maintenance.applet") === -1
|
||||||
}
|
) {
|
||||||
else
|
uni.showToast({
|
||||||
{
|
title: "该用户没有权限",
|
||||||
uni.showToast({
|
icon: "none",
|
||||||
title: '登录成功',
|
});
|
||||||
icon: 'success',
|
} else {
|
||||||
});
|
uni.showToast({
|
||||||
getUserZone().then(res => {
|
title: "登录成功",
|
||||||
if(res.code == 200){
|
icon: "success",
|
||||||
uni.setStorageSync('userZone', res.data);
|
});
|
||||||
getUserOperation().then(res => {
|
getUserZone().then((res) => {
|
||||||
if(res.code == 200){
|
if (res.code == 200) {
|
||||||
uni.setStorageSync('userOperation', res.data);
|
uni.setStorageSync("userZone", res.data);
|
||||||
if(res.data.length > 0){
|
getUserOperation().then((res) => {
|
||||||
uni.setStorageSync('userDefultOperation', res.data[0]);
|
if (res.code == 200) {
|
||||||
}
|
uni.setStorageSync("userOperation", res.data);
|
||||||
// 登录成功后跳转到Home Tab页面
|
if (res.data.length > 0) {
|
||||||
uni.switchTab({
|
uni.setStorageSync("userDefultOperation", res.data[0]);
|
||||||
url: '/pages/mine/mine', // 替换为你的Tab页面路径
|
}
|
||||||
});
|
// 登录成功后跳转到Home Tab页面
|
||||||
}
|
uni.switchTab({
|
||||||
else
|
url: "/pages/mine/mine", // 替换为你的Tab页面路径
|
||||||
{
|
});
|
||||||
uni.showToast({
|
} else {
|
||||||
title: '获取用户区域信息失败',
|
uni.showToast({
|
||||||
icon: 'none',
|
title: "获取用户区域信息失败",
|
||||||
});
|
icon: "none",
|
||||||
}
|
});
|
||||||
});
|
}
|
||||||
}
|
});
|
||||||
else
|
} else {
|
||||||
{
|
uni.showToast({
|
||||||
uni.showToast({
|
title: "获取用户区域信息失败",
|
||||||
title: '获取用户区域信息失败',
|
icon: "none",
|
||||||
icon: 'none',
|
});
|
||||||
});
|
}
|
||||||
}
|
});
|
||||||
});
|
}
|
||||||
}
|
} else {
|
||||||
} else {
|
console.log("OK3--user/login登录失败");
|
||||||
console.log('OK3--user/login登录失败');
|
uni.showToast({
|
||||||
uni.showToast({
|
title: "登录失败",
|
||||||
title: '登录失败',
|
icon: "none",
|
||||||
icon: 'none',
|
});
|
||||||
});
|
}
|
||||||
}
|
},
|
||||||
},
|
(error) => {
|
||||||
(error) => {
|
console.log("登录异常--user/login");
|
||||||
console.log('登录异常--user/login');
|
uni.hideLoading();
|
||||||
uni.showToast({
|
isLogin.value = false;
|
||||||
title: '登录失败',
|
uni.showToast({
|
||||||
icon: 'none',
|
title: "登录失败",
|
||||||
});
|
icon: "none",
|
||||||
}
|
});
|
||||||
);
|
}
|
||||||
};
|
);
|
||||||
|
};
|
||||||
return {
|
|
||||||
userName,
|
return {
|
||||||
passWord,
|
userName,
|
||||||
login
|
passWord,
|
||||||
};
|
login,
|
||||||
},
|
isLogin,
|
||||||
};
|
};
|
||||||
|
},
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.container {
|
.container {
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.container .title {
|
.container .title {
|
||||||
font-size: 20px;
|
font-size: 20px;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
letter-spacing: 3px;
|
letter-spacing: 3px;
|
||||||
margin-top: 20%;
|
margin-top: 20%;
|
||||||
margin-bottom: 30%;
|
margin-bottom: 30%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.input-group {
|
.input-group {
|
||||||
margin-bottom: 30px;
|
margin-bottom: 30px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.input-container {
|
.input-container {
|
||||||
display: flex;
|
display: flex;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.login-button {
|
||||||
.login-button {
|
margin-top: 80px;
|
||||||
margin-top: 80px;
|
background-color: #007aff;
|
||||||
background-color: #007aff;
|
}
|
||||||
}
|
</style>
|
||||||
</style>
|
|
||||||
|
|||||||
@ -1,85 +1,83 @@
|
|||||||
.divLowerLeft {
|
.divLowerLeft {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
z-index: 100;
|
z-index: 100;
|
||||||
left: 10px;
|
left: 10px;
|
||||||
bottom: 30vh;
|
bottom: 30vh;
|
||||||
}
|
}
|
||||||
|
|
||||||
.divBtn {
|
.divBtn {
|
||||||
background-color: white;
|
background-color: white;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
margin-bottom: 5px;
|
margin-bottom: 5px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
border: 1px solid #80808061;
|
border: 1px solid #80808061;
|
||||||
padding: 0px 5px;
|
padding: 0px 5px;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.divBtnTitle {
|
.divBtnTitle {
|
||||||
padding-top: 10px;
|
padding-top: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.lbWorn {
|
.lbWorn {
|
||||||
color: red;
|
color: red;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.divBottom {
|
.divBottom {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
z-index: 100;
|
z-index: 100;
|
||||||
bottom: 0px;
|
bottom: 0px;
|
||||||
background: white;
|
background: white;
|
||||||
width: 100vw;
|
width: 100vw;
|
||||||
padding: 15px;
|
padding: 15px;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.divSiteInfo {
|
.divSiteInfo {
|
||||||
z-index: 100;
|
z-index: 100;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
bottom: 0px;
|
bottom: 0px;
|
||||||
background: white;
|
background: white;
|
||||||
width: 100vw;
|
width: 100vw;
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
border-radius: 15px;
|
border-radius: 15px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.divClose {
|
.divClose {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
right: 3px;
|
right: 3px;
|
||||||
top: -10px;
|
top: -10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.divName {
|
.divName {
|
||||||
display: flex;
|
display: flex;
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
line-height: 20px;
|
line-height: 20px;
|
||||||
margin-top: 15px;
|
margin-top: 15px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.divAdrress {
|
.divAdrress {
|
||||||
margin-top: 5px;
|
margin-top: 5px;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
font-weight: 300;
|
font-weight: 300;
|
||||||
}
|
}
|
||||||
|
|
||||||
.divCountRow {
|
.divCountRow {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
margin-top: 10px;
|
margin-top: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.divCountRow .divCount {
|
.divCountRow .divCount {
|
||||||
font-size: 20px;
|
font-size: 20px;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.divCountRow .divTitle {
|
.divCountRow .divTitle {
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
font-weight: 300;
|
font-weight: 300;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -359,35 +359,55 @@ const onRingClick = (bikeCode) => {
|
|||||||
title: "指令下发中...",
|
title: "指令下发中...",
|
||||||
mask: true,
|
mask: true,
|
||||||
});
|
});
|
||||||
api.callEbikeInfo("getBikeINfoData?bikeCode=" + bikeCode).then((res) => {
|
console.log(1111);
|
||||||
if (res.code == 200) {
|
|
||||||
const ecuId = res.data.ecuId;
|
api
|
||||||
const bikeId = res.data.bikeId;
|
.callEbikeInfo("getBikeINfoData?bikeCode=" + bikeCode)
|
||||||
// 处理开锁逻辑
|
.then((res) => {
|
||||||
api
|
console.log(res);
|
||||||
.callCoreApi(
|
if (res.code == 200) {
|
||||||
"findEbike?ecuId=" + ecuId + "&bikeId=" + bikeId,
|
const ecuId = res.data.ecuId;
|
||||||
{},
|
const bikeId = res.data.bikeId;
|
||||||
"get"
|
// 处理开锁逻辑
|
||||||
)
|
api
|
||||||
.then((res) => {
|
.callCoreApi(
|
||||||
uni.hideLoading();
|
"findEbike?ecuId=" + ecuId + "&bikeId=" + bikeId,
|
||||||
var title = res.data.message;
|
{},
|
||||||
var icon = "";
|
"get"
|
||||||
if (res.data.code == 200) {
|
)
|
||||||
icon = "success";
|
.then((res) => {
|
||||||
} else {
|
uni.hideLoading();
|
||||||
icon = "error";
|
var title = res.data.message;
|
||||||
}
|
var icon = "";
|
||||||
uni.showToast({
|
if (res.data.code == 200) {
|
||||||
title: title,
|
icon = "success";
|
||||||
icon: icon,
|
} else {
|
||||||
duration: 1000,
|
icon = "error";
|
||||||
mask: true,
|
}
|
||||||
|
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>
|
</script>
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user