修改bug

This commit is contained in:
zhouyanli
2026-07-30 18:01:39 +08:00
parent 80ff7588b1
commit 8c0a713512
20 changed files with 223 additions and 134 deletions

View File

@@ -31,7 +31,9 @@
"Bash(sed -i '32,36s/.*//' App.vue)", "Bash(sed -i '32,36s/.*//' App.vue)",
"Bash(sed -i '32d;33d;34d;35d;36d' 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\": 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)" "Bash(perl -i -pe 's/^t\\\\t\\\\t\\\\t\\\\t\"disableScroll\"/\\\\t\\\\t\\\\t\\\\t\\\\t\\\\t\"disableScroll\"/' pages.json)",
"Bash(sed -i '113s|// loadRevenue\\(true\\)|loadRevenue\\(true\\)|' pageSubPack/inspection-revenue/public-revenue.vue)",
"Bash(sed -i '120s|// loadRevenue\\(\\)|loadRevenue\\(\\)|' pageSubPack/inspection-revenue/public-revenue.vue)"
] ]
} }
} }

View File

@@ -1,5 +1,6 @@
<script setup> <script setup>
import { onLaunch,onShow,onHide } from '@dcloudio/uni-app' import { onLaunch,onShow,onHide } from '@dcloudio/uni-app'
import { isPublicPath } from '@/common/checkLogin.js'
let cidRetryTimer = null let cidRetryTimer = null
let cidRetryCount = 0 let cidRetryCount = 0
@@ -29,6 +30,20 @@
// 所有人统一进首页 // 所有人统一进首页
console.log('进入首页hasToken=' + !!token + '') console.log('进入首页hasToken=' + !!token + '')
// 全局 navigateTo 拦截器:未登录用户访问需登录页面时自动跳转登录页
uni.addInterceptor('navigateTo', {
invoke(args) {
const t = uni.getStorageSync('token')
if (!t && !isPublicPath(args.url)) {
uni.showToast({ title: '请先登录', icon: 'none' })
setTimeout(() => {
uni.navigateTo({ url: '/pageSubPack/loginSub/login?mode=pwd' })
}, 1000)
return false
}
}
})
}) })
onShow((options) => { onShow((options) => {
console.log('App Show', options) console.log('App Show', options)

View File

@@ -0,0 +1,55 @@
/**
* 登录检查工具 — 统一拦截未登录用户的功能操作
*
* 使用方式:
* import { requireLogin } from '@/common/checkLogin.js'
* if (!requireLogin()) return
*
* 页面级调用即可,全局 navigateTo 拦截器App.vue onLaunch 中注册)作为兜底。
*/
/** 无需登录即可访问的页面路径白名单(全局拦截器使用) */
export const PUBLIC_PATHS = [
'/pageSubPack/loginSub/login',
'/pageSubPack/loginSub/register-new-user',
'/pageSubPack/loginSub/forget-pwd',
'/pageSubPack/loginSub/change-pwd',
'/pageSubPack/loginSub/privacy',
'/pages/navigation/navigation'
]
/**
* 判断指定路径是否为公开页面(无需登录)
* @param {string} url - navigateTo 的目标 url
* @returns {boolean}
*/
export function isPublicPath(url) {
if (!url) return true
// 去掉查询参数
const path = url.split('?')[0]
return PUBLIC_PATHS.some(p => path === p || path.startsWith(p + '?'))
}
/**
* 检查是否已登录;未登录则弹出提示并跳转登录页
* @param {object} [options]
* @param {string} [options.message='请先登录'] - 提示文案
* @param {boolean} [options.redirect=true] - 是否自动跳转登录页
* @returns {boolean} 已登录返回 true否则返回 false
*/
export function requireLogin(options = {}) {
const {
message = '请先登录',
redirect = true
} = options
const token = uni.getStorageSync('token')
if (token) return true
uni.showToast({ title: message, icon: 'none' })
if (redirect) {
setTimeout(() => {
uni.navigateTo({ url: '/pageSubPack/loginSub/login?mode=pwd' })
}, 1000)
}
return false
}

View File

@@ -96,7 +96,7 @@
<!-- 活动详情 --> <!-- 活动详情 -->
<view class="section" style="margin-bottom: 40rpx;"> <view class="section" style="margin-bottom: 40rpx;">
<view class="section-title">活动详情</view> <view class="section-title">活动详情</view>
<view class="section-content"> <view class="section-content rich-content">
<view v-html="activityConent.content"></view> <view v-html="activityConent.content"></view>
<view></view> <view></view>
</view> </view>
@@ -584,6 +584,8 @@ const showToastMessage = (message) => {
font-weight: 500; font-weight: 500;
line-height: 1.4; line-height: 1.4;
text-align: right; text-align: right;
white-space: pre-wrap;
word-break: break-all;
} }
/* 区块样式 */ /* 区块样式 */
@@ -604,8 +606,11 @@ const showToastMessage = (message) => {
.section-content { .section-content {
font-size: 28rpx; font-size: 28rpx;
white-space: pre-wrap;
word-break: break-all;
color: #666; color: #666;
line-height: 1.6; line-height: 1.6;
overflow-x: hidden;
} }
.section-content view { .section-content view {
@@ -910,3 +915,24 @@ const showToastMessage = (message) => {
} }
} }
</style> </style>
<style lang="scss">
/* 富文本v-html内图片自适应 — 非 scoped否则穿透不到 v-html 内容 */
.section-content {
img {
max-width: 100% !important;
height: auto !important;
display: block;
}
}
.rich-content {
white-space: normal !important;
word-break: normal !important;
overflow: hidden;
/* 富文本内嵌的所有元素不超出容器 */
* {
max-width: 100% !important;
box-sizing: border-box !important;
}
}
</style>

View File

@@ -110,14 +110,14 @@ onShow(() =>{
const onRefresh = () => { const onRefresh = () => {
refreshing.value = true refreshing.value = true
// loadRevenue(true) loadRevenue(true)
} }
const loadMore = () => { const loadMore = () => {
if (noMoreData.value || loadingMore.value) return if (noMoreData.value || loadingMore.value) return
loadingMore.value = true loadingMore.value = true
pageNum.value++ pageNum.value++
// loadRevenue() loadRevenue()
} }
const narBack = () => { const narBack = () => {

View File

@@ -51,6 +51,7 @@
<image src="https://wuyeadmin.bugtc.com/images/login/password.png" mode="" style="height: 100%;width: 100%;"></image> <image src="https://wuyeadmin.bugtc.com/images/login/password.png" mode="" style="height: 100%;width: 100%;"></image>
</view> </view>
<uni-easyinput class="input-content" type="password" v-model="password" <uni-easyinput class="input-content" type="password" v-model="password"
@input="password = password.replace(/\s/g, '')"
placeholder="请输入密码" :inputBorder="false" maxlength="16" :placeholderStyle="placeholderStyle"> placeholder="请输入密码" :inputBorder="false" maxlength="16" :placeholderStyle="placeholderStyle">
</uni-easyinput> </uni-easyinput>
</view> </view>
@@ -237,6 +238,7 @@ const handlePwdLogin = () => {
if (!password.value) { uni.showToast({ title: '请输入密码', 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 < 6) { uni.showToast({ title: '密码至少输入 6 位', icon: 'none' }); return }
if (password.value.length > 16) { uni.showToast({ title: '密码不能超过 16 位', icon: 'none' }); return } if (password.value.length > 16) { uni.showToast({ title: '密码不能超过 16 位', icon: 'none' }); return }
if (/\s/.test(password.value)) { uni.showToast({ title: '密码格式不对', icon: 'none' }); return }
if (!agreeAgreement.value) { openPrivacyPopup('login'); return } if (!agreeAgreement.value) { openPrivacyPopup('login'); return }
doLogin() doLogin()
} }

View File

@@ -1,11 +1,6 @@
<template> <template>
<view class="register-page"> <view class="register-page">
<view class="status_bar"></view> <view class="status_bar"></view>
<!-- 顶部导航 -->
<!-- <view class="nav-bar">
<uni-icons type="left" size="28" color="#333" @click="goBack"></uni-icons>
<view class="nav-title">注册</view>
</view> -->
<!-- 注册标题 --> <!-- 注册标题 -->
<view class="register-title">注册用户</view> <view class="register-title">注册用户</view>
@@ -18,7 +13,6 @@
</view> </view>
<uni-easyinput class="input-content" type="number" v-model="phoneNumber" @input="phoneNumber = phoneNumber.replace(/\D/g, '')" 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" />
</view> </view>
<!-- 验证码输入 + 获取验证码按钮 --> <!-- 验证码输入 + 获取验证码按钮 -->
@@ -26,58 +20,53 @@
<view class="input-icon"> <view class="input-icon">
<image src="https://wuyeadmin.bugtc.com/images/login/code.png" mode="" style="height: 100%;width: 100%;"> <image src="https://wuyeadmin.bugtc.com/images/login/code.png" mode="" style="height: 100%;width: 100%;">
</image> </image>
<!-- <uni-icons type="locked" size="24" color="#999"></uni-icons> -->
</view> </view>
<uni-easyinput class="input-content verify-input" type="number" v-model="verifyCode" @input="verifyCode = verifyCode.replace(/\D/g, '')" 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" />
<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后重新获取` : '获取验证码' }}
</button> </button>
</view> </view>
<!-- 账号输入框 --> <!-- 账号输入框 -->
<view class="input-item"> <view class="input-item-wrap">
<view class="input-icon"> <view class="input-item">
<image src="https://wuyeadmin.bugtc.com/images/login/account.png" mode="" <view class="input-icon">
style="height: 100%;width: 100%;"></image> <image src="https://wuyeadmin.bugtc.com/images/login/account.png" mode=""
<!-- <uni-icons type="person" size="24" color="#999"></uni-icons> --> style="height: 100%;width: 100%;"></image>
</view>
<uni-easyinput class="input-content" type="text" v-model="account" @blur="validateAccount" @focus="clearAccountError" placeholder="请输入账号4-20位" :inputBorder="false"
maxlength="20" :placeholderStyle="placeholderStyle" />
</view> </view>
<uni-easyinput class="input-content" type="text" v-model="account" placeholder="请输入账号4-20位" :inputBorder="false" <text class="input-error" v-if="accountError">{{ accountError }}</text>
maxlength="20" :placeholderStyle="placeholderStyle" />
</view> </view>
<!-- 密码输入框 --> <!-- 密码输入框 -->
<view class="input-item"> <view class="input-item-wrap">
<view class="input-icon"> <view class="input-item">
<image src="https://wuyeadmin.bugtc.com/images/login/password.png" mode="" <view class="input-icon">
style="height: 100%;width: 100%;"></image> <image src="https://wuyeadmin.bugtc.com/images/login/password.png" mode=""
<!-- <uni-icons type="locked" size="24" color="#999"></uni-icons> --> style="height: 100%;width: 100%;"></image>
</view>
<uni-easyinput class="input-content" type="password" v-model="password" @input="password = password.replace(/\s/g, '')" @blur="validatePassword" @focus="clearPasswordError" placeholder="请输入密码6-16位"
:inputBorder="false" maxlength="16" :placeholderStyle="placeholderStyle" />
</view> </view>
<uni-easyinput class="input-content" type="password" v-model="password" placeholder="请输入密码6-16位" <text class="input-error" v-if="passwordError">{{ passwordError }}</text>
:inputBorder="false" maxlength="16" :placeholderStyle="placeholderStyle" />
</view> </view>
<!-- 协议勾选 --> <!-- 协议勾选 -->
<view class="agreement-item"> <view class="agreement-item">
<view @click="toggleAgreement"> <view @click="toggleAgreement">
<uni-icons type="checkbox-filled" size="24" color="#007aff" v-if="agreeAgreement"></uni-icons> <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> <uni-icons type="checkbox" size="24" color="#999" v-else></uni-icons>
</view> </view>
<!-- <text class="agreement-text" @click.stop="goToPrivacy">我已阅读并同意<text
class="agreePrivacy">用户隐私政策</text></text> -->
<text class="agreement-text" >我已阅读并同意 <text class="agreement-text" >我已阅读并同意
<text class="agreePrivacy" @click.stop="goToUserAgreement">用户协议</text> <text class="agreePrivacy" @click.stop="goToUserAgreement">用户协议</text>
<text class="agreePrivacy" @click.stop="goToPrivacy">隐私政策</text> <text class="agreePrivacy" @click.stop="goToPrivacy">隐私政策</text>
</text> </text>
</view> </view>
<!-- 立即注册按钮 --> <!-- 立即注册按钮 -->
<button class="register-btn" @click="handleRegister"> <button class="register-btn" @click="handleRegister">
立即注册 立即注册
@@ -106,34 +95,30 @@
import PrivacyPopup from '@/components/privacy-popup/privacy-popup.vue' import PrivacyPopup from '@/components/privacy-popup/privacy-popup.vue'
// ========== 响应式数据 ========== // ========== 响应式数据 ==========
// 表单数据
const phoneNumber = ref(''); const phoneNumber = ref('');
const verifyCode = ref(''); const verifyCode = ref('');
const account = ref(''); const account = ref('');
const accountError = ref('');
const password = ref(''); const password = ref('');
const passwordError = ref('');
const placeholderStyle = ref('font-size:24rpx') const placeholderStyle = ref('font-size:24rpx')
// 协议勾选
const agreeAgreement = ref(false); const agreeAgreement = ref(false);
// 隐私弹窗
const showPrivacyPopup = ref(false) const showPrivacyPopup = ref(false)
const pendingAction = ref('') const pendingAction = ref('')
// 验证码倒计时
const countDown = ref(0); const countDown = ref(0);
let timer = null; let timer = null;
// ========== 计算属性 ========== // ========== 计算属性 ==========
// 是否可获取验证码(手机号格式正确)
const canGetVerify = computed(() => { const canGetVerify = computed(() => {
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 canRegister = computed(() => { const canRegister = computed(() => {
const phoneReg = /^1[3-9]\d{9}$/; // 手机号11位 const phoneReg = /^1[3-9]\d{9}$/;
const verifyReg = /^\d{6}$/; // 验证码6位 const verifyReg = /^\d{6}$/;
const accountReg = /^.{4,20}$/; // 账号4-20位 const accountReg = /^.{4,20}$/;
const pwdReg = /^.{6,16}$/; // 密码6-16位 const pwdReg = /^.{6,16}$/;
return phoneReg.test(phoneNumber.value) && return phoneReg.test(phoneNumber.value) &&
verifyReg.test(verifyCode.value) && verifyReg.test(verifyCode.value) &&
@@ -143,16 +128,50 @@
}); });
// ========== 方法 ========== // ========== 方法 ==========
// 返回上一页
const goBack = () => { const goBack = () => {
uni.navigateBack(); uni.navigateBack();
}; };
// 切换协议勾选状态
const toggleAgreement = () => { const toggleAgreement = () => {
agreeAgreement.value = !agreeAgreement.value; agreeAgreement.value = !agreeAgreement.value;
}; };
// 打开用户协议
// 账号失焦校验
const validateAccount = () => {
const val = account.value
if (!val) { accountError.value = ''; return }
if (/\s/.test(val)) {
accountError.value = '账号不能包含空格'
} else if (val.length < 4 || val.length > 20) {
accountError.value = '账号需 4-20 位'
} else {
accountError.value = ''
}
};
// 账号聚焦清除错误提示
const clearAccountError = () => {
accountError.value = ''
};
// 密码失焦校验
const validatePassword = () => {
const val = password.value
if (!val) { passwordError.value = ''; return }
if (val.length < 6 || val.length > 16) {
passwordError.value = '密码需 6-16 位'
} else if (/\s/.test(val)) {
passwordError.value = '密码不能包含空格'
} else {
passwordError.value = ''
}
};
// 密码聚焦清除错误提示
const clearPasswordError = () => {
passwordError.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')
@@ -162,7 +181,6 @@
// #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')
@@ -172,16 +190,13 @@
// #endif // #endif
} }
// 检查表单状态(实时更新按钮状态)
const checkForm = () => {}; const checkForm = () => {};
// 打开隐私弹窗
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
@@ -191,13 +206,11 @@
pendingAction.value = '' pendingAction.value = ''
} }
// 不同意隐私协议
const disagreePrivacy = () => { const disagreePrivacy = () => {
showPrivacyPopup.value = false showPrivacyPopup.value = false
pendingAction.value = '' pendingAction.value = ''
} }
// 获取验证码 // 获取验证码
const getVerifyCode = () => { const getVerifyCode = () => {
if (!canGetVerify.value) return; if (!canGetVerify.value) return;
@@ -211,7 +224,6 @@
title: '验证码已发送', title: '验证码已发送',
icon: 'success' icon: 'success'
}); });
// 开始60秒倒计时
countDown.value = 60; countDown.value = 60;
timer = setInterval(() => { timer = setInterval(() => {
countDown.value--; countDown.value--;
@@ -220,7 +232,6 @@
timer = null; timer = null;
} }
}, 1000); }, 1000);
} else { } else {
uni.showToast({ uni.showToast({
title: '验证码发送失败', title: '验证码发送失败',
@@ -233,8 +244,6 @@
icon: 'none' icon: 'none'
}); });
}) })
}; };
// 处理注册逻辑 // 处理注册逻辑
@@ -263,6 +272,10 @@
uni.showToast({ title: '账号长度需为 4-20 位', icon: 'none' }); uni.showToast({ title: '账号长度需为 4-20 位', icon: 'none' });
return; return;
} }
if (/\s/.test(account.value)) {
uni.showToast({ title: '账号格式不对,不允许注册', icon: 'none' });
return;
}
if (!password.value) { if (!password.value) {
uni.showToast({ title: '请输入密码', icon: 'none' }); uni.showToast({ title: '请输入密码', icon: 'none' });
return; return;
@@ -275,6 +288,10 @@
uni.showToast({ title: '密码不能超过 16 位', icon: 'none' }); uni.showToast({ title: '密码不能超过 16 位', icon: 'none' });
return; return;
} }
if (/\s/.test(password.value)) {
uni.showToast({ title: '密码格式不对,不允许注册', icon: 'none' });
return;
}
if (!agreeAgreement.value) { if (!agreeAgreement.value) {
openPrivacyPopup('register') openPrivacyPopup('register')
return; return;
@@ -305,7 +322,6 @@
url: '/pageSubPack/loginSub/login?mode=pwd' url: '/pageSubPack/loginSub/login?mode=pwd'
}); });
}, 1500); }, 1500);
} else { } else {
uni.showToast({ uni.showToast({
title: '注册失败', title: '注册失败',
@@ -322,7 +338,6 @@
}; };
// ========== 生命周期 ========== // ========== 生命周期 ==========
// 页面卸载时清除定时器
onUnmounted(() => { onUnmounted(() => {
if (timer) { if (timer) {
clearInterval(timer); clearInterval(timer);
@@ -334,7 +349,6 @@
/* 页面容器 */ /* 页面容器 */
.register-page { .register-page {
padding: 20rpx 40rpx 40rpx; padding: 20rpx 40rpx 40rpx;
/* background-color: #f8f9fa; */
height: 100vh; height: 100vh;
overflow: hidden; overflow: hidden;
box-sizing: border-box; box-sizing: border-box;
@@ -346,11 +360,9 @@
width: 100%; width: 100%;
} }
/* 顶部导航栏 */
.nav-bar { .nav-bar {
display: flex; display: flex;
align-items: center; align-items: center;
/* height: 88rpx; */
margin-bottom: 70rpx; margin-bottom: 70rpx;
} }
@@ -363,7 +375,6 @@
margin-right: 100rpx; margin-right: 100rpx;
} }
/* 注册标题 */
.register-title { .register-title {
font-size: 40rpx; font-size: 40rpx;
font-weight: 600; font-weight: 600;
@@ -371,6 +382,15 @@
margin-bottom: 60rpx; margin-bottom: 60rpx;
} }
/* 输入框外层包装(用于承载错误提示) */
.input-item-wrap {
margin-bottom: 30rpx;
}
.input-item-wrap .input-item {
margin-bottom: 0;
}
/* 输入框通用样式 */ /* 输入框通用样式 */
.input-item { .input-item {
display: flex; display: flex;
@@ -405,7 +425,7 @@
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;
@@ -424,6 +444,14 @@
padding-right: 20rpx; padding-right: 20rpx;
} }
/* 输入框错误提示(在输入框下方) */
.input-error {
color: #e74c3c;
font-size: 22rpx;
line-height: 1.4;
padding: 10rpx 30rpx 0;
}
/* 获取验证码按钮 */ /* 获取验证码按钮 */
.get-verify-btn { .get-verify-btn {
position: absolute; position: absolute;

View File

@@ -1,9 +1,5 @@
<template> <template>
<view class="contentStyle"> <view class="contentStyle">
<view class="status-bar"></view>
<uni-nav-bar title="设置" left-icon="left" @clickLeft="goBack" backgroundColor="transparent" :border="false">
</uni-nav-bar>
<scroll-view class="page" scroll-y> <scroll-view class="page" scroll-y>
<view class="setting-item" v-for="(item, index) in settingList" :key="index" @click="onItemClick(item)"> <view class="setting-item" v-for="(item, index) in settingList" :key="index" @click="onItemClick(item)">
<text class="item-title">{{ item.title }}</text> <text class="item-title">{{ item.title }}</text>
@@ -29,21 +25,13 @@
<script setup> <script setup>
import { import {
ref, ref,
onMounted, onMounted
reactive
} from 'vue' } from 'vue'
import {
onReachBottom,
onLoad,
onUnload,
onPullDownRefresh
} from '@dcloudio/uni-app'
import { import {
authLogout, getUserProfile, getUserNotify, changeUserNotify, getAppVersion, checkAppUpdate, postUpdateLog authLogout, getUserProfile, getUserNotify, changeUserNotify, getAppVersion, checkAppUpdate, postUpdateLog
} from '/pageSubPack/api/apiSub.js' } from '/pageSubPack/api/apiSub.js'
// //
const statusBarHeight = ref(20)
const cacheSize = ref(0) const cacheSize = ref(0)
const currentVersion = ref('1.0.0') const currentVersion = ref('1.0.0')
const currentVersionCode = ref(1) const currentVersionCode = ref(1)
@@ -357,11 +345,6 @@
}) })
} }
const goBack = () => {
uni.switchTab({
url: '/pages/myIndex/myIndex'
});
}
onMounted(async () => { onMounted(async () => {
initCurrentVersion() initCurrentVersion()
@@ -466,10 +449,6 @@
opacity: 0.8; opacity: 0.8;
} }
.status-bar {
width: 100vw;
height: 46px;
}
</style> </style>
<style> <style>

View File

@@ -223,10 +223,8 @@
// 返回 // 返回
const goBack = () => { const goBack = () => {
uni.navigateTo({ uni.navigateBack();
url: '/pageSubPack/payment-list/paymentIndex' }
})
}
</script> </script>
<style lang="scss"> <style lang="scss">
page { page {

View File

@@ -186,9 +186,9 @@
} }
// 返回 // 返回
const goBack = () => { const goBack = () => {
uni.navigateTo({ url: '/pageSubPack/payment-list/paymentIndex' }); uni.navigateBack();
} }
</script> </script>
<style lang="scss"> <style lang="scss">
page { page {

View File

@@ -88,7 +88,7 @@
// 方法 // 方法
const goBack = () => { const goBack = () => {
uni.navigateTo({ url: '/pageSubPack/payment-list/paymentIndex' }); uni.navigateBack();
} }
const handlePrimaryClick = () => { const handlePrimaryClick = () => {

View File

@@ -135,11 +135,9 @@
// 返回 // 返回
const goBack = () => { const goBack = () => {
uni.navigateTo({ uni.navigateBack();
url: '/pageSubPack/payment-list/paymentIndex' }
});
}
// 立即缴费 — 通过微信拉起日照银行小程序进行支付 // 立即缴费 — 通过微信拉起日照银行小程序进行支付
const handlePay = () => { const handlePay = () => {
@@ -220,7 +218,7 @@
// 返回缴费列表 // 返回缴费列表
const handleBackToList = () => { const handleBackToList = () => {
uni.navigateTo({ uni.redirectTo({
url: '/pageSubPack/payment-list/paymentIndex' url: '/pageSubPack/payment-list/paymentIndex'
}); });
} }

View File

@@ -107,9 +107,7 @@
// 方法 // 方法
const goBack = () => { const goBack = () => {
uni.navigateTo({ uni.navigateBack();
url: '/pageSubPack/payment-list/paymentIndex'
});
} }
// 以下为原代码保留的方法(未使用但保持功能完整) // 以下为原代码保留的方法(未使用但保持功能完整)

View File

@@ -247,11 +247,9 @@
return `${height}rpx` return `${height}rpx`
} }
const goBack = () => { const goBack = () => {
uni.navigateTo({ uni.navigateBack();
url: '/pageSubPack/payment-list/paymentIndex' }
});
}
</script> </script>
<style lang="scss"> <style lang="scss">

View File

@@ -117,11 +117,9 @@
} }
// 返回 // 返回
const goBack = () => { const goBack = () => {
uni.navigateTo({ uni.navigateBack();
url: '/pageSubPack/payment-list/paymentIndex' }
});
}
// 立即缴费 — 通过微信拉起日照银行小程序进行支付 // 立即缴费 — 通过微信拉起日照银行小程序进行支付
const handlePay = () => { const handlePay = () => {
@@ -203,7 +201,7 @@
// 返回缴费列表 // 返回缴费列表
const handleBackToList = () => { const handleBackToList = () => {
uni.navigateTo({ uni.redirectTo({
url: '/pageSubPack/payment-list/paymentIndex' url: '/pageSubPack/payment-list/paymentIndex'
}); });
} }

View File

@@ -233,7 +233,7 @@
const onSearch = () => {} const onSearch = () => {}
const goBack = () => { const goBack = () => {
uni.navigateTo({ url: '/pageSubPack/payment-list/paymentIndex' }); uni.navigateBack();
} }
</script> </script>

View File

@@ -199,10 +199,9 @@
{ {
"root": "pageSubPack/my", "root": "pageSubPack/my",
"pages": [{ "pages": [{
"path": "settingIndex", "path": "settingIndex",
"style": { "style": {
"navigationBarTitleText": "", "navigationBarTitleText": "设置"
"navigationStyle": "custom"
} }
}, },
{ {

View File

@@ -183,6 +183,7 @@
getBannarList, getBannarList,
getReloadUserInfo getReloadUserInfo
} from "/pageSubPack/api/api.js" } from "/pageSubPack/api/api.js"
import { requireLogin } from '@/common/checkLogin.js'
// 列表数据状态 // 列表数据状态
@@ -199,19 +200,6 @@
const lastUserId = ref('') const lastUserId = ref('')
const pageReady = ref(false) 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 ''

View File

@@ -48,6 +48,7 @@
} from 'vue'; } from 'vue';
import { getUserProfile } from '../../pageSubPack/api/apiSub'; import { getUserProfile } from '../../pageSubPack/api/apiSub';
import {onShow} from '@dcloudio/uni-app' import {onShow} from '@dcloudio/uni-app'
import { requireLogin } from '@/common/checkLogin.js'
const list = ref([{ const list = ref([{
@@ -97,6 +98,7 @@
// 返回 // 返回
const onItemClick = (item) => { const onItemClick = (item) => {
if (!requireLogin()) return
if (item.title == '我的房屋') { if (item.title == '我的房屋') {
uni.navigateTo({ uni.navigateTo({
url: '/pageSubPack/my/myHouseIndex', url: '/pageSubPack/my/myHouseIndex',
@@ -130,6 +132,7 @@
} }
} }
const goSetting = () => { const goSetting = () => {
if (!requireLogin()) return
uni.navigateTo({ uni.navigateTo({
url: '/pageSubPack/my/settingIndex', url: '/pageSubPack/my/settingIndex',
success: res => {}, success: res => {},

View File

@@ -53,6 +53,7 @@
import { import {
ref ref
} from 'vue'; } from 'vue';
import { requireLogin } from '@/common/checkLogin.js'
const commonFuncList = ref([{ const commonFuncList = ref([{
@@ -138,7 +139,7 @@
// --方法---- // --方法----
const handleFuncClick = (item) => { const handleFuncClick = (item) => {
if (!requireLogin()) return
uni.setStorageSync('sourcePage', 'serviceIndex') uni.setStorageSync('sourcePage', 'serviceIndex')
uni.navigateTo({ uni.navigateTo({
url: item.path, url: item.path,
@@ -147,6 +148,7 @@
// banner跳转 // banner跳转
function bannnerClick(){ function bannnerClick(){
if (!requireLogin()) return
uni.navigateTo({ url: '/pageSubPack/online-repair/onlineRepair'}) uni.navigateTo({ url: '/pageSubPack/online-repair/onlineRepair'})
} }
</script> </script>