| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194 |
- <template>
- <view class="content">
- <view class="set-box" >
- <view class="item" @tap="showAlert()">
- <view class="left">
- <view class="title">账号注销及删除应用数据</view>
- </view>
- </view>
- </view>
-
- <view class="checkbox">
- <view class="checkbox-icon" @tap="handleAgree">
- <image src="../../static/image/login/radio_default.png" v-show="!agree"></image>
- <image src="../../static/image/login/radio_choose.png" v-show="agree"></image>
- </view>
- <view>我已阅读并同意<text @tap="goToWeb()">《用户注销协议》</text> </view>
- </view>
-
- <u-modal
- :show="showCustomModal"
- title="您正在申请注销账户"
- content="1.账户一旦注销,不可恢复\n 2.用户权益等视为自行放弃,无法继续使用\n"
- :show-cancel-button="true"
- cancel-text="我再想想"
- confirm-text="仍然注销"
- @confirm="deleteUser"
- @cancel="showCustomModal = false">
- </u-modal>
-
- </view>
- </template>
- <script>
- import { removeUser } from '@/api/user'
- export default {
- data() {
- return {
- showCustomModal:false,
- userInfo:null,
- agree: false
- }
- },
- onLoad() {
- this.userInfo = JSON.parse(uni.getStorageSync('userInfo'));
- },
- methods: {
- // 同意
- handleAgree() {
- this.agree = !this.agree
- },
- showAlert(){
- if(!this.agree){
- uni.showToast({icon:'none',title: "请先同意用户注销协议"});
- return;
- }
- let that=this;
- this.showCustomModal=true;
- },
- deleteUser(){
- let that=this;
- uni.showLoading({title:""});
- removeUser().then(res => {
- uni.hideLoading();
- if(res.code==200){
- uni.showToast({icon:'none',title: "账号已注销"});
- setTimeout(()=>{
- uni.$emit("loginOut");
- },2000);
- }
- else{
- uni.showToast({
- icon:'none',
- title: res.msg
- });
- }
- },
- rej => {}
- );
- },
- goToWeb(index){
- uni.setStorageSync('url',"https://userapp.zkhj6.com/web/userRemoveService");
- uni.navigateTo({
- url:"/pages/index/h5"
- })
- },
- }
- }
-
-
- </script>
- <style scoped lang="scss">
-
- @mixin u-flex($flexD, $alignI, $justifyC) {
- display: flex;
- flex-direction: $flexD;
- align-items: $alignI;
- justify-content: $justifyC;
- }
-
- page{
- height: 100%;
- }
- .content{
- height: 100%;
- background-color: #f5f5f5;
- }
- .line{
- height: 1px;background-color: #F7F7F7;
- }
- .logo{
- padding-top: 15%;
- text-align: center;
- image{
- width: 120rpx;
- height: 120rpx;
- border-radius: 10rpx;
- box-shadow:0px 0px 20rpx rgba(0,0,0,0.2);
- }
- p{
- margin: 10px 0px;
- font-size: 14px;
- }
- }
- .set-box{
- margin-top: 20upx;
- background: #fff;
- padding: 0 30upx;
- .item{
- position: relative;
- display: flex;
- align-items: center;
- justify-content: space-between;
- padding: 25upx 0;
- .left{
- display: flex;
- flex-direction: column;
- .title{
- font-size: 32upx;
- font-weight: bold;
- color: #333;
- margin-bottom: 10rpx;
- }
- .text{
- font-size: 22upx;
- color: #999;
- }
-
- }
- .right{
- width: 10upx;
- height: 20upx;
-
- }
- .right-text{
-
- }
- }
- }
- .checkbox {
- margin-left: 24rpx;
- margin-top: 24rpx;
- @include u-flex(row, flex-start, flex-start);
- font-family: PingFang SC, PingFang SC;
- font-weight: 400;
- font-size: 26rpx;
- color: #999999;
- line-height: 38rpx;
- text-align: left;
- text {
- color:#2583EB;
- }
- &-icon {
- flex-shrink: 0;
- margin-right: 12rpx;
- image {
- height: 24rpx;
- width: 24rpx;
- }
- }
-
- }
- </style>
|