张善主

Merge remote-tracking branch 'origin/main'

@@ -10,6 +10,10 @@ export class SpConstants{ @@ -10,6 +10,10 @@ export class SpConstants{
10 static USER_STATUS="user_status" 10 static USER_STATUS="user_status"
11 static USER_TEMP_TOKEN="tempToken" 11 static USER_TEMP_TOKEN="tempToken"
12 static USER_PHONE = "user_phone" 12 static USER_PHONE = "user_phone"
  13 + static USER_CREATOR_ID = "creatorId"
  14 + static USER_HEAD_PHOTO_URL = "headPhotoUrl"
  15 + static USER_SEX = "sex"
  16 + static USER_BIRTHDAY = "birthday"
13 //协议相关 17 //协议相关
14 static NET_SERVICE_PROTOCOL = "user_protocol" //人民日报客户端网络服务使用协议 18 static NET_SERVICE_PROTOCOL = "user_protocol" //人民日报客户端网络服务使用协议
15 static PRIVATE_PROTOCOL = "private_protocol" //人民日报客户端用户隐私协议 19 static PRIVATE_PROTOCOL = "private_protocol" //人民日报客户端用户隐私协议
1 -import { Action, ContentDTO, Params, PhotoListBean } from 'wdBean'; 1 +import { Action, ContentDTO, Params, PhotoListBean, commentInfo } from 'wdBean';
2 import { ExtraDTO } from 'wdBean/src/main/ets/bean/component/extra/ExtraDTO'; 2 import { ExtraDTO } from 'wdBean/src/main/ets/bean/component/extra/ExtraDTO';
3 import { Logger } from 'wdKit'; 3 import { Logger } from 'wdKit';
4 import { StringUtils } from 'wdKit/src/main/ets/utils/StringUtils'; 4 import { StringUtils } from 'wdKit/src/main/ets/utils/StringUtils';
@@ -133,6 +133,24 @@ export class ProcessUtils { @@ -133,6 +133,24 @@ export class ProcessUtils {
133 Logger.debug(TAG, `gotoWeb, ${content.objectId}`); 133 Logger.debug(TAG, `gotoWeb, ${content.objectId}`);
134 } 134 }
135 135
  136 + static commentGotoWeb(content: commentInfo) {
  137 + let taskAction: Action = {
  138 + type: 'JUMP_INNER_NEW_PAGE',
  139 + params: {
  140 + contentID: content?.newsId,
  141 + pageID: 'IMAGE_TEXT_DETAIL',
  142 + extra: {
  143 + relType: content?.relType,
  144 + relId: content?.relId,
  145 + sourcePage: '5',
  146 + commentId: content?.commentId
  147 + } as ExtraDTO
  148 + } as Params,
  149 + };
  150 + WDRouterRule.jumpWithAction(taskAction)
  151 + Logger.debug(TAG, `commentGotoWeb, ${content.newsId}`);
  152 + }
  153 +
136 private static gotoWeb(content: ContentDTO) { 154 private static gotoWeb(content: ContentDTO) {
137 let taskAction: Action = { 155 let taskAction: Action = {
138 type: 'JUMP_INNER_NEW_PAGE', 156 type: 'JUMP_INNER_NEW_PAGE',
@@ -143,7 +161,8 @@ export class ProcessUtils { @@ -143,7 +161,8 @@ export class ProcessUtils {
143 relType: content?.relType, 161 relType: content?.relType,
144 relId: content?.relId, 162 relId: content?.relId,
145 channelId: content?.channelId, 163 channelId: content?.channelId,
146 - sourcePage: '5' 164 + sourcePage: '5',
  165 + commentId: content?.commentInfo?.commentId
147 } as ExtraDTO 166 } as ExtraDTO
148 } as Params, 167 } as Params,
149 }; 168 };
@@ -15,6 +15,8 @@ export { ItemBean } from './src/main/ets/bean/ItemBean'; @@ -15,6 +15,8 @@ export { ItemBean } from './src/main/ets/bean/ItemBean';
15 // Content 15 // Content
16 export { ContentDTO } from './src/main/ets/bean/content/ContentDTO'; 16 export { ContentDTO } from './src/main/ets/bean/content/ContentDTO';
17 17
  18 +export { commentInfo } from './src/main/ets/bean/content/commentInfo';
  19 +
18 export { AudioDTO } from './src/main/ets/bean/content/AudioDTO'; 20 export { AudioDTO } from './src/main/ets/bean/content/AudioDTO';
19 21
20 export { Action } from './src/main/ets/bean/content/Action' 22 export { Action } from './src/main/ets/bean/content/Action'
@@ -146,3 +148,8 @@ export { @@ -146,3 +148,8 @@ export {
146 InfluenceData 148 InfluenceData
147 } from './src/main/ets/bean/peoples/PeopleShipUserDetailData'; 149 } from './src/main/ets/bean/peoples/PeopleShipUserDetailData';
148 150
  151 +export {
  152 + UserDetail,
  153 + UserExtend
  154 +} from './src/main/ets/bean/user/UserDetail';
  155 +
@@ -15,4 +15,5 @@ export interface ExtraDTO extends ItemDTO { @@ -15,4 +15,5 @@ export interface ExtraDTO extends ItemDTO {
15 relType: string; 15 relType: string;
16 liveStreamType?: number; 16 liveStreamType?: number;
17 photoList: PhotoListBean[]; 17 photoList: PhotoListBean[];
  18 + commentId?: string;
18 } 19 }
@@ -3,5 +3,9 @@ export interface commentInfo { @@ -3,5 +3,9 @@ export interface commentInfo {
3 newsTitle: string, 3 newsTitle: string,
4 userName: string, 4 userName: string,
5 userHeaderUrl: string, 5 userHeaderUrl: string,
6 - publishTime: number 6 + publishTime: number,
  7 + commentId: string,
  8 + newsId: string,
  9 + relId: string;
  10 + relType: string;
7 } 11 }
  1 +export interface UserDetail{
  2 + createTime:string
  3 + headPhotoStatus:number
  4 + id:number
  5 + modifyNumber:number
  6 + phone:string
  7 + status:number
  8 + tenancy:number
  9 + userNameStatus:number
  10 + userType:number
  11 + userName:string
  12 + userExtend:UserExtend
  13 +}
  14 +
  15 + export interface UserExtend{
  16 + airec:number
  17 + deviceId:string
  18 + lastLoginTime:string
  19 + sex:number
  20 + address:string
  21 + birthday:string
  22 + city:string
  23 + county:string
  24 + headPhotoUrl:string
  25 + introduction:string
  26 + province:string
  27 + sign:string
  28 + creatorId:string
  29 +}
  30 +
@@ -12,7 +12,7 @@ export struct MultiPictureDetailItemComponent { @@ -12,7 +12,7 @@ export struct MultiPictureDetailItemComponent {
12 12
13 13
14 async aboutToAppear() { 14 async aboutToAppear() {
15 - Logger.info(TAG, 'pictures preview') 15 + // Logger.info(TAG, 'pictures preview')
16 } 16 }
17 17
18 build() { 18 build() {
1 -import { Logger, SPHelper } from 'wdKit'; 1 +import {
  2 + NetworkUtil,
  3 + Logger,
  4 + NetworkType,
  5 + SPHelper,
  6 +} from 'wdKit';
2 import { ResponseDTO } from 'wdNetwork'; 7 import { ResponseDTO } from 'wdNetwork';
3 import { 8 import {
4 ContentDetailDTO, 9 ContentDetailDTO,
@@ -61,7 +66,15 @@ export struct MultiPictureDetailPageComponent { @@ -61,7 +66,15 @@ export struct MultiPictureDetailPageComponent {
61 familyName: 'BebasNeue_Regular', 66 familyName: 'BebasNeue_Regular',
62 familySrc: $rawfile('font/BebasNeue_Regular.otf') 67 familySrc: $rawfile('font/BebasNeue_Regular.otf')
63 }) 68 })
  69 + // 注册监听网络连接
  70 + let netStatus = NetworkUtil.isNetConnected()
  71 + if(netStatus) {
  72 + // 有网络
64 this.getContentDetailData() 73 this.getContentDetailData()
  74 + } else {
  75 + // 无网络
  76 + this.netStatus = 1
  77 + }
65 } 78 }
66 79
67 aboutToDisappear() { 80 aboutToDisappear() {
@@ -73,7 +86,7 @@ export struct MultiPictureDetailPageComponent { @@ -73,7 +86,7 @@ export struct MultiPictureDetailPageComponent {
73 if (this.contentDetailData?.photoList && this.contentDetailData?.photoList?.length > 0) { 86 if (this.contentDetailData?.photoList && this.contentDetailData?.photoList?.length > 0) {
74 Swiper(this.swiperController) { 87 Swiper(this.swiperController) {
75 ForEach(this.contentDetailData.photoList, (item: PhotoListBean) => { 88 ForEach(this.contentDetailData.photoList, (item: PhotoListBean) => {
76 - Swiper(this.swiperController) { 89 + Swiper(this.swiperControllerItem) {
77 MultiPictureDetailItemComponent({ MultiPictureDetailItem: item }) 90 MultiPictureDetailItemComponent({ MultiPictureDetailItem: item })
78 } 91 }
79 .width('100%') 92 .width('100%')
@@ -256,16 +269,15 @@ export struct MultiPictureDetailPageComponent { @@ -256,16 +269,15 @@ export struct MultiPictureDetailPageComponent {
256 }) 269 })
257 .height(px2vp(this.titleHeight) + 64) 270 .height(px2vp(this.titleHeight) + 64)
258 271
259 - } else { 272 + }
260 if(this.netStatus !== undefined) { 273 if(this.netStatus !== undefined) {
261 - EmptyComponent({ emptyType: this.netStatus}) 274 + EmptyComponent({ emptyType: $netStatus, emptyButton:true, retry: () => {this.getContentDetailData()}})
262 .id('e_empty_content') 275 .id('e_empty_content')
263 .alignRules({ 276 .alignRules({
264 center: { anchor: "__container__", align: VerticalAlign.Center }, 277 center: { anchor: "__container__", align: VerticalAlign.Center },
265 middle: { anchor: "__container__", align: HorizontalAlign.Center } 278 middle: { anchor: "__container__", align: HorizontalAlign.Center }
266 }) 279 })
267 } 280 }
268 - }  
269 OperRowListView({ 281 OperRowListView({
270 contentDetailData: this.contentDetailData, 282 contentDetailData: this.contentDetailData,
271 }) 283 })
@@ -293,12 +305,9 @@ export struct MultiPictureDetailPageComponent { @@ -293,12 +305,9 @@ export struct MultiPictureDetailPageComponent {
293 .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM]) 305 .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM])
294 } 306 }
295 307
296 - private getContentDetailData() { 308 + getContentDetailData() {
297 try { 309 try {
298 - PageRepository.fetchDetailData(this.relId, this.contentId, this.relType).then((resDTO: ResponseDTO<ContentDetailDTO[]>) => {  
299 - // Logger.info(TAG, `fetchDetailData then,navResDTO.timestamp ${resDTO.timestamp}`);  
300 - // Logger.info(TAG, `fetchDetailData then,navResDTO: ${JSON.stringify(resDTO)}`);  
301 - // Logger.info(TAG, `fetchDetailData then,navResDTO.data: ${JSON.stringify(resDTO.data)}`); 310 + PageRepository.fetchDetailData(this.relId, this.contentId, this.relType).then(async (resDTO: ResponseDTO<ContentDetailDTO[]>) => {
302 if (!resDTO || !resDTO.data) { 311 if (!resDTO || !resDTO.data) {
303 Logger.error(TAG, 'fetchDetailData is empty'); 312 Logger.error(TAG, 'fetchDetailData is empty');
304 return 313 return
@@ -307,29 +316,25 @@ export struct MultiPictureDetailPageComponent { @@ -307,29 +316,25 @@ export struct MultiPictureDetailPageComponent {
307 Logger.error(TAG, `fetchDetailData then code:${resDTO.code}, message:${resDTO.message}`); 316 Logger.error(TAG, `fetchDetailData then code:${resDTO.code}, message:${resDTO.message}`);
308 return 317 return
309 } 318 }
  319 + this.netStatus = undefined
310 this.contentDetailData = resDTO.data?.[0]; 320 this.contentDetailData = resDTO.data?.[0];
  321 + // this.contentDetailData.photoList = []
311 if(this.contentDetailData?.photoList && this.contentDetailData?.photoList?.length === 0) { 322 if(this.contentDetailData?.photoList && this.contentDetailData?.photoList?.length === 0) {
  323 + // 暂无内容
312 this.netStatus = 0 324 this.netStatus = 0
  325 + Logger.info(TAG, `this.netStatus:${JSON.stringify(this.netStatus)}`)
313 } 326 }
314 Logger.info(TAG, `contentDetailData:${JSON.stringify(this.contentDetailData)}`) 327 Logger.info(TAG, `contentDetailData:${JSON.stringify(this.contentDetailData)}`)
315 - if (HttpUrlUtils.getUserId()) { 328 + // 未登录,跳转登录
  329 + const user_id = await SPHelper.default.get(SpConstants.USER_ID, '')
  330 + if (user_id) {
316 this.getInteractBrowsOperate() 331 this.getInteractBrowsOperate()
317 this.getBatchAttentionStatus() 332 this.getBatchAttentionStatus()
318 } 333 }
319 }).catch((err: Error) => { 334 }).catch((err: Error) => {
320 Logger.info(TAG, `fetchDetailData then,err: ${JSON.stringify(err)}`); 335 Logger.info(TAG, `fetchDetailData then,err: ${JSON.stringify(err)}`);
321 - /*// 请求失败处理  
322 - if (err.response) {  
323 - // 请求已发出,但服务器响应的状态码不在2xx范围内  
324 - console.error('请求失败,状态码:', err.response.status);  
325 - console.error('响应数据:', err.response.data);  
326 - } else if (err.request) {  
327 - // 请求已发出,但无响应(例如:网络故障)  
328 - console.error('请求已发出,但无响应:', err.request);  
329 - } else {  
330 - // 发生了其他类型的错误(如配置错误或拒绝权限等)  
331 - console.error('请求发生错误:', err.message);  
332 - }*/ 336 + // 内容获取失败
  337 + this.netStatus = 9
333 }) 338 })
334 } catch (exception) { 339 } catch (exception) {
335 340
1 -import { ContentDTO, FullColumnImgUrlDTO } from 'wdBean'; 1 +import { ContentDTO, FullColumnImgUrlDTO, PhotoListBean } from 'wdBean';
2 import { RmhTitle } from '../cardCommon/RmhTitle' 2 import { RmhTitle } from '../cardCommon/RmhTitle'
3 import { ProcessUtils } from 'wdRouter'; 3 import { ProcessUtils } from 'wdRouter';
4 import { CommonConstants } from 'wdConstant/Index'; 4 import { CommonConstants } from 'wdConstant/Index';
@@ -92,8 +92,17 @@ export struct Card19Component { @@ -92,8 +92,17 @@ export struct Card19Component {
92 } 92 }
93 // 图片-从无图到9图展示 93 // 图片-从无图到9图展示
94 createImg({ fullColumnImgUrls: this.contentDTO.fullColumnImgUrls }) 94 createImg({ fullColumnImgUrls: this.contentDTO.fullColumnImgUrls })
95 - .onClick((event: ClickEvent) => {  
96 - ProcessUtils.processPage(this.contentDTO) 95 + .onClick(() => {
  96 + const photoList: PhotoListBean[] = this.contentDTO.fullColumnImgUrls.map(item => {
  97 + const photo: PhotoListBean = {
  98 + width: item.weight,
  99 + height: item.height,
  100 + picPath: item.fullUrl,
  101 + picDesc: ''
  102 + }
  103 + return photo
  104 + })
  105 + ProcessUtils.gotoMultiPictureListPage(photoList)
97 }) 106 })
98 //TODO 底部的:分享、评论、点赞 功能;需要引用一个公共组件 107 //TODO 底部的:分享、评论、点赞 功能;需要引用一个公共组件
99 } 108 }
@@ -103,6 +112,9 @@ export struct Card19Component { @@ -103,6 +112,9 @@ export struct Card19Component {
103 top: $r('app.float.card_comp_pagePadding_tb'), 112 top: $r('app.float.card_comp_pagePadding_tb'),
104 bottom: $r('app.float.card_comp_pagePadding_tb') 113 bottom: $r('app.float.card_comp_pagePadding_tb')
105 }) 114 })
  115 + .onClick((event: ClickEvent) => {
  116 + ProcessUtils.processPage(this.contentDTO)
  117 + })
106 } 118 }
107 } 119 }
108 120
1 -import { CompDTO, ContentDTO, Params } from 'wdBean'; 1 +import { commentInfo, CompDTO, ContentDTO, Params } from 'wdBean';
2 import { WDRouterPage, WDRouterRule } from 'wdRouter/Index'; 2 import { WDRouterPage, WDRouterRule } from 'wdRouter/Index';
3 import { HttpUrlUtils } from 'wdNetwork/Index'; 3 import { HttpUrlUtils } from 'wdNetwork/Index';
4 import { postInteractAccentionOperateParams } from 'wdBean'; 4 import { postInteractAccentionOperateParams } from 'wdBean';
@@ -68,6 +68,9 @@ export struct ZhSingleRow06 { @@ -68,6 +68,9 @@ export struct ZhSingleRow06 {
68 .backgroundColor(0xf9f9f9) 68 .backgroundColor(0xf9f9f9)
69 .borderRadius(4) 69 .borderRadius(4)
70 .margin({bottom: 12}) 70 .margin({bottom: 12})
  71 + .onClick(() => {
  72 + ProcessUtils.commentGotoWeb(this.compDTO.operDataList[0]?.commentInfo as commentInfo)
  73 + })
71 74
72 Row() { 75 Row() {
73 Text(DateTimeUtils.getCommentTime(this.compDTO.operDataList[0]?.commentInfo?.publishTime)) 76 Text(DateTimeUtils.getCommentTime(this.compDTO.operDataList[0]?.commentInfo?.publishTime))
@@ -97,9 +100,6 @@ export struct ZhSingleRow06 { @@ -97,9 +100,6 @@ export struct ZhSingleRow06 {
97 .backgroundColor($r('app.color.white')) 100 .backgroundColor($r('app.color.white'))
98 .margin({ bottom: 8 }) 101 .margin({ bottom: 8 })
99 .height(251) 102 .height(251)
100 - .onClick(() => {  
101 - WDRouterRule.jumpWithPage(WDRouterPage.QualityCommentsPage)  
102 - })  
103 } 103 }
104 104
105 @Builder 105 @Builder
@@ -128,6 +128,9 @@ export struct ZhSingleRow06 { @@ -128,6 +128,9 @@ export struct ZhSingleRow06 {
128 .width(14) 128 .width(14)
129 .height(14) 129 .height(14)
130 } 130 }
  131 + .onClick(() => {
  132 + WDRouterRule.jumpWithPage(WDRouterPage.QualityCommentsPage)
  133 + })
131 } 134 }
132 .margin({bottom: 10}) 135 .margin({bottom: 10})
133 .justifyContent(FlexAlign.SpaceBetween) 136 .justifyContent(FlexAlign.SpaceBetween)
@@ -52,7 +52,7 @@ export struct EmptyComponent { @@ -52,7 +52,7 @@ export struct EmptyComponent {
52 // private emptySize: SizeOptions = {}; 52 // private emptySize: SizeOptions = {};
53 @State emptyWidth: string | number = CommonConstants.FULL_PARENT; 53 @State emptyWidth: string | number = CommonConstants.FULL_PARENT;
54 @State emptyHeight: string | number = CommonConstants.FULL_PARENT; 54 @State emptyHeight: string | number = CommonConstants.FULL_PARENT;
55 - @State emptyType: number = WDViewDefaultType.WDViewDefaultType_Default; 55 + @Link emptyType: number
56 @State emptyButton: boolean = false 56 @State emptyButton: boolean = false
57 @State timeNum: number = 10 57 @State timeNum: number = 10
58 /** 58 /**
@@ -113,6 +113,7 @@ export struct AudioDialog { @@ -113,6 +113,7 @@ export struct AudioDialog {
113 if (this.playerController) { 113 if (this.playerController) {
114 // this.onConfirm() 114 // this.onConfirm()
115 this.playerController.switchPlayOrPause() 115 this.playerController.switchPlayOrPause()
  116 + this.AudioSuspension.playerController.get().switchPlayOrPause()
116 this.currentStatus = this.playerController.getStatus() 117 this.currentStatus = this.playerController.getStatus()
117 } 118 }
118 }) 119 })
@@ -7,6 +7,7 @@ import { CheckVerifyBean } from './CheckVerifyBean'; @@ -7,6 +7,7 @@ import { CheckVerifyBean } from './CheckVerifyBean';
7 import { 7 import {
8 SpConstants 8 SpConstants
9 } from '../../../../../../../commons/wdNetwork/oh_modules/wdConstant/src/main/ets/constants/SpConstants' 9 } from '../../../../../../../commons/wdNetwork/oh_modules/wdConstant/src/main/ets/constants/SpConstants'
  10 +import { UserDetail } from 'wdBean/Index';
10 11
11 12
12 const TAG = 'LoginModel' 13 const TAG = 'LoginModel'
@@ -302,5 +303,26 @@ export class LoginModel { @@ -302,5 +303,26 @@ export class LoginModel {
302 }) 303 })
303 } 304 }
304 305
  306 + queryUserDetail() {
  307 + let bean: Record<string, string> = {};
  308 + let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();
  309 + return new Promise<UserDetail>((success, fail) => {
  310 + HttpBizUtil.get<ResponseDTO<UserDetail>>(HttpUrlUtils.queryUserDetail(), headers).then((data: ResponseDTO<UserDetail>) => {
  311 + if (!data || !data.data) {
  312 + fail("数据为空")
  313 + return
  314 + }
  315 + if (data.code != 0) {
  316 + fail(data.message)
  317 + return
  318 + }
  319 + success(data.data)
  320 + }, (error: Error) => {
  321 + fail(error.message)
  322 + Logger.debug("LoginViewModel:error ", error.toString())
  323 + })
  324 + })
  325 + }
  326 +
305 } 327 }
306 328
@@ -321,13 +321,7 @@ struct LoginPage { @@ -321,13 +321,7 @@ struct LoginPage {
321 ///同步兴趣tag 321 ///同步兴趣tag
322 let interestsModel = new InterestsHobbiesModel() 322 let interestsModel = new InterestsHobbiesModel()
323 interestsModel.updateInterests() 323 interestsModel.updateInterests()
324 -  
325 - router.back({  
326 - params: { userName: data.userName,  
327 - userId:data.id},  
328 - url: `${WDRouterPage.getBundleInfo()}`  
329 - }  
330 - ) 324 + this.queryUserDetail()
331 }).catch((error:string)=>{ 325 }).catch((error:string)=>{
332 promptAction.showToast({ message: error }) 326 promptAction.showToast({ message: error })
333 }) 327 })
@@ -339,12 +333,12 @@ struct LoginPage { @@ -339,12 +333,12 @@ struct LoginPage {
339 ///同步兴趣tag 333 ///同步兴趣tag
340 let interestsModel = new InterestsHobbiesModel() 334 let interestsModel = new InterestsHobbiesModel()
341 interestsModel.updateInterests() 335 interestsModel.updateInterests()
342 -  
343 - router.back({  
344 - params: { userName: data.userName,  
345 - userId:data.id},  
346 - url: `${WDRouterPage.getBundleInfo()}`  
347 - }) 336 + this.queryUserDetail()
  337 + // router.back({
  338 + // params: { userName: data.userName,
  339 + // userId:data.id},
  340 + // url: `${WDRouterPage.getBundleInfo()}`
  341 + // })
348 }).catch((value: string) => { 342 }).catch((value: string) => {
349 promptAction.showToast({ message: value }) 343 promptAction.showToast({ message: value })
350 }) 344 })
@@ -352,6 +346,19 @@ struct LoginPage { @@ -352,6 +346,19 @@ struct LoginPage {
352 346
353 } 347 }
354 348
  349 + queryUserDetail(){
  350 + this.loginViewModel.queryUserDetail().then(()=>{
  351 + router.back({
  352 + url: `${WDRouterPage.getBundleInfo()}`
  353 + }
  354 + )
  355 + }).catch(()=>{
  356 + router.back({
  357 + url: `${WDRouterPage.getBundleInfo()}`
  358 + })
  359 + })
  360 + }
  361 +
355 //登录 362 //登录
356 loginSubmit() { 363 loginSubmit() {
357 Logger.debug(TAG, "loginSubmit " + this.checkCodePage) 364 Logger.debug(TAG, "loginSubmit " + this.checkCodePage)
@@ -9,6 +9,7 @@ import { encryptMessage } from '../../utils/cryptoUtil' @@ -9,6 +9,7 @@ import { encryptMessage } from '../../utils/cryptoUtil'
9 9
10 import { HttpUrlUtils } from 'wdNetwork/src/main/ets/http/HttpUrlUtils' 10 import { HttpUrlUtils } from 'wdNetwork/src/main/ets/http/HttpUrlUtils'
11 import { SpConstants } from 'wdConstant/Index' 11 import { SpConstants } from 'wdConstant/Index'
  12 +import { UserDetail } from 'wdBean/Index';
12 13
13 const TAG = "LoginViewModel" 14 const TAG = "LoginViewModel"
14 15
@@ -213,4 +214,26 @@ export class LoginViewModel { @@ -213,4 +214,26 @@ export class LoginViewModel {
213 return bufferStr; 214 return bufferStr;
214 215
215 } 216 }
  217 +
  218 + queryUserDetail(){
  219 + return new Promise<UserDetail>((success, fail) => {
  220 + this.loginModel.queryUserDetail().then((data: UserDetail) => {
  221 + //保存sp
  222 + if(data){
  223 + SPHelper.default.save(SpConstants.USER_NAME, data.userName)
  224 + SPHelper.default.save(SpConstants.USER_PHONE, data.phone)
  225 + }
  226 + if(data.userExtend){
  227 + SPHelper.default.save(SpConstants.USER_SEX, data.userExtend.sex)
  228 + SPHelper.default.save(SpConstants.USER_CREATOR_ID, data.userExtend.creatorId+"")
  229 + SPHelper.default.save(SpConstants.USER_HEAD_PHOTO_URL, data.userExtend.headPhotoUrl)
  230 + SPHelper.default.save(SpConstants.USER_BIRTHDAY, data.userExtend.birthday)
  231 + }
  232 +
  233 + success(data)
  234 + }).catch(() => {
  235 + fail()
  236 + })
  237 + })
  238 + }
216 } 239 }