张善主

Merge remote-tracking branch 'origin/main'

Showing 23 changed files with 282 additions and 96 deletions
... ... @@ -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})
... ...
import { commentItemModel } from './CommentModel'
/**
* 发布评论
*/
@Observed
export class publishCommentModel {
... ...
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)
... ...
... ... @@ -61,10 +61,14 @@ export struct ZhSingleRow02 {
if (this.moreWidth > this.initMoreWidth * 2) {
if (this.compDTO?.objectType === '11') {
ProcessUtils.jumpChannelTab(this.compDTO.objectId, this.compDTO.pageId as string, this.compDTO.objectTitle)
} else if (this.compDTO?.objectType === '5') {
ProcessUtils._gotoSpecialTopic(this.compDTO.linkUrl)
} else if (this.compDTO?.objectType === '6') {
ProcessUtils._gotoDefaultWeb(this.compDTO.linkUrl)
} else {
const contentDTO: ContentDTO = {
objectId: this.compDTO.objectId,
objectType: this.compDTO.objectType,
linkUrl: this.compDTO.linkUrl,
pageId: this.compDTO.pageId
} as ContentDTO
ProcessUtils.processPage(contentDTO)
}
}
}
... ... @@ -181,10 +185,14 @@ export struct ZhSingleRow02 {
.onClick(() => {
if (this.compDTO?.objectType === '11') {
ProcessUtils.jumpChannelTab(this.compDTO.objectId, this.compDTO.pageId as string, this.compDTO.objectTitle)
} else if (this.compDTO?.objectType === '5') {
ProcessUtils._gotoSpecialTopic(this.compDTO.linkUrl)
} else if (this.compDTO?.objectType === '6') {
ProcessUtils._gotoDefaultWeb(this.compDTO.linkUrl)
} else {
const contentDTO: ContentDTO = {
objectId: this.compDTO.objectId,
objectType: this.compDTO.objectType,
linkUrl: this.compDTO.linkUrl,
pageId: this.compDTO.pageId
} as ContentDTO
ProcessUtils.processPage(contentDTO)
}
})
}
... ...
... ... @@ -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
}
... ...
... ... @@ -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({
... ...
... ... @@ -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)
... ...
... ... @@ -261,6 +261,7 @@ 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;
}
... ...
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
... ...
... ... @@ -53,14 +53,23 @@ export struct LiveHorizontalCardComponent {
resetEdgeAnimation() {
if (this.moreWidth > this.initMoreWidth) {
this.moreWidth = this.moreWidth - 1
this.resetEdgeAnimation();
this.moreWidth = 16
}
this.resetMoreTips()
}
toMore() {
if (this.moreWidth > this.initMoreWidth * 2) {
this.liveToMore();
}
}
liveToMore() {
if (!!this.compDTO.dataSourceType) {
if (this.compDTO.dataSourceType === 'OBJECT_POS') {
ProcessUtils.jumpChannelTab(this.compDTO.objectId, this.compDTO.pageId as string, this.compDTO.objectTitle)
return;
}
if (this.compDTO.linkUrl) {
let taskAction: Action = {
type: 'JUMP_H5_BY_WEB_VIEW',
... ... @@ -72,8 +81,19 @@ export struct LiveHorizontalCardComponent {
} else {
this.jumpToLiveMorePage()
}
} else {
if (this.compDTO?.objectType === '11') {
} else {
const contentDTO: ContentDTO = {
objectId: this.compDTO.objectId,
objectType: this.compDTO.objectType,
linkUrl: this.compDTO.linkUrl,
pageId: this.compDTO.pageId
} as ContentDTO
ProcessUtils.processPage(contentDTO)
}
}
}
async aboutToAppear(): Promise<void> {
this.loadImg = await onlyWifiLoadImg();
... ... @@ -105,17 +125,7 @@ export struct LiveHorizontalCardComponent {
.height(14)
}
.onClick(() => {
if (this.compDTO.linkUrl) {
let taskAction: Action = {
type: 'JUMP_H5_BY_WEB_VIEW',
params: {
url: this.compDTO.linkUrl
} as Params,
};
WDRouterRule.jumpWithAction(taskAction)
} else {
this.jumpToLiveMorePage()
}
this.liveToMore();
})
}
}.justifyContent(FlexAlign.SpaceBetween)
... ... @@ -201,7 +211,6 @@ export struct LiveHorizontalCardComponent {
.onTouch((event?: TouchEvent) => {
if(event) {
if (event.type === TouchType.Up) {
this.toMore();
this.resetEdgeAnimation();
}
}
... ...
... ... @@ -8,6 +8,7 @@ import { DateTimeUtils, Logger, ToastUtils } from 'wdKit/Index';
import { publishCommentModel } from 'wdComponent/src/main/ets/components/comment/model/PublishCommentModel';
import { PictureLoading } from '../widgets/vertical/PictureLoading';
import { TrackConstants, TrackingButton, TrackingPageBrowse } from 'wdTracking/Index';
import { LiveDetailPageLogic } from '../viewModel/LiveDetailPageLogic';
const TAG = 'DetailPlayLiveCommon'
... ... @@ -24,23 +25,39 @@ const TAG = 'DetailPlayLiveCommon'
export struct DetailPlayLiveCommon {
private liveViewModel: LiveViewModel = new LiveViewModel()
pageShowTime: number = 0;
@Provide relId: string = ''
@Provide contentId: string = ''
@Provide relType: string = ''
// 直播状态
@Provide liveState: string = ''
// 直播样式 0-正常模式,1-隐藏直播 2-隐藏大家聊
@Provide liveStyle: number = -1
// 直播地址
@Provide playUrl: string = ''
@Provide imgUrl: string = ''
// // 直播间背景图
// @Provide imgUrl: string = ''
// 全屏展示
@Provide pageShow: number = -1
// 关闭全屏
@Provide pageHide: number = -1
// 返回功能
@Provide pageBackPress: number = -1
@Provide liveDetailPageLogic :LiveDetailPageLogic = new LiveDetailPageLogic
// 直播详情内容
@Provide contentDetailData: ContentDetailDTO = {} as ContentDetailDTO
//发布评论 Model
@Provide publishCommentModel: publishCommentModel = new publishCommentModel()
// 埋点
@Provide pageId: string = TrackConstants.PageName.Live_Detail
@Provide pageName: string = TrackConstants.PageName.Live_Detail
// 横屏或竖屏 general-竖屏,news-横屏
@State liveLandscape: string = ''
@State isLoading: boolean = false
// 是否隐藏Loading view
@State isHideLoading: boolean = false
async aboutToAppear(): Promise<void> {
const par: Action = router.getParams() as Action;
... ... @@ -55,14 +72,14 @@ export struct DetailPlayLiveCommon {
build() {
Column() {
// 直播预约或横屏直播统一进横屏直播
if (this.liveState === 'wait' || this.liveLandscape === 'news') {
if (this.liveDetailPageLogic.isLangScapeScreenVideo()) {
// 非沉浸式直播
DetailPlayLivePage({ contentId: this.contentId, relId: this.relId, relType: this.relType })
} else if (this.liveLandscape === 'general') {
} else if (this.liveDetailPageLogic.isVerticalScreenVideo()) {
// 沉浸式直播
DetailPlayVLivePage()
} else {
PictureLoading().visibility(this.isLoading ? Visibility.None : Visibility.Visible)
PictureLoading().visibility(this.isHideLoading ? Visibility.None : Visibility.Visible)
}
}
.height('100%')
... ... @@ -93,13 +110,17 @@ export struct DetailPlayLiveCommon {
}
}
this.liveLandscape =
detailData?.liveInfo?.liveLandScape
this.liveState = detailData.liveInfo?.liveState
this.contentDetailData = data[0]
this.liveDetailPageLogic.contentDetailData = this.contentDetailData
this.liveDetailPageLogic.liveLandscape = detailData?.liveInfo?.liveLandScape
this.liveDetailPageLogic.liveState = detailData.liveInfo?.liveState
this.liveDetailPageLogic.resolvingRoomBackgroundImgUrl()
this.publishCommentModel.targetId = String(detailData?.newsId || '')
this.publishCommentModel.targetRelId = String(detailData?.reLInfo?.relId || '')
this.publishCommentModel.targetTitle = detailData?.newsTitle
... ... @@ -110,22 +131,25 @@ export struct DetailPlayLiveCommon {
this.publishCommentModel.visitorComment = String(detailData?.visitorComment || '')
this.publishCommentModel.commentContent = ''
this.liveStyle = detailData.liveInfo?.liveStyle
if (detailData.fullColumnImgUrls && detailData.fullColumnImgUrls.length > 0) {
this.imgUrl = detailData.fullColumnImgUrls[0].url
}
//
// if (this.contentDetailData.liveInfo && this.contentDetailData.liveInfo.previewUrl &&
// this.contentDetailData.liveInfo.previewUrl.length > 0) {
// this.imgUrl = this.contentDetailData.liveInfo.previewUrl
// } else if (detailData.fullColumnImgUrls && detailData.fullColumnImgUrls.length > 0) {
// this.imgUrl = detailData.fullColumnImgUrls[0].url
// }
if (detailData.liveInfo.liveState == 'end') {
this.playUrl = detailData.liveInfo.vlive[0].replayUri
}
} else {
this.isLoading
this.isHideLoading = true
ToastUtils.shortToast('内容不存在')
router.back()
}
}, () => {
this.isLoading
this.isHideLoading = true
ToastUtils.shortToast('内容不存在')
router.back()
... ...
... ... @@ -8,6 +8,7 @@ import { DisplayDirection } from 'wdConstant/Index';
import { LiveEmptyComponent, WDLiveViewDefaultType } from 'wdComponent/Index';
import { PlayerEndView } from '../widgets/vertical/PlayerEndView';
import { TrackConstants, TrackingButton } from 'wdTracking/Index';
import { LiveDetailPageLogic } from '../viewModel/LiveDetailPageLogic';
const storage = LocalStorage.getShared();
const TAG = 'DetailPlayVLivePage'
... ... @@ -29,12 +30,14 @@ export struct DetailPlayVLivePage {
@Consume liveState: string
@Consume liveStyle: number
@Consume playUrl: string
@Consume imgUrl: string
// @Consume imgUrl: string
@Consume @Watch('openFullScreen') pageShow: number
@Consume @Watch('closeFullScreen') pageHide: number
@Consume contentId: string
@State swiperIndex: number = 1
@Consume liveDetailPageLogic :LiveDetailPageLogic
aboutToAppear(): void {
this.openFullScreen()
this.getLiveRoomData()
... ... @@ -61,7 +64,7 @@ export struct DetailPlayVLivePage {
Stack() {
// 直播背景图,模糊处理
Image(this.imgUrl)
Image(this.liveDetailPageLogic.imgUrl)
.height('100%')
.width('100%')
.blur(100)
... ...
import { ContentDetailDTO } from 'wdBean/Index'
/**
* 直播信息对象逻辑加工处理的工具类
*/
export class LiveDetailPageLogic {
// 直播状态
liveState: string = ''
// 横屏或竖屏 general-竖屏,news-横屏
liveLandscape: string = ''
// 直播样式 0-正常模式,1-隐藏直播 2-隐藏大家聊
liveStyle: number = -1
// 预告片图片/视频url
imgUrl: string = ''
/**
* 直播详情页面,展示的直播信息对象
*/
contentDetailData: ContentDetailDTO = new ContentDetailDTO
/**
* 横屏直播
* @returns true:横屏直播;false:竖屏直播
*/
isLangScapeScreenVideo(): boolean {
return this.liveState === 'wait' || this.liveLandscape === 'news'
}
/**
* 竖屏直播
* @returns
*/
isVerticalScreenVideo(): boolean {
return this.liveLandscape === 'general'
}
/**
* 解析背景图片资源
*/
resolvingRoomBackgroundImgUrl() {
if (this.contentDetailData.liveInfo && this.contentDetailData.liveInfo.previewUrl &&
this.contentDetailData.liveInfo.previewUrl.length > 0) {
this.imgUrl = this.contentDetailData.liveInfo.previewUrl
} else if (this.contentDetailData.fullColumnImgUrls && this.contentDetailData.fullColumnImgUrls.length > 0) {
this.imgUrl = this.contentDetailData.fullColumnImgUrls[0].url
}
}
}
\ No newline at end of file
... ...
import { ContentDetailDTO, LiveDetailsBean, LiveRoomItemBean } from 'wdBean/Index'
import { ContentDetailDTO, LiveRoomItemBean } from 'wdBean/Index'
import { CustomPullToRefresh, EmptyComponent, ErrorComponent, WDViewDefaultType } from 'wdComponent/Index'
import CustomRefreshLoadLayout from 'wdComponent/src/main/ets/components/page/CustomRefreshLoadLayout'
import RefreshLayout from 'wdComponent/src/main/ets/components/page/RefreshLayout'
import { RefreshLayoutBean } from 'wdComponent/src/main/ets/components/page/RefreshLayoutBean'
import PageModel from 'wdComponent/src/main/ets/viewmodel/PageModel'
import { ViewType } from 'wdConstant/Index'
import { LiveViewModel } from '../../viewModel/LiveViewModel'
import { TabChatItemComponent } from './TabChatItemComponent'
import { EmitterEventId, EmitterUtils, LazyDataSource, Logger } from 'wdKit';
import { EmitterEventId, EmitterUtils, LazyDataSource, Logger } from 'wdKit'
import { publishCommentModel } from 'wdComponent/src/main/ets/components/comment/model/PublishCommentModel'
import { PeopleShipNoMoreData } from 'wdComponent/src/main/ets/components/reusable/PeopleShipNoMoreData'
import LoadMoreLayout from 'wdComponent/src/main/ets/components/page/LoadMoreLayout'
const TAG: string = 'TabChatComponent';
... ... @@ -23,14 +20,26 @@ export struct TabChatComponent {
@State private pageModel: PageModel = new PageModel()
liveViewModel: LiveViewModel = new LiveViewModel()
@State liveChatList: LazyDataSource<LiveRoomItemBean> = new LazyDataSource();
// @State liveList: LazyDataSource<LiveRoomItemBean> = new LazyDataSource();
@Consume contentDetailData: ContentDetailDTO
@Consume publishCommentModel: publishCommentModel
@Prop @Watch("lastInputedCommentChanged") lastInputedComment: LiveRoomItemBean
private scroller: Scroller = new Scroller()
aboutToAppear(): void {
index: number = 0
@Prop @Watch('updateData') parentComponentIndex: number
private initUI: boolean = true
/**
*
*/
updateData() {
if (this.index === this.parentComponentIndex && this.initUI) {
this.getLiveList()
}
}
aboutToAppear(): void {
//注册通知
EmitterUtils.receiveEvent(EmitterEventId.COMMENT_PUBLISH, async (targetId?: string) => {
... ... @@ -66,7 +75,6 @@ export struct TabChatComponent {
} else if (this.pageModel.viewType == ViewType.EMPTY) {
EmptyComponent({ emptyType: WDViewDefaultType.WDViewDefaultType_NoComment1 })
} else {
// this.ListLayout()
CustomPullToRefresh({
alldata: this.liveChatList,
... ... @@ -79,6 +87,7 @@ export struct TabChatComponent {
this.pageModel.currentPage = 1
this.getLiveList(resolve)
},
})
}
}
... ... @@ -99,24 +108,11 @@ export struct TabChatComponent {
},
(item: LiveRoomItemBean, contentIndex: number) => JSON.stringify(item)
)
// 加载更多
ListItem() {
if (this.pageModel.hasMore && this.liveChatList && this.liveChatList.totalCount() > 0) {
LoadMoreLayout({ isVisible: this.pageModel.hasMore })
} else if (!this.pageModel.hasMore && !this.pageModel.isLoading) {
PeopleShipNoMoreData()
}
}
} .edgeEffect(EdgeEffect.None)
}.edgeEffect(EdgeEffect.None)
.scrollBar(BarState.Off)
.onReachEnd(() => {
Logger.debug(TAG, "触底了");
if (!this.pageModel.isLoading && this.pageModel.hasMore) {
//加载分页数据
//this.currentPage++;
this.getLiveList()
}
})
}
@Builder
... ... @@ -141,7 +137,7 @@ export struct TabChatComponent {
this.liveViewModel.getLiveChatList(
this.pageModel.currentPage,
this.contentDetailData?.liveInfo?.mlive?.mliveId,
String( this.contentDetailData.newsId),
String(this.contentDetailData.newsId),
20,)
.then(
(data) => {
... ... @@ -153,13 +149,21 @@ export struct TabChatComponent {
resolve('')
}
}
if(this.pageModel.currentPage ===1){
if (this.pageModel.currentPage === 1) {
this.liveChatList.clear()
}
Logger.debug(TAG, `${JSON.stringify(data)}`)
if (data.barrageResponses && data.barrageResponses.length > 0) {
this.pageModel.viewType = ViewType.LOADED;
this.liveChatList.push(...data.barrageResponses)
if (this.initUI) {
this.initUI = false
setTimeout(() => {
this.scroller.scrollToIndex(this.liveChatList.totalCount() - 1)
}, 300)
}
if (data.barrageResponses.length === this.pageModel.pageSize) {
this.pageModel.currentPage++;
this.pageModel.hasMore = true;
... ...
... ... @@ -16,11 +16,39 @@ export struct TabChatItemComponent {
build() {
Row() {
Image(StringUtils.isEmpty(this.item.senderUserAvatarUrl) ? $r('app.media.default_head') : this.item.senderUserAvatarUrl)
Image(StringUtils.isEmpty(this.item.senderUserAvatarUrl) ? $r('app.media.default_head') :
this.item.senderUserAvatarUrl)
.borderRadius(90)
.width(24)
.height(24)
Column() {
if (this.item.dataType == 'ZH_IMAGE_MSG') {
Row() {
Text() {
Span(this.item.senderUserName + ': ')
.fontColor('#666666')
}
.margin({ left: 8 })
.lineHeight(20)
.layoutWeight(1)
.fontSize('14fp')
.fontWeight(400)
}
.alignItems(VerticalAlign.Top)
if (this.item.pictureUrls && this.item.pictureUrls.length > 0) {
Image(this.item.pictureUrls[0])
.width(`100%`)
.objectFit(ImageFit.Contain)
.borderRadius(4)
.margin({
top: 10
})
.onClick(() => {
this.gotoMultipleListImagePage(this.item.pictureUrls[0])
})
}
} else {
Row() {
Text() {
Span(this.item.senderUserName + ': ')
... ... @@ -35,7 +63,9 @@ export struct TabChatItemComponent {
.fontWeight(400)
}
.alignItems(VerticalAlign.Top)
if (this.item.dataType == 'ZH_TEXT_AND_IMAGE_MSG' && this.item.pictureUrls && this.item.pictureUrls.length > 0) {
if (this.item.dataType == 'ZH_TEXT_AND_IMAGE_MSG' && this.item.pictureUrls &&
this.item.pictureUrls.length > 0) {
Image(this.item.pictureUrls[0])
.width(`100%`)
.objectFit(ImageFit.Contain)
... ... @@ -48,6 +78,8 @@ export struct TabChatItemComponent {
})
}
}
}
.margin({
left: 8,
right: 8
... ... @@ -75,8 +107,8 @@ export struct TabChatItemComponent {
height: 0,
picPath: imgUrl,
picDesc: '',
itemType:2,
id:0
itemType: 2,
id: 0
})
let taskAction: Action = {
type: 'JUMP_DETAIL_PAGE',
... ...
... ... @@ -11,7 +11,7 @@ export struct TabComponent {
@Prop @Watch('changeToChart') changeToTab: number
@State fontColor: string = '#999999'
@State selectedFontColor: string = '#222222'
@State currentIndex: number = 0
@Prop currentIndex: number = 0
// private controller: TabsController = new TabsController()
private swiperController: SwiperController = new SwiperController()
@Prop tabs: string[] = []
... ... @@ -63,7 +63,11 @@ export struct TabComponent {
} else if ('直播间' === item) {
TabLiveComponent({ lastInputedComment: this.lastInputedLiveComment }).backgroundColor('#F5F5F5')
} else if ('大家聊' === item) {
TabChatComponent({ lastInputedComment: this.lastInputedChatComment }).backgroundColor('#F5F5F5')
TabChatComponent({
lastInputedComment: this.lastInputedChatComment,
index: index,
parentComponentIndex: this.currentIndex
}).backgroundColor('#F5F5F5')
}
}, (item: string, index: number) => {
... ... @@ -74,6 +78,7 @@ export struct TabComponent {
.vertical(false)
.indicator(false)
.loop(false)
.cachedCount(-1)
.alignSelf(ItemAlign.Start)
.effectMode(EdgeEffect.None)
.onChange((index: number) => {
... ...
... ... @@ -25,7 +25,10 @@ export struct TabLiveComponent {
private scroller: Scroller = new Scroller()
@Prop @Watch("lastInputedCommentChanged") lastInputedComment: LiveRoomItemBean
aboutToAppear(): void {
this.getLiveList()
}
... ... @@ -92,7 +95,6 @@ export struct TabLiveComponent {
Logger.debug(TAG, "触底了");
if (!this.pageModel.isLoading && this.pageModel.hasMore) {
//加载分页数据
//this.currentPage++;
this.getLiveList()
}
})
... ...
... ... @@ -39,6 +39,10 @@
{
"name": "location_reason",
"value": " "
},
{
"name": "anchor_leaving",
"value": "主播暂时离开,马上回来"
}
]
}
\ No newline at end of file
... ...
... ... @@ -168,6 +168,7 @@ struct LaunchAdvertisingPage {
///埋点
this.trackingLaunchClick()
this.enter()
if(this.defaultModel.linkUrl.length > 0){
if (this.defaultModel.openType == '2') {
... ...