Merge origin/main: 登录页改版+真机横屏锁定 与 打包模式多成员特性合并(rem 方案按平台分工)
This commit is contained in:
commit
3b40bdb534
@ -5,7 +5,8 @@ const DESIGN_WIDTH = 1920
|
|||||||
const DESIGN_HEIGHT = 1280
|
const DESIGN_HEIGHT = 1280
|
||||||
const BASE_FONT_SIZE = 100
|
const BASE_FONT_SIZE = 100
|
||||||
// 整体缩放系数:<1 整体缩小,>1 整体放大(布局偏大就调小这个值)
|
// 整体缩放系数:<1 整体缩小,>1 整体放大(布局偏大就调小这个值)
|
||||||
// 0.45 平板触摸尺寸基准偏大;桌面全屏(1920×1080)统一调整为 0.28
|
// 0.45 平板触摸尺寸基准偏大;桌面 H5/Electron(1920×1080)统一调整为 0.28
|
||||||
|
// 真机 APP-PLUS 的 rem 由下方全局纯 CSS 承担(0.675 系数,修复真机退出登录后白屏),JS 仅 H5 参与计算
|
||||||
const REM_SCALE = 0.28
|
const REM_SCALE = 0.28
|
||||||
|
|
||||||
function logScreenInfo () {
|
function logScreenInfo () {
|
||||||
@ -82,6 +83,12 @@ export default {
|
|||||||
|
|
||||||
<style>
|
<style>
|
||||||
/*每个页面公共css */
|
/*每个页面公共css */
|
||||||
|
/* rem 基准:设计稿 1920×1280,REM_SCALE=0.675
|
||||||
|
fontSize = min(w/1920, h/1280) × 67.5px = min(3.515625vw, 5.2734375vh)
|
||||||
|
纯 CSS 实现,首帧即正确,不依赖 renderjs 时序(修复真机退出登录后白屏) */
|
||||||
|
html {
|
||||||
|
font-size: min(3.515625vw, 5.2734375vh);
|
||||||
|
}
|
||||||
|
|
||||||
/* H5/Electron 下 picker 下拉弹窗宽度与触发下拉框一致(高特异性覆盖库默认 300px),阴影调淡 */
|
/* H5/Electron 下 picker 下拉弹窗宽度与触发下拉框一致(高特异性覆盖库默认 300px),阴影调淡 */
|
||||||
uni-picker .uni-picker-container .uni-picker-custom,
|
uni-picker .uni-picker-container .uni-picker-custom,
|
||||||
|
|||||||
@ -12,7 +12,7 @@
|
|||||||
"compilerVersion" : 3,
|
"compilerVersion" : 3,
|
||||||
"screenOrientation" : [ "landscape-primary", "landscape-secondary" ],
|
"screenOrientation" : [ "landscape-primary", "landscape-secondary" ],
|
||||||
"splashscreen" : {
|
"splashscreen" : {
|
||||||
"alwaysShowBeforeRender" : true,
|
"alwaysShowBeforeRender" : false,
|
||||||
"waiting" : true,
|
"waiting" : true,
|
||||||
"autoclose" : true,
|
"autoclose" : true,
|
||||||
"delay" : 0
|
"delay" : 0
|
||||||
|
|||||||
@ -40,6 +40,10 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
|
this.lockLandscape()
|
||||||
|
setTimeout(() => {
|
||||||
|
this.lockLandscape()
|
||||||
|
}, 300)
|
||||||
uni.hideKeyboard?.()
|
uni.hideKeyboard?.()
|
||||||
;[80, 180, 320, 520].forEach((delay) => {
|
;[80, 180, 320, 520].forEach((delay) => {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
@ -86,6 +90,29 @@ export default {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
// 强制锁定横屏 + 全屏重排:真机 reLaunch 后新 WebView 可能以竖屏尺寸创建,需 setStyle 强制全屏
|
||||||
|
lockLandscape() {
|
||||||
|
// #ifdef APP-PLUS
|
||||||
|
try {
|
||||||
|
const screen = plus && plus.screen
|
||||||
|
if (screen && typeof screen.lockOrientation === 'function') {
|
||||||
|
screen.lockOrientation('landscape')
|
||||||
|
console.log('[index] lockOrientation=landscape done')
|
||||||
|
}
|
||||||
|
if (typeof plus !== 'undefined' && plus.webview) {
|
||||||
|
const wv = plus.webview.currentWebview()
|
||||||
|
if (wv && typeof wv.setStyle === 'function') {
|
||||||
|
wv.setStyle({ top: '0px', bottom: '0px', left: '0px', right: '0px' })
|
||||||
|
console.log('[index] webview setStyle fullscreen done')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true
|
||||||
|
} catch (e) {
|
||||||
|
console.error('[index] lockOrientation 异常:', e)
|
||||||
|
}
|
||||||
|
// #endif
|
||||||
|
return false
|
||||||
|
},
|
||||||
getMenuTitle(menu) {
|
getMenuTitle(menu) {
|
||||||
return menu?.meta?.title || menu?.name || '未命名菜单'
|
return menu?.meta?.title || menu?.name || '未命名菜单'
|
||||||
},
|
},
|
||||||
@ -205,7 +232,12 @@ export default {
|
|||||||
<script module="remInject" lang="renderjs">
|
<script module="remInject" lang="renderjs">
|
||||||
export default {
|
export default {
|
||||||
mounted() {
|
mounted() {
|
||||||
// 整体缩放系数:<1 缩小,>1 放大(布局偏大就调小);0.45 平板基准偏大,全站统一 0.28
|
// #ifdef APP-PLUS
|
||||||
|
// 真机 rem 由 App.vue 全局纯 CSS(html { font-size: min(3.515625vw, 5.2734375vh) },0.675 系数)承担,
|
||||||
|
// renderjs 不再覆盖,避免与 CSS 方案互相覆盖导致白屏/抖动
|
||||||
|
return
|
||||||
|
// #endif
|
||||||
|
// 整体缩放系数:<1 缩小,>1 放大(布局偏大就调小);0.45 平板基准偏大,H5/Electron 桌面统一 0.28
|
||||||
const REM_SCALE = 0.28
|
const REM_SCALE = 0.28
|
||||||
const setFontSize = () => {
|
const setFontSize = () => {
|
||||||
const docEl = document.documentElement
|
const docEl = document.documentElement
|
||||||
@ -227,7 +259,6 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
.layout-page {
|
.layout-page {
|
||||||
min-height: 100vh;
|
min-height: 100vh;
|
||||||
|
|||||||
@ -1763,7 +1763,12 @@ export default {
|
|||||||
<script module="remInject" lang="renderjs">
|
<script module="remInject" lang="renderjs">
|
||||||
export default {
|
export default {
|
||||||
mounted() {
|
mounted() {
|
||||||
// 整体缩放系数:<1 缩小,>1 放大(布局偏大就调小);0.45 平板基准偏大,全站统一 0.28
|
// #ifdef APP-PLUS
|
||||||
|
// 真机 rem 由 App.vue 全局纯 CSS(html { font-size: min(3.515625vw, 5.2734375vh) },0.675 系数)承担,
|
||||||
|
// renderjs 不再覆盖,避免与 CSS 方案互相覆盖导致白屏/抖动
|
||||||
|
return
|
||||||
|
// #endif
|
||||||
|
// 整体缩放系数:<1 缩小,>1 放大(布局偏大就调小);0.45 平板基准偏大,H5/Electron 桌面统一 0.28
|
||||||
const REM_SCALE = 0.28
|
const REM_SCALE = 0.28
|
||||||
const setFontSize = () => {
|
const setFontSize = () => {
|
||||||
const docEl = document.documentElement
|
const docEl = document.documentElement
|
||||||
@ -1785,7 +1790,6 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
.update-mask {
|
.update-mask {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
|
|||||||
@ -3153,7 +3153,12 @@ export default {
|
|||||||
<script module="remInject" lang="renderjs">
|
<script module="remInject" lang="renderjs">
|
||||||
export default {
|
export default {
|
||||||
mounted() {
|
mounted() {
|
||||||
// 整体缩放系数:<1 缩小,>1 放大(布局偏大就调小);0.45 平板基准偏大,全站统一 0.28
|
// #ifdef APP-PLUS
|
||||||
|
// 真机 rem 由 App.vue 全局纯 CSS(html { font-size: min(3.515625vw, 5.2734375vh) },0.675 系数)承担,
|
||||||
|
// renderjs 不再覆盖,避免与 CSS 方案互相覆盖导致白屏/抖动
|
||||||
|
return
|
||||||
|
// #endif
|
||||||
|
// 整体缩放系数:<1 缩小,>1 放大(布局偏大就调小);0.45 平板基准偏大,H5/Electron 桌面统一 0.28
|
||||||
const REM_SCALE = 0.28
|
const REM_SCALE = 0.28
|
||||||
const setFontSize = () => {
|
const setFontSize = () => {
|
||||||
const docEl = document.documentElement
|
const docEl = document.documentElement
|
||||||
@ -3175,7 +3180,6 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
.page {
|
.page {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
|||||||
@ -555,12 +555,18 @@ export default {
|
|||||||
}
|
}
|
||||||
this.restoreWorkbenchMembers()
|
this.restoreWorkbenchMembers()
|
||||||
this.restoreScanRecords()
|
this.restoreScanRecords()
|
||||||
|
// 真机进入页面即锁横屏(远程提交特性);成员恢复沿用本地多成员模型 restoreWorkbenchMembers(已兼容旧单成员缓存)
|
||||||
|
this.lockLandscape()
|
||||||
this.loadTodayPackStat()
|
this.loadTodayPackStat()
|
||||||
this.loadWorkbenchInfo()
|
this.loadWorkbenchInfo()
|
||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
try {
|
try {
|
||||||
this.pageActive = true
|
this.pageActive = true
|
||||||
|
this.lockLandscape()
|
||||||
|
setTimeout(() => {
|
||||||
|
this.lockLandscape()
|
||||||
|
}, 300)
|
||||||
this.attachPlusKeyboardListener()
|
this.attachPlusKeyboardListener()
|
||||||
this.attachGlobalKeyboardListener()
|
this.attachGlobalKeyboardListener()
|
||||||
this.startScanWatchdog()
|
this.startScanWatchdog()
|
||||||
@ -579,6 +585,29 @@ export default {
|
|||||||
this.clearIdleAutoLogoutTimer()
|
this.clearIdleAutoLogoutTimer()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
// 强制锁定横屏 + 全屏重排:真机 reLaunch 后新 WebView 可能以竖屏尺寸创建,需 setStyle 强制全屏
|
||||||
|
lockLandscape() {
|
||||||
|
// #ifdef APP-PLUS
|
||||||
|
try {
|
||||||
|
const screen = plus && plus.screen
|
||||||
|
if (screen && typeof screen.lockOrientation === 'function') {
|
||||||
|
screen.lockOrientation('landscape')
|
||||||
|
console.log('[packaging] lockOrientation=landscape done')
|
||||||
|
}
|
||||||
|
if (typeof plus !== 'undefined' && plus.webview) {
|
||||||
|
const wv = plus.webview.currentWebview()
|
||||||
|
if (wv && typeof wv.setStyle === 'function') {
|
||||||
|
wv.setStyle({ top: '0px', bottom: '0px', left: '0px', right: '0px' })
|
||||||
|
console.log('[packaging] webview setStyle fullscreen done')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true
|
||||||
|
} catch (e) {
|
||||||
|
console.error('[packaging] lockOrientation 异常:', e)
|
||||||
|
}
|
||||||
|
// #endif
|
||||||
|
return false
|
||||||
|
},
|
||||||
handlePackSearch() {
|
handlePackSearch() {
|
||||||
const kw = this.dedupeRepeatedScan(String(this.keyword || '').trim())
|
const kw = this.dedupeRepeatedScan(String(this.keyword || '').trim())
|
||||||
if (!kw) {
|
if (!kw) {
|
||||||
@ -2810,7 +2839,12 @@ export default {
|
|||||||
<script module="remInject" lang="renderjs">
|
<script module="remInject" lang="renderjs">
|
||||||
export default {
|
export default {
|
||||||
mounted() {
|
mounted() {
|
||||||
// 整体缩放系数:<1 缩小,>1 放大(布局偏大就调小);0.45 平板基准偏大,全站统一 0.28
|
// #ifdef APP-PLUS
|
||||||
|
// 真机 rem 由 App.vue 全局纯 CSS(html { font-size: min(3.515625vw, 5.2734375vh) },0.675 系数)承担,
|
||||||
|
// renderjs 不再覆盖,避免与 CSS 方案互相覆盖导致白屏/抖动
|
||||||
|
return
|
||||||
|
// #endif
|
||||||
|
// 整体缩放系数:<1 缩小,>1 放大(布局偏大就调小);0.45 平板基准偏大,H5/Electron 桌面统一 0.28
|
||||||
const REM_SCALE = 0.28
|
const REM_SCALE = 0.28
|
||||||
const setFontSize = () => {
|
const setFontSize = () => {
|
||||||
const docEl = document.documentElement
|
const docEl = document.documentElement
|
||||||
@ -2832,7 +2866,6 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
.page {
|
.page {
|
||||||
height: 100vh;
|
height: 100vh;
|
||||||
|
|||||||
@ -33,7 +33,12 @@ export default {
|
|||||||
<script module="remInject" lang="renderjs">
|
<script module="remInject" lang="renderjs">
|
||||||
export default {
|
export default {
|
||||||
mounted() {
|
mounted() {
|
||||||
// 整体缩放系数:<1 缩小,>1 放大(布局偏大就调小);0.45 平板基准偏大,全站统一 0.28
|
// #ifdef APP-PLUS
|
||||||
|
// 真机 rem 由 App.vue 全局纯 CSS(html { font-size: min(3.515625vw, 5.2734375vh) },0.675 系数)承担,
|
||||||
|
// renderjs 不再覆盖,避免与 CSS 方案互相覆盖导致白屏/抖动
|
||||||
|
return
|
||||||
|
// #endif
|
||||||
|
// 整体缩放系数:<1 缩小,>1 放大(布局偏大就调小);0.45 平板基准偏大,H5/Electron 桌面统一 0.28
|
||||||
const REM_SCALE = 0.28
|
const REM_SCALE = 0.28
|
||||||
const setFontSize = () => {
|
const setFontSize = () => {
|
||||||
const docEl = document.documentElement
|
const docEl = document.documentElement
|
||||||
@ -55,7 +60,6 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
.page {
|
.page {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
|||||||
@ -33,7 +33,12 @@ export default {
|
|||||||
<script module="remInject" lang="renderjs">
|
<script module="remInject" lang="renderjs">
|
||||||
export default {
|
export default {
|
||||||
mounted() {
|
mounted() {
|
||||||
// 整体缩放系数:<1 缩小,>1 放大(布局偏大就调小);0.45 平板基准偏大,全站统一 0.28
|
// #ifdef APP-PLUS
|
||||||
|
// 真机 rem 由 App.vue 全局纯 CSS(html { font-size: min(3.515625vw, 5.2734375vh) },0.675 系数)承担,
|
||||||
|
// renderjs 不再覆盖,避免与 CSS 方案互相覆盖导致白屏/抖动
|
||||||
|
return
|
||||||
|
// #endif
|
||||||
|
// 整体缩放系数:<1 缩小,>1 放大(布局偏大就调小);0.45 平板基准偏大,H5/Electron 桌面统一 0.28
|
||||||
const REM_SCALE = 0.28
|
const REM_SCALE = 0.28
|
||||||
const setFontSize = () => {
|
const setFontSize = () => {
|
||||||
const docEl = document.documentElement
|
const docEl = document.documentElement
|
||||||
@ -55,7 +60,6 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
.page {
|
.page {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user