wangliang_wd

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

* 'main' of http://192.168.1.42/developOne/harmonyPool:
  ref |> 修改华为账号一键登录为“华为账号快速登录”
  ref |> 临时回退华为账号一键登录
  fix(17649): 早晚报>专题类型稿件详情页_滚动预览不该展示滚动条
  fix(专题): 拼接修正
  fix(专题): 请求页面数据,增加参数
  fix(18943): 专题骨架图取错,不应展示稿件详情骨架图
... ... @@ -29,6 +29,8 @@ export struct WdWebComponent {
.mixedMode(MixedMode.All)
.onlineImageAccess(true)
.enableNativeEmbedMode(true)
.horizontalScrollBarAccess(false)
.verticalScrollBarAccess(false)
.onPageBegin((event) => {
this.onPageBegin(event?.url);
})
... ...
import { Action, H5ReceiveDetailBean, ContentDetailDTO, InteractDataDTO } from 'wdBean';
import { WdWebComponent } from 'wdWebComponent';
import router from '@ohos.router';
import { CommonConstants } from 'wdConstant'
import { BridgeWebViewControl } from 'wdJsBridge/Index';
import { detailedSkeleton } from './skeleton/detailSkeleton'
import { NativeCallH5Type } from 'wdWebComponent/src/main/ets/pages/NativeCallH5Type';
import { OperRowListView } from './view/OperRowListView';
import DetailViewModel from '../viewmodel/DetailViewModel';
... ... @@ -15,6 +13,7 @@ import { common } from '@kit.AbilityKit';
import { PageRepository } from '../repository/PageRepository';
import { CommentDialogView } from './CommentDialogView';
import { faceDetector } from '@kit.CoreVisionKit';
import { channelSkeleton } from './skeleton/channelSkeleton';
const TAG: string = 'SpacialTopicPageComponent'
... ... @@ -117,7 +116,7 @@ export struct SpacialTopicPageComponent {
let pageId = this.action.params.extra?.pageId
console.log('pageIdpageId',pageId)
if(pageId){
let pageInfoMsg = await PageRepository.fetchMorningEveningPageInfo(pageId)
let pageInfoMsg = await PageRepository.fetchMorningEveningPageInfo(pageId,contentId)
let detailBeans = await DetailViewModel.getDetailPageData(relId, contentId, relType)
if (detailBeans?.length > 0) {
this.contentDetailData = JSON.parse(JSON.stringify(detailBeans[0]));
... ... @@ -192,7 +191,7 @@ export struct SpacialTopicPageComponent {
}).padding({ bottom: 200 })
} else {
if (!this.isPageEnd) {
detailedSkeleton().padding({ top:`${this.topSafeHeight}px`,bottom: this.bottomSafeHeight })
channelSkeleton().padding({ top:`${this.topSafeHeight}px`,bottom: this.bottomSafeHeight })
}
}
//底部交互区
... ...
... ... @@ -192,9 +192,12 @@ export class PageRepository {
/**
* 早晚报pageInfo请求
* */
static getMorningEveningPageInfoUrl(pageId: string) {
static getMorningEveningPageInfoUrl(pageId: string,topicId:string) {
let url = HttpUrlUtils.getHost() + HttpUrlUtils.PAGE_INFO_PATH;
url = url + "?pageId=" + pageId;
if(!StringUtils.isEmpty(topicId)){
url = url+ "&topicId=" + topicId;
}
Logger.info(TAG, "getMorningEveningPageInfoUrl url = " + url)
return url;
}
... ... @@ -392,8 +395,8 @@ export class PageRepository {
/**
* 获取早晚报pageInfo
* */
static fetchMorningEveningPageInfo(pageId: string) {
let url = PageRepository.getMorningEveningPageInfoUrl(pageId)
static fetchMorningEveningPageInfo(pageId: string,topicId:string) {
let url = PageRepository.getMorningEveningPageInfoUrl(pageId,topicId)
return WDHttp.get<ResponseDTO<PageInfoBean>>(url)
};
... ... @@ -418,7 +421,7 @@ export class PageRepository {
* 获取播报pageInfo
* */
static fetchBroadcastPageInfo(pageId: string) {
let url = PageRepository.getMorningEveningPageInfoUrl(pageId)
let url = PageRepository.getMorningEveningPageInfoUrl(pageId,'')
return WDHttp.get<ResponseDTO<PageInfoBean>>(url)
};
... ...
... ... @@ -9,7 +9,7 @@ export class BroadcastViewModel {
static async getBroadcastViewPageInfo(pageId: string): Promise<PageInfoBean> {
return new Promise<PageInfoBean>((success, error) => {
Logger.info(TAG, `getBroadcastViewPageInfo pageInfo start`);
PageRepository.fetchMorningEveningPageInfo(pageId).then((resDTO: ResponseDTO<PageInfoBean>) => {
PageRepository.fetchMorningEveningPageInfo(pageId,'').then((resDTO: ResponseDTO<PageInfoBean>) => {
if (!resDTO || !resDTO.data) {
Logger.error(TAG, 'getBroadcastViewPageInfo then navResDTO is empty');
error('resDTO is empty');
... ...
... ... @@ -36,7 +36,7 @@ export class MorningEveningViewModel {
static async getMorningEveningPageInfo(pageId: string): Promise<PageInfoBean> {
return new Promise<PageInfoBean>((success, error) => {
Logger.info(TAG, `getMorningEveningPageInfo pageInfo start`);
PageRepository.fetchMorningEveningPageInfo(pageId).then((resDTO: ResponseDTO<PageInfoBean>) => {
PageRepository.fetchMorningEveningPageInfo(pageId,'').then((resDTO: ResponseDTO<PageInfoBean>) => {
if (!resDTO || !resDTO.data) {
Logger.error(TAG, 'getMorningEveningPageInfo then navResDTO is empty');
error('resDTO is empty');
... ...
... ... @@ -160,7 +160,7 @@ struct OneKeyLoginPage {
Row() {
Image($r("app.media.huawei_one_key_login_icon"))
.width(24).height(24)
Text("华为账号一键登录")
Text("华为账号快速登录")
.fontColor(Color.White)
.margin({left:5})
}
... ... @@ -170,30 +170,34 @@ struct OneKeyLoginPage {
.borderRadius(4)
.type(ButtonType.Normal)
.backgroundColor("#ED2800")
.onClick(() => {
Stack(){
//目前不支持文字和图标同时展示,后面优化
LoginWithHuaweiIDButton({
params: {
// LoginWithHuaweiIDButton支持的样式。
style: loginComponentManager.Style.BUTTON_CUSTOM,
// LoginWithHuaweiIDButton的边框圆角半径。
// borderRadius: 4,
// LoginWithHuaweiIDButton支持的登录类型。
loginType: loginComponentManager.LoginType.QUICK_LOGIN,
// LoginWithHuaweiIDButton支持按钮的样式跟随系统深浅色模式切换。
// supportDarkMode: true,
customButtonParams: {
fontColor: loginComponentManager.FontColor.WHITE,
// backgroundColor:!this.agreeProtocol ? "#60ED2800" : "#ED2800"
backgroundColor:"#ED2800"
}
},
controller: this.controller
}).opacity(0)
}
.width('100%')
.height('100%')
this.requestLogin()
})
// Stack(){
// //目前不支持文字和图标同时展示,后面优化
// LoginWithHuaweiIDButton({
// params: {
// // LoginWithHuaweiIDButton支持的样式。
// style: loginComponentManager.Style.BUTTON_CUSTOM,
// // LoginWithHuaweiIDButton的边框圆角半径。
// // borderRadius: 4,
// // LoginWithHuaweiIDButton支持的登录类型。
// loginType: loginComponentManager.LoginType.QUICK_LOGIN,
// // LoginWithHuaweiIDButton支持按钮的样式跟随系统深浅色模式切换。
// // supportDarkMode: true,
// customButtonParams: {
// fontColor: loginComponentManager.FontColor.WHITE,
// // backgroundColor:!this.agreeProtocol ? "#60ED2800" : "#ED2800"
// backgroundColor:"#ED2800"
// }
// },
// controller: this.controller
// }).opacity(0)
// }
// .width('100%')
// .height('100%')
}
}
.height(48)
... ...
... ... @@ -94,7 +94,7 @@ export default class HuaweiAuth {
// 创建授权请求,并设置参数
let loginRequest = new authentication.HuaweiIDProvider().createAuthorizationWithHuaweiIDRequest();
// 获取头像昵称需要传如下scope
loginRequest.scopes = ['profile']; //, 'phone'
loginRequest.scopes = ['profile', 'phone']; //, 'phone'
// 若开发者需要进行服务端开发,则需传如下permission获取authorizationCode
loginRequest.permissions = ['serviceauthcode'];
// 用户是否需要登录授权,该值为true且用户未登录或未授权时,会拉起用户登录或授权页面
... ...