You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

83 lines
1.7 KiB

<template>
<view>
<view class="address_foot">
<button @click="deleteuserinfo()">Delete account</button>
</view>
</view>
</template>
<script>
import {defaultRequest} from '../../api/index.js'
export default {
data(){
return {
delete:{
_action:'unregistuser',
username:'',
password:''
}
}
},
methods:{
getuserinfo(){
let data={_action:'getinfo'}
defaultRequest(data).then(res =>{
console.log(res)
})
},
deleteuserinfo(){
uni.showModal({
title: 'Confirm Delet?',
content: 'All the data of the account will disappear, including the balance of money, historical orders, etc. will disappear',
cancelText: "cancel", // 取消按钮的文字
confirmText: "confirm", // 确认按钮的文字
showCancel: true, // 是否显示取消按钮,默认为 true
confirmColor: '#f55850',
cancelColor: '#39B54A',
success: (res) => {
if(res.confirm) {
console.log('comfirm') //点击确定之后执行的代码
defaultRequest(this.delete).then(res =>{
if(res.error == 0){
uni.showToast({
icon:'none',
title:'ok to delete!'
})
}
})
} else {
console.log('cancel') //点击取消之后执行的代码
}
}
})
}
},
onShow() {
let user = uni.getStorageInfoSync('user_info')
console.log(user)
this.getuserinfo()
}
}
</script>
<style lang="scss" scoped>
.address_foot{
padding: 42rpx 24rpx;
border-top: #E2E2E2 solid 1px;
position: fixed;
bottom: 0;
width: 100%;
box-sizing: border-box;
button{
color: white;
background-color: #000000 !important;
font-size: 26.67rpx;
font-weight: bold;
margin: 0;
}
}
</style>