logout.vue 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. <template>
  2. <view>
  3. <u-navbar title="注销账号"></u-navbar>
  4. <view class="logout-head">
  5. <img src="../../static/img/logout.png" alt="">
  6. <p>注销帐号</p>
  7. </view>
  8. <view class="logout-text">
  9. <p>我们很遗憾您做出注销帐号的决定,在提交申请前请您仔细阅读以下内容:</p>
  10. <p> 1.您应确保您有权决定该账户的注销事宜,不侵犯任何第三方的合法权益,如因此引发任何投诉争议,由您自行承担。</p>
  11. <p> 2.帐号注销后您无法再使用本社区的各项服务,您的个人信息及求助记录也将被清空。</p>
  12. <p> 3.如您已被国家机关调查或正处于诉讼、仲裁程序中,请注意,注销您的帐号并不代表此帐号注销前的帐号行为和相关责任得到豁免或减轻。</p>
  13. </view>
  14. <view class="logout-btn">
  15. <u-button class="logout-btn1" shape="circle" type="" @click="logout">
  16. <span>继续注销</span>
  17. </u-button>
  18. <u-button class="logout-btn2" shape="circle" type="success" @click="toSetting">
  19. <span>我再想想</span>
  20. </u-button>
  21. </view>
  22. </view>
  23. </template>
  24. <script>
  25. import * as userApi from '@/apis/user.js'
  26. export default {
  27. data() {
  28. return {
  29. }
  30. },
  31. methods: {
  32. toSetting() {
  33. uni.navigateBack({
  34. })
  35. },
  36. logout() {
  37. uni.showLoading({
  38. title: "加载中",
  39. mask: true,
  40. })
  41. userApi.deleteUser().then((res) => {
  42. uni.hideLoading();
  43. uni.redirectTo({
  44. url: '/pages/login/login'
  45. })
  46. }).catch(error => {
  47. uni.showToast({
  48. title: error,
  49. icon: "none"
  50. })
  51. })
  52. }
  53. }
  54. }
  55. </script>
  56. <style>
  57. page{
  58. background-color: #fff;
  59. }
  60. </style>
  61. <style lang="scss" scoped>
  62. .collapse{
  63. background-color: #fff;
  64. padding:0 10px;
  65. }
  66. .logout-head{
  67. background-color: #FF5E5E ;
  68. padding: 20px 0;
  69. display: flex;
  70. flex-direction: column;
  71. align-items: center;
  72. img{
  73. height: 52px;
  74. width: 52px;
  75. }
  76. p{
  77. color:#fff;
  78. margin-top: 4px;
  79. }
  80. }
  81. .logout-text{
  82. padding: 24px;
  83. p{
  84. line-height: 28px;
  85. }
  86. }
  87. .logout-btn{
  88. display: flex;
  89. justify-content: space-between;
  90. padding: 0 24px;
  91. }
  92. .logout-btn1{
  93. color:#BBBBBB!important;
  94. background-color:#fff!important;
  95. flex: 0.4;
  96. span{
  97. color:#333;
  98. }
  99. }
  100. .logout-btn2{
  101. background-color:#00B962!important;
  102. flex: 0.4;
  103. border-color: #00B962!important;
  104. color:#fff!important;
  105. }
  106. </style>