zh
liuyongli 3 years ago
parent 813dace43b
commit 93995a546a

@ -0,0 +1,144 @@
<template>
<view>
<view class="flex flex-direction align-center">
<view style="font-size: 60rpx;margin: 60rpx 0 30rpx;">输入短信验证码</view>
<view style="font-size: 34rpx;color: #888888;line-height: 50rpx;">我们将发送短信验证码到你的手机号</view>
<view style="font-size: 48rpx;line-height: 60rpx;margin-bottom: 50rpx;">{{hidePhone}}</view>
<u-message-input value="" @change="getCode"></u-message-input>
<view class="text-red" style="padding: 20rpx;margin-top: 20rpx;" v-if="showBtn" @tap="sendCode"></view>
<view class="text-red" style="padding: 20rpx;margin-top: 20rpx;" v-else>{{time}}s</view>
<!-- <u-keyboard ref="uKeyboard" mode="number" v-model="show"></u-keyboard> -->
<view class="btn-box" style="padding: 30rpx;">
<button class="bg-red text-white" @tap="next"></button>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
show: false,
time: 60,
showBtn: true,
phone:"",
hidePhone:"",
sms:""
};
},
onLoad() {
this.phone=uni.getStorageSync("userInfo").phone
this.hidePhone = this.phone.substr(0,3)+"****"+this.phone.substr(7);
console.log(this.phone,this.hidePhone)
},
methods: {
showKeyboard() {
this.show = true
},
//
sendCode() {
this.$u.post('/api/v1/messages/verify/sms/send', {
userID: uni.getStorageSync("userInfo").id
}).then(res => {
console.log(res);
if (res.data.code == "FAIL") {
this.$u.toast(res.data.msg);
return
}
uni.showToast({
title:"发送成功"
})
//
this.countDown()
});
},
//
countDown(){
let time = this.time
this.showBtn = false
this.time--
let that = this
console.log(this.time)
let timer = setInterval(function() {
that.time--
if (that.time == 0) {
clearInterval(timer)
that.showBtn = true
that.time = time
return
}
}, 1000)
},
getCode(value){
this.sms = value
},
next() {
if(!this.sms){
this.$u.toast("请输入验证码");
return
}
uni.showModal({
title: '提示',
content: '确认注销账号吗?',
success: (res) => {
if (res.confirm) {
console.log('用户点击确定');
this.$u.post('/api/v1/users/profile/userDestroy', {
user_id: uni.getStorageSync("userInfo").id
}).then(res => {
console.log(res);
if (res.data.code == "FAIL") {
this.$u.toast(res.data.msg);
return
}
uni.clearStorageSync()
uni.showToast({
title: "账号已注销"
})
setTimeout(function() {
uni.reLaunch({
url: "../login/login"
})
}, 2000)
});
} else if (res.cancel) {
console.log('用户点击取消');
}
//
uni.redirectTo({
url: "/pages/mine/mine"
})
},
});
// this.$u.post('/api/v1/messages/verify/sms', {
// userID: uni.getStorageSync("userInfo").id,
// sms:this.sms
// }).then(res => {
// console.log(res);
// if (res.data.code == "FAIL") {
// this.$u.toast(res.data.msg);
// return
// }
// // //
// // uni.redirectTo({
// // url: "/packageA/setPassword/setPassword"
// // })
// });
}
}
}
</script>
<style lang="scss">
page {
background-color: #FFFFFF;
}
.btn-box {
position: fixed;
width: 100%;
bottom: 0;
}
</style>

@ -0,0 +1,138 @@
<template>
<view class="box">
<view class="box_text">
<view class="text">请注意一旦注销账户</view>
<view class="title">您的账户无法登陆与使用</view>
<view class="title">身份账户信息会员权益将被清空且无法恢复</view>
<view class="title">您账户内的资产余额优惠劵权益卡等将会被清空且无法恢复</view>
<view class="title">您已经完成等交易将无法出理售后</view>
<view class="title">您将无法便捷的使用查询账号历史交易记录</view>
</view>
<view class="ccc">
<navigator url="/packageA/settings/SendSMS" class="item ">
<view class="">确认注销</view>
</navigator>
<navigator url="/packageA/settings/account" class="item1">
<view class="">不注销了</view>
</navigator>
</view>
</view>
</template>
<script>
export default {
data() {
return {
};
},
methods: {
// deleteUser() {
// uni.showModal({
// title: '',
// content: '',
// success: (res) => {
// if (res.confirm) {
// console.log('');
// this.$u.post('/api/v1/users/profile/userDestroy', {
// user_id: uni.getStorageSync("userInfo").id
// }).then(res => {
// console.log(res);
// if (res.data.code == "FAIL") {
// this.$u.toast(res.data.msg);
// return
// }
// uni.clearStorageSync()
// uni.showToast({
// title: ""
// })
// setTimeout(function() {
// uni.reLaunch({
// url: "../login/login"
// })
// }, 2000)
// });
// } else if (res.cancel) {
// console.log('');
// }
// }
// });
// },
// signOut() {
// uni.showModal({
// title: '',
// content: '退,退',
// confirmText: "退",
// cancelText: "",
// success: function(res) {
// if (res.confirm) {
// uni.clearStorageSync()
// uni.navigateTo({
// url: "/pages/login/login"
// })
// console.log('');
// } else if (res.cancel) {
// console.log('');
// }
// }
// });
// }
}
}
</script>
<style lang="scss">
.box {
width: 100%;
height: 100vh;
background: #fff;
margin-top: 5rpx;
// box-shadow: inset 10rpx 0rpx 0rpx 0rpx red;
}
.text {
line-height: 100rpx;
padding: 0 30rpx;
font-size: 38rpx;
font-weight: 600;
color: #333333;
}
.title {
padding: 20rpx 40rpx;
font-size: 28rpx;
color: #333333;
}
.ccc {
line-height: 100rpx;
margin-top: 450rpx;
display: flex;
font-size: 38rpx;
color: #333333;
padding: 30rpx;
background: #fff;
display: flex;
align-items: center;
justify-content: space-around;
width: 100%;
margin-bottom: 50rpx;
}
.item{
background-color: #efefef;
color: #000;
position: relative;
padding: 2rpx 91rpx;
/* background: #F9F9F9; */
border-radius: 8rpx;
}
.item1{
background-color: rgb(207, 34, 36);
color: #fff;
position: relative;
padding: 2rpx 91rpx;
/* background: #F9F9F9; */
border-radius: 8rpx;
}
</style>
Loading…
Cancel
Save