陈剑华

Merge remote-tracking branch 'origin/main'

Showing 28 changed files with 707 additions and 151 deletions
... ... @@ -236,6 +236,10 @@ export class HttpUrlUtils {
* 预约状态
*/
static readonly LIVE_APPOINTMENT_BATCH_PATH: string = "/api/live-center-message/zh/c/live/subscribe/user/batch";
/**
* 游客 评论列表
*/
static readonly VISITOR_COMMENT_LIST_DATA_PATH: string = "/api/rmrb-comment/comment/zh/c/visitorCommentList";
/**
* 查询是否被禁言
... ... @@ -868,4 +872,9 @@ export class HttpUrlUtils {
let url = HttpUrlUtils.getHost() + "/api/rmrb-contact/contact/zh/c/push/device"
return url
}
static getVisitorCommentListDataUrl() {
let url = HttpUrlUtils.getHost() + HttpUrlUtils.VISITOR_COMMENT_LIST_DATA_PATH
return url
}
}
... ...
... ... @@ -91,6 +91,8 @@ export class WDRouterPage {
static loginProtocolPage = new WDRouterPage("wdLogin", "ets/pages/login/LoginProtocolWebview");
//我的主页
static mineHomePage = new WDRouterPage("wdComponent", "ets/pages/MineHomePage");
//游客评论列表
static visitorCommentPage = new WDRouterPage("wdComponent", "ets/pages/VisitorCommentPage");
// 隐私设置页
static privacySettingPage = new WDRouterPage("wdComponent", "ets/components/page/PrivacySettingPage");
// 关于页
... ...
... ... @@ -115,6 +115,7 @@ export class ProcessUtils {
}
break;
case ContentConstants.TYPE_LINK:
content.openType = "1"
ProcessUtils.gotoDefaultWeb(content);
break;
//图集详情页
... ...
... ... @@ -60,20 +60,13 @@ export struct CarderInteraction {
})
}
Row() {
Image($r('app.media.CarderInteraction_comment'))
.width(18)
.height(18)
Text('评论')
.margin({ left: 4 })
.fontSize(14)
.fontColor('#666666')
if(this.contentDetailData.rmhInfo != null){
if(this.contentDetailData.shareInfo != null && 1 == this.contentDetailData.shareInfo.shareOpen && 1 == this.contentDetailData.rmhInfo.cnShareControl){
this.shareLayout()
}
}else{
this.shareLayout()
}
.justifyContent(FlexAlign.Center)
.onClick(() => {
ProcessUtils.processPage(this.contentDTO)
})
this.builderLike()
}
... ... @@ -87,6 +80,23 @@ export struct CarderInteraction {
.alignItems(VerticalAlign.Center)
}
@Builder
shareLayout() {
Row() {
Image($r('app.media.CarderInteraction_comment'))
.width(18)
.height(18);
Text('评论')
.margin({ left: 4 })
.fontSize(14)
.fontColor('#666666');
}
.justifyContent(FlexAlign.Center)
.onClick(() => {
ProcessUtils.processPage(this.contentDTO);
})
}
/**
* 点赞组件
*/
... ...
... ... @@ -54,7 +54,7 @@ export struct PaperTitleComponent {
.margin({ left: 10 })
.fontSize(22)
.fontColor($r('app.color.white'))
.fontWeight(900)
.fontFamily('Source Han Serif CN')
.maxLines(1)
... ... @@ -133,7 +133,7 @@ export struct PaperTitleComponent {
.linearGradient({
direction: GradientDirection.Right, // 渐变方向
repeating: false, // 渐变颜色是否重复
colors: [[0x4dffffff, 0.0], [0x33ffffff, 0.3], [0x1affffff,0.6], [0x03ffffff,1]] // 数组末尾元素占比小于1时满足重复着色效果
colors: [[0x4dffffff, 0.0], [0x33ffffff, 0.2], [0x1affffff,0.6], [0x03ffffff,1]] // 数组末尾元素占比小于1时满足重复着色效果
})
.margin({ left:8, right: 0})
... ...
... ... @@ -128,6 +128,7 @@ export struct SpacialTopicPageComponent {
this.publishCommentModel.keyArticle = String(this.contentDetailData?.keyArticle || '')
this.publishCommentModel.targetType = String(this.contentDetailData?.newsType || '')
this.publishCommentModel.visitorComment = String(this.contentDetailData?.visitorComment || '')
// }
this.subjectData = 'dasdasdadas'
... ... @@ -135,8 +136,15 @@ export struct SpacialTopicPageComponent {
// this.trySendData2H5()
}
if(pageInfoMsg && pageInfoMsg.data){
this.contentDetailData.openComment = Number(pageInfoMsg.data.topicInfo.commentFlag)
this.contentDetailData.commentDisplay = Number(pageInfoMsg.data.topicInfo.commentShowFlag)
this.contentDetailData.openComment = Number(pageInfoMsg.data.topicInfo?.commentFlag)
this.contentDetailData.commentDisplay = Number(pageInfoMsg.data.topicInfo?.commentShowFlag)
if(pageInfoMsg.data.topicInfo?.shareOpen === 1){
if (!this.operationButtonList.includes('share')) {
this.operationButtonList.push('share');
}
}else{
this.operationButtonList = this.operationButtonList.filter(e =>e !== 'share')
}
}
console.log('contentDetailData',this.contentDetailData)
... ... @@ -194,6 +202,7 @@ export struct SpacialTopicPageComponent {
this.showCommentList = true
}
})
//全部评论
CommentDialogView({
index: $index,
currentIndex: $currentIndex,
... ...
import { inputMethodEngine } from '@kit.IMEKit'
import { commentInfo } from 'wdBean/Index'
import { ToastUtils } from 'wdKit/Index'
import { HttpUtils } from 'wdNetwork/Index'
import { commentItemModel } from '../model/CommentModel'
import { publishCommentModel } from '../model/PublishCommentModel'
import commentViewModel from '../viewmodel/CommentViewModel'
... ... @@ -40,6 +42,17 @@ export struct CommentCustomDialog {
}
}
// 未登录,游客评论未打开 则先登录
if (!HttpUtils.isLogin()) {
if (this.publishCommentModel.visitorComment != "1") {
ToastUtils.showToast("暂时无法评论", 3000)
this.publishCommentModel.commentContent = ''
this.controller?.close()
return
}
}
// 点击时 即可埋点
if (this.onPublishBtnClickTrack) {
this.onPublishBtnClickTrack()
... ...
... ... @@ -24,7 +24,10 @@ export struct CommentListDialogView {
pageInfo: this.pageInfo,
onClose: this.onClose
}),
autoCancel: false,
autoCancel: true,
cancel: () => {
PublicDialogManager.shareInstance().closeDialog(this.dialogController)
},
customStyle: true,
alignment: DialogAlignment.Bottom,
})
... ...
... ... @@ -128,13 +128,13 @@ export struct CommentTabComponent {
if(this.contentDetail.appstyle === 9) return
this.onCommentFocus && this.onCommentFocus()
// 未登录,游客评论未打开 则先登录
if (!HttpUtils.isLogin()) {
if (this.contentDetail.visitorComment != 1) {
WDRouterRule.jumpWithPage(WDRouterPage.loginPage)
return
}
}
// 未登录,游客评论未打开 则先登录 ,这里逻辑 放到 发布按钮事件判断了
// if (!HttpUtils.isLogin()) {
// if (this.contentDetail.visitorComment != 1) {
// ToastUtils.showToast("暂时无法评论", 3000)
// return
// }
// }
if (this.contentDetail.openComment != 1 && this.contentDetail.commentDisplay != 1) {
ToastUtils.showToast("暂时无法评论", 3000)
... ...
... ... @@ -23,7 +23,7 @@ export default struct MinePagePersonFunctionUI {
switch (item.msg){
case "评论":{
if(!this.isLogin){
WDRouterRule.jumpWithPage(WDRouterPage.loginPage)
WDRouterRule.jumpWithPage(WDRouterPage.visitorCommentPage)
return
}else {
let params: Record<string, string> = {'comment': "1"};
... ...
... ... @@ -83,7 +83,7 @@ export default struct MinePageUserSimpleInfoUI {
.textAlign(TextAlign.Center)
.fontColor($r('app.color.white'))
.fontSize(`${this.calcHeight(19)}lpx`)
.width(`${this.calcHeight(50)}lpx`)
.width(this.levelId>9?`${this.calcHeight(69)}lpx`:`${this.calcHeight(50)}lpx`)
.height(`${this.calcHeight(29)}lpx`)
}.margin({top:'`${this.calcHeight(15)}lpx`'})
}.alignItems(HorizontalAlign.Start)
... ...
... ... @@ -159,6 +159,9 @@ export struct AppointmentListUI {
this.count = this.data.totalCount()
if (this.data.totalCount() < value.totalCount) {
this.curPageNum++
if(this.count < 5){
this.getNewPageData()
}
} else {
this.hasMore = false
}
... ...
import { ContentDTO } from 'wdBean/Index'
import { StringUtils, UserDataLocal } from 'wdKit/Index'
import MinePageDatasModel from '../../../model/MinePageDatasModel'
import { CommentLikeOperationRequestItem } from '../../../viewmodel/CommentLikeOperationRequestItem'
import { CommentListItem } from '../../../viewmodel/CommentListItem'
import measure from '@ohos.measure'
@Component
export struct VisitorCommentComponent {
@ObjectLink data: CommentListItem
isLastItem: boolean = false
@State isExpand: boolean = false;
@State isExpandParent: boolean = false;
@State isOverLines: boolean = false
@State isOverLinesParent: boolean = false
build() {
Column() {
Row() {
if (this.isExpand) {
Text() {
Span(this.data.commentContent)
}
.textStyle()
} else {
Text() {
Span(this.clipText(this.data.commentContent, 31, 5, 630, 0))
if (this.isOverLines) {
Span('...展开')
.fontColor($r('app.color.color_999999'))
.onClick(() => {
this.isExpand = true
})
}
}.maxLines(5)
.wordBreak(WordBreak.BREAK_ALL)
.textStyle()
}
}.padding({ left: '31lpx', right: '31lpx' })
.width('100%')
Column() {
if (StringUtils.isNotEmpty(this.data.parentCommentContent)) {
//父评论
Row() {
if (this.isExpandParent) {
Text() {
Span(`@${this.data.parentCommentUserName}:`)
.fontColor($r('app.color.color_000000'))
.fontWeight('500lpx')
.fontSize('27lpx')
.lineHeight('40lpx')
Span(this.data.parentCommentContent)
.fontColor($r('app.color.color_000000'))
.fontWeight('400lpx')
.fontSize('27lpx')
.lineHeight('40lpx')
}
.width('100%')
.textAlign(TextAlign.Start)
} else {
Text() {
Span(`@${this.data.parentCommentUserName}:`)
.fontColor($r('app.color.color_000000'))
.fontWeight('500lpx')
.fontSize('27lpx')
.lineHeight('40lpx')
Span(this.clipText(this.data.parentCommentContent, 31, 5, 630, 1))
.fontColor($r('app.color.color_000000'))
.fontWeight('400lpx')
.fontSize('27lpx')
.lineHeight('40lpx')
if (this.isOverLinesParent) {
Span('...展开')
.fontColor($r('app.color.color_999999'))
.onClick(() => {
this.isExpandParent = true
})
}
}.maxLines(5)
.wordBreak(WordBreak.BREAK_ALL)
.textAlign(TextAlign.Start)
.width('100%')
}
}
.width('100%')
.padding({ top: '23lpx', bottom: '15lpx', right: '23lpx' })
Divider()
.width('100%')
.height('1lpx')
.strokeWidth('1lpx')
.backgroundColor($r('app.color.color_EDEDED'))
.margin({ top: '4lpx', bottom: '4lpx' })
}
Column() {
Row() {
Row() {
Image($r('app.media.comment_link_icon'))
.objectFit(ImageFit.Auto)
.width('31lpx')
.height('31lpx')
.margin({ right: '10lpx' })
Column() {
Row() {
Text(`${this.data.targetTitle}`)
.fontWeight('400lpx')
.fontColor($r('app.color.color_666666'))
.lineHeight('38lpx')
.fontSize('27lpx')
.layoutWeight(1)
.maxLines(1)
.textOverflow({ overflow: TextOverflow.Ellipsis })
}.width('100%')
}
.layoutWeight(1)
.alignItems(HorizontalAlign.Start)
}.layoutWeight(1)
Image($r('app.media.arrow_icon_right'))
.margin({ right: '4lpx' })
.width('23lpx')
.height('23lpx')
.margin({right:'23lpx'})
}
.width('100%')
.height('69lpx')
.justifyContent(FlexAlign.SpaceBetween)
}.height('69lpx')
.justifyContent(FlexAlign.Center)
}
.margin({ top: '19lpx', bottom: '31lpx', left: '31lpx', right: '31lpx' })
.padding({ left: '23lpx' })
.width('662lpx')
.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)
}
commentLikeOperation() {
let item = new CommentLikeOperationRequestItem(this.data.targetId, this.data.id + "", this.data.targetType + "", UserDataLocal.getUserName(), UserDataLocal.getUserHeaderUrl(), this.data.like_status === 0 ? 1 : 0)
MinePageDatasModel.getCommentLikeOperation(item, getContext(this)).then((value) => {
if (value != null) {
if (value.code === 0 || value.code.toString() === "0") {
this.data.like_status = this.data.like_status === 0 ? 1 : 0
this.data.likeNum = this.data.like_status === 0 ? this.data.likeNum - 1 : this.data.likeNum + 1
}
}
})
}
/**
* 截断文本
* @author liuzhendong(猩猩G)
* @param {string} str 要截断的文本 '啊啊啊啊啊'
* @param {number} fontSize 字体大小(px)
* @param {number} maxLines 最大行数 3
* @param {number} textWidth 文本宽度(px) vp 需要转换vp2px()
* @returns {string} clipStr 截断后的文本 '啊啊'
* @param {type} 0 我的评论 1 父评论
*/
clipText(str: string, fontSize: number, maxLines: number, textWidth: number, type: number): string {
let strArr: string[] = str.split("")
let truncateContent: string = '啊啊啊啊啊' // ...比正常文字宽度更小,这里使用啊啊啊(任意三个文字)代替计算
let measureTruncateWidth: number = measure.measureText({
textContent: truncateContent,
fontSize: px2fp(fontSize),
wordBreak:WordBreak.BREAK_ALL
})
if(type === 1){
measureTruncateWidth = measureTruncateWidth + measure.measureText({
textContent: `@${this.data.parentCommentUserName}:`,
fontSize: px2fp(fontSize),
wordBreak:WordBreak.BREAK_ALL
})
}
let clipStr: string = ''
for (let i = 0; i < strArr.length; i++) {
if (measure.measureText({
textContent: clipStr,
fontSize: px2fp(fontSize),
wordBreak:WordBreak.BREAK_ALL
}) >= textWidth * maxLines - measureTruncateWidth) {
if (type === 0) {
this.isOverLines = true
} else {
this.isOverLinesParent = true
}
break;
}
clipStr += strArr[i]
}
return clipStr
}
}
@Extend(Text)
function textStyle() {
.width('630lpx')
.fontSize('31lpx')
.fontWeight('400lpx')
.fontColor($r('app.color.color_222222'))
.lineHeight('46lpx')
}
function getParams(item: CommentListItem) : ContentDTO{
let contentDTO = new ContentDTO();
// contentDTO.objectType = item.targetType + ""
// contentDTO.objectId = item.targetId + ""
// contentDTO.newsTitle = item.targetTitle
// contentDTO.channelId =
// contentDTO.rmhPlatform =
contentDTO.objectId = item.targetId;
contentDTO.relType = item.targetRelType + "";
contentDTO.relId = item.targetRelId;
contentDTO.objectType = item.targetType + "";
contentDTO.newsTitle = item.targetTitle
return contentDTO
}
... ...
... ... @@ -451,9 +451,9 @@ export struct PaperSingleColumn999CardView {
Text(DateTimeUtils.getFormattedDuration(this.item?.videoInfo.videoDuration * 1000))
.fontColor(Color.White)
.fontSize($r('app.float.vp_12'))
.fontWeight(500)
.textAlign(TextAlign.End)
.lineHeight(18)
.fontFamily('BebasNeue')
.textShadow({
radius: 2,
color: 'rgba(0,0,0,0.3)',
... ... @@ -509,7 +509,7 @@ export struct PaperSingleColumn999CardView {
Text(this.item?.photoNum.toString())
.fontColor(Color.White)
.fontSize($r('app.float.vp_12'))
.fontWeight(500)
.fontFamily('BebasNeue')
.textAlign(TextAlign.End)
.lineHeight(18)
.textShadow({
... ...
... ... @@ -45,7 +45,7 @@ struct EditUserNikeNamePage {
.alignItems(VerticalAlign.Center)
Divider()
.margin(20)
.margin({ top:0,bottom:20,left:20 ,right:20 })
Row(){
Text('1、账号中(头像、昵称等)不允许含有违禁违规内容;\n2、最多16个字,只能输入中文、数字、英文字母。')
... ...
... ... @@ -98,12 +98,14 @@ struct InteractMessagePage {
Column(){
Row(){
Text('共获')
.fontSize(18)
.fontSize(18).height(40).align(Alignment.Bottom)
Text(this.likeNum.toString())
.fontSize(30)
.fontSize(40)
.fontColor(Color.Red)
.fontFamily('BebasNeue')
.margin(5).height(40).align(Alignment.Bottom)
Text('赞')
.fontSize(18)
.fontSize(18).height(40).align(Alignment.Bottom)
}.height(75)
... ...
... ... @@ -4,7 +4,7 @@ import PageModel from '../../viewmodel/PageModel';
import { CommonConstants, ViewType } from 'wdConstant'
import { EmptyComponent,WDViewDefaultType } from '../view/EmptyComponent'
import { ErrorComponent } from '../view/ErrorComponent'
import { CompDTO, ContentDTO, contentListParams,contentListItem } from 'wdBean'
import { CompDTO, ContentDTO, contentListParams,contentListItem, InteractDataDTO } from 'wdBean'
import NoMoreLayout from './NoMoreLayout'
import { CustomSelectUI } from '../view/CustomSelectUI';
import { CustomBottomFuctionUI } from '../view/CustomBottomFuctionUI';
... ... @@ -16,6 +16,7 @@ import { NetworkUtil } from 'wdKit/Index';
import TrackingPageBrowseUtils from '../../utils/TrackingPageBrowseUtils'
import { TrackConstants, TrackingButton, TrackingContent, TrackParamConvert } from 'wdTracking/Index';
import { PeopleShipMainViewModel } from '../../viewmodel/PeopleShipMainViewModel';
@Entry
@Component
struct MyCollectionListPage {
... ... @@ -28,6 +29,8 @@ struct MyCollectionListPage {
@Provide deleteNum :number = 0;
@Provide isAllSelect:boolean = false
@Provide commentList: InteractDataDTO[] = []
@State currentPage: number = 1;
private scroller: Scroller = new Scroller();
emptyType: WDViewDefaultType = WDViewDefaultType.WDViewDefaultType_Default
... ... @@ -175,6 +178,10 @@ struct MyCollectionListPage {
this.allDatas.push(compDTO)
}
if (this.allDatas.length > 0){
this.getContentData()
}
if (collectionItem.hasNext === 0) {
this.browSingModel.hasMore = false;
} else {
... ... @@ -254,17 +261,34 @@ struct MyCollectionListPage {
if (this.allDatas.length === 0) {
this.browSingModel.viewType = ViewType.EMPTY;
this.browSingModel.emptyType = WDViewDefaultType.WDViewDefaultType_NoCollection
this.browSingModel.hasMore === true
this.isDisplayButton = false;
}
}
getContentData(){
for (let index = 0; index < this.allDatas.length; index++) {
const compDTO = this.allDatas[index];
compDTO.isCollection = true ///用于时间展示
this.allDatas.push(compDTO)
async getContentData(){
try {
// 获取列表数据
const params: contentListParams = {
contentList: []
}
this.allDatas.forEach((item: ContentDTO) => {
params.contentList.push({
contentId: item.objectId,
contentType: Number(item.objectType ?? '1')
})
})
this.commentList = await PeopleShipMainViewModel.getContentInteractInfo(params)
let datas: ContentDTO[] = [];
for (let index = 0; index < this.allDatas.length; index++) {
const compDTO = this.allDatas[index];
compDTO.interactData = this.commentList[index]
datas.push(compDTO)
}
this.allDatas.push(...datas)
} catch (exception) {
}
}
}
\ No newline at end of file
... ...
... ... @@ -29,10 +29,10 @@ export struct CustomTitleUI {
Text(this.titleName)
.maxLines(1)
.id("title")
.fontSize(`${this.calcHeight(30)}lpx`)
.fontSize(`${this.calcHeight(35)}lpx`)
.fontWeight(400)
.fontColor($r('app.color.color_222222'))
.lineHeight(`${this.calcHeight(43)}lpx`)
.lineHeight(`${this.calcHeight(50)}lpx`)
.alignRules({
center: {anchor: "__container__", align: VerticalAlign.Center},
middle: {anchor: "__container__", align: HorizontalAlign.Center}
... ...
import { SpConstants } from 'wdConstant';
import { Logger, SPHelper, ToastUtils, EmitterEventId, EmitterUtils, DateTimeUtils } from 'wdKit';
import { Logger, SPHelper, ToastUtils, EmitterEventId, EmitterUtils, DateTimeUtils, CustomToast } from 'wdKit';
import {MineMainSettingFunctionItem} from '../../viewmodel/MineMainSettingFunctionItem';
import MineSettingDatasModel from '../../model/MineSettingDatasModel';
import router from '@ohos.router';
... ... @@ -31,6 +31,17 @@ export struct AccountAndSecurityLayout {
pageShowAccountTime:number = 0;
pageHideAccountTime:number = 0;
@State toastText:string = ""
dialogToast: CustomDialogController = new CustomDialogController({
builder: CustomToast({
msg: this.toastText,
}),
autoCancel: false,
alignment: DialogAlignment.Center,
customStyle: true,
maskColor:"#00000000"
})
//注销账户 浏览埋点
logoutLayoutHide(){
this.logoutLayoutHideTime = DateTimeUtils.getTimeStamp()
... ... @@ -127,9 +138,6 @@ export struct AccountAndSecurityLayout {
// 收到eventId为1的事件后执行该回调
let callback = (eventData: emitter.EventData): void => {
// promptAction.showToast({
// message: JSON.stringify(eventData)
// });
if(eventData&&eventData.data){
this.listData[0].subTitle = eventData.data['content']
}
... ... @@ -477,11 +485,11 @@ export struct AccountAndSecurityLayout {
logout(){
let login = new LoginViewModel;
login.logOut().then(()=>{
promptAction.showToast({ message: '退出登录' })
this.showToastTip('退出登录')
EmitterUtils.sendEvent(EmitterEventId.PEOPLE_SHIP_ATTENTION)
router.back();
}).catch((error:string)=>{
promptAction.showToast({ message: error })
this.showToastTip(error)
});
}
... ... @@ -500,6 +508,11 @@ export struct AccountAndSecurityLayout {
securityNum = phoneNum.replace(needSecurityString,'****')
return securityNum;
}
showToastTip(msg:string){
this.toastText = msg
this.dialogToast.open()
}
}
@Component
... ...
... ... @@ -4,7 +4,7 @@ import MinePageCreatorFunctionsItem from '../viewmodel/MinePageCreatorFunctionsI
import MinePageMoreFunctionModel from '../viewmodel/MinePageMoreFunctionModel';
import { HttpBizUtil, HttpUrlUtils, HttpUtils, ResponseDTO, WDHttp } from 'wdNetwork';
import { MineAppointmentListItem } from '../viewmodel/MineAppointmentListItem';
import { Logger, StringUtils, EmitterUtils, EmitterEventId, SPHelper } from 'wdKit';
import { Logger, StringUtils, EmitterUtils, EmitterEventId, SPHelper, DeviceUtil, DateTimeUtils } from 'wdKit';
import { MineFollowListDetailItem } from '../viewmodel/MineFollowListDetailItem';
import { FollowListDetailRequestItem } from '../viewmodel/FollowListDetailRequestItem';
import { FollowListItem } from '../viewmodel/FollowListItem';
... ... @@ -918,6 +918,37 @@ class MinePageDatasModel{
return rmhInfo
}
/**
* 游客评论列表
* @param pageSize
* @param pageNum
* @returns
*/
fetchVisitorCommentListData(pageNum:string,visitorFirstTime:string) {
let time = encodeURI(DateTimeUtils.getCurDate(DateTimeUtils.PATTERN_DATE_TIME_HYPHEN))
let deviceId = DeviceUtil.clientId()
let url = HttpUrlUtils.getVisitorCommentListDataUrl()+ `?pageSize=${20}&pageNum=${pageNum}&visitorFirstTime=${visitorFirstTime}&time=${time}&deviceId=${deviceId}`
return WDHttp.get<ResponseDTO<MineCommentListDetailItem>>(url)
};
visitorCommentListData(pageNum:string,visitorFirstTime:string): Promise<MineCommentListDetailItem> {
return new Promise<MineCommentListDetailItem>((success, error) => {
Logger.info(TAG, `visitorCommentListData start`);
this.fetchVisitorCommentListData(pageNum,visitorFirstTime).then((navResDTO: ResponseDTO<MineCommentListDetailItem>) => {
if (!navResDTO || navResDTO.code != 0) {
error(null)
return
}
Logger.info(TAG, "visitorCommentListData then,visitorCommentListData.timeStamp:" + navResDTO.timestamp);
let navigationBean = navResDTO.data as MineCommentListDetailItem
success(navigationBean);
}).catch((err: Error) => {
Logger.error(TAG, `visitorCommentListData catch, error.name : ${err.name}, error.message:${err.message}`);
error(null)
})
})
}
}
const minePageDatasModel = MinePageDatasModel.getInstance()
... ...
import { TAG } from '@ohos/hypium/src/main/Constant';
import { ContentDTO } from 'wdBean/Index';
import { SpConstants } from 'wdConstant/Index'
import { DateTimeUtils, LazyDataSource, NetworkUtil, SPHelper, StringUtils} from 'wdKit/Index'
import { ProcessUtils } from 'wdRouter/Index';
import { VisitorCommentComponent } from '../components/mine/home/VisitorCommentComponent';
import { CustomPullToRefresh } from '../components/reusable/CustomPullToRefresh';
import { CustomTitleUI } from '../components/reusable/CustomTitleUI';
import { ListHasNoMoreDataUI } from '../components/reusable/ListHasNoMoreDataUI';
import { EmptyComponent } from '../components/view/EmptyComponent';
import MinePageDatasModel from '../model/MinePageDatasModel';
import { CommentListItem } from '../viewmodel/CommentListItem';
@Entry
@Component
struct VisitorCommentPage {
@State data: LazyDataSource<CommentListItem> = new LazyDataSource();
@State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0
@State count: number = 0;
@State isLoading: boolean = false
@State hasMore: boolean = true
curPageNum: number = 1;
@State isGetRequest: boolean = false
private scroller: Scroller = new Scroller();
@State isConnectNetwork : boolean = NetworkUtil.isNetConnected()
@State commentTime:string = ""
aboutToAppear(): void {
this.commentTime = SPHelper.default.getSync(SpConstants.FIRSTCOMMENTTIME, "") as string
if (StringUtils.isNotEmpty(this.commentTime)) {
this.getNewPageData(this.commentTime)
}else{
this.isGetRequest = true
}
}
build() {
Column() {
//标题栏目
CustomTitleUI({ titleName: "评论列表" })
if (this.count == 0) {
if (this.isGetRequest == true) {
if(this.isConnectNetwork){
EmptyComponent({ emptyType: 10 })
.height('100%')
.width('100%')
}else{
EmptyComponent({ emptyType: 1,emptyHeight:"100%" ,retry: () => {
this.isConnectNetwork = NetworkUtil.isNetConnected()
if(this.isConnectNetwork){
this.curPageNum = 1;
this.hasMore = true
this.isGetRequest = false
this.data.clear()
if (!this.isLoading) {
this.getNewPageData(this.commentTime)
}
}
}})
.layoutWeight(1)
.width('100%')
}
}
} else {
Stack(){
Row()
.width("100%")
.height("100%")
.backgroundColor($r('app.color.white'))
.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.BOTTOM])
CustomPullToRefresh({
alldata:this.data,
scroller:this.scroller,
customList:()=>{
this.ListLayout()
},
onRefresh:(resolve)=>{
this.curPageNum = 1;
this.hasMore = true
this.isGetRequest = false
this.data.clear()
if (!this.isLoading){
this.getNewPageData(this.commentTime)
if(resolve) resolve('刷新成功')
}
},
onLoadMore:(resolve)=> {
if (!this.isLoading) {
this.isLoading = true
this.getNewPageData(this.commentTime)
}
}
})
}
}
}
.backgroundColor($r('app.color.color_transparent'))
.height('100%')
.width('100%')
}
@Builder ListLayout(){
List({ space:6,scroller: this.scroller }) {
LazyForEach(this.data, (item: CommentListItem, index: number) => {
ListItem() {
VisitorCommentComponent({
data: item,
isLastItem: index === this.data.totalCount() - 1
})
}
.onClick(() => {
let content = getParams(item)
ProcessUtils.processPage(content)
})
}, (item: CommentListItem, index: number) => index.toString())
//没有更多数据 显示提示
if (!this.hasMore) {
ListItem() {
ListHasNoMoreDataUI()
}.padding({bottom:px2vp(this.bottomSafeHeight) + 20})
}
}
.cachedCount(4)
.scrollBar(BarState.Off)
.edgeEffect(EdgeEffect.None)
.margin({ top: '23lpx'})
.layoutWeight(1)
}
getNewPageData(commentTime:string) {
this.isLoading = true
if (this.hasMore) {
MinePageDatasModel.visitorCommentListData( `${this.curPageNum}`, encodeURI(commentTime)).then((value) => {
if (!this.data || value.list.length == 0) {
this.hasMore = false
} else {
value.list.forEach((item) => {
let commentContent = item.commentContent
if (item.sensitiveShow === 0 && item.sensitiveExist === 1) {
commentContent = item.commentContentSensitive
}
let parentCommentContent = ""
if (item.parentCommentVo != null) {
parentCommentContent = item.parentCommentVo.commentContent
}
let parentCommentUserName = ""
if (item.parentCommentVo != null) {
parentCommentUserName = item.parentCommentVo.fromUserName
}
let publishTime =
DateTimeUtils.getCommentTime(DateTimeUtils.parseDate(item.createTime, DateTimeUtils.PATTERN_DATE_TIME_HYPHEN))
this.data.push(new CommentListItem(item.fromUserHeader, item.fromUserName, item.targetTitle, publishTime,
commentContent, item.likeNum, 0, item.id, item.targetId, item.targetType, item.targetRelId,
item.targetRelObjectId, item.targetRelType, item.targetStatus, item.checkStatus, parentCommentContent,
parentCommentUserName))
})
this.data.notifyDataReload()
this.count = this.data.totalCount()
if (this.data.totalCount() < value.totalCount) {
this.curPageNum++
} else {
this.hasMore = false
}
}
this.isGetRequest = true
this.isLoading = false
}).catch((err: Error) => {
console.log(TAG, JSON.stringify(err))
this.isGetRequest = true
this.isLoading = false
})
}
}
}
function getParams(item: CommentListItem) : ContentDTO{
let contentDTO = new ContentDTO();
// contentDTO.objectType = item.targetType + ""
// contentDTO.objectId = item.targetId + ""
// contentDTO.newsTitle = item.targetTitle
// contentDTO.channelId =
// contentDTO.rmhPlatform =
contentDTO.objectId = item.targetId;
contentDTO.relType = item.targetRelType + "";
contentDTO.relId = item.targetRelId;
contentDTO.objectType = item.targetType + "";
contentDTO.newsTitle = item.targetTitle
return contentDTO
}
\ No newline at end of file
... ...
... ... @@ -26,6 +26,7 @@
"pages/MineMessagePage",
"components/page/InteractMessagePage",
"pages/ShowHomePageHeaderPage",
"pages/SubscribeMessagePage"
"pages/SubscribeMessagePage",
"pages/VisitorCommentPage"
]
}
\ No newline at end of file
... ...
... ... @@ -183,7 +183,7 @@ struct ModifyPasswordPage {
.alignItems(VerticalAlign.Center)
Column() {
Text("提示:密码长度6~20位,使用大写字母、小写字母、数字、特殊字符中三种或三种以上").fontSize(12).maxLines(3).fontColor(0x999999).padding({top:`${this.calcHeight(10)}lpx`})
Text("提示:密码长度8~20位,使用大写字母、小写字母、数字、特殊字符中三种或三种以上").fontSize(12).maxLines(3).fontColor(0x999999).padding({top:`${this.calcHeight(10)}lpx`})
}
.width('100%')
.height(`${this.calcHeight(85)}lpx`)
... ... @@ -200,6 +200,7 @@ struct ModifyPasswordPage {
.width('100%')
.height(`${this.calcHeight(80)}lpx`)
.backgroundColor(this.btnStatus ? '#ED2800' : '#99ED2800')
.enabled(this.btnStatus ?true:false)
.borderRadius('4vp')
.onClick(() => {
if(this.btnStatus){
... ... @@ -227,7 +228,7 @@ struct ModifyPasswordPage {
}
inputTextChange(){
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)) {
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)) {
this.btnStatus = true;
} else {
this.btnStatus = false;
... ...
... ... @@ -134,7 +134,7 @@ export struct SettingPasswordPage {
this.listData.push(new AccoutPageDataModel(0, '设置密码', '', '', '', '', 0))
this.listData.push(new AccoutPageDataModel(1, '', '', '', '', '请输入密码', 10086))
this.listData.push(new AccoutPageDataModel(1, '', '', '', '', '再次输入密码', 10087))
this.listData.push(new AccoutPageDataModel(3, '', '', '提示:密码长度6~20位,使用大写字母、小写字母、数字、特殊字符中三种或三种以上', '', '', 0))
this.listData.push(new AccoutPageDataModel(3, '', '', '提示:密码长度8~20位,使用大写字母、小写字母、数字、特殊字符中三种或三种以上', '', '', 0))
this.listData.push(new AccoutPageDataModel(4, '', '', '', '确认', '', 0))
break;
case 2:
... ... @@ -294,6 +294,7 @@ export struct SettingPasswordPage {
.width('100%')
.height('80lpx')
.backgroundColor(this.btnStatus ? '#da3e22' : '#e5856d')
.enabled(this.btnStatus ?true:false)
.fontColor('#fff')
.borderRadius('4vp')
.onClick(() => {
... ... @@ -325,7 +326,7 @@ export struct SettingPasswordPage {
TrackingButton.click("setPasswordPageConfirm",TrackConstants.PageName.Setup_Passwd,TrackConstants.PageName.Setup_Passwd)
}
// 需要+手机号校验
if (this.password01.length < 6 || this.password01.length > 20) {
if (this.password01.length < 8 || this.password01.length > 20) {
this.showToastTip('密码不符合密码规范')
return
}
... ... @@ -376,7 +377,7 @@ export struct SettingPasswordPage {
}
if (this.password01) {
if ((this.password01.length >= 6 && this.password01.length <= 20) && (this.password02.length >= 6 && this.password02.length <= 20)) {
if ((this.password01.length >= 8 && this.password01.length <= 20) && (this.password02.length >= 8 && this.password02.length <= 20)) {
this.btnStatus = true;
} else {
this.btnStatus = false;
... ...
... ... @@ -64,5 +64,6 @@ struct MorningEveningPaperPage {
onBackPress() {
Logger.info(TAG, 'onBackPress');
return true
}
}
\ No newline at end of file
... ...
... ... @@ -74,107 +74,86 @@ struct LaunchAdvertisingPage {
bottom: 0
})
if (this.defaultModel.isAd === '1'){
Stack({alignContent:Alignment.TopStart}){
Text('广告')
.fontColor(Color.White)
.textAlign(TextAlign.Center)
.fontSize('24lpx')
.width('72lpx')
.height('36lpx')
.borderRadius(2)
.margin({top:'15lpx',left:'19lpx'})
Stack(){
Column(){
Row(){
if (this.defaultModel.isAd === '1') {
Text('广告')
.fontColor(Color.White)
.textAlign(TextAlign.Center)
.fontSize('24lpx')
.width('72lpx')
.height('36lpx')
.borderRadius(2)
.margin({top:'15lpx',left:'19lpx'})
.backgroundColor('#80000000')
.margin({left:16})
}
Blank()
Button(){
Text(this.time + 's 跳过')
.fontSize('27lpx')
.fontColor(Color.White)
.margin({left:'28lpx',right:'28lpx'})
}
.width('148lpx')
.height('56lpx')
.margin({top:'10lpx',right:'19lpx'})
.backgroundColor('#80000000')
.onClick(() => {
this.enter()
this.trackingLaunchJumpOver()
}).margin({right:16})
}.margin({top:10}).width('100%').height('56lpx')
Blank()
if (this.defaultModel.linkUrl.length > 0 || this.defaultModel.objectId.length > 0){
Button(){
Row(){
Text('点击跳转至详情')
.fontSize('31lpx')
.fontColor(Color.White)
.margin({
left:'55lpx'
})
Image($r('app.media.Slice'))
.width('46lpx')
.height('46lpx')
.margin({right:'55lpx'})
}.alignItems(VerticalAlign.Center)
}
.width('566lpx')
.height('111lpx')
.margin({
bottom: '51lpx'
})
.backgroundColor('#80000000')
.onClick(()=>{
this.action()
})
}
if(this.defaultModel.screenType === '1') {
Image($r('app.media.LaunchPage_logo'))
.width('278lpx')
.height('154lpx')
.margin({top: '28lpx',bottom:'28lpx'})
}
}
.width('100%')
.height('100%')
}
Stack({alignContent:Alignment.TopEnd}){
Button(){
Text(this.time + 's 跳过')
// .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM])
.fontSize('27lpx')
.fontColor(Color.White)
.margin({left:'28lpx',right:'28lpx'})
}
.width('148lpx')
.height('56lpx')
.margin({top:'10lpx',right:'19lpx'})
.backgroundColor('#80000000')
.onClick(() => {
this.enter()
this.trackingLaunchJumpOver()
})
}
.width('100%')
.height('100%')
if(this.defaultModel.screenType != '2'){
//底部logo样式 按钮加载在背景展示图上
Button(){
Row(){
Text('点击跳转至详情')
.fontSize('31lpx')
.fontColor(Color.White)
.margin({
left:'55lpx'
})
Image($r('app.media.Slice'))
.width('46lpx')
.height('46lpx')
.margin({right:'55lpx'})
}.alignItems(VerticalAlign.Center)
}
.width('566lpx')
.height('111lpx')
.margin({
bottom: '51lpx'
})
.backgroundColor('#80000000')
.onClick(()=>{
this.action()
})
}
}
}
.width('100%')
.height('84%')
.height('100%')
.margin({top:'0'})
if(this.defaultModel.screenType === '2'){
//全屏样式,底部无logo 按钮放在原底部logo位置
Button(){
Row(){
Text('点击跳转至详情')
.fontSize('31lpx')
.fontColor(Color.White)
.margin({
left:'55lpx'
})
Image($r('app.media.Slice'))
.width('46lpx')
.height('46lpx')
.margin({right:'55lpx'})
}.alignItems(VerticalAlign.Center)
}
.width('566lpx')
.height('111lpx')
.margin({
top: '28lpx'
})
.backgroundColor('#80000000')
.onClick(()=>{
this.action()
})
}else {
//底部logo样式
Image($r('app.media.LaunchPage_logo'))
.width('278lpx')
.height('154lpx')
.margin({top: '28lpx'})
}
}
.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM])
.width('100%')
... ... @@ -189,6 +168,7 @@ struct LaunchAdvertisingPage {
///埋点
this.trackingLaunchClick()
this.enter()
if(this.defaultModel.linkUrl.length > 0){
if (this.defaultModel.openType == '2') {
... ... @@ -230,7 +210,12 @@ struct LaunchAdvertisingPage {
this.defaultModel.screenName = dataModel.launchAdInfo[0].matInfo.advTitle
this.defaultModel.durations = dataModel.launchAdInfo[0].displayDuration
this.defaultModel.linkUrl = dataModel.launchAdInfo[0].matInfo.linkUrl
this.defaultModel.screenType = dataModel.launchAdInfo[0].matInfo.startStyle
if (dataModel.launchAdInfo[0].matInfo.startStyle === '1') {
this.defaultModel.screenType = '2'
}else {
this.defaultModel.screenType = '1'
}
this.defaultModel.bootScreenUrl = dataModel.launchAdInfo[0].matInfo.matImageUrl[0]
this.defaultModel.bootVideoUrl = dataModel.launchAdInfo[0].matInfo.matVideoUrl
this.defaultModel.showType = dataModel.launchAdInfo[0].matInfo.matType
... ...
... ... @@ -17,11 +17,28 @@ struct DefaultWebPage {
build() {
Column() {
WdWebComponent({
webviewControl: this.webviewControl,
webUrl: this.webUrl,
isPageEnd: $isPageEnd
})
Column() {
WdWebComponent({
webviewControl: this.webviewControl,
webUrl: this.webUrl,
isPageEnd: $isPageEnd
})
}.layoutWeight(1)
.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP])
Row() {
Button({type: ButtonType.Normal}) {
Image($r("app.media.back_icon_black"))
.width(20).height(25)
}.height(44).width(44)
.backgroundColor(Color.White)
.onClick(() => {
router.back()
})
Blank()
}.width("100%").height(44)
.alignItems(VerticalAlign.Center)
.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.BOTTOM])
}
.width(CommonConstants.FULL_WIDTH)
.height(CommonConstants.FULL_HEIGHT)
... ...