张善主

feat(意见反馈):UI调整3

@@ -123,7 +123,8 @@ function handleJsCallReceiveH5Data(data: Message) { @@ -123,7 +123,8 @@ function handleJsCallReceiveH5Data(data: Message) {
123 height: item.height, 123 height: item.height,
124 picPath: item.pic, 124 picPath: item.pic,
125 picDesc: '', 125 picDesc: '',
126 - itemType:2 126 + itemType:2,
  127 + id:0
127 } 128 }
128 return photo 129 return photo
129 }) 130 })
@@ -4,6 +4,7 @@ @@ -4,6 +4,7 @@
4 4
5 // 【图文、图集稿件正文图片】图片信息数组 5 // 【图文、图集稿件正文图片】图片信息数组
6 export interface PhotoListBean { 6 export interface PhotoListBean {
  7 + id: number;
7 height: number; 8 height: number;
8 width: number; 9 width: number;
9 picPath: string; 10 picPath: string;
@@ -19,6 +19,7 @@ const TAG = 'FeedBackActivity' @@ -19,6 +19,7 @@ const TAG = 'FeedBackActivity'
19 @Entry 19 @Entry
20 @Component 20 @Component
21 export struct FeedBackActivity { 21 export struct FeedBackActivity {
  22 + @State textNumLabel: string = '0/500';
22 contact: string = ""; 23 contact: string = "";
23 email: string = ""; 24 email: string = "";
24 //UI 25 //UI
@@ -82,17 +83,19 @@ export struct FeedBackActivity { @@ -82,17 +83,19 @@ export struct FeedBackActivity {
82 .width(CommonConstants.FULL_WIDTH) 83 .width(CommonConstants.FULL_WIDTH)
83 .margin({ left: $r('app.float.vp_16'), top: $r('app.float.vp_12') }) 84 .margin({ left: $r('app.float.vp_16'), top: $r('app.float.vp_12') })
84 Stack({ alignContent: Alignment.BottomEnd }) { 85 Stack({ alignContent: Alignment.BottomEnd }) {
85 - TextInput({ placeholder: $r('app.string.feedback_comments') }) 86 + TextArea({ placeholder: $r('app.string.feedback_comments') })
86 .width(CommonConstants.FULL_WIDTH) 87 .width(CommonConstants.FULL_WIDTH)
87 .height(CommonConstants.FULL_HEIGHT) 88 .height(CommonConstants.FULL_HEIGHT)
  89 + .padding({bottom:96})
88 .backgroundColor($r('app.color.color_F5F5F5')) 90 .backgroundColor($r('app.color.color_F5F5F5'))
89 .align(Alignment.TopStart) 91 .align(Alignment.TopStart)
90 .onChange((value) => { 92 .onChange((value) => {
91 // Logger.debug(TAG, "onChange" + value + "/" + this.passwordContent) 93 // Logger.debug(TAG, "onChange" + value + "/" + this.passwordContent)
92 this.contact = value 94 this.contact = value
  95 + this.textNumLabel = value.length+"/500"
93 }) 96 })
94 GridRow({ 97 GridRow({
95 - columns:3, 98 + columns:5,
96 }) { 99 }) {
97 100
98 ForEach(this.pics, (feedbackImageItem: PhotoListBean, index: number) => { 101 ForEach(this.pics, (feedbackImageItem: PhotoListBean, index: number) => {
@@ -114,35 +117,57 @@ export struct FeedBackActivity { @@ -114,35 +117,57 @@ export struct FeedBackActivity {
114 .width(60) 117 .width(60)
115 .height(60) 118 .height(60)
116 .borderRadius($r('app.float.margin_1')) 119 .borderRadius($r('app.float.margin_1'))
  120 + .onClick(async (event: ClickEvent) => {
  121 + if(await FastClickUtil.isMinDelayTime()){
  122 + return
  123 + }
  124 + //查看图片 fixme 去除添加按钮
  125 + ProcessUtils.gotoMultiPictureListPage(this.pics, index)
  126 + })
117 Image($r('app.media.icon_feekback_delete')) 127 Image($r('app.media.icon_feekback_delete'))
118 .width(24) 128 .width(24)
119 .height(24) 129 .height(24)
120 .borderRadius($r('app.float.margin_1')) 130 .borderRadius($r('app.float.margin_1'))
121 - }  
122 - .width(60)  
123 - .height(60)  
124 .onClick(async (event: ClickEvent) => { 131 .onClick(async (event: ClickEvent) => {
125 if(await FastClickUtil.isMinDelayTime()){ 132 if(await FastClickUtil.isMinDelayTime()){
126 return 133 return
127 } 134 }
128 - //查看图片 fixme 去除添加按钮  
129 - ProcessUtils.gotoMultiPictureListPage(this.pics, index) 135 +
  136 + let temp: PhotoListBean[] = [] as PhotoListBean[]
  137 + temp.length = this.pics.length - 1;
  138 + let tempIndex = 0;
  139 + for (let index = 0; index < this.pics.length; index++) {
  140 + const element = this.pics[index];
  141 + if(!StringUtils.isEmpty(element.picPath) && element.id != feedbackImageItem.id){
  142 + temp[tempIndex] = element;
  143 + tempIndex = tempIndex+1
  144 + }
  145 + }
  146 + if(tempIndex < 3){
  147 + temp[tempIndex] = this.addPic
  148 + }
  149 + this.pics = temp
130 }) 150 })
131 } 151 }
  152 + .width(60)
  153 + .height(60)
  154 + }
132 } 155 }
133 }) 156 })
134 } 157 }
135 - .width(CommonConstants.FULL_WIDTH)  
136 .margin({bottom: $r('app.float.vp_12'), right: $r('app.float.vp_12'),left: $r('app.float.vp_12')}) 158 .margin({bottom: $r('app.float.vp_12'), right: $r('app.float.vp_12'),left: $r('app.float.vp_12')})
137 - Text('0/500') 159 + Text(this.textNumLabel)
138 .margin({bottom: $r('app.float.vp_12'), right: $r('app.float.vp_11')}) 160 .margin({bottom: $r('app.float.vp_12'), right: $r('app.float.vp_11')})
139 } 161 }
140 .height(200) 162 .height(200)
141 - .width('100%')  
142 - .margin({ left: $r('app.float.vp_16'), top: $r('app.float.vp_12'), right: $r('app.float.vp_16') }) 163 + .width('90%')
  164 + .margin({ top: $r('app.float.vp_12') })
143 .backgroundColor($r('app.color.color_F5F5F5')) 165 .backgroundColor($r('app.color.color_F5F5F5'))
144 .borderRadius(4) 166 .borderRadius(4)
145 167
  168 +
  169 +
  170 +
146 Text($r('app.string.feedback_email')) 171 Text($r('app.string.feedback_email'))
147 .fontColor($r('app.color.color_222222')) 172 .fontColor($r('app.color.color_222222'))
148 .fontSize($r('app.float.font_size_14')) 173 .fontSize($r('app.float.font_size_14'))
@@ -154,7 +179,6 @@ export struct FeedBackActivity { @@ -154,7 +179,6 @@ export struct FeedBackActivity {
154 .fontColor($r('app.color.color_222222')) 179 .fontColor($r('app.color.color_222222'))
155 .fontSize($r('app.float.font_size_14')) 180 .fontSize($r('app.float.font_size_14'))
156 .fontWeight(FontWeight.Bold) 181 .fontWeight(FontWeight.Bold)
157 - .margin({ left: $r('app.float.vp_12') })  
158 TextInput({ placeholder: $r('app.string.feedback_hideemail') }) 182 TextInput({ placeholder: $r('app.string.feedback_hideemail') })
159 .width(CommonConstants.FULL_WIDTH) 183 .width(CommonConstants.FULL_WIDTH)
160 .height(CommonConstants.FULL_HEIGHT) 184 .height(CommonConstants.FULL_HEIGHT)
@@ -165,8 +189,9 @@ export struct FeedBackActivity { @@ -165,8 +189,9 @@ export struct FeedBackActivity {
165 }) 189 })
166 } 190 }
167 .height(44) 191 .height(44)
168 - .margin({ left: $r('app.float.vp_16'), right: $r('app.float.vp_12'), top: $r('app.float.margin_16') }) 192 + .width('90%')
169 .backgroundColor($r('app.color.color_F5F5F5')) 193 .backgroundColor($r('app.color.color_F5F5F5'))
  194 + .margin({top: $r('app.float.margin_16') })
170 .borderRadius(4) 195 .borderRadius(4)
171 Blank().layoutWeight(1) 196 Blank().layoutWeight(1)
172 } 197 }
@@ -225,21 +250,23 @@ export struct FeedBackActivity { @@ -225,21 +250,23 @@ export struct FeedBackActivity {
225 // 其中包含Array<string>类型的photoUris,为返回图库选择后的媒体文件的uri数组;还包含boolean类型的isOriginalPhoto,指示返回图库选择后的媒体文件是否为原图。 250 // 其中包含Array<string>类型的photoUris,为返回图库选择后的媒体文件的uri数组;还包含boolean类型的isOriginalPhoto,指示返回图库选择后的媒体文件是否为原图。
226 // 声明变量array,其取值为PhotoSelectResult中的数组。 251 // 声明变量array,其取值为PhotoSelectResult中的数组。
227 array = PhotoSelectResult['photoUris']; 252 array = PhotoSelectResult['photoUris'];
  253 + let startIndex = this.pics.length-1;
228 let totalLen = this.pics.length+array.length; 254 let totalLen = this.pics.length+array.length;
229 if(totalLen > 3){ 255 if(totalLen > 3){
230 totalLen = 3 256 totalLen = 3
231 } 257 }
232 this.pics.length = totalLen; 258 this.pics.length = totalLen;
233 - let startIndex = this.pics.length-1;  
234 259
235 array.forEach((value) => { 260 array.forEach((value) => {
236 let pic: PhotoListBean = {itemType:2,picPath:value} as PhotoListBean 261 let pic: PhotoListBean = {itemType:2,picPath:value} as PhotoListBean
  262 + pic.id = startIndex
237 this.pics[startIndex] = pic 263 this.pics[startIndex] = pic
238 startIndex = startIndex+1; 264 startIndex = startIndex+1;
239 mediaFlag = true; 265 mediaFlag = true;
240 Logger.info(TAG, `select image/video uri: ${value}`); 266 Logger.info(TAG, `select image/video uri: ${value}`);
241 }) 267 })
242 if(this.pics.length<3){ 268 if(this.pics.length<3){
  269 + this.addPic.id = startIndex
243 this.pics[this.pics.length-1]=this.addPic; 270 this.pics[this.pics.length-1]=this.addPic;
244 } 271 }
245 } 272 }
@@ -41,7 +41,8 @@ export struct Card19Component { @@ -41,7 +41,8 @@ export struct Card19Component {
41 height: item.height, 41 height: item.height,
42 picPath: item.fullUrl, 42 picPath: item.fullUrl,
43 picDesc: '', 43 picDesc: '',
44 - itemType:2 44 + itemType:2,
  45 + id:0
45 } 46 }
46 return photo 47 return photo
47 }) 48 })