优化ios版本,新增注销账号功能

This commit is contained in:
唐明明
2023-10-25 17:03:00 +08:00
parent 663a5a9762
commit 76bb2b2a43
11 changed files with 474 additions and 18 deletions

View File

@@ -15,6 +15,10 @@
{
"playground" : "custom",
"type" : "uni-app:app-android"
},
{
"playground" : "custom",
"type" : "uni-app:app-ios"
}
]
}

View File

@@ -10,8 +10,8 @@ import router from '../router'
// 基础配置
const config = {
apiUrl : 'https://douhuo.douhuofalv.com/api/',
// apiUrl : 'https://api.douhuotest.douhuofalv.com/api/', //测试环境
// apiUrl : 'https://douhuo.douhuofalv.com/api/',
apiUrl : 'https://api.douhuotest.douhuofalv.com/api/', //测试环境
timeout : 60000
}

View File

@@ -187,6 +187,23 @@ const debtUrl = () => {
})
}
// 账户注销
const offSmsCode = data => {
return request({
url : 'app/user/log_off_code',
data
})
}
// 账户注销确认
const offUser = data => {
return request({
url: 'app/user/log_off',
method: 'POST',
data
})
}
export {
relations,
code,
@@ -209,5 +226,7 @@ export {
getSignLogs,
getFlows,
createCity,
debtUrl
debtUrl,
offSmsCode,
offUser
}

View File

@@ -2,8 +2,8 @@
"name" : "抖火法律",
"appid" : "__UNI__C305C03",
"description" : "纵有疾风起,人生不言弃",
"versionName" : "1.5.0",
"versionCode" : 105,
"versionName" : "1.6.2",
"versionCode" : 1062,
"transformPx" : false,
/* 5+App */
"app-plus" : {
@@ -37,10 +37,8 @@
"<uses-permission android:name=\"android.permission.CALL_PHONE\"/>",
"<uses-permission android:name=\"android.permission.CAMERA\"/>",
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
"<uses-permission android:name=\"android.permission.MODIFY_AUDIO_SETTINGS\"/>",
"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>"
],
"schemes" : "doufire",
@@ -48,15 +46,31 @@
},
/* ios */
"ios" : {
"dSYMs" : false
"dSYMs" : false,
"privacyDescription" : {
"NSPhotoLibraryUsageDescription" : "从您的相册中选择图片作为用户头像与身份认证照片",
"NSPhotoLibraryAddUsageDescription" : "保存您的分享海报与二维码图片",
"NSCameraUsageDescription" : "身份认证图片,用户身份活体认证与用户头头像",
"NSContactsUsageDescription" : "快捷拨打业务联系电话",
"NSLocalNetworkUsageDescription" : "获取网络数据",
"NSUserTrackingUsageDescription" : "开启权限不会获取您在其他站点的隐私信息,该权限仅用于标识设备并保障服务安全"
}
},
/* SDK */
"sdkConfigs" : {
"ad" : {},
"ad" : {
"gdt" : {},
"csj" : {},
"ks" : {},
"ks-content" : {},
"sigmob" : {},
"hw" : {},
"bd" : {}
},
"share" : {
"weixin" : {
"appid" : "wx1bcdeda0dec3f1bd",
"UniversalLinks" : ""
"UniversalLinks" : "https://app.com.douhuofalv/ulink/"
}
},
"payment" : {}

View File

@@ -804,6 +804,29 @@
"enablePullDownRefresh": false,
"navigationBarBackgroundColor": "#ffffff"
}
},{
"path" : "pages/off/off",
"name" : "UserOff",
"style" :{
"navigationBarTitleText": "申请注销账号",
"enablePullDownRefresh": false,
"navigationBarBackgroundColor" : "#FFFFFF"
}
},{
"path" : "pages/off/agreement",
"name" : "UserOffAgreement",
"style":{
"navigationBarTitleText": "",
"enablePullDownRefresh": false
}
},{
"path" : "pages/off/verify",
"name" : "UserOffVerify",
"style": {
"navigationBarTitleText": "",
"enablePullDownRefresh": false,
"navigationBarBackgroundColor" : "#FFFFFF"
}
}],
"globalStyle": {
"navigationBarTextStyle": "black",

View File

@@ -16,7 +16,7 @@
<input type="safe-password" password v-model="password" placeholder="请输入密码">
</view>
<view class="btn">
<button :disabled="phone.length < 11 || password == '' || agreement.length == 0" @click="onAuth()">登录</button>
<button :disabled="phone.length < 11 || password == ''" @click="onAuth()">登录</button>
</view>
<view class="agreement">
<u-checkbox-group
@@ -49,6 +49,13 @@
},
methods: {
onAuth(){
if(this.agreement.length <= 0){
uni.showToast({
title: '请阅读并同意服务协议与隐私政策',
icon : 'none'
})
return
}
uni.showLoading({
title: '登录中...'
})

View File

@@ -140,7 +140,7 @@
</view>
</u-count-down>
</view>
<image class="ad-img" :src="layAdImg" mode="widthFix"></image>
<image class="ad-img" :src="layAdImg" mode="heightFix"></image>
<view class="ad-btn">
<u-icon
class="ad-btn-icon"
@@ -318,8 +318,8 @@
}
// ad弹窗广告
.ad-lay{
width: 70vw;
position: relative;
text-align: center;
.ad-down{
position: absolute;
top: 20rpx;
@@ -337,7 +337,7 @@
}
}
.ad-img{
width: 70vw;
height: 75vh;
border-radius: 20rpx;
}
.ad-btn{
@@ -498,8 +498,6 @@
white-space: nowrap;
width: calc(100% - 60rpx);
&-item{
position: relative;
z-index: 2;
width: 25%;
line-height: 60rpx;
text-align: center;
@@ -507,18 +505,22 @@
color: #454545;
transition: all .4s;
display: inline-block;
background-color: transparent;
&.active{
color: white;
position: relative;
z-index: 2;
}
}
&-acitve-block{
display: inline-block;
width: 25%;
height: 60rpx;
background: linear-gradient( to right, #d51959, #ec7247);
background-image: linear-gradient( to right, #d51959, #ec7247);
border-radius: 35rpx;
position: absolute;
left: 0;
top: 0;
transition: all .4s;
}
}

22
pages/off/agreement.vue Normal file
View File

@@ -0,0 +1,22 @@
<template>
<view>
</view>
</template>
<script>
export default {
data() {
return {
}
},
methods: {
}
}
</script>
<style lang="scss">
</style>

65
pages/off/off.vue Normal file
View File

@@ -0,0 +1,65 @@
<template>
<view class="content">
<view class="title">为保证你的账号安全在你提交的注销申请生效前需同时满足以下条件</view>
<view class="title">1. 账号处干安全状态</view>
<view class="text">账号为你本人拥有处于正常使用状态无被盗违规封禁风险</view>
<view class="title">2. 账号财产已结清交易已完成</view>
<view class="text">账号下所有关联业务的资产业务奖金火力值和权益包括会员身份均已结清清空或自愿放弃所有交易已完成或已自愿放弃</view>
<view class="title">3. 账号无任何纠纷包括但不限于投诉或举报服务均已完成或已自愿放弃</view>
<view class="agreement">
<u-checkbox-group
v-model="agreement"
placement="row"
>
<u-checkbox shape="circle" name="agreement" activeColor="#446EFE"></u-checkbox>
我已阅读并同意
<my-link class="agreement-nav":to="{name: 'RichText', params: { id: 5 }}">抖火注销须知</my-link>
</u-checkbox-group>
</view>
<view class="tool">
<button class="btn" :disabled="agreement.length <= 0" @click="onNext()">下一步</button>
</view>
</view>
</template>
<script>
export default {
data() {
return {
agreement: []
}
},
methods: {
onNext(){
this.$Router.push({
name: 'UserOffVerify'
})
}
}
}
</script>
<style lang="scss" scoped>
.content{
padding: 20rpx 50rpx 50rpx;
background: white;
.title{ font-weight: bold; font-size: 36rpx;line-height: 50rpx; margin-top: 30rpx; text-align: justify; }
.text{ font-size: 32rpx; color: #555; margin-bottom: 30rpx; line-height: 50rpx; text-align: justify; }
.agreement{ font-size: 30rpx; margin-top: 100rpx; color: gray; }
.agreement-nav{ color: $main-color; }
.tool{
padding-top: 50rpx;
button{
background: $main-color;
color: white;
eight: 100rpx;
line-height: 100rpx;
border-radius: 20rpx;
color: white;
font-size: 34rpx;
font-weight: bold;
&[disabled]{ opacity: .5; }
}
}
}
</style>

292
pages/off/verify.vue Normal file
View File

@@ -0,0 +1,292 @@
<template>
<view class="registered-content">
<view class="title">注销账号</view>
<view class="submit-title">请填写您的账号信息</view>
<view class="from">
<view class="from-inpus from-input-phoen">
<label>+86</label>
<input type="number" v-model="username" maxlength="11" placeholder="输入手机号码">
</view>
<view class="from-inpus from-password">
<label>登录密码</label>
<input type="safe-password" password v-model="password" placeholder="请输入登录密码">
</view>
<view class="from-inpus from-input-code">
<label>验证码</label>
<input type="number" v-model="code" maxlength="4" placeholder="短信验证码">
<button :disabled="username.length < 11 || getSms" @click="getCode">{{sendCode}}</button>
</view>
</view>
<view class="button">
<button @click="onRegistered()">注销账号</button>
</view>
<!-- 显示图形验证码 -->
<u-popup :show="captchaShow" mode="center" :round="10" closeable @close="captchaShow = false, captcha = ''">
<view class="captcha-lay">
<view class="captcha-title">图形验证</view>
<view class="captcha-img">
<image :src="captchaImg" mode="widthFix" @click="getCode()"></image>
</view>
<view class="captcha-input">
<input type="text" placeholder="请输入验证码" v-model="captcha" maxlength="10">
</view>
<button class="captcha-btn" @click="getPhoneCode">验证</button>
</view>
</u-popup>
</view>
</template>
<script>
var outTime;
import { offSmsCode, offUser } from '@/apis/interfaces/user.js'
import { captcha } from '@/apis/interfaces/auth.js'
export default {
data() {
return {
password : '',
username : '',
code : '',
getSms : false,
sendCode : '获取验证码',
captcha : '',
captchaImg : '',
captchaKey : '',
captchaShow : false,
};
},
methods: {
// 提交修改信息
onRegistered(){
uni.showLoading({
title: '提交中...',
mask : true
})
offUser({
username: this.username,
password: this.password,
code : this.code,
}).then(res => {
// 重置验证码与计时器
this.getSms = false;
this.sendCode = '获取验证码';
clearInterval(outTime);
uni.hideLoading()
uni.showModal({
title : "提示",
content : "账号注销申请已提交",
showCancel : false,
confirmColor: "#446EFE",
success : modalRes => {
this.$store.commit('setToken', '');
this.$Router.replaceAll({
name: 'Auth'
})
}
})
}).catch(err => {
uni.showToast({
title: err.message,
icon : 'none'
})
})
},
// 弹出图形验证码
getCode(){
uni.showLoading({
title: '加载中...',
mask : true
})
captcha().then(res => {
let { img, key } = res
this.captchaImg = img
this.captchaKey = key
this.captchaShow = true
uni.hideLoading()
}).catch(err => {
uni.showToast({
title: err.message,
icon : 'none'
})
})
},
// 获取验证码
getPhoneCode() {
uni.showLoading({
title : '加载中...',
mask :true
})
let smsTime = 60;
offSmsCode({
mobileNo : this.username,
captcha : this.captcha,
captcha_key : this.captchaKey
}).then(res => {
uni.showToast({
title: res.message,
icon: "none",
});
this.captchaShow = false;
this.captcha = '';
this.getSms = true;
this.sendCode = smsTime + 's后重新获取';
outTime = setInterval(() => {
if (smsTime <= 1) {
this.getSms = false;
this.sendCode = '重新获取';
clearInterval(outTime);
return
}
this.sendCode = smsTime + 's后重新获取';
smsTime -= 1;
}, 1000);
}).catch((err) => {
uni.showToast({
title: err.message,
icon: "none",
});
});
}
}
}
</script>
<style lang="scss">
// 图形验证码
.captcha-lay{
padding: 30rpx;
width: 70vw;
box-sizing: border-box;
.captcha-title{
text-align: center;
font-size: 35rpx;
font-weight: bold;
line-height: 90rpx;
}
.captcha-img{
text-align: center;
padding-bottom: 30rpx;
image{
width: 300rpx;
}
}
.captcha-input{
input{
height: 100rpx;
border:solid 1rpx #ddd;
text-align: center;
line-height: 98rpx;
font-size: 34rpx;
padding: 0 30rpx;
box-sizing: border-box;
border-radius: $radius-lg;
background: transparent;
}
}
.captcha-btn{
margin-top: 30rpx;
background: $main-color;
color: white;
font-weight: normal;
font-size: 34rpx;
border-radius: $radius-lg;
height: 90rpx;
line-height: 90rpx;
&::after{
border: none;
}
}
}
// 注册
.registered-content{
padding: 50rpx;
.title{
padding-top: 3vh;
padding-bottom: 10rpx;
font-weight: bold;
font-size: 44rpx;
}
.submit-title{
font-size: 30rpx;
color: gray;
line-height: 40rpx;
}
// 注册单
.from{
margin-top: 80rpx;
}
.from-inpus{
@extend .border-solid;
display: flex;
align-items: center;
margin-bottom: 20rpx;
justify-content: space-between;
label{
width: 170rpx;
line-height: 100rpx;
font-size: 32rpx;
}
input{
width: calc(100% - 200rpx);
height: 100rpx;
line-height: 100rpx;
font-size: 32rpx;
}
}
.from-password{
input{
width: calc(100% - 200rpx);
height: 100rpx;
line-height: 100rpx;
font-size: 32rpx;
}
}
.from-input-phoen{
label{
line-height: 60rpx;
height: 60rpx;
border-right: solid 1rpx $border-color;
}
}
.from-input-code{
button{
font-size: 32rpx;
width: 230rpx;
padding: 0;
height: 80rpx;
line-height: 80rpx;
border-radius: 0;
margin: 0;
border: none;
background: transparent;
color: $main-color;
&::after{
display: none;
}
&[disabled]{
opacity: .5;
}
}
input{
width: calc(100% - 460rpx);
}
}
// 按钮
.button{
padding-top: 50rpx;
button{
background: $main-color;
border-radius: $radius-lg;
height: 100rpx;
line-height: 100rpx;
color: white;
font-size: 38rpx;
&::after{
display: none;
}
&[disabled]{
opacity: .5;
}
}
}
}
</style>

View File

@@ -38,6 +38,14 @@
</view>
</view>
</view>
<view class="set-nav-block">
<view class="set-nav" @click="onNav('UserOff')">
<label>账户注销</label>
<view class="value nowrap">
<uni-icons type="right" color="gray"></uni-icons>
</view>
</view>
</view>
<view class="set-nav-block">
<view class="set-nav" @click="onLogout">
<label>退出登录</label>
@@ -91,7 +99,7 @@
}
</script>
<style lang="scss">
<style lang="scss" scoped>
.content{
padding-top: 30rpx;
box-sizing: border-box;