管理员界面对接中
This commit is contained in:
parent
8bfa454681
commit
3f9d75d597
|
@ -0,0 +1,12 @@
|
|||
import request from "@/utils/request";
|
||||
// 首页数据
|
||||
export const GetHomeDataApi = (data) =>
|
||||
request.get("/api/AdminApp/GetHomeData", data);
|
||||
|
||||
// 区域列表
|
||||
export const GetRegionDataListApi = (data) =>
|
||||
request.get("/api/AdminApp/GetRegionDataList", data);
|
||||
|
||||
// 用户数据
|
||||
export const GetUserDataApi = (data) =>
|
||||
request.get("/api/AdminApp/GetUserData", data);
|
|
@ -2,55 +2,31 @@
|
|||
<view class="content">
|
||||
<view class="bg-box">
|
||||
<view class="homo-title">首页</view>
|
||||
<image
|
||||
class="bg-logo"
|
||||
style="width: 200rpx; height: 170rpx"
|
||||
src="/static/adminImg/bg-logo.png"
|
||||
></image>
|
||||
<image
|
||||
class="bg-hi"
|
||||
style="width: 130rpx; height: 50rpx"
|
||||
src="/static/adminImg/logo-hi.png"
|
||||
></image>
|
||||
<image class="bg-logo" style="width: 200rpx; height: 170rpx" src="/static/adminImg/bg-logo.png"></image>
|
||||
<image class="bg-hi" style="width: 130rpx; height: 50rpx" src="/static/adminImg/logo-hi.png"></image>
|
||||
<view style="height: 150rpx"></view>
|
||||
<view class="tip">欢迎使用,张三</view>
|
||||
<view class="desc">欢迎使用巡检管理员端</view>
|
||||
<view class="card">
|
||||
<view class="card-item">
|
||||
<view class="item-title">区域数量 </view>
|
||||
<view class="item-totel">10 </view>
|
||||
<image
|
||||
class="card-img"
|
||||
style="width: 130rpx; height: 130rpx"
|
||||
src="/static/adminImg/card1.png"
|
||||
></image>
|
||||
<view class="item-totel">{{ form.areaCount }} </view>
|
||||
<image class="card-img" style="width: 130rpx; height: 130rpx" src="/static/adminImg/card1.png"></image>
|
||||
</view>
|
||||
<view class="card-item">
|
||||
<view class="item-title">子区域数量 </view>
|
||||
<view class="item-totel">20 </view>
|
||||
<image
|
||||
class="card-img"
|
||||
style="width: 130rpx; height: 130rpx"
|
||||
src="/static/adminImg/card2.png"
|
||||
></image>
|
||||
<view class="item-totel">{{ form.regionCount }} </view>
|
||||
<image class="card-img" style="width: 130rpx; height: 130rpx" src="/static/adminImg/card2.png"></image>
|
||||
</view>
|
||||
<view class="card-item">
|
||||
<view class="item-title">已绑定子区域数 </view>
|
||||
<view class="item-totel">30 </view>
|
||||
<image
|
||||
class="card-img"
|
||||
style="width: 130rpx; height: 130rpx"
|
||||
src="/static/adminImg/card3.png"
|
||||
></image>
|
||||
<view class="item-totel">{{ form.bindnfc }} </view>
|
||||
<image class="card-img" style="width: 130rpx; height: 130rpx" src="/static/adminImg/card3.png"></image>
|
||||
</view>
|
||||
<view class="card-item">
|
||||
<view class="item-title">未绑定子区域数 </view>
|
||||
<view class="item-totel">40 </view>
|
||||
<image
|
||||
class="card-img"
|
||||
style="width: 130rpx; height: 130rpx"
|
||||
src="/static/adminImg/card4.png"
|
||||
></image>
|
||||
<view class="item-totel">{{ form.noBindnfc }} </view>
|
||||
<image class="card-img" style="width: 130rpx; height: 130rpx" src="/static/adminImg/card4.png"></image>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="true" style="display: flex">
|
||||
|
@ -61,19 +37,31 @@
|
|||
</view>
|
||||
</template>
|
||||
<script>
|
||||
import { loginApi } from "@/api/apiList";
|
||||
import { GetHomeDataApi } from "@/api/apiAdmin";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
phone: "13800451500",
|
||||
pwd: "123456",
|
||||
form: {
|
||||
"regionCount": 0,
|
||||
"areaCount": 0,
|
||||
"bindnfc": 0,
|
||||
"noBindnfc": 0
|
||||
}
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
uni.hideLoading(); // 关闭 Loading
|
||||
},
|
||||
onLoad() {},
|
||||
onLoad() { },
|
||||
onShow() {
|
||||
this.getDataFn()
|
||||
},
|
||||
methods: {
|
||||
async getDataFn() {
|
||||
const res = await GetHomeDataApi();
|
||||
console.log(res, "首页数据");
|
||||
Object.assign(this.form, res.data);
|
||||
},
|
||||
testFn() {
|
||||
let u = navigator.userAgent;
|
||||
let isAndroid = u.indexOf("Android") > -1 || u.indexOf("Adr") > -1; //android
|
||||
|
@ -107,23 +95,27 @@ export default {
|
|||
// background-color: skyblue;
|
||||
|
||||
overflow: hidden;
|
||||
|
||||
// padding-bottom: 100rpx;
|
||||
.bg-box {
|
||||
position: relative;
|
||||
// background-color: #528dfe;
|
||||
background: linear-gradient(to bottom, #3179fb, white);
|
||||
height: 650rpx;
|
||||
|
||||
.homo-title {
|
||||
color: white;
|
||||
transform: translateY(30rpx);
|
||||
font-size: 35rpx;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.bg-logo {
|
||||
position: absolute;
|
||||
right: 50rpx;
|
||||
top: 160rpx;
|
||||
}
|
||||
|
||||
.bg-hi {
|
||||
position: absolute;
|
||||
left: 30rpx;
|
||||
|
@ -135,11 +127,13 @@ export default {
|
|||
color: white;
|
||||
font-size: 40rpx;
|
||||
}
|
||||
|
||||
.desc {
|
||||
margin-top: 20rpx;
|
||||
padding-left: 30rpx;
|
||||
color: #ffffff99;
|
||||
}
|
||||
|
||||
.card {
|
||||
// border: 1px solid red;
|
||||
display: grid;
|
||||
|
@ -147,6 +141,7 @@ export default {
|
|||
grid-template-rows: repeat(2, 1fr);
|
||||
gap: 30rpx;
|
||||
padding: 50rpx;
|
||||
|
||||
.card-item {
|
||||
position: relative;
|
||||
// border: 1px solid blue;
|
||||
|
@ -155,12 +150,15 @@ export default {
|
|||
background: linear-gradient(to bottom, white, #e1e9ff);
|
||||
height: 280rpx;
|
||||
padding: 30rpx;
|
||||
|
||||
.item-title {
|
||||
font-size: 30rpx;
|
||||
}
|
||||
|
||||
.item-totel {
|
||||
font-size: 50rpx;
|
||||
}
|
||||
|
||||
.card-img {
|
||||
position: absolute;
|
||||
right: 20rpx;
|
||||
|
|
|
@ -3,27 +3,14 @@
|
|||
<view class="content-title">我的</view>
|
||||
<view class="head">
|
||||
<view class="avatar-box">
|
||||
<u-avatar
|
||||
:src="baseInfo.avatar || '/static/images/avatar.png'"
|
||||
size="140"
|
||||
mode="circle"
|
||||
class="avatar"
|
||||
></u-avatar>
|
||||
<u-avatar :src="'/static/images/avatar.png'" size="140" mode="circle" class="avatar"></u-avatar>
|
||||
</view>
|
||||
<view class="content-name">JuLia James</view>
|
||||
<view class="content-name">{{ userName }}</view>
|
||||
</view>
|
||||
<view class="cell-list-box">
|
||||
<view
|
||||
class="cell-list-item"
|
||||
v-for="item in cellList"
|
||||
@click="toPage(item.path, item)"
|
||||
>
|
||||
<view class="cell-list-item" v-for="item in cellList" @click="toPage(item.path, item)">
|
||||
<view class="cell-list-item-left">
|
||||
<image
|
||||
style="width: 60rpx; height: 60rpx"
|
||||
mode="aspectFit"
|
||||
:src="item.icon"
|
||||
></image>
|
||||
<image style="width: 60rpx; height: 60rpx" mode="aspectFit" :src="item.icon"></image>
|
||||
<text>{{ item.title }}</text>
|
||||
</view>
|
||||
|
||||
|
@ -35,17 +22,9 @@
|
|||
</view>
|
||||
<view class="empty-box"></view>
|
||||
<view class="cell-list-box2">
|
||||
<view
|
||||
class="cell-list-item"
|
||||
v-for="item in cellList2"
|
||||
@click="toPage(item.path, item)"
|
||||
>
|
||||
<view class="cell-list-item" v-for="item in cellList2" @click="toPage(item.path, item)">
|
||||
<view class="cell-list-item-left">
|
||||
<image
|
||||
style="width: 60rpx; height: 60rpx"
|
||||
mode="aspectFit"
|
||||
:src="item.icon"
|
||||
></image>
|
||||
<image style="width: 60rpx; height: 60rpx" mode="aspectFit" :src="item.icon"></image>
|
||||
<text>{{ item.title }}</text>
|
||||
</view>
|
||||
|
||||
|
@ -59,8 +38,7 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import { GetCompanyInformation } from "@/api/apiList.js";
|
||||
|
||||
import { GetUserDataApi } from "@/api/apiAdmin.js";
|
||||
import {
|
||||
toast,
|
||||
clearStorageSync,
|
||||
|
@ -72,14 +50,22 @@ import {
|
|||
export default {
|
||||
data() {
|
||||
return {
|
||||
baseInfo: {
|
||||
avatar: "",
|
||||
companyName: "南昌理工",
|
||||
name: "保洁",
|
||||
sex: 0, // 0 男 1 女
|
||||
time: "2025/4/2-2026/4/2",
|
||||
personType: "保洁员",
|
||||
form: {
|
||||
"id": "08dd80a7-f2fa-46df-8374-4e132418512e",
|
||||
"name": "计算机学院教学大楼12栋",
|
||||
"description": "12栋",
|
||||
"companyId": "4b2d9662-a768-08f2-a0c8-762b8c76da2a",
|
||||
"departmentId": "08dd6dcf-ffc9-4000-89b2-b53ea1d5acfb",
|
||||
"department": null,
|
||||
"userId": "21645b80-8aff-3cf2-b1f3-2ba9d485fecd",
|
||||
"areas": [],
|
||||
"createTime": "2025-04-21T15:41:36.897423",
|
||||
"isDeleted": false
|
||||
},
|
||||
// 用户姓名
|
||||
userName: '',
|
||||
// 人员类型
|
||||
userType: '',
|
||||
clickCount: 0, // 用于记录点击次数
|
||||
version: "",
|
||||
|
||||
|
@ -118,31 +104,23 @@ export default {
|
|||
};
|
||||
},
|
||||
onLoad() {
|
||||
// this.getUserInfo();
|
||||
// const that = this;
|
||||
// uni.getSystemInfo({
|
||||
// success: function (res) {
|
||||
// console.log("res", res);
|
||||
// that.version = res.appVersion;
|
||||
// },
|
||||
// });
|
||||
},
|
||||
onShow() {
|
||||
// this.getCompanyInformation();
|
||||
// uni.$on("refresh", (e) => {
|
||||
// this.getUserInfo();
|
||||
// uni.$off("refresh");
|
||||
// });
|
||||
this.getDataFn();
|
||||
},
|
||||
|
||||
// 下拉刷新
|
||||
onPullDownRefresh() {
|
||||
//console.log('refresh');
|
||||
// this.getUserInfo();
|
||||
// uni.stopPullDownRefresh(); //停止刷新
|
||||
},
|
||||
|
||||
methods: {
|
||||
async getDataFn() {
|
||||
const res = await GetUserDataApi();
|
||||
console.log(res, "用户数据");
|
||||
Object.assign(this.form, res.data.userRegion);
|
||||
// 用户名称
|
||||
this.userName = res.data.userName
|
||||
// 人员类型
|
||||
this.userType = res.data.userType
|
||||
this.cellList[1].content = res.data.userType
|
||||
// 所属区域
|
||||
this.cellList[2].content = res.data.userRegion.name
|
||||
},
|
||||
handleClick() {
|
||||
this.clickCount++; // 每次点击增加点击次数
|
||||
if (this.clickCount === 6) {
|
||||
|
@ -152,50 +130,6 @@ export default {
|
|||
});
|
||||
}
|
||||
},
|
||||
upload_avatar() {
|
||||
const _this = this;
|
||||
uni.chooseImage({
|
||||
count: 1,
|
||||
sizeType: ["original", "compressed"], //可以指定是原图还是压缩图,默认二者都有
|
||||
sourceType: ["album", "camera"], //从相册选择
|
||||
success: function (res) {
|
||||
uni.uploadFile({
|
||||
url: _this.$api_url + "/api/index/upload_cos",
|
||||
filePath: res.tempFilePaths[0],
|
||||
name: "file",
|
||||
formData: {
|
||||
floder: "avatar",
|
||||
},
|
||||
success: (uploadFileRes) => {
|
||||
//let retData = JSON.parse(uploadFileRes)
|
||||
|
||||
let retData = JSON.parse(uploadFileRes.data);
|
||||
console.log("up:", retData);
|
||||
const _data = {
|
||||
avatar: retData.data.file,
|
||||
};
|
||||
_this.$api.baseInfoSave(_data).then((ret) => {
|
||||
if (ret.code == 1) {
|
||||
_this.baseInfo.avatar = retData.data.file;
|
||||
} else {
|
||||
toast(res.msg);
|
||||
}
|
||||
});
|
||||
},
|
||||
});
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 获取单位信息
|
||||
async getCompanyInformation() {
|
||||
const res = await GetCompanyInformation();
|
||||
if (res.succeed) {
|
||||
this.baseInfo = res.data;
|
||||
this.cellList[0].content = this.baseInfo.time;
|
||||
}
|
||||
},
|
||||
|
||||
toPage(path, item) {
|
||||
if (item.title === "注销") {
|
||||
uni.showModal({
|
||||
|
@ -203,12 +137,12 @@ export default {
|
|||
content: "确定注销吗?",
|
||||
showCancel: true,
|
||||
success: function (res) {
|
||||
if(!res.confirm){return}
|
||||
console.log(res,'res--')
|
||||
if (!res.confirm) { return }
|
||||
console.log(res, 'res--')
|
||||
// 确定退出
|
||||
let u = navigator.userAgent;
|
||||
let isAndroid =
|
||||
u.indexOf("Android") > -1 || u.indexOf("Adr") > -1; //android
|
||||
u.indexOf("Android") > -1 || u.indexOf("Adr") > -1; //android
|
||||
// let isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios
|
||||
try {
|
||||
if (isAndroid && AndroidJs) {
|
||||
|
@ -246,6 +180,7 @@ export default {
|
|||
<style lang="scss" scoped>
|
||||
.content {
|
||||
height: calc(100vh - 100rpx);
|
||||
|
||||
// background: #f6f8fc;
|
||||
.content-title {
|
||||
background: #fff;
|
||||
|
@ -254,6 +189,7 @@ export default {
|
|||
font-size: 30rpx;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.head {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
|
@ -269,6 +205,7 @@ export default {
|
|||
height: 140rpx;
|
||||
border-radius: 50%;
|
||||
position: relative;
|
||||
|
||||
.avatar {
|
||||
width: 100%;
|
||||
}
|
||||
|
@ -306,6 +243,7 @@ export default {
|
|||
align-self: center;
|
||||
}
|
||||
}
|
||||
|
||||
&-right {
|
||||
color: #999;
|
||||
}
|
||||
|
|
|
@ -4,40 +4,26 @@
|
|||
<view class="card">
|
||||
<view class="card-item card-left">
|
||||
<view class="card-title">已绑定子区域数</view>
|
||||
<view class="card-totel">10</view>
|
||||
<view class="card-totel">{{ form.bindnfc }}</view>
|
||||
</view>
|
||||
<view class="card-item card-right">
|
||||
<view class="card-title">未绑定子区域数</view>
|
||||
<view class="card-totel">10</view>
|
||||
<view class="card-totel">{{ form.noBindnfc }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 搜索 -->
|
||||
<view class="search-box">
|
||||
<u-input
|
||||
class="search-input"
|
||||
v-model="keyword"
|
||||
border
|
||||
placeholder="搜索名称"
|
||||
></u-input>
|
||||
<u-input class="search-input" v-model="keyword" border placeholder="搜索名称"></u-input>
|
||||
<view class="select-box" @click="selectFn">
|
||||
<view>
|
||||
{{ selectVal }}
|
||||
</view>
|
||||
<image
|
||||
src="/static/svg/down.svg"
|
||||
style="width: 30rpx; height: 30rpx; margin-left: 10rpx"
|
||||
></image>
|
||||
<image src="/static/svg/down.svg" style="width: 30rpx; height: 30rpx; margin-left: 10rpx"></image>
|
||||
</view>
|
||||
</view>
|
||||
<!-- tabs -->
|
||||
<u-tabs
|
||||
class="tabs-box"
|
||||
bg-color="#F6F8FC"
|
||||
:list="tabsList"
|
||||
:is-scroll="true"
|
||||
:current="tabCurrent"
|
||||
@change="tabChangeFn"
|
||||
></u-tabs>
|
||||
<u-tabs class="tabs-box" bg-color="#F6F8FC" :list="tabsList" :is-scroll="true" :current="tabCurrent"
|
||||
@change="tabChangeFn"></u-tabs>
|
||||
<!-- tip -->
|
||||
<view class="tip-box">共10个子区域,其中5个未绑定</view>
|
||||
<!-- 列表 -->
|
||||
|
@ -46,33 +32,19 @@
|
|||
<view v-for="i in 80" class="item-box">
|
||||
<view class="item-title">子区域{{ i }}</view>
|
||||
<view v-if="i % 2 === 0" class="btn-have btn">已绑定</view>
|
||||
<view
|
||||
v-if="i % 2 !== 0"
|
||||
class="btn-none btn"
|
||||
@click="showDialog = true"
|
||||
>去绑定</view
|
||||
>
|
||||
<view v-if="i % 2 !== 0" class="btn-none btn" @click="showDialog = true">去绑定</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
<!-- 筛选的下拉 -->
|
||||
<u-action-sheet
|
||||
:list="options"
|
||||
title="请选择"
|
||||
@click="changeFn"
|
||||
v-model:value="selectShow"
|
||||
></u-action-sheet>
|
||||
<bind-dialog
|
||||
:visible="showDialog"
|
||||
@close="showDialog = false"
|
||||
@changeBinding="onChangeBinding"
|
||||
@confirm="onConfirm"
|
||||
></bind-dialog>
|
||||
<u-action-sheet :list="options" title="请选择" @click="changeFn" v-model:value="selectShow"></u-action-sheet>
|
||||
<bind-dialog :visible="showDialog" @close="showDialog = false" @changeBinding="onChangeBinding"
|
||||
@confirm="onConfirm"></bind-dialog>
|
||||
<u-tabbar :list="vuex_tabbar"></u-tabbar>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
import { loginApi } from "@/api/apiList";
|
||||
import { GetRegionDataListApi, GetHomeDataApi } from "@/api/apiAdmin.js";
|
||||
import BindDialog from "@/pages/adminNfc/components/bindDialog.vue"; // 确保路径正确
|
||||
export default {
|
||||
components: {
|
||||
|
@ -80,6 +52,12 @@ export default {
|
|||
},
|
||||
data() {
|
||||
return {
|
||||
form: {
|
||||
"regionCount": 0,
|
||||
"areaCount": 0,
|
||||
"bindnfc": 0,
|
||||
"noBindnfc": 0
|
||||
},
|
||||
keyword: "",
|
||||
selectShow: false,
|
||||
showDialog: false,
|
||||
|
@ -128,8 +106,23 @@ export default {
|
|||
mounted() {
|
||||
uni.hideLoading(); // 关闭 Loading
|
||||
},
|
||||
onLoad() {},
|
||||
onLoad() {
|
||||
this.getAreaFn();
|
||||
},
|
||||
onShow() {
|
||||
this.getDataFn();
|
||||
},
|
||||
methods: {
|
||||
async getDataFn() {
|
||||
const res = await GetHomeDataApi();
|
||||
console.log(res, "首页数据");
|
||||
Object.assign(this.form, res.data);
|
||||
},
|
||||
async getAreaFn() {
|
||||
const res = await GetRegionDataListApi()
|
||||
console.log(res, "区域数据");
|
||||
this.tabsList = res.data.areaList
|
||||
},
|
||||
selectFn() {
|
||||
this.selectShow = true;
|
||||
},
|
||||
|
@ -141,7 +134,6 @@ export default {
|
|||
console.log(val, "val--");
|
||||
this.tabCurrent = val;
|
||||
},
|
||||
|
||||
onChangeBinding() {
|
||||
console.log("点击了更换绑定");
|
||||
// 处理更换绑定的逻辑
|
||||
|
@ -159,11 +151,13 @@ export default {
|
|||
// overflow: hidden;
|
||||
background-color: #f6f8fc;
|
||||
padding-bottom: 100rpx;
|
||||
|
||||
.card {
|
||||
display: flex;
|
||||
// margin-top: 30rpx;
|
||||
padding-left: 30rpx;
|
||||
padding-right: 30rpx;
|
||||
|
||||
.card-item {
|
||||
position: relative;
|
||||
flex: 1;
|
||||
|
@ -172,36 +166,41 @@ export default {
|
|||
color: white;
|
||||
padding: 20rpx;
|
||||
font-size: 30rpx;
|
||||
|
||||
.card-title {
|
||||
font-size: 30rpx;
|
||||
}
|
||||
|
||||
.card-totel {
|
||||
padding-left: 20rpx;
|
||||
font-size: 40rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.card-left {
|
||||
background: url("/static/adminImg/icon-bg1.png") no-repeat right 32rpx
|
||||
bottom 20rpx / 60rpx 60rpx;
|
||||
background: url("/static/adminImg/icon-bg1.png") no-repeat right 32rpx bottom 20rpx / 60rpx 60rpx;
|
||||
background-color: #4974f3;
|
||||
}
|
||||
|
||||
.card-right {
|
||||
margin-left: 20rpx;
|
||||
background: url("/static/adminImg/icon-bg2.png") no-repeat right 32rpx
|
||||
bottom 20rpx / 60rpx 60rpx;
|
||||
background: url("/static/adminImg/icon-bg2.png") no-repeat right 32rpx bottom 20rpx / 60rpx 60rpx;
|
||||
background-color: #53d5a9;
|
||||
}
|
||||
}
|
||||
|
||||
.search-box {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
// border: 1px solid red;
|
||||
margin-top: 20rpx;
|
||||
padding: 20rpx;
|
||||
|
||||
.search-input {
|
||||
background-color: white;
|
||||
border-radius: 50rpx;
|
||||
}
|
||||
|
||||
.select-box {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
|
@ -216,13 +215,16 @@ export default {
|
|||
padding-bottom: 10rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.tip-box {
|
||||
color: grey;
|
||||
padding-left: 30rpx;
|
||||
}
|
||||
|
||||
.list-box {
|
||||
padding-left: 30rpx;
|
||||
padding-right: 30rpx;
|
||||
|
||||
.item-box {
|
||||
background-color: white;
|
||||
margin-top: 20rpx;
|
||||
|
@ -233,11 +235,13 @@ export default {
|
|||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
|
||||
.item-title {
|
||||
font-size: 30rpx;
|
||||
color: #333;
|
||||
// font-weight: bold;
|
||||
}
|
||||
|
||||
.btn {
|
||||
padding-left: 20rpx;
|
||||
padding-right: 20rpx;
|
||||
|
@ -245,10 +249,12 @@ export default {
|
|||
padding-top: 5rpx;
|
||||
padding-bottom: 5rpx;
|
||||
}
|
||||
|
||||
.btn-have {
|
||||
background-color: #f5f5f5;
|
||||
color: black;
|
||||
}
|
||||
|
||||
.btn-none {
|
||||
background-color: #4274dc;
|
||||
color: white;
|
||||
|
|
|
@ -114,6 +114,7 @@ export default {
|
|||
form: {
|
||||
note: "", // 备注
|
||||
url: "", // 图片
|
||||
// url: "http://sl.vrgon.com:8005/uploads/20250418/13800451500/3e6bd20b50d34555b5737db851acd71e.png", // 图片
|
||||
},
|
||||
areaOptions: [
|
||||
{ label: "东大门操场", value: "east_gate" },
|
||||
|
|
|
@ -1,30 +1,19 @@
|
|||
<template>
|
||||
<view class="content">
|
||||
<view
|
||||
style="margin-top: 50rpx; display: flex; align-items: center; padding-right: 50rpx"
|
||||
>
|
||||
<view style="margin-top: 50rpx; display: flex; align-items: center; padding-right: 50rpx">
|
||||
<view style="margin-right: 50rpx">账号</view>
|
||||
<u-input v-model="phone" border placeholder="账号"></u-input>
|
||||
</view>
|
||||
<view
|
||||
style="margin-top: 50rpx; display: flex; align-items: center; padding-right: 50rpx"
|
||||
>
|
||||
<view style="margin-top: 50rpx; display: flex; align-items: center; padding-right: 50rpx">
|
||||
<view style="margin-right: 50rpx">账号</view>
|
||||
<u-input v-model="pwd" border placeholder="密码"></u-input>
|
||||
</view>
|
||||
<u-button type="primary" @click="loginFn" style="margin-top: 50rpx">登陆</u-button>
|
||||
<u-button type="primary" @click="login1Fn" style="margin-top: 50rpx"
|
||||
>登陆13800451500-清洁工</u-button
|
||||
>
|
||||
<u-button type="primary" @click="login2Fn" style="margin-top: 50rpx"
|
||||
>登陆18174010562-管理员</u-button
|
||||
>
|
||||
<u-button type="primary" @click="login4Fn" style="margin-top: 50rpx"
|
||||
>登陆18174010562-清洁工</u-button
|
||||
>
|
||||
<u-button type="primary" @click="login3Fn" style="margin-top: 50rpx"
|
||||
>登陆18174010561-清洁工</u-button
|
||||
>
|
||||
<u-button type="primary" @click="loginFn('admin')" style="margin-top: 50rpx">登陆-管理员</u-button>
|
||||
<u-button type="primary" @click="login1Fn" style="margin-top: 50rpx">登陆13800451500-清洁工</u-button>
|
||||
<u-button type="primary" @click="login2Fn" style="margin-top: 50rpx">登陆18174010562-管理员</u-button>
|
||||
<u-button type="primary" @click="login4Fn" style="margin-top: 50rpx">登陆18174010562-清洁工</u-button>
|
||||
<u-button type="primary" @click="login3Fn" style="margin-top: 50rpx">登陆18174010561-清洁工</u-button>
|
||||
<u-button type="primary" @click="login5Fn" style="margin-top: 50rpx">登陆18174010561-管理员</u-button>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
|
@ -33,7 +22,7 @@ import { loginApi } from "@/api/apiList";
|
|||
export default {
|
||||
data() {
|
||||
return {
|
||||
phone: "13800451500",
|
||||
phone: "18174010566",
|
||||
pwd: "123456",
|
||||
};
|
||||
},
|
||||
|
@ -41,117 +30,34 @@ export default {
|
|||
// console.log("%c%s", "color:red", "mounted--");
|
||||
uni.hideLoading(); // 关闭 Loading
|
||||
},
|
||||
onLoad() {},
|
||||
onLoad() { },
|
||||
methods: {
|
||||
login1Fn() {
|
||||
this.phone = "13800451500";
|
||||
// this.phone = "18174010561";
|
||||
this.pwd = "123456";
|
||||
|
||||
const normalTabBar = [
|
||||
{
|
||||
pagePath: "/pages/index/planList",
|
||||
iconPath: "/static/tab/planList.png",
|
||||
selectedIconPath: "/static/tab/planList-active.png",
|
||||
text: "计划",
|
||||
},
|
||||
{
|
||||
pagePath: "/pages/index/index",
|
||||
iconPath: "/static/tab/admin-home.png",
|
||||
selectedIconPath: "/static/tab/admin-home-acitve.png",
|
||||
text: "首页",
|
||||
},
|
||||
{
|
||||
pagePath: "/pages/user/index",
|
||||
iconPath: "/static/tab/admin-my.png",
|
||||
selectedIconPath: "/static/tab/admin-my-active.png",
|
||||
text: "设置",
|
||||
},
|
||||
];
|
||||
this.$u.vuex("vuex_tabbar", normalTabBar);
|
||||
this.loginFn("user");
|
||||
},
|
||||
login2Fn() {
|
||||
this.phone = "18174010562";
|
||||
this.pwd = "123456";
|
||||
|
||||
const adminTabBar = [
|
||||
{
|
||||
pagePath: "/pages/adminHome/index",
|
||||
iconPath: "/static/tab/admin-home.png",
|
||||
selectedIconPath: "/static/tab/admin-home-acitve.png",
|
||||
text: "首页",
|
||||
},
|
||||
{
|
||||
pagePath: "/pages/adminNfc/index",
|
||||
iconPath: "/static/tab/nfc.png",
|
||||
selectedIconPath: "/static/tab/nfc-active.png",
|
||||
text: "nfc写入",
|
||||
},
|
||||
{
|
||||
pagePath: "/pages/adminMy/index",
|
||||
iconPath: "/static/tab/admin-my.png",
|
||||
selectedIconPath: "/static/tab/admin-my-active.png",
|
||||
text: "我的",
|
||||
},
|
||||
];
|
||||
this.$u.vuex("vuex_tabbar", adminTabBar);
|
||||
this.loginFn("admin");
|
||||
},
|
||||
login4Fn() {
|
||||
this.phone = "18174010562";
|
||||
this.pwd = "123456";
|
||||
|
||||
const normalTabBar = [
|
||||
{
|
||||
pagePath: "/pages/index/planList",
|
||||
iconPath: "/static/tab/planList.png",
|
||||
selectedIconPath: "/static/tab/planList-active.png",
|
||||
text: "计划",
|
||||
},
|
||||
{
|
||||
pagePath: "/pages/index/index",
|
||||
iconPath: "/static/tab/admin-home.png",
|
||||
selectedIconPath: "/static/tab/admin-home-acitve.png",
|
||||
text: "首页",
|
||||
},
|
||||
{
|
||||
pagePath: "/pages/user/index",
|
||||
iconPath: "/static/tab/admin-my.png",
|
||||
selectedIconPath: "/static/tab/admin-my-active.png",
|
||||
text: "设置",
|
||||
},
|
||||
];
|
||||
this.$u.vuex("vuex_tabbar", normalTabBar);
|
||||
this.loginFn("user");
|
||||
},
|
||||
login3Fn() {
|
||||
this.phone = "18174010561";
|
||||
this.pwd = "123456";
|
||||
|
||||
const normalTabBar = [
|
||||
{
|
||||
pagePath: "/pages/index/planList",
|
||||
iconPath: "/static/tab/planList.png",
|
||||
selectedIconPath: "/static/tab/planList-active.png",
|
||||
text: "计划",
|
||||
},
|
||||
{
|
||||
pagePath: "/pages/index/index",
|
||||
iconPath: "/static/tab/admin-home.png",
|
||||
selectedIconPath: "/static/tab/admin-home-acitve.png",
|
||||
text: "首页",
|
||||
},
|
||||
{
|
||||
pagePath: "/pages/user/index",
|
||||
iconPath: "/static/tab/admin-my.png",
|
||||
selectedIconPath: "/static/tab/admin-my-active.png",
|
||||
text: "设置",
|
||||
},
|
||||
];
|
||||
this.$u.vuex("vuex_tabbar", normalTabBar);
|
||||
this.loginFn("user");
|
||||
},
|
||||
login4Fn() {
|
||||
this.phone = "18174010562";
|
||||
this.pwd = "123456";
|
||||
this.loginFn("user");
|
||||
},
|
||||
login5Fn() {
|
||||
this.phone = "18174010561";
|
||||
this.pwd = "123456";
|
||||
this.loginFn("admin");
|
||||
},
|
||||
async loginFn(type) {
|
||||
let salt = bcrypt.genSaltSync(12);
|
||||
let req = {
|
||||
|
@ -170,11 +76,54 @@ export default {
|
|||
uni.setStorageSync("token", "Bearer " + token);
|
||||
console.log(type, "type--");
|
||||
if (type === "user") {
|
||||
const normalTabBar = [
|
||||
{
|
||||
pagePath: "/pages/index/planList",
|
||||
iconPath: "/static/tab/planList.png",
|
||||
selectedIconPath: "/static/tab/planList-active.png",
|
||||
text: "计划",
|
||||
},
|
||||
{
|
||||
pagePath: "/pages/index/index",
|
||||
iconPath: "/static/tab/admin-home.png",
|
||||
selectedIconPath: "/static/tab/admin-home-acitve.png",
|
||||
text: "首页",
|
||||
},
|
||||
{
|
||||
pagePath: "/pages/user/index",
|
||||
iconPath: "/static/tab/admin-my.png",
|
||||
selectedIconPath: "/static/tab/admin-my-active.png",
|
||||
text: "设置",
|
||||
},
|
||||
];
|
||||
this.$u.vuex("vuex_tabbar", normalTabBar);
|
||||
|
||||
uni.switchTab({
|
||||
url: `/pages/index/planList`,
|
||||
});
|
||||
}
|
||||
if (type === "admin") {
|
||||
const adminTabBar = [
|
||||
{
|
||||
pagePath: "/pages/adminHome/index",
|
||||
iconPath: "/static/tab/admin-home.png",
|
||||
selectedIconPath: "/static/tab/admin-home-acitve.png",
|
||||
text: "首页",
|
||||
},
|
||||
{
|
||||
pagePath: "/pages/adminNfc/index",
|
||||
iconPath: "/static/tab/nfc.png",
|
||||
selectedIconPath: "/static/tab/nfc-active.png",
|
||||
text: "nfc写入",
|
||||
},
|
||||
{
|
||||
pagePath: "/pages/adminMy/index",
|
||||
iconPath: "/static/tab/admin-my.png",
|
||||
selectedIconPath: "/static/tab/admin-my-active.png",
|
||||
text: "我的",
|
||||
},
|
||||
];
|
||||
this.$u.vuex("vuex_tabbar", adminTabBar);
|
||||
uni.switchTab({
|
||||
url: `/pages/adminHome/index`,
|
||||
});
|
||||
|
|
|
@ -195,7 +195,7 @@ export default {
|
|||
content: "确定注销吗?",
|
||||
showCancel: true,
|
||||
success: function (res) {
|
||||
if(res.confirm){
|
||||
if(res.confirm){return}
|
||||
// 确定退出
|
||||
let u = navigator.userAgent;
|
||||
let isAndroid =
|
||||
|
@ -223,7 +223,6 @@ export default {
|
|||
console.log(e, "e-----判断安卓苹果类型出错");
|
||||
}
|
||||
return
|
||||
}
|
||||
},
|
||||
});
|
||||
return;
|
||||
|
|
|
@ -45,7 +45,7 @@ const baseRequest = async (url, method, data = {}, loading = true) => {
|
|||
reslove(res);
|
||||
}
|
||||
} else {
|
||||
if (successData.statusCode === 401) {
|
||||
if ([401,403].includes(successData.statusCode)) {
|
||||
console.log(successData, "successData--");
|
||||
console.log("%c%s", "color:red", "登录过期");
|
||||
uni.showModal({
|
||||
|
|
Loading…
Reference in New Issue