index.vue 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222
  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 :style="{ paddingBottom: `${paddingBottom}px` }" 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. paddingBottom: 0
  49. }
  50. },
  51. onLoad() {
  52. this.getAgreement()
  53. },
  54. onShow() {
  55. uni.removeStorageSync('form_type_cart');
  56. },
  57. onReady() {
  58. const query = uni.createSelectorQuery().in(this);
  59. query.select('.footer').boundingClientRect(data => {
  60. this.paddingBottom = data.height;
  61. }).exec();
  62. },
  63. methods: {
  64. getAgreement() {
  65. getUserAgreement('cancel').then(res => {
  66. this.agreementData = res.data
  67. })
  68. },
  69. cancelUser() {
  70. cancelUser().then(res => {
  71. this.$store.commit("LOGOUT");
  72. uni.reLaunch({
  73. url: '/pages/index/index'
  74. })
  75. }).catch(msg => {
  76. return this.$util.Tips({
  77. title: msg
  78. });
  79. });
  80. }
  81. }
  82. }
  83. </script>
  84. <style lang="scss" scoped>
  85. .agreement {
  86. background-color: #fff;
  87. .content {
  88. padding: 0 30rpx;
  89. }
  90. }
  91. .top-msg {
  92. display: flex;
  93. align-items: center;
  94. background-color: #fff;
  95. padding: 40rpx 30rpx 40rpx 30rpx;
  96. .avatar {
  97. width: 76rpx;
  98. height: 76rpx;
  99. margin-right: 20rpx;
  100. img {
  101. width: 100%;
  102. height: 100%;
  103. border-radius: 50%;
  104. }
  105. }
  106. }
  107. .footer {
  108. text-align: center;
  109. z-index: 99;
  110. width: 100%;
  111. background-color: #fafafa;
  112. position: fixed;
  113. padding: 0 30rpx 36rpx 30rpx;
  114. box-sizing: border-box;
  115. border-top: 1rpx solid #eee;
  116. bottom: 0rpx;
  117. .trip {
  118. color: #999999;
  119. font-size: 24rpx;
  120. margin: 24rpx 0;
  121. }
  122. .cancellation {
  123. height: 45px;
  124. color: #fff;
  125. font-size: 32rpx;
  126. background: #E93323;
  127. border-radius: 23px;
  128. }
  129. }
  130. .tipaddress {
  131. position: fixed;
  132. left: 13%;
  133. top: 25%;
  134. // margin-left: -283rpx;
  135. width: 560rpx;
  136. height: 614rpx;
  137. background-color: #fff;
  138. border-radius: 10rpx;
  139. z-index: 100;
  140. text-align: center;
  141. .top {
  142. width: 560rpx;
  143. height: 270rpx;
  144. border-top-left-radius: 10rpx;
  145. border-top-right-radius: 10rpx;
  146. background-image: url('../../../static/images/address.png');
  147. background-repeat: round;
  148. background-color: #E93323;
  149. .tipsphoto {
  150. display: inline-block;
  151. width: 200rpx;
  152. height: 200rpx;
  153. margin-top: 73rpx;
  154. }
  155. }
  156. .bottom {
  157. font-size: 32rpx;
  158. font-weight: 400;
  159. .font1 {
  160. font-size: 36rpx;
  161. font-weight: 600;
  162. color: #333333;
  163. margin: 32rpx 0rpx 22rpx;
  164. }
  165. .font2 {
  166. color: #666666;
  167. margin-bottom: 48rpx;
  168. }
  169. .btn {
  170. display: flex;
  171. margin: 0 20rpx;
  172. .btn-sty {
  173. height: 82rpx;
  174. border-radius: 42rpx;
  175. line-height: 82rpx;
  176. padding: 24rpx 78rpx;
  177. margin: 0 auto;
  178. }
  179. .cancellation-btn {
  180. background-color: #F5F5F5;
  181. color: #333333;
  182. }
  183. .cancel {
  184. color: #FFFFFF;
  185. background: linear-gradient(90deg, #F67A38 0%, #F11B09 100%);
  186. }
  187. }
  188. }
  189. }
  190. .mark {
  191. position: fixed;
  192. top: 0;
  193. left: 0;
  194. bottom: 0;
  195. right: 0;
  196. background: rgba(0, 0, 0, 0.5);
  197. z-index: 99;
  198. }
  199. </style>