index.vue 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. <template>
  2. <view class="client-my-page">
  3. <view class="jzgs-name-box">
  4. <text>家政公司名称</text>
  5. </view>
  6. <view class="admin-head-box">
  7. <view class="head-img-box">
  8. <img class="head-img" :src="myInfoData.userImg" v-if="myInfoData.userImg">
  9. <icon class="phone-default-userImg" v-else></icon>
  10. </view>
  11. <view class="head-content-box">
  12. <text>{{myInfoData.realName}}</text>
  13. <view class="head-content-row-box" v-if="myInfoData.userName">
  14. <icon class="tel-icon"></icon>
  15. <text class="content-text" >{{myInfoData.userName}}</text>
  16. </view>
  17. <view class="head-content-row-box" v-if="myInfoData.idcard">
  18. <icon class="idcard-icon"></icon>
  19. <text class="content-text" >{{myInfoData.idcard}}</text>
  20. </view>
  21. </view>
  22. </view>
  23. <view class="my-list-box">
  24. <view class="list-row" @click="goToPage('grcj')">
  25. <icon class="list-icon user-icon"></icon>
  26. <text>修改个人信息</text>
  27. </view>
  28. <view class="list-row" @click="xgmmBtn">
  29. <icon class="list-icon mm-icon"></icon>
  30. <text>修改密码</text>
  31. </view>
  32. <view class="list-row" @click="exitLogin">
  33. <icon class="list-icon login-out-icon"></icon>
  34. <text>退出登录</text>
  35. </view>
  36. </view>
  37. <!-- 底部区域 -->
  38. <customTabbarClient :currentTab="2"></customTabbarClient>
  39. <common-dialog ref="commonDialogRef" :title="exitTitle" :content="exitContent" @confirm-btn="exitBtn"></common-dialog>
  40. <shexiangDialogVue ref="shexiangRef" title="摄像头说明"></shexiangDialogVue>
  41. <password-dialog ref="passwordDialogRef" :title="修改密码" @confirm-btn="passwordBtn"></password-dialog>
  42. <!-- 摄像头确认 -->
  43. <zhuapaiConfrimVue ref="zpRef" @error="zpConfirmError" title="摄像头测试"></zhuapaiConfrimVue>
  44. </view>
  45. </template>
  46. <script setup>
  47. import {toast} from "@/utils/common";
  48. import {onLoad,onShow} from '@dcloudio/uni-app';
  49. import cacheManager from '@/utils/cacheManager.js';
  50. import {getMineUser,getMineInfo,getMineLogout} from '@/api/my.js'
  51. import {reactive,ref} from "vue";
  52. import customTabbarClient from "@/components/custom-tabbar/custom-tabbar-admin.vue"
  53. import commonDialog from '@/components/dialog/commonDialog.vue';
  54. import passwordDialog from './passwordDialog.vue';
  55. import shexiangDialogVue from "@/components/dialog/shexiangDialog.vue";
  56. import zhuapaiConfrimVue from "@/components/zhuapaiConfirm/index.vue";
  57. let myInfoData = reactive({
  58. userImg: '',
  59. realName: '',
  60. idcard: '',
  61. userName: '',
  62. kaoshiCount: '',
  63. kechengCount: '',
  64. lianxiCount: '',
  65. from:''
  66. });
  67. const commonDialogRef = ref(null);
  68. const passwordDialogRef = ref(null);
  69. const shexiangRef = ref(null);
  70. const zpRef = ref(null);
  71. const exitContent = '你确定要执行这个操作吗?';
  72. const exitTitle = '退出登录';
  73. function getMyInit() {
  74. getUserInfo();
  75. getNumInfo();
  76. }
  77. // 获取用户头像
  78. function goToPage(data){
  79. switch (data) {
  80. case 'grcj':
  81. uni.navigateTo({
  82. url:'/pages/admin/my/myInfo?from=my'
  83. })
  84. break;
  85. }
  86. }
  87. function getUserInfo(){
  88. getMineUser({}).then(res => {
  89. myInfoData.userImg= res.data.icon;
  90. myInfoData.realName = res.data.realName;
  91. myInfoData.idcard = res.data.idcard;
  92. myInfoData.userName = res.data.userName;
  93. })
  94. }
  95. function getNumInfo(){
  96. getMineInfo({}).then(res => {
  97. myInfoData.kaoshiCount = res.data.kaoshiCount;
  98. myInfoData.kechengCount = res.data.kechengCount;
  99. myInfoData.lianxiCount = res.data.lianxiCount;
  100. })
  101. }
  102. function exitLogin(){
  103. commonDialogRef.value.handleShow();
  104. }
  105. function xgmmBtn(){
  106. passwordDialogRef.value.handleShow();
  107. }
  108. function exitBtn(){
  109. getMineLogout().then(res => {
  110. toast('退出登录成功')
  111. cacheManager.clearAll();
  112. uni.reLaunch({
  113. url: '/pages/Login/index'
  114. });
  115. }).catch(err => {
  116. toast('退出登录失败,请稍后重试')
  117. })
  118. }
  119. function showMessageDl() {
  120. console.log(shexiangRef.value)
  121. shexiangRef.value.handleShow()
  122. }
  123. function showZhuaPaiConfirm() {
  124. zpRef.value.showDialog()
  125. }
  126. function zpConfirmSuccess() {
  127. zpRef.value.showDialog()
  128. }
  129. function zpConfirmError() {
  130. uni.showToast({
  131. title: '摄像头唤起异常',
  132. icon: 'none'
  133. })
  134. }
  135. onLoad(() => {
  136. })
  137. onShow(() => {
  138. getMyInit()
  139. })
  140. </script>
  141. <style>
  142. </style>