| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153 |
- <template>
- <page-meta :page-font-size="fontValue+'px'" :root-font-size="fontValue+'px'"></page-meta>
- <view>
- <cu-custom bgImage="/static/bg.png" :isBack="true">
- <template v-slot:content>
- <text class="text-black">注销账号</text>
- </template>
- </cu-custom>
- <view class="contentIncolumnC">
- <view style="width: 90%;margin-top: 40rpx;">
- <view class="contentInRowL">
- <text class="text-bold text-black">用户名:</text>
- <text>{{name}}</text>
- </view>
- <view class="contentInRowL" style="margin-top: 20rpx;">
- <text class="text-bold text-black">验证码:</text>
- <input type="number" class="main-input" v-model="form.yanzhma" placeholder="请输入验证码"/>
- </view>
- <view class="yzmbt" @click="getEmailcodeSele">
- <text>{{huoquyzm}}</text>
- </view>
- <view class="contentInRowL" style="margin-top: 20rpx;">
- <text class="text-grey">验证码将发至注册时填写的邮箱</text>
- </view>
- <view class="margin-top text-center">
- <button class="cu-btn bg-zblue border lg margin-top" style="width: 100%;" @tap="submit">注销</button>
- </view>
- </view>
- </view>
- </view>
- </template>
- <script setup lang="ts">
- import CuCustom from '@/colorui/components/cu-custom.vue'
- import {ref,reactive} from "vue";
- import Auth from "@/api/Auth";
- import {useUserStore} from "@/store/userStore";
- import {getcodeByUsername,zhuxiaozhanghao,clearVoipTk} from "@/api/Login";
- import MessageUtils from "@/utils/MessageUtils";
- const fontValue=ref(Auth.getfontSize());
- const userStore = useUserStore();
- let name = userStore.getUser()?.name;
- let username = userStore.getUser()?.username;
- const form = reactive({
- yanzhma: ""
- });
- const huoquyzm=ref('获取验证码');
- const timeCall=ref(0);
- const timer=ref();
- //邮箱验证码
- const getEmailcodeSele = () =>{
- if(timeCall.value==0){
- getEmailcodeact();
- }
- else{
- return;
- }
- }
- const getEmailcodeact = () =>{
- uni.showLoading({
- mask:true
- })
- getcodeByUsername(username).then((res : any) => {
- console.log('getEmailcode',res);
- uni.hideLoading();
- if(res.code==200){
- MessageUtils.success(res.msg);
- timeCall.value=60;
- timer.value = setInterval(() => {
- timeCall.value=timeCall.value-1;
- if(timeCall.value==0){
- clearInterval(timer.value);
- huoquyzm.value='获取验证码';
- }
- else{
- huoquyzm.value='重新获取'+'('+timeCall.value+')';
- }
- }, 1000);
- }
- else{
- MessageUtils.success(res.msg);
- }
- });
- }
- /** 提交按钮 */
- function submit() {
- console.log(form.yanzhma);
- if(form.yanzhma==''){
- MessageUtils.success('验证码不能为空');
- return;
- }
- let data={
- username: username,
- code:form.yanzhma
- }
- zhuxiaozhanghao(data)
- .then((res) => {
- console.log(res)
- MessageUtils.success('注销成功');
- var data={
- "voipTk":Auth.getvoipTk()
- }
- clearVoipTk(JSON.stringify(data)).then((res)=>{
- console.log('clearVoipTk2',res);
- })
- .catch((err) => {
- console.log('clearVoipTk2',err);
- });
- Auth.logout();
-
- })
- .catch((err) => {
- MessageUtils.error(err.msg);
- })
- }
- </script>
- <style scoped>
- @import url('@/static/css/main.css');
- .yzmbt{
- margin-top: 16rpx;
- color: white;
- font-size: 26upx;
- width: 170rpx;
- height: 60rpx;
- line-height: 60rpx;
- text-align: center;
- margin-left: auto;
- margin-right: 10rpx;
- border-radius: 2rpx;
- background-color:#60BA63;
- }
- .oBorder {
- border: none;
- border-radius: 8px;
- border: 1rpx solid #6E75FB;
- -webkit-box-shadow: 0 0 60upx 0 rgba(43, 86, 112, .1);
- box-shadow: 0 0 60upx 0 rgba(43, 86, 112, .1);
- }
- .main-input {
- flex: 1;
- text-align: left;
- font-size: 28upx;
- height: 60upx;
- padding-right: 10upx;
- border-radius: 8px;
- border: 1rpx solid #6E75FB;
- }
- </style>
|