account-delete 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. <template>
  2. <view class="account-delete-page">
  3. <view class="warning-card">
  4. <uni-icons type="info-filled" size="48" color="#f44336"></uni-icons>
  5. <text class="warning-title">账号注销须知</text>
  6. <text class="warning-text">注销账号后,以下数据将被永久删除且不可恢复:</text>
  7. <view class="warning-list">
  8. <text class="warning-item">• 个人信息及宠物档案</text>
  9. <text class="warning-item">• 历史订单记录</text>
  10. <text class="warning-item">• 评价与投诉记录</text>
  11. <text class="warning-item">• 账户余额(如有)</text>
  12. </view>
  13. </view>
  14. <view class="confirm-section">
  15. <view class="check-row">
  16. <checkbox-group @change="onCheckChange">
  17. <label class="check-label">
  18. <checkbox :checked="confirmed" color="#f44336" style="transform: scale(0.7);" />
  19. <text>我已了解上述风险,确认注销</text>
  20. </label>
  21. </checkbox-group>
  22. </view>
  23. <button class="delete-btn" :disabled="!confirmed" @click="onDelete">确认注销账号</button>
  24. </view>
  25. </view>
  26. </template>
  27. <script setup>
  28. import { ref } from 'vue'
  29. const confirmed = ref(false)
  30. const onCheckChange = () => { confirmed.value = !confirmed.value }
  31. const onDelete = () => {
  32. uni.showModal({
  33. title: '最终确认',
  34. content: '账号注销后无法恢复,确定继续吗?',
  35. confirmColor: '#f44336',
  36. success: (res) => {
  37. if (res.confirm) {
  38. uni.showToast({ title: '账号已注销', icon: 'success' })
  39. setTimeout(() => uni.navigateTo({ url: '/pages/login/login/index' }), 1000)
  40. }
  41. }
  42. })
  43. }
  44. </script>
  45. <style lang="scss" scoped>
  46. .account-delete-page {
  47. min-height: 100vh;
  48. background: #f7f8fa;
  49. padding: 40rpx 32rpx;
  50. }
  51. .warning-card {
  52. background: #fff;
  53. border-radius: 24rpx;
  54. padding: 48rpx 32rpx;
  55. display: flex;
  56. flex-direction: column;
  57. align-items: center;
  58. text-align: center;
  59. }
  60. .warning-title {
  61. font-size: 36rpx;
  62. font-weight: 800;
  63. color: #f44336;
  64. margin: 24rpx 0 16rpx;
  65. }
  66. .warning-text {
  67. font-size: 28rpx;
  68. color: #666;
  69. margin-bottom: 24rpx;
  70. }
  71. .warning-list {
  72. align-self: flex-start;
  73. }
  74. .warning-item {
  75. display: block;
  76. font-size: 26rpx;
  77. color: #999;
  78. line-height: 2;
  79. }
  80. .confirm-section {
  81. margin-top: 48rpx;
  82. }
  83. .check-row {
  84. margin-bottom: 32rpx;
  85. }
  86. .check-label {
  87. display: flex;
  88. align-items: center;
  89. font-size: 26rpx;
  90. color: #666;
  91. }
  92. .delete-btn {
  93. width: 100%;
  94. height: 96rpx;
  95. background: #f44336;
  96. color: #fff;
  97. border: none;
  98. border-radius: 48rpx;
  99. font-size: 32rpx;
  100. font-weight: bold;
  101. line-height: 96rpx;
  102. }
  103. .delete-btn[disabled] {
  104. background: #ccc;
  105. }
  106. </style>