zhenghy
Showing 57 changed files with 1220 additions and 727 deletions
@@ -6,41 +6,34 @@ import { SPHelper } from './SPHelper' @@ -6,41 +6,34 @@ import { SPHelper } from './SPHelper'
6 import { StringUtils } from './StringUtils' 6 import { StringUtils } from './StringUtils'
7 7
8 export class UserDataLocal { 8 export class UserDataLocal {
9 - public static userId=''  
10 - public static userType=''  
11 - public static token=''  
12 - public static userName=''  
13 -  
14 - public static userHeaderUrl=''  
15 - public static userLevel = -1  
16 - public static userLevelHeaderUrl='' 9 + private static userId=''
  10 + private static userType=''
  11 + private static userName=''
  12 + private static userHeaderUrl=''
  13 + private static userLevel = -1
  14 + private static userLevelHeaderUrl=''
17 15
18 //先写死 16 //先写死
19 static USER_ID="userId" 17 static USER_ID="userId"
20 static USER_Type="userType" 18 static USER_Type="userType"
21 - static USER_JWT_TOKEN="jwtToken"  
22 static USER_NAME="userName" 19 static USER_NAME="userName"
23 -  
24 static USER_HEADER_URL="userHeaderUrl" 20 static USER_HEADER_URL="userHeaderUrl"
25 static USER_LEVEL="userLevel" 21 static USER_LEVEL="userLevel"
26 static USER_LEVEL_HEADER_URL="userLevelHeaderUrl" 22 static USER_LEVEL_HEADER_URL="userLevelHeaderUrl"
27 - static USER_FOLLOW_OPERATION="user_follow_operation"  
28 -  
29 - //刷新token 用到  
30 - static USER_REFRESH_TOKEN="refreshToken"  
31 23
  24 + static USER_FOLLOW_OPERATION="user_follow_operation"
32 25
33 /** 26 /**
34 * 清除 本地用户数据 27 * 清除 本地用户数据
35 */ 28 */
36 public static clearUserData(){ 29 public static clearUserData(){
37 - SPHelper.default.deleteSync(UserDataLocal.USER_ID)  
38 - SPHelper.default.deleteSync(UserDataLocal.USER_Type)  
39 - SPHelper.default.deleteSync(UserDataLocal.USER_JWT_TOKEN) //待确认  
40 - SPHelper.default.deleteSync(UserDataLocal.USER_NAME)  
41 - SPHelper.default.deleteSync(UserDataLocal.USER_HEADER_URL)  
42 - SPHelper.default.deleteSync(UserDataLocal.USER_LEVEL)  
43 - SPHelper.default.deleteSync(UserDataLocal.USER_LEVEL_HEADER_URL) 30 + UserDataLocal.userId=''
  31 + UserDataLocal.userType=''
  32 + UserDataLocal.userName=''
  33 +
  34 + UserDataLocal.userHeaderUrl=''
  35 + UserDataLocal.userLevel = -1
  36 + UserDataLocal.userLevelHeaderUrl=''
44 } 37 }
45 38
46 public static getUserId() { 39 public static getUserId() {
@@ -59,17 +52,6 @@ export class UserDataLocal { @@ -59,17 +52,6 @@ export class UserDataLocal {
59 return UserDataLocal.userType; 52 return UserDataLocal.userType;
60 } 53 }
61 54
62 - private static getXToken() {  
63 - if(StringUtils.isNotEmpty(UserDataLocal.token)){  
64 - return UserDataLocal.token  
65 - }  
66 - UserDataLocal.token = SPHelper.default.getSync(UserDataLocal.USER_JWT_TOKEN,"") as string  
67 - if(StringUtils.isNotEmpty(UserDataLocal.token)) {  
68 - return UserDataLocal.token  
69 - }  
70 - return 'eyJhbGciOiJIUzI1NiIsImtpZCI6ImQ4WkI2QkhxSEZrdjJ2U25BNlRwZEdKRjBHcjItVzBvS2FaYzdLOUUycmcifQ.eyJpc3MiOiJwZW9wbGVzLWRhaWx5LWZvdXJhIiwic3ViIjoicGVvcGxlcy1kYWlseS1mb3VyYSIsImV4cCI6MTcwMzY0OTYwNiwidXNlcklkIjo0NTk3NzYyOTc0NzQ5NDksInVzZXJWZXJzaW9uIjoiNDU5Nzc2Mjk3NDc0OTQ5XzIiLCJ1c2VyTmFtZSI6IkJ1bGlraWtpMTgxIiwidXNlclR5cGUiOjIsImNyZWF0b3JJZCI6NDI2NTM5MH0.jhQ9kylcm3FxWf0-lBMZuLkdtIQ6XpFnAi0AFZJNwfc';  
71 - }  
72 -  
73 public static getUserName() { 55 public static getUserName() {
74 if(StringUtils.isNotEmpty(UserDataLocal.userName)){ 56 if(StringUtils.isNotEmpty(UserDataLocal.userName)){
75 return UserDataLocal.userName 57 return UserDataLocal.userName
@@ -118,4 +100,5 @@ export class UserDataLocal { @@ -118,4 +100,5 @@ export class UserDataLocal {
118 public static setUserLevelHeaderUrl(url:string) { 100 public static setUserLevelHeaderUrl(url:string) {
119 SPHelper.default.save(UserDataLocal.USER_LEVEL_HEADER_URL, url) 101 SPHelper.default.save(UserDataLocal.USER_LEVEL_HEADER_URL, url)
120 } 102 }
  103 +
121 } 104 }
@@ -8,3 +8,5 @@ export { HttpUrlUtils } from "./src/main/ets/http/HttpUrlUtils" @@ -8,3 +8,5 @@ export { HttpUrlUtils } from "./src/main/ets/http/HttpUrlUtils"
8 8
9 export { HttpBizUtil } from "./src/main/ets/http/HttpBizUtil" 9 export { HttpBizUtil } from "./src/main/ets/http/HttpBizUtil"
10 10
  11 +export { HostEnum, HostManager } from "./src/main/ets/http/HttpHostManager"
  12 +
  1 +import { SpConstants } from 'wdConstant';
  2 +import { SPHelper, StringUtils } from 'wdKit';
  3 +import { HostEnum, HostManager } from './HttpHostManager';
  4 +
  5 +/**
  6 + * 网络请求参数工具类
  7 + */
  8 +export class HttpParams {
  9 + private static userId = ''
  10 + private static userType = ''
  11 + private static token = ''
  12 +
  13 + static buildHeaders(): Record<string, string> {
  14 + let headers: Record<string, string> = {};
  15 + // 通用请求头
  16 + headers['User-Agent'] = 'Dalvik/2.1.0 (Linux; U; Android 13; 22101317C Build/TKQ1.221013.002)'
  17 + headers['channel'] = HttpParams.getChannel()
  18 + headers['plat'] = HttpParams.getPlat()
  19 + headers['Content-Type'] = 'application/json; charset=utf-8'
  20 + headers['timestamp'] = HttpParams.getTimestamp()
  21 + headers['RMRB-X-TOKEN'] = HttpParams.getXToken()
  22 + headers['device_id'] = HttpParams.getDeviceId()
  23 + if (HttpParams.getXToken() != '') {
  24 + headers['cookie'] = 'RMRB-X-TOKEN=' + HttpParams.getXToken()
  25 + }
  26 + headers['build_version'] = HttpParams.getVersion()
  27 + headers['adcode'] = HttpParams.getAdCode()
  28 + headers['os_version'] = HttpParams.getOsVersion()
  29 + headers['versionCode'] = HttpParams.getVersionCode()
  30 + headers['system'] = HttpParams.getTerminalId()
  31 + headers['version_name'] = HttpParams.getVersionName()
  32 + headers['EagleEye-TraceID'] = 'D539562E48554A60977AF4BECB6D6C7A'
  33 + headers['imei'] = HttpParams.getImei()
  34 + headers['Accept-Language'] = 'zh'
  35 + HttpParams.setLocationHeader(headers)
  36 + // // TODO 判断是否登录
  37 + headers['userId'] = HttpParams.getUserId()
  38 + headers['userType'] = HttpParams.getUserType()
  39 + //
  40 + headers['mpassid'] = 'ZbHTMeTsfaYDAHqt8ZHIzcPs'
  41 + HttpParams.addSpecialHeaders(headers);
  42 + return headers;
  43 + }
  44 +
  45 + static addSpecialHeaders(headers: Record<string, string>) {
  46 + switch (HostManager.getHost()) {
  47 + case HostEnum.HOST_UAT:
  48 + headers['X-Ca-Stage'] = 'PRE'
  49 + headers['Authorization'] = 'APPCODE 83092caa603a421aa0222308b3f6b27a'
  50 + headers['appCode'] = '83092caa603a421aa0222308b3f6b27a'
  51 + break
  52 + case HostEnum.HOST_SIT:
  53 + headers['X-Ca-Stage'] = 'TEST'
  54 + headers['Authorization'] = 'APPCODE 0af1f9085e484c97b2a44704bae72c07'
  55 + headers['appCode'] = '0af1f9085e484c97b2a44704bae72c07'
  56 + break
  57 + case HostEnum.HOST_PRODUCT:
  58 + headers['X-Ca-Stage'] = 'RELEASE'
  59 + headers['Authorization'] = 'APPCODE 3d4181bceeb94d9780e10dbb6c67bbf6'
  60 + headers['appCode'] = '3d4181bceeb94d9780e10dbb6c67bbf6'
  61 + break
  62 + case HostEnum.HOST_DEV:
  63 + headers['X-Ca-Stage'] = 'TEST'
  64 + headers['Authorization'] = 'APPCODE ff33172859e14f9a8299e3bd769e79f9'
  65 + headers['appCode'] = 'ff33172859e14f9a8299e3bd769e79f9'
  66 + break
  67 + default:
  68 + break
  69 + }
  70 + }
  71 +
  72 + static setLocationHeader(headers: Record<string, string>) {
  73 + let cityName = SPHelper.default.getSync(SpConstants.LOCATION_CITY_NAME, '') as string
  74 + if (StringUtils.isNotEmpty(cityName)) {
  75 + headers['city'] = encodeURI(cityName)
  76 + }
  77 + let cityCode = SPHelper.default.getSync(SpConstants.LOCATION_CITY_CODE, '') as string
  78 + if (StringUtils.isNotEmpty(cityCode)) {
  79 + headers['city_dode'] = encodeURI(cityCode)
  80 + }
  81 + }
  82 +
  83 + private static getCity() {
  84 + // TODO 对接定位
  85 + return '%E5%90%88%E8%82%A5%E5%B8%82';
  86 + }
  87 +
  88 + private static getChannel() {
  89 + // TODO 对接配置
  90 + return 'rmrb_china_0000';
  91 + }
  92 +
  93 + private static getPlat() {
  94 + return 'Phone';
  95 + }
  96 +
  97 + private static getTimestamp() {
  98 + // return DateTimeUtils.getCurrentTime() + '';
  99 + // TODO 暂时写死,有些page 真实时间戳 返回数据为空
  100 + return '155203523';
  101 + }
  102 +
  103 + private static getXToken() {
  104 + if (StringUtils.isNotEmpty(HttpParams.token)) {
  105 + return HttpParams.token
  106 + }
  107 + HttpParams.token = SPHelper.default.getSync(SpConstants.USER_JWT_TOKEN, "") as string
  108 + if (StringUtils.isNotEmpty(HttpParams.token)) {
  109 + return HttpParams.token
  110 + }
  111 + // return 'eyJhbGciOiJIUzI1NiIsImtpZCI6ImQ4WkI2QkhxSEZrdjJ2U25BNlRwZEdKRjBHcjItVzBvS2FaYzdLOUUycmcifQ.eyJpc3MiOiJwZW9wbGVzLWRhaWx5LWZvdXJhIiwic3ViIjoicGVvcGxlcy1kYWlseS1mb3VyYSIsImV4cCI6MTcwMzY0OTYwNiwidXNlcklkIjo0NTk3NzYyOTc0NzQ5NDksInVzZXJWZXJzaW9uIjoiNDU5Nzc2Mjk3NDc0OTQ5XzIiLCJ1c2VyTmFtZSI6IkJ1bGlraWtpMTgxIiwidXNlclR5cGUiOjIsImNyZWF0b3JJZCI6NDI2NTM5MH0.jhQ9kylcm3FxWf0-lBMZuLkdtIQ6XpFnAi0AFZJNwfc';
  112 + return ''
  113 + }
  114 +
  115 + static getRefreshToken(): string {
  116 + let refreshToken = SPHelper.default.getSync(SpConstants.USER_REFRESH_TOKEN, "")
  117 + if (StringUtils.isNotEmpty(refreshToken)) {
  118 + return refreshToken as string;
  119 + }
  120 + return '';
  121 + }
  122 +
  123 + public static getDeviceId() {
  124 + // TODO
  125 + return '8a81226a-cabd-3e1b-b630-b51db4a720ed';
  126 + }
  127 +
  128 + private static getVersion() {
  129 + // TODO
  130 + return '202401242103';
  131 + }
  132 +
  133 + private static getVersionCode() {
  134 + // TODO
  135 + return '7301';
  136 + }
  137 +
  138 + private static getVersionName() {
  139 + // TODO
  140 + return '7.3.0.1';
  141 + }
  142 +
  143 + private static getAdCode() {
  144 + return '340000';
  145 + }
  146 +
  147 + private static getOsVersion() {
  148 + // TODO
  149 + return '12';
  150 + }
  151 +
  152 + public static getCityCode() {
  153 + // TODO
  154 + return '340100';
  155 + }
  156 +
  157 + public static getProvinceCode() {
  158 + // TODO
  159 + return '340000';
  160 + }
  161 +
  162 + /**
  163 + * 地区code
  164 + */
  165 + public static getDistrictCode() {
  166 + // TODO
  167 + return '340103';
  168 + }
  169 +
  170 + private static getTerminalId() {
  171 + return 'Android';
  172 + }
  173 +
  174 + public static getImei() {
  175 + // TODO
  176 + return '8a81226a-cabd-3e1b-b630-b51db4a720ed';
  177 + }
  178 +
  179 + public static getUserId(): string {
  180 + // TODO 对接登录
  181 + if (StringUtils.isNotEmpty(HttpParams.userId)) {
  182 + return HttpParams.userId
  183 + }
  184 + HttpParams.userId = SPHelper.default.getSync(SpConstants.USER_ID, "") as string
  185 + return HttpParams.userId;
  186 + }
  187 +
  188 + public static getUserType() {
  189 + if (StringUtils.isNotEmpty(HttpParams.userType)) {
  190 + return HttpParams.userType
  191 + }
  192 + HttpParams.userType = SPHelper.default.getSync(SpConstants.USER_Type, "") as string
  193 + return HttpParams.userType;
  194 + }
  195 +
  196 + public static setUserId(userId: string) {
  197 + HttpParams.userId = userId;
  198 + }
  199 +
  200 + public static setUserType(userType: string) {
  201 + HttpParams.userType = userType;
  202 + }
  203 +
  204 + public static setUserToken(token: string) {
  205 + HttpParams.token = token;
  206 + }
  207 +}
  1 +export enum HostEnum {
  2 + /**
  3 + * uat环境url
  4 + */
  5 + HOST_UAT = 'https://pd-apis-uat.pdnews.cn',
  6 + /**
  7 + * 中文端sit环境
  8 + */
  9 + HOST_SIT = 'https://pd-apis-sit.pdnews.cn',
  10 + /**
  11 + * dev环境url
  12 + */
  13 + HOST_DEV = 'https://pd-apis-dev.pdnews.cn',
  14 + /**
  15 + * 正式环境url
  16 + */
  17 + HOST_PRODUCT = 'https://pdapis.pdnews.cn',
  18 +}
  19 +
  20 +/**
  21 + * 环境host管理工具类
  22 + */
  23 +export class HostManager {
  24 + private static _hostUrl: HostEnum = HostEnum.HOST_PRODUCT;
  25 +
  26 + static changeHost(host: HostEnum) {
  27 + HostManager._hostUrl = host;
  28 + }
  29 +
  30 + static getHost(): string {
  31 + return HostManager._hostUrl;
  32 + }
  33 +}
1 import ArrayList from '@ohos.util.ArrayList'; 1 import ArrayList from '@ohos.util.ArrayList';
2 import service from './AxiosRequest'; 2 import service from './AxiosRequest';
3 -import { HttpUtils } from '../utils/HttpUtils';  
4 import { AxiosError, AxiosHeaders, AxiosRequestConfig, RawAxiosRequestHeaders } from '@ohos/axios'; 3 import { AxiosError, AxiosHeaders, AxiosRequestConfig, RawAxiosRequestHeaders } from '@ohos/axios';
5 import { ResponseDTO } from '../bean/ResponseDTO'; 4 import { ResponseDTO } from '../bean/ResponseDTO';
6 import HashMap from '@ohos.util.HashMap'; 5 import HashMap from '@ohos.util.HashMap';
  6 +import { HttpParams } from './HttpCommonParams';
7 7
8 export class HttpRequest { 8 export class HttpRequest {
9 private static globalHeaderProviders: ArrayList<() => Record<string, string>> = new ArrayList(); 9 private static globalHeaderProviders: ArrayList<() => Record<string, string>> = new ArrayList();
@@ -14,7 +14,7 @@ export class HttpRequest { @@ -14,7 +14,7 @@ export class HttpRequest {
14 14
15 static initHttpHeader() { 15 static initHttpHeader() {
16 HttpRequest.addGlobalHeaderProvider(() => { 16 HttpRequest.addGlobalHeaderProvider(() => {
17 - return HttpUtils.buildHeaders(); 17 + return HttpParams.buildHeaders();
18 }) 18 })
19 } 19 }
20 20
@@ -34,15 +34,17 @@ export class HttpRequest { @@ -34,15 +34,17 @@ export class HttpRequest {
34 34
35 static buildHeaderWithGlobalHeader(headers?: HashMap<string, string>): AxiosHeaders { 35 static buildHeaderWithGlobalHeader(headers?: HashMap<string, string>): AxiosHeaders {
36 let commonHeader: AxiosHeaders = new AxiosHeaders() 36 let commonHeader: AxiosHeaders = new AxiosHeaders()
37 - headers?.forEach((v, k) => {  
38 - commonHeader.set(k, v);  
39 - }); 37 +
40 HttpRequest.globalHeaderProviders.forEach((func) => { 38 HttpRequest.globalHeaderProviders.forEach((func) => {
41 let headers = func(); 39 let headers = func();
42 for (const obj of Object.entries(headers)) { 40 for (const obj of Object.entries(headers)) {
43 commonHeader.set(obj[0], obj[1]); 41 commonHeader.set(obj[0], obj[1]);
44 } 42 }
45 }) 43 })
  44 + // 业务headers,覆盖common(如果有冲突的话,取业务)
  45 + headers?.forEach((v, k) => {
  46 + commonHeader.set(k, v);
  47 + });
46 if (!commonHeader.get('Content-Type')) { 48 if (!commonHeader.get('Content-Type')) {
47 commonHeader.set('Content-Type', 'application/json;charset=utf-8'); 49 commonHeader.set('Content-Type', 'application/json;charset=utf-8');
48 } 50 }
@@ -56,24 +58,13 @@ export class HttpRequest { @@ -56,24 +58,13 @@ export class HttpRequest {
56 return service.get(url, config) 58 return service.get(url, config)
57 } 59 }
58 60
59 - static post0<T = ResponseDTO<string>>(url: string, data?: object, headers?: HashMap<string, string>): Promise<T> { 61 + static post<T = ResponseDTO<string>>(url: string, data?: object, headers?: HashMap<string, string>): Promise<T> {
60 let config: AxiosRequestConfig = { 62 let config: AxiosRequestConfig = {
61 headers: HttpRequest.buildHeaderWithGlobalHeader(headers) 63 headers: HttpRequest.buildHeaderWithGlobalHeader(headers)
62 } 64 }
63 return service.post(url, data, config) 65 return service.post(url, data, config)
64 } 66 }
65 67
66 - static post<T = object>(url: string, data1?: object, headers?: HashMap<string, string>): Promise<T> {  
67 - let requestHeaders: AxiosHeaders = new AxiosHeaders()  
68 - headers?.forEach((v, k) => {  
69 - requestHeaders.set(k, v);  
70 - });  
71 - let config: AxiosRequestConfig = {  
72 - headers: requestHeaders as RawAxiosRequestHeaders,  
73 - }  
74 - return service.post(url, data1, config)  
75 - }  
76 -  
77 static put<T = ResponseDTO<string>>(url: string, data?: object, headers?: HashMap<string, string>): Promise<T> { 68 static put<T = ResponseDTO<string>>(url: string, data?: object, headers?: HashMap<string, string>): Promise<T> {
78 let config: AxiosRequestConfig = { 69 let config: AxiosRequestConfig = {
79 headers: HttpRequest.buildHeaderWithGlobalHeader(headers) 70 headers: HttpRequest.buildHeaderWithGlobalHeader(headers)
1 import HashMap from '@ohos.util.HashMap'; 1 import HashMap from '@ohos.util.HashMap';
2 import { SpConstants } from 'wdConstant'; 2 import { SpConstants } from 'wdConstant';
3 import { SPHelper, StringUtils } from 'wdKit'; 3 import { SPHelper, StringUtils } from 'wdKit';
  4 +import { HostEnum, HostManager } from './HttpHostManager';
4 5
5 /** 6 /**
6 * 网络请求业务侧工具类 7 * 网络请求业务侧工具类
7 */ 8 */
8 export class HttpUrlUtils { 9 export class HttpUrlUtils {
9 /** 10 /**
10 - * uat环境url  
11 - */  
12 - static readonly HOST_UAT: string = "https://pd-apis-uat.pdnews.cn";  
13 - /**  
14 - * 中文端sit环境  
15 - */  
16 - static readonly HOST_SIT: string = "https://pd-apis-sit.pdnews.cn";  
17 - /**  
18 - * 正式环境url  
19 - */  
20 - static readonly HOST_PRODUCT: string = "https://pdapis.pdnews.cn";  
21 - /**  
22 - * dev环境url  
23 - */  
24 - static readonly HOST_DEV: string = "https://pd-apis-dev.pdnews.cn";  
25 - /**  
26 * 启动接口(底导接口) 11 * 启动接口(底导接口)
27 */ 12 */
28 static readonly BOTTOM_NAV_PATH: string = "/api/rmrb-bff-display-zh/display/zh/c/bottomNavGroup"; 13 static readonly BOTTOM_NAV_PATH: string = "/api/rmrb-bff-display-zh/display/zh/c/bottomNavGroup";
@@ -293,21 +278,14 @@ export class HttpUrlUtils { @@ -293,21 +278,14 @@ export class HttpUrlUtils {
293 * 获取启动页相关数据 278 * 获取启动页相关数据
294 */ 279 */
295 static readonly LAUNCH_PAGE_PATH: string = "/api/rmrb-bff-display-zh/display/zh/c/launchPage"; 280 static readonly LAUNCH_PAGE_PATH: string = "/api/rmrb-bff-display-zh/display/zh/c/launchPage";
296 - private static _hostUrl: string = HttpUrlUtils.HOST_PRODUCT;  
297 /** 281 /**
298 * 推荐列表 282 * 推荐列表
299 */ 283 */
300 static readonly RECOMMEND_LIST: string = "/api/rmrb-bff-display-zh/recommend/zh/c/list"; 284 static readonly RECOMMEND_LIST: string = "/api/rmrb-bff-display-zh/recommend/zh/c/list";
301 -  
302 /** 285 /**
303 * 搜索推荐 286 * 搜索推荐
304 */ 287 */
305 static readonly SEARCH_SUGGEST_DATA_PATH: string = "/api/rmrb-bff-display-zh/recommend/zh/c/list"; 288 static readonly SEARCH_SUGGEST_DATA_PATH: string = "/api/rmrb-bff-display-zh/recommend/zh/c/list";
306 -  
307 - public static set hostUrl(value: string) {  
308 - HttpUrlUtils._hostUrl = value;  
309 - }  
310 -  
311 private static userId = '' 289 private static userId = ''
312 private static userType = '' 290 private static userType = ''
313 private static token = '' 291 private static token = ''
@@ -354,24 +332,24 @@ export class HttpUrlUtils { @@ -354,24 +332,24 @@ export class HttpUrlUtils {
354 } 332 }
355 333
356 static addSpecialHeaders(headers: HashMap<string, string>) { 334 static addSpecialHeaders(headers: HashMap<string, string>) {
357 - switch (HttpUrlUtils._hostUrl) {  
358 - case HttpUrlUtils.HOST_UAT: 335 + switch (HostManager.getHost()) {
  336 + case HostEnum.HOST_UAT:
359 // TODO 待优化到常量类里 337 // TODO 待优化到常量类里
360 headers.set('X-Ca-Stage', 'PRE'); 338 headers.set('X-Ca-Stage', 'PRE');
361 headers.set('Authorization', 'APPCODE 83092caa603a421aa0222308b3f6b27a'); 339 headers.set('Authorization', 'APPCODE 83092caa603a421aa0222308b3f6b27a');
362 headers.set('appCode', '83092caa603a421aa0222308b3f6b27a'); 340 headers.set('appCode', '83092caa603a421aa0222308b3f6b27a');
363 break 341 break
364 - case HttpUrlUtils.HOST_SIT: 342 + case HostEnum.HOST_SIT:
365 headers.set('X-Ca-Stage', 'TEST'); 343 headers.set('X-Ca-Stage', 'TEST');
366 headers.set('Authorization', 'APPCODE 0af1f9085e484c97b2a44704bae72c07'); 344 headers.set('Authorization', 'APPCODE 0af1f9085e484c97b2a44704bae72c07');
367 headers.set('appCode', '0af1f9085e484c97b2a44704bae72c07'); 345 headers.set('appCode', '0af1f9085e484c97b2a44704bae72c07');
368 break 346 break
369 - case HttpUrlUtils.HOST_PRODUCT: 347 + case HostEnum.HOST_PRODUCT:
370 headers.set('X-Ca-Stage', 'RELEASE'); 348 headers.set('X-Ca-Stage', 'RELEASE');
371 headers.set('Authorization', 'APPCODE 3d4181bceeb94d9780e10dbb6c67bbf6'); 349 headers.set('Authorization', 'APPCODE 3d4181bceeb94d9780e10dbb6c67bbf6');
372 headers.set('appCode', '3d4181bceeb94d9780e10dbb6c67bbf6'); 350 headers.set('appCode', '3d4181bceeb94d9780e10dbb6c67bbf6');
373 break 351 break
374 - case HttpUrlUtils.HOST_DEV: 352 + case HostEnum.HOST_DEV:
375 headers.set('X-Ca-Stage', 'TEST'); 353 headers.set('X-Ca-Stage', 'TEST');
376 headers.set('Authorization', 'APPCODE ff33172859e14f9a8299e3bd769e79f9'); 354 headers.set('Authorization', 'APPCODE ff33172859e14f9a8299e3bd769e79f9');
377 headers.set('appCode', 'ff33172859e14f9a8299e3bd769e79f9'); 355 headers.set('appCode', 'ff33172859e14f9a8299e3bd769e79f9');
@@ -392,8 +370,8 @@ export class HttpUrlUtils { @@ -392,8 +370,8 @@ export class HttpUrlUtils {
392 } 370 }
393 } 371 }
394 372
395 - static getHost() {  
396 - return HttpUrlUtils._hostUrl; 373 + static getHost(): string {
  374 + return HostManager.getHost();
397 } 375 }
398 376
399 private static getCity() { 377 private static getCity() {
@@ -510,48 +488,48 @@ export class HttpUrlUtils { @@ -510,48 +488,48 @@ export class HttpUrlUtils {
510 } 488 }
511 489
512 static getVerifyCodeUrl() { 490 static getVerifyCodeUrl() {
513 - let url = HttpUrlUtils._hostUrl + "/api/rmrb-user-center/auth/zh/c/sendVerifyCode"; 491 + let url = HttpUrlUtils.getHost() + "/api/rmrb-user-center/auth/zh/c/sendVerifyCode";
514 return url; 492 return url;
515 } 493 }
516 494
517 static getVerifyCodeByTokenUrl() { 495 static getVerifyCodeByTokenUrl() {
518 - let url = HttpUrlUtils._hostUrl + "/api/rmrb-user-center/user/zh/c/sendVerifyCodeByToken"; 496 + let url = HttpUrlUtils.getHost() + "/api/rmrb-user-center/user/zh/c/sendVerifyCodeByToken";
519 return url; 497 return url;
520 } 498 }
521 499
522 static getCheckVerifyCodeByToken() { 500 static getCheckVerifyCodeByToken() {
523 - let url = HttpUrlUtils._hostUrl + "/api/rmrb-user-center/user/zh/c/checkVerifyCodeByToken"; 501 + let url = HttpUrlUtils.getHost() + "/api/rmrb-user-center/user/zh/c/checkVerifyCodeByToken";
524 return url; 502 return url;
525 } 503 }
526 504
527 505
528 static getForgetPasswordUrl() { 506 static getForgetPasswordUrl() {
529 - let url = HttpUrlUtils._hostUrl + "/api/rmrb-user-center/user/zh/c/forgotPassword"; 507 + let url = HttpUrlUtils.getHost() + "/api/rmrb-user-center/user/zh/c/forgotPassword";
530 return url; 508 return url;
531 } 509 }
532 510
533 static getLogoutUrl() { 511 static getLogoutUrl() {
534 - let url = HttpUrlUtils._hostUrl + "/api/rmrb-user-center/user/zh/c/appLogout"; 512 + let url = HttpUrlUtils.getHost() + "/api/rmrb-user-center/user/zh/c/appLogout";
535 return url; 513 return url;
536 } 514 }
537 515
538 static getRefreshTokenUrl() { 516 static getRefreshTokenUrl() {
539 - let url = HttpUrlUtils._hostUrl + HttpUrlUtils.REFRESH_TOKEN_PATH; 517 + let url = HttpUrlUtils.getHost() + HttpUrlUtils.REFRESH_TOKEN_PATH;
540 return url; 518 return url;
541 } 519 }
542 520
543 static getResetPassworddUrl() { 521 static getResetPassworddUrl() {
544 - let url = HttpUrlUtils._hostUrl + "/api/rmrb-user-center/user/zh/c/resetPassword"; 522 + let url = HttpUrlUtils.getHost() + "/api/rmrb-user-center/user/zh/c/resetPassword";
545 return url; 523 return url;
546 } 524 }
547 525
548 static queryUserDetail() { 526 static queryUserDetail() {
549 - let url = HttpUrlUtils._hostUrl + "/api/rmrb-user-center/user/zh/c/queryUserDetail"; 527 + let url = HttpUrlUtils.getHost() + "/api/rmrb-user-center/user/zh/c/queryUserDetail";
550 return url; 528 return url;
551 } 529 }
552 530
553 static editUserDetail() { 531 static editUserDetail() {
554 - let url = HttpUrlUtils._hostUrl + "/api/rmrb-user-center/user/zh/c/editUserDetail"; 532 + let url = HttpUrlUtils.getHost() + "/api/rmrb-user-center/user/zh/c/editUserDetail";
555 return url; 533 return url;
556 } 534 }
557 535
@@ -561,308 +539,315 @@ export class HttpUrlUtils { @@ -561,308 +539,315 @@ export class HttpUrlUtils {
561 } 539 }
562 540
563 static getCheckVerifyCodeUrl() { 541 static getCheckVerifyCodeUrl() {
564 - let url = HttpUrlUtils._hostUrl + "/api/rmrb-user-center/auth/zh/c/checkVerifyCode"; 542 + let url = HttpUrlUtils.getHost() + "/api/rmrb-user-center/auth/zh/c/checkVerifyCode";
565 return url; 543 return url;
566 } 544 }
567 545
568 static getAgreement() { 546 static getAgreement() {
569 - let url = HttpUrlUtils._hostUrl + "/api/rmrb-bff-display-zh/display/zh/c/agreement"; 547 + let url = HttpUrlUtils.getHost() + "/api/rmrb-bff-display-zh/display/zh/c/agreement";
570 return url; 548 return url;
571 } 549 }
572 550
573 static getCheckVerifyByTokenCodeUrl() { 551 static getCheckVerifyByTokenCodeUrl() {
574 - let url = HttpUrlUtils._hostUrl + "/api/rmrb-user-center/auth/zh/c/checkVerifyCodeByToken"; 552 + let url = HttpUrlUtils.getHost() + "/api/rmrb-user-center/auth/zh/c/checkVerifyCodeByToken";
575 return url; 553 return url;
576 } 554 }
577 555
578 556
579 /*优质评论页*/ 557 /*优质评论页*/
580 static getQualityCommentUrl() { 558 static getQualityCommentUrl() {
581 - let url = HttpUrlUtils._hostUrl + "/api/rmrb-comment/comment/zh/c/highQuality"; 559 + let url = HttpUrlUtils.getHost() + "/api/rmrb-comment/comment/zh/c/highQuality";
582 560
583 return url 561 return url
584 } 562 }
585 563
586 /*获取详情页评论列表*/ 564 /*获取详情页评论列表*/
587 static getContentCommentListDataUrl() { 565 static getContentCommentListDataUrl() {
588 - let url = HttpUrlUtils._hostUrl + "/api/rmrb-comment/comment/zh/c/contentCommentList" 566 + let url = HttpUrlUtils.getHost() + "/api/rmrb-comment/comment/zh/c/contentCommentList"
589 return url 567 return url
590 } 568 }
591 569
592 /*获取子评论列表*/ 570 /*获取子评论列表*/
593 static getChildContentCommentListDataUrl() { 571 static getChildContentCommentListDataUrl() {
594 - let url = HttpUrlUtils._hostUrl + "/api/rmrb-comment/comment/zh/c/childCommentList" 572 + let url = HttpUrlUtils.getHost() + "/api/rmrb-comment/comment/zh/c/childCommentList"
595 return url 573 return url
596 } 574 }
597 575
598 /*评论状态*/ 576 /*评论状态*/
599 static getBatchCommentStatusUrl() { 577 static getBatchCommentStatusUrl() {
600 - let url = HttpUrlUtils._hostUrl + "/api/rmrb-comment/comment/zh/c/batchCommentStatus" 578 + let url = HttpUrlUtils.getHost() + "/api/rmrb-comment/comment/zh/c/batchCommentStatus"
601 return url 579 return url
602 } 580 }
603 581
604 /*评论点赞*/ 582 /*评论点赞*/
605 static getCommentLikeUrl() { 583 static getCommentLikeUrl() {
606 - let url = HttpUrlUtils._hostUrl + "/api/rmrb-comment/comment/zh/c/commentLike" 584 + let url = HttpUrlUtils.getHost() + "/api/rmrb-comment/comment/zh/c/commentLike"
607 return url 585 return url
608 } 586 }
609 587
610 /*发布评论*/ 588 /*发布评论*/
611 static getPublishCommentUrl() { 589 static getPublishCommentUrl() {
612 - let url = HttpUrlUtils._hostUrl + "/api/rmrb-comment/comment/zh/c/publish" 590 + let url = HttpUrlUtils.getHost() + "/api/rmrb-comment/comment/zh/c/publish"
613 return url 591 return url
614 } 592 }
615 593
616 /*游客发布评论*/ 594 /*游客发布评论*/
617 static getNoUserPublishCommentUrl() { 595 static getNoUserPublishCommentUrl() {
618 - let url = HttpUrlUtils._hostUrl + "/api/rmrb-comment/comment/zh/c/commentLike" 596 + let url = HttpUrlUtils.getHost() + "/api/rmrb-comment/comment/zh/c/commentLike"
619 return url 597 return url
620 } 598 }
621 599
622 /*levleIcon*/ 600 /*levleIcon*/
623 static getBatchUserUrl() { 601 static getBatchUserUrl() {
624 - let url = HttpUrlUtils._hostUrl + "/api/rmrb-user-point/auth/level/zh/c/batchUser" 602 + let url = HttpUrlUtils.getHost() + "/api/rmrb-user-point/auth/level/zh/c/batchUser"
625 return url 603 return url
626 } 604 }
627 605
628 /*authIcon 20个一次上限*/ 606 /*authIcon 20个一次上限*/
629 static getDetailListUrl() { 607 static getDetailListUrl() {
630 - let url = HttpUrlUtils._hostUrl + "/api/rmrb-contact/contact/zh/c/master/detailList" 608 + let url = HttpUrlUtils.getHost() + "/api/rmrb-contact/contact/zh/c/master/detailList"
631 return url 609 return url
632 } 610 }
633 611
634 612
635 //账户注销 613 //账户注销
636 static accountLogoutUrl() { 614 static accountLogoutUrl() {
637 - let url = HttpUrlUtils._hostUrl + "/api/rmrb-user-center/user/zh/c/logoff"; 615 + let url = HttpUrlUtils.getHost() + "/api/rmrb-user-center/user/zh/c/logoff";
638 return url; 616 return url;
639 } 617 }
640 618
641 //更换手机号绑定 619 //更换手机号绑定
642 static changeBindPhone() { 620 static changeBindPhone() {
643 - let url = HttpUrlUtils._hostUrl + "/api/rmrb-user-center/user/zh/c/userPhoneChange"; 621 + let url = HttpUrlUtils.getHost() + "/api/rmrb-user-center/user/zh/c/userPhoneChange";
644 return url; 622 return url;
645 } 623 }
646 624
647 //获取用户安全页信息 625 //获取用户安全页信息
648 static querySecurity() { 626 static querySecurity() {
649 - let url = HttpUrlUtils._hostUrl + "/api/rmrb-user-center/user/zh/c/security/query"; 627 + let url = HttpUrlUtils.getHost() + "/api/rmrb-user-center/user/zh/c/security/query";
650 return url; 628 return url;
651 } 629 }
652 630
653 static getAppointmentListDataUrl() { 631 static getAppointmentListDataUrl() {
654 - let url = HttpUrlUtils._hostUrl + HttpUrlUtils.APPOINTMENT_LIST_DATA_PATH 632 + let url = HttpUrlUtils.getHost() + HttpUrlUtils.APPOINTMENT_LIST_DATA_PATH
655 return url 633 return url
656 } 634 }
657 635
658 static getMyCollectionListDataUrl() { 636 static getMyCollectionListDataUrl() {
659 - let url = HttpUrlUtils._hostUrl + HttpUrlUtils.APPOINTMENT_MyCollectionList_PATH 637 + let url = HttpUrlUtils.getHost() + HttpUrlUtils.APPOINTMENT_MyCollectionList_PATH
660 return url 638 return url
661 } 639 }
662 640
663 static getExecuteCollcetUrl() { 641 static getExecuteCollcetUrl() {
664 - let url = HttpUrlUtils._hostUrl + HttpUrlUtils.APPOINTMENT_ExecuteCollcet_PATH 642 + let url = HttpUrlUtils.getHost() + HttpUrlUtils.APPOINTMENT_ExecuteCollcet_PATH
665 return url 643 return url
666 } 644 }
667 645
668 static getFollowListDetailDataUrl() { 646 static getFollowListDetailDataUrl() {
669 - let url = HttpUrlUtils._hostUrl + HttpUrlUtils.FOLLOW_LIST_DETAIL_DATA_PATH 647 + let url = HttpUrlUtils.getHost() + HttpUrlUtils.FOLLOW_LIST_DETAIL_DATA_PATH
670 return url 648 return url
671 } 649 }
672 650
673 static getFollowListDataUrl() { 651 static getFollowListDataUrl() {
674 - let url = HttpUrlUtils._hostUrl + HttpUrlUtils.FOLLOW_LIST_DATA_PATH 652 + let url = HttpUrlUtils.getHost() + HttpUrlUtils.FOLLOW_LIST_DATA_PATH
675 return url 653 return url
676 } 654 }
677 655
678 static getMineFollowListDataUrl() { 656 static getMineFollowListDataUrl() {
679 - let url = HttpUrlUtils._hostUrl + HttpUrlUtils.MINE_FOLLOW_LIST_DATA_PATH 657 + let url = HttpUrlUtils.getHost() + HttpUrlUtils.MINE_FOLLOW_LIST_DATA_PATH
680 return url 658 return url
681 } 659 }
682 660
683 static getFollowListStatusDataUrl() { 661 static getFollowListStatusDataUrl() {
684 - let url = HttpUrlUtils._hostUrl + HttpUrlUtils.FOLLOW_LIST_STATUS_DATA_PATH 662 + let url = HttpUrlUtils.getHost() + HttpUrlUtils.FOLLOW_LIST_STATUS_DATA_PATH
685 return url 663 return url
686 } 664 }
687 665
688 static getCommentListStatusDataUrl() { 666 static getCommentListStatusDataUrl() {
689 - let url = HttpUrlUtils._hostUrl + HttpUrlUtils.COMMENT_LIST_STATUS_DATA_PATH 667 + let url = HttpUrlUtils.getHost() + HttpUrlUtils.COMMENT_LIST_STATUS_DATA_PATH
690 return url 668 return url
691 } 669 }
692 670
693 static getMineCommentListDataUrl() { 671 static getMineCommentListDataUrl() {
694 - let url = HttpUrlUtils._hostUrl + HttpUrlUtils.MINE_COMMENT_LIST_DATA_PATH 672 + let url = HttpUrlUtils.getHost() + HttpUrlUtils.MINE_COMMENT_LIST_DATA_PATH
695 return url 673 return url
696 } 674 }
697 675
698 static getMineUserLevelDataUrl() { 676 static getMineUserLevelDataUrl() {
699 - let url = HttpUrlUtils._hostUrl + HttpUrlUtils.MINE_USER_LEVEL_DATA_PATH 677 + let url = HttpUrlUtils.getHost() + HttpUrlUtils.MINE_USER_LEVEL_DATA_PATH
700 return url 678 return url
701 } 679 }
702 680
703 static getOtherUserLevelDataUrl() { 681 static getOtherUserLevelDataUrl() {
704 - let url = HttpUrlUtils._hostUrl + HttpUrlUtils.OTHER_USER_LEVEL_DATA_PATH 682 + let url = HttpUrlUtils.getHost() + HttpUrlUtils.OTHER_USER_LEVEL_DATA_PATH
705 return url 683 return url
706 } 684 }
707 685
708 static getMineUserDetailDataUrl() { 686 static getMineUserDetailDataUrl() {
709 - let url = HttpUrlUtils._hostUrl + HttpUrlUtils.MINE_USER_DETAIL_DATA_PATH 687 + let url = HttpUrlUtils.getHost() + HttpUrlUtils.MINE_USER_DETAIL_DATA_PATH
710 return url 688 return url
711 } 689 }
712 690
713 static getOtherUserDetailDataUrl() { 691 static getOtherUserDetailDataUrl() {
714 - let url = HttpUrlUtils._hostUrl + HttpUrlUtils.OTHER_USER_DETAIL_DATA_PATH 692 + let url = HttpUrlUtils.getHost() + HttpUrlUtils.OTHER_USER_DETAIL_DATA_PATH
715 return url 693 return url
716 } 694 }
717 695
718 static getOtherCommentListDataUrl() { 696 static getOtherCommentListDataUrl() {
719 - let url = HttpUrlUtils._hostUrl + HttpUrlUtils.OTHER_COMMENT_LIST_DATA_PATH 697 + let url = HttpUrlUtils.getHost() + HttpUrlUtils.OTHER_COMMENT_LIST_DATA_PATH
720 return url 698 return url
721 } 699 }
722 700
723 static getOtherUserFollowListDataUrl() { 701 static getOtherUserFollowListDataUrl() {
724 - let url = HttpUrlUtils._hostUrl + HttpUrlUtils.OTHER_USER_FOLLOW_LIST_DATA_PATH 702 + let url = HttpUrlUtils.getHost() + HttpUrlUtils.OTHER_USER_FOLLOW_LIST_DATA_PATH
725 return url 703 return url
726 } 704 }
727 705
728 static getAppointmentOperationUrl() { 706 static getAppointmentOperationUrl() {
729 - let url = HttpUrlUtils._hostUrl + HttpUrlUtils.APPOINTMENT_OPERATION_STATUS_PATH 707 + let url = HttpUrlUtils.getHost() + HttpUrlUtils.APPOINTMENT_OPERATION_STATUS_PATH
730 return url 708 return url
731 } 709 }
732 710
733 static getCommentLikeOperationUrl() { 711 static getCommentLikeOperationUrl() {
734 - let url = HttpUrlUtils._hostUrl + HttpUrlUtils.COMMENT_LIKE_OPERATION_PATH 712 + let url = HttpUrlUtils.getHost() + HttpUrlUtils.COMMENT_LIKE_OPERATION_PATH
735 return url 713 return url
736 } 714 }
737 715
738 static getFollowOperationUrl() { 716 static getFollowOperationUrl() {
739 - let url = HttpUrlUtils._hostUrl + HttpUrlUtils.FOLLOW_OPERATION_PATH 717 + let url = HttpUrlUtils.getHost() + HttpUrlUtils.FOLLOW_OPERATION_PATH
740 return url 718 return url
741 } 719 }
742 720
743 static getSearchHintDataUrl() { 721 static getSearchHintDataUrl() {
744 - let url = HttpUrlUtils._hostUrl + HttpUrlUtils.SEARCH_HINT_DATA_PATH 722 + let url = HttpUrlUtils.getHost() + HttpUrlUtils.SEARCH_HINT_DATA_PATH
745 return url 723 return url
746 } 724 }
747 725
748 static getSearchHotsDataUrl() { 726 static getSearchHotsDataUrl() {
749 - let url = HttpUrlUtils._hostUrl + HttpUrlUtils.SEARCH_HOTS_DATA_PATH 727 + let url = HttpUrlUtils.getHost() + HttpUrlUtils.SEARCH_HOTS_DATA_PATH
750 return url 728 return url
751 } 729 }
752 730
753 static getRelatedSearchContentDataUrl() { 731 static getRelatedSearchContentDataUrl() {
754 - let url = HttpUrlUtils._hostUrl + HttpUrlUtils.RELATED_SEARCH_CONTENT_DATA_PATH 732 + let url = HttpUrlUtils.getHost() + HttpUrlUtils.RELATED_SEARCH_CONTENT_DATA_PATH
755 return url 733 return url
756 } 734 }
757 735
758 static getInterestsUrl() { 736 static getInterestsUrl() {
759 - let url = HttpUrlUtils._hostUrl + HttpUrlUtils.INTERESTS_HOTS_DATA_PATH; 737 + let url = HttpUrlUtils.getHost() + HttpUrlUtils.INTERESTS_HOTS_DATA_PATH;
760 return url; 738 return url;
761 739
762 } 740 }
763 741
764 static getUpdateInterestsUrl() { 742 static getUpdateInterestsUrl() {
765 - let url = HttpUrlUtils._hostUrl + HttpUrlUtils.INTERESTS_UPDATETAG_PATH; 743 + let url = HttpUrlUtils.getHost() + HttpUrlUtils.INTERESTS_UPDATETAG_PATH;
766 return url; 744 return url;
767 } 745 }
768 746
769 static getLaunchPageDataUrl() { 747 static getLaunchPageDataUrl() {
770 - let url = HttpUrlUtils._hostUrl + HttpUrlUtils.LAUNCH_PAGE_PATH; 748 + let url = HttpUrlUtils.getHost() + HttpUrlUtils.LAUNCH_PAGE_PATH;
771 return url; 749 return url;
772 750
773 } 751 }
774 752
775 static getLiveDetailsUrl() { 753 static getLiveDetailsUrl() {
776 - let url = HttpUrlUtils._hostUrl + HttpUrlUtils.LIVE_DETAILS_PATH 754 + let url = HttpUrlUtils.getHost() + HttpUrlUtils.LIVE_DETAILS_PATH
777 return url 755 return url
778 } 756 }
779 757
780 static getLiveListUrl() { 758 static getLiveListUrl() {
781 - let url = HttpUrlUtils._hostUrl + HttpUrlUtils.LIVE_LIST_PATH 759 + let url = HttpUrlUtils.getHost() + HttpUrlUtils.LIVE_LIST_PATH
782 return url 760 return url
783 } 761 }
784 762
785 static getLiveChatListUrl() { 763 static getLiveChatListUrl() {
786 - let url = HttpUrlUtils._hostUrl + HttpUrlUtils.LIVE_CHAT_LIST_PATH 764 + let url = HttpUrlUtils.getHost() + HttpUrlUtils.LIVE_CHAT_LIST_PATH
787 return url 765 return url
788 } 766 }
789 767
790 static getLiveRoomDataUrl() { 768 static getLiveRoomDataUrl() {
791 - let url = HttpUrlUtils._hostUrl + HttpUrlUtils.LIVE_ROOM_DATA_PATH 769 + let url = HttpUrlUtils.getHost() + HttpUrlUtils.LIVE_ROOM_DATA_PATH
792 return url 770 return url
793 } 771 }
794 772
795 static getLiveAppointmentStatusUrl() { 773 static getLiveAppointmentStatusUrl() {
796 - let url = HttpUrlUtils._hostUrl + HttpUrlUtils.LIVE_APPOINTMENT_STATUS_PATH 774 + let url = HttpUrlUtils.getHost() + HttpUrlUtils.LIVE_APPOINTMENT_STATUS_PATH
797 return url 775 return url
798 } 776 }
799 777
800 static getLiveAppointmentUrl() { 778 static getLiveAppointmentUrl() {
801 - let url = HttpUrlUtils._hostUrl + HttpUrlUtils.LIVE_APPOINTMENT_PATH 779 + let url = HttpUrlUtils.getHost() + HttpUrlUtils.LIVE_APPOINTMENT_PATH
802 return url 780 return url
803 } 781 }
804 782
805 static getAppointmentStatusUrl() { 783 static getAppointmentStatusUrl() {
806 - let url = HttpUrlUtils._hostUrl + HttpUrlUtils.LIVE_APPOINTMENT_BATCH_PATH 784 + let url = HttpUrlUtils.getHost() + HttpUrlUtils.LIVE_APPOINTMENT_BATCH_PATH
807 return url 785 return url
808 } 786 }
809 787
810 static getSearchResultCountDataUrl() { 788 static getSearchResultCountDataUrl() {
811 - let url = HttpUrlUtils._hostUrl + HttpUrlUtils.SEARCH_RESULT_COUNT_DATA_PATH 789 + let url = HttpUrlUtils.getHost() + HttpUrlUtils.SEARCH_RESULT_COUNT_DATA_PATH
812 return url 790 return url
813 } 791 }
814 792
815 static getSearchResultListDataUrl() { 793 static getSearchResultListDataUrl() {
816 - let url = HttpUrlUtils._hostUrl + HttpUrlUtils.SEARCH_RESULT_LIST_DATA_PATH 794 + let url = HttpUrlUtils.getHost() + HttpUrlUtils.SEARCH_RESULT_LIST_DATA_PATH
817 return url 795 return url
818 } 796 }
819 797
820 static getInteractListDataUrl() { 798 static getInteractListDataUrl() {
821 - let url = HttpUrlUtils._hostUrl + HttpUrlUtils.INTERACT_DATA_PATH 799 + let url = HttpUrlUtils.getHost() + HttpUrlUtils.INTERACT_DATA_PATH
822 return url 800 return url
823 } 801 }
824 802
825 static getCreatorDetailListDataUrl() { 803 static getCreatorDetailListDataUrl() {
826 - let url = HttpUrlUtils._hostUrl + HttpUrlUtils.CREATOR_DETAIL_LIST_DATA_PATH 804 + let url = HttpUrlUtils.getHost() + HttpUrlUtils.CREATOR_DETAIL_LIST_DATA_PATH
827 return url 805 return url
828 } 806 }
829 807
830 static getArticleCountHotsDataUrl() { 808 static getArticleCountHotsDataUrl() {
831 - let url = HttpUrlUtils._hostUrl + HttpUrlUtils.ARTICLE_COUNT_HOTS_DATA_PATH 809 + let url = HttpUrlUtils.getHost() + HttpUrlUtils.ARTICLE_COUNT_HOTS_DATA_PATH
832 return url 810 return url
833 } 811 }
834 812
835 static getArticleListHotsDataUrl() { 813 static getArticleListHotsDataUrl() {
836 - let url = HttpUrlUtils._hostUrl + HttpUrlUtils.ARTICLE_LIST_HOTS_DATA_PATH 814 + let url = HttpUrlUtils.getHost() + HttpUrlUtils.ARTICLE_LIST_HOTS_DATA_PATH
837 return url 815 return url
838 } 816 }
839 817
840 static getCreatorInfluenceInfoHotsDataUrl() { 818 static getCreatorInfluenceInfoHotsDataUrl() {
841 - let url = HttpUrlUtils._hostUrl + HttpUrlUtils.CREATOR_INFLUENCE_HOTS_DATA_PATH 819 + let url = HttpUrlUtils.getHost() + HttpUrlUtils.CREATOR_INFLUENCE_HOTS_DATA_PATH
842 return url 820 return url
843 } 821 }
844 822
845 //点赞 823 //点赞
846 static executeLike() { 824 static executeLike() {
847 - let url = HttpUrlUtils._hostUrl + "/api/rmrb-interact/interact/zh/c/like/executeLike"; 825 + let url = HttpUrlUtils.getHost() + "/api/rmrb-interact/interact/zh/c/like/executeLike";
848 return url; 826 return url;
849 } 827 }
850 828
851 //获取点赞状态 829 //获取点赞状态
852 static getLikeStatus() { 830 static getLikeStatus() {
853 - let url = HttpUrlUtils._hostUrl + "/api/rmrb-interact/interact/zh/c/batchLikeAndCollect/status"; 831 + let url = HttpUrlUtils.getHost() + "/api/rmrb-interact/interact/zh/c/batchLikeAndCollect/status";
854 return url; 832 return url;
855 } 833 }
856 834
  835 + //获取点赞数
  836 + static getLikeCount() {
  837 + let url = HttpUrlUtils.getHost() + "/api/rmrb-contact/contact/zh/c/v2/content/interactData";
  838 + return url;
  839 + }
  840 +
  841 +
857 //搜索推荐 842 //搜索推荐
858 static getSearchSuggestDataUrl() { 843 static getSearchSuggestDataUrl() {
859 - let url = HttpUrlUtils._hostUrl + HttpUrlUtils.SEARCH_SUGGEST_DATA_PATH 844 + let url = HttpUrlUtils.getHost() + HttpUrlUtils.SEARCH_SUGGEST_DATA_PATH
860 return url 845 return url
861 } 846 }
862 847
863 //金刚位聚合页 848 //金刚位聚合页
864 static getThemeListUrl() { 849 static getThemeListUrl() {
865 - let url = HttpUrlUtils._hostUrl + "/api/rmrb-bff-display-zh/display/zh/c/themeList"; 850 + let url = HttpUrlUtils.getHost() + "/api/rmrb-bff-display-zh/display/zh/c/themeList";
866 return url; 851 return url;
867 } 852 }
868 853
1 -// import { ResponseLogin } from '../bean/account/ResponseLogin';  
2 -import { Logger } from 'wdKit';  
3 -  
4 -// import { UserInfo } from '../bean/account/UserInfo';  
5 -// import { ConfigConstants } from '../constants/ConfigConstants';  
6 -// import { AccountManagerUtils } from './AccountManagerUtils';  
7 -// import { AppUtils } from './AppUtils';  
8 -// import { DeviceUtil } from './DeviceUtil';  
9 -// import { Logger } from './Logger';  
10 -// import { StringUtils } from './StringUtils'; 1 +import { HttpRequest } from '../http/HttpRequest';
11 2
12 const TAG: string = '[HttpUtils]' 3 const TAG: string = '[HttpUtils]'
13 4
14 export class HttpUtils { 5 export class HttpUtils {
15 - static buildHeaders(): Record<string, string> {  
16 - let timestamp: number = new Date().getTime(); // 单位毫秒  
17 - // let clientId = DeviceUtil.clientId()  
18 - 6 + /**
  7 + * 添加公共参数,如登录后,添加登录信息
  8 + */
  9 + static addCommonHeader() {
  10 + HttpRequest.addGlobalHeaderProvider(() => {
19 let headers: Record<string, string> = {}; 11 let headers: Record<string, string> = {};
20 - // 通用请求头  
21 - headers["version"] = 'V3';  
22 - // headers["appId"] = ConfigConstants.appId; // 应用id  
23 - // headers["terminalId"] = ConfigConstants.terminalId; // 终端ID  
24 - // headers["sourceId"] = ConfigConstants.sourceId; // 咪咕视频  
25 - // headers["appType"] = ConfigConstants.appType; // 手机客户端App(安卓)  
26 - // headers["clientType"] = ConfigConstants.clientType; // 客户端类型  
27 - // headers["appVersion"] = AppUtils.getAppVersionCode() + ''; // 客户端版本号:2600010500  
28 - // headers["APP-VERSION-CODE"] = AppUtils.getAppVersionCode() + ''; // APP版本号:250006577  
29 - // headers["appVersionName"] = AppUtils.getAppVersionName() // app对外显示版本: '6.1.5.00'  
30 - // headers["appCode"] = ConfigConstants.appCode; // 应用编码:产品_渠道_应用的拼接串,用下划线_ 拼接而成  
31 - // headers["ptvCode"] = ConfigConstants.ptvCode; // 基线版本号_应用版本号 todo:  
32 - // headers["clientProvinceCode"] = ''; // 客户端分省号 // 02  
33 - // headers["provinceCode"] = ''; // 客户端分省号 // 02  
34 - // headers["clientCityId"] = ''; // 客户端城市ID // 0210  
35 - // headers["carrierCode"] = ''; // 运营商信息  
36 -  
37 - // 设备信息请求头  
38 - // headers["User-Agent"] = ''; // 终端UA,自动获取  
39 - headers["Content-Type"] = 'application/json;charset=UTF-8'; // 返回/响应的HTTP内容类型  
40 - headers["os"] = 'android'; // 操作系统类型:鸿蒙、安卓或iOS  
41 - // headers["osInfo"] = 'AD'; // 操作系统信息  
42 - headers["Phone-Info"] = 'HUAWEI'; // 手机信息: todo  
43 - // headers["oaid"] = ''; // 开放匿名设备ID,是中国移动安全联盟(MSA)发起并制定标准用户识别ID  
44 - headers["networkInfo"] = 'WIFI'; // 网络类型: todo  
45 - headers["cache-control"] = 'no-cache'; // 请求和响应遵循的缓存机制  
46 - // headers["clientId"] = clientId; // 客户端编号:客户端初始化时生成的客户端ID,保证唯一性  
47 - headers["imei"] = 'd1de6d3ae0db44bea1b3f0e20a14d90a'; // 终端手机序列号: todo  
48 - headers["X-UP-CLIENT-CHANNEL-ID"] = '2600010500-99000-101700010130012'; // 客户端渠道ID: todo  
49 - headers["channelCode"] = 'VIDEO_APPMAIL'; // 渠道编码  
50 - // headers["l_c"] = clientId; // 客户端id,同clientId  
51 - // headers["l_t"] = timestamp + ''; // 本机时间戳  
52 - // headers["l_s"] = ''; // l_c和l_t拼接后的MD5校验  
53 -  
54 - // 签名相关请求头  
55 - headers["timeStamp"] = timestamp + ''; // 服务端时间戳(毫秒):1701667763664  
56 - headers["signType"] = 'RSA'; // 签名类型,固定RSA 12 + return headers;
  13 + })
  14 + }
57 15
58 - // 业务请求头  
59 - // headers["promotionID"] = '54b0f421-a6df-41d3-9be2-92820b2c5d8c'; // 促销Id todo  
60 - // headers["tenantId"] = ''; // 租户Id 16 + /**
  17 + * 添加公共参数,如登出后,移除登录信息
  18 + */
  19 + static removeCommonHeader() {
61 20
62 - // 添加其他header  
63 - // headers["sdkCeId"] = '27fb3129-5a54-45bc-8af1-7dc8f1155501'; // 用户中台老接口定义的ID,保持不变,现网:咪咕视频Android版,27fb3129-5a54-45bc-8af1-7dc8f1155501 todo  
64 - headers["support-pendant"] = '1'; // 挂件标识, "1":客户端支持挂件节目结构;非"1":不支持挂件节目结构-展示通用对象  
65 - Logger.info(TAG, "buildHeader headers:" + JSON.stringify(headers));  
66 - return headers;  
67 } 21 }
68 } 22 }
69 -  
70 -// export default new HttpUtils()  
@@ -124,4 +124,6 @@ export class WDRouterPage { @@ -124,4 +124,6 @@ export class WDRouterPage {
124 static themeListPage = new WDRouterPage("wdComponent", "ets/components/page/ThemeListPage"); 124 static themeListPage = new WDRouterPage("wdComponent", "ets/components/page/ThemeListPage");
125 // 栏目页面、频道详情 125 // 栏目页面、频道详情
126 static columnPage = new WDRouterPage("phone", "ets/pages/column/ColumnPage"); 126 static columnPage = new WDRouterPage("phone", "ets/pages/column/ColumnPage");
  127 + //展示头像
  128 + static showUserHeaderPage = new WDRouterPage("wdComponent", "ets/pages/ShowUserHeaderPage");
127 } 129 }
@@ -157,13 +157,14 @@ export class ProcessUtils { @@ -157,13 +157,14 @@ export class ProcessUtils {
157 * 图集详情页 157 * 图集详情页
158 * @param content 158 * @param content
159 * */ 159 * */
160 - public static gotoMultiPictureListPage(photoList: PhotoListBean[]) { 160 + public static gotoMultiPictureListPage(photoList: PhotoListBean[], swiperIndex?:number) {
161 let taskAction: Action = { 161 let taskAction: Action = {
162 type: 'JUMP_DETAIL_PAGE', 162 type: 'JUMP_DETAIL_PAGE',
163 params: { 163 params: {
164 detailPageType: 18, 164 detailPageType: 18,
165 extra: { 165 extra: {
166 - photoList 166 + photoList,
  167 + swiperIndex
167 } as ExtraDTO 168 } as ExtraDTO
168 } as Params, 169 } as Params,
169 }; 170 };
@@ -99,6 +99,7 @@ function handleJsCallReceiveH5Data(data: Message) { @@ -99,6 +99,7 @@ function handleJsCallReceiveH5Data(data: Message) {
99 case '3': 99 case '3':
100 let imgListData: IImgListData = JSON.parse(data?.data?.imgListData || "{}") 100 let imgListData: IImgListData = JSON.parse(data?.data?.imgListData || "{}")
101 let imgArr = imgListData?.imgArr || [] 101 let imgArr = imgListData?.imgArr || []
  102 + let swiperIndex = imgListData?.imgIndex
102 if (imgArr.length > 0) { 103 if (imgArr.length > 0) {
103 const photoList: PhotoListBean[] = imgArr.map(item => { 104 const photoList: PhotoListBean[] = imgArr.map(item => {
104 const photo: PhotoListBean = { 105 const photo: PhotoListBean = {
@@ -109,7 +110,7 @@ function handleJsCallReceiveH5Data(data: Message) { @@ -109,7 +110,7 @@ function handleJsCallReceiveH5Data(data: Message) {
109 } 110 }
110 return photo 111 return photo
111 }) 112 })
112 - ProcessUtils.gotoMultiPictureListPage(photoList) 113 + ProcessUtils.gotoMultiPictureListPage(photoList,swiperIndex)
113 } 114 }
114 break; 115 break;
115 case '5': 116 case '5':
@@ -79,6 +79,7 @@ export struct WdWebLocalComponent { @@ -79,6 +79,7 @@ export struct WdWebLocalComponent {
79 if (this.videoUrl) { 79 if (this.videoUrl) {
80 Video({ src: this.videoUrl }) 80 Video({ src: this.videoUrl })
81 .autoPlay(true) 81 .autoPlay(true)
  82 + .objectFit(ImageFit.Contain)
82 .width(this.positionWidth) 83 .width(this.positionWidth)
83 .height(this.positionHeight) 84 .height(this.positionHeight)
84 .borderRadius(5) 85 .borderRadius(5)
@@ -15,5 +15,6 @@ export interface ExtraDTO extends ItemDTO { @@ -15,5 +15,6 @@ export interface ExtraDTO extends ItemDTO {
15 relType: string; 15 relType: string;
16 liveStreamType?: number; 16 liveStreamType?: number;
17 photoList: PhotoListBean[]; 17 photoList: PhotoListBean[];
  18 + swiperIndex?: number
18 commentId?: string; 19 commentId?: string;
19 } 20 }
1 export interface UserInfoDTO { 1 export interface UserInfoDTO {
2 - userHeadUrl:string 2 + userHeadUrl: string
  3 + userName?: string
  4 + headPhotoUrl?: string
3 } 5 }
@@ -71,8 +71,6 @@ export { SpacialTopicPageComponent } from './src/main/ets/components/SpacialTopi @@ -71,8 +71,6 @@ export { SpacialTopicPageComponent } from './src/main/ets/components/SpacialTopi
71 71
72 export { LogoutViewModel } from "./src/main/ets/viewmodel/LogoutViewModel" 72 export { LogoutViewModel } from "./src/main/ets/viewmodel/LogoutViewModel"
73 73
74 -export { ImageSwiperComponent } from "./src/main/ets/components/ImageSwiperComponent"  
75 -  
76 export { newsSkeleton } from "./src/main/ets/components/skeleton/newsSkeleton" 74 export { newsSkeleton } from "./src/main/ets/components/skeleton/newsSkeleton"
77 75
78 export { LiveCommentComponent } from "./src/main/ets/components/comment/view/LiveCommentComponent" 76 export { LiveCommentComponent } from "./src/main/ets/components/comment/view/LiveCommentComponent"
@@ -9,6 +9,7 @@ import { @@ -9,6 +9,7 @@ import {
9 HorizontalStrokeCardThreeTwoRadioForOneComponent 9 HorizontalStrokeCardThreeTwoRadioForOneComponent
10 } from './view/HorizontalStrokeCardThreeTwoRadioForOneComponent'; 10 } from './view/HorizontalStrokeCardThreeTwoRadioForOneComponent';
11 import { ZhSingleRow02 } from './compview/ZhSingleRow02'; 11 import { ZhSingleRow02 } from './compview/ZhSingleRow02';
  12 +import { ZhSingleRow03 } from './compview/ZhSingleRow03';
12 import { ZhSingleRow04 } from './compview/ZhSingleRow04'; 13 import { ZhSingleRow04 } from './compview/ZhSingleRow04';
13 import { ZhSingleRow05 } from './compview/ZhSingleRow05'; 14 import { ZhSingleRow05 } from './compview/ZhSingleRow05';
14 import { ZhSingleRow06 } from './compview/ZhSingleRow06'; 15 import { ZhSingleRow06 } from './compview/ZhSingleRow06';
@@ -60,7 +61,7 @@ export struct CompParser { @@ -60,7 +61,7 @@ export struct CompParser {
60 } else if (compDTO.compStyle === CompStyle.Zh_Single_Row_02) { 61 } else if (compDTO.compStyle === CompStyle.Zh_Single_Row_02) {
61 ZhSingleRow02({ compDTO }) 62 ZhSingleRow02({ compDTO })
62 } else if (compDTO.compStyle === CompStyle.Zh_Single_Row_03) { 63 } else if (compDTO.compStyle === CompStyle.Zh_Single_Row_03) {
63 - LiveHorizontalReservationComponent({ compDTO: compDTO }) 64 + ZhSingleRow03({ compDTO: compDTO })
64 } else if (compDTO.compStyle === CompStyle.Zh_Grid_Layout_02) { 65 } else if (compDTO.compStyle === CompStyle.Zh_Grid_Layout_02) {
65 ZhGridLayout02({ compDTO: compDTO }) 66 ZhGridLayout02({ compDTO: compDTO })
66 } else if (compDTO.compStyle === CompStyle.Zh_Grid_Layout_03) { 67 } else if (compDTO.compStyle === CompStyle.Zh_Grid_Layout_03) {
@@ -44,9 +44,9 @@ export struct DynamicDetailComponent { @@ -44,9 +44,9 @@ export struct DynamicDetailComponent {
44 /** 44 /**
45 * 关注状态:默认未关注 点击去关注 45 * 关注状态:默认未关注 点击去关注
46 */ 46 */
47 - @State followStatus: String = '0'; 47 + @State followStatus: String = '';
48 48
49 - @State newsStatusOfUser: batchLikeAndCollectResult | undefined = undefined// 点赞、收藏状态 49 + @State newsStatusOfUser: batchLikeAndCollectResult = {} as batchLikeAndCollectResult// 点赞、收藏状态
50 //跳转 50 //跳转
51 private mJumpInfo: ContentDTO = {} as ContentDTO; 51 private mJumpInfo: ContentDTO = {} as ContentDTO;
52 52
@@ -121,6 +121,7 @@ export struct DynamicDetailComponent { @@ -121,6 +121,7 @@ export struct DynamicDetailComponent {
121 } 121 }
122 .width('63%') 122 .width('63%')
123 .margin({right: $r('app.float.margin_6')}) 123 .margin({right: $r('app.float.margin_6')})
  124 + if(!StringUtils.isEmpty(this.followStatus)){
124 if (this.followStatus == '0') { 125 if (this.followStatus == '0') {
125 Text('关注') 126 Text('关注')
126 .width($r('app.float.margin_54')) 127 .width($r('app.float.margin_54'))
@@ -148,6 +149,7 @@ export struct DynamicDetailComponent { @@ -148,6 +149,7 @@ export struct DynamicDetailComponent {
148 }) 149 })
149 } 150 }
150 } 151 }
  152 + }
151 .width('100%') 153 .width('100%')
152 .margin({ left: $r('app.float.margin_16')}) 154 .margin({ left: $r('app.float.margin_16')})
153 //内容 155 //内容
@@ -209,7 +211,7 @@ export struct DynamicDetailComponent { @@ -209,7 +211,7 @@ export struct DynamicDetailComponent {
209 } 211 }
210 } 212 }
211 .onClick((event: ClickEvent) => { 213 .onClick((event: ClickEvent) => {
212 - ProcessUtils.gotoMultiPictureListPage(this.contentDetailData.photoList) 214 + ProcessUtils.gotoMultiPictureListPage(this.contentDetailData.photoList,index)
213 }) 215 })
214 } else { 216 } else {
215 GridCol({ 217 GridCol({
@@ -226,7 +228,7 @@ export struct DynamicDetailComponent { @@ -226,7 +228,7 @@ export struct DynamicDetailComponent {
226 }) 228 })
227 } 229 }
228 .onClick((event: ClickEvent) => { 230 .onClick((event: ClickEvent) => {
229 - ProcessUtils.gotoMultiPictureListPage(this.contentDetailData.photoList) 231 + ProcessUtils.gotoMultiPictureListPage(this.contentDetailData.photoList,index)
230 }) 232 })
231 } 233 }
232 } else if (this.contentDetailData.photoList.length === 4) { 234 } else if (this.contentDetailData.photoList.length === 4) {
@@ -238,7 +240,7 @@ export struct DynamicDetailComponent { @@ -238,7 +240,7 @@ export struct DynamicDetailComponent {
238 .borderRadius(this.caclImageRadius(index)) 240 .borderRadius(this.caclImageRadius(index))
239 } 241 }
240 .onClick((event: ClickEvent) => { 242 .onClick((event: ClickEvent) => {
241 - ProcessUtils.gotoMultiPictureListPage(this.contentDetailData.photoList) 243 + ProcessUtils.gotoMultiPictureListPage(this.contentDetailData.photoList,index)
242 }) 244 })
243 } else { 245 } else {
244 GridCol({ 246 GridCol({
@@ -249,7 +251,7 @@ export struct DynamicDetailComponent { @@ -249,7 +251,7 @@ export struct DynamicDetailComponent {
249 .borderRadius(this.caclImageRadius(index)) 251 .borderRadius(this.caclImageRadius(index))
250 } 252 }
251 .onClick((event: ClickEvent) => { 253 .onClick((event: ClickEvent) => {
252 - ProcessUtils.gotoMultiPictureListPage(this.contentDetailData.photoList) 254 + ProcessUtils.gotoMultiPictureListPage(this.contentDetailData.photoList,index)
253 }) 255 })
254 } 256 }
255 }) 257 })
@@ -330,8 +332,8 @@ export struct DynamicDetailComponent { @@ -330,8 +332,8 @@ export struct DynamicDetailComponent {
330 Image(this.newsStatusOfUser?.likeStatus == '1'? 332 Image(this.newsStatusOfUser?.likeStatus == '1'?
331 $r('app.media.icon_like_selected_redheart') 333 $r('app.media.icon_like_selected_redheart')
332 :$r('app.media.icon_like_unselect_grey_redheart')) 334 :$r('app.media.icon_like_unselect_grey_redheart'))
333 - .width($r('app.float.margin_24'))  
334 - .height($r('app.float.margin_24')) 335 + .width($r('app.float.margin_36'))
  336 + .height($r('app.float.margin_36'))
335 .objectFit(ImageFit.Cover) 337 .objectFit(ImageFit.Cover)
336 if(this.interactDataDTO?.likeNum != 0){ 338 if(this.interactDataDTO?.likeNum != 0){
337 Text(NumberFormatterUtils.formatNumberWithWan(this.interactDataDTO?.likeNum)) 339 Text(NumberFormatterUtils.formatNumberWithWan(this.interactDataDTO?.likeNum))
@@ -430,12 +432,18 @@ export struct DynamicDetailComponent { @@ -430,12 +432,18 @@ export struct DynamicDetailComponent {
430 432
431 // 已登录->查询用户对作品点赞、收藏状态 433 // 已登录->查询用户对作品点赞、收藏状态
432 private async getInteractDataStatus() { 434 private async getInteractDataStatus() {
  435 + // 未登录,跳转登录
  436 + const user_id = await SPHelper.default.get(SpConstants.USER_ID, '')
  437 + if (!user_id) {
  438 + WDRouterRule.jumpWithPage(WDRouterPage.loginPage)
  439 + return
  440 + }
433 try { 441 try {
434 const params: batchLikeAndCollectParams = { 442 const params: batchLikeAndCollectParams = {
435 contentList: [ 443 contentList: [
436 { 444 {
437 - contentId: this.contentDetailData[0]?.newsId + '',  
438 - contentType: this.contentDetailData[0]?.newsType + '', 445 + contentId: this.contentDetailData?.newsId + '',
  446 + contentType: this.contentDetailData?.newsType + '',
439 } 447 }
440 ] 448 ]
441 } 449 }
@@ -453,6 +461,13 @@ export struct DynamicDetailComponent { @@ -453,6 +461,13 @@ export struct DynamicDetailComponent {
453 * 查询当前登录用户是否关注作品号主 461 * 查询当前登录用户是否关注作品号主
454 * */ 462 * */
455 private async getBatchAttentionStatus() { 463 private async getBatchAttentionStatus() {
  464 + // 未登录,跳转登录
  465 + const user_id = await SPHelper.default.get(SpConstants.USER_ID, '')
  466 + if (!user_id) {
  467 + WDRouterRule.jumpWithPage(WDRouterPage.loginPage)
  468 + this.followStatus = '0';
  469 + return
  470 + }
456 try { 471 try {
457 const params: postBatchAttentionStatusParams = { 472 const params: postBatchAttentionStatusParams = {
458 creatorIds: [{ creatorId: this.contentDetailData?.rmhInfo?.rmhId ?? '' }] 473 creatorIds: [{ creatorId: this.contentDetailData?.rmhInfo?.rmhId ?? '' }]
@@ -461,7 +476,7 @@ export struct DynamicDetailComponent { @@ -461,7 +476,7 @@ export struct DynamicDetailComponent {
461 this.followStatus = data[0]?.status; 476 this.followStatus = data[0]?.status;
462 Logger.info(TAG, `followStatus:${JSON.stringify(this.followStatus)}`) 477 Logger.info(TAG, `followStatus:${JSON.stringify(this.followStatus)}`)
463 } catch (exception) { 478 } catch (exception) {
464 - 479 + this.followStatus = '0';
465 } 480 }
466 } 481 }
467 482
@@ -558,8 +573,6 @@ export struct DynamicDetailComponent { @@ -558,8 +573,6 @@ export struct DynamicDetailComponent {
558 contentType: this.contentDetailData?.newsType + '', 573 contentType: this.contentDetailData?.newsType + '',
559 } 574 }
560 ContentDetailRequest.postExecuteLike(params).then(res => { 575 ContentDetailRequest.postExecuteLike(params).then(res => {
561 -  
562 - if (this.newsStatusOfUser) {  
563 this.newsStatusOfUser.likeStatus = this.newsStatusOfUser?.likeStatus === '1' ? '0' : '1' 576 this.newsStatusOfUser.likeStatus = this.newsStatusOfUser?.likeStatus === '1' ? '0' : '1'
564 if (this.newsStatusOfUser.likeStatus === '1') { 577 if (this.newsStatusOfUser.likeStatus === '1') {
565 this.interactDataDTO.likeNum = Number(this.interactDataDTO.likeNum) + 1 578 this.interactDataDTO.likeNum = Number(this.interactDataDTO.likeNum) + 1
@@ -567,9 +580,6 @@ export struct DynamicDetailComponent { @@ -567,9 +580,6 @@ export struct DynamicDetailComponent {
567 this.interactDataDTO.likeNum = Number(this.interactDataDTO.likeNum) - 1 580 this.interactDataDTO.likeNum = Number(this.interactDataDTO.likeNum) - 1
568 } 581 }
569 console.log('点赞、取消点赞==', this.newsStatusOfUser?.likeStatus, this.interactDataDTO?.likeNum) 582 console.log('点赞、取消点赞==', this.newsStatusOfUser?.likeStatus, this.interactDataDTO?.likeNum)
570 - // this.queryContentInteractCount()  
571 - }  
572 -  
573 }) 583 })
574 } 584 }
575 } 585 }
@@ -13,6 +13,7 @@ import { @@ -13,6 +13,7 @@ import {
13 import DetailViewModel from '../viewmodel/DetailViewModel'; 13 import DetailViewModel from '../viewmodel/DetailViewModel';
14 import { ImageAndTextWebComponent } from './ImageAndTextWebComponent'; 14 import { ImageAndTextWebComponent } from './ImageAndTextWebComponent';
15 import { OperRowListView } from './view/OperRowListView'; 15 import { OperRowListView } from './view/OperRowListView';
  16 +import router from '@ohos.router';
16 import { RecommendList } from '../components/view/RecommendList' 17 import { RecommendList } from '../components/view/RecommendList'
17 import { CommonConstants } from 'wdConstant'; 18 import { CommonConstants } from 'wdConstant';
18 import { HttpUrlUtils } from 'wdNetwork/Index'; 19 import { HttpUrlUtils } from 'wdNetwork/Index';
@@ -20,7 +21,6 @@ import { WDRouterPage, WDRouterRule } from 'wdRouter/Index'; @@ -20,7 +21,6 @@ import { WDRouterPage, WDRouterRule } from 'wdRouter/Index';
20 import { MultiPictureDetailViewModel } from '../viewmodel/MultiPictureDetailViewModel'; 21 import { MultiPictureDetailViewModel } from '../viewmodel/MultiPictureDetailViewModel';
21 import { PageRepository } from '../repository/PageRepository'; 22 import { PageRepository } from '../repository/PageRepository';
22 import { detailedSkeleton } from './skeleton/detailSkeleton'; 23 import { detailedSkeleton } from './skeleton/detailSkeleton';
23 -import { CommentComponent } from '../components/comment/view/CommentComponent'  
24 24
25 const PATTERN_DATE_CN_RN: string = 'yyyy年MM月dd日 HH:mm'; 25 const PATTERN_DATE_CN_RN: string = 'yyyy年MM月dd日 HH:mm';
26 26
@@ -75,58 +75,16 @@ export struct ImageAndTextPageComponent { @@ -75,58 +75,16 @@ export struct ImageAndTextPageComponent {
75 isPageEnd: $isPageEnd 75 isPageEnd: $isPageEnd
76 }) 76 })
77 Column() { 77 Column() {
78 - // 点赞  
79 - if (this.contentDetailData[0]?.openLikes) {  
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 - }  
116 if (this.recommendList.length > 0) { 78 if (this.recommendList.length > 0) {
117 RecommendList({ recommendList: this.recommendList }) 79 RecommendList({ recommendList: this.recommendList })
118 } 80 }
119 - // 评论  
120 - if(this.contentDetailData[0]?.openComment){  
121 -  
122 - }  
123 } 81 }
124 } 82 }
125 83
126 } 84 }
127 .width(CommonConstants.FULL_WIDTH) 85 .width(CommonConstants.FULL_WIDTH)
128 .height(CommonConstants.FULL_HEIGHT) 86 .height(CommonConstants.FULL_HEIGHT)
129 - .padding({ bottom: 126 }) 87 + .padding({ bottom: 76 })
130 .scrollBar(BarState.Off) 88 .scrollBar(BarState.Off)
131 89
132 if (!this.isPageEnd) { 90 if (!this.isPageEnd) {
@@ -134,7 +92,45 @@ export struct ImageAndTextPageComponent { @@ -134,7 +92,45 @@ export struct ImageAndTextPageComponent {
134 } 92 }
135 93
136 //底部交互区 94 //底部交互区
137 - OperRowListView({ contentDetailData: this.contentDetailData[0] }) 95 + if (this.contentDetailData?.length) {
  96 + OperRowListView({contentDetailData: this.contentDetailData[0]})
  97 + }
  98 + /* Row() {
  99 + Image($r('app.media.icon_arrow_left'))
  100 + .width(24)
  101 + .height(24)
  102 + .onClick((event: ClickEvent) => {
  103 + router.back()
  104 + })
  105 +
  106 + Row() {
  107 + Image($r('app.media.icon_comment'))
  108 + .width(24)
  109 + .height(24)
  110 + .margin({ right: 24 })
  111 + .id('comment')
  112 +
  113 + Image($r('app.media.icon_star'))
  114 + .width(24)
  115 + .height(24)
  116 + .margin({ right: 24 })
  117 +
  118 + Image($r('app.media.icon_listen'))
  119 + .width(24)
  120 + .height(24)
  121 + .margin({ right: 24 })
  122 +
  123 + Image($r('app.media.icon_forward'))
  124 + .width(24)
  125 + .height(24)
  126 +
  127 + }
  128 + }
  129 + .width(CommonConstants.FULL_WIDTH)
  130 + .height(56)
  131 + .padding({ left: 15, right: 15, bottom: 50, top: 20 })
  132 + .justifyContent(FlexAlign.SpaceBetween)
  133 + .backgroundColor(Color.White)*/
138 } 134 }
139 135
140 } 136 }
@@ -20,7 +20,7 @@ export struct ImageDownloadComponent { @@ -20,7 +20,7 @@ export struct ImageDownloadComponent {
20 @State image: PixelMap | undefined = undefined; 20 @State image: PixelMap | undefined = undefined;
21 @State photoAccessHelper: photoAccessHelper.PhotoAccessHelper | undefined = undefined; // 相册模块管理实例 21 @State photoAccessHelper: photoAccessHelper.PhotoAccessHelper | undefined = undefined; // 相册模块管理实例
22 @State imageBuffer: ArrayBuffer | undefined = undefined; // 图片ArrayBuffer 22 @State imageBuffer: ArrayBuffer | undefined = undefined; // 图片ArrayBuffer
23 - url: string = '' 23 + @Prop @Watch('onChangeUrl') url: string = ''
24 24
25 build() { 25 build() {
26 Column() { 26 Column() {
@@ -40,7 +40,11 @@ export struct ImageDownloadComponent { @@ -40,7 +40,11 @@ export struct ImageDownloadComponent {
40 40
41 } 41 }
42 42
43 - async aboutToAppear(): Promise<void> { 43 + aboutToAppear(): void {
  44 + this.onChangeUrl()
  45 + }
  46 +
  47 + async onChangeUrl(): Promise<void> {
44 console.info(`cj2024 图片下载 ${this.url}`) 48 console.info(`cj2024 图片下载 ${this.url}`)
45 const context = getContext(this) as common.UIAbilityContext; 49 const context = getContext(this) as common.UIAbilityContext;
46 const atManager = abilityAccessCtrl.createAtManager(); 50 const atManager = abilityAccessCtrl.createAtManager();
1 -import { PhotoListBean } from 'wdBean/Index';  
2 -import { Logger } from 'wdKit/Index';  
3 -import { display, router } from '@kit.ArkUI';  
4 -import { ImageDownloadComponent } from './ImageDownloadComponent';  
5 -import { ImageItemView } from './view/ImageItemView';  
6 -  
7 -const TAG = 'ImageSwiperComponent';  
8 -  
9 -@Component  
10 -export struct ImageSwiperComponent {  
11 - @Provide @Watch('onCurrentPageNumUpdated') currentPageNum: string = '01'  
12 - private scroller: Scroller = new Scroller()  
13 - @State swiperIndex: number = 0;  
14 - photoList: PhotoListBean[] = [];  
15 - private swiperController: SwiperController = new SwiperController()  
16 - private displayTool = display.getDefaultDisplaySync()  
17 - private screenWidth: number = 0  
18 - private picWidth: number = 0  
19 - @State picHeight: number = 0  
20 - @State isEnableSwipe: boolean = true;  
21 -  
22 - // @Provide bgc: Color = Color.White;  
23 -  
24 - //watch监听页码回调  
25 - onCurrentPageNumUpdated(): void {  
26 - Logger.info(TAG, `currentPageNum:${this.currentPageNum}`,)  
27 - let _swiperIndex = Number.parseInt(this.currentPageNum)  
28 - Logger.info(TAG, `_swiperIndex:${_swiperIndex}`)  
29 - this.swiperIndex = _swiperIndex > 0 ? _swiperIndex - 1 : _swiperIndex  
30 - }  
31 -  
32 - aboutToAppear(): void {  
33 - //获取宽高尺寸  
34 - this.screenWidth = this.displayTool.width  
35 - // this.picWidth = this.screenWidth - vp2px(52)  
36 - this.picWidth = this.screenWidth  
37 - this.picHeight = this.picWidth * 578 / 375  
38 - }  
39 -  
40 - build() {  
41 - RelativeContainer() {  
42 - Image($r('app.media.icon_arrow_left_white'))  
43 - .width(24)  
44 - .height(24)  
45 - .aspectRatio(1)  
46 - .interpolation(ImageInterpolation.High)  
47 - .alignRules({  
48 - top: { anchor: "__container__", align: VerticalAlign.Top },  
49 - left: { anchor: "__container__", align: HorizontalAlign.Start }  
50 - })  
51 - .onClick(() => {  
52 - router.back();  
53 - })  
54 - .id("backImg")  
55 -  
56 - if (this.photoList && this.photoList?.length > 0) {  
57 - Swiper(this.swiperController) {  
58 - ForEach(this.photoList, (item: PhotoListBean) => {  
59 - // MultiPictureDetailItemComponent({ MultiPictureDetailItem: item })  
60 - ImageItemView({ MultiPictureDetailItem: item, isEnableSwipe: this.isEnableSwipe })  
61 - })  
62 - }  
63 - .index(this.swiperIndex)  
64 - .width('100%')  
65 - .height(px2vp(this.picHeight) + 32)  
66 - .vertical(false)  
67 - .autoPlay(false)  
68 - .cachedCount(3)  
69 - .indicator(false)  
70 - .displayCount(1)  
71 - .id('e_swiper_content')  
72 - .alignRules({  
73 - center: { anchor: "__container__", align: VerticalAlign.Center },  
74 - middle: { anchor: "__container__", align: HorizontalAlign.Center }  
75 - })  
76 - .onChange((index: number) => {  
77 - this.swiperIndex = index  
78 - })  
79 -  
80 - Row() {  
81 - Scroll(this.scroller) {  
82 - Row() {  
83 - Flex({  
84 - direction: FlexDirection.Column,  
85 - justifyContent: FlexAlign.Start  
86 - }) {  
87 - Text() {  
88 - Span(`${this.swiperIndex + 1}`)  
89 - .fontSize(24)  
90 - .fontFamily('PingFang SC-Medium')  
91 - .fontWeight(500)  
92 - .lineHeight(28)  
93 - Span(`/${this.photoList.length}`)  
94 - .fontSize(14)  
95 - .fontFamily('PingFang SC-Medium')  
96 - .fontWeight(500)  
97 - .lineHeight(19)  
98 - }.fontColor(Color.White).margin(4)  
99 - }  
100 - }  
101 - .width('100%')  
102 - .margin({  
103 - top: 8,  
104 - left: 18,  
105 - bottom: 24,  
106 - right: 18  
107 - })  
108 - }  
109 - .scrollable(ScrollDirection.Vertical)  
110 - .scrollBarWidth(0)  
111 - }  
112 - .id('e_swiper_titles')  
113 - .alignRules({  
114 - bottom: { anchor: "__container__", align: VerticalAlign.Bottom },  
115 - middle: { anchor: "__container__", align: HorizontalAlign.Center }  
116 - })  
117 - }  
118 -  
119 - ImageDownloadComponent({ url: this.photoList[this.swiperIndex].picPath })  
120 - .alignRules({  
121 - bottom: { anchor: "__container__", align: VerticalAlign.Bottom },  
122 - right: { anchor: "__container__", align: HorizontalAlign.End }  
123 - })  
124 - .margin({  
125 - top: 8,  
126 - left: 18,  
127 - bottom: 24,  
128 - right: 18  
129 - })  
130 - .id("downloadImg")  
131 - }  
132 - .width('100%')  
133 - .height('100%')  
134 - .backgroundColor(Color.Black)  
135 - .id('e_picture_container')  
136 - // 设置顶部绘制延伸到状态栏  
137 - // 设置底部绘制延伸到导航条  
138 - .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM])  
139 - }  
140 -}  
1 -import { NetworkUtil, Logger, NetworkType, SPHelper, } from 'wdKit'; 1 +import { NetworkUtil, Logger, NetworkType, SPHelper, WindowModel} from 'wdKit';
2 import { ResponseDTO } from 'wdNetwork'; 2 import { ResponseDTO } from 'wdNetwork';
3 import { 3 import {
4 ContentDetailDTO, 4 ContentDetailDTO,
@@ -78,42 +78,19 @@ export struct MultiPictureDetailPageComponent { @@ -78,42 +78,19 @@ export struct MultiPictureDetailPageComponent {
78 78
79 build() { 79 build() {
80 RelativeContainer() { 80 RelativeContainer() {
81 - if (this.contentDetailData?.photoList && this.contentDetailData?.photoList?.length > 0) {  
82 - Swiper(this.swiperController) {  
83 - ForEach(this.contentDetailData.photoList, (item: PhotoListBean) => {  
84 - Swiper(this.swiperControllerItem) {  
85 - MultiPictureDetailItemComponent({ MultiPictureDetailItem: item }) 81 + this.init()
86 } 82 }
87 .width('100%') 83 .width('100%')
88 .height('100%') 84 .height('100%')
89 - .vertical(true)  
90 - .autoPlay(false)  
91 - .cachedCount(1)  
92 - .indicator(false)  
93 - .displayCount(1)  
94 - .onAnimationEnd(event => {  
95 - router.back()  
96 - })  
97 - }) 85 + .backgroundColor(Color.Black)
  86 + .id('e_picture_container')
  87 + // 设置顶部绘制延伸到状态栏
  88 + // 设置底部绘制延伸到导航条
  89 + .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM])
98 } 90 }
99 - .index(this.swiperIndex)  
100 - .width('100%')  
101 - .height(px2vp(this.picHeight) + 32)  
102 - .vertical(false)  
103 - .autoPlay(false)  
104 - .cachedCount(3)  
105 - .indicator(false)  
106 - .displayCount(1)  
107 - .loop(false)  
108 - .id('e_swiper_content')  
109 - .alignRules({  
110 - center: { anchor: "__container__", align: VerticalAlign.Center },  
111 - middle: { anchor: "__container__", align: HorizontalAlign.Center }  
112 - })  
113 - .onChange((index: number) => {  
114 - this.swiperIndex = index  
115 - })  
116 91
  92 + @Builder
  93 + init() {
117 if (this.contentDetailData.rmhPlatform == 1) { 94 if (this.contentDetailData.rmhPlatform == 1) {
118 Row() { 95 Row() {
119 Row({ space: 8 }) { 96 Row({ space: 8 }) {
@@ -154,6 +131,7 @@ export struct MultiPictureDetailPageComponent { @@ -154,6 +131,7 @@ export struct MultiPictureDetailPageComponent {
154 .height(14) 131 .height(14)
155 .textOverflow({ overflow: TextOverflow.Ellipsis }) 132 .textOverflow({ overflow: TextOverflow.Ellipsis })
156 .margin(0) 133 .margin(0)
  134 + .maxLines(1)
157 } 135 }
158 } 136 }
159 .width('81%') 137 .width('81%')
@@ -192,11 +170,47 @@ export struct MultiPictureDetailPageComponent { @@ -192,11 +170,47 @@ export struct MultiPictureDetailPageComponent {
192 .width('100%') 170 .width('100%')
193 .height(44) 171 .height(44)
194 .alignRules({ 172 .alignRules({
195 - top: { anchor: "e_swiper_content", align: VerticalAlign.Top },  
196 - middle: { anchor: "e_swiper_content", align: HorizontalAlign.Center } 173 + top: { anchor: "__container__", align: VerticalAlign.Top },
  174 + middle: { anchor: "__container__", align: HorizontalAlign.Center }
197 }) 175 })
198 .id('e_attention') 176 .id('e_attention')
199 } 177 }
  178 + if (this.contentDetailData?.photoList && this.contentDetailData?.photoList?.length > 0) {
  179 + Swiper(this.swiperController) {
  180 + ForEach(this.contentDetailData.photoList, (item: PhotoListBean) => {
  181 + Swiper(this.swiperControllerItem) {
  182 + MultiPictureDetailItemComponent({ MultiPictureDetailItem: item })
  183 + }
  184 + .width('100%')
  185 + .height('100%')
  186 + .vertical(true)
  187 + .autoPlay(false)
  188 + .cachedCount(1)
  189 + .indicator(false)
  190 + .displayCount(1)
  191 + .onAnimationEnd(event => {
  192 + router.back()
  193 + })
  194 + })
  195 + }
  196 + .index(this.swiperIndex)
  197 + .width('100%')
  198 + .height(px2vp(this.picHeight) + 32)
  199 + .vertical(false)
  200 + .autoPlay(false)
  201 + .cachedCount(3)
  202 + .indicator(false)
  203 + .displayCount(1)
  204 + .loop(false)
  205 + .id('e_swiper_content')
  206 + .alignRules({
  207 + center: { anchor: "__container__", align: VerticalAlign.Center },
  208 + middle: { anchor: "__container__", align: HorizontalAlign.Center }
  209 + })
  210 + .onChange((index: number) => {
  211 + this.swiperIndex = index
  212 + })
  213 +
200 Row() { 214 Row() {
201 Scroll(this.scroller) { 215 Scroll(this.scroller) {
202 Row() { 216 Row() {
@@ -295,14 +309,6 @@ export struct MultiPictureDetailPageComponent { @@ -295,14 +309,6 @@ export struct MultiPictureDetailPageComponent {
295 .border({ width: { top: 0.5 }, color: '#FFFFFF' }) 309 .border({ width: { top: 0.5 }, color: '#FFFFFF' })
296 .id('e_oper_row') 310 .id('e_oper_row')
297 } 311 }
298 - .width('100%')  
299 - .height('100%')  
300 - .backgroundColor(Color.Black)  
301 - .id('e_picture_container')  
302 - // 设置顶部绘制延伸到状态栏  
303 - // 设置底部绘制延伸到导航条  
304 - .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM])  
305 - }  
306 312
307 getContentDetailData() { 313 getContentDetailData() {
308 try { 314 try {
@@ -318,6 +324,11 @@ export struct MultiPictureDetailPageComponent { @@ -318,6 +324,11 @@ export struct MultiPictureDetailPageComponent {
318 } 324 }
319 this.netStatus = undefined 325 this.netStatus = undefined
320 this.contentDetailData = resDTO.data?.[0]; 326 this.contentDetailData = resDTO.data?.[0];
  327 + if (this.contentDetailData.rmhPlatform == 1) {
  328 + WindowModel.shared.setWindowSystemBarProperties({
  329 + statusBarContentColor: '#ffffff',
  330 + })
  331 + }
321 // this.contentDetailData.photoList = [] 332 // this.contentDetailData.photoList = []
322 if (this.contentDetailData?.photoList && this.contentDetailData?.photoList?.length === 0) { 333 if (this.contentDetailData?.photoList && this.contentDetailData?.photoList?.length === 0) {
323 // 暂无内容 334 // 暂无内容
@@ -102,7 +102,7 @@ export struct Card19Component { @@ -102,7 +102,7 @@ export struct Card19Component {
102 } 102 }
103 return photo 103 return photo
104 }) 104 })
105 - ProcessUtils.gotoMultiPictureListPage(photoList) 105 + ProcessUtils.gotoMultiPictureListPage(photoList,0)
106 }) 106 })
107 //TODO 底部的:分享、评论、点赞 功能;需要引用一个公共组件 107 //TODO 底部的:分享、评论、点赞 功能;需要引用一个公共组件
108 } 108 }
@@ -104,6 +104,9 @@ struct createImg { @@ -104,6 +104,9 @@ struct createImg {
104 } 104 }
105 .align(Alignment.BottomEnd) 105 .align(Alignment.BottomEnd)
106 } 106 }
  107 + .onClick((event: ClickEvent) => {
  108 + ProcessUtils.gotoVod(this.contentDTO)
  109 + })
107 } else { 110 } else {
108 // 竖图显示,宽度占50%,高度自适应 111 // 竖图显示,宽度占50%,高度自适应
109 GridCol({ 112 GridCol({
@@ -5,7 +5,6 @@ import commentViewModel from '../viewmodel/CommentViewModel' @@ -5,7 +5,6 @@ import commentViewModel from '../viewmodel/CommentViewModel'
5 import { router, window } from '@kit.ArkUI' 5 import { router, window } from '@kit.ArkUI'
6 import { CustomTitleUI } from '../../reusable/CustomTitleUI' 6 import { CustomTitleUI } from '../../reusable/CustomTitleUI'
7 import { MyCommentDataSource } from '../model/MyCommentDataSource' 7 import { MyCommentDataSource } from '../model/MyCommentDataSource'
8 -import { HttpUtils } from 'wdNetwork/src/main/ets/utils/HttpUtils'  
9 import { HttpUrlUtils } from 'wdNetwork/Index' 8 import { HttpUrlUtils } from 'wdNetwork/Index'
10 import PageModel from '../../../viewmodel/PageModel' 9 import PageModel from '../../../viewmodel/PageModel'
11 import { ErrorComponent } from '../../view/ErrorComponent' 10 import { ErrorComponent } from '../../view/ErrorComponent'
@@ -77,6 +77,7 @@ export struct ZhSingleRow02 { @@ -77,6 +77,7 @@ export struct ZhSingleRow02 {
77 .padding({ 77 .padding({
78 right: $r('app.float.card_comp_pagePadding_lf'), 78 right: $r('app.float.card_comp_pagePadding_lf'),
79 }) 79 })
  80 + .visibility(this.compDTO?.objectType === '0' || this.compDTO?.objectType === '' ? Visibility.None : Visibility.Visible)
80 .onClick(() => { 81 .onClick(() => {
81 if (this.compDTO?.objectType === '11') { 82 if (this.compDTO?.objectType === '11') {
82 ProcessUtils.jumpChannelTab(this.compDTO.objectId, this.compDTO.pageId as string) 83 ProcessUtils.jumpChannelTab(this.compDTO.objectId, this.compDTO.pageId as string)
  1 +import { CompDTO, ContentDTO, Params } from 'wdBean';
  2 +import { WDRouterPage, WDRouterRule } from 'wdRouter/Index';
  3 +import { HttpUrlUtils } from 'wdNetwork/Index';
  4 +import { postInteractAccentionOperateParams } from 'wdBean';
  5 +import { PageRepository } from '../../repository/PageRepository';
  6 +import { CommonConstants } from 'wdConstant/Index';
  7 +import { ProcessUtils } from 'wdRouter';
  8 +
  9 +/**
  10 + * 小视频横划卡
  11 + * Zh_Single_Row-02
  12 + */
  13 +const TAG = 'Zh_Single_Row-03'
  14 +
  15 +@Entry
  16 +@Component
  17 +export struct ZhSingleRow03 {
  18 + @State compDTO: CompDTO = {} as CompDTO
  19 + scroller: Scroller = new Scroller()
  20 +
  21 + build() {
  22 + Column() {
  23 + //顶部
  24 + this.CompHeader(this.compDTO)
  25 +
  26 + Scroll(this.scroller){
  27 + Row() {
  28 + ForEach(this.compDTO.operDataList, (item: ContentDTO) => {
  29 + Column() {
  30 + Row() {
  31 + Image(item.coverUrl)
  32 + .width(106)
  33 + .height(60)
  34 + .margin({right: 12})
  35 + Text(item.newsTitle)
  36 + .width(154)
  37 + .height(60)
  38 + .maxLines(3)
  39 + .textOverflow({overflow: TextOverflow.Ellipsis})
  40 + }
  41 + .margin({bottom: 16})
  42 +
  43 + Row() {
  44 + Flex({justifyContent: FlexAlign.SpaceBetween}){
  45 + Row() {
  46 + Text(item.liveInfo.liveStartTime.split(' ')[0].slice(5))
  47 + .margin({right: 6})
  48 + .fontColor(0x000000)
  49 + .fontSize(13)
  50 + .textAlign(TextAlign.Start)
  51 + Image($r('app.media.timeline_rect'))
  52 + .width(4)
  53 + .height(3)
  54 + .margin({right: 6})
  55 + Text(item.liveInfo.liveStartTime.split(' ')[1].slice(0, 5))
  56 + .margin({right: 6})
  57 + .fontColor(0x000000)
  58 + .fontSize(13)
  59 + Text('开始直播')
  60 + .fontColor(0xC8C8C8)
  61 + .fontSize(13)
  62 + }
  63 +
  64 + Row() {
  65 + Text('预约')
  66 + .width(48)
  67 + .height(24)
  68 + .backgroundColor(0xED2800)
  69 + .fontColor(0xffffff)
  70 + .fontSize(12)
  71 + .textAlign(TextAlign.Center)
  72 + .borderRadius(3)
  73 + }
  74 + .margin({top: -5})
  75 + }
  76 +
  77 + }
  78 + }
  79 + .width(298)
  80 + .height(116)
  81 + .padding({top: 12, bottom: 12, left: 12, right: 12})
  82 + .backgroundColor(0xf9f9f9)
  83 + .margin({right: 8})
  84 + .onClick(() => {
  85 + ProcessUtils.processPage(item)
  86 + })
  87 + })
  88 + }
  89 + }
  90 + .scrollable(ScrollDirection.Horizontal)
  91 + .scrollBar(BarState.Off)
  92 + }
  93 + .padding({
  94 + left: $r('app.float.card_comp_pagePadding_lf'),
  95 + right: $r('app.float.card_comp_pagePadding_lf'),
  96 + top: $r('app.float.card_comp_pagePadding_tb'),
  97 + bottom: $r('app.float.card_comp_pagePadding_tb')
  98 + })
  99 + .backgroundColor($r('app.color.white'))
  100 + }
  101 +
  102 + @Builder
  103 + CompHeader(item: CompDTO) {
  104 + Row() {
  105 + Row() {
  106 + Image($r("app.media.redLine"))
  107 + .width(3)
  108 + .height(16)
  109 + .margin({ right: 4 })
  110 + Text('直播预约')
  111 + .fontSize($r("app.float.font_size_17"))
  112 + .fontColor($r("app.color.color_222222"))
  113 + .fontWeight(600)
  114 + }
  115 +
  116 + Row() {
  117 + Text("更多")
  118 + .fontSize($r("app.float.font_size_14"))
  119 + .fontColor($r("app.color.color_999999"))
  120 + .margin({ right: 1 })
  121 + Image($r("app.media.more"))
  122 + .width(14)
  123 + .height(14)
  124 + .onClick(() => {
  125 + // TODO 跳转的页面,定义的入参可能不合理。推荐id: 41
  126 + let params = {'index': "1"} as Record<string, string>
  127 + WDRouterRule.jumpWithPage(WDRouterPage.followListPage, params)
  128 + })
  129 + }
  130 + .padding({
  131 + right: $r('app.float.card_comp_pagePadding_lf'),
  132 + })
  133 + .visibility(this.compDTO?.objectType === '0' || this.compDTO?.objectType === '' ? Visibility.None : Visibility.Visible)
  134 + .onClick(() => {
  135 + if (this.compDTO?.objectType === '11') {
  136 + ProcessUtils.jumpChannelTab(this.compDTO.objectId, this.compDTO.pageId as string)
  137 + } else if (this.compDTO?.objectType === '5') {
  138 + ProcessUtils._gotoSpecialTopic(this.compDTO.linkUrl)
  139 + } else if (this.compDTO?.objectType === '6') {
  140 + ProcessUtils._gotoDefaultWeb(this.compDTO.linkUrl)
  141 + }
  142 + })
  143 + }
  144 + .justifyContent(FlexAlign.SpaceBetween)
  145 + .margin({ top: 8, bottom: 8 })
  146 + .width('100%')
  147 + }
  148 +}
  149 +
  150 +@Extend(Text)
  151 +function textOverflowStyle(maxLine: number) {
  152 + .maxLines(maxLine)
  153 + .textOverflow({ overflow: TextOverflow.Ellipsis })
  154 +}
  155 +
  156 +@Component
  157 +struct CreatorItem {
  158 + @Prop item: ContentDTO
  159 + @State rmhIsAttention: number = 0
  160 + build() {
  161 + ListItem() {
  162 + Column() {
  163 + Stack({ alignContent: Alignment.Bottom }) {
  164 + Image(this.item.coverUrl)
  165 + .width(156)
  166 + .height(208)
  167 + Row()
  168 + .width(156)
  169 + .height(80)
  170 + .linearGradient({
  171 + direction: GradientDirection.Bottom,
  172 + colors: [['rgba(0, 0, 0, 0.0)', 0.0], ['rgba(0, 0, 0, 0.3)', 1.0]]
  173 + })
  174 + Text(this.item.newsTitle)
  175 + .fontColor(0xffffff)
  176 + .fontSize(14)
  177 + .maxLines(2)
  178 + .textOverflow({overflow: TextOverflow.Ellipsis})
  179 + .width(140)
  180 + .margin({bottom: 8})
  181 + }
  182 + }
  183 + .width(156)
  184 + .height(208)
  185 + .margin({ right: 11 })
  186 + .borderColor($r('app.color.color_EDEDED'))
  187 + .borderRadius($r('app.float.image_border_radius'))
  188 + }
  189 + .onClick((event: ClickEvent) => {
  190 + ProcessUtils.processPage(this.item)
  191 + })
  192 + }
  193 +
  194 + /**
  195 + * 关注号主 TODO 这里后面需要抽离
  196 + */
  197 + handleAccention(item: ContentDTO, status: number) {
  198 + this.rmhIsAttention = this.rmhIsAttention ? 0 : 1
  199 + return
  200 + // 未登录,跳转登录
  201 + if (!HttpUrlUtils.getUserId()) {
  202 + WDRouterRule.jumpWithPage(WDRouterPage.loginPage)
  203 + return
  204 + }
  205 +
  206 + const params: postInteractAccentionOperateParams = {
  207 + attentionUserType: item.rmhInfo?.userType || '', //被关注用户类型(1 普通用户 2 视频号 3 矩阵号)
  208 + attentionUserId: item.rmhInfo?.userId || '', // 被关注用户号主id
  209 + attentionCreatorId: item.rmhInfo?.rmhId || '', // 被关注用户号主id
  210 + // userType: 1,
  211 + // userId: '1', // TODO 用户id需要从本地获取
  212 + status: status,
  213 + }
  214 + PageRepository.postInteractAccentionOperate(params).then(res => {
  215 + console.log(TAG, '关注号主==', JSON.stringify(res.data))
  216 + if (status === 1) {
  217 + this.rmhIsAttention = 0
  218 + } else {
  219 + this.rmhIsAttention = 1
  220 + }
  221 + })
  222 + }
  223 +}
@@ -36,6 +36,7 @@ export struct ZhSingleRow04 { @@ -36,6 +36,7 @@ export struct ZhSingleRow04 {
36 .width(14) 36 .width(14)
37 .height(14) 37 .height(14)
38 } 38 }
  39 + .visibility(this.compDTO?.objectType === '0' || this.compDTO?.objectType === '' ? Visibility.None : Visibility.Visible)
39 .onClick(() => { 40 .onClick(() => {
40 if (this.compDTO?.objectType === '11') { 41 if (this.compDTO?.objectType === '11') {
41 ProcessUtils.jumpChannelTab(this.compDTO.objectId, this.compDTO.pageId as string) 42 ProcessUtils.jumpChannelTab(this.compDTO.objectId, this.compDTO.pageId as string)
@@ -9,12 +9,13 @@ import { EmptyComponent } from '../../view/EmptyComponent'; @@ -9,12 +9,13 @@ import { EmptyComponent } from '../../view/EmptyComponent';
9 const TAG = "AppointmentListUI" 9 const TAG = "AppointmentListUI"
10 10
11 @Component 11 @Component
12 -export struct AppointmentListUI{ 12 +export struct AppointmentListUI {
13 @State data: LazyDataSource<MineAppointmentItem> = new LazyDataSource(); 13 @State data: LazyDataSource<MineAppointmentItem> = new LazyDataSource();
14 - @State count:number = 0;  
15 - @State isLoading:boolean = false  
16 - @State hasMore:boolean = true  
17 - curPageNum:number = 1; 14 + @State count: number = 0;
  15 + @State isLoading: boolean = false
  16 + @State hasMore: boolean = true
  17 + curPageNum: number = 1;
  18 + @State isGetRequest: boolean = false
18 19
19 aboutToAppear() { 20 aboutToAppear() {
20 this.getNewPageData() 21 this.getNewPageData()
@@ -23,37 +24,41 @@ export struct AppointmentListUI{ @@ -23,37 +24,41 @@ export struct AppointmentListUI{
23 build() { 24 build() {
24 Column() { 25 Column() {
25 //标题栏目 26 //标题栏目
26 - CustomTitleUI({titleName:"预约列表"})  
27 - if(this.count == 0){  
28 - EmptyComponent({emptyType:10}) 27 + CustomTitleUI({ titleName: "预约列表" })
  28 + if (this.count == 0) {
  29 + if (this.isGetRequest == true) {
  30 + EmptyComponent({ emptyType: 10 })
29 .height('100%') 31 .height('100%')
30 .width('100%') 32 .width('100%')
31 - }else{ 33 + }
  34 +
  35 + } else {
32 //刷新控件 TODO 36 //刷新控件 TODO
33 //List 37 //List
34 List({ space: '6lpx' }) { 38 List({ space: '6lpx' }) {
35 LazyForEach(this.data, (item: MineAppointmentItem, index: number) => { 39 LazyForEach(this.data, (item: MineAppointmentItem, index: number) => {
36 ListItem() { 40 ListItem() {
37 - AppointmentListChildComponent({item:item}) 41 + AppointmentListChildComponent({ item: item })
38 } 42 }
39 - .onClick(()=>{ 43 + .onClick(() => {
40 //TODO 跳转 44 //TODO 跳转
41 }) 45 })
42 }, (item: MineAppointmentItem, index: number) => index.toString()) 46 }, (item: MineAppointmentItem, index: number) => index.toString())
43 47
44 //没有更多数据 显示提示 48 //没有更多数据 显示提示
45 - if(!this.hasMore){  
46 - ListItem(){ 49 + if (!this.hasMore) {
  50 + ListItem() {
47 ListHasNoMoreDataUI() 51 ListHasNoMoreDataUI()
48 } 52 }
49 } 53 }
50 - }.cachedCount(4) 54 + }
  55 + .cachedCount(4)
51 .scrollBar(BarState.Off) 56 .scrollBar(BarState.Off)
52 - .margin({top:'23lpx',left:'23lpx',right:'23lpx'}) 57 + .margin({ top: '23lpx', left: '23lpx', right: '23lpx' })
53 .layoutWeight(1) 58 .layoutWeight(1)
54 - .onReachEnd(()=>{  
55 - console.log(TAG,"触底了");  
56 - if(!this.isLoading){ 59 + .onReachEnd(() => {
  60 + console.log(TAG, "触底了");
  61 + if (!this.isLoading) {
57 //加载分页数据 62 //加载分页数据
58 this.getNewPageData() 63 this.getNewPageData()
59 } 64 }
@@ -65,70 +70,73 @@ export struct AppointmentListUI{ @@ -65,70 +70,73 @@ export struct AppointmentListUI{
65 .width('100%') 70 .width('100%')
66 } 71 }
67 72
68 - getNewPageData(){ 73 + getNewPageData() {
69 this.isLoading = true 74 this.isLoading = true
70 - if(this.hasMore){  
71 - MinePageDatasModel.getAppointmentListData("20",`${this.curPageNum}`,getContext(this)).then((value)=>{  
72 - if (!this.data || value.list.length == 0){ 75 + if (this.hasMore) {
  76 + MinePageDatasModel.getAppointmentListData("20", `${this.curPageNum}`, getContext(this)).then((value) => {
  77 + if (!this.data || value.list.length == 0) {
73 this.hasMore = false 78 this.hasMore = false
74 - }else{  
75 - value.list.forEach((value)=>{ 79 + } else {
  80 + value.list.forEach((value) => {
76 let dealTime = this.DealStartTime(value.planStartTime) 81 let dealTime = this.DealStartTime(value.planStartTime)
77 - if(dealTime!=null && dealTime.length === 2){  
78 - this.data.push(new MineAppointmentItem(value.imageUrl,value.status,value.title,true,dealTime[0],dealTime[1],value.relType,value.liveId,value.relId))  
79 - }else {  
80 - this.data.push(new MineAppointmentItem(value.imageUrl,value.status,value.title,true,"","",value.relType,value.liveId,value.relId)) 82 + if (dealTime != null && dealTime.length === 2) {
  83 + this.data.push(new MineAppointmentItem(value.imageUrl, value.status, value.title, true, dealTime[0], dealTime[1], value.relType, value.liveId, value.relId))
  84 + } else {
  85 + this.data.push(new MineAppointmentItem(value.imageUrl, value.status, value.title, true, "", "", value.relType, value.liveId, value.relId))
81 } 86 }
82 }) 87 })
83 this.data.notifyDataReload() 88 this.data.notifyDataReload()
84 this.count = this.data.totalCount() 89 this.count = this.data.totalCount()
85 if (this.data.totalCount() < value.totalCount) { 90 if (this.data.totalCount() < value.totalCount) {
86 this.curPageNum++ 91 this.curPageNum++
87 - }else { 92 + } else {
88 this.hasMore = false 93 this.hasMore = false
89 } 94 }
90 } 95 }
91 - }).catch((err:Error)=>{  
92 - console.log(TAG,JSON.stringify(err)) 96 + this.isGetRequest = true
  97 + this.isLoading = false
  98 + }).catch((err: Error) => {
  99 + console.log(TAG, JSON.stringify(err))
  100 + this.isGetRequest = true
  101 + this.isLoading = false
93 }) 102 })
94 } 103 }
95 - this.isLoading = false  
96 } 104 }
97 105
98 - DealStartTime(planStartTime:string):string[]{  
99 - let dealData:string[] = [] 106 + DealStartTime(planStartTime: string): string[] {
  107 + let dealData: string[] = []
100 108
101 - if(!StringUtils.isNotEmpty(planStartTime)){  
102 - console.log(TAG,"格式有误") 109 + if (!StringUtils.isNotEmpty(planStartTime)) {
  110 + console.log(TAG, "格式有误")
103 return dealData 111 return dealData
104 } 112 }
105 113
106 - if(planStartTime.indexOf(" ") === -1){  
107 - console.log(TAG,"格式有误") 114 + if (planStartTime.indexOf(" ") === -1) {
  115 + console.log(TAG, "格式有误")
108 return dealData 116 return dealData
109 } 117 }
110 let arr = planStartTime.split(" ") 118 let arr = planStartTime.split(" ")
111 - if(arr!=null && StringUtils.isNotEmpty(arr[0])){ //处理年月日 119 + if (arr != null && StringUtils.isNotEmpty(arr[0])) { //处理年月日
112 let time = arr[0].split("-"); 120 let time = arr[0].split("-");
113 - if(time.length === 3){  
114 - let month = time[1].indexOf("0") === 0 ? time[1].substring(1):time[1] 121 + if (time.length === 3) {
  122 + let month = time[1].indexOf("0") === 0 ? time[1].substring(1) : time[1]
115 let day = time[2] 123 let day = time[2]
116 124
117 dealData[0] = `${month}月${day}日` 125 dealData[0] = `${month}月${day}日`
118 - let today = `${new Date().getMonth()+1}月${new Date().getDate()}日`  
119 - if(dealData[0] === today){ 126 + let today = `${new Date().getMonth() + 1}月${new Date().getDate()}日`
  127 + if (dealData[0] === today) {
120 dealData[0] = "今日" 128 dealData[0] = "今日"
121 } 129 }
122 } 130 }
123 } 131 }
124 132
125 - if(arr!=null && StringUtils.isNotEmpty(arr[1])){ //处理时分 133 + if (arr != null && StringUtils.isNotEmpty(arr[1])) { //处理时分
126 let time = arr[1].split(":"); 134 let time = arr[1].split(":");
127 - if(time.length === 3){ 135 + if (time.length === 3) {
128 dealData[1] = `${time[0]}:${time[1]}` 136 dealData[1] = `${time[0]}:${time[1]}`
129 } 137 }
130 } 138 }
131 - console.log(TAG,JSON.stringify(dealData)) 139 + console.log(TAG, JSON.stringify(dealData))
132 return dealData 140 return dealData
133 } 141 }
134 } 142 }
@@ -256,11 +256,13 @@ export struct FollowChildComponent{ @@ -256,11 +256,13 @@ export struct FollowChildComponent{
256 if (value.code === 0 || value.code.toString() === "0") { 256 if (value.code === 0 || value.code.toString() === "0") {
257 this.data.status = this.data.status ==="0"?"1":"0" 257 this.data.status = this.data.status ==="0"?"1":"0"
258 258
259 - if(this.data.status === "1"){  
260 - UserDataLocal.setUserFollowOperation(DateTimeUtils.getTimeStamp()+"")  
261 - }else{  
262 - UserDataLocal.setUserFollowOperation(DateTimeUtils.getTimeStamp()+","+this.data.creatorId)  
263 - } 259 + UserDataLocal.setUserFollowOperation(this.data.creatorId+","+this.data.status)
  260 +
  261 + // if(this.data.status === "1"){
  262 + // UserDataLocal.setUserFollowOperation(DateTimeUtils.getTimeStamp()+"")
  263 + // }else{
  264 + // UserDataLocal.setUserFollowOperation(DateTimeUtils.getTimeStamp()+","+this.data.creatorId)
  265 + // }
264 } 266 }
265 } 267 }
266 }) 268 })
@@ -24,6 +24,7 @@ export struct FollowListDetailUI { @@ -24,6 +24,7 @@ export struct FollowListDetailUI {
24 @State hasMore: boolean = true 24 @State hasMore: boolean = true
25 curPageNum: number = 1; 25 curPageNum: number = 1;
26 preferences: dataPreferences.Preferences | null = null; 26 preferences: dataPreferences.Preferences | null = null;
  27 + @State isGetRequest: boolean = false
27 28
28 aboutToAppear() { 29 aboutToAppear() {
29 this.getNewPageData() 30 this.getNewPageData()
@@ -33,9 +34,12 @@ export struct FollowListDetailUI { @@ -33,9 +34,12 @@ export struct FollowListDetailUI {
33 build() { 34 build() {
34 Column() { 35 Column() {
35 if (this.count === 0) { 36 if (this.count === 0) {
36 - EmptyComponent({emptyType:14}) 37 + if (this.isGetRequest == true) {
  38 + EmptyComponent({ emptyType: 14 })
37 .layoutWeight(1) 39 .layoutWeight(1)
38 .width('100%') 40 .width('100%')
  41 + }
  42 +
39 } else { 43 } else {
40 List({ space: 3 }) { 44 List({ space: 3 }) {
41 LazyForEach(this.data, (item: FollowListDetailItem, index: number = 0) => { 45 LazyForEach(this.data, (item: FollowListDetailItem, index: number = 0) => {
@@ -47,7 +51,7 @@ export struct FollowListDetailUI { @@ -47,7 +51,7 @@ export struct FollowListDetailUI {
47 }, (item: FollowListDetailItem) => item.creatorId) 51 }, (item: FollowListDetailItem) => item.creatorId)
48 52
49 //没有更多数据 显示提示 53 //没有更多数据 显示提示
50 - if (!this.hasMore) { 54 + if (!this.hasMore && this.count != 0) {
51 ListItem() { 55 ListItem() {
52 ListHasNoMoreDataUI() 56 ListHasNoMoreDataUI()
53 } 57 }
@@ -75,16 +79,17 @@ export struct FollowListDetailUI { @@ -75,16 +79,17 @@ export struct FollowListDetailUI {
75 let observer = (key: string) => { 79 let observer = (key: string) => {
76 if (key == UserDataLocal.USER_FOLLOW_OPERATION) { 80 if (key == UserDataLocal.USER_FOLLOW_OPERATION) {
77 if (this.creatorDirectoryId === -1) { 81 if (this.creatorDirectoryId === -1) {
78 - let value = SPHelper.default.getSync(UserDataLocal.USER_FOLLOW_OPERATION,"") as string 82 + let value = SPHelper.default.getSync(UserDataLocal.USER_FOLLOW_OPERATION, "") as string
79 let arr = value.split(',') 83 let arr = value.split(',')
80 - if(arr!=null && arr.length === 2){  
81 - this.data.getDataArray().forEach((element,index) => {  
82 - if (element.creatorId === arr[1]) { 84 + if (arr[1] == "0") {
  85 + this.data.getDataArray().forEach((element, index) => {
  86 + if (element.creatorId === arr[0]) {
83 this.data.deleteItem(index) 87 this.data.deleteItem(index)
  88 + this.count = this.data.size()
84 } 89 }
85 }); 90 });
86 - }else{  
87 - if(!this.isLoading){ 91 + } else {
  92 + if (!this.isLoading) {
88 this.isLoading = true 93 this.isLoading = true
89 this.hasMore = true 94 this.hasMore = true
90 this.curPageNum = 1 95 this.curPageNum = 1
@@ -93,6 +98,16 @@ export struct FollowListDetailUI { @@ -93,6 +98,16 @@ export struct FollowListDetailUI {
93 this.getMyFollowListDetail() 98 this.getMyFollowListDetail()
94 } 99 }
95 } 100 }
  101 + }else{
  102 + let value = SPHelper.default.getSync(UserDataLocal.USER_FOLLOW_OPERATION, "") as string
  103 + let arr = value.split(',')
  104 + if (arr[1] == "0"){
  105 + this.data.getDataArray().forEach((element, index) => {
  106 + if (element.creatorId === arr[0]) {
  107 + this.data.getData(index).status = "0"
  108 + }
  109 + })
  110 + }
96 } 111 }
97 } 112 }
98 } 113 }
@@ -109,7 +124,7 @@ export struct FollowListDetailUI { @@ -109,7 +124,7 @@ export struct FollowListDetailUI {
109 this.isLoading = false 124 this.isLoading = false
110 } else { 125 } else {
111 value.list.forEach((value) => { 126 value.list.forEach((value) => {
112 - let fansNum:number = value.fansNum 127 + let fansNum: number = value.fansNum
113 let fansNumString = "" 128 let fansNumString = ""
114 if (fansNum > 10000) { 129 if (fansNum > 10000) {
115 let temp = (fansNum / 10000) + "" 130 let temp = (fansNum / 10000) + ""
@@ -123,7 +138,7 @@ export struct FollowListDetailUI { @@ -123,7 +138,7 @@ export struct FollowListDetailUI {
123 } else { 138 } else {
124 fansNumString = fansNum + "" 139 fansNumString = fansNum + ""
125 } 140 }
126 - this.data.push(new FollowListDetailItem(value.attentionHeadPhotoUrl, value.attentionUserName, fansNumString, value.introduction, value.attentionCreatorId, "1", value.attentionUserId, value.attentionUserType, value.attentionUserId, value.mainControl, value.banControl,value.authIcon)) 141 + this.data.push(new FollowListDetailItem(value.attentionHeadPhotoUrl, value.attentionUserName, fansNumString, value.introduction, value.attentionCreatorId, "1", value.attentionUserId, value.attentionUserType, value.attentionUserId, value.mainControl, value.banControl, value.authIcon))
127 }) 142 })
128 this.data.notifyDataReload() 143 this.data.notifyDataReload()
129 this.count = this.data.totalCount() 144 this.count = this.data.totalCount()
@@ -134,12 +149,15 @@ export struct FollowListDetailUI { @@ -134,12 +149,15 @@ export struct FollowListDetailUI {
134 } 149 }
135 } 150 }
136 this.isLoading = false 151 this.isLoading = false
  152 + this.isGetRequest = true
137 }).catch((err: Error) => { 153 }).catch((err: Error) => {
138 console.log(TAG, "请求失败") 154 console.log(TAG, "请求失败")
  155 + this.isGetRequest = true
139 this.isLoading = false 156 this.isLoading = false
140 }) 157 })
141 - }else { 158 + } else {
142 this.isLoading = false 159 this.isLoading = false
  160 + this.isGetRequest = true
143 } 161 }
144 } 162 }
145 163
@@ -161,6 +179,7 @@ export struct FollowListDetailUI { @@ -161,6 +179,7 @@ export struct FollowListDetailUI {
161 }).catch((err: Error) => { 179 }).catch((err: Error) => {
162 console.log(TAG, "请求失败") 180 console.log(TAG, "请求失败")
163 this.isLoading = false 181 this.isLoading = false
  182 + this.isGetRequest = true
164 }) 183 })
165 } 184 }
166 } 185 }
@@ -169,7 +188,7 @@ export struct FollowListDetailUI { @@ -169,7 +188,7 @@ export struct FollowListDetailUI {
169 getFollowListStatus(result: MineFollowListDetailItem) { 188 getFollowListStatus(result: MineFollowListDetailItem) {
170 let data_temp: FollowListDetailItem[] = [] 189 let data_temp: FollowListDetailItem[] = []
171 result.list.forEach((item) => { 190 result.list.forEach((item) => {
172 - data_temp.push(new FollowListDetailItem(item.headPhotoUrl, item.cnUserName, item.cnFansNum, item.introduction, item.creatorId, "0", item.attentionUserId, item.cnUserType, item.cnUserId, item.cnMainControl, -1,item.authIcon)) 191 + data_temp.push(new FollowListDetailItem(item.headPhotoUrl, item.cnUserName, item.cnFansNum, item.introduction, item.creatorId, "0", item.attentionUserId, item.cnUserType, item.cnUserId, item.cnMainControl, -1, item.authIcon))
173 }) 192 })
174 let request = new CreatorDetailRequestItem() 193 let request = new CreatorDetailRequestItem()
175 194
@@ -206,6 +225,7 @@ export struct FollowListDetailUI { @@ -206,6 +225,7 @@ export struct FollowListDetailUI {
206 console.log(TAG, JSON.stringify(err)) 225 console.log(TAG, JSON.stringify(err))
207 this.isLoading = false 226 this.isLoading = false
208 this.count = this.count === -1 ? 0 : this.count 227 this.count = this.count === -1 ? 0 : this.count
  228 + this.isGetRequest = true
209 }) 229 })
210 } 230 }
211 231
@@ -225,7 +245,7 @@ export struct FollowListDetailUI { @@ -225,7 +245,7 @@ export struct FollowListDetailUI {
225 }) 245 })
226 246
227 result.forEach((item) => { 247 result.forEach((item) => {
228 - this.data.push(new FollowListDetailItem(item.headPhotoUrl, item.cnUserName, item.cnFansNum, item.introduction, item.creatorId, item.status, item.attentionUserId, item.cnUserType, item.cnUserId, item.mainControl, item.banControl,item.authIcon)) 248 + this.data.push(new FollowListDetailItem(item.headPhotoUrl, item.cnUserName, item.cnFansNum, item.introduction, item.creatorId, item.status, item.attentionUserId, item.cnUserType, item.cnUserId, item.mainControl, item.banControl, item.authIcon))
229 }) 249 })
230 250
231 this.data.notifyDataReload() 251 this.data.notifyDataReload()
@@ -238,9 +258,11 @@ export struct FollowListDetailUI { @@ -238,9 +258,11 @@ export struct FollowListDetailUI {
238 } 258 }
239 259
240 this.isLoading = false 260 this.isLoading = false
  261 + this.isGetRequest = true
241 }).catch((err: Error) => { 262 }).catch((err: Error) => {
242 console.log(TAG, "请求失败") 263 console.log(TAG, "请求失败")
243 this.isLoading = false 264 this.isLoading = false
  265 + this.isGetRequest = true
244 }) 266 })
245 } 267 }
246 } 268 }
@@ -27,6 +27,7 @@ export struct HomePageBottomComponent{ @@ -27,6 +27,7 @@ export struct HomePageBottomComponent{
27 @State userId:string = ""; 27 @State userId:string = "";
28 @Link commentNum:number 28 @Link commentNum:number
29 preferences: dataPreferences.Preferences | null = null; 29 preferences: dataPreferences.Preferences | null = null;
  30 + @State isGetRequest:boolean = false
30 31
31 aboutToAppear(){ 32 aboutToAppear(){
32 this.getNewPageData() 33 this.getNewPageData()
@@ -39,10 +40,11 @@ export struct HomePageBottomComponent{ @@ -39,10 +40,11 @@ export struct HomePageBottomComponent{
39 if (key == UserDataLocal.USER_FOLLOW_OPERATION) { 40 if (key == UserDataLocal.USER_FOLLOW_OPERATION) {
40 let value = SPHelper.default.getSync(UserDataLocal.USER_FOLLOW_OPERATION,"") as string 41 let value = SPHelper.default.getSync(UserDataLocal.USER_FOLLOW_OPERATION,"") as string
41 let arr = value.split(',') 42 let arr = value.split(',')
42 - if(arr!=null && arr.length === 2){ 43 + if(arr[1] == "0"){
43 this.data_follow.getDataArray().forEach((element,index) => { 44 this.data_follow.getDataArray().forEach((element,index) => {
44 - if (element.creatorId === arr[1]) { 45 + if (element.creatorId === arr[0]) {
45 this.data_follow.deleteItem(index) 46 this.data_follow.deleteItem(index)
  47 + this.count = this.data_follow.size()
46 } 48 }
47 }); 49 });
48 }else{ 50 }else{
@@ -62,12 +64,14 @@ export struct HomePageBottomComponent{ @@ -62,12 +64,14 @@ export struct HomePageBottomComponent{
62 64
63 build(){ 65 build(){
64 Column(){ 66 Column(){
  67 + if(this.isGetRequest == true){
65 Divider().width('100%') 68 Divider().width('100%')
66 .height('2lpx') 69 .height('2lpx')
67 .strokeWidth('1lpx') 70 .strokeWidth('1lpx')
68 .backgroundColor($r('app.color.color_EDEDED')) 71 .backgroundColor($r('app.color.color_EDEDED'))
  72 + }
69 73
70 - if(this.count === 0){ 74 + if(this.count === 0 ){
71 if(this.style === 1){ 75 if(this.style === 1){
72 Column(){ 76 Column(){
73 Row(){ 77 Row(){
@@ -92,15 +96,19 @@ export struct HomePageBottomComponent{ @@ -92,15 +96,19 @@ export struct HomePageBottomComponent{
92 let params = {'index': "1"} as Record<string, string> 96 let params = {'index': "1"} as Record<string, string>
93 WDRouterRule.jumpWithPage(WDRouterPage.followListPage,params) 97 WDRouterRule.jumpWithPage(WDRouterPage.followListPage,params)
94 }) 98 })
95 - 99 + if(this.isGetRequest == true){
96 EmptyComponent({emptyType:14}) 100 EmptyComponent({emptyType:14})
97 .layoutWeight(1) 101 .layoutWeight(1)
98 .width('100%') 102 .width('100%')
  103 + }
99 }.layoutWeight(1) 104 }.layoutWeight(1)
100 .justifyContent(FlexAlign.Start) 105 .justifyContent(FlexAlign.Start)
101 }else{ 106 }else{
102 - ListHasNoMoreDataUI({style:2}) 107 + if(this.isGetRequest == true){
  108 + EmptyComponent({emptyType:11})
103 .layoutWeight(1) 109 .layoutWeight(1)
  110 + .width('100%')
  111 + }
104 } 112 }
105 }else{ 113 }else{
106 if(this.style === 1){ 114 if(this.style === 1){
@@ -244,12 +252,15 @@ export struct HomePageBottomComponent{ @@ -244,12 +252,15 @@ export struct HomePageBottomComponent{
244 } 252 }
245 } 253 }
246 this.isLoading = false 254 this.isLoading = false
  255 + this.isGetRequest = true
247 }).catch((err:Error)=>{ 256 }).catch((err:Error)=>{
248 console.log(TAG,"请求失败") 257 console.log(TAG,"请求失败")
249 this.isLoading = false 258 this.isLoading = false
  259 + this.isGetRequest = true
250 }) 260 })
251 }else{ 261 }else{
252 this.isLoading = false 262 this.isLoading = false
  263 + this.isGetRequest = true
253 } 264 }
254 } 265 }
255 266
@@ -266,17 +277,18 @@ export struct HomePageBottomComponent{ @@ -266,17 +277,18 @@ export struct HomePageBottomComponent{
266 MinePageDatasModel.getMineCommentListData(time,object,getContext(this)).then((value)=>{ 277 MinePageDatasModel.getMineCommentListData(time,object,getContext(this)).then((value)=>{
267 if (!this.data_comment || value.list.length == 0){ 278 if (!this.data_comment || value.list.length == 0){
268 this.hasMore = false 279 this.hasMore = false
  280 + this.isLoading = false
269 }else{ 281 }else{
270 this.getCommentListStatus(value) 282 this.getCommentListStatus(value)
271 } 283 }
272 - this.isLoading = false  
273 - this.commentNum = value.totalCount  
274 }).catch((err:Error)=>{ 284 }).catch((err:Error)=>{
275 console.log(TAG,"请求失败") 285 console.log(TAG,"请求失败")
276 this.isLoading = false 286 this.isLoading = false
  287 + this.isGetRequest = true
277 }) 288 })
278 }else{ 289 }else{
279 this.isLoading = false 290 this.isLoading = false
  291 + this.isGetRequest = true
280 } 292 }
281 } 293 }
282 } 294 }
@@ -329,9 +341,11 @@ export struct HomePageBottomComponent{ @@ -329,9 +341,11 @@ export struct HomePageBottomComponent{
329 } 341 }
330 342
331 this.isLoading = false 343 this.isLoading = false
  344 + this.isGetRequest = true
332 }).catch((err:Error)=>{ 345 }).catch((err:Error)=>{
333 console.log(TAG,"请求失败") 346 console.log(TAG,"请求失败")
334 this.isLoading = false 347 this.isLoading = false
  348 + this.isGetRequest = true
335 }) 349 })
336 } 350 }
337 351
@@ -6,50 +6,61 @@ import { ListHasNoMoreDataUI } from '../../reusable/ListHasNoMoreDataUI'; @@ -6,50 +6,61 @@ import { ListHasNoMoreDataUI } from '../../reusable/ListHasNoMoreDataUI';
6 import { MineCommentListDetailItem } from '../../../viewmodel/MineCommentListDetailItem'; 6 import { MineCommentListDetailItem } from '../../../viewmodel/MineCommentListDetailItem';
7 import { OtherUserCommentLikeStatusRequestItem } from '../../../viewmodel/OtherUserCommentLikeStatusRequestItem'; 7 import { OtherUserCommentLikeStatusRequestItem } from '../../../viewmodel/OtherUserCommentLikeStatusRequestItem';
8 import { ChildCommentComponent } from './ChildCommentComponent'; 8 import { ChildCommentComponent } from './ChildCommentComponent';
  9 +import { EmptyComponent } from '../../view/EmptyComponent';
9 10
10 const TAG = "HomePageBottomComponent" 11 const TAG = "HomePageBottomComponent"
  12 +
11 @Component 13 @Component
12 -export struct OtherHomePageBottomCommentComponent{ 14 +export struct OtherHomePageBottomCommentComponent {
13 @Prop curUserId: string 15 @Prop curUserId: string
14 @State data_comment: LazyDataSource<CommentListItem> = new LazyDataSource(); 16 @State data_comment: LazyDataSource<CommentListItem> = new LazyDataSource();
15 - @State isLoading:boolean = false  
16 - @State hasMore:boolean = true  
17 - curPageNum:number = 1;  
18 - @State count:number = 0;  
19 - @Prop levelHead:string  
20 - @Link commentNum:number  
21 -  
22 - aboutToAppear(){ 17 + @State isLoading: boolean = false
  18 + @State hasMore: boolean = true
  19 + curPageNum: number = 1;
  20 + @State count: number = 0;
  21 + @Prop levelHead: string
  22 + @Link commentNum: number
  23 + @State isGetRequest: boolean = false
  24 +
  25 + aboutToAppear() {
23 this.getNewPageData() 26 this.getNewPageData()
24 } 27 }
25 28
26 - build(){  
27 - Column(){ 29 + build() {
  30 + Column() {
28 Divider().width('100%') 31 Divider().width('100%')
29 .height('2lpx') 32 .height('2lpx')
30 .strokeWidth('1lpx') 33 .strokeWidth('1lpx')
31 .backgroundColor($r('app.color.color_EDEDED')) 34 .backgroundColor($r('app.color.color_EDEDED'))
32 35
33 - if(this.count === 0){  
34 - ListHasNoMoreDataUI({style:2}) 36 + if (this.count === 0) {
  37 + if (this.isGetRequest == true) {
  38 + EmptyComponent({emptyType:11})
35 .height('100%') 39 .height('100%')
36 - }else{ 40 + .layoutWeight(1)
  41 + }
  42 + } else {
37 List({ space: 3 }) { 43 List({ space: 3 }) {
38 LazyForEach(this.data_comment, (item: CommentListItem, index: number = 0) => { 44 LazyForEach(this.data_comment, (item: CommentListItem, index: number = 0) => {
39 ListItem() { 45 ListItem() {
40 - ChildCommentComponent({data: item,levelHead:this.levelHead,isLastItem:index===this.data_comment.totalCount()-1}) 46 + ChildCommentComponent({
  47 + data: item,
  48 + levelHead: this.levelHead,
  49 + isLastItem: index === this.data_comment.totalCount() - 1
  50 + })
41 } 51 }
42 .onClick(() => { 52 .onClick(() => {
43 }) 53 })
44 }, (item: CommentListItem, index: number) => index.toString()) 54 }, (item: CommentListItem, index: number) => index.toString())
45 55
46 //没有更多数据 显示提示 56 //没有更多数据 显示提示
47 - if(!this.hasMore){  
48 - ListItem(){ 57 + if (!this.hasMore) {
  58 + ListItem() {
49 ListHasNoMoreDataUI() 59 ListHasNoMoreDataUI()
50 } 60 }
51 } 61 }
52 - }.cachedCount(15) 62 + }
  63 + .cachedCount(15)
53 .layoutWeight(1) 64 .layoutWeight(1)
54 .scrollBar(BarState.Off) 65 .scrollBar(BarState.Off)
55 .edgeEffect(EdgeEffect.None) 66 .edgeEffect(EdgeEffect.None)
@@ -57,9 +68,9 @@ export struct OtherHomePageBottomCommentComponent{ @@ -57,9 +68,9 @@ export struct OtherHomePageBottomCommentComponent{
57 scrollForward: NestedScrollMode.PARENT_FIRST, 68 scrollForward: NestedScrollMode.PARENT_FIRST,
58 scrollBackward: NestedScrollMode.SELF_FIRST 69 scrollBackward: NestedScrollMode.SELF_FIRST
59 }) 70 })
60 - .onReachEnd(()=>{  
61 - console.log(TAG,"触底了");  
62 - if(!this.isLoading){ 71 + .onReachEnd(() => {
  72 + console.log(TAG, "触底了");
  73 + if (!this.isLoading) {
63 this.isLoading = true 74 this.isLoading = true
64 //加载分页数据 75 //加载分页数据
65 this.getNewPageData() 76 this.getNewPageData()
@@ -72,7 +83,6 @@ export struct OtherHomePageBottomCommentComponent{ @@ -72,7 +83,6 @@ export struct OtherHomePageBottomCommentComponent{
72 .justifyContent(FlexAlign.Start) 83 .justifyContent(FlexAlign.Start)
73 } 84 }
74 85
75 -  
76 @Styles 86 @Styles
77 listStyle() { 87 listStyle() {
78 .backgroundColor(Color.White) 88 .backgroundColor(Color.White)
@@ -81,60 +91,64 @@ export struct OtherHomePageBottomCommentComponent{ @@ -81,60 +91,64 @@ export struct OtherHomePageBottomCommentComponent{
81 .borderRadius(12) 91 .borderRadius(12)
82 } 92 }
83 93
84 - getNewPageData(){ 94 + getNewPageData() {
85 this.isLoading = true 95 this.isLoading = true
86 - if(this.hasMore){ 96 + if (this.hasMore) {
87 let time = encodeURI(DateTimeUtils.getCurDate(DateTimeUtils.PATTERN_DATE_TIME_HYPHEN)) 97 let time = encodeURI(DateTimeUtils.getCurDate(DateTimeUtils.PATTERN_DATE_TIME_HYPHEN))
88 - let object = new OtherUserCommentListRequestItem("",20,this.curPageNum,time,"1",this.curUserId) 98 + let object = new OtherUserCommentListRequestItem("", 20, this.curPageNum, time, "1", this.curUserId)
89 99
90 - MinePageDatasModel.getOtherCommentListData(object,getContext(this)).then((value)=>{  
91 - if (!this.data_comment || value.list.length == 0){ 100 + MinePageDatasModel.getOtherCommentListData(object, getContext(this)).then((value) => {
  101 + if (!this.data_comment || value.list.length == 0) {
92 this.hasMore = false 102 this.hasMore = false
93 this.isLoading = false 103 this.isLoading = false
94 - }else{ 104 + } else {
95 this.getCommentListStatus(value) 105 this.getCommentListStatus(value)
96 } 106 }
97 - }).catch((err:Error)=>{  
98 - console.log(TAG,"请求失败") 107 + }).catch((err: Error) => {
  108 + console.log(TAG, "请求失败")
99 this.isLoading = false 109 this.isLoading = false
  110 + this.isGetRequest = true
100 }) 111 })
  112 + } else {
  113 + this.isGetRequest = true
  114 + this.isLoading = false
101 } 115 }
102 } 116 }
103 117
104 - getCommentListStatus(value:MineCommentListDetailItem){ 118 + getCommentListStatus(value: MineCommentListDetailItem) {
105 119
106 let status = new OtherUserCommentLikeStatusRequestItem() 120 let status = new OtherUserCommentLikeStatusRequestItem()
107 - let data : CommentListItem[] = []  
108 - value.list.forEach((item)=>{  
109 - if(item.checkStatus === 2){ 121 + let data: CommentListItem[] = []
  122 + value.list.forEach((item) => {
  123 + if (item.checkStatus === 2) {
110 status.commentIdList.push(item.id) 124 status.commentIdList.push(item.id)
111 } 125 }
112 let commentContent = item.commentContent 126 let commentContent = item.commentContent
113 - if(item.sensitiveShow === 0 && item.sensitiveExist === 1){ 127 + if (item.sensitiveShow === 0 && item.sensitiveExist === 1) {
114 commentContent = item.commentContentSensitive 128 commentContent = item.commentContentSensitive
115 } 129 }
116 let parentCommentContent = "" 130 let parentCommentContent = ""
117 - if(item.parentCommentVo!=null ){ 131 + if (item.parentCommentVo != null) {
118 parentCommentContent = item.parentCommentVo.commentContent 132 parentCommentContent = item.parentCommentVo.commentContent
119 } 133 }
120 let parentCommentUserName = "" 134 let parentCommentUserName = ""
121 - if(item.parentCommentVo!=null ){ 135 + if (item.parentCommentVo != null) {
122 parentCommentUserName = item.parentCommentVo.fromUserName 136 parentCommentUserName = item.parentCommentVo.fromUserName
123 } 137 }
124 - data.push(new CommentListItem(item.fromUserHeader,item.fromUserName,item.targetTitle,item.createTime,commentContent,item.likeNum,0,item.id,item.targetId,item.targetType,item.targetRelId,item.targetRelObjectId,item.targetRelType,item.targetStatus,item.checkStatus,parentCommentContent,parentCommentUserName)) 138 + data.push(new CommentListItem(item.fromUserHeader, item.fromUserName, item.targetTitle, item.createTime, commentContent, item.likeNum, 0, item.id, item.targetId, item.targetType, item.targetRelId, item.targetRelObjectId, item.targetRelType, item.targetStatus, item.checkStatus, parentCommentContent, parentCommentUserName))
125 }) 139 })
126 140
127 - MinePageDatasModel.getOtherUserCommentLikeStatusData(status,getContext(this)).then((newValue)=>{  
128 - newValue.forEach((item)=>{  
129 - data.forEach((list)=>{ 141 + MinePageDatasModel.getOtherUserCommentLikeStatusData(status, getContext(this)).then((newValue) => {
  142 + newValue.forEach((item) => {
  143 + data.forEach((list) => {
130 if (item.commentId == list.id) { 144 if (item.commentId == list.id) {
131 list.like_status = item.status 145 list.like_status = item.status
132 } 146 }
133 }) 147 })
134 }) 148 })
135 149
136 - data.forEach((item)=>{  
137 - this.data_comment.push(new CommentListItem(item.fromUserHeader,item.fromUserName,item.targetTitle,item.createTime,item.commentContent,item.likeNum,item.like_status,item.id,item.targetId,item.targetType,item.targetRelId,item.targetRelObjectId,item.targetRelType,item.targetStatus,item.checkStatus,item.parentCommentContent,item.parentCommentUserName)) 150 + data.forEach((item) => {
  151 + this.data_comment.push(new CommentListItem(item.fromUserHeader, item.fromUserName, item.targetTitle, item.createTime, item.commentContent, item.likeNum, item.like_status, item.id, item.targetId, item.targetType, item.targetRelId, item.targetRelObjectId, item.targetRelType, item.targetStatus, item.checkStatus, item.parentCommentContent, item.parentCommentUserName))
138 }) 152 })
139 153
140 this.data_comment.notifyDataReload() 154 this.data_comment.notifyDataReload()
@@ -143,14 +157,16 @@ export struct OtherHomePageBottomCommentComponent{ @@ -143,14 +157,16 @@ export struct OtherHomePageBottomCommentComponent{
143 this.commentNum = value.totalCount 157 this.commentNum = value.totalCount
144 if (this.data_comment.totalCount() < value.totalCount) { 158 if (this.data_comment.totalCount() < value.totalCount) {
145 this.curPageNum++ 159 this.curPageNum++
146 - }else { 160 + } else {
147 this.hasMore = false 161 this.hasMore = false
148 } 162 }
149 163
150 this.isLoading = false 164 this.isLoading = false
151 - }).catch((err:Error)=>{  
152 - console.log(TAG,"请求失败") 165 + this.isGetRequest = true
  166 + }).catch((err: Error) => {
  167 + console.log(TAG, "请求失败")
153 this.isLoading = false 168 this.isLoading = false
  169 + this.isGetRequest = true
154 }) 170 })
155 } 171 }
156 } 172 }
@@ -17,6 +17,7 @@ export struct OtherHomePageBottomFollowComponent{ @@ -17,6 +17,7 @@ export struct OtherHomePageBottomFollowComponent{
17 curPageNum:number = 1; 17 curPageNum:number = 1;
18 @State count:number = 0; 18 @State count:number = 0;
19 @Prop curUserId: string 19 @Prop curUserId: string
  20 + @State isGetRequest:boolean = false
20 21
21 22
22 aboutToAppear(){ 23 aboutToAppear(){
@@ -54,10 +55,11 @@ export struct OtherHomePageBottomFollowComponent{ @@ -54,10 +55,11 @@ export struct OtherHomePageBottomFollowComponent{
54 let params = {'index': "1"} as Record<string, string> 55 let params = {'index': "1"} as Record<string, string>
55 WDRouterRule.jumpWithPage(WDRouterPage.followListPage,params) 56 WDRouterRule.jumpWithPage(WDRouterPage.followListPage,params)
56 }) 57 })
57 - 58 + if(this.isGetRequest == true){
58 EmptyComponent({emptyType:14}) 59 EmptyComponent({emptyType:14})
59 .layoutWeight(1) 60 .layoutWeight(1)
60 .width('100%') 61 .width('100%')
  62 + }
61 }.layoutWeight(1) 63 }.layoutWeight(1)
62 .justifyContent(FlexAlign.Start) 64 .justifyContent(FlexAlign.Start)
63 }else{ 65 }else{
@@ -155,10 +157,15 @@ export struct OtherHomePageBottomFollowComponent{ @@ -155,10 +157,15 @@ export struct OtherHomePageBottomFollowComponent{
155 } 157 }
156 } 158 }
157 this.isLoading = false 159 this.isLoading = false
  160 + this.isGetRequest = true
158 }).catch((err:Error)=>{ 161 }).catch((err:Error)=>{
159 console.log(TAG,"请求失败") 162 console.log(TAG,"请求失败")
160 this.isLoading = false 163 this.isLoading = false
  164 + this.isGetRequest = true
161 }) 165 })
  166 + }else{
  167 + this.isGetRequest = true
  168 + this.isLoading = false
162 } 169 }
163 } 170 }
164 } 171 }
@@ -63,8 +63,4 @@ export struct SearchRelatedComponent { @@ -63,8 +63,4 @@ export struct SearchRelatedComponent {
63 .padding({ left: '31lpx', right: '31lpx' }) 63 .padding({ left: '31lpx', right: '31lpx' })
64 } 64 }
65 65
66 - test(){  
67 - let c = "12121212121"  
68 -  
69 - }  
70 } 66 }
@@ -36,7 +36,7 @@ export struct SearchResultComponent { @@ -36,7 +36,7 @@ export struct SearchResultComponent {
36 getSuggestData() { 36 getSuggestData() {
37 this.isLoading = true 37 this.isLoading = true
38 38
39 - let request: SearchSuggestRequestItem = new SearchSuggestRequestItem(2, "", "", HttpUrlUtils.getImei(), UserDataLocal.userId, 8, "") 39 + let request: SearchSuggestRequestItem = new SearchSuggestRequestItem(2, "", "", HttpUrlUtils.getImei(), UserDataLocal.getUserId(), 8, "")
40 40
41 SearcherAboutDataModel.getSearchSuggestData(request, getContext(this)).then((value) => { 41 SearcherAboutDataModel.getSearchSuggestData(request, getContext(this)).then((value) => {
42 value.forEach((item) => { 42 value.forEach((item) => {
@@ -9,7 +9,6 @@ export struct AboutPageUI { @@ -9,7 +9,6 @@ export struct AboutPageUI {
9 @State listData: Array<string | Array<string>> = ['隐私授权协议', '软件许可及用户协议']; 9 @State listData: Array<string | Array<string>> = ['隐私授权协议', '软件许可及用户协议'];
10 @State message: string = '京ICP备16066560号-6A Copyright © 人民日报客户端\nall rights reserved.' 10 @State message: string = '京ICP备16066560号-6A Copyright © 人民日报客户端\nall rights reserved.'
11 @State version: string = '版本号:v' 11 @State version: string = '版本号:v'
12 - clickTimes: number = 0  
13 dialogController: CustomDialogController = new CustomDialogController({ 12 dialogController: CustomDialogController = new CustomDialogController({
14 builder: EnvironmentCustomDialog({ 13 builder: EnvironmentCustomDialog({
15 cancel: () => { 14 cancel: () => {
@@ -42,12 +41,12 @@ export struct AboutPageUI { @@ -42,12 +41,12 @@ export struct AboutPageUI {
42 .width('278lpx') 41 .width('278lpx')
43 .height('154lpx') 42 .height('154lpx')
44 .margin({ top: '173lpx', bottom: '154lpx' }) 43 .margin({ top: '173lpx', bottom: '154lpx' })
45 - .onClick(() => {  
46 - this.clickTimes++  
47 - if (this.clickTimes > 2) { 44 + .gesture(
  45 + TapGesture({ count: 2 })
  46 + .onAction((event: GestureEvent) => {
48 this.dialogController.open() 47 this.dialogController.open()
49 - }  
50 }) 48 })
  49 + )
51 // Row(){ 50 // Row(){
52 // 51 //
53 // }.backgroundColor(Color.Yellow) 52 // }.backgroundColor(Color.Yellow)
1 import { SPHelper } from 'wdKit/Index'; 1 import { SPHelper } from 'wdKit/Index';
2 -import { HttpUrlUtils } from 'wdNetwork/Index'; 2 +import { HostEnum, HostManager, HttpUrlUtils } from 'wdNetwork/Index';
3 3
4 @CustomDialog 4 @CustomDialog
5 export struct EnvironmentCustomDialog { 5 export struct EnvironmentCustomDialog {
6 - currentEnvironment: string = HttpUrlUtils.HOST_PRODUCT; 6 + @State currentEnvironment: string = HostManager.getHost();
7 controller: CustomDialogController 7 controller: CustomDialogController
8 cancel: () => void = () => { 8 cancel: () => void = () => {
9 } 9 }
@@ -21,12 +21,12 @@ export struct EnvironmentCustomDialog { @@ -21,12 +21,12 @@ export struct EnvironmentCustomDialog {
21 .margin({ top: 20 }) 21 .margin({ top: 20 })
22 Row() { 22 Row() {
23 Radio({ value: 'Radio1', group: 'radioGroup' }) 23 Radio({ value: 'Radio1', group: 'radioGroup' })
24 - .checked(true) 24 + .checked(this.currentEnvironment == HostEnum.HOST_SIT)
25 .height(20) 25 .height(20)
26 .width(20) 26 .width(20)
27 .onChange((isChecked: boolean) => { 27 .onChange((isChecked: boolean) => {
28 if (isChecked) { 28 if (isChecked) {
29 - this.currentEnvironment = HttpUrlUtils.HOST_SIT; 29 + this.currentEnvironment = HostEnum.HOST_SIT;
30 } 30 }
31 }) 31 })
32 Text('切换到SIT(测试)环境,重启应用生效') 32 Text('切换到SIT(测试)环境,重启应用生效')
@@ -37,12 +37,12 @@ export struct EnvironmentCustomDialog { @@ -37,12 +37,12 @@ export struct EnvironmentCustomDialog {
37 37
38 Row() { 38 Row() {
39 Radio({ value: 'Radio1', group: 'radioGroup' }) 39 Radio({ value: 'Radio1', group: 'radioGroup' })
40 - .checked(true) 40 + .checked(this.currentEnvironment == HostEnum.HOST_UAT)
41 .height(20) 41 .height(20)
42 .width(20) 42 .width(20)
43 .onChange((isChecked: boolean) => { 43 .onChange((isChecked: boolean) => {
44 if (isChecked) { 44 if (isChecked) {
45 - this.currentEnvironment = HttpUrlUtils.HOST_UAT; 45 + this.currentEnvironment = HostEnum.HOST_UAT;
46 } 46 }
47 }) 47 })
48 Text('切换到UAT(预发布)环境,重启应用生效') 48 Text('切换到UAT(预发布)环境,重启应用生效')
@@ -53,12 +53,12 @@ export struct EnvironmentCustomDialog { @@ -53,12 +53,12 @@ export struct EnvironmentCustomDialog {
53 53
54 Row() { 54 Row() {
55 Radio({ value: 'Radio1', group: 'radioGroup' }) 55 Radio({ value: 'Radio1', group: 'radioGroup' })
56 - .checked(true) 56 + .checked(this.currentEnvironment == HostEnum.HOST_PRODUCT)
57 .height(20) 57 .height(20)
58 .width(20) 58 .width(20)
59 .onChange((isChecked: boolean) => { 59 .onChange((isChecked: boolean) => {
60 if (isChecked) { 60 if (isChecked) {
61 - this.currentEnvironment = HttpUrlUtils.HOST_PRODUCT; 61 + this.currentEnvironment = HostEnum.HOST_PRODUCT;
62 } 62 }
63 }) 63 })
64 Text('切换到PROD(现网)环境,重启应用生效') 64 Text('切换到PROD(现网)环境,重启应用生效')
@@ -69,12 +69,12 @@ export struct EnvironmentCustomDialog { @@ -69,12 +69,12 @@ export struct EnvironmentCustomDialog {
69 69
70 Row() { 70 Row() {
71 Radio({ value: 'Radio1', group: 'radioGroup' }) 71 Radio({ value: 'Radio1', group: 'radioGroup' })
72 - .checked(true) 72 + .checked(this.currentEnvironment == HostEnum.HOST_DEV)
73 .height(20) 73 .height(20)
74 .width(20) 74 .width(20)
75 .onChange((isChecked: boolean) => { 75 .onChange((isChecked: boolean) => {
76 if (isChecked) { 76 if (isChecked) {
77 - this.currentEnvironment = HttpUrlUtils.HOST_DEV; 77 + this.currentEnvironment = HostEnum.HOST_DEV;
78 } 78 }
79 }) 79 })
80 Text('切换到DEV(开发)环境,重启应用生效') 80 Text('切换到DEV(开发)环境,重启应用生效')
@@ -29,7 +29,7 @@ export struct HorizontalStrokeCardThreeTwoRadioForMoreComponent { @@ -29,7 +29,7 @@ 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) 32 + .visibility(this.compDTO?.objectType === '0' || this.compDTO?.objectType === '' ? Visibility.None : Visibility.Visible)
33 .onClick(() => { 33 .onClick(() => {
34 if (this.compDTO?.objectType === '11') { 34 if (this.compDTO?.objectType === '11') {
35 ProcessUtils.jumpChannelTab(this.compDTO.objectId, this.compDTO.pageId as string) 35 ProcessUtils.jumpChannelTab(this.compDTO.objectId, this.compDTO.pageId as string)
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 +import { SPHelper } from 'wdKit';
  4 +import { WDRouterPage, WDRouterRule } from 'wdRouter/Index';
  5 +import { SpConstants } from 'wdConstant/Index';
  6 +
3 7
4 const TAG = 'LikeComponent'; 8 const TAG = 'LikeComponent';
5 9
@@ -9,6 +13,8 @@ export struct LikeComponent { @@ -9,6 +13,8 @@ export struct LikeComponent {
9 viewModel: LikeViewModel = new LikeViewModel() 13 viewModel: LikeViewModel = new LikeViewModel()
10 @Prop data: Record<string, string> 14 @Prop data: Record<string, string>
11 enableBtn = true 15 enableBtn = true
  16 + componentType : number = 1 //1: 底部栏目样式 2: 新闻页中间位置样式
  17 + @State likeCount: number = 0 //点赞数
12 18
13 //上层传值 样例 19 //上层传值 样例
14 // this.data['contentId'] = '30035444649' //必须 20 // this.data['contentId'] = '30035444649' //必须
@@ -23,16 +29,77 @@ export struct LikeComponent { @@ -23,16 +29,77 @@ export struct LikeComponent {
23 if (this.data) { 29 if (this.data) {
24 //获取点赞状态 30 //获取点赞状态
25 this.getLikeStatus() 31 this.getLikeStatus()
  32 + //获取点赞数
  33 + this.getLikeCount()
26 } 34 }
27 35
28 } 36 }
29 37
30 build() { 38 build() {
  39 + if (this.componentType == 2){
  40 + //2: 新闻页中间位置样式
  41 + Column() {
  42 +
  43 + Button(){
  44 +
  45 + Row(){
  46 + Image(this.likeStatus ? $r('app.media.icon_like_select') : $r('app.media.icon_like_default'))
  47 + .width(20)
  48 + .height(20)
  49 + Text(this.likeCount.toString())
  50 + .height(20)
  51 + .margin({
  52 + right: 0,
  53 + left: 4
  54 + })
  55 + .fontColor(this.likeStatus ? '#ED2800' : '#222222')
  56 + .fontSize('16')
  57 + }
  58 + .justifyContent(FlexAlign.Center)
  59 + .width('100%')
  60 + .height('100%')
  61 +
  62 + }
  63 + .width('100%')
  64 + .height('100%')
  65 + .backgroundColor(Color.White)
  66 + .type(ButtonType.Capsule)
  67 + .borderColor('#EDEDED')
  68 + .borderRadius(20)
  69 + .borderWidth(1)
  70 + .onClick(()=>{
  71 +
  72 + this.clickButtonEvent()
  73 +
  74 + })
  75 +
  76 + }
  77 + .width(154)
  78 + .height(40)
  79 +
  80 +
  81 + }else {
  82 + //1: 底部栏目样式 默认样式
31 Column() { 83 Column() {
32 Image(this.likeStatus ? $r('app.media.icon_like_select') : $r('app.media.icon_like_default')) 84 Image(this.likeStatus ? $r('app.media.icon_like_select') : $r('app.media.icon_like_default'))
33 .width(24) 85 .width(24)
34 .height(24) 86 .height(24)
35 .onClick(() => { 87 .onClick(() => {
  88 + this.clickButtonEvent()
  89 + })
  90 + }.width(24).height(24)
  91 + }
  92 +
  93 + }
  94 +
  95 + async clickButtonEvent(){
  96 + // 未登录,跳转登录
  97 + const user_id = await SPHelper.default.get(SpConstants.USER_ID, '')
  98 + if (!user_id) {
  99 + WDRouterRule.jumpWithPage(WDRouterPage.loginPage)
  100 + return
  101 + }
  102 +
36 if (!this.enableBtn) { 103 if (!this.enableBtn) {
37 return 104 return
38 } 105 }
@@ -43,14 +110,19 @@ export struct LikeComponent { @@ -43,14 +110,19 @@ export struct LikeComponent {
43 //0 110 //0
44 this.executeLike('1') 111 this.executeLike('1')
45 } 112 }
46 - })  
47 - }.width(24).height(24) 113 +
48 } 114 }
49 115
50 executeLike(status: string) { 116 executeLike(status: string) {
51 this.data['status'] = status 117 this.data['status'] = status
52 this.viewModel.executeLike2(this.data).then(() => { 118 this.viewModel.executeLike2(this.data).then(() => {
53 this.likeStatus = !this.likeStatus 119 this.likeStatus = !this.likeStatus
  120 + //点赞和取消点赞成功后更新点赞数
  121 + if(this.likeStatus){
  122 + this.likeCount ++
  123 + }else {
  124 + this.likeCount --
  125 + }
54 this.enableBtn = true 126 this.enableBtn = true
55 }).catch(() => { 127 }).catch(() => {
56 this.enableBtn = true 128 this.enableBtn = true
@@ -69,5 +141,19 @@ export struct LikeComponent { @@ -69,5 +141,19 @@ export struct LikeComponent {
69 }) 141 })
70 } 142 }
71 143
  144 + //获取点赞数
  145 + getLikeCount() {
  146 + this.viewModel.getLikeCount(this.data).then((data) => {
  147 + if (data && data['data']) {
  148 + this.likeCount = data['data']['likeNum']
  149 + }else {
  150 + this.likeCount = 0
  151 + }
  152 + }).catch(() => {
  153 + this.likeCount = 0
  154 + })
  155 + }
  156 +
  157 +
72 158
73 } 159 }
@@ -13,6 +13,7 @@ import router from '@ohos.router'; @@ -13,6 +13,7 @@ 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 { LikeComponent } from './LikeComponent';
  16 +import { CommentCustomDialog } from '../comment/view/CommentCustomDialog';
16 import { HttpUrlUtils } from 'wdNetwork/Index'; 17 import { HttpUrlUtils } from 'wdNetwork/Index';
17 import { WDRouterPage, WDRouterRule } from 'wdRouter/Index'; 18 import { WDRouterPage, WDRouterRule } from 'wdRouter/Index';
18 import { PageRepository } from '../../repository/PageRepository'; 19 import { PageRepository } from '../../repository/PageRepository';
@@ -27,11 +28,13 @@ export interface OperationItem { @@ -27,11 +28,13 @@ export interface OperationItem {
27 28
28 const TAG = 'OperRowListView'; 29 const TAG = 'OperRowListView';
29 30
30 -@Preview 31 +// @Preview
  32 +@Entry
31 @Component 33 @Component
32 export struct OperRowListView { 34 export struct OperRowListView {
33 // private contentDetailData: ContentDetailDTO = {} as ContentDetailDTO 35 // private contentDetailData: ContentDetailDTO = {} as ContentDetailDTO
34 - @Prop contentDetailData: ContentDetailDTO 36 + // @Prop contentDetailData: ContentDetailDTO
  37 + @State contentDetailData: ContentDetailDTO = {} as ContentDetailDTO
35 @State interactData: InteractDataDTO = {} as InteractDataDTO 38 @State interactData: InteractDataDTO = {} as InteractDataDTO
36 @State newsStatusOfUser: batchLikeAndCollectResult | undefined = undefined // 点赞、收藏状态 39 @State newsStatusOfUser: batchLikeAndCollectResult | undefined = undefined // 点赞、收藏状态
37 @State likeBean: Record<string, string> = {} 40 @State likeBean: Record<string, string> = {}
@@ -71,12 +74,13 @@ export struct OperRowListView { @@ -71,12 +74,13 @@ export struct OperRowListView {
71 // this.data['channelId'] = "2059" //必须 74 // this.data['channelId'] = "2059" //必须
72 // this.data['status'] = "1" //必须 75 // this.data['status'] = "1" //必须
73 this.likeBean['contentId'] = this.contentDetailData.newsId + '' 76 this.likeBean['contentId'] = this.contentDetailData.newsId + ''
74 - this.likeBean['userName'] = this.contentDetailData.editorName + '' 77 + this.likeBean['userName'] = this.contentDetailData.userInfo?.userName + ''
75 this.likeBean['contentType'] = this.contentDetailData.newsType + '' 78 this.likeBean['contentType'] = this.contentDetailData.newsType + ''
76 this.likeBean['title'] = this.contentDetailData.newsTitle + '' 79 this.likeBean['title'] = this.contentDetailData.newsTitle + ''
77 - this.likeBean['userHeaderUrl'] = '' 80 + this.likeBean['userHeaderUrl'] = this.contentDetailData.userInfo?.headPhotoUrl + ''
78 this.likeBean['channelId'] = this.contentDetailData.reLInfo?.channelId + '' 81 this.likeBean['channelId'] = this.contentDetailData.reLInfo?.channelId + ''
79 - this.likeBean['status'] = '' 82 + console.info(TAG, 'contentDetailData----', JSON.stringify(this.contentDetailData))
  83 + console.info(TAG, 'likeBean----', JSON.stringify(this.likeBean))
80 } 84 }
81 85
82 build() { 86 build() {
@@ -100,7 +104,13 @@ export struct OperRowListView { @@ -100,7 +104,13 @@ export struct OperRowListView {
100 .onClick(() => { 104 .onClick(() => {
101 router.back(); 105 router.back();
102 }) 106 })
103 - TextInput({placeholder:'说两句11...'}) 107 + Column() {
  108 + /*评论组件*/
  109 + /* CommentCustomDialog({
  110 + placeHolderText: '说两句'
  111 + })*/
  112 + }
  113 + /*TextInput({placeholder:'说两句...'})
104 .placeholderColor('#999999') 114 .placeholderColor('#999999')
105 .placeholderFont( 115 .placeholderFont(
106 { 116 {
@@ -116,9 +126,9 @@ export struct OperRowListView { @@ -116,9 +126,9 @@ export struct OperRowListView {
116 .borderRadius(0) 126 .borderRadius(0)
117 .onClick(() => { 127 .onClick(() => {
118 this.buildInputMethod() 128 this.buildInputMethod()
119 - }) 129 + })*/
120 } 130 }
121 - .width('45.5%') 131 + // .width('45.5%')
122 .alignItems(VerticalAlign.Center) 132 .alignItems(VerticalAlign.Center)
123 .justifyContent(FlexAlign.Start) 133 .justifyContent(FlexAlign.Start)
124 Flex({ justifyContent: FlexAlign.SpaceAround, alignItems:ItemAlign.Center }) { 134 Flex({ justifyContent: FlexAlign.SpaceAround, alignItems:ItemAlign.Center }) {
@@ -129,8 +139,11 @@ export struct OperRowListView { @@ -129,8 +139,11 @@ export struct OperRowListView {
129 .width('54.5%') 139 .width('54.5%')
130 } 140 }
131 .width('100%') 141 .width('100%')
132 - .height(126) 142 + .height(50)
133 .backgroundColor(Color.Black) 143 .backgroundColor(Color.Black)
  144 + .margin({
  145 + bottom: 20
  146 + })
134 } 147 }
135 /** 148 /**
136 * 组件项 149 * 组件项
@@ -141,9 +154,12 @@ export struct OperRowListView { @@ -141,9 +154,12 @@ export struct OperRowListView {
141 buildOperationItem(item: OperationItem, index: number) { 154 buildOperationItem(item: OperationItem, index: number) {
142 Column() { 155 Column() {
143 if (item.text === '点赞') { 156 if (item.text === '点赞') {
  157 + /*点赞组件*/
  158 + if (this.likeBean?.contentId) {
144 LikeComponent({ 159 LikeComponent({
145 data: this.likeBean 160 data: this.likeBean
146 }) 161 })
  162 + }
147 163
148 /* RelativeContainer() { 164 /* RelativeContainer() {
149 Row() { 165 Row() {
@@ -191,6 +207,7 @@ export struct OperRowListView { @@ -191,6 +207,7 @@ export struct OperRowListView {
191 } 207 }
192 .id(`e_icon_${index}`)*/ 208 .id(`e_icon_${index}`)*/
193 } else if (item.text === '收藏') { 209 } else if (item.text === '收藏') {
  210 +
194 RelativeContainer() { 211 RelativeContainer() {
195 Row() { 212 Row() {
196 Image(this.newsStatusOfUser?.collectStatus == 1 ? item.icon_check : item.icon) 213 Image(this.newsStatusOfUser?.collectStatus == 1 ? item.icon_check : item.icon)
@@ -236,7 +253,7 @@ export struct OperRowListView { @@ -236,7 +253,7 @@ export struct OperRowListView {
236 } 253 }
237 .id(`e_icon_${index}`) 254 .id(`e_icon_${index}`)
238 } else if (item.text === '评论') { 255 } else if (item.text === '评论') {
239 - RelativeContainer() { 256 + /* RelativeContainer() {
240 Row() { 257 Row() {
241 Image(item.icon) 258 Image(item.icon)
242 .width(24) 259 .width(24)
@@ -279,7 +296,7 @@ export struct OperRowListView { @@ -279,7 +296,7 @@ export struct OperRowListView {
279 .id(`e_row3_${index}`) 296 .id(`e_row3_${index}`)
280 } 297 }
281 } 298 }
282 - .id(`e_icon_${index}`) 299 + .id(`e_icon_${index}`)*/
283 } else { 300 } else {
284 RelativeContainer() { 301 RelativeContainer() {
285 Row() { 302 Row() {
@@ -43,5 +43,27 @@ export class LikeModel { @@ -43,5 +43,27 @@ export class LikeModel {
43 43
44 44
45 45
  46 + getLikeCount(data: Record<string, string>) {
  47 + let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();
  48 + let channelId : string = data['channelId']
  49 + let contentId : string = data['contentId']
  50 + let contentType : string = data['contentType']
  51 + let detail : string = '1'
  52 + let url = HttpUrlUtils.getLikeCount() + `?channelId=${channelId}&contentId=${contentId}&contentType=${contentType}&detail=${detail}`
  53 + return new Promise<object>((success, fail) => {
  54 + HttpBizUtil.get<ResponseDTO<object>>(url, headers).then((data: ResponseDTO<object>) => {
  55 + if (data.code != 0) {
  56 + fail(data.message)
  57 + return
  58 + }
  59 + success(data)
  60 + }, (error: Error) => {
  61 + fail(error.message)
  62 + Logger.debug("LoginViewModel:error ", error.toString())
  63 + })
  64 + })
  65 + }
  66 +
  67 +
46 68
47 } 69 }
1 import HashMap from '@ohos.util.HashMap'; 1 import HashMap from '@ohos.util.HashMap';
2 -import { UserDataLocal } from 'wdKit/Index';  
3 -import { HttpUrlUtils, ResponseDTO } from 'wdNetwork';  
4 -import { HttpRequest } from 'wdNetwork/src/main/ets/http/HttpRequest'; 2 +import { HttpBizUtil, HttpUrlUtils, ResponseDTO } from 'wdNetwork';
5 3
6 export class LogoutModel{ 4 export class LogoutModel{
7 5
8 requestLogout(){ 6 requestLogout(){
9 let bean: Record<string, string> = {}; 7 let bean: Record<string, string> = {};
10 - bean['refreshToken'] = UserDataLocal.USER_REFRESH_TOKEN  
11 - bean['refreshToken'] = 'ddrqreeee' 8 + bean['refreshToken'] = HttpUrlUtils.getRefreshToken()
12 let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders(); 9 let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();
13 return new Promise<string>((success, fail) => { 10 return new Promise<string>((success, fail) => {
14 - HttpRequest.post<ResponseDTO<string>>(HttpUrlUtils.accountLogoutUrl(), bean, headers).then((data: ResponseDTO<string>) => { 11 + HttpBizUtil.post<ResponseDTO<string>>(HttpUrlUtils.accountLogoutUrl(), bean, headers).then((data: ResponseDTO<string>) => {
15 if (!data) { 12 if (!data) {
16 fail("数据为空") 13 fail("数据为空")
17 return 14 return
@@ -23,7 +20,6 @@ export class LogoutModel{ @@ -23,7 +20,6 @@ export class LogoutModel{
23 success(data.message) 20 success(data.message)
24 }, (error: Error) => { 21 }, (error: Error) => {
25 fail(error.message) 22 fail(error.message)
26 - // Logger.debug("LoginViewModel:error ", error.toString())  
27 }) 23 })
28 }) 24 })
29 } 25 }
@@ -19,7 +19,7 @@ const TAG = "SearcherAboutDataModel" @@ -19,7 +19,7 @@ const TAG = "SearcherAboutDataModel"
19 class SearcherAboutDataModel{ 19 class SearcherAboutDataModel{
20 private static instance: SearcherAboutDataModel; 20 private static instance: SearcherAboutDataModel;
21 public searchHistoryData:SearchHistoryItem[] = [] 21 public searchHistoryData:SearchHistoryItem[] = []
22 - public SEARCH_HISTORY_KEY:string = "SEARCH_HISTORY_KEY" + UserDataLocal.userId 22 + public SEARCH_HISTORY_KEY:string = "SEARCH_HISTORY_KEY" + UserDataLocal.getUserId()
23 23
24 private constructor() { } 24 private constructor() { }
25 25
@@ -29,13 +29,11 @@ struct MineHomePage { @@ -29,13 +29,11 @@ struct MineHomePage {
29 registTime:number = 0//账号注册时间 29 registTime:number = 0//账号注册时间
30 @State registerTimeForDay:number = 0 30 @State registerTimeForDay:number = 0
31 31
32 - aboutToAppear(){ 32 + onPageShow(): void {
33 this.getUserInfo() 33 this.getUserInfo()
34 this.getUserLevel() 34 this.getUserLevel()
35 } 35 }
36 36
37 -  
38 -  
39 build() { 37 build() {
40 Stack({ alignContent: Alignment.Top }){ 38 Stack({ alignContent: Alignment.Top }){
41 Image($r('app.media.title_bg')) 39 Image($r('app.media.title_bg'))
@@ -65,9 +63,8 @@ struct MineHomePage { @@ -65,9 +63,8 @@ struct MineHomePage {
65 .height('130lpx') 63 .height('130lpx')
66 .objectFit(ImageFit.Cover) 64 .objectFit(ImageFit.Cover)
67 }.onClick(()=>{ 65 }.onClick(()=>{
68 - //TODO 显示头像  
69 - let params = {'userId': "531267787833221"} as Record<string, string>;  
70 - WDRouterRule.jumpWithPage(WDRouterPage.otherNormalUserHomePagePage,params) 66 + let params = {'headPhotoUrl': this.headPhotoUrl} as Record<string, string>;
  67 + WDRouterRule.jumpWithPage(WDRouterPage.showUserHeaderPage,params)
71 }).width('135lpx') 68 }).width('135lpx')
72 .height('135lpx') 69 .height('135lpx')
73 70
@@ -370,6 +367,9 @@ struct MineHomePage { @@ -370,6 +367,9 @@ struct MineHomePage {
370 if(StringUtils.isNotEmpty(value.introduction)){ 367 if(StringUtils.isNotEmpty(value.introduction)){
371 this.desc = value.introduction 368 this.desc = value.introduction
372 this.isHasIntroduction = true 369 this.isHasIntroduction = true
  370 + }else{
  371 + this.desc = "点击添加简介,让大家认识你"
  372 + this.isHasIntroduction = false
373 } 373 }
374 this.browseNum = value.browseNum 374 this.browseNum = value.browseNum
375 this.commentNum = value.commentNum 375 this.commentNum = value.commentNum
1 import { PhotoListBean } from 'wdBean/Index'; 1 import { PhotoListBean } from 'wdBean/Index';
2 import { display, router } from '@kit.ArkUI'; 2 import { display, router } from '@kit.ArkUI';
3 -import { Logger } from 'wdKit/Index';  
4 import { ImageItemView } from '../components/view/ImageItemView'; 3 import { ImageItemView } from '../components/view/ImageItemView';
5 import { ImageDownloadComponent } from '../components/ImageDownloadComponent'; 4 import { ImageDownloadComponent } from '../components/ImageDownloadComponent';
6 import { Action } from 'wdBean'; 5 import { Action } from 'wdBean';
@@ -10,7 +9,6 @@ const TAG = 'MultiPictureListPage'; @@ -10,7 +9,6 @@ const TAG = 'MultiPictureListPage';
10 @Entry 9 @Entry
11 @Component 10 @Component
12 export struct MultiPictureListPage { 11 export struct MultiPictureListPage {
13 - @Provide @Watch('onCurrentPageNumUpdated') currentPageNum: string = '01'  
14 private scroller: Scroller = new Scroller() 12 private scroller: Scroller = new Scroller()
15 @State swiperIndex: number = 0; 13 @State swiperIndex: number = 0;
16 photoList: PhotoListBean[] = []; 14 photoList: PhotoListBean[] = [];
@@ -20,17 +18,10 @@ export struct MultiPictureListPage { @@ -20,17 +18,10 @@ export struct MultiPictureListPage {
20 private picWidth: number = 0 18 private picWidth: number = 0
21 @State picHeight: number = 0 19 @State picHeight: number = 0
22 @State isEnableSwipe: boolean = true; 20 @State isEnableSwipe: boolean = true;
  21 + @State currentUrl: string = ''
23 22
24 // @Provide bgc: Color = Color.White; 23 // @Provide bgc: Color = Color.White;
25 24
26 - //watch监听页码回调  
27 - onCurrentPageNumUpdated(): void {  
28 - Logger.info(TAG, `currentPageNum:${this.currentPageNum}`,)  
29 - let _swiperIndex = Number.parseInt(this.currentPageNum)  
30 - Logger.info(TAG, `_swiperIndex:${_swiperIndex}`)  
31 - this.swiperIndex = _swiperIndex > 0 ? _swiperIndex - 1 : _swiperIndex  
32 - }  
33 -  
34 aboutToAppear(): void { 25 aboutToAppear(): void {
35 //获取宽高尺寸 26 //获取宽高尺寸
36 this.screenWidth = this.displayTool.width 27 this.screenWidth = this.displayTool.width
@@ -40,6 +31,8 @@ export struct MultiPictureListPage { @@ -40,6 +31,8 @@ export struct MultiPictureListPage {
40 let par: Action = router.getParams() as Action; 31 let par: Action = router.getParams() as Action;
41 let params = par?.params; 32 let params = par?.params;
42 this.photoList = params?.extra?.photoList || []; 33 this.photoList = params?.extra?.photoList || [];
  34 + this.swiperIndex = params?.extra?.swiperIndex || 0;
  35 + this.currentUrl = this.photoList[this.swiperIndex]?.picPath
43 } 36 }
44 37
45 build() { 38 build() {
@@ -80,6 +73,7 @@ export struct MultiPictureListPage { @@ -80,6 +73,7 @@ export struct MultiPictureListPage {
80 }) 73 })
81 .onChange((index: number) => { 74 .onChange((index: number) => {
82 this.swiperIndex = index 75 this.swiperIndex = index
  76 + this.currentUrl = this.photoList[index]?.picPath
83 }) 77 })
84 78
85 Row() { 79 Row() {
@@ -121,7 +115,7 @@ export struct MultiPictureListPage { @@ -121,7 +115,7 @@ export struct MultiPictureListPage {
121 }) 115 })
122 } 116 }
123 117
124 - ImageDownloadComponent({ url: this.photoList[this.swiperIndex].picPath }) 118 + ImageDownloadComponent({ url: this.currentUrl })
125 .alignRules({ 119 .alignRules({
126 bottom: { anchor: "__container__", align: VerticalAlign.Bottom }, 120 bottom: { anchor: "__container__", align: VerticalAlign.Bottom },
127 right: { anchor: "__container__", align: HorizontalAlign.End } 121 right: { anchor: "__container__", align: HorizontalAlign.End }
  1 +import { router } from '@kit.ArkUI';
  2 +
  3 +@Entry
  4 +@Component
  5 +struct ShowUserHeaderPage {
  6 + @State headPhotoUrl: string = '';
  7 + @State params:Record<string, string> = router.getParams() as Record<string, string>;
  8 +
  9 + onPageShow() {
  10 + this.headPhotoUrl = this.params?.['headPhotoUrl'];
  11 + }
  12 +
  13 + build() {
  14 + Row() {
  15 + Image(this.headPhotoUrl)
  16 + .alt($r('app.media.default_head'))
  17 + .width('720lpx')
  18 + .height('720lpx')
  19 + .objectFit(ImageFit.Auto)
  20 + .clip(new Circle({ width: '720lpx', height: '720lpx' }))
  21 + }
  22 + .width('100%')
  23 + .height('100%')
  24 + .alignItems(VerticalAlign.Center)
  25 + .backgroundColor($r('app.color.color_000000'))
  26 + .onClick(()=>{
  27 + router.back()
  28 + })
  29 + }
  30 +}
@@ -35,16 +35,8 @@ export class PageRepository { @@ -35,16 +35,8 @@ export class PageRepository {
35 } 35 }
36 36
37 static getPageInfoUrl(pageId: string) { 37 static getPageInfoUrl(pageId: string) {
38 - let url = HttpUrlUtils.getHost() + HttpUrlUtils.PAGE_INFO_PATH;  
39 - // TODO 暂定只请求第一页,后续对接分页加载,参数再调整 first_load?  
40 - url = url + "?channelStrategy=2&loadStrategy=first_load"  
41 - + "&districtCode=" + HttpUrlUtils.getDistrictCode()  
42 - + "&provinceCode=" + HttpUrlUtils.getProvinceCode()  
43 - + "&cityCode=" + HttpUrlUtils.getCityCode()  
44 - + "&refreshTime=" + DateTimeUtils.getTimeStamp()  
45 - + "&pageId=" + pageId  
46 - // Logger.debug("TAG", 'getCompInfoUrl url: '+url);  
47 - Logger.info(TAG, "getPageInfoUrl url = " + url) 38 + let url = HttpUrlUtils.getHost() + HttpUrlUtils.PAGE_INFO_PATH + "?pageId=" + pageId;
  39 + // Logger.info(TAG, "getPageInfoUrl url = " + url)
48 return url; 40 return url;
49 } 41 }
50 42
@@ -293,7 +285,7 @@ export class PageRepository { @@ -293,7 +285,7 @@ export class PageRepository {
293 static postExecuteLike(params: postExecuteLikeParams): Promise<ResponseDTO> { 285 static postExecuteLike(params: postExecuteLikeParams): Promise<ResponseDTO> {
294 let url = HttpUrlUtils.getHost() + HttpUrlUtils.INTERACT_EXECUTELIKE 286 let url = HttpUrlUtils.getHost() + HttpUrlUtils.INTERACT_EXECUTELIKE
295 let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders(); 287 let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();
296 - return WDHttp.post0(url, params, headers) 288 + return WDHttp.post(url, params, headers)
297 } 289 }
298 290
299 /** 291 /**
@@ -304,7 +296,7 @@ export class PageRepository { @@ -304,7 +296,7 @@ export class PageRepository {
304 static postExecuteCollectRecord(params: postExecuteCollectRecordParams): Promise<ResponseDTO> { 296 static postExecuteCollectRecord(params: postExecuteCollectRecordParams): Promise<ResponseDTO> {
305 let url = HttpUrlUtils.getHost() + HttpUrlUtils.INTERACT_EXECUTECOLLECTRECORD 297 let url = HttpUrlUtils.getHost() + HttpUrlUtils.INTERACT_EXECUTECOLLECTRECORD
306 let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders(); 298 let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();
307 - return WDHttp.post0(url, params, headers) 299 + return WDHttp.post(url, params, headers)
308 } 300 }
309 301
310 /** 302 /**
@@ -314,7 +306,7 @@ export class PageRepository { @@ -314,7 +306,7 @@ export class PageRepository {
314 static getContentInteract(params: contentListParams): Promise<ResponseDTO<InteractDataDTO[]>> { 306 static getContentInteract(params: contentListParams): Promise<ResponseDTO<InteractDataDTO[]>> {
315 let url = HttpUrlUtils.getHost() + HttpUrlUtils.INTERACT_DATA_PATH 307 let url = HttpUrlUtils.getHost() + HttpUrlUtils.INTERACT_DATA_PATH
316 let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders(); 308 let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();
317 - return WDHttp.post0(url, params, headers) 309 + return WDHttp.post(url, params, headers)
318 } 310 }
319 311
320 // 浏览历史新增、删除接口 312 // 浏览历史新增、删除接口
@@ -331,7 +323,7 @@ export class PageRepository { @@ -331,7 +323,7 @@ export class PageRepository {
331 static fetchBatchAttentionStatus(params: postBatchAttentionStatusParams): Promise<ResponseDTO<postBatchAttentionStatusResult[]>> { 323 static fetchBatchAttentionStatus(params: postBatchAttentionStatusParams): Promise<ResponseDTO<postBatchAttentionStatusResult[]>> {
332 let url = HttpUrlUtils.getHost() + HttpUrlUtils.FOLLOW_LIST_STATUS_DATA_PATH 324 let url = HttpUrlUtils.getHost() + HttpUrlUtils.FOLLOW_LIST_STATUS_DATA_PATH
333 let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders(); 325 let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();
334 - return WDHttp.post0(url, params, headers) 326 + return WDHttp.post(url, params, headers)
335 } 327 }
336 328
337 /** 329 /**
@@ -340,7 +332,7 @@ export class PageRepository { @@ -340,7 +332,7 @@ export class PageRepository {
340 static postInteractAccentionOperate(params: postInteractAccentionOperateParams): Promise<ResponseDTO> { 332 static postInteractAccentionOperate(params: postInteractAccentionOperateParams): Promise<ResponseDTO> {
341 let url = HttpUrlUtils.getHost() + HttpUrlUtils.INTERACT_ACCENTION_OPERATION 333 let url = HttpUrlUtils.getHost() + HttpUrlUtils.INTERACT_ACCENTION_OPERATION
342 let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders(); 334 let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();
343 - return WDHttp.post0(url, params, headers) 335 + return WDHttp.post(url, params, headers)
344 } 336 }
345 337
346 static fetchNewspaperInfo(date: string) { 338 static fetchNewspaperInfo(date: string) {
@@ -48,5 +48,19 @@ export class LikeViewModel { @@ -48,5 +48,19 @@ export class LikeViewModel {
48 } 48 }
49 49
50 50
  51 + //点赞数
  52 + getLikeCount(bean: Record<string, string>) {
  53 +
  54 + return new Promise<object>((success, fail) => {
  55 + this.likeModel.getLikeCount(bean).then((data) => {
  56 + success(data)
  57 + }).catch((error: string) => {
  58 + fail(error)
  59 + })
  60 + })
  61 +
  62 + }
  63 +
  64 +
51 65
52 } 66 }
1 import { SpConstants } from 'wdConstant/Index' 1 import { SpConstants } from 'wdConstant/Index'
2 -import { SPHelper } from 'wdKit/Index' 2 +import { SPHelper, UserDataLocal } from 'wdKit/Index'
3 import { HttpUrlUtils } from 'wdNetwork/Index' 3 import { HttpUrlUtils } from 'wdNetwork/Index'
4 import { LogoutModel } from '../model/LogoutModel' 4 import { LogoutModel } from '../model/LogoutModel'
5 5
@@ -20,17 +20,18 @@ export class LogoutViewModel{ @@ -20,17 +20,18 @@ export class LogoutViewModel{
20 } 20 }
21 21
22 static clearLoginInfo() { 22 static clearLoginInfo() {
23 - SPHelper.default.save(SpConstants.USER_FIRST_MARK, '')  
24 - SPHelper.default.save(SpConstants.USER_ID, '')  
25 - SPHelper.default.save(SpConstants.USER_JWT_TOKEN, '')  
26 - SPHelper.default.save(SpConstants.USER_LONG_TIME_NO_LOGIN_MARK, '')  
27 - SPHelper.default.save(SpConstants.USER_REFRESH_TOKEN, '')  
28 - SPHelper.default.save(SpConstants.USER_STATUS, '')  
29 - SPHelper.default.save(SpConstants.USER_Type, '')  
30 - SPHelper.default.save(SpConstants.USER_NAME, '')  
31 - SPHelper.default.save(SpConstants.USER_PHONE, '') 23 + SPHelper.default.saveSync(SpConstants.USER_FIRST_MARK, '')
  24 + SPHelper.default.saveSync(SpConstants.USER_ID, '')
  25 + SPHelper.default.saveSync(SpConstants.USER_JWT_TOKEN, '')
  26 + SPHelper.default.saveSync(SpConstants.USER_LONG_TIME_NO_LOGIN_MARK, '')
  27 + SPHelper.default.saveSync(SpConstants.USER_REFRESH_TOKEN, '')
  28 + SPHelper.default.saveSync(SpConstants.USER_STATUS, '')
  29 + SPHelper.default.saveSync(SpConstants.USER_Type, '')
  30 + SPHelper.default.saveSync(SpConstants.USER_NAME, '')
  31 + SPHelper.default.saveSync(SpConstants.USER_PHONE, '')
32 HttpUrlUtils.setUserId("") 32 HttpUrlUtils.setUserId("")
33 HttpUrlUtils.setUserType("") 33 HttpUrlUtils.setUserType("")
34 HttpUrlUtils.setUserToken('') 34 HttpUrlUtils.setUserToken('')
  35 + UserDataLocal.clearUserData()
35 } 36 }
36 } 37 }
1 -import { PageDTO, CompDTO, PageInfoDTO, ContentDTO } from 'wdBean'; 1 +import { CompDTO, ContentDTO, PageDTO, PageInfoDTO } from 'wdBean';
2 import { CompStyle, ViewType } from 'wdConstant/Index'; 2 import { CompStyle, ViewType } from 'wdConstant/Index';
3 import { CollectionUtils, DateTimeUtils, Logger, NetworkUtil } 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';
7 import { promptAction } from '@kit.ArkUI'; 7 import { promptAction } from '@kit.ArkUI';
8 -import { AdvRuleBean, CompAdvBean } from 'wdBean/src/main/ets/bean/adv/AdvsRuleBean'; 8 +import { 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 import { WDViewDefaultType } from '../components/view/EmptyComponent';
@@ -104,7 +104,11 @@ export class PageHelper { @@ -104,7 +104,11 @@ export class PageHelper {
104 if (pageDto && pageDto.compList && pageDto.compList.length > 0) { 104 if (pageDto && pageDto.compList && pageDto.compList.length > 0) {
105 pageModel.viewType = ViewType.LOADED; 105 pageModel.viewType = ViewType.LOADED;
106 let sizeBefore: number = pageModel.compList.size(); 106 let sizeBefore: number = pageModel.compList.size();
  107 + if (isLastGroup) {
  108 + // 认为分页只会在最后一个group里
107 pageModel.currentPage++; 109 pageModel.currentPage++;
  110 + }
  111 + // pageModel.currentPage++;
108 pageModel.hasMore = true; 112 pageModel.hasMore = true;
109 113
110 //移除音频 和 活动 114 //移除音频 和 活动
@@ -21,6 +21,7 @@ @@ -21,6 +21,7 @@
21 "components/page/LiveMorePage", 21 "components/page/LiveMorePage",
22 "components/page/ReserveMorePage", 22 "components/page/ReserveMorePage",
23 "pages/VideoPlayPage", 23 "pages/VideoPlayPage",
24 - "components/page/ThemeListPage" 24 + "components/page/ThemeListPage",
  25 + "pages/ShowUserHeaderPage"
25 ] 26 ]
26 } 27 }
@@ -245,7 +245,7 @@ export class ContentDetailRequest { @@ -245,7 +245,7 @@ export class ContentDetailRequest {
245 static getContentInteract(params: contentListParams): Promise<ResponseDTO<InteractDataDTO[]>> { 245 static getContentInteract(params: contentListParams): Promise<ResponseDTO<InteractDataDTO[]>> {
246 let url = HttpUrlUtils.getHost() + HttpUrlUtils.INTERACT_DATA_PATH 246 let url = HttpUrlUtils.getHost() + HttpUrlUtils.INTERACT_DATA_PATH
247 let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders(); 247 let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();
248 - return WDHttp.post0(url, params, headers) 248 + return WDHttp.post(url, params, headers)
249 } 249 }
250 250
251 /** 251 /**
@@ -255,7 +255,7 @@ export class ContentDetailRequest { @@ -255,7 +255,7 @@ export class ContentDetailRequest {
255 static postBatchLikeAndCollectStatus(params: batchLikeAndCollectParams): Promise<ResponseDTO<batchLikeAndCollectResult[]>> { 255 static postBatchLikeAndCollectStatus(params: batchLikeAndCollectParams): Promise<ResponseDTO<batchLikeAndCollectResult[]>> {
256 let url = HttpUrlUtils.getHost() + HttpUrlUtils.INTERACT_DATA_STATUS 256 let url = HttpUrlUtils.getHost() + HttpUrlUtils.INTERACT_DATA_STATUS
257 let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders(); 257 let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();
258 - return WDHttp.post0(url, params, headers) 258 + return WDHttp.post(url, params, headers)
259 } 259 }
260 260
261 /** 261 /**
@@ -265,7 +265,7 @@ export class ContentDetailRequest { @@ -265,7 +265,7 @@ export class ContentDetailRequest {
265 static postBatchAttentionStatus(params: postBatchAttentionStatusParams): Promise<ResponseDTO<postBatchAttentionStatusResult[]>> { 265 static postBatchAttentionStatus(params: postBatchAttentionStatusParams): Promise<ResponseDTO<postBatchAttentionStatusResult[]>> {
266 let url = HttpUrlUtils.getHost() + HttpUrlUtils.FOLLOW_LIST_STATUS_DATA_PATH 266 let url = HttpUrlUtils.getHost() + HttpUrlUtils.FOLLOW_LIST_STATUS_DATA_PATH
267 let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders(); 267 let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();
268 - return WDHttp.post0(url, params, headers) 268 + return WDHttp.post(url, params, headers)
269 } 269 }
270 270
271 271
@@ -277,7 +277,7 @@ export class ContentDetailRequest { @@ -277,7 +277,7 @@ export class ContentDetailRequest {
277 static postRecommendVideoList(params: recommentVideoListParams): Promise<ResponseDTO<ContentDetailDTO[]>> { 277 static postRecommendVideoList(params: recommentVideoListParams): Promise<ResponseDTO<ContentDetailDTO[]>> {
278 let url = HttpUrlUtils.getHost() + HttpUrlUtils.RECOMMEND_VIDEOLIST 278 let url = HttpUrlUtils.getHost() + HttpUrlUtils.RECOMMEND_VIDEOLIST
279 let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders(); 279 let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();
280 - return WDHttp.post0(url, params, headers) 280 + return WDHttp.post(url, params, headers)
281 } 281 }
282 282
283 /** 283 /**
@@ -288,7 +288,7 @@ export class ContentDetailRequest { @@ -288,7 +288,7 @@ export class ContentDetailRequest {
288 static postExecuteLike(params: postExecuteLikeParams): Promise<ResponseDTO> { 288 static postExecuteLike(params: postExecuteLikeParams): Promise<ResponseDTO> {
289 let url = HttpUrlUtils.getHost() + HttpUrlUtils.INTERACT_EXECUTELIKE 289 let url = HttpUrlUtils.getHost() + HttpUrlUtils.INTERACT_EXECUTELIKE
290 let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders(); 290 let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();
291 - return WDHttp.post0(url, params, headers) 291 + return WDHttp.post(url, params, headers)
292 } 292 }
293 293
294 /** 294 /**
@@ -299,7 +299,7 @@ export class ContentDetailRequest { @@ -299,7 +299,7 @@ export class ContentDetailRequest {
299 static postExecuteCollectRecord(params: postExecuteCollectRecordParams): Promise<ResponseDTO> { 299 static postExecuteCollectRecord(params: postExecuteCollectRecordParams): Promise<ResponseDTO> {
300 let url = HttpUrlUtils.getHost() + HttpUrlUtils.INTERACT_EXECUTECOLLECTRECORD 300 let url = HttpUrlUtils.getHost() + HttpUrlUtils.INTERACT_EXECUTECOLLECTRECORD
301 let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders(); 301 let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();
302 - return WDHttp.post0(url, params, headers) 302 + return WDHttp.post(url, params, headers)
303 } 303 }
304 304
305 /** 305 /**
@@ -309,7 +309,7 @@ export class ContentDetailRequest { @@ -309,7 +309,7 @@ export class ContentDetailRequest {
309 static postPointLevelOperate(params: postPointLevelOperateParams): Promise<ResponseDTO> { 309 static postPointLevelOperate(params: postPointLevelOperateParams): Promise<ResponseDTO> {
310 let url = HttpUrlUtils.getHost() + HttpUrlUtils.USERPOINT_OPERATE 310 let url = HttpUrlUtils.getHost() + HttpUrlUtils.USERPOINT_OPERATE
311 let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders(); 311 let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();
312 - return WDHttp.post0(url, params, headers) 312 + return WDHttp.post(url, params, headers)
313 } 313 }
314 314
315 /** 315 /**
@@ -318,7 +318,7 @@ export class ContentDetailRequest { @@ -318,7 +318,7 @@ export class ContentDetailRequest {
318 static postCommentPublish(params: postCommentPublishParams): Promise<ResponseDTO> { 318 static postCommentPublish(params: postCommentPublishParams): Promise<ResponseDTO> {
319 let url = HttpUrlUtils.getHost() + HttpUrlUtils.COMMENT_PUBLISH 319 let url = HttpUrlUtils.getHost() + HttpUrlUtils.COMMENT_PUBLISH
320 let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders(); 320 let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();
321 - return WDHttp.post0(url, params, headers) 321 + return WDHttp.post(url, params, headers)
322 } 322 }
323 323
324 324
@@ -328,7 +328,7 @@ export class ContentDetailRequest { @@ -328,7 +328,7 @@ export class ContentDetailRequest {
328 static postInteractBrowsOperate(params: postInteractBrowsOperateParams): Promise<ResponseDTO> { 328 static postInteractBrowsOperate(params: postInteractBrowsOperateParams): Promise<ResponseDTO> {
329 let url = HttpUrlUtils.getHost() + HttpUrlUtils.INTERACT_BROWS_OPERATE 329 let url = HttpUrlUtils.getHost() + HttpUrlUtils.INTERACT_BROWS_OPERATE
330 let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders(); 330 let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();
331 - return WDHttp.post0(url, params, headers) 331 + return WDHttp.post(url, params, headers)
332 } 332 }
333 333
334 /** 334 /**
@@ -337,6 +337,6 @@ export class ContentDetailRequest { @@ -337,6 +337,6 @@ export class ContentDetailRequest {
337 static postInteractAccentionOperate(params: postInteractAccentionOperateParams): Promise<ResponseDTO> { 337 static postInteractAccentionOperate(params: postInteractAccentionOperateParams): Promise<ResponseDTO> {
338 let url = HttpUrlUtils.getHost() + HttpUrlUtils.INTERACT_ACCENTION_OPERATION 338 let url = HttpUrlUtils.getHost() + HttpUrlUtils.INTERACT_ACCENTION_OPERATION
339 let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders(); 339 let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();
340 - return WDHttp.post0(url, params, headers) 340 + return WDHttp.post(url, params, headers)
341 } 341 }
342 } 342 }
@@ -32,15 +32,15 @@ export struct DetailPlayLivePage { @@ -32,15 +32,15 @@ export struct DetailPlayLivePage {
32 32
33 aboutToAppear(): void { 33 aboutToAppear(): void {
34 Logger.info(TAG, `wyj-aboutToAppear`) 34 Logger.info(TAG, `wyj-aboutToAppear`)
35 - this.listener?.on("change", (mediaQueryResult) => {  
36 - Logger.info(TAG, `change;${mediaQueryResult.matches}`)  
37 - if (mediaQueryResult?.matches) {  
38 - this.displayDirection = DisplayDirection.VIDEO_HORIZONTAL  
39 - } else {  
40 - this.displayDirection = DisplayDirection.VERTICAL  
41 - }  
42 - WindowModel.shared.setMainWindowFullScreen(this.displayDirection == DisplayDirection.VIDEO_HORIZONTAL)  
43 - }) 35 + // this.listener?.on("change", (mediaQueryResult) => {
  36 + // Logger.info(TAG, `change;${mediaQueryResult.matches}`)
  37 + // if (mediaQueryResult?.matches) {
  38 + // this.displayDirection = DisplayDirection.VIDEO_HORIZONTAL
  39 + // } else {
  40 + // this.displayDirection = DisplayDirection.VERTICAL
  41 + // }
  42 + // WindowModel.shared.setMainWindowFullScreen(this.displayDirection == DisplayDirection.VIDEO_HORIZONTAL)
  43 + // })
44 this.getLiveDetails() 44 this.getLiveDetails()
45 this.getLiveRoomData() 45 this.getLiveRoomData()
46 } 46 }
@@ -67,7 +67,7 @@ export struct DetailPlayLivePage { @@ -67,7 +67,7 @@ export struct DetailPlayLivePage {
67 67
68 onPageShowCus(): void { 68 onPageShowCus(): void {
69 Logger.info(TAG, `wyj-onPageShowCus`) 69 Logger.info(TAG, `wyj-onPageShowCus`)
70 - // WindowModel.shared.setPreferredOrientation(window.Orientation.AUTO_ROTATION_RESTRICTED); 70 + // WindowModel.shared.setPreferredOrientation(window.Orientation.LOCKED);
71 } 71 }
72 72
73 onPageHideCus(): void { 73 onPageHideCus(): void {
@@ -100,7 +100,7 @@ export struct TabLiveItemComponent { @@ -100,7 +100,7 @@ export struct TabLiveItemComponent {
100 picDesc: '' 100 picDesc: ''
101 }) 101 })
102 } 102 }
103 - this.gotoMultipleListImagePage() 103 + this.gotoMultipleListImagePage(index)
104 }) 104 })
105 }) 105 })
106 } 106 }
@@ -187,13 +187,14 @@ export struct TabLiveItemComponent { @@ -187,13 +187,14 @@ export struct TabLiveItemComponent {
187 * 大图列表页 187 * 大图列表页
188 * @param content 188 * @param content
189 * */ 189 * */
190 - gotoMultipleListImagePage() { 190 + gotoMultipleListImagePage(index: number) {
191 let taskAction: Action = { 191 let taskAction: Action = {
192 type: 'JUMP_DETAIL_PAGE', 192 type: 'JUMP_DETAIL_PAGE',
193 params: { 193 params: {
194 detailPageType: 18, 194 detailPageType: 18,
195 extra: { 195 extra: {
196 - photoList: this.photoList 196 + photoList: this.photoList,
  197 + swiperIndex: index,
197 } as ExtraDTO 198 } as ExtraDTO
198 } as Params, 199 } as Params,
199 }; 200 };
@@ -191,7 +191,10 @@ export struct PlayUIComponent { @@ -191,7 +191,10 @@ export struct PlayUIComponent {
191 191
192 @Builder 192 @Builder
193 getMiddleUIComponent() { 193 getMiddleUIComponent() {
194 - Stack() 194 + Stack() {
  195 + Text('播放功能暂时关闭')
  196 + .fontColor(Color.White)
  197 + }.alignContent(Alignment.Center)
195 .layoutWeight(1) 198 .layoutWeight(1)
196 .width('100%') 199 .width('100%')
197 .onClick(() => { 200 .onClick(() => {
@@ -13,7 +13,7 @@ export struct TopPlayComponent { @@ -13,7 +13,7 @@ export struct TopPlayComponent {
13 aboutToAppear(): void { 13 aboutToAppear(): void {
14 if (this.playerController) { 14 if (this.playerController) {
15 this.playerController.onCanplay = () => { 15 this.playerController.onCanplay = () => {
16 - this.playerController?.play() 16 + // this.playerController?.play()
17 } 17 }
18 } 18 }
19 } 19 }
@@ -31,7 +31,7 @@ export struct TopPlayComponent { @@ -31,7 +31,7 @@ export struct TopPlayComponent {
31 } else if (this.liveDetailsBean.liveInfo.liveState == 'end') { 31 } else if (this.liveDetailsBean.liveInfo.liveState == 'end') {
32 playUrl = this.liveDetailsBean.liveInfo.vlive[0].replayUri 32 playUrl = this.liveDetailsBean.liveInfo.vlive[0].replayUri
33 } 33 }
34 - this.playerController?.firstPlay(playUrl); 34 + // this.playerController?.firstPlay(playUrl);
35 } 35 }
36 } 36 }
37 37
@@ -47,14 +47,14 @@ export class LoginViewModel { @@ -47,14 +47,14 @@ export class LoginViewModel {
47 47
48 return new Promise<LoginBean>((success, fail) => { 48 return new Promise<LoginBean>((success, fail) => {
49 this.loginModel.appLogin(phone, loginType, verificationCode).then((data: LoginBean) => { 49 this.loginModel.appLogin(phone, loginType, verificationCode).then((data: LoginBean) => {
50 - SPHelper.default.save(SpConstants.USER_FIRST_MARK, data.firstMark)  
51 - SPHelper.default.save(SpConstants.USER_ID, data.id)  
52 - SPHelper.default.save(SpConstants.USER_JWT_TOKEN, data.jwtToken)  
53 - SPHelper.default.save(SpConstants.USER_LONG_TIME_NO_LOGIN_MARK, data.longTimeNoLoginMark)  
54 - SPHelper.default.save(SpConstants.USER_REFRESH_TOKEN, data.refreshToken)  
55 - SPHelper.default.save(SpConstants.USER_STATUS, data.status)  
56 - SPHelper.default.save(SpConstants.USER_Type, data.userType)  
57 - SPHelper.default.save(SpConstants.USER_NAME, data.userName) 50 + SPHelper.default.saveSync(SpConstants.USER_FIRST_MARK, data.firstMark)
  51 + SPHelper.default.saveSync(SpConstants.USER_ID, data.id)
  52 + SPHelper.default.saveSync(SpConstants.USER_JWT_TOKEN, data.jwtToken)
  53 + SPHelper.default.saveSync(SpConstants.USER_LONG_TIME_NO_LOGIN_MARK, data.longTimeNoLoginMark)
  54 + SPHelper.default.saveSync(SpConstants.USER_REFRESH_TOKEN, data.refreshToken)
  55 + SPHelper.default.saveSync(SpConstants.USER_STATUS, data.status)
  56 + SPHelper.default.saveSync(SpConstants.USER_Type, data.userType)
  57 + SPHelper.default.saveSync(SpConstants.USER_NAME, data.userName)
58 HttpUrlUtils.setUserId(data.id+"") 58 HttpUrlUtils.setUserId(data.id+"")
59 HttpUrlUtils.setUserType(data.userType+"") 59 HttpUrlUtils.setUserType(data.userType+"")
60 HttpUrlUtils.setUserToken(data.jwtToken) 60 HttpUrlUtils.setUserToken(data.jwtToken)
@@ -71,14 +71,14 @@ export class LoginViewModel { @@ -71,14 +71,14 @@ export class LoginViewModel {
71 let passwordNew = await this.doMd(password) 71 let passwordNew = await this.doMd(password)
72 Logger.debug(TAG, "PASSWORD:" + passwordNew) 72 Logger.debug(TAG, "PASSWORD:" + passwordNew)
73 this.loginModel.appLoginByPassword(phone, loginType, passwordNew, oldPassword).then((data: LoginBean) => { 73 this.loginModel.appLoginByPassword(phone, loginType, passwordNew, oldPassword).then((data: LoginBean) => {
74 - SPHelper.default.save(SpConstants.USER_FIRST_MARK, data.firstMark)  
75 - SPHelper.default.save(SpConstants.USER_ID, data.id)  
76 - SPHelper.default.save(SpConstants.USER_JWT_TOKEN, data.jwtToken)  
77 - SPHelper.default.save(SpConstants.USER_LONG_TIME_NO_LOGIN_MARK, data.longTimeNoLoginMark)  
78 - SPHelper.default.save(SpConstants.USER_REFRESH_TOKEN, data.refreshToken)  
79 - SPHelper.default.save(SpConstants.USER_STATUS, data.status)  
80 - SPHelper.default.save(SpConstants.USER_Type, data.userType)  
81 - SPHelper.default.save(SpConstants.USER_NAME, data.userName) 74 + SPHelper.default.saveSync(SpConstants.USER_FIRST_MARK, data.firstMark)
  75 + SPHelper.default.saveSync(SpConstants.USER_ID, data.id)
  76 + SPHelper.default.saveSync(SpConstants.USER_JWT_TOKEN, data.jwtToken)
  77 + SPHelper.default.saveSync(SpConstants.USER_LONG_TIME_NO_LOGIN_MARK, data.longTimeNoLoginMark)
  78 + SPHelper.default.saveSync(SpConstants.USER_REFRESH_TOKEN, data.refreshToken)
  79 + SPHelper.default.saveSync(SpConstants.USER_STATUS, data.status)
  80 + SPHelper.default.saveSync(SpConstants.USER_Type, data.userType)
  81 + SPHelper.default.saveSync(SpConstants.USER_NAME, data.userName)
82 HttpUrlUtils.setUserId(data.id+"") 82 HttpUrlUtils.setUserId(data.id+"")
83 HttpUrlUtils.setUserType(data.userType+"") 83 HttpUrlUtils.setUserType(data.userType+"")
84 HttpUrlUtils.setUserToken(data.jwtToken) 84 HttpUrlUtils.setUserToken(data.jwtToken)
@@ -94,8 +94,8 @@ export class LoginViewModel { @@ -94,8 +94,8 @@ export class LoginViewModel {
94 return new Promise<CheckVerifyBean>((success, reject) => { 94 return new Promise<CheckVerifyBean>((success, reject) => {
95 this.loginModel.checkVerifyCode(phone, verifyCode).then((data: CheckVerifyBean) => { 95 this.loginModel.checkVerifyCode(phone, verifyCode).then((data: CheckVerifyBean) => {
96 //todo 保存数据 96 //todo 保存数据
97 - SPHelper.default.save(SpConstants.USER_TEMP_TOKEN, data.tempToken)  
98 - SPHelper.default.save(SpConstants.USER_JWT_TOKEN, data.jwtToken) 97 + SPHelper.default.saveSync(SpConstants.USER_TEMP_TOKEN, data.tempToken)
  98 + SPHelper.default.saveSync(SpConstants.USER_JWT_TOKEN, data.jwtToken)
99 success(data) 99 success(data)
100 100
101 }, (value: string) => { 101 }, (value: string) => {
@@ -107,8 +107,8 @@ export class LoginViewModel { @@ -107,8 +107,8 @@ export class LoginViewModel {
107 return new Promise<CheckVerifyBean>((success, reject) => { 107 return new Promise<CheckVerifyBean>((success, reject) => {
108 this.loginModel.checkVerifyCodeByToken(verifyCode).then((data: CheckVerifyBean) => { 108 this.loginModel.checkVerifyCodeByToken(verifyCode).then((data: CheckVerifyBean) => {
109 //todo 保存数据 109 //todo 保存数据
110 - SPHelper.default.save(SpConstants.USER_TEMP_TOKEN, data.tempToken)  
111 - SPHelper.default.save(SpConstants.USER_JWT_TOKEN, data.jwtToken) 110 + SPHelper.default.saveSync(SpConstants.USER_TEMP_TOKEN, data.tempToken)
  111 + SPHelper.default.saveSync(SpConstants.USER_JWT_TOKEN, data.jwtToken)
112 success(data) 112 success(data)
113 113
114 }, (value: string) => { 114 }, (value: string) => {
@@ -149,14 +149,14 @@ export class LoginViewModel { @@ -149,14 +149,14 @@ export class LoginViewModel {
149 this.loginModel.logOut().then((data) => { 149 this.loginModel.logOut().then((data) => {
150 //清除登录状态以及token、userid等信息 150 //清除登录状态以及token、userid等信息
151 151
152 - SPHelper.default.save(SpConstants.USER_FIRST_MARK, '')  
153 - SPHelper.default.save(SpConstants.USER_ID, '')  
154 - SPHelper.default.save(SpConstants.USER_JWT_TOKEN, '')  
155 - SPHelper.default.save(SpConstants.USER_LONG_TIME_NO_LOGIN_MARK, '')  
156 - SPHelper.default.save(SpConstants.USER_REFRESH_TOKEN, '')  
157 - SPHelper.default.save(SpConstants.USER_STATUS, '')  
158 - SPHelper.default.save(SpConstants.USER_Type, '')  
159 - SPHelper.default.save(SpConstants.USER_NAME, '') 152 + SPHelper.default.saveSync(SpConstants.USER_FIRST_MARK, '')
  153 + SPHelper.default.saveSync(SpConstants.USER_ID, '')
  154 + SPHelper.default.saveSync(SpConstants.USER_JWT_TOKEN, '')
  155 + SPHelper.default.saveSync(SpConstants.USER_LONG_TIME_NO_LOGIN_MARK, '')
  156 + SPHelper.default.saveSync(SpConstants.USER_REFRESH_TOKEN, '')
  157 + SPHelper.default.saveSync(SpConstants.USER_STATUS, '')
  158 + SPHelper.default.saveSync(SpConstants.USER_Type, '')
  159 + SPHelper.default.saveSync(SpConstants.USER_NAME, '')
160 HttpUrlUtils.setUserId("") 160 HttpUrlUtils.setUserId("")
161 HttpUrlUtils.setUserType("") 161 HttpUrlUtils.setUserType("")
162 HttpUrlUtils.setUserToken('') 162 HttpUrlUtils.setUserToken('')
@@ -218,14 +218,14 @@ export class LoginViewModel { @@ -218,14 +218,14 @@ export class LoginViewModel {
218 this.loginModel.queryUserDetail().then((data: UserDetail) => { 218 this.loginModel.queryUserDetail().then((data: UserDetail) => {
219 //保存sp 219 //保存sp
220 if(data){ 220 if(data){
221 - SPHelper.default.save(SpConstants.USER_NAME, data.userName)  
222 - SPHelper.default.save(SpConstants.USER_PHONE, data.phone) 221 + SPHelper.default.saveSync(SpConstants.USER_NAME, data.userName)
  222 + SPHelper.default.saveSync(SpConstants.USER_PHONE, data.phone)
223 } 223 }
224 if(data.userExtend){ 224 if(data.userExtend){
225 - SPHelper.default.save(SpConstants.USER_SEX, data.userExtend.sex)  
226 - SPHelper.default.save(SpConstants.USER_CREATOR_ID, data.userExtend.creatorId+"")  
227 - SPHelper.default.save(SpConstants.USER_HEAD_PHOTO_URL, data.userExtend.headPhotoUrl)  
228 - SPHelper.default.save(SpConstants.USER_BIRTHDAY, data.userExtend.birthday) 225 + SPHelper.default.saveSync(SpConstants.USER_SEX, data.userExtend.sex)
  226 + SPHelper.default.saveSync(SpConstants.USER_CREATOR_ID, data.userExtend.creatorId+"")
  227 + SPHelper.default.saveSync(SpConstants.USER_HEAD_PHOTO_URL, data.userExtend.headPhotoUrl)
  228 + SPHelper.default.saveSync(SpConstants.USER_BIRTHDAY, data.userExtend.birthday)
229 } 229 }
230 230
231 success(data) 231 success(data)
@@ -14,7 +14,7 @@ import { @@ -14,7 +14,7 @@ import {
14 StringUtils, 14 StringUtils,
15 WindowModel 15 WindowModel
16 } from 'wdKit'; 16 } from 'wdKit';
17 -import { HttpUrlUtils, WDHttp } from 'wdNetwork'; 17 +import { HostEnum, HostManager, WDHttp } from 'wdNetwork';
18 18
19 export default class EntryAbility extends UIAbility { 19 export default class EntryAbility extends UIAbility {
20 onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void { 20 onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void {
@@ -25,7 +25,7 @@ export default class EntryAbility extends UIAbility { @@ -25,7 +25,7 @@ export default class EntryAbility extends UIAbility {
25 WDHttp.initHttpHeader() 25 WDHttp.initHttpHeader()
26 const spHostUrl = SPHelper.default.getSync('hostUrl', '') as string 26 const spHostUrl = SPHelper.default.getSync('hostUrl', '') as string
27 if (StringUtils.isNotEmpty(spHostUrl)) { 27 if (StringUtils.isNotEmpty(spHostUrl)) {
28 - HttpUrlUtils.hostUrl = spHostUrl 28 + HostManager.changeHost(spHostUrl as HostEnum)
29 } 29 }
30 30
31 // 注册监听网络连接 31 // 注册监听网络连接