Merge branch 'main' of http://192.168.1.42/developOne/harmonyPool into main
* 'main' of http://192.168.1.42/developOne/harmonyPool: (49 commits) feat(金刚卡):点击跳转到专题页 禅道:16610 早晚报时间样式,字体大小及背景样式鸿蒙与安卓不一致 fix: 16851 人民号分享名片与分享按钮icon点击无反应 fix: 16734 人民号-推荐页面下的关注按钮与标题重叠 fix:bug[16812]人民号--搜索下的无图片信息的人民号号主头像鸿蒙与安卓不一致 图集人民号点击头像跳转到号主页,对接评论点赞组合组件 修复绑定账号异常提示 fix: 16734 人民号-推荐页面下的关注按钮与标题重叠 fix:bug[16837]用户评论任意详情页返回我的-评论后未能获取到评论内容 fix: 16809 人民号下我的关注图标样式鸿蒙与安卓不一致 fix:16809 人民号下我的关注图标样式鸿蒙与安卓不一致 jira: desc:16656 人民号主页中的“+关注”的样式鸿蒙与安卓不一致 jira: desc:16768 【uat】号主页,号主信息和内容标签tab间距过大 fix: 16578 进入直播列表。直播预约按钮和时间没有显示 feat(动态):已关注状态处理 ref |> Revert "ref |> 新增友盟统计" Revert "ref |> 新增埋点封装" ref |> 统一 OS、Channel公参字段 修复验证码bug fix:CardMediaInfo取值兼容 ...
Showing
100 changed files
with
1429 additions
and
480 deletions
Too many changes to show.
To preserve performance only 100 of 100+ files are displayed.
| @@ -53,5 +53,15 @@ export class AppUtils { | @@ -53,5 +53,15 @@ export class AppUtils { | ||
| 53 | } | 53 | } |
| 54 | return ''; | 54 | return ''; |
| 55 | } | 55 | } |
| 56 | + | ||
| 57 | + static getAppChannel() { | ||
| 58 | + // TODO: 待确认,暂时写死一个 | ||
| 59 | + return "rmrb_china_0000" | ||
| 60 | + } | ||
| 61 | + | ||
| 62 | + static getOSName() { | ||
| 63 | + // TODO: 待确认,暂时写死Android | ||
| 64 | + return "Harmony" | ||
| 65 | + } | ||
| 56 | } | 66 | } |
| 57 | 67 |
| @@ -70,10 +70,16 @@ export class DeviceUtil { | @@ -70,10 +70,16 @@ export class DeviceUtil { | ||
| 70 | } | 70 | } |
| 71 | 71 | ||
| 72 | /** | 72 | /** |
| 73 | + * 获取设备型号: HUAWEI Mate 60 Pro | ||
| 74 | + */ | ||
| 75 | + static getMarketName() { | ||
| 76 | + return deviceInfo.marketName | ||
| 77 | + } | ||
| 78 | + | ||
| 79 | + /** | ||
| 73 | * 客户端日志链路追踪traceid生成:在每个请求头加上参数Key:EagleEye-TraceID ,value为32位生成随机值 | 80 | * 客户端日志链路追踪traceid生成:在每个请求头加上参数Key:EagleEye-TraceID ,value为32位生成随机值 |
| 74 | */ | 81 | */ |
| 75 | static getRandomUUIDForTraceID(): string { | 82 | static getRandomUUIDForTraceID(): string { |
| 76 | - deviceInfo.productModel | ||
| 77 | - return util.generateRandomUUID().toUpperCase().replace('-', '') | 83 | + return util.generateRandomUUID().toUpperCase().replace(/-/g, '') |
| 78 | } | 84 | } |
| 79 | } | 85 | } |
| @@ -6,6 +6,9 @@ | @@ -6,6 +6,9 @@ | ||
| 6 | "ATTENTION": "THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.", | 6 | "ATTENTION": "THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.", |
| 7 | "specifiers": { | 7 | "specifiers": { |
| 8 | "@ohos/axios@^2.1.1": "@ohos/axios@2.2.0", | 8 | "@ohos/axios@^2.1.1": "@ohos/axios@2.2.0", |
| 9 | + "@umeng/analytics@^1.0.19": "@umeng/analytics@1.0.19", | ||
| 10 | + "@umeng/common@^1.0.21": "@umeng/common@1.0.21", | ||
| 11 | + "libcommon.so@../../oh_modules/.ohpm/@umeng+common@1.0.21/oh_modules/@umeng/common/src/main/cpp/types/libcommon": "libcommon.so@../../oh_modules/.ohpm/@umeng+common@1.0.21/oh_modules/@umeng/common/src/main/cpp/types/libcommon", | ||
| 9 | "wdConstant@../wdConstant": "wdConstant@../wdConstant", | 12 | "wdConstant@../wdConstant": "wdConstant@../wdConstant", |
| 10 | "wdKit@../wdKit": "wdKit@../wdKit" | 13 | "wdKit@../wdKit": "wdKit@../wdKit" |
| 11 | }, | 14 | }, |
| @@ -16,6 +19,26 @@ | @@ -16,6 +19,26 @@ | ||
| 16 | "resolved": "https://repo.harmonyos.com/ohpm/@ohos/axios/-/axios-2.2.0.har", | 19 | "resolved": "https://repo.harmonyos.com/ohpm/@ohos/axios/-/axios-2.2.0.har", |
| 17 | "registryType": "ohpm" | 20 | "registryType": "ohpm" |
| 18 | }, | 21 | }, |
| 22 | + "@umeng/analytics@1.0.19": { | ||
| 23 | + "name": "@umeng/analytics", | ||
| 24 | + "integrity": "sha512-0m9z5l8to+POjDl9UkCQC8s4P+e2E1OILwUglC7ME4QwqfH44e59GLJtQdwF0h6kwpsy3YBft4SoWK8MYbuP7g==", | ||
| 25 | + "resolved": "https://ohpm.openharmony.cn/ohpm/@umeng/analytics/-/analytics-1.0.19.har", | ||
| 26 | + "registryType": "ohpm" | ||
| 27 | + }, | ||
| 28 | + "@umeng/common@1.0.21": { | ||
| 29 | + "name": "@umeng/common", | ||
| 30 | + "integrity": "sha512-EbXsd4OoRisTQf5egNY/+z1D2bvrYw9VwC2xu3EJA9TiDPSbnaJZ5+yltA/Se6yZ4oCcFvq6e5/AAfPuumunbw==", | ||
| 31 | + "resolved": "https://ohpm.openharmony.cn/ohpm/@umeng/common/-/common-1.0.21.har", | ||
| 32 | + "registryType": "ohpm", | ||
| 33 | + "dependencies": { | ||
| 34 | + "libcommon.so": "./src/main/cpp/types/libcommon" | ||
| 35 | + } | ||
| 36 | + }, | ||
| 37 | + "libcommon.so@../../oh_modules/.ohpm/@umeng+common@1.0.21/oh_modules/@umeng/common/src/main/cpp/types/libcommon": { | ||
| 38 | + "name": "libcommon.so", | ||
| 39 | + "resolved": "../../oh_modules/.ohpm/@umeng+common@1.0.21/oh_modules/@umeng/common/src/main/cpp/types/libcommon", | ||
| 40 | + "registryType": "local" | ||
| 41 | + }, | ||
| 19 | "wdConstant@../wdConstant": { | 42 | "wdConstant@../wdConstant": { |
| 20 | "name": "wdconstant", | 43 | "name": "wdconstant", |
| 21 | "resolved": "../wdConstant", | 44 | "resolved": "../wdConstant", |
| @@ -24,7 +47,11 @@ | @@ -24,7 +47,11 @@ | ||
| 24 | "wdKit@../wdKit": { | 47 | "wdKit@../wdKit": { |
| 25 | "name": "wdkit", | 48 | "name": "wdkit", |
| 26 | "resolved": "../wdKit", | 49 | "resolved": "../wdKit", |
| 27 | - "registryType": "local" | 50 | + "registryType": "local", |
| 51 | + "dependencies": { | ||
| 52 | + "@umeng/common": "^1.0.21", | ||
| 53 | + "@umeng/analytics": "^1.0.19" | ||
| 54 | + } | ||
| 28 | } | 55 | } |
| 29 | } | 56 | } |
| 30 | } | 57 | } |
| 1 | import { SpConstants } from 'wdConstant'; | 1 | import { SpConstants } from 'wdConstant'; |
| 2 | -import { DateTimeUtils, DeviceUtil, SPHelper, StringUtils } from 'wdKit'; | 2 | +import { AppUtils, DateTimeUtils, DeviceUtil, SPHelper, StringUtils } from 'wdKit'; |
| 3 | import { HttpUtils } from '../utils/HttpUtils'; | 3 | import { HttpUtils } from '../utils/HttpUtils'; |
| 4 | import { HostEnum, HostManager } from './HttpHostManager'; | 4 | import { HostEnum, HostManager } from './HttpHostManager'; |
| 5 | 5 | ||
| @@ -11,16 +11,16 @@ export class HttpParams { | @@ -11,16 +11,16 @@ export class HttpParams { | ||
| 11 | let headers: Record<string, string> = {}; | 11 | let headers: Record<string, string> = {}; |
| 12 | // 通用请求头 | 12 | // 通用请求头 |
| 13 | headers['User-Agent'] = 'Dalvik/2.1.0 (Linux; U; Android 13; 22101317C Build/TKQ1.221013.002)' // TODO | 13 | headers['User-Agent'] = 'Dalvik/2.1.0 (Linux; U; Android 13; 22101317C Build/TKQ1.221013.002)' // TODO |
| 14 | - headers['channel'] = 'rmrb_china_0000' // 自有渠道 | 14 | + headers['channel'] = AppUtils.getAppChannel() |
| 15 | headers['plat'] = DeviceUtil.getPlat() | 15 | headers['plat'] = DeviceUtil.getPlat() |
| 16 | headers['Content-Type'] = 'application/json; charset=utf-8' | 16 | headers['Content-Type'] = 'application/json; charset=utf-8' |
| 17 | headers['device_id'] = DeviceUtil.clientId() | 17 | headers['device_id'] = DeviceUtil.clientId() |
| 18 | headers['build_version'] = HttpParams.getVersion() | 18 | headers['build_version'] = HttpParams.getVersion() |
| 19 | headers['adcode'] = HttpUtils.getProvinceCode() | 19 | headers['adcode'] = HttpUtils.getProvinceCode() |
| 20 | headers['os_version'] = DeviceUtil.getOsVersion() | 20 | headers['os_version'] = DeviceUtil.getOsVersion() |
| 21 | - headers['system'] = 'Android' // TODO 后续是否新增鸿蒙标识 | ||
| 22 | - headers['versionCode'] = HttpParams.getVersionCode() | ||
| 23 | - headers['version_name'] = HttpParams.getVersionName() | 21 | + headers['system'] = AppUtils.getOSName() |
| 22 | + headers['versionCode'] = AppUtils.getAppVersionCode() | ||
| 23 | + headers['version_name'] = AppUtils.getAppVersionName() | ||
| 24 | headers['EagleEye-TraceID'] = DeviceUtil.getRandomUUIDForTraceID() | 24 | headers['EagleEye-TraceID'] = DeviceUtil.getRandomUUIDForTraceID() |
| 25 | headers['imei'] = DeviceUtil.clientId() | 25 | headers['imei'] = DeviceUtil.clientId() |
| 26 | headers['Accept-Language'] = 'zh' | 26 | headers['Accept-Language'] = 'zh' |
| @@ -67,7 +67,7 @@ export class ProcessUtils { | @@ -67,7 +67,7 @@ export class ProcessUtils { | ||
| 67 | linkUrl: advert.linkUrl, | 67 | linkUrl: advert.linkUrl, |
| 68 | pageId: advert.pageId, | 68 | pageId: advert.pageId, |
| 69 | objectId: advert.objectId, | 69 | objectId: advert.objectId, |
| 70 | - objectType: advert.objectType, | 70 | + objectType: advert.objectType.toString(), |
| 71 | relId: advert.relId, | 71 | relId: advert.relId, |
| 72 | bottomNavId: advert.bottomNavId | 72 | bottomNavId: advert.bottomNavId |
| 73 | } as ContentDTO; | 73 | } as ContentDTO; |
| @@ -124,6 +124,7 @@ export class ProcessUtils { | @@ -124,6 +124,7 @@ export class ProcessUtils { | ||
| 124 | //动态详情页(动态图文) | 124 | //动态详情页(动态图文) |
| 125 | case ContentConstants.TYPE_FOURTEEN: | 125 | case ContentConstants.TYPE_FOURTEEN: |
| 126 | ProcessUtils.gotoDynamicDetailPage(content); | 126 | ProcessUtils.gotoDynamicDetailPage(content); |
| 127 | + break; | ||
| 127 | //动态详情页(动态视频) | 128 | //动态详情页(动态视频) |
| 128 | case ContentConstants.TYPE_FIFTEEN: | 129 | case ContentConstants.TYPE_FIFTEEN: |
| 129 | ProcessUtils.gotoDynamicDetailPage(content); | 130 | ProcessUtils.gotoDynamicDetailPage(content); |
| @@ -322,6 +323,8 @@ export class ProcessUtils { | @@ -322,6 +323,8 @@ export class ProcessUtils { | ||
| 322 | extra: { | 323 | extra: { |
| 323 | relType: content?.relType, | 324 | relType: content?.relType, |
| 324 | relId: content?.relId, | 325 | relId: content?.relId, |
| 326 | + extra: content?.extra, | ||
| 327 | + title: content?.newsTitle | ||
| 325 | } as ExtraDTO | 328 | } as ExtraDTO |
| 326 | } as Params, | 329 | } as Params, |
| 327 | }; | 330 | }; |
| @@ -9,13 +9,17 @@ import router from '@ohos.router'; | @@ -9,13 +9,17 @@ import router from '@ohos.router'; | ||
| 9 | import Url from '@ohos.url' | 9 | 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 | - | 12 | +import { HttpUtils } from 'wdNetwork/Index'; |
| 13 | const TAG = 'JsBridgeBiz' | 13 | const TAG = 'JsBridgeBiz' |
| 14 | 14 | ||
| 15 | class AppInfo { | 15 | class AppInfo { |
| 16 | plat: string = '' | 16 | plat: string = '' |
| 17 | system: string = '' | 17 | system: string = '' |
| 18 | networkStatus: number = 1 | 18 | networkStatus: number = 1 |
| 19 | + screenStatusBarHeight: number = 40 // TODO 这里需要动态获取 | ||
| 20 | + screenTabbarSafeHeight: number = 42 // TODO 这里需要动态获取 | ||
| 21 | + imei: string = HttpUtils.getImei() | ||
| 22 | + device_id: string = HttpUtils.getDeviceId() | ||
| 19 | // TODO 完善 | 23 | // TODO 完善 |
| 20 | } | 24 | } |
| 21 | 25 |
| @@ -4,6 +4,7 @@ import { Logger } from 'wdKit/Index'; | @@ -4,6 +4,7 @@ import { Logger } from 'wdKit/Index'; | ||
| 4 | import { performJSCallNative } from './JsBridgeBiz'; | 4 | import { performJSCallNative } from './JsBridgeBiz'; |
| 5 | import { H5CallNativeType } from './H5CallNativeType'; | 5 | import { H5CallNativeType } from './H5CallNativeType'; |
| 6 | import { Message } from 'wdJsBridge/src/main/ets/bean/Message'; | 6 | import { Message } from 'wdJsBridge/src/main/ets/bean/Message'; |
| 7 | +import { DateTimeUtils } from 'wdKit' | ||
| 7 | 8 | ||
| 8 | const TAG = 'WdWebLocalComponent'; | 9 | const TAG = 'WdWebLocalComponent'; |
| 9 | 10 | ||
| @@ -22,6 +23,13 @@ export struct WdWebLocalComponent { | @@ -22,6 +23,13 @@ export struct WdWebLocalComponent { | ||
| 22 | @State positionLeft: number = 0 | 23 | @State positionLeft: number = 0 |
| 23 | @State positionTop: number = 0 | 24 | @State positionTop: number = 0 |
| 24 | @State videoLandscape: string = '1' | 25 | @State videoLandscape: string = '1' |
| 26 | + @State curRate: PlaybackSpeed = PlaybackSpeed.Speed_Forward_1_00_X | ||
| 27 | + @State sliderStartTime: string = ''; | ||
| 28 | + @State currentTime: number = 0; | ||
| 29 | + @State durationTime: number = 0; | ||
| 30 | + @State durationStringTime: string = ''; | ||
| 31 | + @State isPause: boolean = true; | ||
| 32 | + controller: VideoController = new VideoController() | ||
| 25 | 33 | ||
| 26 | build() { | 34 | build() { |
| 27 | Column() { | 35 | Column() { |
| @@ -77,22 +85,87 @@ export struct WdWebLocalComponent { | @@ -77,22 +85,87 @@ export struct WdWebLocalComponent { | ||
| 77 | }) | 85 | }) |
| 78 | 86 | ||
| 79 | if (this.videoUrl) { | 87 | if (this.videoUrl) { |
| 80 | - Video({ src: this.videoUrl }) | ||
| 81 | - .autoPlay(true) | ||
| 82 | - .objectFit(ImageFit.Contain) | ||
| 83 | - .width(this.positionWidth) | ||
| 84 | - .height(this.positionHeight) | ||
| 85 | - .borderRadius(5) | ||
| 86 | - .alignRules({ | ||
| 87 | - top: { anchor: "__container__", align: VerticalAlign.Top }, | 88 | + Stack({ alignContent: Alignment.Bottom }) { |
| 89 | + Video({ | ||
| 90 | + src: this.videoUrl, | ||
| 91 | + currentProgressRate: this.curRate, | ||
| 92 | + controller: this.controller | ||
| 88 | }) | 93 | }) |
| 89 | - .offset({ | ||
| 90 | - x: this.positionLeft, | ||
| 91 | - y: this.positionTop | ||
| 92 | - }) | ||
| 93 | - .id("video") | ||
| 94 | - } | 94 | + .borderRadius(5) |
| 95 | + .controls(false) | ||
| 96 | + .autoPlay(true) | ||
| 97 | + .objectFit(ImageFit.Contain) | ||
| 98 | + .onStart(() => { | ||
| 99 | + this.isPause = false | ||
| 100 | + }) | ||
| 101 | + .onPause(() => { | ||
| 102 | + this.isPause = true | ||
| 103 | + }) | ||
| 104 | + .onPrepared((event) => { | ||
| 105 | + if (event) { | ||
| 106 | + this.durationTime = event.duration | ||
| 107 | + } | ||
| 108 | + }) | ||
| 109 | + .onUpdate((event) => { | ||
| 110 | + if (event) { | ||
| 111 | + this.currentTime = event.time | ||
| 112 | + } | ||
| 113 | + }) | ||
| 114 | + Row() { | ||
| 115 | + Image($r(this.isPause ? 'app.media.icon_play' : 'app.media.icon_pause')) | ||
| 116 | + .width(24) | ||
| 117 | + .height(24) | ||
| 118 | + .onClick(()=>{ | ||
| 119 | + if(this.isPause){ | ||
| 120 | + this.controller.start() | ||
| 121 | + }else{ | ||
| 122 | + this.controller.pause() | ||
| 123 | + } | ||
| 124 | + }) | ||
| 125 | + Row() { | ||
| 126 | + Text(DateTimeUtils.getFormattedDuration(this.currentTime * 1000)).fontSize(12).fontColor(Color.White).fontWeight(600) | ||
| 127 | + Slider({ | ||
| 128 | + value: this.currentTime, | ||
| 129 | + min: 0, | ||
| 130 | + max: this.durationTime | ||
| 131 | + }) | ||
| 132 | + .width("50%") | ||
| 133 | + .selectedColor('#ED2800') | ||
| 134 | + .margin({ left: 4, right: 4 }) | ||
| 135 | + // .blockStyle({ | ||
| 136 | + // type: SliderBlockType.IMAGE, | ||
| 137 | + // image: $r('app.media.slider_block') | ||
| 138 | + // }) | ||
| 139 | + // .blockSize({ width: 18, height: 12 }) | ||
| 140 | + .onChange((value: number, mode: SliderChangeMode) => { | ||
| 141 | + this.controller.setCurrentTime(value); | ||
| 142 | + }) | ||
| 143 | + Text(DateTimeUtils.getFormattedDuration(this.durationTime * 1000)).fontSize(12).fontColor(Color.White).fontWeight(600) | ||
| 144 | + } | ||
| 145 | + .justifyContent(FlexAlign.Center) | ||
| 95 | 146 | ||
| 147 | + Image($r('app.media.icon_full_screen')) | ||
| 148 | + .width(24) | ||
| 149 | + .height(24) | ||
| 150 | + .onClick(()=>{ | ||
| 151 | + this.controller.requestFullscreen(true) | ||
| 152 | + }) | ||
| 153 | + } | ||
| 154 | + .opacity(0.8) | ||
| 155 | + .width("100%") | ||
| 156 | + .justifyContent(FlexAlign.SpaceAround) | ||
| 157 | + } | ||
| 158 | + .width(this.positionWidth) | ||
| 159 | + .height(this.positionHeight) | ||
| 160 | + .alignRules({ | ||
| 161 | + top: { anchor: "__container__", align: VerticalAlign.Top }, | ||
| 162 | + }) | ||
| 163 | + .offset({ | ||
| 164 | + x: this.positionLeft, | ||
| 165 | + y: this.positionTop | ||
| 166 | + }) | ||
| 167 | + .id("video") | ||
| 168 | + } | ||
| 96 | } | 169 | } |
| 97 | }.width('100%') | 170 | }.width('100%') |
| 98 | .height(this.webHeight) | 171 | .height(this.webHeight) |
289 Bytes
339 Bytes
293 Bytes
1.79 KB
497 Bytes
| @@ -130,8 +130,6 @@ export { LiveInfoDTO } from './src/main/ets/bean/detail/LiveInfoDTO'; | @@ -130,8 +130,6 @@ export { LiveInfoDTO } from './src/main/ets/bean/detail/LiveInfoDTO'; | ||
| 130 | 130 | ||
| 131 | export { postRecommendListParams } from './src/main/ets/bean/detail/postRecommendListParams'; | 131 | export { postRecommendListParams } from './src/main/ets/bean/detail/postRecommendListParams'; |
| 132 | 132 | ||
| 133 | -export { postThemeListParams } from './src/main/ets/bean/detail/postThemeListParams'; | ||
| 134 | - | ||
| 135 | export { LiveDTO } from './src/main/ets/bean/peoples/LiveDTO'; | 133 | export { LiveDTO } from './src/main/ets/bean/peoples/LiveDTO'; |
| 136 | 134 | ||
| 137 | export { contentVideosDTO } from './src/main/ets/bean/content/contentVideosDTO'; | 135 | export { contentVideosDTO } from './src/main/ets/bean/content/contentVideosDTO'; |
| @@ -165,3 +163,7 @@ export { | @@ -165,3 +163,7 @@ export { | ||
| 165 | AttentionBatchDTO, | 163 | AttentionBatchDTO, |
| 166 | CreatorDTO | 164 | CreatorDTO |
| 167 | } from './src/main/ets/bean/peoples/AttentionBatchDTO'; | 165 | } from './src/main/ets/bean/peoples/AttentionBatchDTO'; |
| 166 | + | ||
| 167 | +export { GoldenPositionExtraBean } from './src/main/ets/bean/content/GoldenPositionExtraBean'; | ||
| 168 | +export { ClassBean } from './src/main/ets/bean/content/ClassBean'; | ||
| 169 | +export { CreatorsBean } from './src/main/ets/bean/content/CreatorsBean'; |
| @@ -17,4 +17,6 @@ export interface ExtraDTO extends ItemDTO { | @@ -17,4 +17,6 @@ export interface ExtraDTO extends ItemDTO { | ||
| 17 | photoList: PhotoListBean[]; | 17 | photoList: PhotoListBean[]; |
| 18 | swiperIndex?: number | 18 | swiperIndex?: number |
| 19 | commentId?: string; | 19 | commentId?: string; |
| 20 | + extra?:string | ||
| 21 | + title: string | ||
| 20 | } | 22 | } |
| 1 | +import { FullColumnImgUrlDTO } from '../detail/FullColumnImgUrlDTO'; | ||
| 2 | +import { LiveInfoDTO } from '../detail/LiveInfoDTO'; | ||
| 3 | +import { VideoInfoDTO } from '../detail/VideoInfoDTO'; | ||
| 4 | +import { InteractDataDTO } from './InteractDataDTO'; | ||
| 5 | +import { slideShows } from '../morningevening/slideShows'; | ||
| 6 | +import { VoiceInfoDTO } from '../detail/VoiceInfoDTO'; | ||
| 7 | +import { RmhInfoDTO } from '../detail/RmhInfoDTO'; | ||
| 8 | +import { commentInfo } from './commentInfo'; | ||
| 9 | +import { ArrayList } from '@kit.ArkTS'; | ||
| 10 | + | ||
| 11 | +export interface ClassBean { | ||
| 12 | + secondClassifyName:string | ||
| 13 | + classifyName:string | ||
| 14 | +} |
| 1 | +import { ArrayList } from '@kit.ArkTS'; | ||
| 2 | +import { ClassBean } from './ClassBean'; | ||
| 3 | +import { CreatorsBean } from './CreatorsBean'; | ||
| 4 | + | ||
| 5 | +export interface GoldenPositionExtraBean { | ||
| 6 | + sort:number | ||
| 7 | + pageNum:number | ||
| 8 | + pageSize:number | ||
| 9 | + channelId:string | ||
| 10 | + topicId:string | ||
| 11 | + keyWord:string | ||
| 12 | + aggregateType:string | ||
| 13 | + poolCode:string | ||
| 14 | + showPublishStartTime:string | ||
| 15 | + showPublishEndTime:string | ||
| 16 | + keywordsType:string | ||
| 17 | + keywords:ArrayList<string> | ||
| 18 | + classifys: ArrayList<ClassBean> | ||
| 19 | + creatorTags: ArrayList<CreatorsBean> | ||
| 20 | +} |
| @@ -25,6 +25,7 @@ import { Card2Component } from './cardview/Card2Component'; | @@ -25,6 +25,7 @@ import { Card2Component } from './cardview/Card2Component'; | ||
| 25 | import { Card5Component } from './cardview/Card5Component'; | 25 | import { Card5Component } from './cardview/Card5Component'; |
| 26 | import { WDRouterPage, WDRouterRule } from 'wdRouter/Index'; | 26 | import { WDRouterPage, WDRouterRule } from 'wdRouter/Index'; |
| 27 | import { AdvCardParser } from './cardViewAdv/AdvCardParser'; | 27 | import { AdvCardParser } from './cardViewAdv/AdvCardParser'; |
| 28 | +import PageModel from '../viewmodel/PageModel'; | ||
| 28 | 29 | ||
| 29 | /** | 30 | /** |
| 30 | * comp适配器. | 31 | * comp适配器. |
| @@ -34,7 +35,9 @@ import { AdvCardParser } from './cardViewAdv/AdvCardParser'; | @@ -34,7 +35,9 @@ import { AdvCardParser } from './cardViewAdv/AdvCardParser'; | ||
| 34 | @Component | 35 | @Component |
| 35 | export struct CompParser { | 36 | export struct CompParser { |
| 36 | @State compDTO: CompDTO = {} as CompDTO | 37 | @State compDTO: CompDTO = {} as CompDTO |
| 37 | - compIndex: number = 0; | 38 | + |
| 39 | + @State private pageModel: PageModel = new PageModel(); | ||
| 40 | + @State compIndex: number = 0; | ||
| 38 | 41 | ||
| 39 | build() { | 42 | build() { |
| 40 | Column() { | 43 | Column() { |
| @@ -44,7 +47,7 @@ export struct CompParser { | @@ -44,7 +47,7 @@ export struct CompParser { | ||
| 44 | 47 | ||
| 45 | @Builder | 48 | @Builder |
| 46 | componentBuilder(compDTO: CompDTO, compIndex: number) { | 49 | componentBuilder(compDTO: CompDTO, compIndex: number) { |
| 47 | - if (compDTO.operDataList[0]?.objectType !== '3' && compDTO.operDataList[0]?.objectType !== '13') { //暂时屏蔽活动和音频详情入口 | 50 | + //if (compDTO.operDataList[0]?.objectType !== '3' && compDTO.operDataList[0]?.objectType !== '13') { //暂时屏蔽活动和音频详情入口 |
| 48 | if (compDTO.compStyle === CompStyle.Label_03) { | 51 | if (compDTO.compStyle === CompStyle.Label_03) { |
| 49 | LabelComponent({ compDTO: compDTO }) | 52 | LabelComponent({ compDTO: compDTO }) |
| 50 | Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 }) | 53 | Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 }) |
| @@ -100,7 +103,8 @@ export struct CompParser { | @@ -100,7 +103,8 @@ export struct CompParser { | ||
| 100 | ZhSingleColumn09({ compDTO }) | 103 | ZhSingleColumn09({ compDTO }) |
| 101 | Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 }) | 104 | Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 }) |
| 102 | } else if (compDTO.compStyle === CompStyle.Card_Comp_Adv) { // 广告 | 105 | } else if (compDTO.compStyle === CompStyle.Card_Comp_Adv) { // 广告 |
| 103 | - AdvCardParser({compDTO}) | 106 | + AdvCardParser({pageModel:this.pageModel,compDTO}) |
| 107 | + //Text(`compIndex = ${compIndex}`).width('100%').fontSize('12fp').fontColor(Color.Red).padding({ left: 16, right: 16 }) | ||
| 104 | Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 }) | 108 | Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 }) |
| 105 | } else if (!Number.isNaN(Number(compDTO.compStyle))) { | 109 | } else if (!Number.isNaN(Number(compDTO.compStyle))) { |
| 106 | CardParser({ contentDTO: compDTO.operDataList[0] }); | 110 | CardParser({ contentDTO: compDTO.operDataList[0] }); |
| @@ -119,6 +123,6 @@ export struct CompParser { | @@ -119,6 +123,6 @@ export struct CompParser { | ||
| 119 | } | 123 | } |
| 120 | } | 124 | } |
| 121 | 125 | ||
| 122 | - } | 126 | + // } |
| 123 | } | 127 | } |
| 124 | 128 |
| @@ -97,15 +97,29 @@ export struct DynamicDetailComponent { | @@ -97,15 +97,29 @@ export struct DynamicDetailComponent { | ||
| 97 | .height($r('app.float.margin_32')) | 97 | .height($r('app.float.margin_32')) |
| 98 | .objectFit(ImageFit.Cover) | 98 | .objectFit(ImageFit.Cover) |
| 99 | .borderRadius($r('app.float.margin_16')) | 99 | .borderRadius($r('app.float.margin_16')) |
| 100 | - Image($r('app.media.icon_border_test')) | 100 | + Image(this.contentDetailData.rmhInfo?.honoraryIcon) |
| 101 | .width($r('app.float.margin_48')) | 101 | .width($r('app.float.margin_48')) |
| 102 | .height($r('app.float.margin_48')) | 102 | .height($r('app.float.margin_48')) |
| 103 | .objectFit(ImageFit.Cover) | 103 | .objectFit(ImageFit.Cover) |
| 104 | .borderRadius($r('app.float.margin_24')) | 104 | .borderRadius($r('app.float.margin_24')) |
| 105 | + if(!StringUtils.isEmpty(this.contentDetailData.rmhInfo?.authIcon)){ | ||
| 106 | + Stack() { | ||
| 107 | + Image(this.contentDetailData.rmhInfo?.authIcon) | ||
| 108 | + .width($r('app.float.vp_12')) | ||
| 109 | + .height($r('app.float.vp_12')) | ||
| 110 | + .objectFit(ImageFit.Cover) | ||
| 111 | + } | ||
| 112 | + .width($r('app.float.margin_48')) | ||
| 113 | + .height($r('app.float.margin_48')) | ||
| 114 | + .alignContent(Alignment.BottomEnd) | ||
| 115 | + } | ||
| 105 | } | 116 | } |
| 106 | .width($r('app.float.margin_48')) | 117 | .width($r('app.float.margin_48')) |
| 107 | .height($r('app.float.margin_48')) | 118 | .height($r('app.float.margin_48')) |
| 108 | .alignContent(Alignment.Center) | 119 | .alignContent(Alignment.Center) |
| 120 | + .onClick(() => { | ||
| 121 | + ProcessUtils.gotoPeopleShipHomePage(this.contentDetailData.rmhInfo == null ?"":this.contentDetailData.rmhInfo.rmhId) | ||
| 122 | + }) | ||
| 109 | Column(){ | 123 | Column(){ |
| 110 | //昵称 | 124 | //昵称 |
| 111 | Text(this.contentDetailData.rmhInfo?.rmhName) | 125 | Text(this.contentDetailData.rmhInfo?.rmhName) |
| @@ -128,7 +142,7 @@ export struct DynamicDetailComponent { | @@ -128,7 +142,7 @@ export struct DynamicDetailComponent { | ||
| 128 | .margin({right: $r('app.float.margin_6')}) | 142 | .margin({right: $r('app.float.margin_6')}) |
| 129 | if(!StringUtils.isEmpty(this.followStatus)){ | 143 | if(!StringUtils.isEmpty(this.followStatus)){ |
| 130 | if (this.followStatus == '0') { | 144 | if (this.followStatus == '0') { |
| 131 | - Text('关注') | 145 | + Text('+关注') |
| 132 | .width($r('app.float.margin_54')) | 146 | .width($r('app.float.margin_54')) |
| 133 | .height($r('app.float.margin_24')) | 147 | .height($r('app.float.margin_24')) |
| 134 | .textAlign(TextAlign.Center) | 148 | .textAlign(TextAlign.Center) |
| @@ -147,7 +161,8 @@ export struct DynamicDetailComponent { | @@ -147,7 +161,8 @@ export struct DynamicDetailComponent { | ||
| 147 | .textAlign(TextAlign.Center) | 161 | .textAlign(TextAlign.Center) |
| 148 | .fontSize($r('app.float.font_size_12')) | 162 | .fontSize($r('app.float.font_size_12')) |
| 149 | .borderRadius($r('app.float.vp_3')) | 163 | .borderRadius($r('app.float.vp_3')) |
| 150 | - .borderColor($r('app.color.color_CCCCCC')) | 164 | + .borderColor($r('app.color.color_CCCCCC_1A')) |
| 165 | + .backgroundColor($r('app.color.color_CCCCCC_1A')) | ||
| 151 | .fontColor($r('app.color.color_CCCCCC')) | 166 | .fontColor($r('app.color.color_CCCCCC')) |
| 152 | .onClick(() => { | 167 | .onClick(() => { |
| 153 | this.handleAccention() | 168 | this.handleAccention() |
| @@ -300,7 +315,7 @@ export struct DynamicDetailComponent { | @@ -300,7 +315,7 @@ export struct DynamicDetailComponent { | ||
| 300 | } | 315 | } |
| 301 | } | 316 | } |
| 302 | } | 317 | } |
| 303 | - .padding({ left: this.contentDetailData.videoInfo[0].videoLandScape === 1?0: 16,top: $r('app.float.margin_8')}) | 318 | + .padding({ left: this.contentDetailData.videoInfo[0].videoLandScape === 1?0: 25,top: $r('app.float.margin_8')}) |
| 304 | .onClick((event: ClickEvent) => { | 319 | .onClick((event: ClickEvent) => { |
| 305 | ProcessUtils.processPage(this.mJumpInfo) | 320 | ProcessUtils.processPage(this.mJumpInfo) |
| 306 | }) | 321 | }) |
| @@ -312,8 +327,8 @@ export struct DynamicDetailComponent { | @@ -312,8 +327,8 @@ export struct DynamicDetailComponent { | ||
| 312 | .fontSize($r('app.float.font_size_12')) | 327 | .fontSize($r('app.float.font_size_12')) |
| 313 | .lineHeight($r('app.float.margin_16')) | 328 | .lineHeight($r('app.float.margin_16')) |
| 314 | .margin({ top: $r('app.float.margin_16') | 329 | .margin({ top: $r('app.float.margin_16') |
| 315 | - ,left: $r('app.float.margin_16') | ||
| 316 | - ,right: $r('app.float.margin_16') }) | 330 | + ,left: $r('app.float.vp_12') |
| 331 | + ,right: $r('app.float.vp_12') }) | ||
| 317 | //微信/朋友圈/微博 | 332 | //微信/朋友圈/微博 |
| 318 | Row(){ | 333 | Row(){ |
| 319 | Image($r('app.media.xxhdpi_pic_wechat')) | 334 | Image($r('app.media.xxhdpi_pic_wechat')) |
| 1 | -import { Logger, NumberFormatterUtils, DateTimeUtils, EmitterUtils, EmitterEventId, NetworkUtil } from 'wdKit'; | 1 | +import { |
| 2 | + Logger, | ||
| 3 | + NumberFormatterUtils, | ||
| 4 | + DateTimeUtils, | ||
| 5 | + EmitterUtils, | ||
| 6 | + EmitterEventId, | ||
| 7 | + NetworkUtil, | ||
| 8 | + DisplayUtils | ||
| 9 | +} from 'wdKit'; | ||
| 2 | import { | 10 | import { |
| 3 | Action, | 11 | Action, |
| 4 | ContentDetailDTO, | 12 | ContentDetailDTO, |
| @@ -41,6 +49,7 @@ export struct ImageAndTextPageComponent { | @@ -41,6 +49,7 @@ export struct ImageAndTextPageComponent { | ||
| 41 | @State publishCommentModel: publishCommentModel = new publishCommentModel() | 49 | @State publishCommentModel: publishCommentModel = new publishCommentModel() |
| 42 | @State operationButtonList: string[] = ['comment', 'collect', 'share'] | 50 | @State operationButtonList: string[] = ['comment', 'collect', 'share'] |
| 43 | @State isNetConnected: boolean = true | 51 | @State isNetConnected: boolean = true |
| 52 | + @State info: Area | null = null | ||
| 44 | 53 | ||
| 45 | build() { | 54 | build() { |
| 46 | Column() { | 55 | Column() { |
| @@ -131,8 +140,11 @@ export struct ImageAndTextPageComponent { | @@ -131,8 +140,11 @@ export struct ImageAndTextPageComponent { | ||
| 131 | Divider().strokeWidth(6).color('#f5f5f5') | 140 | Divider().strokeWidth(6).color('#f5f5f5') |
| 132 | CommentComponent({ | 141 | CommentComponent({ |
| 133 | publishCommentModel: this.publishCommentModel | 142 | publishCommentModel: this.publishCommentModel |
| 143 | + }).onAreaChange((oldValue: Area, newValue: Area) => { | ||
| 144 | + this.info = newValue | ||
| 134 | }) | 145 | }) |
| 135 | // .onMeasureSize() | 146 | // .onMeasureSize() |
| 147 | + | ||
| 136 | } | 148 | } |
| 137 | } | 149 | } |
| 138 | } | 150 | } |
| @@ -144,28 +156,25 @@ export struct ImageAndTextPageComponent { | @@ -144,28 +156,25 @@ export struct ImageAndTextPageComponent { | ||
| 144 | .scrollBar(BarState.Off) | 156 | .scrollBar(BarState.Off) |
| 145 | .align(Alignment.Top) | 157 | .align(Alignment.Top) |
| 146 | 158 | ||
| 147 | - if(!this.isNetConnected) { | 159 | + if (!this.isNetConnected) { |
| 148 | EmptyComponent({ | 160 | EmptyComponent({ |
| 149 | emptyType: 1, | 161 | emptyType: 1, |
| 150 | emptyButton: true, | 162 | emptyButton: true, |
| 151 | retry: () => { | 163 | retry: () => { |
| 152 | this.getDetail() | 164 | this.getDetail() |
| 153 | } | 165 | } |
| 154 | - }) | ||
| 155 | - }else{ | 166 | + }).padding({ bottom: 200 }) |
| 167 | + } else { | ||
| 156 | if (!this.isPageEnd) { | 168 | if (!this.isPageEnd) { |
| 157 | detailedSkeleton() | 169 | detailedSkeleton() |
| 158 | } | 170 | } |
| 159 | } | 171 | } |
| 160 | - | ||
| 161 | //底部交互区 | 172 | //底部交互区 |
| 162 | - if (this.contentDetailData?.length) { | ||
| 163 | - OperRowListView({ | ||
| 164 | - contentDetailData: this.contentDetailData[0], | ||
| 165 | - publishCommentModel: this.publishCommentModel, | ||
| 166 | - operationButtonList: this.operationButtonList, | ||
| 167 | - }) | ||
| 168 | - } | 173 | + OperRowListView({ |
| 174 | + contentDetailData: this.contentDetailData[0], | ||
| 175 | + publishCommentModel: this.publishCommentModel, | ||
| 176 | + operationButtonList: this.operationButtonList, | ||
| 177 | + }) | ||
| 169 | } | 178 | } |
| 170 | 179 | ||
| 171 | } | 180 | } |
| @@ -308,7 +317,16 @@ export struct ImageAndTextPageComponent { | @@ -308,7 +317,16 @@ export struct ImageAndTextPageComponent { | ||
| 308 | if (targetId) { | 317 | if (targetId) { |
| 309 | if (targetId == this.publishCommentModel.targetId) { | 318 | if (targetId == this.publishCommentModel.targetId) { |
| 310 | // 滚动到评论列表 | 319 | // 滚动到评论列表 |
| 311 | - | 320 | + if (this.info) { |
| 321 | + // let height = DisplayUtils.getDeviceHeight() / 2 | ||
| 322 | + let offSetY = this.info?.globalPosition.y as number | ||
| 323 | + //头部距离48 | ||
| 324 | + this.scroller.scrollTo({ | ||
| 325 | + yOffset: offSetY - 100, | ||
| 326 | + xOffset: 0, | ||
| 327 | + animation: { duration: 1000, curve: Curve.Ease } | ||
| 328 | + }) | ||
| 329 | + } | ||
| 312 | } | 330 | } |
| 313 | } | 331 | } |
| 314 | }) | 332 | }) |
| 1 | // import { FrontLinkObject, MorningEveningPaperDTO, PageInfoBean } from 'wdBean'; | 1 | // import { FrontLinkObject, MorningEveningPaperDTO, PageInfoBean } from 'wdBean'; |
| 2 | import { CompList, PageInfoBean } from 'wdBean'; | 2 | import { CompList, PageInfoBean } from 'wdBean'; |
| 3 | -import { DateTimeUtils, Logger, SPHelper } from 'wdKit/Index'; | 3 | +import { DateTimeUtils, Logger, SPHelper, WindowModel } from 'wdKit/Index'; |
| 4 | import { PaperReaderSimpleDialog } from '../../dialog/PaperReaderDialog'; | 4 | import { PaperReaderSimpleDialog } from '../../dialog/PaperReaderDialog'; |
| 5 | import { MorningEveningViewModel } from '../../viewmodel/MorningEveningViewModel'; | 5 | import { MorningEveningViewModel } from '../../viewmodel/MorningEveningViewModel'; |
| 6 | // import { AudioBarView } from './AudioBarView'; | 6 | // import { AudioBarView } from './AudioBarView'; |
| @@ -102,6 +102,7 @@ export struct MorningEveningPaperComponent { | @@ -102,6 +102,7 @@ export struct MorningEveningPaperComponent { | ||
| 102 | async aboutToAppear() { | 102 | async aboutToAppear() { |
| 103 | let windowHight: window.Window = await window.getLastWindow(getContext(this)); | 103 | let windowHight: window.Window = await window.getLastWindow(getContext(this)); |
| 104 | await windowHight.setWindowLayoutFullScreen(true); | 104 | await windowHight.setWindowLayoutFullScreen(true); |
| 105 | + WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#ffffff', }) | ||
| 105 | this.topSafeHeight = px2vp(windowHight.getWindowAvoidArea(window.AvoidAreaType.TYPE_SYSTEM).topRect.height) | 106 | this.topSafeHeight = px2vp(windowHight.getWindowAvoidArea(window.AvoidAreaType.TYPE_SYSTEM).topRect.height) |
| 106 | 107 | ||
| 107 | let dailyPaperTopicPageId = await SPHelper.default.getSync('dailyPaperTopicPageId', "") as String | 108 | let dailyPaperTopicPageId = await SPHelper.default.getSync('dailyPaperTopicPageId', "") as String |
| @@ -173,6 +174,7 @@ export struct MorningEveningPaperComponent { | @@ -173,6 +174,7 @@ export struct MorningEveningPaperComponent { | ||
| 173 | async aboutToDisappear() { | 174 | async aboutToDisappear() { |
| 174 | let windowHight: window.Window = await window.getLastWindow(getContext(this)); | 175 | let windowHight: window.Window = await window.getLastWindow(getContext(this)); |
| 175 | await windowHight.setWindowLayoutFullScreen(false); | 176 | await windowHight.setWindowLayoutFullScreen(false); |
| 177 | + WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#000000', }) | ||
| 176 | } | 178 | } |
| 177 | 179 | ||
| 178 | onPageHide() { | 180 | onPageHide() { |
| @@ -34,7 +34,7 @@ export struct PaperTitleComponent { | @@ -34,7 +34,7 @@ export struct PaperTitleComponent { | ||
| 34 | Text(this.subTitle ?? '')// Text('2024年\n1月16日') | 34 | Text(this.subTitle ?? '')// Text('2024年\n1月16日') |
| 35 | // .width(50) | 35 | // .width(50) |
| 36 | .margin({ left: 5 }) | 36 | .margin({ left: 5 }) |
| 37 | - .fontSize(12) | 37 | + .fontSize(8) |
| 38 | .fontColor($r('app.color.white')) | 38 | .fontColor($r('app.color.white')) |
| 39 | .maxLines(2) | 39 | .maxLines(2) |
| 40 | 40 | ||
| @@ -47,7 +47,8 @@ export struct PaperTitleComponent { | @@ -47,7 +47,8 @@ export struct PaperTitleComponent { | ||
| 47 | .alignItems(VerticalAlign.Center) | 47 | .alignItems(VerticalAlign.Center) |
| 48 | .alignRules({ | 48 | .alignRules({ |
| 49 | left: { anchor: "img_logo1", align: HorizontalAlign.End }, | 49 | left: { anchor: "img_logo1", align: HorizontalAlign.End }, |
| 50 | - center: { anchor: "__container__", align: VerticalAlign.Center } }) | 50 | + center: { anchor: "__container__", align: VerticalAlign.Center } |
| 51 | + }) | ||
| 51 | .id('row_paper_date') | 52 | .id('row_paper_date') |
| 52 | 53 | ||
| 53 | Image($r('app.media.icon_close')) | 54 | Image($r('app.media.icon_close')) |
| @@ -55,7 +56,8 @@ export struct PaperTitleComponent { | @@ -55,7 +56,8 @@ export struct PaperTitleComponent { | ||
| 55 | .width($r('app.float.top_arrow_size')) | 56 | .width($r('app.float.top_arrow_size')) |
| 56 | .alignRules({ | 57 | .alignRules({ |
| 57 | right: { anchor: "__container__", align: HorizontalAlign.End }, | 58 | right: { anchor: "__container__", align: HorizontalAlign.End }, |
| 58 | - center: { anchor: "__container__", align: VerticalAlign.Center } }) | 59 | + center: { anchor: "__container__", align: VerticalAlign.Center } |
| 60 | + }) | ||
| 59 | .id('img_close') | 61 | .id('img_close') |
| 60 | .onClick((event: ClickEvent) => { | 62 | .onClick((event: ClickEvent) => { |
| 61 | // console.info(TAG, "img_close") | 63 | // console.info(TAG, "img_close") |
| @@ -68,11 +70,12 @@ export struct PaperTitleComponent { | @@ -68,11 +70,12 @@ export struct PaperTitleComponent { | ||
| 68 | .width($r('app.float.top_arrow_size')) | 70 | .width($r('app.float.top_arrow_size')) |
| 69 | .alignRules({ | 71 | .alignRules({ |
| 70 | right: { anchor: "img_close", align: HorizontalAlign.Start }, | 72 | right: { anchor: "img_close", align: HorizontalAlign.Start }, |
| 71 | - center: { anchor: "__container__", align: VerticalAlign.Center } }) | 73 | + center: { anchor: "__container__", align: VerticalAlign.Center } |
| 74 | + }) | ||
| 72 | .id('img_share') | 75 | .id('img_share') |
| 73 | .margin({ right: 13 }) | 76 | .margin({ right: 13 }) |
| 74 | } | 77 | } |
| 75 | - // .margin({ left: 14, right: 14 }) | 78 | + .margin({ left: 14, right: 14 }) |
| 76 | .height($r('app.float.top_bar_height')) | 79 | .height($r('app.float.top_bar_height')) |
| 77 | 80 | ||
| 78 | // .backgroundColor(Color.Black) | 81 | // .backgroundColor(Color.Black) |
| @@ -5,7 +5,8 @@ import { | @@ -5,7 +5,8 @@ import { | ||
| 5 | PhotoListBean, | 5 | PhotoListBean, |
| 6 | postInteractBrowsOperateParams, | 6 | postInteractBrowsOperateParams, |
| 7 | postBatchAttentionStatusParams, | 7 | postBatchAttentionStatusParams, |
| 8 | - postInteractAccentionOperateParams | 8 | + postInteractAccentionOperateParams, |
| 9 | + Params | ||
| 9 | } from 'wdBean'; | 10 | } from 'wdBean'; |
| 10 | import { MultiPictureDetailViewModel } from '../viewmodel/MultiPictureDetailViewModel'; | 11 | import { MultiPictureDetailViewModel } from '../viewmodel/MultiPictureDetailViewModel'; |
| 11 | import display from '@ohos.display'; | 12 | import display from '@ohos.display'; |
| @@ -44,6 +45,7 @@ export struct MultiPictureDetailPageComponent { | @@ -44,6 +45,7 @@ export struct MultiPictureDetailPageComponent { | ||
| 44 | @State netStatus: number | undefined = undefined // 存储网络状态用来展示缺省图 | 45 | @State netStatus: number | undefined = undefined // 存储网络状态用来展示缺省图 |
| 45 | @State showDownload: Boolean = false // 控制是否显示下载默认隐藏 | 46 | @State showDownload: Boolean = false // 控制是否显示下载默认隐藏 |
| 46 | @State publishCommentModel: publishCommentModel = new publishCommentModel() | 47 | @State publishCommentModel: publishCommentModel = new publishCommentModel() |
| 48 | + @State operationButtonList: string[] = ['comment', 'like', 'collect', 'share'] | ||
| 47 | 49 | ||
| 48 | //watch监听页码回调 | 50 | //watch监听页码回调 |
| 49 | onCurrentPageNumUpdated(): void { | 51 | onCurrentPageNumUpdated(): void { |
| @@ -98,19 +100,31 @@ export struct MultiPictureDetailPageComponent { | @@ -98,19 +100,31 @@ export struct MultiPictureDetailPageComponent { | ||
| 98 | if (this.contentDetailData.rmhPlatform == 1) { | 100 | if (this.contentDetailData.rmhPlatform == 1) { |
| 99 | Row() { | 101 | Row() { |
| 100 | Row({ space: 8 }) { | 102 | Row({ space: 8 }) { |
| 101 | - Row() { | ||
| 102 | - Image(this.contentDetailData?.rmhInfo?.rmhHeadUrl) | ||
| 103 | - .borderRadius(24) | ||
| 104 | - .aspectRatio(1) | ||
| 105 | - .border({ width: 1, color: Color.White, style: BorderStyle.Solid }) | ||
| 106 | - .alt($r('app.media.picture_loading')) | ||
| 107 | - .width(36) | ||
| 108 | - .height(36) | ||
| 109 | - .objectFit(ImageFit.Fill) | ||
| 110 | - .interpolation(ImageInterpolation.High) | 103 | + if (this.getImgUrl()){ |
| 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) | ||
| 121 | + } | ||
| 122 | + | ||
| 123 | + }) | ||
| 124 | + } | ||
| 125 | + .width('13%') | ||
| 126 | + .height('100%') | ||
| 111 | } | 127 | } |
| 112 | - .width('13%') | ||
| 113 | - .height('100%') | ||
| 114 | 128 | ||
| 115 | Row() { | 129 | Row() { |
| 116 | Flex({ | 130 | Flex({ |
| @@ -190,6 +204,7 @@ export struct MultiPictureDetailPageComponent { | @@ -190,6 +204,7 @@ export struct MultiPictureDetailPageComponent { | ||
| 190 | middle: { anchor: "__container__", align: HorizontalAlign.Center } | 204 | middle: { anchor: "__container__", align: HorizontalAlign.Center } |
| 191 | }) | 205 | }) |
| 192 | .id('e_attention') | 206 | .id('e_attention') |
| 207 | + .visibility(!this.showDownload ? Visibility.Visible : Visibility.None) | ||
| 193 | } | 208 | } |
| 194 | if (this.contentDetailData?.photoList && this.contentDetailData?.photoList?.length > 0) { | 209 | if (this.contentDetailData?.photoList && this.contentDetailData?.photoList?.length > 0) { |
| 195 | Swiper(this.swiperController) { | 210 | Swiper(this.swiperController) { |
| @@ -305,10 +320,8 @@ export struct MultiPictureDetailPageComponent { | @@ -305,10 +320,8 @@ export struct MultiPictureDetailPageComponent { | ||
| 305 | OperRowListView({ | 320 | OperRowListView({ |
| 306 | contentDetailData: this.contentDetailData, | 321 | contentDetailData: this.contentDetailData, |
| 307 | publishCommentModel: this.publishCommentModel, | 322 | publishCommentModel: this.publishCommentModel, |
| 323 | + operationButtonList: this.operationButtonList, | ||
| 308 | }) | 324 | }) |
| 309 | - .width('100%') | ||
| 310 | - .height(56) | ||
| 311 | - .border({ width: { top: 0.5 }, color: '#FFFFFF' }) | ||
| 312 | } | 325 | } |
| 313 | .visibility(!this.showDownload ? Visibility.Visible : Visibility.None) | 326 | .visibility(!this.showDownload ? Visibility.Visible : Visibility.None) |
| 314 | Column(){ | 327 | Column(){ |
| @@ -385,6 +398,7 @@ export struct MultiPictureDetailPageComponent { | @@ -385,6 +398,7 @@ export struct MultiPictureDetailPageComponent { | ||
| 385 | if (this.contentDetailData?.photoList && this.contentDetailData?.photoList?.length === 0) { | 398 | if (this.contentDetailData?.photoList && this.contentDetailData?.photoList?.length === 0) { |
| 386 | // 暂无内容 | 399 | // 暂无内容 |
| 387 | this.netStatus = 0 | 400 | this.netStatus = 0 |
| 401 | + this.operationButtonList = [] | ||
| 388 | Logger.info(TAG, `this.netStatus:${JSON.stringify(this.netStatus)}`) | 402 | Logger.info(TAG, `this.netStatus:${JSON.stringify(this.netStatus)}`) |
| 389 | } | 403 | } |
| 390 | Logger.info(TAG, `contentDetailData:${JSON.stringify(this.contentDetailData)}`) | 404 | Logger.info(TAG, `contentDetailData:${JSON.stringify(this.contentDetailData)}`) |
| @@ -399,12 +413,17 @@ export struct MultiPictureDetailPageComponent { | @@ -399,12 +413,17 @@ export struct MultiPictureDetailPageComponent { | ||
| 399 | Logger.info(TAG, `fetchDetailData then,err: ${JSON.stringify(err)}`); | 413 | Logger.info(TAG, `fetchDetailData then,err: ${JSON.stringify(err)}`); |
| 400 | // 内容获取失败 | 414 | // 内容获取失败 |
| 401 | this.netStatus = 9 | 415 | this.netStatus = 9 |
| 416 | + this.operationButtonList = [] | ||
| 402 | }) | 417 | }) |
| 403 | } catch (exception) { | 418 | } catch (exception) { |
| 404 | 419 | ||
| 405 | } | 420 | } |
| 406 | } | 421 | } |
| 407 | 422 | ||
| 423 | + getImgUrl() { | ||
| 424 | + return this.contentDetailData?.rmhInfo?.rmhHeadUrl || this.contentDetailData?.userInfo?.userHeadUrl | ||
| 425 | + } | ||
| 426 | + | ||
| 408 | // 记录浏览历史 | 427 | // 记录浏览历史 |
| 409 | private getInteractBrowsOperate() { | 428 | private getInteractBrowsOperate() { |
| 410 | try { | 429 | try { |
| @@ -16,7 +16,7 @@ export struct CardMediaInfo { | @@ -16,7 +16,7 @@ export struct CardMediaInfo { | ||
| 16 | 16 | ||
| 17 | build() { | 17 | build() { |
| 18 | Row() { | 18 | Row() { |
| 19 | - if (this.contentDTO.objectType === '1' || this.contentDTO.objectType === '15') { | 19 | + if (this.contentDTO?.objectType === '1' || this.contentDTO?.objectType === '15') { |
| 20 | // 点播、动态视频 | 20 | // 点播、动态视频 |
| 21 | Row() { | 21 | Row() { |
| 22 | Image($r('app.media.card_play')) | 22 | Image($r('app.media.card_play')) |
| @@ -30,23 +30,23 @@ export struct CardMediaInfo { | @@ -30,23 +30,23 @@ export struct CardMediaInfo { | ||
| 30 | // liveInfo.liveState 直播新闻-直播状态 wait待开播running直播中end已结束cancel已取消paused暂停 | 30 | // liveInfo.liveState 直播新闻-直播状态 wait待开播running直播中end已结束cancel已取消paused暂停 |
| 31 | // 显示直播信息 | 31 | // 显示直播信息 |
| 32 | Row() { | 32 | Row() { |
| 33 | - if (this.contentDTO.liveInfo.liveState === 'wait') { | 33 | + if (this.contentDTO?.liveInfo?.liveState === 'wait') { |
| 34 | Image($r('app.media.card_wait')) | 34 | Image($r('app.media.card_wait')) |
| 35 | .mediaLogo() | 35 | .mediaLogo() |
| 36 | Text('预约') | 36 | Text('预约') |
| 37 | .mediaText() | 37 | .mediaText() |
| 38 | - } else if (this.contentDTO.liveInfo.liveState === 'running') { | 38 | + } else if (this.contentDTO?.liveInfo?.liveState === 'running') { |
| 39 | Image($r('app.media.card_live')) | 39 | Image($r('app.media.card_live')) |
| 40 | .mediaLogo() | 40 | .mediaLogo() |
| 41 | Text('直播中') | 41 | Text('直播中') |
| 42 | .mediaText() | 42 | .mediaText() |
| 43 | - } else if (this.contentDTO.liveInfo.liveState === 'end' && this.contentDTO.liveInfo.replayUri) { | 43 | + } else if (this.contentDTO?.liveInfo?.liveState === 'end' && this.contentDTO?.liveInfo?.replayUri) { |
| 44 | Image($r('app.media.card_play')) | 44 | Image($r('app.media.card_play')) |
| 45 | .mediaLogo() | 45 | .mediaLogo() |
| 46 | Text('回看') | 46 | Text('回看') |
| 47 | .mediaText() | 47 | .mediaText() |
| 48 | - } else if (this.contentDTO.liveInfo.liveState === 'end' && this.contentDTO.liveInfo | ||
| 49 | - .replayUri) { | 48 | + } else if (this.contentDTO?.liveInfo?.liveState === 'end' && this.contentDTO?.liveInfo |
| 49 | + ?.replayUri) { | ||
| 50 | // Image($r('app.media.card_live')) | 50 | // Image($r('app.media.card_live')) |
| 51 | // .mediaLogo() | 51 | // .mediaLogo() |
| 52 | Text('直播结束') | 52 | Text('直播结束') |
| @@ -31,21 +31,25 @@ export struct RmhTitle { | @@ -31,21 +31,25 @@ export struct RmhTitle { | ||
| 31 | .fontColor($r('app.color.color_222222')) | 31 | .fontColor($r('app.color.color_222222')) |
| 32 | .fontWeight(600) | 32 | .fontWeight(600) |
| 33 | .alignSelf(ItemAlign.Start) | 33 | .alignSelf(ItemAlign.Start) |
| 34 | - Row() { | ||
| 35 | - if (this.publishTime) { | ||
| 36 | - Text(DateTimeUtils.getCommentTime(Number.parseFloat(this.publishTime))) | 34 | + Flex({alignContent: FlexAlign.Start, wrap: FlexWrap.NoWrap}) { |
| 35 | + Row() { | ||
| 36 | + if (this.publishTime) { | ||
| 37 | + Text(DateTimeUtils.getCommentTime(Number.parseFloat(this.publishTime))) | ||
| 38 | + .fontSize($r("app.float.font_size_12")) | ||
| 39 | + .fontColor($r("app.color.color_B0B0B0")) | ||
| 40 | + Image($r('app.media.point')) | ||
| 41 | + .width(16) | ||
| 42 | + .height(16) | ||
| 43 | + } | ||
| 44 | + Text(this.rmhInfo.rmhDesc) | ||
| 37 | .fontSize($r("app.float.font_size_12")) | 45 | .fontSize($r("app.float.font_size_12")) |
| 38 | .fontColor($r("app.color.color_B0B0B0")) | 46 | .fontColor($r("app.color.color_B0B0B0")) |
| 39 | - Image($r('app.media.point')) | ||
| 40 | - .width(16) | ||
| 41 | - .height(16) | 47 | + .maxLines(1) |
| 48 | + .alignSelf(ItemAlign.Start) | ||
| 49 | + .textOverflow({ overflow: TextOverflow.Ellipsis }) | ||
| 50 | + .textAlign(TextAlign.Start) | ||
| 42 | } | 51 | } |
| 43 | - Text(this.rmhInfo.rmhDesc) | ||
| 44 | - .fontSize($r("app.float.font_size_12")) | ||
| 45 | - .fontColor($r("app.color.color_B0B0B0")) | ||
| 46 | - .maxLines(1) | ||
| 47 | - .alignSelf(ItemAlign.Start) | ||
| 48 | - .textOverflow({ overflow: TextOverflow.Ellipsis }) | 52 | + .width('75%') |
| 49 | } | 53 | } |
| 50 | } | 54 | } |
| 51 | 55 |
| @@ -7,6 +7,7 @@ import { CardAdvBigImageComponent } from './CardAdvBigImageComponent'; | @@ -7,6 +7,7 @@ import { CardAdvBigImageComponent } from './CardAdvBigImageComponent'; | ||
| 7 | import { CardAdvVideoComponent } from './CardAdvVideoComponent'; | 7 | import { CardAdvVideoComponent } from './CardAdvVideoComponent'; |
| 8 | import { CardAdvGanMiComponent } from './CardAdvGanMiComponent'; | 8 | import { CardAdvGanMiComponent } from './CardAdvGanMiComponent'; |
| 9 | import { CardAdvVideoExComponent } from './CardAdvVideoExComponent'; | 9 | import { CardAdvVideoExComponent } from './CardAdvVideoExComponent'; |
| 10 | +import PageModel from '../../viewmodel/PageModel'; | ||
| 10 | 11 | ||
| 11 | /** | 12 | /** |
| 12 | * @Description: 广告稿件解析类 | 13 | * @Description: 广告稿件解析类 |
| @@ -19,28 +20,29 @@ import { CardAdvVideoExComponent } from './CardAdvVideoExComponent'; | @@ -19,28 +20,29 @@ import { CardAdvVideoExComponent } from './CardAdvVideoExComponent'; | ||
| 19 | @Component | 20 | @Component |
| 20 | export struct AdvCardParser { | 21 | export struct AdvCardParser { |
| 21 | @State compDTO: CompDTO = {} as CompDTO; | 22 | @State compDTO: CompDTO = {} as CompDTO; |
| 23 | + pageModel: PageModel = new PageModel(); | ||
| 22 | 24 | ||
| 23 | build() { | 25 | build() { |
| 24 | - this.contentBuilder(this.compDTO); | 26 | + this.contentBuilder(this.pageModel, this.compDTO); |
| 25 | } | 27 | } |
| 26 | 28 | ||
| 27 | @Builder | 29 | @Builder |
| 28 | - contentBuilder(compDTO: CompDTO) { | 30 | + contentBuilder(pageModel: PageModel, compDTO: CompDTO) { |
| 29 | if (compDTO.matInfo.advSubType === CompStyle.Card_Adv_5) { //三图广告 | 31 | if (compDTO.matInfo.advSubType === CompStyle.Card_Adv_5) { //三图广告 |
| 30 | - CardAdvThreeImageComponent({ compDTO }) | 32 | + CardAdvThreeImageComponent({ pageModel, compDTO }) |
| 31 | } else if (compDTO.matInfo.advSubType === CompStyle.Card_Adv_6) { //小图广告 | 33 | } else if (compDTO.matInfo.advSubType === CompStyle.Card_Adv_6) { //小图广告 |
| 32 | - CardAdvSmallImageComponent({ compDTO }) | 34 | + CardAdvSmallImageComponent({ pageModel, compDTO }) |
| 33 | } else if (compDTO.matInfo.advSubType === CompStyle.Card_Adv_7 || | 35 | } else if (compDTO.matInfo.advSubType === CompStyle.Card_Adv_7 || |
| 34 | compDTO.matInfo.advSubType === CompStyle.Card_Adv_12) { // 长通栏广告 和 顶部长通栏广告 | 36 | compDTO.matInfo.advSubType === CompStyle.Card_Adv_12) { // 长通栏广告 和 顶部长通栏广告 |
| 35 | - CardAdvLongImageComponent({ compDTO }) | 37 | + CardAdvLongImageComponent({ pageModel, compDTO }) |
| 36 | } else if (compDTO.matInfo.advSubType === CompStyle.Card_Adv_8) { //大图广告 | 38 | } else if (compDTO.matInfo.advSubType === CompStyle.Card_Adv_8) { //大图广告 |
| 37 | - CardAdvBigImageComponent({ compDTO }) | 39 | + CardAdvBigImageComponent({ pageModel, compDTO }) |
| 38 | } else if (compDTO.matInfo.advSubType === CompStyle.Card_Adv_9) { //视频广告 | 40 | } else if (compDTO.matInfo.advSubType === CompStyle.Card_Adv_9) { //视频广告 |
| 39 | - CardAdvVideoComponent({ compDTO }) | 41 | + CardAdvVideoComponent({ pageModel, compDTO }) |
| 40 | } else if (compDTO.matInfo.advSubType === CompStyle.Card_Adv_10) { //展会广告 | 42 | } else if (compDTO.matInfo.advSubType === CompStyle.Card_Adv_10) { //展会广告 |
| 41 | - CardAdvVideoExComponent({ compDTO }) | 43 | + CardAdvVideoExComponent({ pageModel, compDTO}) |
| 42 | } else if (compDTO.matInfo.advSubType === CompStyle.Card_Adv_11) { //冠名广告 | 44 | } else if (compDTO.matInfo.advSubType === CompStyle.Card_Adv_11) { //冠名广告 |
| 43 | - CardAdvGanMiComponent({ compDTO }) | 45 | + CardAdvGanMiComponent({ pageModel, compDTO }) |
| 44 | } | 46 | } |
| 45 | } | 47 | } |
| 46 | } | 48 | } |
| 1 | import { CompDTO } from 'wdBean'; | 1 | import { CompDTO } from 'wdBean'; |
| 2 | import { CommonConstants } from 'wdConstant/Index'; | 2 | import { CommonConstants } from 'wdConstant/Index'; |
| 3 | import { ProcessUtils } from 'wdRouter'; | 3 | import { ProcessUtils } from 'wdRouter'; |
| 4 | +import PageModel from '../../viewmodel/PageModel'; | ||
| 4 | import { CardAdvBottom } from './CardAdvBottom'; | 5 | import { CardAdvBottom } from './CardAdvBottom'; |
| 5 | 6 | ||
| 6 | const TAG: string = 'Card2Component'; | 7 | const TAG: string = 'Card2Component'; |
| @@ -16,12 +17,9 @@ const TAG: string = 'Card2Component'; | @@ -16,12 +17,9 @@ const TAG: string = 'Card2Component'; | ||
| 16 | @Component | 17 | @Component |
| 17 | export struct CardAdvBigImageComponent { | 18 | export struct CardAdvBigImageComponent { |
| 18 | @State compDTO: CompDTO = {} as CompDTO | 19 | @State compDTO: CompDTO = {} as CompDTO |
| 19 | - | ||
| 20 | - | 20 | + pageModel: PageModel = new PageModel(); |
| 21 | aboutToAppear(): void { | 21 | aboutToAppear(): void { |
| 22 | 22 | ||
| 23 | - | ||
| 24 | - | ||
| 25 | } | 23 | } |
| 26 | 24 | ||
| 27 | aboutToDisappear(): void { | 25 | aboutToDisappear(): void { |
| @@ -43,7 +41,7 @@ export struct CardAdvBigImageComponent { | @@ -43,7 +41,7 @@ export struct CardAdvBigImageComponent { | ||
| 43 | .borderColor($r('app.color.color_0D000000')) | 41 | .borderColor($r('app.color.color_0D000000')) |
| 44 | .width(CommonConstants.FULL_WIDTH) | 42 | .width(CommonConstants.FULL_WIDTH) |
| 45 | 43 | ||
| 46 | - CardAdvBottom().margin({ | 44 | + CardAdvBottom({pageModel:this.pageModel,compDTO:this.compDTO}).margin({ |
| 47 | top: 8, | 45 | top: 8, |
| 48 | }) | 46 | }) |
| 49 | } | 47 | } |
| 1 | import { CompDTO } from 'wdBean/Index'; | 1 | import { CompDTO } from 'wdBean/Index'; |
| 2 | +import { Logger } from 'wdKit/Index'; | ||
| 3 | +import PageModel from '../../viewmodel/PageModel'; | ||
| 2 | 4 | ||
| 3 | /** | 5 | /** |
| 4 | - * @Description: 广告稿件 底部标签+删除按钮 | 6 | + * @Description: 广告稿件 底部标签+删除按钮 |
| 5 | * @Author: | 7 | * @Author: |
| 6 | - * @Email: liyubing@wondertek.com.cn | 8 | + * @Email: liyubing@wondertek.com.cn |
| 7 | * @CreateDate: | 9 | * @CreateDate: |
| 8 | - * @UpdateRemark: 更新说明 | ||
| 9 | - * @Version: 1.0 | 10 | + * @UpdateRemark: 更新说明 |
| 11 | + * @Version: 1.0 | ||
| 10 | */ | 12 | */ |
| 11 | @Component | 13 | @Component |
| 12 | export struct CardAdvBottom { | 14 | export struct CardAdvBottom { |
| 13 | - @State compDTO: CompDTO = {} as CompDTO; | 15 | + pageModel: PageModel = new PageModel(); |
| 16 | + @State compDTO: CompDTO = {} as CompDTO | ||
| 14 | 17 | ||
| 15 | build() { | 18 | build() { |
| 16 | 19 | ||
| @@ -36,6 +39,30 @@ export struct CardAdvBottom { | @@ -36,6 +39,30 @@ export struct CardAdvBottom { | ||
| 36 | .borderColor($r('app.color.color_EDEDED')) | 39 | .borderColor($r('app.color.color_EDEDED')) |
| 37 | .borderRadius(4) | 40 | .borderRadius(4) |
| 38 | 41 | ||
| 39 | - }.width('100%') | 42 | + }.width('100%').onClick(() => { |
| 43 | + | ||
| 44 | + this.delComp() | ||
| 45 | + }) | ||
| 46 | + } | ||
| 47 | + /** | ||
| 48 | + * 删除稿件 | ||
| 49 | + */ | ||
| 50 | + private delComp() { | ||
| 51 | + if (this.pageModel) { | ||
| 52 | + | ||
| 53 | + let a = this.compDTO; | ||
| 54 | + let currentIndex = -1 | ||
| 55 | + for (let i = 0; i < this.pageModel.compList.size(); i++) { | ||
| 56 | + let b = this.pageModel.compList.getData(i) | ||
| 57 | + if (a.compStyle === b.compStyle && a.matInfo === b.matInfo) { | ||
| 58 | + currentIndex = i | ||
| 59 | + break; | ||
| 60 | + } | ||
| 61 | + } | ||
| 62 | + Logger.error("ZZZXXXXX","currentIndex====>"+currentIndex); | ||
| 63 | + if (currentIndex >= 0) { | ||
| 64 | + this.pageModel.compList.deleteItem(currentIndex) | ||
| 65 | + } | ||
| 66 | + } | ||
| 40 | } | 67 | } |
| 41 | } | 68 | } |
| @@ -4,8 +4,10 @@ import { AdvExtraData, AdvExtraItemData } from 'wdBean/src/main/ets/bean/adv/Adv | @@ -4,8 +4,10 @@ import { AdvExtraData, AdvExtraItemData } from 'wdBean/src/main/ets/bean/adv/Adv | ||
| 4 | import { CompAdvMatInfoBean } from 'wdBean/src/main/ets/bean/adv/CompAdvInfoBean'; | 4 | import { CompAdvMatInfoBean } from 'wdBean/src/main/ets/bean/adv/CompAdvInfoBean'; |
| 5 | import { CommonConstants } from 'wdConstant/Index'; | 5 | import { CommonConstants } from 'wdConstant/Index'; |
| 6 | import { ProcessUtils } from 'wdRouter'; | 6 | import { ProcessUtils } from 'wdRouter'; |
| 7 | +import PageModel from '../../viewmodel/PageModel'; | ||
| 7 | import { CardMediaInfo } from '../cardCommon/CardMediaInfo' | 8 | import { CardMediaInfo } from '../cardCommon/CardMediaInfo' |
| 8 | import { CardSourceInfo } from '../cardCommon/CardSourceInfo' | 9 | import { CardSourceInfo } from '../cardCommon/CardSourceInfo' |
| 10 | +import { CardAdvTop } from './CardAdvTop'; | ||
| 9 | 11 | ||
| 10 | const TAG: string = 'Card2Component'; | 12 | const TAG: string = 'Card2Component'; |
| 11 | 13 | ||
| @@ -22,6 +24,7 @@ export struct CardAdvGanMiComponent { | @@ -22,6 +24,7 @@ export struct CardAdvGanMiComponent { | ||
| 22 | @State compDTO: CompDTO = {} as CompDTO | 24 | @State compDTO: CompDTO = {} as CompDTO |
| 23 | @State advExtraData: AdvExtraData = {} as AdvExtraData | 25 | @State advExtraData: AdvExtraData = {} as AdvExtraData |
| 24 | @State advLength: number = 0; | 26 | @State advLength: number = 0; |
| 27 | + pageModel: PageModel = new PageModel(); | ||
| 25 | 28 | ||
| 26 | aboutToAppear(): void { | 29 | aboutToAppear(): void { |
| 27 | 30 | ||
| @@ -29,7 +32,7 @@ export struct CardAdvGanMiComponent { | @@ -29,7 +32,7 @@ export struct CardAdvGanMiComponent { | ||
| 29 | let labelDTO = JSON.parse(extraData) as AdvExtraData | 32 | let labelDTO = JSON.parse(extraData) as AdvExtraData |
| 30 | this.advExtraData = labelDTO | 33 | this.advExtraData = labelDTO |
| 31 | //this.advExtraData.item = [this.advExtraData.item[0]] | 34 | //this.advExtraData.item = [this.advExtraData.item[0]] |
| 32 | - // this.advExtraData.item[2].title ="我爱你中国我爱你中国我爱你中国我爱你中国我爱你中国我爱你中国我爱你中国我爱你中国我爱你中国我爱你中国我爱你中国我爱你中国我爱你中国我爱你中国我爱你中国" | 35 | + // this.advExtraData.item[2].title ="我爱你中国我爱你中国我爱你中国我爱你中国我爱你中国我爱你中国我爱你中国我爱你中国我爱你中国我爱你中国我爱你中国我爱你中国我爱你中国我爱你中国我爱你中国" |
| 33 | this.advLength = this.advExtraData.item.length | 36 | this.advLength = this.advExtraData.item.length |
| 34 | } | 37 | } |
| 35 | 38 | ||
| @@ -53,41 +56,7 @@ export struct CardAdvGanMiComponent { | @@ -53,41 +56,7 @@ export struct CardAdvGanMiComponent { | ||
| 53 | .borderColor($r('app.color.color_0D000000')) | 56 | .borderColor($r('app.color.color_0D000000')) |
| 54 | 57 | ||
| 55 | // 广告标签和删除功能 | 58 | // 广告标签和删除功能 |
| 56 | - Row() { | ||
| 57 | - Text($r('app.string.comp_advertisement')) | ||
| 58 | - .fontSize('10fp') | ||
| 59 | - .fontColor($r('app.color.white')) | ||
| 60 | - .width(28) | ||
| 61 | - .height(16) | ||
| 62 | - .backgroundColor('#4D000000') | ||
| 63 | - .borderRadius(3) | ||
| 64 | - .textAlign(TextAlign.Center) | ||
| 65 | - | ||
| 66 | - Blank() | ||
| 67 | - | ||
| 68 | - Stack() { | ||
| 69 | - Image($r('app.media.comp_adv_close_white')) | ||
| 70 | - .width(9) | ||
| 71 | - .height(9) | ||
| 72 | - .borderRadius({ | ||
| 73 | - topLeft: '4vp', | ||
| 74 | - topRight: '4vp', | ||
| 75 | - bottomLeft: '4vp', | ||
| 76 | - bottomRight: '4vp' | ||
| 77 | - }) | ||
| 78 | - } | ||
| 79 | - .width(18) | ||
| 80 | - .height(14) | ||
| 81 | - .backgroundColor('#4D000000') | ||
| 82 | - .borderWidth(0.5) | ||
| 83 | - .borderColor($r('app.color.white')) | ||
| 84 | - .borderRadius(3) | ||
| 85 | - | ||
| 86 | - }.width('100%').padding({ | ||
| 87 | - top: 8, | ||
| 88 | - left: 8, | ||
| 89 | - right: 8 | ||
| 90 | - }) | 59 | + CardAdvTop({ pageModel: this.pageModel, compDTO: this.compDTO }) |
| 91 | } | 60 | } |
| 92 | .alignContent(Alignment.Top) | 61 | .alignContent(Alignment.Top) |
| 93 | .width(CommonConstants.FULL_WIDTH) | 62 | .width(CommonConstants.FULL_WIDTH) |
| @@ -100,7 +69,7 @@ export struct CardAdvGanMiComponent { | @@ -100,7 +69,7 @@ export struct CardAdvGanMiComponent { | ||
| 100 | // | 69 | // |
| 101 | List({ space: 8 }) { | 70 | List({ space: 8 }) { |
| 102 | 71 | ||
| 103 | - ForEach(this.advExtraData.item, (content: AdvExtraItemData) => { | 72 | + ForEach(this.advExtraData.item, (content: AdvExtraItemData, index: number) => { |
| 104 | 73 | ||
| 105 | ListItem() { | 74 | ListItem() { |
| 106 | // 广告列表信息 | 75 | // 广告列表信息 |
| @@ -123,7 +92,10 @@ export struct CardAdvGanMiComponent { | @@ -123,7 +92,10 @@ export struct CardAdvGanMiComponent { | ||
| 123 | .width('100%') | 92 | .width('100%') |
| 124 | .margin({ top: 8 }) | 93 | .margin({ top: 8 }) |
| 125 | 94 | ||
| 126 | - }.width(this.advLength >= 3 ? 150 : this.advLength == 2 ? 210 : '100%').onClick(() => { | 95 | + } |
| 96 | + .width(this.advLength >= 3 ? 150 : this.advLength == 2 ? 210 : '100%') | ||
| 97 | + .margin({ left: index === 0 ? this.advLength == 1 ? 0 : 16 : 0 }) | ||
| 98 | + .onClick(() => { | ||
| 127 | 99 | ||
| 128 | let matInfo: CompAdvMatInfoBean = { | 100 | let matInfo: CompAdvMatInfoBean = { |
| 129 | linkUrl: content.linkUrl, | 101 | linkUrl: content.linkUrl, |
| @@ -142,7 +114,7 @@ export struct CardAdvGanMiComponent { | @@ -142,7 +114,7 @@ export struct CardAdvGanMiComponent { | ||
| 142 | .listDirection(Axis.Horizontal) | 114 | .listDirection(Axis.Horizontal) |
| 143 | .edgeEffect(EdgeEffect.None) | 115 | .edgeEffect(EdgeEffect.None) |
| 144 | .scrollBar(BarState.Off) | 116 | .scrollBar(BarState.Off) |
| 145 | - .contentStartOffset(this.advLength == 1 ? 0 : 16) | 117 | + // .contentStartOffset(this.advLength == 1 ? 0 : 16) |
| 146 | .contentEndOffset(this.advLength == 1 ? 0 : 16) | 118 | .contentEndOffset(this.advLength == 1 ? 0 : 16) |
| 147 | .margin({ top: 10, bottom: 10 }) | 119 | .margin({ top: 10, bottom: 10 }) |
| 148 | .padding({ | 120 | .padding({ |
| @@ -150,7 +122,6 @@ export struct CardAdvGanMiComponent { | @@ -150,7 +122,6 @@ export struct CardAdvGanMiComponent { | ||
| 150 | right: this.advLength == 1 ? 16 : 0, | 122 | right: this.advLength == 1 ? 16 : 0, |
| 151 | }) | 123 | }) |
| 152 | 124 | ||
| 153 | - | ||
| 154 | // 更多按钮 | 125 | // 更多按钮 |
| 155 | commonButton(this.advExtraData) | 126 | commonButton(this.advExtraData) |
| 156 | 127 |
sight_harmony/features/wdComponent/src/main/ets/components/cardViewAdv/CardAdvLongImageComponent.ets
| 1 | //全标题 "appStyle":"2", | 1 | //全标题 "appStyle":"2", |
| 2 | -import { CompDTO, ContentDTO } from 'wdBean'; | 2 | +import { CompDTO } from 'wdBean'; |
| 3 | import { CommonConstants, CompStyle } from 'wdConstant/Index'; | 3 | import { CommonConstants, CompStyle } from 'wdConstant/Index'; |
| 4 | import { ProcessUtils } from 'wdRouter'; | 4 | import { ProcessUtils } from 'wdRouter'; |
| 5 | -import { CardMediaInfo } from '../cardCommon/CardMediaInfo' | ||
| 6 | -import { CardSourceInfo } from '../cardCommon/CardSourceInfo' | 5 | +import PageModel from '../../viewmodel/PageModel'; |
| 7 | import { CardAdvBottom } from './CardAdvBottom'; | 6 | import { CardAdvBottom } from './CardAdvBottom'; |
| 8 | 7 | ||
| 9 | const TAG: string = 'Card2Component'; | 8 | const TAG: string = 'Card2Component'; |
| @@ -18,15 +17,11 @@ const TAG: string = 'Card2Component'; | @@ -18,15 +17,11 @@ const TAG: string = 'Card2Component'; | ||
| 18 | */ | 17 | */ |
| 19 | @Component | 18 | @Component |
| 20 | export struct CardAdvLongImageComponent { | 19 | export struct CardAdvLongImageComponent { |
| 21 | - | ||
| 22 | - | ||
| 23 | @State compDTO: CompDTO = {} as CompDTO | 20 | @State compDTO: CompDTO = {} as CompDTO |
| 24 | - | ||
| 25 | - @State haveTitle : boolean = true | 21 | + @State haveTitle: boolean = true |
| 22 | + pageModel: PageModel = new PageModel(); | ||
| 26 | 23 | ||
| 27 | aboutToAppear(): void { | 24 | aboutToAppear(): void { |
| 28 | - | ||
| 29 | - | ||
| 30 | this.haveTitle = this.compDTO.matInfo.advSubType === CompStyle.Card_Adv_7; | 25 | this.haveTitle = this.compDTO.matInfo.advSubType === CompStyle.Card_Adv_7; |
| 31 | } | 26 | } |
| 32 | 27 | ||
| @@ -37,12 +32,10 @@ export struct CardAdvLongImageComponent { | @@ -37,12 +32,10 @@ export struct CardAdvLongImageComponent { | ||
| 37 | build() { | 32 | build() { |
| 38 | 33 | ||
| 39 | Column() { | 34 | Column() { |
| 40 | - | ||
| 41 | //新闻标题 | 35 | //新闻标题 |
| 42 | - if(this.haveTitle ){ | 36 | + if (this.haveTitle) { |
| 43 | Text(this.compDTO.matInfo.advTitle).width('100%').bottomTextStyle().margin({ bottom: 8, }) | 37 | Text(this.compDTO.matInfo.advTitle).width('100%').bottomTextStyle().margin({ bottom: 8, }) |
| 44 | } | 38 | } |
| 45 | - | ||
| 46 | //长图 | 39 | //长图 |
| 47 | Image(this.compDTO.matInfo.matImageUrl[0]) | 40 | Image(this.compDTO.matInfo.matImageUrl[0]) |
| 48 | .width(CommonConstants.FULL_WIDTH) | 41 | .width(CommonConstants.FULL_WIDTH) |
| @@ -51,7 +44,7 @@ export struct CardAdvLongImageComponent { | @@ -51,7 +44,7 @@ export struct CardAdvLongImageComponent { | ||
| 51 | .borderWidth(0.5) | 44 | .borderWidth(0.5) |
| 52 | .borderColor($r('app.color.color_0D000000')) | 45 | .borderColor($r('app.color.color_0D000000')) |
| 53 | 46 | ||
| 54 | - CardAdvBottom().margin({ | 47 | + CardAdvBottom({ pageModel: this.pageModel, compDTO:this.compDTO }).margin({ |
| 55 | top: 8, | 48 | top: 8, |
| 56 | }) | 49 | }) |
| 57 | } | 50 | } |
| @@ -5,6 +5,7 @@ import { ProcessUtils } from 'wdRouter'; | @@ -5,6 +5,7 @@ import { ProcessUtils } from 'wdRouter'; | ||
| 5 | import measure from '@ohos.measure'; | 5 | import measure from '@ohos.measure'; |
| 6 | import { DisplayUtils } from 'wdKit/Index'; | 6 | import { DisplayUtils } from 'wdKit/Index'; |
| 7 | import { CardAdvBottom } from './CardAdvBottom'; | 7 | import { CardAdvBottom } from './CardAdvBottom'; |
| 8 | +import PageModel from '../../viewmodel/PageModel'; | ||
| 8 | 9 | ||
| 9 | const TAG: string = 'CardAdvSmallImageComponent'; | 10 | const TAG: string = 'CardAdvSmallImageComponent'; |
| 10 | 11 | ||
| @@ -20,7 +21,7 @@ const TAG: string = 'CardAdvSmallImageComponent'; | @@ -20,7 +21,7 @@ const TAG: string = 'CardAdvSmallImageComponent'; | ||
| 20 | export struct CardAdvSmallImageComponent { | 21 | export struct CardAdvSmallImageComponent { |
| 21 | @State compDTO: CompDTO = {} as CompDTO | 22 | @State compDTO: CompDTO = {} as CompDTO |
| 22 | @State isBigThreeLine: boolean = false // 标题的行数大于等于3行 是true | 23 | @State isBigThreeLine: boolean = false // 标题的行数大于等于3行 是true |
| 23 | - | 24 | + pageModel: PageModel = new PageModel(); |
| 24 | aboutToAppear(): void { | 25 | aboutToAppear(): void { |
| 25 | 26 | ||
| 26 | // 计算标题文本行数 | 27 | // 计算标题文本行数 |
| @@ -68,7 +69,7 @@ export struct CardAdvSmallImageComponent { | @@ -68,7 +69,7 @@ export struct CardAdvSmallImageComponent { | ||
| 68 | .margin({ left: 12 }) | 69 | .margin({ left: 12 }) |
| 69 | 70 | ||
| 70 | 71 | ||
| 71 | - CardAdvBottom().width('62%').id('bottom_adv').alignRules({ | 72 | + CardAdvBottom({pageModel:this.pageModel,compDTO:this.compDTO}).width('62%').id('bottom_adv').alignRules({ |
| 72 | bottom: { anchor: this.isBigThreeLine ? '' : 'adv_imag', align: VerticalAlign.Bottom }, | 73 | bottom: { anchor: this.isBigThreeLine ? '' : 'adv_imag', align: VerticalAlign.Bottom }, |
| 73 | right: { anchor: this.isBigThreeLine ? '' : 'adv_imag', align: HorizontalAlign.Start }, | 74 | right: { anchor: this.isBigThreeLine ? '' : 'adv_imag', align: HorizontalAlign.Start }, |
| 74 | top: { anchor: this.isBigThreeLine ? 'title_name' : '', align: VerticalAlign.Bottom }, | 75 | top: { anchor: this.isBigThreeLine ? 'title_name' : '', align: VerticalAlign.Bottom }, |
| @@ -2,6 +2,7 @@ | @@ -2,6 +2,7 @@ | ||
| 2 | import { CompDTO, ContentDTO } from 'wdBean'; | 2 | import { CompDTO, ContentDTO } from 'wdBean'; |
| 3 | import { CommonConstants } from 'wdConstant/Index'; | 3 | import { CommonConstants } from 'wdConstant/Index'; |
| 4 | import { ProcessUtils } from 'wdRouter'; | 4 | import { ProcessUtils } from 'wdRouter'; |
| 5 | +import PageModel from '../../viewmodel/PageModel'; | ||
| 5 | import { CardMediaInfo } from '../cardCommon/CardMediaInfo' | 6 | import { CardMediaInfo } from '../cardCommon/CardMediaInfo' |
| 6 | import { CardSourceInfo } from '../cardCommon/CardSourceInfo' | 7 | import { CardSourceInfo } from '../cardCommon/CardSourceInfo' |
| 7 | import { CardAdvBottom } from './CardAdvBottom'; | 8 | import { CardAdvBottom } from './CardAdvBottom'; |
| @@ -19,7 +20,7 @@ const TAG: string = 'Card2Component'; | @@ -19,7 +20,7 @@ const TAG: string = 'Card2Component'; | ||
| 19 | @Component | 20 | @Component |
| 20 | export struct CardAdvThreeImageComponent { | 21 | export struct CardAdvThreeImageComponent { |
| 21 | @State compDTO: CompDTO = {} as CompDTO | 22 | @State compDTO: CompDTO = {} as CompDTO |
| 22 | - | 23 | + pageModel: PageModel = new PageModel(); |
| 23 | aboutToAppear(): void { | 24 | aboutToAppear(): void { |
| 24 | 25 | ||
| 25 | } | 26 | } |
| @@ -63,7 +64,7 @@ export struct CardAdvThreeImageComponent { | @@ -63,7 +64,7 @@ export struct CardAdvThreeImageComponent { | ||
| 63 | .margin({ top: 8 }) | 64 | .margin({ top: 8 }) |
| 64 | 65 | ||
| 65 | // 广告工具组件 | 66 | // 广告工具组件 |
| 66 | - CardAdvBottom().width('100%').margin({ top: 8 }) | 67 | + CardAdvBottom({pageModel:this.pageModel,compDTO:this.compDTO}).width('100%').margin({ top: 8 }) |
| 67 | } | 68 | } |
| 68 | .width('100%') | 69 | .width('100%') |
| 69 | .justifyContent(FlexAlign.Start) | 70 | .justifyContent(FlexAlign.Start) |
| 1 | +import { CompDTO } from 'wdBean/Index'; | ||
| 2 | +import { Logger } from 'wdKit/Index'; | ||
| 3 | +import PageModel from '../../viewmodel/PageModel'; | ||
| 4 | + | ||
| 5 | +/** | ||
| 6 | + * @Description: 广告稿件 顶部标签+删除按钮 | ||
| 7 | + * @Author: | ||
| 8 | + * @Email: liyubing@wondertek.com.cn | ||
| 9 | + * @CreateDate: | ||
| 10 | + * @UpdateRemark: 更新说明 | ||
| 11 | + * @Version: 1.0 | ||
| 12 | + */ | ||
| 13 | +@Component | ||
| 14 | +export struct CardAdvTop { | ||
| 15 | + pageModel: PageModel = new PageModel(); | ||
| 16 | + compDTO: CompDTO = {} as CompDTO | ||
| 17 | + | ||
| 18 | + build() { | ||
| 19 | + | ||
| 20 | + Row() { | ||
| 21 | + Text($r('app.string.comp_advertisement')) | ||
| 22 | + .fontSize('10fp') | ||
| 23 | + .fontColor($r('app.color.white')) | ||
| 24 | + .width(28) | ||
| 25 | + .height(16) | ||
| 26 | + .backgroundColor('#4D000000') | ||
| 27 | + .borderRadius(4) | ||
| 28 | + .textAlign(TextAlign.Center) | ||
| 29 | + | ||
| 30 | + Blank() | ||
| 31 | + | ||
| 32 | + Stack() { | ||
| 33 | + Image($r('app.media.comp_adv_close_white')) | ||
| 34 | + .width(9) | ||
| 35 | + .height(9) | ||
| 36 | + .borderRadius({ | ||
| 37 | + topLeft: '4vp', | ||
| 38 | + topRight: '4vp', | ||
| 39 | + bottomLeft: '4vp', | ||
| 40 | + bottomRight: '4vp' | ||
| 41 | + }) | ||
| 42 | + } | ||
| 43 | + .width(18) | ||
| 44 | + .height(14) | ||
| 45 | + .backgroundColor('#4D000000') | ||
| 46 | + .borderWidth(0.5) | ||
| 47 | + .borderColor($r('app.color.white')) | ||
| 48 | + .borderRadius(4) | ||
| 49 | + | ||
| 50 | + }.width('100%').padding({ | ||
| 51 | + top: 8, | ||
| 52 | + left: 8, | ||
| 53 | + right: 8 | ||
| 54 | + }).onClick(() => { | ||
| 55 | + this.delComp() | ||
| 56 | + }) | ||
| 57 | + } | ||
| 58 | + | ||
| 59 | + /** | ||
| 60 | + * 删除稿件 | ||
| 61 | + */ | ||
| 62 | + private delComp() { | ||
| 63 | + if (this.pageModel) { | ||
| 64 | + | ||
| 65 | + let a = this.compDTO; | ||
| 66 | + let currentIndex = -1 | ||
| 67 | + for (let i = 0; i < this.pageModel.compList.size(); i++) { | ||
| 68 | + let b = this.pageModel.compList.getData(i) | ||
| 69 | + if (a.compStyle === b.compStyle && a.matInfo === b.matInfo) { | ||
| 70 | + currentIndex = i | ||
| 71 | + break; | ||
| 72 | + } | ||
| 73 | + } | ||
| 74 | + | ||
| 75 | + Logger.error("ZZZXXXXX","currentIndex====>"+currentIndex); | ||
| 76 | + if (currentIndex >= 0) { | ||
| 77 | + this.pageModel.compList.deleteItem(currentIndex) | ||
| 78 | + } | ||
| 79 | + } | ||
| 80 | + } | ||
| 81 | +} |
| @@ -2,6 +2,7 @@ | @@ -2,6 +2,7 @@ | ||
| 2 | import { CompDTO, ContentDTO, VideoInfoDTO } from 'wdBean'; | 2 | import { CompDTO, ContentDTO, VideoInfoDTO } from 'wdBean'; |
| 3 | import { CommonConstants } from 'wdConstant/Index'; | 3 | import { CommonConstants } from 'wdConstant/Index'; |
| 4 | import { ProcessUtils } from 'wdRouter'; | 4 | import { ProcessUtils } from 'wdRouter'; |
| 5 | +import PageModel from '../../viewmodel/PageModel'; | ||
| 5 | import { CardMediaInfo } from '../cardCommon/CardMediaInfo' | 6 | import { CardMediaInfo } from '../cardCommon/CardMediaInfo' |
| 6 | import { CardSourceInfo } from '../cardCommon/CardSourceInfo' | 7 | import { CardSourceInfo } from '../cardCommon/CardSourceInfo' |
| 7 | import { CardAdvBottom } from './CardAdvBottom'; | 8 | import { CardAdvBottom } from './CardAdvBottom'; |
| @@ -20,7 +21,7 @@ const TAG: string = 'Card2Component'; | @@ -20,7 +21,7 @@ const TAG: string = 'Card2Component'; | ||
| 20 | export struct CardAdvVideoComponent { | 21 | export struct CardAdvVideoComponent { |
| 21 | @State compDTO: CompDTO = {} as CompDTO | 22 | @State compDTO: CompDTO = {} as CompDTO |
| 22 | @State contentDTO: ContentDTO = {} as ContentDTO | 23 | @State contentDTO: ContentDTO = {} as ContentDTO |
| 23 | - | 24 | + pageModel: PageModel = new PageModel(); |
| 24 | aboutToAppear(): void { | 25 | aboutToAppear(): void { |
| 25 | 26 | ||
| 26 | // this.contentDTO.objectType = '1' | 27 | // this.contentDTO.objectType = '1' |
| @@ -54,7 +55,7 @@ export struct CardAdvVideoComponent { | @@ -54,7 +55,7 @@ export struct CardAdvVideoComponent { | ||
| 54 | .width(CommonConstants.FULL_WIDTH) | 55 | .width(CommonConstants.FULL_WIDTH) |
| 55 | .margin({ top: 8 }) | 56 | .margin({ top: 8 }) |
| 56 | 57 | ||
| 57 | - CardAdvBottom().margin({ | 58 | + CardAdvBottom({pageModel:this.pageModel,compDTO:this.compDTO}).margin({ |
| 58 | top: 8, | 59 | top: 8, |
| 59 | }) | 60 | }) |
| 60 | } | 61 | } |
| @@ -3,6 +3,8 @@ import { AdvExtraData, AdvExtraItemData } from 'wdBean/src/main/ets/bean/adv/Adv | @@ -3,6 +3,8 @@ import { AdvExtraData, AdvExtraItemData } from 'wdBean/src/main/ets/bean/adv/Adv | ||
| 3 | import { CompAdvMatInfoBean } from 'wdBean/src/main/ets/bean/adv/CompAdvInfoBean'; | 3 | import { CompAdvMatInfoBean } from 'wdBean/src/main/ets/bean/adv/CompAdvInfoBean'; |
| 4 | import { CommonConstants } from 'wdConstant/Index'; | 4 | import { CommonConstants } from 'wdConstant/Index'; |
| 5 | import { ProcessUtils } from 'wdRouter'; | 5 | import { ProcessUtils } from 'wdRouter'; |
| 6 | +import PageModel from '../../viewmodel/PageModel'; | ||
| 7 | +import { CardAdvTop } from './CardAdvTop'; | ||
| 6 | 8 | ||
| 7 | const TAG: string = 'Card2Component'; | 9 | const TAG: string = 'Card2Component'; |
| 8 | 10 | ||
| @@ -18,6 +20,7 @@ const TAG: string = 'Card2Component'; | @@ -18,6 +20,7 @@ const TAG: string = 'Card2Component'; | ||
| 18 | export struct CardAdvVideoExComponent { | 20 | export struct CardAdvVideoExComponent { |
| 19 | @State compDTO: CompDTO = {} as CompDTO | 21 | @State compDTO: CompDTO = {} as CompDTO |
| 20 | @State advExtraData: AdvExtraData = {} as AdvExtraData | 22 | @State advExtraData: AdvExtraData = {} as AdvExtraData |
| 23 | + pageModel: PageModel = new PageModel(); | ||
| 21 | 24 | ||
| 22 | aboutToAppear(): void { | 25 | aboutToAppear(): void { |
| 23 | 26 | ||
| @@ -45,42 +48,7 @@ export struct CardAdvVideoExComponent { | @@ -45,42 +48,7 @@ export struct CardAdvVideoExComponent { | ||
| 45 | .borderColor($r('app.color.color_0D000000')) | 48 | .borderColor($r('app.color.color_0D000000')) |
| 46 | 49 | ||
| 47 | 50 | ||
| 48 | - Row() { | ||
| 49 | - | ||
| 50 | - Text($r('app.string.comp_advertisement')) | ||
| 51 | - .fontSize('10fp') | ||
| 52 | - .fontColor($r('app.color.white')) | ||
| 53 | - .width(28) | ||
| 54 | - .height(16) | ||
| 55 | - .backgroundColor('#4D000000') | ||
| 56 | - .borderRadius(4) | ||
| 57 | - .textAlign(TextAlign.Center) | ||
| 58 | - | ||
| 59 | - Blank() | ||
| 60 | - | ||
| 61 | - Stack() { | ||
| 62 | - Image($r('app.media.comp_adv_close_white')) | ||
| 63 | - .width(9) | ||
| 64 | - .height(9) | ||
| 65 | - .borderRadius({ | ||
| 66 | - topLeft: '4vp', | ||
| 67 | - topRight: '4vp', | ||
| 68 | - bottomLeft: '4vp', | ||
| 69 | - bottomRight: '4vp' | ||
| 70 | - }) | ||
| 71 | - } | ||
| 72 | - .width(18) | ||
| 73 | - .height(14) | ||
| 74 | - .backgroundColor('#4D000000') | ||
| 75 | - .borderWidth(0.5) | ||
| 76 | - .borderColor($r('app.color.white')) | ||
| 77 | - .borderRadius(4) | ||
| 78 | - | ||
| 79 | - }.width('100%').padding({ | ||
| 80 | - top: 8, | ||
| 81 | - left: 8, | ||
| 82 | - right: 8 | ||
| 83 | - }) | 51 | + CardAdvTop({ pageModel: this.pageModel, compDTO: this.compDTO }) |
| 84 | } | 52 | } |
| 85 | .alignContent(Alignment.Top) | 53 | .alignContent(Alignment.Top) |
| 86 | .width(CommonConstants.FULL_WIDTH) | 54 | .width(CommonConstants.FULL_WIDTH) |
| @@ -2,6 +2,7 @@ import { ContentDTO, slideShows } from 'wdBean'; | @@ -2,6 +2,7 @@ import { ContentDTO, slideShows } from 'wdBean'; | ||
| 2 | import { CommonConstants } from 'wdConstant'; | 2 | import { CommonConstants } from 'wdConstant'; |
| 3 | import { ProcessUtils } from 'wdRouter'; | 3 | import { ProcessUtils } from 'wdRouter'; |
| 4 | import { CardSourceInfo } from '../cardCommon/CardSourceInfo'; | 4 | import { CardSourceInfo } from '../cardCommon/CardSourceInfo'; |
| 5 | +import { CardMediaInfo } from '../cardCommon/CardMediaInfo'; | ||
| 5 | 6 | ||
| 6 | /** | 7 | /** |
| 7 | * 大专题卡--CompStyle: 10 | 8 | * 大专题卡--CompStyle: 10 |
| @@ -23,9 +24,6 @@ export struct Card10Component { | @@ -23,9 +24,6 @@ export struct Card10Component { | ||
| 23 | .maxLines(2) | 24 | .maxLines(2) |
| 24 | .textOverflow({ overflow: TextOverflow.Ellipsis }) | 25 | .textOverflow({ overflow: TextOverflow.Ellipsis }) |
| 25 | .margin({ bottom: 19 }) | 26 | .margin({ bottom: 19 }) |
| 26 | - .onClick((event: ClickEvent) => { | ||
| 27 | - ProcessUtils.processPage(this.contentDTO) | ||
| 28 | - }) | ||
| 29 | } | 27 | } |
| 30 | // 大图 | 28 | // 大图 |
| 31 | Stack() { | 29 | Stack() { |
| @@ -111,12 +109,23 @@ export struct Card10Component { | @@ -111,12 +109,23 @@ export struct Card10Component { | ||
| 111 | 109 | ||
| 112 | // 右侧图片 | 110 | // 右侧图片 |
| 113 | if (item.fullColumnImgUrls[0] && item.fullColumnImgUrls[0].url) { | 111 | if (item.fullColumnImgUrls[0] && item.fullColumnImgUrls[0].url) { |
| 114 | - Image(item.fullColumnImgUrls[0].url) | ||
| 115 | - .width(117) | ||
| 116 | - .height(78) | ||
| 117 | - .objectFit(ImageFit.Cover) | ||
| 118 | - .borderRadius($r('app.float.image_border_radius')) | ||
| 119 | - .margin({ left: 12 }) | 112 | + Stack() { |
| 113 | + Image(item.fullColumnImgUrls[0].url) | ||
| 114 | + .width(117) | ||
| 115 | + .height(78) | ||
| 116 | + .objectFit(ImageFit.Cover) | ||
| 117 | + .borderRadius($r('app.float.image_border_radius')) | ||
| 118 | + .margin({ left: 12 }) | ||
| 119 | + CardMediaInfo({ | ||
| 120 | + contentDTO: { | ||
| 121 | + objectType: String(item.objectType), | ||
| 122 | + videoInfo: { videoDuration: Number(item.videoDuration) as number }, | ||
| 123 | + photoNum: Number(item.photoNum), | ||
| 124 | + voiceInfo: { voiceDuration: Number(item.voiceDuration) as number } | ||
| 125 | + } as ContentDTO | ||
| 126 | + }) | ||
| 127 | + } | ||
| 128 | + .alignContent(Alignment.BottomEnd) | ||
| 120 | } | 129 | } |
| 121 | } | 130 | } |
| 122 | .padding({ top: 10, bottom: 10 }) | 131 | .padding({ top: 10, bottom: 10 }) |
| @@ -15,7 +15,7 @@ export class publishCommentModel { | @@ -15,7 +15,7 @@ export class publishCommentModel { | ||
| 15 | /*【迭代二新增】关联的频道id/专题id; 页面必传*/ | 15 | /*【迭代二新增】关联的频道id/专题id; 页面必传*/ |
| 16 | targetRelObjectId: string = "" | 16 | targetRelObjectId: string = "" |
| 17 | /*【迭代二新增】是否是重点稿件 1是 0否 页面必传*/ | 17 | /*【迭代二新增】是否是重点稿件 1是 0否 页面必传*/ |
| 18 | - keyArticle: string = '' | 18 | + keyArticle: string = '0' |
| 19 | /*内容类别, 1:点播,2:直播,3:活动,4:广告,5:专题,6:链接,7:榜单,8:图文,9:组图,10:H5新闻,11:频道,12:组件,13:音频,14:动态(13和14为中文版新增) 页面必传*/ | 19 | /*内容类别, 1:点播,2:直播,3:活动,4:广告,5:专题,6:链接,7:榜单,8:图文,9:组图,10:H5新闻,11:频道,12:组件,13:音频,14:动态(13和14为中文版新增) 页面必传*/ |
| 20 | targetType: string = '' | 20 | targetType: string = '' |
| 21 | /*评论总数*/ | 21 | /*评论总数*/ |
| @@ -9,8 +9,9 @@ import measure from '@ohos.measure' | @@ -9,8 +9,9 @@ import measure from '@ohos.measure' | ||
| 9 | import { CommentCustomDialog } from './CommentCustomDialog' | 9 | import { CommentCustomDialog } from './CommentCustomDialog' |
| 10 | import { publishCommentModel } from '../model/PublishCommentModel'; | 10 | import { publishCommentModel } from '../model/PublishCommentModel'; |
| 11 | import { ifaa } from '@kit.OnlineAuthenticationKit'; | 11 | import { ifaa } from '@kit.OnlineAuthenticationKit'; |
| 12 | -import { HttpUrlUtils } from 'wdNetwork/Index'; | 12 | +import { HttpUrlUtils, HttpUtils } from 'wdNetwork/Index'; |
| 13 | import NoMoreLayout from '../../page/NoMoreLayout'; | 13 | import NoMoreLayout from '../../page/NoMoreLayout'; |
| 14 | +import { WDRouterPage, WDRouterRule } from 'wdRouter/Index'; | ||
| 14 | 15 | ||
| 15 | const TAG = 'CommentComponent'; | 16 | const TAG = 'CommentComponent'; |
| 16 | 17 | ||
| @@ -181,9 +182,6 @@ export struct CommentComponent { | @@ -181,9 +182,6 @@ export struct CommentComponent { | ||
| 181 | if (this.hasMore === false) NoMoreLayout() | 182 | if (this.hasMore === false) NoMoreLayout() |
| 182 | } | 183 | } |
| 183 | } | 184 | } |
| 184 | -// .onScrollFrameBegin((offset: number, state: ScrollState)=>{ | ||
| 185 | -// | ||
| 186 | -// }) | ||
| 187 | .onReachEnd(()=>{ | 185 | .onReachEnd(()=>{ |
| 188 | if (this.hasMore) { | 186 | if (this.hasMore) { |
| 189 | this.getData() | 187 | this.getData() |
| @@ -559,6 +557,12 @@ struct commentFooterView { | @@ -559,6 +557,12 @@ struct commentFooterView { | ||
| 559 | 557 | ||
| 560 | } | 558 | } |
| 561 | .onClick(() => { | 559 | .onClick(() => { |
| 560 | + // 未登录,跳转登录 | ||
| 561 | + const user_id = HttpUtils.getUserId() | ||
| 562 | + if (!user_id) { | ||
| 563 | + WDRouterRule.jumpWithPage(WDRouterPage.loginPage) | ||
| 564 | + return | ||
| 565 | + } | ||
| 562 | commentLikeChange(this.item) | 566 | commentLikeChange(this.item) |
| 563 | commentViewModel.commentLike(this.item).then(() => { | 567 | commentViewModel.commentLike(this.item).then(() => { |
| 564 | }).catch(() => { | 568 | }).catch(() => { |
| @@ -7,17 +7,17 @@ import commentViewModel from '../viewmodel/CommentViewModel' | @@ -7,17 +7,17 @@ import commentViewModel from '../viewmodel/CommentViewModel' | ||
| 7 | @Preview | 7 | @Preview |
| 8 | @CustomDialog | 8 | @CustomDialog |
| 9 | export struct CommentCustomDialog { | 9 | export struct CommentCustomDialog { |
| 10 | - | ||
| 11 | @ObjectLink publishCommentModel: publishCommentModel | 10 | @ObjectLink publishCommentModel: publishCommentModel |
| 12 | controller?: CustomDialogController | 11 | controller?: CustomDialogController |
| 13 | confirm: (value: Record<string, string>) => void = () => { | 12 | confirm: (value: Record<string, string>) => void = () => { |
| 14 | } | 13 | } |
| 15 | @State private emojiSwitch: boolean = false | 14 | @State private emojiSwitch: boolean = false |
| 16 | textInputController: TextAreaController = new TextAreaController() | 15 | textInputController: TextAreaController = new TextAreaController() |
| 16 | + @State positionInfo: CaretOffset = { index: 0, x: 0, y: 0 } | ||
| 17 | 17 | ||
| 18 | aboutToAppear(): void { | 18 | aboutToAppear(): void { |
| 19 | 19 | ||
| 20 | - | 20 | + // this.textInputController.caretPosition(0) |
| 21 | } | 21 | } |
| 22 | 22 | ||
| 23 | publishCommentRequest() { | 23 | publishCommentRequest() { |
| @@ -25,7 +25,7 @@ export struct CommentCustomDialog { | @@ -25,7 +25,7 @@ export struct CommentCustomDialog { | ||
| 25 | // this.publishCommentModel.commentContent = this.commentText | 25 | // this.publishCommentModel.commentContent = this.commentText |
| 26 | //TODO 判断类型 | 26 | //TODO 判断类型 |
| 27 | this.publishCommentModel.commentType = '2' | 27 | this.publishCommentModel.commentType = '2' |
| 28 | - commentViewModel.publishComment(this.publishCommentModel).then((model:commentItemModel) => { | 28 | + commentViewModel.publishComment(this.publishCommentModel).then((model: commentItemModel) => { |
| 29 | this.publishCommentModel.commentContent = '' | 29 | this.publishCommentModel.commentContent = '' |
| 30 | // | 30 | // |
| 31 | 31 | ||
| @@ -74,12 +74,13 @@ export struct CommentCustomDialog { | @@ -74,12 +74,13 @@ export struct CommentCustomDialog { | ||
| 74 | .height(30) | 74 | .height(30) |
| 75 | .onClick(() => { | 75 | .onClick(() => { |
| 76 | 76 | ||
| 77 | - // this.commentText = this.commentText + '神鼎' | 77 | + this.positionInfo = this.textInputController.getCaretOffset() |
| 78 | + | ||
| 78 | this.emojiSwitch = !this.emojiSwitch | 79 | this.emojiSwitch = !this.emojiSwitch |
| 79 | if (this.emojiSwitch) { | 80 | if (this.emojiSwitch) { |
| 80 | this.textInputController.stopEditing() | 81 | this.textInputController.stopEditing() |
| 81 | } else { | 82 | } else { |
| 82 | - this.textInputController.caretPosition(this.textInputController.getTextContentRect().x) | 83 | + // this.textInputController.caretPosition(this.textInputController.getTextContentRect().x) |
| 83 | } | 84 | } |
| 84 | 85 | ||
| 85 | }) | 86 | }) |
| @@ -116,7 +117,7 @@ export struct CommentCustomDialog { | @@ -116,7 +117,7 @@ export struct CommentCustomDialog { | ||
| 116 | 117 | ||
| 117 | //表情view | 118 | //表情view |
| 118 | if (this.emojiSwitch) { | 119 | if (this.emojiSwitch) { |
| 119 | - emojiView() | 120 | + emojiView({ publishCommentModel: this.publishCommentModel }).height(150) |
| 120 | } | 121 | } |
| 121 | 122 | ||
| 122 | }.backgroundColor(Color.White) | 123 | }.backgroundColor(Color.White) |
| @@ -129,8 +130,88 @@ export struct CommentCustomDialog { | @@ -129,8 +130,88 @@ export struct CommentCustomDialog { | ||
| 129 | 130 | ||
| 130 | @Component | 131 | @Component |
| 131 | struct emojiView { | 132 | struct emojiView { |
| 133 | + @ObjectLink publishCommentModel: publishCommentModel | ||
| 134 | + /*没找到获取系统emoji的方案*/ | ||
| 135 | + private emojiString = '😀,😁,😂,😃,😄,😅,😆,😇,😈,😉,😊,😋,😌,😍,😎,😏,😐,😑,😒,😓,😔,😕,😖,😗,😘,😙,😚,😛,😜,😝,😞,😟,😠,😡,😢,😣,😤,😥,😦,😧,😨,😩,😪,😫,😬,😭,😮,😯,😰,😱,😲,😳,😴,😵,😶,😷,😸,😹,😺,😻,😼,😽,😾,😿,🙀,🙅,🙆,🙇,🙈,🙉,🙊,🙋,🙌,🙍,🙎,🙏' | ||
| 136 | + private displayArray: string[][] = [] | ||
| 137 | + private swiperController: SwiperController = new SwiperController() | ||
| 138 | + | ||
| 139 | + aboutToAppear(): void { | ||
| 140 | + | ||
| 141 | + | ||
| 142 | + | ||
| 143 | + this.displayArray = chunk(this.emojiString.split(','), 20) | ||
| 144 | + | ||
| 145 | + //补上删除按钮以及空白占位 | ||
| 146 | + let lastElement = this.displayArray.slice(-1)[0]; | ||
| 147 | + if (lastElement.length < 20) { | ||
| 148 | + let needLength = (20 - lastElement.length) | ||
| 149 | + for (let index = 0; index < needLength; index++) { | ||
| 150 | + lastElement.push('') | ||
| 151 | + } | ||
| 152 | + } | ||
| 153 | + | ||
| 154 | + this.displayArray.forEach(element => { | ||
| 155 | + element.push('删除') | ||
| 156 | + }); | ||
| 157 | + | ||
| 158 | + } | ||
| 159 | + | ||
| 132 | build() { | 160 | build() { |
| 161 | + | ||
| 162 | + // String.fromCodePoint() | ||
| 163 | + Swiper(this.swiperController) { | ||
| 164 | + | ||
| 165 | + ForEach(this.displayArray, (array: [], index) => { | ||
| 166 | + Column() { | ||
| 167 | + Grid() { | ||
| 168 | + ForEach(array, (emoji: string, subIndex: number) => { | ||
| 169 | + GridItem() { | ||
| 170 | + Text() { | ||
| 171 | + if (emoji == '删除') { | ||
| 172 | + ImageSpan($r('app.media.wdInput_delete')) | ||
| 173 | + } else { | ||
| 174 | + Span(emoji) | ||
| 175 | + } | ||
| 176 | + | ||
| 177 | + }.textAlign(TextAlign.Center).width(30).height(30) | ||
| 178 | + | ||
| 179 | + // .backgroundColor(Color.Orange) | ||
| 180 | + }.onClick(() => { | ||
| 181 | + if (emoji == '删除') { | ||
| 182 | + this.publishCommentModel.commentContent = this.publishCommentModel.commentContent.substring(0, this.publishCommentModel.commentContent.length -1) | ||
| 183 | + } else if (emoji == '') { | ||
| 184 | + | ||
| 185 | + } else { | ||
| 186 | + this.publishCommentModel.commentContent = this.publishCommentModel.commentContent + emoji | ||
| 187 | + } | ||
| 188 | + | ||
| 189 | + }) | ||
| 190 | + }) | ||
| 191 | + } | ||
| 192 | + .maxCount(6) | ||
| 193 | + .columnsTemplate('1fr 1fr 1fr 1fr 1fr 1fr 1fr') | ||
| 194 | + .rowsGap(10) | ||
| 195 | + .layoutDirection(GridDirection.Row) | ||
| 196 | + | ||
| 197 | + Row().height(40) | ||
| 198 | + } | ||
| 199 | + }) | ||
| 200 | + } | ||
| 201 | + .indicator(true) | ||
| 202 | + .vertical(false) | ||
| 203 | + .height(140) | ||
| 204 | + } | ||
| 205 | +} | ||
| 206 | + | ||
| 207 | +function chunk<T>(array: T[], size: number): T[][] { | ||
| 208 | + const result: T[][] = []; | ||
| 209 | + | ||
| 210 | + for (let i = 0; i < array.length; i += size) { | ||
| 211 | + result.push(array.slice(i, i + size)); | ||
| 133 | } | 212 | } |
| 213 | + | ||
| 214 | + return result; | ||
| 134 | } | 215 | } |
| 135 | 216 | ||
| 136 | 217 |
sight_harmony/features/wdComponent/src/main/ets/components/comment/view/QualityCommentsComponent.ets
| 1 | import { ViewType } from 'wdConstant/Index' | 1 | import { ViewType } from 'wdConstant/Index' |
| 2 | import { DateTimeUtils, LazyDataSource, WindowModel } from 'wdKit/Index' | 2 | import { DateTimeUtils, LazyDataSource, WindowModel } from 'wdKit/Index' |
| 3 | -import { commentItemModel, commentListModel } from '../model/CommentModel' | 3 | +import { commentItemModel } from '../model/CommentModel' |
| 4 | import commentViewModel from '../viewmodel/CommentViewModel' | 4 | import commentViewModel from '../viewmodel/CommentViewModel' |
| 5 | import { router, window } from '@kit.ArkUI' | 5 | import { router, window } from '@kit.ArkUI' |
| 6 | -import { CustomTitleUI } from '../../reusable/CustomTitleUI' | ||
| 7 | -import { MyCommentDataSource } from '../model/MyCommentDataSource' | ||
| 8 | -import { HttpUrlUtils } from 'wdNetwork/Index' | ||
| 9 | -import PageModel from '../../../viewmodel/PageModel' | 6 | +import { HttpUtils } from 'wdNetwork/Index' |
| 10 | import { ErrorComponent } from '../../view/ErrorComponent' | 7 | import { ErrorComponent } from '../../view/ErrorComponent' |
| 11 | -import { EmptyComponent , WDViewDefaultType} from '../../view/EmptyComponent' | ||
| 12 | -import { CustomPullToRefresh } from '../../reusable/CustomPullToRefresh' | 8 | +import { EmptyComponent, WDViewDefaultType } from '../../view/EmptyComponent' |
| 13 | import NoMoreLayout from '../../page/NoMoreLayout' | 9 | import NoMoreLayout from '../../page/NoMoreLayout' |
| 10 | +import { CommentCustomDialog } from './CommentCustomDialog' | ||
| 11 | +import { publishCommentModel } from '../model/PublishCommentModel' | ||
| 12 | +import { WDRouterPage, WDRouterRule } from 'wdRouter/Index' | ||
| 14 | 13 | ||
| 15 | const TAG = 'QualityCommentsComponent'; | 14 | const TAG = 'QualityCommentsComponent'; |
| 16 | 15 | ||
| @@ -24,9 +23,6 @@ export struct QualityCommentsComponent { | @@ -24,9 +23,6 @@ export struct QualityCommentsComponent { | ||
| 24 | @State hasMore: boolean = true; | 23 | @State hasMore: boolean = true; |
| 25 | @State currentPage: number = 1; | 24 | @State currentPage: number = 1; |
| 26 | private scroller: Scroller = new Scroller(); | 25 | private scroller: Scroller = new Scroller(); |
| 27 | - | ||
| 28 | - | ||
| 29 | - | ||
| 30 | @State tileOpacity: number = 0; | 26 | @State tileOpacity: number = 0; |
| 31 | firstPositionY: number = 0; | 27 | firstPositionY: number = 0; |
| 32 | bottomSafeHeight: string = AppStorage.get<number>('bottomSafeHeight') + 'px'; | 28 | bottomSafeHeight: string = AppStorage.get<number>('bottomSafeHeight') + 'px'; |
| @@ -34,6 +30,11 @@ export struct QualityCommentsComponent { | @@ -34,6 +30,11 @@ export struct QualityCommentsComponent { | ||
| 34 | lastWindowColor: string = '#ffffff' | 30 | lastWindowColor: string = '#ffffff' |
| 35 | currentWindowColor: string = '#FF4202' | 31 | currentWindowColor: string = '#FF4202' |
| 36 | @State allDatas: LazyDataSource<commentItemModel> = new LazyDataSource(); | 32 | @State allDatas: LazyDataSource<commentItemModel> = new LazyDataSource(); |
| 33 | + @State dialogController: CustomDialogController | null = null; | ||
| 34 | + | ||
| 35 | + /*必传*/ | ||
| 36 | + @State publishCommentModel: publishCommentModel = new publishCommentModel() | ||
| 37 | + | ||
| 37 | 38 | ||
| 38 | aboutToDisappear(): void { | 39 | aboutToDisappear(): void { |
| 39 | 40 | ||
| @@ -43,13 +44,33 @@ export struct QualityCommentsComponent { | @@ -43,13 +44,33 @@ export struct QualityCommentsComponent { | ||
| 43 | windowClass.setWindowLayoutFullScreen(false) | 44 | windowClass.setWindowLayoutFullScreen(false) |
| 44 | // windowClass.setWindowSystemBarProperties({ statusBarColor: '#000' }) | 45 | // windowClass.setWindowSystemBarProperties({ statusBarColor: '#000' }) |
| 45 | 46 | ||
| 47 | + this.dialogController = null // 将dialogController置空 | ||
| 48 | + | ||
| 46 | } | 49 | } |
| 47 | 50 | ||
| 48 | aboutToAppear(): void { | 51 | aboutToAppear(): void { |
| 49 | 52 | ||
| 50 | this.fullScreen(); | 53 | this.fullScreen(); |
| 51 | this.getData(); | 54 | this.getData(); |
| 55 | + this.showAlert() | ||
| 56 | + } | ||
| 52 | 57 | ||
| 58 | + showAlert(){ | ||
| 59 | + this.dialogController = new CustomDialogController({ | ||
| 60 | + builder: CommentCustomDialog({ | ||
| 61 | + confirm: (value: Record<string, string>) => { | ||
| 62 | + | ||
| 63 | + }, | ||
| 64 | + publishCommentModel: this.publishCommentModel | ||
| 65 | + }), | ||
| 66 | + autoCancel: true, | ||
| 67 | + alignment: DialogAlignment.Bottom, | ||
| 68 | + customStyle: true, | ||
| 69 | + offset: { | ||
| 70 | + dx: 0, | ||
| 71 | + dy: -20 | ||
| 72 | + }, | ||
| 73 | + }) | ||
| 53 | } | 74 | } |
| 54 | 75 | ||
| 55 | getData(resolve?: (value: string | PromiseLike<string>) => void){ | 76 | getData(resolve?: (value: string | PromiseLike<string>) => void){ |
| @@ -217,7 +238,7 @@ export struct QualityCommentsComponent { | @@ -217,7 +238,7 @@ export struct QualityCommentsComponent { | ||
| 217 | // ListItemGroup({ header: this.titleHeader() }) | 238 | // ListItemGroup({ header: this.titleHeader() }) |
| 218 | LazyForEach(this.allDatas, (item: commentItemModel, index: number) => { | 239 | LazyForEach(this.allDatas, (item: commentItemModel, index: number) => { |
| 219 | ListItem() { | 240 | ListItem() { |
| 220 | - QualityCommentItem({ item: item, index: index }).margin({ left: 12, right: 12 }) | 241 | + QualityCommentItem({ item: item, index: index , dialogController:this.dialogController, publishCommentModel:this.publishCommentModel}).margin({ left: 12, right: 12 }) |
| 221 | } | 242 | } |
| 222 | }) | 243 | }) |
| 223 | // 加载更多 | 244 | // 加载更多 |
| @@ -243,16 +264,6 @@ export struct QualityCommentsComponent { | @@ -243,16 +264,6 @@ export struct QualityCommentsComponent { | ||
| 243 | } | 264 | } |
| 244 | 265 | ||
| 245 | 266 | ||
| 246 | - @Builder | ||
| 247 | - testLayout(){ | ||
| 248 | - List({ space: 12, scroller:this.scroller }){ | ||
| 249 | - LazyForEach(this.allDatas, (item: commentItemModel, index: number) => { | ||
| 250 | - ListItem() { | ||
| 251 | - QualityCommentItem({ item: item, index: index }).margin({ left: 12, right: 12 }) | ||
| 252 | - } | ||
| 253 | - }) | ||
| 254 | - } | ||
| 255 | - } | ||
| 256 | 267 | ||
| 257 | } | 268 | } |
| 258 | 269 | ||
| @@ -261,6 +272,8 @@ export struct QualityCommentsComponent { | @@ -261,6 +272,8 @@ export struct QualityCommentsComponent { | ||
| 261 | 272 | ||
| 262 | @Component | 273 | @Component |
| 263 | struct QualityCommentItem { | 274 | struct QualityCommentItem { |
| 275 | + @ObjectLink publishCommentModel: publishCommentModel | ||
| 276 | + dialogController: CustomDialogController | null = null; | ||
| 264 | @ObjectLink item: commentItemModel | 277 | @ObjectLink item: commentItemModel |
| 265 | index: number = 0 | 278 | index: number = 0 |
| 266 | 279 | ||
| @@ -360,7 +373,20 @@ struct QualityCommentItem { | @@ -360,7 +373,20 @@ struct QualityCommentItem { | ||
| 360 | Row({ space: 16 }) { | 373 | Row({ space: 16 }) { |
| 361 | Row() { | 374 | Row() { |
| 362 | Image($r('app.media.comment_icon_pinglun')).width(16).height(16) | 375 | Image($r('app.media.comment_icon_pinglun')).width(16).height(16) |
| 363 | - } | 376 | + }.onClick(()=>{ |
| 377 | + this.publishCommentModel.targetId = this.item.targetId | ||
| 378 | + this.publishCommentModel.targetRelId = this.item.targetRelId | ||
| 379 | + this.publishCommentModel.targetTitle = this.item.targetTitle | ||
| 380 | + this.publishCommentModel.targetRelType = this.item.targetRelType | ||
| 381 | + this.publishCommentModel.targetRelObjectId = this.item.targetRelObjectId | ||
| 382 | + this.publishCommentModel.targetType = this.item.targetType | ||
| 383 | + // this.publishCommentModel.keyArticle = this.item.keyArticle | ||
| 384 | + | ||
| 385 | + this.publishCommentModel.rootCommentId = this.item.rootCommentId | ||
| 386 | + this.publishCommentModel.parentId = this.item.id | ||
| 387 | + | ||
| 388 | + this.dialogController?.open() | ||
| 389 | + }) | ||
| 364 | 390 | ||
| 365 | Row() { | 391 | Row() { |
| 366 | Image($r(this.item.api_status ? 'app.media.comment_like_select' : 'app.media.comment_like_normal')) | 392 | Image($r(this.item.api_status ? 'app.media.comment_like_select' : 'app.media.comment_like_normal')) |
| @@ -373,6 +399,12 @@ struct QualityCommentItem { | @@ -373,6 +399,12 @@ struct QualityCommentItem { | ||
| 373 | .margin({ left: 3 }) | 399 | .margin({ left: 3 }) |
| 374 | } | 400 | } |
| 375 | }.onClick(() => { | 401 | }.onClick(() => { |
| 402 | + // 未登录,跳转登录 | ||
| 403 | + const user_id = HttpUtils.getUserId() | ||
| 404 | + if (!user_id) { | ||
| 405 | + WDRouterRule.jumpWithPage(WDRouterPage.loginPage) | ||
| 406 | + return | ||
| 407 | + } | ||
| 376 | commentLikeChange(this.item) | 408 | commentLikeChange(this.item) |
| 377 | commentViewModel.commentLike(this.item).then(() => { | 409 | commentViewModel.commentLike(this.item).then(() => { |
| 378 | }).catch(() => { | 410 | }).catch(() => { |
| @@ -4,6 +4,7 @@ import { postInteractAccentionOperateParams } from 'wdBean'; | @@ -4,6 +4,7 @@ import { postInteractAccentionOperateParams } from 'wdBean'; | ||
| 4 | import { PageRepository } from '../../repository/PageRepository'; | 4 | import { PageRepository } from '../../repository/PageRepository'; |
| 5 | import { ProcessUtils } from 'wdRouter'; | 5 | import { ProcessUtils } from 'wdRouter'; |
| 6 | import { HttpUtils } from 'wdNetwork/Index'; | 6 | import { HttpUtils } from 'wdNetwork/Index'; |
| 7 | +import { DateTimeUtils } from 'wdKit'; | ||
| 7 | 8 | ||
| 8 | /** | 9 | /** |
| 9 | * 直播预约卡 | 10 | * 直播预约卡 |
| @@ -17,6 +18,22 @@ export struct ZhSingleRow03 { | @@ -17,6 +18,22 @@ export struct ZhSingleRow03 { | ||
| 17 | @State compDTO: CompDTO = {} as CompDTO | 18 | @State compDTO: CompDTO = {} as CompDTO |
| 18 | scroller: Scroller = new Scroller() | 19 | scroller: Scroller = new Scroller() |
| 19 | 20 | ||
| 21 | + format(timeNum: number) { | ||
| 22 | + const todayDate = new Date().setHours(0,0,0,0) | ||
| 23 | + const parseDate = new Date(timeNum).setHours(0,0,0,0); | ||
| 24 | + if (todayDate === parseDate) { | ||
| 25 | + return '今天' | ||
| 26 | + } else { const str = DateTimeUtils.formatDate(timeNum, 'MM月dd日') | ||
| 27 | + const month: string = str.split('月')[0]; | ||
| 28 | + if (month[0] === "0") { | ||
| 29 | + return str.slice(1) | ||
| 30 | + } else { | ||
| 31 | + return str.slice(0) | ||
| 32 | + } | ||
| 33 | + } | ||
| 34 | + | ||
| 35 | + } | ||
| 36 | + | ||
| 20 | build() { | 37 | build() { |
| 21 | Column() { | 38 | Column() { |
| 22 | //顶部 | 39 | //顶部 |
| @@ -42,7 +59,8 @@ export struct ZhSingleRow03 { | @@ -42,7 +59,8 @@ export struct ZhSingleRow03 { | ||
| 42 | Row() { | 59 | Row() { |
| 43 | Flex({justifyContent: FlexAlign.SpaceBetween}){ | 60 | Flex({justifyContent: FlexAlign.SpaceBetween}){ |
| 44 | Row() { | 61 | Row() { |
| 45 | - Text(item.liveInfo.liveStartTime.split(' ')[0].slice(5).split('-').join('月')+'日') | 62 | + Text(this.format(new Date(item.liveInfo.liveStartTime).getTime())) |
| 63 | + // Text(item.liveInfo.liveStartTime.split(' ')[0].slice(5).split('-').join('月')+'日') | ||
| 46 | .margin({right: 6}) | 64 | .margin({right: 6}) |
| 47 | .fontColor(0x000000) | 65 | .fontColor(0x000000) |
| 48 | .fontSize(13) | 66 | .fontSize(13) |
| @@ -106,7 +124,7 @@ export struct ZhSingleRow03 { | @@ -106,7 +124,7 @@ export struct ZhSingleRow03 { | ||
| 106 | .width(3) | 124 | .width(3) |
| 107 | .height(16) | 125 | .height(16) |
| 108 | .margin({ right: 4 }) | 126 | .margin({ right: 4 }) |
| 109 | - Text('直播预约') | 127 | + Text('直播预告') |
| 110 | .fontSize($r("app.float.font_size_17")) | 128 | .fontSize($r("app.float.font_size_17")) |
| 111 | .fontColor($r("app.color.color_222222")) | 129 | .fontColor($r("app.color.color_222222")) |
| 112 | .fontWeight(600) | 130 | .fontWeight(600) |
| @@ -9,13 +9,12 @@ export default struct MinePageMoreFunctionUI { | @@ -9,13 +9,12 @@ export default struct MinePageMoreFunctionUI { | ||
| 9 | build() { | 9 | build() { |
| 10 | Column() { | 10 | Column() { |
| 11 | Column() { | 11 | Column() { |
| 12 | - Text(`更多功能`) | ||
| 13 | - .width('456lpx') | ||
| 14 | - .height('38lpx') | ||
| 15 | - .fontColor($r('app.color.color_666666')) | 12 | + Text("更多功能") |
| 13 | + .fontColor($r('app.color.color_222222')) | ||
| 16 | .fontSize('29lpx') | 14 | .fontSize('29lpx') |
| 17 | .margin({ left: "31lpx" }) | 15 | .margin({ left: "31lpx" }) |
| 18 | - .fontWeight('600lpx') | 16 | + .lineHeight('46lpx') |
| 17 | + .fontWeight(FontWeight.Bold) | ||
| 19 | }.height('92lpx') | 18 | }.height('92lpx') |
| 20 | .width('100%') | 19 | .width('100%') |
| 21 | .justifyContent(FlexAlign.Center) | 20 | .justifyContent(FlexAlign.Center) |
| @@ -85,6 +85,7 @@ export struct FollowFirstTabsComponent{ | @@ -85,6 +85,7 @@ export struct FollowFirstTabsComponent{ | ||
| 85 | .vertical(false) | 85 | .vertical(false) |
| 86 | .barMode(BarMode.Scrollable) | 86 | .barMode(BarMode.Scrollable) |
| 87 | .barWidth('100%') | 87 | .barWidth('100%') |
| 88 | + .barBackgroundColor($r('app.color.white')) | ||
| 88 | .barHeight('84lpx') | 89 | .barHeight('84lpx') |
| 89 | .animationDuration(0) | 90 | .animationDuration(0) |
| 90 | .onChange((index: number) => { | 91 | .onChange((index: number) => { |
| @@ -70,9 +70,15 @@ export struct FollowListDetailUI { | @@ -70,9 +70,15 @@ export struct FollowListDetailUI { | ||
| 70 | Column() { | 70 | Column() { |
| 71 | if (this.count === 0) { | 71 | if (this.count === 0) { |
| 72 | if (this.isGetRequest == true) { | 72 | if (this.isGetRequest == true) { |
| 73 | - EmptyComponent({ emptyType: 14,emptyHeight:"100%" }) | ||
| 74 | - .layoutWeight(1) | ||
| 75 | - .width('100%') | 73 | + if(this.creatorDirectoryId === -1){ |
| 74 | + EmptyComponent({ emptyType: 14,emptyHeight:"100%" }) | ||
| 75 | + .layoutWeight(1) | ||
| 76 | + .width('100%') | ||
| 77 | + }else{ | ||
| 78 | + EmptyComponent({ emptyType: 16,emptyHeight:"100%" }) | ||
| 79 | + .layoutWeight(1) | ||
| 80 | + .width('100%') | ||
| 81 | + } | ||
| 76 | } | 82 | } |
| 77 | 83 | ||
| 78 | } else { | 84 | } else { |
| 1 | import { FollowListItem, FollowThirdListItem } from '../../../viewmodel/FollowListItem' | 1 | import { FollowListItem, FollowThirdListItem } from '../../../viewmodel/FollowListItem' |
| 2 | import { FollowListDetailUI } from './FollowListDetailUI' | 2 | import { FollowListDetailUI } from './FollowListDetailUI' |
| 3 | +import measure from '@ohos.measure' | ||
| 3 | 4 | ||
| 4 | @Component | 5 | @Component |
| 5 | export struct FollowThirdTabsComponent{ | 6 | export struct FollowThirdTabsComponent{ |
| @@ -11,8 +12,8 @@ export struct FollowThirdTabsComponent{ | @@ -11,8 +12,8 @@ export struct FollowThirdTabsComponent{ | ||
| 11 | 12 | ||
| 12 | 13 | ||
| 13 | private controller: TabsController = new TabsController() | 14 | private controller: TabsController = new TabsController() |
| 14 | - fontColor: string = '#999999' | ||
| 15 | - selectedFontColor: string = '#000000' | 15 | + fontColor: string = '#666666' |
| 16 | + selectedFontColor: string = '#222222' | ||
| 16 | 17 | ||
| 17 | build(){ | 18 | build(){ |
| 18 | if(this.data != null){ | 19 | if(this.data != null){ |
| @@ -26,32 +27,44 @@ export struct FollowThirdTabsComponent{ | @@ -26,32 +27,44 @@ export struct FollowThirdTabsComponent{ | ||
| 26 | 27 | ||
| 27 | @Builder TabBuilder(index: number, item: FollowThirdListItem) { | 28 | @Builder TabBuilder(index: number, item: FollowThirdListItem) { |
| 28 | Column(){ | 29 | Column(){ |
| 29 | - Text(item.directoryName) | ||
| 30 | - .fontSize('30lpx') | ||
| 31 | - .textAlign(TextAlign.Center) | ||
| 32 | - .fontWeight(this.currentIndex === index ? 600 : 400) | ||
| 33 | - .fontColor(this.currentIndex === index ? this.selectedFontColor : this.fontColor) | ||
| 34 | - .lineHeight('38lpx') | ||
| 35 | - .backgroundColor($r('app.color.color_F9F9F9')) | ||
| 36 | - .padding('13lpx') | ||
| 37 | - .maxLines(1) | 30 | + Row(){ |
| 31 | + Image(index === 0?$r("app.media.ic_collect_left_left"):(index === this.data[this.firstIndex].children[this.secondIndex].children.length-1?$r('app.media.ic_collect_right_left'):$r('app.media.ic_collect_mid_left'))) | ||
| 32 | + .width(index === 0?"19lpx":"35lpx") | ||
| 33 | + .height('61lpx') | ||
| 34 | + .objectFit(ImageFit.Fill) | ||
| 35 | + | ||
| 36 | + Text(item.directoryName) | ||
| 37 | + .fontSize('27lpx') | ||
| 38 | + .fontWeight(this.currentIndex === index ? "600lpx" : "400lpx") | ||
| 39 | + .fontColor(this.currentIndex === index ? this.selectedFontColor : this.fontColor) | ||
| 40 | + .lineHeight('35lpx') | ||
| 41 | + .backgroundImage($r('app.media.ic_collect_mid')) | ||
| 42 | + .backgroundImageSize(ImageSize.Cover) | ||
| 43 | + .padding({top:"13lpx",bottom:"13lpx"}) | ||
| 44 | + | ||
| 45 | + Image(index === 0?$r("app.media.ic_collect_left_right"):(index === this.data[this.firstIndex].children[this.secondIndex].children.length-1?$r('app.media.ic_collect_right_right'):$r('app.media.ic_collect_mid_right'))) | ||
| 46 | + .width(index === this.data[this.firstIndex].children[this.secondIndex].children.length-1?"19lpx":"35lpx") | ||
| 47 | + .height('61lpx') | ||
| 48 | + .objectFit(ImageFit.Fill) | ||
| 49 | + } | ||
| 38 | } | 50 | } |
| 39 | .onClick(()=>{ | 51 | .onClick(()=>{ |
| 40 | this.currentIndex = index | 52 | this.currentIndex = index |
| 41 | this.controller.changeIndex(this.currentIndex) | 53 | this.controller.changeIndex(this.currentIndex) |
| 42 | }) | 54 | }) |
| 43 | - .height('84lpx') | ||
| 44 | - .margin({right:'9lpx'}) | ||
| 45 | - .padding({left:'20lpx',right:index === this.data[this.firstIndex].children[this.secondIndex].children.length-1?"20lpx":"0lpx"}) | ||
| 46 | - .justifyContent(FlexAlign.Center) | 55 | + .offset({x:index === 0?"0lpx":"-5lpx"}) |
| 56 | + .height('80lpx') | ||
| 57 | + .justifyContent(FlexAlign.End) | ||
| 47 | } | 58 | } |
| 48 | 59 | ||
| 60 | + | ||
| 61 | + | ||
| 49 | @Builder FollowThirdUI(){ | 62 | @Builder FollowThirdUI(){ |
| 50 | 63 | ||
| 51 | Column(){ | 64 | Column(){ |
| 52 | Column() { | 65 | Column() { |
| 53 | // 页签 | 66 | // 页签 |
| 54 | - Row({ space: 7 }) { | 67 | + Row() { |
| 55 | Scroll() { | 68 | Scroll() { |
| 56 | Row() { | 69 | Row() { |
| 57 | ForEach(this.data[this.firstIndex].children[this.secondIndex].children, (item: FollowThirdListItem, index: number ) => { | 70 | ForEach(this.data[this.firstIndex].children[this.secondIndex].children, (item: FollowThirdListItem, index: number ) => { |
| @@ -63,8 +76,8 @@ export struct FollowThirdTabsComponent{ | @@ -63,8 +76,8 @@ export struct FollowThirdTabsComponent{ | ||
| 63 | .align(Alignment.Start) | 76 | .align(Alignment.Start) |
| 64 | .scrollable(ScrollDirection.Horizontal) | 77 | .scrollable(ScrollDirection.Horizontal) |
| 65 | .scrollBar(BarState.Off) | 78 | .scrollBar(BarState.Off) |
| 66 | - .width('90%') | ||
| 67 | - .padding({left:'11lpx'}) | 79 | + .width('100%') |
| 80 | + .padding({left:'31lpx',right:'48lpx'}) | ||
| 68 | } | 81 | } |
| 69 | .alignItems(VerticalAlign.Bottom) | 82 | .alignItems(VerticalAlign.Bottom) |
| 70 | .width('100%') | 83 | .width('100%') |
| @@ -77,11 +90,6 @@ export struct FollowThirdTabsComponent{ | @@ -77,11 +90,6 @@ export struct FollowThirdTabsComponent{ | ||
| 77 | ForEach(this.data[this.firstIndex].children[this.secondIndex].children, (item: FollowThirdListItem, index: number ) => { | 90 | ForEach(this.data[this.firstIndex].children[this.secondIndex].children, (item: FollowThirdListItem, index: number ) => { |
| 78 | TabContent(){ | 91 | TabContent(){ |
| 79 | Column(){ | 92 | Column(){ |
| 80 | - Divider().width('100%') | ||
| 81 | - .height('2lpx') | ||
| 82 | - .strokeWidth('1lpx') | ||
| 83 | - .backgroundColor($r('app.color.color_EDEDED')) | ||
| 84 | - .margin({left:'20lpx'}) | ||
| 85 | FollowListDetailUI({creatorDirectoryId:this.data[this.firstIndex].children[this.secondIndex].children[index].id}) | 93 | FollowListDetailUI({creatorDirectoryId:this.data[this.firstIndex].children[this.secondIndex].children[index].id}) |
| 86 | } | 94 | } |
| 87 | } | 95 | } |
| @@ -99,4 +107,19 @@ export struct FollowThirdTabsComponent{ | @@ -99,4 +107,19 @@ export struct FollowThirdTabsComponent{ | ||
| 99 | } | 107 | } |
| 100 | } | 108 | } |
| 101 | 109 | ||
| 110 | + getMeasureText(text: string,index:number) { | ||
| 111 | + let width = measure.measureText({ | ||
| 112 | + textContent: text, | ||
| 113 | + fontSize: px2fp(27), | ||
| 114 | + lineHeight: px2fp(35) | ||
| 115 | + }) | ||
| 116 | + if(index === 0){ | ||
| 117 | + return width + 19+ 35 | ||
| 118 | + }else if(index === this.data[this.firstIndex].children[this.secondIndex].children.length-1){ | ||
| 119 | + return width + 35+ 35 | ||
| 120 | + }else{ | ||
| 121 | + return width + 35+ 19 | ||
| 122 | + } | ||
| 123 | + } | ||
| 124 | + | ||
| 102 | } | 125 | } |
| 1 | -import { ContentDTO, Params } from 'wdBean'; | ||
| 2 | import { DateTimeUtils, LazyDataSource, SPHelper,UserDataLocal } from 'wdKit'; | 1 | import { DateTimeUtils, LazyDataSource, SPHelper,UserDataLocal } from 'wdKit'; |
| 3 | -import { ProcessUtils, WDRouterPage, WDRouterRule } from 'wdRouter'; | 2 | +import { WDRouterPage, WDRouterRule } from 'wdRouter'; |
| 4 | import MinePageDatasModel from '../../../model/MinePageDatasModel'; | 3 | import MinePageDatasModel from '../../../model/MinePageDatasModel'; |
| 5 | import { CommentListItem } from '../../../viewmodel/CommentListItem'; | 4 | import { CommentListItem } from '../../../viewmodel/CommentListItem'; |
| 6 | import { FollowListDetailItem } from '../../../viewmodel/FollowListDetailItem'; | 5 | import { FollowListDetailItem } from '../../../viewmodel/FollowListDetailItem'; |
| @@ -106,6 +105,7 @@ export struct HomePageBottomComponent{ | @@ -106,6 +105,7 @@ export struct HomePageBottomComponent{ | ||
| 106 | EmptyComponent({emptyType:14}) | 105 | EmptyComponent({emptyType:14}) |
| 107 | .layoutWeight(1) | 106 | .layoutWeight(1) |
| 108 | .width('100%') | 107 | .width('100%') |
| 108 | + .offset({y:"-200lpx"}) | ||
| 109 | } | 109 | } |
| 110 | }.layoutWeight(1) | 110 | }.layoutWeight(1) |
| 111 | .justifyContent(FlexAlign.Start) | 111 | .justifyContent(FlexAlign.Start) |
| @@ -114,6 +114,7 @@ export struct HomePageBottomComponent{ | @@ -114,6 +114,7 @@ export struct HomePageBottomComponent{ | ||
| 114 | EmptyComponent({emptyType:11}) | 114 | EmptyComponent({emptyType:11}) |
| 115 | .layoutWeight(1) | 115 | .layoutWeight(1) |
| 116 | .width('100%') | 116 | .width('100%') |
| 117 | + .offset({y:"-200lpx"}) | ||
| 117 | } | 118 | } |
| 118 | } | 119 | } |
| 119 | }else{ | 120 | }else{ |
| @@ -323,6 +324,27 @@ export struct HomePageBottomComponent{ | @@ -323,6 +324,27 @@ export struct HomePageBottomComponent{ | ||
| 323 | data.push(new CommentListItem(item.fromUserHeader,item.fromUserName,item.targetTitle,item.createTime,commentContent,item.likeNum,0,item.id,item.targetId,item.targetType,item.targetRelId,item.targetRelObjectId,item.targetRelType,item.targetStatus,item.checkStatus,parentCommentContent,parentCommentUserName)) | 324 | data.push(new CommentListItem(item.fromUserHeader,item.fromUserName,item.targetTitle,item.createTime,commentContent,item.likeNum,0,item.id,item.targetId,item.targetType,item.targetRelId,item.targetRelObjectId,item.targetRelType,item.targetStatus,item.checkStatus,parentCommentContent,parentCommentUserName)) |
| 324 | }) | 325 | }) |
| 325 | 326 | ||
| 327 | + if(status.commentIdList.length === 0){ | ||
| 328 | + data.forEach((item)=>{ | ||
| 329 | + let publishTime = DateTimeUtils.getCommentTime(DateTimeUtils.parseDate(item.createTime,DateTimeUtils.PATTERN_DATE_TIME_HYPHEN)) | ||
| 330 | + this.data_comment.push(new CommentListItem(item.fromUserHeader,item.fromUserName,item.targetTitle,publishTime,item.commentContent,item.likeNum,item.like_status,item.id,item.targetId,item.targetType,item.targetRelId,item.targetRelObjectId,item.targetRelType,item.targetStatus,item.checkStatus,item.parentCommentContent,item.parentCommentUserName)) | ||
| 331 | + }) | ||
| 332 | + | ||
| 333 | + this.data_comment.notifyDataReload() | ||
| 334 | + | ||
| 335 | + this.count = this.data_comment.totalCount() | ||
| 336 | + this.commentNum = value.totalCount | ||
| 337 | + if (this.data_comment.totalCount() < value.totalCount) { | ||
| 338 | + this.curPageNum++ | ||
| 339 | + }else { | ||
| 340 | + this.hasMore = false | ||
| 341 | + } | ||
| 342 | + | ||
| 343 | + this.isLoading = false | ||
| 344 | + this.isGetRequest = true | ||
| 345 | + return | ||
| 346 | + } | ||
| 347 | + | ||
| 326 | MinePageDatasModel.getOtherUserCommentLikeStatusData(status,getContext(this)).then((newValue)=>{ | 348 | MinePageDatasModel.getOtherUserCommentLikeStatusData(status,getContext(this)).then((newValue)=>{ |
| 327 | newValue.forEach((item)=>{ | 349 | newValue.forEach((item)=>{ |
| 328 | data.forEach((list)=>{ | 350 | data.forEach((list)=>{ |
| @@ -139,6 +139,27 @@ export struct OtherHomePageBottomCommentComponent { | @@ -139,6 +139,27 @@ export struct OtherHomePageBottomCommentComponent { | ||
| 139 | data.push(new CommentListItem(item.fromUserHeader, item.fromUserName, item.targetTitle, item.createTime, commentContent, item.likeNum, 0, item.id, item.targetId, item.targetType, item.targetRelId, item.targetRelObjectId, item.targetRelType, item.targetStatus, item.checkStatus, parentCommentContent, parentCommentUserName)) | 139 | data.push(new CommentListItem(item.fromUserHeader, item.fromUserName, item.targetTitle, item.createTime, commentContent, item.likeNum, 0, item.id, item.targetId, item.targetType, item.targetRelId, item.targetRelObjectId, item.targetRelType, item.targetStatus, item.checkStatus, parentCommentContent, parentCommentUserName)) |
| 140 | }) | 140 | }) |
| 141 | 141 | ||
| 142 | + if(status.commentIdList.length === 0){ | ||
| 143 | + data.forEach((item) => { | ||
| 144 | + this.data_comment.push(new CommentListItem(item.fromUserHeader, item.fromUserName, item.targetTitle, item.createTime, item.commentContent, item.likeNum, item.like_status, item.id, item.targetId, item.targetType, item.targetRelId, item.targetRelObjectId, item.targetRelType, item.targetStatus, item.checkStatus, item.parentCommentContent, item.parentCommentUserName)) | ||
| 145 | + }) | ||
| 146 | + | ||
| 147 | + this.data_comment.notifyDataReload() | ||
| 148 | + | ||
| 149 | + this.count = this.data_comment.totalCount() | ||
| 150 | + this.commentNum = value.totalCount | ||
| 151 | + if (this.data_comment.totalCount() < value.totalCount) { | ||
| 152 | + this.curPageNum++ | ||
| 153 | + } else { | ||
| 154 | + this.hasMore = false | ||
| 155 | + } | ||
| 156 | + | ||
| 157 | + this.isLoading = false | ||
| 158 | + this.isGetRequest = true | ||
| 159 | + return | ||
| 160 | + } | ||
| 161 | + | ||
| 162 | + | ||
| 142 | MinePageDatasModel.getOtherUserCommentLikeStatusData(status, getContext(this)).then((newValue) => { | 163 | MinePageDatasModel.getOtherUserCommentLikeStatusData(status, getContext(this)).then((newValue) => { |
| 143 | newValue.forEach((item) => { | 164 | newValue.forEach((item) => { |
| 144 | data.forEach((list) => { | 165 | data.forEach((list) => { |
| @@ -319,7 +319,7 @@ struct ChannelDialog { | @@ -319,7 +319,7 @@ struct ChannelDialog { | ||
| 319 | } | 319 | } |
| 320 | } | 320 | } |
| 321 | }), | 321 | }), |
| 322 | - PanGesture({ fingers: 1, direction: null, distance: 0 }) | 322 | + PanGesture({ fingers: 1, direction: this.isEditIng ? PanDirection.All:PanDirection.None, distance: 0 }) |
| 323 | .onActionStart((event: GestureEvent) => { | 323 | .onActionStart((event: GestureEvent) => { |
| 324 | this.dragItem = item.num | 324 | this.dragItem = item.num |
| 325 | this.dragRefOffsetX = 0 | 325 | this.dragRefOffsetX = 0 |
| @@ -3,6 +3,7 @@ import { RefreshLayoutBean } from './RefreshLayoutBean'; | @@ -3,6 +3,7 @@ import { RefreshLayoutBean } from './RefreshLayoutBean'; | ||
| 3 | 3 | ||
| 4 | /** | 4 | /** |
| 5 | * Custom layout to show refresh or load. | 5 | * Custom layout to show refresh or load. |
| 6 | + * @deprecated | ||
| 6 | */ | 7 | */ |
| 7 | @Component | 8 | @Component |
| 8 | export default struct CustomLayout { | 9 | export default struct CustomLayout { |
| @@ -3,8 +3,6 @@ import { Logger } from 'wdKit'; | @@ -3,8 +3,6 @@ import { Logger } from 'wdKit'; | ||
| 3 | import { EmptyComponent } from '../view/EmptyComponent'; | 3 | import { EmptyComponent } from '../view/EmptyComponent'; |
| 4 | import PageModel from '../../viewmodel/PageModel'; | 4 | import PageModel from '../../viewmodel/PageModel'; |
| 5 | import { autoRefresh, listTouchEvent } from '../../utils/PullDownRefresh'; | 5 | import { autoRefresh, listTouchEvent } from '../../utils/PullDownRefresh'; |
| 6 | -import RefreshLayout from './RefreshLayout'; | ||
| 7 | -import { RefreshLayoutBean } from './RefreshLayoutBean'; | ||
| 8 | import LoadMoreLayout from './LoadMoreLayout'; | 6 | import LoadMoreLayout from './LoadMoreLayout'; |
| 9 | import { CompParser } from '../CompParser'; | 7 | import { CompParser } from '../CompParser'; |
| 10 | import { CompDTO } from 'wdBean'; | 8 | import { CompDTO } from 'wdBean'; |
| @@ -14,6 +12,8 @@ import { ProcessUtils } from 'wdRouter/Index'; | @@ -14,6 +12,8 @@ import { ProcessUtils } from 'wdRouter/Index'; | ||
| 14 | import PageAdModel from '../../viewmodel/PageAdvModel'; | 12 | import PageAdModel from '../../viewmodel/PageAdvModel'; |
| 15 | import PageNoMoreLayout from './PageNoMoreLayout'; | 13 | import PageNoMoreLayout from './PageNoMoreLayout'; |
| 16 | import { NoMoreBean } from './NoMoreBean'; | 14 | import { NoMoreBean } from './NoMoreBean'; |
| 15 | +import { RefreshLayoutBean } from '../refresh/RefreshLayoutBean'; | ||
| 16 | +import RefreshLayout from '../refresh/RefreshLayout'; | ||
| 17 | 17 | ||
| 18 | const TAG = 'PageComponent'; | 18 | const TAG = 'PageComponent'; |
| 19 | 19 | ||
| @@ -66,15 +66,15 @@ export struct PageComponent { | @@ -66,15 +66,15 @@ export struct PageComponent { | ||
| 66 | // 下拉刷新 | 66 | // 下拉刷新 |
| 67 | ListItem() { | 67 | ListItem() { |
| 68 | RefreshLayout({ | 68 | RefreshLayout({ |
| 69 | - refreshBean: new RefreshLayoutBean(this.pageModel.isVisiblePullDown, this.pageModel.pullDownRefreshImage, | ||
| 70 | - this.pageModel.pullDownRefreshText, this.pageModel.pullDownRefreshHeight) | 69 | + refreshBean: new RefreshLayoutBean(this.pageModel.isVisiblePullDown, this.pageModel.load, |
| 70 | + this.pageModel.offsetY) | ||
| 71 | }) | 71 | }) |
| 72 | } | 72 | } |
| 73 | 73 | ||
| 74 | LazyForEach(this.pageModel.compList, (compDTO: CompDTO, compIndex: number) => { | 74 | LazyForEach(this.pageModel.compList, (compDTO: CompDTO, compIndex: number) => { |
| 75 | ListItem() { | 75 | ListItem() { |
| 76 | Column() { | 76 | Column() { |
| 77 | - CompParser({ compDTO: compDTO, compIndex: compIndex }); | 77 | + CompParser({ pageModel: this.pageModel, compDTO: compDTO, compIndex: compIndex }); |
| 78 | } | 78 | } |
| 79 | } | 79 | } |
| 80 | }, | 80 | }, |
| @@ -99,8 +99,12 @@ struct PeopleShipHomePage { | @@ -99,8 +99,12 @@ struct PeopleShipHomePage { | ||
| 99 | 99 | ||
| 100 | } | 100 | } |
| 101 | 101 | ||
| 102 | - async aboutToAppear() { | 102 | + aboutToAppear() { |
| 103 | 103 | ||
| 104 | + this.getData() | ||
| 105 | + } | ||
| 106 | + | ||
| 107 | + private async getData() { | ||
| 104 | try { | 108 | try { |
| 105 | // 获取页面信息 | 109 | // 获取页面信息 |
| 106 | this.detailModel = await PeopleShipHomePageDataModel.getPeopleShipHomePageDetailInfo(this.creatorId, '', '') | 110 | this.detailModel = await PeopleShipHomePageDataModel.getPeopleShipHomePageDetailInfo(this.creatorId, '', '') |
| @@ -117,8 +121,6 @@ struct PeopleShipHomePage { | @@ -117,8 +121,6 @@ struct PeopleShipHomePage { | ||
| 117 | } catch (exception) { | 121 | } catch (exception) { |
| 118 | 122 | ||
| 119 | } | 123 | } |
| 120 | - | ||
| 121 | - | ||
| 122 | } | 124 | } |
| 123 | 125 | ||
| 124 | findFollowStata(followList: QueryListIsFollowedItem[]) { | 126 | findFollowStata(followList: QueryListIsFollowedItem[]) { |
| @@ -156,8 +158,10 @@ struct PeopleShipHomePage { | @@ -156,8 +158,10 @@ struct PeopleShipHomePage { | ||
| 156 | PageRepository.postInteractAccentionOperate(params).then(res => { | 158 | PageRepository.postInteractAccentionOperate(params).then(res => { |
| 157 | if (this.isAttention == '1') { | 159 | if (this.isAttention == '1') { |
| 158 | this.isAttention = '0' | 160 | this.isAttention = '0' |
| 161 | + this.detailModel.fansNum -= 1 | ||
| 159 | } else { | 162 | } else { |
| 160 | this.isAttention = '1' | 163 | this.isAttention = '1' |
| 164 | + this.detailModel.fansNum += 1 | ||
| 161 | } | 165 | } |
| 162 | this.isLoadingAttention = false | 166 | this.isLoadingAttention = false |
| 163 | }) | 167 | }) |
| @@ -3,6 +3,7 @@ import { RefreshLayoutBean } from './RefreshLayoutBean'; | @@ -3,6 +3,7 @@ import { RefreshLayoutBean } from './RefreshLayoutBean'; | ||
| 3 | 3 | ||
| 4 | /** | 4 | /** |
| 5 | * The refresh layout component. | 5 | * The refresh layout component. |
| 6 | + * @deprecated | ||
| 6 | */ | 7 | */ |
| 7 | @Component | 8 | @Component |
| 8 | export default struct RefreshLayout { | 9 | export default struct RefreshLayout { |
| 1 | -import { ContentDTO } from 'wdBean'; | 1 | +import { ContentDTO , Action,GoldenPositionExtraBean} from 'wdBean'; |
| 2 | import { CommonConstants ,ViewType} from 'wdConstant'; | 2 | import { CommonConstants ,ViewType} from 'wdConstant'; |
| 3 | import PageViewModel from '../../viewmodel/PageViewModel'; | 3 | import PageViewModel from '../../viewmodel/PageViewModel'; |
| 4 | import RefreshLayout from '../page/RefreshLayout'; | 4 | import RefreshLayout from '../page/RefreshLayout'; |
| @@ -22,9 +22,14 @@ struct ThemeListPage { | @@ -22,9 +22,14 @@ struct ThemeListPage { | ||
| 22 | currentPage: number = 1; | 22 | currentPage: number = 1; |
| 23 | pageSize: number = 20; | 23 | pageSize: number = 20; |
| 24 | title: string = '金刚位聚合页' | 24 | title: string = '金刚位聚合页' |
| 25 | + extra: string = '' | ||
| 25 | 26 | ||
| 26 | aboutToAppear(): void { | 27 | aboutToAppear(): void { |
| 27 | - PageViewModel.postThemeList(this.sort, this.currentPage, this.pageSize).then((liveReviewDTO) => { | 28 | + let par:Action = router.getParams() as Action; |
| 29 | + let params = par?.params; | ||
| 30 | + this.extra = params?.extra?.extra || ''; | ||
| 31 | + this.title = params?.extra?.title || ''; | ||
| 32 | + PageViewModel.postThemeList(this.sort, this.currentPage, this.pageSize,this.extra).then((liveReviewDTO) => { | ||
| 28 | console.log(`postThemeList${JSON.stringify(liveReviewDTO)}`) | 33 | console.log(`postThemeList${JSON.stringify(liveReviewDTO)}`) |
| 29 | this.data.push(...liveReviewDTO.list) | 34 | this.data.push(...liveReviewDTO.list) |
| 30 | if(this.data.getDataArray().length > 0){ | 35 | if(this.data.getDataArray().length > 0){ |
| @@ -339,8 +339,8 @@ export struct TopNavigationComponent { | @@ -339,8 +339,8 @@ export struct TopNavigationComponent { | ||
| 339 | }else { | 339 | }else { |
| 340 | Row() { | 340 | Row() { |
| 341 | Image($r('app.media.icon_search')) | 341 | Image($r('app.media.icon_search')) |
| 342 | - .width(18) | ||
| 343 | - .height(18) | 342 | + .width('24vp') |
| 343 | + .height('24vp') | ||
| 344 | } | 344 | } |
| 345 | .height('40vp') | 345 | .height('40vp') |
| 346 | .width('40vp') | 346 | .width('40vp') |
| @@ -3,31 +3,29 @@ import { FollowListDetailItem } from '../../viewmodel/FollowListDetailItem'; | @@ -3,31 +3,29 @@ import { FollowListDetailItem } from '../../viewmodel/FollowListDetailItem'; | ||
| 3 | 3 | ||
| 4 | @Component | 4 | @Component |
| 5 | export struct PeopleShipAttentionContentListHeadComponent { | 5 | export struct PeopleShipAttentionContentListHeadComponent { |
| 6 | - | ||
| 7 | - @State index: number = 0 | ||
| 8 | @ObjectLink item: FollowListDetailItem | 6 | @ObjectLink item: FollowListDetailItem |
| 7 | + | ||
| 9 | build() { | 8 | build() { |
| 10 | - Column(){ | 9 | + Column() { |
| 11 | // 头像 | 10 | // 头像 |
| 12 | PeopleShipHomePageHeadComponent({ | 11 | PeopleShipHomePageHeadComponent({ |
| 13 | diameter: 48, | 12 | diameter: 48, |
| 14 | iconDiameter: 16, | 13 | iconDiameter: 16, |
| 15 | - headPhotoUrl: this.index == 0 ? $r('app.media.attention_mine') : | ||
| 16 | - ((this.item.attentionHeadPhotoUrl && this.item.attentionHeadPhotoUrl.length > 0) ? | ||
| 17 | - this.item.attentionHeadPhotoUrl : $r('app.media.WDAccountOwnerHedaerDefaultIcon')), | ||
| 18 | - authIcon: this.index == 0 ? '' : this.item.authIcon | 14 | + headPhotoUrl: (this.item.attentionHeadPhotoUrl && this.item.attentionHeadPhotoUrl.length > 0) ? |
| 15 | + this.item.attentionHeadPhotoUrl : $r('app.media.WDAccountOwnerHedaerDefaultIcon'), | ||
| 16 | + authIcon: this.item.authIcon | ||
| 19 | }).margin({ | 17 | }).margin({ |
| 20 | bottom: '8vp' | 18 | bottom: '8vp' |
| 21 | }) | 19 | }) |
| 22 | 20 | ||
| 23 | - Text(this.index == 0 ? '我的关注' : this.item.attentionUserName) | 21 | + Text(this.item.attentionUserName) |
| 24 | .fontColor($r('app.color.color_666666')) | 22 | .fontColor($r('app.color.color_666666')) |
| 25 | .fontSize($r('app.float.vp_13')) | 23 | .fontSize($r('app.float.vp_13')) |
| 26 | .fontWeight(400) | 24 | .fontWeight(400) |
| 27 | .height('18vp') | 25 | .height('18vp') |
| 28 | .lineHeight('18vp') | 26 | .lineHeight('18vp') |
| 29 | .maxLines(1) | 27 | .maxLines(1) |
| 30 | - .textOverflow({overflow: TextOverflow.Ellipsis}) | 28 | + .textOverflow({ overflow: TextOverflow.Ellipsis }) |
| 31 | .padding({ | 29 | .padding({ |
| 32 | left: '2vp', | 30 | left: '2vp', |
| 33 | right: '2vp' | 31 | right: '2vp' |
| @@ -36,7 +34,7 @@ export struct PeopleShipAttentionContentListHeadComponent { | @@ -36,7 +34,7 @@ export struct PeopleShipAttentionContentListHeadComponent { | ||
| 36 | .alignItems(HorizontalAlign.Center) | 34 | .alignItems(HorizontalAlign.Center) |
| 37 | .width('78vp') | 35 | .width('78vp') |
| 38 | .margin({ | 36 | .margin({ |
| 39 | - left: this.index == 0 ? '8vp' : '4vp', | 37 | + left: '4vp', |
| 40 | top: '14vp', | 38 | top: '14vp', |
| 41 | bottom: '14vp' | 39 | bottom: '14vp' |
| 42 | }) | 40 | }) |
| @@ -6,37 +6,72 @@ import { PeopleShipAttentionContentListHeadComponent } from './PeopleShipAttenti | @@ -6,37 +6,72 @@ import { PeopleShipAttentionContentListHeadComponent } from './PeopleShipAttenti | ||
| 6 | @Component | 6 | @Component |
| 7 | export struct PeopleShipAttentionContentListTopComponent { | 7 | export struct PeopleShipAttentionContentListTopComponent { |
| 8 | @Prop followList: FollowListDetailItem[] | 8 | @Prop followList: FollowListDetailItem[] |
| 9 | + | ||
| 9 | build() { | 10 | build() { |
| 10 | Column() { | 11 | Column() { |
| 11 | - List(){ | 12 | + List() { |
| 12 | ListItem() { | 13 | ListItem() { |
| 13 | - PeopleShipAttentionContentListHeadComponent({ | ||
| 14 | - index: 0, | ||
| 15 | - item: this.followList[0] | ||
| 16 | - }) | 14 | + this.PeopleShipFollowTop() |
| 17 | }.onClick(() => { | 15 | }.onClick(() => { |
| 18 | // 跳转到关注列表-我的 | 16 | // 跳转到关注列表-我的 |
| 19 | WDRouterRule.jumpWithPage(WDRouterPage.followListPage) | 17 | WDRouterRule.jumpWithPage(WDRouterPage.followListPage) |
| 20 | }) | 18 | }) |
| 21 | 19 | ||
| 22 | 20 | ||
| 23 | - ForEach(this.followList, (item: FollowListDetailItem, index: number) => { | 21 | + ForEach(this.followList, (item: FollowListDetailItem) => { |
| 24 | ListItem() { | 22 | ListItem() { |
| 25 | PeopleShipAttentionContentListHeadComponent({ | 23 | PeopleShipAttentionContentListHeadComponent({ |
| 26 | - index: index + 1, | ||
| 27 | item: item | 24 | item: item |
| 28 | }) | 25 | }) |
| 29 | }.onClick(() => { | 26 | }.onClick(() => { |
| 30 | let creatorId = item.attentionCreatorId || '' | 27 | let creatorId = item.attentionCreatorId || '' |
| 31 | ProcessUtils.gotoPeopleShipHomePage(creatorId) | 28 | ProcessUtils.gotoPeopleShipHomePage(creatorId) |
| 32 | }) | 29 | }) |
| 33 | - }, (item: FollowListDetailItem) => item.attentionCreatorId) | 30 | + }, (item: FollowListDetailItem, index: number) => item.attentionCreatorId + index) |
| 34 | } | 31 | } |
| 35 | .listDirection(Axis.Horizontal) | 32 | .listDirection(Axis.Horizontal) |
| 36 | .scrollBar(BarState.Off) | 33 | .scrollBar(BarState.Off) |
| 37 | .width('100%') | 34 | .width('100%') |
| 38 | .height('102vp') | 35 | .height('102vp') |
| 36 | + | ||
| 39 | Divider().strokeWidth(1).color($r('app.color.color_F5F5F5')) | 37 | Divider().strokeWidth(1).color($r('app.color.color_F5F5F5')) |
| 40 | } | 38 | } |
| 41 | } | 39 | } |
| 40 | + | ||
| 41 | + @Builder | ||
| 42 | + PeopleShipFollowTop() { | ||
| 43 | + Column() { | ||
| 44 | + // 头像 | ||
| 45 | + Image($r('app.media.attention_mine')) | ||
| 46 | + .alt($r('app.media.attention_mine')) | ||
| 47 | + .width(48) | ||
| 48 | + .height(48) | ||
| 49 | + .borderRadius(24) | ||
| 50 | + .objectFit(ImageFit.ScaleDown) | ||
| 51 | + .backgroundColor($r('app.color.color_F5F5F5')) | ||
| 52 | + .margin({ | ||
| 53 | + bottom: '8vp' | ||
| 54 | + }) | ||
| 55 | + | ||
| 56 | + Text('我的关注') | ||
| 57 | + .fontColor($r('app.color.color_666666')) | ||
| 58 | + .fontSize($r('app.float.vp_13')) | ||
| 59 | + .fontWeight(400) | ||
| 60 | + .height('18vp') | ||
| 61 | + .lineHeight('18vp') | ||
| 62 | + .maxLines(1) | ||
| 63 | + .textOverflow({ overflow: TextOverflow.Ellipsis }) | ||
| 64 | + .padding({ | ||
| 65 | + left: '2vp', | ||
| 66 | + right: '2vp' | ||
| 67 | + }) | ||
| 68 | + } | ||
| 69 | + .alignItems(HorizontalAlign.Center) | ||
| 70 | + .width('78vp') | ||
| 71 | + .margin({ | ||
| 72 | + left: '8vp', | ||
| 73 | + top: '14vp', | ||
| 74 | + bottom: '14vp' | ||
| 75 | + }) | ||
| 76 | + } | ||
| 42 | } | 77 | } |
| @@ -280,6 +280,7 @@ export struct PeopleShipMainComponent { | @@ -280,6 +280,7 @@ export struct PeopleShipMainComponent { | ||
| 280 | //批量查询各类型内容动态数据接口 | 280 | //批量查询各类型内容动态数据接口 |
| 281 | this.checkContentInteractData(listData.list, resolve) | 281 | this.checkContentInteractData(listData.list, resolve) |
| 282 | } else { | 282 | } else { |
| 283 | + this.hasMore = false; | ||
| 283 | this.resolveEnd(true, resolve) | 284 | this.resolveEnd(true, resolve) |
| 284 | } | 285 | } |
| 285 | 286 |
| @@ -25,12 +25,27 @@ export struct PeopleShipRecommendHeadComponent { | @@ -25,12 +25,27 @@ export struct PeopleShipRecommendHeadComponent { | ||
| 25 | }) | 25 | }) |
| 26 | }.margin({ top: 12, bottom: 8 }) | 26 | }.margin({ top: 12, bottom: 8 }) |
| 27 | 27 | ||
| 28 | - Text(this.rmhInfo.userName) | ||
| 29 | - .fontColor($r('app.color.color_222222')) | ||
| 30 | - .fontSize($r('app.float.vp_14')) | ||
| 31 | - .fontWeight(600) | ||
| 32 | - .maxLines(1) | ||
| 33 | - .textOverflow({overflow: TextOverflow.Ellipsis}) | 28 | + Row() { |
| 29 | + Text(this.rmhInfo.userName) | ||
| 30 | + .fontColor($r('app.color.color_222222')) | ||
| 31 | + .fontSize($r('app.float.vp_14')) | ||
| 32 | + .fontWeight(600) | ||
| 33 | + .maxLines(1) | ||
| 34 | + .textOverflow({overflow: TextOverflow.Ellipsis}) | ||
| 35 | + if (this.rmhInfo.authIcon) { | ||
| 36 | + Image(this.rmhInfo.authIcon) | ||
| 37 | + .width('12vp') | ||
| 38 | + .height('12vp') | ||
| 39 | + .borderRadius(6) | ||
| 40 | + .objectFit(ImageFit.Cover) | ||
| 41 | + .margin({ | ||
| 42 | + left: '2vp' | ||
| 43 | + }) | ||
| 44 | + } | ||
| 45 | + } | ||
| 46 | + .alignItems(VerticalAlign.Center) | ||
| 47 | + .justifyContent(FlexAlign.Center) | ||
| 48 | + | ||
| 34 | 49 | ||
| 35 | Text(this.rmhInfo.introduction) | 50 | Text(this.rmhInfo.introduction) |
| 36 | .fontColor($r('app.color.color_B0B0B0')) | 51 | .fontColor($r('app.color.color_B0B0B0')) |
| 1 | +import { ToastUtils } from 'wdKit'; | ||
| 2 | + | ||
| 1 | @Component | 3 | @Component |
| 2 | export struct PeopleShipHomeAttentionComponent { | 4 | export struct PeopleShipHomeAttentionComponent { |
| 3 | @Consume isAttention: string | 5 | @Consume isAttention: string |
| @@ -18,7 +20,14 @@ export struct PeopleShipHomeAttentionComponent { | @@ -18,7 +20,14 @@ export struct PeopleShipHomeAttentionComponent { | ||
| 18 | .height(20) | 20 | .height(20) |
| 19 | .color($r('app.color.color_fff')) | 21 | .color($r('app.color.color_fff')) |
| 20 | }else { | 22 | }else { |
| 21 | - Text('+ 关注') | 23 | + Image($r('app.media.people_ship_top_add')) |
| 24 | + .objectFit(ImageFit.Auto) | ||
| 25 | + .width('16vp') | ||
| 26 | + .height('16pv') | ||
| 27 | + .margin({ | ||
| 28 | + right: '4vp' | ||
| 29 | + }) | ||
| 30 | + Text('关注') | ||
| 22 | .fontColor(Color.White) | 31 | .fontColor(Color.White) |
| 23 | .fontSize($r('app.float.vp_14')) | 32 | .fontSize($r('app.float.vp_14')) |
| 24 | .fontWeight(500) | 33 | .fontWeight(500) |
| @@ -104,7 +113,7 @@ export struct PeopleShipHomeAttentionComponent { | @@ -104,7 +113,7 @@ export struct PeopleShipHomeAttentionComponent { | ||
| 104 | left: '-5vp' | 113 | left: '-5vp' |
| 105 | }) | 114 | }) |
| 106 | .onClick(() => { | 115 | .onClick(() => { |
| 107 | - | 116 | + ToastUtils.showToast('分享为公共方法,待开发', 1000); |
| 108 | }) | 117 | }) |
| 109 | 118 | ||
| 110 | } | 119 | } |
| @@ -24,7 +24,7 @@ export struct PeopleShipHomeListComponent { | @@ -24,7 +24,7 @@ export struct PeopleShipHomeListComponent { | ||
| 24 | // 列表 | 24 | // 列表 |
| 25 | else if (this.publishCount == 0) { | 25 | else if (this.publishCount == 0) { |
| 26 | // 无数据展示 | 26 | // 无数据展示 |
| 27 | - EmptyComponent({emptyType: 13}).height(DisplayUtils.getDeviceHeight() - this.topHeight) | 27 | + EmptyComponent({emptyType: 12}).height(DisplayUtils.getDeviceHeight() - this.topHeight) |
| 28 | } else { | 28 | } else { |
| 29 | Column() { | 29 | Column() { |
| 30 | Column() { | 30 | Column() { |
| @@ -38,14 +38,17 @@ export struct PeopleShipHomeListComponent { | @@ -38,14 +38,17 @@ export struct PeopleShipHomeListComponent { | ||
| 38 | } | 38 | } |
| 39 | .justifyContent(FlexAlign.Start) | 39 | .justifyContent(FlexAlign.Start) |
| 40 | } | 40 | } |
| 41 | + .backgroundColor(Color.White) | ||
| 41 | .align(Alignment.Start) | 42 | .align(Alignment.Start) |
| 42 | .scrollable(ScrollDirection.Horizontal) | 43 | .scrollable(ScrollDirection.Horizontal) |
| 43 | .scrollBar(BarState.Off) | 44 | .scrollBar(BarState.Off) |
| 44 | .width('100%') | 45 | .width('100%') |
| 45 | } | 46 | } |
| 47 | + .backgroundColor(Color.White) | ||
| 46 | .alignItems(VerticalAlign.Bottom) | 48 | .alignItems(VerticalAlign.Bottom) |
| 47 | .width('100%') | 49 | .width('100%') |
| 48 | } | 50 | } |
| 51 | + .justifyContent(FlexAlign.Start) | ||
| 49 | .height('44vp') | 52 | .height('44vp') |
| 50 | .alignItems(HorizontalAlign.Start) | 53 | .alignItems(HorizontalAlign.Start) |
| 51 | .width('100%') | 54 | .width('100%') |
| 1 | import router from '@ohos.router' | 1 | import router from '@ohos.router' |
| 2 | import { PeopleShipUserDetailData } from 'wdBean' | 2 | import { PeopleShipUserDetailData } from 'wdBean' |
| 3 | import { PeopleShipHomePageHeadComponent } from './PeopleShipHomePageHeadComponent' | 3 | import { PeopleShipHomePageHeadComponent } from './PeopleShipHomePageHeadComponent' |
| 4 | +import { WDRouterPage, WDRouterRule } from 'wdRouter/Index' | ||
| 5 | +import { ToastUtils } from 'wdKit'; | ||
| 4 | 6 | ||
| 5 | @Component | 7 | @Component |
| 6 | export struct PeopleShipHomePageNavComponent { | 8 | export struct PeopleShipHomePageNavComponent { |
| @@ -38,8 +40,13 @@ export struct PeopleShipHomePageNavComponent { | @@ -38,8 +40,13 @@ export struct PeopleShipHomePageNavComponent { | ||
| 38 | iconDiameter: 10, | 40 | iconDiameter: 10, |
| 39 | headPhotoUrl: (this.detailModel.headPhotoUrl && this.detailModel.headPhotoUrl.length > 0 ) ? this.detailModel.headPhotoUrl : $r('app.media.WDAccountOwnerHedaerDefaultIcon'), | 41 | headPhotoUrl: (this.detailModel.headPhotoUrl && this.detailModel.headPhotoUrl.length > 0 ) ? this.detailModel.headPhotoUrl : $r('app.media.WDAccountOwnerHedaerDefaultIcon'), |
| 40 | authIcon: this.detailModel.authIcon | 42 | authIcon: this.detailModel.authIcon |
| 41 | - }) | ||
| 42 | - .margin({ | 43 | + }).onClick(()=>{ |
| 44 | + let params = { | ||
| 45 | + 'headPhotoUrl': this.detailModel.headPhotoUrl, | ||
| 46 | + 'headType': '1' | ||
| 47 | + } as Record<string, string>; | ||
| 48 | + WDRouterRule.jumpWithPage(WDRouterPage.showUserHeaderPage,params) | ||
| 49 | + }).margin({ | ||
| 43 | left: '10vp', | 50 | left: '10vp', |
| 44 | }) | 51 | }) |
| 45 | .visibility((this.topOpacity > 0.5 ? Visibility.Visible : Visibility.Hidden)) | 52 | .visibility((this.topOpacity > 0.5 ? Visibility.Visible : Visibility.Hidden)) |
| @@ -56,7 +63,25 @@ export struct PeopleShipHomePageNavComponent { | @@ -56,7 +63,25 @@ export struct PeopleShipHomePageNavComponent { | ||
| 56 | 63 | ||
| 57 | if (this.isAttention == '0') { | 64 | if (this.isAttention == '0') { |
| 58 | // 关注 | 65 | // 关注 |
| 59 | - Button('+ 关注', { type: ButtonType.Normal, stateEffect: true }) | 66 | + Button({ type: ButtonType.Normal, stateEffect: true }) { |
| 67 | + Row(){ | ||
| 68 | + Image($r('app.media.people_ship_top_add')) | ||
| 69 | + .objectFit(ImageFit.Auto) | ||
| 70 | + .width('12vp') | ||
| 71 | + .height('12pv') | ||
| 72 | + .margin({ | ||
| 73 | + right: '2vp' | ||
| 74 | + }) | ||
| 75 | + Text('关注') | ||
| 76 | + .fontSize($r('app.float.vp_12')) | ||
| 77 | + .fontColor(Color.White) | ||
| 78 | + } | ||
| 79 | + .alignSelf(ItemAlign.Center) | ||
| 80 | + .justifyContent(FlexAlign.Center) | ||
| 81 | + .width('100%') | ||
| 82 | + .height('100%') | ||
| 83 | + } | ||
| 84 | + | ||
| 60 | .borderRadius(4) | 85 | .borderRadius(4) |
| 61 | .backgroundColor($r('app.color.color_ED2800')) | 86 | .backgroundColor($r('app.color.color_ED2800')) |
| 62 | .width('54vp') | 87 | .width('54vp') |
| @@ -71,8 +96,6 @@ export struct PeopleShipHomePageNavComponent { | @@ -71,8 +96,6 @@ export struct PeopleShipHomePageNavComponent { | ||
| 71 | left: '12vp', | 96 | left: '12vp', |
| 72 | }) | 97 | }) |
| 73 | .padding(0) | 98 | .padding(0) |
| 74 | - .fontSize($r('app.float.vp_12')) | ||
| 75 | - .fontColor(Color.White) | ||
| 76 | .visibility((this.attentionOpacity ? Visibility.Visible : Visibility.Hidden)) | 99 | .visibility((this.attentionOpacity ? Visibility.Visible : Visibility.Hidden)) |
| 77 | } else { | 100 | } else { |
| 78 | Button('已关注', { type: ButtonType.Normal, stateEffect: true }) | 101 | Button('已关注', { type: ButtonType.Normal, stateEffect: true }) |
| @@ -104,7 +127,7 @@ export struct PeopleShipHomePageNavComponent { | @@ -104,7 +127,7 @@ export struct PeopleShipHomePageNavComponent { | ||
| 104 | .objectFit(ImageFit.Auto) | 127 | .objectFit(ImageFit.Auto) |
| 105 | .margin({ right: '10vp' }) | 128 | .margin({ right: '10vp' }) |
| 106 | .onClick(() => { | 129 | .onClick(() => { |
| 107 | - | 130 | + ToastUtils.showToast('分享为公共方法,待开发', 1000); |
| 108 | }) | 131 | }) |
| 109 | } | 132 | } |
| 110 | .width('100%') | 133 | .width('100%') |
| @@ -5,7 +5,7 @@ export struct PeopleShipHomePageAttestationComponent { | @@ -5,7 +5,7 @@ export struct PeopleShipHomePageAttestationComponent { | ||
| 5 | build() { | 5 | build() { |
| 6 | Row() { | 6 | Row() { |
| 7 | Text(this.name) | 7 | Text(this.name) |
| 8 | - .lineHeight('16vp') | 8 | + .lineHeight('18vp') |
| 9 | .fontColor($r('app.color.color_ED2800')) | 9 | .fontColor($r('app.color.color_ED2800')) |
| 10 | .fontSize($r('app.float.vp_11')) | 10 | .fontSize($r('app.float.vp_11')) |
| 11 | .backgroundColor($r('app.color.color_1AED2800')) | 11 | .backgroundColor($r('app.color.color_1AED2800')) |
| @@ -16,21 +16,27 @@ export struct PeopleShipHomePageAttestationComponent { | @@ -16,21 +16,27 @@ export struct PeopleShipHomePageAttestationComponent { | ||
| 16 | left: '16vp', | 16 | left: '16vp', |
| 17 | }) | 17 | }) |
| 18 | .padding({ | 18 | .padding({ |
| 19 | - top: '3vp', | ||
| 20 | - bottom: '3vp', | ||
| 21 | - right: '6vp', | ||
| 22 | - left: '6vp' | 19 | + top: '1vp', |
| 20 | + bottom: '1vp', | ||
| 21 | + right: '4vp', | ||
| 22 | + left: '4vp' | ||
| 23 | }) | 23 | }) |
| 24 | 24 | ||
| 25 | Text(this.content) | 25 | Text(this.content) |
| 26 | - .lineHeight('22vp') | 26 | + .lineHeight('18vp') |
| 27 | .fontSize($r('app.float.vp_12')) | 27 | .fontSize($r('app.float.vp_12')) |
| 28 | .layoutWeight(1) | 28 | .layoutWeight(1) |
| 29 | .fontColor($r('app.color.color_222222')) | 29 | .fontColor($r('app.color.color_222222')) |
| 30 | .textAlign(TextAlign.Start) | 30 | .textAlign(TextAlign.Start) |
| 31 | + .align(Alignment.Center) | ||
| 32 | + .padding(0) | ||
| 31 | .margin({ | 33 | .margin({ |
| 32 | right: '16vp' | 34 | right: '16vp' |
| 33 | }) | 35 | }) |
| 36 | + .padding({ | ||
| 37 | + top: '1vp', | ||
| 38 | + bottom: '1vp', | ||
| 39 | + }) | ||
| 34 | } | 40 | } |
| 35 | .width('100%') | 41 | .width('100%') |
| 36 | .alignItems(VerticalAlign.Top) | 42 | .alignItems(VerticalAlign.Top) |
| @@ -9,6 +9,7 @@ export struct PeopleShipHomePageHeadComponent { | @@ -9,6 +9,7 @@ export struct PeopleShipHomePageHeadComponent { | ||
| 9 | Stack({ alignContent: Alignment.BottomEnd }) { | 9 | Stack({ alignContent: Alignment.BottomEnd }) { |
| 10 | // 头像 | 10 | // 头像 |
| 11 | Image( this.headPhotoUrl ) | 11 | Image( this.headPhotoUrl ) |
| 12 | + .alt($r('app.media.WDAccountOwnerHedaerDefaultIcon')) | ||
| 12 | .width(this.diameter) | 13 | .width(this.diameter) |
| 13 | .height(this.diameter) | 14 | .height(this.diameter) |
| 14 | .borderRadius(this.diameter/2) | 15 | .borderRadius(this.diameter/2) |
| @@ -2,11 +2,12 @@ import measure from '@ohos.measure' | @@ -2,11 +2,12 @@ import measure from '@ohos.measure' | ||
| 2 | import { DisplayUtils } from 'wdKit' | 2 | import { DisplayUtils } from 'wdKit' |
| 3 | import { PeopleShipHomePageHeadComponent } from './PeopleShipHomePageHeadComponent' | 3 | import { PeopleShipHomePageHeadComponent } from './PeopleShipHomePageHeadComponent' |
| 4 | import { PeopleShipHomePageAttestationComponent } from './PeopleShipHomePageAttestationComponent' | 4 | import { PeopleShipHomePageAttestationComponent } from './PeopleShipHomePageAttestationComponent' |
| 5 | -import { Logger } from 'wdKit' | 5 | +import { Logger } from 'wdKit' |
| 6 | import { PeopleShipHomePageDataModel } from '../../viewmodel/PeopleShipHomePageDataModel' | 6 | import { PeopleShipHomePageDataModel } from '../../viewmodel/PeopleShipHomePageDataModel' |
| 7 | import { InfluenceData, PeopleShipUserDetailData } from 'wdBean' | 7 | import { InfluenceData, PeopleShipUserDetailData } from 'wdBean' |
| 8 | import { PeopleShipHomeAttentionComponent } from './PeopleShipHomeAttentionComponent' | 8 | import { PeopleShipHomeAttentionComponent } from './PeopleShipHomeAttentionComponent' |
| 9 | import { HWLocationUtils } from 'wdHwAbility' | 9 | import { HWLocationUtils } from 'wdHwAbility' |
| 10 | +import { WDRouterPage, WDRouterRule } from 'wdRouter/Index' | ||
| 10 | 11 | ||
| 11 | 12 | ||
| 12 | @Component | 13 | @Component |
| @@ -27,30 +28,37 @@ export struct PeopleShipHomePageTopComponent { | @@ -27,30 +28,37 @@ export struct PeopleShipHomePageTopComponent { | ||
| 27 | @State collapseTxt: string = '…展开'; | 28 | @State collapseTxt: string = '…展开'; |
| 28 | private subTxt: string = ''; | 29 | private subTxt: string = ''; |
| 29 | @State content: string = '' | 30 | @State content: string = '' |
| 30 | - @State topFixedHeight: number = 320 | 31 | + @State topFixedHeight: number = 286 |
| 31 | @State lineInNum: number = 1 | 32 | @State lineInNum: number = 1 |
| 32 | @Link topHeight: number | 33 | @Link topHeight: number |
| 33 | @State provinceName: string = '' | 34 | @State provinceName: string = '' |
| 35 | + | ||
| 34 | build() { | 36 | build() { |
| 35 | Column() { | 37 | Column() { |
| 36 | - Stack({ alignContent: Alignment.TopStart}) { | 38 | + Stack({ alignContent: Alignment.TopStart }) { |
| 37 | // 顶部图片 | 39 | // 顶部图片 |
| 38 | Image($r('app.media.home_page_bg')) | 40 | Image($r('app.media.home_page_bg')) |
| 39 | .width('100%') | 41 | .width('100%') |
| 40 | .height('120vp') | 42 | .height('120vp') |
| 41 | .objectFit(ImageFit.Fill) | 43 | .objectFit(ImageFit.Fill) |
| 42 | - .backgroundColor(Color.Black) | 44 | + .backgroundColor(Color.White) |
| 43 | // 头像和名称 | 45 | // 头像和名称 |
| 44 | Row() { | 46 | Row() { |
| 45 | // 头像 | 47 | // 头像 |
| 46 | PeopleShipHomePageHeadComponent({ | 48 | PeopleShipHomePageHeadComponent({ |
| 47 | diameter: 80, | 49 | diameter: 80, |
| 48 | iconDiameter: 20, | 50 | iconDiameter: 20, |
| 49 | - headPhotoUrl:(this.detailModel.headPhotoUrl && this.detailModel.headPhotoUrl.length > 0) ? this.detailModel.headPhotoUrl : $r('app.media.WDAccountOwnerHedaerDefaultIcon') , | 51 | + headPhotoUrl: (this.detailModel.headPhotoUrl && this.detailModel.headPhotoUrl.length > 0) ? this.detailModel.headPhotoUrl : $r('app.media.WDAccountOwnerHedaerDefaultIcon'), |
| 50 | authIcon: this.detailModel.authIcon | 52 | authIcon: this.detailModel.authIcon |
| 51 | }).margin({ | 53 | }).margin({ |
| 52 | left: '10vp', | 54 | left: '10vp', |
| 53 | bottom: '20vp' | 55 | bottom: '20vp' |
| 56 | + }).onClick(() => { | ||
| 57 | + let params = { | ||
| 58 | + 'headPhotoUrl': this.detailModel.headPhotoUrl, | ||
| 59 | + 'headType': '1' | ||
| 60 | + } as Record<string, string>; | ||
| 61 | + WDRouterRule.jumpWithPage(WDRouterPage.showUserHeaderPage, params) | ||
| 54 | }) | 62 | }) |
| 55 | 63 | ||
| 56 | 64 | ||
| @@ -61,7 +69,7 @@ export struct PeopleShipHomePageTopComponent { | @@ -61,7 +69,7 @@ export struct PeopleShipHomePageTopComponent { | ||
| 61 | .fontColor($r('app.color.color_222222')) | 69 | .fontColor($r('app.color.color_222222')) |
| 62 | .fontWeight(500) | 70 | .fontWeight(500) |
| 63 | .textAlign(TextAlign.Start) | 71 | .textAlign(TextAlign.Start) |
| 64 | - .textOverflow({overflow: TextOverflow.Ellipsis}) | 72 | + .textOverflow({ overflow: TextOverflow.Ellipsis }) |
| 65 | .maxLines(2) | 73 | .maxLines(2) |
| 66 | .layoutWeight(1) | 74 | .layoutWeight(1) |
| 67 | .margin({ | 75 | .margin({ |
| @@ -78,82 +86,89 @@ export struct PeopleShipHomePageTopComponent { | @@ -78,82 +86,89 @@ export struct PeopleShipHomePageTopComponent { | ||
| 78 | .width('100%') | 86 | .width('100%') |
| 79 | .height('180vp') | 87 | .height('180vp') |
| 80 | .backgroundColor(Color.Transparent) | 88 | .backgroundColor(Color.Transparent) |
| 89 | + | ||
| 81 | // 认证id:1蓝2黄,蓝v 只有官方认证,黄v有领域和身份认证 | 90 | // 认证id:1蓝2黄,蓝v 只有官方认证,黄v有领域和身份认证 |
| 82 | // 官方认证 | 91 | // 官方认证 |
| 83 | - if(this.detailModel.authId == 1 && this.detailModel.categoryAuth.length > 0) { | ||
| 84 | - PeopleShipHomePageAttestationComponent({name: '官方认证', content: this.detailModel.categoryAuth}) | 92 | + if (this.detailModel.authId == 1 && this.detailModel.categoryAuth.length > 0) { |
| 93 | + PeopleShipHomePageAttestationComponent({ name: '官方认证', content: this.detailModel.categoryAuth}) | ||
| 85 | .margin({ | 94 | .margin({ |
| 86 | - top: '10vp', | 95 | + top: '0vp', |
| 87 | bottom: '10vp' | 96 | bottom: '10vp' |
| 88 | }) | 97 | }) |
| 89 | } | 98 | } |
| 90 | - if(this.detailModel.authId == 2) { | ||
| 91 | - if (this.detailModel.authTitle && this.detailModel.authTitle.length > 0 ){ | ||
| 92 | - PeopleShipHomePageAttestationComponent({name: '领域认证', content: this.detailModel.authTitle}) | ||
| 93 | - .margin({ | ||
| 94 | - top: '10vp', | ||
| 95 | - bottom: '10vp' | ||
| 96 | - }) | ||
| 97 | - } | ||
| 98 | - if (this.detailModel.authPersonal && this.detailModel.authPersonal.length > 0 ){ | ||
| 99 | - PeopleShipHomePageAttestationComponent({name: '身份认证', content: this.detailModel.authPersonal}) | 99 | + if (this.detailModel.authId == 2) { |
| 100 | + if (this.detailModel.authTitle && this.detailModel.authTitle.length > 0) { | ||
| 101 | + PeopleShipHomePageAttestationComponent({ name: '领域认证', content: this.detailModel.authTitle }) | ||
| 100 | .margin({ | 102 | .margin({ |
| 101 | - top: '10vp', | 103 | + top: '0vp', |
| 104 | + bottom: (this.detailModel.authPersonal && this.detailModel.authPersonal.length > 0) ? '6vp' : '10vp' | ||
| 105 | + }) | ||
| 106 | + } | ||
| 107 | + if (this.detailModel.authPersonal && this.detailModel.authPersonal.length > 0) { | ||
| 108 | + PeopleShipHomePageAttestationComponent({ name: '身份认证', content: this.detailModel.authPersonal }) | ||
| 109 | + .margin({ | ||
| 110 | + top: '0vp', | ||
| 102 | bottom: '10vp' | 111 | bottom: '10vp' |
| 103 | }) | 112 | }) |
| 104 | } | 113 | } |
| 105 | } | 114 | } |
| 106 | 115 | ||
| 107 | // 简介 | 116 | // 简介 |
| 108 | - if(this.lineInNum > 3) { | 117 | + if (this.lineInNum > 3) { |
| 109 | Row() { | 118 | Row() { |
| 110 | Text() { | 119 | Text() { |
| 111 | Span(this.content) | 120 | Span(this.content) |
| 112 | .fontColor($r('app.color.color_222222')) | 121 | .fontColor($r('app.color.color_222222')) |
| 113 | 122 | ||
| 114 | Span(this.collapseTxt) | 123 | Span(this.collapseTxt) |
| 115 | - .onClick(()=>{ | ||
| 116 | - if(this.isCollapse){ | 124 | + .onClick(() => { |
| 125 | + if (this.isCollapse) { | ||
| 117 | this.maxLines = Infinity; | 126 | this.maxLines = Infinity; |
| 118 | this.content = `简介:${this.detailModel.introduction}` | 127 | this.content = `简介:${this.detailModel.introduction}` |
| 119 | this.isCollapse = false; | 128 | this.isCollapse = false; |
| 120 | this.collapseTxt = '收起'; | 129 | this.collapseTxt = '收起'; |
| 121 | this.topHeight = this.topFixedHeight + 21 * this.lineInNum | 130 | this.topHeight = this.topFixedHeight + 21 * this.lineInNum |
| 122 | 131 | ||
| 123 | - }else{ | 132 | + } else { |
| 124 | this.isCollapse = true; | 133 | this.isCollapse = true; |
| 125 | this.collapseTxt = '…展开'; | 134 | this.collapseTxt = '…展开'; |
| 126 | this.content = this.subTxt; | 135 | this.content = this.subTxt; |
| 127 | - this.topHeight = this.topFixedHeight + 21 * 3 | 136 | + this.topHeight = this.topFixedHeight + 21 * 3 |
| 128 | } | 137 | } |
| 129 | }) | 138 | }) |
| 130 | .fontColor($r('app.color.color_B0B0B0')) | 139 | .fontColor($r('app.color.color_B0B0B0')) |
| 131 | 140 | ||
| 132 | } | 141 | } |
| 142 | + .backgroundColor(Color.Transparent) | ||
| 133 | .lineHeight('21vp') | 143 | .lineHeight('21vp') |
| 144 | + .width('100%') | ||
| 134 | .maxLines(this.maxLines) | 145 | .maxLines(this.maxLines) |
| 135 | - .textOverflow({overflow: TextOverflow.Ellipsis}) | 146 | + .textOverflow({ overflow: TextOverflow.Ellipsis }) |
| 136 | .fontSize($r('app.float.vp_14')) | 147 | .fontSize($r('app.float.vp_14')) |
| 137 | - .key('home_page_introduction') | ||
| 138 | - .margin({ | 148 | + .padding({ |
| 139 | left: '16vp', | 149 | left: '16vp', |
| 140 | right: '16vp', | 150 | right: '16vp', |
| 141 | }) | 151 | }) |
| 142 | }.width('100%') | 152 | }.width('100%') |
| 153 | + .backgroundColor(Color.Transparent) | ||
| 143 | .alignItems(VerticalAlign.Top) | 154 | .alignItems(VerticalAlign.Top) |
| 144 | - }else { | 155 | + } else { |
| 145 | Row() { | 156 | Row() { |
| 146 | Text(`简介:${this.detailModel.introduction}`) | 157 | Text(`简介:${this.detailModel.introduction}`) |
| 147 | - .fontSize($r('app.float.vp_14')) | ||
| 148 | - .fontColor($r('app.color.color_222222')) | ||
| 149 | - .lineHeight('21vp') | ||
| 150 | - .maxLines(3) | ||
| 151 | - .textOverflow({overflow: TextOverflow.Ellipsis}) | ||
| 152 | - .margin({ | ||
| 153 | - left: '16vp', | ||
| 154 | - right: '16vp', | ||
| 155 | - }) | 158 | + .fontSize($r('app.float.vp_14')) |
| 159 | + .fontColor($r('app.color.color_222222')) | ||
| 160 | + .lineHeight('21vp') | ||
| 161 | + .width('100%') | ||
| 162 | + .maxLines(3) | ||
| 163 | + .textOverflow({ overflow: TextOverflow.Ellipsis }) | ||
| 164 | + .padding({ | ||
| 165 | + left: '16vp', | ||
| 166 | + right: '16vp', | ||
| 167 | + }) | ||
| 168 | + .backgroundColor(Color.Transparent) | ||
| 169 | + | ||
| 156 | }.width('100%') | 170 | }.width('100%') |
| 171 | + .backgroundColor(Color.Transparent) | ||
| 157 | .alignItems(VerticalAlign.Top) | 172 | .alignItems(VerticalAlign.Top) |
| 158 | } | 173 | } |
| 159 | 174 | ||
| @@ -164,7 +179,6 @@ export struct PeopleShipHomePageTopComponent { | @@ -164,7 +179,6 @@ export struct PeopleShipHomePageTopComponent { | ||
| 164 | .fontSize($r('app.float.vp_12')) | 179 | .fontSize($r('app.float.vp_12')) |
| 165 | .fontColor($r('app.color.color_999999')) | 180 | .fontColor($r('app.color.color_999999')) |
| 166 | .textAlign(TextAlign.Start) | 181 | .textAlign(TextAlign.Start) |
| 167 | - .width('100%') | ||
| 168 | .alignSelf(ItemAlign.Start) | 182 | .alignSelf(ItemAlign.Start) |
| 169 | .margin({ | 183 | .margin({ |
| 170 | right: '16vp', | 184 | right: '16vp', |
| @@ -247,7 +261,8 @@ export struct PeopleShipHomePageTopComponent { | @@ -247,7 +261,8 @@ export struct PeopleShipHomePageTopComponent { | ||
| 247 | .height('6vp') | 261 | .height('6vp') |
| 248 | } | 262 | } |
| 249 | .width('100%') | 263 | .width('100%') |
| 250 | - .height('100%') | 264 | + |
| 265 | + // .height('100%') | ||
| 251 | } | 266 | } |
| 252 | 267 | ||
| 253 | async aboutToAppear() { | 268 | async aboutToAppear() { |
| @@ -265,17 +280,15 @@ export struct PeopleShipHomePageTopComponent { | @@ -265,17 +280,15 @@ export struct PeopleShipHomePageTopComponent { | ||
| 265 | 280 | ||
| 266 | } | 281 | } |
| 267 | 282 | ||
| 268 | - | ||
| 269 | - | ||
| 270 | // 不听减去2个字-一直到时3行 | 283 | // 不听减去2个字-一直到时3行 |
| 271 | private compIntroductionTextHeights() { | 284 | private compIntroductionTextHeights() { |
| 272 | let introduction = `简介:${this.detailModel.introduction}` | 285 | let introduction = `简介:${this.detailModel.introduction}` |
| 273 | - let lineInNum1 = this.getTextLineNum(introduction, DisplayUtils.getDeviceWidth() - 32, 21, $r('app.float.vp_14')) | ||
| 274 | - while (lineInNum1 > 3 ) { | 286 | + let lineInNum1 = this.getTextLineNum(introduction, DisplayUtils.getDeviceWidth() - 32, 21, $r('app.float.vp_14')) |
| 287 | + while (lineInNum1 > 3) { | ||
| 275 | introduction = introduction.substring(0, introduction.length - 2); | 288 | introduction = introduction.substring(0, introduction.length - 2); |
| 276 | - lineInNum1 = this.getTextLineNum(introduction, DisplayUtils.getDeviceWidth() - 32, 21, $r('app.float.vp_14')) | 289 | + lineInNum1 = this.getTextLineNum(introduction + this.collapseTxt, DisplayUtils.getDeviceWidth() - 32, 21, $r('app.float.vp_14')) |
| 277 | } | 290 | } |
| 278 | - introduction = introduction.substring(0, introduction.length - 3); | 291 | + // introduction = introduction.substring(0, introduction.length - 3); |
| 279 | Logger.debug('PeopleShipHomePageTopComponent', '3行简介:', `${introduction}`) | 292 | Logger.debug('PeopleShipHomePageTopComponent', '3行简介:', `${introduction}`) |
| 280 | 293 | ||
| 281 | this.subTxt = introduction; | 294 | this.subTxt = introduction; |
| @@ -285,7 +298,7 @@ export struct PeopleShipHomePageTopComponent { | @@ -285,7 +298,7 @@ export struct PeopleShipHomePageTopComponent { | ||
| 285 | private getTextLineNum(text: string, constraintWidth: number, lineHeight: number, fontSize: number | string | Resource) { | 298 | private getTextLineNum(text: string, constraintWidth: number, lineHeight: number, fontSize: number | string | Resource) { |
| 286 | let size = this.topMeasureText(text, constraintWidth, lineHeight, fontSize) | 299 | let size = this.topMeasureText(text, constraintWidth, lineHeight, fontSize) |
| 287 | let height: number = Number(size.height) | 300 | let height: number = Number(size.height) |
| 288 | - return Math.ceil(px2vp(height)/lineHeight) | 301 | + return Math.ceil(px2vp(height) / lineHeight) |
| 289 | } | 302 | } |
| 290 | 303 | ||
| 291 | private topMeasureText(text: string, constraintWidth: number, lineHeight: number, fontSize: number | string | Resource) { | 304 | private topMeasureText(text: string, constraintWidth: number, lineHeight: number, fontSize: number | string | Resource) { |
| @@ -299,51 +312,56 @@ export struct PeopleShipHomePageTopComponent { | @@ -299,51 +312,56 @@ export struct PeopleShipHomePageTopComponent { | ||
| 299 | 312 | ||
| 300 | async onIntroductionUpdated() { | 313 | async onIntroductionUpdated() { |
| 301 | 314 | ||
| 302 | - if (this.content.length == 0 && this.detailModel.introduction ) { | ||
| 303 | - this.lineInNum = this.getTextLineNum(`简介:${this.detailModel.introduction}`, DisplayUtils.getDeviceWidth() - 32, 21, $r('app.float.vp_14')) | 315 | + if (this.content.length == 0 && this.detailModel.introduction) { |
| 316 | + this.lineInNum = this.getTextLineNum(`简介:${this.detailModel.introduction}`, DisplayUtils.getDeviceWidth() - 32, 21, $r('app.float.vp_14')) | ||
| 304 | if (this.lineInNum > 3) { | 317 | if (this.lineInNum > 3) { |
| 305 | this.compIntroductionTextHeights() | 318 | this.compIntroductionTextHeights() |
| 306 | this.content = this.subTxt | 319 | this.content = this.subTxt |
| 307 | } | 320 | } |
| 308 | } | 321 | } |
| 309 | - if (this.detailModel) { | ||
| 310 | - this.topFixedHeight = 308 | ||
| 311 | - if (this.detailModel.region && this.detailModel.region.length > 0) { | ||
| 312 | - this.provinceName = this.detailModel.region | ||
| 313 | - }else { | ||
| 314 | - this.provinceName = await this.computeIPRegion(this.detailModel.province) | ||
| 315 | - } | ||
| 316 | - if(this.detailModel.authId == 1 && this.detailModel.categoryAuth.length > 0) { | ||
| 317 | - this.topFixedHeight += this.getTextLineNum(this.detailModel.categoryAuth, DisplayUtils.getDeviceWidth() - 90, 22, $r('app.float.vp_12'))*22 | ||
| 318 | - } | ||
| 319 | - else if(this.detailModel.authId == 2) { | ||
| 320 | - if (this.detailModel.authTitle && this.detailModel.authTitle.length > 0 ){ | ||
| 321 | - this.topFixedHeight += this.getTextLineNum(this.detailModel.authTitle, DisplayUtils.getDeviceWidth() - 90, 22, $r('app.float.vp_12'))*22 | ||
| 322 | - } | ||
| 323 | - if (this.detailModel.authPersonal && this.detailModel.authPersonal.length > 0 ){ | ||
| 324 | - if (this.detailModel.authTitle && this.detailModel.authTitle.length > 0 ){ | ||
| 325 | - this.topFixedHeight += 10 | ||
| 326 | - } | ||
| 327 | - this.topFixedHeight += this.getTextLineNum(this.detailModel.authPersonal, DisplayUtils.getDeviceWidth() - 90, 22, $r('app.float.vp_12'))*22 | ||
| 328 | - } | ||
| 329 | - } | ||
| 330 | - this.lineInNum = this.getTextLineNum(`简介:${this.detailModel.introduction}`, DisplayUtils.getDeviceWidth() - 32, 21, $r('app.float.vp_14')) | ||
| 331 | - if (this.lineInNum <= 3) { | ||
| 332 | - this.topFixedHeight += (21 * this.lineInNum) | ||
| 333 | - this.topHeight = this.topFixedHeight | ||
| 334 | - }else { | ||
| 335 | - this.topHeight = this.topFixedHeight + (this.isCollapse ? 21*3 : 21 * this.lineInNum ) | ||
| 336 | - } | ||
| 337 | - // IP归属地 | ||
| 338 | - if (this.provinceName && this.provinceName.length > 0) { | ||
| 339 | - this.topHeight += 28 | ||
| 340 | - } | ||
| 341 | - } | 322 | + if (this.detailModel) { |
| 323 | + this.topFixedHeight = 286 | ||
| 324 | + if (this.detailModel.region && this.detailModel.region.length > 0) { | ||
| 325 | + this.provinceName = this.detailModel.region | ||
| 326 | + } else { | ||
| 327 | + this.provinceName = await this.computeIPRegion(this.detailModel.province) | ||
| 328 | + } | ||
| 329 | + if (this.detailModel.authId == 1 && this.detailModel.categoryAuth.length > 0) { | ||
| 330 | + this.topFixedHeight += this.getTextLineNum(this.detailModel.categoryAuth, DisplayUtils.getDeviceWidth() - 90, 22, $r('app.float.vp_12')) * 18 | ||
| 331 | + this.topFixedHeight += 12 | ||
| 332 | + } | ||
| 333 | + else if (this.detailModel.authId == 2) { | ||
| 334 | + if (this.detailModel.authTitle && this.detailModel.authTitle.length > 0) { | ||
| 335 | + this.topFixedHeight += this.getTextLineNum(this.detailModel.authTitle, DisplayUtils.getDeviceWidth() - 90, 22, $r('app.float.vp_12')) * 18 | ||
| 336 | + if (this.detailModel.authPersonal && this.detailModel.authPersonal.length > 0){ | ||
| 337 | + this.topFixedHeight += 8 | ||
| 338 | + }else{ | ||
| 339 | + this.topFixedHeight += 12 | ||
| 340 | + } | ||
| 341 | + } | ||
| 342 | + if (this.detailModel.authPersonal && this.detailModel.authPersonal.length > 0) { | ||
| 343 | + this.topFixedHeight += this.getTextLineNum(this.detailModel.authPersonal, DisplayUtils.getDeviceWidth() - 90, 22, $r('app.float.vp_12')) * 18 | ||
| 344 | + this.topFixedHeight += 12 | ||
| 345 | + } | ||
| 346 | + } | ||
| 347 | + this.lineInNum = this.getTextLineNum(`简介:${this.detailModel.introduction}`, DisplayUtils.getDeviceWidth() - 32, 21, $r('app.float.vp_14')) | ||
| 348 | + if (this.lineInNum <= 3) { | ||
| 349 | + this.topHeight = this.topFixedHeight + (21 * this.lineInNum) | ||
| 350 | + } else { | ||
| 351 | + this.lineInNum = this.getTextLineNum(`简介:${this.detailModel.introduction}` + '收起', DisplayUtils.getDeviceWidth() - 32, 21, $r('app.float.vp_14')) | ||
| 352 | + this.topHeight = this.topFixedHeight + (this.isCollapse ? 21 * 3 : 21 * this.lineInNum) | ||
| 353 | + } | ||
| 354 | + // IP归属地 | ||
| 355 | + if (this.provinceName && this.provinceName.length > 0) { | ||
| 356 | + this.topFixedHeight += 28 | ||
| 357 | + this.topHeight += 28 | ||
| 358 | + } | ||
| 359 | + } | ||
| 342 | } | 360 | } |
| 343 | 361 | ||
| 344 | - private computeShowNum(count: number) { | ||
| 345 | - if(count >= 10000) { | ||
| 346 | - return `${(count/10000).toFixed(1)}万` | 362 | + private computeShowNum(count: number) { |
| 363 | + if (count >= 10000) { | ||
| 364 | + return `${(count / 10000).toFixed(1)}万` | ||
| 347 | } | 365 | } |
| 348 | return `${count}` | 366 | return `${count}` |
| 349 | } | 367 | } |
| @@ -352,7 +370,7 @@ export struct PeopleShipHomePageTopComponent { | @@ -352,7 +370,7 @@ export struct PeopleShipHomePageTopComponent { | ||
| 352 | private async computeIPRegion(province: string) { | 370 | private async computeIPRegion(province: string) { |
| 353 | if (province && province.length) { | 371 | if (province && province.length) { |
| 354 | try { | 372 | try { |
| 355 | - let provinceName = await HWLocationUtils.getProvinceName(province) ; | 373 | + let provinceName = await HWLocationUtils.getProvinceName(province); |
| 356 | return provinceName | 374 | return provinceName |
| 357 | } catch (e) { | 375 | } catch (e) { |
| 358 | return '' | 376 | return '' |
| @@ -360,5 +378,4 @@ export struct PeopleShipHomePageTopComponent { | @@ -360,5 +378,4 @@ export struct PeopleShipHomePageTopComponent { | ||
| 360 | } | 378 | } |
| 361 | return '' | 379 | return '' |
| 362 | } | 380 | } |
| 363 | - | ||
| 364 | } | 381 | } |
| 1 | +import { RefreshLayoutBean } from '../refresh/RefreshLayoutBean'; | ||
| 2 | +import RefreshLoadLayout from '../refresh/RefreshLoadLayout'; | ||
| 3 | + | ||
| 4 | +/** | ||
| 5 | + * The refresh layout component. | ||
| 6 | + */ | ||
| 7 | +@Component | ||
| 8 | +export default struct RefreshLayout { | ||
| 9 | + @ObjectLink refreshBean: RefreshLayoutBean; | ||
| 10 | + | ||
| 11 | + build() { | ||
| 12 | + Column() { | ||
| 13 | + if (this.refreshBean.isVisible) { | ||
| 14 | + RefreshLoadLayout({ | ||
| 15 | + refreshBean: new RefreshLayoutBean(this.refreshBean.isVisible, this.refreshBean.loadStatus, this.refreshBean.offset) | ||
| 16 | + }) | ||
| 17 | + } | ||
| 18 | + } | ||
| 19 | + } | ||
| 20 | +} |
| 1 | +/** | ||
| 2 | + * 下拉刷新数据bean. | ||
| 3 | + */ | ||
| 4 | +@Observed | ||
| 5 | +export class RefreshLayoutBean { | ||
| 6 | + /** | ||
| 7 | + * Custom refresh load layout isVisible. | ||
| 8 | + */ | ||
| 9 | + isVisible: boolean; | ||
| 10 | + loadStatus: number; // 1-下拉刷新 2-松开刷新 3-刷新完成 | ||
| 11 | + | ||
| 12 | + offset: number; | ||
| 13 | + | ||
| 14 | + constructor(isVisible: boolean, loadStatus: LoadStatus, offset: number) { | ||
| 15 | + this.isVisible = isVisible; | ||
| 16 | + this.loadStatus = loadStatus; | ||
| 17 | + this.offset = offset; | ||
| 18 | + } | ||
| 19 | +} | ||
| 20 | + | ||
| 21 | +export const enum LoadStatus { | ||
| 22 | + /** | ||
| 23 | + * 触发刷新前,有下拉动作了 | ||
| 24 | + */ | ||
| 25 | + IDLE, | ||
| 26 | + /** | ||
| 27 | + * 触发刷新前,有下拉动作了 | ||
| 28 | + */ | ||
| 29 | + PRELOAD, | ||
| 30 | + /** | ||
| 31 | + * 刷新中 | ||
| 32 | + */ | ||
| 33 | + LOADING, | ||
| 34 | + /** | ||
| 35 | + * 触发刷新结束,展示‘已更新最新’ | ||
| 36 | + */ | ||
| 37 | + LOADED, | ||
| 38 | +} |
| 1 | +import lottie, { AnimationItem } from '@ohos/lottie'; | ||
| 2 | +import { LoadStatus, RefreshLayoutBean } from './RefreshLayoutBean'; | ||
| 3 | + | ||
| 4 | +/** | ||
| 5 | + * Custom layout to show refresh or load. | ||
| 6 | + * TODO 待优化 | ||
| 7 | + */ | ||
| 8 | +@Component | ||
| 9 | +export default struct CustomLayout { | ||
| 10 | + // 设置刷新view高度 | ||
| 11 | + static readonly REFRESH_HEIGHT: number = 90; | ||
| 12 | + @ObjectLink @Watch('onOffsetChange') refreshBean: RefreshLayoutBean; | ||
| 13 | + private mainRenderingSettings: RenderingContextSettings = new RenderingContextSettings(true) | ||
| 14 | + private mainCanvasRenderingContext: CanvasRenderingContext2D = new CanvasRenderingContext2D(this.mainRenderingSettings) | ||
| 15 | + private mainRenderingSettings2: RenderingContextSettings = new RenderingContextSettings(true) | ||
| 16 | + private mainCanvasRenderingContext2: CanvasRenderingContext2D = new CanvasRenderingContext2D(this.mainRenderingSettings2) | ||
| 17 | + private animateItem: AnimationItem | null = null; | ||
| 18 | + private animateItem2: AnimationItem | null = null; | ||
| 19 | + private animateName: string = "refresh"; | ||
| 20 | + private animateName2: string = "refreshing"; | ||
| 21 | + @State private layoutHeight: number = 0; | ||
| 22 | + | ||
| 23 | + build() { | ||
| 24 | + Stack({ alignContent: Alignment.Center }) { | ||
| 25 | + Canvas(this.mainCanvasRenderingContext) | ||
| 26 | + .width(60) | ||
| 27 | + .height(60) | ||
| 28 | + .backgroundColor(Color.Transparent) | ||
| 29 | + .onReady(() => { | ||
| 30 | + // 可在此生命回调周期中加载动画,可以保证动画尺寸正确 | ||
| 31 | + //抗锯齿的设置 | ||
| 32 | + this.mainCanvasRenderingContext.imageSmoothingEnabled = true; | ||
| 33 | + this.mainCanvasRenderingContext.imageSmoothingQuality = 'medium' | ||
| 34 | + }) | ||
| 35 | + .onDisAppear(() => { | ||
| 36 | + lottie.destroy(this.animateName); | ||
| 37 | + }) | ||
| 38 | + .visibility(this.refreshBean.loadStatus === LoadStatus.PRELOAD ? Visibility.Visible : Visibility.Hidden) | ||
| 39 | + | ||
| 40 | + Canvas(this.mainCanvasRenderingContext2) | ||
| 41 | + .width(60) | ||
| 42 | + .height(60) | ||
| 43 | + .backgroundColor(Color.Transparent) | ||
| 44 | + .onReady(() => { | ||
| 45 | + // 可在此生命回调周期中加载动画,可以保证动画尺寸正确 | ||
| 46 | + //抗锯齿的设置 | ||
| 47 | + this.mainCanvasRenderingContext2.imageSmoothingEnabled = true; | ||
| 48 | + this.mainCanvasRenderingContext2.imageSmoothingQuality = 'medium' | ||
| 49 | + }) | ||
| 50 | + .onDisAppear(() => { | ||
| 51 | + lottie.destroy(this.animateName2); | ||
| 52 | + }) | ||
| 53 | + .visibility(this.refreshBean.loadStatus === LoadStatus.LOADING ? Visibility.Visible : Visibility.Hidden) | ||
| 54 | + | ||
| 55 | + Text('已更新至最新') | ||
| 56 | + .fontSize(17) | ||
| 57 | + .textAlign(TextAlign.Center) | ||
| 58 | + .fontColor('#bbbbbb') | ||
| 59 | + .visibility(this.refreshBean.loadStatus != LoadStatus.LOADED ? Visibility.Hidden : Visibility.Visible) | ||
| 60 | + | ||
| 61 | + } | ||
| 62 | + .clip(true) | ||
| 63 | + .width('100%') | ||
| 64 | + .height(this.layoutHeight) | ||
| 65 | + } | ||
| 66 | + | ||
| 67 | + animate1(offset: number) { | ||
| 68 | + if (this.animateItem == null) { | ||
| 69 | + this.animateItem = lottie.loadAnimation({ | ||
| 70 | + container: this.mainCanvasRenderingContext, | ||
| 71 | + renderer: 'canvas', // canvas 渲染模式 | ||
| 72 | + loop: 1, | ||
| 73 | + autoplay: true, | ||
| 74 | + name: this.animateName, | ||
| 75 | + path: "lottie/refresh_step1.json", // 路径加载动画只支持entry/src/main/ets 文件夹下的相对路径 | ||
| 76 | + }) | ||
| 77 | + } | ||
| 78 | + this.animateItem.goToAndStop(1) | ||
| 79 | + let total = CustomLayout.REFRESH_HEIGHT | ||
| 80 | + let progress = offset * 100 / total | ||
| 81 | + this.animateItem?.goToAndStop(this.getFramesByProgress(progress), true); | ||
| 82 | + } | ||
| 83 | + | ||
| 84 | + animate2() { | ||
| 85 | + if (this.animateItem2 == null) { | ||
| 86 | + this.animateItem2 = lottie.loadAnimation({ | ||
| 87 | + container: this.mainCanvasRenderingContext2, | ||
| 88 | + renderer: 'canvas', // canvas 渲染模式 | ||
| 89 | + loop: 10, | ||
| 90 | + autoplay: true, | ||
| 91 | + name: this.animateName2, | ||
| 92 | + path: "lottie/refresh_step2.json", // 路径加载动画只支持entry/src/main/ets 文件夹下的相对路径 | ||
| 93 | + }) | ||
| 94 | + } | ||
| 95 | + // this.animateItem2.isLoaded | ||
| 96 | + // TODO 是否拦截重复触发 | ||
| 97 | + this.animateItem2.goToAndPlay(1) | ||
| 98 | + } | ||
| 99 | + | ||
| 100 | + getFramesByProgress(progress: number): number { | ||
| 101 | + if (this.animateItem == null) { | ||
| 102 | + return 1; | ||
| 103 | + } | ||
| 104 | + let progressTmp = progress | ||
| 105 | + let total = this.animateItem.totalFrames; | ||
| 106 | + let frame = Math.floor(total * progressTmp / 100); | ||
| 107 | + if (frame >= total - 1) { | ||
| 108 | + frame = total - 1 | ||
| 109 | + } | ||
| 110 | + return frame; | ||
| 111 | + } | ||
| 112 | + | ||
| 113 | + onOffsetChange() { | ||
| 114 | + if (!this.refreshBean.isVisible) { | ||
| 115 | + return | ||
| 116 | + } | ||
| 117 | + if (this.refreshBean.loadStatus === LoadStatus.PRELOAD) { | ||
| 118 | + // 下拉刷新 | ||
| 119 | + this.animate1(this.refreshBean.offset) | ||
| 120 | + } else if (this.refreshBean.loadStatus == LoadStatus.LOADING) { | ||
| 121 | + // 正在刷新 | ||
| 122 | + this.animate2() | ||
| 123 | + } else { | ||
| 124 | + // 刷新完成 | ||
| 125 | + lottie.destroy() | ||
| 126 | + } | ||
| 127 | + let maxH = CustomLayout.REFRESH_HEIGHT | ||
| 128 | + let tmpHeight = this.refreshBean.offset > maxH ? maxH : this.refreshBean.offset | ||
| 129 | + if (this.refreshBean.loadStatus === LoadStatus.LOADED) { | ||
| 130 | + if (tmpHeight <= 0) { | ||
| 131 | + setTimeout(() => { | ||
| 132 | + // 延时设置0,让“已更新到最新”展示 | ||
| 133 | + this.layoutHeight = 0 | ||
| 134 | + }, 1500) | ||
| 135 | + } | ||
| 136 | + } else { | ||
| 137 | + // 直接设置高度 | ||
| 138 | + this.layoutHeight = tmpHeight | ||
| 139 | + } | ||
| 140 | + } | ||
| 141 | +} |
| @@ -11,7 +11,7 @@ export struct SearchCreatorComponent{ | @@ -11,7 +11,7 @@ export struct SearchCreatorComponent{ | ||
| 11 | Stack({alignContent: Alignment.Bottom}){ | 11 | Stack({alignContent: Alignment.Bottom}){ |
| 12 | Image(this.item.headerPhotoUrl) | 12 | Image(this.item.headerPhotoUrl) |
| 13 | .width('92lpx') | 13 | .width('92lpx') |
| 14 | - .alt($r('app.media.default_head')) | 14 | + .alt($r('app.media.icon_default_head_mater')) |
| 15 | .height('92lpx') | 15 | .height('92lpx') |
| 16 | .margin({bottom:'15lpx'}) | 16 | .margin({bottom:'15lpx'}) |
| 17 | .borderRadius(50) | 17 | .borderRadius(50) |
| @@ -194,7 +194,8 @@ export struct SearchResultContentComponent{ | @@ -194,7 +194,8 @@ export struct SearchResultContentComponent{ | ||
| 194 | isSearch: true, | 194 | isSearch: true, |
| 195 | publishTimestamp:"", | 195 | publishTimestamp:"", |
| 196 | bottomNavId:'', | 196 | bottomNavId:'', |
| 197 | - openType:'' | 197 | + openType:'', |
| 198 | + extra:'' | ||
| 198 | } | 199 | } |
| 199 | 200 | ||
| 200 | this.data.push(contentDTO) | 201 | this.data.push(contentDTO) |
| @@ -81,9 +81,9 @@ export struct AccountAndSecurityLayout { | @@ -81,9 +81,9 @@ export struct AccountAndSecurityLayout { | ||
| 81 | 81 | ||
| 82 | // 收到eventId为1的事件后执行该回调 | 82 | // 收到eventId为1的事件后执行该回调 |
| 83 | let callback = (eventData: emitter.EventData): void => { | 83 | let callback = (eventData: emitter.EventData): void => { |
| 84 | - promptAction.showToast({ | ||
| 85 | - message: JSON.stringify(eventData) | ||
| 86 | - }); | 84 | + // promptAction.showToast({ |
| 85 | + // message: JSON.stringify(eventData) | ||
| 86 | + // }); | ||
| 87 | if(eventData&&eventData.data){ | 87 | if(eventData&&eventData.data){ |
| 88 | this.listData[0].subTitle = eventData.data['content'] | 88 | this.listData[0].subTitle = eventData.data['content'] |
| 89 | } | 89 | } |
| @@ -3,7 +3,7 @@ import { EmptyComponent } from '../view/EmptyComponent' | @@ -3,7 +3,7 @@ import { EmptyComponent } from '../view/EmptyComponent' | ||
| 3 | @Entry | 3 | @Entry |
| 4 | @Component | 4 | @Component |
| 5 | export struct DefaultPage { | 5 | export struct DefaultPage { |
| 6 | - @State type: number = 1 | 6 | + @State type: number = 15 |
| 7 | 7 | ||
| 8 | retry() { | 8 | retry() { |
| 9 | console.log('daj点击了重试') | 9 | console.log('daj点击了重试') |
| @@ -13,7 +13,6 @@ export struct DefaultPage { | @@ -13,7 +13,6 @@ export struct DefaultPage { | ||
| 13 | Row() { | 13 | Row() { |
| 14 | EmptyComponent({ | 14 | EmptyComponent({ |
| 15 | emptyType: this.type, | 15 | emptyType: this.type, |
| 16 | - emptyButton: true, | ||
| 17 | retry: () => { | 16 | retry: () => { |
| 18 | this.retry() | 17 | this.retry() |
| 19 | } | 18 | } |
| @@ -231,11 +231,11 @@ export struct EmptyComponent { | @@ -231,11 +231,11 @@ export struct EmptyComponent { | ||
| 231 | } else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoSearchResult) { | 231 | } else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoSearchResult) { |
| 232 | imageString = $r('app.media.icon_no_result') | 232 | imageString = $r('app.media.icon_no_result') |
| 233 | } else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoNetwork) { | 233 | } else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoNetwork) { |
| 234 | - imageString = $r('app.media.icon_no_net') | 234 | + imageString = $r('app.media.icon_no_net1') |
| 235 | } else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_ContentFailed) { | 235 | } else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_ContentFailed) { |
| 236 | imageString = $r('app.media.icon_no_content') | 236 | imageString = $r('app.media.icon_no_content') |
| 237 | } else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoCreation) { | 237 | } else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoCreation) { |
| 238 | - imageString = $r('app.media.icon_no_appointmentMade') | 238 | + imageString = $r('app.media.icon_no_works1') |
| 239 | } else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoBooking) { | 239 | } else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoBooking) { |
| 240 | imageString = $r('app.media.icon_no_appointmentMade') | 240 | imageString = $r('app.media.icon_no_appointmentMade') |
| 241 | } else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NetworkFailed) { | 241 | } else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NetworkFailed) { |
| @@ -9,17 +9,18 @@ export struct MergeRecordDialog { | @@ -9,17 +9,18 @@ export struct MergeRecordDialog { | ||
| 9 | build() { | 9 | build() { |
| 10 | Column() { | 10 | Column() { |
| 11 | Text("合并游客记录到当前账号,可避免信息丢失") | 11 | Text("合并游客记录到当前账号,可避免信息丢失") |
| 12 | - .fontColor("#222222") | 12 | + .fontColor("#333333") |
| 13 | .fontSize(18) | 13 | .fontSize(18) |
| 14 | .width("100%") | 14 | .width("100%") |
| 15 | .fontWeight(FontWeight.Bold) | 15 | .fontWeight(FontWeight.Bold) |
| 16 | .textAlign(TextAlign.Center) | 16 | .textAlign(TextAlign.Center) |
| 17 | - .margin({ top: 20 }) | 17 | + .margin({ top: 25 }) |
| 18 | + .padding({left:24,right:24}) | ||
| 18 | 19 | ||
| 19 | - Divider().color("#999999").width("100%").margin({ top: 20 }).height('1vp') | 20 | + Divider().color("#08000000").width("100%").margin({ top: 20 }).height('2vp') |
| 20 | Row() { | 21 | Row() { |
| 21 | Text('取消') | 22 | Text('取消') |
| 22 | - .fontSize(16) | 23 | + .fontSize(18) |
| 23 | .fontColor("#648DF2") | 24 | .fontColor("#648DF2") |
| 24 | .layoutWeight(1) | 25 | .layoutWeight(1) |
| 25 | .fontWeight(FontWeight.Medium) | 26 | .fontWeight(FontWeight.Medium) |
| @@ -31,28 +32,22 @@ export struct MergeRecordDialog { | @@ -31,28 +32,22 @@ export struct MergeRecordDialog { | ||
| 31 | } | 32 | } |
| 32 | 33 | ||
| 33 | }) | 34 | }) |
| 34 | - .height('100%') | ||
| 35 | - // Divider().color("#999999").height('100%').width('0.5vp') | 35 | + .height(50) |
| 36 | + Divider().color("#eeeeee").height(44).width(1).margin({top:3}).strokeWidth(1).vertical(true) | ||
| 36 | Text('一键合并') | 37 | Text('一键合并') |
| 37 | - .fontSize(16) | 38 | + .fontSize(18) |
| 38 | .fontColor("#648DF2") | 39 | .fontColor("#648DF2") |
| 39 | .layoutWeight(1) | 40 | .layoutWeight(1) |
| 40 | .fontWeight(FontWeight.Medium) | 41 | .fontWeight(FontWeight.Medium) |
| 41 | .textAlign(TextAlign.Center) | 42 | .textAlign(TextAlign.Center) |
| 42 | - .border({ | ||
| 43 | - width: { left: 1 }, | ||
| 44 | - color: "#999999", | ||
| 45 | - style: { left: BorderStyle.Solid } | ||
| 46 | - | ||
| 47 | - }) | ||
| 48 | .onClick(() => { | 43 | .onClick(() => { |
| 49 | this.controller.close() | 44 | this.controller.close() |
| 50 | if (this.confirm) { | 45 | if (this.confirm) { |
| 51 | this.confirm() | 46 | this.confirm() |
| 52 | } | 47 | } |
| 53 | }) | 48 | }) |
| 54 | - .height('100%') | 49 | + .height(50) |
| 55 | }.layoutWeight(1).justifyContent(FlexAlign.Center) | 50 | }.layoutWeight(1).justifyContent(FlexAlign.Center) |
| 56 | - }.height(140).backgroundColor(Color.White).borderRadius(10).width('74%') | 51 | + }.height(140).backgroundColor(Color.White).borderRadius(14).width('75%') |
| 57 | } | 52 | } |
| 58 | } | 53 | } |
| @@ -4,16 +4,18 @@ import { router } from '@kit.ArkUI'; | @@ -4,16 +4,18 @@ import { router } from '@kit.ArkUI'; | ||
| 4 | @Component | 4 | @Component |
| 5 | struct ShowUserHeaderPage { | 5 | struct ShowUserHeaderPage { |
| 6 | @State headPhotoUrl: string = ''; | 6 | @State headPhotoUrl: string = ''; |
| 7 | + @State headType: string = '' | ||
| 7 | @State params:Record<string, string> = router.getParams() as Record<string, string>; | 8 | @State params:Record<string, string> = router.getParams() as Record<string, string>; |
| 8 | 9 | ||
| 9 | onPageShow() { | 10 | onPageShow() { |
| 10 | this.headPhotoUrl = this.params?.['headPhotoUrl']; | 11 | this.headPhotoUrl = this.params?.['headPhotoUrl']; |
| 12 | + this.headType = this.params?.['headType'] ?? ''; | ||
| 11 | } | 13 | } |
| 12 | 14 | ||
| 13 | build() { | 15 | build() { |
| 14 | Row() { | 16 | Row() { |
| 15 | Image(this.headPhotoUrl) | 17 | Image(this.headPhotoUrl) |
| 16 | - .alt($r('app.media.default_head')) | 18 | + .alt(this.headType.length > 0 ? $r('app.media.WDAccountOwnerHedaerDefaultIcon') : $r('app.media.default_head')) |
| 17 | .width('720lpx') | 19 | .width('720lpx') |
| 18 | .height('720lpx') | 20 | .height('720lpx') |
| 19 | .objectFit(ImageFit.Auto) | 21 | .objectFit(ImageFit.Auto) |
| @@ -22,7 +22,7 @@ import { | @@ -22,7 +22,7 @@ import { | ||
| 22 | postExecuteLikeParams, | 22 | postExecuteLikeParams, |
| 23 | postInteractAccentionOperateParams, | 23 | postInteractAccentionOperateParams, |
| 24 | postRecommendListParams, | 24 | postRecommendListParams, |
| 25 | - postThemeListParams | 25 | + GoldenPositionExtraBean |
| 26 | } from 'wdBean'; | 26 | } from 'wdBean'; |
| 27 | import { PageUIReqBean } from '../components/page/bean/PageUIReqBean'; | 27 | import { PageUIReqBean } from '../components/page/bean/PageUIReqBean'; |
| 28 | 28 | ||
| @@ -437,7 +437,7 @@ export class PageRepository { | @@ -437,7 +437,7 @@ export class PageRepository { | ||
| 437 | * @param params | 437 | * @param params |
| 438 | * @returns | 438 | * @returns |
| 439 | * */ | 439 | * */ |
| 440 | - static postThemeList(params: postThemeListParams) { | 440 | + static postThemeList(params: GoldenPositionExtraBean) { |
| 441 | let url = HttpUrlUtils.getThemeListUrl() | 441 | let url = HttpUrlUtils.getThemeListUrl() |
| 442 | Logger.info(TAG, "postThemeList url = " + url + JSON.stringify(params)) | 442 | Logger.info(TAG, "postThemeList url = " + url + JSON.stringify(params)) |
| 443 | return WDHttp.post<ResponseDTO<LiveReviewDTO>>(url, params) | 443 | return WDHttp.post<ResponseDTO<LiveReviewDTO>>(url, params) |
| @@ -3,6 +3,7 @@ import { touchMoveLoadMore, touchUpLoadMore } from './PullUpLoadMore'; | @@ -3,6 +3,7 @@ import { touchMoveLoadMore, touchUpLoadMore } from './PullUpLoadMore'; | ||
| 3 | import PageModel from '../viewmodel/PageModel'; | 3 | import PageModel from '../viewmodel/PageModel'; |
| 4 | import PageHelper from '../viewmodel/PageHelper'; | 4 | import PageHelper from '../viewmodel/PageHelper'; |
| 5 | import PageAdModel from '../viewmodel/PageAdvModel'; | 5 | import PageAdModel from '../viewmodel/PageAdvModel'; |
| 6 | +import { LoadStatus } from '../components/refresh/RefreshLayoutBean'; | ||
| 6 | 7 | ||
| 7 | export function listTouchEvent(pageModel: PageModel, pageAdvModel: PageAdModel, event: TouchEvent) { | 8 | export function listTouchEvent(pageModel: PageModel, pageAdvModel: PageAdModel, event: TouchEvent) { |
| 8 | switch (event.type) { | 9 | switch (event.type) { |
| @@ -46,7 +47,7 @@ export function listTouchEvent(pageModel: PageModel, pageAdvModel: PageAdModel, | @@ -46,7 +47,7 @@ export function listTouchEvent(pageModel: PageModel, pageAdvModel: PageAdModel, | ||
| 46 | export function touchMovePullRefresh(pageModel: PageModel, event: TouchEvent) { | 47 | export function touchMovePullRefresh(pageModel: PageModel, event: TouchEvent) { |
| 47 | if (pageModel.startIndex === 0) { | 48 | if (pageModel.startIndex === 0) { |
| 48 | pageModel.isPullRefreshOperation = true; | 49 | pageModel.isPullRefreshOperation = true; |
| 49 | - let height = vp2px(pageModel.pullDownRefreshHeight); | 50 | + let height = vp2px(Const.CUSTOM_REFRESH_DECIDE_HEIGHT); |
| 50 | pageModel.offsetY = event.touches[0].y - pageModel.downY; | 51 | pageModel.offsetY = event.touches[0].y - pageModel.downY; |
| 51 | // The sliding offset is greater than the pull-down refresh layout height, and the refresh condition is met. | 52 | // The sliding offset is greater than the pull-down refresh layout height, and the refresh condition is met. |
| 52 | if (pageModel.offsetY >= height) { | 53 | if (pageModel.offsetY >= height) { |
| @@ -98,12 +99,14 @@ export function pullRefreshState(pageModel: PageModel, state: number) { | @@ -98,12 +99,14 @@ export function pullRefreshState(pageModel: PageModel, state: number) { | ||
| 98 | pageModel.isCanRefresh = false; | 99 | pageModel.isCanRefresh = false; |
| 99 | pageModel.isRefreshing = false; | 100 | pageModel.isRefreshing = false; |
| 100 | pageModel.isVisiblePullDown = true; | 101 | pageModel.isVisiblePullDown = true; |
| 102 | + pageModel.load = LoadStatus.PRELOAD | ||
| 101 | break; | 103 | break; |
| 102 | case RefreshState.Release: | 104 | case RefreshState.Release: |
| 103 | pageModel.pullDownRefreshText = $r('app.string.release_refresh_text'); | 105 | pageModel.pullDownRefreshText = $r('app.string.release_refresh_text'); |
| 104 | pageModel.pullDownRefreshImage = $r('app.media.ic_pull_up_refresh'); | 106 | pageModel.pullDownRefreshImage = $r('app.media.ic_pull_up_refresh'); |
| 105 | pageModel.isCanRefresh = true; | 107 | pageModel.isCanRefresh = true; |
| 106 | pageModel.isRefreshing = false; | 108 | pageModel.isRefreshing = false; |
| 109 | + pageModel.load = LoadStatus.PRELOAD | ||
| 107 | break; | 110 | break; |
| 108 | case RefreshState.Refreshing: | 111 | case RefreshState.Refreshing: |
| 109 | pageModel.offsetY = vp2px(pageModel.pullDownRefreshHeight); | 112 | pageModel.offsetY = vp2px(pageModel.pullDownRefreshHeight); |
| @@ -111,18 +114,21 @@ export function pullRefreshState(pageModel: PageModel, state: number) { | @@ -111,18 +114,21 @@ export function pullRefreshState(pageModel: PageModel, state: number) { | ||
| 111 | pageModel.pullDownRefreshImage = $r('app.media.ic_pull_up_load'); | 114 | pageModel.pullDownRefreshImage = $r('app.media.ic_pull_up_load'); |
| 112 | pageModel.isCanRefresh = true; | 115 | pageModel.isCanRefresh = true; |
| 113 | pageModel.isRefreshing = true; | 116 | pageModel.isRefreshing = true; |
| 117 | + pageModel.load = LoadStatus.LOADING | ||
| 114 | break; | 118 | break; |
| 115 | case RefreshState.Success: | 119 | case RefreshState.Success: |
| 116 | pageModel.pullDownRefreshText = $r('app.string.refresh_success_text'); | 120 | pageModel.pullDownRefreshText = $r('app.string.refresh_success_text'); |
| 117 | pageModel.pullDownRefreshImage = $r('app.media.ic_succeed_refresh'); | 121 | pageModel.pullDownRefreshImage = $r('app.media.ic_succeed_refresh'); |
| 118 | pageModel.isCanRefresh = true; | 122 | pageModel.isCanRefresh = true; |
| 119 | pageModel.isRefreshing = true; | 123 | pageModel.isRefreshing = true; |
| 124 | + pageModel.load = LoadStatus.LOADED | ||
| 120 | break; | 125 | break; |
| 121 | case RefreshState.Fail: | 126 | case RefreshState.Fail: |
| 122 | pageModel.pullDownRefreshText = $r('app.string.refresh_fail_text'); | 127 | pageModel.pullDownRefreshText = $r('app.string.refresh_fail_text'); |
| 123 | pageModel.pullDownRefreshImage = $r('app.media.ic_fail_refresh'); | 128 | pageModel.pullDownRefreshImage = $r('app.media.ic_fail_refresh'); |
| 124 | pageModel.isCanRefresh = true; | 129 | pageModel.isCanRefresh = true; |
| 125 | pageModel.isRefreshing = true; | 130 | pageModel.isRefreshing = true; |
| 131 | + pageModel.load = LoadStatus.LOADED | ||
| 126 | break; | 132 | break; |
| 127 | default: | 133 | default: |
| 128 | break; | 134 | break; |
| @@ -36,6 +36,10 @@ export class RefreshConstants { | @@ -36,6 +36,10 @@ export class RefreshConstants { | ||
| 36 | */ | 36 | */ |
| 37 | static readonly CUSTOM_LAYOUT_HEIGHT: number = 80; | 37 | static readonly CUSTOM_LAYOUT_HEIGHT: number = 80; |
| 38 | /** | 38 | /** |
| 39 | + * 下拉刷新,判定距离 | ||
| 40 | + */ | ||
| 41 | + static readonly CUSTOM_REFRESH_DECIDE_HEIGHT: number = 20; | ||
| 42 | + /** | ||
| 39 | * Full the width. | 43 | * Full the width. |
| 40 | */ | 44 | */ |
| 41 | static readonly FULL_WIDTH: string = '100%'; | 45 | static readonly FULL_WIDTH: string = '100%'; |
| @@ -116,7 +116,6 @@ export class PageHelper { | @@ -116,7 +116,6 @@ export class PageHelper { | ||
| 116 | //移除音频 和 活动 | 116 | //移除音频 和 活动 |
| 117 | this.collectPageComp(pageModel, pageDto) | 117 | this.collectPageComp(pageModel, pageDto) |
| 118 | 118 | ||
| 119 | - | ||
| 120 | // pageModel.compList.push(...pageDto.compList) | 119 | // pageModel.compList.push(...pageDto.compList) |
| 121 | 120 | ||
| 122 | // TODO 暂时去掉互动数据,待优化。(主要是互动数据返回,如何渲染到ui上) | 121 | // TODO 暂时去掉互动数据,待优化。(主要是互动数据返回,如何渲染到ui上) |
| @@ -161,10 +160,8 @@ export class PageHelper { | @@ -161,10 +160,8 @@ export class PageHelper { | ||
| 161 | flag = false | 160 | flag = false |
| 162 | } | 161 | } |
| 163 | 162 | ||
| 164 | - | ||
| 165 | let pageCompSize = pageCompList.length // 信息流组件业务数量 | 163 | let pageCompSize = pageCompList.length // 信息流组件业务数量 |
| 166 | - console.error("ZZZXXXXX", " start--->" + pageCompSize); | ||
| 167 | - | 164 | + // console.error("ZZZXXXXX", " start--->" + pageCompSize); |
| 168 | if (pageCompSize == 0) { | 165 | if (pageCompSize == 0) { |
| 169 | flag = false | 166 | flag = false |
| 170 | } | 167 | } |
| @@ -174,7 +171,7 @@ export class PageHelper { | @@ -174,7 +171,7 @@ export class PageHelper { | ||
| 174 | let layoutAdvIndex = 0; //稿件投放统计 | 171 | let layoutAdvIndex = 0; //稿件投放统计 |
| 175 | // 升序排序 | 172 | // 升序排序 |
| 176 | compAdvList.sort((a: CompAdvBean, b: CompAdvBean) => a.slotInfo.position - b.slotInfo.position) | 173 | compAdvList.sort((a: CompAdvBean, b: CompAdvBean) => a.slotInfo.position - b.slotInfo.position) |
| 177 | - // console.error("ZZZXXXXX", " 排序后的广告--->" + JSON.stringify(compAdvList)); | 174 | + // console.error("ZZZXXXXX", " 排序后的广告--->" + JSON.stringify(compAdvList)); |
| 178 | //当前日期 | 175 | //当前日期 |
| 179 | let serverTimeLong: number = DateTimeUtils.getTimeStamp(); | 176 | let serverTimeLong: number = DateTimeUtils.getTimeStamp(); |
| 180 | for (let advBean of compAdvList) { | 177 | for (let advBean of compAdvList) { |
| @@ -227,7 +224,7 @@ export class PageHelper { | @@ -227,7 +224,7 @@ export class PageHelper { | ||
| 227 | let changeContentDTO = (matInfo: CompAdvMatInfoBean) => { | 224 | let changeContentDTO = (matInfo: CompAdvMatInfoBean) => { |
| 228 | let advContentBean: ContentDTO = {} as ContentDTO; | 225 | let advContentBean: ContentDTO = {} as ContentDTO; |
| 229 | advContentBean.newsTitle = matInfo.advTitle | 226 | advContentBean.newsTitle = matInfo.advTitle |
| 230 | - advContentBean.objectType = matInfo.advType == "0" ? matInfo.advType : "4" | 227 | + advContentBean.objectType = matInfo.advType == "0" ? matInfo.advType.toString() : "4" |
| 231 | advContentBean.coverUrl = matInfo.matImageUrl[0] | 228 | advContentBean.coverUrl = matInfo.matImageUrl[0] |
| 232 | advContentBean.linkUrl = matInfo.linkUrl | 229 | advContentBean.linkUrl = matInfo.linkUrl |
| 233 | advContentBean.openType = matInfo.linkType | 230 | advContentBean.openType = matInfo.linkType |
| @@ -263,7 +260,7 @@ export class PageHelper { | @@ -263,7 +260,7 @@ export class PageHelper { | ||
| 263 | if (advPosition <= pageModel.pageTotalCompSize && advPosition >= a) { | 260 | if (advPosition <= pageModel.pageTotalCompSize && advPosition >= a) { |
| 264 | 261 | ||
| 265 | let b = advPosition - a; | 262 | let b = advPosition - a; |
| 266 | - console.error('ZZZXXXXX', matInfo.advSubType + '-------------' + matInfo.advTitle + " "+ advPosition + " "+a+" "+b) | 263 | + // console.error('ZZZXXXXX', matInfo.advSubType + '-------------' + matInfo.advTitle + " " + advPosition + " " + a + " " + b) |
| 267 | if (b <= pageCompSize && b >= 0) { | 264 | if (b <= pageCompSize && b >= 0) { |
| 268 | 265 | ||
| 269 | let advComp: CompDTO = { | 266 | let advComp: CompDTO = { |
| @@ -281,15 +278,13 @@ export class PageHelper { | @@ -281,15 +278,13 @@ export class PageHelper { | ||
| 281 | 278 | ||
| 282 | } | 279 | } |
| 283 | } | 280 | } |
| 284 | - | ||
| 285 | } | 281 | } |
| 286 | } | 282 | } |
| 287 | } | 283 | } |
| 288 | - | ||
| 289 | } | 284 | } |
| 290 | 285 | ||
| 291 | } | 286 | } |
| 292 | - console.error("ZZZXXXXX", " end--->" + pageCompList.length); | 287 | + // console.error("ZZZXXXXX", " end--->" + pageCompList.length); |
| 293 | } | 288 | } |
| 294 | 289 | ||
| 295 | 290 | ||
| @@ -310,13 +305,14 @@ export class PageHelper { | @@ -310,13 +305,14 @@ export class PageHelper { | ||
| 310 | 305 | ||
| 311 | //移除音频 和 活动 | 306 | //移除音频 和 活动 |
| 312 | this.collectPageComp(pageModel, data) | 307 | this.collectPageComp(pageModel, data) |
| 313 | - // | 308 | + |
| 314 | // pageModel.compList.push(...data.compList) | 309 | // pageModel.compList.push(...data.compList) |
| 315 | - PageViewModel.getInteractData(data.compList).then((data: CompDTO[]) => { | ||
| 316 | - // 刷新,替换所有数据 | ||
| 317 | - pageModel.compList.updateItems(sizeBefore, data) | ||
| 318 | - pageModel.timestamp = DateTimeUtils.getTimeStamp().toString() | ||
| 319 | - }) | 310 | + // TODO 暂时屏蔽,此处代码会造成 广告逻辑错乱,只有第一页有广告数据,随着加载更多,第二页也会出现广告数据 |
| 311 | + // PageViewModel.getInteractData(data.compList).then((data: CompDTO[]) => { | ||
| 312 | + // // 刷新,替换所有数据 | ||
| 313 | + // pageModel.compList.updateItems(sizeBefore, data) | ||
| 314 | + // pageModel.timestamp = DateTimeUtils.getTimeStamp().toString() | ||
| 315 | + // }) | ||
| 320 | } | 316 | } |
| 321 | }).catch((err: string | Resource) => { | 317 | }).catch((err: string | Resource) => { |
| 322 | promptAction.showToast({ message: err }); | 318 | promptAction.showToast({ message: err }); |
| @@ -339,15 +335,21 @@ export class PageHelper { | @@ -339,15 +335,21 @@ export class PageHelper { | ||
| 339 | if (contentInfo && (contentInfo.objectType === '13' || contentInfo.objectType === '3')) { | 335 | if (contentInfo && (contentInfo.objectType === '13' || contentInfo.objectType === '3')) { |
| 340 | Logger.debug(TAG, 'getGroupData 移除音频 和 活动'); | 336 | Logger.debug(TAG, 'getGroupData 移除音频 和 活动'); |
| 341 | } else { | 337 | } else { |
| 342 | - pageCompList.add(element) | 338 | + // 暂时屏蔽活动和音频详情入口 |
| 339 | + if (element.operDataList[0]?.objectType === '3' || element.operDataList[0]?.objectType === '13') { | ||
| 340 | + } else { | ||
| 341 | + pageCompList.add(element) | ||
| 342 | + } | ||
| 343 | + | ||
| 343 | } | 344 | } |
| 344 | } | 345 | } |
| 345 | 346 | ||
| 347 | + // 记录 | ||
| 346 | pageModel.pageTotalCompSize = pageCompList.length + pageModel.pageTotalCompSize | 348 | pageModel.pageTotalCompSize = pageCompList.length + pageModel.pageTotalCompSize |
| 347 | - console.error("ZZZXXXXX", " collectPageComp--->" + pageModel.pageTotalCompSize); | 349 | + // console.error("ZZZXXXXX", " collectPageComp--->" + pageModel.pageTotalCompSize); |
| 348 | 350 | ||
| 349 | // 处理页面广告数据,投放到页面的位置 | 351 | // 处理页面广告数据,投放到页面的位置 |
| 350 | - // this.handlePageCompAdvPostion(pageCompList, pageModel, pageDto); | 352 | + this.handlePageCompAdvPostion(pageCompList, pageModel, pageDto); |
| 351 | 353 | ||
| 352 | 354 | ||
| 353 | //遍历所有组件和稿件数据 push到页面 | 355 | //遍历所有组件和稿件数据 push到页面 |
| @@ -6,6 +6,7 @@ import { PageUIReqBean } from '../components/page/bean/PageUIReqBean'; | @@ -6,6 +6,7 @@ import { PageUIReqBean } from '../components/page/bean/PageUIReqBean'; | ||
| 6 | import { GroupInfoDTO, PageInfoDTO } from 'wdBean/src/main/ets/bean/navigation/PageInfoDTO'; | 6 | import { GroupInfoDTO, PageInfoDTO } from 'wdBean/src/main/ets/bean/navigation/PageInfoDTO'; |
| 7 | import { AdvRuleBean, CompAdvBean } from 'wdBean/src/main/ets/bean/adv/AdvsRuleBean'; | 7 | import { AdvRuleBean, CompAdvBean } from 'wdBean/src/main/ets/bean/adv/AdvsRuleBean'; |
| 8 | import { WDViewDefaultType } from '../components/view/EmptyComponent'; | 8 | import { WDViewDefaultType } from '../components/view/EmptyComponent'; |
| 9 | +import { LoadStatus } from '../components/refresh/RefreshLayoutBean'; | ||
| 9 | 10 | ||
| 10 | /** | 11 | /** |
| 11 | * 页面下拉刷新、上拉加载数据bean。 | 12 | * 页面下拉刷新、上拉加载数据bean。 |
| @@ -33,6 +34,7 @@ export default class PageModel { | @@ -33,6 +34,7 @@ export default class PageModel { | ||
| 33 | pullDownRefreshImage: Resource = $r('app.media.ic_pull_down_refresh'); | 34 | pullDownRefreshImage: Resource = $r('app.media.ic_pull_down_refresh'); |
| 34 | pullDownRefreshHeight: number = Const.CUSTOM_LAYOUT_HEIGHT; | 35 | pullDownRefreshHeight: number = Const.CUSTOM_LAYOUT_HEIGHT; |
| 35 | isVisiblePullDown: boolean = false; | 36 | isVisiblePullDown: boolean = false; |
| 37 | + load: LoadStatus = LoadStatus.IDLE; | ||
| 36 | pullUpLoadText: Resource = $r('app.string.pull_up_load_text'); | 38 | pullUpLoadText: Resource = $r('app.string.pull_up_load_text'); |
| 37 | pullUpLoadImage: Resource = $r('app.media.ic_pull_up_load'); | 39 | pullUpLoadImage: Resource = $r('app.media.ic_pull_up_load'); |
| 38 | pullUpLoadHeight: number = Const.CUSTOM_LAYOUT_HEIGHT; | 40 | pullUpLoadHeight: number = Const.CUSTOM_LAYOUT_HEIGHT; |
| @@ -8,7 +8,8 @@ import { | @@ -8,7 +8,8 @@ import { | ||
| 8 | NavigationBodyDTO, | 8 | NavigationBodyDTO, |
| 9 | PageDTO, | 9 | PageDTO, |
| 10 | PageInfoBean, | 10 | PageInfoBean, |
| 11 | - PageInfoDTO | 11 | + PageInfoDTO, |
| 12 | + GoldenPositionExtraBean | ||
| 12 | } from 'wdBean'; | 13 | } from 'wdBean'; |
| 13 | 14 | ||
| 14 | import { CollectionUtils, Logger, ResourcesUtils, StringUtils } from 'wdKit'; | 15 | import { CollectionUtils, Logger, ResourcesUtils, StringUtils } from 'wdKit'; |
| @@ -379,10 +380,13 @@ export class PageViewModel extends BaseViewModel { | @@ -379,10 +380,13 @@ export class PageViewModel extends BaseViewModel { | ||
| 379 | }) | 380 | }) |
| 380 | } | 381 | } |
| 381 | 382 | ||
| 382 | - async postThemeList(sort: number, pageNum: number, pageSize: number) : Promise<LiveReviewDTO> { | 383 | + async postThemeList(sort: number, pageNum: number, pageSize: number,extra: string) : Promise<LiveReviewDTO> { |
| 384 | + let bean: GoldenPositionExtraBean = JSON.parse(extra) | ||
| 385 | + bean.pageNum = pageNum | ||
| 386 | + bean.pageSize = pageSize | ||
| 383 | return new Promise<LiveReviewDTO>((success, error) => { | 387 | return new Promise<LiveReviewDTO>((success, error) => { |
| 384 | Logger.info(TAG, `postThemeList pageInfo start`); | 388 | Logger.info(TAG, `postThemeList pageInfo start`); |
| 385 | - PageRepository.postThemeList({ sort, pageNum, pageSize }).then((resDTO) => { | 389 | + PageRepository.postThemeList(bean).then((resDTO) => { |
| 386 | if (!resDTO || !resDTO.data) { | 390 | if (!resDTO || !resDTO.data) { |
| 387 | Logger.error(TAG, 'postThemeList then navResDTO is empty'); | 391 | Logger.error(TAG, 'postThemeList then navResDTO is empty'); |
| 388 | error('resDTO is empty'); | 392 | error('resDTO is empty'); |
sight_harmony/features/wdComponent/src/main/resources/base/media/ic_collect_left_left.png
0 → 100644
845 Bytes
sight_harmony/features/wdComponent/src/main/resources/base/media/ic_collect_left_right.png
0 → 100644
2.06 KB
625 Bytes
1.99 KB
sight_harmony/features/wdComponent/src/main/resources/base/media/ic_collect_mid_right.png
0 → 100644
2.06 KB
sight_harmony/features/wdComponent/src/main/resources/base/media/ic_collect_right_left.png
0 → 100644
1.99 KB
sight_harmony/features/wdComponent/src/main/resources/base/media/ic_collect_right_right.png
0 → 100644
901 Bytes
sight_harmony/features/wdComponent/src/main/resources/base/media/item_collect_tag_middle.webp
0 → 100644
No preview for this file type
221 Bytes
| 1 | export { add } from "./src/main/ets/utils/Calc" | 1 | export { add } from "./src/main/ets/utils/Calc" |
| 2 | 2 | ||
| 3 | -export { HWLocationUtils } from './src/main/ets/location/HWLocationUtils' | ||
| 3 | +export { HWLocationUtils } from './src/main/ets/location/HWLocationUtils' | ||
| 4 | + | ||
| 5 | +export { WDPushNotificationManager } from "./src/main/ets/notification/WDPushNotificationManager" |
sight_harmony/features/wdHwAbility/src/main/ets/notification/WDPushNotificationManager.ets
0 → 100644
| 1 | + | ||
| 2 | +import { pushCommon, pushService } from '@kit.PushKit'; | ||
| 3 | +import { AAID } from '@kit.PushKit'; | ||
| 4 | +import { AccountManagerUtils, Logger, SPHelper, UserDataLocal } from 'wdKit/Index'; | ||
| 5 | +import { BusinessError } from '@kit.BasicServicesKit'; | ||
| 6 | +import notificationManager from '@ohos.notificationManager'; | ||
| 7 | +import { common, Want } from '@kit.AbilityKit'; | ||
| 8 | + | ||
| 9 | +const TAG = "NotificationManager" | ||
| 10 | + | ||
| 11 | +/* | ||
| 12 | + * 远程推送通知管理类 | ||
| 13 | + * Push Kit: https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/push-introduction-0000001726287974 | ||
| 14 | + * Notification Kit: https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/notification-overview-0000001822162741 | ||
| 15 | + * */ | ||
| 16 | +export class WDPushNotificationManager { | ||
| 17 | + | ||
| 18 | + private static instance: WDPushNotificationManager | ||
| 19 | + static getInstance() : WDPushNotificationManager { | ||
| 20 | + if (!WDPushNotificationManager.instance) { | ||
| 21 | + WDPushNotificationManager.instance = new WDPushNotificationManager() | ||
| 22 | + } | ||
| 23 | + return WDPushNotificationManager.instance | ||
| 24 | + } | ||
| 25 | + | ||
| 26 | + async requestEnableNotifications(context: common.UIAbilityContext) : Promise<boolean> { | ||
| 27 | + let enabled = await notificationManager.isNotificationEnabled() | ||
| 28 | + if (!enabled) { | ||
| 29 | + try { | ||
| 30 | + await notificationManager.requestEnableNotification(context) | ||
| 31 | + enabled = true | ||
| 32 | + } catch (err) { | ||
| 33 | + Logger.error(TAG, "请求通知权限报错: " + JSON.stringify(err)) | ||
| 34 | + let error = err as BusinessError | ||
| 35 | + if (error.code == 1600004) { | ||
| 36 | + Logger.error(TAG, "请求通知权限 - 用户已拒绝") | ||
| 37 | + } | ||
| 38 | + } | ||
| 39 | + } | ||
| 40 | + Logger.info(TAG, "推送 enabled " + enabled) | ||
| 41 | + return enabled | ||
| 42 | + } | ||
| 43 | + | ||
| 44 | + async fetchTokenAndBindProfileId() { | ||
| 45 | + try { | ||
| 46 | + const pushToken: string = await pushService.getToken(); | ||
| 47 | + Logger.info(TAG, "获取推送token: " + pushToken) | ||
| 48 | + | ||
| 49 | + //TODO: pushToken 上传至服务器 | ||
| 50 | + SPHelper.default.save("devicePushToken", pushToken) | ||
| 51 | + | ||
| 52 | + if (AccountManagerUtils.isLoginSync()) { | ||
| 53 | + this.bindUserProfileId(UserDataLocal.getUserId()) | ||
| 54 | + } | ||
| 55 | + | ||
| 56 | + } catch (err) { | ||
| 57 | + Logger.error(TAG, "获取推送token失败: " + JSON.stringify(err)) | ||
| 58 | + } | ||
| 59 | + } | ||
| 60 | + | ||
| 61 | + // 禁止推送 | ||
| 62 | + stopPush() { | ||
| 63 | + pushService.deleteToken() | ||
| 64 | + } | ||
| 65 | + | ||
| 66 | + /// 应用匿名标识符 | ||
| 67 | + async getAAID() { | ||
| 68 | + let aaid: string = "" | ||
| 69 | + try { | ||
| 70 | + aaid = await AAID.getAAID(); | ||
| 71 | + Logger.info(TAG, "获取应用匿名标识符AAID: " + aaid) | ||
| 72 | + } catch (err) { | ||
| 73 | + Logger.error(TAG, "获取应用匿名标识符AAID失败: " + JSON.stringify(err)) | ||
| 74 | + } | ||
| 75 | + return aaid | ||
| 76 | + } | ||
| 77 | + | ||
| 78 | + // TODO: 登录时调用 | ||
| 79 | + bindUserProfileId(profileId: string) { | ||
| 80 | + pushService.bindAppProfileId(pushCommon.AppProfileType.PROFILE_TYPE_APPLICATION_ACCOUNT, profileId).then(() => { | ||
| 81 | + Logger.info(TAG, "推送绑定profileId 成功: " + profileId) | ||
| 82 | + }).catch((err: BusinessError) => { | ||
| 83 | + Logger.error(TAG, "推送绑定profileId失败: " + profileId + " " + JSON.stringify(err)) | ||
| 84 | + }); | ||
| 85 | + } | ||
| 86 | + unbindUserProfileId(profileId: string) { | ||
| 87 | + pushService.unbindAppProfileId(profileId).then(() => { | ||
| 88 | + Logger.info(TAG, "推送解绑profileId 成功: " + profileId) | ||
| 89 | + }).catch((err: BusinessError) => { | ||
| 90 | + Logger.error(TAG, "推送解绑profileId失败: " + profileId + " " + JSON.stringify(err)) | ||
| 91 | + }); | ||
| 92 | + } | ||
| 93 | + | ||
| 94 | + sendLocalNotification() { | ||
| 95 | + let notificationRequest: notificationManager.NotificationRequest = { | ||
| 96 | + id: 1, | ||
| 97 | + content: { | ||
| 98 | + notificationContentType: notificationManager.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, | ||
| 99 | + normal: { | ||
| 100 | + title: "test_title", | ||
| 101 | + text: "test_text", | ||
| 102 | + additionalText: "test_additionalText" | ||
| 103 | + } | ||
| 104 | + } | ||
| 105 | + }; | ||
| 106 | + notificationManager.publish(notificationRequest).then(() => { | ||
| 107 | + console.info("publish success"); | ||
| 108 | + }).catch((err: BusinessError) => { | ||
| 109 | + console.error(`publish fail: ${JSON.stringify(err)}`); | ||
| 110 | + }); | ||
| 111 | + } | ||
| 112 | + | ||
| 113 | + setBadgeNumber(number: number) : Promise<void> { | ||
| 114 | + return notificationManager.setBadgeNumber(number) | ||
| 115 | + } | ||
| 116 | + | ||
| 117 | + // 接收推送数据,包括启动和二次点击拉起 | ||
| 118 | + // 参考:https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/push-dev-0000001727885258 | ||
| 119 | + onWant(want: Want) { | ||
| 120 | + Logger.info(TAG, "接收到推送?: " + JSON.stringify(want.parameters)) | ||
| 121 | + } | ||
| 122 | + | ||
| 123 | +} |
-
Please register or login to post a comment