实名认证动态0.5
This commit is contained in:
parent
46769ff923
commit
3902e20553
16
api/realName/realName.js
Normal file
16
api/realName/realName.js
Normal file
|
|
@ -0,0 +1,16 @@
|
||||||
|
import request from "../../utils/request";
|
||||||
|
|
||||||
|
export function putTwoElementRealName(data) {
|
||||||
|
return request({
|
||||||
|
url: "/app/realName/twoElementRealName",
|
||||||
|
method: "PUT",
|
||||||
|
data,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getRefreshRealName() {
|
||||||
|
return request({
|
||||||
|
url: "/app/realName/refreshRealName",
|
||||||
|
method: "GET",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
@ -1,7 +1,10 @@
|
||||||
<template>
|
<template>
|
||||||
<view>
|
<view>
|
||||||
<!-- 填充区,避免内容被导航栏遮挡 -->
|
<!-- 填充区,避免内容被导航栏遮挡 -->
|
||||||
<view :style="{ height: navBarHeight + 'px' }" class="navbar-placeholder"></view>
|
<view
|
||||||
|
:style="{ height: navBarHeight + 'px' }"
|
||||||
|
class="navbar-placeholder"
|
||||||
|
></view>
|
||||||
|
|
||||||
<!-- 自定义导航栏 -->
|
<!-- 自定义导航栏 -->
|
||||||
<view
|
<view
|
||||||
|
|
@ -14,19 +17,28 @@
|
||||||
class="custom-navbar"
|
class="custom-navbar"
|
||||||
>
|
>
|
||||||
<view
|
<view
|
||||||
:style="{ height: capsuleHeight + 'px', lineHeight: capsuleHeight + 'px' }"
|
:style="{
|
||||||
|
height: capsuleHeight + 'px',
|
||||||
|
lineHeight: capsuleHeight + 'px',
|
||||||
|
}"
|
||||||
class="navbar-left"
|
class="navbar-left"
|
||||||
@click="handleBack"
|
@click="handleBack"
|
||||||
>
|
>
|
||||||
<image :src="backIcon" class="back-icon" mode="aspectFit"></image>
|
<image :src="backIcon" class="back-icon" mode="aspectFit"></image>
|
||||||
</view>
|
</view>
|
||||||
<view
|
<view
|
||||||
:style="{ height: capsuleHeight + 'px', lineHeight: capsuleHeight + 'px' }"
|
:style="{
|
||||||
|
height: capsuleHeight + 'px',
|
||||||
|
lineHeight: capsuleHeight + 'px',
|
||||||
|
}"
|
||||||
class="navbar-title"
|
class="navbar-title"
|
||||||
>{{ title }}
|
>{{ title }}
|
||||||
</view>
|
</view>
|
||||||
<view
|
<view
|
||||||
:style="{ height: capsuleHeight + 'px', lineHeight: capsuleHeight + 'px' }"
|
:style="{
|
||||||
|
height: capsuleHeight + 'px',
|
||||||
|
lineHeight: capsuleHeight + 'px',
|
||||||
|
}"
|
||||||
class="navbar-right"
|
class="navbar-right"
|
||||||
>
|
>
|
||||||
<slot name="right"></slot>
|
<slot name="right"></slot>
|
||||||
|
|
@ -36,173 +48,179 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import CommonEnum from '../../enum/common'
|
import CommonEnum from "../../enum/common";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'CustomNavbar',
|
name: "CustomNavbar",
|
||||||
props: {
|
props: {
|
||||||
title: {
|
title: {
|
||||||
type: String,
|
type: String,
|
||||||
default: '',
|
default: "",
|
||||||
},
|
|
||||||
backIcon: {
|
|
||||||
type: String,
|
|
||||||
default: CommonEnum.BACK_BUTTON,
|
|
||||||
},
|
|
||||||
showBack: {
|
|
||||||
type: Boolean,
|
|
||||||
default: true,
|
|
||||||
},
|
|
||||||
// 新增:滚动相关配置
|
|
||||||
backgroundColor: {
|
|
||||||
type: String,
|
|
||||||
default: CommonEnum.BASE_COLOR, // 滚动时的背景色,使用基调颜色
|
|
||||||
},
|
|
||||||
scrollThreshold: {
|
|
||||||
type: Number,
|
|
||||||
default: 20, // 滚动阈值,超过此值开始变色
|
|
||||||
},
|
|
||||||
enableScrollEffect: {
|
|
||||||
type: Boolean,
|
|
||||||
default: true, // 是否启用滚动效果
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
data() {
|
backIcon: {
|
||||||
return {
|
type: String,
|
||||||
statusBarHeight: 0,
|
default: CommonEnum.BACK_BUTTON,
|
||||||
navBarHeight: 0,
|
},
|
||||||
menuButtonInfo: null,
|
showBack: {
|
||||||
capsuleHeight: 0,
|
type: Boolean,
|
||||||
// 新增:滚动状态
|
default: true,
|
||||||
isScrolled: false,
|
},
|
||||||
scrollTop: 0,
|
// 新增:滚动相关配置
|
||||||
lastScrollTop: 0,
|
backgroundColor: {
|
||||||
|
type: String,
|
||||||
|
default: CommonEnum.BASE_COLOR, // 滚动时的背景色,使用基调颜色
|
||||||
|
},
|
||||||
|
scrollThreshold: {
|
||||||
|
type: Number,
|
||||||
|
default: 20, // 滚动阈值,超过此值开始变色
|
||||||
|
},
|
||||||
|
enableScrollEffect: {
|
||||||
|
type: Boolean,
|
||||||
|
default: true, // 是否启用滚动效果
|
||||||
|
},
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
statusBarHeight: 0,
|
||||||
|
navBarHeight: 0,
|
||||||
|
menuButtonInfo: null,
|
||||||
|
capsuleHeight: 0,
|
||||||
|
// 新增:滚动状态
|
||||||
|
isScrolled: false,
|
||||||
|
scrollTop: 0,
|
||||||
|
lastScrollTop: 0,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.getSystemInfo();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
getSystemInfo() {
|
||||||
|
// 获取系统信息
|
||||||
|
const systemInfo = uni.getSystemInfoSync();
|
||||||
|
// 获取状态栏高度
|
||||||
|
this.statusBarHeight = systemInfo.statusBarHeight;
|
||||||
|
|
||||||
|
// 获取胶囊按钮信息
|
||||||
|
this.menuButtonInfo = uni.getMenuButtonBoundingClientRect();
|
||||||
|
|
||||||
|
// 计算胶囊高度
|
||||||
|
this.capsuleHeight = this.menuButtonInfo.height;
|
||||||
|
|
||||||
|
// 计算导航栏高度(胶囊底部到状态栏顶部的距离)
|
||||||
|
this.navBarHeight = this.menuButtonInfo.bottom + 8;
|
||||||
|
},
|
||||||
|
handleBack() {
|
||||||
|
if (this.showBack) {
|
||||||
|
// 先触发自定义事件,让父组件有机会处理
|
||||||
|
this.$emit("back");
|
||||||
|
// 自动执行返回逻辑
|
||||||
|
uni.navigateBack({
|
||||||
|
delta: 1,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
|
||||||
this.getSystemInfo()
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
getSystemInfo() {
|
|
||||||
// 获取系统信息
|
|
||||||
const systemInfo = uni.getSystemInfoSync()
|
|
||||||
// 获取状态栏高度
|
|
||||||
this.statusBarHeight = systemInfo.statusBarHeight
|
|
||||||
|
|
||||||
// 获取胶囊按钮信息
|
// 新增:处理页面滚动(供父组件调用)
|
||||||
this.menuButtonInfo = uni.getMenuButtonBoundingClientRect()
|
handlePageScroll(e) {
|
||||||
|
if (!this.enableScrollEffect) return;
|
||||||
|
|
||||||
// 计算胶囊高度
|
this.scrollTop = e.scrollTop;
|
||||||
this.capsuleHeight = this.menuButtonInfo.height
|
|
||||||
|
|
||||||
// 计算导航栏高度(胶囊底部到状态栏顶部的距离)
|
// 判断是否超过滚动阈值
|
||||||
this.navBarHeight = this.menuButtonInfo.bottom + 8
|
if (this.scrollTop > this.scrollThreshold) {
|
||||||
},
|
if (!this.isScrolled) {
|
||||||
handleBack() {
|
this.isScrolled = true;
|
||||||
if (this.showBack) {
|
this.$emit("scroll-change", {
|
||||||
// 先触发自定义事件,让父组件有机会处理
|
isScrolled: true,
|
||||||
this.$emit('back')
|
scrollTop: this.scrollTop,
|
||||||
// 自动执行返回逻辑
|
});
|
||||||
uni.navigateBack({
|
|
||||||
delta: 1,
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
},
|
} else {
|
||||||
|
if (this.isScrolled) {
|
||||||
// 新增:处理页面滚动(供父组件调用)
|
this.isScrolled = false;
|
||||||
handlePageScroll(e) {
|
this.$emit("scroll-change", {
|
||||||
if (!this.enableScrollEffect) return
|
isScrolled: false,
|
||||||
|
scrollTop: this.scrollTop,
|
||||||
this.scrollTop = e.scrollTop
|
});
|
||||||
|
|
||||||
// 判断是否超过滚动阈值
|
|
||||||
if (this.scrollTop > this.scrollThreshold) {
|
|
||||||
if (!this.isScrolled) {
|
|
||||||
this.isScrolled = true
|
|
||||||
this.$emit('scroll-change', { isScrolled: true, scrollTop: this.scrollTop })
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (this.isScrolled) {
|
|
||||||
this.isScrolled = false
|
|
||||||
this.$emit('scroll-change', { isScrolled: false, scrollTop: this.scrollTop })
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// 触发滚动事件,让父组件可以获取滚动信息
|
// 触发滚动事件,让父组件可以获取滚动信息
|
||||||
this.$emit('scroll', {
|
this.$emit("scroll", {
|
||||||
scrollTop: this.scrollTop,
|
scrollTop: this.scrollTop,
|
||||||
isScrolled: this.isScrolled,
|
isScrolled: this.isScrolled,
|
||||||
})
|
});
|
||||||
},
|
|
||||||
|
|
||||||
// 新增:手动设置滚动状态(供父组件调用)
|
|
||||||
setScrollState(scrollTop) {
|
|
||||||
if (!this.enableScrollEffect) return
|
|
||||||
|
|
||||||
this.scrollTop = scrollTop
|
|
||||||
this.isScrolled = scrollTop > this.scrollThreshold
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
}
|
|
||||||
|
// 新增:手动设置滚动状态(供父组件调用)
|
||||||
|
setScrollState(scrollTop) {
|
||||||
|
if (!this.enableScrollEffect) return;
|
||||||
|
|
||||||
|
this.scrollTop = scrollTop;
|
||||||
|
this.isScrolled = scrollTop > this.scrollThreshold;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
/* 填充区样式 */
|
/* 填充区样式 */
|
||||||
.navbar-placeholder {
|
.navbar-placeholder {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
background-color: transparent;
|
background-color: transparent;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 自定义导航栏样式 */
|
/* 自定义导航栏样式 */
|
||||||
.custom-navbar {
|
.custom-navbar {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
top: 0;
|
top: 0;
|
||||||
left: 0;
|
left: 0;
|
||||||
right: 0;
|
right: 0;
|
||||||
z-index: 999;
|
z-index: 999;
|
||||||
padding-top: 0;
|
padding-top: 0;
|
||||||
background-color: transparent;
|
background-color: transparent;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
padding-left: 30rpx;
|
padding-left: 30rpx;
|
||||||
padding-right: 30rpx;
|
padding-right: 30rpx;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
transition: background-color 0.3s ease; /* 添加过渡动画 */
|
transition: background-color 0.3s ease; /* 添加过渡动画 */
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 滚动状态样式 */
|
/* 滚动状态样式 */
|
||||||
.navbar-scrolled {
|
.navbar-scrolled {
|
||||||
box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.1); /* 滚动时添加阴影 */
|
box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.1); /* 滚动时添加阴影 */
|
||||||
}
|
}
|
||||||
|
|
||||||
.navbar-left {
|
.navbar-left {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
width: 60rpx;
|
width: 60rpx;
|
||||||
|
|
||||||
.back-icon {
|
.back-icon {
|
||||||
width: 56rpx;
|
width: 56rpx;
|
||||||
height: 56rpx;
|
height: 56rpx;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.navbar-title {
|
.navbar-title {
|
||||||
font-size: 36rpx;
|
font-size: 36rpx;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
color: #695347;
|
color: #695347;
|
||||||
flex: 1;
|
flex: 1;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.navbar-right {
|
.navbar-right {
|
||||||
width: 60rpx;
|
width: 60rpx;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
||||||
|
|
@ -23,12 +23,22 @@
|
||||||
<view class="inputYourIdentify">请输入您的有效身份信息</view>
|
<view class="inputYourIdentify">请输入您的有效身份信息</view>
|
||||||
|
|
||||||
<view class="inputBox">
|
<view class="inputBox">
|
||||||
<input class="input" placeholder="请输入您的姓名" type="text" />
|
<input
|
||||||
<input class="input" placeholder="请输入您的身份证号" type="text" />
|
v-model="twoElementRealName.userName"
|
||||||
<input class="input" placeholder="请输入您的手机号" type="text" />
|
class="input"
|
||||||
|
placeholder="请输入您的姓名"
|
||||||
|
type="text"
|
||||||
|
/>
|
||||||
|
<input
|
||||||
|
v-model="twoElementRealName.idCard"
|
||||||
|
class="input"
|
||||||
|
placeholder="请输入您的身份证号"
|
||||||
|
type="text"
|
||||||
|
/>
|
||||||
|
<!-- <input class="input" placeholder="请输入您的手机号" type="text" />-->
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<button class="submit">提交</button>
|
<button class="submit" @click="submit()">提交</button>
|
||||||
<view class="tip"
|
<view class="tip"
|
||||||
>点击提交代表您授权日行一善、项目捐款获取以上信 息,用于实名验证
|
>点击提交代表您授权日行一善、项目捐款获取以上信 息,用于实名验证
|
||||||
</view>
|
</view>
|
||||||
|
|
@ -38,6 +48,10 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import CommonEnum from "../../enum/common";
|
import CommonEnum from "../../enum/common";
|
||||||
|
import {
|
||||||
|
getRefreshRealName,
|
||||||
|
putTwoElementRealName,
|
||||||
|
} from "../../api/realName/realName";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {},
|
components: {},
|
||||||
|
|
@ -46,26 +60,29 @@ export default {
|
||||||
flower: "https://api.ccttiot.com/image-1757990177680.png",
|
flower: "https://api.ccttiot.com/image-1757990177680.png",
|
||||||
CommonEnum,
|
CommonEnum,
|
||||||
loading: false,
|
loading: false,
|
||||||
|
twoElementRealName: {
|
||||||
|
userName: "",
|
||||||
|
idCard: "",
|
||||||
|
},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
onLoad() {
|
onLoad() {},
|
||||||
// 页面加载时获取数据
|
|
||||||
this.loadPageData();
|
|
||||||
},
|
|
||||||
methods: {
|
methods: {
|
||||||
// 加载页面数据
|
async submit() {
|
||||||
async loadPageData() {
|
uni.showLoading({
|
||||||
this.loading = true;
|
title: "实名认证中",
|
||||||
|
mask: true,
|
||||||
|
});
|
||||||
try {
|
try {
|
||||||
// TODO: 调用页面数据API
|
const res = await putTwoElementRealName(this.twoElementRealName);
|
||||||
// const response = await getPageData()
|
if (res.code === 200) {
|
||||||
// 模拟加载
|
uni.hideLoading();
|
||||||
setTimeout(() => {
|
await getRefreshRealName();
|
||||||
this.loading = false;
|
}
|
||||||
}, 1000);
|
// 成功后的操作,比如跳转页面
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("获取页面数据失败:", error);
|
uni.hideLoading();
|
||||||
this.loading = false;
|
console.error("提交失败:", error);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
@ -131,29 +148,29 @@ export default {
|
||||||
|
|
||||||
.box {
|
.box {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
left: 27px;
|
left: 54rpx; /* 27px * 2 */
|
||||||
top: 259px;
|
top: 518rpx; /* 259px * 2 */
|
||||||
width: 321px;
|
width: 642rpx; /* 321px * 2 */
|
||||||
height: 356px;
|
height: 712rpx; /* 356px * 2 */
|
||||||
border-radius: 15px;
|
border-radius: 30rpx; /* 15px * 2 */
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
|
|
||||||
background: #fffbf5;
|
background: #fffbf5;
|
||||||
|
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
border: 0.5px solid #c7a26d;
|
border: 1rpx solid #c7a26d; /* 0.5px * 2 */
|
||||||
}
|
}
|
||||||
|
|
||||||
.inputYourIdentify {
|
.inputYourIdentify {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
left: 50px;
|
left: 100rpx; /* 50px * 2 */
|
||||||
top: 282px;
|
top: 564rpx; /* 282px * 2 */
|
||||||
|
|
||||||
height: 22px;
|
height: 44rpx; /* 22px * 2 */
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
|
|
||||||
font-family: AlibabaPuHuiTi;
|
font-family: AlibabaPuHuiTi;
|
||||||
font-size: 16px;
|
font-size: 32rpx; /* 16px * 2 */
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
line-height: normal;
|
line-height: normal;
|
||||||
letter-spacing: 0em;
|
letter-spacing: 0em;
|
||||||
|
|
@ -179,17 +196,17 @@ export default {
|
||||||
text-align: left;
|
text-align: left;
|
||||||
font-style: normal;
|
font-style: normal;
|
||||||
text-transform: none;
|
text-transform: none;
|
||||||
border-bottom: #d8d8d8 solid 1px;
|
border-bottom: #d8d8d8 solid 2rpx; /* 1px * 2 */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.submit {
|
.submit {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
left: 50px;
|
left: 100rpx; /* 50px * 2 */
|
||||||
top: 488px;
|
top: 976rpx; /* 488px * 2 */
|
||||||
width: 275px;
|
width: 550rpx; /* 275px * 2 */
|
||||||
height: 49px;
|
height: 98rpx; /* 49px * 2 */
|
||||||
border-radius: 10px;
|
border-radius: 20rpx; /* 10px * 2 */
|
||||||
opacity: 0.5;
|
opacity: 0.5;
|
||||||
|
|
||||||
background: #c7a26d;
|
background: #c7a26d;
|
||||||
|
|
@ -197,14 +214,14 @@ export default {
|
||||||
|
|
||||||
.tip {
|
.tip {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
left: 50px;
|
left: 100rpx; /* 50px * 2 */
|
||||||
top: 549px;
|
top: 1098rpx; /* 549px * 2 */
|
||||||
width: 272px;
|
width: 544rpx; /* 272px * 2 */
|
||||||
height: 32px;
|
height: 64rpx; /* 32px * 2 */
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
|
|
||||||
font-family: AlibabaPuHuiTi;
|
font-family: AlibabaPuHuiTi;
|
||||||
font-size: 12px;
|
font-size: 24rpx; /* 12px * 2 */
|
||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
line-height: normal;
|
line-height: normal;
|
||||||
letter-spacing: 0em;
|
letter-spacing: 0em;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user