增加协议

This commit is contained in:
GaoHao
2025-01-07 11:01:32 +08:00
parent c47fe17bcf
commit f82c31084d
5 changed files with 52 additions and 65 deletions

View File

@@ -66,22 +66,22 @@
title: '正在发送验证码...' title: '正在发送验证码...'
}) })
let res = await setSendMsg(data.mobile,'forget') let res = await setSendMsg(data.mobile,'forget')
if ( res.code == 0 ) { uni.hideLoading();
uni.hideToast();
if( res ){
data.sending = true; data.sending = true;
uni.showToast({ uni.showToast({
title: '验证码发送成功请注意查收', title: '验证码发送成功请注意查收',
icon: 'none', icon: 'none',
duration: 1000
}) })
data.countDown(); data.countDown();
} else { } else {
uni.showModal({ uni.showModal({
showCancel: false, showCancel: false,
title: '短信发送失败', title: '短信发送失败',
content: res.msg ? res.msg : '请一分钟后再获取验证码' content: '请一分钟后再获取验证码'
}); });
} }
uni.hideLoading();
} }
} }
@@ -146,25 +146,15 @@
msg: data.code, msg: data.code,
}) })
uni.hideLoading(); uni.hideLoading();
if (res.code === 0) { uni.showToast({
uni.showToast({ title: '密码找回成功',
title: '密码找回成功', icon: 'none'
icon: 'none' });
setTimeout(function() {
uni.navigateTo({
url: '/pages/login/login'
}); });
setTimeout(function() { }, 1000)
uni.navigateTo({
url: '/pages/login/login'
});
}, 1000)
} else {
uni.showModal({
showCancel: false,
title: '密码找回失败',
content: res.msg,
});
}
} }
} }

View File

@@ -37,7 +37,7 @@
<!-- 协议地址 --> <!-- 协议地址 -->
<navigator url="/pages/me/privacy" open-type="navigate">隐私政策</navigator> <navigator url="/pages/me/privacy" open-type="navigate">隐私政策</navigator>
<navigator url="/me/setting/xieyi" open-type="navigate">用户服务协议</navigator> <navigator url="/pages/me/agreement" open-type="navigate">用户服务协议</navigator>
</view> </view>
<u-toast ref="uToast" /> <u-toast ref="uToast" />
@@ -128,6 +128,7 @@
password: password, password: password,
phone: mobile phone: mobile
}) })
console.log(res)
uni.setStorageSync('token', res.token) uni.setStorageSync('token', res.token)
uni.setStorageSync('userId', res.user.userId) uni.setStorageSync('userId', res.user.userId)
uni.setStorageSync('userName', res.user.userName) uni.setStorageSync('userName', res.user.userName)

View File

@@ -35,9 +35,9 @@
</u-checkbox-group> </u-checkbox-group>
<view>注册即同意</view> <view>注册即同意</view>
<!-- 协议地址 --> <!-- 协议地址 -->
<navigator url="/me/setting/mimi" open-type="navigate" style="color: #37A6FF;">隐私政策</navigator> <navigator url="/pages/me/privacy" open-type="navigate" style="color: #37A6FF;">隐私政策</navigator>
<navigator url="/me/setting/xieyi" open-type="navigate" style="color: #37A6FF;">用户协议</navigator> <navigator url="/pages/me/agreement" open-type="navigate" style="color: #37A6FF;">用户协议</navigator>
</view> </view>
</view> </view>
</view> </view>

View File

@@ -1,6 +1,6 @@
<template> <template>
<view style="line-height: 26px;padding: 32upx;" class="home1 "> <view style="line-height: 26px;padding: 32upx;" class="home1 ">
<view style="font-size: 28upx;" v-html="content"></view> <view style="font-size: 28upx;" v-html="data.content"></view>
<view class="btn-box u-flex u-row-center" v-if="!isLogin"> <view class="btn-box u-flex u-row-center" v-if="!isLogin">
<view class="btn cancel" @click="cancel">拒绝</view> <view class="btn cancel" @click="cancel">拒绝</view>
<view class="btn" @click="back">同意</view> <view class="btn" @click="back">同意</view>
@@ -8,43 +8,39 @@
</view> </view>
</template> </template>
<script> <script setup>
export default { import { reactive } from 'vue';
data() { import { onLoad } from '@dcloudio/uni-app'
return { import config from '@/commons/config.js';
content:'', import {selectUserById} from '@/api/user/user.js';
isLogin:false import {commonType} from '@/api/init.js';
}
},
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
}); let data = reactive({
} content: '',
} isLogin:false
} })
onLoad(() => {
getGuize()
data.isLogin=uni.getStorageSync('token')?true:false
})
async function getGuize() {
let res = await commonType(154)
data.content = res.value
}
function cancel(){
// #ifdef H5
uni.navigateBack()
// #endif
// #ifdef APP
plus.runtime.quit();
// #endif
}
function back(){
uni.navigateBack()
}
</script> </script>
<style scoped> <style scoped>

View File

@@ -1,6 +1,6 @@
<template> <template>
<view style="font-size: 14px;line-height: 26px;padding: 32upx;" class="home1 "> <view style="font-size: 14px;line-height: 26px;padding: 32upx;" class="home1 ">
<view style="font-size: 28upx;" v-html="content"></view> <view style="font-size: 28upx;" v-html="data.content"></view>
<view class="btn-box u-flex u-row-center" v-if="!isLogin"> <view class="btn-box u-flex u-row-center" v-if="!isLogin">
<view class="btn cancel" @click="cancel">拒绝</view> <view class="btn cancel" @click="cancel">拒绝</view>
<view class="btn" @click="back">同意</view> <view class="btn" @click="back">同意</view>
@@ -27,7 +27,7 @@
async function getGuize() { async function getGuize() {
let res = await commonType(155) let res = await commonType(155)
this.content = res.value data.content = res.value
} }
function cancel(){ function cancel(){