index.vue 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277
  1. <template>
  2. <view class="client-my-page">
  3. <view class="jzgs-name-box">
  4. <text>{{myInfoData.jzName}}</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>
  18. </view>
  19. <view class="my-list-box">
  20. <view class="list-row" @click="goToPage('grcj')">
  21. <icon class="list-icon user-icon"></icon>
  22. <text>修改个人信息</text>
  23. </view>
  24. <view class="list-row" @click="goToPage('jzxx')">
  25. <icon class="list-icon jzxx-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="ewmBtn">
  33. <icon class="list-icon code-icon"></icon>
  34. <text>二维码</text>
  35. </view>
  36. <view class="list-row" @click="exitLogin">
  37. <icon class="list-icon login-out-icon"></icon>
  38. <text>退出登录</text>
  39. </view>
  40. </view>
  41. <!-- 底部区域 -->
  42. <customTabbarClient :currentTab="3"></customTabbarClient>
  43. <common-dialog ref="commonDialogRef" :title="exitTitle" :content="exitContent"
  44. @confirm-btn="exitBtn"></common-dialog>
  45. <shexiangDialogVue ref="shexiangRef" title="摄像头说明"></shexiangDialogVue>
  46. <password-dialog ref="passwordDialogRef" @confirm-btn="passwordBtn"></password-dialog>
  47. <image-dialog ref="imageDialogRef"></image-dialog>
  48. <!-- 摄像头确认 -->
  49. <zhuapaiConfrimVue ref="zpRef" @error="zpConfirmError" title="摄像头测试"></zhuapaiConfrimVue>
  50. </view>
  51. </template>
  52. <script setup>
  53. import {
  54. toast
  55. } from "@/utils/common";
  56. import {
  57. onLoad,
  58. onShow
  59. } from '@dcloudio/uni-app';
  60. import cacheManager from '@/utils/cacheManager.js';
  61. import {
  62. getGlMineUser,
  63. getGlMineLogout,
  64. getGlPasswordUpdate
  65. } from '@/api/my.js'
  66. import {
  67. reactive,
  68. ref
  69. } from "vue";
  70. import customTabbarClient from "@/components/custom-tabbar/custom-tabbar-admin.vue"
  71. import commonDialog from '@/components/dialog/commonDialog.vue';
  72. import passwordDialog from './passwordDialog.vue';
  73. import imageDialog from './imageDialog.vue';
  74. import shexiangDialogVue from "@/components/dialog/shexiangDialog.vue";
  75. import zhuapaiConfrimVue from "@/components/zhuapaiConfirm/index.vue";
  76. import {
  77. useIsCanBack
  78. } from "@/store/isCanBack.js"
  79. // #ifndef APP-HARMONY
  80. import UniShare from '@/uni_modules/uni-share/js_sdk/uni-share.js';
  81. const uniShare = new UniShare();
  82. // #endif
  83. // #ifdef APP-HARMONY
  84. import {
  85. uniShare
  86. } from "@/uni_modules/uni-share"
  87. // #endif
  88. let myInfoData = reactive({
  89. jzName: '',
  90. userImg: '',
  91. realName: '',
  92. idcard: '',
  93. userName: '',
  94. from: ''
  95. });
  96. const commonDialogRef = ref(null);
  97. const passwordDialogRef = ref(null);
  98. const imageDialogRef = ref(null);
  99. const shexiangRef = ref(null);
  100. const zpRef = ref(null);
  101. const exitContent = '你确定要执行这个操作吗?';
  102. const exitTitle = '退出登录';
  103. const store = useIsCanBack();
  104. function getMyInit() {
  105. getUserInfo();
  106. }
  107. // 获取用户头像
  108. function goToPage(data) {
  109. switch (data) {
  110. case 'grcj':
  111. uni.navigateTo({
  112. url: '/pages/admin/my/myInfo?from=my'
  113. })
  114. break;
  115. case 'jzxx':
  116. uni.navigateTo({
  117. url: '/pages/admin/my/jzInfo'
  118. })
  119. break;
  120. }
  121. }
  122. function getUserInfo() {
  123. getGlMineUser({}).then(res => {
  124. myInfoData.userImg = res.data.icon;
  125. myInfoData.realName = res.data.realName;
  126. myInfoData.idcard = res.data.idcard;
  127. myInfoData.userName = res.data.userName;
  128. myInfoData.jzName = res.data.jzName;
  129. })
  130. }
  131. function exitLogin() {
  132. commonDialogRef.value.handleShow();
  133. }
  134. function xgmmBtn() {
  135. passwordDialogRef.value.handleShow();
  136. }
  137. function ewmBtn() {
  138. imageDialogRef.value.handleShow();
  139. // if (!plus.runtime.isApplicationExist({
  140. // pname: 'com.tencent.mm'
  141. // })) {
  142. // uni.showToast({
  143. // title: '请先安装微信',
  144. // icon: 'none'
  145. // });
  146. // return;
  147. // }
  148. // // 分享到小程序 我想加个参数
  149. // uni.share({
  150. // provider: 'weixin',
  151. // scene: "WXSceneSession",
  152. // type: 5,
  153. // imageUrl: 'https://qiniu-web-assets.dcloud.net.cn/unidoc/zh/share-logo@3.png',
  154. // title: '欢迎体验uniapp12312',
  155. // miniProgram: {
  156. // id: 'gh_fa5889151e7d',
  157. // path: 'pages/Login/clientIndex?from=appcx',
  158. // type: 2,
  159. // webUrl: 'http://uniapp.dcloud.io'
  160. // },
  161. // success: ret => {
  162. // console.log(JSON.stringify(ret));
  163. // }
  164. // });
  165. // // #ifdef APP-HARMONY
  166. // uniShare(['https://img-cdn-aliyun.dcloud.net.cn/stream/icon/__UNI__HelloUniApp.png'])
  167. // // #endif
  168. // // #ifndef APP-HARMONY
  169. // uniShare.show({
  170. // content: { //公共的分享参数配置 类型(type)、链接(herf)、标题(title)、summary(描述)、imageUrl(缩略图)
  171. // type: 5,
  172. // href: 'https://uniapp.dcloud.io/',
  173. // title: '标题',
  174. // summary: '描述阿斯顿发啥发啥发',
  175. // imageUrl: 'https://img-cdn-aliyun.dcloud.net.cn/stream/icon/__UNI__HelloUniApp.png',
  176. // miniProgram: {
  177. // id: 'gh_abcdefg',
  178. // path: 'pages/index/index',
  179. // type: 0,
  180. // webUrl: 'http://uniapp.dcloud.io'
  181. // },
  182. // },
  183. // menus: [{
  184. // "img": "/static/app-plus/sharemenu/wechatfriend.png",
  185. // "text": "微信好友",
  186. // "share": { //当前项的分享参数配置。可覆盖公共的配置如下:分享到微信小程序,配置了type=5
  187. // "provider": "weixin",
  188. // "scene": "WXSceneSession"
  189. // }
  190. // }, {
  191. // "img": "/static/app-plus/sharemenu/wechatmoments.png",
  192. // "text": "微信朋友圈",
  193. // "share": {
  194. // "provider": "weixin",
  195. // "scene": "WXSceneTimeline"
  196. // }
  197. // }],
  198. // cancelText: "取消分享",
  199. // }, e => { //callback
  200. // console.log(uniShare.isShow);
  201. // console.log(e);
  202. // })
  203. // // #endif
  204. }
  205. function passwordBtn(data) {
  206. console.log(data, 'data');
  207. const opt = {
  208. passwordOld: data.oldPassWord,
  209. passwordNew: data.newPassWord,
  210. }
  211. getGlPasswordUpdate(opt).then(res => {
  212. if (res.data) {
  213. uni.showToast({
  214. title: '更新成功'
  215. })
  216. passwordDialogRef.value.handleClose();
  217. }
  218. })
  219. }
  220. function exitBtn() {
  221. getGlMineLogout().then(res => {
  222. toast('退出登录成功')
  223. cacheManager.clearAll();
  224. uni.reLaunch({
  225. url: '/pages/Login/index'
  226. });
  227. store.setIsCanBack(true)
  228. }).catch(err => {
  229. toast('退出登录失败,请稍后重试')
  230. store.setIsCanBack(false)
  231. })
  232. }
  233. function showMessageDl() {
  234. console.log(shexiangRef.value)
  235. shexiangRef.value.handleShow()
  236. }
  237. function showZhuaPaiConfirm() {
  238. zpRef.value.showDialog()
  239. }
  240. function zpConfirmSuccess() {
  241. zpRef.value.showDialog()
  242. }
  243. function zpConfirmError() {
  244. uni.showToast({
  245. title: '摄像头唤起异常',
  246. icon: 'none'
  247. })
  248. }
  249. onLoad(() => {
  250. })
  251. onShow(() => {
  252. getMyInit()
  253. })
  254. </script>
  255. <style>
  256. </style>