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
wangliang_wd
2024-09-29 10:33:42 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
60c8a1714b8b51788daa952429d1ff154e2465d9
60c8a171
1 parent
81fa02e8
feat:优化我的界面头像闪烁问题,优化关注列表刷新逻辑
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
23 additions
and
36 deletions
sight_harmony/commons/wdKit/src/main/ets/utils/UserDataLocal.ets
sight_harmony/features/wdComponent/src/main/ets/components/mine/MinePageUserSimpleInfoUI.ets
sight_harmony/features/wdComponent/src/main/ets/components/mine/follow/FollowListDetailUI.ets
sight_harmony/features/wdComponent/src/main/ets/components/page/EditUserInfoPage.ets
sight_harmony/features/wdComponent/src/main/ets/components/page/EditUserNikeNamePage.ets
sight_harmony/commons/wdKit/src/main/ets/utils/UserDataLocal.ets
View file @
60c8a17
...
...
@@ -72,6 +72,11 @@ export class UserDataLocal {
SPHelper.default.save(UserDataLocal.USER_HEADER_URL, url)
}
public static setUser_name(url:string) {
UserDataLocal.userName = url
SPHelper.default.save(UserDataLocal.USER_NAME, url)
}
public static setUserType(type:string) {
SPHelper.default.save(UserDataLocal.USER_Type, type)
}
...
...
sight_harmony/features/wdComponent/src/main/ets/components/mine/MinePageUserSimpleInfoUI.ets
View file @
60c8a17
...
...
@@ -26,11 +26,11 @@ export default struct MinePageUserSimpleInfoUI {
loginStateChange(){
if(this.isLogin){
///已登录状态,先获取本地数据
this.userName = SPHelper.default.getSync(SpConstants.USER_NAME,"") as string
this.headPhotoUrl = SPHelper.default.getSync(SpConstants.USER_HEAD_PHOTO_URL,"") as string
this.userName = UserDataLocal.getUserName()
this.headPhotoUrl = UserDataLocal.USER_HEADER_URL
///用户类型1普通用户
let userType =
SPHelper.default.getSync(SpConstants.USER_Type,"") as string
let userType =
UserDataLocal.getUserType()
if (userType && userType.length > 0) {
this.userType = userType
}
...
...
@@ -43,7 +43,7 @@ export default struct MinePageUserSimpleInfoUI {
}
pageShowForUpdateData(){
let name =
SPHelper.default.getSync(SpConstants.USER_NAME,"") as string
let name =
UserDataLocal.getUserName()
if (name != this.userName) {
this.loginStateChange()
}
...
...
@@ -182,6 +182,8 @@ export default struct MinePageUserSimpleInfoUI {
this.headPhotoUrl = value.headPhotoUrl
UserDataLocal.setUserHeaderUrl(value.headPhotoUrl)
UserDataLocal.setUser_name(value.userName)
this.userType = value.userType
UserDataLocal.setUserType(value.userType)
...
...
sight_harmony/features/wdComponent/src/main/ets/components/mine/follow/FollowListDetailUI.ets
View file @
60c8a17
...
...
@@ -199,7 +199,7 @@ export struct FollowListDetailUI {
this.getMyFollowListDetail()
} else {
if (this.hasMore) {
let object = new FollowListDetailRequestItem(this.creatorDirectoryId,
2
0, this.curPageNum)
let object = new FollowListDetailRequestItem(this.creatorDirectoryId,
1
0, this.curPageNum)
MinePageDatasModel.getFollowListDetailData(object, getContext(this)).then((value) => {
if (!this.data || value.list.length == 0) {
...
...
@@ -250,10 +250,6 @@ export struct FollowListDetailUI {
}
})
})
if(StringUtils.isNotEmpty(userid)) {
this.getFollowStatus(data_temp, result.totalCount)
}else {
data_temp.forEach((item) => {
let introduction = item.introduction
if(item.introduction.indexOf("\n") != -1){
...
...
@@ -274,6 +270,9 @@ export struct FollowListDetailUI {
this.isLoading = false
this.isGetRequest = true
if(StringUtils.isNotEmpty(userid)) {
this.getFollowStatus(this.data, result.totalCount)
}
}else{
this.isGetRequest = true
...
...
@@ -286,41 +285,20 @@ export struct FollowListDetailUI {
})
}
getFollowStatus(result:
FollowListDetailItem[]
, totalCount: number) {
getFollowStatus(result:
LazyDataSource<FollowListDetailItem>
, totalCount: number) {
let status = new FollowListStatusRequestItem()
result.forEach((item) => {
result.
getDataArray().
forEach((item) => {
status.creatorIds.push(new QueryListIsFollowedItem(item.creatorId))
})
MinePageDatasModel.getFollowListStatusData(status, getContext(this)).then((newValue) => {
newValue.forEach((item) => {
result.forEach((list) => {
result.
getDataArray().
forEach((list) => {
if (item.creatorId == list.creatorId) {
list.status = item.status
}
})
})
result.forEach((item) => {
let introduction = item.introduction
if(item.introduction.indexOf("\n") != -1){
let regex:RegExp = new RegExp('\n','g')
introduction = item.introduction.replace(regex,'')
}
this.data.push(new FollowListDetailItem(item.headPhotoUrl, item.cnUserName, item.cnFansNum, introduction, item.creatorId, item.status, item.attentionUserId, item.cnUserType, item.cnUserId, item.mainControl, item.banControl, item.authIcon))
})
this.data.notifyDataReload()
this.count = this.data.totalCount()
if (this.data.totalCount() < totalCount) {
this.curPageNum++
} else {
this.hasMore = false
}
this.isLoading = false
this.isGetRequest = true
}).catch((err: Error) => {
// console.log(TAG, "请求失败")
this.isLoading = false
...
...
sight_harmony/features/wdComponent/src/main/ets/components/page/EditUserInfoPage.ets
View file @
60c8a17
...
...
@@ -12,7 +12,7 @@ import router from '@ohos.router';
import TrackingPageBrowseUtils from '../../utils/TrackingPageBrowseUtils'
import { TrackConstants } from 'wdTracking/Index';
import { SPHelper } from 'wdKit/Index';
import { SPHelper
, UserDataLocal
} from 'wdKit/Index';
import { SpConstants } from 'wdConstant/Index';
import { photoPickerUtils} from '../../utils/PhotoPickerUtils';
import { cameraPickerUtils } from '../../utils/CameraPickerUtils';
...
...
@@ -138,6 +138,7 @@ struct EditUserInfoPage {
let userType = SPHelper.default.getSync(SpConstants.USER_Type,"") as string
if (userType && userType.length > 0) {
this.userType = userType
this.headerImg = UserDataLocal.getUserHeaderUrl()
}
this.getAccountOwnerInfo()
...
...
sight_harmony/features/wdComponent/src/main/ets/components/page/EditUserNikeNamePage.ets
View file @
60c8a17
...
...
@@ -4,7 +4,7 @@ import { editModel, editModelParams, WDEditDataModelType } from '../../model/Edi
import EditInfoViewModel from '../../viewmodel/EditInfoViewModel';
// import { encryptMessage } from '../../../utils/cryptoUtil'
import { encryptMessage } from 'wdLogin/src/main/ets/utils/cryptoUtil'
import { SPHelper } from 'wdKit';
import { SPHelper
, UserDataLocal
} from 'wdKit';
import { SpConstants } from 'wdConstant';
@Entry
...
...
@@ -91,7 +91,8 @@ struct EditUserNikeNamePage {
}
goBack(){
SPHelper.default.saveSync(SpConstants.USER_NAME, this.nikeName)
UserDataLocal.setUser_name(this.nikeName)
let params: editModelParams = {
userName: this.nikeName
}
...
...
Please
register
or
login
to post a comment