张善主

Merge remote-tracking branch 'origin/main'

... ... @@ -98,4 +98,8 @@ export class DeviceUtil {
static isTablet(): boolean {
return deviceInfo.deviceType == 'tablet';
}
static is2in1(): boolean {
return deviceInfo.deviceType == '2in1';
}
}
... ...
... ... @@ -43,6 +43,9 @@ export class WindowModel {
return this.windowClass as window.Window
}
/**
* @deprecated 应用整体全屏,不需要再设置全屏与否了。
*/
setMainWindowFullScreen(fullScreen: boolean) {
if (deviceInfo.deviceType != "phone") {
return
... ... @@ -140,6 +143,9 @@ export class WindowModel {
return this.windowClass?.getWindowProperties()
}
/**
* @deprecated 应用整体全屏,不需要再设置全屏与否了。
*/
setWindowLayoutFullScreen(isFullScreen: boolean) {
this.isFullScreen = isFullScreen
this.windowClass?.setWindowLayoutFullScreen(isFullScreen)
... ...
... ... @@ -35,7 +35,7 @@ export struct topicInfoView {
if (this.frontLinkObject.linkUrl.length > 0 || this.frontLinkObject?.newsId.length > 0) {
Row() {
Text("查看详情")
.fontSize(14)
.fontSize(12)
.fontColor($r('app.color.white'))
.maxLines(1)
.borderRadius(2)
... ... @@ -59,7 +59,7 @@ export struct topicInfoView {
ProcessUtils.processPage(contentDTO)
})
.width(80)
.width(70)
.alignRules({
left: { anchor: "__container__", align: HorizontalAlign.Start },
bottom: { anchor: "__container__", align: VerticalAlign.Bottom }
... ... @@ -85,7 +85,7 @@ export struct topicInfoView {
left: { anchor: "__container__", align: HorizontalAlign.Start },
bottom: this.frontLinkObject.linkUrl.length > 0 || this.frontLinkObject?.newsId.length > 0 ?{ anchor: "row_detail", align: VerticalAlign.Top }:{ anchor: "__container__", align: VerticalAlign.Bottom }
})
.margin({top: 10 , left: 16, right: 16, bottom: this.frontLinkObject.linkUrl.length > 0 || this.frontLinkObject?.newsId.length > 0 ?0:16})
.margin({top: 10 , left: 16, right: 16, bottom: this.frontLinkObject.linkUrl.length > 0 || this.frontLinkObject?.newsId.length > 0 ?10:16})
.id('txt_summary')
Text(this.frontLinkObject?.title ?? "")
... ...
... ... @@ -88,7 +88,7 @@ export struct Card6Component {
.fontSize(18)
.lineHeight(27)
.fontWeight(FontWeight.Normal)
.maxLines(this.contentDTO.appStyle === '6' ? 4 : 2)
.maxLines(this.contentDTO.appStyle === '6' ? 4 : 3)
.alignSelf(ItemAlign.Start)
.textOverflow({ overflow: TextOverflow.Ellipsis }) // 超出的部分显示省略号。
.textIndent((this.contentDTO.newTags?.length || this.contentDTO.seoTags?.length) > 2 &&
... ... @@ -107,7 +107,7 @@ export struct Card6Component {
}
.alignItems(HorizontalAlign.Start)
.height(this.contentDTO.appStyle === CompStyle.Card_13 ? 78 : 156)
.height(this.contentDTO.appStyle === CompStyle.Card_13 ? '' : 156)
.justifyContent(FlexAlign.SpaceBetween)
... ... @@ -138,7 +138,8 @@ export struct Card6Component {
})
.width(CommonConstants.FULL_WIDTH)
.height(this.contentDTO.appStyle === CompStyle.Card_13 ? 106 : 184) .justifyContent(FlexAlign.SpaceBetween)
.height(this.contentDTO.appStyle === CompStyle.Card_13 ? '' : 184)
.justifyContent(FlexAlign.SpaceBetween)
.alignItems(VerticalAlign.Top)
}
}
... ...
... ... @@ -44,10 +44,14 @@ export struct ZhSingleRow04 {
.onClick(() => {
if (this.compDTO?.objectType === '11') {
ProcessUtils.jumpChannelTab(this.compDTO.objectId, this.compDTO.pageId as string, this.compDTO.objectTitle)
} else if (this.compDTO?.objectType === '5') {
ProcessUtils._gotoSpecialTopic(this.compDTO.linkUrl)
} else if (this.compDTO?.objectType === '6') {
ProcessUtils._gotoDefaultWeb(this.compDTO.linkUrl)
} else {
const contentDTO: ContentDTO = {
objectId: this.compDTO.objectId,
objectType: this.compDTO.objectType,
linkUrl: this.compDTO.linkUrl,
pageId: this.compDTO.pageId
} as ContentDTO
ProcessUtils.processPage(contentDTO)
}
})
}
... ... @@ -84,6 +88,7 @@ export struct ZhSingleRow04 {
.scrollBar(BarState.Off)
.width(CommonConstants.FULL_PARENT)
.height(166)
.edgeEffect(EdgeEffect.None)
}
.width(CommonConstants.FULL_WIDTH)
.backgroundColor($r("app.color.white"))
... ...
... ... @@ -19,6 +19,7 @@ const TAG = 'MinePageComponent';
*/
@Component
export struct MinePageComponent {
private topRectHeight: string = AppStorage.get<number>('topSafeHeight') + 'px';
//是否是创作者
@State isCreator:boolean = false
@State isLogin:boolean = false //默认 false 测试放开
... ... @@ -167,6 +168,8 @@ export struct MinePageComponent {
.backgroundColor($r('app.color.color_F9F9F9'))
.scrollable(ScrollDirection.Vertical)
.scrollBar(BarState.Off)
// 预留状态栏、导航栏高度
.margin({ top: this.topRectHeight})
}
... ...
... ... @@ -22,6 +22,7 @@ const storage = LocalStorage.getShared();
@Entry(storage)
@Component
export struct TopNavigationComponentNew {
private topRectHeight: string = AppStorage.get<number>('topSafeHeight') + 'px';
/**
* @deprecated
*/
... ... @@ -138,6 +139,8 @@ export struct TopNavigationComponentNew {
.width('100%')
.height('100%')
}
// 预留状态栏
.margin({ top: this.topRectHeight })
}
@Builder
... ...
... ... @@ -133,6 +133,7 @@ struct MineHomePage {
.backgroundImageSize(ImageSize.Cover)
.padding({left:"17lpx",right:"8lpx"})
.height('35lpx')
.borderRadius({topRight:2,bottomRight:2})
}
Blank()
... ...
... ... @@ -78,7 +78,7 @@ export struct DetailPlayVLivePage {
LiveEmptyComponent({
emptyType: WDLiveViewDefaultType.WDViewDefaultType_NoLiveSuspend
})
.height('30%').margin({top:this.topSafeHeight })
.height('40%').margin({top:this.topSafeHeight })
} else {
if (this.liveDetailPageLogic.showPad) {
... ... @@ -92,7 +92,7 @@ export struct DetailPlayVLivePage {
LiveEmptyComponent({
emptyType: WDLiveViewDefaultType.WDViewDefaultType_NoLiveSuspend
})
.height('30%').margin({top:this.topSafeHeight })
.height('40%').margin({top:this.topSafeHeight })
}
... ...
... ... @@ -14,6 +14,7 @@ import { EmitterEventId, EmitterUtils, Logger, SPHelper, WindowModel } from 'wdK
import { TrackConstants, TrackingContent, TrackParamConvert } from 'wdTracking/Index'
const TAG = "PlayerCommentComponent"
/**
* 沉浸式直播--- 聊天区域
*/
... ... @@ -52,7 +53,7 @@ export struct PlayerCommentComponent {
this.liveViewModel.getLiveCommentList(
1,
this.contentDetailData?.liveInfo?.mlive?.mliveId,
this.contentDetailData?.newsId+'',
this.contentDetailData?.newsId + '',
20,)
.then(
(data) => {
... ... @@ -82,21 +83,22 @@ export struct PlayerCommentComponent {
build() {
Column() {
List({ scroller: this.scroller }) {
// 主持人
if (this.contentDetailData.oldNewsId) {
ChartItemCompereComponent()
}
ForEach(this.liveChatList, (item: LiveRoomItemBean) => {
ListItem() {
ChatItemComponent({ item: item })
Stack({ alignContent: Alignment.BottomStart }) {
List({ scroller: this.scroller }) {
// 主持人
if (this.contentDetailData.oldNewsId) {
ChartItemCompereComponent()
}
})
}
.height(280)
.width('80%')
.scrollBar(BarState.Off)
.margin({ bottom: 20 })
ForEach(this.liveChatList, (item: LiveRoomItemBean) => {
ListItem() {
ChatItemComponent({ item: item })
}
})
}
.width('80%')
.scrollBar(BarState.Off)
}.height(280)
// 收藏、分享、点赞是否需要根据字段显隐
LiveOperRowListView({
... ...
... ... @@ -13,6 +13,7 @@ export struct PlayerUIComponent {
build() {
Stack() {
// 标题
PlayerTitleComponent()
PlayerCommentComponent()
... ...
import AbilityConstant from '@ohos.app.ability.AbilityConstant';
import app from '@system.app';
import hilog from '@ohos.hilog';
import UIAbility from '@ohos.app.ability.UIAbility';
import Want from '@ohos.app.ability.Want';
import window from '@ohos.window';
import { BusinessError } from '@ohos.base';
import { DeviceUtil, EmitterEventId, EmitterUtils, WindowModel } from 'wdKit';
import { DeviceUtil, EmitterEventId, EmitterUtils, Logger, WindowModel } from 'wdKit';
import { ConfigurationConstant } from '@kit.AbilityKit';
import { StartupManager } from '../startupmanager/StartupManager';
import { UIContext } from '@ohos.arkui.UIContext';
let floatWindowClass: window.Window | null = null;
const TAG = 'EntryAbility'
export default class EntryAbility extends UIAbility {
onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void {
StartupManager.sharedInstance().appOnCreate(want, launchParam, this.context)
hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onCreate');
Logger.info(TAG, 'Ability onCreate');
// 还没深色模式需求,暂直接不跟随系统。
this.context.getApplicationContext().setColorMode(ConfigurationConstant.ColorMode.COLOR_MODE_LIGHT);
... ... @@ -32,13 +31,13 @@ export default class EntryAbility extends UIAbility {
}
onDestroy(): void {
hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onDestroy');
Logger.info(TAG, 'Ability onDestroy');
StartupManager.sharedInstance().appOnDestory()
}
onWindowStageCreate(windowStage: window.WindowStage): void {
// Main window is created, set main page for this ability
hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageCreate');
Logger.info(TAG, 'Ability onWindowStageCreate');
WindowModel.shared.setWindowStage(windowStage);
// 2. 获取布局避让遮挡的区域
const windowClass: window.Window = windowStage.getMainWindowSync(); // 获取应用主窗口
... ... @@ -57,72 +56,50 @@ export default class EntryAbility extends UIAbility {
// 音频悬浮窗初始移动位置604为ui高度
let initMoveY = vp2px(604)
// 在普通phone/折叠屏/tablet设备上以沉浸式(全屏)启动
if (DeviceUtil.isPhone() || DeviceUtil.isTablet()) {
// 设置窗口的布局是否为沉浸式布局
// 沉浸式布局是指布局不避让状态栏与导航栏,组件可能产生与其重叠的情况。
// 非沉浸式布局是指布局避让状态栏与导航栏,组件不会与其重叠。
// windowClass.setWindowLayoutFullScreen(true)
// 设置窗口全屏模式时窗口内导航栏、状态栏的属性
// windowClass.setWindowSystemBarProperties({
// statusBarContentColor: "#FFFFFF"
// })
// 设置启动时窗口的显示方向属性,
// 普通phone以PORTRAIT/竖屏显示模式启动
// 折叠屏和tablet是以AUTO_ROTATION_RESTRICTED/受开关控制的自动旋转模式启动
WindowModel.shared.setPreferredOrientation(window.Orientation.PORTRAIT)
.then(() => {
hilog.info(0x0000, 'testTag', 'setPreferredOrientation Succeeded');
})
.catch((err: Error) => {
hilog.error(0x0000, 'testTag',
`setPreferredOrientation catch, error error.name : ${err.name}, error.message:${err.message}`);
})
}
this.onWindowSetup(windowClass)
//../../../../../../features/wdLogin/src/main/ets/pages/launchPage/LaunchPage
windowStage.loadContent('pages/launchPage/LaunchPage', (err, data) => {
if (err.code) {
hilog.error(0x0000, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? '');
Logger.error(TAG, 'Failed to load the content. Cause: ' + JSON.stringify(err) ?? '');
return;
}
hilog.info(0x0000, 'testTag', 'Succeeded in loading the content. Data: %{public}s', JSON.stringify(data) ?? '');
Logger.info(TAG, 'Succeeded in loading the content. Data: ' + JSON.stringify(data) ?? '');
});
// 1.创建悬浮窗
windowStage.createSubWindow('subWindow', (err: BusinessError, data) => {
let errCode: number = err.code;
if (errCode) {
console.error('floatWindowClass Failed to create the subwindow. Cause: ' + JSON.stringify(err));
Logger.error('floatWindowClass Failed to create the subwindow. Cause: ' + JSON.stringify(err));
return;
}
console.info('floatWindowClass Succeeded in creating the subwindow. Data: ' + JSON.stringify(data));
Logger.info('floatWindowClass Succeeded in creating the subwindow. Data: ' + JSON.stringify(data));
floatWindowClass = data;
AppStorage.setOrCreate('floatWindowClass', floatWindowClass);
// 2.悬浮窗窗口创建成功后,设置悬浮窗的位置、大小及相关属性等。
floatWindowClass.moveWindowTo(0, initMoveY, (err: BusinessError) => {
let errCode: number = err.code;
if (errCode) {
console.error('floatWindowClass Failed to move the window. Cause:' + JSON.stringify(err));
Logger.error('floatWindowClass Failed to move the window. Cause:' + JSON.stringify(err));
return;
}
console.info('floatWindowClass Succeeded in moving the window.');
Logger.info('floatWindowClass Succeeded in moving the window.');
});
// 3.为悬浮窗加载对应的目标页面。
floatWindowClass.setUIContent("pages/view/AudioComponent", (err: BusinessError) => {
let errCode: number = err.code;
if (errCode) {
console.error('floatWindowClass Failed to load the content. Cause:' + JSON.stringify(err));
Logger.error('floatWindowClass Failed to load the content. Cause:' + JSON.stringify(err));
return;
}
console.info('floatWindowClass Succeeded in loading the content.');
Logger.info('floatWindowClass Succeeded in loading the content.');
let color: string = 'rgba(0,0,0,0)';
try {
(floatWindowClass as window.Window).setWindowBackgroundColor(color);
} catch (exception) {
console.error('Failed to set the background color. Cause: ' + JSON.stringify(exception));
};
Logger.error('Failed to set the background color. Cause: ' + JSON.stringify(exception));
}
;
});
floatWindowClass.on('windowEvent', (data) => {
... ... @@ -132,33 +109,68 @@ export default class EntryAbility extends UIAbility {
});
}
public async onWindowSetup(mainWindow: window.Window) {
// 在普通phone/折叠屏/tablet设备上以沉浸式(全屏)启动
if (DeviceUtil.isPhone() || DeviceUtil.isTablet()) {
// 设置窗口的布局是否为沉浸式布局
// 沉浸式布局是指布局不避让状态栏与导航栏,组件可能产生与其重叠的情况。
// 非沉浸式布局是指布局避让状态栏与导航栏,,组件不会与其重叠
mainWindow.setWindowLayoutFullScreen(true)
//设置窗口全屏模式时窗口内导航栏、状态栏的属性
mainWindow.setWindowSystemBarProperties({
//statusBarColor:'#000000'
statusBarContentColor: '#FFFFFF'
})
mainWindow.setSpecificSystemBarEnabled('status', true)
// 设置启动时窗口的显示方向属性,
// 普通phone以PORTRAIT/竖屏显示模式启动
// 折叠屏和tablet是以AUTO_ROTATION_RESTRICTED/受开关控制的自动旋转模式启动
WindowModel.shared.setPreferredOrientation(window.Orientation.PORTRAIT)
.then(() => {
Logger.info(TAG, 'setPreferredOrientation Succeeded');
})
.catch((err: Error) => {
Logger.info(TAG,
`setPreferredOrientation catch, error error.name : ${err.name}, error.message:${err.message}`);
})
} else if (DeviceUtil.is2in1()) {
// 2in1(PC)设备不支持旋转(无横竖屏模式),会以默认窗口(非全屏)显示模式启动Logger.info(TAG,`start at 2in1 window device )
Logger.info(TAG, 'start at 2in1 window device')
} else {
// 轻量级智能穿戴/lite wearable device
Logger.info(TAG, 'start at other type device')
}
}
destroyFloatWindow() {
(floatWindowClass as window.Window).destroyWindow((err: BusinessError) => {
let errCode: number = err.code;
if (errCode) {
console.error('floatWindowClass Failed to destroy the window. Cause: ' + JSON.stringify(err));
Logger.error('floatWindowClass Failed to destroy the window. Cause: ' + JSON.stringify(err));
return;
}
console.info('floatWindowClass Succeeded in destroying the window.');
Logger.info('floatWindowClass Succeeded in destroying the window.');
});
}
onWindowStageDestroy(): void {
// Main window is destroyed, release UI related resources
this.destroyFloatWindow()
hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageDestroy');
Logger.info(TAG, 'Ability onWindowStageDestroy');
}
onForeground(): void {
// Ability has brought to foreground
hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onForeground');
Logger.info(TAG, 'Ability onForeground');
EmitterUtils.sendEmptyEvent(EmitterEventId.APP_ENTER_FOREGROUD)
}
onBackground(): void {
// Ability has back to background
hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onBackground');
Logger.info(TAG, 'Ability onBackground');
EmitterUtils.sendEmptyEvent(EmitterEventId.APP_ENTER_BACKGROUD)
}
... ...
... ... @@ -176,7 +176,7 @@ struct LaunchAdvertisingPage {
if (this.defaultModel.openType == '2') {
//端外打开
ProcessUtils.jumpExternalWebPage(this.defaultModel.linkUrl)
}else {
}else if(this.defaultModel.openType == '1'){
//端内打开
ProcessUtils.gotoDefaultWebPage(this.defaultModel.linkUrl)
}
... ... @@ -222,6 +222,7 @@ struct LaunchAdvertisingPage {
this.defaultModel.bootVideoUrl = dataModel.launchAdInfo[0].matInfo.matVideoUrl
this.defaultModel.showType = dataModel.launchAdInfo[0].matInfo.matType
this.defaultModel.isAd = '1'
this.defaultModel.openType = dataModel.launchAdInfo[0].matInfo.openType
}
}
... ...
... ... @@ -23,6 +23,7 @@ let storage = LocalStorage.getShared();
@Component
export struct BottomNavigationComponent {
@Provide bottomRectHeight: number = 0
private bottomRectHeight1: string = AppStorage.get<number>('bottomSafeHeight') + 'px';
@Provide topRectHeight: number = 0
@Provide isLayoutFullScreen: boolean = false
@Provide displayDirection: DisplayDirection = DisplayDirection.VERTICAL
... ... @@ -73,50 +74,51 @@ export struct BottomNavigationComponent {
}
build() {
Tabs({ barPosition: BarPosition.End, index: this.currentNavIndex, controller: this.navController }) {
ForEach(this.bottomNavList, (navItem: BottomNavDTO, index: number) => {
TabContent() {
if (CompUtils.isMine(navItem)) {
// 我的页面组件数据列表
MinePageComponent({ isMinePage: this.currentNavIndex === this.bottomNavList.length - 1 })
} else if (navItem.name === '视频') {
// 视频频道,包含视频和直播
VideoChannelPage({
topNavList: navItem.topNavChannelList.filter(item => item.channelId != 2073),
_currentNavIndex: $currentNavIndex,
autoRefresh: this.autoRefresh
})
} else {
TopNavigationComponentNew({
groupId: navItem.id,
topNavList: navItem.topNavChannelList.filter(item => item.channelId != 2073),
_currentNavIndex: $currentNavIndex,
bottomNavIndex: index,
currentBottomNavName: navItem.name,
assignChannel: this.assignChannel,
autoRefresh: this.autoRefresh
})
Column() {
Tabs({ barPosition: BarPosition.End, index: this.currentNavIndex, controller: this.navController }) {
ForEach(this.bottomNavList, (navItem: BottomNavDTO, index: number) => {
TabContent() {
if (CompUtils.isMine(navItem)) {
// 我的页面组件数据列表
MinePageComponent({ isMinePage: this.currentNavIndex === this.bottomNavList.length - 1 })
} else if (navItem.name === '视频') {
// 视频频道,包含视频和直播
VideoChannelPage({
topNavList: navItem.topNavChannelList.filter(item => item.channelId != 2073),
_currentNavIndex: $currentNavIndex,
autoRefresh: this.autoRefresh
})
} else {
TopNavigationComponentNew({
groupId: navItem.id,
topNavList: navItem.topNavChannelList.filter(item => item.channelId != 2073),
_currentNavIndex: $currentNavIndex,
bottomNavIndex: index,
currentBottomNavName: navItem.name,
assignChannel: this.assignChannel,
autoRefresh: this.autoRefresh
})
}
}
}
.tabBar(this.tabBarBuilder(navItem, index))
.tabBar(this.tabBarBuilder(navItem, index))
.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP])
});
// .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP])
});
}
.zIndex(10)
.scrollable(false)
.animationDuration(0)
.barHeight(this.displayDirection === DisplayDirection.VERTICAL ? $r('app.float.bottom_navigation_barHeight') :
0.001)
.barMode(BarMode.Fixed)
.barBackgroundColor(this.barBackgroundColor)
// 备注:鸿蒙目前只有修改三线导航背景方法,对于全面屏导航条手机需要设置背景色并使其扩散到导航区域
.backgroundColor(this.barBackgroundColor)
.expandSafeArea([SafeAreaType.SYSTEM])
// .padding({ bottom: this.bottomRectHeight + 'px', top: this.topRectHeight + 'px' }) // 此处margin具体数值在实际中应与导航条区域高度保持一致
}
.zIndex(10)
.scrollable(false)
.animationDuration(0)
.barHeight(this.displayDirection === DisplayDirection.VERTICAL ? $r('app.float.bottom_navigation_barHeight') :
0.001)
.barMode(BarMode.Fixed)
.barBackgroundColor(this.barBackgroundColor)
// 备注:鸿蒙目前只有修改三线导航背景方法,对于全面屏导航条手机需要设置背景色并使其扩散到导航区域
.backgroundColor(this.barBackgroundColor)
.layoutWeight(1)
Blank().width('100%').height(this.bottomRectHeight1).backgroundColor(this.barBackgroundColor)
}.height('100%').width('100%')
}
@Builder
... ...
import { insightIntent, InsightIntentExecutor } from '@kit.AbilityKit';
import { window } from '@kit.ArkUI';
import { BusinessError } from '@kit.BasicServicesKit';
import { NetworkUtil, SPHelper, ToastUtils } from 'wdKit';
import { ProcessUtils } from 'wdRouter';
import DailyPaperTopicModel from 'wdComponent/src/main/ets/model/DailyPaperTopicModel'
/**
* 意图调用
*/
... ... @@ -19,7 +22,7 @@ export default class InsightIntentExecutorImpl extends InsightIntentExecutor {
*/
onExecuteInUIAbilityForegroundMode(name: string, param: Record<string, Object>, pageLoader: window.WindowStage):
Promise<insightIntent.ExecuteResult> {
console.log('yzl onExecuteInUIAbilityForegroundMode',name,JSON.stringify(param))
console.log('yzl onExecuteInUIAbilityForegroundMode', name, JSON.stringify(param))
// 根据意图名称分发处理逻辑
switch (name) {
case InsightIntentExecutorImpl.ViewBlog:
... ... @@ -36,19 +39,19 @@ export default class InsightIntentExecutorImpl extends InsightIntentExecutor {
}
} as insightIntent.ExecuteResult)
}
/**
* 实现习惯推荐功能
* @param param 意图参数
* @param pageLoader 窗口
*/
private jumpToViewBlog(param: Record<string, Object>, pageLoader: window.WindowStage): Promise<insightIntent.ExecuteResult> {
console.log('yzl jumpToView',JSON.stringify(param))
private jumpToViewBlog(param: Record<string, Object>,
pageLoader: window.WindowStage): Promise<insightIntent.ExecuteResult> {
console.log('yzl jumpToView', JSON.stringify(param))
return new Promise((resolve, reject) => {
// TODO 实现意图调用,loadContent的入参为歌曲落地页路径,例如:pages/SongPage
// TODO 热启动是否切到主页
pageLoader.loadContent('pages/MainPage')
.then(() => {
resolve({
code: 0,
result: {
... ... @@ -72,12 +75,26 @@ export default class InsightIntentExecutorImpl extends InsightIntentExecutor {
* @param param 意图参数
* @param pageLoader 窗口
*/
private jumpToViewColumnUpdate(param: Record<string, Object>, pageLoader: window.WindowStage): Promise<insightIntent.ExecuteResult> {
console.log('yzl jumpToViewColum',JSON.stringify(param))
private jumpToViewColumnUpdate(param: Record<string, Object>,
pageLoader: window.WindowStage): Promise<insightIntent.ExecuteResult> {
return new Promise((resolve, reject) => {
pageLoader.loadContent('pages/MainPage')
.then(() => {
ProcessUtils.gotoMorningEveningPaper()
if (NetworkUtil.isNetConnected()) {
DailyPaperTopicModel.getDailyPaperTopic().then(dailyPaperTopicBean => {
if (dailyPaperTopicBean && dailyPaperTopicBean.id > 0) {
SPHelper.default.saveSync('dailyPaperTopicPageId', dailyPaperTopicBean.id);
ProcessUtils.gotoMorningEveningPaper() //跳转至早晚报页面
} else {
ToastUtils.showToast('暂无早晚报信息', 1000)
}
}).catch((err: string) => {
console.log('yzlerr',JSON.stringify(err))
ToastUtils.showToast('暂无早晚报信息', 1000)
})
} else {
ToastUtils.showToast('网络出小差了,请检查网络后重试', 1000)
}
resolve({
code: 0,
result: {
... ...