logOff.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. <template>
  2. <div class="logoff">
  3. <div class="logo flex align-center justify-center">
  4. <el-icon :size="60" color="#00DD9A">
  5. <WarningFilled />
  6. </el-icon>
  7. </div>
  8. <div class="title">
  9. 注销亿职赞服务
  10. </div>
  11. <div class="titles">
  12. 亿职赞服务注销后,您将放弃以下权益且无法找回
  13. </div>
  14. <div class="xieyi">
  15. <div class="xieyi-item">
  16. ·您将无法通过该账号登录、使用亿职赞平台
  17. </div>
  18. <div class="xieyi-item">
  19. ·您将无法访问账号的个人信息(包括账号、昵称、头像等)
  20. </div>
  21. <div class="xieyi-item">
  22. ·您账号的所有权益,将视为主动放弃
  23. </div>
  24. </div>
  25. <div class="tongyi">
  26. 点击【确认注销】即代表您已同意<span @click="dialogAgreements = true">《用户注销协议》</span>
  27. </div>
  28. <div class="btn flex align-center justify-center">
  29. <el-button style="width: 400px;" size="large" @click="logOff()" type="primary">确认注销</el-button>
  30. </div>
  31. <!-- 协议弹窗 -->
  32. <agreement :title="title" v-if="dialogAgreements" :dialogAgreements="dialogAgreements" :typeid="typeid"
  33. @closeAgree="closeAgree" />
  34. </div>
  35. </template>
  36. <script>
  37. import {
  38. ElMessageBox,
  39. ElMessage,
  40. } from 'element-plus'
  41. import agreement from '../../components/agreement/agreement.vue'
  42. export default {
  43. components: {
  44. agreement
  45. },
  46. data() {
  47. return {
  48. screenHeight: 0,
  49. dialogAgreements: false,
  50. title: '用户注销协议',
  51. typeid: '343',
  52. }
  53. },
  54. mounted() {
  55. this.screenHeight = window.innerHeight
  56. },
  57. methods: {
  58. //注销账号
  59. logOff() {
  60. ElMessageBox.confirm(
  61. '确认注销后,您将退出登录,并清除所有数据',
  62. '提示', {
  63. confirmButtonText: '确认注销',
  64. cancelButtonText: '我在想想想',
  65. type: 'warning',
  66. }
  67. ).then(() => {
  68. let data = {
  69. state: 8,
  70. }
  71. this.$Request.post('/app/user/logout', data, {
  72. type: 'json'
  73. }).then(res => {
  74. if (res.code == 0) {
  75. ElMessage({
  76. message: '提交成功',
  77. type: 'success',
  78. duration: 1500,
  79. offset: this.screenHeight / 2
  80. })
  81. localStorage.removeItem('token');
  82. localStorage.removeItem('userId');
  83. localStorage.removeItem('userType')
  84. // 调用重置状态的函数
  85. this.$store.dispatch('SET_DATA');
  86. this.$router.push({
  87. name: 'login'
  88. })
  89. } else {
  90. ElMessage({
  91. message: res.msg,
  92. type: 'error',
  93. duration: 1500,
  94. offset: this.screenHeight / 2
  95. })
  96. }
  97. })
  98. }).catch(() => {})
  99. },
  100. closeAgree(data) {
  101. this.dialogAgreements = data
  102. },
  103. }
  104. }
  105. </script>
  106. <style lang="scss" scoped>
  107. .logo {
  108. width: 100%;
  109. }
  110. .title {
  111. width: 100%;
  112. text-align: center;
  113. font-size: 28px;
  114. font-weight: bold;
  115. margin-top: 20px;
  116. }
  117. .titles {
  118. width: 100%;
  119. text-align: center;
  120. margin-top: 10px;
  121. color: #999999;
  122. }
  123. .xieyi {
  124. width: fit-content;
  125. padding: 10px 20px 20px 20px;
  126. background-color: #f5f5f5;
  127. margin: 0 auto;
  128. margin-top: 20px;
  129. border-radius: 10px;
  130. .xieyi-item {
  131. margin-top: 10px;
  132. }
  133. }
  134. .tongyi {
  135. width: 100%;
  136. text-align: center;
  137. color: #999999;
  138. margin-top: 20px;
  139. font-size: 13px;
  140. span {
  141. color: #00DD9A;
  142. cursor: pointer;
  143. }
  144. }
  145. .btn {
  146. width: 100%;
  147. margin-top: 20px;
  148. }
  149. </style>