zhenghy

Merge branch 'main' of http://192.168.1.42/developOne/harmonyPool

# Conflicts:
#	sight_harmony/commons/wdNetwork/src/main/ets/http/HttpUrlUtils.ets
... ... @@ -5,13 +5,13 @@
"name": "default",
"type": "HarmonyOS",
"material": {
"certpath": "/Users/jrl/.ohos/config/auto_debug_sight_harmony_com.wondertek.sight_2850086000431478878.cer",
"storePassword": "0000001B1B59DAB22B389A8BCD25A2C43C89DE581FD6AC3EEE1D3FC227D46727A7763AAE553A50B5E81310",
"certpath": "C:\\Users\\pc\\.ohos\\config\\default_sight_harmony_l75MehGV9G3TUayEtL68-EIWqyYDqfVXfu9D-DPJ7I0=.cer",
"storePassword": "0000001AB256FAF47AA4D68E4841C95D357490DE9FBB26A3A9161AD3069E31B3623E25CB49409CCA9CF7",
"keyAlias": "debugKey",
"keyPassword": "0000001B2B0EDD642E43906A1B9A6B72A79F40316E908829B79DD96467FE5C3A8D1DF9E40957DA733DF77F",
"profile": "/Users/jrl/.ohos/config/auto_debug_sight_harmony_com.wondertek.sight_2850086000431478878.p7b",
"keyPassword": "0000001AFB06818C2BC8DC275326668AAC62B91EBF7D3F84E8BE0F156D02623AA0F4F8C6B73F362CB371",
"profile": "C:\\Users\\pc\\.ohos\\config\\default_sight_harmony_l75MehGV9G3TUayEtL68-EIWqyYDqfVXfu9D-DPJ7I0=.p7b",
"signAlg": "SHA256withECDSA",
"storeFile": "/Users/jrl/.ohos/config/auto_debug_sight_harmony_com.wondertek.sight_2850086000431478878.p12"
"storeFile": "C:\\Users\\pc\\.ohos\\config\\default_sight_harmony_l75MehGV9G3TUayEtL68-EIWqyYDqfVXfu9D-DPJ7I0=.p12"
}
}
],
... ...
... ... @@ -144,10 +144,12 @@ export class HttpUrlUtils {
* 个人中心 我的关注列表
*/
static readonly OTHER_USER_FOLLOW_LIST_DATA_PATH: string = "/api/rmrb-interact/interact/zh/c/userAttention/list";
/**
* 预约操作
*/
static readonly APPOINTMENT_OPERATION_STATUS_PATH: string = "/api/live-center-message/zh/c/live/subscribe";
/**
* 点赞操作
*/
... ... @@ -167,7 +169,11 @@ export class HttpUrlUtils {
* */
static readonly MORNING_EVENING_PAGE_INFO_PATH: string = "/api/rmrb-bff-display-zh/display/zh/c/pageInfo";
static readonly MORNING_EVENING_COMP_INFO_PATH: string = "/api/rmrb-bff-display-zh/display/zh/c/compInfo";
private static hostUrl: string = HttpUrlUtils.HOST_UAT;
private static _hostUrl: string = HttpUrlUtils.HOST_PRODUCT;
public static set hostUrl(value: string) {
HttpUrlUtils._hostUrl = value;
}
private static userId = ''
private static userType = ''
private static token = ''
... ... @@ -183,8 +189,8 @@ export class HttpUrlUtils {
headers.set('timestamp', HttpUrlUtils.getTimestamp())
headers.set('RMRB-X-TOKEN', HttpUrlUtils.getXToken())
headers.set('device_id', HttpUrlUtils.getDeviceId())
if (HttpUrlUtils.getXToken() != '') {
headers.set('cookie', 'RMRB-X-TOKEN=' + HttpUrlUtils.getXToken())
if(HttpUrlUtils.getXToken()!=''){
headers.set('cookie', 'RMRB-X-TOKEN='+HttpUrlUtils.getXToken())
}
headers.set('build_version', HttpUrlUtils.getVersion())
headers.set('adcode', HttpUrlUtils.getAdCode())
... ... @@ -213,7 +219,7 @@ export class HttpUrlUtils {
}
static addSpecialHeaders(headers: HashMap<string, string>) {
switch (HttpUrlUtils.hostUrl) {
switch (HttpUrlUtils._hostUrl) {
case HttpUrlUtils.HOST_UAT:
// TODO 待优化到常量类里
headers.set('X-Ca-Stage', 'PRE');
... ... @@ -241,7 +247,7 @@ export class HttpUrlUtils {
}
static getHost() {
return HttpUrlUtils.hostUrl;
return HttpUrlUtils._hostUrl;
}
private static getCity() {
... ... @@ -265,20 +271,20 @@ export class HttpUrlUtils {
}
private static getXToken() {
if (StringUtils.isNotEmpty(HttpUrlUtils.token)) {
if(StringUtils.isNotEmpty(HttpUrlUtils.token)){
return HttpUrlUtils.token
}
HttpUrlUtils.token = SPHelper.default.getSync(SpConstants.USER_JWT_TOKEN, "") as string
if (StringUtils.isNotEmpty(HttpUrlUtils.token)) {
return HttpUrlUtils.token
HttpUrlUtils.token = SPHelper.default.getSync(SpConstants.USER_JWT_TOKEN,"") as string
if(StringUtils.isNotEmpty(HttpUrlUtils.token)) {
return HttpUrlUtils.token
}
return 'eyJhbGciOiJIUzI1NiIsImtpZCI6ImQ4WkI2QkhxSEZrdjJ2U25BNlRwZEdKRjBHcjItVzBvS2FaYzdLOUUycmcifQ.eyJpc3MiOiJwZW9wbGVzLWRhaWx5LWZvdXJhIiwic3ViIjoicGVvcGxlcy1kYWlseS1mb3VyYSIsImV4cCI6MTcwMzY0OTYwNiwidXNlcklkIjo0NTk3NzYyOTc0NzQ5NDksInVzZXJWZXJzaW9uIjoiNDU5Nzc2Mjk3NDc0OTQ5XzIiLCJ1c2VyTmFtZSI6IkJ1bGlraWtpMTgxIiwidXNlclR5cGUiOjIsImNyZWF0b3JJZCI6NDI2NTM5MH0.jhQ9kylcm3FxWf0-lBMZuLkdtIQ6XpFnAi0AFZJNwfc';
}
static getRefreshToken() {
let refreshToken = SPHelper.default.getSync(SpConstants.USER_REFRESH_TOKEN, "")
if (StringUtils.isNotEmpty(refreshToken)) {
return refreshToken as string;
static getRefreshToken() {
let refreshToken = SPHelper.default.getSync(SpConstants.USER_REFRESH_TOKEN,"")
if(StringUtils.isNotEmpty(refreshToken)) {
return refreshToken as string;
}
return '';
}
... ... @@ -341,55 +347,55 @@ export class HttpUrlUtils {
public static getUserId() {
// TODO 对接登录
if (StringUtils.isNotEmpty(HttpUrlUtils.userId)) {
if(StringUtils.isNotEmpty(HttpUrlUtils.userId)){
return HttpUrlUtils.userId
}
HttpUrlUtils.userId = SPHelper.default.getSync(SpConstants.USER_ID, "") as string
HttpUrlUtils.userId = SPHelper.default.getSync(SpConstants.USER_ID,"") as string
return HttpUrlUtils.userId;
}
public static getUserType() {
if (StringUtils.isNotEmpty(HttpUrlUtils.userType)) {
public static getUserType() {
if(StringUtils.isNotEmpty(HttpUrlUtils.userType)){
return HttpUrlUtils.userType
}
HttpUrlUtils.userType = SPHelper.default.getSync(SpConstants.USER_Type, "") as string
HttpUrlUtils.userType = SPHelper.default.getSync(SpConstants.USER_Type,"") as string
return HttpUrlUtils.userType;
}
static getVerifyCodeUrl() {
let url = HttpUrlUtils.hostUrl + "/api/rmrb-user-center/auth/zh/c/sendVerifyCode";
let url = HttpUrlUtils._hostUrl + "/api/rmrb-user-center/auth/zh/c/sendVerifyCode";
return url;
}
static getVerifyCodeByTokenUrl() {
let url = HttpUrlUtils.hostUrl + "/api/rmrb-user-center/auth/zh/c/sendVerifyCodeByToken";
let url = HttpUrlUtils._hostUrl + "/api/rmrb-user-center/auth/zh/c/sendVerifyCodeByToken";
return url;
}
static getForgetPasswordUrl() {
let url = HttpUrlUtils.hostUrl + "/api/rmrb-user-center/user/zh/c/forgotPassword";
let url = HttpUrlUtils._hostUrl + "/api/rmrb-user-center/user/zh/c/forgotPassword";
return url;
}
static getLogoutUrl() {
let url = HttpUrlUtils.hostUrl + "/api/rmrb-user-center/user/zh/c/logout";
let url = HttpUrlUtils._hostUrl + "/api/rmrb-user-center/user/zh/c/logout";
return url;
}
static getResetPassworddUrl() {
let url = HttpUrlUtils.hostUrl + "/api/rmrb-user-center/user/zh/c/resetPassword";
let url = HttpUrlUtils._hostUrl + "/api/rmrb-user-center/user/zh/c/resetPassword";
return url;
}
static queryUserDetail() {
let url = HttpUrlUtils.hostUrl + "/api/rmrb-user-center/user/zh/c/queryUserDetail";
let url = HttpUrlUtils._hostUrl + "/api/rmrb-user-center/user/zh/c/queryUserDetail";
return url;
}
static editUserDetail() {
let url = HttpUrlUtils.hostUrl + "/api/rmrb-user-center/user/zh/c/editUserDetail";
let url = HttpUrlUtils._hostUrl + "/api/rmrb-user-center/user/zh/c/editUserDetail";
return url;
}
... ... @@ -399,17 +405,17 @@ export class HttpUrlUtils {
}
static getCheckVerifyCodeUrl() {
let url = HttpUrlUtils.hostUrl + "/api/rmrb-user-center/auth/zh/c/checkVerifyCode";
let url = HttpUrlUtils._hostUrl + "/api/rmrb-user-center/auth/zh/c/checkVerifyCode";
return url;
}
static getCheckVerifyByTokenCodeUrl() {
let url = HttpUrlUtils.hostUrl + "/api/rmrb-user-center/auth/zh/c/checkVerifyCodeByToken";
let url = HttpUrlUtils._hostUrl + "/api/rmrb-user-center/auth/zh/c/checkVerifyCodeByToken";
return url;
}
static getAppointmentListDataUrl() {
let url = HttpUrlUtils.hostUrl + HttpUrlUtils.APPOINTMENT_LIST_DATA_PATH
let url = HttpUrlUtils._hostUrl + HttpUrlUtils.APPOINTMENT_LIST_DATA_PATH
return url
}
... ... @@ -419,77 +425,77 @@ export class HttpUrlUtils {
}
static getFollowListDetailDataUrl() {
let url = HttpUrlUtils.hostUrl + HttpUrlUtils.FOLLOW_LIST_DETAIL_DATA_PATH
let url = HttpUrlUtils._hostUrl + HttpUrlUtils.FOLLOW_LIST_DETAIL_DATA_PATH
return url
}
static getFollowListDataUrl() {
let url = HttpUrlUtils.hostUrl + HttpUrlUtils.FOLLOW_LIST_DATA_PATH
let url = HttpUrlUtils._hostUrl + HttpUrlUtils.FOLLOW_LIST_DATA_PATH
return url
}
static getMineFollowListDataUrl() {
let url = HttpUrlUtils.hostUrl + HttpUrlUtils.MINE_FOLLOW_LIST_DATA_PATH
let url = HttpUrlUtils._hostUrl + HttpUrlUtils.MINE_FOLLOW_LIST_DATA_PATH
return url
}
static getFollowListStatusDataUrl() {
let url = HttpUrlUtils.hostUrl + HttpUrlUtils.FOLLOW_LIST_STATUS_DATA_PATH
let url = HttpUrlUtils._hostUrl + HttpUrlUtils.FOLLOW_LIST_STATUS_DATA_PATH
return url
}
static getCommentListStatusDataUrl() {
let url = HttpUrlUtils.hostUrl + HttpUrlUtils.COMMENT_LIST_STATUS_DATA_PATH
let url = HttpUrlUtils._hostUrl + HttpUrlUtils.COMMENT_LIST_STATUS_DATA_PATH
return url
}
static getMineCommentListDataUrl() {
let url = HttpUrlUtils.hostUrl + HttpUrlUtils.MINE_COMMENT_LIST_DATA_PATH
let url = HttpUrlUtils._hostUrl + HttpUrlUtils.MINE_COMMENT_LIST_DATA_PATH
return url
}
static getMineUserLevelDataUrl() {
let url = HttpUrlUtils.hostUrl + HttpUrlUtils.MINE_USER_LEVEL_DATA_PATH
let url = HttpUrlUtils._hostUrl + HttpUrlUtils.MINE_USER_LEVEL_DATA_PATH
return url
}
static getOtherUserLevelDataUrl() {
let url = HttpUrlUtils.hostUrl + HttpUrlUtils.OTHER_USER_LEVEL_DATA_PATH
let url = HttpUrlUtils._hostUrl + HttpUrlUtils.OTHER_USER_LEVEL_DATA_PATH
return url
}
static getMineUserDetailDataUrl() {
let url = HttpUrlUtils.hostUrl + HttpUrlUtils.MINE_USER_DETAIL_DATA_PATH
let url = HttpUrlUtils._hostUrl + HttpUrlUtils.MINE_USER_DETAIL_DATA_PATH
return url
}
static getOtherUserDetailDataUrl() {
let url = HttpUrlUtils.hostUrl + HttpUrlUtils.OTHER_USER_DETAIL_DATA_PATH
let url = HttpUrlUtils._hostUrl + HttpUrlUtils.OTHER_USER_DETAIL_DATA_PATH
return url
}
static getOtherCommentListDataUrl() {
let url = HttpUrlUtils.hostUrl + HttpUrlUtils.OTHER_COMMENT_LIST_DATA_PATH
let url = HttpUrlUtils._hostUrl + HttpUrlUtils.OTHER_COMMENT_LIST_DATA_PATH
return url
}
static getOtherUserFollowListDataUrl() {
let url = HttpUrlUtils.hostUrl + HttpUrlUtils.OTHER_USER_FOLLOW_LIST_DATA_PATH
let url = HttpUrlUtils._hostUrl + HttpUrlUtils.OTHER_USER_FOLLOW_LIST_DATA_PATH
return url
}
static getAppointmentOperationUrl() {
let url = HttpUrlUtils.hostUrl + HttpUrlUtils.APPOINTMENT_OPERATION_STATUS_PATH
let url = HttpUrlUtils._hostUrl + HttpUrlUtils.APPOINTMENT_OPERATION_STATUS_PATH
return url
}
static getCommentLikeOperationUrl() {
let url = HttpUrlUtils.hostUrl + HttpUrlUtils.COMMENT_LIKE_OPERATION_PATH
let url = HttpUrlUtils._hostUrl + HttpUrlUtils.COMMENT_LIKE_OPERATION_PATH
return url
}
static getFollowOperationUrl() {
let url = HttpUrlUtils.hostUrl + HttpUrlUtils.FOLLOW_OPERATION_PATH
let url = HttpUrlUtils._hostUrl + HttpUrlUtils.FOLLOW_OPERATION_PATH
return url
}
... ...
... ... @@ -53,3 +53,5 @@ export { HeadPictureCardComponent } from "./src/main/ets/components/view/HeadPic
export { ZhGridLayoutComponent } from "./src/main/ets/components/view/ZhGridLayoutComponent"
export { MultiPictureDetailPageComponent } from "./src/main/ets/components/MultiPictureDetailPageComponent"
export { AudioDetailComponent } from "./src/main/ets/components/AudioDetailComponent"
... ...
import { Logger } from 'wdKit';
import { MultiPictureDetailViewModel } from '../viewmodel/MultiPictureDetailViewModel';
import { ContentDetailDTO, PhotoListBean } from 'wdBean';
import media from '@ohos.multimedia.media';
import { OperRowListView } from './view/OperRowListView';
const TAG = 'AudioDetailComponent'
@Component
export struct AudioDetailComponent {
private relId: string = ''
private contentId: string = ''
private relType: string = ''
// private avPlayer:media.AVPlayer
@State contentDetailData: ContentDetailDTO[] = [] as ContentDetailDTO[]
@State iocClock: string = '定时';
@State iconTheOriginal: string = '原文';
@State iconList: string = '列表';
@State text: string = ''
@State coverImage:string = 'app.media.audio'
@State newsTitle:string = '夜读'
@State palyIcon:string = "app.media.playicon"
@State showList: boolean = false
@State outSetValueOne:number = 40
//
// @State @Watch('onIsPlayChanged')isPlay: boolean = false
// onIsPlayChanged(){
// if(this.isPlay){
// this.avPlayer.play()
// this.palyIcon = "app.media.suspend"
// }else{
// this.avPlayer.pause()
// this.palyIcon = "app.media.playicon"
// }
// }
//
async aboutToAppear() {
this.getContentDetailData()
// // 创建avPlayer实例对象
// this.avPlayer = await media.createAVPlayer()
// // 创建状态机变化回调函数
// this.setAVPlayerCallback()
}
//
// // 注册avplayer回调函数
// setAVPlayerCallback() {
// // seek操作结果回调函数
// this.avPlayer.on('seekDone', (seekDoneTime) => {
// console.info(`AVPlayer seek succeeded, seek time is ${seekDoneTime}`);
// })
// // error回调监听函数,当avPlayer在操作过程中出现错误时调用reset接口触发重置流程
// this.avPlayer.on('error', (err) => {
// console.error(`Invoke avPlayer failed, code is ${err.code}, message is ${err.message}`);
// this.avPlayer.reset(); // 调用reset重置资源,触发idle状态
// })
// // 状态机变化回调函数
// this.avPlayer.on('stateChange', async (state, reason) => {
// switch (state) {
// case 'idle': // 成功调用reset接口后触发该状态机上报
// console.info('AVPlayer state idle called.');
// this.avPlayer.release(); // 调用release接口销毁实例对象
// this.isPlay = false
// break;
// case 'initialized': // avplayer 设置播放源后触发该状态上报
// console.info('AVPlayerstate initialized called.');
// this.avPlayer.prepare().then(() => {
// console.info('AVPlayer prepare succeeded.');
// })
// this.isPlay = false
// break;
// case 'prepared': // prepare调用成功后上报该状态机
// console.info('AVPlayer state prepared called.');
// this.isPlay = false
// this.avPlayer.play(); // 调用播放接口开始播放
// break;
// case 'playing': // play成功调用后触发该状态机上报
// console.info('AVPlayer state playing called.');
// this.isPlay = true
// break;
// case 'paused': // pause成功调用后触发该状态机上报
// console.info('AVPlayer state paused called.');
// this.avPlayer.play(); // 再次播放接口开始播放
// this.isPlay = false
// break;
// case 'completed': // 播放结束后触发该状态机上报
// console.info('AVPlayer state completed called.');
// this.avPlayer.stop(); //调用播放结束接口
// break;
// case 'stopped': // stop接口成功调用后触发该状态机上报
// console.info('AVPlayer state stopped called.');
// this.avPlayer.reset(); // 调用reset接口初始化avplayer状态
// this.isPlay = false
// break;
// case 'released':
// console.info('AVPlayer state released called.');
// break;
// default:
// console.info('AVPlayer state unknown called.');
// break;
// }
// })
// }
// gotoPlay(){
// this.avPlayer.url = this.contentDetailData[0].audioList[0].audioUrl
// }
build() {
Row() {
Column() {
// 封面
Row() {
Image($r('app.media.audio'))
.width(240)
.height(160)
.borderRadius('0')
}
.justifyContent(FlexAlign.Center)
.width('100%')
.margin({ top: 64 })
// 标题
Row() {
Text(this.newsTitle)
.fontSize(20)
.fontWeight(FontWeight.Bold)
.fontColor('#ffffff')
.textAlign(TextAlign.Center)
.lineHeight(28)
.fontFamily('PingFang SC, PingFang SC')
}
.padding({ left: 34, right: 34 })
.margin({ top: 32 })
// 操作矩阵
Row() {
// 定时
Column() {
Image($r('app.media.clock'))
.width(28)
.height(28)
Text(this.iocClock)
.fontColor('#fff')
.fontSize(12)
.lineHeight(16)
.margin(2)
}
// 原文
Column() {
Image($r('app.media.theOriginal'))
.width(28)
.height(28)
Text(this.iconTheOriginal)
.fontColor('#fff')
.fontSize(12)
.lineHeight(16)
.margin(2)
}
// 列表
Column() {
Image($r('app.media.list'))
.width(28)
.height(28)
Text(this.iconList)
.fontColor('#fff')
.fontSize(12)
.lineHeight(16)
.margin(2)
}
.onClick(() => {
this.showList = !this.showList
Logger.info(TAG,'这里')
console.log('列表', this.showList)
})
}
.width('100%')
.padding({ left: 49, right: 49 })
.justifyContent(FlexAlign.SpaceBetween)
.margin({ top: 60 })
Column(){
// 进度条
Row(){
Slider({
value: this.outSetValueOne,
min: 0,
max: 100,
style: SliderStyle.OutSet
})
.trackColor('rgba(0,0,0,0.5)')
.selectedColor('#ED2800')
.showTips(true)
.onChange((value: number, mode: SliderChangeMode) => {
this.outSetValueOne = value
console.info('value:' + value + 'mode:' + mode.toString())
})
}
.width('100%')
.padding({left:24,right:24})
.margin({top:110})
// 播放按钮
Row(){
Image($r('app.media.loop'))
.width(24)
.height(24)
Image($r('app.media.Backward'))
.width(24)
.height(24)
Stack(){
Image($r('app.media.playicon'))
.width(32)
.height(32)
}
.backgroundColor('rgba(255,255,255,0.1)')
.width(60)
.height(60)
.borderRadius(50)
.alignContent(Alignment.Center)
.onClick(()=>{
// this.gotoPlay()
console.log('播放')
this.getContentDetailData()
})
Image($r('app.media.fastForward'))
.width(24)
.height(24)
Image($r('app.media.doubleSpeed'))
.width(24)
.height(24)
}
.width('100%')
.justifyContent(FlexAlign.SpaceBetween)
.margin({top:56})
.padding({left:32,right:32})
}
// OperRowListView()
}
}
}
private async getContentDetailData() {
try {
let data = await MultiPictureDetailViewModel.getDetailData(this.relId, this.contentId, this.relType)
this.contentDetailData = data;
this.coverImage = this.contentDetailData[0].audioList[0].fullColumnImgUrls[0].url
this.newsTitle = this.contentDetailData[0].newsTitle
Logger.info(TAG, `contentDetailData:${JSON.stringify(this.contentDetailData)}`)
console.log(JSON.stringify(this.contentDetailData))
console.log(this.newsTitle)
console.log(this.coverImage)
} catch (exception) {
}
}
}
\ No newline at end of file
... ...
... ... @@ -229,6 +229,7 @@ export struct MorningEveningPaperComponent {
// console.info(TAG, `onClick listen_right_bg`);
})
}
.margin({ left: 12, right: 12 })
// .width('100%')
.height(56)
.alignItems(VerticalAlign.Center)
... ...
... ... @@ -33,17 +33,20 @@ export struct topicInfoView {
Row() {
Text("查看详情")
.fontSize(16)
.fontSize(14)
.fontColor($r('app.color.white'))
.maxLines(1)
.backgroundColor($r('app.color.color_99636363'))
.borderRadius(2)
.padding({ left: 6, top: 4, bottom: 4 })
Image($r('app.media.more'))
.height($r('app.float.top_arrow_size'))
.width(20)
Image($r('app.media.more'))// .height($r('app.float.top_arrow_size'))
.width(12)
.height(12)
.margin({ left: 4, right: 7 })
}
.margin({ top: 10, left: 16, right: 16 })
.backgroundColor($r('app.color.color_99636363'))
.margin({ top: 8, left: 16, right: 16, bottom: 16 })
.borderRadius(2)
// .backgroundColor(Color.Red)
.alignRules({
left: { anchor: "__container__", align: HorizontalAlign.Start },
... ... @@ -61,6 +64,7 @@ export struct topicInfoView {
left: { anchor: "__container__", align: HorizontalAlign.Start },
bottom: { anchor: "row_detail", align: VerticalAlign.Top }
})
.margin({ left: 16, right: 16 })
.id('txt_summary')
Text(this.frontLinkObject?.title ?? "")
... ... @@ -71,6 +75,7 @@ export struct topicInfoView {
left: { anchor: "__container__", align: HorizontalAlign.Start },
bottom: { anchor: "txt_summary", align: VerticalAlign.Top }
})
.margin({ left: 16, right: 16, bottom: 8 })
.id('txt_title')
}
.width("100%")
... ...
... ... @@ -23,6 +23,7 @@ export struct MultiPictureDetailItemComponent {
.width('100%')
.aspectRatio(this.MultiPictureDetailItem.width / this.MultiPictureDetailItem.height)
.objectFit(ImageFit.Fill)
.interpolation(ImageInterpolation.High)
}
.height('100%')
.width('100%')
... ...
... ... @@ -13,15 +13,14 @@ const LOCAL_CHANNEL: string = '地方频道'
struct ChannelDialog {
@State indexSettingTabIndex: number = 1
@State isEditIng: boolean = false
@Link currentTopNavSelectedIndex : number
@Link myChannelList: Array<TopNavDTO>
@Link moreChannelList: Array<TopNavDTO>
@Link localChannelList: Array<TopNavDTO>
@Link indexSettingArray: Array<string>
@Link topNavList: Array<TopNavDTO>
@Link currentTopNavSelectedIndex: number
@Link myChannelList: TopNavDTO[]
@Link moreChannelList: TopNavDTO[]
@Link localChannelList: TopNavDTO[]
@Link indexSettingArray: string[]
controller?: CustomDialogController
myChannelItemEditHandle = (index: number): void => {
let item = this.myChannelList.splice(index, 1)[0]
console.info(`itemitemitem${JSON.stringify(item)}`)
if (item.moreChannel === '1') {
this.moreChannelList.unshift(item)
}
... ... @@ -29,7 +28,6 @@ struct ChannelDialog {
this.localChannelList.unshift(item)
}
}
controller?: CustomDialogController
build() {
Column() {
... ... @@ -108,7 +106,7 @@ struct ChannelDialog {
Row() {
Text(item.name)
.fontSize(14)
.fontColor( this.currentTopNavSelectedIndex === index ? '#ED2800' : (item.homeChannel === '1' ? '#999999' : '#222222'))
.fontColor(this.currentTopNavSelectedIndex === index ? '#ED2800' : (item.homeChannel === '1' ? '#999999' : '#222222'))
if (this.isEditIng && item.myChannel !== '1') {
Image($r('app.media.icon_audio_close'))
... ... @@ -122,10 +120,11 @@ struct ChannelDialog {
.backgroundColor(item.homeChannel === '1' ? '#F5F5F5' : '')
.onClick(() => {
if (this.isEditIng) {
if(item.myChannel !== '1'){
if (item.myChannel !== '1') {
this.myChannelItemEditHandle(index)
}
}else{
} else {
this.currentTopNavSelectedIndex = index
this.controller?.close()
}
})
... ... @@ -234,306 +233,35 @@ struct ChannelDialog {
.padding(16)
.backgroundColor('#ffffff')
}
onTopNavigationDataUpdated() {
}
}
@Entry
@Component
struct ChannelSubscriptionLayout {
@State indexSettingArray: string [] = ['推荐', '热点']
//当前选中的频道
@Prop currentTopNavSelectedIndex?: number;
@Link currentTopNavSelectedIndex: number;
@Link myChannelList: TopNavDTO []
@Link moreChannelList: TopNavDTO []
@Link localChannelList: TopNavDTO []
@State indexSettingArray: Array<string> = ['推荐', '热点']
@State myChannelList: Array<TopNavDTO> = [
// {
// channelId: 0,
// channelStyle: 1,
// channelType: 1,
// defaultPermitted: 1,
// delPermitted: 1,
// fontCColor: '#000000',
// fontColor: '#000000',
// headlinesOn: 0,
// homeChannel: '1',
// iconCUrl: '',
// iconCUrlSize: '',
// iconUrl: '',
// iconUrlSize: '',
// localChannel: '',
// moreChannel: '',
// movePermitted: 0,
// myChannel: '1',
// name: '推荐',
// num: 0,
// pageId: 21212,
// pageType: '',
// underlineCColor: ''
// },
// {
// channelId: 1,
// channelStyle: 1,
// channelType: 1,
// defaultPermitted: 1,
// delPermitted: 1,
// fontCColor: '#000000',
// fontColor: '#000000',
// headlinesOn: 0,
// homeChannel: '1',
// iconCUrl: '',
// iconCUrlSize: '',
// iconUrl: '',
// iconUrlSize: '',
// localChannel: '',
// moreChannel: '',
// movePermitted: 0,
// myChannel: '1',
// name: '热点',
// num: 0,
// pageId: 21212,
// pageType: '',
// underlineCColor: ''
// },
// {
// channelId: 2,
// channelStyle: 1,
// channelType: 1,
// defaultPermitted: 1,
// delPermitted: 1,
// fontCColor: '#000000',
// fontColor: '#000000',
// headlinesOn: 0,
// homeChannel: '',
// iconCUrl: '',
// iconCUrlSize: '',
// iconUrl: '',
// iconUrlSize: '',
// localChannel: '',
// moreChannel: '',
// movePermitted: 0,
// myChannel: '1',
// name: '视频',
// num: 0,
// pageId: 21212,
// pageType: '',
// underlineCColor: ''
// },
// {
// channelId: 3,
// channelStyle: 1,
// channelType: 1,
// defaultPermitted: 1,
// delPermitted: 1,
// fontCColor: '#000000',
// fontColor: '#000000',
// headlinesOn: 0,
// homeChannel: '',
// iconCUrl: '',
// iconCUrlSize: '',
// iconUrl: '',
// iconUrlSize: '',
// localChannel: '',
// moreChannel: '',
// movePermitted: 0,
// myChannel: '1',
// name: '云课堂',
// num: 0,
// pageId: 21212,
// pageType: '',
// underlineCColor: ''
// },
]
@State moreChannelList: Array<TopNavDTO> = [
// {
// channelId: 4,
// channelStyle: 1,
// channelType: 1,
// defaultPermitted: 1,
// delPermitted: 1,
// fontCColor: '#000000',
// fontColor: '#000000',
// headlinesOn: 0,
// homeChannel: '',
// iconCUrl: '',
// iconCUrlSize: '',
// iconUrl: '',
// iconUrlSize: '',
// localChannel: '',
// moreChannel: '1',
// movePermitted: 0,
// myChannel: '',
// name: '房产',
// num: 0,
// pageId: 21212,
// pageType: '',
// underlineCColor: ''
// },
// {
// channelId: 5,
// channelStyle: 1,
// channelType: 1,
// defaultPermitted: 1,
// delPermitted: 1,
// fontCColor: '#000000',
// fontColor: '#000000',
// headlinesOn: 0,
// homeChannel: '',
// iconCUrl: '',
// iconCUrlSize: '',
// iconUrl: '',
// iconUrlSize: '',
// localChannel: '',
// moreChannel: '1',
// movePermitted: 0,
// myChannel: '',
// name: '生态',
// num: 0,
// pageId: 21212,
// pageType: '',
// underlineCColor: ''
// },
// {
// channelId: 6,
// channelStyle: 1,
// channelType: 1,
// defaultPermitted: 1,
// delPermitted: 1,
// fontCColor: '#000000',
// fontColor: '#000000',
// headlinesOn: 0,
// homeChannel: '',
// iconCUrl: '',
// iconCUrlSize: '',
// iconUrl: '',
// iconUrlSize: '',
// localChannel: '',
// moreChannel: '1',
// movePermitted: 0,
// myChannel: '',
// name: '健康',
// num: 0,
// pageId: 21212,
// pageType: '',
// underlineCColor: ''
// }
]
@State localChannelList: Array<TopNavDTO> = [
// {
// channelId: 7,
// channelStyle: 1,
// channelType: 1,
// defaultPermitted: 1,
// delPermitted: 1,
// fontCColor: '#000000',
// fontColor: '#000000',
// headlinesOn: 0,
// homeChannel: '',
// iconCUrl: '',
// iconCUrlSize: '',
// iconUrl: '',
// iconUrlSize: '',
// localChannel: '1',
// moreChannel: '',
// movePermitted: 0,
// myChannel: '',
// name: '北京',
// num: 0,
// pageId: 21212,
// pageType: '',
// underlineCColor: ''
// },
// {
// channelId: 8,
// channelStyle: 1,
// channelType: 1,
// defaultPermitted: 1,
// delPermitted: 1,
// fontCColor: '#000000',
// fontColor: '#000000',
// headlinesOn: 0,
// homeChannel: '',
// iconCUrl: '',
// iconCUrlSize: '',
// iconUrl: '',
// iconUrlSize: '',
// localChannel: '1',
// moreChannel: '',
// movePermitted: 0,
// myChannel: '',
// name: '上海',
// num: 0,
// pageId: 21212,
// pageType: '',
// underlineCColor: ''
// },
// {
// channelId: 9,
// channelStyle: 1,
// channelType: 1,
// defaultPermitted: 1,
// delPermitted: 1,
// fontCColor: '#000000',
// fontColor: '#000000',
// headlinesOn: 0,
// homeChannel: '',
// iconCUrl: '',
// iconCUrlSize: '',
// iconUrl: '',
// iconUrlSize: '',
// localChannel: '1',
// moreChannel: '',
// movePermitted: 0,
// myChannel: '',
// name: '江苏',
// num: 0,
// pageId: 21212,
// pageType: '',
// underlineCColor: ''
// }
]
// 顶导数据
@State topNavList: TopNavDTO[] = []
dialogController: CustomDialogController | null = new CustomDialogController({
builder: ChannelDialog({
currentTopNavSelectedIndex:this.currentTopNavSelectedIndex,
indexSettingArray: this.indexSettingArray,
topNavList: this.topNavList,
myChannelList: this.myChannelList,
moreChannelList: this.moreChannelList,
localChannelList: this.localChannelList,
currentTopNavSelectedIndex: $currentTopNavSelectedIndex,
indexSettingArray: $indexSettingArray,
myChannelList: $myChannelList,
moreChannelList: $moreChannelList,
localChannelList: $localChannelList
}),
cancel: this.exitApp,
alignment: DialogAlignment.TopEnd,
customStyle: true,
})
aboutToAppear() {
this.topNavList.forEach((item,index)=>{
if(item.myChannel === '1'){
this.myChannelList.push(item)
}
if(item.moreChannel === '1'){
this.moreChannelList.push(item)
}
if(item.localChannel === '1'){
this.localChannelList.push(item)
}
})
}
aboutToDisappear() {
this.dialogController = null // 将dialogController置空
}
onCancel() {
console.info('Callback when the first button is clicked')
}
aboutToAppear() {
onAccept() {
console.info('Callback when the second button is clicked')
}
exitApp() {
console.info('Click the callback in the blank area')
aboutToDisappear() {
this.dialogController = null // 将dialogController置空
}
build() {
... ...
... ... @@ -101,6 +101,7 @@ export struct PageComponent {
}
onChange() {
Logger.info(TAG, `onChangezz id: ${this.pageId} , ${this.channelId} , ${this.navIndex} , navIndex: ${this.currentTopNavSelectedIndex}`);
if (this.navIndex === this.currentTopNavSelectedIndex) {
this.getData();
}
... ...
... ... @@ -17,46 +17,63 @@ export struct TopNavigationComponent {
// 顶导数据
@State @Watch('onTopNavigationDataUpdated') topNavList: TopNavDTO[] = []
@State compList: LazyDataSource<CompDTO> = new LazyDataSource();
@State handledTopNavList: TopNavDTO[] = []
//我的频道id缓存列表
@State channelIds: number[] = []
// 我的频道列表
@State myChannelList: TopNavDTO[] = []
// 更多频道列表
@State moreChannelList: TopNavDTO[] = []
// 地方频道列表
@State localChannelList: TopNavDTO[] = []
readonly MAX_LINE: number = 1;
topNavListHandle() {
let defaultMyChannelList: TopNavDTO[] = []
this.handledTopNavList = [...this.topNavList]
this.handledTopNavList.sort((a, b) => {
let handledTopNavList = [...this.topNavList]
handledTopNavList.sort((a, b) => {
return a.num - b.num;
});
Logger.info(TAG, `aboutToAppear this.handledTopNavListsort : ${JSON.stringify(this.handledTopNavList)}`);
for (let i = 0; i < this.handledTopNavList.length; i++) {
if (this.handledTopNavList[i].defaultPermitted === 0 || this.handledTopNavList[i].movePermitted === 0 || this.handledTopNavList[i].delPermitted === 0 || this.handledTopNavList[i].headlinesOn === 1) {
defaultMyChannelList.push(this.handledTopNavList.splice(i, 1)[0]);
handledTopNavList.forEach(item => {
if (item.defaultPermitted === 1 || item.movePermitted === 0 || item.delPermitted === 0 || item.headlinesOn === 1) {
defaultMyChannelList.push(item);
}
}
})
defaultMyChannelList.forEach(item => {
item.myChannel = '1'
if (item.defaultPermitted === 1) {
item.homeChannel = '1'
}
let index = handledTopNavList.findIndex(_item => _item.channelId === item.channelId)
if (index !== -1) {
handledTopNavList.splice(index, 1)
}
})
Logger.info(TAG, `aboutToAppear defaultMyChannelListsort : ${JSON.stringify(defaultMyChannelList)}`);
handledTopNavList.unshift(...defaultMyChannelList)
handledTopNavList.forEach((item, index) => {
if (item.channelType === 2) {
item.localChannel = '1'
}
if (index >= 11) {
if (item.channelType === 1) {
item.moreChannel = '1'
}
} else {
if (item.channelType === 1 && item.myChannel !== '1') {
item.moreChannel = '1'
}
}
for (const element of defaultMyChannelList) {
element.myChannel = '1'
if (element.defaultPermitted === 1) {
element.homeChannel = '1'
if (item.myChannel === '1') {
this.myChannelList.push(item)
}
}
this.handledTopNavList.unshift(...defaultMyChannelList)
for (let i = 0; i < this.handledTopNavList.length; i++) {
if(this.handledTopNavList[i].channelType === 2){
this.handledTopNavList[i].localChannel = '1'
if (item.moreChannel === '1') {
this.moreChannelList.push(item)
}
if(i>=11){
if(this.handledTopNavList[i].channelType === 1){
this.handledTopNavList[i].moreChannel = '1'
}
}else{
if(this.handledTopNavList[i].channelType === 1 && this.handledTopNavList[i].myChannel !== '1'){
this.handledTopNavList[i].moreChannel = '1'
}
if (item.localChannel === '1') {
this.localChannelList.push(item)
}
}
console.info(`handledTopNavList:${JSON.stringify(this.handledTopNavList)}`)
})
}
build() {
... ... @@ -150,7 +167,7 @@ export struct TopNavigationComponent {
Stack({ alignContent: Alignment.TopEnd }) {
Tabs() {
ForEach(this.handledTopNavList, (navItem: TopNavDTO, index: number) => {
ForEach(this.myChannelList, (navItem: TopNavDTO, index: number) => {
TabContent() {
PageComponent({
currentTopNavSelectedIndex: $currentTopNavSelectedIndex,
... ... @@ -171,8 +188,10 @@ export struct TopNavigationComponent {
})
ChannelSubscriptionLayout({
topNavList: this.handledTopNavList,
currentTopNavSelectedIndex: this.currentTopNavSelectedIndex
myChannelList: $myChannelList,
moreChannelList: $moreChannelList,
localChannelList: $localChannelList,
currentTopNavSelectedIndex: $currentTopNavSelectedIndex
})
}
... ... @@ -208,7 +227,6 @@ export struct TopNavigationComponent {
bottom: $r('app.float.top_tab_item_padding_bottom')
})
.id(`col_tabBar${index}`)
}
aboutToAppear() {
... ...
import { Action, CompDTO, Params } from 'wdBean';
import { ExtraDTO } from 'wdBean/src/main/ets/bean/component/extra/ExtraDTO';
import { CommonConstants } from 'wdConstant/Index';
import { DateTimeUtils, Logger } from 'wdKit';
import { WDRouterRule } from 'wdRouter';
... ... @@ -23,15 +24,12 @@ export struct AlbumCardComponent {
.fontColor(0x222222)
.lineHeight(25)
.maxLines(3)
.margin({ top: 6,
left: 16,
right: 16 })
.width(343)
.width(CommonConstants.FULL_WIDTH)
RelativeContainer() {
Image(this.compDTO.operDataList[0].fullColumnImgUrls[0].url)
.width(229)
.height(154)
.width('66.6%')
.aspectRatio(16/9)
.alignRules({
top: { anchor: "__container__", align: VerticalAlign.Top },
left: { anchor: "__container__", align: HorizontalAlign.Start }
... ... @@ -39,8 +37,8 @@ export struct AlbumCardComponent {
.id('mainImage')
Image(this.compDTO.operDataList[0].fullColumnImgUrls[1].url)
.width(112)
.height(76)
.width('33%')
.aspectRatio(16/9)
.alignRules({
top: { anchor: "__container__", align: VerticalAlign.Top },
right: { anchor: "__container__", align: HorizontalAlign.End }
... ... @@ -48,14 +46,14 @@ export struct AlbumCardComponent {
.id('subTopImage')
Image(this.compDTO.operDataList[0].fullColumnImgUrls[2].url)
.width(112)
.height(76)
.width('33%')
.aspectRatio(16/9)
.alignRules({
right: { anchor: "__container__", align: HorizontalAlign.End },
bottom: { anchor: "__container__", align: VerticalAlign.Bottom }
})
.id('subBottomImage')
// 下面是渲染右下角图标
Shape() {
Rect().width(33).height(18)
}
... ... @@ -97,8 +95,8 @@ export struct AlbumCardComponent {
.width(17)
.height(17)
}
.width(343)
.height(154)
.width(CommonConstants.FULL_WIDTH)
.aspectRatio(24/9)
.onClick((event: ClickEvent) => {
let taskAction: Action = {
type: 'JUMP_DETAIL_PAGE',
... ... @@ -134,13 +132,17 @@ export struct AlbumCardComponent {
.margin({
left: 6
})
}.margin({ left: 24 })
.width(375)
}
.width(CommonConstants.FULL_WIDTH)
.height(16)
.id('label')
}
.width(375)
// .backgroundColor(0x000000)
.width(CommonConstants.FULL_WIDTH)
.padding({
top: 14,
left: 16,
right: 16,
bottom: 14
})
}
}
\ No newline at end of file
... ...
... ... @@ -44,6 +44,7 @@ export struct OperRowListView {
.width(24)
.height(24)
.aspectRatio(1)
.interpolation(ImageInterpolation.High)
}
.margin({
top: 0,
... ... @@ -74,14 +75,12 @@ export struct OperRowListView {
.width('45.5%')
.alignItems(VerticalAlign.Center)
.justifyContent(FlexAlign.Start)
Row() {
Flex({ justifyContent: FlexAlign.SpaceAround, alignItems:ItemAlign.Center }) {
ForEach(this.operationList, (item: OperationItem, index: number) => {
this.buildOperationItem(item, index)
}, (item: OperationItem, index: number) => JSON.stringify(item))
}
.width('54.5%')
.alignItems(VerticalAlign.Center)
.justifyContent(FlexAlign.Center)
}
.width('100%')
.height(56)
... ... @@ -100,6 +99,7 @@ export struct OperRowListView {
.width(24)
.height(24)
.aspectRatio(1)
.interpolation(ImageInterpolation.High)
}
.margin(5)
.alignItems(HorizontalAlign.Center)
... ... @@ -108,6 +108,5 @@ export struct OperRowListView {
Logger.info(TAG, `buildOperationItem onClick event index: ${index}`);
ToastUtils.showToast('体验版,本功能暂未开发', 1000);
})
.width('19%')
}
}
\ No newline at end of file
... ...
... ... @@ -102,6 +102,7 @@ export class PageRepository {
* 早晚报pageInfo请求 TODO 现网无数据写死测试环境
* */
static getMorningEveningPageInfoUrl(pageId: string) {
HttpUrlUtils.hostUrl = HttpUrlUtils.HOST_DEV
let url = HttpUrlUtils.getHost() + HttpUrlUtils.MORNING_EVENING_PAGE_INFO_PATH;
url = url + "?pageId=" + pageId;
Logger.info(TAG, "getMorningEveningPageInfoUrl url = " + url)
... ... @@ -122,6 +123,7 @@ export class PageRepository {
* topicId:专题id
* */
static getMorningEveningCompInfoUrl(pageId: number, groupId: number, refreshTime: string, topicId: string, pageNum: number, pageSize: number) {
HttpUrlUtils.hostUrl = HttpUrlUtils.HOST_DEV
let url = HttpUrlUtils.getHost() + HttpUrlUtils.MORNING_EVENING_COMP_INFO_PATH;
url = url + "?loadStrategy=first_load&pageNum=" + pageNum + "&refreshTime=" + refreshTime + "&pageId="
+ pageId + "&channelStrategy=2&groupId=" + groupId + "&topicId=" + topicId + "&pageSize=" + pageSize;
... ...
@Component
export struct AVPlayer {
@State outSetValueOne:number = 40
build() {
Column(){
// 进度条
Row(){
Slider({
value: this.outSetValueOne,
min: 0,
max: 100,
style: SliderStyle.OutSet
})
.trackColor('rgba(0,0,0,0.5)')
.selectedColor('#ED2800')
.showTips(true)
.onChange((value: number, mode: SliderChangeMode) => {
this.outSetValueOne = value
console.info('value:' + value + 'mode:' + mode.toString())
})
}
.width('100%')
.padding({left:24,right:24})
.margin({top:110})
// 播放按钮
Row(){
Image($r('app.media.loop'))
.width(24)
.height(24)
Image($r('app.media.Backward'))
.width(24)
.height(24)
Stack(){
Image($r("app.media.playicon"))
.width(32)
.height(32)
}
.backgroundColor('rgba(255,255,255,0.1)')
.width(60)
.height(60)
.padding(14)
.borderRadius(50)
.onClick(()=>{
// this.avPlayerUrl()
})
Image($r('app.media.fastForward'))
.width(24)
.height(24)
Image($r('app.media.doubleSpeed'))
.width(24)
.height(24)
}
.width('100%')
.justifyContent(FlexAlign.SpaceBetween)
.margin({top:56})
.padding({left:32,right:32})
}
}
}
\ No newline at end of file
import media from '@ohos.multimedia.media';
import { Song } from '../viewModel/Song'
import { AVPlayer } from '../../components/AVPlayer'
import { Logger } from 'wdKit';
import { AudioDetailComponent } from 'wdComponent';
import router from '@ohos.router';
import { Params, Action } from 'wdBean';
const TAG = 'AudioDetail';
@Entry
@Component
struct AudioDetail {
@State message: string = '大自然的奇迹展览在中国国家博物馆拉开帷幕';
@State iocClock: string = '定时';
@State iconTheOriginal: string = '原文';
@State iconList: string = '列表';
@State text: string = ''
@State showList: boolean = false
controller: TextInputController = new TextInputController()
// 音频
@State songs: Song[] = []
// private avPlayer:media.AVPlayer
async aboutToAppear() {
//加载音乐列表
// let response = await axios({
// method:'get',
// url:''
// })
// //创建avPlayer实例对象
// this.avPlayer = await media.createAVPlayer()
// //创建状态机变化回调函数
// this.setAVPlayerCallback()
// // this.avPlayer.url =
}
// 注册avplayer回调函数
// setAVPlayerCallback() {
// // seek操作结果回调函数
// this.avPlayer.on('seekDone', (seekDoneTime) => {
// console.info(`AVPlayer seek succeeded, seek time is ${seekDoneTime}`);
// })
// // error回调监听函数,当avPlayer在操作过程中出现错误时调用reset接口触发重置流程
// this.avPlayer.on('error', (err) => {
// console.error(`Invoke avPlayer failed, code is ${err.code}, message is ${err.message}`);
// this.avPlayer.reset(); // 调用reset重置资源,触发idle状态
// })
// // 状态机变化回调函数
// this.avPlayer.on('stateChange', async (state, reason) => {
// switch (state) {
// case 'idle': // 成功调用reset接口后触发该状态机上报
// console.info('AVPlayer state idle called.');
// this.avPlayer.release(); // 调用release接口销毁实例对象
// break;
// case 'initialized': // avplayer 设置播放源后触发该状态上报
// console.info('AVPlayerstate initialized called.');
// this.avPlayer.prepare().then(() => {
// console.info('AVPlayer prepare succeeded.');
// })
// break;
// case 'prepared': // prepare调用成功后上报该状态机
// console.info('AVPlayer state prepared called.');
// this.avPlayer.play(); // 调用播放接口开始播放
// break;
// case 'playing': // play成功调用后触发该状态机上报
// console.info('AVPlayer state playing called.');
// break;
// case 'paused': // pause成功调用后触发该状态机上报
// console.info('AVPlayer state paused called.');
// this.avPlayer.play(); // 再次播放接口开始播放
// break;
// case 'completed': // 播放结束后触发该状态机上报
// console.info('AVPlayer state completed called.');
// this.avPlayer.stop(); //调用播放结束接口
// break;
// case 'stopped': // stop接口成功调用后触发该状态机上报
// console.info('AVPlayer state stopped called.');
// this.avPlayer.reset(); // 调用reset接口初始化avplayer状态
// break;
// case 'released':
// console.info('AVPlayer state released called.');
// break;
// default:
// console.info('AVPlayer state unknown called.');
// break;
// }
// })
// }
@State relId: string = ''
@State contentId: string = ''
@State relType: string = ''
build() {
Column() {
Row() {
Column() {
// 封面
Row() {
Image($r('app.media.audio'))
.width(240)
.height(160)
.borderRadius('0.00vp')
}
.justifyContent(FlexAlign.Center)
.width('100%')
.margin({ top: 64 })
// 标题
Row() {
Text(this.message)
.fontSize(20)
.fontWeight(FontWeight.Bold)
.fontColor('#ffffff')
.textAlign(TextAlign.Center)
.lineHeight(28)
.fontFamily('PingFang SC, PingFang SC')
}
.padding({ left: 34, right: 34 })
.margin({ top: 32 })
// 操作矩阵
Row() {
// 定时
Column() {
Image($r('app.media.clock'))
.width(28)
.height(28)
Text(this.iocClock)
.fontColor('#fff')
.fontSize(12)
.lineHeight(16)
.margin(2)
}
// 原文
Column() {
Image($r('app.media.theOriginal'))
.width(28)
.height(28)
Text(this.iconTheOriginal)
.fontColor('#fff')
.fontSize(12)
.lineHeight(16)
.margin(2)
}
// 列表
Column() {
Image($r('app.media.list'))
.width(28)
.height(28)
Text(this.iconList)
.fontColor('#fff')
.fontSize(12)
.lineHeight(16)
.margin(2)
}
.onClick(() => {
this.showList = !this.showList
console.log('列表', this.showList)
})
}
.width('100%')
.padding({ left: 49, right: 49 })
.justifyContent(FlexAlign.SpaceBetween)
.margin({ top: 60 })
AVPlayer()
}
}
.height('100%-56')
Row() {
Image($r('app.media.leftArrow'))
.width(24)
.height(24)
TextInput({ text: this.text, placeholder: 'input your word...', controller: this.controller })
.placeholderColor('#999999')
.placeholderFont({ size: 12, weight: 400 })
.caretColor(Color.White)
.height(30)
.width(115)
.fontSize(12)
.fontColor('#999999')
.backgroundColor('rgba(255,255,255,0.1)')
.borderRadius(0)
.backgroundColor('[UIColor colorWithRed:255/255.0 green:255/255.0 blue:255/255.0 alpha:1.0].CGColor')
.onChange((value: string) => {
this.text = value
})
// 消息
Badge({
count: 100,
style: { fontSize: 12, badgeColor: '#FA2A2D' },
}) {
Image($r('app.media.news'))
.width(24)
.height(24)
}
// 点赞
Badge({
count: 100,
style: { fontSize: 12, badgeColor: '#FA2A2D' },
}) {
Image($r('app.media.like'))
.width(24)
.height(24)
}
// 收藏
Image($r('app.media.collection'))
.width(24)
.height(24)
// 分享
Image($r('app.media.share'))
.width(24)
.height(24)
}
.height(56)
.width('100%')
.padding(13)
.justifyContent(FlexAlign.SpaceBetween)
// 播放列表
AudioDetailComponent({
relId: this.relId,
contentId: this.contentId,
relType: this.relType
})
}
.height('100%')
.width('100%')
.backgroundColor('#20272E')
.justifyContent(FlexAlign.SpaceBetween)
}
aboutToAppear() {
let par:Action = router.getParams() as Action;
let params = par?.params;
this.relId = params?.extra?.relId || '';
this.relType = params?.extra?.relType || '';
this.contentId = params?.contentID || '';
Logger.info(TAG, 'aboutToAppear');
Logger.info(TAG, 'params', JSON.stringify(params));
}
}
\ No newline at end of file
... ...