Toggle navigation
Toggle navigation
This project
Loading...
Sign in
developOne
/
harmonyPool
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
陈剑华
2024-04-26 15:00:02 +0800
Browse Files
Options
Browse Files
Download
Plain Diff
Commit
68f9316a38ea0c62adc1adf52ba3d126aa9c0013
68f9316a
2 parents
689e9d4c
b7c978bb
Merge remote-tracking branch 'origin/main'
Hide whitespace changes
Inline
Side-by-side
Showing
38 changed files
with
818 additions
and
545 deletions
sight_harmony/commons/wdKit/src/main/ets/utils/UserDataLocal.ets
sight_harmony/commons/wdNetwork/Index.ets
sight_harmony/commons/wdNetwork/src/main/ets/http/HttpCommonParams.ets
sight_harmony/commons/wdNetwork/src/main/ets/http/HttpHostManager.ets
sight_harmony/commons/wdNetwork/src/main/ets/http/HttpUrlUtils.ets
sight_harmony/commons/wdRouter/src/main/ets/utils/ProcessUtils.ets
sight_harmony/commons/wdWebComponent/src/main/ets/pages/JsBridgeBiz.ets
sight_harmony/commons/wdWebComponent/src/main/ets/pages/WdWebLocalComponent.ets
sight_harmony/features/wdBean/src/main/ets/bean/component/extra/ExtraDTO.ts
sight_harmony/features/wdComponent/Index.ets
sight_harmony/features/wdComponent/src/main/ets/components/DynamicDetailComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/ImageDownloadComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/ImageSwiperComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card19Component.ets
sight_harmony/features/wdComponent/src/main/ets/components/mine/appointment/AppointmentListUI.ets
sight_harmony/features/wdComponent/src/main/ets/components/mine/follow/FollowChildComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/mine/follow/FollowListDetailUI.ets
sight_harmony/features/wdComponent/src/main/ets/components/mine/home/HomePageBottomComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/mine/home/OtherHomePageBottomCommentComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/mine/home/OtherHomePageBottomFollowComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/search/SearchRelatedComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/search/SearchResultComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/setting/AboutPageUI.ets
sight_harmony/features/wdComponent/src/main/ets/components/setting/EnvironmentCustomDialog.ets
sight_harmony/features/wdComponent/src/main/ets/components/view/LikeComponent.ets
sight_harmony/features/wdComponent/src/main/ets/model/LikeModel.ets
sight_harmony/features/wdComponent/src/main/ets/model/LogoutModel.ets
sight_harmony/features/wdComponent/src/main/ets/model/SearcherAboutDataModel.ets
sight_harmony/features/wdComponent/src/main/ets/pages/MultiPictureListPage.ets
sight_harmony/features/wdComponent/src/main/ets/viewmodel/LikeViewModel.ets
sight_harmony/features/wdComponent/src/main/ets/viewmodel/LogoutViewModel.ets
sight_harmony/features/wdComponent/src/main/ets/viewmodel/PageHelper.ets
sight_harmony/features/wdDetailPlayLive/src/main/ets/pages/DetailPlayLivePage.ets
sight_harmony/features/wdDetailPlayLive/src/main/ets/widgets/details/TabLiveItemComponent.ets
sight_harmony/features/wdDetailPlayLive/src/main/ets/widgets/details/video/PlayUIComponent.ets
sight_harmony/features/wdDetailPlayLive/src/main/ets/widgets/details/video/TopPlayComponet.ets
sight_harmony/features/wdLogin/src/main/ets/pages/login/LoginViewModel.ets
sight_harmony/products/phone/src/main/ets/entryability/EntryAbility.ets
sight_harmony/commons/wdKit/src/main/ets/utils/UserDataLocal.ets
View file @
68f9316
...
...
@@ -6,41 +6,34 @@ import { SPHelper } from './SPHelper'
import { StringUtils } from './StringUtils'
export class UserDataLocal {
public static userId=''
public static userType=''
public static token=''
public static userName=''
public static userHeaderUrl=''
public static userLevel = -1
public static userLevelHeaderUrl=''
private static userId=''
private static userType=''
private static userName=''
private static userHeaderUrl=''
private static userLevel = -1
private static userLevelHeaderUrl=''
//先写死
static USER_ID="userId"
static USER_Type="userType"
static USER_JWT_TOKEN="jwtToken"
static USER_NAME="userName"
static USER_HEADER_URL="userHeaderUrl"
static USER_LEVEL="userLevel"
static USER_LEVEL_HEADER_URL="userLevelHeaderUrl"
static USER_FOLLOW_OPERATION="user_follow_operation"
//刷新token 用到
static USER_REFRESH_TOKEN="refreshToken"
static USER_FOLLOW_OPERATION="user_follow_operation"
/**
* 清除 本地用户数据
*/
public static clearUserData(){
SPHelper.default.deleteSync(UserDataLocal.USER_ID)
SPHelper.default.deleteSync(UserDataLocal.USER_Type)
SPHelper.default.deleteSync(UserDataLocal.USER_JWT_TOKEN) //待确认
SPHelper.default.deleteSync(UserDataLocal.USER_NAME)
SPHelper.default.deleteSync(UserDataLocal.USER_HEADER_URL)
SPHelper.default.deleteSync(UserDataLocal.USER_LEVEL)
SPHelper.default.deleteSync(UserDataLocal.USER_LEVEL_HEADER_URL)
UserDataLocal.userId=''
UserDataLocal.userType=''
UserDataLocal.userName=''
UserDataLocal.userHeaderUrl=''
UserDataLocal.userLevel = -1
UserDataLocal.userLevelHeaderUrl=''
}
public static getUserId() {
...
...
@@ -59,17 +52,6 @@ export class UserDataLocal {
return UserDataLocal.userType;
}
private static getXToken() {
if(StringUtils.isNotEmpty(UserDataLocal.token)){
return UserDataLocal.token
}
UserDataLocal.token = SPHelper.default.getSync(UserDataLocal.USER_JWT_TOKEN,"") as string
if(StringUtils.isNotEmpty(UserDataLocal.token)) {
return UserDataLocal.token
}
return 'eyJhbGciOiJIUzI1NiIsImtpZCI6ImQ4WkI2QkhxSEZrdjJ2U25BNlRwZEdKRjBHcjItVzBvS2FaYzdLOUUycmcifQ.eyJpc3MiOiJwZW9wbGVzLWRhaWx5LWZvdXJhIiwic3ViIjoicGVvcGxlcy1kYWlseS1mb3VyYSIsImV4cCI6MTcwMzY0OTYwNiwidXNlcklkIjo0NTk3NzYyOTc0NzQ5NDksInVzZXJWZXJzaW9uIjoiNDU5Nzc2Mjk3NDc0OTQ5XzIiLCJ1c2VyTmFtZSI6IkJ1bGlraWtpMTgxIiwidXNlclR5cGUiOjIsImNyZWF0b3JJZCI6NDI2NTM5MH0.jhQ9kylcm3FxWf0-lBMZuLkdtIQ6XpFnAi0AFZJNwfc';
}
public static getUserName() {
if(StringUtils.isNotEmpty(UserDataLocal.userName)){
return UserDataLocal.userName
...
...
@@ -118,4 +100,5 @@ export class UserDataLocal {
public static setUserLevelHeaderUrl(url:string) {
SPHelper.default.save(UserDataLocal.USER_LEVEL_HEADER_URL, url)
}
}
\ No newline at end of file
...
...
sight_harmony/commons/wdNetwork/Index.ets
View file @
68f9316
...
...
@@ -8,3 +8,5 @@ export { HttpUrlUtils } from "./src/main/ets/http/HttpUrlUtils"
export { HttpBizUtil } from "./src/main/ets/http/HttpBizUtil"
export { HostEnum, HostManager } from "./src/main/ets/http/HttpHostManager"
...
...
sight_harmony/commons/wdNetwork/src/main/ets/http/HttpCommonParams.ets
0 → 100644
View file @
68f9316
import HashMap from '@ohos.util.HashMap';
import { SpConstants } from 'wdConstant';
import { SPHelper, StringUtils } from 'wdKit';
import { HostEnum, HostManager } from './HttpHostManager';
/**
* 网络请求参数工具类
*/
export class HttpParams {
private static userId = ''
private static userType = ''
private static token = ''
static getCommonHeaders(): HashMap<string, string> {
let headers: HashMap<string, string> = new HashMap<string, string>()
headers.set('User-Agent', 'Dalvik/2.1.0 (Linux; U; Android 13; 22101317C Build/TKQ1.221013.002)')
headers.set('channel', HttpParams.getChannel())
//headers.set('appCode', ConfigConstants.appCode)
headers.set('plat', HttpParams.getPlat())
//headers.set('Authorization', 'APPCODE 83092caa603a421aa0222308b3f6b27a')
headers.set('Content-Type', 'application/json; charset=utf-8')
headers.set('timestamp', HttpParams.getTimestamp())
headers.set('RMRB-X-TOKEN', HttpParams.getXToken())
headers.set('device_id', HttpParams.getDeviceId())
if (HttpParams.getXToken() != '') {
headers.set('cookie', 'RMRB-X-TOKEN=' + HttpParams.getXToken())
}
headers.set('build_version', HttpParams.getVersion())
headers.set('adcode', HttpParams.getAdCode())
headers.set('os_version', HttpParams.getOsVersion())
//headers.set('X-Ca-Stage', 'PRE')
headers.set('versionCode', HttpParams.getVersionCode())
headers.set('system', HttpParams.getTerminalId())
headers.set('version_name', HttpParams.getVersionName())
headers.set('EagleEye-TraceID', 'D539562E48554A60977AF4BECB6D6C7A')
headers.set('imei', HttpParams.getImei())
headers.set('Accept-Language', 'zh')
HttpParams.setLocationHeader(headers)
// TODO 判断是否登录
headers.set('userId', HttpParams.getUserId())
headers.set('userType', HttpParams.getUserType())
headers.set('mpassid', 'ZbHTMeTsfaYDAHqt8ZHIzcPs')
HttpParams.addSpecialHeaders(headers);
// Logger.debug("TAG", '******************* commonHeaders headers start ******************************** ');
// headers.forEach((v,k)=>{
// Logger.debug("TAG", 'getCommonHeaders header: ' + k + ': ' + v);
// })
// Logger.debug("TAG", '******************* commonHeaders headers end ******************************** ');
return headers;
}
static addSpecialHeaders(headers: HashMap<string, string>) {
switch (HostManager.getHost()) {
case HostEnum.HOST_UAT:
// TODO 待优化到常量类里
headers.set('X-Ca-Stage', 'PRE');
headers.set('Authorization', 'APPCODE 83092caa603a421aa0222308b3f6b27a');
headers.set('appCode', '83092caa603a421aa0222308b3f6b27a');
break
case HostEnum.HOST_SIT:
headers.set('X-Ca-Stage', 'TEST');
headers.set('Authorization', 'APPCODE 0af1f9085e484c97b2a44704bae72c07');
headers.set('appCode', '0af1f9085e484c97b2a44704bae72c07');
break
case HostEnum.HOST_PRODUCT:
headers.set('X-Ca-Stage', 'RELEASE');
headers.set('Authorization', 'APPCODE 3d4181bceeb94d9780e10dbb6c67bbf6');
headers.set('appCode', '3d4181bceeb94d9780e10dbb6c67bbf6');
break
case HostEnum.HOST_DEV:
headers.set('X-Ca-Stage', 'TEST');
headers.set('Authorization', 'APPCODE ff33172859e14f9a8299e3bd769e79f9');
headers.set('appCode', 'ff33172859e14f9a8299e3bd769e79f9');
break
default:
break
}
}
static setLocationHeader(headers: HashMap<string, string>) {
let cityName = SPHelper.default.getSync(SpConstants.LOCATION_CITY_NAME, '') as string
if (StringUtils.isNotEmpty(cityName)) {
headers.set('city', encodeURI(cityName))
}
let cityCode = SPHelper.default.getSync(SpConstants.LOCATION_CITY_CODE, '') as string
if (StringUtils.isNotEmpty(cityCode)) {
headers.set('city_dode', encodeURI(cityCode))
}
}
private static getCity() {
// TODO 对接定位
return '%E5%90%88%E8%82%A5%E5%B8%82';
}
private static getChannel() {
// TODO 对接配置
return 'rmrb_china_0000';
}
private static getPlat() {
return 'Phone';
}
private static getTimestamp() {
// return DateTimeUtils.getCurrentTime() + '';
// TODO 暂时写死,有些page 真实时间戳 返回数据为空
return '155203523';
}
private static getXToken() {
if (StringUtils.isNotEmpty(HttpParams.token)) {
return HttpParams.token
}
HttpParams.token = SPHelper.default.getSync(SpConstants.USER_JWT_TOKEN, "") as string
if (StringUtils.isNotEmpty(HttpParams.token)) {
return HttpParams.token
}
// return 'eyJhbGciOiJIUzI1NiIsImtpZCI6ImQ4WkI2QkhxSEZrdjJ2U25BNlRwZEdKRjBHcjItVzBvS2FaYzdLOUUycmcifQ.eyJpc3MiOiJwZW9wbGVzLWRhaWx5LWZvdXJhIiwic3ViIjoicGVvcGxlcy1kYWlseS1mb3VyYSIsImV4cCI6MTcwMzY0OTYwNiwidXNlcklkIjo0NTk3NzYyOTc0NzQ5NDksInVzZXJWZXJzaW9uIjoiNDU5Nzc2Mjk3NDc0OTQ5XzIiLCJ1c2VyTmFtZSI6IkJ1bGlraWtpMTgxIiwidXNlclR5cGUiOjIsImNyZWF0b3JJZCI6NDI2NTM5MH0.jhQ9kylcm3FxWf0-lBMZuLkdtIQ6XpFnAi0AFZJNwfc';
return ''
}
static getRefreshToken(): string {
let refreshToken = SPHelper.default.getSync(SpConstants.USER_REFRESH_TOKEN, "")
if (StringUtils.isNotEmpty(refreshToken)) {
return refreshToken as string;
}
return '';
}
public static getDeviceId() {
// TODO
return '8a81226a-cabd-3e1b-b630-b51db4a720ed';
}
private static getVersion() {
// TODO
return '202401242103';
}
private static getVersionCode() {
// TODO
return '7301';
}
private static getVersionName() {
// TODO
return '7.3.0.1';
}
private static getAdCode() {
return '340000';
}
private static getOsVersion() {
// TODO
return '12';
}
public static getCityCode() {
// TODO
return '340100';
}
public static getProvinceCode() {
// TODO
return '340000';
}
/**
* 地区code
*/
public static getDistrictCode() {
// TODO
return '340103';
}
private static getTerminalId() {
return 'Android';
}
public static getImei() {
// TODO
return '8a81226a-cabd-3e1b-b630-b51db4a720ed';
}
public static getUserId(): string {
// TODO 对接登录
if (StringUtils.isNotEmpty(HttpParams.userId)) {
return HttpParams.userId
}
HttpParams.userId = SPHelper.default.getSync(SpConstants.USER_ID, "") as string
return HttpParams.userId;
}
public static getUserType() {
if (StringUtils.isNotEmpty(HttpParams.userType)) {
return HttpParams.userType
}
HttpParams.userType = SPHelper.default.getSync(SpConstants.USER_Type, "") as string
return HttpParams.userType;
}
public static setUserId(userId: string) {
HttpParams.userId = userId;
}
public static setUserType(userType: string) {
HttpParams.userType = userType;
}
public static setUserToken(token: string) {
HttpParams.token = token;
}
}
\ No newline at end of file
...
...
sight_harmony/commons/wdNetwork/src/main/ets/http/HttpHostManager.ets
0 → 100644
View file @
68f9316
export enum HostEnum {
/**
* uat环境url
*/
HOST_UAT = 'https://pd-apis-uat.pdnews.cn',
/**
* 中文端sit环境
*/
HOST_SIT = 'https://pd-apis-sit.pdnews.cn',
/**
* dev环境url
*/
HOST_DEV = 'https://pd-apis-dev.pdnews.cn',
/**
* 正式环境url
*/
HOST_PRODUCT = 'https://pdapis.pdnews.cn',
}
/**
* 环境host管理工具类
*/
export class HostManager {
private static _hostUrl: HostEnum = HostEnum.HOST_PRODUCT;
static changeHost(host: HostEnum) {
HostManager._hostUrl = host;
}
static getHost(): string {
return HostManager._hostUrl;
}
}
\ No newline at end of file
...
...
sight_harmony/commons/wdNetwork/src/main/ets/http/HttpUrlUtils.ets
View file @
68f9316
import HashMap from '@ohos.util.HashMap';
import { SpConstants } from 'wdConstant';
import { SPHelper, StringUtils } from 'wdKit';
import { HostEnum, HostManager } from './HttpHostManager';
/**
* 网络请求业务侧工具类
*/
export class HttpUrlUtils {
/**
* uat环境url
*/
static readonly HOST_UAT: string = "https://pd-apis-uat.pdnews.cn";
/**
* 中文端sit环境
*/
static readonly HOST_SIT: string = "https://pd-apis-sit.pdnews.cn";
/**
* 正式环境url
*/
static readonly HOST_PRODUCT: string = "https://pdapis.pdnews.cn";
/**
* dev环境url
*/
static readonly HOST_DEV: string = "https://pd-apis-dev.pdnews.cn";
/**
* 启动接口(底导接口)
*/
static readonly BOTTOM_NAV_PATH: string = "/api/rmrb-bff-display-zh/display/zh/c/bottomNavGroup";
...
...
@@ -293,21 +278,14 @@ export class HttpUrlUtils {
* 获取启动页相关数据
*/
static readonly LAUNCH_PAGE_PATH: string = "/api/rmrb-bff-display-zh/display/zh/c/launchPage";
private static _hostUrl: string = HttpUrlUtils.HOST_PRODUCT;
/**
* 推荐列表
*/
static readonly RECOMMEND_LIST: string = "/api/rmrb-bff-display-zh/recommend/zh/c/list";
/**
* 搜索推荐
*/
static readonly SEARCH_SUGGEST_DATA_PATH: string = "/api/rmrb-bff-display-zh/recommend/zh/c/list";
public static set hostUrl(value: string) {
HttpUrlUtils._hostUrl = value;
}
private static userId = ''
private static userType = ''
private static token = ''
...
...
@@ -354,24 +332,24 @@ export class HttpUrlUtils {
}
static addSpecialHeaders(headers: HashMap<string, string>) {
switch (HttpUrlUtils._hostUrl) {
case HttpUrlUtils.HOST_UAT:
switch (HostManager.getHost()) {
case HostEnum.HOST_UAT:
// TODO 待优化到常量类里
headers.set('X-Ca-Stage', 'PRE');
headers.set('Authorization', 'APPCODE 83092caa603a421aa0222308b3f6b27a');
headers.set('appCode', '83092caa603a421aa0222308b3f6b27a');
break
case H
ttpUrlUtils
.HOST_SIT:
case H
ostEnum
.HOST_SIT:
headers.set('X-Ca-Stage', 'TEST');
headers.set('Authorization', 'APPCODE 0af1f9085e484c97b2a44704bae72c07');
headers.set('appCode', '0af1f9085e484c97b2a44704bae72c07');
break
case H
ttpUrlUtils
.HOST_PRODUCT:
case H
ostEnum
.HOST_PRODUCT:
headers.set('X-Ca-Stage', 'RELEASE');
headers.set('Authorization', 'APPCODE 3d4181bceeb94d9780e10dbb6c67bbf6');
headers.set('appCode', '3d4181bceeb94d9780e10dbb6c67bbf6');
break
case H
ttpUrlUtils
.HOST_DEV:
case H
ostEnum
.HOST_DEV:
headers.set('X-Ca-Stage', 'TEST');
headers.set('Authorization', 'APPCODE ff33172859e14f9a8299e3bd769e79f9');
headers.set('appCode', 'ff33172859e14f9a8299e3bd769e79f9');
...
...
@@ -392,8 +370,8 @@ export class HttpUrlUtils {
}
}
static getHost() {
return HttpUrlUtils._hostUrl;
static getHost(): string {
return HostManager.getHost();
}
private static getCity() {
...
...
@@ -487,7 +465,7 @@ export class HttpUrlUtils {
return 'Android';
}
public
static getImei() {
public static getImei() {
// TODO
return '8a81226a-cabd-3e1b-b630-b51db4a720ed';
}
...
...
@@ -510,48 +488,48 @@ export class HttpUrlUtils {
}
static getVerifyCodeUrl() {
let url = HttpUrlUtils.
_hostUrl
+ "/api/rmrb-user-center/auth/zh/c/sendVerifyCode";
let url = HttpUrlUtils.
getHost()
+ "/api/rmrb-user-center/auth/zh/c/sendVerifyCode";
return url;
}
static getVerifyCodeByTokenUrl() {
let url = HttpUrlUtils.
_hostUrl
+ "/api/rmrb-user-center/user/zh/c/sendVerifyCodeByToken";
let url = HttpUrlUtils.
getHost()
+ "/api/rmrb-user-center/user/zh/c/sendVerifyCodeByToken";
return url;
}
static getCheckVerifyCodeByToken() {
let url = HttpUrlUtils.
_hostUrl
+ "/api/rmrb-user-center/user/zh/c/checkVerifyCodeByToken";
let url = HttpUrlUtils.
getHost()
+ "/api/rmrb-user-center/user/zh/c/checkVerifyCodeByToken";
return url;
}
static getForgetPasswordUrl() {
let url = HttpUrlUtils.
_hostUrl
+ "/api/rmrb-user-center/user/zh/c/forgotPassword";
let url = HttpUrlUtils.
getHost()
+ "/api/rmrb-user-center/user/zh/c/forgotPassword";
return url;
}
static getLogoutUrl() {
let url = HttpUrlUtils.
_hostUrl
+ "/api/rmrb-user-center/user/zh/c/appLogout";
let url = HttpUrlUtils.
getHost()
+ "/api/rmrb-user-center/user/zh/c/appLogout";
return url;
}
static getRefreshTokenUrl() {
let url = HttpUrlUtils.
_hostUrl
+ HttpUrlUtils.REFRESH_TOKEN_PATH;
let url = HttpUrlUtils.
getHost()
+ HttpUrlUtils.REFRESH_TOKEN_PATH;
return url;
}
static getResetPassworddUrl() {
let url = HttpUrlUtils.
_hostUrl
+ "/api/rmrb-user-center/user/zh/c/resetPassword";
let url = HttpUrlUtils.
getHost()
+ "/api/rmrb-user-center/user/zh/c/resetPassword";
return url;
}
static queryUserDetail() {
let url = HttpUrlUtils.
_hostUrl
+ "/api/rmrb-user-center/user/zh/c/queryUserDetail";
let url = HttpUrlUtils.
getHost()
+ "/api/rmrb-user-center/user/zh/c/queryUserDetail";
return url;
}
static editUserDetail() {
let url = HttpUrlUtils.
_hostUrl
+ "/api/rmrb-user-center/user/zh/c/editUserDetail";
let url = HttpUrlUtils.
getHost()
+ "/api/rmrb-user-center/user/zh/c/editUserDetail";
return url;
}
...
...
@@ -561,308 +539,315 @@ export class HttpUrlUtils {
}
static getCheckVerifyCodeUrl() {
let url = HttpUrlUtils.
_hostUrl
+ "/api/rmrb-user-center/auth/zh/c/checkVerifyCode";
let url = HttpUrlUtils.
getHost()
+ "/api/rmrb-user-center/auth/zh/c/checkVerifyCode";
return url;
}
static getAgreement() {
let url = HttpUrlUtils.
_hostUrl
+ "/api/rmrb-bff-display-zh/display/zh/c/agreement";
let url = HttpUrlUtils.
getHost()
+ "/api/rmrb-bff-display-zh/display/zh/c/agreement";
return url;
}
static getCheckVerifyByTokenCodeUrl() {
let url = HttpUrlUtils.
_hostUrl
+ "/api/rmrb-user-center/auth/zh/c/checkVerifyCodeByToken";
let url = HttpUrlUtils.
getHost()
+ "/api/rmrb-user-center/auth/zh/c/checkVerifyCodeByToken";
return url;
}
/*优质评论页*/
static getQualityCommentUrl() {
let url = HttpUrlUtils.
_hostUrl
+ "/api/rmrb-comment/comment/zh/c/highQuality";
let url = HttpUrlUtils.
getHost()
+ "/api/rmrb-comment/comment/zh/c/highQuality";
return url
}
/*获取详情页评论列表*/
static getContentCommentListDataUrl() {
let url = HttpUrlUtils.
_hostUrl
+ "/api/rmrb-comment/comment/zh/c/contentCommentList"
let url = HttpUrlUtils.
getHost()
+ "/api/rmrb-comment/comment/zh/c/contentCommentList"
return url
}
/*获取子评论列表*/
static getChildContentCommentListDataUrl() {
let url = HttpUrlUtils.
_hostUrl
+ "/api/rmrb-comment/comment/zh/c/childCommentList"
let url = HttpUrlUtils.
getHost()
+ "/api/rmrb-comment/comment/zh/c/childCommentList"
return url
}
/*评论状态*/
static getBatchCommentStatusUrl() {
let url = HttpUrlUtils.
_hostUrl
+ "/api/rmrb-comment/comment/zh/c/batchCommentStatus"
let url = HttpUrlUtils.
getHost()
+ "/api/rmrb-comment/comment/zh/c/batchCommentStatus"
return url
}
/*评论点赞*/
static getCommentLikeUrl() {
let url = HttpUrlUtils.
_hostUrl
+ "/api/rmrb-comment/comment/zh/c/commentLike"
let url = HttpUrlUtils.
getHost()
+ "/api/rmrb-comment/comment/zh/c/commentLike"
return url
}
/*发布评论*/
static getPublishCommentUrl() {
let url = HttpUrlUtils.
_hostUrl
+ "/api/rmrb-comment/comment/zh/c/publish"
let url = HttpUrlUtils.
getHost()
+ "/api/rmrb-comment/comment/zh/c/publish"
return url
}
/*游客发布评论*/
static getNoUserPublishCommentUrl() {
let url = HttpUrlUtils.
_hostUrl
+ "/api/rmrb-comment/comment/zh/c/commentLike"
let url = HttpUrlUtils.
getHost()
+ "/api/rmrb-comment/comment/zh/c/commentLike"
return url
}
/*levleIcon*/
static getBatchUserUrl() {
let url = HttpUrlUtils.
_hostUrl
+ "/api/rmrb-user-point/auth/level/zh/c/batchUser"
let url = HttpUrlUtils.
getHost()
+ "/api/rmrb-user-point/auth/level/zh/c/batchUser"
return url
}
/*authIcon 20个一次上限*/
static getDetailListUrl() {
let url = HttpUrlUtils.
_hostUrl
+ "/api/rmrb-contact/contact/zh/c/master/detailList"
let url = HttpUrlUtils.
getHost()
+ "/api/rmrb-contact/contact/zh/c/master/detailList"
return url
}
//账户注销
static accountLogoutUrl() {
let url = HttpUrlUtils.
_hostUrl
+ "/api/rmrb-user-center/user/zh/c/logoff";
let url = HttpUrlUtils.
getHost()
+ "/api/rmrb-user-center/user/zh/c/logoff";
return url;
}
//更换手机号绑定
static changeBindPhone() {
let url = HttpUrlUtils.
_hostUrl
+ "/api/rmrb-user-center/user/zh/c/userPhoneChange";
let url = HttpUrlUtils.
getHost()
+ "/api/rmrb-user-center/user/zh/c/userPhoneChange";
return url;
}
//获取用户安全页信息
static querySecurity() {
let url = HttpUrlUtils.
_hostUrl
+ "/api/rmrb-user-center/user/zh/c/security/query";
let url = HttpUrlUtils.
getHost()
+ "/api/rmrb-user-center/user/zh/c/security/query";
return url;
}
static getAppointmentListDataUrl() {
let url = HttpUrlUtils.
_hostUrl
+ HttpUrlUtils.APPOINTMENT_LIST_DATA_PATH
let url = HttpUrlUtils.
getHost()
+ HttpUrlUtils.APPOINTMENT_LIST_DATA_PATH
return url
}
static getMyCollectionListDataUrl() {
let url = HttpUrlUtils.
_hostUrl
+ HttpUrlUtils.APPOINTMENT_MyCollectionList_PATH
let url = HttpUrlUtils.
getHost()
+ HttpUrlUtils.APPOINTMENT_MyCollectionList_PATH
return url
}
static getExecuteCollcetUrl() {
let url = HttpUrlUtils.
_hostUrl
+ HttpUrlUtils.APPOINTMENT_ExecuteCollcet_PATH
let url = HttpUrlUtils.
getHost()
+ HttpUrlUtils.APPOINTMENT_ExecuteCollcet_PATH
return url
}
static getFollowListDetailDataUrl() {
let url = HttpUrlUtils.
_hostUrl
+ HttpUrlUtils.FOLLOW_LIST_DETAIL_DATA_PATH
let url = HttpUrlUtils.
getHost()
+ HttpUrlUtils.FOLLOW_LIST_DETAIL_DATA_PATH
return url
}
static getFollowListDataUrl() {
let url = HttpUrlUtils.
_hostUrl
+ HttpUrlUtils.FOLLOW_LIST_DATA_PATH
let url = HttpUrlUtils.
getHost()
+ HttpUrlUtils.FOLLOW_LIST_DATA_PATH
return url
}
static getMineFollowListDataUrl() {
let url = HttpUrlUtils.
_hostUrl
+ HttpUrlUtils.MINE_FOLLOW_LIST_DATA_PATH
let url = HttpUrlUtils.
getHost()
+ HttpUrlUtils.MINE_FOLLOW_LIST_DATA_PATH
return url
}
static getFollowListStatusDataUrl() {
let url = HttpUrlUtils.
_hostUrl
+ HttpUrlUtils.FOLLOW_LIST_STATUS_DATA_PATH
let url = HttpUrlUtils.
getHost()
+ HttpUrlUtils.FOLLOW_LIST_STATUS_DATA_PATH
return url
}
static getCommentListStatusDataUrl() {
let url = HttpUrlUtils.
_hostUrl
+ HttpUrlUtils.COMMENT_LIST_STATUS_DATA_PATH
let url = HttpUrlUtils.
getHost()
+ HttpUrlUtils.COMMENT_LIST_STATUS_DATA_PATH
return url
}
static getMineCommentListDataUrl() {
let url = HttpUrlUtils.
_hostUrl
+ HttpUrlUtils.MINE_COMMENT_LIST_DATA_PATH
let url = HttpUrlUtils.
getHost()
+ HttpUrlUtils.MINE_COMMENT_LIST_DATA_PATH
return url
}
static getMineUserLevelDataUrl() {
let url = HttpUrlUtils.
_hostUrl
+ HttpUrlUtils.MINE_USER_LEVEL_DATA_PATH
let url = HttpUrlUtils.
getHost()
+ HttpUrlUtils.MINE_USER_LEVEL_DATA_PATH
return url
}
static getOtherUserLevelDataUrl() {
let url = HttpUrlUtils.
_hostUrl
+ HttpUrlUtils.OTHER_USER_LEVEL_DATA_PATH
let url = HttpUrlUtils.
getHost()
+ HttpUrlUtils.OTHER_USER_LEVEL_DATA_PATH
return url
}
static getMineUserDetailDataUrl() {
let url = HttpUrlUtils.
_hostUrl
+ HttpUrlUtils.MINE_USER_DETAIL_DATA_PATH
let url = HttpUrlUtils.
getHost()
+ HttpUrlUtils.MINE_USER_DETAIL_DATA_PATH
return url
}
static getOtherUserDetailDataUrl() {
let url = HttpUrlUtils.
_hostUrl
+ HttpUrlUtils.OTHER_USER_DETAIL_DATA_PATH
let url = HttpUrlUtils.
getHost()
+ HttpUrlUtils.OTHER_USER_DETAIL_DATA_PATH
return url
}
static getOtherCommentListDataUrl() {
let url = HttpUrlUtils.
_hostUrl
+ HttpUrlUtils.OTHER_COMMENT_LIST_DATA_PATH
let url = HttpUrlUtils.
getHost()
+ HttpUrlUtils.OTHER_COMMENT_LIST_DATA_PATH
return url
}
static getOtherUserFollowListDataUrl() {
let url = HttpUrlUtils.
_hostUrl
+ HttpUrlUtils.OTHER_USER_FOLLOW_LIST_DATA_PATH
let url = HttpUrlUtils.
getHost()
+ HttpUrlUtils.OTHER_USER_FOLLOW_LIST_DATA_PATH
return url
}
static getAppointmentOperationUrl() {
let url = HttpUrlUtils.
_hostUrl
+ HttpUrlUtils.APPOINTMENT_OPERATION_STATUS_PATH
let url = HttpUrlUtils.
getHost()
+ HttpUrlUtils.APPOINTMENT_OPERATION_STATUS_PATH
return url
}
static getCommentLikeOperationUrl() {
let url = HttpUrlUtils.
_hostUrl
+ HttpUrlUtils.COMMENT_LIKE_OPERATION_PATH
let url = HttpUrlUtils.
getHost()
+ HttpUrlUtils.COMMENT_LIKE_OPERATION_PATH
return url
}
static getFollowOperationUrl() {
let url = HttpUrlUtils.
_hostUrl
+ HttpUrlUtils.FOLLOW_OPERATION_PATH
let url = HttpUrlUtils.
getHost()
+ HttpUrlUtils.FOLLOW_OPERATION_PATH
return url
}
static getSearchHintDataUrl() {
let url = HttpUrlUtils.
_hostUrl
+ HttpUrlUtils.SEARCH_HINT_DATA_PATH
let url = HttpUrlUtils.
getHost()
+ HttpUrlUtils.SEARCH_HINT_DATA_PATH
return url
}
static getSearchHotsDataUrl() {
let url = HttpUrlUtils.
_hostUrl
+ HttpUrlUtils.SEARCH_HOTS_DATA_PATH
let url = HttpUrlUtils.
getHost()
+ HttpUrlUtils.SEARCH_HOTS_DATA_PATH
return url
}
static getRelatedSearchContentDataUrl() {
let url = HttpUrlUtils.
_hostUrl
+ HttpUrlUtils.RELATED_SEARCH_CONTENT_DATA_PATH
let url = HttpUrlUtils.
getHost()
+ HttpUrlUtils.RELATED_SEARCH_CONTENT_DATA_PATH
return url
}
static getInterestsUrl() {
let url = HttpUrlUtils.
_hostUrl
+ HttpUrlUtils.INTERESTS_HOTS_DATA_PATH;
let url = HttpUrlUtils.
getHost()
+ HttpUrlUtils.INTERESTS_HOTS_DATA_PATH;
return url;
}
static getUpdateInterestsUrl() {
let url = HttpUrlUtils.
_hostUrl
+ HttpUrlUtils.INTERESTS_UPDATETAG_PATH;
let url = HttpUrlUtils.
getHost()
+ HttpUrlUtils.INTERESTS_UPDATETAG_PATH;
return url;
}
static getLaunchPageDataUrl() {
let url = HttpUrlUtils.
_hostUrl
+ HttpUrlUtils.LAUNCH_PAGE_PATH;
let url = HttpUrlUtils.
getHost()
+ HttpUrlUtils.LAUNCH_PAGE_PATH;
return url;
}
static getLiveDetailsUrl() {
let url = HttpUrlUtils.
_hostUrl
+ HttpUrlUtils.LIVE_DETAILS_PATH
let url = HttpUrlUtils.
getHost()
+ HttpUrlUtils.LIVE_DETAILS_PATH
return url
}
static getLiveListUrl() {
let url = HttpUrlUtils.
_hostUrl
+ HttpUrlUtils.LIVE_LIST_PATH
let url = HttpUrlUtils.
getHost()
+ HttpUrlUtils.LIVE_LIST_PATH
return url
}
static getLiveChatListUrl() {
let url = HttpUrlUtils.
_hostUrl
+ HttpUrlUtils.LIVE_CHAT_LIST_PATH
let url = HttpUrlUtils.
getHost()
+ HttpUrlUtils.LIVE_CHAT_LIST_PATH
return url
}
static getLiveRoomDataUrl() {
let url = HttpUrlUtils.
_hostUrl
+ HttpUrlUtils.LIVE_ROOM_DATA_PATH
let url = HttpUrlUtils.
getHost()
+ HttpUrlUtils.LIVE_ROOM_DATA_PATH
return url
}
static getLiveAppointmentStatusUrl() {
let url = HttpUrlUtils.
_hostUrl
+ HttpUrlUtils.LIVE_APPOINTMENT_STATUS_PATH
let url = HttpUrlUtils.
getHost()
+ HttpUrlUtils.LIVE_APPOINTMENT_STATUS_PATH
return url
}
static getLiveAppointmentUrl() {
let url = HttpUrlUtils.
_hostUrl
+ HttpUrlUtils.LIVE_APPOINTMENT_PATH
let url = HttpUrlUtils.
getHost()
+ HttpUrlUtils.LIVE_APPOINTMENT_PATH
return url
}
static getAppointmentStatusUrl() {
let url = HttpUrlUtils.
_hostUrl
+ HttpUrlUtils.LIVE_APPOINTMENT_BATCH_PATH
let url = HttpUrlUtils.
getHost()
+ HttpUrlUtils.LIVE_APPOINTMENT_BATCH_PATH
return url
}
static getSearchResultCountDataUrl() {
let url = HttpUrlUtils.
_hostUrl
+ HttpUrlUtils.SEARCH_RESULT_COUNT_DATA_PATH
let url = HttpUrlUtils.
getHost()
+ HttpUrlUtils.SEARCH_RESULT_COUNT_DATA_PATH
return url
}
static getSearchResultListDataUrl() {
let url = HttpUrlUtils.
_hostUrl
+ HttpUrlUtils.SEARCH_RESULT_LIST_DATA_PATH
let url = HttpUrlUtils.
getHost()
+ HttpUrlUtils.SEARCH_RESULT_LIST_DATA_PATH
return url
}
static getInteractListDataUrl() {
let url = HttpUrlUtils.
_hostUrl
+ HttpUrlUtils.INTERACT_DATA_PATH
let url = HttpUrlUtils.
getHost()
+ HttpUrlUtils.INTERACT_DATA_PATH
return url
}
static getCreatorDetailListDataUrl() {
let url = HttpUrlUtils.
_hostUrl
+ HttpUrlUtils.CREATOR_DETAIL_LIST_DATA_PATH
let url = HttpUrlUtils.
getHost()
+ HttpUrlUtils.CREATOR_DETAIL_LIST_DATA_PATH
return url
}
static getArticleCountHotsDataUrl() {
let url = HttpUrlUtils.
_hostUrl
+ HttpUrlUtils.ARTICLE_COUNT_HOTS_DATA_PATH
let url = HttpUrlUtils.
getHost()
+ HttpUrlUtils.ARTICLE_COUNT_HOTS_DATA_PATH
return url
}
static getArticleListHotsDataUrl() {
let url = HttpUrlUtils.
_hostUrl
+ HttpUrlUtils.ARTICLE_LIST_HOTS_DATA_PATH
let url = HttpUrlUtils.
getHost()
+ HttpUrlUtils.ARTICLE_LIST_HOTS_DATA_PATH
return url
}
static getCreatorInfluenceInfoHotsDataUrl() {
let url = HttpUrlUtils.
_hostUrl
+ HttpUrlUtils.CREATOR_INFLUENCE_HOTS_DATA_PATH
let url = HttpUrlUtils.
getHost()
+ HttpUrlUtils.CREATOR_INFLUENCE_HOTS_DATA_PATH
return url
}
//点赞
static executeLike() {
let url = HttpUrlUtils.
_hostUrl
+ "/api/rmrb-interact/interact/zh/c/like/executeLike";
let url = HttpUrlUtils.
getHost()
+ "/api/rmrb-interact/interact/zh/c/like/executeLike";
return url;
}
//获取点赞状态
static getLikeStatus() {
let url = HttpUrlUtils.
_hostUrl
+ "/api/rmrb-interact/interact/zh/c/batchLikeAndCollect/status";
let url = HttpUrlUtils.
getHost()
+ "/api/rmrb-interact/interact/zh/c/batchLikeAndCollect/status";
return url;
}
//获取点赞数
static getLikeCount() {
let url = HttpUrlUtils.getHost() + "/api/rmrb-contact/contact/zh/c/v2/content/interactData";
return url;
}
//搜索推荐
static getSearchSuggestDataUrl() {
let url = HttpUrlUtils.
_hostUrl
+ HttpUrlUtils.SEARCH_SUGGEST_DATA_PATH
let url = HttpUrlUtils.
getHost()
+ HttpUrlUtils.SEARCH_SUGGEST_DATA_PATH
return url
}
//金刚位聚合页
static getThemeListUrl() {
let url = HttpUrlUtils.
_hostUrl
+ "/api/rmrb-bff-display-zh/display/zh/c/themeList";
let url = HttpUrlUtils.
getHost()
+ "/api/rmrb-bff-display-zh/display/zh/c/themeList";
return url;
}
...
...
sight_harmony/commons/wdRouter/src/main/ets/utils/ProcessUtils.ets
View file @
68f9316
...
...
@@ -157,13 +157,14 @@ export class ProcessUtils {
* 图集详情页
* @param content
* */
public static gotoMultiPictureListPage(photoList: PhotoListBean[]) {
public static gotoMultiPictureListPage(photoList: PhotoListBean[]
, swiperIndex?:number
) {
let taskAction: Action = {
type: 'JUMP_DETAIL_PAGE',
params: {
detailPageType: 18,
extra: {
photoList
photoList,
swiperIndex
} as ExtraDTO
} as Params,
};
...
...
sight_harmony/commons/wdWebComponent/src/main/ets/pages/JsBridgeBiz.ets
View file @
68f9316
...
...
@@ -99,6 +99,7 @@ function handleJsCallReceiveH5Data(data: Message) {
case '3':
let imgListData: IImgListData = JSON.parse(data?.data?.imgListData || "{}")
let imgArr = imgListData?.imgArr || []
let swiperIndex = imgListData?.imgIndex
if (imgArr.length > 0) {
const photoList: PhotoListBean[] = imgArr.map(item => {
const photo: PhotoListBean = {
...
...
@@ -109,7 +110,7 @@ function handleJsCallReceiveH5Data(data: Message) {
}
return photo
})
ProcessUtils.gotoMultiPictureListPage(photoList)
ProcessUtils.gotoMultiPictureListPage(photoList
,swiperIndex
)
}
break;
case '5':
...
...
sight_harmony/commons/wdWebComponent/src/main/ets/pages/WdWebLocalComponent.ets
View file @
68f9316
...
...
@@ -79,6 +79,7 @@ export struct WdWebLocalComponent {
if (this.videoUrl) {
Video({ src: this.videoUrl })
.autoPlay(true)
.objectFit(ImageFit.Contain)
.width(this.positionWidth)
.height(this.positionHeight)
.borderRadius(5)
...
...
sight_harmony/features/wdBean/src/main/ets/bean/component/extra/ExtraDTO.ts
View file @
68f9316
...
...
@@ -15,5 +15,6 @@ export interface ExtraDTO extends ItemDTO {
relType
:
string
;
liveStreamType
?:
number
;
photoList
:
PhotoListBean
[];
swiperIndex
?:
number
commentId
?:
string
;
}
\ No newline at end of file
...
...
sight_harmony/features/wdComponent/Index.ets
View file @
68f9316
...
...
@@ -71,8 +71,6 @@ export { SpacialTopicPageComponent } from './src/main/ets/components/SpacialTopi
export { LogoutViewModel } from "./src/main/ets/viewmodel/LogoutViewModel"
export { ImageSwiperComponent } from "./src/main/ets/components/ImageSwiperComponent"
export { newsSkeleton } from "./src/main/ets/components/skeleton/newsSkeleton"
export { LiveCommentComponent } from "./src/main/ets/components/comment/view/LiveCommentComponent"
...
...
sight_harmony/features/wdComponent/src/main/ets/components/DynamicDetailComponent.ets
View file @
68f9316
...
...
@@ -211,7 +211,7 @@ export struct DynamicDetailComponent {
}
}
.onClick((event: ClickEvent) => {
ProcessUtils.gotoMultiPictureListPage(this.contentDetailData.photoList)
ProcessUtils.gotoMultiPictureListPage(this.contentDetailData.photoList
,index
)
})
} else {
GridCol({
...
...
@@ -228,7 +228,7 @@ export struct DynamicDetailComponent {
})
}
.onClick((event: ClickEvent) => {
ProcessUtils.gotoMultiPictureListPage(this.contentDetailData.photoList)
ProcessUtils.gotoMultiPictureListPage(this.contentDetailData.photoList
,index
)
})
}
} else if (this.contentDetailData.photoList.length === 4) {
...
...
@@ -240,7 +240,7 @@ export struct DynamicDetailComponent {
.borderRadius(this.caclImageRadius(index))
}
.onClick((event: ClickEvent) => {
ProcessUtils.gotoMultiPictureListPage(this.contentDetailData.photoList)
ProcessUtils.gotoMultiPictureListPage(this.contentDetailData.photoList
,index
)
})
} else {
GridCol({
...
...
@@ -251,7 +251,7 @@ export struct DynamicDetailComponent {
.borderRadius(this.caclImageRadius(index))
}
.onClick((event: ClickEvent) => {
ProcessUtils.gotoMultiPictureListPage(this.contentDetailData.photoList)
ProcessUtils.gotoMultiPictureListPage(this.contentDetailData.photoList
,index
)
})
}
})
...
...
sight_harmony/features/wdComponent/src/main/ets/components/ImageDownloadComponent.ets
View file @
68f9316
...
...
@@ -20,7 +20,7 @@ export struct ImageDownloadComponent {
@State image: PixelMap | undefined = undefined;
@State photoAccessHelper: photoAccessHelper.PhotoAccessHelper | undefined = undefined; // 相册模块管理实例
@State imageBuffer: ArrayBuffer | undefined = undefined; // 图片ArrayBuffer
url: string = ''
@Prop @Watch('onChangeUrl')
url: string = ''
build() {
Column() {
...
...
@@ -40,7 +40,11 @@ export struct ImageDownloadComponent {
}
async aboutToAppear(): Promise<void> {
aboutToAppear(): void {
this.onChangeUrl()
}
async onChangeUrl(): Promise<void> {
console.info(`cj2024 图片下载 ${this.url}`)
const context = getContext(this) as common.UIAbilityContext;
const atManager = abilityAccessCtrl.createAtManager();
...
...
sight_harmony/features/wdComponent/src/main/ets/components/ImageSwiperComponent.ets
deleted
100644 → 0
View file @
689e9d4
import { PhotoListBean } from 'wdBean/Index';
import { Logger } from 'wdKit/Index';
import { display, router } from '@kit.ArkUI';
import { ImageDownloadComponent } from './ImageDownloadComponent';
import { ImageItemView } from './view/ImageItemView';
const TAG = 'ImageSwiperComponent';
@Component
export struct ImageSwiperComponent {
@Provide @Watch('onCurrentPageNumUpdated') currentPageNum: string = '01'
private scroller: Scroller = new Scroller()
@State swiperIndex: number = 0;
photoList: PhotoListBean[] = [];
private swiperController: SwiperController = new SwiperController()
private displayTool = display.getDefaultDisplaySync()
private screenWidth: number = 0
private picWidth: number = 0
@State picHeight: number = 0
@State isEnableSwipe: boolean = true;
// @Provide bgc: Color = Color.White;
//watch监听页码回调
onCurrentPageNumUpdated(): void {
Logger.info(TAG, `currentPageNum:${this.currentPageNum}`,)
let _swiperIndex = Number.parseInt(this.currentPageNum)
Logger.info(TAG, `_swiperIndex:${_swiperIndex}`)
this.swiperIndex = _swiperIndex > 0 ? _swiperIndex - 1 : _swiperIndex
}
aboutToAppear(): void {
//获取宽高尺寸
this.screenWidth = this.displayTool.width
// this.picWidth = this.screenWidth - vp2px(52)
this.picWidth = this.screenWidth
this.picHeight = this.picWidth * 578 / 375
}
build() {
RelativeContainer() {
Image($r('app.media.icon_arrow_left_white'))
.width(24)
.height(24)
.aspectRatio(1)
.interpolation(ImageInterpolation.High)
.alignRules({
top: { anchor: "__container__", align: VerticalAlign.Top },
left: { anchor: "__container__", align: HorizontalAlign.Start }
})
.onClick(() => {
router.back();
})
.id("backImg")
if (this.photoList && this.photoList?.length > 0) {
Swiper(this.swiperController) {
ForEach(this.photoList, (item: PhotoListBean) => {
// MultiPictureDetailItemComponent({ MultiPictureDetailItem: item })
ImageItemView({ MultiPictureDetailItem: item, isEnableSwipe: this.isEnableSwipe })
})
}
.index(this.swiperIndex)
.width('100%')
.height(px2vp(this.picHeight) + 32)
.vertical(false)
.autoPlay(false)
.cachedCount(3)
.indicator(false)
.displayCount(1)
.id('e_swiper_content')
.alignRules({
center: { anchor: "__container__", align: VerticalAlign.Center },
middle: { anchor: "__container__", align: HorizontalAlign.Center }
})
.onChange((index: number) => {
this.swiperIndex = index
})
Row() {
Scroll(this.scroller) {
Row() {
Flex({
direction: FlexDirection.Column,
justifyContent: FlexAlign.Start
}) {
Text() {
Span(`${this.swiperIndex + 1}`)
.fontSize(24)
.fontFamily('PingFang SC-Medium')
.fontWeight(500)
.lineHeight(28)
Span(`/${this.photoList.length}`)
.fontSize(14)
.fontFamily('PingFang SC-Medium')
.fontWeight(500)
.lineHeight(19)
}.fontColor(Color.White).margin(4)
}
}
.width('100%')
.margin({
top: 8,
left: 18,
bottom: 24,
right: 18
})
}
.scrollable(ScrollDirection.Vertical)
.scrollBarWidth(0)
}
.id('e_swiper_titles')
.alignRules({
bottom: { anchor: "__container__", align: VerticalAlign.Bottom },
middle: { anchor: "__container__", align: HorizontalAlign.Center }
})
}
ImageDownloadComponent({ url: this.photoList[this.swiperIndex].picPath })
.alignRules({
bottom: { anchor: "__container__", align: VerticalAlign.Bottom },
right: { anchor: "__container__", align: HorizontalAlign.End }
})
.margin({
top: 8,
left: 18,
bottom: 24,
right: 18
})
.id("downloadImg")
}
.width('100%')
.height('100%')
.backgroundColor(Color.Black)
.id('e_picture_container')
// 设置顶部绘制延伸到状态栏
// 设置底部绘制延伸到导航条
.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM])
}
}
\ No newline at end of file
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card19Component.ets
View file @
68f9316
...
...
@@ -102,7 +102,7 @@ export struct Card19Component {
}
return photo
})
ProcessUtils.gotoMultiPictureListPage(photoList)
ProcessUtils.gotoMultiPictureListPage(photoList
,0
)
})
//TODO 底部的:分享、评论、点赞 功能;需要引用一个公共组件
}
...
...
sight_harmony/features/wdComponent/src/main/ets/components/mine/appointment/AppointmentListUI.ets
View file @
68f9316
...
...
@@ -9,12 +9,13 @@ import { EmptyComponent } from '../../view/EmptyComponent';
const TAG = "AppointmentListUI"
@Component
export struct AppointmentListUI{
export struct AppointmentListUI
{
@State data: LazyDataSource<MineAppointmentItem> = new LazyDataSource();
@State count:number = 0;
@State isLoading:boolean = false
@State hasMore:boolean = true
curPageNum:number = 1;
@State count: number = 0;
@State isLoading: boolean = false
@State hasMore: boolean = true
curPageNum: number = 1;
@State isGetRequest: boolean = false
aboutToAppear() {
this.getNewPageData()
...
...
@@ -23,37 +24,41 @@ export struct AppointmentListUI{
build() {
Column() {
//标题栏目
CustomTitleUI({titleName:"预约列表"})
if(this.count == 0){
EmptyComponent({emptyType:10})
.height('100%')
.width('100%')
}else{
CustomTitleUI({ titleName: "预约列表" })
if (this.count == 0) {
if (this.isGetRequest == true) {
EmptyComponent({ emptyType: 10 })
.height('100%')
.width('100%')
}
} else {
//刷新控件 TODO
//List
List({ space: '6lpx' }) {
LazyForEach(this.data, (item: MineAppointmentItem, index: number) => {
ListItem() {
AppointmentListChildComponent({
item:item
})
AppointmentListChildComponent({
item: item
})
}
.onClick(()
=>
{
.onClick(()
=>
{
//TODO 跳转
})
}, (item: MineAppointmentItem, index: number) => index.toString())
//没有更多数据 显示提示
if(!this.hasMore){
ListItem(){
if (!this.hasMore) {
ListItem() {
ListHasNoMoreDataUI()
}
}
}.cachedCount(4)
}
.cachedCount(4)
.scrollBar(BarState.Off)
.margin({
top:'23lpx',left:'23lpx',right:'23lpx'
})
.margin({
top: '23lpx', left: '23lpx', right: '23lpx'
})
.layoutWeight(1)
.onReachEnd(()=>{
console.log(TAG,"触底了");
if(!this.isLoading){
.onReachEnd(() => {
console.log(TAG, "触底了");
if (!this.isLoading) {
//加载分页数据
this.getNewPageData()
}
...
...
@@ -65,70 +70,73 @@ export struct AppointmentListUI{
.width('100%')
}
getNewPageData()
{
getNewPageData()
{
this.isLoading = true
if(this.hasMore){
MinePageDatasModel.getAppointmentListData("20",`${this.curPageNum}`,getContext(this)).then((value)=>{
if (!this.data || value.list.length == 0){
this.hasMore = false
}else{
value.list.forEach((value)=>{
let dealTime = this.DealStartTime(value.planStartTime)
if(dealTime!=null && dealTime.length === 2){
this.data.push(new MineAppointmentItem(value.imageUrl,value.status,value.title,true,dealTime[0],dealTime[1],value.relType,value.liveId,value.relId))
}else {
this.data.push(new MineAppointmentItem(value.imageUrl,value.status,value.title,true,"","",value.relType,value.liveId,value.relId))
}
})
this.data.notifyDataReload()
this.count = this.data.totalCount()
if (this.data.totalCount() < value.totalCount) {
this.curPageNum++
}else {
this.hasMore = false
if (this.hasMore) {
MinePageDatasModel.getAppointmentListData("20", `${this.curPageNum}`, getContext(this)).then((value) => {
if (!this.data || value.list.length == 0) {
this.hasMore = false
} else {
value.list.forEach((value) => {
let dealTime = this.DealStartTime(value.planStartTime)
if (dealTime != null && dealTime.length === 2) {
this.data.push(new MineAppointmentItem(value.imageUrl, value.status, value.title, true, dealTime[0], dealTime[1], value.relType, value.liveId, value.relId))
} else {
this.data.push(new MineAppointmentItem(value.imageUrl, value.status, value.title, true, "", "", value.relType, value.liveId, value.relId))
}
})
this.data.notifyDataReload()
this.count = this.data.totalCount()
if (this.data.totalCount() < value.totalCount) {
this.curPageNum++
} else {
this.hasMore = false
}
}).catch((err:Error)=>{
console.log(TAG,JSON.stringify(err))
})
}
this.isGetRequest = true
this.isLoading = false
}).catch((err: Error) => {
console.log(TAG, JSON.stringify(err))
this.isGetRequest = true
this.isLoading = false
})
}
this.isLoading = false
}
DealStartTime(planStartTime:string):string[]{
let dealData:string[] = []
DealStartTime(planStartTime: string): string[] {
let dealData: string[] = []
if(!StringUtils.isNotEmpty(planStartTime)){
console.log(TAG,"格式有误")
if (!StringUtils.isNotEmpty(planStartTime)) {
console.log(TAG, "格式有误")
return dealData
}
if(planStartTime.indexOf(" ") === -1){
console.log(TAG,"格式有误")
if (planStartTime.indexOf(" ") === -1) {
console.log(TAG, "格式有误")
return dealData
}
let arr = planStartTime.split(" ")
if
(arr!=null && StringUtils.isNotEmpty(arr[0])){
//处理年月日
if
(arr != null && StringUtils.isNotEmpty(arr[0])) {
//处理年月日
let time = arr[0].split("-");
if(time.length === 3){
let month = time[1].indexOf("0") === 0 ? time[1].substring(1):time[1]
if (time.length === 3) {
let month = time[1].indexOf("0") === 0 ? time[1].substring(1) : time[1]
let day = time[2]
dealData[0] = `${month}月${day}日`
let today = `${new Date().getMonth()+1}月${new Date().getDate()}日`
if(dealData[0] === today){
let today = `${new Date().getMonth() + 1}月${new Date().getDate()}日`
if (dealData[0] === today) {
dealData[0] = "今日"
}
}
}
if
(arr!=null && StringUtils.isNotEmpty(arr[1])){
//处理时分
if
(arr != null && StringUtils.isNotEmpty(arr[1])) {
//处理时分
let time = arr[1].split(":");
if(time.length === 3){
dealData[1] = `${time[0]}:${time[1]}`
if (time.length === 3) {
dealData[1] = `${time[0]}:${time[1]}`
}
}
console.log(TAG,JSON.stringify(dealData))
console.log(TAG,
JSON.stringify(dealData))
return dealData
}
}
\ No newline at end of file
...
...
sight_harmony/features/wdComponent/src/main/ets/components/mine/follow/FollowChildComponent.ets
View file @
68f9316
...
...
@@ -256,11 +256,13 @@ export struct FollowChildComponent{
if (value.code === 0 || value.code.toString() === "0") {
this.data.status = this.data.status ==="0"?"1":"0"
if(this.data.status === "1"){
UserDataLocal.setUserFollowOperation(DateTimeUtils.getTimeStamp()+"")
}else{
UserDataLocal.setUserFollowOperation(DateTimeUtils.getTimeStamp()+","+this.data.creatorId)
}
UserDataLocal.setUserFollowOperation(this.data.creatorId+","+this.data.status)
// if(this.data.status === "1"){
// UserDataLocal.setUserFollowOperation(DateTimeUtils.getTimeStamp()+"")
// }else{
// UserDataLocal.setUserFollowOperation(DateTimeUtils.getTimeStamp()+","+this.data.creatorId)
// }
}
}
})
...
...
sight_harmony/features/wdComponent/src/main/ets/components/mine/follow/FollowListDetailUI.ets
View file @
68f9316
...
...
@@ -24,6 +24,7 @@ export struct FollowListDetailUI {
@State hasMore: boolean = true
curPageNum: number = 1;
preferences: dataPreferences.Preferences | null = null;
@State isGetRequest: boolean = false
aboutToAppear() {
this.getNewPageData()
...
...
@@ -33,9 +34,12 @@ export struct FollowListDetailUI {
build() {
Column() {
if (this.count === 0) {
EmptyComponent({emptyType:14})
.layoutWeight(1)
.width('100%')
if (this.isGetRequest == true) {
EmptyComponent({ emptyType: 14 })
.layoutWeight(1)
.width('100%')
}
} else {
List({ space: 3 }) {
LazyForEach(this.data, (item: FollowListDetailItem, index: number = 0) => {
...
...
@@ -47,7 +51,7 @@ export struct FollowListDetailUI {
}, (item: FollowListDetailItem) => item.creatorId)
//没有更多数据 显示提示
if (!this.hasMore) {
if (!this.hasMore
&& this.count != 0
) {
ListItem() {
ListHasNoMoreDataUI()
}
...
...
@@ -75,16 +79,17 @@ export struct FollowListDetailUI {
let observer = (key: string) => {
if (key == UserDataLocal.USER_FOLLOW_OPERATION) {
if (this.creatorDirectoryId === -1) {
let value = SPHelper.default.getSync(UserDataLocal.USER_FOLLOW_OPERATION,"") as string
let value = SPHelper.default.getSync(UserDataLocal.USER_FOLLOW_OPERATION,
"") as string
let arr = value.split(',')
if(arr!=null && arr.length === 2){
this.data.getDataArray().forEach((element,index) => {
if (element.creatorId === arr[1]) {
if (arr[1] == "0") {
this.data.getDataArray().forEach((element, index) => {
if (element.creatorId === arr[0]) {
this.data.deleteItem(index)
this.count = this.data.size()
}
});
}else{
if(!this.isLoading){
} else {
if (!this.isLoading) {
this.isLoading = true
this.hasMore = true
this.curPageNum = 1
...
...
@@ -93,6 +98,16 @@ export struct FollowListDetailUI {
this.getMyFollowListDetail()
}
}
}else{
let value = SPHelper.default.getSync(UserDataLocal.USER_FOLLOW_OPERATION, "") as string
let arr = value.split(',')
if (arr[1] == "0"){
this.data.getDataArray().forEach((element, index) => {
if (element.creatorId === arr[0]) {
this.data.getData(index).status = "0"
}
})
}
}
}
}
...
...
@@ -109,7 +124,7 @@ export struct FollowListDetailUI {
this.isLoading = false
} else {
value.list.forEach((value) => {
let fansNum:number = value.fansNum
let fansNum:
number = value.fansNum
let fansNumString = ""
if (fansNum > 10000) {
let temp = (fansNum / 10000) + ""
...
...
@@ -123,7 +138,7 @@ export struct FollowListDetailUI {
} else {
fansNumString = fansNum + ""
}
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))
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))
})
this.data.notifyDataReload()
this.count = this.data.totalCount()
...
...
@@ -134,12 +149,15 @@ export struct FollowListDetailUI {
}
}
this.isLoading = false
this.isGetRequest = true
}).catch((err: Error) => {
console.log(TAG, "请求失败")
this.isGetRequest = true
this.isLoading = false
})
}else {
}
else {
this.isLoading = false
this.isGetRequest = true
}
}
...
...
@@ -161,6 +179,7 @@ export struct FollowListDetailUI {
}).catch((err: Error) => {
console.log(TAG, "请求失败")
this.isLoading = false
this.isGetRequest = true
})
}
}
...
...
@@ -169,7 +188,7 @@ export struct FollowListDetailUI {
getFollowListStatus(result: MineFollowListDetailItem) {
let data_temp: FollowListDetailItem[] = []
result.list.forEach((item) => {
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))
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))
})
let request = new CreatorDetailRequestItem()
...
...
@@ -206,6 +225,7 @@ export struct FollowListDetailUI {
console.log(TAG, JSON.stringify(err))
this.isLoading = false
this.count = this.count === -1 ? 0 : this.count
this.isGetRequest = true
})
}
...
...
@@ -225,7 +245,7 @@ export struct FollowListDetailUI {
})
result.forEach((item) => {
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))
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))
})
this.data.notifyDataReload()
...
...
@@ -238,9 +258,11 @@ export struct FollowListDetailUI {
}
this.isLoading = false
this.isGetRequest = true
}).catch((err: Error) => {
console.log(TAG, "请求失败")
this.isLoading = false
this.isGetRequest = true
})
}
}
\ No newline at end of file
...
...
sight_harmony/features/wdComponent/src/main/ets/components/mine/home/HomePageBottomComponent.ets
View file @
68f9316
...
...
@@ -27,6 +27,7 @@ export struct HomePageBottomComponent{
@State userId:string = "";
@Link commentNum:number
preferences: dataPreferences.Preferences | null = null;
@State isGetRequest:boolean = false
aboutToAppear(){
this.getNewPageData()
...
...
@@ -39,10 +40,11 @@ export struct HomePageBottomComponent{
if (key == UserDataLocal.USER_FOLLOW_OPERATION) {
let value = SPHelper.default.getSync(UserDataLocal.USER_FOLLOW_OPERATION,"") as string
let arr = value.split(',')
if(arr
!=null && arr.length === 2
){
if(arr
[1] == "0"
){
this.data_follow.getDataArray().forEach((element,index) => {
if (element.creatorId === arr[
1
]) {
if (element.creatorId === arr[
0
]) {
this.data_follow.deleteItem(index)
this.count = this.data_follow.size()
}
});
}else{
...
...
@@ -62,12 +64,14 @@ export struct HomePageBottomComponent{
build(){
Column(){
Divider().width('100%')
.height('2lpx')
.strokeWidth('1lpx')
.backgroundColor($r('app.color.color_EDEDED'))
if(this.isGetRequest == true){
Divider().width('100%')
.height('2lpx')
.strokeWidth('1lpx')
.backgroundColor($r('app.color.color_EDEDED'))
}
if(this.count === 0){
if(this.count === 0
){
if(this.style === 1){
Column(){
Row(){
...
...
@@ -92,15 +96,19 @@ export struct HomePageBottomComponent{
let params = {'index': "1"} as Record<string, string>
WDRouterRule.jumpWithPage(WDRouterPage.followListPage,params)
})
EmptyComponent({emptyType:14})
.layoutWeight(1)
.width('100%')
if(this.isGetRequest == true){
EmptyComponent({emptyType:14})
.layoutWeight(1)
.width('100%')
}
}.layoutWeight(1)
.justifyContent(FlexAlign.Start)
}else{
ListHasNoMoreDataUI({style:2})
.layoutWeight(1)
if(this.isGetRequest == true){
EmptyComponent({emptyType:11})
.layoutWeight(1)
.width('100%')
}
}
}else{
if(this.style === 1){
...
...
@@ -244,12 +252,15 @@ export struct HomePageBottomComponent{
}
}
this.isLoading = false
this.isGetRequest = true
}).catch((err:Error)=>{
console.log(TAG,"请求失败")
this.isLoading = false
this.isGetRequest = true
})
}else{
this.isLoading = false
this.isGetRequest = true
}
}
...
...
@@ -266,17 +277,18 @@ export struct HomePageBottomComponent{
MinePageDatasModel.getMineCommentListData(time,object,getContext(this)).then((value)=>{
if (!this.data_comment || value.list.length == 0){
this.hasMore = false
this.isLoading = false
}else{
this.getCommentListStatus(value)
}
this.isLoading = false
this.commentNum = value.totalCount
}).catch((err:Error)=>{
console.log(TAG,"请求失败")
this.isLoading = false
this.isGetRequest = true
})
}else{
this.isLoading = false
this.isGetRequest = true
}
}
}
...
...
@@ -329,9 +341,11 @@ export struct HomePageBottomComponent{
}
this.isLoading = false
this.isGetRequest = true
}).catch((err:Error)=>{
console.log(TAG,"请求失败")
this.isLoading = false
this.isGetRequest = true
})
}
...
...
sight_harmony/features/wdComponent/src/main/ets/components/mine/home/OtherHomePageBottomCommentComponent.ets
View file @
68f9316
...
...
@@ -6,50 +6,61 @@ import { ListHasNoMoreDataUI } from '../../reusable/ListHasNoMoreDataUI';
import { MineCommentListDetailItem } from '../../../viewmodel/MineCommentListDetailItem';
import { OtherUserCommentLikeStatusRequestItem } from '../../../viewmodel/OtherUserCommentLikeStatusRequestItem';
import { ChildCommentComponent } from './ChildCommentComponent';
import { EmptyComponent } from '../../view/EmptyComponent';
const TAG = "HomePageBottomComponent"
@Component
export struct OtherHomePageBottomCommentComponent{
export struct OtherHomePageBottomCommentComponent
{
@Prop curUserId: string
@State data_comment: LazyDataSource<CommentListItem> = new LazyDataSource();
@State isLoading:boolean = false
@State hasMore:boolean = true
curPageNum:number = 1;
@State count:number = 0;
@Prop levelHead:string
@Link commentNum:number
aboutToAppear(){
@State isLoading: boolean = false
@State hasMore: boolean = true
curPageNum: number = 1;
@State count: number = 0;
@Prop levelHead: string
@Link commentNum: number
@State isGetRequest: boolean = false
aboutToAppear() {
this.getNewPageData()
}
build(){
Column(){
build() {
Column() {
Divider().width('100%')
.height('2lpx')
.strokeWidth('1lpx')
.backgroundColor($r('app.color.color_EDEDED'))
if(this.count === 0){
ListHasNoMoreDataUI({style:2})
.height('100%')
}else{
if (this.count === 0) {
if (this.isGetRequest == true) {
EmptyComponent({emptyType:11})
.height('100%')
.layoutWeight(1)
}
} else {
List({ space: 3 }) {
LazyForEach(this.data_comment, (item: CommentListItem, index: number = 0) => {
ListItem() {
ChildCommentComponent({data: item,levelHead:this.levelHead,isLastItem:index===this.data_comment.totalCount()-1})
ChildCommentComponent({
data: item,
levelHead: this.levelHead,
isLastItem: index === this.data_comment.totalCount() - 1
})
}
.onClick(() => {
})
}, (item: CommentListItem, index: number) => index.toString())
//没有更多数据 显示提示
if(!this.hasMore){
ListItem(){
if (!this.hasMore) {
ListItem() {
ListHasNoMoreDataUI()
}
}
}.cachedCount(15)
}
.cachedCount(15)
.layoutWeight(1)
.scrollBar(BarState.Off)
.edgeEffect(EdgeEffect.None)
...
...
@@ -57,9 +68,9 @@ export struct OtherHomePageBottomCommentComponent{
scrollForward: NestedScrollMode.PARENT_FIRST,
scrollBackward: NestedScrollMode.SELF_FIRST
})
.onReachEnd(()=>{
console.log(TAG,"触底了");
if(!this.isLoading){
.onReachEnd(() => {
console.log(TAG, "触底了");
if (!this.isLoading) {
this.isLoading = true
//加载分页数据
this.getNewPageData()
...
...
@@ -72,7 +83,6 @@ export struct OtherHomePageBottomCommentComponent{
.justifyContent(FlexAlign.Start)
}
@Styles
listStyle() {
.backgroundColor(Color.White)
...
...
@@ -81,60 +91,64 @@ export struct OtherHomePageBottomCommentComponent{
.borderRadius(12)
}
getNewPageData(){
getNewPageData()
{
this.isLoading = true
if
(this.hasMore)
{
if
(this.hasMore)
{
let time = encodeURI(DateTimeUtils.getCurDate(DateTimeUtils.PATTERN_DATE_TIME_HYPHEN))
let object = new OtherUserCommentListRequestItem("",
20,this.curPageNum,time,"1",
this.curUserId)
let object = new OtherUserCommentListRequestItem("",
20, this.curPageNum, time, "1",
this.curUserId)
MinePageDatasModel.getOtherCommentListData(object,getContext(this)).then((value)=>{
if (!this.data_comment || value.list.length == 0){
MinePageDatasModel.getOtherCommentListData(object, getContext(this)).then((value) => {
if (!this.data_comment || value.list.length == 0) {
this.hasMore = false
this.isLoading = false
}
else
{
}
else
{
this.getCommentListStatus(value)
}
}).catch((err:Error)=>{
console.log(TAG,"请求失败")
}).catch((err: Error) => {
console.log(TAG, "请求失败")
this.isLoading = false
this.isGetRequest = true
})
} else {
this.isGetRequest = true
this.isLoading = false
}
}
getCommentListStatus(value:
MineCommentListDetailItem)
{
getCommentListStatus(value:
MineCommentListDetailItem)
{
let status = new OtherUserCommentLikeStatusRequestItem()
let data : CommentListItem[] = []
value.list.forEach((item)=>{
if(item.checkStatus === 2){
let data: CommentListItem[] = []
value.list.forEach((item) => {
if (item.checkStatus === 2) {
status.commentIdList.push(item.id)
}
let commentContent = item.commentContent
if
(item.sensitiveShow === 0 && item.sensitiveExist === 1)
{
if
(item.sensitiveShow === 0 && item.sensitiveExist === 1)
{
commentContent = item.commentContentSensitive
}
let parentCommentContent = ""
if
(item.parentCommentVo!=null )
{
if
(item.parentCommentVo != null)
{
parentCommentContent = item.parentCommentVo.commentContent
}
let parentCommentUserName = ""
if
(item.parentCommentVo!=null )
{
if
(item.parentCommentVo != null)
{
parentCommentUserName = item.parentCommentVo.fromUserName
}
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))
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))
})
MinePageDatasModel.getOtherUserCommentLikeStatusData(status,getContext(this)).then((newValue)=>{
newValue.forEach((item)=>{
data.forEach((list)=>{
MinePageDatasModel.getOtherUserCommentLikeStatusData(status, getContext(this)).then((newValue) => {
newValue.forEach((item) => {
data.forEach((list) => {
if (item.commentId == list.id) {
list.like_status = item.status
}
})
})
data.forEach((item)=>{
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))
data.forEach((item) => {
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))
})
this.data_comment.notifyDataReload()
...
...
@@ -143,14 +157,16 @@ export struct OtherHomePageBottomCommentComponent{
this.commentNum = value.totalCount
if (this.data_comment.totalCount() < value.totalCount) {
this.curPageNum++
}else {
}
else {
this.hasMore = false
}
this.isLoading = false
}).catch((err:Error)=>{
console.log(TAG,"请求失败")
this.isGetRequest = true
}).catch((err: Error) => {
console.log(TAG, "请求失败")
this.isLoading = false
this.isGetRequest = true
})
}
}
\ No newline at end of file
...
...
sight_harmony/features/wdComponent/src/main/ets/components/mine/home/OtherHomePageBottomFollowComponent.ets
View file @
68f9316
...
...
@@ -17,6 +17,7 @@ export struct OtherHomePageBottomFollowComponent{
curPageNum:number = 1;
@State count:number = 0;
@Prop curUserId: string
@State isGetRequest:boolean = false
aboutToAppear(){
...
...
@@ -54,10 +55,11 @@ export struct OtherHomePageBottomFollowComponent{
let params = {'index': "1"} as Record<string, string>
WDRouterRule.jumpWithPage(WDRouterPage.followListPage,params)
})
EmptyComponent({emptyType:14})
.layoutWeight(1)
.width('100%')
if(this.isGetRequest == true){
EmptyComponent({emptyType:14})
.layoutWeight(1)
.width('100%')
}
}.layoutWeight(1)
.justifyContent(FlexAlign.Start)
}else{
...
...
@@ -155,10 +157,15 @@ export struct OtherHomePageBottomFollowComponent{
}
}
this.isLoading = false
this.isGetRequest = true
}).catch((err:Error)=>{
console.log(TAG,"请求失败")
this.isLoading = false
this.isGetRequest = true
})
}else{
this.isGetRequest = true
this.isLoading = false
}
}
}
\ No newline at end of file
...
...
sight_harmony/features/wdComponent/src/main/ets/components/search/SearchRelatedComponent.ets
View file @
68f9316
...
...
@@ -63,8 +63,4 @@ export struct SearchRelatedComponent {
.padding({ left: '31lpx', right: '31lpx' })
}
test(){
let c = "12121212121"
}
}
\ No newline at end of file
...
...
sight_harmony/features/wdComponent/src/main/ets/components/search/SearchResultComponent.ets
View file @
68f9316
...
...
@@ -36,7 +36,7 @@ export struct SearchResultComponent {
getSuggestData() {
this.isLoading = true
let request: SearchSuggestRequestItem = new SearchSuggestRequestItem(2, "", "", HttpUrlUtils.getImei(), UserDataLocal.
userId
, 8, "")
let request: SearchSuggestRequestItem = new SearchSuggestRequestItem(2, "", "", HttpUrlUtils.getImei(), UserDataLocal.
getUserId()
, 8, "")
SearcherAboutDataModel.getSearchSuggestData(request, getContext(this)).then((value) => {
value.forEach((item) => {
...
...
sight_harmony/features/wdComponent/src/main/ets/components/setting/AboutPageUI.ets
View file @
68f9316
...
...
@@ -9,7 +9,6 @@ export struct AboutPageUI {
@State listData: Array<string | Array<string>> = ['隐私授权协议', '软件许可及用户协议'];
@State message: string = '京ICP备16066560号-6A Copyright © 人民日报客户端\nall rights reserved.'
@State version: string = '版本号:v'
clickTimes: number = 0
dialogController: CustomDialogController = new CustomDialogController({
builder: EnvironmentCustomDialog({
cancel: () => {
...
...
@@ -42,12 +41,12 @@ export struct AboutPageUI {
.width('278lpx')
.height('154lpx')
.margin({ top: '173lpx', bottom: '154lpx' })
.onClick(() => {
this.clickTimes++
if (this.clickTimes > 2) {
this.dialogController.open()
}
})
.gesture(
TapGesture({ count: 2 })
.onAction((event: GestureEvent) => {
this.dialogController.open()
})
)
// Row(){
//
// }.backgroundColor(Color.Yellow)
...
...
sight_harmony/features/wdComponent/src/main/ets/components/setting/EnvironmentCustomDialog.ets
View file @
68f9316
import { SPHelper } from 'wdKit/Index';
import { HttpUrlUtils } from 'wdNetwork/Index';
import { H
ostEnum, HostManager, H
ttpUrlUtils } from 'wdNetwork/Index';
@CustomDialog
export struct EnvironmentCustomDialog {
currentEnvironment: string = HttpUrlUtils.HOST_PRODUCT
;
@State currentEnvironment: string = HostManager.getHost()
;
controller: CustomDialogController
cancel: () => void = () => {
}
...
...
@@ -21,12 +21,12 @@ export struct EnvironmentCustomDialog {
.margin({ top: 20 })
Row() {
Radio({ value: 'Radio1', group: 'radioGroup' })
.checked(t
rue
)
.checked(t
his.currentEnvironment == HostEnum.HOST_SIT
)
.height(20)
.width(20)
.onChange((isChecked: boolean) => {
if (isChecked) {
this.currentEnvironment = H
ttpUrlUtils
.HOST_SIT;
this.currentEnvironment = H
ostEnum
.HOST_SIT;
}
})
Text('切换到SIT(测试)环境,重启应用生效')
...
...
@@ -37,12 +37,12 @@ export struct EnvironmentCustomDialog {
Row() {
Radio({ value: 'Radio1', group: 'radioGroup' })
.checked(t
rue
)
.checked(t
his.currentEnvironment == HostEnum.HOST_UAT
)
.height(20)
.width(20)
.onChange((isChecked: boolean) => {
if (isChecked) {
this.currentEnvironment = H
ttpUrlUtils
.HOST_UAT;
this.currentEnvironment = H
ostEnum
.HOST_UAT;
}
})
Text('切换到UAT(预发布)环境,重启应用生效')
...
...
@@ -53,12 +53,12 @@ export struct EnvironmentCustomDialog {
Row() {
Radio({ value: 'Radio1', group: 'radioGroup' })
.checked(t
rue
)
.checked(t
his.currentEnvironment == HostEnum.HOST_PRODUCT
)
.height(20)
.width(20)
.onChange((isChecked: boolean) => {
if (isChecked) {
this.currentEnvironment = H
ttpUrlUtils
.HOST_PRODUCT;
this.currentEnvironment = H
ostEnum
.HOST_PRODUCT;
}
})
Text('切换到PROD(现网)环境,重启应用生效')
...
...
@@ -69,12 +69,12 @@ export struct EnvironmentCustomDialog {
Row() {
Radio({ value: 'Radio1', group: 'radioGroup' })
.checked(t
rue
)
.checked(t
his.currentEnvironment == HostEnum.HOST_DEV
)
.height(20)
.width(20)
.onChange((isChecked: boolean) => {
if (isChecked) {
this.currentEnvironment = H
ttpUrlUtils
.HOST_DEV;
this.currentEnvironment = H
ostEnum
.HOST_DEV;
}
})
Text('切换到DEV(开发)环境,重启应用生效')
...
...
sight_harmony/features/wdComponent/src/main/ets/components/view/LikeComponent.ets
View file @
68f9316
import { Logger } from 'wdKit/Index'
import { LikeViewModel } from '../../viewmodel/LikeViewModel'
import { SPHelper } from 'wdKit';
import { WDRouterPage, WDRouterRule } from 'wdRouter/Index';
import { SpConstants } from 'wdConstant/Index';
const TAG = 'LikeComponent';
...
...
@@ -9,6 +13,8 @@ export struct LikeComponent {
viewModel: LikeViewModel = new LikeViewModel()
@Prop data: Record<string, string>
enableBtn = true
componentType : number = 1 //1: 底部栏目样式 2: 新闻页中间位置样式
@State likeCount: number = 0 //点赞数
//上层传值 样例
// this.data['contentId'] = '30035444649' //必须
...
...
@@ -23,34 +29,100 @@ export struct LikeComponent {
if (this.data) {
//获取点赞状态
this.getLikeStatus()
//获取点赞数
this.getLikeCount()
}
}
build() {
Column() {
Image(this.likeStatus ? $r('app.media.icon_like_select') : $r('app.media.icon_like_default'))
.width(24)
.height(24)
.onClick(() => {
if (!this.enableBtn) {
return
}
if (this.likeStatus) {
//1
this.executeLike('0')
} else {
//0
this.executeLike('1')
if (this.componentType == 2){
//2: 新闻页中间位置样式
Column() {
Button(){
Row(){
Image(this.likeStatus ? $r('app.media.icon_like_select') : $r('app.media.icon_like_default'))
.width(20)
.height(20)
Text(this.likeCount.toString())
.height(20)
.margin({
right: 0,
left: 4
})
.fontColor(this.likeStatus ? '#ED2800' : '#222222')
.fontSize('16')
}
.justifyContent(FlexAlign.Center)
.width('100%')
.height('100%')
}
.width('100%')
.height('100%')
.backgroundColor(Color.White)
.type(ButtonType.Capsule)
.borderColor('#EDEDED')
.borderRadius(20)
.borderWidth(1)
.onClick(()=>{
this.clickButtonEvent()
})
}.width(24).height(24)
}
.width(154)
.height(40)
}else {
//1: 底部栏目样式 默认样式
Column() {
Image(this.likeStatus ? $r('app.media.icon_like_select') : $r('app.media.icon_like_default'))
.width(24)
.height(24)
.onClick(() => {
this.clickButtonEvent()
})
}.width(24).height(24)
}
}
async clickButtonEvent(){
// 未登录,跳转登录
const user_id = await SPHelper.default.get(SpConstants.USER_ID, '')
if (!user_id) {
WDRouterRule.jumpWithPage(WDRouterPage.loginPage)
return
}
if (!this.enableBtn) {
return
}
if (this.likeStatus) {
//1
this.executeLike('0')
} else {
//0
this.executeLike('1')
}
}
executeLike(status: string) {
this.data['status'] = status
this.viewModel.executeLike2(this.data).then(() => {
this.likeStatus = !this.likeStatus
//点赞和取消点赞成功后更新点赞数
if(this.likeStatus){
this.likeCount ++
}else {
this.likeCount --
}
this.enableBtn = true
}).catch(() => {
this.enableBtn = true
...
...
@@ -69,5 +141,19 @@ export struct LikeComponent {
})
}
//获取点赞数
getLikeCount() {
this.viewModel.getLikeCount(this.data).then((data) => {
if (data && data['data']) {
this.likeCount = data['data']['likeNum']
}else {
this.likeCount = 0
}
}).catch(() => {
this.likeCount = 0
})
}
}
\ No newline at end of file
...
...
sight_harmony/features/wdComponent/src/main/ets/model/LikeModel.ets
View file @
68f9316
...
...
@@ -43,5 +43,27 @@ export class LikeModel {
getLikeCount(data: Record<string, string>) {
let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();
let channelId : string = data['channelId']
let contentId : string = data['contentId']
let contentType : string = data['contentType']
let detail : string = '1'
let url = HttpUrlUtils.getLikeCount() + `?channelId=${channelId}&contentId=${contentId}&contentType=${contentType}&detail=${detail}`
return new Promise<object>((success, fail) => {
HttpBizUtil.get<ResponseDTO<object>>(url, headers).then((data: ResponseDTO<object>) => {
if (data.code != 0) {
fail(data.message)
return
}
success(data)
}, (error: Error) => {
fail(error.message)
Logger.debug("LoginViewModel:error ", error.toString())
})
})
}
}
\ No newline at end of file
...
...
sight_harmony/features/wdComponent/src/main/ets/model/LogoutModel.ets
View file @
68f9316
...
...
@@ -7,7 +7,7 @@ export class LogoutModel{
requestLogout(){
let bean: Record<string, string> = {};
bean['refreshToken'] =
UserDataLocal.USER_REFRESH_TOKEN
bean['refreshToken'] =
HttpUrlUtils.getRefreshToken()
bean['refreshToken'] = 'ddrqreeee'
let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();
return new Promise<string>((success, fail) => {
...
...
sight_harmony/features/wdComponent/src/main/ets/model/SearcherAboutDataModel.ets
View file @
68f9316
...
...
@@ -19,7 +19,7 @@ const TAG = "SearcherAboutDataModel"
class SearcherAboutDataModel{
private static instance: SearcherAboutDataModel;
public searchHistoryData:SearchHistoryItem[] = []
public SEARCH_HISTORY_KEY:string = "SEARCH_HISTORY_KEY" + UserDataLocal.
userId
public SEARCH_HISTORY_KEY:string = "SEARCH_HISTORY_KEY" + UserDataLocal.
getUserId()
private constructor() { }
...
...
sight_harmony/features/wdComponent/src/main/ets/pages/MultiPictureListPage.ets
View file @
68f9316
import { PhotoListBean } from 'wdBean/Index';
import { display, router } from '@kit.ArkUI';
import { Logger } from 'wdKit/Index';
import { ImageItemView } from '../components/view/ImageItemView';
import { ImageDownloadComponent } from '../components/ImageDownloadComponent';
import { Action } from 'wdBean';
...
...
@@ -10,7 +9,6 @@ const TAG = 'MultiPictureListPage';
@Entry
@Component
export struct MultiPictureListPage {
@Provide @Watch('onCurrentPageNumUpdated') currentPageNum: string = '01'
private scroller: Scroller = new Scroller()
@State swiperIndex: number = 0;
photoList: PhotoListBean[] = [];
...
...
@@ -20,17 +18,10 @@ export struct MultiPictureListPage {
private picWidth: number = 0
@State picHeight: number = 0
@State isEnableSwipe: boolean = true;
@State currentUrl: string = ''
// @Provide bgc: Color = Color.White;
//watch监听页码回调
onCurrentPageNumUpdated(): void {
Logger.info(TAG, `currentPageNum:${this.currentPageNum}`,)
let _swiperIndex = Number.parseInt(this.currentPageNum)
Logger.info(TAG, `_swiperIndex:${_swiperIndex}`)
this.swiperIndex = _swiperIndex > 0 ? _swiperIndex - 1 : _swiperIndex
}
aboutToAppear(): void {
//获取宽高尺寸
this.screenWidth = this.displayTool.width
...
...
@@ -40,6 +31,8 @@ export struct MultiPictureListPage {
let par: Action = router.getParams() as Action;
let params = par?.params;
this.photoList = params?.extra?.photoList || [];
this.swiperIndex = params?.extra?.swiperIndex || 0;
this.currentUrl = this.photoList[this.swiperIndex]?.picPath
}
build() {
...
...
@@ -80,6 +73,7 @@ export struct MultiPictureListPage {
})
.onChange((index: number) => {
this.swiperIndex = index
this.currentUrl = this.photoList[index]?.picPath
})
Row() {
...
...
@@ -121,7 +115,7 @@ export struct MultiPictureListPage {
})
}
ImageDownloadComponent({ url: this.
photoList[this.swiperIndex].picPath
})
ImageDownloadComponent({ url: this.
currentUrl
})
.alignRules({
bottom: { anchor: "__container__", align: VerticalAlign.Bottom },
right: { anchor: "__container__", align: HorizontalAlign.End }
...
...
sight_harmony/features/wdComponent/src/main/ets/viewmodel/LikeViewModel.ets
View file @
68f9316
...
...
@@ -48,5 +48,19 @@ export class LikeViewModel {
}
//点赞数
getLikeCount(bean: Record<string, string>) {
return new Promise<object>((success, fail) => {
this.likeModel.getLikeCount(bean).then((data) => {
success(data)
}).catch((error: string) => {
fail(error)
})
})
}
}
\ No newline at end of file
...
...
sight_harmony/features/wdComponent/src/main/ets/viewmodel/LogoutViewModel.ets
View file @
68f9316
...
...
@@ -20,15 +20,15 @@ export class LogoutViewModel{
}
static clearLoginInfo() {
SPHelper.default.save(SpConstants.USER_FIRST_MARK, '')
SPHelper.default.save(SpConstants.USER_ID, '')
SPHelper.default.save(SpConstants.USER_JWT_TOKEN, '')
SPHelper.default.save(SpConstants.USER_LONG_TIME_NO_LOGIN_MARK, '')
SPHelper.default.save(SpConstants.USER_REFRESH_TOKEN, '')
SPHelper.default.save(SpConstants.USER_STATUS, '')
SPHelper.default.save(SpConstants.USER_Type, '')
SPHelper.default.save(SpConstants.USER_NAME, '')
SPHelper.default.save(SpConstants.USER_PHONE, '')
SPHelper.default.saveSync(SpConstants.USER_FIRST_MARK, '')
SPHelper.default.saveSync(SpConstants.USER_ID, '')
SPHelper.default.saveSync(SpConstants.USER_JWT_TOKEN, '')
SPHelper.default.saveSync(SpConstants.USER_LONG_TIME_NO_LOGIN_MARK, '')
SPHelper.default.saveSync(SpConstants.USER_REFRESH_TOKEN, '')
SPHelper.default.saveSync(SpConstants.USER_STATUS, '')
SPHelper.default.saveSync(SpConstants.USER_Type, '')
SPHelper.default.saveSync(SpConstants.USER_NAME, '')
SPHelper.default.saveSync(SpConstants.USER_PHONE, '')
HttpUrlUtils.setUserId("")
HttpUrlUtils.setUserType("")
HttpUrlUtils.setUserToken('')
...
...
sight_harmony/features/wdComponent/src/main/ets/viewmodel/PageHelper.ets
View file @
68f9316
import {
PageDTO, CompDTO, PageInfoDTO, Content
DTO } from 'wdBean';
import {
CompDTO, ContentDTO, PageDTO, PageInfo
DTO } from 'wdBean';
import { CompStyle, ViewType } from 'wdConstant/Index';
import { CollectionUtils, DateTimeUtils, Logger, NetworkUtil } from 'wdKit';
import { closeRefresh } from '../utils/PullDownRefresh';
import PageModel from './PageModel';
import PageViewModel from './PageViewModel';
import { promptAction } from '@kit.ArkUI';
import {
AdvRuleBean,
CompAdvBean } from 'wdBean/src/main/ets/bean/adv/AdvsRuleBean';
import { CompAdvBean } from 'wdBean/src/main/ets/bean/adv/AdvsRuleBean';
import PageAdModel from './PageAdvModel';
import { ArrayList } from '@kit.ArkTS';
import { WDViewDefaultType } from '../components/view/EmptyComponent';
...
...
@@ -104,7 +104,11 @@ export class PageHelper {
if (pageDto && pageDto.compList && pageDto.compList.length > 0) {
pageModel.viewType = ViewType.LOADED;
let sizeBefore: number = pageModel.compList.size();
pageModel.currentPage++;
if (isLastGroup) {
// 认为分页只会在最后一个group里
pageModel.currentPage++;
}
// pageModel.currentPage++;
pageModel.hasMore = true;
//移除音频 和 活动
...
...
sight_harmony/features/wdDetailPlayLive/src/main/ets/pages/DetailPlayLivePage.ets
View file @
68f9316
...
...
@@ -32,15 +32,15 @@ export struct DetailPlayLivePage {
aboutToAppear(): void {
Logger.info(TAG, `wyj-aboutToAppear`)
this.listener?.on("change", (mediaQueryResult) => {
Logger.info(TAG, `change;${mediaQueryResult.matches}`)
if (mediaQueryResult?.matches) {
this.displayDirection = DisplayDirection.VIDEO_HORIZONTAL
} else {
this.displayDirection = DisplayDirection.VERTICAL
}
WindowModel.shared.setMainWindowFullScreen(this.displayDirection == DisplayDirection.VIDEO_HORIZONTAL)
})
// this.listener?.on("change", (mediaQueryResult) => {
// Logger.info(TAG, `change;${mediaQueryResult.matches}`)
// if (mediaQueryResult?.matches) {
// this.displayDirection = DisplayDirection.VIDEO_HORIZONTAL
// } else {
// this.displayDirection = DisplayDirection.VERTICAL
// }
// WindowModel.shared.setMainWindowFullScreen(this.displayDirection == DisplayDirection.VIDEO_HORIZONTAL)
// })
this.getLiveDetails()
this.getLiveRoomData()
}
...
...
@@ -67,7 +67,7 @@ export struct DetailPlayLivePage {
onPageShowCus(): void {
Logger.info(TAG, `wyj-onPageShowCus`)
// WindowModel.shared.setPreferredOrientation(window.Orientation.
AUTO_ROTATION_RESTRICT
ED);
// WindowModel.shared.setPreferredOrientation(window.Orientation.
LOCK
ED);
}
onPageHideCus(): void {
...
...
sight_harmony/features/wdDetailPlayLive/src/main/ets/widgets/details/TabLiveItemComponent.ets
View file @
68f9316
...
...
@@ -100,7 +100,7 @@ export struct TabLiveItemComponent {
picDesc: ''
})
}
this.gotoMultipleListImagePage()
this.gotoMultipleListImagePage(
index
)
})
})
}
...
...
@@ -187,13 +187,14 @@ export struct TabLiveItemComponent {
* 大图列表页
* @param content
* */
gotoMultipleListImagePage() {
gotoMultipleListImagePage(
index: number
) {
let taskAction: Action = {
type: 'JUMP_DETAIL_PAGE',
params: {
detailPageType: 18,
extra: {
photoList: this.photoList
photoList: this.photoList,
swiperIndex: index,
} as ExtraDTO
} as Params,
};
...
...
sight_harmony/features/wdDetailPlayLive/src/main/ets/widgets/details/video/PlayUIComponent.ets
View file @
68f9316
...
...
@@ -191,12 +191,15 @@ export struct PlayUIComponent {
@Builder
getMiddleUIComponent() {
Stack()
.layoutWeight(1)
.width('100%')
.onClick(() => {
this.isMenuVisible = !this.isMenuVisible
})
Stack() {
Text('播放功能暂时关闭')
.fontColor(Color.White)
}.alignContent(Alignment.Center)
.layoutWeight(1)
.width('100%')
.onClick(() => {
this.isMenuVisible = !this.isMenuVisible
})
}
@Builder
...
...
sight_harmony/features/wdDetailPlayLive/src/main/ets/widgets/details/video/TopPlayComponet.ets
View file @
68f9316
...
...
@@ -13,7 +13,7 @@ export struct TopPlayComponent {
aboutToAppear(): void {
if (this.playerController) {
this.playerController.onCanplay = () => {
this.playerController?.play()
//
this.playerController?.play()
}
}
}
...
...
@@ -31,7 +31,7 @@ export struct TopPlayComponent {
} else if (this.liveDetailsBean.liveInfo.liveState == 'end') {
playUrl = this.liveDetailsBean.liveInfo.vlive[0].replayUri
}
this.playerController?.firstPlay(playUrl);
//
this.playerController?.firstPlay(playUrl);
}
}
...
...
sight_harmony/features/wdLogin/src/main/ets/pages/login/LoginViewModel.ets
View file @
68f9316
...
...
@@ -47,14 +47,14 @@ export class LoginViewModel {
return new Promise<LoginBean>((success, fail) => {
this.loginModel.appLogin(phone, loginType, verificationCode).then((data: LoginBean) => {
SPHelper.default.save(SpConstants.USER_FIRST_MARK, data.firstMark)
SPHelper.default.save(SpConstants.USER_ID, data.id)
SPHelper.default.save(SpConstants.USER_JWT_TOKEN, data.jwtToken)
SPHelper.default.save(SpConstants.USER_LONG_TIME_NO_LOGIN_MARK, data.longTimeNoLoginMark)
SPHelper.default.save(SpConstants.USER_REFRESH_TOKEN, data.refreshToken)
SPHelper.default.save(SpConstants.USER_STATUS, data.status)
SPHelper.default.save(SpConstants.USER_Type, data.userType)
SPHelper.default.save(SpConstants.USER_NAME, data.userName)
SPHelper.default.saveSync(SpConstants.USER_FIRST_MARK, data.firstMark)
SPHelper.default.saveSync(SpConstants.USER_ID, data.id)
SPHelper.default.saveSync(SpConstants.USER_JWT_TOKEN, data.jwtToken)
SPHelper.default.saveSync(SpConstants.USER_LONG_TIME_NO_LOGIN_MARK, data.longTimeNoLoginMark)
SPHelper.default.saveSync(SpConstants.USER_REFRESH_TOKEN, data.refreshToken)
SPHelper.default.saveSync(SpConstants.USER_STATUS, data.status)
SPHelper.default.saveSync(SpConstants.USER_Type, data.userType)
SPHelper.default.saveSync(SpConstants.USER_NAME, data.userName)
HttpUrlUtils.setUserId(data.id+"")
HttpUrlUtils.setUserType(data.userType+"")
HttpUrlUtils.setUserToken(data.jwtToken)
...
...
@@ -71,14 +71,14 @@ export class LoginViewModel {
let passwordNew = await this.doMd(password)
Logger.debug(TAG, "PASSWORD:" + passwordNew)
this.loginModel.appLoginByPassword(phone, loginType, passwordNew, oldPassword).then((data: LoginBean) => {
SPHelper.default.save(SpConstants.USER_FIRST_MARK, data.firstMark)
SPHelper.default.save(SpConstants.USER_ID, data.id)
SPHelper.default.save(SpConstants.USER_JWT_TOKEN, data.jwtToken)
SPHelper.default.save(SpConstants.USER_LONG_TIME_NO_LOGIN_MARK, data.longTimeNoLoginMark)
SPHelper.default.save(SpConstants.USER_REFRESH_TOKEN, data.refreshToken)
SPHelper.default.save(SpConstants.USER_STATUS, data.status)
SPHelper.default.save(SpConstants.USER_Type, data.userType)
SPHelper.default.save(SpConstants.USER_NAME, data.userName)
SPHelper.default.saveSync(SpConstants.USER_FIRST_MARK, data.firstMark)
SPHelper.default.saveSync(SpConstants.USER_ID, data.id)
SPHelper.default.saveSync(SpConstants.USER_JWT_TOKEN, data.jwtToken)
SPHelper.default.saveSync(SpConstants.USER_LONG_TIME_NO_LOGIN_MARK, data.longTimeNoLoginMark)
SPHelper.default.saveSync(SpConstants.USER_REFRESH_TOKEN, data.refreshToken)
SPHelper.default.saveSync(SpConstants.USER_STATUS, data.status)
SPHelper.default.saveSync(SpConstants.USER_Type, data.userType)
SPHelper.default.saveSync(SpConstants.USER_NAME, data.userName)
HttpUrlUtils.setUserId(data.id+"")
HttpUrlUtils.setUserType(data.userType+"")
HttpUrlUtils.setUserToken(data.jwtToken)
...
...
@@ -94,8 +94,8 @@ export class LoginViewModel {
return new Promise<CheckVerifyBean>((success, reject) => {
this.loginModel.checkVerifyCode(phone, verifyCode).then((data: CheckVerifyBean) => {
//todo 保存数据
SPHelper.default.save(SpConstants.USER_TEMP_TOKEN, data.tempToken)
SPHelper.default.save(SpConstants.USER_JWT_TOKEN, data.jwtToken)
SPHelper.default.saveSync(SpConstants.USER_TEMP_TOKEN, data.tempToken)
SPHelper.default.saveSync(SpConstants.USER_JWT_TOKEN, data.jwtToken)
success(data)
}, (value: string) => {
...
...
@@ -107,8 +107,8 @@ export class LoginViewModel {
return new Promise<CheckVerifyBean>((success, reject) => {
this.loginModel.checkVerifyCodeByToken(verifyCode).then((data: CheckVerifyBean) => {
//todo 保存数据
SPHelper.default.save(SpConstants.USER_TEMP_TOKEN, data.tempToken)
SPHelper.default.save(SpConstants.USER_JWT_TOKEN, data.jwtToken)
SPHelper.default.saveSync(SpConstants.USER_TEMP_TOKEN, data.tempToken)
SPHelper.default.saveSync(SpConstants.USER_JWT_TOKEN, data.jwtToken)
success(data)
}, (value: string) => {
...
...
@@ -149,14 +149,14 @@ export class LoginViewModel {
this.loginModel.logOut().then((data) => {
//清除登录状态以及token、userid等信息
SPHelper.default.save(SpConstants.USER_FIRST_MARK, '')
SPHelper.default.save(SpConstants.USER_ID, '')
SPHelper.default.save(SpConstants.USER_JWT_TOKEN, '')
SPHelper.default.save(SpConstants.USER_LONG_TIME_NO_LOGIN_MARK, '')
SPHelper.default.save(SpConstants.USER_REFRESH_TOKEN, '')
SPHelper.default.save(SpConstants.USER_STATUS, '')
SPHelper.default.save(SpConstants.USER_Type, '')
SPHelper.default.save(SpConstants.USER_NAME, '')
SPHelper.default.saveSync(SpConstants.USER_FIRST_MARK, '')
SPHelper.default.saveSync(SpConstants.USER_ID, '')
SPHelper.default.saveSync(SpConstants.USER_JWT_TOKEN, '')
SPHelper.default.saveSync(SpConstants.USER_LONG_TIME_NO_LOGIN_MARK, '')
SPHelper.default.saveSync(SpConstants.USER_REFRESH_TOKEN, '')
SPHelper.default.saveSync(SpConstants.USER_STATUS, '')
SPHelper.default.saveSync(SpConstants.USER_Type, '')
SPHelper.default.saveSync(SpConstants.USER_NAME, '')
HttpUrlUtils.setUserId("")
HttpUrlUtils.setUserType("")
HttpUrlUtils.setUserToken('')
...
...
@@ -218,14 +218,14 @@ export class LoginViewModel {
this.loginModel.queryUserDetail().then((data: UserDetail) => {
//保存sp
if(data){
SPHelper.default.save(SpConstants.USER_NAME, data.userName)
SPHelper.default.save(SpConstants.USER_PHONE, data.phone)
SPHelper.default.saveSync(SpConstants.USER_NAME, data.userName)
SPHelper.default.saveSync(SpConstants.USER_PHONE, data.phone)
}
if(data.userExtend){
SPHelper.default.save(SpConstants.USER_SEX, data.userExtend.sex)
SPHelper.default.save(SpConstants.USER_CREATOR_ID, data.userExtend.creatorId+"")
SPHelper.default.save(SpConstants.USER_HEAD_PHOTO_URL, data.userExtend.headPhotoUrl)
SPHelper.default.save(SpConstants.USER_BIRTHDAY, data.userExtend.birthday)
SPHelper.default.saveSync(SpConstants.USER_SEX, data.userExtend.sex)
SPHelper.default.saveSync(SpConstants.USER_CREATOR_ID, data.userExtend.creatorId+"")
SPHelper.default.saveSync(SpConstants.USER_HEAD_PHOTO_URL, data.userExtend.headPhotoUrl)
SPHelper.default.saveSync(SpConstants.USER_BIRTHDAY, data.userExtend.birthday)
}
success(data)
...
...
sight_harmony/products/phone/src/main/ets/entryability/EntryAbility.ets
View file @
68f9316
...
...
@@ -14,7 +14,7 @@ import {
StringUtils,
WindowModel
} from 'wdKit';
import { H
ttpUrlUtils
, WDHttp } from 'wdNetwork';
import { H
ostEnum, HostManager
, WDHttp } from 'wdNetwork';
export default class EntryAbility extends UIAbility {
onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void {
...
...
@@ -25,7 +25,7 @@ export default class EntryAbility extends UIAbility {
WDHttp.initHttpHeader()
const spHostUrl = SPHelper.default.getSync('hostUrl', '') as string
if (StringUtils.isNotEmpty(spHostUrl)) {
H
ttpUrlUtils.hostUrl = spHostUrl
H
ostManager.changeHost(spHostUrl as HostEnum)
}
// 注册监听网络连接
...
...
Please
register
or
login
to post a comment