|
@@ -27,13 +27,17 @@ export class ScreenCtrl extends ModuleControl<EditorModule> {
|
|
|
docHeight: window.innerHeight, //实际屏幕高度
|
|
|
safeFactor: 0.8,
|
|
|
})
|
|
|
-
|
|
|
+ get isShortPage () {
|
|
|
+ return this.state.pageMode == "short";
|
|
|
+ }
|
|
|
+
|
|
|
initEvent() {
|
|
|
+ if ( !this.store.isEditMode ) return;
|
|
|
+
|
|
|
this.state.onUseForChanged(()=>this.updateAdapterState());
|
|
|
this.state.onPageModeChanged(()=>this.updateAdapterState());
|
|
|
this.state.onPageSizeTypeChanged(()=>this.updateAdapterState());
|
|
|
|
|
|
-
|
|
|
const size = 3;
|
|
|
const safeFactor = Math.pow((PCRates[0] / PCRates[1]) , 1.0 / size);
|
|
|
let min = 0.42;
|
|
@@ -52,18 +56,26 @@ export class ScreenCtrl extends ModuleControl<EditorModule> {
|
|
|
}
|
|
|
|
|
|
getAdapterIndex() {
|
|
|
+ if(this.state.pageMode == "long") return 1;
|
|
|
return ["short", "normal", "long"].indexOf(this.state.pageSizeType)
|
|
|
}
|
|
|
|
|
|
updateAdapterState() {
|
|
|
+ if (!this.store.rootPage) return;
|
|
|
+
|
|
|
this.store.streamCardIds.forEach(c=>{
|
|
|
const card = this.helper.findComp(c) as DesignComp;
|
|
|
card.setW(this.getCurrScreenWidth());
|
|
|
- card.setH(this.getCurrScreenHeight());
|
|
|
+ this.helper.extendStreamCard(card.id);
|
|
|
})
|
|
|
const w = this.helper.designSizeToPx(this.getCurrScreenWidth());
|
|
|
const h = this.helper.designSizeToPx(this.getCurrScreenHeight());
|
|
|
+
|
|
|
this.controls.editorCtrl.state.setPage({w, h});
|
|
|
+
|
|
|
+
|
|
|
+ this.store.rootPage.layout.size[0] = this.getCurrScreenWidth();
|
|
|
+ this.store.rootPage.layout.size[1] = this.getCurrScreenHeight();
|
|
|
}
|
|
|
|
|
|
getCurrScreenHeight() {
|
|
@@ -78,7 +90,7 @@ export class ScreenCtrl extends ModuleControl<EditorModule> {
|
|
|
getCurrScreenWidth() {
|
|
|
const currScreenIndex = this.getAdapterIndex();
|
|
|
const pageValue = this.state
|
|
|
- if ( pageValue.useFor == "pc") {
|
|
|
+ if ( pageValue.useFor == "pc" ) {
|
|
|
return PCWidths[currScreenIndex];
|
|
|
}
|
|
|
return MobleDesignWidth
|