zhangbo1_wd
Showing 121 changed files with 5380 additions and 1364 deletions
... ... @@ -4,7 +4,7 @@ import router from '@ohos.router';
@Entry
@Component
struct OtherNormalUserHomePage {
@State userId: string = "111111111";
@State userId: string = "-1";
onPageShow() {
this.userId = router.getParams()?.["userId"]
... ...
... ... @@ -26,16 +26,16 @@ export default struct MinePageUserSimpleInfoUI {
.alt($r('app.media.default_head'))
.width('108lpx')
.height('108lpx')
.objectFit(ImageFit.Cover)
.objectFit(ImageFit.Auto)
.borderRadius(50)
Image(this.levelHead)
.width('120lpx')
.height('120lpx')
.objectFit(ImageFit.Cover)
.width('130lpx')
.height('130lpx')
.objectFit(ImageFit.Auto)
.borderRadius(50)
}.width('120lpx')
.height('120lpx')
}.width('130lpx')
.height('130lpx')
.alignContent(Alignment.Center)
.onClick(()=>{
if(!this.isLogin){
... ...
... ... @@ -14,10 +14,6 @@ export struct FollowFirstTabsComponent{
selectedFontColor: string = '#000000'
aboutToAppear(){
// let res = JSON.parse(`{"code":"0","data":[{"children":[],"directoryName":"阅读","directoryWeight":99,"id":165,"isShow":1,"level":1,"parentId":0,"rootId":0},{"children":[{"children":[{"directoryName":"三二","directoryWeight":2,"id":120,"isShow":1,"level":3,"parentId":118,"rootId":117},{"directoryName":"三级","directoryWeight":1,"id":119,"isShow":1,"level":3,"parentId":118,"rootId":117}],"directoryName":"二级","directoryWeight":1,"id":118,"isShow":1,"level":2,"parentId":117,"rootId":117}],"directoryName":"幽游白书","directoryWeight":33,"id":117,"isShow":1,"level":1,"parentId":0,"rootId":0},{"children":[],"directoryName":"推荐","directoryWeight":9,"id":386,"isShow":1,"level":1,"parentId":0,"rootId":0},{"children":[],"directoryName":"政务","directoryWeight":9,"id":379,"isShow":1,"level":1,"parentId":0,"rootId":0},{"children":[{"children":[],"directoryName":"推荐","directoryWeight":0,"id":335,"isShow":1,"level":2,"parentId":320,"rootId":320}],"directoryName":"推荐","directoryWeight":9,"id":320,"isShow":1,"level":1,"parentId":0,"rootId":0},{"children":[],"directoryName":"媒体","directoryWeight":8,"id":390,"isShow":1,"level":1,"parentId":0,"rootId":0},{"children":[],"directoryName":"媒体","directoryWeight":8,"id":323,"isShow":1,"level":1,"parentId":0,"rootId":0},{"children":[],"directoryName":"自媒体","directoryWeight":7,"id":329,"isShow":1,"level":1,"parentId":0,"rootId":0},{"children":[],"directoryName":"名人","directoryWeight":6,"id":389,"isShow":1,"level":1,"parentId":0,"rootId":0},{"children":[{"children":[],"directoryName":"测试","directoryWeight":0,"id":338,"isShow":1,"level":2,"parentId":324,"rootId":324}],"directoryName":"名人","directoryWeight":6,"id":324,"isShow":1,"level":1,"parentId":0,"rootId":0},{"children":[{"children":[],"directoryName":"2级目录","directoryWeight":0,"id":340,"isShow":1,"level":2,"parentId":312,"rootId":312},{"children":[{"directoryName":"3级测试","directoryWeight":0,"id":368,"isShow":1,"level":3,"parentId":339,"rootId":312}],"directoryName":"二级目录","directoryWeight":0,"id":339,"isShow":1,"level":2,"parentId":312,"rootId":312},{"children":[{"directoryName":"企业","directoryWeight":1,"id":348,"isShow":1,"level":3,"parentId":336,"rootId":312},{"directoryName":"部委","directoryWeight":0,"id":344,"isShow":1,"level":3,"parentId":336,"rootId":312},{"directoryName":"地方","directoryWeight":0,"id":341,"isShow":1,"level":3,"parentId":336,"rootId":312}],"directoryName":"类型","directoryWeight":0,"id":336,"isShow":1,"level":2,"parentId":312,"rootId":312},{"children":[{"directoryName":"贵州省","directoryWeight":0,"id":378,"isShow":1,"level":3,"parentId":332,"rootId":312},{"directoryName":"西藏自治区","directoryWeight":0,"id":377,"isShow":1,"level":3,"parentId":332,"rootId":312},{"directoryName":"四川省","directoryWeight":0,"id":376,"isShow":1,"level":3,"parentId":332,"rootId":312},{"directoryName":"重庆市","directoryWeight":0,"id":375,"isShow":1,"level":3,"parentId":332,"rootId":312},{"directoryName":"湖南省","directoryWeight":0,"id":374,"isShow":1,"level":3,"parentId":332,"rootId":312},{"directoryName":"云南省","directoryWeight":0,"id":373,"isShow":1,"level":3,"parentId":332,"rootId":312},{"directoryName":"广西壮族自治区","directoryWeight":0,"id":372,"isShow":1,"level":3,"parentId":332,"rootId":312},{"directoryName":"宁夏回族自治区","directoryWeight":0,"id":371,"isShow":1,"level":3,"parentId":332,"rootId":312},{"directoryName":"湖北省","directoryWeight":0,"id":370,"isShow":1,"level":3,"parentId":332,"rootId":312},{"directoryName":"青海省","directoryWeight":0,"id":369,"isShow":1,"level":3,"parentId":332,"rootId":312},{"directoryName":"陕西省","directoryWeight":0,"id":367,"isShow":1,"level":3,"parentId":332,"rootId":312},{"directoryName":"甘肃省","directoryWeight":0,"id":366,"isShow":1,"level":3,"parentId":332,"rootId":312},{"directoryName":"吉林省","directoryWeight":0,"id":365,"isShow":1,"level":3,"parentId":332,"rootId":312},{"directoryName":"广东省","directoryWeight":0,"id":364,"isShow":1,"level":3,"parentId":332,"rootId":312},{"directoryName":"海南省","directoryWeight":0,"id":363,"isShow":1,"level":3,"parentId":332,"rootId":312},{"directoryName":"辽宁省","directoryWeight":0,"id":362,"isShow":1,"level":3,"parentId":332,"rootId":312},{"directoryName":"江苏省","directoryWeight":0,"id":361,"isShow":1,"level":3,"parentId":332,"rootId":312},{"directoryName":"新疆维吾尔族自治区","directoryWeight":0,"id":360,"isShow":1,"level":3,"parentId":332,"rootId":312},{"directoryName":"福建省","directoryWeight":0,"id":359,"isShow":1,"level":3,"parentId":332,"rootId":312},{"directoryName":"山东省","directoryWeight":0,"id":358,"isShow":1,"level":3,"parentId":332,"rootId":312},{"directoryName":"河南省","directoryWeight":0,"id":357,"isShow":1,"level":3,"parentId":332,"rootId":312},{"directoryName":"浙江省","directoryWeight":0,"id":356,"isShow":1,"level":3,"parentId":332,"rootId":312},{"directoryName":"安徽省","directoryWeight":0,"id":355,"isShow":1,"level":3,"parentId":332,"rootId":312},{"directoryName":"上海市","directoryWeight":0,"id":354,"isShow":1,"level":3,"parentId":332,"rootId":312},{"directoryName":"河北省","directoryWeight":0,"id":353,"isShow":1,"level":3,"parentId":332,"rootId":312},{"directoryName":"黑龙江省","directoryWeight":0,"id":352,"isShow":1,"level":3,"parentId":332,"rootId":312},{"directoryName":"江西省","directoryWeight":0,"id":351,"isShow":1,"level":3,"parentId":332,"rootId":312},{"directoryName":"内蒙古自治区","directoryWeight":0,"id":350,"isShow":1,"level":3,"parentId":332,"rootId":312},{"directoryName":"北京市","directoryWeight":0,"id":349,"isShow":1,"level":3,"parentId":332,"rootId":312},{"directoryName":"山西省","directoryWeight":0,"id":346,"isShow":1,"level":3,"parentId":332,"rootId":312}],"directoryName":"地域","directoryWeight":0,"id":332,"isShow":1,"level":2,"parentId":312,"rootId":312}],"directoryName":"政务","directoryWeight":5,"id":312,"isShow":1,"level":1,"parentId":0,"rootId":0},{"children":[],"directoryName":"学校","directoryWeight":4,"id":331,"isShow":1,"level":1,"parentId":0,"rootId":0},{"children":[],"directoryName":"机构","directoryWeight":3,"id":330,"isShow":1,"level":1,"parentId":0,"rootId":0},{"children":[{"children":[{"directoryName":"新闻联播","directoryWeight":3,"id":79,"isShow":1,"level":3,"parentId":75,"rootId":74},{"directoryName":"第三季","directoryWeight":2,"id":78,"isShow":1,"level":3,"parentId":75,"rootId":74},{"directoryName":"三级","directoryWeight":1,"id":76,"isShow":1,"level":3,"parentId":75,"rootId":74}],"directoryName":"短视频","directoryWeight":1,"id":75,"isShow":1,"level":2,"parentId":74,"rootId":74}],"directoryName":"创作","directoryWeight":3,"id":74,"isShow":1,"level":1,"parentId":0,"rootId":0},{"children":[{"children":[],"directoryName":"教学","directoryWeight":2,"id":72,"isShow":1,"level":2,"parentId":64,"rootId":64},{"children":[],"directoryName":"热门","directoryWeight":1,"id":73,"isShow":1,"level":2,"parentId":64,"rootId":64},{"children":[],"directoryName":"赛事","directoryWeight":1,"id":71,"isShow":1,"level":2,"parentId":64,"rootId":64}],"directoryName":"游戏","directoryWeight":2,"id":64,"isShow":1,"level":1,"parentId":0,"rootId":0},{"children":[],"directoryName":"新闻","directoryWeight":1,"id":315,"isShow":1,"level":1,"parentId":0,"rootId":0},{"children":[{"children":[],"directoryName":"趣闻","directoryWeight":6,"id":70,"isShow":1,"level":2,"parentId":63,"rootId":63},{"children":[],"directoryName":"时政","directoryWeight":5,"id":69,"isShow":1,"level":2,"parentId":63,"rootId":63},{"children":[],"directoryName":"农业","directoryWeight":3,"id":68,"isShow":1,"level":2,"parentId":63,"rootId":63},{"children":[],"directoryName":"娱乐","directoryWeight":3,"id":67,"isShow":1,"level":2,"parentId":63,"rootId":63},{"children":[],"directoryName":"科技","directoryWeight":2,"id":66,"isShow":1,"level":2,"parentId":63,"rootId":63},{"children":[],"directoryName":"国际","directoryWeight":1,"id":65,"isShow":1,"level":2,"parentId":63,"rootId":63}],"directoryName":"新闻","directoryWeight":1,"id":63,"isShow":1,"level":1,"parentId":0,"rootId":0},{"children":[],"directoryName":"公安","directoryWeight":0,"id":388,"isShow":1,"level":1,"parentId":0,"rootId":0},{"children":[],"directoryName":"dddd","directoryWeight":0,"id":387,"isShow":1,"level":1,"parentId":0,"rootId":0},{"children":[],"directoryName":"健康","directoryWeight":0,"id":384,"isShow":1,"level":1,"parentId":0,"rootId":0},{"children":[],"directoryName":"综合","directoryWeight":0,"id":328,"isShow":1,"level":1,"parentId":0,"rootId":0},{"children":[],"directoryName":"房产","directoryWeight":0,"id":327,"isShow":1,"level":1,"parentId":0,"rootId":0},{"children":[],"directoryName":"健康","directoryWeight":0,"id":318,"isShow":1,"level":1,"parentId":0,"rootId":0},{"children":[],"directoryName":"历史","directoryWeight":0,"id":310,"isShow":1,"level":1,"parentId":0,"rootId":0},{"children":[],"directoryName":"dddd","directoryWeight":0,"id":309,"isShow":1,"level":1,"parentId":0,"rootId":0},{"children":[{"children":[],"directoryName":"aaaa","directoryWeight":1,"id":333,"isShow":1,"level":2,"parentId":308,"rootId":308},{"children":[],"directoryName":"qqq","directoryWeight":0,"id":334,"isShow":1,"level":2,"parentId":308,"rootId":308}],"directoryName":"dddd","directoryWeight":0,"id":308,"isShow":1,"level":1,"parentId":0,"rootId":0}],"message":"Success","success":true,"timestamp":1710741803593}`) as ResponseDTO<FollowListItem[]>
// res.data.forEach(element => {
// this.data.push(element)
// });
MinePageDatasModel.getFollowListData(getContext(this)).then((value)=>{
this.data.push(new FollowListItem("我的"))
value.forEach((element)=>{
... ... @@ -85,7 +81,7 @@ export struct FollowFirstTabsComponent{
this.currentIndex = index
})
.width('100%')
.height('100%')
.layoutWeight(1)
}.width('100%')
}
}
\ No newline at end of file
... ...
... ... @@ -70,7 +70,7 @@ export struct FollowListDetailUI{
//我的关注列表
if (this.creatorDirectoryId === -1){
if(this.hasMore){
let object = new FollowListDetailRequestItem(20,this.curPageNum)
let object = new FollowListDetailRequestItem(-1,20,this.curPageNum)
MinePageDatasModel.getMineFollowListData(object,getContext(this)).then((value)=>{
if (!this.data || value.list.length == 0){
... ...
... ... @@ -23,14 +23,13 @@ export struct FollowSecondTabsComponent{
if(this.data != null){
if(this.data[this.firstIndex].children == null || this.data[this.firstIndex].children.length == 0){
FollowListDetailUI({creatorDirectoryId:this.data[this.firstIndex].id})
FollowListDetailUI({creatorDirectoryId:this.data[this.firstIndex].id}).layoutWeight(1)
}else{
this.FollowSecondUI()
}
}
}
}.layoutWeight(1)
.width('100%')
.height('100%')
}
@Builder FollowSecondUI(){
... ...
import { LazyDataSource, StringUtils } from 'wdKit';
import { DateTimeUtils, LazyDataSource, StringUtils } from 'wdKit';
import MinePageDatasModel from '../../../../model/MinePageDatasModel';
import { HttpUrlUtils } from '../../../../network/HttpUrlUtils';
import RouteManager from '../../../../utils/RouteManager';
... ... @@ -33,8 +33,32 @@ export struct HomePageBottomComponent{
.backgroundColor($r('app.color.color_EDEDED'))
if(this.count === 0){
ListHasNoMoreDataUI({style:2})
.height('100%')
if(this.style === 1){
Row(){
Text("关注更多人民号")
.fontWeight('400lpx')
.fontColor($r('app.color.color_222222'))
.lineHeight('38lpx')
.fontSize('27lpx')
.textAlign(TextAlign.Center)
.margin({right:'4lpx'})
Image($r('app.media.arrow_icon_right'))
.objectFit(ImageFit.Auto)
.width('27lpx')
.height('27lpx')
}.height('69lpx')
.width('659lpx')
.alignItems(VerticalAlign.Center)
.justifyContent(FlexAlign.Center)
.backgroundColor($r('app.color.color_F5F5F5'))
.margin({top:'31lpx',bottom:'4lpx'})
.onClick(()=>{
RouteManager.jumpNewPage("pages/FollowListPage",new RouterObject('',1))
})
}else{
ListHasNoMoreDataUI({style:2})
.layoutWeight(1)
}
}else{
if(this.style === 1){
List({ space: 3 }) {
... ... @@ -129,6 +153,8 @@ export struct HomePageBottomComponent{
}
}
.width('100%')
.height('100%')
.justifyContent(FlexAlign.Start)
}
... ... @@ -145,7 +171,7 @@ export struct HomePageBottomComponent{
//我的关注列表
if (this.style === 1){
if(this.hasMore){
let object = new FollowListDetailRequestItem(20,this.curPageNum)
let object = new FollowListDetailRequestItem(-1,20,this.curPageNum)
MinePageDatasModel.getMineFollowListData(object,getContext(this)).then((value)=>{
if (!this.data_follow || value.list.length == 0){
... ... @@ -170,9 +196,11 @@ export struct HomePageBottomComponent{
}
}else if(this.style === 0){
if(this.hasMore){
let object = new FollowListDetailRequestItem(20,this.curPageNum)
let time = encodeURI(DateTimeUtils.getCurDate(DateTimeUtils.PATTERN_DATE_TIME_HYPHEN))
let object = new FollowListDetailRequestItem(-1,20,this.curPageNum)
MinePageDatasModel.getMineCommentListData(object,getContext(this)).then((value)=>{
MinePageDatasModel.getMineCommentListData(time,object,getContext(this)).then((value)=>{
if (!this.data_comment || value.list.length == 0){
this.hasMore = false
}else{
... ...
... ... @@ -55,18 +55,20 @@ export struct MyHomeComponent {
Stack(){
Image(this.headPhotoUrl)
.alt($r('app.media.default_head'))
.width('115lpx')
.height('115lpx')
.objectFit(ImageFit.Cover)
.width('100lpx')
.height('100lpx')
.objectFit(ImageFit.Auto)
.borderRadius(50)
Image(this.levelHead)
.width('130lpx')
.height('130lpx')
.objectFit(ImageFit.Cover)
.borderRadius(50)
}.onClick(()=>{
//531267787833221
RouteManager.jumpNewPage("pages/OtherNormalUserHomePage",new RouterObject('512157124138245',0))
})
}).width('135lpx')
.height('135lpx')
Column() {
Row() {
Text(`${this.userName}`)
... ...
... ... @@ -6,6 +6,7 @@ import MinePageDatasModel from '../../../../model/MinePageDatasModel';
import { MineCommentListDetailItem } from '../../../../viewmodel/MineCommentListDetailItem';
import { OtherUserCommentLikeStatusRequestItem } from '../../../../viewmodel/OtherUserCommentLikeStatusRequestItem';
import { CommentLikeOperationRequestItem } from '../../../../viewmodel/CommentLikeOperationRequestItem';
import { HttpUrlUtils } from '../../../../network/HttpUrlUtils';
const TAG = "HomePageBottomComponent"
@Component
... ... @@ -17,6 +18,7 @@ export struct OtherHomePageBottomCommentComponent{
curPageNum:number = 1;
@State count:number = 0;
@Prop levelHead:string
@Link commentNum:number
aboutToAppear(){
this.getNewPageData()
... ... @@ -122,6 +124,7 @@ export struct OtherHomePageBottomCommentComponent{
this.data_comment.notifyDataReload()
this.count = this.data_comment.totalCount()
this.commentNum = value.totalCount
if (this.data_comment.totalCount() < value.totalCount) {
this.curPageNum++
}else {
... ...
... ... @@ -104,7 +104,7 @@ export struct OtherHomePageBottomFollowComponent{
getNewPageData(){
this.isLoading = true
//我的关注列表
//关注列表
if(this.hasMore){
let object = new UserFollowListRequestItem(Number(this.curUserId),20,this.curPageNum,"1")
... ... @@ -164,47 +164,6 @@ struct ChildFollowComponent {
.textOverflow({ overflow: TextOverflow.Ellipsis })
}.layoutWeight(1)
.alignItems(HorizontalAlign.Start)
if(this.data.status == "1"){
Row(){
Text(`已关注`)
.fontColor($r('app.color.color_CCCCCC'))
.fontSize('23lpx')
.fontWeight('500lpx')
.lineHeight('35lpx')
}.backgroundColor($r('app.color.color_F5F5F5'))
.borderRadius('6lpx')
.borderColor($r('app.color.color_F5F5F5'))
.borderWidth('2lpx')
.justifyContent(FlexAlign.Center)
.width('100lpx')
.height('46lpx')
.margin({left:'4lpx',top:'23lpx'})
.onClick(()=>{
this.data.status = "0"
})
}else{
Row(){
Image($r('app.media.follow_icon'))
.margin({right:'4lpx'})
.width('23lpx')
.height('23lpx')
Text(`关注`)
.fontColor($r('app.color.color_ED2800'))
.fontSize('23lpx')
.fontWeight('500lpx')
.lineHeight('35lpx')
}.borderColor($r('app.color.color_1AED2800'))
.borderRadius('6lpx')
.borderWidth('2lpx')
.justifyContent(FlexAlign.Center)
.width('100lpx')
.height('46lpx')
.margin({left:'4lpx',top:'23lpx'})
.onClick(()=>{
this.data.status = "1"
})
}
}.alignItems(VerticalAlign.Top)
.width('100%')
.layoutWeight(1)
... ...
... ... @@ -9,7 +9,7 @@ const TAG = "OtherUserHomeComponent"
@Component
export struct OtherUserHomeComponent {
@Prop curUserId: string
@Watch('change') @Prop curUserId: string
@State tileOpacity: number = 0;
firstPositionY:number = 0;
... ... @@ -27,6 +27,12 @@ export struct OtherUserHomeComponent {
@State attentionNum:number = 0//关注数
@State desc:string = ""
change(){
this.getUserInfo()
this.getUserLevel()
}
aboutToAppear(){
this.getUserInfo()
this.getUserLevel()
... ... @@ -52,8 +58,8 @@ export struct OtherUserHomeComponent {
Stack(){
Image(this.headPhotoUrl)
.alt($r('app.media.default_head'))
.width('115lpx')
.height('115lpx')
.width('100lpx')
.height('100lpx')
.objectFit(ImageFit.Cover)
.borderRadius(50)
Image(this.levelHead)
... ... @@ -165,7 +171,7 @@ export struct OtherUserHomeComponent {
//tab 页面
Tabs({controller: this.controller}) {
TabContent() {
OtherHomePageBottomCommentComponent({curUserId:this.curUserId,levelHead:this.levelHead})
OtherHomePageBottomCommentComponent({curUserId:this.curUserId,levelHead:this.levelHead,commentNum:$commentNum})
}.tabBar(this.TabBuilder(0,"评论"))
TabContent() {
OtherHomePageBottomFollowComponent({curUserId:this.curUserId})
... ... @@ -295,6 +301,9 @@ export struct OtherUserHomeComponent {
getUserInfo(){
if(this.curUserId === "-1" ){
return
}
let item = new OtherUserDetailRequestItem("","1",this.curUserId)
MinePageDatasModel.getOtherUserDetailData(item,getContext(this)).then((value)=>{
if(value!=null){
... ... @@ -312,6 +321,9 @@ export struct OtherUserHomeComponent {
})
}
getUserLevel(){
if(this.curUserId === "-1" ){
return
}
MinePageDatasModel.getOtherUserLevelData([this.curUserId],getContext(this)).then((value)=>{
if(value!=null){
this.levelHead = value[0].levelHead
... ...
... ... @@ -324,10 +324,10 @@ class MinePageDatasModel{
* @param context
* @returns
*/
getMineCommentListData(params:FollowListDetailRequestItem,context: Context): Promise<MineCommentListDetailItem> {
getMineCommentListData(time:string,params:FollowListDetailRequestItem,context: Context): Promise<MineCommentListDetailItem> {
return new Promise<MineCommentListDetailItem>((success, error) => {
Logger.info(TAG, `getAppointmentList start`);
this.fetchMineCommentListData(params).then((navResDTO: ResponseDTO<MineCommentListDetailItem>) => {
this.fetchMineCommentListData(time,params).then((navResDTO: ResponseDTO<MineCommentListDetailItem>) => {
if (!navResDTO || navResDTO.code != 0) {
success(this.getMineCommentListDataLocal(context))
return
... ... @@ -342,8 +342,8 @@ class MinePageDatasModel{
})
}
fetchMineCommentListData(object:FollowListDetailRequestItem) {
let url = HttpUrlUtils.getMineCommentListDataUrl()+`?pageSize=${object.pageSize}&pageNum=${object.pageNum}`
fetchMineCommentListData(time:string,object:FollowListDetailRequestItem) {
let url = HttpUrlUtils.getMineCommentListDataUrl()+`?pageSize=${object.pageSize}&pageNum=${object.pageNum}&time=${time}`
let headers: HashMap<string, string> = HttpUrlUtils.getYcgCommonHeaders();
return WDHttp.get<ResponseDTO<MineCommentListDetailItem>>(url, headers)
};
... ... @@ -581,7 +581,7 @@ class MinePageDatasModel{
}
fetchOtherUserCommentLikeStatusData(object:OtherUserCommentLikeStatusRequestItem) {
let url = HttpUrlUtils.getFollowListStatusDataUrl()
let url = HttpUrlUtils.getCommentListStatusDataUrl()
let headers: HashMap<string, string> = HttpUrlUtils.getYcgCommonHeaders();
return WDHttp.post<ResponseDTO<QueryCommentListIsLikedItem[]>>(url,object, headers)
};
... ...
... ... @@ -74,6 +74,11 @@ export class HttpUrlUtils {
static readonly FOLLOW_LIST_STATUS_DATA_PATH: string = "/api/rmrb-interact/interact/zh/c/batchAttention/status";
/**
* 个人中心 启用用户 有没有被当前用户点赞状态
*/
static readonly COMMENT_LIST_STATUS_DATA_PATH: string = "/api/rmrb-comment/comment/zh/c/batchCommentStatus";
/**
* 个人中心 我的评论列表
*/
static readonly MINE_COMMENT_LIST_DATA_PATH: string = "/api/rmrb-comment/comment/zh/c/myCommentList";
... ... @@ -238,6 +243,11 @@ export class HttpUrlUtils {
return url
}
static getCommentListStatusDataUrl() {
let url = HttpUrlUtils.hostUrl + HttpUrlUtils.COMMENT_LIST_STATUS_DATA_PATH
return url
}
static getMineCommentListDataUrl() {
let url = HttpUrlUtils.HOST_SIT + HttpUrlUtils.MINE_COMMENT_LIST_DATA_PATH
return url
... ... @@ -290,13 +300,13 @@ export class HttpUrlUtils {
/**
* 预约操作
* 点赞操作
*/
static readonly COMMENT_LIKE_OPERATION_PATH: string = "/api/rmrb-comment/comment/zh/c/commentLike";
/**
* 关注操作
*/
static readonly FOLLOW_OPERATION_PATH: string = "https://pd-apis-sit.pdnews.cn/api/rmrb-interact/interact/zh/c/attention/operation";
static readonly FOLLOW_OPERATION_PATH: string = "/api/rmrb-interact/interact/zh/c/attention/operation";
static getYcgCommonHeaders(): HashMap<string, string> {
let headers: HashMap<string, string> = new HashMap<string, string>()
... ...
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="none" version="1.1" width="24" height="24" viewBox="0 0 24 24"><g style="opacity:0.20000000298023224;"><g><path d="M6.29805,13.2927L19.701900000000002,20.8323C19.8353,20.9073,20,20.811,20,20.658L20,3.34197C20,3.189004,19.8353,3.0926614,19.701900000000002,3.167654L6.29805,10.70735C6.1647300000000005,10.78234,6,10.686,6,10.53303L6,3.2C6,3.0895431,5.9104600000000005,3,5.8,3L4.2,3C4.0895431,3,4,3.0895431,4,3.2L4,20.6764C4,20.8251,4.156463,20.9218,4.289443,20.8553L5.8894400000000005,20.0553C5.9572,20.0214,6,19.9521,6,19.8764L6,13.467C6,13.314,6.1647300000000005,13.2177,6.29805,13.2927" fill-rule="evenodd" fill="#4D5258" fill-opacity="1"/></g></g></svg>
\ No newline at end of file
... ...
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1712047709053" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="11870" width="28" height="28" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M878.885769 568.138291c0 201.397023-163.248995 364.646017-364.646017 364.646017S149.485359 769.535314 149.485359 568.138291c0-192.076766 148.582234-349.076131 336.901997-363.309391 0-0.4335-0.252875-0.903126-0.252875-1.408876V147.353983h-112.168207c-15.497636 0-28.033021-12.535384-28.033021-28.105271 0-15.497636 12.535384-28.033021 28.033021-28.03302h280.51083c15.461511 0 28.105271 12.535384 28.105271 28.03302 0 15.569886-12.643759 28.105271-28.105271 28.105271h-112.168207V203.383899c0 0.541875-0.252875 0.975376-0.252875 1.408876 188.247513 14.269385 336.829747 171.26875 336.829747 363.345516zM514.239752 259.52219c-170.437875 0-308.616101 138.142101-308.616101 308.616101s138.142101 308.616101 308.616101 308.616101c170.365625 0 308.507726-138.142101 308.507726-308.616101s-138.142101-308.616101-308.507726-308.616101z m0 392.787413c-46.529034 0-84.171312-37.714528-84.171312-84.171312 0-36.558527 23.481267-67.445424 56.029916-79.005433V343.693502c0-15.497636 12.535384-28.033021 28.105271-28.033021 15.497636 0 28.033021 12.535384 28.03302 28.033021v145.439356c32.657024 11.560008 56.138291 42.446906 56.138291 79.005433 0 46.456784-37.714528 84.171312-84.135186 84.171312z" fill="#4D5258" p-id="11871"></path></svg>
\ No newline at end of file
... ...
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="none" version="1.1" width="24" height="24" viewBox="0 0 24 24"><defs><clipPath id="master_svg0_13448_089636"><rect x="0" y="0" width="24" height="24" rx="0"/></clipPath></defs><g style="opacity:0.20000000298023224;" clip-path="url(#master_svg0_13448_089636)"><g><path d="M10.67639,4L3.2,4C3.0895431,4,3,4.0895431,3,4.2L3,20.8C3,20.9105,3.0895431,21,3.2,21L20.8,21C20.9105,21,21,20.9105,21,20.8L21,5.12361C21,5.04785,20.9572,4.9786,20.8894,4.944721L19.2894,4.144721C19.1565,4.0782313,19,4.17493,19,4.323607L19,19L5,19L5,6L9.87639,6C9.95215,6,10.0214,5.9572,10.05528,5.8894400000000005L10.85528,4.289443C10.92177,4.156463,10.82507,4,10.67639,4" fill-rule="evenodd" fill="#4D5258" fill-opacity="1"/></g><g><path d="M11.5,3.0706476L11.5,6.52935C11.5,6.56044,11.5339189,6.57965,11.5605798,6.56365L14.44283,4.8343C14.46873,4.81876,14.46873,4.78124,14.44283,4.7657L11.5605798,3.0363479C11.5339189,3.0203513,11.5,3.0395558,11.5,3.0706476" fill-rule="evenodd" fill="#4D5258" fill-opacity="1"/></g><g><path d="M15,3.0706476L15,6.52935C15,6.56044,15.0339189,6.57965,15.0605798,6.56365L17.94283,4.8343C17.96873,4.81876,17.96873,4.78124,17.94283,4.7657L15.0605798,3.0363479C15.0339189,3.0203513,15,3.0395558,15,3.0706476" fill-rule="evenodd" fill="#4D5258" fill-opacity="1"/></g><g><path d="M8.916,11.64L8.916,16L9.964,16L9.964,10.48L8.916,10.48L7.9879999999999995,11.176L7.9879999999999995,12.312000000000001L8.916,11.64ZM10.788,14.864L10.788,16L11.9,16L11.9,14.864L10.788,14.864ZM13.008,15.612C13.27725,15.9294,13.692,16.0881,14.251999999999999,16.088C14.812000000000001,16.088,15.22663,15.928,15.496,15.608C15.76525,15.2881,15.9,14.81338,15.9,14.184L15.9,12.232C15.9,11.623999999999999,15.76525,11.16537,15.496,10.856C15.22663,10.54675,14.812000000000001,10.392,14.251999999999999,10.392C13.71325,10.392,13.304,10.548,13.024000000000001,10.86C12.744,11.172,12.604,11.62937,12.604,12.232L12.604,14.184C12.604,14.81875,12.73863,15.2948,13.008,15.612ZM14.728,14.932C14.64525,15.0947,14.48663,15.176,14.251999999999999,15.176C14.02262,15.176,13.866620000000001,15.0947,13.783999999999999,14.932C13.70125,14.76937,13.66,14.49075,13.66,14.096L13.66,12.384C13.66,11.989370000000001,13.7,11.712,13.780000000000001,11.552C13.86,11.392,14.01725,11.312000000000001,14.251999999999999,11.312000000000001C14.48663,11.312000000000001,14.64525,11.392,14.728,11.552C14.81063,11.712,14.852,11.989370000000001,14.852,12.384L14.852,14.096C14.852,14.49075,14.81063,14.76937,14.728,14.932Z" fill="#4D5258" fill-opacity="1"/></g></g></svg>
\ No newline at end of file
... ...
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="none" version="1.1" width="24" height="24" viewBox="0 0 24 24"><g style="opacity:0.20000000298023224;"><g><path d="M17.701900000000002,13.2927L4.298053,20.8323C4.164731,20.9073,4,20.811,4,20.658L4,3.34197C4,3.189004,4.164731,3.0926614,4.298052,3.167654L17.701900000000002,10.70735C17.8353,10.78234,18,10.686,18,10.53303L18,3.2C18,3.0895431,18.0895,3,18.2,3L19.8,3C19.9105,3,20,3.0895431,20,3.2L20,20.6764C20,20.8251,19.8435,20.9218,19.7106,20.8553L18.110599999999998,20.0553C18.0428,20.0214,18,19.9521,18,19.8764L18,13.467C18,13.314,17.8353,13.2177,17.701900000000002,13.2927" fill-rule="evenodd" fill="#4D5258" fill-opacity="1"/></g></g></svg>
\ No newline at end of file
... ...
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="none" version="1.1" width="28" height="28" viewBox="0 0 28 28"><g style="opacity:0.20000000298023224;"><g><path d="M3.5,4.31780565625L3.5,6.18447265625Q3.5,6.2308826562499995,3.5177614,6.27376265625Q3.5355229,6.31664265625,3.5683417,6.34946265625Q3.601161,6.38228265625,3.644041,6.40004265625Q3.68692,6.41780265625,3.733333,6.41780265625L24.2667,6.41780265625Q24.3131,6.41780265625,24.356,6.40004265625Q24.3988,6.38228265625,24.4317,6.34946265625Q24.4645,6.31664265625,24.4822,6.27376265625Q24.5,6.2308826562499995,24.5,6.18447265625L24.5,4.31780565625Q24.5,4.27139265625,24.4822,4.22851365625Q24.4645,4.18563365625,24.4317,4.15281435625Q24.3988,4.11999555625,24.356,4.10223405625Q24.3131,4.08447265625,24.2667,4.08447265625L3.733333,4.08447265625Q3.68692,4.08447265625,3.644041,4.10223405625Q3.601161,4.11999555625,3.5683417,4.15281435625Q3.5355229,4.18563365625,3.5177614,4.22851365625Q3.5,4.27139265625,3.5,4.31780565625ZM10.20878,13.80699265625L3.862763,9.57631265625C3.707701,9.47294265625,3.5,9.58410265625,3.5,9.77046265625L3.5,18.23177265625C3.5,18.41817265625,3.707701,18.52937265625,3.862763,18.42597265625L10.20878,14.19527265625C10.34732,14.10297265625,10.34732,13.89935265625,10.20878,13.80699265625ZM24.2667,12.83349265625L13.5609,12.83349265625C13.47249,12.83349265625,13.3917,12.88343265625,13.35217,12.96248265625L12.41884,14.82917265625C12.34127,14.98427265625,12.45409,15.16687265625,12.62754,15.16687265625L24.2667,15.16687265625C24.3955,15.16687265625,24.5,15.06237265625,24.5,14.93347265625L24.5,13.06683265625C24.5,12.93796265625,24.3955,12.83349265625,24.2667,12.83349265625ZM3.5,21.81777265625L3.5,23.68447265625Q3.5,23.73087265625,3.5177614,23.77377265625Q3.5355229,23.81667265625,3.5683417,23.84947265625Q3.601161,23.88227265625,3.644041,23.90007265625Q3.68692,23.91777265625,3.733333,23.91777265625L24.2667,23.91777265625Q24.3131,23.91777265625,24.356,23.90007265625Q24.3988,23.88227265625,24.4317,23.84947265625Q24.4645,23.81667265625,24.4822,23.77377265625Q24.5,23.73087265625,24.5,23.68447265625L24.5,21.81777265625Q24.5,21.77137265625,24.4822,21.72847265625Q24.4645,21.68567265625,24.4317,21.65277265625Q24.3988,21.61997265625,24.356,21.60227265625Q24.3131,21.58447265625,24.2667,21.58447265625L3.733333,21.58447265625Q3.68692,21.58447265625,3.644041,21.60227265625Q3.601161,21.61997265625,3.5683417,21.65277265625Q3.5355229,21.68567265625,3.5177614,21.72847265625Q3.5,21.77137265625,3.5,21.81777265625Z" fill-rule="evenodd" fill="#4D5258" fill-opacity="1"/></g></g></svg>
\ No newline at end of file
... ...
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="none" version="1.1" width="24" height="24" viewBox="0 0 24 24"><g style="opacity:0.20000000298023224;"><g><path d="M16.61255231628418,0.6909312143875121L15.48135231628418,1.8221886143875121C15.40315231628418,1.9003386143875123,15.40325231628418,2.0270586143875122,15.48145231628418,2.105148614387512L16.87945231628418,3.5008286143875122L2.19995231628418,3.5008286143875122C2.0894953162841796,3.5008286143875122,1.9999523162841797,3.5903786143875123,1.9999523162841797,3.7008286143875124L1.9999523162841797,14.377268614387512C1.9999523162841797,14.452968614387512,2.0427528162841795,14.522268614387512,2.1105093162841797,14.556068614387513L3.7105123162841798,15.356068614387512C3.8434923162841796,15.422568614387512,3.9999523162841797,15.325868614387511,3.9999523162841797,15.177268614387513L3.9999523162841797,5.500828614387512L18.99995231628418,5.500828614387512L18.99995231628418,5.499258614387513L21.22095231628418,5.499258614387513C21.39905231628418,5.499258614387513,21.48835231628418,5.283828614387512,21.36235231628418,5.157838614387512L16.895452316284178,0.6909312143875121C16.81735231628418,0.6128262143875122,16.69065231628418,0.6128263143875122,16.61255231628418,0.6909312143875121ZM19.99995231628418,8.823458614387512L19.99995231628418,18.499868614387513L5.11660231628418,18.499868614387513L5.115252316284179,18.498468614387512L2.7755723162841797,18.498468614387512C2.5973913162841797,18.498468614387512,2.50815731628418,18.71396861438751,2.6341503162841797,18.839968614387512L7.101052316284179,23.30686861438751C7.17916231628418,23.384968614387514,7.30579231628418,23.384968614387514,7.383902316284179,23.30686861438751L8.51515231628418,22.17556861438751C8.59330231628418,22.097468614387513,8.593252316284179,21.970668614387513,8.51503231628418,21.89256861438751L7.11995231628418,20.499868614387513L21.79995231628418,20.499868614387513C21.91045231628418,20.499868614387513,21.99995231628418,20.410268614387512,21.99995231628418,20.299868614387513L21.99995231628418,9.623458614387513C21.99995231628418,9.547708614387512,21.95715231628418,9.478458614387511,21.889352316284178,9.444578614387511L20.28935231628418,8.644578614387513C20.15645231628418,8.578088614387513,19.99995231628418,8.674788614387513,19.99995231628418,8.823458614387512Z" fill-rule="evenodd" fill="#4D5258" fill-opacity="1"/></g></g></svg>
\ No newline at end of file
... ...
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="none" version="1.1" width="24" height="24" viewBox="0 0 24 24"><g><g><path d="M6.915255046875,4.7314907592749025L11.848588046875001,5.964826319274902C11.937618046875,5.987086319274902,12.000078046875,6.067076319274903,12.000078046875,6.158856319274903L12.000078046875,28.413216319274902C12.000078046875,28.5433163192749,11.877808046875,28.638816319274902,11.751578046875,28.6072163192749L6.818241046875,27.3739163192749C6.729207546875,27.351616319274903,6.666748046875,27.2716163192749,6.666748046875,27.179916319274902L6.666748046875,4.925519319274902C6.666748046875,4.795405019274902,6.789026046875,4.6999334192749025,6.915255046875,4.7314907592749025M20.248548046875,4.7314907592749025L25.181848046875,5.964826319274902C25.270848046875,5.987086319274902,25.333348046875,6.067076319274903,25.333348046875,6.158856319274903L25.333348046875,28.413216319274902C25.333348046875,28.5433163192749,25.211048046875,28.638816319274902,25.084848046875,28.6072163192749L20.151448046875,27.3739163192749C20.062448046874998,27.351616319274903,20.000048046875,27.2716163192749,20.000048046875,27.179916319274902L20.000048046875,4.925519319274902C20.000048046875,4.795405019274902,20.122248046875,4.6999334192749025,20.248548046875,4.7314907592749025" fill-rule="evenodd" fill="#FFFFFF" fill-opacity="1"/></g></g></svg>
\ No newline at end of file
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1712048425819" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="13530" width="32" height="32" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M893.035 463.821679C839.00765 429.699141 210.584253 28.759328 179.305261 8.854514 139.495634-16.737389 99.686007 17.385148 99.686007 57.194775v909.934329c0 45.496716 42.653172 68.245075 76.775709 48.340262 45.496716-28.435448 676.763657-429.375262 716.573284-454.967165 34.122537-22.748358 34.122537-76.775709 0-96.680522z" fill="#FFFFFF" p-id="13531"></path></svg>
\ No newline at end of file
... ...
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="none" version="1.1" width="32" height="32" viewBox="0 0 32 32"><g><g><path d="M6.915255046875,4.7314907592749025L11.848588046875001,5.964826319274902C11.937618046875,5.987086319274902,12.000078046875,6.067076319274903,12.000078046875,6.158856319274903L12.000078046875,28.413216319274902C12.000078046875,28.5433163192749,11.877808046875,28.638816319274902,11.751578046875,28.6072163192749L6.818241046875,27.3739163192749C6.729207546875,27.351616319274903,6.666748046875,27.2716163192749,6.666748046875,27.179916319274902L6.666748046875,4.925519319274902C6.666748046875,4.795405019274902,6.789026046875,4.6999334192749025,6.915255046875,4.7314907592749025M20.248548046875,4.7314907592749025L25.181848046875,5.964826319274902C25.270848046875,5.987086319274902,25.333348046875,6.067076319274903,25.333348046875,6.158856319274903L25.333348046875,28.413216319274902C25.333348046875,28.5433163192749,25.211048046875,28.638816319274902,25.084848046875,28.6072163192749L20.151448046875,27.3739163192749C20.062448046874998,27.351616319274903,20.000048046875,27.2716163192749,20.000048046875,27.179916319274902L20.000048046875,4.925519319274902C20.000048046875,4.795405019274902,20.122248046875,4.6999334192749025,20.248548046875,4.7314907592749025" fill-rule="evenodd" fill="#FFFFFF" fill-opacity="1"/></g></g></svg>
\ No newline at end of file
... ...
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="none" version="1.1" width="28.000001907348633" height="28.000001907348633" viewBox="0 0 28.000001907348633 28.000001907348633"><g style="opacity:0.20000000298023224;"><g></g><g><path d="M3.5,25.08349609375L3.5,2.91682909375Q3.5,2.85937609375,3.5112086,2.80302709375Q3.5224172,2.74667709375,3.5444036,2.6935970937500002Q3.56639,2.6405170937499998,3.5983094,2.59274709375Q3.630229,2.54497609375,3.670854,2.50435009375Q3.71148,2.46372509375,3.759251,2.43180549375Q3.8070209999999998,2.39988609375,3.8601010000000002,2.37789969375Q3.913181,2.35591329375,3.969531,2.34470469375Q4.02588,2.33349609375,4.083333,2.33349609375L23.9167,2.33349609375Q23.9741,2.33349609375,24.0305,2.34470469375Q24.0868,2.35591329375,24.1399,2.37789969375Q24.193,2.39988609375,24.2407,2.43180549375Q24.2885,2.46372509375,24.3291,2.50435009375Q24.3698,2.54497609375,24.4017,2.59274709375Q24.4336,2.6405170937499998,24.4556,2.6935970937500002Q24.4776,2.74667709375,24.4888,2.80302709375Q24.5,2.85937609375,24.5,2.91682909375L24.5,15.16649609375L22.1666,15.16649609375L22.1666,4.66650609375L5.83325,4.66650609375L5.83325,23.33319609375L14,23.33319609375L14,25.66679609375L4.083333,25.66679609375Q4.02588,25.66679609375,3.969531,25.65559609375Q3.913181,25.64439609375,3.8601010000000002,25.62239609375Q3.8070209999999998,25.60039609375,3.759251,25.56849609375Q3.71148,25.53659609375,3.670854,25.49599609375Q3.630229,25.45539609375,3.5983094,25.40759609375Q3.56639,25.35979609375,3.5444036,25.30669609375Q3.5224172,25.25369609375,3.5112086,25.19729609375Q3.5,25.14099609375,3.5,25.08349609375Z" fill-rule="evenodd" fill="#4D5258" fill-opacity="1"/></g><g><path d="M9.333251953125,11.43447265625C9.333251953125,11.56334265625,9.437718953125,11.66780265625,9.566584953125,11.66780265625L17.355711953125002,11.66780265625C17.444091953125,11.66780265625,17.524881953125,11.61787265625,17.564411953125,11.53882265625L18.497741953125,9.67215565625C18.575311953125002,9.51701265625,18.462501953125,9.33447265625,18.289041953125,9.33447265625L9.566584953125,9.33447265625C9.437718953125,9.33447265625,9.333251953125,9.43893965625,9.333251953125,9.56780565625L9.333251953125,11.43447265625Z" fill="#4D5258" fill-opacity="1"/></g><g><path d="M9.333251953125,16.68203125C9.333251953125,16.81090125,9.437718953125,16.91536125,9.566584953125,16.91536125L14.439041953124999,16.91536125C14.527421953125,16.91536125,14.608221953125,16.86543125,14.647741953125,16.786381249999998L15.581081953125,14.91971425C15.658651953125,14.76457125,15.545831953124999,14.58203125,15.372381953125,14.58203125L9.566584953125,14.58203125C9.437718953125,14.58203125,9.333251953125,14.68649825,9.333251953125,14.81536425L9.333251953125,16.68203125Z" fill="#4D5258" fill-opacity="1"/></g><g><path d="M17.588956390625,19.15734328125L20.566870390625,19.16774328125L20.548890390625,24.31857328125L19.458060390625,24.314763281250002L19.471360390625,20.50559328125C19.471810390625,20.37673328125,19.367710390625,20.27190328125,19.238840390625,20.27145328125L18.346340390625,20.26833328125C18.217470390625,20.26788328125,18.112640390625,20.37198328125,18.112190390625,20.50085328125L18.098890390625,24.31002328125L17.054726390625,24.30637328125C16.925861390625,24.30592328125,16.821030110625,24.410023281249998,16.820580290625,24.53889328125L16.817464871625,25.43139328125C16.817015045625,25.560263281250002,16.921116390625,25.66509328125,17.049982390625,25.66554328125L24.933730390625,25.693063281249998C25.062600390625,25.69351328125,25.167430390625,25.58941328125,25.167880390625,25.46054328125L25.171000390625,24.56804328125C25.171450390624997,24.43917328125,25.067340390625,24.33434328125,24.938480390625,24.33389328125L21.934310390625,24.323413281249998L21.941450390625,22.27882328125L24.105620390625,22.28638328125C24.234480390625002,22.28683328125,24.339310390625002,22.18272328125,24.339760390625,22.05386328125L24.342820390625,21.17886328125C24.343270390625,21.04999328125,24.239170390625,20.94516328125,24.110300390625,20.94471328125L21.946130390625,20.93716328125L21.952290390625002,19.17257328125L24.588960390625,19.18178328125C24.717820390625,19.18223328125,24.822660390625,19.07812328125,24.823100390625,18.94926328125L24.826220390625,18.05675828125C24.826670390625,17.92789328125,24.722570390625002,17.82306218125,24.593700390625,17.82261228125L17.593700390625,17.79817776225C17.464835390625,17.79772793625,17.360004390625,17.90182928125,17.359554390625,18.03069528125L17.356439390625,18.92320328125C17.355989390625,19.05206328125,17.460090390625,19.15689328125,17.588956390625,19.15734328125Z" fill-rule="evenodd" fill="#4D5258" fill-opacity="1"/></g></g></svg>
\ No newline at end of file
... ...
... ... @@ -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"
}
}
],
... ...
... ... @@ -32,4 +32,6 @@ export { SystemUtils } from './src/main/ets/utils/SystemUtils'
export { PermissionUtil } from './src/main/ets/utils/PermissionUtil'
export { UserDataLocal } from './src/main/ets/utils/UserDataLocal'
\ No newline at end of file
export { UserDataLocal } from './src/main/ets/utils/UserDataLocal'
export { NumberFormatterUtils } from './src/main/ets/utils/NumberFormatterUtils'
\ No newline at end of file
... ...
import { StringUtils } from './StringUtils';
import getLunar from './GetLunar'
/**
* 日期/时间工具
*/
... ... @@ -457,6 +457,15 @@ export class DateTimeUtils {
return timeStr;
}
/**
* 获取农历日期
* @param _date eg: '2024-02-01 12:12:12' or '2024-02-01' 如果不传,取当前时间
* @returns eg: '二月廿五'
* 如果后面有其他农历需求,可以引入农历插件。这个引入的getLunar文件可以删除
*/
static getLunar(_date?: string) {
return getLunar(_date)
}
}
// const dateTimeUtils = new DateTimeUtils()
\ No newline at end of file
... ...
/**
* 获取某个日期的农历
* @parmas {newDate} 日期 年-月-日
*/
export default function getLunar(newDate){
var nyear;
var nmonth;
var nday = -1;
var nwday;
var nhrs;
var nmin;
var nsec;
var newDate = newDate;
var lmonth, lday, lleap; //农历参数
function Draw() {
NewTick();
//显示时间
var s = nyear + '年' + nmonth + '月' + nday + '日 ' + '星期' + cweekday(nwday) + ' ' + shapetime(nhrs, nmin, nsec);
s += " 农历" + lmonth + "月" + lday; //农历
var lunar_month_day=lmonth + "月" + lday;
return lunar_month_day;
}
function NewTick() {
console.warn('noww---', newDate)
var noww = newDate ? new Date(newDate) : new Date();
if (noww.getDate() != nday) {
nyear = noww.getFullYear();
nmonth = noww.getMonth() + 1;
nwday = noww.getDay();
nday = noww.getDate();
getlunar(); //获取农历
}
nhrs = noww.getHours();
nmin = noww.getMinutes();
nsec = noww.getSeconds();
}
//辅助函数
var hzWeek = new Array("日", "一", "二", "三", "四", "五", "六", "日");
function cweekday(wday) {
return hzWeek[wday];
}
function shapetime(vhrs, vmin, vsec) {
if (vsec <= 9) vsec = "0" + vsec;
if (vmin <= 9) vmin = "0" + vmin;
if (vhrs <= 9) vhrs = "0" + vhrs;
return vhrs + ":" + vmin + ":" + vsec
}
//农历函数开始
var lunarInfo = new Array(0x04bd8, 0x04ae0, 0x0a570, 0x054d5, 0x0d260, 0x0d950, 0x16554, 0x056a0, 0x09ad0, 0x055d2, 0x04ae0, 0x0a5b6, 0x0a4d0, 0x0d250, 0x1d255, 0x0b540, 0x0d6a0, 0x0ada2, 0x095b0, 0x14977, 0x04970, 0x0a4b0, 0x0b4b5, 0x06a50, 0x06d40, 0x1ab54, 0x02b60, 0x09570, 0x052f2, 0x04970, 0x06566, 0x0d4a0, 0x0ea50, 0x06e95, 0x05ad0, 0x02b60, 0x186e3, 0x092e0, 0x1c8d7, 0x0c950, 0x0d4a0, 0x1d8a6, 0x0b550, 0x056a0, 0x1a5b4, 0x025d0, 0x092d0, 0x0d2b2, 0x0a950, 0x0b557, 0x06ca0, 0x0b550, 0x15355, 0x04da0, 0x0a5b0, 0x14573, 0x052b0, 0x0a9a8, 0x0e950, 0x06aa0, 0x0aea6, 0x0ab50, 0x04b60, 0x0aae4, 0x0a570, 0x05260, 0x0f263, 0x0d950, 0x05b57, 0x056a0, 0x096d0, 0x04dd5, 0x04ad0, 0x0a4d0, 0x0d4d4, 0x0d250, 0x0d558, 0x0b540, 0x0b6a0, 0x195a6, 0x095b0, 0x049b0, 0x0a974, 0x0a4b0, 0x0b27a, 0x06a50, 0x06d40, 0x0af46, 0x0ab60, 0x09570, 0x04af5, 0x04970, 0x064b0, 0x074a3, 0x0ea50, 0x06b58, 0x05ac0, 0x0ab60, 0x096d5, 0x092e0, //1990
0x0c960, 0x0d954, 0x0d4a0, 0x0da50, 0x07552, 0x056a0, 0x0abb7, 0x025d0, 0x092d0, 0x0cab5, 0x0a950, 0x0b4a0, 0x0baa4, 0x0ad50, 0x055d9, 0x04ba0, 0x0a5b0, 0x15176, 0x052b0, 0x0a930, 0x07954, 0x06aa0, 0x0ad50, 0x05b52, 0x04b60, 0x0a6e6, 0x0a4e0, 0x0d260, 0x0ea65, 0x0d530, 0x05aa0, 0x076a3, 0x096d0, 0x04bd7, 0x04ad0, 0x0a4d0, 0x1d0b6, 0x0d250, 0x0d520, 0x0dd45, 0x0b5a0, 0x056d0, 0x055b2, 0x049b0, 0x0a577, 0x0a4b0, 0x0aa50, 0x1b255, 0x06d20, 0x0ada0, 0x14b63);
function lYearDays(y) {
var i, sum = 348;
for (i = 0x8000; i > 0x8; i >>= 1) sum += (lunarInfo[y - 1900] & i) ? 1 : 0;
return (sum + leapDays(y));
}
function leapDays(y) {
if (leapMonth(y)) return ((lunarInfo[y - 1900] & 0x10000) ? 30 : 29);
else return (0);
}
function leapMonth(y) {
return (lunarInfo[y - 1900] & 0xf);
}
function monthDays(y, m) {
return ((lunarInfo[y - 1900] & (0x10000 >> m)) ? 30 : 29);
}
function Lunar(y, m, d) {
var i, leap = 0,
temp = 0;
var offset = (Date.UTC(y, m, d) - Date.UTC(1900, 0, 31)) / 86400000;
for (i = 1900; i < 2050 && offset > 0; i++) {
temp = lYearDays(i);
offset -= temp;
}
if (offset < 0) {
offset += temp;
i--;
}
this.year = i;
leap = leapMonth(i);
this.isLeap = false;
for (i = 1; i < 13 && offset > 0; i++) {
if (leap > 0 && i == (leap + 1) && this.isLeap == false) {--i;
this.isLeap = true;
temp = leapDays(this.year);
} else {
temp = monthDays(this.year, i);
}
if (this.isLeap == true && i == (leap + 1)) this.isLeap = false;
offset -= temp;
}
if (offset == 0 && leap > 0 && i == leap + 1) if (this.isLeap) {
this.isLeap = false;
} else {
this.isLeap = true; --i;
}
if (offset < 0) {
offset += temp; --i;
}
this.month = i;
this.day = offset + 1;
}
var nStr1 = new Array('', '一', '二', '三', '四', '五', '六', '七', '八', '九', '十', '十一', '十二');
var nStr2 = new Array('初', '十', '廿', '卅', '□');
function GetcDay(d) {
var s;
switch (d) {
case 10:
s = '初十';
break;
case 20:
s = '二十';
break;
case 30:
s = '三十';
break;
default:
s = nStr2[Math.floor(d / 10)];
s += nStr1[d % 10];
break;
}
return (s);
}
function GetcMon(m) {
if (m == 1) return '正';
else return nStr1[m];
}
function getlunar() {
var lObj = new Lunar(nyear, nmonth - 1, nday);
lmonth = GetcMon(lObj.month);
lday = GetcDay(lObj.day);
lleap = lObj.isLeap;
if (lleap == 1) {
lmonth = "闰" + lmonth;
}
}
//农历函数结束
return Draw();
}
\ No newline at end of file
... ...
export class NumberFormatterUtils {
/**
* 数据小于一万返回原数据,大于一万保留小数点后一位,加上万字
* @param num
* @returns
*/
static formatNumberWithWan(inputNumber: number | String): string {
const num = typeof inputNumber === 'number' ? inputNumber : Number(inputNumber);
if (isNaN(num) || num < 10000) {
return num.toString();
} else {
const wanUnit = num / 10000;
return `${wanUnit.toFixed(1)}万`;
}
}
}
\ No newline at end of file
... ...
... ... @@ -41,13 +41,33 @@ export class HttpUrlUtils {
/**
* 批查接口,查询互动相关数据,如收藏数、评论数等
*/
static readonly INTERACT_DATA_PATH: string = "/api/rmrb-contact/contact/zh/c/v2/content/interactData";
static readonly INTERACT_DATA_PATH: string = "/api/rmrb-contact/contact/zh/c/content/interactData";
// 多图(图集)详情页
/**
* 批量查询内容当前用户点赞、收藏状态
*/
static readonly INTERACT_DATA_STATUS: string = "/api/rmrb-interact/interact/zh/c/batchLikeAndCollect/status";
/**
* 点赞、取消点赞
*/
static readonly INTERACT_EXECUTELIKE: string = "/api/rmrb-interact/interact/zh/c/like/executeLike";
/**
* 收藏、取消收藏
*/
static readonly INTERACT_EXECUTECOLLECTRECORD: string = "/api/rmrb-interact/interact/zh/c/collect/executeCollcetRecord";
/**
* 关注号主
*/
static readonly INTERACT_ACCENTION_OPERATION: string = "/api/rmrb-interact/interact/zh/c/attention/operation";
/**
* 用户等级/积分-APP根据业务场景动态增减成长值(APP)
*/
static readonly USERPOINT_OPERATE: string = "/api/rmrb-user-point/auth/pointLevel/zh/operate";
/**
* 评论发布
*/
static readonly COMMENT_PUBLISH: string = "/api/rmrb-comment/comment/zh/c/publish";
/**
* 沉浸式視頻批量查詢20條數據
*/
static readonly RECOMMEND_VIDEOLIST: string = "/api/rmrb-bff-display-zh/recommend/zh/c/videoList";
... ... @@ -76,6 +96,14 @@ export class HttpUrlUtils {
*/
static readonly APPOINTMENT_QueryUserDetail_PATH: string = "/api/rmrb-user-center/user/zh/c/queryUserDetail";
/**
* 资料编辑 更新普通用户信息
*/
static readonly APPOINTMENT_editUserDetail_PATH: string = "/api/rmrb-user-center/user/zh/c/editUserDetail";
/**
* 资料编辑 更新普通用户名
*/
static readonly APPOINTMENT_editUserDetail1_PATH: string = "/api/rmrb-user-center/user/zh/c/completeUserInfo";
/**
/**
* 个人中心 关注列表详情
*/
... ... @@ -128,12 +156,10 @@ 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";
/**
* 点赞操作
*/
... ... @@ -153,7 +179,12 @@ 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_PRODUCT;
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 = ''
... ... @@ -169,8 +200,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())
... ... @@ -199,7 +230,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');
... ... @@ -227,7 +258,7 @@ export class HttpUrlUtils {
}
static getHost() {
return HttpUrlUtils.hostUrl;
return HttpUrlUtils._hostUrl;
}
private static getCity() {
... ... @@ -251,20 +282,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 '';
}
... ... @@ -327,55 +358,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;
}
... ... @@ -385,17 +416,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
}
... ... @@ -405,77 +436,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
}
... ...
... ... @@ -73,6 +73,8 @@ export function registerRouter() {
return WDRouterPage.morningEveningPaperPage
} else if (action.params?.pageID == "IMAGE_TEXT_DETAIL") {
return WDRouterPage.imageTextDetailPage
} else if (action.params?.pageID == "BroadcastPage") {
return WDRouterPage.broadcastPage
}
return undefined
})
... ...
... ... @@ -83,4 +83,7 @@ export class WDRouterPage {
// static loginProtocolPage = new WDRouterPage("wdLogin", "ets/pages/login/LoginProtocolWebview");
//播报页面
static broadcastPage = new WDRouterPage("phone", "ets/pages/broadcast/BroadcastPage");
}
... ...
... ... @@ -23,7 +23,19 @@ export { Pic } from './src/main/ets/bean/content/Pic'
export { InteractDataDTO } from './src/main/ets/bean/content/InteractDataDTO';
export { InteractDataStatusBean, PhotoListBean } from './src/main/ets/bean/detail/MultiPictureDetailPageDTO';
export {
PhotoListBean,
InputMethodProperty,
batchLikeAndCollectParams,
postBatchAttentionStatusParams,
postInteractBrowsOperateParams,
postBatchAttentionStatusResult,
batchLikeAndCollectResult,
postExecuteLikeParams,
postExecuteCollectRecordParams,
contentListParams,
postInteractAccentionOperateParams
} from './src/main/ets/bean/detail/MultiPictureDetailPageDTO';
export { InteractParam, ContentBean } from './src/main/ets/bean/content/InteractParam';
... ...
... ... @@ -28,5 +28,6 @@ export interface CompDTO {
sortValue: number;
subType: string;
imageScale: number; // 封面图比例 1-4:3, 2-16:9, 3-3:2
audioDataList: AudioDTO[]
audioDataList: AudioDTO[];
isSelect: boolean;
}
\ No newline at end of file
... ...
... ... @@ -2,11 +2,11 @@
* 批查接口查询互动相关数据,返回数据bean
*/
export interface InteractDataDTO {
collectNum: number;
commentNum: number;
collectNum: number | String;
commentNum: number | String;
contentId: string;
contentType: number;
likeNum: number;
likeNum: number | String;
readNum: number;
shareNum: number;
}
\ No newline at end of file
... ...
/**
* 点赞、已读、分享数量
*/
export interface InteractDataDTO {
collectNum: number;
commentNum: number;
contentType: number;
likeNum: number;
readNum: number;
shareNum: number;
contentId: string;
}
... ...
/*
* 多图(图集)详情
* */
// 批量查询内容当前用户点赞、收藏状态
export interface InteractDataStatusBean {
contentId: string;
contentType: number;
contentRelId: string;
relType: number;
likeStatus: number;
collectStatus: number;
}
// 【图文、图集稿件正文图片】图片信息数组
export interface PhotoListBean {
... ... @@ -17,4 +8,173 @@ export interface PhotoListBean {
width: number;
picPath: string;
picDesc: string;
}
export interface InputMethodProperty {
/**
* The name of input method
*
* @syscap SystemCapability.MiscServices.InputMethodFramework
* @since 8
* @deprecated since 9
* @useinstead inputMethod.InputMethodProperty#name
*/
readonly packageName: string;
/**
* The id of input method
*
* @syscap SystemCapability.MiscServices.InputMethodFramework
* @since 8
* @deprecated since 9
* @useinstead inputMethod.InputMethodProperty#id
*/
readonly methodId: string;
/**
* The name of input method
*
* @syscap SystemCapability.MiscServices.InputMethodFramework
* @since 9
*/
readonly name: string;
/**
* The id of input method
*
* @syscap SystemCapability.MiscServices.InputMethodFramework
* @since 9
*/
readonly id: string;
/**
* The label of input method
*
* @syscap SystemCapability.MiscServices.InputMethodFramework
* @since 9
*/
readonly label?: string;
/**
* The label id of input method
*
* @type { ?number }
* @syscap SystemCapability.MiscServices.InputMethodFramework
* @since 10
*/
readonly labelId?: number;
/**
* The icon of input method
*
* @syscap SystemCapability.MiscServices.InputMethodFramework
* @since 9
*/
readonly icon?: string;
/**
* The icon id of input method
*
* @type { ?number }
* @syscap SystemCapability.MiscServices.InputMethodFramework
* @since 9
*/
readonly iconId?: number;
/**
* The extra info of input method
*
* @type { object }
* @syscap SystemCapability.MiscServices.InputMethodFramework
* @since 9
*/
/**
* The extra info of input method
*
* @type { ?object }
* @syscap SystemCapability.MiscServices.InputMethodFramework
* @since 10
*/
extra?: object;
}
export interface IStatusContentList {
contentId: string;
// relType: string;
contentType: string;
// contentRelId: string;
}
export interface batchLikeAndCollectParams {
// userType: number;
// userId: string;
contentList: IStatusContentList[]
}
export interface postBatchAttentionStatusParamsItem {
creatorId: string;
}
export interface postBatchAttentionStatusParams {
creatorIds: postBatchAttentionStatusParamsItem[]
}
export interface postInteractBrowsOperateParamsContent {
browseTime: string;
contentId: string;
contentType: number;
}
export interface postInteractBrowsOperateParams {
delStatus: number;
contentList: postInteractBrowsOperateParamsContent[]
}
export interface postBatchAttentionStatusResult {
creatorId: string;
status: string;
userId: string;
}
export interface batchLikeAndCollectResult {
collectStatus: number;
contentType: string;
likeStatus: string;
relType: string;
contentId: string;
contentRelId: string;
}
export interface postExecuteLikeParams {
status: string;
contentId: string;
contentType: string;
relType?: string;
userName?: string;
title?: string;
contentRelId?: string;
userHeaderUrl?: string;
channelId?: string;
}
export interface postExecuteCollectRecordParamsItem {
contentId: string;
contentType: string;
relType?: string;
contentRelId?: string;
}
export interface postExecuteCollectRecordParams {
status: string;
contentList: postExecuteCollectRecordParamsItem[]
}
interface contentListItem {
contentId: string;
contentType: number;
}
export interface contentListParams {
contentList: contentListItem[];
}
export interface postInteractAccentionOperateParams {
attentionUserType: string;
attentionUserId: string;
attentionCreatorId: string;
// userType: number;
// userId: string;
status: number;
}
\ No newline at end of file
... ...
export interface ChannelInfo {
channelId: string;
channelLevel: string;
channelName: string;
channelSkin: string;
channelStrategy: string;
channelStyle: string;
pageId: string;
pageTopType: string;
pcStyle: string;
webBackgroundImgUrl: string;
}
\ No newline at end of file
... ...
import { Group } from './Group';
import { TopicInfo } from './TopicInfo';
import { ChannelInfo } from './ChannelInfo'
export interface PageInfoBean {
backIconUrl: string;
backgroundColor: string;
... ... @@ -8,7 +8,7 @@ export interface PageInfoBean {
baselineColor: string;
baselineCopywriting: string;
baselineShow: number;
// channelInfo?: any;
channelInfo?: ChannelInfo;
// cornersAdv?: any;
// cornersAdv2: any[];
description: string;
... ...
... ... @@ -53,3 +53,8 @@ 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"
export { BroadcastPageComponent } from "./src/main/ets/components/broadcast/BroadcastPageComponent"
... ...
import { Logger } from 'wdKit';
import { MultiPictureDetailViewModel } from '../viewmodel/MultiPictureDetailViewModel';
import { ContentDetailDTO } from 'wdBean';
import media from '@ohos.multimedia.media';
import { OperRowListView } from './view/OperRowListView';
import { WDPlayerController } from 'wdPlayer/Index';
const TAG = 'AudioDetailComponent'
interface Arr{
image:string,
title:string
}
@Component
export struct AudioDetailComponent {
private relId: string = ''
private contentId: string = ''
private relType: string = ''
private avPlayer?: media.AVPlayer;
@State playerController: WDPlayerController = new WDPlayerController();
private arr:Arr[]=[
{image:'clock',title:'定时'},
{image:'theOriginal',title:'原文'},
{image:'list',title:'列表'},
]
@State contentDetailData: ContentDetailDTO[] = [] as ContentDetailDTO[]//详情
@State coverImage:string = '' //封面图
@State newsTitle:string = '' //标题
@State audioUrl:string = '' //音频路径
@State duration:number = 0 //时长
@State outSetValueOne:number = 40 //播放进度
@State isPlay: boolean = false
async aboutToAppear() {
await this.getContentDetailData()
this.playerController.firstPlay(this.audioUrl);
this.playerController.onCanplay = () => {
this.playerController.play()
this.isPlay = true
}
this.playerController.onTimeUpdate = (nowSeconds, totalSeconds) =>{
console.log('现在时间',nowSeconds)
console.log('总时间',totalSeconds)
this.outSetValueOne = nowSeconds
this.duration = totalSeconds
}
}
onPageHide() {
this.playerController?.pause();
}
build() {
Row() {
Column() {
// 封面
Row() {
Image(this.coverImage)
.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() {
ForEach(this.arr,(item:Arr)=>{
Column() {
Image(item.image=='clock'?$r('app.media.clock_close'):item.image=='theOriginal'?$r('app.media.theOriginal_close'):item.image=='list'?$r('app.media.list_close'):'')
.width(28)
.height(28)
Text(item.title)
.fontColor('#4D5258')
.fontSize(12)
.lineHeight(16)
.margin(2)
}
})
}
.width('100%')
.padding({ left: 49, right: 49 })
.justifyContent(FlexAlign.SpaceBetween)
.margin({ top: 60 })
Column(){
// 进度条
Row(){
Slider({
value: this.outSetValueOne,
step: 1
})
.showTips(true)
.trackColor('rgba(0,0,0,0.5)')
.selectedColor('#ED2800')
.onChange((value: number, mode: SliderChangeMode) => {
console.log('滑块长度',value)
this.playerController?.setSeekTime(value, mode);
})
}
.width('100%')
.padding({left:24,right:24})
.margin({top:110})
// 播放按钮
Row(){
Column(){
Image($r('app.media.loop_close'))
.width(24)
.height(24)
Text('循环')
.fontColor('#4D5258')
.fontSize(12)
.lineHeight(16)
.margin(2)
}
Image($r('app.media.Backward_close'))
.width(24)
.height(24)
Stack({ alignContent: Alignment.Center }){
Image(this.isPlay?$r('app.media.suspend'):$r('app.media.playicon'))
.width(32)
.height(32)
}
.padding(28)
.backgroundColor('#4D5258')
.borderRadius(50)
.onClick(()=>{
if(this.isPlay){
this.playerController.pause()
}else{
this.playerController.play()
}
this.isPlay = !this.isPlay
})
Image($r('app.media.fastForward_close'))
.width(24)
.height(24)
Column(){
Image($r('app.media.doubleSpeed_close'))
.width(24)
.height(24)
Text('倍速')
.fontColor('#4D5258')
.fontSize(12)
.lineHeight(16)
.margin(2)
}
}
.width('100%')
.justifyContent(FlexAlign.SpaceBetween)
.margin({top:56})
.padding({left:32,right:32})
}
.layoutWeight(1)
OperRowListView()
}
}
}
private async getContentDetailData() {
try {
let data = await MultiPictureDetailViewModel.getDetailData(this.relId, this.contentId, this.relType)
this.contentDetailData = data;
console.log('音乐详情',JSON.stringify(this.contentDetailData))
this.newsTitle = this.contentDetailData[0].newsTitle
console.log('标题',JSON.stringify(this.newsTitle))
this.coverImage = this.contentDetailData[0].fullColumnImgUrls[0].url
console.log('封面图',JSON.stringify(this.coverImage))
this.duration = this.contentDetailData[0].audioList[0].duration
console.log('音频时长',JSON.stringify(this.duration))
this.audioUrl = this.contentDetailData[0].audioList[0].audioUrl
console.log('音频时长',JSON.stringify(this.audioUrl))
} catch (exception) {
console.log('请求失败',JSON.stringify(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%")
... ...
... ... @@ -5,9 +5,6 @@ const TAG = 'MultiPictureDetailPageComponent';
@Component
export struct MultiPictureDetailItemComponent {
private photoListLength: number = 1;
private index: number = 1;
private newsTitle: string = '';
private MultiPictureDetailItem: PhotoListBean = {} as PhotoListBean
... ... @@ -23,49 +20,11 @@ export struct MultiPictureDetailItemComponent {
.width('100%')
.aspectRatio(this.MultiPictureDetailItem.width / this.MultiPictureDetailItem.height)
.objectFit(ImageFit.Fill)
.interpolation(ImageInterpolation.High)
}
.height('100%')
.width('100%')
Row() {
Flex({
direction: FlexDirection.Column,
justifyContent: FlexAlign.Start
}) {
Text() {
Span(`${this.index + 1}`).fontSize(24).fontFamily('PingFang SC-Medium').fontWeight(500).lineHeight(28)
Span(`/${this.photoListLength}`).fontSize(14).fontFamily('PingFang SC-Medium').fontWeight(500).lineHeight(19)
}.fontColor(Color.White).margin(4)
Text(`${this.newsTitle}`).fontColor(Color.White).fontSize(16).fontFamily('PingFang SC-Semibold')
.fontWeight(600).lineHeight(24)
.margin ({
top: 4,
left: 0,
bottom: 4,
right: 0
})
Text(`${this.MultiPictureDetailItem.picDesc}`).fontColor(Color.White)
.fontSize(14).fontFamily('PingFang SC-Regular').fontWeight(400).lineHeight(22)
.textOverflow({ overflow: TextOverflow.Ellipsis })
.margin ({
top: 4,
left: 0,
bottom: 4,
right: 18
})
}
}
.width('100%')
.height(178)
.margin ({
top: 8,
left: 18,
bottom: 8,
right: 18
})
}
.backgroundColor(Color.Black)
.width('100%')
... ...
import { Logger } from 'wdKit';
import { ContentDetailDTO, PhotoListBean } from 'wdBean';
import {
ContentDetailDTO,
PhotoListBean,
postInteractBrowsOperateParams,
postBatchAttentionStatusParams,
postInteractAccentionOperateParams
} from 'wdBean';
import { MultiPictureDetailViewModel } from '../viewmodel/MultiPictureDetailViewModel';
import display from '@ohos.display';
import font from '@ohos.font';
import { OperRowListView } from './view/OperRowListView';
import { MultiPictureDetailItemComponent } from './MultiPictureDetailItemComponent';
import { DateTimeUtils } from 'wdKit/Index';
import { HttpUrlUtils } from 'wdNetwork/Index';
import { WDRouterPage, WDRouterRule } from 'wdRouter/Index';
import { PageRepository } from '../repository/PageRepository';
const TAG = 'MultiPictureDetailPageComponent';
... ... @@ -17,10 +27,11 @@ export struct MultiPictureDetailPageComponent {
private screenWidth: number = 0
private picWidth: number = 0
@State picHeight: number = 0
@State contentDetailData: ContentDetailDTO[] = [] as ContentDetailDTO[]
@State contentDetailData: ContentDetailDTO = {} as ContentDetailDTO
@Provide @Watch('onCurrentPageNumUpdated') currentPageNum: string = '01'
private swiperController: SwiperController = new SwiperController()
@State swiperIndex: number = 0;
@Provide followStatus: string = '0' // 关注状态
//watch监听页码回调
onCurrentPageNumUpdated(): void {
... ... @@ -43,6 +54,10 @@ export struct MultiPictureDetailPageComponent {
familySrc: $rawfile('font/BebasNeue_Regular.otf')
})
this.getContentDetailData()
if (HttpUrlUtils.getUserId()) {
this.getInteractBrowsOperate()
this.getBatchAttentionStatus()
}
}
aboutToDisappear() {
... ... @@ -51,10 +66,10 @@ export struct MultiPictureDetailPageComponent {
build() {
RelativeContainer() {
if (this.contentDetailData && this.contentDetailData.length > 0 && this.contentDetailData[0].photoList && this.contentDetailData[0].photoList?.length > 0) {
if (this.contentDetailData?.photoList && this.contentDetailData?.photoList?.length > 0) {
Swiper(this.swiperController) {
ForEach(this.contentDetailData[0].photoList, (item: PhotoListBean, index: number) => {
MultiPictureDetailItemComponent({ photoListLength: this.contentDetailData[0].photoList?.length , index: index, newsTitle: this.contentDetailData[0].newsTitle, MultiPictureDetailItem: item })
ForEach(this.contentDetailData.photoList, (item: PhotoListBean) => {
MultiPictureDetailItemComponent({ MultiPictureDetailItem: item })
})
}
.index(this.swiperIndex)
... ... @@ -73,16 +88,140 @@ export struct MultiPictureDetailPageComponent {
.onChange((index: number) => {
this.swiperIndex = index
})
if(this.contentDetailData.rmhPlatform == 1) {
Row() {
Row(){
Row({space: 8}) {
Image(this.contentDetailData?.rmhInfo?.rmhHeadUrl)
.borderRadius('50%')
.alt($r('app.media.picture_loading'))
.width(36)
.height(36)
.objectFit(ImageFit.Fill)
.interpolation(ImageInterpolation.High)
}
.width('13%')
.height('100%')
Row() {
Flex({
direction: FlexDirection.Column,
justifyContent: FlexAlign.Start
}) {
Text(`${this.contentDetailData?.rmhInfo?.rmhName}`)
.fontColor(Color.White)
.fontSize(14)
.fontFamily('PingFang PingFang SC-Medium')
.fontWeight(500)
.lineHeight(17)
.margin(0)
Text(`${this.contentDetailData?.rmhInfo?.rmhDesc}`)
.fontColor('#676767')
.fontSize(12)
.fontFamily('PingFang SC-Regular')
.fontWeight(400)
.lineHeight(14)
.textOverflow({ overflow: TextOverflow.Clip })
.margin (0)
}
}
.width('81%')
.height('100%')
}
.width('74.4%')
.height('100%')
.margin({
top: 0,
bottom: 0,
left: 16,
right:0
})
if(this.followStatus == '0') {
Row(){
Button('+关注', { type: ButtonType.Normal, stateEffect: true })
.borderRadius(4)
.backgroundColor('#ED2800')
.width(48)
.height(24)
.onClick(() => {
this.handleAccention()
})
.margin({
top: 10,
bottom: 10,
left: 16,
right:16
})
.fontSize(12)
.fontColor(Color.White)
}
.width('21.6%')
.height('100%')
}
}
.width('100%')
.height(44)
.alignRules({
top: { anchor: "e_swiper_content", align: VerticalAlign.Top },
middle: { anchor: "e_swiper_content", align: HorizontalAlign.Center }
})
.id('e_attention')
}
Row() {
Flex({
direction: FlexDirection.Column,
justifyContent: FlexAlign.Start
}) {
Text() {
Span(`${this.swiperIndex + 1}`).fontSize(24).fontFamily('PingFang SC-Medium').fontWeight(500).lineHeight(28)
Span(`/${this.contentDetailData.photoList.length}`).fontSize(14).fontFamily('PingFang SC-Medium').fontWeight(500).lineHeight(19)
}.fontColor(Color.White).margin(4)
Text(`${this.contentDetailData.newsTitle}`).fontColor(Color.White).fontSize(16).fontFamily('PingFang SC-Semibold')
.fontWeight(600).lineHeight(24)
.margin ({
top: 4,
left: 0,
bottom: 4,
right: 0
})
Text(`${this.contentDetailData.photoList?.[this.swiperIndex].picDesc}`).fontColor(Color.White)
.fontSize(14).fontFamily('PingFang SC-Regular').fontWeight(400).lineHeight(22)
.textOverflow({ overflow: TextOverflow.Ellipsis })
.margin ({
top: 4,
left: 0,
bottom: 4,
right: 18
})
.maxLines(3)
}
}
.width('100%')
.height(178)
.margin ({
top: 8,
left: 18,
bottom: 8,
right: 18
})
.id('e_swiper_titles')
.alignRules({
bottom: { anchor: "e_swiper_content", align: VerticalAlign.Bottom },
middle: { anchor: "e_swiper_content", align: HorizontalAlign.Center }
})
OperRowListView({
contentDetailData: this.contentDetailData,
})
.alignRules({
bottom: { anchor: "__container__", align: VerticalAlign.Bottom },
middle: { anchor: "__container__", align: HorizontalAlign.Center }
})
.width('100%').height(56).margin(16)
.border({ width: {top: 0.5}, color: '#FFFFFF' })
.id('e_oper_row')
}
OperRowListView()
.alignRules({
bottom: { anchor: "__container__", align: VerticalAlign.Bottom },
middle: { anchor: "__container__", align: HorizontalAlign.Center }
})
.width('100%')
.height(56)
.border({ width: {top: 0.5}, color: '#FFFFFF' })
.id('e_oper_row')
}
.width('100%')
.height('100%')
... ... @@ -93,10 +232,70 @@ export struct MultiPictureDetailPageComponent {
private async getContentDetailData() {
try {
let data = await MultiPictureDetailViewModel.getDetailData(this.relId, this.contentId, this.relType)
this.contentDetailData = data;
this.contentDetailData = data?.[0];
Logger.info(TAG, `contentDetailData:${JSON.stringify(this.contentDetailData)}`)
} catch (exception) {
}
}
// 记录浏览历史
private getInteractBrowsOperate() {
try {
const params: postInteractBrowsOperateParams = {
delStatus: 0,
contentList: [{
browseTime: DateTimeUtils.getCurDate(DateTimeUtils.PATTERN_DATE_TIME_HYPHEN),
contentId: this.contentDetailData?.newsId + '',
contentType: this.contentDetailData?.newsType || 0,
}]
}
MultiPictureDetailViewModel.getInteractBrowsOperate(params).then(res => {
console.log(TAG, '记录浏览历史==', JSON.stringify(res.data))
})
} catch (exception) {
}
}
// 已登录->批量查作品是否被号主关注
private async getBatchAttentionStatus() {
try {
const params: postBatchAttentionStatusParams = {
creatorIds: [{ creatorId: this.contentDetailData?.rmhInfo?.rmhId ?? '' }]
}
let data = await MultiPictureDetailViewModel.getBatchAttentionStatus(params)
this.followStatus = data[0]?.status;
Logger.info(TAG, `followStatus:${JSON.stringify(this.followStatus)}`)
} catch (exception) {
}
}
/**
* 关注号主
*/
handleAccention() {
// 未登录,跳转登录
if (!HttpUrlUtils.getUserId()) {
WDRouterRule.jumpWithPage(WDRouterPage.loginPage)
return
}
const params: postInteractAccentionOperateParams = {
attentionUserType: this.contentDetailData?.rmhInfo?.userType || '', //被关注用户类型(1 普通用户 2 视频号 3 矩阵号)
attentionUserId: this.contentDetailData?.rmhInfo?.userId || '', // 被关注用户号主id
attentionCreatorId: this.contentDetailData?.rmhInfo?.rmhId || '', // 被关注用户号主id
// userType: 1,
// userId: '1',
status: 1,
}
PageRepository.postInteractAccentionOperate(params).then(res => {
console.log(TAG, '关注号主==', JSON.stringify(res.data))
if (this.followStatus == '1') {
this.followStatus = '0'
} else {
this.followStatus = '1'
}
})
}
}
\ No newline at end of file
... ...
import router from '@ohos.router';
import { Params } from 'wdBean'
import { RecommendHeader } from './RecommendHeader';
import { RecommendTitle } from './RecommendTitle';
import { RecommendLists } from './RecommendLists'
import { SelectedColumns } from './SelectedColumns'
import { CompList, PageInfoBean, CompInfoBean } from 'wdBean';
import { DateTimeUtils, Logger } from 'wdKit/Index';
import { PaperReaderSimpleDialog } from '../../dialog/PaperReaderDialog';
import { BroadcastViewModel } from '../../viewmodel/BroadcastViewModel';
import { DateFormatUtil, PlayerConstants, WDPlayerController } from 'wdPlayer';
import { AudioDataList } from 'wdBean/src/main/ets/bean/morningevening/AudioDataList';
import { CommonConstants } from 'wdConstant/Index';
const TAG = 'BroadcastPageComponent';
@Entry
@Component
export struct BroadcastPageComponent {
@State params:Params = router.getParams() as Params;
@State pageInfoBean: PageInfoBean = {} as PageInfoBean // 播报页面信息
@State compInfoBean: CompInfoBean = {} as CompInfoBean // 组件信息
@State recommendCompInfoBean: CompInfoBean = {} as CompInfoBean // 推荐播报组件信息
@State columnsCompInfoBean: CompInfoBean = {} as CompInfoBean // 精选栏目组件信息
@State compListItem: CompList = {} as CompList
@State audioPlayUrl: string = ""
@Provide title: string = ''
@Provide subTitle: string = ''
@Provide isAudioPlaying: boolean = false
@Provide status: number = PlayerConstants.STATUS_START;
@Provide currentTime: string = "00:00";
@Provide totalTime: string = "00:00";
@Provide progressVal: number = 0;
private audioDataList: AudioDataList[] = []
private playerController: WDPlayerController = new WDPlayerController();
simpleAudioDialog: CustomDialogController = new CustomDialogController({
builder: PaperReaderSimpleDialog({
cancel: this.onCancel,
confirm: this.onConfirm,
playerController: this.playerController
}),
autoCancel: false,
customStyle: true,
alignment: DialogAlignment.CenterStart,
offset: { dx: 12, dy: -150 },
})
onCancel() {
Logger.info(TAG, "cj2024 onCancel = ")
}
/**
* 回调无用
**/
onConfirm() {
Logger.info(TAG, "cj2024 onConfirm = ")
}
// 续播判断
changeContinue() {
Logger.info(TAG, "cj2024 changeContinue = 1")
this.playerController.continue = () => {
Logger.info(TAG, "cj2024 changeContinue = 2")
this.playerController?.stop();
}
return;
}
async aboutToAppear() {
Logger.debug(TAG, `about1ToAppear`, router.getParams().toString())
const currentTime = new Date().getTime()
try {
// 获取页面信息
Logger.warn('获取页面信息')
let pageInfoBean = await BroadcastViewModel.getBroadcastViewPageInfo('21003')
Logger.warn('pageInfoBean-')
Logger.warn(pageInfoBean.groups[0].blockDesc)
this.pageInfoBean = pageInfoBean;
//TODO 根据页面中组件信息。现在默认认为后端只返回2个。第一个是播报,第二个是精选栏目
const pageId = pageInfoBean.id,
groupId_0 = pageInfoBean.groups[0]?.id,
refreshTime = currentTime + "",
topicId = pageInfoBean?.topicInfo?.topicId || '',
channelId = pageInfoBean?.channelInfo?.channelId || ''
if(pageInfoBean.groups[0]) {
this.recommendCompInfoBean = await BroadcastViewModel.getBroadcastCompInfo(pageId, groupId_0, refreshTime, topicId, channelId)
}
if(pageInfoBean.groups[1]) {
const groupId_1 = pageInfoBean.groups[1]?.id
this.columnsCompInfoBean = await BroadcastViewModel.getBroadcastCompInfo(pageId, groupId_1, refreshTime, topicId, channelId)
}
} catch (exception) {
}
}
onPageShow() {
Logger.debug(TAG, `onPageShow--`, JSON.stringify(router.getParams()))
}
onPageHide() {
this.status = PlayerConstants.STATUS_PAUSE;
this.playerController?.pause();
}
build() {
Column() {
// 顶部标题
RecommendHeader()
List() {
ListItem(){
RecommendTitle()
}
if(this.pageInfoBean.groups && this.pageInfoBean.groups[0] && this.recommendCompInfoBean.compList) {
ListItem(){
RecommendLists({
recommendCompInfoBean: this.recommendCompInfoBean
})
}
}
if(this.pageInfoBean.groups && this.pageInfoBean.groups[1] && this.columnsCompInfoBean.compList) {
ListItem() {
SelectedColumns({
columnsCompTitle: this.pageInfoBean.groups[1].blockDesc,
columnsCompInfoBean: this.columnsCompInfoBean
})
.margin({ top: 12 })
}
}
}
.layoutWeight(1)
// @ts-ignore
.onScrollFrameBegin((offset, state) => {
console.log('ccc',String(offset), state)
})
.onReachStart(() => {
console.log('onReachStart----->',)
})
}
.width(CommonConstants.FULL_WIDTH)
.backgroundImage($r('app.media.broadcast_bg'))
.backgroundImageSize({width: '100%', height: '100%'})
}
}
\ No newline at end of file
... ...
import router from '@ohos.router';
import { CommonConstants } from 'wdConstant/Index';
/**
* 今日推荐顶部标题--fixed标题
*/
@Entry
@Component
export struct RecommendHeader {
build() {
Stack() {
Image($r('app.media.icon_arrow_down_black'))
.height($r('app.float.top_arrow_size'))
.width($r('app.float.top_arrow_size'))
.onClick((event: ClickEvent) => {
router.back()
})
.zIndex(1)
Text('今日推荐')
.margin({ left: 5 })
.fontSize($r('app.float.selected_text_size'))
.fontColor($r('app.color.color_222222'))
.width(CommonConstants.FULL_WIDTH)
.height(CommonConstants.FULL_HEIGHT)
.textAlign(TextAlign.Center)
}
.height($r('app.float.top_bar_height'))
.padding({left: 16, right: 16})
.alignContent(Alignment.Start)
}
}
\ No newline at end of file
... ...
import { CompInfoBean, CompDTO } from 'wdBean'
import { CommonConstants } from 'wdConstant';
import { ProcessUtils } from '../../utils/ProcessUtils';
/**
* 播报--今日推荐列表
*/
@Entry
@Component
export struct RecommendLists {
@Prop recommendCompInfoBean: CompInfoBean = {} as CompInfoBean // 推荐-组件信息
build() {
Column(){
ForEach(this.recommendCompInfoBean.compList.slice(0,3), (item: CompDTO) => {
this.recommendTop3Item(item)
})
// 查看更多
if(this.recommendCompInfoBean.compList.length > 3) {
Row() {
Text("查看全部")
.fontSize($r("app.float.font_size_12"))
.fontColor($r("app.color.color_222222"))
.margin({ right: 1 })
Image($r("app.media.more"))
.width(14)
.height(14)
}
.width(CommonConstants.FULL_WIDTH)
.height(40)
.borderRadius(3)
.justifyContent(FlexAlign.Center)
.margin({top: 5})
.onClick(() => {
// console.log(1)
})
}
}
.margin({left: 16, right: 16})
.padding({left: 16, right: 16})
.backgroundColor($r('app.color.color_fff'))
.borderRadius(5)
}
@Builder
recommendTop3Item(item: CompDTO) {
Row(){
Image($r('app.media.broadcast_pause'))
.width(24)
.height(24)
.margin({right:12})
Text(item.operDataList[0].newsTitle)
.fontSize($r('app.float.font_size_16'))
.fontColor($r('app.color.color_212228'))
.maxLines(1)
.textOverflow({overflow: TextOverflow.Ellipsis})
.layoutWeight(1)
}
.width(CommonConstants.FULL_WIDTH)
.padding({top: 12, bottom: 12})
.onClick(() => {
ProcessUtils.processPage(item.operDataList[0])
})
}
@Builder
recommendListItem() {
}
}
\ No newline at end of file
... ...
import { CommonConstants } from 'wdConstant/Index'
import { DateTimeUtils } from 'wdKit';
/**
* 播报标题描述
*/
@Entry
@Component
export struct RecommendTitle {
build() {
Row(){
// 左边
Column(){
Text('每日最动听的声音')
.fontSize($r('app.float.font_size_14'))
.fontColor($r('app.color.color_222222'))
.alignSelf(ItemAlign.Start)
Image($r('app.media.broadcast_line'))
.width(147)
.margin({
top: 8, bottom: 8
})
Row(){
Column(){
Text('今推')
.fontSize($r('app.float.font_size_24'))
.fontColor($r('app.color.color_222222'))
.fontWeight(600)
Text('日荐')
.fontSize($r('app.float.font_size_24'))
.fontColor($r('app.color.color_222222'))
.fontWeight(600)
}
.margin({right: 8})
.alignSelf(ItemAlign.Start)
Column() {
Text(DateTimeUtils.getLunar())
.fontSize($r('app.float.font_size_14'))
.fontColor($r('app.color.color_222222'))
.alignSelf(ItemAlign.Start)
Text(DateTimeUtils.formatDate(new Date().getTime(), 'MM/dd'))
.fontSize($r('app.float.font_size_24'))
.fontColor($r('app.color.color_222222'))
}
}
.alignSelf(ItemAlign.Start)
}
Blank()
Image($r('app.media.broadcast_pause'))
.width(90)
.height(90)
.margin({
right: 9
})
}
.width(CommonConstants.FULL_WIDTH)
.padding({left: 16, right: 16})
.margin({bottom: 12})
}
}
\ No newline at end of file
... ...
import { CompInfoBean, CompDTO } from 'wdBean'
import { DateTimeUtils } from 'wdKit/Index'
import { CommonConstants } from 'wdConstant';
import { ProcessUtils } from '../../utils/ProcessUtils';
/**
* 精选栏目
*/
@Entry
@Component
export struct SelectedColumns {
@Prop columnsCompInfoBean: CompInfoBean = {} as CompInfoBean // 精选栏目组件信息
@Prop columnsCompTitle: string = ''
build() {
Column(){
Text(this.columnsCompTitle)
.fontSize($r('app.float.selected_text_size'))
.fontColor($r('app.color.color_222222'))
.fontWeight(500)
.width(CommonConstants.FULL_WIDTH)
ForEach(this.columnsCompInfoBean.compList, (item: CompDTO) => {
this.SelectedColumnsItem(item)
})
}
.padding({left: 16,top: 12, right: 16})
.backgroundColor($r('app.color.white'))
}
@Builder
SelectedColumnsItem(item: CompDTO) {
Row() {
Image(item.operDataList[0].coverUrl)
.height(53)
.width(80)
.objectFit(ImageFit.Cover)
.margin({right: 12})
Column({space: 4}){
Text(item.operDataList[0].newsTitle)
.fontSize($r('app.float.font_size_16'))
.fontColor($r('app.color.color_222222'))
.width(CommonConstants.FULL_WIDTH)
.maxLines(1)
.textOverflow({overflow: TextOverflow.Ellipsis})
Text(item.operDataList[0].newsSummary)
.fontSize($r('app.float.font_size_12'))
.fontColor($r('app.color.color_999999'))
.width(CommonConstants.FULL_WIDTH)
.maxLines(1)
.textOverflow({overflow: TextOverflow.Ellipsis})
Row(){
Image($r('app.media.broadcast_clock'))
.width(12)
.height(12)
.margin({right: 4})
Text(DateTimeUtils.getCommentTime(Number.parseFloat(item.operDataList[0].publishTime)))
.fontSize($r('app.float.font_size_12'))
.fontColor($r('app.color.color_999999'))
.margin({ right :24 })
Image($r('app.media.broadcast_listen'))
.width(12)
.height(12)
.margin({right: 4})
Text('0')
.fontSize($r('app.float.font_size_12'))
.fontColor($r('app.color.color_999999'))
.margin({ right :24})
}
.width(CommonConstants.FULL_WIDTH)
}
.layoutWeight(1)
}
.onClick((event: ClickEvent) => {
// TODO 跳转到音频专题页
})
.width(CommonConstants.FULL_WIDTH)
.height(73)
}
}
\ No newline at end of file
... ...
... ... @@ -30,17 +30,18 @@ export default struct MinePageUserSimpleInfoUI {
build(){
Row(){
//头像
Stack({alignContent: Alignment.Center}){
Stack(){
Image(this.headPhotoUrl)
.alt($r('app.media.default_head'))
.width('108lpx')
.height('108lpx')
.objectFit(ImageFit.Auto)
.objectFit(ImageFit.Cover)
.borderRadius(50)
Image(this.levelHead)
.width('130lpx')
.height('130lpx')
.objectFit(ImageFit.Auto)
.objectFit(ImageFit.Cover)
.borderRadius(50)
}.width('130lpx')
.height('130lpx')
.alignContent(Alignment.Center)
... ...
... ... @@ -80,7 +80,7 @@ export struct FollowFirstTabsComponent{
this.currentIndex = index
})
.width('100%')
.height('100%')
.layoutWeight(1)
}.width('100%')
}
}
\ No newline at end of file
... ...
... ... @@ -23,14 +23,14 @@ export struct FollowSecondTabsComponent{
if(this.data != null){
if(this.data[this.firstIndex].children == null || this.data[this.firstIndex].children.length == 0){
FollowListDetailUI({creatorDirectoryId:this.data[this.firstIndex].id})
FollowListDetailUI({creatorDirectoryId:this.data[this.firstIndex].id}).layoutWeight(1)
}else{
this.FollowSecondUI()
}
}
}
.width('100%')
.height('100%')
.layoutWeight(1)
}
@Builder FollowSecondUI(){
... ...
... ... @@ -128,7 +128,7 @@ export struct HomePageBottomComponent{
List({ space: 3 }) {
LazyForEach(this.data_comment, (item: CommentListItem, index: number = 0) => {
ListItem() {
ChildCommentComponent({data: item})
ChildCommentComponent({data: item,isLastItem:index===this.data_comment.totalCount()-1})
}
.onClick(() => {
})
... ... @@ -158,7 +158,7 @@ export struct HomePageBottomComponent{
})
}
}
}.height('100%')
}.layoutWeight(1)
.justifyContent(FlexAlign.Start)
.width('100%')
}
... ... @@ -334,6 +334,7 @@ struct ChildFollowComponent {
@Component
struct ChildCommentComponent {
@ObjectLink data: CommentListItem
isLastItem: boolean = false
build() {
Column(){
... ... @@ -408,10 +409,12 @@ struct ChildCommentComponent {
.backgroundColor($r('app.color.color_F5F5F5'))
.margin({top:'19lpx',bottom:'31lpx'})
Divider().width('100%')
.height('12lpx')
.strokeWidth('12lpx')
.backgroundColor($r('app.color.color_F5F5F5'))
if(!this.isLastItem){
Divider().width('100%')
.height('12lpx')
.strokeWidth('12lpx')
.color($r('app.color.color_F5F5F5'))
}
}
.justifyContent(FlexAlign.Center)
... ...
... ... @@ -37,7 +37,7 @@ export struct OtherHomePageBottomCommentComponent{
List({ space: 3 }) {
LazyForEach(this.data_comment, (item: CommentListItem, index: number = 0) => {
ListItem() {
ChildCommentComponent({data: item,levelHead:this.levelHead})
ChildCommentComponent({data: item,levelHead:this.levelHead,isLastItem:index===this.data_comment.totalCount()-1})
}
.onClick(() => {
})
... ... @@ -68,6 +68,8 @@ export struct OtherHomePageBottomCommentComponent{
}
}
.width('100%')
.layoutWeight(1)
.justifyContent(FlexAlign.Start)
}
... ... @@ -143,6 +145,7 @@ export struct OtherHomePageBottomCommentComponent{
struct ChildCommentComponent {
@ObjectLink data: CommentListItem
@Prop levelHead:string
isLastItem: boolean = false
build() {
Column(){
... ... @@ -234,10 +237,12 @@ struct ChildCommentComponent {
.backgroundColor($r('app.color.color_F5F5F5'))
.margin({top:'19lpx',bottom:'31lpx'})
Divider().width('100%')
.height('12lpx')
.strokeWidth('12lpx')
.backgroundColor($r('app.color.color_F5F5F5'))
if(!this.isLastItem){
Divider().width('100%')
.height('12lpx')
.strokeWidth('12lpx')
.color($r('app.color.color_F5F5F5'))
}
}
.justifyContent(FlexAlign.Center)
... ...
import { CustomTitleUI } from '../reusable/CustomTitleUI'
import { CustomTitleAndEditUI } from '../reusable/CustomTitleAndEditUI'
import MyCollectionViewModel from '../../viewmodel/MyCollectionViewModel';
import PageModel from '../../viewmodel/PageModel';
import { CommonConstants, ViewType } from 'wdConstant'
... ... @@ -11,20 +11,31 @@ import LoadMoreLayout from './LoadMoreLayout'
import NoMoreLayout from './NoMoreLayout'
import { CompParser } from '../CompParser'
import CustomRefreshLoadLayout from './CustomRefreshLoadLayout';
import { listTouchEvent } from '../../utils/PullDownRefresh';
import { CustomSelectUI } from '../view/CustomSelectUI';
import { CustomBottomFuctionUI } from '../view/CustomBottomFuctionUI';
@Entry
@Component
struct BrowsingHistoryPage {
@State private browSingModel: PageModel = new PageModel()
isloading : boolean = false
@Provide isEditState:boolean = false
@State allDatas :CompDTO[] = [];
@State selectDatas :CompDTO[] = [];
@Provide deleteNum :number = 0;
@Provide isAllSelect:boolean = false
aboutToAppear(){
this.getData()
}
build() {
Column(){
CustomTitleUI({titleName:'浏览历史'})
CustomTitleAndEditUI({titleName:'浏览历史',isDisplayButton:true,editCallback:()=>{
this.allSelectDatas(false)
this.isAllSelect = false
this.selectDatas = []
this.deleteNum = 0
}})
if (this.browSingModel.viewType == ViewType.LOADING){
this.LoadingLayout()
}else if(this.browSingModel.viewType == ViewType.ERROR){
... ... @@ -34,16 +45,21 @@ struct BrowsingHistoryPage {
}else {
this.ListLayout()
}
if (this.isEditState){
CustomBottomFuctionUI({
selectAllCallback:(isAllSelect)=>{
this.allSelectDatas(isAllSelect)
},
confirmCallback:()=>{
this.deleteDatas()
}
})
.position({y:'92%'})
}
}
.width(CommonConstants.FULL_WIDTH)
.height(CommonConstants.FULL_HEIGHT)
.onTouch((event: TouchEvent | undefined) => {
if (event) {
if (this.browSingModel.viewType === ViewType.LOADED) {
listTouchEvent(this.browSingModel, event);
}
}
})
}
@Builder ListLayout() {
... ... @@ -56,11 +72,9 @@ struct BrowsingHistoryPage {
})
}
LazyForEach(this.browSingModel.compList, (compDTO: CompDTO, compIndex: number) => {
ForEach(this.allDatas, (compDTO: CompDTO, compIndex: number) => {
ListItem() {
Column() {
CompParser({ compDTO: compDTO, compIndex: compIndex });
}
this.newCompParser(compDTO,compIndex)
}
})
... ... @@ -79,6 +93,24 @@ struct BrowsingHistoryPage {
.height(CommonConstants.FULL_PARENT)
}
@Builder
newCompParser(compDTO: CompDTO, compIndex: number){
Row(){
if (this.isEditState){
CustomSelectUI({
isOn:compDTO.isSelect,
selectCallback:(isOn)=>{
this.addCompDTO(isOn,compDTO)
}
})
.margin({left:16})
}
Column() {
CompParser({ compDTO: compDTO, compIndex: compIndex })
}
}
}
@Builder LoadingLayout() {
CustomRefreshLoadLayout({ refreshBean: new RefreshLayoutBean(true,
$r('app.media.ic_pull_up_load'), $r('app.string.pull_up_load_text'), this.browSingModel.pullDownRefreshHeight) })
... ... @@ -89,7 +121,7 @@ struct BrowsingHistoryPage {
MyCollectionViewModel.newFetchMyCollectList(2,'1',this.browSingModel.currentPage,getContext(this)).then(pageDto => {
if (pageDto && pageDto.compList && pageDto.compList.length > 0) {
this.browSingModel.viewType = ViewType.LOADED;
this.browSingModel.compList.push(...pageDto.compList)
this.allDatas.push(...pageDto.compList)
if (pageDto.compList.length === this.browSingModel.pageSize) {
this.browSingModel.currentPage++;
this.browSingModel.hasMore = true;
... ... @@ -101,4 +133,49 @@ struct BrowsingHistoryPage {
}
})
}
}
\ No newline at end of file
//数据处理
//单个选择
addCompDTO(isOn:boolean , compDTO: CompDTO){
compDTO.isSelect = isOn;
if (isOn === true){
this.selectDatas.push(compDTO)
}else {
this.selectDatas.splice(this.selectDatas.indexOf(compDTO),1)
}
this.deleteNum = this.selectDatas.length
this.isAllSelect = this.deleteNum === this.allDatas.length?true:false;
}
//全选
allSelectDatas(isOn:boolean){
let datas: CompDTO[] = [];
for (let index = 0; index < this.allDatas.length; index++) {
const compDTO = this.allDatas[index];
compDTO.isSelect = isOn
datas.push(compDTO)
}
this.selectDatas = []
this.allDatas = []
if (isOn === true) {
this.selectDatas.push(...datas)
}else {
this.selectDatas.splice(0,this.deleteNum)
}
this.allDatas.push(...datas)
this.deleteNum = this.selectDatas.length
}
//删除
deleteDatas(){
for (let index = 0; index < this.selectDatas.length; index++) {
const compDTO = this.allDatas[index];
this.allDatas.splice(this.selectDatas.indexOf(compDTO),1)
}
//重置删除状态
this.isEditState = false
this.isAllSelect = false
}
}
... ...
... ... @@ -25,7 +25,7 @@ export struct CarouselLayout01CardView {
.width(CommonConstants.FULL_PARENT)
.height(CommonConstants.FULL_PARENT)
.objectFit(ImageFit.Cover)
.borderRadius($r("app.float.border_radius_6"))
// .borderRadius($r("app.float.border_radius_6"))
.alignRules({
top: { anchor: '__container__', align: VerticalAlign.Top },
left: { anchor: '__container__', align: HorizontalAlign.Start }
... ... @@ -45,7 +45,7 @@ export struct CarouselLayout01CardView {
// .id('img_corner_top_Left')
// }
Text(this.item.title)
Text(this.item.newsTitle)
.width(CommonConstants.FULL_PARENT)
.height(39)
.padding({ left: 8, right: 69, bottom: 8 })
... ...
import { TopNavDTO } from 'wdBean';
import curves from '@ohos.curves';
const INDEX_SETTING_TITLE: string = '首页设置'
const INDEX_SETTING_SUBTITLE: string = '将指定频道设置为首页'
const MY_CHANNEL: string = '我的频道'
const EDIT_TEXT: string = '编辑'
const EDIT_DOWN: string = '完成'
const MY_CHANNEL_TIP1: string = '点击进入频道'
const MY_CHANNEL_TIP2: string = '拖动调整频道顺序'
const MORE_CHANNEL: string = '更多频道'
const LOCAL_CHANNEL: string = '地方频道'
@CustomDialog
struct ChannelDialog {
@State indexSettingTabIndex: number = 1
@State dragItem: number = -1
@State item: number = -1
private dragRefOffsetX: number = 0
private dragRefOffsetY: number = 0
@State offsetX: number = 0
@State offsetY: number = 0
private FIX_VP_X: number = 80
private FIX_VP_Y: number = 48
@State indexSettingTabIndex: number = 0
@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>
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)
@State currentTopNavSelectedItem: TopNavDTO = {} as TopNavDTO
@Link currentTopNavSelectedIndex: number
@Link myChannelList: TopNavDTO[]
@Link moreChannelList: TopNavDTO[]
@Link localChannelList: TopNavDTO[]
@Link indexSettingArray: string[]
controller?: CustomDialogController
confirm: (index: number) => void = () => {
}
changeChannelIndex: (index1: number, index2: number) => void = () => {
}
delChannelItem: (index: number) => void = () => {
}
addChannelItem: (item: TopNavDTO) => void = () => {
}
aboutToAppear() {
this.currentTopNavSelectedItem = this.myChannelList[this.currentTopNavSelectedIndex]
}
itemMove(index: number, newIndex: number): void {
let targetItem = this.myChannelList[newIndex]
if (!(targetItem?.headlinesOn === 1 || targetItem?.movePermitted === 0 || targetItem?.homeChannel === '1')) {
this.changeChannelIndex(index, newIndex)
if (index <= this.currentTopNavSelectedIndex || newIndex <= this.currentTopNavSelectedIndex) {
// this.currentTopNavSelectedIndex = this.myChannelList.findIndex(ele => ele.channelId === currentTopNavSelectedItem.channelId)
}
}
if (item.localChannel === '1') {
this.localChannelList.unshift(item)
}
//向下滑
down(index: number): void {
console.info(`向下滑`)
this.offsetY -= this.FIX_VP_Y
this.dragRefOffsetY += this.FIX_VP_Y
this.itemMove(index, index + 4)
}
//向下滑(右下角为空)
down2(index: number): void {
this.offsetY -= this.FIX_VP_Y
this.dragRefOffsetY += this.FIX_VP_Y
this.itemMove(index, index + 4)
}
//向上滑
up(index: number): void {
console.info(`向上滑`)
this.offsetY += this.FIX_VP_Y
this.dragRefOffsetY -= this.FIX_VP_Y
this.itemMove(index, index - 4)
}
//向左滑
left(index: number): void {
console.info(`向左滑`)
this.offsetX += this.FIX_VP_X
this.dragRefOffsetX -= this.FIX_VP_X
this.itemMove(index, index - 1)
}
//向右滑
right(index: number): void {
console.info(`向右滑`)
this.offsetX -= this.FIX_VP_X
this.dragRefOffsetX += this.FIX_VP_X
this.itemMove(index, index + 1)
}
//向右下滑
lowerRight(index: number): void {
console.info(`向右下滑`)
this.offsetX -= this.FIX_VP_X
this.dragRefOffsetX += this.FIX_VP_X
this.offsetY -= this.FIX_VP_Y
this.dragRefOffsetY += this.FIX_VP_Y
this.itemMove(index, index + 5)
}
//向右上滑
upperRight(index: number): void {
console.info(`向右上滑`)
this.offsetX -= this.FIX_VP_X
this.dragRefOffsetX += this.FIX_VP_X
this.offsetY += this.FIX_VP_Y
this.dragRefOffsetY -= this.FIX_VP_Y
this.itemMove(index, index - 3)
}
//向左下滑
lowerLeft(index: number): void {
console.info(`向左下滑`)
this.offsetX += this.FIX_VP_X
this.dragRefOffsetX -= this.FIX_VP_X
this.offsetY -= this.FIX_VP_Y
this.dragRefOffsetY += this.FIX_VP_Y
this.itemMove(index, index + 3)
}
//向左上滑
upperLeft(index: number): void {
console.info(`向左上滑`)
this.offsetX += this.FIX_VP_X
this.dragRefOffsetX -= this.FIX_VP_X
this.offsetY += this.FIX_VP_Y
this.dragRefOffsetY -= this.FIX_VP_Y
this.itemMove(index, index - 5)
}
handleAnimationTo(item: TopNavDTO, event: GestureEvent) {
let index = this.myChannelList.findIndex(ele => ele.num === this.dragItem)
if (!(item.headlinesOn === 1 || item.movePermitted === 0 || item.homeChannel === '1') && this.isEditIng) {
this.offsetY = event.offsetY - this.dragRefOffsetY
this.offsetX = event.offsetX - this.dragRefOffsetX
if (this.offsetY >= this.FIX_VP_Y / 2 && (this.offsetX <= 44 && this.offsetX >= -44)
) {
//向下滑
this.down(index)
} else if (this.offsetY <= -this.FIX_VP_Y / 2 && (this.offsetX <= 44 && this.offsetX >= -44)
) {
//向上滑
this.up(index)
} else if (this.offsetX >= this.FIX_VP_X / 2 && (this.offsetY <= 20 && this.offsetY >= -20)
) {
//向右滑
this.right(index)
} else if (this.offsetX <= -this.FIX_VP_X / 2 && (this.offsetY <= 20 && this.offsetY >= -20)
) {
//向左滑
this.left(index)
} else if (this.offsetX >= this.FIX_VP_X / 2 && this.offsetY >= this.FIX_VP_Y / 2
) {
//向右下滑
this.lowerRight(index)
} else if (this.offsetX >= this.FIX_VP_X / 2 && this.offsetY <= -this.FIX_VP_Y / 2
) {
//向右上滑
this.upperRight(index)
} else if (this.offsetX <= -this.FIX_VP_X / 2 && this.offsetY >= this.FIX_VP_Y / 2
) {
//向左下滑
this.lowerLeft(index)
} else if (this.offsetX <= -this.FIX_VP_X / 2 && this.offsetY <= -this.FIX_VP_Y / 2
) {
//向左上滑
this.upperLeft(index)
} else if (this.offsetX >= this.FIX_VP_X / 2 && this.offsetY >= this.FIX_VP_Y / 2
) {
//向右下滑(右下角为空)
this.down2(index)
}
}
}
controller?: CustomDialogController
build() {
Column() {
Flex({ justifyContent: FlexAlign.SpaceBetween, alignItems: ItemAlign.Center }) {
Image($r('app.media.icon_ren_min_ri_bao'))
.width(72)
... ... @@ -45,7 +191,7 @@ struct ChannelDialog {
})
}
.width('100%')
.margin({ top: 30, bottom: 10 })
.padding({ bottom: 10 })
List() {
... ... @@ -59,6 +205,7 @@ struct ChannelDialog {
Text(INDEX_SETTING_SUBTITLE)
.fontSize(12)
.fontWeight(400)
.fontColor('#222222')
}
.width('100%')
.margin({ top: 22, bottom: 16 })
... ... @@ -68,16 +215,30 @@ struct ChannelDialog {
ListItem() {
Flex({ justifyContent: FlexAlign.SpaceBetween }) {
ForEach(this.indexSettingArray, (text: string, index: number) => {
Button(text, { type: ButtonType.Normal, stateEffect: false })
.width('48%')
.borderRadius(2)
.fontColor(index === this.indexSettingTabIndex ? '#ffffff' : '#ED2800')
.fontSize(16)
.fontWeight(400)
.backgroundColor(index === this.indexSettingTabIndex ? '#ED2800' : '#FDE9E5')
.onClick(() => {
this.indexSettingTabIndex = index
})
Stack() {
Image(this.indexSettingTabIndex === index ? $r('app.media.index_setting_button_active') : $r('app.media.index_setting_button'))
.objectFit(ImageFit.Auto)
.rotate({
angle: index === 1 ? 180 : 0
})
Row() {
if (index === 0) {
Image(this.indexSettingTabIndex === index ? $r('app.media.recommend_icon') : $r('app.media.recommend_icon_active'))
.width(20)
}
Text(text)
.textAlign(TextAlign.Center)
.fontSize(16)
.fontColor(index === this.indexSettingTabIndex ? '#ffffff' : '#ED2800')
}
.width('100%')
.justifyContent(FlexAlign.Center)
}
.alignContent(Alignment.Start)
.height(36)
.onClick(() => {
this.indexSettingTabIndex = index
})
})
}
.height(36)
... ... @@ -86,9 +247,17 @@ struct ChannelDialog {
ListItem() {
Row() {
Text(MY_CHANNEL)
.fontSize(16)
.fontWeight(600)
Row() {
Text(MY_CHANNEL)
.fontSize(16)
.fontWeight(600)
.margin({ right: 4 })
Text(!this.isEditIng ? MY_CHANNEL_TIP1 : MY_CHANNEL_TIP2)
.fontSize(12)
.fontWeight(400)
.fontColor('#222222')
}
Text(this.isEditIng ? EDIT_DOWN : EDIT_TEXT)
.fontSize(14)
.fontColor('#ED2800')
... ... @@ -101,14 +270,15 @@ struct ChannelDialog {
.margin({ bottom: 12 })
}
// 我的频道列表
ListItem() {
GridRow({ columns: 4, gutter: 10 }) {
Grid() {
ForEach(this.myChannelList, (item: TopNavDTO, index: number) => {
GridCol() {
GridItem() {
Row() {
Text(item.name)
.fontSize(14)
.fontColor( this.currentTopNavSelectedIndex === index ? '#ED2800' : (item.homeChannel === '1' ? '#999999' : '#222222'))
.fontColor(this.currentTopNavSelectedItem.channelId === item.channelId ? '#ED2800' : (item.homeChannel === '1' || item.movePermitted === 0 ? '#999999' : '#222222'))
if (this.isEditIng && item.myChannel !== '1') {
Image($r('app.media.icon_audio_close'))
... ... @@ -119,30 +289,63 @@ struct ChannelDialog {
.width('100%')
.height('100%')
.justifyContent(FlexAlign.Center)
.backgroundColor(item.homeChannel === '1' ? '#F5F5F5' : '')
.backgroundColor(item.homeChannel === '1' || item.movePermitted === 0 ? '#F5F5F5' : '#ffffff')
.onClick(() => {
if (this.isEditIng) {
if(item.myChannel !== '1'){
this.myChannelItemEditHandle(index)
if (item.myChannel !== '1') {
this.delChannelItem(index)
}
}else{
} else {
this.confirm(index)
this.controller?.close()
}
})
}
.width(80)
.width('23%')
.height(40)
.border({
width: item.homeChannel === '1' ? 0 : 1,
color: '#EDEDED',
radius: 3
})
.zIndex(this.dragItem == item.num ? 1 : 0)
.translate(this.dragItem == item.num ? { x: this.offsetX, y: this.offsetY } : { x: 0, y: 0 })
.gesture(
GestureGroup(GestureMode.Sequence,
PanGesture({ fingers: 1, direction: null, distance: 0 })
.onActionStart((event: GestureEvent) => {
this.dragItem = item.num
this.dragRefOffsetX = 0
this.dragRefOffsetY = 0
})
.onActionUpdate((event: GestureEvent) => {
animateTo({ curve: curves.interpolatingSpring(0, 1, 400, 38) }, () => {
this.handleAnimationTo(item, event)
})
})
.onActionEnd((event: GestureEvent) => {
animateTo({ curve: curves.interpolatingSpring(0, 1, 400, 38) }, () => {
this.dragItem = -1
})
})
)
.onCancel(() => {
animateTo({ curve: curves.interpolatingSpring(0, 1, 400, 38) }, () => {
this.dragItem = -1
})
}))
}, (item: TopNavDTO) => JSON.stringify(item))
}
.width('100%')
.margin({ bottom: 24 })
.columnsTemplate('1fr 1fr 1fr 1fr')
.columnsGap(8)
.rowsGap(8)
.height(Math.ceil(this.myChannelList.length / 4) * 48)
}
//更多频道列表
ListItem() {
Column() {
if (this.moreChannelList.length > 0) {
... ... @@ -168,7 +371,7 @@ struct ChannelDialog {
.width('100%').height('100%')
.justifyContent(FlexAlign.Center)
.onClick(() => {
this.myChannelList.push(this.moreChannelList.splice(index, 1)[0])
this.addChannelItem(this.moreChannelList.splice(index, 1)[0])
})
}
.width(80)
... ... @@ -186,6 +389,7 @@ struct ChannelDialog {
.width('100%')
}
//本地频道列表
ListItem() {
Column() {
if (this.localChannelList.length > 0) {
... ... @@ -211,7 +415,7 @@ struct ChannelDialog {
.width('100%').height('100%')
.justifyContent(FlexAlign.Center)
.onClick(() => {
this.myChannelList.push(this.localChannelList.splice(index, 1)[0])
this.addChannelItem(this.localChannelList.splice(index, 1)[0])
})
}
.width(80)
... ... @@ -229,311 +433,1634 @@ struct ChannelDialog {
}
}.width('100%').height('100%')
}
.padding(16)
.padding({ top: 40, right: 15, bottom: 20, left: 15 })
.backgroundColor('#ffffff')
}
onTopNavigationDataUpdated() {
}
}
@Entry
// @Entry
@Component
struct ChannelSubscriptionLayout {
@State indexSettingArray: string [] = ['推荐', '热点']
//当前选中的频道
@Prop currentTopNavSelectedIndex?: number;
@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[] = []
@Link currentTopNavSelectedIndex: number;
@Link myChannelList: TopNavDTO []
@Link moreChannelList: TopNavDTO []
@Link localChannelList: TopNavDTO []
@Link @Watch('onChannelIdsUpdate') channelIds: number []
changeTab: (index: number) => void = () => {
}
//频道弹窗点击切换频道
onAccept = (index: number) => {
this.changeTab(index)
}
//交换我的频道数组中的位置
changeChannelIndex = (index1: number, index2: number) => {
let tmp = this.myChannelList.splice(index1, 1)
let channelIdTmp = this.channelIds.splice(index1, 1)
this.myChannelList.splice(index2, 0, tmp[0])
this.channelIds.splice(index2, 0, channelIdTmp[0])
}
//删除频道
delChannelItem = (index: number) => {
let item = this.myChannelList.splice(index, 1)[0]
this.channelIds.splice(index, 1)
if (item.moreChannel === '1') {
this.moreChannelList.unshift(item)
}
if (item.localChannel === '1') {
this.localChannelList.unshift(item)
}
}
// 添加频道
addChannelItem = (item: TopNavDTO) => {
this.channelIds.push(item.channelId)
this.myChannelList.push(item)
}
// @State currentTopNavSelectedIndex: number = 0
// @State topNavList: TopNavDTO [] = [
// {
// channelId: 2001,
// channelStrategy: 1,
// channelStyle: 2,
// channelType: 1,
// defaultPermitted: 1,
// delPermitted: 0,
// fontCColor: "#FFFFFF",
// fontColor: "#F9AB99",
// headlinesOn: 0,
// homeChannel: "0",
// iconCUrl: "",
// iconCUrlSize: "",
// iconUrl: "",
// iconUrlSize: "",
// localChannel: "0",
// moreChannel: "0",
// movePermitted: 0,
// myChannel: "0",
// name: "推荐",
// num: 1,
// pageId: 20011,
// pageType: "",
// underlineCColor: ""
// },
// {
// channelId: 2002,
// channelStrategy: 2,
// channelStyle: 2,
// channelType: 1,
// defaultPermitted: 1,
// delPermitted: 0,
// fontCColor: "#FFFFFF",
// fontColor: "#F9AB99",
// headlinesOn: 0,
// homeChannel: "0",
// iconCUrl: "",
// iconCUrlSize: "",
// iconUrl: "",
// iconUrlSize: "",
// localChannel: "0",
// moreChannel: "0",
// movePermitted: 0,
// myChannel: "0",
// name: "热点",
// num: 2,
// pageId: 20012,
// pageType: "",
// underlineCColor: ""
// },
// {
// channelId: 2003,
// channelStrategy: 2,
// channelStyle: 2,
// channelType: 1,
// defaultPermitted: 0,
// delPermitted: 0,
// fontCColor: "#FFFFFF",
// fontColor: "#F9AB99",
// headlinesOn: 0,
// homeChannel: "0",
// iconCUrl: "",
// iconCUrlSize: "",
// iconUrl: "",
// iconUrlSize: "",
// localChannel: "0",
// moreChannel: "0",
// movePermitted: 1,
// myChannel: "0",
// name: "锐评",
// num: 3,
// pageId: 20013,
// pageType: "",
// underlineCColor: ""
// },
// {
// channelId: 2066,
// channelStrategy: 2,
// channelStyle: 3,
// channelType: 1,
// defaultPermitted: 0,
// delPermitted: 1,
// fontCColor: "#FFFFFF",
// fontColor: "#F9AB99",
// headlinesOn: 0,
// homeChannel: "0",
// iconCUrl: "",
// iconCUrlSize: "",
// iconUrl: "",
// iconUrlSize: "",
// localChannel: "0",
// moreChannel: "0",
// movePermitted: 1,
// myChannel: "0",
// name: "播报",
// num: 4,
// pageId: 21003,
// pageType: "",
// underlineCColor: ""
// },
// {
// channelId: 2006,
// channelStrategy: 2,
// channelStyle: 3,
// channelType: 1,
// defaultPermitted: 0,
// delPermitted: 0,
// fontCColor: "#FFFFFF",
// fontColor: "#F9AB99",
// headlinesOn: 0,
// homeChannel: "0",
// iconCUrl: "",
// iconCUrlSize: "",
// iconUrl: "",
// iconUrlSize: "",
// localChannel: "0",
// moreChannel: "0",
// movePermitted: 1,
// myChannel: "0",
// name: "版面",
// num: 5,
// pageId: 20016,
// pageType: "",
// underlineCColor: ""
// },
// {
// channelId: 2011,
// channelStrategy: 2,
// channelStyle: 2,
// channelType: 1,
// defaultPermitted: 0,
// delPermitted: 1,
// fontCColor: "#FFFFFF",
// fontColor: "#F9AB99",
// headlinesOn: 0,
// homeChannel: "0",
// iconCUrl: "",
// iconCUrlSize: "",
// iconUrl: "",
// iconUrlSize: "",
// localChannel: "0",
// moreChannel: "0",
// movePermitted: 1,
// myChannel: "0",
// name: "体育",
// num: 6,
// pageId: 20021,
// pageType: "",
// underlineCColor: ""
// },
// {
// channelId: 2020,
// channelStrategy: 1,
// channelStyle: 2,
// channelType: 1,
// defaultPermitted: 0,
// delPermitted: 1,
// fontCColor: "#FFFFFF",
// fontColor: "#F9AB99",
// headlinesOn: 0,
// homeChannel: "0",
// iconCUrl: "",
// iconCUrlSize: "",
// iconUrl: "",
// iconUrlSize: "",
// localChannel: "0",
// moreChannel: "0",
// movePermitted: 1,
// myChannel: "0",
// name: "国际",
// num: 7,
// pageId: 20030,
// pageType: "",
// underlineCColor: ""
// },
// {
// channelId: 2063,
// channelStrategy: 2,
// channelStyle: 2,
// channelType: 1,
// defaultPermitted: 0,
// delPermitted: 0,
// fontCColor: "#FFFFFF",
// fontColor: "#F9AB99",
// headlinesOn: 0,
// homeChannel: "0",
// iconCUrl: "",
// iconCUrlSize: "",
// iconUrl: "",
// iconUrlSize: "",
// localChannel: "0",
// moreChannel: "0",
// movePermitted: 0,
// myChannel: "0",
// name: "两会",
// num: 8,
// pageId: 21000,
// pageType: "",
// underlineCColor: ""
// },
// {
// channelId: 2072,
// channelStrategy: 2,
// channelStyle: 2,
// channelType: 1,
// defaultPermitted: 0,
// delPermitted: 0,
// fontCColor: "#FFFFFF",
// fontColor: "#F9AB99",
// headlinesOn: 0,
// homeChannel: "0",
// iconCUrl: "",
// iconCUrlSize: "",
// iconUrl: "",
// iconUrlSize: "",
// localChannel: "0",
// moreChannel: "0",
// movePermitted: 0,
// myChannel: "0",
// name: "亚运",
// num: 9,
// pageId: 21009,
// pageType: "",
// underlineCColor: ""
// },
// {
// channelId: 2015,
// channelStrategy: 1,
// channelStyle: 2,
// channelType: 1,
// defaultPermitted: 0,
// delPermitted: 1,
// fontCColor: "#FFFFFF",
// fontColor: "#F9AB99",
// headlinesOn: 0,
// homeChannel: "0",
// iconCUrl: "",
// iconCUrlSize: "",
// iconUrl: "",
// iconUrlSize: "",
// localChannel: "0",
// moreChannel: "0",
// movePermitted: 1,
// myChannel: "0",
// name: "科技",
// num: 10,
// pageId: 20025,
// pageType: "",
// underlineCColor: ""
// },
// {
// channelId: 2004,
// channelStrategy: 2,
// channelStyle: 2,
// channelType: 1,
// defaultPermitted: 0,
// delPermitted: 0,
// fontCColor: "#FFFFFF",
// fontColor: "#F9AB99",
// headlinesOn: 0,
// homeChannel: "0",
// iconCUrl: "",
// iconCUrlSize: "",
// iconUrl: "",
// iconUrlSize: "",
// localChannel: "0",
// moreChannel: "0",
// movePermitted: 1,
// myChannel: "0",
// name: "云课堂",
// num: 11,
// pageId: 20014,
// pageType: "",
// underlineCColor: ""
// },
// {
// channelId: 2005,
// channelStrategy: 2,
// channelStyle: 2,
// channelType: 1,
// defaultPermitted: 0,
// delPermitted: 0,
// fontCColor: "#FFFFFF",
// fontColor: "#F9AB99",
// headlinesOn: 0,
// homeChannel: "0",
// iconCUrl: "",
// iconCUrlSize: "",
// iconUrl: "",
// iconUrlSize: "",
// localChannel: "0",
// moreChannel: "0",
// movePermitted: 1,
// myChannel: "0",
// name: "文件",
// num: 12,
// pageId: 20015,
// pageType: "",
// underlineCColor: ""
// },
// {
// channelId: 2007,
// channelStrategy: 1,
// channelStyle: 2,
// channelType: 1,
// defaultPermitted: 0,
// delPermitted: 0,
// fontCColor: "#FFFFFF",
// fontColor: "#F9AB99",
// headlinesOn: 0,
// homeChannel: "0",
// iconCUrl: "",
// iconCUrlSize: "",
// iconUrl: "",
// iconUrlSize: "",
// localChannel: "0",
// moreChannel: "0",
// movePermitted: 1,
// myChannel: "0",
// name: "镜头",
// num: 13,
// pageId: 20017,
// pageType: "",
// underlineCColor: ""
// },
// {
// channelId: 2008,
// channelStrategy: 2,
// channelStyle: 2,
// channelType: 1,
// defaultPermitted: 0,
// delPermitted: 0,
// fontCColor: "#FFFFFF",
// fontColor: "#F9AB99",
// headlinesOn: 0,
// homeChannel: "0",
// iconCUrl: "",
// iconCUrlSize: "",
// iconUrl: "",
// iconUrlSize: "",
// localChannel: "0",
// moreChannel: "0",
// movePermitted: 1,
// myChannel: "0",
// name: "公益",
// num: 14,
// pageId: 20018,
// pageType: "",
// underlineCColor: ""
// },
// {
// channelId: 2009,
// channelStrategy: 1,
// channelStyle: 2,
// channelType: 1,
// defaultPermitted: 0,
// delPermitted: 1,
// fontCColor: "#FFFFFF",
// fontColor: "#F9AB99",
// headlinesOn: 0,
// homeChannel: "0",
// iconCUrl: "",
// iconCUrlSize: "",
// iconUrl: "",
// iconUrlSize: "",
// localChannel: "0",
// moreChannel: "0",
// movePermitted: 1,
// myChannel: "0",
// name: "社会",
// num: 15,
// pageId: 20019,
// pageType: "",
// underlineCColor: ""
// },
// {
// channelId: 2010,
// channelStrategy: 1,
// channelStyle: 2,
// channelType: 1,
// defaultPermitted: 0,
// delPermitted: 1,
// fontCColor: "#FFFFFF",
// fontColor: "#F9AB99",
// headlinesOn: 0,
// homeChannel: "0",
// iconCUrl: "",
// iconCUrlSize: "",
// iconUrl: "",
// iconUrlSize: "",
// localChannel: "0",
// moreChannel: "0",
// movePermitted: 1,
// myChannel: "0",
// name: "财经",
// num: 16,
// pageId: 20020,
// pageType: "",
// underlineCColor: ""
// },
// {
// channelId: 2012,
// channelStrategy: 1,
// channelStyle: 2,
// channelType: 1,
// defaultPermitted: 0,
// delPermitted: 1,
// fontCColor: "#FFFFFF",
// fontColor: "#F9AB99",
// headlinesOn: 0,
// homeChannel: "0",
// iconCUrl: "",
// iconCUrlSize: "",
// iconUrl: "",
// iconUrlSize: "",
// localChannel: "0",
// moreChannel: "0",
// movePermitted: 1,
// myChannel: "0",
// name: "文化",
// num: 17,
// pageId: 20022,
// pageType: "",
// underlineCColor: ""
// },
// {
// channelId: 2013,
// channelStrategy: 1,
// channelStyle: 2,
// channelType: 1,
// defaultPermitted: 0,
// delPermitted: 1,
// fontCColor: "#FFFFFF",
// fontColor: "#F9AB99",
// headlinesOn: 0,
// homeChannel: "0",
// iconCUrl: "",
// iconCUrlSize: "",
// iconUrl: "",
// iconUrlSize: "",
// localChannel: "0",
// moreChannel: "0",
// movePermitted: 1,
// myChannel: "0",
// name: "教育",
// num: 18,
// pageId: 20023,
// pageType: "",
// underlineCColor: ""
// },
// {
// channelId: 2014,
// channelStrategy: 1,
// channelStyle: 2,
// channelType: 1,
// defaultPermitted: 0,
// delPermitted: 1,
// fontCColor: "#FFFFFF",
// fontColor: "#F9AB99",
// headlinesOn: 0,
// homeChannel: "0",
// iconCUrl: "",
// iconCUrlSize: "",
// iconUrl: "",
// iconUrlSize: "",
// localChannel: "0",
// moreChannel: "0",
// movePermitted: 1,
// myChannel: "0",
// name: "军事",
// num: 19,
// pageId: 20024,
// pageType: "",
// underlineCColor: ""
// },
// {
// channelId: 2017,
// channelStrategy: 2,
// channelStyle: 2,
// channelType: 1,
// defaultPermitted: 0,
// delPermitted: 1,
// fontCColor: "#FFFFFF",
// fontColor: "#F9AB99",
// headlinesOn: 0,
// homeChannel: "0",
// iconCUrl: "",
// iconCUrlSize: "",
// iconUrl: "",
// iconUrlSize: "",
// localChannel: "0",
// moreChannel: "0",
// movePermitted: 1,
// myChannel: "0",
// name: "健康",
// num: 20,
// pageId: 20027,
// pageType: "",
// underlineCColor: ""
// },
// {
// channelId: 2019,
// channelStrategy: 1,
// channelStyle: 2,
// channelType: 1,
// defaultPermitted: 0,
// delPermitted: 1,
// fontCColor: "#FFFFFF",
// fontColor: "#F9AB99",
// headlinesOn: 0,
// homeChannel: "0",
// iconCUrl: "",
// iconCUrlSize: "",
// iconUrl: "",
// iconUrlSize: "",
// localChannel: "0",
// moreChannel: "0",
// movePermitted: 1,
// myChannel: "0",
// name: "房产",
// num: 21,
// pageId: 20029,
// pageType: "",
// underlineCColor: ""
// },
// {
// channelId: 2018,
// channelStrategy: 1,
// channelStyle: 2,
// channelType: 1,
// defaultPermitted: 0,
// delPermitted: 1,
// fontCColor: "#FFFFFF",
// fontColor: "#F9AB99",
// headlinesOn: 0,
// homeChannel: "0",
// iconCUrl: "",
// iconCUrlSize: "",
// iconUrl: "",
// iconUrlSize: "",
// localChannel: "0",
// moreChannel: "0",
// movePermitted: 1,
// myChannel: "0",
// name: "汽车",
// num: 22,
// pageId: 20028,
// pageType: "",
// underlineCColor: ""
// },
// {
// channelId: 2065,
// channelStrategy: 2,
// channelStyle: 2,
// channelType: 1,
// defaultPermitted: 0,
// delPermitted: 0,
// fontCColor: "#FFFFFF",
// fontColor: "#F9AB99",
// headlinesOn: 0,
// homeChannel: "0",
// iconCUrl: "",
// iconCUrlSize: "",
// iconUrl: "",
// iconUrlSize: "",
// localChannel: "0",
// moreChannel: "0",
// movePermitted: 1,
// myChannel: "0",
// name: "三农",
// num: 24,
// pageId: 21002,
// pageType: "",
// underlineCColor: ""
// },
// {
// channelId: 2024,
// channelStrategy: 1,
// channelStyle: 2,
// channelType: 1,
// defaultPermitted: 0,
// delPermitted: 1,
// fontCColor: "#FFFFFF",
// fontColor: "#F9AB99",
// headlinesOn: 0,
// homeChannel: "0",
// iconCUrl: "",
// iconCUrlSize: "",
// iconUrl: "",
// iconUrlSize: "",
// localChannel: "0",
// moreChannel: "0",
// movePermitted: 1,
// myChannel: "0",
// name: "家居",
// num: 25,
// pageId: 20034,
// pageType: "",
// underlineCColor: ""
// },
// {
// channelId: 2021,
// channelStrategy: 1,
// channelStyle: 2,
// channelType: 1,
// defaultPermitted: 0,
// delPermitted: 1,
// fontCColor: "#FFFFFF",
// fontColor: "#F9AB99",
// headlinesOn: 0,
// homeChannel: "0",
// iconCUrl: "",
// iconCUrlSize: "",
// iconUrl: "",
// iconUrlSize: "",
// localChannel: "0",
// moreChannel: "0",
// movePermitted: 1,
// myChannel: "0",
// name: "法治",
// num: 27,
// pageId: 20031,
// pageType: "",
// underlineCColor: ""
// },
// {
// channelId: 2022,
// channelStrategy: 1,
// channelStyle: 2,
// channelType: 1,
// defaultPermitted: 0,
// delPermitted: 1,
// fontCColor: "#FFFFFF",
// fontColor: "#F9AB99",
// headlinesOn: 0,
// homeChannel: "0",
// iconCUrl: "",
// iconCUrlSize: "",
// iconUrl: "",
// iconUrlSize: "",
// localChannel: "0",
// moreChannel: "0",
// movePermitted: 1,
// myChannel: "0",
// name: "美食",
// num: 28,
// pageId: 20032,
// pageType: "",
// underlineCColor: ""
// },
// {
// channelId: 2025,
// channelStrategy: 1,
// channelStyle: 2,
// channelType: 1,
// defaultPermitted: 0,
// delPermitted: 1,
// fontCColor: "#FFFFFF",
// fontColor: "#F9AB99",
// headlinesOn: 0,
// homeChannel: "0",
// iconCUrl: "",
// iconCUrlSize: "",
// iconUrl: "",
// iconUrlSize: "",
// localChannel: "0",
// moreChannel: "0",
// movePermitted: 1,
// myChannel: "0",
// name: "育儿",
// num: 29,
// pageId: 20035,
// pageType: "",
// underlineCColor: ""
// },
// {
// channelId: 2026,
// channelStrategy: 1,
// channelStyle: 2,
// channelType: 1,
// defaultPermitted: 0,
// delPermitted: 1,
// fontCColor: "#FFFFFF",
// fontColor: "#F9AB99",
// headlinesOn: 0,
// homeChannel: "0",
// iconCUrl: "",
// iconCUrlSize: "",
// iconUrl: "",
// iconUrlSize: "",
// localChannel: "0",
// moreChannel: "0",
// movePermitted: 1,
// myChannel: "0",
// name: "生态",
// num: 30,
// pageId: 20036,
// pageType: "",
// underlineCColor: ""
// },
// {
// channelId: 2023,
// channelStrategy: 1,
// channelStyle: 2,
// channelType: 1,
// defaultPermitted: 0,
// delPermitted: 1,
// fontCColor: "#FFFFFF",
// fontColor: "#F9AB99",
// headlinesOn: 0,
// homeChannel: "0",
// iconCUrl: "",
// iconCUrlSize: "",
// iconUrl: "",
// iconUrlSize: "",
// localChannel: "0",
// moreChannel: "0",
// movePermitted: 1,
// myChannel: "0",
// name: "时尚",
// num: 31,
// pageId: 20033,
// pageType: "",
// underlineCColor: ""
// },
// {
// channelId: 2027,
// channelStrategy: 1,
// channelStyle: 2,
// channelType: 2,
// defaultPermitted: 0,
// delPermitted: 1,
// fontCColor: "#FFFFFF",
// fontColor: "#F9AB99",
// headlinesOn: 0,
// homeChannel: "0",
// iconCUrl: "",
// iconCUrlSize: "",
// iconUrl: "",
// iconUrlSize: "",
// localChannel: "0",
// moreChannel: "0",
// movePermitted: 1,
// myChannel: "0",
// name: "北京",
// num: 32,
// pageId: 20037,
// pageType: "",
// underlineCColor: ""
// },
// {
// channelId: 2029,
// channelStrategy: 1,
// channelStyle: 2,
// channelType: 2,
// defaultPermitted: 0,
// delPermitted: 1,
// fontCColor: "#FFFFFF",
// fontColor: "#F9AB99",
// headlinesOn: 0,
// homeChannel: "0",
// iconCUrl: "",
// iconCUrlSize: "",
// iconUrl: "",
// iconUrlSize: "",
// localChannel: "0",
// moreChannel: "0",
// movePermitted: 1,
// myChannel: "0",
// name: "天津",
// num: 33,
// pageId: 20039,
// pageType: "",
// underlineCColor: ""
// },
// {
// channelId: 2030,
// channelStrategy: 1,
// channelStyle: 2,
// channelType: 2,
// defaultPermitted: 0,
// delPermitted: 1,
// fontCColor: "#FFFFFF",
// fontColor: "#F9AB99",
// headlinesOn: 0,
// homeChannel: "0",
// iconCUrl: "",
// iconCUrlSize: "",
// iconUrl: "",
// iconUrlSize: "",
// localChannel: "0",
// moreChannel: "0",
// movePermitted: 1,
// myChannel: "0",
// name: "河北",
// num: 34,
// pageId: 20040,
// pageType: "",
// underlineCColor: ""
// },
// {
// channelId: 2042,
// channelStrategy: 1,
// channelStyle: 2,
// channelType: 2,
// defaultPermitted: 0,
// delPermitted: 1,
// fontCColor: "#FFFFFF",
// fontColor: "#F9AB99",
// headlinesOn: 0,
// homeChannel: "0",
// iconCUrl: "",
// iconCUrlSize: "",
// iconUrl: "",
// iconUrlSize: "",
// localChannel: "0",
// moreChannel: "0",
// movePermitted: 1,
// myChannel: "0",
// name: "河南",
// num: 35,
// pageId: 20052,
// pageType: "",
// underlineCColor: ""
// },
// {
// channelId: 2041,
// channelStrategy: 1,
// channelStyle: 2,
// channelType: 2,
// defaultPermitted: 0,
// delPermitted: 1,
// fontCColor: "#FFFFFF",
// fontColor: "#F9AB99",
// headlinesOn: 0,
// homeChannel: "0",
// iconCUrl: "",
// iconCUrlSize: "",
// iconUrl: "",
// iconUrlSize: "",
// localChannel: "0",
// moreChannel: "0",
// movePermitted: 1,
// myChannel: "0",
// name: "山东",
// num: 36,
// pageId: 20051,
// pageType: "",
// underlineCColor: ""
// },
// {
// channelId: 2031,
// channelStrategy: 2,
// channelStyle: 2,
// channelType: 2,
// defaultPermitted: 0,
// delPermitted: 1,
// fontCColor: "#FFFFFF",
// fontColor: "#F9AB99",
// headlinesOn: 0,
// homeChannel: "0",
// iconCUrl: "",
// iconCUrlSize: "",
// iconUrl: "",
// iconUrlSize: "",
// localChannel: "0",
// moreChannel: "0",
// movePermitted: 1,
// myChannel: "0",
// name: "山西",
// num: 37,
// pageId: 20041,
// pageType: "",
// underlineCColor: ""
// },
// {
// channelId: 2032,
// channelStrategy: 1,
// channelStyle: 2,
// channelType: 2,
// defaultPermitted: 0,
// delPermitted: 1,
// fontCColor: "#FFFFFF",
// fontColor: "#F9AB99",
// headlinesOn: 0,
// homeChannel: "0",
// iconCUrl: "",
// iconCUrlSize: "",
// iconUrl: "",
// iconUrlSize: "",
// localChannel: "0",
// moreChannel: "0",
// movePermitted: 1,
// myChannel: "0",
// name: "内蒙古",
// num: 38,
// pageId: 20042,
// pageType: "",
// underlineCColor: ""
// },
// {
// channelId: 2033,
// channelStrategy: 1,
// channelStyle: 2,
// channelType: 2,
// defaultPermitted: 0,
// delPermitted: 1,
// fontCColor: "#FFFFFF",
// fontColor: "#F9AB99",
// headlinesOn: 0,
// homeChannel: "0",
// iconCUrl: "",
// iconCUrlSize: "",
// iconUrl: "",
// iconUrlSize: "",
// localChannel: "0",
// moreChannel: "0",
// movePermitted: 1,
// myChannel: "0",
// name: "辽宁",
// num: 39,
// pageId: 20043,
// pageType: "",
// underlineCColor: ""
// },
// {
// channelId: 2034,
// channelStrategy: 1,
// channelStyle: 2,
// channelType: 2,
// defaultPermitted: 0,
// delPermitted: 1,
// fontCColor: "#FFFFFF",
// fontColor: "#F9AB99",
// headlinesOn: 0,
// homeChannel: "0",
// iconCUrl: "",
// iconCUrlSize: "",
// iconUrl: "",
// iconUrlSize: "",
// localChannel: "0",
// moreChannel: "0",
// movePermitted: 1,
// myChannel: "0",
// name: "吉林",
// num: 40,
// pageId: 20044,
// pageType: "",
// underlineCColor: ""
// },
// {
// channelId: 2035,
// channelStrategy: 1,
// channelStyle: 2,
// channelType: 2,
// defaultPermitted: 0,
// delPermitted: 1,
// fontCColor: "#FFFFFF",
// fontColor: "#F9AB99",
// headlinesOn: 0,
// homeChannel: "0",
// iconCUrl: "",
// iconCUrlSize: "",
// iconUrl: "",
// iconUrlSize: "",
// localChannel: "0",
// moreChannel: "0",
// movePermitted: 1,
// myChannel: "0",
// name: "黑龙江",
// num: 41,
// pageId: 20045,
// pageType: "",
// underlineCColor: ""
// },
// {
// channelId: 2028,
// channelStrategy: 1,
// channelStyle: 2,
// channelType: 2,
// defaultPermitted: 0,
// delPermitted: 1,
// fontCColor: "#FFFFFF",
// fontColor: "#F9AB99",
// headlinesOn: 0,
// homeChannel: "0",
// iconCUrl: "",
// iconCUrlSize: "",
// iconUrl: "",
// iconUrlSize: "",
// localChannel: "0",
// moreChannel: "0",
// movePermitted: 1,
// myChannel: "0",
// name: "上海",
// num: 42,
// pageId: 20038,
// pageType: "",
// underlineCColor: ""
// },
// {
// channelId: 2036,
// channelStrategy: 1,
// channelStyle: 2,
// channelType: 2,
// defaultPermitted: 0,
// delPermitted: 1,
// fontCColor: "#FFFFFF",
// fontColor: "#F9AB99",
// headlinesOn: 0,
// homeChannel: "0",
// iconCUrl: "",
// iconCUrlSize: "",
// iconUrl: "",
// iconUrlSize: "",
// localChannel: "0",
// moreChannel: "0",
// movePermitted: 1,
// myChannel: "0",
// name: "江苏",
// num: 43,
// pageId: 20046,
// pageType: "",
// underlineCColor: ""
// },
// {
// channelId: 2037,
// channelStrategy: 1,
// channelStyle: 2,
// channelType: 2,
// defaultPermitted: 0,
// delPermitted: 1,
// fontCColor: "#FFFFFF",
// fontColor: "#F9AB99",
// headlinesOn: 0,
// homeChannel: "0",
// iconCUrl: "",
// iconCUrlSize: "",
// iconUrl: "",
// iconUrlSize: "",
// localChannel: "0",
// moreChannel: "0",
// movePermitted: 1,
// myChannel: "0",
// name: "浙江",
// num: 44,
// pageId: 20047,
// pageType: "",
// underlineCColor: ""
// },
// {
// channelId: 2038,
// channelStrategy: 1,
// channelStyle: 2,
// channelType: 2,
// defaultPermitted: 0,
// delPermitted: 1,
// fontCColor: "#FFFFFF",
// fontColor: "#F9AB99",
// headlinesOn: 0,
// homeChannel: "0",
// iconCUrl: "",
// iconCUrlSize: "",
// iconUrl: "",
// iconUrlSize: "",
// localChannel: "0",
// moreChannel: "0",
// movePermitted: 1,
// myChannel: "0",
// name: "安徽",
// num: 45,
// pageId: 20048,
// pageType: "",
// underlineCColor: ""
// },
// {
// channelId: 2039,
// channelStrategy: 1,
// channelStyle: 2,
// channelType: 2,
// defaultPermitted: 0,
// delPermitted: 1,
// fontCColor: "#FFFFFF",
// fontColor: "#F9AB99",
// headlinesOn: 0,
// homeChannel: "0",
// iconCUrl: "",
// iconCUrlSize: "",
// iconUrl: "",
// iconUrlSize: "",
// localChannel: "0",
// moreChannel: "0",
// movePermitted: 1,
// myChannel: "0",
// name: "福建",
// num: 46,
// pageId: 20049,
// pageType: "",
// underlineCColor: ""
// },
// {
// channelId: 2040,
// channelStrategy: 1,
// channelStyle: 2,
// channelType: 2,
// defaultPermitted: 0,
// delPermitted: 1,
// fontCColor: "#FFFFFF",
// fontColor: "#F9AB99",
// headlinesOn: 0,
// homeChannel: "0",
// iconCUrl: "",
// iconCUrlSize: "",
// iconUrl: "",
// iconUrlSize: "",
// localChannel: "0",
// moreChannel: "0",
// movePermitted: 1,
// myChannel: "0",
// name: "江西",
// num: 47,
// pageId: 20050,
// pageType: "",
// underlineCColor: ""
// },
// {
// channelId: 2045,
// channelStrategy: 2,
// channelStyle: 2,
// channelType: 2,
// defaultPermitted: 0,
// delPermitted: 1,
// fontCColor: "#FFFFFF",
// fontColor: "#F9AB99",
// headlinesOn: 0,
// homeChannel: "0",
// iconCUrl: "",
// iconCUrlSize: "",
// iconUrl: "",
// iconUrlSize: "",
// localChannel: "0",
// moreChannel: "0",
// movePermitted: 1,
// myChannel: "0",
// name: "广东",
// num: 48,
// pageId: 20055,
// pageType: "",
// underlineCColor: ""
// },
// {
// channelId: 2046,
// channelStrategy: 1,
// channelStyle: 2,
// channelType: 2,
// defaultPermitted: 0,
// delPermitted: 1,
// fontCColor: "#FFFFFF",
// fontColor: "#F9AB99",
// headlinesOn: 0,
// homeChannel: "0",
// iconCUrl: "",
// iconCUrlSize: "",
// iconUrl: "",
// iconUrlSize: "",
// localChannel: "0",
// moreChannel: "0",
// movePermitted: 1,
// myChannel: "0",
// name: "广西",
// num: 49,
// pageId: 20056,
// pageType: "",
// underlineCColor: ""
// },
// {
// channelId: 2048,
// channelStrategy: 1,
// channelStyle: 2,
// channelType: 2,
// defaultPermitted: 0,
// delPermitted: 1,
// fontCColor: "#FFFFFF",
// fontColor: "#F9AB99",
// headlinesOn: 0,
// homeChannel: "0",
// iconCUrl: "",
// iconCUrlSize: "",
// iconUrl: "",
// iconUrlSize: "",
// localChannel: "0",
// moreChannel: "0",
// movePermitted: 1,
// myChannel: "0",
// name: "重庆",
// num: 50,
// pageId: 20058,
// pageType: "",
// underlineCColor: ""
// },
// {
// channelId: 2049,
// channelStrategy: 1,
// channelStyle: 2,
// channelType: 2,
// defaultPermitted: 0,
// delPermitted: 1,
// fontCColor: "#FFFFFF",
// fontColor: "#F9AB99",
// headlinesOn: 0,
// homeChannel: "0",
// iconCUrl: "",
// iconCUrlSize: "",
// iconUrl: "",
// iconUrlSize: "",
// localChannel: "0",
// moreChannel: "0",
// movePermitted: 1,
// myChannel: "0",
// name: "四川",
// num: 51,
// pageId: 20059,
// pageType: "",
// underlineCColor: ""
// },
// {
// channelId: 2051,
// channelStrategy: 1,
// channelStyle: 2,
// channelType: 2,
// defaultPermitted: 0,
// delPermitted: 1,
// fontCColor: "#FFFFFF",
// fontColor: "#F9AB99",
// headlinesOn: 0,
// homeChannel: "0",
// iconCUrl: "",
// iconCUrlSize: "",
// iconUrl: "",
// iconUrlSize: "",
// localChannel: "0",
// moreChannel: "0",
// movePermitted: 1,
// myChannel: "0",
// name: "云南",
// num: 52,
// pageId: 20061,
// pageType: "",
// underlineCColor: ""
// },
// {
// channelId: 2050,
// channelStrategy: 1,
// channelStyle: 2,
// channelType: 2,
// defaultPermitted: 0,
// delPermitted: 1,
// fontCColor: "#FFFFFF",
// fontColor: "#F9AB99",
// headlinesOn: 0,
// homeChannel: "0",
// iconCUrl: "",
// iconCUrlSize: "",
// iconUrl: "",
// iconUrlSize: "",
// localChannel: "0",
// moreChannel: "0",
// movePermitted: 1,
// myChannel: "0",
// name: "贵州",
// num: 53,
// pageId: 20060,
// pageType: "",
// underlineCColor: ""
// },
// {
// channelId: 2044,
// channelStrategy: 1,
// channelStyle: 2,
// channelType: 2,
// defaultPermitted: 0,
// delPermitted: 1,
// fontCColor: "#FFFFFF",
// fontColor: "#F9AB99",
// headlinesOn: 0,
// homeChannel: "0",
// iconCUrl: "",
// iconCUrlSize: "",
// iconUrl: "",
// iconUrlSize: "",
// localChannel: "0",
// moreChannel: "0",
// movePermitted: 1,
// myChannel: "0",
// name: "湖南",
// num: 54,
// pageId: 20054,
// pageType: "",
// underlineCColor: ""
// },
// {
// channelId: 2043,
// channelStrategy: 1,
// channelStyle: 2,
// channelType: 2,
// defaultPermitted: 0,
// delPermitted: 1,
// fontCColor: "#FFFFFF",
// fontColor: "#F9AB99",
// headlinesOn: 0,
// homeChannel: "0",
// iconCUrl: "",
// iconCUrlSize: "",
// iconUrl: "",
// iconUrlSize: "",
// localChannel: "0",
// moreChannel: "0",
// movePermitted: 1,
// myChannel: "0",
// name: "湖北",
// num: 55,
// pageId: 20053,
// pageType: "",
// underlineCColor: ""
// },
// {
// channelId: 2052,
// channelStrategy: 2,
// channelStyle: 2,
// channelType: 2,
// defaultPermitted: 0,
// delPermitted: 1,
// fontCColor: "#FFFFFF",
// fontColor: "#F9AB99",
// headlinesOn: 0,
// homeChannel: "0",
// iconCUrl: "",
// iconCUrlSize: "",
// iconUrl: "",
// iconUrlSize: "",
// localChannel: "0",
// moreChannel: "0",
// movePermitted: 1,
// myChannel: "0",
// name: "西藏",
// num: 56,
// pageId: 20062,
// pageType: "",
// underlineCColor: ""
// },
// {
// channelId: 2057,
// channelStrategy: 2,
// channelStyle: 2,
// channelType: 2,
// defaultPermitted: 0,
// delPermitted: 1,
// fontCColor: "#FFFFFF",
// fontColor: "#F9AB99",
// headlinesOn: 0,
// homeChannel: "0",
// iconCUrl: "",
// iconCUrlSize: "",
// iconUrl: "",
// iconUrlSize: "",
// localChannel: "0",
// moreChannel: "0",
// movePermitted: 1,
// myChannel: "0",
// name: "新疆",
// num: 57,
// pageId: 20067,
// pageType: "",
// underlineCColor: ""
// },
// {
// channelId: 2053,
// channelStrategy: 1,
// channelStyle: 2,
// channelType: 2,
// defaultPermitted: 0,
// delPermitted: 1,
// fontCColor: "#FFFFFF",
// fontColor: "#F9AB99",
// headlinesOn: 0,
// homeChannel: "0",
// iconCUrl: "",
// iconCUrlSize: "",
// iconUrl: "",
// iconUrlSize: "",
// localChannel: "0",
// moreChannel: "0",
// movePermitted: 1,
// myChannel: "0",
// name: "陕西",
// num: 58,
// pageId: 20063,
// pageType: "",
// underlineCColor: ""
// },
// {
// channelId: 2054,
// channelStrategy: 1,
// channelStyle: 2,
// channelType: 2,
// defaultPermitted: 0,
// delPermitted: 1,
// fontCColor: "#FFFFFF",
// fontColor: "#F9AB99",
// headlinesOn: 0,
// homeChannel: "0",
// iconCUrl: "",
// iconCUrlSize: "",
// iconUrl: "",
// iconUrlSize: "",
// localChannel: "0",
// moreChannel: "0",
// movePermitted: 1,
// myChannel: "0",
// name: "甘肃",
// num: 59,
// pageId: 20064,
// pageType: "",
// underlineCColor: ""
// },
// {
// channelId: 2055,
// channelStrategy: 1,
// channelStyle: 2,
// channelType: 2,
// defaultPermitted: 0,
// delPermitted: 1,
// fontCColor: "#FFFFFF",
// fontColor: "#F9AB99",
// headlinesOn: 0,
// homeChannel: "0",
// iconCUrl: "",
// iconCUrlSize: "",
// iconUrl: "",
// iconUrlSize: "",
// localChannel: "0",
// moreChannel: "0",
// movePermitted: 1,
// myChannel: "0",
// name: "青海",
// num: 60,
// pageId: 20065,
// pageType: "",
// underlineCColor: ""
// },
// {
// channelId: 2056,
// channelStrategy: 2,
// channelStyle: 2,
// channelType: 2,
// defaultPermitted: 0,
// delPermitted: 1,
// fontCColor: "#FFFFFF",
// fontColor: "#F9AB99",
// headlinesOn: 0,
// homeChannel: "0",
// iconCUrl: "",
// iconCUrlSize: "",
// iconUrl: "",
// iconUrlSize: "",
// localChannel: "0",
// moreChannel: "0",
// movePermitted: 1,
// myChannel: "0",
// name: "宁夏",
// num: 61,
// pageId: 20066,
// pageType: "",
// underlineCColor: ""
// },
// {
// channelId: 2047,
// channelStrategy: 1,
// channelStyle: 2,
// channelType: 2,
// defaultPermitted: 0,
// delPermitted: 1,
// fontCColor: "#FFFFFF",
// fontColor: "#F9AB99",
// headlinesOn: 0,
// homeChannel: "0",
// iconCUrl: "",
// iconCUrlSize: "",
// iconUrl: "",
// iconUrlSize: "",
// localChannel: "0",
// moreChannel: "0",
// movePermitted: 1,
// myChannel: "0",
// name: "海南",
// num: 62,
// pageId: 20057,
// pageType: "",
// underlineCColor: ""
// }
// ]
// @State myChannelList: TopNavDTO [] = []
// @State moreChannelList: TopNavDTO [] = []
// @State localChannelList: 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,
confirm: this.onAccept,
changeChannelIndex: this.changeChannelIndex,
delChannelItem: this.delChannelItem,
addChannelItem: this.addChannelItem
}),
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')
// topNavListHandle() {
// let defaultMyChannelList: TopNavDTO[] = []
// let handledTopNavList = [...this.topNavList]
// handledTopNavList.sort((a, b) => {
// return a.num - b.num;
// });
// 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)
// }
// })
//
// 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'
// }
// }
//
// if (item.myChannel === '1') {
// this.myChannelList.push(item)
// }
// if (item.moreChannel === '1') {
// this.moreChannelList.push(item)
// }
// if (item.localChannel === '1') {
// this.localChannelList.push(item)
// }
// })
// }
onChannelIdsUpdate(){
AppStorage.SetOrCreate('channelIds', this.channelIds.join(','));
console.log(`AppStorage.get('channelIds')${AppStorage.get('channelIds')}`)
}
onAccept() {
console.info('Callback when the second button is clicked')
aboutToAppear() {
console.log(`myChannelListzz${this.channelIds}}`)
// this.topNavListHandle()
}
exitApp() {
console.info('Click the callback in the blank area')
aboutToDisappear() {
this.dialogController = null // 将dialogController置空
}
build() {
... ... @@ -542,8 +2069,9 @@ struct ChannelSubscriptionLayout {
.width(18)
}
.width(36)
.height(30)
.height(36)
.justifyContent(FlexAlign.Center)
.padding({ bottom: 6 })
.backgroundColor('#ffffff')
.onClick(() => {
if (this.dialogController != null) {
... ...
import { CustomTitleUI } from '../reusable/CustomTitleUI';
import { EditListInfo } from '../../model/EditInfoModel';
import { EditListInfo, editModel, editModelParams, WDEditDataModelType } from '../../model/EditInfoModel';
import EditInfoViewModel from '../../viewmodel/EditInfoViewModel';
import { WDRouterPage, WDRouterRule } from 'wdRouter';
import {AreaPickerDialog} from '../view/areaPickerDialog/AreaPickerDialog'
import { AreaListModel } from '../../model/AreaListModel';
import router from '@ohos.router';
@Entry
@Component
... ... @@ -13,9 +13,16 @@ struct EditUserInfoPage {
@State listData: EditListInfo[] = []
@State headerImg: string = ''
@State dataSource: AreaListModel[] = []
@State currentUserInfo: editModel = new editModel()
dialogController: CustomDialogController = new CustomDialogController({
builder: AreaPickerDialog({dataSource:this.dataSource}),
builder: AreaPickerDialog({dataSource:this.dataSource,
confirmCallback:(area:string)=>{
this.currentUserInfo.userExtend.city = area;
this.currentUserInfo.editDataType = WDEditDataModelType.WDEditDataModelType_region
this.updateEditModel()
}
}),
alignment: DialogAlignment.Bottom,
offset:{dx:0,dy:-20}
})
... ... @@ -25,6 +32,10 @@ struct EditUserInfoPage {
this.getAreaList()
}
onPageShow(){
this.updateUserNameAndIntroduction()
}
build() {
Row() {
Column() {
... ... @@ -89,14 +100,15 @@ struct EditUserInfoPage {
.width('100%')
.onClick(()=>{
if (i === 1){
// WDRouterRule.jumpWithPage(WDRouterPage.editUserInfoPage)
WDRouterRule.jumpWithPage(WDRouterPage.editUserNikeNamePage)
let params: editModelParams = {
editContent: this.currentUserInfo.userName
}
WDRouterRule.jumpWithPage(WDRouterPage.editUserNikeNamePage,params)
}else if (i === 2){
WDRouterRule.jumpWithPage(WDRouterPage.editUserIntroductionPage)
// router.pushUrl({
// url:'pages/EditUserInstoductionPage',
// params:{pageNum:i}
// })
let params: editModelParams = {
editContent: this.currentUserInfo.userExtend.introduction
}
WDRouterRule.jumpWithPage(WDRouterPage.editUserIntroductionPage,params)
}else if (i === 3){
this.dialogController.open()
} else if (i === 4) {
... ... @@ -105,25 +117,57 @@ struct EditUserInfoPage {
end:new Date(),
selected:new Date,
lunar:false,
// onAccept:(value:DatePickerResult) => {
//
// }
onAccept:(value:DatePickerResult) => {
let mon = value.month as number + 1
this.currentUserInfo.userExtend.birthday = value.year+'-'+mon.toString()+'-'+value.day;
this.currentUserInfo.editDataType = WDEditDataModelType.WDEditDataModelType_birthday
this.updateEditModel()
}
})
}else if(i === 5){
TextPickerDialog.show({
range:['男','女'],
range:['女','男'],
selected:0,
// onAccept:(value:TextPickerResult) => {
//
// }
onAccept:(value:TextPickerResult) => {
this.currentUserInfo.userExtend.sex = value.index.toString();
this.currentUserInfo.editDataType = WDEditDataModelType.WDEditDataModelType_sex
this.updateEditModel()
}
})
}
})
}
updateUserNameAndIntroduction(){
let backParams:editModelParams = router.getParams() as editModelParams;
if (backParams) {
let userName = backParams.userName as string ///昵称
let introduction = backParams.introduction as string ///简介
if (userName) {
if (userName != this.currentUserInfo.userName) {
this.currentUserInfo.userName = userName;
this.currentUserInfo.editDataType = WDEditDataModelType.WDEditDataModelType_nickname
this.updateEditModel()
}
} else if (introduction){
if (introduction != this.currentUserInfo.userExtend.introduction ) {
this.currentUserInfo.userExtend.introduction = introduction;
this.currentUserInfo.editDataType = WDEditDataModelType.WDEditDataModelType_intro
this.updateEditModel()
}
}
}
}
updateEditModel(){
this.listData = []
this.listData.push(...EditInfoViewModel.getEditListInfo(this.currentUserInfo))
}
getAccountOwnerInfo(){
EditInfoViewModel.queryAccountOwnerInfo(1,getContext(this)).then((editModel) => {
this.headerImg = editModel.userExtend.headPhotoUrl
this.currentUserInfo = editModel;
this.listData.push(...EditInfoViewModel.getEditListInfo(editModel))
});
}
... ...
import { CustomTitleUI } from '../reusable/CustomTitleUI'
import router from '@ohos.router'
import { editModelParams } from '../../model/EditInfoModel'
@Entry
@Component
struct EditUserIntroductionPage {
@State numCount: number = 0
@State textColor : string = '#222222'
@State introduction: string = ''
@State params:editModelParams = router.getParams() as editModelParams;
build() {
Column(){
CustomTitleUI({titleName:'修改简介'})
Row(){
TextInput({placeholder:'请输入简介'})
TextInput({placeholder:'请输入简介',text:this.params.editContent})
.maxLength(60)
.width('100%')
.height(80)
... ... @@ -23,6 +26,7 @@ struct EditUserIntroductionPage {
}else {
this.textColor = '#222222'
}
this.introduction = value
})
Text(this.numCount.toString() + '/60')
... ... @@ -46,6 +50,15 @@ struct EditUserIntroductionPage {
.backgroundColor('#ED2800')
.borderRadius(5)
.margin(30)
.onClick(()=>{
let params: editModelParams = {
introduction: this.introduction
}
router.back({
url:'',
params:params
})
})
}
}
}
\ No newline at end of file
... ...
import { CustomTitleUI } from '../reusable/CustomTitleUI'
import router from '@ohos.router'
import { editModelParams } from '../../model/EditInfoModel'
@Entry
@Component
... ... @@ -6,13 +8,14 @@ struct EditUserNikeNamePage {
///接收传参
@State numCount: number = 0
@State textColor : string = '#222222'
@State nikeName: string = ''
@State params:editModelParams = router.getParams() as editModelParams;
build() {
Column(){
CustomTitleUI({titleName:'修改昵称'})
Row(){
TextInput({placeholder:'请输入昵称'})
TextInput({placeholder:'请输入昵称',text:this.params.editContent})
.width('100%')
.maxLength(16)
.height(50)
... ... @@ -24,6 +27,7 @@ struct EditUserNikeNamePage {
}else {
this.textColor = '#222222'
}
this.nikeName = value
})
Text(this.numCount.toString() + '/16')
... ... @@ -46,6 +50,15 @@ struct EditUserNikeNamePage {
.backgroundColor('#ED2800')
.borderRadius(5)
.margin(30)
.onClick(()=>{
let params: editModelParams = {
userName: this.nikeName
}
router.back({
url:'',
params:params
})
})
}
}
}
\ No newline at end of file
... ...
import { CustomTitleUI } from '../reusable/CustomTitleUI'
import { CustomTitleAndEditUI } from '../reusable/CustomTitleAndEditUI'
import MyCollectionViewModel from '../../viewmodel/MyCollectionViewModel';
import PageModel from '../../viewmodel/PageModel';
import { CommonConstants, ViewType } from 'wdConstant'
... ... @@ -11,20 +11,31 @@ import LoadMoreLayout from './LoadMoreLayout'
import NoMoreLayout from './NoMoreLayout'
import { CompParser } from '../CompParser'
import CustomRefreshLoadLayout from './CustomRefreshLoadLayout';
import { CustomSelectUI } from '../view/CustomSelectUI';
import { CustomBottomFuctionUI } from '../view/CustomBottomFuctionUI';
@Entry
@Component
struct MyCollectionListPage {
@State private browSingModel: PageModel = new PageModel()
isloading : boolean = false
@Provide isEditState:boolean = false
@State allDatas :CompDTO[] = [];
@State selectDatas :CompDTO[] = [];
@Provide deleteNum :number = 0;
@Provide isAllSelect:boolean = false
aboutToAppear(){
this.getData()
}
build() {
Column(){
CustomTitleUI({titleName:'我的收藏'})
CustomTitleAndEditUI({titleName:'我的收藏',isDisplayButton:true,editCallback:()=>{
this.allSelectDatas(false)
this.isAllSelect = false
this.selectDatas = []
this.deleteNum = 0
}})
if (this.browSingModel.viewType == ViewType.LOADING){
this.LoadingLayout()
}else if(this.browSingModel.viewType == ViewType.ERROR){
... ... @@ -34,6 +45,18 @@ struct MyCollectionListPage {
}else {
this.ListLayout()
}
if (this.isEditState){
CustomBottomFuctionUI({
selectAllCallback:(isAllSelect)=>{
this.allSelectDatas(isAllSelect)
},
confirmCallback:()=>{
this.deleteDatas()
}
})
.position({y:'92%'})
}
}
.width(CommonConstants.FULL_WIDTH)
.height(CommonConstants.FULL_HEIGHT)
... ... @@ -49,11 +72,9 @@ struct MyCollectionListPage {
})
}
LazyForEach(this.browSingModel.compList, (compDTO: CompDTO, compIndex: number) => {
ForEach(this.allDatas, (compDTO: CompDTO, compIndex: number) => {
ListItem() {
Column() {
CompParser({ compDTO: compDTO, compIndex: compIndex });
}
this.newCompParser(compDTO,compIndex)
}
})
... ... @@ -72,6 +93,24 @@ struct MyCollectionListPage {
.height(CommonConstants.FULL_PARENT)
}
@Builder
newCompParser(compDTO: CompDTO, compIndex: number){
Row(){
if (this.isEditState){
CustomSelectUI({
isOn:compDTO.isSelect,
selectCallback:(isOn)=>{
this.addCompDTO(isOn,compDTO)
}
})
.margin({left:16})
}
Column() {
CompParser({ compDTO: compDTO, compIndex: compIndex })
}
}
}
@Builder LoadingLayout() {
CustomRefreshLoadLayout({ refreshBean: new RefreshLayoutBean(true,
$r('app.media.ic_pull_up_load'), $r('app.string.pull_up_load_text'), this.browSingModel.pullDownRefreshHeight) })
... ... @@ -82,7 +121,7 @@ struct MyCollectionListPage {
MyCollectionViewModel.newFetchMyCollectList(1,'1',this.browSingModel.currentPage,getContext(this)).then(pageDto => {
if (pageDto && pageDto.compList && pageDto.compList.length > 0) {
this.browSingModel.viewType = ViewType.LOADED;
this.browSingModel.compList.push(...pageDto.compList)
this.allDatas.push(...pageDto.compList)
if (pageDto.compList.length === this.browSingModel.pageSize) {
this.browSingModel.currentPage++;
this.browSingModel.hasMore = true;
... ... @@ -94,4 +133,49 @@ struct MyCollectionListPage {
}
})
}
//数据处理
//单个选择
addCompDTO(isOn:boolean , compDTO: CompDTO){
compDTO.isSelect = isOn;
if (isOn === true){
this.selectDatas.push(compDTO)
}else {
this.selectDatas.splice(this.selectDatas.indexOf(compDTO),1)
}
this.deleteNum = this.selectDatas.length
this.isAllSelect = this.deleteNum === this.allDatas.length?true:false;
}
//全选
allSelectDatas(isOn:boolean){
let datas: CompDTO[] = [];
for (let index = 0; index < this.allDatas.length; index++) {
const compDTO = this.allDatas[index];
compDTO.isSelect = isOn
datas.push(compDTO)
}
this.selectDatas = []
this.allDatas = []
if (isOn === true) {
this.selectDatas.push(...datas)
}else {
this.selectDatas.splice(0,this.deleteNum)
}
this.allDatas.push(...datas)
this.deleteNum = this.selectDatas.length
}
//删除
deleteDatas(){
for (let index = 0; index < this.selectDatas.length; index++) {
const compDTO = this.allDatas[index];
this.allDatas.splice(this.selectDatas.indexOf(compDTO),1)
}
//重置删除状态
this.isEditState = false
this.isAllSelect = false
}
}
\ No newline at end of file
... ...
... ... @@ -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();
}
... ...
... ... @@ -11,56 +11,81 @@ const TAG = 'TopNavigationComponent';
*/
@Component
export struct TopNavigationComponent {
private tabsController: TabsController = new TabsController()
@Prop _currentNavIndex?: number;
// 顶导当前选中/焦点下标
@State currentTopNavSelectedIndex: number = 0;
// 顶导数据
@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.channelIds.push(item.channelId)
}
}
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)}`)
})
}
isBroadcast (item: TopNavDTO) {
return item.name === '播报'
}
build() {
Column() {
// 顶部搜索、日报logo、早晚报
RelativeContainer() {
Stack({ alignContent: Alignment.Center }) {
... ... @@ -80,7 +105,6 @@ export struct TopNavigationComponent {
}
.alignItems(VerticalAlign.Center)
.justifyContent(FlexAlign.Center)
}
.height(30)
.width(123)
... ... @@ -146,18 +170,20 @@ export struct TopNavigationComponent {
.width('100%')
.height(40)
.visibility(this._currentNavIndex == 0 ? Visibility.Visible : Visibility.None)
// 频道分类list
Stack({ alignContent: Alignment.TopEnd }) {
Tabs() {
ForEach(this.handledTopNavList, (navItem: TopNavDTO, index: number) => {
Tabs({ controller: this.tabsController }) {
ForEach(this.myChannelList, (navItem: TopNavDTO, index: number) => {
TabContent() {
PageComponent({
currentTopNavSelectedIndex: $currentTopNavSelectedIndex,
navIndex: index,
pageId: navItem.pageId + '',
channelId: navItem.channelId + ''
})
if(!this.isBroadcast(navItem)) {
PageComponent({
currentTopNavSelectedIndex: $currentTopNavSelectedIndex,
navIndex: index,
pageId: navItem.pageId + '',
channelId: navItem.channelId + ''
})
}
}
.tabBar(this.tabBarBuilder(navItem, index))
}, (navItem: TopNavDTO) => JSON.stringify(navItem));
... ... @@ -167,12 +193,31 @@ export struct TopNavigationComponent {
.vertical(false)
.onChange((index: number) => {
Logger.info(TAG, `onChange index : ${index}`);
this.currentTopNavSelectedIndex = index;
if(!this.isBroadcast(this.myChannelList[index])) {
this.currentTopNavSelectedIndex = index;
} else {
// 跳转到播报页面
let taskAction: Action = {
type: 'JUMP_INNER_NEW_PAGE',
params: {
pageID: 'BroadcastPage',
id: this.myChannelList[index].pageId
} as Params,
};
WDRouterRule.jumpWithAction(taskAction)
this.tabsController.changeIndex(this.currentTopNavSelectedIndex)
}
})
// 分类列表最右侧频道设置
ChannelSubscriptionLayout({
topNavList: this.handledTopNavList,
currentTopNavSelectedIndex: this.currentTopNavSelectedIndex
currentTopNavSelectedIndex: $currentTopNavSelectedIndex,
myChannelList: $myChannelList,
moreChannelList: $moreChannelList,
localChannelList: $localChannelList,
channelIds: $channelIds,
changeTab: (index) => {
this.tabsController.changeIndex(index)
}
})
}
... ... @@ -208,7 +253,7 @@ export struct TopNavigationComponent {
bottom: $r('app.float.top_tab_item_padding_bottom')
})
.id(`col_tabBar${index}`)
.margin({ right: this.myChannelList.length === index + 1 ? 36 : 0 })
}
aboutToAppear() {
... ...
import router from '@ohos.router'
@Component
export struct CustomTitleAndEditUI {
imgBack:boolean = true
titleName:string = "默认标题"
isDisplayButton:boolean = false
@Consume isEditState:boolean
editCallback: () => void = () => {
}
build() {
RelativeContainer() {
//标题栏目
if(this.imgBack){
Image($r('app.media.back_icon'))
.width('46lpx')
.height('46lpx')
.objectFit(ImageFit.Auto)
.interpolation(ImageInterpolation.High)
.id("back_icon")
.alignRules({
center: {anchor: "__container__", align: VerticalAlign.Center},
left: {anchor: "__container__", align: HorizontalAlign.Start}
})
.margin({left:'31lpx'})
.onClick(()=>{
router.back()
})
}
Text(this.titleName)
.height('42lpx')
.maxLines(1)
.id("title")
.fontSize('35lpx')
.fontWeight(400)
.fontColor($r('app.color.color_222222'))
.lineHeight('42lpx')
.alignRules({
center: {anchor: "__container__", align: VerticalAlign.Center},
middle: {anchor: "__container__", align: HorizontalAlign.Center}
})
if (this.isDisplayButton){
Button(this.isEditState === true?'取消':'编辑')
.type(ButtonType.Normal)
.fontColor($r('app.color.color_222222'))
.backgroundColor(Color.White)
.id("edit_Button")
.alignRules({
center: {anchor: "__container__", align: VerticalAlign.Center},
right: {anchor: "__container__", align: HorizontalAlign.End}
})
.margin({right:'31lpx'})
.onClick(()=>{
this.isEditState = !this.isEditState
this.editCallback()
})
}
}
.height('84lpx')
.width('100%')
.backgroundColor($r('app.color.white'))
}
}
\ No newline at end of file
... ...
... ... @@ -37,10 +37,10 @@ export struct CustomTitleUI {
center: {anchor: "__container__", align: VerticalAlign.Center},
middle: {anchor: "__container__", align: HorizontalAlign.Center}
})
}
.height('84lpx')
.width('100%')
.backgroundColor($r('app.color.white'))
}
}
\ No newline at end of file
... ...
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
... ...
... ... @@ -49,6 +49,7 @@ export struct BannerComponent {
}
.margin({ left: $r('app.float.main_margin'), right: $r('app.float.main_margin') })
.padding({ bottom: 14 })
.borderRadius($r('app.float.image_border_radius'))
.displayCount(this.buildDisplayCount()) // 仅展示1个图片
.cachedCount(2)
.index(1) // The default index of Swiper.
... ...
... ... @@ -22,8 +22,18 @@ export struct CompStyle_09 {
.margin({ bottom: 19 })
}
// 大图
Image(this.compDTO.operDataList[0].coverUrl)
.width('100%')
Stack(){
Image(this.compDTO.operDataList[0].coverUrl)
.width('100%')
.borderRadius({topLeft: $r('app.float.image_border_radius'), topRight: $r('app.float.image_border_radius')})
Text('专题')
.fontSize($r('app.float.font_size_12'))
.padding({left: 8, right: 8, top: 3, bottom: 3})
.backgroundColor(Color.Red)
.fontColor(Color.White)
.borderRadius($r('app.float.button_border_radius'))
.margin({left: 5, bottom: 5})
}.alignContent(Alignment.BottomStart)
// 时间线--后端返回三个,
Column(){
ForEach(this.compDTO.operDataList[0].slideShows, (item:slideShows, index:number) => {
... ... @@ -44,7 +54,7 @@ export struct CompStyle_09 {
.backgroundColor($r('app.color.color_F5F5F5'))
.width(CommonConstants.FULL_WIDTH)
.height(40)
.borderRadius(3)
.borderRadius($r('app.float.button_border_radius'))
.justifyContent(FlexAlign.Center)
.margin({top: 5})
}
... ... @@ -67,20 +77,27 @@ export struct CompStyle_09 {
Column(){
Stack() {
if(index < this.compDTO.operDataList[0].slideShows.length - 1) {
Line()
.width(1)
.startPoint([4, index > 0 ? 0 : 20])
.endPoint([4, 100])
.stroke($r('app.color.color_EDEDED'))
Divider()
.vertical(true)
.color($r('app.color.color_EDEDED'))
.strokeWidth(1)
.strokeLineCap(LineCapStyle.Butt)
.margin({top: index > 0 ? 0 : 16, left: 4})
}
if(index > 0 && index == this.compDTO.operDataList[0].slideShows.length - 1) {
Divider()
.vertical(true)
.color($r('app.color.color_EDEDED'))
.strokeWidth(1)
.height(16)
.margin({left: 4})
}
Column(){
Row() {
// 标题
Image($r("app.media.point_icon"))
.width(9)
.height(6)
.height(9)
.margin({ right: 5 })
Text(DateTimeUtils.formatDate(item.publishTime, "MM月dd日 HH:mm"))
.fontSize($r('app.float.font_size_12'))
... ... @@ -89,6 +106,7 @@ export struct CompStyle_09 {
}
.width(CommonConstants.FULL_WIDTH)
.height(32)
.alignItems(VerticalAlign.Center)
Row() {
Text(item.newsTitle)
.fontSize($r('app.float.font_size_17'))
... ... @@ -103,13 +121,14 @@ export struct CompStyle_09 {
Image(item.fullColumnImgUrls[0].url)
.width(90)
.height(60)
.borderRadius(4)
.borderRadius($r('app.float.image_border_radius'))
}
}
}
}
.alignContent(Alignment.Start)
.alignContent(Alignment.TopStart)
}
.height(item.fullColumnImgUrls[0] && item.fullColumnImgUrls[0].url ? 100 : 78)
.alignItems(HorizontalAlign.Start)
}
}
\ No newline at end of file
... ...
... ... @@ -24,11 +24,21 @@ export struct CompStyle_10 {
.margin({ bottom: 19 })
}
// 大图
Image(this.compDTO.operDataList[0] && this.compDTO.operDataList[0].coverUrl)
.width('100%')
.onClick((event: ClickEvent) => {
ProcessUtils.processPage(this.compDTO?.operDataList[0])
})
Stack(){
Image(this.compDTO.operDataList[0] && this.compDTO.operDataList[0].coverUrl)
.width('100%')
.borderRadius({topLeft: $r('app.float.image_border_radius'), topRight: $r('app.float.image_border_radius')})
.onClick((event: ClickEvent) => {
ProcessUtils.processPage(this.compDTO?.operDataList[0])
})
Text('专题')
.fontSize($r('app.float.font_size_12'))
.padding({left: 8, right: 8, top: 3, bottom: 3})
.backgroundColor(Color.Red)
.fontColor(Color.White)
.borderRadius($r('app.float.button_border_radius'))
.margin({left: 5, bottom: 5})
}.alignContent(Alignment.BottomStart)
// 专题列表--后端返回三个,
Column(){
ForEach(this.compDTO.operDataList[0].slideShows, (item:slideShows, index:number) => {
... ... @@ -49,7 +59,7 @@ export struct CompStyle_10 {
.backgroundColor($r('app.color.color_F5F5F5'))
.width(CommonConstants.FULL_WIDTH)
.height(40)
.borderRadius(3)
.borderRadius($r('app.float.button_border_radius'))
.justifyContent(FlexAlign.Center)
.margin({top: 5})
.onClick((event: ClickEvent) => {
... ... @@ -105,7 +115,7 @@ export struct CompStyle_10 {
.width(117)
.height(78)
.objectFit(ImageFit.Cover)
.borderRadius(4)
.borderRadius($r('app.float.image_border_radius'))
.margin({left: 12})
}
}
... ...
@Component
export struct CustomBottomFuctionUI {
@Consume deleteNum: number
@Consume isAllSelect: boolean
selectAllCallback: (isOn: boolean) => void = () => {
}
confirmCallback: () => void = () => {
}
build() {
RelativeContainer(){
Row(){
Image(this.isAllSelect?$r("app.media.MyCollection_selected_icon"):$r("app.media.MyCollection_unselected_icon"))
.width('20')
.height('20')
.margin({right:'31lpx' })
Text(this.isAllSelect?'取消':'全选')
.fontColor($r('app.color.color_222222'))
.backgroundColor(Color.White)
}
.id("allSelect_Button")
.margin({left:'31lpx'})
.alignRules({
center: {anchor: "__container__", align: VerticalAlign.Center},
left: {anchor: "__container__", align: HorizontalAlign.Start}
})
.onClick(()=>{
this.isAllSelect = !this.isAllSelect;
this.selectAllCallback(this.isAllSelect)
})
Button('删除'+ (this.deleteNum === 0 ? '':'('+this.deleteNum.toString()+')'))
.type(ButtonType.Normal)
.fontColor(this.deleteNum === 0?$r('app.color.color_222222'):$r('app.color.color_ED2800'))
.backgroundColor(Color.White)
.id("delete_Button")
.alignRules({
center: {anchor: "__container__", align: VerticalAlign.Center},
right: {anchor: "__container__", align: HorizontalAlign.End}
})
.margin({right:'31lpx'})
.onClick(()=>{
this.confirmCallback()
})
}
.height('8%')
.width('100%')
.backgroundColor(Color.White)
}
}
\ No newline at end of file
... ...
@Component
export struct CustomSelectUI {
@State isOn: boolean = false
selectCallback: (isOn: boolean) => void = () => {
}
build() {
Button(){
Image(this.isOn?$r("app.media.MyCollection_selected_icon"):$r("app.media.MyCollection_unselected_icon"))
}
.backgroundColor(Color.White)
.type(ButtonType.Normal)
.width('20')
.height('20')
.onClick(() => {
this.isOn = !this.isOn;
this.selectCallback(this.isOn)
})
}
}
\ No newline at end of file
... ...
... ... @@ -10,8 +10,8 @@ export struct HeadPictureCardComponent {
Stack() {
Image(this.compDTO.operDataList[0].coverUrl)
.width(CommonConstants.FULL_WIDTH)
.height(CommonConstants.FULL_HEIGHT)
.autoResize(true)
.borderRadius($r('app.float.image_border_radius'))
if (this.compDTO.operDataList[0].newsTitle) {
Row()
.width(CommonConstants.FULL_WIDTH)
... ... @@ -38,7 +38,6 @@ export struct HeadPictureCardComponent {
}
.alignContent(Alignment.Bottom)
.width(CommonConstants.FULL_WIDTH)
.height(200)
.padding(
{ top: 16, bottom: 16, left: 14, right: 14 })
.onClick((event: ClickEvent) => {
... ...
import { ToastUtils, Logger } from 'wdKit';
import { ToastUtils, Logger, NumberFormatterUtils } from 'wdKit';
import {
InputMethodProperty,
batchLikeAndCollectResult,
batchLikeAndCollectParams,
ContentDetailDTO,
postExecuteLikeParams,
contentListParams,
InteractDataDTO,
postExecuteCollectRecordParams
} from 'wdBean';
import router from '@ohos.router';
import inputMethod from '@ohos.inputMethod';
import { MultiPictureDetailViewModel } from '../../viewmodel/MultiPictureDetailViewModel';
import { HttpUrlUtils } from 'wdNetwork/Index';
import { WDRouterPage, WDRouterRule } from 'wdRouter/Index';
import { PageRepository } from '../../repository/PageRepository';
export interface OperationItem {
icon: Resource;
icon_check?: Resource;
text: string | Resource;
num?: number; // 个数
}
const TAG = 'OperRowListView';
@Preview
@Component
export struct OperRowListView {
private contentDetailData: ContentDetailDTO = {} as ContentDetailDTO
@State interactData: InteractDataDTO = {} as InteractDataDTO
@State newsStatusOfUser: batchLikeAndCollectResult | undefined = undefined // 点赞、收藏状态
@State operationList: OperationItem[] = [
{
icon: $r('app.media.ic_comment'),
text: "评论",
},
{
icon: $r('app.media.ic_like_uncheck'),
icon_check: $r('app.media.ic_like_check'),
text: "点赞",
num: 6622
},
{
icon: $r('app.media.ic_collect_uncheck'),
icon_check: $r('app.media.ic_collect_check'),
text: "收藏",
num: 662,
},
{
icon: $r('app.media.ic_comment'),
text: "评论",
num: 500,
},
{
icon: $r('app.media.ic_share'),
... ... @@ -33,19 +54,64 @@ export struct OperRowListView {
]
aboutToAppear() {
if (HttpUrlUtils.getUserId()) {
this.getInteractDataStatus()
}
this.queryContentInteractCount()
}
build() {
Row() {
ForEach(this.operationList, (item: OperationItem, index: number) => {
this.buildOperationItem(item, index)
}, (item: OperationItem, index: number) => JSON.stringify(item))
Flex({ justifyContent: FlexAlign.SpaceBetween, alignItems:ItemAlign.Center }){
Row() {
Column() {
Image($r('app.media.icon_arrow_left_white'))
.width(24)
.height(24)
.aspectRatio(1)
.interpolation(ImageInterpolation.High)
}
.margin({
top: 0,
left: 8,
right: 8,
bottom: 0
})
.alignItems(HorizontalAlign.Center)
.hoverEffect(HoverEffect.Scale)
.onClick(() => {
router.back();
})
TextInput({placeholder:'说两句...'})
.placeholderColor('#999999')
.placeholderFont(
{
size: 12,
weight: 400,
family: 'PingFang SC-Regular'
}
)
.caretColor('#1A1A1A')
.backgroundColor('#1A1A1A')
.width('61.5%')
.height(30)
.borderRadius(0)
.onClick(() => {
this.buildInputMethod()
})
}
.width('45.5%')
.alignItems(VerticalAlign.Center)
.justifyContent(FlexAlign.Start)
Flex({ justifyContent: FlexAlign.SpaceAround, alignItems:ItemAlign.Center }) {
ForEach(this.operationList, (item: OperationItem, index: number) => {
this.buildOperationItem(item, index)
}, (item: OperationItem) => JSON.stringify(item))
}
.width('54.5%')
}
.width('100%')
.height('100%')
.alignItems(VerticalAlign.Center)
.justifyContent(FlexAlign.Center)
.height(56)
.backgroundColor(Color.Black)
}
/**
... ... @@ -56,17 +122,288 @@ export struct OperRowListView {
@Builder
buildOperationItem(item: OperationItem, index: number) {
Column() {
Image(item.icon)
.width(24)
.height(24)
.aspectRatio(1)
if (item.text === '点赞') {
RelativeContainer() {
Row() {
Image(this.newsStatusOfUser?.likeStatus == '1' ? item.icon_check : item.icon)
.width(24)
.height(24)
.aspectRatio(1)
.interpolation(ImageInterpolation.High)
.onClick(() => {
this.toggleLikeStatus()
})
}
.alignRules({
center: { anchor: '__container__', align: VerticalAlign.Center },
middle: { anchor: '__container__', align: HorizontalAlign.Center }
})
.id(`e_row1_${index}`)
if(this.interactData?.likeNum > 0) {
Row() {
Image($r('app.media.corner_mark'))
.width(25)
.height(12)
.interpolation(ImageInterpolation.High)
}
.alignRules({
top: { anchor: `e_row1_${index}`, align: VerticalAlign.Top },
left: { anchor: `e_row1_${index}`, align: HorizontalAlign.Center }
})
.id(`e_row2_${index}`)
Row() {
Text(`${this.interactData?.likeNum}`)
.fontSize(8)
.textAlign(TextAlign.Center)
.fontColor(Color.White)
.lineHeight(12)
}
.alignRules({
top: { anchor: `e_row2_${index}`, align: VerticalAlign.Top },
middle: { anchor: `e_row2_${index}`, align: HorizontalAlign.Center }
})
.id(`e_row3_${index}`)
}
}
.id(`e_icon_${index}`)
} else if (item.text === '收藏') {
RelativeContainer() {
Row() {
Image(this.newsStatusOfUser?.collectStatus == 1 ? item.icon_check : item.icon)
.width(24)
.height(24)
.aspectRatio(1)
.interpolation(ImageInterpolation.High)
.onClick(() => {
this.toggleCollectStatus()
})
}
.alignRules({
center: { anchor: '__container__', align: VerticalAlign.Center },
middle: { anchor: '__container__', align: HorizontalAlign.Center }
})
.id(`e_row1_${index}`)
if(this.interactData?.collectNum > 0) {
Row() {
Image($r('app.media.corner_mark'))
.width(25)
.height(12)
.interpolation(ImageInterpolation.High)
}
.alignRules({
top: { anchor: `e_row1_${index}`, align: VerticalAlign.Top },
left: { anchor: `e_row1_${index}`, align: HorizontalAlign.Center }
})
.id(`e_row2_${index}`)
Row() {
Text(`${this.interactData?.collectNum}`)
.fontSize(8)
.textAlign(TextAlign.Center)
.fontColor(Color.White)
.lineHeight(12)
}
.alignRules({
top: { anchor: `e_row2_${index}`, align: VerticalAlign.Top },
middle: { anchor: `e_row2_${index}`, align: HorizontalAlign.Center }
})
.id(`e_row3_${index}`)
}
}
.id(`e_icon_${index}`)
} else if (item.text === '评论') {
RelativeContainer() {
Row() {
Image(item.icon)
.width(24)
.height(24)
.aspectRatio(1)
.interpolation(ImageInterpolation.High)
.onClick((event: ClickEvent) => {
ToastUtils.showToast('评论为公共方法,待开发', 1000);
})
}
.alignRules({
center: { anchor: '__container__', align: VerticalAlign.Center },
middle: { anchor: '__container__', align: HorizontalAlign.Center }
})
.id(`e_row1_${index}`)
if(this.interactData?.commentNum > 0) {
Row() {
Image($r('app.media.corner_mark'))
.width(25)
.height(12)
.interpolation(ImageInterpolation.High)
}
.alignRules({
top: { anchor: `e_row1_${index}`, align: VerticalAlign.Top },
left: { anchor: `e_row1_${index}`, align: HorizontalAlign.Center }
})
.id(`e_row2_${index}`)
Row() {
Text(`${this.interactData?.commentNum}`)
.fontSize(8)
.textAlign(TextAlign.Center)
.fontColor(Color.White)
.lineHeight(12)
}
.alignRules({
top: { anchor: `e_row2_${index}`, align: VerticalAlign.Top },
middle: { anchor: `e_row2_${index}`, align: HorizontalAlign.Center }
})
.id(`e_row3_${index}`)
}
}
.id(`e_icon_${index}`)
} else {
RelativeContainer() {
Row() {
Image(item.icon)
.width(24)
.height(24)
.aspectRatio(1)
.interpolation(ImageInterpolation.High)
.onClick((event: ClickEvent) => {
ToastUtils.showToast('分享为公共方法,待开发', 1000);
})
}
.alignRules({
center: { anchor: '__container__', align: VerticalAlign.Center },
middle: { anchor: '__container__', align: HorizontalAlign.Center }
})
.id(`e_row1_${index}`)
}
.id(`e_icon_${index}`)
}
}
.margin(5)
.alignItems(HorizontalAlign.Center)
.hoverEffect(HoverEffect.Scale)
.onClick((event: ClickEvent) => {
Logger.info(TAG, `buildOperationItem onClick event index: ${index}`);
ToastUtils.showToast('体验版,本功能暂未开发', 1000);
}
/**
* 输入法
*/
private buildInputMethod() {
let im = inputMethod.getCurrentInputMethod();
let prop: InputMethodProperty = {
packageName: im.packageName,
methodId: im.methodId,
name: im.name,
id: im.id,
extra: {}
}
try{
inputMethod.switchInputMethod(prop, (err, result) => {
if (err !== undefined) {
console.error('Failed to switchInputMethod: ' + JSON.stringify(err));
return;
}
if (result) {
console.info('Succeeded in switching inputmethod.');
} else {
console.error('Failed to switchInputMethod.');
}
});
} catch(err) {
console.error('Failed to switchInputMethod: ' + JSON.stringify(err));
}
}
// 已登录->查询用户对作品点赞、收藏状态
private async getInteractDataStatus() {
try {
const params: batchLikeAndCollectParams = {
contentList: [
{
contentId: this.contentDetailData?.newsId + '',
contentType: this.contentDetailData?.newsType + '',
}
]
}
console.error(TAG, JSON.stringify(this.contentDetailData))
let data = await MultiPictureDetailViewModel.getInteractDataStatus(params)
console.error(TAG, '查询用户对作品点赞、收藏状态', JSON.stringify(data))
this.newsStatusOfUser = data[0];
Logger.info(TAG, `newsStatusOfUser:${JSON.stringify(this.newsStatusOfUser)}`)
} catch (exception) {
console.error(TAG, JSON.stringify(exception))
}
}
/**
* 点赞、取消点赞
*/
toggleLikeStatus() {
// 未登录,跳转登录
if (!HttpUrlUtils.getUserId()) {
WDRouterRule.jumpWithPage(WDRouterPage.loginPage)
return
}
const params: postExecuteLikeParams = {
status: this.newsStatusOfUser?.likeStatus === '1' ? '0' : '1',
contentId: this.contentDetailData?.newsId + '',
contentType: this.contentDetailData?.newsType + '',
}
PageRepository.postExecuteLike(params).then(res => {
console.log(TAG, '点赞、取消点赞', 'toggleLikeStatus==',)
if (this.newsStatusOfUser) {
this.newsStatusOfUser.likeStatus = this.newsStatusOfUser?.likeStatus === '1' ? '0' : '1'
this.queryContentInteractCount()
}
})
}
/**
* 收藏、取消收藏
*/
toggleCollectStatus() {
// 未登录,跳转登录
if (!HttpUrlUtils.getUserId()) {
WDRouterRule.jumpWithPage(WDRouterPage.loginPage)
return
}
const params: postExecuteCollectRecordParams = {
status: this.newsStatusOfUser?.collectStatus === 1 ? '0' : '1',
contentList: [{
contentId: this.contentDetailData?.newsId + '',
contentType: this.contentDetailData?.newsType + '',
}],
}
PageRepository.postExecuteCollectRecord(params).then(res => {
console.log(TAG, '收藏、取消收藏','toggleLikeStatus==',)
if (this.newsStatusOfUser) {
this.newsStatusOfUser.collectStatus = this.newsStatusOfUser?.collectStatus === 1 ? 0 : 1
this.queryContentInteractCount()
}
})
}
/**
* 查询点赞、收藏数量
*/
queryContentInteractCount() {
console.error(TAG,'contentDetailData2222', JSON.stringify(this.contentDetailData))
const params: contentListParams = {
contentList: [{
contentId: this.contentDetailData?.newsId + '',
contentType: this.contentDetailData?.newsType,
}]
}
PageRepository.getContentInteract(params).then(res => {
if (res.data) {
this.interactData.likeNum = NumberFormatterUtils.formatNumberWithWan(res.data[0]?.likeNum)
this.interactData.collectNum = NumberFormatterUtils.formatNumberWithWan(res.data[0]?.collectNum)
this.interactData.commentNum = NumberFormatterUtils.formatNumberWithWan(res.data[0]?.commentNum)
}
console.log(TAG, '获取互动点赞等数据===', JSON.stringify(res))
console.log(TAG, 'this.interactData', JSON.stringify(this.interactData))
})
}
}
\ No newline at end of file
... ...
... ... @@ -47,7 +47,7 @@ export struct ZhGridLayoutComponent {
buildItemCard(item: ContentDTO) {
Column() {
Image(item.coverUrl)
.borderRadius(5)
.width(44)
.aspectRatio(1 / 1)
.margin(16)
Text(item.newsTitle)
... ...
import { Logger } from 'wdKit';
import { AreaListManageModel, AreaListModel } from '../../../model/AreaListModel';
import EditInfoViewModel from '../../../viewmodel/EditInfoViewModel';
import { FirstLevelComponent } from './FirstLevelComponent';
... ... @@ -12,11 +13,7 @@ export struct AreaPickerDialog {
title: string = '地区选择'
@Provide dataSource: AreaListModel[] = []
result: JSON[] = [];
aboutToAppear(){
this.currentFirst = EditInfoViewModel.getAreaListManageModel(this.dataSource[0])
this.currentSecondBean = EditInfoViewModel.getAreaListManageModel(this.dataSource[0].children[0])
this.currentThirdBean = EditInfoViewModel.getAreaListManageModel(this.dataSource[0].children[0].children[0])
confirmCallback: (area:string) => void = () => {
}
build() {
... ... @@ -39,7 +36,8 @@ export struct AreaPickerDialog {
Button('确定',{type:ButtonType.Normal})
.onClick(()=> {
this.controller.close()
this.confirmCallback(this.currentFirst.label+this.currentSecondBean.label+this.currentThirdBean.label);
})
.backgroundColor(0xffffff)
.fontColor(Color.Blue)
... ...
... ... @@ -12,6 +12,7 @@ export struct FirstLevelComponent {
const element = this.dataSource[index];
this.labelList.push(element.label)
}
this.currentFirst = EditInfoViewModel.getAreaListManageModel(this.dataSource[this.select])
}
build() {
... ... @@ -21,10 +22,10 @@ export struct FirstLevelComponent {
Text('暂无数据').fontSize(20)
}else {
TextPicker({range:this.labelList,selected:this.select})
// .onChange((value:string,index:number) => {
// this.select = index
// this.currentFirst = EditInfoViewModel.getAreaListManageModel(this.dataSource[index])
// })
.onChange((value: string | string[], index: number | number[]) => {
this.select = index as number
this.currentFirst = EditInfoViewModel.getAreaListManageModel(this.dataSource[index as number])
})
.backgroundColor(Color.White)
.border({color:'#e2e2e2',width:{right:0.5}})
.width('100%')
... ...
import { AreaListManageModel, AreaListModel } from '../../../model/AreaListModel';
import EditInfoViewModel from '../../../viewmodel/EditInfoViewModel';
@Component
export struct SecondLevelComponent {
@State mTip: string = '暂无数据'
... ... @@ -8,13 +8,6 @@ export struct SecondLevelComponent {
@Consume @Watch('onFirstChange') currentFirst: AreaListManageModel;
@Consume currentSecondBean: AreaListManageModel
aboutToAppear(){
for (let index = 0; index < this.currentFirst.children.length; index++) {
const element = this.currentFirst.children[index];
this.labelList.push(element.label)
}
}
build() {
Column(){
Column(){
... ... @@ -22,10 +15,10 @@ export struct SecondLevelComponent {
Text(this.mTip).fontSize(20)
}else {
TextPicker({range:this.labelList,selected:this.select})
// .onChange((value:string,index:number) => {
// this.select = index
// this.currentSecondBean = this.currentFirst.children[index]
// })
.onChange((value: string | string[], index: number | number[]) => {
this.select = index as number
this.currentSecondBean = EditInfoViewModel.getAreaListManageModel(this.currentFirst.children[index as number])
})
.backgroundColor(Color.White)
.border({color:'#e2e2e2',width:{right:0.5}})
.width('100%')
... ... @@ -47,7 +40,7 @@ export struct SecondLevelComponent {
const element = this.currentFirst.children[index];
this.labelList.push(element.label)
}
// this.currentSecondBean = this.currentFirst.children[this.select]
this.currentSecondBean = EditInfoViewModel.getAreaListManageModel(this.currentFirst.children[this.select])
}
}
}
\ No newline at end of file
... ...
import { AreaListManageModel, AreaListModel } from '../../../model/AreaListModel';
import EditInfoViewModel from '../../../viewmodel/EditInfoViewModel';
@Component
export struct ThirdLevelComponent {
@State mTip: string = '暂无数据'
... ... @@ -9,13 +9,6 @@ export struct ThirdLevelComponent {
@Consume @Watch('onSecondChange') currentSecondBean: AreaListManageModel;
@Consume currentThirdBean: AreaListManageModel
aboutToAppear(){
for (let index = 0; index < this.currentSecondBean.children.length; index++) {
const element = this.currentSecondBean.children[index];
this.labelList.push(element.label)
}
}
build() {
Column(){
Column(){
... ... @@ -23,10 +16,10 @@ export struct ThirdLevelComponent {
Text(this.mTip).fontSize(20)
}else {
TextPicker({range:this.labelList,selected:this.select})
// .onChange((value:string,index:number) => {
// this.select = index
// this.currentThirdBean = this.currentSecondBean.children[index]
// })
.onChange((value: string | string[], index: number | number[]) => {
this.select = index as number
this.currentThirdBean = EditInfoViewModel.getAreaListManageModel(this.currentSecondBean.children[index as number])
})
.backgroundColor(Color.White)
.border({color:'#e2e2e2',width:{right:0.5}})
.width('100%')
... ... @@ -52,7 +45,7 @@ export struct ThirdLevelComponent {
const element = this.currentSecondBean.children[index];
this.labelList.push(element.label)
}
// this.currentThirdBean = this.currentSecondBean.children[this.select]
this.currentThirdBean = EditInfoViewModel.getAreaListManageModel(this.currentSecondBean.children[this.select])
}
}
}
\ No newline at end of file
... ...
/**
* WDEditDataModelType 更新资料类型
*/
export const enum WDEditDataModelType {
WDEditDataModelType_default, //默认不修改
WDEditDataModelType_head, //头像
WDEditDataModelType_nickname, //昵称
WDEditDataModelType_intro, //简介
WDEditDataModelType_sex, //性别
WDEditDataModelType_birthday, //生日
WDEditDataModelType_region, //地址
}
export class EditListInfo{
//标题
title:string
... ... @@ -11,32 +24,57 @@ export class EditListInfo{
}
}
export interface EditInfoModel{
export class EditInfoModel{
//头像
headPhotoUrl:string
headPhotoUrl:string = ''
//简介
introduction:string
introduction:string = ''
//城市
city:string
city:string = ''
//地区
county:string
county:string = ''
//生日
birthday:string
birthday:string = ''
//性别
sex:number
sex:string = ''
airec:number
airec:number = 0
constructor(headPhotoUrl?:string , introduction?:string,city?:string , county?:string,birthday?:string , sex?:string,airec?:number) {
}
}
export interface editModel{
userName:string
export class editModel{
userName:string = ''
userNameStatus:string = ''
userNameStatus:string
phone:string = ''
phone:string
headPhotoStatus:string = ''
headPhotoStatus:string
userExtend:EditInfoModel = new EditInfoModel()
editDataType:WDEditDataModelType = 0
constructor(userName?:string , userNameStatus?:string,phone?:string , headPhotoStatus?:string,userExtend?:EditInfoModel,editDataType?:WDEditDataModelType) {
}
}
userExtend:EditInfoModel
export interface editModelParams {
editContent?: string;
userName?: string;
introduction?: string;
//地区
city?:string;
county?:string;
province?:string;
//生日
birthday?:string;
//性别
sex?:string;
}
\ No newline at end of file
... ...
... ... @@ -197,16 +197,15 @@ struct MineHomePage {
this.currentIndex = index
})
.vertical(false)
.height("100%")
}.width("100%")
}
.edgeEffect(EdgeEffect.None)
.scrollBar(BarState.Off)
.width('100%')
.height('100%')
.layoutWeight(1)
}
}.width('100%')
.height('100%')
.layoutWeight(1)
}
@Builder MineHomeTitleTransparent() {
... ...
... ... @@ -190,16 +190,15 @@ struct OtherNormalUserHomePage {
this.currentIndex = index
})
.vertical(false)
.height("100%")
}.width("100%")
}
.edgeEffect(EdgeEffect.None)
.scrollBar(BarState.Off)
.width('100%')
.height('100%')
.layoutWeight(1)
}
}.width('100%')
.height('100%')
.layoutWeight(1)
}
@Builder MineHomeTitleTransparent() {
... ...
... ... @@ -5,13 +5,19 @@ import {
CompInfoBean,
ContentDetailDTO,
InteractDataDTO,
InteractDataStatusBean,
batchLikeAndCollectResult,
MorningEveningPaperDTO,
NavigationBodyDTO,
NewspaperListBean,
NewspaperTimeInfoBean,
PageDTO,
PageInfoBean
PageInfoBean,
postBatchAttentionStatusParams,
postBatchAttentionStatusResult,
postExecuteLikeParams,
postExecuteCollectRecordParams,
contentListParams,
postInteractAccentionOperateParams
} from 'wdBean';
const TAG = 'HttpRequest';
... ... @@ -99,7 +105,7 @@ export class PageRepository {
}
/**
* 早晚报pageInfo请求 TODO 现网无数据写死测试环境
* 早晚报pageInfo请求
* */
static getMorningEveningPageInfoUrl(pageId: string) {
let url = HttpUrlUtils.getHost() + HttpUrlUtils.MORNING_EVENING_PAGE_INFO_PATH;
... ... @@ -118,7 +124,7 @@ export class PageRepository {
*
* 可选
* channelId:频道id
* channelStrategy:频道策略 TODO 现网无数据写死测试环境
* channelStrategy:频道策略
* topicId:专题id
* */
static getMorningEveningCompInfoUrl(pageId: number, groupId: number, refreshTime: string, topicId: string, pageNum: number, pageSize: number) {
... ... @@ -172,9 +178,41 @@ export class PageRepository {
static fetchInteractDataStatus(param: object) {
let url = PageRepository.getInteractDataStatusUrl()
let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();
return WDHttp.post<ResponseDTO<InteractDataStatusBean[]>>(url, param, headers)
return WDHttp.post<ResponseDTO<batchLikeAndCollectResult[]>>(url, param, headers)
};
/**
* 用户点赞、取消点赞
* @param params
* @returns
*/
static postExecuteLike(params: postExecuteLikeParams): Promise<ResponseDTO> {
let url = HttpUrlUtils.getHost() + HttpUrlUtils.INTERACT_EXECUTELIKE
let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();
return WDHttp.post0(url, params, headers)
}
/**
* 用户收藏、取消收藏
* @param params
* @returns
*/
static postExecuteCollectRecord(params: postExecuteCollectRecordParams): Promise<ResponseDTO> {
let url = HttpUrlUtils.getHost() + HttpUrlUtils.INTERACT_EXECUTECOLLECTRECORD
let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();
return WDHttp.post0(url, params, headers)
}
/**
*
* @returns
*/
static getContentInteract(params: contentListParams): Promise<ResponseDTO<InteractDataDTO[]>> {
let url = HttpUrlUtils.getHost() + HttpUrlUtils.INTERACT_DATA_PATH
let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();
return WDHttp.post0(url, params, headers)
}
// 浏览历史新增、删除接口
static fetchInteractBrowsOperate(param: object) {
let url = PageRepository.getInteractBrowsOperateUrl()
... ... @@ -182,6 +220,25 @@ export class PageRepository {
return WDHttp.post<ResponseDTO<null>>(url, param, headers)
};
/**
* 批量查号主是否为用户关注
* @returns
*/
static fetchBatchAttentionStatus(params: postBatchAttentionStatusParams): Promise<ResponseDTO<postBatchAttentionStatusResult[]>> {
let url = HttpUrlUtils.getHost() + HttpUrlUtils.FOLLOW_LIST_STATUS_DATA_PATH
let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();
return WDHttp.post0(url, params, headers)
}
/**
* 关注号主
*/
static postInteractAccentionOperate(params: postInteractAccentionOperateParams): Promise<ResponseDTO> {
let url = HttpUrlUtils.getHost() + HttpUrlUtils.INTERACT_ACCENTION_OPERATION
let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();
return WDHttp.post0(url, params, headers)
}
static fetchNewspaperInfo(date: string) {
let url = PageRepository.getNewspaperInfoUrl(date)
let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();
... ... @@ -211,4 +268,28 @@ export class PageRepository {
let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();
return WDHttp.get<ResponseDTO<CompInfoBean>>(url, headers)
};
}
\ No newline at end of file
/**
* 获取播报pageInfo
* */
static fetchBroadcastPageInfo(pageId: string) {
let url = PageRepository.getMorningEveningPageInfoUrl(pageId)
let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();
return WDHttp.get<ResponseDTO<PageInfoBean>>(url, headers)
};
/**
* 获取播报compInfo
* https://pdapis.pdnews.cn/api/rmrb-bff-display-zh/display/zh/c/compInfo
* @param params
* @returns
* */
static fetchBroadcastCompInfo(pageId: number, groupId: number, refreshTime: string, topicId:
string, channelId: string) {
let url = HttpUrlUtils.getHost() + HttpUrlUtils.MORNING_EVENING_COMP_INFO_PATH;
url = `${url}?topicId=${topicId}&channelStrategy=2&groupId=${groupId}&refreshTime=${refreshTime}&pageSize=50&recommend=0&pageId=${pageId}&loadStrategy=first_load&pageNum=1&channelId=${channelId}`
Logger.info(TAG, "getMorningEveningCompInfoUrl url = " + url)
let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();
return WDHttp.get<ResponseDTO<CompInfoBean>>(url, headers)
};
}
... ...
import { CompInfoBean, PageInfoBean } from 'wdBean/Index';
import { Logger } from 'wdKit/Index';
import { ResponseDTO } from 'wdNetwork/Index';
import { PageRepository } from '../repository/PageRepository';
const TAG = 'BroadcastViewModel'
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>) => {
if (!resDTO || !resDTO.data) {
Logger.error(TAG, 'getBroadcastViewPageInfo then navResDTO is empty');
error('resDTO is empty');
return
}
if (resDTO.code != 0) {
Logger.error(TAG, `getBroadcastViewPageInfo then code:${resDTO.code}, message:${resDTO.message}`);
error('resDTO Response Code is failure');
return
}
// let navResStr = JSON.stringify(navResDTO);
Logger.info(TAG, "getBroadcastViewPageInfo then,navResDTO.timestamp:" + resDTO.timestamp);
success(resDTO.data);
}).catch((err: Error) => {
Logger.error(TAG, `getBroadcastViewPageInfo catch, error.name : ${err.name}, error.message:${err.message}`);
error(err);
})
})
}
// 获取播报组件信息:https://pdapis.pdnews.cn/api/rmrb-bff-display-zh/display/zh/c/compInfo?topicId=&
// channelStrategy=2&groupId=30113&refreshTime=1712023953772&pageSize=50&recommend=0&pageId=21003&loadStrategy=first_load&pageNum=1&channelId=2066
static async getBroadcastCompInfo(pageId: number, groupId: number, refreshTime: string, topicId: string, channelId: string): Promise<CompInfoBean> {
return new Promise<CompInfoBean>((success, error) => {
Logger.info(TAG, `getMorningEveningCompInfo pageInfo start`);
PageRepository.fetchBroadcastCompInfo(pageId, groupId, refreshTime, topicId, channelId)
.then((resDTO: ResponseDTO<CompInfoBean>) => {
if (!resDTO || !resDTO.data) {
Logger.error(TAG, 'getMorningEveningCompInfo then navResDTO is empty');
error('resDTO is empty');
return
}
if (resDTO.code != 0) {
Logger.error(TAG, `getMorningEveningCompInfo then code:${resDTO.code}, message:${resDTO.message}`);
error('resDTO Response Code is failure');
return
}
// let navResStr = JSON.stringify(navResDTO);
Logger.info(TAG, "getMorningEveningCompInfo then,navResDTO.timestamp:" + resDTO.timestamp);
success(resDTO.data);
})
.catch((err: Error) => {
Logger.error(TAG, `getMorningEveningCompInfo catch, error.name : ${err.name}, error.message:${err.message}`);
error(err);
})
})
}
}
\ No newline at end of file
... ...
import { EditInfoModel, EditListInfo, editModel } from '../model/EditInfoModel';
import { EditInfoModel, EditListInfo, editModel, editModelParams, WDEditDataModelType } from '../model/EditInfoModel';
import HashMap from '@ohos.util.HashMap';
import { HttpUrlUtils, ResponseDTO, WDHttp } from 'wdNetwork';
import { Logger, ResourcesUtils } from 'wdKit';
... ... @@ -27,15 +27,20 @@ class EditInfoViewModel {
return WDHttp.get<ResponseDTO>(requestUrl,headers)
}
BasePOSTRequest(requestUrl:string){
let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders()
requestUrl = HttpUrlUtils.HOST_SIT + requestUrl
return WDHttp.post<ResponseDTO>(requestUrl,headers)
}
getEditListInfo(item?:editModel):EditListInfo[]{
this.editListData = [
new EditListInfo('昵称',item&&item.userName?item.userName:'待完善'),
new EditListInfo('简介',item&&item.userExtend.introduction?item.userExtend.introduction:'待完善'),
new EditListInfo('地区',item&&item.userExtend.city?item.userExtend.city:'待完善'),
new EditListInfo('生日',item&&item.userExtend.birthday?item.userExtend.birthday:'待完善'),
new EditListInfo('性别',item&&item.userExtend.sex?item.userExtend.sex===1?'男':'女':'待完善'),
]
new EditListInfo('昵称',item&&item.userName.length > 0?item.userName:'待完善'),
new EditListInfo('简介',item&&item.userExtend.introduction.length > 0?item.userExtend.introduction:'待完善'),
new EditListInfo('地区',item&&item.userExtend.city.length > 0?item.userExtend.city:'待完善'),
new EditListInfo('生日',item&&item.userExtend.birthday.length > 0?item.userExtend.birthday:'待完善'),
new EditListInfo('性别',item&&item.userExtend.sex.length > 0?(item.userExtend.sex=== '1'?'男':'女'):'待完善'),]
return this.editListData
}
... ... @@ -51,7 +56,6 @@ class EditInfoViewModel {
}).catch((error: Error) => {
Logger.info('EditInfoViewModel','EditInfoViewModel','EditInfoViewModel')
success(this.GetqueryAccountOwnerLocal(context))
})
}))
}
... ... @@ -61,14 +65,14 @@ class EditInfoViewModel {
let compRes: ResponseDTO<editModel> | null = await ResourcesUtils.getResourcesJson<ResponseDTO<editModel>>(context,'userInfo.json');
if (!compRes || !compRes.data) {
Logger.info(TAG, `getAppointmentListDataLocal compRes is empty`);
return {} as editModel
return new editModel()
}
Logger.info(TAG, `getAppointmentListDataLocal getResourcesJsonSync compRes : ${JSON.stringify(compRes)}`);
return compRes.data
}
getAreaList(context: Context):PromiseLike<AreaListModel[]>{
return new Promise(((success, error) => {
return new Promise((success, error) => {
success(this.getAreaListLocal(context))
// this.BaseGetRequest(HttpUrlUtils.APPOINTMENT_AccountOwner_PATH).then((navResDTO:ResponseDTO) =>{
// if (navResDTO.code == 200) {
... ... @@ -81,7 +85,7 @@ class EditInfoViewModel {
// success(this.GetqueryAccountOwnerLocal(context))
//
// })
}))
})
}
async getAreaListLocal(context: Context): Promise<AreaListModel[]> {
... ... @@ -99,9 +103,33 @@ class EditInfoViewModel {
return new AreaListManageModel(item.code,item.id,item.label,item.children)
}
updateUserInfo(){
}
// updateUserInfo(item?:editModel):Promise<ResponseDTO> {
// let params: editModelParams = {};
// if (item.editDataType === WDEditDataModelType.WDEditDataModelType_head) {
// // params =
// } else if (item.editDataType === WDEditDataModelType.WDEditDataModelType_nickname) {
// params = { userName: item.userName }
// } else if (item.editDataType === WDEditDataModelType.WDEditDataModelType_intro) {
// params = { introduction: item.userExtend.introduction }
// } else if (item.editDataType === WDEditDataModelType.WDEditDataModelType_sex) {
// params = { sex: item.userExtend.sex }
// } else if (item.editDataType === WDEditDataModelType.WDEditDataModelType_birthday) {
// params = { birthday: item.userExtend.birthday }
// } else if (item.editDataType === WDEditDataModelType.WDEditDataModelType_region) {
// params = { county: item.userExtend.county }
// } else {
// }
// return new Promise((success, error) => {
// this.BasePOSTRequest(HttpUrlUtils.APPOINTMENT_editUserDetail_PATH)
// .then((navResDTO: ResponseDTO) => {
// if (navResDTO.code == 200) {
// }
// })
// .catch((error: Error) => {
//
// })
// })
// }
}
... ...
import { Logger } from 'wdKit';
import { ResponseDTO } from 'wdNetwork';
import { ContentDetailDTO } from 'wdBean';
import { ContentDetailDTO,
batchLikeAndCollectParams,
batchLikeAndCollectResult,
postBatchAttentionStatusParams,
postBatchAttentionStatusResult,
postInteractBrowsOperateParams
} from 'wdBean';
import { PageRepository } from '../repository/PageRepository';
const TAG = 'MultiPictureDetailViewModel';
export class MultiPictureDetailViewModel {
/*fetchDetailData
fetchInteractData
fetchInteractDataStatus
fetchInteractBrowsOperate*/
static async getDetailData(relId: string, contentId: string, relType: string): Promise<ContentDetailDTO[]> {
return new Promise<ContentDetailDTO[]>((success, error) => {
Logger.info(TAG, `fetchDetailData start`);
... ... @@ -34,4 +35,75 @@ export class MultiPictureDetailViewModel {
})
})
}
/**
* 批量查询作品查询点赞、收藏状态
* @returns
*/
static async getInteractDataStatus(params:batchLikeAndCollectParams): Promise<batchLikeAndCollectResult[]> {
return new Promise<batchLikeAndCollectResult[]>((success, error) => {
Logger.info(TAG, `fetchInteractDataStatus start`);
PageRepository.fetchInteractDataStatus(params).then((resDTO: ResponseDTO<batchLikeAndCollectResult[]>) => {
if (!resDTO || !resDTO.data) {
Logger.error(TAG, 'fetchInteractDataStatus is empty');
error('resDTO is empty');
return
}
if (resDTO.code != 0) {
Logger.error(TAG, `fetchInteractDataStatus then code:${resDTO.code}, message:${resDTO.message}`);
error('resDTO Response Code is failure');
return
}
Logger.info(TAG, "fetchInteractDataStatus then,navResDTO.timestamp:" + resDTO.timestamp);
success(resDTO.data);
}).catch((err: Error) => {
Logger.error(TAG, `fetchInteractDataStatus catch, error.name : ${err.name}, error.message:${err.message}`);
error(err);
})
})
}
// 已登录->批量查作品是否被号主关注
static async getBatchAttentionStatus(params: postBatchAttentionStatusParams): Promise<postBatchAttentionStatusResult[]> {
return new Promise<postBatchAttentionStatusResult[]>((success, error) => {
Logger.info(TAG, `fetchBatchAttentionStatus start`);
PageRepository.fetchBatchAttentionStatus(params).then((resDTO: ResponseDTO<postBatchAttentionStatusResult[]>) => {
if (!resDTO || !resDTO.data) {
Logger.error(TAG, 'fetchBatchAttentionStatus is empty');
error('resDTO is empty');
return
}
if (resDTO.code != 0) {
Logger.error(TAG, `fetchBatchAttentionStatus then code:${resDTO.code}, message:${resDTO.message}`);
error('resDTO Response Code is failure');
return
}
Logger.info(TAG, "fetchBatchAttentionStatus then,navResDTO.timestamp:" + resDTO.timestamp);
success(resDTO.data);
}).catch((err: Error) => {
Logger.error(TAG, `fetchBatchAttentionStatus catch, error.name : ${err.name}, error.message:${err.message}`);
error(err);
})
})
}
// 记录浏览历史
static async getInteractBrowsOperate(params: postInteractBrowsOperateParams): Promise<ResponseDTO<null>> {
return new Promise<ResponseDTO<null>>((success, error) => {
Logger.info(TAG, `fetchInteractBrowsOperate start`);
PageRepository.fetchInteractBrowsOperate(params).then((resDTO: ResponseDTO<null>) => {
if (resDTO.code != 0) {
Logger.error(TAG, `fetchInteractBrowsOperate then code:${resDTO.code}, message:${resDTO.message}`);
error('resDTO Response Code is failure');
return
}
Logger.info(TAG, "fetchInteractBrowsOperate then,navResDTO.timestamp:" + resDTO.timestamp);
success(resDTO);
}).catch((err: Error) => {
Logger.error(TAG, `fetchInteractBrowsOperate catch, error.name : ${err.name}, error.message:${err.message}`);
error(err);
})
})
}
}
... ...
... ... @@ -82,7 +82,11 @@
},
{
"name": "image_border_radius",
"value": "8vp"
"value": "5vp"
},
{
"name": "button_border_radius",
"value": "3vp"
},
{
"name": "border_radius_6",
... ...
import { Logger, ResourcesUtils } from 'wdKit';
import { HttpUrlUtils, ResponseDTO, WDHttp } from 'wdNetwork';
import { ContentDetailDTO } from 'wdBean';
import { ContentDetailDTO, InteractDataDTO } from 'wdBean';
import HashMap from '@ohos.util.HashMap';
const TAG = 'ContentDetailRequest';
... ... @@ -13,11 +13,118 @@ export interface ContentDetailRequestParams {
relType: string
}
export interface recommentVideoListParame {
export interface recommentVideoListParams {
pageSize: number;
refreshCnt: number;
}
interface contentListItem {
contentId: string;
contentType: number;
}
export interface contentListParams {
contentList: contentListItem[];
}
export interface IStatusContentList {
contentId: string;
// relType: string;
contentType: string;
// contentRelId: string;
}
export interface batchLikeAndCollectParams {
// userType: number;
// userId: string;
contentList: IStatusContentList[]
}
export interface batchLikeAndCollectResult {
collectStatus: number;
contentType: string;
likeStatus: string;
relType: string;
contentId: string;
contentRelId: string;
}
export interface postBatchAttentionStatusParamsItem {
creatorId: string;
}
export interface postBatchAttentionStatusParams {
creatorIds: postBatchAttentionStatusParamsItem[]
}
export interface postBatchAttentionStatusResult {
creatorId: string;
status: string;
userId: string;
}
export interface postExecuteLikeParams {
status: string;
contentId: string;
contentType: string;
relType?: string;
userName?: string;
title?: string;
contentRelId?: string;
userHeaderUrl?: string;
channelId?: string;
}
export interface postExecuteCollectRecordParamsItem {
contentId: string;
contentType: string;
relType?: string;
contentRelId?: string;
}
export interface postExecuteCollectRecordParams {
status: string;
contentList: postExecuteCollectRecordParamsItem[]
}
export interface postPointLevelOperateParams {
operateType: number;
}
export interface postCommentPublishParams {
targetId: string;
keyArticle: string;
commentPics: string;
targetTitle: string;
commentType: string;
targetType: string;
commentContent: string;
parentId: string;
rootCommentId: string;
}
export interface postInteractBrowsOperateParamsContent {
browseTime: string;
contentId: string;
contentType: number;
}
export interface postInteractBrowsOperateParams {
delStatus: number;
contentList: postInteractBrowsOperateParamsContent[]
}
export interface postInteractAccentionOperateParams {
attentionUserType: string;
attentionUserId: string;
attentionCreatorId: string;
// userType: number;
// userId: string;
status: number;
}
export class ContentDetailRequest {
static getContentDetailDataMock(context: Context): Promise<ResponseDTO<ContentDetailDTO[]>> {
... ... @@ -55,30 +162,30 @@ export class ContentDetailRequest {
*
* @returns
*/
static getContentInteract() {
static getContentInteract(params: contentListParams): Promise<ResponseDTO<InteractDataDTO[]>> {
let url = HttpUrlUtils.getHost() + HttpUrlUtils.INTERACT_DATA_PATH
let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();
return WDHttp.get(url, headers)
return WDHttp.post0(url, params, headers)
}
/**
*
* 批量查询作品查询点赞、收藏状态
* @returns
*/
static postBatchLikeAndCollectStatus() {
static postBatchLikeAndCollectStatus(params: batchLikeAndCollectParams): Promise<ResponseDTO<batchLikeAndCollectResult[]>> {
let url = HttpUrlUtils.getHost() + HttpUrlUtils.INTERACT_DATA_STATUS
let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();
return WDHttp.post(url, headers)
return WDHttp.post0(url, params, headers)
}
/**
*
* 批量查号主是否为用户关注
* @returns
*/
static postBatchAttentionStatus() {
static postBatchAttentionStatus(params: postBatchAttentionStatusParams): Promise<ResponseDTO<postBatchAttentionStatusResult[]>> {
let url = HttpUrlUtils.getHost() + HttpUrlUtils.FOLLOW_LIST_STATUS_DATA_PATH
let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();
return WDHttp.post(url, headers)
return WDHttp.post0(url, params, headers)
}
... ... @@ -87,9 +194,69 @@ export class ContentDetailRequest {
* @returns
*/
static postRecommendVideoList(params: recommentVideoListParame): Promise<ResponseDTO<ContentDetailDTO[]>> {
static postRecommendVideoList(params: recommentVideoListParams): Promise<ResponseDTO<ContentDetailDTO[]>> {
let url = HttpUrlUtils.getHost() + HttpUrlUtils.RECOMMEND_VIDEOLIST
let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();
return WDHttp.post0(url, params, headers)
}
/**
* 用户点赞、取消点赞
* @param params
* @returns
*/
static postExecuteLike(params: postExecuteLikeParams): Promise<ResponseDTO> {
let url = HttpUrlUtils.getHost() + HttpUrlUtils.INTERACT_EXECUTELIKE
let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();
return WDHttp.post0(url, params, headers)
}
/**
* 用户收藏、取消收藏
* @param params
* @returns
*/
static postExecuteCollectRecord(params: postExecuteCollectRecordParams): Promise<ResponseDTO> {
let url = HttpUrlUtils.getHost() + HttpUrlUtils.INTERACT_EXECUTECOLLECTRECORD
let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();
return WDHttp.post0(url, params, headers)
}
/**
*用户等级/积分-APP根据业务场景动态增减成长值(APP)
* 操作类型:1阅读 2评论 3回复(积分任务同评论) 4分享 5点赞 6关注 7打开客户端 8上传头像 9打开推送开关
*/
static postPointLevelOperate(params: postPointLevelOperateParams): Promise<ResponseDTO> {
let url = HttpUrlUtils.getHost() + HttpUrlUtils.USERPOINT_OPERATE
let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();
return WDHttp.post0(url, params, headers)
}
/**
* 评论发布
*/
static postCommentPublish(params: postCommentPublishParams): Promise<ResponseDTO> {
let url = HttpUrlUtils.getHost() + HttpUrlUtils.COMMENT_PUBLISH
let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();
return WDHttp.post0(url, params, headers)
}
/**
* 浏览历史新增、删除接口
*/
static postInteractBrowsOperate(params: postInteractBrowsOperateParams): Promise<ResponseDTO> {
let url = HttpUrlUtils.getHost() + HttpUrlUtils.INTERACT_BROWS_OPERATE
let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();
return WDHttp.post0(url, params, headers)
}
/**
* 关注号主
*/
static postInteractAccentionOperate(params: postInteractAccentionOperateParams): Promise<ResponseDTO> {
let url = HttpUrlUtils.getHost() + HttpUrlUtils.INTERACT_ACCENTION_OPERATION
let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();
return WDHttp.post0(url, params, headers)
}
}
\ No newline at end of file
... ...
import router from '@ohos.router';
import mediaquery from '@ohos.mediaquery';
import window from '@ohos.window';
import { Action, ContentDetailDTO, RmhInfoDTO, UserInfoDTO } from 'wdBean';
import { Logger, SPHelper, WindowModel } from 'wdKit';
import { PlayerConstants, WDPlayerController, WDPlayerRenderView } from 'wdPlayer';
import { devicePLSensorManager } from 'wdDetailPlayApi';
import { ContentDetailDTO, InteractDataDTO } from 'wdBean';
import { WDPlayerController, WDPlayerRenderView } from 'wdPlayer';
import { ContentDetailRequest, devicePLSensorManager } from 'wdDetailPlayApi';
import { PlayControlViewContainer } from '../view/PlayControlViewContainer';
import { PlayerDetailContainer } from '../view/PlayerDetailContainer';
import { PlayViewModel } from '../viewmodel/PlayViewModel';
import { DetailContainer } from '../view/DetailContainer';
import {
batchLikeAndCollectParams,
batchLikeAndCollectResult,
postBatchAttentionStatusParams,
postInteractBrowsOperateParams
} from 'wdDetailPlayApi/src/main/ets/request/ContentDetailRequest';
import { HttpUrlUtils } from 'wdNetwork/Index';
import { DateTimeUtils } from 'wdKit/Index';
const TAG = 'DetailPlayShortVideoPage';
... ... @@ -18,73 +22,104 @@ const TAG = 'DetailPlayShortVideoPage';
@Component
export struct DetailPlayShortVideoPage {
private contentId?: string = undefined
private relId?: string = undefined
private relType?: string = undefined
private contentDetailData: ContentDetailDTO | undefined = undefined
@Prop index: number = 0
@Prop @Watch('currentIndexChange') currentIndex: number = 0
private index: number = 0
private playerController: WDPlayerController = new WDPlayerController();
@Watch("urlChanged") @State url?: string = undefined
@Watch('changeContinue') @Provide nextContId?: string = '';
@Watch('getPlayHistory') @Provide curContId?: string = undefined;
@Watch("playVMChanged") @Provide playVM: PlayViewModel = new PlayViewModel();
@State playerController: WDPlayerController = new WDPlayerController();
@Provide contentDetailData: ContentDetailDTO | undefined = undefined
@Provide interactData: InteractDataDTO | undefined = undefined
@Provide isFullScreen: boolean = false;
@Provide canStart?: boolean = false;
@Provide status: number = PlayerConstants.STATUS_START;
@Provide userId: string = '';
@Provide newsSourceName?: string = ''
@Provide newsTitle?: string = ''
@Provide editorName?: string = ''
@Provide rmhInfo?: RmhInfoDTO | null = null
@Provide userInfo?: UserInfoDTO | null = null
@Provide message?: string = ''
@Provide newsSummary?: string = ''
@Provide progressVal: number = 0;
@Provide videoLandScape?: number = 1; // 视频朝向, 横屏视频:1;竖屏视频:2
playVMChanged() {
this.url = this.playVM.url
this.newsSourceName = this.playVM.newsSourceName
this.newsTitle = this.playVM.newsTitle
this.editorName = this.playVM.editorName
this.newsSummary = this.playVM.newsSummary
this.videoLandScape = this.playVM.videoLandScape ?? 1
this.curContId = this.playVM.contentId
this.nextContId = this.playVM.nextContId
this.canStart = this.playVM.canStart;
this.message = this.playVM.message
this.rmhInfo = this.playVM.rmhInfo
this.userInfo = this.playVM.userInfo
}
@Provide newsStatusOfUser: batchLikeAndCollectResult | undefined = undefined // 点赞、收藏状态
@Provide followStatus: string = '0' // 关注状态
currentIndexChange() {
console.log('currentIndexChange====', this.currentIndex)
if (this.currentIndex != this.index) {
this.playerController.pause()
if (this.index < this.currentIndex - 5 && this.playerController.getPlayer()) {
this.playerController.release()
}
} else {
console.log('currentIndexChange====1', this.playerController)
this.playerController.switchPlayOrPause()
this.queryNewsInfoOfUser()
console.log('currentIndex==== ', this.currentIndex)
if (!this.playerController.getPlayer()) {
console.error('state91111111===', this.contentDetailData?.videoInfo[0]?.videoUrl || '')
this.playerController.firstPlay(this.contentDetailData?.videoInfo[0]?.videoUrl || '');
console.error('state91111111===', this.playerController?.getPlayer()?.state)
} else {
console.error('state9===', this.playerController?.getPlayer()?.state)
this.playerController.play()
}
}
}
aboutToAppear() {
console.log('开始设置setContentDetailData', JSON.stringify(this.contentDetailData))
/**
* 查询用户点赞、收藏、关注等状态
*/
queryNewsInfoOfUser() {
if (HttpUrlUtils.getUserId()) {
const params: batchLikeAndCollectParams = {
contentList: [
{
contentId: this.contentDetailData?.newsId + '',
contentType: this.contentDetailData?.newsType + '',
}
]
}
// 已登录->查询用户对作品点赞、收藏状态
ContentDetailRequest.postBatchLikeAndCollectStatus(params).then(res => {
console.log('查询点赞、收藏状态==', JSON.stringify(res.data))
if (res.data) {
this.newsStatusOfUser = res.data[0]
}
})
this.playVM.setContentDetailData(this.contentDetailData)
const params1: postBatchAttentionStatusParams = {
creatorIds: [{ creatorId: this.contentDetailData?.rmhInfo?.rmhId ?? '' }]
}
// 已登录->批量查作品是否被号主关注
ContentDetailRequest.postBatchAttentionStatus(params1).then(res => {
console.log('批量查号主是否为用户关注==', JSON.stringify(res.data))
if (res.data) {
this.followStatus = res.data[0]?.status
}
})
let action: Action = router.getParams() as Action
Logger.info(TAG, "action", JSON.stringify(action))
if (action) {
this.contentId = action.params?.contentID
if (action.params && action.params.extra) {
this.relId = action.params.extra.relId
this.relType = action.params.extra.relType
// 记录浏览历史
const params2: postInteractBrowsOperateParams = {
delStatus: 0,
contentList: [{
browseTime: DateTimeUtils.getCurDate(DateTimeUtils.PATTERN_DATE_TIME_HYPHEN),
contentId: this.contentDetailData?.newsId + '',
contentType: this.contentDetailData?.newsType || 0,
}]
}
ContentDetailRequest.postInteractBrowsOperate(params2).then(res => {
console.log('记录浏览历史==', JSON.stringify(res.data))
})
}
}
aboutToAppear() {
// console.log('开始设置setContentDetailData', JSON.stringify(this.contentDetailData))
this.videoLandScape = this.contentDetailData?.videoInfo[0]?.videoLandScape
this.queryNewsInfoOfUser()
this.playerController.onCanplay = () => {
if (this.index == 0 || this.currentIndex === this.index) {
this.playerController.play()
}
}
this.playerController.onTimeUpdate = (position, duration) => {
this.progressVal = Math.floor(position * 100 / duration);
}
// 设置播放地址
// this.url = 'https://media.w3.org/2010/05/sintel/trailer.mp4'
let listener = mediaquery.matchMediaSync('(orientation: landscape)');
listener.on("change", (mediaQueryResult) => {
if (mediaQueryResult.matches) {
... ... @@ -94,29 +129,25 @@ export struct DetailPlayShortVideoPage {
this.isFullScreen = false
console.log("横屏 no")
}
WindowModel.shared.setMainWindowFullScreen(this.isFullScreen)
// WindowModel.shared.setMainWindowFullScreen(this.isFullScreen)
})
console.error('111,', this.index, this.currentIndex)
if (this.index == 0 && this.currentIndex === this.index) {
setTimeout(() => {
this.playerController.play()
}, 2000)
}
}
onPageShow() {
WindowModel.shared.setPreferredOrientation(window.Orientation.AUTO_ROTATION_RESTRICTED);
// WindowModel.shared.setPreferredOrientation(window.Orientation.AUTO_ROTATION_RESTRICTED);
}
aboutToDisappear(): void {
this.playerController?.pause();
console.log('aboutToDisappear', this.index)
this.playerController?.release();
// this.playerController.onCanplay = ()={}
}
onPageHide() {
WindowModel.shared.setPreferredOrientation(window.Orientation.PORTRAIT);
// WindowModel.shared.setPreferredOrientation(window.Orientation.PORTRAIT);
devicePLSensorManager.devicePLSensorOff();
this.status = PlayerConstants.STATUS_PAUSE;
// this.status = PlayerConstants.STATUS_PAUSE;
this.playerController?.pause();
}
... ... @@ -126,10 +157,10 @@ export struct DetailPlayShortVideoPage {
WDPlayerRenderView({
playerController: this.playerController,
onLoad: async () => {
console.log('onload==', this.contentId, this.relId, this.relType)
// this.playVM.playWithContentId(this.contentId ?? "846899373")
this.playVM.playWithIds(this.contentId,
this.relId, this.relType)
// console.log('onload==', this.index)
// if (this.index === 0) {
this.playerController.firstPlay(this.contentDetailData?.videoInfo[0]?.videoUrl);
// }
}
})
.height('100%')
... ... @@ -176,49 +207,6 @@ export struct DetailPlayShortVideoPage {
}
.height('100%')
.width('100%')
.backgroundColor(Color.Black)
}
// 续播判断
changeContinue() {
if (this.nextContId) {
this.playerController.continue = () => {
this.playerController?.stop();
this.playVM.playWithContentId(this.nextContId ?? '');
}
return;
}
this.playerController.continue = undefined;
}
urlChanged() {
if (this.url) {
console.log("url:" + this.url);
this.status = PlayerConstants.STATUS_START;
this.playerController.firstPlay(this.url);
}
}
getPlayHistory() {
SPHelper.default.get('playHistory', '').then((str) => {
let result = str.toString();
let time = 0;
if (result != null && result != "") {
let playHistory: Record<string, Record<string, number>> = JSON.parse(result);
let userData: Record<string, number> = {};
if (this.userId) {
userData = playHistory[this.userId] ?? {};
}
if (this.curContId) {
time = userData?.[this.curContId] ?? 0;
}
}
this.playerController?.setStartTime(time);
}).catch((err: Error) => {
// Error: Inner error. Error code 15500000
Logger.error(TAG, 'catch err:' + JSON.stringify(err));
this.playerController?.setStartTime(0);
});
}
}
\ No newline at end of file
... ...
import { Action, ContentDetailDTO } from 'wdBean/Index';
import { Action, ContentDetailDTO, InteractDataDTO } from 'wdBean/Index';
import { ContentDetailRequest } from 'wdDetailPlayApi/Index'
import { ResponseDTO } from 'wdNetwork/Index';
import { DetailPlayShortVideoPage } from './DetailPlayShortVideoPage'
import { Test } from './Test'
import router from '@ohos.router';
import window from '@ohos.window';
import { contentListParams } from 'wdDetailPlayApi/src/main/ets/request/ContentDetailRequest';
@Entry
@Component
... ... @@ -16,9 +18,9 @@ export struct DetailVideoListPage {
@State data: ContentDetailDTO[] = []
@State testData: string[] = ['111', '222', '333']
@State currentIndex: number = 0
@State interactDataList: InteractDataDTO[] = []
async aboutToAppear(): Promise<void> {
console.error('=================',)
let data: ContentDetailDTO[] = []
let action: Action = router.getParams() as Action
if (action) {
... ... @@ -34,28 +36,63 @@ export struct DetailVideoListPage {
}).then((resDTO: ResponseDTO<ContentDetailDTO[]>) => {
console.error('resDTO==', JSON.stringify(resDTO.data))
if (resDTO.data) {
data.push(resDTO.data[0])
this.data.push(resDTO.data[0])
}
})
}
await this.queryVideoList()
// await ContentDetailRequest.postRecommendVideoList({
// pageSize: 5,
// refreshCnt: 1
// }).then(res => {
// if (res.data) {
// data = data.concat(res.data)
// }
// console.log('res1===', JSON.stringify(res))
// console.log('res==' + this.data)
// })
if (this.data.length > 0) {
const params: contentListParams = {
contentList: []
}
this.data.map(item => {
params.contentList.push({
contentId: item.newsId + '',
contentType: item.newsType
})
})
// 批量查询内容当前用户点赞、收藏状态
await ContentDetailRequest.getContentInteract(params).then(res => {
if (res.data) {
this.interactDataList = res.data || []
}
console.log('获取互动点赞等数据===', JSON.stringify(res))
})
// 查询各类型内容动态数据接口V2
}
// this.data = data
console.error('aboutToAppear===', this.data.length)
}
async queryVideoList() {
await ContentDetailRequest.postRecommendVideoList({
pageSize: 10,
pageSize: 5,
refreshCnt: 1
}).then(res => {
if (res.data) {
data = data.concat(res.data)
this.data = this.data.concat(res.data)
}
// this.data = res.data || []
console.log('res1===', JSON.stringify(res))
console.log('res==' + this.data)
// console.log('queryVideoList===', JSON.stringify(this.data))
})
this.data = data
console.error('aboutToAppear===', this.data.length)
}
build() {
... ... @@ -67,7 +104,8 @@ export struct DetailVideoListPage {
DetailPlayShortVideoPage({
contentDetailData: item,
currentIndex: this.currentIndex,
index: index
index: index,
interactData: this.interactDataList[index]
})
}.width('100%')
.height('100%')
... ... @@ -82,7 +120,7 @@ export struct DetailVideoListPage {
// }, (item: string) => item)
}
.cachedCount(0)
.cachedCount(-1)
.indicator(false)
.vertical(true)
.loop(false)
... ... @@ -92,6 +130,10 @@ export struct DetailVideoListPage {
.onChange((index: number) => {
this.currentIndex = index
console.info('onChange==', index.toString())
if (this.currentIndex === this.data.length - 1) {
this.queryVideoList()
}
})
}.width('100%').height('100%')
... ...
@Entry
@Preview
@Component
export struct Test {
@Prop currentItem: string = '';
@Prop @Watch('currentIndexChange') currentIndex: number = 0;
@Prop index: number = 0;
currentIndexChange() {
console.log('currentIndexChange====', this.currentIndex);
}
build() {
Row() {
Column() {
Text('currentItem: ' + this.currentItem).fontSize(30)
Text('currentIndex: ' + this.currentIndex).fontSize(30)
Text('index: ' + this.index).fontSize(30)
}
RelativeContainer() {
Image($r('app.media.ic_like_uncheck'))
.width('100%')
.borderRadius(24)
.aspectRatio(1)
.border({ width: 1, color: Color.White, style: BorderStyle.Solid })
.alignRules({
top: { anchor: "__container__", align: VerticalAlign.Top },
left: { anchor: "__container__", align: HorizontalAlign.Start }
})
.id("row1")
Image($r('app.media.ic_add'))
.width(24)
.borderRadius(12)
.alignRules({
left: { anchor: "__container__", align: HorizontalAlign.Center },
bottom: { anchor: "__container__", align: VerticalAlign.Bottom },
})
.margin({ left: -12 })
.id("row2")
}.height('auto')
}
.height(58)
.width(48)
.backgroundColor(Color.Black)
}
}
\ No newline at end of file
... ...
@CustomDialog
export struct DetailDialog {
controller: CustomDialogController
@Prop name: string
@Prop title: string
@Prop summary: string
@Link isOpen: boolean
build() {
Column() {
if (this.name + '1222222') {
Text(`@${this.name}` + '1222222')
.fontColor(Color.White)
.fontSize(14)
.fontWeight(600)
.lineHeight(17)
}
if (this.title) {
Text(this.title)
.fontColor(Color.White)
.fontSize(16)
.fontWeight(600)
.margin({ top: 8 })
.lineHeight(24)
}
Text(this.summary)
.fontColor(Color.White)
.fontSize(14)
.fontWeight(400)
.margin({ top: 8 })
.lineHeight(21)
Row() {
Image($r('app.media.ic_close'))
.height(24).margin({ top: 20 }).onClick(() => {
this.controller.close()
if (this.isOpen) {
this.isOpen = !this.isOpen
}
})
}.width('100%').justifyContent(FlexAlign.Center)
}
.width('100%')
.alignItems(HorizontalAlign.Start)
.backgroundColor(Color.Gray)
// .linearGradient({
// direction: GradientDirection.Top, // 渐变方向
// repeating: false, // 渐变颜色是否重复
// colors: [['rgba(0, 0, 0, 0.1)', 0.0], ['rgba(0, 0, 0, 0)', 1.0]] // 数组末尾元素占比小于1时满足重复着色效果
// })
.padding({ top: 20, bottom: 30, left: 16, right: 16 })
}
}
\ No newline at end of file
... ...
import { RmhInfoDTO, UserInfoDTO } from 'wdBean/Index';
import { ContentDetailDTO, InteractDataDTO, RmhInfoDTO, UserInfoDTO } from 'wdBean/Index';
import {
batchLikeAndCollectParams,
batchLikeAndCollectResult,
ContentDetailRequest,
contentListParams,
postExecuteCollectRecordParams,
postExecuteLikeParams,
postInteractAccentionOperateParams
} from 'wdDetailPlayApi/src/main/ets/request/ContentDetailRequest';
import { ToastUtils } from 'wdKit';
import { HttpUrlUtils } from 'wdNetwork/Index';
import { WDRouterPage, WDRouterRule } from 'wdRouter/Index';
export interface OperationItem {
icon: Resource;
icon_check?: Resource;
// icon_selected: Resource;
text: string | Resource;
... ... @@ -13,25 +25,30 @@ const FULL_PARENT: string = '100%';
const TAG = 'OperationListView';
@Preview
@Component
export struct OperationListView {
@Consume rmhInfo?: RmhInfoDTO
@Consume userInfo?: UserInfoDTO
@Consume interactData: InteractDataDTO
@Consume contentDetailData: ContentDetailDTO
@Consume newsStatusOfUser: batchLikeAndCollectResult
@Consume followStatus: string
@State operationList: OperationItem[] = [
{
icon: $r('app.media.ic_like_uncheck'),
icon_check: $r('app.media.ic_like_check'),
text: "赞",
num: 6622
// num: 6622
},
{
icon: $r('app.media.ic_collect_uncheck'),
icon_check: $r('app.media.ic_collect_check'),
text: "收藏",
num: 662,
// num: 662,
},
{
icon: $r('app.media.ic_comment'),
text: "评论",
num: 500,
text: "抢首评",
// num: 500,
},
{
icon: $r('app.media.ic_share'),
... ... @@ -42,76 +59,228 @@ export struct OperationListView {
aboutToAppear() {
}
build() {
// List({ space: 0, initialIndex: 0 }) {
// ForEach(this.operationList, (item: OperationItem, index: number) => {
// ListItem() {
// this.buildOperationItem(item, index)
// }
// }, (item: OperationItem, index: number) => JSON.stringify(item))
// }
// .width(48)
// .height(250)
// // .margin({ bottom: 100 })
// .backgroundColor(Color.Red)
// // .listDirection(Axis.Vertical) // 默认值:Axis.Vertical
// // .lanes(this.buildLanes()) // 行/列数,一列 // 默认值:1
// .cachedCount(2)
// .scrollBar(BarState.Off)
// .nestedScroll({
// scrollForward: NestedScrollMode.PARENT_FIRST,
// scrollBackward: NestedScrollMode.SELF_FIRST
// })
/**
* 点赞、取消点赞
*/
toggleLikeStatus() {
// 未登录,跳转登录
if (!HttpUrlUtils.getUserId()) {
WDRouterRule.jumpWithPage(WDRouterPage.loginPage)
return
}
const params: postExecuteLikeParams = {
status: this.newsStatusOfUser?.likeStatus === '1' ? '0' : '1',
contentId: this.contentDetailData?.newsId + '',
contentType: this.contentDetailData?.newsType + '',
}
ContentDetailRequest.postExecuteLike(params).then(res => {
console.log('toggleLikeStatus==',)
if (this.newsStatusOfUser) {
this.newsStatusOfUser.likeStatus = this.newsStatusOfUser?.likeStatus === '1' ? '0' : '1'
this.queryContentInteractCount()
}
Column() {
this.buildUserComp()
ForEach(this.operationList, (item: OperationItem, index: number) => {
this.buildOperationItem(item, index)
}, (item: OperationItem, index: number) => JSON.stringify(item))
})
}
/**
* 收藏、取消收藏
*/
toggleCollectStatus() {
// 未登录,跳转登录
if (!HttpUrlUtils.getUserId()) {
WDRouterRule.jumpWithPage(WDRouterPage.loginPage)
return
}
.width(48)
const params: postExecuteCollectRecordParams = {
status: this.newsStatusOfUser?.collectStatus === 1 ? '0' : '1',
contentList: [{
contentId: this.contentDetailData?.newsId + '',
contentType: this.contentDetailData?.newsType + '',
}],
}
ContentDetailRequest.postExecuteCollectRecord(params).then(res => {
console.log('toggleLikeStatus==',)
if (this.newsStatusOfUser) {
this.newsStatusOfUser.collectStatus = this.newsStatusOfUser?.collectStatus === 1 ? 0 : 1
this.queryContentInteractCount()
}
})
}
@Builder
buildUserComp() {
Column() {
Image(this.rmhInfo?.rmhHeadUrl || this.userInfo?.userHeadUrl)
.width(48)
.borderRadius(24)
.aspectRatio(1)
// .margin(18)
/**
* 查询点赞、收藏数量
*/
queryContentInteractCount() {
const params: contentListParams = {
contentList: [{
contentId: this.contentDetailData?.newsId + '',
contentType: this.contentDetailData?.newsType,
}]
}
ContentDetailRequest.getContentInteract(params).then(res => {
if (res.data && this.interactData) {
this.interactData.likeNum = res.data[0]?.likeNum
this.interactData.collectNum = res.data[0]?.collectNum
this.interactData.commentNum = res.data[0]?.commentNum
}
console.log('获取互动点赞等数据===', JSON.stringify(res))
})
}
getImgUrl() {
return this.contentDetailData?.rmhInfo?.rmhHeadUrl || this.contentDetailData?.userInfo?.userHeadUrl
}
/**
* 组件项
*
* @param programmeBean item 组件项
* 关注号主
*/
handleAccention() {
// 未登录,跳转登录
if (!HttpUrlUtils.getUserId()) {
WDRouterRule.jumpWithPage(WDRouterPage.loginPage)
return
}
const params2: postInteractAccentionOperateParams = {
attentionUserType: this.contentDetailData?.rmhInfo?.userType || '', //被关注用户类型(1 普通用户 2 视频号 3 矩阵号)
attentionUserId: this.contentDetailData?.rmhInfo?.userId || '', // 被关注用户号主id
attentionCreatorId: this.contentDetailData?.rmhInfo?.rmhId || '', // 被关注用户号主id
// userType: 1,
// userId: '1',
status: 1,
}
ContentDetailRequest.postInteractAccentionOperate(params2).then(res => {
console.log('关注号主==', JSON.stringify(res.data))
if (this.followStatus == '1') {
this.followStatus = '0'
} else {
this.followStatus = '1'
}
})
}
@Builder
buildUserComp() {
Column() {
if (this.getImgUrl()) {
RelativeContainer() {
Image(this.getImgUrl())
.width('100%')
.borderRadius(24)
.aspectRatio(1)
.border({ width: 1, color: Color.White, style: BorderStyle.Solid })
.alignRules({
top: { anchor: "__container__", align: VerticalAlign.Top },
left: { anchor: "__container__", align: HorizontalAlign.Start }
})
.id("row1")
.onClick(() => {
// 号主页
})
if (this.followStatus == '0') {
Image($r('app.media.ic_add'))
.width(24)
.borderRadius(12)
.alignRules({
left: { anchor: "__container__", align: HorizontalAlign.Center },
bottom: { anchor: "__container__", align: VerticalAlign.Bottom },
})
.margin({ left: -12 })
.id("row2")
.onClick(() => {
// 关注
this.handleAccention()
})
}
}.height(60)
}
}.margin({ bottom: 18 })
}
@Builder
buildOperationItem(item: OperationItem, index: number) {
Column() {
Image(item.icon)
.width('100%')
.aspectRatio(1)
// .borderRadius(6)
Text(item.text)
.width('100%')// .margin({ top: 4, left: 6, right: 6 })// .backgroundColor(Color.Brown)
.fontWeight(FontWeight.Normal)
.textAlign(TextAlign.Center)
.fontSize(13)
.fontColor('#FFFFFF')
.maxLines(1)
.textOverflow({ overflow: TextOverflow.Ellipsis })
if (item.text === '赞') {
Image(this.newsStatusOfUser?.likeStatus == '1' ? item.icon_check : item.icon)
.width(32)
.aspectRatio(1)
.onClick(() => {
this.toggleLikeStatus()
})
Text(this.interactData?.likeNum ? (this.interactData.likeNum + '') : item.text)
.width('100%')// .margin({ top: 4, left: 6, right: 6 })// .backgroundColor(Color.Brown)
.fontWeight(500)
.textAlign(TextAlign.Center)
.fontSize(13)
.fontColor('#FFFFFF')
.maxLines(1)
.textOverflow({ overflow: TextOverflow.Ellipsis })
} else if (item.text === '收藏') {
Image(this.newsStatusOfUser?.collectStatus == 1 ? item.icon_check : item.icon)
.width(32)
.aspectRatio(1)
.onClick(() => {
this.toggleCollectStatus()
})
Text(this.interactData?.collectNum ? (this.interactData.collectNum + '') : item.text)
.width('100%')// .margin({ top: 4, left: 6, right: 6 })// .backgroundColor(Color.Brown)
.fontWeight(500)
.textAlign(TextAlign.Center)
.fontSize(13)
.fontColor('#FFFFFF')
.maxLines(1)
.textOverflow({ overflow: TextOverflow.Ellipsis })
} else if (item.text === '抢首评') {
Image(item.icon)
.width(32)
.aspectRatio(1)
.onClick((event: ClickEvent) => {
ToastUtils.showToast('评论为公共方法,待开发', 1000);
})
Text(this.interactData?.commentNum ? (this.interactData.commentNum + '') : item.text)
.width('100%')// .margin({ top: 4, left: 6, right: 6 })// .backgroundColor(Color.Brown)
.fontWeight(500)
.textAlign(TextAlign.Center)
.fontSize(13)
.fontColor('#FFFFFF')
.maxLines(1)
.textOverflow({ overflow: TextOverflow.Ellipsis })
} else {
Image(item.icon)
.width(32)
.aspectRatio(1)
.onClick((event: ClickEvent) => {
ToastUtils.showToast('分享为公共方法,待开发', 1000);
})
Text(item.text)
.width('100%')// .margin({ top: 4, left: 6, right: 6 })// .backgroundColor(Color.Brown)
.fontWeight(500)
.textAlign(TextAlign.Center)
.fontSize(13)
.fontColor('#FFFFFF')
.maxLines(1)
.textOverflow({ overflow: TextOverflow.Ellipsis })
}
}
.margin(5)
// .backgroundColor(Color.Black)
// .width(48)
.margin({ bottom: 20 })
.alignItems(HorizontalAlign.Center)
.hoverEffect(HoverEffect.Scale)
.onClick((event: ClickEvent) => {
console.info(TAG, `buildOperationItem onClick event index: ${index}`);
// ToastUtils.showToast('体验版,本功能暂未开发', 1000);
})
}
build() {
Column() {
this.buildUserComp()
ForEach(this.operationList, (item: OperationItem, index: number) => {
this.buildOperationItem(item, index)
}, (item: OperationItem, index: number) => JSON.stringify(item))
}
.width(48)
}
}
\ No newline at end of file
... ...
... ... @@ -5,80 +5,119 @@ import { WindowModel } from 'wdKit';
import { WDPlayerController } from 'wdPlayer';
import { devicePLSensorManager } from 'wdDetailPlayApi';
import { OperationListView } from './OperationListView';
import { RmhInfoDTO, UserInfoDTO } from 'wdBean/Index';
import { ContentDetailDTO, RmhInfoDTO, UserInfoDTO } from 'wdBean/Index';
import { DetailDialog } from './DetailDialog';
@Component
export struct PlayerTitleComment {
private playerController?: WDPlayerController;
@Consume newsSourceName?: string
@Consume newsTitle?: string
@Consume editorName?: string
@Consume newsSummary?: string;
@State @Watch('watchSpeed') playSpeed: number = 1;
@Consume isFullScreen: boolean;
@State comment: string = '';
@Consume contentDetailData: ContentDetailDTO | undefined
@Consume isFullScreen: boolean;
@Consume progressVal: number;
@Consume videoLandScape?: number
@State isOpen: boolean = false
dialogController: CustomDialogController = new CustomDialogController({
builder: DetailDialog({
name: this.getName(),
title: this.getTitle(),
summary: this.getSummary(),
isOpen: this.isOpen
}),
autoCancel: false,
customStyle: true,
alignment: DialogAlignment.Bottom
})
aboutToAppear() {
}
watchSpeed() {
this.playerController?.setSpeed(this.playSpeed);
}
getName() {
return this.contentDetailData?.newsSourceName || this.contentDetailData?.editorName || ''
}
getTitle() {
return this.contentDetailData?.newsTitle || this.contentDetailData?.newsSummary || ''
}
getSummary() {
return this.contentDetailData?.newsSummary || ''
}
build() {
Column() {
// Column() {
// Row() {
// Image($r('app.media.ic_switch_orientation'))
// .width(34)
// .aspectRatio(1)
// .objectFit(ImageFit.Contain)
// .padding({ left: 10, right: 5 })
// Text("全屏观看")
// .fontColor(Color.White)
// .fontSize('14fp')
// .maxLines(2)
// .layoutWeight(1)
// }
// .width(100)
// .backgroundColor(Color.Gray)
// .borderRadius(10)
// .alignItems(VerticalAlign.Center)
// .visibility(this.videoLandScape == 2 ? Visibility.Hidden : Visibility.Visible)
// .onClick(() => {
// this.isFullScreen = !this.isFullScreen;
// WindowModel.shared.setPreferredOrientation(window.Orientation.LANDSCAPE);
// devicePLSensorManager.devicePLSensorOn(window.Orientation.LANDSCAPE);
// })
// }
// .width('100%')
// // .margin({ bottom: 120 })
// .alignItems(HorizontalAlign.Center)
if (this.contentDetailData?.videoInfo[0]?.videoLandScape === 1) {
Column() {
Row() {
Image($r('app.media.ic_switch_orientation'))
.width(34)
.aspectRatio(1)
.objectFit(ImageFit.Contain)
.padding({ left: 10, right: 5 })
Text("全屏观看")
.fontColor(Color.White)
.fontSize('14fp')
.maxLines(2)
.layoutWeight(1)
}
.width(100)
.backgroundColor(Color.Gray)
.borderRadius(10)
.alignItems(VerticalAlign.Center)
.visibility(this.videoLandScape == 2 ? Visibility.Hidden : Visibility.Visible)
.onClick(() => {
this.isFullScreen = !this.isFullScreen;
WindowModel.shared.setPreferredOrientation(window.Orientation.LANDSCAPE);
devicePLSensorManager.devicePLSensorOn(window.Orientation.LANDSCAPE);
})
}
.width('100%')
// .margin({ bottom: 120 })
.alignItems(HorizontalAlign.Center)
}
Row() {
Column() {
if (this.newsSourceName || this.editorName) {
Text("@" + (this.newsSourceName || this.editorName))
if (this.getName()) {
Text("@" + this.getName())
.fontColor(Color.White)
.fontSize(15)
.maxLines(1)
.textOverflow({ overflow: TextOverflow.Ellipsis })
}
if (this.newsTitle || this.newsSummary) {
Text(this.newsTitle || this.newsSummary)
if (this.getTitle()) {
Text(this.getTitle())
.fontColor(Color.White)
.fontSize(15)
.maxLines(3)
.textOverflow({ overflow: TextOverflow.Ellipsis })
}
Text('查看详情 > ')
.margin({ top: 5 })
.fontColor(Color.White)
.fontSize(12)
.maxLines(2)
if (this.contentDetailData?.newsSummary) {
Text('查看详情 > ')
.margin({ top: 8 })
.padding(6)
.borderRadius(2)
.backgroundColor('#636363')
.fontColor(Color.White)
.fontSize(12)
.onClick(() => {
console.log('click===', this.dialogController?.open)
this.isOpen = true
this.dialogController?.open()
})
}
}
.layoutWeight(1)
.alignItems(HorizontalAlign.Start)
... ... @@ -112,29 +151,10 @@ export struct PlayerTitleComment {
.height(24)
.aspectRatio(1)
.onClick(() => {
if (this.isFullScreen) {
if (deviceInfo.deviceType != "phone") {
WindowModel.shared.getWindowSize().then((size) => {
if (size.width > size.height) {
router.back();
} else {
this.isFullScreen = !this.isFullScreen;
WindowModel.shared.setPreferredOrientation(window.Orientation.PORTRAIT);
devicePLSensorManager.devicePLSensorOn(window.Orientation.PORTRAIT);
}
})
} else {
this.isFullScreen = !this.isFullScreen;
WindowModel.shared.setPreferredOrientation(window.Orientation.PORTRAIT);
devicePLSensorManager.devicePLSensorOn(window.Orientation.PORTRAIT);
}
} else {
router.back();
}
router.back();
})
TextInput({ placeholder: '说两句...', text: this.comment })
.placeholderColor(Color.White)
.placeholderFont({ size: 14 })
.fontColor(Color.White)
... ... @@ -154,5 +174,8 @@ export struct PlayerTitleComment {
.width('100%')
// .height('40%')
.alignItems(HorizontalAlign.Start)
.opacity(this.isOpen ? 0 : 1)
.animation({ duration: 200 })
}
}
\ No newline at end of file
}
... ...
{
"src": [
"pages/DetailVideoListPage",
"pages/Test"
"pages/DetailVideoListPage"
]
}
\ No newline at end of file
... ...
... ... @@ -2,6 +2,7 @@ import media from '@ohos.multimedia.media';
import prompt from '@ohos.promptAction';
import { Logger } from '../utils/Logger';
import { PlayerConstants, AVPlayerStatus, Events } from '../constants/PlayerConstants';
import { BusinessError } from '@ohos.base';
@Observed
export class WDPlayerController {
... ... @@ -20,6 +21,7 @@ export class WDPlayerController {
public onTimeUpdate?: (position: number, duration: number) => void;
public onVolumeUpdate?: (volume: number) => void;
public continue?: () => void;
public onCanplay?: () => void;
constructor() {
Logger.error("初始化")
... ... @@ -43,7 +45,10 @@ export class WDPlayerController {
Logger.error('[PlayVideoModel] createAvPlayer fail!');
reject();
}
}).catch((error: BusinessError) => {
console.error(`AVPlayer catchCallback, error message:${error.message}`);
});
;
});
}
... ... @@ -74,6 +79,9 @@ export class WDPlayerController {
}
// this.avPlayer.play();
this.duration = this.avPlayer.duration;
if (this.onCanplay) {
this.onCanplay()
}
break;
case AVPlayerStatus.PLAYING:
this.setBright();
... ... @@ -143,13 +151,15 @@ export class WDPlayerController {
}
async release() {
if (this.avPlayer == null) {
await this.initPromise;
}
// if (this.avPlayer == null) {
// await this.initPromise;
// }
if (this.avPlayer == null) {
return
}
this.avPlayer.release();
this.avPlayer.release()
this.avPlayer = undefined
}
async pause() {
... ... @@ -171,7 +181,7 @@ export class WDPlayerController {
}
this.avPlayer.play();
}
async stop() {
if (this.avPlayer == null) {
await this.initPromise;
... ... @@ -250,6 +260,10 @@ export class WDPlayerController {
return this.status;
}
getPlayer() {
return this.avPlayer;
}
initProgress(time: number) {
let nowSeconds = Math.floor(time / 1000);
let totalSeconds = Math.floor(this.duration / 1000);
... ...
... ... @@ -74,7 +74,7 @@ export struct WDPlayerRenderView {
Row() {
// 设置为“surface“类型时XComponent组件可以和其他组件一起进行布局和渲染。
XComponent({
id: 'xComponentId112233',
id: 'xComponentId',
type: 'surface',
controller: this.xComponentController
})
... ...
@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 { BroadcastPageComponent } from 'wdComponent';
import { Logger } from 'wdKit';
const TAG = 'BroadcastPageComponent';
@Entry
@Component
struct BroadcastPage {
build() {
Column() {
BroadcastPageComponent()
}
}
pageTransition() {
// 定义页面进入时的效果,从底侧滑入
PageTransitionEnter({ type: RouteType.None, duration: 300 })
.slide(SlideEffect.Bottom)
// 定义页面退出时的效果,向底侧滑出
PageTransitionExit({ type: RouteType.None, duration: 300 })
.slide(SlideEffect.Bottom)
}
aboutToAppear() {
Logger.info(TAG, 'aboutToAppear');
}
aboutToDisappear() {
Logger.info(TAG, 'aboutToDisappear');
}
onPageShow() {
Logger.info(TAG, 'onPageShow');
}
onPageHide() {
Logger.info(TAG, 'onPageHide');
}
onBackPress() {
Logger.info(TAG, 'onBackPress');
}
}
\ 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 || '';
}
}
\ No newline at end of file
... ...
... ... @@ -9,6 +9,7 @@
"pages/detail/MultiPictureDetailPage",
"pages/launchPage/PrivacyPage",
"pages/launchPage/LaunchPage",
"pages/launchPage/LaunchAdvertisingPage"
"pages/launchPage/LaunchAdvertisingPage",
"pages/broadcast/BroadcastPage"
]
}
... ...