index.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216
  1. <template>
  2. <view class="agreement" :style="colorStyle">
  3. <view class="top-msg" v-if="agreementData.avatar">
  4. <view class="avatar">
  5. <img :src="agreementData.avatar" alt="">
  6. </view>
  7. <view class="name">{{agreementData.name}}</view>
  8. </view>
  9. <view class="content" v-html="agreementData.content">
  10. </view>
  11. <view class="footer">
  12. <view class="trip">
  13. 点击【立即注销】即代表您已经同意《用户注销协议》
  14. </view>
  15. <view class="cancellation flex-aj-center" @click="isCancellation = true">
  16. 立即注销
  17. </view>
  18. </view>
  19. <view class="mark" v-show="isCancellation"></view>
  20. <view class="tipaddress" v-show="isCancellation">
  21. <view class="top"></view>
  22. <view class="bottom">
  23. <view class="font1">是否确认注销</view>
  24. <view class="font2">注销后无法恢复,请谨慎操作</view>
  25. <view class="btn">
  26. <view class="cancellation-btn btn-sty flex-aj-center" @tap="cancelUser">注销</view>
  27. <view class="cancel btn-sty flex-aj-center" @tap="isCancellation = false">
  28. 取消
  29. </view>
  30. </view>
  31. </view>
  32. </view>
  33. </view>
  34. </template>
  35. <script>
  36. import colors from '@/mixins/color.js';
  37. import {
  38. getUserAgreement,
  39. cancelUser,
  40. getLogout
  41. } from '@/api/user.js'
  42. export default {
  43. mixins: [colors],
  44. data() {
  45. return {
  46. isCancellation: false,
  47. agreementData: ''
  48. }
  49. },
  50. onLoad() {
  51. this.getAgreement()
  52. },
  53. onShow() {
  54. uni.removeStorageSync('form_type_cart');
  55. },
  56. methods: {
  57. getAgreement() {
  58. getUserAgreement('cancel').then(res => {
  59. this.agreementData = res.data
  60. })
  61. },
  62. cancelUser() {
  63. cancelUser().then(res => {
  64. this.$store.commit("LOGOUT");
  65. uni.reLaunch({
  66. url: '/pages/index/index'
  67. })
  68. }).catch(msg => {
  69. return this.$util.Tips({
  70. title: msg
  71. });
  72. });
  73. }
  74. }
  75. }
  76. </script>
  77. <style lang="scss" scoped>
  78. .agreement {
  79. background-color: #fff;
  80. .content {
  81. padding: 0 30rpx;
  82. height: calc(100vh - 61rpx);
  83. }
  84. }
  85. .top-msg {
  86. display: flex;
  87. align-items: center;
  88. background-color: #fff;
  89. padding: 40rpx 30rpx 40rpx 30rpx;
  90. .avatar {
  91. width: 76rpx;
  92. height: 76rpx;
  93. margin-right: 20rpx;
  94. img {
  95. width: 100%;
  96. height: 100%;
  97. border-radius: 50%;
  98. }
  99. }
  100. }
  101. .footer {
  102. text-align: center;
  103. z-index: 99;
  104. width: 100%;
  105. background-color: #fafafa;
  106. position: fixed;
  107. padding: 36rpx 30rpx;
  108. box-sizing: border-box;
  109. border-top: 1rpx solid #eee;
  110. bottom: 0rpx;
  111. .trip {
  112. color: #999999;
  113. font-size: 24rpx;
  114. margin: 24rpx 0;
  115. }
  116. .cancellation {
  117. height: 45px;
  118. color: #fff;
  119. font-size: 32rpx;
  120. background: #E93323;
  121. border-radius: 23px;
  122. }
  123. }
  124. .tipaddress {
  125. position: fixed;
  126. left: 13%;
  127. top: 25%;
  128. // margin-left: -283rpx;
  129. width: 560rpx;
  130. height: 614rpx;
  131. background-color: #fff;
  132. border-radius: 10rpx;
  133. z-index: 100;
  134. text-align: center;
  135. .top {
  136. width: 560rpx;
  137. height: 270rpx;
  138. border-top-left-radius: 10rpx;
  139. border-top-right-radius: 10rpx;
  140. background-image: url('../../../static/images/address.png');
  141. background-repeat: round;
  142. background-color: #E93323;
  143. .tipsphoto {
  144. display: inline-block;
  145. width: 200rpx;
  146. height: 200rpx;
  147. margin-top: 73rpx;
  148. }
  149. }
  150. .bottom {
  151. font-size: 32rpx;
  152. font-weight: 400;
  153. .font1 {
  154. font-size: 36rpx;
  155. font-weight: 600;
  156. color: #333333;
  157. margin: 32rpx 0rpx 22rpx;
  158. }
  159. .font2 {
  160. color: #666666;
  161. margin-bottom: 48rpx;
  162. }
  163. .btn {
  164. display: flex;
  165. margin: 0 20rpx;
  166. .btn-sty {
  167. height: 82rpx;
  168. border-radius: 42rpx;
  169. line-height: 82rpx;
  170. padding: 24rpx 78rpx;
  171. margin: 0 auto;
  172. }
  173. .cancellation-btn {
  174. background-color: #F5F5F5;
  175. color: #333333;
  176. }
  177. .cancel {
  178. color: #FFFFFF;
  179. background: linear-gradient(90deg, #F67A38 0%, #F11B09 100%);
  180. }
  181. }
  182. }
  183. }
  184. .mark {
  185. position: fixed;
  186. top: 0;
  187. left: 0;
  188. bottom: 0;
  189. right: 0;
  190. background: rgba(0, 0, 0, 0.5);
  191. z-index: 99;
  192. }
  193. </style>