index.vue 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. <template>
  2. <view class="cancellation-v">
  3. <view class="cancellation-hd">
  4. <image :src="accountSecurity"></image>
  5. </view>
  6. <view class="content u-flex-col">
  7. <view class="content-text u-flex-col">
  8. <text class="content-title u-font-36 u-type-primary">确认注销账户?</text>
  9. <text class="content-tip u-font-28">注销账户后以下数据将全部清空</text>
  10. <view class="list u-flex-col u-font-26">
  11. <text class="item">企业组织架构和员工信息</text>
  12. <text class="item">所有数据和聊天记录</text>
  13. <text class="item">删除和永久注销JNPF账户</text>
  14. </view>
  15. </view>
  16. <view class="btn">
  17. <u-button type="primary" @click="handleClick">注销账号</u-button>
  18. </view>
  19. </view>
  20. </view>
  21. </template>
  22. <script>
  23. import {
  24. accountCancel,
  25. logout
  26. } from '@/api/common.js'
  27. import resources from '@/libs/resources.js'
  28. export default {
  29. data() {
  30. return {
  31. accountSecurity: resources.banner.accountSecurity
  32. }
  33. },
  34. computed: {
  35. token() {
  36. return uni.getStorageSync('token')
  37. },
  38. userInfo() {
  39. return uni.getStorageSync('userInfo') || {}
  40. }
  41. },
  42. methods: {
  43. handleClick() {
  44. uni.showModal({
  45. title: '提示',
  46. content: '您的JNPF账号将被删除,您确定要注销JNPF账号么?',
  47. success: res => {
  48. if (res.confirm) {
  49. if (this.userInfo.isAdministrator) return this.$u.toast('管理员账号不能注销')
  50. accountCancel(this.token).then((res) => {
  51. this.$u.toast(res.msg)
  52. setTimeout(() => {
  53. uni.reLaunch({
  54. url: '/pages/login/index'
  55. })
  56. }, 1000)
  57. })
  58. }
  59. }
  60. })
  61. },
  62. }
  63. }
  64. </script>
  65. <style lang="scss">
  66. .cancellation-v {
  67. .cancellation-hd {
  68. width: 100%;
  69. height: 280rpx;
  70. image {
  71. width: 100%;
  72. height: 100%;
  73. }
  74. }
  75. .content {
  76. .content-text {
  77. justify-content: center;
  78. padding: 176rpx 0 0 190rpx;
  79. }
  80. .content-title {
  81. height: 100rpx;
  82. font-weight: 700;
  83. }
  84. .content-tip {
  85. height: 80rpx;
  86. color: #252B3A;
  87. }
  88. .list {
  89. .item {
  90. margin-bottom: 35rpx;
  91. color: #666;
  92. display: flex;
  93. flex-direction: row;
  94. align-items: center;
  95. &::before {
  96. content: "";
  97. width: 12rpx;
  98. height: 12rpx;
  99. border-radius: 50%;
  100. background-color: #356efe;
  101. margin-right: 30rpx;
  102. }
  103. }
  104. }
  105. .btn {
  106. padding: 0 32rpx;
  107. width: 100%;
  108. position: fixed;
  109. bottom: 40rpx;
  110. margin: 0 auto;
  111. }
  112. }
  113. }
  114. </style>