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-04 09:29:50 +0800
Browse Files
Options
Browse Files
Download
Plain Diff
Commit
574e315bd65412fc3d7348065d102f6a98dba3e1
574e315b
2 parents
300c284b
db4f8c57
Merge remote-tracking branch 'origin/main'
Show whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
264 additions
and
146 deletions
sight_harmony/commons/wdKit/src/main/ets/utils/SPHelper.ets
sight_harmony/features/wdBean/src/main/ets/bean/content/ContentDTO.ets
sight_harmony/features/wdBean/src/main/ets/bean/detail/ShareInfoDTO.ts
sight_harmony/features/wdComponent/src/main/ets/components/ENewspaperPageComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/MorningEveningPaper/PaperTitleComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/page/CardView.ets
sight_harmony/features/wdComponent/src/main/ets/components/setting/AccountAndSecurityLayout.ets
sight_harmony/features/wdComponent/src/main/ets/components/setting/MineSettingComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/view/LiveOperRowListView.ets
sight_harmony/features/wdComponent/src/main/ets/components/view/OperRowListView.ets
sight_harmony/features/wdComponent/src/main/ets/model/MineSettingDatasModel.ets
sight_harmony/features/wdDetailPlayLive/src/main/ets/pages/DetailPlayLiveCommon.ets
sight_harmony/features/wdDetailPlayLive/src/main/ets/pages/DetailPlayLivePage.ets
sight_harmony/features/wdDetailPlayLive/src/main/ets/pages/DetailPlayVLivePage.ets
sight_harmony/features/wdDetailPlayLive/src/main/ets/viewModel/LiveDetailPageLogic.ets
sight_harmony/features/wdDetailPlayLive/src/main/ets/widgets/details/video/TopPlayComponet.ets
sight_harmony/features/wdDetailPlayShortVideo/src/main/ets/view/OperationListView.ets
sight_harmony/features/wdShare/src/main/ets/WDShare.ets
sight_harmony/products/phone/src/main/ets/pages/launchPage/LaunchAdvertisingPage.ets
sight_harmony/commons/wdKit/src/main/ets/utils/SPHelper.ets
View file @
574e315
import data_preferences from '@ohos.data.preferences';
import { Logger } from './Logger';
import { JSON } from '@kit.ArkTS';
const TAG = 'SPHelper'
const logEnable = false
/**
* sp存储,单条数据,value<1k;业务数据超过1k的,建议使用KVStoreHelper
*/
...
...
@@ -12,10 +15,14 @@ export class SPHelper {
static init(context: Context) {
SPHelper.context = context;
if (context) {
Logger.debug(TAG, '初始化context')
}
}
static setSpFilename(spFilename: string) {
SPHelper.spFilename = spFilename;
Logger.debug(TAG, '设置文件名: ' + spFilename)
}
// 静态属性
...
...
@@ -37,47 +44,75 @@ export class SPHelper {
}
async save(key: string, value: data_preferences.ValueType) {
try {
const preferences: data_preferences.Preferences = await this.getVideoPreferences();
await preferences.put(key, value)
await preferences.flush()
if (logEnable) {
Logger.debug(TAG, '保存 key: ' + key + " value => " + value)
}
} catch (e) {
Logger.error(TAG, '保存 key: ' + key + " value => " + value + " 报错:" + JSON.stringify(e))
}
}
saveSync(key: string, value: data_preferences.ValueType) {
const preferences: data_preferences.Preferences = this.getVideoPreferencesSync();
preferences.putSync(key, value)
preferences.flush().then(() => {
Logger.debug(TAG, 'saveSync flush success')
if (logEnable) {
Logger.debug(TAG, 'sync保存 key: ' + key + " value => " + value)
}
}).catch((error: object) => {
Logger.
debug(TAG, 'saveSync flush failed: '
+ JSON.stringify(error))
Logger.
error(TAG, 'sync保存 key: ' + key + " value => " + value + " 报错:"
+ JSON.stringify(error))
});
}
async get(key: string, defValue: data_preferences.ValueType): Promise<data_preferences.ValueType> {
const preferences: data_preferences.Preferences = await this.getVideoPreferences();
return await preferences.get(key, defValue);
const data = await preferences.get(key, defValue);
if (logEnable) {
Logger.debug(TAG, '获取 key: ' + key + " value => " + data + "| 默认值:" + defValue)
}
return data
}
getSync(key: string, defValue: data_preferences.ValueType): data_preferences.ValueType {
const preferences: data_preferences.Preferences = this.getVideoPreferencesSync();
return preferences.getSync(key, defValue);
const data = preferences.getSync(key, defValue);
if (logEnable) {
Logger.debug(TAG, 'sync获取 key: ' + key + " value => " + data + "| 默认值:" + defValue)
}
return data
}
async has(key: string): Promise<boolean> {
const preferences: data_preferences.Preferences = await this.getVideoPreferences();
return await preferences.has(key);
const data = await preferences.has(key);
if (logEnable) {
Logger.debug(TAG, 'has key: ' + key + ' => ' + data)
}
return data
}
hasSync(key: string): boolean {
const preferences: data_preferences.Preferences = this.getVideoPreferencesSync();
return preferences.hasSync(key);
const data = preferences.hasSync(key);
if (logEnable) {
Logger.debug(TAG, 'synchas key: ' + key + ' => ' + data)
}
return data
}
async delete(key: string) {
const preferences: data_preferences.Preferences = await this.getVideoPreferences();
preferences.delete(key).then(async () => {
await preferences.flush();
if (logEnable) {
Logger.debug(TAG, '删除 key: ' + key)
}
}).catch((err: Error) => {
// Logger.error(TAG, 'Failed to delete the key. Cause: ' + err
);
Logger.error(TAG, '删除 key失败:' + JSON.stringify(err)
);
});
}
...
...
@@ -85,9 +120,11 @@ export class SPHelper {
const preferences: data_preferences.Preferences = this.getVideoPreferencesSync();
preferences.deleteSync(key)
preferences.flush().then(() => {
Logger.debug(TAG, 'deleteSync flush success')
if (logEnable) {
Logger.debug(TAG, 'sync删除 key: ' + key)
}
}).catch((error: object) => {
Logger.
debug(TAG, 'deleteSync flush failed: ' + JSON.stringify(error))
Logger.
error(TAG, 'sync删除 key失败:' + JSON.stringify(error));
});
}
...
...
@@ -95,8 +132,9 @@ export class SPHelper {
this.getVideoPreferences().then(async (preferences: data_preferences.Preferences) => {
preferences.clearSync()
await preferences.flush()
Logger.debug(TAG, 'sync清除所有数据');
}).catch((err: Error) => {
// Logger.error(TAG, 'get the preferences failed, Cause: ' + err
);
Logger.error(TAG, 'sync清除所有数据,失败:' + JSON.stringify(err)
);
});
}
...
...
sight_harmony/features/wdBean/src/main/ets/bean/content/ContentDTO.ets
View file @
574e315
...
...
@@ -9,6 +9,16 @@ import { commentInfo } from './commentInfo';
import { BaseDTO } from '../component/BaseDTO';
import { LiveRoomDataBean } from '../live/LiveRoomDataBean';
export class ContentShareInfoDTO {
shareTitle: string = ''
shareUrl: string = ''
shareSummary: string = ''
shareCoverUrl: string = ''
sharePosterCoverUrl: string = ''
shareOpen: number = 0
sharePosterOpen: number = 0
}
@Observed
export class ContentDTO implements BaseDTO {
seoTags: string = '';
...
...
@@ -70,6 +80,7 @@ export class ContentDTO implements BaseDTO {
fullColumnImgUrls: FullColumnImgUrlDTO[] = [];
liveInfo: LiveInfoDTO = {} as LiveInfoDTO; // 直播新闻信息【BFF聚合】
videoInfo: VideoInfoDTO = {} as VideoInfoDTO; // 视频新闻信息【BFF聚合】,视频非原片+清晰度最高的
shareInfo: ContentShareInfoDTO = {} as ContentShareInfoDTO
newsSummary: string = ''; //appstyle:2 ,新闻详情
contentText?: string = '';
...
...
@@ -154,6 +165,7 @@ export class ContentDTO implements BaseDTO {
content.fullColumnImgUrls = old.fullColumnImgUrls;
content.liveInfo = old.liveInfo;
content.videoInfo = old.videoInfo;
content.shareInfo = old.shareInfo
content.newsSummary = old.newsSummary;
content.interactData = old.interactData;
content.hasMore = old.hasMore;
...
...
sight_harmony/features/wdBean/src/main/ets/bean/detail/ShareInfoDTO.ts
View file @
574e315
...
...
@@ -14,37 +14,37 @@ export interface ShareInfoDTO {
//分享链接
shareUrl
:
string
;
//首发时间
p
ublishTime
:
string
;
appCustomP
ublishTime
:
string
;
//图片
i
mageUrl
:
string
;
appCustomI
mageUrl
:
string
;
//直播和内容的举报,仅针对人民号发布的才能举报,cms创建的没有举报按钮
s
howReport
:
boolean
;
appCustomS
howReport
:
boolean
;
//点赞按钮显示 -1:不展示 0:未点赞 1:已点赞
s
howLike
:
number
;
appCustomS
howLike
:
number
;
//0 分享海报关闭,1 分享海报开启
p
osterShareControl
:
string
;
appCustomP
osterShareControl
:
string
;
//是否展示海报 -1-不展示图标
s
howPoster
:
number
;
appCustomS
howPoster
:
number
;
//海报展示类型 1:专题、文章、图文、视频、直播 2:人民号 3:评论 4:电子报海报 5:音频专题海报 6:早晚报专题海报 7:榜单H5 8:H5普通文章专题,包含时间链
s
howPosterType
:
number
;
appCustomS
howPosterType
:
number
;
//接口返回: 内容id、内容类型
c
ontentId
:
string
;
appCustomC
ontentId
:
string
;
//内容类型,分享的类型 0:不跳转 1:点播,2:直播,3:活动,4:广告,5:专题,6:链接,7:榜单,8:图文,9:组图,10:H5新闻,11:频道,12:组件,13:音频,14动态图文,15动态视频
c
ontentType
:
string
;
appCustomC
ontentType
:
string
;
//关系id
t
argetRelId
:
string
;
appCustomT
argetRelId
:
string
;
//关系类型,1.频道关系;2.专题关系
t
argetRelType
:
string
;
appCustomT
argetRelType
:
string
;
//21:文章专题,22:音频专题,23:直播专题,24:话题专题,25:早晚报专题
t
opicType
:
string
;
appCustomT
opicType
:
string
;
//早晚报;1-早报;2-午报;3-晚报
t
opicPattern
:
number
;
appCustomT
opicPattern
:
number
;
//是否有头版
i
sFrontDaily
:
boolean
;
appCustomI
sFrontDaily
:
boolean
;
//分享海报简介
posterSummary
:
string
;
sharePosterItemList
:
SharePosterItemBean
[]
appCustomPosterSummary
:
string
;
appCustomSharePosterItemList
:
SharePosterItemBean
[]
//分享海报标题
p
osterTitle
:
string
;
appCustomP
osterTitle
:
string
;
}
...
...
sight_harmony/features/wdComponent/src/main/ets/components/ENewspaperPageComponent.ets
View file @
574e315
...
...
@@ -444,17 +444,17 @@ export struct ENewspaperPageComponent {
let contentDetailData: ContentDetailDTO = {
shareInfo:{
shareTitle:this.newspaperListBean?.list[this.swiperIndex].pageName,
publishTime:this.newspaperListBean?.list[this.swiperIndex].periodNum,
imageUrl:this.newspaperListBean?.list[this.swiperIndex].pagePic,
appCustomPublishTime:this.newspaperListBean?.list[this.swiperIndex].periodNum,
appCustomImageUrl:this.newspaperListBean?.list[this.swiperIndex].pagePic,
shareUrl:this.newspaperListBean?.list[this.swiperIndex].sharePagePic.shareUrl,
sharePosterCoverUrl:this.newspaperListBean?.list[this.swiperIndex].sharePagePic.sharePosterCoverUrl,
showReport:false,
showLike:-1,
appCustomShowReport:false,
appCustomShowLike:-1,
shareOpen:1,
sharePosterOpen:1,
posterShareControl:'-1',
showPoster:-1,
showPosterType:4,
appCustomPosterShareControl:'-1',
appCustomShowPoster:-1,
appCustomShowPosterType:4,
}
} as ContentDetailDTO
WDShare.shareContent(contentDetailData,TrackConstants.PageName.NewsPaperPage,TrackConstants.PageName.NewsPaperPage)
...
...
sight_harmony/features/wdComponent/src/main/ets/components/MorningEveningPaper/PaperTitleComponent.ets
View file @
574e315
...
...
@@ -157,20 +157,20 @@ export struct PaperTitleComponent {
let contentDetailData: ContentDetailDTO = {
newsId:Number.parseInt(this.topicInfo.topicId),
shareInfo:{
contentId:this.topicInfo.topicId,
contentType:this.topicInfo.topicType+'',
appCustomContentId:this.topicInfo.topicId,
appCustomContentType:this.topicInfo.topicType+'',
shareTitle:this.topicInfo.shareTitle,
shareSummary:this.topicInfo.shareSummary,
i
mageUrl:this.topicInfo.shareCoverUrl,
appCustomI
mageUrl:this.topicInfo.shareCoverUrl,
sharePosterCoverUrl:this.topicInfo.sharePosterCoverUrl,
shareUrl:this.topicInfo.shareUrl,
targetRelId:this.topicInfo.relId,
targetRelType:this.topicInfo.relType,
showReport:false,
showLike:-1,
appCustomTargetRelId:this.topicInfo.relId,
appCustomTargetRelType:this.topicInfo.relType,
appCustomShowReport:false,
appCustomShowLike:-1,
shareOpen:1,
sharePosterOpen:this.topicInfo.posterFlag,
s
howPoster:this.topicInfo.posterFlag>0?1:-1,
appCustomS
howPoster:this.topicInfo.posterFlag>0?1:-1,
}
} as ContentDetailDTO
WDShare.setTopicBeanToShareBean(contentDetailData.shareInfo,this.topicInfo)
...
...
sight_harmony/features/wdComponent/src/main/ets/components/page/CardView.ets
View file @
574e315
...
...
@@ -6,6 +6,7 @@ import { ProcessUtils, WDRouterRule } from 'wdRouter';
import { TrackConstants,
TrackingButton,
TrackingContent, TrackingPageBrowse, TrackParamConvert } from 'wdTracking/Index';
import { WDShare } from 'wdShare/Index';
const TAG: string = 'CardView';
...
...
@@ -588,7 +589,7 @@ export struct PaperSingleColumn999CardView {
right: { anchor: '__container__', align: HorizontalAlign.End }
})
.onClick(() => {
ToastUtils.showToast('分享为公共方法,待开发', 1000
)
WDShare.shareProgram(this.item
)
})
}.width(CommonConstants.FULL_PARENT)
.justifyContent(FlexAlign.SpaceBetween)
...
...
sight_harmony/features/wdComponent/src/main/ets/components/setting/AccountAndSecurityLayout.ets
View file @
574e315
import { SpConstants } from 'wdConstant';
import { Logger, SPHelper, ToastUtils, EmitterEventId, EmitterUtils, DateTimeUtils, CustomToast } from 'wdKit';
import {MineMainSettingFunctionItem} from '../../viewmodel/MineMainSettingFunctionItem';
import
MineSettingDatasModel
from '../../model/MineSettingDatasModel';
import
{ MineSettingDatasModel }
from '../../model/MineSettingDatasModel';
import router from '@ohos.router';
import { WDRouterPage, WDRouterRule } from 'wdRouter';
import { Params } from 'wdBean';
...
...
sight_harmony/features/wdComponent/src/main/ets/components/setting/MineSettingComponent.ets
View file @
574e315
...
...
@@ -9,13 +9,15 @@ import { Params } from 'wdBean';
// import { common } from '@kit.AbilityKit';
import fs from '@ohos.file.fs';
import { CustomCacheDialog } from './CustomCacheDialog';
import
MineSettingDatasModel
from '../../model/MineSettingDatasModel';
import
{ MineSettingDatasModel }
from '../../model/MineSettingDatasModel';
import { MineMainSettingFunctionItem } from '../../viewmodel/MineMainSettingFunctionItem';
import common from '@ohos.app.ability.common';
import dataPreferences from '@ohos.data.preferences';
import { TitleBackComponent } from './TitleBackComponent';
import { MyCustomDialog } from '../reusable/MyCustomDialog';
import { TrackingButton, TrackConstants } from 'wdTracking/Index';
import { JSON } from '@kit.ArkTS';
import { HttpUtils } from 'wdNetwork/Index';
@Component
export struct MineSettingComponent {
...
...
@@ -82,10 +84,9 @@ export struct MineSettingComponent {
async getSettingPageData() {
let oldList = MineSettingDatasModel.getMineMainSettingFunctionItemData();
let userId=await SPHelper.default.get(SpConstants.USER_ID,'') as string
if(userId==''){
this.listData=oldList.slice(1,oldList.length)
}else {
if (!HttpUtils.isLogin()) {
this.listData = oldList.slice(1,oldList.length)
} else {
this.listData = oldList;
}
...
...
@@ -167,6 +168,7 @@ export struct MineSettingComponent {
.margin({ left: `${this.calcHeight(81)}lpx`, right: `${this.calcHeight(29)}lpx` })
.selectedColor("#ED2800")
.onChange((isOn: boolean) => {
Logger.debug("SPHelper", "数据 : " + JSON.stringify(item))
if(item.itemType=='push_switch'){
trackButtonClick("settingPagePushSwitch")
//推送
...
...
sight_harmony/features/wdComponent/src/main/ets/components/view/LiveOperRowListView.ets
View file @
574e315
...
...
@@ -296,7 +296,6 @@ export struct LiveOperRowListView {
.aspectRatio(1)
.interpolation(ImageInterpolation.High)
.onClick((event: ClickEvent) => {
// ToastUtils.showToast('分享为公共方法,待开发', 1000);
this.share()
})
}
...
...
sight_harmony/features/wdComponent/src/main/ets/components/view/OperRowListView.ets
View file @
574e315
...
...
@@ -391,7 +391,6 @@ export struct OperRowListView {
.aspectRatio(1)
.interpolation(ImageInterpolation.High)
.onClick((event: ClickEvent) => {
// ToastUtils.showToast('分享为公共方法,待开发', 1000);
this.share()
})
}
...
...
sight_harmony/features/wdComponent/src/main/ets/model/MineSettingDatasModel.ets
View file @
574e315
...
...
@@ -12,74 +12,49 @@ const TAG = "MineSettingDatasModel"
/**
* 我的设置页面 所有数据 获取封装类
*/
class MineSettingDatasModel{
private static instance: MineSettingDatasModel;
mainSettingData:Array<MineMainSettingFunctionItem> = []
accountAndSecurityData:Array<MineMainSettingFunctionItem> = []
private constructor() { }
/**
* 单例模式
* @returns
*/
public static getInstance(): MineSettingDatasModel {
if (!MineSettingDatasModel.instance) {
MineSettingDatasModel.instance = new MineSettingDatasModel();
}
return MineSettingDatasModel.instance;
}
export class MineSettingDatasModel {
/**
* 评论 关注 收藏 等7个数据
* 包含名字和图标
*/
getMineMainSettingFunctionItemData():MineMainSettingFunctionItem[]{
if(this.mainSettingData.length === 7){
return this.mainSettingData
}
this.mainSettingData = []
this.mainSettingData.push(new MineMainSettingFunctionItem(null, '账户与安全', '18888888888', 0, false,"account"))
static getMineMainSettingFunctionItemData() {
let mainSettingData: MineMainSettingFunctionItem[] = []
mainSettingData.push(new MineMainSettingFunctionItem(null, '账户与安全', '18888888888', 0, false,"account"))
let pushState=SPHelper.default.getSync(SpConstants.SETTING_PUSH_SWITCH,false) as boolean
this.mainSettingData.push(new MineMainSettingFunctionItem(null, '接收推送', null, 1, pushState,"push_switch"))
this.mainSettingData.push(new MineMainSettingFunctionItem(null, '隐私设罝', null, 0, false,"private_setting"))
mainSettingData.push(new MineMainSettingFunctionItem(null, '接收推送', null, 1, pushState,"push_switch"))
mainSettingData.push(new MineMainSettingFunctionItem(null, '隐私设罝', null, 0, false,"private_setting"))
let wifiState=SPHelper.default.getSync(SpConstants.SETTING_WIFI_IMAGE_SWITCH,false) as boolean
this.
mainSettingData.push(new MineMainSettingFunctionItem(null, '仅wifi网络加载图片', null, 1, wifiState,"wifi_switch"))
mainSettingData.push(new MineMainSettingFunctionItem(null, '仅wifi网络加载图片', null, 1, wifiState,"wifi_switch"))
let videoState=SPHelper.default.getSync(SpConstants.SETTING_WIFI_VIDEO_SWITCH,false) as boolean
this.
mainSettingData.push(new MineMainSettingFunctionItem(null, 'wifi网络情况下自动播放视频', null, 1, videoState,"video_switch"))
mainSettingData.push(new MineMainSettingFunctionItem(null, 'wifi网络情况下自动播放视频', null, 1, videoState,"video_switch"))
let suspensionState=SPHelper.default.getSync(SpConstants.SETTING_SUSPENSION_SWITCH,false) as boolean
this.
mainSettingData.push(new MineMainSettingFunctionItem(null, '开启播放器悬浮窗', null, 1, suspensionState,"suspensionState_switch"))
mainSettingData.push(new MineMainSettingFunctionItem(null, '开启播放器悬浮窗', null, 1, suspensionState,"suspensionState_switch"))
// this.mainSettingData.push(new MineMainSettingFunctionItem(null, null, null, 2, null,""))
this.
mainSettingData.push(new MineMainSettingFunctionItem(null, '清理缓存', '32MB', 0, false,"clear_cache"))
mainSettingData.push(new MineMainSettingFunctionItem(null, '清理缓存', '32MB', 0, false,"clear_cache"))
// this.mainSettingData.push(new MineMainSettingFunctionItem(null, '评价我们', null, 0, false,""))
return
this.
mainSettingData
return mainSettingData
}
/**
* 评论 关注 收藏 等7个数据
* 包含名字和图标
*/
getAccountAndSecuritySettingData():MineMainSettingFunctionItem[]{
if(this.accountAndSecurityData.length === 7){
return this.accountAndSecurityData
}
this.accountAndSecurityData = []
this.accountAndSecurityData.push(new MineMainSettingFunctionItem(null, '更换手机号', '18888888888', 0, false,""))
this.accountAndSecurityData.push(new MineMainSettingFunctionItem(null, '设置密码', null, 0, false,""))
this.accountAndSecurityData.push(new MineMainSettingFunctionItem(null, null, null, 2, null,""))
static getAccountAndSecuritySettingData():MineMainSettingFunctionItem[]{
let accountAndSecurityData: MineMainSettingFunctionItem[] = []
accountAndSecurityData.push(new MineMainSettingFunctionItem(null, '更换手机号', '18888888888', 0, false,""))
accountAndSecurityData.push(new MineMainSettingFunctionItem(null, '设置密码', null, 0, false,""))
accountAndSecurityData.push(new MineMainSettingFunctionItem(null, null, null, 2, null,""))
// this.accountAndSecurityData.push(new MineMainSettingFunctionItem($r('app.media.account_qqicon'), '绑定QQ', '立即绑定', 0, false,""))
// this.accountAndSecurityData.push(new MineMainSettingFunctionItem($r('app.media.account_wechaticon'), '绑定微信', '立即绑定', 0, false,""))
// this.accountAndSecurityData.push(new MineMainSettingFunctionItem($r('app.media.account_weiboicon'), '绑定新浪微博', '立即绑定', 0, false,""))
// this.accountAndSecurityData.push(new MineMainSettingFunctionItem($r('app.media.account_appleicon'), 'Apple ID', null, 0, false,""))
// this.accountAndSecurityData.push(new MineMainSettingFunctionItem(null, null, null, 2, null,""))
this.
accountAndSecurityData.push(new MineMainSettingFunctionItem(null, '注销账号', null, 0, false,""))
accountAndSecurityData.push(new MineMainSettingFunctionItem(null, '注销账号', null, 0, false,""))
return
this.
accountAndSecurityData
return accountAndSecurityData
}
...
...
@@ -113,10 +88,10 @@ class MineSettingDatasModel{
/**
* 判断是否设置过密码
*/
checkSetPassword(): Promise<CheckSetPasswordItem> {
static
checkSetPassword(): Promise<CheckSetPasswordItem> {
return new Promise<CheckSetPasswordItem>((success, error) => {
Logger.info(TAG, `checkSetPassword start`);
this
.fetchCheckSetPassword().then((navResDTO: ResponseDTO<CheckSetPasswordItem>) => {
MineSettingDatasModel
.fetchCheckSetPassword().then((navResDTO: ResponseDTO<CheckSetPasswordItem>) => {
if (!navResDTO || navResDTO.code != 0) {
error(null)
return
...
...
@@ -131,13 +106,9 @@ class MineSettingDatasModel{
})
}
fetchCheckSetPassword() {
static
fetchCheckSetPassword() {
let url = HttpUrlUtils.checkSetPassword()
return WDHttp.get<ResponseDTO<CheckSetPasswordItem>>(url)
};
}
const mineSettingDatasModel = MineSettingDatasModel.getInstance()
export default mineSettingDatasModel as MineSettingDatasModel
// export default MineMainSettingFunctionItem as MineMainSettingFunctionItem
...
...
sight_harmony/features/wdDetailPlayLive/src/main/ets/pages/DetailPlayLiveCommon.ets
View file @
574e315
...
...
@@ -7,7 +7,7 @@ import { DetailPlayVLivePage } from './DetailPlayVLivePage';
import { DateTimeUtils, Logger, ToastUtils } from 'wdKit/Index';
import { publishCommentModel } from 'wdComponent/src/main/ets/components/comment/model/PublishCommentModel';
import { PictureLoading } from '../widgets/vertical/PictureLoading';
import { TrackConstants, Tracking
Button, Tracking
PageBrowse } from 'wdTracking/Index';
import { TrackConstants, TrackingPageBrowse } from 'wdTracking/Index';
import { LiveDetailPageLogic } from '../viewModel/LiveDetailPageLogic';
const TAG = 'DetailPlayLiveCommon'
...
...
@@ -36,8 +36,7 @@ export struct DetailPlayLiveCommon {
@Provide liveStyle: number = -1
// 直播地址
@Provide playUrl: string = ''
// // 直播间背景图
// @Provide imgUrl: string = ''
// 全屏展示
@Provide pageShow: number = -1
// 关闭全屏
...
...
@@ -45,7 +44,6 @@ export struct DetailPlayLiveCommon {
// 返回功能
@Provide pageBackPress: number = -1
@Provide liveDetailPageLogic :LiveDetailPageLogic = new LiveDetailPageLogic
// 直播详情内容
@Provide contentDetailData: ContentDetailDTO = {} as ContentDetailDTO
...
...
@@ -106,20 +104,22 @@ export struct DetailPlayLiveCommon {
let m3u8uUrl = pullStreamAddressData.transCode[0].m3u8Url
detailData.liveInfo.vlive[0].liveUrl = m3u8uUrl
this.playUrl = m3u8uUrl
// console.log(TAG, ' GetPullAddressBean:', m3u8uUrl)
}
}
this.liveState = detailData.liveInfo?.liveState
this.contentDetailData = data[0]
this.liveDetailPageLogic.contentDetailData = this.contentDetailData
this.liveDetailPageLogic.liveLandscape = detailData?.liveInfo?.liveLandScape
this.liveDetailPageLogic.liveState = detailData.liveInfo?.liveState
this.liveDetailPageLogic.resolvingRoomBackgroundImgUrl()
this.liveDetailPageLogic.resolvingRoomImgSource()
this.liveDetailPageLogic.resolvingRoomVliveData(0)
this.publishCommentModel.targetId = String(detailData?.newsId || '')
this.publishCommentModel.targetRelId = String(detailData?.reLInfo?.relId || '')
...
...
@@ -131,13 +131,6 @@ export struct DetailPlayLiveCommon {
this.publishCommentModel.visitorComment = String(detailData?.visitorComment || '')
this.publishCommentModel.commentContent = ''
this.liveStyle = detailData.liveInfo?.liveStyle
//
// if (this.contentDetailData.liveInfo && this.contentDetailData.liveInfo.previewUrl &&
// this.contentDetailData.liveInfo.previewUrl.length > 0) {
// this.imgUrl = this.contentDetailData.liveInfo.previewUrl
// } else if (detailData.fullColumnImgUrls && detailData.fullColumnImgUrls.length > 0) {
// this.imgUrl = detailData.fullColumnImgUrls[0].url
// }
if (detailData.liveInfo.liveState == 'end') {
this.playUrl = detailData.liveInfo.vlive[0].replayUri
...
...
sight_harmony/features/wdDetailPlayLive/src/main/ets/pages/DetailPlayLivePage.ets
View file @
574e315
...
...
@@ -7,9 +7,10 @@ import mediaquery from '@ohos.mediaquery';
import { Logger, WindowModel } from 'wdKit/Index';
import { router, window } from '@kit.ArkUI';
import { WDAliPlayerController } from 'wdPlayer/Index';
import { LiveOperRowListView } from 'wdComponent';
import { Live
EmptyComponent, Live
OperRowListView } from 'wdComponent';
import { publishCommentModel } from 'wdComponent/src/main/ets/components/comment/model/PublishCommentModel';
import { TrackConstants, TrackingContent, TrackParamConvert } from 'wdTracking/Index';
import { LiveDetailPageLogic } from '../viewModel/LiveDetailPageLogic';
let TAG: string = 'DetailPlayLivePage';
...
...
@@ -39,6 +40,8 @@ export struct DetailPlayLivePage {
@State lastInputedLiveComment: LiveRoomItemBean = {} as LiveRoomItemBean // 上次输入的直播间消息
@State lastInputedChatComment: LiveRoomItemBean = {} as LiveRoomItemBean // 上次输入的大家聊消息
aboutToAppear(): void {
Logger.info(TAG, `wyj-aboutToAppear`)
...
...
@@ -69,6 +72,7 @@ export struct DetailPlayLivePage {
TopPlayComponent({ playerController: this.playerController })
.height(this.displayDirection == DisplayDirection.VERTICAL ? 211 : '100%')
TabComponent({
tabs: this.tabs,
changeToTab: this.changeToTab,
...
...
sight_harmony/features/wdDetailPlayLive/src/main/ets/pages/DetailPlayVLivePage.ets
View file @
574e315
...
...
@@ -35,8 +35,7 @@ export struct DetailPlayVLivePage {
@Consume @Watch('closeFullScreen') pageHide: number
@Consume contentId: string
@State swiperIndex: number = 1
@Consume liveDetailPageLogic :LiveDetailPageLogic
@Consume liveDetailPageLogic: LiveDetailPageLogic
aboutToAppear(): void {
this.openFullScreen()
...
...
@@ -62,7 +61,7 @@ export struct DetailPlayVLivePage {
build() {
Stack() {
Stack(
{ alignContent: Alignment.Top }
) {
// 直播背景图,模糊处理
Image(this.liveDetailPageLogic.imgUrl)
.height('100%')
...
...
@@ -79,13 +78,33 @@ export struct DetailPlayVLivePage {
LiveEmptyComponent({
emptyType: WDLiveViewDefaultType.WDViewDefaultType_NoLiveSuspend
})
.height('
60%'
)
.height('
30%').margin({top:this.topSafeHeight }
)
} else {
if (this.liveDetailPageLogic.showPad) {
// 有垫片
if(this.liveDetailPageLogic.padImageUri.length > 0){
// 配置了垫片资源
Image(this.liveDetailPageLogic.padImageUri).objectFit(ImageFit.Fill).width('100%').height('100%')
}else {
// 没有配置垫片资源
LiveEmptyComponent({
emptyType: WDLiveViewDefaultType.WDViewDefaultType_NoLiveSuspend
})
.height('30%').margin({top:this.topSafeHeight })
}
} else {
// 播放器
PlayerComponent({
playerController: this.playerController
})
}
}
// 直播详情 左右滑动业务数据
PlayerInfoComponent({
playerController: this.playerController,
swiperController: this.swiperController,
...
...
sight_harmony/features/wdDetailPlayLive/src/main/ets/viewModel/LiveDetailPageLogic.ets
View file @
574e315
import { ContentDetailDTO } from 'wdBean/Index'
const TAG = 'LiveDetailPageLogic'
/**
* 直播信息对象逻辑加工处理的工具类
*/
...
...
@@ -14,6 +14,10 @@ export class LiveDetailPageLogic {
// 预告片图片/视频url
imgUrl: string = ''
// 垫片资源
padImageUri:string = ''
// 垫片是否开启
showPad:boolean = false
/**
...
...
@@ -42,15 +46,42 @@ export class LiveDetailPageLogic {
/**
* 解析
背景
图片资源
* 解析
直播间的
图片资源
*/
resolvingRoom
BackgroundImgUrl
() {
resolvingRoom
ImgSource
() {
// 背景图资源
if (this.contentDetailData.liveInfo && this.contentDetailData.liveInfo.previewUrl &&
this.contentDetailData.liveInfo.previewUrl.length > 0) {
this.imgUrl = this.contentDetailData.liveInfo.previewUrl
} else if (this.contentDetailData.fullColumnImgUrls && this.contentDetailData.fullColumnImgUrls.length > 0) {
this.imgUrl = this.contentDetailData.fullColumnImgUrls[0].url
}
// 垫图资源
if (this.contentDetailData.liveInfo){
if(this.contentDetailData.liveInfo.padImageUri.length > 0){
this.padImageUri =this.contentDetailData.liveInfo.padImageUri
}
//this.padImageUri = 'https://uatjdcdnphoto.aikan.pdnews.cn/sjbj-20240515/image/display/cdb84fe86b1440d58f3fc585841b928d.jpg'
}
console.log(TAG, ' this.imgUrl===>', this.imgUrl)
}
/**
* 解析直播详情里面的 vlive资源
* @param index
*/
resolvingRoomVliveData(index:number){
// 只有直播中的才会有垫片
if(this.liveState === 'running'){
this.showPad = this.contentDetailData.liveInfo.vlive[index].showPad
}
}
}
\ No newline at end of file
...
...
sight_harmony/features/wdDetailPlayLive/src/main/ets/widgets/details/video/TopPlayComponet.ets
View file @
574e315
...
...
@@ -4,6 +4,8 @@ import { PlayerConstants, WDAliPlayerController, WDPlayerRenderLiveView } from '
import { PlayUIComponent } from './PlayUIComponent';
import { PictureLoading } from '../../vertical/PictureLoading';
import { TrackConstants } from 'wdTracking/Index';
import { LiveDetailPageLogic } from '../../../viewModel/LiveDetailPageLogic';
import { LiveEmptyComponent, WDLiveViewDefaultType } from 'wdComponent/Index';
const TAG: string = 'TopPlayComponent'
...
...
@@ -32,6 +34,7 @@ export struct TopPlayComponent {
@Provide playSourceState: number = 0
private playUrl: string = ""
private xComponentIsLoaded: boolean = false
@Consume liveDetailPageLogic: LiveDetailPageLogic
aboutToAppear(): void {
if (this.playerController) {
...
...
@@ -66,6 +69,15 @@ export struct TopPlayComponent {
* 更新直播播放数据
*/
updateData() {
// 检测垫片
if (this.liveDetailPageLogic.showPad){
this.isHideLoading = true
this.isWait = true
this.previewUrl = this.liveDetailPageLogic.imgUrl
return
}
// 检测直播等待状态的直播预告是否视频资源
if (this.contentDetailData.liveInfo && this.contentDetailData.liveInfo.previewType === 1
&& this.contentDetailData?.liveInfo?.liveState == 'wait'
...
...
@@ -140,7 +152,8 @@ export struct TopPlayComponent {
this.previewUrl = ''
}
}
// Logger.debug(TAG, `---0------>` + this.isWait + ' ->' + this.isHideLoading + ' ->' + this.isEnd+' -->'+this.isVideoSource)
Logger.debug(TAG,
`---0------>` + this.isWait + ' ->' + this.isHideLoading + ' ->' + this.isEnd + ' -->' + this.isVideoSource)
}
tryToPlay() {
...
...
@@ -163,6 +176,11 @@ export struct TopPlayComponent {
build() {
Stack() {
if (this.liveDetailPageLogic.showPad) {
} else {
// 视频资源播放
WDPlayerRenderLiveView({
playerController: this.playerController,
...
...
@@ -179,6 +197,8 @@ export struct TopPlayComponent {
.height('100%')
.width('100%')
.visibility(this.isWait ? Visibility.None : Visibility.Visible)
}
if (this.isVideoSource) {
...
...
@@ -187,10 +207,25 @@ export struct TopPlayComponent {
Image(this.previewUrl)
.objectFit(ImageFit.Cover)
.alt($r('app.media.live_room_image_fail'))
.visibility(this.isWait || this.isEnd ? Visibility.Visible : Visibility.None)
// .contrast(this.isEnd ? 0.4 : 1)
.visibility(this.isWait || this.isEnd ? Visibility.Visible :
Visibility.None)// .contrast(this.isEnd ? 0.4 : 1)
.blur(this.isEnd ? 20 : 0)
.width('100%')
if (this.liveDetailPageLogic.showPad) {
// 有垫片
if (this.liveDetailPageLogic.padImageUri.length > 0) {
// 配置了垫片资源
Image(this.liveDetailPageLogic.padImageUri).objectFit(ImageFit.Fill).width('100%').height('100%')
} else {
// 没有配置垫片资源
LiveEmptyComponent({
emptyType: WDLiveViewDefaultType.WDViewDefaultType_NoLiveSuspend
}).width('100%').height('100%')
}
}
}
// loading
...
...
sight_harmony/features/wdDetailPlayShortVideo/src/main/ets/view/OperationListView.ets
View file @
574e315
...
...
@@ -13,6 +13,7 @@ import { HttpUrlUtils } from 'wdNetwork/Index';
import { WDPlayerController } from 'wdPlayer/Index';
import { WDRouterPage, WDRouterRule } from 'wdRouter/Index';
import { SpConstants } from 'wdConstant/Index'
import { WDShare } from 'wdShare/Index';
export interface OperationItem {
icon: Resource;
...
...
@@ -282,7 +283,7 @@ export struct OperationListView {
.width(32)
.aspectRatio(1)
.onClick((event: ClickEvent) => {
ToastUtils.showToast('分享为公共方法,待开发', 1000);
WDShare.shareContent(this.contentDetailData)
})
Text(item.text)
.width('100%')// .margin({ top: 4, left: 6, right: 6 })// .backgroundColor(Color.Brown)
...
...
sight_harmony/features/wdShare/src/main/ets/WDShare.ets
View file @
574e315
...
...
@@ -22,7 +22,18 @@ export class WDShare {
}
static shareProgram(program: ContentDTO, pageName: string ="", pageId: string = "") {
//TODO: 处理分享弹框交互和 海报逻辑
WDShareBase.getInstance().share({
to: ShareType.System,
scene: ShareScene.System,
type: ShareContentType.Link,
obj: {
title: program.shareInfo.shareTitle,
desc: program.shareInfo.shareSummary,
link: program.shareInfo.shareUrl,
}
})
}
static shareSubject(subject: PageInfoDTO) {
...
...
@@ -32,21 +43,21 @@ export class WDShare {
//专题分享数据转换
static setTopicBeanToShareBean(shareBean: ShareInfoDTO, topicInfoBean: TopicInfo){
shareBean.
t
opicType = topicInfoBean.topicType+''
shareBean.
appCustomT
opicType = topicInfoBean.topicType+''
//21:文章专题,22:音频专题,23:直播专题,24:话题专题,25:早晚报专题,26:时间链
if(25 == topicInfoBean.topicType){
shareBean.showPosterType = 6
shareBean.topicPattern = topicInfoBean.topicPattern
shareBean.publishTime = topicInfoBean.topicDate
shareBean.appCustomShowPosterType = 6
shareBean.appCustomTopicPattern = topicInfoBean.topicPattern
shareBean.appCustomPublishTime = topicInfoBean.topicDate
if(topicInfoBean.frontLinkObject == null){
shareBean.
i
sFrontDaily = false
shareBean.
appCustomI
sFrontDaily = false
if(topicInfoBean.shareContentList != null && topicInfoBean.shareContentList.length>0){
shareBean.sharePosterItemList = [] as SharePosterItemBean[]
shareBean.sharePosterItemList.length = topicInfoBean.shareContentList.length
shareBean.appCustomSharePosterItemList = [] as SharePosterItemBean[]
shareBean.appCustomSharePosterItemList.length = topicInfoBean.shareContentList.length
for (let index = 0; index < topicInfoBean.shareContentList.length; index++) {
let element = topicInfoBean.shareContentList[index]
if(element != null){
shareBean.
s
harePosterItemList[index] = {
shareBean.
appCustomS
harePosterItemList[index] = {
title:topicInfoBean.shareContentList[index].newsTitle,
imageUrl:topicInfoBean.shareContentList[index].coverUrl,
} as SharePosterItemBean
...
...
@@ -54,25 +65,25 @@ export class WDShare {
}
}
}else{
shareBean.
i
sFrontDaily = true
shareBean.
appCustomI
sFrontDaily = true
shareBean.sharePosterCoverUrl = topicInfoBean.frontLinkObject.coverUrl
shareBean.
p
osterSummary = topicInfoBean.frontLinkObject.summary
shareBean.
appCustomP
osterSummary = topicInfoBean.frontLinkObject.summary
}
}else{
//文章/直播/话题专题(H5普通文章专题,包含时间链)
shareBean.
s
howPosterType = 8
shareBean.
appCustomS
howPosterType = 8
//海报的头图
shareBean.sharePosterCoverUrl = topicInfoBean.backgroundImgUrl
shareBean.isFrontDaily = false
shareBean.posterTitle = topicInfoBean.title
shareBean.posterSummary = topicInfoBean.summary
shareBean.appCustomIsFrontDaily = false
shareBean.appCustomPosterTitle = topicInfoBean.title
shareBean.appCustomPosterSummary = topicInfoBean.summary
if(topicInfoBean.shareContentList != null && topicInfoBean.shareContentList.length>0){
shareBean.sharePosterItemList = [] as SharePosterItemBean[]
shareBean.sharePosterItemList.length = topicInfoBean.shareContentList.length
shareBean.appCustomSharePosterItemList = [] as SharePosterItemBean[]
shareBean.appCustomSharePosterItemList.length = topicInfoBean.shareContentList.length
for (let index = 0; index < topicInfoBean.shareContentList.length; index++) {
let element = topicInfoBean.shareContentList[index]
if(element != null){
shareBean.
s
harePosterItemList[index] = {
shareBean.
appCustomS
harePosterItemList[index] = {
title:topicInfoBean.shareContentList[index].newsTitle,
imageUrl:topicInfoBean.shareContentList[index].coverUrl,
timeNode:topicInfoBean.shareContentList[index].publishTime,
...
...
sight_harmony/products/phone/src/main/ets/pages/launchPage/LaunchAdvertisingPage.ets
View file @
574e315
...
...
@@ -138,10 +138,12 @@ struct LaunchAdvertisingPage {
})
}
if(this.defaultModel.screenType === '1') {
Column(){
Image($r('app.media.LaunchPage_logo'))
.width('278lpx')
.height('154lpx')
.margin({top: '28lpx',bottom:'28lpx'})
.margin({top:20})
}.width('100%').height('16%').backgroundColor(Color.White).expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM])
}
}
.width('100%')
...
...
Please
register
or
login
to post a comment