陈剑华

Merge remote-tracking branch 'origin/main'

1 -import ArrayList from '@ohos.util.ArrayList'  
2 -import { ViewType } from 'wdConstant/Index';  
3 import { DateTimeUtils, EmitterEventId, EmitterUtils, LazyDataSource } from 'wdKit/Index'; 1 import { DateTimeUtils, EmitterEventId, EmitterUtils, LazyDataSource } from 'wdKit/Index';
4 -import PageModel from '../../../viewmodel/PageModel';  
5 -import { commentItemModel, commentListModel, WDPublicUserType } from '../model/CommentModel';  
6 -import commentViewModel from '../viewmodel/CommentViewModel' 2 +import { commentItemModel, WDPublicUserType } from '../model/CommentModel';
  3 +import commentViewModel from '../viewmodel/CommentViewModel';
7 import { CommentText } from './CommentText'; 4 import { CommentText } from './CommentText';
8 -import measure from '@ohos.measure'  
9 -import { CommentCustomDialog } from './CommentCustomDialog' 5 +import { CommentCustomDialog } from './CommentCustomDialog';
10 import { publishCommentModel } from '../model/PublishCommentModel'; 6 import { publishCommentModel } from '../model/PublishCommentModel';
11 -import { ifaa } from '@kit.OnlineAuthenticationKit';  
12 -import { HttpUrlUtils, HttpUtils } from 'wdNetwork/Index';  
13 -import NoMoreLayout from '../../page/NoMoreLayout'; 7 +import { HttpUtils } from 'wdNetwork/Index';
14 import { WDRouterPage, WDRouterRule } from 'wdRouter/Index'; 8 import { WDRouterPage, WDRouterRule } from 'wdRouter/Index';
15 -import { ColorUtils } from '../../../utils/ColorUtils'; 9 +import { EmptyComponent } from '../../view/EmptyComponent';
16 10
17 const TAG = 'CommentComponent'; 11 const TAG = 'CommentComponent';
18 12
@@ -27,10 +21,8 @@ export struct CommentComponent { @@ -27,10 +21,8 @@ export struct CommentComponent {
27 // @State private browSingModel: commentListModel = new commentListModel() 21 // @State private browSingModel: commentListModel = new commentListModel()
28 /*必传*/ 22 /*必传*/
29 @ObjectLink publishCommentModel: publishCommentModel 23 @ObjectLink publishCommentModel: publishCommentModel
30 -  
31 listScroller: ListScroller = new ListScroller(); // scroller控制器 24 listScroller: ListScroller = new ListScroller(); // scroller控制器
32 historyOffset: number = 0; // 上次浏览到列表距离顶端的偏移量offset 25 historyOffset: number = 0; // 上次浏览到列表距离顶端的偏移量offset
33 -  
34 isloading: boolean = false 26 isloading: boolean = false
35 @State allDatas: LazyDataSource<commentItemModel> = new LazyDataSource(); 27 @State allDatas: LazyDataSource<commentItemModel> = new LazyDataSource();
36 @State dialogController: CustomDialogController | null = null; 28 @State dialogController: CustomDialogController | null = null;
@@ -142,7 +134,7 @@ export struct CommentComponent { @@ -142,7 +134,7 @@ export struct CommentComponent {
142 134
143 build() { 135 build() {
144 Column() { 136 Column() {
145 - List({scroller:this.listScroller}) { 137 + List({ scroller: this.listScroller }) {
146 ListItemGroup({ header: this.titleHeader() }) 138 ListItemGroup({ header: this.titleHeader() })
147 139
148 LazyForEach(this.allDatas, (item: commentItemModel, index: number) => { 140 LazyForEach(this.allDatas, (item: commentItemModel, index: number) => {
@@ -181,10 +173,15 @@ export struct CommentComponent { @@ -181,10 +173,15 @@ export struct CommentComponent {
181 173
182 // 加载更多 174 // 加载更多
183 ListItem() { 175 ListItem() {
184 - if (this.hasMore === false) NoMoreLayout() 176 + if (this.hasMore === false) {
  177 + // NoMoreLayout()
  178 + EmptyComponent({ emptyType: 17 })
  179 + .height(300)
185 } 180 }
  181 +
186 } 182 }
187 - .onReachEnd(()=>{ 183 + }
  184 + .onReachEnd(() => {
188 if (this.hasMore) { 185 if (this.hasMore) {
189 this.getData() 186 this.getData()
190 } 187 }
@@ -197,11 +194,13 @@ export struct CommentComponent { @@ -197,11 +194,13 @@ export struct CommentComponent {
197 194
198 //获取数据 195 //获取数据
199 async getData() { 196 async getData() {
200 - commentViewModel.fetchContentCommentList(this.currentPage + '', this.publishCommentModel.targetId, this.publishCommentModel.targetType) 197 + commentViewModel.fetchContentCommentList(this.currentPage + '', this.publishCommentModel.targetId,
  198 + this.publishCommentModel.targetType)
201 .then(commentListModel => { 199 .then(commentListModel => {
202 this.currentPage++ 200 this.currentPage++
203 201
204 - if (Number.parseInt(commentListModel.totalCommentNum) > Number.parseInt(this.publishCommentModel.totalCommentNumer)) { 202 + if (Number.parseInt(commentListModel.totalCommentNum) >
  203 + Number.parseInt(this.publishCommentModel.totalCommentNumer)) {
205 this.publishCommentModel.totalCommentNumer = commentListModel.totalCommentNum + '' 204 this.publishCommentModel.totalCommentNumer = commentListModel.totalCommentNum + ''
206 } 205 }
207 206
@@ -223,7 +222,7 @@ export struct CommentComponent { @@ -223,7 +222,7 @@ export struct CommentComponent {
223 }); 222 });
224 223
225 224
226 - }else{ 225 + } else {
227 this.hasMore = false 226 this.hasMore = false
228 } 227 }
229 }) 228 })
@@ -47,7 +47,7 @@ export default struct MinePageMoreFunctionUI { @@ -47,7 +47,7 @@ export default struct MinePageMoreFunctionUI {
47 .fontWeight(400) 47 .fontWeight(400)
48 48
49 Blank() 49 Blank()
50 - Image($r('app.media.mine_user_arrow')) 50 + Image($r('app.media.mine_user_arrow_2'))
51 .width('27lpx') 51 .width('27lpx')
52 .height('27lpx') 52 .height('27lpx')
53 .objectFit(ImageFit.Auto) 53 .objectFit(ImageFit.Auto)
@@ -83,14 +83,15 @@ export default struct MinePageUserSimpleInfoUI { @@ -83,14 +83,15 @@ export default struct MinePageUserSimpleInfoUI {
83 .height('29lpx') 83 .height('29lpx')
84 }.margin({top:'15lpx'}) 84 }.margin({top:'15lpx'})
85 }.alignItems(HorizontalAlign.Start) 85 }.alignItems(HorizontalAlign.Start)
86 - .margin({top:'12lpx',left:'17lpx'}) 86 + .margin({top:'12lpx',left:'23lpx'})
87 .width('352lpx') 87 .width('352lpx')
88 }else{ 88 }else{
89 Row(){ 89 Row(){
90 Text("登录注册") 90 Text("登录注册")
91 .fontColor($r('app.color.color_222222')) 91 .fontColor($r('app.color.color_222222'))
92 - .textOverflow({ overflow: TextOverflow.Ellipsis })  
93 - .fontSize('33lpx') 92 + .fontSize('38lpx')
  93 + .lineHeight("46lpx")
  94 + .fontWeight(600)
94 95
95 Image($r('app.media.mine_user_edit')) 96 Image($r('app.media.mine_user_edit'))
96 .width('11lpx') 97 .width('11lpx')
@@ -101,7 +102,7 @@ export default struct MinePageUserSimpleInfoUI { @@ -101,7 +102,7 @@ export default struct MinePageUserSimpleInfoUI {
101 }.onClick(()=>{ 102 }.onClick(()=>{
102 this.jumpLogin() 103 this.jumpLogin()
103 }) 104 })
104 - .margin({top:'11lpx',left:'17lpx'}) 105 + .margin({top:'11lpx',left:'23lpx'})
105 .width('352lpx') 106 .width('352lpx')
106 } 107 }
107 108
1 import { BottomNavDTO, CompDTO, TopNavDTO } from 'wdBean'; 1 import { BottomNavDTO, CompDTO, TopNavDTO } from 'wdBean';
2 import { SpConstants } from 'wdConstant'; 2 import { SpConstants } from 'wdConstant';
3 -import { DisplayUtils, LazyDataSource, Logger, SPHelper } from 'wdKit'; 3 +import { DisplayUtils, LazyDataSource, Logger, SPHelper, NetworkUtil, ToastUtils } from 'wdKit';
4 import { ProcessUtils, WDRouterPage, WDRouterRule } from 'wdRouter'; 4 import { ProcessUtils, WDRouterPage, WDRouterRule } from 'wdRouter';
5 import { PageComponent } from './PageComponent'; 5 import { PageComponent } from './PageComponent';
6 import { ChannelSubscriptionLayout } from './ChannelSubscriptionLayout'; 6 import { ChannelSubscriptionLayout } from './ChannelSubscriptionLayout';
@@ -209,7 +209,11 @@ export struct TopNavigationComponent { @@ -209,7 +209,11 @@ export struct TopNavigationComponent {
209 .height(30) 209 .height(30)
210 .width(124) 210 .width(124)
211 .onClick(() => { 211 .onClick(() => {
  212 + if (NetworkUtil.isNetConnected()) {
212 ProcessUtils.gotoMorningEveningPaper() 213 ProcessUtils.gotoMorningEveningPaper()
  214 + } else {
  215 + ToastUtils.showToast('网络出小差了,请检查网络后重试', 1000)
  216 + }
213 }) 217 })
214 }.width('100%') 218 }.width('100%')
215 .justifyContent(FlexAlign.SpaceBetween) 219 .justifyContent(FlexAlign.SpaceBetween)
@@ -256,7 +256,7 @@ export struct MineSettingComponent { @@ -256,7 +256,7 @@ export struct MineSettingComponent {
256 256
257 // 右侧文案和右箭头 257 // 右侧文案和右箭头
258 Row() { 258 Row() {
259 - Text((item.itemType=='clear_cache') ? this.cacheSize.toFixed(2) + 'MB' : '') 259 + Text((item.itemType=='clear_cache') ? this.cacheSize.toFixed(2) + 'M' : '')
260 .fontColor('#999999') 260 .fontColor('#999999')
261 .maxLines(1) 261 .maxLines(1)
262 Image($r('app.media.mine_user_arrow')) 262 Image($r('app.media.mine_user_arrow'))
@@ -231,7 +231,7 @@ export struct EmptyComponent { @@ -231,7 +231,7 @@ export struct EmptyComponent {
231 this.emptyType === WDViewDefaultType.WDViewDefaultType_NoComment1) { 231 this.emptyType === WDViewDefaultType.WDViewDefaultType_NoComment1) {
232 imageString = $r('app.media.icon_no_comment') 232 imageString = $r('app.media.icon_no_comment')
233 } else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoSearchResult) { 233 } else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoSearchResult) {
234 - imageString = $r('app.media.icon_no_result') 234 + imageString = $r('app.media.icon_no_result1')
235 } else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoNetwork) { 235 } else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoNetwork) {
236 imageString = $r('app.media.icon_no_net1') 236 imageString = $r('app.media.icon_no_net1')
237 } else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_ContentFailed) { 237 } else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_ContentFailed) {
@@ -47,13 +47,13 @@ class MineSettingDatasModel{ @@ -47,13 +47,13 @@ class MineSettingDatasModel{
47 this.mainSettingData.push(new MineMainSettingFunctionItem(null, '接收推送', null, 1, pushState,"push_switch")) 47 this.mainSettingData.push(new MineMainSettingFunctionItem(null, '接收推送', null, 1, pushState,"push_switch"))
48 this.mainSettingData.push(new MineMainSettingFunctionItem(null, '隐私设罝', null, 0, false,"private_setting")) 48 this.mainSettingData.push(new MineMainSettingFunctionItem(null, '隐私设罝', null, 0, false,"private_setting"))
49 let wifiState=SPHelper.default.getSync(SpConstants.SETTING_WIFI_IMAGE_SWITCH,false) as boolean 49 let wifiState=SPHelper.default.getSync(SpConstants.SETTING_WIFI_IMAGE_SWITCH,false) as boolean
50 - this.mainSettingData.push(new MineMainSettingFunctionItem(null, '仅WiFi网络加载图片', null, 1, wifiState,"wifi_switch")) 50 + this.mainSettingData.push(new MineMainSettingFunctionItem(null, '仅wifi网络加载图片', null, 1, wifiState,"wifi_switch"))
51 let videoState=SPHelper.default.getSync(SpConstants.SETTING_WIFI_VIDEO_SWITCH,false) as boolean 51 let videoState=SPHelper.default.getSync(SpConstants.SETTING_WIFI_VIDEO_SWITCH,false) as boolean
52 - this.mainSettingData.push(new MineMainSettingFunctionItem(null, 'WiFi网络情况下自动播放视频', null, 1, videoState,"video_switch")) 52 + this.mainSettingData.push(new MineMainSettingFunctionItem(null, 'wifi网络情况下自动播放视频', null, 1, videoState,"video_switch"))
53 let suspensionState=SPHelper.default.getSync(SpConstants.SETTING_SUSPENSION_SWITCH,false) as boolean 53 let suspensionState=SPHelper.default.getSync(SpConstants.SETTING_SUSPENSION_SWITCH,false) as boolean
54 this.mainSettingData.push(new MineMainSettingFunctionItem(null, '开启播放器悬浮窗', null, 1, suspensionState,"suspensionState_switch")) 54 this.mainSettingData.push(new MineMainSettingFunctionItem(null, '开启播放器悬浮窗', null, 1, suspensionState,"suspensionState_switch"))
55 this.mainSettingData.push(new MineMainSettingFunctionItem(null, null, null, 2, null,"")) 55 this.mainSettingData.push(new MineMainSettingFunctionItem(null, null, null, 2, null,""))
56 - this.mainSettingData.push(new MineMainSettingFunctionItem(null, '清缓存', '32MB', 0, false,"clear_cache")) 56 + this.mainSettingData.push(new MineMainSettingFunctionItem(null, '清缓存', '32MB', 0, false,"clear_cache"))
57 this.mainSettingData.push(new MineMainSettingFunctionItem(null, '评价我们', null, 0, false,"")) 57 this.mainSettingData.push(new MineMainSettingFunctionItem(null, '评价我们', null, 0, false,""))
58 58
59 return this.mainSettingData 59 return this.mainSettingData
@@ -392,7 +392,7 @@ struct MineHomePage { @@ -392,7 +392,7 @@ struct MineHomePage {
392 this.userName = value.userName 392 this.userName = value.userName
393 this.headPhotoUrl = value.headPhotoUrl 393 this.headPhotoUrl = value.headPhotoUrl
394 if(StringUtils.isNotEmpty(value.introduction)){ 394 if(StringUtils.isNotEmpty(value.introduction)){
395 - this.desc = value.introduction 395 + this.desc = "简介:" + value.introduction
396 this.isHasIntroduction = true 396 this.isHasIntroduction = true
397 }else{ 397 }else{
398 this.desc = "点击添加简介,让大家认识你" 398 this.desc = "点击添加简介,让大家认识你"
@@ -90,7 +90,7 @@ export struct TabLiveComponent { @@ -90,7 +90,7 @@ export struct TabLiveComponent {
90 20) 90 20)
91 .then( 91 .then(
92 (data) => { 92 (data) => {
93 - Logger.debug(TAG, `${JSON.stringify(data)}`) 93 + Logger.debug(TAG, '直播间数据:' + `${JSON.stringify(data)}`)
94 if (data.barrageResponses && data.barrageResponses.length > 0) { 94 if (data.barrageResponses && data.barrageResponses.length > 0) {
95 /** 95 /**
96 * 在直播聊天添加一条新内容逻辑: 96 * 在直播聊天添加一条新内容逻辑:
@@ -117,6 +117,7 @@ export struct TabLiveComponent { @@ -117,6 +117,7 @@ export struct TabLiveComponent {
117 if (StringUtils.isEmpty(this.liveDetailsBean.oldNewsId) 117 if (StringUtils.isEmpty(this.liveDetailsBean.oldNewsId)
118 && this.liveDetailsBean 118 && this.liveDetailsBean
119 && this.liveDetailsBean.liveInfo.liveState != 'wait') { 119 && this.liveDetailsBean.liveInfo.liveState != 'wait') {
  120 + this.pageModel.viewType = ViewType.LOADED;
120 this.updateLiveListData() 121 this.updateLiveListData()
121 } else { 122 } else {
122 this.pageModel.viewType = ViewType.EMPTY; 123 this.pageModel.viewType = ViewType.EMPTY;