优化登录,修改bug
This commit is contained in:
@@ -27,7 +27,11 @@
|
|||||||
"Bash(sed -i '232s/^\t\t /\\\\t\\\\t/' pages/index/index.vue)",
|
"Bash(sed -i '232s/^\t\t /\\\\t\\\\t/' pages/index/index.vue)",
|
||||||
"Bash(sed -i '233s/^\t\t /\\\\t\\\\t\\\\t/' pages/index/index.vue)",
|
"Bash(sed -i '233s/^\t\t /\\\\t\\\\t\\\\t/' pages/index/index.vue)",
|
||||||
"Bash(awk 'NR==235 { print substr\\($0, 2\\); next } 1' \"D:/wuye-jumin-front/property-uniapp-project/pages.json\")",
|
"Bash(awk 'NR==235 { print substr\\($0, 2\\); next } 1' \"D:/wuye-jumin-front/property-uniapp-project/pages.json\")",
|
||||||
"Bash(mv /tmp/pages_temp.json \"D:/wuye-jumin-front/property-uniapp-project/pages.json\")"
|
"Bash(mv /tmp/pages_temp.json \"D:/wuye-jumin-front/property-uniapp-project/pages.json\")",
|
||||||
|
"Bash(sed -i '32,36s/.*//' App.vue)",
|
||||||
|
"Bash(sed -i '32d;33d;34d;35d;36d' App.vue)",
|
||||||
|
"Bash(perl -i -pe 's/\\\\\\\\t\\\\t\\\\t\\\\t\\\\t\"disableScroll\": true/\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\"disableScroll\": true/' pages.json)",
|
||||||
|
"Bash(perl -i -pe 's/^t\\\\t\\\\t\\\\t\\\\t\"disableScroll\"/\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\"disableScroll\"/' pages.json)"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,27 +10,25 @@
|
|||||||
console.log('App 启动')
|
console.log('App 启动')
|
||||||
uni.onPushMessage((res) => {
|
uni.onPushMessage((res) => {
|
||||||
console.log("收到推送消息:",res) //监听推送消息
|
console.log("收到推送消息:",res) //监听推送消息
|
||||||
})
|
})
|
||||||
|
|
||||||
// #ifdef APP-PLUS
|
// #ifdef APP-PLUS
|
||||||
// 只有 App 平台才获取 CID
|
// 只有 App 平台才获取 CID
|
||||||
getPushCID()
|
getPushCID()
|
||||||
// #endif
|
// #endif
|
||||||
|
|
||||||
// 首页已是入口页:已登录用户不做跳转,直接留首页
|
// 路由分发(同步):所有人先进首页,点击功能再提示登录
|
||||||
// 仅对未登录用户按需跳转到引导页或登录页
|
const token = uni.getStorageSync('token') || ''
|
||||||
const token = uni.getStorageSync('token')
|
|
||||||
const hasShowGuide = uni.getStorageSync('hasShowGuide')
|
const hasShowGuide = uni.getStorageSync('hasShowGuide')
|
||||||
|
|
||||||
|
// 首次使用:标记引导已看过(不再强制引导页),直接进首页
|
||||||
if (!token && !hasShowGuide) {
|
if (!token && !hasShowGuide) {
|
||||||
// 首次使用:跳转引导页
|
console.log('首次启动,标记引导已看过,进入首页')
|
||||||
console.log('首次启动,跳转引导页')
|
uni.setStorageSync('hasShowGuide', true)
|
||||||
uni.reLaunch({ url: '/pages/navigation/navigation' })
|
|
||||||
} else if (!token && hasShowGuide) {
|
|
||||||
// 已看过引导但未登录:跳转登录页
|
|
||||||
console.log('已看过引导页,跳转登录页')
|
|
||||||
uni.reLaunch({ url: '/pageSubPack/loginSub/pwd-login' })
|
|
||||||
}
|
}
|
||||||
// 有 token:已在首页,不做跳转
|
|
||||||
|
// 所有人统一进首页
|
||||||
|
console.log('进入首页(hasToken=' + !!token + ')')
|
||||||
})
|
})
|
||||||
onShow((options) => {
|
onShow((options) => {
|
||||||
console.log('App Show', options)
|
console.log('App Show', options)
|
||||||
|
|||||||
@@ -57,6 +57,12 @@ export const deleteMyHouse = (data) => {
|
|||||||
export const setMyHouseDefault = (data) => {
|
export const setMyHouseDefault = (data) => {
|
||||||
return post(`/api/resident/my/house/default`, data)
|
return post(`/api/resident/my/house/default`, data)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 添加房屋与业主关系-下拉数据
|
||||||
|
export const getHouseDataList = (data) => {
|
||||||
|
return get(`/api/resident/my/house/dataList`, data)
|
||||||
|
}
|
||||||
|
|
||||||
// 获取当前用户登录信息
|
// 获取当前用户登录信息
|
||||||
export const getUserProfile = (data) => {
|
export const getUserProfile = (data) => {
|
||||||
return get(`/api/resident/user/profile`, data)
|
return get(`/api/resident/user/profile`, data)
|
||||||
|
|||||||
@@ -13,15 +13,20 @@ export default function request(url, data = {}, method = "GET") {
|
|||||||
// mask: true
|
// mask: true
|
||||||
// });
|
// });
|
||||||
|
|
||||||
|
const token = uni.getStorageSync("token") || "";
|
||||||
|
const header = {
|
||||||
|
"clientid": "resident",
|
||||||
|
'content-type': 'application/json'
|
||||||
|
};
|
||||||
|
if (token) {
|
||||||
|
header["Authorization"] = "Bearer " + token;
|
||||||
|
}
|
||||||
|
|
||||||
uni.request({
|
uni.request({
|
||||||
url: baseUrl + url,
|
url: baseUrl + url,
|
||||||
data: data,
|
data: data,
|
||||||
method: method,
|
method: method,
|
||||||
header: {
|
header,
|
||||||
"Authorization": "Bearer " + (uni.getStorageSync("token") || ''),
|
|
||||||
"clientid": "resident",
|
|
||||||
'content-type': 'application/json'
|
|
||||||
},
|
|
||||||
success: (res) => {
|
success: (res) => {
|
||||||
// uni.hideLoading();
|
// uni.hideLoading();
|
||||||
|
|
||||||
@@ -33,13 +38,12 @@ export default function request(url, data = {}, method = "GET") {
|
|||||||
|
|
||||||
const resData = res.data || {};
|
const resData = res.data || {};
|
||||||
|
|
||||||
// token 过期
|
// token 过期:仅在有 token 且过期时跳转登录页(无 token 用户正常浏览首页,由点击拦截处理)
|
||||||
if (resData.code === 401) {
|
if (resData.code === 401) {
|
||||||
uni.showToast({ title: '登录过期,请重新登录', icon: 'none' });
|
if (token) {
|
||||||
uni.clearStorageSync('token');
|
uni.clearStorageSync('token');
|
||||||
setTimeout(() => {
|
uni.reLaunch({ url: '/pageSubPack/loginSub/login?mode=pwd' });
|
||||||
uni.reLaunch({ url: '/pageSubPack/loginSub/pwd-login' });
|
}
|
||||||
}, 1500);
|
|
||||||
reject({ msg: '登录过期', code: 401 });
|
reject({ msg: '登录过期', code: 401 });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -69,14 +73,19 @@ export const putMethod = (url, data) => request(url, data, 'PUT');
|
|||||||
// 上传
|
// 上传
|
||||||
export const upload = (filePath, url) => {
|
export const upload = (filePath, url) => {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
|
const t = uni.getStorageSync("token") || "";
|
||||||
|
const uploadHeader = {
|
||||||
|
"clientid": "resident"
|
||||||
|
};
|
||||||
|
if (t) {
|
||||||
|
uploadHeader["Authorization"] = "Bearer " + t;
|
||||||
|
}
|
||||||
|
|
||||||
uni.uploadFile({
|
uni.uploadFile({
|
||||||
url: baseUrl + url,
|
url: baseUrl + url,
|
||||||
filePath: filePath,
|
filePath: filePath,
|
||||||
name: 'file',
|
name: 'file',
|
||||||
header: {
|
header: uploadHeader,
|
||||||
"Authorization": "Bearer " + (uni.getStorageSync("token") || ''),
|
|
||||||
"clientid": "resident"
|
|
||||||
},
|
|
||||||
success: (res) => {
|
success: (res) => {
|
||||||
try {
|
try {
|
||||||
const data = JSON.parse(res.data);
|
const data = JSON.parse(res.data);
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
// 服务器地址(与 request.js 保持一致)
|
// 服务器地址(与 request.js 保持一致)
|
||||||
const baseUrl = 'https://wuyeapi.ckdzkj.com';
|
// const baseUrl = 'https://wuyeapi.ckdzkj.com';
|
||||||
|
const baseUrl = "http://192.168.1.222:8080"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 图片上传 Hook
|
* 图片上传 Hook
|
||||||
|
|||||||
@@ -2,10 +2,10 @@
|
|||||||
<view class="reset-pwd-page">
|
<view class="reset-pwd-page">
|
||||||
<view class="status_bar"></view>
|
<view class="status_bar"></view>
|
||||||
<!-- 顶部导航栏 -->
|
<!-- 顶部导航栏 -->
|
||||||
<view class="nav-bar">
|
<!-- <view class="nav-bar">
|
||||||
<uni-icons type="left" size="28" color="#333" @click="goBack"></uni-icons>
|
<uni-icons type="left" size="28" color="#333" @click="goBack"></uni-icons>
|
||||||
<view class="nav-title">修改密码</view>
|
<view class="nav-title">修改密码</view>
|
||||||
</view>
|
</view> -->
|
||||||
|
|
||||||
<!-- 密码提示 -->
|
<!-- 密码提示 -->
|
||||||
<view class="pwd-tips">密码为 6-16 位,需同时包含字母和数字</view>
|
<view class="pwd-tips">密码为 6-16 位,需同时包含字母和数字</view>
|
||||||
@@ -13,14 +13,14 @@
|
|||||||
<!-- 新密码输入框 -->
|
<!-- 新密码输入框 -->
|
||||||
<view class="input-item">
|
<view class="input-item">
|
||||||
<uni-easyinput class="input-content" type="password" v-model="newPassword"
|
<uni-easyinput class="input-content" type="password" v-model="newPassword"
|
||||||
placeholder="请输入密码" :inputBorder="false" :placeholderStyle="placeholderStyle">
|
placeholder="请输入密码" :inputBorder="false" maxlength="16" :placeholderStyle="placeholderStyle">
|
||||||
</uni-easyinput>
|
</uni-easyinput>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 确认密码输入框 -->
|
<!-- 确认密码输入框 -->
|
||||||
<view class="input-item">
|
<view class="input-item">
|
||||||
<uni-easyinput class="input-content" type="password" v-model="confirmPassword"
|
<uni-easyinput class="input-content" type="password" v-model="confirmPassword"
|
||||||
placeholder="请再次输入密码" :inputBorder="false" :placeholderStyle="placeholderStyle">
|
placeholder="请再次输入密码" :inputBorder="false" maxlength="16" :placeholderStyle="placeholderStyle">
|
||||||
</uni-easyinput>
|
</uni-easyinput>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
@@ -95,7 +95,7 @@ const handleConfirm = () => {
|
|||||||
//uni.setStorageSync('token', res.token); // 假设后端返回token字段
|
//uni.setStorageSync('token', res.token); // 假设后端返回token字段
|
||||||
uni.showToast({ title: '修改成功', icon: 'success' });
|
uni.showToast({ title: '修改成功', icon: 'success' });
|
||||||
setTimeout(() =>{
|
setTimeout(() =>{
|
||||||
uni.navigateTo({ url: '/pageSubPack/loginSub/pwd-login' });
|
uni.navigateTo({ url: '/pageSubPack/loginSub/login?mode=pwd' });
|
||||||
},1500)
|
},1500)
|
||||||
|
|
||||||
}else{
|
}else{
|
||||||
@@ -116,7 +116,9 @@ const handleConfirm = () => {
|
|||||||
/* 页面容器 */
|
/* 页面容器 */
|
||||||
.reset-pwd-page {
|
.reset-pwd-page {
|
||||||
padding: 20rpx 40rpx 40rpx;
|
padding: 20rpx 40rpx 40rpx;
|
||||||
min-height: 100vh;
|
height: 100vh;
|
||||||
|
overflow: hidden;
|
||||||
|
box-sizing: border-box;
|
||||||
background: repeating-linear-gradient(180deg, #E2F0FF, #F6FAFF );
|
background: repeating-linear-gradient(180deg, #E2F0FF, #F6FAFF );
|
||||||
}
|
}
|
||||||
.status_bar{
|
.status_bar{
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="forget-page">
|
<view class="forget-page">
|
||||||
<view class="status_bar"></view>
|
<view class="status_bar"></view>
|
||||||
<view class="nav-bar">
|
<!-- <view class="nav-bar">
|
||||||
<uni-icons type="left" size="28" color="#333" @click="goBack"></uni-icons>
|
<uni-icons type="left" size="28" color="#333" @click="goBack"></uni-icons>
|
||||||
<view class="nav-title">忘记密码</view>
|
<view class="nav-title">忘记密码</view>
|
||||||
</view>
|
</view> -->
|
||||||
<!-- 手机号输入框 -->
|
<!-- 手机号输入框 -->
|
||||||
<view class="input-item">
|
<view class="input-item">
|
||||||
<view class="input-icon">
|
<view class="input-icon">
|
||||||
<image src="http://47.104.199.163:9090/images/login/phone.png" mode="" style="height: 100%;width: 100%;"></image>
|
<image src="http://47.104.199.163:9090/images/login/phone.png" mode="" style="height: 100%;width: 100%;"></image>
|
||||||
</view>
|
</view>
|
||||||
<uni-easyinput class="input-content" type="number" v-model="phoneNumber" trim="all"
|
<uni-easyinput class="input-content" type="number" v-model="phoneNumber" @input="phoneNumber = phoneNumber.replace(/\D/g, '')" trim="all"
|
||||||
placeholder="请输入手机号" :inputBorder="false" maxlength="11" :placeholderStyle="placeholderStyle">
|
placeholder="请输入手机号" :inputBorder="false" maxlength="11" :placeholderStyle="placeholderStyle">
|
||||||
</uni-easyinput>
|
</uni-easyinput>
|
||||||
</view>
|
</view>
|
||||||
@@ -20,7 +20,7 @@
|
|||||||
<image src="http://47.104.199.163:9090/images/login/code.png" mode="" style="height: 100%;width: 100%;"></image>
|
<image src="http://47.104.199.163:9090/images/login/code.png" mode="" style="height: 100%;width: 100%;"></image>
|
||||||
<!-- <uni-icons type="locked" size="24" color="#999"></uni-icons> -->
|
<!-- <uni-icons type="locked" size="24" color="#999"></uni-icons> -->
|
||||||
</view>
|
</view>
|
||||||
<uni-easyinput class="input-content verify-input" type="number" v-model="verifyCode" trim="all"
|
<uni-easyinput class="input-content verify-input" type="number" v-model="verifyCode" @input="verifyCode = verifyCode.replace(/\D/g, '')" trim="all"
|
||||||
placeholder="请输入验证码" :inputBorder="false" maxlength="6" :placeholderStyle="placeholderStyle">
|
placeholder="请输入验证码" :inputBorder="false" maxlength="6" :placeholderStyle="placeholderStyle">
|
||||||
</uni-easyinput>
|
</uni-easyinput>
|
||||||
<button
|
<button
|
||||||
@@ -131,7 +131,9 @@ const goBack = () => {
|
|||||||
<style scoped>
|
<style scoped>
|
||||||
.forget-page{
|
.forget-page{
|
||||||
padding: 20rpx 40rpx 40rpx;
|
padding: 20rpx 40rpx 40rpx;
|
||||||
min-height: 100vh;
|
height: 100vh;
|
||||||
|
overflow: hidden;
|
||||||
|
box-sizing: border-box;
|
||||||
background: repeating-linear-gradient(180deg, #E2F0FF, #F6FAFF );
|
background: repeating-linear-gradient(180deg, #E2F0FF, #F6FAFF );
|
||||||
}
|
}
|
||||||
.status_bar{
|
.status_bar{
|
||||||
|
|||||||
@@ -1,72 +1,82 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="login-page">
|
<view class="login-page">
|
||||||
<view class="status_bar"></view>
|
<view class="status_bar"></view>
|
||||||
|
|
||||||
<!-- 登录标题 -->
|
<!-- 登录标题 -->
|
||||||
<view class="login-title">手机验证码登录</view>
|
<view class="login-title">{{ loginMode === 'sms' ? '手机验证码登录' : '账号密码登录' }}</view>
|
||||||
|
|
||||||
<!-- 手机号输入框 -->
|
<!-- ====== 验证码登录模式 ====== -->
|
||||||
<view class="input-item">
|
<template v-if="loginMode === 'sms'">
|
||||||
<view class="input-icon">
|
<!-- 手机号输入框 -->
|
||||||
<!-- <uni-icons type="phone" size="24" color="#999"></uni-icons> -->
|
<view class="input-item">
|
||||||
<image src="https://wuyeadmin.bugtc.com/images/login/phone.png" mode="" style="height: 100%;width: 100%;"></image>
|
<view class="input-icon">
|
||||||
|
<image src="https://wuyeadmin.bugtc.com/images/login/phone.png" mode="" style="height: 100%;width: 100%;"></image>
|
||||||
|
</view>
|
||||||
|
<uni-easyinput class="input-content" type="number" v-model="phoneNumber"
|
||||||
|
@input="phoneNumber = phoneNumber.replace(/\D/g, '')"
|
||||||
|
placeholder="请输入手机号" :inputBorder="false" maxlength="11" :placeholderStyle="placeholderStyle">
|
||||||
|
</uni-easyinput>
|
||||||
</view>
|
</view>
|
||||||
<uni-easyinput class="input-content" type="number" v-model="phoneNumber"
|
|
||||||
placeholder="请输入手机号" :inputBorder="false" maxlength="11" :placeholderStyle="placeholderStyle">
|
|
||||||
</uni-easyinput>
|
|
||||||
|
|
||||||
</view>
|
<!-- 验证码输入框 + 获取验证码按钮 -->
|
||||||
|
<view class="input-item verify-item">
|
||||||
<!-- 验证码输入框 + 获取验证码按钮 -->
|
<view class="input-icon">
|
||||||
<view class="input-item verify-item">
|
<image src="https://wuyeadmin.bugtc.com/images/login/code.png" mode="" style="height: 100%;width: 100%;"></image>
|
||||||
<view class="input-icon">
|
</view>
|
||||||
<image src="https://wuyeadmin.bugtc.com/images/login/code.png" mode="" style="height: 100%;width: 100%;"></image>
|
<uni-easyinput class="input-content verify-input" type="number" v-model="verifyCode"
|
||||||
|
@input="verifyCode = verifyCode.replace(/\D/g, '')"
|
||||||
|
placeholder="请输入验证码" :inputBorder="false" maxlength="6" :placeholderStyle="placeholderStyle">
|
||||||
|
</uni-easyinput>
|
||||||
|
<button class="get-verify-btn" :disabled="!canGetVerify || countDown > 0" @click="getVerifyCode">
|
||||||
|
{{ countDown > 0 ? `${countDown}s后重新获取` : '获取验证码' }}
|
||||||
|
</button>
|
||||||
</view>
|
</view>
|
||||||
<uni-easyinput class="input-content verify-input" type="number" v-model="verifyCode"
|
</template>
|
||||||
placeholder="请输入验证码" :inputBorder="false" maxlength="6" :placeholderStyle="placeholderStyle">
|
|
||||||
</uni-easyinput>
|
|
||||||
<button
|
|
||||||
class="get-verify-btn"
|
|
||||||
:disabled="!canGetVerify || countDown > 0"
|
|
||||||
@click="getVerifyCode"
|
|
||||||
>
|
|
||||||
{{ countDown > 0 ? `${countDown}s后重新获取` : '获取验证码' }}
|
|
||||||
</button>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
<!-- 协议勾选 -->
|
<!-- ====== 账号密码登录模式 ====== -->
|
||||||
<view class="agreement-item" >
|
<template v-if="loginMode === 'pwd'">
|
||||||
<view @click="toggleAgreement">
|
<!-- 账号输入框 -->
|
||||||
<uni-icons
|
<view class="input-item">
|
||||||
type="checkbox-filled"
|
<view class="input-icon">
|
||||||
size="24"
|
<image src="https://wuyeadmin.bugtc.com/images/login/phone.png" mode="" style="height: 100%;width: 100%;"></image>
|
||||||
color="#007aff"
|
</view>
|
||||||
v-if="agreeAgreement"
|
<uni-easyinput class="input-content" type="text" v-model="account"
|
||||||
></uni-icons>
|
placeholder="请输入帐号" :inputBorder="false" maxlength="16" :placeholderStyle="placeholderStyle">
|
||||||
<uni-icons
|
</uni-easyinput>
|
||||||
type="checkbox"
|
</view>
|
||||||
size="24"
|
|
||||||
color="#999"
|
<!-- 密码输入框 -->
|
||||||
v-else
|
<view class="input-item">
|
||||||
></uni-icons>
|
<view class="input-icon">
|
||||||
</view>
|
<image src="https://wuyeadmin.bugtc.com/images/login/password.png" mode="" style="height: 100%;width: 100%;"></image>
|
||||||
<text class="agreement-text" >我已阅读并同意
|
</view>
|
||||||
<text class="agreePrivacy" @click.stop="goToUserAgreement">《用户协议》</text>和
|
<uni-easyinput class="input-content" type="password" v-model="password"
|
||||||
<text class="agreePrivacy" @click.stop="goToPrivacy">《隐私政策》</text>
|
placeholder="请输入密码" :inputBorder="false" maxlength="16" :placeholderStyle="placeholderStyle">
|
||||||
</text>
|
</uni-easyinput>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<!-- 协议勾选 + 忘记密码 -->
|
||||||
|
<view class="agreement-wrap">
|
||||||
|
<view class="agreement-item">
|
||||||
|
<view @click="toggleAgreement" class="checkbox-icon">
|
||||||
|
<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>
|
||||||
|
</view>
|
||||||
|
<text class="agreement-text">我已阅读并同意
|
||||||
|
<text class="agreePrivacy" @click.stop="goToUserAgreement">《用户协议》</text>和
|
||||||
|
<text class="agreePrivacy" @click.stop="goToPrivacy">《隐私政策》</text>
|
||||||
|
</text>
|
||||||
|
</view>
|
||||||
|
<text class="forget-pwd" v-if="loginMode === 'pwd'" @click="goForgetPwd">忘记密码?</text>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 登录按钮 -->
|
<!-- 登录按钮 -->
|
||||||
<button
|
<button class="login-btn" @click="handleLogin">登录</button>
|
||||||
class="login-btn"
|
|
||||||
@click="handleLogin"
|
|
||||||
>
|
|
||||||
登录
|
|
||||||
</button>
|
|
||||||
|
|
||||||
<!-- 底部链接 -->
|
<!-- 底部链接 -->
|
||||||
<view class="bottom-link">
|
<view class="bottom-link">
|
||||||
<navigator class="link-item" url="/pageSubPack/loginSub/pwd-login">账号密码登录</navigator>
|
<text class="link-item" @click="switchMode">{{ loginMode === 'sms' ? '账号密码登录' : '验证码登录' }}</text>
|
||||||
<navigator class="link-item" url="/pageSubPack/loginSub/register-new-user">注册新用户</navigator>
|
<navigator class="link-item" url="/pageSubPack/loginSub/register-new-user">注册新用户</navigator>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
@@ -77,51 +87,50 @@
|
|||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, computed, onUnmounted } from 'vue';
|
import { ref, computed, onUnmounted } from 'vue';
|
||||||
import {getLoginBySms,getSendCode} from '../api/api.js'
|
import { onLoad } from '@dcloudio/uni-app'
|
||||||
|
import { getLoginBySms, getLoginPassword, getSendCode } from '../api/api.js'
|
||||||
import PrivacyPopup from '@/components/privacy-popup/privacy-popup.vue'
|
import PrivacyPopup from '@/components/privacy-popup/privacy-popup.vue'
|
||||||
|
|
||||||
|
// ========== 模式切换 ==========
|
||||||
|
// 'sms' = 手机验证码登录, 'pwd' = 账号密码登录
|
||||||
|
const loginMode = ref('pwd')
|
||||||
|
|
||||||
// ========== 响应式数据 ==========
|
// ========== 响应式数据 ==========
|
||||||
// 手机号
|
const phoneNumber = ref('') // 短信登录:手机号
|
||||||
const phoneNumber = ref('');
|
const verifyCode = ref('') // 短信登录:验证码
|
||||||
// 验证码
|
const account = ref('') // 密码登录:账号
|
||||||
const verifyCode = ref('');
|
const password = ref('') // 密码登录:密码
|
||||||
|
const agreeAgreement = ref(false)
|
||||||
const placeholderStyle = ref('font-size:24rpx')
|
const placeholderStyle = ref('font-size:24rpx')
|
||||||
// 是否同意协议
|
|
||||||
const agreeAgreement = ref(false); // 默认不勾选
|
// 验证码倒计时
|
||||||
// 倒计时(秒)
|
const countDown = ref(0)
|
||||||
const countDown = ref(0);
|
let timer = null
|
||||||
// 定时器
|
|
||||||
let timer = null;
|
|
||||||
// 隐私弹窗
|
// 隐私弹窗
|
||||||
const showPrivacyPopup = ref(false)
|
const showPrivacyPopup = ref(false)
|
||||||
const pendingAction = ref('')
|
const pendingAction = ref('')
|
||||||
|
|
||||||
|
// ========== onLoad: 读取 mode 参数 ==========
|
||||||
|
onLoad((options) => {
|
||||||
|
if (options && options.mode === 'sms') {
|
||||||
|
loginMode.value = 'sms'
|
||||||
|
} else if (options && options.mode === 'pwd') {
|
||||||
|
loginMode.value = 'pwd'
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
// ========== 计算属性 ==========
|
// ========== 计算属性 ==========
|
||||||
// 是否可以获取验证码(手机号格式正确)
|
// 短信模式:是否可获取验证码
|
||||||
const canGetVerify = computed(() => {
|
const canGetVerify = computed(() => {
|
||||||
// 手机号正则:11位数字,以1开头
|
if (loginMode.value !== 'sms') return false
|
||||||
const phoneReg = /^1[3-9]\d{9}$/;
|
const phoneReg = /^1[3-9]\d{9}$/
|
||||||
return phoneReg.test(phoneNumber.value);
|
return phoneReg.test(phoneNumber.value)
|
||||||
});
|
})
|
||||||
|
|
||||||
// 是否可以登录(手机号+验证码+协议都满足)
|
// ========== 共享方法 ==========
|
||||||
const canLogin = computed(() => {
|
const toggleAgreement = () => { agreeAgreement.value = !agreeAgreement.value }
|
||||||
const phoneReg = /^1[3-9]\d{9}$/;
|
|
||||||
const verifyReg = /^\d{6}$/;
|
|
||||||
return phoneReg.test(phoneNumber.value) && verifyReg.test(verifyCode.value) && agreeAgreement.value;
|
|
||||||
});
|
|
||||||
|
|
||||||
// ========== 方法 ==========
|
|
||||||
// 检查表单状态
|
|
||||||
const checkForm = () => {
|
|
||||||
// 无需额外逻辑,计算属性已实时监听
|
|
||||||
};
|
|
||||||
|
|
||||||
// 切换协议勾选状态
|
|
||||||
const toggleAgreement = () => {
|
|
||||||
agreeAgreement.value = !agreeAgreement.value;
|
|
||||||
};
|
|
||||||
// 打开用户协议
|
|
||||||
const goToUserAgreement = () => {
|
const goToUserAgreement = () => {
|
||||||
// #ifdef APP-PLUS
|
// #ifdef APP-PLUS
|
||||||
plus.runtime.openURL('https://wuye.ckdzkj.com/parivw/ownler_xieyi.html')
|
plus.runtime.openURL('https://wuye.ckdzkj.com/parivw/ownler_xieyi.html')
|
||||||
@@ -131,7 +140,6 @@ const goToUserAgreement = () => {
|
|||||||
// #endif
|
// #endif
|
||||||
}
|
}
|
||||||
|
|
||||||
// 打开隐私政策
|
|
||||||
const goToPrivacy = () => {
|
const goToPrivacy = () => {
|
||||||
// #ifdef APP-PLUS
|
// #ifdef APP-PLUS
|
||||||
plus.runtime.openURL('https://wuye.ckdzkj.com/parivw/owner.html')
|
plus.runtime.openURL('https://wuye.ckdzkj.com/parivw/owner.html')
|
||||||
@@ -140,13 +148,12 @@ const goToPrivacy = () => {
|
|||||||
window.open('https://wuye.ckdzkj.com/parivw/owner.html')
|
window.open('https://wuye.ckdzkj.com/parivw/owner.html')
|
||||||
// #endif
|
// #endif
|
||||||
}
|
}
|
||||||
// 打开隐私弹窗
|
|
||||||
const openPrivacyPopup = (action) => {
|
const openPrivacyPopup = (action) => {
|
||||||
pendingAction.value = action || ''
|
pendingAction.value = action || ''
|
||||||
showPrivacyPopup.value = true
|
showPrivacyPopup.value = true
|
||||||
}
|
}
|
||||||
|
|
||||||
// 同意隐私协议
|
|
||||||
const agreePrivacy = () => {
|
const agreePrivacy = () => {
|
||||||
showPrivacyPopup.value = false
|
showPrivacyPopup.value = false
|
||||||
agreeAgreement.value = true
|
agreeAgreement.value = true
|
||||||
@@ -156,155 +163,140 @@ const agreePrivacy = () => {
|
|||||||
pendingAction.value = ''
|
pendingAction.value = ''
|
||||||
}
|
}
|
||||||
|
|
||||||
// 不同意隐私协议
|
|
||||||
const disagreePrivacy = () => {
|
const disagreePrivacy = () => {
|
||||||
showPrivacyPopup.value = false
|
showPrivacyPopup.value = false
|
||||||
pendingAction.value = ''
|
pendingAction.value = ''
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取验证码
|
// 切换登录模式
|
||||||
|
const switchMode = () => {
|
||||||
|
if (loginMode.value === 'sms') {
|
||||||
|
loginMode.value = 'pwd'
|
||||||
|
} else {
|
||||||
|
loginMode.value = 'sms'
|
||||||
|
}
|
||||||
|
// 重置相关字段
|
||||||
|
agreeAgreement.value = false
|
||||||
|
if (timer) { clearInterval(timer); timer = null }
|
||||||
|
countDown.value = 0
|
||||||
|
}
|
||||||
|
|
||||||
|
// 忘记密码跳转
|
||||||
|
const goForgetPwd = () => {
|
||||||
|
uni.navigateTo({ url: '/pageSubPack/loginSub/forget-pwd' })
|
||||||
|
}
|
||||||
|
|
||||||
|
// ========== 验证码登录:获取验证码 ==========
|
||||||
const getVerifyCode = () => {
|
const getVerifyCode = () => {
|
||||||
if (!canGetVerify.value) return;
|
if (!canGetVerify.value) return
|
||||||
let params = {
|
uni.showLoading({ title: '发送中...', mask: true })
|
||||||
phone:phoneNumber.value,
|
getSendCode({ phone: phoneNumber.value, scene: 'login' }).then(res => {
|
||||||
scene:'login'
|
uni.hideLoading()
|
||||||
}
|
if (res.code === 200) {
|
||||||
uni.showLoading({ title: '发送中...', mask: true });
|
uni.showToast({ title: '验证码已发送', icon: 'success' })
|
||||||
getSendCode(params).then(res =>{
|
countDown.value = 60
|
||||||
if(res.code === 200){
|
timer = setInterval(() => {
|
||||||
uni.hideLoading();
|
countDown.value--
|
||||||
uni.showToast({
|
if (countDown.value <= 0) {
|
||||||
title: '验证码已发送',
|
clearInterval(timer)
|
||||||
icon: 'success'
|
timer = null
|
||||||
});
|
}
|
||||||
// 开始60秒倒计时
|
}, 1000)
|
||||||
countDown.value = 60;
|
} else {
|
||||||
timer = setInterval(() => {
|
uni.showToast({ title: '验证码发送失败', icon: 'none' })
|
||||||
countDown.value--;
|
}
|
||||||
if (countDown.value <= 0) {
|
|
||||||
clearInterval(timer);
|
|
||||||
timer = null;
|
|
||||||
}
|
|
||||||
}, 1000);
|
|
||||||
}else{
|
|
||||||
uni.showToast({
|
|
||||||
title: '验证码发送失败',
|
|
||||||
icon: 'none'
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
uni.hideLoading();
|
uni.hideLoading()
|
||||||
uni.showToast({
|
uni.showToast({ title: err.msg || '网络异常', icon: 'none' })
|
||||||
title: err.msg||'网络异常',
|
|
||||||
icon: 'none'
|
|
||||||
});
|
|
||||||
})
|
})
|
||||||
|
}
|
||||||
|
|
||||||
};
|
// ========== 登录处理(分发) ==========
|
||||||
|
|
||||||
// 登录处理
|
|
||||||
const handleLogin = () => {
|
const handleLogin = () => {
|
||||||
if (!phoneNumber.value) {
|
if (loginMode.value === 'sms') {
|
||||||
uni.showToast({ title: '请输入手机号', icon: 'none' });
|
handleSmsLogin()
|
||||||
return;
|
} else {
|
||||||
}
|
handlePwdLogin()
|
||||||
if (!/^1[3-9]\d{9}$/.test(phoneNumber.value)) {
|
|
||||||
uni.showToast({ title: '请输入正确的手机号', icon: 'none' });
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (!verifyCode.value) {
|
|
||||||
uni.showToast({ title: '请输入验证码', icon: 'none' });
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (!/^\d{6}$/.test(verifyCode.value)) {
|
|
||||||
uni.showToast({ title: '验证码为 6 位数字', icon: 'none' });
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (!agreeAgreement.value) {
|
|
||||||
openPrivacyPopup('login')
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ========== 验证码登录 ==========
|
||||||
|
const handleSmsLogin = () => {
|
||||||
|
if (!phoneNumber.value) { uni.showToast({ title: '请输入手机号', icon: 'none' }); return }
|
||||||
|
if (!/^1[3-9]\d{9}$/.test(phoneNumber.value)) { uni.showToast({ title: '请输入正确的手机号', icon: 'none' }); return }
|
||||||
|
if (!verifyCode.value) { uni.showToast({ title: '请输入验证码', icon: 'none' }); return }
|
||||||
|
if (!/^\d{6}$/.test(verifyCode.value)) { uni.showToast({ title: '验证码为 6 位数字', icon: 'none' }); return }
|
||||||
|
if (!agreeAgreement.value) { openPrivacyPopup('login'); return }
|
||||||
doLogin()
|
doLogin()
|
||||||
};
|
}
|
||||||
|
|
||||||
|
// ========== 密码登录 ==========
|
||||||
|
const handlePwdLogin = () => {
|
||||||
|
if (!account.value) { uni.showToast({ title: '请输入账号', icon: 'none' }); return }
|
||||||
|
if (account.value.length < 4 || account.value.length > 20) { uni.showToast({ title: '账号长度需为 4-20 位', icon: 'none' }); return }
|
||||||
|
if (!password.value) { uni.showToast({ title: '请输入密码', icon: 'none' }); return }
|
||||||
|
if (password.value.length < 6) { uni.showToast({ title: '密码至少输入 6 位', icon: 'none' }); return }
|
||||||
|
if (password.value.length > 16) { uni.showToast({ title: '密码不能超过 16 位', icon: 'none' }); return }
|
||||||
|
if (!agreeAgreement.value) { openPrivacyPopup('login'); return }
|
||||||
|
doLogin()
|
||||||
|
}
|
||||||
|
|
||||||
|
// ========== 执行登录 ==========
|
||||||
const doLogin = () => {
|
const doLogin = () => {
|
||||||
uni.showLoading({ title: '登录中...', mask: true });
|
uni.showLoading({ title: '登录中...', mask: true })
|
||||||
const push_cid = uni.getStorageSync('push_cid')
|
const push_cid = uni.getStorageSync('push_cid')
|
||||||
let params = {
|
|
||||||
phone:phoneNumber.value,
|
if (loginMode.value === 'sms') {
|
||||||
smsCode:verifyCode.value,
|
// 验证码登录
|
||||||
scene:'login',
|
getLoginBySms({ phone: phoneNumber.value, smsCode: verifyCode.value, scene: 'login', cid: push_cid })
|
||||||
cid:push_cid
|
.then(onLoginSuccess).catch(onLoginError)
|
||||||
|
} else {
|
||||||
|
// 密码登录
|
||||||
|
getLoginPassword({ username: account.value, password: password.value, cid: push_cid })
|
||||||
|
.then(onLoginSuccess).catch(onLoginError)
|
||||||
}
|
}
|
||||||
getLoginBySms(params).then(res =>{
|
}
|
||||||
if(res.code === 200){
|
|
||||||
uni.hideLoading();
|
|
||||||
if(res.data){
|
|
||||||
uni.setStorageSync('token', res.data.token);
|
|
||||||
// 存用户ID
|
|
||||||
if(res.data.userId) {
|
|
||||||
uni.setStorageSync('userId', res.data.userId);
|
|
||||||
}
|
|
||||||
// 存当前绑定的小区ID,0 表示未绑定
|
|
||||||
const currentVillageId = res.data.currentVillageId || 0;
|
|
||||||
uni.setStorageSync('currentVillageId', currentVillageId);
|
|
||||||
uni.hideLoading();
|
|
||||||
uni.showToast({ title: '登录成功', icon: 'success' });
|
|
||||||
|
|
||||||
setTimeout(() =>{
|
const onLoginSuccess = (res) => {
|
||||||
uni.switchTab({ url: '/pages/index/index' });
|
if (res.code === 200 && res.data) {
|
||||||
},1500)
|
uni.setStorageSync('token', res.data.token)
|
||||||
}else{
|
if (res.data.userId) { uni.setStorageSync('userId', res.data.userId) }
|
||||||
uni.showToast({ title: '登录失败', icon: 'none' });
|
const currentVillageId = res.data.currentVillageId || 0
|
||||||
}
|
uni.setStorageSync('currentVillageId', currentVillageId)
|
||||||
|
uni.hideLoading()
|
||||||
|
uni.showToast({ title: '登录成功', icon: 'success' })
|
||||||
|
setTimeout(() => { uni.switchTab({ url: '/pages/index/index' }) }, 1500)
|
||||||
|
} else {
|
||||||
|
uni.hideLoading()
|
||||||
|
uni.showToast({ title: res.msg || '登录失败', icon: 'none' })
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}else{
|
const onLoginError = (err) => {
|
||||||
uni.showToast({ title:'登录失败', icon: 'none' });
|
|
||||||
}
|
|
||||||
|
|
||||||
}).catch(err => {
|
|
||||||
uni.hideLoading();
|
|
||||||
uni.showToast({
|
|
||||||
title: err.msg || '网络异常,请重试',
|
|
||||||
icon: 'none'
|
|
||||||
});
|
|
||||||
})
|
|
||||||
|
|
||||||
// 登录成功后上报推送 CID
|
|
||||||
// #ifdef APP-PLUS
|
|
||||||
const cid = uni.getStorageSync('push_cid')
|
|
||||||
if (cid) {
|
|
||||||
reportPushCID(cid)
|
|
||||||
}
|
|
||||||
// #endif
|
|
||||||
|
|
||||||
// setTimeout(() =>{
|
|
||||||
// uni.switchTab({ url: '/pages/index/index' });
|
|
||||||
// },1500)
|
|
||||||
uni.hideLoading()
|
uni.hideLoading()
|
||||||
};
|
uni.showToast({ title: err.msg || '网络异常,请重试', icon: 'none' })
|
||||||
|
}
|
||||||
|
|
||||||
// ========== 生命周期 ==========
|
// ========== 生命周期 ==========
|
||||||
// 页面卸载时清除定时器
|
|
||||||
onUnmounted(() => {
|
onUnmounted(() => {
|
||||||
if (timer) {
|
if (timer) { clearInterval(timer) }
|
||||||
clearInterval(timer);
|
})
|
||||||
}
|
|
||||||
});
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
/* 页面容器 */
|
/* 页面容器 */
|
||||||
.login-page {
|
.login-page {
|
||||||
padding: 80rpx 40rpx 40rpx;
|
padding: 80rpx 40rpx 40rpx;
|
||||||
/* background-color: #f8f9fa; */
|
height: 100vh;
|
||||||
min-height: 100vh;
|
overflow: hidden;
|
||||||
|
box-sizing: border-box;
|
||||||
background: repeating-linear-gradient(to bottom, #E2F0FF, #F6FAFF );
|
background: repeating-linear-gradient(to bottom, #E2F0FF, #F6FAFF );
|
||||||
}
|
}
|
||||||
.status_bar {
|
|
||||||
height: 160px;
|
.status_bar {
|
||||||
width: 100%;
|
height: 160px;
|
||||||
}
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
/* 登录标题 */
|
/* 登录标题 */
|
||||||
.login-title {
|
.login-title {
|
||||||
@@ -335,10 +327,9 @@ onUnmounted(() => {
|
|||||||
|
|
||||||
/* 输入框图标 */
|
/* 输入框图标 */
|
||||||
.input-icon {
|
.input-icon {
|
||||||
width: 50rpx;
|
width: 50rpx;
|
||||||
height: 50rpx;
|
height: 50rpx;
|
||||||
margin-right: 20rpx;
|
margin-right: 20rpx;
|
||||||
color: #999;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 输入框内容 */
|
/* 输入框内容 */
|
||||||
@@ -349,7 +340,7 @@ onUnmounted(() => {
|
|||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 深度覆盖 uni-easyinput 内部默认样式,解决高度偏移 */
|
/* 深度覆盖 uni-easyinput 内部默认样式 */
|
||||||
.input-content :deep(.uni-easyinput__content) {
|
.input-content :deep(.uni-easyinput__content) {
|
||||||
height: 100% !important;
|
height: 100% !important;
|
||||||
min-height: unset !important;
|
min-height: unset !important;
|
||||||
@@ -386,36 +377,56 @@ onUnmounted(() => {
|
|||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 获取验证码按钮禁用状态 */
|
|
||||||
.get-verify-btn:disabled {
|
.get-verify-btn:disabled {
|
||||||
background-color: #ccc;
|
background-color: #ccc;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
border-radius: 50px;
|
border-radius: 50px;
|
||||||
}
|
}
|
||||||
.get-verify-btn::after{
|
|
||||||
border-radius: 50px;
|
.get-verify-btn::after {
|
||||||
|
border-radius: 50px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 协议和忘记密码行 */
|
||||||
|
.agreement-wrap {
|
||||||
|
display: flex;
|
||||||
|
align-items: flex-start;
|
||||||
|
justify-content: space-between;
|
||||||
|
margin: 70rpx 0 28rpx 0;
|
||||||
|
padding: 0 10rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 协议勾选项 */
|
|
||||||
.agreement-item {
|
.agreement-item {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: flex-start;
|
||||||
margin: 70rpx 0 28rpx 0;
|
flex: 1;
|
||||||
padding-left: 10rpx;
|
min-width: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.checkbox-icon {
|
||||||
|
flex-shrink: 0;
|
||||||
|
margin-top: 2rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 协议文本 */
|
|
||||||
.agreement-text {
|
.agreement-text {
|
||||||
font-size: 24rpx;
|
font-size: 24rpx;
|
||||||
color: #666;
|
color: #666;
|
||||||
margin-left: 10rpx;
|
margin-left: 10rpx;
|
||||||
|
line-height: 1.5;
|
||||||
}
|
}
|
||||||
.agreePrivacy{
|
|
||||||
color: #2F77FD;
|
.agreePrivacy {
|
||||||
|
color: #2F77FD;
|
||||||
}
|
}
|
||||||
/* .agreePrivacy.active{
|
|
||||||
color: #2F77FD;
|
.forget-pwd {
|
||||||
} */
|
font-size: 24rpx;
|
||||||
|
color: #666;
|
||||||
|
flex-shrink: 0;
|
||||||
|
margin-left: 16rpx;
|
||||||
|
line-height: 1.5;
|
||||||
|
}
|
||||||
|
|
||||||
/* 登录按钮 */
|
/* 登录按钮 */
|
||||||
.login-btn {
|
.login-btn {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
@@ -428,15 +439,13 @@ onUnmounted(() => {
|
|||||||
margin-bottom: 60rpx;
|
margin-bottom: 60rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 登录按钮禁用状态 */
|
|
||||||
.login-btn:disabled {
|
.login-btn:disabled {
|
||||||
background-color: #99c8ff;
|
background-color: #99c8ff;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
/* border-radius: 50px; */
|
|
||||||
}
|
}
|
||||||
/* 禁用按钮边框 */
|
|
||||||
button:after{
|
button:after {
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 底部链接 */
|
/* 底部链接 */
|
||||||
@@ -446,7 +455,6 @@ button:after{
|
|||||||
padding: 0 20rpx;
|
padding: 0 20rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 链接项 */
|
|
||||||
.link-item {
|
.link-item {
|
||||||
font-size: 28rpx;
|
font-size: 28rpx;
|
||||||
color: #007aff;
|
color: #007aff;
|
||||||
|
|||||||
@@ -1,356 +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="https://wuyeadmin.bugtc.com/images/login/phone.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="https://wuyeadmin.bugtc.com/images/login/password.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">
|
|
||||||
<view @click="toggleAgreement" class="checkbox-icon">
|
|
||||||
<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>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
<text class="agreement-text" >我已阅读并同意
|
|
||||||
<text class="agreePrivacy" @click.stop="goToUserAgreement">《用户协议》</text>和
|
|
||||||
<text class="agreePrivacy" @click.stop="goToPrivacy">《隐私政策》</text>
|
|
||||||
</text>
|
|
||||||
</view>
|
|
||||||
<navigator class="forget-pwd" url="/pageSubPack/loginSub/forget-pwd">忘记密码?</navigator>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
<!-- 登录按钮 -->
|
|
||||||
<button
|
|
||||||
class="login-btn"
|
|
||||||
@click="handleLogin"
|
|
||||||
>
|
|
||||||
登录
|
|
||||||
</button>
|
|
||||||
|
|
||||||
<!-- 底部链接 -->
|
|
||||||
<view class="bottom-link">
|
|
||||||
<navigator class="link-item" url="/pageSubPack/loginSub/login">验证码登录</navigator>
|
|
||||||
<navigator class="link-item" url="/pageSubPack/loginSub/register-new-user">注册新用户</navigator>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<!-- 隐私协议弹窗 -->
|
|
||||||
<privacy-popup v-model:show="showPrivacyPopup" @agree="agreePrivacy" @disagree="disagreePrivacy" @close="showPrivacyPopup = false" />
|
|
||||||
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script setup>
|
|
||||||
import { ref, computed } from 'vue';
|
|
||||||
import {onLoad} from "@dcloudio/uni-app"
|
|
||||||
import {getLoginPassword} from '../api/api.js'
|
|
||||||
import PrivacyPopup from '@/components/privacy-popup/privacy-popup.vue'
|
|
||||||
|
|
||||||
// 响应式数据
|
|
||||||
const phoneNumber = ref('');
|
|
||||||
const password = ref('');
|
|
||||||
const agreeAgreement = ref(false); // 默认勾选
|
|
||||||
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 showPrivacyPopup = ref(false)
|
|
||||||
const pendingAction = ref('') // 记录待执行操作,如 'smsLogin'
|
|
||||||
|
|
||||||
// 打开用户协议
|
|
||||||
const goToUserAgreement = () => {
|
|
||||||
// #ifdef APP-PLUS
|
|
||||||
plus.runtime.openURL('https://wuye.ckdzkj.com/parivw/ownler_xieyi.html')
|
|
||||||
// #endif
|
|
||||||
// #ifdef H5
|
|
||||||
window.open('https://wuye.ckdzkj.com/parivw/ownler_xieyi.html')
|
|
||||||
// #endif
|
|
||||||
}
|
|
||||||
|
|
||||||
// 打开隐私政策
|
|
||||||
const goToPrivacy = () => {
|
|
||||||
// #ifdef APP-PLUS
|
|
||||||
plus.runtime.openURL('https://wuye.ckdzkj.com/parivw/owner.html')
|
|
||||||
// #endif
|
|
||||||
// #ifdef H5
|
|
||||||
window.open('https://wuye.ckdzkj.com/parivw/owner.html')
|
|
||||||
// #endif
|
|
||||||
}
|
|
||||||
|
|
||||||
// 打开隐私弹窗(可传入待执行操作标识)
|
|
||||||
const openPrivacyPopup = (action) => {
|
|
||||||
pendingAction.value = action || ''
|
|
||||||
showPrivacyPopup.value = true
|
|
||||||
}
|
|
||||||
|
|
||||||
// 同意隐私协议
|
|
||||||
const agreePrivacy = () => {
|
|
||||||
showPrivacyPopup.value = false
|
|
||||||
agreeAgreement.value = true
|
|
||||||
// 执行之前拦截的操作
|
|
||||||
if (pendingAction.value === 'smsLogin') {
|
|
||||||
uni.navigateTo({ url: '/pageSubPack/loginSub/login' })
|
|
||||||
} else if (pendingAction.value === 'login') {
|
|
||||||
doLogin()
|
|
||||||
}
|
|
||||||
pendingAction.value = ''
|
|
||||||
}
|
|
||||||
|
|
||||||
// 不同意隐私协议
|
|
||||||
const disagreePrivacy = () => {
|
|
||||||
showPrivacyPopup.value = false
|
|
||||||
pendingAction.value = ''
|
|
||||||
}
|
|
||||||
|
|
||||||
// 检查表单
|
|
||||||
const checkForm = () => {};
|
|
||||||
|
|
||||||
|
|
||||||
onLoad(() =>{
|
|
||||||
});
|
|
||||||
|
|
||||||
// 登录逻辑
|
|
||||||
const handleLogin = () => {
|
|
||||||
|
|
||||||
if (!phoneNumber.value) {
|
|
||||||
uni.showToast({ title: '请输入账号', icon: 'none' });
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (phoneNumber.value.length < 4 || phoneNumber.value.length > 16) {
|
|
||||||
uni.showToast({ title: '账号长度需为 4-16 位', icon: 'none' });
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (!password.value) {
|
|
||||||
uni.showToast({ title: '请输入密码', icon: 'none' });
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (password.value.length < 6) {
|
|
||||||
uni.showToast({ title: '密码至少输入 6 位', icon: 'none' });
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (password.value.length > 16) {
|
|
||||||
uni.showToast({ title: '密码不能超过 16 位', icon: 'none' });
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if(!agreeAgreement.value){
|
|
||||||
openPrivacyPopup('login')
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
doLogin()
|
|
||||||
};
|
|
||||||
|
|
||||||
const doLogin = () => {
|
|
||||||
uni.showLoading({ title: '登录中...', mask: true });
|
|
||||||
const push_cid = uni.getStorageSync('push_cid')
|
|
||||||
let params = {
|
|
||||||
username:phoneNumber.value,
|
|
||||||
password:password.value,
|
|
||||||
cid:push_cid
|
|
||||||
}
|
|
||||||
getLoginPassword(params).then(res =>{
|
|
||||||
if(res.code === 200){
|
|
||||||
uni.setStorageSync('token', res.data.token);
|
|
||||||
// 存用户ID
|
|
||||||
if(res.data) {
|
|
||||||
// 存当前绑定的小区ID,0 表示未绑定
|
|
||||||
const currentVillageId = res.data.currentVillageId || 0;
|
|
||||||
uni.setStorageSync('currentVillageId', currentVillageId);
|
|
||||||
uni.setStorageSync('userId',res.data.userId)
|
|
||||||
}
|
|
||||||
uni.hideLoading();
|
|
||||||
uni.showToast({ title: '登录成功', icon: 'success' });
|
|
||||||
setTimeout(() =>{
|
|
||||||
uni.switchTab({
|
|
||||||
url: '/pages/index/index'
|
|
||||||
},2000);
|
|
||||||
})
|
|
||||||
}else{
|
|
||||||
uni.showToast({ title: res.msg, icon: 'none' });
|
|
||||||
}
|
|
||||||
|
|
||||||
}).catch(err => {
|
|
||||||
// console.log('密码登录异常',err)
|
|
||||||
uni.hideLoading();
|
|
||||||
uni.showToast({
|
|
||||||
title: err.msg || '网络异常',
|
|
||||||
icon: 'none'
|
|
||||||
});
|
|
||||||
})
|
|
||||||
};
|
|
||||||
</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: 52rpx;
|
|
||||||
font-weight: 600;
|
|
||||||
color: #333;
|
|
||||||
text-align: center;
|
|
||||||
margin-bottom: 142rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.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%;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 深度覆盖 uni-easyinput 内部默认样式,解决高度偏移 */
|
|
||||||
.input-content :deep(.uni-easyinput__content) {
|
|
||||||
height: 100% !important;
|
|
||||||
min-height: unset !important;
|
|
||||||
padding: 0 !important;
|
|
||||||
background-color: transparent !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.input-content :deep(.uni-easyinput__content-input) {
|
|
||||||
height: 100% !important;
|
|
||||||
min-height: unset !important;
|
|
||||||
padding: 0 !important;
|
|
||||||
line-height: 88rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.agreement-wrap {
|
|
||||||
display: flex;
|
|
||||||
align-items: flex-start;
|
|
||||||
justify-content: space-between;
|
|
||||||
margin: 70rpx 0 28rpx 0;
|
|
||||||
padding: 0 10rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.agreement-item {
|
|
||||||
display: flex;
|
|
||||||
align-items: flex-start;
|
|
||||||
flex: 1;
|
|
||||||
min-width: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.checkbox-icon {
|
|
||||||
flex-shrink: 0;
|
|
||||||
margin-top: 2rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.agreement-text {
|
|
||||||
font-size: 24rpx;
|
|
||||||
color: #666;
|
|
||||||
margin-left: 10rpx;
|
|
||||||
line-height: 1.5;
|
|
||||||
}
|
|
||||||
.agreePrivacy{
|
|
||||||
color: #2F77FD;
|
|
||||||
}
|
|
||||||
|
|
||||||
.forget-pwd {
|
|
||||||
font-size: 24rpx;
|
|
||||||
color: #666;
|
|
||||||
text-decoration: none;
|
|
||||||
flex-shrink: 0;
|
|
||||||
margin-left: 16rpx;
|
|
||||||
line-height: 1.5;
|
|
||||||
}
|
|
||||||
|
|
||||||
.login-btn {
|
|
||||||
width: 100%;
|
|
||||||
height: 88rpx;
|
|
||||||
line-height: 88rpx;
|
|
||||||
background-color: #007aff;
|
|
||||||
color: #fff;
|
|
||||||
border-radius: 8rpx;
|
|
||||||
font-size: 28rpx;
|
|
||||||
margin-bottom: 60rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.login-btn:disabled {
|
|
||||||
background-color: #99c8ff;
|
|
||||||
color: #fff;
|
|
||||||
/* border-radius: 50px; */
|
|
||||||
|
|
||||||
}
|
|
||||||
/* 禁用按钮边框 */
|
|
||||||
button:after{
|
|
||||||
border-radius: 8px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.bottom-link {
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
padding: 0 20rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.link-item {
|
|
||||||
font-size: 28rpx;
|
|
||||||
color: #007aff;
|
|
||||||
text-decoration: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
</style>
|
|
||||||
@@ -2,10 +2,10 @@
|
|||||||
<view class="register-page">
|
<view class="register-page">
|
||||||
<view class="status_bar"></view>
|
<view class="status_bar"></view>
|
||||||
<!-- 顶部导航 -->
|
<!-- 顶部导航 -->
|
||||||
<view class="nav-bar">
|
<!-- <view class="nav-bar">
|
||||||
<uni-icons type="left" size="28" color="#333" @click="goBack"></uni-icons>
|
<uni-icons type="left" size="28" color="#333" @click="goBack"></uni-icons>
|
||||||
<view class="nav-title">注册</view>
|
<view class="nav-title">注册</view>
|
||||||
</view>
|
</view> -->
|
||||||
|
|
||||||
<!-- 注册标题 -->
|
<!-- 注册标题 -->
|
||||||
<view class="register-title">注册用户</view>
|
<view class="register-title">注册用户</view>
|
||||||
@@ -16,9 +16,9 @@
|
|||||||
<image src="https://wuyeadmin.bugtc.com/images/login/phone.png" mode=""
|
<image src="https://wuyeadmin.bugtc.com/images/login/phone.png" mode=""
|
||||||
style="height: 100%;width: 100%;"></image>
|
style="height: 100%;width: 100%;"></image>
|
||||||
</view>
|
</view>
|
||||||
<uni-easyinput class="input-content" type="number" v-model="phoneNumber" placeholder="请输入手机号"
|
<uni-easyinput class="input-content" type="number" v-model="phoneNumber" @input="phoneNumber = phoneNumber.replace(/\D/g, '')" placeholder="请输入手机号"
|
||||||
:inputBorder="false" maxlength="11" :placeholderStyle="placeholderStyle">
|
:inputBorder="false" maxlength="11" :placeholderStyle="placeholderStyle" />
|
||||||
</uni-easyinput>
|
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 验证码输入 + 获取验证码按钮 -->
|
<!-- 验证码输入 + 获取验证码按钮 -->
|
||||||
@@ -28,9 +28,9 @@
|
|||||||
</image>
|
</image>
|
||||||
<!-- <uni-icons type="locked" size="24" color="#999"></uni-icons> -->
|
<!-- <uni-icons type="locked" size="24" color="#999"></uni-icons> -->
|
||||||
</view>
|
</view>
|
||||||
<uni-easyinput class="input-content verify-input" type="number" v-model="verifyCode" placeholder="请输入验证码"
|
<uni-easyinput class="input-content verify-input" type="number" v-model="verifyCode" @input="verifyCode = verifyCode.replace(/\D/g, '')" placeholder="请输入验证码"
|
||||||
:inputBorder="false" maxlength="6" :placeholderStyle="placeholderStyle">
|
:inputBorder="false" maxlength="6" :placeholderStyle="placeholderStyle" />
|
||||||
</uni-easyinput>
|
|
||||||
|
|
||||||
<button class="get-verify-btn" :disabled="!canGetVerify || countDown > 0" @click="getVerifyCode">
|
<button class="get-verify-btn" :disabled="!canGetVerify || countDown > 0" @click="getVerifyCode">
|
||||||
{{ countDown > 0 ? `${countDown}s后重新获取` : '获取验证码' }}
|
{{ countDown > 0 ? `${countDown}s后重新获取` : '获取验证码' }}
|
||||||
@@ -45,8 +45,8 @@
|
|||||||
<!-- <uni-icons type="person" size="24" color="#999"></uni-icons> -->
|
<!-- <uni-icons type="person" size="24" color="#999"></uni-icons> -->
|
||||||
</view>
|
</view>
|
||||||
<uni-easyinput class="input-content" type="text" v-model="account" placeholder="请输入账号(4-20位)" :inputBorder="false"
|
<uni-easyinput class="input-content" type="text" v-model="account" placeholder="请输入账号(4-20位)" :inputBorder="false"
|
||||||
:placeholderStyle="placeholderStyle">
|
maxlength="20" :placeholderStyle="placeholderStyle" />
|
||||||
</uni-easyinput>
|
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
@@ -58,8 +58,8 @@
|
|||||||
<!-- <uni-icons type="locked" size="24" color="#999"></uni-icons> -->
|
<!-- <uni-icons type="locked" size="24" color="#999"></uni-icons> -->
|
||||||
</view>
|
</view>
|
||||||
<uni-easyinput class="input-content" type="password" v-model="password" placeholder="请输入密码(6-16位)"
|
<uni-easyinput class="input-content" type="password" v-model="password" placeholder="请输入密码(6-16位)"
|
||||||
:inputBorder="false" :placeholderStyle="placeholderStyle">
|
:inputBorder="false" maxlength="16" :placeholderStyle="placeholderStyle" />
|
||||||
</uni-easyinput>
|
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
<!-- 协议勾选 -->
|
<!-- 协议勾选 -->
|
||||||
@@ -302,7 +302,7 @@
|
|||||||
});
|
});
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
uni.redirectTo({
|
uni.redirectTo({
|
||||||
url: '/pageSubPack/loginSub/pwd-login'
|
url: '/pageSubPack/loginSub/login?mode=pwd'
|
||||||
});
|
});
|
||||||
}, 1500);
|
}, 1500);
|
||||||
|
|
||||||
@@ -335,7 +335,9 @@
|
|||||||
.register-page {
|
.register-page {
|
||||||
padding: 20rpx 40rpx 40rpx;
|
padding: 20rpx 40rpx 40rpx;
|
||||||
/* background-color: #f8f9fa; */
|
/* background-color: #f8f9fa; */
|
||||||
min-height: 100vh;
|
height: 100vh;
|
||||||
|
overflow: hidden;
|
||||||
|
box-sizing: border-box;
|
||||||
background: repeating-linear-gradient(180deg, #E2F0FF, #F6FAFF);
|
background: repeating-linear-gradient(180deg, #E2F0FF, #F6FAFF);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -10,13 +10,13 @@
|
|||||||
<view class="form-item">
|
<view class="form-item">
|
||||||
<view class="item-label">车牌号</view>
|
<view class="item-label">车牌号</view>
|
||||||
<input class="item-input" v-model="formData.carNum" placeholder="请输入"
|
<input class="item-input" v-model="formData.carNum" placeholder="请输入"
|
||||||
placeholder-class="input-placeholder" />
|
placeholder-class="input-placeholder" maxlength="8" />
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="form-item">
|
<view class="form-item">
|
||||||
<text class="item-label">车辆品牌</text>
|
<text class="item-label">车辆品牌</text>
|
||||||
<input class="item-input" v-model="formData.carBrand" placeholder="请输入"
|
<input class="item-input" v-model="formData.carBrand" placeholder="请输入"
|
||||||
placeholder-class="input-placeholder" />
|
placeholder-class="input-placeholder" maxlength="32"/>
|
||||||
</view>
|
</view>
|
||||||
<!-- <view class="form-item" @click="selectItem('车辆品牌')">
|
<!-- <view class="form-item" @click="selectItem('车辆品牌')">
|
||||||
<text class="item-label">车辆品牌</text>
|
<text class="item-label">车辆品牌</text>
|
||||||
@@ -28,13 +28,13 @@
|
|||||||
<view class="form-item">
|
<view class="form-item">
|
||||||
<view class="item-label">车辆型号</view>
|
<view class="item-label">车辆型号</view>
|
||||||
<input class="item-input" v-model="formData.carModel" placeholder="请输入"
|
<input class="item-input" v-model="formData.carModel" placeholder="请输入"
|
||||||
placeholder-class="input-placeholder" />
|
placeholder-class="input-placeholder" maxlength="32"/>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="form-item">
|
<view class="form-item">
|
||||||
<view class="item-label">车辆颜色</view>
|
<view class="item-label">车辆颜色</view>
|
||||||
<input class="item-input" v-model="formData.carColor" placeholder="请输入"
|
<input class="item-input" v-model="formData.carColor" placeholder="请输入"
|
||||||
placeholder-class="input-placeholder" />
|
placeholder-class="input-placeholder" maxlength="5"/>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="form-item upload-item">
|
<view class="form-item upload-item">
|
||||||
@@ -140,7 +140,6 @@
|
|||||||
title: err.msg || '网络异常',
|
title: err.msg || '网络异常',
|
||||||
icon: 'none'
|
icon: 'none'
|
||||||
})
|
})
|
||||||
console.error('列表接口报错:', err)
|
|
||||||
} finally {
|
} finally {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -90,7 +90,7 @@
|
|||||||
<scroll-view scroll-y class="form-box">
|
<scroll-view scroll-y class="form-box">
|
||||||
<view class="form-item">
|
<view class="form-item">
|
||||||
<text class="label">住户名称</text>
|
<text class="label">住户名称</text>
|
||||||
<input class="input" v-model="form.name" placeholder="请输入真实姓名" placeholder-class="ph" />
|
<input class="input" v-model="form.name" placeholder="请输入真实姓名" placeholder-class="ph" maxlength="20"/>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="form-item">
|
<view class="form-item">
|
||||||
@@ -117,7 +117,7 @@
|
|||||||
|
|
||||||
<view class="form-item">
|
<view class="form-item">
|
||||||
<text class="label">证件号码</text>
|
<text class="label">证件号码</text>
|
||||||
<input class="input" v-model="form.cardNo" placeholder="请输入证件号码" placeholder-class="ph" />
|
<input class="input" v-model="form.cardNo" placeholder="请输入证件号码" placeholder-class="ph" maxlength="18"/>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="form-item arrow-item" @click="openRelation">
|
<view class="form-item arrow-item" @click="openRelation">
|
||||||
@@ -129,7 +129,7 @@
|
|||||||
<view class="form-item phone-item">
|
<view class="form-item phone-item">
|
||||||
<text class="label">手机号码</text>
|
<text class="label">手机号码</text>
|
||||||
<input class="input" v-model="form.phone" placeholder="请输入手机号" placeholder-class="ph"
|
<input class="input" v-model="form.phone" placeholder="请输入手机号" placeholder-class="ph"
|
||||||
type="tel" />
|
type="tel" maxlength="11"/>
|
||||||
<!-- <button class="code-btn" :disabled="cd>0" @click="sendCode">
|
<!-- <button class="code-btn" :disabled="cd>0" @click="sendCode">
|
||||||
{{ cd > 0 ? cd+'s' : '获取验证码' }}
|
{{ cd > 0 ? cd+'s' : '获取验证码' }}
|
||||||
</button> -->
|
</button> -->
|
||||||
@@ -141,7 +141,7 @@
|
|||||||
<view class="form-item">
|
<view class="form-item">
|
||||||
<text class="label">验证码</text>
|
<text class="label">验证码</text>
|
||||||
<input class="input" v-model="form.code" placeholder="请输入6位验证码" placeholder-class="ph"
|
<input class="input" v-model="form.code" placeholder="请输入6位验证码" placeholder-class="ph"
|
||||||
type="number" />
|
type="number" maxlength="6"/>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 身份证上传 -->
|
<!-- 身份证上传 -->
|
||||||
@@ -255,6 +255,7 @@
|
|||||||
getHouseAuthSendSmsCode,
|
getHouseAuthSendSmsCode,
|
||||||
getMyHouseDetail,
|
getMyHouseDetail,
|
||||||
upDateMyHouse,
|
upDateMyHouse,
|
||||||
|
getHouseDataList,
|
||||||
} from '/pageSubPack/api/apiSub.js'
|
} from '/pageSubPack/api/apiSub.js'
|
||||||
import {
|
import {
|
||||||
useImageUpload
|
useImageUpload
|
||||||
@@ -315,35 +316,7 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
const relations = ref([{
|
const relations = ref([])
|
||||||
id: 0,
|
|
||||||
name: '本人'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 1,
|
|
||||||
name: '配偶'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 2,
|
|
||||||
name: '父母'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 3,
|
|
||||||
name: '子女'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 4,
|
|
||||||
name: '亲属'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 5,
|
|
||||||
name: '租户'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 6,
|
|
||||||
name: '其他'
|
|
||||||
}
|
|
||||||
])
|
|
||||||
|
|
||||||
const upDataListNum = ref(0)
|
const upDataListNum = ref(0)
|
||||||
// const idCardFront = ref('')
|
// const idCardFront = ref('')
|
||||||
@@ -495,8 +468,8 @@
|
|||||||
idCardBackUpload.setPreviewUrl(data.data.cardImageBack?.url || data.data.cardImageBack || '')
|
idCardBackUpload.setPreviewUrl(data.data.cardImageBack?.url || data.data.cardImageBack || '')
|
||||||
} else {
|
} else {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: `${res.msg}`,
|
title: res.msg,
|
||||||
icon: 'error'
|
icon: 'none'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
@@ -514,6 +487,7 @@
|
|||||||
clearInterval(timer)
|
clearInterval(timer)
|
||||||
})
|
})
|
||||||
onLoad((option) => {
|
onLoad((option) => {
|
||||||
|
loadRelations()
|
||||||
console.log(uni.getStorageSync('updateHouseId'));
|
console.log(uni.getStorageSync('updateHouseId'));
|
||||||
if (option.id) {
|
if (option.id) {
|
||||||
if (uni.getStorageSync('operationType') == 'update') {
|
if (uni.getStorageSync('operationType') == 'update') {
|
||||||
@@ -560,6 +534,21 @@
|
|||||||
showRelation.value = false
|
showRelation.value = false
|
||||||
upDataListNum.value++
|
upDataListNum.value++
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 获取与业主关系下拉数据
|
||||||
|
const loadRelations = async () => {
|
||||||
|
try {
|
||||||
|
const res = await getHouseDataList({dictType:"com_resident_relationship",dictName:'与业主关系'})
|
||||||
|
if (res.code === 200) {
|
||||||
|
relations.value = (res.rows || []).map(item => ({
|
||||||
|
id: item.dictValue,
|
||||||
|
name: item.dictLabel
|
||||||
|
}))
|
||||||
|
}
|
||||||
|
} catch (err) {
|
||||||
|
console.error('加载与业主关系失败:', err)
|
||||||
|
}
|
||||||
|
}
|
||||||
const selectClick = (item) => {
|
const selectClick = (item) => {
|
||||||
formData.status = item;
|
formData.status = item;
|
||||||
uni.setStorageSync('houseStatus', item)
|
uni.setStorageSync('houseStatus', item)
|
||||||
|
|||||||
@@ -76,7 +76,7 @@ const onDeleteAccount = () => {
|
|||||||
uni.showToast({ title: '注销成功', icon: 'success' })
|
uni.showToast({ title: '注销成功', icon: 'success' })
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
uni.redirectTo({
|
uni.redirectTo({
|
||||||
url: '/pageSubPack/loginSub/pwd-login'
|
url: '/pageSubPack/loginSub/login?mode=pwd'
|
||||||
})
|
})
|
||||||
}, 1500)
|
}, 1500)
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -195,7 +195,7 @@
|
|||||||
title: err.msg || '网络异常',
|
title: err.msg || '网络异常',
|
||||||
icon: 'none'
|
icon: 'none'
|
||||||
})
|
})
|
||||||
console.error('列表接口报错:', err)
|
// console.error('列表接口报错:', err)
|
||||||
} finally {
|
} finally {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -298,6 +298,8 @@
|
|||||||
border-radius: 20rpx;
|
border-radius: 20rpx;
|
||||||
box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.05);
|
box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.05);
|
||||||
transition: all 0.2s ease;
|
transition: all 0.2s ease;
|
||||||
|
overflow: hidden;
|
||||||
|
min-width: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 选中状态 */
|
/* 选中状态 */
|
||||||
@@ -315,6 +317,9 @@
|
|||||||
font-size: 32rpx;
|
font-size: 32rpx;
|
||||||
color: #333;
|
color: #333;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
|
white-space: nowrap;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 成功提示弹窗 */
|
/* 成功提示弹窗 */
|
||||||
|
|||||||
@@ -62,7 +62,7 @@
|
|||||||
}else {
|
}else {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: `${res.msg}`,
|
title: `${res.msg}`,
|
||||||
icon: 'error'
|
icon: 'none'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@@ -86,7 +86,7 @@
|
|||||||
}else {
|
}else {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: `${res.msg}`,
|
title: `${res.msg}`,
|
||||||
icon: 'error'
|
icon: 'none'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@@ -105,10 +105,7 @@
|
|||||||
content: '确认选择此' + checkType.value + '吗?',
|
content: '确认选择此' + checkType.value + '吗?',
|
||||||
success: (res) => {
|
success: (res) => {
|
||||||
if (res.confirm) {
|
if (res.confirm) {
|
||||||
uni.showLoading({
|
|
||||||
title: '选择中...',
|
|
||||||
mask: true
|
|
||||||
})
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '选择成功',
|
title: '选择成功',
|
||||||
@@ -129,7 +126,6 @@
|
|||||||
}
|
}
|
||||||
}, 1000)
|
}, 1000)
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
uni.hideLoading()
|
|
||||||
goFreash()
|
goFreash()
|
||||||
}, 2500)
|
}, 2500)
|
||||||
}
|
}
|
||||||
@@ -190,12 +186,7 @@
|
|||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
|
|
||||||
.parkingLot-grid {
|
|
||||||
display: grid;
|
|
||||||
|
|
||||||
grid-template-columns: repeat(3, 1fr);
|
|
||||||
gap: 30rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.empty-state {
|
.empty-state {
|
||||||
display: flex;
|
display: flex;
|
||||||
@@ -212,6 +203,15 @@
|
|||||||
margin-top: 20rpx;
|
margin-top: 20rpx;
|
||||||
margin-bottom: 10rpx;
|
margin-bottom: 10rpx;
|
||||||
}
|
}
|
||||||
|
.parkingLot-grid {
|
||||||
|
/* display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
gap: 30rpx; */
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: repeat(3, 1fr);
|
||||||
|
gap: 30rpx
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
.parkingLot-item {
|
.parkingLot-item {
|
||||||
height: 100rpx;
|
height: 100rpx;
|
||||||
@@ -223,6 +223,9 @@
|
|||||||
border-radius: 20rpx;
|
border-radius: 20rpx;
|
||||||
box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.05);
|
box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.05);
|
||||||
transition: all 0.2s ease;
|
transition: all 0.2s ease;
|
||||||
|
/* padding: 0 24rpx; */
|
||||||
|
overflow: hidden;
|
||||||
|
min-width: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.parkingLot-item.active {
|
.parkingLot-item.active {
|
||||||
@@ -238,5 +241,8 @@
|
|||||||
font-size: 32rpx;
|
font-size: 32rpx;
|
||||||
color: #333;
|
color: #333;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
|
white-space: nowrap;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
@@ -310,7 +310,7 @@
|
|||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
uni.hideLoading();
|
uni.hideLoading();
|
||||||
uni.reLaunch({
|
uni.reLaunch({
|
||||||
url: '/pageSubPack/loginSub/pwd-login'
|
url: '/pageSubPack/loginSub/login?mode=pwd'
|
||||||
});
|
});
|
||||||
}, 1500);
|
}, 1500);
|
||||||
} else {
|
} else {
|
||||||
@@ -320,7 +320,7 @@
|
|||||||
uni.removeStorageSync('currentVillageId');
|
uni.removeStorageSync('currentVillageId');
|
||||||
uni.hideLoading();
|
uni.hideLoading();
|
||||||
uni.reLaunch({
|
uni.reLaunch({
|
||||||
url: '/pageSubPack/loginSub/pwd-login'
|
url: '/pageSubPack/loginSub/login?mode=pwd'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -332,7 +332,7 @@
|
|||||||
uni.removeStorageSync('currentVillageId');
|
uni.removeStorageSync('currentVillageId');
|
||||||
uni.hideLoading();
|
uni.hideLoading();
|
||||||
uni.reLaunch({
|
uni.reLaunch({
|
||||||
url: '/pageSubPack/loginSub/pwd-login'
|
url: '/pageSubPack/loginSub/login?mode=pwd'
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -42,12 +42,6 @@
|
|||||||
<text class="label">预约时间</text>
|
<text class="label">预约时间</text>
|
||||||
<text class="value time-value">{{ showTimeText || '请选择预约时间' }}</text>
|
<text class="value time-value">{{ showTimeText || '请选择预约时间' }}</text>
|
||||||
</view>
|
</view>
|
||||||
<!-- <view class="form-item">
|
|
||||||
<text class="label">预约时间</text>
|
|
||||||
<view class="value" @click="">
|
|
||||||
<uni-datetime-picker type="datetime" v-model="form.datetime" @change="changeTime" />
|
|
||||||
</view>
|
|
||||||
</view> -->
|
|
||||||
|
|
||||||
<!-- 问题照片 -->
|
<!-- 问题照片 -->
|
||||||
<view class="form-item-wenti">
|
<view class="form-item-wenti">
|
||||||
@@ -78,7 +72,7 @@
|
|||||||
<text class="popup-title">预约时间({{ tempTime.format('YYYY-MM-DD HH:mm') }})</text>
|
<text class="popup-title">预约时间({{ tempTime.format('YYYY-MM-DD HH:mm') }})</text>
|
||||||
<text class="confirm-btn" @click="confirmTime">确认</text>
|
<text class="confirm-btn" @click="confirmTime">确认</text>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 时间选择列:日期 | 小时 | 分钟 -->
|
<!-- 时间选择列:日期 | 小时 | 分钟 -->
|
||||||
<view class="time-selector">
|
<view class="time-selector">
|
||||||
<!-- 日期列 -->
|
<!-- 日期列 -->
|
||||||
|
|||||||
@@ -1,8 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="contentStyle" style="">
|
<view class="contentStyle">
|
||||||
<view class="status-bar"></view>
|
|
||||||
<uni-nav-bar title="生活缴费" left-icon="left" @clickLeft="goBack" backgroundColor="transparent" :border="false">
|
|
||||||
</uni-nav-bar>
|
|
||||||
<view class="topbox">
|
<view class="topbox">
|
||||||
<image class="titleImg" src="https://wuyeadmin.bugtc.com/images/propertyImgs/payTitle.png"></image>
|
<image class="titleImg" src="https://wuyeadmin.bugtc.com/images/propertyImgs/payTitle.png"></image>
|
||||||
<image class="payImg" src="https://wuyeadmin.bugtc.com/images/propertyImgs/payImg.png"></image>
|
<image class="payImg" src="https://wuyeadmin.bugtc.com/images/propertyImgs/payImg.png"></image>
|
||||||
@@ -91,29 +88,14 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import {
|
import { ref } from 'vue'
|
||||||
ref,
|
import { onShow, onLoad } from '@dcloudio/uni-app'
|
||||||
onMounted,
|
|
||||||
computed
|
|
||||||
|
|
||||||
} from 'vue'
|
|
||||||
import {
|
|
||||||
onShow,
|
|
||||||
onReady,
|
|
||||||
onReachBottom,
|
|
||||||
onLoad,
|
|
||||||
onUnload,
|
|
||||||
onPullDownRefresh
|
|
||||||
} from '@dcloudio/uni-app'
|
|
||||||
|
|
||||||
import {
|
import {
|
||||||
getTopUpSelectByResident,
|
getTopUpSelectByResident,
|
||||||
postInsertOpenId,
|
|
||||||
postSubscribeAuth,
|
|
||||||
getTopUpDetails,
|
getTopUpDetails,
|
||||||
} from '/pageSubPack/api/apiSub.js'
|
} from '/pageSubPack/api/apiSub.js'
|
||||||
// 响应式数据
|
// 响应式数据
|
||||||
const statusBarHeight = ref(20)
|
|
||||||
const detailslist = ref([])
|
const detailslist = ref([])
|
||||||
const pageNum = ref(1)
|
const pageNum = ref(1)
|
||||||
const pageSize = ref(3)
|
const pageSize = ref(3)
|
||||||
@@ -179,29 +161,6 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
const postOpenId = async () => {
|
|
||||||
// App 端直接从本地存储获取 openid
|
|
||||||
try {
|
|
||||||
const openid = uni.getStorageSync('openid')
|
|
||||||
if (!openid) {
|
|
||||||
uni.showToast({
|
|
||||||
title: '请先登录',
|
|
||||||
icon: 'none'
|
|
||||||
})
|
|
||||||
return
|
|
||||||
}
|
|
||||||
await postInsertOpenId({
|
|
||||||
openid: openid,
|
|
||||||
residentUserId: uni.getStorageSync('userId')
|
|
||||||
})
|
|
||||||
} catch (err) {
|
|
||||||
uni.showToast({
|
|
||||||
title: err.msg || '网络异常',
|
|
||||||
icon: 'none'
|
|
||||||
})
|
|
||||||
// console.error('列表接口报错:', err)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
onShow(() => {
|
onShow(() => {
|
||||||
|
|
||||||
// Zy --------------
|
// Zy --------------
|
||||||
@@ -211,13 +170,8 @@
|
|||||||
// 不再自动请求订阅消息,改为用户点击触发
|
// 不再自动请求订阅消息,改为用户点击触发
|
||||||
})
|
})
|
||||||
// 生命周期
|
// 生命周期
|
||||||
onReady(() => {})
|
|
||||||
|
|
||||||
onLoad(() => {
|
onLoad(() => {
|
||||||
// postOpenId()
|
uni.hideTabBar({ animation: false });
|
||||||
uni.hideTabBar({
|
|
||||||
animation: false // 关闭动画,更稳定
|
|
||||||
});
|
|
||||||
getPayList()
|
getPayList()
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -278,21 +232,6 @@
|
|||||||
uni.setStorageSync('addPaymentType', type.name)
|
uni.setStorageSync('addPaymentType', type.name)
|
||||||
}
|
}
|
||||||
|
|
||||||
const goBack = () => {
|
|
||||||
console.log('返回',uni.getStorageSync('sourcePage'))
|
|
||||||
if (uni.getStorageSync('sourcePage') == 'serviceIndex') {
|
|
||||||
uni.switchTab({
|
|
||||||
url: '/pages/serviceIndex/serviceIndex'
|
|
||||||
})
|
|
||||||
} else if (uni.getStorageSync('sourcePage') == 'index') {
|
|
||||||
uni.switchTab({
|
|
||||||
url: '/pages/index/index'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
uni.removeStorageSync('sourcePage')
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// 获取缴费列表
|
// 获取缴费列表
|
||||||
const getBillDetails = (isLoadMore = false) => {
|
const getBillDetails = (isLoadMore = false) => {
|
||||||
if (isLoadMore) {
|
if (isLoadMore) {
|
||||||
@@ -348,8 +287,9 @@
|
|||||||
.contentStyle {
|
.contentStyle {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
height: 100vh;
|
min-height: 100vh;
|
||||||
background: linear-gradient(180deg, #dfedfd, #F6FAFF);
|
background: linear-gradient(180deg, #dfedfd, #F6FAFF);
|
||||||
|
overflow-x: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
.page {
|
.page {
|
||||||
@@ -557,11 +497,6 @@
|
|||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
}
|
}
|
||||||
|
|
||||||
.status-bar {
|
|
||||||
width: 100vw;
|
|
||||||
height: 46px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.details-scroll {
|
.details-scroll {
|
||||||
max-height: 500rpx;
|
max-height: 500rpx;
|
||||||
margin-bottom: 40rpx;
|
margin-bottom: 40rpx;
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
"path": "pages/index/index",
|
"path": "pages/index/index",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "首页",
|
"navigationBarTitleText": "首页",
|
||||||
"navigationStyle": "custom",
|
// "navigationStyle": "custom",
|
||||||
"navigationBarBackgroundColor": "#F8F8F8"
|
"navigationBarBackgroundColor": "#F8F8F8"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -19,15 +19,15 @@
|
|||||||
{
|
{
|
||||||
"path": "pages/serviceIndex/serviceIndex",
|
"path": "pages/serviceIndex/serviceIndex",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "服务",
|
"navigationBarTitleText": "服务"
|
||||||
"navigationStyle": "custom"
|
// "navigationStyle": "custom"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"path": "pages/myIndex/myIndex",
|
"path": "pages/myIndex/myIndex",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "我的",
|
"navigationBarTitleText": "我的"
|
||||||
"navigationStyle": "custom"
|
// "navigationStyle": "custom"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -38,35 +38,32 @@
|
|||||||
"path": "register-new-user",
|
"path": "register-new-user",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "注册新用户",
|
"navigationBarTitleText": "注册新用户",
|
||||||
"navigationStyle": "custom"
|
// "navigationStyle": "custom",
|
||||||
}
|
"disableScroll": true
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "pwd-login",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "账号密码登录",
|
|
||||||
"navigationStyle": "custom"
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"path": "login",
|
"path": "login",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "验证码登录",
|
"navigationBarTitleText": "验证码登录",
|
||||||
"navigationStyle": "custom"
|
"navigationStyle": "custom",
|
||||||
|
"disableScroll": true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"path": "forget-pwd",
|
"path": "forget-pwd",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "忘记密码",
|
"navigationBarTitleText": "忘记密码",
|
||||||
"navigationStyle": "custom"
|
// "navigationStyle": "custom",
|
||||||
|
"disableScroll": true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"path": "change-pwd",
|
"path": "change-pwd",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "修改密码",
|
"navigationBarTitleText": "修改密码",
|
||||||
"navigationStyle": "custom"
|
// "navigationStyle": "custom",
|
||||||
|
"disableScroll": true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -398,8 +395,14 @@
|
|||||||
{
|
{
|
||||||
"path": "paymentIndex",
|
"path": "paymentIndex",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "",
|
"navigationBarTitleText": "生活缴费",
|
||||||
"navigationStyle": "custom"
|
"navigationBarBackgroundColor": "#dfedfd",
|
||||||
|
"navigationBarTextStyle": "black",
|
||||||
|
"app-plus": {
|
||||||
|
"titleNView": {
|
||||||
|
"autoBackButton": true
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
"path": "addHydropower",
|
"path": "addHydropower",
|
||||||
|
|||||||
@@ -1,25 +1,22 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="content-class">
|
<view class="content-class">
|
||||||
|
<!-- 首次加载遮罩 -->
|
||||||
|
<view class="loading-mask" v-if="!pageReady">
|
||||||
|
<view class="loading-bg"></view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
|
||||||
<!-- 固定头部 -->
|
<!-- 固定头部 -->
|
||||||
<view class="header-fixed">
|
<view class="header-fixed" v-if="pageReady">
|
||||||
<view class="nar-top"></view>
|
<view class="nar-top"></view>
|
||||||
<view class="header-content">
|
<view class="header-content">
|
||||||
<!-- 状态栏占位 -->
|
|
||||||
<view class="status_bar" :style="{ height: statusBarHeight + 'px' }"></view>
|
|
||||||
<!-- 导航栏 -->
|
|
||||||
<view class="nav-bar">
|
|
||||||
<text class="nav-title">首页</text>
|
|
||||||
</view>
|
|
||||||
<!-- 小区选择 -->
|
<!-- 小区选择 -->
|
||||||
<view class="header-container" @click="navigateToPage">
|
<view class="header-container" @click="navigateToPage">
|
||||||
<!-- 左侧小区选择区域 -->
|
|
||||||
<view class="location-area">
|
<view class="location-area">
|
||||||
<!-- 定位图标 -->
|
|
||||||
<view class="location-icon">
|
<view class="location-icon">
|
||||||
<image src="https://wuyeadmin.bugtc.com/images/home/adress.png"
|
<image src="https://wuyeadmin.bugtc.com/images/home/adress.png"
|
||||||
style="height: 100%;width: 100%;"></image>
|
style="height: 100%;width: 100%;"></image>
|
||||||
</view>
|
</view>
|
||||||
<!-- 小区名称和下拉箭头 -->
|
|
||||||
<view class="community-selector">
|
<view class="community-selector">
|
||||||
<text class="community-name">{{ currentCommunity }}</text>
|
<text class="community-name">{{ currentCommunity }}</text>
|
||||||
<u-icon name="arrow-down-fill" size="16" :color="isDropdownOpen ? '#2979ff' : '#222222'"
|
<u-icon name="arrow-down-fill" size="16" :color="isDropdownOpen ? '#2979ff' : '#222222'"
|
||||||
@@ -31,7 +28,7 @@
|
|||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 滚动内容区 -->
|
<!-- 滚动内容区 -->
|
||||||
<scroll-view class="main-scroll" scroll-y>
|
<scroll-view class="main-scroll" v-if="pageReady" scroll-y>
|
||||||
<!-- banner -->
|
<!-- banner -->
|
||||||
<view class="bannarClass">
|
<view class="bannarClass">
|
||||||
<up-swiper :key="bannerSwiperKey" :list="bannerList" indicator indicatorMode="dot" radius="10">
|
<up-swiper :key="bannerSwiperKey" :list="bannerList" indicator indicatorMode="dot" radius="10">
|
||||||
@@ -107,7 +104,6 @@
|
|||||||
<view style="color: #fff;font-size: 28rpx;">邻里便民服务 即将上线</view>
|
<view style="color: #fff;font-size: 28rpx;">邻里便民服务 即将上线</view>
|
||||||
</view>
|
</view>
|
||||||
</up-col>
|
</up-col>
|
||||||
|
|
||||||
</up-row>
|
</up-row>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -121,7 +117,6 @@
|
|||||||
<text class="look-more-title" @click="moreClick">查看更多</text>
|
<text class="look-more-title" @click="moreClick">查看更多</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- 活动列表内容(去掉内层 scroll-view,由外层统一滚动) -->
|
|
||||||
<view class="activity-list">
|
<view class="activity-list">
|
||||||
<view class="eventListCard" v-for="(activity, index) in activityList" :key="activity.id"
|
<view class="eventListCard" v-for="(activity, index) in activityList" :key="activity.id"
|
||||||
@click="goToActivityDetail(activity)">
|
@click="goToActivityDetail(activity)">
|
||||||
@@ -155,7 +150,6 @@
|
|||||||
</up-col>
|
</up-col>
|
||||||
</up-row>
|
</up-row>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- 空状态 -->
|
<!-- 空状态 -->
|
||||||
@@ -163,15 +157,12 @@
|
|||||||
<uni-icons type="info" size="30" color="#ccc"></uni-icons>
|
<uni-icons type="info" size="30" color="#ccc"></uni-icons>
|
||||||
<text class="empty-text">暂无数据</text>
|
<text class="empty-text">暂无数据</text>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
|
||||||
</uni-card>
|
</uni-card>
|
||||||
|
|
||||||
<!-- 底部占位 -->
|
<!-- 底部占位 -->
|
||||||
<view class="scroll-bottom-space"></view>
|
<view class="scroll-bottom-space"></view>
|
||||||
</scroll-view>
|
</scroll-view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
@@ -196,85 +187,77 @@
|
|||||||
|
|
||||||
// 列表数据状态
|
// 列表数据状态
|
||||||
const isDropdownOpen = ref(false)
|
const isDropdownOpen = ref(false)
|
||||||
const scrollTop = ref(0)
|
const activityList = ref([])
|
||||||
const activityList = ref([]) // 活动列表数据
|
|
||||||
const currentCommunity = ref('请绑定房屋')
|
const currentCommunity = ref('请绑定房屋')
|
||||||
const currentVillageId = ref('')
|
const currentVillageId = ref('')
|
||||||
const statusBarHeight = ref(0)
|
|
||||||
const bannerList = ref([])
|
const bannerList = ref([])
|
||||||
const bannerRawData = ref([]) // 保留原始数据(含link)
|
const bannerRawData = ref([])
|
||||||
const bannerSwiperKey = ref(0)
|
const bannerSwiperKey = ref(0)
|
||||||
const noticeText = ref('暂无公告')
|
const noticeText = ref('暂无公告')
|
||||||
const noticeKey = ref(0)
|
const noticeKey = ref(0)
|
||||||
const noticeId = ref('')
|
const noticeId = ref('')
|
||||||
const lastUserId = ref('') // 用于检测是否切换账号
|
const lastUserId = ref('')
|
||||||
|
const pageReady = ref(false)
|
||||||
|
|
||||||
|
// =======工具方法=======
|
||||||
|
const requireLogin = () => {
|
||||||
|
const token = uni.getStorageSync('token')
|
||||||
|
if (!token) {
|
||||||
|
uni.showToast({ title: '请先登录', icon: 'none' })
|
||||||
|
setTimeout(() => {
|
||||||
|
uni.navigateTo({ url: '/pageSubPack/loginSub/login?mode=pwd' })
|
||||||
|
}, 1000)
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
// =======方法=======
|
// =======方法=======
|
||||||
// 格式化时间
|
|
||||||
const formatDate = (date) => {
|
const formatDate = (date) => {
|
||||||
if (!date) return ''
|
if (!date) return ''
|
||||||
return moment(date).format('YYYY-MM-DD HH:mm')
|
return moment(date).format('YYYY-MM-DD HH:mm')
|
||||||
}
|
}
|
||||||
// 公告跳转
|
|
||||||
const getNoticeMore = () => {
|
const getNoticeMore = () => {
|
||||||
|
if (!requireLogin()) return
|
||||||
uni.setStorageSync('sourcePage', "index")
|
uni.setStorageSync('sourcePage', "index")
|
||||||
uni.navigateTo({
|
uni.navigateTo({ url: "/pageSubPack/notice-list/noticeList" })
|
||||||
url: "/pageSubPack/notice-list/noticeList"
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
// 获取bannar列表
|
|
||||||
const getbannarData = async () => {
|
const getbannarData = async () => {
|
||||||
try {
|
try {
|
||||||
const res = await getBannarList({
|
const res = await getBannarList({ villageId: uni.getStorageSync('currentVillageId') })
|
||||||
villageId: uni.getStorageSync('currentVillageId')
|
|
||||||
})
|
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
bannerRawData.value = res.data || []
|
bannerRawData.value = res.data || []
|
||||||
const newList = (res.data || []).map(item => item.url)
|
const newList = (res.data || []).map(item => item.url)
|
||||||
// 只有 banner 数据真正变化时才更新,避免 swiper 反复重建
|
|
||||||
if (JSON.stringify(newList) !== JSON.stringify(bannerList.value)) {
|
if (JSON.stringify(newList) !== JSON.stringify(bannerList.value)) {
|
||||||
bannerList.value = newList
|
bannerList.value = newList
|
||||||
await nextTick()
|
await nextTick()
|
||||||
bannerSwiperKey.value++
|
bannerSwiperKey.value++
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
uni.showToast({
|
|
||||||
title: '获取失败',
|
|
||||||
icon: 'none'
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
const msg = err?.msg || (typeof err === 'string' ? err : '获取失败')
|
// 静默失败
|
||||||
uni.showToast({
|
|
||||||
title: msg,
|
|
||||||
icon: 'none'
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// banner点击跳转
|
|
||||||
const bannerClick = (index) => {
|
const bannerClick = (index) => {
|
||||||
|
if (!requireLogin()) return
|
||||||
const item = bannerRawData.value[index]
|
const item = bannerRawData.value[index]
|
||||||
if (item && item.link) {
|
if (item && item.link) {
|
||||||
uni.navigateTo({
|
uni.navigateTo({ url: item.link })
|
||||||
url: item.link
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 接收选择小区返回的参数
|
|
||||||
const slelctHomeData = (data) => {
|
const slelctHomeData = (data) => {
|
||||||
// console.log('收到B页面返回的数据:', data)
|
if (data.name) currentCommunity.value = data.name
|
||||||
if (data.name) {
|
if (data.villageId) currentVillageId.value = data.villageId
|
||||||
currentCommunity.value = data.name
|
|
||||||
}
|
|
||||||
if (data.villageId) {
|
|
||||||
currentVillageId.value = data.villageId
|
|
||||||
}
|
|
||||||
getCurrentCommunityData()
|
getCurrentCommunityData()
|
||||||
getNoticeData()
|
getNoticeData()
|
||||||
noticeKey.value++
|
noticeKey.value++
|
||||||
getNewActivityList()
|
getNewActivityList()
|
||||||
}
|
}
|
||||||
// 获取当前认证小区的方法
|
|
||||||
const getCurrentCommunityData = () => {
|
const getCurrentCommunityData = () => {
|
||||||
getCurrentVillage().then(res => {
|
getCurrentVillage().then(res => {
|
||||||
if (res.code === 200 && res.data && res.data.villageId) {
|
if (res.code === 200 && res.data && res.data.villageId) {
|
||||||
@@ -286,15 +269,10 @@
|
|||||||
currentVillageId.value = ''
|
currentVillageId.value = ''
|
||||||
}
|
}
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
uni.showToast({
|
uni.showToast({ title: err.msg || '网络异常', icon: 'error' })
|
||||||
title: err.msg || '网络异常',
|
|
||||||
icon: 'error'
|
|
||||||
});
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// 获取首页最新小区公告
|
|
||||||
const getNoticeData = async () => {
|
const getNoticeData = async () => {
|
||||||
try {
|
try {
|
||||||
const res = await getNoticeLatest()
|
const res = await getNoticeLatest()
|
||||||
@@ -306,54 +284,38 @@
|
|||||||
noticeText.value = '暂无公告'
|
noticeText.value = '暂无公告'
|
||||||
noticeId.value = ''
|
noticeId.value = ''
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
|
||||||
uni.showToast({
|
|
||||||
title: res.msg || '获取通知失败',
|
|
||||||
icon: 'none',
|
|
||||||
duration: 2000
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
uni.showToast({
|
|
||||||
title: err.msg || '网络异常',
|
|
||||||
icon: 'none',
|
|
||||||
duration: 1000
|
|
||||||
})
|
|
||||||
noticeText.value = '暂无公告'
|
noticeText.value = '暂无公告'
|
||||||
noticeId.value = ''
|
noticeId.value = ''
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 刷新所有数据(提取公共方法)
|
|
||||||
const refreshAllData = async () => {
|
const refreshAllData = async () => {
|
||||||
const token = uni.getStorageSync('token') || '';
|
const token = uni.getStorageSync('token') || ''
|
||||||
const needReload = uni.getStorageSync('needReloadUserInfo');
|
const needReload = uni.getStorageSync('needReloadUserInfo')
|
||||||
// 只有从绑定房屋返回首页时,才重新加载用户信息获取最新小区ID
|
|
||||||
if (token && needReload) {
|
if (token && needReload) {
|
||||||
try {
|
try {
|
||||||
const res = await getReloadUserInfo();
|
const res = await getReloadUserInfo()
|
||||||
if (res.code === 200 && res.data) {
|
if (res.code === 200 && res.data) {
|
||||||
if (res.data.userId) {
|
if (res.data.userId) uni.setStorageSync('userId', res.data.userId)
|
||||||
uni.setStorageSync('userId', res.data.userId);
|
const reloadedVillageId = res.data.currentVillageId || 0
|
||||||
}
|
uni.setStorageSync('currentVillageId', reloadedVillageId)
|
||||||
const reloadedVillageId = res.data.currentVillageId || 0;
|
|
||||||
uni.setStorageSync('currentVillageId', reloadedVillageId);
|
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error('重新加载用户信息失败', err);
|
console.error('重新加载用户信息失败', err)
|
||||||
} finally {
|
} finally {
|
||||||
uni.removeStorageSync('needReloadUserInfo');
|
uni.removeStorageSync('needReloadUserInfo')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
getCurrentCommunityData();
|
getCurrentCommunityData()
|
||||||
getNoticeData()
|
getNoticeData()
|
||||||
noticeKey.value++
|
noticeKey.value++
|
||||||
getNewActivityList()
|
getNewActivityList()
|
||||||
getbannarData()
|
getbannarData()
|
||||||
|
pageReady.value = true
|
||||||
}
|
}
|
||||||
|
|
||||||
// 切换账号时重置页面数据
|
|
||||||
const resetPageData = () => {
|
const resetPageData = () => {
|
||||||
currentCommunity.value = '请先绑定房屋'
|
currentCommunity.value = '请先绑定房屋'
|
||||||
currentVillageId.value = ''
|
currentVillageId.value = ''
|
||||||
@@ -366,131 +328,84 @@
|
|||||||
|
|
||||||
onShow(() => {
|
onShow(() => {
|
||||||
const currentUserId = uni.getStorageSync('userId') || ''
|
const currentUserId = uni.getStorageSync('userId') || ''
|
||||||
// 检测到切换账号:重置数据并重新加载
|
|
||||||
if (lastUserId.value && lastUserId.value !== currentUserId) {
|
if (lastUserId.value && lastUserId.value !== currentUserId) {
|
||||||
resetPageData()
|
resetPageData()
|
||||||
refreshAllData()
|
refreshAllData()
|
||||||
} else {
|
} else {
|
||||||
// 首次显示 或 非切换账号的普通返回,直接刷新数据(不清空已有数据)
|
|
||||||
refreshAllData()
|
refreshAllData()
|
||||||
}
|
}
|
||||||
lastUserId.value = currentUserId
|
lastUserId.value = currentUserId
|
||||||
})
|
})
|
||||||
|
|
||||||
onLoad(() => {
|
onLoad(() => {
|
||||||
const info = uni.getSystemInfoSync()
|
|
||||||
statusBarHeight.value = info.statusBarHeight || 0
|
|
||||||
|
|
||||||
// 绑定全局事件监听
|
|
||||||
uni.$on('confirm', slelctHomeData)
|
uni.$on('confirm', slelctHomeData)
|
||||||
|
|
||||||
// 记录当前用户ID,用于 onShow 中检测是否切换账号
|
|
||||||
lastUserId.value = uni.getStorageSync('userId') || ''
|
lastUserId.value = uni.getStorageSync('userId') || ''
|
||||||
|
|
||||||
// 数据刷新统一放到 onShow,避免 onLoad + onShow 首次重复请求
|
|
||||||
})
|
})
|
||||||
|
|
||||||
// 页面销毁时移除监听(防止内存泄漏)
|
|
||||||
onUnload(() => {
|
onUnload(() => {
|
||||||
uni.$off('confirm', slelctHomeData)
|
uni.$off('confirm', slelctHomeData)
|
||||||
})
|
})
|
||||||
|
|
||||||
// 方法逻辑
|
|
||||||
const openDoorClick = () => {
|
const openDoorClick = () => {
|
||||||
|
if (!requireLogin()) return
|
||||||
uni.setStorageSync('sourcePage', "index")
|
uni.setStorageSync('sourcePage', "index")
|
||||||
uni.navigateTo({
|
uni.navigateTo({ url: "/pageSubPack/notice-list/oneClickOpen" })
|
||||||
url: "/pageSubPack/notice-list/oneClickOpen"
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
// 生活缴费
|
|
||||||
const payMentClick = () => {
|
const payMentClick = () => {
|
||||||
|
if (!requireLogin()) return
|
||||||
uni.setStorageSync('sourcePage', "index")
|
uni.setStorageSync('sourcePage', "index")
|
||||||
uni.navigateTo({
|
uni.navigateTo({ url: "/pageSubPack/payment-list/paymentIndex" })
|
||||||
url: "/pageSubPack/payment-list/paymentIndex"
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
// 点击小区选择
|
|
||||||
const navigateToPage = () => {
|
const navigateToPage = () => {
|
||||||
// const token = uni.getStorageSync('token') || '';
|
const cachedVillageId = uni.getStorageSync('currentVillageId')
|
||||||
const cachedVillageId = uni.getStorageSync('currentVillageId');
|
|
||||||
// 未登录 或 未绑定小区 → 去我的页面认证
|
|
||||||
if (!cachedVillageId || cachedVillageId === '0' || cachedVillageId === 0) {
|
if (!cachedVillageId || cachedVillageId === '0' || cachedVillageId === 0) {
|
||||||
currentCommunity.value = '请先绑定房屋';
|
currentCommunity.value = '请先绑定房屋'
|
||||||
uni.setStorageSync('currentCommunity', '请先绑定房屋');
|
uni.setStorageSync('currentCommunity', '请先绑定房屋')
|
||||||
uni.showToast({
|
uni.showToast({ title: '请先绑定小区', icon: 'none', duration: 1500 })
|
||||||
title: '请先绑定小区',
|
setTimeout(() => { uni.switchTab({ url: '/pages/myIndex/myIndex' }) }, 1500)
|
||||||
icon: 'none',
|
|
||||||
duration: 1500
|
|
||||||
});
|
|
||||||
setTimeout(() => {
|
|
||||||
uni.switchTab({
|
|
||||||
url: '/pages/myIndex/myIndex',
|
|
||||||
});
|
|
||||||
}, 1500);
|
|
||||||
} else {
|
} else {
|
||||||
// 已登录且已绑定小区 → 去选择小区
|
uni.navigateTo({ url: `/pageSubPack/notice-list/selectHome?villageId=${cachedVillageId}` })
|
||||||
uni.navigateTo({
|
|
||||||
url: `/pageSubPack/notice-list/selectHome?villageId=${cachedVillageId}`
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
// 获取首页最新活动
|
|
||||||
const getNewActivityList = async () => {
|
const getNewActivityList = async () => {
|
||||||
try {
|
try {
|
||||||
let params = {
|
const res = await getActivitylatest({ villageId: uni.getStorageSync('currentVillageId') })
|
||||||
villageId: uni.getStorageSync('currentVillageId')
|
|
||||||
}
|
|
||||||
const res = await getActivitylatest(params)
|
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
if (res.data) {
|
activityList.value = res.data || []
|
||||||
activityList.value = res.data || []
|
|
||||||
} else {
|
|
||||||
activityList.value = []
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
activityList.value = []
|
activityList.value = []
|
||||||
uni.showToast({
|
|
||||||
title: res.msg,
|
|
||||||
icon: 'error',
|
|
||||||
duration: 1000
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
uni.showToast({
|
activityList.value = []
|
||||||
title: err.msg || '网络异常',
|
|
||||||
icon: 'error',
|
|
||||||
duration: 1000
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const onlineRepairClick = () => {
|
const onlineRepairClick = () => {
|
||||||
|
if (!requireLogin()) return
|
||||||
uni.setStorageSync('sourcePage', "index")
|
uni.setStorageSync('sourcePage', "index")
|
||||||
uni.navigateTo({
|
uni.navigateTo({ url: '/pageSubPack/online-repair/onlineRepair' })
|
||||||
url: '/pageSubPack/online-repair/onlineRepair'
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
// 访客邀请
|
|
||||||
const visitorClick = () => {
|
const visitorClick = () => {
|
||||||
|
if (!requireLogin()) return
|
||||||
uni.setStorageSync('sourcePage', "index")
|
uni.setStorageSync('sourcePage', "index")
|
||||||
uni.navigateTo({
|
uni.navigateTo({ url: "/pageSubPack/visitor/visitor-list" })
|
||||||
url: "/pageSubPack/visitor/visitor-list"
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
// 跳转到活动详情页
|
|
||||||
const goToActivityDetail = (activity) => {
|
const goToActivityDetail = (activity) => {
|
||||||
|
if (!requireLogin()) return
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: `/pageSubPack/activity-list/activityListDetails?id=${activity.id}&title=${activity.title}&applied=${activity.applied || ''}&statusText=${activity.statusText || ''}`
|
url: `/pageSubPack/activity-list/activityListDetails?id=${activity.id}&title=${activity.title}&applied=${activity.applied || ''}&statusText=${activity.statusText || ''}`
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
// 活动列表的查看更多
|
|
||||||
const moreClick = () => {
|
const moreClick = () => {
|
||||||
|
if (!requireLogin()) return
|
||||||
uni.setStorageSync('sourcePage', "index")
|
uni.setStorageSync('sourcePage', "index")
|
||||||
uni.navigateTo({
|
uni.navigateTo({ url: "/pageSubPack/activity-list/activityList" })
|
||||||
url: "/pageSubPack/activity-list/activityList"
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@@ -505,6 +420,22 @@
|
|||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
|
||||||
|
/* 加载遮罩 */
|
||||||
|
.loading-mask {
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
z-index: 999;
|
||||||
|
}
|
||||||
|
|
||||||
|
.loading-bg {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
background: repeating-linear-gradient(to right, #EDF4FA, #C0E4FB);
|
||||||
|
}
|
||||||
|
|
||||||
/* 固定头部 */
|
/* 固定头部 */
|
||||||
.header-fixed {
|
.header-fixed {
|
||||||
position: relative;
|
position: relative;
|
||||||
@@ -539,34 +470,12 @@
|
|||||||
height: 40rpx;
|
height: 40rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.status_bar {
|
|
||||||
width: 100%;
|
|
||||||
flex-shrink: 0;
|
|
||||||
position: relative;
|
|
||||||
z-index: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 导航栏 */
|
|
||||||
.nav-bar {
|
|
||||||
height: 44px;
|
|
||||||
line-height: 44px;
|
|
||||||
text-align: center;
|
|
||||||
position: relative;
|
|
||||||
z-index: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
.nav-title {
|
|
||||||
font-size: 32rpx;
|
|
||||||
font-weight: 500;
|
|
||||||
}
|
|
||||||
|
|
||||||
.header-container {
|
.header-container {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
padding: 4rpx 30rpx;
|
padding: 20rpx 30rpx;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
// border-bottom: 1rpx solid #f0f0f0;
|
|
||||||
position: relative;
|
position: relative;
|
||||||
z-index: 10;
|
z-index: 10;
|
||||||
}
|
}
|
||||||
@@ -607,7 +516,6 @@
|
|||||||
.bannarClass {
|
.bannarClass {
|
||||||
position: relative;
|
position: relative;
|
||||||
padding: 20rpx 40rpx;
|
padding: 20rpx 40rpx;
|
||||||
// margin-bottom: 20rpx;
|
|
||||||
height: 300rpx;
|
height: 300rpx;
|
||||||
|
|
||||||
::v-deep .u-swiper {
|
::v-deep .u-swiper {
|
||||||
@@ -634,7 +542,6 @@
|
|||||||
margin-bottom: 20rpx;
|
margin-bottom: 20rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 修改通知栏样式
|
|
||||||
::v-deep .uni-noticebar__content-wrapper--scrollable {
|
::v-deep .uni-noticebar__content-wrapper--scrollable {
|
||||||
margin-right: 20px;
|
margin-right: 20px;
|
||||||
}
|
}
|
||||||
@@ -643,10 +550,6 @@
|
|||||||
padding: 4px 12px;
|
padding: 4px 12px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.notice-bar::after {
|
|
||||||
color: #3E8EFF;
|
|
||||||
}
|
|
||||||
|
|
||||||
.bg-card-open {
|
.bg-card-open {
|
||||||
padding: 20rpx;
|
padding: 20rpx;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
@@ -664,8 +567,6 @@
|
|||||||
width: 88rpx;
|
width: 88rpx;
|
||||||
height: 88rpx;
|
height: 88rpx;
|
||||||
border-radius: 10rpx;
|
border-radius: 10rpx;
|
||||||
// opacity: 0.4;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.iconClass-img {
|
.iconClass-img {
|
||||||
@@ -682,31 +583,24 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.adCardClass {
|
.adCardClass {
|
||||||
// width: 100%;
|
|
||||||
height: 200rpx;
|
height: 200rpx;
|
||||||
margin: 0 30rpx 20rpx;
|
margin: 0 30rpx 20rpx;
|
||||||
background-color: #3E8EFF;
|
background-color: #3E8EFF;
|
||||||
// margin-top: 30rpx;
|
|
||||||
border-radius: 28rpx;
|
border-radius: 28rpx;
|
||||||
|
|
||||||
.titleLeft {
|
.titleLeft {
|
||||||
text-align: left;
|
text-align: left;
|
||||||
line-height: 2;
|
line-height: 2;
|
||||||
// margin-top: 32rpx;
|
|
||||||
// margin-left: 30rpx;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.iconRightClass {
|
.iconRightClass {
|
||||||
width: 120rpx;
|
width: 120rpx;
|
||||||
height: 120rpx;
|
height: 120rpx;
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
// margin-top: 20rpx;
|
|
||||||
margin: 36rpx;
|
margin: 36rpx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.activity-card {}
|
|
||||||
|
|
||||||
.uni-card {
|
.uni-card {
|
||||||
margin: 0 18px 20rpx !important;
|
margin: 0 18px 20rpx !important;
|
||||||
}
|
}
|
||||||
@@ -722,20 +616,16 @@
|
|||||||
font-size: 32rpx;
|
font-size: 32rpx;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
color: #222;
|
color: #222;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.eventListCard {
|
.eventListCard {
|
||||||
// min-height:200rpx ;
|
|
||||||
position: relative;
|
position: relative;
|
||||||
margin: 30rpx 0rpx;
|
margin: 30rpx 0rpx;
|
||||||
|
|
||||||
// overflow: hidden;
|
|
||||||
.activity-img {
|
.activity-img {
|
||||||
width: 170rpx;
|
width: 170rpx;
|
||||||
height: 230rpx;
|
height: 230rpx;
|
||||||
position: relative;
|
position: relative;
|
||||||
// background-color: #333333;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.status-tag {
|
.status-tag {
|
||||||
@@ -806,4 +696,4 @@
|
|||||||
font-size: 28rpx;
|
font-size: 28rpx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="contentStyle" style="">
|
<view class="contentStyle" style="">
|
||||||
<view class="status-bar"></view>
|
<!-- <view class="status-bar"></view>
|
||||||
<uni-nav-bar title="我的" backgroundColor="transparent" :border="false">
|
<uni-nav-bar title="我的" backgroundColor="transparent" :border="false">
|
||||||
</uni-nav-bar>
|
</uni-nav-bar> -->
|
||||||
<scroll-view class="page" scroll-y>
|
<scroll-view class="page" scroll-y>
|
||||||
<view class="topBox">
|
<view class="topBox">
|
||||||
<view class="name">
|
<view class="name">
|
||||||
|
|||||||
@@ -71,17 +71,19 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref } from 'vue';
|
import { ref, onMounted } from 'vue';
|
||||||
|
|
||||||
// 守卫:已登录或已看过引导页的用户不展示引导页,直接跳转
|
// 守卫:已登录或已看过引导页的用户不展示引导页,直接跳转
|
||||||
const hasShowGuide = uni.getStorageSync('hasShowGuide')
|
const hasShowGuide = uni.getStorageSync('hasShowGuide')
|
||||||
const tokenSave = uni.getStorageSync('token')
|
const tokenSave = uni.getStorageSync('token')
|
||||||
|
// 是否需要重定向(老用户跳过引导页)
|
||||||
|
const needRedirect = hasShowGuide || tokenSave
|
||||||
|
|
||||||
if (hasShowGuide || tokenSave) {
|
if (needRedirect) {
|
||||||
if (tokenSave) {
|
if (tokenSave) {
|
||||||
uni.reLaunch({ url: '/pages/index/index' })
|
uni.reLaunch({ url: '/pages/index/index' })
|
||||||
} else if (hasShowGuide) {
|
} else if (hasShowGuide) {
|
||||||
uni.reLaunch({ url: '/pageSubPack/loginSub/pwd-login' })
|
uni.reLaunch({ url: '/pageSubPack/loginSub/login?mode=pwd' })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -91,8 +93,17 @@ const currentStep = ref(0);
|
|||||||
const mode = ref("default")
|
const mode = ref("default")
|
||||||
// 防重复跳转锁
|
// 防重复跳转锁
|
||||||
const isNavigating = ref(false)
|
const isNavigating = ref(false)
|
||||||
// 控制是否展示引导内容(已登录用户不展示,避免闪烁)
|
// 控制是否展示引导内容(初始为 false,避免重定向用户看到闪烁)
|
||||||
const showContent = ref(!hasShowGuide && !tokenSave)
|
const showContent = ref(false)
|
||||||
|
|
||||||
|
// 页面挂载后延迟显示,让过渡更平滑
|
||||||
|
onMounted(() => {
|
||||||
|
// 需要重定向的用户不展示引导内容
|
||||||
|
if (needRedirect) return
|
||||||
|
setTimeout(() => {
|
||||||
|
showContent.value = true
|
||||||
|
}, 100)
|
||||||
|
})
|
||||||
|
|
||||||
// ========== 方法 ==========
|
// ========== 方法 ==========
|
||||||
// 滑动swiper切换步骤
|
// 滑动swiper切换步骤
|
||||||
@@ -119,7 +130,7 @@ const handleBtnClick = () => {
|
|||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
uni.redirectTo({
|
uni.redirectTo({
|
||||||
url: "/pageSubPack/loginSub/pwd-login"
|
url: "/pageSubPack/loginSub/login?mode=pwd"
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -136,6 +147,19 @@ const handleBtnClick = () => {
|
|||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
|
animation: guideFadeIn 0.5s ease-out;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 引导页淡入动画 */
|
||||||
|
@keyframes guideFadeIn {
|
||||||
|
from {
|
||||||
|
opacity: 0;
|
||||||
|
transform: translateY(20rpx);
|
||||||
|
}
|
||||||
|
to {
|
||||||
|
opacity: 1;
|
||||||
|
transform: translateY(0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 状态栏 - 自适应设备状态栏高度 */
|
/* 状态栏 - 自适应设备状态栏高度 */
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="contentStyle" style="">
|
<view class="contentStyle" style="">
|
||||||
<view class="status-bar"></view>
|
<!-- <view class="status-bar"></view>
|
||||||
<uni-nav-bar title="服务" backgroundColor="transparent" :border="false">
|
<uni-nav-bar title="服务" backgroundColor="transparent" :border="false">
|
||||||
</uni-nav-bar>
|
</uni-nav-bar> -->
|
||||||
<!-- 表单区域 -->
|
<!-- 表单区域 -->
|
||||||
<scroll-view class="page" scroll-y>
|
<scroll-view class="page" scroll-y>
|
||||||
<view class="container">
|
<view class="container">
|
||||||
|
|||||||
Reference in New Issue
Block a user