Merge branch 'main' of http://192.168.1.42/developOne/harmonyPool into main
* 'main' of http://192.168.1.42/developOne/harmonyPool: fix: 横版视频全屏LANDSCAPE_INVERTED替换为LANDSCAPE fix |> 修复uat环境--热点频道下无图卡下缺少评论问题 fix: 横版视频详情页,全屏按钮位置和样式与安卓不一致 fix: 稿件详情点赞数字使用系统字体 fix: 人民号动态图片上下滑动未能返回上一级 fix |> 修复进入专题页面状态栏字体颜色由H5前端控制 fix |> 频道编辑页首页设置问题修复 ref |> 临时把mpaas屏蔽,解决可能崩溃问题 fix: 我的>收藏-缺省图与安卓不一致 fix: 竖屏直播回看bug 删除 string.json 中EntryAbility_desc和EntryAbility_label 变量
Showing
30 changed files
with
339 additions
and
264 deletions
| @@ -27,6 +27,10 @@ | @@ -27,6 +27,10 @@ | ||
| 27 | { | 27 | { |
| 28 | "name": "location_reason", | 28 | "name": "location_reason", |
| 29 | "value": " " | 29 | "value": " " |
| 30 | + }, | ||
| 31 | + { | ||
| 32 | + "name": "STORE_PERSISTENT_DATA", | ||
| 33 | + "value": "STORE_PERSISTENT_DATASTORE_PERSISTENT_DATASTORE_PERSISTENT_DATA" | ||
| 30 | } | 34 | } |
| 31 | ] | 35 | ] |
| 32 | } | 36 | } |
| @@ -24,8 +24,8 @@ interface dataObject { | @@ -24,8 +24,8 @@ interface dataObject { | ||
| 24 | // 9、活动投稿 视频跳转 | 24 | // 9、活动投稿 视频跳转 |
| 25 | // 10、活动投稿 动态跳转 | 25 | // 10、活动投稿 动态跳转 |
| 26 | // 11、活动投稿 图集跳转 | 26 | // 11、活动投稿 图集跳转 |
| 27 | - dataSource: WDH5WebDataSource | ||
| 28 | - operateType?: string | 27 | + dataSource?: WDH5WebDataSource |
| 28 | + operateType?: WDH5WebPageOperationType | ||
| 29 | webViewHeight?: string | 29 | webViewHeight?: string |
| 30 | dataJson?: string | 30 | dataJson?: string |
| 31 | appInnerLink?: string | 31 | appInnerLink?: string |
| @@ -39,6 +39,7 @@ interface dataObject { | @@ -39,6 +39,7 @@ interface dataObject { | ||
| 39 | positionTop?: string | 39 | positionTop?: string |
| 40 | videoLandscape?: string | 40 | videoLandscape?: string |
| 41 | imgListData?: string | 41 | imgListData?: string |
| 42 | + statusBarMode?: string | ||
| 42 | } | 43 | } |
| 43 | 44 | ||
| 44 | /** | 45 | /** |
| @@ -85,4 +86,41 @@ export enum WDH5WebDataSource { | @@ -85,4 +86,41 @@ export enum WDH5WebDataSource { | ||
| 85 | WDH5WebDataSourcePartinActivityPublishVideo = 9, | 86 | WDH5WebDataSourcePartinActivityPublishVideo = 9, |
| 86 | WDH5WebDataSourcePartinActivityPublishDynamic = 10, | 87 | WDH5WebDataSourcePartinActivityPublishDynamic = 10, |
| 87 | WDH5WebDataSourcePartinActivityPublishPicture = 11, | 88 | WDH5WebDataSourcePartinActivityPublishPicture = 11, |
| 88 | -} | ||
| 89 | +} | ||
| 90 | + | ||
| 91 | +export enum WDH5WebPageOperationType { | ||
| 92 | + WDH5WebPageOperationTypeClose = '1', | ||
| 93 | + WDH5WebPageOperationTypeReload = '2', | ||
| 94 | + WDH5WebPageOperationTypeGoBack = '3', | ||
| 95 | + WDH5WebPageOperationTypePlayerVideoFor4G = '4', | ||
| 96 | + WDH5WebPageOperationTypeEmailSubscribeHasClosed = '5', | ||
| 97 | + WDH5WebPageOperationTypeHeightUpdate = '8', | ||
| 98 | + WDH5WebPageOperationTypeVideoPlay = '9', // 让App开始播放视频 | ||
| 99 | + WDH5WebPageOperationTypeAudioPlayed = '10', // H5开始播放音频 (做互斥用) | ||
| 100 | + WDH5WebPageOperationTypeCloseAppNavigationBar = '12', | ||
| 101 | + WDH5WebPageOperationTypeOpenAppNavigationBar = '13', | ||
| 102 | + WDH5WebPageOperationTypeCloseBottomBar = '14', | ||
| 103 | + WDH5WebPageOperationTypeOpenBottomBar = '15', | ||
| 104 | + WDH5WebPageOperationTypeShowNavigationShareButton = '16', | ||
| 105 | + WDH5WebPageOperationTypeHiddenNavigationShareButton = '17', | ||
| 106 | + WDH5WebPageOperationTypeSetTitle = '18', | ||
| 107 | + WDH5WebPageOperationTypeSetStatusBar = '19', | ||
| 108 | + WDH5WebPageOperationTypeBottomBarMaskViewShow = '20', | ||
| 109 | + WDH5WebPageOperationTypeBottomBarMaskViewHidden = '21', | ||
| 110 | + WDH5WebPageOperationTypeRetry = '22', | ||
| 111 | + WDH5WebPageOperationTypeCreatorFollowStatusChanged = '24', | ||
| 112 | + | ||
| 113 | + WDH5WebPageOperationTypeStartPopupAlert = '32', //(原生代码确保Webview底部到底) | ||
| 114 | + WDH5WebPageOperationTypeEndPopupAlert = '33', | ||
| 115 | + | ||
| 116 | + WDH5WebPageOperationTypeSkipHomePage = '40', | ||
| 117 | + WDH5WebPageOperationTypeSkipScoreCenterSign = '41', | ||
| 118 | + WDH5WebPageOperationTypeSkipFeedbackPage = '42', | ||
| 119 | + WDH5WebPageOperationTypeSkipFollowListPage = '43', | ||
| 120 | + | ||
| 121 | + WDH5WebPageOperationTypeShowLoading = '47', | ||
| 122 | + WDH5WebPageOperationTypeHiddenLoading = '48', | ||
| 123 | + | ||
| 124 | + WDH5WebPageOperationTypeVideoRectChange = '49', // 修改App视频尺寸 (暂未使用) | ||
| 125 | + | ||
| 126 | +}; |
| @@ -10,8 +10,8 @@ | @@ -10,8 +10,8 @@ | ||
| 10 | "@tingyun/harmonyos": "file:./src/main/ets/tingyunAPM/tingyun_0.0.6.har", | 10 | "@tingyun/harmonyos": "file:./src/main/ets/tingyunAPM/tingyun_0.0.6.har", |
| 11 | "@umeng/common": "^1.0.21", | 11 | "@umeng/common": "^1.0.21", |
| 12 | "@umeng/analytics": "^1.0.19", | 12 | "@umeng/analytics": "^1.0.19", |
| 13 | - "@mpaas/udid": "0.0.2", | ||
| 14 | - "@mpaas/upgrade": "0.0.2", | ||
| 15 | - "@mpaas/framework": "0.0.2" | 13 | +// "@mpaas/udid": "0.0.3", |
| 14 | +// "@mpaas/upgrade": "0.0.3", | ||
| 15 | +// "@mpaas/framework": "0.0.3" | ||
| 16 | } | 16 | } |
| 17 | } | 17 | } |
| 1 | -import { MPUpgradeService } from '@mpaas/upgrade' | ||
| 2 | -import { upgradeRes } from '@mpaas/upgrade/src/main/ets/t4/a' | 1 | +// import { MPUpgradeService } from '@mpaas/upgrade' |
| 2 | +// import { upgradeRes } from '@mpaas/upgrade/src/main/ets/t4/a' | ||
| 3 | import { AppUtils } from '../utils/AppUtils' | 3 | import { AppUtils } from '../utils/AppUtils' |
| 4 | import { SPHelper } from '../utils/SPHelper' | 4 | import { SPHelper } from '../utils/SPHelper' |
| 5 | 5 | ||
| @@ -16,7 +16,7 @@ export class MpaasUpgradeCheck { | @@ -16,7 +16,7 @@ export class MpaasUpgradeCheck { | ||
| 16 | /// 默认提示框 | 16 | /// 默认提示框 |
| 17 | checkNewVersionAndShow() { | 17 | checkNewVersionAndShow() { |
| 18 | try { | 18 | try { |
| 19 | - MPUpgradeService.checkNewVersionAndShow() | 19 | + // MPUpgradeService.checkNewVersionAndShow() |
| 20 | } catch (error) { | 20 | } catch (error) { |
| 21 | console.log("mpaas upgrade fail", JSON.stringify(error)) | 21 | console.log("mpaas upgrade fail", JSON.stringify(error)) |
| 22 | } | 22 | } |
| @@ -25,69 +25,70 @@ export class MpaasUpgradeCheck { | @@ -25,69 +25,70 @@ export class MpaasUpgradeCheck { | ||
| 25 | checkNewVersion(): Promise<UpgradeTipContent | null> { | 25 | checkNewVersion(): Promise<UpgradeTipContent | null> { |
| 26 | 26 | ||
| 27 | return new Promise((resolve, fail) => { | 27 | return new Promise((resolve, fail) => { |
| 28 | - MPUpgradeService.checkNewVersion().then((response)=>{ | ||
| 29 | - let str = JSON.stringify(response) | ||
| 30 | - console.log("mpaas upgrade check", str) | ||
| 31 | - | ||
| 32 | - /* | ||
| 33 | - { | ||
| 34 | - "android64FileSize": 0, | ||
| 35 | - "downloadURL": "https://appgallery.huawei.com/#/app", | ||
| 36 | - "fileSize": 0, | ||
| 37 | - "fullMd5": "no md5", | ||
| 38 | - "guideMemo": "欢迎使用新版本", | ||
| 39 | - "isWifi": 0, | ||
| 40 | - "netType": "ALL", | ||
| 41 | - "newestVersion": "1.0.1", | ||
| 42 | - "resultStatus": 204, | ||
| 43 | - "silentType": 0, | ||
| 44 | - "upgradeVersion": "1.0.1" | ||
| 45 | - }*/ | ||
| 46 | - | ||
| 47 | - let res = response as upgradeRes | ||
| 48 | - | ||
| 49 | - // AliUpgradeNewVersion = 201, /*当前使用的已是最新版本*/ | ||
| 50 | - // AliUpgradeOneTime = 202, /*客户端已有新版本,单次提醒*/ | ||
| 51 | - // AliUpgradeForceUpdate = 203, /*客户端已有新版本,强制升级(已废弃)*/ | ||
| 52 | - // AliUpgradeEveryTime = 204, /*客户端已有新版本,多次提醒*/ | ||
| 53 | - // AliUpgradeRejectLogin = 205, /*限制登录(已废弃)*/ | ||
| 54 | - // AliUpgradeForceUpdateWithLogin = 206 /*客户端已有新版本,强制升级*/ | ||
| 55 | - | ||
| 56 | - const currentAppVersoin = AppUtils.getAppVersionName() | ||
| 57 | - | ||
| 58 | - if (res.resultStatus == 201) { | ||
| 59 | - resolve(null) | ||
| 60 | - return | ||
| 61 | - } | ||
| 62 | - | ||
| 63 | - // 单次升级控制 | ||
| 64 | - if (res.resultStatus == 202) { | ||
| 65 | - const oldOnceValue = SPHelper.default.getSync("upgradeOnceKey", false) as boolean | ||
| 66 | - if (true == oldOnceValue) { | ||
| 67 | - resolve(null) | ||
| 68 | - return | ||
| 69 | - } | ||
| 70 | - SPHelper.default.save("upgradeOnceKey", true) | ||
| 71 | - } else { | ||
| 72 | - SPHelper.default.save("upgradeOnceKey", false) | ||
| 73 | - } | ||
| 74 | - | ||
| 75 | - if (res.resultStatus == 202 || res.resultStatus == 204 || res.resultStatus == 206) { | ||
| 76 | - let content: UpgradeTipContent = { | ||
| 77 | - content: res.guideMemo, | ||
| 78 | - newVersion: res.upgradeVersion, | ||
| 79 | - downloadUrl: res.downloadURL, | ||
| 80 | - forceUpgrade: res.resultStatus == 206 | ||
| 81 | - } | ||
| 82 | - resolve(content) | ||
| 83 | - return | ||
| 84 | - } | ||
| 85 | - | ||
| 86 | - resolve(null) | ||
| 87 | - }).catch((error: Error) => { | ||
| 88 | - console.log("mpaas upgrade fail", `name: ${error.name}, message: ${error.message}, \nstack: ${error.stack}`) | ||
| 89 | - fail("检测升级失败") | ||
| 90 | - }) | 28 | + fail("a") |
| 29 | + // MPUpgradeService.checkNewVersion().then((response)=>{ | ||
| 30 | + // let str = JSON.stringify(response) | ||
| 31 | + // console.log("mpaas upgrade check", str) | ||
| 32 | + // | ||
| 33 | + // /* | ||
| 34 | + // { | ||
| 35 | + // "android64FileSize": 0, | ||
| 36 | + // "downloadURL": "https://appgallery.huawei.com/#/app", | ||
| 37 | + // "fileSize": 0, | ||
| 38 | + // "fullMd5": "no md5", | ||
| 39 | + // "guideMemo": "欢迎使用新版本", | ||
| 40 | + // "isWifi": 0, | ||
| 41 | + // "netType": "ALL", | ||
| 42 | + // "newestVersion": "1.0.1", | ||
| 43 | + // "resultStatus": 204, | ||
| 44 | + // "silentType": 0, | ||
| 45 | + // "upgradeVersion": "1.0.1" | ||
| 46 | + // }*/ | ||
| 47 | + // | ||
| 48 | + // let res = response as upgradeRes | ||
| 49 | + // | ||
| 50 | + // // AliUpgradeNewVersion = 201, /*当前使用的已是最新版本*/ | ||
| 51 | + // // AliUpgradeOneTime = 202, /*客户端已有新版本,单次提醒*/ | ||
| 52 | + // // AliUpgradeForceUpdate = 203, /*客户端已有新版本,强制升级(已废弃)*/ | ||
| 53 | + // // AliUpgradeEveryTime = 204, /*客户端已有新版本,多次提醒*/ | ||
| 54 | + // // AliUpgradeRejectLogin = 205, /*限制登录(已废弃)*/ | ||
| 55 | + // // AliUpgradeForceUpdateWithLogin = 206 /*客户端已有新版本,强制升级*/ | ||
| 56 | + // | ||
| 57 | + // const currentAppVersoin = AppUtils.getAppVersionName() | ||
| 58 | + // | ||
| 59 | + // if (res.resultStatus == 201) { | ||
| 60 | + // resolve(null) | ||
| 61 | + // return | ||
| 62 | + // } | ||
| 63 | + // | ||
| 64 | + // // 单次升级控制 | ||
| 65 | + // if (res.resultStatus == 202) { | ||
| 66 | + // const oldOnceValue = SPHelper.default.getSync("upgradeOnceKey", false) as boolean | ||
| 67 | + // if (true == oldOnceValue) { | ||
| 68 | + // resolve(null) | ||
| 69 | + // return | ||
| 70 | + // } | ||
| 71 | + // SPHelper.default.save("upgradeOnceKey", true) | ||
| 72 | + // } else { | ||
| 73 | + // SPHelper.default.save("upgradeOnceKey", false) | ||
| 74 | + // } | ||
| 75 | + // | ||
| 76 | + // if (res.resultStatus == 202 || res.resultStatus == 204 || res.resultStatus == 206) { | ||
| 77 | + // let content: UpgradeTipContent = { | ||
| 78 | + // content: res.guideMemo, | ||
| 79 | + // newVersion: res.upgradeVersion, | ||
| 80 | + // downloadUrl: res.downloadURL, | ||
| 81 | + // forceUpgrade: res.resultStatus == 206 | ||
| 82 | + // } | ||
| 83 | + // resolve(content) | ||
| 84 | + // return | ||
| 85 | + // } | ||
| 86 | + // | ||
| 87 | + // resolve(null) | ||
| 88 | + // }).catch((error: Error) => { | ||
| 89 | + // console.log("mpaas upgrade fail", `name: ${error.name}, message: ${error.message}, \nstack: ${error.stack}`) | ||
| 90 | + // fail("检测升级失败") | ||
| 91 | + // }) | ||
| 91 | }) | 92 | }) |
| 92 | } | 93 | } |
| 93 | } | 94 | } |
| 1 | -import { MPFramework } from '@mpaas/framework' | 1 | +// import { MPFramework } from '@mpaas/framework' |
| 2 | import { common } from '@kit.AbilityKit'; | 2 | import { common } from '@kit.AbilityKit'; |
| 3 | 3 | ||
| 4 | /* | 4 | /* |
| @@ -12,17 +12,18 @@ export class MpaasUtils { | @@ -12,17 +12,18 @@ export class MpaasUtils { | ||
| 12 | 12 | ||
| 13 | // 启动时onCreate()方法调用 | 13 | // 启动时onCreate()方法调用 |
| 14 | static initApp(context: common.UIAbilityContext) { | 14 | static initApp(context: common.UIAbilityContext) { |
| 15 | - MPFramework.create(context); | 15 | + // MPFramework.create(context); |
| 16 | } | 16 | } |
| 17 | 17 | ||
| 18 | // 获取mPaaS utdid | 18 | // 获取mPaaS utdid |
| 19 | static async mpaasUtdid() { | 19 | static async mpaasUtdid() { |
| 20 | - let utdid = await MPFramework.instance.udid | 20 | + // let utdid = await MPFramework.instance.udid |
| 21 | + let utdid = "xxxxxxxxxx" | ||
| 21 | return utdid | 22 | return utdid |
| 22 | } | 23 | } |
| 23 | 24 | ||
| 24 | // 登录和退出登录调用,用来管理白名单用 | 25 | // 登录和退出登录调用,用来管理白名单用 |
| 25 | static setupUserId(userId?: string) { | 26 | static setupUserId(userId?: string) { |
| 26 | - MPFramework.instance.userId = userId | 27 | + // MPFramework.instance.userId = userId |
| 27 | } | 28 | } |
| 28 | } | 29 | } |
| @@ -5,8 +5,9 @@ import { setDefaultNativeWebSettings } from './WebComponentUtil'; | @@ -5,8 +5,9 @@ import { setDefaultNativeWebSettings } from './WebComponentUtil'; | ||
| 5 | import { Action } from 'wdBean'; | 5 | import { Action } from 'wdBean'; |
| 6 | import { performJSCallNative } from './JsBridgeBiz'; | 6 | import { performJSCallNative } from './JsBridgeBiz'; |
| 7 | import { H5CallNativeType } from './H5CallNativeType'; | 7 | import { H5CallNativeType } from './H5CallNativeType'; |
| 8 | -import { Message,WDH5WebDataSource } from 'wdJsBridge/src/main/ets/bean/Message'; | 8 | +import { Message,WDH5WebDataSource,WDH5WebPageOperationType } from 'wdJsBridge/src/main/ets/bean/Message'; |
| 9 | import { JSON } from '@kit.ArkTS'; | 9 | import { JSON } from '@kit.ArkTS'; |
| 10 | +import { WindowModel } from 'wdKit'; | ||
| 10 | 11 | ||
| 11 | const TAG = 'WdWebComponent'; | 12 | const TAG = 'WdWebComponent'; |
| 12 | 13 | ||
| @@ -84,7 +85,18 @@ export struct WdWebComponent { | @@ -84,7 +85,18 @@ export struct WdWebComponent { | ||
| 84 | } | 85 | } |
| 85 | } | 86 | } |
| 86 | 87 | ||
| 88 | + if (data.handlerName === H5CallNativeType.jsCall_currentPageOperate) { | ||
| 89 | + this.jsCall_currentPageOperate(data) | ||
| 90 | + return | ||
| 91 | + } | ||
| 92 | + } | ||
| 93 | + | ||
| 94 | + private jsCall_currentPageOperate(data: Message) { | ||
| 95 | + if (data.data?.operateType == WDH5WebPageOperationType.WDH5WebPageOperationTypeSetStatusBar) { | ||
| 96 | + WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: data.data?.statusBarMode =='2'?'#ffffff':'#000000'}) | ||
| 97 | + } | ||
| 87 | } | 98 | } |
| 99 | + | ||
| 88 | onPageBegin: (url?: string) => void = () => { | 100 | onPageBegin: (url?: string) => void = () => { |
| 89 | Logger.debug(TAG, 'onPageBegin'); | 101 | Logger.debug(TAG, 'onPageBegin'); |
| 90 | this.registerHandlers(); | 102 | this.registerHandlers(); |
| @@ -32,8 +32,8 @@ import { CommentComponent } from '../components/comment/view/CommentComponent' | @@ -32,8 +32,8 @@ import { CommentComponent } from '../components/comment/view/CommentComponent' | ||
| 32 | import { HttpUtils } from 'wdNetwork/Index'; | 32 | import { HttpUtils } from 'wdNetwork/Index'; |
| 33 | import { viewBlogItemInsightIntentShare } from '../utils/InsightIntentShare' | 33 | import { viewBlogItemInsightIntentShare } from '../utils/InsightIntentShare' |
| 34 | import { common } from '@kit.AbilityKit'; | 34 | import { common } from '@kit.AbilityKit'; |
| 35 | -import { componentUtils, window } from '@kit.ArkUI'; | ||
| 36 | -import { TrackConstants, TrackingButton, TrackingContent, TrackingPageBrowse } from 'wdTracking/Index'; | 35 | +import { componentUtils } from '@kit.ArkUI'; |
| 36 | +import { TrackConstants, TrackingContent, TrackingPageBrowse } from 'wdTracking/Index'; | ||
| 37 | 37 | ||
| 38 | const PATTERN_DATE_CN_RN: string = 'yyyy年MM月dd日 HH:mm'; | 38 | const PATTERN_DATE_CN_RN: string = 'yyyy年MM月dd日 HH:mm'; |
| 39 | 39 | ||
| @@ -117,8 +117,10 @@ export struct ImageAndTextPageComponent { | @@ -117,8 +117,10 @@ export struct ImageAndTextPageComponent { | ||
| 117 | Text(NumberFormatterUtils.formatNumberWithWan(this.likeNum)) | 117 | Text(NumberFormatterUtils.formatNumberWithWan(this.likeNum)) |
| 118 | .fontSize(16) | 118 | .fontSize(16) |
| 119 | .fontColor(this.newsStatusOfUser?.likeStatus == '1' ? '#ED2800' : '#999999') | 119 | .fontColor(this.newsStatusOfUser?.likeStatus == '1' ? '#ED2800' : '#999999') |
| 120 | - .fontWeight(500) | 120 | + .fontFamily('PingFang SC-Regular') |
| 121 | + .fontWeight(400) | ||
| 121 | .margin({ left: 5 }) | 122 | .margin({ left: 5 }) |
| 123 | + .lineHeight(20) | ||
| 122 | } | 124 | } |
| 123 | } | 125 | } |
| 124 | .width(154) | 126 | .width(154) |
| @@ -7,6 +7,7 @@ import { windowSizeManager } from '../utils/Managers'; | @@ -7,6 +7,7 @@ import { windowSizeManager } from '../utils/Managers'; | ||
| 7 | import { runWithAnimation } from '../utils/FuncUtils'; | 7 | import { runWithAnimation } from '../utils/FuncUtils'; |
| 8 | import { PhotoListBean } from 'wdBean/Index'; | 8 | import { PhotoListBean } from 'wdBean/Index'; |
| 9 | import { http } from '@kit.NetworkKit'; | 9 | import { http } from '@kit.NetworkKit'; |
| 10 | +import { router } from '@kit.ArkUI'; | ||
| 10 | 11 | ||
| 11 | const TAG = 'MultiPictureDetailItemComponent'; | 12 | const TAG = 'MultiPictureDetailItemComponent'; |
| 12 | 13 | ||
| @@ -27,12 +28,15 @@ export struct MultiPictureDetailItemComponent { | @@ -27,12 +28,15 @@ export struct MultiPictureDetailItemComponent { | ||
| 27 | private MultiPictureDetailItem: PhotoListBean = {} as PhotoListBean | 28 | private MultiPictureDetailItem: PhotoListBean = {} as PhotoListBean |
| 28 | //alt app.media.picture_loading 设计稿尺寸 | 29 | //alt app.media.picture_loading 设计稿尺寸 |
| 29 | @State imageWidth:string | number = 167 | 30 | @State imageWidth:string | number = 167 |
| 30 | - private scroller: Scroller = new Scroller() | 31 | + private swiperControllerItem: SwiperController = new SwiperController() |
| 32 | + @State currentOffset: number = 0 | ||
| 33 | + @Consume duration: number | ||
| 31 | 34 | ||
| 32 | 35 | ||
| 33 | async aboutToAppear() { | 36 | async aboutToAppear() { |
| 34 | this.imageUri = this.MultiPictureDetailItem.picPath | 37 | this.imageUri = this.MultiPictureDetailItem.picPath |
| 35 | this.getPicture() | 38 | this.getPicture() |
| 39 | + console.log(TAG, JSON.stringify(this.MultiPictureDetailItem)) | ||
| 36 | } | 40 | } |
| 37 | 41 | ||
| 38 | /** | 42 | /** |
| @@ -179,54 +183,79 @@ export struct MultiPictureDetailItemComponent { | @@ -179,54 +183,79 @@ export struct MultiPictureDetailItemComponent { | ||
| 179 | } | 183 | } |
| 180 | 184 | ||
| 181 | build() { | 185 | build() { |
| 182 | - Row() { | ||
| 183 | - Scroll(this.scroller) { | ||
| 184 | - if(this.imageUri != null && (this.imageUri.includes('.gif') || this.imageUri.includes('.GIF'))){ | ||
| 185 | - Image(this.imageUri)// TODO:知识点:宽高只根据其尺寸设置一个,通过保持宽高比来设置另一个属性 | ||
| 186 | - .alt($r('app.media.datail_imageLoading_w')) | ||
| 187 | - .width(this.imageWidth) | ||
| 188 | - .objectFit(ImageFit.Auto)// TODO:知识点:保持宽高比进行缩放,可以超出父组件,以便实现多图切换的增强功能 | ||
| 189 | - .interpolation(ImageInterpolation.High) | ||
| 190 | - .autoResize(false) | ||
| 191 | - .transform(this.matrix)// TODO:知识点:通过matrix控制图片的缩放 | ||
| 192 | - .defaultFocus(true) | ||
| 193 | - .offset({ | ||
| 194 | - // TODO:知识点:通过offset控制图片的偏移 | ||
| 195 | - x: this.imageOffsetInfo.currentX, | ||
| 196 | - y: this.imageOffsetInfo.currentY | ||
| 197 | - }) | ||
| 198 | - .onComplete(event => { | ||
| 199 | - this.imageWidth = '100%' | ||
| 200 | - }) | ||
| 201 | - }else{ | ||
| 202 | - Image(this.imagePixelMap || 'app.media.datail_imageLoading_w')// TODO:知识点:宽高只根据其尺寸设置一个,通过保持宽高比来设置另一个属性 | ||
| 203 | - .alt($r('app.media.datail_imageLoading_w')) | ||
| 204 | - .width(this.imageWidth) | ||
| 205 | - .objectFit(ImageFit.Auto)// TODO:知识点:保持宽高比进行缩放,可以超出父组件,以便实现多图切换的增强功能 | ||
| 206 | - .interpolation(ImageInterpolation.High) | ||
| 207 | - .autoResize(false) | ||
| 208 | - .transform(this.matrix)// TODO:知识点:通过matrix控制图片的缩放 | ||
| 209 | - .defaultFocus(true) | ||
| 210 | - .offset({ | ||
| 211 | - // TODO:知识点:通过offset控制图片的偏移 | ||
| 212 | - x: this.imageOffsetInfo.currentX, | ||
| 213 | - y: this.imageOffsetInfo.currentY | ||
| 214 | - }) | ||
| 215 | - .onComplete(event => { | ||
| 216 | - this.imageWidth = '100%' | ||
| 217 | - }) | 186 | + Swiper(this.swiperControllerItem){ |
| 187 | + Row(){ // 居中显示 | ||
| 188 | + List(){ | ||
| 189 | + ListItem(){ | ||
| 190 | + if(this.imageUri != null && (this.imageUri.includes('.gif') || this.imageUri.includes('.GIF'))){ | ||
| 191 | + Image(this.imageUri)// TODO:知识点:宽高只根据其尺寸设置一个,通过保持宽高比来设置另一个属性 | ||
| 192 | + .alt($r('app.media.datail_imageLoading_w')) | ||
| 193 | + .width(this.imageWidth) | ||
| 194 | + .objectFit(ImageFit.Auto)// TODO:知识点:保持宽高比进行缩放,可以超出父组件,以便实现多图切换的增强功能 | ||
| 195 | + .interpolation(ImageInterpolation.High) | ||
| 196 | + .autoResize(false) | ||
| 197 | + .transform(this.matrix)// TODO:知识点:通过matrix控制图片的缩放 | ||
| 198 | + .defaultFocus(true) | ||
| 199 | + .offset({ | ||
| 200 | + // TODO:知识点:通过offset控制图片的偏移 | ||
| 201 | + x: this.imageOffsetInfo.currentX, | ||
| 202 | + y: this.imageOffsetInfo.currentY | ||
| 203 | + | ||
| 204 | + }) | ||
| 205 | + .onComplete(event => { | ||
| 206 | + this.imageWidth = '100%' | ||
| 207 | + }) | ||
| 208 | + } else { | ||
| 209 | + Image(this.imagePixelMap || 'app.media.datail_imageLoading_w')// TODO:知识点:宽高只根据其尺寸设置一个,通过保持宽高比来设置另一个属性 | ||
| 210 | + .alt($r('app.media.datail_imageLoading_w')) | ||
| 211 | + .width(this.imageWidth) | ||
| 212 | + .objectFit(ImageFit.Auto)// TODO:知识点:保持宽高比进行缩放,可以超出父组件,以便实现多图切换的增强功能 | ||
| 213 | + .interpolation(ImageInterpolation.High) | ||
| 214 | + .autoResize(false) | ||
| 215 | + .transform(this.matrix)// TODO:知识点:通过matrix控制图片的缩放 | ||
| 216 | + .defaultFocus(true) | ||
| 217 | + .offset({ | ||
| 218 | + // TODO:知识点:通过offset控制图片的偏移 | ||
| 219 | + x: this.imageOffsetInfo.currentX, | ||
| 220 | + y: this.imageOffsetInfo.currentY | ||
| 221 | + }) | ||
| 222 | + .onComplete(event => { | ||
| 223 | + this.imageWidth = '100%' | ||
| 224 | + }) | ||
| 225 | + } | ||
| 226 | + } | ||
| 218 | } | 227 | } |
| 228 | + .alignListItem(ListItemAlign.Center) | ||
| 229 | + .scrollBarWidth(0) | ||
| 219 | } | 230 | } |
| 220 | - .scrollable(ScrollDirection.Vertical) | ||
| 221 | - .scrollBarWidth(0) | ||
| 222 | - // .height(this.imageDefaultSize.height || "100%") | 231 | + .justifyContent(FlexAlign.Center) |
| 223 | } | 232 | } |
| 233 | + .height('100%') | ||
| 234 | + .vertical(true) | ||
| 235 | + .autoPlay(false) | ||
| 236 | + .cachedCount(1) | ||
| 237 | + .indicator(false) | ||
| 238 | + .displayCount(1) | ||
| 239 | + .loop(false) | ||
| 240 | + .zIndex(10) | ||
| 241 | + .onGestureSwipe((index: number, extraInfo: SwiperAnimationEvent) => { | ||
| 242 | + console.info("onGestureSwipe current offset: " + extraInfo.currentOffset) | ||
| 243 | + this.currentOffset = Math.abs(extraInfo.currentOffset) | ||
| 244 | + }) | ||
| 245 | + .onTouch((event: TouchEvent) => { | ||
| 246 | + if (this.duration === 0) { | ||
| 247 | + this.duration = 500 | ||
| 248 | + } | ||
| 249 | + if (event.type === 1) { | ||
| 250 | + // if(this.currentOffset > px2vp((this.windowHeight - item.height)/2 - 100)) { | ||
| 251 | + if (this.currentOffset > 160) { | ||
| 252 | + router.back() | ||
| 253 | + } | ||
| 254 | + } | ||
| 255 | + }) | ||
| 224 | .onBlur(() => { | 256 | .onBlur(() => { |
| 225 | this.resetCurrentImageInfo(); | 257 | this.resetCurrentImageInfo(); |
| 226 | }) | 258 | }) |
| 227 | - .height('100%') | ||
| 228 | - .width('100%') | ||
| 229 | - .justifyContent(FlexAlign.Center) | ||
| 230 | .gesture( | 259 | .gesture( |
| 231 | GestureGroup( | 260 | GestureGroup( |
| 232 | GestureMode.Exclusive, | 261 | GestureMode.Exclusive, |
| @@ -326,5 +355,6 @@ export struct MultiPictureDetailItemComponent { | @@ -326,5 +355,6 @@ export struct MultiPictureDetailItemComponent { | ||
| 326 | // }) | 355 | // }) |
| 327 | ), | 356 | ), |
| 328 | ) | 357 | ) |
| 358 | + // .height(this.imageDefaultSize.height || "100%") | ||
| 329 | } | 359 | } |
| 330 | } | 360 | } |
| @@ -147,7 +147,7 @@ export struct CardSourceInfo { | @@ -147,7 +147,7 @@ export struct CardSourceInfo { | ||
| 147 | } | 147 | } |
| 148 | 148 | ||
| 149 | // 评论数 | 149 | // 评论数 |
| 150 | - if ((this.contentDTO.rmhPlatform === 1 || this.contentDTO.source) && !this.isCompInnerSource && Number(this.getContentDtoBean()?.interactData?.commentNum) > 0 && | 150 | + if (this.contentDTO.objectType !=='2' && !this.isCompInnerSource && Number(this.getContentDtoBean()?.interactData?.commentNum) > 0 && |
| 151 | this.showCommentNum()) { | 151 | this.showCommentNum()) { |
| 152 | Text(`${this.handlerNum(this.getContentDtoBean()?.interactData?.commentNum.toString())}评`) | 152 | Text(`${this.handlerNum(this.getContentDtoBean()?.interactData?.commentNum.toString())}评`) |
| 153 | .fontSize($r("app.float.font_size_11")) | 153 | .fontSize($r("app.float.font_size_11")) |
| @@ -155,7 +155,7 @@ export struct CardSourceInfo { | @@ -155,7 +155,7 @@ export struct CardSourceInfo { | ||
| 155 | .flexShrink(0) | 155 | .flexShrink(0) |
| 156 | } else { | 156 | } else { |
| 157 | 157 | ||
| 158 | - if ((this.contentDTO.rmhPlatform === 1 || this.contentDTO.source) && this.isCompInnerSource && this.contentDTO.interactData && this.contentDTO.interactData?.commentNum > 0) { | 158 | + if (this.contentDTO.objectType !=='2' && this.isCompInnerSource && this.contentDTO.interactData && this.contentDTO.interactData?.commentNum > 0) { |
| 159 | Text(`${this.handlerNum(this.contentDTO.interactData?.commentNum.toString())}评`) | 159 | Text(`${this.handlerNum(this.contentDTO.interactData?.commentNum.toString())}评`) |
| 160 | .fontSize($r("app.float.font_size_11")) | 160 | .fontSize($r("app.float.font_size_11")) |
| 161 | .fontColor($r("app.color.color_B0B0B0")) | 161 | .fontColor($r("app.color.color_B0B0B0")) |
| @@ -208,11 +208,11 @@ export struct CardSourceInfo { | @@ -208,11 +208,11 @@ export struct CardSourceInfo { | ||
| 208 | } | 208 | } |
| 209 | 209 | ||
| 210 | // 评论数 | 210 | // 评论数 |
| 211 | - if ((this.contentDTO.rmhPlatform === 1 || this.contentDTO.source) && !this.isCompInnerSource && Number(this.getContentDtoBean()?.interactData?.commentNum) > 0 && | 211 | + if (this.contentDTO.objectType !=='2' && !this.isCompInnerSource && Number(this.getContentDtoBean()?.interactData?.commentNum) > 0 && |
| 212 | this.showCommentNum()) { | 212 | this.showCommentNum()) { |
| 213 | have = true | 213 | have = true |
| 214 | } else { | 214 | } else { |
| 215 | - if ((this.contentDTO.rmhPlatform === 1 || this.contentDTO.source) && this.isCompInnerSource && this.contentDTO.interactData && this.contentDTO.interactData?.commentNum > 0) { | 215 | + if (this.contentDTO.objectType !=='2' && this.isCompInnerSource && this.contentDTO.interactData && this.contentDTO.interactData?.commentNum > 0) { |
| 216 | have = true | 216 | have = true |
| 217 | } | 217 | } |
| 218 | } | 218 | } |
| @@ -46,6 +46,7 @@ struct ChannelSubscriptionLayout { | @@ -46,6 +46,7 @@ struct ChannelSubscriptionLayout { | ||
| 46 | navItem: BottomNavDTO = {} as BottomNavDTO | 46 | navItem: BottomNavDTO = {} as BottomNavDTO |
| 47 | // 顶部导航栏是否有临时跳转频道数据不 | 47 | // 顶部导航栏是否有临时跳转频道数据不 |
| 48 | @Prop haveTempTabData: boolean | 48 | @Prop haveTempTabData: boolean |
| 49 | + | ||
| 49 | changeTab: (index: number) => void = () => { | 50 | changeTab: (index: number) => void = () => { |
| 50 | } | 51 | } |
| 51 | 52 | ||
| @@ -272,6 +273,25 @@ struct ChannelSubscriptionLayout { | @@ -272,6 +273,25 @@ struct ChannelSubscriptionLayout { | ||
| 272 | } | 273 | } |
| 273 | } | 274 | } |
| 274 | 275 | ||
| 276 | + | ||
| 277 | + @Builder | ||
| 278 | + firstSettingItemBuilder (item:TopNavDTO, index: number){ | ||
| 279 | + if (this.homeChannelList.length == 1) { | ||
| 280 | + Image('') | ||
| 281 | + .width('100%') | ||
| 282 | + .height('100%') | ||
| 283 | + .backgroundColor('#ED2800') | ||
| 284 | + .borderRadius(4) | ||
| 285 | + }else { | ||
| 286 | + Image(item.channelId === this.indexSettingChannelId ? $r('app.media.index_setting_button_active') : | ||
| 287 | + $r('app.media.index_setting_button')) | ||
| 288 | + .objectFit(ImageFit.Contain) | ||
| 289 | + .rotate({ | ||
| 290 | + angle: index === 1 ? 180 : 0 | ||
| 291 | + }) | ||
| 292 | + } | ||
| 293 | + } | ||
| 294 | + | ||
| 275 | @Builder | 295 | @Builder |
| 276 | sheetBuilder() { | 296 | sheetBuilder() { |
| 277 | Column() { | 297 | Column() { |
| @@ -290,60 +310,64 @@ struct ChannelSubscriptionLayout { | @@ -290,60 +310,64 @@ struct ChannelSubscriptionLayout { | ||
| 290 | .padding({ bottom: 10 }) | 310 | .padding({ bottom: 10 }) |
| 291 | 311 | ||
| 292 | List() { | 312 | List() { |
| 293 | - ListItem() { | ||
| 294 | - Row() { | ||
| 295 | - Text(INDEX_SETTING_TITLE) | ||
| 296 | - .fontSize(16) | ||
| 297 | - .fontWeight(600) | ||
| 298 | - .margin({ right: 4 }) | ||
| 299 | - | ||
| 300 | - Text(INDEX_SETTING_SUBTITLE) | ||
| 301 | - .fontSize(12) | ||
| 302 | - .fontWeight(400) | ||
| 303 | - .fontColor('#80222222') | 313 | + |
| 314 | + if (this.homeChannelList.length > 0) { | ||
| 315 | + ListItem() { | ||
| 316 | + Row() { | ||
| 317 | + Text(INDEX_SETTING_TITLE) | ||
| 318 | + .fontSize(16) | ||
| 319 | + .fontWeight(600) | ||
| 320 | + .margin({ right: 4 }) | ||
| 321 | + | ||
| 322 | + Text(INDEX_SETTING_SUBTITLE) | ||
| 323 | + .fontSize(12) | ||
| 324 | + .fontWeight(400) | ||
| 325 | + .fontColor('#80222222') | ||
| 326 | + } | ||
| 327 | + .width('100%') | ||
| 328 | + .margin({ top: 22, bottom: 16 }) | ||
| 329 | + | ||
| 304 | } | 330 | } |
| 305 | - .width('100%') | ||
| 306 | - .margin({ top: 22, bottom: 16 }) | ||
| 307 | 331 | ||
| 308 | - } | 332 | + ListItem() { |
| 333 | + Flex({ justifyContent: FlexAlign.SpaceBetween }) { | ||
| 334 | + ForEach(this.homeChannelList, (item: TopNavDTO, index: number) => { | ||
| 335 | + Stack() { | ||
| 336 | + this.firstSettingItemBuilder(item,index) | ||
| 337 | + // Image(item.channelId === this.indexSettingChannelId ? $r('app.media.index_setting_button_active') : | ||
| 338 | + // $r('app.media.index_setting_button')) | ||
| 339 | + // .objectFit(ImageFit.Contain) | ||
| 340 | + // .rotate({ | ||
| 341 | + // angle: index === 1 ? 180 : 0 | ||
| 342 | + // }) | ||
| 343 | + Row() { | ||
| 344 | + if (index === 0) { | ||
| 345 | + Image(item.channelId === this.indexSettingChannelId ? $r('app.media.recommend_icon') : | ||
| 346 | + $r('app.media.recommend_icon_active')) | ||
| 347 | + .width(20) | ||
| 348 | + } | ||
| 349 | + Text(item.name) | ||
| 350 | + .textAlign(TextAlign.Center) | ||
| 351 | + .fontSize(16) | ||
| 352 | + .fontColor(item.channelId === this.indexSettingChannelId ? '#ffffff' : '#ED2800') | ||
| 309 | 353 | ||
| 310 | - ListItem() { | ||
| 311 | - Flex({ justifyContent: FlexAlign.SpaceBetween }) { | ||
| 312 | - ForEach(this.homeChannelList, (item: TopNavDTO, index: number) => { | ||
| 313 | - Stack() { | ||
| 314 | - Image(item.channelId === this.indexSettingChannelId ? $r('app.media.index_setting_button_active') : | ||
| 315 | - $r('app.media.index_setting_button')) | ||
| 316 | - .objectFit(ImageFit.Auto) | ||
| 317 | - .rotate({ | ||
| 318 | - angle: index === 1 ? 180 : 0 | ||
| 319 | - }) | ||
| 320 | - Row() { | ||
| 321 | - if (index === 0) { | ||
| 322 | - Image(item.channelId === this.indexSettingChannelId ? $r('app.media.recommend_icon') : | ||
| 323 | - $r('app.media.recommend_icon_active')) | ||
| 324 | - .width(20) | ||
| 325 | } | 354 | } |
| 326 | - Text(item.name) | ||
| 327 | - .textAlign(TextAlign.Center) | ||
| 328 | - .fontSize(16) | ||
| 329 | - .fontColor(item.channelId === this.indexSettingChannelId ? '#ffffff' : '#ED2800') | ||
| 330 | - | 355 | + .width('100%') |
| 356 | + .justifyContent(FlexAlign.Center) | ||
| 331 | } | 357 | } |
| 332 | - .width('100%') | ||
| 333 | - .justifyContent(FlexAlign.Center) | ||
| 334 | - } | ||
| 335 | - .alignContent(Alignment.Start) | ||
| 336 | - .height(36) | ||
| 337 | - .onClick(() => { | ||
| 338 | - this.indexSettingChannelId = item.channelId | ||
| 339 | - AppStorage.set('indexSettingChannelId', item.channelId) | 358 | + .alignContent(Alignment.Start) |
| 359 | + .height(36) | ||
| 360 | + .layoutWeight(1) | ||
| 361 | + .onClick(() => { | ||
| 362 | + this.indexSettingChannelId = item.channelId | ||
| 363 | + AppStorage.set('indexSettingChannelId', item.channelId) | ||
| 364 | + }) | ||
| 340 | }) | 365 | }) |
| 341 | - }) | 366 | + } |
| 367 | + .height(36) | ||
| 368 | + .margin({ bottom: 36 }) | ||
| 342 | } | 369 | } |
| 343 | - .height(36) | ||
| 344 | - .margin({ bottom: 36 }) | ||
| 345 | } | 370 | } |
| 346 | - | ||
| 347 | ListItem() { | 371 | ListItem() { |
| 348 | Row() { | 372 | Row() { |
| 349 | Row() { | 373 | Row() { |
| @@ -366,7 +390,7 @@ struct ChannelSubscriptionLayout { | @@ -366,7 +390,7 @@ struct ChannelSubscriptionLayout { | ||
| 366 | } | 390 | } |
| 367 | .width('100%') | 391 | .width('100%') |
| 368 | .justifyContent(FlexAlign.SpaceBetween) | 392 | .justifyContent(FlexAlign.SpaceBetween) |
| 369 | - .margin({ bottom: 12 }) | 393 | + .margin({ top:this.homeChannelList.length > 0?0:22,bottom: 12 }) |
| 370 | } | 394 | } |
| 371 | 395 | ||
| 372 | // 我的频道列表 | 396 | // 我的频道列表 |
| @@ -228,7 +228,7 @@ export struct EmptyComponent { | @@ -228,7 +228,7 @@ export struct EmptyComponent { | ||
| 228 | let imageString: Resource | string = $r('app.media.icon_no_content') | 228 | let imageString: Resource | string = $r('app.media.icon_no_content') |
| 229 | if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoCollection || | 229 | if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoCollection || |
| 230 | this.emptyType === WDViewDefaultType.WDViewDefaultType_NoHistory) { | 230 | this.emptyType === WDViewDefaultType.WDViewDefaultType_NoHistory) { |
| 231 | - imageString = $r('app.media.icon_no_collection') | 231 | + imageString = $r("app.media.icon_no_collection") |
| 232 | } else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoMessage) { | 232 | } else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoMessage) { |
| 233 | imageString = $r('app.media.icon_no_message1') | 233 | imageString = $r('app.media.icon_no_message1') |
| 234 | } else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoComment || | 234 | } else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoComment || |
| @@ -24,6 +24,7 @@ export struct MultiPictureListPage { | @@ -24,6 +24,7 @@ export struct MultiPictureListPage { | ||
| 24 | @Provide bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0 | 24 | @Provide bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0 |
| 25 | @Provide topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0 | 25 | @Provide topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0 |
| 26 | // @Provide bgc: Color = Color.White; | 26 | // @Provide bgc: Color = Color.White; |
| 27 | + @Provide duration: number = 0 | ||
| 27 | 28 | ||
| 28 | aboutToAppear(): void { | 29 | aboutToAppear(): void { |
| 29 | //获取宽高尺寸 | 30 | //获取宽高尺寸 |
| @@ -43,13 +43,13 @@ export class devicePLSensorManager { | @@ -43,13 +43,13 @@ export class devicePLSensorManager { | ||
| 43 | requestOrientation = window.Orientation.LANDSCAPE; | 43 | requestOrientation = window.Orientation.LANDSCAPE; |
| 44 | } | 44 | } |
| 45 | else if (orientation > 225 && orientation < 315) { | 45 | else if (orientation > 225 && orientation < 315) { |
| 46 | - requestOrientation = window.Orientation.LANDSCAPE_INVERTED; | 46 | + requestOrientation = window.Orientation.LANDSCAPE; |
| 47 | } | 47 | } |
| 48 | if (targetOrientation == window.Orientation.PORTRAIT && requestOrientation == window.Orientation.PORTRAIT) { | 48 | if (targetOrientation == window.Orientation.PORTRAIT && requestOrientation == window.Orientation.PORTRAIT) { |
| 49 | WindowModel.shared.setPreferredOrientation(window.Orientation.AUTO_ROTATION_RESTRICTED); | 49 | WindowModel.shared.setPreferredOrientation(window.Orientation.AUTO_ROTATION_RESTRICTED); |
| 50 | sensor.off(sensor.SensorId.ACCELEROMETER); | 50 | sensor.off(sensor.SensorId.ACCELEROMETER); |
| 51 | } | 51 | } |
| 52 | - if (targetOrientation == window.Orientation.LANDSCAPE && (requestOrientation == window.Orientation.LANDSCAPE || requestOrientation == window.Orientation.LANDSCAPE_INVERTED)) { | 52 | + if (targetOrientation == window.Orientation.LANDSCAPE && (requestOrientation == window.Orientation.LANDSCAPE || requestOrientation == window.Orientation.LANDSCAPE)) { |
| 53 | WindowModel.shared.setPreferredOrientation(window.Orientation.AUTO_ROTATION_RESTRICTED); | 53 | WindowModel.shared.setPreferredOrientation(window.Orientation.AUTO_ROTATION_RESTRICTED); |
| 54 | sensor.off(sensor.SensorId.ACCELEROMETER); | 54 | sensor.off(sensor.SensorId.ACCELEROMETER); |
| 55 | } | 55 | } |
| @@ -122,7 +122,7 @@ export struct PlayUIComponent { | @@ -122,7 +122,7 @@ export struct PlayUIComponent { | ||
| 122 | this.displayDirection = DisplayDirection.VERTICAL | 122 | this.displayDirection = DisplayDirection.VERTICAL |
| 123 | WindowModel.shared.setPreferredOrientation(this.displayDirection == DisplayDirection.VERTICAL ? | 123 | WindowModel.shared.setPreferredOrientation(this.displayDirection == DisplayDirection.VERTICAL ? |
| 124 | window.Orientation.PORTRAIT : | 124 | window.Orientation.PORTRAIT : |
| 125 | - window.Orientation.LANDSCAPE_INVERTED) | 125 | + window.Orientation.LANDSCAPE) |
| 126 | WindowModel.shared.setSpecificSystemBarEnabled(true) | 126 | WindowModel.shared.setSpecificSystemBarEnabled(true) |
| 127 | 127 | ||
| 128 | }) | 128 | }) |
| @@ -354,7 +354,7 @@ export struct PlayUIComponent { | @@ -354,7 +354,7 @@ export struct PlayUIComponent { | ||
| 354 | 354 | ||
| 355 | WindowModel.shared.setPreferredOrientation(this.displayDirection == DisplayDirection.VERTICAL ? | 355 | WindowModel.shared.setPreferredOrientation(this.displayDirection == DisplayDirection.VERTICAL ? |
| 356 | window.Orientation.PORTRAIT : | 356 | window.Orientation.PORTRAIT : |
| 357 | - window.Orientation.LANDSCAPE_INVERTED) | 357 | + window.Orientation.LANDSCAPE) |
| 358 | 358 | ||
| 359 | 359 | ||
| 360 | }) | 360 | }) |
| @@ -10,6 +10,7 @@ export struct PlayerInfoComponent { | @@ -10,6 +10,7 @@ export struct PlayerInfoComponent { | ||
| 10 | @Consume liveState: string | 10 | @Consume liveState: string |
| 11 | @Consume isShowControl: boolean | 11 | @Consume isShowControl: boolean |
| 12 | @Link swiperIndex: number | 12 | @Link swiperIndex: number |
| 13 | + @Provide isFullScreen: boolean = false // 判断是否全屏,全屏状态下swiper禁止切换 | ||
| 13 | 14 | ||
| 14 | 15 | ||
| 15 | build() { | 16 | build() { |
| @@ -37,6 +38,7 @@ export struct PlayerInfoComponent { | @@ -37,6 +38,7 @@ export struct PlayerInfoComponent { | ||
| 37 | .onChange((index) => { | 38 | .onChange((index) => { |
| 38 | this.swiperIndex = index | 39 | this.swiperIndex = index |
| 39 | }) | 40 | }) |
| 41 | + .disableSwipe(this.isFullScreen) | ||
| 40 | } | 42 | } |
| 41 | .height('100%') | 43 | .height('100%') |
| 42 | .width('100%') | 44 | .width('100%') |
| @@ -19,6 +19,7 @@ export struct PlayerTitleComponent { | @@ -19,6 +19,7 @@ export struct PlayerTitleComponent { | ||
| 19 | @Consume displayDirection: DisplayDirection | 19 | @Consume displayDirection: DisplayDirection |
| 20 | @State isLarge:boolean = false | 20 | @State isLarge:boolean = false |
| 21 | private playerController?: WDAliPlayerController | 21 | private playerController?: WDAliPlayerController |
| 22 | + @Consume isFullScreen: boolean | ||
| 22 | 23 | ||
| 23 | aboutToAppear(): void { | 24 | aboutToAppear(): void { |
| 24 | if (!this.playerController) { | 25 | if (!this.playerController) { |
| @@ -52,7 +53,7 @@ export struct PlayerTitleComponent { | @@ -52,7 +53,7 @@ export struct PlayerTitleComponent { | ||
| 52 | .onClick(() => { | 53 | .onClick(() => { |
| 53 | WindowModel.shared.setPreferredOrientation((this.isLarge && this.displayDirection == DisplayDirection.VIDEO_HORIZONTAL) ? | 54 | WindowModel.shared.setPreferredOrientation((this.isLarge && this.displayDirection == DisplayDirection.VIDEO_HORIZONTAL) ? |
| 54 | window.Orientation.PORTRAIT : | 55 | window.Orientation.PORTRAIT : |
| 55 | - window.Orientation.LANDSCAPE_INVERTED) | 56 | + window.Orientation.LANDSCAPE) |
| 56 | WindowModel.shared.setSpecificSystemBarEnabled(true) | 57 | WindowModel.shared.setSpecificSystemBarEnabled(true) |
| 57 | this.isLarge = false | 58 | this.isLarge = false |
| 58 | this.displayDirection = DisplayDirection.VERTICAL | 59 | this.displayDirection = DisplayDirection.VERTICAL |
| @@ -64,6 +65,7 @@ export struct PlayerTitleComponent { | @@ -64,6 +65,7 @@ export struct PlayerTitleComponent { | ||
| 64 | // this.playerController.onVideoSizePlayerUIComponentMethod(2,1); | 65 | // this.playerController.onVideoSizePlayerUIComponentMethod(2,1); |
| 65 | // } | 66 | // } |
| 66 | } | 67 | } |
| 68 | + this.isFullScreen = false | ||
| 67 | }) | 69 | }) |
| 68 | Text(this.contentDetailData.newsTitle || '') | 70 | Text(this.contentDetailData.newsTitle || '') |
| 69 | .maxLines(2) | 71 | .maxLines(2) |
| @@ -14,6 +14,7 @@ export struct PlayerUIComponent { | @@ -14,6 +14,7 @@ export struct PlayerUIComponent { | ||
| 14 | private playerController?: WDAliPlayerController | 14 | private playerController?: WDAliPlayerController |
| 15 | @Provide isSmall:boolean = false | 15 | @Provide isSmall:boolean = false |
| 16 | @Consume isShowControl: boolean | 16 | @Consume isShowControl: boolean |
| 17 | + @Consume isFullScreen: boolean | ||
| 17 | @Consume displayDirection: DisplayDirection | 18 | @Consume displayDirection: DisplayDirection |
| 18 | aboutToAppear() { | 19 | aboutToAppear() { |
| 19 | if (!this.playerController) { | 20 | if (!this.playerController) { |
| @@ -43,7 +44,7 @@ export struct PlayerUIComponent { | @@ -43,7 +44,7 @@ export struct PlayerUIComponent { | ||
| 43 | WindowModel.shared.setSpecificSystemBarEnabled(false) | 44 | WindowModel.shared.setSpecificSystemBarEnabled(false) |
| 44 | this.displayDirection = DisplayDirection.VIDEO_HORIZONTAL | 45 | this.displayDirection = DisplayDirection.VIDEO_HORIZONTAL |
| 45 | WindowModel.shared.setPreferredOrientation( | 46 | WindowModel.shared.setPreferredOrientation( |
| 46 | - window.Orientation.LANDSCAPE_INVERTED) | 47 | + window.Orientation.LANDSCAPE) |
| 47 | if(this.playerController){ | 48 | if(this.playerController){ |
| 48 | // if(this.playerController.onVideoSizePlayerUIComponentMethod){ | 49 | // if(this.playerController.onVideoSizePlayerUIComponentMethod){ |
| 49 | // this.playerController.onVideoSizePlayerUIComponentMethod(1,2) | 50 | // this.playerController.onVideoSizePlayerUIComponentMethod(1,2) |
| @@ -56,6 +57,7 @@ export struct PlayerUIComponent { | @@ -56,6 +57,7 @@ export struct PlayerUIComponent { | ||
| 56 | this.playerController.onVideoSizePlayerTitleComponentBack(1,2) | 57 | this.playerController.onVideoSizePlayerTitleComponentBack(1,2) |
| 57 | } | 58 | } |
| 58 | } | 59 | } |
| 60 | + this.isFullScreen = true | ||
| 59 | }) | 61 | }) |
| 60 | .visibility(this.isSmall ? Visibility.Visible : Visibility.Hidden) | 62 | .visibility(this.isSmall ? Visibility.Visible : Visibility.Hidden) |
| 61 | .margin({ top: 301}) // 195 + 211 - 105 | 63 | .margin({ top: 301}) // 195 + 211 - 105 |
| @@ -17,6 +17,7 @@ export struct PlayerVideoControlComponent { | @@ -17,6 +17,7 @@ export struct PlayerVideoControlComponent { | ||
| 17 | @Consume displayDirection: DisplayDirection | 17 | @Consume displayDirection: DisplayDirection |
| 18 | @Consume contentDetailData: ContentDetailDTO | 18 | @Consume contentDetailData: ContentDetailDTO |
| 19 | @Consume isSmall:boolean | 19 | @Consume isSmall:boolean |
| 20 | + @Consume isFullScreen: boolean | ||
| 20 | 21 | ||
| 21 | aboutToAppear(): void { | 22 | aboutToAppear(): void { |
| 22 | if (this.playerController) { | 23 | if (this.playerController) { |
| @@ -75,7 +76,7 @@ export struct PlayerVideoControlComponent { | @@ -75,7 +76,7 @@ export struct PlayerVideoControlComponent { | ||
| 75 | WindowModel.shared.setSpecificSystemBarEnabled(false) | 76 | WindowModel.shared.setSpecificSystemBarEnabled(false) |
| 76 | this.displayDirection = DisplayDirection.VIDEO_HORIZONTAL | 77 | this.displayDirection = DisplayDirection.VIDEO_HORIZONTAL |
| 77 | WindowModel.shared.setPreferredOrientation( | 78 | WindowModel.shared.setPreferredOrientation( |
| 78 | - window.Orientation.LANDSCAPE_INVERTED) | 79 | + window.Orientation.LANDSCAPE) |
| 79 | if(this.playerController){ | 80 | if(this.playerController){ |
| 80 | // if(this.playerController.onVideoSizePlayerUIComponentMethod){ | 81 | // if(this.playerController.onVideoSizePlayerUIComponentMethod){ |
| 81 | // this.playerController.onVideoSizePlayerUIComponentMethod(1,2) | 82 | // this.playerController.onVideoSizePlayerUIComponentMethod(1,2) |
| @@ -88,6 +89,7 @@ export struct PlayerVideoControlComponent { | @@ -88,6 +89,7 @@ export struct PlayerVideoControlComponent { | ||
| 88 | this.playerController.onVideoSizePlayerTitleComponentBack(1,2) | 89 | this.playerController.onVideoSizePlayerTitleComponentBack(1,2) |
| 89 | } | 90 | } |
| 90 | } | 91 | } |
| 92 | + this.isFullScreen = true | ||
| 91 | }) | 93 | }) |
| 92 | } | 94 | } |
| 93 | } | 95 | } |
| @@ -452,24 +452,27 @@ export struct DetailPlayShortVideoPage { | @@ -452,24 +452,27 @@ export struct DetailPlayShortVideoPage { | ||
| 452 | playerFullscreenBuilder() { | 452 | playerFullscreenBuilder() { |
| 453 | Row() { | 453 | Row() { |
| 454 | Image($r('app.media.ic_switch_orientation')) | 454 | Image($r('app.media.ic_switch_orientation')) |
| 455 | - .width(16) | 455 | + .width(24) |
| 456 | .aspectRatio(1) | 456 | .aspectRatio(1) |
| 457 | .objectFit(ImageFit.Contain) | 457 | .objectFit(ImageFit.Contain) |
| 458 | .margin({ left: 8, right: 4 }) | 458 | .margin({ left: 8, right: 4 }) |
| 459 | - Text("全屏观看") | ||
| 460 | - .fontColor(Color.White) | ||
| 461 | - .fontWeight(400) | ||
| 462 | - .fontSize(12) | ||
| 463 | - .layoutWeight(1) | 459 | + // Text("全屏观看") |
| 460 | + // .fontColor(Color.White) | ||
| 461 | + // .fontWeight(400) | ||
| 462 | + // .fontSize(12) | ||
| 463 | + // .layoutWeight(1) | ||
| 464 | } | 464 | } |
| 465 | - .width(84) | ||
| 466 | - .height(28) | ||
| 467 | - .backgroundColor('#0DFFFFFF') | ||
| 468 | - .border({ width: 1, color: '#4DFFFFFF', radius: 4 }) | 465 | + // .width(84) |
| 466 | + // .height(28) | ||
| 467 | + // .backgroundColor('#0DFFFFFF') | ||
| 468 | + // .border({ width: 1, color: '#4DFFFFFF', radius: 4 }) | ||
| 469 | .alignItems(VerticalAlign.Center) | 469 | .alignItems(VerticalAlign.Center) |
| 470 | .justifyContent(FlexAlign.Center) | 470 | .justifyContent(FlexAlign.Center) |
| 471 | .align(Alignment.Bottom) | 471 | .align(Alignment.Bottom) |
| 472 | - .margin({ top: 280 }) | 472 | + // .margin({ top: 280 }) |
| 473 | + .position({ | ||
| 474 | + y: '66.5%' | ||
| 475 | + }) | ||
| 473 | .onClick(() => { | 476 | .onClick(() => { |
| 474 | // 全屏方案待定 | 477 | // 全屏方案待定 |
| 475 | // this.displayDirection = DisplayDirection.VERTICAL | 478 | // this.displayDirection = DisplayDirection.VERTICAL |
| @@ -478,7 +481,7 @@ export struct DetailPlayShortVideoPage { | @@ -478,7 +481,7 @@ export struct DetailPlayShortVideoPage { | ||
| 478 | DisplayDirection.VERTICAL | 481 | DisplayDirection.VERTICAL |
| 479 | WindowModel.shared.setPreferredOrientation(this.displayDirection == DisplayDirection.VERTICAL ? | 482 | WindowModel.shared.setPreferredOrientation(this.displayDirection == DisplayDirection.VERTICAL ? |
| 480 | window.Orientation.PORTRAIT : | 483 | window.Orientation.PORTRAIT : |
| 481 | - window.Orientation.LANDSCAPE_INVERTED) | 484 | + window.Orientation.LANDSCAPE) |
| 482 | 485 | ||
| 483 | 486 | ||
| 484 | }) | 487 | }) |
| @@ -146,7 +146,7 @@ export struct DetailVideoListPage { | @@ -146,7 +146,7 @@ export struct DetailVideoListPage { | ||
| 146 | this.displayDirection = DisplayDirection.VERTICAL | 146 | this.displayDirection = DisplayDirection.VERTICAL |
| 147 | WindowModel.shared.setPreferredOrientation(this.displayDirection == DisplayDirection.VERTICAL ? | 147 | WindowModel.shared.setPreferredOrientation(this.displayDirection == DisplayDirection.VERTICAL ? |
| 148 | window.Orientation.PORTRAIT : | 148 | window.Orientation.PORTRAIT : |
| 149 | - window.Orientation.LANDSCAPE_INVERTED) | 149 | + window.Orientation.LANDSCAPE) |
| 150 | } | 150 | } |
| 151 | } | 151 | } |
| 152 | 152 |
| @@ -157,7 +157,7 @@ export struct VideoChannelDetail { | @@ -157,7 +157,7 @@ export struct VideoChannelDetail { | ||
| 157 | this.displayDirection = DisplayDirection.VERTICAL | 157 | this.displayDirection = DisplayDirection.VERTICAL |
| 158 | WindowModel.shared.setPreferredOrientation(this.displayDirection == DisplayDirection.VERTICAL ? | 158 | WindowModel.shared.setPreferredOrientation(this.displayDirection == DisplayDirection.VERTICAL ? |
| 159 | window.Orientation.PORTRAIT : | 159 | window.Orientation.PORTRAIT : |
| 160 | - window.Orientation.LANDSCAPE_INVERTED) | 160 | + window.Orientation.LANDSCAPE) |
| 161 | } | 161 | } |
| 162 | } | 162 | } |
| 163 | 163 |
| @@ -76,7 +76,7 @@ export struct PlayerFullScreenView { | @@ -76,7 +76,7 @@ export struct PlayerFullScreenView { | ||
| 76 | DisplayDirection.VERTICAL | 76 | DisplayDirection.VERTICAL |
| 77 | WindowModel.shared.setPreferredOrientation(this.displayDirection == DisplayDirection.VERTICAL ? | 77 | WindowModel.shared.setPreferredOrientation(this.displayDirection == DisplayDirection.VERTICAL ? |
| 78 | window.Orientation.PORTRAIT : | 78 | window.Orientation.PORTRAIT : |
| 79 | - window.Orientation.LANDSCAPE_INVERTED) | 79 | + window.Orientation.LANDSCAPE) |
| 80 | }) | 80 | }) |
| 81 | Text(this.getTitle()) | 81 | Text(this.getTitle()) |
| 82 | .fontSize(18) | 82 | .fontSize(18) |
| @@ -96,11 +96,10 @@ export struct WDPlayerRenderVLiveView { | @@ -96,11 +96,10 @@ export struct WDPlayerRenderVLiveView { | ||
| 96 | if (this.onLoad) { | 96 | if (this.onLoad) { |
| 97 | this.onLoad(event) | 97 | this.onLoad(event) |
| 98 | } | 98 | } |
| 99 | - }) | ||
| 100 | - .width(this.selfSize.width) | ||
| 101 | - .height(this.selfSize.height) | ||
| 102 | - /*.height('100%') | ||
| 103 | - .width('100%')*/ | 99 | + })// .width(this.selfSize.width) |
| 100 | + // .height(this.selfSize.height) | ||
| 101 | + .height('100%') | ||
| 102 | + .width('100%') | ||
| 104 | .renderFit(RenderFit.RESIZE_FILL) | 103 | .renderFit(RenderFit.RESIZE_FILL) |
| 105 | } | 104 | } |
| 106 | .id(this.insId) | 105 | .id(this.insId) |
| @@ -63,7 +63,7 @@ export struct WDPlayerRenderView { | @@ -63,7 +63,7 @@ export struct WDPlayerRenderView { | ||
| 63 | } | 63 | } |
| 64 | 64 | ||
| 65 | this.playerController.onVideoSizeChange = (width: number, height: number) => { | 65 | this.playerController.onVideoSizeChange = (width: number, height: number) => { |
| 66 | - // console.log(`WDPlayerRenderView onVideoSizeChange width:${width} videoTop:${height}`) | 66 | + console.log(`WDPlayerRenderView onVideoSizeChange width:${width} videoTop:${height}`) |
| 67 | Logger.info(TAG, ` onVideoSizeChange width:${width} height:${height}`) | 67 | Logger.info(TAG, ` onVideoSizeChange width:${width} height:${height}`) |
| 68 | this.videoWidth = width; | 68 | this.videoWidth = width; |
| 69 | this.videoHeight = height; | 69 | this.videoHeight = height; |
| 1 | -import { NetworkUtil, Logger, NetworkType, SPHelper, WindowModel, StringUtils } from 'wdKit'; | 1 | +import { NetworkUtil, Logger, SPHelper, StringUtils } from 'wdKit'; |
| 2 | import { ResponseDTO } from 'wdNetwork'; | 2 | import { ResponseDTO } from 'wdNetwork'; |
| 3 | import { | 3 | import { |
| 4 | ContentDetailDTO, | 4 | ContentDetailDTO, |
| @@ -9,11 +9,9 @@ import { | @@ -9,11 +9,9 @@ import { | ||
| 9 | Params, | 9 | Params, |
| 10 | InteractDataDTO | 10 | InteractDataDTO |
| 11 | } from 'wdBean'; | 11 | } from 'wdBean'; |
| 12 | -import display from '@ohos.display'; | ||
| 13 | import { DateTimeUtils } from 'wdKit/Index'; | 12 | import { DateTimeUtils } from 'wdKit/Index'; |
| 14 | import { WDRouterPage, WDRouterRule } from 'wdRouter/Index'; | 13 | import { WDRouterPage, WDRouterRule } from 'wdRouter/Index'; |
| 15 | import { SpConstants } from 'wdConstant/Index'; | 14 | import { SpConstants } from 'wdConstant/Index'; |
| 16 | -import { router } from '@kit.ArkUI'; | ||
| 17 | import { common } from '@kit.AbilityKit'; | 15 | import { common } from '@kit.AbilityKit'; |
| 18 | import { CommentDialogView } from 'wdDetailPlayShortVideo/Index'; | 16 | import { CommentDialogView } from 'wdDetailPlayShortVideo/Index'; |
| 19 | import { EmptyComponent, | 17 | import { EmptyComponent, |
| @@ -44,7 +42,6 @@ export struct MultiPictureDetailPageComponent { | @@ -44,7 +42,6 @@ export struct MultiPictureDetailPageComponent { | ||
| 44 | @Consume topSafeHeight: number | 42 | @Consume topSafeHeight: number |
| 45 | @Provide @Watch('onCurrentPageNumUpdated') currentPageNum: string = '01' | 43 | @Provide @Watch('onCurrentPageNumUpdated') currentPageNum: string = '01' |
| 46 | private swiperController: SwiperController = new SwiperController() | 44 | private swiperController: SwiperController = new SwiperController() |
| 47 | - private swiperControllerItem: SwiperController = new SwiperController() | ||
| 48 | @State swiperIndex: number = 0; | 45 | @State swiperIndex: number = 0; |
| 49 | @Provide followStatus: string | undefined = '0' // 关注状态 | 46 | @Provide followStatus: string | undefined = '0' // 关注状态 |
| 50 | @Provide showCommentList: boolean = false | 47 | @Provide showCommentList: boolean = false |
| @@ -56,14 +53,13 @@ export struct MultiPictureDetailPageComponent { | @@ -56,14 +53,13 @@ export struct MultiPictureDetailPageComponent { | ||
| 56 | @State showDownload: Boolean = false // 控制是否显示下载默认隐藏 | 53 | @State showDownload: Boolean = false // 控制是否显示下载默认隐藏 |
| 57 | @State publishCommentModel: publishCommentModel = new publishCommentModel() | 54 | @State publishCommentModel: publishCommentModel = new publishCommentModel() |
| 58 | @State operationButtonList: string[] = ['comment', 'like', 'collect', 'share'] | 55 | @State operationButtonList: string[] = ['comment', 'like', 'collect', 'share'] |
| 59 | - @State currentOffset: number = 0 | ||
| 60 | - @State duration: number = 0 | ||
| 61 | @Provide interactData: InteractDataDTO = {} as InteractDataDTO | 56 | @Provide interactData: InteractDataDTO = {} as InteractDataDTO |
| 62 | pageParam: ParamType = {} | 57 | pageParam: ParamType = {} |
| 63 | followUserId: string = '' | 58 | followUserId: string = '' |
| 64 | followUserName: string = '' | 59 | followUserName: string = '' |
| 65 | @State isEnableSwipe: boolean = true; | 60 | @State isEnableSwipe: boolean = true; |
| 66 | @State isScrollerTop: boolean = false; | 61 | @State isScrollerTop: boolean = false; |
| 62 | + @Provide duration: number = 0 | ||
| 67 | 63 | ||
| 68 | //watch监听页码回调 | 64 | //watch监听页码回调 |
| 69 | onCurrentPageNumUpdated(): void { | 65 | onCurrentPageNumUpdated(): void { |
| @@ -300,32 +296,9 @@ export struct MultiPictureDetailPageComponent { | @@ -300,32 +296,9 @@ export struct MultiPictureDetailPageComponent { | ||
| 300 | imgSwiper() { | 296 | imgSwiper() { |
| 301 | Swiper(this.swiperController) { | 297 | Swiper(this.swiperController) { |
| 302 | ForEach(this.contentDetailData.photoList, (item: PhotoListBean) => { | 298 | ForEach(this.contentDetailData.photoList, (item: PhotoListBean) => { |
| 303 | - Swiper(this.swiperControllerItem) { | ||
| 304 | - MultiPictureDetailItemComponent({ MultiPictureDetailItem: item, isEnableSwipe: this.isEnableSwipe }) | ||
| 305 | - } | ||
| 306 | - .width('100%') | ||
| 307 | - .height('100%') | ||
| 308 | - .vertical(true) | ||
| 309 | - .autoPlay(false) | ||
| 310 | - .cachedCount(1) | ||
| 311 | - .indicator(false) | ||
| 312 | - .displayCount(1) | ||
| 313 | - .loop(false) | ||
| 314 | - .onGestureSwipe((index: number, extraInfo: SwiperAnimationEvent) => { | ||
| 315 | - console.info("onGestureSwipe current offset: " + extraInfo.currentOffset) | ||
| 316 | - this.currentOffset = Math.abs(extraInfo.currentOffset) | ||
| 317 | - }) | ||
| 318 | - .onTouch((event: TouchEvent) => { | ||
| 319 | - if (this.duration === 0) { | ||
| 320 | - this.duration = 500 | ||
| 321 | - } | ||
| 322 | - if (event.type === 1) { | ||
| 323 | - // if(this.currentOffset > px2vp((this.windowHeight - item.height)/2 - 100)) { | ||
| 324 | - if (this.currentOffset > 160) { | ||
| 325 | - router.back() | ||
| 326 | - } | ||
| 327 | - } | ||
| 328 | - }) | 299 | + MultiPictureDetailItemComponent( |
| 300 | + { MultiPictureDetailItem: item, isEnableSwipe: this.isEnableSwipe } | ||
| 301 | + ) | ||
| 329 | }) | 302 | }) |
| 330 | } | 303 | } |
| 331 | .index(this.swiperIndex) | 304 | .index(this.swiperIndex) |
| @@ -425,9 +398,9 @@ export struct MultiPictureDetailPageComponent { | @@ -425,9 +398,9 @@ export struct MultiPictureDetailPageComponent { | ||
| 425 | 398 | ||
| 426 | Scroll(this.scroller) { | 399 | Scroll(this.scroller) { |
| 427 | Column() { | 400 | Column() { |
| 428 | - Row() | 401 | + /*Row() |
| 429 | .width("100%") | 402 | .width("100%") |
| 430 | - .height(this.contentDetailData.photoList?.[this.swiperIndex].picDesc ? 90 : 130) | 403 | + .height(this.contentDetailData.photoList?.[this.swiperIndex].picDesc ? 90 : 130)*/ |
| 431 | Flex({ | 404 | Flex({ |
| 432 | direction: FlexDirection.Column | 405 | direction: FlexDirection.Column |
| 433 | }) { | 406 | }) { |
| @@ -451,7 +424,10 @@ export struct MultiPictureDetailPageComponent { | @@ -451,7 +424,10 @@ export struct MultiPictureDetailPageComponent { | ||
| 451 | }) | 424 | }) |
| 452 | } | 425 | } |
| 453 | } | 426 | } |
| 454 | - .height(230) | 427 | + .constraintSize({ |
| 428 | + maxHeight: 230 | ||
| 429 | + }) | ||
| 430 | + // .height(230) | ||
| 455 | .edgeEffect(EdgeEffect.None) | 431 | .edgeEffect(EdgeEffect.None) |
| 456 | .scrollBarWidth(0) | 432 | .scrollBarWidth(0) |
| 457 | .scrollBar(BarState.Off) | 433 | .scrollBar(BarState.Off) |
| @@ -19,9 +19,9 @@ | @@ -19,9 +19,9 @@ | ||
| 19 | "name": "EntryAbility", | 19 | "name": "EntryAbility", |
| 20 | // 这里不能改动,和后台推送有绑定 | 20 | // 这里不能改动,和后台推送有绑定 |
| 21 | "srcEntry": "./ets/entryability/EntryAbility.ets", | 21 | "srcEntry": "./ets/entryability/EntryAbility.ets", |
| 22 | - "description": "$string:EntryAbility_desc", | 22 | + "description": "$string:app_desc", |
| 23 | "icon": "$media:app_icon_layer", | 23 | "icon": "$media:app_icon_layer", |
| 24 | - "label": "$string:EntryAbility_label", | 24 | + "label": "$string:app_name", |
| 25 | "startWindowIcon": "$media:app_icon", | 25 | "startWindowIcon": "$media:app_icon", |
| 26 | "startWindowBackground": "$color:start_window_background", | 26 | "startWindowBackground": "$color:start_window_background", |
| 27 | "exported": true, | 27 | "exported": true, |
| @@ -5,14 +5,6 @@ | @@ -5,14 +5,6 @@ | ||
| 5 | "value": "main entry" | 5 | "value": "main entry" |
| 6 | }, | 6 | }, |
| 7 | { | 7 | { |
| 8 | - "name": "EntryAbility_desc", | ||
| 9 | - "value": "$string:app_desc" | ||
| 10 | - }, | ||
| 11 | - { | ||
| 12 | - "name": "EntryAbility_label", | ||
| 13 | - "value": "$string:app_name" | ||
| 14 | - }, | ||
| 15 | - { | ||
| 16 | "name": "permission_photo_tip", | 8 | "name": "permission_photo_tip", |
| 17 | "value": "开启之后即可用于保存新闻图片到相册、发视频、设置封面、设置头像、缓存图片和视频来展示内容等功能" | 9 | "value": "开启之后即可用于保存新闻图片到相册、发视频、设置封面、设置头像、缓存图片和视频来展示内容等功能" |
| 18 | }, | 10 | }, |
| @@ -5,14 +5,6 @@ | @@ -5,14 +5,6 @@ | ||
| 5 | "value": "main entry" | 5 | "value": "main entry" |
| 6 | }, | 6 | }, |
| 7 | { | 7 | { |
| 8 | - "name": "EntryAbility_desc", | ||
| 9 | - "value": "$string:app_desc" | ||
| 10 | - }, | ||
| 11 | - { | ||
| 12 | - "name": "EntryAbility_label", | ||
| 13 | - "value": "$string:app_name" | ||
| 14 | - }, | ||
| 15 | - { | ||
| 16 | "name": "dialog_text_title", | 8 | "name": "dialog_text_title", |
| 17 | "value": "个人隐私保护指引" | 9 | "value": "个人隐私保护指引" |
| 18 | }, | 10 | }, |
| @@ -5,14 +5,6 @@ | @@ -5,14 +5,6 @@ | ||
| 5 | "value": "主入口" | 5 | "value": "主入口" |
| 6 | }, | 6 | }, |
| 7 | { | 7 | { |
| 8 | - "name": "EntryAbility_desc", | ||
| 9 | - "value": "$string:app_desc" | ||
| 10 | - }, | ||
| 11 | - { | ||
| 12 | - "name": "EntryAbility_label", | ||
| 13 | - "value": "$string:app_name" | ||
| 14 | - }, | ||
| 15 | - { | ||
| 16 | "name": "dialog_text_title", | 8 | "name": "dialog_text_title", |
| 17 | "value": "个人隐私保护指引" | 9 | "value": "个人隐私保护指引" |
| 18 | }, | 10 | }, |
-
Please register or login to post a comment