<template>
  <view class="main">
    <view class="header-toper">
      <view class="start-bar"></view>
      <view class="header-toper-title">
        <image src="../../static/img/back.png" mode="" @click="backOrder"></image>
        <text>{{$lang.lang.deletion.deletionTitle}}</text>
      </view>
    </view>
    <view class="logo1">
      <text>{{ $lang.lang.deletion.deletionText }}</text>
    </view>
    <view class="login-btns">
      <view class="" @click="loginOff">{{ $lang.lang.deletion.deletionButton }}</view>
    </view>
  </view>
</template>

<script>

import storage from "@/utils/storage";

export default {
  components: {
  },
  data() {
    return {
    }
  },
  onLoad() {
  },
  methods: {
    backOrder(){
      uni.navigateTo({
        url:'../deletion/login'
      })
    },
    loginOff() {
      let that = this
      uni.showModal({
        title: '提示',
        content: that.$lang.lang.site.logNotice,
        success: function (res) {
          if (res.confirm) {
            that.$request.deleted('/app-api/member/member/cancellation').then((res) => {
              if (res.code == 0 && res.data) {
                storage.clean()
                uni.showToast({
                  title: that.$lang.lang.site.offSuccess,
                  icon: 'none'
                })
                uni.setStorageSync('Authorization', '')
                setTimeout(() => {
                  uni.reLaunch({
                    url: '../deletion/login'
                  })
                  // uni.reLaunch({
                  // 	url: '../login/login'
                  // })
                }, 2000)
              } else {
                uni.showToast({
                  title: res.msg,
                  icon: 'none'
                })
              }
            })
          } else if (res.cancel) {
            console.log('用户点击取消')
          }
        }
      })
    },
  }
}
</script>

<style scoped>
page{
  width: 100%;
  position: relative;
  background: url(@/static/img/login-bg2.png) no-repeat;
  background-size:cover;
  height: 100%;
}
.logo1{
  padding: 30% 7%;
  color: red;
  font-size: 24px;
}
.login-btns{
  margin-top:20%;
  padding: 0 50upx;
}
.login-btns view{
  width: 100%;
  height: 96upx;
  border-radius: 100upx;
  color: var(--c0);
  font-size: 36upx;
  font-weight: 700;
  display: flex;
  justify-content: center;
  align-items: center;
  background: #5BA8DC;
  margin-bottom: 60upx;
}
</style>
