wangliang_wd

Merge branch 'main' of http://192.168.1.42/developOne/harmonyPool into main

* 'main' of http://192.168.1.42/developOne/harmonyPool:
  fix: 系统设置暗黑模式,缺省页.backgroundColor(Color.White)
  fix: 系统设置暗黑模式,Web容器增加.backgroundColor(Color.White)
  fix: 图文稿件详情页,点击图片查看大图,双击图片,屏幕黑屏。系统升级原来的代码不兼容,
@@ -27,6 +27,7 @@ export struct WdWebComponent { @@ -27,6 +27,7 @@ export struct WdWebComponent {
27 build() { 27 build() {
28 Column() { 28 Column() {
29 Web({ src: this.webUrl, controller: this.webviewControl }) 29 Web({ src: this.webUrl, controller: this.webviewControl })
  30 + .backgroundColor(Color.White)
30 .domStorageAccess(true) 31 .domStorageAccess(true)
31 .databaseAccess(true) 32 .databaseAccess(true)
32 .javaScriptAccess(true) 33 .javaScriptAccess(true)
@@ -59,6 +59,7 @@ export struct WdWebLocalComponent { @@ -59,6 +59,7 @@ export struct WdWebLocalComponent {
59 controller: this.webviewControl, 59 controller: this.webviewControl,
60 renderMode: RenderMode.SYNC_RENDER 60 renderMode: RenderMode.SYNC_RENDER
61 })// Web({ src: this.webResource, controller: this.webviewControl }) 61 })// Web({ src: this.webResource, controller: this.webviewControl })
  62 + .backgroundColor(Color.White)
62 .domStorageAccess(true) 63 .domStorageAccess(true)
63 .databaseAccess(true) 64 .databaseAccess(true)
64 .javaScriptAccess(true) 65 .javaScriptAccess(true)
@@ -3,7 +3,7 @@ import { matrix4, promptAction, window } from '@kit.ArkUI'; @@ -3,7 +3,7 @@ import { matrix4, promptAction, window } from '@kit.ArkUI';
3 import { BusinessError } from '@kit.BasicServicesKit'; 3 import { BusinessError } from '@kit.BasicServicesKit';
4 import { ScaleModel } from '../model/ScaleModel'; 4 import { ScaleModel } from '../model/ScaleModel';
5 import { OffsetModel } from '../model/OffsetModel'; 5 import { OffsetModel } from '../model/OffsetModel';
6 -import { windowSizeManager } from '../utils/Managers'; 6 +import { WindowSizeManager } from '../utils/Managers';
7 import { runWithAnimation } from '../utils/FuncUtils'; 7 import { runWithAnimation } from '../utils/FuncUtils';
8 import { PhotoListBean } from 'wdBean/Index'; 8 import { PhotoListBean } from 'wdBean/Index';
9 import { http } from '@kit.NetworkKit'; 9 import { http } from '@kit.NetworkKit';
@@ -31,12 +31,12 @@ export struct MultiPictureDetailItemComponent { @@ -31,12 +31,12 @@ export struct MultiPictureDetailItemComponent {
31 private swiperControllerItem: SwiperController = new SwiperController() 31 private swiperControllerItem: SwiperController = new SwiperController()
32 @State currentOffset: number = 0 32 @State currentOffset: number = 0
33 @Consume duration: number 33 @Consume duration: number
  34 + windowSizeManager: WindowSizeManager = new WindowSizeManager();
34 35
35 36
36 async aboutToAppear() { 37 async aboutToAppear() {
37 this.imageUri = this.MultiPictureDetailItem.picPath 38 this.imageUri = this.MultiPictureDetailItem.picPath
38 this.getPicture() 39 this.getPicture()
39 - console.log(TAG, JSON.stringify(this.MultiPictureDetailItem))  
40 } 40 }
41 41
42 /** 42 /**
@@ -113,15 +113,15 @@ export struct MultiPictureDetailItemComponent { @@ -113,15 +113,15 @@ export struct MultiPictureDetailItemComponent {
113 // const imageSource: image.ImageSource = image.createImageSource(this.imageUri); 113 // const imageSource: image.ImageSource = image.createImageSource(this.imageUri);
114 imageSource.getImageInfo(0).then((data: image.ImageInfo) => { 114 imageSource.getImageInfo(0).then((data: image.ImageInfo) => {
115 this.imageWHRatio = data.size.width / data.size.height; 115 this.imageWHRatio = data.size.width / data.size.height;
116 - this.imageDefaultSize = this.calcImageDefaultSize(this.imageWHRatio, windowSizeManager.get());  
117 - if (this.imageDefaultSize.width === windowSizeManager.get().width) { 116 + this.imageDefaultSize = this.calcImageDefaultSize(this.imageWHRatio, this.windowSizeManager.get());
  117 + if (this.imageDefaultSize.width === this.windowSizeManager.get().width) {
118 this.fitWH = "width"; 118 this.fitWH = "width";
119 } else { 119 } else {
120 this.fitWH = "height"; 120 this.fitWH = "height";
121 } 121 }
122 this.imageScaleInfo.maxScaleValue += this.fitWH === "width" ? 122 this.imageScaleInfo.maxScaleValue += this.fitWH === "width" ?
123 - (windowSizeManager.get().height / this.imageDefaultSize.height) :  
124 - (windowSizeManager.get().width / this.imageDefaultSize.width); 123 + (this.windowSizeManager.get().height / this.imageDefaultSize.height) :
  124 + (this.windowSizeManager.get().width / this.imageDefaultSize.width);
125 }).catch((err: BusinessError) => { 125 }).catch((err: BusinessError) => {
126 console.error(`[error][getImageInfo]${err.message}`); 126 console.error(`[error][getImageInfo]${err.message}`);
127 }); 127 });
@@ -275,7 +275,7 @@ export struct MultiPictureDetailItemComponent { @@ -275,7 +275,7 @@ export struct MultiPictureDetailItemComponent {
275 // 已经是缩小状态,双击放大 275 // 已经是缩小状态,双击放大
276 fn = () => { 276 fn = () => {
277 this.isEnableSwipe = false; 277 this.isEnableSwipe = false;
278 - const ratio: number = this.calcFitScaleRatio(this.imageDefaultSize, windowSizeManager.get()); 278 + const ratio: number = this.calcFitScaleRatio(this.imageDefaultSize, this.windowSizeManager.get());
279 this.imageScaleInfo.scaleValue = ratio; 279 this.imageScaleInfo.scaleValue = ratio;
280 this.imageOffsetInfo.reset(); 280 this.imageOffsetInfo.reset();
281 this.matrix = matrix4.identity().scale({ 281 this.matrix = matrix4.identity().scale({
@@ -144,7 +144,7 @@ export struct EmptyComponent { @@ -144,7 +144,7 @@ export struct EmptyComponent {
144 .type(ButtonType.Normal) 144 .type(ButtonType.Normal)
145 .width(80) 145 .width(80)
146 .height(28) 146 .height(28)
147 - .backgroundColor('#fffffff') 147 + .backgroundColor(Color.White)
148 .fontColor('#FF666666') 148 .fontColor('#FF666666')
149 .border({ width: 1 }) 149 .border({ width: 1 })
150 .borderColor('#FFEDEDED') 150 .borderColor('#FFEDEDED')
1 import { window } from '@kit.ArkUI'; 1 import { window } from '@kit.ArkUI';
  2 +import { common } from '@kit.AbilityKit';
2 3
3 -class WindowSizeManager { 4 +export class WindowSizeManager {
4 private size: window.Size = { width: 0, height: 0 }; 5 private size: window.Size = { width: 0, height: 0 };
  6 + // 获取UIAbility上下文
  7 + private context: common.UIAbilityContext = getContext(this) as common.UIAbilityContext
5 8
6 constructor() { 9 constructor() {
7 - window.getLastWindow(getContext()).then((value: window.Window) => { 10 + window.getLastWindow(this.context).then((value: window.Window) => {
8 const rect: window.Rect = value.getWindowProperties().windowRect; 11 const rect: window.Rect = value.getWindowProperties().windowRect;
9 this.size.width = px2vp(rect.width); 12 this.size.width = px2vp(rect.width);
10 this.size.height = px2vp(rect.height); 13 this.size.height = px2vp(rect.height);
11 - console.log(`[windowWidth]${this.size.width} [windowHeight]${this.size.height}`); 14 + // console.log('MultiPictureDetailItemComponent', `[windowWidth]${this.size.width} [windowHeight]${this.size.height}`);
12 }) 15 })
13 } 16 }
14 17
15 get(): window.Size { 18 get(): window.Size {
16 return this.size; 19 return this.size;
17 } 20 }
18 -}  
19 -  
20 -export const windowSizeManager: WindowSizeManager = new WindowSizeManager();  
  21 +}
@@ -73,6 +73,7 @@ struct LoginProtocolWebview { @@ -73,6 +73,7 @@ struct LoginProtocolWebview {
73 .height(44) 73 .height(44)
74 if(this.isConnectNetwork){ 74 if(this.isConnectNetwork){
75 Web({ src: this.webUrl, controller: this.webviewController }) 75 Web({ src: this.webUrl, controller: this.webviewController })
  76 + .backgroundColor(Color.White)
76 .domStorageAccess(true) 77 .domStorageAccess(true)
77 .databaseAccess(true) 78 .databaseAccess(true)
78 .javaScriptAccess(true) 79 .javaScriptAccess(true)