f
This commit is contained in:
@@ -11,6 +11,13 @@ export default defineManifestConfig({
|
||||
'app-plus': {
|
||||
usingComponents: true,
|
||||
nvueStyleCompiler: 'uni-app',
|
||||
darkmode: false,
|
||||
safearea: {
|
||||
background: '#ffffff',
|
||||
bottom: {
|
||||
offset: 'none',
|
||||
},
|
||||
},
|
||||
compatible: {
|
||||
ignoreVersion: true,
|
||||
runtimeVersion: "1.7.0,1.8.0,1.9.0",
|
||||
@@ -49,7 +56,10 @@ export default defineManifestConfig({
|
||||
"NSLocalNetworkUsageDescription": "需要本地网络进行服务使用",
|
||||
"NSPhotoLibraryAddUsageDescription": "需要保存二维码海报"
|
||||
},
|
||||
"idfa": false
|
||||
"idfa": false,
|
||||
"plist": {
|
||||
"UIUserInterfaceStyle": "Light"
|
||||
}
|
||||
},
|
||||
/* SDK配置 */
|
||||
"sdkConfigs": {
|
||||
|
||||
@@ -38,10 +38,10 @@ export default defineUniPages({
|
||||
{ path: 'pages/withdraw-details', auth: true, style: { navigationBarTitleText: '提现记录' } },
|
||||
],
|
||||
globalStyle: {
|
||||
backgroundColor: '@bgColor',
|
||||
backgroundColorBottom: '@bgColorBottom',
|
||||
backgroundColorTop: '@bgColorTop',
|
||||
backgroundTextStyle: '@bgTxtStyle',
|
||||
backgroundColor: '#fcfcfc',
|
||||
backgroundColorBottom: '#fcfcfc',
|
||||
backgroundColorTop: '#fcfcfc',
|
||||
backgroundTextStyle: 'dark',
|
||||
navigationBarBackgroundColor: '#ffffff',
|
||||
navigationBarTextStyle: 'black',
|
||||
navigationBarTitleText: 'BDRP',
|
||||
|
||||
13
src/App.vue
13
src/App.vue
@@ -1,10 +1,21 @@
|
||||
<script setup lang="ts">
|
||||
import { installPrivacyGuards } from '@/composables/usePrivacyConsent'
|
||||
import {
|
||||
ensurePrivacyConsentIfNeeded,
|
||||
installPrivacyGuards,
|
||||
} from '@/composables/usePrivacyConsent'
|
||||
|
||||
const NOTIFICATION_SESSION_KEY = 'bdrp_app_shown_notifications'
|
||||
|
||||
onLaunch(async () => {
|
||||
installPrivacyGuards()
|
||||
uni.removeStorageSync(NOTIFICATION_SESSION_KEY)
|
||||
// #ifdef APP-PLUS
|
||||
plus.nativeUI.setUIStyle('light')
|
||||
// #endif
|
||||
ensurePrivacyConsentIfNeeded()
|
||||
})
|
||||
|
||||
onShow(() => {
|
||||
ensurePrivacyConsentIfNeeded()
|
||||
})
|
||||
</script>
|
||||
|
||||
2
src/auto-imports.d.ts
vendored
2
src/auto-imports.d.ts
vendored
@@ -43,6 +43,7 @@ declare global {
|
||||
const effectScope: typeof import('vue')['effectScope']
|
||||
const ensureCurrentPageAccess: typeof import('./composables/useNavigationAuthGuard')['ensureCurrentPageAccess']
|
||||
const ensurePageAccessByUrl: typeof import('./composables/useNavigationAuthGuard')['ensurePageAccessByUrl']
|
||||
const ensurePrivacyConsentIfNeeded: typeof import('./composables/usePrivacyConsent')['ensurePrivacyConsentIfNeeded']
|
||||
const extendRef: typeof import('@vueuse/core')['extendRef']
|
||||
const getAgentInfo: typeof import('./utils/storage')['getAgentInfo']
|
||||
const getCurrentInstance: typeof import('vue')['getCurrentInstance']
|
||||
@@ -438,6 +439,7 @@ declare module 'vue' {
|
||||
readonly effectScope: UnwrapRef<typeof import('vue')['effectScope']>
|
||||
readonly ensureCurrentPageAccess: UnwrapRef<typeof import('./composables/useNavigationAuthGuard')['ensureCurrentPageAccess']>
|
||||
readonly ensurePageAccessByUrl: UnwrapRef<typeof import('./composables/useNavigationAuthGuard')['ensurePageAccessByUrl']>
|
||||
readonly ensurePrivacyConsentIfNeeded: UnwrapRef<typeof import('./composables/usePrivacyConsent')['ensurePrivacyConsentIfNeeded']>
|
||||
readonly extendRef: UnwrapRef<typeof import('@vueuse/core')['extendRef']>
|
||||
readonly getAgentInfo: UnwrapRef<typeof import('./utils/storage')['getAgentInfo']>
|
||||
readonly getCurrentInstance: UnwrapRef<typeof import('vue')['getCurrentInstance']>
|
||||
|
||||
5
src/components.d.ts
vendored
5
src/components.d.ts
vendored
@@ -20,5 +20,10 @@ declare module 'vue' {
|
||||
RealNameAuthDialog: typeof import('./components/RealNameAuthDialog.vue')['default']
|
||||
SectionTitle: typeof import('./components/SectionTitle.vue')['default']
|
||||
VipBanner: typeof import('./components/VipBanner.vue')['default']
|
||||
WdButton: typeof import('wot-design-uni/components/wd-button/wd-button.vue')['default']
|
||||
WdNavbar: typeof import('wot-design-uni/components/wd-navbar/wd-navbar.vue')['default']
|
||||
WdPopup: typeof import('wot-design-uni/components/wd-popup/wd-popup.vue')['default']
|
||||
WdTabbar: typeof import('wot-design-uni/components/wd-tabbar/wd-tabbar.vue')['default']
|
||||
WdTabbarItem: typeof import('wot-design-uni/components/wd-tabbar-item/wd-tabbar-item.vue')['default']
|
||||
}
|
||||
}
|
||||
|
||||
@@ -259,20 +259,4 @@ function close() {
|
||||
font-size: 15px;
|
||||
}
|
||||
}
|
||||
|
||||
/* 深色模式适配 */
|
||||
@media (prefers-color-scheme: dark) {
|
||||
.guide-content {
|
||||
background: rgba(30, 30, 30, 0.95);
|
||||
color: #e5e5e5;
|
||||
}
|
||||
|
||||
.guide-title {
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
.guide-instruction {
|
||||
color: #d1d5db;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -106,3 +106,21 @@ export function installPrivacyGuards() {
|
||||
installPrivacyNavigationGuard()
|
||||
installPrivacyRequestGuard()
|
||||
}
|
||||
|
||||
const PRIVACY_FLOW_ROUTES = new Set([
|
||||
'pages/privacy-consent',
|
||||
'pages/privacy-policy',
|
||||
'pages/launch',
|
||||
])
|
||||
|
||||
/** 未同意时若已落在业务页(如 iOS web-view 返回后栈异常),强制回到授权页 */
|
||||
export function ensurePrivacyConsentIfNeeded() {
|
||||
if (hasAcceptedPrivacyPolicy())
|
||||
return
|
||||
const pages = getCurrentPages()
|
||||
const page = pages[pages.length - 1] as { route?: string } | undefined
|
||||
const route = normalizeRoute(page?.route || '')
|
||||
if (PRIVACY_FLOW_ROUTES.has(route))
|
||||
return
|
||||
uni.reLaunch({ url: PRIVACY_CONSENT_PAGE })
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ import {
|
||||
useRouter,
|
||||
} from '@/composables/uni-router'
|
||||
import { ensurePageAccessByUrl } from '@/composables/useNavigationAuthGuard'
|
||||
import { ensurePrivacyConsentIfNeeded } from '@/composables/usePrivacyConsent'
|
||||
import { useGlobalNotification } from '@/composables/useGlobalNotification'
|
||||
|
||||
const router = useRouter()
|
||||
@@ -91,6 +92,7 @@ onMounted(() => {
|
||||
})
|
||||
|
||||
onShow(() => {
|
||||
ensurePrivacyConsentIfNeeded()
|
||||
syncTitle()
|
||||
ensureAuthIfNeeded()
|
||||
console.log('[通知DEBUG] default layout onShow')
|
||||
|
||||
@@ -4,7 +4,7 @@ import { onMounted, reactive, ref } from 'vue'
|
||||
import { getCurrentUniRoute } from '@/composables/uni-router'
|
||||
import { openCustomerService } from '@/composables/useCustomerService'
|
||||
import { ensurePageAccessByUrl } from '@/composables/useNavigationAuthGuard'
|
||||
import { getPrivacyConsentPageUrl } from '@/composables/usePrivacyConsent'
|
||||
import { ensurePrivacyConsentIfNeeded, getPrivacyConsentPageUrl } from '@/composables/usePrivacyConsent'
|
||||
import { useGlobalNotification } from '@/composables/useGlobalNotification'
|
||||
|
||||
const {
|
||||
@@ -75,6 +75,7 @@ function ensureAuthIfNeeded() {
|
||||
}
|
||||
|
||||
onShow(() => {
|
||||
ensurePrivacyConsentIfNeeded()
|
||||
syncTabbar()
|
||||
ensureAuthIfNeeded()
|
||||
console.log('[通知DEBUG] home layout onShow')
|
||||
|
||||
@@ -13,7 +13,7 @@ async function routeOnLaunch() {
|
||||
routing.value = true
|
||||
try {
|
||||
if (!hasAcceptedPrivacyPolicy()) {
|
||||
uni.reLaunch({ url: getPrivacyConsentPageUrl() })
|
||||
uni.redirectTo({ url: getPrivacyConsentPageUrl() })
|
||||
return
|
||||
}
|
||||
await bootstrap()
|
||||
|
||||
@@ -1,15 +1,27 @@
|
||||
<script setup lang="ts">
|
||||
import { useAppBootstrap } from '@/composables/useAppBootstrap'
|
||||
import { useReportWebview } from '@/composables/useReportWebview'
|
||||
import { getPrivacyDecision, setPrivacyDecision } from '@/composables/usePrivacyConsent'
|
||||
|
||||
definePage({ layout: false })
|
||||
|
||||
const { bootstrap } = useAppBootstrap()
|
||||
const { buildSitePathUrl } = useReportWebview()
|
||||
const handling = ref(false)
|
||||
const rejectConfirming = ref(false)
|
||||
|
||||
function openPrivacyPolicy() {
|
||||
const url = buildSitePathUrl('/app/privacyPolicy')
|
||||
// #ifdef APP-IOS
|
||||
if (url) {
|
||||
plus.runtime.openURL(url)
|
||||
return
|
||||
}
|
||||
uni.showToast({ title: '隐私政策链接不可用', icon: 'none' })
|
||||
// #endif
|
||||
// #ifndef APP-IOS
|
||||
uni.navigateTo({ url: '/pages/privacy-policy' })
|
||||
// #endif
|
||||
}
|
||||
|
||||
async function handleAgree() {
|
||||
|
||||
@@ -133,25 +133,6 @@
|
||||
|
||||
}
|
||||
|
||||
/* ===== 暗色主题支持 ===== */
|
||||
@media (prefers-color-scheme: dark) {
|
||||
:root {
|
||||
--color-text-primary: #ffffff;
|
||||
--color-text-secondary: #e5e5e5;
|
||||
--color-text-tertiary: #a3a3a3;
|
||||
--color-text-quaternary: #737373;
|
||||
|
||||
--color-bg-primary: #1a1a1a;
|
||||
--color-bg-secondary: #262626;
|
||||
--color-bg-tertiary: #404040;
|
||||
--color-bg-quaternary: #525252;
|
||||
|
||||
--color-border-primary: #404040;
|
||||
--color-border-secondary: #525252;
|
||||
--color-border-tertiary: #737373;
|
||||
}
|
||||
}
|
||||
|
||||
/* ===== 工具类 ===== */
|
||||
.text-primary {
|
||||
color: var(--color-primary) !important;
|
||||
|
||||
Reference in New Issue
Block a user