This commit is contained in:
GaoHao 2025-01-07 10:42:53 +08:00
parent f7037c0643
commit 0041cc0e15
7 changed files with 192 additions and 45 deletions

View File

@ -30,3 +30,14 @@ export const registerCode = (params) => {
})
}
/**
* 修改密码
*/
export const forgetPwd = (data) => {
return http.request({
url: '/Login/forgetPwd',
method: 'POST',
params: data
})
}

View File

@ -71,6 +71,11 @@
"style": {
"navigationBarTitleText": "个人资料"
}
}, {
"path": "pages/me/privacy",
"style": {
"navigationBarTitleText": "隐私协议"
}
},
{
"path": "pages/index/search/index",

View File

@ -35,8 +35,7 @@
<script setup>
import { reactive } from 'vue';
import { onLoad} from '@dcloudio/uni-app'
import http from '@/http/http.js';
import {setSendMsg,registerCode} from '@/api/login/login.js';
import {setSendMsg,forgetPwd} from '@/api/login/login.js';
let data = reactive({
code: '',
mobile: '',
@ -116,7 +115,7 @@
/**
* 注册
*/
function reset() {
async function reset() {
if (!data.mobile) {
uni.showToast({
@ -141,33 +140,31 @@
uni.showLoading({
title: '正在修改密码中...'
})
http.request({
url: 'app/Login/forgetPwd?pwd=' + data.password + '&phone=' + data.mobile + '&msg=' + data.code,
method: 'post'
}).then(
res => {
uni.hideLoading();
if (res.code === 0) {
uni.showToast({
title: '密码找回成功',
icon: 'none'
});
setTimeout(function() {
uni.navigateTo({
url: '/pages/login/login'
});
}, 1000)
} else {
uni.showModal({
showCancel: false,
title: '密码找回失败',
content: res.msg,
});
}
let res = await forgetPwd({
pwd: data.password,
phone: data.mobile,
msg: data.code,
})
uni.hideLoading();
if (res.code === 0) {
uni.showToast({
title: '密码找回成功',
icon: 'none'
});
setTimeout(function() {
uni.navigateTo({
url: '/pages/login/login'
});
}, 1000)
} else {
uni.showModal({
showCancel: false,
title: '密码找回失败',
content: res.msg,
});
}
}
}

View File

@ -35,7 +35,7 @@
</u-checkbox-group>
<view>同意</view>
<!-- 协议地址 -->
<navigator url="/me/setting/mimi" open-type="navigate">隐私政策</navigator>
<navigator url="/pages/me/privacy" open-type="navigate">隐私政策</navigator>
<navigator url="/me/setting/xieyi" open-type="navigate">用户服务协议</navigator>
</view>
@ -193,10 +193,7 @@
font-weight: 400;
font-size: 24rpx;
color: #333333;
position: absolute;
left: 0;
right: 0;
bottom: 78rpx;
margin-top: 50rpx;
}

View File

@ -46,9 +46,8 @@
<script setup>
import { reactive } from 'vue';
import { onLoad} from '@dcloudio/uni-app'
import http from '@/http/http.js';
import {setSendMsg,registerCode} from '@/api/login/login.js';
import {commonType} from '@/api/login/login.js';
import {commonType} from '@/api/init.js';
let data = reactive({
@ -65,18 +64,15 @@
checked: false,
})
onLoad(( options ) => {
onLoad(async ( options ) => {
if (uni.getStorageSync('qdCodeion')) { data.qdCodeion = uni.getStorageSync('qdCodeion') }
if (options.qdCode) { data.qdCodeion = options.qdCode }
if (options.invitation ) { data.invitation = options.invitation }
http.request({
url:'app/common/type/3',
}).then(res => {
if (res.code == 0) {
data.registerCode = res.data.value
}
});
let res = await commonType(3)
if (res.code == 0) {
data.registerCode = res.data.value
}
})
/**
@ -179,7 +175,7 @@
invitation,
registerCode,
qdCodeion
} = this;
} = data;
if (!mobile) {
uni.showToast({
title: '请输入账号',

70
pages/me/privacy.vue Normal file
View File

@ -0,0 +1,70 @@
<template>
<view style="font-size: 14px;line-height: 26px;padding: 32upx;" class="home1 ">
<view style="font-size: 28upx;" v-html="content"></view>
<view class="btn-box u-flex u-row-center" v-if="!isLogin">
<view class="btn cancel" @click="cancel">拒绝</view>
<view class="btn" @click="back">同意</view>
</view>
</view>
</template>
<script setup>
import { reactive } from 'vue';
import { onLoad } from '@dcloudio/uni-app'
import config from '@/commons/config.js';
import {selectUserById} from '@/api/user/user.js';
import {commonType} from '@/api/init.js';
let data = reactive({
content: '',
isLogin:false
})
onLoad(() => {
getGuize()
data.isLogin=uni.getStorageSync('token')?true:false
})
async function getGuize() {
let res = await commonType(155)
this.content = res.data.value
}
function cancel(){
// #ifdef H5
uni.navigateBack()
// #endif
// #ifdef APP
plus.runtime.quit();
// #endif
}
function back(){
uni.navigateBack()
}
</script>
<style scoped>
.btn {
width: 100%;
height: 42px;
line-height: 42px;
border-radius: 30px;
background: #ff7581;
color: #ffffff;
text-align: center;
}
.btn-box{
gap: 20px;
padding: 30rpx 130rpx;
}
.cancel{
background-color: #eee;
color: #999;
}
page{
/* background: #1c1b20; */
}
</style>

71
pages/me/xieyi.vue Normal file
View File

@ -0,0 +1,71 @@
<template>
<view style="line-height: 26px;padding: 32upx;" class="home1 ">
<view style="font-size: 28upx;" v-html="content"></view>
<view class="btn-box u-flex u-row-center" v-if="!isLogin">
<view class="btn cancel" @click="cancel">拒绝</view>
<view class="btn" @click="back">同意</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
content:'',
isLogin:false
}
},
onLoad() {
this.getGuize();
this.isLogin=uni.getStorageSync('token')?true:false
},
methods: {
cancel(){
// #ifdef H5
uni.navigateBack()
// #endif
// #ifdef APP
plus.runtime.quit();
// #endif
},
back(){
uni.navigateBack()
},
getGuize(){
// this.$Request.getT('/agreement/find?id=1').then(res =>{
// if(res.status === 0){
// this.content = res.data.content;
// }
// });
this.$u.get('app/common/type/154').then(res => {
this.content = res.data.value
});
}
}
}
</script>
<style scoped>
.btn {
width: 100%;
height: 42px;
line-height: 42px;
border-radius: 30px;
background: #ff7581;
color: #ffffff;
text-align: center;
}
.btn-box{
gap: 20px;
padding: 30rpx 130rpx;
}
.cancel{
background-color: #eee;
color: #999;
}
page{
/* background: #1c1b20; */
}
</style>