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 |> 文件替换
  fix |> 版本修改
  ref |> 冷启动优化
  fix |> 评论行数显示优化
... ... @@ -2,8 +2,8 @@
"app": {
"bundleName": "com.peopledailychina.hosactivity",
"vendor": "$string:app_vendor",
"versionCode": 7402,
"versionName": "7.4.0.2",
"versionCode": 7403,
"versionName": "7.4.0.3",
"icon": "$media:app_icon",
"label": "$string:app_name"
}
... ...
... ... @@ -49,6 +49,7 @@
"signingConfig": "default",
"compileSdkVersion": "5.0.0(12)",
"compatibleSdkVersion": "5.0.0(12)",
"compatibleSdkVersionStage": "beta3",
"runtimeOS": "HarmonyOS",
"buildOption": {
"arkOptions": {
... ... @@ -64,6 +65,7 @@
"signingConfig": "release",
"compileSdkVersion": "5.0.0(12)",
"compatibleSdkVersion": "5.0.0(12)",
"compatibleSdkVersionStage": "beta3",
"runtimeOS": "HarmonyOS",
"buildOption": {
"arkOptions": {
... ...
... ... @@ -5,6 +5,7 @@ import { AccountManagerUtils } from '../utils/AccountManagerUtils';
import { UserDataLocal } from '../utils/UserDataLocal';
import { EmitterUtils } from '../utils/EmitterUtils';
import { EmitterEventId } from '../utils/EmitterEventId';
import { Logger } from '../utils/Logger';
export class UmengStats {
... ... @@ -17,7 +18,7 @@ export class UmengStats {
preInit({
context: context.getApplicationContext(),
plugins: [new InternalPlugin()],
enableLog: true
enableLog: Logger.isDebug
});
}
... ...
... ... @@ -75,10 +75,19 @@ export class CacheData {
})
}
static getNetworkData(data: CacheData): string {
static getNetworkDataSync(data: CacheData): string {
if (data.networkData) {
return JSON.stringify(data.networkData);
}
return "";
}
static getNetworkDataAsync(data: CacheData): Promise<string> {
return new Promise((resolve) => {
let string = ""
if (data.networkData) {
string = JSON.stringify(data.networkData);
}
resolve(string)
})
}
}
\ No newline at end of file
... ...
... ... @@ -751,7 +751,7 @@ struct commentHeaderView {
maxline: 3,
fontSize: 16,
fontWeight: FontWeight.Regular,
marginWidth: (this.isZD?60:70 + 16)
marginWidth: (this.isZD?60:this.leftGap + 16)
})
.margin({ left: this.leftGap, right: 16,top:-12 })
.onClick(() => {
... ...
... ... @@ -41,36 +41,37 @@ export struct CommentText {
promise: Promise<Array<display.Display>> = display.getAllDisplays()
aboutToAppear() {
// this.longMessage = TestLongText
let tempMessage = new String(this.longMessage)
tempMessage = tempMessage.replace(/\n/g,'')
// console.log(`>>>>>>>文本:${this.longMessage}-${tempMessage}`)
console.log(`文本宽度为:${this.textWidth}`)
let padding = vp2px(5 + this.marginWidth)
this.textWidth = measure.measureText({
textContent: this.longMessage,
textContent: tempMessage.toString(),
fontSize: this.fontSize,
fontWeight: this.fontWeight,
constraintWidth: (this.screenWidth - padding),
wordBreak:WordBreak.BREAK_ALL
})
console.log(`文本宽度为:${this.textWidth}`)
// console.log(`>>>>>>>文本宽度为:${this.textWidth}-${this.contentText}`)
this.promise.then((data: Array<display.Display>) => {
console.log(`所有的屏幕信息:${JSON.stringify(data)}`)
//单位为像素
this.screenWidth = data[0]["width"]
// 屏幕宽度 * 最大行数 * 组件宽度比例 和 文字测量宽度
// 屏幕宽度 * 最大行数 * 组件宽度比例 和 文字测量宽度3900,,3951
this.isExpanded = (this.screenWidth - padding) * this.lines <= this.textWidth
// this.expandedStates = this.isExpanded;
let lines = this.getTextLineNum(
this.longMessage,
tempMessage.toString(),
(this.screenWidth - padding),
this.lineHeight,
this.fontSize,
this.fontWeight
)
console.log(`>>>>>>>行高数:${lines}-${this.screenWidth}-${this.longMessage}`)
if (lines > 3) {
this.isExpanded = true
}
... ... @@ -82,8 +83,8 @@ export struct CommentText {
let padding = vp2px(5 + this.marginWidth)
let maxLineTextWidth = (this.screenWidth - padding) * this.maxline;
for (let index = 0; index < this.longMessage.length; index++) {
const element = this.longMessage.substring(0, index)
for (let index = 0; index < tempMessage.length; index++) {
const element = tempMessage.substring(0, index)
const string = element + this.collapseText; //截取
const thisTextWidth = measure.measureText({
textContent: string,
... ...
... ... @@ -3,7 +3,7 @@ import { LottieView } from '../../lottie/LottieView'
import lottie from '@ohos/lottie';
import { CommonConstants } from 'wdConstant';
import { common} from '@kit.AbilityKit';
import { VoiceRecoginizer } from 'wdHwAbility/src/main/ets/voiceRecognizer/VoiceRecoginizer';
import { VoiceRecoginizer } from 'wdHwAbility';
@Component
export struct VoiceInputView {
... ...
... ... @@ -42,8 +42,10 @@ export class ChannelViewModel {
CacheData.getLocalCacheData(CacheData.bottomCacheKey).then((data) => {
// Logger.debug(TAG, 'getBottomNavCacheData 333 ' + JSON.stringify(data));
if (data) {
let navBean = JSON.parse(CacheData.getNetworkData(data)) as NavigationBodyDTO
success(navBean)
CacheData.getNetworkDataAsync(data).then((json) => {
let navBean = JSON.parse(json) as NavigationBodyDTO
success(navBean)
})
} else {
success(null)
}
... ... @@ -68,8 +70,10 @@ export class ChannelViewModel {
return new Promise<NavigationDetailDTO | null>((success) => {
CacheData.getLocalCacheData(CacheData.channelCacheDataKey + id).then((data) => {
if (data) {
let navBean = JSON.parse(CacheData.getNetworkData(data)) as NavigationDetailDTO
success(navBean)
CacheData.getNetworkDataAsync(data).then((json) => {
let navBean = JSON.parse(json) as NavigationDetailDTO
success(navBean)
})
} else {
success(null)
}
... ...
... ... @@ -367,8 +367,10 @@ export class PageViewModel extends BaseViewModel {
CacheData.getLocalCacheData(CacheData.comPageInfoCacheKey + pageId).then((data) => {
// Logger.debug(TAG, 'getPageInfoCache 333 ' + JSON.stringify(data));
if (data) {
let navBean = JSON.parse(CacheData.getNetworkData(data)) as PageInfoDTO
success(navBean)
CacheData.getNetworkDataAsync(data).then((json) => {
let navBean = JSON.parse(json) as PageInfoDTO
success(navBean)
})
} else {
success(null)
}
... ... @@ -391,8 +393,10 @@ export class PageViewModel extends BaseViewModel {
.then((data) => {
// Logger.debug(TAG, 'getPageGroupCacheData 333 ' + JSON.stringify(data));
if (data) {
let navBean = JSON.parse(CacheData.getNetworkData(data)) as PageDTO
success(navBean)
CacheData.getNetworkDataAsync(data).then((json) => {
let navBean = JSON.parse(json) as PageDTO
success(navBean)
})
} else {
success(null)
}
... ...
import { audio } from '@kit.AudioKit'
import { ArkTSUtils } from '@kit.ArkTS'
import {getVoicebufferDataLengthByte} from 'neonui'
import lazy {getVoicebufferDataLengthByte} from 'neonui'
import process from '@ohos.process'
import { NativeNui } from 'neonui'
import lazy { NativeNui } from 'neonui'
let TAG:string = "AudioCapturer"
//音频采集器类,主要用于采集音频,写入文件
... ...
import {NativeNui,Constants,MapToJson,INativeNuiCallback, AsrResult, KwsResult} from 'neonui'
import lazy {NativeNui,Constants,MapToJson,INativeNuiCallback, AsrResult, KwsResult} from 'neonui'
import { PermissionUtils,DeviceUtil, Logger, DateTimeUtils } from 'wdKit';
import AudioCapturer from './AudioCapture';
import { common, Permissions } from '@kit.AbilityKit';
... ...
... ... @@ -71,14 +71,20 @@ export default class HuaweiAuth {
return;
}
Logger.info(TAG, 'get anonymousPhone is empty. ' + JSON.stringify(response));
Logger.infoOptimize(TAG, () => {
return 'get anonymousPhone is empty. ' + JSON.stringify(response)
});
fail("获取匿名手机号为空")
}).catch((err: BusinessError) => {
Logger.error(TAG, 'get anonymousPhone failed. ' + JSON.stringify(err));
Logger.errorOptimize(TAG, () => {
return 'get anonymousPhone failed. ' + JSON.stringify(err)
})
fail("获取匿名手机号失败")
})
} catch (err) {
Logger.error(TAG, 'get anonymousPhone fail. ' + JSON.stringify(err));
Logger.errorOptimize(TAG, () => {
return 'get anonymousPhone fail. ' + JSON.stringify(err)
})
fail("获取匿名手机号失败")
}
})
... ...
... ... @@ -63,15 +63,14 @@ struct MainPage {
}
setTimeout(() => {
// 这里延后,因为有可能是换端进入H5页面
setTimeout(() => {
StartupManager.sharedInstance().appReachMainPage()
}, 200)
webview.WebviewController.initializeWebEngine()
ComponentModule.preInitArticleWebTemplate(this.getUIContext())
}, 1000)
// 这里延后,因为有可能是换端进入H5页面
setTimeout(() => {
StartupManager.sharedInstance().appReachMainPage()
}, 700)
}, 500)
}
pageTransition() {
... ...