accountSafe.vue 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
  1. <template>
  2. <view class="content">
  3. <view class="set-box" >
  4. <view class="item" @tap="showAlert()">
  5. <view class="left">
  6. <view class="title">账号注销及删除应用数据</view>
  7. </view>
  8. </view>
  9. </view>
  10. <view class="checkbox">
  11. <view class="checkbox-icon" @tap="handleAgree">
  12. <image src="../../static/image/login/radio_default.png" v-show="!agree"></image>
  13. <image src="../../static/image/login/radio_choose.png" v-show="agree"></image>
  14. </view>
  15. <view>我已阅读并同意<text @tap="goToWeb()">《用户注销协议》</text> </view>
  16. </view>
  17. <u-modal
  18. :show="showCustomModal"
  19. title="您正在申请注销账户"
  20. content="1.账户一旦注销,不可恢复\n 2.用户权益等视为自行放弃,无法继续使用\n"
  21. :show-cancel-button="true"
  22. cancel-text="我再想想"
  23. confirm-text="仍然注销"
  24. @confirm="deleteUser"
  25. @cancel="showCustomModal = false">
  26. </u-modal>
  27. </view>
  28. </template>
  29. <script>
  30. import { removeUser } from '@/api/user'
  31. export default {
  32. data() {
  33. return {
  34. showCustomModal:false,
  35. userInfo:null,
  36. agree: false
  37. }
  38. },
  39. onLoad() {
  40. this.userInfo = JSON.parse(uni.getStorageSync('userInfo'));
  41. },
  42. methods: {
  43. // 同意
  44. handleAgree() {
  45. this.agree = !this.agree
  46. },
  47. showAlert(){
  48. if(!this.agree){
  49. uni.showToast({icon:'none',title: "请先同意用户注销协议"});
  50. return;
  51. }
  52. let that=this;
  53. this.showCustomModal=true;
  54. // uni.showModal({
  55. // title:"您正在申请注销账户",
  56. // content:"账户一旦注销,不可恢复\n 2.会员权益等视为自行放弃,无法继续使用\n 3.医疗行业受法律监管用户问诊订单/病历数据等必须保持15年以上。",
  57. // showCancel:true,
  58. // cancelText:'我再想想',
  59. // confirmText:'仍然注销',
  60. // success:res=>{
  61. // if(res.confirm){
  62. // this.deleteUser();
  63. // }else{
  64. // // 否则点击了取消
  65. // }
  66. // }
  67. // });
  68. },
  69. deleteUser(){
  70. let that=this;
  71. uni.showLoading({title:""});
  72. removeUser().then(res => {
  73. uni.hideLoading();
  74. if(res.code==200){
  75. uni.showToast({icon:'none',title: "账号已注销"});
  76. setTimeout(()=>{
  77. uni.$emit("loginOut");
  78. },2000);
  79. }
  80. else{
  81. uni.showToast({
  82. icon:'none',
  83. title: res.msg
  84. });
  85. }
  86. },
  87. rej => {}
  88. );
  89. },
  90. goToWeb(index){
  91. uni.setStorageSync('url',"http://app.fbylive.com/web/userRemoveService");
  92. uni.navigateTo({
  93. url:"/pages/index/h5"
  94. })
  95. },
  96. }
  97. }
  98. </script>
  99. <style scoped lang="scss">
  100. @mixin u-flex($flexD, $alignI, $justifyC) {
  101. display: flex;
  102. flex-direction: $flexD;
  103. align-items: $alignI;
  104. justify-content: $justifyC;
  105. }
  106. page{
  107. height: 100%;
  108. }
  109. .content{
  110. height: 100%;
  111. background-color: #f5f5f5;
  112. }
  113. .line{
  114. height: 1px;background-color: #F7F7F7;
  115. }
  116. .logo{
  117. padding-top: 15%;
  118. text-align: center;
  119. image{
  120. width: 120rpx;
  121. height: 120rpx;
  122. border-radius: 10rpx;
  123. box-shadow:0px 0px 20rpx rgba(0,0,0,0.2);
  124. }
  125. p{
  126. margin: 10px 0px;
  127. font-size: 14px;
  128. }
  129. }
  130. .set-box{
  131. margin-top: 20upx;
  132. background: #fff;
  133. padding: 0 30upx;
  134. .item{
  135. position: relative;
  136. display: flex;
  137. align-items: center;
  138. justify-content: space-between;
  139. padding: 25upx 0;
  140. .left{
  141. display: flex;
  142. flex-direction: column;
  143. .title{
  144. font-size: 32upx;
  145. font-weight: bold;
  146. color: #333;
  147. margin-bottom: 10rpx;
  148. }
  149. .text{
  150. font-size: 22upx;
  151. color: #999;
  152. }
  153. }
  154. .right{
  155. width: 10upx;
  156. height: 20upx;
  157. }
  158. .right-text{
  159. }
  160. }
  161. }
  162. .checkbox {
  163. margin-left: 24rpx;
  164. margin-top: 24rpx;
  165. @include u-flex(row, flex-start, flex-start);
  166. font-family: PingFang SC, PingFang SC;
  167. font-weight: 400;
  168. font-size: 26rpx;
  169. color: #999999;
  170. line-height: 38rpx;
  171. text-align: left;
  172. text {
  173. color:#2583EB;
  174. }
  175. &-icon {
  176. flex-shrink: 0;
  177. margin-right: 12rpx;
  178. image {
  179. height: 24rpx;
  180. width: 24rpx;
  181. }
  182. }
  183. }
  184. </style>