heyang 11 місяців тому
батько
коміт
94a168d118

+ 20 - 1
api/basicsModules/index.js

@@ -205,6 +205,24 @@ export const systemAppletRolePermission = (data) => {
 
 
 
+/************************扫码相关************************/
+
+//化学品终端-扫码登录
+export const chemicalAioVerifyScanLogin  = (data) => {
+	return apiResquest({
+		url: `/chemical/aio/verify/scanLogin`,
+		method: 'GET',
+		data: data,
+	})
+};
+//化学品终端-双人认证
+export const chemicalAioVerifyAppletLogin  = (data) => {
+	return apiResquest({
+		url: `/chemical/aio/verify/appletLogin`,
+		method: 'GET',
+		data: data,
+	})
+};
 
 
 /************************未调试************************/
@@ -227,4 +245,5 @@ export const gradingControl  = (data) => {
         method: 'POST',
         data: {...data}
     })
-};
+};
+

+ 44 - 0
component/public.js

@@ -0,0 +1,44 @@
+// 日期格式化
+export function parseTime(time, pattern) {
+	if (arguments.length === 0 || !time) {
+		return null
+	}
+	if(time.indexOf('T')!== -1){
+    let newTime = time.split('T')
+    time = newTime[0] + ' ' + newTime[1]
+  }
+	const format = pattern || '{y}-{m}-{d} {h}:{i}:{s}'
+	let date
+	if (typeof time === 'object') {
+		date = time
+	} else {
+		if ((typeof time === 'string') && (/^[0-9]+$/.test(time))) {
+			time = parseInt(time)
+		} else if (typeof time === 'string') {
+			time = time.replace(new RegExp(/-/gm), '/');
+		}
+		if ((typeof time === 'number') && (time.toString().length === 10)) {
+			time = time * 1000
+		}
+		date = new Date(time)
+	}
+	const formatObj = {
+		y: date.getFullYear(),
+		m: date.getMonth() + 1,
+		d: date.getDate(),
+		h: date.getHours(),
+		i: date.getMinutes(),
+		s: date.getSeconds(),
+		a: date.getDay()
+	}
+	const time_str = format.replace(/{(y|m|d|h|i|s|a)+}/g, (result, key) => {
+		let value = formatObj[key]
+		// Note: getDay() returns 0 on Sunday
+		if (key === 'a') { return ['日', '一', '二', '三', '四', '五', '六'][value] }
+		if (result.length > 0 && value < 10) {
+			value = '0' + value
+		}
+		return value || 0
+	})
+	return time_str
+}

BIN
images/basicsModules/icon_pzjc_xz.png


+ 1 - 1
manifest.json

@@ -50,7 +50,7 @@
     "quickapp" : {},
     /* 小程序特有相关 */
     "mp-weixin" : {
-        "appid" : "wx0cbc02ca7f6e7f25",
+        "appid" : "wx60e12abd2e79c618",
         "setting" : {
             "urlCheck" : false,
             "minified" : true

+ 8 - 6
pages.json

@@ -34,12 +34,6 @@
 				"navigationStyle": "custom"
 			}
 		},
-		{
-			"path": "pages/saoCode/saoCode",//扫码识别
-			"style": {
-				"navigationBarTitleText": ""
-			}
-		},
 		{
 			"path": "pages/pages_patrolInspector/chemicalDetail",
 			"style": {
@@ -99,6 +93,14 @@
 			"style": {
 				"navigationBarTitleText": "立即催办"
 			}
+		},
+		{
+			"path": "pages/saoCode/saoCode",//扫码中转
+			"style": {
+				"navigationBarTitleText": "",
+				"navigationBarTextStyle": "white", //导航文字颜色
+				"navigationBarBackgroundColor": "#0183FA" //导航背景色
+			}
 		}
 	],
 	"subPackages": [

+ 361 - 252
pages/login/login.vue

@@ -3,27 +3,27 @@
   <view id="login">
     <img class="login-max-big" :src="loginBanner">
     <view class="login-box">
-	  <view class="tabTitle">
-	  	<view class="tabTitle_li" @tap="tabClick(index)"  :key="index" v-for="(item,index) in tabText">
-	  		<view :class="{on:curTab==index}" class="tabTitle_text">{{item}}</view>
-	  	    <view :class="{on:curTab==index}" class="tabTitle_across"></view>
-	  	</view>
-	  </view>
+      <view class="tabTitle">
+        <view class="tabTitle_li" @tap="tabClick(index)" :key="index" v-for="(item,index) in tabText">
+          <view :class="{on:curTab==index}" class="tabTitle_text">{{item}}</view>
+          <view :class="{on:curTab==index}" class="tabTitle_across"></view>
+        </view>
+      </view>
       <view class="input-max-box-one">
         <view class="input-box">
-          <img src="@/images/basicsModules/img_log_in_account.png"/>
+          <img src="@/images/basicsModules/img_log_in_account.png" />
           <input type="text" v-model="username" placeholder="请输入账号" maxlength="20">
         </view>
       </view>
       <view class="input-max-box-two">
         <view class="input-box">
-          <img src="@/images/basicsModules/img_log_in_password.png"/>
+          <img src="@/images/basicsModules/img_log_in_password.png" />
           <input type="password" v-model="password" placeholder="请输入密码" maxlength="20">
         </view>
       </view>
       <view class="check-box" @click="checkboxChange">
-        <img v-if="checkedType" src="@/images/basicsModules/icon_13.png"/>
-        <img v-if="!checkedType" src="@/images/basicsModules/icon_12.png"/>
+        <img v-if="checkedType" src="@/images/basicsModules/icon_13.png" />
+        <img v-if="!checkedType" src="@/images/basicsModules/icon_12.png" />
         <view>记住我</view>
       </view>
       <view class="button-box" @click="login">登录</view>
@@ -37,33 +37,44 @@
 
 <script>
 import md5 from '@/utils/md5.js'
-import { config } from '@/api/request/config.js'
-import { login,configInfo,getLogoInfo,getConfigByType,systemAppletRolePermission} from '@/api/basicsModules/index.js'
-import { Encrypt,Decrypt} from '@/utils/secret.js'
+import {
+  config
+} from '@/api/request/config.js'
+import {
+  login,
+  configInfo,
+  getConfigByType,
+  getGentleIdentifier,
+  systemAppletRolePermission
+} from '@/api/basicsModules/index.js'
+import {
+  Encrypt,
+  Decrypt
+} from '@/utils/secret.js'
 export default {
   data() {
     return {
-      identityStatus:1,
+      identityStatus: 1,
       // username:"superadmin",
       // password:"zd123456",
-      username:"789654",
-      password:"zd123456",
-      checkedType:false,
-      loginBanner:uni.getStorageSync('loginBanner'),
-      infoList:[],//模板消息Id
-      tabText:['师生登录','供应商登录'],
-      curTab:0,
-      pageType:0,
-	  supplierType:false,
+      username: "sudiyu",
+      password: "zd123456",
+      checkedType: false,
+      loginBanner: uni.getStorageSync('loginBanner'),
+      infoList: [], //模板消息Id
+      tabText: ['师生登录', '供应商登录'],
+      curTab: 0,
+      pageType: 0,
+      supplierType: false,
     }
   },
 
   onLoad(option) {
     //供应商注册成功后返回到供应商注册页面
-    if(option.status){
-      this.identityStatus=2
+    if (option.status) {
+      this.identityStatus = 2
     }
-    if(uni.getStorageSync('userName') && uni.getStorageSync('password')){
+    if (uni.getStorageSync('userName') && uni.getStorageSync('password')) {
       this.username = uni.getStorageSync('userName');
       this.password = uni.getStorageSync('password');
       this.checkedType = true;
@@ -71,120 +82,187 @@ export default {
 
 
   },
-  onShow(){
-    this.getConfigInfo();
-    this.getLogoInfo();
+  onShow() {
+    // this.getConfigInfo();
   },
   methods: {
     //顶部tab点击
     tabClick(index) {
       this.curTab = index;
     },
-	  //登录
+    //登录
     async login() {
       let self = this;
       let obj = {
-        account:this.username,
-        password:md5.hex_md5(this.password),
+        account: this.username,
+        password: md5.hex_md5(this.password),
       }
-      const {data} = await login(obj)
-      if(data.code == 200){
-        //uni.setStorageSync('token',data.data.token);
-        uni.setStorageSync('token','2be4d101-2456-46d1-87ee-c1658ef21d2d');
-        uni.setStorageSync('userId',data.data.userId);
-         // userType 0-系统 1-教职工 2-学生 3-大屏
-        uni.setStorageSync('userType',data.data.userType==0||data.data.userType==1?'11':(data.data.userType==2?'22':(data.data.userType==3?'3':'none')));
-        uni.setStorageSync('userType','1');
-        if(this.checkedType){
-          uni.setStorageSync('userName',this.username)
-          uni.setStorageSync('password',this.password)
-        }else{
+      const {
+        data
+      } = await login(obj)
+      if (data.code == 200) {
+        uni.setStorageSync('token', data.data.token);
+        uni.setStorageSync('userId', data.data.userId);
+        // userType 0-系统 1-教职工 2-学生 3-大屏
+        uni.setStorageSync('userType', data.data.userType == 0 || data.data.userType == 1 ? '1' :
+            (data.data.userType == 2 ? '2' : (data.data.userType == 3 ? '3' : 'none')));
+        if (this.checkedType) {
+          uni.setStorageSync('userName', this.username)
+          uni.setStorageSync('password', this.password)
+        } else {
           uni.removeStorageSync('userName')
           uni.removeStorageSync('password')
         }
-      //等待配置与字段获取到后跳转
-      Promise.all([
-        //获取开发配置
-        this.getConfigByType(),
-        //获取权限字段
-        this.systemAppletRolePermission()
-      ]).then((result)=>{
-        uni.redirectTo({
-          url: '/pages/home/home',
-        });
-      }).catch((error) => {
-        wx.showToast({
-          title: '数据异常,请稍候再试!',
-          icon: "none",
-          duration: 3000
-        });
-      })
+        //等待配置与字段获取到后跳转
+        Promise.all([
+          //获取开发配置
+          this.getConfigByType(),
+          //获取权限字段
+          this.systemAppletRolePermission()
+        ]).then((result) => {
+          if(uni.getStorageSync('codeData')){
+            uni.redirectTo({
+              url: '/pages/saoCode/saoCode',
+            });
+          }else{
+            uni.redirectTo({
+              url: '/pages/mine/mine',
+            });
+          }
+        }).catch((error) => {
+          wx.showToast({
+            title: '数据异常,请稍候再试!',
+            icon: "none",
+            duration: 3000
+          });
+        })
+
+
+
+        //获取身份标识
+        // this.getGentleIdentifier();
+      }
+    },
+    //获取权限字段
+    async systemAppletRolePermission() {
+      let self = this;
+      const {
+        data
+      } = await systemAppletRolePermission();
+      if (data.code == 200) {
+        uni.setStorageSync('permissions', data.data.data)
       }
     },
-    //获取公共配置的图片
-	async getLogoInfo(){
-      const {data} = await getLogoInfo();
-      if(data.code == 200){
-        this.loginBanner = config.base_url + data.data.loginBanner;
-        uni.setStorageSync('circularLogo',config.base_url + data.data.circularLogo)
-        uni.setStorageSync('loginBanner',config.base_url + data.data.loginBanner)
-        uni.setStorageSync('homepageBanner',config.base_url + data.data.homepageBanner)
-        uni.setStorageSync('videoCover',config.base_url + data.data.videoCover)
+    //获取用户身份标识"adminGentle": false,
+    //管理员身份 "rectifyGentle": false,
+    //整改身份"applyGentle": false    检查者身份
+    async getGentleIdentifier() {
+      let self = this;
+      const {
+        data
+      } = await getGentleIdentifier();
+      if (data.code == 200) {
+        uni.setStorageSync('gentleIdentifierData', data.data)
+        let list = [];
+        if (data.data.adminGentle || data.data.collegeGentle) { //校级管理员
+          list.push({
+            name: '管理员',
+            pageType: 1
+          })
+        }
+        if (data.data.applyGentle || data.data.myApplyGentle) {
+          list.push({
+            name: '检查者',
+            pageType: 2
+          })
+        }
+        if (data.data.rectifyGentle) {
+          list.push({
+            name: '整改者',
+            pageType: 3
+          })
+        }
+        if (!data.data.adminGentle && !data.data.applyGentle && !data.data.myApplyGentle && !data.data.applyGentle &&
+            !data.data.collegeGentle) {
+          self.pageType = 'mine'
+          list.push({
+            name: '暂无权限',
+            pageType: 'mine'
+          })
+        }
+        uni.setStorageSync('gentleIdentifier', list)
+        if (uni.getStorageSync('saoCode')) {
+          uni.redirectTo({
+            url: '/pages/saoCode/saoCode'
+          });
+        } else if (self.pageType == 'mine') {
+          uni.redirectTo({
+            url: '/pages/mine/mine',
+          });
+        } else {
+          uni.redirectTo({
+            url: '/pages/home/home',
+          });
+        }
       }
     },
-	//获取权限字段
-	async systemAppletRolePermission(){
-		let self = this;
-		const {data} = await systemAppletRolePermission();
-		if(data.code==200){
-			uni.setStorageSync('permissions',data.data.data)
-		}
-	},
-    switchClick(){
-      if(this.identityStatus==1){
-        this.identityStatus=2;
-      }else{
-        this.identityStatus=1;
+    switchClick() {
+      if (this.identityStatus == 1) {
+        this.identityStatus = 2;
+      } else {
+        this.identityStatus = 1;
       }
     },
-	//查询公共配置
-    async getConfigInfo(){
-      const {data} = await configInfo({ type: '1,2,4' });
-      if(data.code == 200){
-		let list = JSON.parse(data.data)
-		let newData = {};
-		list.forEach((item) => {
-			let obj = JSON.parse(item.configValue)
-			newData = {...newData,...obj}
-		})
-		uni.setStorageSync('circularLogo',config.base_url + newData.circularLogo)
-		uni.setStorageSync('videoCover',config.base_url + newData.videoCover)
-		this.$set(this,'loginBanner',config.base_url + newData.loginBanner);
-		uni.setStorageSync('loginBanner',config.base_url + newData.loginBanner)
-		this.$set(this,'supplierType',newData.supplier);
-		uni.setStorageSync('supplierType',newData.supplier)
-		uni.setStorageSync('homepageBanner',config.base_url + newData.homepageBanner)
+    //查询公共配置
+    async getConfigInfo() {
+      const {
+        data
+      } = await configInfo({
+        type: '1,2,4'
+      });
+      if (data.code == 200) {
+        let list = JSON.parse(data.data)
+        let newData = {};
+        list.forEach((item) => {
+          let obj = JSON.parse(item.configValue)
+          newData = {
+            ...newData,
+            ...obj
+          }
+        })
+        uni.setStorageSync('circularLogo', config.base_url + newData.circularLogo)
+        uni.setStorageSync('videoCover', config.base_url + newData.videoCover)
+        this.$set(this, 'loginBanner', config.base_url + newData.loginBanner);
+        uni.setStorageSync('loginBanner', config.base_url + newData.loginBanner)
+        this.$set(this, 'supplierType', newData.supplier);
+        uni.setStorageSync('supplierType', newData.supplier)
+        uni.setStorageSync('homepageBanner', config.base_url + newData.homepageBanner)
       }
     },
     //获取开发配置
-	async getConfigByType(){
-      const {data} = await getConfigByType({ category: 2, configType: 5 });
-      if(data.code == 200){
+    async getConfigByType() {
+      const {
+        data
+      } = await getConfigByType({
+        category: 2,
+        configType: 5
+      });
+      if (data.code == 200) {
         let obj = JSON.parse(data.data.configValue)
         //文件预览地址
-        uni.setStorageSync('filePreviewUrl','https://'+obj.fileExtranetUrl)
+        uni.setStorageSync('filePreviewUrl', 'https://' + obj.fileExtranetUrl)
         //摄像头代理访问地址
-        uni.setStorageSync('cameraExtranetAgent','https://'+obj.cameraExtranetAgent)
+        uni.setStorageSync('cameraExtranetAgent', 'https://' + obj.cameraExtranetAgent)
         //摄像头地址ip段
-        uni.setStorageSync('cameraIntranetAgent',obj.cameraIntranetAgent)
+        uni.setStorageSync('cameraIntranetAgent', obj.cameraIntranetAgent)
         //摄像头访问地址
-        uni.setStorageSync('cameraUrl','https://'+obj.cameraExtranetUrl)
+        uni.setStorageSync('cameraUrl', 'https://' + obj.cameraExtranetUrl)
         //MQTT地址
-        uni.setStorageSync('mqttUrl',Decrypt(obj.mqttExtranetUrl))
+        uni.setStorageSync('mqttUrl', Decrypt(obj.mqttExtranetUrl))
         //MQTT账号
-        uni.setStorageSync('mqttUser',Decrypt(obj.mqttExtranetUser))
+        uni.setStorageSync('mqttUser', Decrypt(obj.mqttExtranetUser))
         //MQTT密码
-        uni.setStorageSync('mqttPassword',Decrypt(obj.mqttExtranetPassword))
+        uni.setStorageSync('mqttPassword', Decrypt(obj.mqttExtranetPassword))
       }
     },
     checkboxChange() {
@@ -192,18 +270,17 @@ export default {
     },
     //点击事件
     handleClick(doType) {
-      if(doType=='register'){//供应商注册
+      if (doType == 'register') { //供应商注册
         uni.redirectTo({
           url: '/pages_supplier/register/register?pageStatus=0'
         });
-      }else if(doType=='forget'){//忘记密码
+      } else if (doType == 'forget') { //忘记密码
         uni.showModal({
-          showCancel:false,
-          confirmColor:'#0183FA',
+          showCancel: false,
+          confirmColor: '#0183FA',
           content: '请您联系学校相关管理人员申请重置密码',
-          success: function (res) {
-            if (res.confirm) {
-            }
+          success: function(res) {
+            if (res.confirm) {}
           }
         });
       }
@@ -215,176 +292,206 @@ export default {
 
 
 <style lang="stylus" scoped>
-#login{
-  height:100%;
-  width:100%;
-  background #f5f5f5
-  position relative
-  .login-max-big{
-    width:750rpx;
-    height:1177rpx;
-    z-index:0;
+#login {
+  height: 100%;
+  width: 100%;
+
+  background #f5f5f5;
+  position relative;
+
+  .login-max-big {
+    width: 750rpx;
+    height: 1177rpx;
+    z-index: 0;
   }
-  .login-box{
-    z-index:3;
-    position: absolute
+
+  .login-box {
+    z-index: 3;
+    position: absolute;
     top:446rpx;
-    left:46rpx;
-    width:658rpx;
-    height:700rpx;
+    left: 46rpx;
+    width: 658rpx;
+    height: 700rpx;
+
     // background #fff
-	/* 切换按钮 */
-	.tabTitle{
-		display flex;
-		width:100%;
-		height: 100rpx;
-		position: absolute;
-		top: 50rpx;
-		justify-content: center;
-		>view:nth-of-type(1){
-			margin-right: 100rpx;
-		}
-		.tabTitle_li{
-			width:168rpx;
-			text-align center;
-			.tabTitle_text{
-				display: inline-block;
-				font-size: 32rpx;
-				font-family: PingFang SC;
-				font-weight: 500;
-				color: #333333;
-				line-height: 90rpx;
-				&.on{
-					color:#0183FA;
-				}
-			}
-			.tabTitle_across{
-				width: 100rpx;
-				height: 4rpx;
-				background: #0183FA;
-				border-radius: 2rpx;
-				margin-left 30rpx;
-				display none;
-				&.on{
-					display block;
-				}
-			}
-
-		}
-	}
+    /* 切换按钮 */
+    .tabTitle {
+      display flex;
+      width: 100%;
+      height: 100rpx;
+      position: absolute;
+      top: 50rpx;
+      justify-content: center;
+
+      >view:nth-of-type(1) {
+        margin-right: 100rpx;
+      }
+
+      .tabTitle_li {
+        width: 168rpx;
+        text-align center;
+
+        .tabTitle_text {
+          display: inline-block;
+          font-size: 32rpx;
+          font-family: PingFang SC;
+          font-weight: 500;
+          color: #333333;
+          line-height: 90rpx;
+
+          &.on {
+            color: #0183FA;
+          }
+        }
+
+        .tabTitle_across {
+          width: 100rpx;
+          height: 4rpx;
+          background: #0183FA;
+          border-radius: 2rpx;
+          margin-left 30rpx;
+          display none;
+
+          &.on {
+            display block;
+          }
+        }
+
+      }
+    }
+
     border-radius:20rpx;
-    .input-max-box-one{
-		overflow: hidden;
-		margin-top:68rpx;
-      .input-box{
-        display flex
-        width:600rpx;
-        height:80rpx;
-        border:1rpx solid #e0e0e0;
-        border-radius:40rpx;
-        margin:147rpx auto 0;
-        img{
-          width:28rpx;
-          height:32rpx;
-          margin:24rpx 31rpx;
+
+    .input-max-box-one {
+      overflow: hidden;
+      margin-top: 68rpx;
+
+      .input-box {
+        display flex;
+        width: 600rpx;
+        height: 80rpx;
+        border: 1rpx solid #e0e0e0;
+        border-radius: 40rpx;
+        margin: 147rpx auto 0;
+
+        img {
+          width: 28rpx;
+          height: 32rpx;
+          margin: 24rpx 31rpx;
         }
-        input{
-          flex:1;
-          font-size:24rpx;
-          height:80rpx;
-          line-height:80rpx;
-          margin-right:31rpx;
+
+        input {
+          flex: 1;
+          font-size: 24rpx;
+          height: 80rpx;
+          line-height: 80rpx;
+          margin-right: 31rpx;
         }
       }
-      .text-box{
-        height:59rpx;
-        line-height:59rpx;
-        color:#DC1616;
-        font-size:24rpx;
-        margin-left:102rpx;
+
+      .text-box {
+        height: 59rpx;
+        line-height: 59rpx;
+        color: #DC1616;
+        font-size: 24rpx;
+        margin-left: 102rpx;
       }
     }
-    .input-max-box-two{
-      margin-top:40rpx;
-      .input-box{
-        display flex
-        width:600rpx;
-        height:80rpx;
-        border:1rpx solid #e0e0e0;
-        border-radius:40rpx;
-        margin:0 auto 0;
-        img{
-          width:30rpx;
-          height:32rpx;
-          margin:24rpx 30rpx;
+
+    .input-max-box-two {
+      margin-top: 40rpx;
+
+      .input-box {
+        display flex;
+        width: 600rpx;
+        height: 80rpx;
+        border: 1rpx solid #e0e0e0;
+        border-radius: 40rpx;
+        margin: 0 auto 0;
+
+        img {
+          width: 30rpx;
+          height: 32rpx;
+          margin: 24rpx 30rpx;
         }
-        input{
-          flex:1;
-          font-size:24rpx;
-          height:80rpx;
-          line-height:80rpx;
-          margin-right:31rpx;
+
+        input {
+          flex: 1;
+          font-size: 24rpx;
+          height: 80rpx;
+          line-height: 80rpx;
+          margin-right: 31rpx;
         }
       }
-      .text-box{
-        height:59rpx;
-        line-height:59rpx;
-        color:#DC1616;
-        font-size:24rpx;
-        margin-left:102rpx;
+
+      .text-box {
+        height: 59rpx;
+        line-height: 59rpx;
+        color: #DC1616;
+        font-size: 24rpx;
+        margin-left: 102rpx;
       }
     }
-    .check-box{
-      margin:30rpx 0 30rpx 104rpx;
-      width:300rpx;
-      height:50rpx;
-      display:flex;
-      img{
-        margin-top:10rpx;
-        width:32rpx;
-        height:32rpx;
-        margin-right:10rpx;
+
+    .check-box {
+      margin: 30rpx 0 30rpx 104rpx;
+      width: 300rpx;
+      height: 50rpx;
+      display: flex;
+
+      img {
+        margin-top: 10rpx;
+        width: 32rpx;
+        height: 32rpx;
+        margin-right: 10rpx;
       }
-      view{
-        font-size:24rpx;
-        line-height:50rpx;
+
+      view {
+        font-size: 24rpx;
+        line-height: 50rpx;
       }
     }
-    .button-box{
+
+    .button-box {
       width: 600rpx;
       line-height: 80rpx;
       background: #0183FA;
       border-radius: 40rpx;
       font-size: 36rpx;
-      color:#fff;
-      text-align center
-      margin:0 auto 0;
+      color: #fff;
+      text-align center;
+      margin: 0 auto 0;
     }
+
     /* 供应商注册 */
-    .supplier{
+    .supplier {
       display: flex;
       justify-content: space-between;
-      margin:30rpx 40rpx 0;
-      .supplier_l{
+      margin: 30rpx 40rpx 0;
+
+      .supplier_l {
         font-size: 24rpx;
         font-family: PingFang SC;
         font-weight: 400;
         color: #333333;
         line-height: 24rpx;
       }
-      .supplier_r{
+
+      .supplier_r {
         font-size: 24rpx;
         font-family: PingFang SC;
         font-weight: 400;
         color: #333333;
         line-height: 24rpx;
-        >text{
+
+        >text {
           color: #0183FA;
         }
       }
     }
+
     /* 供应商切换 */
-    .switch_btn{
+    .switch_btn {
       display: flex;
       justify-content: center;
       align-items: center;
@@ -394,20 +501,22 @@ export default {
       color: #0183FA;
       line-height: 24rpx;
       margin-top: 60rpx;
-      >img{
+
+      >img {
         width: 24rpx;
         height: 24rpx;
         margin-left: 12rpx;
       }
     }
   }
-  .top-back{
-    z-index:2;
-    position: absolute
+
+  .top-back {
+    z-index: 2;
+    position: absolute;
     top:261rpx;
-    left:375rpx;
-    height:296rpx;
-    width:366rpx;
+    left: 375rpx;
+    height: 296rpx;
+    width: 366rpx;
   }
 }
 </style>

+ 422 - 318
pages/mine/mine.vue

@@ -3,15 +3,15 @@
   <view id="mine">
     <view class="top-max-big-box" v-if="pageType">
       <!--老师-->
-      <view class="top-max-box-two" v-if="userType==1">
+      <view class="top-max-box-two" v-if="userType==1&&certification.auditStatus">
         <view class="user-img-box" @click="selectImage">
-          <img v-if="userData.avatar" :src="baseUrl+userData.avatar">
-          <img v-else  src="@/images/basicsModules/icon_01.png">
+          <img v-if="userData.avatar" :src="userData.avatarUrl">
+          <img v-else src="@/images/basicsModules/icon_01.png">
           <view>{{userData.avatar?'编辑':'未上传'}}</view>
         </view>
         <view class="name-box">
           <view>{{userData.userName}}</view>
-          <view>{{userData.deptName}}</view>
+          <view>{{userData.professional}}丨{{userData.deptName}}</view>
         </view>
       </view>
       <!--学生-->
@@ -20,13 +20,16 @@
         <view class="top-max-box-one">
           <view class="user-img-box" @click="selectImage">
             <img v-if="userData.avatar" :src="userData.avatarUrl">
-            <img v-else  src="@/images/basicsModules/icon_01.png">
+            <img v-else src="@/images/basicsModules/icon_01.png">
             <view>{{userData.avatar?'编辑':'未上传'}}</view>
           </view>
           <view class="name-box">
             <view class="name-box-min">
               <view>{{userData.userName}}</view>
-              <view :class="userData.status == 2?'view-color-one':(userData.status == 3?'view-color-two':(userData.status == 1?'view-color-tree':''))">{{userData.status == 2?'负面清单':(userData.status == 3?'黑名单':(userData.status == 1?'正常':''))}}</view>
+              <view
+                  :class="userData.status == 2?'view-color-one':(userData.status == 3?'view-color-two':(userData.status == 1?'view-color-tree':''))">
+                {{userData.status == 2?'负面清单':(userData.status == 3?'黑名单':(userData.status == 1?'正常':''))}}
+              </view>
             </view>
             <view class="name-box-user">{{userData.professional}}丨{{userData.deptName}}</view>
           </view>
@@ -57,72 +60,91 @@
           </view>
         </view>
       </view>
+
     </view>
-    <mineConfigurationSlot v-for="(item,index) in mineConfigData" :key="index" :mineConfig="item"></mineConfigurationSlot>
-	<view class="out-button" @click="clickOut">退出登录</view>
+
+    <mineConfigurationSlot v-for="(item,index) in mineConfigData" :key="index" :mineConfig="item">
+    </mineConfigurationSlot>
+    <view class="out-button" @click="clickOut">退出登录</view>
     <tab-bar></tab-bar>
   </view>
 </template>
 
 <script>
-import { config } from '@/api/request/config.js'
-import { logout,studentinfoFacemy,simpleInfo,getSafeWarnList,getMyPointsLogInfo,
-		querySignature,fingerprintQuantity,fingerprintQueryList,systemAppletLayoutSelect,systemUserProfile} from '@/api/basicsModules/index.js'
-import { tabBar } from '@/component/tabBar.vue'
-
-	import { mineConfigurationSlot } from '@/component/mineConfigurationSlot'
-	import { getMineConfig } from '@/utils/mineConfig'
-	
+import {
+  config
+} from '@/api/request/config.js'
+import {
+  logout,
+  studentinfoFacemy,
+  simpleInfo,
+  getSafeWarnList,
+  getMyPointsLogInfo,
+  querySignature,
+  fingerprintQuantity,
+  fingerprintQueryList,
+  systemAppletLayoutSelect
+} from '@/api/basicsModules/index.js'
+import {
+  tabBar
+} from '@/component/tabBar.vue'
+
+import {
+  mineConfigurationSlot
+} from '@/component/mineConfigurationSlot'
+import {
+  getMineConfig
+} from '@/utils/mineConfig'
+
 export default {
   components: {
     tabBar,
-	mineConfigurationSlot,
+    mineConfigurationSlot,
   },
   data() {
     return {
-		baseUrl:config.base_url,
-	  mineConfigData: [],
+      mineConfigData: [],
       //页面状态
-      pageType:false,
+      pageType: false,
       //认证数据
-      certification:{
+      certification: {
 
       },
-      userType:0,
-      userData:{
+      userType: 0,
+      userData: {
         deptName: "",
         professional: "",
         userName: "",
       },
-      securityAlertNum:0,
-      adminSubCount:0,
-      wranDoCount:0,
+      securityAlertNum: 0,
+      adminSubCount: 0,
+      wranDoCount: 0,
       //奖励分
-      bonusPoints:0,
+      bonusPoints: 0,
       //信用分
-      creditScore:0,
+      creditScore: 0,
       //用户签名
-      signatureUrl:'',
+      signatureUrl: '',
       // 人脸
-      ifFaceFeature:"",
+      ifFaceFeature: "",
       //签名
-      isUpload:"",
-      Quantity:0,//指纹录取数量
+      isUpload: "",
+      Quantity: 0, //指纹录取数量
 
     }
   },
   onLoad() {
-	
+
   },
-  onShow(){
-	this.simpleInfo();
-	this.systemAppletLayoutSelect();
-    if(uni.getStorageSync('token')&&uni.getStorageSync('userId')&&uni.getStorageSync('userType')){
-	  this.userType = uni.getStorageSync('userType')
+  onShow() {
+
+    this.systemAppletLayoutSelect();
+    if (uni.getStorageSync('token') && uni.getStorageSync('userId') && uni.getStorageSync('userType')) {
+      this.userType = uni.getStorageSync('userType')
       this.studentinfoFacemy();
-      
+      this.simpleInfo();
       this.querySignature();
-    }else{
+    } else {
       uni.removeStorageSync('token');
       uni.removeStorageSync('userId');
       uni.removeStorageSync('userType');
@@ -133,176 +155,210 @@ export default {
   },
 
   methods: {
-	//获取菜单配置
-	async systemAppletLayoutSelect() {
-		const {data} = await systemAppletLayoutSelect({module:'mine'})
-		if(data.code == 200){
-		  let list = JSON.parse(JSON.stringify(data.data))
-		  for(let i=0;i<list.length;i++){
-			list[i].layout = JSON.parse(list[i].layout);
-		  }
-		  this.$set(this,'mineConfigData',getMineConfig(list));
-		  console.log('mineConfigData',this.mineConfigData)
-		}
-	},
+    //获取菜单配置
+    async systemAppletLayoutSelect() {
+      const {
+        data
+      } = await systemAppletLayoutSelect({
+        module: 'mine'
+      })
+      if (data.code == 200) {
+        let list = JSON.parse(JSON.stringify(data.data))
+        for (let i = 0; i < list.length; i++) {
+          list[i].layout = JSON.parse(list[i].layout);
+        }
+        this.$set(this, 'mineConfigData', getMineConfig(list));
+        console.log('mineConfigData', this.mineConfigData)
+      }
+    },
     //学生端-信用分/奖励分/扫一扫按钮
-    goUserPage(type){
+    goUserPage(type) {
       let self = this;
-      if(type == 1){
+      if (type == 1) {
         uni.navigateTo({
           url: '/pages_student/mine/creditPoints',
         });
-      }else if(type == 2){
+      } else if (type == 2) {
         uni.navigateTo({
           url: '/pages_student/mine/rewardPoints',
         });
-      }else if(type == 3){
+      } else if (type == 3) {
         uni.scanCode({
           onlyFromCamera: true,
-          success: function (res) {
+          success: function(res) {
             uni.navigateTo({
-              url: '/pages_student/integralManage/codeSuccess?q='+encodeURIComponent(JSON.stringify(res.result))
+              url: '/pages_student/mine/codeSuccess?q=' + encodeURIComponent(JSON.stringify(res.result))
             });
           }
         });
-      }else if(type == 'none'){
-		  uni.showToast({
-		    title: '暂未开放',
-		    icon:"none",
-		    mask:true,
-		    duration: 2000
-		  });
-	  }
+      } else if (type == 'none') {
+        uni.showToast({
+          title: '暂未开放',
+          icon: "none",
+          mask: true,
+          duration: 2000
+        });
+      }
     },
     //获取个人信息
-    async simpleInfo(){
-      const {data} = await systemUserProfile();
-      if(data.code == 200){
-		this.$set(this,'userData',data.data)
-		uni.setStorageSync('faceImg',data.data.faceImg);
-		this.$set(this,'pageType',true)
+    async simpleInfo() {
+      const {
+        data
+      } = await simpleInfo();
+      if (data.code == 200) {
+        this.userData = data.data;
+        this.userData.avatar = data.data.avatar;
+
+        this.userData.avatarUrl = config.base_url + data.data.avatar;
+        console.log(config.base_url)
+        console.log(this.userData.avatarUrl)
+        if (this.userType == 1) {
+          this.getSafeWarnList();
+        } else if (this.userType == 2) {
+          //this.getMyPointsLogInfo();
+        }
+        if (data.data.count) {
+          this.adminSubCount = data.data.count.adminSubCount;
+          this.wranDoCount = data.data.count.wranDoCount;
+        }
+        this.pageType = true;
       }
     },
 
     //查询用户指纹录取数量
-    async fingerprintQuantityFun(){
-      let _this=this;
-      const {data} = await fingerprintQuantity(uni.getStorageSync('userId'));
-      if(data.code == 200){
-        _this.Quantity=data.data;
+    async fingerprintQuantityFun() {
+      let _this = this;
+      const {
+        data
+      } = await fingerprintQuantity(uni.getStorageSync('userId'));
+      if (data.code == 200) {
+        _this.Quantity = data.data;
 
       }
     },
     //查询用户指纹录取数据
-    async fingerprintClick(){
-      let _this=this;
-      const {data} = await fingerprintQueryList(uni.getStorageSync('userId'));
-      if(data.code == 200){
+    async fingerprintClick() {
+      let _this = this;
+      const {
+        data
+      } = await fingerprintQueryList(uni.getStorageSync('userId'));
+      if (data.code == 200) {
         uni.navigateTo({
-          url: '/pages/fingerprint',//指纹信息
+          url: '/pages/fingerprint', //指纹信息
         });
       }
     },
     //查询用户电子签名
-    async querySignature(){
-      let _this=this;
-      const {data} = await querySignature();
-      if(data.code == 200){
+    async querySignature() {
+      let _this = this;
+      const {
+        data
+      } = await querySignature();
+      if (data.code == 200) {
 
-        _this.isUpload=data.data.isUpload;
-        _this.signatureUrl=data.data.signature;
+        _this.isUpload = data.data.isUpload;
+        _this.signatureUrl = data.data.signature;
       }
     },
     //获取个人奖励分/信用分
-    async getMyPointsLogInfo(){
-      const {data} = await getMyPointsLogInfo();
-      if(data.code == 200){
+    async getMyPointsLogInfo() {
+      const {
+        data
+      } = await getMyPointsLogInfo();
+      if (data.code == 200) {
         this.bonusPoints = data.data.bonusPoints;
         this.creditScore = data.data.creditScore;
       }
     },
     //获取报警信息列表
-    async getSafeWarnList(){
+    async getSafeWarnList() {
       let obj = {
-        pageNum:1,
-        pageSize:1,
-        count:0,
-        groupStatus:1,
+        pageNum: 1,
+        pageSize: 1,
+        count: 0,
+        groupStatus: 1,
       };
-      const {data} = await getSafeWarnList(obj);
-      if(data.code == 200){
-        if(data.rows[0]){
+      const {
+        data
+      } = await getSafeWarnList(obj);
+      if (data.code == 200) {
+        if (data.rows[0]) {
           this.securityAlertNum = data.rows[0].todayHappenCount;
-        }else{
+        } else {
           this.securityAlertNum = 0;
         }
       }
     },
     //获取当前身份人脸验证状态与学生卡上传状态
-    async studentinfoFacemy(){
+    async studentinfoFacemy() {
       let obj = {
-        studentsId:uni.getStorageSync('userId')
+        studentsId: uni.getStorageSync('userId')
       }
-      const {data} = await studentinfoFacemy(obj)
-      if(data.code == 200){
+      const {
+        data
+      } = await studentinfoFacemy(obj)
+      if (data.code == 200) {
         this.certification = data.data;
         this.ifFaceFeature = data.data.ifFaceFeature;
       }
     },
     //退出按钮
-    clickOut(){
+    clickOut() {
       let self = this;
       uni.showModal({
         // title: '确认要退出吗?',
         content: '确认要退出吗',
-        cancelColor:"#999",
-        confirmColor:"#0183FA",
-        success: function (res) {
+        cancelColor: "#999",
+        confirmColor: "#0183FA",
+        success: function(res) {
           if (res.confirm) {
             self.logout();
-          } else if (res.cancel) {
-          }
+          } else if (res.cancel) {}
         }
       });
     },
     //退出登录
     async logout() {
-      let self = this;
-      const {data} = await logout();
-      if(data.code == 200){
-        uni.removeStorageSync('token');
-        uni.removeStorageSync('userId');
-        uni.removeStorageSync('userType');
-        uni.redirectTo({
-          url: '/pages/login/login',
-        });
-      }
+      uni.clearStorageSync();
+      uni.redirectTo({
+        url: '/pages/login/login',
+      });
+      // let self = this;
+      // const {data} = await logout();
+      // if(data.code == 200){
+      //   uni.removeStorageSync('token');
+      //   uni.removeStorageSync('userId');
+      //   uni.removeStorageSync('userType');
+      //   uni.redirectTo({
+      //     url: '/pages/login',
+      //   });
+      // }
     },
     //页面跳转
-    goPage(type){
-      if(type == 'pointsRecord'){//积分记录
+    goPage(type) {
+      if (type == 'pointsRecord') { //积分记录
         uni.navigateTo({
           url: '/pages_student/mine/pointsRecord',
         });
-      }else if(type == 'faceImage'){//身份验证
+      } else if (type == 'faceImage') { //身份验证
         uni.navigateTo({
           url: '/pages/faceImage',
         });
-      }else if(type == 'laboratory'){
+      } else if (type == 'laboratory') {
         uni.navigateTo({
-          url: '/pages_manage/workbench/laboratory/meLaboratory',//我的实验室
+          url: '/pages_manage/workbench/laboratory/meLaboratory', //我的实验室
         });
-      }else if(type == 'alarm'){
+      } else if (type == 'alarm') {
         uni.navigateTo({
-		  url: '/pages/earlyWarningManage/earlyWarningList',//安全警报
-		});
-      }else if(type == 'record'){
+          url: '/pages/earlyWarningManage/earlyWarningList', //安全警报
+        });
+      } else if (type == 'record') {
         uni.navigateTo({
-          url: '/pages_manage/workbench/plan/planList',//预案执行记录
+          url: '/pages_manage/workbench/plan/planList', //预案执行记录
         });
-      }else if(type == 'signature'){
+      } else if (type == 'signature') {
         uni.navigateTo({
-          url: '/pages_manage/workbench/signature/signature?item='+this.signatureUrl,//电子签名
+          url: '/pages_manage/workbench/signature/signature?item=' + this.signatureUrl, //电子签名
         });
       }
 
@@ -321,15 +377,17 @@ export default {
         }
       });
     },
-    async uploadImg(tempFilePaths){
+    async uploadImg(tempFilePaths) {
       var self = this;
       uni.showLoading({
         title: '上传中',
         mask: true
       });
       uni.uploadFile({
-        url: config.base_url+'/system/file/upload', //仅为示例,非真实的接口地址
-        header:{'Authorization':uni.getStorageSync('token')},
+        url: config.base_url + '/base/file/upload', //仅为示例,非真实的接口地址
+        header: {
+          'Authorization': uni.getStorageSync('token')
+        },
         filePath: tempFilePaths,
         name: 'file',
         formData: {
@@ -337,18 +395,18 @@ export default {
         },
         success: (uploadFileRes) => {
           let res = JSON.parse(uploadFileRes.data);
-          if(res.code == 200){
+          if (res.code == 200) {
             uni.navigateTo({
-              url: '/pages_basics/avatar?src='+config.base_url+res.data.url,
+              url: '/pages/avatar?src=' + config.base_url + res.data.url, //预案执行记录
             });
 
 
 
-          }else{
+          } else {
             uni.showToast({
               title: res.msg,
-              icon:"none",
-              mask:true,
+              icon: "none",
+              mask: true,
               duration: 2000
             });
           }
@@ -364,249 +422,295 @@ export default {
 </script>
 
 <style lang="stylus" scoped>
-#mine{
-  height:100%;
-  .top-max-big-box{
+#mine {
+  height: 100%;
+
+  .top-max-big-box {
+
     /*background:#ffffff;*/
-    .user-top-max-box-one{
-      overflow hidden
-      background url("@/images/basicsModules/img_wd_bg.png") no-repeat
-      background-size:100%;
-      height:350rpx;
-      .top-max-box-one{
-        background #fff
-        margin:40rpx 40rpx 0;
-        z-index:1;
-        height:180rpx;
-        border-top-right-radius 20rpx
-        border-top-left-radius 20rpx
-        display flex
-        overflow hidden
-        .user-img-box{
-          height:120rpx;
-          width:100rpx;
-          margin:30rpx 53rpx 0 22rpx;
-          img{
-            height:100rpx;
-            width:100rpx;
-            border-radius:50%;
+    .user-top-max-box-one {
+      overflow hidden;
+      background url("@/images/basicsModules/img_wd_bg.png") no-repeat;
+      background-size: 100%;
+      height: 350rpx;
+
+      .top-max-box-one {
+        background #fff;
+        margin: 40rpx 40rpx 0;
+        z-index: 1;
+        height: 180rpx;
+
+        border-top-right-radius 20rpx;
+        border-top-left-radius 20rpx;
+        display flex;
+        overflow hidden;
+
+        .user-img-box {
+          height: 120rpx;
+          width: 100rpx;
+          margin: 30rpx 53rpx 0 22rpx;
+
+          img {
+            height: 100rpx;
+            width: 100rpx;
+            border-radius: 50%;
           }
-          view{
-            font-size:22rpx;
-            color:#666666;
-            text-align center
-            line-height:22rpx;
-            margin-top:10rpx;
+
+          view {
+            font-size: 22rpx;
+            color: #666666;
+            text-align center;
+            line-height: 22rpx;
+            margin-top: 10rpx;
           }
         }
-        .name-box{
-          margin-top:30rpx;
-          .name-box-min{
-            display flex
-            overflow hidden
-            margin-bottom:11rpx;
-            view:nth-child(1){
-              height:48rpx;
-              line-height:48rpx;
+
+        .name-box {
+          margin-top: 30rpx;
+
+          .name-box-min {
+            display flex;
+            overflow hidden;
+            margin-bottom: 11rpx;
+
+            view:nth-child(1) {
+              height: 48rpx;
+              line-height: 48rpx;
               font-size: 30rpx;
               color: #333;
             }
-            view:nth-child(2){
-              height:30rpx;
-              line-height:30rpx;
-              font-size:20rpx;
-              padding:0 20rpx;
-              margin:9rpx 0 9rpx 20rpx;
+
+            view:nth-child(2) {
+              height: 30rpx;
+              line-height: 30rpx;
+              font-size: 20rpx;
+              padding: 0 20rpx;
+              margin: 9rpx 0 9rpx 20rpx;
             }
-            view-color-one{
+
+            .view-color-one {
               background #FDD255;
             }
-            view-color-two{
+
+            .view-color-two {
               background #A2A2A2;
             }
-            view-color-tree{
+
+            .view-color-tree {
               background #0183FA;
             }
           }
-          .name-box-user{
-            line-height:41rpx;
+
+          .name-box-user {
+            line-height: 41rpx;
             font-size: 22rpx;
             color: #333;
           }
         }
 
       }
-      .num-max-box{
-        width:670rpx;
-        background #fff
-        border-bottom-right-radius 20rpx
-        border-bottom-left-radius 20rpx
-        height:130rpx;
-        margin:0 40rpx;
-        display flex
-        .min-num-box{
-          flex:1;
-          .min-num-view{
-            margin-top:30rpx;
-            height:30rpx;
-            line-height:30rpx;
-            font-size:22rpx;
+
+      .num-max-box {
+        width: 670rpx;
+        background #fff;
+        border-bottom-right-radius 20rpx;
+        border-bottom-left-radius 20rpx;
+        height: 130rpx;
+        margin: 0 40rpx;
+
+        display flex;
+        .min-num-box {
+          flex: 1;
+
+          .min-num-view {
+            margin-top: 30rpx;
+            height: 30rpx;
+            line-height: 30rpx;
+            font-size: 22rpx;
             text-align center
           }
-          .color-one{
-            font-weight:700;
-            font-size:26rpx;
-            color:#2B99FE;
+
+          .color-one {
+            font-weight: 700;
+            font-size: 26rpx;
+            color: #2B99FE;
           }
-          .color-two{
-            font-weight:700;
-            font-size:26rpx;
-            color:#FDD255;
+
+          .color-two {
+            font-weight: 700;
+            font-size: 26rpx;
+            color: #FDD255;
           }
-          .bottom-min-num-view{
-            display flex
-            margin-top:20rpx;
-            .img-one{
-              width:25rpx;
-              height:28rpx;
+
+          .bottom-min-num-view {
+            display flex;
+            margin-top: 20rpx;
+
+            .img-one {
+              width: 25rpx;
+              height: 28rpx;
               margin: 0 10rpx 0 58rpx;
             }
-            .img-two{
-              width:28rpx;
-              height:26rpx;
+
+            .img-two {
+              width: 28rpx;
+              height: 26rpx;
               margin: 0 10rpx 0 59rpx;
             }
-            view{
-              font-size:22rpx;
+
+            view {
+              font-size: 22rpx;
             }
           }
         }
       }
-      .null-p{
-        background #dedede
-        height:30rpx;
-        width:2rpx;
-        margin:50rpx 0 0;
+
+      .null-p {
+        background #dedede;
+        height: 30rpx;
+        width: 2rpx;
+        margin: 50rpx 0 0;
       }
     }
-    .top-max-box-two{
-      background url("@/images/basicsModules/img_wd_bg.png")
-      background-size:100%;
-      height:245rpx;
-      display flex
-      overflow hidden
-      .user-img-box{
-        height:120rpx;
-        width:100rpx;
-        margin:50rpx 53rpx 0 22rpx;
-        img{
-          height:100rpx;
-          width:100rpx;
-          border-radius:50%;
+
+    .top-max-box-two {
+      background url("@/images/basicsModules/img_wd_bg.png");
+      background-size: 100%;
+      height: 245rpx;
+
+      display flex;
+      overflow hidden;
+
+      .user-img-box {
+        height: 120rpx;
+        width: 100rpx;
+        margin: 50rpx 53rpx 0 22rpx;
+
+        img {
+          height: 100rpx;
+          width: 100rpx;
+          border-radius: 50%;
         }
-        view{
-          font-size:22rpx;
-          color:#fff;
-          text-align center
-          line-height:22rpx;
-          margin-top:10rpx;
+
+        view {
+          font-size: 22rpx;
+          color: #fff;
+          text-align center;
+          line-height: 22rpx;
+          margin-top: 10rpx;
         }
       }
-      .name-box{
-        margin-top:50rpx;
-        view:nth-child(1){
-          line-height:48rpx;
-          margin-bottom:11rpx;
+
+      .name-box {
+        margin-top: 50rpx;
+
+        view:nth-child(1) {
+          line-height: 48rpx;
+          margin-bottom: 11rpx;
           font-size: 30rpx;
           color: #fff;
         }
-        view:nth-child(2){
-          line-height:41rpx;
+
+        view:nth-child(2) {
+          line-height: 41rpx;
           font-size: 22rpx;
           color: #fff;
         }
       }
 
     }
-    .button-max-big-box{
-      background #fff
-      padding:0 20rpx;
-      margin-top:30rpx;
-      .button-max-box{
-        height:100rpx;
-        display flex
-        border-top:1rpx solid #e0e0e0;
-        .left-img{
-          height:30rpx;
-          width:30rpx;
-          margin:34rpx 44rpx 0 0;
+
+    .button-max-big-box {
+      background #fff;
+      padding: 0 20rpx;
+      margin-top: 30rpx;
+
+      .button-max-box {
+        height: 100rpx;
+        display flex;
+        border-top: 1rpx solid #e0e0e0;
+
+        .left-img {
+          height: 30rpx;
+          width: 30rpx;
+          margin: 34rpx 44rpx 0 0;
         }
-        view{
-          line-height:100rpx;
+
+        view {
+          line-height: 100rpx;
         }
-        view:nth-child(2){
-          flex:1;
-          color:#333333;
+
+        view:nth-child(2) {
+          flex: 1;
+          color: #333333;
           font-size: 30rpx;
         }
-        .right-img{
-          height:24rpx;
-          width:12rpx;
-          margin:39rpx 0 0 0;
+
+        .right-img {
+          height: 24rpx;
+          width: 12rpx;
+          margin: 39rpx 0 0 0;
         }
-        .colorA{
-          color:#E45656!important;
+
+        .colorA {
+          color: #E45656 !important;
         }
-        .marginType{
-          margin-right:12rpx;
+
+        .marginType {
+          margin-right: 12rpx;
         }
-        .view-three-one{
-          width:30rpx;
-          height:30rpx;
-          text-align center
-          background #FF4552
-          border-radius:50%;
-          font-size:20rpx;
-          line-height:30rpx;
-          color:#fff;
-          margin:36rpx 20rpx;
+
+        .view-three-one {
+          width: 30rpx;
+          height: 30rpx;
+          text-align center;
+          background #FF4552;
+          border-radius: 50%;
+          font-size: 20rpx;
+          line-height: 30rpx;
+          color: #fff;
+          margin: 36rpx 20rpx;
         }
-        .view-three-two{
-          width:30rpx;
-          height:30rpx;
-          text-align center
-          border-radius:50%;
-          font-size:20rpx;
-          line-height:30rpx;
-          color:#999;
-          margin:36rpx 20rpx;
+
+        .view-three-two {
+          width: 30rpx;
+          height: 30rpx;
+          text-align center;
+          border-radius: 50%;
+          font-size: 20rpx;
+          line-height: 30rpx;
+          color: #999;
+          margin: 36rpx 20rpx;
 
         }
-        .view-three-type{
-          width:120rpx;
+
+        .view-three-type {
+          width: 120rpx;
           text-align center;
-          color:#CCCCCC;
+          color: #CCCCCC;
           font-size: 26rpx;
         }
       }
-      .button-max-box:nth-child(1){
-        border:none;
+
+      .button-max-box:nth-child(1) {
+        border: none;
       }
     }
   }
-  .out-button{
-    position absolute
-    bottom:140rpx;
-    left:25rpx;
-    width:700rpx;
-    height:100rpx;
-    line-height:100rpx;
-    border-radius:10rpx;
-    text-align center
-    background #E0E0E0
-    color:#0183FA;
+
+  .out-button {
+    position absolute;
+    bottom: 140rpx;
+    left: 25rpx;
+    width: 700rpx;
+    height: 100rpx;
+    line-height: 100rpx;
+    border-radius: 10rpx;
+    text-align center;
+    background #E0E0E0;
+    color: #0183FA;
     font-size: 30rpx;
-    margin:0 auto;
+    margin: 0 auto;
   }
 }
 </style>

+ 111 - 90
pages/saoCode/saoCode.vue

@@ -1,102 +1,123 @@
 <!--扫描二维码页面-->
 <template>
-    <view id="saoCode">
-        <web-view :src="baseUrl+'admin/#/codeHtml?code='+code+'&type='+type"></web-view>
-    </view>
+  <view id="saoCode">
+    <web-view v-if="webViewType" :src="baseUrl+'admin/#/codeHtml?code='+code+'&type='+type"></web-view>
+  </view>
 </template>
+
 <script>
-	import { config } from '@/api/request/config.js'
-    export default {
-        name: "saoCode",
-        data() {
-            return {
-				baseUrl:config.base_url,
-                code:"",
-                type:"",
-                subId:"",
-				pageType:2,
-            }
-        },
+import {
+  config
+} from '@/api/request/config.js'
+import {
+  chemicalAioVerifyScanLogin,chemicalAioVerifyAppletLogin
+} from '@/api/basicsModules/index.js'
 
-      onLoad(option) {
-        let self = this;
-        if(option.q){
-          let text = decodeURIComponent(option.q)
-          let list = text.split("?")[1].split("&");
-          for(let i=0;i<list.length;i++){
-            let newList = list[i].split("=");
-            if(newList[0] == 'code'){
-              self.code = newList[1];
-            }else if(newList[0] == 'type'){
-              self.type = newList[1];
-            }else if(newList[0] == 'subId'){
-              self.subId = newList[1];
-            }
-          }
-          if(!uni.getStorageSync('token')){
-            uni.setStorageSync('saoCode',this.code);
-            uni.setStorageSync('saoType',this.type);
-            uni.setStorageSync('saoSubId',this.subId);
-            uni.redirectTo({
-              url: '/pages/login',
-            });
-          }else{
-            if(this.type==7){//培训课程
-              uni.redirectTo({
-                url: '/pages/pages_patrolInspector/courseQRcode?code='+this.code,
-              });
-            }else if(this.type==8){//化学品柜
-              uni.redirectTo({
-                url: '/pages/pages_patrolInspector/chemicalCabinetQRcode?code='+this.code,
-              });
-            }else if(this.type==9){//化学品
-              uni.redirectTo({
-                url: '/pages/pages_patrolInspector/chemicalDetail?code='+this.code,
-              });
-            }else if(this.type==11){//化学品身份识别验证
-              uni.redirectTo({
-                url: '/pages/pages_patrolInspector/identityVerify?code='+this.code+'&subId='+this.subId,
-              });
-            }
-          }
-        }else{
-          this.code = uni.getStorageSync('saoCode');
-          this.type = uni.getStorageSync('saoType');
-          this.type = uni.getStorageSync('saoSubId');
-          uni.removeStorageSync('saoCode');
-          uni.removeStorageSync('saoType');
-          uni.removeStorageSync('saoSubId');
-          if(this.type==7){//培训课程
-            uni.redirectTo({
-              url: '/pages/pages_patrolInspector/courseQRcode?code='+this.code,
-            });
-          }else if(this.type==8){//化学品柜
-            uni.redirectTo({
-              url: '/pages/pages_patrolInspector/chemicalCabinetQRcode?code='+this.code,
-            });
-          }else if(this.type==9){//化学品
-            uni.redirectTo({
-              url: '/pages/pages_patrolInspector/chemicalDetail?code='+this.code,
-            });
-          }else if(this.type==11){//化学品身份识别验证
-              uni.redirectTo({
-                url: '/pages/pages_patrolInspector/identityVerify?code='+this.code+'&subId='+this.subId,
-              });
-            }
+export default {
+  name: "saoCode",
+  data() {
+    return {
+      webViewType:false,
+      baseUrl: config.base_url,
+      code: "",
+      type: "",
+    }
+  },
+  onLoad(option) {
+    let self = this;
+    if (option.q) {
+      let text = decodeURIComponent(option.q)
+      console.log('text',text)
+      let list = text.split("?")[1].split("&");
+      let codeData = {};
+      console.log('codeData',codeData)
+      list.forEach((item) => {
+        codeData[item.split("=")[0]] = item.split("=")[1];
+      })
+      if (!uni.getStorageSync('token')) {
+        uni.setStorageSync('codeData', codeData);
+        uni.redirectTo({
+          url: '/pages/login/login',
+        });
+      } else {
+        if (codeData.type == 11) {
+          //化学品终端-扫码登录
+          this.chemicalAioVerifyScanLogin(codeData.code, codeData.subId, codeData.macId);
+        }else if (codeData.type == 12) {
+          //化学品终端-双人认证
+          this.chemicalAioVerifyAppletLogin(codeData.doorId, codeData.subId, codeData.macId, codeData.code);
         }
-      },
-      mounted(){
-
-      },
+      }
+    } else {
+      let codeData = uni.getStorageSync('codeData');
+      uni.removeStorageSync('codeData');
+      if (codeData.type == 11) {
+        //化学品终端-扫码登录
+        this.chemicalAioVerifyScanLogin(codeData.code, codeData.subId, codeData.macId);
+      }else if (codeData.type == 12) {
+        //化学品终端-双人认证
+        this.chemicalAioVerifyAppletLogin(codeData.doorId, codeData.subId, codeData.macId, codeData.code);
+      }
+    }
+  },
+  mounted() {
 
-      methods:{
+  },
 
-      },
-    }
+  methods: {
+    //化学品终端-扫码登录
+    async chemicalAioVerifyScanLogin(code, subId, macId) {
+      const {
+        data
+      } = await chemicalAioVerifyScanLogin({
+        code: code,
+        subId: subId,
+        userId: uni.getStorageSync('userId'),
+        macId: macId
+      });
+      uni.showToast({
+        mask: true,
+        icon: "none",
+        position: "center",
+        title: data.message,
+        duration: 2000
+      });
+      setTimeout(function() {
+        uni.redirectTo({
+          url: '/pages/mine/mine',
+        });
+      }, 2000);
+    },
+    //化学品终端-双人认证
+    async chemicalAioVerifyAppletLogin(doorId, subId, macId, code) {
+      const {
+        data
+      } = await chemicalAioVerifyAppletLogin({
+        doorId: doorId,
+        subId: subId,
+        macId: macId,
+        code: code,
+        userId: uni.getStorageSync('userId'),
+      });
+      uni.showToast({
+        mask: true,
+        icon: "none",
+        position: "center",
+        title: data.message,
+        duration: 2000
+      });
+      setTimeout(function() {
+        uni.redirectTo({
+          url: '/pages/mine/mine',
+        });
+      }, 2000);
+    },
+  },
+}
 </script>
 
 <style lang="stylus" scoped>
-    #saoCode{
-        overflow scroll
-    }
+#saoCode {
+  overflow scroll
+}
 </style>