liyubing

Merge remote-tracking branch 'origin/main'

... ... @@ -34,11 +34,10 @@ export struct ENewspaperItemComponent {
.visibility(this.isShowSkeleton ? Visibility.Visible : Visibility.None)
Image(this.newspaperListItemBean.pagePic)
.width('100%')
.aspectRatio(378 / 566)
.objectFit(ImageFit.Fill)
.onComplete(() => {
this.isShowSkeleton = false
})
.objectFit(ImageFit.Contain)
.visibility(this.isShowSkeleton ? Visibility.None : Visibility.Visible)
Canvas(this.context)
... ... @@ -49,7 +48,7 @@ export struct ENewspaperItemComponent {
})
}
.padding({ top: 16, right: 16, bottom: 16, left: 16 })
.padding({ top:14, right: 10, bottom: 14, left: 10 })
.margin({ left: 10, right: 10 })
.backgroundColor(Color.White)
.width('100%')
... ...
... ... @@ -28,6 +28,8 @@ export struct ENewspaperPageComponent {
@State swiperIndex: number = 0;
//当前选择的日期标记
@State selectDate: Date = new Date()
@State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0
@State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0
//watch监听报纸页码回调
onCurrentPageNumUpdated(): void {
... ... @@ -102,7 +104,10 @@ export struct ENewspaperPageComponent {
//获取宽高尺寸
this.screenWidth = this.displayTool.width
this.picWidth = this.screenWidth - vp2px(52)
this.picHeight = this.picWidth * 566 / 378
let screenHeight = this.displayTool.height;
// bottomSafeHeight 底导高度 topSafeHeight 顶导高度 44 顶部高度 60 底部高度
let height = screenHeight -this.bottomSafeHeight - this.topSafeHeight - vp2px(44) - vp2px(60)
this.picHeight = height
// 默认日期
const date = new Date()
const month = date.getMonth() + 1
... ... @@ -213,10 +218,11 @@ export struct ENewspaperPageComponent {
}
.index(this.swiperIndex)
.width('100%')
.height(px2vp(this.picHeight) + 32)
// newspaper_shadow 44 高度 e_newspaper_content 35 margin top
.height(px2vp(this.picHeight) - 44 - 35)
.vertical(true)
.autoPlay(false)
.cachedCount(3)
.cachedCount(1)
.indicator(false)
.loop(false)
.displayCount(1)
... ... @@ -234,6 +240,7 @@ export struct ENewspaperPageComponent {
Image($r('app.media.newspaper_shadow'))
.height($r('app.float.vp_12'))
.width('100%')
.margin({ left: 10, right: 10, top: -1 })
.objectFit(ImageFit.Contain)
.alignRules({
... ...
... ... @@ -11,6 +11,7 @@ import { router } from '@kit.ArkUI';
import { CommonConstants } from 'wdConstant/Index';
import { ProcessUtils } from 'wdRouter/Index';
import { TrackConstants, TrackingButton, TrackingPageBrowse } from 'wdTracking/Index';
import inputMethod from '@ohos.inputMethod';
const TAG = 'FeedBackActivity'
... ... @@ -23,14 +24,15 @@ const TAG = 'FeedBackActivity'
export struct FeedBackActivity {
pageShowTime:number = 0;
@State canSubmit: boolean = false;
@State textNumLabel: string = '0/500';
contact: string = "";
@State textNumLabel: number = 0;
email: string = "";
//UI
scroller: Scroller = new Scroller();
@State isNetConnected: boolean = true
@State editValue: FeedbackTypeBean = {classifyName:''} as FeedbackTypeBean
@State feedbackTypeBeans: FeedbackTypeBean[] = [] as FeedbackTypeBean[]
//添加图片
addPic: PhotoListBean = {itemType:1} as PhotoListBean
... ... @@ -107,7 +109,7 @@ export struct FeedBackActivity {
.width(CommonConstants.FULL_WIDTH)
.margin({ left: 24, top: $r('app.float.vp_12') })
Stack({ alignContent: Alignment.BottomEnd }) {
TextArea({ placeholder: $r('app.string.feedback_comments') })
TextArea({ placeholder: $r('app.string.feedback_comments'),text: this.editValue.classifyName})
.width(CommonConstants.FULL_WIDTH)
.height(CommonConstants.FULL_HEIGHT)
.fontColor($r('app.color.color_222222'))
... ... @@ -116,12 +118,20 @@ export struct FeedBackActivity {
.placeholderFont({size:$r('app.float.font_size_13_2')})
.padding({bottom:96})
.backgroundColor($r('app.color.color_F5F5F5'))
.outlineColor($r('app.color.color_F5F5F5'))
.align(Alignment.TopStart)
.maxLength(500)
.onChange((value) => {
// Logger.debug(TAG, "onChange" + value + "/" + this.passwordContent)
this.contact = value
this.textNumLabel = value.length+"/500"
if(value.length> 500){
//隐藏键盘
inputMethod.getController().stopInputSession();
ToastUtils.shortToast($r('app.string.res_feedback_commentsFail'))
// Logger.debug(TAG, "onChange > 500 " + value)
this.editValue = {classifyName:value.substring(0,500)} as FeedbackTypeBean
}else{
this.editValue.classifyName = value
}
// Logger.debug(TAG, "onChange " + value)
this.textNumLabel = value.length
this.canSubmit = this.checkSubmit()
})
GridRow({
... ... @@ -185,9 +195,17 @@ export struct FeedBackActivity {
})
}
.margin({bottom: $r('app.float.vp_12'), right: $r('app.float.vp_12'),left: $r('app.float.vp_12')})
Text(this.textNumLabel)
Text(){
ContainerSpan(){
if(this.textNumLabel<500){
Span(this.textNumLabel+'/500').fontColor($r('app.color.color_999999'))
}else{
Span(this.textNumLabel+'').fontColor($r('app.color.color_ED2800'))
Span('/500').fontColor($r('app.color.color_999999'))
}
}
}
.margin({bottom: $r('app.float.vp_12'), right: $r('app.float.vp_11')})
.fontColor($r('app.color.color_999999'))
.fontSize($r('app.float.font_size_13_5'))
}
.height(200)
... ... @@ -279,7 +297,7 @@ export struct FeedBackActivity {
* */
checkSubmit(): boolean {
if(StringUtils.isEmpty(this.contact) || this.contact.length < 10){
if(StringUtils.isEmpty(this.editValue.classifyName) || this.editValue.classifyName.length < 10){
return false
}
... ... @@ -395,7 +413,7 @@ export struct FeedBackActivity {
return
}
//内容必填
if(StringUtils.isEmpty(this.contact) || this.contact.length < 10 || this.contact.length>500){
if(StringUtils.isEmpty(this.editValue.classifyName) || this.editValue.classifyName.length < 10 || this.editValue.classifyName.length>500){
ToastUtils.shortToast($r('app.string.res_feedback_commentsFail'))
return
}
... ... @@ -403,7 +421,7 @@ export struct FeedBackActivity {
try {
let feedBackParams: FeedBackParams = {
//反馈内容
"content": this.contact,
"content": this.editValue.classifyName,
//投诉类型 id
"classifyFlagIds": selectType,
//设备
... ...
... ... @@ -224,7 +224,7 @@ export struct MorningEveningPaperComponent {
if (imageSource) {
const pixelMap: image.PixelMap = await imageNet2PixelMap(imageSource);
effectKit.createColorPicker(pixelMap, (err, colorPicker) => {
let color = colorPicker.getMainColorSync();
let color = colorPicker.getLargestProportionColor();
Logger.debug(TAG, "compInfoBean compStyle = " + color)
// color = ColorUtils.getMorningEveningPaperRgb({red:color.red,green:color.green,blue:color.blue,alpha:color.alpha})
// 将取色器选取的color示例转换为十六进制颜色代码
... ... @@ -273,6 +273,7 @@ export struct MorningEveningPaperComponent {
}
}
// .height(`calc(100% - ${this.bottomSafeHeight + this.topSafeHeight + 'vp'})`)
.edgeEffect(EdgeEffect.None) // 必须设置列表为滑动到边缘无效果
.scrollBar(BarState.Off)
.onWillScroll(scrollOffset =>{
this.scrollOffset = this.scrollOffset + scrollOffset as number
... ...
... ... @@ -19,31 +19,121 @@ export struct ZhSingleRow02 {
@State pageId: string = '';
@State pageName: string = '';
@State compDTO: CompDTO = {} as CompDTO
@State initMoreWidth: number = 16;
@State moreWidth:number = 16
@State moreTips: string = ''
scroller: Scroller = new Scroller()
resetMoreTips() {
console.log('resetMoreTips', this.moreWidth, this.initMoreWidth)
if (this.moreWidth < this.initMoreWidth * 2) {
this.moreTips = '查看更多';
}
}
edgeAnimation() {
if (this.moreWidth < this.initMoreWidth * 3) {
if (!this.moreTips) {
this.moreTips = '查看更多';
}
this.moreWidth = this.moreWidth + 2
}
if (this.moreWidth > this.initMoreWidth * 2) {
this.moreTips = '松手查看';
} else {
}
}
reverseEdgeAnimation() {
if (this.moreWidth > this.initMoreWidth) {
this.moreWidth = this.moreWidth - 2
}
this.resetMoreTips()
}
resetEdgeAnimation() {
if (this.moreWidth > this.initMoreWidth) {
this.moreWidth = this.moreWidth - 1
this.resetEdgeAnimation();
}
this.resetMoreTips()
}
toMore() {
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)
}
}
}
build() {
Column() {
//顶部
this.CompHeader(this.compDTO)
Row(){
// 列表内容
List() {
ForEach(this.compDTO.operDataList, (item: ContentDTO, index: number) => {
CreatorItem({
item,
index,
compDTO: this.compDTO,
pageId: this.pageId,
pageName: this.pageName
// 列表内容
Scroll(this.scroller) {
Row() {
Row() {
ForEach(this.compDTO.operDataList, (item: ContentDTO, index: number) => {
CreatorItem({
item,
index,
compDTO: this.compDTO,
pageId: this.pageId,
pageName: this.pageName
})
.margin({ right: 8 })
})
.margin({right: index === this.compDTO.operDataList.length - 1 ? $r('app.float.card_comp_pagePadding_lf') : 0})
})
}
if (this.compDTO.operDataList.length > 2) {
Column() {
if (this.moreWidth > this.initMoreWidth + 2) {
Text(this.moreTips)
.fontSize(8)
.fontColor(0x858585)
.width(8)
}
}
.justifyContent(FlexAlign.Center)
.align(Alignment.Center)
.height('100%')
.width(this.moreWidth)
.backgroundColor(0xe9e9e9)
.borderRadius({ topLeft: 5, bottomLeft: 5 })
}
}
.listDirection(Axis.Horizontal)
.scrollBar(BarState.Off)
.edgeEffect(EdgeEffect.None)
}
.width(CommonConstants.FULL_WIDTH)
.height(208)
.align(Alignment.Start)
.scrollable(this.compDTO.operDataList.length > 2 ? ScrollDirection.Horizontal : ScrollDirection.None)
.scrollBar(BarState.Off)
.edgeEffect(EdgeEffect.None)
.onReachEnd(() => {
this.edgeAnimation()
})
.onScrollStop(() => {
// this.resetEdgeAnimation();
})
.onScroll((xOffset: number, yOffset: number) => {
if (xOffset < 0) {
this.reverseEdgeAnimation();
}
})
.onTouch((event?: TouchEvent) => {
if(event) {
if (event.type === TouchType.Up) {
this.toMore();
this.resetEdgeAnimation();
}
}
})
}
.padding({
left: $r('app.float.card_comp_pagePadding_lf'),
... ... @@ -126,6 +216,7 @@ struct CreatorItem {
.width(156)
.height(208)
.backgroundColor(0xf5f5f5)
.borderRadius(5)
Row()
.width(156)
... ... @@ -134,6 +225,7 @@ struct CreatorItem {
direction: GradientDirection.Bottom,
colors: [['rgba(0, 0, 0, 0.0)', 0.0], ['rgba(0, 0, 0, 0.3)', 1.0]]
})
.borderRadius(5)
Text(this.item.newsTitle)
.fontColor(0xffffff)
.fontSize(14)
... ... @@ -145,7 +237,6 @@ struct CreatorItem {
}
.width(156)
.height(208)
.margin({ right: 11 })
.borderColor($r('app.color.color_EDEDED'))
.borderRadius($r('app.float.image_border_radius'))
}
... ...
... ... @@ -29,17 +29,61 @@ export struct ZhSingleRow03 {
@State pageId: string = '';
@State pageName: string = '';
@State compDTO: CompDTO = {} as CompDTO
@State isEndEdge: boolean = false;
// @State reserveStatus: reserveItem[] = []
@State reservedIds: string[] = [];
@State loadImg: boolean = false;
@State initMoreWidth: number = 16;
@State moreWidth:number = 16
@State moreTips: string = ''
scroller: Scroller = new Scroller()
resetMoreTips() {
console.log('resetMoreTips', this.moreWidth, this.initMoreWidth)
if (this.moreWidth < this.initMoreWidth * 2) {
this.moreTips = '查看更多';
}
}
edgeAnimation() {
if (this.moreWidth < this.initMoreWidth * 3) {
if (!this.moreTips) {
this.moreTips = '查看更多';
}
this.moreWidth = this.moreWidth + 2
}
if (this.moreWidth > this.initMoreWidth * 2) {
this.moreTips = '松手查看';
} else {
}
}
reverseEdgeAnimation() {
if (this.moreWidth > this.initMoreWidth) {
this.moreWidth = this.moreWidth - 2
}
this.resetMoreTips()
}
resetEdgeAnimation() {
if (this.moreWidth > this.initMoreWidth) {
this.moreWidth = this.moreWidth - 1
this.resetEdgeAnimation();
}
this.resetMoreTips()
}
toMore() {
if (this.moreWidth > this.initMoreWidth * 2) {
this.jumpToMore()
}
}
async aboutToAppear(): Promise<void> {
this.getReserveState();
this.loadImg = await onlyWifiLoadImg();
}
scroller: Scroller = new Scroller()
// 请求所有预约状态
async getReserveState() {
... ... @@ -106,25 +150,51 @@ export struct ZhSingleRow03 {
Scroll(this.scroller){
Row() {
ForEach(this.compDTO.operDataList, (item: ContentDTO) => {
this.ItemCard(item)
})
Row() {
ForEach(this.compDTO.operDataList, (item: ContentDTO) => {
this.ItemCard(item)
})
}
if (this.compDTO.operDataList.length > 2) {
Column() {
if (this.moreWidth > this.initMoreWidth + 2) {
Text(this.moreTips)
.fontSize(8)
.fontColor(0x858585)
.width(8)
}
}
.justifyContent(FlexAlign.Center)
.align(Alignment.Center)
.width(this.moreWidth)
.backgroundColor(0xf9f9f9)
.borderRadius({ topLeft: 5, bottomLeft: 5 })
.height(116)
}
}
}
.scrollable(ScrollDirection.Horizontal)
.align(Alignment.Start)
.scrollable(this.compDTO.operDataList.length > 2 ? ScrollDirection.Horizontal : ScrollDirection.None)
.scrollBar(BarState.Off)
.onScrollEdge((side: Edge) => {
if (side === Edge.End) {
this.isEndEdge = true;
}
.edgeEffect(EdgeEffect.None)
.onReachEnd(() => {
this.edgeAnimation()
})
.onScrollStop(() => {
if (this.isEndEdge) {
this.jumpToMore();
}
// this.resetEdgeAnimation();
})
.onScroll((xOffset: number, yOffset: number) => {
this.isEndEdge = false;
if (xOffset < 0) {
this.reverseEdgeAnimation();
}
})
.onTouch((event?: TouchEvent) => {
if(event) {
if (event.type === TouchType.Up) {
this.toMore();
this.resetEdgeAnimation();
}
}
})
}
.padding({
... ...
... ... @@ -11,6 +11,14 @@ import { FollowOperationRequestItem } from '../../../viewmodel/FollowOperationRe
export struct FollowChildComponent{
@ObjectLink data: FollowListDetailItem
@State type:number = 0
@State columnHeight:number = 202
aboutToAppear(): void {
if(this.type == 0 && StringUtils.isEmpty(this.data.introduction)){
this.columnHeight = 202 - 31
}
}
build() {
if(this.type == 0 ){
... ... @@ -115,7 +123,7 @@ export struct FollowChildComponent{
.justifyContent(FlexAlign.SpaceBetween)
.alignItems(VerticalAlign.Top)
}.height('202lpx')
}.height(`${this.columnHeight}lpx`)
.justifyContent(FlexAlign.Start)
Divider()
... ...
... ... @@ -144,13 +144,11 @@ export struct FollowListDetailUI {
value.list.forEach((value) => {
let fansNum: number = value.fansNum
let fansNumString = ""
if (fansNum > 10000) {
let temp = (fansNum / 10000) + ""
let index = temp.indexOf('.')
if (index != -1) {
temp = temp.substring(0, index + 2)
} else {
temp = temp
if (fansNum >= 10000) {
let temp = (fansNum / 10000) .toFixed(1)
if (Number(temp.substring(temp.length-1)) == 0) {
temp = temp.substring(0, temp.length-2)
}
fansNumString = temp + "万"
} else {
... ...
... ... @@ -8,6 +8,62 @@ export struct HorizontalStrokeCardThreeTwoRadioForMoreComponent {
@State compDTO: CompDTO = {} as CompDTO
@State pageId: string = '';
@State pageName: string = '';
@State initMoreWidth: number = 16;
@State moreWidth:number = 16
@State moreTips: string = ''
scroller: Scroller = new Scroller()
resetMoreTips() {
console.log('resetMoreTips', this.moreWidth, this.initMoreWidth)
if (this.moreWidth < this.initMoreWidth * 2) {
this.moreTips = '查看更多';
}
}
edgeAnimation() {
if (this.moreWidth < this.initMoreWidth * 3) {
if (!this.moreTips) {
this.moreTips = '查看更多';
}
this.moreWidth = this.moreWidth + 2
}
if (this.moreWidth > this.initMoreWidth * 2) {
this.moreTips = '松手查看';
} else {
}
}
reverseEdgeAnimation() {
if (this.moreWidth > this.initMoreWidth) {
this.moreWidth = this.moreWidth - 2
}
this.resetMoreTips()
}
resetEdgeAnimation() {
if (this.moreWidth > this.initMoreWidth) {
this.moreWidth = this.moreWidth - 1
this.resetEdgeAnimation();
}
this.resetMoreTips()
}
toMore() {
if (this.moreWidth > this.initMoreWidth * 2) {
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()
}
}
}
build() {
Column() {
... ... @@ -53,40 +109,78 @@ export struct HorizontalStrokeCardThreeTwoRadioForMoreComponent {
.width('100%')
// .backgroundColor($r("app.color.white"))
List({ space: 12 }) {
Scroll(this.scroller) {
Row() {
Row() {
ForEach(this.compDTO.operDataList, (item: ContentDTO, index: number) => {
Column() {
Image(item.coverUrl)
.aspectRatio(1.5)
.width(this.compDTO.operDataList.length == 2 ? 210 : 150)
.borderRadius(4)
.objectFit(ImageFit.Cover)
ForEach(this.compDTO.operDataList, (item: ContentDTO, index: number) => {
ListItem() {
Text(item.newsTitle)
.fontSize($r("app.float.font_size_14"))
.fontColor($r("app.color.color_212228"))
.fontWeight(400)
.maxLines(2)
.textOverflow({ overflow: TextOverflow.Ellipsis })// 超出的部分显示省略号。
.textAlign(TextAlign.Start)
.margin({ top: 8 })
.width(150)
.lineHeight(19)
}
.padding({ left: (index == 0) ? 16 : 0, right: 16 })
// .offset({x:16})
.onClick(() => {
InfomationCardClick.track(this.compDTO, item, this.pageId, this.pageName)
ProcessUtils.processPage(item)
})
})
}
if (this.compDTO.operDataList.length > 2) {
Column() {
Image(item.coverUrl)
.aspectRatio(1.5)
.width(this.compDTO.operDataList.length == 2 ? 210 : 150)
.borderRadius(4)
.objectFit(ImageFit.Cover)
Text(item.newsTitle)
.fontSize($r("app.float.font_size_14"))
.fontColor($r("app.color.color_212228"))
.fontWeight(400)
.maxLines(2)
.textOverflow({ overflow: TextOverflow.Ellipsis })// 超出的部分显示省略号。
.textAlign(TextAlign.Start)
.margin({ top: 8 })
.width(150)
.lineHeight(19)
if (this.moreWidth > this.initMoreWidth + 2) {
Text(this.moreTips)
.fontSize(8)
.fontColor(0x858585)
.width(8)
}
}
.justifyContent(FlexAlign.Center)
.align(Alignment.Center)
.width(this.moreWidth)
.backgroundColor(0xf1f3f4)
.borderRadius({ topLeft: 5, bottomLeft: 5 })
.height(this.compDTO.operDataList.length == 2 ? 180 : 146)
}
.padding({ left: (index == 0) ? 16 : 0, right: (index == this.compDTO.operDataList.length - 1) ? 16 : 0 })
// .offset({x:16})
.onClick(() => {
InfomationCardClick.track(this.compDTO, item, this.pageId, this.pageName)
ProcessUtils.processPage(item)
})
})
}.listDirection(Axis.Horizontal)
}
}
.align(Alignment.Start)
.scrollable(this.compDTO.operDataList.length > 2 ? ScrollDirection.Horizontal : ScrollDirection.None)
.scrollBar(BarState.Off)
.width('100%')
.edgeEffect(EdgeEffect.None)
.onReachEnd(() => {
this.edgeAnimation()
})
.onScrollStop(() => {
// this.resetEdgeAnimation();
})
.onScroll((xOffset: number, yOffset: number) => {
if (xOffset < 0) {
this.reverseEdgeAnimation();
}
})
.onTouch((event?: TouchEvent) => {
if(event) {
if (event.type === TouchType.Up) {
this.toMore();
this.resetEdgeAnimation();
}
}
})
// .width('100%')
// .backgroundColor($r("app.color.color_FE4B05"))
// .padding({left:16,right:16})
... ...
... ... @@ -18,6 +18,62 @@ export struct LiveHorizontalCardComponent {
@State pageName: string = '';
@State compDTO: CompDTO = {} as CompDTO
@State loadImg: boolean = false;
@State initMoreWidth: number = 16;
@State moreWidth:number = 16
@State moreTips: string = ''
scroller: Scroller = new Scroller()
resetMoreTips() {
console.log('resetMoreTips', this.moreWidth, this.initMoreWidth)
if (this.moreWidth < this.initMoreWidth * 2) {
this.moreTips = '查看更多';
}
}
edgeAnimation() {
if (this.moreWidth < this.initMoreWidth * 3) {
if (!this.moreTips) {
this.moreTips = '查看更多';
}
this.moreWidth = this.moreWidth + 2
}
if (this.moreWidth > this.initMoreWidth * 2) {
this.moreTips = '松手查看';
} else {
}
}
reverseEdgeAnimation() {
if (this.moreWidth > this.initMoreWidth) {
this.moreWidth = this.moreWidth - 2
}
this.resetMoreTips()
}
resetEdgeAnimation() {
if (this.moreWidth > this.initMoreWidth) {
this.moreWidth = this.moreWidth - 1
this.resetEdgeAnimation();
}
this.resetMoreTips()
}
toMore() {
if (this.moreWidth > this.initMoreWidth * 2) {
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()
}
}
}
async aboutToAppear(): Promise<void> {
this.loadImg = await onlyWifiLoadImg();
... ... @@ -69,46 +125,85 @@ export struct LiveHorizontalCardComponent {
// 多个
if (this.compDTO.operDataList.length >= 2) {
List({ space: 12 }) {
ForEach(this.compDTO.operDataList, (item: ContentDTO, index: number) => {
ListItem() {
Column() {
Stack({ alignContent: Alignment.BottomEnd }) {
Image(this.loadImg ? item.coverUrl : '')
.backgroundColor(0xf5f5f5)
.aspectRatio(16 / 9)
Scroll(this.scroller) {
Row() {
Row() {
ForEach(this.compDTO.operDataList, (item: ContentDTO, index: number) => {
Column() {
Stack({ alignContent: Alignment.BottomEnd }) {
Image(this.loadImg ? item.coverUrl : '')
.backgroundColor(0xf5f5f5)
.aspectRatio(16 / 9)
.width(this.compDTO.operDataList.length == 2 ? 210 : 150)
.borderRadius(4)
.objectFit(ImageFit.Cover)
CardMediaInfo({
livePeopleNum:false,
contentDTO: item
})
}
Text(item.newsTitle)
.fontSize($r("app.float.font_size_14"))
.fontColor($r("app.color.color_212228"))
.fontWeight(400)
.maxLines(2)
.textOverflow({ overflow: TextOverflow.Ellipsis })// 超出的部分显示省略号。
.textAlign(TextAlign.Start)
.margin({ top: 8 })
.width(this.compDTO.operDataList.length == 2 ? 210 : 150)
.borderRadius(4)
.objectFit(ImageFit.Cover)
CardMediaInfo({
livePeopleNum:false,
contentDTO: item
})
}
Text(item.newsTitle)
.fontSize($r("app.float.font_size_14"))
.fontColor($r("app.color.color_212228"))
.fontWeight(400)
.maxLines(2)
.textOverflow({ overflow: TextOverflow.Ellipsis })// 超出的部分显示省略号。
.textAlign(TextAlign.Start)
.margin({ top: 8 })
.width(this.compDTO.operDataList.length == 2 ? 210 : 150)
}
.padding({ left: (index == 0) ? 16 : 0, right: 16 })
.onClick(() => {
InfomationCardClick.track(this.compDTO, item, this.pageId, this.pageName)
if (item.objectType != '0') {
console.log(item.objectId)
this.gotoLive(item)
}
})
})
}
.padding({ left: (index == 0) ? 16 : 0, right: (index == this.compDTO.operDataList.length - 1) ? 16 : 0 })
.onClick(() => {
InfomationCardClick.track(this.compDTO, item, this.pageId, this.pageName)
if (item.objectType != '0') {
console.log(item.objectId)
this.gotoLive(item)
if (this.compDTO.operDataList.length > 2) {
Column() {
if (this.moreWidth > this.initMoreWidth + 2) {
Text(this.moreTips)
.fontSize(8)
.fontColor(0x858585)
.width(8)
}
}
})
})
.justifyContent(FlexAlign.Center)
.align(Alignment.Center)
.width(this.moreWidth)
.backgroundColor(0xf1f3f4)
.borderRadius({ topLeft: 5, bottomLeft: 5 })
.height(this.compDTO.operDataList.length == 2 ? 180 : 146)
}
}
}
.listDirection(Axis.Horizontal)
.align(Alignment.Start)
.scrollable(this.compDTO.operDataList.length > 2 ? ScrollDirection.Horizontal : ScrollDirection.None)
.scrollBar(BarState.Off)
.edgeEffect(EdgeEffect.None)
.onReachEnd(() => {
this.edgeAnimation()
})
.onScrollStop(() => {
// this.resetEdgeAnimation();
})
.onScroll((xOffset: number, yOffset: number) => {
if (xOffset < 0) {
this.reverseEdgeAnimation();
}
})
.onTouch((event?: TouchEvent) => {
if(event) {
if (event.type === TouchType.Up) {
this.toMore();
this.resetEdgeAnimation();
}
}
})
.width(CommonConstants.FULL_WIDTH)
.height(this.compDTO.operDataList.length == 2 ? 180 : 136)
} else if (this.compDTO.operDataList.length) {
... ...
... ... @@ -7,8 +7,8 @@ struct GuidePages {
// guideImage = [$r('app.media.guide_static1'), $r('app.media.guide_static2'), $r('app.media.guide_static3'), $r('app.media.guide_static4'),$r('app.media.guide_static5')]
// guideTitle = [$r('app.media.guide_title1'), $r('app.media.guide_title2'), $r('app.media.guide_title3'), $r('app.media.guide_title4'),$r('app.media.guide_title5')]
// guideIndex = [$r('app.media.guide_index1'), $r('app.media.guide_index2'), $r('app.media.guide_index3'),$r('app.media.guide_index4'), $r('app.media.guide_button')]
guideImage = [$r('app.media.guide_Static')]
guideIndex = [$r('app.media.guide_button')]
guideImage = [$r('app.media.guide_Static'),'']
guideIndex = [$r('app.media.guide_button'),'']
build() {
Column() {
... ... @@ -17,10 +17,16 @@ struct GuidePages {
this.ChildItem(index)
}, (item: number) => JSON.stringify(item))
}.loop(false).disableSwipe(true)
}.loop(false)
.indicator(false)
.width('100%')
.height('100%')
.effectMode(EdgeEffect.None)
.onChange(index => {
if (index == 1) {
WDRouterRule.jumpWithReplacePage(WDRouterPage.launchInterestsPage)
}
})
}.width('100%')
.height('100%')
... ...
... ... @@ -103,8 +103,8 @@ struct LaunchAdvertisingPage {
.fontSize('24lpx')
.width('72lpx')
.height('36lpx')
.borderRadius(5)
.margin({top:'10lpx',left:'19lpx'})
.borderRadius(2)
.margin({top:'15lpx',left:'19lpx'})
.backgroundColor('#80000000')
}
.width('100%')
... ... @@ -191,7 +191,7 @@ struct LaunchAdvertisingPage {
this.trackingLaunchClick()
if(this.defaultModel.linkUrl.length > 0){
if (this.defaultModel.objectType == '2') {
if (this.defaultModel.openType == '2') {
//端外打开
ProcessUtils.jumpExternalWebPage(this.defaultModel.linkUrl)
}else {
... ...
... ... @@ -3,8 +3,9 @@ import { WDRouterRule } from 'wdRouter';
import { WDRouterPage } from 'wdRouter';
import { SPHelper } from 'wdKit/Index';
import { SpConstants } from 'wdConstant/Index';
import { ButtonOptions, promptAction } from '@kit.ArkUI';
import { ButtonOptions, promptAction, window } from '@kit.ArkUI';
import { ParamType, TrackConstants, TrackingContent } from 'wdTracking/Index';
import { ImageKnifeComponent } from '@ohos/imageknife';
@Entry
@Component
... ... @@ -13,7 +14,6 @@ struct LaunchInterestsHobbiesPage {
@State selectCount: number = 0
@State interestsArray: InterestsList[] = []
aboutToAppear(){
//请求接口,获取兴趣偏好数据
this.requestInterestsData()
... ... @@ -21,106 +21,116 @@ struct LaunchInterestsHobbiesPage {
build() {
Column() {
Row(){
Blank()
Text('跳过')
.fontSize('27lpx')
.fontColor('#333333')
.width('54lpx')
.height('35lpx')
.margin({top:'27lpx',right:'46lpx'})
.onClick(()=>{
//直接跳过到首页
//跳转首页
WDRouterRule.jumpWithReplacePage(WDRouterPage.mainPage)
this.trackingLaunchJumpOver(false)
})
}
.width('100%')
.justifyContent(FlexAlign.End)
Text('选择感兴趣的内容')
.fontSize('46lpx')
.fontWeight(FontWeight.Bold)
.textAlign(TextAlign.Center)
.fontColor('#333333')
.width('100%')
.height('61lpx')
.margin({top:'84lpx'})
Text('完善信息,将为您推荐个性化的内容')
.fontSize('27lpx')
.textAlign(TextAlign.Center)
.fontColor('#9E9E9E')
.width('100%')
.height('35lpx')
.margin({top:'12lpx'})
Grid( ){
ForEach(this.interestsArray,(item:InterestsList,index:number)=>{
GridItem(){
Stack({alignContent:Alignment.TopStart}){
Image(item.pic)
.width('100%')
.height('100%')
.backgroundColor(Color.White)
.borderRadius(5)
Stack(){
Image('')
.width('100%')
.height('100%')
.backgroundColor(Color.Black)
.opacity(item.choose?0.5:0)
.borderRadius(5)
}
Stack(){
Column({}){
Text(item.name)
.fontSize(18)
.fontColor('#FFFFFF')
.margin({top:'21lpx',left:'19lpx'})
.width('100%')
.height('46lpx')
.fontWeight(FontWeight.Bold)
Text(item.title)
.fontSize('23lpx')
.fontColor('#FFFFFF')
.margin({top:'2lpx',left:'19lpx'})
Stack(){
Column(){
Row(){
Blank()
Text('跳过')
.fontSize('27lpx')
.fontColor('#333333')
.width('54lpx')
.height('35lpx')
.margin({right:'46lpx'})
.onClick(()=>{
//直接跳过到首页
//跳转首页
WDRouterRule.jumpWithReplacePage(WDRouterPage.mainPage)
this.trackingLaunchJumpOver(false)
})
}
.width('100%')
.justifyContent(FlexAlign.End)
Text('选择感兴趣的内容')
.fontSize('46lpx')
.fontWeight(FontWeight.Bold)
.textAlign(TextAlign.Center)
.fontColor('#333333')
.width('100%')
.height('61lpx')
.margin({top:'84lpx'})
Text('完善信息,将为您推荐个性化的内容')
.fontSize('27lpx')
.textAlign(TextAlign.Center)
.fontColor('#9E9E9E')
.width('100%')
.height('35lpx')
.margin({top:'12lpx'})
Grid( ){
ForEach(this.interestsArray,(item:InterestsList,index:number)=>{
GridItem(){
Stack({alignContent:Alignment.TopStart}){
ImageKnifeComponent({imageKnifeOption:{loadSrc:item.pic}})
.width('100%')
.height('31lpx')
Image(item.choose ? $r('app.media.interestsSelected') : $r('app.media.interestsSelectNot'))
.height('32lpx')
.width('32lpx')
.margin({top:'80lpx',left:'110lpx'})
}.justifyContent(FlexAlign.Start)
.height('100%')
.backgroundColor(Color.White)
.borderRadius(5)
// Image(item.pic)
// .width('100%')
// .height('100%')
// .backgroundColor(Color.White)
// .borderRadius(5)
Stack(){
Image('')
.width('100%')
.height('100%')
.backgroundColor(Color.Black)
.opacity(item.choose?0.5:0)
.borderRadius(5)
}
Stack(){
Column({}){
Text(item.name)
.fontSize(18)
.fontColor('#FFFFFF')
.margin({top:'21lpx',left:'19lpx'})
.width('100%')
.height('46lpx')
.fontWeight(FontWeight.Bold)
Text(item.title)
.fontSize('23lpx')
.fontColor('#FFFFFF')
.margin({top:'2lpx',left:'19lpx'})
.width('100%')
.height('31lpx')
Image(item.choose ? $r('app.media.interestsSelected') : $r('app.media.interestsSelectNot'))
.height('32lpx')
.width('32lpx')
.margin({top:'80lpx',left:'110lpx'})
}.justifyContent(FlexAlign.Start)
}
}
}
.width('192lpx')
.height('230lpx')
.borderRadius('8lpx')
.onClick(()=>{
//选择后改变已选择属性
item.choose = !item.choose
this.interestsArray.splice(index,1,item)
this.selectCount = this.interestsArray.filter(item => item.choose).length
})
}
})
}
.width('192lpx')
.height('230lpx')
.borderRadius('8lpx')
.onClick(()=>{
//选择后改变已选择属性
item.choose = !item.choose
this.interestsArray.splice(index,1,item)
this.selectCount = this.interestsArray.filter(item => item.choose).length
})
})
.width('90%')
// .height('70%')
.margin({top:'61lpx',bottom:'240lpx'})
.columnsTemplate('1fr 1fr 1fr')
.columnsGap('23lpx')
.rowsGap('23lpx')
.scrollBar(BarState.Off)
}
.width('100%')
.height('100%')
}
.width('90%')
.height('70%')
.margin({top:'61lpx'})
.columnsTemplate('1fr 1fr 1fr')
// .rowsTemplate('1fr 1fr 1fr 1fr')
.columnsGap('23lpx')
.rowsGap('23lpx')
.scrollBar(BarState.Off)
.width('100%')
.height(`calc(100% - ${108 + 'lpx'})`)
// .backgroundColor(Color.Red)
Stack({alignContent:Alignment.Center}){
Button(this.selectCount == 0?'选好了':'选好了(' + this.selectCount + ')')
... ... @@ -131,9 +141,11 @@ struct LaunchInterestsHobbiesPage {
.borderRadius('10lpx')
.width('662lpx')
.height('84lpx')
.margin({top:'10lpx'})
Image('')
.width('662lpx')
.height('84lpx')
.margin({top:'10lpx'})
.backgroundColor(Color.White)
.opacity(this.selectCount == 0 ? 0.6 : 0)
.borderRadius('10lpx')
... ... @@ -156,10 +168,8 @@ struct LaunchInterestsHobbiesPage {
}
.width('100%')
.height('108lpx')
// .position({y:})
// .margin({bottom:'1',top:'1'})
.backgroundColor('#FFFFFF')
.margin({top:0})
// .backgroundColor(Color.Orange)
}
.width('100%')
.height('100%')
... ...