index.vue 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. <template>
  2. <view>
  3. <uni-card>
  4. <!-- <uni-list-item title="操作手册" showExtraIcon="true" :extra-icon="list" showArrow
  5. to="/pages/my/updatePwd" /> -->
  6. <uni-list-item title="活体激活" showExtraIcon="true" :extra-icon="cameraExtraIcon" showArrow to="/pages/living/check" />
  7. <uni-list-item title="修改密码" showExtraIcon="true" :extra-icon="extraIcon" showArrow
  8. to="/pages/my/updatePwd" />
  9. <view @click="goOut">
  10. <uni-list-item title="退出登录" showExtraIcon="true" :extra-icon="goOutExtraIcon" showArrow />
  11. </view>
  12. </uni-card>
  13. </view>
  14. </template>
  15. <script>
  16. import {} from '@/common/auth.js'
  17. import {
  18. UpdatePwd,
  19. unbind,
  20. logout
  21. } from '@/api/my.js'
  22. export default {
  23. data() {
  24. return {
  25. list: {
  26. color: '#4a4a4a',
  27. size: '18',
  28. type: 'list'
  29. },
  30. cameraExtraIcon: {
  31. color: '#4a4a4a',
  32. size: '18',
  33. type: 'camera-filled'
  34. },
  35. extraIcon: {
  36. color: '#4a4a4a',
  37. size: '18',
  38. type: 'gear-filled'
  39. },
  40. goOutExtraIcon: {
  41. color: '#4a4a4a',
  42. size: '18',
  43. type: 'close'
  44. }
  45. }
  46. },
  47. methods: {
  48. goOut() {
  49. uni.showModal({
  50. title: '提示',
  51. content: '是否退出登录',
  52. cancelText: '取消',
  53. confirmText: '确定',
  54. success: function(res) {
  55. if (res.confirm) {
  56. uni.showLoading({
  57. title: '正在退出中...'
  58. })
  59. unbind().then(res => {
  60. logout().then(resp => {
  61. uni.clearStorageSync()
  62. uni.hideLoading()
  63. uni.showToast({
  64. icon: 'none',
  65. title: '退出成功'
  66. })
  67. setTimeout(function() {
  68. uni.reLaunch({
  69. url: '/pages/login/index'
  70. })
  71. }, 1000)
  72. })
  73. })
  74. }
  75. }
  76. })
  77. }
  78. }
  79. }
  80. </script>
  81. <style>
  82. </style>