陈剑华

Merge remote-tracking branch 'origin/main'

Showing 18 changed files with 173 additions and 64 deletions
... ... @@ -2,4 +2,5 @@ export default class BuildProfile {
static readonly HAR_VERSION = '1.0.0';
static readonly BUILD_MODE_NAME = 'debug';
static readonly DEBUG = true;
static readonly TARGET_NAME = 'default';
}
\ No newline at end of file
... ...
import { ToastUtils } from 'wdKit';
/**
* 卡片 分享、评论、点赞公用组件
*/
@Component
export struct CarderInteraction {
build() {
Row(){
Row(){
Image($r('app.media.CarderInteraction_share'))
.width(18)
.height(18)
Text('分享')
.margin({left:4})
.fontSize(14)
.fontColor('#666666')
}
.justifyContent(FlexAlign.Center)
.onClick(()=>{
ToastUtils.showToast('分享为公共方法,待开发', 1000)
})
Row(){
Image($r('app.media.CarderInteraction_comment'))
.width(18)
.height(18)
Text('评论')
.margin({left:4})
.fontSize(14)
.fontColor('#666666')
}
.justifyContent(FlexAlign.Center)
.onClick(()=>{
ToastUtils.showToast('分享为公共方法,待开发', 1000)
})
Row(){
Image($r('app.media.CarderInteraction_like'))
.width(18)
.height(18)
Text('点赞')
.margin({left:4})
.fontSize(14)
.fontColor('#666666')
}
.justifyContent(FlexAlign.Center)
.onClick(()=>{
ToastUtils.showToast('分享为公共方法,待开发', 1000)
})
}
.width('100%')
.margin({top:11})
.padding({
left:21,
right:21
})
.justifyContent(FlexAlign.SpaceBetween)
.alignItems(VerticalAlign.Center)
}
}
... ...
... ... @@ -3,6 +3,7 @@ import { CommonConstants } from 'wdConstant';
import { ProcessUtils } from 'wdRouter';
import { CardSourceInfo } from '../cardCommon/CardSourceInfo';
import { CardMediaInfo } from '../cardCommon/CardMediaInfo';
import { Notes } from './notes';
/**
* 大专题卡--CompStyle: 10
... ... @@ -40,19 +41,8 @@ export struct Card10Component {
.onClick((event: ClickEvent) => {
ProcessUtils.processPage(this.contentDTO)
})
// Text('专题')
// .fontSize($r('app.float.font_size_12'))
// .padding({ left: 8, right: 8, top: 3, bottom: 3 })
// .backgroundColor(Color.Red)
// .fontColor(Color.White)
// .borderRadius($r('app.float.button_border_radius'))
// .margin({ left: 5, bottom: 5 })
ImageSpan($r('app.media.special'))
.width($r('app.float.font_size_36'))
.objectFit(ImageFit.Fill)
.verticalAlign(ImageSpanAlignment.CENTER)
.margin({ left: 5, bottom: 5 })
Notes({ objectType: 5 }).margin({ left: 5, bottom: 5 })
}.alignContent(Alignment.BottomStart)
// 专题列表--后端返回三个,
... ... @@ -99,31 +89,18 @@ export struct Card10Component {
timelineItem(item: slideShows, index: number) {
Row() {
Column() {
Text(item.newsTitle) {
Stack() {
if (item.objectType == '5') {
// Text('专题')
// .fontSize($r('app.float.font_size_12'))
// .padding({ left: 8, right: 8, top: 3, bottom: 3 })
// .backgroundColor(Color.Red)
// .fontColor(Color.White)
// .borderRadius($r('app.float.button_border_radius'))
// .margin({ right: 5 })
ImageSpan($r('app.media.special'))
.width($r('app.float.font_size_36'))
.objectFit(ImageFit.Fill)
.verticalAlign(ImageSpanAlignment.CENTER)
.margin({ right: 5 })
Notes({ objectType: 5 })
}
Span(item.newsTitle)
}
.fontSize($r('app.float.font_size_17'))
.fontWeight(400)
.fontColor($r('app.color.color_222222'))
.maxLines(2)
.textOverflow({ overflow: TextOverflow.Ellipsis })
Text(item.newsTitle)
.fontSize($r('app.float.font_size_17'))
.fontWeight(400)
.fontColor($r('app.color.color_222222'))
.maxLines(2)
.textOverflow({ overflow: TextOverflow.Ellipsis })
.textIndent(item.objectType == '5' ? 40 : 0)
}.alignContent(Alignment.TopStart)
CardSourceInfo(
{
... ...
... ... @@ -3,6 +3,7 @@ import { RmhTitle } from '../cardCommon/RmhTitle'
import { CardMediaInfo } from '../cardCommon/CardMediaInfo'
import { CommonConstants } from 'wdConstant/Index';
import { ProcessUtils } from 'wdRouter';
import {CarderInteraction} from '../CarderInteraction'
const TAG = 'Card12Component';
... ... @@ -34,7 +35,7 @@ export struct Card12Component {
.lineHeight(25)
.fontFamily('PingFang SC-Regular')
}
CarderInteraction()
//TODO 底部的:分享、评论、点赞 功能;需要引用一个公共组件
}
.padding({
... ...
... ... @@ -3,6 +3,7 @@ import { RmhTitle } from '../cardCommon/RmhTitle'
import { CardMediaInfo } from '../cardCommon/CardMediaInfo'
import { CommonConstants } from 'wdConstant/Index';
import { ProcessUtils } from 'wdRouter';
import {CarderInteraction} from '../CarderInteraction'
const TAG = 'Card14Component';
... ... @@ -79,7 +80,7 @@ export struct Card14Component {
.width(CommonConstants.FULL_WIDTH)
.margin({ bottom: 8 })
.height(75)
CarderInteraction()
//TODO 底部的:分享、评论、点赞 功能;需要引用一个公共组件
}
... ...
... ... @@ -3,6 +3,7 @@ import { ProcessUtils } from 'wdRouter';
import { RmhTitle } from '../cardCommon/RmhTitle'
import { CardMediaInfo } from '../cardCommon/CardMediaInfo'
import { CommonConstants } from 'wdConstant/Index';
import {CarderInteraction} from '../CarderInteraction'
const TAG: string = 'Card15Component';
... ... @@ -80,7 +81,7 @@ export struct Card15Component {
.width(CommonConstants.FULL_WIDTH)
.aspectRatio(16 / 9)
.alignContent(Alignment.BottomEnd)
CarderInteraction()
//TODO 底部的:分享、评论、点赞 功能;需要引用一个公共组件
}
.padding({
... ...
... ... @@ -3,6 +3,7 @@ import { RmhTitle } from '../cardCommon/RmhTitle'
import { CardMediaInfo } from '../cardCommon/CardMediaInfo'
import { CommonConstants } from 'wdConstant/Index';
import { ProcessUtils } from 'wdRouter';
import {CarderInteraction} from '../CarderInteraction'
const TAG = 'Card16Component';
... ... @@ -44,6 +45,7 @@ export struct Card16Component {
})
}
}
CarderInteraction()
//TODO 底部的:分享、评论、点赞 功能;需要引用一个公共组件
}
.padding({
... ...
... ... @@ -2,6 +2,7 @@ import { ContentDTO, FullColumnImgUrlDTO, PhotoListBean } from 'wdBean';
import { RmhTitle } from '../cardCommon/RmhTitle'
import { ProcessUtils } from 'wdRouter';
import { CommonConstants } from 'wdConstant/Index';
import {CarderInteraction} from '../CarderInteraction'
const TAG = 'Card19Component';
... ... @@ -104,6 +105,7 @@ export struct Card19Component {
})
ProcessUtils.gotoMultiPictureListPage(photoList,0)
})
CarderInteraction()
//TODO 底部的:分享、评论、点赞 功能;需要引用一个公共组件
}
.padding({
... ...
... ... @@ -3,6 +3,7 @@ import { RmhTitle } from '../cardCommon/RmhTitle'
import { CardMediaInfo } from '../cardCommon/CardMediaInfo'
import { CommonConstants } from 'wdConstant/Index';
import { ProcessUtils } from 'wdRouter';
import {CarderInteraction} from '../CarderInteraction'
const TAG = 'Card20Component';
/**
... ... @@ -64,6 +65,7 @@ export struct Card20Component {
if (this.contentDTO.fullColumnImgUrls[0]) {
createImg({ contentDTO: this.contentDTO })
}
CarderInteraction()
//TODO 底部的:分享、评论、点赞 功能;需要引用一个公共组件
}
.padding({
... ...
... ... @@ -3,7 +3,7 @@ import { CommonConstants, CompStyle } from 'wdConstant';
import { ProcessUtils } from 'wdRouter';
import { RmhTitle } from '../cardCommon/RmhTitle'
import { CardMediaInfo } from '../cardCommon/CardMediaInfo'
import {CarderInteraction} from '../CarderInteraction'
const TAG: string = 'Card6Component-Card13Component';
/**
... ... @@ -42,7 +42,7 @@ export struct Card21Component {
}
.columnsTemplate('2fr 1fr')
.maxCount(1)
CarderInteraction()
//TODO 底部的:分享、评论、点赞 功能;需要引用一个公共组件
}
.onClick((event: ClickEvent) => {
... ...
... ... @@ -2,8 +2,10 @@
import { ContentDTO } from 'wdBean';
import { CommonConstants } from 'wdConstant/Index';
import { ProcessUtils } from 'wdRouter';
import { CardMediaInfo } from '../cardCommon/CardMediaInfo'
import { CardSourceInfo } from '../cardCommon/CardSourceInfo'
import { CardMediaInfo } from '../cardCommon/CardMediaInfo';
import { CardSourceInfo } from '../cardCommon/CardSourceInfo';
import { Notes } from './notes';
const TAG: string = 'Card2Component';
/**
... ... @@ -34,13 +36,21 @@ export struct Card2Component {
build() {
Column() {
Column() {
//新闻标题
Text(this.contentDTO.newsTitle)
.fontSize($r('app.float.font_size_17'))
.fontColor($r('app.color.color_222222'))
.maxLines(2)
.textOverflow({ overflow: TextOverflow.Ellipsis })// 超出的部分显示省略号。
.align(Alignment.Start)
Stack() {
//新闻标题
if (this.contentDTO.objectType == '5') {
Notes({ objectType: this.contentDTO.objectType })
}
Text(this.contentDTO.newsTitle)
.fontSize($r('app.float.font_size_17'))
.fontColor($r('app.color.color_222222'))
.maxLines(2)
.textOverflow({ overflow: TextOverflow.Ellipsis })// 超出的部分显示省略号。
.align(Alignment.Start)
.textIndent(this.contentDTO.objectType == '5' ? 40 : 0)
}
.alignContent(Alignment.TopStart)
//大图
Stack() {
Image(this.contentDTO.coverUrl)
... ...
import { ContentDTO } from 'wdBean';
import { CommonConstants, CompStyle } from 'wdConstant';
import { ProcessUtils } from 'wdRouter';
import { CardSourceInfo } from '../cardCommon/CardSourceInfo'
import { CardMediaInfo } from '../cardCommon/CardMediaInfo'
import { CardSourceInfo } from '../cardCommon/CardSourceInfo';
import { CardMediaInfo } from '../cardCommon/CardMediaInfo';
import { Notes } from './notes';
const TAG: string = 'Card6Component-Card13Component';
/**
... ... @@ -26,12 +28,21 @@ export struct Card6Component {
// .padding(2)
// .margin({ right: 2 })
// }
Text(`${this.contentDTO.newsTitle}`)
.fontSize(16)
.fontWeight(FontWeight.Normal)
.maxLines(3)//
.alignSelf(ItemAlign.Start)
.textOverflow({ overflow: TextOverflow.Ellipsis }) // 超出的部分显示省略号。
Stack() {
if (this.contentDTO.newTags) {
Notes({ newTags: this.contentDTO.newTags })
}
Text(`${this.contentDTO.newsTitle}`)
.fontSize(16)
.fontWeight(FontWeight.Normal)
.maxLines(3)
.alignSelf(ItemAlign.Start)
.textOverflow({ overflow: TextOverflow.Ellipsis })// 超出的部分显示省略号。
.textIndent(this.contentDTO.newTags.length < 5 && this.contentDTO.newTags.length > 2 ? 60 :
this.contentDTO.newTags.length != 0 && this.contentDTO.newTags.length < 3 ? 30 : 0)
}.alignContent(Alignment.TopStart)
}.height("80%")
.justifyContent(FlexAlign.Start)
... ... @@ -42,6 +53,7 @@ export struct Card6Component {
.alignItems(HorizontalAlign.Start)
.justifyContent(FlexAlign.Start)
.width('58%')
Stack() {
Image(this.contentDTO.coverUrl)
.backgroundColor($r('app.color.color_B0B0B0'))
... ...
... ... @@ -2,6 +2,7 @@ import { ContentDTO, slideShows } from 'wdBean';
import { CommonConstants } from 'wdConstant';
import { DateTimeUtils } from 'wdKit';
import { ProcessUtils } from 'wdRouter';
import { Notes } from './notes';
/**
* 时间链卡--CompStyle: 09
... ... @@ -32,12 +33,8 @@ export struct Card9Component {
topLeft: $r('app.float.image_border_radius'),
topRight: $r('app.float.image_border_radius')
})
Text('专题')
.fontSize($r('app.float.font_size_12'))
.padding({ left: 8, right: 8, top: 3, bottom: 3 })
.backgroundColor(Color.Red)
.fontColor(Color.White)
.borderRadius($r('app.float.button_border_radius'))
Notes({ objectType: 5 })
.margin({ left: 5, bottom: 5 })
}.alignContent(Alignment.BottomStart)
... ...
/**
* 表示
* objectType 0:不跳转 1:点播,2:直播,3:活动,4:广告,5:专题,6:链接,7:榜单,8:图文,9:组图,10:H5新闻,11:频道,12:组件,13:音频,
14动态图文,15动态视频16问政;100人民号,101标签
*/
@Preview
@Component
export struct Notes {
@State objectType: number | string = 5
@State newTags: string = ''
build() {
if (this.returnTypeTitleFn()) {
Text(this.returnTypeTitleFn())
.fontSize($r('app.float.font_size_12'))
.padding({
left: 5,
right: 5,
top: 3,
bottom: 3
})
.linearGradient({ angle: 90, colors: [['#FFFF2B00', 0.0], ['#FFFE6A00', 1.0]] })
.fontColor(Color.White)
.borderRadius($r('app.float.button_border_radius'))
}
}
returnTypeTitleFn(): string {
if (this.newTags) {
return this.newTags
} else {
if (this.objectType == 5) {
return '专题'
} else if (this.objectType == 10) {
return 'H5'
} else if (this.objectType == 8) {
return '文章'
}
}
return ''
}
}
\ No newline at end of file
... ...
... ... @@ -99,7 +99,7 @@ struct ModifyPasswordPage {
Row() {
Row() {
TextInput({ placeholder: "请再请输入原密码" })
TextInput({ placeholder: "再次输入新密码" })
.placeholderColor("#CCCCCC")
.type(InputType.Password)
.showPasswordIcon(true)
... ...