张善主

Merge remote-tracking branch 'origin/main'

... ... @@ -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()
}
}
}
... ...
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%')
}
... ...
... ... @@ -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()
}
}
}
... ...
... ... @@ -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')
... ...
@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
... ...
... ... @@ -34,6 +34,8 @@ export struct SearchComponent {
aboutToAppear() {
//获取提示滚动
this.getSearchHint()
//清除缓存
SearcherAboutDataModel.searchHistoryData = []
//获取搜索历史
this.getSearchHistoryData()
}
... ...
... ... @@ -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')
... ...
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
}
}
/**
* 首页 搜索提示滚动内容
*/
... ...
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)
... ...