setting.vue 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. <script>
  2. import api from '@/api'
  3. export default {
  4. data() {
  5. return {
  6. version: this.$store.state.sysInfo.app_version
  7. }
  8. },
  9. methods: {
  10. async exit() {
  11. // await api.logout()
  12. this.$refs.modal.show = false
  13. this.$store.commit('exit', 'logout')
  14. },
  15. async denyOff() {
  16. await api.denyOff()
  17. this.$refs.modal1.show = false
  18. this.$common.toast('注销成功')
  19. setTimeout(() => {
  20. this.$store.commit('exit', 'logout')
  21. }, 1000)
  22. }
  23. }
  24. }
  25. </script>
  26. <template>
  27. <view>
  28. <view class="radius10 bg-white w-m mt-10 group">
  29. <view class="item" @click="$jump({ url: './securityCenter' })">
  30. <view class="title f28">账号安全</view>
  31. <u-icon name="arrow-right" color="#5c5c5c"></u-icon>
  32. </view>
  33. <view class="item">
  34. <view class="title f28">版本号</view>
  35. <view class="value">{{ 'V' + version }}</view>
  36. </view>
  37. <view class="item" @click="$refs.modal1.show = true">
  38. <view class="title f28">注销账号</view>
  39. <u-icon name="arrow-right" color="#5c5c5c"></u-icon>
  40. </view>
  41. </view>
  42. <u-button
  43. text="退出登录"
  44. color="var(--theme)"
  45. @click="$refs.modal.show = true"
  46. shape="circle"
  47. customStyle="width: 650rpx;height: 98rpx; position:fixed;bottom:100rpx;left:50%;transform:translate(-50%)"
  48. ></u-button>
  49. <custom-modal ref="modal" @confirm="exit" content="是否确定退出登录?"></custom-modal>
  50. <custom-modal ref="modal1" @confirm="denyOff" content="是否确定注销账号?"></custom-modal>
  51. </view>
  52. </template>
  53. <style lang="scss" scoped>
  54. .group {
  55. padding: 0 24rpx;
  56. .item {
  57. display: flex;
  58. justify-content: space-between;
  59. align-items: center;
  60. height: 98rpx;
  61. line-height: 98rpx;
  62. box-sizing: border-box;
  63. .title {
  64. color: #1e1e1e;
  65. }
  66. .value {
  67. color: #5c5c5c;
  68. font-size: 28rpx;
  69. }
  70. & + .item {
  71. border-top: 1px solid #f5f5f5;
  72. }
  73. }
  74. }
  75. </style>