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-04-22 17:44:59 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
d6e5a60eb478ed7bd19a46f467ca51ba26a8991a
d6e5a60e
1 parent
0569b8f2
feat:优化我的收藏
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
26 additions
and
19 deletions
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card17Component.ets
sight_harmony/features/wdComponent/src/main/ets/components/page/EditUserIntroductionPage.ets
sight_harmony/features/wdComponent/src/main/ets/components/page/EditUserNikeNamePage.ets
sight_harmony/features/wdComponent/src/main/ets/viewmodel/MyCollectionViewModel.ets
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card17Component.ets
View file @
d6e5a60
...
...
@@ -29,7 +29,8 @@ export struct Card17Component {
// 三个图,
GridRow({ gutter: 2 }) {
GridCol({ span: { xs: 8 } }) {
Image(this.contentDTO.fullColumnImgUrls[0].url)
Image(this.contentDTO.fullColumnImgUrls.length > 0 ?this.contentDTO.fullColumnImgUrls[0].url:'')
.backgroundColor('#f5f5f5')
.width(CommonConstants.FULL_WIDTH)
.aspectRatio(16 / 9)
.borderRadius({
...
...
@@ -39,7 +40,8 @@ export struct Card17Component {
}
GridCol({ span: { xs: 4 } }) {
Image(this.contentDTO.fullColumnImgUrls[1].url)
Image(this.contentDTO.fullColumnImgUrls.length > 1? this.contentDTO.fullColumnImgUrls[1].url:'')
.backgroundColor('#f5f5f5')
.width(CommonConstants.FULL_WIDTH)
.aspectRatio(16 / 9)
.margin({ bottom: 1 })
...
...
@@ -54,7 +56,8 @@ export struct Card17Component {
}
GridCol({ span: { xs: 4 } }) {
Image(this.contentDTO.fullColumnImgUrls[2].url)
Image(this.contentDTO.fullColumnImgUrls.length > 2? this.contentDTO.fullColumnImgUrls[2].url:'')
.backgroundColor('#f5f5f5')
.width(CommonConstants.FULL_WIDTH)
.aspectRatio(16 / 9)
.margin({ top: 1 })
...
...
sight_harmony/features/wdComponent/src/main/ets/components/page/EditUserIntroductionPage.ets
View file @
d6e5a60
...
...
@@ -51,11 +51,7 @@ struct EditUserIntroductionPage {
.borderRadius(5)
.margin(30)
.onClick(()=>{
let currentUserInfo:editModel = new editModel()
currentUserInfo.userExtend.introduction = this.introduction
currentUserInfo.editDataType = WDEditDataModelType.WDEditDataModelType_intro
this.updateEditModel(currentUserInfo)
this.updateEditModel()
let params: editModelParams = {
introduction: this.introduction
}
...
...
@@ -68,7 +64,10 @@ struct EditUserIntroductionPage {
}
updateEditModel(Info:editModel){
EditInfoViewModel.updateUserInfo(Info)
updateEditModel(){
let currentUserInfo:editModel = new editModel()
currentUserInfo.userExtend.introduction = this.introduction
currentUserInfo.editDataType = WDEditDataModelType.WDEditDataModelType_intro
EditInfoViewModel.updateUserInfo(currentUserInfo)
}
}
\ No newline at end of file
...
...
sight_harmony/features/wdComponent/src/main/ets/components/page/EditUserNikeNamePage.ets
View file @
d6e5a60
...
...
@@ -2,6 +2,8 @@ import { CustomTitleUI } from '../reusable/CustomTitleUI'
import router from '@ohos.router'
import { editModel, editModelParams, WDEditDataModelType } from '../../model/EditInfoModel'
import EditInfoViewModel from '../../viewmodel/EditInfoViewModel';
// import { encryptMessage } from '../../../utils/cryptoUtil'
import { encryptMessage } from 'wdLogin/src/main/ets/utils/cryptoUtil'
@Entry
@Component
struct EditUserNikeNamePage {
...
...
@@ -51,13 +53,17 @@ struct EditUserNikeNamePage {
.borderRadius(5)
.margin(30)
.onClick(()=>{
///内部更新
this.updateEditModel()
})
}
}
async updateEditModel(){
let currentUserInfo:editModel = new editModel()
currentUserInfo.userExtend.introduction = this.nikeName
currentUserInfo.userName = await encryptMessage(this.nikeName);
currentUserInfo.editDataType = WDEditDataModelType.WDEditDataModelType_nickname
this.updateEditModel(currentUserInfo)
EditInfoViewModel.updateUserInfo(currentUserInfo).then(()=>{
let params: editModelParams = {
userName: this.nikeName
}
...
...
@@ -67,9 +73,4 @@ struct EditUserNikeNamePage {
})
})
}
}
updateEditModel(Info:editModel){
EditInfoViewModel.updateUserInfo(Info)
}
}
\ No newline at end of file
...
...
sight_harmony/features/wdComponent/src/main/ets/viewmodel/MyCollectionViewModel.ets
View file @
d6e5a60
...
...
@@ -53,8 +53,12 @@ class MyCollectionViewModel {
let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders()
WDHttp.post<ResponseDTO>(HttpUrlUtils.getExecuteCollcetUrl(),params,headers).then((navResDTO: ResponseDTO) => {
if (navResDTO.code == 0) {
if(params.status === 1){
promptAction.showToast({ message: '收藏成功' })
} else {
promptAction.showToast({ message: '删除成功' })
}
}
})
.catch((error: Error) => {
Logger.info(TAG,'executeCollcet','ResponseDTO')
...
...
Please
register
or
login
to post a comment