未审核账号逻辑调整

test
zhangdi 1 year ago
parent 55ae673aed
commit c1e5623908
  1. 29
      App.vue
  2. 5
      api/api.js
  3. 82
      common/betone_components/betone-list.vue
  4. 4
      manifest.json
  5. 25
      package-lock.json
  6. 4
      package.json
  7. 7
      pages.json
  8. 187
      pages/login/authInfo.vue
  9. 142
      pages/login/components/alarm.vue
  10. 366
      pages/login/components/eacharts.vue
  11. 130
      pages/login/components/swiper.vue
  12. 43
      pages/login/login.vue
  13. 17
      pages/my/my.vue
  14. 139
      pages/order/tasking.vue
  15. 6
      pages/register/index.vue
  16. 26
      pages/submission/records.vue
  17. 78
      store/index.js
  18. 5
      utils/request.js
  19. 17
      utils/tabbar.js
  20. 6
      utils/website.js

@ -2,27 +2,38 @@
export default {
onLaunch: function (options) {
uni.hideTabBar()
console.log("App Show");
const Pages = options.path;
//
const WHITE = [
"pages/login/login",
"pages/register/index",
"pages/register/registerSuccess",
"pages/login/authInfo"
];
const value = uni.getStorageSync("token");
console.log("App Launch", !value);
if (!value) {
console.log("App Launch");
if ((!value) && (WHITE.indexOf(Pages) < 0)) {
uni.redirectTo({
url: "/pages/login/login",
});
return false
} else {
const userInfo = uni.getStorageSync("userinfo");
if (userInfo) {
//
this.$store.dispatch("changeTabbar", userInfo);
}
}
const userInfo = uni.getStorageSync("userinfo");
if (userInfo) {
//
this.$store.dispatch("changeTabbar", userInfo.role_id);
}
},
onReady() {
},
onShow: function () {
},
onHide: function () {

@ -6,7 +6,10 @@ const install = (Vue, vm) => {
// 此处没有使用传入的params参数
let getTenantInfo = (params, config = {}) => http.get('/blade-system/tenant/info', params, config)
// 此处使用了传入的params参数,一切自定义即可
let login = (params) => http.post('/blade-auth/oauth/token?' + params)
let login = (params,data) => http.post('/blade-auth/oauth/token?'+ params,data,{
authorizations: true,
isparams: true
})
// 退出
let logout = () => http.get('/blade-auth/oauth/logout')
// 注册

@ -1,15 +1,14 @@
<template>
<view class="page-box">
<view class="page-search-top">
<betone-new-input v-model="searchInfo.requirementCode"
:placeholder="dataTypes == 1 ? '搜索维修单单号' : '搜索维修单单号或单位名称'" icon="search" style="margin-bottom: 32rpx"
@changevalue="searchData()" />
<u-tabs :list="tabList" :is-scroll="false" :current="current" @change="changeTab"
<betone-new-input v-model="searchInfo.requirementCode" :placeholder="dataTypes == 1 ? '搜索单号' : '搜索单号或单位名称'"
icon="search" style="margin-bottom: 32rpx" @changevalue="searchData()" />
<u-tabs :list="tabList" :is-scroll="true" :current="current" @change="changeTab"
bg-color="rgba(248, 248, 248, 1)"></u-tabs>
</view>
<view class="order-box">
<!-- @click="goPage(item, 'details')" -->
<view class="order-item" v-for="(item, index) in orderData" :key="index" >
<view class="order-item" v-for="(item, index) in orderData" :key="index">
<view class="item-top">
<view class="item-left" v-if="dataTypes == 1">
<text class="item-orderNo">单号{{ item.requirementCode }}</text>
@ -73,7 +72,7 @@
<u-button size="mini" :plain="true" style="margin-right: 32rpx" :hair-line="true"
type="primary" @click="goPage(item, 'location')">查看位置</u-button>
</block>
<block v-if="item.status == 5 && dataTypes == 1">
<block v-if="item.status == 4 && dataTypes == 1">
<u-button size="mini" :plain="true" style="margin-right: 32rpx" :hair-line="true"
type="primary" @click="goPage(item, 'evaluate')">评价</u-button>
@ -114,6 +113,10 @@ export default {
tabList: {
type: Array,
default: []
},
type: {
type: String,
default: ''
}
},
data() {
@ -129,7 +132,7 @@ export default {
待维修: "#3A62D7",
待提报: "#81B337",
已完成: "#CECECE",
待维修: '#E99D42'
待维修: '#E99D42',
},
current: 0,
@ -162,7 +165,7 @@ export default {
mounted() {
this.$nextTick(() => {
// this.getRecordsList()
this.getRecordsList()
// this.getRepairPersons()//
//
uni.$on('onReachBottom', () => {
@ -240,24 +243,51 @@ export default {
},
//
statusName(item) {
if (item == -1) {
return '待提报'
}
if (item == 0) {
return '待接单'
}
if(item == 2){ //
return '待接单'
}
if (item == 1 || item == 3) {
return '待维修'
}
if (item == 4 || item == 5 || item == 6 || item == 9) {
return '已完成'
}
if (item == 7) {
return '已驳回'
if (this.type != 'submission') {
if (item == -1) {
return '待提报'
}
if (item == 0) {
return '待接单'
}
if (item == 2) { //
return '待接单'
}
if (item == 1 || item == 3) {
return '待维修'
}
if (item == 4 || item == 5 || item == 6 || item == 9) {
return '已完成'
}
if (item == 7) {
return '已驳回'
}
} else {
if (item == -1) {
return '待提报'
}
if (item == 0) {
return '待接单'
}
if (item == 1 || item == 3 || item == 2) {
return '待维修'
}
if (item == 4) {
return '维修完成'
}
if (item == 5) {
return '待评价'
}
if (item == 6) {
return '已完成'
}
if (item == 9||item == 7) {
return '已驳回'
}
}
},
//
@ -426,7 +456,7 @@ export default {
}
.item-right {
width: 132rpx;
width: 162rpx;
height: 48rpx;
margin: 36rpx 24rpx 0 0;
}

@ -120,8 +120,8 @@
"sdkConfigs" : {
"maps" : {
"amap" : {
"key" : "a9632baa2c4ae13a34c1fb265dda41f5",
"securityJsCode" : "",
"key" : "a35a37c732890b60c4ff0aadd318d0aa",
"securityJsCode" : "7b6d007df2a0d16719b34ec5b7fce504",
"serviceHost" : ""
}
}

25
package-lock.json generated

@ -1,6 +1,8 @@
{
"requires": true,
"name": "laboratory_maintenance_app",
"version": "1.0.0",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
"echarts": {
"version": "5.5.1",
@ -11,6 +13,27 @@
"zrender": "5.6.0"
}
},
"jsbn": {
"version": "1.1.0",
"resolved": "https://registry.npmmirror.com/jsbn/-/jsbn-1.1.0.tgz",
"integrity": "sha512-4bYVV3aAMtDTTu4+xsDYa6sy9GyJ69/amsu9sYF2zqjiEoZA5xJi3BrfX3uY+/IekIu7MwdObdbDWpoZdBv3/A=="
},
"miniprogram-sm-crypto": {
"version": "0.3.13",
"resolved": "https://registry.npmmirror.com/miniprogram-sm-crypto/-/miniprogram-sm-crypto-0.3.13.tgz",
"integrity": "sha512-H7qwbCEmIXZzekCSgEWeHh1mb4cnz0E42YH3U5xqpOaJBB2Sj9ySq0hTGv0f+Jwo5SknABR6fw+EtjnMyJ/O/Q==",
"requires": {
"jsbn": "^1.1.0"
}
},
"sm-crypto": {
"version": "0.3.13",
"resolved": "https://registry.npmmirror.com/sm-crypto/-/sm-crypto-0.3.13.tgz",
"integrity": "sha512-ztNF+pZq6viCPMA1A6KKu3bgpkmYti5avykRHbcFIdSipFdkVmfUw2CnpM2kBJyppIalqvczLNM3wR8OQ0pT5w==",
"requires": {
"jsbn": "^1.1.0"
}
},
"tslib": {
"version": "2.3.0",
"resolved": "https://registry.npmmirror.com/tslib/-/tslib-2.3.0.tgz",

@ -14,6 +14,8 @@
"author": "",
"license": "ISC",
"dependencies": {
"echarts": "^5.5.1"
"echarts": "^5.5.1",
"miniprogram-sm-crypto": "^0.3.13",
"sm-crypto": "^0.3.13"
}
}

@ -124,6 +124,13 @@
"navigationBarTextStyle": "white"
}
},
{
"path": "pages/login/authInfo",
"style": {
"navigationStyle": "custom",
"navigationBarTextStyle": "white"
}
},
{
"path": "pages/register/index",
"style": {

@ -0,0 +1,187 @@
<template>
<view class="page-css">
<view class="">
<view class="banner-swiper" v-if="swiperList.length > 0">
<view class="logo-txt">科研医疗建筑运维平台</view>
<u-swiper height="444" :list="swiperList" mode="none"></u-swiper>
</view>
<view class="work-title">工作台</view>
<view class="workbench">
<view v-for="(item, index) in workList" :key="index" class="workbench-slider">
<view class="workbench-item" @click="goPage(item)">
<view class="workbench-item-icon">
<image :src="item.img" mode="aspectFit" />
</view>
<u-badge class="badge" type="error" :count="item.num" :offset="[0, 0]"></u-badge>
</view>
<view class="workbench-name">{{ item.name }}</view>
</view>
</view>
<view class="work-title">实验室巡检</view>
<view>
<swiperSlider></swiperSlider>
</view>
<view class="work-title">设备报警</view>
<view>
<alarm></alarm>
</view>
<view class="work-title">维修统计</view>
<view class="statistics">
<eacharts :type="'maintenanceStatistics'"></eacharts>
<eacharts :type="'maintenanceStatisticsPie'"></eacharts>
</view>
</view>
<betone-tabbar ref="tabbarRef" />
<betone-loading ref="BetLoading"></betone-loading>
<u-modal v-model="show" :content="content" ></u-modal>
</view>
</template>
<script>
import swiperSlider from "./components/swiper.vue";
import alarm from "./components/alarm.vue";
import eacharts from "./components/eacharts.vue";
export default {
components: {
swiperSlider,
alarm,
eacharts,
},
data() {
return {
show:true,
content:'账号审核中!',
swiperList: [require("@/static/images/home/lab.png")],
workList: [
{
name: "实验室巡检",
img: require("@/static/images/home/lab_xj.png"),
num: 10,
pagePath: ''
},
{
name: "报送记录",
img: require("@/static/images/home/bs_jl.png"),
num: 0,
pagePath: ''
},
{
name: "设备报警",
img: require("@/static/images/home/alarm.png"),
num: 2,
pagePath: ''
},
{
name: "其他",
img: require("@/static/images/home/full.png"),
num: 0,
pagePath: ''
},
],
};
},
onShow() {
this.$nextTick(() => {
this.$refs.tabbarRef.getPermission();
this.$refs.BetLoading.show();
setTimeout(() => {
this.$refs.BetLoading.hide();
}, 1000);
});
//
this.getworkbench();
},
methods: {
getworkbench() {
console.log(55);
// this.$u.api.getworkbench().then(res=>{
// }).catch(err=>{
// })
},
goPage(item){
uni.navigateTo({
url: item.pagePath,
});
}
},
};
</script>
<style lang="scss" scoped>
.page-css {
width: 100%;
// min-height: 100%;
padding: 0;
background: rgba(239, 239, 239, 1);
padding-top: var(--status-bar-height);
.banner-swiper {
margin-bottom: 64rpx;
position: relative;
.logo-txt {
color: rgba(255, 255, 255, 1);
font-size: 36rpx;
position: absolute;
top: 40rpx;
left: 20rpx;
z-index: 10;
}
}
.work-title {
color: rgba(16, 16, 16, 1);
font-size: 32rpx;
padding: 0 0 32rpx 36rpx;
}
.workbench {
height: 210rpx;
position: relative;
display: flex;
justify-content: space-around;
margin: 0 40rpx 32rpx;
.workbench-item {
width: 160rpx;
height: 148rpx;
background-color: rgba(58, 98, 215, 0.57);
border-radius: 8rpx;
position: relative;
.workbench-item-icon {
width: 64rpx;
height: 64rpx;
position: absolute;
left: 0;
top: 0;
bottom: 0;
right: 0;
margin: auto;
image {
width: 100%;
height: 100%;
}
}
}
.workbench-name {
width: 100%;
text-align: center;
font-size: 28rpx;
color: rgba(16, 16, 16, 1);
margin-top: 16rpx;
}
.badge {
// background-color: blue;
// color: white;
}
}
.statistics_pie {
width: 100%;
}
}
</style>

@ -0,0 +1,142 @@
<template>
<view>
<view v-for="(item, index) in list" :key="index" class="alarm-box">
<view class="alarm-left" :style="{ borderColor: item.color }">
<i>{{ item.alarmName }}</i>
<i>{{ item.levelNanme }}</i>
</view>
<view class="alarm-center">
<text>{{ item.deviceName }}</text>
<text>品牌:{{ item.brand }}</text>
<text>型号:{{ item.model }}</text>
<text>报警时间:{{ item.alarmTime }}</text>
<view class="alarm-center-btn">一键报送</view>
</view>
<view class="alarm-right"></view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
colorList: {
特别严重: "rgba(189,49,36,1)",
严重: "rgba(233,157,66,1)",
},
list: [],
};
},
mounted() {
this.deviceList()
},
methods: {
deviceList() {
// this.$u.api.deviceList().then(res => {
// if (res.code == 200) {
let data_ = [
{
"alarmTime": "2024-11-15",
"alarmLevel": 1,
"model": "GDXH-12582",
"deviceName": "2024-11-11",
"brand": "品牌A"
},
{
"alarmTime": "2024-11-08",
"alarmLevel": 2,
"model": "GDXH-88542",
"deviceName": "2024-11-11",
"brand": "品牌B"
}
]
data_.forEach(v => {
if (v.alarmLevel == 1) {
v.alarmName = '一级'
v.levelNanme = '超级严重'
}
if (v.alarmLevel == 2) {
v.alarmName = '二级'
v.levelNanme = '严重'
}
v.color = this.colorList[v.levelNanme]
});
this.list = data_
// }
// })
}
}
};
</script>
<style lang="scss" scoped>
.alarm-box {
margin: 0 40rpx 32rpx;
background-color: #ffffff;
border-radius: 20rpx;
display: flex;
flex-direction: row;
.alarm-left {
width: 160rpx;
height: 160rpx;
text-align: center;
border: 16rpx solid rgba(189, 49, 36, 1);
border-radius: 50%;
margin: 36rpx 36rpx 36rpx 48rpx;
i {
display: block;
text-align: center;
&:nth-child(1) {
color: rgba(16, 16, 16, 1);
font-size: 28rpx;
padding-top: 30rpx;
}
&:nth-child(2) {
color: rgba(190, 190, 190, 1);
font-size: 26rpx;
}
}
}
.alarm-center {
flex: 1;
color: rgba(154, 154, 154, 1);
font-size: 24rpx;
position: relative;
text {
display: block;
line-height: 40rpx;
font-size: 24rpx;
&:nth-child(1) {
color: rgba(0, 0, 0, 1);
font-size: 28rpx;
padding: 28rpx 0 8rpx 0;
}
&:nth-child(2) {}
}
.alarm-center-btn {
width: 160rpx;
height: 60rpx;
line-height: 40rpx;
border-radius: 8rpx;
background-color: rgba(58, 98, 215, 0.16);
color: rgba(58, 98, 215, 1);
font-size: 28rpx;
line-height: 60rpx;
text-align: center;
position: absolute;
top: 28rpx;
right: 40rpx;
cursor: pointer;
}
}
}
</style>

@ -0,0 +1,366 @@
<template>
<view class="eacharts-box">
<view class="eacharts-time">
<!-- <u-form :model="form" ref="uForm">
<u-form-item label="选择时间:" label-width="140" :border-bottom="false">
<u-input v-model="form.searchTime" type="select" @click="calendarShow = true" :border="true"
placeholder="请选择时间" />
</u-form-item>
</u-form> -->
<u-calendar v-model="calendarShow" :mode="mode" @change="change"></u-calendar>
</view>
<!-- eacharts 图表 -->
<view class="echarts" v-if="type == 'maintenanceStatistics'">
<l-echart ref="chartRef" :key="Math.random()"></l-echart>
</view>
<!-- 饼状图 -->
<view class="echartsPie" v-if="type == 'maintenanceStatisticsPie'">
<view class="pie-item">
<view style="height:308rpx"><l-echart ref="chartRefPieLeft" :key="Math.random()"></l-echart></view>
<text class="pie-title">故障现象分类</text>
</view>
<view class="pie-item">
<view style="height:308rpx"><l-echart ref="chartRefPieRight" :key="Math.random()"></l-echart></view>
<text class="pie-title">设备分类</text>
</view>
</view>
</view>
</template>
<script>
import * as echarts from "echarts";
import lEchart from "@/uni_modules/lime-echart/components/lime-echart/";
export default {
components: { lEchart },
props: {
type: {
type: String,
default: "",
},
},
data() {
return {
form: {
searchTime: "",
startTime: "",
endTime: "",
},
calendarShow: false,
mode: "range",
upkeepStatInfo: {},
pieInfo: {},//
};
},
mounted() {
//
if (this.type == "maintenanceStatistics") {
this.upkeepStat()
}
if (this.type == "maintenanceStatisticsPie") {
this.pieStat()
}
},
methods: {
//
upkeepStat() {
let query_ = {
startTime: this.form.startTime,
endTime: this.form.endTime,
}
// this.$u.api.upkeepStat(query_).then(res => {
// if (res.code == 200) {
this.upkeepStatInfo = {
"total": [
10,
20
],
"unCompleted": [
7,
8
],
"xData": [
"报送维修",
"巡检维修"
],
"completed": [
3,
12
]
}
this.maintenanceInit();
// }
// })
},
//
pieStat() {
let query_ = {
startTime: this.form.startTime,
endTime: this.form.endTime,
}
// this.$u.api.pieStat(query_).then(res => {
// if (res.code == 200) {
this.pieInfo = {"fault": [
{
"name": "电气",
"value": 300
},
{
"name": "空调",
"value": 248
},
{
"name": "装修类",
"value": 135
},
{
"name": "智能设备",
"value": 180
},
{
"name": "暖通、自控",
"value": 654
}
],
"device": [
{
"name": "设备1",
"value": 580
},
{
"name": "空调",
"value": 1048
},
{
"name": "通风柜",
"value": 735
}
]}
this.maintenancePieLeftInit();
this.maintenancePieRightInit();
// }
// })
},
selectFun() {
this.calendarShow = true;
},
change(e) {
this.form.startTime = e.startDate;
this.form.endTime = e.endDate;
this.form.searchTime = e.startDate + "-" + e.endDate;
if (this.type == "maintenanceStatistics") {
this.upkeepStat()
}
if (this.type == "maintenanceStatisticsPie") {
this.pieStat()
}
//
},
//
maintenanceInit() {
let opts = {
tooltip: {},
legend: {
//
data: ["总计", "已完成", "未完成"],
},
xAxis: {
data: this.upkeepStatInfo.xData,
},
grid: {
top: "15%",
left: "10%",
right: "5%",
bottom: "15%",
},
yAxis: {},
series: [
{
name: "总计",
type: "bar",
data: this.upkeepStatInfo.total,
barWidth: 30, //
barGap: "0", // 0
itemStyle: {
color: "#2478f2",
},
},
{
name: "已完成",
type: "bar",
data: this.upkeepStatInfo.completed,
barWidth: 30, //
barGap: "0", // 0
itemStyle: {
color: "#84b7f9",
},
},
{
name: "未完成",
type: "bar",
data: this.upkeepStatInfo.unCompleted,
barWidth: 30, //
barGap: "0", // 0
itemStyle: {
color: "#5f9cf8",
},
},
],
};
this.$refs.chartRef.init((config) => {
const { canvas } = config;
const chart = echarts.init(canvas, null, config);
chart.setOption(opts);
// chart
return chart;
});
},
//
maintenancePieLeftInit() {
let opts = {
series: [
{
name: "",
type: "pie",
radius: ['40%', '70%'],
label: {
// .
normal: {
show: true,
fontSize: 8, // [ default: false ]
position: "outside", // 'outside'线'inside','inner' 'inside','center'
formatter: "{b}\n {c}", //
color: '#000'
},
},
data: this.pieInfo.fault,
emphasis: {
itemStyle: {
shadowBlur: 10,
shadowOffsetX: 0,
shadowColor: "rgba(0, 0, 0, 1)",
},
},
labelLine: {
// 线, label 'outside'线
normal: {
show: true, // 线
length: 5, // label 'outside'线
length2: 5,
//
lineStyle: {
// 线
type: "solid",
},
},
},
},
],
};
this.$refs.chartRefPieLeft.init((config) => {
const { canvas } = config;
const chart = echarts.init(canvas, null, config);
chart.setOption(opts);
// chart
return chart;
});
},
maintenancePieRightInit() {
let opts = {
series: [
{
type: "pie",
radius: ['40%', '70%'],
label: {
// .
normal: {
show: true,
fontSize: 8, // [ default: false ]
position: "outside", // 'outside'线'inside','inner' 'inside','center'
formatter: "{b}\n {c}", //
color: '#000'
},
},
data: this.pieInfo.device,
labelLine: {
// 线, label 'outside'线
normal: {
show: true, // 线
length: 5, // label 'outside'线
length2: 5,
//
lineStyle: {
// 线
type: "solid",
},
},
},
},
],
};
this.$refs.chartRefPieRight.init((config) => {
const { canvas } = config;
const chart = echarts.init(canvas, null, config);
chart.setOption(opts);
// chart
return chart;
});
},
},
};
</script>
<style lang="scss" scoped>
.eacharts-box {
background: #fff;
margin: 0 40rpx 32rpx;
border-radius: 20rpx;
overflow: hidden;
.eacharts-time {
margin: 0 136rpx 0 24rpx;
display: flex;
flex-direction: row;
text {
line-height: 60rpx;
color: rgba(16, 16, 16, 1);
font-size: 28rpx;
margin-top: 30rpx;
margin-right: 10rpx;
}
}
.echarts {
width: calc(100% - 64rpx);
height: 308rpx;
margin: 0 auto 20rpx;
}
.echartsPie {
width: calc(100% - 64rpx);
min-height: 308rpx;
margin: 0 auto 0;
.pie-item {
width: 100%;
height: 368rpx;
// float: left;
}
}
.pie-title {
height: 30rpx;
text-align: center;
display: block;
color: rgba(16, 16, 16, 1);
font-size: 28rpx;
}
}
</style>

@ -0,0 +1,130 @@
<template>
<view class="notice_bg">
<view class="line"></view>
<swiper autoplay="true" display-multiple-items="1" vertical="true" circular interval="7000" class="bar-swiper">
<swiper-item v-for="(item, index) in list" :key="index" class="swiper-item">
<view class="title">{{ item.inspectionName }}</view>
<view class="time">巡检计划时间:{{ item.inspectionTime }}</view>
<view class="name">巡检人:{{ item.inspectionPerson }}</view>
<view class="status">
<i class="status-name">{{ item.isStart == 1 ? '已开始' : '未开始' }}</i><i>预约时间{{ item.appointTime }}</i>
</view>
<view class="type">{{ item.taskType == 1 ? '周期任务' : '单次任务' }}</view>
</swiper-item>
</swiper>
</view>
</template>
<script>
export default {
data() {
return {
list: [
{
"inspectionPerson": "张三",
"taskType": "1",
"appointTime": "2024-11-15",
"inspectionTime": "2024-11-11",
"inspectionName": "水系统检查",
"isStart": "0"
},
{
"inspectionPerson": "李四",
"taskType": "2",
"appointTime": "2024-11-15",
"inspectionTime": "2024-11-11",
"inspectionName": "设备检查",
"isStart": "1"
}
],
};
},
mounted() {
},
methods: {
//
click(id) {
// console.log(id, "======>id");
},
workList() {
this.$u.api.workList().then(res => {
if (res.code == 200) {
this.list = res.data
}
})
}
},
};
</script>
<style scoped lang="scss">
.notice_bg {
margin: 0 40rpx 32rpx;
background-color: #ffffff;
border-radius: 20rpx;
padding: 16rpx 20rpx;
display: flex;
align-items: center;
position: relative;
.icon {
width: 74rpx;
height: 72rpx;
}
.bar-swiper {
font-size: 24rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: rgba(34, 34, 34, 0.5);
height: 260rpx;
display: flex;
align-items: center;
flex: 1;
margin-left: 12rpx;
}
.swiper-item {
overflow: hidden;
}
//
.title {
font-size: 32rpx;
color: rgba(16, 16, 16, 1);
text-align: left;
margin-top: 22rpx;
line-height: 38rpx;
}
.time {
margin-top: 20rpx;
margin-bottom: 28rpx;
}
.time,
.name {
font-size: 26rpx;
color: rgba(108, 108, 108, 1);
line-height: 38rpx;
}
.status {
font-size: 26rpx;
line-height: 38rpx;
margin-top: 20rpx;
.status-name {
color: rgba(58, 98, 215, 1);
padding-right: 10rpx;
}
}
.type {
position: absolute;
top: 20rpx;
right: 20rpx;
color: rgba(58, 98, 215, 1);
font-size: 26rpx;
}
}
</style>

@ -4,9 +4,9 @@
<view class="title">科研医疗建筑运维平台</view>
<view class="sp-login-form">
<betone-new-input :value="userInfo.username" placeholder="请输入用户名" icon="account-fill"
style="margin-bottom: 32rpx" @changevalue="userInfo.username=$event" />
style="margin-bottom: 32rpx" @changevalue="userInfo.username = $event" />
<betone-new-input style="margin-bottom: 32rpx" v-model="userInfo.pwd" placeholder="请输入密码" :type="'password'"
icon="lock-fill" @changevalue="userInfo.pwd=$event" />
icon="lock-fill" @changevalue="userInfo.pwd = $event" />
<u-checkbox-group>
<u-checkbox @change="rememberPwdChange" v-model="rememberPwd" key="index" name="记住密码">记住密码</u-checkbox>
</u-checkbox-group>
@ -26,7 +26,8 @@
<script>
import { getTopUrl, bjectToQueryString } from "@/utils/util";
import md5 from "@/uni_modules/md5/md5.min.js";
import { sm2 } from 'miniprogram-sm-crypto';
import website from '@/utils/website'
export default {
data() {
return {
@ -42,7 +43,7 @@ export default {
},
computed: {
disabled() {
console.log(11111111111,this.userInfo)
console.log(11111111111, this.userInfo)
return !this.userInfo.username || !this.userInfo.pwd;
},
},
@ -60,13 +61,13 @@ export default {
if (this.rememberPwd) {
uni.setStorage({
key: "loginInfo",
data: {...this.userInfo,'rememberPwd':true},
data: { ...this.userInfo, 'rememberPwd': true },
});
}
},
rememberFn(){
rememberFn() {
let rememberInfo = uni.getStorageSync('loginInfo')
if(rememberInfo.rememberPwd){
if (rememberInfo.rememberPwd) {
this.userInfo.username = rememberInfo.username
this.userInfo.pwd = rememberInfo.pwd
this.rememberPwd = true
@ -83,10 +84,15 @@ export default {
return false;
}
this.$refs.BetLoading.show();
// // smCrypto
// const smCryptoInstance = new smCrypto.SM2Instance();
// //
// smCryptoInstance.setKey(website.publicKey);
let formdata = {
tenantId: this.userInfo.tenantId,
username: this.userInfo.username,
password: md5(this.userInfo.pwd),
password: sm2.doEncrypt(this.userInfo.pwd, website.publicKey, 0),
grant_type: "captcha",
scope: "all",
type: "account",
@ -94,18 +100,19 @@ export default {
if (this.rememberPwd) {
uni.setStorage({
key: "loginInfo",
data: {...this.userInfo,'rememberPwd':true},
data: { ...this.userInfo, 'rememberPwd': true },
});
}else{
} else {
uni.setStorage({
key: "loginInfo",
data: {'rememberPwd':false},
data: { 'rememberPwd': false },
});
}
//
this.$u.api
.login(bjectToQueryString(formdata))
.login(bjectToQueryString(formdata), formdata)
.then((res) => {
uni.setStorage({
key: "userinfo",
data: res,
@ -114,12 +121,18 @@ export default {
key: "token",
data: res.access_token,
});
this.$store.dispatch("changeTabbar", res.role_id);
console.log(555555555,res.detail.status)
this.$store.dispatch("changeTabbar", res);
this.$refs.BetLoading.hide();
})
.catch((err) => {
if (err.error_code == 2004) {
uni.redirectTo({
url: "/pages/login/authInfo",
});
return false
}
this.$refs.BetLoading.hide();
});
},

@ -2,7 +2,7 @@
<view class="page-css sp-my-new">
<view class="info-top sp-my-new-header">
<view class="top-item">
<image :src="userIfo.avatar
<image :src="userIfo.avatar != ''
? userIfo.avatar
: require('@/static/images/avatr.png')
" alt="" />
@ -11,11 +11,12 @@
<view class="top-name">{{ userIfo.businessName }}{{ userIfo.nick_name }}
<!-- <u-tag text="签约" type="warning" mode="plain"/> -->
</view>
<view class="top-phone">{{ userIfo.phoneNumber }}15053473693</view>
<view class="top-phone">{{ userIfo.user_name }}</view>
</view>
<view class="top-item"> {{ userIfo.area }} 山东济南</view>
<view class="top-item"> {{ userIfo.area }} </view>
</view>
<view class="feature-box">
<!-- -->
<view class="feature-box" v-if="status == 1">
<text>客户功能</text>
<view class="feature-list clearfix">
<view v-for="(item, index) in featureData" :key="index" class="list-item" @click="pageTo(item)">
@ -41,6 +42,7 @@ export default {
data() {
return {
userIfo: {}, //
status:null,
featureData: [
{
title: "登录记录",
@ -70,9 +72,12 @@ export default {
onShow() {
this.$nextTick(() => {
let info = uni.getStorageSync("userinfo");
if (info) {
this.userIfo = info;
this.userIfo = JSON.parse(JSON.stringify(info));
}
console.log(11111,this.userIfo)
this.status = this.userIfo.detail.status
this.$refs.tabbarRef.getPermission();
this.$refs.BetLoading.show();
setTimeout(() => {
@ -131,6 +136,8 @@ export default {
width: 136rpx;
height: 136rpx;
margin: 36rpx;
border-radius: 50%;
border: 1px solid #000;
image {
width: 100%;

@ -12,34 +12,15 @@ export default {
data() {
return {
tabList: [
{
name: "全部",
key: "9999",
},
{
name: "待接单",
key: "0",
},
{
name: "维修中",
key: "1,2,3",
},
{
name: "已完成",
key: "4,5,6",
},
],
tagColor: {
维修中: "#3A62D7",
待确认: "#81B337",
待提报: "#81B337",
已完成: "#CECECE",
待维修: '#E99D42'
}
};
},
computed: {
dataTypes() {
return this.$store.state.dataType
},
},
onReachBottom() {
uni.$emit('onReachBottom');
@ -50,9 +31,119 @@ export default {
},
onShow() {
this.$nextTick(() => {
console.log(999999)
this.$refs.tablist.getRecordsList()
this.$refs.tabbarRef.getPermission();
// 1839536982874193922
if (this.dataTypes == 2) {
this.tabList = [
{
name: "全部",
key: "9999",
},
{
name: "待提报",
key: "-1",
},
{
name: "待接单",
key: "0",
},
{
name: "待维修",
key: "2",
},
{
name: "维修完成",
key: "4",
},
{
name: "待评价",
key: "5",
},
{
name: "已完成",
key: "6",
},
{
name: "已驳回",
key: "7,8",
},
{
name: "已关闭",
key: "9",
},
]
}
// 1839537055389515777
if (this.dataTypes == 3) {
this.tabList = [
{
name: "全部",
key: "9999",
},
{
name: "待维修",
key: "2",
},
{
name: "维修完成",
key: "4",
},
{
name: "待评价",
key: "5",
},
{
name: "已完成",
key: "6",
},
{
name: "已驳回",
key: "7,8",
},
{
name: "已关闭",
key: "9",
},
]
}
// 1839552581620793346
if (this.dataTypes == 4) {
this.tabList = [
{
name: "全部",
key: "9999",
},
{
name: "待确认",
key: "1",
},
{
name: "待维修",
key: "2,3",
},
{
name: "维修完成",
key: "4",
},
{
name: "待评价",
key: "5",
},
{
name: "已完成",
key: "6",
},
{
name: "已驳回",
key: "7,8",
},
{
name: "已关闭",
key: "9",
},
]
}
});
},
methods: {

@ -146,13 +146,13 @@ export default {
showAreaModal: false,
countryData: [],
childArr: [], //
childArr: [], // 120.439196,36.171428
mapInfo: {
showMapSelect: false,
mapKey: '58235226b0fab29ed527bac25ec853ae',
address: '',
latitude: '',
longitude: '',
latitude: '120.439196',
longitude: '36.171428',
listIco: '/uni_modules/map-Point/static/item-inx.png',
orientationIco: '/uni_modules/map-Point/static/map-inx.png',
resettingIco: "/uni_modules/map-Point/static/position.png",

@ -1,6 +1,6 @@
<template>
<view class="page-css">
<betone-list :tabList="tabList"></betone-list>
<betone-list :tabList="tabList" type="submission"></betone-list>
<!-- <betone-tabbar ref="tabbarRef" /> -->
</view>
@ -20,12 +20,32 @@ export default {
key: "-1",
},
{
name: "维修中",
name: "待接单",
key: "0",
},
{
name: "待维修",
key: "1,2,3",
},
{
name: "已驳回",
key: "7,8",
},
{
name: "维修完成",
key: "4",
},
{
name: "待评价",
key: "5",
},
{
name: "已完成",
key: "4,5,6",
key: "6",
},
{
name: "已关闭",
key: "9",
},
],

@ -11,7 +11,7 @@ const store = new Vuex.Store({
},
getters: {},
actions: {
changeTabbar({ commit }, role_id) {
changeTabbar({ commit }, res) {
/*
admin 超管 1123598816738675201
客户 1846419477876510721
@ -19,39 +19,59 @@ const store = new Vuex.Store({
维修负责人 1839537055389515777
维修人员 1839552581620793346
*/
// console.log(66666666666,role_id)
if (role_id == "1123598816738675201" || role_id == "1846419477876510721") {
commit('updateDatatype', 1) //客户
commit('updateTabbar', tabBar.member)
if (res.detail.status == 90) {
commit('updateTabbar', tabBar.oathTab)
uni.reLaunch({
url: "/pages/home/index",
});
}
if (role_id == "1839536982874193922") {
commit('updateDatatype', 2) //客服
commit('updateTabbar', tabBar.ordinary)
uni.reLaunch({
url: "/pages/order/tasking",
});
}
if (role_id == "1839537055389515777") {
commit('updateDatatype', 3) //维修负责人
commit('updateTabbar', tabBar.manage)
uni.reLaunch({
url: "/pages/order/tasking",
});
}
if (role_id == "1839552581620793346") {
commit('updateDatatype', 4) //维修人员
commit('updateTabbar', tabBar.repair)
uni.reLaunch({
url: "/pages/order/tasking",
url: "/pages/login/authInfo",
});
} else {
// console.log(66666666666,role_id)
if (res.role_id == "1123598816738675201" || res.role_id == "1846419477876510721") {
commit('updateDatatype', 1) //客户
commit('updateTabbar', tabBar.member)
uni.reLaunch({
url: "/pages/home/index",
});
}
if (res.role_id == "1839536982874193922") {
commit('updateDatatype', 2) //客服
commit('updateTabbar', tabBar.ordinary)
// 如果是维修人员登录 则实时更新当前维修人员的位置
uni.reLaunch({
url: "/pages/order/tasking",
});
}
if (res.role_id == "1839537055389515777") {
commit('updateDatatype', 3) //维修负责人
commit('updateTabbar', tabBar.manage)
uni.reLaunch({
url: "/pages/order/tasking",
});
}
if (res.role_id == "1839552581620793346") {
commit('updateDatatype', 4) //维修人员
commit('updateTabbar', tabBar.repair)
uni.reLaunch({
url: "/pages/order/tasking",
});
// 如果是维修人员登录 则实时更新当前维修人员的位置
}
}
},
changeDatatype({ commit }, type) {
commit('updateTabbar', payload)

@ -32,7 +32,7 @@ const install = (Vue, vm) => {
// config.headers.BladeAuth = 'bearer ' + token
config.header[website.tokenHeader] = 'bearer ' + token
}
const authorization = config.header.authorization == false;
const authorization = config.header.authorizations == false;
if (!authorization) {
config.header['Authorization'] = `Basic ${Base64.encode(`${website.clientId}:${website.clientSecret}`)}`;
}
@ -40,7 +40,7 @@ const install = (Vue, vm) => {
config.params = config.data
}
// 判断是否登录接口
if (config.url == '/blade-auth/oauth/token') {
if (config.url.indexOf('/blade-auth/oauth/token')>=0) {
config.header['Tenant-Id'] = config.data.tenantId
config.header['Dept-Id'] = ''
config.header['Role-Id'] = ''
@ -59,7 +59,6 @@ const install = (Vue, vm) => {
const data = res
let status = res.code || res.status;
const message = res.msg || res.error_description || '未知错误';
console.log(555555555,status)
if (!!res.error_code) {
uni.showToast({
title: res.error_description,

@ -4,7 +4,7 @@ const ordinary = [{
selectedIconPath: "photo-fill",
text: "接单记录",
pagePath: "/pages/order/tasking",
}, {
}, {
iconPath: "account",
selectedIconPath: "account-fill",
text: "我的",
@ -63,9 +63,22 @@ const repair = [{
text: "我的",
pagePath: "/pages/my/my",
}]
const oathTab = [{
iconPath: "photo",
selectedIconPath: "photo-fill",
text: "工作台",
pagePath: "/pages/login/authInfo",
},
{
iconPath: "account",
selectedIconPath: "account-fill",
text: "我的",
pagePath: "/pages/my/my",
}]
export default {
ordinary,
member,
manage,
repair
repair,
oathTab
}

@ -2,12 +2,12 @@
* 全局配置文件
*/
export default {
baseUrl: 'http://124.221.142.15:8088/lab',
// baseUrl:'http://192.168.0.111:80',
// baseUrl: 'http://124.221.142.15:8088/lab',
baseUrl:'http://192.168.0.111:80',
indexTitle: "科研医疗建筑运维平台",
clientId: "saber", // 客户端id
clientSecret: "saber_secret", // 客户端密钥
tokenTime: 3000,
tokenHeader: "Blade-Auth",
publicKey:"044803cada544d84eddc70b57549ccb7567546f3590c3905f9e5503e2fb5e3ea00cc88e7a382bf679e4ca9456b2aff5275015ccdd1cb986d53b82c6b337ae7116c"
};
Loading…
Cancel
Save