wangliang_wd

Merge branch 'main' of http://192.168.1.42/developOne/harmonyPool into main

* 'main' of http://192.168.1.42/developOne/harmonyPool:
  ref |> 桌面组件改掉网络图片路径,尝试解决某些情况下无法加载图片问题
  ref |> 视频详情页评论弹框改为半模态弹框,视频上推效果
  ref |> 评论列表换成半模态弹框
  fix(18721,测试反馈比较严重问题): UI还原问题-【uat】进入心情没好直播间-输入框显示白色
1 /** 1 /**
2 - * 直播详情 关注相关信息 2 + * 直播详情 关注相关信息 直播详情页用户信息行
3 */ 3 */
4 import { 4 import {
5 ContentDetailRequest, 5 ContentDetailRequest,
@@ -40,6 +40,7 @@ export struct LiveFollowComponent { @@ -40,6 +40,7 @@ export struct LiveFollowComponent {
40 bottomLeft: 90 40 bottomLeft: 90
41 }) 41 })
42 Row() { 42 Row() {
  43 + //号主头像
43 Image(this.rmhInfo.rmhHeadUrl) 44 Image(this.rmhInfo.rmhHeadUrl)
44 .width(24) 45 .width(24)
45 .height(24) 46 .height(24)
@@ -54,6 +55,7 @@ export struct LiveFollowComponent { @@ -54,6 +55,7 @@ export struct LiveFollowComponent {
54 WDRouterRule.jumpWithPage(WDRouterPage.peopleShipHomePage, params) 55 WDRouterRule.jumpWithPage(WDRouterPage.peopleShipHomePage, params)
55 } 56 }
56 }) 57 })
  58 + //号主名称
57 Text(this.rmhInfo.rmhName) 59 Text(this.rmhInfo.rmhName)
58 .fontColor(Color.White) 60 .fontColor(Color.White)
59 .maxLines(1) 61 .maxLines(1)
@@ -65,6 +67,7 @@ export struct LiveFollowComponent { @@ -65,6 +67,7 @@ export struct LiveFollowComponent {
65 right: 6 67 right: 6
66 }) 68 })
67 Blank() 69 Blank()
  70 + //关注状态
68 Text(this.followStatus === '0' ? '关注' : '已关注') 71 Text(this.followStatus === '0' ? '关注' : '已关注')
69 .fontColor(Color.White) 72 .fontColor(Color.White)
70 .fontWeight(500) 73 .fontWeight(500)
1 import { ContentDetailDTO, PageInfoDTO } from 'wdBean/Index' 1 import { ContentDetailDTO, PageInfoDTO } from 'wdBean/Index'
2 -import { PublicDialogManager } from 'wdKit/Index' 2 +import { Logger, PublicDialogManager } from 'wdKit/Index'
3 import { TrackConstants } from 'wdTracking/Index' 3 import { TrackConstants } from 'wdTracking/Index'
4 import { OperRowListView } from '../../view/OperRowListView' 4 import { OperRowListView } from '../../view/OperRowListView'
5 import { publishCommentModel } from '../model/PublishCommentModel' 5 import { publishCommentModel } from '../model/PublishCommentModel'
6 import { CommentComponent } from './CommentComponent' 6 import { CommentComponent } from './CommentComponent'
7 7
  8 +const TAG = "CommentListDialogView"
  9 +
8 /// 评论列表弹框 10 /// 评论列表弹框
9 @Component 11 @Component
10 export struct CommentListDialogView { 12 export struct CommentListDialogView {
11 - @Link @Watch('showCommentListChange') showCommentList: boolean 13 + @State windowWidth: number = AppStorage.get<number>('windowWidth') || 0
  14 + @State windowHeight: number = AppStorage.get<number>('windowHeight') || 0
  15 + @Link showCommentList: boolean
12 @Link contentDetailData: ContentDetailDTO // 详情页传 16 @Link contentDetailData: ContentDetailDTO // 详情页传
13 @Link pageInfo: PageInfoDTO // 专题页传 17 @Link pageInfo: PageInfoDTO // 专题页传
14 @Link publishCommentModel: publishCommentModel 18 @Link publishCommentModel: publishCommentModel
  19 + private maxHeight: number = 0 // px
15 onClose?: () => void 20 onClose?: () => void
  21 + onHeightDidChange?: Callback<number>
16 22
17 - // @Consume pageId: TrackConstants.PageName  
18 - // @Consume pageName: TrackConstants.PageName  
19 -  
20 - private dialogController: CustomDialogController = new CustomDialogController({  
21 - builder: CommentListDialog({  
22 - contentDetailData: this.contentDetailData,  
23 - publishCommentModel:this.publishCommentModel,  
24 - pageInfo: this.pageInfo,  
25 - onClose: this.onClose  
26 - }),  
27 - autoCancel: true,  
28 - cancel: () => {  
29 - PublicDialogManager.shareInstance().closeDialog(this.dialogController)  
30 - },  
31 - customStyle: true,  
32 - alignment: DialogAlignment.Bottom,  
33 - })  
34 -  
35 - showCommentListChange(val: boolean) {  
36 - if (this.showCommentList) {  
37 - PublicDialogManager.shareInstance().openDialog(this.dialogController, this.closeAction.bind(this))  
38 - } else {  
39 - PublicDialogManager.shareInstance().closeDialog(this.dialogController)  
40 - } 23 + aboutToAppear(): void {
  24 + this.maxHeight = this.windowHeight - this.windowWidth * 9 / 16
41 } 25 }
42 26
43 - closeAction() {  
44 - if (this.onClose) {  
45 - this.onClose()  
46 - } else {  
47 - this.showCommentList = false 27 + build() {
  28 + Row() {
48 } 29 }
  30 + .height("100%").width("100%")
  31 + .bindSheet($$this.showCommentList,
  32 + this.commentListDialog(),
  33 + {
  34 + height: this.maxHeight + 'px',
  35 + preferType: SheetType.BOTTOM,
  36 + showClose: false,
  37 + dragBar: false,
  38 + onDisappear: () => {
  39 + this.showCommentList = false
  40 + if (this.onClose) { this.onClose() }
  41 + },
  42 + shouldDismiss:((sheetDismiss: SheetDismiss)=> {
  43 + console.log("bind sheet shouldDismiss")
  44 + sheetDismiss.dismiss()
  45 + }),
  46 + onHeightDidChange: (number: number) => {
  47 + Logger.debug(TAG, "onHeightDidChange : " + number)
  48 + let height = number
  49 + if (height > this.maxHeight) {
  50 + height = this.maxHeight
  51 + }
  52 + if (this.onHeightDidChange) {
  53 + this.onHeightDidChange(height)
  54 + }
  55 + }
  56 + })
49 } 57 }
50 58
51 - build() { 59 + @Builder commentListDialog() {
  60 + Column() {
  61 + CommentListDialog({
  62 + contentDetailData: this.contentDetailData,
  63 + publishCommentModel:this.publishCommentModel,
  64 + pageInfo: this.pageInfo,
  65 + onClose: this.onClose
  66 + })
  67 + }.height("100%").width("100%")
52 } 68 }
53 } 69 }
54 70
55 -@CustomDialog 71 +@Component
56 struct CommentListDialog { 72 struct CommentListDialog {
57 73
58 /// 内部使用 74 /// 内部使用
59 @Link publishCommentModel: publishCommentModel 75 @Link publishCommentModel: publishCommentModel
60 @State private operationButtonList: string[] = [] 76 @State private operationButtonList: string[] = []
61 - controller?: CustomDialogController  
62 - @State windowWidth: number = AppStorage.get<number>('windowWidth') || 0  
63 - @State windowHeight: number = AppStorage.get<number>('windowHeight') || 0  
64 77
65 /// 外部初始化 78 /// 外部初始化
66 @Link contentDetailData: ContentDetailDTO // 详情页传 79 @Link contentDetailData: ContentDetailDTO // 详情页传
@@ -97,6 +110,7 @@ struct CommentListDialog { @@ -97,6 +110,7 @@ struct CommentListDialog {
97 110
98 build() { 111 build() {
99 Column() { 112 Column() {
  113 + Row().height(10)
100 this.titleHeaderView() 114 this.titleHeaderView()
101 115
102 CommentComponent({ 116 CommentComponent({
@@ -117,11 +131,11 @@ struct CommentListDialog { @@ -117,11 +131,11 @@ struct CommentListDialog {
117 styleType: 1, 131 styleType: 1,
118 inDialog: true, 132 inDialog: true,
119 dialogBeforeJumpOtherPageAction: () => { 133 dialogBeforeJumpOtherPageAction: () => {
120 - PublicDialogManager.shareInstance().closeLastDialog() 134 + // PublicDialogManager.shareInstance().closeLastDialog()
121 } 135 }
122 }) 136 })
123 } 137 }
124 - .height(this.windowHeight - this.windowWidth * 9 / 16 + 'px') 138 + .height("100%").width("100%")
125 .backgroundColor(Color.White) 139 .backgroundColor(Color.White)
126 } 140 }
127 141
@@ -189,7 +189,7 @@ export struct LiveOperRowListView { @@ -189,7 +189,7 @@ export struct LiveOperRowListView {
189 Stack({ alignContent: Alignment.Start }) { 189 Stack({ alignContent: Alignment.Start }) {
190 RelativeContainer() { 190 RelativeContainer() {
191 191
192 - Image($r('app.media.comment_img_input_hui')) 192 + Image(this.styleType == 1 ? $r('app.media.comment_img_input_hui'):$r('app.media.comment_img_input_black'))
193 .objectFit(ImageFit.Fill) 193 .objectFit(ImageFit.Fill)
194 .resizable({ 194 .resizable({
195 slice: { 195 slice: {
@@ -208,7 +208,7 @@ export struct LiveOperRowListView { @@ -208,7 +208,7 @@ export struct LiveOperRowListView {
208 .id("Image") 208 .id("Image")
209 Text("说两句...") 209 Text("说两句...")
210 .fontSize(12) 210 .fontSize(12)
211 - .fontColor('#999999') 211 + .fontColor(this.styleType == 1 ? '#999999':'#CCFFFFFF')
212 .margin({ left: 10 }) 212 .margin({ left: 10 })
213 .alignRules({ 213 .alignRules({
214 top: { anchor: "__container__", align: VerticalAlign.Top }, 214 top: { anchor: "__container__", align: VerticalAlign.Top },
@@ -13,6 +13,7 @@ import { LiveDetailPageLogic } from '../viewModel/LiveDetailPageLogic'; @@ -13,6 +13,7 @@ import { LiveDetailPageLogic } from '../viewModel/LiveDetailPageLogic';
13 const TAG = 'DetailPlayLiveCommon' 13 const TAG = 'DetailPlayLiveCommon'
14 14
15 /** 15 /**
  16 + * 直播详情页
16 * @Description: 沉浸式和非沉浸式直播页面 17 * @Description: 沉浸式和非沉浸式直播页面
17 * @Author: 18 * @Author:
18 * @Email: 19 * @Email:
@@ -10,6 +10,7 @@ import { PlayerEndView } from '../widgets/vertical/PlayerEndView'; @@ -10,6 +10,7 @@ import { PlayerEndView } from '../widgets/vertical/PlayerEndView';
10 import { TrackConstants, TrackingButton } from 'wdTracking/Index'; 10 import { TrackConstants, TrackingButton } from 'wdTracking/Index';
11 import { LiveDetailPageLogic } from '../viewModel/LiveDetailPageLogic'; 11 import { LiveDetailPageLogic } from '../viewModel/LiveDetailPageLogic';
12 import { onlyWifiLoadVideo } from 'wdComponent/src/main/ets/utils/lazyloadImg'; 12 import { onlyWifiLoadVideo } from 'wdComponent/src/main/ets/utils/lazyloadImg';
  13 +import { StringUtils } from 'wdKit';
13 14
14 const storage = LocalStorage.getShared(); 15 const storage = LocalStorage.getShared();
15 const TAG = 'DetailPlayVLivePage' 16 const TAG = 'DetailPlayVLivePage'
@@ -97,7 +98,7 @@ export struct DetailPlayVLivePage { @@ -97,7 +98,7 @@ export struct DetailPlayVLivePage {
97 .blur(100) 98 .blur(100)
98 .renderFit(RenderFit.RESIZE_COVER) 99 .renderFit(RenderFit.RESIZE_COVER)
99 // 直播结束且无回看 100 // 直播结束且无回看
100 - if (this.liveState === 'end' && !this.playUrl) { 101 + if (this.liveState === 'end' && StringUtils.isEmpty(this.playUrl)) {
101 PlayerEndView() 102 PlayerEndView()
102 } else { 103 } else {
103 // 直播暂停,仍然可以评论 104 // 直播暂停,仍然可以评论
@@ -6,7 +6,7 @@ import { DateFormatUtil, PlayerConstants, WDAliPlayerController } from 'wdPlayer @@ -6,7 +6,7 @@ import { DateFormatUtil, PlayerConstants, WDAliPlayerController } from 'wdPlayer
6 import { ContentDetailDTO, LiveRoomDataBean } from 'wdBean/Index'; 6 import { ContentDetailDTO, LiveRoomDataBean } from 'wdBean/Index';
7 import { DisplayDirection } from 'wdConstant/Index'; 7 import { DisplayDirection } from 'wdConstant/Index';
8 import { LiveFollowComponent, LottieView } from 'wdComponent/Index'; 8 import { LiveFollowComponent, LottieView } from 'wdComponent/Index';
9 - 9 +//直播间播放器上层覆盖物
10 @Component 10 @Component
11 export struct PlayUIComponent { 11 export struct PlayUIComponent {
12 playerController?: WDAliPlayerController; 12 playerController?: WDAliPlayerController;
@@ -84,11 +84,12 @@ export struct PlayUIComponent { @@ -84,11 +84,12 @@ export struct PlayUIComponent {
84 .height('100%') 84 .height('100%')
85 .alignItems(HorizontalAlign.Start) 85 .alignItems(HorizontalAlign.Start)
86 } 86 }
87 - 87 + //最顶部UI
88 @Builder 88 @Builder
89 getTopUIComponent() { 89 getTopUIComponent() {
90 Column() { 90 Column() {
91 Row() { 91 Row() {
  92 + //返回键
92 Image($r('app.media.icon_arrow_left_white')) 93 Image($r('app.media.icon_arrow_left_white'))
93 .width(24) 94 .width(24)
94 .aspectRatio(1) 95 .aspectRatio(1)
@@ -105,6 +106,7 @@ export struct PlayUIComponent { @@ -105,6 +106,7 @@ export struct PlayUIComponent {
105 106
106 }) 107 })
107 if (this.contentDetailData.liveInfo?.liveState != 'wait') { 108 if (this.contentDetailData.liveInfo?.liveState != 'wait') {
  109 + //标题
108 Text(this.contentDetailData.newsTitle) 110 Text(this.contentDetailData.newsTitle)
109 .maxLines(1) 111 .maxLines(1)
110 .textOverflow({ overflow: TextOverflow.MARQUEE }) 112 .textOverflow({ overflow: TextOverflow.MARQUEE })
@@ -116,6 +118,7 @@ export struct PlayUIComponent { @@ -116,6 +118,7 @@ export struct PlayUIComponent {
116 } else { 118 } else {
117 Blank() 119 Blank()
118 } 120 }
  121 + //分享按钮
119 Image($r('app.media.icon_share')) 122 Image($r('app.media.icon_share'))
120 .width(24) 123 .width(24)
121 .aspectRatio(1) 124 .aspectRatio(1)
@@ -126,16 +129,18 @@ export struct PlayUIComponent { @@ -126,16 +129,18 @@ export struct PlayUIComponent {
126 .margin({ 129 .margin({
127 bottom: 10 130 bottom: 10
128 }) 131 })
129 - 132 + //第二行左边号主信息
130 Row() { 133 Row() {
131 if (this.contentDetailData?.rmhInfo) { 134 if (this.contentDetailData?.rmhInfo) {
132 LiveFollowComponent({ 135 LiveFollowComponent({
133 rmhInfo: this.contentDetailData.rmhInfo 136 rmhInfo: this.contentDetailData.rmhInfo
134 }) 137 })
135 .margin({ 138 .margin({
  139 + top:-7,
136 right: 10 140 right: 10
137 }) 141 })
138 } 142 }
  143 + //第二行右边直播状态参与人数
139 this.getLiveStatusView() 144 this.getLiveStatusView()
140 } 145 }
141 } 146 }
1 import { WDAliPlayerController } from 'wdPlayer/Index' 1 import { WDAliPlayerController } from 'wdPlayer/Index'
2 import { PlayerUIComponent } from './PlayerUIComponent' 2 import { PlayerUIComponent } from './PlayerUIComponent'
3 - 3 +//竖屏直播详情页左右滑动浮层
4 @Component 4 @Component
5 export struct PlayerInfoComponent { 5 export struct PlayerInfoComponent {
6 swiperController?: SwiperController 6 swiperController?: SwiperController
@@ -8,7 +8,7 @@ import { @@ -8,7 +8,7 @@ import {
8 postInteractBrowsOperateParams 8 postInteractBrowsOperateParams
9 } from 'wdDetailPlayApi/src/main/ets/request/ContentDetailRequest'; 9 } from 'wdDetailPlayApi/src/main/ets/request/ContentDetailRequest';
10 import { HttpUtils } from 'wdNetwork/Index'; 10 import { HttpUtils } from 'wdNetwork/Index';
11 -import { DateTimeUtils, WindowModel } from 'wdKit/Index'; 11 +import { DateTimeUtils, Logger, WindowModel } from 'wdKit/Index';
12 import { PlayerBottomView } from '../view/PlayerBottomView'; 12 import { PlayerBottomView } from '../view/PlayerBottomView';
13 import { PlayerRightView } from '../view/PlayerRightView'; 13 import { PlayerRightView } from '../view/PlayerRightView';
14 import { DisplayDirection } from 'wdConstant/Index'; 14 import { DisplayDirection } from 'wdConstant/Index';
@@ -229,7 +229,7 @@ export struct DetailPlayShortVideoPage { @@ -229,7 +229,7 @@ export struct DetailPlayShortVideoPage {
229 showCommentListChanged() { 229 showCommentListChanged() {
230 if (this.showCommentList) { 230 if (this.showCommentList) {
231 this.playerWidth = px2vp(this.windowWidth) 231 this.playerWidth = px2vp(this.windowWidth)
232 - this.playerHeight = px2vp(this.windowWidth) / (16 / 9.0) 232 + // this.playerHeight = px2vp(this.windowWidth) / (16 / 9.0)
233 } else { 233 } else {
234 this.calculatePlayerRect() 234 this.calculatePlayerRect()
235 } 235 }
@@ -245,6 +245,11 @@ export struct DetailPlayShortVideoPage { @@ -245,6 +245,11 @@ export struct DetailPlayShortVideoPage {
245 showCommentList: $showCommentList, 245 showCommentList: $showCommentList,
246 publishCommentModel: $publishCommentModel, 246 publishCommentModel: $publishCommentModel,
247 interactData: $interactData, 247 interactData: $interactData,
  248 + onHeightDidChange: (height: number) => {
  249 + this.playerWidth = px2vp(this.windowWidth)
  250 + this.playerHeight = px2vp(this.windowHeight - height)
  251 + Logger.debug(TAG, "height: " + px2vp(height) + " ===> 视频高度: " + this.playerHeight + " window height: " + px2vp(this.windowHeight))
  252 + }
248 }) 253 })
249 this.playerViewBuilder() 254 this.playerViewBuilder()
250 255
@@ -338,7 +343,7 @@ export struct DetailPlayShortVideoPage { @@ -338,7 +343,7 @@ export struct DetailPlayShortVideoPage {
338 343
339 // 横屏-全屏观看 344 // 横屏-全屏观看
340 // 点击查看详情 不展示 345 // 点击查看详情 不展示
341 - if (this.videoLandScape === 1 && !this.isOpenDetail && this.displayDirection === DisplayDirection.VERTICAL) { 346 + if (this.videoLandScape === 1 && !this.isOpenDetail && this.displayDirection === DisplayDirection.VERTICAL && !this.showCommentList) {
342 this.playerFullscreenBuilder() 347 this.playerFullscreenBuilder()
343 } 348 }
344 349
@@ -12,6 +12,7 @@ export struct CommentDialogView { @@ -12,6 +12,7 @@ export struct CommentDialogView {
12 @Link interactData: InteractDataDTO 12 @Link interactData: InteractDataDTO
13 @State fakePageInfo: PageInfoDTO = {} as PageInfoDTO 13 @State fakePageInfo: PageInfoDTO = {} as PageInfoDTO
14 @State dialogOffsetY: number = 0 // (this.windowHeight - this.windowWidth * 9 / 16) 14 @State dialogOffsetY: number = 0 // (this.windowHeight - this.windowWidth * 9 / 16)
  15 + onHeightDidChange?: Callback<number>
15 16
16 @State @Watch("innerShowCommentChange") innerShowComment: boolean = false 17 @State @Watch("innerShowCommentChange") innerShowComment: boolean = false
17 18
@@ -38,7 +39,8 @@ export struct CommentDialogView { @@ -38,7 +39,8 @@ export struct CommentDialogView {
38 if (Number.parseInt(this.publishCommentModel.totalCommentNumer) > Number.parseInt(this.interactData.commentNum + "")) { 39 if (Number.parseInt(this.publishCommentModel.totalCommentNumer) > Number.parseInt(this.interactData.commentNum + "")) {
39 this.interactData.commentNum = Number.parseInt(this.publishCommentModel.totalCommentNumer) 40 this.interactData.commentNum = Number.parseInt(this.publishCommentModel.totalCommentNumer)
40 } 41 }
41 - } 42 + },
  43 + onHeightDidChange: this.onHeightDidChange
42 }) 44 })
43 } 45 }
44 } 46 }
@@ -141,7 +141,27 @@ export struct WDPlayerRenderView { @@ -141,7 +141,27 @@ export struct WDPlayerRenderView {
141 141
142 this.xComponentController.setXComponentSurfaceRect({ 142 this.xComponentController.setXComponentSurfaceRect({
143 surfaceWidth: info.size.height * ratio, 143 surfaceWidth: info.size.height * ratio,
144 - surfaceHeight: info.size.height 144 + surfaceHeight: info.size.height,
  145 + offsetY: 0
  146 + });
  147 + return
  148 + }
  149 + } else {
  150 + // 横屏
  151 + let ratio = this.videoWidth / this.videoHeight
  152 + const height = info.size.width / ratio
  153 +
  154 + // 横屏,缩放高度小 视频区域高度
  155 + if (height < info.size.height) {
  156 +
  157 + Logger.debug(TAG, "ratio = " + ratio + " ==> new height = " + height)
  158 +
  159 + Logger.debug(TAG, "宽度固定,求高度: " + height)
  160 +
  161 + this.xComponentController.setXComponentSurfaceRect({
  162 + surfaceWidth: info.size.width,
  163 + surfaceHeight: height,
  164 + offsetY: (info.size.height - height) / 2
145 }); 165 });
146 return 166 return
147 } 167 }
@@ -149,7 +169,8 @@ export struct WDPlayerRenderView { @@ -149,7 +169,8 @@ export struct WDPlayerRenderView {
149 169
150 this.xComponentController.setXComponentSurfaceRect({ 170 this.xComponentController.setXComponentSurfaceRect({
151 surfaceWidth: info.size.width, 171 surfaceWidth: info.size.width,
152 - surfaceHeight: info.size.height 172 + surfaceHeight: info.size.height,
  173 + offsetY: 0
153 }); 174 });
154 } 175 }
155 176
@@ -80,7 +80,7 @@ export default class DailyNewspaperFormAbility extends FormExtensionAbility { @@ -80,7 +80,7 @@ export default class DailyNewspaperFormAbility extends FormExtensionAbility {
80 Logger.debug(TAG, ` xFailed to updateForm. Code: ${err.code}, message: ${err.message}`); 80 Logger.debug(TAG, ` xFailed to updateForm. Code: ${err.code}, message: ${err.message}`);
81 }); 81 });
82 82
83 - let fileDir = this.context.getApplicationContext().filesDir + "/widget-daily-newspaper" 83 + let fileDir = this.context.getApplicationContext().tempDir + "/widget-daily-newspaper"
84 await FileUtils.makeDirIfNotExsit(fileDir) 84 await FileUtils.makeDirIfNotExsit(fileDir)
85 85
86 NewspaperDataFetcher.dealWithPictures(data, formId, fileDir, (data) => { 86 NewspaperDataFetcher.dealWithPictures(data, formId, fileDir, (data) => {
@@ -92,7 +92,7 @@ export class NewspaperDataFetcher { @@ -92,7 +92,7 @@ export class NewspaperDataFetcher {
92 92
93 CrptoUtils.md5(data.paperInfo.leftImageUrl).then((md5String) => { 93 CrptoUtils.md5(data.paperInfo.leftImageUrl).then((md5String) => {
94 94
95 - const fileName = formId + "file" + md5String; 95 + const fileName = formId + "file" + Date.now();
96 const filePath = tempDir + "/" + fileName 96 const filePath = tempDir + "/" + fileName
97 NewspaperDataFetcher.downloadUrlToPath(data.paperInfo.leftImageUrl!, filePath).then(() => { 97 NewspaperDataFetcher.downloadUrlToPath(data.paperInfo.leftImageUrl!, filePath).then(() => {
98 let file = fs.openSync(filePath) 98 let file = fs.openSync(filePath)
@@ -119,7 +119,7 @@ export class NewspaperDataFetcher { @@ -119,7 +119,7 @@ export class NewspaperDataFetcher {
119 } 119 }
120 120
121 CrptoUtils.md5(content.coverUrl).then((md5String) => { 121 CrptoUtils.md5(content.coverUrl).then((md5String) => {
122 - const fileName = formId + "file" + md5String; 122 + const fileName = formId + "file" + Date.now() + index;
123 const filePath = tempDir + "/" + fileName 123 const filePath = tempDir + "/" + fileName
124 NewspaperDataFetcher.downloadUrlToPath(content.coverUrl!, filePath).then(() => { 124 NewspaperDataFetcher.downloadUrlToPath(content.coverUrl!, filePath).then(() => {
125 Logger.debug(TAG, "open file for display "); 125 Logger.debug(TAG, "open file for display ");