123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160 |
- <template>
- <view class="client-my-page">
- <view class="jzgs-name-box">
- <text>{{myInfoData.jzName}}</text>
- </view>
- <view class="admin-head-box">
- <view class="head-img-box">
- <img class="head-img" :src="myInfoData.userImg" v-if="myInfoData.userImg">
- <icon class="phone-default-userImg" v-else></icon>
- </view>
- <view class="head-content-box">
- <text>{{myInfoData.realName}}</text>
- <view class="head-content-row-box" v-if="myInfoData.userName">
- <icon class="tel-icon"></icon>
- <text class="content-text" >{{myInfoData.userName}}</text>
- </view>
- </view>
- </view>
-
- <view class="my-list-box">
- <view class="list-row" @click="goToPage('grcj')">
- <icon class="list-icon user-icon"></icon>
- <text>修改个人信息</text>
- </view>
- <view class="list-row" @click="xgmmBtn">
- <icon class="list-icon mm-icon"></icon>
- <text>修改密码</text>
- </view>
- <view class="list-row" @click="exitLogin">
- <icon class="list-icon login-out-icon"></icon>
- <text>退出登录</text>
- </view>
- </view>
- <!-- 底部区域 -->
- <customTabbarClient :currentTab="2"></customTabbarClient>
- <common-dialog ref="commonDialogRef" :title="exitTitle" :content="exitContent" @confirm-btn="exitBtn"></common-dialog>
- <shexiangDialogVue ref="shexiangRef" title="摄像头说明"></shexiangDialogVue>
- <password-dialog ref="passwordDialogRef" @confirm-btn="passwordBtn"></password-dialog>
- <!-- 摄像头确认 -->
- <zhuapaiConfrimVue ref="zpRef" @error="zpConfirmError" title="摄像头测试"></zhuapaiConfrimVue>
- </view>
- </template>
- <script setup>
- import {toast} from "@/utils/common";
- import {onLoad,onShow} from '@dcloudio/uni-app';
- import cacheManager from '@/utils/cacheManager.js';
- import {getGlMineUser,getGlMineLogout,getGlPasswordUpdate} from '@/api/my.js'
- import {reactive,ref} from "vue";
- import customTabbarClient from "@/components/custom-tabbar/custom-tabbar-admin.vue"
- import commonDialog from '@/components/dialog/commonDialog.vue';
- import passwordDialog from './passwordDialog.vue';
- import shexiangDialogVue from "@/components/dialog/shexiangDialog.vue";
- import zhuapaiConfrimVue from "@/components/zhuapaiConfirm/index.vue";
- import {useIsCanBack} from "@/store/isCanBack.js"
- let myInfoData = reactive({
- jzName: '',
- userImg: '',
- realName: '',
- idcard: '',
- userName: '',
- from:''
- });
- const commonDialogRef = ref(null);
- const passwordDialogRef = ref(null);
- const shexiangRef = ref(null);
- const zpRef = ref(null);
- const exitContent = '你确定要执行这个操作吗?';
- const exitTitle = '退出登录';
-
- const store = useIsCanBack();
-
- function getMyInit() {
- getUserInfo();
- }
- // 获取用户头像
- function goToPage(data){
- switch (data) {
- case 'grcj':
- uni.navigateTo({
- url:'/pages/admin/my/myInfo?from=my'
- })
- break;
- }
- }
- function getUserInfo(){
- getGlMineUser({}).then(res => {
- myInfoData.userImg= res.data.icon;
- myInfoData.realName = res.data.realName;
- myInfoData.idcard = res.data.idcard;
- myInfoData.userName = res.data.userName;
- myInfoData.jzName = res.data.jzName;
- })
- }
- function exitLogin(){
- commonDialogRef.value.handleShow();
-
- }
- function xgmmBtn(){
- passwordDialogRef.value.handleShow();
- }
- function passwordBtn(data){
- console.log(data,'data');
- const opt = {
- passwordOld: data.oldPassWord,
- passwordNew: data.newPassWord,
- }
- getGlPasswordUpdate(opt).then(res => {
- if (res.data) {
- uni.showToast({
- title: '更新成功'
- })
- passwordDialogRef.value.handleClose();
- }
- })
- }
- function exitBtn(){
- getGlMineLogout().then(res => {
- toast('退出登录成功')
- cacheManager.clearAll();
- uni.reLaunch({
- url: '/pages/Login/index'
- });
- store.setIsCanBack(true)
- }).catch(err => {
- toast('退出登录失败,请稍后重试')
- store.setIsCanBack(false)
- })
- }
-
- function showMessageDl() {
- console.log(shexiangRef.value)
- shexiangRef.value.handleShow()
- }
-
- function showZhuaPaiConfirm() {
- zpRef.value.showDialog()
- }
-
- function zpConfirmSuccess() {
- zpRef.value.showDialog()
- }
- function zpConfirmError() {
- uni.showToast({
- title: '摄像头唤起异常',
- icon: 'none'
- })
- }
-
- onLoad(() => {
-
- })
- onShow(() => {
- getMyInit()
- })
- </script>
- <style>
- </style>
|