douaojie

Merge remote-tracking branch 'origin/main'

@@ -17,6 +17,11 @@ export enum EmitterEventId { @@ -17,6 +17,11 @@ export enum EmitterEventId {
17 17
18 // 关注,取消关注 18 // 关注,取消关注
19 PEOPLE_SHIP_ATTENTION = 7, 19 PEOPLE_SHIP_ATTENTION = 7,
  20 + // 我的关注 为null
  21 + MY_FOLLOW_EMPTY = 8,
  22 +
  23 + // 登录成功
  24 + LOGIN_SUCCESS = 8,
20 25
21 // App回到前台 26 // App回到前台
22 APP_ENTER_FOREGROUD = 100, 27 APP_ENTER_FOREGROUD = 100,
  1 +import { EmitterUtils, EmitterEventId, Logger } from 'wdKit/Index'
1 import MinePageDatasModel from '../../../model/MinePageDatasModel' 2 import MinePageDatasModel from '../../../model/MinePageDatasModel'
2 import { FollowListItem } from '../../../viewmodel/FollowListItem' 3 import { FollowListItem } from '../../../viewmodel/FollowListItem'
3 import { CustomTitleUI } from '../../reusable/CustomTitleUI' 4 import { CustomTitleUI } from '../../reusable/CustomTitleUI'
@@ -20,16 +21,26 @@ export struct FollowFirstTabsComponent{ @@ -20,16 +21,26 @@ export struct FollowFirstTabsComponent{
20 }) 21 })
21 22
22 if(this.controller != null && this.data.length>1 && this.changeIndex === 1){ 23 if(this.controller != null && this.data.length>1 && this.changeIndex === 1){
23 - //个人主页 跳转 关注页 tab 2  
24 - let intervalID = setInterval(() => {  
25 - this.currentIndex = this.changeIndex  
26 - this.controller.changeIndex(this.currentIndex)  
27 - clearInterval(intervalID);  
28 - }, 500); 24 + this.jumpFollowNextPage()
29 } 25 }
30 }).catch((err:Error)=>{ 26 }).catch((err:Error)=>{
31 console.log(TAG,JSON.stringify(err)) 27 console.log(TAG,JSON.stringify(err))
32 }) 28 })
  29 +
  30 + EmitterUtils.receiveEvent(EmitterEventId.MY_FOLLOW_EMPTY, (() => {
  31 + if(this.controller != null && this.data.length>1 ){
  32 + this.jumpFollowNextPage()
  33 + }
  34 + }))
  35 + }
  36 +
  37 + jumpFollowNextPage(){
  38 + //个人主页 跳转 关注页 tab 2
  39 + let intervalID = setInterval(() => {
  40 + this.currentIndex = 1
  41 + this.controller.changeIndex(this.currentIndex)
  42 + clearInterval(intervalID);
  43 + }, 500);
33 } 44 }
34 45
35 @Builder TabBuilder(index: number, item: FollowListItem) { 46 @Builder TabBuilder(index: number, item: FollowListItem) {
1 -import { LazyDataSource, SPHelper, UserDataLocal } from 'wdKit'; 1 +import { EmitterEventId, EmitterUtils, LazyDataSource, SPHelper, UserDataLocal } from 'wdKit';
2 import MinePageDatasModel from '../../../model/MinePageDatasModel'; 2 import MinePageDatasModel from '../../../model/MinePageDatasModel';
3 import SearcherAboutDataModel from '../../../model/SearcherAboutDataModel'; 3 import SearcherAboutDataModel from '../../../model/SearcherAboutDataModel';
4 import { CreatorDetailRequestItem } from '../../../viewmodel/CreatorDetailRequestItem'; 4 import { CreatorDetailRequestItem } from '../../../viewmodel/CreatorDetailRequestItem';
@@ -156,10 +156,12 @@ export struct FollowListDetailUI { @@ -156,10 +156,12 @@ export struct FollowListDetailUI {
156 } 156 }
157 this.isLoading = false 157 this.isLoading = false
158 this.isGetRequest = true 158 this.isGetRequest = true
  159 + this.sendFollowMessage()
159 }).catch((err: Error) => { 160 }).catch((err: Error) => {
160 console.log(TAG, "请求失败") 161 console.log(TAG, "请求失败")
161 this.isGetRequest = true 162 this.isGetRequest = true
162 this.isLoading = false 163 this.isLoading = false
  164 + this.sendFollowMessage()
163 }) 165 })
164 } else { 166 } else {
165 this.isLoading = false 167 this.isLoading = false
@@ -167,6 +169,12 @@ export struct FollowListDetailUI { @@ -167,6 +169,12 @@ export struct FollowListDetailUI {
167 } 169 }
168 } 170 }
169 171
  172 + sendFollowMessage(){
  173 + if(this.count === 0){
  174 + EmitterUtils.sendEvent(EmitterEventId.MY_FOLLOW_EMPTY)
  175 + }
  176 + }
  177 +
170 getNewPageData() { 178 getNewPageData() {
171 //我的关注列表 179 //我的关注列表
172 if (this.creatorDirectoryId === -1) { 180 if (this.creatorDirectoryId === -1) {
@@ -284,6 +284,7 @@ export struct HomePageBottomComponent{ @@ -284,6 +284,7 @@ export struct HomePageBottomComponent{
284 if (!this.data_comment || value.list.length == 0){ 284 if (!this.data_comment || value.list.length == 0){
285 this.hasMore = false 285 this.hasMore = false
286 this.isLoading = false 286 this.isLoading = false
  287 + this.isGetRequest = true
287 }else{ 288 }else{
288 this.getCommentListStatus(value) 289 this.getCommentListStatus(value)
289 } 290 }
@@ -101,6 +101,7 @@ export struct OtherHomePageBottomCommentComponent { @@ -101,6 +101,7 @@ export struct OtherHomePageBottomCommentComponent {
101 if (!this.data_comment || value.list.length == 0) { 101 if (!this.data_comment || value.list.length == 0) {
102 this.hasMore = false 102 this.hasMore = false
103 this.isLoading = false 103 this.isLoading = false
  104 + this.isGetRequest = true
104 } else { 105 } else {
105 this.getCommentListStatus(value) 106 this.getCommentListStatus(value)
106 } 107 }
@@ -5,12 +5,14 @@ import { RefreshConstants } from '../../utils/RefreshConstants' @@ -5,12 +5,14 @@ import { RefreshConstants } from '../../utils/RefreshConstants'
5 */ 5 */
6 @Component 6 @Component
7 export default struct NoMoreLayout { 7 export default struct NoMoreLayout {
  8 +
  9 +
8 build() { 10 build() {
9 - Row() { 11 + Column() {
10 Text($r('app.string.footer_text')) 12 Text($r('app.string.footer_text'))
11 - .margin({ left: RefreshConstants.NoMoreLayoutConstant_NORMAL_PADDING })  
12 .fontSize(RefreshConstants.NoMoreLayoutConstant_TITLE_FONT) 13 .fontSize(RefreshConstants.NoMoreLayoutConstant_TITLE_FONT)
13 .textAlign(TextAlign.Center) 14 .textAlign(TextAlign.Center)
  15 + .margin({bottom:40})
14 } 16 }
15 .width(RefreshConstants.FULL_WIDTH) 17 .width(RefreshConstants.FULL_WIDTH)
16 .justifyContent(FlexAlign.Center) 18 .justifyContent(FlexAlign.Center)
1 import { Params } from 'wdBean'; 1 import { Params } from 'wdBean';
2 import { AppUtils, StringUtils } from 'wdKit/Index'; 2 import { AppUtils, StringUtils } from 'wdKit/Index';
3 import { WDRouterPage, WDRouterRule } from 'wdRouter'; 3 import { WDRouterPage, WDRouterRule } from 'wdRouter';
  4 +import { CustomTitleUI } from '../reusable/CustomTitleUI';
4 import { EnvironmentCustomDialog } from './EnvironmentCustomDialog'; 5 import { EnvironmentCustomDialog } from './EnvironmentCustomDialog';
5 6
6 const TAG = 'AboutPageUI'; 7 const TAG = 'AboutPageUI';
@@ -23,11 +24,11 @@ export struct AboutPageUI { @@ -23,11 +24,11 @@ export struct AboutPageUI {
23 }) 24 })
24 25
25 build() { 26 build() {
26 - Navigation() { 27 + // Navigation() {
27 //滑动区域 28 //滑动区域
28 this.aboutUi() 29 this.aboutUi()
29 - }.titleMode(NavigationTitleMode.Mini)  
30 - .title('关于') 30 + // }.titleMode(NavigationTitleMode.Mini)
  31 + // .title('关于')
31 } 32 }
32 33
33 aboutToAppear() { 34 aboutToAppear() {
@@ -42,6 +43,8 @@ export struct AboutPageUI { @@ -42,6 +43,8 @@ export struct AboutPageUI {
42 @Builder 43 @Builder
43 aboutUi() { 44 aboutUi() {
44 Column() { 45 Column() {
  46 + CustomTitleUI({titleName:'关于'})
  47 +
45 Image($r('app.media.setting_about_logo')) 48 Image($r('app.media.setting_about_logo'))
46 .width('278lpx') 49 .width('278lpx')
47 .height('154lpx') 50 .height('154lpx')
@@ -34,7 +34,7 @@ export class RefreshConstants { @@ -34,7 +34,7 @@ export class RefreshConstants {
34 /** 34 /**
35 * The refresh and load height. 35 * The refresh and load height.
36 */ 36 */
37 - static readonly CUSTOM_LAYOUT_HEIGHT: number = 90; 37 + static readonly CUSTOM_LAYOUT_HEIGHT: number = 80;
38 /** 38 /**
39 * Full the width. 39 * Full the width.
40 */ 40 */
@@ -58,10 +58,10 @@ export struct TabLiveComponent { @@ -58,10 +58,10 @@ export struct TabLiveComponent {
58 // 加载更多 58 // 加载更多
59 ListItem() { 59 ListItem() {
60 if (this.pageModel.hasMore) { 60 if (this.pageModel.hasMore) {
61 - LoadMoreLayout({  
62 - refreshBean: new RefreshLayoutBean(this.pageModel.isVisiblePullUpLoad, this.pageModel.pullUpLoadImage,  
63 - this.pageModel.pullUpLoadText, this.pageModel.pullUpLoadHeight)  
64 - }) 61 + // LoadMoreLayout({
  62 + // refreshBean: new RefreshLayoutBean(this.pageModel.isVisiblePullUpLoad, this.pageModel.pullUpLoadImage,
  63 + // this.pageModel.pullUpLoadText, this.pageModel.pullUpLoadHeight)
  64 + // })
65 } else { 65 } else {
66 ListHasNoMoreDataUI() 66 ListHasNoMoreDataUI()
67 } 67 }
@@ -89,7 +89,7 @@ export struct TabLiveComponent { @@ -89,7 +89,7 @@ export struct TabLiveComponent {
89 if (data.barrageResponses && data.barrageResponses.length > 0) { 89 if (data.barrageResponses && data.barrageResponses.length > 0) {
90 /** 90 /**
91 * 在直播聊天添加一条新内容逻辑: 91 * 在直播聊天添加一条新内容逻辑:
92 - 判断 oldNewsId:迁移id空 且 直播状态不是预约:"wait" 92 + 判断 oldNewsId:迁移id空 且 直播状态不是预约:"wait"
93 消息内容: 93 消息内容:
94 1.头像固定:APP默认头像 94 1.头像固定:APP默认头像
95 2.名称固定:人民日报主持人 95 2.名称固定:人民日报主持人
@@ -105,22 +105,17 @@ export struct TabLiveComponent { @@ -105,22 +105,17 @@ export struct TabLiveComponent {
105 if (StringUtils.isEmpty(this.liveDetailsBean.oldNewsId) 105 if (StringUtils.isEmpty(this.liveDetailsBean.oldNewsId)
106 && this.liveDetailsBean 106 && this.liveDetailsBean
107 && this.liveDetailsBean.liveInfo.liveState != 'wait') { 107 && this.liveDetailsBean.liveInfo.liveState != 'wait') {
108 - let liveRoomItemBeanTemp: LiveRoomItemBean = {} as LiveRoomItemBean  
109 - liveRoomItemBeanTemp.text = this.liveDetailsBean.newIntroduction  
110 - liveRoomItemBeanTemp.senderUserName = '人民日报主持人'  
111 - liveRoomItemBeanTemp.pictureUrls = []  
112 - liveRoomItemBeanTemp.pictureUrls.push(this.liveDetailsBean?.fullColumnImgUrls[0]?.url)  
113 - liveRoomItemBeanTemp.dataType = 'ZH_TEXT_AND_IMAGE_MSG'  
114 - let temp = this.liveDetailsBean?.fullColumnImgUrls[0]  
115 - if (temp) {  
116 - liveRoomItemBeanTemp.pictureResolutions = []  
117 - liveRoomItemBeanTemp.pictureResolutions.push(`${temp.height}*${temp.weight}`)  
118 - }  
119 - this.liveList.push(liveRoomItemBeanTemp) 108 + this.updateLiveListData()
120 } 109 }
121 } 110 }
122 } else { 111 } else {
123 - this.pageModel.viewType = ViewType.EMPTY; 112 + if (StringUtils.isEmpty(this.liveDetailsBean.oldNewsId)
  113 + && this.liveDetailsBean
  114 + && this.liveDetailsBean.liveInfo.liveState != 'wait') {
  115 + this.updateLiveListData()
  116 + } else {
  117 + this.pageModel.viewType = ViewType.EMPTY;
  118 + }
124 } 119 }
125 }, 120 },
126 () => { 121 () => {
@@ -128,6 +123,21 @@ export struct TabLiveComponent { @@ -128,6 +123,21 @@ export struct TabLiveComponent {
128 }) 123 })
129 } 124 }
130 125
  126 + updateLiveListData() {
  127 + let liveRoomItemBeanTemp: LiveRoomItemBean = {} as LiveRoomItemBean
  128 + liveRoomItemBeanTemp.text = this.liveDetailsBean.newIntroduction
  129 + liveRoomItemBeanTemp.senderUserName = '人民日报主持人'
  130 + liveRoomItemBeanTemp.pictureUrls = []
  131 + liveRoomItemBeanTemp.pictureUrls.push(this.liveDetailsBean?.fullColumnImgUrls[0]?.url)
  132 + liveRoomItemBeanTemp.dataType = 'ZH_TEXT_AND_IMAGE_MSG'
  133 + let temp = this.liveDetailsBean?.fullColumnImgUrls[0]
  134 + if (temp) {
  135 + liveRoomItemBeanTemp.pictureResolutions = []
  136 + liveRoomItemBeanTemp.pictureResolutions.push(`${temp.height}*${temp.weight}`)
  137 + }
  138 + this.liveList.push(liveRoomItemBeanTemp)
  139 + }
  140 +
131 aboutToDisappear(): void { 141 aboutToDisappear(): void {
132 } 142 }
133 } 143 }
1 import { Logger } from 'wdKit/src/main/ets/utils/Logger' 1 import { Logger } from 'wdKit/src/main/ets/utils/Logger'
2 import { LoginModel } from './LoginModel' 2 import { LoginModel } from './LoginModel'
3 import { LoginBean } from './LoginBean' 3 import { LoginBean } from './LoginBean'
4 -import { SPHelper, StringUtils, UserDataLocal } from 'wdKit' 4 +import { EmitterEventId, EmitterUtils, SPHelper, StringUtils, UserDataLocal } from 'wdKit'
5 import { CheckVerifyBean } from './CheckVerifyBean' 5 import { CheckVerifyBean } from './CheckVerifyBean'
6 import cryptoFramework from '@ohos.security.cryptoFramework' 6 import cryptoFramework from '@ohos.security.cryptoFramework'
7 import buffer from '@ohos.buffer' 7 import buffer from '@ohos.buffer'
@@ -55,6 +55,7 @@ export class LoginViewModel { @@ -55,6 +55,7 @@ export class LoginViewModel {
55 SPHelper.default.saveSync(SpConstants.USER_STATUS, data.status) 55 SPHelper.default.saveSync(SpConstants.USER_STATUS, data.status)
56 SPHelper.default.saveSync(SpConstants.USER_Type, data.userType) 56 SPHelper.default.saveSync(SpConstants.USER_Type, data.userType)
57 SPHelper.default.saveSync(SpConstants.USER_NAME, data.userName) 57 SPHelper.default.saveSync(SpConstants.USER_NAME, data.userName)
  58 + EmitterUtils.sendEmptyEvent(EmitterEventId.LOGIN_SUCCESS)
58 success(data) 59 success(data)
59 }).catch((error:string) => { 60 }).catch((error:string) => {
60 fail(error) 61 fail(error)
@@ -82,6 +83,7 @@ export class LoginViewModel { @@ -82,6 +83,7 @@ export class LoginViewModel {
82 SPHelper.default.saveSync(SpConstants.USER_STATUS, data.status) 83 SPHelper.default.saveSync(SpConstants.USER_STATUS, data.status)
83 SPHelper.default.saveSync(SpConstants.USER_Type, data.userType) 84 SPHelper.default.saveSync(SpConstants.USER_Type, data.userType)
84 SPHelper.default.saveSync(SpConstants.USER_NAME, data.userName) 85 SPHelper.default.saveSync(SpConstants.USER_NAME, data.userName)
  86 + EmitterUtils.sendEmptyEvent(EmitterEventId.LOGIN_SUCCESS)
85 success(data) 87 success(data)
86 }).catch((value: string) => { 88 }).catch((value: string) => {
87 fail(value) 89 fail(value)