张善主

Merge remote-tracking branch 'origin/main'

Showing 94 changed files with 1765 additions and 340 deletions
@@ -24,4 +24,6 @@ export class SpConstants{ @@ -24,4 +24,6 @@ export class SpConstants{
24 static SETTING_SUSPENSION_SWITCH = "setting_suspension_switch" //悬浮窗 开关 24 static SETTING_SUSPENSION_SWITCH = "setting_suspension_switch" //悬浮窗 开关
25 static SETTING_PUSH_SWITCH = "setting_push_switch" //推送 开关 25 static SETTING_PUSH_SWITCH = "setting_push_switch" //推送 开关
26 26
  27 + //未登录保存兴趣标签
  28 + static PUBLICVISUTORMODE_INTERESTTAGS = 'PublicVisitorMode_InterestTags'
27 } 29 }
@@ -42,4 +42,6 @@ export { ErrorToastUtils } from './src/main/ets/utils/ErrorToastUtils' @@ -42,4 +42,6 @@ export { ErrorToastUtils } from './src/main/ets/utils/ErrorToastUtils'
42 42
43 export { EmitterUtils } from './src/main/ets/utils/EmitterUtils' 43 export { EmitterUtils } from './src/main/ets/utils/EmitterUtils'
44 44
45 -export { EmitterEventId } from './src/main/ets/utils/EmitterEventId'  
  45 +export { EmitterEventId } from './src/main/ets/utils/EmitterEventId'
  46 +
  47 +export { HWLocationUtils } from './src/main/ets/utils/HWLocationUtils'
  1 +import { Logger } from './Logger';
  2 +import { PermissionUtils } from './PermissionUtils';
  3 +import { abilityAccessCtrl, bundleManager, Permissions } from '@kit.AbilityKit';
  4 +import { BusinessError } from '@kit.BasicServicesKit';
  5 +import { geoLocationManager } from '@kit.LocationKit';
  6 +import { SPHelper } from './SPHelper';
  7 +
  8 +/**
  9 + * 系统定位服务实现
  10 + * */
  11 +export class HWLocationUtils {
  12 + //d定位相关
  13 + static LOCATION_CITY_NAME = "location_city_name" //定位
  14 + static LOCATION_CITY_CODE = "location_city_code" //定位
  15 +
  16 +
  17 + static LOCATION: Permissions = 'ohos.permission.LOCATION'
  18 + static APPROXIMATELY_LOCATION: Permissions = 'ohos.permission.APPROXIMATELY_LOCATION'
  19 +
  20 + private static getLocation() {
  21 + let requestInfo: geoLocationManager.LocationRequest = {
  22 + 'priority': geoLocationManager.LocationRequestPriority.FIRST_FIX,
  23 + 'scenario': geoLocationManager.LocationRequestScenario.UNSET,
  24 + distanceInterval: 0,
  25 + timeInterval: 60,
  26 + maxAccuracy: 0
  27 + };
  28 + geoLocationManager.on('locationChange', requestInfo, (data) => {
  29 + Logger.debug('location :' + JSON.stringify(data))
  30 + })
  31 + }
  32 +
  33 + private static getLocationData() {
  34 + return new Promise<Record<string, string | number>>((success, fail) => {
  35 + let requestInfo: geoLocationManager.LocationRequest = {
  36 + 'priority': geoLocationManager.LocationRequestPriority.FIRST_FIX,
  37 + 'scenario': geoLocationManager.LocationRequestScenario.DAILY_LIFE_SERVICE,
  38 + distanceInterval: 0,
  39 + timeInterval: 60,
  40 + maxAccuracy: 0
  41 + };
  42 + geoLocationManager.on('locationChange', requestInfo, (data) => {
  43 + Logger.debug('location :' + JSON.stringify(data)) //{"latitude":31.86870096,"longitude":117.3015341,"altitude":0,"accuracy":5000,"speed":0,"timeStamp":1713332445643,"direction":0,"timeSinceBoot":589519570869240,"additions":"","additionSize":0}
  44 + let record: Record<string, string | number> = {};
  45 + record['latitude'] = data.latitude
  46 + record['longitude'] = data.longitude
  47 + success(record)
  48 + })
  49 + })
  50 + }
  51 +
  52 + //开启定位服务
  53 + static async startLocationService() {
  54 + let grant = await PermissionUtils.checkPermissions(HWLocationUtils.APPROXIMATELY_LOCATION)
  55 + if (grant) {
  56 + HWLocationUtils.getCurrentLocation()
  57 + return
  58 + }
  59 + let context = getContext();
  60 + let requestGrant = await PermissionUtils.reqPermissionsFromUser([HWLocationUtils.APPROXIMATELY_LOCATION], context);
  61 + Logger.debug('location2 :' + requestGrant)
  62 + if (requestGrant) {
  63 + HWLocationUtils.getCurrentLocation()
  64 + } else {
  65 + PermissionUtils.openPermissionsInSystemSettings(context)
  66 + }
  67 + }
  68 +
  69 + private static getCurrentLocation() {
  70 + let requestInfo: geoLocationManager.CurrentLocationRequest = {
  71 + 'priority': geoLocationManager.LocationRequestPriority.FIRST_FIX,
  72 + 'scenario': geoLocationManager.LocationRequestScenario.DAILY_LIFE_SERVICE,
  73 + 'maxAccuracy': 0
  74 + };
  75 + try {
  76 + geoLocationManager.getCurrentLocation(requestInfo).then((result) => {
  77 + //{"latitude":31.8687047,"longitude":117.30152005,"altitude":0,"accuracy":5000,"speed":0,"timeStamp":1713331875766,"direction":0,"timeSinceBoot":588949694096931,"additions":"","additionSize":0}
  78 + Logger.debug('location' + JSON.stringify(result))
  79 + HWLocationUtils.getReverseGeoCodeRequest(result.latitude, result.longitude)
  80 + })
  81 + .catch((error: number) => {
  82 + Logger.debug('location' + JSON.stringify(error))
  83 + });
  84 + } catch (err) {
  85 + }
  86 + }
  87 +
  88 + private static getGeoCodeRequest(description: string) {
  89 + let requestInfo: geoLocationManager.GeoCodeRequest = { 'description': description };
  90 + geoLocationManager.getAddressesFromLocationName(requestInfo, (error, data) => {
  91 + if (data) {
  92 + Logger.debug('location :' + JSON.stringify(data))
  93 + }
  94 + //[{"latitude":31.898204927828598,"longitude":117.29702564819466,"locale":"zh","placeName":"安徽省合肥市瑶海区白龙路与北二环路辅路交叉口南20米","countryCode":"CN","countryName":"中国","administrativeArea":"安徽省","subAdministrativeArea":"合肥市","locality":"合肥市","subLocality":"瑶海区","roadName":"白龙路与北二环路辅路","subRoadName":"20","premises":"20","postalCode":"","phoneNumber":"18756071597","addressUrl":"","descriptionsSize":0,"isFromMock":false}]
  95 + })
  96 + }
  97 +
  98 + private static getReverseGeoCodeRequest(latitude: number, longitude: number) {
  99 + let requestInfo: geoLocationManager.ReverseGeoCodeRequest = {
  100 + "latitude": latitude,
  101 + "longitude": longitude,
  102 + "maxItems": 2
  103 + };
  104 + geoLocationManager.getAddressesFromLocation(requestInfo, (error, data) => {
  105 + if (error) {
  106 + Logger.debug('location :' + JSON.stringify(error))
  107 + }
  108 + if (data) {
  109 + Logger.debug('location :' + JSON.stringify(data))
  110 + if (data[0] && data[0].countryName) {
  111 + if (data[0].descriptionsSize && data[0].descriptions) {
  112 + let code = data[0].descriptions[1]
  113 + let cityCode = code.substring(0, 6)
  114 + let cityName = data[0].subAdministrativeArea;
  115 + if (cityName) {
  116 + SPHelper.default.save(HWLocationUtils.LOCATION_CITY_NAME, cityName)
  117 + }
  118 + if (cityCode) {
  119 + SPHelper.default.save(HWLocationUtils.LOCATION_CITY_NAME, cityCode)
  120 + }
  121 + }
  122 + }
  123 + }
  124 + })
  125 + }
  126 +
  127 +
  128 + //取消定位
  129 + static cancelLocation() {
  130 + // geoLocationManager.off('locationChange')
  131 + return new Promise<boolean>((success, fail) => {
  132 + geoLocationManager.off("locationChange", (data) => {
  133 + Logger.debug('location :' + JSON.stringify(data))
  134 + success(true)
  135 + })
  136 + })
  137 + }
  138 +}
1 { 1 {
2 - "lockfileVersion": 1, 2 + "meta": {
  3 + "stableOrder": true
  4 + },
  5 + "lockfileVersion": 3,
3 "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.",
4 "specifiers": { 7 "specifiers": {
5 - "@ohos/axios@^2.1.1": "@ohos/axios@2.2.0" 8 + "@ohos/axios@^2.1.1": "@ohos/axios@2.2.0",
  9 + "wdConstant@../wdConstant": "wdConstant@../wdConstant",
  10 + "wdKit@../wdKit": "wdKit@../wdKit"
6 }, 11 },
7 "packages": { 12 "packages": {
8 "@ohos/axios@2.2.0": { 13 "@ohos/axios@2.2.0": {
  14 + "name": "@ohos/axios",
  15 + "integrity": "sha512-v1QBWk6DfcN8wUW3D0ieFbHTR1taSI5cOgxp5l6B5cegXuNYhSc8ggKlAIXe6h/14LsfM+NW0ZGfSXcNEIM5yA==",
9 "resolved": "https://repo.harmonyos.com/ohpm/@ohos/axios/-/axios-2.2.0.har", 16 "resolved": "https://repo.harmonyos.com/ohpm/@ohos/axios/-/axios-2.2.0.har",
10 - "integrity": "sha512-v1QBWk6DfcN8wUW3D0ieFbHTR1taSI5cOgxp5l6B5cegXuNYhSc8ggKlAIXe6h/14LsfM+NW0ZGfSXcNEIM5yA==" 17 + "registryType": "ohpm"
  18 + },
  19 + "wdConstant@../wdConstant": {
  20 + "name": "wdconstant",
  21 + "resolved": "../wdConstant",
  22 + "registryType": "local"
  23 + },
  24 + "wdKit@../wdKit": {
  25 + "name": "wdkit",
  26 + "resolved": "../wdKit",
  27 + "registryType": "local"
11 } 28 }
12 } 29 }
13 } 30 }
@@ -2,7 +2,7 @@ @@ -2,7 +2,7 @@
2 * ResponseDTO 2 * ResponseDTO
3 */ 3 */
4 export interface ResponseDTO<T = string> { 4 export interface ResponseDTO<T = string> {
5 - success:boolean; 5 + success: boolean;
6 6
7 // 服务请求响应值/微服务响应状态码” 7 // 服务请求响应值/微服务响应状态码”
8 code: number; 8 code: number;
@@ -12,6 +12,7 @@ export interface ResponseDTO<T = string> { @@ -12,6 +12,7 @@ export interface ResponseDTO<T = string> {
12 12
13 // 响应结果 13 // 响应结果
14 data?: T; 14 data?: T;
  15 + totalCount?: number;
15 16
16 // 请求响应时间戳(unix格式) 17 // 请求响应时间戳(unix格式)
17 timestamp?: number; 18 timestamp?: number;
@@ -235,6 +235,11 @@ export class HttpUrlUtils { @@ -235,6 +235,11 @@ export class HttpUrlUtils {
235 static readonly SEARCH_RESULT_LIST_DATA_PATH: string = "/api/rmrb-search-api/zh/c/search"; 235 static readonly SEARCH_RESULT_LIST_DATA_PATH: string = "/api/rmrb-search-api/zh/c/search";
236 236
237 /** 237 /**
  238 + * 创作者详情接口
  239 + */
  240 + static readonly CREATOR_DETAIL_LIST_DATA_PATH: string = "/api/rmrb-contact/contact/zh/c/master/detailList";
  241 +
  242 + /**
238 * 早晚报列表 243 * 早晚报列表
239 * 根据页面id获取页面楼层列表 244 * 根据页面id获取页面楼层列表
240 * https://pdapis.pdnews.cn/api/rmrb-bff-display-zh/display/zh/c/pageInfo?pageId=28927 245 * https://pdapis.pdnews.cn/api/rmrb-bff-display-zh/display/zh/c/pageInfo?pageId=28927
@@ -258,6 +263,10 @@ export class HttpUrlUtils { @@ -258,6 +263,10 @@ export class HttpUrlUtils {
258 * app启动页 兴趣偏好 263 * app启动页 兴趣偏好
259 */ 264 */
260 static readonly INTERESTS_HOTS_DATA_PATH: string = "/api/rmrb-user-center/user/zh/c/tag/queryTags"; 265 static readonly INTERESTS_HOTS_DATA_PATH: string = "/api/rmrb-user-center/user/zh/c/tag/queryTags";
  266 + /**
  267 + * 更新 兴趣偏好
  268 + */
  269 + static readonly INTERESTS_UPDATETAG_PATH: string = "/api/rmrb-user-center/user/zh/c/tag/updateUserTag";
261 270
262 271
263 private static _hostUrl: string = HttpUrlUtils.HOST_PRODUCT; 272 private static _hostUrl: string = HttpUrlUtils.HOST_PRODUCT;
@@ -663,6 +672,11 @@ export class HttpUrlUtils { @@ -663,6 +672,11 @@ export class HttpUrlUtils {
663 672
664 } 673 }
665 674
  675 + static getUpdateInterestsUrl() {
  676 + let url = HttpUrlUtils._hostUrl + HttpUrlUtils.INTERESTS_UPDATETAG_PATH;
  677 + return url;
  678 + }
  679 +
666 static getLiveDetailsUrl() { 680 static getLiveDetailsUrl() {
667 let url = HttpUrlUtils._hostUrl + HttpUrlUtils.LIVE_DETAILS_PATH 681 let url = HttpUrlUtils._hostUrl + HttpUrlUtils.LIVE_DETAILS_PATH
668 return url 682 return url
@@ -708,6 +722,11 @@ export class HttpUrlUtils { @@ -708,6 +722,11 @@ export class HttpUrlUtils {
708 return url 722 return url
709 } 723 }
710 724
  725 + static getCreatorDetailListDataUrl() {
  726 + let url = HttpUrlUtils._hostUrl + HttpUrlUtils.CREATOR_DETAIL_LIST_DATA_PATH
  727 + return url
  728 + }
  729 +
711 // static getYcgCommonHeaders(): HashMap<string, string> { 730 // static getYcgCommonHeaders(): HashMap<string, string> {
712 // let headers: HashMap<string, string> = new HashMap<string, string>() 731 // let headers: HashMap<string, string> = new HashMap<string, string>()
713 // 732 //
1 { 1 {
2 - "lockfileVersion": 1, 2 + "meta": {
  3 + "stableOrder": true
  4 + },
  5 + "lockfileVersion": 3,
3 "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.",
4 - "specifiers": {},  
5 - "packages": {} 7 + "specifiers": {
  8 + "wdBean@../../features/wdBean": "wdBean@../../features/wdBean",
  9 + "wdKit@../wdKit": "wdKit@../wdKit"
  10 + },
  11 + "packages": {
  12 + "wdBean@../../features/wdBean": {
  13 + "name": "wdbean",
  14 + "resolved": "../../features/wdBean",
  15 + "registryType": "local"
  16 + },
  17 + "wdKit@../wdKit": {
  18 + "name": "wdkit",
  19 + "resolved": "../wdKit",
  20 + "registryType": "local"
  21 + }
  22 + }
6 } 23 }
@@ -43,6 +43,7 @@ export class WDRouterPage { @@ -43,6 +43,7 @@ export class WDRouterPage {
43 static detailPlayVodPage = new WDRouterPage("wdDetailPlayVod", "ets/pages/DetailPlayVodPage"); 43 static detailPlayVodPage = new WDRouterPage("wdDetailPlayVod", "ets/pages/DetailPlayVodPage");
44 // 直播详情页 44 // 直播详情页
45 static detailPlayLivePage = new WDRouterPage("wdDetailPlayLive", "ets/pages/DetailPlayLivePage"); 45 static detailPlayLivePage = new WDRouterPage("wdDetailPlayLive", "ets/pages/DetailPlayLivePage");
  46 + static detailPlayVLivePage = new WDRouterPage("wdDetailPlayLive", "ets/pages/DetailPlayVLivePage");
46 // 多图(图集)详情页 47 // 多图(图集)详情页
47 static multiPictureDetailPage = new WDRouterPage("phone", "ets/pages/detail/MultiPictureDetailPage"); 48 static multiPictureDetailPage = new WDRouterPage("phone", "ets/pages/detail/MultiPictureDetailPage");
48 // 音乐详情页 49 // 音乐详情页
1 { 1 {
2 - "lockfileVersion": 1, 2 + "meta": {
  3 + "stableOrder": true
  4 + },
  5 + "lockfileVersion": 3,
3 "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.",
4 - "specifiers": {},  
5 - "packages": {} 7 + "specifiers": {
  8 + "wdBean@../../features/wdBean": "wdBean@../../features/wdBean",
  9 + "wdConstant@../wdConstant": "wdConstant@../wdConstant",
  10 + "wdJsBridge@../wdJsBridge": "wdJsBridge@../wdJsBridge",
  11 + "wdKit@../wdKit": "wdKit@../wdKit",
  12 + "wdRouter@../wdRouter": "wdRouter@../wdRouter"
  13 + },
  14 + "packages": {
  15 + "wdBean@../../features/wdBean": {
  16 + "name": "wdbean",
  17 + "resolved": "../../features/wdBean",
  18 + "registryType": "local"
  19 + },
  20 + "wdConstant@../wdConstant": {
  21 + "name": "wdconstant",
  22 + "resolved": "../wdConstant",
  23 + "registryType": "local"
  24 + },
  25 + "wdJsBridge@../wdJsBridge": {
  26 + "name": "wdjsbridge",
  27 + "resolved": "../wdJsBridge",
  28 + "registryType": "local"
  29 + },
  30 + "wdKit@../wdKit": {
  31 + "name": "wdkit",
  32 + "resolved": "../wdKit",
  33 + "registryType": "local"
  34 + },
  35 + "wdRouter@../wdRouter": {
  36 + "name": "wdrouter",
  37 + "resolved": "../wdRouter",
  38 + "registryType": "local",
  39 + "dependencies": {
  40 + "wdKit": "file:../wdKit",
  41 + "wdBean": "file:../../features/wdBean"
  42 + }
  43 + }
  44 + }
6 } 45 }
@@ -13,6 +13,7 @@ export struct WdWebComponent { @@ -13,6 +13,7 @@ export struct WdWebComponent {
13 @Prop backVisibility: boolean = false 13 @Prop backVisibility: boolean = false
14 @Prop webUrl: string = '' 14 @Prop webUrl: string = ''
15 @Prop @Watch('onReloadStateChanged') reload: number = 0 15 @Prop @Watch('onReloadStateChanged') reload: number = 0
  16 + @Link isPageEnd: boolean
16 17
17 build() { 18 build() {
18 Column() { 19 Column() {
@@ -37,7 +38,6 @@ export struct WdWebComponent { @@ -37,7 +38,6 @@ export struct WdWebComponent {
37 .horizontalScrollBarAccess(false) 38 .horizontalScrollBarAccess(false)
38 .verticalScrollBarAccess(false) 39 .verticalScrollBarAccess(false)
39 .onPageBegin((event) => { 40 .onPageBegin((event) => {
40 - console.log(this.webUrl,"yzl")  
41 this.onPageBegin(event?.url); 41 this.onPageBegin(event?.url);
42 }) 42 })
43 .onPageEnd((event) => { 43 .onPageEnd((event) => {
@@ -86,18 +86,19 @@ export struct WdWebComponent { @@ -86,18 +86,19 @@ export struct WdWebComponent {
86 BridgeUtil.webViewLoadLocalJs(getContext(this), this.webviewControl) 86 BridgeUtil.webViewLoadLocalJs(getContext(this), this.webviewControl)
87 } 87 }
88 onPageEnd: (url?: string) => void = () => { 88 onPageEnd: (url?: string) => void = () => {
  89 + this.isPageEnd = true
89 Logger.debug(TAG, 'onPageEnd'); 90 Logger.debug(TAG, 'onPageEnd');
90 } 91 }
91 onLoadIntercept: (url?: string) => boolean = () => { 92 onLoadIntercept: (url?: string) => boolean = () => {
92 Logger.debug(TAG, 'onLoadIntercept return false'); 93 Logger.debug(TAG, 'onLoadIntercept return false');
93 return false 94 return false
94 } 95 }
  96 +
95 onReloadStateChanged() { 97 onReloadStateChanged() {
96 Logger.info(TAG, `onReloadStateChanged:::refresh, this.reload: ${this.reload}`); 98 Logger.info(TAG, `onReloadStateChanged:::refresh, this.reload: ${this.reload}`);
97 if (this.reload > 0) { 99 if (this.reload > 0) {
98 this.webviewControl.refresh() 100 this.webviewControl.refresh()
99 } 101 }
100 } 102 }
101 -  
102 } 103 }
103 104
@@ -12,9 +12,12 @@ const TAG = 'WdWebLocalComponent'; @@ -12,9 +12,12 @@ const TAG = 'WdWebLocalComponent';
12 @Component 12 @Component
13 export struct WdWebLocalComponent { 13 export struct WdWebLocalComponent {
14 webviewControl: BridgeWebViewControl = new BridgeWebViewControl() 14 webviewControl: BridgeWebViewControl = new BridgeWebViewControl()
  15 + onWebPrepared: () => void = () => {
  16 + }
15 @Prop backVisibility: boolean = false 17 @Prop backVisibility: boolean = false
16 @Prop webResource: Resource = {} as Resource 18 @Prop webResource: Resource = {} as Resource
17 @State webHeight: string | number = '100%' 19 @State webHeight: string | number = '100%'
  20 + @Link isPageEnd: boolean
18 21
19 build() { 22 build() {
20 Column() { 23 Column() {
@@ -106,6 +109,8 @@ export struct WdWebLocalComponent { @@ -106,6 +109,8 @@ export struct WdWebLocalComponent {
106 } 109 }
107 onPageEnd: (url?: string) => void = () => { 110 onPageEnd: (url?: string) => void = () => {
108 Logger.debug(TAG, 'onPageEnd'); 111 Logger.debug(TAG, 'onPageEnd');
  112 + this.onWebPrepared()
  113 + this.isPageEnd = true
109 } 114 }
110 onLoadIntercept: (url?: string) => boolean = () => { 115 onLoadIntercept: (url?: string) => boolean = () => {
111 Logger.debug(TAG, 'onLoadIntercept return false'); 116 Logger.debug(TAG, 'onLoadIntercept return false');
@@ -171,12 +171,15 @@ export interface LiveInfo { @@ -171,12 +171,15 @@ export interface LiveInfo {
171 liveState: string 171 liveState: string
172 //2024-04-12 15:00:00 直播开始时间 172 //2024-04-12 15:00:00 直播开始时间
173 planStartTime: string 173 planStartTime: string
  174 + liveStyle: number;
174 vlive: Array<Vlive> 175 vlive: Array<Vlive>
175 - mlive:MLive 176 + mlive: MLive
176 } 177 }
  178 +
177 export interface MLive { 179 export interface MLive {
178 - mliveId:string 180 + mliveId: string
179 } 181 }
  182 +
180 export interface FullColumnImgUrls { 183 export interface FullColumnImgUrls {
181 url: string 184 url: string
182 } 185 }
@@ -63,3 +63,6 @@ export { SpacialTopicPageComponent } from './src/main/ets/components/SpacialTopi @@ -63,3 +63,6 @@ export { SpacialTopicPageComponent } from './src/main/ets/components/SpacialTopi
63 63
64 export { LogoutViewModel } from "./src/main/ets/viewmodel/LogoutViewModel" 64 export { LogoutViewModel } from "./src/main/ets/viewmodel/LogoutViewModel"
65 65
  66 +export { ImageSwiperComponent } from "./src/main/ets/components/ImageSwiperComponent"
  67 +export { newsSkeleton } from "./src/main/ets/components/skeleton/newsSkeleton"
  68 +
@@ -6,8 +6,11 @@ @@ -6,8 +6,11 @@
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 + "@ohos/lottie@2.0.0": "@ohos/lottie@2.0.0",
9 "wdBean@../wdBean": "wdBean@../wdBean", 10 "wdBean@../wdBean": "wdBean@../wdBean",
10 "wdConstant@../../commons/wdConstant": "wdConstant@../../commons/wdConstant", 11 "wdConstant@../../commons/wdConstant": "wdConstant@../../commons/wdConstant",
  12 + "wdDetailPlayApi@../wdDetailPlayApi": "wdDetailPlayApi@../wdDetailPlayApi",
  13 + "wdDetailPlayShortVideo@../wdDetailPlayShortVideo": "wdDetailPlayShortVideo@../wdDetailPlayShortVideo",
11 "wdJsBridge@../../commons/wdJsBridge": "wdJsBridge@../../commons/wdJsBridge", 14 "wdJsBridge@../../commons/wdJsBridge": "wdJsBridge@../../commons/wdJsBridge",
12 "wdKit@../../commons/wdKit": "wdKit@../../commons/wdKit", 15 "wdKit@../../commons/wdKit": "wdKit@../../commons/wdKit",
13 "wdLogin@../wdLogin": "wdLogin@../wdLogin", 16 "wdLogin@../wdLogin": "wdLogin@../wdLogin",
@@ -23,6 +26,12 @@ @@ -23,6 +26,12 @@
23 "resolved": "https://repo.harmonyos.com/ohpm/@ohos/axios/-/axios-2.2.0.har", 26 "resolved": "https://repo.harmonyos.com/ohpm/@ohos/axios/-/axios-2.2.0.har",
24 "registryType": "ohpm" 27 "registryType": "ohpm"
25 }, 28 },
  29 + "@ohos/lottie@2.0.0": {
  30 + "name": "@ohos/lottie",
  31 + "integrity": "sha512-jFEFYfuqGO323aMiwtzHmDGRJI0qTxjZD2Lzbn+LxRdoHSfu5OVu22I8gVm5ej019tCw3WOk547NHZ2GuWiNSg==",
  32 + "resolved": "https://repo.harmonyos.com/ohpm/@ohos/lottie/-/lottie-2.0.0.har",
  33 + "registryType": "ohpm"
  34 + },
26 "wdBean@../wdBean": { 35 "wdBean@../wdBean": {
27 "name": "wdbean", 36 "name": "wdbean",
28 "resolved": "../wdBean", 37 "resolved": "../wdBean",
@@ -33,6 +42,32 @@ @@ -33,6 +42,32 @@
33 "resolved": "../../commons/wdConstant", 42 "resolved": "../../commons/wdConstant",
34 "registryType": "local" 43 "registryType": "local"
35 }, 44 },
  45 + "wdDetailPlayApi@../wdDetailPlayApi": {
  46 + "name": "wddetailplayapi",
  47 + "resolved": "../wdDetailPlayApi",
  48 + "registryType": "local",
  49 + "dependencies": {
  50 + "wdPlayer": "file:../../features/wdPlayer",
  51 + "wdKit": "file:../../commons/wdKit",
  52 + "wdBean": "file:../../features/wdBean",
  53 + "wdRouter": "file:../../commons/wdRouter",
  54 + "wdNetwork": "file:../../commons/wdNetwork"
  55 + }
  56 + },
  57 + "wdDetailPlayShortVideo@../wdDetailPlayShortVideo": {
  58 + "name": "wddetailplayshortvideo",
  59 + "resolved": "../wdDetailPlayShortVideo",
  60 + "registryType": "local",
  61 + "dependencies": {
  62 + "@ohos/lottie": "2.0.0",
  63 + "wdPlayer": "file:../../features/wdPlayer",
  64 + "wdKit": "file:../../commons/wdKit",
  65 + "wdBean": "file:../../features/wdBean",
  66 + "wdRouter": "file:../../commons/wdRouter",
  67 + "wdNetwork": "file:../../commons/wdNetwork",
  68 + "wdDetailPlayApi": "file:../../features/wdDetailPlayApi"
  69 + }
  70 + },
36 "wdJsBridge@../../commons/wdJsBridge": { 71 "wdJsBridge@../../commons/wdJsBridge": {
37 "name": "wdjsbridge", 72 "name": "wdjsbridge",
38 "resolved": "../../commons/wdJsBridge", 73 "resolved": "../../commons/wdJsBridge",
@@ -2,6 +2,7 @@ import { Action, NewspaperListItemBean, NewspaperPositionItemBean, Params } from @@ -2,6 +2,7 @@ import { Action, NewspaperListItemBean, NewspaperPositionItemBean, Params } from
2 import { ExtraDTO } from 'wdBean/src/main/ets/bean/component/extra/ExtraDTO'; 2 import { ExtraDTO } from 'wdBean/src/main/ets/bean/component/extra/ExtraDTO';
3 import { StringUtils } from 'wdKit'; 3 import { StringUtils } from 'wdKit';
4 import { WDRouterRule } from 'wdRouter'; 4 import { WDRouterRule } from 'wdRouter';
  5 +import { newsSkeleton } from './skeleton/newsSkeleton';
5 6
6 @Component 7 @Component
7 export struct ENewspaperItemComponent { 8 export struct ENewspaperItemComponent {
@@ -11,13 +12,20 @@ export struct ENewspaperItemComponent { @@ -11,13 +12,20 @@ export struct ENewspaperItemComponent {
11 private startX: number = 0 12 private startX: number = 0
12 private startY: number = 0 13 private startY: number = 0
13 private itemBeanClicked: NewspaperPositionItemBean = {} as NewspaperPositionItemBean 14 private itemBeanClicked: NewspaperPositionItemBean = {} as NewspaperPositionItemBean
  15 + @State isShowSkeleton: boolean = true
14 16
15 build() { 17 build() {
16 Stack() { 18 Stack() {
  19 + newsSkeleton()
  20 + .visibility(this.isShowSkeleton ? Visibility.Visible : Visibility.None)
17 Image(this.newspaperListItemBean.pagePic) 21 Image(this.newspaperListItemBean.pagePic)
18 .width('100%') 22 .width('100%')
19 .aspectRatio(378 / 566) 23 .aspectRatio(378 / 566)
20 .objectFit(ImageFit.Fill) 24 .objectFit(ImageFit.Fill)
  25 + .onComplete(() => {
  26 + this.isShowSkeleton = false
  27 + })
  28 + .visibility(this.isShowSkeleton ? Visibility.None : Visibility.Visible)
21 29
22 Canvas(this.context) 30 Canvas(this.context)
23 .width('100%') 31 .width('100%')
@@ -62,7 +70,7 @@ export struct ENewspaperItemComponent { @@ -62,7 +70,7 @@ export struct ENewspaperItemComponent {
62 pageID: 'IMAGE_TEXT_DETAIL', 70 pageID: 'IMAGE_TEXT_DETAIL',
63 extra: { 71 extra: {
64 relType: this.itemBeanClicked.relType ?? '', 72 relType: this.itemBeanClicked.relType ?? '',
65 - relId: ''+this.itemBeanClicked.relId, 73 + relId: '' + this.itemBeanClicked.relId,
66 sourcePage: '5' 74 sourcePage: '5'
67 } as ExtraDTO 75 } as ExtraDTO
68 } as Params, 76 } as Params,
@@ -110,11 +110,11 @@ export struct ENewspaperPageComponent { @@ -110,11 +110,11 @@ export struct ENewspaperPageComponent {
110 }) 110 })
111 111
112 Row() { 112 Row() {
113 - Text(this.calendarDate) 113 + Text(this.calendarDate?.replace('-', '.')?.replace('-', '.'))
114 .fontSize($r('app.float.font_size_20')) 114 .fontSize($r('app.float.font_size_20'))
115 .fontColor($r('app.color.white')) 115 .fontColor($r('app.color.white'))
116 .fontFamily('BebasNeue_Regular') 116 .fontFamily('BebasNeue_Regular')
117 - .fontWeight(FontWeight.Bold) 117 + .fontWeight(FontWeight.Regular)
118 118
119 Image($r('app.media.icon_triangle')) 119 Image($r('app.media.icon_triangle'))
120 .width($r('app.float.border_radius_6')) 120 .width($r('app.float.border_radius_6'))
@@ -167,6 +167,7 @@ export struct ENewspaperPageComponent { @@ -167,6 +167,7 @@ export struct ENewspaperPageComponent {
167 .autoPlay(false) 167 .autoPlay(false)
168 .cachedCount(3) 168 .cachedCount(3)
169 .indicator(false) 169 .indicator(false)
  170 + .loop(false)
170 .displayCount(1) 171 .displayCount(1)
171 .margin({ top: 35, left: 10, right: 10 }) 172 .margin({ top: 35, left: 10, right: 10 })
172 .id('e_newspaper_content') 173 .id('e_newspaper_content')
@@ -191,12 +192,13 @@ export struct ENewspaperPageComponent { @@ -191,12 +192,13 @@ export struct ENewspaperPageComponent {
191 .id('e_newspaper_shadow') 192 .id('e_newspaper_shadow')
192 193
193 Row() { 194 Row() {
194 - Text('滑动查看下一版') 195 + Text(this.swiperIndex + 1 == this.newspaperListBean?.list?.length ? '已到底部,可以选择其他日期' : '滑动查看下一版')
195 .fontColor(Color.White) 196 .fontColor(Color.White)
196 .fontSize($r('app.float.font_size_14')) 197 .fontSize($r('app.float.font_size_14'))
197 Image($r('app.media.icon_next_page')) 198 Image($r('app.media.icon_next_page'))
198 .width($r('app.float.vp_16')) 199 .width($r('app.float.vp_16'))
199 .height($r('app.float.vp_16')) 200 .height($r('app.float.vp_16'))
  201 + .visibility(this.swiperIndex + 1 == this.newspaperListBean?.list?.length ? Visibility.None : Visibility.Visible)
200 } 202 }
201 .justifyContent(FlexAlign.Center) 203 .justifyContent(FlexAlign.Center)
202 .margin({ top: $r('app.float.margin_16') }) 204 .margin({ top: $r('app.float.margin_16') })
@@ -19,6 +19,7 @@ import { HttpUrlUtils } from 'wdNetwork/Index'; @@ -19,6 +19,7 @@ import { HttpUrlUtils } from 'wdNetwork/Index';
19 import { WDRouterPage, WDRouterRule } from 'wdRouter/Index'; 19 import { WDRouterPage, WDRouterRule } from 'wdRouter/Index';
20 import { MultiPictureDetailViewModel } from '../viewmodel/MultiPictureDetailViewModel'; 20 import { MultiPictureDetailViewModel } from '../viewmodel/MultiPictureDetailViewModel';
21 import { PageRepository } from '../repository/PageRepository'; 21 import { PageRepository } from '../repository/PageRepository';
  22 +import { detailedSkeleton } from './skeleton/detailSkeleton'
22 23
23 const TAG = 'ImageAndTextPageComponent' 24 const TAG = 'ImageAndTextPageComponent'
24 25
@@ -30,41 +31,49 @@ export struct ImageAndTextPageComponent { @@ -30,41 +31,49 @@ export struct ImageAndTextPageComponent {
30 @State recommendList: ContentDTO[] = [] 31 @State recommendList: ContentDTO[] = []
31 @State newsStatusOfUser: batchLikeAndCollectResult | undefined = undefined // 点赞、收藏状态 32 @State newsStatusOfUser: batchLikeAndCollectResult | undefined = undefined // 点赞、收藏状态
32 @State interactData: InteractDataDTO = {} as InteractDataDTO 33 @State interactData: InteractDataDTO = {} as InteractDataDTO
  34 + @State isPageEnd: boolean = false
  35 +
33 build() { 36 build() {
34 Column() { 37 Column() {
35 - // 发布时间  
36 - Row() {  
37 - Image($r('app.media.icon_ren_min_ri_bao'))  
38 - .width(70)  
39 - .height(28)  
40 - Text(this.contentDetailData[0]?.publishTime)  
41 - .fontColor($r('app.color.color_B0B0B0'))  
42 - .fontSize($r('app.float.font_size_13'))  
43 - .height('100%')  
44 - .align(Alignment.End)  
45 - }  
46 - .width(CommonConstants.FULL_WIDTH)  
47 - .height(32)  
48 - .padding({ left: 15, right: 15, })  
49 - .justifyContent(FlexAlign.SpaceBetween)  
50 - .backgroundColor(Color.White) 38 + if (!this.isPageEnd) {
  39 + detailedSkeleton()
  40 + } else {
  41 + // 发布时间
  42 + Row() {
  43 + Image($r('app.media.icon_ren_min_ri_bao'))
  44 + .width(70)
  45 + .height(28)
  46 + Text(this.contentDetailData[0]?.publishTime)
  47 + .fontColor($r('app.color.color_B0B0B0'))
  48 + .fontSize($r('app.float.font_size_13'))
  49 + .height('100%')
  50 + .align(Alignment.End)
  51 + }
  52 + .width(CommonConstants.FULL_WIDTH)
  53 + .height(32)
  54 + .padding({ left: 15, right: 15, })
  55 + .justifyContent(FlexAlign.SpaceBetween)
  56 + .backgroundColor(Color.White)
51 57
52 - Row() {  
53 - Image($r('app.media.line'))  
54 - .width('100%')  
55 - .height(6)  
56 - .objectFit(ImageFit.Cover)  
57 - .margin({ top: 10 }) 58 + Row() {
  59 + Image($r('app.media.line'))
  60 + .width('100%')
  61 + .height(6)
  62 + .objectFit(ImageFit.Cover)
  63 + .margin({ top: 10 })
  64 + }
  65 + .padding({ left: 15, right: 15 })
  66 + .backgroundColor(Color.White)
58 } 67 }
59 - .padding({ left: 15, right: 15 })  
60 - .backgroundColor(Color.White) 68 +
61 69
62 Stack({ alignContent: Alignment.Bottom }) { 70 Stack({ alignContent: Alignment.Bottom }) {
63 Scroll(this.scroller) { 71 Scroll(this.scroller) {
64 Column() { 72 Column() {
65 ImageAndTextWebComponent({ 73 ImageAndTextWebComponent({
66 contentDetailData: this.contentDetailData, 74 contentDetailData: this.contentDetailData,
67 - action: this.action 75 + action: this.action,
  76 + isPageEnd: $isPageEnd
68 }) 77 })
69 Column() { 78 Column() {
70 if (this.recommendList.length > 0) { 79 if (this.recommendList.length > 0) {
@@ -77,7 +86,7 @@ export struct ImageAndTextPageComponent { @@ -77,7 +86,7 @@ export struct ImageAndTextPageComponent {
77 .width(CommonConstants.FULL_WIDTH) 86 .width(CommonConstants.FULL_WIDTH)
78 .height(CommonConstants.FULL_HEIGHT) 87 .height(CommonConstants.FULL_HEIGHT)
79 .padding({ bottom: 76 }) 88 .padding({ bottom: 76 })
80 - // .scrollBar(BarState.Off) 89 + .scrollBar(BarState.Off)
81 90
82 //底部交互区 91 //底部交互区
83 Row() { 92 Row() {
@@ -122,138 +131,6 @@ export struct ImageAndTextPageComponent { @@ -122,138 +131,6 @@ export struct ImageAndTextPageComponent {
122 .height(CommonConstants.FULL_HEIGHT) 131 .height(CommonConstants.FULL_HEIGHT)
123 } 132 }
124 133
125 - // build() {  
126 - // Column() {  
127 - // // 发布时间  
128 - // Row() {  
129 - // Image($r('app.media.icon_ren_min_ri_bao'))  
130 - // .width(70)  
131 - // .height(28)  
132 - // Text(this.contentDetailData[0]?.publishTime)  
133 - // .fontColor($r('app.color.color_B0B0B0'))  
134 - // .fontSize($r('app.float.font_size_13'))  
135 - // .height('100%')  
136 - // .align(Alignment.End)  
137 - // }  
138 - // .width(CommonConstants.FULL_WIDTH)  
139 - // .height(32)  
140 - // .padding({ left: 15, right: 15, })  
141 - // .justifyContent(FlexAlign.SpaceBetween)  
142 - // .backgroundColor(Color.White)  
143 - //  
144 - // Row() {  
145 - // Image($r('app.media.line'))  
146 - // .width('100%')  
147 - // .height(6)  
148 - // .objectFit(ImageFit.Cover)  
149 - // .margin({ top: 10 })  
150 - // }  
151 - // .padding({ left: 15, right: 15, })  
152 - // .backgroundColor(Color.White)  
153 - //  
154 - // Stack({ alignContent: Alignment.Bottom }) {  
155 - //  
156 - // List() {  
157 - // //详情展示区  
158 - // ListItem() {  
159 - // Column() {  
160 - // ImageAndTextWebComponent({  
161 - // contentDetailData: this.contentDetailData,  
162 - // action: this.action,  
163 - // })  
164 - // }.width(CommonConstants.FULL_WIDTH)  
165 - // // .height(CommonConstants.FULL_HEIGHT)  
166 - // }  
167 - //  
168 - // if (this.contentDetailData[0]?.openLikes === 1) {  
169 - // ListItem() {  
170 - // // 点赞  
171 - // Row() {  
172 - // Row() {  
173 - // if (this.newsStatusOfUser?.likeStatus === '1') {  
174 - // Image(this.contentDetailData[0]?.likesStyle === 1 ? $r('app.media.ic_like_check') : (this.contentDetailData[0]?.likesStyle === 2 ? $r('app.media.icon_prayer_active') : $r('app.media.icon_candle_active')))  
175 - // .width(24)  
176 - // .height(24)  
177 - // .margin({ right: 5 })  
178 - // } else {  
179 - // Image(this.contentDetailData[0]?.likesStyle === 1 ? $r('app.media.icon_like') : (this.contentDetailData[0]?.likesStyle === 2 ? $r('app.media.icon_prayer') : $r('app.media.icon_candle')))  
180 - // .width(24)  
181 - // .height(24)  
182 - // .margin({ right: 5 })  
183 - // }  
184 - // Text(`${this.interactData?.likeNum || 0}`)  
185 - // .fontSize(16)  
186 - // .fontColor(this.newsStatusOfUser?.likeStatus === '1' ? '#ED2800' : '#999999')  
187 - // .fontWeight(500)  
188 - // }.alignItems(VerticalAlign.Center)  
189 - // .onClick(() => {  
190 - // this.toggleLikeStatus()  
191 - // })  
192 - //  
193 - // }.width(CommonConstants.FULL_WIDTH).height(80)  
194 - // .justifyContent(FlexAlign.Center)  
195 - // }  
196 - // .border({  
197 - // width: { bottom: 5 },  
198 - // color: '#f5f5f5',  
199 - // })  
200 - // }  
201 - //  
202 - // // 相关推荐区  
203 - // ListItem() {  
204 - // RecommendList({ recommendList: this.recommendList })  
205 - // }  
206 - // }  
207 - // .width(CommonConstants.FULL_WIDTH)  
208 - // .height(CommonConstants.FULL_HEIGHT)  
209 - // .padding({ bottom: 56 })  
210 - // .scrollBar(BarState.Off)  
211 - // .edgeEffect(EdgeEffect.None)  
212 - //  
213 - // //底部交互区  
214 - // Row() {  
215 - // Image($r('app.media.icon_arrow_left'))  
216 - // .width(24)  
217 - // .height(24)  
218 - // .onClick((event: ClickEvent) => {  
219 - // router.back()  
220 - // })  
221 - //  
222 - // Row() {  
223 - // Image($r('app.media.icon_comment'))  
224 - // .width(24)  
225 - // .height(24)  
226 - // .margin({ right: 24 })  
227 - // .id('comment')  
228 - //  
229 - // Image($r('app.media.icon_star'))  
230 - // .width(24)  
231 - // .height(24)  
232 - // .margin({ right: 24 })  
233 - //  
234 - // Image($r('app.media.icon_listen'))  
235 - // .width(24)  
236 - // .height(24)  
237 - // .margin({ right: 24 })  
238 - //  
239 - // Image($r('app.media.icon_forward'))  
240 - // .width(24)  
241 - // .height(24)  
242 - //  
243 - // }  
244 - // }  
245 - // .width(CommonConstants.FULL_WIDTH)  
246 - // .height(56)  
247 - // .padding({ left: 15, right: 15, bottom: 50, top: 20 })  
248 - // .justifyContent(FlexAlign.SpaceBetween)  
249 - // .backgroundColor(Color.White)  
250 - // }  
251 - //  
252 - // }.width(CommonConstants.FULL_WIDTH).height(CommonConstants.FULL_HEIGHT)  
253 - // .backgroundColor(Color.White)  
254 - //  
255 - // }  
256 -  
257 private async getDetail() { 134 private async getDetail() {
258 let contentId: string = '' 135 let contentId: string = ''
259 let relId: string = '' 136 let relId: string = ''
@@ -15,8 +15,12 @@ import { BridgeWebViewControl } from 'wdJsBridge/Index'; @@ -15,8 +15,12 @@ import { BridgeWebViewControl } from 'wdJsBridge/Index';
15 export struct ImageAndTextWebComponent { 15 export struct ImageAndTextWebComponent {
16 action: Action = {} as Action 16 action: Action = {} as Action
17 @State reload: number = 0; 17 @State reload: number = 0;
  18 + @Link isPageEnd: boolean
18 @Prop @Watch('onDetailDataUpdated') contentDetailData: ContentDetailDTO [] = [] as ContentDetailDTO [] 19 @Prop @Watch('onDetailDataUpdated') contentDetailData: ContentDetailDTO [] = [] as ContentDetailDTO []
19 webviewControl: BridgeWebViewControl = new BridgeWebViewControl() 20 webviewControl: BridgeWebViewControl = new BridgeWebViewControl()
  21 + private h5ReceiveAppData: H5ReceiveDetailBean = { dataSource: '2' } as H5ReceiveDetailBean
  22 + private webPrepared = false;
  23 + private dataPrepared = false;
20 24
21 onDetailDataUpdated() { 25 onDetailDataUpdated() {
22 if (this.action) { 26 if (this.action) {
@@ -50,7 +54,6 @@ export struct ImageAndTextWebComponent { @@ -50,7 +54,6 @@ export struct ImageAndTextWebComponent {
50 54
51 } 55 }
52 56
53 - let h5ReceiveAppData: H5ReceiveDetailBean = { dataSource: '2' } as H5ReceiveDetailBean  
54 // TODO 对接user信息、登录情况 57 // TODO 对接user信息、登录情况
55 let h5ReceiveDataExtraBean: H5ReceiveDataExtraBean = { creatorId: '', isLogin: '0' } as H5ReceiveDataExtraBean 58 let h5ReceiveDataExtraBean: H5ReceiveDataExtraBean = { creatorId: '', isLogin: '0' } as H5ReceiveDataExtraBean
56 let h5ReceiveDataJsonBean: H5ReceiveDataJsonBean = { 59 let h5ReceiveDataJsonBean: H5ReceiveDataJsonBean = {
@@ -67,12 +70,10 @@ export struct ImageAndTextWebComponent { @@ -67,12 +70,10 @@ export struct ImageAndTextWebComponent {
67 response.code = 200 70 response.code = 200
68 response.success = true 71 response.success = true
69 h5ReceiveDataJsonBean.responseMap = response 72 h5ReceiveDataJsonBean.responseMap = response
70 - h5ReceiveAppData.dataJson = h5ReceiveDataJsonBean  
71 - h5ReceiveAppData.dataExt = h5ReceiveDataExtraBean  
72 - // TODO 暂延时1s,考虑业务流程再优化  
73 - setTimeout(() => {  
74 - this.sendContentData2H5(h5ReceiveAppData);  
75 - }, 2000) 73 + this.h5ReceiveAppData.dataJson = h5ReceiveDataJsonBean
  74 + this.h5ReceiveAppData.dataExt = h5ReceiveDataExtraBean
  75 + this.dataPrepared = true
  76 + this.trySendData2H5()
76 77
77 } 78 }
78 79
@@ -84,10 +85,26 @@ export struct ImageAndTextWebComponent { @@ -84,10 +85,26 @@ export struct ImageAndTextWebComponent {
84 webviewControl: this.webviewControl, 85 webviewControl: this.webviewControl,
85 webResource: $rawfile('apph5/index.html'), 86 webResource: $rawfile('apph5/index.html'),
86 backVisibility: false, 87 backVisibility: false,
  88 + onWebPrepared: this.onWebPrepared.bind(this),
  89 + isPageEnd:$isPageEnd
  90 +
87 }) 91 })
88 } 92 }
89 } 93 }
90 94
  95 + private trySendData2H5() {
  96 + if (!this.webPrepared || !this.dataPrepared) {
  97 + return
  98 + }
  99 + // 数据、web组件,都准备好了,开始塞详情数据
  100 + this.sendContentData2H5(this.h5ReceiveAppData)
  101 + }
  102 +
  103 + private onWebPrepared() {
  104 + this.webPrepared = true
  105 + this.trySendData2H5()
  106 + }
  107 +
91 private sendContentData2H5(h5ReceiveAppData: H5ReceiveDetailBean) { 108 private sendContentData2H5(h5ReceiveAppData: H5ReceiveDetailBean) {
92 Logger.debug('ImageAndTextWebComponent', 'jsCall_receiveAppData'); 109 Logger.debug('ImageAndTextWebComponent', 'jsCall_receiveAppData');
93 this.webviewControl.callHandle(NativeCallH5Type.jsCall_receiveAppData, 110 this.webviewControl.callHandle(NativeCallH5Type.jsCall_receiveAppData,
  1 +import { PhotoListBean } from 'wdBean/Index';
  2 +import { Logger } from 'wdKit/Index';
  3 +import { MultiPictureDetailItemComponent } from './MultiPictureDetailItemComponent';
  4 +import { display } from '@kit.ArkUI';
  5 +
  6 +const TAG = 'ImageSwiperComponent';
  7 +
  8 +@Component
  9 +export struct ImageSwiperComponent {
  10 + @Provide @Watch('onCurrentPageNumUpdated') currentPageNum: string = '01'
  11 + private scroller: Scroller = new Scroller()
  12 + @State swiperIndex: number = 0;
  13 + photoList: PhotoListBean[] = [];
  14 + private swiperController: SwiperController = new SwiperController()
  15 + private displayTool = display.getDefaultDisplaySync()
  16 + private screenWidth: number = 0
  17 + private picWidth: number = 0
  18 + @State picHeight: number = 0
  19 +
  20 + //watch监听页码回调
  21 + onCurrentPageNumUpdated(): void {
  22 + Logger.info(TAG, `currentPageNum:${this.currentPageNum}`,)
  23 + let _swiperIndex = Number.parseInt(this.currentPageNum)
  24 + Logger.info(TAG, `_swiperIndex:${_swiperIndex}`)
  25 + this.swiperIndex = _swiperIndex > 0 ? _swiperIndex - 1 : _swiperIndex
  26 + }
  27 +
  28 + aboutToAppear(): void {
  29 + //获取宽高尺寸
  30 + this.screenWidth = this.displayTool.width
  31 + // this.picWidth = this.screenWidth - vp2px(52)
  32 + this.picWidth = this.screenWidth
  33 + this.picHeight = this.picWidth * 578 / 375
  34 + }
  35 +
  36 + build() {
  37 + RelativeContainer() {
  38 + if (this.photoList && this.photoList?.length > 0) {
  39 + Swiper(this.swiperController) {
  40 + ForEach(this.photoList, (item: PhotoListBean) => {
  41 + MultiPictureDetailItemComponent({ MultiPictureDetailItem: item })
  42 + })
  43 + }
  44 + .index(this.swiperIndex)
  45 + .width('100%')
  46 + .height(px2vp(this.picHeight) + 32)
  47 + .vertical(false)
  48 + .autoPlay(false)
  49 + .cachedCount(3)
  50 + .indicator(false)
  51 + .displayCount(1)
  52 + .id('e_swiper_content')
  53 + .alignRules({
  54 + center: { anchor: "__container__", align: VerticalAlign.Center },
  55 + middle: { anchor: "__container__", align: HorizontalAlign.Center }
  56 + })
  57 + .onChange((index: number) => {
  58 + this.swiperIndex = index
  59 + })
  60 +
  61 + Row() {
  62 + Scroll(this.scroller) {
  63 + Row() {
  64 + Flex({
  65 + direction: FlexDirection.Column,
  66 + justifyContent: FlexAlign.Start
  67 + }) {
  68 + Text() {
  69 + Span(`${this.swiperIndex + 1}`)
  70 + .fontSize(24)
  71 + .fontFamily('PingFang SC-Medium')
  72 + .fontWeight(500)
  73 + .lineHeight(28)
  74 + Span(`/${this.photoList.length}`)
  75 + .fontSize(14)
  76 + .fontFamily('PingFang SC-Medium')
  77 + .fontWeight(500)
  78 + .lineHeight(19)
  79 + }.fontColor(Color.White).margin(4)
  80 + }
  81 + }
  82 + .width('100%')
  83 + .margin({
  84 + top: 8,
  85 + left: 18,
  86 + bottom: 24,
  87 + right: 18
  88 + })
  89 + }
  90 + .scrollable(ScrollDirection.Vertical)
  91 + .scrollBarWidth(0)
  92 + }
  93 + .id('e_swiper_titles')
  94 + .alignRules({
  95 + bottom: { anchor: "__container__", align: VerticalAlign.Bottom },
  96 + middle: { anchor: "__container__", align: HorizontalAlign.Center }
  97 + })
  98 + }
  99 + }
  100 + .width('100%')
  101 + .height('100%')
  102 + .backgroundColor(Color.Black)
  103 + .id('e_picture_container')
  104 + // 设置顶部绘制延伸到状态栏
  105 + // 设置底部绘制延伸到导航条
  106 + .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM])
  107 + }
  108 +}
@@ -4,6 +4,7 @@ import { WdWebComponent } from 'wdWebComponent'; @@ -4,6 +4,7 @@ import { WdWebComponent } from 'wdWebComponent';
4 import router from '@ohos.router'; 4 import router from '@ohos.router';
5 import { CommonConstants } from 'wdConstant' 5 import { CommonConstants } from 'wdConstant'
6 import { BridgeWebViewControl } from 'wdJsBridge/Index'; 6 import { BridgeWebViewControl } from 'wdJsBridge/Index';
  7 +import { detailedSkeleton } from './skeleton/detailSkeleton'
7 8
8 const TAG = 'SpacialTopicPageComponent' 9 const TAG = 'SpacialTopicPageComponent'
9 10
@@ -13,14 +14,20 @@ export struct SpacialTopicPageComponent { @@ -13,14 +14,20 @@ export struct SpacialTopicPageComponent {
13 scroller: Scroller = new Scroller(); 14 scroller: Scroller = new Scroller();
14 action: Action = {} as Action 15 action: Action = {} as Action
15 @State webUrl: string = ''; 16 @State webUrl: string = '';
  17 + @State isPageEnd: boolean = false
  18 +
16 build() { 19 build() {
17 Column() { 20 Column() {
  21 + if (!this.isPageEnd) {
  22 + detailedSkeleton()
  23 + }
18 Stack({ alignContent: Alignment.Bottom }) { 24 Stack({ alignContent: Alignment.Bottom }) {
19 Column() { 25 Column() {
20 WdWebComponent({ 26 WdWebComponent({
21 webviewControl: this.webviewControl, 27 webviewControl: this.webviewControl,
22 webUrl: this.webUrl, 28 webUrl: this.webUrl,
23 backVisibility: false, 29 backVisibility: false,
  30 + isPageEnd:$isPageEnd
24 }) 31 })
25 } 32 }
26 .padding({ bottom: 56 }) 33 .padding({ bottom: 56 })
@@ -64,6 +71,8 @@ export struct SpacialTopicPageComponent { @@ -64,6 +71,8 @@ export struct SpacialTopicPageComponent {
64 .padding({ left: 15, right: 15, bottom: 20, top: 20 }) 71 .padding({ left: 15, right: 15, bottom: 20, top: 20 })
65 .justifyContent(FlexAlign.SpaceBetween) 72 .justifyContent(FlexAlign.SpaceBetween)
66 .backgroundColor(Color.White) 73 .backgroundColor(Color.White)
  74 +
  75 +
67 } 76 }
68 }.width(CommonConstants.FULL_WIDTH).height(CommonConstants.FULL_HEIGHT) 77 }.width(CommonConstants.FULL_WIDTH).height(CommonConstants.FULL_HEIGHT)
69 .backgroundColor(Color.White) 78 .backgroundColor(Color.White)
1 import { CompDTO, ContentDTO } from 'wdBean'; 1 import { CompDTO, ContentDTO } from 'wdBean';
2 import { CommonConstants } from 'wdConstant/Index'; 2 import { CommonConstants } from 'wdConstant/Index';
  3 +import { CollectionUtils, DateTimeUtils, Logger, StringUtils, ToastUtils } from 'wdKit/Index';
  4 +import PageViewModel from '../../viewmodel/PageViewModel';
3 5
4 const TAG = 'Zh_Grid_Layout-02'; 6 const TAG = 'Zh_Grid_Layout-02';
5 const FULL_PARENT: string = '100%'; 7 const FULL_PARENT: string = '100%';
@@ -11,46 +13,76 @@ let listSize: number = 2; @@ -11,46 +13,76 @@ let listSize: number = 2;
11 * Zh_Grid_Layout-02 13 * Zh_Grid_Layout-02
12 * 14 *
13 */ 15 */
14 -@Preview  
15 @Component 16 @Component
16 export struct ZhGridLayout02 { 17 export struct ZhGridLayout02 {
17 @State compDTO: CompDTO = {} as CompDTO 18 @State compDTO: CompDTO = {} as CompDTO
  19 + @State operDataList: ContentDTO[] = []
  20 + currentPage = 1
  21 + pageSize = 12
18 22
19 aboutToAppear() { 23 aboutToAppear() {
20 - if (this.compDTO.operDataList) {  
21 - listSize = this.compDTO.operDataList.length > 5 ? 2 : this.compDTO.operDataList.length;  
22 - } 24 + Logger.debug(TAG, 'aboutToAppear ' + this.compDTO.objectTitle)
  25 + this.currentPage = 1
  26 + PageViewModel.getLiveReviewUrl(this.currentPage, this.pageSize).then((liveReviewDTO) => {
  27 + this.operDataList = []
  28 + this.operDataList.push(...liveReviewDTO.list)
  29 + })
23 } 30 }
24 31
25 build() { 32 build() {
26 Column() { 33 Column() {
27 - Row() {  
28 - Image($r("app.media.redLine"))  
29 - .width(3)  
30 - .height(16)  
31 - .margin({ right: 4 })  
32 - Text(this.compDTO.objectTitle)  
33 - .fontSize($r("app.float.font_size_17"))  
34 - .fontColor($r("app.color.color_222222"))  
35 - .fontWeight(600)  
36 - }  
37 - .justifyContent(FlexAlign.Start)  
38 - .margin({ top: 8, bottom: 8 })  
39 - .width(CommonConstants.FULL_WIDTH)  
40 34
41 35
42 - GridRow({  
43 - columns: { sm: listSize, md: 2 },  
44 - breakpoints: { value: ['320vp', '520vp', '840vp'] }  
45 - }) {  
46 - ForEach(this.compDTO.operDataList, (item: ContentDTO, index: number) => {  
47 - GridCol() {  
48 - this.buildItemCard(this.compDTO.operDataList[index]); 36 + Scroll() {
  37 + Column() {
  38 + Row() {
  39 + Image($r("app.media.redLine"))
  40 + .width(3)
  41 + .height(16)
  42 + .margin({ right: 4 })
  43 + Text(this.compDTO.objectTitle)
  44 + .fontSize($r("app.float.font_size_17"))
  45 + .fontColor($r("app.color.color_222222"))
  46 + .fontWeight(600)
  47 + }
  48 + .justifyContent(FlexAlign.Start)
  49 + .margin({ top: 8, bottom: 8 })
  50 + .width(CommonConstants.FULL_WIDTH)
  51 +
  52 + GridRow({
  53 + columns: { sm: listSize, md: 2 },
  54 + breakpoints: { value: ['320vp', '520vp', '840vp'] }
  55 + }) {
  56 + ForEach(this.operDataList, (item: ContentDTO, index: number) => {
  57 + GridCol() {
  58 + this.buildItemCard(item);
  59 + }
  60 + })
49 } 61 }
50 - }) 62 + }
  63 +
51 } 64 }
  65 + .width("100%")
  66 + .height("100%")
  67 + // .layoutWeight(1)
  68 + .edgeEffect(EdgeEffect.None)
  69 + .scrollBar(BarState.Off)
  70 + .onReachStart(() => {
  71 + Logger.debug(TAG, 'onReachStart')
  72 + })
  73 + .onReachEnd(() => {
  74 + Logger.debug(TAG, 'onReachEnd')
  75 + this.addItems()
  76 + })
  77 + .nestedScroll({
  78 + scrollForward: NestedScrollMode.PARENT_FIRST,
  79 + scrollBackward: NestedScrollMode.SELF_FIRST
  80 + })
52 } 81 }
53 .width(CommonConstants.FULL_WIDTH) 82 .width(CommonConstants.FULL_WIDTH)
  83 + // .width("100%")
  84 + .height("100%")
  85 + // .layoutWeight(1)
54 .padding({ 86 .padding({
55 top: 14, 87 top: 14,
56 left: 16, 88 left: 16,
@@ -78,6 +110,15 @@ export struct ZhGridLayout02 { @@ -78,6 +110,15 @@ export struct ZhGridLayout02 {
78 } 110 }
79 .width('100%') 111 .width('100%')
80 } 112 }
  113 +
  114 + addItems() {
  115 + Logger.debug(TAG, 'addItems')
  116 + this.currentPage++
  117 + PageViewModel.getLiveReviewUrl(this.currentPage, this.pageSize).then((liveReviewDTO) => {
  118 + this.operDataList.push(...liveReviewDTO.list)
  119 + Logger.debug(TAG, 'addItems after: ' + this.operDataList.length)
  120 + })
  121 + }
81 } 122 }
82 123
83 124
@@ -16,7 +16,7 @@ export default struct MinePageMoreFunctionUI { @@ -16,7 +16,7 @@ export default struct MinePageMoreFunctionUI {
16 .fontColor($r('app.color.color_666666')) 16 .fontColor($r('app.color.color_666666'))
17 .fontSize('29lpx') 17 .fontSize('29lpx')
18 .margin({ left: "31lpx" }) 18 .margin({ left: "31lpx" })
19 - .fontWeight(600) 19 + .fontWeight('600lpx')
20 }.height('92lpx') 20 }.height('92lpx')
21 .width('100%') 21 .width('100%')
22 .justifyContent(FlexAlign.Center) 22 .justifyContent(FlexAlign.Center)
@@ -10,6 +10,8 @@ export default struct MinePagePersonFunctionUI { @@ -10,6 +10,8 @@ export default struct MinePagePersonFunctionUI {
10 loginChange(){ 10 loginChange(){
11 if(this.loginState){ 11 if(this.loginState){
12 this.isLogin=true 12 this.isLogin=true
  13 + }else{
  14 + this.isLogin=false
13 } 15 }
14 } 16 }
15 17
@@ -18,6 +18,8 @@ export default struct MinePageUserSimpleInfoUI { @@ -18,6 +18,8 @@ export default struct MinePageUserSimpleInfoUI {
18 Logger.debug("isLogin",'MinePageUserSimpleInfoUI') 18 Logger.debug("isLogin",'MinePageUserSimpleInfoUI')
19 if(this.loginState){ 19 if(this.loginState){
20 this.isLogin=true 20 this.isLogin=true
  21 + }else {
  22 + this.isLogin=false
21 } 23 }
22 } 24 }
23 loginStateChange(){ 25 loginStateChange(){
@@ -13,6 +13,7 @@ import CustomRefreshLoadLayout from './CustomRefreshLoadLayout'; @@ -13,6 +13,7 @@ import CustomRefreshLoadLayout from './CustomRefreshLoadLayout';
13 import { CompParser } from '../CompParser'; 13 import { CompParser } from '../CompParser';
14 import { CompDTO } from 'wdBean'; 14 import { CompDTO } from 'wdBean';
15 import PageHelper from '../../viewmodel/PageHelper'; 15 import PageHelper from '../../viewmodel/PageHelper';
  16 +import { channelSkeleton } from '../skeleton/channelSkeleton'
16 17
17 const TAG = 'PageComponent'; 18 const TAG = 'PageComponent';
18 19
@@ -77,11 +78,13 @@ export struct PageComponent { @@ -77,11 +78,13 @@ export struct PageComponent {
77 refreshBean: new RefreshLayoutBean(this.pageModel.isVisiblePullUpLoad, this.pageModel.pullUpLoadImage, 78 refreshBean: new RefreshLayoutBean(this.pageModel.isVisiblePullUpLoad, this.pageModel.pullUpLoadImage,
78 this.pageModel.pullUpLoadText, this.pageModel.pullUpLoadHeight) 79 this.pageModel.pullUpLoadText, this.pageModel.pullUpLoadHeight)
79 }) 80 })
80 - } else { 81 + } else if (!this.pageModel.contentNeedScroll) {
81 NoMoreLayout() 82 NoMoreLayout()
82 } 83 }
83 } 84 }
84 } 85 }
  86 + // comp自己处理分页,这里设置EdgeEffect.None
  87 + .edgeEffect(this.pageModel.contentNeedScroll ? EdgeEffect.None : EdgeEffect.Spring)
85 .scrollBar(BarState.Off) 88 .scrollBar(BarState.Off)
86 .cachedCount(8) 89 .cachedCount(8)
87 .height(CommonConstants.FULL_PARENT) 90 .height(CommonConstants.FULL_PARENT)
@@ -95,10 +98,11 @@ export struct PageComponent { @@ -95,10 +98,11 @@ export struct PageComponent {
95 98
96 @Builder 99 @Builder
97 LoadingLayout() { 100 LoadingLayout() {
98 - CustomRefreshLoadLayout({  
99 - refreshBean: new RefreshLayoutBean(true,  
100 - $r('app.media.ic_pull_up_load'), $r('app.string.pull_up_load_text'), this.pageModel.pullDownRefreshHeight)  
101 - }) 101 + channelSkeleton()
  102 + // CustomRefreshLoadLayout({
  103 + // refreshBean: new RefreshLayoutBean(true,
  104 + // $r('app.media.ic_pull_up_load'), $r('app.string.pull_up_load_text'), this.pageModel.pullDownRefreshHeight)
  105 + // })
102 } 106 }
103 107
104 async aboutToAppear() { 108 async aboutToAppear() {
  1 +/**
  2 + * 搜索活动 展示组件
  3 + */
  4 +import { ContentDTO } from 'wdBean/Index';
  5 +
  6 +@Component
  7 +export struct ActivityItemComponent {
  8 + @State contentDTO: ContentDTO = {} as ContentDTO;
  9 +
  10 + build() {
  11 + Row() {
  12 + Stack(){
  13 + Image(this.contentDTO.coverUrl)
  14 + .width('207lpx')
  15 + .height('276lpx')
  16 + .objectFit(ImageFit.Auto)
  17 + .borderRadius('7lpx')
  18 +
  19 + Row(){
  20 + Image(this.contentDTO.programType+"" === "1" ? $r('app.media.activity_is_start_icon') :$r('app.media.activity_not_begin_icon'))
  21 + .width('42lpx')
  22 + .height('35lpx')
  23 + .objectFit(ImageFit.Auto)
  24 + .interpolation(ImageInterpolation.Medium)
  25 +
  26 + Text(this.contentDTO.programType+"" === "1" ? "进行中" :"未开始")
  27 + .fontColor($r('app.color.white'))
  28 + .fontSize('21lpx')
  29 + .fontWeight('400lpx')
  30 + .lineHeight('31lpx')
  31 + .textAlign(TextAlign.Center)
  32 + }.margin({right:'19lpx',bottom:'13lpx'})
  33 + }.alignContent(Alignment.BottomEnd)
  34 +
  35 +
  36 + Column() {
  37 +
  38 + Row(){
  39 + // Text(){
  40 + // // backgroundColor 不生效
  41 + // Span(this.contentDTO.objectType == "new_collect" ? "征稿" : this.contentDTO.objectType == "vote" ? "投票":"")
  42 + // .fontColor($r('app.color.main_red'))
  43 + // .fontSize('23lpx')
  44 + // .fontWeight('400lpx')
  45 + // .lineHeight('31lpx')
  46 + // .padding({left:'10lpx',right:'10lpx',top:'6lpx',bottom:'6lpx'})
  47 + // .backgroundColor( "#FF0"/*$r('app.color.color_ED2800')*/)
  48 + // .borderRadius('10lpx')
  49 + // .margin({ right: '10lpx' })
  50 + //
  51 + // Span(this.contentDTO.newsTitle)
  52 + // .fontColor($r('app.color.color_222222'))
  53 + // .fontSize('33lpx')
  54 + // .fontWeight('400lpx')
  55 + // .lineHeight('48lpx')
  56 + // }.textAlign(TextAlign.Start)
  57 + // .maxLines(2)
  58 + // .textOverflow({ overflow: TextOverflow.Ellipsis })
  59 +
  60 + //TODO 这里的样式(objectType) 只写了两个,其他的需要扩展
  61 + Text(this.contentDTO.objectType == "new_collect" ? "征稿" : this.contentDTO.objectType == "vote" ? "投票":"")
  62 + .fontColor($r('app.color.white'))
  63 + .fontSize('23lpx')
  64 + .fontWeight('400lpx')
  65 + .lineHeight('31lpx')
  66 + .textAlign(TextAlign.Center)
  67 + .padding({left:'10lpx',right:'10lpx',top:'6lpx',bottom:'6lpx'})
  68 + .backgroundColor( $r('app.color.color_ED2800'))
  69 + .borderRadius('10lpx')
  70 + .margin({ right: '10lpx' })
  71 +
  72 +
  73 + Text(this.contentDTO.newsTitle)
  74 + .fontColor($r('app.color.color_222222'))
  75 + .fontSize('33lpx')
  76 + .fontWeight('400lpx')
  77 + .lineHeight('48lpx')
  78 + .textAlign(TextAlign.Start)
  79 + .maxLines(2)
  80 + .layoutWeight(1)
  81 + }
  82 + .margin({ bottom: '15lpx' })
  83 + .alignItems(VerticalAlign.Top)
  84 + .width('100%')
  85 +
  86 + Row() {
  87 + Image($r('app.media.time_icon'))
  88 + .width('27lpx')
  89 + .height('27lpx')
  90 + .objectFit(ImageFit.Auto)
  91 + .margin({ right: '4lpx' })
  92 + .interpolation(ImageInterpolation.Medium)
  93 +
  94 + Text("时间:" + this.contentDTO.startTime.split(" ")[0] + "~" + this.contentDTO.endTime.split(" ")[0])
  95 + .fontColor($r('app.color.color_999999'))
  96 + .fontSize('23lpx')
  97 + .fontWeight('400lpx')
  98 + .lineHeight('31lpx')
  99 + }
  100 +
  101 + Blank()
  102 +
  103 + Text(this.contentDTO.programType+"" === "1" ? "立即参与" : "立即查看")
  104 + .fontColor($r('app.color.white'))
  105 + .fontSize('23lpx')
  106 + .fontWeight('500lpx')
  107 + .lineHeight('38lpx')
  108 + .width('154lpx')
  109 + .height('54lpx')
  110 + .textAlign(TextAlign.Center)
  111 + .backgroundColor(this.contentDTO.programType+"" == "1" ? $r('app.color.color_ED2800') : $r('app.color.color_F07E47'))
  112 + .borderRadius('6lpx')
  113 +
  114 + }.alignItems(HorizontalAlign.Start)
  115 + .width('428lpx')
  116 + .height('276lpx')
  117 +
  118 + }.height('330lpx')
  119 + .justifyContent(FlexAlign.SpaceBetween)
  120 + .width('100%')
  121 + .padding({left:'31lpx',right:'31lpx'})
  122 + }
  123 +}
@@ -253,7 +253,8 @@ export struct SearchComponent { @@ -253,7 +253,8 @@ export struct SearchComponent {
253 if(StringUtils.isNotEmpty(this.searchText)){ 253 if(StringUtils.isNotEmpty(this.searchText)){
254 SearcherAboutDataModel.putSearchHistoryData(this.searchText) 254 SearcherAboutDataModel.putSearchHistoryData(this.searchText)
255 this.getSearchHistoryData() 255 this.getSearchHistoryData()
256 - ToastUtils.shortToast("插入一条搜索记录") 256 +
  257 + this.getSearchHotResData(this.searchText)
257 } 258 }
258 }else{ 259 }else{
259 router.back() 260 router.back()
@@ -3,12 +3,14 @@ import { ContentDTO, @@ -3,12 +3,14 @@ import { ContentDTO,
3 FullColumnImgUrlDTO, InteractDataDTO, RmhInfoDTO, VideoInfoDTO } from 'wdBean/Index' 3 FullColumnImgUrlDTO, InteractDataDTO, RmhInfoDTO, VideoInfoDTO } from 'wdBean/Index'
4 import { LiveInfoDTO } from 'wdBean/src/main/ets/bean/detail/LiveInfoDTO' 4 import { LiveInfoDTO } from 'wdBean/src/main/ets/bean/detail/LiveInfoDTO'
5 import { VoiceInfoDTO } from 'wdBean/src/main/ets/bean/detail/VoiceInfoDTO' 5 import { VoiceInfoDTO } from 'wdBean/src/main/ets/bean/detail/VoiceInfoDTO'
6 -import { LazyDataSource, StringUtils } from 'wdKit/Index' 6 +import { LazyDataSource, StringUtils, ToastUtils } from 'wdKit/Index'
7 import SearcherAboutDataModel from '../../model/SearcherAboutDataModel' 7 import SearcherAboutDataModel from '../../model/SearcherAboutDataModel'
  8 +import { CreatorDetailRequestItem } from '../../viewmodel/CreatorDetailRequestItem'
8 import { SearchResultContentData } from '../../viewmodel/SearchResultContentData' 9 import { SearchResultContentData } from '../../viewmodel/SearchResultContentData'
9 import { SearchRmhDescription } from '../../viewmodel/SearchResultContentItem' 10 import { SearchRmhDescription } from '../../viewmodel/SearchResultContentItem'
10 import { CardParser } from '../CardParser' 11 import { CardParser } from '../CardParser'
11 import { ListHasNoMoreDataUI } from '../reusable/ListHasNoMoreDataUI' 12 import { ListHasNoMoreDataUI } from '../reusable/ListHasNoMoreDataUI'
  13 +import { ActivityItemComponent } from './ActivityItemComponent'
12 14
13 const TAG = "SearchResultContentComponent" 15 const TAG = "SearchResultContentComponent"
14 16
@@ -20,6 +22,7 @@ export struct SearchResultContentComponent{ @@ -20,6 +22,7 @@ export struct SearchResultContentComponent{
20 @State data_rmh: SearchRmhDescription[] = [] 22 @State data_rmh: SearchRmhDescription[] = []
21 @State count:number = 0; 23 @State count:number = 0;
22 @State isLoading:boolean = false 24 @State isLoading:boolean = false
  25 + @State isLoading2:boolean = false
23 @State hasMore:boolean = true 26 @State hasMore:boolean = true
24 curPageNum:number = 1; 27 curPageNum:number = 1;
25 28
@@ -52,7 +55,25 @@ export struct SearchResultContentComponent{ @@ -52,7 +55,25 @@ export struct SearchResultContentComponent{
52 if(value.list[0].dataList!=null){ 55 if(value.list[0].dataList!=null){
53 this.data_rmh = value.list[0].dataList 56 this.data_rmh = value.list[0].dataList
54 //TODO 查询创作者详情接口 57 //TODO 查询创作者详情接口
  58 + let request = new CreatorDetailRequestItem()
55 59
  60 + this.data_rmh .forEach((data)=>{
  61 + request.creatorIdList.push(data.creatorId)
  62 + })
  63 +
  64 + SearcherAboutDataModel.getCreatorDetailListData(request).then((value)=>{
  65 + if(value!=null && value.length>0){
  66 + this.data_rmh.forEach((data)=>{
  67 + value.forEach((item)=>{
  68 + if(data.creatorId == item.creatorId){
  69 + data.headerPhotoUrl = item.headPhotoUrl
  70 + }
  71 + })
  72 + })
  73 + }
  74 + }).catch((err:Error)=>{
  75 + console.log(TAG,JSON.stringify(err))
  76 + })
56 } 77 }
57 this.getInteractData(value) 78 this.getInteractData(value)
58 } 79 }
@@ -105,7 +126,7 @@ export struct SearchResultContentComponent{ @@ -105,7 +126,7 @@ export struct SearchResultContentComponent{
105 cityCode: value.data.cityCode, 126 cityCode: value.data.cityCode,
106 coverSize: "", 127 coverSize: "",
107 coverType: -1, 128 coverType: -1,
108 - coverUrl: value.data.appStyleImages.split("&&")[0], 129 + coverUrl: this.searchType=="activity"?value.data.zhChannelPageImg:value.data.appStyleImages.split("&&")[0],
109 description: value.data.description, 130 description: value.data.description,
110 districtCode: value.data.districtCode, 131 districtCode: value.data.districtCode,
111 endTime: value.data.endTime, 132 endTime: value.data.endTime,
@@ -122,7 +143,7 @@ export struct SearchResultContentComponent{ @@ -122,7 +143,7 @@ export struct SearchResultContentComponent{
122 programId: "", 143 programId: "",
123 programName: "", 144 programName: "",
124 programSource: -1, 145 programSource: -1,
125 - programType: -1, 146 + programType: Number.parseInt(value.data.status),
126 provinceCode: value.data.provinceCode, 147 provinceCode: value.data.provinceCode,
127 showTitleEd: value.data.showTitleEd, 148 showTitleEd: value.data.showTitleEd,
128 showTitleIng: value.data.showTitleIng, 149 showTitleIng: value.data.showTitleIng,
@@ -186,42 +207,76 @@ export struct SearchResultContentComponent{ @@ -186,42 +207,76 @@ export struct SearchResultContentComponent{
186 Column(){ 207 Column(){
187 if (this.data_rmh!=null && this.data_rmh.length > 0) { 208 if (this.data_rmh!=null && this.data_rmh.length > 0) {
188 //List 209 //List
189 - List() { 210 + List({space:'8lpx'}) {
190 ForEach(this.data_rmh, (item: SearchRmhDescription, index: number) => { 211 ForEach(this.data_rmh, (item: SearchRmhDescription, index: number) => {
191 ListItem() { 212 ListItem() {
192 Column(){ 213 Column(){
193 - Image($r('app.media.default_head'))  
194 - .width('84lpx')  
195 - .height('84lpx') 214 + Image(item.headerPhotoUrl)
  215 + .width('92lpx')
  216 + .alt($r('app.media.default_head'))
  217 + .height('92lpx')
196 .margin({bottom:'15lpx'}) 218 .margin({bottom:'15lpx'})
  219 + .borderRadius(50)
197 Text(item.creatorName) 220 Text(item.creatorName)
198 - .fontSize('20lpx') 221 + .fontSize('25lpx')
  222 + .fontWeight('400lpx')
  223 + .lineHeight('35lpx')
  224 + .constraintSize({maxWidth:'150lpx'})
  225 + .maxLines(1)
  226 + .textOverflow({ overflow: TextOverflow.Ellipsis })
199 }.alignItems(HorizontalAlign.Center) 227 }.alignItems(HorizontalAlign.Center)
  228 + .justifyContent(FlexAlign.Center)
200 229
201 }.onClick(()=>{ 230 }.onClick(()=>{
202 //TODO 跳转 231 //TODO 跳转
203 }) 232 })
204 .width('150lpx') 233 .width('150lpx')
  234 + .height('100%')
205 }) 235 })
  236 +
  237 + ListItem(){
  238 + Text("查看更多")
  239 + .height('180lpx')
  240 + .textAlign(TextAlign.Center)
  241 + .width('77lpx')
  242 + .backgroundColor($r('app.color.color_EDEDED'))
  243 + .fontColor($r('app.color.color_9E9E9E'))
  244 + .borderRadius({topLeft:'4lpx',bottomLeft:'4lpx'})
  245 + }.height('100%')
  246 + .margin({left:'23lpx'})
  247 +
206 } 248 }
207 .cachedCount(6) 249 .cachedCount(6)
208 - .edgeEffect(EdgeEffect.None) 250 + .edgeEffect(EdgeEffect.Spring)
209 .scrollBar(BarState.Off) 251 .scrollBar(BarState.Off)
210 .listDirection(Axis.Horizontal) 252 .listDirection(Axis.Horizontal)
211 .width('100%') 253 .width('100%')
212 - .height('150lpx') 254 + .height('219lpx')
213 .onReachEnd(()=>{ 255 .onReachEnd(()=>{
214 - if(!this.isLoading){ 256 + if(!this.isLoading2){
  257 + this.isLoading2 = true
215 //进入更多关注页 258 //进入更多关注页
  259 + ToastUtils.shortToast("进入更多关注页")
  260 +
216 } 261 }
217 }) 262 })
  263 +
  264 + Divider()
  265 + .width('100%')
  266 + .height('12lpx')
  267 + .color($r('app.color.color_F5F5F5'))
  268 + .strokeWidth('12lpx')
218 } 269 }
219 //List 270 //List
220 List({ space: '6lpx' }) { 271 List({ space: '6lpx' }) {
221 LazyForEach(this.data, (item: ContentDTO, index: number) => { 272 LazyForEach(this.data, (item: ContentDTO, index: number) => {
222 ListItem() { 273 ListItem() {
223 Column(){ 274 Column(){
224 - CardParser({contentDTO:item}) 275 + if(this.searchType == "activity"){
  276 + ActivityItemComponent({contentDTO:item})
  277 + }else{
  278 + CardParser({contentDTO:item})
  279 + }
225 if(index != this.data.totalCount()-1 ){ 280 if(index != this.data.totalCount()-1 ){
226 Divider() 281 Divider()
227 .width('100%') 282 .width('100%')
@@ -245,7 +300,6 @@ export struct SearchResultContentComponent{ @@ -245,7 +300,6 @@ export struct SearchResultContentComponent{
245 }.cachedCount(6) 300 }.cachedCount(6)
246 .edgeEffect(EdgeEffect.None) 301 .edgeEffect(EdgeEffect.None)
247 .scrollBar(BarState.Off) 302 .scrollBar(BarState.Off)
248 - .margin({top:'23lpx',left:'23lpx',right:'23lpx'})  
249 .layoutWeight(1) 303 .layoutWeight(1)
250 .onReachEnd(()=>{ 304 .onReachEnd(()=>{
251 console.log(TAG,"触底了"); 305 console.log(TAG,"触底了");
  1 +import { EmptyComponent } from '../view/EmptyComponent'
  2 +
  3 +@Entry
  4 +@Component
  5 +export struct DefaultPage {
  6 + build() {
  7 + Row() {
  8 + EmptyComponent({ emptyType: 8 })
  9 + }
  10 + }
  11 +}
@@ -4,7 +4,7 @@ @@ -4,7 +4,7 @@
4 4
5 @Entry 5 @Entry
6 @Component 6 @Component
7 -export struct detailedSkeleton { 7 +export struct newsSkeleton {
8 @State quantity: Array<number> = [1, 2, 3,] 8 @State quantity: Array<number> = [1, 2, 3,]
9 9
10 build() { 10 build() {
@@ -23,7 +23,7 @@ export const enum WDViewDefaultType { @@ -23,7 +23,7 @@ export const enum WDViewDefaultType {
23 WDViewDefaultType_NoCollection, 23 WDViewDefaultType_NoCollection,
24 ///无历史记录 24 ///无历史记录
25 WDViewDefaultType_NoHistory, 25 WDViewDefaultType_NoHistory,
26 - ///网络失败 26 + ///网络失败 请稍后重试-倒计时
27 WDViewDefaultType_NetworkFailed, 27 WDViewDefaultType_NetworkFailed,
28 ///内容获取失败 28 ///内容获取失败
29 WDViewDefaultType_ContentFailed, 29 WDViewDefaultType_ContentFailed,
@@ -42,12 +42,13 @@ export const enum WDViewDefaultType { @@ -42,12 +42,13 @@ export const enum WDViewDefaultType {
42 /** 42 /**
43 * 空数据/无数据 43 * 空数据/无数据
44 */ 44 */
  45 +@Preview
45 @Component 46 @Component
46 export struct EmptyComponent { 47 export struct EmptyComponent {
47 // private emptySize: SizeOptions = {}; 48 // private emptySize: SizeOptions = {};
48 @State emptyWidth: string | number = CommonConstants.FULL_PARENT; 49 @State emptyWidth: string | number = CommonConstants.FULL_PARENT;
49 @State emptyHeight: string | number = CommonConstants.FULL_PARENT; 50 @State emptyHeight: string | number = CommonConstants.FULL_PARENT;
50 - @State emptyType:number = WDViewDefaultType.WDViewDefaultType_Default 51 + @State emptyType: number = WDViewDefaultType.WDViewDefaultType_Default
51 /** 52 /**
52 * The empty image width percentage setting. 53 * The empty image width percentage setting.
53 */ 54 */
@@ -101,16 +102,52 @@ export struct EmptyComponent { @@ -101,16 +102,52 @@ export struct EmptyComponent {
101 let contentString: string = '暂无内容' 102 let contentString: string = '暂无内容'
102 if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoCollection) { 103 if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoCollection) {
103 contentString = '暂无收藏' 104 contentString = '暂无收藏'
  105 + } else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoMessage) {
  106 + contentString = '暂无消息'
  107 + } else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoComment) {
  108 + contentString = '暂无评论'
  109 + } else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoSearchResult) {
  110 + contentString = '没有找到相关内容'
  111 + } else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoNetwork) {
  112 + contentString = '网络出小差了,请检查网络后重试'
  113 + } else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_ContentFailed) {
  114 + contentString = '获取内容失败请重试'
  115 + } else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoCreation) {
  116 + contentString = '暂无作品'
  117 + } else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoBooking) {
  118 + contentString = '暂无预约'
  119 + } else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NetworkFailed) {
  120 + contentString = '' // 前方拥堵,请耐心等待
  121 + } else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoVisitAccount) {
  122 + contentString = '该号主暂时无法访问' // 前方拥堵,请耐心等待
104 } 123 }
  124 +
105 return contentString 125 return contentString
106 } 126 }
107 127
108 -  
109 buildNoDataTipImage(): Resource | string { 128 buildNoDataTipImage(): Resource | string {
110 Logger.info(TAG, "buildNoDataTip"); 129 Logger.info(TAG, "buildNoDataTip");
111 let imageString: Resource | string = $r('app.media.icon_no_content') 130 let imageString: Resource | string = $r('app.media.icon_no_content')
112 if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoCollection) { 131 if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoCollection) {
113 imageString = $r('app.media.icon_no_collection') 132 imageString = $r('app.media.icon_no_collection')
  133 + } else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoMessage) {
  134 + imageString = $r('app.media.icon_no_message')
  135 + } else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoComment) {
  136 + imageString = $r('app.media.icon_no_comment')
  137 + } else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoSearchResult) {
  138 + imageString = $r('app.media.icon_no_result')
  139 + } else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoNetwork) {
  140 + imageString = $r('app.media.icon_no_net')
  141 + } else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_ContentFailed) {
  142 + imageString = $r('app.media.icon_no_content')
  143 + } else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoCreation) {
  144 + imageString = $r('app.media.icon_no_appointmentMade')
  145 + } else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoBooking) {
  146 + imageString = $r('app.media.icon_no_appointmentMade')
  147 + } else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NetworkFailed) {
  148 + imageString = $r('app.media.icon_no_net')
  149 + } else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoVisitAccount) {
  150 + imageString = $r('app.media.icon_no_master1')
114 } 151 }
115 return imageString 152 return imageString
116 } 153 }
@@ -7,6 +7,8 @@ import { SearchHotContentItem } from '../viewmodel/SearchHotContentItem'; @@ -7,6 +7,8 @@ import { SearchHotContentItem } from '../viewmodel/SearchHotContentItem';
7 import { SearchResultCountItem } from '../viewmodel/SearchResultCountItem'; 7 import { SearchResultCountItem } from '../viewmodel/SearchResultCountItem';
8 import { SearchResultContentData } from '../viewmodel/SearchResultContentData'; 8 import { SearchResultContentData } from '../viewmodel/SearchResultContentData';
9 import { contentListParams, InteractDataDTO } from 'wdBean/Index'; 9 import { contentListParams, InteractDataDTO } from 'wdBean/Index';
  10 +import { CreatorDetailRequestItem } from '../viewmodel/CreatorDetailRequestItem';
  11 +import { CreatorDetailResponseItem } from '../viewmodel/CreatorDetailResponseItem';
10 12
11 const TAG = "SearcherAboutDataModel" 13 const TAG = "SearcherAboutDataModel"
12 14
@@ -320,6 +322,37 @@ class SearcherAboutDataModel{ @@ -320,6 +322,37 @@ class SearcherAboutDataModel{
320 } 322 }
321 323
322 324
  325 + /**
  326 + * 获取关注详情 列表
  327 + */
  328 + getCreatorDetailListData(object:CreatorDetailRequestItem): Promise<CreatorDetailResponseItem[]> {
  329 + return new Promise<CreatorDetailResponseItem[]>((success, error) => {
  330 + Logger.info(TAG, `getCreatorDetailListData start`);
  331 + this.fetchCreatorDetailListData(object).then((navResDTO: ResponseDTO<CreatorDetailResponseItem[]>) => {
  332 + if (!navResDTO || navResDTO.code != 0) {
  333 + success([])
  334 + return
  335 + }
  336 + Logger.info(TAG, "getCreatorDetailListData then,SearchResultListResDTO.timeStamp:" + navResDTO.timestamp);
  337 + let navigationBean = navResDTO.data as CreatorDetailResponseItem[]
  338 + success(navigationBean);
  339 + }).catch((err: Error) => {
  340 + Logger.error(TAG, `getCreatorDetailListData catch, error.name : ${err.name}, error.message:${err.message}`);
  341 + success([])
  342 + })
  343 + })
  344 + }
  345 +
  346 + fetchCreatorDetailListData(object:CreatorDetailRequestItem) {
  347 + let url = HttpUrlUtils.getCreatorDetailListDataUrl()
  348 + let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();
  349 + return WDHttp.post<ResponseDTO<CreatorDetailResponseItem[]>>(url,object, headers)
  350 + };
  351 +
  352 +
  353 +
  354 +
  355 +
323 } 356 }
324 357
325 const searcherAboutDataModel = SearcherAboutDataModel.getInstance() 358 const searcherAboutDataModel = SearcherAboutDataModel.getInstance()
  1 +export class CreatorDetailRequestItem{
  2 + creatorIdList:string[] = []
  3 +}
  1 +export class CreatorDetailResponseItem{
  2 + articleCreation: number = 0
  3 + attentionNum: number = 0
  4 + authIcon: string = ""
  5 + authId: number = 0
  6 + authPersonal: string = ""
  7 + authTitle: string = ""
  8 + banControl: number = 0
  9 + categoryAuth: string = ""
  10 + city: string = ""
  11 + cnContentPublish: number = 0
  12 + cnIsComment: number = 0
  13 + cnIsLike: number = 0
  14 + cnLiveCommentControl: number = 0
  15 + cnLiveGiftControl: number = 0
  16 + cnLiveLikeControl: number = 0
  17 + cnLivePublish: number = 0
  18 + cnLiveShareControl: number = 0
  19 + cnShareControl: number = 0
  20 + collectNum: number = 0
  21 + commentNum: number = 0
  22 + contentPublish: number = 0
  23 + creatorId: string = ""
  24 + district: string = ""
  25 + dynamicControl: number = 0
  26 + dynamicCreation: number = 0
  27 + fansNum: number = 0
  28 + headPhotoUrl: string = ""
  29 + honoraryIcon: string = ""
  30 + honoraryTitle: string = ""
  31 + introduction: string = ""
  32 + isAttention: number = 0
  33 + isComment: number = 0
  34 + isLike: number = 0
  35 + likeNum: number = 0
  36 + liveCommentControl: number = 0
  37 + liveGiftControl: number = 0
  38 + liveLikeControl: number = 0
  39 + livePublish: number = 0
  40 + liveShareControl: number = 0
  41 + liveSwitch: number = 0
  42 + mainControl: number = 0
  43 + pictureCollectionCreation: number = 0
  44 + posterShareControl: number = 0
  45 + province: string = ""
  46 + region: string = ""
  47 + registTime: number = 0
  48 + shareControl: number = 0
  49 + shareNum: number = 0
  50 + subjectType: number = 0
  51 + userId: string = ""
  52 + userName: string = ""
  53 + userType: string = ""
  54 + videoCollectionCreation: number = 0
  55 + videoCreation: number = 0
  56 +}
@@ -129,10 +129,13 @@ class EditInfoViewModel { @@ -129,10 +129,13 @@ class EditInfoViewModel {
129 .then((navResDTO: ResponseDTO) => { 129 .then((navResDTO: ResponseDTO) => {
130 if (navResDTO.code == 0) { 130 if (navResDTO.code == 0) {
131 promptAction.showToast({ message: '修改成功' }) 131 promptAction.showToast({ message: '修改成功' })
  132 + }else {
  133 + promptAction.showToast({ message: navResDTO.message })
132 } 134 }
133 }) 135 })
134 .catch((error: Error) => { 136 .catch((error: Error) => {
135 Logger.info(TAG,'updateUserInfo','EditInfoViewModel') 137 Logger.info(TAG,'updateUserInfo','EditInfoViewModel')
  138 + promptAction.showToast({ message: error.message })
136 }) 139 })
137 }) 140 })
138 } 141 }
1 import { PageDTO, CompDTO, PageInfoDTO } from 'wdBean'; 1 import { PageDTO, CompDTO, PageInfoDTO } from 'wdBean';
2 -import { ViewType } from 'wdConstant/Index';  
3 -import { DateTimeUtils, Logger } from 'wdKit'; 2 +import { CompStyle, ViewType } from 'wdConstant/Index';
  3 +import { CollectionUtils, DateTimeUtils, Logger } from 'wdKit';
4 import { closeRefresh } from '../utils/PullDownRefresh'; 4 import { closeRefresh } from '../utils/PullDownRefresh';
5 import PageModel from './PageModel'; 5 import PageModel from './PageModel';
6 import PageViewModel from './PageViewModel'; 6 import PageViewModel from './PageViewModel';
@@ -65,39 +65,33 @@ export class PageHelper { @@ -65,39 +65,33 @@ export class PageHelper {
65 } else { 65 } else {
66 pageModel.hasMore = false; 66 pageModel.hasMore = false;
67 } 67 }
  68 +
  69 + // TODO 暂时去掉互动数据,待优化。(主要是互动数据返回,如何渲染到ui上)
  70 + // TODO updateItems(sizeBefore, data),这里可能有时序问题,导致覆盖别的group数据,需要优化,考虑精准替换
68 // 二次请求,批查互动数据 71 // 二次请求,批查互动数据
69 - PageViewModel.getInteractData(pageDto.compList).then((data: CompDTO[]) => {  
70 - // 刷新,替换所有数据  
71 - // pageModel.compList.replaceAll(...data)  
72 - pageModel.compList.updateItems(sizeBefore, data)  
73 - pageModel.timestamp = DateTimeUtils.getTimeStamp().toString()  
74 - })  
75 - // TODO 待优化,解决content级别的展现加载 72 + // PageViewModel.getInteractData(pageDto.compList).then((data: CompDTO[]) => {
  73 + // // 刷新,替换所有数据
  74 + // // pageModel.compList.replaceAll(...data)
  75 + // pageModel.compList.updateItems(sizeBefore, data)
  76 + // pageModel.timestamp = DateTimeUtils.getTimeStamp().toString()
  77 + // })
  78 + // content级别的展现加载丢给comp自己,这里只需要处理屏蔽分页加载,pageModel.pageScroll
76 if (isLastGroup) { 79 if (isLastGroup) {
77 closeRefresh(pageModel, true); 80 closeRefresh(pageModel, true);
78 - // // 最后一个楼层,特殊处理  
79 - // // 检测楼层最后一个组件业务数据是否需要通过访问接口获取  
80 - // let comp: CompDTO = pageDto.compList[pageDto.compList.length - 1]  
81 - // let compSize = CollectionUtils.getListSize(comp.operDataList)  
82 - // // 直播回放,需要二次请求数据  
83 - // if (compSize <= 0 && comp.dataSourceType == 'LIVE_END') {  
84 - // let liveReviewDTO = await PageViewModel.getLiveReviewUrl(pageModel.currentPage, pageModel.pageSize)  
85 - // // content数据回来,塞给comp  
86 - // comp.operDataList.push(...liveReviewDTO.list)  
87 - // } 81 + // 最后一个楼层,特殊处理
  82 + // 检测楼层最后一个组件业务数据是否需要通过访问接口获取
  83 + let comp: CompDTO = pageDto.compList[pageDto.compList.length - 1]
  84 + let compSize = CollectionUtils.getListSize(comp.operDataList)
  85 + // 直播回放,需要二次请求数据
  86 + if (compSize <= 0 && comp.compStyle == CompStyle.Zh_Grid_Layout_02) {
  87 + // 这个comp,数据自己二次请求,自己分页处理,这里加flag,将page层滑动及loadmore ui去掉
  88 + pageModel.contentNeedScroll = true
  89 + }
88 } 90 }
89 } 91 }
90 } 92 }
91 93
92 /** 94 /**
93 - * 获取直播回看数据  
94 - */  
95 - private async getLiveEnd(pageModel: PageModel) {  
96 - let liveReviewDTO = await PageViewModel.getLiveReviewUrl(pageModel.currentPage, pageModel.pageSize)  
97 - Logger.debug(TAG, 'aboutToAppear, getPreviewData ' + liveReviewDTO.hasNext);  
98 - }  
99 -  
100 - /**  
101 * comp加载更多,分页加载 95 * comp加载更多,分页加载
102 */ 96 */
103 private compLoadMore(pageModel: PageModel) { 97 private compLoadMore(pageModel: PageModel) {
@@ -125,14 +119,6 @@ export class PageHelper { @@ -125,14 +119,6 @@ export class PageHelper {
125 promptAction.showToast({ message: err }); 119 promptAction.showToast({ message: err });
126 }) 120 })
127 } 121 }
128 -  
129 - /**  
130 - * 节目数据分页加载  
131 - * TODO 待完善框架  
132 - */  
133 - private contentLoadMore() {  
134 -  
135 - }  
136 } 122 }
137 123
138 124
@@ -20,6 +20,9 @@ export default class PageModel { @@ -20,6 +20,9 @@ export default class PageModel {
20 // 当前请求数据的group 20 // 当前请求数据的group
21 groupData: GroupInfoDTO = {} as GroupInfoDTO; 21 groupData: GroupInfoDTO = {} as GroupInfoDTO;
22 compList: LazyDataSource<CompDTO> = new LazyDataSource(); 22 compList: LazyDataSource<CompDTO> = new LazyDataSource();
  23 + // 是否comp自己处理分页加载;默认是最后一个comp下的content有分页数据,需要节目内容的分页加载
  24 + // (如:首页-视频tab-直播tab,最后一个comp是直播回看列表,视频内容需要分页加载)
  25 + contentNeedScroll: boolean = false;
23 // 页面状态,刷新、加载更多等,1-首次、2-下拉、3上拉 26 // 页面状态,刷新、加载更多等,1-首次、2-下拉、3上拉
24 loadStrategy: number = 1; 27 loadStrategy: number = 1;
25 currentPage: number = 1; 28 currentPage: number = 1;
@@ -139,6 +139,14 @@ @@ -139,6 +139,14 @@
139 { 139 {
140 "name": "color_000000", 140 "name": "color_000000",
141 "value": "#000000" 141 "value": "#000000"
  142 + },
  143 + {
  144 + "name": "color_F07E47",
  145 + "value": "#F07E47"
  146 + },
  147 + {
  148 + "name": "color_9E9E9E",
  149 + "value": "#9E9E9E"
142 } 150 }
143 ] 151 ]
144 } 152 }
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
1 { 1 {
2 - "lockfileVersion": 1, 2 + "meta": {
  3 + "stableOrder": true
  4 + },
  5 + "lockfileVersion": 3,
3 "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.",
4 - "specifiers": {},  
5 - "packages": {} 7 + "specifiers": {
  8 + "@ohos/axios@^2.1.1": "@ohos/axios@2.2.0",
  9 + "wdBean@../wdBean": "wdBean@../wdBean",
  10 + "wdConstant@../../commons/wdConstant": "wdConstant@../../commons/wdConstant",
  11 + "wdKit@../../commons/wdKit": "wdKit@../../commons/wdKit",
  12 + "wdNetwork@../../commons/wdNetwork": "wdNetwork@../../commons/wdNetwork",
  13 + "wdPlayer@../wdPlayer": "wdPlayer@../wdPlayer",
  14 + "wdRouter@../../commons/wdRouter": "wdRouter@../../commons/wdRouter"
  15 + },
  16 + "packages": {
  17 + "@ohos/axios@2.2.0": {
  18 + "name": "@ohos/axios",
  19 + "integrity": "sha512-v1QBWk6DfcN8wUW3D0ieFbHTR1taSI5cOgxp5l6B5cegXuNYhSc8ggKlAIXe6h/14LsfM+NW0ZGfSXcNEIM5yA==",
  20 + "resolved": "https://repo.harmonyos.com/ohpm/@ohos/axios/-/axios-2.2.0.har",
  21 + "registryType": "ohpm"
  22 + },
  23 + "wdBean@../wdBean": {
  24 + "name": "wdbean",
  25 + "resolved": "../wdBean",
  26 + "registryType": "local"
  27 + },
  28 + "wdConstant@../../commons/wdConstant": {
  29 + "name": "wdconstant",
  30 + "resolved": "../../commons/wdConstant",
  31 + "registryType": "local"
  32 + },
  33 + "wdKit@../../commons/wdKit": {
  34 + "name": "wdkit",
  35 + "resolved": "../../commons/wdKit",
  36 + "registryType": "local"
  37 + },
  38 + "wdNetwork@../../commons/wdNetwork": {
  39 + "name": "wdnetwork",
  40 + "resolved": "../../commons/wdNetwork",
  41 + "registryType": "local",
  42 + "dependencies": {
  43 + "wdConstant": "file:../wdConstant",
  44 + "wdKit": "file:../wdKit",
  45 + "@ohos/axios": "^2.1.1"
  46 + }
  47 + },
  48 + "wdPlayer@../wdPlayer": {
  49 + "name": "wdplayer",
  50 + "resolved": "../wdPlayer",
  51 + "registryType": "local",
  52 + "dependencies": {
  53 + "wdKit": "file:../../commons/wdKit"
  54 + }
  55 + },
  56 + "wdRouter@../../commons/wdRouter": {
  57 + "name": "wdrouter",
  58 + "resolved": "../../commons/wdRouter",
  59 + "registryType": "local",
  60 + "dependencies": {
  61 + "wdKit": "file:../wdKit",
  62 + "wdBean": "file:../../features/wdBean"
  63 + }
  64 + }
  65 + }
6 } 66 }
1 -export { DetailPlayLivePage } from './src/main/ets/pages/DetailPlayLivePage'  
  1 +export { DetailPlayLivePage } from './src/main/ets/pages/DetailPlayLivePage'
  2 +
  3 +export { DetailPlayVLivePage } from './src/main/ets/pages/DetailPlayVLivePage'
  1 +{
  2 + "meta": {
  3 + "stableOrder": true
  4 + },
  5 + "lockfileVersion": 3,
  6 + "ATTENTION": "THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.",
  7 + "specifiers": {
  8 + "@ohos/axios@^2.1.1": "@ohos/axios@2.2.0",
  9 + "@ohos/lottie@2.0.0": "@ohos/lottie@2.0.0",
  10 + "wdBean@../wdBean": "wdBean@../wdBean",
  11 + "wdComponent@../wdComponent": "wdComponent@../wdComponent",
  12 + "wdConstant@../../commons/wdConstant": "wdConstant@../../commons/wdConstant",
  13 + "wdDetailPlayApi@../wdDetailPlayApi": "wdDetailPlayApi@../wdDetailPlayApi",
  14 + "wdDetailPlayShortVideo@../wdDetailPlayShortVideo": "wdDetailPlayShortVideo@../wdDetailPlayShortVideo",
  15 + "wdJsBridge@../../commons/wdJsBridge": "wdJsBridge@../../commons/wdJsBridge",
  16 + "wdKit@../../commons/wdKit": "wdKit@../../commons/wdKit",
  17 + "wdLogin@../wdLogin": "wdLogin@../wdLogin",
  18 + "wdNetwork@../../commons/wdNetwork": "wdNetwork@../../commons/wdNetwork",
  19 + "wdPlayer@../wdPlayer": "wdPlayer@../wdPlayer",
  20 + "wdRouter@../../commons/wdRouter": "wdRouter@../../commons/wdRouter",
  21 + "wdWebComponent@../../commons/wdWebComponent": "wdWebComponent@../../commons/wdWebComponent"
  22 + },
  23 + "packages": {
  24 + "@ohos/axios@2.2.0": {
  25 + "name": "@ohos/axios",
  26 + "integrity": "sha512-v1QBWk6DfcN8wUW3D0ieFbHTR1taSI5cOgxp5l6B5cegXuNYhSc8ggKlAIXe6h/14LsfM+NW0ZGfSXcNEIM5yA==",
  27 + "resolved": "https://repo.harmonyos.com/ohpm/@ohos/axios/-/axios-2.2.0.har",
  28 + "registryType": "ohpm"
  29 + },
  30 + "@ohos/lottie@2.0.0": {
  31 + "name": "@ohos/lottie",
  32 + "integrity": "sha512-jFEFYfuqGO323aMiwtzHmDGRJI0qTxjZD2Lzbn+LxRdoHSfu5OVu22I8gVm5ej019tCw3WOk547NHZ2GuWiNSg==",
  33 + "resolved": "https://repo.harmonyos.com/ohpm/@ohos/lottie/-/lottie-2.0.0.har",
  34 + "registryType": "ohpm"
  35 + },
  36 + "wdBean@../wdBean": {
  37 + "name": "wdbean",
  38 + "resolved": "../wdBean",
  39 + "registryType": "local"
  40 + },
  41 + "wdComponent@../wdComponent": {
  42 + "name": "wdcomponent",
  43 + "resolved": "../wdComponent",
  44 + "registryType": "local",
  45 + "dependencies": {
  46 + "@ohos/lottie": "2.0.0",
  47 + "wdConstant": "file:../../commons/wdConstant",
  48 + "wdPlayer": "file:../../features/wdPlayer",
  49 + "wdLogin": "file:../../features/wdLogin",
  50 + "wdKit": "file:../../commons/wdKit",
  51 + "wdWebComponent": "file:../../commons/wdWebComponent",
  52 + "wdBean": "file:../../features/wdBean",
  53 + "wdDetailPlayShortVideo": "file:../../features/wdDetailPlayShortVideo",
  54 + "wdRouter": "file:../../commons/wdRouter",
  55 + "wdNetwork": "file:../../commons/wdNetwork",
  56 + "wdJsBridge": "file:../../commons/wdJsBridge"
  57 + }
  58 + },
  59 + "wdConstant@../../commons/wdConstant": {
  60 + "name": "wdconstant",
  61 + "resolved": "../../commons/wdConstant",
  62 + "registryType": "local"
  63 + },
  64 + "wdDetailPlayApi@../wdDetailPlayApi": {
  65 + "name": "wddetailplayapi",
  66 + "resolved": "../wdDetailPlayApi",
  67 + "registryType": "local",
  68 + "dependencies": {
  69 + "wdPlayer": "file:../../features/wdPlayer",
  70 + "wdKit": "file:../../commons/wdKit",
  71 + "wdBean": "file:../../features/wdBean",
  72 + "wdRouter": "file:../../commons/wdRouter",
  73 + "wdNetwork": "file:../../commons/wdNetwork"
  74 + }
  75 + },
  76 + "wdDetailPlayShortVideo@../wdDetailPlayShortVideo": {
  77 + "name": "wddetailplayshortvideo",
  78 + "resolved": "../wdDetailPlayShortVideo",
  79 + "registryType": "local",
  80 + "dependencies": {
  81 + "@ohos/lottie": "2.0.0",
  82 + "wdPlayer": "file:../../features/wdPlayer",
  83 + "wdKit": "file:../../commons/wdKit",
  84 + "wdBean": "file:../../features/wdBean",
  85 + "wdRouter": "file:../../commons/wdRouter",
  86 + "wdNetwork": "file:../../commons/wdNetwork",
  87 + "wdDetailPlayApi": "file:../../features/wdDetailPlayApi"
  88 + }
  89 + },
  90 + "wdJsBridge@../../commons/wdJsBridge": {
  91 + "name": "wdjsbridge",
  92 + "resolved": "../../commons/wdJsBridge",
  93 + "registryType": "local"
  94 + },
  95 + "wdKit@../../commons/wdKit": {
  96 + "name": "wdkit",
  97 + "resolved": "../../commons/wdKit",
  98 + "registryType": "local"
  99 + },
  100 + "wdLogin@../wdLogin": {
  101 + "name": "wdlogin",
  102 + "resolved": "../wdLogin",
  103 + "registryType": "local",
  104 + "dependencies": {
  105 + "wdConstant": "file:../../commons/wdConstant",
  106 + "wdKit": "file:../../commons/wdKit",
  107 + "wdWebComponent": "file:../../commons/wdWebComponent",
  108 + "wdBean": "file:../../features/wdBean",
  109 + "wdRouter": "file:../../commons/wdRouter",
  110 + "wdNetwork": "file:../../commons/wdNetwork"
  111 + }
  112 + },
  113 + "wdNetwork@../../commons/wdNetwork": {
  114 + "name": "wdnetwork",
  115 + "resolved": "../../commons/wdNetwork",
  116 + "registryType": "local",
  117 + "dependencies": {
  118 + "wdConstant": "file:../wdConstant",
  119 + "wdKit": "file:../wdKit",
  120 + "@ohos/axios": "^2.1.1"
  121 + }
  122 + },
  123 + "wdPlayer@../wdPlayer": {
  124 + "name": "wdplayer",
  125 + "resolved": "../wdPlayer",
  126 + "registryType": "local",
  127 + "dependencies": {
  128 + "wdKit": "file:../../commons/wdKit"
  129 + }
  130 + },
  131 + "wdRouter@../../commons/wdRouter": {
  132 + "name": "wdrouter",
  133 + "resolved": "../../commons/wdRouter",
  134 + "registryType": "local",
  135 + "dependencies": {
  136 + "wdKit": "file:../wdKit",
  137 + "wdBean": "file:../../features/wdBean"
  138 + }
  139 + },
  140 + "wdWebComponent@../../commons/wdWebComponent": {
  141 + "name": "wdwebcomponent",
  142 + "resolved": "../../commons/wdWebComponent",
  143 + "registryType": "local",
  144 + "dependencies": {
  145 + "wdConstant": "file:../wdConstant",
  146 + "wdKit": "file:../wdKit",
  147 + "wdJsBridge": "file:../wdJsBridge",
  148 + "wdBean": "file:../../features/wdBean",
  149 + "wdRouter": "file:../wdRouter"
  150 + }
  151 + }
  152 + }
  153 +}
  1 +import { BottomComponent } from '../widgets/details/BottomComponent';
  2 +import { TabComponent } from '../widgets/details/TabComponent';
  3 +import { TopPlayComponent } from '../widgets/details/video/TopPlayComponet';
  4 +
  5 +
  6 +@Component
  7 +export struct DetailPlayHLivePage {
  8 + aboutToAppear(): void {
  9 +
  10 + }
  11 +
  12 + build() {
  13 + Column() {
  14 + TopPlayComponent()
  15 + TabComponent()
  16 + BottomComponent()
  17 + }
  18 + .height('100%')
  19 + .width('100%')
  20 + }
  21 +
  22 + onPageShow(): void {
  23 +
  24 + }
  25 +
  26 + aboutToDisappear(): void {
  27 +
  28 + }
  29 +}
  1 +import { BottomComponent } from '../widgets/details/BottomComponent';
  2 +import { TopPlayComponent } from '../widgets/details/video/TopPlayComponet';
  3 +import { TopPlayVComponent } from '../widgets/details/video/TopPlayVComponet';
  4 +
  5 +
  6 +@Component
  7 +export struct DetailPlayVLivePage {
  8 + aboutToAppear(): void {
  9 +
  10 + }
  11 +
  12 + build() {
  13 + Column() {
  14 + TopPlayVComponent()
  15 + // TabComponent()
  16 + BottomComponent()
  17 + }
  18 + .height('100%')
  19 + .width('100%')
  20 + }
  21 +
  22 + onPageShow(): void {
  23 +
  24 + }
  25 +
  26 + aboutToDisappear(): void {
  27 +
  28 + }
  29 +}
  1 +import { LiveDetailsBean } from 'wdBean/Index';
  2 +import { WDPlayerController, WDPlayerRenderView } from 'wdPlayer/Index';
  3 +import { PlayUIComponent } from './PlayUIComponent';
  4 +
  5 +@Component
  6 +export struct TopPlayVComponent {
  7 + @Consume @Watch('updateData') liveDetailsBean: LiveDetailsBean
  8 + playerController: WDPlayerController = new WDPlayerController();
  9 +
  10 + aboutToAppear(): void {
  11 + this.playerController.onCanplay = () => {
  12 + this.playerController.play()
  13 + }
  14 + }
  15 +
  16 + updateData() {
  17 + //直播新闻-直播状态 wait待开播running直播中end已结束cancel已取消paused暂停
  18 + if (this.liveDetailsBean.liveInfo && this.liveDetailsBean.liveInfo.vlive.length > 0) {
  19 + let playUrl = ''
  20 + if (this.liveDetailsBean.liveInfo.liveState == 'running') {
  21 + playUrl = this.liveDetailsBean.liveInfo.vlive[0].liveUrl
  22 + } else if (this.liveDetailsBean.liveInfo.liveState == 'end') {
  23 + playUrl = this.liveDetailsBean.liveInfo.vlive[0].replayUri
  24 + }
  25 + this.playerController.firstPlay(playUrl);
  26 + }
  27 + }
  28 +
  29 + build() {
  30 + Stack() {
  31 + // https://developer.huawei.com/consumer/cn/doc/harmonyos-references/ts-universal-attributes-image-effect-0000001862607345
  32 + Image(this.liveDetailsBean.fullColumnImgUrls[0].url)
  33 + .height('100%')
  34 + .width('100%')
  35 + .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM])
  36 + .blur(100)
  37 +
  38 + WDPlayerRenderView({
  39 + playerController: this.playerController,
  40 + onLoad: async () => {
  41 + }
  42 + })// .height('100%')
  43 + .width('100%')// 扩展至所有非安全区域
  44 + .onClick(() => {
  45 + this.playerController.play()
  46 + })
  47 + // PlayUIComponent({ playerController: this.playerController })
  48 + }
  49 + // .height('100%')
  50 + .width('100%')
  51 + // 扩展至所有非安全区域
  52 + .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM])
  53 + }
  54 +
  55 + aboutToDisappear(): void {
  56 + this.playerController.pause()
  57 + }
  58 +}
1 { 1 {
2 - "lockfileVersion": 1, 2 + "meta": {
  3 + "stableOrder": true
  4 + },
  5 + "lockfileVersion": 3,
3 "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.",
4 - "specifiers": {},  
5 - "packages": {} 7 + "specifiers": {
  8 + "@ohos/axios@^2.1.1": "@ohos/axios@2.2.0",
  9 + "@ohos/lottie@2.0.0": "@ohos/lottie@2.0.0",
  10 + "wdBean@../wdBean": "wdBean@../wdBean",
  11 + "wdConstant@../../commons/wdConstant": "wdConstant@../../commons/wdConstant",
  12 + "wdDetailPlayApi@../wdDetailPlayApi": "wdDetailPlayApi@../wdDetailPlayApi",
  13 + "wdKit@../../commons/wdKit": "wdKit@../../commons/wdKit",
  14 + "wdNetwork@../../commons/wdNetwork": "wdNetwork@../../commons/wdNetwork",
  15 + "wdPlayer@../wdPlayer": "wdPlayer@../wdPlayer",
  16 + "wdRouter@../../commons/wdRouter": "wdRouter@../../commons/wdRouter"
  17 + },
  18 + "packages": {
  19 + "@ohos/axios@2.2.0": {
  20 + "name": "@ohos/axios",
  21 + "integrity": "sha512-v1QBWk6DfcN8wUW3D0ieFbHTR1taSI5cOgxp5l6B5cegXuNYhSc8ggKlAIXe6h/14LsfM+NW0ZGfSXcNEIM5yA==",
  22 + "resolved": "https://repo.harmonyos.com/ohpm/@ohos/axios/-/axios-2.2.0.har",
  23 + "registryType": "ohpm"
  24 + },
  25 + "@ohos/lottie@2.0.0": {
  26 + "name": "@ohos/lottie",
  27 + "integrity": "sha512-jFEFYfuqGO323aMiwtzHmDGRJI0qTxjZD2Lzbn+LxRdoHSfu5OVu22I8gVm5ej019tCw3WOk547NHZ2GuWiNSg==",
  28 + "resolved": "https://repo.harmonyos.com/ohpm/@ohos/lottie/-/lottie-2.0.0.har",
  29 + "registryType": "ohpm"
  30 + },
  31 + "wdBean@../wdBean": {
  32 + "name": "wdbean",
  33 + "resolved": "../wdBean",
  34 + "registryType": "local"
  35 + },
  36 + "wdConstant@../../commons/wdConstant": {
  37 + "name": "wdconstant",
  38 + "resolved": "../../commons/wdConstant",
  39 + "registryType": "local"
  40 + },
  41 + "wdDetailPlayApi@../wdDetailPlayApi": {
  42 + "name": "wddetailplayapi",
  43 + "resolved": "../wdDetailPlayApi",
  44 + "registryType": "local",
  45 + "dependencies": {
  46 + "wdPlayer": "file:../../features/wdPlayer",
  47 + "wdKit": "file:../../commons/wdKit",
  48 + "wdBean": "file:../../features/wdBean",
  49 + "wdRouter": "file:../../commons/wdRouter",
  50 + "wdNetwork": "file:../../commons/wdNetwork"
  51 + }
  52 + },
  53 + "wdKit@../../commons/wdKit": {
  54 + "name": "wdkit",
  55 + "resolved": "../../commons/wdKit",
  56 + "registryType": "local"
  57 + },
  58 + "wdNetwork@../../commons/wdNetwork": {
  59 + "name": "wdnetwork",
  60 + "resolved": "../../commons/wdNetwork",
  61 + "registryType": "local",
  62 + "dependencies": {
  63 + "wdConstant": "file:../wdConstant",
  64 + "wdKit": "file:../wdKit",
  65 + "@ohos/axios": "^2.1.1"
  66 + }
  67 + },
  68 + "wdPlayer@../wdPlayer": {
  69 + "name": "wdplayer",
  70 + "resolved": "../wdPlayer",
  71 + "registryType": "local",
  72 + "dependencies": {
  73 + "wdKit": "file:../../commons/wdKit"
  74 + }
  75 + },
  76 + "wdRouter@../../commons/wdRouter": {
  77 + "name": "wdrouter",
  78 + "resolved": "../../commons/wdRouter",
  79 + "registryType": "local",
  80 + "dependencies": {
  81 + "wdKit": "file:../wdKit",
  82 + "wdBean": "file:../../features/wdBean"
  83 + }
  84 + }
  85 + }
6 } 86 }
1 import mediaquery from '@ohos.mediaquery'; 1 import mediaquery from '@ohos.mediaquery';
2 import { ContentDetailDTO, InteractDataDTO } from 'wdBean'; 2 import { ContentDetailDTO, InteractDataDTO } from 'wdBean';
3 -import { WDPlayerController, WDPlayerRenderView } from 'wdPlayer'; 3 +import { PlayerConstants, WDPlayerController, WDPlayerRenderView } from 'wdPlayer';
4 import { ContentDetailRequest, devicePLSensorManager } from 'wdDetailPlayApi'; 4 import { ContentDetailRequest, devicePLSensorManager } from 'wdDetailPlayApi';
5 import { PlayControlViewContainer } from '../view/PlayControlViewContainer'; 5 import { PlayControlViewContainer } from '../view/PlayControlViewContainer';
6 import { PlayerDetailContainer } from '../view/PlayerDetailContainer'; 6 import { PlayerDetailContainer } from '../view/PlayerDetailContainer';
@@ -32,6 +32,19 @@ export struct DetailPlayShortVideoPage { @@ -32,6 +32,19 @@ export struct DetailPlayShortVideoPage {
32 @Provide videoLandScape?: number = 1; // 视频朝向, 横屏视频:1;竖屏视频:2 32 @Provide videoLandScape?: number = 1; // 视频朝向, 横屏视频:1;竖屏视频:2
33 @Provide newsStatusOfUser: batchLikeAndCollectResult | undefined = undefined // 点赞、收藏状态 33 @Provide newsStatusOfUser: batchLikeAndCollectResult | undefined = undefined // 点赞、收藏状态
34 @Provide followStatus: string = '0' // 关注状态 34 @Provide followStatus: string = '0' // 关注状态
  35 + @Link @Watch('switchVideoStatusChange') switchVideoStatus: boolean
  36 +
  37 + switchVideoStatusChange() {
  38 + if (this.switchVideoStatus) {
  39 + if (this.currentIndex === this.index && this.playerController.getStatus() === PlayerConstants.STATUS_PAUSE) {
  40 + this.playerController.play()
  41 + }
  42 + } else {
  43 + if (this.currentIndex === this.index && this.playerController.getStatus() === PlayerConstants.STATUS_START) {
  44 + this.playerController.pause()
  45 + }
  46 + }
  47 + }
35 48
36 currentIndexChange() { 49 currentIndexChange() {
37 if (this.currentIndex != this.index) { 50 if (this.currentIndex != this.index) {
@@ -166,6 +179,7 @@ export struct DetailPlayShortVideoPage { @@ -166,6 +179,7 @@ export struct DetailPlayShortVideoPage {
166 }) 179 })
167 .height('100%') 180 .height('100%')
168 .width('100%') 181 .width('100%')
  182 + .margin({ top: this.contentDetailData?.videoInfo[0]?.videoLandScape === 1 ? 218 : 0 })
169 .onClick(() => { 183 .onClick(() => {
170 console.error('WDPlayerRenderView=== onClick') 184 console.error('WDPlayerRenderView=== onClick')
171 this.playerController?.switchPlayOrPause(); 185 this.playerController?.switchPlayOrPause();
@@ -24,6 +24,7 @@ export struct DetailVideoListPage { @@ -24,6 +24,7 @@ export struct DetailVideoListPage {
24 @State currentIndex: number = 0 24 @State currentIndex: number = 0
25 @State interactDataList: InteractDataDTO[] = [] 25 @State interactDataList: InteractDataDTO[] = []
26 @State isFullScreen: boolean = false 26 @State isFullScreen: boolean = false
  27 + @State switchVideoStatus: boolean = false
27 28
28 async aboutToAppear(): Promise<void> { 29 async aboutToAppear(): Promise<void> {
29 30
@@ -157,6 +158,7 @@ export struct DetailVideoListPage { @@ -157,6 +158,7 @@ export struct DetailVideoListPage {
157 ForEach(this.data, (item: ContentDetailDTO, index: number) => { 158 ForEach(this.data, (item: ContentDetailDTO, index: number) => {
158 Column() { 159 Column() {
159 DetailPlayShortVideoPage({ 160 DetailPlayShortVideoPage({
  161 + switchVideoStatus: $switchVideoStatus,
160 contentDetailData: item, 162 contentDetailData: item,
161 currentIndex: this.currentIndex, 163 currentIndex: this.currentIndex,
162 index: index, 164 index: index,
@@ -34,14 +34,15 @@ export struct VideoChannelDetail { @@ -34,14 +34,15 @@ export struct VideoChannelDetail {
34 private channelStrategy: string = '1' // 频道策略 1-推荐;2-时间线 34 private channelStrategy: string = '1' // 频道策略 1-推荐;2-时间线
35 // private topicId?: string = '' // 专题id 35 // private topicId?: string = '' // 专题id
36 // private recommend?: string = '' // 0.非推荐,1.推荐; 36 // private recommend?: string = '' // 0.非推荐,1.推荐;
37 - @State @Watch('navIndexChange') bottomNavIndex: number = 0  
38 - @State @Watch('navIndexChange') topNavIndex: number = 0 37 + @Link @Watch('navIndexChange') bottomNavIndex: number
  38 + @Link @Watch('navIndexChange') topNavIndex: number
39 private swiperController: SwiperController = new SwiperController() 39 private swiperController: SwiperController = new SwiperController()
40 @Provide showComment: boolean = false 40 @Provide showComment: boolean = false
41 @State data: ContentDetailDTO[] = [] 41 @State data: ContentDetailDTO[] = []
42 @State currentIndex: number = 0 42 @State currentIndex: number = 0
43 @State interactDataList: InteractDataDTO[] = [] 43 @State interactDataList: InteractDataDTO[] = []
44 @State totalCount: number = 0 44 @State totalCount: number = 0
  45 + @State switchVideoStatus: boolean = false
45 46
46 /** 47 /**
47 * 监听视频频道激活或失活 48 * 监听视频频道激活或失活
@@ -49,30 +50,22 @@ export struct VideoChannelDetail { @@ -49,30 +50,22 @@ export struct VideoChannelDetail {
49 navIndexChange() { 50 navIndexChange() {
50 if (this.bottomNavIndex === 2 && this.topNavIndex === 0) { 51 if (this.bottomNavIndex === 2 && this.topNavIndex === 0) {
51 // 如果视频在暂停则播放视频 52 // 如果视频在暂停则播放视频
  53 + this.switchVideoStatus = true
52 } else { 54 } else {
53 // 如果视频在播放则暂停视频 55 // 如果视频在播放则暂停视频
  56 + this.switchVideoStatus = false
54 } 57 }
  58 +
55 } 59 }
56 60
57 async aboutToAppear(): Promise<void> { 61 async aboutToAppear(): Promise<void> {
58 - const windowStage = WindowModel.shared.getWindowStage() as window.WindowStage  
59 - const windowClass: window.Window = windowStage.getMainWindowSync();  
60 - windowClass.setWindowSystemBarProperties({  
61 - statusBarContentColor: '#ffffff',  
62 - })  
63 - console.error('aboutToAppear groupId', this.groupId)  
64 - console.error('aboutToAppear pageId', this.pageId)  
65 - console.error('aboutToAppear channelId', this.channelId) 62 + WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#ffffff', })
66 // 根据视频频道传参查询视频楼层信息 63 // 根据视频频道传参查询视频楼层信息
67 this.getRecCompInfo() 64 this.getRecCompInfo()
68 } 65 }
69 66
70 aboutToDisappear(): void { 67 aboutToDisappear(): void {
71 - const windowStage = WindowModel.shared.getWindowStage() as window.WindowStage  
72 - const windowClass: window.Window = windowStage.getMainWindowSync();  
73 - windowClass.setWindowSystemBarProperties({  
74 - statusBarContentColor: '#000000',  
75 - }) 68 + WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#000000', })
76 console.error('aboutToDisappear videoChanel') 69 console.error('aboutToDisappear videoChanel')
77 } 70 }
78 71
@@ -105,8 +98,7 @@ export struct VideoChannelDetail { @@ -105,8 +98,7 @@ export struct VideoChannelDetail {
105 } 98 }
106 99
107 await ContentDetailRequest.getRecCompInfo(params).then(res => { 100 await ContentDetailRequest.getRecCompInfo(params).then(res => {
108 - console.log('根据视频频道传参查询视频楼层信息', res.data?.totalCount)  
109 - console.log('根据视频频道传参查询视频楼层信息', JSON.stringify(res.data?.compList)) 101 + console.log('根据视频频道传参查询视频楼层信息totalCount', res.data?.totalCount + '')
110 102
111 this.totalCount = res.data?.totalCount || 0 103 this.totalCount = res.data?.totalCount || 0
112 const list1: batchContentDetailParams = { 104 const list1: batchContentDetailParams = {
@@ -136,8 +128,6 @@ export struct VideoChannelDetail { @@ -136,8 +128,6 @@ export struct VideoChannelDetail {
136 this.batchContentDetail(list1) 128 this.batchContentDetail(list1)
137 this.getContentInteract(list2) 129 this.getContentInteract(list2)
138 130
139 - }).catch((e: BusinessError) => {  
140 - console.error('eeeeeeeeeeeeee', e)  
141 }) 131 })
142 } 132 }
143 133
@@ -147,7 +137,7 @@ export struct VideoChannelDetail { @@ -147,7 +137,7 @@ export struct VideoChannelDetail {
147 async batchContentDetail(list: batchContentDetailParams) { 137 async batchContentDetail(list: batchContentDetailParams) {
148 if (list.contents.length > 0) { 138 if (list.contents.length > 0) {
149 await ContentDetailRequest.batchContentDetail(list).then(res => { 139 await ContentDetailRequest.batchContentDetail(list).then(res => {
150 - console.log('根据视频楼层信息批量查询视频列表', JSON.stringify(res.data)) 140 + console.log('根据视频楼层信息批量查询视频列表', res.data)
151 this.data = this.data.concat(res.data as []) 141 this.data = this.data.concat(res.data as [])
152 }) 142 })
153 } 143 }
@@ -160,7 +150,7 @@ export struct VideoChannelDetail { @@ -160,7 +150,7 @@ export struct VideoChannelDetail {
160 if (list.contentList.length > 0) { 150 if (list.contentList.length > 0) {
161 await ContentDetailRequest.getContentInteract(list).then(res => { 151 await ContentDetailRequest.getContentInteract(list).then(res => {
162 this.interactDataList = res.data || [] 152 this.interactDataList = res.data || []
163 - console.log('根据视频信息批量查询点赞、收藏状态', JSON.stringify(res)) 153 + console.log('根据视频信息批量查询点赞、收藏状态', res.data)
164 }) 154 })
165 } 155 }
166 } 156 }
@@ -171,6 +161,7 @@ export struct VideoChannelDetail { @@ -171,6 +161,7 @@ export struct VideoChannelDetail {
171 ForEach(this.data, (item: ContentDetailDTO, index: number) => { 161 ForEach(this.data, (item: ContentDetailDTO, index: number) => {
172 Column() { 162 Column() {
173 DetailPlayShortVideoPage({ 163 DetailPlayShortVideoPage({
  164 + switchVideoStatus: $switchVideoStatus,
174 contentDetailData: item, 165 contentDetailData: item,
175 currentIndex: this.currentIndex, 166 currentIndex: this.currentIndex,
176 index: index, 167 index: index,
@@ -48,7 +48,9 @@ export struct PlayerTitleComment { @@ -48,7 +48,9 @@ export struct PlayerTitleComment {
48 } 48 }
49 49
50 getName() { 50 getName() {
51 - return this.contentDetailData?.newsSourceName || this.contentDetailData?.editorName || '' 51 + // console.error(this.contentDetailData?.newsSourceName + '===========' + this.contentDetailData?.editorName)
  52 + // this.contentDetailData?.newsSourceName ||
  53 + return this.contentDetailData?.editorName || ''
52 } 54 }
53 55
54 getTitle() { 56 getTitle() {
1 { 1 {
2 - "lockfileVersion": 1, 2 + "meta": {
  3 + "stableOrder": true
  4 + },
  5 + "lockfileVersion": 3,
3 "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.",
4 - "specifiers": {},  
5 - "packages": {} 7 + "specifiers": {
  8 + "@ohos/axios@^2.1.1": "@ohos/axios@2.2.0",
  9 + "wdBean@../wdBean": "wdBean@../wdBean",
  10 + "wdConstant@../../commons/wdConstant": "wdConstant@../../commons/wdConstant",
  11 + "wdDetailPlayApi@../wdDetailPlayApi": "wdDetailPlayApi@../wdDetailPlayApi",
  12 + "wdKit@../../commons/wdKit": "wdKit@../../commons/wdKit",
  13 + "wdNetwork@../../commons/wdNetwork": "wdNetwork@../../commons/wdNetwork",
  14 + "wdPlayer@../wdPlayer": "wdPlayer@../wdPlayer",
  15 + "wdRouter@../../commons/wdRouter": "wdRouter@../../commons/wdRouter"
  16 + },
  17 + "packages": {
  18 + "@ohos/axios@2.2.0": {
  19 + "name": "@ohos/axios",
  20 + "integrity": "sha512-v1QBWk6DfcN8wUW3D0ieFbHTR1taSI5cOgxp5l6B5cegXuNYhSc8ggKlAIXe6h/14LsfM+NW0ZGfSXcNEIM5yA==",
  21 + "resolved": "https://repo.harmonyos.com/ohpm/@ohos/axios/-/axios-2.2.0.har",
  22 + "registryType": "ohpm"
  23 + },
  24 + "wdBean@../wdBean": {
  25 + "name": "wdbean",
  26 + "resolved": "../wdBean",
  27 + "registryType": "local"
  28 + },
  29 + "wdConstant@../../commons/wdConstant": {
  30 + "name": "wdconstant",
  31 + "resolved": "../../commons/wdConstant",
  32 + "registryType": "local"
  33 + },
  34 + "wdDetailPlayApi@../wdDetailPlayApi": {
  35 + "name": "wddetailplayapi",
  36 + "resolved": "../wdDetailPlayApi",
  37 + "registryType": "local",
  38 + "dependencies": {
  39 + "wdPlayer": "file:../../features/wdPlayer",
  40 + "wdKit": "file:../../commons/wdKit",
  41 + "wdBean": "file:../../features/wdBean",
  42 + "wdRouter": "file:../../commons/wdRouter",
  43 + "wdNetwork": "file:../../commons/wdNetwork"
  44 + }
  45 + },
  46 + "wdKit@../../commons/wdKit": {
  47 + "name": "wdkit",
  48 + "resolved": "../../commons/wdKit",
  49 + "registryType": "local"
  50 + },
  51 + "wdNetwork@../../commons/wdNetwork": {
  52 + "name": "wdnetwork",
  53 + "resolved": "../../commons/wdNetwork",
  54 + "registryType": "local",
  55 + "dependencies": {
  56 + "wdConstant": "file:../wdConstant",
  57 + "wdKit": "file:../wdKit",
  58 + "@ohos/axios": "^2.1.1"
  59 + }
  60 + },
  61 + "wdPlayer@../wdPlayer": {
  62 + "name": "wdplayer",
  63 + "resolved": "../wdPlayer",
  64 + "registryType": "local",
  65 + "dependencies": {
  66 + "wdKit": "file:../../commons/wdKit"
  67 + }
  68 + },
  69 + "wdRouter@../../commons/wdRouter": {
  70 + "name": "wdrouter",
  71 + "resolved": "../../commons/wdRouter",
  72 + "registryType": "local",
  73 + "dependencies": {
  74 + "wdKit": "file:../wdKit",
  75 + "wdBean": "file:../../features/wdBean"
  76 + }
  77 + }
  78 + }
6 } 79 }
1 { 1 {
2 - "lockfileVersion": 1, 2 + "meta": {
  3 + "stableOrder": true
  4 + },
  5 + "lockfileVersion": 3,
3 "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.",
4 - "specifiers": {},  
5 - "packages": {} 7 + "specifiers": {
  8 + "@ohos/axios@^2.1.1": "@ohos/axios@2.2.0",
  9 + "wdBean@../wdBean": "wdBean@../wdBean",
  10 + "wdConstant@../../commons/wdConstant": "wdConstant@../../commons/wdConstant",
  11 + "wdJsBridge@../../commons/wdJsBridge": "wdJsBridge@../../commons/wdJsBridge",
  12 + "wdKit@../../commons/wdKit": "wdKit@../../commons/wdKit",
  13 + "wdNetwork@../../commons/wdNetwork": "wdNetwork@../../commons/wdNetwork",
  14 + "wdRouter@../../commons/wdRouter": "wdRouter@../../commons/wdRouter",
  15 + "wdWebComponent@../../commons/wdWebComponent": "wdWebComponent@../../commons/wdWebComponent"
  16 + },
  17 + "packages": {
  18 + "@ohos/axios@2.2.0": {
  19 + "name": "@ohos/axios",
  20 + "integrity": "sha512-v1QBWk6DfcN8wUW3D0ieFbHTR1taSI5cOgxp5l6B5cegXuNYhSc8ggKlAIXe6h/14LsfM+NW0ZGfSXcNEIM5yA==",
  21 + "resolved": "https://repo.harmonyos.com/ohpm/@ohos/axios/-/axios-2.2.0.har",
  22 + "registryType": "ohpm"
  23 + },
  24 + "wdBean@../wdBean": {
  25 + "name": "wdbean",
  26 + "resolved": "../wdBean",
  27 + "registryType": "local"
  28 + },
  29 + "wdConstant@../../commons/wdConstant": {
  30 + "name": "wdconstant",
  31 + "resolved": "../../commons/wdConstant",
  32 + "registryType": "local"
  33 + },
  34 + "wdJsBridge@../../commons/wdJsBridge": {
  35 + "name": "wdjsbridge",
  36 + "resolved": "../../commons/wdJsBridge",
  37 + "registryType": "local"
  38 + },
  39 + "wdKit@../../commons/wdKit": {
  40 + "name": "wdkit",
  41 + "resolved": "../../commons/wdKit",
  42 + "registryType": "local"
  43 + },
  44 + "wdNetwork@../../commons/wdNetwork": {
  45 + "name": "wdnetwork",
  46 + "resolved": "../../commons/wdNetwork",
  47 + "registryType": "local",
  48 + "dependencies": {
  49 + "wdConstant": "file:../wdConstant",
  50 + "wdKit": "file:../wdKit",
  51 + "@ohos/axios": "^2.1.1"
  52 + }
  53 + },
  54 + "wdRouter@../../commons/wdRouter": {
  55 + "name": "wdrouter",
  56 + "resolved": "../../commons/wdRouter",
  57 + "registryType": "local",
  58 + "dependencies": {
  59 + "wdKit": "file:../wdKit",
  60 + "wdBean": "file:../../features/wdBean"
  61 + }
  62 + },
  63 + "wdWebComponent@../../commons/wdWebComponent": {
  64 + "name": "wdwebcomponent",
  65 + "resolved": "../../commons/wdWebComponent",
  66 + "registryType": "local",
  67 + "dependencies": {
  68 + "wdConstant": "file:../wdConstant",
  69 + "wdKit": "file:../wdKit",
  70 + "wdJsBridge": "file:../wdJsBridge",
  71 + "wdBean": "file:../../features/wdBean",
  72 + "wdRouter": "file:../wdRouter"
  73 + }
  74 + }
  75 + }
6 } 76 }
@@ -8,7 +8,7 @@ import { ErrorToastUtils, SPHelper } from 'wdKit' @@ -8,7 +8,7 @@ import { ErrorToastUtils, SPHelper } from 'wdKit'
8 import { WDRouterPage } from 'wdRouter/src/main/ets/router/WDRouterPage'; 8 import { WDRouterPage } from 'wdRouter/src/main/ets/router/WDRouterPage';
9 import { WDRouterRule } from 'wdRouter/src/main/ets/router/WDRouterRule'; 9 import { WDRouterRule } from 'wdRouter/src/main/ets/router/WDRouterRule';
10 import { Params } from '../../../../../../../commons/wdRouter/oh_modules/wdBean/src/main/ets/bean/content/Params' 10 import { Params } from '../../../../../../../commons/wdRouter/oh_modules/wdBean/src/main/ets/bean/content/Params'
11 - 11 +import {InterestsHobbiesModel} from '../../../../../../../products/phone/src/main/ets/pages/viewModel/InterestsHobbiesModel'
12 @Extend(Row) 12 @Extend(Row)
13 function otherStyle() { 13 function otherStyle() {
14 .backgroundImageSize(ImageSize.Cover) 14 .backgroundImageSize(ImageSize.Cover)
@@ -306,6 +306,10 @@ struct LoginPage { @@ -306,6 +306,10 @@ struct LoginPage {
306 if (this.checkCodePage) { 306 if (this.checkCodePage) {
307 this.loginViewModel.appLogin(this.phoneContent, 2, this.codeContent).then((data) => { 307 this.loginViewModel.appLogin(this.phoneContent, 2, this.codeContent).then((data) => {
308 Logger.debug(TAG, "requestLogin: " + data.jwtToken) 308 Logger.debug(TAG, "requestLogin: " + data.jwtToken)
  309 + ///同步兴趣tag
  310 + let interestsModel = new InterestsHobbiesModel()
  311 + interestsModel.updateInterests()
  312 +
309 router.back({ 313 router.back({
310 params: { userName: data.userName, 314 params: { userName: data.userName,
311 userId:data.id}, 315 userId:data.id},
@@ -319,6 +323,11 @@ struct LoginPage { @@ -319,6 +323,11 @@ struct LoginPage {
319 this.loginViewModel.appLoginByPassword(this.accountContent, 0, this.passwordContent, "").then((data) => { 323 this.loginViewModel.appLoginByPassword(this.accountContent, 0, this.passwordContent, "").then((data) => {
320 Logger.debug(TAG, "requestLogin: " + data.jwtToken) 324 Logger.debug(TAG, "requestLogin: " + data.jwtToken)
321 promptAction.showToast({ message: '登录成功' }) 325 promptAction.showToast({ message: '登录成功' })
  326 +
  327 + ///同步兴趣tag
  328 + let interestsModel = new InterestsHobbiesModel()
  329 + interestsModel.updateInterests()
  330 +
322 router.back({ 331 router.back({
323 params: { userName: data.userName, 332 params: { userName: data.userName,
324 userId:data.id}, 333 userId:data.id},
@@ -43,6 +43,10 @@ struct LoginProtocolWebview { @@ -43,6 +43,10 @@ struct LoginProtocolWebview {
43 .width(24) 43 .width(24)
44 .aspectRatio(1) 44 .aspectRatio(1)
45 .onClick(() => { 45 .onClick(() => {
  46 + if(this.webviewController.accessBackward()){
  47 + this.webviewController.backward()
  48 + return
  49 + }
46 router.back(); 50 router.back();
47 }).margin({ left: 16 }) 51 }).margin({ left: 16 })
48 Text() 52 Text()
1 { 1 {
2 - "lockfileVersion": 1, 2 + "meta": {
  3 + "stableOrder": true
  4 + },
  5 + "lockfileVersion": 3,
3 "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.",
4 - "specifiers": {},  
5 - "packages": {} 7 + "specifiers": {
  8 + "wdKit@../../commons/wdKit": "wdKit@../../commons/wdKit"
  9 + },
  10 + "packages": {
  11 + "wdKit@../../commons/wdKit": {
  12 + "name": "wdkit",
  13 + "resolved": "../../commons/wdKit",
  14 + "registryType": "local"
  15 + }
  16 + }
6 } 17 }
@@ -41,16 +41,15 @@ class MGPlayRenderViewIns { @@ -41,16 +41,15 @@ class MGPlayRenderViewIns {
41 export struct WDPlayerRenderView { 41 export struct WDPlayerRenderView {
42 private playerController?: WDPlayerController; 42 private playerController?: WDPlayerController;
43 private xComponentController: XComponentController = new XComponentController(); 43 private xComponentController: XComponentController = new XComponentController();
  44 + private insId: string = "WDPlayRenderView" + insIndex;
44 onLoad?: ((event?: object) => void); 45 onLoad?: ((event?: object) => void);
45 - videoWidth: number = 0  
46 - videoHeight: number = 0 46 + @State videoWidth: number = 0
  47 + @State videoHeight: number = 0
47 @State selfSize: Size = new Size('100%', '100%'); 48 @State selfSize: Size = new Size('100%', '100%');
48 - private insId: string = "WDPlayRenderView" + insIndex;  
49 49
50 aboutToAppear() { 50 aboutToAppear() {
51 MGPlayRenderViewIns.add(); 51 MGPlayRenderViewIns.add();
52 52
53 - console.log('playerController', this.playerController)  
54 insIndex++; 53 insIndex++;
55 if (!this.playerController) { 54 if (!this.playerController) {
56 return 55 return
@@ -80,9 +79,7 @@ export struct WDPlayerRenderView { @@ -80,9 +79,7 @@ export struct WDPlayerRenderView {
80 }) 79 })
81 .onLoad(async (event) => { 80 .onLoad(async (event) => {
82 Logger.info(TAG, 'onLoad') 81 Logger.info(TAG, 'onLoad')
83 - let surfaceId = this.xComponentController.getXComponentSurfaceId()  
84 - console.log('surfaceId===', surfaceId)  
85 - console.log('insId===', this.insId) 82 + // const surfaceId = this.xComponentController.getXComponentSurfaceId()
86 this.xComponentController.setXComponentSurfaceSize({ 83 this.xComponentController.setXComponentSurfaceSize({
87 surfaceWidth: 1920, 84 surfaceWidth: 1920,
88 surfaceHeight: 1080 85 surfaceHeight: 1080
@@ -94,27 +91,14 @@ export struct WDPlayerRenderView { @@ -94,27 +91,14 @@ export struct WDPlayerRenderView {
94 }) 91 })
95 .width(this.selfSize.width) 92 .width(this.selfSize.width)
96 .height(this.selfSize.height) 93 .height(this.selfSize.height)
97 - .margin({ top: this.getPlayerMarginTop() })  
98 } 94 }
99 .id(this.insId) 95 .id(this.insId)
100 .onAreaChange(() => { 96 .onAreaChange(() => {
101 // this.updateLayout() 97 // this.updateLayout()
102 }) 98 })
103 .backgroundColor("#000000") 99 .backgroundColor("#000000")
104 - .alignItems(VerticalAlign.Center)  
105 - .justifyContent(FlexAlign.Center)  
106 - .alignItems(this.selfSize.width === '100%' ? VerticalAlign.Top : VerticalAlign.Center)  
107 - .height('100%')  
108 - .width('100%')  
109 } 100 }
110 -  
111 - /**  
112 - * 横屏播放器非居中展示  
113 - */  
114 - getPlayerMarginTop() {  
115 - return this.selfSize.width === '100%' && this.videoWidth > this.videoHeight ? 218 : 0  
116 - }  
117 - 101 +
118 updateLayout() { 102 updateLayout() {
119 let info = componentUtils.getRectangleById(this.insId); 103 let info = componentUtils.getRectangleById(this.insId);
120 if (info.size.width > 0 && info.size.height > 0 && this.videoHeight > 0 && this.videoWidth > 0) { 104 if (info.size.width > 0 && info.size.height > 0 && this.videoHeight > 0 && this.videoWidth > 0) {
1 { 1 {
2 - "lockfileVersion": 1, 2 + "meta": {
  3 + "stableOrder": true
  4 + },
  5 + "lockfileVersion": 3,
3 "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.",
4 "specifiers": { 7 "specifiers": {
5 "@ohos/hypium@1.0.16": "@ohos/hypium@1.0.16" 8 "@ohos/hypium@1.0.16": "@ohos/hypium@1.0.16"
6 }, 9 },
7 "packages": { 10 "packages": {
8 "@ohos/hypium@1.0.16": { 11 "@ohos/hypium@1.0.16": {
  12 + "name": "@ohos/hypium",
  13 + "integrity": "sha512-PC3jpwKERg68V+4dmKU+SLjNps9i5JcQH57rQriaTsh62NBgVZs4SceMmNOtrIOyldbEJ5mXSwoZwiG/nkRmTw==",
9 "resolved": "https://repo.harmonyos.com/ohpm/@ohos/hypium/-/hypium-1.0.16.har", 14 "resolved": "https://repo.harmonyos.com/ohpm/@ohos/hypium/-/hypium-1.0.16.har",
10 - "integrity": "sha512-PC3jpwKERg68V+4dmKU+SLjNps9i5JcQH57rQriaTsh62NBgVZs4SceMmNOtrIOyldbEJ5mXSwoZwiG/nkRmTw==" 15 + "registryType": "ohpm"
11 } 16 }
12 } 17 }
13 } 18 }
1 { 1 {
2 - "lockfileVersion": 1, 2 + "meta": {
  3 + "stableOrder": true
  4 + },
  5 + "lockfileVersion": 3,
3 "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.",
4 - "specifiers": {},  
5 - "packages": {} 7 + "specifiers": {
  8 + "@ohos/axios@^2.1.1": "@ohos/axios@2.2.0",
  9 + "@ohos/lottie@2.0.0": "@ohos/lottie@2.0.0",
  10 + "wdBean@../../features/wdBean": "wdBean@../../features/wdBean",
  11 + "wdComponent@../../features/wdComponent": "wdComponent@../../features/wdComponent",
  12 + "wdConstant@../../commons/wdConstant": "wdConstant@../../commons/wdConstant",
  13 + "wdDetailPlayApi@../../features/wdDetailPlayApi": "wdDetailPlayApi@../../features/wdDetailPlayApi",
  14 + "wdDetailPlayShortVideo@../../features/wdDetailPlayShortVideo": "wdDetailPlayShortVideo@../../features/wdDetailPlayShortVideo",
  15 + "wdJsBridge@../../commons/wdJsBridge": "wdJsBridge@../../commons/wdJsBridge",
  16 + "wdKit@../../commons/wdKit": "wdKit@../../commons/wdKit",
  17 + "wdLogin@../../features/wdLogin": "wdLogin@../../features/wdLogin",
  18 + "wdNetwork@../../commons/wdNetwork": "wdNetwork@../../commons/wdNetwork",
  19 + "wdPlayer@../../features/wdPlayer": "wdPlayer@../../features/wdPlayer",
  20 + "wdRouter@../../commons/wdRouter": "wdRouter@../../commons/wdRouter",
  21 + "wdWebComponent@../../commons/wdWebComponent": "wdWebComponent@../../commons/wdWebComponent"
  22 + },
  23 + "packages": {
  24 + "@ohos/axios@2.2.0": {
  25 + "name": "@ohos/axios",
  26 + "integrity": "sha512-v1QBWk6DfcN8wUW3D0ieFbHTR1taSI5cOgxp5l6B5cegXuNYhSc8ggKlAIXe6h/14LsfM+NW0ZGfSXcNEIM5yA==",
  27 + "resolved": "https://repo.harmonyos.com/ohpm/@ohos/axios/-/axios-2.2.0.har",
  28 + "registryType": "ohpm"
  29 + },
  30 + "@ohos/lottie@2.0.0": {
  31 + "name": "@ohos/lottie",
  32 + "integrity": "sha512-jFEFYfuqGO323aMiwtzHmDGRJI0qTxjZD2Lzbn+LxRdoHSfu5OVu22I8gVm5ej019tCw3WOk547NHZ2GuWiNSg==",
  33 + "resolved": "https://repo.harmonyos.com/ohpm/@ohos/lottie/-/lottie-2.0.0.har",
  34 + "registryType": "ohpm"
  35 + },
  36 + "wdBean@../../features/wdBean": {
  37 + "name": "wdbean",
  38 + "resolved": "../../features/wdBean",
  39 + "registryType": "local"
  40 + },
  41 + "wdComponent@../../features/wdComponent": {
  42 + "name": "wdcomponent",
  43 + "resolved": "../../features/wdComponent",
  44 + "registryType": "local",
  45 + "dependencies": {
  46 + "@ohos/lottie": "2.0.0",
  47 + "wdConstant": "file:../../commons/wdConstant",
  48 + "wdPlayer": "file:../../features/wdPlayer",
  49 + "wdLogin": "file:../../features/wdLogin",
  50 + "wdKit": "file:../../commons/wdKit",
  51 + "wdWebComponent": "file:../../commons/wdWebComponent",
  52 + "wdBean": "file:../../features/wdBean",
  53 + "wdDetailPlayShortVideo": "file:../../features/wdDetailPlayShortVideo",
  54 + "wdRouter": "file:../../commons/wdRouter",
  55 + "wdNetwork": "file:../../commons/wdNetwork",
  56 + "wdJsBridge": "file:../../commons/wdJsBridge"
  57 + }
  58 + },
  59 + "wdConstant@../../commons/wdConstant": {
  60 + "name": "wdconstant",
  61 + "resolved": "../../commons/wdConstant",
  62 + "registryType": "local"
  63 + },
  64 + "wdDetailPlayApi@../../features/wdDetailPlayApi": {
  65 + "name": "wddetailplayapi",
  66 + "resolved": "../../features/wdDetailPlayApi",
  67 + "registryType": "local",
  68 + "dependencies": {
  69 + "wdPlayer": "file:../../features/wdPlayer",
  70 + "wdKit": "file:../../commons/wdKit",
  71 + "wdBean": "file:../../features/wdBean",
  72 + "wdRouter": "file:../../commons/wdRouter",
  73 + "wdNetwork": "file:../../commons/wdNetwork"
  74 + }
  75 + },
  76 + "wdDetailPlayShortVideo@../../features/wdDetailPlayShortVideo": {
  77 + "name": "wddetailplayshortvideo",
  78 + "resolved": "../../features/wdDetailPlayShortVideo",
  79 + "registryType": "local",
  80 + "dependencies": {
  81 + "@ohos/lottie": "2.0.0",
  82 + "wdPlayer": "file:../../features/wdPlayer",
  83 + "wdKit": "file:../../commons/wdKit",
  84 + "wdBean": "file:../../features/wdBean",
  85 + "wdRouter": "file:../../commons/wdRouter",
  86 + "wdNetwork": "file:../../commons/wdNetwork",
  87 + "wdDetailPlayApi": "file:../../features/wdDetailPlayApi"
  88 + }
  89 + },
  90 + "wdJsBridge@../../commons/wdJsBridge": {
  91 + "name": "wdjsbridge",
  92 + "resolved": "../../commons/wdJsBridge",
  93 + "registryType": "local"
  94 + },
  95 + "wdKit@../../commons/wdKit": {
  96 + "name": "wdkit",
  97 + "resolved": "../../commons/wdKit",
  98 + "registryType": "local"
  99 + },
  100 + "wdLogin@../../features/wdLogin": {
  101 + "name": "wdlogin",
  102 + "resolved": "../../features/wdLogin",
  103 + "registryType": "local",
  104 + "dependencies": {
  105 + "wdConstant": "file:../../commons/wdConstant",
  106 + "wdKit": "file:../../commons/wdKit",
  107 + "wdWebComponent": "file:../../commons/wdWebComponent",
  108 + "wdBean": "file:../../features/wdBean",
  109 + "wdRouter": "file:../../commons/wdRouter",
  110 + "wdNetwork": "file:../../commons/wdNetwork"
  111 + }
  112 + },
  113 + "wdNetwork@../../commons/wdNetwork": {
  114 + "name": "wdnetwork",
  115 + "resolved": "../../commons/wdNetwork",
  116 + "registryType": "local",
  117 + "dependencies": {
  118 + "wdConstant": "file:../wdConstant",
  119 + "wdKit": "file:../wdKit",
  120 + "@ohos/axios": "^2.1.1"
  121 + }
  122 + },
  123 + "wdPlayer@../../features/wdPlayer": {
  124 + "name": "wdplayer",
  125 + "resolved": "../../features/wdPlayer",
  126 + "registryType": "local",
  127 + "dependencies": {
  128 + "wdKit": "file:../../commons/wdKit"
  129 + }
  130 + },
  131 + "wdRouter@../../commons/wdRouter": {
  132 + "name": "wdrouter",
  133 + "resolved": "../../commons/wdRouter",
  134 + "registryType": "local",
  135 + "dependencies": {
  136 + "wdKit": "file:../wdKit",
  137 + "wdBean": "file:../../features/wdBean"
  138 + }
  139 + },
  140 + "wdWebComponent@../../commons/wdWebComponent": {
  141 + "name": "wdwebcomponent",
  142 + "resolved": "../../commons/wdWebComponent",
  143 + "registryType": "local",
  144 + "dependencies": {
  145 + "wdConstant": "file:../wdConstant",
  146 + "wdKit": "file:../wdKit",
  147 + "wdJsBridge": "file:../wdJsBridge",
  148 + "wdBean": "file:../../features/wdBean",
  149 + "wdRouter": "file:../wdRouter"
  150 + }
  151 + }
  152 + }
6 } 153 }
1 import { BottomNavigationComponent, LogoutViewModel} from 'wdComponent'; 1 import { BottomNavigationComponent, LogoutViewModel} from 'wdComponent';
2 import { BreakpointConstants } from 'wdConstant'; 2 import { BreakpointConstants } from 'wdConstant';
3 3
4 -import { BreakpointSystem, EmitterEventId, EmitterUtils, Logger } from 'wdKit'; 4 +import { BreakpointSystem, EmitterEventId, EmitterUtils, HWLocationUtils, Logger } from 'wdKit';
5 import router from '@ohos.router'; 5 import router from '@ohos.router';
6 import { promptAction } from '@kit.ArkUI'; 6 import { promptAction } from '@kit.ArkUI';
7 7
@@ -21,6 +21,7 @@ struct MainPage { @@ -21,6 +21,7 @@ struct MainPage {
21 } 21 }
22 22
23 aboutToAppear() { 23 aboutToAppear() {
  24 + HWLocationUtils.startLocationService()
24 this.breakpointSystem.register() 25 this.breakpointSystem.register()
25 Logger.info(TAG, `aboutToAppear `); 26 Logger.info(TAG, `aboutToAppear `);
26 EmitterUtils.receiveEvent(EmitterEventId.FORCE_USER_LOGIN_OUT, () => { 27 EmitterUtils.receiveEvent(EmitterEventId.FORCE_USER_LOGIN_OUT, () => {
1 import {InterestsHobbiesModel, InterestsList} from '../viewModel/InterestsHobbiesModel' 1 import {InterestsHobbiesModel, InterestsList} from '../viewModel/InterestsHobbiesModel'
2 import { WDRouterRule } from 'wdRouter'; 2 import { WDRouterRule } from 'wdRouter';
3 import { WDRouterPage } from 'wdRouter'; 3 import { WDRouterPage } from 'wdRouter';
  4 +import { SPHelper } from 'wdKit/Index';
  5 +import { SpConstants } from 'wdConstant/Index';
4 6
5 @Entry 7 @Entry
6 @Component 8 @Component
@@ -121,6 +123,7 @@ struct LaunchInterestsHobbiesPage { @@ -121,6 +123,7 @@ struct LaunchInterestsHobbiesPage {
121 .width('662lpx') 123 .width('662lpx')
122 .height('84lpx') 124 .height('84lpx')
123 .onClick(()=>{ 125 .onClick(()=>{
  126 + this.saveTagIds()
124 //跳转首页 127 //跳转首页
125 WDRouterRule.jumpWithReplacePage(WDRouterPage.mainPage) 128 WDRouterRule.jumpWithReplacePage(WDRouterPage.mainPage)
126 }) 129 })
@@ -149,4 +152,15 @@ struct LaunchInterestsHobbiesPage { @@ -149,4 +152,15 @@ struct LaunchInterestsHobbiesPage {
149 }) 152 })
150 } 153 }
151 154
  155 + saveTagIds(){
  156 + let tags: string = ''
  157 + if (this.interestsArray.filter(item => item.choose).length > 0) {
  158 + let array = this.interestsArray.filter(item => item.choose)
  159 + for (let index = 0; index < array.length; index++) {
  160 + const element = array[index];
  161 + tags = tags.length === 0 ? element.id.toString() : tags + ',' + element.id.toString()
  162 + }
  163 + }
  164 + SPHelper.default.saveSync(SpConstants.PUBLICVISUTORMODE_INTERESTTAGS,tags)
  165 + }
152 } 166 }
@@ -3,6 +3,7 @@ import { HttpRequest } from 'wdNetwork/src/main/ets/http/HttpRequest'; @@ -3,6 +3,7 @@ import { HttpRequest } from 'wdNetwork/src/main/ets/http/HttpRequest';
3 import { HttpUrlUtils, ResponseDTO } from 'wdNetwork/Index'; 3 import { HttpUrlUtils, ResponseDTO } from 'wdNetwork/Index';
4 import { Logger, SPHelper } from 'wdKit/Index'; 4 import { Logger, SPHelper } from 'wdKit/Index';
5 import data from '@ohos.telephony.data'; 5 import data from '@ohos.telephony.data';
  6 +import { SpConstants } from 'wdConstant/Index';
6 7
7 8
8 export interface InterestsBean { 9 export interface InterestsBean {
@@ -60,9 +61,23 @@ export class InterestsHobbiesModel { @@ -60,9 +61,23 @@ export class InterestsHobbiesModel {
60 fail(error.message) 61 fail(error.message)
61 }) 62 })
62 }) 63 })
63 -  
64 -  
65 } 64 }
66 65
67 - 66 + updateInterests(){
  67 + let tags = SPHelper.default.getSync(SpConstants.PUBLICVISUTORMODE_INTERESTTAGS,'') as string
  68 + if (tags.length === 0) return
  69 + let bean: Record<string, string> = {};
  70 + bean['tagIds'] = tags
  71 + let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();
  72 + return new Promise<ResponseDTO>((success, fail) => {
  73 + HttpRequest.post<ResponseDTO>(HttpUrlUtils.getUpdateInterestsUrl(),bean,headers).then((data: ResponseDTO) => {
  74 + if (data.code == 0) {
  75 + Logger.info('InterestsHobbiesModel','updateInterests','更新兴趣成功')
  76 + SPHelper.default.deleteSync(SpConstants.PUBLICVISUTORMODE_INTERESTTAGS)
  77 + }
  78 + }, (error: Error) => {
  79 + fail(error.message)
  80 + })
  81 + })
  82 + }
68 } 83 }
@@ -10,7 +10,7 @@ const TAG = 'DefaultWebPage'; @@ -10,7 +10,7 @@ const TAG = 'DefaultWebPage';
10 struct DefaultWebPage { 10 struct DefaultWebPage {
11 private url?: string; 11 private url?: string;
12 @State reload: number = 0; 12 @State reload: number = 0;
13 - 13 + @State isPageEnd : boolean = false
14 aboutToAppear() { 14 aboutToAppear() {
15 let action: Action = router.getParams() as Action 15 let action: Action = router.getParams() as Action
16 if (action) { 16 if (action) {
@@ -32,7 +32,8 @@ struct DefaultWebPage { @@ -32,7 +32,8 @@ struct DefaultWebPage {
32 WdWebComponent({ 32 WdWebComponent({
33 webUrl: this.url, 33 webUrl: this.url,
34 backVisibility: false, 34 backVisibility: false,
35 - reload: this.reload 35 + reload: this.reload,
  36 + isPageEnd:this.isPageEnd
36 }) 37 })
37 } 38 }
38 } 39 }