liyubing

Merge remote-tracking branch 'origin/main'

# Conflicts:
#	sight_harmony/features/wdBean/src/main/ets/bean/component/CompDTO.ets
#	sight_harmony/features/wdComponent/src/main/ets/components/CompParser.ets
#	sight_harmony/features/wdComponent/src/main/ets/viewmodel/PageHelper.ets
Showing 82 changed files with 1361 additions and 874 deletions

Too many changes to show.

To preserve performance only 82 of 82+ files are displayed.

@@ -34,6 +34,7 @@ export class SpConstants{ @@ -34,6 +34,7 @@ export class SpConstants{
34 //定位相关 34 //定位相关
35 static LOCATION_CITY_NAME = "location_city_name" //定位 35 static LOCATION_CITY_NAME = "location_city_name" //定位
36 static LOCATION_CITY_CODE = "location_city_code" //定位 36 static LOCATION_CITY_CODE = "location_city_code" //定位
  37 + static LOCATION_PERMISSION_REFUSE = "location_permission_refuse" //定位
37 38
38 //启动页数据存储key 39 //启动页数据存储key
39 static APP_LAUNCH_PAGE_DATA_MODEL = 'app_launch_page_data_model' 40 static APP_LAUNCH_PAGE_DATA_MODEL = 'app_launch_page_data_model'
1 import { Action } from './Action'; 1 import { Action } from './Action';
  2 +
2 interface dataObject { 3 interface dataObject {
3 // dataSource: 4 // dataSource:
4 // 1、图文详情数据 5 // 1、图文详情数据
@@ -17,7 +18,11 @@ interface dataObject { @@ -17,7 +18,11 @@ interface dataObject {
17 webViewHeight?: string 18 webViewHeight?: string
18 dataJson?: string 19 dataJson?: string
19 appInnerLink?: string 20 appInnerLink?: string
  21 + method?: string
  22 + url?: string
  23 + parameters?: object
20 } 24 }
  25 +
21 /** 26 /**
22 * 消息Message 27 * 消息Message
23 */ 28 */
@@ -10,5 +10,7 @@ export enum EmitterEventId { @@ -10,5 +10,7 @@ export enum EmitterEventId {
10 NETWORK_DISCONNECTED = 3, 10 NETWORK_DISCONNECTED = 3,
11 // 跳转首页指定频道,事件id 11 // 跳转首页指定频道,事件id
12 JUMP_HOME_CHANNEL = 4, 12 JUMP_HOME_CHANNEL = 4,
  13 +
  14 + LOCATION = 5
13 } 15 }
14 16
1 export { ResponseDTO } from "./src/main/ets/bean/ResponseDTO" 1 export { ResponseDTO } from "./src/main/ets/bean/ResponseDTO"
2 2
  3 +export { ResposeError } from "./src/main/ets/bean/ResposeError"
  4 +
3 export { HttpRequest as WDHttp } from "./src/main/ets/http/HttpRequest" 5 export { HttpRequest as WDHttp } from "./src/main/ets/http/HttpRequest"
4 6
5 export { HttpUrlUtils } from "./src/main/ets/http/HttpUrlUtils" 7 export { HttpUrlUtils } from "./src/main/ets/http/HttpUrlUtils"
  1 +/**
  2 + * 接口返回错误数据封装
  3 + */
  4 +export class ResposeError {
  5 + code: number = -1;
  6 + message: string = '';
  7 +
  8 + static buildError(message: string, code?: number): ResposeError {
  9 + let error = new ResposeError()
  10 + error.message = message
  11 + if (code) {
  12 + error.code = code
  13 + }
  14 + return error;
  15 + }
  16 +}
@@ -6,6 +6,7 @@ import axios, { @@ -6,6 +6,7 @@ import axios, {
6 InternalAxiosRequestConfig 6 InternalAxiosRequestConfig
7 } from '@ohos/axios'; 7 } from '@ohos/axios';
8 import { Logger } from 'wdKit/Index'; 8 import { Logger } from 'wdKit/Index';
  9 +import { ResposeError } from '../bean/ResposeError';
9 10
10 // import type ResponseDTO from '../models/ResponseDTO'; 11 // import type ResponseDTO from '../models/ResponseDTO';
11 12
@@ -99,17 +100,16 @@ instance.interceptors.response.use(// 响应拦截器response类型就是Axios.r @@ -99,17 +100,16 @@ instance.interceptors.response.use(// 响应拦截器response类型就是Axios.r
99 }, 100 },
100 (error: AxiosError) => { 101 (error: AxiosError) => {
101 // 异常响应 102 // 异常响应
102 - // console.log('全局响应失败拦截')  
103 - // console.log(error.request)  
104 - // console.log(error.response) 103 + // 429-流量超标;403-临时token;406-token过期,强制下线
105 // 这里用来处理http常见错误,进行全局提示 104 // 这里用来处理http常见错误,进行全局提示
  105 + let errorBean = new ResposeError()
106 if (error != null && error.response != null) { 106 if (error != null && error.response != null) {
107 let message = buildErrorMsg(error.response.status); 107 let message = buildErrorMsg(error.response.status);
108 // 错误消息可以使用全局弹框展示出来 108 // 错误消息可以使用全局弹框展示出来
109 console.log(`httpStatus:${error.response?.status}-${message},请检查网络或联系管理员!`) 109 console.log(`httpStatus:${error.response?.status}-${message},请检查网络或联系管理员!`)
  110 + errorBean = buildError(error.response.status)
110 } 111 }
111 -  
112 - return Promise.reject(error); 112 + return Promise.reject(errorBean);
113 } 113 }
114 ); 114 );
115 115
@@ -161,3 +161,9 @@ function buildErrorMsg(httpStatus: number): string { @@ -161,3 +161,9 @@ function buildErrorMsg(httpStatus: number): string {
161 } 161 }
162 return message; 162 return message;
163 } 163 }
  164 +
  165 +function buildError(httpStatus: number): ResposeError {
  166 + let message = buildErrorMsg(httpStatus);
  167 + let error: ResposeError = ResposeError.buildError(message, httpStatus)
  168 + return error;
  169 +}
@@ -4,6 +4,7 @@ import HashMap from '@ohos.util.HashMap'; @@ -4,6 +4,7 @@ import HashMap from '@ohos.util.HashMap';
4 import { ResponseDTO } from '../bean/ResponseDTO'; 4 import { ResponseDTO } from '../bean/ResponseDTO';
5 import { HttpUrlUtils, WDHttp } from '../../../../Index'; 5 import { HttpUrlUtils, WDHttp } from '../../../../Index';
6 import { RefreshTokenRes } from '../bean/RefreshTokenRes'; 6 import { RefreshTokenRes } from '../bean/RefreshTokenRes';
  7 +import { ResposeError } from '../bean/ResposeError';
7 8
8 const TAG: string = 'HttpBizUtil' 9 const TAG: string = 'HttpBizUtil'
9 10
@@ -20,14 +21,12 @@ export class HttpBizUtil { @@ -20,14 +21,12 @@ export class HttpBizUtil {
20 * @returns 返回值 21 * @returns 返回值
21 */ 22 */
22 static get<T = ResponseDTO<string>>(url: string, headers?: HashMap<string, string>): Promise<T> { 23 static get<T = ResponseDTO<string>>(url: string, headers?: HashMap<string, string>): Promise<T> {
23 - return new Promise<T>((success, debug) => { 24 + return new Promise<T>((success, error) => {
24 WDHttp.get<T>(url, headers).then((originalRes: T) => { 25 WDHttp.get<T>(url, headers).then((originalRes: T) => {
25 - try {  
26 - let resDTO = originalRes as ResponseDTO  
27 - Logger.debug(TAG, 'get: ' + resDTO.code)  
28 - Logger.debug(TAG, 'get: ' + resDTO.message) 26 + success(originalRes)
  27 + }).catch((res: ResposeError) => {
29 // 403:临时token;406:强制下线、封禁、清空登录信息还要跳转登录页面 28 // 403:临时token;406:强制下线、封禁、清空登录信息还要跳转登录页面
30 - if (resDTO.code == 403 || resDTO.code == 406) { 29 + if (res.code == 403 || res.code == 406) {
31 HttpBizUtil.refreshToken().then((token: string) => { 30 HttpBizUtil.refreshToken().then((token: string) => {
32 if (headers) { 31 if (headers) {
33 headers.replace('RMRB-X-TOKEN', token) 32 headers.replace('RMRB-X-TOKEN', token)
@@ -39,18 +38,14 @@ export class HttpBizUtil { @@ -39,18 +38,14 @@ export class HttpBizUtil {
39 Logger.debug(TAG, 'get again: ' + againResDTO) 38 Logger.debug(TAG, 'get again: ' + againResDTO)
40 success(againResDTO) 39 success(againResDTO)
41 }).catch((res: object) => { 40 }).catch((res: object) => {
42 - debug(res) 41 + error(ResposeError.buildError(JSON.stringify(res)))
43 }) 42 })
44 }); 43 });
45 } else { 44 } else {
46 - success(originalRes)  
47 - }  
48 - } catch (e) {  
49 - debug(originalRes) 45 + // 非403、406,直接抛出去
  46 + Logger.debug(TAG, 'get else: ' + JSON.stringify(res))
  47 + error(res)
50 } 48 }
51 -  
52 - }).catch((res: object) => {  
53 - debug(res)  
54 }) 49 })
55 }) 50 })
56 } 51 }
@@ -63,34 +58,31 @@ export class HttpBizUtil { @@ -63,34 +58,31 @@ export class HttpBizUtil {
63 * @returns 返回值 58 * @returns 返回值
64 */ 59 */
65 static post<T = ResponseDTO<string>>(url: string, data?: object, headers?: HashMap<string, string>): Promise<T> { 60 static post<T = ResponseDTO<string>>(url: string, data?: object, headers?: HashMap<string, string>): Promise<T> {
66 - return new Promise<T>((success, debug) => { 61 + return new Promise<T>((success, error) => {
67 WDHttp.post<T>(url, data, headers).then((originalRes: T) => { 62 WDHttp.post<T>(url, data, headers).then((originalRes: T) => {
68 - try {  
69 - let resDTO = originalRes as ResponseDTO  
70 - Logger.debug(TAG, 'post: ' + resDTO.code)  
71 - Logger.debug(TAG, 'post: ' + resDTO.message) 63 + success(originalRes)
  64 + }).catch((res: ResposeError) => {
72 // 403:临时token;406:强制下线、封禁、清空登录信息还要跳转登录页面 65 // 403:临时token;406:强制下线、封禁、清空登录信息还要跳转登录页面
73 - if (resDTO.code == 403 || resDTO.code == 406) { 66 + Logger.debug(TAG, 'post catch error: ' + JSON.stringify(res))
  67 + if (res.code == 403 || res.code == 406) {
74 HttpBizUtil.refreshToken().then((token: string) => { 68 HttpBizUtil.refreshToken().then((token: string) => {
75 if (headers) { 69 if (headers) {
76 headers.replace('RMRB-X-TOKEN', token) 70 headers.replace('RMRB-X-TOKEN', token)
77 headers.replace('cookie', 'RMRB-X-TOKEN=' + token) 71 headers.replace('cookie', 'RMRB-X-TOKEN=' + token)
78 } 72 }
  73 + Logger.debug(TAG, 'post again send: ' + token)
79 // refreshToken为空场景不处理,直接请求接口。 74 // refreshToken为空场景不处理,直接请求接口。
80 - WDHttp.post<T>(url, headers).then((againResDTO: T) => { 75 + WDHttp.post<T>(url, data, headers).then((againResDTO: T) => {
  76 + Logger.debug(TAG, 'post again success: ' + JSON.stringify(againResDTO))
81 success(againResDTO) 77 success(againResDTO)
82 }).catch((res: object) => { 78 }).catch((res: object) => {
83 - debug(res) 79 + error(ResposeError.buildError(JSON.stringify(res)))
84 }) 80 })
85 }); 81 });
86 } else { 82 } else {
87 - success(originalRes) 83 + // 非403、406,直接抛出去
  84 + error(res)
88 } 85 }
89 - } catch (e) {  
90 - success(originalRes)  
91 - }  
92 - }).catch((res: object) => {  
93 - debug(res)  
94 }) 86 })
95 }) 87 })
96 } 88 }
@@ -104,9 +96,9 @@ export class HttpBizUtil { @@ -104,9 +96,9 @@ export class HttpBizUtil {
104 params.set('refreshToken', HttpUrlUtils.getRefreshToken()) 96 params.set('refreshToken', HttpUrlUtils.getRefreshToken())
105 params.set('deviceId', HttpUrlUtils.getDeviceId()) 97 params.set('deviceId', HttpUrlUtils.getDeviceId())
106 let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders(); 98 let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();
107 - Logger.debug(TAG, 'refreshToken getRefreshToken: ' + HttpUrlUtils.getRefreshToken())  
108 - // // 请求刷新token接口  
109 - return new Promise<string>((success, debug) => { 99 + // Logger.debug(TAG, 'refreshToken getRefreshToken: ' + HttpUrlUtils.getRefreshToken())
  100 + // 请求刷新token接口
  101 + return new Promise<string>((success, error) => {
110 WDHttp.post<ResponseDTO<RefreshTokenRes>>(url, params, headers).then((resDTO: ResponseDTO<RefreshTokenRes>) => { 102 WDHttp.post<ResponseDTO<RefreshTokenRes>>(url, params, headers).then((resDTO: ResponseDTO<RefreshTokenRes>) => {
111 let newToken = '' 103 let newToken = ''
112 if (resDTO) { 104 if (resDTO) {
@@ -126,6 +118,7 @@ export class HttpBizUtil { @@ -126,6 +118,7 @@ export class HttpBizUtil {
126 Logger.debug(TAG, 'refreshToken refreshToken: ' + resDTO.data.refreshToken) 118 Logger.debug(TAG, 'refreshToken refreshToken: ' + resDTO.data.refreshToken)
127 } 119 }
128 } 120 }
  121 + Logger.debug(TAG, 'refreshToken last jwtToken: ' + newToken)
129 success(newToken) 122 success(newToken)
130 }); 123 });
131 }) 124 })
@@ -47,6 +47,10 @@ export class HttpUrlUtils { @@ -47,6 +47,10 @@ export class HttpUrlUtils {
47 */ 47 */
48 static readonly INTERACT_DATA_PATH: string = "/api/rmrb-contact/contact/zh/c/content/interactData"; 48 static readonly INTERACT_DATA_PATH: string = "/api/rmrb-contact/contact/zh/c/content/interactData";
49 /** 49 /**
  50 + * 查询各类型内容动态数据接口V2:其他场景的均调用V2---api缓存1-2s
  51 + */
  52 + static readonly INTERACT_V2_DATA_PATH: string = "/api/rmrb-contact/contact/zh/c/v2/content/interactData";
  53 + /**
50 * 查询视频频道推荐楼层 54 * 查询视频频道推荐楼层
51 */ 55 */
52 static readonly DISPLAY_REC_COMPINFO: string = "/api/rmrb-bff-display-zh/display/zh/c/rec/compInfo"; 56 static readonly DISPLAY_REC_COMPINFO: string = "/api/rmrb-bff-display-zh/display/zh/c/rec/compInfo";
@@ -742,7 +746,7 @@ export class HttpUrlUtils { @@ -742,7 +746,7 @@ export class HttpUrlUtils {
742 } 746 }
743 747
744 static getSearchHotsDataUrl() { 748 static getSearchHotsDataUrl() {
745 - let url = HttpUrlUtils.HOST_SIT + HttpUrlUtils.SEARCH_HOTS_DATA_PATH 749 + let url = HttpUrlUtils._hostUrl + HttpUrlUtils.SEARCH_HOTS_DATA_PATH
746 return url 750 return url
747 } 751 }
748 752
@@ -843,6 +847,13 @@ export class HttpUrlUtils { @@ -843,6 +847,13 @@ export class HttpUrlUtils {
843 let url = HttpUrlUtils._hostUrl + "/api/rmrb-interact/interact/zh/c/like/executeLike"; 847 let url = HttpUrlUtils._hostUrl + "/api/rmrb-interact/interact/zh/c/like/executeLike";
844 return url; 848 return url;
845 } 849 }
  850 +
  851 + //获取点赞状态
  852 + static getLikeStatus() {
  853 + let url = HttpUrlUtils._hostUrl + "/api/rmrb-interact/interact/zh/c/batchLikeAndCollect/status";
  854 + return url;
  855 + }
  856 +
846 //搜索推荐 857 //搜索推荐
847 static getSearchSuggestDataUrl() { 858 static getSearchSuggestDataUrl() {
848 let url = HttpUrlUtils._hostUrl + HttpUrlUtils.SEARCH_SUGGEST_DATA_PATH 859 let url = HttpUrlUtils._hostUrl + HttpUrlUtils.SEARCH_SUGGEST_DATA_PATH
@@ -171,6 +171,17 @@ export class ProcessUtils { @@ -171,6 +171,17 @@ export class ProcessUtils {
171 Logger.debug(TAG, `gotoMultiPictureListPage`); 171 Logger.debug(TAG, `gotoMultiPictureListPage`);
172 } 172 }
173 173
  174 + public static _gotoSpecialTopic(linkUrl: string) {
  175 + let taskAction: Action = {
  176 + type: 'JUMP_INNER_NEW_PAGE',
  177 + params: {
  178 + url: linkUrl,
  179 + pageID: 'SPACIAL_TOPIC_PAGE',
  180 + } as Params,
  181 + };
  182 + WDRouterRule.jumpWithAction(taskAction)
  183 + }
  184 +
174 public static gotoSpecialTopic(content: ContentDTO) { 185 public static gotoSpecialTopic(content: ContentDTO) {
175 let taskAction: Action = { 186 let taskAction: Action = {
176 type: 'JUMP_INNER_NEW_PAGE', 187 type: 'JUMP_INNER_NEW_PAGE',
@@ -182,6 +193,16 @@ export class ProcessUtils { @@ -182,6 +193,16 @@ export class ProcessUtils {
182 WDRouterRule.jumpWithAction(taskAction) 193 WDRouterRule.jumpWithAction(taskAction)
183 } 194 }
184 195
  196 + public static _gotoDefaultWeb(linkUrl: string) {
  197 + let taskAction: Action = {
  198 + type: 'JUMP_H5_BY_WEB_VIEW',
  199 + params: {
  200 + url: linkUrl,
  201 + } as Params,
  202 + };
  203 + WDRouterRule.jumpWithAction(taskAction)
  204 + }
  205 +
185 public static gotoDefaultWeb(content: ContentDTO) { 206 public static gotoDefaultWeb(content: ContentDTO) {
186 let taskAction: Action = { 207 let taskAction: Action = {
187 type: 'JUMP_H5_BY_WEB_VIEW', 208 type: 'JUMP_H5_BY_WEB_VIEW',
@@ -11,6 +11,7 @@ @@ -11,6 +11,7 @@
11 "wdKit": "file:../wdKit", 11 "wdKit": "file:../wdKit",
12 "wdJsBridge": "file:../wdJsBridge", 12 "wdJsBridge": "file:../wdJsBridge",
13 "wdBean": "file:../../features/wdBean", 13 "wdBean": "file:../../features/wdBean",
14 - "wdRouter": "file:../wdRouter" 14 + "wdRouter": "file:../wdRouter",
  15 + "wdNetwork": "file:../wdNetwork"
15 } 16 }
16 } 17 }
@@ -10,6 +10,9 @@ export class H5CallNativeType { @@ -10,6 +10,9 @@ export class H5CallNativeType {
10 static jsCall_callAppService = 'jsCall_callAppService' 10 static jsCall_callAppService = 'jsCall_callAppService'
11 static jsCall_appInnerLinkMethod = 'jsCall_appInnerLinkMethod' 11 static jsCall_appInnerLinkMethod = 'jsCall_appInnerLinkMethod'
12 static jsCall_receiveH5Data = 'jsCall_receiveH5Data' 12 static jsCall_receiveH5Data = 'jsCall_receiveH5Data'
  13 + static jsCall_getAppLoginAuthInfo = 'jsCall_getAppLoginAuthInfo'
  14 + static jsCall_appNotifyEvent = 'jsCall_appNotifyEvent'
  15 +
13 // TODO 业务自行新增类型、自行在JsBridgeBiz#performJSCallNative里添加接收分支处理。 16 // TODO 业务自行新增类型、自行在JsBridgeBiz#performJSCallNative里添加接收分支处理。
14 17
15 static { 18 static {
@@ -19,6 +22,8 @@ export class H5CallNativeType { @@ -19,6 +22,8 @@ export class H5CallNativeType {
19 H5CallNativeType.JsCallTypeList.push(H5CallNativeType.jsCall_callAppService) 22 H5CallNativeType.JsCallTypeList.push(H5CallNativeType.jsCall_callAppService)
20 H5CallNativeType.JsCallTypeList.push(H5CallNativeType.jsCall_appInnerLinkMethod) 23 H5CallNativeType.JsCallTypeList.push(H5CallNativeType.jsCall_appInnerLinkMethod)
21 H5CallNativeType.JsCallTypeList.push(H5CallNativeType.jsCall_receiveH5Data) 24 H5CallNativeType.JsCallTypeList.push(H5CallNativeType.jsCall_receiveH5Data)
  25 + H5CallNativeType.JsCallTypeList.push(H5CallNativeType.jsCall_getAppLoginAuthInfo)
  26 + H5CallNativeType.JsCallTypeList.push(H5CallNativeType.jsCall_appNotifyEvent)
22 } 27 }
23 } 28 }
24 29
  1 +import HashMap from '@ohos.util.HashMap';
1 import { Callback } from 'wdJsBridge'; 2 import { Callback } from 'wdJsBridge';
2 import { Message } from 'wdJsBridge/src/main/ets/bean/Message'; 3 import { Message } from 'wdJsBridge/src/main/ets/bean/Message';
3 import { Logger } from 'wdKit'; 4 import { Logger } from 'wdKit';
@@ -8,6 +9,7 @@ import { ProcessUtils } from 'wdRouter'; @@ -8,6 +9,7 @@ import { ProcessUtils } from 'wdRouter';
8 import router from '@ohos.router'; 9 import router from '@ohos.router';
9 import Url from '@ohos.url' 10 import Url from '@ohos.url'
10 import { ContentDTO } from 'wdBean/Index'; 11 import { ContentDTO } from 'wdBean/Index';
  12 +import { ResponseDTO, WDHttp, HttpUrlUtils } from 'wdNetwork';
11 13
12 const TAG = 'JsBridgeBiz' 14 const TAG = 'JsBridgeBiz'
13 15
@@ -37,7 +39,9 @@ export function performJSCallNative(data: Message, call: Callback) { @@ -37,7 +39,9 @@ export function performJSCallNative(data: Message, call: Callback) {
37 case H5CallNativeType.jsCall_getArticleDetailBussinessData: 39 case H5CallNativeType.jsCall_getArticleDetailBussinessData:
38 break; 40 break;
39 case H5CallNativeType.jsCall_callAppService: 41 case H5CallNativeType.jsCall_callAppService:
40 - handleJsCallCallAppService(data) 42 + handleJsCallCallAppService(data, (res: string) => {
  43 + call(res)
  44 + })
41 break; 45 break;
42 case H5CallNativeType.jsCall_receiveH5Data: 46 case H5CallNativeType.jsCall_receiveH5Data:
43 handleJsCallReceiveH5Data(data) 47 handleJsCallReceiveH5Data(data)
@@ -60,6 +64,21 @@ function handleJsCallCurrentPageOperate(data: Message) { @@ -60,6 +64,21 @@ function handleJsCallCurrentPageOperate(data: Message) {
60 } 64 }
61 } 65 }
62 66
  67 +function handleJsCallCallAppService(data: Message, callback: (res: string) => void) {
  68 + let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();
  69 + let url: string = HttpUrlUtils.getHost() + data?.data?.url
  70 + if (data?.data?.method === 'get') {
  71 + WDHttp.get<ResponseDTO<string>>(url, headers).then((res: ResponseDTO<string>) => {
  72 + callback(JSON.stringify(res))
  73 + })
  74 + }
  75 + if (data?.data?.method === 'post') {
  76 + WDHttp.post<ResponseDTO<string>>(url, data?.data?.parameters, headers).then(res => {
  77 + callback(JSON.stringify(res))
  78 + })
  79 + }
  80 +}
  81 +
63 /** 82 /**
64 * 获取App公共信息 83 * 获取App公共信息
65 */ 84 */
@@ -87,19 +106,14 @@ function handleJsCallReceiveH5Data(data: Message) { @@ -87,19 +106,14 @@ function handleJsCallReceiveH5Data(data: Message) {
87 } 106 }
88 } 107 }
89 108
90 -function handleJsCallCallAppService(data: Message) {  
91 -  
92 -}  
93 -  
94 function handleJsCallAppInnerLinkMethod(data: Message) { 109 function handleJsCallAppInnerLinkMethod(data: Message) {
95 let urlObject = Url.URL.parseURL(data?.data?.appInnerLink); 110 let urlObject = Url.URL.parseURL(data?.data?.appInnerLink);
96 let urlParams = new Url.URLParams(urlObject.search); 111 let urlParams = new Url.URLParams(urlObject.search);
97 - console.log('urlObject:', `${JSON.stringify(urlParams)}`)  
98 let content: ContentDTO = { 112 let content: ContentDTO = {
99 objectId: urlParams.get('contentId') || '', 113 objectId: urlParams.get('contentId') || '',
100 relId: urlParams.get('relId') || '', 114 relId: urlParams.get('relId') || '',
101 relType: urlParams.get('relType') || '', 115 relType: urlParams.get('relType') || '',
102 - pageId:urlParams.get('pageId') || '', 116 + pageId: urlParams.get('pageId') || '',
103 objectType: '' 117 objectType: ''
104 } as ContentDTO 118 } as ContentDTO
105 if (urlParams.get('skipType') === '1') { 119 if (urlParams.get('skipType') === '1') {
@@ -130,14 +144,14 @@ function handleJsCallAppInnerLinkMethod(data: Message) { @@ -130,14 +144,14 @@ function handleJsCallAppInnerLinkMethod(data: Message) {
130 ProcessUtils.processPage(content) 144 ProcessUtils.processPage(content)
131 break; 145 break;
132 case 'topic': 146 case 'topic':
133 - if(urlParams.get('subType') === 'h5'){ 147 + if (urlParams.get('subType') === 'h5') {
134 content.objectType = ContentConstants.TYPE_SPECIAL_TOPIC 148 content.objectType = ContentConstants.TYPE_SPECIAL_TOPIC
135 ProcessUtils.processPage(content) 149 ProcessUtils.processPage(content)
136 } 150 }
137 - if(urlParams.get('subType') === 'moring_evening_news'){ 151 + if (urlParams.get('subType') === 'moring_evening_news') {
138 ProcessUtils.gotoMorningEveningPaper() 152 ProcessUtils.gotoMorningEveningPaper()
139 } 153 }
140 - if(urlParams.get('subType') === 'electronic_newspapers'){ 154 + if (urlParams.get('subType') === 'electronic_newspapers') {
141 ProcessUtils.gotoENewsPaper() 155 ProcessUtils.gotoENewsPaper()
142 } 156 }
143 break; 157 break;
@@ -32,6 +32,7 @@ export interface CompDTO { @@ -32,6 +32,7 @@ export interface CompDTO {
32 subType: string; 32 subType: string;
33 imageScale: number; // 封面图比例 1-4:3, 2-16:9, 3-3:2 33 imageScale: number; // 封面图比例 1-4:3, 2-16:9, 3-3:2
34 audioDataList: AudioDTO[]; 34 audioDataList: AudioDTO[];
  35 + titleShowPolicy: string | number;
35 36
36 /** 37 /**
37 * 组件内容源类型 (LIVE_HORIZONTAL_CARD\LIVE_RESERVATION\LIVE_LARGE_CARD\LIVE_END\LIVE_MONTHLY_RANKING ) 38 * 组件内容源类型 (LIVE_HORIZONTAL_CARD\LIVE_RESERVATION\LIVE_LARGE_CARD\LIVE_END\LIVE_MONTHLY_RANKING )
@@ -42,4 +43,7 @@ export interface CompDTO { @@ -42,4 +43,7 @@ export interface CompDTO {
42 * 信息流广告素材 43 * 信息流广告素材
43 */ 44 */
44 matInfo: CompAdvMatInfoBean 45 matInfo: CompAdvMatInfoBean
  46 +
  47 + pageId?: string;
  48 + objectType?: string;
45 } 49 }
  1 +import { RmhInfoDTO } from '../detail/RmhInfoDTO'
  2 +
1 export interface LiveDetailsBean { 3 export interface LiveDetailsBean {
2 /** 4 /**
3 * { 5 * {
@@ -164,14 +166,16 @@ export interface LiveDetailsBean { @@ -164,14 +166,16 @@ export interface LiveDetailsBean {
164 //迁移id 166 //迁移id
165 oldNewsId: string 167 oldNewsId: string
166 reLInfo: ReLInfo 168 reLInfo: ReLInfo
167 - rmhInfo: RmhInfo 169 + rmhInfo: RmhInfoDTO
168 } 170 }
169 171
170 export interface LiveInfo { 172 export interface LiveInfo {
171 //直播新闻-直播状态 wait 待开播 running 直播中 end 已结束cancel已取消paused暂停 173 //直播新闻-直播状态 wait 待开播 running 直播中 end 已结束cancel已取消paused暂停
172 liveState: string 174 liveState: string
  175 +
173 //2024-04-12 15:00:00 直播开始时间 176 //2024-04-12 15:00:00 直播开始时间
174 planStartTime: string 177 planStartTime: string
  178 + //直播样式 0-正常模式 , 1-隐藏直播间,2-隐藏大家聊 【人民号发布是竖屏的,为空】
175 liveStyle: number; 179 liveStyle: number;
176 vlive: Array<Vlive> 180 vlive: Array<Vlive>
177 mlive: MLive 181 mlive: MLive
@@ -197,11 +201,3 @@ export interface Vlive { @@ -197,11 +201,3 @@ export interface Vlive {
197 export interface ReLInfo { 201 export interface ReLInfo {
198 relId: string 202 relId: string
199 } 203 }
200 -  
201 -export interface RmhInfo {  
202 - rmhName: string;  
203 - rmhHeadUrl: string;  
204 - rmhId: string;  
205 - userId: string;  
206 - userType: string;  
207 -}  
@@ -9,6 +9,7 @@ export interface PageInfoDTO { @@ -9,6 +9,7 @@ export interface PageInfoDTO {
9 name: string; // 名称 9 name: string; // 名称
10 hasPopUp: number; 10 hasPopUp: number;
11 baselineShow: number; 11 baselineShow: number;
  12 + baselineCopywriting: string;
12 groups: GroupInfoDTO[]; 13 groups: GroupInfoDTO[];
13 channelInfo: ChannelInfoDTO; 14 channelInfo: ChannelInfoDTO;
14 15
@@ -20,11 +21,11 @@ export interface PageInfoDTO { @@ -20,11 +21,11 @@ export interface PageInfoDTO {
20 /** 21 /**
21 * 挂角广告数据 22 * 挂角广告数据
22 */ 23 */
23 - cornersAdv:AdvRuleBean 24 + cornersAdv: AdvRuleBean
24 /** 25 /**
25 * 广告中心-挂角广告信息 26 * 广告中心-挂角广告信息
26 */ 27 */
27 - cornersAdv2:CompAdvBean[] 28 + cornersAdv2: CompAdvBean[]
28 29
29 } 30 }
30 31
@@ -14,6 +14,8 @@ export { PageComponent } from "./src/main/ets/components/page/PageComponent" @@ -14,6 +14,8 @@ export { PageComponent } from "./src/main/ets/components/page/PageComponent"
14 14
15 export { BottomNavigationComponent } from "./src/main/ets/components/page/BottomNavigationComponent" 15 export { BottomNavigationComponent } from "./src/main/ets/components/page/BottomNavigationComponent"
16 16
  17 +export { LikeComponent } from "./src/main/ets/components/view/LikeComponent"
  18 +
17 export { TopNavigationComponent } from "./src/main/ets/components/page/TopNavigationComponent" 19 export { TopNavigationComponent } from "./src/main/ets/components/page/TopNavigationComponent"
18 20
19 export { LabelComponent } from "./src/main/ets/components/view/LabelComponent" 21 export { LabelComponent } from "./src/main/ets/components/view/LabelComponent"
@@ -77,7 +79,11 @@ export { LiveCommentComponent } from "./src/main/ets/components/comment/view/Liv @@ -77,7 +79,11 @@ export { LiveCommentComponent } from "./src/main/ets/components/comment/view/Liv
77 79
78 export { WDViewDefaultType } from "./src/main/ets/components/view/EmptyComponent" 80 export { WDViewDefaultType } from "./src/main/ets/components/view/EmptyComponent"
79 81
  82 +export { PermissionDesComponent } from "./src/main/ets/components/view/PermissionDesComponent"
  83 +
80 export { AudioRowComponent } from "./src/main/ets/components/live/AudioRowComponent" 84 export { AudioRowComponent } from "./src/main/ets/components/live/AudioRowComponent"
81 85
82 export { WDLiveViewDefaultType } from "./src/main/ets/components/view/LiveEmptyComponent" 86 export { WDLiveViewDefaultType } from "./src/main/ets/components/view/LiveEmptyComponent"
83 87
  88 +export { LiveFollowComponent } from "./src/main/ets/components/cardCommon/LiveFollowComponent"
  89 +
@@ -20,8 +20,8 @@ import { ZhCarouselLayout01 } from './compview/ZhCarouselLayout01'; @@ -20,8 +20,8 @@ import { ZhCarouselLayout01 } from './compview/ZhCarouselLayout01';
20 import { CardParser } from './CardParser'; 20 import { CardParser } from './CardParser';
21 import { LiveHorizontalReservationComponent } from './view/LiveHorizontalReservationComponent'; 21 import { LiveHorizontalReservationComponent } from './view/LiveHorizontalReservationComponent';
22 import { ZhGridLayout02 } from './compview/ZhGridLayout02'; 22 import { ZhGridLayout02 } from './compview/ZhGridLayout02';
23 -import { Card5Component } from './cardview/Card5Component';  
24 import { Card2Component } from './cardview/Card2Component'; 23 import { Card2Component } from './cardview/Card2Component';
  24 +import { Card5Component } from './cardview/Card5Component';
25 import { WDRouterPage, WDRouterRule } from 'wdRouter/Index'; 25 import { WDRouterPage, WDRouterRule } from 'wdRouter/Index';
26 import { CardAdvComponent } from './cardViewAdv/CardAdvComponent'; 26 import { CardAdvComponent } from './cardViewAdv/CardAdvComponent';
27 import { AdvCardParser } from './cardViewAdv/AdvCardParser'; 27 import { AdvCardParser } from './cardViewAdv/AdvCardParser';
1 -import { AccountManagerUtils, Logger, DateTimeUtils } from 'wdKit'; 1 +import { AccountManagerUtils, Logger, DateTimeUtils, SPHelper, NumberFormatterUtils } from 'wdKit';
2 import { MultiPictureDetailViewModel } from '../viewmodel/MultiPictureDetailViewModel'; 2 import { MultiPictureDetailViewModel } from '../viewmodel/MultiPictureDetailViewModel';
3 -import { ContentDetailDTO,batchLikeAndCollectResult,batchLikeAndCollectParams,postBatchAttentionStatusParams, 3 +import { ContentDetailDTO,postBatchAttentionStatusParams,
4 PhotoListBean, 4 PhotoListBean,
5 ContentDTO, 5 ContentDTO,
6 - RmhInfoDTO, } from 'wdBean'; 6 + batchLikeAndCollectResult,
  7 + RmhInfoDTO,
  8 + InteractDataDTO, } from 'wdBean';
7 import media from '@ohos.multimedia.media'; 9 import media from '@ohos.multimedia.media';
8 import { OperRowListView } from './view/OperRowListView'; 10 import { OperRowListView } from './view/OperRowListView';
9 import { WDPlayerController } from 'wdPlayer/Index'; 11 import { WDPlayerController } from 'wdPlayer/Index';
  12 +import {
  13 + batchLikeAndCollectParams,
  14 + ContentDetailRequest,
  15 + contentListParams,
  16 + postExecuteCollectRecordParams,
  17 + postExecuteLikeParams,
  18 + postInteractAccentionOperateParams
  19 +} from 'wdDetailPlayApi/src/main/ets/request/ContentDetailRequest';
10 import { ContentConstants } from '../constants/ContentConstants'; 20 import { ContentConstants } from '../constants/ContentConstants';
11 -import { ProcessUtils } from 'wdRouter'; 21 +import { ProcessUtils, WDRouterPage, WDRouterRule } from 'wdRouter';
12 import { StringUtils } from 'wdKit/src/main/ets/utils/StringUtils'; 22 import { StringUtils } from 'wdKit/src/main/ets/utils/StringUtils';
13 import display from '@ohos.display'; 23 import display from '@ohos.display';
14 import { BusinessError } from '@ohos.base'; 24 import { BusinessError } from '@ohos.base';
15 -import { CommonConstants } from 'wdConstant/Index'; 25 +import { CommonConstants, SpConstants } from 'wdConstant/Index';
16 import { CardMediaInfo } from '../components/cardCommon/CardMediaInfo' 26 import { CardMediaInfo } from '../components/cardCommon/CardMediaInfo'
17 import router from '@ohos.router'; 27 import router from '@ohos.router';
18 const TAG = 'DynamicDetailComponent' 28 const TAG = 'DynamicDetailComponent'
@@ -23,32 +33,23 @@ export struct DynamicDetailComponent { @@ -23,32 +33,23 @@ export struct DynamicDetailComponent {
23 private relId: string = '' 33 private relId: string = ''
24 private contentId: string = '' 34 private contentId: string = ''
25 private relType: string = '' 35 private relType: string = ''
26 - //出参 fixme 模拟数据用json转换  
27 - @State contentDetailData: ContentDetailDTO = {  
28 - publishTime: "2023年03月14日 08:16",  
29 - rmhInfo:{rmhHeadUrl:"",rmhName:"人民号名称",rmhDesc:"人民号描述单行展示"},  
30 - newsContent:"优先展示这个内容",  
31 - newsSummary:"其次展示这个内容",  
32 - newsTitle:"上面两个都没有再展示这个内容",  
33 - newsType:15  
34 - } as ContentDetailDTO  
35 - //变量 36 +
  37 + //出参
  38 + @State contentDetailData: ContentDetailDTO = {} as ContentDetailDTO
  39 + //UI
36 scroller: Scroller = new Scroller(); 40 scroller: Scroller = new Scroller();
  41 +
  42 + //点赞 收藏 评论 数量
  43 + @State interactDataDTO: InteractDataDTO = {likeNum:0} as InteractDataDTO
37 /** 44 /**
38 - * 默认未关注 点击去关注 45 + * 关注状态:默认未关注 点击去关注
39 */ 46 */
40 - private followStatus: String = '0';  
41 - @State newsStatusOfUser: batchLikeAndCollectResult | undefined = undefined // 点赞、收藏状态 47 + @State followStatus: String = '0';
42 48
  49 + @State newsStatusOfUser: batchLikeAndCollectResult | undefined = undefined// 点赞、收藏状态
43 //跳转 50 //跳转
44 private mJumpInfo: ContentDTO = {} as ContentDTO; 51 private mJumpInfo: ContentDTO = {} as ContentDTO;
45 52
46 - // 获取当前所有的display对象  
47 - promise: Promise<Array<display.Display>> = display.getAllDisplays()  
48 -  
49 - // 屏幕宽度(单位px)  
50 - @State screenWidth: number = 0;  
51 -  
52 async aboutToAppear() { 53 async aboutToAppear() {
53 await this.getContentDetailData() 54 await this.getContentDetailData()
54 } 55 }
@@ -130,7 +131,7 @@ export struct DynamicDetailComponent { @@ -130,7 +131,7 @@ export struct DynamicDetailComponent {
130 .backgroundColor($r('app.color.color_ED2800')) 131 .backgroundColor($r('app.color.color_ED2800'))
131 .fontColor($r('app.color.color_fff')) 132 .fontColor($r('app.color.color_fff'))
132 .onClick(() => { 133 .onClick(() => {
133 - // this.handleAccention(this.item, 1) 134 + this.handleAccention()
134 }) 135 })
135 } else { 136 } else {
136 Text('已关注') 137 Text('已关注')
@@ -143,7 +144,7 @@ export struct DynamicDetailComponent { @@ -143,7 +144,7 @@ export struct DynamicDetailComponent {
143 .borderColor($r('app.color.color_CCCCCC')) 144 .borderColor($r('app.color.color_CCCCCC'))
144 .fontColor($r('app.color.color_CCCCCC')) 145 .fontColor($r('app.color.color_CCCCCC'))
145 .onClick(() => { 146 .onClick(() => {
146 - // this.handleAccention(this.item, 0) 147 + this.handleAccention()
147 }) 148 })
148 } 149 }
149 } 150 }
@@ -224,6 +225,9 @@ export struct DynamicDetailComponent { @@ -224,6 +225,9 @@ export struct DynamicDetailComponent {
224 item.height = callback?.height || 0; 225 item.height = callback?.height || 0;
225 }) 226 })
226 } 227 }
  228 + .onClick((event: ClickEvent) => {
  229 + ProcessUtils.gotoMultiPictureListPage(this.contentDetailData.photoList)
  230 + })
227 } 231 }
228 } else if (this.contentDetailData.photoList.length === 4) { 232 } else if (this.contentDetailData.photoList.length === 4) {
229 GridCol({ 233 GridCol({
@@ -233,6 +237,9 @@ export struct DynamicDetailComponent { @@ -233,6 +237,9 @@ export struct DynamicDetailComponent {
233 .aspectRatio(1) 237 .aspectRatio(1)
234 .borderRadius(this.caclImageRadius(index)) 238 .borderRadius(this.caclImageRadius(index))
235 } 239 }
  240 + .onClick((event: ClickEvent) => {
  241 + ProcessUtils.gotoMultiPictureListPage(this.contentDetailData.photoList)
  242 + })
236 } else { 243 } else {
237 GridCol({ 244 GridCol({
238 span: { sm: 4, lg: 3 } 245 span: { sm: 4, lg: 3 }
@@ -241,6 +248,9 @@ export struct DynamicDetailComponent { @@ -241,6 +248,9 @@ export struct DynamicDetailComponent {
241 .aspectRatio(1) 248 .aspectRatio(1)
242 .borderRadius(this.caclImageRadius(index)) 249 .borderRadius(this.caclImageRadius(index))
243 } 250 }
  251 + .onClick((event: ClickEvent) => {
  252 + ProcessUtils.gotoMultiPictureListPage(this.contentDetailData.photoList)
  253 + })
244 } 254 }
245 }) 255 })
246 } 256 }
@@ -316,17 +326,32 @@ export struct DynamicDetailComponent { @@ -316,17 +326,32 @@ export struct DynamicDetailComponent {
316 .margin({ top: $r('app.float.margin_24')}) 326 .margin({ top: $r('app.float.margin_24')})
317 //点赞 327 //点赞
318 Row(){ 328 Row(){
319 - Image($r('app.media.icon_like_selected_redheart')) 329 + Blank().layoutWeight(1)
  330 + Image(this.newsStatusOfUser?.likeStatus == '1'?
  331 + $r('app.media.icon_like_selected_redheart')
  332 + :$r('app.media.icon_like_unselect_grey_redheart'))
320 .width($r('app.float.margin_24')) 333 .width($r('app.float.margin_24'))
321 .height($r('app.float.margin_24')) 334 .height($r('app.float.margin_24'))
322 .objectFit(ImageFit.Cover) 335 .objectFit(ImageFit.Cover)
323 - Text("2.6万") 336 + if(this.interactDataDTO?.likeNum != 0){
  337 + Text(NumberFormatterUtils.formatNumberWithWan(this.interactDataDTO?.likeNum))
324 .fontColor($r('app.color.color_999999')) 338 .fontColor($r('app.color.color_999999'))
325 .fontSize($r('app.float.font_size_16')) 339 .fontSize($r('app.float.font_size_16'))
326 .lineHeight($r('app.float.margin_20')) 340 .lineHeight($r('app.float.margin_20'))
327 .margin({ left: $r('app.float.margin_2')}) 341 .margin({ left: $r('app.float.margin_2')})
328 } 342 }
  343 + Blank().layoutWeight(1)
  344 + }
  345 + .width($r('app.float.margin_154'))
  346 + .height($r('app.float.margin_40'))
329 .margin({top:$r('app.float.margin_16')}) 347 .margin({top:$r('app.float.margin_16')})
  348 + .borderWidth($r('app.float.margin_1'))
  349 + .borderColor($r('app.color.color_EDEDED'))
  350 + .borderRadius($r('app.float.margin_20'))
  351 + .onClick((event: ClickEvent) => {
  352 + //点赞操作
  353 + this.toggleLikeStatus()
  354 + })
330 Blank().layoutWeight(1) 355 Blank().layoutWeight(1)
331 //fixme 评论组件 356 //fixme 评论组件
332 } 357 }
@@ -394,20 +419,23 @@ export struct DynamicDetailComponent { @@ -394,20 +419,23 @@ export struct DynamicDetailComponent {
394 this.getBatchAttentionStatus() 419 this.getBatchAttentionStatus()
395 this.getInteractDataStatus() 420 this.getInteractDataStatus()
396 this.makeJumpInfo() 421 this.makeJumpInfo()
  422 + this.interactDataV2()
397 } 423 }
398 424
399 - // 查询当前登录用户点赞状态  
400 - private async getInteractDataStatus() {  
401 - //未登录  
402 - if(!AccountManagerUtils.isLoginSync() || this.contentDetailData?.openLikes != 1){  
403 - return 425 +
  426 + private async interactDataV2() {
  427 + this.interactDataDTO = await MultiPictureDetailViewModel.interactDataV2(
  428 + this.contentDetailData?.newsId+'',this.contentDetailData?.newsType+'',this.contentDetailData.reLInfo == null ?'':this.contentDetailData.reLInfo?.relId,this.contentDetailData.rmhPlatform)
404 } 429 }
  430 +
  431 + // 已登录->查询用户对作品点赞、收藏状态
  432 + private async getInteractDataStatus() {
405 try { 433 try {
406 const params: batchLikeAndCollectParams = { 434 const params: batchLikeAndCollectParams = {
407 contentList: [ 435 contentList: [
408 { 436 {
409 - contentId: this.contentDetailData?.newsId + '',  
410 - contentType: this.contentDetailData?.newsType + '', 437 + contentId: this.contentDetailData[0]?.newsId + '',
  438 + contentType: this.contentDetailData[0]?.newsType + '',
411 } 439 }
412 ] 440 ]
413 } 441 }
@@ -486,6 +514,64 @@ export struct DynamicDetailComponent { @@ -486,6 +514,64 @@ export struct DynamicDetailComponent {
486 return 3; //普通图 514 return 3; //普通图
487 } 515 }
488 } 516 }
  517 +
  518 + /**
  519 + * 关注号主
  520 + */
  521 + async handleAccention() {
  522 + // 未登录,跳转登录
  523 + const user_id = await SPHelper.default.get(SpConstants.USER_ID, '')
  524 + if (!user_id) {
  525 + WDRouterRule.jumpWithPage(WDRouterPage.loginPage)
  526 + return
  527 + }
  528 +
  529 + const params2: postInteractAccentionOperateParams = {
  530 + attentionUserType: this.contentDetailData?.rmhInfo?.userType || '', //被关注用户类型(1 普通用户 2 视频号 3 矩阵号)
  531 + attentionUserId: this.contentDetailData?.rmhInfo?.userId || '', // 被关注用户号主id
  532 + attentionCreatorId: this.contentDetailData?.rmhInfo?.rmhId || '', // 被关注用户号主id
  533 + status: this.followStatus == '0'? 1:0,
  534 + }
  535 + ContentDetailRequest.postInteractAccentionOperate(params2).then(res => {
  536 + console.log('关注号主==', JSON.stringify(res.data))
  537 + if (this.followStatus == '1') {
  538 + this.followStatus = '0'
  539 + } else {
  540 + this.followStatus = '1'
  541 + }
  542 + })
  543 + }
  544 +
  545 + /**
  546 + * 点赞、取消点赞
  547 + */
  548 + async toggleLikeStatus() {
  549 + // 未登录,跳转登录
  550 + const user_id = await SPHelper.default.get(SpConstants.USER_ID, '')
  551 + if (!user_id) {
  552 + WDRouterRule.jumpWithPage(WDRouterPage.loginPage)
  553 + return
  554 + }
  555 + const params: postExecuteLikeParams = {
  556 + status: this.newsStatusOfUser?.likeStatus === '1' ? '0' : '1',
  557 + contentId: this.contentDetailData?.newsId + '',
  558 + contentType: this.contentDetailData?.newsType + '',
  559 + }
  560 + ContentDetailRequest.postExecuteLike(params).then(res => {
  561 +
  562 + if (this.newsStatusOfUser) {
  563 + this.newsStatusOfUser.likeStatus = this.newsStatusOfUser?.likeStatus === '1' ? '0' : '1'
  564 + if (this.newsStatusOfUser.likeStatus === '1') {
  565 + this.interactDataDTO.likeNum = Number(this.interactDataDTO.likeNum) + 1
  566 + } else {
  567 + this.interactDataDTO.likeNum = Number(this.interactDataDTO.likeNum) - 1
  568 + }
  569 + console.log('点赞、取消点赞==', this.newsStatusOfUser?.likeStatus, this.interactDataDTO?.likeNum)
  570 + // this.queryContentInteractCount()
  571 + }
  572 +
  573 + })
  574 + }
489 } 575 }
490 576
491 interface radiusType { 577 interface radiusType {
@@ -12,7 +12,7 @@ import { @@ -12,7 +12,7 @@ import {
12 } from 'wdBean'; 12 } from 'wdBean';
13 import DetailViewModel from '../viewmodel/DetailViewModel'; 13 import DetailViewModel from '../viewmodel/DetailViewModel';
14 import { ImageAndTextWebComponent } from './ImageAndTextWebComponent'; 14 import { ImageAndTextWebComponent } from './ImageAndTextWebComponent';
15 -import router from '@ohos.router'; 15 +import { OperRowListView } from './view/OperRowListView';
16 import { RecommendList } from '../components/view/RecommendList' 16 import { RecommendList } from '../components/view/RecommendList'
17 import { CommonConstants } from 'wdConstant'; 17 import { CommonConstants } from 'wdConstant';
18 import { HttpUrlUtils } from 'wdNetwork/Index'; 18 import { HttpUrlUtils } from 'wdNetwork/Index';
@@ -74,6 +74,45 @@ export struct ImageAndTextPageComponent { @@ -74,6 +74,45 @@ export struct ImageAndTextPageComponent {
74 isPageEnd: $isPageEnd 74 isPageEnd: $isPageEnd
75 }) 75 })
76 Column() { 76 Column() {
  77 + // 点赞
  78 + if (this.contentDetailData[0]?.openLikes) {
  79 + // 点赞
  80 + Row() {
  81 + Row() {
  82 + if (this.newsStatusOfUser?.likeStatus === '1') {
  83 + 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')))
  84 + .width(24)
  85 + .height(24)
  86 + .margin({ right: 5 })
  87 + } else {
  88 + 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')))
  89 + .width(24)
  90 + .height(24)
  91 + .margin({ right: 5 })
  92 + }
  93 + Text(`${this.interactData?.likeNum || 0}`)
  94 + .fontSize(16)
  95 + .fontColor(this.newsStatusOfUser?.likeStatus === '1' ? '#ED2800' : '#999999')
  96 + .fontWeight(500)
  97 + }
  98 + .width(140)
  99 + .height(36)
  100 + .justifyContent(FlexAlign.Center)
  101 + .alignItems(VerticalAlign.Center)
  102 + .borderRadius(20)
  103 + .border({
  104 + width: 1,
  105 + color: '#EDEDED',
  106 + })
  107 + .onClick(() => {
  108 + this.toggleLikeStatus()
  109 + })
  110 +
  111 + }.width(CommonConstants.FULL_WIDTH).height(80)
  112 + .justifyContent(FlexAlign.Center)
  113 +
  114 + Divider().strokeWidth(6).color('#f5f5f5')
  115 + }
77 if (this.recommendList.length > 0) { 116 if (this.recommendList.length > 0) {
78 RecommendList({ recommendList: this.recommendList }) 117 RecommendList({ recommendList: this.recommendList })
79 } 118 }
@@ -91,42 +130,7 @@ export struct ImageAndTextPageComponent { @@ -91,42 +130,7 @@ export struct ImageAndTextPageComponent {
91 } 130 }
92 131
93 //底部交互区 132 //底部交互区
94 - Row() {  
95 - Image($r('app.media.icon_arrow_left'))  
96 - .width(24)  
97 - .height(24)  
98 - .onClick((event: ClickEvent) => {  
99 - router.back()  
100 - })  
101 -  
102 - Row() {  
103 - Image($r('app.media.icon_comment'))  
104 - .width(24)  
105 - .height(24)  
106 - .margin({ right: 24 })  
107 - .id('comment')  
108 -  
109 - Image($r('app.media.icon_star'))  
110 - .width(24)  
111 - .height(24)  
112 - .margin({ right: 24 })  
113 -  
114 - Image($r('app.media.icon_listen'))  
115 - .width(24)  
116 - .height(24)  
117 - .margin({ right: 24 })  
118 -  
119 - Image($r('app.media.icon_forward'))  
120 - .width(24)  
121 - .height(24)  
122 -  
123 - }  
124 - }  
125 - .width(CommonConstants.FULL_WIDTH)  
126 - .height(56)  
127 - .padding({ left: 15, right: 15, bottom: 50, top: 20 })  
128 - .justifyContent(FlexAlign.SpaceBetween)  
129 - .backgroundColor(Color.White) 133 + OperRowListView({ contentDetailData: this.contentDetailData[0] })
130 } 134 }
131 135
132 } 136 }
@@ -6,7 +6,8 @@ import { @@ -6,7 +6,8 @@ import {
6 H5ReceiveDetailBean, 6 H5ReceiveDetailBean,
7 ResponseBean 7 ResponseBean
8 } from 'wdBean'; 8 } from 'wdBean';
9 -import { Logger } from 'wdKit'; 9 +import { Logger, SPHelper, NetworkUtil } from 'wdKit';
  10 +import { SpConstants } from 'wdConstant';
10 import { WdWebLocalComponent } from 'wdWebComponent'; 11 import { WdWebLocalComponent } from 'wdWebComponent';
11 import { NativeCallH5Type } from 'wdWebComponent/src/main/ets/pages/NativeCallH5Type'; 12 import { NativeCallH5Type } from 'wdWebComponent/src/main/ets/pages/NativeCallH5Type';
12 import { BridgeWebViewControl } from 'wdJsBridge/Index'; 13 import { BridgeWebViewControl } from 'wdJsBridge/Index';
@@ -22,7 +23,7 @@ export struct ImageAndTextWebComponent { @@ -22,7 +23,7 @@ export struct ImageAndTextWebComponent {
22 private webPrepared = false; 23 private webPrepared = false;
23 private dataPrepared = false; 24 private dataPrepared = false;
24 25
25 - onDetailDataUpdated() { 26 + async onDetailDataUpdated() {
26 if (this.action) { 27 if (this.action) {
27 let contentId: string = '' 28 let contentId: string = ''
28 let contentType: string = '' 29 let contentType: string = ''
@@ -30,6 +31,8 @@ export struct ImageAndTextWebComponent { @@ -30,6 +31,8 @@ export struct ImageAndTextWebComponent {
30 let channelId: string = '' 31 let channelId: string = ''
31 let compId: string = '' 32 let compId: string = ''
32 let sourcePage: string = '5' 33 let sourcePage: string = '5'
  34 + let creatorId = await SPHelper.default.get(SpConstants.USER_CREATOR_ID, '') || ''
  35 + let isLogin = await SPHelper.default.get(SpConstants.USER_STATUS, '') || '0'
33 if (this.action.params) { 36 if (this.action.params) {
34 if (this.action.params.contentID) { 37 if (this.action.params.contentID) {
35 contentId = this.action.params?.contentID 38 contentId = this.action.params?.contentID
@@ -56,9 +59,9 @@ export struct ImageAndTextWebComponent { @@ -56,9 +59,9 @@ export struct ImageAndTextWebComponent {
56 59
57 // TODO 对接user信息、登录情况 60 // TODO 对接user信息、登录情况
58 let h5ReceiveDataExtraBean: H5ReceiveDataExtraBean = { 61 let h5ReceiveDataExtraBean: H5ReceiveDataExtraBean = {
59 - creatorId: '',  
60 - isLogin: '0',  
61 - networkStatus: 1, 62 + creatorId: creatorId,
  63 + isLogin: isLogin,
  64 + networkStatus: Number(NetworkUtil.isNetConnected()),
62 loadImageOnlyWifiSwitch: '2', 65 loadImageOnlyWifiSwitch: '2',
63 66
64 } as H5ReceiveDataExtraBean 67 } as H5ReceiveDataExtraBean
  1 +/**
  2 + * 直播详情 关注相关信息
  3 + */
  4 +import {
  5 + ContentDetailRequest,
  6 + postInteractAccentionOperateParams
  7 +} from 'wdDetailPlayApi/src/main/ets/request/ContentDetailRequest';
  8 +import { postBatchAttentionStatusParams, RmhInfoDTO } from 'wdBean/Index';
  9 +import { SpConstants } from 'wdConstant/Index';
  10 +import { Logger, SPHelper } from 'wdKit/Index';
  11 +import { WDRouterPage, WDRouterRule } from 'wdRouter/Index';
  12 +import { MultiPictureDetailViewModel } from '../../viewmodel/MultiPictureDetailViewModel';
  13 +
  14 +const TAG = 'LiveFollowComponent'
  15 +
  16 +@Component
  17 +export struct LiveFollowComponent {
  18 + @Prop rmhInfo: RmhInfoDTO
  19 +
  20 + aboutToAppear(): void {
  21 + this.getBatchAttentionStatus()
  22 + }
  23 +
  24 + /**
  25 + * 默认未关注 点击去关注
  26 + */
  27 + @State followStatus: String = '0';
  28 +
  29 + build() {
  30 + Stack() {
  31 + Stack()
  32 + .height(22)
  33 + .width(130)
  34 + .backgroundColor('#000000')
  35 + .opacity(0.3)
  36 + .borderRadius({
  37 + topLeft: 90,
  38 + bottomLeft: 90
  39 + })
  40 + Row() {
  41 + Image(this.rmhInfo.rmhHeadUrl)
  42 + .width(24)
  43 + .height(24)
  44 + .borderRadius(90)
  45 + Text(this.rmhInfo.rmhName)
  46 + .fontColor(Color.White)
  47 + .maxLines(1)
  48 + .fontWeight(500)
  49 + .fontSize('12fp')
  50 + .layoutWeight(1)
  51 + .margin({
  52 + left: 4,
  53 + right: 6
  54 + })
  55 + Blank()
  56 + Text(this.followStatus === '0' ? '关注' : '已关注')
  57 + .fontColor(Color.White)
  58 + .fontWeight(500)
  59 + .fontSize('10fp')
  60 + .padding({
  61 + left: 8,
  62 + right: 8,
  63 + top: 3,
  64 + bottom: 3
  65 + })
  66 + .borderRadius(2)
  67 + .margin({ right: 2 })
  68 + .backgroundColor(this.followStatus === '0' ? $r('app.color.color_ED2800') : $r('app.color.color_CCCCCC'))
  69 + .onClick(() => {
  70 + this.handleAccention()
  71 + })
  72 + }
  73 + .height(22)
  74 + .width(130)
  75 + }
  76 + }
  77 +
  78 + /**
  79 + * 查询当前登录用户是否关注作品号主
  80 + * */
  81 + private async getBatchAttentionStatus() {
  82 + try {
  83 + const params: postBatchAttentionStatusParams = {
  84 + creatorIds: [{ creatorId: this.rmhInfo?.rmhId ?? '' }]
  85 + }
  86 + let data = await MultiPictureDetailViewModel.getBatchAttentionStatus(params)
  87 + this.followStatus = data[0]?.status;
  88 + Logger.info(TAG, `followStatus:${JSON.stringify(this.followStatus)}`)
  89 + } catch (exception) {
  90 +
  91 + }
  92 + }
  93 +
  94 + /**
  95 + * 关注号主
  96 + */
  97 + async handleAccention() {
  98 + // 未登录,跳转登录
  99 + const user_id = await SPHelper.default.get(SpConstants.USER_ID, '')
  100 + if (!user_id) {
  101 + WDRouterRule.jumpWithPage(WDRouterPage.loginPage)
  102 + return
  103 + }
  104 +
  105 + const params2: postInteractAccentionOperateParams = {
  106 + attentionUserType: this.rmhInfo?.userType || '', //被关注用户类型(1 普通用户 2 视频号 3 矩阵号)
  107 + attentionUserId: this.rmhInfo?.userId || '', // 被关注用户号主id
  108 + attentionCreatorId: this.rmhInfo?.rmhId || '', // 被关注用户号主id
  109 + status: this.followStatus == '0' ? 1 : 0,
  110 + }
  111 + ContentDetailRequest.postInteractAccentionOperate(params2).then(res => {
  112 + console.log('关注号主==', JSON.stringify(res.data))
  113 + if (this.followStatus == '1') {
  114 + this.followStatus = '0'
  115 + } else {
  116 + this.followStatus = '1'
  117 + }
  118 + })
  119 + }
  120 +}
@@ -20,6 +20,7 @@ export struct Card5Component { @@ -20,6 +20,7 @@ export struct Card5Component {
20 // newsTitle: '今天是周日,天气阴天,明天是周一。', 20 // newsTitle: '今天是周日,天气阴天,明天是周一。',
21 // objectType: '6' 21 // objectType: '6'
22 } as ContentDTO; 22 } as ContentDTO;
  23 + @State titleShowPolicy: number | string = 1
23 24
24 build() { 25 build() {
25 Stack() { 26 Stack() {
@@ -27,7 +28,7 @@ export struct Card5Component { @@ -27,7 +28,7 @@ export struct Card5Component {
27 .width(CommonConstants.FULL_WIDTH) 28 .width(CommonConstants.FULL_WIDTH)
28 .autoResize(true) 29 .autoResize(true)
29 .borderRadius($r('app.float.image_border_radius')) 30 .borderRadius($r('app.float.image_border_radius'))
30 - if (this.contentDTO.titleShow === 1 && this.contentDTO.newsTitle) { 31 + if ((this.titleShowPolicy === 1 || this.contentDTO.titleShow === 1) && this.contentDTO.newsTitle) {
31 Row() 32 Row()
32 .width(CommonConstants.FULL_WIDTH) 33 .width(CommonConstants.FULL_WIDTH)
33 .height(59) 34 .height(59)
@@ -87,6 +87,10 @@ export class commentItemModel { @@ -87,6 +87,10 @@ export class commentItemModel {
87 maxLine: number = 3 87 maxLine: number = 3
88 /*是否有展示更多*/ 88 /*是否有展示更多*/
89 hasMore: boolean = false 89 hasMore: boolean = false
  90 + /*展开子评论的状态下是否有展开更多*/
  91 + childsHasMore: boolean = false
  92 + /*子评论pageNum*/
  93 + pageNum:number = 1
90 /*当有展示更多的时候,当前的状态是展开还是收起*/ 94 /*当有展示更多的时候,当前的状态是展开还是收起*/
91 expanded: boolean = false 95 expanded: boolean = false
92 /*是否正在加载子评论*/ 96 /*是否正在加载子评论*/
1 @Observed 1 @Observed
2 export class publishCommentModel { 2 export class publishCommentModel {
3 - /*被评论的内容id*/ 3 +
  4 + //页面必传
  5 + /*被评论的内容id 页面必传*/
4 targetId: string = "" 6 targetId: string = ""
5 - /*被评论的内容关系id*/ 7 + /*被评论的内容关系id 页面必传*/
6 targetRelId: string = "" 8 targetRelId: string = ""
7 - /*1.文字 2.文字+表情 3.定制表情(客户端写死) 4.图片*/  
8 - commentType: string = '1'  
9 - /*根评论id,如果是一级评论,传-1;否则,传当前评论所属的根评论id*/  
10 - rootCommentId: string = "-1"  
11 - /*【迭代二新增】内容的标题,取bff内容详情接口中newsTitle字段*/ 9 + /*【迭代二新增】内容的标题,取bff内容详情接口中newsTitle字段 页面必传*/
12 targetTitle: string = "" 10 targetTitle: string = ""
13 - /*被评论的内容关系类型,1.频道关系;2.专题关系;【人民号内容为空】默认0*/ 11 + /*被评论的内容关系类型,1.频道关系;2.专题关系;【人民号内容为空】默认0 页面必传*/
14 targetRelType: string = '' 12 targetRelType: string = ''
15 - /*【迭代二新增】关联的频道id/专题id;*/ 13 + /*【迭代二新增】关联的频道id/专题id; 页面必传*/
16 targetRelObjectId: string = "" 14 targetRelObjectId: string = ""
  15 + /*【迭代二新增】是否是重点稿件 1是 0否 页面必传*/
  16 + keyArticle: string = ''
  17 + /*内容类别, 1:点播,2:直播,3:活动,4:广告,5:专题,6:链接,7:榜单,8:图文,9:组图,10:H5新闻,11:频道,12:组件,13:音频,14:动态(13和14为中文版新增) 页面必传*/
  18 + targetType: string = ''
  19 + /*评论总数*/
  20 + totalCommentNumer: string = ''
  21 +
  22 + //评论传参
17 /*评论图片url,多个逗号隔开*/ 23 /*评论图片url,多个逗号隔开*/
18 commentPics: string = "" 24 commentPics: string = ""
19 /*评论内容*/ 25 /*评论内容*/
20 commentContent: string = "" 26 commentContent: string = ""
21 - /*【迭代二新增】是否是重点稿件 1是 0否*/  
22 - keyArticle: string = ''  
23 - /*内容类别, 1:点播,2:直播,3:活动,4:广告,5:专题,6:链接,7:榜单,8:图文,9:组图,10:H5新闻,11:频道,12:组件,13:音频,14:动态(13和14为中文版新增)*/  
24 - targetType: string = '' 27 + /*1.文字 2.文字+表情 3.定制表情(客户端写死) 4.图片*/
  28 + commentType: string = '1'
  29 + /*根评论id,如果是一级评论,传-1;否则,传当前评论所属的根评论id*/
  30 + rootCommentId: string = "-1"
25 /*父评论id,如果是其它评论的回复,该字段必填*/ 31 /*父评论id,如果是其它评论的回复,该字段必填*/
26 parentId: string = "-1" 32 parentId: string = "-1"
27 33
28 34
  35 + //可选
29 placeHolderText: string = "优质评论会获得最佳评论人的称号" 36 placeHolderText: string = "优质评论会获得最佳评论人的称号"
30 37
31 } 38 }
@@ -12,36 +12,37 @@ import { ifaa } from '@kit.OnlineAuthenticationKit'; @@ -12,36 +12,37 @@ import { ifaa } from '@kit.OnlineAuthenticationKit';
12 12
13 const TAG = 'CommentComponent'; 13 const TAG = 'CommentComponent';
14 14
  15 +const testString = '因为读书的人\n是低着头向上看的人\n身处一隅,却能放眼世界\n2,因为读书的人\n总是比不读书的人\n活得有趣一点\n3,因为读书的人\n即使平凡,绝不平庸'
15 16
16 // @Entry 17 // @Entry
17 @Preview 18 @Preview
18 @Component 19 @Component
19 export struct CommentComponent { 20 export struct CommentComponent {
20 - @State contentId: string = '30004266013'  
21 - /*内容类别, 1:点播,2:直播,3:活动,4:广告,5:专题,6:链接,7:榜单,8:图文,9:组图,10:H5新闻,11:频道,12:组件,13:音频,14:动态(13和14为中文版新增)*/  
22 - @State contentType: string = '8'  
23 - /*内容的标题,取bff内容详情接口中newsTitle字段*/  
24 - @State targetTitle: string = '北约同意向乌克兰提供防空系统在内的更多军事支持'  
25 - /*被评论的内容关系id*/  
26 - @State targetRelId: string = "500002849023"  
27 - /*关联的频道id/专题id*/  
28 - @State targetRelObjectId: string = "2002"  
29 - /*是否是重点稿件 1是 0否*/  
30 - @State keyArticle: string = "0"  
31 - /*被评论的内容关系类型,1.频道关系;2.专题关系;【人民号内容为空】默认0*/  
32 - @State targetRelType: string = "1" 21 +
33 // @State private browSingModel: commentListModel = new commentListModel() 22 // @State private browSingModel: commentListModel = new commentListModel()
  23 + /*必传*/
  24 + @ObjectLink publishCommentModel: publishCommentModel
  25 +
34 isloading: boolean = false 26 isloading: boolean = false
  27 +
35 @State allDatas: LazyDataSource<commentItemModel> = new LazyDataSource(); 28 @State allDatas: LazyDataSource<commentItemModel> = new LazyDataSource();
36 - @State publishCommentModel: publishCommentModel = new publishCommentModel()  
37 - @State dialogController: CustomDialogController | null = new CustomDialogController({  
38 29
  30 + @State dialogController: CustomDialogController | null = null;
  31 +
  32 +
  33 + // 在自定义组件即将析构销毁时将dialogControlle置空
  34 + aboutToDisappear() {
  35 + this.dialogController = null // 将dialogController置空
  36 + }
  37 +
  38 + aboutToAppear() {
  39 +
  40 + this.dialogController = new CustomDialogController({
39 builder: CommentCustomDialog({ 41 builder: CommentCustomDialog({
40 confirm: (value: Record<string, string>) => { 42 confirm: (value: Record<string, string>) => {
41 - this.publishComment(value) 43 +
42 }, 44 },
43 - commentText: this.publishCommentModel.commentContent,  
44 - placeHolderText: this.publishCommentModel.placeHolderText, 45 + publishCommentModel:this.publishCommentModel
45 }), 46 }),
46 autoCancel: true, 47 autoCancel: true,
47 alignment: DialogAlignment.Bottom, 48 alignment: DialogAlignment.Bottom,
@@ -52,20 +53,6 @@ export struct CommentComponent { @@ -52,20 +53,6 @@ export struct CommentComponent {
52 }, 53 },
53 }) 54 })
54 55
55 - // 在自定义组件即将析构销毁时将dialogControlle置空  
56 - aboutToDisappear() {  
57 - this.dialogController = null // 将dialogController置空  
58 - }  
59 -  
60 - aboutToAppear() {  
61 - this.publishCommentModel.targetTitle = this.targetTitle  
62 - this.publishCommentModel.targetId = this.contentId  
63 - this.publishCommentModel.targetType = this.contentType  
64 - this.publishCommentModel.targetRelId = this.targetRelId  
65 - this.publishCommentModel.targetRelType = this.targetRelType  
66 - this.publishCommentModel.targetRelObjectId = this.targetRelObjectId  
67 - this.publishCommentModel.keyArticle = this.keyArticle  
68 -  
69 this.getData(); 56 this.getData();
70 57
71 } 58 }
@@ -105,7 +92,7 @@ export struct CommentComponent { @@ -105,7 +92,7 @@ export struct CommentComponent {
105 /*查看更多和收起*/ 92 /*查看更多和收起*/
106 @Builder 93 @Builder
107 GroupFooterView(item: commentItemModel, index: number) { 94 GroupFooterView(item: commentItemModel, index: number) {
108 - footerExpandedView({ item: item, contentId: this.contentId, contentType: this.contentType }) 95 + footerExpandedView({ item: item, contentId: this.publishCommentModel.targetId, contentType: this.publishCommentModel.targetType })
109 } 96 }
110 97
111 build() { 98 build() {
@@ -152,13 +139,13 @@ export struct CommentComponent { @@ -152,13 +139,13 @@ export struct CommentComponent {
152 139
153 //获取数据 140 //获取数据
154 async getData() { 141 async getData() {
155 - commentViewModel.fetchContentCommentList('1', this.contentId, this.contentType).then(commentListModel => { 142 + commentViewModel.fetchContentCommentList('1', this.publishCommentModel.targetId, this.publishCommentModel.targetType).then(commentListModel => {
156 if (commentListModel && commentListModel.list && commentListModel.list.length > 0) { 143 if (commentListModel && commentListModel.list && commentListModel.list.length > 0) {
157 commentListModel.list.forEach(element => { 144 commentListModel.list.forEach(element => {
158 element.hasMore = Number.parseInt(element.childCommentNum) ? true : false 145 element.hasMore = Number.parseInt(element.childCommentNum) ? true : false
159 let newModel = commentViewModel.deepCopyCommentItemModel(element) 146 let newModel = commentViewModel.deepCopyCommentItemModel(element)
160 - newModel.targetId = this.contentId  
161 - newModel.targetType = this.contentType 147 + // newModel.targetId = this.publishCommentModel.targetId
  148 + // newModel.targetType = this.publishCommentModel.targetType
162 this.allDatas.push(newModel) 149 this.allDatas.push(newModel)
163 }); 150 });
164 151
@@ -167,20 +154,6 @@ export struct CommentComponent { @@ -167,20 +154,6 @@ export struct CommentComponent {
167 }) 154 })
168 155
169 } 156 }
170 -  
171 - /*回复评论*/  
172 - publishComment(value: Record<string, string>) {  
173 -  
174 - this.publishCommentModel.commentContent = value['commentContent']  
175 - this.publishCommentModel.commentType = value['commentType']  
176 -  
177 - commentViewModel.publishComment(this.publishCommentModel).then(() => {  
178 - this.publishCommentModel.commentContent = ''  
179 - }).catch(() => {  
180 -  
181 - })  
182 -  
183 - }  
184 } 157 }
185 158
186 159
@@ -230,7 +203,7 @@ struct ChildCommentItem { @@ -230,7 +203,7 @@ struct ChildCommentItem {
230 .fontSize(14) 203 .fontSize(14)
231 .fontColor($r('app.color.color_222222')) 204 .fontColor($r('app.color.color_222222'))
232 .fontWeight(FontWeight.Medium) 205 .fontWeight(FontWeight.Medium)
233 - .margin({ left: 0 , right:0}) 206 + .margin({ left: 0, right: 0 })
234 207
235 208
236 /// 暂时不显示 “我” 的标签了 209 /// 暂时不显示 “我” 的标签了
@@ -257,10 +230,12 @@ struct ChildCommentItem { @@ -257,10 +230,12 @@ struct ChildCommentItem {
257 .margin({ left: 5 }); 230 .margin({ left: 5 });
258 } 231 }
259 }.margin({ left: 0, right: 16 }) 232 }.margin({ left: 0, right: 16 })
  233 +
260 // .backgroundColor(Color.Red) 234 // .backgroundColor(Color.Red)
261 235
262 CommentText({ 236 CommentText({
263 longMessage: this.item.commentContent, 237 longMessage: this.item.commentContent,
  238 + // longMessage:testString,
264 maxline: 3, 239 maxline: 3,
265 fontSize: 14, 240 fontSize: 14,
266 fontWeight: FontWeight.Regular, 241 fontWeight: FontWeight.Regular,
@@ -297,12 +272,27 @@ struct footerExpandedView { @@ -297,12 +272,27 @@ struct footerExpandedView {
297 build() { 272 build() {
298 Row() { 273 Row() {
299 if (this.item.expanded) { 274 if (this.item.expanded) {
  275 + if (this.item.childsHasMore) {
  276 + Row() {
  277 + Text().backgroundColor($r('app.color.color_EDEDED')).width(24).height(1)
  278 + Text('查看更多回复').fontColor($r('app.color.color_222222')).fontSize(14).margin({ left: 6 })
  279 + Image($r('app.media.comment_unfold')).width(12).height(12)
  280 + }.margin({ left: 53 })
  281 + .onClick(() => {
  282 + if (this.item.isLoading) {
  283 + return
  284 + }
  285 + this.item.isLoading = true
  286 + fetchChildContentCommentList(this.contentId, this.contentType, this.item)
  287 + })
  288 + }
300 Row() { 289 Row() {
301 Text('收起').fontColor($r('app.color.color_222222')).fontSize(14) 290 Text('收起').fontColor($r('app.color.color_222222')).fontSize(14)
302 Image($r('app.media.comment_pickUp')).width(12).height(12) 291 Image($r('app.media.comment_pickUp')).width(12).height(12)
303 - }.margin({ left: 213 }) 292 + }.margin({ left: this.item.childsHasMore ? 32 : 213 })
304 .onClick(() => { 293 .onClick(() => {
305 - this.item.expanded = !this.item.expanded 294 + this.item.pageNum = 1
  295 + this.item.expanded = false
306 this.item.childComments = [] 296 this.item.childComments = []
307 this.item.childCommentsLazyDataSource.clear() 297 this.item.childCommentsLazyDataSource.clear()
308 }) 298 })
@@ -317,28 +307,35 @@ struct footerExpandedView { @@ -317,28 +307,35 @@ struct footerExpandedView {
317 return 307 return
318 } 308 }
319 this.item.isLoading = true 309 this.item.isLoading = true
320 - //load child  
321 - commentViewModel.fetchChildContentCommentList('1', this.contentId, this.contentType, this.item.id) 310 + fetchChildContentCommentList(this.contentId, this.contentType, this.item)
  311 + })
  312 + }
  313 + }.height(30)
  314 + }
  315 +}
  316 +
  317 +function fetchChildContentCommentList(contentId: string, contentType: string, item: commentItemModel) {
  318 +
  319 + commentViewModel.fetchChildContentCommentList(item.pageNum + '', contentId, contentType, item.id)
322 .then((commentListModel) => { 320 .then((commentListModel) => {
323 - this.item.isLoading = false  
324 - this.item.expanded = !this.item.expanded 321 + item.pageNum = item.pageNum + 1
  322 + item.childsHasMore = commentListModel.hasNext > 0 ? true : false
  323 + item.isLoading = false
  324 + item.expanded = true
325 commentListModel.list.forEach(element => { 325 commentListModel.list.forEach(element => {
326 - this.item.childComments.push(element) 326 + item.childComments.push(element)
327 let newModel = commentViewModel.deepCopyCommentItemModel(element) 327 let newModel = commentViewModel.deepCopyCommentItemModel(element)
328 - newModel.targetId = this.contentId  
329 - newModel.targetType = this.contentType 328 + newModel.targetId = contentId
  329 + newModel.targetType = contentType
330 330
331 - this.item.childCommentsLazyDataSource.push(newModel) 331 + item.childCommentsLazyDataSource.push(newModel)
332 }) 332 })
333 }).catch(() => { 333 }).catch(() => {
334 - this.item.isLoading = false  
335 - }) 334 + item.isLoading = false
336 }) 335 })
337 - }  
338 - }.height(30)  
339 - }  
340 } 336 }
341 337
  338 +
342 @Component 339 @Component
343 struct commentHeaderView { 340 struct commentHeaderView {
344 @Link publishCommentModel: publishCommentModel 341 @Link publishCommentModel: publishCommentModel
@@ -411,7 +408,14 @@ struct commentHeaderView { @@ -411,7 +408,14 @@ struct commentHeaderView {
411 marginWidth: (59 + 16) 408 marginWidth: (59 + 16)
412 }) 409 })
413 .margin({ left: 59, right: 16, top: -5 }) 410 .margin({ left: 59, right: 16, top: -5 })
414 - 411 + .onClick(() => {
  412 + this.publishCommentModel.rootCommentId = this.item.rootCommentId
  413 + this.publishCommentModel.parentId = this.item.id
  414 + this.publishCommentModel.placeHolderText = '回复' + this.item.fromUserName + ':'
  415 + if (this.dialogController != null) {
  416 + this.dialogController.open()
  417 + }
  418 + })
415 419
416 commentFooterView({ 420 commentFooterView({
417 item: this.item, 421 item: this.item,
@@ -456,7 +460,12 @@ struct commentFooterView { @@ -456,7 +460,12 @@ struct commentFooterView {
456 .fontColor($r('app.color.color_222222')) 460 .fontColor($r('app.color.color_222222'))
457 .fontSize(12) 461 .fontSize(12)
458 .onClick(() => { 462 .onClick(() => {
459 - //TODO: 回复 463 + this.publishCommentModel.rootCommentId = this.item.rootCommentId
  464 + this.publishCommentModel.parentId = this.item.id
  465 + this.publishCommentModel.placeHolderText = '回复' + this.item.fromUserName + ':'
  466 + if (this.dialogController != null) {
  467 + this.dialogController.open()
  468 + }
460 }) 469 })
461 } 470 }
462 471
@@ -5,27 +5,51 @@ import commentViewModel from '../viewmodel/CommentViewModel' @@ -5,27 +5,51 @@ import commentViewModel from '../viewmodel/CommentViewModel'
5 @Preview 5 @Preview
6 @CustomDialog 6 @CustomDialog
7 export struct CommentCustomDialog { 7 export struct CommentCustomDialog {
8 - commentText: string = ''  
9 - placeHolderText: string = '优质评论会获得最佳评论人的称号' 8 +
  9 + @ObjectLink publishCommentModel: publishCommentModel
10 controller?: CustomDialogController 10 controller?: CustomDialogController
11 confirm: (value: Record<string, string>) => void = () => { 11 confirm: (value: Record<string, string>) => void = () => {
12 } 12 }
13 @State private emojiSwitch: boolean = false 13 @State private emojiSwitch: boolean = false
14 textInputController: TextAreaController = new TextAreaController() 14 textInputController: TextAreaController = new TextAreaController()
15 15
  16 + aboutToAppear(): void {
  17 +
  18 +
  19 + }
  20 +
  21 + publishCommentRequest() {
  22 + let bean: Record<string, string> = {};
  23 + // this.publishCommentModel.commentContent = this.commentText
  24 + //TODO 判断类型
  25 + this.publishCommentModel.commentType = '1'
  26 + commentViewModel.publishComment(this.publishCommentModel).then(() => {
  27 + this.publishCommentModel.commentContent = ''
  28 + // this.commentText = ''
  29 + if (this.controller != null) {
  30 + this.controller.close()
  31 + }
  32 + this.confirm(bean)
  33 + }).catch(() => {
  34 + if (this.controller != null) {
  35 + this.controller.close()
  36 + }
  37 + })
  38 + }
  39 +
16 build() { 40 build() {
17 Column() { 41 Column() {
18 Row() { 42 Row() {
19 TextArea({ 43 TextArea({
20 - placeholder: this.placeHolderText, 44 + placeholder: this.publishCommentModel.placeHolderText,
21 controller: this.textInputController, 45 controller: this.textInputController,
22 - text: this.commentText 46 + text: this.publishCommentModel.commentContent
23 }) 47 })
24 .height('100%') 48 .height('100%')
25 .width('100%') 49 .width('100%')
26 .backgroundColor($r('app.color.color_transparent')) 50 .backgroundColor($r('app.color.color_transparent'))
27 .onChange(value => { 51 .onChange(value => {
28 - this.commentText = value; 52 + this.publishCommentModel.commentContent = value;
29 }) 53 })
30 } 54 }
31 .backgroundColor('#F9F9F9') 55 .backgroundColor('#F9F9F9')
@@ -68,18 +92,11 @@ export struct CommentCustomDialog { @@ -68,18 +92,11 @@ export struct CommentCustomDialog {
68 .textAlign(TextAlign.Center) 92 .textAlign(TextAlign.Center)
69 .borderRadius(4) 93 .borderRadius(4)
70 .onClick(() => { 94 .onClick(() => {
71 - if (this.commentText.length > 0) { 95 + if (this.publishCommentModel.commentContent.length > 0) {
72 //请求评论接口 96 //请求评论接口
73 //commentType 97 //commentType
74 //commentContent 98 //commentContent
75 - let bean: Record<string, string> = {};  
76 - bean['commentContent'] = this.commentText  
77 - //TODO 判断类型  
78 - bean['commentType'] = '1'  
79 - this.confirm(bean)  
80 - if (this.controller != null) {  
81 - this.controller.close()  
82 - } 99 + this.publishCommentRequest()
83 } 100 }
84 }) 101 })
85 } 102 }
  1 +
  2 +import { publishCommentModel } from '../model/PublishCommentModel'
  3 +
  4 +@Preview
  5 +@Component
  6 +export struct CommentTabComponent {
  7 + @ObjectLink publishCommentModel: publishCommentModel
  8 +
  9 + build() {
  10 + }
  11 +}
@@ -44,7 +44,8 @@ export struct CommentText { @@ -44,7 +44,8 @@ export struct CommentText {
44 textContent: this.longMessage, 44 textContent: this.longMessage,
45 fontSize: this.fontSize, 45 fontSize: this.fontSize,
46 fontWeight: this.fontWeight, 46 fontWeight: this.fontWeight,
47 - constraintWidth: (this.screenWidth - padding) 47 + constraintWidth: (this.screenWidth - padding),
  48 + wordBreak:WordBreak.BREAK_ALL
48 }) 49 })
49 50
50 console.log(`文本宽度为:${this.textWidth}`) 51 console.log(`文本宽度为:${this.textWidth}`)
@@ -71,7 +72,8 @@ export struct CommentText { @@ -71,7 +72,8 @@ export struct CommentText {
71 textContent: string, 72 textContent: string,
72 fontSize: this.fontSize, 73 fontSize: this.fontSize,
73 fontWeight: this.fontWeight, 74 fontWeight: this.fontWeight,
74 - constraintWidth: (this.screenWidth - padding) 75 + constraintWidth: (this.screenWidth - padding),
  76 + wordBreak:WordBreak.BREAK_ALL
75 }) 77 })
76 78
77 //计算有误差20 79 //计算有误差20
@@ -130,6 +132,7 @@ export struct CommentText { @@ -130,6 +132,7 @@ export struct CommentText {
130 .fontWeight(this.fontWeight) 132 .fontWeight(this.fontWeight)
131 .fontColor(this.fontColor) 133 .fontColor(this.fontColor)
132 .maxLines(this.lines) 134 .maxLines(this.lines)
  135 + .wordBreak(WordBreak.BREAK_ALL)
133 136
134 // .backgroundColor(Color.Red) 137 // .backgroundColor(Color.Red)
135 138
@@ -8,6 +8,10 @@ import { MyCommentDataSource } from '../model/MyCommentDataSource' @@ -8,6 +8,10 @@ import { MyCommentDataSource } from '../model/MyCommentDataSource'
8 import { HttpUtils } from 'wdNetwork/src/main/ets/utils/HttpUtils' 8 import { HttpUtils } from 'wdNetwork/src/main/ets/utils/HttpUtils'
9 import { HttpUrlUtils } from 'wdNetwork/Index' 9 import { HttpUrlUtils } from 'wdNetwork/Index'
10 import PageModel from '../../../viewmodel/PageModel' 10 import PageModel from '../../../viewmodel/PageModel'
  11 +import { ErrorComponent } from '../../view/ErrorComponent'
  12 +import { EmptyComponent , WDViewDefaultType} from '../../view/EmptyComponent'
  13 +import { CustomPullToRefresh } from '../../reusable/CustomPullToRefresh'
  14 +import NoMoreLayout from '../../page/NoMoreLayout'
11 15
12 const TAG = 'QualityCommentsComponent'; 16 const TAG = 'QualityCommentsComponent';
13 17
@@ -16,8 +20,13 @@ const TAG = 'QualityCommentsComponent'; @@ -16,8 +20,13 @@ const TAG = 'QualityCommentsComponent';
16 @Component 20 @Component
17 export struct QualityCommentsComponent { 21 export struct QualityCommentsComponent {
18 22
19 - @State private browSingModel: PageModel = new PageModel()  
20 - isloading : boolean = false 23 + //刷新
  24 + @State viewType:number = ViewType.LOADING;
  25 + @State hasMore: boolean = true;
  26 + @State currentPage: number = 1;
  27 + private scroller: Scroller = new Scroller();
  28 +
  29 +
21 30
22 @State tileOpacity: number = 0; 31 @State tileOpacity: number = 0;
23 firstPositionY: number = 0; 32 firstPositionY: number = 0;
@@ -25,7 +34,7 @@ export struct QualityCommentsComponent { @@ -25,7 +34,7 @@ export struct QualityCommentsComponent {
25 topSafeHeight: number = AppStorage.get<number>('topSafeHeight') as number; 34 topSafeHeight: number = AppStorage.get<number>('topSafeHeight') as number;
26 lastWindowColor: string = '#ffffff' 35 lastWindowColor: string = '#ffffff'
27 currentWindowColor: string = '#FF4202' 36 currentWindowColor: string = '#FF4202'
28 - @State allDatas: MyCommentDataSource = new MyCommentDataSource(); 37 + @State allDatas: LazyDataSource<commentItemModel> = new LazyDataSource();
29 38
30 aboutToDisappear(): void { 39 aboutToDisappear(): void {
31 40
@@ -40,14 +49,31 @@ export struct QualityCommentsComponent { @@ -40,14 +49,31 @@ export struct QualityCommentsComponent {
40 aboutToAppear(): void { 49 aboutToAppear(): void {
41 50
42 this.fullScreen(); 51 this.fullScreen();
  52 + this.getData();
  53 +
  54 + }
  55 +
  56 + getData(resolve?: (value: string | PromiseLike<string>) => void){
  57 + commentViewModel.fetchQualityCommentList(this.currentPage + '').then((commentListModel) => {
  58 + if(resolve) resolve('刷新成功')
43 59
44 - commentViewModel.fetchQualityCommentList('1').then((commentListModel) => {  
45 if (commentListModel && commentListModel.list && commentListModel.list.length > 0) { 60 if (commentListModel && commentListModel.list && commentListModel.list.length > 0) {
  61 + if (this.currentPage === 1) {
  62 + this.allDatas.clear()
  63 + }
46 commentListModel.list.forEach(element => { 64 commentListModel.list.forEach(element => {
47 - this.allDatas.pushData(commentViewModel.deepCopyCommentItemModel(element)) 65 + this.allDatas.push(commentViewModel.deepCopyCommentItemModel(element))
48 }); 66 });
49 - } else {  
50 67
  68 + if (commentListModel.hasNext === 0) {
  69 + this.hasMore = false;
  70 + } else {
  71 + this.hasMore = true;
  72 + }
  73 + } else {
  74 + if (this.currentPage === 1) {
  75 + this.viewType = ViewType.EMPTY;
  76 + }
51 } 77 }
52 }) 78 })
53 } 79 }
@@ -151,20 +177,77 @@ export struct QualityCommentsComponent { @@ -151,20 +177,77 @@ export struct QualityCommentsComponent {
151 177
152 build() { 178 build() {
153 Column() { 179 Column() {
  180 +
  181 +
154 Stack({ alignContent: Alignment.Top }) { 182 Stack({ alignContent: Alignment.Top }) {
155 183
156 Scroll() { 184 Scroll() {
157 Column() { 185 Column() {
158 Stack() { 186 Stack() {
159 this.titleHeader() 187 this.titleHeader()
  188 + this.listLayout()
  189 +
  190 + // if(this.viewType == ViewType.ERROR){
  191 + // ErrorComponent()
  192 + // }else if(this.viewType == ViewType.EMPTY){
  193 + // EmptyComponent({emptyType:WDViewDefaultType.WDViewDefaultType_NoComment})
  194 + // }else {
  195 + // CustomPullToRefresh({
  196 + // alldata:[],
  197 + // scroller:this.scroller,
  198 + // customList:()=>{
  199 + // // this.listLayout()
  200 + // this.testLayout()
  201 + // },
  202 + // onRefresh:(resolve)=>{
  203 + // this.currentPage = 1
  204 + // this.getData(resolve)
  205 + // },
  206 + // onLoadMore:(resolve)=> {
  207 + // if (this.hasMore === false) {
  208 + // if(resolve) resolve('')
  209 + // return
  210 + // }
  211 + // this.currentPage++
  212 + // this.getData(resolve)
  213 + // }
  214 + // })
  215 + // }
160 216
161 - List({ space: 12 }) { 217 +
  218 +
  219 +
  220 + }.alignContent(Alignment.Top)
  221 + }.backgroundColor(this.currentWindowColor).width('100%')
  222 + }
  223 + .friction(0.6)
  224 + .scrollBar(BarState.Off)
  225 + .edgeEffect(EdgeEffect.None)
  226 + .width('100%')
  227 + .height('100%')
  228 +
  229 + this.TabbarTransparent()
  230 + this.TabbarNormal()
  231 +
  232 + }
  233 +
  234 + }
  235 +
  236 + }
  237 +
  238 + @Builder
  239 + listLayout(){
  240 + List({ space: 12, scroller:this.scroller }) {
162 // ListItemGroup({ header: this.titleHeader() }) 241 // ListItemGroup({ header: this.titleHeader() })
163 LazyForEach(this.allDatas, (item: commentItemModel, index: number) => { 242 LazyForEach(this.allDatas, (item: commentItemModel, index: number) => {
164 ListItem() { 243 ListItem() {
165 QualityCommentItem({ item: item, index: index }).margin({ left: 12, right: 12 }) 244 QualityCommentItem({ item: item, index: index }).margin({ left: 12, right: 12 })
166 } 245 }
167 }) 246 })
  247 + // 加载更多
  248 + ListItem() {
  249 + if (this.hasMore === false) NoMoreLayout()
  250 + }
168 ListItem() { 251 ListItem() {
169 252
170 }.height(this.bottomSafeHeight) 253 }.height(this.bottomSafeHeight)
@@ -172,36 +255,31 @@ export struct QualityCommentsComponent { @@ -172,36 +255,31 @@ export struct QualityCommentsComponent {
172 .margin({ top: 196 }) 255 .margin({ top: 196 })
173 .height("100%") 256 .height("100%")
174 .width("100%") 257 .width("100%")
175 - .edgeEffect(EdgeEffect.Spring) 258 + .edgeEffect(EdgeEffect.None) // 必须设置列表为滑动到边缘无效果
  259 + // .edgeEffect(EdgeEffect.Spring)
176 .nestedScroll({ 260 .nestedScroll({
177 scrollForward: NestedScrollMode.PARENT_FIRST, 261 scrollForward: NestedScrollMode.PARENT_FIRST,
178 scrollBackward: NestedScrollMode.SELF_FIRST 262 scrollBackward: NestedScrollMode.SELF_FIRST
179 }) 263 })
180 -  
181 - // .margin({ bottom: this.bottomSafeHeight })  
182 -  
183 - // .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.BOTTOM])  
184 - }.alignContent(Alignment.Top)  
185 - }.backgroundColor(this.currentWindowColor).width('100%')  
186 } 264 }
187 - .friction(0.6)  
188 - .scrollBar(BarState.Off)  
189 - .edgeEffect(EdgeEffect.None)  
190 - .width('100%')  
191 - .height('100%')  
192 -  
193 - this.TabbarTransparent()  
194 - this.TabbarNormal()  
195 265
196 266
  267 + @Builder
  268 + testLayout(){
  269 + List({ space: 12, scroller:this.scroller }){
  270 + LazyForEach(this.allDatas, (item: commentItemModel, index: number) => {
  271 + ListItem() {
  272 + // QualityCommentItem({ item: item, index: index }).margin({ left: 12, right: 12 })
197 } 273 }
198 - 274 + })
199 } 275 }
200 -  
201 } 276 }
  277 +
202 } 278 }
203 279
204 280
  281 +
  282 +
205 @Component 283 @Component
206 struct QualityCommentItem { 284 struct QualityCommentItem {
207 @ObjectLink item: commentItemModel 285 @ObjectLink item: commentItemModel
@@ -316,10 +394,10 @@ struct QualityCommentItem { @@ -316,10 +394,10 @@ struct QualityCommentItem {
316 .margin({ left: 3 }) 394 .margin({ left: 3 })
317 } 395 }
318 }.onClick(() => { 396 }.onClick(() => {
319 - commentViewModel.commnetLikeChange(this.item) 397 + commentLikeChange(this.item)
320 commentViewModel.commentLike(this.item).then(() => { 398 commentViewModel.commentLike(this.item).then(() => {
321 }).catch(() => { 399 }).catch(() => {
322 - commentViewModel.commnetLikeChange(this.item) 400 + commentLikeChange(this.item)
323 }) 401 })
324 }) 402 })
325 } 403 }
@@ -331,5 +409,24 @@ struct QualityCommentItem { @@ -331,5 +409,24 @@ struct QualityCommentItem {
331 } 409 }
332 } 410 }
333 411
  412 +function commentLikeChange(item: commentItemModel) {
  413 + item.api_status = !item.api_status
  414 + //点赞
  415 + if (item.api_status) {
  416 + if (item.likeNum.length > 0) {
  417 + item.likeNum = (Number.parseInt(item.likeNum) + 1) + ''
  418 + } else {
  419 + item.likeNum = '1'
  420 + }
  421 + }
  422 + //取消点赞
  423 + if (!item.api_status) {
  424 + item.likeNum = (Number.parseInt(item.likeNum) - 1) + ''
  425 + if (Number.parseInt(item.likeNum) <= 0) {
  426 + item.likeNum = ''
  427 + }
  428 + }
  429 +}
  430 +
334 431
335 432
@@ -239,7 +239,8 @@ class CommentViewModel { @@ -239,7 +239,8 @@ class CommentViewModel {
239 239
240 let promiseArray: Promise<commentStatusListModel | void>[] = []; 240 let promiseArray: Promise<commentStatusListModel | void>[] = [];
241 241
242 - //TODO 未登录不用批查 242 + //未登录不用批查
  243 + if (HttpUrlUtils.getUserId()){
243 if (commentIDs.length > 0) { 244 if (commentIDs.length > 0) {
244 let promise1 = new Promise<void>((success) => { 245 let promise1 = new Promise<void>((success) => {
245 // HttpRequest HttpBizUtil 246 // HttpRequest HttpBizUtil
@@ -284,7 +285,7 @@ class CommentViewModel { @@ -284,7 +285,7 @@ class CommentViewModel {
284 }) 285 })
285 promiseArray.push(promise1); 286 promiseArray.push(promise1);
286 } 287 }
287 - 288 + }
288 if (fromUserIDs.length > 0) { 289 if (fromUserIDs.length > 0) {
289 let promise2 = new Promise<void>((success) => { 290 let promise2 = new Promise<void>((success) => {
290 let url = HttpUrlUtils.getBatchUserUrl(); 291 let url = HttpUrlUtils.getBatchUserUrl();
@@ -385,21 +386,7 @@ class CommentViewModel { @@ -385,21 +386,7 @@ class CommentViewModel {
385 386
386 } 387 }
387 388
388 - commnetLikeChange(model: commentItemModel) {  
389 - model.api_status = !model.api_status  
390 - //点赞  
391 - if (model.api_status) {  
392 - model.likeNum = (Number.parseInt(model.likeNum) + 1) + ''  
393 - }  
394 - //取消点赞  
395 - if (!model.api_status) {  
396 - model.likeNum = (Number.parseInt(model.likeNum) - 1) + ''  
397 - if (Number.parseInt(model.likeNum) < 0) {  
398 - model.likeNum = '0'  
399 - }  
400 - }  
401 - // return model  
402 - } 389 +
403 390
404 deepCopyCommentItemModel(model: commentItemModel) { 391 deepCopyCommentItemModel(model: commentItemModel) {
405 let newModel = new commentItemModel() 392 let newModel = new commentItemModel()
@@ -88,11 +88,11 @@ export struct ZhCarouselLayout01 { @@ -88,11 +88,11 @@ export struct ZhCarouselLayout01 {
88 .curve(Curve.Linear) 88 .curve(Curve.Linear)
89 .autoPlay(this.isAutoPlay()) 89 .autoPlay(this.isAutoPlay())
90 .onAnimationStart((index: number, targetIndex: number) => { 90 .onAnimationStart((index: number, targetIndex: number) => {
91 - Logger.info(TAG, `Swiper onAnimationStart index : ${index}, targetIndex: ${targetIndex}`); 91 + // Logger.info(TAG, `Swiper onAnimationStart index : ${index}, targetIndex: ${targetIndex}`);
92 this.swiperIndex = targetIndex 92 this.swiperIndex = targetIndex
93 }) 93 })
94 .onChange((index: number) => { 94 .onChange((index: number) => {
95 - Logger.info(TAG, `Swiper onChange index : ${index}`); 95 + // Logger.info(TAG, `Swiper onChange index : ${index}`);
96 96
97 }) 97 })
98 .onAnimationEnd((index: number, extraInfo: SwiperAnimationEvent) => { 98 .onAnimationEnd((index: number, extraInfo: SwiperAnimationEvent) => {
@@ -100,7 +100,7 @@ export struct ZhCarouselLayout01 { @@ -100,7 +100,7 @@ export struct ZhCarouselLayout01 {
100 setTimeout(() => { 100 setTimeout(() => {
101 this.SecondWd = 12 101 this.SecondWd = 12
102 }, 2000) 102 }, 2000)
103 - console.info("onAnimationEnd, index: " + index) 103 + // console.info("onAnimationEnd, index: " + index)
104 }) 104 })
105 105
106 if (this.compDTO?.operDataList.length > 1) { 106 if (this.compDTO?.operDataList.length > 1) {
@@ -65,7 +65,11 @@ export struct ZhGridLayout03 { @@ -65,7 +65,11 @@ export struct ZhGridLayout03 {
65 } 65 }
66 .width('100%') 66 .width('100%')
67 .onClick((event: ClickEvent) => { 67 .onClick((event: ClickEvent) => {
  68 + if (item.objectType === '11') {
  69 + ProcessUtils.jumpChannelTab(item.objectId, item.pageId)
  70 + } else {
68 ProcessUtils.processPage(item) 71 ProcessUtils.processPage(item)
  72 + }
69 }) 73 })
70 } 74 }
71 } 75 }
@@ -15,8 +15,14 @@ const TAG = 'Zh_Single_Column-09' @@ -15,8 +15,14 @@ const TAG = 'Zh_Single_Column-09'
15 @Component 15 @Component
16 export struct ZhSingleColumn09 { 16 export struct ZhSingleColumn09 {
17 @State compDTO: CompDTO = {} as CompDTO 17 @State compDTO: CompDTO = {} as CompDTO
18 - @State list: Array<string> = ['社会', '三个字', '是四个字', '时事', '社会', '三个字', '是四个字', '时事']  
19 @State activeIndexs: Array<number> = [] 18 @State activeIndexs: Array<number> = []
  19 + @State operDataList: ContentDTO[] = this.compDTO?.operDataList || []
  20 + @State selfClosed: Boolean = false;
  21 +
  22 + aboutToAppear(): void {
  23 + this.operDataList = this.shuffleArray(this.compDTO?.operDataList)
  24 + }
  25 +
20 26
21 getItemWidth(index: number) { 27 getItemWidth(index: number) {
22 if (index % 4 === 0 || index % 4 === 3) { 28 if (index % 4 === 0 || index % 4 === 3) {
@@ -26,12 +32,56 @@ export struct ZhSingleColumn09 { @@ -26,12 +32,56 @@ export struct ZhSingleColumn09 {
26 } 32 }
27 } 33 }
28 34
  35 + shuffleArray(array: ContentDTO[]) {
  36 + for(let i = array.length - 1; i > 0; i--) {
  37 + const j = Math.floor(Math.random() * (i + 1));
  38 + const tempArray = array[i];
  39 + array[i] = array[j];
  40 + array[j] = tempArray
  41 + }
  42 + return array
  43 + }
  44 +
29 build() { 45 build() {
30 Column() { 46 Column() {
31 //顶部 47 //顶部
32 - this.CompHeader(this.compDTO) 48 + Row() {
  49 + Column() {
  50 + Text('以下是否有您感兴趣?')
  51 + .fontSize(18)
  52 + .fontColor(0x000000)
  53 + .fontWeight(600)
  54 + .width('70%')
  55 + .margin({bottom: 4})
  56 +
  57 + Text('选中标签,为您推荐更多您感兴趣的内容')
  58 + .fontSize(12)
  59 + .fontColor(0xB0B0B0)
  60 + .margin({bottom: 10})
  61 + .width('70%')
  62 + }
  63 +
  64 + Button('选好了', { type: ButtonType.Normal, stateEffect: false })
  65 + .fontColor(this.activeIndexs.length > 0 ? 0xed2800 : 0xB0B0B0)
  66 + .fontSize(14)
  67 + .width(62)
  68 + .height(26)
  69 + .backgroundColor(this.activeIndexs.length > 0 ? 0xfdf0ed : 0xf5f5f5)
  70 + // .lineHeight(26)
  71 + .borderRadius(4)
  72 + .margin({top: -10})
  73 + .padding({top: 0, bottom: 0, left: 0, right: 0})
  74 + .onClick(() => {
  75 + if (this.activeIndexs.length > 0) {
  76 + this.selfClosed = true;
  77 + }
  78 + })
  79 + }
  80 + .justifyContent(FlexAlign.SpaceBetween)
  81 + .width('100%')
  82 +
33 Grid() { 83 Grid() {
34 - ForEach(this.compDTO.operDataList, (item: ContentDTO, index: number) => { 84 + ForEach(this.operDataList, (item: ContentDTO, index: number) => {
35 GridItem() { 85 GridItem() {
36 Stack({alignContent: Alignment.TopEnd}) { 86 Stack({alignContent: Alignment.TopEnd}) {
37 Image(item.coverUrl) 87 Image(item.coverUrl)
@@ -73,17 +123,24 @@ export struct ZhSingleColumn09 { @@ -73,17 +123,24 @@ export struct ZhSingleColumn09 {
73 Row() { 123 Row() {
74 Text('换一换') 124 Text('换一换')
75 .fontSize(14) 125 .fontSize(14)
76 - .fontColor(0xed2800) 126 + .fontColor(this.compDTO?.operDataList.length > 8 ? 0xed2800 : 0xB0B0B0)
77 .margin({right: 4}) 127 .margin({right: 4})
78 - Image($r('app.media.icon_refresh')) 128 + Image(this.compDTO?.operDataList.length > 8 ? $r('app.media.icon_refresh') : $r('app.media.ic_refresh'))
79 .width(14) 129 .width(14)
80 .height(14) 130 .height(14)
81 } 131 }
  132 + .onClick(() => {
  133 + if (this.compDTO?.operDataList.length > 8) {
  134 + this.operDataList = this.shuffleArray(this.operDataList)
  135 + this.activeIndexs = [];
  136 + }
  137 + })
82 138
83 Image($r("app.media.close_button")) 139 Image($r("app.media.close_button"))
84 .width(14) 140 .width(14)
85 .height(14) 141 .height(14)
86 .onClick(() => { 142 .onClick(() => {
  143 + this.selfClosed = true;
87 }) 144 })
88 } 145 }
89 .height(40) 146 .height(40)
@@ -98,42 +155,7 @@ export struct ZhSingleColumn09 { @@ -98,42 +155,7 @@ export struct ZhSingleColumn09 {
98 bottom: $r('app.float.card_comp_pagePadding_tb') 155 bottom: $r('app.float.card_comp_pagePadding_tb')
99 }) 156 })
100 .backgroundColor($r('app.color.white')) 157 .backgroundColor($r('app.color.white'))
101 - .margin({ bottom: 8 })  
102 -  
103 - }  
104 -  
105 - @Builder  
106 - CompHeader(item: CompDTO) {  
107 - Row() {  
108 - Column() {  
109 - Text('以下是否有您感兴趣?')  
110 - .fontSize(18)  
111 - .fontColor(0x000000)  
112 - .fontWeight(600)  
113 - .width('70%')  
114 - .margin({bottom: 4})  
115 -  
116 - Text('选中标签,为您推荐更多您感兴趣的内容')  
117 - .fontSize(12)  
118 - .fontColor(0xB0B0B0)  
119 - .margin({bottom: 10})  
120 - .width('70%')  
121 - }  
122 -  
123 - Text('选好了')  
124 - .fontColor(0xed2800)  
125 - .fontSize(14)  
126 - .width(62)  
127 - .height(26)  
128 - .backgroundColor(0xfdf0ed)  
129 - .textAlign(TextAlign.Center)  
130 - // .lineHeight(26)  
131 - .borderRadius(4)  
132 - .margin({top: -10})  
133 -  
134 - }  
135 - .justifyContent(FlexAlign.SpaceBetween)  
136 - .width('100%') 158 + .visibility(this.selfClosed ? Visibility.None : Visibility.Visible)
137 } 159 }
138 } 160 }
139 161
@@ -70,9 +70,7 @@ export struct ZhSingleRow02 { @@ -70,9 +70,7 @@ export struct ZhSingleRow02 {
70 .height(14) 70 .height(14)
71 .onClick(() => { 71 .onClick(() => {
72 // TODO 跳转的页面,定义的入参可能不合理。推荐id: 41 72 // TODO 跳转的页面,定义的入参可能不合理。推荐id: 41
73 - let params: Params = {  
74 - pageID: "1"  
75 - } 73 + let params = {'index': "1"} as Record<string, string>
76 WDRouterRule.jumpWithPage(WDRouterPage.followListPage, params) 74 WDRouterRule.jumpWithPage(WDRouterPage.followListPage, params)
77 }) 75 })
78 } 76 }
@@ -80,10 +78,13 @@ export struct ZhSingleRow02 { @@ -80,10 +78,13 @@ export struct ZhSingleRow02 {
80 right: $r('app.float.card_comp_pagePadding_lf'), 78 right: $r('app.float.card_comp_pagePadding_lf'),
81 }) 79 })
82 .onClick(() => { 80 .onClick(() => {
83 - let params: Params = {  
84 - pageID: "1" 81 + if (this.compDTO?.objectType === '11') {
  82 + ProcessUtils.jumpChannelTab(this.compDTO.objectId, this.compDTO.pageId as string)
  83 + } else if (this.compDTO?.objectType === '5') {
  84 + ProcessUtils._gotoSpecialTopic(this.compDTO.linkUrl)
  85 + } else if (this.compDTO?.objectType === '6') {
  86 + ProcessUtils._gotoDefaultWeb(this.compDTO.linkUrl)
85 } 87 }
86 - WDRouterRule.jumpWithPage(WDRouterPage.followListPage, params)  
87 }) 88 })
88 } 89 }
89 .justifyContent(FlexAlign.SpaceBetween) 90 .justifyContent(FlexAlign.SpaceBetween)
@@ -36,6 +36,15 @@ export struct ZhSingleRow04 { @@ -36,6 +36,15 @@ export struct ZhSingleRow04 {
36 .width(14) 36 .width(14)
37 .height(14) 37 .height(14)
38 } 38 }
  39 + .onClick(() => {
  40 + if (this.compDTO?.objectType === '11') {
  41 + ProcessUtils.jumpChannelTab(this.compDTO.objectId, this.compDTO.pageId as string)
  42 + } else if (this.compDTO?.objectType === '5') {
  43 + ProcessUtils._gotoSpecialTopic(this.compDTO.linkUrl)
  44 + } else if (this.compDTO?.objectType === '6') {
  45 + ProcessUtils._gotoDefaultWeb(this.compDTO.linkUrl)
  46 + }
  47 + })
39 } 48 }
40 .justifyContent(FlexAlign.SpaceBetween) 49 .justifyContent(FlexAlign.SpaceBetween)
41 .margin({ top: 8, bottom: 8 }) 50 .margin({ top: 8, bottom: 8 })
@@ -83,9 +83,7 @@ export struct ZhSingleRow05 { @@ -83,9 +83,7 @@ export struct ZhSingleRow05 {
83 .height(14) 83 .height(14)
84 .onClick(() => { 84 .onClick(() => {
85 // TODO 跳转的页面,定义的入参可能不合理。推荐id: 41 85 // TODO 跳转的页面,定义的入参可能不合理。推荐id: 41
86 - let params: Params = {  
87 - pageID: "1"  
88 - } 86 + let params = {'index': "1"} as Record<string, string>;
89 WDRouterRule.jumpWithPage(WDRouterPage.followListPage, params) 87 WDRouterRule.jumpWithPage(WDRouterPage.followListPage, params)
90 }) 88 })
91 } 89 }
1 -import { Logger, StringUtils, UserDataLocal } from 'wdKit' 1 +import { StringUtils, UserDataLocal } from 'wdKit'
2 import { WDRouterPage, WDRouterRule } from 'wdRouter' 2 import { WDRouterPage, WDRouterRule } from 'wdRouter'
3 import MinePageDatasModel from '../../model/MinePageDatasModel' 3 import MinePageDatasModel from '../../model/MinePageDatasModel'
4 const TAG = "MinePageUserSimpleInfoUI" 4 const TAG = "MinePageUserSimpleInfoUI"
@@ -4,6 +4,8 @@ import { ListHasNoMoreDataUI } from '../../reusable/ListHasNoMoreDataUI'; @@ -4,6 +4,8 @@ import { ListHasNoMoreDataUI } from '../../reusable/ListHasNoMoreDataUI';
4 import { MineAppointmentItem } from '../../../viewmodel/MineAppointmentItem'; 4 import { MineAppointmentItem } from '../../../viewmodel/MineAppointmentItem';
5 import { LazyDataSource, StringUtils } from 'wdKit'; 5 import { LazyDataSource, StringUtils } from 'wdKit';
6 import MinePageDatasModel from '../../../model/MinePageDatasModel'; 6 import MinePageDatasModel from '../../../model/MinePageDatasModel';
  7 +import { EmptyComponent } from '../../view/EmptyComponent';
  8 +
7 const TAG = "AppointmentListUI" 9 const TAG = "AppointmentListUI"
8 10
9 @Component 11 @Component
@@ -23,7 +25,9 @@ export struct AppointmentListUI{ @@ -23,7 +25,9 @@ export struct AppointmentListUI{
23 //标题栏目 25 //标题栏目
24 CustomTitleUI({titleName:"预约列表"}) 26 CustomTitleUI({titleName:"预约列表"})
25 if(this.count == 0){ 27 if(this.count == 0){
26 - ListHasNoMoreDataUI({style:2}) 28 + EmptyComponent({emptyType:10})
  29 + .height('100%')
  30 + .width('100%')
27 }else{ 31 }else{
28 //刷新控件 TODO 32 //刷新控件 TODO
29 //List 33 //List
@@ -84,6 +88,8 @@ export struct AppointmentListUI{ @@ -84,6 +88,8 @@ export struct AppointmentListUI{
84 this.hasMore = false 88 this.hasMore = false
85 } 89 }
86 } 90 }
  91 + }).catch((err:Error)=>{
  92 + console.log(TAG,JSON.stringify(err))
87 }) 93 })
88 } 94 }
89 this.isLoading = false 95 this.isLoading = false
@@ -15,6 +15,7 @@ export struct ChildCommentComponent { @@ -15,6 +15,7 @@ export struct ChildCommentComponent {
15 @State isExpandParent: boolean = false; 15 @State isExpandParent: boolean = false;
16 @State isOverLines: boolean = false 16 @State isOverLines: boolean = false
17 @State isOverLinesParent: boolean = false 17 @State isOverLinesParent: boolean = false
  18 + testText:string = "1,因为读书的人\n是低着头向上看的人\n身处一隅,却能放眼世界\n2,因为读书的人\n总是比不读书的人\n活得有趣一点\n3,因为读书的人\n即使平凡,绝不平庸"
18 19
19 build() { 20 build() {
20 Column() { 21 Column() {
@@ -71,7 +72,7 @@ export struct ChildCommentComponent { @@ -71,7 +72,7 @@ export struct ChildCommentComponent {
71 }) 72 })
72 } 73 }
73 } 74 }
74 - .margin({ bottom: '10lpx' }) 75 + .margin({ bottom: '5lpx' })
75 .width('100%') 76 .width('100%')
76 .height('108lpx') 77 .height('108lpx')
77 .padding({ left: '31lpx', right: '31lpx' }) 78 .padding({ left: '31lpx', right: '31lpx' })
@@ -93,6 +94,7 @@ export struct ChildCommentComponent { @@ -93,6 +94,7 @@ export struct ChildCommentComponent {
93 }) 94 })
94 } 95 }
95 }.maxLines(5) 96 }.maxLines(5)
  97 + .wordBreak(WordBreak.BREAK_ALL)
96 .textStyle() 98 .textStyle()
97 } 99 }
98 }.padding({ left: '31lpx', right: '31lpx' }) 100 }.padding({ left: '31lpx', right: '31lpx' })
@@ -138,6 +140,7 @@ export struct ChildCommentComponent { @@ -138,6 +140,7 @@ export struct ChildCommentComponent {
138 }) 140 })
139 } 141 }
140 }.maxLines(5) 142 }.maxLines(5)
  143 + .wordBreak(WordBreak.BREAK_ALL)
141 .textAlign(TextAlign.Start) 144 .textAlign(TextAlign.Start)
142 .width('100%') 145 .width('100%')
143 } 146 }
@@ -243,11 +246,13 @@ export struct ChildCommentComponent { @@ -243,11 +246,13 @@ export struct ChildCommentComponent {
243 let measureTruncateWidth: number = measure.measureText({ 246 let measureTruncateWidth: number = measure.measureText({
244 textContent: truncateContent, 247 textContent: truncateContent,
245 fontSize: px2fp(fontSize), 248 fontSize: px2fp(fontSize),
  249 + wordBreak:WordBreak.BREAK_ALL
246 }) 250 })
247 if(type === 1){ 251 if(type === 1){
248 measureTruncateWidth = measureTruncateWidth + measure.measureText({ 252 measureTruncateWidth = measureTruncateWidth + measure.measureText({
249 textContent: `@${this.data.parentCommentUserName}:`, 253 textContent: `@${this.data.parentCommentUserName}:`,
250 fontSize: px2fp(fontSize), 254 fontSize: px2fp(fontSize),
  255 + wordBreak:WordBreak.BREAK_ALL
251 }) 256 })
252 } 257 }
253 let clipStr: string = '' 258 let clipStr: string = ''
@@ -255,6 +260,7 @@ export struct ChildCommentComponent { @@ -255,6 +260,7 @@ export struct ChildCommentComponent {
255 if (measure.measureText({ 260 if (measure.measureText({
256 textContent: clipStr, 261 textContent: clipStr,
257 fontSize: px2fp(fontSize), 262 fontSize: px2fp(fontSize),
  263 + wordBreak:WordBreak.BREAK_ALL
258 }) >= textWidth * maxLines - measureTruncateWidth) { 264 }) >= textWidth * maxLines - measureTruncateWidth) {
259 if (type === 0) { 265 if (type === 0) {
260 this.isOverLines = true 266 this.isOverLines = true
@@ -89,9 +89,7 @@ export struct HomePageBottomComponent{ @@ -89,9 +89,7 @@ export struct HomePageBottomComponent{
89 .backgroundColor($r('app.color.color_F5F5F5')) 89 .backgroundColor($r('app.color.color_F5F5F5'))
90 .margin({top:'31lpx',bottom:'4lpx'}) 90 .margin({top:'31lpx',bottom:'4lpx'})
91 .onClick(()=>{ 91 .onClick(()=>{
92 - let params: Params = {  
93 - pageID: "1"  
94 - } 92 + let params = {'index': "1"} as Record<string, string>
95 WDRouterRule.jumpWithPage(WDRouterPage.followListPage,params) 93 WDRouterRule.jumpWithPage(WDRouterPage.followListPage,params)
96 }) 94 })
97 95
@@ -128,9 +126,7 @@ export struct HomePageBottomComponent{ @@ -128,9 +126,7 @@ export struct HomePageBottomComponent{
128 .backgroundColor($r('app.color.color_F5F5F5')) 126 .backgroundColor($r('app.color.color_F5F5F5'))
129 .margin({top:'31lpx',bottom:'4lpx'}) 127 .margin({top:'31lpx',bottom:'4lpx'})
130 }.onClick(()=>{ 128 }.onClick(()=>{
131 - let params: Params = {  
132 - pageID: "1"  
133 - } 129 + let params = {'index': "1"} as Record<string, string>
134 WDRouterRule.jumpWithPage(WDRouterPage.followListPage,params) 130 WDRouterRule.jumpWithPage(WDRouterPage.followListPage,params)
135 }) 131 })
136 132
@@ -51,9 +51,7 @@ export struct OtherHomePageBottomFollowComponent{ @@ -51,9 +51,7 @@ export struct OtherHomePageBottomFollowComponent{
51 .backgroundColor($r('app.color.color_F5F5F5')) 51 .backgroundColor($r('app.color.color_F5F5F5'))
52 .margin({top:'31lpx',bottom:'4lpx'}) 52 .margin({top:'31lpx',bottom:'4lpx'})
53 .onClick(()=>{ 53 .onClick(()=>{
54 - let params: Params = {  
55 - pageID: "1"  
56 - } 54 + let params = {'index': "1"} as Record<string, string>
57 WDRouterRule.jumpWithPage(WDRouterPage.followListPage,params) 55 WDRouterRule.jumpWithPage(WDRouterPage.followListPage,params)
58 }) 56 })
59 57
@@ -85,9 +83,7 @@ export struct OtherHomePageBottomFollowComponent{ @@ -85,9 +83,7 @@ export struct OtherHomePageBottomFollowComponent{
85 .backgroundColor($r('app.color.color_F5F5F5')) 83 .backgroundColor($r('app.color.color_F5F5F5'))
86 .margin({top:'31lpx',bottom:'4lpx'}) 84 .margin({top:'31lpx',bottom:'4lpx'})
87 }.onClick(()=>{ 85 }.onClick(()=>{
88 - let params: Params = {  
89 - pageID: "1"  
90 - } 86 + let params = {'index': "1"} as Record<string, string>;
91 WDRouterRule.jumpWithPage(WDRouterPage.followListPage,params) 87 WDRouterRule.jumpWithPage(WDRouterPage.followListPage,params)
92 }) 88 })
93 89
1 import { BottomNavi, CommonConstants } from 'wdConstant'; 1 import { BottomNavi, CommonConstants } from 'wdConstant';
2 import { BottomNavDTO } from 'wdBean'; 2 import { BottomNavDTO } from 'wdBean';
3 -import { EmitterEventId, EmitterUtils, Logger } from 'wdKit'; 3 +import { DateTimeUtils, EmitterEventId, EmitterUtils, Logger } from 'wdKit';
4 import { TopNavigationComponent } from './TopNavigationComponent'; 4 import { TopNavigationComponent } from './TopNavigationComponent';
5 import { MinePageComponent } from './MinePageComponent'; 5 import { MinePageComponent } from './MinePageComponent';
6 import { CompUtils } from '../../utils/CompUtils'; 6 import { CompUtils } from '../../utils/CompUtils';
@@ -40,11 +40,10 @@ export struct BottomNavigationComponent { @@ -40,11 +40,10 @@ export struct BottomNavigationComponent {
40 * Component opacity value: 0.6. 40 * Component opacity value: 0.6.
41 */ 41 */
42 readonly SIXTY_OPACITY: number = 0.6; 42 readonly SIXTY_OPACITY: number = 0.6;
43 - // 接收指定频道跳转的参数  
44 - @State assignChannel: AssignChannelParam = new AssignChannelParam()  
45 // 用于传参到顶导组件,【不用channelParam,主要是时序问题,需要先底导处理完,再延时触发顶导处理】 43 // 用于传参到顶导组件,【不用channelParam,主要是时序问题,需要先底导处理完,再延时触发顶导处理】
46 - @State assignChannel1: AssignChannelParam = new AssignChannelParam()  
47 - 44 + @State assignChannel: AssignChannelParam = new AssignChannelParam()
  45 + // 自动刷新触发(双击tab自动刷新)
  46 + @State autoRefresh: number = 0
48 async aboutToAppear() { 47 async aboutToAppear() {
49 Logger.info(TAG, `aboutToAppear currentNavIndex: ${this.currentNavIndex}`); 48 Logger.info(TAG, `aboutToAppear currentNavIndex: ${this.currentNavIndex}`);
50 let bottomNav = await PageViewModel.getBottomNavData(getContext(this)) 49 let bottomNav = await PageViewModel.getBottomNavData(getContext(this))
@@ -60,8 +59,8 @@ export struct BottomNavigationComponent { @@ -60,8 +59,8 @@ export struct BottomNavigationComponent {
60 Logger.debug(TAG, 'receiveEvent JUMP_HOME_CHANNEL: ' + str) 59 Logger.debug(TAG, 'receiveEvent JUMP_HOME_CHANNEL: ' + str)
61 if (str) { 60 if (str) {
62 // 跳转指定频道场景,传参底导id、频道id 61 // 跳转指定频道场景,传参底导id、频道id
63 - this.assignChannel = JSON.parse(str) as AssignChannelParam  
64 - this.changeBottomNav() 62 + let assignChannel = JSON.parse(str) as AssignChannelParam
  63 + this.changeBottomNav(assignChannel)
65 } 64 }
66 }) 65 })
67 } 66 }
@@ -83,9 +82,11 @@ export struct BottomNavigationComponent { @@ -83,9 +82,11 @@ export struct BottomNavigationComponent {
83 groupId: navItem.id, 82 groupId: navItem.id,
84 topNavList: navItem.topNavChannelList.filter(item => item.channelId != 2073), 83 topNavList: navItem.topNavChannelList.filter(item => item.channelId != 2073),
85 _currentNavIndex: $currentNavIndex, 84 _currentNavIndex: $currentNavIndex,
  85 + navIndex: index,
86 currentBottomNavName: navItem.name, 86 currentBottomNavName: navItem.name,
87 barBackgroundColor: $barBackgroundColor, 87 barBackgroundColor: $barBackgroundColor,
88 - assignChannel: this.assignChannel1 88 + assignChannel: this.assignChannel,
  89 + autoRefresh: this.autoRefresh
89 }) 90 })
90 } 91 }
91 92
@@ -100,11 +101,6 @@ export struct BottomNavigationComponent { @@ -100,11 +101,6 @@ export struct BottomNavigationComponent {
100 .barMode(BarMode.Fixed) 101 .barMode(BarMode.Fixed)
101 // TODO:更详细的判断是视频频道 102 // TODO:更详细的判断是视频频道
102 .barBackgroundColor(this.barBackgroundColor) 103 .barBackgroundColor(this.barBackgroundColor)
103 - .onChange((index: number) => {  
104 - Logger.info(TAG, `onChange, index: ${index}`);  
105 - this.currentNavIndex = index;  
106 - // this.onBottomNavigationIndexChange()  
107 - })  
108 .backgroundColor(this.barBackgroundColor) 104 .backgroundColor(this.barBackgroundColor)
109 .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM]) 105 .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM])
110 106
@@ -141,6 +137,19 @@ export struct BottomNavigationComponent { @@ -141,6 +137,19 @@ export struct BottomNavigationComponent {
141 } 137 }
142 .height($r('app.float.bottom_navigation_barHeight')) 138 .height($r('app.float.bottom_navigation_barHeight'))
143 .hoverEffect(HoverEffect.Highlight) 139 .hoverEffect(HoverEffect.Highlight)
  140 + .onClick(() => {
  141 + if (this.currentNavIndex === index) {
  142 + // 当前tab,双击事件
  143 + this.doubleClick(() => {
  144 + Logger.info(TAG, 'tab double click ')
  145 + this.autoRefresh++
  146 + })
  147 + } else {
  148 + // 切换tab
  149 + this.currentNavIndex = index;
  150 + Logger.info(TAG, `onChange, index: ${index}`);
  151 + }
  152 + })
144 153
145 // .justifyContent(FlexAlign.Center) 154 // .justifyContent(FlexAlign.Center)
146 // .onClick(() => { 155 // .onClick(() => {
@@ -164,11 +173,11 @@ export struct BottomNavigationComponent { @@ -164,11 +173,11 @@ export struct BottomNavigationComponent {
164 /** 173 /**
165 * 底导id变化,即指定频道跳转场景 174 * 底导id变化,即指定频道跳转场景
166 */ 175 */
167 - changeBottomNav() { 176 + changeBottomNav(assignChannel: AssignChannelParam) {
168 let index = -1 177 let index = -1
169 for (let i = 0; i < this.bottomNavList.length; i++) { 178 for (let i = 0; i < this.bottomNavList.length; i++) {
170 let bottomNavDTO: BottomNavDTO = this.bottomNavList[i] 179 let bottomNavDTO: BottomNavDTO = this.bottomNavList[i]
171 - if (bottomNavDTO.id.toString() === this.assignChannel.bottomNavId) { 180 + if (bottomNavDTO.id.toString() === assignChannel.bottomNavId) {
172 index = i 181 index = i
173 break 182 break
174 } 183 }
@@ -180,10 +189,27 @@ export struct BottomNavigationComponent { @@ -180,10 +189,27 @@ export struct BottomNavigationComponent {
180 189
181 setTimeout(() => { 190 setTimeout(() => {
182 // 底导切换后,触发顶导切换 191 // 底导切换后,触发顶导切换
183 - this.assignChannel1 = new AssignChannelParam()  
184 - this.assignChannel1.pageId = this.assignChannel.pageId  
185 - this.assignChannel1.channelId = this.assignChannel.channelId  
186 - this.assignChannel1.bottomNavId = this.assignChannel.bottomNavId 192 + this.assignChannel = new AssignChannelParam()
  193 + this.assignChannel.pageId = assignChannel.pageId
  194 + this.assignChannel.channelId = assignChannel.channelId
  195 + this.assignChannel.bottomNavId = assignChannel.bottomNavId
187 }, 20) 196 }, 20)
188 } 197 }
  198 +
  199 + /**
  200 + * 双击实现
  201 + */
  202 + doubleClickTime: number = 0
  203 +
  204 + /**
  205 + * 双击实现
  206 + */
  207 + private doubleClick(fun: () => void) {
  208 + let now = DateTimeUtils.getTimeStamp()
  209 + if (now - this.doubleClickTime < 200) {
  210 + fun()
  211 + } else {
  212 + this.doubleClickTime = now
  213 + }
  214 + }
189 } 215 }
@@ -2,8 +2,7 @@ import { Action, ContentDTO, Params } from 'wdBean'; @@ -2,8 +2,7 @@ import { Action, ContentDTO, Params } from 'wdBean';
2 import { CommonConstants, ConfigConstants, ScreenType } from 'wdConstant'; 2 import { CommonConstants, ConfigConstants, ScreenType } from 'wdConstant';
3 import { Logger } from 'wdKit'; 3 import { Logger } from 'wdKit';
4 import { CompUtils } from '../../utils/CompUtils'; 4 import { CompUtils } from '../../utils/CompUtils';
5 -import { WDRouterRule } from 'wdRouter';  
6 -import { ProcessUtils } from 'wdRouter'; 5 +import { ProcessUtils, WDRouterRule } from 'wdRouter';
7 6
8 const TAG: string = 'CardView'; 7 const TAG: string = 'CardView';
9 8
@@ -24,8 +23,7 @@ export struct CarouselLayout01CardView { @@ -24,8 +23,7 @@ export struct CarouselLayout01CardView {
24 Image(this.item.coverUrl) 23 Image(this.item.coverUrl)
25 .width(CommonConstants.FULL_PARENT) 24 .width(CommonConstants.FULL_PARENT)
26 .height(CommonConstants.FULL_PARENT) 25 .height(CommonConstants.FULL_PARENT)
27 - .objectFit(ImageFit.Cover)  
28 - // .borderRadius($r("app.float.border_radius_6")) 26 + .objectFit(ImageFit.Cover)// .borderRadius($r("app.float.border_radius_6"))
29 .alignRules({ 27 .alignRules({
30 top: { anchor: '__container__', align: VerticalAlign.Top }, 28 top: { anchor: '__container__', align: VerticalAlign.Top },
31 left: { anchor: '__container__', align: HorizontalAlign.Start } 29 left: { anchor: '__container__', align: HorizontalAlign.Start }
@@ -435,11 +433,10 @@ export struct PaperSingleColumn999CardView { @@ -435,11 +433,10 @@ export struct PaperSingleColumn999CardView {
435 .fontSize(12) 433 .fontSize(12)
436 .fontColor(Color.Gray) 434 .fontColor(Color.Gray)
437 .margin({ left: 22 }) 435 .margin({ left: 22 })
438 - Image($r('app.media.icon_share')) 436 + Image($r('app.media.icon_forward'))
439 .width(16) 437 .width(16)
440 .height(16) 438 .height(16)
441 .margin({ left: 10, right: 22, top: 10, bottom: 10 }) 439 .margin({ left: 10, right: 22, top: 10, bottom: 10 })
442 - .backgroundColor(Color.Brown)  
443 }.width(CommonConstants.FULL_PARENT) 440 }.width(CommonConstants.FULL_PARENT)
444 .justifyContent(FlexAlign.SpaceBetween) 441 .justifyContent(FlexAlign.SpaceBetween)
445 } 442 }
@@ -447,7 +444,7 @@ export struct PaperSingleColumn999CardView { @@ -447,7 +444,7 @@ export struct PaperSingleColumn999CardView {
447 .backgroundColor(Color.White) 444 .backgroundColor(Color.White)
448 .margin({ bottom: 5, left: 12, right: 12 }) 445 .margin({ bottom: 5, left: 12, right: 12 })
449 .borderRadius(4) 446 .borderRadius(4)
450 - .onClick(()=>{ 447 + .onClick(() => {
451 ProcessUtils.processPage(this.item) 448 ProcessUtils.processPage(this.item)
452 }) 449 })
453 } 450 }
@@ -137,7 +137,7 @@ struct EditUserInfoPage { @@ -137,7 +137,7 @@ struct EditUserInfoPage {
137 TextPickerDialog.show({ 137 TextPickerDialog.show({
138 range:['男','女'], 138 range:['男','女'],
139 canLoop:false, 139 canLoop:false,
140 - selected:0, 140 + selected:this.currentUserInfo.userExtend.sex === 0?1:0,
141 onAccept:(value:TextPickerResult) => { 141 onAccept:(value:TextPickerResult) => {
142 this.currentUserInfo.userExtend.sex = value.index == 0?1:0; 142 this.currentUserInfo.userExtend.sex = value.index == 0?1:0;
143 this.currentUserInfo.editDataType = WDEditDataModelType.WDEditDataModelType_sex 143 this.currentUserInfo.editDataType = WDEditDataModelType.WDEditDataModelType_sex
@@ -52,22 +52,34 @@ struct EditUserIntroductionPage { @@ -52,22 +52,34 @@ struct EditUserIntroductionPage {
52 .margin(30) 52 .margin(30)
53 .onClick(()=>{ 53 .onClick(()=>{
54 this.updateEditModel() 54 this.updateEditModel()
55 - let params: editModelParams = {  
56 - introduction: this.introduction  
57 - }  
58 - router.back({  
59 - url:'',  
60 - params:params  
61 - })  
62 }) 55 })
63 } 56 }
64 } 57 }
65 58
66 59
67 updateEditModel(){ 60 updateEditModel(){
  61 + if (this.params.editContent === this.introduction) {
  62 + this.goBack()
  63 + return
  64 + }
  65 +
68 let currentUserInfo:editModel = new editModel() 66 let currentUserInfo:editModel = new editModel()
69 currentUserInfo.userExtend.introduction = this.introduction 67 currentUserInfo.userExtend.introduction = this.introduction
70 currentUserInfo.editDataType = WDEditDataModelType.WDEditDataModelType_intro 68 currentUserInfo.editDataType = WDEditDataModelType.WDEditDataModelType_intro
71 - EditInfoViewModel.updateUserInfo(currentUserInfo) 69 + EditInfoViewModel.updateUserInfo(currentUserInfo).then(()=>{
  70 + this.goBack()
  71 + }).catch(()=>{
  72 + this.goBack()
  73 + })
  74 + }
  75 +
  76 + goBack(){
  77 + let params: editModelParams = {
  78 + introduction: this.introduction
  79 + }
  80 + router.back({
  81 + url:'',
  82 + params:params
  83 + })
72 } 84 }
73 } 85 }
@@ -60,10 +60,22 @@ struct EditUserNikeNamePage { @@ -60,10 +60,22 @@ struct EditUserNikeNamePage {
60 } 60 }
61 61
62 async updateEditModel(){ 62 async updateEditModel(){
  63 + if (this.params.editContent === this.nikeName) {
  64 + this.goBack()
  65 + return
  66 + }
  67 +
63 let currentUserInfo:editModel = new editModel() 68 let currentUserInfo:editModel = new editModel()
64 currentUserInfo.userName = await encryptMessage(this.nikeName); 69 currentUserInfo.userName = await encryptMessage(this.nikeName);
65 currentUserInfo.editDataType = WDEditDataModelType.WDEditDataModelType_nickname 70 currentUserInfo.editDataType = WDEditDataModelType.WDEditDataModelType_nickname
66 EditInfoViewModel.updateUserInfo(currentUserInfo).then(()=>{ 71 EditInfoViewModel.updateUserInfo(currentUserInfo).then(()=>{
  72 + this.goBack()
  73 + }).catch(()=>{
  74 + this.goBack()
  75 + })
  76 + }
  77 +
  78 + goBack(){
67 let params: editModelParams = { 79 let params: editModelParams = {
68 userName: this.nikeName 80 userName: this.nikeName
69 } 81 }
@@ -71,6 +83,5 @@ struct EditUserNikeNamePage { @@ -71,6 +83,5 @@ struct EditUserNikeNamePage {
71 url:'', 83 url:'',
72 params:params 84 params:params
73 }) 85 })
74 - })  
75 } 86 }
76 } 87 }
@@ -5,11 +5,11 @@ import router from '@ohos.router'; @@ -5,11 +5,11 @@ import router from '@ohos.router';
5 @Entry 5 @Entry
6 @Component 6 @Component
7 struct FollowListPage { 7 struct FollowListPage {
8 - @State params:Params = router.getParams() as Params; 8 + @State params:Record<string, string> = router.getParams() as Record<string, string>;
9 @State curIndex: string = '0'; 9 @State curIndex: string = '0';
10 10
11 onPageShow() { 11 onPageShow() {
12 - this.curIndex = this.params?.pageID; 12 + this.curIndex = this.params?.['index'];
13 } 13 }
14 14
15 build() { 15 build() {
@@ -50,7 +50,7 @@ export struct MinePageComponent { @@ -50,7 +50,7 @@ export struct MinePageComponent {
50 //个人功能数据 50 //个人功能数据
51 this.personalData = MinePageDatasModel.getPersonalFunctionsData() 51 this.personalData = MinePageDatasModel.getPersonalFunctionsData()
52 //创作者功能数据 52 //创作者功能数据
53 - this.creatorData = MinePageDatasModel.getCreatorFunctionsData() 53 + // this.creatorData = MinePageDatasModel.getCreatorFunctionsData()
54 //更多功能数据 54 //更多功能数据
55 this.moreData = MinePageDatasModel.getMoreFunctionsData() 55 this.moreData = MinePageDatasModel.getMoreFunctionsData()
56 } 56 }
  1 +/**
  2 + * 已到底UI,数据bean封装【page接口返回配置信息:文字、文字颜色】
  3 + */
  4 +@Observed
  5 +export class NoMoreBean {
  6 + text: string = '';
  7 + textColor: string = '';
  8 +
  9 + constructor(text: string) {
  10 + this.text = text;
  11 + }
  12 +}
1 import { CommonConstants, ViewType } from 'wdConstant'; 1 import { CommonConstants, ViewType } from 'wdConstant';
2 import { Logger } from 'wdKit'; 2 import { Logger } from 'wdKit';
3 -import PageViewModel from '../../viewmodel/PageViewModel';  
4 import { EmptyComponent } from '../view/EmptyComponent'; 3 import { EmptyComponent } from '../view/EmptyComponent';
5 -import { ErrorComponent } from '../view/ErrorComponent';  
6 import PageModel from '../../viewmodel/PageModel'; 4 import PageModel from '../../viewmodel/PageModel';
7 -import { listTouchEvent } from '../../utils/PullDownRefresh'; 5 +import { autoRefresh, listTouchEvent } from '../../utils/PullDownRefresh';
8 import RefreshLayout from './RefreshLayout'; 6 import RefreshLayout from './RefreshLayout';
9 import { RefreshLayoutBean } from './RefreshLayoutBean'; 7 import { RefreshLayoutBean } from './RefreshLayoutBean';
10 -import NoMoreLayout from './NoMoreLayout';  
11 import LoadMoreLayout from './LoadMoreLayout'; 8 import LoadMoreLayout from './LoadMoreLayout';
12 -import CustomRefreshLoadLayout from './CustomRefreshLoadLayout';  
13 import { CompParser } from '../CompParser'; 9 import { CompParser } from '../CompParser';
14 import { CompDTO } from 'wdBean'; 10 import { CompDTO } from 'wdBean';
15 import PageHelper from '../../viewmodel/PageHelper'; 11 import PageHelper from '../../viewmodel/PageHelper';
16 import { channelSkeleton } from '../skeleton/channelSkeleton' 12 import { channelSkeleton } from '../skeleton/channelSkeleton'
17 import { ProcessUtils } from 'wdRouter/Index'; 13 import { ProcessUtils } from 'wdRouter/Index';
18 import PageAdModel from '../../viewmodel/PageAdvModel'; 14 import PageAdModel from '../../viewmodel/PageAdvModel';
  15 +import PageNoMoreLayout from './PageNoMoreLayout';
  16 +import { NoMoreBean } from './NoMoreBean';
19 17
20 const TAG = 'PageComponent'; 18 const TAG = 'PageComponent';
21 19
@@ -27,18 +25,24 @@ export struct PageComponent { @@ -27,18 +25,24 @@ export struct PageComponent {
27 pageId: string = ""; 25 pageId: string = "";
28 channelId: string = ""; 26 channelId: string = "";
29 @Link @Watch('onChange') currentTopNavSelectedIndex: number 27 @Link @Watch('onChange') currentTopNavSelectedIndex: number
  28 + // 自动刷新通知
  29 + @Prop @Watch('onAutoRefresh') autoRefresh: number = 0
30 30
31 build() { 31 build() {
32 Column() { 32 Column() {
33 if (this.pageModel.viewType == ViewType.LOADING) { 33 if (this.pageModel.viewType == ViewType.LOADING) {
34 - // LoadingComponent()  
35 this.LoadingLayout() 34 this.LoadingLayout()
36 - } else if (this.pageModel.viewType == ViewType.ERROR) {  
37 - ErrorComponent()  
38 - } else if (this.pageModel.viewType == ViewType.EMPTY) {  
39 - EmptyComponent()  
40 - } else { 35 + } else if (this.pageModel.viewType == ViewType.LOADED) {
41 this.ListLayout() 36 this.ListLayout()
  37 + } else if (this.pageModel.viewType == ViewType.EMPTY) {
  38 + //缺省页
  39 + EmptyComponent({
  40 + emptyType: this.pageModel.emptyType,
  41 + emptyButton: true,
  42 + retry: () => {
  43 + this.getData()
  44 + }
  45 + })
42 } 46 }
43 } 47 }
44 .width(CommonConstants.FULL_PARENT) 48 .width(CommonConstants.FULL_PARENT)
@@ -65,6 +69,7 @@ export struct PageComponent { @@ -65,6 +69,7 @@ export struct PageComponent {
65 this.pageModel.pullDownRefreshText, this.pageModel.pullDownRefreshHeight) 69 this.pageModel.pullDownRefreshText, this.pageModel.pullDownRefreshHeight)
66 }) 70 })
67 } 71 }
  72 +
68 LazyForEach(this.pageModel.compList, (compDTO: CompDTO, compIndex: number) => { 73 LazyForEach(this.pageModel.compList, (compDTO: CompDTO, compIndex: number) => {
69 ListItem() { 74 ListItem() {
70 Column() { 75 Column() {
@@ -83,7 +88,7 @@ export struct PageComponent { @@ -83,7 +88,7 @@ export struct PageComponent {
83 this.pageModel.pullUpLoadText, this.pageModel.pullUpLoadHeight) 88 this.pageModel.pullUpLoadText, this.pageModel.pullUpLoadHeight)
84 }) 89 })
85 } else if (!this.pageModel.contentNeedScroll) { 90 } else if (!this.pageModel.contentNeedScroll) {
86 - NoMoreLayout() 91 + PageNoMoreLayout({ noMoreBean: new NoMoreBean(this.pageModel.pageInfo.baselineCopywriting) })
87 } 92 }
88 } 93 }
89 } 94 }
@@ -224,6 +229,15 @@ export struct PageComponent { @@ -224,6 +229,15 @@ export struct PageComponent {
224 } 229 }
225 } 230 }
226 231
  232 + onAutoRefresh() {
  233 + if (this.navIndex != this.currentTopNavSelectedIndex) {
  234 + return
  235 + }
  236 + // 当前页面,自动刷新数据
  237 + Logger.debug(TAG, 'page onAutoRefresh ' + this.autoRefresh)
  238 + autoRefresh(this.pageModel, this.pageAdvModel)
  239 + }
  240 +
227 async getData() { 241 async getData() {
228 Logger.info(TAG, `getData id: ${this.pageId} , ${this.channelId} , navIndex: ${this.currentTopNavSelectedIndex}`); 242 Logger.info(TAG, `getData id: ${this.pageId} , ${this.channelId} , navIndex: ${this.currentTopNavSelectedIndex}`);
229 this.pageModel.pageId = this.pageId; 243 this.pageModel.pageId = this.pageId;
@@ -231,14 +245,6 @@ export struct PageComponent { @@ -231,14 +245,6 @@ export struct PageComponent {
231 this.pageModel.channelId = this.channelId; 245 this.pageModel.channelId = this.channelId;
232 this.pageModel.currentPage = 1; 246 this.pageModel.currentPage = 1;
233 PageHelper.getInitData(this.pageModel, this.pageAdvModel) 247 PageHelper.getInitData(this.pageModel, this.pageAdvModel)
234 - // let pageInfo = await PageViewModel.getPageInfo(this.pageModel.pageId);  
235 - // if (pageInfo == null) {  
236 - // this.pageModel.viewType = ViewType.EMPTY;  
237 - // return;  
238 - // }  
239 - // this.pageModel.pageInfo = pageInfo;  
240 - // this.pageModel.loadStrategy = 1  
241 - // PageHelper.parseGroup(this.pageModel)  
242 } 248 }
243 } 249 }
244 250
  1 +import { RefreshConstants } from '../../utils/RefreshConstants'
  2 +import { NoMoreBean } from './NoMoreBean';
  3 +
  4 +/**
  5 + * The No more data layout component.
  6 + */
  7 +@Component
  8 +export default struct PageNoMoreLayout {
  9 + @ObjectLink noMoreBean: NoMoreBean;
  10 + text: string | Resource = $r('app.string.footer_text')
  11 +
  12 + aboutToAppear(): void {
  13 + if (this.noMoreBean && this.noMoreBean.text.length > 0) {
  14 + this.text = this.noMoreBean.text
  15 + }
  16 + }
  17 +
  18 + build() {
  19 + Row() {
  20 + Text(this.text)
  21 + .margin({ left: RefreshConstants.NoMoreLayoutConstant_NORMAL_PADDING })
  22 + .fontSize(RefreshConstants.NoMoreLayoutConstant_TITLE_FONT)
  23 + .textAlign(TextAlign.Center)
  24 + }
  25 + .width(RefreshConstants.FULL_WIDTH)
  26 + .justifyContent(FlexAlign.Center)
  27 + .height(RefreshConstants.CUSTOM_LAYOUT_HEIGHT)
  28 + }
  29 +}
1 -import { Action, CompDTO, Params, TopNavDTO } from 'wdBean';  
2 -import { LazyDataSource, Logger, StringUtils } from 'wdKit'; 1 +import { CompDTO, TopNavDTO } from 'wdBean';
  2 +import { LazyDataSource, Logger } from 'wdKit';
3 import { ProcessUtils } from 'wdRouter'; 3 import { ProcessUtils } from 'wdRouter';
4 import { PageComponent } from './PageComponent'; 4 import { PageComponent } from './PageComponent';
5 import { ChannelSubscriptionLayout } from './ChannelSubscriptionLayout'; 5 import { ChannelSubscriptionLayout } from './ChannelSubscriptionLayout';
6 import { FirstTabTopSearchComponent } from '../search/FirstTabTopSearchComponent'; 6 import { FirstTabTopSearchComponent } from '../search/FirstTabTopSearchComponent';
7 -import window from '@ohos.window';  
8 -import { WindowModel } from 'wdKit';  
9 import { VideoChannelDetail } from 'wdDetailPlayShortVideo/Index'; 7 import { VideoChannelDetail } from 'wdDetailPlayShortVideo/Index';
10 import { AssignChannelParam } from 'wdRouter/src/main/ets/utils/HomeChannelUtils'; 8 import { AssignChannelParam } from 'wdRouter/src/main/ets/utils/HomeChannelUtils';
11 9
@@ -51,6 +49,12 @@ export struct TopNavigationComponent { @@ -51,6 +49,12 @@ export struct TopNavigationComponent {
51 @State localChannelList: TopNavDTO[] = [] 49 @State localChannelList: TopNavDTO[] = []
52 readonly MAX_LINE: number = 1; 50 readonly MAX_LINE: number = 1;
53 @ObjectLink @Watch('onAssignChannelChange') assignChannel: AssignChannelParam 51 @ObjectLink @Watch('onAssignChannelChange') assignChannel: AssignChannelParam
  52 + // 底导传递过来的自动刷新通知
  53 + @Prop @Watch('onAutoRefresh') autoRefresh: number = 0
  54 + // 传递给page的自动刷新通知
  55 + @State autoRefresh2Page: number = 0
  56 + // 当前底导index
  57 + @State navIndex: number = 0
54 58
55 //处理新闻tab顶导频道数据 59 //处理新闻tab顶导频道数据
56 topNavListHandle() { 60 topNavListHandle() {
@@ -201,6 +205,7 @@ export struct TopNavigationComponent { @@ -201,6 +205,7 @@ export struct TopNavigationComponent {
201 navIndex: index, 205 navIndex: index,
202 pageId: navItem.pageId + '', 206 pageId: navItem.pageId + '',
203 channelId: navItem.channelId + '', 207 channelId: navItem.channelId + '',
  208 + autoRefresh: this.autoRefresh2Page
204 }) 209 })
205 } 210 }
206 } 211 }
@@ -258,10 +263,10 @@ export struct TopNavigationComponent { @@ -258,10 +263,10 @@ export struct TopNavigationComponent {
258 if (this.currentTopNavSelectedIndex == 0) { 263 if (this.currentTopNavSelectedIndex == 0) {
259 return item.name === '视频' ? Color.White : '#e5e0e0' 264 return item.name === '视频' ? Color.White : '#e5e0e0'
260 } else { 265 } else {
261 - return this.currentTopNavSelectedIndex === index ? Color.Black : Color.Gray 266 + return this.currentTopNavSelectedIndex === index ? Color.Black : "#999999"
262 } 267 }
263 } else { 268 } else {
264 - return this.currentTopNavSelectedIndex === index ? Color.Black : Color.Gray 269 + return this.currentTopNavSelectedIndex === index ? Color.Black : "#999999"
265 } 270 }
266 } 271 }
267 272
@@ -269,30 +274,28 @@ export struct TopNavigationComponent { @@ -269,30 +274,28 @@ export struct TopNavigationComponent {
269 tabBarBuilder(item: TopNavDTO, index: number) { 274 tabBarBuilder(item: TopNavDTO, index: number) {
270 Column() { 275 Column() {
271 Text(item.name) 276 Text(item.name)
272 - .fontSize(this.currentTopNavSelectedIndex === index ? $r('app.float.selected_text_size') : $r('app.float.normal_text_size')) 277 + .fontSize($r('app.float.selected_text_size'))
273 .fontWeight(this.currentTopNavSelectedIndex === index ? FontWeight.Bold : FontWeight.Normal) 278 .fontWeight(this.currentTopNavSelectedIndex === index ? FontWeight.Bold : FontWeight.Normal)
274 .fontColor(this.getFontColor(item, index)) 279 .fontColor(this.getFontColor(item, index))
275 - .padding({ top: $r('app.float.top_tab_item_padding_top') }) 280 + .padding({ top: $r('app.float.top_tab_item_padding_top') , bottom: $r('app.float.top_tab_item_padding_bottom')})
276 .maxLines(this.MAX_LINE) 281 .maxLines(this.MAX_LINE)
277 if (this.currentTopNavSelectedIndex === index) { 282 if (this.currentTopNavSelectedIndex === index) {
278 Row() 283 Row()
279 .width(20) 284 .width(20)
280 .height(3) 285 .height(3)
281 .backgroundImage($r('app.media.icon_channel_active'), ImageRepeat.NoRepeat) 286 .backgroundImage($r('app.media.icon_channel_active'), ImageRepeat.NoRepeat)
  287 + .backgroundImageSize(ImageSize.Contain)
282 } 288 }
283 -  
284 } 289 }
285 .hoverEffect(HoverEffect.Highlight) 290 .hoverEffect(HoverEffect.Highlight)
286 .constraintSize({ 291 .constraintSize({
287 minWidth: $r('app.float.top_tab_item_min_width'), 292 minWidth: $r('app.float.top_tab_item_min_width'),
288 maxWidth: $r('app.float.top_tab_item_max_width') 293 maxWidth: $r('app.float.top_tab_item_max_width')
289 }) 294 })
290 - // .margin({ right: 36 })  
291 .backgroundColor(Color.Transparent) 295 .backgroundColor(Color.Transparent)
292 .padding({ 296 .padding({
293 left: $r('app.float.top_tab_item_padding_horizontal'), 297 left: $r('app.float.top_tab_item_padding_horizontal'),
294 right: $r('app.float.top_tab_item_padding_horizontal'), 298 right: $r('app.float.top_tab_item_padding_horizontal'),
295 - bottom: $r('app.float.top_tab_item_padding_bottom')  
296 }) 299 })
297 .id(`col_tabBar${index}`) 300 .id(`col_tabBar${index}`)
298 .margin({ right: this.myChannelList.length === index + 1 ? 36 : 0 }) 301 .margin({ right: this.myChannelList.length === index + 1 ? 36 : 0 })
@@ -311,6 +314,14 @@ export struct TopNavigationComponent { @@ -311,6 +314,14 @@ export struct TopNavigationComponent {
311 Logger.info(TAG, `onTopNavigationDataUpdated currentTopNavIndex: ${this.currentTopNavSelectedIndex},topNavList.length:${this.topNavList.length}`); 314 Logger.info(TAG, `onTopNavigationDataUpdated currentTopNavIndex: ${this.currentTopNavSelectedIndex},topNavList.length:${this.topNavList.length}`);
312 } 315 }
313 316
  317 + onAutoRefresh() {
  318 + if (this.navIndex != this._currentNavIndex) {
  319 + return
  320 + }
  321 + // 通知page刷新
  322 + this.autoRefresh2Page++
  323 + }
  324 +
314 /** 325 /**
315 * 频道id变化,即指定频道跳转场景 326 * 频道id变化,即指定频道跳转场景
316 */ 327 */
@@ -23,6 +23,9 @@ export struct SearchHotsComponent{ @@ -23,6 +23,9 @@ export struct SearchHotsComponent{
23 } 23 }
24 }).catch((err:Error)=>{ 24 }).catch((err:Error)=>{
25 console.log(TAG,JSON.stringify(err)) 25 console.log(TAG,JSON.stringify(err))
  26 + if(this.searchHotsData.length === 0){
  27 + this.searchHotsData.push(new SearchHotContentItem("二十大",0,1))
  28 + }
26 }) 29 })
27 } 30 }
28 31
@@ -29,6 +29,17 @@ export struct HorizontalStrokeCardThreeTwoRadioForMoreComponent { @@ -29,6 +29,17 @@ export struct HorizontalStrokeCardThreeTwoRadioForMoreComponent {
29 .width(14) 29 .width(14)
30 .height(14) 30 .height(14)
31 } 31 }
  32 + .visibility(this.compDTO?.objectType === '0' ? Visibility.None : Visibility.Visible)
  33 + .onClick(() => {
  34 + if (this.compDTO?.objectType === '11') {
  35 + ProcessUtils.jumpChannelTab(this.compDTO.objectId, this.compDTO.pageId as string)
  36 + } else if (this.compDTO?.objectType === '5') {
  37 + ProcessUtils._gotoSpecialTopic(this.compDTO.linkUrl)
  38 + } else if (this.compDTO?.objectType === '6') {
  39 + ProcessUtils._gotoDefaultWeb(this.compDTO.linkUrl)
  40 + }
  41 + })
  42 +
32 }.justifyContent(FlexAlign.SpaceBetween) 43 }.justifyContent(FlexAlign.SpaceBetween)
33 .padding({ left: 16, right: 16 }) 44 .padding({ left: 16, right: 16 })
34 .margin({ top: 8, bottom: 8 }) 45 .margin({ top: 8, bottom: 8 })
1 import { Logger } from 'wdKit/Index' 1 import { Logger } from 'wdKit/Index'
2 import { LikeViewModel } from '../../viewmodel/LikeViewModel' 2 import { LikeViewModel } from '../../viewmodel/LikeViewModel'
3 3
  4 +const TAG = 'LikeComponent';
  5 +
4 @Component 6 @Component
5 export struct LikeComponent { 7 export struct LikeComponent {
6 @State likeStatus: boolean = false 8 @State likeStatus: boolean = false
@@ -15,17 +17,12 @@ export struct LikeComponent { @@ -15,17 +17,12 @@ export struct LikeComponent {
15 // this.data['title'] = '开创两校交流先河!克罗地亚教育代表团访问同济大学' 17 // this.data['title'] = '开创两校交流先河!克罗地亚教育代表团访问同济大学'
16 // this.data['userHeaderUrl'] = "" 18 // this.data['userHeaderUrl'] = ""
17 // this.data['channelId'] = "2059" //必须 19 // this.data['channelId'] = "2059" //必须
18 - // this.data['status'] = "1" //必须 20 + // this.data['status'] = "1"
19 21
20 aboutToAppear(): void { 22 aboutToAppear(): void {
21 if (this.data) { 23 if (this.data) {
22 - Logger.debug("ddd: " + this.data['status'])  
23 - if (this.data['status'] == '1') {  
24 - this.likeStatus = true  
25 - } else {  
26 - this.likeStatus = false  
27 - }  
28 - 24 + //获取点赞状态
  25 + this.getLikeStatus()
29 } 26 }
30 27
31 } 28 }
@@ -41,10 +38,10 @@ export struct LikeComponent { @@ -41,10 +38,10 @@ export struct LikeComponent {
41 } 38 }
42 if (this.likeStatus) { 39 if (this.likeStatus) {
43 //1 40 //1
44 - this.executeLike('1') 41 + this.executeLike('0')
45 } else { 42 } else {
46 //0 43 //0
47 - this.executeLike('0') 44 + this.executeLike('1')
48 } 45 }
49 }) 46 })
50 }.width(24).height(24) 47 }.width(24).height(24)
@@ -59,4 +56,18 @@ export struct LikeComponent { @@ -59,4 +56,18 @@ export struct LikeComponent {
59 this.enableBtn = true 56 this.enableBtn = true
60 }) 57 })
61 } 58 }
  59 +
  60 + getLikeStatus() {
  61 + this.viewModel.getLikeStatus(this.data).then((data) => {
  62 + if (data && data['data'].length && data['data'][0]['likeStatus']) {
  63 + this.likeStatus = data['data'][0]['likeStatus']
  64 + }else {
  65 + this.likeStatus = false
  66 + }
  67 + }).catch(() => {
  68 + this.likeStatus = false
  69 + })
  70 + }
  71 +
  72 +
62 } 73 }
@@ -12,6 +12,7 @@ import { @@ -12,6 +12,7 @@ import {
12 import router from '@ohos.router'; 12 import router from '@ohos.router';
13 import inputMethod from '@ohos.inputMethod'; 13 import inputMethod from '@ohos.inputMethod';
14 import { MultiPictureDetailViewModel } from '../../viewmodel/MultiPictureDetailViewModel'; 14 import { MultiPictureDetailViewModel } from '../../viewmodel/MultiPictureDetailViewModel';
  15 +import { LikeComponent } from './LikeComponent';
15 import { HttpUrlUtils } from 'wdNetwork/Index'; 16 import { HttpUrlUtils } from 'wdNetwork/Index';
16 import { WDRouterPage, WDRouterRule } from 'wdRouter/Index'; 17 import { WDRouterPage, WDRouterRule } from 'wdRouter/Index';
17 import { PageRepository } from '../../repository/PageRepository'; 18 import { PageRepository } from '../../repository/PageRepository';
@@ -29,9 +30,11 @@ const TAG = 'OperRowListView'; @@ -29,9 +30,11 @@ const TAG = 'OperRowListView';
29 @Preview 30 @Preview
30 @Component 31 @Component
31 export struct OperRowListView { 32 export struct OperRowListView {
32 - private contentDetailData: ContentDetailDTO = {} as ContentDetailDTO 33 + // private contentDetailData: ContentDetailDTO = {} as ContentDetailDTO
  34 + @Prop contentDetailData: ContentDetailDTO
33 @State interactData: InteractDataDTO = {} as InteractDataDTO 35 @State interactData: InteractDataDTO = {} as InteractDataDTO
34 @State newsStatusOfUser: batchLikeAndCollectResult | undefined = undefined // 点赞、收藏状态 36 @State newsStatusOfUser: batchLikeAndCollectResult | undefined = undefined // 点赞、收藏状态
  37 + @State likeBean: Record<string, string> = {}
35 38
36 @State operationList: OperationItem[] = [ 39 @State operationList: OperationItem[] = [
37 { 40 {
@@ -60,6 +63,20 @@ export struct OperRowListView { @@ -60,6 +63,20 @@ export struct OperRowListView {
60 this.getInteractDataStatus() 63 this.getInteractDataStatus()
61 } 64 }
62 this.queryContentInteractCount() 65 this.queryContentInteractCount()
  66 + // 点赞需要数据
  67 + // this.data['userName'] = '人民日报网友2kD2xW'
  68 + // this.data['contentType'] = '8' //必须
  69 + // this.data['title'] = '开创两校交流先河!克罗地亚教育代表团访问同济大学'
  70 + // this.data['userHeaderUrl'] = ""
  71 + // this.data['channelId'] = "2059" //必须
  72 + // this.data['status'] = "1" //必须
  73 + this.likeBean['contentId'] = this.contentDetailData.newsId + ''
  74 + this.likeBean['userName'] = this.contentDetailData.editorName + ''
  75 + this.likeBean['contentType'] = this.contentDetailData.newsType + ''
  76 + this.likeBean['title'] = this.contentDetailData.newsTitle + ''
  77 + this.likeBean['userHeaderUrl'] = ''
  78 + this.likeBean['channelId'] = this.contentDetailData.reLInfo?.channelId + ''
  79 + this.likeBean['status'] = ''
63 } 80 }
64 81
65 build() { 82 build() {
@@ -83,7 +100,7 @@ export struct OperRowListView { @@ -83,7 +100,7 @@ export struct OperRowListView {
83 .onClick(() => { 100 .onClick(() => {
84 router.back(); 101 router.back();
85 }) 102 })
86 - TextInput({placeholder:'说两句...'}) 103 + TextInput({placeholder:'说两句11...'})
87 .placeholderColor('#999999') 104 .placeholderColor('#999999')
88 .placeholderFont( 105 .placeholderFont(
89 { 106 {
@@ -112,10 +129,9 @@ export struct OperRowListView { @@ -112,10 +129,9 @@ export struct OperRowListView {
112 .width('54.5%') 129 .width('54.5%')
113 } 130 }
114 .width('100%') 131 .width('100%')
115 - .height(56) 132 + .height(126)
116 .backgroundColor(Color.Black) 133 .backgroundColor(Color.Black)
117 } 134 }
118 -  
119 /** 135 /**
120 * 组件项 136 * 组件项
121 * 137 *
@@ -125,7 +141,11 @@ export struct OperRowListView { @@ -125,7 +141,11 @@ export struct OperRowListView {
125 buildOperationItem(item: OperationItem, index: number) { 141 buildOperationItem(item: OperationItem, index: number) {
126 Column() { 142 Column() {
127 if (item.text === '点赞') { 143 if (item.text === '点赞') {
128 - RelativeContainer() { 144 + LikeComponent({
  145 + data: this.likeBean
  146 + })
  147 +
  148 + /* RelativeContainer() {
129 Row() { 149 Row() {
130 Image(this.newsStatusOfUser?.likeStatus == '1' ? item.icon_check : item.icon) 150 Image(this.newsStatusOfUser?.likeStatus == '1' ? item.icon_check : item.icon)
131 .width(24) 151 .width(24)
@@ -134,6 +154,7 @@ export struct OperRowListView { @@ -134,6 +154,7 @@ export struct OperRowListView {
134 .interpolation(ImageInterpolation.High) 154 .interpolation(ImageInterpolation.High)
135 .onClick(() => { 155 .onClick(() => {
136 this.toggleLikeStatus() 156 this.toggleLikeStatus()
  157 + console.log('点赞_111', JSON.stringify(this.contentDetailData))
137 }) 158 })
138 } 159 }
139 .alignRules({ 160 .alignRules({
@@ -168,7 +189,7 @@ export struct OperRowListView { @@ -168,7 +189,7 @@ export struct OperRowListView {
168 .id(`e_row3_${index}`) 189 .id(`e_row3_${index}`)
169 } 190 }
170 } 191 }
171 - .id(`e_icon_${index}`) 192 + .id(`e_icon_${index}`)*/
172 } else if (item.text === '收藏') { 193 } else if (item.text === '收藏') {
173 RelativeContainer() { 194 RelativeContainer() {
174 Row() { 195 Row() {
  1 +@Component
  2 +export struct PermissionDesComponent {
  3 + @State translateY: number = 0
  4 +
  5 + aboutToAppear(): void {
  6 + this.startDismiss()
  7 + }
  8 +
  9 + build() {
  10 + Column() {
  11 + Row() {
  12 + Image($r('app.media.tips')).width(20).height(20)
  13 + Text("权限使用说明").fontColor('#FF222222').fontSize(14)
  14 + .fontWeight(FontWeight.Bold)
  15 + .margin({left:4})
  16 + }.height(26)
  17 +
  18 + Text("用于为你推荐你可能感兴趣的资讯内容及附近的相关信息,以提升浏览体验。不授权该权限不影响App正常使用。")
  19 + .fontSize(14)
  20 + .fontColor('#666666')
  21 + }
  22 + .translate({ y: this.translateY })
  23 + .animation({
  24 + duration: 400,
  25 + curve: Curve.Linear,
  26 + })
  27 + .alignItems(HorizontalAlign.Start)
  28 + .width('90%')
  29 + // .height(60)
  30 + .backgroundColor('#FFFFFF')
  31 + .border({ radius: 5 })
  32 + .margin({ top: 12 })
  33 + .padding(12)
  34 + }
  35 +
  36 + startDismiss() {
  37 + setTimeout(() => {
  38 + this.translateY = -250
  39 + }, 4000)
  40 + }
  41 +}
1 import { HashMap } from '@kit.ArkTS'; 1 import { HashMap } from '@kit.ArkTS';
2 import { Logger } from 'wdKit/Index'; 2 import { Logger } from 'wdKit/Index';
3 -import { HttpUrlUtils, ResponseDTO } from 'wdNetwork/Index'; 3 +import { HttpBizUtil, HttpUrlUtils, ResponseDTO } from 'wdNetwork/Index';
4 import { HttpRequest } from 'wdNetwork/src/main/ets/http/HttpRequest'; 4 import { HttpRequest } from 'wdNetwork/src/main/ets/http/HttpRequest';
5 5
6 export class LikeModel { 6 export class LikeModel {
@@ -8,7 +8,7 @@ export class LikeModel { @@ -8,7 +8,7 @@ export class LikeModel {
8 let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders(); 8 let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();
9 9
10 return new Promise<object>((success, fail) => { 10 return new Promise<object>((success, fail) => {
11 - HttpRequest.post<ResponseDTO<object>>(HttpUrlUtils.executeLike(), data, headers).then((data: ResponseDTO<object>) => { 11 + HttpBizUtil.post<ResponseDTO<object>>(HttpUrlUtils.executeLike(), data, headers).then((data: ResponseDTO<object>) => {
12 if (data.code != 0) { 12 if (data.code != 0) {
13 fail(data.message) 13 fail(data.message)
14 return 14 return
@@ -20,4 +20,28 @@ export class LikeModel { @@ -20,4 +20,28 @@ export class LikeModel {
20 }) 20 })
21 }) 21 })
22 } 22 }
  23 +
  24 +
  25 + getLikeStatus(data: Record<string, string>) {
  26 + let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();
  27 + let model : Record<string,Record<string,string>[]> = {}
  28 + model['contentList'] = [data]
  29 +
  30 + return new Promise<object>((success, fail) => {
  31 + HttpBizUtil.post<ResponseDTO<object>>(HttpUrlUtils.getLikeStatus(), model, headers).then((data: ResponseDTO<object>) => {
  32 + if (data.code != 0) {
  33 + fail(data.message)
  34 + return
  35 + }
  36 + success(data)
  37 + }, (error: Error) => {
  38 + fail(error.message)
  39 + Logger.debug("LoginViewModel:error ", error.toString())
  40 + })
  41 + })
  42 + }
  43 +
  44 +
  45 +
  46 +
23 } 47 }
@@ -118,7 +118,7 @@ class MinePageDatasModel{ @@ -118,7 +118,7 @@ class MinePageDatasModel{
118 Logger.info(TAG, `getAppointmentList start`); 118 Logger.info(TAG, `getAppointmentList start`);
119 this.fetchAppointmentListData(pageSize,pageNum).then((navResDTO: ResponseDTO<MineAppointmentListItem>) => { 119 this.fetchAppointmentListData(pageSize,pageNum).then((navResDTO: ResponseDTO<MineAppointmentListItem>) => {
120 if (!navResDTO || navResDTO.code != 0) { 120 if (!navResDTO || navResDTO.code != 0) {
121 - success(this.getAppointmentListDataLocal(context)) 121 + error(null)
122 return 122 return
123 } 123 }
124 Logger.info(TAG, "getAppointmentList then,AppointmentResDTO.timeStamp:" + navResDTO.timestamp); 124 Logger.info(TAG, "getAppointmentList then,AppointmentResDTO.timeStamp:" + navResDTO.timestamp);
@@ -126,22 +126,11 @@ class MinePageDatasModel{ @@ -126,22 +126,11 @@ class MinePageDatasModel{
126 success(navigationBean); 126 success(navigationBean);
127 }).catch((err: Error) => { 127 }).catch((err: Error) => {
128 Logger.error(TAG, `fetchAppointmentListDataApi catch, error.name : ${err.name}, error.message:${err.message}`); 128 Logger.error(TAG, `fetchAppointmentListDataApi catch, error.name : ${err.name}, error.message:${err.message}`);
129 - success(this.getAppointmentListDataLocal(context)) 129 + error(null)
130 }) 130 })
131 }) 131 })
132 } 132 }
133 133
134 - async getAppointmentListDataLocal(context: Context): Promise<MineAppointmentListItem> {  
135 - Logger.info(TAG, `getBottomNavDataMock start`);  
136 - let compRes: ResponseDTO<MineAppointmentListItem> | null = await ResourcesUtils.getResourcesJson<ResponseDTO<MineAppointmentListItem>>(context,'appointment_list_data.json' );  
137 - if (!compRes || !compRes.data) {  
138 - Logger.info(TAG, `getAppointmentListDataLocal compRes is empty`);  
139 - return new MineAppointmentListItem()  
140 - }  
141 - Logger.info(TAG, `getAppointmentListDataLocal getResourcesJsonSync compRes : ${JSON.stringify(compRes)}`);  
142 - return compRes.data  
143 - }  
144 -  
145 /** 134 /**
146 * 关注频道详情 135 * 关注频道详情
147 * @param pageSize 136 * @param pageSize
@@ -154,7 +143,7 @@ class MinePageDatasModel{ @@ -154,7 +143,7 @@ class MinePageDatasModel{
154 Logger.info(TAG, `getAppointmentList start`); 143 Logger.info(TAG, `getAppointmentList start`);
155 this.fetchFollowListDetailData(params).then((navResDTO: ResponseDTO<MineFollowListDetailItem>) => { 144 this.fetchFollowListDetailData(params).then((navResDTO: ResponseDTO<MineFollowListDetailItem>) => {
156 if (!navResDTO || navResDTO.code != 0) { 145 if (!navResDTO || navResDTO.code != 0) {
157 - success(this.getFollowListDetailDataLocal(context)) 146 + error(null)
158 return 147 return
159 } 148 }
160 Logger.info(TAG, "getAppointmentList then,AppointmentResDTO.timeStamp:" + navResDTO.timestamp); 149 Logger.info(TAG, "getAppointmentList then,AppointmentResDTO.timeStamp:" + navResDTO.timestamp);
@@ -162,22 +151,11 @@ class MinePageDatasModel{ @@ -162,22 +151,11 @@ class MinePageDatasModel{
162 success(navigationBean); 151 success(navigationBean);
163 }).catch((err: Error) => { 152 }).catch((err: Error) => {
164 Logger.error(TAG, `fetchAppointmentListDataApi catch, error.name : ${err.name}, error.message:${err.message}`); 153 Logger.error(TAG, `fetchAppointmentListDataApi catch, error.name : ${err.name}, error.message:${err.message}`);
165 - success(this.getFollowListDetailDataLocal(context)) 154 + error(null)
166 }) 155 })
167 }) 156 })
168 } 157 }
169 158
170 - async getFollowListDetailDataLocal(context: Context): Promise<MineFollowListDetailItem> {  
171 - Logger.info(TAG, `getBottomNavDataMock start`);  
172 - let compRes: ResponseDTO<MineFollowListDetailItem> | null = await ResourcesUtils.getResourcesJson<ResponseDTO<MineFollowListDetailItem>>(context,'follow_list_detail_data_id120.json' );  
173 - if (!compRes || !compRes.data) {  
174 - Logger.info(TAG, `getAppointmentListDataLocal compRes is empty`);  
175 - return new MineFollowListDetailItem()  
176 - }  
177 - Logger.info(TAG, `getAppointmentListDataLocal getResourcesJsonSync compRes : ${JSON.stringify(compRes)}`);  
178 - return compRes.data  
179 - }  
180 -  
181 fetchFollowListDetailData(object:FollowListDetailRequestItem) { 159 fetchFollowListDetailData(object:FollowListDetailRequestItem) {
182 let url = HttpUrlUtils.getFollowListDetailDataUrl() 160 let url = HttpUrlUtils.getFollowListDetailDataUrl()
183 let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders(); 161 let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();
@@ -199,7 +177,7 @@ class MinePageDatasModel{ @@ -199,7 +177,7 @@ class MinePageDatasModel{
199 Logger.info(TAG, `getAppointmentList start`); 177 Logger.info(TAG, `getAppointmentList start`);
200 this.fetchFollowListData().then((navResDTO: ResponseDTO<FollowListItem[]>) => { 178 this.fetchFollowListData().then((navResDTO: ResponseDTO<FollowListItem[]>) => {
201 if (!navResDTO || navResDTO.code != 0) { 179 if (!navResDTO || navResDTO.code != 0) {
202 - success(this.getFollowListDataLocal(context)) 180 + error(null)
203 return 181 return
204 } 182 }
205 Logger.info(TAG, "getAppointmentList then,AppointmentResDTO.timeStamp:" + navResDTO.timestamp); 183 Logger.info(TAG, "getAppointmentList then,AppointmentResDTO.timeStamp:" + navResDTO.timestamp);
@@ -207,21 +185,11 @@ class MinePageDatasModel{ @@ -207,21 +185,11 @@ class MinePageDatasModel{
207 success(navigationBean); 185 success(navigationBean);
208 }).catch((err: Error) => { 186 }).catch((err: Error) => {
209 Logger.error(TAG, `fetchAppointmentListDataApi catch, error.name : ${err.name}, error.message:${err.message}`); 187 Logger.error(TAG, `fetchAppointmentListDataApi catch, error.name : ${err.name}, error.message:${err.message}`);
210 - success(this.getFollowListDataLocal(context)) 188 + error(null)
211 }) 189 })
212 }) 190 })
213 } 191 }
214 192
215 - async getFollowListDataLocal(context: Context): Promise<FollowListItem[]> {  
216 - Logger.info(TAG, `getFollowListDataLocal start`);  
217 - let compRes: ResponseDTO<FollowListItem[]> | null = await ResourcesUtils.getResourcesJson<ResponseDTO<FollowListItem[]>>(context,'follow_list_data.json' );  
218 - if (!compRes || !compRes.data) {  
219 - Logger.info(TAG, `getFollowListDataLocal compRes is empty`);  
220 - return []  
221 - }  
222 - Logger.info(TAG, `getFollowListDataLocal getResourcesJsonSync compRes : ${JSON.stringify(compRes)}`);  
223 - return compRes.data  
224 - }  
225 193
226 /** 194 /**
227 * 我的关注列表 195 * 我的关注列表
@@ -234,7 +202,7 @@ class MinePageDatasModel{ @@ -234,7 +202,7 @@ class MinePageDatasModel{
234 Logger.info(TAG, `getAppointmentList start`); 202 Logger.info(TAG, `getAppointmentList start`);
235 this.fetchMineDetailFollowListData(params).then((navResDTO: ResponseDTO<MineFollowListItem>) => { 203 this.fetchMineDetailFollowListData(params).then((navResDTO: ResponseDTO<MineFollowListItem>) => {
236 if (!navResDTO || navResDTO.code != 0) { 204 if (!navResDTO || navResDTO.code != 0) {
237 - success(this.getMineFollowListDataLocal(context)) 205 + error(null)
238 return 206 return
239 } 207 }
240 Logger.info(TAG, "getAppointmentList then,AppointmentResDTO.timeStamp:" + navResDTO.timestamp); 208 Logger.info(TAG, "getAppointmentList then,AppointmentResDTO.timeStamp:" + navResDTO.timestamp);
@@ -242,7 +210,7 @@ class MinePageDatasModel{ @@ -242,7 +210,7 @@ class MinePageDatasModel{
242 success(navigationBean); 210 success(navigationBean);
243 }).catch((err: Error) => { 211 }).catch((err: Error) => {
244 Logger.error(TAG, `fetchAppointmentListDataApi catch, error.name : ${err.name}, error.message:${err.message}`); 212 Logger.error(TAG, `fetchAppointmentListDataApi catch, error.name : ${err.name}, error.message:${err.message}`);
245 - success(this.getMineFollowListDataLocal(context)) 213 + error(null)
246 }) 214 })
247 }) 215 })
248 } 216 }
@@ -253,17 +221,6 @@ class MinePageDatasModel{ @@ -253,17 +221,6 @@ class MinePageDatasModel{
253 return WDHttp.get<ResponseDTO<MineFollowListItem>>(url, headers) 221 return WDHttp.get<ResponseDTO<MineFollowListItem>>(url, headers)
254 }; 222 };
255 223
256 - async getMineFollowListDataLocal(context: Context): Promise<MineFollowListItem> {  
257 - Logger.info(TAG, `getMineFollowListDataLocal start`);  
258 - let compRes: ResponseDTO<MineFollowListItem> | null = await ResourcesUtils.getResourcesJson<ResponseDTO<MineFollowListItem>>(context,'mine_follow_list_data.json' );  
259 - if (!compRes || !compRes.data) {  
260 - Logger.info(TAG, `getMineFollowListDataLocal compRes is empty`);  
261 - return new MineFollowListItem()  
262 - }  
263 - Logger.info(TAG, `getMineFollowListDataLocal getResourcesJsonSync compRes : ${JSON.stringify(compRes)}`);  
264 - return compRes.data  
265 - }  
266 -  
267 /** 224 /**
268 * 查询是否被关注 列表 225 * 查询是否被关注 列表
269 * @param params 226 * @param params
@@ -275,7 +232,7 @@ class MinePageDatasModel{ @@ -275,7 +232,7 @@ class MinePageDatasModel{
275 Logger.info(TAG, `getAppointmentList start`); 232 Logger.info(TAG, `getAppointmentList start`);
276 this.fetchFollowListStatusData(params).then((navResDTO: ResponseDTO<QueryListIsFollowedItem[]>) => { 233 this.fetchFollowListStatusData(params).then((navResDTO: ResponseDTO<QueryListIsFollowedItem[]>) => {
277 if (!navResDTO || navResDTO.code != 0) { 234 if (!navResDTO || navResDTO.code != 0) {
278 - success(this.getFollowListStatusDataLocal(context)) 235 + error(null)
279 return 236 return
280 } 237 }
281 Logger.info(TAG, "getAppointmentList then,AppointmentResDTO.timeStamp:" + navResDTO.timestamp); 238 Logger.info(TAG, "getAppointmentList then,AppointmentResDTO.timeStamp:" + navResDTO.timestamp);
@@ -283,7 +240,7 @@ class MinePageDatasModel{ @@ -283,7 +240,7 @@ class MinePageDatasModel{
283 success(navigationBean); 240 success(navigationBean);
284 }).catch((err: Error) => { 241 }).catch((err: Error) => {
285 Logger.error(TAG, `fetchAppointmentListDataApi catch, error.name : ${err.name}, error.message:${err.message}`); 242 Logger.error(TAG, `fetchAppointmentListDataApi catch, error.name : ${err.name}, error.message:${err.message}`);
286 - success(this.getFollowListStatusDataLocal(context)) 243 + error(null)
287 }) 244 })
288 }) 245 })
289 } 246 }
@@ -294,18 +251,6 @@ class MinePageDatasModel{ @@ -294,18 +251,6 @@ class MinePageDatasModel{
294 return WDHttp.post<ResponseDTO<QueryListIsFollowedItem[]>>(url,object, headers) 251 return WDHttp.post<ResponseDTO<QueryListIsFollowedItem[]>>(url,object, headers)
295 }; 252 };
296 253
297 - async getFollowListStatusDataLocal(context: Context): Promise<QueryListIsFollowedItem[]> {  
298 - Logger.info(TAG, `getMineFollowListDataLocal start`);  
299 - let compRes: ResponseDTO<QueryListIsFollowedItem[]> | null = await ResourcesUtils.getResourcesJson<ResponseDTO<QueryListIsFollowedItem[]>>(context,'follow_list_id120_isfocus_data.json' );  
300 - if (!compRes || !compRes.data) {  
301 - Logger.info(TAG, `getMineFollowListDataLocal compRes is empty`);  
302 - return []  
303 - }  
304 - Logger.info(TAG, `getMineFollowListDataLocal getResourcesJsonSync compRes : ${JSON.stringify(compRes)}`);  
305 - return compRes.data  
306 - }  
307 -  
308 -  
309 /** 254 /**
310 * 我的评论列表 255 * 我的评论列表
311 * @param params 256 * @param params
@@ -317,16 +262,15 @@ class MinePageDatasModel{ @@ -317,16 +262,15 @@ class MinePageDatasModel{
317 Logger.info(TAG, `getAppointmentList start`); 262 Logger.info(TAG, `getAppointmentList start`);
318 this.fetchMineCommentListData(time,params).then((navResDTO: ResponseDTO<MineCommentListDetailItem>) => { 263 this.fetchMineCommentListData(time,params).then((navResDTO: ResponseDTO<MineCommentListDetailItem>) => {
319 if (!navResDTO || navResDTO.code != 0) { 264 if (!navResDTO || navResDTO.code != 0) {
320 - success(this.getMineCommentListDataLocal(context)) 265 + error(null)
321 return 266 return
322 } 267 }
323 Logger.info(TAG, "getAppointmentList then,AppointmentResDTO.timeStamp:" + navResDTO.timestamp); 268 Logger.info(TAG, "getAppointmentList then,AppointmentResDTO.timeStamp:" + navResDTO.timestamp);
324 let navigationBean = navResDTO.data as MineCommentListDetailItem 269 let navigationBean = navResDTO.data as MineCommentListDetailItem
325 success(navigationBean); 270 success(navigationBean);
326 - // success(this.getMineCommentListDataLocal(context))  
327 }).catch((err: Error) => { 271 }).catch((err: Error) => {
328 Logger.error(TAG, `fetchAppointmentListDataApi catch, error.name : ${err.name}, error.message:${err.message}`); 272 Logger.error(TAG, `fetchAppointmentListDataApi catch, error.name : ${err.name}, error.message:${err.message}`);
329 - success(this.getMineCommentListDataLocal(context)) 273 + error(null)
330 }) 274 })
331 }) 275 })
332 } 276 }
@@ -337,16 +281,6 @@ class MinePageDatasModel{ @@ -337,16 +281,6 @@ class MinePageDatasModel{
337 return WDHttp.get<ResponseDTO<MineCommentListDetailItem>>(url, headers) 281 return WDHttp.get<ResponseDTO<MineCommentListDetailItem>>(url, headers)
338 }; 282 };
339 283
340 - async getMineCommentListDataLocal(context: Context): Promise<MineCommentListDetailItem> {  
341 - Logger.info(TAG, `getMineFollowListDataLocal start`);  
342 - let compRes: ResponseDTO<MineCommentListDetailItem> | null = await ResourcesUtils.getResourcesJson<ResponseDTO<MineCommentListDetailItem>>(context,'mine_comment_list_data2.json' );  
343 - if (!compRes || !compRes.data) {  
344 - Logger.info(TAG, `getMineFollowListDataLocal compRes is empty`);  
345 - return new MineCommentListDetailItem()  
346 - }  
347 - Logger.info(TAG, `getMineFollowListDataLocal getResourcesJsonSync compRes : ${JSON.stringify(compRes)}`);  
348 - return compRes.data  
349 - }  
350 284
351 /** 285 /**
352 * 个人中心 获取用户等级 286 * 个人中心 获取用户等级
@@ -356,7 +290,7 @@ class MinePageDatasModel{ @@ -356,7 +290,7 @@ class MinePageDatasModel{
356 Logger.info(TAG, `getAppointmentList start`); 290 Logger.info(TAG, `getAppointmentList start`);
357 this.fetchMineUserLevelData().then((navResDTO: ResponseDTO<MineUserLevelItem>) => { 291 this.fetchMineUserLevelData().then((navResDTO: ResponseDTO<MineUserLevelItem>) => {
358 if (!navResDTO || navResDTO.code != 0) { 292 if (!navResDTO || navResDTO.code != 0) {
359 - success(this.getMineUserLevelDataLocal(context)) 293 + error(null)
360 return 294 return
361 } 295 }
362 Logger.info(TAG, "getAppointmentList then,AppointmentResDTO.timeStamp:" + navResDTO.timestamp); 296 Logger.info(TAG, "getAppointmentList then,AppointmentResDTO.timeStamp:" + navResDTO.timestamp);
@@ -364,7 +298,7 @@ class MinePageDatasModel{ @@ -364,7 +298,7 @@ class MinePageDatasModel{
364 success(navigationBean); 298 success(navigationBean);
365 }).catch((err: Error) => { 299 }).catch((err: Error) => {
366 Logger.error(TAG, `fetchMineUserLevelData catch, error.name : ${err.name}, error.message:${err.message}`); 300 Logger.error(TAG, `fetchMineUserLevelData catch, error.name : ${err.name}, error.message:${err.message}`);
367 - success(this.getMineUserLevelDataLocal(context)) 301 + error(null)
368 }) 302 })
369 }) 303 })
370 } 304 }
@@ -376,17 +310,6 @@ class MinePageDatasModel{ @@ -376,17 +310,6 @@ class MinePageDatasModel{
376 return HttpBizUtil.get<ResponseDTO<MineUserLevelItem>>(url, headers) 310 return HttpBizUtil.get<ResponseDTO<MineUserLevelItem>>(url, headers)
377 }; 311 };
378 312
379 - async getMineUserLevelDataLocal(context: Context): Promise<MineUserLevelItem> {  
380 - Logger.info(TAG, `getMineUserLevelDataLocal start`);  
381 - let compRes: ResponseDTO<MineUserLevelItem> | null = await ResourcesUtils.getResourcesJson<ResponseDTO<MineUserLevelItem>>(context,'mine_user_level.json' );  
382 - if (!compRes || !compRes.data) {  
383 - Logger.info(TAG, `getMineUserLevelDataLocal compRes is empty`);  
384 - return new MineUserLevelItem()  
385 - }  
386 - Logger.info(TAG, `getMineUserLevelDataLocal getResourcesJsonSync compRes : ${JSON.stringify(compRes)}`);  
387 - return compRes.data  
388 - }  
389 -  
390 /** 313 /**
391 * 个人中心 获取用户详细信息 314 * 个人中心 获取用户详细信息
392 */ 315 */
@@ -395,7 +318,7 @@ class MinePageDatasModel{ @@ -395,7 +318,7 @@ class MinePageDatasModel{
395 Logger.info(TAG, `getAppointmentList start`); 318 Logger.info(TAG, `getAppointmentList start`);
396 this.fetchMineUserDetailData().then((navResDTO: ResponseDTO<MineUserDetailItem>) => { 319 this.fetchMineUserDetailData().then((navResDTO: ResponseDTO<MineUserDetailItem>) => {
397 if (!navResDTO || navResDTO.code != 0) { 320 if (!navResDTO || navResDTO.code != 0) {
398 - success(this.getMineUserDetailDataLocal(context)) 321 + error(null)
399 return 322 return
400 } 323 }
401 Logger.info(TAG, "getUserDetailData then,timeStamp:" + navResDTO.timestamp); 324 Logger.info(TAG, "getUserDetailData then,timeStamp:" + navResDTO.timestamp);
@@ -403,7 +326,7 @@ class MinePageDatasModel{ @@ -403,7 +326,7 @@ class MinePageDatasModel{
403 success(navigationBean); 326 success(navigationBean);
404 }).catch((err: Error) => { 327 }).catch((err: Error) => {
405 Logger.error(TAG, `fetchMineUserDetailData catch, error.name : ${err.name}, error.message:${err.message}`); 328 Logger.error(TAG, `fetchMineUserDetailData catch, error.name : ${err.name}, error.message:${err.message}`);
406 - success(this.getMineUserDetailDataLocal(context)) 329 + error(null)
407 }) 330 })
408 }) 331 })
409 } 332 }
@@ -415,16 +338,7 @@ class MinePageDatasModel{ @@ -415,16 +338,7 @@ class MinePageDatasModel{
415 return HttpBizUtil.get<ResponseDTO<MineUserDetailItem>>(url, headers) 338 return HttpBizUtil.get<ResponseDTO<MineUserDetailItem>>(url, headers)
416 }; 339 };
417 340
418 - async getMineUserDetailDataLocal(context: Context): Promise<MineUserDetailItem> {  
419 - Logger.info(TAG, `getMineUserLevelDataLocal start`);  
420 - let compRes: ResponseDTO<MineUserDetailItem> | null = await ResourcesUtils.getResourcesJson<ResponseDTO<MineUserDetailItem>>(context,'mine_user_detail.json' );  
421 - if (!compRes || !compRes.data) {  
422 - Logger.info(TAG, `getMineUserDetailDataLocal compRes is empty`);  
423 - return new MineUserDetailItem()  
424 - }  
425 - Logger.info(TAG, `getMineUserDetailDataLocal getResourcesJsonSync compRes : ${JSON.stringify(compRes)}`);  
426 - return compRes.data  
427 - } 341 +
428 /** 342 /**
429 * 个人中心 获取其他用户详细信息 343 * 个人中心 获取其他用户详细信息
430 */ 344 */
@@ -433,7 +347,7 @@ class MinePageDatasModel{ @@ -433,7 +347,7 @@ class MinePageDatasModel{
433 Logger.info(TAG, `getAppointmentList start`); 347 Logger.info(TAG, `getAppointmentList start`);
434 this.fetchOtherUserDetailData(item).then((navResDTO: ResponseDTO<MineUserDetailItem>) => { 348 this.fetchOtherUserDetailData(item).then((navResDTO: ResponseDTO<MineUserDetailItem>) => {
435 if (!navResDTO || navResDTO.code != 0) { 349 if (!navResDTO || navResDTO.code != 0) {
436 - success(this.getOtherUserDetailDataLocal(context)) 350 + error(null)
437 return 351 return
438 } 352 }
439 Logger.info(TAG, "getUserDetailData then,timeStamp:" + navResDTO.timestamp); 353 Logger.info(TAG, "getUserDetailData then,timeStamp:" + navResDTO.timestamp);
@@ -441,7 +355,7 @@ class MinePageDatasModel{ @@ -441,7 +355,7 @@ class MinePageDatasModel{
441 success(navigationBean); 355 success(navigationBean);
442 }).catch((err: Error) => { 356 }).catch((err: Error) => {
443 Logger.error(TAG, `fetchMineUserDetailData catch, error.name : ${err.name}, error.message:${err.message}`); 357 Logger.error(TAG, `fetchMineUserDetailData catch, error.name : ${err.name}, error.message:${err.message}`);
444 - success(this.getOtherUserDetailDataLocal(context)) 358 + error(null)
445 }) 359 })
446 }) 360 })
447 } 361 }
@@ -452,17 +366,6 @@ class MinePageDatasModel{ @@ -452,17 +366,6 @@ class MinePageDatasModel{
452 return WDHttp.post<ResponseDTO<MineUserDetailItem>>(url, item,headers) 366 return WDHttp.post<ResponseDTO<MineUserDetailItem>>(url, item,headers)
453 }; 367 };
454 368
455 - async getOtherUserDetailDataLocal(context: Context): Promise<MineUserDetailItem> {  
456 - Logger.info(TAG, `getMineUserLevelDataLocal start`);  
457 - let compRes: ResponseDTO<MineUserDetailItem> | null = await ResourcesUtils.getResourcesJson<ResponseDTO<MineUserDetailItem>>(context,'other_user512157124138245_detail.json' );  
458 - if (!compRes || !compRes.data) {  
459 - Logger.info(TAG, `getMineUserDetailDataLocal compRes is empty`);  
460 - return new MineUserDetailItem()  
461 - }  
462 - Logger.info(TAG, `getMineUserDetailDataLocal getResourcesJsonSync compRes : ${JSON.stringify(compRes)}`);  
463 - return compRes.data  
464 - }  
465 -  
466 /** 369 /**
467 * 个人中心 获取其他用户等级 370 * 个人中心 获取其他用户等级
468 */ 371 */
@@ -471,7 +374,7 @@ class MinePageDatasModel{ @@ -471,7 +374,7 @@ class MinePageDatasModel{
471 Logger.info(TAG, `getAppointmentList start`); 374 Logger.info(TAG, `getAppointmentList start`);
472 this.fetchOtherUserLevelData(item).then((navResDTO: ResponseDTO<MineUserLevelItem[]>) => { 375 this.fetchOtherUserLevelData(item).then((navResDTO: ResponseDTO<MineUserLevelItem[]>) => {
473 if (!navResDTO || navResDTO.code != 0) { 376 if (!navResDTO || navResDTO.code != 0) {
474 - success(this.getOtherUserLevelDataLocal(context)) 377 + error(null)
475 return 378 return
476 } 379 }
477 Logger.info(TAG, "getAppointmentList then,AppointmentResDTO.timeStamp:" + navResDTO.timestamp); 380 Logger.info(TAG, "getAppointmentList then,AppointmentResDTO.timeStamp:" + navResDTO.timestamp);
@@ -479,11 +382,11 @@ class MinePageDatasModel{ @@ -479,11 +382,11 @@ class MinePageDatasModel{
479 if(navigationBean.length>0 && StringUtils.isNotEmpty(navigationBean[0].levelHead)){ 382 if(navigationBean.length>0 && StringUtils.isNotEmpty(navigationBean[0].levelHead)){
480 success(navigationBean); 383 success(navigationBean);
481 }else{ 384 }else{
482 - success(this.getOtherUserLevelDataLocal(context)) 385 + error(null)
483 } 386 }
484 }).catch((err: Error) => { 387 }).catch((err: Error) => {
485 Logger.error(TAG, `fetchMineUserLevelData catch, error.name : ${err.name}, error.message:${err.message}`); 388 Logger.error(TAG, `fetchMineUserLevelData catch, error.name : ${err.name}, error.message:${err.message}`);
486 - success(this.getOtherUserLevelDataLocal(context)) 389 + error(null)
487 }) 390 })
488 }) 391 })
489 } 392 }
@@ -494,17 +397,6 @@ class MinePageDatasModel{ @@ -494,17 +397,6 @@ class MinePageDatasModel{
494 return WDHttp.post<ResponseDTO<MineUserLevelItem[]>>(url,item, headers) 397 return WDHttp.post<ResponseDTO<MineUserLevelItem[]>>(url,item, headers)
495 }; 398 };
496 399
497 - async getOtherUserLevelDataLocal(context: Context): Promise<MineUserLevelItem[]> {  
498 - Logger.info(TAG, `getMineUserLevelDataLocal start`);  
499 - let compRes: ResponseDTO<MineUserLevelItem[]> | null = await ResourcesUtils.getResourcesJson<ResponseDTO<MineUserLevelItem[]>>(context,'other_user512157124138245_level.json' );  
500 - if (!compRes || !compRes.data) {  
501 - Logger.info(TAG, `getMineUserLevelDataLocal compRes is empty`);  
502 - return []  
503 - }  
504 - Logger.info(TAG, `getMineUserLevelDataLocal getResourcesJsonSync compRes : ${JSON.stringify(compRes)}`);  
505 - return compRes.data  
506 - }  
507 -  
508 /** 400 /**
509 * 其他用户的评论列表 401 * 其他用户的评论列表
510 * @param params 402 * @param params
@@ -516,7 +408,7 @@ class MinePageDatasModel{ @@ -516,7 +408,7 @@ class MinePageDatasModel{
516 Logger.info(TAG, `getAppointmentList start`); 408 Logger.info(TAG, `getAppointmentList start`);
517 this.fetchOtherCommentListData(params).then((navResDTO: ResponseDTO<MineCommentListDetailItem>) => { 409 this.fetchOtherCommentListData(params).then((navResDTO: ResponseDTO<MineCommentListDetailItem>) => {
518 if (!navResDTO || navResDTO.code != 0) { 410 if (!navResDTO || navResDTO.code != 0) {
519 - success(this.getOtherCommentListDataLocal(context)) 411 + error(null)
520 return 412 return
521 } 413 }
522 Logger.info(TAG, "getAppointmentList then,AppointmentResDTO.timeStamp:" + navResDTO.timestamp); 414 Logger.info(TAG, "getAppointmentList then,AppointmentResDTO.timeStamp:" + navResDTO.timestamp);
@@ -524,7 +416,7 @@ class MinePageDatasModel{ @@ -524,7 +416,7 @@ class MinePageDatasModel{
524 success(navigationBean); 416 success(navigationBean);
525 }).catch((err: Error) => { 417 }).catch((err: Error) => {
526 Logger.error(TAG, `fetchAppointmentListDataApi catch, error.name : ${err.name}, error.message:${err.message}`); 418 Logger.error(TAG, `fetchAppointmentListDataApi catch, error.name : ${err.name}, error.message:${err.message}`);
527 - success(this.getOtherCommentListDataLocal(context)) 419 + error(null)
528 }) 420 })
529 }) 421 })
530 } 422 }
@@ -535,16 +427,6 @@ class MinePageDatasModel{ @@ -535,16 +427,6 @@ class MinePageDatasModel{
535 return WDHttp.get<ResponseDTO<MineCommentListDetailItem>>(url, headers) 427 return WDHttp.get<ResponseDTO<MineCommentListDetailItem>>(url, headers)
536 }; 428 };
537 429
538 - async getOtherCommentListDataLocal(context: Context): Promise<MineCommentListDetailItem> {  
539 - Logger.info(TAG, `getMineFollowListDataLocal start`);  
540 - let compRes: ResponseDTO<MineCommentListDetailItem> | null = await ResourcesUtils.getResourcesJson<ResponseDTO<MineCommentListDetailItem>>(context,'other_user512157124138245_comment_list_data.json' );  
541 - if (!compRes || !compRes.data) {  
542 - Logger.info(TAG, `getMineFollowListDataLocal compRes is empty`);  
543 - return new MineCommentListDetailItem()  
544 - }  
545 - Logger.info(TAG, `getMineFollowListDataLocal getResourcesJsonSync compRes : ${JSON.stringify(compRes)}`);  
546 - return compRes.data  
547 - }  
548 430
549 /** 431 /**
550 * 查询是否点赞了这条评论 432 * 查询是否点赞了这条评论
@@ -557,7 +439,7 @@ class MinePageDatasModel{ @@ -557,7 +439,7 @@ class MinePageDatasModel{
557 Logger.info(TAG, `getAppointmentList start`); 439 Logger.info(TAG, `getAppointmentList start`);
558 this.fetchOtherUserCommentLikeStatusData(params).then((navResDTO: ResponseDTO<QueryCommentListIsLikedItem[]>) => { 440 this.fetchOtherUserCommentLikeStatusData(params).then((navResDTO: ResponseDTO<QueryCommentListIsLikedItem[]>) => {
559 if (!navResDTO || navResDTO.code != 0) { 441 if (!navResDTO || navResDTO.code != 0) {
560 - success(this.getOtherUserCommentLikeStatusDataLocal(context)) 442 + error(null)
561 return 443 return
562 } 444 }
563 Logger.info(TAG, "getAppointmentList then,AppointmentResDTO.timeStamp:" + navResDTO.timestamp); 445 Logger.info(TAG, "getAppointmentList then,AppointmentResDTO.timeStamp:" + navResDTO.timestamp);
@@ -565,7 +447,7 @@ class MinePageDatasModel{ @@ -565,7 +447,7 @@ class MinePageDatasModel{
565 success(navigationBean); 447 success(navigationBean);
566 }).catch((err: Error) => { 448 }).catch((err: Error) => {
567 Logger.error(TAG, `fetchAppointmentListDataApi catch, error.name : ${err.name}, error.message:${err.message}`); 449 Logger.error(TAG, `fetchAppointmentListDataApi catch, error.name : ${err.name}, error.message:${err.message}`);
568 - success(this.getOtherUserCommentLikeStatusDataLocal(context)) 450 + error(null)
569 }) 451 })
570 }) 452 })
571 } 453 }
@@ -576,17 +458,6 @@ class MinePageDatasModel{ @@ -576,17 +458,6 @@ class MinePageDatasModel{
576 return WDHttp.post<ResponseDTO<QueryCommentListIsLikedItem[]>>(url,object, headers) 458 return WDHttp.post<ResponseDTO<QueryCommentListIsLikedItem[]>>(url,object, headers)
577 }; 459 };
578 460
579 - async getOtherUserCommentLikeStatusDataLocal(context: Context): Promise<QueryCommentListIsLikedItem[]> {  
580 - Logger.info(TAG, `getMineFollowListDataLocal start`);  
581 - let compRes: ResponseDTO<QueryCommentListIsLikedItem[]> | null = await ResourcesUtils.getResourcesJson<ResponseDTO<QueryCommentListIsLikedItem[]>>(context,'other_user512157124138245_comment_list_liked_data.json' );  
582 - if (!compRes || !compRes.data) {  
583 - Logger.info(TAG, `getMineFollowListDataLocal compRes is empty`);  
584 - return []  
585 - }  
586 - Logger.info(TAG, `getMineFollowListDataLocal getResourcesJsonSync compRes : ${JSON.stringify(compRes)}`);  
587 - return compRes.data  
588 - }  
589 -  
590 /** 461 /**
591 * 其他用户的关注列表 462 * 其他用户的关注列表
592 * @param params 463 * @param params
@@ -598,7 +469,7 @@ class MinePageDatasModel{ @@ -598,7 +469,7 @@ class MinePageDatasModel{
598 Logger.info(TAG, `getAppointmentList start`); 469 Logger.info(TAG, `getAppointmentList start`);
599 this.fetchOtherUserFollowListData(params).then((navResDTO: ResponseDTO<MineFollowListItem>) => { 470 this.fetchOtherUserFollowListData(params).then((navResDTO: ResponseDTO<MineFollowListItem>) => {
600 if (!navResDTO || navResDTO.code != 0) { 471 if (!navResDTO || navResDTO.code != 0) {
601 - success(this.getOtherUserFollowListDataLocal(context)) 472 + error(null)
602 return 473 return
603 } 474 }
604 Logger.info(TAG, "getAppointmentList then,AppointmentResDTO.timeStamp:" + navResDTO.timestamp); 475 Logger.info(TAG, "getAppointmentList then,AppointmentResDTO.timeStamp:" + navResDTO.timestamp);
@@ -606,7 +477,7 @@ class MinePageDatasModel{ @@ -606,7 +477,7 @@ class MinePageDatasModel{
606 success(navigationBean); 477 success(navigationBean);
607 }).catch((err: Error) => { 478 }).catch((err: Error) => {
608 Logger.error(TAG, `fetchAppointmentListDataApi catch, error.name : ${err.name}, error.message:${err.message}`); 479 Logger.error(TAG, `fetchAppointmentListDataApi catch, error.name : ${err.name}, error.message:${err.message}`);
609 - success(this.getOtherUserFollowListDataLocal(context)) 480 + error(null)
610 }) 481 })
611 }) 482 })
612 } 483 }
@@ -617,17 +488,6 @@ class MinePageDatasModel{ @@ -617,17 +488,6 @@ class MinePageDatasModel{
617 return WDHttp.get<ResponseDTO<MineFollowListItem>>(url, headers) 488 return WDHttp.get<ResponseDTO<MineFollowListItem>>(url, headers)
618 }; 489 };
619 490
620 - async getOtherUserFollowListDataLocal(context: Context): Promise<MineFollowListItem> {  
621 - Logger.info(TAG, `getMineFollowListDataLocal start`);  
622 - let compRes: ResponseDTO<MineFollowListItem> | null = await ResourcesUtils.getResourcesJson<ResponseDTO<MineFollowListItem>>(context,'other_user_follow_list_data.json' );  
623 - if (!compRes || !compRes.data) {  
624 - Logger.info(TAG, `getMineFollowListDataLocal compRes is empty`);  
625 - return new MineFollowListItem()  
626 - }  
627 - Logger.info(TAG, `getMineFollowListDataLocal getResourcesJsonSync compRes : ${JSON.stringify(compRes)}`);  
628 - return compRes.data  
629 - }  
630 -  
631 /** 491 /**
632 * 预约 和取消预约操作 492 * 预约 和取消预约操作
633 * @param params 493 * @param params
@@ -639,14 +499,14 @@ class MinePageDatasModel{ @@ -639,14 +499,14 @@ class MinePageDatasModel{
639 Logger.info(TAG, `getAppointmentList start`); 499 Logger.info(TAG, `getAppointmentList start`);
640 this.fetchAppointmentOperation(params).then((navResDTO: ResponseDTO) => { 500 this.fetchAppointmentOperation(params).then((navResDTO: ResponseDTO) => {
641 if (!navResDTO || navResDTO.code != 0) { 501 if (!navResDTO || navResDTO.code != 0) {
642 - success(this.getAppointmentOperationLocal(context)) 502 + error(null)
643 return 503 return
644 } 504 }
645 Logger.info(TAG, "getAppointmentList then,AppointmentResDTO.timeStamp:" + navResDTO.timestamp); 505 Logger.info(TAG, "getAppointmentList then,AppointmentResDTO.timeStamp:" + navResDTO.timestamp);
646 success(navResDTO); 506 success(navResDTO);
647 }).catch((err: Error) => { 507 }).catch((err: Error) => {
648 Logger.error(TAG, `fetchAppointmentListDataApi catch, error.name : ${err.name}, error.message:${err.message}`); 508 Logger.error(TAG, `fetchAppointmentListDataApi catch, error.name : ${err.name}, error.message:${err.message}`);
649 - success(this.getAppointmentOperationLocal(context)) 509 + error(null)
650 }) 510 })
651 }) 511 })
652 } 512 }
@@ -657,18 +517,6 @@ class MinePageDatasModel{ @@ -657,18 +517,6 @@ class MinePageDatasModel{
657 return WDHttp.post<ResponseDTO>(url,object, headers) 517 return WDHttp.post<ResponseDTO>(url,object, headers)
658 }; 518 };
659 519
660 - async getAppointmentOperationLocal(context: Context): Promise<ResponseDTO> {  
661 - Logger.info(TAG, `getMineFollowListDataLocal start`);  
662 - let compRes: ResponseDTO | null = await ResourcesUtils.getResourcesJson<ResponseDTO>(context,'appointment_operation_data.json');  
663 - if (!compRes ) {  
664 - Logger.info(TAG, `getMineFollowListDataLocal compRes is empty`);  
665 - return compRes  
666 - }  
667 - Logger.info(TAG, `getMineFollowListDataLocal getResourcesJsonSync compRes : ${JSON.stringify(compRes)}`);  
668 - return compRes  
669 - }  
670 -  
671 -  
672 /** 520 /**
673 * 评论点赞操作 521 * 评论点赞操作
674 * @param params 522 * @param params
@@ -680,14 +528,14 @@ class MinePageDatasModel{ @@ -680,14 +528,14 @@ class MinePageDatasModel{
680 Logger.info(TAG, `getAppointmentList start`); 528 Logger.info(TAG, `getAppointmentList start`);
681 this.fetchCommentLikeOperation(params).then((navResDTO: ResponseDTO) => { 529 this.fetchCommentLikeOperation(params).then((navResDTO: ResponseDTO) => {
682 if (!navResDTO || navResDTO.code != 0) { 530 if (!navResDTO || navResDTO.code != 0) {
683 - success(this.getCommentLikeOperationLocal(context)) 531 + error(null)
684 return 532 return
685 } 533 }
686 Logger.info(TAG, "getAppointmentList then,AppointmentResDTO.timeStamp:" + navResDTO.timestamp); 534 Logger.info(TAG, "getAppointmentList then,AppointmentResDTO.timeStamp:" + navResDTO.timestamp);
687 success(navResDTO); 535 success(navResDTO);
688 }).catch((err: Error) => { 536 }).catch((err: Error) => {
689 Logger.error(TAG, `fetchAppointmentListDataApi catch, error.name : ${err.name}, error.message:${err.message}`); 537 Logger.error(TAG, `fetchAppointmentListDataApi catch, error.name : ${err.name}, error.message:${err.message}`);
690 - success(this.getCommentLikeOperationLocal(context)) 538 + error(null)
691 }) 539 })
692 }) 540 })
693 } 541 }
@@ -698,17 +546,6 @@ class MinePageDatasModel{ @@ -698,17 +546,6 @@ class MinePageDatasModel{
698 return WDHttp.post<ResponseDTO>(url,object, headers) 546 return WDHttp.post<ResponseDTO>(url,object, headers)
699 }; 547 };
700 548
701 - async getCommentLikeOperationLocal(context: Context): Promise<ResponseDTO> {  
702 - Logger.info(TAG, `getMineFollowListDataLocal start`);  
703 - let compRes: ResponseDTO | null = await ResourcesUtils.getResourcesJson<ResponseDTO>(context,'comment_like_operation_data.json');  
704 - if (!compRes ) {  
705 - Logger.info(TAG, `getMineFollowListDataLocal compRes is empty`);  
706 - return compRes  
707 - }  
708 - Logger.info(TAG, `getMineFollowListDataLocal getResourcesJsonSync compRes : ${JSON.stringify(compRes)}`);  
709 - return compRes  
710 - }  
711 -  
712 /** 549 /**
713 * 关注 取消关注 操作 550 * 关注 取消关注 操作
714 * @param params 551 * @param params
@@ -720,14 +557,14 @@ class MinePageDatasModel{ @@ -720,14 +557,14 @@ class MinePageDatasModel{
720 Logger.info(TAG, `getAppointmentList start`); 557 Logger.info(TAG, `getAppointmentList start`);
721 this.fetchFollowOperation(params).then((navResDTO: ResponseDTO) => { 558 this.fetchFollowOperation(params).then((navResDTO: ResponseDTO) => {
722 if (!navResDTO || navResDTO.code != 0) { 559 if (!navResDTO || navResDTO.code != 0) {
723 - success(this.getFollowOperationLocal(context)) 560 + error(null)
724 return 561 return
725 } 562 }
726 Logger.info(TAG, "getAppointmentList then,AppointmentResDTO.timeStamp:" + navResDTO.timestamp); 563 Logger.info(TAG, "getAppointmentList then,AppointmentResDTO.timeStamp:" + navResDTO.timestamp);
727 success(navResDTO); 564 success(navResDTO);
728 }).catch((err: Error) => { 565 }).catch((err: Error) => {
729 Logger.error(TAG, `fetchAppointmentListDataApi catch, error.name : ${err.name}, error.message:${err.message}`); 566 Logger.error(TAG, `fetchAppointmentListDataApi catch, error.name : ${err.name}, error.message:${err.message}`);
730 - success(this.getFollowOperationLocal(context)) 567 + error(null)
731 }) 568 })
732 }) 569 })
733 } 570 }
@@ -738,17 +575,6 @@ class MinePageDatasModel{ @@ -738,17 +575,6 @@ class MinePageDatasModel{
738 return WDHttp.post<ResponseDTO>(url,object, headers) 575 return WDHttp.post<ResponseDTO>(url,object, headers)
739 }; 576 };
740 577
741 - async getFollowOperationLocal(context: Context): Promise<ResponseDTO> {  
742 - Logger.info(TAG, `getMineFollowListDataLocal start`);  
743 - let compRes: ResponseDTO | null = await ResourcesUtils.getResourcesJson<ResponseDTO>(context,'follow_operation_data.json');  
744 - if (!compRes ) {  
745 - Logger.info(TAG, `getMineFollowListDataLocal compRes is empty`);  
746 - return compRes  
747 - }  
748 - Logger.info(TAG, `getMineFollowListDataLocal getResourcesJsonSync compRes : ${JSON.stringify(compRes)}`);  
749 - return compRes  
750 - }  
751 -  
752 578
753 } 579 }
754 580
@@ -100,7 +100,7 @@ class SearcherAboutDataModel{ @@ -100,7 +100,7 @@ class SearcherAboutDataModel{
100 Logger.info(TAG, `getSearchHintData start`); 100 Logger.info(TAG, `getSearchHintData start`);
101 this.fetchSearchHintData().then((navResDTO: ResponseDTO<string[]>) => { 101 this.fetchSearchHintData().then((navResDTO: ResponseDTO<string[]>) => {
102 if (!navResDTO || navResDTO.code != 0) { 102 if (!navResDTO || navResDTO.code != 0) {
103 - success(this.getSearchHintDataLocal(context)) 103 + error(null)
104 return 104 return
105 } 105 }
106 Logger.info(TAG, "getSearchHintData then,SearchHintDataResDTO.timeStamp:" + navResDTO.timestamp); 106 Logger.info(TAG, "getSearchHintData then,SearchHintDataResDTO.timeStamp:" + navResDTO.timestamp);
@@ -108,7 +108,7 @@ class SearcherAboutDataModel{ @@ -108,7 +108,7 @@ class SearcherAboutDataModel{
108 success(navigationBean); 108 success(navigationBean);
109 }).catch((err: Error) => { 109 }).catch((err: Error) => {
110 Logger.error(TAG, `fetchSearchHintData catch, error.name : ${err.name}, error.message:${err.message}`); 110 Logger.error(TAG, `fetchSearchHintData catch, error.name : ${err.name}, error.message:${err.message}`);
111 - success(this.getSearchHintDataLocal(context)) 111 + error(null)
112 }) 112 })
113 }) 113 })
114 } 114 }
@@ -119,17 +119,6 @@ class SearcherAboutDataModel{ @@ -119,17 +119,6 @@ class SearcherAboutDataModel{
119 return WDHttp.get<ResponseDTO<string[]>>(url, headers) 119 return WDHttp.get<ResponseDTO<string[]>>(url, headers)
120 }; 120 };
121 121
122 - async getSearchHintDataLocal(context: Context): Promise<string[]> {  
123 - Logger.info(TAG, `getSearchHintDataLocal start`);  
124 - let compRes: ResponseDTO<string[]> | null = await ResourcesUtils.getResourcesJson<ResponseDTO<string[]>>(context,'search_hint_data.json' );  
125 - if (!compRes || !compRes.data) {  
126 - Logger.info(TAG, `getSearchHintDataLocal compRes is empty`);  
127 - return []  
128 - }  
129 - Logger.info(TAG, `getSearchHintDataLocal compRes : ${JSON.stringify(compRes)}`);  
130 - return compRes.data  
131 - }  
132 -  
133 122
134 /** 123 /**
135 * 搜索主页 热词 124 * 搜索主页 热词
@@ -139,7 +128,7 @@ class SearcherAboutDataModel{ @@ -139,7 +128,7 @@ class SearcherAboutDataModel{
139 Logger.info(TAG, `getSearchHintData start`); 128 Logger.info(TAG, `getSearchHintData start`);
140 this.fetchSearchHotsData().then((navResDTO: ResponseDTO<SearchHotContentItem[]>) => { 129 this.fetchSearchHotsData().then((navResDTO: ResponseDTO<SearchHotContentItem[]>) => {
141 if (!navResDTO || navResDTO.code != 0) { 130 if (!navResDTO || navResDTO.code != 0) {
142 - success(this.getSearchHotsDataLocal(context)) 131 + error(null)
143 return 132 return
144 } 133 }
145 Logger.info(TAG, "getSearchHotsData then,getSearchHotsData.timeStamp:" + navResDTO.timestamp); 134 Logger.info(TAG, "getSearchHotsData then,getSearchHotsData.timeStamp:" + navResDTO.timestamp);
@@ -147,7 +136,7 @@ class SearcherAboutDataModel{ @@ -147,7 +136,7 @@ class SearcherAboutDataModel{
147 success(navigationBean); 136 success(navigationBean);
148 }).catch((err: Error) => { 137 }).catch((err: Error) => {
149 Logger.error(TAG, `getSearchHotsData catch, error.name : ${err.name}, error.message:${err.message}`); 138 Logger.error(TAG, `getSearchHotsData catch, error.name : ${err.name}, error.message:${err.message}`);
150 - success(this.getSearchHotsDataLocal(context)) 139 + error(null)
151 }) 140 })
152 }) 141 })
153 } 142 }
@@ -158,18 +147,6 @@ class SearcherAboutDataModel{ @@ -158,18 +147,6 @@ class SearcherAboutDataModel{
158 return WDHttp.get<ResponseDTO<SearchHotContentItem[]>>(url, headers) 147 return WDHttp.get<ResponseDTO<SearchHotContentItem[]>>(url, headers)
159 }; 148 };
160 149
161 - async getSearchHotsDataLocal(context: Context): Promise<SearchHotContentItem[]> {  
162 - Logger.info(TAG, `getSearchHotsDataLocal start`);  
163 - let compRes: ResponseDTO<SearchHotContentItem[]> | null = await ResourcesUtils.getResourcesJson<ResponseDTO<SearchHotContentItem[]>>(context,'search_hots_data.json' ,);  
164 - if (!compRes || !compRes.data) {  
165 - Logger.info(TAG, `getSearchHotsDataLocal compRes is empty`);  
166 - return []  
167 - }  
168 - Logger.info(TAG, `getSearchHotsDataLocal compRes : ${JSON.stringify(compRes)}`);  
169 - return compRes.data  
170 - }  
171 -  
172 -  
173 /** 150 /**
174 * 搜索 联想词 151 * 搜索 联想词
175 */ 152 */
@@ -178,7 +155,7 @@ class SearcherAboutDataModel{ @@ -178,7 +155,7 @@ class SearcherAboutDataModel{
178 Logger.info(TAG, `getSearchHintData start`); 155 Logger.info(TAG, `getSearchHintData start`);
179 this.fetchRelatedSearchContentData(keyword).then((navResDTO: ResponseDTO<string[]>) => { 156 this.fetchRelatedSearchContentData(keyword).then((navResDTO: ResponseDTO<string[]>) => {
180 if (!navResDTO || navResDTO.code != 0) { 157 if (!navResDTO || navResDTO.code != 0) {
181 - success(this.getRelatedSearchContentDataLocal(context)) 158 + error(null)
182 return 159 return
183 } 160 }
184 Logger.info(TAG, "getSearchHintData then,SearchHintDataResDTO.timeStamp:" + navResDTO.timestamp); 161 Logger.info(TAG, "getSearchHintData then,SearchHintDataResDTO.timeStamp:" + navResDTO.timestamp);
@@ -186,7 +163,7 @@ class SearcherAboutDataModel{ @@ -186,7 +163,7 @@ class SearcherAboutDataModel{
186 success(navigationBean); 163 success(navigationBean);
187 }).catch((err: Error) => { 164 }).catch((err: Error) => {
188 Logger.error(TAG, `fetchSearchHintData catch, error.name : ${err.name}, error.message:${err.message}`); 165 Logger.error(TAG, `fetchSearchHintData catch, error.name : ${err.name}, error.message:${err.message}`);
189 - success(this.getRelatedSearchContentDataLocal(context)) 166 + error(null)
190 }) 167 })
191 }) 168 })
192 } 169 }
@@ -197,17 +174,6 @@ class SearcherAboutDataModel{ @@ -197,17 +174,6 @@ class SearcherAboutDataModel{
197 return WDHttp.get<ResponseDTO<string[]>>(url, headers) 174 return WDHttp.get<ResponseDTO<string[]>>(url, headers)
198 }; 175 };
199 176
200 - async getRelatedSearchContentDataLocal(context: Context): Promise<string[]> {  
201 - Logger.info(TAG, `getSearchHintDataLocal start`);  
202 - let compRes: ResponseDTO<string[]> | null = await ResourcesUtils.getResourcesJson<ResponseDTO<string[]>>(context,'search_related_data_nimen.json' );  
203 - if (!compRes || !compRes.data) {  
204 - Logger.info(TAG, `getSearchHintDataLocal compRes is empty`);  
205 - return []  
206 - }  
207 - Logger.info(TAG, `getSearchHintDataLocal compRes : ${JSON.stringify(compRes)}`);  
208 - return compRes.data  
209 - }  
210 -  
211 /** 177 /**
212 * 搜索结果 展示tab数量 178 * 搜索结果 展示tab数量
213 */ 179 */
@@ -216,7 +182,7 @@ class SearcherAboutDataModel{ @@ -216,7 +182,7 @@ class SearcherAboutDataModel{
216 Logger.info(TAG, `getSearchResultCountData start`); 182 Logger.info(TAG, `getSearchResultCountData start`);
217 this.fetchSearchResultCountData(keyword).then((navResDTO: ResponseDTO<SearchResultCountItem>) => { 183 this.fetchSearchResultCountData(keyword).then((navResDTO: ResponseDTO<SearchResultCountItem>) => {
218 if (!navResDTO || navResDTO.code != 0) { 184 if (!navResDTO || navResDTO.code != 0) {
219 - success(this.getSearchResultCountDataLocal(context)) 185 + error(null)
220 return 186 return
221 } 187 }
222 Logger.info(TAG, "getSearchResultCountData then,SearchHintDataResDTO.timeStamp:" + navResDTO.timestamp); 188 Logger.info(TAG, "getSearchResultCountData then,SearchHintDataResDTO.timeStamp:" + navResDTO.timestamp);
@@ -224,7 +190,7 @@ class SearcherAboutDataModel{ @@ -224,7 +190,7 @@ class SearcherAboutDataModel{
224 success(navigationBean); 190 success(navigationBean);
225 }).catch((err: Error) => { 191 }).catch((err: Error) => {
226 Logger.error(TAG, `getSearchResultCountData catch, error.name : ${err.name}, error.message:${err.message}`); 192 Logger.error(TAG, `getSearchResultCountData catch, error.name : ${err.name}, error.message:${err.message}`);
227 - success(this.getSearchResultCountDataLocal(context)) 193 + error(null)
228 }) 194 })
229 }) 195 })
230 } 196 }
@@ -235,17 +201,6 @@ class SearcherAboutDataModel{ @@ -235,17 +201,6 @@ class SearcherAboutDataModel{
235 return WDHttp.get<ResponseDTO<SearchResultCountItem>>(url, headers) 201 return WDHttp.get<ResponseDTO<SearchResultCountItem>>(url, headers)
236 }; 202 };
237 203
238 - async getSearchResultCountDataLocal(context: Context): Promise<SearchResultCountItem> {  
239 - Logger.info(TAG, `getSearchResultCountDataLocal start`);  
240 - let compRes: ResponseDTO<SearchResultCountItem> | null = await ResourcesUtils.getResourcesJson<ResponseDTO<SearchResultCountItem>>(context,'search_result_count_data.json' );  
241 - if (!compRes || !compRes.data) {  
242 - Logger.info(TAG, `getSearchResultCountDataLocal compRes is empty`);  
243 - return new SearchResultCountItem()  
244 - }  
245 - Logger.info(TAG, `getSearchResultCountDataLocal compRes : ${JSON.stringify(compRes)}`);  
246 - return compRes.data  
247 - }  
248 -  
249 /** 204 /**
250 * 搜索结果 展示列表 205 * 搜索结果 展示列表
251 */ 206 */
@@ -254,7 +209,7 @@ class SearcherAboutDataModel{ @@ -254,7 +209,7 @@ class SearcherAboutDataModel{
254 Logger.info(TAG, `getSearchResultListData start`); 209 Logger.info(TAG, `getSearchResultListData start`);
255 this.fetchSearchResultListData(pageSize,pageNum,searchType,keyword).then((navResDTO: ResponseDTO<SearchResultContentData>) => { 210 this.fetchSearchResultListData(pageSize,pageNum,searchType,keyword).then((navResDTO: ResponseDTO<SearchResultContentData>) => {
256 if (!navResDTO || navResDTO.code != 0) { 211 if (!navResDTO || navResDTO.code != 0) {
257 - success(this.getSearchResultListDataLocal(context)) 212 + error(null)
258 return 213 return
259 } 214 }
260 Logger.info(TAG, "getSearchResultListData then,SearchResultListResDTO.timeStamp:" + navResDTO.timestamp); 215 Logger.info(TAG, "getSearchResultListData then,SearchResultListResDTO.timeStamp:" + navResDTO.timestamp);
@@ -262,7 +217,7 @@ class SearcherAboutDataModel{ @@ -262,7 +217,7 @@ class SearcherAboutDataModel{
262 success(navigationBean); 217 success(navigationBean);
263 }).catch((err: Error) => { 218 }).catch((err: Error) => {
264 Logger.error(TAG, `getSearchResultListData catch, error.name : ${err.name}, error.message:${err.message}`); 219 Logger.error(TAG, `getSearchResultListData catch, error.name : ${err.name}, error.message:${err.message}`);
265 - success(this.getSearchResultListDataLocal(context)) 220 + error(null)
266 }) 221 })
267 }) 222 })
268 } 223 }
@@ -273,17 +228,6 @@ class SearcherAboutDataModel{ @@ -273,17 +228,6 @@ class SearcherAboutDataModel{
273 return WDHttp.get<ResponseDTO<SearchResultContentData>>(url, headers) 228 return WDHttp.get<ResponseDTO<SearchResultContentData>>(url, headers)
274 }; 229 };
275 230
276 - async getSearchResultListDataLocal(context: Context): Promise<SearchResultContentData> {  
277 - Logger.info(TAG, `getSearchResultListDataLocal start`);  
278 - let compRes: ResponseDTO<SearchResultContentData> | null = await ResourcesUtils.getResourcesJson<ResponseDTO<SearchResultContentData>>(context,'search_result_list_data.json' );  
279 - if (!compRes || !compRes.data) {  
280 - Logger.info(TAG, `getSearchResultListDataLocal compRes is empty`);  
281 - return new SearchResultContentData()  
282 - }  
283 - Logger.info(TAG, `getSearchResultListDataLocal getResourcesJsonSync compRes : ${JSON.stringify(compRes)}`);  
284 - return compRes.data  
285 - }  
286 -  
287 /** 231 /**
288 * 搜索结果 展示列表(交互详情 评论收藏点赞分享数量) 232 * 搜索结果 展示列表(交互详情 评论收藏点赞分享数量)
289 */ 233 */
@@ -292,7 +236,7 @@ class SearcherAboutDataModel{ @@ -292,7 +236,7 @@ class SearcherAboutDataModel{
292 Logger.info(TAG, `getInteractListData start`); 236 Logger.info(TAG, `getInteractListData start`);
293 this.fetchInteractListData(data).then((navResDTO: ResponseDTO<InteractDataDTO[]>) => { 237 this.fetchInteractListData(data).then((navResDTO: ResponseDTO<InteractDataDTO[]>) => {
294 if (!navResDTO || navResDTO.code != 0) { 238 if (!navResDTO || navResDTO.code != 0) {
295 - success(this.getInteractListDataLocal(context)) 239 + error(null)
296 return 240 return
297 } 241 }
298 Logger.info(TAG, "getInteractListData then,SearchResultListResDTO.timeStamp:" + navResDTO.timestamp); 242 Logger.info(TAG, "getInteractListData then,SearchResultListResDTO.timeStamp:" + navResDTO.timestamp);
@@ -300,7 +244,7 @@ class SearcherAboutDataModel{ @@ -300,7 +244,7 @@ class SearcherAboutDataModel{
300 success(navigationBean); 244 success(navigationBean);
301 }).catch((err: Error) => { 245 }).catch((err: Error) => {
302 Logger.error(TAG, `getInteractListData catch, error.name : ${err.name}, error.message:${err.message}`); 246 Logger.error(TAG, `getInteractListData catch, error.name : ${err.name}, error.message:${err.message}`);
303 - success(this.getInteractListDataLocal(context)) 247 + error(null)
304 }) 248 })
305 }) 249 })
306 } 250 }
@@ -311,18 +255,6 @@ class SearcherAboutDataModel{ @@ -311,18 +255,6 @@ class SearcherAboutDataModel{
311 return WDHttp.post<ResponseDTO<InteractDataDTO[]>>(url,data, headers) 255 return WDHttp.post<ResponseDTO<InteractDataDTO[]>>(url,data, headers)
312 }; 256 };
313 257
314 - async getInteractListDataLocal(context: Context): Promise<InteractDataDTO[]> {  
315 - Logger.info(TAG, `getInteractListDataLocal start`);  
316 - let compRes: ResponseDTO<InteractDataDTO[]> | null = await ResourcesUtils.getResourcesJson<ResponseDTO<InteractDataDTO[]>>(context,'search_result_interact_list_data.json' );  
317 - if (!compRes || !compRes.data) {  
318 - Logger.info(TAG, `getInteractListDataLocal compRes is empty`);  
319 - return []  
320 - }  
321 - Logger.info(TAG, `getInteractListDataLocal getResourcesJsonSync compRes : ${JSON.stringify(compRes)}`);  
322 - return compRes.data  
323 - }  
324 -  
325 -  
326 /** 258 /**
327 * 获取关注详情 列表 259 * 获取关注详情 列表
328 */ 260 */
@@ -331,7 +263,7 @@ class SearcherAboutDataModel{ @@ -331,7 +263,7 @@ class SearcherAboutDataModel{
331 Logger.info(TAG, `getCreatorDetailListData start`); 263 Logger.info(TAG, `getCreatorDetailListData start`);
332 this.fetchCreatorDetailListData(object).then((navResDTO: ResponseDTO<CreatorDetailResponseItem[]>) => { 264 this.fetchCreatorDetailListData(object).then((navResDTO: ResponseDTO<CreatorDetailResponseItem[]>) => {
333 if (!navResDTO || navResDTO.code != 0) { 265 if (!navResDTO || navResDTO.code != 0) {
334 - success([]) 266 + error(null)
335 return 267 return
336 } 268 }
337 Logger.info(TAG, "getCreatorDetailListData then,SearchResultListResDTO.timeStamp:" + navResDTO.timestamp); 269 Logger.info(TAG, "getCreatorDetailListData then,SearchResultListResDTO.timeStamp:" + navResDTO.timestamp);
@@ -339,7 +271,7 @@ class SearcherAboutDataModel{ @@ -339,7 +271,7 @@ class SearcherAboutDataModel{
339 success(navigationBean); 271 success(navigationBean);
340 }).catch((err: Error) => { 272 }).catch((err: Error) => {
341 Logger.error(TAG, `getCreatorDetailListData catch, error.name : ${err.name}, error.message:${err.message}`); 273 Logger.error(TAG, `getCreatorDetailListData catch, error.name : ${err.name}, error.message:${err.message}`);
342 - success([]) 274 + error(null)
343 }) 275 })
344 }) 276 })
345 } 277 }
@@ -357,9 +289,8 @@ class SearcherAboutDataModel{ @@ -357,9 +289,8 @@ class SearcherAboutDataModel{
357 return new Promise<ContentDTO[]>((success, error) => { 289 return new Promise<ContentDTO[]>((success, error) => {
358 Logger.info(TAG, `getSearchSuggestData start`); 290 Logger.info(TAG, `getSearchSuggestData start`);
359 this.fetchSearchSuggestData(object).then((navResDTO: ResponseDTO<ContentDTO[]>) => { 291 this.fetchSearchSuggestData(object).then((navResDTO: ResponseDTO<ContentDTO[]>) => {
360 - if (!navResDTO || navResDTO.code != 0 /*|| navResDTO.data == null*/) {  
361 - // success(this.getSearchSuggestDataLocal(context))  
362 - success([]) 292 + if (!navResDTO || navResDTO.code != 0 ) {
  293 + error(null)
363 return 294 return
364 } 295 }
365 Logger.info(TAG, "getSearchSuggestData then,SearchResultListResDTO.timeStamp:" + navResDTO.timestamp); 296 Logger.info(TAG, "getSearchSuggestData then,SearchResultListResDTO.timeStamp:" + navResDTO.timestamp);
@@ -367,8 +298,7 @@ class SearcherAboutDataModel{ @@ -367,8 +298,7 @@ class SearcherAboutDataModel{
367 success(navigationBean); 298 success(navigationBean);
368 }).catch((err: Error) => { 299 }).catch((err: Error) => {
369 Logger.error(TAG, `getSearchSuggestData catch, error.name : ${err.name}, error.message:${err.message}`); 300 Logger.error(TAG, `getSearchSuggestData catch, error.name : ${err.name}, error.message:${err.message}`);
370 - // success(this.getSearchSuggestDataLocal(context))  
371 - success([]) 301 + error(null)
372 }) 302 })
373 }) 303 })
374 } 304 }
@@ -379,20 +309,6 @@ class SearcherAboutDataModel{ @@ -379,20 +309,6 @@ class SearcherAboutDataModel{
379 return WDHttp.post<ResponseDTO<ContentDTO[]>>(url,object, headers) 309 return WDHttp.post<ResponseDTO<ContentDTO[]>>(url,object, headers)
380 }; 310 };
381 311
382 - async getSearchSuggestDataLocal(context: Context): Promise<ContentDTO[]> {  
383 - Logger.info(TAG, `getInteractListDataLocal start`);  
384 - let compRes: ResponseDTO<ContentDTO[]> | null = await ResourcesUtils.getResourcesJson<ResponseDTO<ContentDTO[]>>(context,'search_suggest_data.json' );  
385 - if (!compRes || !compRes.data) {  
386 - Logger.info(TAG, `getInteractListDataLocal compRes is empty`);  
387 - return []  
388 - }  
389 - Logger.info(TAG, `getInteractListDataLocal getResourcesJsonSync compRes : ${JSON.stringify(compRes)}`);  
390 - return compRes.data  
391 - }  
392 -  
393 -  
394 -  
395 -  
396 } 312 }
397 313
398 const searcherAboutDataModel = SearcherAboutDataModel.getInstance() 314 const searcherAboutDataModel = SearcherAboutDataModel.getInstance()
@@ -65,9 +65,8 @@ struct MineHomePage { @@ -65,9 +65,8 @@ struct MineHomePage {
65 .height('130lpx') 65 .height('130lpx')
66 .objectFit(ImageFit.Cover) 66 .objectFit(ImageFit.Cover)
67 }.onClick(()=>{ 67 }.onClick(()=>{
68 - let params: Params = {  
69 - pageID: "531267787833221"//sit 测试用 512157124138245  
70 - } 68 + //TODO 显示头像
  69 + let params = {'userId': "531267787833221"} as Record<string, string>;
71 WDRouterRule.jumpWithPage(WDRouterPage.otherNormalUserHomePagePage,params) 70 WDRouterRule.jumpWithPage(WDRouterPage.otherNormalUserHomePagePage,params)
72 }).width('135lpx') 71 }).width('135lpx')
73 .height('135lpx') 72 .height('135lpx')
@@ -11,11 +11,11 @@ const TAG = "OtherNormalUserHomePage" @@ -11,11 +11,11 @@ const TAG = "OtherNormalUserHomePage"
11 @Entry 11 @Entry
12 @Component 12 @Component
13 struct OtherNormalUserHomePage { 13 struct OtherNormalUserHomePage {
14 - @State params:Params = router.getParams() as Params; 14 + @State params:Record<string, string> = router.getParams() as Record<string, string>;
15 @Watch('change') @State curUserId: string = '-1'; 15 @Watch('change') @State curUserId: string = '-1';
16 16
17 onPageShow() { 17 onPageShow() {
18 - this.curUserId = this.params?.pageID; 18 + this.curUserId = this.params?.['userId'];
19 } 19 }
20 20
21 change(){ 21 change(){
1 import HashMap from '@ohos.util.HashMap'; 1 import HashMap from '@ohos.util.HashMap';
2 import { HttpUrlUtils, ResponseDTO, WDHttp } from 'wdNetwork'; 2 import { HttpUrlUtils, ResponseDTO, WDHttp } from 'wdNetwork';
3 -import { DateTimeUtils, Logger } from 'wdKit'; 3 +import { DateTimeUtils, Logger, StringUtils } from 'wdKit';
4 import { 4 import {
5 batchLikeAndCollectResult, 5 batchLikeAndCollectResult,
6 CompInfoBean, 6 CompInfoBean,
@@ -128,6 +128,19 @@ export class PageRepository { @@ -128,6 +128,19 @@ export class PageRepository {
128 return url; 128 return url;
129 } 129 }
130 130
  131 + static getInteractDataV2Url(contentId: string, contentType: string, contentRelId: string,rmhPlatform:number) {
  132 + let url = HttpUrlUtils.getHost() + HttpUrlUtils.INTERACT_V2_DATA_PATH;
  133 + url = url + "?contentId=" + contentId
  134 + + "&contentType=" + contentType
  135 + if(!StringUtils.isEmpty(contentRelId)){
  136 + url = url + "&contentRelId=" + contentRelId;
  137 + }
  138 + url = url + "&rmhPlatform=" + rmhPlatform;
  139 + url = url + "&detail=" + '1';
  140 + Logger.info(TAG, "getInteractDataV2Url url = " + url)
  141 + return url;
  142 + }
  143 +
131 static getInteractDataUrl() { 144 static getInteractDataUrl() {
132 let url = HttpUrlUtils.getHost() + HttpUrlUtils.INTERACT_DATA_PATH; 145 let url = HttpUrlUtils.getHost() + HttpUrlUtils.INTERACT_DATA_PATH;
133 Logger.info(TAG, "getInteractDataUrl url = " + url) 146 Logger.info(TAG, "getInteractDataUrl url = " + url)
@@ -253,6 +266,12 @@ export class PageRepository { @@ -253,6 +266,12 @@ export class PageRepository {
253 return WDHttp.get<ResponseDTO<ContentDetailDTO[]>>(url, headers) 266 return WDHttp.get<ResponseDTO<ContentDetailDTO[]>>(url, headers)
254 }; 267 };
255 268
  269 + static fetchInteractDataV2(contentId: string, contentType: string, contentRelId: string,rmhPlatform:number) {
  270 + let url = PageRepository.getInteractDataV2Url(contentId, contentType, contentRelId,rmhPlatform)
  271 + let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();
  272 + return WDHttp.get<ResponseDTO<InteractDataDTO>>(url, headers)
  273 + };
  274 +
256 static fetchInteractData(param: object) { 275 static fetchInteractData(param: object) {
257 let url = PageRepository.getInteractDataUrl() 276 let url = PageRepository.getInteractDataUrl()
258 let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders(); 277 let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();
1 -import promptAction from '@ohos.promptAction';  
2 import { RefreshConstants as Const, RefreshState } from './RefreshConstants'; 1 import { RefreshConstants as Const, RefreshState } from './RefreshConstants';
3 import { touchMoveLoadMore, touchUpLoadMore } from './PullUpLoadMore'; 2 import { touchMoveLoadMore, touchUpLoadMore } from './PullUpLoadMore';
4 -import { PageDTO, CompDTO } from 'wdBean';  
5 import PageModel from '../viewmodel/PageModel'; 3 import PageModel from '../viewmodel/PageModel';
6 -import PageViewModel from '../viewmodel/PageViewModel';  
7 -import { DateTimeUtils } from 'wdKit';  
8 import PageHelper from '../viewmodel/PageHelper'; 4 import PageHelper from '../viewmodel/PageHelper';
9 import PageAdModel from '../viewmodel/PageAdvModel'; 5 import PageAdModel from '../viewmodel/PageAdvModel';
10 6
11 -export function listTouchEvent(pageModel: PageModel,pageAdvModel:PageAdModel, event: TouchEvent) { 7 +export function listTouchEvent(pageModel: PageModel, pageAdvModel: PageAdModel, event: TouchEvent) {
12 switch (event.type) { 8 switch (event.type) {
13 case TouchType.Down: 9 case TouchType.Down:
14 pageModel.downY = event.touches[0].y; 10 pageModel.downY = event.touches[0].y;
@@ -36,7 +32,7 @@ export function listTouchEvent(pageModel: PageModel,pageAdvModel:PageAdModel, ev @@ -36,7 +32,7 @@ export function listTouchEvent(pageModel: PageModel,pageAdvModel:PageAdModel, ev
36 } 32 }
37 if ((pageModel.isPullRefreshOperation === true)) { 33 if ((pageModel.isPullRefreshOperation === true)) {
38 // Lift your finger and pull down to refresh. 34 // Lift your finger and pull down to refresh.
39 - touchUpPullRefresh(pageModel,pageAdvModel); 35 + touchUpPullRefresh(pageModel, pageAdvModel);
40 } else { 36 } else {
41 // Fingers up, handle loading more. 37 // Fingers up, handle loading more.
42 touchUpLoadMore(pageModel); 38 touchUpLoadMore(pageModel);
@@ -66,7 +62,7 @@ export function touchMovePullRefresh(pageModel: PageModel, event: TouchEvent) { @@ -66,7 +62,7 @@ export function touchMovePullRefresh(pageModel: PageModel, event: TouchEvent) {
66 } 62 }
67 } 63 }
68 64
69 -export function touchUpPullRefresh(pageModel: PageModel,pageAdvModel:PageAdModel) { 65 +export function touchUpPullRefresh(pageModel: PageModel, pageAdvModel: PageAdModel) {
70 if (pageModel.isCanRefresh === true) { 66 if (pageModel.isCanRefresh === true) {
71 pageModel.offsetY = vp2px(pageModel.pullDownRefreshHeight); 67 pageModel.offsetY = vp2px(pageModel.pullDownRefreshHeight);
72 pullRefreshState(pageModel, RefreshState.Refreshing); 68 pullRefreshState(pageModel, RefreshState.Refreshing);
@@ -74,38 +70,26 @@ export function touchUpPullRefresh(pageModel: PageModel,pageAdvModel:PageAdModel @@ -74,38 +70,26 @@ export function touchUpPullRefresh(pageModel: PageModel,pageAdvModel:PageAdModel
74 setTimeout(() => { 70 setTimeout(() => {
75 let self: PageModel = pageModel; 71 let self: PageModel = pageModel;
76 let advSelf: PageAdModel = pageAdvModel; 72 let advSelf: PageAdModel = pageAdvModel;
77 - PageHelper.refreshUI(self,advSelf)  
78 - // PageViewModel.getPageData(self.bizCopy(2))  
79 - // .then((data: PageDTO) => {  
80 - // self.timestamp = DateTimeUtils.getTimeStamp().toString()  
81 - // if (data == null || data.compList == null || data.compList.length == 0) {  
82 - // self.hasMore = false;  
83 - // } else {  
84 - // if (data.compList.length == self.pageSize) {  
85 - // self.currentPage++;  
86 - // self.hasMore = true;  
87 - // } else {  
88 - // self.hasMore = false;  
89 - // }  
90 - // // 刷新,替换所有数据  
91 - // self.compList.replaceAll(...data.compList)  
92 - // PageViewModel.getInteractData(data.compList).then((data: CompDTO[]) => {  
93 - // // 刷新,替换所有数据  
94 - // self.compList.replaceAll(...data)  
95 - // self.timestamp = DateTimeUtils.getTimeStamp().toString()  
96 - // })  
97 - // }  
98 - // closeRefresh(self, true);  
99 - // }).catch((err: string | Resource) => {  
100 - // promptAction.showToast({ message: err });  
101 - // closeRefresh(self, false);  
102 - // }); 73 + PageHelper.refreshUI(self, advSelf)
103 }, Const.DELAY_TIME); 74 }, Const.DELAY_TIME);
104 } else { 75 } else {
105 closeRefresh(pageModel, false); 76 closeRefresh(pageModel, false);
106 } 77 }
107 } 78 }
108 79
  80 +/**
  81 + * 自动刷新接口,如首页底导,双击按钮自动刷新
  82 + * @param pageModel 页面数据
  83 + * @param pageAdvModel 广告数据
  84 + */
  85 +export function autoRefresh(pageModel: PageModel, pageAdvModel: PageAdModel) {
  86 + pageModel.isVisiblePullDown = true;
  87 + pageModel.offsetY = vp2px(pageModel.pullDownRefreshHeight);
  88 + pullRefreshState(pageModel, RefreshState.Refreshing);
  89 + pageModel.currentPage = 1;
  90 + PageHelper.refreshUI(pageModel, pageAdvModel)
  91 +}
  92 +
109 export function pullRefreshState(pageModel: PageModel, state: number) { 93 export function pullRefreshState(pageModel: PageModel, state: number) {
110 switch (state) { 94 switch (state) {
111 case RefreshState.DropDown: 95 case RefreshState.DropDown:
1 -import promptAction from '@ohos.promptAction';  
2 import PageModel from '../viewmodel/PageModel'; 1 import PageModel from '../viewmodel/PageModel';
3 import { RefreshConstants as Const } from './RefreshConstants'; 2 import { RefreshConstants as Const } from './RefreshConstants';
4 -import PageViewModel from '../viewmodel/PageViewModel';  
5 -import { PageDTO, CompDTO } from 'wdBean';  
6 -import { DateTimeUtils } from 'wdKit';  
7 import PageHelper from '../viewmodel/PageHelper'; 3 import PageHelper from '../viewmodel/PageHelper';
8 4
9 export function touchMoveLoadMore(model: PageModel, event: TouchEvent) { 5 export function touchMoveLoadMore(model: PageModel, event: TouchEvent) {
@@ -30,29 +26,6 @@ export function touchUpLoadMore(model: PageModel) { @@ -30,29 +26,6 @@ export function touchUpLoadMore(model: PageModel) {
30 setTimeout(() => { 26 setTimeout(() => {
31 closeLoadMore(model); 27 closeLoadMore(model);
32 PageHelper.loadMore(self) 28 PageHelper.loadMore(self)
33 - // PageViewModel.getPageData(self.bizCopy())  
34 - // .then((data: PageDTO) => {  
35 - // self.timestamp = DateTimeUtils.getTimeStamp().toString()  
36 - // if (data == null || data.compList == null || data.compList.length == 0) {  
37 - // self.hasMore = false;  
38 - // } else {  
39 - // if (data.compList.length == self.pageSize) {  
40 - // self.currentPage++;  
41 - // self.hasMore = true;  
42 - // } else {  
43 - // self.hasMore = false;  
44 - // }  
45 - // let sizeBefore: number = self.compList.size();  
46 - // self.compList.push(...data.compList)  
47 - // PageViewModel.getInteractData(data.compList).then((data: CompDTO[]) => {  
48 - // // 刷新,替换所有数据  
49 - // self.compList.updateItems(sizeBefore, data)  
50 - // self.timestamp = DateTimeUtils.getTimeStamp().toString()  
51 - // })  
52 - // }  
53 - // }).catch((err: string | Resource) => {  
54 - // promptAction.showToast({ message: err });  
55 - // })  
56 }, Const.DELAY_TIME); 29 }, Const.DELAY_TIME);
57 } else { 30 } else {
58 closeLoadMore(self); 31 closeLoadMore(self);
@@ -21,6 +21,7 @@ export class LikeViewModel { @@ -21,6 +21,7 @@ export class LikeViewModel {
21 this.likeModel.executeLike(bean) 21 this.likeModel.executeLike(bean)
22 } 22 }
23 23
  24 + //点赞
24 executeLike2(bean: Record<string, string>) { 25 executeLike2(bean: Record<string, string>) {
25 26
26 return new Promise<object>((success, fail) => { 27 return new Promise<object>((success, fail) => {
@@ -32,4 +33,20 @@ export class LikeViewModel { @@ -32,4 +33,20 @@ export class LikeViewModel {
32 }) 33 })
33 34
34 } 35 }
  36 +
  37 + //点赞状态
  38 + getLikeStatus(bean: Record<string, string>) {
  39 +
  40 + return new Promise<object>((success, fail) => {
  41 + this.likeModel.getLikeStatus(bean).then((data) => {
  42 + success(data)
  43 + }).catch((error: string) => {
  44 + fail(error)
  45 + })
  46 + })
  47 +
  48 + }
  49 +
  50 +
  51 +
35 } 52 }
@@ -5,7 +5,8 @@ import { ContentDetailDTO, @@ -5,7 +5,8 @@ import { ContentDetailDTO,
5 batchLikeAndCollectResult, 5 batchLikeAndCollectResult,
6 postBatchAttentionStatusParams, 6 postBatchAttentionStatusParams,
7 postBatchAttentionStatusResult, 7 postBatchAttentionStatusResult,
8 - postInteractBrowsOperateParams 8 + postInteractBrowsOperateParams,
  9 + InteractDataDTO
9 } from 'wdBean'; 10 } from 'wdBean';
10 import { PageRepository } from '../repository/PageRepository'; 11 import { PageRepository } from '../repository/PageRepository';
11 12
@@ -106,4 +107,28 @@ export class MultiPictureDetailViewModel { @@ -106,4 +107,28 @@ export class MultiPictureDetailViewModel {
106 }) 107 })
107 } 108 }
108 109
  110 + //查询点赞数量
  111 + static async interactDataV2(contentId: string, contentType: string, contentRelId: string,rmhPlatform:number): Promise<InteractDataDTO> {
  112 + return new Promise<InteractDataDTO>((success, error) => {
  113 + Logger.info(TAG, `interactDataV2 start`);
  114 + PageRepository.fetchInteractDataV2(contentId, contentType, contentRelId,rmhPlatform).then((resDTO: ResponseDTO<InteractDataDTO>) => {
  115 + if (!resDTO || !resDTO.data) {
  116 + Logger.error(TAG, 'interactDataV2 is empty');
  117 + error('resDTO is empty');
  118 + return
  119 + }
  120 + if (resDTO.code != 0) {
  121 + Logger.error(TAG, `interactDataV2 then code:${resDTO.code}, message:${resDTO.message}`);
  122 + error('resDTO Response Code is failure');
  123 + return
  124 + }
  125 + Logger.info(TAG, "interactDataV2 then,navResDTO.timestamp:" + resDTO.timestamp);
  126 + success(resDTO.data);
  127 + }).catch((err: Error) => {
  128 + Logger.error(TAG, `interactDataV2 catch, error.name : ${err.name}, error.message:${err.message}`);
  129 + error(err);
  130 + })
  131 + })
  132 + }
  133 +
109 } 134 }
1 import { PageDTO, CompDTO, PageInfoDTO, ContentDTO } from 'wdBean'; 1 import { PageDTO, CompDTO, PageInfoDTO, ContentDTO } from 'wdBean';
2 import { CompStyle, ViewType } from 'wdConstant/Index'; 2 import { CompStyle, ViewType } from 'wdConstant/Index';
3 -import { CollectionUtils, DateTimeUtils, Logger } from 'wdKit'; 3 +import { CollectionUtils, DateTimeUtils, Logger, NetworkUtil } 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';
@@ -8,6 +8,7 @@ import { promptAction } from '@kit.ArkUI'; @@ -8,6 +8,7 @@ import { promptAction } from '@kit.ArkUI';
8 import { AdvRuleBean, CompAdvBean } from 'wdBean/src/main/ets/bean/adv/AdvsRuleBean'; 8 import { AdvRuleBean, CompAdvBean } from 'wdBean/src/main/ets/bean/adv/AdvsRuleBean';
9 import PageAdModel from './PageAdvModel'; 9 import PageAdModel from './PageAdvModel';
10 import { ArrayList } from '@kit.ArkTS'; 10 import { ArrayList } from '@kit.ArkTS';
  11 +import { WDViewDefaultType } from '../components/view/EmptyComponent';
11 12
12 const TAG = 'PageHelper'; 13 const TAG = 'PageHelper';
13 14
@@ -37,22 +38,31 @@ export class PageHelper { @@ -37,22 +38,31 @@ export class PageHelper {
37 */ 38 */
38 async getInitData(pageModel: PageModel, pageAdvModel: PageAdModel) { 39 async getInitData(pageModel: PageModel, pageAdvModel: PageAdModel) {
39 pageModel.loadStrategy = 1 40 pageModel.loadStrategy = 1
  41 + let netStatus = NetworkUtil.isNetConnected()
  42 + if (netStatus) {
40 this.getPageInfo(pageModel, pageAdvModel) 43 this.getPageInfo(pageModel, pageAdvModel)
  44 + } else {
  45 + pageModel.viewType = ViewType.EMPTY;
  46 + pageModel.emptyType = WDViewDefaultType.WDViewDefaultType_NoNetwork;
  47 + }
41 } 48 }
42 49
43 - async getPageInfo(pageModel: PageModel, pageAdvModel: PageAdModel) { 50 + getPageInfo(pageModel: PageModel, pageAdvModel: PageAdModel) {
44 pageModel.currentPage = 1; 51 pageModel.currentPage = 1;
45 - let pageInfo = await PageViewModel.getPageInfo(pageModel.pageId); 52 + PageViewModel.getPageInfo(pageModel.pageId).then(pageInfo => {
46 if (pageInfo == null) { 53 if (pageInfo == null) {
47 pageModel.viewType = ViewType.EMPTY; 54 pageModel.viewType = ViewType.EMPTY;
  55 + pageModel.emptyType = WDViewDefaultType.WDViewDefaultType_NoListContent;
48 return; 56 return;
49 } 57 }
50 pageModel.pageInfo = pageInfo; 58 pageModel.pageInfo = pageInfo;
51 //解析广告资源 59 //解析广告资源
52 - pageAdvModel.analysisAdvSource(pageInfo)  
53 - 60 + pageAdvModel.analysisAdvSource(pageInfo);
54 this.parseGroup(pageModel) 61 this.parseGroup(pageModel)
55 - 62 + }).catch(() => {
  63 + pageModel.viewType = ViewType.EMPTY;
  64 + pageModel.emptyType = WDViewDefaultType.WDViewDefaultType_ContentFailed;
  65 + })
56 } 66 }
57 67
58 68
@@ -84,6 +94,8 @@ export class PageHelper { @@ -84,6 +94,8 @@ export class PageHelper {
84 // 没数据,展示空页面 94 // 没数据,展示空页面
85 Logger.debug(TAG, 'aboutToAppear, data response page ' + pageModel.pageId + ', comp list is empty.'); 95 Logger.debug(TAG, 'aboutToAppear, data response page ' + pageModel.pageId + ', comp list is empty.');
86 pageModel.viewType = ViewType.EMPTY; 96 pageModel.viewType = ViewType.EMPTY;
  97 + pageModel.emptyType = WDViewDefaultType.WDViewDefaultType_NoListContent;
  98 +
87 } 99 }
88 } 100 }
89 101
@@ -5,6 +5,7 @@ import { RefreshConstants as Const } from '../utils/RefreshConstants'; @@ -5,6 +5,7 @@ import { RefreshConstants as Const } from '../utils/RefreshConstants';
5 import { PageUIReqBean } from '../components/page/bean/PageUIReqBean'; 5 import { PageUIReqBean } from '../components/page/bean/PageUIReqBean';
6 import { GroupInfoDTO, PageInfoDTO } from 'wdBean/src/main/ets/bean/navigation/PageInfoDTO'; 6 import { GroupInfoDTO, PageInfoDTO } from 'wdBean/src/main/ets/bean/navigation/PageInfoDTO';
7 import { AdvRuleBean, CompAdvBean } from 'wdBean/src/main/ets/bean/adv/AdvsRuleBean'; 7 import { AdvRuleBean, CompAdvBean } from 'wdBean/src/main/ets/bean/adv/AdvsRuleBean';
  8 +import { WDViewDefaultType } from '../components/view/EmptyComponent';
8 9
9 /** 10 /**
10 * 页面下拉刷新、上拉加载数据bean。 11 * 页面下拉刷新、上拉加载数据bean。
@@ -38,6 +39,7 @@ export default class PageModel { @@ -38,6 +39,7 @@ export default class PageModel {
38 isVisiblePullUpLoad: boolean = false; 39 isVisiblePullUpLoad: boolean = false;
39 offsetY: number = 0; 40 offsetY: number = 0;
40 viewType: number = ViewType.LOADING; 41 viewType: number = ViewType.LOADING;
  42 + emptyType: WDViewDefaultType = WDViewDefaultType.WDViewDefaultType_Default
41 hasMore: boolean = true; 43 hasMore: boolean = true;
42 startIndex = 0; 44 startIndex = 0;
43 endIndex = 0; 45 endIndex = 0;
@@ -34,7 +34,7 @@ @@ -34,7 +34,7 @@
34 }, 34 },
35 { 35 {
36 "name": "selected_text_size", 36 "name": "selected_text_size",
37 - "value": "18fp" 37 + "value": "17vp"
38 }, 38 },
39 { 39 {
40 "name": "font_size_18", 40 "name": "font_size_18",
@@ -117,6 +117,10 @@ @@ -117,6 +117,10 @@
117 "value": "28vp" 117 "value": "28vp"
118 }, 118 },
119 { 119 {
  120 + "name": "margin_40",
  121 + "value": "40vp"
  122 + },
  123 + {
120 "name": "margin_48", 124 "name": "margin_48",
121 "value": "48vp" 125 "value": "48vp"
122 }, 126 },
@@ -129,6 +133,10 @@ @@ -129,6 +133,10 @@
129 "value": "60vp" 133 "value": "60vp"
130 }, 134 },
131 { 135 {
  136 + "name": "margin_154",
  137 + "value": "154vp"
  138 + },
  139 + {
132 "name": "single_row_03_img_height", 140 "name": "single_row_03_img_height",
133 "value": "88vp" 141 "value": "88vp"
134 }, 142 },
@@ -170,11 +178,11 @@ @@ -170,11 +178,11 @@
170 }, 178 },
171 { 179 {
172 "name": "top_tab_item_padding_bottom", 180 "name": "top_tab_item_padding_bottom",
173 - "value": "5vp" 181 + "value": "2vp"
174 }, 182 },
175 { 183 {
176 "name": "top_tab_item_padding_top", 184 "name": "top_tab_item_padding_top",
177 - "value": "2vp" 185 + "value": "5vp"
178 }, 186 },
179 { 187 {
180 "name": "top_bar_height", 188 "name": "top_bar_height",
@@ -185,6 +193,10 @@ @@ -185,6 +193,10 @@
185 "value": "24vp" 193 "value": "24vp"
186 }, 194 },
187 { 195 {
  196 + "name": "margin_1",
  197 + "value": "1vp"
  198 + },
  199 + {
188 "name": "margin_6", 200 "name": "margin_6",
189 "value": "6vp" 201 "value": "6vp"
190 }, 202 },
@@ -6,7 +6,7 @@ @@ -6,7 +6,7 @@
6 }, 6 },
7 { 7 {
8 "name": "footer_text", 8 "name": "footer_text",
9 - "value": "已经到底了" 9 + "value": "已显示全部内容"
10 }, 10 },
11 { 11 {
12 "name": "pull_up_load_text", 12 "name": "pull_up_load_text",
@@ -98,7 +98,14 @@ export struct DetailPlayLivePage { @@ -98,7 +98,14 @@ export struct DetailPlayLivePage {
98 (data) => { 98 (data) => {
99 if (data.length > 0) { 99 if (data.length > 0) {
100 if (data[0].liveInfo?.liveState == 'wait') { 100 if (data[0].liveInfo?.liveState == 'wait') {
  101 + //直播样式 0-正常模式 , 1-隐藏直播间,2-隐藏大家聊 【人民号发布是竖屏的,为空】
  102 + if (data[0].liveInfo?.liveStyle == 1) {
  103 + this.tabs = ['简介', '大家聊']
  104 + } else if (data[0].liveInfo?.liveStyle == 2) {
  105 + this.tabs = ['简介', '直播间',]
  106 + } else {
101 this.tabs = ['简介', '直播间', '大家聊'] 107 this.tabs = ['简介', '直播间', '大家聊']
  108 + }
102 } else { 109 } else {
103 this.tabs = ['直播间', '大家聊'] 110 this.tabs = ['直播间', '大家聊']
104 } 111 }
@@ -4,6 +4,7 @@ import { devicePLSensorManager } from 'wdDetailPlayApi/Index' @@ -4,6 +4,7 @@ import { devicePLSensorManager } from 'wdDetailPlayApi/Index'
4 import { DateFormatUtil, WDPlayerController } from 'wdPlayer/Index' 4 import { DateFormatUtil, WDPlayerController } from 'wdPlayer/Index'
5 import { LiveDetailsBean, LiveRoomDataBean } from 'wdBean/Index' 5 import { LiveDetailsBean, LiveRoomDataBean } from 'wdBean/Index'
6 import { DisplayDirection } from 'wdConstant/Index' 6 import { DisplayDirection } from 'wdConstant/Index'
  7 +import { LiveFollowComponent } from 'wdComponent/Index'
7 8
8 @Component 9 @Component
9 export struct PlayUIComponent { 10 export struct PlayUIComponent {
@@ -95,7 +96,17 @@ export struct PlayUIComponent { @@ -95,7 +96,17 @@ export struct PlayUIComponent {
95 bottom: 10 96 bottom: 10
96 }) 97 })
97 98
  99 + Row() {
  100 + if (this.liveDetailsBean?.rmhInfo) {
  101 + LiveFollowComponent({
  102 + rmhInfo: this.liveDetailsBean.rmhInfo
  103 + })
  104 + .margin({
  105 + right: 10
  106 + })
  107 + }
98 this.getLiveStatusView() 108 this.getLiveStatusView()
  109 + }
99 }.width('100%') 110 }.width('100%')
100 .padding({ 111 .padding({
101 top: 20, 112 top: 20,
@@ -78,7 +78,7 @@ export struct PlayerCommentComponent { @@ -78,7 +78,7 @@ export struct PlayerCommentComponent {
78 78
79 LiveCommentComponent({ heartNum: this.liveRoomDataBean.likeNum }) 79 LiveCommentComponent({ heartNum: this.liveRoomDataBean.likeNum })
80 .visibility(this.displayDirection == DisplayDirection.VERTICAL ? Visibility.Visible : Visibility.None) 80 .visibility(this.displayDirection == DisplayDirection.VERTICAL ? Visibility.Visible : Visibility.None)
81 - .backgroundColor(Color.Transparent) 81 + .backgroundColor(Color.Black)
82 }.alignItems(HorizontalAlign.Start) 82 }.alignItems(HorizontalAlign.Start)
83 83
84 } 84 }
@@ -5,7 +5,7 @@ const TAG = 'PlayerComponent' @@ -5,7 +5,7 @@ const TAG = 'PlayerComponent'
5 5
6 @Component 6 @Component
7 export struct PlayerComponent { 7 export struct PlayerComponent {
8 - private playerController?: WDPlayerController; 8 + @Prop playerController: WDPlayerController;
9 @Consume @Watch('updateData') liveDetailsBean: LiveDetailsBean 9 @Consume @Watch('updateData') liveDetailsBean: LiveDetailsBean
10 @Consume @Watch('pageShowChange') pageShow: number 10 @Consume @Watch('pageShowChange') pageShow: number
11 @Consume @Watch('pageHideChange') pageHide: number 11 @Consume @Watch('pageHideChange') pageHide: number
@@ -26,17 +26,15 @@ export struct PlayerComponent { @@ -26,17 +26,15 @@ export struct PlayerComponent {
26 26
27 aboutToAppear(): void { 27 aboutToAppear(): void {
28 console.log(TAG, 'aboutToAppear') 28 console.log(TAG, 'aboutToAppear')
29 - if (this.playerController) {  
30 this.playerController.onCanplay = () => { 29 this.playerController.onCanplay = () => {
31 console.log('可以播放了') 30 console.log('可以播放了')
32 this.playerController?.play() 31 this.playerController?.play()
33 - // this.playerController.selfSize  
34 } 32 }
35 } 33 }
36 34
37 - }  
38 -  
39 aboutToDisappear(): void { 35 aboutToDisappear(): void {
  36 + this.playerController.onCanplay = () => {
  37 + }
40 this.playerController?.pause() 38 this.playerController?.pause()
41 this.playerController?.stop() 39 this.playerController?.stop()
42 this.playerController?.release() 40 this.playerController?.release()
@@ -74,15 +72,14 @@ export struct PlayerComponent { @@ -74,15 +72,14 @@ export struct PlayerComponent {
74 .blur(100) 72 .blur(100)
75 .renderFit(RenderFit.RESIZE_COVER) 73 .renderFit(RenderFit.RESIZE_COVER)
76 74
77 - // TODO:判断横竖屏,liveStreamType=1竖屏铺满屏幕,liveStreamType=0横屏正常展示 75 + // TODO:判断横竖屏,liveStreamType=1竖屏铺满屏幕,裁剪不拉伸,liveStreamType=0横屏正常展示
78 if (this.liveStreamType == null) { 76 if (this.liveStreamType == null) {
79 WDPlayerRenderVLiveView({ 77 WDPlayerRenderVLiveView({
80 playerController: this.playerController, 78 playerController: this.playerController,
81 onLoad: () => { 79 onLoad: () => {
82 this.playerController?.firstPlay(this.playUrl); 80 this.playerController?.firstPlay(this.playUrl);
83 } 81 }
84 - }).height('100%')  
85 - .width('100%') 82 + })
86 } else if (this.liveStreamType == 0) { 83 } else if (this.liveStreamType == 0) {
87 WDPlayerRenderView({ 84 WDPlayerRenderView({
88 playerController: this.playerController, 85 playerController: this.playerController,
1 import { LiveDetailsBean, LiveRoomDataBean } from 'wdBean/Index' 1 import { LiveDetailsBean, LiveRoomDataBean } from 'wdBean/Index'
  2 +import { LiveFollowComponent } from 'wdComponent/Index'
2 import { NumberFormatterUtils } from 'wdKit/Index' 3 import { NumberFormatterUtils } from 'wdKit/Index'
3 4
4 @Preview 5 @Preview
@@ -35,28 +36,12 @@ export struct PlayerTitleComponent { @@ -35,28 +36,12 @@ export struct PlayerTitleComponent {
35 @Builder 36 @Builder
36 getLiveStatusView() { 37 getLiveStatusView() {
37 if (this.liveDetailsBean.rmhInfo?.rmhName) { 38 if (this.liveDetailsBean.rmhInfo?.rmhName) {
38 - Row() {  
39 - Image(this.liveDetailsBean.rmhInfo?.rmhHeadUrl || '')  
40 - .width(24)  
41 - .aspectRatio(1)  
42 - .borderRadius(12)  
43 - .fillColor(Color.Transparent)  
44 -  
45 - Text(this.liveDetailsBean.rmhInfo?.rmhName || '')  
46 - .fontSize(12)  
47 - .fontWeight(500)  
48 - .fontColor(Color.White)  
49 - .padding({  
50 - top: 2,  
51 - right: 8,  
52 - left: 4,  
53 - bottom: 2 39 + LiveFollowComponent({
  40 + rmhInfo: this.liveDetailsBean.rmhInfo
  41 + }).margin({
  42 + right: 10
54 }) 43 })
55 - }  
56 - .backgroundColor('#4D000000')  
57 - .borderRadius(2)  
58 - .borderRadius({ topLeft: 12, bottomLeft: 12 })  
59 - .margin({ right: 8 }) 44 +
60 } 45 }
61 46
62 47
@@ -23,12 +23,12 @@ export struct DetailPlayShortVideoPage { @@ -23,12 +23,12 @@ export struct DetailPlayShortVideoPage {
23 @Prop index: number = 0 23 @Prop index: number = 0
24 @Prop @Watch('currentIndexChange') currentIndex: number = 0 24 @Prop @Watch('currentIndexChange') currentIndex: number = 0
25 @State playerController: WDPlayerController = new WDPlayerController(); 25 @State playerController: WDPlayerController = new WDPlayerController();
26 - @Provide contentDetailData: ContentDetailDTO | undefined = undefined  
27 - @Provide interactData: InteractDataDTO | undefined = undefined 26 + @Provide contentDetailData: ContentDetailDTO = {} as ContentDetailDTO
  27 + @Provide interactData: InteractDataDTO = {} as InteractDataDTO
28 @Provide isFullScreen: boolean = false; 28 @Provide isFullScreen: boolean = false;
29 @Provide progressVal: number = 0; 29 @Provide progressVal: number = 0;
30 @Provide videoLandScape?: number = 1; // 视频朝向, 横屏视频:1;竖屏视频:2 30 @Provide videoLandScape?: number = 1; // 视频朝向, 横屏视频:1;竖屏视频:2
31 - @Provide newsStatusOfUser: batchLikeAndCollectResult | undefined = undefined // 点赞、收藏状态 31 + @Provide newsStatusOfUser: batchLikeAndCollectResult = {} as batchLikeAndCollectResult // 点赞、收藏状态
32 @Provide followStatus: string = '0' // 关注状态 32 @Provide followStatus: string = '0' // 关注状态
33 @Provide isOpenDetail: boolean = false // 查看详情按钮点击 33 @Provide isOpenDetail: boolean = false // 查看详情按钮点击
34 @Provide isDragging: boolean = false // 拖动时间进度条 34 @Provide isDragging: boolean = false // 拖动时间进度条
@@ -24,10 +24,8 @@ export struct DetailVideoListPage { @@ -24,10 +24,8 @@ export struct DetailVideoListPage {
24 @Provide pageHide: number = -1 24 @Provide pageHide: number = -1
25 @Provide switchVideoStatus: boolean = false 25 @Provide switchVideoStatus: boolean = false
26 @State data: ContentDetailDTO[] = [] 26 @State data: ContentDetailDTO[] = []
27 - @State testData: string[] = ['111', '222', '333']  
28 @State currentIndex: number = 0 27 @State currentIndex: number = 0
29 @State interactDataList: InteractDataDTO[] = [] 28 @State interactDataList: InteractDataDTO[] = []
30 - @State isFullScreen: boolean = false  
31 29
32 async aboutToAppear(): Promise<void> { 30 async aboutToAppear(): Promise<void> {
33 this.openFullScreen() 31 this.openFullScreen()
@@ -41,10 +39,7 @@ export struct DetailVideoListPage { @@ -41,10 +39,7 @@ export struct DetailVideoListPage {
41 } 39 }
42 await this.getContentDetail(this.contentId, this.relId, this.relType) 40 await this.getContentDetail(this.contentId, this.relId, this.relType)
43 } 41 }
44 -  
45 await this.queryVideoList() 42 await this.queryVideoList()
46 - this.getContentInteract()  
47 -  
48 console.log(TAG, 'aboutToAppear', JSON.stringify(action.params)) 43 console.log(TAG, 'aboutToAppear', JSON.stringify(action.params))
49 } 44 }
50 45
@@ -93,9 +88,22 @@ export struct DetailVideoListPage { @@ -93,9 +88,22 @@ export struct DetailVideoListPage {
93 contentId: contentId, 88 contentId: contentId,
94 relId: relId, 89 relId: relId,
95 relType: relType 90 relType: relType
96 - }).then((resDTO: ResponseDTO<ContentDetailDTO[]>) => {  
97 - console.error('getContentDetail==', JSON.stringify(resDTO.data)) 91 + }).then(async (resDTO: ResponseDTO<ContentDetailDTO[]>) => {
  92 + console.log(TAG, 'getContentDetail:', JSON.stringify(resDTO.data))
98 if (resDTO.data) { 93 if (resDTO.data) {
  94 + const params: contentListParams = {
  95 + contentList: [{
  96 + contentId: resDTO.data[0].newsId + '',
  97 + contentType: resDTO.data[0].newsType
  98 + }]
  99 + }
  100 + // 批量查询内容当前用户点赞、收藏状态
  101 + await ContentDetailRequest.getContentInteract(params).then(res => {
  102 + if (res.data) {
  103 + this.interactDataList = this.interactDataList.concat(res.data)
  104 + }
  105 + console.log('获取互动点赞等数据===', JSON.stringify(res))
  106 + })
99 this.data.push(resDTO.data[0]) 107 this.data.push(resDTO.data[0])
100 } 108 }
101 }) 109 })
@@ -108,8 +116,9 @@ export struct DetailVideoListPage { @@ -108,8 +116,9 @@ export struct DetailVideoListPage {
108 await ContentDetailRequest.postRecommendVideoList({ 116 await ContentDetailRequest.postRecommendVideoList({
109 pageSize: 5, 117 pageSize: 5,
110 refreshCnt: 1 118 refreshCnt: 1
111 - }).then(res => { 119 + }).then(async res => {
112 if (res.data) { 120 if (res.data) {
  121 + await this.getContentInteract(res.data)
113 this.data = this.data.concat(res.data) 122 this.data = this.data.concat(res.data)
114 console.log('视频列表===', JSON.stringify(res.data)) 123 console.log('视频列表===', JSON.stringify(res.data))
115 } 124 }
@@ -119,21 +128,21 @@ export struct DetailVideoListPage { @@ -119,21 +128,21 @@ export struct DetailVideoListPage {
119 /** 128 /**
120 * 批量查询内容当前用户点赞、收藏状态 129 * 批量查询内容当前用户点赞、收藏状态
121 */ 130 */
122 - getContentInteract() {  
123 - if (this.data.length > 0) { 131 + async getContentInteract(data: ContentDetailDTO[]) {
  132 + if (data.length > 0) {
124 const params: contentListParams = { 133 const params: contentListParams = {
125 contentList: [] 134 contentList: []
126 } 135 }
127 - this.data.map(item => { 136 + data.map(item => {
128 params.contentList.push({ 137 params.contentList.push({
129 contentId: item.newsId + '', 138 contentId: item.newsId + '',
130 contentType: item.newsType 139 contentType: item.newsType
131 }) 140 })
132 }) 141 })
133 // 批量查询内容当前用户点赞、收藏状态 142 // 批量查询内容当前用户点赞、收藏状态
134 - ContentDetailRequest.getContentInteract(params).then(res => { 143 + await ContentDetailRequest.getContentInteract(params).then(res => {
135 if (res.data) { 144 if (res.data) {
136 - this.interactDataList = res.data || [] 145 + this.interactDataList = this.interactDataList.concat(res.data)
137 } 146 }
138 console.log('获取互动点赞等数据===', JSON.stringify(res)) 147 console.log('获取互动点赞等数据===', JSON.stringify(res))
139 }) 148 })
@@ -145,7 +145,7 @@ export struct VideoChannelDetail { @@ -145,7 +145,7 @@ export struct VideoChannelDetail {
145 refreshTime: this.refreshTime, 145 refreshTime: this.refreshTime,
146 } 146 }
147 147
148 - await ContentDetailRequest.getRecCompInfo(params).then(res => { 148 + await ContentDetailRequest.getRecCompInfo(params).then(async res => {
149 this.isRequestError = false 149 this.isRequestError = false
150 console.log('根据视频频道传参查询视频楼层信息totalCount', res.data?.totalCount + '') 150 console.log('根据视频频道传参查询视频楼层信息totalCount', res.data?.totalCount + '')
151 151
@@ -174,8 +174,8 @@ export struct VideoChannelDetail { @@ -174,8 +174,8 @@ export struct VideoChannelDetail {
174 }) 174 })
175 } 175 }
176 176
177 - this.batchContentDetail(list1)  
178 - this.getContentInteract(list2) 177 + await this.batchContentDetail(list1, list2)
  178 +
179 setTimeout(() => { 179 setTimeout(() => {
180 this.isMouted = true 180 this.isMouted = true
181 }, 500) 181 }, 500)
@@ -189,11 +189,14 @@ export struct VideoChannelDetail { @@ -189,11 +189,14 @@ export struct VideoChannelDetail {
189 /** 189 /**
190 * 根据视频楼层信息批量查询视频列表 190 * 根据视频楼层信息批量查询视频列表
191 */ 191 */
192 - async batchContentDetail(list: batchContentDetailParams) { 192 + async batchContentDetail(list: batchContentDetailParams, list2: contentListParams) {
193 if (list.contents.length > 0) { 193 if (list.contents.length > 0) {
194 - await ContentDetailRequest.batchContentDetail(list).then(res => { 194 + await ContentDetailRequest.batchContentDetail(list).then(async res => {
  195 + if (res.data) {
  196 + await this.getContentInteract(list2)
  197 + this.data = this.data.concat(res.data)
  198 + }
195 console.log('根据视频楼层信息批量查询视频列表', res.data) 199 console.log('根据视频楼层信息批量查询视频列表', res.data)
196 - this.data = this.data.concat(res.data as [])  
197 }) 200 })
198 } 201 }
199 } 202 }
@@ -204,7 +207,9 @@ export struct VideoChannelDetail { @@ -204,7 +207,9 @@ export struct VideoChannelDetail {
204 async getContentInteract(list: contentListParams) { 207 async getContentInteract(list: contentListParams) {
205 if (list.contentList.length > 0) { 208 if (list.contentList.length > 0) {
206 await ContentDetailRequest.getContentInteract(list).then(res => { 209 await ContentDetailRequest.getContentInteract(list).then(res => {
207 - this.interactDataList = res.data || [] 210 + if (res.data) {
  211 + this.interactDataList = this.interactDataList.concat(res.data)
  212 + }
208 console.log('根据视频信息批量查询点赞、收藏状态', res.data) 213 console.log('根据视频信息批量查询点赞、收藏状态', res.data)
209 }) 214 })
210 } 215 }
@@ -15,7 +15,9 @@ export struct PlayerProgressView { @@ -15,7 +15,9 @@ export struct PlayerProgressView {
15 if (this.playerController) { 15 if (this.playerController) {
16 this.playerController.onStatusChange = (status: number) => { 16 this.playerController.onStatusChange = (status: number) => {
17 this.status = status 17 this.status = status
18 - console.log('=============', this.status) 18 + }
  19 + this.playerController.onSeekDone = (status: number) => {
  20 + this.playerController?.play()
19 } 21 }
20 } 22 }
21 } 23 }