Toggle navigation
Toggle navigation
This project
Loading...
Sign in
developOne
/
harmonyPool
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
yuanfeiyang02
2024-04-22 15:12:07 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
1723f2a53572bf353cb4804586ae6f37448d4c5f
1723f2a5
1 parent
5b9dc9fb
feat:启动广告页接口数据获取
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
132 additions
and
12 deletions
sight_harmony/commons/wdNetwork/src/main/ets/http/HttpUrlUtils.ets
sight_harmony/products/phone/src/main/ets/pages/launchPage/LaunchAdvertisingPage.ets
sight_harmony/products/phone/src/main/ets/pages/launchPage/LaunchPage.ets
sight_harmony/products/phone/src/main/ets/pages/viewModel/InterestsHobbiesModel.ets
sight_harmony/products/phone/src/main/ets/pages/viewModel/LaunchDataModel.ets
sight_harmony/products/phone/src/main/ets/pages/viewModel/LaunchPageModel.ets
sight_harmony/commons/wdNetwork/src/main/ets/http/HttpUrlUtils.ets
View file @
1723f2a
...
...
@@ -281,6 +281,11 @@ export class HttpUrlUtils {
* 更新 兴趣偏好
*/
static readonly INTERESTS_UPDATETAG_PATH: string = "/api/rmrb-user-center/user/zh/c/tag/updateUserTag";
/**
* 获取启动页相关数据
*/
static readonly LAUNCH_PAGE_PATH: string = "/api/rmrb-bff-display-zh/display/zh/c/launchPage";
private static _hostUrl: string = HttpUrlUtils.HOST_PRODUCT;
/**
* 推荐列表
...
...
@@ -714,6 +719,12 @@ export class HttpUrlUtils {
return url;
}
static getLaunchPageDataUrl() {
let url = HttpUrlUtils._hostUrl + HttpUrlUtils.LAUNCH_PAGE_PATH;
return url;
}
static getLiveDetailsUrl() {
let url = HttpUrlUtils._hostUrl + HttpUrlUtils.LIVE_DETAILS_PATH
return url
...
...
sight_harmony/products/phone/src/main/ets/pages/launchPage/LaunchAdvertisingPage.ets
View file @
1723f2a
...
...
@@ -12,6 +12,7 @@ struct LaunchAdvertisingPage {
// url:'pages/MainPage'
// })
WDRouterRule.jumpWithReplacePage(WDRouterPage.mainPage)
clearInterval(this.timer)
}
onPageShow(){
...
...
sight_harmony/products/phone/src/main/ets/pages/launchPage/LaunchPage.ets
View file @
1723f2a
...
...
@@ -9,6 +9,7 @@ import { GlobalContext } from '../../utils/GlobalContext'
import { WDRouterRule } from 'wdRouter';
import { WDRouterPage } from 'wdRouter';
import { LaunchModel } from '../viewModel/LaunchModel'
import { LaunchPageModel } from '../viewModel/LaunchPageModel'
@Entry
@Component
...
...
@@ -44,7 +45,8 @@ struct LaunchPage {
this.saveIsPrivacy();
//跳转引导页
this.jumpToGuidePage();
//同意隐私协议后请求启动页相关数据
this.requestLaunchPageData();
}
jumpToAdvertisingPage() {
...
...
@@ -90,9 +92,11 @@ struct LaunchPage {
this.dialogController.open();
// }
} else {
//需要根据请求数据判断是否需要进入广告页,广告数据为nil则直接跳转到首页
//跳转广告页
this.jumpToAdvertisingPage();
//同意隐私协议后每次启动app请求启动页相关数据,并更新数据
this.requestLaunchPageData();
}
});
});
...
...
@@ -154,4 +158,12 @@ struct LaunchPage {
launchModel.getAgreement()
}
requestLaunchPageData() {
//请求启动页相关接口数据并保存
let launchPageModel = new LaunchPageModel()
launchPageModel.getLaunchPageData()
}
}
\ No newline at end of file
...
...
sight_harmony/products/phone/src/main/ets/pages/viewModel/InterestsHobbiesModel.ets
View file @
1723f2a
...
...
@@ -46,16 +46,6 @@ export class InterestsHobbiesModel {
Logger.debug("InterestsHobbiesModel兴趣偏好数据获取成功:success ", JSON.stringify(data))
success(data.data);
//保存数据
// for (let i = 0; i < data.data.length; i++) {
// if (data.data[i].type == 1) {
// SPHelper.default.save(SpConstants.USER_PROTOCOL, data.data[i].linkUrl)
// } else if (data.data[i].type == 2) {
// SPHelper.default.save(SpConstants.PRIVATE_PROTOCOL, data.data[i].linkUrl)
// }
// }
}, (error: Error) => {
Logger.debug("InterestsHobbiesModel兴趣偏好数据获取失败:error ", error.toString())
fail(error.message)
...
...
sight_harmony/products/phone/src/main/ets/pages/viewModel/LaunchDataModel.ets
0 → 100644
View file @
1723f2a
export interface NetLayerLaunchOperatModel {
ID : string
screenName : string //开机屏名称
objectType : string // WDPublicProgramType 对象类型 0:不跳转,1:点播,2:直播,3:活动,4:广告,5:专题,6:链接,7:榜单,11:图文,12:组图,13:H5新闻,14:频道
objectId : string //跳转id
objectLevel : string //频道(1:一级频道,2:二级频道),专题(1:普通专题,2:主题专题,3:作者专题 21:文章专题,22:音频专题,23:直播专题,24:话题专题)
pageId : string //跳转页面id,objectType=5,14使用页面跳转
durations : string //展示时长(单位:秒)
linkUrl : string //转链接地址【objectType=6,13】
screenType : string // 0, 1 : WDDisplayStyle_Logo 2 : WDDisplayStyle_Full
bootScreenUrl : string //开机屏封面图/视频地址
bootVideoScreenUrl : string //视频封面地址
showType : string //文件类型WDPublicFileType 2: 视频 其他: 图片
isAd : string //0-非广告,1-是广告
bottomNavId : string //底部导航ID
relId : string //频道/专题内容关系id
}
export interface NetLayerLauncherADMaterialModel{
matType : string //1 video 其他 image
startStyle : number // 1 WDDisplayStyle_Full 全屏样式 其他 WDDisplayStyle_Logo 底部logo样式
advTitle : string
matImageUrl : string[] //取firstObject
matVideoUrl : string
openType : string //链接打开方式,0-没链接,不用打开,1-端内打开,2-端外打开
linkUrl : string
}
export interface NetLayerLauncherADInfoModel{
ID : string
startTime : number
endTime : number
displayDuration : number
displayRound : number
matInfo : NetLayerLauncherADMaterialModel
}
export interface NetLayerLauncherH5TemplateInfoModel{
versionRangeMin : string
versionRangeMax : string
h5TemplateUrl : string
version : string
md5 : string
}
export default interface LaunchDataModel{
launchPageInfo : NetLayerLaunchOperatModel
launchAdInfo : NetLayerLauncherADInfoModel[]
h5Template : NetLayerLauncherH5TemplateInfoModel[]
}
\ No newline at end of file
...
...
sight_harmony/products/phone/src/main/ets/pages/viewModel/LaunchPageModel.ets
0 → 100644
View file @
1723f2a
import LaunchDataModel from '../viewModel/LaunchDataModel'
import HashMap from '@ohos.util.HashMap';
import { HttpRequest } from 'wdNetwork/src/main/ets/http/HttpRequest';
import { HttpUrlUtils, ResponseDTO } from 'wdNetwork/Index';
import { Logger, SPHelper } from 'wdKit/Index';
import data from '@ohos.telephony.data';
import { SpConstants } from 'wdConstant/Index';
export class LaunchPageModel {
getLaunchPageData() {
let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();
return new Promise<LaunchDataModel>((success, fail) => {
HttpRequest.get<ResponseDTO<LaunchDataModel>>(HttpUrlUtils.getLaunchPageDataUrl(), headers).then((data: ResponseDTO<LaunchDataModel>) => {
if (!data || !data.data) {
fail("数据为空")
return
}
if (data.code != 0) {
fail(data.message)
return
}
Logger.debug("LaunchPageModel获取启动相关数据获取成功:success ", JSON.stringify(data))
success(data.data);
//存储数据
}, (error: Error) => {
Logger.debug("LaunchPageModel获取启动相关数据获取失败:error ", error.toString())
fail(error.message)
})
})
}
}
...
...
Please
register
or
login
to post a comment