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
yangchenggong1_wd
2024-03-28 11:25:39 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
163d398a13d372831d849af4a05d72aca005731e
163d398a
1 parent
9695a1d3
desc:预约操作完善
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
190 additions
and
7 deletions
PeopleDaily_Harmony/entry/src/main/resources/rawfile/appointment_operation_data.json
PeopleDaily_Harmony/wdComponent/src/main/ets/components/page/mine/appointment/AppointmentListChildComponent.ets
PeopleDaily_Harmony/wdComponent/src/main/ets/components/page/mine/appointment/AppointmentListUI.ets
PeopleDaily_Harmony/wdComponent/src/main/ets/components/page/mine/follow/FollowListDetailUI.ets
PeopleDaily_Harmony/wdComponent/src/main/ets/components/reusable/MyCustomDialog.ets
PeopleDaily_Harmony/wdComponent/src/main/ets/model/MinePageDatasModel.ets
PeopleDaily_Harmony/wdComponent/src/main/ets/network/HttpUrlUtils.ets
PeopleDaily_Harmony/wdComponent/src/main/ets/viewmodel/AppointmentOperationRequestItem.ets
PeopleDaily_Harmony/wdComponent/src/main/ets/viewmodel/MineAppointmentItem.ets
PeopleDaily_Harmony/wdComponent/src/main/resources/base/element/color.json
PeopleDaily_Harmony/entry/src/main/resources/rawfile/appointment_operation_data.json
0 → 100644
View file @
163d398
{
"code"
:
"0"
,
"message"
:
"Success"
,
"requestId"
:
"9a63f8f9e61d442880a7537763fd1769"
,
"success"
:
true
,
"timestamp"
:
1711589284588
}
\ No newline at end of file
...
...
PeopleDaily_Harmony/wdComponent/src/main/ets/components/page/mine/appointment/AppointmentListChildComponent.ets
View file @
163d398
import MinePageDatasModel from '../../../../model/MinePageDatasModel'
import { AppointmentOperationRequestItem } from '../../../../viewmodel/AppointmentOperationRequestItem'
import { MineAppointmentItem } from '../../../../viewmodel/MineAppointmentItem'
import { MyCustomDialog } from '../../../reusable/MyCustomDialog'
@Component
export struct AppointmentListChildComponent{
@ObjectLink item: MineAppointmentItem
dialogController: CustomDialogController = new CustomDialogController({
builder: MyCustomDialog({
cancel: this.onCancel,
confirm: this.onAccept.bind(this),//如果后期回调方法里 要使用this,一定要bind
title: "提示",
tipValue: '是否确认取消预约',
}),
autoCancel: true,
alignment: DialogAlignment.Center,
offset: { dx: 0, dy: -20 },
gridCount: 4,
customStyle: false
})
build() {
Column(){
Stack(){
...
...
@@ -95,8 +112,7 @@ export struct AppointmentListChildComponent{
.height('46lpx')
.borderRadius('6lpx')
.onClick(()=>{
this.item.isAppointment = !this.item.isAppointment
//TODO 预约动作
this.dialogController.open()
})
}else {
Text(this.item.relType === 2?"去观看":"看回放")
...
...
@@ -117,4 +133,25 @@ export struct AppointmentListChildComponent{
.backgroundColor($r('app.color.white'))
.borderRadius('8lpx')
}
onCancel() {
console.info('Callback when the first button is clicked')
}
onAccept() {
console.info('Callback when the second button is clicked')
this.appointmentOperation()
}
appointmentOperation(){
let item = new AppointmentOperationRequestItem(this.item.relId,this.item.liveId+"",!this.item.isAppointment)
MinePageDatasModel.getAppointmentOperation(item,getContext(this)).then((value)=>{
if(value!=null){
if (value.code === 0 || value.code.toString() === "0") {
this.item.isAppointment = !this.item.isAppointment
}
}
})
}
}
\ No newline at end of file
...
...
PeopleDaily_Harmony/wdComponent/src/main/ets/components/page/mine/appointment/AppointmentListUI.ets
View file @
163d398
...
...
@@ -71,9 +71,9 @@ export struct AppointmentListUI{
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))
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))
this.data.push(new MineAppointmentItem(value.imageUrl,value.status,value.title,true,"","",value.relType
,value.liveId,value.relId
))
}
})
this.data.notifyDataReload()
...
...
PeopleDaily_Harmony/wdComponent/src/main/ets/components/page/mine/follow/FollowListDetailUI.ets
View file @
163d398
...
...
@@ -234,7 +234,8 @@ struct ChildComponent {
}.height('146lpx')
.justifyContent(FlexAlign.Center)
.onClick(()=>{
RouteManager.jumpNewPage("pages/OtherNormalUserHomePage",new RouterObject(this.data.attentionUserId,0))
//跳转 人民号的 主页
// RouteManager.jumpNewPage("pages/OtherNormalUserHomePage",new RouterObject(this.data.attentionUserId,0))
})
}
}
\ No newline at end of file
...
...
PeopleDaily_Harmony/wdComponent/src/main/ets/components/reusable/MyCustomDialog.ets
0 → 100644
View file @
163d398
@CustomDialog
export struct MyCustomDialog {
@State title: string = "标题"
@State tipValue: string ="提示文字"
@State leftText: string = "取消"
@State rightText: string = "确认"
controller?: CustomDialogController
cancel: () => void = () => {
}
confirm: () => void = () => {
}
build() {
Column() {
Text(this.title)
.fontSize("32lpx")
.margin({ top: "40lpx", bottom: "15lpx" })
.fontColor($r('app.color.color_333333'))
.fontSize('35lpx')
.fontWeight('600lpx')
Text(this.tipValue)
.margin({ bottom: "30lpx" })
.fontSize("27lpx")
.fontColor($r('app.color.color_B0B0B0'))
Divider()
.width("100%")
.strokeWidth('1lpx')
.height('1lpx')
.color($r('app.color.color_EEEEEE'))
Row(){
Text(this.leftText)
.fontSize('35lpx')
.fontWeight('400lpx')
.fontColor($r('app.color.color_333333'))
.onClick(() => {
this.controller.close()
this.cancel()
}).layoutWeight(1)
.textAlign(TextAlign.Center)
Divider()
.width("1lpx")
.strokeWidth('1lpx')
.vertical(true)
.height('92lpx')
.color($r('app.color.color_EEEEEE'))
Text(this.rightText)
.fontSize('35lpx')
.textAlign(TextAlign.Center)
.fontWeight('400lpx')
.fontColor($r('app.color.color_648DF2'))
.onClick(() => {
if (this.controller != undefined) {
this.controller.close()
this.confirm()
}
}).layoutWeight(1)
}
.alignItems(VerticalAlign.Center)
.height('96lpx')
}.borderRadius(10)
}
}
\ No newline at end of file
...
...
PeopleDaily_Harmony/wdComponent/src/main/ets/model/MinePageDatasModel.ets
View file @
163d398
...
...
@@ -21,6 +21,7 @@ import { OtherUserCommentListRequestItem } from '../viewmodel/OtherUserCommentLi
import { QueryCommentListIsLikedItem } from '../viewmodel/QueryCommentListIsLikedItem';
import { UserFollowListRequestItem } from '../viewmodel/UserFollowListRequestItem';
import { OtherUserDetailRequestItem } from '../viewmodel/OtherUserDetailRequestItem';
import { AppointmentOperationRequestItem } from '../viewmodel/AppointmentOperationRequestItem';
const TAG = "MinePageDatasModel"
/**
...
...
@@ -635,6 +636,46 @@ class MinePageDatasModel{
return compRes.data
}
/**
* 预约 和取消预约操作
* @param params
* @param context
* @returns
*/
getAppointmentOperation(params:AppointmentOperationRequestItem,context: Context): Promise<ResponseDTO> {
return new Promise((success, error) => {
Logger.info(TAG, `getAppointmentList start`);
this.fetchAppointmentOperation(params).then((navResDTO: ResponseDTO) => {
if (!navResDTO || navResDTO.code != 0) {
success(this.getAppointmentOperationLocal(context))
return
}
Logger.info(TAG, "getAppointmentList then,AppointmentResDTO.timeStamp:" + navResDTO.timestamp);
success(navResDTO);
}).catch((err: Error) => {
Logger.error(TAG, `fetchAppointmentListDataApi catch, error.name : ${err.name}, error.message:${err.message}`);
success(this.getAppointmentOperationLocal(context))
})
})
}
fetchAppointmentOperation(object:AppointmentOperationRequestItem) {
let url = HttpUrlUtils.getAppointmentOperationUrl()
let headers: HashMap<string, string> = HttpUrlUtils.getYcgCommonHeaders();
return WDHttp.post<ResponseDTO>(url,object, headers)
};
async getAppointmentOperationLocal(context: Context): Promise<ResponseDTO> {
Logger.info(TAG, `getMineFollowListDataLocal start`);
let compRes: ResponseDTO | null = await ResourcesUtils.getResourcesJson<ResponseDTO>('appointment_operation_data.json',context );
if (!compRes ) {
Logger.info(TAG, `getMineFollowListDataLocal compRes is empty`);
return null
}
Logger.info(TAG, `getMineFollowListDataLocal getResourcesJsonSync compRes : ${JSON.stringify(compRes)}`);
return compRes
}
}
const minePageDatasModel = MinePageDatasModel.getInstance()
...
...
PeopleDaily_Harmony/wdComponent/src/main/ets/network/HttpUrlUtils.ets
View file @
163d398
...
...
@@ -98,6 +98,11 @@ export class HttpUrlUtils {
*/
static readonly OTHER_USER_FOLLOW_LIST_DATA_PATH: string = "/api/rmrb-interact/interact/zh/c/userAttention/list";
/**
* 预约操作
*/
static readonly APPOINTMENT_OPERATION_STATUS_PATH: string = "/api/live-center-message/zh/c/live/subscribe";
private static hostUrl: string = HttpUrlUtils.HOST_UAT;
static getCommonHeaders(): HashMap<string, string> {
...
...
@@ -238,7 +243,10 @@ export class HttpUrlUtils {
return url
}
static getAppointmentOperationUrl() {
let url = HttpUrlUtils.HOST_SIT + HttpUrlUtils.APPOINTMENT_OPERATION_STATUS_PATH
return url
}
static getYcgCommonHeaders(): HashMap<string, string> {
let headers: HashMap<string, string> = new HashMap<string, string>()
...
...
PeopleDaily_Harmony/wdComponent/src/main/ets/viewmodel/AppointmentOperationRequestItem.ets
0 → 100644
View file @
163d398
// {"relationId":"500000017021","liveId":"20000007348","isSubscribe":false}
export class AppointmentOperationRequestItem{
relationId:string = ""
liveId:string = ""
isSubscribe:boolean = false
constructor(relationId: string ,liveId: string ,isSubscribe: boolean ) {
this.relationId = relationId
this.liveId = liveId
this.isSubscribe = isSubscribe
}
}
...
...
PeopleDaily_Harmony/wdComponent/src/main/ets/viewmodel/MineAppointmentItem.ets
View file @
163d398
...
...
@@ -18,7 +18,7 @@ export class MineAppointmentItem{
isAppointment:boolean
constructor(imageUrl:string[],status:string,title:string,isAppointment:boolean,timePre:string,timeBack:string,relType:number ) {
constructor(imageUrl:string[],status:string,title:string,isAppointment:boolean,timePre:string,timeBack:string,relType:number
,liveId:number,relId:string
) {
this.imageUrl=imageUrl
this.status=status
this.title=title
...
...
@@ -26,5 +26,7 @@ export class MineAppointmentItem{
this.timePre = timePre
this.timeBack = timeBack
this.relType = relType
this.liveId = liveId
this.relId = relId
}
}
\ No newline at end of file
...
...
PeopleDaily_Harmony/wdComponent/src/main/resources/base/element/color.json
View file @
163d398
...
...
@@ -102,6 +102,14 @@
{
"name"
:
"color_transparent"
,
"value"
:
"#00000000"
},
{
"name"
:
"color_648DF2"
,
"value"
:
"#648DF2"
},
{
"name"
:
"color_EEEEEE"
,
"value"
:
"#EEEEEE"
}
]
}
\ No newline at end of file
...
...
Please
register
or
login
to post a comment