|
@@ -1,76 +1,8 @@
|
|
<!-- 我的 -->
|
|
<!-- 我的 -->
|
|
<template>
|
|
<template>
|
|
<view id="mine">
|
|
<view id="mine">
|
|
- <teacherMine class="flex-box-page" v-if="userType==1"></teacherMine>
|
|
|
|
- <pupilMine class="flex-box-page" v-if="userType==2"></pupilMine>
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- <!--
|
|
|
|
- <view class="top-max-big-box" v-if="pageType">
|
|
|
|
-
|
|
|
|
- <view class="top-max-box-two" v-if="userType==1">
|
|
|
|
- <view class="user-img-box" @click="selectImage">
|
|
|
|
- <img v-if="userData.avatar" :src="baseUrl+userData.avatar">
|
|
|
|
- <img v-else src="@/pages/images/icon_01.png">
|
|
|
|
- <view>{{userData.avatar?'编辑':'未上传'}}</view>
|
|
|
|
- </view>
|
|
|
|
- <view class="name-box">
|
|
|
|
- <view>{{userData.userName}}</view>
|
|
|
|
- <view>{{userData.deptName}}</view>
|
|
|
|
- </view>
|
|
|
|
- </view>
|
|
|
|
-
|
|
|
|
- <view class="user-top-max-box-one" v-if="userType==2">
|
|
|
|
- <view class="back-posi"></view>
|
|
|
|
- <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="@/pages/images/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>
|
|
|
|
- <view class="name-box-user">{{userData.professional}}丨{{userData.deptName}}</view>
|
|
|
|
- </view>
|
|
|
|
- </view>
|
|
|
|
- <view class="num-max-box">
|
|
|
|
- <view class="min-num-box" @click="goUserPage('none')">
|
|
|
|
- <view class="min-num-view color-one">{{creditScore}}</view>
|
|
|
|
- <view class="bottom-min-num-view">
|
|
|
|
- <img class="img-one" src="@/pages/images/icon_wd_xyf.png">
|
|
|
|
- <view>信用分</view>
|
|
|
|
- </view>
|
|
|
|
- </view>
|
|
|
|
- <view class="null-p"></view>
|
|
|
|
- <view class="min-num-box" @click="goUserPage('none')">
|
|
|
|
- <view class="min-num-view color-two">{{bonusPoints}}</view>
|
|
|
|
- <view class="bottom-min-num-view">
|
|
|
|
- <img class="img-two" src="@/pages/images/icon_wd_jlf.png">
|
|
|
|
- <view>奖励分</view>
|
|
|
|
- </view>
|
|
|
|
- </view>
|
|
|
|
- <view class="null-p"></view>
|
|
|
|
- <view class="min-num-box" @click="goUserPage(3)">
|
|
|
|
- <view class="min-num-view">扫一扫</view>
|
|
|
|
- <view class="bottom-min-num-view">
|
|
|
|
- <img class="img-two" src="@/pages/images/icon_wd_dh.png">
|
|
|
|
- <view>兑换礼品</view>
|
|
|
|
- </view>
|
|
|
|
- </view>
|
|
|
|
- </view>
|
|
|
|
- </view>
|
|
|
|
- </view>
|
|
|
|
- <mineConfigurationSlot v-for="(item,index) in mineConfigData" :key="index" :mineConfig="item">
|
|
|
|
- </mineConfigurationSlot>
|
|
|
|
- <view class="out-button" @click="clickOut">退出登录</view>
|
|
|
|
- <tab-bar></tab-bar> -->
|
|
|
|
|
|
+ <teacherMine class="flex-box-page" ref="teacherMine" v-if="userType==1"></teacherMine>
|
|
|
|
+ <pupilMine class="flex-box-page" ref="pupilMine" v-if="userType==2"></pupilMine>
|
|
</view>
|
|
</view>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
@@ -82,38 +14,8 @@
|
|
pupilMine
|
|
pupilMine
|
|
} from '@/pages/views/pupilPage/pupilMine'
|
|
} from '@/pages/views/pupilPage/pupilMine'
|
|
|
|
|
|
-
|
|
|
|
- // import {
|
|
|
|
- // config
|
|
|
|
- // } from '@/api/request/config.js'
|
|
|
|
- // import {
|
|
|
|
- // logout,
|
|
|
|
- // studentinfoFacemy,
|
|
|
|
- // simpleInfo,
|
|
|
|
- // getSafeWarnList,
|
|
|
|
- // fingerprintQuantity,
|
|
|
|
- // fingerprintQueryList,
|
|
|
|
- // systemAppletLayoutSelect,
|
|
|
|
- // systemUserProfile,
|
|
|
|
- // examPointsRecordGetMyPointsLogInfo
|
|
|
|
- // } from '@/pages/api/index.js'
|
|
|
|
- // import {
|
|
|
|
- // getMineConfig
|
|
|
|
- // } from '@/utils/mineConfig'
|
|
|
|
-
|
|
|
|
- // import {
|
|
|
|
- // tabBar
|
|
|
|
- // } from '@/pages/component/tabBar.vue'
|
|
|
|
- // import {
|
|
|
|
- // mineConfigurationSlot
|
|
|
|
- // } from '@/pages/component/mineConfigurationSlot'
|
|
|
|
-
|
|
|
|
export default {
|
|
export default {
|
|
-
|
|
|
|
- // components: {
|
|
|
|
- // tabBar,
|
|
|
|
- // mineConfigurationSlot,
|
|
|
|
- // },
|
|
|
|
|
|
+
|
|
components: {
|
|
components: {
|
|
teacherMine,
|
|
teacherMine,
|
|
pupilMine,
|
|
pupilMine,
|
|
@@ -122,36 +24,6 @@
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
userType: 0,
|
|
userType: 0,
|
|
-
|
|
|
|
- // baseUrl: config.base_url,
|
|
|
|
- // mineConfigData: [],
|
|
|
|
- // //页面状态
|
|
|
|
- // pageType: false,
|
|
|
|
- // //认证数据
|
|
|
|
- // certification: {
|
|
|
|
-
|
|
|
|
- // },
|
|
|
|
- // userType: 0,
|
|
|
|
- // userData: {
|
|
|
|
- // deptName: "",
|
|
|
|
- // professional: "",
|
|
|
|
- // userName: "",
|
|
|
|
- // },
|
|
|
|
- // securityAlertNum: 0,
|
|
|
|
- // adminSubCount: 0,
|
|
|
|
- // wranDoCount: 0,
|
|
|
|
- // //奖励分
|
|
|
|
- // bonusPoints: 0,
|
|
|
|
- // //信用分
|
|
|
|
- // creditScore: 0,
|
|
|
|
- // //用户签名
|
|
|
|
- // signatureUrl: '',
|
|
|
|
- // // 人脸
|
|
|
|
- // ifFaceFeature: "",
|
|
|
|
- // //签名
|
|
|
|
- // isUpload: "",
|
|
|
|
- // Quantity: 0, //指纹录取数量
|
|
|
|
-
|
|
|
|
}
|
|
}
|
|
},
|
|
},
|
|
onLoad() {
|
|
onLoad() {
|
|
@@ -159,205 +31,16 @@
|
|
},
|
|
},
|
|
onShow() {
|
|
onShow() {
|
|
this.userType = uni.getStorageSync('userType')
|
|
this.userType = uni.getStorageSync('userType')
|
|
- // this.simpleInfo();
|
|
|
|
- // this.systemAppletLayoutSelect();
|
|
|
|
- // if (uni.getStorageSync('token') && uni.getStorageSync('userId') && uni.getStorageSync('userType')) {
|
|
|
|
- // this.userType = uni.getStorageSync('userType')
|
|
|
|
- // if(this.userType == '2'){
|
|
|
|
- // this.examPointsRecordGetMyPointsLogInfo();
|
|
|
|
- // }
|
|
|
|
- // } else {
|
|
|
|
- // uni.removeStorageSync('token');
|
|
|
|
- // uni.removeStorageSync('userId');
|
|
|
|
- // uni.removeStorageSync('userType');
|
|
|
|
- // uni.redirectTo({
|
|
|
|
- // url: '/pages/login',
|
|
|
|
- // });
|
|
|
|
- // }
|
|
|
|
|
|
+ this.$nextTick(()=>{
|
|
|
|
+ if(this.userType == 1){
|
|
|
|
+ this.$refs.teacherMine.initialize();
|
|
|
|
+ }else if(this.userType == 2){
|
|
|
|
+ this.$refs.pupilMine.initialize();
|
|
|
|
+ }
|
|
|
|
+ })
|
|
},
|
|
},
|
|
-
|
|
|
|
methods: {
|
|
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));
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- //查询学生-信用分/奖励分
|
|
|
|
- async examPointsRecordGetMyPointsLogInfo() {
|
|
|
|
- const {
|
|
|
|
- data
|
|
|
|
- } = await examPointsRecordGetMyPointsLogInfo();
|
|
|
|
- if (data.code == 200) {
|
|
|
|
- this.bonusPoints = data.data.bonusPoints;
|
|
|
|
- this.creditScore = data.data.creditScore;
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- //学生端-信用分/奖励分/扫一扫按钮
|
|
|
|
- goUserPage(type) {
|
|
|
|
- let self = this;
|
|
|
|
- if (type == 1) {
|
|
|
|
- uni.navigateTo({
|
|
|
|
- url: '/pages_student/views/mine/creditPoints',
|
|
|
|
- });
|
|
|
|
- } else if (type == 2) {
|
|
|
|
- uni.navigateTo({
|
|
|
|
- url: '/pages_student/views/mine/rewardPoints',
|
|
|
|
- });
|
|
|
|
- } else if (type == 3) {
|
|
|
|
- uni.scanCode({
|
|
|
|
- onlyFromCamera: true,
|
|
|
|
- success: function(res) {
|
|
|
|
- uni.navigateTo({
|
|
|
|
- url: '/pages_student/views/integralManage/codeSuccess?q=' +
|
|
|
|
- encodeURIComponent(JSON.stringify(res.result))
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
- } 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 getSafeWarnList() {
|
|
|
|
- let obj = {
|
|
|
|
- pageNum: 1,
|
|
|
|
- pageSize: 1,
|
|
|
|
- count: 0,
|
|
|
|
- groupStatus: 1,
|
|
|
|
- };
|
|
|
|
- const {
|
|
|
|
- data
|
|
|
|
- } = await getSafeWarnList(obj);
|
|
|
|
- if (data.code == 200) {
|
|
|
|
- if (data.rows[0]) {
|
|
|
|
- this.securityAlertNum = data.rows[0].todayHappenCount;
|
|
|
|
- } else {
|
|
|
|
- this.securityAlertNum = 0;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- //获取当前身份人脸验证状态与学生卡上传状态
|
|
|
|
- async studentinfoFacemy() {
|
|
|
|
- let obj = {
|
|
|
|
- studentsId: uni.getStorageSync('userId')
|
|
|
|
- }
|
|
|
|
- const {
|
|
|
|
- data
|
|
|
|
- } = await studentinfoFacemy(obj)
|
|
|
|
- if (data.code == 200) {
|
|
|
|
- this.certification = data.data;
|
|
|
|
- this.ifFaceFeature = data.data.ifFaceFeature;
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- //退出按钮
|
|
|
|
- clickOut() {
|
|
|
|
- let self = this;
|
|
|
|
- uni.showModal({
|
|
|
|
- // title: '确认要退出吗?',
|
|
|
|
- content: '确认要退出吗',
|
|
|
|
- cancelColor: "#999",
|
|
|
|
- confirmColor: "#0183FA",
|
|
|
|
- success: function(res) {
|
|
|
|
- if (res.confirm) {
|
|
|
|
- self.logout();
|
|
|
|
- } 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/views/login/login',
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- // 头像上传
|
|
|
|
- selectImage() {
|
|
|
|
- let self = this;
|
|
|
|
- wx.chooseImage({
|
|
|
|
- count: 1,
|
|
|
|
- sizeType: ["original", "compressed"],
|
|
|
|
- sourceType: ["album", "camera"],
|
|
|
|
- success: function(res) {
|
|
|
|
- let tempFilePaths = res.tempFilePaths[0];
|
|
|
|
- self.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')
|
|
|
|
- },
|
|
|
|
- filePath: tempFilePaths,
|
|
|
|
- name: 'file',
|
|
|
|
- formData: {
|
|
|
|
- 'user': 'test'
|
|
|
|
- },
|
|
|
|
- success: (uploadFileRes) => {
|
|
|
|
- let res = JSON.parse(uploadFileRes.data);
|
|
|
|
- if (res.code == 200) {
|
|
|
|
- uni.navigateTo({
|
|
|
|
- url: '/pages_basics/views/avatar?src=' + config.base_url + res.data.url,
|
|
|
|
- });
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- } else {
|
|
|
|
- uni.showToast({
|
|
|
|
- title: res.msg,
|
|
|
|
- icon: "none",
|
|
|
|
- mask: true,
|
|
|
|
- duration: 2000
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- fail: err => {},
|
|
|
|
- complete: () => {
|
|
|
|
- uni.hideLoading()
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
- },
|
|
|
|
|
|
+
|
|
},
|
|
},
|
|
}
|
|
}
|
|
</script>
|
|
</script>
|