会议回放,观看直播与会议
This commit is contained in:
@@ -20,7 +20,7 @@ export { preferenceStore } from './src/main/ets/utils/PreferenceStore'
|
||||
|
||||
export { LoginInfo,Data } from './src/main/ets/models/LoginInfoModel'
|
||||
|
||||
export { DataWebModel } from './src/main/ets/models/DataWebModel'
|
||||
export { DataWebModel,DataWebModels } from './src/main/ets/models/DataWebModel'
|
||||
|
||||
export { PromptActionClass } from './src/main/ets/components/PromptActionClass'
|
||||
|
||||
@@ -28,4 +28,8 @@ export { RequestDefaultModel,ExpertData } from './src/main/ets/models/RequestDef
|
||||
|
||||
export { HdList, HdListController } from './src/main/ets/components/HdList'
|
||||
|
||||
export { AESEncryptionDecryption } from './src/main/ets/utils/AESEncryptionDecryption'
|
||||
|
||||
export { HdGrid } from './src/main/ets/components/HdGrid'
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,113 @@
|
||||
import { BasicConstant } from '../constants/BasicConstant'
|
||||
import { HdListController } from '../components/HdList'
|
||||
|
||||
|
||||
@Component
|
||||
export struct HdGrid {
|
||||
@State
|
||||
refreshing: boolean = false
|
||||
@State
|
||||
finished: boolean = false
|
||||
@State
|
||||
loading: boolean = false
|
||||
// options
|
||||
lw: number = 0
|
||||
|
||||
@Builder
|
||||
defaultListContent() {
|
||||
}
|
||||
|
||||
@BuilderParam
|
||||
listContent: () => void = this.defaultListContent
|
||||
// function
|
||||
onLoad: () => void = () => {
|
||||
}
|
||||
onRefresh: () => void = () => {
|
||||
}
|
||||
// controller
|
||||
controller: HdListController = new HdListController()
|
||||
scroller: Scroller = new Scroller()
|
||||
|
||||
aboutToAppear() {
|
||||
if (this.controller) {
|
||||
this.controller.loaded = () => this.loading = false
|
||||
this.controller.finished = () => this.finished = true
|
||||
this.controller.refreshed = () => this.refreshing = false
|
||||
this.controller.reload = () => {
|
||||
this.finished = false
|
||||
this.refreshing = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Builder
|
||||
loadMoreBuilder() {
|
||||
GridItem() {
|
||||
if (this.finished) {
|
||||
Row() {
|
||||
Text($r('app.string.hd_list_finished'))
|
||||
.fontColor(Color.Gray)
|
||||
.fontSize($r('app.float.hd_list_load_font'))
|
||||
}
|
||||
.height($r('app.float.hd_list_load_height'))
|
||||
.width('100%')
|
||||
.justifyContent(FlexAlign.Center)
|
||||
} else if (this.loading && !this.finished) {
|
||||
Row() {
|
||||
LoadingProgress()
|
||||
.width($r('app.float.hd_list_load_icon'))
|
||||
Text($r('app.string.hd_list_loading'))
|
||||
.fontColor(Color.Gray)
|
||||
.fontSize($r('app.float.hd_list_load_font'))
|
||||
}
|
||||
.height($r('app.float.hd_list_load_height'))
|
||||
.width('100%')
|
||||
.justifyContent(FlexAlign.Center)
|
||||
}
|
||||
}
|
||||
.height($r('app.float.hd_list_load_height'))
|
||||
}
|
||||
|
||||
build() {
|
||||
Refresh({ refreshing: $$this.refreshing }) {
|
||||
Grid(this.scroller) {
|
||||
this.listContent()
|
||||
this.loadMoreBuilder()
|
||||
}
|
||||
.columnsTemplate('1fr 1fr')
|
||||
.columnsGap(10)
|
||||
.rowsGap(10)
|
||||
.width('100%')
|
||||
.height('100%')
|
||||
.padding({ left: BasicConstant.SPACE_LG, right: BasicConstant.SPACE_LG })
|
||||
// .divider({
|
||||
// strokeWidth: $r('app.float.common_border_width'),
|
||||
// color: $r('app.color.common_gray_border')
|
||||
// })
|
||||
.onReachEnd(() => {
|
||||
if (this.loading || this.refreshing || this.finished) {
|
||||
return;
|
||||
}
|
||||
this.loading = true
|
||||
this.onLoad()
|
||||
})
|
||||
.scrollBar(BarState.Off)
|
||||
.nestedScroll({
|
||||
scrollForward: NestedScrollMode.PARENT_FIRST,
|
||||
scrollBackward: NestedScrollMode.SELF_FIRST
|
||||
})
|
||||
.edgeEffect(EdgeEffect.None)
|
||||
}
|
||||
.width('100%')
|
||||
.height('100%')
|
||||
.layoutWeight(this.lw)
|
||||
.onRefreshing(() => {
|
||||
if (this.loading) {
|
||||
return;
|
||||
}
|
||||
this.finished = false
|
||||
this.onRefresh()
|
||||
// tip: must next tick
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -11,7 +11,7 @@ export class BasicConstant {
|
||||
static readonly urlHtml = "http://dev-doc.igandan.com/app/"
|
||||
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 urlExpertAPI = "https://app.igandan.com/app/expertAPI/";
|
||||
@@ -19,10 +19,14 @@ export class BasicConstant {
|
||||
// static readonly urlHtml = "http://doc.igandan.com/app/"
|
||||
// static readonly urlImage = "http://app.igandan.com/app/"
|
||||
// static readonly urlExpert = "http://app.igandan.com/app/expert/"
|
||||
// static readonly wxUrl = "https://wx.igandan.com/";// 微信服务器地址
|
||||
|
||||
|
||||
static readonly getStartpage=BasicConstant.urlExpertApp + "startpage";
|
||||
static readonly meetingListV2=BasicConstant.urlExpertAPI + "meetingListV2";
|
||||
static readonly meetingV2Video=BasicConstant.urlExpertAPI + "meetingV2Video";
|
||||
static readonly getTypeUuidByName=BasicConstant.urlExpertApp + "getTypeUuidByName";
|
||||
static readonly zhibourl = BasicConstant.wxUrl+"hcp/setInfo";
|
||||
static readonly videoByTypeNew = BasicConstant.urlExpertApp + 'videoByTypeNew'
|
||||
static readonly videoDetail = BasicConstant.urlExpertAPI + "videoDetail";
|
||||
}
|
||||
@@ -1,4 +1,10 @@
|
||||
export class DataWebModel {
|
||||
url: string = '';
|
||||
title: string = '';
|
||||
|
||||
}
|
||||
|
||||
export class DataWebModels extends DataWebModel {
|
||||
type:string=''
|
||||
|
||||
}
|
||||
@@ -0,0 +1,115 @@
|
||||
import { cryptoFramework } from '@kit.CryptoArchitectureKit';
|
||||
import { buffer, util } from '@kit.ArkTS';
|
||||
|
||||
|
||||
export const base = new util.Base64Helper();
|
||||
|
||||
export class AESEncryptionDecryption {
|
||||
|
||||
// 字节流转成可理解的字符串
|
||||
static uint8ArrayToString(array: Uint8Array) {
|
||||
// 将UTF-8编码转换成Unicode编码
|
||||
let out: string = '';
|
||||
let index: number = 0;
|
||||
let len: number = array.length;
|
||||
while (index < len) {
|
||||
let character = array[index++];
|
||||
switch (character >> 4) {
|
||||
case 0:
|
||||
case 1:
|
||||
case 2:
|
||||
case 3:
|
||||
case 4:
|
||||
case 5:
|
||||
case 6:
|
||||
case 7:
|
||||
out += String.fromCharCode(character);
|
||||
break;
|
||||
case 12:
|
||||
case 13:
|
||||
out += String.fromCharCode(((character & 0x1F) << 6) | (array[index++] & 0x3F));
|
||||
break;
|
||||
case 14:
|
||||
out += String.fromCharCode(((character & 0x0F) << 12) | ((array[index++] & 0x3F) << 6) |
|
||||
((array[index++] & 0x3F) << 0));
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
return out;
|
||||
}
|
||||
|
||||
// 字符串转成字节流
|
||||
static stringToUint8Array(str: string) {
|
||||
return new Uint8Array(buffer.from(str, 'utf-8').buffer);
|
||||
}
|
||||
|
||||
// 获取密钥
|
||||
static async getKey() {
|
||||
let symAlgName = 'AES128';
|
||||
let symKeyGenerator = cryptoFramework.createSymKeyGenerator(symAlgName);
|
||||
let dataUint8Array = AESEncryptionDecryption.stringToUint8Array('Whh82GtW/EVjBkD8');
|
||||
let keyBlob: cryptoFramework.DataBlob = { data: dataUint8Array };
|
||||
let promiseSymKey = await symKeyGenerator.convertKey(keyBlob);
|
||||
let key = base.encodeToStringSync(promiseSymKey.getEncoded().data); // 将密钥转换为base64存储
|
||||
return key;
|
||||
}
|
||||
|
||||
// 加密
|
||||
static async aesEncrypt(text: string, puKey: string): Promise<string> {
|
||||
let globalResult = '';
|
||||
try {
|
||||
let cipherAlgName = 'AES128|ECB|PKCS7';
|
||||
let globalCipher = cryptoFramework.createCipher(cipherAlgName);
|
||||
let symAlgName = 'AES128';
|
||||
let symKeyGenerator = cryptoFramework.createSymKeyGenerator(symAlgName);
|
||||
// let dataUint8Array = base.decodeSync(puKey);
|
||||
let dataUint8Array = AESEncryptionDecryption.stringToUint8Array(puKey);
|
||||
let keyBlob: cryptoFramework.DataBlob = { data: dataUint8Array };
|
||||
let promiseSymKey = await symKeyGenerator.convertKey(keyBlob);
|
||||
await globalCipher.init(cryptoFramework.CryptoMode.ENCRYPT_MODE, promiseSymKey, null);
|
||||
let result = await globalCipher.doFinal({ data: AESEncryptionDecryption.stringToUint8Array(text) });
|
||||
globalResult = base.encodeToStringSync(result.data);
|
||||
console.info('加密后的明文:' + globalResult);
|
||||
} catch (err) {
|
||||
console.info('加密错误:' +err.message);
|
||||
}
|
||||
return globalResult;
|
||||
}
|
||||
// 使用 AES 密钥加密数据
|
||||
|
||||
static encryptMessage(symKey: cryptoFramework.SymKey, plainText: cryptoFramework.DataBlob) {
|
||||
|
||||
let cipher = cryptoFramework.createCipher('AES128|ECB|PKCS7');
|
||||
|
||||
cipher.initSync(cryptoFramework.CryptoMode.ENCRYPT_MODE, symKey, null); // ECB模式params为null。
|
||||
|
||||
let cipherData = cipher.doFinalSync(plainText);
|
||||
|
||||
return cipherData;
|
||||
|
||||
}
|
||||
|
||||
// 解密
|
||||
static async aesDecrypt(text: string, key: string) {
|
||||
let globalResult = '';
|
||||
try {
|
||||
let cipherAlgName = 'AES128|ECB|PKCS7';
|
||||
let globalCipher = cryptoFramework.createCipher(cipherAlgName);
|
||||
let symAlgName = 'AES128';
|
||||
let symKeyGenerator = cryptoFramework.createSymKeyGenerator(symAlgName);
|
||||
let dataUint8Array = base.decodeSync(key);
|
||||
let keyBlob: cryptoFramework.DataBlob = { data: dataUint8Array };
|
||||
let promiseSymKey = await symKeyGenerator.convertKey(keyBlob);
|
||||
await globalCipher.init(cryptoFramework.CryptoMode.DECRYPT_MODE, promiseSymKey, null);
|
||||
let plainText: cryptoFramework.DataBlob = { data: base.decodeSync(text) };
|
||||
let result = await globalCipher.doFinal(plainText);
|
||||
globalResult = AESEncryptionDecryption.uint8ArrayToString(result.data);
|
||||
console.info('解密后的明文:' + globalResult);
|
||||
} catch (err) {
|
||||
console.info(err.message);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user