张善主

Merge remote-tracking branch 'origin/main'

@@ -236,6 +236,10 @@ export class HttpUrlUtils { @@ -236,6 +236,10 @@ export class HttpUrlUtils {
236 * 预约状态 236 * 预约状态
237 */ 237 */
238 static readonly LIVE_APPOINTMENT_BATCH_PATH: string = "/api/live-center-message/zh/c/live/subscribe/user/batch"; 238 static readonly LIVE_APPOINTMENT_BATCH_PATH: string = "/api/live-center-message/zh/c/live/subscribe/user/batch";
  239 + /**
  240 + * 游客 评论列表
  241 + */
  242 + static readonly VISITOR_COMMENT_LIST_DATA_PATH: string = "/api/rmrb-comment/comment/zh/c/visitorCommentList";
239 243
240 /** 244 /**
241 * 查询是否被禁言 245 * 查询是否被禁言
@@ -868,4 +872,9 @@ export class HttpUrlUtils { @@ -868,4 +872,9 @@ export class HttpUrlUtils {
868 let url = HttpUrlUtils.getHost() + "/api/rmrb-contact/contact/zh/c/push/device" 872 let url = HttpUrlUtils.getHost() + "/api/rmrb-contact/contact/zh/c/push/device"
869 return url 873 return url
870 } 874 }
  875 +
  876 + static getVisitorCommentListDataUrl() {
  877 + let url = HttpUrlUtils.getHost() + HttpUrlUtils.VISITOR_COMMENT_LIST_DATA_PATH
  878 + return url
  879 + }
871 } 880 }
@@ -91,6 +91,8 @@ export class WDRouterPage { @@ -91,6 +91,8 @@ export class WDRouterPage {
91 static loginProtocolPage = new WDRouterPage("wdLogin", "ets/pages/login/LoginProtocolWebview"); 91 static loginProtocolPage = new WDRouterPage("wdLogin", "ets/pages/login/LoginProtocolWebview");
92 //我的主页 92 //我的主页
93 static mineHomePage = new WDRouterPage("wdComponent", "ets/pages/MineHomePage"); 93 static mineHomePage = new WDRouterPage("wdComponent", "ets/pages/MineHomePage");
  94 + //游客评论列表
  95 + static visitorCommentPage = new WDRouterPage("wdComponent", "ets/pages/VisitorCommentPage");
94 // 隐私设置页 96 // 隐私设置页
95 static privacySettingPage = new WDRouterPage("wdComponent", "ets/components/page/PrivacySettingPage"); 97 static privacySettingPage = new WDRouterPage("wdComponent", "ets/components/page/PrivacySettingPage");
96 // 关于页 98 // 关于页
@@ -23,7 +23,7 @@ export default struct MinePagePersonFunctionUI { @@ -23,7 +23,7 @@ export default struct MinePagePersonFunctionUI {
23 switch (item.msg){ 23 switch (item.msg){
24 case "评论":{ 24 case "评论":{
25 if(!this.isLogin){ 25 if(!this.isLogin){
26 - WDRouterRule.jumpWithPage(WDRouterPage.loginPage) 26 + WDRouterRule.jumpWithPage(WDRouterPage.visitorCommentPage)
27 return 27 return
28 }else { 28 }else {
29 let params: Record<string, string> = {'comment': "1"}; 29 let params: Record<string, string> = {'comment': "1"};
  1 +import { ContentDTO } from 'wdBean/Index'
  2 +import { StringUtils, UserDataLocal } from 'wdKit/Index'
  3 +import MinePageDatasModel from '../../../model/MinePageDatasModel'
  4 +import { CommentLikeOperationRequestItem } from '../../../viewmodel/CommentLikeOperationRequestItem'
  5 +import { CommentListItem } from '../../../viewmodel/CommentListItem'
  6 +import measure from '@ohos.measure'
  7 +
  8 +@Component
  9 +export struct VisitorCommentComponent {
  10 + @ObjectLink data: CommentListItem
  11 + isLastItem: boolean = false
  12 + @State isExpand: boolean = false;
  13 + @State isExpandParent: boolean = false;
  14 + @State isOverLines: boolean = false
  15 + @State isOverLinesParent: boolean = false
  16 +
  17 + build() {
  18 + Column() {
  19 + Row() {
  20 + if (this.isExpand) {
  21 + Text() {
  22 + Span(this.data.commentContent)
  23 + }
  24 + .textStyle()
  25 + } else {
  26 + Text() {
  27 + Span(this.clipText(this.data.commentContent, 31, 5, 630, 0))
  28 + if (this.isOverLines) {
  29 + Span('...展开')
  30 + .fontColor($r('app.color.color_999999'))
  31 + .onClick(() => {
  32 + this.isExpand = true
  33 + })
  34 + }
  35 + }.maxLines(5)
  36 + .wordBreak(WordBreak.BREAK_ALL)
  37 + .textStyle()
  38 + }
  39 + }.padding({ left: '31lpx', right: '31lpx' })
  40 + .width('100%')
  41 +
  42 + Column() {
  43 + if (StringUtils.isNotEmpty(this.data.parentCommentContent)) {
  44 + //父评论
  45 + Row() {
  46 + if (this.isExpandParent) {
  47 + Text() {
  48 + Span(`@${this.data.parentCommentUserName}:`)
  49 + .fontColor($r('app.color.color_000000'))
  50 + .fontWeight('500lpx')
  51 + .fontSize('27lpx')
  52 + .lineHeight('40lpx')
  53 + Span(this.data.parentCommentContent)
  54 + .fontColor($r('app.color.color_000000'))
  55 + .fontWeight('400lpx')
  56 + .fontSize('27lpx')
  57 + .lineHeight('40lpx')
  58 + }
  59 + .width('100%')
  60 + .textAlign(TextAlign.Start)
  61 + } else {
  62 + Text() {
  63 + Span(`@${this.data.parentCommentUserName}:`)
  64 + .fontColor($r('app.color.color_000000'))
  65 + .fontWeight('500lpx')
  66 + .fontSize('27lpx')
  67 + .lineHeight('40lpx')
  68 +
  69 + Span(this.clipText(this.data.parentCommentContent, 31, 5, 630, 1))
  70 + .fontColor($r('app.color.color_000000'))
  71 + .fontWeight('400lpx')
  72 + .fontSize('27lpx')
  73 + .lineHeight('40lpx')
  74 + if (this.isOverLinesParent) {
  75 + Span('...展开')
  76 + .fontColor($r('app.color.color_999999'))
  77 + .onClick(() => {
  78 + this.isExpandParent = true
  79 + })
  80 + }
  81 + }.maxLines(5)
  82 + .wordBreak(WordBreak.BREAK_ALL)
  83 + .textAlign(TextAlign.Start)
  84 + .width('100%')
  85 + }
  86 + }
  87 + .width('100%')
  88 + .padding({ top: '23lpx', bottom: '15lpx', right: '23lpx' })
  89 +
  90 + Divider()
  91 + .width('100%')
  92 + .height('1lpx')
  93 + .strokeWidth('1lpx')
  94 + .backgroundColor($r('app.color.color_EDEDED'))
  95 + .margin({ top: '4lpx', bottom: '4lpx' })
  96 + }
  97 +
  98 + Column() {
  99 + Row() {
  100 + Row() {
  101 + Image($r('app.media.comment_link_icon'))
  102 + .objectFit(ImageFit.Auto)
  103 + .width('31lpx')
  104 + .height('31lpx')
  105 + .margin({ right: '10lpx' })
  106 +
  107 + Column() {
  108 + Row() {
  109 + Text(`${this.data.targetTitle}`)
  110 + .fontWeight('400lpx')
  111 + .fontColor($r('app.color.color_666666'))
  112 + .lineHeight('38lpx')
  113 + .fontSize('27lpx')
  114 + .layoutWeight(1)
  115 + .maxLines(1)
  116 + .textOverflow({ overflow: TextOverflow.Ellipsis })
  117 + }.width('100%')
  118 + }
  119 + .layoutWeight(1)
  120 + .alignItems(HorizontalAlign.Start)
  121 + }.layoutWeight(1)
  122 +
  123 + Image($r('app.media.arrow_icon_right'))
  124 + .margin({ right: '4lpx' })
  125 + .width('23lpx')
  126 + .height('23lpx')
  127 + .margin({right:'23lpx'})
  128 + }
  129 + .width('100%')
  130 + .height('69lpx')
  131 + .justifyContent(FlexAlign.SpaceBetween)
  132 +
  133 + }.height('69lpx')
  134 + .justifyContent(FlexAlign.Center)
  135 + }
  136 + .margin({ top: '19lpx', bottom: '31lpx', left: '31lpx', right: '31lpx' })
  137 + .padding({ left: '23lpx' })
  138 + .width('662lpx')
  139 + .backgroundColor($r('app.color.color_F5F5F5'))
  140 +
  141 + if (!this.isLastItem) {
  142 + Divider().width('100%')
  143 + .height('12lpx')
  144 + .strokeWidth('12lpx')
  145 + .color($r('app.color.color_F5F5F5'))
  146 + }
  147 + }
  148 + .justifyContent(FlexAlign.Center)
  149 + }
  150 +
  151 + commentLikeOperation() {
  152 + let item = new CommentLikeOperationRequestItem(this.data.targetId, this.data.id + "", this.data.targetType + "", UserDataLocal.getUserName(), UserDataLocal.getUserHeaderUrl(), this.data.like_status === 0 ? 1 : 0)
  153 + MinePageDatasModel.getCommentLikeOperation(item, getContext(this)).then((value) => {
  154 + if (value != null) {
  155 + if (value.code === 0 || value.code.toString() === "0") {
  156 + this.data.like_status = this.data.like_status === 0 ? 1 : 0
  157 + this.data.likeNum = this.data.like_status === 0 ? this.data.likeNum - 1 : this.data.likeNum + 1
  158 + }
  159 + }
  160 + })
  161 + }
  162 +
  163 + /**
  164 + * 截断文本
  165 + * @author liuzhendong(猩猩G)
  166 + * @param {string} str 要截断的文本 '啊啊啊啊啊'
  167 + * @param {number} fontSize 字体大小(px)
  168 + * @param {number} maxLines 最大行数 3
  169 + * @param {number} textWidth 文本宽度(px) vp 需要转换vp2px()
  170 + * @returns {string} clipStr 截断后的文本 '啊啊'
  171 + * @param {type} 0 我的评论 1 父评论
  172 + */
  173 + clipText(str: string, fontSize: number, maxLines: number, textWidth: number, type: number): string {
  174 + let strArr: string[] = str.split("")
  175 + let truncateContent: string = '啊啊啊啊啊' // ...比正常文字宽度更小,这里使用啊啊啊(任意三个文字)代替计算
  176 + let measureTruncateWidth: number = measure.measureText({
  177 + textContent: truncateContent,
  178 + fontSize: px2fp(fontSize),
  179 + wordBreak:WordBreak.BREAK_ALL
  180 + })
  181 + if(type === 1){
  182 + measureTruncateWidth = measureTruncateWidth + measure.measureText({
  183 + textContent: `@${this.data.parentCommentUserName}:`,
  184 + fontSize: px2fp(fontSize),
  185 + wordBreak:WordBreak.BREAK_ALL
  186 + })
  187 + }
  188 + let clipStr: string = ''
  189 + for (let i = 0; i < strArr.length; i++) {
  190 + if (measure.measureText({
  191 + textContent: clipStr,
  192 + fontSize: px2fp(fontSize),
  193 + wordBreak:WordBreak.BREAK_ALL
  194 + }) >= textWidth * maxLines - measureTruncateWidth) {
  195 + if (type === 0) {
  196 + this.isOverLines = true
  197 + } else {
  198 + this.isOverLinesParent = true
  199 + }
  200 + break;
  201 + }
  202 + clipStr += strArr[i]
  203 + }
  204 + return clipStr
  205 + }
  206 +}
  207 +
  208 +@Extend(Text)
  209 +function textStyle() {
  210 + .width('630lpx')
  211 + .fontSize('31lpx')
  212 + .fontWeight('400lpx')
  213 + .fontColor($r('app.color.color_222222'))
  214 + .lineHeight('46lpx')
  215 +}
  216 +
  217 +function getParams(item: CommentListItem) : ContentDTO{
  218 + let contentDTO = new ContentDTO();
  219 +
  220 + // contentDTO.objectType = item.targetType + ""
  221 + // contentDTO.objectId = item.targetId + ""
  222 + // contentDTO.newsTitle = item.targetTitle
  223 + // contentDTO.channelId =
  224 + // contentDTO.rmhPlatform =
  225 +
  226 + contentDTO.objectId = item.targetId;
  227 + contentDTO.relType = item.targetRelType + "";
  228 + contentDTO.relId = item.targetRelId;
  229 + contentDTO.objectType = item.targetType + "";
  230 + contentDTO.newsTitle = item.targetTitle
  231 +
  232 + return contentDTO
  233 +}
@@ -45,7 +45,7 @@ struct EditUserNikeNamePage { @@ -45,7 +45,7 @@ struct EditUserNikeNamePage {
45 .alignItems(VerticalAlign.Center) 45 .alignItems(VerticalAlign.Center)
46 46
47 Divider() 47 Divider()
48 - .margin(20) 48 + .margin({ top:0,bottom:20,left:20 ,right:20 })
49 49
50 Row(){ 50 Row(){
51 Text('1、账号中(头像、昵称等)不允许含有违禁违规内容;\n2、最多16个字,只能输入中文、数字、英文字母。') 51 Text('1、账号中(头像、昵称等)不允许含有违禁违规内容;\n2、最多16个字,只能输入中文、数字、英文字母。')
@@ -4,7 +4,7 @@ import PageModel from '../../viewmodel/PageModel'; @@ -4,7 +4,7 @@ import PageModel from '../../viewmodel/PageModel';
4 import { CommonConstants, ViewType } from 'wdConstant' 4 import { CommonConstants, ViewType } from 'wdConstant'
5 import { EmptyComponent,WDViewDefaultType } from '../view/EmptyComponent' 5 import { EmptyComponent,WDViewDefaultType } from '../view/EmptyComponent'
6 import { ErrorComponent } from '../view/ErrorComponent' 6 import { ErrorComponent } from '../view/ErrorComponent'
7 -import { CompDTO, ContentDTO, contentListParams,contentListItem } from 'wdBean' 7 +import { CompDTO, ContentDTO, contentListParams,contentListItem, InteractDataDTO } from 'wdBean'
8 import NoMoreLayout from './NoMoreLayout' 8 import NoMoreLayout from './NoMoreLayout'
9 import { CustomSelectUI } from '../view/CustomSelectUI'; 9 import { CustomSelectUI } from '../view/CustomSelectUI';
10 import { CustomBottomFuctionUI } from '../view/CustomBottomFuctionUI'; 10 import { CustomBottomFuctionUI } from '../view/CustomBottomFuctionUI';
@@ -16,6 +16,7 @@ import { NetworkUtil } from 'wdKit/Index'; @@ -16,6 +16,7 @@ import { NetworkUtil } from 'wdKit/Index';
16 import TrackingPageBrowseUtils from '../../utils/TrackingPageBrowseUtils' 16 import TrackingPageBrowseUtils from '../../utils/TrackingPageBrowseUtils'
17 import { TrackConstants, TrackingButton, TrackingContent, TrackParamConvert } from 'wdTracking/Index'; 17 import { TrackConstants, TrackingButton, TrackingContent, TrackParamConvert } from 'wdTracking/Index';
18 18
  19 +import { PeopleShipMainViewModel } from '../../viewmodel/PeopleShipMainViewModel';
19 @Entry 20 @Entry
20 @Component 21 @Component
21 struct MyCollectionListPage { 22 struct MyCollectionListPage {
@@ -28,6 +29,8 @@ struct MyCollectionListPage { @@ -28,6 +29,8 @@ struct MyCollectionListPage {
28 @Provide deleteNum :number = 0; 29 @Provide deleteNum :number = 0;
29 @Provide isAllSelect:boolean = false 30 @Provide isAllSelect:boolean = false
30 31
  32 + @Provide commentList: InteractDataDTO[] = []
  33 +
31 @State currentPage: number = 1; 34 @State currentPage: number = 1;
32 private scroller: Scroller = new Scroller(); 35 private scroller: Scroller = new Scroller();
33 emptyType: WDViewDefaultType = WDViewDefaultType.WDViewDefaultType_Default 36 emptyType: WDViewDefaultType = WDViewDefaultType.WDViewDefaultType_Default
@@ -175,6 +178,10 @@ struct MyCollectionListPage { @@ -175,6 +178,10 @@ struct MyCollectionListPage {
175 this.allDatas.push(compDTO) 178 this.allDatas.push(compDTO)
176 } 179 }
177 180
  181 + if (this.allDatas.length > 0){
  182 + this.getContentData()
  183 + }
  184 +
178 if (collectionItem.hasNext === 0) { 185 if (collectionItem.hasNext === 0) {
179 this.browSingModel.hasMore = false; 186 this.browSingModel.hasMore = false;
180 } else { 187 } else {
@@ -259,12 +266,28 @@ struct MyCollectionListPage { @@ -259,12 +266,28 @@ struct MyCollectionListPage {
259 } 266 }
260 } 267 }
261 268
262 - getContentData(){  
263 - for (let index = 0; index < this.allDatas.length; index++) {  
264 - const compDTO = this.allDatas[index];  
265 - compDTO.isCollection = true ///用于时间展示  
266 - this.allDatas.push(compDTO) 269 + async getContentData(){
  270 + try {
  271 + // 获取列表数据
  272 + const params: contentListParams = {
  273 + contentList: []
  274 + }
  275 + this.allDatas.forEach((item: ContentDTO) => {
  276 + params.contentList.push({
  277 + contentId: item.objectId,
  278 + contentType: Number(item.objectType ?? '1')
  279 + })
  280 + })
  281 + this.commentList = await PeopleShipMainViewModel.getContentInteractInfo(params)
  282 +
  283 + let datas: ContentDTO[] = [];
  284 + for (let index = 0; index < this.allDatas.length; index++) {
  285 + const compDTO = this.allDatas[index];
  286 + compDTO.interactData = this.commentList[index]
  287 + datas.push(compDTO)
  288 + }
  289 + this.allDatas.push(...datas)
  290 + } catch (exception) {
267 } 291 }
268 } 292 }
269 -  
270 } 293 }
@@ -29,10 +29,10 @@ export struct CustomTitleUI { @@ -29,10 +29,10 @@ export struct CustomTitleUI {
29 Text(this.titleName) 29 Text(this.titleName)
30 .maxLines(1) 30 .maxLines(1)
31 .id("title") 31 .id("title")
32 - .fontSize(`${this.calcHeight(30)}lpx`) 32 + .fontSize(`${this.calcHeight(35)}lpx`)
33 .fontWeight(400) 33 .fontWeight(400)
34 .fontColor($r('app.color.color_222222')) 34 .fontColor($r('app.color.color_222222'))
35 - .lineHeight(`${this.calcHeight(43)}lpx`) 35 + .lineHeight(`${this.calcHeight(50)}lpx`)
36 .alignRules({ 36 .alignRules({
37 center: {anchor: "__container__", align: VerticalAlign.Center}, 37 center: {anchor: "__container__", align: VerticalAlign.Center},
38 middle: {anchor: "__container__", align: HorizontalAlign.Center} 38 middle: {anchor: "__container__", align: HorizontalAlign.Center}
@@ -4,7 +4,7 @@ import MinePageCreatorFunctionsItem from '../viewmodel/MinePageCreatorFunctionsI @@ -4,7 +4,7 @@ import MinePageCreatorFunctionsItem from '../viewmodel/MinePageCreatorFunctionsI
4 import MinePageMoreFunctionModel from '../viewmodel/MinePageMoreFunctionModel'; 4 import MinePageMoreFunctionModel from '../viewmodel/MinePageMoreFunctionModel';
5 import { HttpBizUtil, HttpUrlUtils, HttpUtils, ResponseDTO, WDHttp } from 'wdNetwork'; 5 import { HttpBizUtil, HttpUrlUtils, HttpUtils, ResponseDTO, WDHttp } from 'wdNetwork';
6 import { MineAppointmentListItem } from '../viewmodel/MineAppointmentListItem'; 6 import { MineAppointmentListItem } from '../viewmodel/MineAppointmentListItem';
7 -import { Logger, StringUtils, EmitterUtils, EmitterEventId, SPHelper } from 'wdKit'; 7 +import { Logger, StringUtils, EmitterUtils, EmitterEventId, SPHelper, DeviceUtil, DateTimeUtils } from 'wdKit';
8 import { MineFollowListDetailItem } from '../viewmodel/MineFollowListDetailItem'; 8 import { MineFollowListDetailItem } from '../viewmodel/MineFollowListDetailItem';
9 import { FollowListDetailRequestItem } from '../viewmodel/FollowListDetailRequestItem'; 9 import { FollowListDetailRequestItem } from '../viewmodel/FollowListDetailRequestItem';
10 import { FollowListItem } from '../viewmodel/FollowListItem'; 10 import { FollowListItem } from '../viewmodel/FollowListItem';
@@ -918,6 +918,37 @@ class MinePageDatasModel{ @@ -918,6 +918,37 @@ class MinePageDatasModel{
918 return rmhInfo 918 return rmhInfo
919 } 919 }
920 920
  921 + /**
  922 + * 游客评论列表
  923 + * @param pageSize
  924 + * @param pageNum
  925 + * @returns
  926 + */
  927 + fetchVisitorCommentListData(pageNum:string,visitorFirstTime:string) {
  928 + let time = encodeURI(DateTimeUtils.getCurDate(DateTimeUtils.PATTERN_DATE_TIME_HYPHEN))
  929 + let deviceId = DeviceUtil.clientId()
  930 + let url = HttpUrlUtils.getVisitorCommentListDataUrl()+ `?pageSize=${20}&pageNum=${pageNum}&visitorFirstTime=${visitorFirstTime}&time=${time}&deviceId=${deviceId}`
  931 + return WDHttp.get<ResponseDTO<MineCommentListDetailItem>>(url)
  932 + };
  933 +
  934 + visitorCommentListData(pageNum:string,visitorFirstTime:string): Promise<MineCommentListDetailItem> {
  935 + return new Promise<MineCommentListDetailItem>((success, error) => {
  936 + Logger.info(TAG, `visitorCommentListData start`);
  937 + this.fetchVisitorCommentListData(pageNum,visitorFirstTime).then((navResDTO: ResponseDTO<MineCommentListDetailItem>) => {
  938 + if (!navResDTO || navResDTO.code != 0) {
  939 + error(null)
  940 + return
  941 + }
  942 + Logger.info(TAG, "visitorCommentListData then,visitorCommentListData.timeStamp:" + navResDTO.timestamp);
  943 + let navigationBean = navResDTO.data as MineCommentListDetailItem
  944 + success(navigationBean);
  945 + }).catch((err: Error) => {
  946 + Logger.error(TAG, `visitorCommentListData catch, error.name : ${err.name}, error.message:${err.message}`);
  947 + error(null)
  948 + })
  949 + })
  950 + }
  951 +
921 } 952 }
922 953
923 const minePageDatasModel = MinePageDatasModel.getInstance() 954 const minePageDatasModel = MinePageDatasModel.getInstance()
  1 +import { TAG } from '@ohos/hypium/src/main/Constant';
  2 +import { ContentDTO } from 'wdBean/Index';
  3 +import { SpConstants } from 'wdConstant/Index'
  4 +import { DateTimeUtils, LazyDataSource, NetworkUtil, SPHelper, StringUtils} from 'wdKit/Index'
  5 +import { ProcessUtils } from 'wdRouter/Index';
  6 +import { VisitorCommentComponent } from '../components/mine/home/VisitorCommentComponent';
  7 +import { CustomPullToRefresh } from '../components/reusable/CustomPullToRefresh';
  8 +import { CustomTitleUI } from '../components/reusable/CustomTitleUI';
  9 +import { ListHasNoMoreDataUI } from '../components/reusable/ListHasNoMoreDataUI';
  10 +import { EmptyComponent } from '../components/view/EmptyComponent';
  11 +import MinePageDatasModel from '../model/MinePageDatasModel';
  12 +import { CommentListItem } from '../viewmodel/CommentListItem';
  13 +
  14 +@Entry
  15 +@Component
  16 +struct VisitorCommentPage {
  17 + @State data: LazyDataSource<CommentListItem> = new LazyDataSource();
  18 + @State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0
  19 + @State count: number = 0;
  20 + @State isLoading: boolean = false
  21 + @State hasMore: boolean = true
  22 + curPageNum: number = 1;
  23 + @State isGetRequest: boolean = false
  24 + private scroller: Scroller = new Scroller();
  25 + @State isConnectNetwork : boolean = NetworkUtil.isNetConnected()
  26 + @State commentTime:string = ""
  27 +
  28 + aboutToAppear(): void {
  29 + this.commentTime = SPHelper.default.getSync(SpConstants.FIRSTCOMMENTTIME, "") as string
  30 + if (StringUtils.isNotEmpty(this.commentTime)) {
  31 + this.getNewPageData(this.commentTime)
  32 + }else{
  33 + this.isGetRequest = true
  34 + }
  35 + }
  36 +
  37 + build() {
  38 + Column() {
  39 + //标题栏目
  40 + CustomTitleUI({ titleName: "评论列表" })
  41 + if (this.count == 0) {
  42 + if (this.isGetRequest == true) {
  43 + if(this.isConnectNetwork){
  44 + EmptyComponent({ emptyType: 10 })
  45 + .height('100%')
  46 + .width('100%')
  47 + }else{
  48 + EmptyComponent({ emptyType: 1,emptyHeight:"100%" ,retry: () => {
  49 + this.isConnectNetwork = NetworkUtil.isNetConnected()
  50 + if(this.isConnectNetwork){
  51 + this.curPageNum = 1;
  52 + this.hasMore = true
  53 + this.isGetRequest = false
  54 + this.data.clear()
  55 +
  56 + if (!this.isLoading) {
  57 + this.getNewPageData(this.commentTime)
  58 + }
  59 + }
  60 + }})
  61 + .layoutWeight(1)
  62 + .width('100%')
  63 + }
  64 + }
  65 + } else {
  66 + Stack(){
  67 + Row()
  68 + .width("100%")
  69 + .height("100%")
  70 + .backgroundColor($r('app.color.white'))
  71 + .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.BOTTOM])
  72 + CustomPullToRefresh({
  73 + alldata:this.data,
  74 + scroller:this.scroller,
  75 + customList:()=>{
  76 + this.ListLayout()
  77 + },
  78 + onRefresh:(resolve)=>{
  79 + this.curPageNum = 1;
  80 + this.hasMore = true
  81 + this.isGetRequest = false
  82 + this.data.clear()
  83 +
  84 + if (!this.isLoading){
  85 + this.getNewPageData(this.commentTime)
  86 + if(resolve) resolve('刷新成功')
  87 + }
  88 + },
  89 + onLoadMore:(resolve)=> {
  90 + if (!this.isLoading) {
  91 + this.isLoading = true
  92 + this.getNewPageData(this.commentTime)
  93 + }
  94 + }
  95 + })
  96 + }
  97 + }
  98 + }
  99 + .backgroundColor($r('app.color.color_transparent'))
  100 + .height('100%')
  101 + .width('100%')
  102 + }
  103 +
  104 + @Builder ListLayout(){
  105 + List({ space:6,scroller: this.scroller }) {
  106 + LazyForEach(this.data, (item: CommentListItem, index: number) => {
  107 + ListItem() {
  108 + VisitorCommentComponent({
  109 + data: item,
  110 + isLastItem: index === this.data.totalCount() - 1
  111 + })
  112 + }
  113 + .onClick(() => {
  114 + let content = getParams(item)
  115 + ProcessUtils.processPage(content)
  116 + })
  117 + }, (item: CommentListItem, index: number) => index.toString())
  118 +
  119 + //没有更多数据 显示提示
  120 + if (!this.hasMore) {
  121 + ListItem() {
  122 + ListHasNoMoreDataUI()
  123 + }.padding({bottom:px2vp(this.bottomSafeHeight) + 20})
  124 + }
  125 + }
  126 + .cachedCount(4)
  127 + .scrollBar(BarState.Off)
  128 + .edgeEffect(EdgeEffect.None)
  129 + .margin({ top: '23lpx'})
  130 + .layoutWeight(1)
  131 + }
  132 +
  133 + getNewPageData(commentTime:string) {
  134 + this.isLoading = true
  135 + if (this.hasMore) {
  136 + MinePageDatasModel.visitorCommentListData( `${this.curPageNum}`, encodeURI(commentTime)).then((value) => {
  137 + if (!this.data || value.list.length == 0) {
  138 + this.hasMore = false
  139 + } else {
  140 + value.list.forEach((item) => {
  141 + let commentContent = item.commentContent
  142 + if (item.sensitiveShow === 0 && item.sensitiveExist === 1) {
  143 + commentContent = item.commentContentSensitive
  144 + }
  145 + let parentCommentContent = ""
  146 + if (item.parentCommentVo != null) {
  147 + parentCommentContent = item.parentCommentVo.commentContent
  148 + }
  149 + let parentCommentUserName = ""
  150 + if (item.parentCommentVo != null) {
  151 + parentCommentUserName = item.parentCommentVo.fromUserName
  152 + }
  153 + let publishTime =
  154 + DateTimeUtils.getCommentTime(DateTimeUtils.parseDate(item.createTime, DateTimeUtils.PATTERN_DATE_TIME_HYPHEN))
  155 +
  156 + this.data.push(new CommentListItem(item.fromUserHeader, item.fromUserName, item.targetTitle, publishTime,
  157 + commentContent, item.likeNum, 0, item.id, item.targetId, item.targetType, item.targetRelId,
  158 + item.targetRelObjectId, item.targetRelType, item.targetStatus, item.checkStatus, parentCommentContent,
  159 + parentCommentUserName))
  160 +
  161 + })
  162 + this.data.notifyDataReload()
  163 + this.count = this.data.totalCount()
  164 + if (this.data.totalCount() < value.totalCount) {
  165 + this.curPageNum++
  166 + } else {
  167 + this.hasMore = false
  168 + }
  169 + }
  170 + this.isGetRequest = true
  171 + this.isLoading = false
  172 + }).catch((err: Error) => {
  173 + console.log(TAG, JSON.stringify(err))
  174 + this.isGetRequest = true
  175 + this.isLoading = false
  176 + })
  177 + }
  178 + }
  179 +}
  180 +
  181 +function getParams(item: CommentListItem) : ContentDTO{
  182 + let contentDTO = new ContentDTO();
  183 +
  184 + // contentDTO.objectType = item.targetType + ""
  185 + // contentDTO.objectId = item.targetId + ""
  186 + // contentDTO.newsTitle = item.targetTitle
  187 + // contentDTO.channelId =
  188 + // contentDTO.rmhPlatform =
  189 +
  190 + contentDTO.objectId = item.targetId;
  191 + contentDTO.relType = item.targetRelType + "";
  192 + contentDTO.relId = item.targetRelId;
  193 + contentDTO.objectType = item.targetType + "";
  194 + contentDTO.newsTitle = item.targetTitle
  195 +
  196 + return contentDTO
  197 +}
@@ -26,6 +26,7 @@ @@ -26,6 +26,7 @@
26 "pages/MineMessagePage", 26 "pages/MineMessagePage",
27 "components/page/InteractMessagePage", 27 "components/page/InteractMessagePage",
28 "pages/ShowHomePageHeaderPage", 28 "pages/ShowHomePageHeaderPage",
29 - "pages/SubscribeMessagePage" 29 + "pages/SubscribeMessagePage",
  30 + "pages/VisitorCommentPage"
30 ] 31 ]
31 } 32 }
@@ -183,7 +183,7 @@ struct ModifyPasswordPage { @@ -183,7 +183,7 @@ struct ModifyPasswordPage {
183 .alignItems(VerticalAlign.Center) 183 .alignItems(VerticalAlign.Center)
184 184
185 Column() { 185 Column() {
186 - Text("提示:密码长度6~20位,使用大写字母、小写字母、数字、特殊字符中三种或三种以上").fontSize(12).maxLines(3).fontColor(0x999999).padding({top:`${this.calcHeight(10)}lpx`}) 186 + Text("提示:密码长度8~20位,使用大写字母、小写字母、数字、特殊字符中三种或三种以上").fontSize(12).maxLines(3).fontColor(0x999999).padding({top:`${this.calcHeight(10)}lpx`})
187 } 187 }
188 .width('100%') 188 .width('100%')
189 .height(`${this.calcHeight(85)}lpx`) 189 .height(`${this.calcHeight(85)}lpx`)
@@ -200,6 +200,7 @@ struct ModifyPasswordPage { @@ -200,6 +200,7 @@ struct ModifyPasswordPage {
200 .width('100%') 200 .width('100%')
201 .height(`${this.calcHeight(80)}lpx`) 201 .height(`${this.calcHeight(80)}lpx`)
202 .backgroundColor(this.btnStatus ? '#ED2800' : '#99ED2800') 202 .backgroundColor(this.btnStatus ? '#ED2800' : '#99ED2800')
  203 + .enabled(this.btnStatus ?true:false)
203 .borderRadius('4vp') 204 .borderRadius('4vp')
204 .onClick(() => { 205 .onClick(() => {
205 if(this.btnStatus){ 206 if(this.btnStatus){
@@ -227,7 +228,7 @@ struct ModifyPasswordPage { @@ -227,7 +228,7 @@ struct ModifyPasswordPage {
227 } 228 }
228 229
229 inputTextChange(){ 230 inputTextChange(){
230 - if ((this.password_old.length >= 6 && this.password_old.length <= 20) && (this.password_new.length >= 6 && this.password_new.length <= 20)&& (this.password_new_repeat.length >= 6 && this.password_new_repeat.length <= 20)) { 231 + if ((this.password_old.length >= 8 && this.password_old.length <= 20) && (this.password_new.length >= 8 && this.password_new.length <= 20)&& (this.password_new_repeat.length >= 8 && this.password_new_repeat.length <= 20)) {
231 this.btnStatus = true; 232 this.btnStatus = true;
232 } else { 233 } else {
233 this.btnStatus = false; 234 this.btnStatus = false;
@@ -134,7 +134,7 @@ export struct SettingPasswordPage { @@ -134,7 +134,7 @@ export struct SettingPasswordPage {
134 this.listData.push(new AccoutPageDataModel(0, '设置密码', '', '', '', '', 0)) 134 this.listData.push(new AccoutPageDataModel(0, '设置密码', '', '', '', '', 0))
135 this.listData.push(new AccoutPageDataModel(1, '', '', '', '', '请输入密码', 10086)) 135 this.listData.push(new AccoutPageDataModel(1, '', '', '', '', '请输入密码', 10086))
136 this.listData.push(new AccoutPageDataModel(1, '', '', '', '', '再次输入密码', 10087)) 136 this.listData.push(new AccoutPageDataModel(1, '', '', '', '', '再次输入密码', 10087))
137 - this.listData.push(new AccoutPageDataModel(3, '', '', '提示:密码长度6~20位,使用大写字母、小写字母、数字、特殊字符中三种或三种以上', '', '', 0)) 137 + this.listData.push(new AccoutPageDataModel(3, '', '', '提示:密码长度8~20位,使用大写字母、小写字母、数字、特殊字符中三种或三种以上', '', '', 0))
138 this.listData.push(new AccoutPageDataModel(4, '', '', '', '确认', '', 0)) 138 this.listData.push(new AccoutPageDataModel(4, '', '', '', '确认', '', 0))
139 break; 139 break;
140 case 2: 140 case 2:
@@ -294,6 +294,7 @@ export struct SettingPasswordPage { @@ -294,6 +294,7 @@ export struct SettingPasswordPage {
294 .width('100%') 294 .width('100%')
295 .height('80lpx') 295 .height('80lpx')
296 .backgroundColor(this.btnStatus ? '#da3e22' : '#e5856d') 296 .backgroundColor(this.btnStatus ? '#da3e22' : '#e5856d')
  297 + .enabled(this.btnStatus ?true:false)
297 .fontColor('#fff') 298 .fontColor('#fff')
298 .borderRadius('4vp') 299 .borderRadius('4vp')
299 .onClick(() => { 300 .onClick(() => {
@@ -325,7 +326,7 @@ export struct SettingPasswordPage { @@ -325,7 +326,7 @@ export struct SettingPasswordPage {
325 TrackingButton.click("setPasswordPageConfirm",TrackConstants.PageName.Setup_Passwd,TrackConstants.PageName.Setup_Passwd) 326 TrackingButton.click("setPasswordPageConfirm",TrackConstants.PageName.Setup_Passwd,TrackConstants.PageName.Setup_Passwd)
326 } 327 }
327 // 需要+手机号校验 328 // 需要+手机号校验
328 - if (this.password01.length < 6 || this.password01.length > 20) { 329 + if (this.password01.length < 8 || this.password01.length > 20) {
329 this.showToastTip('密码不符合密码规范') 330 this.showToastTip('密码不符合密码规范')
330 return 331 return
331 } 332 }
@@ -376,7 +377,7 @@ export struct SettingPasswordPage { @@ -376,7 +377,7 @@ export struct SettingPasswordPage {
376 } 377 }
377 378
378 if (this.password01) { 379 if (this.password01) {
379 - if ((this.password01.length >= 6 && this.password01.length <= 20) && (this.password02.length >= 6 && this.password02.length <= 20)) { 380 + if ((this.password01.length >= 8 && this.password01.length <= 20) && (this.password02.length >= 8 && this.password02.length <= 20)) {
380 this.btnStatus = true; 381 this.btnStatus = true;
381 } else { 382 } else {
382 this.btnStatus = false; 383 this.btnStatus = false;
@@ -64,5 +64,6 @@ struct MorningEveningPaperPage { @@ -64,5 +64,6 @@ struct MorningEveningPaperPage {
64 64
65 onBackPress() { 65 onBackPress() {
66 Logger.info(TAG, 'onBackPress'); 66 Logger.info(TAG, 'onBackPress');
  67 + return true
67 } 68 }
68 } 69 }
@@ -74,107 +74,86 @@ struct LaunchAdvertisingPage { @@ -74,107 +74,86 @@ struct LaunchAdvertisingPage {
74 bottom: 0 74 bottom: 0
75 }) 75 })
76 76
77 - if (this.defaultModel.isAd === '1'){  
78 - Stack({alignContent:Alignment.TopStart}){  
79 - Text('广告')  
80 - .fontColor(Color.White)  
81 - .textAlign(TextAlign.Center)  
82 - .fontSize('24lpx')  
83 - .width('72lpx')  
84 - .height('36lpx')  
85 - .borderRadius(2)  
86 - .margin({top:'15lpx',left:'19lpx'}) 77 +
  78 + Stack(){
  79 + Column(){
  80 + Row(){
  81 + if (this.defaultModel.isAd === '1') {
  82 + Text('广告')
  83 + .fontColor(Color.White)
  84 + .textAlign(TextAlign.Center)
  85 + .fontSize('24lpx')
  86 + .width('72lpx')
  87 + .height('36lpx')
  88 + .borderRadius(2)
  89 + .margin({top:'15lpx',left:'19lpx'})
  90 + .backgroundColor('#80000000')
  91 + .margin({left:16})
  92 + }
  93 +
  94 + Blank()
  95 +
  96 + Button(){
  97 + Text(this.time + 's 跳过')
  98 + .fontSize('27lpx')
  99 + .fontColor(Color.White)
  100 + .margin({left:'28lpx',right:'28lpx'})
  101 + }
  102 + .width('148lpx')
  103 + .height('56lpx')
  104 + .margin({top:'10lpx',right:'19lpx'})
  105 + .backgroundColor('#80000000')
  106 + .onClick(() => {
  107 + this.enter()
  108 + this.trackingLaunchJumpOver()
  109 + }).margin({right:16})
  110 +
  111 + }.margin({top:10}).width('100%').height('56lpx')
  112 +
  113 + Blank()
  114 +
  115 + if (this.defaultModel.linkUrl.length > 0 || this.defaultModel.objectId.length > 0){
  116 + Button(){
  117 + Row(){
  118 + Text('点击跳转至详情')
  119 + .fontSize('31lpx')
  120 + .fontColor(Color.White)
  121 + .margin({
  122 + left:'55lpx'
  123 + })
  124 + Image($r('app.media.Slice'))
  125 + .width('46lpx')
  126 + .height('46lpx')
  127 + .margin({right:'55lpx'})
  128 + }.alignItems(VerticalAlign.Center)
  129 + }
  130 + .width('566lpx')
  131 + .height('111lpx')
  132 + .margin({
  133 + bottom: '51lpx'
  134 + })
87 .backgroundColor('#80000000') 135 .backgroundColor('#80000000')
  136 + .onClick(()=>{
  137 + this.action()
  138 + })
  139 + }
  140 + if(this.defaultModel.screenType === '1') {
  141 + Image($r('app.media.LaunchPage_logo'))
  142 + .width('278lpx')
  143 + .height('154lpx')
  144 + .margin({top: '28lpx',bottom:'28lpx'})
  145 + }
88 } 146 }
89 .width('100%') 147 .width('100%')
90 .height('100%') 148 .height('100%')
91 } 149 }
92 -  
93 - Stack({alignContent:Alignment.TopEnd}){  
94 - Button(){  
95 - Text(this.time + 's 跳过')  
96 - // .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM])  
97 - .fontSize('27lpx')  
98 - .fontColor(Color.White)  
99 - .margin({left:'28lpx',right:'28lpx'})  
100 -  
101 - }  
102 - .width('148lpx')  
103 - .height('56lpx')  
104 - .margin({top:'10lpx',right:'19lpx'})  
105 - .backgroundColor('#80000000')  
106 - .onClick(() => {  
107 - this.enter()  
108 - this.trackingLaunchJumpOver()  
109 - })  
110 - }  
111 .width('100%') 150 .width('100%')
112 .height('100%') 151 .height('100%')
113 -  
114 - if(this.defaultModel.screenType != '2'){  
115 - //底部logo样式 按钮加载在背景展示图上  
116 - Button(){  
117 - Row(){  
118 - Text('点击跳转至详情')  
119 - .fontSize('31lpx')  
120 - .fontColor(Color.White)  
121 - .margin({  
122 - left:'55lpx'  
123 - })  
124 - Image($r('app.media.Slice'))  
125 - .width('46lpx')  
126 - .height('46lpx')  
127 - .margin({right:'55lpx'})  
128 - }.alignItems(VerticalAlign.Center)  
129 - }  
130 - .width('566lpx')  
131 - .height('111lpx')  
132 - .margin({  
133 - bottom: '51lpx'  
134 - })  
135 - .backgroundColor('#80000000')  
136 - .onClick(()=>{  
137 - this.action()  
138 - })  
139 - }  
140 } 152 }
141 } 153 }
142 .width('100%') 154 .width('100%')
143 - .height('84%') 155 + .height('100%')
144 .margin({top:'0'}) 156 .margin({top:'0'})
145 -  
146 - if(this.defaultModel.screenType === '2'){  
147 - //全屏样式,底部无logo 按钮放在原底部logo位置  
148 - Button(){  
149 - Row(){  
150 - Text('点击跳转至详情')  
151 - .fontSize('31lpx')  
152 - .fontColor(Color.White)  
153 - .margin({  
154 - left:'55lpx'  
155 - })  
156 - Image($r('app.media.Slice'))  
157 - .width('46lpx')  
158 - .height('46lpx')  
159 - .margin({right:'55lpx'})  
160 - }.alignItems(VerticalAlign.Center)  
161 - }  
162 - .width('566lpx')  
163 - .height('111lpx')  
164 - .margin({  
165 - top: '28lpx'  
166 - })  
167 - .backgroundColor('#80000000')  
168 - .onClick(()=>{  
169 - this.action()  
170 - })  
171 - }else {  
172 - //底部logo样式  
173 - Image($r('app.media.LaunchPage_logo'))  
174 - .width('278lpx')  
175 - .height('154lpx')  
176 - .margin({top: '28lpx'})  
177 - }  
178 } 157 }
179 .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM]) 158 .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM])
180 .width('100%') 159 .width('100%')
@@ -230,7 +209,12 @@ struct LaunchAdvertisingPage { @@ -230,7 +209,12 @@ struct LaunchAdvertisingPage {
230 this.defaultModel.screenName = dataModel.launchAdInfo[0].matInfo.advTitle 209 this.defaultModel.screenName = dataModel.launchAdInfo[0].matInfo.advTitle
231 this.defaultModel.durations = dataModel.launchAdInfo[0].displayDuration 210 this.defaultModel.durations = dataModel.launchAdInfo[0].displayDuration
232 this.defaultModel.linkUrl = dataModel.launchAdInfo[0].matInfo.linkUrl 211 this.defaultModel.linkUrl = dataModel.launchAdInfo[0].matInfo.linkUrl
233 - this.defaultModel.screenType = dataModel.launchAdInfo[0].matInfo.startStyle 212 + if (dataModel.launchAdInfo[0].matInfo.startStyle === '1') {
  213 + this.defaultModel.screenType = '2'
  214 + }else {
  215 + this.defaultModel.screenType = '1'
  216 + }
  217 +
234 this.defaultModel.bootScreenUrl = dataModel.launchAdInfo[0].matInfo.matImageUrl[0] 218 this.defaultModel.bootScreenUrl = dataModel.launchAdInfo[0].matInfo.matImageUrl[0]
235 this.defaultModel.bootVideoUrl = dataModel.launchAdInfo[0].matInfo.matVideoUrl 219 this.defaultModel.bootVideoUrl = dataModel.launchAdInfo[0].matInfo.matVideoUrl
236 this.defaultModel.showType = dataModel.launchAdInfo[0].matInfo.matType 220 this.defaultModel.showType = dataModel.launchAdInfo[0].matInfo.matType