Showing
16 changed files
with
192 additions
and
75 deletions
| @@ -191,7 +191,7 @@ struct createImg { | @@ -191,7 +191,7 @@ struct createImg { | ||
| 191 | }) { | 191 | }) { |
| 192 | ForEach(this.fullColumnImgUrls, (item: FullColumnImgUrlDTO, index: number) => { | 192 | ForEach(this.fullColumnImgUrls, (item: FullColumnImgUrlDTO, index: number) => { |
| 193 | if (this.fullColumnImgUrls.length === 1) { | 193 | if (this.fullColumnImgUrls.length === 1) { |
| 194 | - if (this.getPicType(item.weight, item.height) !== 3) { | 194 | + if (this.getPicType(item.weight, item.height) < 3) { |
| 195 | GridCol({ | 195 | GridCol({ |
| 196 | span: this.getPicType(item.weight, item.height) === 1 ? 12 : 8 | 196 | span: this.getPicType(item.weight, item.height) === 1 ? 12 : 8 |
| 197 | }){ | 197 | }){ |
| 1 | import { inputMethodEngine } from '@kit.IMEKit' | 1 | import { inputMethodEngine } from '@kit.IMEKit' |
| 2 | import { commentInfo } from 'wdBean/Index' | 2 | import { commentInfo } from 'wdBean/Index' |
| 3 | import { VoiceRecoginizer } from 'wdHwAbility' | 3 | import { VoiceRecoginizer } from 'wdHwAbility' |
| 4 | -import { ToastUtils } from 'wdKit/Index' | 4 | +import { Logger, ToastUtils } from 'wdKit/Index' |
| 5 | import { HttpUtils } from 'wdNetwork/Index' | 5 | import { HttpUtils } from 'wdNetwork/Index' |
| 6 | import { commentItemModel } from '../model/CommentModel' | 6 | import { commentItemModel } from '../model/CommentModel' |
| 7 | import { publishCommentModel } from '../model/PublishCommentModel' | 7 | import { publishCommentModel } from '../model/PublishCommentModel' |
| @@ -9,6 +9,8 @@ import commentViewModel from '../viewmodel/CommentViewModel' | @@ -9,6 +9,8 @@ import commentViewModel from '../viewmodel/CommentViewModel' | ||
| 9 | import { VoiceInputView } from './VoiceInputView' | 9 | import { VoiceInputView } from './VoiceInputView' |
| 10 | import { common, UIAbility } from '@kit.AbilityKit' | 10 | import { common, UIAbility } from '@kit.AbilityKit' |
| 11 | 11 | ||
| 12 | +const TAG = "CommentInputDialog" | ||
| 13 | + | ||
| 12 | export interface CommentDialogInputContent { | 14 | export interface CommentDialogInputContent { |
| 13 | comment?: string | 15 | comment?: string |
| 14 | imageUrl?: string | 16 | imageUrl?: string |
| @@ -213,15 +215,16 @@ export struct CommentCustomDialog { | @@ -213,15 +215,16 @@ export struct CommentCustomDialog { | ||
| 213 | struct emojiView { | 215 | struct emojiView { |
| 214 | @ObjectLink publishCommentModel: publishCommentModel | 216 | @ObjectLink publishCommentModel: publishCommentModel |
| 215 | /*没找到获取系统emoji的方案*/ | 217 | /*没找到获取系统emoji的方案*/ |
| 216 | - private emojiString = '😀,😁,😂,😃,😄,😅,😆,😇,😈,😉,😊,😋,😌,😍,😎,😏,😐,😑,😒,😓,😔,😕,😖,😗,😘,😙,😚,😛,😜,😝,😞,😟,😠,😡,😢,😣,😤,😥,😦,😧,😨,😩,😪,😫,😬,😭,😮,😯,😰,😱,😲,😳,😴,😵,😶,😷,😸,😹,😺,😻,😼,😽,😾,😿,🙀,🙅,🙆,🙇,🙈,🙉,🙊,🙋,🙌,🙍,🙎,🙏' | 218 | + private emojiArray = ["😀","😁","😂","😃","😄","😅","😆","😇","😈","😉","😊","😋","😌","😍","😎","😏","😐","😑","😒","😓","😔","😕","😖","😗","😘","😙","😚","😛","😜","😝","😞","😟","😠","😡","😢","😣","😤","😥","😦","😧","😨","😩","😪","😫","😬","😭","😮","😯","😰","😱","😲","😳","😴","😵","😶","😷","😸","😹","😺","😻","😼","😽","😾","😿","🙀","🙅","🙆","🙇","🙈","🙉","🙊","🙋","🙌","🙍","🙎","🙏"] |
| 219 | + // private emojiCharCodeArray: number[] = [] | ||
| 217 | private displayArray: string[][] = [] | 220 | private displayArray: string[][] = [] |
| 218 | private swiperController: SwiperController = new SwiperController() | 221 | private swiperController: SwiperController = new SwiperController() |
| 219 | 222 | ||
| 220 | aboutToAppear(): void { | 223 | aboutToAppear(): void { |
| 221 | 224 | ||
| 222 | 225 | ||
| 223 | - | ||
| 224 | - this.displayArray = chunk(this.emojiString.split(','), 20) | 226 | + // this.emojiCharCodeArray = this.emojiArray.map((a) => { return a.charCodeAt(0) }) |
| 227 | + this.displayArray = chunk(this.emojiArray, 20) | ||
| 225 | 228 | ||
| 226 | //补上删除按钮以及空白占位 | 229 | //补上删除按钮以及空白占位 |
| 227 | let lastElement = this.displayArray.slice(-1)[0]; | 230 | let lastElement = this.displayArray.slice(-1)[0]; |
| @@ -260,10 +263,27 @@ struct emojiView { | @@ -260,10 +263,27 @@ struct emojiView { | ||
| 260 | // .backgroundColor(Color.Orange) | 263 | // .backgroundColor(Color.Orange) |
| 261 | }.onClick(() => { | 264 | }.onClick(() => { |
| 262 | if (emoji == '删除') { | 265 | if (emoji == '删除') { |
| 263 | - this.publishCommentModel.commentContent = this.publishCommentModel.commentContent.substring(0, this.publishCommentModel.commentContent.length -1) | 266 | + let content = this.publishCommentModel.commentContent |
| 267 | + // if (content.length > 3) { | ||
| 268 | + // if (isEmojiCharacter(content.substring(content.length-4))) { | ||
| 269 | + // content = content.substring(0, content.length -4) | ||
| 270 | + // this.publishCommentModel.commentContent = content | ||
| 271 | + // return | ||
| 272 | + // } | ||
| 273 | + // } | ||
| 274 | + if (content.length > 1) { | ||
| 275 | + if (isEmojiCharacter(content.substring(content.length-2))) { | ||
| 276 | + content = content.substring(0, content.length -2) | ||
| 277 | + this.publishCommentModel.commentContent = content | ||
| 278 | + return | ||
| 279 | + } | ||
| 280 | + } | ||
| 281 | + content = content.substring(0, content.length -1) | ||
| 282 | + this.publishCommentModel.commentContent = content | ||
| 264 | } else if (emoji == '') { | 283 | } else if (emoji == '') { |
| 265 | 284 | ||
| 266 | } else { | 285 | } else { |
| 286 | + Logger.debug(TAG, "charCode: " + emoji.charCodeAt(0) + " ==> " + emoji) | ||
| 267 | this.publishCommentModel.commentContent = this.publishCommentModel.commentContent + emoji | 287 | this.publishCommentModel.commentContent = this.publishCommentModel.commentContent + emoji |
| 268 | } | 288 | } |
| 269 | 289 | ||
| @@ -295,6 +315,45 @@ function chunk<T>(array: T[], size: number): T[][] { | @@ -295,6 +315,45 @@ function chunk<T>(array: T[], size: number): T[][] { | ||
| 295 | return result; | 315 | return result; |
| 296 | } | 316 | } |
| 297 | 317 | ||
| 298 | - | ||
| 299 | - | ||
| 300 | - | 318 | +// https://blog.csdn.net/liaowenfeng/article/details/120484855 |
| 319 | +function isEmojiCharacter(substring: string): boolean { | ||
| 320 | + for (let i = 0; i < substring.length; i++) { | ||
| 321 | + let hs = substring.charCodeAt(i); | ||
| 322 | + if (0xd800 <= hs && hs <= 0xdbff) { | ||
| 323 | + if (substring.length > 1) { | ||
| 324 | + let ls = substring.charCodeAt(i + 1); | ||
| 325 | + let uc = ((hs - 0xd800) * 0x400) + (ls - 0xdc00) + 0x10000; | ||
| 326 | + if (0x1d000 <= uc && uc <= 0x1f77f) { | ||
| 327 | + return true; | ||
| 328 | + } | ||
| 329 | + if (0x1f900 <= uc && uc <= 0x1f9ff) { | ||
| 330 | + // SupplementalSymBolsAndPictographs 字符串含有表情字符[U+1F900,U+1F90F] | ||
| 331 | + // https://www.fileformat.info/info/unicode/block/supplemental_symbols_and_pictographs/index.htm | ||
| 332 | + // https://www.fileformat.info/info/unicode/char/1f964/index.htm | ||
| 333 | + return true; | ||
| 334 | + } | ||
| 335 | + } | ||
| 336 | + } | ||
| 337 | + else if (substring.length > 1) { | ||
| 338 | + let ls = substring.charCodeAt(i + 1); | ||
| 339 | + if (ls == 0x20e3) { | ||
| 340 | + return true; | ||
| 341 | + } | ||
| 342 | + } else { | ||
| 343 | + if (0x2100 <= hs && hs <= 0x27ff) { | ||
| 344 | + return true; | ||
| 345 | + } else if (0x2B05 <= hs && hs <= 0x2b07) { | ||
| 346 | + return true; | ||
| 347 | + } else if (0x2934 <= hs && hs <= 0x2935) { | ||
| 348 | + return true; | ||
| 349 | + } else if (0x3297 <= hs && hs <= 0x3299) { | ||
| 350 | + return true; | ||
| 351 | + } else if (hs == 0xa9 || hs == 0xae || hs == 0x303d || hs == 0x3030 || | ||
| 352 | + hs == 0x2b55 || hs == 0x2b1c || hs == 0x2b1b || | ||
| 353 | + hs == 0x2b50) { | ||
| 354 | + return true; | ||
| 355 | + } | ||
| 356 | + } | ||
| 357 | + } | ||
| 358 | + return false; | ||
| 359 | +} |
| 1 | -import { DateTimeUtils, LazyDataSource, UserDataLocal } from 'wdKit'; | 1 | +import { DateTimeUtils, DisplayUtils, LazyDataSource, UserDataLocal } from 'wdKit'; |
| 2 | import MinePageDatasModel from '../../../model/MinePageDatasModel'; | 2 | import MinePageDatasModel from '../../../model/MinePageDatasModel'; |
| 3 | import { CommentListItem } from '../../../viewmodel/CommentListItem'; | 3 | import { CommentListItem } from '../../../viewmodel/CommentListItem'; |
| 4 | import { FollowListDetailRequestItem } from '../../../viewmodel/FollowListDetailRequestItem'; | 4 | import { FollowListDetailRequestItem } from '../../../viewmodel/FollowListDetailRequestItem'; |
| @@ -27,7 +27,7 @@ export struct HomePageBottomCommentComponent { | @@ -27,7 +27,7 @@ export struct HomePageBottomCommentComponent { | ||
| 27 | @Link commentNum: number | 27 | @Link commentNum: number |
| 28 | @State isGetRequest: boolean = false | 28 | @State isGetRequest: boolean = false |
| 29 | private scroller: Scroller = new Scroller(); | 29 | private scroller: Scroller = new Scroller(); |
| 30 | - | 30 | + @State bottomCompH:number = 200 |
| 31 | aboutToAppear() { | 31 | aboutToAppear() { |
| 32 | this.getNewPageData() | 32 | this.getNewPageData() |
| 33 | } | 33 | } |
| @@ -107,7 +107,7 @@ export struct HomePageBottomCommentComponent { | @@ -107,7 +107,7 @@ export struct HomePageBottomCommentComponent { | ||
| 107 | //没有更多数据 显示提示 | 107 | //没有更多数据 显示提示 |
| 108 | if (!this.hasMore) { | 108 | if (!this.hasMore) { |
| 109 | ListItem() { | 109 | ListItem() { |
| 110 | - ListHasNoMoreDataUI() | 110 | + ListHasNoMoreDataUI().height(this.bottomCompH > 100 ? this.bottomCompH :100) |
| 111 | } | 111 | } |
| 112 | } | 112 | } |
| 113 | } | 113 | } |
| @@ -172,6 +172,7 @@ export struct HomePageBottomCommentComponent { | @@ -172,6 +172,7 @@ export struct HomePageBottomCommentComponent { | ||
| 172 | parentCommentUserName)) | 172 | parentCommentUserName)) |
| 173 | }) | 173 | }) |
| 174 | 174 | ||
| 175 | + this.bottomCompH = DisplayUtils.getDeviceHeight() - data.length*180 | ||
| 175 | if (status.commentIdList.length === 0) { | 176 | if (status.commentIdList.length === 0) { |
| 176 | 177 | ||
| 177 | if (this.curPageNum === 1) this.data_comment.clear() | 178 | if (this.curPageNum === 1) this.data_comment.clear() |
| @@ -16,6 +16,7 @@ import { SPHelper } from 'wdKit/Index'; | @@ -16,6 +16,7 @@ import { SPHelper } from 'wdKit/Index'; | ||
| 16 | import { SpConstants } from 'wdConstant/Index'; | 16 | import { SpConstants } from 'wdConstant/Index'; |
| 17 | import { photoPickerUtils} from '../../utils/PhotoPickerUtils'; | 17 | import { photoPickerUtils} from '../../utils/PhotoPickerUtils'; |
| 18 | import { cameraPickerUtils } from '../../utils/CameraPickerUtils'; | 18 | import { cameraPickerUtils } from '../../utils/CameraPickerUtils'; |
| 19 | +import { OSSConfigSceneType, OSSFileType, OSSUploadManager, UploadResourceParams } from 'wdHwAbility'; | ||
| 19 | 20 | ||
| 20 | @Entry | 21 | @Entry |
| 21 | @Component | 22 | @Component |
| @@ -102,18 +103,37 @@ struct EditUserInfoPage { | @@ -102,18 +103,37 @@ struct EditUserInfoPage { | ||
| 102 | photoPickerUtils.getPhotoPicker(1).then(value => { | 103 | photoPickerUtils.getPhotoPicker(1).then(value => { |
| 103 | if (value['photoUris'].length > 0) { | 104 | if (value['photoUris'].length > 0) { |
| 104 | this.headerImg = value['photoUris'][0] | 105 | this.headerImg = value['photoUris'][0] |
| 106 | + this.photoCommit() | ||
| 105 | } | 107 | } |
| 106 | }) | 108 | }) |
| 107 | }else { | 109 | }else { |
| 108 | cameraPickerUtils.getCamera().then(value => { | 110 | cameraPickerUtils.getCamera().then(value => { |
| 109 | if (value.length > 0) { | 111 | if (value.length > 0) { |
| 110 | this.headerImg = value | 112 | this.headerImg = value |
| 113 | + this.photoCommit() | ||
| 111 | } | 114 | } |
| 112 | }) | 115 | }) |
| 113 | } | 116 | } |
| 114 | } | 117 | } |
| 115 | 118 | ||
| 116 | 119 | ||
| 120 | + async photoCommit(){ | ||
| 121 | + if (this.headerImg.length > 0) { | ||
| 122 | + try { | ||
| 123 | + let results = await OSSUploadManager.sharedManager().uploadFile(this.headerImg,OSSConfigSceneType.userPhone,OSSFileType.image) | ||
| 124 | + let photoUrl = results.ossFile??'' | ||
| 125 | + if (photoUrl.length > 0) { | ||
| 126 | + this.currentUserInfo.headPhotoUrl = photoUrl | ||
| 127 | + this.currentUserInfo.editDataType = WDEditDataModelType.WDEditDataModelType_head | ||
| 128 | + this.updateEditModel() | ||
| 129 | + } | ||
| 130 | + } catch (exception) { | ||
| 131 | + console.log('请求失败',JSON.stringify(exception)) | ||
| 132 | + } | ||
| 133 | + } | ||
| 134 | + } | ||
| 135 | + | ||
| 136 | + | ||
| 117 | aboutToAppear() { | 137 | aboutToAppear() { |
| 118 | let userType = SPHelper.default.getSync(SpConstants.USER_Type,"") as string | 138 | let userType = SPHelper.default.getSync(SpConstants.USER_Type,"") as string |
| 119 | if (userType && userType.length > 0) { | 139 | if (userType && userType.length > 0) { |
| @@ -145,30 +165,30 @@ struct EditUserInfoPage { | @@ -145,30 +165,30 @@ struct EditUserInfoPage { | ||
| 145 | .height(84) | 165 | .height(84) |
| 146 | .borderRadius(42) | 166 | .borderRadius(42) |
| 147 | 167 | ||
| 148 | - // if (this.headerImg.length === 0){ | ||
| 149 | - // Image('') | ||
| 150 | - // .width('84') | ||
| 151 | - // .height('84') | ||
| 152 | - // .backgroundColor(Color.Gray) | ||
| 153 | - // .opacity(0.7) | ||
| 154 | - // .borderRadius(5) | ||
| 155 | - // .borderRadius(42) | ||
| 156 | - // | ||
| 157 | - // Image($r('app.media.seletct_photo')) | ||
| 158 | - // .width('30') | ||
| 159 | - // .height('30') | ||
| 160 | - // } | 168 | + if (this.headerImg.length === 0){ |
| 169 | + Image('') | ||
| 170 | + .width('84') | ||
| 171 | + .height('84') | ||
| 172 | + .backgroundColor(Color.Gray) | ||
| 173 | + .opacity(0.7) | ||
| 174 | + .borderRadius(5) | ||
| 175 | + .borderRadius(42) | ||
| 176 | + | ||
| 177 | + Image($r('app.media.seletct_photo')) | ||
| 178 | + .width('30') | ||
| 179 | + .height('30') | ||
| 180 | + } | ||
| 161 | }.margin({top:20}) | 181 | }.margin({top:20}) |
| 162 | .onClick(()=>{ | 182 | .onClick(()=>{ |
| 163 | - // this.photoDialogController.open() | 183 | + this.photoDialogController.open() |
| 164 | }) | 184 | }) |
| 165 | 185 | ||
| 166 | ///目前不支持头像上传,暂时屏蔽 | 186 | ///目前不支持头像上传,暂时屏蔽 |
| 167 | - // Button('点击更换头像') | ||
| 168 | - // .fontColor(Color.Gray) | ||
| 169 | - // .fontSize(15) | ||
| 170 | - // .backgroundColor(Color.White) | ||
| 171 | - // .margin({top:10,bottom:20}) | 187 | + Button('点击更换头像') |
| 188 | + .fontColor(Color.Gray) | ||
| 189 | + .fontSize(15) | ||
| 190 | + .backgroundColor(Color.White) | ||
| 191 | + .margin({top:10,bottom:20}) | ||
| 172 | 192 | ||
| 173 | List({}){ | 193 | List({}){ |
| 174 | ForEach(this.listData,(item:EditListInfo,index:number) =>{ | 194 | ForEach(this.listData,(item:EditListInfo,index:number) =>{ |
| @@ -283,8 +303,10 @@ struct EditUserInfoPage { | @@ -283,8 +303,10 @@ struct EditUserInfoPage { | ||
| 283 | EditInfoViewModel.queryAccountOwnerInfo(getContext(this)).then((editModel) => { | 303 | EditInfoViewModel.queryAccountOwnerInfo(getContext(this)).then((editModel) => { |
| 284 | this.listData = [] | 304 | this.listData = [] |
| 285 | if (editModel.userExtend?.headPhotoUrl) { | 305 | if (editModel.userExtend?.headPhotoUrl) { |
| 306 | + if (this.headerImg.length === 0) { | ||
| 286 | this.headerImg = editModel.userExtend.headPhotoUrl | 307 | this.headerImg = editModel.userExtend.headPhotoUrl |
| 287 | } | 308 | } |
| 309 | + } | ||
| 288 | this.currentUserInfo = editModel as editModel; | 310 | this.currentUserInfo = editModel as editModel; |
| 289 | this.listData.push(...EditInfoViewModel.getEditListInfo(editModel)) | 311 | this.listData.push(...EditInfoViewModel.getEditListInfo(editModel)) |
| 290 | }); | 312 | }); |
| @@ -295,7 +317,9 @@ struct EditUserInfoPage { | @@ -295,7 +317,9 @@ struct EditUserInfoPage { | ||
| 295 | this.currentUserInfo.userExtend.introduction = peopleItem.introduction | 317 | this.currentUserInfo.userExtend.introduction = peopleItem.introduction |
| 296 | this.currentUserInfo.userExtend.creatorId = peopleItem.creatorId | 318 | this.currentUserInfo.userExtend.creatorId = peopleItem.creatorId |
| 297 | this.currentUserInfo.userName = peopleItem.userName | 319 | this.currentUserInfo.userName = peopleItem.userName |
| 320 | + if (this.headerImg.length === 0) { | ||
| 298 | this.headerImg = peopleItem.headPhotoUrl | 321 | this.headerImg = peopleItem.headPhotoUrl |
| 322 | + } | ||
| 299 | this.currentUserInfo.userType = Number(this.userType) | 323 | this.currentUserInfo.userType = Number(this.userType) |
| 300 | this.currentUserInfo.userExtend.districtCode = peopleItem.district | 324 | this.currentUserInfo.userExtend.districtCode = peopleItem.district |
| 301 | this.currentUserInfo.userExtend.cityCode = peopleItem.city | 325 | this.currentUserInfo.userExtend.cityCode = peopleItem.city |
| @@ -307,6 +331,7 @@ struct EditUserInfoPage { | @@ -307,6 +331,7 @@ struct EditUserInfoPage { | ||
| 307 | } | 331 | } |
| 308 | 332 | ||
| 309 | getAreaList(){ | 333 | getAreaList(){ |
| 334 | + if (this.dataSource.length > 0) return | ||
| 310 | EditInfoViewModel.getAreaList(getContext(this)).then((value) =>{ | 335 | EditInfoViewModel.getAreaList(getContext(this)).then((value) =>{ |
| 311 | this.dataSource.push(...value) | 336 | this.dataSource.push(...value) |
| 312 | this.getAreaIndex() | 337 | this.getAreaIndex() |
| @@ -12,7 +12,7 @@ export struct ListHasNoMoreDataUI{ | @@ -12,7 +12,7 @@ export struct ListHasNoMoreDataUI{ | ||
| 12 | .lineHeight(20) | 12 | .lineHeight(20) |
| 13 | }.justifyContent(FlexAlign.Center) | 13 | }.justifyContent(FlexAlign.Center) |
| 14 | .width('100%') | 14 | .width('100%') |
| 15 | - .margin({top: 24,bottom: 24}) | 15 | + .margin({top: 15}) |
| 16 | }else if (this.style === 2){ | 16 | }else if (this.style === 2){ |
| 17 | Column(){ | 17 | Column(){ |
| 18 | Image($r('app.media.empty_icon')) | 18 | Image($r('app.media.empty_icon')) |
| 1 | import { CommonConstants } from 'wdConstant'; | 1 | import { CommonConstants } from 'wdConstant'; |
| 2 | import { Logger } from 'wdKit'; | 2 | import { Logger } from 'wdKit'; |
| 3 | +import { router } from '@kit.ArkUI'; | ||
| 3 | 4 | ||
| 4 | const TAG = 'EmptyComponent'; | 5 | const TAG = 'EmptyComponent'; |
| 5 | 6 | ||
| @@ -108,7 +109,19 @@ export struct EmptyComponent { | @@ -108,7 +109,19 @@ export struct EmptyComponent { | ||
| 108 | } | 109 | } |
| 109 | 110 | ||
| 110 | build() { | 111 | build() { |
| 112 | + Stack({alignContent:Alignment.Bottom}) { | ||
| 111 | this.noProgrammeData(); | 113 | this.noProgrammeData(); |
| 114 | + Image($r("app.media.icon_arrow_left_white")) | ||
| 115 | + .width(24) | ||
| 116 | + .height(24) | ||
| 117 | + .onClick(() => { | ||
| 118 | + router.back(); | ||
| 119 | + }) | ||
| 120 | + .position({ | ||
| 121 | + bottom: 15, | ||
| 122 | + left: 16 | ||
| 123 | + }) | ||
| 124 | + } | ||
| 112 | } | 125 | } |
| 113 | 126 | ||
| 114 | /** | 127 | /** |
| @@ -74,6 +74,8 @@ export class editModel{ | @@ -74,6 +74,8 @@ export class editModel{ | ||
| 74 | } | 74 | } |
| 75 | 75 | ||
| 76 | export interface editModelParams { | 76 | export interface editModelParams { |
| 77 | + headPhotoUrl?: string; | ||
| 78 | + | ||
| 77 | editContent?: string; | 79 | editContent?: string; |
| 78 | 80 | ||
| 79 | userName?: string; | 81 | userName?: string; |
| @@ -209,6 +209,7 @@ struct MineHomePage { | @@ -209,6 +209,7 @@ struct MineHomePage { | ||
| 209 | .padding({ left: 16 }) | 209 | .padding({ left: 16 }) |
| 210 | 210 | ||
| 211 | 211 | ||
| 212 | + Column(){ | ||
| 212 | //用户简介区域 | 213 | //用户简介区域 |
| 213 | Column() { | 214 | Column() { |
| 214 | Row() { | 215 | Row() { |
| @@ -246,17 +247,18 @@ struct MineHomePage { | @@ -246,17 +247,18 @@ struct MineHomePage { | ||
| 246 | .fontColor($r('app.color.color_999999')) | 247 | .fontColor($r('app.color.color_999999')) |
| 247 | .textAlign(TextAlign.Start) | 248 | .textAlign(TextAlign.Start) |
| 248 | .margin({ top: 10 }) | 249 | .margin({ top: 10 }) |
| 249 | - | ||
| 250 | } | 250 | } |
| 251 | .padding({ left: 16,right: 16,top: 12,bottom: 12}) | 251 | .padding({ left: 16,right: 16,top: 12,bottom: 12}) |
| 252 | .alignItems(HorizontalAlign.Start) | 252 | .alignItems(HorizontalAlign.Start) |
| 253 | - .justifyContent(FlexAlign.Center) | ||
| 254 | - .width('100%') | ||
| 255 | - .backgroundColor($r('app.color.white')) | ||
| 256 | - //间隔符 | ||
| 257 | 253 | ||
| 254 | + //间隔符 | ||
| 258 | Divider().width('100%').height(6).color($r('app.color.color_F5F5F5')).strokeWidth(6) | 255 | Divider().width('100%').height(6).color($r('app.color.color_F5F5F5')).strokeWidth(6) |
| 259 | 256 | ||
| 257 | + }.width('100%') | ||
| 258 | + .backgroundColor($r('app.color.white')) | ||
| 259 | + .alignItems(HorizontalAlign.Start) | ||
| 260 | + .justifyContent(FlexAlign.Center) | ||
| 261 | + | ||
| 260 | //tab 页面 | 262 | //tab 页面 |
| 261 | Stack({ alignContent: Alignment.Top }){ | 263 | Stack({ alignContent: Alignment.Top }){ |
| 262 | Tabs({controller: this.controller}) { | 264 | Tabs({controller: this.controller}) { |
| @@ -446,6 +448,7 @@ struct MineHomePage { | @@ -446,6 +448,7 @@ struct MineHomePage { | ||
| 446 | .fontWeight(this.currentIndex === index ? 600 : 400) | 448 | .fontWeight(this.currentIndex === index ? 600 : 400) |
| 447 | .fontColor(this.currentIndex === index ? this.selectedFontColor : this.fontColor) | 449 | .fontColor(this.currentIndex === index ? this.selectedFontColor : this.fontColor) |
| 448 | .lineHeight(20) | 450 | .lineHeight(20) |
| 451 | + .height(40) | ||
| 449 | 452 | ||
| 450 | if(this.currentIndex === index){ | 453 | if(this.currentIndex === index){ |
| 451 | Divider() | 454 | Divider() |
| @@ -453,7 +456,7 @@ struct MineHomePage { | @@ -453,7 +456,7 @@ struct MineHomePage { | ||
| 453 | .height(2) | 456 | .height(2) |
| 454 | .color('#ED2800') | 457 | .color('#ED2800') |
| 455 | .strokeWidth(2) | 458 | .strokeWidth(2) |
| 456 | - .margin({top: 35}) | 459 | + .margin({top: 40}) |
| 457 | .id("divTag") | 460 | .id("divTag") |
| 458 | } | 461 | } |
| 459 | }.onClick(()=>{ | 462 | }.onClick(()=>{ |
| @@ -461,7 +464,7 @@ struct MineHomePage { | @@ -461,7 +464,7 @@ struct MineHomePage { | ||
| 461 | this.controller.changeIndex(this.currentIndex) | 464 | this.controller.changeIndex(this.currentIndex) |
| 462 | trackTabFirstClick(index === 0 ? "评论":"关注") | 465 | trackTabFirstClick(index === 0 ? "评论":"关注") |
| 463 | }) | 466 | }) |
| 464 | - .height(35) | 467 | + .height(42) |
| 465 | .width(36) | 468 | .width(36) |
| 466 | .margin({right: 30}) | 469 | .margin({right: 30}) |
| 467 | } | 470 | } |
| @@ -148,7 +148,10 @@ export class PageRepository { | @@ -148,7 +148,10 @@ export class PageRepository { | ||
| 148 | } | 148 | } |
| 149 | 149 | ||
| 150 | static getInteractDataUrl(params: contentInteractParams) { | 150 | static getInteractDataUrl(params: contentInteractParams) { |
| 151 | - let url = HttpUrlUtils.getHost() + HttpUrlUtils.INTERACT_DATA_PATH; | 151 | + let url = HttpUrlUtils.getHost() + HttpUrlUtils.INTERACT_V2_DATA_PATH; |
| 152 | + if (params.contentType == 8 && params.readFlag != 1) { | ||
| 153 | + url = HttpUrlUtils.getHost() + HttpUrlUtils.INTERACT_DATA_PATH; | ||
| 154 | + } | ||
| 152 | url = url + "?contentId=" + params.contentId | 155 | url = url + "?contentId=" + params.contentId |
| 153 | + "&contentType=" + params.contentType | 156 | + "&contentType=" + params.contentType |
| 154 | if (!StringUtils.isEmpty(params.contentRelId)) { | 157 | if (!StringUtils.isEmpty(params.contentRelId)) { |
| @@ -142,6 +142,7 @@ class EditInfoViewModel { | @@ -142,6 +142,7 @@ class EditInfoViewModel { | ||
| 142 | 142 | ||
| 143 | if (item.userType === 1){ | 143 | if (item.userType === 1){ |
| 144 | if (item.editDataType == WDEditDataModelType.WDEditDataModelType_head) { | 144 | if (item.editDataType == WDEditDataModelType.WDEditDataModelType_head) { |
| 145 | + this.params = { headPhotoUrl: item.headPhotoUrl } | ||
| 145 | } else if (item.editDataType == WDEditDataModelType.WDEditDataModelType_nickname) { | 146 | } else if (item.editDataType == WDEditDataModelType.WDEditDataModelType_nickname) { |
| 146 | this.params = { userName: item.userName } | 147 | this.params = { userName: item.userName } |
| 147 | } | 148 | } |
| @@ -176,6 +177,7 @@ class EditInfoViewModel { | @@ -176,6 +177,7 @@ class EditInfoViewModel { | ||
| 176 | }else { | 177 | }else { |
| 177 | let url = '' | 178 | let url = '' |
| 178 | if (item.editDataType == WDEditDataModelType.WDEditDataModelType_head) { | 179 | if (item.editDataType == WDEditDataModelType.WDEditDataModelType_head) { |
| 180 | + this.params = { headPhotoUrl: item.headPhotoUrl} | ||
| 179 | url = '/api/rmrb-creator-user/c/rmrb-creator-user/creator/updateIcon' | 181 | url = '/api/rmrb-creator-user/c/rmrb-creator-user/creator/updateIcon' |
| 180 | } else if (item.editDataType == WDEditDataModelType.WDEditDataModelType_nickname) { | 182 | } else if (item.editDataType == WDEditDataModelType.WDEditDataModelType_nickname) { |
| 181 | this.params = { name: item.userName} | 183 | this.params = { name: item.userName} |
| @@ -13,6 +13,8 @@ export class MineUserDetailItem{ | @@ -13,6 +13,8 @@ export class MineUserDetailItem{ | ||
| 13 | honoraryIcon = ""//荣誉称号 (优先) | 13 | honoraryIcon = ""//荣誉称号 (优先) |
| 14 | avatarFrame:string = ""//最佳评论员头像框地址 | 14 | avatarFrame:string = ""//最佳评论员头像框地址 |
| 15 | 15 | ||
| 16 | + province:string = "" | ||
| 17 | + region:string = "" | ||
| 16 | 18 | ||
| 17 | 19 | ||
| 18 | } | 20 | } |
| @@ -4,6 +4,7 @@ import { Logger, StringUtils } from 'wdKit/Index' | @@ -4,6 +4,7 @@ import { Logger, StringUtils } from 'wdKit/Index' | ||
| 4 | import { WDRouterRule } from 'wdRouter' | 4 | import { WDRouterRule } from 'wdRouter' |
| 5 | import { ExtraDTO } from 'wdBean/src/main/ets/bean/component/extra/ExtraDTO' | 5 | import { ExtraDTO } from 'wdBean/src/main/ets/bean/component/extra/ExtraDTO' |
| 6 | import { LiveMessageOptType, LiveMessageRole } from 'wdBean/src/main/ets/bean/live/LiveRoomBean' | 6 | import { LiveMessageOptType, LiveMessageRole } from 'wdBean/src/main/ets/bean/live/LiveRoomBean' |
| 7 | +import { LengthMetrics, LengthUnit } from '@kit.ArkUI' | ||
| 7 | 8 | ||
| 8 | const TAG = "TabChatItemComponent" | 9 | const TAG = "TabChatItemComponent" |
| 9 | 10 | ||
| @@ -68,14 +69,20 @@ export struct TabChatItemComponent { | @@ -68,14 +69,20 @@ export struct TabChatItemComponent { | ||
| 68 | Span(' 主持人 ') | 69 | Span(' 主持人 ') |
| 69 | .fontSize(11) | 70 | .fontSize(11) |
| 70 | .lineHeight(20) | 71 | .lineHeight(20) |
| 71 | - .textBackgroundStyle({ color: "#70FFC63F", radius: 2 }) | 72 | + .textBackgroundStyle({ color: "#F1EFEB"}) |
| 73 | + .baselineOffset(new LengthMetrics(5,LengthUnit.PX)) | ||
| 74 | + .fontColor('#968562') | ||
| 75 | + .borderRadius(2) | ||
| 72 | Span(' ') | 76 | Span(' ') |
| 73 | } | 77 | } |
| 74 | if (this.item.role == LiveMessageRole.guest) { | 78 | if (this.item.role == LiveMessageRole.guest) { |
| 75 | Span(' 嘉宾 ') | 79 | Span(' 嘉宾 ') |
| 76 | .fontSize(11) | 80 | .fontSize(11) |
| 77 | .lineHeight(20) | 81 | .lineHeight(20) |
| 78 | - .textBackgroundStyle({ color: "#70FFC63F", radius: 2 }) | 82 | + .textBackgroundStyle({ color: "#F1EFEB"}) |
| 83 | + .baselineOffset(new LengthMetrics(5,LengthUnit.PX)) | ||
| 84 | + .fontColor('#968562') | ||
| 85 | + .borderRadius(2) | ||
| 79 | Span(' ') | 86 | Span(' ') |
| 80 | } | 87 | } |
| 81 | Span("回复了 ").fontColor('#222222') | 88 | Span("回复了 ").fontColor('#222222') |
| @@ -59,7 +59,7 @@ export struct PlayerUIComponent { | @@ -59,7 +59,7 @@ export struct PlayerUIComponent { | ||
| 59 | } | 59 | } |
| 60 | this.isFullScreen = true | 60 | this.isFullScreen = true |
| 61 | }) | 61 | }) |
| 62 | - .visibility(!this.isFullScreen ? Visibility.Visible : Visibility.Hidden) | 62 | + .visibility(!this.isFullScreen && this.isSmall ? Visibility.Visible : Visibility.Hidden) |
| 63 | .margin({ top: 301}) // 195 + 211 - 105 | 63 | .margin({ top: 301}) // 195 + 211 - 105 |
| 64 | .position({ x: '96.8%' }) | 64 | .position({ x: '96.8%' }) |
| 65 | .markAnchor({ x: '96.8%' }) | 65 | .markAnchor({ x: '96.8%' }) |
| @@ -62,36 +62,36 @@ export struct PlayerVideoControlComponent { | @@ -62,36 +62,36 @@ export struct PlayerVideoControlComponent { | ||
| 62 | }) | 62 | }) |
| 63 | } | 63 | } |
| 64 | //全屏按钮 | 64 | //全屏按钮 |
| 65 | - if(!this.isSmall) { | ||
| 66 | - Image($r('app.media.icon_live_player_full_screen')) | ||
| 67 | - .height(32) | ||
| 68 | - .width(32) | ||
| 69 | - .padding(5) | ||
| 70 | - .borderRadius($r('app.float.vp_16')) | ||
| 71 | - .border({width:0.5}) | ||
| 72 | - .borderColor(0x4DFFFFFF) | ||
| 73 | - .backgroundColor(0x4D222222) | ||
| 74 | - .margin({right:10}) | ||
| 75 | - .onClick(() => { | ||
| 76 | - WindowModel.shared.setSpecificSystemBarEnabled(false) | ||
| 77 | - this.displayDirection = DisplayDirection.VIDEO_HORIZONTAL | ||
| 78 | - WindowModel.shared.setPreferredOrientation( | ||
| 79 | - window.Orientation.LANDSCAPE) | ||
| 80 | - if(this.playerController){ | ||
| 81 | - // if(this.playerController.onVideoSizePlayerUIComponentMethod){ | ||
| 82 | - // this.playerController.onVideoSizePlayerUIComponentMethod(1,2) | 65 | + // if(!this.isSmall) { |
| 66 | + // Image($r('app.media.icon_live_player_full_screen')) | ||
| 67 | + // .height(32) | ||
| 68 | + // .width(32) | ||
| 69 | + // .padding(5) | ||
| 70 | + // .borderRadius($r('app.float.vp_16')) | ||
| 71 | + // .border({width:0.5}) | ||
| 72 | + // .borderColor(0x4DFFFFFF) | ||
| 73 | + // .backgroundColor(0x4D222222) | ||
| 74 | + // .margin({right:10}) | ||
| 75 | + // .onClick(() => { | ||
| 76 | + // WindowModel.shared.setSpecificSystemBarEnabled(false) | ||
| 77 | + // this.displayDirection = DisplayDirection.VIDEO_HORIZONTAL | ||
| 78 | + // WindowModel.shared.setPreferredOrientation( | ||
| 79 | + // window.Orientation.LANDSCAPE) | ||
| 80 | + // if(this.playerController){ | ||
| 81 | + // // if(this.playerController.onVideoSizePlayerUIComponentMethod){ | ||
| 82 | + // // this.playerController.onVideoSizePlayerUIComponentMethod(1,2) | ||
| 83 | + // // } | ||
| 84 | + // if(this.playerController.onVideoSizePlayerComponentBack){ | ||
| 85 | + // this.playerController.onVideoSizePlayerComponentBack(1,2) | ||
| 86 | + // } | ||
| 87 | + // | ||
| 88 | + // if(this.playerController.onVideoSizePlayerTitleComponentBack){ | ||
| 89 | + // this.playerController.onVideoSizePlayerTitleComponentBack(1,2) | ||
| 90 | + // } | ||
| 91 | + // } | ||
| 92 | + // this.isFullScreen = true | ||
| 93 | + // }) | ||
| 83 | // } | 94 | // } |
| 84 | - if(this.playerController.onVideoSizePlayerComponentBack){ | ||
| 85 | - this.playerController.onVideoSizePlayerComponentBack(1,2) | ||
| 86 | - } | ||
| 87 | - | ||
| 88 | - if(this.playerController.onVideoSizePlayerTitleComponentBack){ | ||
| 89 | - this.playerController.onVideoSizePlayerTitleComponentBack(1,2) | ||
| 90 | - } | ||
| 91 | - } | ||
| 92 | - this.isFullScreen = true | ||
| 93 | - }) | ||
| 94 | - } | ||
| 95 | } | 95 | } |
| 96 | .alignItems(VerticalAlign.Center) | 96 | .alignItems(VerticalAlign.Center) |
| 97 | // .linearGradient({ angle: 0, colors: [['#99000000', 0], ['#00000000', 1]] }) | 97 | // .linearGradient({ angle: 0, colors: [['#99000000', 0], ['#00000000', 1]] }) |
| @@ -71,7 +71,7 @@ export struct PlayerTitleView { | @@ -71,7 +71,7 @@ export struct PlayerTitleView { | ||
| 71 | * @returns {string} clipStr 截断后的文本 '啊啊' | 71 | * @returns {string} clipStr 截断后的文本 '啊啊' |
| 72 | */ | 72 | */ |
| 73 | clipText(str: string, fontSize: number, maxLines: number, textWidth: number): string { | 73 | clipText(str: string, fontSize: number, maxLines: number, textWidth: number): string { |
| 74 | - let strArr: string[] = str.split("") | 74 | + let strArr: string[] = str.replace(/\n/g, '').split("") |
| 75 | let truncateContent: string = '啊啊啊啊啊啊' // ...比正常文字宽度更小,这里使用啊啊啊(任意三个文字)代替计算 | 75 | let truncateContent: string = '啊啊啊啊啊啊' // ...比正常文字宽度更小,这里使用啊啊啊(任意三个文字)代替计算 |
| 76 | let measureTruncateWidth: number = measure.measureText({ | 76 | let measureTruncateWidth: number = measure.measureText({ |
| 77 | textContent: truncateContent, | 77 | textContent: truncateContent, |
| @@ -219,7 +219,7 @@ export struct PlayerTitleView { | @@ -219,7 +219,7 @@ export struct PlayerTitleView { | ||
| 219 | // } else { | 219 | // } else { |
| 220 | if (this.summary && this.titleLines < 4) { | 220 | if (this.summary && this.titleLines < 4) { |
| 221 | Text() { | 221 | Text() { |
| 222 | - Span(this.clipText(this.summary, 14, this.summaryLines, this.windowWidth - 150 - vp2px(50))) | 222 | + Span(this.clipText(this.summary, 14, this.summaryLines, this.windowWidth - 160 - vp2px(50))) |
| 223 | .fontSize(14) | 223 | .fontSize(14) |
| 224 | .fontColor(Color.White) | 224 | .fontColor(Color.White) |
| 225 | .lineHeight(21) | 225 | .lineHeight(21) |
| @@ -11,7 +11,7 @@ import { putObject } from './upload' | @@ -11,7 +11,7 @@ import { putObject } from './upload' | ||
| 11 | 11 | ||
| 12 | export enum OSSConfigSceneType { | 12 | export enum OSSConfigSceneType { |
| 13 | feedback = "feedback", | 13 | feedback = "feedback", |
| 14 | - | 14 | + userPhone = 'userPhone' |
| 15 | } | 15 | } |
| 16 | 16 | ||
| 17 | export enum OSSFileType { | 17 | export enum OSSFileType { |
-
Please register or login to post a comment