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-06-14 16:22:19 +0800
Browse Files
Options
Browse Files
Download
Plain Diff
Commit
024de000b82cbe3b686f5dff0df0d51cc5941ca4
024de000
2 parents
7016b93c
90ab9abb
Merge remote-tracking branch 'origin/main'
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
120 additions
and
51 deletions
sight_harmony/features/wdComponent/src/main/ets/components/mine/MinePageUserSimpleInfoUI.ets
sight_harmony/features/wdComponent/src/main/ets/components/page/EditUserInfoPage.ets
sight_harmony/features/wdComponent/src/main/ets/components/page/TopNavigationComponentNew.ets
sight_harmony/features/wdComponent/src/main/ets/components/view/areaPickerDialog/AreaPickerDialog.ets
sight_harmony/features/wdComponent/src/main/ets/components/view/areaPickerDialog/SecondLevelComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/view/areaPickerDialog/ThirdLevelComponent.ets
sight_harmony/features/wdComponent/src/main/ets/model/AreaListModel.ets
sight_harmony/features/wdComponent/src/main/ets/utils/InsightIntentShare.ets
sight_harmony/features/wdComponent/src/main/ets/viewmodel/EditInfoViewModel.ets
sight_harmony/features/wdComponent/src/main/resources/base/media/like_default_status.png
sight_harmony/features/wdComponent/src/main/resources/base/media/liked_status.png
sight_harmony/features/wdLogin/src/main/ets/pages/login/LoginViewModel.ets
sight_harmony/features/wdComponent/src/main/ets/components/mine/MinePageUserSimpleInfoUI.ets
View file @
024de00
import { StringUtils, UserDataLocal } from 'wdKit'
import { SpConstants } from 'wdConstant/Index'
import { SPHelper, StringUtils, UserDataLocal } from 'wdKit'
import { WDRouterPage, WDRouterRule } from 'wdRouter'
import { TrackingButton, TrackConstants } from 'wdTracking/Index'
import MinePageDatasModel from '../../model/MinePageDatasModel'
...
...
@@ -8,7 +9,7 @@ const TAG = "MinePageUserSimpleInfoUI"
@Component
export default struct MinePageUserSimpleInfoUI {
@Watch('loginStateChange') @Prop isLogin :boolean
@State userName:string = "登
陆
注册"
@State userName:string = "登
录
注册"
@State headPhotoUrl:string = ""
userType:string = "1"
@State levelHead:string = ""
...
...
@@ -17,6 +18,10 @@ 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.getUserInfo()
}else{
this.headPhotoUrl = ""
...
...
@@ -57,7 +62,7 @@ export default struct MinePageUserSimpleInfoUI {
Text(this.userName)
.fontColor($r('app.color.color_222222'))
.maxLines(1)
.fontWeight(FontWeight.
Bold
)
.fontWeight(FontWeight.
Medium
)
.textOverflow({ overflow: TextOverflow.Ellipsis })
.fontSize(`${this.calcHeight(33)}lpx`)
.lineHeight(`${this.calcHeight(46)}lpx`)
...
...
@@ -74,6 +79,7 @@ export default struct MinePageUserSimpleInfoUI {
trackButtonClick("myPageUserName")
})
if (this.levelId !== 0){
Stack(){
Image($r('app.media.mine_grade_bg'))
.width(`${this.calcHeight(84)}lpx`)
...
...
@@ -86,6 +92,7 @@ export default struct MinePageUserSimpleInfoUI {
.width(this.levelId>9?`${this.calcHeight(69)}lpx`:`${this.calcHeight(50)}lpx`)
.height(`${this.calcHeight(29)}lpx`)
}.margin({top:'`${this.calcHeight(15)}lpx`'})
}
}.alignItems(HorizontalAlign.Start)
.margin({top:`${this.calcHeight(12)}lpx`,left:`${this.calcHeight(23)}lpx`})
.width(`${this.calcHeight(352)}lpx`)
...
...
sight_harmony/features/wdComponent/src/main/ets/components/page/EditUserInfoPage.ets
View file @
024de00
...
...
@@ -6,7 +6,7 @@ import { WDRouterPage, WDRouterRule } from 'wdRouter';
import {AreaPickerDialog} from '../view/areaPickerDialog/AreaPickerDialog'
import {EditUserInfoCustomDialog} from '../view/areaPickerDialog/EditUserInfoCustomDialog'
import {EditUserSexCustomDialog} from '../view/areaPickerDialog/EditUserSexCustomDialog'
import { AreaListModel } from '../../model/AreaListModel';
import { AreaListM
anageModel, AreaListM
odel } from '../../model/AreaListModel';
import router from '@ohos.router';
import TrackingPageBrowseUtils from '../../utils/TrackingPageBrowseUtils'
import { TrackConstants } from 'wdTracking/Index';
...
...
@@ -22,8 +22,12 @@ struct EditUserInfoPage {
@State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0
@State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0
@State firstSelect:number = 0
@State secondSelect:number = 0
@State thirdSelect:number = 0
dialogController: CustomDialogController = new CustomDialogController({
builder: AreaPickerDialog({dataSource:this.dataSource,
builder: AreaPickerDialog({dataSource:this.dataSource,
firstSelect:this.firstSelect,secondSelect:this.secondSelect,thirdSelect:this.thirdSelect,
confirmCallback:(province:string,city:string,county:string,address:string)=>{
this.currentUserInfo.userExtend.province = province;
this.currentUserInfo.userExtend.city = city;
...
...
@@ -31,6 +35,7 @@ struct EditUserInfoPage {
this.currentUserInfo.userExtend.address = address;
this.currentUserInfo.editDataType = WDEditDataModelType.WDEditDataModelType_region
this.updateEditModel()
this.getAreaIndex()
}
}),
alignment: DialogAlignment.Bottom,
...
...
@@ -232,6 +237,30 @@ struct EditUserInfoPage {
getAreaList(){
EditInfoViewModel.getAreaList(getContext(this)).then((value) =>{
this.dataSource.push(...value)
this.getAreaIndex()
})
}
getAreaIndex(){
///地区选择器当前位置
if (this.currentUserInfo.userExtend.province.length > 0) {
this.dataSource.forEach((element,index) => {
if (element.label === this.currentUserInfo.userExtend.province) {
this.firstSelect = index
let currentFirst = EditInfoViewModel.getAreaListManageModel(element)
currentFirst.children.forEach((element,index) => {
if (element.label === this.currentUserInfo.userExtend.city) {
this.secondSelect = index
let currentSecondBean = EditInfoViewModel.getAreaListManageModel(element)
currentSecondBean.children.forEach((element,index) => {
if (element.label === this.currentUserInfo.userExtend.county) {
this.thirdSelect = index
}
});
}
});
}
});
}
}
}
...
...
sight_harmony/features/wdComponent/src/main/ets/components/page/TopNavigationComponentNew.ets
View file @
024de00
...
...
@@ -202,10 +202,6 @@ export struct TopNavigationComponentNew {
//防止多次点击
if (!this.isClickMorningEveningPaper) {
this.isClickMorningEveningPaper = true;
let c = setInterval(() => {
this.isClickMorningEveningPaper = false
}, 1000);
this.clickMorningEveningPaper()
}
})
...
...
@@ -705,11 +701,15 @@ export struct TopNavigationComponentNew {
} else {
ToastUtils.showToast('暂无早晚报信息', 1000)
}
this.isClickMorningEveningPaper = false
}).catch((err: string) => {
ToastUtils.showToast('暂无早晚报信息', 1000)
this.isClickMorningEveningPaper = false
})
} else {
ToastUtils.showToast('网络出小差了,请检查网络后重试', 1000)
this.isClickMorningEveningPaper = false
}
}
...
...
sight_harmony/features/wdComponent/src/main/ets/components/view/areaPickerDialog/AreaPickerDialog.ets
View file @
024de00
...
...
@@ -12,6 +12,11 @@ export struct AreaPickerDialog {
title: string = '修改地区'
@Provide dataSource: AreaListModel[] = []
result: JSON[] = [];
firstSelect:number = 0
secondSelect:number = 0
thirdSelect:number = 0
confirmCallback: (province:string,city:string,county:string,address:string) => void = () => {
}
...
...
@@ -52,9 +57,9 @@ export struct AreaPickerDialog {
.strokeWidth(1)
Row(){
FirstLevelComponent().width('33%')
SecondLevelComponent().width('33%')
ThirdLevelComponent().width('33%')
FirstLevelComponent({select:this.firstSelect}).width('33%')
SecondLevelComponent({currentSelect:this.secondSelect}).width('33%')
ThirdLevelComponent({currentSelect:this.thirdSelect}).width('33%')
}
}
.backgroundColor(0xffffff)
...
...
sight_harmony/features/wdComponent/src/main/ets/components/view/areaPickerDialog/SecondLevelComponent.ets
View file @
024de00
...
...
@@ -7,7 +7,7 @@ export struct SecondLevelComponent {
@State select: number = 0;
@Consume @Watch('onFirstChange') currentFirst: AreaListManageModel;
@Consume currentSecondBean: AreaListManageModel
currentSelect:number = 0
build() {
Column(){
Column(){
...
...
@@ -35,7 +35,13 @@ export struct SecondLevelComponent {
}
onFirstChange(){
if (this.currentSelect > 0){
this.select = this.currentSelect
this.currentSelect = 0
}else {
this.select = 0
}
if (!this.currentFirst) {
this.mTip = '暂无数据';
} else {
...
...
sight_harmony/features/wdComponent/src/main/ets/components/view/areaPickerDialog/ThirdLevelComponent.ets
View file @
024de00
...
...
@@ -8,7 +8,7 @@ export struct ThirdLevelComponent {
@Consume @Watch('onFirstChange') currentFirst: AreaListManageModel;
@Consume @Watch('onSecondChange') currentSecondBean: AreaListManageModel;
@Consume currentThirdBean: AreaListManageModel
currentSelect:number = 0
build() {
Column(){
Column(){
...
...
@@ -36,11 +36,21 @@ export struct ThirdLevelComponent {
}
onFirstChange(){
this.select = 0
// if (this.currentSelect > 0){
// this.select = this.currentSelect
// this.currentSelect = 0
// }else {
// this.select = 0
// }
}
onSecondChange(){
if (this.currentSelect > 0){
this.select = this.currentSelect
this.currentSelect = 0
}else {
this.select = 0
}
if (!this.currentSecondBean) {
this.mTip = '暂无数据';
} else {
...
...
sight_harmony/features/wdComponent/src/main/ets/model/AreaListModel.ets
View file @
024de00
export interface AreaListData{
success: boolean;
code: number;
message: string;
data: AreaListModel[];
timestamp?: number;
}
export interface AreaListModel{
...
...
sight_harmony/features/wdComponent/src/main/ets/utils/InsightIntentShare.ets
View file @
024de00
...
...
@@ -27,8 +27,9 @@ export function viewBlogInsightIntentShare(context: common.UIAbilityContext, ent
let insightIntentArray: insightIntent.InsightIntent [] = []
let identifier = generateUUID()
if (compList?.length > 0) {
compList?.forEach((item: CompDTO | CompList) => {
item.operDataList.forEach((_item: ContentDTO) => {
compList?.forEach((comp: CompDTO | CompList) => {
comp.operDataList.forEach((item: ContentDTO) => {
console.log('zzzz',JSON.stringify(item))
let viewBlogInsightIntentItem: insightIntent.InsightIntent = {
intentName: 'ViewBlog',
intentVersion: '1.0.1',
...
...
@@ -43,25 +44,26 @@ export function viewBlogInsightIntentShare(context: common.UIAbilityContext, ent
},
intentEntityInfo: {
entityName: 'Blog',
entityId: _item?.objectId,
displayName: _item?.newsTitle,
entityId: item?.objectId || '',//必传
displayName: item?.newsTitle || '', //必传
entityGroupId, //channelId
logoURL: _item?.coverUrl,
metadataModificationTime: _item?.publishTimestamp,
blogTitle: _item?.newsTitle,
logoURL: item?.coverUrl,
metadataModificationTime: Number(item?.publishTime) || 0,//int
blogTitle: item?.newsTitle,
blogType: 'Normal',
blogCategory: item.name,
categoryDisplayName: item.name,
blogSubTitle: _item?.newsSummary.length > 20 ?
_item?.newsSummary.substring(0, 20) : _item?.newsSummary,
blogAuthor: _item?.source,
blogPublishTime: _item?.publishTimestamp,
tag: _item?.newTags.split(','),
likeCount: _item?.interactData?.likeNum || 0,
forwardCount: _item?.interactData?.shareNum || 0,
commentCount: _item?.interactData?.commentNum || 0,
favorites: _item?.interactData?.collectNum || 0,
viewCount: _item?.interactData?.readNum || 0,
blogCategory: entityGroupId === '2001' ? '推荐' : '热点',
categoryDisplayName: item.newsTitle,//卡片上的主标题
description: item?.newsSummary || '',//必传
blogSubTitle: item?.newsSummary.length > 20 ?
item?.newsSummary.substring(0, 20) : item?.newsSummary,
blogAuthor: item?.source,
blogPublishTime: item?.publishTime,//string
tag: item?.newTags.split(','),
likeCount: item?.interactData?.likeNum || 0,
forwardCount: item?.interactData?.shareNum || 0,
commentCount: item?.interactData?.commentNum || 0,
favorites: item?.interactData?.collectNum || 0,
viewCount: item?.interactData?.readNum || 0,
rankingHint: 99
}
}
...
...
@@ -84,6 +86,7 @@ export function viewBlogInsightIntentShare(context: common.UIAbilityContext, ent
export function viewBlogItemInsightIntentShare(context: common.UIAbilityContext, item: ContentDetailDTO,
interactData?: InteractDataDTO) {
let identifier = generateUUID()
console.log('zzzz',JSON.stringify(item))
let viewBlogInsightIntentItem: insightIntent.InsightIntent = {
intentName: 'ViewBlog',
intentVersion: '1.0.1',
...
...
@@ -93,19 +96,20 @@ export function viewBlogItemInsightIntentShare(context: common.UIAbilityContext,
},
intentEntityInfo: {
entityName: 'Blog',
entityId: String(item?.newsId),
displayName: item?.newsTitle,
entityId: String(item?.newsId) || '',
displayName: item?.newsTitle || '',
entityGroupId: String(item?.reLInfo?.channelId), //channelId
logoURL: item.fullColumnImgUrls.length > 0 ? item.fullColumnImgUrls[0]?.url : item.firstFrameImageUri,
metadataModificationTime:
item?.publishTime
,
metadataModificationTime:
new Date(item.publishTime).getTime() || 0
,
blogTitle: item?.newsTitle,
blogType: 'Normal',
blogCategory: item,
categoryDisplayName: '', //TODO 分类名称
blogCategory: item?.reLInfo?.channelId === 2001 ? '推荐' : '热点',
categoryDisplayName: item.newsTitle || '',
blogSubTitle: item?.newsSummary.length > 20 ?
item?.newsSummary.substring(0, 20) : item?.newsSummary,
description: item?.newsSummary || '',//必传
blogAuthor: item?.newsSourceName,
blogPublishTime:
item?.publishTime
,
blogPublishTime:
`${new Date(item.publishTime).getTime()}` || ''
,
tag: item?.newsTags.split(','),
viewCount: item?.viewCount || 0,
likeCount: interactData?.likeNum || 0,
...
...
sight_harmony/features/wdComponent/src/main/ets/viewmodel/EditInfoViewModel.ets
View file @
024de00
...
...
@@ -4,7 +4,7 @@ import {
EditListInfo, editModel, editModelParams, WDEditDataModelType } from '../model/EditInfoModel';
import { HttpUrlUtils, ResponseDTO, WDHttp } from 'wdNetwork';
import { Logger, ResourcesUtils } from 'wdKit';
import { AreaListManageModel, AreaListModel } from '../model/AreaListModel';
import { AreaListManageModel, AreaListModel
,AreaListData
} from '../model/AreaListModel';
import promptAction from '@ohos.promptAction';
const TAG = "EditInfoViewModel"
...
...
@@ -74,17 +74,16 @@ class EditInfoViewModel {
getAreaList(context: Context):PromiseLike<AreaListModel[]>{
return new Promise((success, error) => {
WDHttp.get<AreaListData>(HttpUrlUtils.getHost() + HttpUrlUtils.APPOINTMENT_userArea_PATH).then((navResDTO: AreaListData) => {
if (navResDTO.code == 0) {
success(navResDTO.data)
}else {
success(this.getAreaListLocal(context))
}
}).catch((error: Error) => {
Logger.info(TAG,'executeCollcet','ResponseDTO')
success(this.getAreaListLocal(context))
// HttpRequest.post(HttpUrlUtils.APPOINTMENT_AccountOwner_PATH).then((navResDTO:ResponseDTO) =>{
// if (navResDTO.code == 200) {
// // let editM = navResDTO.data as EditInfoModel
// // success(JSON.parse(navResDTO.data)
// }
// }).catch((error: Error) => {
// Logger.info(TAG,'getAreaList','EditInfoViewModel')
// success(this.getAreaListLocal(context))
//
// })
})
})
}
...
...
sight_harmony/features/wdComponent/src/main/resources/base/media/like_default_status.png
View file @
024de00
533 Bytes
|
W:
|
H:
1.04 KB
|
W:
|
H:
2-up
Swipe
Onion skin
sight_harmony/features/wdComponent/src/main/resources/base/media/liked_status.png
View file @
024de00
403 Bytes
|
W:
|
H:
816 Bytes
|
W:
|
H:
2-up
Swipe
Onion skin
sight_harmony/features/wdLogin/src/main/ets/pages/login/LoginViewModel.ets
View file @
024de00
...
...
@@ -246,6 +246,8 @@ export class LoginViewModel {
}
if(data.userExtend.headPhotoUrl!=undefined){
SPHelper.default.saveSync(SpConstants.USER_HEAD_PHOTO_URL, data.userExtend.headPhotoUrl)
}else {
SPHelper.default.deleteSync(SpConstants.USER_HEAD_PHOTO_URL)
}
if(data.userExtend.birthday!=undefined){
SPHelper.default.saveSync(SpConstants.USER_BIRTHDAY, data.userExtend.birthday)
...
...
Please
register
or
login
to post a comment