Merge branch 'main' of http://192.168.1.42/developOne/harmonyPool
Showing
83 changed files
with
1281 additions
and
1034 deletions
| @@ -31,10 +31,11 @@ export const enum CompStyle { | @@ -31,10 +31,11 @@ export const enum CompStyle { | ||
| 31 | Zh_Single_Column_02 = 'Zh_Single_Column-02', //10 头图卡 | 31 | Zh_Single_Column_02 = 'Zh_Single_Column-02', //10 头图卡 |
| 32 | Zh_Single_Column_03 = 'Zh_Single_Column-03', //9 直播大图卡 | 32 | Zh_Single_Column_03 = 'Zh_Single_Column-03', //9 直播大图卡 |
| 33 | Zh_Single_Column_04 = 'Zh_Single_Column-04', //17 人民号主题卡 | 33 | Zh_Single_Column_04 = 'Zh_Single_Column-04', //17 人民号主题卡 |
| 34 | - Zh_Single_Column_05 = 'Zh_Single_Column-05', //16 人民号入驻卡 | 34 | + Zh_Single_Column_05 = 'Zh_Single_Column-05', //16 人民号入驻卡 |
| 35 | Zh_Single_Column_06 = 'Zh_Single_Column-06', //12 本地问政卡 | 35 | Zh_Single_Column_06 = 'Zh_Single_Column-06', //12 本地问政卡 |
| 36 | Zh_Single_Column_07 = 'Zh_Single_Column-07', //14 热门留言卡 | 36 | Zh_Single_Column_07 = 'Zh_Single_Column-07', //14 热门留言卡 |
| 37 | Zh_Single_Column_08 = 'Zh_Single_Column-08', //12 问政提问卡 | 37 | Zh_Single_Column_08 = 'Zh_Single_Column-08', //12 问政提问卡 |
| 38 | + Zh_Single_Column_09 = 'Zh_Single_Column-09', //12 问政提问卡 | ||
| 38 | Zh_Single_Column_10 = 'Zh_Single_Column-10', //18 服务组合卡 | 39 | Zh_Single_Column_10 = 'Zh_Single_Column-10', //18 服务组合卡 |
| 39 | Zh_Single_Column_11 = 'Zh_Single_Column-11', //19 问政组合卡 | 40 | Zh_Single_Column_11 = 'Zh_Single_Column-11', //19 问政组合卡 |
| 40 | Zh_Grid_Layout_01 = 'Zh_Grid_Layout-01', //4 信息流组合卡 | 41 | Zh_Grid_Layout_01 = 'Zh_Grid_Layout-01', //4 信息流组合卡 |
| @@ -3,15 +3,15 @@ | @@ -3,15 +3,15 @@ | ||
| 3 | { | 3 | { |
| 4 | "name": "shared_desc", | 4 | "name": "shared_desc", |
| 5 | "value": "全局工具包" | 5 | "value": "全局工具包" |
| 6 | - } , | 6 | + }, |
| 7 | { | 7 | { |
| 8 | "name": "net_core_no_network", | 8 | "name": "net_core_no_network", |
| 9 | "value": "当前无网络,请重试" | 9 | "value": "当前无网络,请重试" |
| 10 | - } , | 10 | + }, |
| 11 | { | 11 | { |
| 12 | "name": "net_core_weak_network", | 12 | "name": "net_core_weak_network", |
| 13 | "value": "当前无网络,请重试" | 13 | "value": "当前无网络,请重试" |
| 14 | - } , | 14 | + }, |
| 15 | { | 15 | { |
| 16 | "name": "net_core_page_error_network", | 16 | "name": "net_core_page_error_network", |
| 17 | "value": "网络出小差了,请检查下网络" | 17 | "value": "网络出小差了,请检查下网络" |
| @@ -47,6 +47,10 @@ | @@ -47,6 +47,10 @@ | ||
| 47 | { | 47 | { |
| 48 | "name": "auditing_core_error", | 48 | "name": "auditing_core_error", |
| 49 | "value": "内容已下线" | 49 | "value": "内容已下线" |
| 50 | + }, | ||
| 51 | + { | ||
| 52 | + "name": "image_request_fail", | ||
| 53 | + "value": "图片加载失败,请检查网络" | ||
| 50 | } | 54 | } |
| 51 | ] | 55 | ] |
| 52 | } | 56 | } |
| @@ -62,7 +62,7 @@ export class HttpBizUtil { | @@ -62,7 +62,7 @@ export class HttpBizUtil { | ||
| 62 | Logger.debug(TAG, 'post: ' + resDTO.code) | 62 | Logger.debug(TAG, 'post: ' + resDTO.code) |
| 63 | Logger.debug(TAG, 'post: ' + resDTO.message) | 63 | Logger.debug(TAG, 'post: ' + resDTO.message) |
| 64 | // 403:临时token;406:强制下线、封禁、清空登录信息还要跳转登录页面 | 64 | // 403:临时token;406:强制下线、封禁、清空登录信息还要跳转登录页面 |
| 65 | - if (resDTO.code == 0 || resDTO.code == 406) { | 65 | + if (resDTO.code == 403 || resDTO.code == 406) { |
| 66 | HttpBizUtil.refreshToken().then((token: string) => { | 66 | HttpBizUtil.refreshToken().then((token: string) => { |
| 67 | if (headers) { | 67 | if (headers) { |
| 68 | headers.replace('RMRB-X-TOKEN', token) | 68 | headers.replace('RMRB-X-TOKEN', token) |
| @@ -397,7 +397,8 @@ export class HttpUrlUtils { | @@ -397,7 +397,8 @@ export class HttpUrlUtils { | ||
| 397 | if (StringUtils.isNotEmpty(HttpUrlUtils.token)) { | 397 | if (StringUtils.isNotEmpty(HttpUrlUtils.token)) { |
| 398 | return HttpUrlUtils.token | 398 | return HttpUrlUtils.token |
| 399 | } | 399 | } |
| 400 | - return 'eyJhbGciOiJIUzI1NiIsImtpZCI6ImQ4WkI2QkhxSEZrdjJ2U25BNlRwZEdKRjBHcjItVzBvS2FaYzdLOUUycmcifQ.eyJpc3MiOiJwZW9wbGVzLWRhaWx5LWZvdXJhIiwic3ViIjoicGVvcGxlcy1kYWlseS1mb3VyYSIsImV4cCI6MTcwMzY0OTYwNiwidXNlcklkIjo0NTk3NzYyOTc0NzQ5NDksInVzZXJWZXJzaW9uIjoiNDU5Nzc2Mjk3NDc0OTQ5XzIiLCJ1c2VyTmFtZSI6IkJ1bGlraWtpMTgxIiwidXNlclR5cGUiOjIsImNyZWF0b3JJZCI6NDI2NTM5MH0.jhQ9kylcm3FxWf0-lBMZuLkdtIQ6XpFnAi0AFZJNwfc'; | 400 | + // return 'eyJhbGciOiJIUzI1NiIsImtpZCI6ImQ4WkI2QkhxSEZrdjJ2U25BNlRwZEdKRjBHcjItVzBvS2FaYzdLOUUycmcifQ.eyJpc3MiOiJwZW9wbGVzLWRhaWx5LWZvdXJhIiwic3ViIjoicGVvcGxlcy1kYWlseS1mb3VyYSIsImV4cCI6MTcwMzY0OTYwNiwidXNlcklkIjo0NTk3NzYyOTc0NzQ5NDksInVzZXJWZXJzaW9uIjoiNDU5Nzc2Mjk3NDc0OTQ5XzIiLCJ1c2VyTmFtZSI6IkJ1bGlraWtpMTgxIiwidXNlclR5cGUiOjIsImNyZWF0b3JJZCI6NDI2NTM5MH0.jhQ9kylcm3FxWf0-lBMZuLkdtIQ6XpFnAi0AFZJNwfc'; |
| 401 | + return '' | ||
| 401 | } | 402 | } |
| 402 | 403 | ||
| 403 | static getRefreshToken() { | 404 | static getRefreshToken() { |
| 1 | -import { Callback, BridgeWebViewControl } from 'wdJsBridge'; | 1 | +import { Callback } from 'wdJsBridge'; |
| 2 | import { Message } from 'wdJsBridge/src/main/ets/bean/Message'; | 2 | import { Message } from 'wdJsBridge/src/main/ets/bean/Message'; |
| 3 | -import { Logger, StringUtils, } from 'wdKit'; | 3 | +import { Logger } from 'wdKit'; |
| 4 | import { H5CallNativeType } from './H5CallNativeType'; | 4 | import { H5CallNativeType } from './H5CallNativeType'; |
| 5 | import { ContentDTO } from 'wdBean'; | 5 | import { ContentDTO } from 'wdBean'; |
| 6 | //TODO 这里引用了 features模块,是否考虑将跳转抽到公共模块 | 6 | //TODO 这里引用了 features模块,是否考虑将跳转抽到公共模块 |
| @@ -27,7 +27,10 @@ export function performJSCallNative(data: Message, call: Callback) { | @@ -27,7 +27,10 @@ export function performJSCallNative(data: Message, call: Callback) { | ||
| 27 | case H5CallNativeType.jsCall_callAppService: | 27 | case H5CallNativeType.jsCall_callAppService: |
| 28 | break; | 28 | break; |
| 29 | case H5CallNativeType.jsCall_receiveH5Data: | 29 | case H5CallNativeType.jsCall_receiveH5Data: |
| 30 | - handleH5Data(JSON.parse(data?.data?.dataJson || '{}')) | 30 | + if(data?.data?.dataSource === 5){ |
| 31 | + handleH5Data(JSON.parse(data?.data?.dataJson || '{}')) | ||
| 32 | + | ||
| 33 | + } | ||
| 31 | break; | 34 | break; |
| 32 | case 'changeNativeMessage': | 35 | case 'changeNativeMessage': |
| 33 | call("this is change Web Message") | 36 | call("this is change Web Message") |
| @@ -59,6 +62,7 @@ function getAppPublicInfo(): string { | @@ -59,6 +62,7 @@ function getAppPublicInfo(): string { | ||
| 59 | } | 62 | } |
| 60 | 63 | ||
| 61 | function handleH5Data(content:ContentDTO) { | 64 | function handleH5Data(content:ContentDTO) { |
| 65 | + Logger.debug(TAG, 'handleH5Data' + ', content: ' + JSON.stringify(content)) | ||
| 62 | ProcessUtils.processPage(content) | 66 | ProcessUtils.processPage(content) |
| 63 | } | 67 | } |
| 64 | 68 |
| 1 | import router from '@ohos.router'; | 1 | import router from '@ohos.router'; |
| 2 | -import { BridgeUtil, BridgeWebViewControl, Callback } from 'wdJsBridge'; | 2 | +import { BridgeHandler, BridgeUtil, BridgeWebViewControl, Callback } from 'wdJsBridge'; |
| 3 | import { Logger } from 'wdKit/Index'; | 3 | import { Logger } from 'wdKit/Index'; |
| 4 | +import { setDefaultNativeWebSettings } from './WebComponentUtil'; | ||
| 5 | +import { Action } from 'wdBean'; | ||
| 4 | import { performJSCallNative } from './JsBridgeBiz'; | 6 | import { performJSCallNative } from './JsBridgeBiz'; |
| 5 | import { H5CallNativeType } from './H5CallNativeType'; | 7 | import { H5CallNativeType } from './H5CallNativeType'; |
| 6 | import { Message } from 'wdJsBridge/src/main/ets/bean/Message'; | 8 | import { Message } from 'wdJsBridge/src/main/ets/bean/Message'; |
| @@ -10,9 +12,9 @@ const TAG = 'WdWebLocalComponent'; | @@ -10,9 +12,9 @@ const TAG = 'WdWebLocalComponent'; | ||
| 10 | @Component | 12 | @Component |
| 11 | export struct WdWebComponent { | 13 | export struct WdWebComponent { |
| 12 | webviewControl: BridgeWebViewControl = new BridgeWebViewControl() | 14 | webviewControl: BridgeWebViewControl = new BridgeWebViewControl() |
| 15 | + onWebPrepared: () => void = () => {} | ||
| 13 | @Prop backVisibility: boolean = false | 16 | @Prop backVisibility: boolean = false |
| 14 | @Prop webUrl: string = '' | 17 | @Prop webUrl: string = '' |
| 15 | - @Prop @Watch('onReloadStateChanged') reload: number = 0 | ||
| 16 | @Link isPageEnd: boolean | 18 | @Link isPageEnd: boolean |
| 17 | 19 | ||
| 18 | build() { | 20 | build() { |
| @@ -34,9 +36,10 @@ export struct WdWebComponent { | @@ -34,9 +36,10 @@ export struct WdWebComponent { | ||
| 34 | .domStorageAccess(true) | 36 | .domStorageAccess(true) |
| 35 | .databaseAccess(true) | 37 | .databaseAccess(true) |
| 36 | .javaScriptAccess(true) | 38 | .javaScriptAccess(true) |
| 37 | - .zoomAccess(false) | ||
| 38 | - .horizontalScrollBarAccess(false) | ||
| 39 | - .verticalScrollBarAccess(false) | 39 | + .imageAccess(true) |
| 40 | + .mixedMode(MixedMode.All) | ||
| 41 | + .onlineImageAccess(true) | ||
| 42 | + .enableNativeEmbedMode(true) | ||
| 40 | .onPageBegin((event) => { | 43 | .onPageBegin((event) => { |
| 41 | this.onPageBegin(event?.url); | 44 | this.onPageBegin(event?.url); |
| 42 | }) | 45 | }) |
| @@ -66,14 +69,13 @@ export struct WdWebComponent { | @@ -66,14 +69,13 @@ export struct WdWebComponent { | ||
| 66 | // 注册h5调用js相关 | 69 | // 注册h5调用js相关 |
| 67 | for (let i = 0; i < H5CallNativeType.JsCallTypeList.length; i++) { | 70 | for (let i = 0; i < H5CallNativeType.JsCallTypeList.length; i++) { |
| 68 | let handleName = H5CallNativeType.JsCallTypeList[i]; | 71 | let handleName = H5CallNativeType.JsCallTypeList[i]; |
| 69 | - console.log('handleName:', handleName) | ||
| 70 | let handle = (data: Message, f: Callback) => { | 72 | let handle = (data: Message, f: Callback) => { |
| 73 | + Logger.debug('registerHandlers handlerName: ' + JSON.stringify(data)) | ||
| 71 | this.defaultPerformJSCallNative(data, f) | 74 | this.defaultPerformJSCallNative(data, f) |
| 72 | }; | 75 | }; |
| 73 | this.webviewControl.registerHandler(handleName, { handle: handle }); | 76 | this.webviewControl.registerHandler(handleName, { handle: handle }); |
| 74 | } | 77 | } |
| 75 | } | 78 | } |
| 76 | - | ||
| 77 | /** | 79 | /** |
| 78 | * 默认【CallNative】逻辑处理 | 80 | * 默认【CallNative】逻辑处理 |
| 79 | */ | 81 | */ |
| @@ -83,22 +85,18 @@ export struct WdWebComponent { | @@ -83,22 +85,18 @@ export struct WdWebComponent { | ||
| 83 | onPageBegin: (url?: string) => void = () => { | 85 | onPageBegin: (url?: string) => void = () => { |
| 84 | Logger.debug(TAG, 'onPageBegin'); | 86 | Logger.debug(TAG, 'onPageBegin'); |
| 85 | this.registerHandlers(); | 87 | this.registerHandlers(); |
| 88 | + // setTimeout(() => { | ||
| 86 | BridgeUtil.webViewLoadLocalJs(getContext(this), this.webviewControl) | 89 | BridgeUtil.webViewLoadLocalJs(getContext(this), this.webviewControl) |
| 90 | + // }, 100) | ||
| 87 | } | 91 | } |
| 88 | onPageEnd: (url?: string) => void = () => { | 92 | onPageEnd: (url?: string) => void = () => { |
| 89 | - this.isPageEnd = true | ||
| 90 | Logger.debug(TAG, 'onPageEnd'); | 93 | Logger.debug(TAG, 'onPageEnd'); |
| 94 | + this.onWebPrepared() | ||
| 95 | + this.isPageEnd = true | ||
| 91 | } | 96 | } |
| 92 | onLoadIntercept: (url?: string) => boolean = () => { | 97 | onLoadIntercept: (url?: string) => boolean = () => { |
| 93 | Logger.debug(TAG, 'onLoadIntercept return false'); | 98 | Logger.debug(TAG, 'onLoadIntercept return false'); |
| 94 | return false | 99 | return false |
| 95 | } | 100 | } |
| 96 | - | ||
| 97 | - onReloadStateChanged() { | ||
| 98 | - Logger.info(TAG, `onReloadStateChanged:::refresh, this.reload: ${this.reload}`); | ||
| 99 | - if (this.reload > 0) { | ||
| 100 | - this.webviewControl.refresh() | ||
| 101 | - } | ||
| 102 | - } | ||
| 103 | } | 101 | } |
| 104 | 102 |
| @@ -12,8 +12,7 @@ const TAG = 'WdWebLocalComponent'; | @@ -12,8 +12,7 @@ const TAG = 'WdWebLocalComponent'; | ||
| 12 | @Component | 12 | @Component |
| 13 | export struct WdWebLocalComponent { | 13 | export struct WdWebLocalComponent { |
| 14 | webviewControl: BridgeWebViewControl = new BridgeWebViewControl() | 14 | webviewControl: BridgeWebViewControl = new BridgeWebViewControl() |
| 15 | - onWebPrepared: () => void = () => { | ||
| 16 | - } | 15 | + onWebPrepared: () => void = () => {} |
| 17 | @Prop backVisibility: boolean = false | 16 | @Prop backVisibility: boolean = false |
| 18 | @Prop webResource: Resource = {} as Resource | 17 | @Prop webResource: Resource = {} as Resource |
| 19 | @State webHeight: string | number = '100%' | 18 | @State webHeight: string | number = '100%' |
| @@ -73,6 +72,7 @@ export struct WdWebLocalComponent { | @@ -73,6 +72,7 @@ export struct WdWebLocalComponent { | ||
| 73 | for (let i = 0; i < H5CallNativeType.JsCallTypeList.length; i++) { | 72 | for (let i = 0; i < H5CallNativeType.JsCallTypeList.length; i++) { |
| 74 | let handleName = H5CallNativeType.JsCallTypeList[i]; | 73 | let handleName = H5CallNativeType.JsCallTypeList[i]; |
| 75 | let handle = (data: Message, f: Callback) => { | 74 | let handle = (data: Message, f: Callback) => { |
| 75 | + Logger.debug('registerHandlers handlerName: ' + JSON.stringify(data.data)) | ||
| 76 | this.setCurrentPageOperate(data) | 76 | this.setCurrentPageOperate(data) |
| 77 | this.defaultPerformJSCallNative(data, f) | 77 | this.defaultPerformJSCallNative(data, f) |
| 78 | }; | 78 | }; |
| @@ -19,7 +19,7 @@ export interface CompDTO { | @@ -19,7 +19,7 @@ export interface CompDTO { | ||
| 19 | name: string; | 19 | name: string; |
| 20 | objectId: string; // 跳转页面id? | 20 | objectId: string; // 跳转页面id? |
| 21 | objectTitle: string; // comp标题 | 21 | objectTitle: string; // comp标题 |
| 22 | - // objectType?: any; // 跳转类型,枚举: | 22 | + // objectType?: string; // 跳转类型,枚举: |
| 23 | operDataList: ContentDTO[]; // 运营数据列表【正常运营配置的强运营数据,部分推荐场景的配置(自动源兜底数据)】 | 23 | operDataList: ContentDTO[]; // 运营数据列表【正常运营配置的强运营数据,部分推荐场景的配置(自动源兜底数据)】 |
| 24 | // pageId?: any; | 24 | // pageId?: any; |
| 25 | posterSize: string; | 25 | posterSize: string; |
| @@ -5,6 +5,7 @@ import { InteractDataDTO } from './InteractDataDTO'; | @@ -5,6 +5,7 @@ import { InteractDataDTO } from './InteractDataDTO'; | ||
| 5 | import { slideShows } from '../morningevening/slideShows'; | 5 | import { slideShows } from '../morningevening/slideShows'; |
| 6 | import { VoiceInfoDTO } from '../detail/VoiceInfoDTO'; | 6 | import { VoiceInfoDTO } from '../detail/VoiceInfoDTO'; |
| 7 | import { RmhInfoDTO } from '../detail/RmhInfoDTO' | 7 | import { RmhInfoDTO } from '../detail/RmhInfoDTO' |
| 8 | +import {commentInfo} from './commentInfo' | ||
| 8 | export interface ContentDTO { | 9 | export interface ContentDTO { |
| 9 | appStyle: string; | 10 | appStyle: string; |
| 10 | cityCode: string; | 11 | cityCode: string; |
| @@ -75,4 +76,5 @@ export interface ContentDTO { | @@ -75,4 +76,5 @@ export interface ContentDTO { | ||
| 75 | newTags: string; | 76 | newTags: string; |
| 76 | titleShow?: number; | 77 | titleShow?: number; |
| 77 | isSearch?: boolean; // 是否是搜索的结果,区分搜索和主页的数据 | 78 | isSearch?: boolean; // 是否是搜索的结果,区分搜索和主页的数据 |
| 79 | + commentInfo?: commentInfo | ||
| 78 | } | 80 | } |
| @@ -20,4 +20,5 @@ export interface Params { | @@ -20,4 +20,5 @@ export interface Params { | ||
| 20 | // 17.多图(图集)详情页 | 20 | // 17.多图(图集)详情页 |
| 21 | detailPageType?: number; // 详情页类型 | 21 | detailPageType?: number; // 详情页类型 |
| 22 | liveStyle?: number; // 直播类型:0横屏,1竖屏 | 22 | liveStyle?: number; // 直播类型:0横屏,1竖屏 |
| 23 | + creatorId?: string; //号主id | ||
| 23 | } | 24 | } |
| @@ -69,3 +69,5 @@ export { newsSkeleton } from "./src/main/ets/components/skeleton/newsSkeleton" | @@ -69,3 +69,5 @@ export { newsSkeleton } from "./src/main/ets/components/skeleton/newsSkeleton" | ||
| 69 | 69 | ||
| 70 | export { LiveCommentComponent } from "./src/main/ets/components/comment/view/LiveCommentComponent" | 70 | export { LiveCommentComponent } from "./src/main/ets/components/comment/view/LiveCommentComponent" |
| 71 | 71 | ||
| 72 | +export { WDViewDefaultType } from "./src/main/ets/components/view/EmptyComponent" | ||
| 73 | + |
| @@ -11,8 +11,11 @@ import { | @@ -11,8 +11,11 @@ import { | ||
| 11 | } from './view/HorizontalStrokeCardThreeTwoRadioForOneComponent'; | 11 | } from './view/HorizontalStrokeCardThreeTwoRadioForOneComponent'; |
| 12 | import { ZhSingleRow02 } from './compview/ZhSingleRow02'; | 12 | import { ZhSingleRow02 } from './compview/ZhSingleRow02'; |
| 13 | import { ZhSingleRow04 } from './compview/ZhSingleRow04'; | 13 | import { ZhSingleRow04 } from './compview/ZhSingleRow04'; |
| 14 | +import { ZhSingleRow05 } from './compview/ZhSingleRow05'; | ||
| 15 | +import { ZhSingleRow06 } from './compview/ZhSingleRow06'; | ||
| 14 | import { ZhSingleColumn04 } from './compview/ZhSingleColumn04'; | 16 | import { ZhSingleColumn04 } from './compview/ZhSingleColumn04'; |
| 15 | import { ZhSingleColumn05 } from './compview/ZhSingleColumn05'; | 17 | import { ZhSingleColumn05 } from './compview/ZhSingleColumn05'; |
| 18 | +import { ZhSingleColumn09 } from './compview/ZhSingleColumn09'; | ||
| 16 | import { ZhGridLayout03 } from './compview/ZhGridLayout03'; | 19 | import { ZhGridLayout03 } from './compview/ZhGridLayout03'; |
| 17 | import { CardParser } from './CardParser'; | 20 | import { CardParser } from './CardParser'; |
| 18 | import { LiveHorizontalReservationComponent } from './view/LiveHorizontalReservationComponent'; | 21 | import { LiveHorizontalReservationComponent } from './view/LiveHorizontalReservationComponent'; |
| @@ -31,60 +34,63 @@ export struct CompParser { | @@ -31,60 +34,63 @@ export struct CompParser { | ||
| 31 | compIndex: number = 0; | 34 | compIndex: number = 0; |
| 32 | 35 | ||
| 33 | build() { | 36 | build() { |
| 34 | - Column(){ | 37 | + Column() { |
| 35 | this.componentBuilder(this.compDTO, this.compIndex); | 38 | this.componentBuilder(this.compDTO, this.compIndex); |
| 36 | - Divider().strokeWidth(1).color('#f5f5f5').padding({left:16,right:16}) | ||
| 37 | } | 39 | } |
| 38 | } | 40 | } |
| 39 | 41 | ||
| 40 | @Builder | 42 | @Builder |
| 41 | componentBuilder(compDTO: CompDTO, compIndex: number) { | 43 | componentBuilder(compDTO: CompDTO, compIndex: number) { |
| 42 | - if (compDTO.compStyle === CompStyle.Label_03) { | ||
| 43 | - LabelComponent({ compDTO: compDTO }) | ||
| 44 | - } else if (compDTO.compStyle === CompStyle.Zh_Carousel_Layout_01) { | ||
| 45 | - BannerComponent({ compDTO: compDTO }) | ||
| 46 | - } else if (compDTO.compStyle === CompStyle.Zh_Single_Row_01 && compDTO.imageScale === 2) { | ||
| 47 | - LiveHorizontalCardComponent({ compDTO: compDTO }) | ||
| 48 | - } else if (compDTO.compStyle === CompStyle.Zh_Single_Row_01 && compDTO.imageScale === 3) { | ||
| 49 | - if (compDTO.operDataList.length > 1) { | ||
| 50 | - HorizontalStrokeCardThreeTwoRadioForMoreComponent({ compDTO: compDTO }) | ||
| 51 | - } else { | ||
| 52 | - HorizontalStrokeCardThreeTwoRadioForOneComponent({ compDTO: compDTO }) | 44 | + if (compDTO.operDataList[0]?.objectType !== '3' && compDTO.operDataList[0]?.objectType !== '13') { //暂时屏蔽活动和音频详情入口 |
| 45 | + if (compDTO.compStyle === CompStyle.Label_03) { | ||
| 46 | + LabelComponent({ compDTO: compDTO }) | ||
| 47 | + } else if (compDTO.compStyle === CompStyle.Zh_Carousel_Layout_01) { | ||
| 48 | + BannerComponent({ compDTO: compDTO }) | ||
| 49 | + } else if (compDTO.compStyle === CompStyle.Zh_Single_Row_01 && compDTO.imageScale === 2) { | ||
| 50 | + LiveHorizontalCardComponent({ compDTO: compDTO }) | ||
| 51 | + } else if (compDTO.compStyle === CompStyle.Zh_Single_Row_01 && compDTO.imageScale === 3) { | ||
| 52 | + if (compDTO.operDataList.length > 1) { | ||
| 53 | + HorizontalStrokeCardThreeTwoRadioForMoreComponent({ compDTO: compDTO }) | ||
| 54 | + } else { | ||
| 55 | + HorizontalStrokeCardThreeTwoRadioForOneComponent({ compDTO: compDTO }) | ||
| 56 | + } | ||
| 57 | + } else if (compDTO.compStyle === CompStyle.Zh_Single_Row_02) { | ||
| 58 | + ZhSingleRow02({ compDTO }) | ||
| 59 | + } else if (compDTO.compStyle === CompStyle.Zh_Single_Row_03) { | ||
| 60 | + LiveHorizontalReservationComponent({ compDTO: compDTO }) | ||
| 61 | + } else if (compDTO.compStyle === CompStyle.Zh_Grid_Layout_02) { | ||
| 62 | + ZhGridLayout02({ compDTO: compDTO }) | ||
| 63 | + } else if (compDTO.compStyle === CompStyle.Zh_Grid_Layout_03) { | ||
| 64 | + ZhGridLayout03({ compDTO: compDTO }) | ||
| 65 | + } else if (compDTO.compStyle === CompStyle.Zh_Single_Row_04) { | ||
| 66 | + ZhSingleRow04({ compDTO: compDTO }) | ||
| 67 | + } else if (compDTO.compStyle === CompStyle.Zh_Single_Row_05) { | ||
| 68 | + ZhSingleRow05({ compDTO }) | ||
| 69 | + } else if (compDTO.compStyle === CompStyle.Zh_Single_Row_06) { | ||
| 70 | + ZhSingleRow06({ compDTO }) | ||
| 71 | + } else if (compDTO.compStyle === CompStyle.Zh_Single_Column_02) { | ||
| 72 | + //头图卡 和comStyle 2相同, | ||
| 73 | + Card5Component({ contentDTO: compDTO.operDataList[0] }) | ||
| 74 | + } else if (compDTO.compStyle === CompStyle.Zh_Single_Column_04) { | ||
| 75 | + ZhSingleColumn04({ compDTO: compDTO }) | ||
| 76 | + } else if (compDTO.compStyle === CompStyle.Zh_Single_Column_05) { | ||
| 77 | + ZhSingleColumn05({ compDTO: compDTO }) | ||
| 78 | + } else if (compDTO.compStyle === CompStyle.Zh_Single_Column_09) { | ||
| 79 | + ZhSingleColumn09({ compDTO }) | ||
| 80 | + } else if (!Number.isNaN(Number(compDTO.compStyle))) { | ||
| 81 | + CardParser({ contentDTO: compDTO.operDataList[0] }); | ||
| 53 | } | 82 | } |
| 54 | - } else if (compDTO.compStyle === CompStyle.Zh_Single_Row_02) { | ||
| 55 | - ZhSingleRow02({ compDTO }) | ||
| 56 | - } else if (compDTO.compStyle === CompStyle.Zh_Single_Row_03) { | ||
| 57 | - LiveHorizontalReservationComponent({ compDTO: compDTO }) | ||
| 58 | - } else if (compDTO.compStyle === CompStyle.Zh_Grid_Layout_02) { | ||
| 59 | - ZhGridLayout02({ compDTO: compDTO }) | ||
| 60 | - } else if (compDTO.compStyle === CompStyle.Zh_Grid_Layout_03) { | ||
| 61 | - ZhGridLayout03({ compDTO: compDTO }) | ||
| 62 | - } else if (compDTO.compStyle === CompStyle.Zh_Single_Row_04) { | ||
| 63 | - ZhSingleRow04({ compDTO: compDTO }) | ||
| 64 | - } else if (compDTO.compStyle === CompStyle.Zh_Single_Column_02) { | ||
| 65 | - //头图卡 和comStyle 2相同, | ||
| 66 | - Card5Component({ contentDTO: compDTO.operDataList[0] }) | ||
| 67 | - } else if (compDTO.compStyle === CompStyle.Zh_Single_Column_04) { | ||
| 68 | - ZhSingleColumn04({ compDTO: compDTO }) | ||
| 69 | - } else if (compDTO.compStyle === CompStyle.Zh_Single_Column_05) { | ||
| 70 | - ZhSingleColumn05({ compDTO: compDTO }) | ||
| 71 | - } else if (!Number.isNaN(Number(compDTO.compStyle))) { | ||
| 72 | - CardParser({ contentDTO: compDTO.operDataList[0] }); | ||
| 73 | - } | ||
| 74 | - else { | ||
| 75 | - // todo:组件未实现 / Component Not Implemented | ||
| 76 | - Text(compDTO.compStyle) | ||
| 77 | - .width(CommonConstants.FULL_PARENT) | ||
| 78 | - .padding(10) | ||
| 79 | - .onClick(()=>{ | ||
| 80 | - if (compDTO.compStyle === CompStyle.Zh_Single_Row_06) {//精选评论 | ||
| 81 | - WDRouterRule.jumpWithPage(WDRouterPage.QualityCommentsPage) | ||
| 82 | - } | ||
| 83 | - }) | ||
| 84 | - // Text(compDTO.compStyle) | ||
| 85 | - // .width(CommonConstants.FULL_PARENT) | ||
| 86 | - // .padding(10) | ||
| 87 | - // .backgroundColor(Color.Brown) // 展示本页未实现的compStyle | 83 | + else { |
| 84 | + Text(compDTO.compStyle) | ||
| 85 | + .width(CommonConstants.FULL_PARENT) | ||
| 86 | + .padding(10) | ||
| 87 | + .onClick(() => { | ||
| 88 | + if (compDTO.compStyle === CompStyle.Zh_Single_Row_06) { //精选评论 | ||
| 89 | + WDRouterRule.jumpWithPage(WDRouterPage.QualityCommentsPage) | ||
| 90 | + } | ||
| 91 | + }) | ||
| 92 | + } | ||
| 93 | + Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 }) | ||
| 88 | } | 94 | } |
| 89 | } | 95 | } |
| 90 | } | 96 | } |
| 1 | import { PhotoListBean } from 'wdBean/Index'; | 1 | import { PhotoListBean } from 'wdBean/Index'; |
| 2 | import { Logger } from 'wdKit/Index'; | 2 | import { Logger } from 'wdKit/Index'; |
| 3 | -import { MultiPictureDetailItemComponent } from './MultiPictureDetailItemComponent'; | ||
| 4 | import { display, router } from '@kit.ArkUI'; | 3 | import { display, router } from '@kit.ArkUI'; |
| 5 | import { ImageDownloadComponent } from './ImageDownloadComponent'; | 4 | import { ImageDownloadComponent } from './ImageDownloadComponent'; |
| 5 | +import { ImageItemView } from './view/ImageItemView'; | ||
| 6 | 6 | ||
| 7 | const TAG = 'ImageSwiperComponent'; | 7 | const TAG = 'ImageSwiperComponent'; |
| 8 | 8 | ||
| @@ -17,6 +17,9 @@ export struct ImageSwiperComponent { | @@ -17,6 +17,9 @@ export struct ImageSwiperComponent { | ||
| 17 | private screenWidth: number = 0 | 17 | private screenWidth: number = 0 |
| 18 | private picWidth: number = 0 | 18 | private picWidth: number = 0 |
| 19 | @State picHeight: number = 0 | 19 | @State picHeight: number = 0 |
| 20 | + @State isEnableSwipe: boolean = true; | ||
| 21 | + | ||
| 22 | + // @Provide bgc: Color = Color.White; | ||
| 20 | 23 | ||
| 21 | //watch监听页码回调 | 24 | //watch监听页码回调 |
| 22 | onCurrentPageNumUpdated(): void { | 25 | onCurrentPageNumUpdated(): void { |
| @@ -53,7 +56,8 @@ export struct ImageSwiperComponent { | @@ -53,7 +56,8 @@ export struct ImageSwiperComponent { | ||
| 53 | if (this.photoList && this.photoList?.length > 0) { | 56 | if (this.photoList && this.photoList?.length > 0) { |
| 54 | Swiper(this.swiperController) { | 57 | Swiper(this.swiperController) { |
| 55 | ForEach(this.photoList, (item: PhotoListBean) => { | 58 | ForEach(this.photoList, (item: PhotoListBean) => { |
| 56 | - MultiPictureDetailItemComponent({ MultiPictureDetailItem: item }) | 59 | + // MultiPictureDetailItemComponent({ MultiPictureDetailItem: item }) |
| 60 | + ImageItemView({ MultiPictureDetailItem: item, isEnableSwipe: this.isEnableSwipe }) | ||
| 57 | }) | 61 | }) |
| 58 | } | 62 | } |
| 59 | .index(this.swiperIndex) | 63 | .index(this.swiperIndex) |
| 1 | -import { CommonConstants } from 'wdConstant'; | ||
| 2 | -import { Logger } from 'wdKit'; | ||
| 3 | - | ||
| 4 | -const TAG = 'EmptyComponent'; | ||
| 5 | - | ||
| 6 | -/** | ||
| 7 | - * WDViewDefaultType 缺省页 | ||
| 8 | - */ | ||
| 9 | -export const enum WDViewDefaultType { | ||
| 10 | - ///无网 | ||
| 11 | - WDViewDefaultType_NoNetwork, | ||
| 12 | - ///网络失败 请稍后重试-倒计时 | ||
| 13 | - WDViewDefaultType_NetworkFailed, | ||
| 14 | - ///内容获取失败 | ||
| 15 | - WDViewDefaultType_ContentFailed, | ||
| 16 | -} | ||
| 17 | - | ||
| 18 | -/** | ||
| 19 | - * 空数据/无数据 | ||
| 20 | - */ | ||
| 21 | -@Preview | ||
| 22 | -@Component | ||
| 23 | -export struct MultiPictureDetailEmptyComponent { | ||
| 24 | - // private emptySize: SizeOptions = {}; | ||
| 25 | - @State emptyWidth: string | number = CommonConstants.FULL_PARENT; | ||
| 26 | - @State emptyHeight: string | number = CommonConstants.FULL_PARENT; | ||
| 27 | - @State emptyType: number = WDViewDefaultType.WDViewDefaultType_ContentFailed | ||
| 28 | - /** | ||
| 29 | - * The empty image width percentage setting. | ||
| 30 | - */ | ||
| 31 | - readonly EMPTY_IMAGE_WIDTH: string = '15%'; | ||
| 32 | - /** | ||
| 33 | - * The empty image height percentage setting. | ||
| 34 | - */ | ||
| 35 | - readonly EMPTY_IMAGE_HEIGHT: string = '15%'; | ||
| 36 | - /** | ||
| 37 | - * The empty data text component margin top. | ||
| 38 | - */ | ||
| 39 | - readonly EMPTY_TIP_TEXT_MARGIN_TOP: string = '10'; | ||
| 40 | - /** | ||
| 41 | - * The empty data text opacity. | ||
| 42 | - */ | ||
| 43 | - readonly TEXT_OPACITY: number = 1; | ||
| 44 | - | ||
| 45 | - build() { | ||
| 46 | - this.noProgrammeData(); | ||
| 47 | - } | ||
| 48 | - | ||
| 49 | - /** | ||
| 50 | - * 无数据,空白view组件 | ||
| 51 | - */ | ||
| 52 | - @Builder | ||
| 53 | - noProgrammeData() { | ||
| 54 | - Column() { | ||
| 55 | - Image(this.buildNoDataTipImage()) | ||
| 56 | - .width('this.EMPTY_IMAGE_WIDTH') | ||
| 57 | - .height(this.EMPTY_IMAGE_HEIGHT) | ||
| 58 | - .objectFit(ImageFit.Contain) | ||
| 59 | - // .border({ width: 1, color: Color.Red, radius: 6 }) | ||
| 60 | - | ||
| 61 | - Text(this.buildNoDataTip()) | ||
| 62 | - .fontSize($r('app.float.font_size_14')) | ||
| 63 | - .fontColor('#999999') | ||
| 64 | - .fontWeight(FontWeight.Normal) | ||
| 65 | - .opacity(this.TEXT_OPACITY) | ||
| 66 | - .margin({ top: this.EMPTY_TIP_TEXT_MARGIN_TOP }) | ||
| 67 | - .onClick((event: ClickEvent) => { | ||
| 68 | - Logger.info(TAG, `noProgrammeData onClick event?.source: ${event.source}`); | ||
| 69 | - }) | ||
| 70 | - Button('点击重试', { type: ButtonType.Normal, stateEffect: true }) | ||
| 71 | - .borderRadius(4) | ||
| 72 | - .margin(16) | ||
| 73 | - .height(28) | ||
| 74 | - .fontSize(12) | ||
| 75 | - .fontColor('#CCCCCC') | ||
| 76 | - .fontFamily('PingFang SC-Medium') | ||
| 77 | - .border({ width: 1, color: '#545454' }) | ||
| 78 | - .backgroundColor(Color.Black) | ||
| 79 | - } | ||
| 80 | - .justifyContent(FlexAlign.Center) | ||
| 81 | - .width(this.emptyWidth) | ||
| 82 | - .height(this.emptyHeight) | ||
| 83 | - .backgroundColor(Color.Black) | ||
| 84 | - } | ||
| 85 | - | ||
| 86 | - buildNoDataTip(): string { | ||
| 87 | - Logger.info(TAG, "buildNoDataTip"); | ||
| 88 | - let contentString: string = '获取内容失败请重试' | ||
| 89 | - if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoNetwork) { | ||
| 90 | - contentString = '网络出小差了,请检查网络后重试' | ||
| 91 | - } else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_ContentFailed) { | ||
| 92 | - contentString = '获取内容失败请重试' | ||
| 93 | - } | ||
| 94 | - | ||
| 95 | - return contentString | ||
| 96 | - } | ||
| 97 | - | ||
| 98 | - buildNoDataTipImage(): Resource | string { | ||
| 99 | - Logger.info(TAG, "buildNoDataTip"); | ||
| 100 | - let imageString: Resource | string = $r('app.media.icon_no_content') | ||
| 101 | - if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoNetwork) { | ||
| 102 | - imageString = $r('app.media.icon_no_net') | ||
| 103 | - } else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_ContentFailed) { | ||
| 104 | - imageString = $r('app.media.icon_no_content') | ||
| 105 | - } else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NetworkFailed) { | ||
| 106 | - imageString = $r('app.media.icon_no_net') | ||
| 107 | - } | ||
| 108 | - return imageString | ||
| 109 | - } | ||
| 110 | -} |
| 1 | import { PhotoListBean } from 'wdBean'; | 1 | import { PhotoListBean } from 'wdBean'; |
| 2 | import { Logger } from 'wdKit'; | 2 | import { Logger } from 'wdKit'; |
| 3 | +import router from '@ohos.router'; | ||
| 4 | +import display from '@ohos.display'; | ||
| 3 | 5 | ||
| 4 | const TAG = 'MultiPictureDetailPageComponent'; | 6 | const TAG = 'MultiPictureDetailPageComponent'; |
| 5 | 7 | ||
| 6 | @Component | 8 | @Component |
| 7 | export struct MultiPictureDetailItemComponent { | 9 | export struct MultiPictureDetailItemComponent { |
| 8 | private MultiPictureDetailItem: PhotoListBean = {} as PhotoListBean | 10 | private MultiPictureDetailItem: PhotoListBean = {} as PhotoListBean |
| 11 | + //alt app.media.picture_loading 设计稿尺寸 | ||
| 12 | + @State imageWidth:string | number = 167 | ||
| 13 | + @State ratio:number = 167/60 | ||
| 14 | + private scroller: Scroller = new Scroller() | ||
| 15 | + private displayTool = display.getDefaultDisplaySync() | ||
| 16 | + @State picHeight: number = 0 | ||
| 9 | 17 | ||
| 10 | 18 | ||
| 11 | async aboutToAppear() { | 19 | async aboutToAppear() { |
| 12 | Logger.info(TAG, 'pictures preview') | 20 | Logger.info(TAG, 'pictures preview') |
| 21 | + this.picHeight = this.displayTool.width * 578 / 375 | ||
| 13 | } | 22 | } |
| 14 | 23 | ||
| 15 | build() { | 24 | build() { |
| 16 | - Stack({ alignContent: Alignment.BottomStart }) { | ||
| 17 | - Row() { | ||
| 18 | - Image(this.MultiPictureDetailItem.picPath) | ||
| 19 | - .alt($r('app.media.picture_loading')) | ||
| 20 | - .width('100%') | ||
| 21 | - .aspectRatio(this.MultiPictureDetailItem.width / this.MultiPictureDetailItem.height) | ||
| 22 | - .objectFit(ImageFit.Fill) | ||
| 23 | - .interpolation(ImageInterpolation.High) | ||
| 24 | - } | ||
| 25 | - .height('100%') | ||
| 26 | - .width('100%') | 25 | + Row() { |
| 26 | + Image(this.MultiPictureDetailItem.picPath) | ||
| 27 | + .alt($r('app.media.picture_loading')) | ||
| 28 | + .width(this.imageWidth) | ||
| 29 | + .aspectRatio(this.ratio) | ||
| 30 | + .objectFit(ImageFit.Fill) | ||
| 31 | + .interpolation(ImageInterpolation.High) | ||
| 32 | + .onComplete(event => { | ||
| 33 | + this.imageWidth = '100%' | ||
| 34 | + this.ratio = this.MultiPictureDetailItem.width / this.MultiPictureDetailItem.height | ||
| 35 | + }) | ||
| 36 | + /*.onDrop(event => { | ||
| 37 | + router.back(); | ||
| 38 | + }) | ||
| 39 | + .draggable(true)*/ | ||
| 40 | + /*Scroll(this.scroller) { | ||
| 27 | 41 | ||
| 42 | + } | ||
| 43 | + .scrollable(ScrollDirection.Vertical) | ||
| 44 | + .scrollBarWidth(0) | ||
| 45 | + .height(px2vp(this.picHeight))*/ | ||
| 28 | } | 46 | } |
| 29 | - .backgroundColor(Color.Black) | 47 | + .height('100%') |
| 30 | .width('100%') | 48 | .width('100%') |
| 49 | + .backgroundColor(Color.Black) | ||
| 50 | + .justifyContent(FlexAlign.Center) | ||
| 31 | } | 51 | } |
| 32 | } | 52 | } |
| 1 | -import { Logger } from 'wdKit'; | 1 | +import { Logger, SPHelper } from 'wdKit'; |
| 2 | import { ResponseDTO } from 'wdNetwork'; | 2 | import { ResponseDTO } from 'wdNetwork'; |
| 3 | import { | 3 | import { |
| 4 | ContentDetailDTO, | 4 | ContentDetailDTO, |
| @@ -12,11 +12,12 @@ import display from '@ohos.display'; | @@ -12,11 +12,12 @@ import display from '@ohos.display'; | ||
| 12 | import font from '@ohos.font'; | 12 | import font from '@ohos.font'; |
| 13 | import { OperRowListView } from './view/OperRowListView'; | 13 | import { OperRowListView } from './view/OperRowListView'; |
| 14 | import { MultiPictureDetailItemComponent } from './MultiPictureDetailItemComponent'; | 14 | import { MultiPictureDetailItemComponent } from './MultiPictureDetailItemComponent'; |
| 15 | -import { MultiPictureDetailEmptyComponent } from './MultiPictureDetailEmptyComponent'; | 15 | +import { EmptyComponent } from './view/EmptyComponent'; |
| 16 | import { DateTimeUtils } from 'wdKit/Index'; | 16 | import { DateTimeUtils } from 'wdKit/Index'; |
| 17 | import { HttpUrlUtils } from 'wdNetwork/Index'; | 17 | import { HttpUrlUtils } from 'wdNetwork/Index'; |
| 18 | import { WDRouterPage, WDRouterRule } from 'wdRouter/Index'; | 18 | import { WDRouterPage, WDRouterRule } from 'wdRouter/Index'; |
| 19 | import { PageRepository } from '../repository/PageRepository'; | 19 | import { PageRepository } from '../repository/PageRepository'; |
| 20 | +import { SpConstants } from 'wdConstant/Index'; | ||
| 20 | 21 | ||
| 21 | const TAG = 'MultiPictureDetailPageComponent'; | 22 | const TAG = 'MultiPictureDetailPageComponent'; |
| 22 | 23 | ||
| @@ -36,7 +37,7 @@ export struct MultiPictureDetailPageComponent { | @@ -36,7 +37,7 @@ export struct MultiPictureDetailPageComponent { | ||
| 36 | @State swiperIndex: number = 0; | 37 | @State swiperIndex: number = 0; |
| 37 | @Provide followStatus: string = '0' // 关注状态 | 38 | @Provide followStatus: string = '0' // 关注状态 |
| 38 | private scroller: Scroller = new Scroller() | 39 | private scroller: Scroller = new Scroller() |
| 39 | - @State netStatus: number = 0 // 存储网络状态用来展示缺省图 | 40 | + @State netStatus: number | undefined = undefined // 存储网络状态用来展示缺省图 |
| 40 | 41 | ||
| 41 | //watch监听页码回调 | 42 | //watch监听页码回调 |
| 42 | onCurrentPageNumUpdated(): void { | 43 | onCurrentPageNumUpdated(): void { |
| @@ -238,8 +239,8 @@ export struct MultiPictureDetailPageComponent { | @@ -238,8 +239,8 @@ export struct MultiPictureDetailPageComponent { | ||
| 238 | .height(px2vp(this.titleHeight) + 64) | 239 | .height(px2vp(this.titleHeight) + 64) |
| 239 | 240 | ||
| 240 | } else { | 241 | } else { |
| 241 | - if (this.netStatus === 1) { | ||
| 242 | - MultiPictureDetailEmptyComponent({ emptyType: 2}) | 242 | + if(this.netStatus !== undefined) { |
| 243 | + EmptyComponent({ emptyType: this.netStatus}) | ||
| 243 | .id('e_empty_content') | 244 | .id('e_empty_content') |
| 244 | .alignRules({ | 245 | .alignRules({ |
| 245 | center: { anchor: "__container__", align: VerticalAlign.Center }, | 246 | center: { anchor: "__container__", align: VerticalAlign.Center }, |
| @@ -289,6 +290,9 @@ export struct MultiPictureDetailPageComponent { | @@ -289,6 +290,9 @@ export struct MultiPictureDetailPageComponent { | ||
| 289 | return | 290 | return |
| 290 | } | 291 | } |
| 291 | this.contentDetailData = resDTO.data?.[0]; | 292 | this.contentDetailData = resDTO.data?.[0]; |
| 293 | + if(this.contentDetailData?.photoList && this.contentDetailData?.photoList?.length === 0) { | ||
| 294 | + this.netStatus = 0 | ||
| 295 | + } | ||
| 292 | Logger.info(TAG, `contentDetailData:${JSON.stringify(this.contentDetailData)}`) | 296 | Logger.info(TAG, `contentDetailData:${JSON.stringify(this.contentDetailData)}`) |
| 293 | if (HttpUrlUtils.getUserId()) { | 297 | if (HttpUrlUtils.getUserId()) { |
| 294 | this.getInteractBrowsOperate() | 298 | this.getInteractBrowsOperate() |
| @@ -350,9 +354,10 @@ export struct MultiPictureDetailPageComponent { | @@ -350,9 +354,10 @@ export struct MultiPictureDetailPageComponent { | ||
| 350 | /** | 354 | /** |
| 351 | * 关注号主 | 355 | * 关注号主 |
| 352 | */ | 356 | */ |
| 353 | - handleAccention() { | 357 | + async handleAccention() { |
| 354 | // 未登录,跳转登录 | 358 | // 未登录,跳转登录 |
| 355 | - if (!HttpUrlUtils.getUserId()) { | 359 | + const user_id = await SPHelper.default.get(SpConstants.USER_ID, '') |
| 360 | + if (!user_id) { | ||
| 356 | WDRouterRule.jumpWithPage(WDRouterPage.loginPage) | 361 | WDRouterRule.jumpWithPage(WDRouterPage.loginPage) |
| 357 | return | 362 | return |
| 358 | } | 363 | } |
| 1 | -import { Action, ContentDetailDTO, } from 'wdBean'; | ||
| 2 | -import DetailViewModel from '../viewmodel/DetailViewModel'; | 1 | +import { Action, H5ReceiveDetailBean } from 'wdBean'; |
| 3 | import { WdWebComponent } from 'wdWebComponent'; | 2 | import { WdWebComponent } from 'wdWebComponent'; |
| 4 | import router from '@ohos.router'; | 3 | import router from '@ohos.router'; |
| 5 | import { CommonConstants } from 'wdConstant' | 4 | import { CommonConstants } from 'wdConstant' |
| 6 | import { BridgeWebViewControl } from 'wdJsBridge/Index'; | 5 | import { BridgeWebViewControl } from 'wdJsBridge/Index'; |
| 7 | import { detailedSkeleton } from './skeleton/detailSkeleton' | 6 | import { detailedSkeleton } from './skeleton/detailSkeleton' |
| 8 | - | 7 | +import { NativeCallH5Type } from 'wdWebComponent/src/main/ets/pages/NativeCallH5Type'; |
| 9 | const TAG = 'SpacialTopicPageComponent' | 8 | const TAG = 'SpacialTopicPageComponent' |
| 10 | 9 | ||
| 11 | @Component | 10 | @Component |
| @@ -15,6 +14,28 @@ export struct SpacialTopicPageComponent { | @@ -15,6 +14,28 @@ export struct SpacialTopicPageComponent { | ||
| 15 | action: Action = {} as Action | 14 | action: Action = {} as Action |
| 16 | @State webUrl: string = ''; | 15 | @State webUrl: string = ''; |
| 17 | @State isPageEnd: boolean = false | 16 | @State isPageEnd: boolean = false |
| 17 | + private h5ReceiveAppData: H5ReceiveDetailBean = { dataSource: '2' } as H5ReceiveDetailBean | ||
| 18 | + private webPrepared = false; | ||
| 19 | + private dataPrepared = false; | ||
| 20 | + | ||
| 21 | + private trySendData2H5() { | ||
| 22 | + if (!this.webPrepared || !this.dataPrepared) { | ||
| 23 | + return | ||
| 24 | + } | ||
| 25 | + // 数据、web组件,都准备好了,开始塞详情数据 | ||
| 26 | + this.sendContentData2H5(this.h5ReceiveAppData) | ||
| 27 | + } | ||
| 28 | + | ||
| 29 | + private onWebPrepared() { | ||
| 30 | + this.webPrepared = true | ||
| 31 | + this.trySendData2H5() | ||
| 32 | + } | ||
| 33 | + | ||
| 34 | + private sendContentData2H5(h5ReceiveAppData: H5ReceiveDetailBean) { | ||
| 35 | + this.webviewControl.callHandle(NativeCallH5Type.jsCall_receiveAppData, | ||
| 36 | + JSON.stringify(h5ReceiveAppData), (data: string) => { | ||
| 37 | + }) | ||
| 38 | + } | ||
| 18 | 39 | ||
| 19 | build() { | 40 | build() { |
| 20 | Column() { | 41 | Column() { |
| @@ -27,7 +48,8 @@ export struct SpacialTopicPageComponent { | @@ -27,7 +48,8 @@ export struct SpacialTopicPageComponent { | ||
| 27 | webviewControl: this.webviewControl, | 48 | webviewControl: this.webviewControl, |
| 28 | webUrl: this.webUrl, | 49 | webUrl: this.webUrl, |
| 29 | backVisibility: false, | 50 | backVisibility: false, |
| 30 | - isPageEnd:$isPageEnd | 51 | + onWebPrepared: this.onWebPrepared.bind(this), |
| 52 | + isPageEnd: $isPageEnd | ||
| 31 | }) | 53 | }) |
| 32 | } | 54 | } |
| 33 | .padding({ bottom: 56 }) | 55 | .padding({ bottom: 56 }) |
| @@ -72,7 +94,6 @@ export struct SpacialTopicPageComponent { | @@ -72,7 +94,6 @@ export struct SpacialTopicPageComponent { | ||
| 72 | .justifyContent(FlexAlign.SpaceBetween) | 94 | .justifyContent(FlexAlign.SpaceBetween) |
| 73 | .backgroundColor(Color.White) | 95 | .backgroundColor(Color.White) |
| 74 | 96 | ||
| 75 | - | ||
| 76 | } | 97 | } |
| 77 | }.width(CommonConstants.FULL_WIDTH).height(CommonConstants.FULL_HEIGHT) | 98 | }.width(CommonConstants.FULL_WIDTH).height(CommonConstants.FULL_HEIGHT) |
| 78 | .backgroundColor(Color.White) | 99 | .backgroundColor(Color.White) |
| @@ -83,8 +104,10 @@ export struct SpacialTopicPageComponent { | @@ -83,8 +104,10 @@ export struct SpacialTopicPageComponent { | ||
| 83 | if (action) { | 104 | if (action) { |
| 84 | this.webUrl = action.params?.url || '' | 105 | this.webUrl = action.params?.url || '' |
| 85 | } | 106 | } |
| 107 | + this.trySendData2H5() | ||
| 86 | } | 108 | } |
| 87 | 109 | ||
| 88 | aboutToDisappear() { | 110 | aboutToDisappear() { |
| 111 | + | ||
| 89 | } | 112 | } |
| 90 | } | 113 | } |
| @@ -11,7 +11,7 @@ export struct LiveCommentComponent { | @@ -11,7 +11,7 @@ export struct LiveCommentComponent { | ||
| 11 | 11 | ||
| 12 | build() { | 12 | build() { |
| 13 | Row() { | 13 | Row() { |
| 14 | - Image($r('app.media.back_icon')) | 14 | + Image($r('app.media.iv_back_left_black')) |
| 15 | .width(24) | 15 | .width(24) |
| 16 | .height(24) | 16 | .height(24) |
| 17 | .margin({ | 17 | .margin({ |
| @@ -71,7 +71,7 @@ export struct LiveCommentComponent { | @@ -71,7 +71,7 @@ export struct LiveCommentComponent { | ||
| 71 | left: 6, | 71 | left: 6, |
| 72 | right: 2 | 72 | right: 2 |
| 73 | }) | 73 | }) |
| 74 | - Image(this.isLike ? $r('app.media.iv_live_comment_hert_light') : $r('app.media.comment_like_normal')) | 74 | + Image(this.isLike ? $r('app.media.icon_like_selected_redheart') : $r('app.media.iv_live_heart_normal')) |
| 75 | .width(24) | 75 | .width(24) |
| 76 | .height(24) | 76 | .height(24) |
| 77 | .margin({ | 77 | .margin({ |
| 1 | import { CompDTO, ContentDTO } from 'wdBean'; | 1 | import { CompDTO, ContentDTO } from 'wdBean'; |
| 2 | import { CommonConstants } from 'wdConstant/Index'; | 2 | import { CommonConstants } from 'wdConstant/Index'; |
| 3 | -import { CollectionUtils, DateTimeUtils, Logger, StringUtils, ToastUtils } from 'wdKit/Index'; | 3 | +import { Logger } from 'wdKit/Index'; |
| 4 | import PageViewModel from '../../viewmodel/PageViewModel'; | 4 | import PageViewModel from '../../viewmodel/PageViewModel'; |
| 5 | 5 | ||
| 6 | const TAG = 'Zh_Grid_Layout-02'; | 6 | const TAG = 'Zh_Grid_Layout-02'; |
| @@ -31,8 +31,6 @@ export struct ZhGridLayout02 { | @@ -31,8 +31,6 @@ export struct ZhGridLayout02 { | ||
| 31 | 31 | ||
| 32 | build() { | 32 | build() { |
| 33 | Column() { | 33 | Column() { |
| 34 | - | ||
| 35 | - | ||
| 36 | Scroll() { | 34 | Scroll() { |
| 37 | Column() { | 35 | Column() { |
| 38 | Row() { | 36 | Row() { |
| @@ -46,10 +44,12 @@ export struct ZhGridLayout02 { | @@ -46,10 +44,12 @@ export struct ZhGridLayout02 { | ||
| 46 | .fontWeight(600) | 44 | .fontWeight(600) |
| 47 | } | 45 | } |
| 48 | .justifyContent(FlexAlign.Start) | 46 | .justifyContent(FlexAlign.Start) |
| 47 | + | ||
| 49 | .margin({ top: 8, bottom: 8 }) | 48 | .margin({ top: 8, bottom: 8 }) |
| 50 | .width(CommonConstants.FULL_WIDTH) | 49 | .width(CommonConstants.FULL_WIDTH) |
| 51 | 50 | ||
| 52 | GridRow({ | 51 | GridRow({ |
| 52 | + gutter: { x: 12, y: 22 }, | ||
| 53 | columns: { sm: listSize, md: 2 }, | 53 | columns: { sm: listSize, md: 2 }, |
| 54 | breakpoints: { value: ['320vp', '520vp', '840vp'] } | 54 | breakpoints: { value: ['320vp', '520vp', '840vp'] } |
| 55 | }) { | 55 | }) { |
| @@ -60,7 +60,6 @@ export struct ZhGridLayout02 { | @@ -60,7 +60,6 @@ export struct ZhGridLayout02 { | ||
| 60 | }) | 60 | }) |
| 61 | } | 61 | } |
| 62 | } | 62 | } |
| 63 | - | ||
| 64 | } | 63 | } |
| 65 | .width("100%") | 64 | .width("100%") |
| 66 | .height("100%") | 65 | .height("100%") |
| @@ -82,12 +81,9 @@ export struct ZhGridLayout02 { | @@ -82,12 +81,9 @@ export struct ZhGridLayout02 { | ||
| 82 | .width(CommonConstants.FULL_WIDTH) | 81 | .width(CommonConstants.FULL_WIDTH) |
| 83 | // .width("100%") | 82 | // .width("100%") |
| 84 | .height("100%") | 83 | .height("100%") |
| 84 | + .padding({ left: 16, right: 16 }) | ||
| 85 | + | ||
| 85 | // .layoutWeight(1) | 86 | // .layoutWeight(1) |
| 86 | - .padding({ | ||
| 87 | - top: 14, | ||
| 88 | - left: 16, | ||
| 89 | - right: 16 | ||
| 90 | - }) | ||
| 91 | 87 | ||
| 92 | } | 88 | } |
| 93 | 89 | ||
| @@ -100,9 +96,9 @@ export struct ZhGridLayout02 { | @@ -100,9 +96,9 @@ export struct ZhGridLayout02 { | ||
| 100 | buildItemCard(item: ContentDTO) { | 96 | buildItemCard(item: ContentDTO) { |
| 101 | Column() { | 97 | Column() { |
| 102 | Image(item.fullColumnImgUrls[0].url) | 98 | Image(item.fullColumnImgUrls[0].url) |
| 103 | - .width(170) | 99 | + .width('100%') |
| 104 | .height(95) | 100 | .height(95) |
| 105 | - .margin(16) | 101 | + .borderRadius(4) |
| 106 | Text(item.newsTitle) | 102 | Text(item.newsTitle) |
| 107 | .fontSize(13) | 103 | .fontSize(13) |
| 108 | .maxLines(2) | 104 | .maxLines(2) |
| @@ -2,18 +2,18 @@ import { CompDTO, ContentDTO, Params } from 'wdBean'; | @@ -2,18 +2,18 @@ import { CompDTO, ContentDTO, Params } from 'wdBean'; | ||
| 2 | import { WDRouterPage, WDRouterRule } from 'wdRouter/Index'; | 2 | import { WDRouterPage, WDRouterRule } from 'wdRouter/Index'; |
| 3 | import { HttpUrlUtils } from 'wdNetwork/Index'; | 3 | import { HttpUrlUtils } from 'wdNetwork/Index'; |
| 4 | import { postInteractAccentionOperateParams } from 'wdBean'; | 4 | import { postInteractAccentionOperateParams } from 'wdBean'; |
| 5 | -import { PageRepository } from '../repository/PageRepository'; | 5 | +import { PageRepository } from '../../repository/PageRepository'; |
| 6 | import { CommonConstants } from 'wdConstant/Index'; | 6 | import { CommonConstants } from 'wdConstant/Index'; |
| 7 | 7 | ||
| 8 | /** | 8 | /** |
| 9 | - * 精选评论卡 | ||
| 10 | - * Zh_Single_Row-06 | 9 | + * 兴趣卡 |
| 10 | + * Zh_Single_Column-09 | ||
| 11 | */ | 11 | */ |
| 12 | -const TAG = 'Zh_Single_Row-06' | 12 | +const TAG = 'Zh_Single_Column-09' |
| 13 | 13 | ||
| 14 | @Entry | 14 | @Entry |
| 15 | @Component | 15 | @Component |
| 16 | -export struct ZhSingleRow06 { | 16 | +export struct ZhSingleColumn09 { |
| 17 | @State compDTO: CompDTO = {} as CompDTO | 17 | @State compDTO: CompDTO = {} as CompDTO |
| 18 | @State list: Array<string> = ['社会', '三个字', '是四个字', '时事', '社会', '三个字', '是四个字', '时事'] | 18 | @State list: Array<string> = ['社会', '三个字', '是四个字', '时事', '社会', '三个字', '是四个字', '时事'] |
| 19 | @State activeIndexs: Array<number> = [] | 19 | @State activeIndexs: Array<number> = [] |
| @@ -31,14 +31,29 @@ export struct ZhSingleRow06 { | @@ -31,14 +31,29 @@ export struct ZhSingleRow06 { | ||
| 31 | //顶部 | 31 | //顶部 |
| 32 | this.CompHeader(this.compDTO) | 32 | this.CompHeader(this.compDTO) |
| 33 | Grid() { | 33 | Grid() { |
| 34 | - ForEach(this.list, (item: string, index: number) => { | 34 | + ForEach(this.compDTO.operDataList, (item: ContentDTO, index: number) => { |
| 35 | GridItem() { | 35 | GridItem() { |
| 36 | - Text(item) | ||
| 37 | - .fontSize(14) | ||
| 38 | - .fontColor(this.activeIndexs.includes(index) ? 0x222222 : 0x666666) | ||
| 39 | - .fontWeight(this.activeIndexs.includes(index) ? 600 : 400) | ||
| 40 | - .textAlign(TextAlign.Center) | 36 | + Stack({alignContent: Alignment.TopEnd}) { |
| 37 | + Image(item.coverUrl) | ||
| 38 | + .width('100%') | ||
| 39 | + .height('100%') | ||
| 40 | + Text(item.newsTitle) | ||
| 41 | + .width('100%') | ||
| 42 | + .height('100%') | ||
| 43 | + .fontSize(14) | ||
| 44 | + .textAlign(TextAlign.Center) | ||
| 45 | + .fontColor(0xffffff) | ||
| 46 | + Image($r('app.media.icon_selected')) | ||
| 47 | + .width(19) | ||
| 48 | + .height(19) | ||
| 49 | + .opacity(this.activeIndexs.includes(index) ? 1 : 0) | ||
| 50 | + .objectFit(ImageFit.Contain) | ||
| 51 | + } | ||
| 52 | + .width('100%') | ||
| 53 | + .height('100%') | ||
| 54 | + .borderRadius(4) | ||
| 41 | } | 55 | } |
| 56 | + .margin({right: index % 4 === 3 ? 0 : 6, bottom: 6}) | ||
| 42 | .onClick(() => { | 57 | .onClick(() => { |
| 43 | if (this.activeIndexs.includes(index)) { | 58 | if (this.activeIndexs.includes(index)) { |
| 44 | const ind = this.activeIndexs.indexOf(index); | 59 | const ind = this.activeIndexs.indexOf(index); |
| @@ -49,29 +64,32 @@ export struct ZhSingleRow06 { | @@ -49,29 +64,32 @@ export struct ZhSingleRow06 { | ||
| 49 | }) | 64 | }) |
| 50 | }) | 65 | }) |
| 51 | } | 66 | } |
| 52 | - .height(70) | 67 | + .height(90) |
| 53 | .columnsTemplate('1fr 1fr 1fr 1fr') | 68 | .columnsTemplate('1fr 1fr 1fr 1fr') |
| 54 | .rowsTemplate('1fr 1fr') | 69 | .rowsTemplate('1fr 1fr') |
| 55 | .margin({bottom: 10}) | 70 | .margin({bottom: 10}) |
| 56 | 71 | ||
| 57 | - | ||
| 58 | - Text('选中标签,为您推荐更多您感兴趣的内容') | ||
| 59 | - .fontSize(12) | ||
| 60 | - .fontColor(0xB0B0B0) | ||
| 61 | - .textAlign(TextAlign.Center) | ||
| 62 | - .margin({bottom: 10}) | ||
| 63 | - | ||
| 64 | Row() { | 72 | Row() { |
| 65 | - Text('选好了') | ||
| 66 | - .fontSize(14) | ||
| 67 | - .fontColor(0x000000) | ||
| 68 | - .width('100%') | ||
| 69 | - .textAlign(TextAlign.Center) | 73 | + Row() { |
| 74 | + Text('换一换') | ||
| 75 | + .fontSize(14) | ||
| 76 | + .fontColor(0xed2800) | ||
| 77 | + .margin({right: 4}) | ||
| 78 | + Image($r('app.media.icon_refresh')) | ||
| 79 | + .width(14) | ||
| 80 | + .height(14) | ||
| 81 | + } | ||
| 82 | + | ||
| 83 | + Image($r("app.media.close_button")) | ||
| 84 | + .width(14) | ||
| 85 | + .height(14) | ||
| 86 | + .onClick(() => { | ||
| 87 | + }) | ||
| 70 | } | 88 | } |
| 71 | .height(40) | 89 | .height(40) |
| 72 | - .backgroundColor(0xf9f9f9) | ||
| 73 | .width('100%') | 90 | .width('100%') |
| 74 | .borderRadius(3) | 91 | .borderRadius(3) |
| 92 | + .justifyContent(FlexAlign.SpaceBetween) | ||
| 75 | } | 93 | } |
| 76 | .padding({ | 94 | .padding({ |
| 77 | left: $r('app.float.card_comp_pagePadding_lf'), | 95 | left: $r('app.float.card_comp_pagePadding_lf'), |
| @@ -87,30 +105,34 @@ export struct ZhSingleRow06 { | @@ -87,30 +105,34 @@ export struct ZhSingleRow06 { | ||
| 87 | @Builder | 105 | @Builder |
| 88 | CompHeader(item: CompDTO) { | 106 | CompHeader(item: CompDTO) { |
| 89 | Row() { | 107 | Row() { |
| 90 | - Row() { | ||
| 91 | - Image($r("app.media.icon_interest_ask")) | ||
| 92 | - .width(24) | ||
| 93 | - .height(24) | ||
| 94 | - .margin({ right: 4 }) | 108 | + Column() { |
| 95 | Text('以下是否有您感兴趣?') | 109 | Text('以下是否有您感兴趣?') |
| 96 | - .fontSize($r("app.float.font_size_17")) | 110 | + .fontSize(18) |
| 97 | .fontColor(0x000000) | 111 | .fontColor(0x000000) |
| 98 | .fontWeight(600) | 112 | .fontWeight(600) |
| 113 | + .width('70%') | ||
| 114 | + .margin({bottom: 4}) | ||
| 115 | + | ||
| 116 | + Text('选中标签,为您推荐更多您感兴趣的内容') | ||
| 117 | + .fontSize(12) | ||
| 118 | + .fontColor(0xB0B0B0) | ||
| 119 | + .margin({bottom: 10}) | ||
| 120 | + .width('70%') | ||
| 99 | } | 121 | } |
| 100 | 122 | ||
| 101 | - Row() { | ||
| 102 | - Image($r("app.media.close_button")) | ||
| 103 | - .width(14) | ||
| 104 | - .height(14) | ||
| 105 | - .onClick(() => { | ||
| 106 | - }) | ||
| 107 | - } | ||
| 108 | - .padding({ | ||
| 109 | - right: $r('app.float.card_comp_pagePadding_lf'), | ||
| 110 | - }) | 123 | + Text('选好了') |
| 124 | + .fontColor(0xed2800) | ||
| 125 | + .fontSize(14) | ||
| 126 | + .width(62) | ||
| 127 | + .height(26) | ||
| 128 | + .backgroundColor(0xfdf0ed) | ||
| 129 | + .textAlign(TextAlign.Center) | ||
| 130 | + // .lineHeight(26) | ||
| 131 | + .borderRadius(4) | ||
| 132 | + .margin({top: -10}) | ||
| 133 | + | ||
| 111 | } | 134 | } |
| 112 | .justifyContent(FlexAlign.SpaceBetween) | 135 | .justifyContent(FlexAlign.SpaceBetween) |
| 113 | - .margin({ top: 8, bottom: 8 }) | ||
| 114 | .width('100%') | 136 | .width('100%') |
| 115 | } | 137 | } |
| 116 | } | 138 | } |
| @@ -119,107 +141,4 @@ export struct ZhSingleRow06 { | @@ -119,107 +141,4 @@ export struct ZhSingleRow06 { | ||
| 119 | function textOverflowStyle(maxLine: number) { | 141 | function textOverflowStyle(maxLine: number) { |
| 120 | .maxLines(maxLine) | 142 | .maxLines(maxLine) |
| 121 | .textOverflow({ overflow: TextOverflow.Ellipsis }) | 143 | .textOverflow({ overflow: TextOverflow.Ellipsis }) |
| 122 | -} | ||
| 123 | - | ||
| 124 | -@Component | ||
| 125 | -struct CreatorItem { | ||
| 126 | - @Prop item: ContentDTO | ||
| 127 | - @State rmhIsAttention: number = 0 | ||
| 128 | - build() { | ||
| 129 | - ListItem() { | ||
| 130 | - Column() { | ||
| 131 | - Flex({direction: FlexDirection.Row, justifyContent: FlexAlign.SpaceBetween}) { | ||
| 132 | - Column() { | ||
| 133 | - Row() { | ||
| 134 | - Image('') | ||
| 135 | - .width(20) | ||
| 136 | - .height(20) | ||
| 137 | - .margin({right: 4}) | ||
| 138 | - .border({width: 1, color: 0xcccccc, radius: 10}) | ||
| 139 | - Text('立志之间') | ||
| 140 | - .fontColor(0x212228) | ||
| 141 | - .fontSize(12) | ||
| 142 | - } | ||
| 143 | - } | ||
| 144 | - | ||
| 145 | - Column() { | ||
| 146 | - Row() { | ||
| 147 | - Image($r('app.media.icon_like_no')) | ||
| 148 | - .width(16) | ||
| 149 | - .height(16) | ||
| 150 | - .margin({right: 4}) | ||
| 151 | - Text('3835') | ||
| 152 | - .fontSize(14) | ||
| 153 | - .fontColor(0x999999) | ||
| 154 | - } | ||
| 155 | - } | ||
| 156 | - } | ||
| 157 | - .margin({top: 10, left: 10, right: 10, bottom: 8}) | ||
| 158 | - | ||
| 159 | - Text('就业不仅是民生问题,也是发展问题,就业不仅是民生问题,也是发展问题,就业不仅是民生问题,也是发展问题,') | ||
| 160 | - .maxLines(2) | ||
| 161 | - .textOverflow({overflow: TextOverflow.Ellipsis}) | ||
| 162 | - .margin({left: 10, right: 10, bottom: 8}) | ||
| 163 | - .fontSize(17) | ||
| 164 | - .fontColor(0x212228) | ||
| 165 | - .lineHeight(25) | ||
| 166 | - | ||
| 167 | - Row() { | ||
| 168 | - Image('') | ||
| 169 | - .width(66) | ||
| 170 | - .height(44) | ||
| 171 | - .borderRadius({topLeft: 3, topRight: 0, bottomLeft: 3, bottomRight: 0}) | ||
| 172 | - Text('原文|强化就业优先政策 健全就业促进机制原文|强化就业优先政策 健全就业促进机制原文|强化就业优先政策 健全就业促进机制') | ||
| 173 | - .margin({left: 8}) | ||
| 174 | - .width(172) | ||
| 175 | - .maxLines(2) | ||
| 176 | - .textOverflow({overflow: TextOverflow.Ellipsis}) | ||
| 177 | - } | ||
| 178 | - .linearGradient({ | ||
| 179 | - direction: GradientDirection.Right, | ||
| 180 | - colors: [[0xffffff, 0.0],[0xffffff, 0.8], [0xf9f9f9, 1.0]] | ||
| 181 | - }) | ||
| 182 | - } | ||
| 183 | - .width(276) | ||
| 184 | - .height(150) | ||
| 185 | - .margin({ right: 10 }) | ||
| 186 | - .borderWidth(1) | ||
| 187 | - .borderColor($r('app.color.color_EDEDED')) | ||
| 188 | - .borderRadius($r('app.float.image_border_radius')) | ||
| 189 | - .backgroundColor(0xf9f9f9) | ||
| 190 | - } | ||
| 191 | - .onClick(() => { | ||
| 192 | - console.log('跳转到rmh'); | ||
| 193 | - }) | ||
| 194 | - } | ||
| 195 | - | ||
| 196 | - /** | ||
| 197 | - * 关注号主 TODO 这里后面需要抽离 | ||
| 198 | - */ | ||
| 199 | - handleAccention(item: ContentDTO, status: number) { | ||
| 200 | - this.rmhIsAttention = this.rmhIsAttention ? 0 : 1 | ||
| 201 | - return | ||
| 202 | - // 未登录,跳转登录 | ||
| 203 | - if (!HttpUrlUtils.getUserId()) { | ||
| 204 | - WDRouterRule.jumpWithPage(WDRouterPage.loginPage) | ||
| 205 | - return | ||
| 206 | - } | ||
| 207 | - | ||
| 208 | - const params: postInteractAccentionOperateParams = { | ||
| 209 | - attentionUserType: item.rmhInfo?.userType || '', //被关注用户类型(1 普通用户 2 视频号 3 矩阵号) | ||
| 210 | - attentionUserId: item.rmhInfo?.userId || '', // 被关注用户号主id | ||
| 211 | - attentionCreatorId: item.rmhInfo?.rmhId || '', // 被关注用户号主id | ||
| 212 | - // userType: 1, | ||
| 213 | - // userId: '1', // TODO 用户id需要从本地获取 | ||
| 214 | - status: status, | ||
| 215 | - } | ||
| 216 | - PageRepository.postInteractAccentionOperate(params).then(res => { | ||
| 217 | - console.log(TAG, '关注号主==', JSON.stringify(res.data)) | ||
| 218 | - if (status === 1) { | ||
| 219 | - this.rmhIsAttention = 0 | ||
| 220 | - } else { | ||
| 221 | - this.rmhIsAttention = 1 | ||
| 222 | - } | ||
| 223 | - }) | ||
| 224 | - } | ||
| 225 | -} | 144 | +} |
| @@ -4,6 +4,7 @@ import { HttpUrlUtils } from 'wdNetwork/Index'; | @@ -4,6 +4,7 @@ import { HttpUrlUtils } from 'wdNetwork/Index'; | ||
| 4 | import { postInteractAccentionOperateParams } from 'wdBean'; | 4 | import { postInteractAccentionOperateParams } from 'wdBean'; |
| 5 | import { PageRepository } from '../../repository/PageRepository'; | 5 | import { PageRepository } from '../../repository/PageRepository'; |
| 6 | import { CommonConstants } from 'wdConstant/Index'; | 6 | import { CommonConstants } from 'wdConstant/Index'; |
| 7 | +import { ProcessUtils } from '../../utils/ProcessUtils'; | ||
| 7 | 8 | ||
| 8 | /** | 9 | /** |
| 9 | * 小视频横划卡 | 10 | * 小视频横划卡 |
| @@ -11,59 +12,9 @@ import { CommonConstants } from 'wdConstant/Index'; | @@ -11,59 +12,9 @@ import { CommonConstants } from 'wdConstant/Index'; | ||
| 11 | */ | 12 | */ |
| 12 | const TAG = 'Zh_Single_Row-02' | 13 | const TAG = 'Zh_Single_Row-02' |
| 13 | 14 | ||
| 14 | -@Entry | ||
| 15 | @Component | 15 | @Component |
| 16 | export struct ZhSingleRow02 { | 16 | export struct ZhSingleRow02 { |
| 17 | - @State compDTO: CompDTO = { | ||
| 18 | - objectTitle: '大标题', | ||
| 19 | - operDataList: [ | ||
| 20 | - { | ||
| 21 | - rmhInfo: { | ||
| 22 | - rmhId: '2489729', | ||
| 23 | - rmhName: '陕西青年职业学院', | ||
| 24 | - rmhDesc: '陕西青年职业学院陕西青年职业学院是经陕西省人民政陕西青年职业学院是经陕西省人民政是经陕西省人民政', | ||
| 25 | - rmhHeadUrl: 'https://cdnjdphoto.aikan.pdnews.cn//upload/ueditor/image/20210113/a_533807397399949312' + | ||
| 26 | - '.png?x-oss-process=image/resize,l_100/auto-orient,1/quality,q_90/format,jpg' | ||
| 27 | - } | ||
| 28 | - }, | ||
| 29 | - { | ||
| 30 | - rmhInfo: { | ||
| 31 | - rmhId: '2489729', | ||
| 32 | - rmhName: '陕西青年职业学院', | ||
| 33 | - rmhDesc: '陕西青年职业学院陕西青年职业学院是经陕西省人民政陕西青年职业学院是经陕西省人民政是经陕西省人民政', | ||
| 34 | - rmhHeadUrl: 'https://cdnjdphoto.aikan.pdnews.cn//upload/ueditor/image/20210113/a_533807397399949312' + | ||
| 35 | - '.png?x-oss-process=image/resize,l_100/auto-orient,1/quality,q_90/format,jpg' | ||
| 36 | - } | ||
| 37 | - }, | ||
| 38 | - { | ||
| 39 | - rmhInfo: { | ||
| 40 | - rmhId: '2489729', | ||
| 41 | - rmhName: '陕西青年职业学院', | ||
| 42 | - rmhDesc: '陕西青年职业学院陕西青年职业学院是经陕西省人民政陕西青年职业学院是经陕西省人民政是经陕西省人民政', | ||
| 43 | - rmhHeadUrl: 'https://cdnjdphoto.aikan.pdnews.cn//upload/ueditor/image/20210113/a_533807397399949312' + | ||
| 44 | - '.png?x-oss-process=image/resize,l_100/auto-orient,1/quality,q_90/format,jpg' | ||
| 45 | - } | ||
| 46 | - }, | ||
| 47 | - { | ||
| 48 | - rmhInfo: { | ||
| 49 | - rmhId: '2489729', | ||
| 50 | - rmhName: '陕西青年职业学院', | ||
| 51 | - rmhDesc: '陕西青年职业学院陕西青年职业学院是经陕西省人民政陕西青年职业学院是经陕西省人民政是经陕西省人民政', | ||
| 52 | - rmhHeadUrl: 'https://cdnjdphoto.aikan.pdnews.cn//upload/ueditor/image/20210113/a_533807397399949312' + | ||
| 53 | - '.png?x-oss-process=image/resize,l_100/auto-orient,1/quality,q_90/format,jpg' | ||
| 54 | - } | ||
| 55 | - }, | ||
| 56 | - { | ||
| 57 | - rmhInfo: { | ||
| 58 | - rmhId: '2489729', | ||
| 59 | - rmhName: '陕西青年职业学院', | ||
| 60 | - rmhDesc: '陕西青年职业学院陕西青年职业学院是经陕西省人民政陕西青年职业学院是经陕西省人民政是经陕西省人民政', | ||
| 61 | - rmhHeadUrl: 'https://cdnjdphoto.aikan.pdnews.cn//upload/ueditor/image/20210113/a_533807397399949312' + | ||
| 62 | - '.png?x-oss-process=image/resize,l_100/auto-orient,1/quality,q_90/format,jpg' | ||
| 63 | - } | ||
| 64 | - }, | ||
| 65 | - ] | ||
| 66 | - } as CompDTO | 17 | + @State compDTO: CompDTO = {} as CompDTO |
| 67 | 18 | ||
| 68 | build() { | 19 | build() { |
| 69 | Column() { | 20 | Column() { |
| @@ -127,6 +78,12 @@ export struct ZhSingleRow02 { | @@ -127,6 +78,12 @@ export struct ZhSingleRow02 { | ||
| 127 | .padding({ | 78 | .padding({ |
| 128 | right: $r('app.float.card_comp_pagePadding_lf'), | 79 | right: $r('app.float.card_comp_pagePadding_lf'), |
| 129 | }) | 80 | }) |
| 81 | + .onClick(() => { | ||
| 82 | + let params: Params = { | ||
| 83 | + pageID: "1" | ||
| 84 | + } | ||
| 85 | + WDRouterRule.jumpWithPage(WDRouterPage.followListPage, params) | ||
| 86 | + }) | ||
| 130 | } | 87 | } |
| 131 | .justifyContent(FlexAlign.SpaceBetween) | 88 | .justifyContent(FlexAlign.SpaceBetween) |
| 132 | .margin({ top: 8, bottom: 8 }) | 89 | .margin({ top: 8, bottom: 8 }) |
| @@ -148,7 +105,7 @@ struct CreatorItem { | @@ -148,7 +105,7 @@ struct CreatorItem { | ||
| 148 | ListItem() { | 105 | ListItem() { |
| 149 | Column() { | 106 | Column() { |
| 150 | Stack({ alignContent: Alignment.Bottom }) { | 107 | Stack({ alignContent: Alignment.Bottom }) { |
| 151 | - Image('') | 108 | + Image(this.item.coverUrl) |
| 152 | .width(156) | 109 | .width(156) |
| 153 | .height(208) | 110 | .height(208) |
| 154 | Row() | 111 | Row() |
| @@ -156,29 +113,25 @@ struct CreatorItem { | @@ -156,29 +113,25 @@ struct CreatorItem { | ||
| 156 | .height(80) | 113 | .height(80) |
| 157 | .linearGradient({ | 114 | .linearGradient({ |
| 158 | direction: GradientDirection.Bottom, | 115 | direction: GradientDirection.Bottom, |
| 159 | - colors: [[0xffffff, 0.0], [0x000000, 1.0]] | 116 | + colors: [['rgba(0, 0, 0, 0.0)', 0.0], ['rgba(0, 0, 0, 0.3)', 1.0]] |
| 160 | }) | 117 | }) |
| 161 | - .opacity(0.3) | ||
| 162 | - Text('这里显示卡片标题这里显示卡片标题这里显示卡片标题这里显示卡片标题这里显示卡片标题') | 118 | + Text(this.item.newsTitle) |
| 163 | .fontColor(0xffffff) | 119 | .fontColor(0xffffff) |
| 164 | .fontSize(14) | 120 | .fontSize(14) |
| 165 | .maxLines(2) | 121 | .maxLines(2) |
| 166 | .textOverflow({overflow: TextOverflow.Ellipsis}) | 122 | .textOverflow({overflow: TextOverflow.Ellipsis}) |
| 167 | .width(140) | 123 | .width(140) |
| 168 | - .height(40) | ||
| 169 | .margin({bottom: 8}) | 124 | .margin({bottom: 8}) |
| 170 | } | 125 | } |
| 171 | - | ||
| 172 | } | 126 | } |
| 173 | .width(156) | 127 | .width(156) |
| 174 | .height(208) | 128 | .height(208) |
| 175 | .margin({ right: 11 }) | 129 | .margin({ right: 11 }) |
| 176 | - .borderWidth(1) | ||
| 177 | .borderColor($r('app.color.color_EDEDED')) | 130 | .borderColor($r('app.color.color_EDEDED')) |
| 178 | .borderRadius($r('app.float.image_border_radius')) | 131 | .borderRadius($r('app.float.image_border_radius')) |
| 179 | } | 132 | } |
| 180 | - .onClick(() => { | ||
| 181 | - console.log('跳转到rmh'); | 133 | + .onClick((event: ClickEvent) => { |
| 134 | + ProcessUtils.processPage(this.item) | ||
| 182 | }) | 135 | }) |
| 183 | } | 136 | } |
| 184 | 137 |
| @@ -3,7 +3,9 @@ import { WDRouterPage, WDRouterRule } from 'wdRouter/Index'; | @@ -3,7 +3,9 @@ import { WDRouterPage, WDRouterRule } from 'wdRouter/Index'; | ||
| 3 | import { HttpUrlUtils } from 'wdNetwork/Index'; | 3 | import { HttpUrlUtils } from 'wdNetwork/Index'; |
| 4 | import { postInteractAccentionOperateParams } from 'wdBean'; | 4 | import { postInteractAccentionOperateParams } from 'wdBean'; |
| 5 | import { PageRepository } from '../../repository/PageRepository'; | 5 | import { PageRepository } from '../../repository/PageRepository'; |
| 6 | +import { DateTimeUtils } from 'wdKit/Index'; | ||
| 6 | import { CommonConstants } from 'wdConstant/Index'; | 7 | import { CommonConstants } from 'wdConstant/Index'; |
| 8 | +import { ProcessUtils } from '../../utils/ProcessUtils'; | ||
| 7 | 9 | ||
| 8 | /** | 10 | /** |
| 9 | * 精选评论卡 | 11 | * 精选评论卡 |
| @@ -11,125 +13,124 @@ import { CommonConstants } from 'wdConstant/Index'; | @@ -11,125 +13,124 @@ import { CommonConstants } from 'wdConstant/Index'; | ||
| 11 | */ | 13 | */ |
| 12 | const TAG = 'Zh_Single_Row-06' | 14 | const TAG = 'Zh_Single_Row-06' |
| 13 | 15 | ||
| 14 | -@Entry | 16 | +// interface commentInfo { |
| 17 | +// commentTitle: string, | ||
| 18 | +// newsTitle: string, | ||
| 19 | +// userName: string, | ||
| 20 | +// userHeaderUrl: string, | ||
| 21 | +// publishTime: number | ||
| 22 | +// } | ||
| 23 | +// interface operDataListItem { | ||
| 24 | +// commentInfo: commentInfo | ||
| 25 | +// } | ||
| 26 | +// interface CommentData{ | ||
| 27 | +// operDataList: Array<operDataListItem> | ||
| 28 | +// } | ||
| 29 | + | ||
| 15 | @Component | 30 | @Component |
| 16 | export struct ZhSingleRow06 { | 31 | export struct ZhSingleRow06 { |
| 17 | - @State compDTO: CompDTO = { | ||
| 18 | - objectTitle: '大标题', | ||
| 19 | - operDataList: [ | ||
| 20 | - { | ||
| 21 | - rmhInfo: { | ||
| 22 | - rmhId: '2489729', | ||
| 23 | - rmhName: '陕西青年职业学院', | ||
| 24 | - rmhDesc: '陕西青年职业学院陕西青年职业学院是经陕西省人民政陕西青年职业学院是经陕西省人民政是经陕西省人民政', | ||
| 25 | - rmhHeadUrl: 'https://cdnjdphoto.aikan.pdnews.cn//upload/ueditor/image/20210113/a_533807397399949312' + | ||
| 26 | - '.png?x-oss-process=image/resize,l_100/auto-orient,1/quality,q_90/format,jpg' | ||
| 27 | - } | ||
| 28 | - }, | ||
| 29 | - { | ||
| 30 | - rmhInfo: { | ||
| 31 | - rmhId: '2489729', | ||
| 32 | - rmhName: '陕西青年职业学院', | ||
| 33 | - rmhDesc: '陕西青年职业学院陕西青年职业学院是经陕西省人民政陕西青年职业学院是经陕西省人民政是经陕西省人民政', | ||
| 34 | - rmhHeadUrl: 'https://cdnjdphoto.aikan.pdnews.cn//upload/ueditor/image/20210113/a_533807397399949312' + | ||
| 35 | - '.png?x-oss-process=image/resize,l_100/auto-orient,1/quality,q_90/format,jpg' | ||
| 36 | - } | ||
| 37 | - }, | ||
| 38 | - { | ||
| 39 | - rmhInfo: { | ||
| 40 | - rmhId: '2489729', | ||
| 41 | - rmhName: '陕西青年职业学院', | ||
| 42 | - rmhDesc: '陕西青年职业学院陕西青年职业学院是经陕西省人民政陕西青年职业学院是经陕西省人民政是经陕西省人民政', | ||
| 43 | - rmhHeadUrl: 'https://cdnjdphoto.aikan.pdnews.cn//upload/ueditor/image/20210113/a_533807397399949312' + | ||
| 44 | - '.png?x-oss-process=image/resize,l_100/auto-orient,1/quality,q_90/format,jpg' | ||
| 45 | - } | ||
| 46 | - }, | ||
| 47 | - { | ||
| 48 | - rmhInfo: { | ||
| 49 | - rmhId: '2489729', | ||
| 50 | - rmhName: '陕西青年职业学院', | ||
| 51 | - rmhDesc: '陕西青年职业学院陕西青年职业学院是经陕西省人民政陕西青年职业学院是经陕西省人民政是经陕西省人民政', | ||
| 52 | - rmhHeadUrl: 'https://cdnjdphoto.aikan.pdnews.cn//upload/ueditor/image/20210113/a_533807397399949312' + | ||
| 53 | - '.png?x-oss-process=image/resize,l_100/auto-orient,1/quality,q_90/format,jpg' | ||
| 54 | - } | ||
| 55 | - }, | ||
| 56 | - { | ||
| 57 | - rmhInfo: { | ||
| 58 | - rmhId: '2489729', | ||
| 59 | - rmhName: '陕西青年职业学院', | ||
| 60 | - rmhDesc: '陕西青年职业学院陕西青年职业学院是经陕西省人民政陕西青年职业学院是经陕西省人民政是经陕西省人民政', | ||
| 61 | - rmhHeadUrl: 'https://cdnjdphoto.aikan.pdnews.cn//upload/ueditor/image/20210113/a_533807397399949312' + | ||
| 62 | - '.png?x-oss-process=image/resize,l_100/auto-orient,1/quality,q_90/format,jpg' | ||
| 63 | - } | ||
| 64 | - }, | ||
| 65 | - ] | ||
| 66 | - } as CompDTO | 32 | + @State compDTO: CompDTO = {} as CompDTO |
| 67 | 33 | ||
| 68 | build() { | 34 | build() { |
| 69 | Column() { | 35 | Column() { |
| 70 | //顶部 | 36 | //顶部 |
| 71 | - this.CompHeader(this.compDTO) | ||
| 72 | - Row(){ | ||
| 73 | - // 列表内容 | ||
| 74 | - List() { | ||
| 75 | - ForEach(this.compDTO.operDataList, (item: ContentDTO, index: number) => { | ||
| 76 | - CreatorItem({ | ||
| 77 | - item | ||
| 78 | - }) | ||
| 79 | - .margin({right: index === this.compDTO.operDataList.length - 1 ? $r('app.float.card_comp_pagePadding_lf') : 0}) | ||
| 80 | - }) | 37 | + if (this.compDTO.operDataList?.length > 0) { |
| 38 | + this.CompHeader(this.compDTO) | ||
| 39 | + } | ||
| 40 | + | ||
| 41 | + Column(){ | ||
| 42 | + Text(this.compDTO.operDataList[0]?.commentInfo?.commentTitle) | ||
| 43 | + .maxLines(4) | ||
| 44 | + .textOverflow({overflow: TextOverflow.Ellipsis}) | ||
| 45 | + .lineHeight(23) | ||
| 46 | + .fontSize(16) | ||
| 47 | + .margin({bottom: 19}) | ||
| 48 | + .textAlign(TextAlign.Start) | ||
| 49 | + .width('100%') | ||
| 50 | + | ||
| 51 | + | ||
| 52 | + Row() { | ||
| 53 | + Image($r('app.media.icon_clip')) | ||
| 54 | + .width(16) | ||
| 55 | + .height(16) | ||
| 56 | + .margin({right: 5}) | ||
| 57 | + Text(this.compDTO.operDataList[0]?.commentInfo?.newsTitle) | ||
| 58 | + .maxLines(1) | ||
| 59 | + .textOverflow({overflow: TextOverflow.Ellipsis}) | ||
| 60 | + .fontSize(14) | ||
| 61 | + .fontColor(0x666666) | ||
| 81 | } | 62 | } |
| 82 | - .listDirection(Axis.Horizontal) | 63 | + .justifyContent(FlexAlign.Start) |
| 64 | + .width('100%') | ||
| 83 | } | 65 | } |
| 84 | - .width(CommonConstants.FULL_WIDTH) | ||
| 85 | - .height(208) | 66 | + .width("100%") |
| 67 | + .padding({top: 12, bottom: 12, left: 10, right: 10}) | ||
| 68 | + .backgroundColor(0xf9f9f9) | ||
| 69 | + .borderRadius(4) | ||
| 70 | + .margin({bottom: 12}) | ||
| 71 | + | ||
| 72 | + Row() { | ||
| 73 | + Text(DateTimeUtils.getCommentTime(this.compDTO.operDataList[0]?.commentInfo?.publishTime)) | ||
| 74 | + .fontSize(14) | ||
| 75 | + .fontColor(0x999999) | ||
| 76 | + | ||
| 77 | + Row(){ | ||
| 78 | + Image($r('app.media.icon_like_no')) | ||
| 79 | + .width(16) | ||
| 80 | + .height(16) | ||
| 81 | + .margin({right: 3}) | ||
| 82 | + | ||
| 83 | + Text('点赞') | ||
| 84 | + .fontSize(14) | ||
| 85 | + .fontColor(0x999999) | ||
| 86 | + } | ||
| 87 | + } | ||
| 88 | + .justifyContent(FlexAlign.SpaceBetween) | ||
| 89 | + .width('100%') | ||
| 86 | } | 90 | } |
| 87 | .padding({ | 91 | .padding({ |
| 88 | left: $r('app.float.card_comp_pagePadding_lf'), | 92 | left: $r('app.float.card_comp_pagePadding_lf'), |
| 89 | - // right: $r('app.float.card_comp_pagePadding_lf'), | 93 | + right: $r('app.float.card_comp_pagePadding_lf'), |
| 90 | top: $r('app.float.card_comp_pagePadding_tb'), | 94 | top: $r('app.float.card_comp_pagePadding_tb'), |
| 91 | bottom: $r('app.float.card_comp_pagePadding_tb') | 95 | bottom: $r('app.float.card_comp_pagePadding_tb') |
| 92 | }) | 96 | }) |
| 93 | .backgroundColor($r('app.color.white')) | 97 | .backgroundColor($r('app.color.white')) |
| 94 | .margin({ bottom: 8 }) | 98 | .margin({ bottom: 8 }) |
| 99 | + .height(251) | ||
| 100 | + .onClick(() => { | ||
| 101 | + WDRouterRule.jumpWithPage(WDRouterPage.QualityCommentsPage) | ||
| 102 | + }) | ||
| 95 | } | 103 | } |
| 96 | 104 | ||
| 97 | @Builder | 105 | @Builder |
| 98 | CompHeader(item: CompDTO) { | 106 | CompHeader(item: CompDTO) { |
| 99 | Row() { | 107 | Row() { |
| 100 | Row() { | 108 | Row() { |
| 101 | - Image($r("app.media.icon_elite_comment")) | ||
| 102 | - .width(24) | ||
| 103 | - .height(24) | ||
| 104 | - .margin({ right: 4 }) | ||
| 105 | - Text('精选评论') | ||
| 106 | - .fontSize($r("app.float.font_size_17")) | ||
| 107 | - .fontColor($r("app.color.color_222222")) | ||
| 108 | - .fontWeight(600) | 109 | + Image(item.operDataList[0]?.commentInfo?.userHeaderUrl ? item.operDataList[0].commentInfo.userHeaderUrl : $r('app.media.default_head')) |
| 110 | + .width(32) | ||
| 111 | + .height(32) | ||
| 112 | + .borderRadius(16) | ||
| 113 | + .margin({right: 8}) | ||
| 114 | + Text(item.operDataList[0]?.commentInfo?.userName) | ||
| 115 | + .lineHeight(32) | ||
| 116 | + .fontSize(14) | ||
| 117 | + .fontColor(0x222222) | ||
| 118 | + .maxLines(1) | ||
| 119 | + .textOverflow({overflow: TextOverflow.Ellipsis}) | ||
| 109 | } | 120 | } |
| 110 | 121 | ||
| 111 | Row() { | 122 | Row() { |
| 112 | - Text("更多") | ||
| 113 | - .fontSize($r("app.float.font_size_14")) | ||
| 114 | - .fontColor($r("app.color.color_999999")) | 123 | + Image($r("app.media.icon_elite_comment")) |
| 124 | + .width(45) | ||
| 125 | + .height(22) | ||
| 115 | .margin({ right: 1 }) | 126 | .margin({ right: 1 }) |
| 116 | Image($r("app.media.more")) | 127 | Image($r("app.media.more")) |
| 117 | .width(14) | 128 | .width(14) |
| 118 | .height(14) | 129 | .height(14) |
| 119 | - .onClick(() => { | ||
| 120 | - // TODO 跳转的页面,定义的入参可能不合理。推荐id: 41 | ||
| 121 | - let params: Params = { | ||
| 122 | - pageID: "1" | ||
| 123 | - } | ||
| 124 | - WDRouterRule.jumpWithPage(WDRouterPage.followListPage, params) | ||
| 125 | - }) | ||
| 126 | } | 130 | } |
| 127 | - .padding({ | ||
| 128 | - right: $r('app.float.card_comp_pagePadding_lf'), | ||
| 129 | - }) | ||
| 130 | } | 131 | } |
| 132 | + .margin({bottom: 10}) | ||
| 131 | .justifyContent(FlexAlign.SpaceBetween) | 133 | .justifyContent(FlexAlign.SpaceBetween) |
| 132 | - .margin({ top: 8, bottom: 8 }) | ||
| 133 | .width('100%') | 134 | .width('100%') |
| 134 | } | 135 | } |
| 135 | } | 136 | } |
| @@ -19,7 +19,6 @@ export default struct MinePagePersonFunctionUI { | @@ -19,7 +19,6 @@ export default struct MinePagePersonFunctionUI { | ||
| 19 | .interpolation(ImageInterpolation.High) | 19 | .interpolation(ImageInterpolation.High) |
| 20 | Text(`${item.msg}`) | 20 | Text(`${item.msg}`) |
| 21 | .margin({top:'8lpx'}) | 21 | .margin({top:'8lpx'}) |
| 22 | - .width('50lpx') | ||
| 23 | .height('23lpx') | 22 | .height('23lpx') |
| 24 | .fontColor($r('app.color.color_222222')) | 23 | .fontColor($r('app.color.color_222222')) |
| 25 | .fontSize('23lpx') | 24 | .fontSize('23lpx') |
| 1 | import { Params } from 'wdBean'; | 1 | import { Params } from 'wdBean'; |
| 2 | -import { DateTimeUtils, LazyDataSource, StringUtils, UserDataLocal } from 'wdKit'; | ||
| 3 | -import { HttpUrlUtils } from 'wdNetwork'; | 2 | +import { DateTimeUtils, LazyDataSource,UserDataLocal } from 'wdKit'; |
| 4 | import { WDRouterPage, WDRouterRule } from 'wdRouter'; | 3 | import { WDRouterPage, WDRouterRule } from 'wdRouter'; |
| 5 | import MinePageDatasModel from '../../../model/MinePageDatasModel'; | 4 | import MinePageDatasModel from '../../../model/MinePageDatasModel'; |
| 6 | import { CommentListItem } from '../../../viewmodel/CommentListItem'; | 5 | import { CommentListItem } from '../../../viewmodel/CommentListItem'; |
| 7 | import { FollowListDetailItem } from '../../../viewmodel/FollowListDetailItem'; | 6 | import { FollowListDetailItem } from '../../../viewmodel/FollowListDetailItem'; |
| 8 | import { FollowListDetailRequestItem } from '../../../viewmodel/FollowListDetailRequestItem'; | 7 | import { FollowListDetailRequestItem } from '../../../viewmodel/FollowListDetailRequestItem'; |
| 9 | -import { FollowOperationRequestItem } from '../../../viewmodel/FollowOperationRequestItem'; | ||
| 10 | import { ListHasNoMoreDataUI } from '../../reusable/ListHasNoMoreDataUI'; | 8 | import { ListHasNoMoreDataUI } from '../../reusable/ListHasNoMoreDataUI'; |
| 11 | import { FollowChildComponent } from '../follow/FollowChildComponent'; | 9 | import { FollowChildComponent } from '../follow/FollowChildComponent'; |
| 12 | 10 | ||
| @@ -22,6 +20,7 @@ export struct HomePageBottomComponent{ | @@ -22,6 +20,7 @@ export struct HomePageBottomComponent{ | ||
| 22 | @State count:number = 0; | 20 | @State count:number = 0; |
| 23 | @State isMineAccount:boolean = true; | 21 | @State isMineAccount:boolean = true; |
| 24 | @State userId:string = ""; | 22 | @State userId:string = ""; |
| 23 | + @Link commentNum:number | ||
| 25 | 24 | ||
| 26 | aboutToAppear(){ | 25 | aboutToAppear(){ |
| 27 | this.getNewPageData() | 26 | this.getNewPageData() |
| @@ -36,30 +35,33 @@ export struct HomePageBottomComponent{ | @@ -36,30 +35,33 @@ export struct HomePageBottomComponent{ | ||
| 36 | 35 | ||
| 37 | if(this.count === 0){ | 36 | if(this.count === 0){ |
| 38 | if(this.style === 1){ | 37 | if(this.style === 1){ |
| 39 | - Row(){ | ||
| 40 | - Text("关注更多人民号") | ||
| 41 | - .fontWeight('400lpx') | ||
| 42 | - .fontColor($r('app.color.color_222222')) | ||
| 43 | - .lineHeight('38lpx') | ||
| 44 | - .fontSize('27lpx') | ||
| 45 | - .textAlign(TextAlign.Center) | ||
| 46 | - .margin({right:'4lpx'}) | ||
| 47 | - Image($r('app.media.arrow_icon_right')) | ||
| 48 | - .objectFit(ImageFit.Auto) | ||
| 49 | - .width('27lpx') | ||
| 50 | - .height('27lpx') | ||
| 51 | - }.height('69lpx') | ||
| 52 | - .width('659lpx') | ||
| 53 | - .alignItems(VerticalAlign.Center) | ||
| 54 | - .justifyContent(FlexAlign.Center) | ||
| 55 | - .backgroundColor($r('app.color.color_F5F5F5')) | ||
| 56 | - .margin({top:'31lpx',bottom:'4lpx'}) | ||
| 57 | - .onClick(()=>{ | ||
| 58 | - let params: Params = { | ||
| 59 | - pageID: "1" | ||
| 60 | - } | ||
| 61 | - WDRouterRule.jumpWithPage(WDRouterPage.followListPage,params) | ||
| 62 | - }) | 38 | + Column(){ |
| 39 | + Row(){ | ||
| 40 | + Text("关注更多人民号") | ||
| 41 | + .fontWeight('400lpx') | ||
| 42 | + .fontColor($r('app.color.color_222222')) | ||
| 43 | + .lineHeight('38lpx') | ||
| 44 | + .fontSize('27lpx') | ||
| 45 | + .textAlign(TextAlign.Center) | ||
| 46 | + .margin({right:'4lpx'}) | ||
| 47 | + Image($r('app.media.arrow_icon_right')) | ||
| 48 | + .objectFit(ImageFit.Auto) | ||
| 49 | + .width('27lpx') | ||
| 50 | + .height('27lpx') | ||
| 51 | + }.height('69lpx') | ||
| 52 | + .width('659lpx') | ||
| 53 | + .alignItems(VerticalAlign.Center) | ||
| 54 | + .justifyContent(FlexAlign.Center) | ||
| 55 | + .backgroundColor($r('app.color.color_F5F5F5')) | ||
| 56 | + .margin({top:'31lpx',bottom:'4lpx'}) | ||
| 57 | + .onClick(()=>{ | ||
| 58 | + let params: Params = { | ||
| 59 | + pageID: "1" | ||
| 60 | + } | ||
| 61 | + WDRouterRule.jumpWithPage(WDRouterPage.followListPage,params) | ||
| 62 | + }) | ||
| 63 | + }.layoutWeight(1) | ||
| 64 | + .justifyContent(FlexAlign.Start) | ||
| 63 | }else{ | 65 | }else{ |
| 64 | ListHasNoMoreDataUI({style:2}) | 66 | ListHasNoMoreDataUI({style:2}) |
| 65 | .layoutWeight(1) | 67 | .layoutWeight(1) |
| @@ -211,7 +213,8 @@ export struct HomePageBottomComponent{ | @@ -211,7 +213,8 @@ export struct HomePageBottomComponent{ | ||
| 211 | this.hasMore = false | 213 | this.hasMore = false |
| 212 | }else{ | 214 | }else{ |
| 213 | value.list.forEach((value)=>{ | 215 | value.list.forEach((value)=>{ |
| 214 | - this.data_comment.push(new CommentListItem(value.fromUserHeader,value.fromUserName,value.targetTitle,value.createTime,value.commentContent,value.likeNum,0,value.id,value.targetId,value.targetType)) | 216 | + let publishTime = DateTimeUtils.getCommentTime(DateTimeUtils.parseDate(value.createTime,DateTimeUtils.PATTERN_DATE_TIME_HYPHEN)) |
| 217 | + this.data_comment.push(new CommentListItem(value.fromUserHeader,value.fromUserName,value.targetTitle,publishTime,value.commentContent,value.likeNum,0,value.id,value.targetId,value.targetType)) | ||
| 215 | }) | 218 | }) |
| 216 | this.data_comment.notifyDataReload() | 219 | this.data_comment.notifyDataReload() |
| 217 | this.count = this.data_comment.totalCount() | 220 | this.count = this.data_comment.totalCount() |
| @@ -222,6 +225,7 @@ export struct HomePageBottomComponent{ | @@ -222,6 +225,7 @@ export struct HomePageBottomComponent{ | ||
| 222 | } | 225 | } |
| 223 | } | 226 | } |
| 224 | this.isLoading = false | 227 | this.isLoading = false |
| 228 | + this.commentNum = value.totalCount | ||
| 225 | }).catch((err:Error)=>{ | 229 | }).catch((err:Error)=>{ |
| 226 | console.log(TAG,"请求失败") | 230 | console.log(TAG,"请求失败") |
| 227 | this.isLoading = false | 231 | this.isLoading = false |
| @@ -18,12 +18,15 @@ export struct BottomNavigationComponent { | @@ -18,12 +18,15 @@ export struct BottomNavigationComponent { | ||
| 18 | @Provide bottomRectHeight: number = 0 | 18 | @Provide bottomRectHeight: number = 0 |
| 19 | @Provide topRectHeight: number = 0 | 19 | @Provide topRectHeight: number = 0 |
| 20 | @Provide isLayoutFullScreen: boolean = false | 20 | @Provide isLayoutFullScreen: boolean = false |
| 21 | + @Provide isImmersive: boolean = false // 是否开启沉浸式模式 http://192.168.1.3:3300/project/3802/interface/api/189229 | ||
| 22 | + @Provide isNight: boolean = false // 是否开启夜间模式 | ||
| 21 | @State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0 | 23 | @State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0 |
| 22 | @State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0 | 24 | @State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0 |
| 23 | // 底导/顶导全部数据 | 25 | // 底导/顶导全部数据 |
| 24 | @State @Watch('onBottomNavigationDataUpdated') bottomNavList: BottomNavDTO[] = [] | 26 | @State @Watch('onBottomNavigationDataUpdated') bottomNavList: BottomNavDTO[] = [] |
| 25 | // 底导当前选中/焦点下标 | 27 | // 底导当前选中/焦点下标 |
| 26 | @State currentNavIndex: number = BottomNavi.NEWS; | 28 | @State currentNavIndex: number = BottomNavi.NEWS; |
| 29 | + // @State currentTopNavSelectedIndex: number = 0; // | ||
| 27 | @State barBackgroundColor: Color = Color.Transparent | 30 | @State barBackgroundColor: Color = Color.Transparent |
| 28 | // 底导TabsController | 31 | // 底导TabsController |
| 29 | private navController: TabsController = new TabsController(); | 32 | private navController: TabsController = new TabsController(); |
| @@ -63,7 +66,7 @@ export struct BottomNavigationComponent { | @@ -63,7 +66,7 @@ export struct BottomNavigationComponent { | ||
| 63 | } else { | 66 | } else { |
| 64 | TopNavigationComponent({ | 67 | TopNavigationComponent({ |
| 65 | groupId: navItem.id, | 68 | groupId: navItem.id, |
| 66 | - topNavList: navItem.topNavChannelList, | 69 | + topNavList: navItem.topNavChannelList.filter(item => item.channelId != 2073), |
| 67 | _currentNavIndex: this.currentNavIndex, | 70 | _currentNavIndex: this.currentNavIndex, |
| 68 | changeBarBackgroundColor: (color: Color) => { | 71 | changeBarBackgroundColor: (color: Color) => { |
| 69 | this.barBackgroundColor = color | 72 | this.barBackgroundColor = color |
| @@ -2,7 +2,7 @@ import { CustomTitleAndEditUI } from '../reusable/CustomTitleAndEditUI' | @@ -2,7 +2,7 @@ import { CustomTitleAndEditUI } from '../reusable/CustomTitleAndEditUI' | ||
| 2 | import MyCollectionViewModel from '../../viewmodel/MyCollectionViewModel'; | 2 | import MyCollectionViewModel from '../../viewmodel/MyCollectionViewModel'; |
| 3 | import PageModel from '../../viewmodel/PageModel'; | 3 | import PageModel from '../../viewmodel/PageModel'; |
| 4 | import { CommonConstants, ViewType } from 'wdConstant' | 4 | import { CommonConstants, ViewType } from 'wdConstant' |
| 5 | -import { EmptyComponent } from '../view/EmptyComponent' | 5 | +import { EmptyComponent,WDViewDefaultType } from '../view/EmptyComponent' |
| 6 | import { ErrorComponent } from '../view/ErrorComponent' | 6 | import { ErrorComponent } from '../view/ErrorComponent' |
| 7 | import RefreshLayout from './RefreshLayout' | 7 | import RefreshLayout from './RefreshLayout' |
| 8 | import { RefreshLayoutBean } from './RefreshLayoutBean'; | 8 | import { RefreshLayoutBean } from './RefreshLayoutBean'; |
| @@ -41,31 +41,28 @@ struct BrowsingHistoryPage { | @@ -41,31 +41,28 @@ struct BrowsingHistoryPage { | ||
| 41 | this.deleteNum = 0 | 41 | this.deleteNum = 0 |
| 42 | }}) | 42 | }}) |
| 43 | 43 | ||
| 44 | - CustomPullToRefresh({ | ||
| 45 | - alldata:this.allDatas, | ||
| 46 | - scroller:this.scroller, | ||
| 47 | - customList:()=>{ | ||
| 48 | - this.ListLayout() | ||
| 49 | - }, | ||
| 50 | - onRefresh:(resolve)=>{ | ||
| 51 | - this.browSingModel.currentPage = 0 | ||
| 52 | - this.getData(resolve) | ||
| 53 | - }, | ||
| 54 | - onLoadMore:(resolve)=> { | ||
| 55 | - this.browSingModel.currentPage++ | ||
| 56 | - this.getData() | ||
| 57 | - } | ||
| 58 | - }) | ||
| 59 | - | ||
| 60 | - | ||
| 61 | // if (this.browSingModel.viewType == ViewType.LOADING){ | 44 | // if (this.browSingModel.viewType == ViewType.LOADING){ |
| 62 | // this.LoadingLayout() | 45 | // this.LoadingLayout() |
| 63 | // }else if(this.browSingModel.viewType == ViewType.ERROR){ | 46 | // }else if(this.browSingModel.viewType == ViewType.ERROR){ |
| 64 | // ErrorComponent() | 47 | // ErrorComponent() |
| 65 | // }else if(this.browSingModel.viewType == ViewType.EMPTY){ | 48 | // }else if(this.browSingModel.viewType == ViewType.EMPTY){ |
| 66 | - // EmptyComponent() | 49 | + EmptyComponent({emptyType:WDViewDefaultType.WDViewDefaultType_NoHistory}) |
| 67 | // }else { | 50 | // }else { |
| 68 | - // this.ListLayout() | 51 | + // CustomPullToRefresh({ |
| 52 | + // alldata:this.allDatas, | ||
| 53 | + // scroller:this.scroller, | ||
| 54 | + // customList:()=>{ | ||
| 55 | + // this.ListLayout() | ||
| 56 | + // }, | ||
| 57 | + // onRefresh:(resolve)=>{ | ||
| 58 | + // this.browSingModel.currentPage = 0 | ||
| 59 | + // this.getData(resolve) | ||
| 60 | + // }, | ||
| 61 | + // onLoadMore:(resolve)=> { | ||
| 62 | + // this.browSingModel.currentPage++ | ||
| 63 | + // this.getData() | ||
| 64 | + // } | ||
| 65 | + // }) | ||
| 69 | // } | 66 | // } |
| 70 | 67 | ||
| 71 | if (this.isEditState){ | 68 | if (this.isEditState){ |
| @@ -127,7 +127,8 @@ struct EditUserInfoPage { | @@ -127,7 +127,8 @@ struct EditUserInfoPage { | ||
| 127 | lunar:false, | 127 | lunar:false, |
| 128 | onAccept:(value:DatePickerResult) => { | 128 | onAccept:(value:DatePickerResult) => { |
| 129 | let mon = value.month as number + 1 | 129 | let mon = value.month as number + 1 |
| 130 | - this.currentUserInfo.userExtend.birthday = value.year+'-'+mon.toString()+'-'+value.day; | 130 | + let monStr = mon < 10? '0'+mon.toString():mon.toString(); |
| 131 | + this.currentUserInfo.userExtend.birthday = value.year+'-'+monStr+'-'+value.day; | ||
| 131 | this.currentUserInfo.editDataType = WDEditDataModelType.WDEditDataModelType_birthday | 132 | this.currentUserInfo.editDataType = WDEditDataModelType.WDEditDataModelType_birthday |
| 132 | this.updateEditModel() | 133 | this.updateEditModel() |
| 133 | } | 134 | } |
| @@ -171,8 +172,10 @@ struct EditUserInfoPage { | @@ -171,8 +172,10 @@ struct EditUserInfoPage { | ||
| 171 | 172 | ||
| 172 | updateEditModel(){ | 173 | updateEditModel(){ |
| 173 | this.listData = [] | 174 | this.listData = [] |
| 174 | - this.listData.push(...EditInfoViewModel.getEditListInfo(this.currentUserInfo)) | ||
| 175 | - EditInfoViewModel.updateUserInfo(this.currentUserInfo) | 175 | + // this.listData.push(...EditInfoViewModel.getEditListInfo(this.currentUserInfo)) |
| 176 | + EditInfoViewModel.updateUserInfo(this.currentUserInfo).then(()=>{ | ||
| 177 | + this.getAccountOwnerInfo() | ||
| 178 | + }) | ||
| 176 | } | 179 | } |
| 177 | getAccountOwnerInfo(){ | 180 | getAccountOwnerInfo(){ |
| 178 | EditInfoViewModel.queryAccountOwnerInfo(1,getContext(this)).then((editModel) => { | 181 | EditInfoViewModel.queryAccountOwnerInfo(1,getContext(this)).then((editModel) => { |
| @@ -19,7 +19,6 @@ import { | @@ -19,7 +19,6 @@ import { | ||
| 19 | struct PeopleShipHomePage { | 19 | struct PeopleShipHomePage { |
| 20 | // Todo 传入数据 后续在修改 | 20 | // Todo 传入数据 后续在修改 |
| 21 | creatorId: string = (router.getParams() as Record<string, string>)['creatorId']; | 21 | creatorId: string = (router.getParams() as Record<string, string>)['creatorId']; |
| 22 | - @State arr: number[] = [] | ||
| 23 | // 页面详情数据 | 22 | // 页面详情数据 |
| 24 | @Provide detailModel: PeopleShipUserDetailData = {} as PeopleShipUserDetailData | 23 | @Provide detailModel: PeopleShipUserDetailData = {} as PeopleShipUserDetailData |
| 25 | // 每个分类数量 | 24 | // 每个分类数量 |
| @@ -108,9 +107,12 @@ struct PeopleShipHomePage { | @@ -108,9 +107,12 @@ struct PeopleShipHomePage { | ||
| 108 | Logger.debug('PeopleShipHomePage', '获取页面信息', `${JSON.stringify(this.detailModel)}`) | 107 | Logger.debug('PeopleShipHomePage', '获取页面信息', `${JSON.stringify(this.detailModel)}`) |
| 109 | 108 | ||
| 110 | // 获取关注 | 109 | // 获取关注 |
| 111 | - let followList: QueryListIsFollowedItem[] = await PeopleShipHomePageDataModel.getHomePageFollowListStatusData(this.creatorId) | ||
| 112 | - Logger.debug('PeopleShipHomePage', '获取关注信息', `${JSON.stringify(followList)}`) | ||
| 113 | - this.findFollowStata(followList) | 110 | + // 登录后获取,是否关注 |
| 111 | + if (HttpUrlUtils.getUserId()) { | ||
| 112 | + let followList: QueryListIsFollowedItem[] = await PeopleShipHomePageDataModel.getHomePageFollowListStatusData(this.creatorId) | ||
| 113 | + Logger.debug('PeopleShipHomePage', '获取关注信息', `${JSON.stringify(followList)}`) | ||
| 114 | + this.findFollowStata(followList) | ||
| 115 | + } | ||
| 114 | 116 | ||
| 115 | } catch (exception) { | 117 | } catch (exception) { |
| 116 | 118 | ||
| @@ -128,14 +130,17 @@ struct PeopleShipHomePage { | @@ -128,14 +130,17 @@ struct PeopleShipHomePage { | ||
| 128 | } | 130 | } |
| 129 | 131 | ||
| 130 | handleChangeAttentionStata() { | 132 | handleChangeAttentionStata() { |
| 133 | + | ||
| 131 | if (!this.isLoadingAttention) { | 134 | if (!this.isLoadingAttention) { |
| 132 | return | 135 | return |
| 133 | } | 136 | } |
| 134 | // 未登录,跳转登录 | 137 | // 未登录,跳转登录 |
| 135 | if (!HttpUrlUtils.getUserId()) { | 138 | if (!HttpUrlUtils.getUserId()) { |
| 139 | + this.isLoadingAttention = false | ||
| 136 | WDRouterRule.jumpWithPage(WDRouterPage.loginPage) | 140 | WDRouterRule.jumpWithPage(WDRouterPage.loginPage) |
| 137 | return | 141 | return |
| 138 | } | 142 | } |
| 143 | + | ||
| 139 | let status = 0 | 144 | let status = 0 |
| 140 | if (this.isAttention == '0') { | 145 | if (this.isAttention == '0') { |
| 141 | status = 1 | 146 | status = 1 |
| @@ -151,36 +151,25 @@ export struct TopNavigationComponent { | @@ -151,36 +151,25 @@ export struct TopNavigationComponent { | ||
| 151 | } | 151 | } |
| 152 | 152 | ||
| 153 | indexChange() { | 153 | indexChange() { |
| 154 | - if (this._currentNavIndex === 2 && this.currentTopNavSelectedIndex === 0 && this.changeBarBackgroundColor) { | ||
| 155 | - this.barBackgroundColor = Color.Black | ||
| 156 | - this.changeBarBackgroundColor(this.barBackgroundColor) | ||
| 157 | - } else { | ||
| 158 | - this.barBackgroundColor = Color.Transparent | ||
| 159 | - this.changeBarBackgroundColor(this.barBackgroundColor) | ||
| 160 | - } | ||
| 161 | 154 | ||
| 155 | + // 判断视频频道待处理 | ||
| 162 | if (this._currentNavIndex === 2 && this.currentTopNavSelectedIndex == 0) { | 156 | if (this._currentNavIndex === 2 && this.currentTopNavSelectedIndex == 0) { |
| 163 | - if (!this.isLayoutFullScreen) { | ||
| 164 | - const windowStage = WindowModel.shared.getWindowStage() as window.WindowStage | ||
| 165 | - const windowClass: window.Window = windowStage.getMainWindowSync(); // 获取应用主窗口 | ||
| 166 | - windowClass.setWindowLayoutFullScreen(true).then(() => { | ||
| 167 | - this.isLayoutFullScreen = true | ||
| 168 | - this.bottomRectHeight = this.bottomSafeHeight | ||
| 169 | - this.topRectHeight = this.topSafeHeight | ||
| 170 | - }) | ||
| 171 | - } | 157 | + this.barBackgroundColor = Color.Black |
| 158 | + this.changeBarBackgroundColor && this.changeBarBackgroundColor(this.barBackgroundColor) | ||
| 159 | + WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#ffffff', }) | ||
| 160 | + WindowModel.shared.setWindowLayoutFullScreen(true) | ||
| 161 | + this.isLayoutFullScreen = true | ||
| 162 | + this.bottomRectHeight = this.bottomSafeHeight | ||
| 163 | + this.topRectHeight = this.topSafeHeight | ||
| 172 | 164 | ||
| 173 | } else { | 165 | } else { |
| 174 | - if (this.isLayoutFullScreen) { | ||
| 175 | - const windowStage = WindowModel.shared.getWindowStage() as window.WindowStage | ||
| 176 | - const windowClass: window.Window = windowStage.getMainWindowSync(); // 获取应用主窗口 | ||
| 177 | - windowClass.setWindowLayoutFullScreen(false).then(() => { | ||
| 178 | - this.isLayoutFullScreen = false | ||
| 179 | - this.bottomRectHeight = 0 | ||
| 180 | - this.topRectHeight = 0 | ||
| 181 | - console.error(' this.isLayoutFullScreen ', this.isLayoutFullScreen) | ||
| 182 | - }) | ||
| 183 | - } | 166 | + this.barBackgroundColor = Color.Transparent |
| 167 | + this.changeBarBackgroundColor && this.changeBarBackgroundColor(this.barBackgroundColor) | ||
| 168 | + WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#000000', }) | ||
| 169 | + WindowModel.shared.setWindowLayoutFullScreen(false) | ||
| 170 | + this.isLayoutFullScreen = false | ||
| 171 | + this.bottomRectHeight = 0 | ||
| 172 | + this.topRectHeight = 0 | ||
| 184 | } | 173 | } |
| 185 | } | 174 | } |
| 186 | 175 |
| @@ -20,24 +20,26 @@ import { RefreshLayoutBean } from '../page/RefreshLayoutBean' | @@ -20,24 +20,26 @@ import { RefreshLayoutBean } from '../page/RefreshLayoutBean' | ||
| 20 | import CustomRefreshLoadLayout from '../page/CustomRefreshLoadLayout' | 20 | import CustomRefreshLoadLayout from '../page/CustomRefreshLoadLayout' |
| 21 | import { ErrorComponent } from '../view/ErrorComponent'; | 21 | import { ErrorComponent } from '../view/ErrorComponent'; |
| 22 | import NoMoreLayout from '../page/NoMoreLayout'; | 22 | import NoMoreLayout from '../page/NoMoreLayout'; |
| 23 | -import { LazyDataSource } from 'wdKit'; | 23 | +// import { LazyDataSource } from 'wdKit'; |
| 24 | +import { CustomPullToRefresh } from '../reusable/CustomPullToRefresh' | ||
| 24 | 25 | ||
| 25 | const TAG = 'PeopleShipHomeArticleListComponent'; | 26 | const TAG = 'PeopleShipHomeArticleListComponent'; |
| 26 | 27 | ||
| 27 | @Component | 28 | @Component |
| 28 | export struct PeopleShipHomeArticleListComponent { | 29 | export struct PeopleShipHomeArticleListComponent { |
| 29 | - // @State arr: ContentDTO[] = [] | ||
| 30 | - @State arr: LazyDataSource<ContentDTO> = new LazyDataSource(); | 30 | + @State arr: ContentDTO[] = [] |
| 31 | + // @State arr: LazyDataSource<ContentDTO> = new LazyDataSource(); | ||
| 31 | @State typeModel: ArticleTypeData = new ArticleTypeData() | 32 | @State typeModel: ArticleTypeData = new ArticleTypeData() |
| 32 | @State creatorId: string = '' | 33 | @State creatorId: string = '' |
| 33 | @Consume detailModel: PeopleShipUserDetailData | 34 | @Consume detailModel: PeopleShipUserDetailData |
| 34 | - @State private viewType: number = 1; | ||
| 35 | - currentIndex: number = 0 | 35 | + @State private viewType: number = 1 |
| 36 | + currentIndex: number = 1 | ||
| 36 | @Link @Watch('onChange') currentTopSelectedIndex: number | 37 | @Link @Watch('onChange') currentTopSelectedIndex: number |
| 37 | @State private hasMore: boolean = true | 38 | @State private hasMore: boolean = true |
| 38 | - @State currentPage: number = 1 | 39 | + @State private currentPage: number = 1 |
| 39 | @State private isLoading: boolean = false | 40 | @State private isLoading: boolean = false |
| 40 | @Consume topHeight: number | 41 | @Consume topHeight: number |
| 42 | + private scroller: Scroller = new Scroller() | ||
| 41 | 43 | ||
| 42 | build() { | 44 | build() { |
| 43 | if (this.viewType == 1) { | 45 | if (this.viewType == 1) { |
| @@ -46,7 +48,35 @@ export struct PeopleShipHomeArticleListComponent { | @@ -46,7 +48,35 @@ export struct PeopleShipHomeArticleListComponent { | ||
| 46 | } else if (this.viewType == 2) { | 48 | } else if (this.viewType == 2) { |
| 47 | ErrorComponent() | 49 | ErrorComponent() |
| 48 | } else { | 50 | } else { |
| 49 | - this.ListLayout() | 51 | + CustomPullToRefresh({ |
| 52 | + alldata:this.arr, | ||
| 53 | + scroller:this.scroller, | ||
| 54 | + hasMore: this.hasMore, | ||
| 55 | + customList:()=>{ | ||
| 56 | + this.ListLayout() | ||
| 57 | + }, | ||
| 58 | + onRefresh:(resolve)=>{ | ||
| 59 | + this.currentPage = 1 | ||
| 60 | + this.getPeopleShipPageArticleList(resolve) | ||
| 61 | + }, | ||
| 62 | + onLoadMore:(resolve)=> { | ||
| 63 | + if (this.hasMore === false) { | ||
| 64 | + if(resolve) { | ||
| 65 | + resolve('') | ||
| 66 | + } | ||
| 67 | + return | ||
| 68 | + } | ||
| 69 | + if(!this.isLoading && this.hasMore){ | ||
| 70 | + //加载分页数据 | ||
| 71 | + this.currentPage++; | ||
| 72 | + this.getPeopleShipPageArticleList(resolve) | ||
| 73 | + }else { | ||
| 74 | + if(resolve) { | ||
| 75 | + resolve('') | ||
| 76 | + } | ||
| 77 | + } | ||
| 78 | + }, | ||
| 79 | + }) | ||
| 50 | } | 80 | } |
| 51 | 81 | ||
| 52 | } | 82 | } |
| @@ -62,10 +92,10 @@ export struct PeopleShipHomeArticleListComponent { | @@ -62,10 +92,10 @@ export struct PeopleShipHomeArticleListComponent { | ||
| 62 | @Builder | 92 | @Builder |
| 63 | ListLayout() { | 93 | ListLayout() { |
| 64 | 94 | ||
| 65 | - List() { | 95 | + List({scroller: this.scroller}) { |
| 66 | // 下拉刷新 | 96 | // 下拉刷新 |
| 67 | 97 | ||
| 68 | - LazyForEach(this.arr, (item: ContentDTO) => { | 98 | + ForEach(this.arr, (item: ContentDTO) => { |
| 69 | ListItem() { | 99 | ListItem() { |
| 70 | CardParser({ contentDTO: item }) | 100 | CardParser({ contentDTO: item }) |
| 71 | }.width("100%") | 101 | }.width("100%") |
| @@ -74,25 +104,25 @@ export struct PeopleShipHomeArticleListComponent { | @@ -74,25 +104,25 @@ export struct PeopleShipHomeArticleListComponent { | ||
| 74 | 104 | ||
| 75 | // 加载更多 | 105 | // 加载更多 |
| 76 | ListItem() { | 106 | ListItem() { |
| 77 | - if (!this.hasMore) { | 107 | + if (!this.hasMore && !this.isLoading) { |
| 78 | NoMoreLayout() | 108 | NoMoreLayout() |
| 79 | } | 109 | } |
| 80 | } | 110 | } |
| 81 | } | 111 | } |
| 82 | .width("100%") | 112 | .width("100%") |
| 83 | .height("100%") | 113 | .height("100%") |
| 84 | - .edgeEffect(EdgeEffect.Spring) | 114 | + .edgeEffect(EdgeEffect.None) |
| 85 | .nestedScroll({ | 115 | .nestedScroll({ |
| 86 | scrollForward: NestedScrollMode.PARENT_FIRST, | 116 | scrollForward: NestedScrollMode.PARENT_FIRST, |
| 87 | scrollBackward: NestedScrollMode.SELF_FIRST | 117 | scrollBackward: NestedScrollMode.SELF_FIRST |
| 88 | }) | 118 | }) |
| 89 | 119 | ||
| 90 | - .onReachEnd(() => { | ||
| 91 | - if(!this.isLoading && this.hasMore){ | ||
| 92 | - //加载分页数据 | ||
| 93 | - this.getPeopleShipPageArticleList() | ||
| 94 | - } | ||
| 95 | - }) | 120 | + // .onReachEnd(() => { |
| 121 | + // if(!this.isLoading && this.hasMore){ | ||
| 122 | + // //加载分页数据 | ||
| 123 | + // this.getPeopleShipPageArticleList() | ||
| 124 | + // } | ||
| 125 | + // }) | ||
| 96 | } | 126 | } |
| 97 | 127 | ||
| 98 | aboutToAppear() { | 128 | aboutToAppear() { |
| @@ -103,26 +133,37 @@ export struct PeopleShipHomeArticleListComponent { | @@ -103,26 +133,37 @@ export struct PeopleShipHomeArticleListComponent { | ||
| 103 | } | 133 | } |
| 104 | 134 | ||
| 105 | onChange() { | 135 | onChange() { |
| 106 | - if (this.currentIndex == this.currentTopSelectedIndex) { | 136 | + if (this.currentIndex == this.currentTopSelectedIndex && this.arr.length == 0) { |
| 107 | this.currentPage = 1 | 137 | this.currentPage = 1 |
| 108 | this.getPeopleShipPageArticleList() | 138 | this.getPeopleShipPageArticleList() |
| 109 | } | 139 | } |
| 110 | } | 140 | } |
| 111 | 141 | ||
| 112 | - private async getPeopleShipPageArticleList() { | 142 | + |
| 143 | + private async getPeopleShipPageArticleList(resolve?: (value: string | PromiseLike<string>) => void) { | ||
| 113 | Logger.info(`获取页面信息PeopleShipHomeArticleListComponent${this.typeModel.type}`) | 144 | Logger.info(`获取页面信息PeopleShipHomeArticleListComponent${this.typeModel.type}`) |
| 114 | if (this.isLoading) { | 145 | if (this.isLoading) { |
| 146 | + if (resolve) { | ||
| 147 | + resolve('') | ||
| 148 | + } | ||
| 115 | return | 149 | return |
| 116 | } | 150 | } |
| 117 | try { | 151 | try { |
| 118 | this.isLoading = true | 152 | this.isLoading = true |
| 119 | let listData: ArticleListData = await PeopleShipHomePageDataModel.getPeopleShipHomePageArticleListData(this.creatorId, this.currentPage, 20, this.typeModel.type) | 153 | let listData: ArticleListData = await PeopleShipHomePageDataModel.getPeopleShipHomePageArticleListData(this.creatorId, this.currentPage, 20, this.typeModel.type) |
| 120 | Logger.debug(TAG, `获取页面信息, ${listData.list.length}`); | 154 | Logger.debug(TAG, `获取页面信息, ${listData.list.length}`); |
| 155 | + Logger.debug(TAG, `已更新值最新, ${this.currentPage}`); | ||
| 121 | 156 | ||
| 157 | + if (resolve ) { | ||
| 158 | + if (this.currentPage == 1) { | ||
| 159 | + resolve('已更新至最新') | ||
| 160 | + }else { | ||
| 161 | + resolve('') | ||
| 162 | + } | ||
| 163 | + } | ||
| 122 | if (listData && listData.list && listData.list.length > 0) { | 164 | if (listData && listData.list && listData.list.length > 0) { |
| 123 | this.viewType = 3; | 165 | this.viewType = 3; |
| 124 | if (listData.list.length === 20) { | 166 | if (listData.list.length === 20) { |
| 125 | - this.currentPage++; | ||
| 126 | this.hasMore = true; | 167 | this.hasMore = true; |
| 127 | } else { | 168 | } else { |
| 128 | this.hasMore = false; | 169 | this.hasMore = false; |
| @@ -130,15 +171,18 @@ export struct PeopleShipHomeArticleListComponent { | @@ -130,15 +171,18 @@ export struct PeopleShipHomeArticleListComponent { | ||
| 130 | } else { | 171 | } else { |
| 131 | this.viewType = 1; | 172 | this.viewType = 1; |
| 132 | } | 173 | } |
| 174 | + this.isLoading = false | ||
| 133 | this.queryArticleContentInteractCount(listData) | 175 | this.queryArticleContentInteractCount(listData) |
| 134 | - Logger.debug(TAG, '展示的总数', `${this.arr.totalCount()}`) | 176 | + Logger.debug(TAG, '展示的总数', `${this.arr.length}`) |
| 135 | }catch (exception) { | 177 | }catch (exception) { |
| 178 | + if (resolve) { | ||
| 179 | + resolve('') | ||
| 180 | + } | ||
| 136 | this.isLoading = false | 181 | this.isLoading = false |
| 137 | - if (this.arr.totalCount() == 0) { | 182 | + if (this.arr.length == 0) { |
| 138 | this.viewType = 2 | 183 | this.viewType = 2 |
| 139 | } | 184 | } |
| 140 | } | 185 | } |
| 141 | - | ||
| 142 | } | 186 | } |
| 143 | 187 | ||
| 144 | /** | 188 | /** |
| @@ -167,6 +211,9 @@ export struct PeopleShipHomeArticleListComponent { | @@ -167,6 +211,9 @@ export struct PeopleShipHomeArticleListComponent { | ||
| 167 | private articleListDTOChangeContentDTO(listData: ArticleListData, listCom: InteractDataDTO[]) { | 211 | private articleListDTOChangeContentDTO(listData: ArticleListData, listCom: InteractDataDTO[]) { |
| 168 | this.isLoading = false | 212 | this.isLoading = false |
| 169 | if (listData.list.length) { | 213 | if (listData.list.length) { |
| 214 | + if (this.currentPage == 1) { | ||
| 215 | + this.arr = [] | ||
| 216 | + } | ||
| 170 | for (const element of listData.list) { | 217 | for (const element of listData.list) { |
| 171 | let contentDTO = {} as ContentDTO | 218 | let contentDTO = {} as ContentDTO |
| 172 | contentDTO.appStyle = this.changeCommon(element.appStyle) | 219 | contentDTO.appStyle = this.changeCommon(element.appStyle) |
| @@ -15,13 +15,13 @@ export struct PeopleShipHomePageHeadComponent { | @@ -15,13 +15,13 @@ export struct PeopleShipHomePageHeadComponent { | ||
| 15 | .borderWidth('1vp') | 15 | .borderWidth('1vp') |
| 16 | .borderStyle(BorderStyle.Solid) | 16 | .borderStyle(BorderStyle.Solid) |
| 17 | .borderColor(Color.White) | 17 | .borderColor(Color.White) |
| 18 | - .objectFit(ImageFit.Auto) | 18 | + .objectFit(ImageFit.Cover) |
| 19 | if(this.authIcon.length > 0 ) { | 19 | if(this.authIcon.length > 0 ) { |
| 20 | Image( this.authIcon ) | 20 | Image( this.authIcon ) |
| 21 | .width(this.iconDiameter) | 21 | .width(this.iconDiameter) |
| 22 | .height(this.iconDiameter) | 22 | .height(this.iconDiameter) |
| 23 | .borderRadius(this.iconDiameter/2) | 23 | .borderRadius(this.iconDiameter/2) |
| 24 | - .objectFit(ImageFit.Auto) | 24 | + .objectFit(ImageFit.Cover) |
| 25 | .margin({ | 25 | .margin({ |
| 26 | right: '-3vp' | 26 | right: '-3vp' |
| 27 | }) | 27 | }) |
| @@ -10,7 +10,7 @@ export struct CustomPullToRefresh { | @@ -10,7 +10,7 @@ export struct CustomPullToRefresh { | ||
| 10 | onLoadMore: (resolve?: (value: string | PromiseLike<string>) => void) => void = () => { | 10 | onLoadMore: (resolve?: (value: string | PromiseLike<string>) => void) => void = () => { |
| 11 | } | 11 | } |
| 12 | ///是否存在上拉更多 | 12 | ///是否存在上拉更多 |
| 13 | - @State hasMore: boolean = true | 13 | + @Prop @Watch('hasMoreChange') hasMore: boolean = true |
| 14 | refreshConfigurator: PullToRefreshConfigurator = new PullToRefreshConfigurator().setHasLoadMore(this.hasMore); | 14 | refreshConfigurator: PullToRefreshConfigurator = new PullToRefreshConfigurator().setHasLoadMore(this.hasMore); |
| 15 | build() { | 15 | build() { |
| 16 | Column(){ | 16 | Column(){ |
| @@ -36,4 +36,8 @@ export struct CustomPullToRefresh { | @@ -36,4 +36,8 @@ export struct CustomPullToRefresh { | ||
| 36 | }) | 36 | }) |
| 37 | } | 37 | } |
| 38 | } | 38 | } |
| 39 | + | ||
| 40 | + hasMoreChange() { | ||
| 41 | + this.refreshConfigurator.setHasLoadMore(this.hasMore) | ||
| 42 | + } | ||
| 39 | } | 43 | } |
| @@ -18,6 +18,7 @@ import promptAction from '@ohos.promptAction'; | @@ -18,6 +18,7 @@ import promptAction from '@ohos.promptAction'; | ||
| 18 | import { LogoutViewModel } from '../../viewmodel/LogoutViewModel'; | 18 | import { LogoutViewModel } from '../../viewmodel/LogoutViewModel'; |
| 19 | import { CustomLogoutDialog } from './CustomLogoutDialog'; | 19 | import { CustomLogoutDialog } from './CustomLogoutDialog'; |
| 20 | import { emitter } from '@kit.BasicServicesKit'; | 20 | import { emitter } from '@kit.BasicServicesKit'; |
| 21 | +import { ConfirmLogoutDialog } from './ConfirmLogoutDialog'; | ||
| 21 | 22 | ||
| 22 | export { SettingPasswordParams } from "wdLogin" | 23 | export { SettingPasswordParams } from "wdLogin" |
| 23 | 24 | ||
| @@ -42,6 +43,19 @@ export struct AccountAndSecurityLayout { | @@ -42,6 +43,19 @@ export struct AccountAndSecurityLayout { | ||
| 42 | alignment: DialogAlignment.Center | 43 | alignment: DialogAlignment.Center |
| 43 | }) | 44 | }) |
| 44 | 45 | ||
| 46 | + confirmDialogController: CustomDialogController = new CustomDialogController({ | ||
| 47 | + builder: ConfirmLogoutDialog({ | ||
| 48 | + cancel: () => { | ||
| 49 | + | ||
| 50 | + }, | ||
| 51 | + confirm: () => { | ||
| 52 | + this.logout() | ||
| 53 | + } | ||
| 54 | + }), | ||
| 55 | + customStyle: true, | ||
| 56 | + alignment: DialogAlignment.Center | ||
| 57 | + }) | ||
| 58 | + | ||
| 45 | 59 | ||
| 46 | aboutToAppear() { | 60 | aboutToAppear() { |
| 47 | // 获取设置页面数据 | 61 | // 获取设置页面数据 |
| @@ -172,11 +186,8 @@ export struct AccountAndSecurityLayout { | @@ -172,11 +186,8 @@ export struct AccountAndSecurityLayout { | ||
| 172 | 186 | ||
| 173 | Column() { | 187 | Column() { |
| 174 | Button('退出登录',{ stateEffect: true ,type: ButtonType.Normal}).width('90%').height('80lpx').backgroundColor('#da3e22').fontColor('#fff').margin('20lpx').borderRadius('8lpx').onClick(()=>{ | 188 | Button('退出登录',{ stateEffect: true ,type: ButtonType.Normal}).width('90%').height('80lpx').backgroundColor('#da3e22').fontColor('#fff').margin('20lpx').borderRadius('8lpx').onClick(()=>{ |
| 175 | - let login = new LoginViewModel; | ||
| 176 | - promptAction.showToast({ message: '退出登录' }) | ||
| 177 | - login.logOut(); | ||
| 178 | - router.back(); | ||
| 179 | - router.back(); | 189 | + this.confirmDialogController.open() |
| 190 | + | ||
| 180 | // AlertDialog.show({ | 191 | // AlertDialog.show({ |
| 181 | // title: '🥟id : ' + "button", | 192 | // title: '🥟id : ' + "button", |
| 182 | // message: '标题:' + '退出登录', | 193 | // message: '标题:' + '退出登录', |
| @@ -415,6 +426,16 @@ export struct AccountAndSecurityLayout { | @@ -415,6 +426,16 @@ export struct AccountAndSecurityLayout { | ||
| 415 | .height('54lpx') | 426 | .height('54lpx') |
| 416 | } | 427 | } |
| 417 | 428 | ||
| 429 | + logout(){ | ||
| 430 | + let login = new LoginViewModel; | ||
| 431 | + login.logOut().then(()=>{ | ||
| 432 | + promptAction.showToast({ message: '退出登录' }) | ||
| 433 | + router.back(); | ||
| 434 | + router.back(); | ||
| 435 | + }).catch((error:string)=>{ | ||
| 436 | + promptAction.showToast({ message: error }) | ||
| 437 | + }); | ||
| 438 | + } | ||
| 418 | 439 | ||
| 419 | //注销账号 | 440 | //注销账号 |
| 420 | requestLogout() { | 441 | requestLogout() { |
sight_harmony/features/wdComponent/src/main/ets/components/setting/ConfirmLogoutDialog.ets
0 → 100644
| 1 | +/**退出登录确认弹框*/ | ||
| 2 | + | ||
| 3 | +@CustomDialog | ||
| 4 | +export struct ConfirmLogoutDialog { | ||
| 5 | + controller: CustomDialogController | ||
| 6 | + cancel: () => void = () => { | ||
| 7 | + } | ||
| 8 | + confirm: () => void = () => { | ||
| 9 | + } | ||
| 10 | + | ||
| 11 | + build() { | ||
| 12 | + Column() { | ||
| 13 | + Text("确认退出登录吗?") | ||
| 14 | + .fontColor("#222222") | ||
| 15 | + .fontSize(18) | ||
| 16 | + .width("100%") | ||
| 17 | + .fontWeight(FontWeight.Bold) | ||
| 18 | + .textAlign(TextAlign.Center) | ||
| 19 | + .margin({ top: 20 }) | ||
| 20 | + | ||
| 21 | + Divider().color("#999999").width("100%").margin({ top: 20 }).height('1vp') | ||
| 22 | + Row() { | ||
| 23 | + Text('确认') | ||
| 24 | + .fontSize(16) | ||
| 25 | + .fontColor("#648DF2") | ||
| 26 | + .layoutWeight(1) | ||
| 27 | + .fontWeight(FontWeight.Medium) | ||
| 28 | + .textAlign(TextAlign.Center) | ||
| 29 | + .onClick(() => { | ||
| 30 | + this.controller.close() | ||
| 31 | + if (this.confirm) { | ||
| 32 | + this.confirm() | ||
| 33 | + } | ||
| 34 | + | ||
| 35 | + }) | ||
| 36 | + .height('100%') | ||
| 37 | + // Divider().color("#999999").height('100%').width('0.5vp') | ||
| 38 | + Text('取消') | ||
| 39 | + .fontSize(16) | ||
| 40 | + .fontColor("#648DF2") | ||
| 41 | + .layoutWeight(1) | ||
| 42 | + .fontWeight(FontWeight.Medium) | ||
| 43 | + .textAlign(TextAlign.Center) | ||
| 44 | + .border({ | ||
| 45 | + width: { left: 1 }, | ||
| 46 | + color: "#999999", | ||
| 47 | + style: { left: BorderStyle.Solid } | ||
| 48 | + | ||
| 49 | + }) | ||
| 50 | + .onClick(() => { | ||
| 51 | + this.controller.close() | ||
| 52 | + if (this.cancel) { | ||
| 53 | + this.cancel() | ||
| 54 | + } | ||
| 55 | + }) | ||
| 56 | + .height('100%') | ||
| 57 | + }.layoutWeight(1).justifyContent(FlexAlign.Center) | ||
| 58 | + }.height(110).backgroundColor(Color.White).borderRadius(6).width('74%') | ||
| 59 | + } | ||
| 60 | +} |
| @@ -108,7 +108,9 @@ export struct EmptyComponent { | @@ -108,7 +108,9 @@ export struct EmptyComponent { | ||
| 108 | let contentString: string = '暂无内容' | 108 | let contentString: string = '暂无内容' |
| 109 | if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoCollection) { | 109 | if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoCollection) { |
| 110 | contentString = '暂无收藏' | 110 | contentString = '暂无收藏' |
| 111 | - } else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoMessage) { | 111 | + } else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoHistory) { |
| 112 | + contentString = '暂无浏览历史' | ||
| 113 | + } else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoMessage) { | ||
| 112 | contentString = '暂无消息' | 114 | contentString = '暂无消息' |
| 113 | } else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoComment) { | 115 | } else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoComment) { |
| 114 | contentString = '暂无评论' | 116 | contentString = '暂无评论' |
| @@ -140,7 +142,7 @@ export struct EmptyComponent { | @@ -140,7 +142,7 @@ export struct EmptyComponent { | ||
| 140 | buildNoDataTipImage(): Resource | string { | 142 | buildNoDataTipImage(): Resource | string { |
| 141 | Logger.info(TAG, "buildNoDataTip"); | 143 | Logger.info(TAG, "buildNoDataTip"); |
| 142 | let imageString: Resource | string = $r('app.media.icon_no_content') | 144 | let imageString: Resource | string = $r('app.media.icon_no_content') |
| 143 | - if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoCollection) { | 145 | + if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoCollection||this.emptyType === WDViewDefaultType.WDViewDefaultType_NoHistory) { |
| 144 | imageString = $r('app.media.icon_no_collection') | 146 | imageString = $r('app.media.icon_no_collection') |
| 145 | } else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoMessage) { | 147 | } else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoMessage) { |
| 146 | imageString = $r('app.media.icon_no_message') | 148 | imageString = $r('app.media.icon_no_message') |
| 1 | +import { image } from '@kit.ImageKit'; | ||
| 2 | +import { matrix4, promptAction, window } from '@kit.ArkUI'; | ||
| 3 | +import { BusinessError } from '@kit.BasicServicesKit'; | ||
| 4 | +import { ScaleModel } from '../../model/ScaleModel'; | ||
| 5 | +import { OffsetModel } from '../../model/OffsetModel'; | ||
| 6 | +import { windowSizeManager } from '../../utils/Managers'; | ||
| 7 | +import { runWithAnimation } from '../../utils/FuncUtils'; | ||
| 8 | +import { PhotoListBean } from 'wdBean/Index'; | ||
| 9 | +import { http } from '@kit.NetworkKit'; | ||
| 10 | + | ||
| 11 | +// TODO:知识点:组件复用 | ||
| 12 | +@Reusable | ||
| 13 | +@Component | ||
| 14 | +export struct ImageItemView { | ||
| 15 | + @Consume private bgc: Color; | ||
| 16 | + @Link isEnableSwipe: boolean; // TODO:需求:多图切换 | ||
| 17 | + @State isEnableOffset: boolean = false; | ||
| 18 | + @State imageScaleInfo: ScaleModel = new ScaleModel(1.0, 1.0, 1.5, 0.3); | ||
| 19 | + @State imageOffsetInfo: OffsetModel = new OffsetModel(0, 0); | ||
| 20 | + @State matrix: matrix4.Matrix4Transit = matrix4.identity().copy(); | ||
| 21 | + @State imagePixelMap: image.PixelMap | null = null; // 当前图片pixelMap,用于Image组件显示 | ||
| 22 | + @State fitWH: "width" | "height" | undefined = undefined; // 表示当前图片是根据宽度适配还是高度适配 | ||
| 23 | + @State imageDefaultSize: image.Size = { width: 0, height: 0 }; // 图片默认大小,即,与屏幕大小最适配的显示大小 | ||
| 24 | + imageUri: string = ""; // 当前图片uri | ||
| 25 | + imageWHRatio: number = 0; // 图片原始宽高比 | ||
| 26 | + private MultiPictureDetailItem: PhotoListBean = {} as PhotoListBean | ||
| 27 | + @State imageBuffer: ArrayBuffer | undefined = undefined; // 图片ArrayBuffer | ||
| 28 | + | ||
| 29 | + aboutToAppear(): void { | ||
| 30 | + this.imageUri = this.MultiPictureDetailItem.picPath | ||
| 31 | + this.getPicture() | ||
| 32 | + } | ||
| 33 | + | ||
| 34 | + /** | ||
| 35 | + * 通过http的request方法从网络下载图片资源 | ||
| 36 | + */ | ||
| 37 | + async getPicture() { | ||
| 38 | + console.info(`cj2024 getPicture`) | ||
| 39 | + http.createHttp() | ||
| 40 | + .request(this.imageUri, | ||
| 41 | + (error: BusinessError, data: http.HttpResponse) => { | ||
| 42 | + if (error) { | ||
| 43 | + // 下载失败时弹窗提示检查网络,不执行后续逻辑 | ||
| 44 | + promptAction.showToast({ | ||
| 45 | + message: $r('app.string.image_request_fail'), | ||
| 46 | + duration: 2000 | ||
| 47 | + }) | ||
| 48 | + return; | ||
| 49 | + } | ||
| 50 | + this.transcodePixelMap(data); | ||
| 51 | + // 判断网络获取到的资源是否为ArrayBuffer类型 | ||
| 52 | + console.info(`cj2024 getPicture ${data.result}`) | ||
| 53 | + if (data.result instanceof ArrayBuffer) { | ||
| 54 | + console.info(`cj2024 getPicture 222`) | ||
| 55 | + this.imageBuffer = data.result as ArrayBuffer; | ||
| 56 | + } | ||
| 57 | + } | ||
| 58 | + ) | ||
| 59 | + } | ||
| 60 | + | ||
| 61 | + /** | ||
| 62 | + * 使用createPixelMap将ArrayBuffer类型的图片装换为PixelMap类型 | ||
| 63 | + * @param data:网络获取到的资源 | ||
| 64 | + */ | ||
| 65 | + transcodePixelMap(data: http.HttpResponse) { | ||
| 66 | + console.info(`cj2024 transcodePixelMap ${data.responseCode}`) | ||
| 67 | + if (http.ResponseCode.OK === data.responseCode) { | ||
| 68 | + const imageData: ArrayBuffer = data.result as ArrayBuffer; | ||
| 69 | + // 通过ArrayBuffer创建图片源实例。 | ||
| 70 | + const imageSource: image.ImageSource = image.createImageSource(imageData); | ||
| 71 | + this.initCurrentImageInfo(imageSource); | ||
| 72 | + } | ||
| 73 | + } | ||
| 74 | + | ||
| 75 | + /** | ||
| 76 | + * 根据图片宽高比及窗口大小计算图片的默认宽高,即,图片最适配屏幕的大小 | ||
| 77 | + * @param imageWHRatio:图片原始宽高比 | ||
| 78 | + * @param size:窗口大小{with:number,height:number} | ||
| 79 | + * @returns image.Size | ||
| 80 | + */ | ||
| 81 | + calcImageDefaultSize(imageWHRatio: number, size: window.Size): image.Size { | ||
| 82 | + let width = 0 | ||
| 83 | + let height = 0; | ||
| 84 | + if (imageWHRatio > size.width / size.height) { | ||
| 85 | + // 图片宽高比大于屏幕宽高比,图片默认以屏幕宽度进行显示 | ||
| 86 | + width = size.width; | ||
| 87 | + height = size.width / imageWHRatio; | ||
| 88 | + } else { | ||
| 89 | + height = size.height; | ||
| 90 | + width = size.height * imageWHRatio; | ||
| 91 | + } | ||
| 92 | + return { width: width, height: height }; | ||
| 93 | + } | ||
| 94 | + | ||
| 95 | + /** | ||
| 96 | + * TODO:知识点:根据图片大小(宽高<=屏幕宽高)和屏幕大小计算图片放大适配屏幕进行显示的缩放倍率 | ||
| 97 | + * @param imageSize:图片当前大小 | ||
| 98 | + * @param windowSize:窗口大小 | ||
| 99 | + * @returns:缩放倍率 | ||
| 100 | + */ | ||
| 101 | + calcFitScaleRatio(imageSize: image.Size, windowSize: window.Size): number { | ||
| 102 | + let ratio: number = 1.0; | ||
| 103 | + if (windowSize.width > imageSize.width) { | ||
| 104 | + ratio = windowSize.width / imageSize.width; | ||
| 105 | + } else { | ||
| 106 | + ratio = windowSize.height / imageSize.height; | ||
| 107 | + } | ||
| 108 | + return ratio; | ||
| 109 | + } | ||
| 110 | + | ||
| 111 | + /** | ||
| 112 | + * 设置当前图片的相关信息:uri、whRatio、pixelMap、fitWH、defaultSize、maxScaleValue | ||
| 113 | + * TODO:知识点:提前获取图片的信息,以进行Image组件的尺寸设置及后续的相关计算 | ||
| 114 | + */ | ||
| 115 | + initCurrentImageInfo(imageSource: image.ImageSource): void { | ||
| 116 | + this.matrix = matrix4.identity().copy(); | ||
| 117 | + // const imageSource: image.ImageSource = image.createImageSource(this.imageUri); | ||
| 118 | + imageSource.getImageInfo(0).then((data: image.ImageInfo) => { | ||
| 119 | + this.imageWHRatio = data.size.width / data.size.height; | ||
| 120 | + this.imageDefaultSize = this.calcImageDefaultSize(this.imageWHRatio, windowSizeManager.get()); | ||
| 121 | + if (this.imageDefaultSize.width === windowSizeManager.get().width) { | ||
| 122 | + this.fitWH = "width"; | ||
| 123 | + } else { | ||
| 124 | + this.fitWH = "height"; | ||
| 125 | + } | ||
| 126 | + this.imageScaleInfo.maxScaleValue += this.fitWH === "width" ? | ||
| 127 | + (windowSizeManager.get().height / this.imageDefaultSize.height) : | ||
| 128 | + (windowSizeManager.get().width / this.imageDefaultSize.width); | ||
| 129 | + }).catch((err: BusinessError) => { | ||
| 130 | + console.error(`[error][getImageInfo]${err.message}`); | ||
| 131 | + }); | ||
| 132 | + imageSource.createPixelMap().then((data: image.PixelMap) => { | ||
| 133 | + this.imagePixelMap = data; | ||
| 134 | + }).catch((err: BusinessError) => { | ||
| 135 | + console.error(`[error][createPixelMap]${err.message}`); | ||
| 136 | + }); | ||
| 137 | + this.isEnableOffset = false; | ||
| 138 | + this.imageScaleInfo.reset(); | ||
| 139 | + this.imageOffsetInfo.reset(); | ||
| 140 | + } | ||
| 141 | + | ||
| 142 | + /** | ||
| 143 | + * 在图片消失时,将当前图片的信息设置为默认值 | ||
| 144 | + */ | ||
| 145 | + resetCurrentImageInfo(): void { | ||
| 146 | + this.imageScaleInfo.reset(); | ||
| 147 | + this.imageOffsetInfo.reset(); | ||
| 148 | + this.matrix = matrix4.identity().copy(); | ||
| 149 | + } | ||
| 150 | + | ||
| 151 | + /** | ||
| 152 | + * TODO:需求:在偏移时评估是否到达边界,以便进行位移限制与图片的切换 | ||
| 153 | + * @returns:长度为4的boolean数组,表示上下左右是否到达边界 | ||
| 154 | + */ | ||
| 155 | + evaluateBound(): boolean[] { | ||
| 156 | + return [false, false, false, false]; | ||
| 157 | + } | ||
| 158 | + | ||
| 159 | + build() { | ||
| 160 | + Stack() { | ||
| 161 | + Image(this.imagePixelMap)// TODO:知识点:宽高只根据其尺寸设置一个,通过保持宽高比来设置另一个属性 | ||
| 162 | + .width(this.fitWH === "width" ? "100%" : undefined) | ||
| 163 | + .height(this.fitWH === "height" ? "100%" : undefined) | ||
| 164 | + .aspectRatio(this.imageWHRatio) | ||
| 165 | + .objectFit(ImageFit.Cover)// TODO:知识点:保持宽高比进行缩放,可以超出父组件,以便实现多图切换的增强功能 | ||
| 166 | + .autoResize(false) | ||
| 167 | + .transform(this.matrix)// TODO:知识点:通过matrix控制图片的缩放 | ||
| 168 | + .defaultFocus(true) | ||
| 169 | + .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM]) | ||
| 170 | + .offset({ | ||
| 171 | + // TODO:知识点:通过offset控制图片的偏移 | ||
| 172 | + x: this.imageOffsetInfo.currentX, | ||
| 173 | + y: this.imageOffsetInfo.currentY | ||
| 174 | + }) | ||
| 175 | + } | ||
| 176 | + .onBlur(() => { | ||
| 177 | + this.resetCurrentImageInfo(); | ||
| 178 | + }) | ||
| 179 | + // .backgroundColor(this.bgc) | ||
| 180 | + .alignContent(Alignment.Center) | ||
| 181 | + .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM]) | ||
| 182 | + .width("100%") | ||
| 183 | + .height("100%") | ||
| 184 | + .gesture( | ||
| 185 | + GestureGroup( | ||
| 186 | + GestureMode.Exclusive, | ||
| 187 | + // TODO:知识点:双击切换图片大小 | ||
| 188 | + TapGesture({ count: 2 }) | ||
| 189 | + .onAction(() => { | ||
| 190 | + let fn: Function; | ||
| 191 | + // 已经是放大状态下,双击缩小 | ||
| 192 | + if (this.imageScaleInfo.scaleValue > this.imageScaleInfo.defaultScaleValue) { | ||
| 193 | + fn = () => { | ||
| 194 | + this.isEnableSwipe = true; | ||
| 195 | + this.imageScaleInfo.reset(); | ||
| 196 | + this.imageOffsetInfo.reset(); | ||
| 197 | + this.matrix = matrix4.identity().copy(); | ||
| 198 | + }; | ||
| 199 | + } else { | ||
| 200 | + // 已经是缩小状态,双击放大 | ||
| 201 | + fn = () => { | ||
| 202 | + this.isEnableSwipe = false; | ||
| 203 | + const ratio: number = this.calcFitScaleRatio(this.imageDefaultSize, windowSizeManager.get()); | ||
| 204 | + this.imageScaleInfo.scaleValue = ratio; | ||
| 205 | + this.imageOffsetInfo.reset(); | ||
| 206 | + this.matrix = matrix4.identity().scale({ | ||
| 207 | + x: ratio, | ||
| 208 | + y: ratio, | ||
| 209 | + }).copy(); | ||
| 210 | + this.imageScaleInfo.stash(); | ||
| 211 | + } | ||
| 212 | + } | ||
| 213 | + runWithAnimation(fn); | ||
| 214 | + }), | ||
| 215 | + // 单击切换背景色 | ||
| 216 | + // TapGesture({ count: 1 }).onAction(() => { | ||
| 217 | + // runWithAnimation(() => { | ||
| 218 | + // this.bgc = this.bgc === Color.White ? Color.Black : Color.White; | ||
| 219 | + // }); | ||
| 220 | + // }), | ||
| 221 | + // TODO:知识点:双指捏合缩放图片 | ||
| 222 | + PinchGesture({ fingers: 2, distance: 1 }) | ||
| 223 | + .onActionUpdate((event: GestureEvent) => { | ||
| 224 | + this.imageScaleInfo.scaleValue = this.imageScaleInfo.lastValue * event.scale; | ||
| 225 | + // TODO:知识点:缩放时不允许大于最大缩放因子+额外缩放因子,不允许小于默认大小-额外缩放因子,额外缩放因子用于提升用户体验 | ||
| 226 | + if (this.imageScaleInfo.scaleValue > this.imageScaleInfo.maxScaleValue * | ||
| 227 | + (1 + this.imageScaleInfo.extraScaleValue) | ||
| 228 | + ) { | ||
| 229 | + this.imageScaleInfo.scaleValue = this.imageScaleInfo.maxScaleValue * | ||
| 230 | + (1 + this.imageScaleInfo.extraScaleValue); | ||
| 231 | + } | ||
| 232 | + if (this.imageScaleInfo.scaleValue < this.imageScaleInfo.defaultScaleValue * | ||
| 233 | + (1 - this.imageScaleInfo.extraScaleValue)) { | ||
| 234 | + this.imageScaleInfo.scaleValue = this.imageScaleInfo.defaultScaleValue * | ||
| 235 | + (1 - this.imageScaleInfo.extraScaleValue); | ||
| 236 | + } | ||
| 237 | + // TODO:知识点:matrix默认缩放中心为组件中心 | ||
| 238 | + this.matrix = matrix4.identity().scale({ | ||
| 239 | + x: this.imageScaleInfo.scaleValue, | ||
| 240 | + y: this.imageScaleInfo.scaleValue, | ||
| 241 | + }).copy(); | ||
| 242 | + console.debug(this.imageScaleInfo.toString()); | ||
| 243 | + }) | ||
| 244 | + .onActionEnd((event: GestureEvent) => { | ||
| 245 | + /** | ||
| 246 | + * TODO:知识点:当小于默认大小时,恢复为默认大小 | ||
| 247 | + */ | ||
| 248 | + if (this.imageScaleInfo.scaleValue < this.imageScaleInfo.defaultScaleValue) { | ||
| 249 | + runWithAnimation(() => { | ||
| 250 | + this.imageScaleInfo.reset(); | ||
| 251 | + this.imageOffsetInfo.reset(); | ||
| 252 | + this.matrix = matrix4.identity().copy(); | ||
| 253 | + }) | ||
| 254 | + } | ||
| 255 | + // TODO:知识点:当大于最大缩放因子时,恢复到最大 | ||
| 256 | + if (this.imageScaleInfo.scaleValue > this.imageScaleInfo.maxScaleValue) { | ||
| 257 | + runWithAnimation(() => { | ||
| 258 | + this.imageScaleInfo.scaleValue = this.imageScaleInfo.maxScaleValue; | ||
| 259 | + this.matrix = matrix4.identity() | ||
| 260 | + .scale({ | ||
| 261 | + x: this.imageScaleInfo.maxScaleValue, | ||
| 262 | + y: this.imageScaleInfo.maxScaleValue | ||
| 263 | + }); | ||
| 264 | + }) | ||
| 265 | + } | ||
| 266 | + this.imageScaleInfo.stash(); | ||
| 267 | + }), | ||
| 268 | + // // TODO:知识点:滑动图片 | ||
| 269 | + // PanGesture({ fingers: 1 })// TODO:需求:默认大小下左右滑动应当是切换图片 | ||
| 270 | + // .onActionUpdate((event: GestureEvent) => { | ||
| 271 | + // if (this.imageScaleInfo.scaleValue === this.imageScaleInfo.defaultScaleValue) { | ||
| 272 | + // // 默认大小下不允许移动 | ||
| 273 | + // return; | ||
| 274 | + // } | ||
| 275 | + // this.imageOffsetInfo.currentX = this.imageOffsetInfo.lastX + event.offsetX; | ||
| 276 | + // this.imageOffsetInfo.currentY = this.imageOffsetInfo.lastY + event.offsetY; | ||
| 277 | + // }) | ||
| 278 | + // .onActionEnd((event: GestureEvent) => { | ||
| 279 | + // this.imageOffsetInfo.stash(); | ||
| 280 | + // }) | ||
| 281 | + ), | ||
| 282 | + ) | ||
| 283 | + } | ||
| 284 | +} |
| 1 | -import { ToastUtils, Logger, NumberFormatterUtils } from 'wdKit'; | 1 | +import { ToastUtils, Logger, NumberFormatterUtils, SPHelper } from 'wdKit'; |
| 2 | import { | 2 | import { |
| 3 | InputMethodProperty, | 3 | InputMethodProperty, |
| 4 | batchLikeAndCollectResult, | 4 | batchLikeAndCollectResult, |
| @@ -15,6 +15,7 @@ import { MultiPictureDetailViewModel } from '../../viewmodel/MultiPictureDetailV | @@ -15,6 +15,7 @@ import { MultiPictureDetailViewModel } from '../../viewmodel/MultiPictureDetailV | ||
| 15 | import { HttpUrlUtils } from 'wdNetwork/Index'; | 15 | import { HttpUrlUtils } from 'wdNetwork/Index'; |
| 16 | import { WDRouterPage, WDRouterRule } from 'wdRouter/Index'; | 16 | import { WDRouterPage, WDRouterRule } from 'wdRouter/Index'; |
| 17 | import { PageRepository } from '../../repository/PageRepository'; | 17 | import { PageRepository } from '../../repository/PageRepository'; |
| 18 | +import { SpConstants } from 'wdConstant/Index'; | ||
| 18 | 19 | ||
| 19 | export interface OperationItem { | 20 | export interface OperationItem { |
| 20 | icon: Resource; | 21 | icon: Resource; |
| @@ -53,8 +54,9 @@ export struct OperRowListView { | @@ -53,8 +54,9 @@ export struct OperRowListView { | ||
| 53 | } | 54 | } |
| 54 | ] | 55 | ] |
| 55 | 56 | ||
| 56 | - aboutToAppear() { | ||
| 57 | - if (HttpUrlUtils.getUserId()) { | 57 | + async aboutToAppear() { |
| 58 | + const user_id = await SPHelper.default.get(SpConstants.USER_ID, '') | ||
| 59 | + if (user_id) { | ||
| 58 | this.getInteractDataStatus() | 60 | this.getInteractDataStatus() |
| 59 | } | 61 | } |
| 60 | this.queryContentInteractCount() | 62 | this.queryContentInteractCount() |
| @@ -338,9 +340,10 @@ export struct OperRowListView { | @@ -338,9 +340,10 @@ export struct OperRowListView { | ||
| 338 | /** | 340 | /** |
| 339 | * 点赞、取消点赞 | 341 | * 点赞、取消点赞 |
| 340 | */ | 342 | */ |
| 341 | - toggleLikeStatus() { | 343 | + async toggleLikeStatus() { |
| 342 | // 未登录,跳转登录 | 344 | // 未登录,跳转登录 |
| 343 | - if (!HttpUrlUtils.getUserId()) { | 345 | + const user_id = await SPHelper.default.get(SpConstants.USER_ID, '') |
| 346 | + if (!user_id) { | ||
| 344 | WDRouterRule.jumpWithPage(WDRouterPage.loginPage) | 347 | WDRouterRule.jumpWithPage(WDRouterPage.loginPage) |
| 345 | return | 348 | return |
| 346 | } | 349 | } |
| @@ -361,9 +364,10 @@ export struct OperRowListView { | @@ -361,9 +364,10 @@ export struct OperRowListView { | ||
| 361 | /** | 364 | /** |
| 362 | * 收藏、取消收藏 | 365 | * 收藏、取消收藏 |
| 363 | */ | 366 | */ |
| 364 | - toggleCollectStatus() { | 367 | + async toggleCollectStatus() { |
| 365 | // 未登录,跳转登录 | 368 | // 未登录,跳转登录 |
| 366 | - if (!HttpUrlUtils.getUserId()) { | 369 | + const user_id = await SPHelper.default.get(SpConstants.USER_ID, '') |
| 370 | + if (!user_id) { | ||
| 367 | WDRouterRule.jumpWithPage(WDRouterPage.loginPage) | 371 | WDRouterRule.jumpWithPage(WDRouterPage.loginPage) |
| 368 | return | 372 | return |
| 369 | } | 373 | } |
| @@ -33,6 +33,7 @@ export struct SecondLevelComponent { | @@ -33,6 +33,7 @@ export struct SecondLevelComponent { | ||
| 33 | } | 33 | } |
| 34 | 34 | ||
| 35 | onFirstChange(){ | 35 | onFirstChange(){ |
| 36 | + this.select = 0 | ||
| 36 | if (!this.currentFirst) { | 37 | if (!this.currentFirst) { |
| 37 | this.mTip = '暂无数据'; | 38 | this.mTip = '暂无数据'; |
| 38 | } else { | 39 | } else { |
| @@ -34,10 +34,11 @@ export struct ThirdLevelComponent { | @@ -34,10 +34,11 @@ export struct ThirdLevelComponent { | ||
| 34 | } | 34 | } |
| 35 | 35 | ||
| 36 | onFirstChange(){ | 36 | onFirstChange(){ |
| 37 | - | 37 | + this.select = 0 |
| 38 | } | 38 | } |
| 39 | 39 | ||
| 40 | onSecondChange(){ | 40 | onSecondChange(){ |
| 41 | + this.select = 0 | ||
| 41 | if (!this.currentSecondBean) { | 42 | if (!this.currentSecondBean) { |
| 42 | this.mTip = '暂无数据'; | 43 | this.mTip = '暂无数据'; |
| 43 | } else { | 44 | } else { |
| @@ -60,7 +60,7 @@ class MinePageDatasModel{ | @@ -60,7 +60,7 @@ class MinePageDatasModel{ | ||
| 60 | return this.personalData | 60 | return this.personalData |
| 61 | } | 61 | } |
| 62 | this.personalData.push(new MinePagePersonalFunctionsItem("评论",$r('app.media.mine_comment_icon'))) | 62 | this.personalData.push(new MinePagePersonalFunctionsItem("评论",$r('app.media.mine_comment_icon'))) |
| 63 | - this.personalData.push(new MinePagePersonalFunctionsItem("关注",$r('app.media.mine_order_icon'))) | 63 | + this.personalData.push(new MinePagePersonalFunctionsItem("关注",$r('app.media.mine_follow_icon'))) |
| 64 | this.personalData.push(new MinePagePersonalFunctionsItem("收藏",$r('app.media.mine_collect_icon'))) | 64 | this.personalData.push(new MinePagePersonalFunctionsItem("收藏",$r('app.media.mine_collect_icon'))) |
| 65 | this.personalData.push(new MinePagePersonalFunctionsItem("历史",$r('app.media.mine_history_icon'))) | 65 | this.personalData.push(new MinePagePersonalFunctionsItem("历史",$r('app.media.mine_history_icon'))) |
| 66 | this.personalData.push(new MinePagePersonalFunctionsItem("消息",$r('app.media.mine_msg_icon'))) | 66 | this.personalData.push(new MinePagePersonalFunctionsItem("消息",$r('app.media.mine_msg_icon'))) |
| 1 | +@Observed | ||
| 2 | +export class OffsetModel { | ||
| 3 | + public currentX: number; | ||
| 4 | + public currentY: number; | ||
| 5 | + public lastX: number = 0; | ||
| 6 | + public lastY: number = 0; | ||
| 7 | + | ||
| 8 | + constructor(currentX: number = 0, currentY: number = 0) { | ||
| 9 | + this.currentX = currentX; | ||
| 10 | + this.currentY = currentY; | ||
| 11 | + } | ||
| 12 | + | ||
| 13 | + reset(): void { | ||
| 14 | + this.currentX = 0; | ||
| 15 | + this.currentY = 0; | ||
| 16 | + this.lastX = 0; | ||
| 17 | + this.lastY = 0; | ||
| 18 | + } | ||
| 19 | + | ||
| 20 | + stash(): void { | ||
| 21 | + this.lastX = this.currentX; | ||
| 22 | + this.lastY = this.currentY; | ||
| 23 | + } | ||
| 24 | + | ||
| 25 | + toString(): string { | ||
| 26 | + return `[currentX: ${this.currentX} currentY: ${this.currentY} lastX: ${this.lastX} lastY: ${this.lastY}]`; | ||
| 27 | + } | ||
| 28 | +} |
| 1 | +@Observed | ||
| 2 | +export class ScaleModel { | ||
| 3 | + /** | ||
| 4 | + * scaleValue: 本次缩放因子,用于控制图片的大小显示 | ||
| 5 | + * lastValue:记录上次缩放完后的缩放因子 | ||
| 6 | + * defaultMaxScaleValue:默认的最大放大值 | ||
| 7 | + * defaultScaleValue:默认缩放值,1 | ||
| 8 | + */ | ||
| 9 | + public scaleValue: number; | ||
| 10 | + public lastValue: number; | ||
| 11 | + public maxScaleValue: number; | ||
| 12 | + public extraScaleValue: number; | ||
| 13 | + public readonly defaultScaleValue: number = 1; | ||
| 14 | + | ||
| 15 | + constructor(scaleValue: number = 1.0, lastValue: number = 1.0, | ||
| 16 | + maxScaleValue: number = 1.5, extraScaleValue: number = 0.2) { | ||
| 17 | + this.scaleValue = scaleValue; | ||
| 18 | + this.lastValue = lastValue; | ||
| 19 | + this.maxScaleValue = maxScaleValue; | ||
| 20 | + this.extraScaleValue = extraScaleValue; | ||
| 21 | + } | ||
| 22 | + | ||
| 23 | + reset(): void { | ||
| 24 | + this.scaleValue = this.defaultScaleValue; | ||
| 25 | + this.lastValue = this.scaleValue; | ||
| 26 | + } | ||
| 27 | + | ||
| 28 | + stash(): void { | ||
| 29 | + this.lastValue = this.scaleValue; | ||
| 30 | + } | ||
| 31 | + | ||
| 32 | + toString(): string { | ||
| 33 | + return `[scaleValue: ${this.scaleValue} lastValue: ${this.lastValue}]`; | ||
| 34 | + } | ||
| 35 | +} |
| @@ -185,10 +185,10 @@ struct MineHomePage { | @@ -185,10 +185,10 @@ struct MineHomePage { | ||
| 185 | //tab 页面 | 185 | //tab 页面 |
| 186 | Tabs({controller: this.controller}) { | 186 | Tabs({controller: this.controller}) { |
| 187 | TabContent() { | 187 | TabContent() { |
| 188 | - HomePageBottomComponent({style:0}) | 188 | + HomePageBottomComponent({style:0,commentNum:$commentNum}) |
| 189 | }.tabBar(this.TabBuilder(0,"评论")) | 189 | }.tabBar(this.TabBuilder(0,"评论")) |
| 190 | TabContent() { | 190 | TabContent() { |
| 191 | - HomePageBottomComponent({style:1}) | 191 | + HomePageBottomComponent({style:1,commentNum:$commentNum}) |
| 192 | }.tabBar(this.TabBuilder(1,"关注")) | 192 | }.tabBar(this.TabBuilder(1,"关注")) |
| 193 | } | 193 | } |
| 194 | .backgroundColor($r('app.color.white')) | 194 | .backgroundColor($r('app.color.white')) |
| 1 | +/** | ||
| 2 | + * 给函数的执行加上动画 | ||
| 3 | + * @param fn:要在动画内执行的回调函数,通常fn里面会改变状态变量 | ||
| 4 | + * @param duration:动画持续时长 | ||
| 5 | + * @param curve:动画区线 | ||
| 6 | + */ | ||
| 7 | +import { ImageViewerConstants } from '../constants/ImageViewerConstants'; | ||
| 8 | + | ||
| 9 | +export function runWithAnimation( | ||
| 10 | + fn: Function, | ||
| 11 | + duration: number = ImageViewerConstants.ANIMATE_DURATION, | ||
| 12 | + curve: Curve = Curve.Smooth): void { | ||
| 13 | + animateTo({ duration: duration, curve: curve }, () => { | ||
| 14 | + fn(); | ||
| 15 | + }) | ||
| 16 | +} |
| 1 | +import { window } from '@kit.ArkUI'; | ||
| 2 | + | ||
| 3 | +class WindowSizeManager { | ||
| 4 | + private size: window.Size = { width: 0, height: 0 }; | ||
| 5 | + | ||
| 6 | + constructor() { | ||
| 7 | + window.getLastWindow(getContext()).then((value: window.Window) => { | ||
| 8 | + const rect: window.Rect = value.getWindowProperties().windowRect; | ||
| 9 | + this.size.width = px2vp(rect.width); | ||
| 10 | + this.size.height = px2vp(rect.height); | ||
| 11 | + console.log(`[windowWidth]${this.size.width} [windowHeight]${this.size.height}`); | ||
| 12 | + }) | ||
| 13 | + } | ||
| 14 | + | ||
| 15 | + get(): window.Size { | ||
| 16 | + return this.size; | ||
| 17 | + } | ||
| 18 | +} | ||
| 19 | + | ||
| 20 | +export const windowSizeManager: WindowSizeManager = new WindowSizeManager(); |
| @@ -25,6 +25,7 @@ export class ProcessUtils { | @@ -25,6 +25,7 @@ export class ProcessUtils { | ||
| 25 | return; | 25 | return; |
| 26 | } | 26 | } |
| 27 | let type = content.objectType; | 27 | let type = content.objectType; |
| 28 | + console.log(TAG,'objectType',`${JSON.stringify(content)}`); | ||
| 28 | switch (type) { | 29 | switch (type) { |
| 29 | case ContentConstants.TYPE_NONE: | 30 | case ContentConstants.TYPE_NONE: |
| 30 | Logger.debug(TAG, "processPage, do nothing"); | 31 | Logger.debug(TAG, "processPage, do nothing"); |
| @@ -59,7 +60,7 @@ export class ProcessUtils { | @@ -59,7 +60,7 @@ export class ProcessUtils { | ||
| 59 | break; | 60 | break; |
| 60 | //动态详情页(动态视频) | 61 | //动态详情页(动态视频) |
| 61 | case ContentConstants.TYPE_FIFTEEN: | 62 | case ContentConstants.TYPE_FIFTEEN: |
| 62 | - ProcessUtils.gotoDynamicDetailPage(content); | 63 | + ProcessUtils.gotoWeb(content); |
| 63 | break; | 64 | break; |
| 64 | default: | 65 | default: |
| 65 | break; | 66 | break; |
| @@ -44,7 +44,7 @@ class EditInfoViewModel { | @@ -44,7 +44,7 @@ class EditInfoViewModel { | ||
| 44 | new EditListInfo('简介',item&&item.userExtend.introduction?item.userExtend.introduction:'待完善'), | 44 | new EditListInfo('简介',item&&item.userExtend.introduction?item.userExtend.introduction:'待完善'), |
| 45 | new EditListInfo('地区',item&&item.userExtend.address?item.userExtend.address:'待完善'), | 45 | new EditListInfo('地区',item&&item.userExtend.address?item.userExtend.address:'待完善'), |
| 46 | new EditListInfo('生日',item&&item.userExtend.birthday?item.userExtend.birthday:'待完善'), | 46 | new EditListInfo('生日',item&&item.userExtend.birthday?item.userExtend.birthday:'待完善'), |
| 47 | - new EditListInfo('性别',item?(item.userExtend.sex === 1?'男':'女'):'待完善'),] | 47 | + new EditListInfo('性别',item?(item.userExtend.sex === 10?'待完善':(item.userExtend.sex === 1?'男':'女')):'待完善'),] |
| 48 | return this.editListData | 48 | return this.editListData |
| 49 | } | 49 | } |
| 50 | 50 | ||
| @@ -129,6 +129,7 @@ class EditInfoViewModel { | @@ -129,6 +129,7 @@ class EditInfoViewModel { | ||
| 129 | .then((navResDTO: ResponseDTO) => { | 129 | .then((navResDTO: ResponseDTO) => { |
| 130 | if (navResDTO.code == 0) { | 130 | if (navResDTO.code == 0) { |
| 131 | promptAction.showToast({ message: '修改成功' }) | 131 | promptAction.showToast({ message: '修改成功' }) |
| 132 | + success(navResDTO) | ||
| 132 | }else { | 133 | }else { |
| 133 | promptAction.showToast({ message: navResDTO.message }) | 134 | promptAction.showToast({ message: navResDTO.message }) |
| 134 | } | 135 | } |
| 1 | -import { PageDTO, CompDTO, PageInfoDTO } from 'wdBean'; | 1 | +import { PageDTO, CompDTO, PageInfoDTO, ContentDTO } from 'wdBean'; |
| 2 | import { CompStyle, ViewType } from 'wdConstant/Index'; | 2 | import { CompStyle, ViewType } from 'wdConstant/Index'; |
| 3 | import { CollectionUtils, DateTimeUtils, Logger } from 'wdKit'; | 3 | import { CollectionUtils, DateTimeUtils, Logger } from 'wdKit'; |
| 4 | import { closeRefresh } from '../utils/PullDownRefresh'; | 4 | import { closeRefresh } from '../utils/PullDownRefresh'; |
| @@ -58,7 +58,6 @@ export class PageHelper { | @@ -58,7 +58,6 @@ export class PageHelper { | ||
| 58 | if (pageDto && pageDto.compList && pageDto.compList.length > 0) { | 58 | if (pageDto && pageDto.compList && pageDto.compList.length > 0) { |
| 59 | pageModel.viewType = ViewType.LOADED; | 59 | pageModel.viewType = ViewType.LOADED; |
| 60 | let sizeBefore: number = pageModel.compList.size(); | 60 | let sizeBefore: number = pageModel.compList.size(); |
| 61 | - pageModel.compList.push(...pageDto.compList) | ||
| 62 | if (pageDto.compList.length === pageModel.pageSize) { | 61 | if (pageDto.compList.length === pageModel.pageSize) { |
| 63 | pageModel.currentPage++; | 62 | pageModel.currentPage++; |
| 64 | pageModel.hasMore = true; | 63 | pageModel.hasMore = true; |
| @@ -66,6 +65,11 @@ export class PageHelper { | @@ -66,6 +65,11 @@ export class PageHelper { | ||
| 66 | pageModel.hasMore = false; | 65 | pageModel.hasMore = false; |
| 67 | } | 66 | } |
| 68 | 67 | ||
| 68 | + //移除音频 和 活动 | ||
| 69 | + this.removeComp(pageModel,pageDto) | ||
| 70 | + | ||
| 71 | + // pageModel.compList.push(...pageDto.compList) | ||
| 72 | + | ||
| 69 | // TODO 暂时去掉互动数据,待优化。(主要是互动数据返回,如何渲染到ui上) | 73 | // TODO 暂时去掉互动数据,待优化。(主要是互动数据返回,如何渲染到ui上) |
| 70 | // TODO updateItems(sizeBefore, data),这里可能有时序问题,导致覆盖别的group数据,需要优化,考虑精准替换 | 74 | // TODO updateItems(sizeBefore, data),这里可能有时序问题,导致覆盖别的group数据,需要优化,考虑精准替换 |
| 71 | // 二次请求,批查互动数据 | 75 | // 二次请求,批查互动数据 |
| @@ -108,7 +112,11 @@ export class PageHelper { | @@ -108,7 +112,11 @@ export class PageHelper { | ||
| 108 | pageModel.hasMore = false; | 112 | pageModel.hasMore = false; |
| 109 | } | 113 | } |
| 110 | let sizeBefore: number = pageModel.compList.size(); | 114 | let sizeBefore: number = pageModel.compList.size(); |
| 111 | - pageModel.compList.push(...data.compList) | 115 | + |
| 116 | + //移除音频 和 活动 | ||
| 117 | + this.removeComp(pageModel,data) | ||
| 118 | + // | ||
| 119 | + // pageModel.compList.push(...data.compList) | ||
| 112 | PageViewModel.getInteractData(data.compList).then((data: CompDTO[]) => { | 120 | PageViewModel.getInteractData(data.compList).then((data: CompDTO[]) => { |
| 113 | // 刷新,替换所有数据 | 121 | // 刷新,替换所有数据 |
| 114 | pageModel.compList.updateItems(sizeBefore, data) | 122 | pageModel.compList.updateItems(sizeBefore, data) |
| @@ -119,6 +127,23 @@ export class PageHelper { | @@ -119,6 +127,23 @@ export class PageHelper { | ||
| 119 | promptAction.showToast({ message: err }); | 127 | promptAction.showToast({ message: err }); |
| 120 | }) | 128 | }) |
| 121 | } | 129 | } |
| 130 | + | ||
| 131 | + /** | ||
| 132 | + * 移除comp | ||
| 133 | + */ | ||
| 134 | + private removeComp(pageModel: PageModel, pageDto: PageDTO) { | ||
| 135 | + let datas = pageDto.compList | ||
| 136 | + for (let index = 0; index < datas.length; index++) { | ||
| 137 | + const element = datas[index]; | ||
| 138 | + let contentInfo: ContentDTO = CollectionUtils.getElement(element.operDataList, 0); | ||
| 139 | + //移除音频 和 活动 | ||
| 140 | + if (contentInfo && (contentInfo.objectType === '13' || contentInfo.objectType === '3')) { | ||
| 141 | + Logger.debug(TAG, 'getGroupData 移除音频 和 活动'); | ||
| 142 | + }else { | ||
| 143 | + pageModel.compList.push(element) | ||
| 144 | + } | ||
| 145 | + } | ||
| 146 | + } | ||
| 122 | } | 147 | } |
| 123 | 148 | ||
| 124 | 149 |
| @@ -39,6 +39,14 @@ | @@ -39,6 +39,14 @@ | ||
| 39 | { | 39 | { |
| 40 | "name": "image_request_fail", | 40 | "name": "image_request_fail", |
| 41 | "value": "图片加载失败,请检查网络" | 41 | "value": "图片加载失败,请检查网络" |
| 42 | + }, | ||
| 43 | + { | ||
| 44 | + "name": "EntryAbility_desc", | ||
| 45 | + "value": "$string:app_desc" | ||
| 46 | + }, | ||
| 47 | + { | ||
| 48 | + "name": "reason_read_write_media", | ||
| 49 | + "value": "user_grant" | ||
| 42 | } | 50 | } |
| 43 | ] | 51 | ] |
| 44 | } | 52 | } |
765 Bytes
789 Bytes
sight_harmony/features/wdComponent/src/main/resources/base/media/iv_live_heart_normal.png
0 → 100644
2.29 KB
| 1 | import { LiveDetailsBean, LiveRoomItemBean } from 'wdBean/Index' | 1 | import { LiveDetailsBean, LiveRoomItemBean } from 'wdBean/Index' |
| 2 | -import { EmptyComponent, ErrorComponent, ListHasNoMoreDataUI } from 'wdComponent/Index' | 2 | +import { EmptyComponent, ErrorComponent, ListHasNoMoreDataUI,WDViewDefaultType } from 'wdComponent/Index' |
| 3 | import CustomRefreshLoadLayout from 'wdComponent/src/main/ets/components/page/CustomRefreshLoadLayout' | 3 | import CustomRefreshLoadLayout from 'wdComponent/src/main/ets/components/page/CustomRefreshLoadLayout' |
| 4 | import LoadMoreLayout from 'wdComponent/src/main/ets/components/page/LoadMoreLayout' | 4 | import LoadMoreLayout from 'wdComponent/src/main/ets/components/page/LoadMoreLayout' |
| 5 | import RefreshLayout from 'wdComponent/src/main/ets/components/page/RefreshLayout' | 5 | import RefreshLayout from 'wdComponent/src/main/ets/components/page/RefreshLayout' |
| @@ -79,7 +79,7 @@ export struct TabChatComponent { | @@ -79,7 +79,7 @@ export struct TabChatComponent { | ||
| 79 | getLiveChatList() { | 79 | getLiveChatList() { |
| 80 | this.pageModel.currentPage = 1 | 80 | this.pageModel.currentPage = 1 |
| 81 | this.liveViewModel.getLiveChatList( | 81 | this.liveViewModel.getLiveChatList( |
| 82 | - 1, | 82 | + this.pageModel.currentPage, |
| 83 | this.liveDetailsBean?.liveInfo?.mlive?.mliveId, | 83 | this.liveDetailsBean?.liveInfo?.mlive?.mliveId, |
| 84 | this.liveDetailsBean?.newsId, | 84 | this.liveDetailsBean?.newsId, |
| 85 | 20,) | 85 | 20,) |
| 1 | import { LiveDetailsBean, LiveRoomItemBean } from 'wdBean/Index' | 1 | import { LiveDetailsBean, LiveRoomItemBean } from 'wdBean/Index' |
| 2 | -import { ListHasNoMoreDataUI } from 'wdComponent/Index' | 2 | +import { EmptyComponent, ErrorComponent, ListHasNoMoreDataUI } from 'wdComponent/Index' |
| 3 | import { StringUtils } from 'wdKit/Index' | 3 | import { StringUtils } from 'wdKit/Index' |
| 4 | import { LiveViewModel } from '../../viewModel/LiveViewModel' | 4 | import { LiveViewModel } from '../../viewModel/LiveViewModel' |
| 5 | import { TabLiveItemComponent } from './TabLiveItemComponent' | 5 | import { TabLiveItemComponent } from './TabLiveItemComponent' |
| 6 | +import CustomRefreshLoadLayout from 'wdComponent/src/main/ets/components/page/CustomRefreshLoadLayout' | ||
| 7 | +import { RefreshLayoutBean } from 'wdComponent/src/main/ets/components/page/RefreshLayoutBean' | ||
| 8 | +import PageModel from 'wdComponent/src/main/ets/viewmodel/PageModel' | ||
| 9 | +import { ViewType } from 'wdConstant/Index' | ||
| 10 | +import LoadMoreLayout from 'wdComponent/src/main/ets/components/page/LoadMoreLayout' | ||
| 11 | +import RefreshLayout from 'wdComponent/src/main/ets/components/page/RefreshLayout' | ||
| 6 | 12 | ||
| 7 | @Component | 13 | @Component |
| 8 | export struct TabLiveComponent { | 14 | export struct TabLiveComponent { |
| 9 | liveViewModel: LiveViewModel = new LiveViewModel() | 15 | liveViewModel: LiveViewModel = new LiveViewModel() |
| 10 | @State liveList: Array<LiveRoomItemBean> = [] | 16 | @State liveList: Array<LiveRoomItemBean> = [] |
| 11 | @Consume @Watch('updateDate') liveDetailsBean: LiveDetailsBean | 17 | @Consume @Watch('updateDate') liveDetailsBean: LiveDetailsBean |
| 18 | + @State private pageModel: PageModel = new PageModel() | ||
| 12 | 19 | ||
| 13 | updateDate() { | 20 | updateDate() { |
| 14 | this.getLiveList() | 21 | this.getLiveList() |
| @@ -20,51 +27,98 @@ export struct TabLiveComponent { | @@ -20,51 +27,98 @@ export struct TabLiveComponent { | ||
| 20 | 27 | ||
| 21 | build() { | 28 | build() { |
| 22 | Stack() { | 29 | Stack() { |
| 23 | - if (this.liveList.length == 0) { | ||
| 24 | - ListHasNoMoreDataUI({ style: 2 }) | 30 | + if (this.pageModel.viewType == ViewType.LOADING) { |
| 31 | + this.LoadingLayout() | ||
| 32 | + } else if (this.pageModel.viewType == ViewType.ERROR) { | ||
| 33 | + ErrorComponent() | ||
| 34 | + } else if (this.pageModel.viewType == ViewType.EMPTY) { | ||
| 35 | + EmptyComponent() | ||
| 25 | } else { | 36 | } else { |
| 26 | - List() { | ||
| 27 | - ForEach(this.liveList, (item: LiveRoomItemBean) => { | ||
| 28 | - ListItem() { | ||
| 29 | - TabLiveItemComponent({ item: item }) | ||
| 30 | - } | ||
| 31 | - }) | ||
| 32 | - ListItem() { | ||
| 33 | - ListHasNoMoreDataUI() | ||
| 34 | - } | ||
| 35 | - } | 37 | + this.ListLayout() |
| 36 | } | 38 | } |
| 37 | } | 39 | } |
| 38 | .alignContent(Alignment.Top) | 40 | .alignContent(Alignment.Top) |
| 39 | .backgroundColor('#F5F5F5') | 41 | .backgroundColor('#F5F5F5') |
| 40 | .height('100%') | 42 | .height('100%') |
| 41 | .width('100%') | 43 | .width('100%') |
| 44 | + } | ||
| 42 | 45 | ||
| 46 | + @Builder | ||
| 47 | + ListLayout() { | ||
| 48 | + List() { | ||
| 49 | + ListItem() { | ||
| 50 | + // 下拉刷新 | ||
| 51 | + RefreshLayout({ | ||
| 52 | + refreshBean: new RefreshLayoutBean(this.pageModel.isVisiblePullDown, this.pageModel.pullDownRefreshImage, | ||
| 53 | + this.pageModel.pullDownRefreshText, this.pageModel.pullDownRefreshHeight) | ||
| 54 | + }) | ||
| 55 | + } | ||
| 56 | + | ||
| 57 | + ForEach(this.liveList, (item: LiveRoomItemBean) => { | ||
| 58 | + ListItem() { | ||
| 59 | + TabLiveItemComponent({ item: item }) | ||
| 60 | + } | ||
| 61 | + }) | ||
| 62 | + // 加载更多 | ||
| 63 | + ListItem() { | ||
| 64 | + if (this.pageModel.hasMore) { | ||
| 65 | + LoadMoreLayout({ | ||
| 66 | + refreshBean: new RefreshLayoutBean(this.pageModel.isVisiblePullUpLoad, this.pageModel.pullUpLoadImage, | ||
| 67 | + this.pageModel.pullUpLoadText, this.pageModel.pullUpLoadHeight) | ||
| 68 | + }) | ||
| 69 | + } else { | ||
| 70 | + ListHasNoMoreDataUI() | ||
| 71 | + } | ||
| 72 | + } | ||
| 73 | + } | ||
| 74 | + } | ||
| 75 | + | ||
| 76 | + @Builder | ||
| 77 | + LoadingLayout() { | ||
| 78 | + CustomRefreshLoadLayout({ | ||
| 79 | + refreshBean: new RefreshLayoutBean(true, | ||
| 80 | + $r('app.media.ic_pull_up_load'), $r('app.string.pull_up_load_text'), this.pageModel.pullDownRefreshHeight) | ||
| 81 | + }) | ||
| 43 | } | 82 | } |
| 44 | 83 | ||
| 45 | getLiveList() { | 84 | getLiveList() { |
| 85 | + this.pageModel.currentPage = 1 | ||
| 46 | this.liveViewModel.getLiveList( | 86 | this.liveViewModel.getLiveList( |
| 47 | - 1, | 87 | + this.pageModel.currentPage, |
| 48 | this.liveDetailsBean?.liveInfo?.mlive?.mliveId, | 88 | this.liveDetailsBean?.liveInfo?.mlive?.mliveId, |
| 49 | this.liveDetailsBean?.newsId, | 89 | this.liveDetailsBean?.newsId, |
| 50 | 20) | 90 | 20) |
| 51 | .then( | 91 | .then( |
| 52 | (data) => { | 92 | (data) => { |
| 53 | - /** | ||
| 54 | - * 在直播聊天添加一条新内容逻辑: | ||
| 55 | - 判断 oldNewsId:迁移id非空 且 直播状态不是预约:"wait" | ||
| 56 | - 消息内容: | ||
| 57 | - 1.头像固定:APP默认头像 | ||
| 58 | - 2.名称固定:人民日报主持人 | ||
| 59 | - 3.内容:详情接口的简介,newIntroduction | ||
| 60 | - */ | ||
| 61 | - if (StringUtils.isNotEmpty(this.liveDetailsBean.oldNewsId) && this.liveDetailsBean && this.liveDetailsBean.liveInfo.liveState != 'wait') { | ||
| 62 | - let liveRoomItemBeanTemp: LiveRoomItemBean = {} as LiveRoomItemBean | ||
| 63 | - liveRoomItemBeanTemp.text = this.liveDetailsBean.newIntroduction | ||
| 64 | - liveRoomItemBeanTemp.senderUserName = '人民日报主持人' | ||
| 65 | - data.barrageResponses.push(liveRoomItemBeanTemp) | 93 | + if (data.barrageResponses && data.barrageResponses.length > 0) { |
| 94 | + /** | ||
| 95 | + * 在直播聊天添加一条新内容逻辑: | ||
| 96 | + 判断 oldNewsId:迁移id非空 且 直播状态不是预约:"wait" | ||
| 97 | + 消息内容: | ||
| 98 | + 1.头像固定:APP默认头像 | ||
| 99 | + 2.名称固定:人民日报主持人 | ||
| 100 | + 3.内容:详情接口的简介,newIntroduction | ||
| 101 | + */ | ||
| 102 | + if (StringUtils.isNotEmpty(this.liveDetailsBean.oldNewsId) | ||
| 103 | + && this.liveDetailsBean | ||
| 104 | + && this.liveDetailsBean.liveInfo.liveState != 'wait' | ||
| 105 | + && this.pageModel.currentPage == 1) { | ||
| 106 | + let liveRoomItemBeanTemp: LiveRoomItemBean = {} as LiveRoomItemBean | ||
| 107 | + liveRoomItemBeanTemp.text = this.liveDetailsBean.newIntroduction | ||
| 108 | + liveRoomItemBeanTemp.senderUserName = '人民日报主持人' | ||
| 109 | + data.barrageResponses.push(liveRoomItemBeanTemp) | ||
| 110 | + } | ||
| 111 | + this.pageModel.viewType = ViewType.LOADED; | ||
| 112 | + this.liveList.push(...data.barrageResponses) | ||
| 113 | + if (data.barrageResponses.length === this.pageModel.pageSize) { | ||
| 114 | + this.pageModel.currentPage++; | ||
| 115 | + this.pageModel.hasMore = true; | ||
| 116 | + } else { | ||
| 117 | + this.pageModel.hasMore = false; | ||
| 118 | + } | ||
| 119 | + } else { | ||
| 120 | + this.pageModel.viewType = ViewType.EMPTY; | ||
| 66 | } | 121 | } |
| 67 | - this.liveList = data.barrageResponses | ||
| 68 | }, | 122 | }, |
| 69 | () => { | 123 | () => { |
| 70 | 124 |
| 1 | -import { LiveRoomItemBean } from 'wdBean/Index' | 1 | +import { LiveRoomItemBean, PhotoListBean } from 'wdBean/Index' |
| 2 | import { DateTimeUtils, StringUtils } from 'wdKit/Index' | 2 | import { DateTimeUtils, StringUtils } from 'wdKit/Index' |
| 3 | 3 | ||
| 4 | @Component | 4 | @Component |
| 5 | export struct TabLiveItemComponent { | 5 | export struct TabLiveItemComponent { |
| 6 | item: LiveRoomItemBean = {} as LiveRoomItemBean | 6 | item: LiveRoomItemBean = {} as LiveRoomItemBean |
| 7 | + photoList: PhotoListBean[] = [] | ||
| 7 | 8 | ||
| 8 | aboutToAppear(): void { | 9 | aboutToAppear(): void { |
| 9 | 10 | ||
| @@ -86,7 +87,16 @@ export struct TabLiveItemComponent { | @@ -86,7 +87,16 @@ export struct TabLiveItemComponent { | ||
| 86 | .aspectRatio(310 / 174) | 87 | .aspectRatio(310 / 174) |
| 87 | .objectFit(ImageFit.Auto) | 88 | .objectFit(ImageFit.Auto) |
| 88 | .borderRadius(4) | 89 | .borderRadius(4) |
| 89 | - } | 90 | + }.onClick(() => { |
| 91 | + for (let item of this.item.pictureUrls) { | ||
| 92 | + this.photoList.push({ | ||
| 93 | + width: 0, | ||
| 94 | + height: 0, | ||
| 95 | + picPath: item, | ||
| 96 | + picDesc: '' | ||
| 97 | + }) | ||
| 98 | + } | ||
| 99 | + }) | ||
| 90 | }) | 100 | }) |
| 91 | }.margin({ | 101 | }.margin({ |
| 92 | left: 32, | 102 | left: 32, |
| @@ -200,18 +200,21 @@ export struct PlayUIComponent { | @@ -200,18 +200,21 @@ export struct PlayUIComponent { | ||
| 200 | } else { | 200 | } else { |
| 201 | Blank() | 201 | Blank() |
| 202 | } | 202 | } |
| 203 | - Image($r('app.media.icon_live_player_full_screen')) | ||
| 204 | - .width(24) | ||
| 205 | - .height(24) | ||
| 206 | - .onClick(() => { | ||
| 207 | - this.displayDirection = this.displayDirection == DisplayDirection.VERTICAL ? DisplayDirection.VIDEO_HORIZONTAL : DisplayDirection.VERTICAL | ||
| 208 | - WindowModel.shared.setPreferredOrientation(this.displayDirection == DisplayDirection.VERTICAL ? | ||
| 209 | - window.Orientation.PORTRAIT : | ||
| 210 | - window.Orientation.LANDSCAPE) | ||
| 211 | - devicePLSensorManager.devicePLSensorOn(this.displayDirection == DisplayDirection.VERTICAL ? | ||
| 212 | - window.Orientation.PORTRAIT : | ||
| 213 | - window.Orientation.LANDSCAPE); | ||
| 214 | - }) | 203 | + if (this.liveDetailsBean?.liveInfo?.liveState == 'running' |
| 204 | + || this.liveDetailsBean?.liveInfo?.liveState == 'end') { | ||
| 205 | + Image($r('app.media.icon_live_player_full_screen')) | ||
| 206 | + .width(24) | ||
| 207 | + .height(24) | ||
| 208 | + .onClick(() => { | ||
| 209 | + this.displayDirection = this.displayDirection == DisplayDirection.VERTICAL ? DisplayDirection.VIDEO_HORIZONTAL : DisplayDirection.VERTICAL | ||
| 210 | + WindowModel.shared.setPreferredOrientation(this.displayDirection == DisplayDirection.VERTICAL ? | ||
| 211 | + window.Orientation.PORTRAIT : | ||
| 212 | + window.Orientation.LANDSCAPE) | ||
| 213 | + devicePLSensorManager.devicePLSensorOn(this.displayDirection == DisplayDirection.VERTICAL ? | ||
| 214 | + window.Orientation.PORTRAIT : | ||
| 215 | + window.Orientation.LANDSCAPE); | ||
| 216 | + }) | ||
| 217 | + } | ||
| 215 | } | 218 | } |
| 216 | .alignItems(VerticalAlign.Center) | 219 | .alignItems(VerticalAlign.Center) |
| 217 | .linearGradient({ angle: 0, colors: [['#99000000', 0], ['#00000000', 1]] }) | 220 | .linearGradient({ angle: 0, colors: [['#99000000', 0], ['#00000000', 1]] }) |
| 1 | -import { window } from '@kit.ArkUI' | ||
| 2 | -import { NumberFormatterUtils, WindowModel } from 'wdKit/Index' | ||
| 3 | - | ||
| 4 | -import { devicePLSensorManager } from 'wdDetailPlayApi/Index' | ||
| 5 | -import { DateFormatUtil, WDPlayerController } from 'wdPlayer/Index' | ||
| 6 | -import { LiveDetailsBean, LiveRoomDataBean } from 'wdBean/Index' | ||
| 7 | - | ||
| 8 | -@Entry | ||
| 9 | -@Component | ||
| 10 | -export struct PlayVUIComponent { | ||
| 11 | - playerController: WDPlayerController = new WDPlayerController(); | ||
| 12 | - //菜单键是否可见 | ||
| 13 | - @State isMenuVisible: boolean = true | ||
| 14 | - @State isFullScreen: boolean = false | ||
| 15 | - @Consume liveDetailsBean: LiveDetailsBean | ||
| 16 | - @Consume liveRoomDataBean: LiveRoomDataBean | ||
| 17 | - @State currentTime: string = '' | ||
| 18 | - @State totalTime: string = '' | ||
| 19 | - @State progressVal: number = 0; | ||
| 20 | - //是否处于播放状态中 | ||
| 21 | - @State isPlayStatus: boolean = true | ||
| 22 | - | ||
| 23 | - aboutToAppear(): void { | ||
| 24 | - //播放进度监听 | ||
| 25 | - this.playerController.onTimeUpdate = (position: number, duration: number) => { | ||
| 26 | - this.currentTime = DateFormatUtil.secondToTime(Math.floor(position / 1000)); | ||
| 27 | - this.totalTime = DateFormatUtil.secondToTime(Math.floor(duration / 1000)); | ||
| 28 | - this.progressVal = Math.floor(position * 100 / duration); | ||
| 29 | - } | ||
| 30 | - } | ||
| 31 | - | ||
| 32 | - build() { | ||
| 33 | - Column() { | ||
| 34 | - this.getTopUIComponent() | ||
| 35 | - this.getMiddleUIComponent() | ||
| 36 | - this.getBottomUIComponent() | ||
| 37 | - } | ||
| 38 | - .width('100%') | ||
| 39 | - .height('100%') | ||
| 40 | - .alignItems(HorizontalAlign.Start) | ||
| 41 | - } | ||
| 42 | - | ||
| 43 | - @Builder | ||
| 44 | - getTopUIComponent() { | ||
| 45 | - Column() { | ||
| 46 | - Row() { | ||
| 47 | - Image($r('app.media.icon_arrow_left_white')) | ||
| 48 | - .width(24) | ||
| 49 | - .aspectRatio(1) | ||
| 50 | - .visibility(Visibility.None) | ||
| 51 | - .margin({ | ||
| 52 | - right: 10 | ||
| 53 | - }) | ||
| 54 | - if (this.liveDetailsBean.liveInfo?.liveState != 'wait') { | ||
| 55 | - Text(this.liveDetailsBean.newsTitle) | ||
| 56 | - .maxLines(1) | ||
| 57 | - .textOverflow({ overflow: TextOverflow.Ellipsis }) | ||
| 58 | - .fontSize('16fp') | ||
| 59 | - .fontWeight(500) | ||
| 60 | - .fontColor(Color.White) | ||
| 61 | - .textAlign(TextAlign.Start) | ||
| 62 | - .layoutWeight(1) | ||
| 63 | - } else { | ||
| 64 | - Blank() | ||
| 65 | - } | ||
| 66 | - Image($r('app.media.icon_share')) | ||
| 67 | - .width(24) | ||
| 68 | - .aspectRatio(1) | ||
| 69 | - .visibility(Visibility.None) | ||
| 70 | - } | ||
| 71 | - .width('100%') | ||
| 72 | - .alignItems(VerticalAlign.Center) | ||
| 73 | - .margin({ | ||
| 74 | - bottom: 10 | ||
| 75 | - }) | ||
| 76 | - | ||
| 77 | - this.getLiveStatusView() | ||
| 78 | - }.width('100%') | ||
| 79 | - .padding({ | ||
| 80 | - top: 20, | ||
| 81 | - bottom: 6, | ||
| 82 | - left: 10, | ||
| 83 | - right: 10 | ||
| 84 | - }) | ||
| 85 | - .alignItems(HorizontalAlign.Start) | ||
| 86 | - .visibility(this.isMenuVisible ? Visibility.Visible : Visibility.None) | ||
| 87 | - } | ||
| 88 | - | ||
| 89 | - @Builder | ||
| 90 | - getLiveStatusView() { | ||
| 91 | - // 直播新闻-直播状态 wait待开播running直播中end已结束cancel已取消paused暂停 | ||
| 92 | - // 预约 | ||
| 93 | - if (this.liveDetailsBean.liveInfo?.liveState == 'wait') { | ||
| 94 | - Row() { | ||
| 95 | - Image($r('app.media.icon_live_status_wait')) | ||
| 96 | - .width(22) | ||
| 97 | - .height(18) | ||
| 98 | - Text('预约') | ||
| 99 | - .fontSize('11fp') | ||
| 100 | - .fontWeight(400) | ||
| 101 | - .fontColor(Color.White) | ||
| 102 | - } | ||
| 103 | - .backgroundColor('#4D000000') | ||
| 104 | - .padding({ | ||
| 105 | - top: 1, | ||
| 106 | - right: 4, | ||
| 107 | - bottom: 1 | ||
| 108 | - }) | ||
| 109 | - } | ||
| 110 | - // 直播中 | ||
| 111 | - else if (this.liveDetailsBean.liveInfo?.liveState == 'running') { | ||
| 112 | - Row() { | ||
| 113 | - Image($r('app.media.icon_live_status_running')) | ||
| 114 | - .width(22) | ||
| 115 | - .height(18) | ||
| 116 | - Text('直播中') | ||
| 117 | - .fontSize('11fp') | ||
| 118 | - .fontWeight(400) | ||
| 119 | - .fontColor(Color.White) | ||
| 120 | - Image($r('app.media.icon_live_player_status_end')) | ||
| 121 | - .width(12) | ||
| 122 | - .height(12) | ||
| 123 | - Text(`${NumberFormatterUtils.formatNumberWithWan(this.liveRoomDataBean.pv)}人参与`) | ||
| 124 | - .fontSize('11fp') | ||
| 125 | - .fontWeight(400) | ||
| 126 | - .fontColor(Color.White) | ||
| 127 | - } | ||
| 128 | - .backgroundColor('#4D000000') | ||
| 129 | - .padding({ | ||
| 130 | - top: 1, | ||
| 131 | - right: 4, | ||
| 132 | - bottom: 1 | ||
| 133 | - }) | ||
| 134 | - } | ||
| 135 | - //回看 | ||
| 136 | - else if (this.liveDetailsBean.liveInfo?.liveState == 'end') { | ||
| 137 | - Row() { | ||
| 138 | - Text('回看') | ||
| 139 | - .fontSize('11fp') | ||
| 140 | - .fontWeight(400) | ||
| 141 | - .fontColor(Color.White) | ||
| 142 | - Image($r('app.media.icon_live_player_status_end')) | ||
| 143 | - .width(12) | ||
| 144 | - .height(12) | ||
| 145 | - Text(`${NumberFormatterUtils.formatNumberWithWan(this.liveRoomDataBean.pv)}人参与`) | ||
| 146 | - .fontSize('11fp') | ||
| 147 | - .fontWeight(400) | ||
| 148 | - .fontColor(Color.White) | ||
| 149 | - } | ||
| 150 | - .backgroundColor('#4D000000') | ||
| 151 | - .padding({ | ||
| 152 | - left: 4, | ||
| 153 | - top: 1, | ||
| 154 | - right: 4, | ||
| 155 | - bottom: 1 | ||
| 156 | - }) | ||
| 157 | - } | ||
| 158 | - } | ||
| 159 | - | ||
| 160 | - @Builder | ||
| 161 | - getMiddleUIComponent() { | ||
| 162 | - Stack() | ||
| 163 | - .layoutWeight(1) | ||
| 164 | - .width('100%') | ||
| 165 | - .onClick(() => { | ||
| 166 | - this.isMenuVisible = !this.isMenuVisible | ||
| 167 | - }) | ||
| 168 | - } | ||
| 169 | - | ||
| 170 | - @Builder | ||
| 171 | - getBottomUIComponent() { | ||
| 172 | - Row() { | ||
| 173 | - if (this.liveDetailsBean?.liveInfo?.liveState == 'end') { | ||
| 174 | - this.playOrPauseBtn() | ||
| 175 | - Text(this.currentTime) | ||
| 176 | - .fontColor(Color.White) | ||
| 177 | - .fontWeight(600) | ||
| 178 | - .fontSize('12fp') | ||
| 179 | - .margin({ | ||
| 180 | - left: 16 | ||
| 181 | - }) | ||
| 182 | - | ||
| 183 | - this.playProgressView() | ||
| 184 | - | ||
| 185 | - Text(this.totalTime) | ||
| 186 | - .fontColor(Color.White) | ||
| 187 | - .fontWeight(600) | ||
| 188 | - .fontSize('12fp') | ||
| 189 | - .margin({ | ||
| 190 | - right: 16 | ||
| 191 | - }) | ||
| 192 | - } else { | ||
| 193 | - Blank() | ||
| 194 | - } | ||
| 195 | - Image($r('app.media.icon_live_player_full_screen')) | ||
| 196 | - .width(24) | ||
| 197 | - .height(24) | ||
| 198 | - .onClick(() => { | ||
| 199 | - this.isFullScreen = !this.isFullScreen | ||
| 200 | - WindowModel.shared.setPreferredOrientation(this.isFullScreen ? window.Orientation.LANDSCAPE : window.Orientation.PORTRAIT); | ||
| 201 | - devicePLSensorManager.devicePLSensorOn(this.isFullScreen ? window.Orientation.LANDSCAPE : window.Orientation.PORTRAIT); | ||
| 202 | - }) | ||
| 203 | - } | ||
| 204 | - .alignItems(VerticalAlign.Center) | ||
| 205 | - .linearGradient({ angle: 0, colors: [['#99000000', 0], ['#00000000', 1]] }) | ||
| 206 | - .width('100%') | ||
| 207 | - .padding({ | ||
| 208 | - left: 10, | ||
| 209 | - right: 10, | ||
| 210 | - top: 15, | ||
| 211 | - bottom: 15 | ||
| 212 | - }) | ||
| 213 | - .visibility(this.isMenuVisible ? Visibility.Visible : Visibility.None) | ||
| 214 | - } | ||
| 215 | - | ||
| 216 | - @Builder | ||
| 217 | - playOrPauseBtn() { | ||
| 218 | - //暂停、播放 | ||
| 219 | - Image(this.isPlayStatus ? $r('app.media.icon_live_player_pause') : $r('app.media.player_play_ic')) | ||
| 220 | - .width(24) | ||
| 221 | - .height(24) | ||
| 222 | - .onClick(() => { | ||
| 223 | - if (this.isPlayStatus) { | ||
| 224 | - this.isPlayStatus = false | ||
| 225 | - this.playerController.pause() | ||
| 226 | - } else { | ||
| 227 | - this.isPlayStatus = true | ||
| 228 | - this.playerController.play() | ||
| 229 | - } | ||
| 230 | - }) | ||
| 231 | - } | ||
| 232 | - | ||
| 233 | - @Builder | ||
| 234 | - playProgressView() { | ||
| 235 | - Slider({ | ||
| 236 | - value: this.progressVal, | ||
| 237 | - step: 1, | ||
| 238 | - style: SliderStyle.OutSet | ||
| 239 | - }) | ||
| 240 | - .blockSize({ | ||
| 241 | - width: 18, | ||
| 242 | - height: 12 | ||
| 243 | - })// .blockStyle({ | ||
| 244 | - // type: SliderBlockType.IMAGE, | ||
| 245 | - // image: $r('app.media.ic_player_block') | ||
| 246 | - // }) | ||
| 247 | - .blockColor(Color.White) | ||
| 248 | - .trackColor('#4DFFFFFF') | ||
| 249 | - .selectedColor('#FFED2800') | ||
| 250 | - .height(14) | ||
| 251 | - .trackThickness(1) | ||
| 252 | - .layoutWeight(1) | ||
| 253 | - .margin({ | ||
| 254 | - left: 8, | ||
| 255 | - right: 8 | ||
| 256 | - }) | ||
| 257 | - .onChange((value: number, mode: SliderChangeMode) => { | ||
| 258 | - this.playerController?.setSeekTime(value, mode); | ||
| 259 | - }) | ||
| 260 | - } | ||
| 261 | -} |
| @@ -15,14 +15,19 @@ export struct PlayerUIComponent { | @@ -15,14 +15,19 @@ export struct PlayerUIComponent { | ||
| 15 | // // 全屏按钮 | 15 | // // 全屏按钮 |
| 16 | // }.layoutWeight(1) | 16 | // }.layoutWeight(1) |
| 17 | 17 | ||
| 18 | - Row() { | ||
| 19 | - PlayerCommentComponent() | ||
| 20 | - PlayerVideoControlComponent({ playerController: this.playerController }) | ||
| 21 | - .visibility(this.isShowControl ? Visibility.Visible : Visibility.Hidden) | ||
| 22 | - .animation({ duration: 500 }) | ||
| 23 | - } | ||
| 24 | - .position({ y: '100%' }) | ||
| 25 | - .markAnchor({ y: '100%' }) | 18 | + |
| 19 | + PlayerCommentComponent() | ||
| 20 | + .visibility(this.isShowControl ? Visibility.Hidden : Visibility.Visible) | ||
| 21 | + .animation({ duration: 500 }) | ||
| 22 | + .position({ y: '100%' }) | ||
| 23 | + .markAnchor({ y: '100%' }) | ||
| 24 | + | ||
| 25 | + PlayerVideoControlComponent({ playerController: this.playerController }) | ||
| 26 | + .visibility(this.isShowControl ? Visibility.Visible : Visibility.Hidden) | ||
| 27 | + .animation({ duration: 500 }) | ||
| 28 | + .position({ y: '100%' }) | ||
| 29 | + .markAnchor({ y: '100%' }) | ||
| 30 | + | ||
| 26 | } | 31 | } |
| 27 | .height('100%') | 32 | .height('100%') |
| 28 | .width('100%') | 33 | .width('100%') |
| @@ -13,6 +13,7 @@ | @@ -13,6 +13,7 @@ | ||
| 13 | "wdBean": "file:../../features/wdBean", | 13 | "wdBean": "file:../../features/wdBean", |
| 14 | "wdRouter": "file:../../commons/wdRouter", | 14 | "wdRouter": "file:../../commons/wdRouter", |
| 15 | "wdNetwork": "file:../../commons/wdNetwork", | 15 | "wdNetwork": "file:../../commons/wdNetwork", |
| 16 | + "wdConstant": "file:../../commons/wdConstant", | ||
| 16 | "wdDetailPlayApi": "file:../../features/wdDetailPlayApi", | 17 | "wdDetailPlayApi": "file:../../features/wdDetailPlayApi", |
| 17 | // "wdComponent": "file:../../features/wdComponent" | 18 | // "wdComponent": "file:../../features/wdComponent" |
| 18 | } | 19 | } |
| @@ -4,7 +4,6 @@ import { ResponseDTO } from 'wdNetwork/Index'; | @@ -4,7 +4,6 @@ import { ResponseDTO } from 'wdNetwork/Index'; | ||
| 4 | import { DetailPlayShortVideoPage } from './DetailPlayShortVideoPage' | 4 | import { DetailPlayShortVideoPage } from './DetailPlayShortVideoPage' |
| 5 | import router from '@ohos.router'; | 5 | import router from '@ohos.router'; |
| 6 | import { contentListParams } from 'wdDetailPlayApi/src/main/ets/request/ContentDetailRequest'; | 6 | import { contentListParams } from 'wdDetailPlayApi/src/main/ets/request/ContentDetailRequest'; |
| 7 | -import window from '@ohos.window'; | ||
| 8 | import { WindowModel } from 'wdKit'; | 7 | import { WindowModel } from 'wdKit'; |
| 9 | 8 | ||
| 10 | const storage = LocalStorage.getShared(); | 9 | const storage = LocalStorage.getShared(); |
| @@ -31,16 +30,16 @@ export struct DetailVideoListPage { | @@ -31,16 +30,16 @@ export struct DetailVideoListPage { | ||
| 31 | /** | 30 | /** |
| 32 | * 开启沉浸式并设置状态栏颜色 | 31 | * 开启沉浸式并设置状态栏颜色 |
| 33 | */ | 32 | */ |
| 34 | - const windowStage = WindowModel.shared.getWindowStage() as window.WindowStage | ||
| 35 | - const windowClass: window.Window = windowStage.getMainWindowSync(); | ||
| 36 | - windowClass.setWindowLayoutFullScreen(true) | ||
| 37 | - this.isFullScreen = true | ||
| 38 | - windowClass.setWindowSystemBarProperties({ | ||
| 39 | - statusBarContentColor: '#ffffff', | ||
| 40 | - }) | 33 | + // const windowStage = WindowModel.shared.getWindowStage() as window.WindowStage |
| 34 | + // const windowClass: window.Window = windowStage.getMainWindowSync(); | ||
| 35 | + // windowClass.setWindowLayoutFullScreen(true) | ||
| 36 | + // this.isFullScreen = true | ||
| 37 | + // windowClass.setWindowSystemBarProperties({ | ||
| 38 | + // statusBarContentColor: '#ffffff', | ||
| 39 | + // }) | ||
| 41 | 40 | ||
| 42 | 41 | ||
| 43 | - let data: ContentDetailDTO[] = [] | 42 | + // let data: ContentDetailDTO[] = [] |
| 44 | let action: Action = router.getParams() as Action | 43 | let action: Action = router.getParams() as Action |
| 45 | if (action) { | 44 | if (action) { |
| 46 | this.contentId = action.params?.contentID || '' | 45 | this.contentId = action.params?.contentID || '' |
| @@ -63,17 +62,6 @@ export struct DetailVideoListPage { | @@ -63,17 +62,6 @@ export struct DetailVideoListPage { | ||
| 63 | 62 | ||
| 64 | await this.queryVideoList() | 63 | await this.queryVideoList() |
| 65 | 64 | ||
| 66 | - // await ContentDetailRequest.postRecommendVideoList({ | ||
| 67 | - // pageSize: 5, | ||
| 68 | - // refreshCnt: 1 | ||
| 69 | - // }).then(res => { | ||
| 70 | - // if (res.data) { | ||
| 71 | - // data = data.concat(res.data) | ||
| 72 | - // } | ||
| 73 | - // console.log('res1===', JSON.stringify(res)) | ||
| 74 | - // console.log('res==' + this.data) | ||
| 75 | - // }) | ||
| 76 | - | ||
| 77 | 65 | ||
| 78 | if (this.data.length > 0) { | 66 | if (this.data.length > 0) { |
| 79 | const params: contentListParams = { | 67 | const params: contentListParams = { |
| @@ -103,37 +91,18 @@ export struct DetailVideoListPage { | @@ -103,37 +91,18 @@ export struct DetailVideoListPage { | ||
| 103 | } | 91 | } |
| 104 | 92 | ||
| 105 | aboutToDisappear(): void { | 93 | aboutToDisappear(): void { |
| 106 | - | ||
| 107 | - const windowStage = WindowModel.shared.getWindowStage() as window.WindowStage | ||
| 108 | - const windowClass: window.Window = windowStage.getMainWindowSync(); // 获取应用主窗口 | ||
| 109 | - windowClass.setWindowLayoutFullScreen(false) | ||
| 110 | - this.isFullScreen = false | ||
| 111 | - windowClass.setWindowSystemBarProperties({ statusBarContentColor: '#000000' }) | ||
| 112 | - | 94 | + WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#000000', }) |
| 95 | + WindowModel.shared.setWindowLayoutFullScreen(false) | ||
| 113 | } | 96 | } |
| 114 | 97 | ||
| 115 | onPageShow(): void { | 98 | onPageShow(): void { |
| 116 | - if (!this.isFullScreen) { | ||
| 117 | - const windowStage = WindowModel.shared.getWindowStage() as window.WindowStage | ||
| 118 | - const windowClass: window.Window = windowStage.getMainWindowSync(); | ||
| 119 | - windowClass.setWindowLayoutFullScreen(true) | ||
| 120 | - this.isFullScreen = true | ||
| 121 | - windowClass.setWindowSystemBarProperties({ | ||
| 122 | - statusBarContentColor: '#ffffff', | ||
| 123 | - }) | ||
| 124 | - | ||
| 125 | - } | 99 | + WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#ffffff', }) |
| 100 | + WindowModel.shared.setWindowLayoutFullScreen(true) | ||
| 126 | } | 101 | } |
| 127 | 102 | ||
| 128 | onPageHide(): void { | 103 | onPageHide(): void { |
| 129 | - if (this.isFullScreen) { | ||
| 130 | - const windowStage = WindowModel.shared.getWindowStage() as window.WindowStage | ||
| 131 | - const windowClass: window.Window = windowStage.getMainWindowSync(); // 获取应用主窗口 | ||
| 132 | - windowClass.setWindowLayoutFullScreen(false) | ||
| 133 | - this.isFullScreen = false | ||
| 134 | - windowClass.setWindowSystemBarProperties({ statusBarContentColor: '#000000' }) | ||
| 135 | - } | ||
| 136 | - | 104 | + WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#000000', }) |
| 105 | + WindowModel.shared.setWindowLayoutFullScreen(false) | ||
| 137 | } | 106 | } |
| 138 | 107 | ||
| 139 | /** | 108 | /** |
| @@ -166,7 +135,7 @@ export struct DetailVideoListPage { | @@ -166,7 +135,7 @@ export struct DetailVideoListPage { | ||
| 166 | }) | 135 | }) |
| 167 | }.width('100%') | 136 | }.width('100%') |
| 168 | .height('100%') | 137 | .height('100%') |
| 169 | - | 138 | + |
| 170 | }, (item: ContentDetailDTO) => item.newsId + '') | 139 | }, (item: ContentDetailDTO) => item.newsId + '') |
| 171 | } | 140 | } |
| 172 | .clip(false) | 141 | .clip(false) |
| 1 | -import { ContentDetailDTO, InteractDataDTO, RmhInfoDTO, UserInfoDTO } from 'wdBean/Index'; | 1 | +import { ContentDetailDTO, InteractDataDTO, Params, RmhInfoDTO, UserInfoDTO } from 'wdBean/Index'; |
| 2 | import { | 2 | import { |
| 3 | batchLikeAndCollectParams, | 3 | batchLikeAndCollectParams, |
| 4 | batchLikeAndCollectResult, | 4 | batchLikeAndCollectResult, |
| @@ -8,10 +8,11 @@ import { | @@ -8,10 +8,11 @@ import { | ||
| 8 | postExecuteLikeParams, | 8 | postExecuteLikeParams, |
| 9 | postInteractAccentionOperateParams | 9 | postInteractAccentionOperateParams |
| 10 | } from 'wdDetailPlayApi/src/main/ets/request/ContentDetailRequest'; | 10 | } from 'wdDetailPlayApi/src/main/ets/request/ContentDetailRequest'; |
| 11 | -import { ToastUtils } from 'wdKit'; | 11 | +import { SPHelper, ToastUtils } from 'wdKit'; |
| 12 | import { HttpUrlUtils } from 'wdNetwork/Index'; | 12 | import { HttpUrlUtils } from 'wdNetwork/Index'; |
| 13 | import { WDPlayerController } from 'wdPlayer/Index'; | 13 | import { WDPlayerController } from 'wdPlayer/Index'; |
| 14 | import { WDRouterPage, WDRouterRule } from 'wdRouter/Index'; | 14 | import { WDRouterPage, WDRouterRule } from 'wdRouter/Index'; |
| 15 | +import { SpConstants } from 'wdConstant/Index' | ||
| 15 | 16 | ||
| 16 | export interface OperationItem { | 17 | export interface OperationItem { |
| 17 | icon: Resource; | 18 | icon: Resource; |
| @@ -64,9 +65,10 @@ export struct OperationListView { | @@ -64,9 +65,10 @@ export struct OperationListView { | ||
| 64 | /** | 65 | /** |
| 65 | * 点赞、取消点赞 | 66 | * 点赞、取消点赞 |
| 66 | */ | 67 | */ |
| 67 | - toggleLikeStatus() { | 68 | + async toggleLikeStatus() { |
| 68 | // 未登录,跳转登录 | 69 | // 未登录,跳转登录 |
| 69 | - if (!HttpUrlUtils.getUserId()) { | 70 | + const user_id = await SPHelper.default.get(SpConstants.USER_ID, '') |
| 71 | + if (!user_id) { | ||
| 70 | this.playerController?.pause() | 72 | this.playerController?.pause() |
| 71 | WDRouterRule.jumpWithPage(WDRouterPage.loginPage) | 73 | WDRouterRule.jumpWithPage(WDRouterPage.loginPage) |
| 72 | return | 74 | return |
| @@ -77,10 +79,16 @@ export struct OperationListView { | @@ -77,10 +79,16 @@ export struct OperationListView { | ||
| 77 | contentType: this.contentDetailData?.newsType + '', | 79 | contentType: this.contentDetailData?.newsType + '', |
| 78 | } | 80 | } |
| 79 | ContentDetailRequest.postExecuteLike(params).then(res => { | 81 | ContentDetailRequest.postExecuteLike(params).then(res => { |
| 80 | - console.log('toggleLikeStatus==',) | 82 | + |
| 81 | if (this.newsStatusOfUser) { | 83 | if (this.newsStatusOfUser) { |
| 82 | this.newsStatusOfUser.likeStatus = this.newsStatusOfUser?.likeStatus === '1' ? '0' : '1' | 84 | this.newsStatusOfUser.likeStatus = this.newsStatusOfUser?.likeStatus === '1' ? '0' : '1' |
| 83 | - this.queryContentInteractCount() | 85 | + if (this.newsStatusOfUser.likeStatus === '1') { |
| 86 | + this.interactData.likeNum = Number(this.interactData.likeNum) + 1 | ||
| 87 | + } else { | ||
| 88 | + this.interactData.likeNum = Number(this.interactData.likeNum) - 1 | ||
| 89 | + } | ||
| 90 | + console.log('点赞、取消点赞==', this.newsStatusOfUser?.likeStatus, this.interactData?.likeNum) | ||
| 91 | + // this.queryContentInteractCount() | ||
| 84 | } | 92 | } |
| 85 | 93 | ||
| 86 | }) | 94 | }) |
| @@ -89,9 +97,10 @@ export struct OperationListView { | @@ -89,9 +97,10 @@ export struct OperationListView { | ||
| 89 | /** | 97 | /** |
| 90 | * 收藏、取消收藏 | 98 | * 收藏、取消收藏 |
| 91 | */ | 99 | */ |
| 92 | - toggleCollectStatus() { | 100 | + async toggleCollectStatus() { |
| 93 | // 未登录,跳转登录 | 101 | // 未登录,跳转登录 |
| 94 | - if (!HttpUrlUtils.getUserId()) { | 102 | + const user_id = await SPHelper.default.get(SpConstants.USER_ID, '') |
| 103 | + if (!user_id) { | ||
| 95 | WDRouterRule.jumpWithPage(WDRouterPage.loginPage) | 104 | WDRouterRule.jumpWithPage(WDRouterPage.loginPage) |
| 96 | return | 105 | return |
| 97 | } | 106 | } |
| @@ -104,10 +113,15 @@ export struct OperationListView { | @@ -104,10 +113,15 @@ export struct OperationListView { | ||
| 104 | 113 | ||
| 105 | } | 114 | } |
| 106 | ContentDetailRequest.postExecuteCollectRecord(params).then(res => { | 115 | ContentDetailRequest.postExecuteCollectRecord(params).then(res => { |
| 107 | - console.log('toggleLikeStatus==',) | ||
| 108 | if (this.newsStatusOfUser) { | 116 | if (this.newsStatusOfUser) { |
| 109 | this.newsStatusOfUser.collectStatus = this.newsStatusOfUser?.collectStatus === 1 ? 0 : 1 | 117 | this.newsStatusOfUser.collectStatus = this.newsStatusOfUser?.collectStatus === 1 ? 0 : 1 |
| 110 | - this.queryContentInteractCount() | 118 | + // this.queryContentInteractCount() |
| 119 | + if (this.newsStatusOfUser.collectStatus === 1) { | ||
| 120 | + this.interactData.collectNum = Number(this.interactData.collectNum) + 1 | ||
| 121 | + } else { | ||
| 122 | + this.interactData.collectNum = Number(this.interactData.collectNum) - 1 | ||
| 123 | + } | ||
| 124 | + console.log('收藏、取消收藏==', this.newsStatusOfUser?.collectStatus, this.interactData?.collectNum) | ||
| 111 | } | 125 | } |
| 112 | }) | 126 | }) |
| 113 | 127 | ||
| @@ -140,9 +154,10 @@ export struct OperationListView { | @@ -140,9 +154,10 @@ export struct OperationListView { | ||
| 140 | /** | 154 | /** |
| 141 | * 关注号主 | 155 | * 关注号主 |
| 142 | */ | 156 | */ |
| 143 | - handleAccention() { | 157 | + async handleAccention() { |
| 144 | // 未登录,跳转登录 | 158 | // 未登录,跳转登录 |
| 145 | - if (!HttpUrlUtils.getUserId()) { | 159 | + const user_id = await SPHelper.default.get(SpConstants.USER_ID, '') |
| 160 | + if (!user_id) { | ||
| 146 | WDRouterRule.jumpWithPage(WDRouterPage.loginPage) | 161 | WDRouterRule.jumpWithPage(WDRouterPage.loginPage) |
| 147 | return | 162 | return |
| 148 | } | 163 | } |
| @@ -181,7 +196,15 @@ export struct OperationListView { | @@ -181,7 +196,15 @@ export struct OperationListView { | ||
| 181 | }) | 196 | }) |
| 182 | .id("row1") | 197 | .id("row1") |
| 183 | .onClick(() => { | 198 | .onClick(() => { |
| 184 | - // 号主页 | 199 | + if (this.contentDetailData.rmhInfo?.cnMainControl === 1) { |
| 200 | + // 号主页 | ||
| 201 | + const params: Params = { | ||
| 202 | + creatorId: this.contentDetailData.rmhInfo.rmhId, | ||
| 203 | + pageID: '' | ||
| 204 | + } | ||
| 205 | + WDRouterRule.jumpWithPage(WDRouterPage.peopleShipHomePage, params) | ||
| 206 | + } | ||
| 207 | + | ||
| 185 | }) | 208 | }) |
| 186 | if (this.followStatus == '0') { | 209 | if (this.followStatus == '0') { |
| 187 | Image($r('app.media.ic_add')) | 210 | Image($r('app.media.ic_add')) |
| @@ -4,9 +4,9 @@ import { WDRouterPage } from 'wdRouter'; | @@ -4,9 +4,9 @@ import { WDRouterPage } from 'wdRouter'; | ||
| 4 | @Entry | 4 | @Entry |
| 5 | @Component | 5 | @Component |
| 6 | struct GuidePages { | 6 | struct GuidePages { |
| 7 | - guideImage = [$r('app.media.guide_static1'), $r('app.media.guide_static2'), $r('app.media.guide_static3'), $r('app.media.guide_static4')] | ||
| 8 | - guideTitle = [$r('app.media.guide_title1'), $r('app.media.guide_title2'), $r('app.media.guide_title3'), $r('app.media.guide_title4')] | ||
| 9 | - guideIndex = [$r('app.media.guide_index1'), $r('app.media.guide_index2'), $r('app.media.guide_index3'), $r('app.media.guide_button')] | 7 | + guideImage = [$r('app.media.guide_static1'), $r('app.media.guide_static2'), $r('app.media.guide_static3'), $r('app.media.guide_static4'),$r('app.media.guide_static5')] |
| 8 | + guideTitle = [$r('app.media.guide_title1'), $r('app.media.guide_title2'), $r('app.media.guide_title3'), $r('app.media.guide_title4'),$r('app.media.guide_title5')] | ||
| 9 | + guideIndex = [$r('app.media.guide_index1'), $r('app.media.guide_index2'), $r('app.media.guide_index3'),$r('app.media.guide_index4'), $r('app.media.guide_button')] | ||
| 10 | 10 | ||
| 11 | build() { | 11 | build() { |
| 12 | Column() { | 12 | Column() { |
| @@ -57,7 +57,7 @@ struct GuidePages { | @@ -57,7 +57,7 @@ struct GuidePages { | ||
| 57 | .margin({ bottom: 85 }) | 57 | .margin({ bottom: 85 }) |
| 58 | .height(40) | 58 | .height(40) |
| 59 | .onClick(() => { | 59 | .onClick(() => { |
| 60 | - if (index == 3) { | 60 | + if (index == 4) { |
| 61 | // 跳转到首页 | 61 | // 跳转到首页 |
| 62 | //WDRouterRule.jumpWithReplacePage(WDRouterPage.mainPage) | 62 | //WDRouterRule.jumpWithReplacePage(WDRouterPage.mainPage) |
| 63 | //跳转到兴趣偏好选择页 | 63 | //跳转到兴趣偏好选择页 |
| 1 | import HashMap from '@ohos.util.HashMap'; | 1 | import HashMap from '@ohos.util.HashMap'; |
| 2 | -import { HttpUrlUtils, ResponseDTO } from 'wdNetwork'; | 2 | +import { HttpBizUtil, HttpUrlUtils, ResponseDTO } from 'wdNetwork'; |
| 3 | import { Logger, SPHelper, StringUtils } from 'wdKit'; | 3 | import { Logger, SPHelper, StringUtils } from 'wdKit'; |
| 4 | import { HttpRequest } from 'wdNetwork/src/main/ets/http/HttpRequest'; | 4 | import { HttpRequest } from 'wdNetwork/src/main/ets/http/HttpRequest'; |
| 5 | import { LoginBean } from './LoginBean'; | 5 | import { LoginBean } from './LoginBean'; |
| @@ -224,7 +224,7 @@ export class LoginModel { | @@ -224,7 +224,7 @@ export class LoginModel { | ||
| 224 | let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders(); | 224 | let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders(); |
| 225 | 225 | ||
| 226 | return new Promise<string>((success, fail) => { | 226 | return new Promise<string>((success, fail) => { |
| 227 | - HttpRequest.post<ResponseDTO<string>>(HttpUrlUtils.getLogoutUrl(), bean, headers).then((data: ResponseDTO<string>) => { | 227 | + HttpBizUtil.post<string>(HttpUrlUtils.getLogoutUrl(), bean, headers).then((data: ResponseDTO<string>)=>{ |
| 228 | if (!data) { | 228 | if (!data) { |
| 229 | fail("数据为空") | 229 | fail("数据为空") |
| 230 | return | 230 | return |
| @@ -234,10 +234,24 @@ export class LoginModel { | @@ -234,10 +234,24 @@ export class LoginModel { | ||
| 234 | return | 234 | return |
| 235 | } | 235 | } |
| 236 | success('') | 236 | success('') |
| 237 | - }, (error: Error) => { | 237 | + }).catch((error:Error)=>{ |
| 238 | fail(error.message) | 238 | fail(error.message) |
| 239 | - Logger.debug("LoginViewModel:error ", error.toString()) | 239 | + Logger.debug("LoginViewModel:error ", error.toString()) |
| 240 | }) | 240 | }) |
| 241 | + // HttpRequest.post<ResponseDTO<string>>(HttpUrlUtils.getLogoutUrl(), bean, headers).then((data: ResponseDTO<string>) => { | ||
| 242 | + // if (!data) { | ||
| 243 | + // fail("数据为空") | ||
| 244 | + // return | ||
| 245 | + // } | ||
| 246 | + // if (data.code != 0) { | ||
| 247 | + // fail(data.message) | ||
| 248 | + // return | ||
| 249 | + // } | ||
| 250 | + // success('') | ||
| 251 | + // }, (error: Error) => { | ||
| 252 | + // fail(error.message) | ||
| 253 | + // Logger.debug("LoginViewModel:error ", error.toString()) | ||
| 254 | + // }) | ||
| 241 | }) | 255 | }) |
| 242 | } | 256 | } |
| 243 | 257 |
| @@ -185,7 +185,7 @@ struct LoginPage { | @@ -185,7 +185,7 @@ struct LoginPage { | ||
| 185 | .height(48) | 185 | .height(48) |
| 186 | .backgroundColor("#F5F5F5") | 186 | .backgroundColor("#F5F5F5") |
| 187 | .borderRadius(4) | 187 | .borderRadius(4) |
| 188 | - .type(InputType.PhoneNumber) | 188 | + .type(InputType.Normal) |
| 189 | .onChange((content) => { | 189 | .onChange((content) => { |
| 190 | this.accountContent = content | 190 | this.accountContent = content |
| 191 | this.isSubmit = (this.accountContent.length >= 11 && this.passwordContent.length >= 6) | 191 | this.isSubmit = (this.accountContent.length >= 11 && this.passwordContent.length >= 6) |
No preview for this file type
No preview for this file type
| @@ -85,7 +85,7 @@ export struct WDPlayerRenderLiveView { | @@ -85,7 +85,7 @@ export struct WDPlayerRenderLiveView { | ||
| 85 | console.log('insId===', this.insId) | 85 | console.log('insId===', this.insId) |
| 86 | this.xComponentController.setXComponentSurfaceSize({ | 86 | this.xComponentController.setXComponentSurfaceSize({ |
| 87 | surfaceWidth: 1920, | 87 | surfaceWidth: 1920, |
| 88 | - surfaceHeight: 1080 | 88 | + surfaceHeight: 720 |
| 89 | }); | 89 | }); |
| 90 | this.playerController?.setXComponentController(this.xComponentController) | 90 | this.playerController?.setXComponentController(this.xComponentController) |
| 91 | if (this.onLoad) { | 91 | if (this.onLoad) { |
| @@ -3,6 +3,7 @@ import { WDRouterRule } from 'wdRouter'; | @@ -3,6 +3,7 @@ import { WDRouterRule } from 'wdRouter'; | ||
| 3 | import { WDRouterPage } from 'wdRouter'; | 3 | import { WDRouterPage } from 'wdRouter'; |
| 4 | import { SPHelper } from 'wdKit/Index'; | 4 | import { SPHelper } from 'wdKit/Index'; |
| 5 | import { SpConstants } from 'wdConstant/Index'; | 5 | import { SpConstants } from 'wdConstant/Index'; |
| 6 | +import { ButtonOptions, promptAction } from '@kit.ArkUI'; | ||
| 6 | 7 | ||
| 7 | @Entry | 8 | @Entry |
| 8 | @Component | 9 | @Component |
| @@ -79,6 +80,11 @@ struct LaunchInterestsHobbiesPage { | @@ -79,6 +80,11 @@ struct LaunchInterestsHobbiesPage { | ||
| 79 | .margin({top:'2lpx',left:'19lpx'}) | 80 | .margin({top:'2lpx',left:'19lpx'}) |
| 80 | .width('100%') | 81 | .width('100%') |
| 81 | .height('31lpx') | 82 | .height('31lpx') |
| 83 | + Image(item.choose ? $r('app.media.interestsSelected') : $r('app.media.interestsSelectNot')) | ||
| 84 | + .height('32lpx') | ||
| 85 | + .width('32lpx') | ||
| 86 | + .margin({top:'80lpx',left:'110lpx'}) | ||
| 87 | + | ||
| 82 | }.justifyContent(FlexAlign.Start) | 88 | }.justifyContent(FlexAlign.Start) |
| 83 | } | 89 | } |
| 84 | 90 | ||
| @@ -87,7 +93,7 @@ struct LaunchInterestsHobbiesPage { | @@ -87,7 +93,7 @@ struct LaunchInterestsHobbiesPage { | ||
| 87 | .width('100%') | 93 | .width('100%') |
| 88 | .height('100%') | 94 | .height('100%') |
| 89 | .backgroundColor(Color.White) | 95 | .backgroundColor(Color.White) |
| 90 | - .opacity(item.choose?0:0.7) | 96 | + .opacity(item.choose?0:0.6) |
| 91 | .borderRadius(5) | 97 | .borderRadius(5) |
| 92 | } | 98 | } |
| 93 | } | 99 | } |
| @@ -122,7 +128,21 @@ struct LaunchInterestsHobbiesPage { | @@ -122,7 +128,21 @@ struct LaunchInterestsHobbiesPage { | ||
| 122 | .borderRadius('10lpx') | 128 | .borderRadius('10lpx') |
| 123 | .width('662lpx') | 129 | .width('662lpx') |
| 124 | .height('84lpx') | 130 | .height('84lpx') |
| 131 | + Image('') | ||
| 132 | + .width('662lpx') | ||
| 133 | + .height('84lpx') | ||
| 134 | + .backgroundColor(Color.White) | ||
| 135 | + .opacity(this.selectCount == 0 ? 0.6 : 0) | ||
| 136 | + .borderRadius('10lpx') | ||
| 125 | .onClick(()=>{ | 137 | .onClick(()=>{ |
| 138 | + if (this.selectCount == 0) { | ||
| 139 | + promptAction.showToast({ | ||
| 140 | + message : '请先选择您感兴趣的内容哦', | ||
| 141 | + duration: 2000, | ||
| 142 | + bottom: 50 | ||
| 143 | + }) | ||
| 144 | + return | ||
| 145 | + } | ||
| 126 | this.saveTagIds() | 146 | this.saveTagIds() |
| 127 | //跳转首页 | 147 | //跳转首页 |
| 128 | WDRouterRule.jumpWithReplacePage(WDRouterPage.mainPage) | 148 | WDRouterRule.jumpWithReplacePage(WDRouterPage.mainPage) |
| @@ -32,7 +32,7 @@ struct DefaultWebPage { | @@ -32,7 +32,7 @@ struct DefaultWebPage { | ||
| 32 | WdWebComponent({ | 32 | WdWebComponent({ |
| 33 | webUrl: this.url, | 33 | webUrl: this.url, |
| 34 | backVisibility: false, | 34 | backVisibility: false, |
| 35 | - reload: this.reload, | 35 | + // reload: this.reload, |
| 36 | isPageEnd:$isPageEnd | 36 | isPageEnd:$isPageEnd |
| 37 | }) | 37 | }) |
| 38 | } | 38 | } |
1.73 KB
-
Please register or login to post a comment