liyubing

Merge remote-tracking branch 'origin/main'

Showing 28 changed files with 139 additions and 65 deletions
... ... @@ -17,6 +17,14 @@ export enum EmitterEventId {
// 关注,取消关注
PEOPLE_SHIP_ATTENTION = 7,
// 我的关注 为null
MY_FOLLOW_EMPTY = 8,
// 登录成功
LOGIN_SUCCESS = 8,
// 换绑成功
PHONE_CHANGE_SUCCESS = 9,
// App回到前台
APP_ENTER_FOREGROUD = 100,
... ...
... ... @@ -44,7 +44,7 @@ export struct CompParser {
@Builder
componentBuilder(compDTO: CompDTO, compIndex: number) {
// if (compDTO.operDataList[0]?.objectType !== '3' && compDTO.operDataList[0]?.objectType !== '13') { //暂时屏蔽活动和音频详情入口
if (compDTO.operDataList[0]?.objectType !== '3' && compDTO.operDataList[0]?.objectType !== '13') { //暂时屏蔽活动和音频详情入口
if (compDTO.compStyle === CompStyle.Label_03) {
LabelComponent({ compDTO: compDTO })
Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
... ... @@ -119,6 +119,6 @@ export struct CompParser {
}
}
// }
}
}
... ...
import { AccountManagerUtils, Logger, DateTimeUtils, SPHelper, NumberFormatterUtils } from 'wdKit';
import { AccountManagerUtils, Logger, DateTimeUtils, SPHelper, NumberFormatterUtils, DisplayUtils } from 'wdKit';
import { MultiPictureDetailViewModel } from '../viewmodel/MultiPictureDetailViewModel';
import { ContentDetailDTO,postBatchAttentionStatusParams,
PhotoListBean,
... ... @@ -83,7 +83,7 @@ export struct DynamicDetailComponent {
Image($r('app.media.ic_news_detail_division'))
.width('100%')
.height($r('app.float.margin_7'))
.margin({left: $r('app.float.margin_16'), right: $r('app.float.margin_16')} )
.padding({left: $r('app.float.margin_16'), right: $r('app.float.margin_16')} )
Stack({ alignContent: Alignment.Bottom }) {
Scroll(this.scroller) {
Column() {
... ... @@ -275,8 +275,8 @@ export struct DynamicDetailComponent {
Image(this.contentDetailData.fullColumnImgUrls!= null && this.contentDetailData.fullColumnImgUrls.length>0&&!StringUtils.isEmpty(this.contentDetailData.fullColumnImgUrls[0].url)?
this.contentDetailData.fullColumnImgUrls[0].url:
this.contentDetailData.videoInfo[0].firstFrameImageUri)
.width(CommonConstants.FULL_WIDTH)
.aspectRatio(16 / 9)
.width(DisplayUtils.getDeviceWidth()- 32)
.height((DisplayUtils.getDeviceWidth()-32)* 9 / 16)
.borderRadius($r('app.float.image_border_radius'))
CardMediaInfo({ contentDTO: this.mJumpInfo })
}
... ... @@ -291,7 +291,8 @@ export struct DynamicDetailComponent {
Image(this.contentDetailData.fullColumnImgUrls!= null && this.contentDetailData.fullColumnImgUrls.length>0&&!StringUtils.isEmpty(this.contentDetailData.fullColumnImgUrls[0].url)?
this.contentDetailData.fullColumnImgUrls[0].url:
this.contentDetailData.videoInfo[0].firstFrameImageUri)
.width(CommonConstants.FULL_WIDTH)
.width(DisplayUtils.getDeviceWidth()/2)
.height(DisplayUtils.getDeviceWidth()/2* 4 / 3)
.borderRadius($r('app.float.image_border_radius'))
CardMediaInfo({ contentDTO: this.mJumpInfo })
}
... ... @@ -299,7 +300,7 @@ export struct DynamicDetailComponent {
}
}
}
.margin({ left: $r('app.float.margin_16'),right: $r('app.float.margin_16'),top: $r('app.float.margin_8')})
.padding({ left: this.contentDetailData.videoInfo[0].videoLandScape === 1?0: 16,top: $r('app.float.margin_8')})
.onClick((event: ClickEvent) => {
ProcessUtils.processPage(this.mJumpInfo)
})
... ... @@ -362,7 +363,7 @@ export struct DynamicDetailComponent {
})
// 评论
if (this.contentDetailData?.openComment) {
Divider().strokeWidth(6).color('#f5f5f5')
Divider().strokeWidth(6).color('#f5f5f5').margin({top:$r('app.float.margin_24')})
CommentComponent({
publishCommentModel: {
targetId: String(this.contentDetailData?.newsId || ''),
... ...
import { ContentDTO, slideShows } from 'wdBean';
import { CommonConstants } from 'wdConstant'
import { DateTimeUtils } from 'wdKit';
import { CommonConstants } from 'wdConstant';
import { ProcessUtils } from 'wdRouter';
import { CardSourceInfo } from '../cardCommon/CardSourceInfo'
import { CardMediaInfo } from '../cardCommon/CardMediaInfo'
import { CardSourceInfo } from '../cardCommon/CardSourceInfo';
/**
* 大专题卡--CompStyle: 10
... ... @@ -25,6 +23,9 @@ export struct Card10Component {
.maxLines(2)
.textOverflow({ overflow: TextOverflow.Ellipsis })
.margin({ bottom: 19 })
.onClick((event: ClickEvent) => {
ProcessUtils.processPage(this.contentDTO)
})
}
// 大图
Stack() {
... ...
import { ContentDTO, slideShows } from 'wdBean';
import { CommonConstants } from 'wdConstant'
import { CommonConstants } from 'wdConstant';
import { DateTimeUtils } from 'wdKit';
import { ProcessUtils } from 'wdRouter';
... ... @@ -104,10 +104,12 @@ export struct Card9Component {
Column() {
Row() {
// 标题
Image($r("app.media.timeline_rect"))
Image($r("app.media.timeAxis"))
.width(9)
.height(9)
.margin({ right: 5 })
.fillColor(item.newsTitleColor)
Text(DateTimeUtils.formatDate(item.publishTime, "MM月dd日 HH:mm"))
.fontSize($r('app.float.font_size_12'))
.fontColor($r('app.color.color_222222'))
... ...
... ... @@ -19,7 +19,7 @@ export struct FollowChildComponent{
Row() {
Row(){
Stack({alignContent: Alignment.Bottom}){
Image(StringUtils.isEmpty(this.data.headPhotoUrl)?$r('app.media.default_head'):this.data.headPhotoUrl)
Image(StringUtils.isEmpty(this.data.headPhotoUrl)?$r('app.media.icon_default_head_mater'):this.data.headPhotoUrl)
.objectFit(ImageFit.Auto)
.width('92lpx')
.height('92lpx')
... ... @@ -128,7 +128,7 @@ export struct FollowChildComponent{
Row() {
Row(){
Stack({alignContent: Alignment.Bottom}){
Image(StringUtils.isEmpty(this.data.headPhotoUrl)?$r('app.media.default_head'):this.data.headPhotoUrl)
Image(StringUtils.isEmpty(this.data.headPhotoUrl)?$r('app.media.icon_default_head_mater'):this.data.headPhotoUrl)
.objectFit(ImageFit.Auto)
.width('92lpx')
.height('92lpx')
... ...
import { EmitterUtils, EmitterEventId, Logger } from 'wdKit/Index'
import MinePageDatasModel from '../../../model/MinePageDatasModel'
import { FollowListItem } from '../../../viewmodel/FollowListItem'
import { CustomTitleUI } from '../../reusable/CustomTitleUI'
... ... @@ -20,17 +21,27 @@ export struct FollowFirstTabsComponent{
})
if(this.controller != null && this.data.length>1 && this.changeIndex === 1){
this.jumpFollowNextPage()
}
}).catch((err:Error)=>{
console.log(TAG,JSON.stringify(err))
})
EmitterUtils.receiveEvent(EmitterEventId.MY_FOLLOW_EMPTY, (() => {
if(this.controller != null && this.data.length>1 ){
this.jumpFollowNextPage()
}
}))
}
jumpFollowNextPage(){
//个人主页 跳转 关注页 tab 2
let intervalID = setInterval(() => {
this.currentIndex = this.changeIndex
this.currentIndex = 1
this.controller.changeIndex(this.currentIndex)
clearInterval(intervalID);
}, 500);
}
}).catch((err:Error)=>{
console.log(TAG,JSON.stringify(err))
})
}
@Builder TabBuilder(index: number, item: FollowListItem) {
Stack(){
... ...
import { LazyDataSource, SPHelper, UserDataLocal } from 'wdKit';
import { EmitterEventId, EmitterUtils, LazyDataSource, SPHelper, UserDataLocal } from 'wdKit';
import MinePageDatasModel from '../../../model/MinePageDatasModel';
import SearcherAboutDataModel from '../../../model/SearcherAboutDataModel';
import { CreatorDetailRequestItem } from '../../../viewmodel/CreatorDetailRequestItem';
... ... @@ -70,7 +70,7 @@ export struct FollowListDetailUI {
Column() {
if (this.count === 0) {
if (this.isGetRequest == true) {
EmptyComponent({ emptyType: 14 })
EmptyComponent({ emptyType: 14,emptyHeight:"100%" })
.layoutWeight(1)
.width('100%')
}
... ... @@ -156,10 +156,12 @@ export struct FollowListDetailUI {
}
this.isLoading = false
this.isGetRequest = true
this.sendFollowMessage()
}).catch((err: Error) => {
console.log(TAG, "请求失败")
this.isGetRequest = true
this.isLoading = false
this.sendFollowMessage()
})
} else {
this.isLoading = false
... ... @@ -167,6 +169,12 @@ export struct FollowListDetailUI {
}
}
sendFollowMessage(){
if(this.count === 0){
EmitterUtils.sendEvent(EmitterEventId.MY_FOLLOW_EMPTY)
}
}
getNewPageData() {
//我的关注列表
if (this.creatorDirectoryId === -1) {
... ... @@ -179,6 +187,7 @@ export struct FollowListDetailUI {
if (!this.data || value.list.length == 0) {
this.hasMore = false
this.isLoading = false
this.isGetRequest = true
} else {
this.getFollowListStatus(value)
}
... ... @@ -226,6 +235,8 @@ export struct FollowListDetailUI {
})
})
this.getFollowStatus(data_temp, result.totalCount)
}else{
this.isGetRequest = true
}
}).catch((err: Error) => {
console.log(TAG, JSON.stringify(err))
... ...
... ... @@ -284,6 +284,7 @@ export struct HomePageBottomComponent{
if (!this.data_comment || value.list.length == 0){
this.hasMore = false
this.isLoading = false
this.isGetRequest = true
}else{
this.getCommentListStatus(value)
}
... ...
... ... @@ -101,6 +101,7 @@ export struct OtherHomePageBottomCommentComponent {
if (!this.data_comment || value.list.length == 0) {
this.hasMore = false
this.isLoading = false
this.isGetRequest = true
} else {
this.getCommentListStatus(value)
}
... ...
... ... @@ -449,7 +449,7 @@ struct ChannelDialog {
}.width('100%').height('100%')
.scrollBar(BarState.Off)
}
.padding({ top: 40, right: 15, bottom: 20, left: 15 })
.padding({ top: 40, right: 15, bottom: 40, left: 15 })
.backgroundColor('#ffffff')
}
}
... ... @@ -526,10 +526,9 @@ struct ChannelSubscriptionLayout {
.width(18)
}
.width(36)
.height(36)
.height(40)
.justifyContent(FlexAlign.Center)
.padding({ bottom: 6 })
.backgroundColor('#ffffff')
.backgroundColor(Color.White)
.onClick(() => {
if (this.dialogController != null) {
this.dialogController.open()
... ...
... ... @@ -5,12 +5,14 @@ import { RefreshConstants } from '../../utils/RefreshConstants'
*/
@Component
export default struct NoMoreLayout {
build() {
Row() {
Column() {
Text($r('app.string.footer_text'))
.margin({ left: RefreshConstants.NoMoreLayoutConstant_NORMAL_PADDING })
.fontSize(RefreshConstants.NoMoreLayoutConstant_TITLE_FONT)
.textAlign(TextAlign.Center)
.margin({bottom:40})
}
.width(RefreshConstants.FULL_WIDTH)
.justifyContent(FlexAlign.Center)
... ...
... ... @@ -64,6 +64,8 @@ export struct TopNavigationComponent {
@State indicatorLeftMargin: number = 0
@State indicatorWidth: number = 0
private tabsWidth: number = 0
//定时器延时处理切换至版面、播报tab时 返回上一个tab
@State tabTimmer: number = 0
topOrBottomNavChange() {
if (this.currentBottomNavName === this.currentBottomNavInfo?.name) {
... ... @@ -261,6 +263,9 @@ export struct TopNavigationComponent {
})
.animationDuration(this.animationDuration)
.onChange((index: number) => {
if(this.tabTimmer){
clearTimeout(this.tabTimmer)
}
this.currentTopNavName =
this._currentNavIndex === 0 ? this.myChannelList[index].name : this.topNavList[index].name
Logger.info(TAG, `onChange index : ${index}`);
... ... @@ -272,11 +277,15 @@ export struct TopNavigationComponent {
if (this.isBroadcast(this._currentNavIndex === 0 ? this.myChannelList[index] : this.topNavList[index])) {
// 跳转到播报页面
ProcessUtils.gotoBroadcastPage(this.myChannelList[index].pageId)
this.tabTimmer = setTimeout(() => {
this.tabsController.changeIndex(this.currentTopNavSelectedIndex)
}, 500)
}
if (this.isLayout(this._currentNavIndex === 0 ? this.myChannelList[index] : this.topNavList[index])) {
ProcessUtils.gotoENewsPaper()
this.tabTimmer = setTimeout(() => {
this.tabsController.changeIndex(this.currentTopNavSelectedIndex)
}, 500)
}
})
.onAnimationStart((index: number, targetIndex: number, event: TabsAnimationEvent) => {
... ...
... ... @@ -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 { Params } from 'wdBean';
import { AppUtils, StringUtils } from 'wdKit/Index';
import { WDRouterPage, WDRouterRule } from 'wdRouter';
import { CustomTitleUI } from '../reusable/CustomTitleUI';
import { EnvironmentCustomDialog } from './EnvironmentCustomDialog';
const TAG = 'AboutPageUI';
... ... @@ -23,11 +24,11 @@ export struct AboutPageUI {
})
build() {
Navigation() {
// Navigation() {
//滑动区域
this.aboutUi()
}.titleMode(NavigationTitleMode.Mini)
.title('关于')
// }.titleMode(NavigationTitleMode.Mini)
// .title('关于')
}
aboutToAppear() {
... ... @@ -42,6 +43,8 @@ export struct AboutPageUI {
@Builder
aboutUi() {
Column() {
CustomTitleUI({titleName:'关于'})
Image($r('app.media.setting_about_logo'))
.width('278lpx')
.height('154lpx')
... ...
... ... @@ -76,7 +76,7 @@ export struct AccountAndSecurityLayout {
addEmitEvent(){
// 定义一个eventId为1的事件
let event: emitter.InnerEvent = {
eventId: 10010
eventId: EmitterEventId.PHONE_CHANGE_SUCCESS
};
// 收到eventId为1的事件后执行该回调
... ...
... ... @@ -197,7 +197,7 @@ export struct EmptyComponent {
} else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoNetwork) {
contentString = '网络出小差了,请检查网络后重试'
} else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_ContentFailed) {
contentString = '获取内容失败请重试'
contentString = '获取内容失败请重试'
} else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoCreation) {
contentString = '暂无作品'
} else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoBooking) {
... ...
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
}
}
/**
* 首页 搜索提示滚动内容
*/
... ...
... ... @@ -34,7 +34,7 @@ export class RefreshConstants {
/**
* The refresh and load height.
*/
static readonly CUSTOM_LAYOUT_HEIGHT: number = 90;
static readonly CUSTOM_LAYOUT_HEIGHT: number = 80;
/**
* Full the width.
*/
... ...
... ... @@ -54,7 +54,7 @@ export class PageHelper {
PageViewModel.getPageInfo(pageModel.pageId).then(pageInfo => {
if (pageInfo == null) {
pageModel.viewType = ViewType.EMPTY;
pageModel.emptyType = WDViewDefaultType.WDViewDefaultType_NoListContent;
pageModel.emptyType = WDViewDefaultType.WDViewDefaultType_NoContent1;
return;
}
pageModel.pageInfo = pageInfo;
... ... @@ -96,7 +96,7 @@ export class PageHelper {
// 没数据,展示空页面
Logger.debug(TAG, 'aboutToAppear, data response page ' + pageModel.pageId + ', comp list is empty.');
pageModel.viewType = ViewType.EMPTY;
pageModel.emptyType = WDViewDefaultType.WDViewDefaultType_NoListContent;
pageModel.emptyType = WDViewDefaultType.WDViewDefaultType_NoContent1;
}
}
... ... @@ -312,7 +312,7 @@ export class PageHelper {
this.collectPageComp(pageModel, data)
//
// pageModel.compList.push(...data.compList)
PageViewModel.getInteractData(pageModel.compList.getDataArray()).then((data: CompDTO[]) => {
PageViewModel.getInteractData(data.compList).then((data: CompDTO[]) => {
// 刷新,替换所有数据
pageModel.compList.updateItems(sizeBefore, data)
pageModel.timestamp = DateTimeUtils.getTimeStamp().toString()
... ...
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="none" version="1.1" width="9" height="6" viewBox="0 0 9 6"><g><g><path d="M2.63066,0.5L7.79156,0.5C8.13703,0.5,8.3784,0.8420000000000001,8.26266,1.167505L6.84044,5.1675C6.76957,5.36684,6.5809,5.5,6.36934,5.5L1.208442,5.5C0.862974,5.5,0.6216,5.158,0.737335,4.8325L2.15956,0.832495C2.23043,0.633155,2.4191000000000003,0.5,2.63066,0.5" fill-rule="evenodd" fill="#ED2800" fill-opacity="1"/></g></g></svg>
\ No newline at end of file
... ...
... ... @@ -58,10 +58,10 @@ export struct TabLiveComponent {
// 加载更多
ListItem() {
if (this.pageModel.hasMore) {
LoadMoreLayout({
refreshBean: new RefreshLayoutBean(this.pageModel.isVisiblePullUpLoad, this.pageModel.pullUpLoadImage,
this.pageModel.pullUpLoadText, this.pageModel.pullUpLoadHeight)
})
// LoadMoreLayout({
// refreshBean: new RefreshLayoutBean(this.pageModel.isVisiblePullUpLoad, this.pageModel.pullUpLoadImage,
// this.pageModel.pullUpLoadText, this.pageModel.pullUpLoadHeight)
// })
} else {
ListHasNoMoreDataUI()
}
... ... @@ -89,7 +89,7 @@ export struct TabLiveComponent {
if (data.barrageResponses && data.barrageResponses.length > 0) {
/**
* 在直播聊天添加一条新内容逻辑:
判断 oldNewsId:迁移id空 且 直播状态不是预约:"wait"
判断 oldNewsId:迁移id空 且 直播状态不是预约:"wait"
消息内容:
1.头像固定:APP默认头像
2.名称固定:人民日报主持人
... ... @@ -105,6 +105,25 @@ export struct TabLiveComponent {
if (StringUtils.isEmpty(this.liveDetailsBean.oldNewsId)
&& this.liveDetailsBean
&& this.liveDetailsBean.liveInfo.liveState != 'wait') {
this.updateLiveListData()
}
}
} else {
if (StringUtils.isEmpty(this.liveDetailsBean.oldNewsId)
&& this.liveDetailsBean
&& this.liveDetailsBean.liveInfo.liveState != 'wait') {
this.updateLiveListData()
} else {
this.pageModel.viewType = ViewType.EMPTY;
}
}
},
() => {
})
}
updateLiveListData() {
let liveRoomItemBeanTemp: LiveRoomItemBean = {} as LiveRoomItemBean
liveRoomItemBeanTemp.text = this.liveDetailsBean.newIntroduction
liveRoomItemBeanTemp.senderUserName = '人民日报主持人'
... ... @@ -118,15 +137,6 @@ export struct TabLiveComponent {
}
this.liveList.push(liveRoomItemBeanTemp)
}
}
} else {
this.pageModel.viewType = ViewType.EMPTY;
}
},
() => {
})
}
aboutToDisappear(): void {
}
... ...
... ... @@ -7,7 +7,7 @@ import { Params } from '../../../../../../../commons/wdRouter/oh_modules/wdBean/
import { WDRouterRule, WDRouterPage } from 'wdRouter';
import { SettingPasswordParams } from './SettingPasswordLayout'
import { Router } from '@ohos.arkui.UIContext'
import { SPHelper, ToastUtils } from 'wdKit/Index'
import { EmitterEventId, EmitterUtils, SPHelper, ToastUtils } from 'wdKit/Index'
import { SpConstants } from 'wdConstant/Index'
import { emitter } from '@kit.BasicServicesKit'
... ... @@ -189,7 +189,7 @@ struct ForgetPasswordPage {
sendEmitEvent(){
// 定义一个eventId为1的事件,事件优先级为Low
let event: emitter.InnerEvent = {
eventId: 10010,
eventId: EmitterEventId.PHONE_CHANGE_SUCCESS,
priority: emitter.EventPriority.LOW
};
... ...
import { Logger } from 'wdKit/src/main/ets/utils/Logger'
import { LoginModel } from './LoginModel'
import { LoginBean } from './LoginBean'
import { SPHelper, StringUtils } from 'wdKit'
import { EmitterEventId, EmitterUtils, SPHelper, StringUtils, UserDataLocal } from 'wdKit'
import { CheckVerifyBean } from './CheckVerifyBean'
import cryptoFramework from '@ohos.security.cryptoFramework'
import buffer from '@ohos.buffer'
... ... @@ -55,6 +55,7 @@ export class LoginViewModel {
SPHelper.default.saveSync(SpConstants.USER_STATUS, data.status)
SPHelper.default.saveSync(SpConstants.USER_Type, data.userType)
SPHelper.default.saveSync(SpConstants.USER_NAME, data.userName)
EmitterUtils.sendEmptyEvent(EmitterEventId.LOGIN_SUCCESS)
success(data)
}).catch((error:string) => {
fail(error)
... ... @@ -82,6 +83,7 @@ export class LoginViewModel {
SPHelper.default.saveSync(SpConstants.USER_STATUS, data.status)
SPHelper.default.saveSync(SpConstants.USER_Type, data.userType)
SPHelper.default.saveSync(SpConstants.USER_NAME, data.userName)
EmitterUtils.sendEmptyEvent(EmitterEventId.LOGIN_SUCCESS)
success(data)
}).catch((value: string) => {
fail(value)
... ... @@ -157,6 +159,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)
... ...