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
张善主
2024-04-29 14:57:26 +0800
Browse Files
Options
Browse Files
Download
Plain Diff
Commit
25c3397986436b5fe94c84966e8c1df486872160
25c33979
2 parents
a5547d14
2dda6e41
Merge remote-tracking branch 'origin/main'
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
49 additions
and
20 deletions
sight_harmony/features/wdComponent/src/main/ets/components/peopleShip/PeopleShipMainComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/peopleShip/PeopleShipRecommendComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/peopleShipHomePage/PeopleShipHomeArticleListComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/peopleShipHomePage/PeopleShipHomeNavComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/reusable/PeopleShipNoMoreData.ets
sight_harmony/features/wdComponent/src/main/ets/components/search/SearchComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/search/SearchHotsComponent.ets
sight_harmony/features/wdComponent/src/main/ets/model/SearcherAboutDataModel.ets
sight_harmony/features/wdComponent/src/main/resources/base/media/search_hots_mark1.png
sight_harmony/features/wdComponent/src/main/resources/base/media/search_hots_mark2.png
sight_harmony/features/wdLogin/src/main/ets/pages/login/LoginViewModel.ets
sight_harmony/features/wdComponent/src/main/ets/components/peopleShip/PeopleShipMainComponent.ets
View file @
25c3397
...
...
@@ -24,7 +24,7 @@ import PageAdModel from '../../viewmodel/PageAdvModel';
import PageHelper from '../../viewmodel/PageHelper';
import { PeopleShipAttentionContentListTopComponent } from './PeopleShipAttentionContentListTopComponent'
import { CardParser } from '../CardParser'
import
NoMoreLayout from '../page/NoMoreLayout
';
import
{ PeopleShipNoMoreData } from '../reusable/PeopleShipNoMoreData
';
@Preview
@Component
...
...
@@ -161,7 +161,7 @@ export struct PeopleShipMainComponent {
// 加载更多
ListItem() {
if (!this.hasMore && !this.isLoading) {
NoMoreLayout
()
PeopleShipNoMoreData
()
}
}
}
...
...
sight_harmony/features/wdComponent/src/main/ets/components/peopleShip/PeopleShipRecommendComponent.ets
View file @
25c3397
import { PeopleShipRecommendHeadComponent } from './PeopleShipRecommendHeadComponent'
import { RmhRecommendDTO } from 'wdBean';
import { Logger } from 'wdKit/Index';
import NoMoreLayout from '../page/NoMoreLayout';
import { PeopleShipNoMoreData } from '../reusable/PeopleShipNoMoreData';
@Component
export struct PeopleShipRecommendComponent {
...
...
@@ -87,7 +86,8 @@ export struct PeopleShipRecommendComponent {
// 为你推荐
Button(this.rmhSelectedList.length == 0 ? '一键关注' : `一键关注 (${this.rmhSelectedList.length})`, { type: ButtonType.Normal, stateEffect: this.rmhSelectedList.length != 0 })
.margin({
top: '24vp'
top: '24vp',
bottom: '10vp'
})
.width('120vp')
.height('36vp')
...
...
@@ -104,7 +104,7 @@ export struct PeopleShipRecommendComponent {
}
})
// 没有更多
NoMoreLayout
()
PeopleShipNoMoreData
()
}
.width('100%')
}
...
...
sight_harmony/features/wdComponent/src/main/ets/components/peopleShipHomePage/PeopleShipHomeArticleListComponent.ets
View file @
25c3397
...
...
@@ -18,9 +18,9 @@ import { CardParser } from '../CardParser'
import { PageRepository } from '../../repository/PageRepository'
import { RefreshLayoutBean } from '../page/RefreshLayoutBean'
import CustomRefreshLoadLayout from '../page/CustomRefreshLoadLayout'
import { ErrorComponent } from '../view/ErrorComponent';
import NoMoreLayout from '../page/NoMoreLayout';
import { ErrorComponent } from '../view/ErrorComponent'
import { CustomPullToRefresh } from '../reusable/CustomPullToRefresh'
import { PeopleShipNoMoreData } from '../reusable/PeopleShipNoMoreData'
const TAG = 'PeopleShipHomeArticleListComponent';
...
...
@@ -104,7 +104,7 @@ export struct PeopleShipHomeArticleListComponent {
// 加载更多
ListItem() {
if (!this.hasMore && !this.isLoading) {
NoMoreLayout
()
PeopleShipNoMoreData
()
}
}
}
...
...
sight_harmony/features/wdComponent/src/main/ets/components/peopleShipHomePage/PeopleShipHomeNavComponent.ets
View file @
25c3397
...
...
@@ -56,7 +56,7 @@ export struct PeopleShipHomePageNavComponent {
if (this.isAttention == '0') {
// 关注
Button('+关注', { type: ButtonType.Normal, stateEffect: true })
Button('+
关注', { type: ButtonType.Normal, stateEffect: true })
.borderRadius(4)
.backgroundColor($r('app.color.color_ED2800'))
.width('54vp')
...
...
sight_harmony/features/wdComponent/src/main/ets/components/reusable/PeopleShipNoMoreData.ets
0 → 100644
View file @
25c3397
@Component
export struct PeopleShipNoMoreData{
@State title: string = '已显示全部内容'
build(){
Row(){
Text("已显示全部内容")
.fontColor($r('app.color.color_999999'))
.fontWeight(400)
.fontSize('14vp')
}
.justifyContent(FlexAlign.Center)
.alignItems(VerticalAlign.Center)
.width('100%')
.margin({top:'24vp',bottom:'24vp'})
}
}
\ No newline at end of file
...
...
sight_harmony/features/wdComponent/src/main/ets/components/search/SearchComponent.ets
View file @
25c3397
...
...
@@ -34,6 +34,8 @@ export struct SearchComponent {
aboutToAppear() {
//获取提示滚动
this.getSearchHint()
//清除缓存
SearcherAboutDataModel.searchHistoryData = []
//获取搜索历史
this.getSearchHistoryData()
}
...
...
sight_harmony/features/wdComponent/src/main/ets/components/search/SearchHotsComponent.ets
View file @
25c3397
...
...
@@ -80,7 +80,7 @@ export struct SearchHotsComponent{
.fontWeight('400lpx')
.lineHeight('42lpx')
}.layoutWeight(1)
if(item.mark
!=0
){
if(item.mark
===1 || item.mark===2
){
Image(item.mark===1?$r('app.media.search_hots_mark1'):$r('app.media.search_hots_mark2'))
.width('42lpx')
.height('31lpx')
...
...
sight_harmony/features/wdComponent/src/main/ets/model/SearcherAboutDataModel.ets
View file @
25c3397
import { Logger, SPHelper, UserDataLocal } from 'wdKit';
import { Logger, SPHelper,
StringUtils,
UserDataLocal } from 'wdKit';
import { HttpUrlUtils, ResponseDTO, WDHttp } from 'wdNetwork';
import { SearchHistoryItem } from '../viewmodel/SearchHistoryItem';
import { SearchHotContentItem } from '../viewmodel/SearchHotContentItem';
...
...
@@ -18,7 +18,7 @@ const TAG = "SearcherAboutDataModel"
class SearcherAboutDataModel{
private static instance: SearcherAboutDataModel;
public searchHistoryData:SearchHistoryItem[] = []
public SEARCH_HISTORY_KEY:string = "SEARCH_HISTORY_KEY"
+ UserDataLocal.getUserId()
public SEARCH_HISTORY_KEY:string = "SEARCH_HISTORY_KEY"
private constructor() { }
...
...
@@ -37,7 +37,7 @@ class SearcherAboutDataModel{
* 插入搜索记录(单个)
*/
public async putSearchHistoryData(content:string){
let history = SPHelper.default.getSync(this.
SEARCH_HISTORY_KEY
,"[]") as string
let history = SPHelper.default.getSync(this.
generationSearchKey()
,"[]") as string
this.searchHistoryData = JSON.parse(history)
this.searchHistoryData.forEach((element,index) => {
if (element.searchContent == content) {
...
...
@@ -45,14 +45,14 @@ class SearcherAboutDataModel{
}
});
this.searchHistoryData.splice(0,0,new SearchHistoryItem(content))
await SPHelper.default.saveSync(this.
SEARCH_HISTORY_KEY
, JSON.stringify(this.searchHistoryData));
await SPHelper.default.saveSync(this.
generationSearchKey()
, JSON.stringify(this.searchHistoryData));
}
/**
* 删除搜索记录(所有)
*/
public async delSearchHistoryData(){
SPHelper.default.deleteSync(this.
SEARCH_HISTORY_KEY
)
SPHelper.default.deleteSync(this.
generationSearchKey()
)
this.searchHistoryData = []
}
/**
...
...
@@ -62,11 +62,11 @@ class SearcherAboutDataModel{
if(this.searchHistoryData!=null && this.searchHistoryData.length>0){
this.searchHistoryData.splice(index,1)
}else{
let history = SPHelper.default.getSync(this.
SEARCH_HISTORY_KEY
,"[]") as string
let history = SPHelper.default.getSync(this.
generationSearchKey()
,"[]") as string
this.searchHistoryData = JSON.parse(history)
this.searchHistoryData.splice(index,1)
}
SPHelper.default.saveSync(this.
SEARCH_HISTORY_KEY
, JSON.stringify(this.searchHistoryData))
SPHelper.default.saveSync(this.
generationSearchKey()
, JSON.stringify(this.searchHistoryData))
}
/**
...
...
@@ -79,7 +79,7 @@ class SearcherAboutDataModel{
}
return this.searchHistoryData
}
let history = SPHelper.default.getSync(this.
SEARCH_HISTORY_KEY
,"[]") as string
let history = SPHelper.default.getSync(this.
generationSearchKey()
,"[]") as string
this.searchHistoryData = JSON.parse(history)
if(this.searchHistoryData.length>10){
...
...
@@ -91,6 +91,15 @@ class SearcherAboutDataModel{
return this.searchHistoryData
}
public generationSearchKey():string{
let userId = UserDataLocal.getUserId()
if(StringUtils.isEmpty(userId)){
return this.SEARCH_HISTORY_KEY + "_" + "0000111122223333"
}else{
return this.SEARCH_HISTORY_KEY + "_" + userId
}
}
/**
* 首页 搜索提示滚动内容
*/
...
...
sight_harmony/features/wdComponent/src/main/resources/base/media/search_hots_mark1.png
View file @
25c3397
902 Bytes
|
W:
|
H:
2.33 KB
|
W:
|
H:
2-up
Swipe
Onion skin
sight_harmony/features/wdComponent/src/main/resources/base/media/search_hots_mark2.png
View file @
25c3397
863 Bytes
|
W:
|
H:
2.04 KB
|
W:
|
H:
2-up
Swipe
Onion skin
sight_harmony/features/wdLogin/src/main/ets/pages/login/LoginViewModel.ets
View file @
25c3397
import { Logger } from 'wdKit/src/main/ets/utils/Logger'
import { LoginModel } from './LoginModel'
import { LoginBean } from './LoginBean'
import { SPHelper, StringUtils } from 'wdKit'
import { SPHelper, StringUtils
, UserDataLocal
} from 'wdKit'
import { CheckVerifyBean } from './CheckVerifyBean'
import cryptoFramework from '@ohos.security.cryptoFramework'
import buffer from '@ohos.buffer'
...
...
@@ -157,6 +157,7 @@ export class LoginViewModel {
SPHelper.default.saveSync(SpConstants.USER_STATUS, '')
SPHelper.default.saveSync(SpConstants.USER_Type, '')
SPHelper.default.saveSync(SpConstants.USER_NAME, '')
UserDataLocal.clearUserData()
success(data)
}).catch((message: string) => {
fail(message)
...
...
Please
register
or
login
to post a comment