wangliang_wd

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

* 'main' of http://192.168.1.42/developOne/harmonyPool:
  fix: 19927 3:2横划卡-后台配置1个运营位,跳转设置--不跳转,鸿蒙端不应展示更多按钮
  fix: 19926 3:2横划卡-后台配置1个运营位,鸿蒙端封面图不正确,见对比截图
  fix: 地方精选卡修改边距
  换一换如果全部遍历过了则按钮置灰不让点击
  fix: 兴趣卡ui优化
  fix: 热点频道,横划卡只配1个运营位,折叠屏右侧展示缺少圆角
  fix |> 游客模式进入文章详情页显示关注按钮
  fix |> 修复竖屏直播横屏流,全屏后,直播标题与屏幕边缘间距不正确问题
  fix: 修复沉浸式播放,不断上滑切换视频,网络出小差弹出频繁
  fix: 标签问题优化,图集详情ui优化
  安卓时间对齐
  fix: 地方精选卡阴影shadow redius单位为px,用vp2px转换
  fix: 标签问题优化
  fix |> 修复进入文章详情页时关注按钮从已关注变成关注
Showing 22 changed files with 98 additions and 75 deletions
import { StringUtils } from './StringUtils';
import getLunar from './GetLunar';
import { systemDateTime } from '@kit.BasicServicesKit';
/**
* 日期/时间工具
... ... @@ -436,7 +437,8 @@ export class DateTimeUtils {
* 获取文章发布时间
* */
public static getCommentTime(publishTime: number): string {
let currentTime: number = new Date().getTime();
// let currentTime: number = new Date().getTime();
let currentTime: number = systemDateTime.getTime(false);
let timeGap = currentTime - publishTime;
let timeStr = ""
if (timeGap >= 60 * 60 * 1000 * 48) {
... ...
... ... @@ -222,13 +222,7 @@ export struct Card10ComponentTimelineItem {
.fontColor(this.isRead ? 0x848484 : '#222222')
.maxLines(2)
.textOverflow({ overflow: TextOverflow.Ellipsis })
.textIndent(
getNotesContentWidth(
this.contentDTO.seoTags || this.contentDTO.newTags,
this.contentDTO.objectType,
this.contentDTO.objectLevel
)
)
.textIndent(this.slideItem.objectType == '5' ? 38 : 0)
}.alignContent(Alignment.TopStart)
Blank()
... ... @@ -271,13 +265,7 @@ export struct Card10ComponentTimelineItem {
.fontColor($r('app.color.color_222222'))
.maxLines(2)
.textOverflow({ overflow: TextOverflow.Ellipsis })
.textIndent(
getNotesContentWidth(
this.contentDTO.seoTags || this.contentDTO.newTags,
this.contentDTO.objectType,
this.contentDTO.objectLevel
)
)
.textIndent(this.slideItem.objectType == '5' ? 38 : 0)
}.alignContent(Alignment.TopStart)
//bottom 评论等信息
... ...
... ... @@ -78,7 +78,8 @@ export struct Card11Component {
getNotesContentWidth(
this.contentDTO.seoTags || this.contentDTO.newTags,
this.contentDTO.objectType,
this.contentDTO.objectLevel
this.contentDTO.objectLevel,
this.contentDTO.top
)
)
}.alignContent(Alignment.TopStart)
... ...
... ... @@ -95,7 +95,8 @@ export struct Card20Component {
getNotesContentWidth(
this.contentDTO.seoTags || this.contentDTO.newTags,
this.contentDTO.objectType,
this.contentDTO.objectLevel
this.contentDTO.objectLevel,
this.contentDTO.top
)
)
.width('100%')
... ...
... ... @@ -87,7 +87,8 @@ export struct Card2Component {
getNotesContentWidth(
this.contentDTO.seoTags || this.contentDTO.newTags,
this.contentDTO.objectType,
this.contentDTO.objectLevel
this.contentDTO.objectLevel,
this.contentDTO.top
)
)
.width('100%')
... ...
... ... @@ -74,7 +74,8 @@ export struct Card3Component {
getNotesContentWidth(
this.contentDTO.seoTags || this.contentDTO.newTags,
this.contentDTO.objectType,
this.contentDTO.objectLevel
this.contentDTO.objectLevel,
this.contentDTO.top
)
)
}.alignContent(Alignment.TopStart)
... ...
... ... @@ -85,7 +85,8 @@ export struct Card4Component {
getNotesContentWidth(
this.contentDTO.seoTags || this.contentDTO.newTags,
this.contentDTO.objectType,
this.contentDTO.objectLevel
this.contentDTO.objectLevel,
this.contentDTO.top
)
)
.width('100%')
... ...
... ... @@ -115,7 +115,8 @@ export struct Card5Component {
getNotesContentWidth(
this.contentDTO.seoTags || this.contentDTO.newTags,
this.contentDTO.objectType,
this.contentDTO.objectLevel
this.contentDTO.objectLevel,
this.contentDTO.top
)
)
}.alignContent(Alignment.TopStart)
... ...
... ... @@ -86,7 +86,8 @@ export struct Card6Component {
getNotesContentWidth(
this.contentDTO.seoTags || this.contentDTO.newTags,
this.contentDTO.objectType,
this.contentDTO.objectLevel
this.contentDTO.objectLevel,
this.contentDTO.top
)
)
.width('100%')
... ...
... ... @@ -13,10 +13,10 @@ export struct Notes {
@State objectLevel: number | string = -1
@State newTags: string = ''
@State seoTags: string = ''
@State marginTop: number = 0;
@State marginTop: number = -1;
build() {
if (this.returnTypeTitleFn()) {
if (returnTypeTitleFn(this.newTags, this.objectType, this.objectLevel)) {
Text(returnTypeTitleFn(this.newTags, this.objectType, this.objectLevel))
.fontSize($r('app.float.font_size_11'))
.padding({
... ... @@ -31,23 +31,4 @@ export struct Notes {
.margin({ top: this.marginTop})
}
}
returnTypeTitleFn(): string {
if (this.newTags) {
return this.newTags
}
if (this.objectType == 5) {
if (this.objectLevel == 24) {
return '调查'
}
return '专题'
}
if (this.objectType == 10) {
return 'H5'
}
if (this.objectType == 8) {
return '文章'
}
return ''
}
}
\ No newline at end of file
... ...
... ... @@ -205,6 +205,7 @@ struct CarouselLayout01CardView {
.backgroundColor(0xf5f5f5)
.borderRadius(this.showPicBorderRadius ? $r('app.float.image_border_radius') : 0)
Stack() {
Row()
.width(CommonConstants.FULL_PARENT)
.height(60)
... ... @@ -212,6 +213,14 @@ struct CarouselLayout01CardView {
direction: GradientDirection.Top, // 渐变方向:to Top/从下往上
colors: [[0x7508111A, 0.0], [0x7508111A, 0.3], [Color.Transparent, 1.0]]
})
.position({
bottom: 10
})
}
.width(CommonConstants.FULL_PARENT)
.height(CommonConstants.FULL_PARENT)
.alignContent(Alignment.Bottom)
Column() {
// 这里用于展示轮播图右上角信息,这里只对直播类型的展示
if (this.item.objectType === '2' || this.item.objectType === '4') {
... ... @@ -223,13 +232,13 @@ struct CarouselLayout01CardView {
// 文本信息
Stack() {
if(this.item.objectType == '5'){
Notes({ objectType: this.item.objectType,objectLevel:this.item.objectLevel })
Notes({ objectType: this.item.objectType,objectLevel:this.item.objectLevel, marginTop: 4 })
} else {
if (this.item.seoTags) {
Notes({ newTags: this.item.seoTags })
Notes({ newTags: this.item.seoTags, marginTop: 4 })
}
if (this.item.newTags) {
Notes({ newTags: this.item.newTags })
Notes({ newTags: this.item.newTags, marginTop: 4 })
}
}
Text(`${this.item.newsTitle}`)
... ... @@ -246,7 +255,8 @@ struct CarouselLayout01CardView {
getNotesContentWidth(
this.item.seoTags || this.item.newTags,
this.item.objectType,
this.item.objectLevel
this.item.objectLevel,
this.item.top
)
)
}
... ...
... ... @@ -14,6 +14,7 @@ const TAG = 'Zh_Single_Column-09'
@Entry
@Component
export struct ZhSingleColumn09 {
@State fullyTraversed: boolean = false;
@State private pageModel: PageModel = new PageModel();
@State pageId: string = '';
@State pageName: string = '';
... ... @@ -24,6 +25,7 @@ export struct ZhSingleColumn09 {
@State loadImg: boolean = false;
@State compIndex: number = 0;
@State currentOperDataListIndex: number = 0; //记录换一换点击次数
@State visitedIndices: Set<number> = new Set<number>();
async aboutToAppear(): Promise<void> {
this.loadImg = await onlyWifiLoadImg();
... ... @@ -77,12 +79,21 @@ export struct ZhSingleColumn09 {
}
shuffleArray(array: ContentDTO[]) {
for (let i = array.length - 1; i > 0; i--) {
for (let i = array.length - 1; i >= 0; i--) {
const j = Math.floor(Math.random() * (i + 1));
console.info(`cj2024 shuffleArray i = ${i} array.length = ${array.length}`)
// 记录被选中的索引 j
this.visitedIndices.add(j);
console.info(`cj2024 shuffleArray j = ${j} visitedIndices = ${this.visitedIndices.size}`)
const tempArray = array[i];
array[i] = array[j];
array[j] = tempArray
}
// 检查是否所有元素都被遍历过
this.fullyTraversed = this.visitedIndices.size === array.length;
return array
}
... ... @@ -131,9 +142,9 @@ export struct ZhSingleColumn09 {
.justifyContent(FlexAlign.SpaceBetween)
.width('100%')
Grid() {
Flex({wrap: FlexWrap.Wrap}) {
ForEach(this.operDataList.slice(0, 8), (item: ContentDTO, index: number) => {
GridItem() {
Row() {
Stack({ alignContent: Alignment.TopEnd }) {
Image(this.loadImg ? item.coverUrl : '')
.backgroundColor(0xf5f5f5)
... ... @@ -163,6 +174,7 @@ export struct ZhSingleColumn09 {
.width('100%')
.aspectRatio(2 / 1)
}
.width('calc((100% - 6vp * 3) / 4)')
.margin({ right: index % 4 === 3 ? 0 : 6, bottom: 6 })
.onClick(() => {
if (this.activeIndexs.includes(index)) {
... ... @@ -174,23 +186,21 @@ export struct ZhSingleColumn09 {
})
})
}
.columnsTemplate('1fr 1fr 1fr 1fr')
// .columnsTemplate('1fr 1fr 1fr 1fr')
.margin({ bottom: 5 })
Row() {
Row() {
Text('换一换')
.fontSize(14)
.fontColor(this.compDTO?.operDataList.length > 8 && this.currentOperDataListIndex > 0 ? 0xed2800 : 0xB0B0B0)
.fontColor(this.compDTO?.operDataList.length > 8 && !this.fullyTraversed ? 0xed2800 : 0xB0B0B0)
.margin({ right: 4 })
Image(this.compDTO?.operDataList.length > 8 ? $r('app.media.icon_refresh') : $r('app.media.ic_refresh'))
.width(14)
.height(14)
}
.onClick(() => {
if (this.currentOperDataListIndex > 0) {
this.currentOperDataListIndex--
} else {
if (this.fullyTraversed) {
return
}
if (this.compDTO?.operDataList.length > 8) {
... ...
... ... @@ -60,8 +60,7 @@ export struct ZhSingleRow04 {
.margin({ bottom: 8 })
.width('100%')
.padding({
left: $r('app.float.card_comp_pagePadding_lf'),
right: $r('app.float.card_comp_pagePadding_lf')
right: 10
})
// 列表内容
... ... @@ -74,8 +73,8 @@ export struct ZhSingleRow04 {
}
)
.margin({
right: index === this.compDTO.operDataList.length - 1 ? 26 : 0, left:
index === 0 ? $r('app.float.card_comp_pagePadding_lf') : 0,
right: index === this.compDTO.operDataList.length - 1 ? 26 : 0,
left: index === 0 ? 2 : 0,
top: 6
})
.onClick(() => {
... ... @@ -167,7 +166,7 @@ struct localCard {
radius: 2,
})
.shadow({
radius: 5,
radius: vp2px(5),
color: 'rgba(0, 0, 0, 0.10)',
offsetX: 0,
offsetY: 1
... ...
... ... @@ -35,12 +35,17 @@ export struct HorizontalStrokeCardThreeTwoRadioForOneComponent {
.width(14)
.height(14)
}
}.justifyContent(FlexAlign.SpaceBetween)
.visibility(this.showMore() ? Visibility.Visible : Visibility.None)
.onClick(() => {
ProcessUtils.compJumpPage(this.compDTO)
})
}
.justifyContent(FlexAlign.SpaceBetween)
.margin({ top: 8, bottom: 8 })
.width('100%')
Image($r("app.media.setting"))
Image(this.compDTO.operDataList[0].coverUrl)
.aspectRatio(1.5)
.width('100%')
.borderRadius(4)
... ... @@ -73,5 +78,8 @@ export struct HorizontalStrokeCardThreeTwoRadioForOneComponent {
})
}
showMore() {
return (!!this.compDTO.dataSourceType && this.compDTO.dataSourceType !== 'OBJECT_POS') || !(this.compDTO?.objectType === '0' || this.compDTO?.objectType === '')
}
}
\ No newline at end of file
... ...
... ... @@ -17,12 +17,13 @@ export function runWithAnimation(
}
export function getNotesContentWidth(
newTags: string,
objectType: number | string,
objectLevel: number | string,
newTags?: string,
objectType?: number | string,
objectLevel?: number | string,
top?: number,
fontSize?: string | number | Resource
) {
let textContent: string = returnTypeTitleFn(newTags, objectType, objectLevel)
let textContent: string = ''
let px = 0
const paddingRightAndLeft = vp2px(8)
const marginRight = vp2px(6);
... ... @@ -30,7 +31,7 @@ export function getNotesContentWidth(
if(objectType == '5'){
textContent = returnTypeTitleFn('', objectType, objectLevel)
} else {
textContent = returnTypeTitleFn(newTags)
textContent = returnTypeTitleFn(newTags, undefined, undefined, top)
}
if (textContent) {
... ... @@ -57,7 +58,8 @@ export function getNotesContentWidth(
export function returnTypeTitleFn(
newTags?: string,
objectType?: number | string,
objectLevel?: number | string
objectLevel?: number | string,
top?: number
): string {
if (newTags) {
return newTags
... ... @@ -74,5 +76,8 @@ export function returnTypeTitleFn(
if (objectType == 8) {
return '文章'
}
if (top === 1) {
return '置顶'
}
return ''
}
\ No newline at end of file
... ...
... ... @@ -219,7 +219,7 @@
<div class="cdescrip_text" v-if="details.rmhDesc" @click="skipCustomerNumberPage">{{details.rmhDesc}}</div>
</div>
<!-- @click.stop阻止事件冒泡 -->
<template v-if="!isOwer">
<template v-if="!isOwer && showButton">
<div class="clook-btn clook" @click.stop="clookBtn" v-if="clookStatusSee || showClook">
<template v-if="clookBtnActive">
<img class="clook-loading anticon-spin" src="./image/loading_clock.svg" alt="">
... ...
... ... @@ -50,6 +50,7 @@ const app = Vue.createApp({
const isRmh = ref(null)
const isNewspaper = ref(null)
const browseStr = ref('')
const showButton = ref(false)
const state = reactive({
clientHeight: 0,
... ... @@ -644,11 +645,13 @@ const app = Vue.createApp({
if (state.isLogined == 1) {
// 已登录
if (window.config.VUE_BASE_NODE === 'dev') {
showButton.value = true
showClook.value = true
} else {
clookStatus(true) // 查"关注"状态 , 更新按钮上的文字
}
} else {
showButton.value = true
showClook.value = true
}
}
... ... @@ -1051,11 +1054,13 @@ const app = Vue.createApp({
headers: state.appHeader,
showError: false
})
showButton.value = true
if (response.success) {
clookStatusSee.value = response.data[0].status == '1' ? false : true // '1' 是已关注 '0'是未关注
}
} else {
if (state.creatorID == state.details.rmhId) {
showButton.value = true
isOwer.value = true
clookStatusSee.value = false
nextTick(() => {
... ... @@ -1090,6 +1095,7 @@ const app = Vue.createApp({
const code = statusResponseMap.code
const data = statusResponseMap.data
if ([ 200, '0' ].includes(code)) {
showButton.value = true
if (data) {
if (data[0].status == '1') {
state.initClockStatus = !initStatus
... ... @@ -1949,6 +1955,7 @@ const app = Vue.createApp({
isNewspaper.value = false
voteInit.value = false
showClook.value = false
showButton.value = false
optionList.value = []
subjectList.value = []
channelList.value = []
... ... @@ -2074,6 +2081,7 @@ const app = Vue.createApp({
optionList,
showClook,
clookStatusSee,
showButton,
timeLine,
shareOpen,
hasReadCount,
... ...
... ... @@ -20,7 +20,7 @@ export struct PlayerInfoComponent {
PlayerUIComponent({ playerController: this.playerController })
.margin({
// bottom: this.bottomSafeHeight + 'px',
top: this.topSafeHeight + 'px'
top:this.isFullScreen ? 0 : this.topSafeHeight + 'px'
})
}
.cachedCount(2)
... ...
... ... @@ -59,7 +59,7 @@ export struct PlayerUIComponent {
}
this.isFullScreen = true
})
.visibility(this.isSmall ? Visibility.Visible : Visibility.Hidden)
.visibility(!this.isFullScreen ? Visibility.Visible : Visibility.Hidden)
.margin({ top: 301}) // 195 + 211 - 105
.position({ x: '96.8%' })
.markAnchor({ x: '96.8%' })
... ...
... ... @@ -138,5 +138,6 @@ export struct PlayerProgressView {
.visibility(this.isOpenDetail ? Visibility.None : Visibility.Visible)
}
}
.onDisAppear(() => clearTimeout(this.timer))
}
}
\ No newline at end of file
... ...
... ... @@ -254,12 +254,17 @@ export struct MultiPictureDetailPageComponent {
if (this.followStatus == '0') {
Button({ type: ButtonType.Normal, stateEffect: true }) {
Row() {
Text('+关注').fontSize(12).fontColor(0xffffff)
Image($r('app.media.add'))
.width(12)
.height(12)
.margin({right: 3})
Text('关注').fontSize(12).fontColor(0xffffff)
}.alignItems(VerticalAlign.Center)
}
.borderRadius(4)
.backgroundColor('#ED2800')
.width(48)
.width(54)
.height(24)
.onClick(() => {
this.handleAccention()
... ... @@ -398,9 +403,8 @@ export struct MultiPictureDetailPageComponent {
.lineHeight(22)
.textOverflow({ overflow: TextOverflow.Ellipsis })
.margin({
top: 4,
left: 18,
bottom: 4,
bottom: 8,
right: 18
})
.maxLines(32)
... ...