index.vue 8.5 KB

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