fanmingyou3_wd

Merge branch 'main' of http://192.168.1.42/developOne/harmonyPool into main

Showing 29 changed files with 739 additions and 5 deletions
  1 +import { AppointmentListUI} from 'wdComponent';
  2 +const TAG = "AppointmentListPage"
  3 +
  4 +@Entry
  5 +@Component
  6 +struct AppointmentListPage {
  7 +
  8 + build() {
  9 + Column(){
  10 + AppointmentListUI()
  11 + }
  12 + }
  13 +}
  1 +import { AboutPageUI} from 'wdComponent';
  2 +
  3 +@Entry
  4 +@Component
  5 +struct PrivacySettingPage {
  6 + build() {
  7 + Column(){
  8 + AboutPageUI()
  9 + }
  10 + }
  11 +}
  1 +import { AboutPageUI} from 'wdComponent';
  2 +
  3 +@Entry
  4 +@Component
  5 +struct PrivacySettingPage {
  6 + build() {
  7 + Column(){
  8 + AboutPageUI()
  9 + }
  10 + }
  11 +}
  1 +import ArrayList from '@ohos.util.ArrayList'
  2 +import { MineSettingComponent } from 'wdComponent';
  3 +
  4 +@Entry
  5 +@Component
  6 +struct SettingPage {
  7 + @State message: string = 'Hello World 02'
  8 +
  9 + build() {
  10 + Column() {
  11 + MineSettingComponent()
  12 + }.setFullWidth()
  13 + }
  14 +
  15 + // 私有方法
  16 + @Styles setFullWidth(){
  17 + .width('100%')
  18 + }
  19 +}
  20 +/*
  21 +
  22 +* */
@@ -3,6 +3,10 @@ @@ -3,6 +3,10 @@
3 "pages/Index", 3 "pages/Index",
4 "pages/MainPage", 4 "pages/MainPage",
5 "pages/ColumnPage", 5 "pages/ColumnPage",
6 - "pages/TestPage" 6 + "pages/TestPage",
  7 + "pages/SettingPage",
  8 + "pages/PrivacySettingPage",
  9 + "pages/SettingAboutPage",
  10 + "pages/AppointmentListPage"
7 ] 11 ]
8 -}  
  12 +}
@@ -27,3 +27,9 @@ export { TriPicCardComponent } from "./components/view/TriPicCardComponent" @@ -27,3 +27,9 @@ export { TriPicCardComponent } from "./components/view/TriPicCardComponent"
27 export { BigPicCardComponent } from "./components/view/BigPicCardComponent" 27 export { BigPicCardComponent } from "./components/view/BigPicCardComponent"
28 28
29 export { HeadPictureCardComponent } from "./components/view/HeadPictureCardComponent" 29 export { HeadPictureCardComponent } from "./components/view/HeadPictureCardComponent"
  30 +
  31 +export { MineSettingComponent } from "./components/page/MineSettingComponent"
  32 +
  33 +export { AboutPageUI } from "./components/page/about/AboutPageUI"
  34 +
  35 +export { AppointmentListUI } from "./components/page/mine/AppointmentListUI"
@@ -65,6 +65,7 @@ export struct MinePageComponent { @@ -65,6 +65,7 @@ export struct MinePageComponent {
65 //Card 65 //Card
66 MinePageCardUI() 66 MinePageCardUI()
67 //创作者区域 67 //创作者区域
  68 +
68 MinePageCreatorFunctionUI({creatorData:$creatorData}) 69 MinePageCreatorFunctionUI({creatorData:$creatorData})
69 //更多功能 70 //更多功能
70 MinePageMoreFunctionUI({moreData:$moreData}) 71 MinePageMoreFunctionUI({moreData:$moreData})
  1 +// @ts-nocheck
  2 +import { BottomNavi, CommonConstants } from 'wdConstant';
  3 +import { Logger } from 'wdKit';
  4 +import { TopNavigationComponent } from './TopNavigationComponent';
  5 +import { BottomNavDTO } from '../../repository/bean/BottomNavDTO';
  6 +import { UIUtils } from '../../repository/UIUtils';
  7 +import { MinePageComponent } from './MinePageComponent';
  8 +import PageViewModel from '../../viewmodel/PageViewModel';
  9 +
  10 +import storageStatistics from "@ohos.file.storageStatistics";
  11 +import { BusinessError } from '@ohos.base';
  12 +
  13 +
  14 +@Component
  15 +export struct MineSettingComponent {
  16 + @State listData: Array<string | Array<string>> = new Array();
  17 + @State privacySwitch:boolean = false
  18 + @State cacheSice:number = 0
  19 +
  20 + aboutToAppear() {
  21 + // 获取设置页面数据
  22 + this.getSettingPageData()
  23 +
  24 + // 获取缓存数据
  25 + storageStatistics.getCurrentBundleStats((err: BusinessError, bundleStats: storageStatistics.BundleStats) => {
  26 + if (err) {
  27 + console.error(`Invoke getCurrentBundleStats failed, code is ${err.code}, message is ${err.message}`);
  28 + } else {
  29 + this.cacheSice = bundleStats.appSize / 1024.00 / 1024.00.toFixed(2);
  30 + }
  31 + });
  32 + }
  33 +
  34 + getSettingPageData() {
  35 + let listArr = [['账户与安全', '接收推送', '隐私设罝', '仅WiFi网络加载图片', 'WiFi网络情况下自动播放视频', '开户播放器悬浮窗'], ['清除缓存', '去评分']];
  36 + this.listData = listArr;
  37 + }
  38 +
  39 + build() {
  40 + Navigation() {
  41 + //滑动区域
  42 + this.settingList()
  43 + }.titleMode(NavigationTitleMode.Mini)
  44 + .title('设置')
  45 + }
  46 +
  47 + // 页面布局
  48 + @Builder settingList() {
  49 + Column() {
  50 + List() {
  51 + // 循环渲染ListItemGroup,contactsGroups为多个分组联系人contacts和标题title的数据集合
  52 + ForEach(this.listData, (item: Array<string>, index: number) => {
  53 + ListItemGroup({ header: index === 0 ? this.itemHead("") : this.itemHead("1") }) {
  54 + // 循环渲染ListItem
  55 + ForEach(item, (subItem: string, subIndex: number) => {
  56 + ListItem() {
  57 + if (subIndex == 6) {
  58 + this.getArrowCell(subItem, subIndex, index)
  59 + } else if (subIndex == 1 || subIndex == 3 || subIndex == 4 || subIndex == 5) {
  60 + this.getSwitchCell(subItem, subIndex)
  61 + } else {
  62 + this.getArrowCell(subItem, subIndex, index)
  63 + }
  64 +
  65 + }.padding({ left: '27lpx' })
  66 + .onClick(() => {
  67 + console.log(subIndex + "")
  68 + if (subIndex == 4) {
  69 + // RouteManager.jumpNewPage("pages/SettingPage") // 调用跳转方法,跳转新页面
  70 + }
  71 + })
  72 + .height('117lpx')
  73 + }, subItem => subItem)
  74 + }
  75 + .divider({
  76 + strokeWidth: 1,
  77 + startMargin: 15,
  78 + endMargin: 10,
  79 + color: '#f0f0f0'
  80 + })
  81 + })
  82 + }.onScrollFrameBegin((offset, state) => {
  83 + return { offsetRemain: 0 }
  84 + })
  85 + }
  86 + .backgroundColor(Color.White)
  87 + .borderRadius(8)
  88 + }
  89 +
  90 + @Builder itemHead(text: string) {
  91 + // 列表分组的头部组件,对应联系人分组A、B等位置的组件
  92 + if (text.length > 0) {
  93 + Row().width('100%').height('20lpx').backgroundColor(0xf0f0f0)
  94 + }
  95 + }
  96 +
  97 + // 右侧开关cell
  98 + @Builder getSwitchCell(item, index) {
  99 + Column() {
  100 + Row() {
  101 + // 左侧logo和标题
  102 + Row() {
  103 + // 判断有没有图片
  104 + if (0) {
  105 + Image('https://pic.rmb.bdstatic.com/e182cf67c341d1128d2a6cc05886bf62.jpeg@s_0,h_2000')
  106 + .height('38lpx')
  107 + .margin({ right: '5lpx' })
  108 +
  109 + Text(`${item}`)
  110 + .margin({ top: '8lpx' })
  111 + .height('38lpx')
  112 + .fontColor('#333333')
  113 + .fontSize('29lpx')
  114 + } else {
  115 + Text(`${item}`)
  116 + .margin({ top: '8lpx' })
  117 + .height('38lpx')
  118 + .fontColor('#333333')
  119 + .fontSize('29lpx')
  120 + }
  121 + }.width('60%')
  122 +
  123 + // 右侧文案和右箭头
  124 + Row() {
  125 + Toggle({ type: ToggleType.Switch, isOn: false })
  126 + .height('50lpx')
  127 + .margin({ left: '81lpx', right: '29lpx' })
  128 + .selectedColor(Color.Pink)
  129 + .onChange((isOn: boolean) => {
  130 + this.privacySwitch = isOn;
  131 + })
  132 + }.width('40%')
  133 + .margin({ right: '29lpx' })
  134 + .justifyContent(FlexAlign.End)
  135 +
  136 + }
  137 + .alignItems(VerticalAlign.Center)
  138 + .justifyContent(FlexAlign.SpaceBetween)
  139 + }.height('54lpx')
  140 + }
  141 +
  142 + // 右文字+箭头cell
  143 + @Builder getArrowCell(item, index, mainIndex) {
  144 + Column() {
  145 +
  146 + Row() {
  147 + // 左侧logo和标题
  148 + Row() {
  149 + // 判断有没有图片
  150 + if (this.privacySwitch) {
  151 + Image('https://pic.rmb.bdstatic.com/e182cf67c341d1128d2a6cc05886bf62.jpeg@s_0,h_2000')
  152 + .height('38lpx')
  153 + .margin({ right: '5lpx' })
  154 + }
  155 + Text(`${item}`)
  156 + .margin({ top: '8lpx' })
  157 + .height('38lpx')
  158 + .fontColor('#333333')
  159 + .fontSize('29lpx')
  160 + }.width('60%')
  161 +
  162 + // 右侧文案和右箭头
  163 + Row() {
  164 + Text((index == 0 && mainIndex != 0) ? this.cacheSice.toFixed(2) + 'MB' : '')
  165 + .fontColor('#999999')
  166 + .maxLines(1)
  167 + Image($r('app.media.mine_user_arrow'))
  168 + .width('27lpx')
  169 + .height('27lpx')
  170 + .objectFit(ImageFit.Auto)
  171 + Column().width('29lpx')
  172 + }.width('40%')
  173 + .margin({ right: '29lpx' })
  174 + .justifyContent(FlexAlign.End)
  175 +
  176 + }
  177 + .alignItems(VerticalAlign.Center)
  178 + .justifyContent(FlexAlign.SpaceBetween)
  179 +
  180 + }
  181 + .height('54lpx')
  182 + }
  183 +}
  1 +const TAG = 'AboutPageUI';
  2 +
  3 +@Component
  4 +export struct AboutPageUI {
  5 + @State message: string = '京ICP备16066560号-6A Copyright © 人民日报客户端\nall rights reserved.'
  6 + @State version: string = '版本号:v8.0.1.1'
  7 +
  8 +
  9 + build() {
  10 + Column() {
  11 + Image($r('app.media.setting_about_logo'))
  12 + .width('278lpx')
  13 + .height('154lpx')
  14 + .margin({top:'173lpx',bottom:'154lpx'})
  15 +
  16 + Row(){
  17 +
  18 + }.backgroundColor(Color.Yellow)
  19 + .width('100%')
  20 + .height('97lpx')
  21 +
  22 + Row(){
  23 +
  24 + }.backgroundColor(Color.Yellow)
  25 + .width('100%')
  26 + .height('97lpx')
  27 +
  28 + Blank()
  29 +
  30 + Image($r('app.media.app_icon'))
  31 + .width('192lpx')
  32 + .height('192lpx')
  33 +
  34 + Text(this.version)
  35 + .fontSize('25lpx')
  36 + .textAlign(TextAlign.Center)
  37 + .fontColor($r("app.color.color_666666"))
  38 + .margin({bottom:'31lpx'})
  39 +
  40 + Text(this.message)
  41 + .fontSize('19lpx')
  42 + .textAlign(TextAlign.Center)
  43 + .fontColor($r("app.color.color_999999"))
  44 + .margin({bottom:'35lpx'})
  45 + }
  46 + .width('100%')
  47 + .height('100%')
  48 + }
  49 +}
  1 +import { MineAppointmentItem } from '../../../viewmodel/MineAppointmentItem'
  2 +
  3 +@Component
  4 +export struct AppointmentListChildComponent{
  5 + @ObjectLink item: MineAppointmentItem
  6 +
  7 + build() {
  8 + Column(){
  9 + Stack(){
  10 + Image(this.item?.imageUrl[0])
  11 + .objectFit(ImageFit.Auto)
  12 +
  13 + if(this.item.relType === 1){
  14 + Row(){
  15 + Row(){
  16 + Image($r('app.media.reserve_icon'))
  17 + .width('42lpx')
  18 + .height('35lpx')
  19 + .objectFit(ImageFit.Auto)
  20 + Text("预约")
  21 + .fontWeight(400)
  22 + .fontSize('21lpx')
  23 + .backgroundColor($r('app.color.color_4D000000'))
  24 + .fontColor($r('app.color.white'))
  25 + .lineHeight('31lpx')
  26 + .layoutWeight(1)
  27 + .textAlign(TextAlign.Center)
  28 + }.width('94lpx')
  29 + .margin({bottom:'15lpx',right:'15lpx'})
  30 + }.width('100%')
  31 + .height('100%')
  32 + .alignItems(VerticalAlign.Bottom)
  33 + .justifyContent(FlexAlign.End)
  34 + }
  35 + }.width('100%')
  36 + .height('376lpx')
  37 +
  38 + Column(){
  39 + Text(this.item.title)
  40 + .fontWeight('400lpx')
  41 + .fontSize('33lpx')
  42 + .fontColor($r('app.color.color_222222'))
  43 + .lineHeight('48lpx')
  44 + .maxLines(2)
  45 + .textOverflow({ overflow: TextOverflow.Ellipsis })
  46 + .margin({bottom:'23lpx'})
  47 + .textAlign(TextAlign.Start)
  48 + .width('100%')
  49 + Row(){
  50 + Row(){
  51 + if(this.item.relType === 2){
  52 + Image($r('app.media.play_status_history_icon'))
  53 + .objectFit(ImageFit.Auto)
  54 + .width('38lpx')
  55 + .height('38lpx')
  56 + .margin({right:'12lpx'})
  57 + Text('已结束').fontColor($r('app.color.color_999999'))
  58 + .fontWeight('500lpx')
  59 + .fontSize('23lpx')
  60 + }else {
  61 + Image($r('app.media.play_status_icon'))
  62 + .objectFit(ImageFit.Auto)
  63 + .width('38lpx')
  64 + .height('38lpx')
  65 + .margin({right:'12lpx'})
  66 + Text(this.item.timePre).fontColor($r('app.color.color_ED2800'))
  67 + .fontWeight('500lpx')
  68 + .fontSize('23lpx')
  69 + Image($r('app.media.point_icon'))
  70 + .objectFit(ImageFit.Auto)
  71 + .width('12lpx')
  72 + .height('31lpx')
  73 + .margin({right:'4lpx'})
  74 + Text(`${this.item.timeBack}开始`).fontColor($r('app.color.color_ED2800'))
  75 + .fontWeight('500lpx')
  76 + .fontSize('23lpx')
  77 + .lineHeight('31lpx')
  78 + }
  79 + }.padding({left:'19lpx',right:'19lpx'})
  80 + .height('46lpx')
  81 + .alignItems(VerticalAlign.Center)
  82 + .backgroundColor($r('app.color.color_F5F5F5'))
  83 + .borderRadius('4lpx')
  84 + Blank()
  85 + .layoutWeight(1)
  86 + if(this.item.relType === 1){
  87 + Text(this.item.isAppointment?"已预约":"预约")
  88 + .fontWeight(400)
  89 + .fontSize('23lpx')
  90 + .backgroundColor(this.item.isAppointment?$r('app.color.color_F5F5F5'):$r('app.color.color_ED2800'))
  91 + .fontColor(this.item.isAppointment?$r('app.color.color_CCCCCC'):$r('app.color.white'))
  92 + .lineHeight('31lpx')
  93 + .textAlign(TextAlign.Center)
  94 + .width('100lpx')
  95 + .height('46lpx')
  96 + .borderRadius('6lpx')
  97 + .onClick(()=>{
  98 + this.item.isAppointment = !this.item.isAppointment
  99 + //TODO 预约动作
  100 + })
  101 + }else {
  102 + Text(this.item.relType === 2?"去观看":"看回放")
  103 + .fontWeight(400)
  104 + .fontSize('23lpx')
  105 + .backgroundColor($r('app.color.color_ED2800'))
  106 + .fontColor($r('app.color.white'))
  107 + .lineHeight('31lpx')
  108 + .textAlign(TextAlign.Center)
  109 + .width('100lpx')
  110 + .height('46lpx')
  111 + .borderRadius('6lpx')
  112 + }
  113 + }
  114 + }
  115 + .padding({left:'23lpx',right:'23lpx',top:'15lpx',bottom:'23lpx'})
  116 + }.margin({ left: 10, right: 10 })
  117 + .backgroundColor($r('app.color.white'))
  118 + .borderRadius('8lpx')
  119 + }
  120 +}
  1 +import { AppointmentListChildComponent } from '../mine/AppointmentListChildComponent';
  2 +import { CustomTitleUI } from '../../reusable/CustomTitleUI'
  3 +import { ListHasNoMoreDataUI } from '../../reusable/ListHasNoMoreDataUI';
  4 +import { MineAppointmentItem } from '../../../viewmodel/MineAppointmentItem';
  5 +import { LazyDataSource, StringUtils } from 'wdKit';
  6 +import MinePageDatasModel from '../../../model/MinePageDatasModel';
  7 +const TAG = "AppointmentListUI"
  8 +
  9 +@Component
  10 +export struct AppointmentListUI{
  11 + @State data: LazyDataSource<MineAppointmentItem> = new LazyDataSource();
  12 + @State isLoading:boolean = false
  13 + @State hasMore:boolean = true
  14 + curPageNum:number = 1;
  15 +
  16 + aboutToAppear() {
  17 + this.getNewPageData()
  18 + }
  19 +
  20 + build() {
  21 + Column() {
  22 + //标题栏目
  23 + CustomTitleUI({titleName:"预约列表"})
  24 + //刷新控件 TODO
  25 + //List
  26 + List({ space: '6lpx' }) {
  27 + LazyForEach(this.data, (item: MineAppointmentItem, index: number) => {
  28 + ListItem() {
  29 + AppointmentListChildComponent({item:item})
  30 + }
  31 + .onClick(()=>{
  32 + //TODO 跳转
  33 + })
  34 + }, (item: MineAppointmentItem, index: number) => index.toString())
  35 +
  36 + //没有更多数据 显示提示
  37 + if(!this.hasMore){
  38 + ListItem(){
  39 + ListHasNoMoreDataUI()
  40 + }
  41 + }
  42 + }.cachedCount(4)
  43 + .margin({top:'23lpx',left:'23lpx',right:'23lpx'})
  44 + .layoutWeight(1)
  45 + .onReachEnd(()=>{
  46 + console.log(TAG,"触底了");
  47 + if(!this.isLoading){
  48 + //加载分页数据
  49 + this.getNewPageData()
  50 + }
  51 + })
  52 + }
  53 + .backgroundColor($r('app.color.color_F9F9F9'))
  54 + .height('100%')
  55 + .width('100%')
  56 + }
  57 +
  58 + getNewPageData(){
  59 + this.isLoading = true
  60 + if(this.hasMore){
  61 + MinePageDatasModel.getAppointmentListData("20",`${this.curPageNum}`).then((value)=>{
  62 + if (!this.data || value.list.length == 0){
  63 + this.hasMore = false
  64 + }else{
  65 + value.list.forEach((value)=>{
  66 + let dealTime = this.DealStartTime(value.planStartTime)
  67 + if(dealTime!=null && dealTime.length === 2){
  68 + this.data.push(new MineAppointmentItem(value.imageUrl,value.status,value.title,true,dealTime[0],dealTime[1],value.relType))
  69 + }else {
  70 + this.data.push(new MineAppointmentItem(value.imageUrl,value.status,value.title,true,"","",value.relType))
  71 + }
  72 + })
  73 + this.data.notifyDataReload()
  74 + if (this.data.totalCount() < value.totalCount) {
  75 + this.curPageNum++
  76 + }else {
  77 + this.hasMore = false
  78 + }
  79 + }
  80 + })
  81 + }
  82 + this.isLoading = false
  83 + }
  84 +
  85 + DealStartTime(planStartTime:string):string[]{
  86 + let dealData:string[] = []
  87 +
  88 + if(!StringUtils.isNotEmpty(planStartTime)){
  89 + console.log(TAG,"格式有误")
  90 + return dealData
  91 + }
  92 +
  93 + if(planStartTime.indexOf(" ") === -1){
  94 + console.log(TAG,"格式有误")
  95 + return dealData
  96 + }
  97 + let arr = planStartTime.split(" ")
  98 + if(arr!=null && StringUtils.isNotEmpty(arr[0])){ //处理年月日
  99 + let time = arr[0].split("-");
  100 + if(time.length === 3){
  101 + let month = time[1].indexOf("0") === 0 ? time[1].substring(1):time[1]
  102 + let day = time[2]
  103 +
  104 + dealData[0] = `${month}月${day}日`
  105 + let today = `${new Date().getMonth()+1}月${new Date().getDate()}日`
  106 + if(dealData[0] === today){
  107 + dealData[0] = "今日"
  108 + }
  109 + }
  110 + }
  111 +
  112 + if(arr!=null && StringUtils.isNotEmpty(arr[1])){ //处理时分
  113 + let time = arr[1].split(":");
  114 + if(time.length === 3){
  115 + dealData[1] = `${time[0]}:${time[1]}`
  116 + }
  117 + }
  118 + console.log(TAG,JSON.stringify(dealData))
  119 + return dealData
  120 + }
  121 +}
1 import MinePageMoreFunctionModel from '../../../viewmodel/MinePageMoreFunctionModel' 1 import MinePageMoreFunctionModel from '../../../viewmodel/MinePageMoreFunctionModel'
  2 +import RouteManager from '../../../utils/RouteManager'
2 3
3 @Component 4 @Component
4 export default struct MinePageMoreFunctionUI{ 5 export default struct MinePageMoreFunctionUI{
@@ -64,6 +65,11 @@ export default struct MinePageMoreFunctionUI{ @@ -64,6 +65,11 @@ export default struct MinePageMoreFunctionUI{
64 } 65 }
65 .onClick(()=>{ 66 .onClick(()=>{
66 console.log(index+"") 67 console.log(index+"")
  68 + if (index == 3) {
  69 + RouteManager.jumpNewPage("pages/SettingPage")
  70 + } else {
  71 + RouteManager.jumpNewPage("pages/PrivacySettingPage")
  72 + }
67 }) 73 })
68 .height('117lpx') 74 .height('117lpx')
69 }, item => item) 75 }, item => item)
1 1
  2 +import RouteManager from '../../../utils/RouteManager'
2 import MinePagePersonalFunctionsItem from '../../../viewmodel/MinePagePersonalFunctionsItem' 3 import MinePagePersonalFunctionsItem from '../../../viewmodel/MinePagePersonalFunctionsItem'
3 4
4 @Component 5 @Component
@@ -34,6 +35,12 @@ export default struct MinePagePersonFunctionUI { @@ -34,6 +35,12 @@ export default struct MinePagePersonFunctionUI {
34 } 35 }
35 }.onClick(()=>{ 36 }.onClick(()=>{
36 console.log(index+"") 37 console.log(index+"")
  38 + switch (item.msg){
  39 + case "预约":{
  40 + RouteManager.jumpNewPage("pages/AppointmentListPage")
  41 + break;
  42 + }
  43 + }
37 }).width('169lpx') 44 }).width('169lpx')
38 .height('117lpx') 45 .height('117lpx')
39 }, item => item) 46 }, item => item)
@@ -61,7 +61,6 @@ export default struct MinePageUserSimpleInfoUI { @@ -61,7 +61,6 @@ export default struct MinePageUserSimpleInfoUI {
61 Row(){ 61 Row(){
62 Text("登录注册") 62 Text("登录注册")
63 .fontColor($r('app.color.color_222222')) 63 .fontColor($r('app.color.color_222222'))
64 - .maxLines(1)  
65 .textOverflow({ overflow: TextOverflow.Ellipsis }) 64 .textOverflow({ overflow: TextOverflow.Ellipsis })
66 .fontSize('33lpx') 65 .fontSize('33lpx')
67 66
  1 +import router from '@ohos.router'
  2 +@Component
  3 +export struct CustomTitleUI {
  4 + imgBack:boolean = true
  5 + titleName:string = "默认标题"
  6 +
  7 + build() {
  8 + RelativeContainer() {
  9 + //标题栏目
  10 + if(this.imgBack){
  11 + Image($r('app.media.back_icon'))
  12 + .width('46lpx')
  13 + .height('46lpx')
  14 + .objectFit(ImageFit.Auto)
  15 + .id("back_icon")
  16 + .alignRules({
  17 + center: {anchor: "__container__", align: VerticalAlign.Center},
  18 + left: {anchor: "__container__", align: HorizontalAlign.Start}
  19 + })
  20 + .margin({left:'31lpx'})
  21 + .onClick(()=>{
  22 + router.back()
  23 + })
  24 + }
  25 +
  26 + Text(this.titleName)
  27 + .height('42lpx')
  28 + .maxLines(1)
  29 + .id("title")
  30 + .fontSize('35lpx')
  31 + .fontWeight(400)
  32 + .fontColor($r('app.color.color_222222'))
  33 + .lineHeight('42lpx')
  34 + .alignRules({
  35 + center: {anchor: "__container__", align: VerticalAlign.Center},
  36 + middle: {anchor: "__container__", align: HorizontalAlign.Center}
  37 + })
  38 + }
  39 + .height('84lpx')
  40 + .width('100%')
  41 + .backgroundColor($r('app.color.white'))
  42 +
  43 + }
  44 +}
  1 +@Component
  2 +export struct ListHasNoMoreDataUI{
  3 + build(){
  4 + Row(){
  5 + Text("已显示全部内容")
  6 + .fontColor($r('app.color.color_999999'))
  7 + .fontWeight('500lpx')
  8 + .fontSize('23lpx')
  9 + }.justifyContent(FlexAlign.Center)
  10 + .width('100%')
  11 + .margin({top:'20lpx',bottom:'20lpx'})
  12 + }
  13 +}
@@ -2,6 +2,12 @@ @@ -2,6 +2,12 @@
2 import MinePagePersonalFunctionsItem from '../viewmodel/MinePagePersonalFunctionsItem' 2 import MinePagePersonalFunctionsItem from '../viewmodel/MinePagePersonalFunctionsItem'
3 import MinePageCreatorFunctionsItem from '../viewmodel/MinePageCreatorFunctionsItem' 3 import MinePageCreatorFunctionsItem from '../viewmodel/MinePageCreatorFunctionsItem'
4 import MinePageMoreFunctionModel from '../viewmodel/MinePageMoreFunctionModel'; 4 import MinePageMoreFunctionModel from '../viewmodel/MinePageMoreFunctionModel';
  5 +import { HttpUrlUtils } from '../network/HttpUrlUtils';
  6 +import HashMap from '@ohos.util.HashMap';
  7 +import { ResponseDTO, WDHttp } from 'wdNetwork';
  8 +import { MineAppointmentListItem } from '../viewmodel/MineAppointmentListItem';
  9 +import { Logger } from 'wdKit';
  10 +const TAG = "MinePageDatasModel"
5 11
6 /** 12 /**
7 * 我的页面 所有数据 获取封装类 13 * 我的页面 所有数据 获取封装类
@@ -12,7 +18,6 @@ class MinePageDatasModel{ @@ -12,7 +18,6 @@ class MinePageDatasModel{
12 creatorData:MinePageCreatorFunctionsItem[] = [] 18 creatorData:MinePageCreatorFunctionsItem[] = []
13 moreData:MinePageMoreFunctionModel[] = [] 19 moreData:MinePageMoreFunctionModel[] = []
14 20
15 -  
16 private constructor() { } 21 private constructor() { }
17 22
18 /** 23 /**
@@ -64,7 +69,7 @@ class MinePageDatasModel{ @@ -64,7 +69,7 @@ class MinePageDatasModel{
64 } 69 }
65 70
66 /** 71 /**
67 - * 更多功能 扫一扫 我的奖品 等6个数据 72 + * 扫一扫 我的奖品 等5个数据
68 * 包含名字和图标 73 * 包含名字和图标
69 */ 74 */
70 getMoreFunctionsData():MinePageCreatorFunctionsItem[]{ 75 getMoreFunctionsData():MinePageCreatorFunctionsItem[]{
@@ -79,6 +84,29 @@ class MinePageDatasModel{ @@ -79,6 +84,29 @@ class MinePageDatasModel{
79 return this.moreData 84 return this.moreData
80 } 85 }
81 86
  87 + fetchAppointmentListData(pageSize:string,pageNum:string) {
  88 + let url = HttpUrlUtils.getAppointmentListDataUrl()+ `?pageSize=${pageSize}&pageNum=${pageNum}`
  89 + let headers: HashMap<string, string> = HttpUrlUtils.getYcgCommonHeaders();
  90 + return WDHttp.get<ResponseDTO<MineAppointmentListItem>>(url, headers)
  91 + };
  92 +
  93 + getAppointmentListData(pageSize:string,pageNum:string): Promise<MineAppointmentListItem> {
  94 + return new Promise<MineAppointmentListItem>((success, error) => {
  95 + Logger.info(TAG, `getAppointmentList start`);
  96 + this.fetchAppointmentListData(pageSize,pageNum).then((navResDTO: ResponseDTO<MineAppointmentListItem>) => {
  97 + if (!navResDTO) {
  98 + error("page data invalid");
  99 + return
  100 + }
  101 + Logger.info(TAG, "getAppointmentList then,AppointmentResDTO.timeStamp:" + navResDTO.timestamp);
  102 + let navigationBean = navResDTO.data
  103 + success(navigationBean);
  104 + }).catch((err: Error) => {
  105 + Logger.error(TAG, `fetchAppointmentListDataApi catch, error.name : ${err.name}, error.message:${err.message}`);
  106 + error(err);
  107 + })
  108 + })
  109 + }
82 110
83 } 111 }
84 112
@@ -39,6 +39,11 @@ export class HttpUrlUtils { @@ -39,6 +39,11 @@ export class HttpUrlUtils {
39 * 批查接口,查询互动相关数据,如收藏数、评论数等 39 * 批查接口,查询互动相关数据,如收藏数、评论数等
40 */ 40 */
41 static readonly INTERACT_DATA_PATH: string = "/api/rmrb-contact/contact/zh/c/content/interactData"; 41 static readonly INTERACT_DATA_PATH: string = "/api/rmrb-contact/contact/zh/c/content/interactData";
  42 + /**
  43 + * 个人中心 我的预约列表
  44 + */
  45 + static readonly APPOINTMENT_LIST_DATA_PATH: string = "/api/live-center-message/zh/c/live/subscribe";
  46 +
42 private static hostUrl: string = HttpUrlUtils.HOST_UAT; 47 private static hostUrl: string = HttpUrlUtils.HOST_UAT;
43 48
44 static getCommonHeaders(): HashMap<string, string> { 49 static getCommonHeaders(): HashMap<string, string> {
@@ -78,6 +83,44 @@ export class HttpUrlUtils { @@ -78,6 +83,44 @@ export class HttpUrlUtils {
78 return headers; 83 return headers;
79 } 84 }
80 85
  86 + static getYcgCommonHeaders(): HashMap<string, string> {
  87 + let headers: HashMap<string, string> = new HashMap<string, string>()
  88 +
  89 + headers.set('mpassid', 'XGt6jfGUx8ADAKruTyAMdhHj')
  90 + headers.set('city', "%E5%90%88%E8%82%A5%E5%B8%82")
  91 + headers.set('User-Agent', 'Dalvik/2.1.0 (Linux; U; Android 10; PCT-AL10 Build/HUAWEIPCT-AL10)')
  92 + headers.set('channel', "rmrb_china_0000")
  93 + headers.set('appCode', "0af1f9085e484c97b2a44704bae72c07")
  94 + headers.set('Authorization', "APPCODE 0af1f9085e484c97b2a44704bae72c07")
  95 + headers.set('X-Ca-Stage', "TEST")
  96 + headers.set('plat', "Phone")
  97 + headers.set('Content-Type', 'application/json; charset=utf-8')
  98 + headers.set('timestamp', "649773304")
  99 + headers.set('RMRB-X-TOKEN', "eyJhbGciOiJIUzI1NiIsImtpZCI6IklFazBGclhfV2RYMEx1ZktDU01iYTVYd0VmUHZ6a043T0F5UTRFLWIwWU0ifQ.eyJpc3MiOiJwZW9wbGVzLWRhaWx5LWZvdXJhIiwic3ViIjoicGVvcGxlcy1kYWlseS1mb3VyYSIsImV4cCI6MTcxMDU4Mzk0MywidXNlcklkIjo1NjczODc0NzcwNjM2MjEsInVzZXJWZXJzaW9uIjoiNTY3Mzg3NDc3MDYzNjIxXzAiLCJ1c2VyTmFtZSI6IiVFNCVCQSVCQSVFNiVCMCU5MSVFNiU5NyVBNSVFNiU4QSVBNSVFNyVCRCU5MSVFNSU4RiU4QmFQcnRxNSIsInVzZXJUeXBlIjoxLCJjcmVhdG9ySWQiOm51bGwsInVzZXJJZFpoIjpudWxsfQ._LTKrUxQozpCj1XMhx1TWOIxn5gjDveoPuMFGpI0g_8")
  100 + headers.set('device_id', "5156098c-6c44-3514-af70-04a0139a9327")
  101 + headers.set('cookie', 'RMRB-X-TOKEN=eyJhbGciOiJIUzI1NiIsImtpZCI6IklFazBGclhfV2RYMEx1ZktDU01iYTVYd0VmUHZ6a043T0F5UTRFLWIwWU0ifQ.eyJpc3MiOiJwZW9wbGVzLWRhaWx5LWZvdXJhIiwic3ViIjoicGVvcGxlcy1kYWlseS1mb3VyYSIsImV4cCI6MTcxMDU4Mzk0MywidXNlcklkIjo1NjczODc0NzcwNjM2MjEsInVzZXJWZXJzaW9uIjoiNTY3Mzg3NDc3MDYzNjIxXzAiLCJ1c2VyTmFtZSI6IiVFNCVCQSVCQSVFNiVCMCU5MSVFNiU5NyVBNSVFNiU4QSVBNSVFNyVCRCU5MSVFNSU4RiU4QmFQcnRxNSIsInVzZXJUeXBlIjoxLCJjcmVhdG9ySWQiOm51bGwsInVzZXJJZFpoIjpudWxsfQ._LTKrUxQozpCj1XMhx1TWOIxn5gjDveoPuMFGpI0g_8')
  102 + headers.set('build_version', "202403112023")
  103 + headers.set('adcode', "340000")
  104 + headers.set('os_version', "10")
  105 + headers.set('city_dode', "340100")
  106 + headers.set('userId', "567387477063621")
  107 + headers.set('versionCode', "7302")
  108 + headers.set('system', "Android")
  109 + headers.set('version_name', "7.3.0.2")
  110 + headers.set('EagleEye-TraceID', '5C3D0800CF2C4440A43E5B131187629B')
  111 + headers.set('imei', "5156098c-6c44-3514-af70-04a0139a9327")
  112 + headers.set('userType', "1")
  113 + headers.set('Accept-Language', 'zh')
  114 +
  115 + // HttpUrlUtils.addSpecialHeaders(headers);
  116 + // Logger.debug("TAG", '******************* commonHeaders headers start ******************************** ');
  117 + // headers.forEach((v,k)=>{
  118 + // Logger.debug("TAG", 'getCommonHeaders header: ' + k + ': ' + v);
  119 + // })
  120 + // Logger.debug("TAG", '******************* commonHeaders headers end ******************************** ');
  121 + return headers;
  122 + }
  123 +
81 static getHost() { 124 static getHost() {
82 return this.hostUrl; 125 return this.hostUrl;
83 } 126 }
@@ -119,6 +162,11 @@ export class HttpUrlUtils { @@ -119,6 +162,11 @@ export class HttpUrlUtils {
119 return url; 162 return url;
120 } 163 }
121 164
  165 + static getAppointmentListDataUrl() {
  166 + let url = this.HOST_SIT + this.APPOINTMENT_LIST_DATA_PATH;
  167 + return url;
  168 + }
  169 +
122 static addSpecialHeaders(headers: HashMap<string, string>) { 170 static addSpecialHeaders(headers: HashMap<string, string>) {
123 switch (this.hostUrl) { 171 switch (this.hostUrl) {
124 case this.HOST_UAT: 172 case this.HOST_UAT:
@@ -30,4 +30,5 @@ export class PageRepository { @@ -30,4 +30,5 @@ export class PageRepository {
30 let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders(); 30 let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();
31 return WDHttp.post<ResponseDTO<InteractDataDTO[]>>(url, param, headers) 31 return WDHttp.post<ResponseDTO<InteractDataDTO[]>>(url, param, headers)
32 }; 32 };
  33 +
33 } 34 }
  1 +@Observed
  2 +export class MineAppointmentItem{
  3 + appStyle:string //"15"
  4 + /*[
  5 + "https://sitcontentjdcdn.aikan.pdnews.cn/sjbj-20231204/image/live/563cc8ce1ecc43b288f6cf60da66579c.jpeg?x-oss-process=image/resize,l_550,m_fill,h_450,w_800/quality,q_90/format,jpg"
  6 + ]*/
  7 + imageUrl:string[]
  8 +
  9 + liveId:number //20000007348
  10 + planStartTime:string //2023-12-05 15:26:10
  11 + timePre:string //12月05日
  12 + timeBack:string //15:26
  13 + relId:string //"500000017021"
  14 + relType:number //1
  15 + startTime:string //""
  16 + status:string //"wait"
  17 + title:string //"视界运营位加权-加权中删除"
  18 + isAppointment:boolean
  19 +
  20 +
  21 + constructor(imageUrl:string[],status:string,title:string,isAppointment:boolean,timePre:string,timeBack:string,relType:number ) {
  22 + this.imageUrl=imageUrl
  23 + this.status=status
  24 + this.title=title
  25 + this.isAppointment=isAppointment
  26 + this.timePre = timePre
  27 + this.timeBack = timeBack
  28 + this.relType = relType
  29 + }
  30 +}
  1 +import { MineAppointmentItem } from './MineAppointmentItem'
  2 +
  3 +export class MineAppointmentListItem{
  4 + list:MineAppointmentItem[]
  5 +
  6 + pageNum: number
  7 + pageSize: number
  8 + totalCount: number
  9 +
  10 +}
@@ -79,6 +79,13 @@ @@ -79,6 +79,13 @@
79 { 79 {
80 "name": "main_red", 80 "name": "main_red",
81 "value": "#E84026" 81 "value": "#E84026"
  82 + }, {
  83 + "name":"color_4D000000",
  84 + "value": "#4D000000"
  85 + },
  86 + {
  87 + "name":"color_CCCCCC",
  88 + "value": "#CCCCCC"
82 } 89 }
83 ] 90 ]
84 } 91 }