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
陈剑华
2024-06-19 11:03:15 +0800
Browse Files
Options
Browse Files
Download
Plain Diff
Commit
46c1b02ec3d0923d71ecd78b00446831aee9141d
46c1b02e
2 parents
0a8cf93e
72e02c4f
Merge remote-tracking branch 'origin/main'
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
176 additions
and
171 deletions
sight_harmony/commons/wdConstant/src/main/ets/constants/SpConstants.ets
sight_harmony/commons/wdWebComponent/src/main/ets/pages/WdWebComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/ENewspaperItemComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/MorningEveningPaper/MorningEveningPaperComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/SpacialTopicPageComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/page/CardView.ets
sight_harmony/features/wdComponent/src/main/ets/components/page/ChannelSubscriptionLayout.ets
sight_harmony/features/wdComponent/src/main/ets/components/page/TopNavigationComponentNew.ets
sight_harmony/features/wdComponent/src/main/ets/components/search/SearchResultContentComponent.ets
sight_harmony/features/wdComponent/src/main/ets/repository/PageRepository.ets
sight_harmony/features/wdComponent/src/main/ets/utils/InsightIntentShare.ets
sight_harmony/features/wdComponent/src/main/ets/viewmodel/BroadcastViewModel.ets
sight_harmony/features/wdComponent/src/main/ets/viewmodel/MorningEveningViewModel.ets
sight_harmony/features/wdComponent/src/main/resources/base/media/paper_placeholder.jpg
sight_harmony/features/wdDetailPlayShortVideo/src/main/ets/pages/VideoChannelDetail.ets
sight_harmony/features/wdDetailPlayShortVideo/src/main/ets/view/PlayerTitleView.ets
sight_harmony/features/wdHwAbility/src/main/ets/location/HWLocationUtils.ets
sight_harmony/features/wdLogin/src/main/ets/pages/login/OneKeyLoginPage.ets
sight_harmony/features/wdLogin/src/main/ets/utils/HuaweiAuth.ets
sight_harmony/products/phone/src/main/ets/utils/InsightIntentExecutorImpl.ets
sight_harmony/commons/wdConstant/src/main/ets/constants/SpConstants.ets
View file @
46c1b02
...
...
@@ -32,9 +32,10 @@ export class SpConstants{
static PUBLICVISUTORMODE_INTERESTTAGS = 'PublicVisitorMode_InterestTags'
//定位相关
static LOCATION_CITY_NAME = "location_city_name" //定位
static LOCATION_CITY_CODE = "location_city_code" //定位
static LOCATION_CITY_NAME = "location_city_name" //城市名称
static LOCATION_CITY_CODE = "location_city_code" //城市code
static LOCATION_PROVINCE_CODE = "location_province_code" //定位,省份code
static LOCATION_PROVINCE_NAME = "location_province_name" //定位,省份名称
static LOCATION_DISTRICT_CODE = "location_district_code" //定位,区县,返回9位,如:合肥-瑶海区-310115114
static LOCATION_PERMISSION_REFUSE = "location_permission_refuse" //定位
...
...
sight_harmony/commons/wdWebComponent/src/main/ets/pages/WdWebComponent.ets
View file @
46c1b02
...
...
@@ -29,6 +29,8 @@ export struct WdWebComponent {
.mixedMode(MixedMode.All)
.onlineImageAccess(true)
.enableNativeEmbedMode(true)
.horizontalScrollBarAccess(false)
.verticalScrollBarAccess(false)
.onPageBegin((event) => {
this.onPageBegin(event?.url);
})
...
...
sight_harmony/features/wdComponent/src/main/ets/components/ENewspaperItemComponent.ets
View file @
46c1b02
...
...
@@ -40,6 +40,7 @@ export struct ENewspaperItemComponent {
Image(this.newspaperListItemBean.pagePic)
.width(px2vp(this.itemPicWidth))
.height(px2vp(this.itemPicHeight))
.alt($r('app.media.paper_placeholder'))
.onComplete((event) => {
if (event?.loadingStatus == 1) {
this.contentWidth = event?.contentWidth
...
...
@@ -49,8 +50,9 @@ export struct ENewspaperItemComponent {
})
.objectFit(ImageFit.Fill)
.zIndex(10)
newsSkeleton()
.zIndex(1)
// newsSkeleton()
// .height('100%')
// .zIndex(1)
if (this.contentWidth !== 0) {
Canvas(this.context)
.width(px2vp(this.contentWidth))
...
...
sight_harmony/features/wdComponent/src/main/ets/components/MorningEveningPaper/MorningEveningPaperComponent.ets
View file @
46c1b02
...
...
@@ -68,8 +68,8 @@ export struct MorningEveningPaperComponent {
@Provide progressVal: number = 0;
@State mixedBgColor: string = ''
// 顶部安全高度赋值
@State topSafeHeight: number = 0;
@State bottomSafeHeight: number = 0;
@State topSafeHeight: number = px2vp(AppStorage.get<number>('topSafeHeight') || 0)
@State bottomSafeHeight: number = px2vp(AppStorage.get<number>('bottomSafeHeight') || 0)
@State isHasTopView: boolean = false;
@State scrollOffset: number = 0
@State currentStatus: number | string |undefined = 0;
...
...
@@ -121,11 +121,11 @@ export struct MorningEveningPaperComponent {
}
async aboutToAppear() {
let windowHight: window.Window = await window.getLastWindow(getContext(this));
//
let windowHight: window.Window = await window.getLastWindow(getContext(this));
// await windowHight.setWindowLayoutFullScreen(true);
// WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#ffffff', })
this.topSafeHeight = px2vp(windowHight.getWindowAvoidArea(window.AvoidAreaType.TYPE_SYSTEM).topRect.height)
this.bottomSafeHeight = px2vp(windowHight.getWindowAvoidArea(window.AvoidAreaType.TYPE_SYSTEM).bottomRect.height)
// this.topSafeHeight = px2vp(windowHight.getWindowAvoidArea(window.AvoidAreaType.TYPE_SYSTEM).topRect.height)
// this.bottomSafeHeight = px2vp(windowHight.getWindowAvoidArea(window.AvoidAreaType.TYPE_SYSTEM).bottomRect.height)
const dailyPaperTopicPageId = await SPHelper.default.getSync('dailyPaperTopicPageId', "") as String
console.info(TAG, `aboutToAppear = ` + dailyPaperTopicPageId)
...
...
@@ -331,13 +331,14 @@ export struct MorningEveningPaperComponent {
.height('100%')
.objectFit(ImageFit.Contain)
Image($r('app.media.icon_listen'))
.width(24)
.height(24)
.margin({ left: 10 })
.width(20)
.height(20)
.margin({ left: 20 })
.alignSelf(ItemAlign.Start)
Text(`${this.pageInfoBean.topicInfo?.topicPattern === 1 ? '早上好' : this.pageInfoBean.topicInfo?.topicPattern === 2 ? '中午好' : '晚上好'}, 请收听今日新闻播报`)
.fontSize(14)
.fontWeight(FontWeight.Medium)
.margin({ left: 50 })
.fontColor(Color.Black)
.maxLines(1)
...
...
sight_harmony/features/wdComponent/src/main/ets/components/SpacialTopicPageComponent.ets
View file @
46c1b02
import { Action, H5ReceiveDetailBean, ContentDetailDTO, InteractDataDTO } from 'wdBean';
import { WdWebComponent } from 'wdWebComponent';
import router from '@ohos.router';
import { CommonConstants } from 'wdConstant'
import { BridgeWebViewControl } from 'wdJsBridge/Index';
import { detailedSkeleton } from './skeleton/detailSkeleton'
import { NativeCallH5Type } from 'wdWebComponent/src/main/ets/pages/NativeCallH5Type';
import { OperRowListView } from './view/OperRowListView';
import DetailViewModel from '../viewmodel/DetailViewModel';
...
...
@@ -15,6 +13,7 @@ import { common } from '@kit.AbilityKit';
import { PageRepository } from '../repository/PageRepository';
import { CommentDialogView } from './CommentDialogView';
import { faceDetector } from '@kit.CoreVisionKit';
import { channelSkeleton } from './skeleton/channelSkeleton';
const TAG: string = 'SpacialTopicPageComponent'
...
...
@@ -117,7 +116,7 @@ export struct SpacialTopicPageComponent {
let pageId = this.action.params.extra?.pageId
console.log('pageIdpageId',pageId)
if(pageId){
let pageInfoMsg = await PageRepository.fetchMorningEveningPageInfo(pageId)
let pageInfoMsg = await PageRepository.fetchMorningEveningPageInfo(pageId
,contentId
)
let detailBeans = await DetailViewModel.getDetailPageData(relId, contentId, relType)
if (detailBeans?.length > 0) {
this.contentDetailData = JSON.parse(JSON.stringify(detailBeans[0]));
...
...
@@ -192,7 +191,7 @@ export struct SpacialTopicPageComponent {
}).padding({ bottom: 200 })
} else {
if (!this.isPageEnd) {
detailed
Skeleton().padding({ top:`${this.topSafeHeight}px`,bottom: this.bottomSafeHeight })
channel
Skeleton().padding({ top:`${this.topSafeHeight}px`,bottom: this.bottomSafeHeight })
}
}
//底部交互区
...
...
sight_harmony/features/wdComponent/src/main/ets/components/page/CardView.ets
View file @
46c1b02
...
...
@@ -574,7 +574,7 @@ export struct PaperSingleColumn999CardView {
.fontColor('#B0B0B0')
.margin({ left: this.item?.source.length > 0?0:16 })
if (this.item.objectType != '2' && this.interactData && this.interactData.commentNum && Number(this.interactData.commentNum) > 0) {
Text(this.
interactData.commentNum
+ "评")
Text(this.
handlerNum(this.interactData.commentNum.toString())
+ "评")
.fontSize(12)
.fontColor('#B0B0B0')
.margin({ left: this.getPublishTime().length >0? 6:0 })
...
...
@@ -671,4 +671,28 @@ export struct PaperSingleColumn999CardView {
}
return contentString;
}
/**
* 全域数字显示规则
* 1、当数量为千位以內时,显示数字,不保留小数点,比如 4585
* 2、当数量为万位~1亿时,显示xx 万,保留小数点后一位,比如1517.9w、2.9w
* 3、当数量为1亿~千亿时,显示XX 亿,保留小数点后一位,比如1517.9亿、2.9亿
* 4、不进行四舍五入
* 5、0 和空 不显示
*/
handlerNum(number: string) {
const num = number??'0';
if (Number.parseInt(num) <= 9999) {
return Number.parseInt(num).toString()
} else if (Number.parseInt(num) > 9999 && Number.parseInt(num) <= 99999999) {
const num1: string = num.slice(0, -4); // 万
const num2: string = num.slice(-4, -3); // 千
return num2 === '0' ? num1 +'万' : num1 + '.' + num2 + '万'
} else if (Number.parseInt(num) > 99999999) {
const num1: string = num.slice(0, -8); // 亿
const num2: string = num.slice(-8, -7);
return num2 === '0' ? num1 +'亿' : num1 + '.' + num2 + '亿'
}
return num
}
}
\ No newline at end of file
...
...
sight_harmony/features/wdComponent/src/main/ets/components/page/ChannelSubscriptionLayout.ets
View file @
46c1b02
import { TopNavDTO } from 'wdBean';
import curves from '@ohos.curves';
import { Logger } from 'wdKit/Index';
const INDEX_SETTING_TITLE: string = '首页设置'
const INDEX_SETTING_SUBTITLE: string = '将指定频道设置为首页'
...
...
@@ -29,6 +30,7 @@ struct ChannelSubscriptionLayout {
@Link localChannelList: TopNavDTO []
// 收集到的我的频道栏目中的频道id
@State channelIds: number [] = []
// 是否显示频道编辑页面
@State isShow: boolean = false
@State dragItem: number = -1
private dragRefOffsetX: number = 0
...
...
@@ -39,6 +41,9 @@ struct ChannelSubscriptionLayout {
private FIX_VP_Y: number = 48
@State indexSettingChannelId: number = AppStorage.get<number>('indexSettingChannelId') || 2002
@State isEditIng: boolean = false
// 顶部导航栏是否有临时跳转频道数据不
@Prop haveTempTabData: boolean
changeTab: (index: number) => void = () => {
}
...
...
@@ -63,7 +68,7 @@ struct ChannelSubscriptionLayout {
let item = this.myChannelList.splice(index, 1)[0]
this.channelIds.splice(index, 1)
AppStorage.setOrCreate('channelIds',
JSON.stringify(this.channelIds
))
AppStorage.setOrCreate('channelIds',
this.channelIds.join(','
))
/*
删除的频道信息回到原栏目中去
...
...
@@ -75,7 +80,6 @@ struct ChannelSubscriptionLayout {
this.localChannelList.unshift(item)
}
// 删除频道的索引值大于 我的栏目中频道最大索引值
if (this.currentTopNavSelectedIndex > this.channelIds.length - 1) {
//使用默认频道
...
...
@@ -126,8 +130,8 @@ struct ChannelSubscriptionLayout {
this.myChannelList.push(item)
AppStorage.setOrCreate('channelIds', this.channelIds.join(','))
// let storageChannelIds: string = AppStorage.get<string>('channelIds') || ''
// console.debug('TopNavigationComponent', 'addChannelItem==>' + storageChannelIds)
let storageChannelIds: string = AppStorage.get<string>('channelIds') || ''
console.debug('TopNavigationComponent', 'addChannelItem==>' + storageChannelIds)
}
itemMove(index: number, newIndex: number): void {
...
...
@@ -566,15 +570,21 @@ struct ChannelSubscriptionLayout {
.backgroundColor(Color.White)
.onClick(() => {
this.isShow = true
if(this.haveTempTabData){
// 存储数据
AppStorage.setOrCreate('channelIds', this.channelIds.join(','))
this.haveTempTabData = false
}
})
.bindContentCover(this.isShow, this.sheetBuilder(), {
modalTransition: ModalTransition.DEFAULT,
onWillAppear: () => {console.log("BindContentCover onWillAppear.")},
onAppear: () => {console.log("BindContentCover onAppear.")},
onWillDisappear: () => {console.log("BindContentCover onWillDisappear.")},
onDisappear: () => {console.log("BindContentCover onDisappear.")
onWillDisappear: () => {console.log("BindContentCover onWillDisappear.")
this.isShow = false
this.isEditIng = false}
this.isEditIng = false},
onDisappear: () => {console.log("BindContentCover onDisappear.")
}
})
}
...
...
@@ -591,6 +601,8 @@ struct ChannelSubscriptionLayout {
this.channelIds.push(item.channelId)
}
})
console.debug('TopNavigationComponent', '--changeMyChannelData channelIds--->' + this.channelIds.join(','))
}
}
...
...
sight_harmony/features/wdComponent/src/main/ets/components/page/TopNavigationComponentNew.ets
View file @
46c1b02
...
...
@@ -64,6 +64,8 @@ export struct TopNavigationComponentNew {
@State indicatorLeftMargin: number = 0
@State indicatorWidth: number = 0
@State isClickMorningEveningPaper: boolean = false
// 顶部导航栏是否有临时跳转频道数据不
@State haveTempTabData: boolean = false
build() {
Column() {
...
...
@@ -215,6 +217,7 @@ export struct TopNavigationComponentNew {
myChannelList: $myChannelList,
moreChannelList: $moreChannelList,
localChannelList: $localChannelList,
haveTempTabData: this.haveTempTabData,
changeTab: (index) => {
this.channelJumpToPage(index)
}
...
...
@@ -374,7 +377,6 @@ export struct TopNavigationComponentNew {
this.listScroller.scrollToIndex(index, true, ScrollAlign.CENTER)
}
/**
* 频道是播报
* @param item
...
...
@@ -501,8 +503,6 @@ export struct TopNavigationComponentNew {
}
let channelId = this.assignChannel.channelId
Logger.debug(TAG,'------onAssignChannelChange--------->'+channelId+' ==>'+this._currentNavIndex)
let index = -1
if (this._currentNavIndex === 0) {
// 第一个,新闻,先拿我的,再拿其他
...
...
@@ -563,14 +563,16 @@ export struct TopNavigationComponentNew {
for (let i = 0; i < this.moreChannelList.length; i++) {
let topNavDTO: TopNavDTO = this.moreChannelList[i]
if (topNavDTO.channelId?.toString() === channelId) {
this.moreChannelList.splice(i,1)
this.moreChannelList.splice(i, 1)
this.haveTempTabData = true
return topNavDTO
}
}
for (let j = 0; j < this.localChannelList.length; j++) {
let topNavDTO: TopNavDTO = this.localChannelList[j]
if (topNavDTO.channelId?.toString() === channelId) {
this.localChannelList.splice(j,1)
this.localChannelList.splice(j, 1)
this.haveTempTabData = true
return topNavDTO
}
}
...
...
@@ -583,19 +585,14 @@ export struct TopNavigationComponentNew {
clickMorningEveningPaper() {
// 早晚报埋点
const params: ParamType = {
"pageName": this.pageName,
"pageId": this.pageId,
}
Tracking.event("morning_evening_news_click", params)
TrackingButton.click('morning_evening_news_click', TrackConstants.SummaryType.MorningAndEveningNews,
TrackConstants.SummaryType.MorningAndEveningNews)
if (NetworkUtil.isNetConnected()) {
DailyPaperTopicModel.getDailyPaperTopic().then(dailyPaperTopicBean => {
if (dailyPaperTopicBean && dailyPaperTopicBean.id > 0) {
SPHelper.default.saveSync('dailyPaperTopicPageId', dailyPaperTopicBean.id);
ProcessUtils.gotoMorningEveningPaper()
TrackingButton.click('morning_evening_news_click', TrackConstants.SummaryType.MorningAndEveningNews,
TrackConstants.SummaryType.MorningAndEveningNews)
} else {
ToastUtils.showToast('暂无早晚报信息', 1000)
}
...
...
@@ -622,127 +619,47 @@ export struct TopNavigationComponentNew {
//请求顶导数据
async getTopNavList(id: number) {
Logger.debug(TAG, 'getTopNavList==>' + this.storageChannelIds)
Logger.debug(TAG, 'getTopNavList=
存储
=>' + this.storageChannelIds)
let bottomNavDetail = await ChannelViewModel.getBottomNavDetailData(id, this.storageChannelIds)
let topNavList = bottomNavDetail?.topNavChannelList || []
let cityName = SPHelper.default.getSync(SpConstants.LOCATION_CITY
_NAME, '') as string
//let provinceName = SPHelper.default.getSync(SpConstants.LOCATION_PROVINCE
_NAME, '') as string
let _myChannelList: TopNavDTO [] = []
let _storageChannelIds: string [] = [] //list1
let defaultMyChannelList: TopNavDTO[] = []
let defaultList = [...topNavList]
Logger.debug(TAG, 'cityName=>' + cityName)
// 排序
defaultList.sort((a, b) => {
return a.num - b.num;
});
//defaultMyChannelList
defaultList.forEach(item => {
if (item.defaultPermitted === 1 || item.movePermitted === 0 || item.delPermitted === 0 ||
item.headlinesOn === 1) {
defaultMyChannelList.push(item);
}
if (item.defaultPermitted === 1) {
this.homeChannelList.push(item)
}
})
//有缓存频道id
if (this.storageChannelIds) {
_storageChannelIds = this.storageChannelIds.split(',')
}
defaultMyChannelList.forEach(item => {
item.myChannel = '1'
topNavList.forEach(item => {
if (item.defaultPermitted === 1) {
item.homeChannel = '1'
}
let index = defaultList.findIndex(_item => _item.channelId === item.channelId)
if (index !== -1) {
defaultList.splice(index, 1)
console.debug('TopNavigationComponent', '--homeChannelList--->' + item.name)
this.homeChannelList.push(item)
}
})
defaultList.unshift(...defaultMyChannelList)
defaultList.forEach((item, index) => {
if (item.channelType === 2) {
if (cityName.includes(item.name)) {
item.myChannel = '1'
}
item.localChannel = '1'
}
if (index >= 11) {
if (item.channelType === 1) {
item.moreChannel = '1'
}
} else {
if (item.channelType === 1 && item.myChannel !== '1') {
item.moreChannel = '1'
}
}
if (this.storageChannelIds && _storageChannelIds.includes(String(item.channelId))) {
item.myChannel = '1'
}
//频道分类
//TODO 暂时隐藏播报
if (item.name !== '播报') {
if (item.myChannel === '1') {
_myChannelList.push(item)
}
if (item.moreChannel === '1' && item.myChannel !== '1') {
} else if (item.moreChannel === '1' && item.myChannel !== '1') {
this.moreChannelList.push(item)
}
if (item.localChannel === '1' && item.myChannel !== '1') {
} else if (item.localChannel === '1' && item.myChannel !== '1') {
this.localChannelList.push(item)
}
}
})
//根据缓存数组排序
if (this.storageChannelIds) {
// let sortedyChannelList: TopNavDTO [] = []
//
// _storageChannelIds.forEach((channelId) => {
// console.debug(TAG, 'getTopNavList=0=>' + channelId)
// for (let a of _myChannelList) {
//
// console.debug(TAG,
// 'getTopNavList=1=>' + channelId + ' ' + a.channelId + ' ' + (channelId == String(a.channelId)))
// if (channelId == String(a.channelId)) {
// sortedyChannelList.push(a)
// break;
// }
// }
//
// })
let sortedyChannelList = _myChannelList.sort((item1, item2) => {
let index1 = this.storageChannelIds.indexOf(String(item1.channelId));
let index2 = this.storageChannelIds.indexOf(String(item2.channelId));
return index1 - index2;
});
_myChannelList = sortedyChannelList
}
// if (cityName) {
// let index = _myChannelList.findIndex(ele => cityName.includes(ele.name))
// const localChannelitem = _myChannelList.splice(index, 1)[0];
// // 将当前地区频道插入到第四个
// _myChannelList.splice(3, 0, localChannelitem);
// }
this.myChannelList = _myChannelList
//缓存首页频道
let index = this.myChannelList.findIndex(_item => _item?.channelId === this.indexSettingChannelId)
if (index > -1) {
this.currentTopNavSelectedIndex = index
}
// 存储我的频道栏目中的频道id信息
let channelIds: number [] = []
this.myChannelList.forEach(item => {
if (item != undefined && item.channelId != undefined) {
channelIds.push(item.channelId)
}
})
AppStorage.setOrCreate('channelIds', channelIds.join(','))
}
}
\ No newline at end of file
...
...
sight_harmony/features/wdComponent/src/main/ets/components/search/SearchResultContentComponent.ets
View file @
46c1b02
...
...
@@ -346,7 +346,9 @@ export struct SearchResultContentComponent {
}.offset({ left: this.listLeft })
ListItem(){
this.itemEnd()
if (this.data_rmh.length === 10){
this.itemEnd()
}
}.height('100%')
.margin({left:'23lpx'})
}
...
...
@@ -375,6 +377,8 @@ export struct SearchResultContentComponent {
console.info(TAG,'Pan start')
})
.onActionUpdate((event: GestureEvent) => {
///小于10个不展示滑动
if (this.data_rmh.length < 10) return;
if (event && this.isEnd) {
// console.log('event.offsetX',event.offsetX)
this.listLeft = event.offsetX < -60 ? -60 : event.offsetX > 0 ? 0 : event.offsetX
...
...
@@ -384,6 +388,7 @@ export struct SearchResultContentComponent {
}
})
.onActionEnd((event: GestureEvent) => {
if (this.data_rmh.length < 10) return;
console.info(TAG,'Pan end')
this.listLeft = 0
// this.moreWidth = 20
...
...
sight_harmony/features/wdComponent/src/main/ets/repository/PageRepository.ets
View file @
46c1b02
...
...
@@ -192,9 +192,12 @@ export class PageRepository {
/**
* 早晚报pageInfo请求
* */
static getMorningEveningPageInfoUrl(pageId: string) {
static getMorningEveningPageInfoUrl(pageId: string
,topicId:string
) {
let url = HttpUrlUtils.getHost() + HttpUrlUtils.PAGE_INFO_PATH;
url = url + "?pageId=" + pageId;
if(!StringUtils.isEmpty(topicId)){
url = url+ "&topicId=" + topicId;
}
Logger.info(TAG, "getMorningEveningPageInfoUrl url = " + url)
return url;
}
...
...
@@ -392,8 +395,8 @@ export class PageRepository {
/**
* 获取早晚报pageInfo
* */
static fetchMorningEveningPageInfo(pageId: string) {
let url = PageRepository.getMorningEveningPageInfoUrl(pageId)
static fetchMorningEveningPageInfo(pageId: string,topicId:string) {
let url = PageRepository.getMorningEveningPageInfoUrl(pageId,topicId)
return WDHttp.get<ResponseDTO<PageInfoBean>>(url)
};
...
...
@@ -418,7 +421,7 @@ export class PageRepository {
* 获取播报pageInfo
* */
static fetchBroadcastPageInfo(pageId: string) {
let url = PageRepository.getMorningEveningPageInfoUrl(pageId)
let url = PageRepository.getMorningEveningPageInfoUrl(pageId
,''
)
return WDHttp.get<ResponseDTO<PageInfoBean>>(url)
};
...
...
sight_harmony/features/wdComponent/src/main/ets/utils/InsightIntentShare.ets
View file @
46c1b02
...
...
@@ -96,7 +96,7 @@ export function viewBlogItemInsightIntentShare(context: common.UIAbilityContext,
},
intentEntityInfo: {
entityName: 'Blog',
entityId:
String(item?.newsId)
|| '',
entityId:
`objectId=${item?.newsId}&objectType=${item?.newsType}`
|| '',
displayName: item?.newsTitle || '',
entityGroupId: String(item?.reLInfo?.channelId), //channelId
logoURL: item.fullColumnImgUrls.length > 0 ? item.fullColumnImgUrls[0]?.url : item.firstFrameImageUri || 'https://cdnjdphoto.aikan.pdnews.cn/WapApi/800/launcher_icon.png',
...
...
@@ -145,7 +145,7 @@ export function viewColumInsightIntentShare(context: common.UIAbilityContext, en
entityId,
displayName: pageInfoBean?.topicInfo?.title,
description: pageInfoBean?.shareSummary,
logoURL: pageInfoBean?.shareCoverUrl,
logoURL: pageInfoBean?.shareCoverUrl
|| 'https://cdnjdphoto.aikan.pdnews.cn/WapApi/800/launcher_icon.png'
,
activityType: ['RecentViews'],
columnTitle: pageInfoBean?.topicInfo?.title,
columnSubTitle: pageInfoBean?.shareSummary,
...
...
sight_harmony/features/wdComponent/src/main/ets/viewmodel/BroadcastViewModel.ets
View file @
46c1b02
...
...
@@ -9,7 +9,7 @@ export class BroadcastViewModel {
static async getBroadcastViewPageInfo(pageId: string): Promise<PageInfoBean> {
return new Promise<PageInfoBean>((success, error) => {
Logger.info(TAG, `getBroadcastViewPageInfo pageInfo start`);
PageRepository.fetchMorningEveningPageInfo(pageId).then((resDTO: ResponseDTO<PageInfoBean>) => {
PageRepository.fetchMorningEveningPageInfo(pageId
,''
).then((resDTO: ResponseDTO<PageInfoBean>) => {
if (!resDTO || !resDTO.data) {
Logger.error(TAG, 'getBroadcastViewPageInfo then navResDTO is empty');
error('resDTO is empty');
...
...
sight_harmony/features/wdComponent/src/main/ets/viewmodel/MorningEveningViewModel.ets
View file @
46c1b02
...
...
@@ -36,7 +36,7 @@ export class MorningEveningViewModel {
static async getMorningEveningPageInfo(pageId: string): Promise<PageInfoBean> {
return new Promise<PageInfoBean>((success, error) => {
Logger.info(TAG, `getMorningEveningPageInfo pageInfo start`);
PageRepository.fetchMorningEveningPageInfo(pageId).then((resDTO: ResponseDTO<PageInfoBean>) => {
PageRepository.fetchMorningEveningPageInfo(pageId
,''
).then((resDTO: ResponseDTO<PageInfoBean>) => {
if (!resDTO || !resDTO.data) {
Logger.error(TAG, 'getMorningEveningPageInfo then navResDTO is empty');
error('resDTO is empty');
...
...
sight_harmony/features/wdComponent/src/main/resources/base/media/paper_placeholder.jpg
0 → 100644
View file @
46c1b02
46.2 KB
sight_harmony/features/wdDetailPlayShortVideo/src/main/ets/pages/VideoChannelDetail.ets
View file @
46c1b02
...
...
@@ -15,6 +15,7 @@ import { DisplayDirection } from 'wdConstant/Index';
import { window } from '@kit.ArkUI';
import { EmptyComponent, WDViewDefaultType } from 'wdComponent/Index';
import { TrackConstants, TrackingPageBrowse } from 'wdTracking/Index';
import { LottieView } from 'wdComponent/Index'
interface loadMoreData {
pageNum: number;
...
...
@@ -24,6 +25,7 @@ interface loadMoreData {
const TAG = 'VideoChannelDetail'
const storage = LocalStorage.getShared();
PersistentStorage.persistProp('GestureLoadStrategy', 0); // 点播视频手势动画0为用户首次进入视频点播,1为用户已进入视频点播
@Entry(storage)
@Component
...
...
@@ -66,6 +68,7 @@ export struct VideoChannelDetail {
pageHideTime: number = 0;
@Provide onlyWifiLoadVideo: boolean = false
@Provide toastTextVisible: boolean = false
@StorageLink('GestureLoadStrategy') GestureLoadStrategy: number = 0
autoRefreshChange() {
if (this.topNavIndex === 0 && !this.isRequesting) {
...
...
@@ -277,7 +280,7 @@ export struct VideoChannelDetail {
}
build() {
Column(
) {
Stack({ alignContent: Alignment.Center }
) {
if (this.isRequestError) {
EmptyComponent({
emptyType: WDViewDefaultType.WDViewDefaultType_NoVideo,
...
...
@@ -289,6 +292,7 @@ export struct VideoChannelDetail {
PictureLoading()
.visibility(this.isMouted ? Visibility.None : Visibility.Visible)
Swiper(this.swiperController) {
ForEach(this.data, (item: ContentDetailDTO, index: number) => {
DetailPlayShortVideoPage({
...
...
@@ -319,6 +323,29 @@ export struct VideoChannelDetail {
this.getRecCompInfo()
}
})
// 作为手势动画的背景
Row() {}
.justifyContent(FlexAlign.Center)
.width('100%')
.height('100%')
.visibility(this.isMouted && this.GestureLoadStrategy == 0 ? Visibility.Visible : Visibility.Hidden)
.backgroundColor('rgba(0, 0, 0, 0.50)')
.onTouch(() => {
this.GestureLoadStrategy = 1
})
// 手势动画 初次进入显示
LottieView({
name: 'slider_up_view_more',
path: "lottie/slider_up_view_more.json",
lottieWidth: 167,
lottieHeight: 167,
autoplay: true,
loop: true
})
.visibility(this.isMouted && this.GestureLoadStrategy == 0 ? Visibility.Visible : Visibility.Hidden)
.onTouch(() => {
this.GestureLoadStrategy = 1
})
}
}
...
...
sight_harmony/features/wdDetailPlayShortVideo/src/main/ets/view/PlayerTitleView.ets
View file @
46c1b02
...
...
@@ -51,7 +51,6 @@ export struct PlayerTitleView {
/**
* 截断文本
* @author liuzhendong(猩猩G)
* @param {string} str 要截断的文本 '啊啊啊啊啊'
* @param {number} fontSize 字体大小(px)
* @param {number} maxLines 最大行数 3
...
...
sight_harmony/features/wdHwAbility/src/main/ets/location/HWLocationUtils.ets
View file @
46c1b02
...
...
@@ -117,6 +117,7 @@ export class HWLocationUtils {
let code: string[] = await HWLocationUtils.getCityCode(data[0].administrativeArea, data[0].subAdministrativeArea)
if (code && code.length >= 2) {
SPHelper.default.save(SpConstants.LOCATION_CITY_NAME, cityName)
SPHelper.default.save(SpConstants.LOCATION_PROVINCE_NAME, data[0].administrativeArea)
SPHelper.default.save(SpConstants.LOCATION_PROVINCE_CODE, code[0])
SPHelper.default.save(SpConstants.LOCATION_CITY_CODE, code[1])
}
...
...
sight_harmony/features/wdLogin/src/main/ets/pages/login/OneKeyLoginPage.ets
View file @
46c1b02
...
...
@@ -50,7 +50,7 @@ struct OneKeyLoginPage {
// 获取到Authorization Code
let authorizationCode = response.authorizationCode;
// hilog.info(0x0000, 'testTag', 'response: %{public}s', JSON.stringify(response));
TrackingButton.click("oneClickLoginPageLoginButton",
this.pageName, this.pageName
)
TrackingButton.click("oneClickLoginPageLoginButton",
TrackConstants.PageName.OneClick_Login, TrackConstants.PageName.OneClick_Login
)
this.requestLogin()
return;
}
...
...
@@ -58,7 +58,6 @@ struct OneKeyLoginPage {
// 埋点计算页面浏览时长
private pageStartDate: number = 0
private pageName = TrackConstants.PageName.OneClick_Login
aboutToAppear(): void {
this.anonymousPhone = HuaweiAuth.sharedInstance().anonymousPhone||""
...
...
@@ -70,7 +69,7 @@ struct OneKeyLoginPage {
onPageHide(): void {
const duration = Math.floor((Date.now() - this.pageStartDate!)/1000)
TrackingPageBrowse.trackCommonPageExposureEnd(
this.pageName, this.pageName
, duration)
TrackingPageBrowse.trackCommonPageExposureEnd(
TrackConstants.PageName.OneClick_Login, TrackConstants.PageName.OneClick_Login
, duration)
}
// pageTransition() {
...
...
@@ -161,7 +160,7 @@ struct OneKeyLoginPage {
Row() {
Image($r("app.media.huawei_one_key_login_icon"))
.width(24).height(24)
Text("华为账号
一键
登录")
Text("华为账号
快速
登录")
.fontColor(Color.White)
.margin({left:5})
}
...
...
@@ -171,30 +170,40 @@ struct OneKeyLoginPage {
.borderRadius(4)
.type(ButtonType.Normal)
.backgroundColor("#ED2800")
.onClick(() => {
Stack(){
//目前不支持文字和图标同时展示,后面优化
LoginWithHuaweiIDButton({
params: {
// LoginWithHuaweiIDButton支持的样式。
style: loginComponentManager.Style.BUTTON_CUSTOM,
// LoginWithHuaweiIDButton的边框圆角半径。
// borderRadius: 4,
// LoginWithHuaweiIDButton支持的登录类型。
loginType: loginComponentManager.LoginType.QUICK_LOGIN,
// LoginWithHuaweiIDButton支持按钮的样式跟随系统深浅色模式切换。
// supportDarkMode: true,
customButtonParams: {
fontColor: loginComponentManager.FontColor.WHITE,
// backgroundColor:!this.agreeProtocol ? "#60ED2800" : "#ED2800"
backgroundColor:"#ED2800"
}
},
controller: this.controller
}).opacity(0)
}
.width('100%')
.height('100%')
if (!this.agreeProtocol) {
this.toastText = "请阅读并勾选用户协议、隐私政策和华为账号用户认证协议"
this.dialogToast.open()
return
}
TrackingButton.click("oneClickLoginPageLoginButton", TrackConstants.PageName.OneClick_Login, TrackConstants.PageName.OneClick_Login)
this.requestLogin()
})
// Stack(){
// //目前不支持文字和图标同时展示,后面优化
// LoginWithHuaweiIDButton({
// params: {
// // LoginWithHuaweiIDButton支持的样式。
// style: loginComponentManager.Style.BUTTON_CUSTOM,
// // LoginWithHuaweiIDButton的边框圆角半径。
// // borderRadius: 4,
// // LoginWithHuaweiIDButton支持的登录类型。
// loginType: loginComponentManager.LoginType.QUICK_LOGIN,
// // LoginWithHuaweiIDButton支持按钮的样式跟随系统深浅色模式切换。
// // supportDarkMode: true,
// customButtonParams: {
// fontColor: loginComponentManager.FontColor.WHITE,
// // backgroundColor:!this.agreeProtocol ? "#60ED2800" : "#ED2800"
// backgroundColor:"#ED2800"
// }
// },
// controller: this.controller
// }).opacity(0)
// }
// .width('100%')
// .height('100%')
}
}
.height(48)
...
...
sight_harmony/features/wdLogin/src/main/ets/utils/HuaweiAuth.ets
View file @
46c1b02
...
...
@@ -94,7 +94,7 @@ export default class HuaweiAuth {
// 创建授权请求,并设置参数
let loginRequest = new authentication.HuaweiIDProvider().createAuthorizationWithHuaweiIDRequest();
// 获取头像昵称需要传如下scope
loginRequest.scopes = ['profile']; //, 'phone'
loginRequest.scopes = ['profile'
, 'phone'
]; //, 'phone'
// 若开发者需要进行服务端开发,则需传如下permission获取authorizationCode
loginRequest.permissions = ['serviceauthcode'];
// 用户是否需要登录授权,该值为true且用户未登录或未授权时,会拉起用户登录或授权页面
...
...
sight_harmony/products/phone/src/main/ets/utils/InsightIntentExecutorImpl.ets
View file @
46c1b02
...
...
@@ -12,6 +12,7 @@ import DailyPaperTopicModel from 'wdComponent/src/main/ets/model/DailyPaperTopic
*/
export default class InsightIntentExecutorImpl extends InsightIntentExecutor {
private static readonly ViewBlog = 'ViewBlog';
private static readonly ViewColumn = 'ViewColumn';
private static readonly ViewColumnUpdate = 'ViewColumnUpdate';
/**
...
...
@@ -31,6 +32,8 @@ export default class InsightIntentExecutorImpl extends InsightIntentExecutor {
return this.jumpToViewBlog(param, pageLoader);
case InsightIntentExecutorImpl.ViewColumnUpdate:
return this.jumpToViewColumnUpdate(param, pageLoader);
case InsightIntentExecutorImpl.ViewColumn:
return this.jumpToViewColumnUpdate(param, pageLoader);
default:
break;
}
...
...
Please
register
or
login
to post a comment