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
chenjun3_wd
2024-04-23 18:34:37 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
36c5e1fee11e161d5fbf19aec25d481bab493594
36c5e1fe
1 parent
a90187dc
直播预约状态查询TODO
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
71 additions
and
6 deletions
sight_harmony/commons/wdNetwork/src/main/ets/http/HttpUrlUtils.ets
sight_harmony/features/wdBean/Index.ets
sight_harmony/features/wdBean/src/main/ets/bean/live/ReserveBean.ets
sight_harmony/features/wdComponent/src/main/ets/components/page/ReserveMorePage.ets
sight_harmony/features/wdComponent/src/main/ets/viewmodel/LiveModel.ets
sight_harmony/commons/wdNetwork/src/main/ets/http/HttpUrlUtils.ets
View file @
36c5e1f
...
...
@@ -225,6 +225,10 @@ export class HttpUrlUtils {
*/
static readonly LIVE_APPOINTMENT_PATH: string = "/api/live-center-message/zh/c/live/subscribe";
/**
* 预约状态
*/
static readonly LIVE_APPOINTMENT_BATCH_PATH: string = "api/live-center-message/zh/c/live/subscribe/user/batch";
/**
* 搜索结果 显示tab 数
*/
...
...
@@ -285,7 +289,6 @@ 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;
/**
* 推荐列表
...
...
@@ -772,6 +775,11 @@ export class HttpUrlUtils {
return url
}
static getAppointmentStatusUrl() {
let url = HttpUrlUtils._hostUrl + HttpUrlUtils.LIVE_APPOINTMENT_BATCH_PATH
return url
}
static getSearchResultCountDataUrl() {
let url = HttpUrlUtils._hostUrl + HttpUrlUtils.SEARCH_RESULT_COUNT_DATA_PATH
return url
...
...
sight_harmony/features/wdBean/Index.ets
View file @
36c5e1f
...
...
@@ -119,10 +119,12 @@ export { ArticleListDTO } from './src/main/ets/bean/component/ArticleListDTO';
export { appStyleImagesDTO } from './src/main/ets/bean/content/appStyleImagesDTO';
export { LiveRoomBean,LiveRoomItemBean } from './src/main/ets/bean/live/LiveRoomBean';
export { LiveRoomBean,
LiveRoomItemBean } from './src/main/ets/bean/live/LiveRoomBean';
export { LiveRoomDataBean } from './src/main/ets/bean/live/LiveRoomDataBean';
export { ReserveBean } from './src/main/ets/bean/live/ReserveBean';
export { LiveInfoDTO } from './src/main/ets/bean/detail/LiveInfoDTO';
export { LiveDTO } from './src/main/ets/bean/peoples/LiveDTO';
...
...
sight_harmony/features/wdBean/src/main/ets/bean/live/ReserveBean.ets
0 → 100644
View file @
36c5e1f
export interface ReserveBean {
relationId: string,
liveId: string
}
\ No newline at end of file
...
...
sight_harmony/features/wdComponent/src/main/ets/components/page/ReserveMorePage.ets
View file @
36c5e1f
import { ContentDTO } from 'wdBean';
import { ContentDTO
, ReserveBean
} from 'wdBean';
import { ProcessUtils } from 'wdRouter';
import { CommonConstants } from 'wdConstant/Index';
import PageViewModel from '../../viewmodel/PageViewModel';
...
...
@@ -24,6 +24,7 @@ const TAG: string = 'ReserveMorePage';
struct ReserveMorePage {
@State private pageModel: PageModel = new PageModel();
@State data: LazyDataSource<ContentDTO> = new LazyDataSource();
reserveBean: ReserveBean[] = []
topSafeHeight: number = AppStorage.get<number>('topSafeHeight') as number;
type: number = 2;
currentPage: number = 1;
...
...
@@ -72,12 +73,32 @@ struct ReserveMorePage {
// }
} as ContentDTO;
aboutToAppear(): void {
PageViewModel.getLiveMoreUrl(this.type, this.currentPage, this.pageSize).then((liveReviewDTO) => {
async aboutToAppear(): Promise<void> {
// PageViewModel.get
PageViewModel.getLiveMoreUrl(this.type, this.currentPage, this.pageSize).then(async (liveReviewDTO) => {
// this.operDataList = []
// this.operDataList.push(...liveReviewDTO.list)
this.data.push(...liveReviewDTO.list)
this.reserveBean = this.transformToLiveDetailsBeans(liveReviewDTO.list)
const apointMentStatus = await LiveModel.getAppointmentStatus(this.reserveBean)
console.info(`cj2024 ${apointMentStatus.code}`)
})
}
// 这个函数遍历liveReviewDTO.list并转换为LiveDetailsBean数组
transformToLiveDetailsBeans(list: ContentDTO[]): ReserveBean[] {
const liveDetailsBeans: ReserveBean[] = [];
list.forEach(item => {
liveDetailsBeans.push({
relationId: item.relId,
liveId: item.objectId,
});
});
return liveDetailsBeans
}
build() {
...
...
@@ -274,6 +295,7 @@ struct ReserveMorePage {
//
// })
const liveDetail = await LiveModel.liveAppointment(item?.relId || '', item?.objectId || '', this.isAppointmentLive || false)
// const liveDetail = await LiveModel.getAppointmentStatus(item?.relId || '', item?.objectId || '', this.isAppointmentLive || false)
}
/*导航栏*/
...
...
sight_harmony/features/wdComponent/src/main/ets/viewmodel/LiveModel.ets
View file @
36c5e1f
...
...
@@ -2,7 +2,7 @@ import HashMap from '@ohos.util.HashMap';
import { HttpUrlUtils, ResponseDTO } from 'wdNetwork';
import { HttpRequest } from 'wdNetwork/src/main/ets/http/HttpRequest';
import { Logger, ToastUtils } from 'wdKit';
import { LiveDetailsBean } from 'wdBean/Index';
import { LiveDetailsBean
, ReserveBean
} from 'wdBean/Index';
const TAG = 'LiveModel'
...
...
@@ -66,5 +66,34 @@ export class LiveModel {
})
})
}
/**
* 查询预约状态
*
[{"relationId":"500002824823","liveId":"20000120522"},{"relationId":"500002845517","liveId":"20000120782"}]
* @returns
* @returns
*/
static getAppointmentStatus(reserveBean: ReserveBean[]) {
// let params: Record<string, ArrayList<ReserveBean>> = {};
// params = reserveBean
let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();
return new Promise<ResponseDTO<string>>((success, fail) => {
HttpRequest.post<ResponseDTO<string>>(
HttpUrlUtils.getAppointmentStatusUrl(),
reserveBean,
headers).then((data: ResponseDTO<string>) => {
if (data.code != 0) {
fail(data.message)
ToastUtils.shortToast(data.message)
return
}
success(data)
}, (error: Error) => {
fail(error.message)
Logger.debug(TAG + ":error ", error.toString())
})
})
}
}
...
...
Please
register
or
login
to post a comment