wangyujian_wd

Merge remote-tracking branch 'origin/main'

Showing 38 changed files with 326 additions and 91 deletions
... ... @@ -49,3 +49,5 @@ export { NetworkUtil } from './src/main/ets/utils/NetworkUtil'
export { NetworkManager } from './src/main/ets/network/NetworkManager'
export { NetworkType } from './src/main/ets/network/NetworkType'
export { CustomToast } from './src/main/ets/reusable/CustomToast'
... ...
@CustomDialog
export struct CustomToast {
public static LENGTH_LONG = 5000;
public static LENGTH_SHORT = 3000;
@State msg: string = ""
@State duration: number = CustomToast.LENGTH_SHORT
@State bgBorderRadius: number = 10
controller: CustomDialogController
dismiss: () => void = () => {
}
aboutToAppear(): void {
let intervalID = setInterval(() => {
if (this.controller != undefined) {
this.controller.close()
this.dismiss()
clearInterval(intervalID);
}
}, this.duration);
}
build() {
Row() {
Text(this.msg)
.fontWeight(FontWeight.Regular)
.fontColor($r('app.color.white'))
.fontSize("27lpx")
.lineHeight("38lpx")
}.borderRadius(`${this.bgBorderRadius}lpx`)
.padding({top:"23lpx",bottom:'23lpx',left:"35lpx",right:"35lpx"})
.backgroundColor($r("app.color.black"))
.opacity(0.7)
}
}
... ...
... ... @@ -509,6 +509,26 @@ export class DateTimeUtils {
}
return num;
}
/**
* 去除发布日期前导零
* @param dateTimeString 2024年01月01日 00:00
* @returns 2024年1月1日 00:00
*/
static removeTrailingZeros(dateTimeString: string) {
// 分割日期时间字符串
const [datePart, timePart] = dateTimeString.split(' ');
// 分割日期
const [year, month, day] = datePart.match(/\d+/g);
// 去除年和月后面的零
const trimmedMonth = parseInt(month, 10);
const trimmedDay = parseInt(day, 10);
// 重新组合日期时间字符串
const newDateTimeString = `${year}${trimmedMonth}${trimmedDay} ${timePart}`;
return newDateTimeString;
}
}
// const dateTimeUtils = new DateTimeUtils()
\ No newline at end of file
... ...
... ... @@ -3,6 +3,10 @@
{
"name": "white",
"value": "#FFFFFF"
},
{
"name": "black",
"value": "#000000"
}
]
}
\ No newline at end of file
... ...
... ... @@ -10,6 +10,7 @@ import Url from '@ohos.url'
import { ContentDTO, PhotoListBean } from 'wdBean';
import { handleJsCallAppService } from './JsCallAppService'
import { HttpUtils } from 'wdNetwork/Index';
const TAG = 'JsBridgeBiz'
class AppInfo {
... ... @@ -20,6 +21,7 @@ class AppInfo {
screenTabbarSafeHeight: number = 42 // TODO 这里需要动态获取
imei: string = HttpUtils.getImei()
device_id: string = HttpUtils.getDeviceId()
fontSizes: string = 'small'
// TODO 完善
}
... ...
... ... @@ -142,14 +142,22 @@ export struct DynamicDetailComponent {
.margin({right: $r('app.float.margin_6')})
if(!StringUtils.isEmpty(this.followStatus)){
if (this.followStatus == '0') {
Text('+关注')
.width($r('app.float.margin_54'))
.height($r('app.float.margin_24'))
Row() {
Blank().layoutWeight(1)
Image($r('app.media.icon_add_attention'))
.width($r('app.float.vp_12'))
.height($r('app.float.vp_12'))
.margin({right:2})
Text('关注')
.textAlign(TextAlign.Center)
.fontSize($r('app.float.font_size_12'))
.fontColor($r('app.color.color_fff'))
Blank().layoutWeight(1)
}
.width($r('app.float.margin_54'))
.height($r('app.float.margin_24'))
.borderRadius($r('app.float.vp_3'))
.backgroundColor($r('app.color.color_ED2800'))
.fontColor($r('app.color.color_fff'))
.onClick(() => {
this.handleAccention()
})
... ...
... ... @@ -61,13 +61,12 @@ export struct ImageAndTextPageComponent {
Text(this.publishTime)
.fontColor($r('app.color.color_B0B0B0'))
.fontSize($r('app.float.font_size_13'))
.height('100%')
.align(Alignment.End)
}
.width(CommonConstants.FULL_WIDTH)
.height(32)
.padding({ left: 15, right: 15, })
.justifyContent(FlexAlign.SpaceBetween)
.alignItems(VerticalAlign.Bottom)
.backgroundColor(Color.White)
Row() {
... ... @@ -108,7 +107,7 @@ export struct ImageAndTextPageComponent {
.height(24)
.margin({ right: 5 })
}
if (this.interactData?.likeNum != '0') {
if (this.interactData?.likeNum) {
Text(`${this.interactData?.likeNum}`)
.fontSize(16)
.fontColor(this.newsStatusOfUser?.likeStatus === '1' ? '#ED2800' : '#999999')
... ... @@ -205,7 +204,8 @@ export struct ImageAndTextPageComponent {
this.contentDetailData = detailBeans;
let dateTime =
DateTimeUtils.parseDate(this.contentDetailData[0]?.publishTime, DateTimeUtils.PATTERN_DATE_TIME_HYPHEN);
this.publishTime = DateTimeUtils.formatDate(dateTime, PATTERN_DATE_CN_RN)
let _publishTime = DateTimeUtils.formatDate(dateTime, PATTERN_DATE_CN_RN)
this.publishTime = DateTimeUtils.removeTrailingZeros(_publishTime)
if (this.contentDetailData[0]?.recommendShow === 1) {
this.getRecommend()
}
... ...
... ... @@ -66,7 +66,7 @@ export struct ImageAndTextWebComponent {
loadImageOnlyWifiSwitch: '2',
networkStatus: Number(NetworkUtil.isNetConnected()),
darkMode: 'light',
fontSizes: 'normalsize'
fontSizes: 'small'
} as H5ReceiveDataExtraBean
let h5ReceiveDataJsonBean: H5ReceiveDataJsonBean = {
... ...
... ... @@ -13,6 +13,7 @@ import { image } from '@kit.ImageKit';
import { getPicture, imageNet2PixelMap } from '../../utils/ImageUtils';
import { effectKit } from '@kit.ArkGraphics2D';
import { window } from '@kit.ArkUI';
import DailyPaperTopicModel from '../../model/DailyPaperTopicModel'
const TAG = 'MorningEveningPaperComponent';
... ... @@ -111,12 +112,19 @@ export struct MorningEveningPaperComponent {
Logger.info(TAG, "currentTime = " + currentTime)
Logger.info(TAG, `currentTime = ${currentTime}`)
try {
let dailyPaperTopicBean = await DailyPaperTopicModel.getDailyPaperTopic()
if (dailyPaperTopicBean) {
dailyPaperTopicPageId = '' + dailyPaperTopicBean.id
Logger.info(TAG, "pageID = " + dailyPaperTopicPageId)
}
// let pageInfoBean = await MorningEveningViewModel.getMorningEveningPageInfo("" + this.dailyPaperTopicPageId)
let pageInfoBean = await MorningEveningViewModel.getMorningEveningPageInfo("" + dailyPaperTopicPageId) //"25091"
this.pageInfoBean = pageInfoBean;
this.title = this.pageInfoBean?.topicInfo?.title
let dateTime = DateTimeUtils.parseDate(this.pageInfoBean?.topicInfo?.topicDate ?? '', DateTimeUtils.PATTERN_DATE_HYPHEN);
this.subTitle = DateTimeUtils.formatDate(dateTime, PATTERN_DATE_CN_RN)
let dateTime = DateTimeUtils.parseDate(this.pageInfoBean?.topicInfo?.topicDate ?? '', DateTimeUtils.PATTERN_DATE_HYPHEN)
const dateShow = new Date(dateTime)
this.subTitle = `${dateShow.getFullYear()}年\n${(dateShow.getMonth() + 1)}月${dateShow.getDate()}日`
Logger.info(TAG, "pageInfoBean topicDate = " + this.pageInfoBean?.topicInfo?.topicDate)
Logger.info(TAG, "pageInfoBean title = " + this.pageInfoBean?.topicInfo?.title)
... ... @@ -166,6 +174,7 @@ export struct MorningEveningPaperComponent {
let color = colorPicker.getMainColorSync();
// 将取色器选取的color示例转换为十六进制颜色代码
this.mixedBgColor = "#" + color.alpha.toString(16) + color.red.toString(16) + color.green.toString(16) + color.blue.toString(16);
Logger.debug(TAG, "compInfoBean compStyle = " + this.mixedBgColor)
});
}
... ... @@ -218,7 +227,6 @@ export struct MorningEveningPaperComponent {
.margin({ left: 14, right: 14 })
}
.width('100%')
// .backgroundColor('#000080')
// .backgroundColor(Color.Black)
// .backgroundColor(this.pageInfoBean?.backgroundColor ?? Color.Black)
.backgroundColor(this.mixedBgColor ?? Color.Black)
... ...
import router from '@ohos.router';
import { ToastUtils } from 'wdKit';
/**
* 早晚报页面标题bar
... ... @@ -74,6 +75,9 @@ export struct PaperTitleComponent {
})
.id('img_share')
.margin({ right: 13 })
.onClick(() => {
ToastUtils.showToast('分享为公共方法,待开发', 1000)
})
}
.margin({ left: 14, right: 14 })
.height($r('app.float.top_bar_height'))
... ...
... ... @@ -101,8 +101,8 @@ export struct SingleColumn999Component {
.height(100)
.padding(9)
.fontColor(Color.White)
.fontSize($r('app.float.font_size_16'))
.fontWeight(FontWeight.Medium)
.fontSize($r('app.float.vp_14'))
.fontWeight(400)
.textAlign(TextAlign.Center)
.align(Alignment.Bottom)
.maxLines(1)
... ... @@ -130,8 +130,8 @@ export struct SingleColumn999Component {
.width("100%")// .height(100)
.padding(9)
.fontColor(Color.White)
.fontSize($r('app.float.font_size_16'))
.fontWeight(FontWeight.Medium)
.fontSize($r('app.float.font_size_14'))
.fontWeight(400)
.textAlign(TextAlign.Center)
.align(Alignment.Bottom)
.maxLines(1)
... ...
import { NetworkUtil, Logger, NetworkType, SPHelper, WindowModel} from 'wdKit';
import { NetworkUtil, Logger, NetworkType, SPHelper, WindowModel, StringUtils} from 'wdKit';
import { ResponseDTO } from 'wdNetwork';
import {
ContentDetailDTO,
... ... @@ -102,6 +102,7 @@ export struct MultiPictureDetailPageComponent {
Row({ space: 8 }) {
if (this.getImgUrl()){
Row() {
Stack() {
Image(this.getImgUrl())
.borderRadius(24)
.aspectRatio(1)
... ... @@ -110,6 +111,21 @@ export struct MultiPictureDetailPageComponent {
.height(36)
.objectFit(ImageFit.Fill)
.interpolation(ImageInterpolation.High)
if(!StringUtils.isEmpty(this.contentDetailData.rmhInfo?.authIcon)){
Stack() {
Image(this.contentDetailData.rmhInfo?.authIcon)
.width($r('app.float.vp_13'))
.height($r('app.float.vp_13'))
.objectFit(ImageFit.Cover)
}
.width(36)
.height(36)
.alignContent(Alignment.BottomEnd)
}
}
.width(36)
.height(36)
.alignContent(Alignment.Center)
.onClick(() => {
if (this.contentDetailData.rmhInfo?.cnMainControl === 1) {
// 号主页
... ... @@ -380,11 +396,11 @@ export struct MultiPictureDetailPageComponent {
}
this.netStatus = undefined
this.contentDetailData = resDTO.data?.[0];
if (this.contentDetailData.rmhPlatform == 1) {
WindowModel.shared.setWindowSystemBarProperties({
statusBarContentColor: '#ffffff',
})
}
// if (this.contentDetailData.rmhPlatform == 1) {
// WindowModel.shared.setWindowSystemBarProperties({
// statusBarContentColor: '#ffffff',
// })
// }
if (this.contentDetailData?.openComment) {
this.publishCommentModel.targetId = String(this.contentDetailData?.newsId || '')
this.publishCommentModel.targetRelId = String(this.contentDetailData?.reLInfo?.relId)
... ...
... ... @@ -24,6 +24,9 @@ export struct Card10Component {
.maxLines(2)
.textOverflow({ overflow: TextOverflow.Ellipsis })
.margin({ bottom: 19 })
.onClick((event: ClickEvent) => {
ProcessUtils.processPage(this.contentDTO)
})
}
// 大图
Stack() {
... ...
import MinePageMoreFunctionModel from '../../viewmodel/MinePageMoreFunctionModel'
import { WDRouterRule, WDRouterPage } from 'wdRouter'
import { Params } from 'wdBean';
import { ToastUtils } from 'wdKit/Index';
@Component
export default struct MinePageMoreFunctionUI {
... ... @@ -75,6 +76,8 @@ export default struct MinePageMoreFunctionUI {
WDRouterRule.jumpWithPage(WDRouterPage.settingPage, params)
}else if (item.msg == "关于") { // 关于
WDRouterRule.jumpWithPage(WDRouterPage.aboutPage)
}else if (item.msg == "意见反馈") { // 关于
ToastUtils.shortToast("待开发")
}
})
.height('117lpx')
... ...
import { Action, ContentDTO, Params } from 'wdBean';
import { CommonConstants, ConfigConstants, ScreenType } from 'wdConstant';
import { Logger } from 'wdKit';
import { Logger, ToastUtils } from 'wdKit';
import { CompUtils } from '../../utils/CompUtils';
import { ProcessUtils, WDRouterRule } from 'wdRouter';
... ... @@ -475,7 +475,7 @@ export struct PaperSingleColumn999CardView {
}
.justifyContent(FlexAlign.Start)
Image($r('app.media.icon_forward'))
Image($r('app.media.icon_paper_share'))
.width(16)
.height(16)
.margin({ left: 10, right: 22, top: 10, bottom: 10 })
... ... @@ -483,6 +483,9 @@ export struct PaperSingleColumn999CardView {
center: { anchor: '__container__', align: VerticalAlign.Center },
right: { anchor: '__container__', align: HorizontalAlign.End }
})
.onClick(() => {
ToastUtils.showToast('分享为公共方法,待开发', 1000)
})
}.width(CommonConstants.FULL_PARENT)
.justifyContent(FlexAlign.SpaceBetween)
}
... ...
... ... @@ -214,20 +214,23 @@ struct ChannelDialog {
Flex({ justifyContent: FlexAlign.SpaceBetween }) {
ForEach(this.homeChannelList, (item: TopNavDTO, index: number) => {
Stack() {
Image(item.channelId === this.indexSettingChannelId ? $r('app.media.index_setting_button_active') : $r('app.media.index_setting_button'))
Image(item.channelId === this.indexSettingChannelId ? $r('app.media.index_setting_button_active') :
$r('app.media.index_setting_button'))
.objectFit(ImageFit.Auto)
.rotate({
angle: index === 1 ? 180 : 0
})
Row() {
if (index === 0) {
Image(item.channelId === this.indexSettingChannelId ? $r('app.media.recommend_icon') : $r('app.media.recommend_icon_active'))
Image(item.channelId === this.indexSettingChannelId ? $r('app.media.recommend_icon') :
$r('app.media.recommend_icon_active'))
.width(20)
}
Text(item.name)
.textAlign(TextAlign.Center)
.fontSize(16)
.fontColor(item.channelId === this.indexSettingChannelId ? '#ffffff' : '#ED2800')
}
.width('100%')
.justifyContent(FlexAlign.Center)
... ... @@ -275,8 +278,8 @@ struct ChannelDialog {
GridItem() {
Row() {
Text(item.name)
.fontSize(14)
.fontColor(this.currentTopNavSelectedItem.channelId === item.channelId ? '#ED2800' : (item.headlinesOn === 1 || item.movePermitted === 0 ? '#999999' : '#222222'))
.fontSize(14)// .fontColor(this.currentTopNavSelectedItem.channelId === item.channelId ? '#ED2800' : (item.headlinesOn === 1 || item.movePermitted === 0 ? '#999999' : '#222222'))
.fontColor(item.headlinesOn === 1 || item.movePermitted === 0 ? '#999999' : '#222222')
if (this.isEditIng && item.delPermitted === 1 && item.movePermitted === 1) {
Image($r('app.media.icon_audio_close'))
... ... @@ -319,7 +322,11 @@ struct ChannelDialog {
}
}
}),
PanGesture({ fingers: 1, direction: this.isEditIng ? PanDirection.All:PanDirection.None, distance: 0 })
PanGesture({
fingers: 1,
direction: this.isEditIng ? PanDirection.All : PanDirection.None,
distance: 0
})
.onActionStart((event: GestureEvent) => {
this.dragItem = item.num
this.dragRefOffsetX = 0
... ... @@ -449,7 +456,12 @@ struct ChannelDialog {
}.width('100%').height('100%')
.scrollBar(BarState.Off)
}
.padding({ top: 40, right: 15, bottom: 40, left: 15 })
.padding({
top: 40,
right: 15,
bottom: 40,
left: 15
})
.backgroundColor('#ffffff')
}
}
... ...
... ... @@ -197,7 +197,7 @@ export struct TopNavigationComponent {
.width(18)
.height(18)
Text('早晚报')
.fontColor($r('app.color.color_B0B0B0'))
.fontColor("#666666")
.fontSize($r('app.float.font_size_13'))
}
.alignItems(VerticalAlign.Center)
... ...
... ... @@ -385,11 +385,12 @@ export struct PeopleShipMainComponent {
})
Logger.debug('PeopleShipMainComponent', `一键关注接口参数: ${JSON.stringify(objects)}`);
let batchInfo = await PeopleShipMainViewModel.getAttentionBatchInfo(objects)
this.oneKeyFollow = false
if (batchInfo.code === 0 || batchInfo.code.toString() === "0") {
this.getData()
}
} catch (exception) {
this.oneKeyFollow = false
}
}
... ...
... ... @@ -67,14 +67,15 @@ export struct PeopleShipHomePageNavComponent {
Row(){
Image($r('app.media.people_ship_top_add'))
.objectFit(ImageFit.Auto)
.width('12vp')
.height('12pv')
.width('13vp')
.height('13pv')
.margin({
right: '2vp'
right: '3vp'
})
Text('关注')
.fontSize($r('app.float.vp_12'))
.fontColor(Color.White)
.height('100%')
}
.alignSelf(ItemAlign.Center)
.justifyContent(FlexAlign.Center)
... ...
... ... @@ -54,7 +54,7 @@ export struct FirstTabTopSearchComponent {
ForEach(this.searchTextData, (item: string, index: number) => {
Text(item)
.fontWeight(400)
.fontColor($r('app.color.color_B0B0B0'))
.fontColor("#666666")
.fontSize($r('app.float.font_size_13'))
.textAlign(TextAlign.Start)
.maxLines(1)
... ...
... ... @@ -42,7 +42,7 @@ export struct SearchHistoryComponent{
Row(){
Text("搜索历史")
.textAlign(TextAlign.Center)
.fontWeight('400lpx')
.fontWeight(FontWeight.Regular)
.fontSize('27lpx')
.lineHeight('38lpx')
.fontColor($r('app.color.color_999999'))
... ... @@ -68,7 +68,7 @@ export struct SearchHistoryComponent{
Text(`${item.searchContent}`)
.fontColor($r('app.color.color_222222'))
.fontSize('31lpx')
.fontWeight('400lpx')
.fontWeight(FontWeight.Regular)
.lineHeight('46lpx')
.maxLines(1)
.constraintSize({maxWidth:index%2 === 0?'270lpx':'230lpx'})
... ...
... ... @@ -68,7 +68,7 @@ export struct SearchHotsComponent{
.height('31lpx')
.fontColor($r('app.color.color_666666'))
.fontSize('27lpx')
.fontWeight('400lpx')
.fontWeight(FontWeight.Regular)
.lineHeight('31lpx')
.margin({right:'12lpx'})
}
... ... @@ -77,7 +77,7 @@ export struct SearchHotsComponent{
.fontColor($r('app.color.color_222222'))
.fontSize('31lpx')
.maxLines(1)
.fontWeight('400lpx')
.fontWeight(FontWeight.Regular)
.lineHeight('42lpx')
}.layoutWeight(1)
... ...
import { ToastUtils, Logger, NumberFormatterUtils, SPHelper } from 'wdKit';
import promptAction from '@ohos.promptAction';
import {
InputMethodProperty,
batchLikeAndCollectResult,
... ... @@ -41,7 +42,7 @@ const TAG = 'OperRowListView';
@Preview
@Component
export struct OperRowListView {
@Prop contentDetailData: ContentDetailDTO // 稿件详情
@Prop @Watch('onDetailUpdated') contentDetailData: ContentDetailDTO // 稿件详情
@State operationButtonList: string[] = ['comment', 'collect', 'share'] // 组件展示条件
@ObjectLink publishCommentModel: publishCommentModel
// @State contentDetailData: ContentDetailDTO = {} as ContentDetailDTO
... ... @@ -49,9 +50,12 @@ export struct OperRowListView {
@State newsStatusOfUser: batchLikeAndCollectResult | undefined = undefined // 点赞、收藏状态
@State likeBean: Record<string, string> = {}
@State audioUrl: string= ''
@State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0
needLike: boolean = true
async aboutToAppear() {
// async aboutToAppear() {
async onDetailUpdated() {
if (!this.contentDetailData) return
const user_id = await SPHelper.default.get(SpConstants.USER_ID, '')
if (user_id) {
this.getInteractDataStatus()
... ... @@ -98,6 +102,7 @@ export struct OperRowListView {
})
.width(42)
if (this.contentDetailData) {
ForEach(this.operationButtonList, (item: string, index: number) => {
if (item == 'comment') {
this.builderComment()
... ... @@ -113,6 +118,7 @@ export struct OperRowListView {
}
})
}
}
.width('100%')
.justifyContent(FlexAlign.Start)
}
... ... @@ -120,6 +126,7 @@ export struct OperRowListView {
.backgroundColor(Color.White)
.padding({
top: 10,
// bottom: `${this.bottomSafeHeight}px`
bottom: 50
})
}
... ... @@ -266,6 +273,9 @@ export struct OperRowListView {
PageRepository.postExecuteCollectRecord(params).then(res => {
if (this.newsStatusOfUser) {
this.newsStatusOfUser.collectStatus = this.newsStatusOfUser?.collectStatus === 1 ? 0 : 1
if(this.newsStatusOfUser.collectStatus === 1){
promptAction.showToast({ message: '收藏成功' })
}
this.queryContentInteractCount()
}
})
... ...
... ... @@ -95,7 +95,7 @@ class MinePageDatasModel{
}
// this.moreData.push(new MinePageMoreFunctionModel("扫一扫",$r('app.media.mine_scan')))
// this.moreData.push(new MinePageMoreFunctionModel("我的奖品",$r('app.media.mine_mygift')))
// this.moreData.push(new MinePageMoreFunctionModel("意见反馈",$r('app.media.mine_suggest')))
this.moreData.push(new MinePageMoreFunctionModel("意见反馈",$r('app.media.mine_suggest')))
this.moreData.push(new MinePageMoreFunctionModel("设置",$r('app.media.mine_setting')))
this.moreData.push(new MinePageMoreFunctionModel("关于",$r('app.media.mine_about')))
return this.moreData
... ...
... ... @@ -429,7 +429,7 @@
</div>
<!-- 分享 -->
<div class="share" v-if="shareOpen">
<div class="share" v-if="false">
<div
v-if="details.shareInfo.sharePosterOpen == 1"
class="sharePoster share-wrapper share-box"
... ...
... ... @@ -101,7 +101,7 @@ export struct VideoChannelDetail {
openFullScreen() {
WindowModel.shared.setWindowSystemBarProperties({
statusBarContentColor: '#ffffff',
statusBarColor: '#000000',
// statusBarColor: '#000000',
// navigationBarColor: '#000000',
// navigationBarContentColor: '#ffffff'
})
... ... @@ -116,7 +116,7 @@ export struct VideoChannelDetail {
closeFullScreen() {
WindowModel.shared.setWindowSystemBarProperties({
statusBarContentColor: '#000000',
statusBarColor: '#ffffff',
// statusBarColor: '#ffffff',
// navigationBarColor: '#0x66000000',
// navigationBarContentColor: '#0xE5FFFFFF'
... ...
... ... @@ -170,7 +170,7 @@ export struct PlayerRightView {
.width(58)
.position({ x: '100%', y: '100%' })
.markAnchor({ x: '100%', y: '100%' })
.padding({ bottom: 72, right: 10 })
.padding({ bottom: 0, right: 10 })
.visibility(this.isOpenDetail || this.isDragging ? Visibility.None : Visibility.Visible)
}
... ... @@ -229,7 +229,8 @@ export struct PlayerRightView {
}
} else if (this.likesStyle === 3) {
return {
url: this.newsStatusOfUser.likeStatus === '1' ? $r(`app.media.ic_candle_check`) : $r(`app.media.ic_candle_uncheck`),
url: this.newsStatusOfUser.likeStatus === '1' ? $r(`app.media.ic_candle_check`) :
$r(`app.media.ic_candle_uncheck`),
name: '默哀'
}
}
... ... @@ -239,13 +240,17 @@ export struct PlayerRightView {
}
transNum2String(name: 'likeNum' | 'collectNum' | 'commentNum') {
console.log(TAG, 'transNum2String', this.interactData.likeNum, this.interactData.collectNum, this.interactData.commentNum)
console.log(TAG, 'transNum2String', this.interactData.likeNum, this.interactData.collectNum,
this.interactData.commentNum)
if (name === 'likeNum') {
return this.interactData.likeNum != 0 ? NumberFormatterUtils.formatNumberWithWan(this.interactData.likeNum || '') : ''
return this.interactData.likeNum != 0 ?
NumberFormatterUtils.formatNumberWithWan(this.interactData.likeNum || '') : ''
} else if (name === 'collectNum') {
return this.interactData.collectNum != 0 ? NumberFormatterUtils.formatNumberWithWan(this.interactData.collectNum || '') : ''
return this.interactData.collectNum != 0 ?
NumberFormatterUtils.formatNumberWithWan(this.interactData.collectNum || '') : ''
} else {
return this.interactData.commentNum != 0 ? NumberFormatterUtils.formatNumberWithWan(this.interactData.commentNum || '') : ''
return this.interactData.commentNum != 0 ?
NumberFormatterUtils.formatNumberWithWan(this.interactData.commentNum || '') : ''
}
}
... ... @@ -282,7 +287,8 @@ export struct PlayerRightView {
@Builder
collectBuilderView() {
Column() {
Image(this.newsStatusOfUser.collectStatus == 1 ? $r(`app.media.ic_collect_check`) : $r(`app.media.ic_collect_uncheck`))
Image(this.newsStatusOfUser.collectStatus == 1 ? $r(`app.media.ic_collect_check`) :
$r(`app.media.ic_collect_uncheck`))
.width(32)
.aspectRatio(1)
.onClick(() => {
... ...
... ... @@ -25,7 +25,7 @@ export struct PlayerTitleComment {
name: this.getName(),
title: this.getTitle(),
summary: this.getSummary(),
isOpen: this.isOpen
isOpenDetail: this.isOpen
}),
autoCancel: false,
... ... @@ -164,9 +164,12 @@ export struct PlayerTitleComment {
step: 0.01,
// style: SliderStyle.OutSet
})
.blockColor(this.status === PlayerConstants.STATUS_START ? Color.Transparent : $r('app.color.play_block_color'))
.trackColor(this.status === PlayerConstants.STATUS_START ? $r('app.color.play_track_color') : $r('app.color.pause_track_color'))
.selectedColor(this.status === PlayerConstants.STATUS_START ? $r('app.color.play_selected_color') : $r('app.color.pause_selected_color'))
.blockColor(this.status === PlayerConstants.STATUS_START ? Color.Transparent :
$r('app.color.play_block_color'))
.trackColor(this.status === PlayerConstants.STATUS_START ? $r('app.color.play_track_color') :
$r('app.color.pause_track_color'))
.selectedColor(this.status === PlayerConstants.STATUS_START ? $r('app.color.play_selected_color') :
$r('app.color.pause_selected_color'))
.trackThickness(this.status === PlayerConstants.STATUS_START ? 1 : 4)
.blockStyle({
type: this.status === PlayerConstants.STATUS_START ? SliderBlockType.DEFAULT : SliderBlockType.IMAGE,
... ... @@ -202,7 +205,12 @@ export struct PlayerTitleComment {
.margin({ left: 12 })
}
.alignItems(VerticalAlign.Center)
.padding({ left: 16, right: 16, top: 11, bottom: 11 })
.padding({
left: 16,
right: 16,
top: 11,
bottom: 11
})
}
}
... ...
... ... @@ -47,7 +47,7 @@ export struct PlayerTitleView {
fontSize: 15,
fontWeight: 400,
lineHeight: 20,
constraintWidth: this.windowWidth - 100 - 16 - 22 + 'px',
constraintWidth: this.windowWidth - 150 - 16 - 22 + 'px',
})
this.titleHeight = info?.height as number || 0
... ... @@ -87,7 +87,12 @@ export struct PlayerTitleView {
*/
if (this.titleHeight > 200 || this.getSummary()) {
Text('查看详情 > ')
.padding({ left: 6, right: 6, top: 4, bottom: 4 })
.padding({
left: 6,
right: 6,
top: 4,
bottom: 4
})
.borderRadius(2)
.backgroundColor('#99636363')
.fontColor(Color.White)
... ... @@ -102,7 +107,7 @@ export struct PlayerTitleView {
}
}
.width(this.windowWidth - 100 + 'px')
.width(this.windowWidth - 150 + 'px')
.padding({ left: 16, right: 22 })
.alignItems(HorizontalAlign.Start)
.visibility(this.isOpenDetail || this.isDragging ? Visibility.None : Visibility.Visible)
... ...
... ... @@ -62,7 +62,7 @@ export class HWLocationUtils {
if (requestGrant) {
HWLocationUtils.getCurrentLocation()
} else {
PermissionUtils.openPermissionsInSystemSettings(context)
// PermissionUtils.openPermissionsInSystemSettings(context)
}
}
... ...
... ... @@ -2,11 +2,10 @@ import { Logger } from 'wdKit/src/main/ets/utils/Logger'
import { LoginInputComponent } from './LoginInputComponent'
import { LoginViewModel } from './LoginViewModel'
import router from '@ohos.router'
import promptAction from '@ohos.promptAction'
import { WDRouterRule, WDRouterPage } from 'wdRouter';
import { SettingPasswordParams } from './SettingPasswordLayout'
import { Router } from '@ohos.arkui.UIContext'
import { EmitterEventId, EmitterUtils, SPHelper, ToastUtils } from 'wdKit/Index'
import { CustomToast, EmitterEventId, EmitterUtils, SPHelper, ToastUtils } from 'wdKit/Index'
import { SpConstants } from 'wdConstant/Index'
import { emitter } from '@kit.BasicServicesKit'
... ... @@ -31,6 +30,18 @@ struct ForgetPasswordPage {
this.sendVerifyCode()
}
}
@State toastText:string = ""
dialogToast: CustomDialogController = new CustomDialogController({
builder: CustomToast({
msg: this.toastText,
}),
autoCancel: false,
alignment: DialogAlignment.Center,
offset: { dx: 0, dy: -20 },
gridCount: 1,
customStyle: true,
maskColor:"#00000000"
})
... ... @@ -100,11 +111,11 @@ struct ForgetPasswordPage {
if(this.pageType == 1){
this.loginViewModel.sendVerifyCodeByToken().then(()=>{
promptAction.showToast({ message: "已发送" })
this.showToastTip("已发送")
this.codeStateSuccess=true
this.isCodeSend=false
}).catch((message: string)=>{
promptAction.showToast({ message: message })
this.showToastTip(message)
this.codeStateSuccess=false
this.isCodeSend=false
})
... ... @@ -112,12 +123,12 @@ struct ForgetPasswordPage {
}
this.loginViewModel.sendVerifyCode(this.phoneContent).then((verifyCode) => {
promptAction.showToast({ message: "已发送" })
this.showToastTip("已发送")
this.codeStateSuccess=true
this.isCodeSend=false
Logger.debug(TAG, "sendVerifyCode: " + verifyCode)
}).catch((message: string)=>{
promptAction.showToast({ message: message })
this.showToastTip(message)
this.codeStateSuccess=false
this.isCodeSend=false
})
... ... @@ -146,7 +157,7 @@ struct ForgetPasswordPage {
}
WDRouterRule.jumpWithPage(WDRouterPage.settingPasswordPage, params)
}).catch((message: string)=>{
promptAction.showToast({ message: message })
this.showToastTip(message)
})
return
}
... ... @@ -159,10 +170,10 @@ struct ForgetPasswordPage {
}
WDRouterRule.jumpWithReplacePage(WDRouterPage.settingPasswordPage, params)
promptAction.showToast({message:"校验成功,准备跳转设置页面"})
this.showToastTip("校验成功,准备跳转设置页面")
Logger.debug(TAG,"校验成功")
}).catch((error:string)=>{
promptAction.showToast({message:error})
this.showToastTip(error)
Logger.debug(TAG,"校验失败")
})
}
... ... @@ -217,4 +228,9 @@ struct ForgetPasswordPage {
// 发送eventId为1的事件,事件内容为eventData
emitter.emit(event, eventData);
}
showToastTip(msg:string){
this.toastText = msg
this.dialogToast.open()
}
}
\ No newline at end of file
... ...
import { Logger, EmitterEventId, EmitterUtils, DateTimeUtils } from 'wdKit'
import { Logger, EmitterEventId, EmitterUtils, DateTimeUtils,CustomToast } from 'wdKit'
import { CustomProtocolDialog } from './CustomProtocolDialog'
import router from '@ohos.router'
import { LoginViewModel } from './LoginViewModel'
import { LoginInputComponent } from './LoginInputComponent'
import promptAction from '@ohos.promptAction'
import { ErrorToastUtils, SPHelper } from 'wdKit'
import { WDRouterPage } from 'wdRouter/src/main/ets/router/WDRouterPage';
import { WDRouterRule } from 'wdRouter/src/main/ets/router/WDRouterRule';
... ... @@ -47,6 +46,18 @@ struct LoginPage {
// @State isPasswordSubmit: boolean = false //账户密码状态 是否出发登录
lastTime: number = 0
@State codeStateSuccess:boolean=false
@State toastText:string = ""
dialogToast: CustomDialogController = new CustomDialogController({
builder: CustomToast({
msg: this.toastText,
}),
autoCancel: false,
alignment: DialogAlignment.Center,
offset: { dx: 0, dy: -20 },
gridCount: 1,
customStyle: true,
maskColor:"#00000000"
})
dialogController: CustomDialogController = new CustomDialogController({
builder: CustomProtocolDialog({
... ... @@ -316,12 +327,12 @@ struct LoginPage {
//发送验证码
sendVerifyCode() {
this.loginViewModel.sendVerifyCode(this.phoneContent).then((verifyCode) => {
promptAction.showToast({ message: "已发送" })
this.showToastTip("已发送")
Logger.debug(TAG, "sendVerifyCode: " + verifyCode)
this.codeStateSuccess=true
this.isCodeSend=false
}).catch((message:string)=>{
promptAction.showToast({ message: message })
this.showToastTip(message)
this.codeStateSuccess=false
this.isCodeSend=false
Logger.debug(TAG, "sendVerifyCode: " + message)
... ... @@ -339,12 +350,13 @@ struct LoginPage {
this.queryUserDetail()
EmitterUtils.sendEvent(EmitterEventId.PEOPLE_SHIP_ATTENTION)
}).catch((error:string)=>{
promptAction.showToast({ message: error })
this.showToastTip(error)
})
} else {
this.loginViewModel.appLoginByPassword(this.accountContent, 0, this.passwordContent, "").then((data) => {
Logger.debug(TAG, "requestLogin: " + data.jwtToken)
promptAction.showToast({ message: '登录成功' })
this.showToastTip('登录成功')
///同步兴趣tag
let interestsModel = new InterestsHobbiesModel()
interestsModel.updateInterests()
... ... @@ -357,12 +369,17 @@ struct LoginPage {
// url: `${WDRouterPage.getBundleInfo()}`
// })
}).catch((value: string) => {
promptAction.showToast({ message: value })
this.showToastTip(value)
})
}
}
showToastTip(msg:string){
this.toastText = msg
this.dialogToast.open()
}
queryUserDetail(){
this.loginViewModel.queryUserDetail().then(()=>{
router.back({
... ...
... ... @@ -16,11 +16,15 @@ struct LoginProtocolWebview {
privateProtocol = 'https://cdnpeoplefrontuat.aikan.pdnews.cn/rmrb/rmrb-protocol-zh-web/0.0.1/app/protocol-1001.html'
logoutProtocol = 'https://cdnpeoplefrontuat.aikan.pdnews.cn/rmrb/rmrb-protocol-zh-web/0.0.1/app/protocol-1003.html'
huaweiAuthProtocol = 'https://privacy.consumer.huawei.com/legal/id/authentication-terms.htm?code=CN&language=zh-CN'
@State contentID:string = "0"
async aboutToAppear() {
if (router.getParams()) {
let params = router.getParams() as Params
Logger.info(TAG, 'params.contentID:' + params.contentID);
if(params.contentID != undefined){
this.contentID = params.contentID
}
if (params.contentID == "1") { //"人民日报客户端网络服务使用协议"
this.webUrl = await SPHelper.default.get(SpConstants.NET_SERVICE_PROTOCOL, this.userProtocol) as string
this.webviewController.loadUrl(this.webUrl)
... ... @@ -71,6 +75,7 @@ struct LoginProtocolWebview {
Logger.info(TAG, 'onHttpErrorReceive event.request.getRequestUrl:' + event?.request.getRequestUrl());
Logger.info(TAG, 'onHttpErrorReceive event.response.getResponseCode:' + event?.response.getResponseCode());
})
.padding({bottom:this.contentID === "2" ? "40lpx" : 0 })
}
}
}
\ No newline at end of file
... ...
import ArrayList from '@ohos.util.ArrayList';
import promptAction from '@ohos.promptAction';
import { Params } from '../../../../../../../commons/wdRouter/oh_modules/wdBean/Index';
import router from '@ohos.router';
import { LoginViewModel } from './LoginViewModel';
import { Logger, SPHelper, ToastUtils } from 'wdKit';
import { CustomToast, Logger, SPHelper, ToastUtils } from 'wdKit';
import {
SpConstants
} from '../../../../../../../commons/wdNetwork/oh_modules/wdConstant/src/main/ets/constants/SpConstants'
... ... @@ -58,6 +57,19 @@ export struct SettingPasswordLayout {
loginViewModel = new LoginViewModel()
pageType?:number; //0、登录->忘记密码 1、设置->重置密码 2、设置->更换手机
@State toastText:string = ""
dialogToast: CustomDialogController = new CustomDialogController({
builder: CustomToast({
msg: this.toastText,
}),
autoCancel: false,
alignment: DialogAlignment.Center,
offset: { dx: 0, dy: -20 },
gridCount: 1,
customStyle: true,
maskColor:"#00000000"
})
aboutToAppear() {
let params:SettingPasswordParams = router.getParams() as SettingPasswordParams;
this.pageId = parseInt(params.pageID);
... ... @@ -194,7 +206,7 @@ export struct SettingPasswordLayout {
this.inputTextChange(value, item.inputTag)
})
.onSubmit((EnterKeyType) => {
promptAction.showToast({ message: 'submit' })
this.showToastTip('submit')
})
}
.alignItems(VerticalAlign.Center)
... ... @@ -218,7 +230,7 @@ export struct SettingPasswordLayout {
this.inputTextChange(value, item.inputTag)
})
.onSubmit((EnterKeyType) => {
promptAction.showToast({ message: 'submit' })
this.showToastTip('submit')
})
}
.alignItems(VerticalAlign.Center)
... ... @@ -264,7 +276,7 @@ export struct SettingPasswordLayout {
Text(item.compDesc).fontSize(12).maxLines(3).fontColor(0x999999).padding({top:'10lpx'})
.onClick(()=>{
if (item.compDesc == '忘记密码') {
promptAction.showToast({ message: '密码不符合密码规范' })
this.showToastTip('密码不符合密码规范')
}
})
}
... ... @@ -307,11 +319,11 @@ export struct SettingPasswordLayout {
if (this.btnStatus) {
// 需要+手机号校验
if (this.password01.length < 6 || this.password01.length > 20) {
promptAction.showToast({ message: '密码不符合密码规范' })
this.showToastTip('密码不符合密码规范')
return
}
if (this.password01 != this.password02) {
promptAction.showToast({ message: '密码不一致' })
this.showToastTip('密码不一致')
return
}
if(this.pageId == 1){ //设置密码
... ... @@ -339,7 +351,6 @@ export struct SettingPasswordLayout {
Logger.error(TAG, 'catch err:' + JSON.stringify(err));
});
}
// promptAction.showToast({ message: '请求接口' })
}
... ... @@ -363,5 +374,10 @@ export struct SettingPasswordLayout {
}
}
}
showToastTip(msg:string){
this.toastText = msg
this.dialogToast.open()
}
}
... ...
... ... @@ -2,7 +2,7 @@ import { Logger } from 'wdKit';
import { MultiPictureDetailPageComponent } from 'wdComponent';
import router from '@ohos.router';
import { Params, Action } from 'wdBean';
import { WindowModel } from 'wdKit/Index';
const TAG = 'MultiPictureDetailPage';
/**
... ... @@ -26,6 +26,8 @@ struct MultiPictureDetailPage {
})
}
}
.padding({top:44})
.backgroundColor(Color.Black)
}
pageTransition(){
... ... @@ -38,6 +40,10 @@ struct MultiPictureDetailPage {
}
aboutToAppear() {
this.openFullScreen()
Logger.info(TAG, 'aboutToDisappear');
let par:Action = router.getParams() as Action;
let params = par?.params;
this.relId = params?.extra?.relId || '';
... ... @@ -47,11 +53,33 @@ struct MultiPictureDetailPage {
Logger.info(TAG, 'params', JSON.stringify(params));
}
aboutToDisappear() {
Logger.info(TAG, 'aboutToDisappear');
}
onBackPress() {
Logger.info(TAG, 'onBackPress');
}
/**
* 开启沉浸式
* TODO:颜色待根据业务接口修改
*/
openFullScreen() {
WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#ffffff', })
WindowModel.shared.setWindowLayoutFullScreen(true)
// WindowModel.shared.setWindowSystemBarEnable([])
}
aboutToDisappear(): void {
console.log(TAG, 'aboutToDisappear')
this.closeFullScreen()
}
/**
* 关闭沉浸式
* TODO:颜色待根据业务接口修改
*/
closeFullScreen() {
WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#000000', })
WindowModel.shared.setWindowLayoutFullScreen(false)
// WindowModel.shared.setWindowSystemBarEnable(['status', 'navigation'])
}
}
\ No newline at end of file
... ...