Compare commits

...

3 Commits

Author SHA1 Message Date
XiuYun CHEN
61a28b9150 bug修改 2025-06-17 13:18:34 +08:00
XiuYun CHEN
7e3a597e92 Merge branch 'master' of https://gitea.igandanyiyuan.com/gdxz/harmony 2025-06-17 13:12:58 +08:00
XiuYun CHEN
1c77820187 bug修改 2025-06-17 13:12:51 +08:00
5 changed files with 34 additions and 15 deletions

View File

@ -12,6 +12,7 @@ export class BasicConstant {
// static readonly urlImage = "https://dev-doc.igandan.com/app/"
// static readonly urlExpert = "https://dev-app.igandan.com/app/expert/"
// static readonly wxUrl = "https://dev-wx.igandan.com/";
// static readonly polvId = "11";//保利威视学员id
//正式环境
static readonly urlExpertAPI = "https://app.igandan.com/app/expertAPI/";
@ -20,6 +21,7 @@ export class BasicConstant {
static readonly urlImage = "http://doc.igandan.com/app/"
static readonly urlExpert = "http://app.igandan.com/app/expert/"
static readonly wxUrl = "https://wx.igandan.com/";// 微信服务器地址
static readonly polvId = "21";//保利威视学员id
static readonly getStartpage=BasicConstant.urlExpertApp + "startpage";
@ -43,6 +45,7 @@ export class BasicConstant {
static readonly gethonorDetail = BasicConstant.urlExpertAPI+'gethonorDetail';
static readonly updatePwd = BasicConstant.urlExpertAPI+'updatePwd'
static readonly read = BasicConstant.urlExpert+'read'//视频阅读数
static readonly POLVID ='PolvId'//保利观众id
static readonly province=['全国','北京市','天津市','河北省','山西省'
,'内蒙古自治区','辽宁省','吉林省','黑龙江省','上海市','江苏省','浙江省'

View File

@ -9,7 +9,7 @@ export struct VideoSelected{
Column() {
HdNav({ title: this.params.title, showRightIcon: false, showLeftIcon: true })
ListCompVideoSelect({type_uuid:this.params.uuid}).backgroundColor(Color.White).height('100%')
ListCompVideoSelect({type_uuid:this.params.uuid}).backgroundColor(Color.White).layoutWeight(1)
}.width('100%')
.height('100%').backgroundColor($r('app.color.top_bg'))
}

View File

@ -10,6 +10,7 @@ import {
} from '@polyvharmony/media-player-sdk';
import {PLVMediaDownloadSetting} from '@polyvharmony/media-player-sdk-addon-cache-down';
const mockAuthentication: PLVVodMainAccountAuthentication = {
userId: "cfb7a69a75",
secretKey: "4KtJhl9EqU"
@ -20,8 +21,8 @@ const mockAuthentication: PLVVodMainAccountAuthentication = {
// }
const mockViewerParam: PLVViewerParam = {
viewerId: "123",
viewerName: "123"
viewerId:'',
viewerName: ""
}
export class PLVMockMediaResourceData {
@ -54,9 +55,9 @@ export class PLVMockMediaResourceData {
return this.mediaResources
}
public setupMediaResourcesFromLocal(vid:string):Promise<PLVMediaResource[]> {
public setupMediaResourcesFromLocal(vid:string,param:PLVViewerParam):Promise<PLVMediaResource[]> {
return this.mediaResources = Promise.resolve([
vod(vid)
vod(vid,param)
// vod("e97dbe3e648aefc2eb6f68b96db9db6c_e"),
// vod("e97dbe3e6401ea8f76617bafe32f57e9_e"),
// vod("e97dbe3e64ed6e0aac558e43787df1b4_e"),
@ -87,21 +88,22 @@ export class PLVMockMediaResourceData {
}
private setupMediaResourcesFromServer() {
this.mediaResources = PLVGeneralApiManager.getVodVideoList(mockAuthentication, 1, 20)
.then(result => {
return result.data!.map(video => vod(video!.vid!))
})
// this.mediaResources = PLVGeneralApiManager.getVodVideoList(mockAuthentication, 1, 20)
// .then(result => {
// return result.data!.map(video => vod(video!.vid!))
// })
}
}
function vod(videoId: string): PLVVodMediaResource {
function vod(videoId: string,param:PLVViewerParam): PLVVodMediaResource {
// 默认下载路径
const defaultDownloadRoot = PLVMediaDownloadSetting.defaultSetting(PLVMediaPlayerAppContext.getInstance().appContext!).downloadRootDirectory
return {
videoId: videoId,
authentication: mockAuthentication,
viewerParam: mockViewerParam,
viewerParam:param,
// viewerParam: mockViewerParam,
scene: "vod",
localVideoSearchPaths: [defaultDownloadRoot]
}

View File

@ -1,5 +1,5 @@
import { runCatching, seconds } from '@polyvharmony/media-player-sdk';
import { BasicConstant } from '@itcast/basic'
import { runCatching, seconds ,PLVViewerParam} from '@polyvharmony/media-player-sdk';
import { BasicConstant,authStore,preferenceStore } from '@itcast/basic'
import { promptAction, router } from '@kit.ArkUI';
import { PLVMockMediaResourceData } from '../polyv/PLVMockMediaResourceData'
import {
@ -9,10 +9,15 @@ import HashMap from '@ohos.util.HashMap';
import { hdHttp, HdResponse ,logger} from '@itcast/basic/Index'
import { BusinessError } from '@kit.BasicServicesKit';
import { VideoDetailModel } from '../model/VideoDetailModel'
const mockViewerParam: PLVViewerParam = {
viewerId:preferenceStore.getItemString(BasicConstant.POLVID),
viewerName: authStore.getUser().realName
}
class VideoTools {
hashMap: HashMap<string, string> = new HashMap();
getVideoDetail(video_uuid:string)
{
this.hashMap.clear();
this.hashMap.set('video_uuid', video_uuid)
hdHttp.httpReq<string>(BasicConstant.videoDetail,this.hashMap).then(async (res: HdResponse<string>) => {
@ -61,7 +66,7 @@ class VideoTools {
async goPLVMediaPlayerSingleVideoPage(vid:string,video_uuid:string)
{
const mediaResourcesResult = await runCatching(PLVMockMediaResourceData.getInstance().setupMediaResourcesFromLocal(vid))
const mediaResourcesResult = await runCatching(PLVMockMediaResourceData.getInstance().setupMediaResourcesFromLocal(vid,mockViewerParam))
if (mediaResourcesResult.success === false) {
promptAction.showToast({
message: `'视频数据初始化失败': ${mediaResourcesResult.error}`,

View File

@ -2,7 +2,7 @@ import { VideoPage,VideoGandan } from 'home'
import { MyHomePage } from 'mypage'
import { TabBarCompModel } from '../../models/TabBarCompModel'
import { TabBarItems } from '../../contants/TabBarItems'
import { BasicConstant } from '@itcast/basic'
import { BasicConstant,AESEncryptionDecryption,authStore,preferenceStore } from '@itcast/basic'
import mediaquery from '@ohos.mediaquery';
@Component
@ -17,11 +17,20 @@ export struct TabBarComp {
@Provide
toTop:boolean=false;
aboutToAppear() {
this.getPolyid()
this.listenerScreen.on('change', (mediaQueryResult) => {
this.isLandscape = mediaQueryResult.matches
})
}
async getPolyid()
{
let mobile =authStore.getUser().mobile
let mobile_encryption = mobile +BasicConstant.polvId;
let signs =await AESEncryptionDecryption.aesEncrypt(mobile_encryption,"deoep09_klodLdAo")
preferenceStore.setItemString(BasicConstant.POLVID,signs)
}
@Builder
TabBarBuilder(item: TabBarCompModel, index: number) {
Column({ space: BasicConstant.SPACE_SM }) {