Merge branch 'main' of http://gitea.bugtc.com/zhouyanli/property-resident-side
This commit is contained in:
@@ -54,7 +54,8 @@
|
||||
"setting" : {
|
||||
"urlCheck" : false
|
||||
},
|
||||
"usingComponents" : true
|
||||
"usingComponents" : true,
|
||||
"lazyCodeLoading": "requiredComponents"
|
||||
},
|
||||
"mp-alipay" : {
|
||||
"usingComponents" : true
|
||||
|
||||
@@ -1,32 +1,14 @@
|
||||
{
|
||||
"pages": [
|
||||
// {
|
||||
// "path": "pages/navigation/navigation",
|
||||
// "style": {
|
||||
// "navigationBarTitleText": "引导页",
|
||||
// "navigationBarTextStyle": "white",
|
||||
// "enablePullDownRefresh": false,
|
||||
// "navigationStyle": "custom"
|
||||
// }
|
||||
// },
|
||||
// {
|
||||
// "path": "pages/login/pwd-login",
|
||||
// "style": {
|
||||
// "navigationBarTitleText": "密码登录",
|
||||
// "navigationBarTextStyle": "white",
|
||||
// "enablePullDownRefresh": false,
|
||||
// "navigationStyle": "custom"
|
||||
// }
|
||||
// },
|
||||
// {
|
||||
// "path": "pages/login/login",
|
||||
// "style": {
|
||||
// "navigationBarTitleText": "验证码登录",
|
||||
// "navigationBarTextStyle": "white",
|
||||
// "enablePullDownRefresh": false,
|
||||
// "navigationStyle": "custom"
|
||||
// }
|
||||
// },
|
||||
{
|
||||
"path": "pages/navigation/navigation",
|
||||
"style": {
|
||||
"navigationBarTitleText": "引导页",
|
||||
"navigationBarTextStyle": "white",
|
||||
"enablePullDownRefresh": false,
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
"path": "pages/index/index",
|
||||
@@ -61,6 +43,20 @@
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pwd-login",
|
||||
"style": {
|
||||
"navigationBarTitleText": "账号密码登录",
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "login",
|
||||
"style": {
|
||||
"navigationBarTitleText": "验证码登录",
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "forget-pwd",
|
||||
"style": {
|
||||
@@ -82,7 +78,8 @@
|
||||
"pages": [{
|
||||
"path": "onlineRepair",
|
||||
"style": {
|
||||
"navigationBarTitleText": "在线报修"
|
||||
"navigationBarTitleText": "在线报修",
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -128,7 +125,8 @@
|
||||
"pages": [{
|
||||
"path": "visitor-list",
|
||||
"style": {
|
||||
"navigationBarTitleText": "访客邀请"
|
||||
"navigationBarTitleText": "访客邀请",
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -156,7 +154,8 @@
|
||||
"pages": [{
|
||||
"path": "activityList",
|
||||
"style": {
|
||||
"navigationBarTitleText": "活动列表"
|
||||
"navigationBarTitleText": "活动列表",
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -180,7 +179,8 @@
|
||||
"pages": [{
|
||||
"path": "noticeList",
|
||||
"style": {
|
||||
"navigationBarTitleText": "通知公告"
|
||||
"navigationBarTitleText": "通知公告",
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
|
||||
@@ -1,5 +1,10 @@
|
||||
<template>
|
||||
<view class="container">
|
||||
<view class="status_bar"></view>
|
||||
<!-- 顶部标题栏 -->
|
||||
<view class="top-bar">
|
||||
<uni-nav-bar left-icon="left" title="活动列表" backgroundColor ="none" :border="false" @clickLeft="narBack" />
|
||||
</view>
|
||||
<!-- 顶部图片 -->
|
||||
<view class="topImg">
|
||||
<image src="/static/首页/banner.png" style="width: 100%;height:100%;"></image>
|
||||
@@ -323,6 +328,15 @@
|
||||
}
|
||||
})
|
||||
|
||||
// 返回
|
||||
const narBack = () =>{
|
||||
// uni.navigateBack({
|
||||
// delta: 1
|
||||
// })
|
||||
uni.switchTab({
|
||||
url:"/pages/index/index"
|
||||
})
|
||||
}
|
||||
// 切换选项卡
|
||||
const switchTab = (tab) => {
|
||||
activeTab.value = tab
|
||||
@@ -504,6 +518,15 @@
|
||||
flex-direction: column;
|
||||
padding: 20rpx;
|
||||
}
|
||||
.status_bar {
|
||||
height: 32px;
|
||||
width: 100%;
|
||||
}
|
||||
/* 顶部标题 */
|
||||
.top-bar {
|
||||
text-align: center;
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
.topImg {
|
||||
width: 100%;
|
||||
height: 280rpx;
|
||||
|
||||
@@ -36,11 +36,12 @@
|
||||
<view class="bannarClass">
|
||||
<up-swiper :list="bannerList" indicator indicatorMode="dot" ></up-swiper>
|
||||
</view>
|
||||
<view class="noticeClass">
|
||||
<image src="/static/首页/公告.png" style="width: 81rpx;height: 81rpx;position: absolute;top: 10px;left: 16px;"></image>
|
||||
<view class="noticeClass" @click="getNoticeMore">
|
||||
<image src="/static/首页/公告.png" style="width: 38px;height: 38px;position: absolute;top: 21px;left: 17px;"></image>
|
||||
<uni-notice-bar show-icon :text="noticeText" type="line"
|
||||
:showIcon="true" show-get-more scrollable color="#000" background-color="#fff" moreColor="#000" @getmore="getNoticeMore"/>
|
||||
<!-- <up-notice-bar class="notice-bar" :text="noticeText" mode="link" speed="100" bgColor="#FFF" color="#000" url="pages/notice-list/noticeList"></up-notice-bar> -->
|
||||
:showIcon="false" show-get-more scrollable color="#000" background-color="#fff" moreColor="#000">
|
||||
</uni-notice-bar>
|
||||
|
||||
</view>
|
||||
<!-- 一键开门 -->
|
||||
<view class="u-demo-block__content bg-card-open">
|
||||
@@ -326,13 +327,17 @@ const moreClick = () =>{
|
||||
position: relative;
|
||||
top: 110px;
|
||||
left: 0;
|
||||
padding: 20rpx;
|
||||
padding: 40rpx;
|
||||
}
|
||||
.noticeClass{
|
||||
position: relative;
|
||||
top: 205rpx;
|
||||
top: 167rpx;
|
||||
left: 0;
|
||||
padding: 20rpx;
|
||||
padding: 40rpx 36rpx;
|
||||
}
|
||||
// 修改通知栏样式
|
||||
::v-deep .uni-noticebar__content-wrapper--scrollable{
|
||||
left: 20px;
|
||||
}
|
||||
.noticeClass.uni-noticebar{
|
||||
padding: 10px 15px 10px 45px;
|
||||
@@ -343,12 +348,12 @@ const moreClick = () =>{
|
||||
}
|
||||
.bg-card-open{
|
||||
position: relative;
|
||||
top: 180rpx;
|
||||
top: 102rpx;
|
||||
left: 0;
|
||||
padding: 20rpx;
|
||||
background-color: #fff;
|
||||
border-radius: 8rpx;
|
||||
margin: 9px;
|
||||
margin: 20px 18px;
|
||||
}
|
||||
.openClass{
|
||||
display: flex;
|
||||
@@ -371,12 +376,12 @@ const moreClick = () =>{
|
||||
.adCardClass{
|
||||
// width: 100%;
|
||||
height: 200rpx;
|
||||
margin: 17rpx;
|
||||
margin: 40rpx 30rpx;
|
||||
background-color: #3E8EFF;
|
||||
// margin-top: 30rpx;
|
||||
border-radius: 20rpx;
|
||||
border-radius: 28rpx;
|
||||
position: relative;
|
||||
top:99px;
|
||||
top:50px;
|
||||
left: 0;
|
||||
.titleLeft{
|
||||
text-align: left;
|
||||
@@ -394,10 +399,13 @@ const moreClick = () =>{
|
||||
}
|
||||
.activity-card{
|
||||
position: relative;
|
||||
top: 102px;
|
||||
top: 45px;
|
||||
left: 0;
|
||||
bottom: 20;
|
||||
}
|
||||
.uni-card{
|
||||
margin: 18px !important;
|
||||
}
|
||||
.eventListClass{
|
||||
margin: 20rpx;
|
||||
display: flex;
|
||||
|
||||
@@ -1,260 +0,0 @@
|
||||
<template>
|
||||
<view class="login-page">
|
||||
<view class="status_bar"></view>
|
||||
<!-- 标题 -->
|
||||
<view class="login-title">账号密码登录</view>
|
||||
|
||||
<!-- 手机号输入框 -->
|
||||
<view class="input-item">
|
||||
<view class="input-icon">
|
||||
<!-- <uni-icons type="phone" size="24" color="#999"></uni-icons> -->
|
||||
<image src="/static/登录/手机号.png" mode="" style="height: 100%;width: 100%;"></image>
|
||||
</view>
|
||||
<uni-easyinput class="input-content" type="text" v-model="phoneNumber"
|
||||
placeholder="请输入帐号" :inputBorder="false" :placeholderStyle="placeholderStyle">
|
||||
</uni-easyinput>
|
||||
</view>
|
||||
|
||||
<!-- 密码输入框 -->
|
||||
<view class="input-item">
|
||||
<view class="input-icon">
|
||||
<!-- <uni-icons type="locked" size="24" color="#999"></uni-icons> -->
|
||||
<image src="/static/登录/密码.png" mode="" style="height: 100%;width: 100%;"></image>
|
||||
</view>
|
||||
<uni-easyinput class="input-content" type="password" v-model="password"
|
||||
placeholder="请输入密码" :inputBorder="false" :placeholderStyle="placeholderStyle">
|
||||
</uni-easyinput>
|
||||
|
||||
</view>
|
||||
|
||||
<!-- 协议勾选 + 忘记密码 -->
|
||||
<view class="agreement-wrap">
|
||||
<view class="agreement-item" @click="toggleAgreement">
|
||||
<uni-icons
|
||||
type="checkbox-filled"
|
||||
size="24"
|
||||
color="#007aff"
|
||||
v-if="agreeAgreement"
|
||||
></uni-icons>
|
||||
<uni-icons
|
||||
type="checkbox"
|
||||
size="24"
|
||||
color="#999"
|
||||
v-else
|
||||
></uni-icons>
|
||||
<text class="agreement-text">我已阅读并同意《用户隐私政策》</text>
|
||||
</view>
|
||||
<navigator class="forget-pwd" url="/pages/loginSub/forget-pwd">忘记密码?</navigator>
|
||||
</view>
|
||||
|
||||
<!-- 登录按钮 -->
|
||||
<button
|
||||
class="login-btn"
|
||||
|
||||
@click="handleLogin"
|
||||
>
|
||||
登录
|
||||
</button>
|
||||
|
||||
<!-- 底部链接 -->
|
||||
<view class="bottom-link">
|
||||
<navigator class="link-item" url="/pages/login/login">验证码登录</navigator>
|
||||
<navigator class="link-item" url="/pages/loginSub/register-new-user">注册新用户</navigator>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, computed } from 'vue';
|
||||
import {onLoad} from "@dcloudio/uni-app"
|
||||
import {getLoginPassword} from '/pages/api/api.js'
|
||||
|
||||
// 响应式数据
|
||||
const phoneNumber = ref('');
|
||||
const password = ref('');
|
||||
const agreeAgreement = ref(true); // 默认勾选
|
||||
const placeholderStyle = ref('font-size:24rpx')
|
||||
|
||||
// 计算属性:是否可登录(帐号+密码+协议都满足)
|
||||
const canLogin = computed(() => {
|
||||
const phoneReg = /^[a-zA-Z0-9_-]{4,16}$/; // 4-16位
|
||||
const pwdReg = /^.{6,16}$/; // 密码6-16位
|
||||
return phoneReg.test(phoneNumber.value) && pwdReg.test(password.value) && agreeAgreement.value;
|
||||
});
|
||||
|
||||
// 切换协议勾选
|
||||
const toggleAgreement = () => {
|
||||
agreeAgreement.value = !agreeAgreement.value;
|
||||
};
|
||||
|
||||
// 检查表单
|
||||
const checkForm = () => {};
|
||||
|
||||
|
||||
onLoad(() =>{
|
||||
});
|
||||
|
||||
const handleLogin = async () => {
|
||||
if (!canLogin.value) return;
|
||||
// 防止多次点击触发登录
|
||||
canLogin.value = false;
|
||||
|
||||
// // 2. 空值校验
|
||||
// if (!phoneNumber.value) {
|
||||
// uni.showToast({ title: '请输入手机号', icon: 'none' });
|
||||
// canLogin.value = true; // 解锁
|
||||
// return;
|
||||
// }
|
||||
// if (!password.value) {
|
||||
// uni.showToast({ title: '请输入密码', icon: 'none' });
|
||||
// canLogin.value = true; // 解锁
|
||||
// return;
|
||||
// }
|
||||
|
||||
const params = {
|
||||
username: phoneNumber.value,
|
||||
password: password.value
|
||||
};
|
||||
|
||||
try {
|
||||
// 3. 调用登录接口
|
||||
const res = await getLoginPassword(params);
|
||||
|
||||
// 登录成功逻辑
|
||||
// 如果后端返回token,这里保存
|
||||
// uni.setStorageSync('token', res.token || '');
|
||||
uni.showToast({ title: '登录成功', icon: 'success' });
|
||||
// 登录成功后再跳转
|
||||
setTimeout(() => {
|
||||
uni.switchTab({ url: '/pages/index/index' });
|
||||
}, 1500);
|
||||
|
||||
} catch (err) {
|
||||
// 登录失败逻辑(所有错误:账号不存在/密码错/网络异常都走这里)
|
||||
uni.showToast({ title: `${err || '登录失败'}`, icon: 'none' });
|
||||
|
||||
} finally {
|
||||
// 无论成功/失败,解锁按钮
|
||||
canLogin.value = true;
|
||||
}
|
||||
};
|
||||
// 登录逻辑
|
||||
// const handleLogin = () => {
|
||||
// if (!canLogin.value) return
|
||||
// let params = {
|
||||
// username:phoneNumber.value,
|
||||
// password:password.value
|
||||
// }
|
||||
// getLoginPassword(params).then(res =>{
|
||||
// // console.log('33333',res)
|
||||
// if(res.code === 200){
|
||||
// // console.log('33333',res)
|
||||
// //uni.setStorageSync('token', res.token); // 假设后端返回token字段
|
||||
// uni.showToast({ title: '登录成功', icon: 'success' });
|
||||
// uni.switchTab({ url: '/pages/index/index' });
|
||||
// // uni.reLaunch({ url: '/pages/index/index' });
|
||||
// }else{
|
||||
// uni.showToast({ title: `${res.msg},请先注册账号`, icon: 'error' });
|
||||
// }
|
||||
|
||||
// })
|
||||
|
||||
// };
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.login-page {
|
||||
padding: 80rpx 40rpx 40rpx;
|
||||
/* background-color: #f8f9fa; */
|
||||
min-height: 100vh;
|
||||
background: repeating-linear-gradient(180deg, #E2F0FF, #F6FAFF );
|
||||
}
|
||||
.status_bar {
|
||||
height: 160px;
|
||||
width: 100%;
|
||||
}
|
||||
.login-title {
|
||||
font-size: 48rpx;
|
||||
font-weight: 600;
|
||||
color: #333;
|
||||
text-align: center;
|
||||
margin-bottom: 80rpx;
|
||||
}
|
||||
|
||||
.input-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
background-color: #fff;
|
||||
border-radius: 40rpx;
|
||||
padding: 0 30rpx;
|
||||
height: 88rpx;
|
||||
margin-bottom: 30rpx;
|
||||
box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.05);
|
||||
}
|
||||
|
||||
.input-icon {
|
||||
margin-right: 20rpx;
|
||||
width: 50rpx;
|
||||
height: 50rpx;
|
||||
}
|
||||
|
||||
.input-content {
|
||||
flex: 1;
|
||||
font-size: 28rpx;
|
||||
color: #333;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.agreement-wrap {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin: 40rpx 0;
|
||||
padding: 0 10rpx;
|
||||
}
|
||||
|
||||
.agreement-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.agreement-text {
|
||||
font-size: 28rpx;
|
||||
color: #666;
|
||||
margin-left: 10rpx;
|
||||
}
|
||||
|
||||
.forget-pwd {
|
||||
font-size: 28rpx;
|
||||
color: #007aff;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.login-btn {
|
||||
width: 100%;
|
||||
height: 88rpx;
|
||||
line-height: 88rpx;
|
||||
background-color: #007aff;
|
||||
color: #fff;
|
||||
border-radius: 44rpx;
|
||||
font-size: 32rpx;
|
||||
margin-bottom: 60rpx;
|
||||
}
|
||||
|
||||
.login-btn:disabled {
|
||||
background-color: #99c8ff;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.bottom-link {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
padding: 0 20rpx;
|
||||
}
|
||||
|
||||
.link-item {
|
||||
font-size: 28rpx;
|
||||
color: #007aff;
|
||||
text-decoration: none;
|
||||
}
|
||||
</style>
|
||||
@@ -77,7 +77,7 @@
|
||||
|
||||
<!-- 底部链接 -->
|
||||
<view class="bottom-link">
|
||||
<navigator class="link-item" url="/pages/login/pwd-login">账号密码登录</navigator>
|
||||
<navigator class="link-item" url="/pages/loginSub/pwd-login">账号密码登录</navigator>
|
||||
<navigator class="link-item" url="/pages/loginSub/register-new-user">注册新用户</navigator>
|
||||
</view>
|
||||
</view>
|
||||
@@ -166,16 +166,16 @@ const handleLogin = () => {
|
||||
smsCode:'123456',
|
||||
scene:'login',
|
||||
}
|
||||
getLoginBySms(params).then(res =>{
|
||||
if(res.code === 200){
|
||||
//uni.setStorageSync('token', res.token); // 假设后端返回token字段
|
||||
uni.showToast({ title: '登录成功', icon: 'success' });
|
||||
// getLoginBySms(params).then(res =>{
|
||||
// if(res.code === 200){
|
||||
// //uni.setStorageSync('token', res.token); // 假设后端返回token字段
|
||||
// uni.showToast({ title: '登录成功', icon: 'success' });
|
||||
|
||||
}else{
|
||||
uni.showToast({ title:'登录失败', icon: 'error' });
|
||||
}
|
||||
// }else{
|
||||
// uni.showToast({ title:'登录失败', icon: 'error' });
|
||||
// }
|
||||
|
||||
})
|
||||
// })
|
||||
uni.switchTab({ url: '/pages/index/index' });
|
||||
// 模拟登录请求
|
||||
// uni.showLoading({
|
||||
@@ -198,7 +198,7 @@ onUnmounted(() => {
|
||||
padding: 80rpx 40rpx 40rpx;
|
||||
/* background-color: #f8f9fa; */
|
||||
min-height: 100vh;
|
||||
background: repeating-linear-gradient(180deg, #E2F0FF, #F6FAFF );
|
||||
background: repeating-linear-gradient(to bottom, #E2F0FF, #F6FAFF );
|
||||
}
|
||||
.status_bar {
|
||||
height: 160px;
|
||||
|
||||
@@ -58,7 +58,7 @@
|
||||
|
||||
<!-- 底部链接 -->
|
||||
<view class="bottom-link">
|
||||
<navigator class="link-item" url="/pages/login/login">验证码登录</navigator>
|
||||
<navigator class="link-item" url="/pages/loginSub/login">验证码登录</navigator>
|
||||
<navigator class="link-item" url="/pages/loginSub/register-new-user">注册新用户</navigator>
|
||||
</view>
|
||||
</view>
|
||||
@@ -94,57 +94,67 @@ const checkForm = () => {};
|
||||
onLoad(() =>{
|
||||
});
|
||||
|
||||
const handleLogin = async () => {
|
||||
if (!canLogin.value) return;
|
||||
// 防止多次点击触发登录
|
||||
canLogin.value = false;
|
||||
// const handleLogin = async () => {
|
||||
// if (!canLogin.value) return;
|
||||
// // 防止多次点击触发登录
|
||||
// // canLogin.value = false;
|
||||
|
||||
// // 2. 空值校验
|
||||
// // // 2. 空值校验
|
||||
// if (!phoneNumber.value) {
|
||||
// uni.showToast({ title: '请输入手机号', icon: 'none' });
|
||||
// canLogin.value = true; // 解锁
|
||||
// // canLogin.value = true;
|
||||
// return;
|
||||
// }
|
||||
// if (!password.value) {
|
||||
// uni.showToast({ title: '请输入密码', icon: 'none' });
|
||||
// canLogin.value = true; // 解锁
|
||||
// // canLogin.value = true;
|
||||
// return;
|
||||
// }
|
||||
|
||||
const params = {
|
||||
username: phoneNumber.value,
|
||||
password: password.value
|
||||
};
|
||||
|
||||
try {
|
||||
// 3. 调用登录接口
|
||||
const res = await getLoginPassword(params);
|
||||
|
||||
// 登录成功逻辑
|
||||
// 如果后端返回token,这里保存
|
||||
// uni.setStorageSync('token', res.token || '');
|
||||
uni.showToast({ title: '登录成功', icon: 'success' });
|
||||
// 登录成功后再跳转
|
||||
setTimeout(() => {
|
||||
uni.switchTab({ url: '/pages/index/index' });
|
||||
}, 1500);
|
||||
|
||||
} catch (err) {
|
||||
// 登录失败逻辑(所有错误:账号不存在/密码错/网络异常都走这里)
|
||||
uni.showToast({ title: `${err || '登录失败'}`, icon: 'none' });
|
||||
|
||||
} finally {
|
||||
// 无论成功/失败,解锁按钮
|
||||
canLogin.value = true;
|
||||
}
|
||||
};
|
||||
// 登录逻辑
|
||||
// const handleLogin = () => {
|
||||
// if (!canLogin.value) return
|
||||
// let params = {
|
||||
// const params = {
|
||||
// username: phoneNumber.value,
|
||||
// password: password.value
|
||||
// };
|
||||
|
||||
// try {
|
||||
// // 3. 调用登录接口
|
||||
// const res = await getLoginPassword(params);
|
||||
|
||||
// // 登录成功逻辑
|
||||
// // 如果后端返回token,这里保存
|
||||
// // uni.setStorageSync('token', res.token || '');
|
||||
// uni.showToast({ title: '登录成功', icon: 'success' });
|
||||
// // 登录成功后再跳转
|
||||
// setTimeout(() => {
|
||||
// uni.switchTab({ url: '/pages/index/index' });
|
||||
// }, 1500);
|
||||
|
||||
// } catch (err) {
|
||||
// // 登录失败逻辑(所有错误:账号不存在/密码错/网络异常都走这里)
|
||||
// uni.showToast({ title: `${err || '登录失败'}`, icon: 'none' });
|
||||
|
||||
// } finally {
|
||||
// // 无论成功/失败,解锁按钮
|
||||
// canLogin.value = true;
|
||||
// }
|
||||
// };
|
||||
// 登录逻辑
|
||||
const handleLogin = () => {
|
||||
if (!canLogin.value) return
|
||||
let params = {
|
||||
username:phoneNumber.value,
|
||||
password:password.value
|
||||
}
|
||||
if (!phoneNumber.value) {
|
||||
uni.showToast({ title: '请输入手机号', icon: 'none' });
|
||||
// canLogin.value = true;
|
||||
return;
|
||||
}
|
||||
if (!password.value) {
|
||||
uni.showToast({ title: '请输入密码', icon: 'none' });
|
||||
// canLogin.value = true;
|
||||
return;
|
||||
}
|
||||
// getLoginPassword(params).then(res =>{
|
||||
// // console.log('33333',res)
|
||||
// if(res.code === 200){
|
||||
@@ -158,8 +168,11 @@ const handleLogin = async () => {
|
||||
// }
|
||||
|
||||
// })
|
||||
setTimeout(() => {
|
||||
uni.switchTab({ url: '/pages/index/index' });
|
||||
}, 1500);
|
||||
|
||||
// };
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
@@ -91,7 +91,7 @@
|
||||
|
||||
<!-- 跳转登录链接 -->
|
||||
<view class="login-link">
|
||||
<navigator class="link-item" url="/pages/login/pwd-login">已有账号,去登录</navigator>
|
||||
<navigator class="link-item" url="/pages/loginSub/login">已有账号,去登录</navigator>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@@ -13,7 +13,10 @@
|
||||
<!-- 便捷服务 -->
|
||||
<swiper-item>
|
||||
<view class="guide-item">
|
||||
<image class="guide-img" src="/static/引导1.png" ></image>
|
||||
<view class="guide-img">
|
||||
<image class="" src="/static/引导1.png" style="width: 100%;height: 100%;"></image>
|
||||
</view>
|
||||
<view style="height: 200rpx;width: 100%;"></view>
|
||||
<view class="guide-title">便捷服务</view>
|
||||
<view class="guide-subtitle">报修、缴费、预约</view>
|
||||
</view>
|
||||
@@ -22,7 +25,10 @@
|
||||
<!-- 高效管理 -->
|
||||
<swiper-item>
|
||||
<view class="guide-item">
|
||||
<image class="guide-img" src="/static/引导2.png" ></image>
|
||||
<view class="guide-img">
|
||||
<image src="/static/引导2.png" style="width: 100%;height: 100%;"></image>
|
||||
</view>
|
||||
<view style="height: 200rpx;width: 100%;"></view>
|
||||
<view class="guide-title">高效管理</view>
|
||||
<view class="guide-subtitle">自动化流程和智能设备</view>
|
||||
</view>
|
||||
@@ -31,7 +37,10 @@
|
||||
<!--安全保障 -->
|
||||
<swiper-item>
|
||||
<view class="guide-item">
|
||||
<image class="guide-img" src="/static/引导3.png"></image>
|
||||
<view class="guide-img">
|
||||
<image src="/static/引导3.png" style="width: 100%;height: 100%;"></image>
|
||||
</view>
|
||||
<view style="height: 200rpx;width: 100%;"></view>
|
||||
<view class="guide-title">安全保障</view>
|
||||
<view class="guide-subtitle">智能巡检和智慧访客</view>
|
||||
</view>
|
||||
@@ -83,7 +92,7 @@ const handleBtnClick = () => {
|
||||
uni.setStorageSync('hasShowGuide', true);
|
||||
// 2. 跳转首页
|
||||
uni.navigateTo({
|
||||
url:"/pages/login/pwd-login"
|
||||
url:"/pages/loginSub/pwd-login"
|
||||
})
|
||||
// uni.switchTab({
|
||||
// url: '/pages/index/index'
|
||||
@@ -97,7 +106,8 @@ const handleBtnClick = () => {
|
||||
.guide-page {
|
||||
width: 100%;
|
||||
height: 100vh;
|
||||
background-color: #f8f9ff;
|
||||
/* background-color: #f8f9ff; */
|
||||
background: linear-gradient(to bottom, #E2F0FF, #F6FAFF);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
@@ -118,23 +128,23 @@ const handleBtnClick = () => {
|
||||
/* 单个引导项 */
|
||||
.guide-item {
|
||||
width: 360px;
|
||||
height: 360px;
|
||||
height: 480px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
/* 引导插画 */
|
||||
|
||||
.guide-img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
height: 50%;
|
||||
margin-bottom: 80rpx;
|
||||
}
|
||||
|
||||
/* 引导标题 */
|
||||
.guide-title {
|
||||
font-size: 48rpx;
|
||||
font-size: 56rpx;
|
||||
font-weight: 600;
|
||||
color: #333;
|
||||
margin-bottom: 20rpx;
|
||||
|
||||
@@ -7,6 +7,11 @@
|
||||
:refresher-triggered="refreshing"
|
||||
:style="{ height: `calc(100vh - ${statusBarHeight + navBarHeight}px)` }"
|
||||
>
|
||||
<view class="status_bar"></view>
|
||||
<!-- 顶部标题栏 -->
|
||||
<view class="top-bar">
|
||||
<uni-nav-bar left-icon="left" title="通知公告" backgroundColor ="none" :border="false" @clickLeft="narBack" />
|
||||
</view>
|
||||
<!-- 下拉刷新 -->
|
||||
<view class="refresh-container" v-if="refreshing">
|
||||
<uni-icons type="spinner-cycle" size="20" color="#999" class="loading"></uni-icons>
|
||||
@@ -115,16 +120,34 @@
|
||||
url:'/pages/notice-list/noticeListDetails'
|
||||
})
|
||||
}
|
||||
// 返回
|
||||
const narBack = () =>{
|
||||
// uni.navigateBack({
|
||||
// delta: 1
|
||||
// })
|
||||
uni.switchTab({
|
||||
url:"/pages/index/index"
|
||||
})
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
/* 通知列表容器 */
|
||||
.notice-list {
|
||||
padding: 12px 12px 20px;
|
||||
padding: 20px;
|
||||
box-sizing: border-box;
|
||||
background-color: #f9f9f9;
|
||||
}
|
||||
.status_bar {
|
||||
height: 32px;
|
||||
width: 100%;
|
||||
}
|
||||
/* 顶部标题 */
|
||||
.top-bar {
|
||||
text-align: center;
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
|
||||
/* 下拉刷新 */
|
||||
.refresh-container {
|
||||
|
||||
@@ -139,6 +139,7 @@
|
||||
.container {
|
||||
min-height: 100vh;
|
||||
background-color: #ffffff;
|
||||
padding: 20px;
|
||||
// font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
|
||||
}
|
||||
|
||||
@@ -155,7 +156,7 @@
|
||||
// border-bottom: 1px solid #f0f0f0;
|
||||
|
||||
.article-title {
|
||||
font-size: 18px;
|
||||
font-size: 32rpx;
|
||||
font-weight: bold;
|
||||
color: #333333;
|
||||
line-height: 1.4;
|
||||
|
||||
@@ -98,9 +98,9 @@ const openDoor = () => {
|
||||
<style scoped>
|
||||
/* 页面全局样式 */
|
||||
.door-open-page {
|
||||
background: linear-gradient(180deg, #4a90e2, #F6FAFF);
|
||||
background: linear-gradient(180deg, #E2F0FF, #F6FAFF);
|
||||
min-height: 100vh;
|
||||
padding: 30rpx 26rpx;
|
||||
padding: 30rpx 40rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.status_bar {
|
||||
@@ -191,7 +191,8 @@ const openDoor = () => {
|
||||
align-items: center;
|
||||
padding: 30rpx 20rpx;
|
||||
border-radius: 10rpx;
|
||||
border: 2px solid #e5e5e5;
|
||||
border: 2px solid #2F77FD;
|
||||
background-color: #F6F9FE;
|
||||
transition: all 0.3s;
|
||||
}
|
||||
/* 选中状态 */
|
||||
@@ -229,8 +230,8 @@ const openDoor = () => {
|
||||
width: 100%;
|
||||
height: 88rpx;
|
||||
line-height: 88rpx;
|
||||
background-color: #ffffff;
|
||||
color: #2c6bc7;
|
||||
background-color: #2F77FD;
|
||||
color: #fff;
|
||||
font-size: 32rpx;
|
||||
border-radius: 20rpx;
|
||||
border: none;
|
||||
|
||||
@@ -292,7 +292,7 @@ onMounted(() => {
|
||||
background-color: #f5f5f5;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
/* padding: 20rpx; */
|
||||
padding: 40rpx;
|
||||
}
|
||||
|
||||
/* 搜索区域 */
|
||||
@@ -356,7 +356,7 @@ onMounted(() => {
|
||||
/* 小区列表 */
|
||||
.community-list {
|
||||
flex: 1;
|
||||
padding: 0 30rpx;
|
||||
/* padding: 0 30rpx; */
|
||||
margin-top: 20rpx;
|
||||
margin-bottom: 180rpx;
|
||||
|
||||
|
||||
@@ -1,9 +1,14 @@
|
||||
<template>
|
||||
<view class="repair-page">
|
||||
<view class="status_bar"></view>
|
||||
<!-- 顶部导航栏 -->
|
||||
<!-- <view class="nav-bar">
|
||||
<text class="nav-title">在线报修</text>
|
||||
</view> -->
|
||||
<view class="nav-bar">
|
||||
<view class="nav-left" @tap="goBack">
|
||||
<image src="/static/首页/arr-left.png" style="width: 48rpx; height: 48rpx;"></image>
|
||||
</view>
|
||||
<view class="nav-title">在线报修</view>
|
||||
<view class="nav-right"></view>
|
||||
</view>
|
||||
|
||||
<!-- 报修类型Tab -->
|
||||
<view class="repair-type-tabs">
|
||||
@@ -11,6 +16,7 @@
|
||||
class="type-tab"
|
||||
:class="{ active: activeType === 'public' }"
|
||||
@click="publicClick"
|
||||
style="margin-right: 20rpx;"
|
||||
>
|
||||
<image src="/static/在线报修/公共报修.png" style="width: 100%;height: 100%;"></image>
|
||||
<!-- <uni-icons type="staff" size="24" color="#fff"></uni-icons> -->
|
||||
@@ -27,7 +33,7 @@
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view style="margin: 10px 13px;">
|
||||
<view style="margin: 14px 0px;">
|
||||
<text class="repair-title">报修记录</text>
|
||||
</view>
|
||||
|
||||
@@ -75,7 +81,7 @@
|
||||
{{ item.content }}
|
||||
</view>
|
||||
|
||||
<!-- 图片占位(可替换为图片组件) -->
|
||||
<!-- 图片占位 -->
|
||||
<view class="item-imgs">
|
||||
<view class="img-placeholder" v-for="i in 3" :key="i">
|
||||
<!-- <uni-icons type="image" size="20" color="#ccc"></uni-icons> -->
|
||||
@@ -145,7 +151,13 @@ function personalClick(){
|
||||
url:"/pages/online-repair/personalRepair"
|
||||
})
|
||||
}
|
||||
|
||||
// 返回上一页
|
||||
const goBack = () => {
|
||||
// uni.navigateBack()
|
||||
uni.switchTab({
|
||||
url:"/pages/index/index"
|
||||
})
|
||||
}
|
||||
// 跳转报修详情
|
||||
const goDetail = (item) => {
|
||||
// const itemStr = encodeURIComponent(JSON.stringify(item))
|
||||
@@ -158,15 +170,55 @@ const goDetail = (item) => {
|
||||
<style scoped>
|
||||
/* 页面整体样式 */
|
||||
.repair-page {
|
||||
background-color: #f5f5f5;
|
||||
background: linear-gradient(to bottom left, #E2F0FF 0%, #f9f9f9 50%);
|
||||
min-height: 100vh;
|
||||
padding: 0 40rpx;
|
||||
}
|
||||
.status_bar {
|
||||
height: 32px;
|
||||
width: 100%;
|
||||
}
|
||||
/* 顶部导航栏 */
|
||||
.nav-bar {
|
||||
height: 90rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
/* padding: 0 30rpx; */
|
||||
color: #fff;
|
||||
position: sticky;
|
||||
top: 44px;
|
||||
z-index: 100;
|
||||
margin-bottom: 20px;
|
||||
/* box-shadow: 0 4rpx 12rpx rgba(0, 122, 255, 0.2); */
|
||||
}
|
||||
|
||||
.nav-left {
|
||||
width: 60rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.nav-title {
|
||||
flex: 1;
|
||||
text-align: center;
|
||||
font-size: 32rpx;
|
||||
font-weight: 600;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
padding: 0 20rpx;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
.nav-right {
|
||||
width: 60rpx;
|
||||
}
|
||||
/* 报修类型Tab */
|
||||
.repair-type-tabs {
|
||||
display: flex;
|
||||
background-color: #fff;
|
||||
padding: 10px;
|
||||
/* background-color: #fff; */
|
||||
/* padding: 10px; */
|
||||
}
|
||||
.type-tab {
|
||||
flex: 1;
|
||||
@@ -178,7 +230,6 @@ const goDetail = (item) => {
|
||||
border-radius: 8px;
|
||||
color: #fff;
|
||||
font-size: 14px;
|
||||
margin-right: 20rpx;
|
||||
}
|
||||
.type-tab.active {
|
||||
background: linear-gradient(135deg, #1E88E5 0%, #64B5F6 100%);
|
||||
@@ -199,8 +250,8 @@ const goDetail = (item) => {
|
||||
.record-status-tabs {
|
||||
display: flex;
|
||||
/* background-color: #fff; */
|
||||
margin-top: 10px;
|
||||
padding: 0 15px;
|
||||
/* margin-top: 10px; */
|
||||
/* padding: 0 15px; */
|
||||
}
|
||||
.status-tab {
|
||||
flex: 1;
|
||||
@@ -229,7 +280,7 @@ const goDetail = (item) => {
|
||||
|
||||
/* 报修列表 */
|
||||
.repair-list {
|
||||
padding: 10px;
|
||||
padding: 28rpx 0rpx;
|
||||
}
|
||||
.repair-item {
|
||||
background-color: #fff;
|
||||
@@ -283,8 +334,8 @@ const goDetail = (item) => {
|
||||
|
||||
/* 标签 */
|
||||
.item-tags {
|
||||
display: flex;
|
||||
gap: 8px;
|
||||
/* display: flex; */
|
||||
/* gap: 8px; */
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.tag {
|
||||
@@ -294,6 +345,7 @@ const goDetail = (item) => {
|
||||
padding: 2px 8px;
|
||||
border-radius: 4px;
|
||||
border: 1px solid #999999;
|
||||
margin-right: 8px;
|
||||
}
|
||||
|
||||
/* 内容 */
|
||||
@@ -308,7 +360,7 @@ const goDetail = (item) => {
|
||||
/* 图片占位 */
|
||||
.item-imgs {
|
||||
display: flex;
|
||||
gap: 12px;
|
||||
/* gap: 12px; */
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.img-placeholder {
|
||||
@@ -319,6 +371,7 @@ const goDetail = (item) => {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin-right: 8px;
|
||||
}
|
||||
|
||||
/* 底部时间和详情 */
|
||||
@@ -326,7 +379,7 @@ const goDetail = (item) => {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
font-size: 12px;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
.item-time {
|
||||
color: #999;
|
||||
|
||||
@@ -1,7 +1,13 @@
|
||||
<template>
|
||||
<view class="visitor-add-page">
|
||||
<!-- Tab 切换:车辆来访/人员来访 -->
|
||||
<view class="tab-bar">
|
||||
<view class="visitor-invite">
|
||||
<!-- 顶部导航 -->
|
||||
<!-- <view class="nav-bar">
|
||||
<uni-icons type="left" size="20" color="#000" @click="navigateBack"></uni-icons>
|
||||
<view class="nav-title">访客邀请</view>
|
||||
</view> -->
|
||||
|
||||
<!-- 标签切换:车辆来访/人员来访 -->
|
||||
<view class="tab-wrap">
|
||||
<view
|
||||
class="tab-item"
|
||||
:class="{ active: activeTab === 'car' }"
|
||||
@@ -19,478 +25,470 @@
|
||||
</view>
|
||||
|
||||
<!-- 表单区域 -->
|
||||
<scroll-view class="form-scroll" scroll-y>
|
||||
<view class="form-wrap">
|
||||
<!-- 房屋信息 -->
|
||||
<view class="form-section">
|
||||
<uni-forms ref="formRef" :modelValue="formData" :rules="formRules" label-width="105px" label-align="left">
|
||||
<!-- 来访地址 -->
|
||||
<uni-forms-item label="来访地址:" name="address" required>
|
||||
<uni-data-select v-model="formData.address" :localdata="addressList" @change="changeAddress" :clear="false"></uni-data-select>
|
||||
</uni-forms-item>
|
||||
<!-- 访客姓名 -->
|
||||
<uni-forms-item label="访客姓名" name="name" required>
|
||||
<uni-easyinput type="text" v-model="formData.name" placeholder="请输入姓名" />
|
||||
</uni-forms-item>
|
||||
<!-- 访客性别 -->
|
||||
<uni-forms-item label="访客性别" name="gender" required>
|
||||
<uni-data-select v-model="formData.gender" :localdata="sexList" @change="changeSex" :clear="false"></uni-data-select>
|
||||
</uni-forms-item>
|
||||
<!-- 访客联系方式 -->
|
||||
<uni-forms-item label="访客联系方式" name="phone" required>
|
||||
<uni-easyinput
|
||||
v-model="formData.phone"
|
||||
placeholder="请输入联系方式"
|
||||
type="number" />
|
||||
</uni-forms-item>
|
||||
<!-- 车牌号:仅车辆来访显示 -->
|
||||
<uni-forms-item
|
||||
label="车牌号:"
|
||||
name="carNumber"
|
||||
required
|
||||
v-if="activeTab === 'car'"
|
||||
>
|
||||
<view class="plate-input-wrap">
|
||||
<!-- 省份简称选择框 -->
|
||||
<view
|
||||
class="plate-item province-item"
|
||||
@click="showProvinceClick"
|
||||
>
|
||||
<text>{{ plateChars[0] || '选' }}</text>
|
||||
<view class="section-title">房屋信息</view>
|
||||
<view class="form-item">
|
||||
<view class="label">
|
||||
<text class="required">*</text>来访地址
|
||||
</view>
|
||||
<!-- 6个字符输入框(省份+6位=完整车牌) -->
|
||||
<view class="value" @click="openAddressModal">
|
||||
{{ form.address }}
|
||||
<uni-icons type="right" size="16" color="#999"></uni-icons>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 访客信息 -->
|
||||
<view class="form-section">
|
||||
<view class="section-title">访客信息</view>
|
||||
<view class="form-item">
|
||||
<view class="label">访客姓名</view>
|
||||
<input
|
||||
v-for="(char, index) in plateChars.slice(1)"
|
||||
class="input"
|
||||
placeholder="请输入访客姓名"
|
||||
v-model="form.name"
|
||||
/>
|
||||
</view>
|
||||
<view class="form-item">
|
||||
<view class="label">
|
||||
<text class="required">*</text>访客性别
|
||||
</view>
|
||||
<view class="value" @click="openGenderModal">
|
||||
{{ form.gender }}
|
||||
<uni-icons type="right" size="16" color="#999"></uni-icons>
|
||||
</view>
|
||||
</view>
|
||||
<view class="form-item">
|
||||
<view class="label">
|
||||
<text class="required">*</text>访客联系方式
|
||||
</view>
|
||||
<input
|
||||
class="input"
|
||||
placeholder="请输入联系方式"
|
||||
v-model="form.phone"
|
||||
type="number"
|
||||
/>
|
||||
</view>
|
||||
|
||||
<!-- 车牌号:仅车辆来访显示 -->
|
||||
<view class="form-item" v-if="activeTab === 'car'">
|
||||
<view class="label">
|
||||
<text class="required">*</text>车牌号
|
||||
</view>
|
||||
<view class="car-number-wrap">
|
||||
<input
|
||||
class="car-input"
|
||||
v-for="(item, index) in 8"
|
||||
:key="index"
|
||||
ref="el => plateInputRefs[index + 1] = el"
|
||||
class="plate-item char-item"
|
||||
v-model="plateChars[index + 1]"
|
||||
v-model="form.carNumber[index]"
|
||||
maxlength="1"
|
||||
type="text"
|
||||
@input="handlePlateInput(index + 1, $event)"
|
||||
placeholder=""
|
||||
@keydown="handlePlateKeydown(index + 1, $event)"/>
|
||||
/>
|
||||
</view>
|
||||
</uni-forms-item>
|
||||
<!-- 随行人数 -->
|
||||
<uni-forms-item label="随行人数:" name="escortNum">
|
||||
<uni-easyinput v-model="formData.escortNum" placeholder="请输入随行人数" type="number"/>
|
||||
</uni-forms-item>
|
||||
<!-- 来访时间 -->
|
||||
<uni-forms-item label="来访时间:" name="visitTime" required>
|
||||
<uni-datetime-picker type="datetime" v-model="formData.visitTime" @change="handleTimeChange" />
|
||||
</uni-forms-item>
|
||||
<!-- 离开时间 -->
|
||||
<uni-forms-item label="离开时间:" name="leaveTime" required>
|
||||
<uni-datetime-picker type="datetime" v-model="formData.leaveTime" @change="handleTimeChange" />
|
||||
</uni-forms-item>
|
||||
</uni-forms>
|
||||
</view>
|
||||
<!-- 提示文字 -->
|
||||
<view class="tips-text">
|
||||
预计来访时间和预计离开时间间隔不能超过24小时
|
||||
<view>车辆停留请勿超出有效期,需及时驶出小区</view>
|
||||
|
||||
<view class="form-item">
|
||||
<view class="label">
|
||||
<text class="required">*</text>随行人数
|
||||
</view>
|
||||
<input
|
||||
class="input"
|
||||
placeholder="请输入随行人数"
|
||||
v-model="form.peopleNum"
|
||||
type="number"
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 有效期 -->
|
||||
<view class="form-section">
|
||||
<view class="section-title">有效期</view>
|
||||
<view class="form-item">
|
||||
<view class="label">
|
||||
<text class="required">*</text>来访时间
|
||||
</view>
|
||||
<view class="value">
|
||||
<uni-datetime-picker type="datetime" v-model="visitTime" @change="changeLog" :border="false"/>
|
||||
</view>
|
||||
</view>
|
||||
<view class="form-item">
|
||||
<view class="label">
|
||||
<text class="required">*</text>离开时间
|
||||
</view>
|
||||
<view class="value">
|
||||
<uni-datetime-picker type="datetime" v-model="leaveTime" @change="changeLog" :border="false"/>
|
||||
</view>
|
||||
</view>
|
||||
<view class="tips">预计来访时间和预计离开时间间隔不能超过24小时</view>
|
||||
<view class="tips">车辆停留请勿超出有效期,需及时驶出小区</view>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
|
||||
<!-- 底部按钮 -->
|
||||
<view class="btn-footer">
|
||||
<view class="btn-wrap">
|
||||
<button
|
||||
class="main-btn"
|
||||
@click="activeTab === 'car' ? submitInvite() : goToQrcode()"
|
||||
class="submit-btn"
|
||||
@click="submitForm"
|
||||
>
|
||||
{{ activeTab === 'car' ? '确认邀请' : '生成通行二维码' }}
|
||||
</button>
|
||||
</view>
|
||||
|
||||
<!-- 省份选择弹窗 -->
|
||||
<uni-popup v-model="showProvinceSelect" type="center" ref="popup">
|
||||
<view class="popup-select-wrap">
|
||||
<text class="popup-title">选择省份简称</text>
|
||||
<uni-data-select
|
||||
v-model="plateChars[0]"
|
||||
:localdata="provinceList"
|
||||
@confirm="onProvinceConfirm"
|
||||
@cancel="popup.close()"
|
||||
placeholder="请选择省份简称"
|
||||
></uni-data-select>
|
||||
<!-- 地址选择弹窗 -->
|
||||
<uni-popup ref="addressModalRef" type="bottom" :mask-click="false">
|
||||
<view class="modal-wrap">
|
||||
<view class="modal-title">选择来访地址</view>
|
||||
<view class="address-list">
|
||||
<view
|
||||
class="address-item"
|
||||
:class="{ active: item === form.address }"
|
||||
v-for="item in addressList"
|
||||
:key="item"
|
||||
@click="selectAddress(item)"
|
||||
>
|
||||
{{ item }}
|
||||
</view>
|
||||
</view>
|
||||
<uni-icons
|
||||
type="closeempty"
|
||||
size="20"
|
||||
class="modal-close"
|
||||
@click="closeAddressModal"
|
||||
></uni-icons>
|
||||
</view>
|
||||
</uni-popup>
|
||||
|
||||
<!-- 性别选择弹窗 -->
|
||||
<uni-popup ref="genderModalRef" type="bottom" :mask-click="false">
|
||||
<view class="modal-wrap">
|
||||
<view class="gender-list">
|
||||
<view
|
||||
class="gender-item"
|
||||
:class="{ active: item === form.gender }"
|
||||
v-for="item in genderList"
|
||||
:key="item"
|
||||
@click="selectGender(item)"
|
||||
>
|
||||
{{ item }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</uni-popup>
|
||||
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, reactive, watch, nextTick } from 'vue';
|
||||
import { ref, reactive} from 'vue';
|
||||
import{onLoad } from "@dcloudio/uni-app"
|
||||
|
||||
// 激活的Tab:car-车辆来访,person-人员来访
|
||||
// 标签激活状态
|
||||
const activeTab = ref('car');
|
||||
const popup = ref(null)
|
||||
|
||||
// 表单数据
|
||||
const formData = reactive({
|
||||
address: '', // 来访地址
|
||||
const form = reactive({
|
||||
address: '桂花园(别墅)2号楼2层', // 来访地址默认值
|
||||
name: '', // 访客姓名
|
||||
gender: '', // 访客性别
|
||||
gender: '男', // 性别默认值
|
||||
phone: '', // 联系方式
|
||||
carNumber: '', // 车牌号(同步输入的完整车牌)
|
||||
escortNum: '', // 随行人数
|
||||
visitTime: '', // 来访时间
|
||||
carNumber: ['', '', '', '', '', '', ''], // 车牌号(7位)
|
||||
peopleNum: '', // 随行人数
|
||||
visitTime: '', // 来访时间默认值
|
||||
leaveTime: '' // 离开时间
|
||||
});
|
||||
|
||||
// 表单Ref(用于调用校验方法)
|
||||
const formRef = ref(null);
|
||||
|
||||
// 表单校验规则
|
||||
const formRules = reactive({
|
||||
address: {
|
||||
rules: [{ required: true, errorMessage: '请选择来访地址' }]
|
||||
},
|
||||
name: {
|
||||
rules: [{ required: true, errorMessage: '请输入访客姓名' }]
|
||||
},
|
||||
gender: {
|
||||
rules: [{ required: true, errorMessage: '请选择访客性别' }]
|
||||
},
|
||||
phone: {
|
||||
rules: [
|
||||
{ required: true, errorMessage: '请输入正确的手机号' },
|
||||
{ pattern: /^1[3-9]\d{9}$/, errorMessage: '请输入正确的手机号' }
|
||||
]
|
||||
},
|
||||
carNumber: {
|
||||
rules: [
|
||||
{
|
||||
required: true,
|
||||
errorMessage: "请输入车牌号",
|
||||
},
|
||||
{
|
||||
validateFunction: (rule, value, callback) => {
|
||||
// 仅车辆来访时生效
|
||||
if (activeTab.value !== 'car') return callback();
|
||||
|
||||
// 1. 校验省份是否选择
|
||||
if (!plateChars.value[0]) {
|
||||
return callback('请选择省份简称');
|
||||
}
|
||||
|
||||
// 2. 拼接完整车牌号
|
||||
const fullPlate = plateChars.value.join('').trim();
|
||||
|
||||
// 3. 校验车牌号长度(省份+5/6位字符)
|
||||
if (fullPlate.length < 7) {
|
||||
return callback('请输入完整车牌号(省份+5位字符)');
|
||||
}
|
||||
if (fullPlate.length > 8) {
|
||||
return callback('车牌号长度超出限制(最多7位)');
|
||||
}
|
||||
|
||||
// 4. 同步到formData.carNumber(供接口提交)
|
||||
formData.carNumber = fullPlate;
|
||||
callback();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
]
|
||||
},
|
||||
visitTime: {
|
||||
rules: [{ required: true, errorMessage: '请选择来访时间' }]
|
||||
},
|
||||
leaveTime: {
|
||||
rules: [
|
||||
{ required: true, errorMessage: '请选择离开时间' },
|
||||
{
|
||||
validateFunction: (rule, value, callback) => {
|
||||
// 1. 空值校验
|
||||
if (!value) return callback('请选择离开时间');
|
||||
if (!formData.visitTime) return callback('请先选择来访时间');
|
||||
|
||||
// 2. 校验时间格式有效性
|
||||
const visitTime = new Date(formData.visitTime);
|
||||
const leaveTime = new Date(value);
|
||||
if (isNaN(visitTime.getTime()) || isNaN(leaveTime.getTime())) {
|
||||
return callback('请选择有效的时间');
|
||||
}
|
||||
|
||||
// 3. 校验离开时间不能早于来访时间
|
||||
if (leaveTime <= visitTime) {
|
||||
return callback('离开时间不能早于来访时间');
|
||||
}
|
||||
|
||||
// 4. 校验时间间隔≤24小时
|
||||
const diffHours = (leaveTime.getTime() - visitTime.getTime()) / (1000 * 60 * 60);
|
||||
if (diffHours > 24) {
|
||||
return callback('来访和离开时间间隔不能超过24小时');
|
||||
}
|
||||
|
||||
callback();
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
});
|
||||
|
||||
// 地址列表
|
||||
// 地址列表(模拟数据)
|
||||
const addressList = ref([
|
||||
{ text: '桂花园(别墅)1号楼1层', value: '桂花园(别墅)1号楼1层' },
|
||||
{ text: '桂花园(别墅)2号楼2层', value: '桂花园(别墅)2号楼2层' }
|
||||
'桂花园(别墅)1号楼1层',
|
||||
'桂花园(别墅)2号楼2层'
|
||||
]);
|
||||
|
||||
// 性别列表
|
||||
const sexList = ref([
|
||||
{ text: '男', value: '男' },
|
||||
{ text: '女', value: '女' }
|
||||
]);
|
||||
const genderList = ref(['男', '女']);
|
||||
|
||||
// 省份简称列表(国标规范)
|
||||
const provinceList = ref([
|
||||
{ text: '京', value: '京' },
|
||||
{ text: '沪', value: '沪' },
|
||||
{ text: '粤', value: '粤' },
|
||||
{ text: '苏', value: '苏' },
|
||||
{ text: '浙', value: '浙' },
|
||||
{ text: '鲁', value: '鲁' },
|
||||
{ text: '川', value: '川' },
|
||||
{ text: '渝', value: '渝' },
|
||||
{ text: '湘', value: '湘' },
|
||||
{ text: '鄂', value: '鄂' }
|
||||
]);
|
||||
// 弹窗/选择器实例
|
||||
const addressModalRef = ref(null);
|
||||
const genderModalRef = ref(null);
|
||||
const timePickerRef = ref(null);
|
||||
// 标记当前选择的是来访/离开时间
|
||||
const currentTimeType = ref('');
|
||||
|
||||
// 车牌号逐位存储(索引0:省份,1-6:字符 → 共7位,兼容普通/新能源车牌)
|
||||
const plateChars = ref(['', '', '', '', '', '', '','']);
|
||||
const showProvinceSelect = ref(false); // 省份选择弹窗
|
||||
const plateInputRefs = ref([]); // 输入框refs,用于自动聚焦
|
||||
|
||||
// 打开省份弹框
|
||||
const showProvinceClick = () => {
|
||||
popup.value.open()
|
||||
};
|
||||
|
||||
// 选择省份后赋值
|
||||
const onProvinceConfirm = () => {
|
||||
showProvinceSelect.value = false;
|
||||
popup.value.close();
|
||||
// 省份选择后自动聚焦第一个字符输入框
|
||||
nextTick(() => {
|
||||
plateInputRefs.value[1]?.focus();
|
||||
// 页面初始化
|
||||
onLoad(() => {
|
||||
// 可在这里请求接口获取地址/默认时间等数据
|
||||
});
|
||||
};
|
||||
|
||||
// 车牌号字符输入处理(优化过滤和自动聚焦)
|
||||
const handlePlateInput = (index, e) => {
|
||||
// 过滤非字母数字,转大写(车牌仅支持字母/数字)
|
||||
let val = e.detail.value.replace(/[^A-Za-z0-9]/g, '').toUpperCase();
|
||||
// 仅保留1个字符
|
||||
val = val.slice(-1);
|
||||
plateChars.value[index] = val;
|
||||
|
||||
// 自动聚焦下一个输入框(如果当前有值且不是最后一位)
|
||||
if (val && index < 7) { // 最后一位是索引6,无需再聚焦
|
||||
nextTick(() => {
|
||||
plateInputRefs.value[index + 1]?.focus();
|
||||
});
|
||||
}
|
||||
|
||||
// 输入完成后触发表单校验
|
||||
if (activeTab.value === 'car') {
|
||||
formRef.value.validateField('carNumber');
|
||||
}
|
||||
};
|
||||
|
||||
// 车牌号删除键处理(优化回退逻辑)
|
||||
const handlePlateKeydown = (index, e) => {
|
||||
// 监听回退键(keyCode 8)
|
||||
if (e.keyCode === 8) {
|
||||
// 当前输入框为空,聚焦上一个
|
||||
if (!plateChars.value[index] && index > 1) {
|
||||
nextTick(() => {
|
||||
plateInputRefs.value[index - 1]?.focus();
|
||||
});
|
||||
} else {
|
||||
// 清空当前输入框
|
||||
plateChars.value[index] = '';
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// 时间变更时重新校验离开时间
|
||||
const handleTimeChange = () => {
|
||||
if (formData.leaveTime) {
|
||||
formRef.value.validateField('leaveTime');
|
||||
}
|
||||
};
|
||||
|
||||
// 切换Tab
|
||||
// 切换tab
|
||||
const switchTab = (tab) => {
|
||||
activeTab.value = tab;
|
||||
// 切换Tab后重置表单
|
||||
if (tab === 'person') {
|
||||
resetForm();
|
||||
}
|
||||
// resetForm();
|
||||
nextTick(() =>{
|
||||
formRef.value.clearValidate() // 清空所有校验提示
|
||||
// formRef.value.validate();
|
||||
|
||||
})
|
||||
|
||||
};
|
||||
|
||||
// 空方法占位
|
||||
const changeAddress = () => {};
|
||||
const changeSex = (e) => {};
|
||||
// 返回上一页
|
||||
const navigateBack = () => {
|
||||
uni.navigateBack();
|
||||
};
|
||||
|
||||
// 提交前表单校验
|
||||
const submitForm = async () => {
|
||||
try {
|
||||
// 调用uni-forms内置校验
|
||||
await formRef.value.validate();
|
||||
return true;
|
||||
} catch (err) {
|
||||
return false;
|
||||
// 打开地址弹窗
|
||||
const openAddressModal = () => {
|
||||
addressModalRef.value.open();
|
||||
};
|
||||
|
||||
// 关闭地址弹窗
|
||||
const closeAddressModal = () => {
|
||||
addressModalRef.value.close();
|
||||
};
|
||||
|
||||
// 选择地址
|
||||
const selectAddress = (item) => {
|
||||
form.address = item;
|
||||
closeAddressModal();
|
||||
};
|
||||
|
||||
// 打开性别弹窗
|
||||
const openGenderModal = () => {
|
||||
genderModalRef.value.open();
|
||||
};
|
||||
|
||||
// 选择性别
|
||||
const selectGender = (item) => {
|
||||
form.gender = item;
|
||||
genderModalRef.value.close();
|
||||
};
|
||||
|
||||
// 打开时间选择器
|
||||
// const openTimePicker = (type) => {
|
||||
// currentTimeType.value = type;
|
||||
// timePickerRef.value.open();
|
||||
// };
|
||||
|
||||
|
||||
|
||||
// 校验来访/离开时间间隔
|
||||
const checkTimeInterval = () => {
|
||||
if (!form.visitTime || !form.leaveTime) return;
|
||||
const visitTime = new Date(form.visitTime).getTime();
|
||||
const leaveTime = new Date(form.leaveTime).getTime();
|
||||
const diffHours = (leaveTime - visitTime) / (1000 * 60 * 60);
|
||||
if (diffHours > 24) {
|
||||
uni.showToast({
|
||||
title: '时间间隔不能超过24小时',
|
||||
icon: 'none'
|
||||
});
|
||||
form.leaveTime = '';
|
||||
}
|
||||
};
|
||||
|
||||
// 车辆来访:提交确认邀请
|
||||
const submitInvite = async () => {
|
||||
const isValid = await submitForm();
|
||||
if (!isValid) return;
|
||||
|
||||
// 模拟接口提交
|
||||
uni.showToast({
|
||||
title: '邀请成功',
|
||||
icon: 'success',
|
||||
duration: 2000
|
||||
});
|
||||
// 表单提交
|
||||
const submitForm = () => {
|
||||
// 必填项校验
|
||||
if (!form.phone) {
|
||||
uni.showToast({ title: '请输入访客联系方式', icon: 'none' });
|
||||
return;
|
||||
}
|
||||
if (!/^1[3-9]\d{9}$/.test(form.phone)) {
|
||||
uni.showToast({ title: '请输入正确的手机号', icon: 'none' });
|
||||
return;
|
||||
}
|
||||
if (activeTab === 'car' && form.carNumber.join('').length < 8) {
|
||||
uni.showToast({ title: '请填写完整车牌号', icon: 'none' });
|
||||
return;
|
||||
}
|
||||
if (!form.peopleNum || form.peopleNum < 0) {
|
||||
uni.showToast({ title: '请输入正确的随行人数', icon: 'none' });
|
||||
return;
|
||||
}
|
||||
if (!form.leaveTime) {
|
||||
uni.showToast({ title: '请选择离开时间', icon: 'none' });
|
||||
return;
|
||||
}
|
||||
checkTimeInterval();
|
||||
if (!form.leaveTime) return; // 时间校验失败则终止提交
|
||||
|
||||
// 提交逻辑(替换为实际接口请求)
|
||||
uni.showLoading({ title: '提交中...' });
|
||||
setTimeout(() => {
|
||||
resetForm();
|
||||
}, 2000);
|
||||
};
|
||||
|
||||
// 跳转到二维码页面(人员来访)
|
||||
const goToQrcode = async () => {
|
||||
const isValid = await submitForm();
|
||||
if (!isValid) return;
|
||||
|
||||
const formStr = encodeURIComponent(JSON.stringify(formData));
|
||||
uni.navigateTo({
|
||||
url: `/pages/visitor/qrcode-page?form=${formStr}`
|
||||
uni.hideLoading();
|
||||
uni.showToast({
|
||||
title: activeTab === 'car' ? '邀请成功' : '二维码生成成功',
|
||||
icon: 'success'
|
||||
});
|
||||
};
|
||||
}, 1000);
|
||||
|
||||
};
|
||||
// 重置表单
|
||||
const resetForm = () => {
|
||||
formData.address = '';
|
||||
formData.name = '';
|
||||
formData.gender = '';
|
||||
formData.phone = '';
|
||||
formData.carNumber = '';
|
||||
formData.escortNum = '';
|
||||
formData.visitTime = '';
|
||||
formData.leaveTime = '';
|
||||
plateChars.value = ['', '', '', '', '', '', '']; // 重置车牌号输入
|
||||
form.address = '';
|
||||
form.name = '';
|
||||
form.gender = '';
|
||||
form.phone = '';
|
||||
form.carNumber = '';
|
||||
form.escortNum = '';
|
||||
form.visitTime = '';
|
||||
form.leaveTime = '';
|
||||
form.carNumber = ['', '', '', '', '', '', '']; // 重置车牌号输入
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.visitor-add-page {
|
||||
background-color: #f8f8f8;
|
||||
.visitor-invite {
|
||||
background-color: #f5f5f5;
|
||||
min-height: 100vh;
|
||||
}
|
||||
|
||||
/* Tab 切换样式 */
|
||||
.tab-bar {
|
||||
/* 导航栏 */
|
||||
.nav-bar {
|
||||
display: flex;
|
||||
background: #fff;
|
||||
align-items: center;
|
||||
padding: 20rpx;
|
||||
background-color: #fff;
|
||||
}
|
||||
.nav-title {
|
||||
font-size: 36rpx;
|
||||
font-weight: 500;
|
||||
margin-left: 20rpx;
|
||||
}
|
||||
|
||||
/* 标签切换 */
|
||||
.tab-wrap {
|
||||
display: flex;
|
||||
background-color: #fff;
|
||||
border-bottom: 1rpx solid #eee;
|
||||
}
|
||||
.tab-item {
|
||||
flex: 1;
|
||||
text-align: center;
|
||||
padding: 20rpx 0;
|
||||
font-size: 32rpx;
|
||||
color: #666;
|
||||
border-bottom: 4rpx solid transparent;
|
||||
color: #333;
|
||||
}
|
||||
.tab-item.active {
|
||||
color: #007aff;
|
||||
border-bottom-color: #007aff;
|
||||
border-bottom: 4rpx solid #007aff;
|
||||
}
|
||||
|
||||
/* 表单样式 */
|
||||
.form-scroll {
|
||||
height: calc(100vh - 220rpx);
|
||||
/* 表单区域 */
|
||||
.form-wrap {
|
||||
padding: 10rpx;
|
||||
}
|
||||
.form-section {
|
||||
background: #fff;
|
||||
margin-top: 20rpx;
|
||||
padding: 20rpx;
|
||||
background-color: #fff;
|
||||
margin-bottom: 10rpx;
|
||||
padding: 20rpx 40rpx;
|
||||
}
|
||||
|
||||
/* 车牌号逐位输入样式 */
|
||||
.plate-input-wrap {
|
||||
flex: 1;
|
||||
.section-title {
|
||||
font-size: 32rpx;
|
||||
font-weight: 500;
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
.form-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 4rpx;
|
||||
padding: 20rpx 0;
|
||||
border-bottom: 1rpx solid #f0f0f0;
|
||||
}
|
||||
.plate-item {
|
||||
width: 52rpx;
|
||||
height: 60rpx;
|
||||
line-height: 60rpx;
|
||||
text-align: center;
|
||||
border: 1rpx solid #ddd;
|
||||
border-radius: 4rpx;
|
||||
font-size: 28rpx;
|
||||
.form-item:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
.label {
|
||||
width: 200rpx;
|
||||
font-size: 30rpx;
|
||||
color: #333;
|
||||
}
|
||||
.province-item {
|
||||
background-color: #f8f8f8;
|
||||
.required {
|
||||
color: red;
|
||||
margin-right: 4rpx;
|
||||
}
|
||||
.char-item {
|
||||
border: 1px solid #666;
|
||||
outline: none;
|
||||
padding: 0;
|
||||
margin: 0 3rpx;
|
||||
.value {
|
||||
flex: 1;
|
||||
font-size: 30rpx;
|
||||
color: #666;
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
align-items: center;
|
||||
}
|
||||
.char-item:focus {
|
||||
border-color: #007aff;
|
||||
box-shadow: 0 0 4rpx rgba(0, 122, 255, 0.5);
|
||||
.input {
|
||||
flex: 1;
|
||||
font-size: 30rpx;
|
||||
color: #666;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
/* 省份选择弹窗样式 */
|
||||
.popup-select-wrap {
|
||||
background: #fff;
|
||||
border-radius: 12rpx;
|
||||
padding: 30rpx;
|
||||
width: 600rpx;
|
||||
margin: 0 auto;
|
||||
/* 车牌号输入 */
|
||||
.car-number-wrap {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
.popup-title {
|
||||
font-size: 32rpx;
|
||||
font-weight: 600;
|
||||
color: #333;
|
||||
margin-bottom: 20rpx;
|
||||
display: block;
|
||||
.car-input {
|
||||
width: 52rpx;
|
||||
height: 60rpx;
|
||||
border: 1rpx solid #eee;
|
||||
text-align: center;
|
||||
font-size: 30rpx;
|
||||
}
|
||||
|
||||
/* 提示文字 */
|
||||
.tips-text {
|
||||
margin: 20rpx;
|
||||
.tips {
|
||||
font-size: 24rpx;
|
||||
color: #999;
|
||||
line-height: 1.6;
|
||||
margin-top: 10rpx;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
/* 底部按钮 */
|
||||
.btn-footer {
|
||||
.btn-wrap {
|
||||
padding: 20rpx;
|
||||
background: #fff;
|
||||
}
|
||||
.main-btn {
|
||||
.submit-btn {
|
||||
background-color: #007aff;
|
||||
color: #fff;
|
||||
border-radius: 8rpx;
|
||||
height: 88rpx;
|
||||
font-size: 32rpx;
|
||||
height: 80rpx;
|
||||
line-height: 80rpx;
|
||||
border-radius: 8rpx;
|
||||
}
|
||||
|
||||
/* 弹窗样式 */
|
||||
.modal-wrap {
|
||||
background-color: #fff;
|
||||
padding: 30rpx;
|
||||
border-top-left-radius: 20rpx;
|
||||
border-top-right-radius: 20rpx;
|
||||
position: relative;
|
||||
}
|
||||
.modal-title {
|
||||
font-size: 32rpx;
|
||||
text-align: center;
|
||||
margin-bottom: 30rpx;
|
||||
}
|
||||
.modal-close {
|
||||
position: absolute;
|
||||
top: 20rpx;
|
||||
right: 20rpx;
|
||||
color: #999;
|
||||
}
|
||||
.address-list, .gender-list {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 20rpx;
|
||||
}
|
||||
.address-item, .gender-item {
|
||||
padding: 20rpx;
|
||||
background-color: #f5f5f5;
|
||||
border-radius: 8rpx;
|
||||
text-align: center;
|
||||
font-size: 30rpx;
|
||||
}
|
||||
.address-item.active, .gender-item.active {
|
||||
background-color: #007aff;
|
||||
color: #fff;
|
||||
}
|
||||
</style>
|
||||
@@ -1,5 +1,14 @@
|
||||
<template>
|
||||
<view class="visitor-page">
|
||||
<view class="status_bar"></view>
|
||||
<!-- 顶部导航栏 -->
|
||||
<view class="nav-bar">
|
||||
<view class="nav-left" @tap="goBack">
|
||||
<image src="/static/首页/arr-left.png" style="width: 48rpx; height: 48rpx;"></image>
|
||||
</view>
|
||||
<view class="nav-title">访客邀请</view>
|
||||
<view class="nav-right"></view>
|
||||
</view>
|
||||
|
||||
<!-- 标签切换栏 -->
|
||||
<view class="tab-bar">
|
||||
@@ -112,7 +121,13 @@ const visitorList = ref([
|
||||
const filterdList = computed(() => {
|
||||
return visitorList.value.filter(item => item.status === activeTab.value)
|
||||
})
|
||||
|
||||
// 返回上一页
|
||||
const goBack = () => {
|
||||
// uni.navigateBack()
|
||||
uni.switchTab({
|
||||
url:"/pages/index/index"
|
||||
})
|
||||
}
|
||||
|
||||
// 查看详情
|
||||
const viewDetail = (item) => {
|
||||
@@ -134,19 +149,57 @@ const addInvitation = () => {
|
||||
<style scoped>
|
||||
/* 页面整体样式 */
|
||||
.visitor-page {
|
||||
background-color: #f5f5f5;
|
||||
background: linear-gradient(to bottom left, #E2F0FF 0%, #f9f9f9 50%);
|
||||
min-height: 100vh;
|
||||
padding: 0 40rpx;
|
||||
}
|
||||
.status_bar {
|
||||
height: 32px;
|
||||
width: 100%;
|
||||
}
|
||||
/* 顶部导航栏 */
|
||||
.nav-bar {
|
||||
height: 90rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
/* padding: 0 30rpx; */
|
||||
color: #fff;
|
||||
position: sticky;
|
||||
top: 44px;
|
||||
z-index: 100;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.nav-left {
|
||||
width: 60rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.nav-title {
|
||||
flex: 1;
|
||||
text-align: center;
|
||||
font-size: 32rpx;
|
||||
font-weight: 600;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
padding: 0 20rpx;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
.nav-right {
|
||||
width: 60rpx;
|
||||
}
|
||||
|
||||
/* 标签切换栏 */
|
||||
.tab-bar {
|
||||
display: flex;
|
||||
background-color: #fff;
|
||||
border-bottom: 2px solid #f5f5f5;
|
||||
}
|
||||
.tab-item {
|
||||
flex: 1;
|
||||
text-align: center;
|
||||
text-align: left;
|
||||
padding: 12px 0;
|
||||
font-size: 16px;
|
||||
color: #666;
|
||||
@@ -161,11 +214,13 @@ const addInvitation = () => {
|
||||
content: '';
|
||||
position: absolute;
|
||||
bottom: -2px;
|
||||
left: 50%;
|
||||
left: 18%;
|
||||
transform: translateX(-50%);
|
||||
width: 40px;
|
||||
height: 2px;
|
||||
background-color: #007aff;
|
||||
width: 64px;
|
||||
height: 4px;
|
||||
border-radius: 6rpx;
|
||||
background-color: #2F77FD;
|
||||
/* background-color: linear-gradient(to bottom, #2F77FD, #CEDFFF); */
|
||||
}
|
||||
|
||||
/* 列表容器 */
|
||||
@@ -176,7 +231,7 @@ const addInvitation = () => {
|
||||
/* 访客列表项 */
|
||||
.visitor-item {
|
||||
background-color: #fff;
|
||||
margin: 10px 15px;
|
||||
margin: 10px 0px;
|
||||
padding: 15px;
|
||||
border-radius: 8px;
|
||||
}
|
||||
|
||||
BIN
property-uniapp-project/static/首页/arr-left.png
Normal file
BIN
property-uniapp-project/static/首页/arr-left.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 440 B |
Reference in New Issue
Block a user