Showing
38 changed files
with
364 additions
and
129 deletions
| @@ -49,3 +49,5 @@ export { NetworkUtil } from './src/main/ets/utils/NetworkUtil' | @@ -49,3 +49,5 @@ export { NetworkUtil } from './src/main/ets/utils/NetworkUtil' | ||
| 49 | export { NetworkManager } from './src/main/ets/network/NetworkManager' | 49 | export { NetworkManager } from './src/main/ets/network/NetworkManager' |
| 50 | 50 | ||
| 51 | export { NetworkType } from './src/main/ets/network/NetworkType' | 51 | export { NetworkType } from './src/main/ets/network/NetworkType' |
| 52 | + | ||
| 53 | +export { CustomToast } from './src/main/ets/reusable/CustomToast' |
| 1 | +@CustomDialog | ||
| 2 | +export struct CustomToast { | ||
| 3 | + public static LENGTH_LONG = 5000; | ||
| 4 | + public static LENGTH_SHORT = 3000; | ||
| 5 | + | ||
| 6 | + @State msg: string = "" | ||
| 7 | + @State duration: number = CustomToast.LENGTH_SHORT | ||
| 8 | + @State bgBorderRadius: number = 10 | ||
| 9 | + | ||
| 10 | + controller: CustomDialogController | ||
| 11 | + | ||
| 12 | + dismiss: () => void = () => { | ||
| 13 | + } | ||
| 14 | + | ||
| 15 | + aboutToAppear(): void { | ||
| 16 | + let intervalID = setInterval(() => { | ||
| 17 | + if (this.controller != undefined) { | ||
| 18 | + this.controller.close() | ||
| 19 | + this.dismiss() | ||
| 20 | + clearInterval(intervalID); | ||
| 21 | + } | ||
| 22 | + }, this.duration); | ||
| 23 | + } | ||
| 24 | + | ||
| 25 | + build() { | ||
| 26 | + Row() { | ||
| 27 | + Text(this.msg) | ||
| 28 | + .fontWeight(FontWeight.Regular) | ||
| 29 | + .fontColor($r('app.color.white')) | ||
| 30 | + .fontSize("27lpx") | ||
| 31 | + .lineHeight("38lpx") | ||
| 32 | + }.borderRadius(`${this.bgBorderRadius}lpx`) | ||
| 33 | + .padding({top:"23lpx",bottom:'23lpx',left:"35lpx",right:"35lpx"}) | ||
| 34 | + .backgroundColor($r("app.color.black")) | ||
| 35 | + .opacity(0.7) | ||
| 36 | + } | ||
| 37 | +} |
| @@ -509,6 +509,26 @@ export class DateTimeUtils { | @@ -509,6 +509,26 @@ export class DateTimeUtils { | ||
| 509 | } | 509 | } |
| 510 | return num; | 510 | return num; |
| 511 | } | 511 | } |
| 512 | + | ||
| 513 | + /** | ||
| 514 | + * 去除发布日期前导零 | ||
| 515 | + * @param dateTimeString 2024年01月01日 00:00 | ||
| 516 | + * @returns 2024年1月1日 00:00 | ||
| 517 | + */ | ||
| 518 | + static removeTrailingZeros(dateTimeString: string) { | ||
| 519 | + // 分割日期时间字符串 | ||
| 520 | + const [datePart, timePart] = dateTimeString.split(' '); | ||
| 521 | + // 分割日期 | ||
| 522 | + const [year, month, day] = datePart.match(/\d+/g); | ||
| 523 | + // 去除年和月后面的零 | ||
| 524 | + const trimmedMonth = parseInt(month, 10); | ||
| 525 | + const trimmedDay = parseInt(day, 10); | ||
| 526 | + | ||
| 527 | + // 重新组合日期时间字符串 | ||
| 528 | + const newDateTimeString = `${year}年${trimmedMonth}月${trimmedDay}日 ${timePart}`; | ||
| 529 | + | ||
| 530 | + return newDateTimeString; | ||
| 531 | + } | ||
| 512 | } | 532 | } |
| 513 | 533 | ||
| 514 | // const dateTimeUtils = new DateTimeUtils() | 534 | // const dateTimeUtils = new DateTimeUtils() |
| @@ -10,6 +10,7 @@ import Url from '@ohos.url' | @@ -10,6 +10,7 @@ import Url from '@ohos.url' | ||
| 10 | import { ContentDTO, PhotoListBean } from 'wdBean'; | 10 | import { ContentDTO, PhotoListBean } from 'wdBean'; |
| 11 | import { handleJsCallAppService } from './JsCallAppService' | 11 | import { handleJsCallAppService } from './JsCallAppService' |
| 12 | import { HttpUtils } from 'wdNetwork/Index'; | 12 | import { HttpUtils } from 'wdNetwork/Index'; |
| 13 | + | ||
| 13 | const TAG = 'JsBridgeBiz' | 14 | const TAG = 'JsBridgeBiz' |
| 14 | 15 | ||
| 15 | class AppInfo { | 16 | class AppInfo { |
| @@ -20,6 +21,7 @@ class AppInfo { | @@ -20,6 +21,7 @@ class AppInfo { | ||
| 20 | screenTabbarSafeHeight: number = 42 // TODO 这里需要动态获取 | 21 | screenTabbarSafeHeight: number = 42 // TODO 这里需要动态获取 |
| 21 | imei: string = HttpUtils.getImei() | 22 | imei: string = HttpUtils.getImei() |
| 22 | device_id: string = HttpUtils.getDeviceId() | 23 | device_id: string = HttpUtils.getDeviceId() |
| 24 | + fontSizes: string = 'small' | ||
| 23 | // TODO 完善 | 25 | // TODO 完善 |
| 24 | } | 26 | } |
| 25 | 27 |
| @@ -142,15 +142,23 @@ export struct DynamicDetailComponent { | @@ -142,15 +142,23 @@ export struct DynamicDetailComponent { | ||
| 142 | .margin({right: $r('app.float.margin_6')}) | 142 | .margin({right: $r('app.float.margin_6')}) |
| 143 | if(!StringUtils.isEmpty(this.followStatus)){ | 143 | if(!StringUtils.isEmpty(this.followStatus)){ |
| 144 | if (this.followStatus == '0') { | 144 | if (this.followStatus == '0') { |
| 145 | - Text('+关注') | ||
| 146 | - .width($r('app.float.margin_54')) | ||
| 147 | - .height($r('app.float.margin_24')) | ||
| 148 | - .textAlign(TextAlign.Center) | ||
| 149 | - .fontSize($r('app.float.font_size_12')) | ||
| 150 | - .borderRadius($r('app.float.vp_3')) | ||
| 151 | - .backgroundColor($r('app.color.color_ED2800')) | ||
| 152 | - .fontColor($r('app.color.color_fff')) | ||
| 153 | - .onClick(() => { | 145 | + Row() { |
| 146 | + Blank().layoutWeight(1) | ||
| 147 | + Image($r('app.media.icon_add_attention')) | ||
| 148 | + .width($r('app.float.vp_12')) | ||
| 149 | + .height($r('app.float.vp_12')) | ||
| 150 | + .margin({right:2}) | ||
| 151 | + Text('关注') | ||
| 152 | + .textAlign(TextAlign.Center) | ||
| 153 | + .fontSize($r('app.float.font_size_12')) | ||
| 154 | + .fontColor($r('app.color.color_fff')) | ||
| 155 | + Blank().layoutWeight(1) | ||
| 156 | + } | ||
| 157 | + .width($r('app.float.margin_54')) | ||
| 158 | + .height($r('app.float.margin_24')) | ||
| 159 | + .borderRadius($r('app.float.vp_3')) | ||
| 160 | + .backgroundColor($r('app.color.color_ED2800')) | ||
| 161 | + .onClick(() => { | ||
| 154 | this.handleAccention() | 162 | this.handleAccention() |
| 155 | }) | 163 | }) |
| 156 | } else { | 164 | } else { |
| @@ -61,13 +61,12 @@ export struct ImageAndTextPageComponent { | @@ -61,13 +61,12 @@ export struct ImageAndTextPageComponent { | ||
| 61 | Text(this.publishTime) | 61 | Text(this.publishTime) |
| 62 | .fontColor($r('app.color.color_B0B0B0')) | 62 | .fontColor($r('app.color.color_B0B0B0')) |
| 63 | .fontSize($r('app.float.font_size_13')) | 63 | .fontSize($r('app.float.font_size_13')) |
| 64 | - .height('100%') | ||
| 65 | - .align(Alignment.End) | ||
| 66 | } | 64 | } |
| 67 | .width(CommonConstants.FULL_WIDTH) | 65 | .width(CommonConstants.FULL_WIDTH) |
| 68 | .height(32) | 66 | .height(32) |
| 69 | .padding({ left: 15, right: 15, }) | 67 | .padding({ left: 15, right: 15, }) |
| 70 | .justifyContent(FlexAlign.SpaceBetween) | 68 | .justifyContent(FlexAlign.SpaceBetween) |
| 69 | + .alignItems(VerticalAlign.Bottom) | ||
| 71 | .backgroundColor(Color.White) | 70 | .backgroundColor(Color.White) |
| 72 | 71 | ||
| 73 | Row() { | 72 | Row() { |
| @@ -108,7 +107,7 @@ export struct ImageAndTextPageComponent { | @@ -108,7 +107,7 @@ export struct ImageAndTextPageComponent { | ||
| 108 | .height(24) | 107 | .height(24) |
| 109 | .margin({ right: 5 }) | 108 | .margin({ right: 5 }) |
| 110 | } | 109 | } |
| 111 | - if (this.interactData?.likeNum != '0') { | 110 | + if (this.interactData?.likeNum) { |
| 112 | Text(`${this.interactData?.likeNum}`) | 111 | Text(`${this.interactData?.likeNum}`) |
| 113 | .fontSize(16) | 112 | .fontSize(16) |
| 114 | .fontColor(this.newsStatusOfUser?.likeStatus === '1' ? '#ED2800' : '#999999') | 113 | .fontColor(this.newsStatusOfUser?.likeStatus === '1' ? '#ED2800' : '#999999') |
| @@ -205,7 +204,8 @@ export struct ImageAndTextPageComponent { | @@ -205,7 +204,8 @@ export struct ImageAndTextPageComponent { | ||
| 205 | this.contentDetailData = detailBeans; | 204 | this.contentDetailData = detailBeans; |
| 206 | let dateTime = | 205 | let dateTime = |
| 207 | DateTimeUtils.parseDate(this.contentDetailData[0]?.publishTime, DateTimeUtils.PATTERN_DATE_TIME_HYPHEN); | 206 | DateTimeUtils.parseDate(this.contentDetailData[0]?.publishTime, DateTimeUtils.PATTERN_DATE_TIME_HYPHEN); |
| 208 | - this.publishTime = DateTimeUtils.formatDate(dateTime, PATTERN_DATE_CN_RN) | 207 | + let _publishTime = DateTimeUtils.formatDate(dateTime, PATTERN_DATE_CN_RN) |
| 208 | + this.publishTime = DateTimeUtils.removeTrailingZeros(_publishTime) | ||
| 209 | if (this.contentDetailData[0]?.recommendShow === 1) { | 209 | if (this.contentDetailData[0]?.recommendShow === 1) { |
| 210 | this.getRecommend() | 210 | this.getRecommend() |
| 211 | } | 211 | } |
| @@ -66,7 +66,7 @@ export struct ImageAndTextWebComponent { | @@ -66,7 +66,7 @@ export struct ImageAndTextWebComponent { | ||
| 66 | loadImageOnlyWifiSwitch: '2', | 66 | loadImageOnlyWifiSwitch: '2', |
| 67 | networkStatus: Number(NetworkUtil.isNetConnected()), | 67 | networkStatus: Number(NetworkUtil.isNetConnected()), |
| 68 | darkMode: 'light', | 68 | darkMode: 'light', |
| 69 | - fontSizes: 'normalsize' | 69 | + fontSizes: 'small' |
| 70 | 70 | ||
| 71 | } as H5ReceiveDataExtraBean | 71 | } as H5ReceiveDataExtraBean |
| 72 | let h5ReceiveDataJsonBean: H5ReceiveDataJsonBean = { | 72 | let h5ReceiveDataJsonBean: H5ReceiveDataJsonBean = { |
| @@ -13,6 +13,7 @@ import { image } from '@kit.ImageKit'; | @@ -13,6 +13,7 @@ import { image } from '@kit.ImageKit'; | ||
| 13 | import { getPicture, imageNet2PixelMap } from '../../utils/ImageUtils'; | 13 | import { getPicture, imageNet2PixelMap } from '../../utils/ImageUtils'; |
| 14 | import { effectKit } from '@kit.ArkGraphics2D'; | 14 | import { effectKit } from '@kit.ArkGraphics2D'; |
| 15 | import { window } from '@kit.ArkUI'; | 15 | import { window } from '@kit.ArkUI'; |
| 16 | +import DailyPaperTopicModel from '../../model/DailyPaperTopicModel' | ||
| 16 | 17 | ||
| 17 | const TAG = 'MorningEveningPaperComponent'; | 18 | const TAG = 'MorningEveningPaperComponent'; |
| 18 | 19 | ||
| @@ -111,12 +112,19 @@ export struct MorningEveningPaperComponent { | @@ -111,12 +112,19 @@ export struct MorningEveningPaperComponent { | ||
| 111 | Logger.info(TAG, "currentTime = " + currentTime) | 112 | Logger.info(TAG, "currentTime = " + currentTime) |
| 112 | Logger.info(TAG, `currentTime = ${currentTime}`) | 113 | Logger.info(TAG, `currentTime = ${currentTime}`) |
| 113 | try { | 114 | try { |
| 115 | + let dailyPaperTopicBean = await DailyPaperTopicModel.getDailyPaperTopic() | ||
| 116 | + if (dailyPaperTopicBean) { | ||
| 117 | + dailyPaperTopicPageId = '' + dailyPaperTopicBean.id | ||
| 118 | + Logger.info(TAG, "pageID = " + dailyPaperTopicPageId) | ||
| 119 | + } | ||
| 120 | + | ||
| 114 | // let pageInfoBean = await MorningEveningViewModel.getMorningEveningPageInfo("" + this.dailyPaperTopicPageId) | 121 | // let pageInfoBean = await MorningEveningViewModel.getMorningEveningPageInfo("" + this.dailyPaperTopicPageId) |
| 115 | let pageInfoBean = await MorningEveningViewModel.getMorningEveningPageInfo("" + dailyPaperTopicPageId) //"25091" | 122 | let pageInfoBean = await MorningEveningViewModel.getMorningEveningPageInfo("" + dailyPaperTopicPageId) //"25091" |
| 116 | this.pageInfoBean = pageInfoBean; | 123 | this.pageInfoBean = pageInfoBean; |
| 117 | this.title = this.pageInfoBean?.topicInfo?.title | 124 | this.title = this.pageInfoBean?.topicInfo?.title |
| 118 | - let dateTime = DateTimeUtils.parseDate(this.pageInfoBean?.topicInfo?.topicDate ?? '', DateTimeUtils.PATTERN_DATE_HYPHEN); | ||
| 119 | - this.subTitle = DateTimeUtils.formatDate(dateTime, PATTERN_DATE_CN_RN) | 125 | + let dateTime = DateTimeUtils.parseDate(this.pageInfoBean?.topicInfo?.topicDate ?? '', DateTimeUtils.PATTERN_DATE_HYPHEN) |
| 126 | + const dateShow = new Date(dateTime) | ||
| 127 | + this.subTitle = `${dateShow.getFullYear()}年\n${(dateShow.getMonth() + 1)}月${dateShow.getDate()}日` | ||
| 120 | Logger.info(TAG, "pageInfoBean topicDate = " + this.pageInfoBean?.topicInfo?.topicDate) | 128 | Logger.info(TAG, "pageInfoBean topicDate = " + this.pageInfoBean?.topicInfo?.topicDate) |
| 121 | Logger.info(TAG, "pageInfoBean title = " + this.pageInfoBean?.topicInfo?.title) | 129 | Logger.info(TAG, "pageInfoBean title = " + this.pageInfoBean?.topicInfo?.title) |
| 122 | 130 | ||
| @@ -166,6 +174,7 @@ export struct MorningEveningPaperComponent { | @@ -166,6 +174,7 @@ export struct MorningEveningPaperComponent { | ||
| 166 | let color = colorPicker.getMainColorSync(); | 174 | let color = colorPicker.getMainColorSync(); |
| 167 | // 将取色器选取的color示例转换为十六进制颜色代码 | 175 | // 将取色器选取的color示例转换为十六进制颜色代码 |
| 168 | this.mixedBgColor = "#" + color.alpha.toString(16) + color.red.toString(16) + color.green.toString(16) + color.blue.toString(16); | 176 | this.mixedBgColor = "#" + color.alpha.toString(16) + color.red.toString(16) + color.green.toString(16) + color.blue.toString(16); |
| 177 | + Logger.debug(TAG, "compInfoBean compStyle = " + this.mixedBgColor) | ||
| 169 | }); | 178 | }); |
| 170 | 179 | ||
| 171 | } | 180 | } |
| @@ -218,7 +227,6 @@ export struct MorningEveningPaperComponent { | @@ -218,7 +227,6 @@ export struct MorningEveningPaperComponent { | ||
| 218 | .margin({ left: 14, right: 14 }) | 227 | .margin({ left: 14, right: 14 }) |
| 219 | } | 228 | } |
| 220 | .width('100%') | 229 | .width('100%') |
| 221 | - // .backgroundColor('#000080') | ||
| 222 | // .backgroundColor(Color.Black) | 230 | // .backgroundColor(Color.Black) |
| 223 | // .backgroundColor(this.pageInfoBean?.backgroundColor ?? Color.Black) | 231 | // .backgroundColor(this.pageInfoBean?.backgroundColor ?? Color.Black) |
| 224 | .backgroundColor(this.mixedBgColor ?? Color.Black) | 232 | .backgroundColor(this.mixedBgColor ?? Color.Black) |
| 1 | import router from '@ohos.router'; | 1 | import router from '@ohos.router'; |
| 2 | +import { ToastUtils } from 'wdKit'; | ||
| 2 | 3 | ||
| 3 | /** | 4 | /** |
| 4 | * 早晚报页面标题bar | 5 | * 早晚报页面标题bar |
| @@ -74,6 +75,9 @@ export struct PaperTitleComponent { | @@ -74,6 +75,9 @@ export struct PaperTitleComponent { | ||
| 74 | }) | 75 | }) |
| 75 | .id('img_share') | 76 | .id('img_share') |
| 76 | .margin({ right: 13 }) | 77 | .margin({ right: 13 }) |
| 78 | + .onClick(() => { | ||
| 79 | + ToastUtils.showToast('分享为公共方法,待开发', 1000) | ||
| 80 | + }) | ||
| 77 | } | 81 | } |
| 78 | .margin({ left: 14, right: 14 }) | 82 | .margin({ left: 14, right: 14 }) |
| 79 | .height($r('app.float.top_bar_height')) | 83 | .height($r('app.float.top_bar_height')) |
| @@ -101,8 +101,8 @@ export struct SingleColumn999Component { | @@ -101,8 +101,8 @@ export struct SingleColumn999Component { | ||
| 101 | .height(100) | 101 | .height(100) |
| 102 | .padding(9) | 102 | .padding(9) |
| 103 | .fontColor(Color.White) | 103 | .fontColor(Color.White) |
| 104 | - .fontSize($r('app.float.font_size_16')) | ||
| 105 | - .fontWeight(FontWeight.Medium) | 104 | + .fontSize($r('app.float.vp_14')) |
| 105 | + .fontWeight(400) | ||
| 106 | .textAlign(TextAlign.Center) | 106 | .textAlign(TextAlign.Center) |
| 107 | .align(Alignment.Bottom) | 107 | .align(Alignment.Bottom) |
| 108 | .maxLines(1) | 108 | .maxLines(1) |
| @@ -130,8 +130,8 @@ export struct SingleColumn999Component { | @@ -130,8 +130,8 @@ export struct SingleColumn999Component { | ||
| 130 | .width("100%")// .height(100) | 130 | .width("100%")// .height(100) |
| 131 | .padding(9) | 131 | .padding(9) |
| 132 | .fontColor(Color.White) | 132 | .fontColor(Color.White) |
| 133 | - .fontSize($r('app.float.font_size_16')) | ||
| 134 | - .fontWeight(FontWeight.Medium) | 133 | + .fontSize($r('app.float.font_size_14')) |
| 134 | + .fontWeight(400) | ||
| 135 | .textAlign(TextAlign.Center) | 135 | .textAlign(TextAlign.Center) |
| 136 | .align(Alignment.Bottom) | 136 | .align(Alignment.Bottom) |
| 137 | .maxLines(1) | 137 | .maxLines(1) |
| 1 | -import { NetworkUtil, Logger, NetworkType, SPHelper, WindowModel} from 'wdKit'; | 1 | +import { NetworkUtil, Logger, NetworkType, SPHelper, WindowModel, StringUtils} from 'wdKit'; |
| 2 | import { ResponseDTO } from 'wdNetwork'; | 2 | import { ResponseDTO } from 'wdNetwork'; |
| 3 | import { | 3 | import { |
| 4 | ContentDetailDTO, | 4 | ContentDetailDTO, |
| @@ -102,25 +102,41 @@ export struct MultiPictureDetailPageComponent { | @@ -102,25 +102,41 @@ export struct MultiPictureDetailPageComponent { | ||
| 102 | Row({ space: 8 }) { | 102 | Row({ space: 8 }) { |
| 103 | if (this.getImgUrl()){ | 103 | if (this.getImgUrl()){ |
| 104 | Row() { | 104 | Row() { |
| 105 | - Image(this.getImgUrl()) | ||
| 106 | - .borderRadius(24) | ||
| 107 | - .aspectRatio(1) | ||
| 108 | - .border({ width: 1, color: Color.White, style: BorderStyle.Solid }) | ||
| 109 | - .width(36) | ||
| 110 | - .height(36) | ||
| 111 | - .objectFit(ImageFit.Fill) | ||
| 112 | - .interpolation(ImageInterpolation.High) | ||
| 113 | - .onClick(() => { | ||
| 114 | - if (this.contentDetailData.rmhInfo?.cnMainControl === 1) { | ||
| 115 | - // 号主页 | ||
| 116 | - const params: Params = { | ||
| 117 | - creatorId: this.contentDetailData.rmhInfo.rmhId, | ||
| 118 | - pageID: '' | ||
| 119 | - } | ||
| 120 | - WDRouterRule.jumpWithPage(WDRouterPage.peopleShipHomePage, params) | 105 | + Stack() { |
| 106 | + Image(this.getImgUrl()) | ||
| 107 | + .borderRadius(24) | ||
| 108 | + .aspectRatio(1) | ||
| 109 | + .border({ width: 1, color: Color.White, style: BorderStyle.Solid }) | ||
| 110 | + .width(36) | ||
| 111 | + .height(36) | ||
| 112 | + .objectFit(ImageFit.Fill) | ||
| 113 | + .interpolation(ImageInterpolation.High) | ||
| 114 | + if(!StringUtils.isEmpty(this.contentDetailData.rmhInfo?.authIcon)){ | ||
| 115 | + Stack() { | ||
| 116 | + Image(this.contentDetailData.rmhInfo?.authIcon) | ||
| 117 | + .width($r('app.float.vp_13')) | ||
| 118 | + .height($r('app.float.vp_13')) | ||
| 119 | + .objectFit(ImageFit.Cover) | ||
| 121 | } | 120 | } |
| 121 | + .width(36) | ||
| 122 | + .height(36) | ||
| 123 | + .alignContent(Alignment.BottomEnd) | ||
| 124 | + } | ||
| 125 | + } | ||
| 126 | + .width(36) | ||
| 127 | + .height(36) | ||
| 128 | + .alignContent(Alignment.Center) | ||
| 129 | + .onClick(() => { | ||
| 130 | + if (this.contentDetailData.rmhInfo?.cnMainControl === 1) { | ||
| 131 | + // 号主页 | ||
| 132 | + const params: Params = { | ||
| 133 | + creatorId: this.contentDetailData.rmhInfo.rmhId, | ||
| 134 | + pageID: '' | ||
| 135 | + } | ||
| 136 | + WDRouterRule.jumpWithPage(WDRouterPage.peopleShipHomePage, params) | ||
| 137 | + } | ||
| 122 | 138 | ||
| 123 | - }) | 139 | + }) |
| 124 | } | 140 | } |
| 125 | .width('13%') | 141 | .width('13%') |
| 126 | .height('100%') | 142 | .height('100%') |
| @@ -380,11 +396,11 @@ export struct MultiPictureDetailPageComponent { | @@ -380,11 +396,11 @@ export struct MultiPictureDetailPageComponent { | ||
| 380 | } | 396 | } |
| 381 | this.netStatus = undefined | 397 | this.netStatus = undefined |
| 382 | this.contentDetailData = resDTO.data?.[0]; | 398 | this.contentDetailData = resDTO.data?.[0]; |
| 383 | - if (this.contentDetailData.rmhPlatform == 1) { | ||
| 384 | - WindowModel.shared.setWindowSystemBarProperties({ | ||
| 385 | - statusBarContentColor: '#ffffff', | ||
| 386 | - }) | ||
| 387 | - } | 399 | + // if (this.contentDetailData.rmhPlatform == 1) { |
| 400 | + // WindowModel.shared.setWindowSystemBarProperties({ | ||
| 401 | + // statusBarContentColor: '#ffffff', | ||
| 402 | + // }) | ||
| 403 | + // } | ||
| 388 | if (this.contentDetailData?.openComment) { | 404 | if (this.contentDetailData?.openComment) { |
| 389 | this.publishCommentModel.targetId = String(this.contentDetailData?.newsId || '') | 405 | this.publishCommentModel.targetId = String(this.contentDetailData?.newsId || '') |
| 390 | this.publishCommentModel.targetRelId = String(this.contentDetailData?.reLInfo?.relId) | 406 | this.publishCommentModel.targetRelId = String(this.contentDetailData?.reLInfo?.relId) |
| @@ -24,6 +24,9 @@ export struct Card10Component { | @@ -24,6 +24,9 @@ export struct Card10Component { | ||
| 24 | .maxLines(2) | 24 | .maxLines(2) |
| 25 | .textOverflow({ overflow: TextOverflow.Ellipsis }) | 25 | .textOverflow({ overflow: TextOverflow.Ellipsis }) |
| 26 | .margin({ bottom: 19 }) | 26 | .margin({ bottom: 19 }) |
| 27 | + .onClick((event: ClickEvent) => { | ||
| 28 | + ProcessUtils.processPage(this.contentDTO) | ||
| 29 | + }) | ||
| 27 | } | 30 | } |
| 28 | // 大图 | 31 | // 大图 |
| 29 | Stack() { | 32 | Stack() { |
| 1 | import MinePageMoreFunctionModel from '../../viewmodel/MinePageMoreFunctionModel' | 1 | import MinePageMoreFunctionModel from '../../viewmodel/MinePageMoreFunctionModel' |
| 2 | import { WDRouterRule, WDRouterPage } from 'wdRouter' | 2 | import { WDRouterRule, WDRouterPage } from 'wdRouter' |
| 3 | import { Params } from 'wdBean'; | 3 | import { Params } from 'wdBean'; |
| 4 | +import { ToastUtils } from 'wdKit/Index'; | ||
| 4 | 5 | ||
| 5 | @Component | 6 | @Component |
| 6 | export default struct MinePageMoreFunctionUI { | 7 | export default struct MinePageMoreFunctionUI { |
| @@ -75,6 +76,8 @@ export default struct MinePageMoreFunctionUI { | @@ -75,6 +76,8 @@ export default struct MinePageMoreFunctionUI { | ||
| 75 | WDRouterRule.jumpWithPage(WDRouterPage.settingPage, params) | 76 | WDRouterRule.jumpWithPage(WDRouterPage.settingPage, params) |
| 76 | }else if (item.msg == "关于") { // 关于 | 77 | }else if (item.msg == "关于") { // 关于 |
| 77 | WDRouterRule.jumpWithPage(WDRouterPage.aboutPage) | 78 | WDRouterRule.jumpWithPage(WDRouterPage.aboutPage) |
| 79 | + }else if (item.msg == "意见反馈") { // 关于 | ||
| 80 | + ToastUtils.shortToast("待开发") | ||
| 78 | } | 81 | } |
| 79 | }) | 82 | }) |
| 80 | .height('117lpx') | 83 | .height('117lpx') |
| 1 | import { Action, ContentDTO, Params } from 'wdBean'; | 1 | import { Action, ContentDTO, Params } from 'wdBean'; |
| 2 | import { CommonConstants, ConfigConstants, ScreenType } from 'wdConstant'; | 2 | import { CommonConstants, ConfigConstants, ScreenType } from 'wdConstant'; |
| 3 | -import { Logger } from 'wdKit'; | 3 | +import { Logger, ToastUtils } from 'wdKit'; |
| 4 | import { CompUtils } from '../../utils/CompUtils'; | 4 | import { CompUtils } from '../../utils/CompUtils'; |
| 5 | import { ProcessUtils, WDRouterRule } from 'wdRouter'; | 5 | import { ProcessUtils, WDRouterRule } from 'wdRouter'; |
| 6 | 6 | ||
| @@ -475,7 +475,7 @@ export struct PaperSingleColumn999CardView { | @@ -475,7 +475,7 @@ export struct PaperSingleColumn999CardView { | ||
| 475 | } | 475 | } |
| 476 | .justifyContent(FlexAlign.Start) | 476 | .justifyContent(FlexAlign.Start) |
| 477 | 477 | ||
| 478 | - Image($r('app.media.icon_forward')) | 478 | + Image($r('app.media.icon_paper_share')) |
| 479 | .width(16) | 479 | .width(16) |
| 480 | .height(16) | 480 | .height(16) |
| 481 | .margin({ left: 10, right: 22, top: 10, bottom: 10 }) | 481 | .margin({ left: 10, right: 22, top: 10, bottom: 10 }) |
| @@ -483,6 +483,9 @@ export struct PaperSingleColumn999CardView { | @@ -483,6 +483,9 @@ export struct PaperSingleColumn999CardView { | ||
| 483 | center: { anchor: '__container__', align: VerticalAlign.Center }, | 483 | center: { anchor: '__container__', align: VerticalAlign.Center }, |
| 484 | right: { anchor: '__container__', align: HorizontalAlign.End } | 484 | right: { anchor: '__container__', align: HorizontalAlign.End } |
| 485 | }) | 485 | }) |
| 486 | + .onClick(() => { | ||
| 487 | + ToastUtils.showToast('分享为公共方法,待开发', 1000) | ||
| 488 | + }) | ||
| 486 | }.width(CommonConstants.FULL_PARENT) | 489 | }.width(CommonConstants.FULL_PARENT) |
| 487 | .justifyContent(FlexAlign.SpaceBetween) | 490 | .justifyContent(FlexAlign.SpaceBetween) |
| 488 | } | 491 | } |
| @@ -214,20 +214,23 @@ struct ChannelDialog { | @@ -214,20 +214,23 @@ struct ChannelDialog { | ||
| 214 | Flex({ justifyContent: FlexAlign.SpaceBetween }) { | 214 | Flex({ justifyContent: FlexAlign.SpaceBetween }) { |
| 215 | ForEach(this.homeChannelList, (item: TopNavDTO, index: number) => { | 215 | ForEach(this.homeChannelList, (item: TopNavDTO, index: number) => { |
| 216 | Stack() { | 216 | Stack() { |
| 217 | - Image(item.channelId === this.indexSettingChannelId ? $r('app.media.index_setting_button_active') : $r('app.media.index_setting_button')) | 217 | + Image(item.channelId === this.indexSettingChannelId ? $r('app.media.index_setting_button_active') : |
| 218 | + $r('app.media.index_setting_button')) | ||
| 218 | .objectFit(ImageFit.Auto) | 219 | .objectFit(ImageFit.Auto) |
| 219 | .rotate({ | 220 | .rotate({ |
| 220 | angle: index === 1 ? 180 : 0 | 221 | angle: index === 1 ? 180 : 0 |
| 221 | }) | 222 | }) |
| 222 | Row() { | 223 | Row() { |
| 223 | if (index === 0) { | 224 | if (index === 0) { |
| 224 | - Image(item.channelId === this.indexSettingChannelId ? $r('app.media.recommend_icon') : $r('app.media.recommend_icon_active')) | 225 | + Image(item.channelId === this.indexSettingChannelId ? $r('app.media.recommend_icon') : |
| 226 | + $r('app.media.recommend_icon_active')) | ||
| 225 | .width(20) | 227 | .width(20) |
| 226 | } | 228 | } |
| 227 | Text(item.name) | 229 | Text(item.name) |
| 228 | .textAlign(TextAlign.Center) | 230 | .textAlign(TextAlign.Center) |
| 229 | .fontSize(16) | 231 | .fontSize(16) |
| 230 | .fontColor(item.channelId === this.indexSettingChannelId ? '#ffffff' : '#ED2800') | 232 | .fontColor(item.channelId === this.indexSettingChannelId ? '#ffffff' : '#ED2800') |
| 233 | + | ||
| 231 | } | 234 | } |
| 232 | .width('100%') | 235 | .width('100%') |
| 233 | .justifyContent(FlexAlign.Center) | 236 | .justifyContent(FlexAlign.Center) |
| @@ -275,8 +278,8 @@ struct ChannelDialog { | @@ -275,8 +278,8 @@ struct ChannelDialog { | ||
| 275 | GridItem() { | 278 | GridItem() { |
| 276 | Row() { | 279 | Row() { |
| 277 | Text(item.name) | 280 | Text(item.name) |
| 278 | - .fontSize(14) | ||
| 279 | - .fontColor(this.currentTopNavSelectedItem.channelId === item.channelId ? '#ED2800' : (item.headlinesOn === 1 || item.movePermitted === 0 ? '#999999' : '#222222')) | 281 | + .fontSize(14)// .fontColor(this.currentTopNavSelectedItem.channelId === item.channelId ? '#ED2800' : (item.headlinesOn === 1 || item.movePermitted === 0 ? '#999999' : '#222222')) |
| 282 | + .fontColor(item.headlinesOn === 1 || item.movePermitted === 0 ? '#999999' : '#222222') | ||
| 280 | 283 | ||
| 281 | if (this.isEditIng && item.delPermitted === 1 && item.movePermitted === 1) { | 284 | if (this.isEditIng && item.delPermitted === 1 && item.movePermitted === 1) { |
| 282 | Image($r('app.media.icon_audio_close')) | 285 | Image($r('app.media.icon_audio_close')) |
| @@ -292,7 +295,7 @@ struct ChannelDialog { | @@ -292,7 +295,7 @@ struct ChannelDialog { | ||
| 292 | .width('23%') | 295 | .width('23%') |
| 293 | .height(40) | 296 | .height(40) |
| 294 | .border({ | 297 | .border({ |
| 295 | - width: item.headlinesOn === 1 || item.movePermitted === 0 ? 0 : 1, | 298 | + width: item.headlinesOn === 1 || item.movePermitted === 0 ? 0 : 1, |
| 296 | color: '#EDEDED', | 299 | color: '#EDEDED', |
| 297 | radius: 3 | 300 | radius: 3 |
| 298 | }) | 301 | }) |
| @@ -319,7 +322,11 @@ struct ChannelDialog { | @@ -319,7 +322,11 @@ struct ChannelDialog { | ||
| 319 | } | 322 | } |
| 320 | } | 323 | } |
| 321 | }), | 324 | }), |
| 322 | - PanGesture({ fingers: 1, direction: this.isEditIng ? PanDirection.All:PanDirection.None, distance: 0 }) | 325 | + PanGesture({ |
| 326 | + fingers: 1, | ||
| 327 | + direction: this.isEditIng ? PanDirection.All : PanDirection.None, | ||
| 328 | + distance: 0 | ||
| 329 | + }) | ||
| 323 | .onActionStart((event: GestureEvent) => { | 330 | .onActionStart((event: GestureEvent) => { |
| 324 | this.dragItem = item.num | 331 | this.dragItem = item.num |
| 325 | this.dragRefOffsetX = 0 | 332 | this.dragRefOffsetX = 0 |
| @@ -449,7 +456,12 @@ struct ChannelDialog { | @@ -449,7 +456,12 @@ struct ChannelDialog { | ||
| 449 | }.width('100%').height('100%') | 456 | }.width('100%').height('100%') |
| 450 | .scrollBar(BarState.Off) | 457 | .scrollBar(BarState.Off) |
| 451 | } | 458 | } |
| 452 | - .padding({ top: 40, right: 15, bottom: 40, left: 15 }) | 459 | + .padding({ |
| 460 | + top: 40, | ||
| 461 | + right: 15, | ||
| 462 | + bottom: 40, | ||
| 463 | + left: 15 | ||
| 464 | + }) | ||
| 453 | .backgroundColor('#ffffff') | 465 | .backgroundColor('#ffffff') |
| 454 | } | 466 | } |
| 455 | } | 467 | } |
| @@ -197,7 +197,7 @@ export struct TopNavigationComponent { | @@ -197,7 +197,7 @@ export struct TopNavigationComponent { | ||
| 197 | .width(18) | 197 | .width(18) |
| 198 | .height(18) | 198 | .height(18) |
| 199 | Text('早晚报') | 199 | Text('早晚报') |
| 200 | - .fontColor($r('app.color.color_B0B0B0')) | 200 | + .fontColor("#666666") |
| 201 | .fontSize($r('app.float.font_size_13')) | 201 | .fontSize($r('app.float.font_size_13')) |
| 202 | } | 202 | } |
| 203 | .alignItems(VerticalAlign.Center) | 203 | .alignItems(VerticalAlign.Center) |
| @@ -385,11 +385,12 @@ export struct PeopleShipMainComponent { | @@ -385,11 +385,12 @@ export struct PeopleShipMainComponent { | ||
| 385 | }) | 385 | }) |
| 386 | Logger.debug('PeopleShipMainComponent', `一键关注接口参数: ${JSON.stringify(objects)}`); | 386 | Logger.debug('PeopleShipMainComponent', `一键关注接口参数: ${JSON.stringify(objects)}`); |
| 387 | let batchInfo = await PeopleShipMainViewModel.getAttentionBatchInfo(objects) | 387 | let batchInfo = await PeopleShipMainViewModel.getAttentionBatchInfo(objects) |
| 388 | + this.oneKeyFollow = false | ||
| 388 | if (batchInfo.code === 0 || batchInfo.code.toString() === "0") { | 389 | if (batchInfo.code === 0 || batchInfo.code.toString() === "0") { |
| 389 | this.getData() | 390 | this.getData() |
| 390 | } | 391 | } |
| 391 | } catch (exception) { | 392 | } catch (exception) { |
| 392 | - | 393 | + this.oneKeyFollow = false |
| 393 | } | 394 | } |
| 394 | } | 395 | } |
| 395 | 396 |
| @@ -67,14 +67,15 @@ export struct PeopleShipHomePageNavComponent { | @@ -67,14 +67,15 @@ export struct PeopleShipHomePageNavComponent { | ||
| 67 | Row(){ | 67 | Row(){ |
| 68 | Image($r('app.media.people_ship_top_add')) | 68 | Image($r('app.media.people_ship_top_add')) |
| 69 | .objectFit(ImageFit.Auto) | 69 | .objectFit(ImageFit.Auto) |
| 70 | - .width('12vp') | ||
| 71 | - .height('12pv') | 70 | + .width('13vp') |
| 71 | + .height('13pv') | ||
| 72 | .margin({ | 72 | .margin({ |
| 73 | - right: '2vp' | 73 | + right: '3vp' |
| 74 | }) | 74 | }) |
| 75 | Text('关注') | 75 | Text('关注') |
| 76 | .fontSize($r('app.float.vp_12')) | 76 | .fontSize($r('app.float.vp_12')) |
| 77 | .fontColor(Color.White) | 77 | .fontColor(Color.White) |
| 78 | + .height('100%') | ||
| 78 | } | 79 | } |
| 79 | .alignSelf(ItemAlign.Center) | 80 | .alignSelf(ItemAlign.Center) |
| 80 | .justifyContent(FlexAlign.Center) | 81 | .justifyContent(FlexAlign.Center) |
| @@ -54,7 +54,7 @@ export struct FirstTabTopSearchComponent { | @@ -54,7 +54,7 @@ export struct FirstTabTopSearchComponent { | ||
| 54 | ForEach(this.searchTextData, (item: string, index: number) => { | 54 | ForEach(this.searchTextData, (item: string, index: number) => { |
| 55 | Text(item) | 55 | Text(item) |
| 56 | .fontWeight(400) | 56 | .fontWeight(400) |
| 57 | - .fontColor($r('app.color.color_B0B0B0')) | 57 | + .fontColor("#666666") |
| 58 | .fontSize($r('app.float.font_size_13')) | 58 | .fontSize($r('app.float.font_size_13')) |
| 59 | .textAlign(TextAlign.Start) | 59 | .textAlign(TextAlign.Start) |
| 60 | .maxLines(1) | 60 | .maxLines(1) |
| @@ -42,7 +42,7 @@ export struct SearchHistoryComponent{ | @@ -42,7 +42,7 @@ export struct SearchHistoryComponent{ | ||
| 42 | Row(){ | 42 | Row(){ |
| 43 | Text("搜索历史") | 43 | Text("搜索历史") |
| 44 | .textAlign(TextAlign.Center) | 44 | .textAlign(TextAlign.Center) |
| 45 | - .fontWeight('400lpx') | 45 | + .fontWeight(FontWeight.Regular) |
| 46 | .fontSize('27lpx') | 46 | .fontSize('27lpx') |
| 47 | .lineHeight('38lpx') | 47 | .lineHeight('38lpx') |
| 48 | .fontColor($r('app.color.color_999999')) | 48 | .fontColor($r('app.color.color_999999')) |
| @@ -68,7 +68,7 @@ export struct SearchHistoryComponent{ | @@ -68,7 +68,7 @@ export struct SearchHistoryComponent{ | ||
| 68 | Text(`${item.searchContent}`) | 68 | Text(`${item.searchContent}`) |
| 69 | .fontColor($r('app.color.color_222222')) | 69 | .fontColor($r('app.color.color_222222')) |
| 70 | .fontSize('31lpx') | 70 | .fontSize('31lpx') |
| 71 | - .fontWeight('400lpx') | 71 | + .fontWeight(FontWeight.Regular) |
| 72 | .lineHeight('46lpx') | 72 | .lineHeight('46lpx') |
| 73 | .maxLines(1) | 73 | .maxLines(1) |
| 74 | .constraintSize({maxWidth:index%2 === 0?'270lpx':'230lpx'}) | 74 | .constraintSize({maxWidth:index%2 === 0?'270lpx':'230lpx'}) |
| @@ -68,7 +68,7 @@ export struct SearchHotsComponent{ | @@ -68,7 +68,7 @@ export struct SearchHotsComponent{ | ||
| 68 | .height('31lpx') | 68 | .height('31lpx') |
| 69 | .fontColor($r('app.color.color_666666')) | 69 | .fontColor($r('app.color.color_666666')) |
| 70 | .fontSize('27lpx') | 70 | .fontSize('27lpx') |
| 71 | - .fontWeight('400lpx') | 71 | + .fontWeight(FontWeight.Regular) |
| 72 | .lineHeight('31lpx') | 72 | .lineHeight('31lpx') |
| 73 | .margin({right:'12lpx'}) | 73 | .margin({right:'12lpx'}) |
| 74 | } | 74 | } |
| @@ -77,7 +77,7 @@ export struct SearchHotsComponent{ | @@ -77,7 +77,7 @@ export struct SearchHotsComponent{ | ||
| 77 | .fontColor($r('app.color.color_222222')) | 77 | .fontColor($r('app.color.color_222222')) |
| 78 | .fontSize('31lpx') | 78 | .fontSize('31lpx') |
| 79 | .maxLines(1) | 79 | .maxLines(1) |
| 80 | - .fontWeight('400lpx') | 80 | + .fontWeight(FontWeight.Regular) |
| 81 | .lineHeight('42lpx') | 81 | .lineHeight('42lpx') |
| 82 | }.layoutWeight(1) | 82 | }.layoutWeight(1) |
| 83 | 83 |
| 1 | import { ToastUtils, Logger, NumberFormatterUtils, SPHelper } from 'wdKit'; | 1 | import { ToastUtils, Logger, NumberFormatterUtils, SPHelper } from 'wdKit'; |
| 2 | +import promptAction from '@ohos.promptAction'; | ||
| 2 | import { | 3 | import { |
| 3 | InputMethodProperty, | 4 | InputMethodProperty, |
| 4 | batchLikeAndCollectResult, | 5 | batchLikeAndCollectResult, |
| @@ -41,7 +42,7 @@ const TAG = 'OperRowListView'; | @@ -41,7 +42,7 @@ const TAG = 'OperRowListView'; | ||
| 41 | @Preview | 42 | @Preview |
| 42 | @Component | 43 | @Component |
| 43 | export struct OperRowListView { | 44 | export struct OperRowListView { |
| 44 | - @Prop contentDetailData: ContentDetailDTO // 稿件详情 | 45 | + @Prop @Watch('onDetailUpdated') contentDetailData: ContentDetailDTO // 稿件详情 |
| 45 | @State operationButtonList: string[] = ['comment', 'collect', 'share'] // 组件展示条件 | 46 | @State operationButtonList: string[] = ['comment', 'collect', 'share'] // 组件展示条件 |
| 46 | @ObjectLink publishCommentModel: publishCommentModel | 47 | @ObjectLink publishCommentModel: publishCommentModel |
| 47 | // @State contentDetailData: ContentDetailDTO = {} as ContentDetailDTO | 48 | // @State contentDetailData: ContentDetailDTO = {} as ContentDetailDTO |
| @@ -49,9 +50,12 @@ export struct OperRowListView { | @@ -49,9 +50,12 @@ export struct OperRowListView { | ||
| 49 | @State newsStatusOfUser: batchLikeAndCollectResult | undefined = undefined // 点赞、收藏状态 | 50 | @State newsStatusOfUser: batchLikeAndCollectResult | undefined = undefined // 点赞、收藏状态 |
| 50 | @State likeBean: Record<string, string> = {} | 51 | @State likeBean: Record<string, string> = {} |
| 51 | @State audioUrl: string= '' | 52 | @State audioUrl: string= '' |
| 53 | + @State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0 | ||
| 52 | needLike: boolean = true | 54 | needLike: boolean = true |
| 53 | 55 | ||
| 54 | - async aboutToAppear() { | 56 | + // async aboutToAppear() { |
| 57 | + async onDetailUpdated() { | ||
| 58 | + if (!this.contentDetailData) return | ||
| 55 | const user_id = await SPHelper.default.get(SpConstants.USER_ID, '') | 59 | const user_id = await SPHelper.default.get(SpConstants.USER_ID, '') |
| 56 | if (user_id) { | 60 | if (user_id) { |
| 57 | this.getInteractDataStatus() | 61 | this.getInteractDataStatus() |
| @@ -98,20 +102,22 @@ export struct OperRowListView { | @@ -98,20 +102,22 @@ export struct OperRowListView { | ||
| 98 | }) | 102 | }) |
| 99 | .width(42) | 103 | .width(42) |
| 100 | 104 | ||
| 101 | - ForEach(this.operationButtonList, (item: string, index: number) => { | ||
| 102 | - if (item == 'comment') { | ||
| 103 | - this.builderComment() | ||
| 104 | - } else if (item == 'like' && this.needLike) { | ||
| 105 | - this.builderLike() | ||
| 106 | - } else if (item == 'collect') { | ||
| 107 | - this.builderCollect() | ||
| 108 | - } else if (item == 'listen') { | ||
| 109 | - this.builderListen() | ||
| 110 | - } else if (item == 'share') { | ||
| 111 | - this.builderShare() | ||
| 112 | - } else { | ||
| 113 | - } | ||
| 114 | - }) | 105 | + if (this.contentDetailData) { |
| 106 | + ForEach(this.operationButtonList, (item: string, index: number) => { | ||
| 107 | + if (item == 'comment') { | ||
| 108 | + this.builderComment() | ||
| 109 | + } else if (item == 'like' && this.needLike) { | ||
| 110 | + this.builderLike() | ||
| 111 | + } else if (item == 'collect') { | ||
| 112 | + this.builderCollect() | ||
| 113 | + } else if (item == 'listen') { | ||
| 114 | + this.builderListen() | ||
| 115 | + } else if (item == 'share') { | ||
| 116 | + this.builderShare() | ||
| 117 | + } else { | ||
| 118 | + } | ||
| 119 | + }) | ||
| 120 | + } | ||
| 115 | } | 121 | } |
| 116 | .width('100%') | 122 | .width('100%') |
| 117 | .justifyContent(FlexAlign.Start) | 123 | .justifyContent(FlexAlign.Start) |
| @@ -120,6 +126,7 @@ export struct OperRowListView { | @@ -120,6 +126,7 @@ export struct OperRowListView { | ||
| 120 | .backgroundColor(Color.White) | 126 | .backgroundColor(Color.White) |
| 121 | .padding({ | 127 | .padding({ |
| 122 | top: 10, | 128 | top: 10, |
| 129 | + // bottom: `${this.bottomSafeHeight}px` | ||
| 123 | bottom: 50 | 130 | bottom: 50 |
| 124 | }) | 131 | }) |
| 125 | } | 132 | } |
| @@ -266,6 +273,9 @@ export struct OperRowListView { | @@ -266,6 +273,9 @@ export struct OperRowListView { | ||
| 266 | PageRepository.postExecuteCollectRecord(params).then(res => { | 273 | PageRepository.postExecuteCollectRecord(params).then(res => { |
| 267 | if (this.newsStatusOfUser) { | 274 | if (this.newsStatusOfUser) { |
| 268 | this.newsStatusOfUser.collectStatus = this.newsStatusOfUser?.collectStatus === 1 ? 0 : 1 | 275 | this.newsStatusOfUser.collectStatus = this.newsStatusOfUser?.collectStatus === 1 ? 0 : 1 |
| 276 | + if(this.newsStatusOfUser.collectStatus === 1){ | ||
| 277 | + promptAction.showToast({ message: '收藏成功' }) | ||
| 278 | + } | ||
| 269 | this.queryContentInteractCount() | 279 | this.queryContentInteractCount() |
| 270 | } | 280 | } |
| 271 | }) | 281 | }) |
| @@ -95,7 +95,7 @@ class MinePageDatasModel{ | @@ -95,7 +95,7 @@ class MinePageDatasModel{ | ||
| 95 | } | 95 | } |
| 96 | // this.moreData.push(new MinePageMoreFunctionModel("扫一扫",$r('app.media.mine_scan'))) | 96 | // this.moreData.push(new MinePageMoreFunctionModel("扫一扫",$r('app.media.mine_scan'))) |
| 97 | // this.moreData.push(new MinePageMoreFunctionModel("我的奖品",$r('app.media.mine_mygift'))) | 97 | // this.moreData.push(new MinePageMoreFunctionModel("我的奖品",$r('app.media.mine_mygift'))) |
| 98 | - // this.moreData.push(new MinePageMoreFunctionModel("意见反馈",$r('app.media.mine_suggest'))) | 98 | + this.moreData.push(new MinePageMoreFunctionModel("意见反馈",$r('app.media.mine_suggest'))) |
| 99 | this.moreData.push(new MinePageMoreFunctionModel("设置",$r('app.media.mine_setting'))) | 99 | this.moreData.push(new MinePageMoreFunctionModel("设置",$r('app.media.mine_setting'))) |
| 100 | this.moreData.push(new MinePageMoreFunctionModel("关于",$r('app.media.mine_about'))) | 100 | this.moreData.push(new MinePageMoreFunctionModel("关于",$r('app.media.mine_about'))) |
| 101 | return this.moreData | 101 | return this.moreData |
No preview for this file type
2.11 KB
| @@ -429,7 +429,7 @@ | @@ -429,7 +429,7 @@ | ||
| 429 | </div> | 429 | </div> |
| 430 | 430 | ||
| 431 | <!-- 分享 --> | 431 | <!-- 分享 --> |
| 432 | - <div class="share" v-if="shareOpen"> | 432 | + <div class="share" v-if="false"> |
| 433 | <div | 433 | <div |
| 434 | v-if="details.shareInfo.sharePosterOpen == 1" | 434 | v-if="details.shareInfo.sharePosterOpen == 1" |
| 435 | class="sharePoster share-wrapper share-box" | 435 | class="sharePoster share-wrapper share-box" |
| @@ -101,7 +101,7 @@ export struct VideoChannelDetail { | @@ -101,7 +101,7 @@ export struct VideoChannelDetail { | ||
| 101 | openFullScreen() { | 101 | openFullScreen() { |
| 102 | WindowModel.shared.setWindowSystemBarProperties({ | 102 | WindowModel.shared.setWindowSystemBarProperties({ |
| 103 | statusBarContentColor: '#ffffff', | 103 | statusBarContentColor: '#ffffff', |
| 104 | - statusBarColor: '#000000', | 104 | + // statusBarColor: '#000000', |
| 105 | // navigationBarColor: '#000000', | 105 | // navigationBarColor: '#000000', |
| 106 | // navigationBarContentColor: '#ffffff' | 106 | // navigationBarContentColor: '#ffffff' |
| 107 | }) | 107 | }) |
| @@ -116,7 +116,7 @@ export struct VideoChannelDetail { | @@ -116,7 +116,7 @@ export struct VideoChannelDetail { | ||
| 116 | closeFullScreen() { | 116 | closeFullScreen() { |
| 117 | WindowModel.shared.setWindowSystemBarProperties({ | 117 | WindowModel.shared.setWindowSystemBarProperties({ |
| 118 | statusBarContentColor: '#000000', | 118 | statusBarContentColor: '#000000', |
| 119 | - statusBarColor: '#ffffff', | 119 | + // statusBarColor: '#ffffff', |
| 120 | // navigationBarColor: '#0x66000000', | 120 | // navigationBarColor: '#0x66000000', |
| 121 | // navigationBarContentColor: '#0xE5FFFFFF' | 121 | // navigationBarContentColor: '#0xE5FFFFFF' |
| 122 | 122 |
| @@ -170,7 +170,7 @@ export struct PlayerRightView { | @@ -170,7 +170,7 @@ export struct PlayerRightView { | ||
| 170 | .width(58) | 170 | .width(58) |
| 171 | .position({ x: '100%', y: '100%' }) | 171 | .position({ x: '100%', y: '100%' }) |
| 172 | .markAnchor({ x: '100%', y: '100%' }) | 172 | .markAnchor({ x: '100%', y: '100%' }) |
| 173 | - .padding({ bottom: 72, right: 10 }) | 173 | + .padding({ bottom: 0, right: 10 }) |
| 174 | .visibility(this.isOpenDetail || this.isDragging ? Visibility.None : Visibility.Visible) | 174 | .visibility(this.isOpenDetail || this.isDragging ? Visibility.None : Visibility.Visible) |
| 175 | 175 | ||
| 176 | } | 176 | } |
| @@ -229,7 +229,8 @@ export struct PlayerRightView { | @@ -229,7 +229,8 @@ export struct PlayerRightView { | ||
| 229 | } | 229 | } |
| 230 | } else if (this.likesStyle === 3) { | 230 | } else if (this.likesStyle === 3) { |
| 231 | return { | 231 | return { |
| 232 | - url: this.newsStatusOfUser.likeStatus === '1' ? $r(`app.media.ic_candle_check`) : $r(`app.media.ic_candle_uncheck`), | 232 | + url: this.newsStatusOfUser.likeStatus === '1' ? $r(`app.media.ic_candle_check`) : |
| 233 | + $r(`app.media.ic_candle_uncheck`), | ||
| 233 | name: '默哀' | 234 | name: '默哀' |
| 234 | } | 235 | } |
| 235 | } | 236 | } |
| @@ -239,13 +240,17 @@ export struct PlayerRightView { | @@ -239,13 +240,17 @@ export struct PlayerRightView { | ||
| 239 | } | 240 | } |
| 240 | 241 | ||
| 241 | transNum2String(name: 'likeNum' | 'collectNum' | 'commentNum') { | 242 | transNum2String(name: 'likeNum' | 'collectNum' | 'commentNum') { |
| 242 | - console.log(TAG, 'transNum2String', this.interactData.likeNum, this.interactData.collectNum, this.interactData.commentNum) | 243 | + console.log(TAG, 'transNum2String', this.interactData.likeNum, this.interactData.collectNum, |
| 244 | + this.interactData.commentNum) | ||
| 243 | if (name === 'likeNum') { | 245 | if (name === 'likeNum') { |
| 244 | - return this.interactData.likeNum != 0 ? NumberFormatterUtils.formatNumberWithWan(this.interactData.likeNum || '') : '' | 246 | + return this.interactData.likeNum != 0 ? |
| 247 | + NumberFormatterUtils.formatNumberWithWan(this.interactData.likeNum || '') : '' | ||
| 245 | } else if (name === 'collectNum') { | 248 | } else if (name === 'collectNum') { |
| 246 | - return this.interactData.collectNum != 0 ? NumberFormatterUtils.formatNumberWithWan(this.interactData.collectNum || '') : '' | 249 | + return this.interactData.collectNum != 0 ? |
| 250 | + NumberFormatterUtils.formatNumberWithWan(this.interactData.collectNum || '') : '' | ||
| 247 | } else { | 251 | } else { |
| 248 | - return this.interactData.commentNum != 0 ? NumberFormatterUtils.formatNumberWithWan(this.interactData.commentNum || '') : '' | 252 | + return this.interactData.commentNum != 0 ? |
| 253 | + NumberFormatterUtils.formatNumberWithWan(this.interactData.commentNum || '') : '' | ||
| 249 | } | 254 | } |
| 250 | } | 255 | } |
| 251 | 256 | ||
| @@ -282,7 +287,8 @@ export struct PlayerRightView { | @@ -282,7 +287,8 @@ export struct PlayerRightView { | ||
| 282 | @Builder | 287 | @Builder |
| 283 | collectBuilderView() { | 288 | collectBuilderView() { |
| 284 | Column() { | 289 | Column() { |
| 285 | - Image(this.newsStatusOfUser.collectStatus == 1 ? $r(`app.media.ic_collect_check`) : $r(`app.media.ic_collect_uncheck`)) | 290 | + Image(this.newsStatusOfUser.collectStatus == 1 ? $r(`app.media.ic_collect_check`) : |
| 291 | + $r(`app.media.ic_collect_uncheck`)) | ||
| 286 | .width(32) | 292 | .width(32) |
| 287 | .aspectRatio(1) | 293 | .aspectRatio(1) |
| 288 | .onClick(() => { | 294 | .onClick(() => { |
| @@ -25,7 +25,7 @@ export struct PlayerTitleComment { | @@ -25,7 +25,7 @@ export struct PlayerTitleComment { | ||
| 25 | name: this.getName(), | 25 | name: this.getName(), |
| 26 | title: this.getTitle(), | 26 | title: this.getTitle(), |
| 27 | summary: this.getSummary(), | 27 | summary: this.getSummary(), |
| 28 | - isOpen: this.isOpen | 28 | + isOpenDetail: this.isOpen |
| 29 | 29 | ||
| 30 | }), | 30 | }), |
| 31 | autoCancel: false, | 31 | autoCancel: false, |
| @@ -164,9 +164,12 @@ export struct PlayerTitleComment { | @@ -164,9 +164,12 @@ export struct PlayerTitleComment { | ||
| 164 | step: 0.01, | 164 | step: 0.01, |
| 165 | // style: SliderStyle.OutSet | 165 | // style: SliderStyle.OutSet |
| 166 | }) | 166 | }) |
| 167 | - .blockColor(this.status === PlayerConstants.STATUS_START ? Color.Transparent : $r('app.color.play_block_color')) | ||
| 168 | - .trackColor(this.status === PlayerConstants.STATUS_START ? $r('app.color.play_track_color') : $r('app.color.pause_track_color')) | ||
| 169 | - .selectedColor(this.status === PlayerConstants.STATUS_START ? $r('app.color.play_selected_color') : $r('app.color.pause_selected_color')) | 167 | + .blockColor(this.status === PlayerConstants.STATUS_START ? Color.Transparent : |
| 168 | + $r('app.color.play_block_color')) | ||
| 169 | + .trackColor(this.status === PlayerConstants.STATUS_START ? $r('app.color.play_track_color') : | ||
| 170 | + $r('app.color.pause_track_color')) | ||
| 171 | + .selectedColor(this.status === PlayerConstants.STATUS_START ? $r('app.color.play_selected_color') : | ||
| 172 | + $r('app.color.pause_selected_color')) | ||
| 170 | .trackThickness(this.status === PlayerConstants.STATUS_START ? 1 : 4) | 173 | .trackThickness(this.status === PlayerConstants.STATUS_START ? 1 : 4) |
| 171 | .blockStyle({ | 174 | .blockStyle({ |
| 172 | type: this.status === PlayerConstants.STATUS_START ? SliderBlockType.DEFAULT : SliderBlockType.IMAGE, | 175 | type: this.status === PlayerConstants.STATUS_START ? SliderBlockType.DEFAULT : SliderBlockType.IMAGE, |
| @@ -202,7 +205,12 @@ export struct PlayerTitleComment { | @@ -202,7 +205,12 @@ export struct PlayerTitleComment { | ||
| 202 | .margin({ left: 12 }) | 205 | .margin({ left: 12 }) |
| 203 | } | 206 | } |
| 204 | .alignItems(VerticalAlign.Center) | 207 | .alignItems(VerticalAlign.Center) |
| 205 | - .padding({ left: 16, right: 16, top: 11, bottom: 11 }) | 208 | + .padding({ |
| 209 | + left: 16, | ||
| 210 | + right: 16, | ||
| 211 | + top: 11, | ||
| 212 | + bottom: 11 | ||
| 213 | + }) | ||
| 206 | } | 214 | } |
| 207 | 215 | ||
| 208 | } | 216 | } |
| @@ -47,7 +47,7 @@ export struct PlayerTitleView { | @@ -47,7 +47,7 @@ export struct PlayerTitleView { | ||
| 47 | fontSize: 15, | 47 | fontSize: 15, |
| 48 | fontWeight: 400, | 48 | fontWeight: 400, |
| 49 | lineHeight: 20, | 49 | lineHeight: 20, |
| 50 | - constraintWidth: this.windowWidth - 100 - 16 - 22 + 'px', | 50 | + constraintWidth: this.windowWidth - 150 - 16 - 22 + 'px', |
| 51 | 51 | ||
| 52 | }) | 52 | }) |
| 53 | this.titleHeight = info?.height as number || 0 | 53 | this.titleHeight = info?.height as number || 0 |
| @@ -87,7 +87,12 @@ export struct PlayerTitleView { | @@ -87,7 +87,12 @@ export struct PlayerTitleView { | ||
| 87 | */ | 87 | */ |
| 88 | if (this.titleHeight > 200 || this.getSummary()) { | 88 | if (this.titleHeight > 200 || this.getSummary()) { |
| 89 | Text('查看详情 > ') | 89 | Text('查看详情 > ') |
| 90 | - .padding({ left: 6, right: 6, top: 4, bottom: 4 }) | 90 | + .padding({ |
| 91 | + left: 6, | ||
| 92 | + right: 6, | ||
| 93 | + top: 4, | ||
| 94 | + bottom: 4 | ||
| 95 | + }) | ||
| 91 | .borderRadius(2) | 96 | .borderRadius(2) |
| 92 | .backgroundColor('#99636363') | 97 | .backgroundColor('#99636363') |
| 93 | .fontColor(Color.White) | 98 | .fontColor(Color.White) |
| @@ -102,7 +107,7 @@ export struct PlayerTitleView { | @@ -102,7 +107,7 @@ export struct PlayerTitleView { | ||
| 102 | } | 107 | } |
| 103 | 108 | ||
| 104 | } | 109 | } |
| 105 | - .width(this.windowWidth - 100 + 'px') | 110 | + .width(this.windowWidth - 150 + 'px') |
| 106 | .padding({ left: 16, right: 22 }) | 111 | .padding({ left: 16, right: 22 }) |
| 107 | .alignItems(HorizontalAlign.Start) | 112 | .alignItems(HorizontalAlign.Start) |
| 108 | .visibility(this.isOpenDetail || this.isDragging ? Visibility.None : Visibility.Visible) | 113 | .visibility(this.isOpenDetail || this.isDragging ? Visibility.None : Visibility.Visible) |
| @@ -62,7 +62,7 @@ export class HWLocationUtils { | @@ -62,7 +62,7 @@ export class HWLocationUtils { | ||
| 62 | if (requestGrant) { | 62 | if (requestGrant) { |
| 63 | HWLocationUtils.getCurrentLocation() | 63 | HWLocationUtils.getCurrentLocation() |
| 64 | } else { | 64 | } else { |
| 65 | - PermissionUtils.openPermissionsInSystemSettings(context) | 65 | + // PermissionUtils.openPermissionsInSystemSettings(context) |
| 66 | } | 66 | } |
| 67 | } | 67 | } |
| 68 | 68 |
| @@ -2,11 +2,10 @@ import { Logger } from 'wdKit/src/main/ets/utils/Logger' | @@ -2,11 +2,10 @@ import { Logger } from 'wdKit/src/main/ets/utils/Logger' | ||
| 2 | import { LoginInputComponent } from './LoginInputComponent' | 2 | import { LoginInputComponent } from './LoginInputComponent' |
| 3 | import { LoginViewModel } from './LoginViewModel' | 3 | import { LoginViewModel } from './LoginViewModel' |
| 4 | import router from '@ohos.router' | 4 | import router from '@ohos.router' |
| 5 | -import promptAction from '@ohos.promptAction' | ||
| 6 | import { WDRouterRule, WDRouterPage } from 'wdRouter'; | 5 | import { WDRouterRule, WDRouterPage } from 'wdRouter'; |
| 7 | import { SettingPasswordParams } from './SettingPasswordLayout' | 6 | import { SettingPasswordParams } from './SettingPasswordLayout' |
| 8 | import { Router } from '@ohos.arkui.UIContext' | 7 | import { Router } from '@ohos.arkui.UIContext' |
| 9 | -import { EmitterEventId, EmitterUtils, SPHelper, ToastUtils } from 'wdKit/Index' | 8 | +import { CustomToast, EmitterEventId, EmitterUtils, SPHelper, ToastUtils } from 'wdKit/Index' |
| 10 | import { SpConstants } from 'wdConstant/Index' | 9 | import { SpConstants } from 'wdConstant/Index' |
| 11 | import { emitter } from '@kit.BasicServicesKit' | 10 | import { emitter } from '@kit.BasicServicesKit' |
| 12 | 11 | ||
| @@ -31,6 +30,18 @@ struct ForgetPasswordPage { | @@ -31,6 +30,18 @@ struct ForgetPasswordPage { | ||
| 31 | this.sendVerifyCode() | 30 | this.sendVerifyCode() |
| 32 | } | 31 | } |
| 33 | } | 32 | } |
| 33 | + @State toastText:string = "" | ||
| 34 | + dialogToast: CustomDialogController = new CustomDialogController({ | ||
| 35 | + builder: CustomToast({ | ||
| 36 | + msg: this.toastText, | ||
| 37 | + }), | ||
| 38 | + autoCancel: false, | ||
| 39 | + alignment: DialogAlignment.Center, | ||
| 40 | + offset: { dx: 0, dy: -20 }, | ||
| 41 | + gridCount: 1, | ||
| 42 | + customStyle: true, | ||
| 43 | + maskColor:"#00000000" | ||
| 44 | + }) | ||
| 34 | 45 | ||
| 35 | 46 | ||
| 36 | 47 | ||
| @@ -100,11 +111,11 @@ struct ForgetPasswordPage { | @@ -100,11 +111,11 @@ struct ForgetPasswordPage { | ||
| 100 | 111 | ||
| 101 | if(this.pageType == 1){ | 112 | if(this.pageType == 1){ |
| 102 | this.loginViewModel.sendVerifyCodeByToken().then(()=>{ | 113 | this.loginViewModel.sendVerifyCodeByToken().then(()=>{ |
| 103 | - promptAction.showToast({ message: "已发送" }) | 114 | + this.showToastTip("已发送") |
| 104 | this.codeStateSuccess=true | 115 | this.codeStateSuccess=true |
| 105 | this.isCodeSend=false | 116 | this.isCodeSend=false |
| 106 | }).catch((message: string)=>{ | 117 | }).catch((message: string)=>{ |
| 107 | - promptAction.showToast({ message: message }) | 118 | + this.showToastTip(message) |
| 108 | this.codeStateSuccess=false | 119 | this.codeStateSuccess=false |
| 109 | this.isCodeSend=false | 120 | this.isCodeSend=false |
| 110 | }) | 121 | }) |
| @@ -112,12 +123,12 @@ struct ForgetPasswordPage { | @@ -112,12 +123,12 @@ struct ForgetPasswordPage { | ||
| 112 | } | 123 | } |
| 113 | 124 | ||
| 114 | this.loginViewModel.sendVerifyCode(this.phoneContent).then((verifyCode) => { | 125 | this.loginViewModel.sendVerifyCode(this.phoneContent).then((verifyCode) => { |
| 115 | - promptAction.showToast({ message: "已发送" }) | 126 | + this.showToastTip("已发送") |
| 116 | this.codeStateSuccess=true | 127 | this.codeStateSuccess=true |
| 117 | this.isCodeSend=false | 128 | this.isCodeSend=false |
| 118 | Logger.debug(TAG, "sendVerifyCode: " + verifyCode) | 129 | Logger.debug(TAG, "sendVerifyCode: " + verifyCode) |
| 119 | }).catch((message: string)=>{ | 130 | }).catch((message: string)=>{ |
| 120 | - promptAction.showToast({ message: message }) | 131 | + this.showToastTip(message) |
| 121 | this.codeStateSuccess=false | 132 | this.codeStateSuccess=false |
| 122 | this.isCodeSend=false | 133 | this.isCodeSend=false |
| 123 | }) | 134 | }) |
| @@ -146,7 +157,7 @@ struct ForgetPasswordPage { | @@ -146,7 +157,7 @@ struct ForgetPasswordPage { | ||
| 146 | } | 157 | } |
| 147 | WDRouterRule.jumpWithPage(WDRouterPage.settingPasswordPage, params) | 158 | WDRouterRule.jumpWithPage(WDRouterPage.settingPasswordPage, params) |
| 148 | }).catch((message: string)=>{ | 159 | }).catch((message: string)=>{ |
| 149 | - promptAction.showToast({ message: message }) | 160 | + this.showToastTip(message) |
| 150 | }) | 161 | }) |
| 151 | return | 162 | return |
| 152 | } | 163 | } |
| @@ -159,10 +170,10 @@ struct ForgetPasswordPage { | @@ -159,10 +170,10 @@ struct ForgetPasswordPage { | ||
| 159 | } | 170 | } |
| 160 | WDRouterRule.jumpWithReplacePage(WDRouterPage.settingPasswordPage, params) | 171 | WDRouterRule.jumpWithReplacePage(WDRouterPage.settingPasswordPage, params) |
| 161 | 172 | ||
| 162 | - promptAction.showToast({message:"校验成功,准备跳转设置页面"}) | 173 | + this.showToastTip("校验成功,准备跳转设置页面") |
| 163 | Logger.debug(TAG,"校验成功") | 174 | Logger.debug(TAG,"校验成功") |
| 164 | }).catch((error:string)=>{ | 175 | }).catch((error:string)=>{ |
| 165 | - promptAction.showToast({message:error}) | 176 | + this.showToastTip(error) |
| 166 | Logger.debug(TAG,"校验失败") | 177 | Logger.debug(TAG,"校验失败") |
| 167 | }) | 178 | }) |
| 168 | } | 179 | } |
| @@ -217,4 +228,9 @@ struct ForgetPasswordPage { | @@ -217,4 +228,9 @@ struct ForgetPasswordPage { | ||
| 217 | // 发送eventId为1的事件,事件内容为eventData | 228 | // 发送eventId为1的事件,事件内容为eventData |
| 218 | emitter.emit(event, eventData); | 229 | emitter.emit(event, eventData); |
| 219 | } | 230 | } |
| 231 | + | ||
| 232 | + showToastTip(msg:string){ | ||
| 233 | + this.toastText = msg | ||
| 234 | + this.dialogToast.open() | ||
| 235 | + } | ||
| 220 | } | 236 | } |
| 1 | -import { Logger, EmitterEventId, EmitterUtils, DateTimeUtils } from 'wdKit' | 1 | +import { Logger, EmitterEventId, EmitterUtils, DateTimeUtils,CustomToast } from 'wdKit' |
| 2 | import { CustomProtocolDialog } from './CustomProtocolDialog' | 2 | import { CustomProtocolDialog } from './CustomProtocolDialog' |
| 3 | import router from '@ohos.router' | 3 | import router from '@ohos.router' |
| 4 | import { LoginViewModel } from './LoginViewModel' | 4 | import { LoginViewModel } from './LoginViewModel' |
| 5 | import { LoginInputComponent } from './LoginInputComponent' | 5 | import { LoginInputComponent } from './LoginInputComponent' |
| 6 | -import promptAction from '@ohos.promptAction' | ||
| 7 | import { ErrorToastUtils, SPHelper } from 'wdKit' | 6 | import { ErrorToastUtils, SPHelper } from 'wdKit' |
| 8 | import { WDRouterPage } from 'wdRouter/src/main/ets/router/WDRouterPage'; | 7 | import { WDRouterPage } from 'wdRouter/src/main/ets/router/WDRouterPage'; |
| 9 | import { WDRouterRule } from 'wdRouter/src/main/ets/router/WDRouterRule'; | 8 | import { WDRouterRule } from 'wdRouter/src/main/ets/router/WDRouterRule'; |
| @@ -47,6 +46,18 @@ struct LoginPage { | @@ -47,6 +46,18 @@ struct LoginPage { | ||
| 47 | // @State isPasswordSubmit: boolean = false //账户密码状态 是否出发登录 | 46 | // @State isPasswordSubmit: boolean = false //账户密码状态 是否出发登录 |
| 48 | lastTime: number = 0 | 47 | lastTime: number = 0 |
| 49 | @State codeStateSuccess:boolean=false | 48 | @State codeStateSuccess:boolean=false |
| 49 | + @State toastText:string = "" | ||
| 50 | + dialogToast: CustomDialogController = new CustomDialogController({ | ||
| 51 | + builder: CustomToast({ | ||
| 52 | + msg: this.toastText, | ||
| 53 | + }), | ||
| 54 | + autoCancel: false, | ||
| 55 | + alignment: DialogAlignment.Center, | ||
| 56 | + offset: { dx: 0, dy: -20 }, | ||
| 57 | + gridCount: 1, | ||
| 58 | + customStyle: true, | ||
| 59 | + maskColor:"#00000000" | ||
| 60 | + }) | ||
| 50 | 61 | ||
| 51 | dialogController: CustomDialogController = new CustomDialogController({ | 62 | dialogController: CustomDialogController = new CustomDialogController({ |
| 52 | builder: CustomProtocolDialog({ | 63 | builder: CustomProtocolDialog({ |
| @@ -316,12 +327,12 @@ struct LoginPage { | @@ -316,12 +327,12 @@ struct LoginPage { | ||
| 316 | //发送验证码 | 327 | //发送验证码 |
| 317 | sendVerifyCode() { | 328 | sendVerifyCode() { |
| 318 | this.loginViewModel.sendVerifyCode(this.phoneContent).then((verifyCode) => { | 329 | this.loginViewModel.sendVerifyCode(this.phoneContent).then((verifyCode) => { |
| 319 | - promptAction.showToast({ message: "已发送" }) | 330 | + this.showToastTip("已发送") |
| 320 | Logger.debug(TAG, "sendVerifyCode: " + verifyCode) | 331 | Logger.debug(TAG, "sendVerifyCode: " + verifyCode) |
| 321 | this.codeStateSuccess=true | 332 | this.codeStateSuccess=true |
| 322 | this.isCodeSend=false | 333 | this.isCodeSend=false |
| 323 | }).catch((message:string)=>{ | 334 | }).catch((message:string)=>{ |
| 324 | - promptAction.showToast({ message: message }) | 335 | + this.showToastTip(message) |
| 325 | this.codeStateSuccess=false | 336 | this.codeStateSuccess=false |
| 326 | this.isCodeSend=false | 337 | this.isCodeSend=false |
| 327 | Logger.debug(TAG, "sendVerifyCode: " + message) | 338 | Logger.debug(TAG, "sendVerifyCode: " + message) |
| @@ -339,12 +350,13 @@ struct LoginPage { | @@ -339,12 +350,13 @@ struct LoginPage { | ||
| 339 | this.queryUserDetail() | 350 | this.queryUserDetail() |
| 340 | EmitterUtils.sendEvent(EmitterEventId.PEOPLE_SHIP_ATTENTION) | 351 | EmitterUtils.sendEvent(EmitterEventId.PEOPLE_SHIP_ATTENTION) |
| 341 | }).catch((error:string)=>{ | 352 | }).catch((error:string)=>{ |
| 342 | - promptAction.showToast({ message: error }) | 353 | + this.showToastTip(error) |
| 343 | }) | 354 | }) |
| 344 | } else { | 355 | } else { |
| 345 | this.loginViewModel.appLoginByPassword(this.accountContent, 0, this.passwordContent, "").then((data) => { | 356 | this.loginViewModel.appLoginByPassword(this.accountContent, 0, this.passwordContent, "").then((data) => { |
| 346 | Logger.debug(TAG, "requestLogin: " + data.jwtToken) | 357 | Logger.debug(TAG, "requestLogin: " + data.jwtToken) |
| 347 | - promptAction.showToast({ message: '登录成功' }) | 358 | + this.showToastTip('登录成功') |
| 359 | + | ||
| 348 | ///同步兴趣tag | 360 | ///同步兴趣tag |
| 349 | let interestsModel = new InterestsHobbiesModel() | 361 | let interestsModel = new InterestsHobbiesModel() |
| 350 | interestsModel.updateInterests() | 362 | interestsModel.updateInterests() |
| @@ -357,12 +369,17 @@ struct LoginPage { | @@ -357,12 +369,17 @@ struct LoginPage { | ||
| 357 | // url: `${WDRouterPage.getBundleInfo()}` | 369 | // url: `${WDRouterPage.getBundleInfo()}` |
| 358 | // }) | 370 | // }) |
| 359 | }).catch((value: string) => { | 371 | }).catch((value: string) => { |
| 360 | - promptAction.showToast({ message: value }) | 372 | + this.showToastTip(value) |
| 361 | }) | 373 | }) |
| 362 | } | 374 | } |
| 363 | 375 | ||
| 364 | } | 376 | } |
| 365 | 377 | ||
| 378 | + showToastTip(msg:string){ | ||
| 379 | + this.toastText = msg | ||
| 380 | + this.dialogToast.open() | ||
| 381 | + } | ||
| 382 | + | ||
| 366 | queryUserDetail(){ | 383 | queryUserDetail(){ |
| 367 | this.loginViewModel.queryUserDetail().then(()=>{ | 384 | this.loginViewModel.queryUserDetail().then(()=>{ |
| 368 | router.back({ | 385 | router.back({ |
| @@ -490,4 +507,4 @@ struct ProtocolComponent { | @@ -490,4 +507,4 @@ struct ProtocolComponent { | ||
| 490 | .backgroundColor('#66000000') | 507 | .backgroundColor('#66000000') |
| 491 | 508 | ||
| 492 | } | 509 | } |
| 493 | -} | ||
| 510 | +} |
| @@ -16,11 +16,15 @@ struct LoginProtocolWebview { | @@ -16,11 +16,15 @@ struct LoginProtocolWebview { | ||
| 16 | privateProtocol = 'https://cdnpeoplefrontuat.aikan.pdnews.cn/rmrb/rmrb-protocol-zh-web/0.0.1/app/protocol-1001.html' | 16 | privateProtocol = 'https://cdnpeoplefrontuat.aikan.pdnews.cn/rmrb/rmrb-protocol-zh-web/0.0.1/app/protocol-1001.html' |
| 17 | logoutProtocol = 'https://cdnpeoplefrontuat.aikan.pdnews.cn/rmrb/rmrb-protocol-zh-web/0.0.1/app/protocol-1003.html' | 17 | logoutProtocol = 'https://cdnpeoplefrontuat.aikan.pdnews.cn/rmrb/rmrb-protocol-zh-web/0.0.1/app/protocol-1003.html' |
| 18 | huaweiAuthProtocol = 'https://privacy.consumer.huawei.com/legal/id/authentication-terms.htm?code=CN&language=zh-CN' | 18 | huaweiAuthProtocol = 'https://privacy.consumer.huawei.com/legal/id/authentication-terms.htm?code=CN&language=zh-CN' |
| 19 | + @State contentID:string = "0" | ||
| 19 | 20 | ||
| 20 | async aboutToAppear() { | 21 | async aboutToAppear() { |
| 21 | if (router.getParams()) { | 22 | if (router.getParams()) { |
| 22 | let params = router.getParams() as Params | 23 | let params = router.getParams() as Params |
| 23 | Logger.info(TAG, 'params.contentID:' + params.contentID); | 24 | Logger.info(TAG, 'params.contentID:' + params.contentID); |
| 25 | + if(params.contentID != undefined){ | ||
| 26 | + this.contentID = params.contentID | ||
| 27 | + } | ||
| 24 | if (params.contentID == "1") { //"人民日报客户端网络服务使用协议" | 28 | if (params.contentID == "1") { //"人民日报客户端网络服务使用协议" |
| 25 | this.webUrl = await SPHelper.default.get(SpConstants.NET_SERVICE_PROTOCOL, this.userProtocol) as string | 29 | this.webUrl = await SPHelper.default.get(SpConstants.NET_SERVICE_PROTOCOL, this.userProtocol) as string |
| 26 | this.webviewController.loadUrl(this.webUrl) | 30 | this.webviewController.loadUrl(this.webUrl) |
| @@ -71,6 +75,7 @@ struct LoginProtocolWebview { | @@ -71,6 +75,7 @@ struct LoginProtocolWebview { | ||
| 71 | Logger.info(TAG, 'onHttpErrorReceive event.request.getRequestUrl:' + event?.request.getRequestUrl()); | 75 | Logger.info(TAG, 'onHttpErrorReceive event.request.getRequestUrl:' + event?.request.getRequestUrl()); |
| 72 | Logger.info(TAG, 'onHttpErrorReceive event.response.getResponseCode:' + event?.response.getResponseCode()); | 76 | Logger.info(TAG, 'onHttpErrorReceive event.response.getResponseCode:' + event?.response.getResponseCode()); |
| 73 | }) | 77 | }) |
| 78 | + .padding({bottom:this.contentID === "2" ? "40lpx" : 0 }) | ||
| 74 | } | 79 | } |
| 75 | } | 80 | } |
| 76 | } | 81 | } |
| 1 | import ArrayList from '@ohos.util.ArrayList'; | 1 | import ArrayList from '@ohos.util.ArrayList'; |
| 2 | -import promptAction from '@ohos.promptAction'; | ||
| 3 | import { Params } from '../../../../../../../commons/wdRouter/oh_modules/wdBean/Index'; | 2 | import { Params } from '../../../../../../../commons/wdRouter/oh_modules/wdBean/Index'; |
| 4 | import router from '@ohos.router'; | 3 | import router from '@ohos.router'; |
| 5 | import { LoginViewModel } from './LoginViewModel'; | 4 | import { LoginViewModel } from './LoginViewModel'; |
| 6 | -import { Logger, SPHelper, ToastUtils } from 'wdKit'; | 5 | +import { CustomToast, Logger, SPHelper, ToastUtils } from 'wdKit'; |
| 7 | import { | 6 | import { |
| 8 | SpConstants | 7 | SpConstants |
| 9 | } from '../../../../../../../commons/wdNetwork/oh_modules/wdConstant/src/main/ets/constants/SpConstants' | 8 | } from '../../../../../../../commons/wdNetwork/oh_modules/wdConstant/src/main/ets/constants/SpConstants' |
| @@ -58,6 +57,19 @@ export struct SettingPasswordLayout { | @@ -58,6 +57,19 @@ export struct SettingPasswordLayout { | ||
| 58 | loginViewModel = new LoginViewModel() | 57 | loginViewModel = new LoginViewModel() |
| 59 | pageType?:number; //0、登录->忘记密码 1、设置->重置密码 2、设置->更换手机 | 58 | pageType?:number; //0、登录->忘记密码 1、设置->重置密码 2、设置->更换手机 |
| 60 | 59 | ||
| 60 | + @State toastText:string = "" | ||
| 61 | + dialogToast: CustomDialogController = new CustomDialogController({ | ||
| 62 | + builder: CustomToast({ | ||
| 63 | + msg: this.toastText, | ||
| 64 | + }), | ||
| 65 | + autoCancel: false, | ||
| 66 | + alignment: DialogAlignment.Center, | ||
| 67 | + offset: { dx: 0, dy: -20 }, | ||
| 68 | + gridCount: 1, | ||
| 69 | + customStyle: true, | ||
| 70 | + maskColor:"#00000000" | ||
| 71 | + }) | ||
| 72 | + | ||
| 61 | aboutToAppear() { | 73 | aboutToAppear() { |
| 62 | let params:SettingPasswordParams = router.getParams() as SettingPasswordParams; | 74 | let params:SettingPasswordParams = router.getParams() as SettingPasswordParams; |
| 63 | this.pageId = parseInt(params.pageID); | 75 | this.pageId = parseInt(params.pageID); |
| @@ -194,7 +206,7 @@ export struct SettingPasswordLayout { | @@ -194,7 +206,7 @@ export struct SettingPasswordLayout { | ||
| 194 | this.inputTextChange(value, item.inputTag) | 206 | this.inputTextChange(value, item.inputTag) |
| 195 | }) | 207 | }) |
| 196 | .onSubmit((EnterKeyType) => { | 208 | .onSubmit((EnterKeyType) => { |
| 197 | - promptAction.showToast({ message: 'submit' }) | 209 | + this.showToastTip('submit') |
| 198 | }) | 210 | }) |
| 199 | } | 211 | } |
| 200 | .alignItems(VerticalAlign.Center) | 212 | .alignItems(VerticalAlign.Center) |
| @@ -218,7 +230,7 @@ export struct SettingPasswordLayout { | @@ -218,7 +230,7 @@ export struct SettingPasswordLayout { | ||
| 218 | this.inputTextChange(value, item.inputTag) | 230 | this.inputTextChange(value, item.inputTag) |
| 219 | }) | 231 | }) |
| 220 | .onSubmit((EnterKeyType) => { | 232 | .onSubmit((EnterKeyType) => { |
| 221 | - promptAction.showToast({ message: 'submit' }) | 233 | + this.showToastTip('submit') |
| 222 | }) | 234 | }) |
| 223 | } | 235 | } |
| 224 | .alignItems(VerticalAlign.Center) | 236 | .alignItems(VerticalAlign.Center) |
| @@ -264,7 +276,7 @@ export struct SettingPasswordLayout { | @@ -264,7 +276,7 @@ export struct SettingPasswordLayout { | ||
| 264 | Text(item.compDesc).fontSize(12).maxLines(3).fontColor(0x999999).padding({top:'10lpx'}) | 276 | Text(item.compDesc).fontSize(12).maxLines(3).fontColor(0x999999).padding({top:'10lpx'}) |
| 265 | .onClick(()=>{ | 277 | .onClick(()=>{ |
| 266 | if (item.compDesc == '忘记密码') { | 278 | if (item.compDesc == '忘记密码') { |
| 267 | - promptAction.showToast({ message: '密码不符合密码规范' }) | 279 | + this.showToastTip('密码不符合密码规范') |
| 268 | } | 280 | } |
| 269 | }) | 281 | }) |
| 270 | } | 282 | } |
| @@ -307,11 +319,11 @@ export struct SettingPasswordLayout { | @@ -307,11 +319,11 @@ export struct SettingPasswordLayout { | ||
| 307 | if (this.btnStatus) { | 319 | if (this.btnStatus) { |
| 308 | // 需要+手机号校验 | 320 | // 需要+手机号校验 |
| 309 | if (this.password01.length < 6 || this.password01.length > 20) { | 321 | if (this.password01.length < 6 || this.password01.length > 20) { |
| 310 | - promptAction.showToast({ message: '密码不符合密码规范' }) | 322 | + this.showToastTip('密码不符合密码规范') |
| 311 | return | 323 | return |
| 312 | } | 324 | } |
| 313 | if (this.password01 != this.password02) { | 325 | if (this.password01 != this.password02) { |
| 314 | - promptAction.showToast({ message: '密码不一致' }) | 326 | + this.showToastTip('密码不一致') |
| 315 | return | 327 | return |
| 316 | } | 328 | } |
| 317 | if(this.pageId == 1){ //设置密码 | 329 | if(this.pageId == 1){ //设置密码 |
| @@ -339,7 +351,6 @@ export struct SettingPasswordLayout { | @@ -339,7 +351,6 @@ export struct SettingPasswordLayout { | ||
| 339 | Logger.error(TAG, 'catch err:' + JSON.stringify(err)); | 351 | Logger.error(TAG, 'catch err:' + JSON.stringify(err)); |
| 340 | }); | 352 | }); |
| 341 | } | 353 | } |
| 342 | - // promptAction.showToast({ message: '请求接口' }) | ||
| 343 | } | 354 | } |
| 344 | 355 | ||
| 345 | 356 | ||
| @@ -363,5 +374,10 @@ export struct SettingPasswordLayout { | @@ -363,5 +374,10 @@ export struct SettingPasswordLayout { | ||
| 363 | } | 374 | } |
| 364 | } | 375 | } |
| 365 | } | 376 | } |
| 377 | + | ||
| 378 | + showToastTip(msg:string){ | ||
| 379 | + this.toastText = msg | ||
| 380 | + this.dialogToast.open() | ||
| 381 | + } | ||
| 366 | } | 382 | } |
| 367 | 383 |
| @@ -2,7 +2,7 @@ import { Logger } from 'wdKit'; | @@ -2,7 +2,7 @@ import { Logger } from 'wdKit'; | ||
| 2 | import { MultiPictureDetailPageComponent } from 'wdComponent'; | 2 | import { MultiPictureDetailPageComponent } from 'wdComponent'; |
| 3 | import router from '@ohos.router'; | 3 | import router from '@ohos.router'; |
| 4 | import { Params, Action } from 'wdBean'; | 4 | import { Params, Action } from 'wdBean'; |
| 5 | - | 5 | +import { WindowModel } from 'wdKit/Index'; |
| 6 | const TAG = 'MultiPictureDetailPage'; | 6 | const TAG = 'MultiPictureDetailPage'; |
| 7 | 7 | ||
| 8 | /** | 8 | /** |
| @@ -26,6 +26,8 @@ struct MultiPictureDetailPage { | @@ -26,6 +26,8 @@ struct MultiPictureDetailPage { | ||
| 26 | }) | 26 | }) |
| 27 | } | 27 | } |
| 28 | } | 28 | } |
| 29 | + .padding({top:44}) | ||
| 30 | + .backgroundColor(Color.Black) | ||
| 29 | } | 31 | } |
| 30 | 32 | ||
| 31 | pageTransition(){ | 33 | pageTransition(){ |
| @@ -38,6 +40,10 @@ struct MultiPictureDetailPage { | @@ -38,6 +40,10 @@ struct MultiPictureDetailPage { | ||
| 38 | } | 40 | } |
| 39 | 41 | ||
| 40 | aboutToAppear() { | 42 | aboutToAppear() { |
| 43 | + this.openFullScreen() | ||
| 44 | + | ||
| 45 | + Logger.info(TAG, 'aboutToDisappear'); | ||
| 46 | + | ||
| 41 | let par:Action = router.getParams() as Action; | 47 | let par:Action = router.getParams() as Action; |
| 42 | let params = par?.params; | 48 | let params = par?.params; |
| 43 | this.relId = params?.extra?.relId || ''; | 49 | this.relId = params?.extra?.relId || ''; |
| @@ -47,11 +53,33 @@ struct MultiPictureDetailPage { | @@ -47,11 +53,33 @@ struct MultiPictureDetailPage { | ||
| 47 | Logger.info(TAG, 'params', JSON.stringify(params)); | 53 | Logger.info(TAG, 'params', JSON.stringify(params)); |
| 48 | } | 54 | } |
| 49 | 55 | ||
| 50 | - aboutToDisappear() { | ||
| 51 | - Logger.info(TAG, 'aboutToDisappear'); | ||
| 52 | - } | ||
| 53 | - | ||
| 54 | onBackPress() { | 56 | onBackPress() { |
| 55 | Logger.info(TAG, 'onBackPress'); | 57 | Logger.info(TAG, 'onBackPress'); |
| 56 | } | 58 | } |
| 59 | + | ||
| 60 | + /** | ||
| 61 | + * 开启沉浸式 | ||
| 62 | + * TODO:颜色待根据业务接口修改 | ||
| 63 | + */ | ||
| 64 | + openFullScreen() { | ||
| 65 | + WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#ffffff', }) | ||
| 66 | + WindowModel.shared.setWindowLayoutFullScreen(true) | ||
| 67 | + // WindowModel.shared.setWindowSystemBarEnable([]) | ||
| 68 | + } | ||
| 69 | + | ||
| 70 | + aboutToDisappear(): void { | ||
| 71 | + console.log(TAG, 'aboutToDisappear') | ||
| 72 | + this.closeFullScreen() | ||
| 73 | + } | ||
| 74 | + | ||
| 75 | + /** | ||
| 76 | + * 关闭沉浸式 | ||
| 77 | + * TODO:颜色待根据业务接口修改 | ||
| 78 | + */ | ||
| 79 | + closeFullScreen() { | ||
| 80 | + WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#000000', }) | ||
| 81 | + WindowModel.shared.setWindowLayoutFullScreen(false) | ||
| 82 | + // WindowModel.shared.setWindowSystemBarEnable(['status', 'navigation']) | ||
| 83 | + } | ||
| 84 | + | ||
| 57 | } | 85 | } |
-
Please register or login to post a comment