index.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. <template>
  2. <view class="agreement" :style="colorStyle">
  3. <view class="flex-center">
  4. <text class="iconfont icon-a-ic_tanhao1"></text>
  5. </view>
  6. <view class="name text-center">账号注销风险</view>
  7. <view class="content" v-html="agreementData.content"></view>
  8. <view class="footerH"></view>
  9. <view class="footer">
  10. <view class="trip">
  11. <checkbox-group @change="ChangeIsDefault">
  12. <checkbox :class="inAnimation ? 'trembling' : ''" @animationend="inAnimation = false" :checked="protocol ? true : false" />
  13. 我已阅读并同意
  14. <text class="red" @click="privacy('privacy ')">《隐私协议》</text>
  15. </checkbox-group>
  16. </view>
  17. <view class="cancellation flex-aj-center" @click="next">下一步</view>
  18. </view>
  19. <view class="mark" v-show="isCancellation"></view>
  20. <tui-modal :show="isCancellation" maskClosable custom @cancel="isCancellation = false">
  21. <view class="tui-modal-custom">
  22. <view class="fs-32 fw-500 lh-44rpx text-center">是否确认注销</view>
  23. <view class="fs-30 text--w111-666 lh-42rpx text-center mt-22">注销后无法恢复,请谨慎操作</view>
  24. <view class="flex-y-center">
  25. <view class="w-full h-72 rd-36rpx flex-center border b-solid b--w111-ccc text-primary-con fs-26 mt-32 mr-16 clear-btn" @tap="cancelUser">注销</view>
  26. <view class="w-full h-72 rd-36rpx flex-center bg-red fs-26 text--w111-fff mt-32 ml-16" @tap="isCancellation = false">取消</view>
  27. </view>
  28. </view>
  29. </tui-modal>
  30. </view>
  31. </template>
  32. <script>
  33. import colors from '@/mixins/color.js';
  34. import { getUserAgreement, cancelUser, getLogout } from '@/api/user.js';
  35. import tuiModal from '@/components/tui-modal/index.vue';
  36. export default {
  37. mixins: [colors],
  38. components: { tuiModal },
  39. data() {
  40. return {
  41. isCancellation: false,
  42. agreementData: '',
  43. protocol: false,
  44. inAnimation: false,
  45. };
  46. },
  47. onLoad() {
  48. this.getAgreement();
  49. },
  50. onShow() {
  51. uni.removeStorageSync('form_type_cart');
  52. },
  53. methods: {
  54. ChangeIsDefault(e) {
  55. this.$set(this, 'protocol', !this.protocol);
  56. },
  57. getAgreement() {
  58. getUserAgreement('cancel').then((res) => {
  59. this.agreementData = res.data;
  60. });
  61. },
  62. next() {
  63. if (this.protocol) {
  64. this.isCancellation = true;
  65. } else {
  66. this.$util.Tips({
  67. title: '请先阅读隐私协议'
  68. });
  69. }
  70. },
  71. cancelUser() {
  72. cancelUser()
  73. .then((res) => {
  74. this.$store.commit('LOGOUT');
  75. uni.reLaunch({
  76. url: '/pages/index/index'
  77. });
  78. })
  79. .catch((msg) => {
  80. return this.$util.Tips({
  81. title: msg
  82. });
  83. });
  84. },
  85. privacy(type) {
  86. uni.navigateTo({
  87. url: '/pages/users/privacy/index?type=' + type
  88. });
  89. }
  90. }
  91. };
  92. </script>
  93. <style lang="scss" scoped>
  94. .footerH {
  95. height: 250rpx;
  96. }
  97. .agreement {
  98. background-color: #fff;
  99. padding-top: 84rpx;
  100. .content {
  101. padding: 0 30rpx;
  102. }
  103. .name {
  104. padding: 30rpx 0 48rpx;
  105. font-size: 36rpx;
  106. font-weight: 500;
  107. color: #333333;
  108. line-height: 50rpx;
  109. }
  110. }
  111. .top-msg {
  112. display: flex;
  113. align-items: center;
  114. background-color: #fff;
  115. padding: 40rpx 30rpx 40rpx 30rpx;
  116. }
  117. .icon-a-ic_tanhao1 {
  118. font-size: 68rpx;
  119. color: #e93323;
  120. }
  121. .footer {
  122. text-align: center;
  123. z-index: 99;
  124. width: 100%;
  125. background-color: #fafafa;
  126. position: fixed;
  127. padding: 0 30rpx 36rpx 30rpx;
  128. box-sizing: border-box;
  129. border-top: 1rpx solid #eee;
  130. bottom: 0rpx;
  131. .red {
  132. color: #e93323;
  133. }
  134. .trip {
  135. color: #999999;
  136. font-size: 24rpx;
  137. margin: 24rpx 0;
  138. }
  139. .cancellation {
  140. height: 45px;
  141. color: #fff;
  142. font-size: 32rpx;
  143. background: #e93323;
  144. border-radius: 23px;
  145. }
  146. }
  147. .mark {
  148. position: fixed;
  149. top: 0;
  150. left: 0;
  151. bottom: 0;
  152. right: 0;
  153. background: rgba(0, 0, 0, 0.5);
  154. z-index: 99;
  155. }
  156. .clear-btn{
  157. border: 1px solid #E93323;
  158. color: #E93323;
  159. }
  160. </style>