添加我的页面
|
|
@ -18,7 +18,7 @@
|
|||
},
|
||||
{
|
||||
"name": "wx_video_course",
|
||||
"value": "1、点击【添加助手】,自动跳转进入微信创建快存助手;\n2、进入微信视频号,选择视频分享至-客服消息-素材助手;\n3、返回【素材魔方APP】微信视频号页面,下拉刷新即可下载微信号视频;"
|
||||
"value": "1、点击【添加助手】,自动跳转进入微信创建素材助手;\n2、进入微信视频号,选择视频分享至-客服消息-素材助手;\n3、返回【素材魔方APP】微信视频号页面,下拉刷新即可下载微信号视频;"
|
||||
},
|
||||
{
|
||||
"name": "wx_playback_course",
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ function defaultBuilder(option: TipDialogOption) {
|
|||
Text(option.title)
|
||||
.fontColor($r('app.color.color_212226'))
|
||||
.fontSize(22)
|
||||
.fontFamily('ysbth')
|
||||
.fontWeight(FontWeight.Medium)
|
||||
.visibility(StrUtil.isEmpty(option.title) ? Visibility.Hidden : Visibility.Visible)
|
||||
Text(option.content)
|
||||
|
|
|
|||
|
|
@ -12,58 +12,60 @@ export declare class TipDialogOption {
|
|||
|
||||
@Builder
|
||||
function defaultBuilder(option: TipDialogOption) {
|
||||
Column() {
|
||||
Text(option.title)
|
||||
.fontColor($r('app.color.color_90ffffff'))
|
||||
.fontSize(18)
|
||||
.fontWeight(FontWeight.Medium)
|
||||
.visibility(StrUtil.isEmpty(option.title) ? Visibility.Hidden : Visibility.Visible)
|
||||
Text(option.content)
|
||||
.textAlign(TextAlign.Center)
|
||||
.fontColor(StrUtil.isNotEmpty(option.title) ? $r('app.color.color_80ffffff') : $r('app.color.color_90ffffff'))
|
||||
.fontSize(StrUtil.isNotEmpty(option.title) ? 14 : 18)
|
||||
.fontWeight(StrUtil.isNotEmpty(option.title) ? FontWeight.Normal : FontWeight.Medium)
|
||||
.textOverflow({ overflow: TextOverflow.Ellipsis })
|
||||
.ellipsisMode(EllipsisMode.END)
|
||||
.margin({ left: 27, top: 12, right: 27 })
|
||||
.maxLines(5)
|
||||
Row() {
|
||||
Button(StrUtil.isNotEmpty(option.leftText) ? option.leftText : '取消', { type: ButtonType.Capsule, stateEffect: false })
|
||||
.fontColor($r('app.color.color_50ffffff'))
|
||||
.fontSize(14)
|
||||
.backgroundColor($r('app.color.color_333333'))
|
||||
.layoutWeight(1)
|
||||
.height(40)
|
||||
.onClick(() => {
|
||||
TipDialog.dismiss();
|
||||
if (option.callback?.cancel) {
|
||||
option.callback?.cancel();
|
||||
}
|
||||
})
|
||||
Blank().width(12)
|
||||
Button(StrUtil.isNotEmpty(option.rightText) ? option.rightText : '确定', { type: ButtonType.Capsule, stateEffect: false })
|
||||
.fontColor(Color.White)
|
||||
.fontSize(14)
|
||||
.backgroundColor(Color.Transparent)
|
||||
.linearGradient({
|
||||
colors: [['#F62C6C', 0.0], ['#FC4F54', 1.0]],
|
||||
direction: GradientDirection.Right
|
||||
})
|
||||
.layoutWeight(1)
|
||||
.height(40)
|
||||
.onClick(() => {
|
||||
TipDialog.dismiss();
|
||||
if (option.callback?.confirm) {
|
||||
option.callback?.confirm();
|
||||
}
|
||||
})
|
||||
Stack({alignContent: Alignment.Top}) {
|
||||
Image($r('app.media.ic_tip_dialog_top_bg')).width('100%').aspectRatio(2.72)
|
||||
|
||||
Column() {
|
||||
Text(option.title)
|
||||
.fontColor($r('app.color.color_212226'))
|
||||
.fontSize(22)
|
||||
.fontFamily('ysbth')
|
||||
.fontWeight(FontWeight.Medium)
|
||||
.visibility(StrUtil.isEmpty(option.title) ? Visibility.Hidden : Visibility.Visible)
|
||||
Text(option.content)
|
||||
.textAlign(TextAlign.Center)
|
||||
.fontColor(StrUtil.isNotEmpty(option.title) ? $r('app.color.color_727686') : $r('app.color.color_212226'))
|
||||
.fontSize(StrUtil.isNotEmpty(option.title) ? 14 : 22)
|
||||
.fontWeight(StrUtil.isNotEmpty(option.title) ? FontWeight.Normal : FontWeight.Medium)
|
||||
.textOverflow({ overflow: TextOverflow.Ellipsis })
|
||||
.ellipsisMode(EllipsisMode.END)
|
||||
.margin({ left: 27, top: 12, right: 27 })
|
||||
.maxLines(5)
|
||||
Row(){
|
||||
Button(StrUtil.isNotEmpty(option.leftText) ? option.leftText : '取消', { type: ButtonType.Capsule, stateEffect: true })
|
||||
.width(110)
|
||||
.height(40)
|
||||
.fontColor($r('app.color.color_80859B'))
|
||||
.fontSize(16)
|
||||
.backgroundColor($r("app.color.color_f1f2f6"))
|
||||
.margin({left: 20})
|
||||
.onClick(() => {
|
||||
TipDialog.dismiss();
|
||||
if (option.callback?.cancel) {
|
||||
option.callback?.cancel();
|
||||
}
|
||||
})
|
||||
Blank().layoutWeight(1)
|
||||
Button(StrUtil.isNotEmpty(option.rightText) ? option.rightText : '确定', { type: ButtonType.Capsule, stateEffect: true })
|
||||
.width(110)
|
||||
.height(40)
|
||||
.fontColor(Color.White)
|
||||
.fontSize(16)
|
||||
.backgroundColor($r("app.color.color_466afd"))
|
||||
.margin({right: 20})
|
||||
.onClick(() => {
|
||||
TipDialog.dismiss();
|
||||
if (option.callback?.confirm) {
|
||||
option.callback?.confirm();
|
||||
}
|
||||
})
|
||||
}
|
||||
.margin({top: 20})
|
||||
}
|
||||
.padding({ left: 14, right: 14 })
|
||||
.margin({ top: 20 })
|
||||
.padding({ top: 20, bottom: 20 })
|
||||
}
|
||||
.padding({ top: 22, bottom: 22 })
|
||||
.borderRadius(20)
|
||||
.backgroundColor($r('app.color.color_222222'))
|
||||
.backgroundColor(Color.White)
|
||||
.width('80%')
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -30,19 +30,22 @@ export class ConfigEntity {
|
|||
wxVideoEnable: boolean = true; //视频号开关
|
||||
|
||||
@Expose({ name: 'client.wechat.video.playback.share.enable' })
|
||||
playbackEnable: boolean = true; //直播回放开关
|
||||
playbackEnable: boolean = true; //
|
||||
|
||||
@Expose({ name: 'client.course.wechat.video' })
|
||||
@Expose({ name: 'client.course.urlplay' })
|
||||
takeMaterialCourse: string = ""; //链接提取教程链接
|
||||
|
||||
@Expose({ name: 'client.course.sphplay' })
|
||||
wxVideoCourse: string = ""; //视频号教程
|
||||
|
||||
@Expose({ name: 'client.course.playback' })
|
||||
@Expose({ name: 'client.course.zbhfplay' })
|
||||
wxPlaybackCourse: string = ""; //直播回放教程
|
||||
|
||||
@Expose({ name: 'client.playback.join.type' })
|
||||
wxPlaybackJoinType: string = ""; //直播加群方式
|
||||
|
||||
@Type(() => WxVideoConfigEntity)
|
||||
@Expose({ name: 'client.mp.share.config.kcsp' })
|
||||
@Expose({ name: 'client.mp.share.config.scmf' })
|
||||
wxVideoConfig: WxVideoConfigEntity = new WxVideoConfigEntity() //直播回放小程序跳转配置
|
||||
|
||||
@Expose({ name: 'client.hmos.video.service.enable' }) //视频号助手是否可用
|
||||
|
|
|
|||
|
|
@ -1,23 +0,0 @@
|
|||
import { ArrayList } from "@kit.ArkTS";
|
||||
|
||||
export class HomeMenuEntity {
|
||||
icon: Resource | null = null;
|
||||
title: string = "";
|
||||
alias: string = "";
|
||||
|
||||
constructor(icon: Resource, title: string, alias: string) {
|
||||
this.icon = icon;
|
||||
this.title = title;
|
||||
this.alias = alias;
|
||||
}
|
||||
}
|
||||
|
||||
export function homeMenuList(): ArrayList<HomeMenuEntity> {
|
||||
let list = new ArrayList<HomeMenuEntity>()
|
||||
list.add(new HomeMenuEntity($r('app.media.ic_home_icon6'), "视频转音频", "videoToAudio"))
|
||||
list.add(new HomeMenuEntity($r('app.media.ic_home_icon8'), "视频加水印", "addWatermark"))
|
||||
list.add(new HomeMenuEntity($r('app.media.ic_home_icon5'), "视频转文字", "videoToText"))
|
||||
list.add(new HomeMenuEntity($r('app.media.ic_home_icon9'), "长图拼接", "longImageMerge"))
|
||||
list.add(new HomeMenuEntity($r('app.media.ic_home_icon10'), "更多功能", "moreTools"))
|
||||
return list;
|
||||
}
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
import { ArrayList } from "@kit.ArkTS";
|
||||
|
||||
export class MenuEntity {
|
||||
icon: Resource | null = null;
|
||||
title: string = "";
|
||||
alias: string = "";
|
||||
|
||||
constructor(icon: Resource, title: string, alias: string) {
|
||||
this.icon = icon;
|
||||
this.title = title;
|
||||
this.alias = alias;
|
||||
}
|
||||
}
|
||||
|
||||
export function homeMenuList(): ArrayList<MenuEntity> {
|
||||
let list = new ArrayList<MenuEntity>()
|
||||
list.add(new MenuEntity($r('app.media.ic_home_icon6'), "视频转音频", "videoToAudio"))
|
||||
list.add(new MenuEntity($r('app.media.ic_home_icon8'), "视频加水印", "addWatermark"))
|
||||
list.add(new MenuEntity($r('app.media.ic_home_icon5'), "视频转文字", "videoToText"))
|
||||
list.add(new MenuEntity($r('app.media.ic_home_icon9'), "长图拼接", "longImageMerge"))
|
||||
list.add(new MenuEntity($r('app.media.ic_home_icon10'), "更多功能", "moreTools"))
|
||||
return list;
|
||||
}
|
||||
|
||||
export function mineMenuList(): ArrayList<MenuEntity> {
|
||||
let list = new ArrayList<MenuEntity>()
|
||||
list.add(new MenuEntity($r('app.media.ic_mine_icon1'), "提取记录", "history"))
|
||||
list.add(new MenuEntity($r('app.media.ic_mine_icon2'), "次数兑换", "diamond"))
|
||||
list.add(new MenuEntity($r('app.media.ic_mine_icon3'), "意见反馈", "feedback"))
|
||||
list.add(new MenuEntity($r('app.media.ic_mine_icon4'), "联系客服", "service"))
|
||||
return list;
|
||||
}
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
|
||||
export class WxVideoServiceEntity {
|
||||
corp_id: string = ""
|
||||
link: string = ""
|
||||
}
|
||||
|
|
@ -69,6 +69,7 @@ class UserConfigManager {
|
|||
this.saveWxVideoEnable(config.config.wxVideoEnable);
|
||||
this.savePlaybackEnable(config.config.playbackEnable);
|
||||
this.saveLoginType(config.config.loginType);
|
||||
this.saveTakeMaterialCourse(config.config.takeMaterialCourse);
|
||||
this.saveWxVideoCourse(config.config.wxVideoCourse);
|
||||
this.savePlaybackCourse(config.config.wxPlaybackCourse);
|
||||
this.saveWxPlaybackJoinType(config.config.wxPlaybackJoinType);
|
||||
|
|
@ -242,6 +243,21 @@ class UserConfigManager {
|
|||
return new Array('phone');
|
||||
}
|
||||
|
||||
/**
|
||||
* 链接提取教程链接
|
||||
* @param url
|
||||
*/
|
||||
saveTakeMaterialCourse(url?: string) {
|
||||
if (StrUtil.isNotEmpty(url)) {
|
||||
PrefUtils.put('take_material_course', url!!);
|
||||
}
|
||||
}
|
||||
|
||||
getTakeMaterialCourse(): string {
|
||||
return PrefUtils.getString('take_material_course');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 视频号教程链接
|
||||
* @param url
|
||||
|
|
|
|||
|
|
@ -82,27 +82,27 @@ export class Api {
|
|||
/**
|
||||
* 链接提取
|
||||
*/
|
||||
static readonly MATERIAL_INFO = '/api/material';
|
||||
static readonly MATERIAL_INFO = '/api/mat/url';
|
||||
|
||||
/**
|
||||
* 视频号和直播回放提取
|
||||
*/
|
||||
static readonly WX_VIDEO = '/api/weixin/video/log';
|
||||
static readonly WX_VIDEO = '/api/wx';
|
||||
|
||||
/**
|
||||
* 跳转至微信发送视频号给客服
|
||||
*/
|
||||
static readonly WX_VIDEO_SERVICE = '/api/weixin/video/service'
|
||||
static readonly WX_VIDEO_SERVICE = '/api/wx/service/url'
|
||||
|
||||
/**
|
||||
* 绑定微信用户信息
|
||||
*/
|
||||
static readonly BIND_WX_USER_INFO = '/api/weixin/user/info'
|
||||
static readonly BIND_WX_USER_INFO = '/api/wx/user/info'
|
||||
|
||||
/**
|
||||
* 下载记录
|
||||
*/
|
||||
static readonly DOWNLOAD_HISTORY_LIST = '/api/material/log'
|
||||
static readonly DOWNLOAD_HISTORY_LIST = '/api/mat/log'
|
||||
|
||||
/**
|
||||
* 素材列表
|
||||
|
|
|
|||
|
|
@ -275,7 +275,7 @@ class ApiService {
|
|||
* @returns
|
||||
*/
|
||||
analysisMaterial(logId: string): Promise<HttpResult> {
|
||||
const params: Record<string, string> = { 'logid': logId }
|
||||
const params: Record<string, string> = { 'id': logId }
|
||||
return AxiosRequest.get<HttpResult>(Api.MATERIAL_INFO, params)
|
||||
}
|
||||
|
||||
|
|
@ -283,9 +283,8 @@ class ApiService {
|
|||
* 获取视频号和直播回放
|
||||
* @returns
|
||||
*/
|
||||
wxVideoList(scene: string): Promise<HttpResult> {
|
||||
const params: Record<string, string> = { 'v': 'v2', 'scene': scene }
|
||||
return AxiosRequest.get<HttpResult>(Api.WX_VIDEO, params)
|
||||
wxVideoList(): Promise<HttpResult> {
|
||||
return AxiosRequest.get<HttpResult>(Api.WX_VIDEO)
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -293,8 +292,8 @@ class ApiService {
|
|||
* @returns
|
||||
*/
|
||||
deleteWxVideo(logId: string): Promise<HttpResult> {
|
||||
const params: Record<string, string> = { 'logId': logId }
|
||||
return AxiosRequest.delete<HttpResult>(Api.WX_VIDEO, params)
|
||||
const params: Record<string, string> = { 'id': logId }
|
||||
return AxiosRequest.delete<HttpResult>(Api.DOWNLOAD_HISTORY_LIST, params)
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -307,7 +306,7 @@ class ApiService {
|
|||
'size': size,
|
||||
'message': message
|
||||
}
|
||||
return AxiosRequest.put<HttpResult>(Api.MATERIAL_INFO, params)
|
||||
return AxiosRequest.put<HttpResult>(Api.DOWNLOAD_HISTORY_LIST, params)
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
import { router, window } from '@kit.ArkUI';
|
||||
import { HomePage } from './home/HomePage';
|
||||
import { MinePage } from './mine/MinePage';
|
||||
import { RecordPage } from './record/RecordPage';
|
||||
import systemDateTime from '@ohos.systemDateTime';
|
||||
import { ToastUtils } from '../../utils/ToastUtils';
|
||||
import { AppUtil, PasteboardUtil, StrUtil } from '@pura/harmony-utils';
|
||||
|
|
@ -55,10 +54,9 @@ struct MainPage {
|
|||
|
||||
onPageShow(): void {
|
||||
this.viewModel.userinfo();
|
||||
if (this.currentIndex === 1) {
|
||||
AppUtil.getContext().eventHub.emit(EventConstants.RecordRefreshEvent);
|
||||
} else if (this.currentIndex === 2) {
|
||||
if (this.currentIndex === 3) {
|
||||
AppUtil.getContext().eventHub.emit(EventConstants.MineRefreshEvent);
|
||||
AppUtil.getContext().eventHub.emit(EventConstants.RecordRefreshEvent);
|
||||
}
|
||||
this.checkPasteboard()
|
||||
}
|
||||
|
|
@ -69,7 +67,7 @@ struct MainPage {
|
|||
AppUtil.getContext().eventHub.emit(EventConstants.MineRefreshEvent);
|
||||
})
|
||||
AppUtil.getContext().eventHub.on(EventConstants.JumpToRecordEvent, (index: number) => {
|
||||
this.tabController.changeIndex(1)
|
||||
this.tabController.changeIndex(3)
|
||||
this.currentIndex = 1
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { borderRadiuses } from '@kit.ArkUI';
|
||||
import { HomeMenuEntity, homeMenuList } from '../../../entity/HomeMenuEntity';
|
||||
import { MenuEntity, homeMenuList } from '../../../entity/MenuEntity';
|
||||
import { NoticeEntity } from '../../../entity/NoticeEntity';
|
||||
import { HomeViewModel } from '../../../viewModel/HomeViewModel';
|
||||
import { AppUtil, WantUtil } from '@pura/harmony-utils';
|
||||
|
|
@ -323,7 +323,7 @@ export struct HomePage {
|
|||
.id('layout_top_menu')
|
||||
|
||||
Grid() {
|
||||
ForEach(homeMenuList().convertToArray(), (item: HomeMenuEntity) => {
|
||||
ForEach(homeMenuList().convertToArray(), (item: MenuEntity) => {
|
||||
GridItem() {
|
||||
Column() {
|
||||
Image(item.icon)
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
import { ConfigManager } from '../../../../manager/UserConfigManager'
|
||||
import { TitleBar } from '../../../../view/TitleBar'
|
||||
|
||||
@Entry
|
||||
|
|
@ -5,14 +6,9 @@ import { TitleBar } from '../../../../view/TitleBar'
|
|||
struct CoursePage {
|
||||
build() {
|
||||
Column() {
|
||||
TitleBar({title: '指导教程'}).width('100%')
|
||||
TitleBar({title: '提取教程'}).width('100%')
|
||||
Scroll() {
|
||||
Column() {
|
||||
Image($r('app.media.ic_course1'))
|
||||
Image($r('app.media.ic_course2'))
|
||||
Image($r('app.media.ic_course3'))
|
||||
}
|
||||
.height('auto')
|
||||
Image(ConfigManager.getTakeMaterialCourse()).width('100%').height('auto')
|
||||
}
|
||||
.layoutWeight(1)
|
||||
.scrollBar(BarState.Off)
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ import {
|
|||
import { VipPermissionEntity } from '../../../../entity/VipPermissionEntity';
|
||||
import { LoginManager } from '../../../../manager/LoginGlobalManager';
|
||||
import { ToastUtils } from '../../../../utils/ToastUtils';
|
||||
import { LinkRecognizeViewModel } from '../../../../viewModel/LinkRecognizeViewModel';
|
||||
import { TakeMaterialViewModel } from '../../../../viewModel/TakeMaterialViewModel';
|
||||
import { AudioMaterialPage } from './material/AudioMaterialPage';
|
||||
import { ImageMaterialPage } from './material/ImageMaterialPage';
|
||||
import { TextMaterialPage } from './material/TextMaterialPage';
|
||||
|
|
@ -47,7 +47,7 @@ struct TakeMaterialPage {
|
|||
@Local videoRowCount: number = 1;
|
||||
@Local imageRowCount: number = 1;
|
||||
|
||||
viewModel: LinkRecognizeViewModel = new LinkRecognizeViewModel(this.getUIContext());
|
||||
viewModel: TakeMaterialViewModel = new TakeMaterialViewModel(this.getUIContext());
|
||||
|
||||
tabController: TabsController = new TabsController();
|
||||
titles: Array<string> = ['视频', '图片', '音频', '文本'];
|
||||
|
|
@ -460,7 +460,7 @@ struct TakeMaterialPage {
|
|||
Column() {
|
||||
Row() {
|
||||
Button({ type: ButtonType.Circle, stateEffect: true }) {
|
||||
Image($r('app.media.ic_back')).width(24).height(24)
|
||||
Image($r('app.media.ic_black_back')).width(24).height(24)
|
||||
}
|
||||
.width(40)
|
||||
.height(40)
|
||||
|
|
@ -474,10 +474,11 @@ struct TakeMaterialPage {
|
|||
Image($r('app.media.ic_link')).width(18).height(18)
|
||||
TextInput({ placeholder: '请输入链接地址', text: this.inputText })
|
||||
.layoutWeight(1)
|
||||
.fontColor('#D6D6D6')
|
||||
.fontColor($r('app.color.color_1a1a1a'))
|
||||
.fontSize(14)
|
||||
.placeholderColor($r('app.color.color_30ffffff'))
|
||||
.placeholderColor($r('app.color.color_999999'))
|
||||
.placeholderFont({ size: 14 })
|
||||
.backgroundColor(Color.Transparent)
|
||||
.onChange((value: string) => {
|
||||
this.inputText = value;
|
||||
})
|
||||
|
|
@ -485,17 +486,17 @@ struct TakeMaterialPage {
|
|||
.width(18)
|
||||
.height(18)
|
||||
.padding(2)
|
||||
.margin({right: 5})
|
||||
.visibility(StrUtil.isNotEmpty(this.inputText) ? Visibility.Visible : Visibility.None)
|
||||
.onClick(() => {
|
||||
this.inputText = '';
|
||||
})
|
||||
Divider()
|
||||
.vertical(true)
|
||||
.strokeWidth(1)
|
||||
.height(14)
|
||||
.color($r('app.color.color_10ffffff'))
|
||||
.margin({ left: 12, right: 12 })
|
||||
Text('获取').fontColor($r('app.color.color_80ffffff')).fontSize(14)
|
||||
Button('获取', {type: ButtonType.Capsule ,stateEffect:true})
|
||||
.fontSize(14)
|
||||
.width(64)
|
||||
.height(32)
|
||||
.margin({right: 4})
|
||||
.backgroundColor($r('app.color.color_466afd'))
|
||||
.onClick(() => {
|
||||
if (StrUtil.isNotEmpty(this.inputText)) {
|
||||
KeyboardUtil.hide()
|
||||
|
|
@ -507,11 +508,11 @@ struct TakeMaterialPage {
|
|||
})
|
||||
}
|
||||
.layoutWeight(1)
|
||||
.height(34)
|
||||
.height(40)
|
||||
.borderRadius(20)
|
||||
.backgroundColor($r('app.color.color_333333'))
|
||||
.margin({ left: 20, right: 16 })
|
||||
.padding({ left: 10, right: 10 })
|
||||
.backgroundColor(Color.White)
|
||||
.margin({ left: 10, right: 16 })
|
||||
.padding({left: 10})
|
||||
}.height(100).padding({ top: 50 })
|
||||
|
||||
Tabs({ barPosition: BarPosition.Start, controller: this.tabController }) {
|
||||
|
|
@ -572,12 +573,9 @@ struct TakeMaterialPage {
|
|||
.tabBar(this.tabBuilder(this.titles[3], 3))
|
||||
}
|
||||
.scrollable(false)
|
||||
.onTabBarClick((index) => {
|
||||
.onSelected((index: number) => {
|
||||
this.currentIndex = index;
|
||||
})
|
||||
/*.onSelected((index: number) => {
|
||||
this.currentIndex = index;
|
||||
})*/
|
||||
.layoutWeight(1)
|
||||
}
|
||||
.width('100%')
|
||||
|
|
@ -587,14 +585,16 @@ struct TakeMaterialPage {
|
|||
|
||||
@Builder
|
||||
tabBuilder(title: string, targetIndex: number) {
|
||||
Column() {
|
||||
Stack() {
|
||||
if (this.currentIndex === targetIndex) {
|
||||
Image($r('app.media.ic_tab_indicator')).width(27).height(11).margin({top: 13})
|
||||
}
|
||||
Text(title)
|
||||
.fontColor(this.currentIndex === targetIndex ? $r("app.color.color_466afd") : $r('app.color.color_50ffffff'))
|
||||
.fontSize(this.currentIndex === targetIndex ? 17 : 14)
|
||||
.fontColor(this.currentIndex === targetIndex ? $r("app.color.color_212226") : $r('app.color.color_5c5f6c'))
|
||||
.fontSize(this.currentIndex === targetIndex ? 16 : 14)
|
||||
.fontWeight(this.currentIndex === targetIndex ? FontWeight.Medium : FontWeight.Regular)
|
||||
}
|
||||
.width('100%')
|
||||
.height(50)
|
||||
.justifyContent(FlexAlign.Center)
|
||||
}
|
||||
}
|
||||
|
|
@ -1,3 +1,4 @@
|
|||
import { RouterUrls } from '../../../../../common/RouterUrls';
|
||||
import { AudioMaterial } from '../../../../../entity/MaterialInfoEntity';
|
||||
import { ToastUtils } from '../../../../../utils/ToastUtils';
|
||||
import { EmptyView, PageStatus } from '../../../../../view/EmptyView';
|
||||
|
|
@ -43,7 +44,7 @@ export struct AudioMaterialPage {
|
|||
Row() {
|
||||
Row() {
|
||||
Image(this.mediaList.every(item => item.isChecked) ? $r('app.media.ic_check_true') : $r('app.media.ic_check_false')).width(18).height(18)
|
||||
Text('全选').fontColor($r('app.color.color_90ffffff')).fontSize(16).margin({ left: 7 })
|
||||
Text('全选').fontColor($r('app.color.color_1a1a1a')).fontSize(16).margin({ left: 7 })
|
||||
}
|
||||
.onClick(() => {
|
||||
this.isCheckAll = !this.isCheckAll;
|
||||
|
|
@ -57,9 +58,12 @@ export struct AudioMaterialPage {
|
|||
Button('转发', { type: ButtonType.Capsule, stateEffect: true })
|
||||
.width(122)
|
||||
.height(40)
|
||||
.backgroundColor($r('app.color.color_333333'))
|
||||
.fontColor($r('app.color.color_50ffffff'))
|
||||
.fontSize(15)
|
||||
.fontColor($r('app.color.color_466afd'))
|
||||
.fontWeight(FontWeight.Medium)
|
||||
.borderWidth(1)
|
||||
.borderColor($r('app.color.color_466afd'))
|
||||
.backgroundColor(Color.Transparent)
|
||||
.onClick(() => {
|
||||
if (this.onShare) {
|
||||
const list = this.selectedItems();
|
||||
|
|
@ -76,12 +80,10 @@ export struct AudioMaterialPage {
|
|||
Button('保存', { type: ButtonType.Capsule, stateEffect: true })
|
||||
.width(122)
|
||||
.height(40)
|
||||
.linearGradient({
|
||||
colors: [['#F62C6C', 0.0], ['#FC4F54', 1.0]],
|
||||
direction: GradientDirection.Right
|
||||
})
|
||||
.fontColor($r('app.color.color_90ffffff'))
|
||||
.fontColor(Color.White)
|
||||
.fontSize(15)
|
||||
.fontWeight(FontWeight.Medium)
|
||||
.backgroundColor($r('app.color.color_466afd'))
|
||||
.margin({ left: 12 })
|
||||
.onClick(() => {
|
||||
if (this.onSave) {
|
||||
|
|
@ -94,7 +96,7 @@ export struct AudioMaterialPage {
|
|||
}
|
||||
})
|
||||
}
|
||||
.backgroundColor($r('app.color.color_222222'))
|
||||
.backgroundColor(Color.White)
|
||||
.padding({
|
||||
left: 16,
|
||||
top: 10,
|
||||
|
|
@ -106,8 +108,13 @@ export struct AudioMaterialPage {
|
|||
|
||||
EmptyView({
|
||||
status: this.mediaList.length > 0 ? PageStatus.GONE : PageStatus.NO_DATA,
|
||||
noDataImage: $r('app.media.ic_empty_audio'),
|
||||
noDataText: '暂无音频'
|
||||
noDataImage: $r('app.media.ic_empty_data'),
|
||||
noDataText: '暂无数据',
|
||||
noDataBtnText: '链接提取教程',
|
||||
noDataBtnIcon: $r('app.media.ic_take_material_course'),
|
||||
onBtnClick: () => {
|
||||
this.getUIContext().getRouter().pushUrl({url: RouterUrls.COURSE_PAGE})
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
import { RouterUrls } from '../../../../../common/RouterUrls';
|
||||
import { ImageMaterial } from '../../../../../entity/MaterialInfoEntity';
|
||||
import { ToastUtils } from '../../../../../utils/ToastUtils';
|
||||
import { EmptyView, PageStatus } from '../../../../../view/EmptyView';
|
||||
|
|
@ -46,7 +47,7 @@ export struct ImageMaterialPage {
|
|||
Row() {
|
||||
Row() {
|
||||
Image(this.mediaList.every(item => item.isChecked) ? $r('app.media.ic_check_true') : $r('app.media.ic_check_false')).width(18).height(18)
|
||||
Text('全选').fontColor($r('app.color.color_90ffffff')).fontSize(16).margin({ left: 7 })
|
||||
Text('全选').fontColor($r('app.color.color_1a1a1a')).fontSize(16).margin({ left: 7 })
|
||||
}
|
||||
.onClick(() => {
|
||||
this.isCheckAll = !this.isCheckAll;
|
||||
|
|
@ -60,9 +61,12 @@ export struct ImageMaterialPage {
|
|||
Button('转发', { type: ButtonType.Capsule, stateEffect: true })
|
||||
.width(122)
|
||||
.height(40)
|
||||
.backgroundColor($r('app.color.color_333333'))
|
||||
.fontColor($r('app.color.color_50ffffff'))
|
||||
.fontSize(15)
|
||||
.fontColor($r('app.color.color_466afd'))
|
||||
.fontWeight(FontWeight.Medium)
|
||||
.borderWidth(1)
|
||||
.borderColor($r('app.color.color_466afd'))
|
||||
.backgroundColor(Color.Transparent)
|
||||
.onClick(() => {
|
||||
if (this.onShare) {
|
||||
const list = this.selectedItems();
|
||||
|
|
@ -79,12 +83,10 @@ export struct ImageMaterialPage {
|
|||
Button('保存', { type: ButtonType.Capsule, stateEffect: true })
|
||||
.width(122)
|
||||
.height(40)
|
||||
.linearGradient({
|
||||
colors: [['#F62C6C', 0.0], ['#FC4F54', 1.0]],
|
||||
direction: GradientDirection.Right
|
||||
})
|
||||
.fontColor($r('app.color.color_90ffffff'))
|
||||
.fontColor(Color.White)
|
||||
.fontSize(15)
|
||||
.fontWeight(FontWeight.Medium)
|
||||
.backgroundColor($r('app.color.color_466afd'))
|
||||
.margin({ left: 12 })
|
||||
.onClick(() => {
|
||||
if (this.onSave) {
|
||||
|
|
@ -97,7 +99,7 @@ export struct ImageMaterialPage {
|
|||
}
|
||||
})
|
||||
}
|
||||
.backgroundColor($r('app.color.color_222222'))
|
||||
.backgroundColor(Color.White)
|
||||
.padding({
|
||||
left: 16,
|
||||
top: 10,
|
||||
|
|
@ -109,8 +111,13 @@ export struct ImageMaterialPage {
|
|||
|
||||
EmptyView({
|
||||
status: this.mediaList.length > 0 ? PageStatus.GONE : PageStatus.NO_DATA,
|
||||
noDataImage: $r('app.media.ic_empty_image'),
|
||||
noDataText: '暂无图片'
|
||||
noDataImage: $r('app.media.ic_empty_data'),
|
||||
noDataText: '暂无数据',
|
||||
noDataBtnText: '链接提取教程',
|
||||
noDataBtnIcon: $r('app.media.ic_take_material_course'),
|
||||
onBtnClick: () => {
|
||||
this.getUIContext().getRouter().pushUrl({url: RouterUrls.COURSE_PAGE})
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
import { PasteboardUtil } from '@pura/harmony-utils';
|
||||
import { RouterUrls } from '../../../../../common/RouterUrls';
|
||||
import { TextMaterial } from '../../../../../entity/MaterialInfoEntity';
|
||||
import { ToastUtils } from '../../../../../utils/ToastUtils';
|
||||
import { EmptyView, PageStatus } from '../../../../../view/EmptyView';
|
||||
|
|
@ -42,7 +43,7 @@ export struct TextMaterialPage {
|
|||
Row() {
|
||||
Row() {
|
||||
Image(this.mediaList.every(item => item.isChecked) ? $r('app.media.ic_check_true') : $r('app.media.ic_check_false')).width(18).height(18)
|
||||
Text('全选').fontColor($r('app.color.color_90ffffff')).fontSize(16).margin({ left: 7 })
|
||||
Text('全选').fontColor($r('app.color.color_1a1a1a')).fontSize(16).margin({ left: 7 })
|
||||
}
|
||||
.onClick(() => {
|
||||
this.isCheckAll = !this.isCheckAll;
|
||||
|
|
@ -54,12 +55,10 @@ export struct TextMaterialPage {
|
|||
Button('复制文本', { type: ButtonType.Capsule, stateEffect: true })
|
||||
.layoutWeight(1)
|
||||
.height(40)
|
||||
.linearGradient({
|
||||
colors: [['#F62C6C', 0.0], ['#FC4F54', 1.0]],
|
||||
direction: GradientDirection.Right
|
||||
})
|
||||
.fontColor($r('app.color.color_90ffffff'))
|
||||
.fontColor(Color.White)
|
||||
.fontSize(15)
|
||||
.fontWeight(FontWeight.Medium)
|
||||
.backgroundColor($r('app.color.color_466afd'))
|
||||
.margin({ left: 27 })
|
||||
.onClick(() => {
|
||||
const list = this.selectedItems();
|
||||
|
|
@ -73,7 +72,7 @@ export struct TextMaterialPage {
|
|||
}
|
||||
})
|
||||
}
|
||||
.backgroundColor($r('app.color.color_222222'))
|
||||
.backgroundColor(Color.White)
|
||||
.padding({
|
||||
left: 16,
|
||||
top: 10,
|
||||
|
|
@ -85,8 +84,13 @@ export struct TextMaterialPage {
|
|||
|
||||
EmptyView({
|
||||
status: this.mediaList.length > 0 ? PageStatus.GONE : PageStatus.NO_DATA,
|
||||
noDataImage: $r('app.media.ic_empty_text'),
|
||||
noDataText: '暂无文本'
|
||||
noDataImage: $r('app.media.ic_empty_data'),
|
||||
noDataText: '暂无数据',
|
||||
noDataBtnText: '链接提取教程',
|
||||
noDataBtnIcon: $r('app.media.ic_take_material_course'),
|
||||
onBtnClick: () => {
|
||||
this.getUIContext().getRouter().pushUrl({url: RouterUrls.COURSE_PAGE})
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
import { RouterUrls } from '../../../../../common/RouterUrls';
|
||||
import { VideoMaterial } from '../../../../../entity/MaterialInfoEntity';
|
||||
import { ToastUtils } from '../../../../../utils/ToastUtils';
|
||||
import { EmptyView, PageStatus } from '../../../../../view/EmptyView';
|
||||
|
|
@ -46,7 +47,7 @@ export struct VideoMaterialPage {
|
|||
Row() {
|
||||
Row() {
|
||||
Image(this.mediaList.every(item => item.isChecked) ? $r('app.media.ic_check_true') : $r('app.media.ic_check_false')).width(18).height(18)
|
||||
Text('全选').fontColor($r('app.color.color_90ffffff')).fontSize(16).margin({ left: 7 })
|
||||
Text('全选').fontColor($r('app.color.color_1a1a1a')).fontSize(16).margin({ left: 7 })
|
||||
}
|
||||
.onClick(() => {
|
||||
this.isCheckAll = !this.isCheckAll;
|
||||
|
|
@ -60,9 +61,12 @@ export struct VideoMaterialPage {
|
|||
Button('转发', { type: ButtonType.Capsule, stateEffect: true })
|
||||
.width(122)
|
||||
.height(40)
|
||||
.backgroundColor($r('app.color.color_333333'))
|
||||
.fontColor($r('app.color.color_50ffffff'))
|
||||
.fontSize(15)
|
||||
.fontColor($r('app.color.color_466afd'))
|
||||
.fontWeight(FontWeight.Medium)
|
||||
.borderWidth(1)
|
||||
.borderColor($r('app.color.color_466afd'))
|
||||
.backgroundColor(Color.Transparent)
|
||||
.onClick(() => {
|
||||
if (this.onShare) {
|
||||
const list = this.selectedItems();
|
||||
|
|
@ -79,12 +83,10 @@ export struct VideoMaterialPage {
|
|||
Button('保存', { type: ButtonType.Capsule, stateEffect: true })
|
||||
.width(122)
|
||||
.height(40)
|
||||
.linearGradient({
|
||||
colors: [['#F62C6C', 0.0], ['#FC4F54', 1.0]],
|
||||
direction: GradientDirection.Right
|
||||
})
|
||||
.fontColor($r('app.color.color_90ffffff'))
|
||||
.fontColor(Color.White)
|
||||
.fontSize(15)
|
||||
.fontWeight(FontWeight.Medium)
|
||||
.backgroundColor($r('app.color.color_466afd'))
|
||||
.margin({ left: 12 })
|
||||
.onClick(() => {
|
||||
if (this.onSave) {
|
||||
|
|
@ -97,7 +99,7 @@ export struct VideoMaterialPage {
|
|||
}
|
||||
})
|
||||
}
|
||||
.backgroundColor($r('app.color.color_222222'))
|
||||
.backgroundColor(Color.White)
|
||||
.padding({
|
||||
left: 16,
|
||||
top: 10,
|
||||
|
|
@ -109,8 +111,13 @@ export struct VideoMaterialPage {
|
|||
|
||||
EmptyView({
|
||||
status: this.mediaList.length > 0 ? PageStatus.GONE : PageStatus.NO_DATA,
|
||||
noDataImage: $r('app.media.ic_empty_video'),
|
||||
noDataText: '暂无视频'
|
||||
noDataImage: $r('app.media.ic_empty_data'),
|
||||
noDataText: '暂无数据',
|
||||
noDataBtnText: '链接提取教程',
|
||||
noDataBtnIcon: $r('app.media.ic_take_material_course'),
|
||||
onBtnClick: () => {
|
||||
this.getUIContext().getRouter().pushUrl({url: RouterUrls.COURSE_PAGE})
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { AppUtil, FileUtil, ObjectUtil,
|
||||
PasteboardUtil,
|
||||
PermissionUtil, RandomUtil, StrUtil } from '@pura/harmony-utils';
|
||||
import {
|
||||
AppUtil, FileUtil, ObjectUtil, PasteboardUtil, RandomUtil, StrUtil
|
||||
} from '@pura/harmony-utils';
|
||||
import { EventConstants } from '../../../../common/EventConstants';
|
||||
import { RouterUrls } from '../../../../common/RouterUrls';
|
||||
import { DownloadDialog, DownloadStatus } from '../../../../dialog/DownloadDialog';
|
||||
|
|
@ -15,7 +15,7 @@ import { ToastUtils } from '../../../../utils/ToastUtils';
|
|||
import { TitleBar } from '../../../../view/TitleBar';
|
||||
import { WxVideoViewModel } from '../../../../viewModel/WxVideoViewModel';
|
||||
import { WxVideoMaterialPage } from './material/WxVideoMaterialPage';
|
||||
import { LevelMode, router } from '@kit.ArkUI';
|
||||
import { CommonModifier, LevelMode, router } from '@kit.ArkUI';
|
||||
import { WxVideoEntity } from '../../../../entity/WxVideoEntity';
|
||||
import { WxImageMaterialPage } from './material/WxImageMaterialPage';
|
||||
import { OnWXResp, WXApi, WXEventHandler } from '../../../../utils/wechat/WXApiEventHandlerImpl';
|
||||
|
|
@ -23,46 +23,41 @@ import * as WxOpenSdk from '@tencent/wechat_open_sdk';
|
|||
import { ErrCode, SendAuthResp } from '@tencent/wechat_open_sdk';
|
||||
import { LoadingDialog } from '../../../../dialog/LoadingDialog';
|
||||
import BuildProfile from 'BuildProfile';
|
||||
import { WxServiceEntity } from '../../../../entity/WxServiceEntity';
|
||||
import { Constants } from '../../../../common/Constants';
|
||||
import { EventReportGlobalManager } from '../../../../manager/EventReportGlobalManager';
|
||||
import { TipDialog } from '../../../../dialog/TipDialog';
|
||||
import { SimpleTipDialog } from '../../../../dialog/SimpleTipDialog';
|
||||
import { JoinWxGroupCourseDialog } from '../../../../dialog/JoinWxGroupCourseDialog';
|
||||
import { PrefUtils } from '../../../../utils/PrefUtils';
|
||||
import { WxVideoServiceEntity } from '../../../../entity/WxVideoServiceEntity';
|
||||
|
||||
@Entry
|
||||
@ComponentV2
|
||||
struct WxVideoPage {
|
||||
@Local tabBarModifier: CommonModifier = new CommonModifier()
|
||||
@Local isPlayback: boolean = false
|
||||
@Local currentIndex: number = 0;
|
||||
@Local isRefreshing: boolean = false;
|
||||
|
||||
@Local videoList: Array<VideoMaterial> = [];
|
||||
@Local imageList: Array<ImageMaterial> = [];
|
||||
|
||||
@Local videoRowCount: number = 1;
|
||||
@Local imageRowCount: number = 1;
|
||||
|
||||
viewModel: WxVideoViewModel = new WxVideoViewModel(this.getUIContext());
|
||||
tabController: TabsController = new TabsController();
|
||||
titles: Array<string> = ['视频', '图片'];
|
||||
type: number = 0
|
||||
|
||||
mediaDownloader?: MediaDownloader | null
|
||||
selectedList: Array<MediaEntity> = []
|
||||
cacheFileUris: Array<string> = []
|
||||
cacheFileUris: Array<string> = []
|
||||
downloadIndex: number = 0
|
||||
totalSize = 0
|
||||
downloadStatus = DownloadStatus.DOWNLOADING
|
||||
|
||||
joinGroupDialogController?: CustomDialogController | null;
|
||||
|
||||
//从微信返回的回调
|
||||
onWXResp: OnWXResp = (resp) => {
|
||||
//微信返回的数据
|
||||
if (resp instanceof SendAuthResp && resp.state?.endsWith('video')) {
|
||||
const authResult = JSON.stringify(resp ?? {}, null , 2);
|
||||
const authResult = JSON.stringify(resp ?? {}, null, 2);
|
||||
const errCode = JSON.parse(authResult).errCode as number;
|
||||
if (errCode === ErrCode.ERR_OK) {
|
||||
const authCode = JSON.parse(authResult).code as string;
|
||||
|
|
@ -97,13 +92,17 @@ struct WxVideoPage {
|
|||
const info = monitor.value()?.now as VipPermissionEntity;
|
||||
if (info.auth) {
|
||||
if (!LoginManager.isLogin()) {
|
||||
this.getUIContext().getRouter().pushUrl({url: RouterUrls.LOGIN_PAGE, params: {from: 1}}, router.RouterMode.Single)
|
||||
this.getUIContext()
|
||||
.getRouter()
|
||||
.pushUrl({ url: RouterUrls.LOGIN_PAGE, params: { from: 1 } }, router.RouterMode.Single)
|
||||
return;
|
||||
}
|
||||
this.shareOrDownload()
|
||||
} else {
|
||||
if (!info.auth_ad) {
|
||||
this.getUIContext().getRouter().pushUrl({url: RouterUrls.VIP_PAGE, params: {origin: 'download_wechat_video'}})
|
||||
this.getUIContext()
|
||||
.getRouter()
|
||||
.pushUrl({ url: RouterUrls.VIP_PAGE, params: { origin: 'download_wechat_video' } })
|
||||
EventReportGlobalManager.eventReport(EventConstants.JUMP_TO_MEMBER_RECHARGE, 'download_wechat_video')
|
||||
return;
|
||||
}
|
||||
|
|
@ -114,7 +113,7 @@ struct WxVideoPage {
|
|||
onErrorCodeChange(monitor: IMonitor) {
|
||||
const errorCode = monitor.value()?.now as number;
|
||||
if (errorCode === 12002 || errorCode === 12003 || errorCode === 12004) {
|
||||
this.getUIContext().getRouter().pushUrl({url: RouterUrls.RECHARGE_DIAMOND_PAGE});
|
||||
this.getUIContext().getRouter().pushUrl({ url: RouterUrls.RECHARGE_DIAMOND_PAGE });
|
||||
EventReportGlobalManager.eventReport(EventConstants.JUMP_TO_RECHARGE_DIAMOND, 'download_wechat_video')
|
||||
ToastUtils.show('钻石已用完')
|
||||
}
|
||||
|
|
@ -128,8 +127,8 @@ struct WxVideoPage {
|
|||
|
||||
@Monitor('viewModel.wxService')
|
||||
onWxServiceChange(monitor: IMonitor) {
|
||||
const info = monitor.value()?.now as WxServiceEntity;
|
||||
if (StrUtil.isEmpty(info.corpid) || StrUtil.isEmpty(info.address)) {
|
||||
const info = monitor.value()?.now as WxVideoServiceEntity;
|
||||
if (StrUtil.isEmpty(info.corp_id) || StrUtil.isEmpty(info.link)) {
|
||||
ToastUtils.show('获取客服信息错误')
|
||||
} else {
|
||||
ConfigManager.saveBindWxVideoHelper(true)
|
||||
|
|
@ -149,6 +148,7 @@ struct WxVideoPage {
|
|||
|
||||
aboutToAppear(): void {
|
||||
WXEventHandler.registerOnWXRespCallback(this.onWXResp)
|
||||
this.tabBarModifier.align(Alignment.Start)
|
||||
this.initParams()
|
||||
this.checkBindStatus()
|
||||
}
|
||||
|
|
@ -170,12 +170,14 @@ struct WxVideoPage {
|
|||
|
||||
showSaveTip() {
|
||||
if (PrefUtils.getBoolean('show_save_tip', true)) {
|
||||
SimpleTipDialog.show(this.getUIContext(), {title: '重要提示', content: '下载完成后需要您点击弹窗允许保存之后才能保存文件到相册', callback: {
|
||||
confirm: () => {
|
||||
this.viewModel.checkVip();
|
||||
PrefUtils.put('show_save_tip', false)
|
||||
SimpleTipDialog.show(this.getUIContext(), {
|
||||
title: '重要提示', content: '下载完成后需要您点击弹窗允许保存之后才能保存文件到相册', callback: {
|
||||
confirm: () => {
|
||||
this.viewModel.checkVip();
|
||||
PrefUtils.put('show_save_tip', false)
|
||||
}
|
||||
}
|
||||
}})
|
||||
})
|
||||
} else {
|
||||
this.viewModel.checkVip()
|
||||
}
|
||||
|
|
@ -197,17 +199,20 @@ struct WxVideoPage {
|
|||
|
||||
shareMedia(media: MediaEntity) {
|
||||
let filePath = FileUtil.getCacheDirPath() + FileUtil.separator + media.initFileName()
|
||||
if (FileUtil.accessSync(filePath) && FileUtil.isFile(filePath) && !(media.totalSize === 0 || media.currentLen !== media.totalSize)) {
|
||||
if (FileUtil.accessSync(filePath) && FileUtil.isFile(filePath) &&
|
||||
!(media.totalSize === 0 || media.currentLen !== media.totalSize)) {
|
||||
this.shareFile(media)
|
||||
} else {
|
||||
this.showDownloadDialog(media instanceof VideoMaterial && media.isMerge ? DownloadStatus.VIDEO_DOWNLOADING : DownloadStatus.DOWNLOADING)
|
||||
this.showDownloadDialog(media instanceof VideoMaterial && media.isMerge ? DownloadStatus.VIDEO_DOWNLOADING :
|
||||
DownloadStatus.DOWNLOADING)
|
||||
this.download(media, true)
|
||||
}
|
||||
}
|
||||
|
||||
async downloadMedia(media: MediaEntity) {
|
||||
let filePath = FileUtil.getCacheDirPath() + FileUtil.separator + media.initFileName()
|
||||
if (FileUtil.accessSync(filePath) && FileUtil.isFile(filePath) && !(media.totalSize === 0 || media.currentLen !== media.totalSize)) {
|
||||
if (FileUtil.accessSync(filePath) && FileUtil.isFile(filePath) &&
|
||||
!(media.totalSize === 0 || media.currentLen !== media.totalSize)) {
|
||||
this.cacheFileUris.push(FileUtil.getUriFromPath(filePath))
|
||||
if (this.downloadIndex < this.selectedList.length - 1) {
|
||||
this.downloadIndex++
|
||||
|
|
@ -228,7 +233,8 @@ struct WxVideoPage {
|
|||
this.isRefreshing = true
|
||||
}
|
||||
} else {
|
||||
this.showDownloadDialog(media instanceof VideoMaterial && media.isMerge ? DownloadStatus.VIDEO_DOWNLOADING : DownloadStatus.DOWNLOADING)
|
||||
this.showDownloadDialog(media instanceof VideoMaterial && media.isMerge ? DownloadStatus.VIDEO_DOWNLOADING :
|
||||
DownloadStatus.DOWNLOADING)
|
||||
this.download(media)
|
||||
}
|
||||
}
|
||||
|
|
@ -278,7 +284,7 @@ struct WxVideoPage {
|
|||
this.updateDownloadDialog(DownloadStatus.PROCESSING)
|
||||
}
|
||||
},
|
||||
onPause:() => {
|
||||
onPause: () => {
|
||||
this.dismissDownloadDialog()
|
||||
},
|
||||
onCancel: () => {
|
||||
|
|
@ -313,32 +319,49 @@ struct WxVideoPage {
|
|||
|
||||
showDownloadDialog(status: DownloadStatus = DownloadStatus.DOWNLOADING) {
|
||||
this.downloadStatus = status
|
||||
DownloadDialog.show(this.getUIContext(), { status: status, totalSize: 0, progress: 0, totalCount: this.selectedList.length, index: this.downloadIndex, callback: {
|
||||
confirm: () => {
|
||||
if (this.downloadStatus === DownloadStatus.COMPLETED) {
|
||||
EventReportGlobalManager.eventReport(EventConstants.DIALOG_GO_TO_VIEW, this.titles[this.currentIndex])
|
||||
AppUtil.getContext().eventHub.emit(EventConstants.JumpToRecordEvent, this.currentIndex)
|
||||
this.getUIContext().getRouter().back()
|
||||
} else {
|
||||
//todo 后台下载
|
||||
}
|
||||
},
|
||||
cancel: () => {
|
||||
if (this.downloadStatus !== DownloadStatus.COMPLETED) {
|
||||
if (this.mediaDownloader) {
|
||||
this.mediaDownloader.cancel()
|
||||
EventReportGlobalManager.eventReport(EventConstants.CANCEL_DOWNLOAD_VIDEO, this.selectedList[this.downloadIndex].url)
|
||||
DownloadDialog.show(this.getUIContext(), {
|
||||
status: status,
|
||||
totalSize: 0,
|
||||
progress: 0,
|
||||
totalCount: this.selectedList.length,
|
||||
index: this.downloadIndex,
|
||||
callback: {
|
||||
confirm: () => {
|
||||
if (this.downloadStatus === DownloadStatus.COMPLETED) {
|
||||
EventReportGlobalManager.eventReport(EventConstants.DIALOG_GO_TO_VIEW, this.titles[this.currentIndex])
|
||||
AppUtil.getContext().eventHub.emit(EventConstants.JumpToRecordEvent, this.currentIndex)
|
||||
this.getUIContext().getRouter().back()
|
||||
} else {
|
||||
//todo 后台下载
|
||||
}
|
||||
},
|
||||
cancel: () => {
|
||||
if (this.downloadStatus !== DownloadStatus.COMPLETED) {
|
||||
if (this.mediaDownloader) {
|
||||
this.mediaDownloader.cancel()
|
||||
EventReportGlobalManager.eventReport(EventConstants.CANCEL_DOWNLOAD_VIDEO,
|
||||
this.selectedList[this.downloadIndex].url)
|
||||
}
|
||||
} else {
|
||||
EventReportGlobalManager.eventReport(EventConstants.DIALOG_CONFIRM_SAVE_FILE,
|
||||
this.titles[this.currentIndex])
|
||||
}
|
||||
} else {
|
||||
EventReportGlobalManager.eventReport(EventConstants.DIALOG_CONFIRM_SAVE_FILE, this.titles[this.currentIndex])
|
||||
}
|
||||
}
|
||||
} })
|
||||
})
|
||||
}
|
||||
|
||||
updateDownloadDialog(status: DownloadStatus = DownloadStatus.DOWNLOADING, totalSize: number = 0, progress: number = 0, isAudio: boolean = false) {
|
||||
updateDownloadDialog(status: DownloadStatus = DownloadStatus.DOWNLOADING, totalSize: number = 0, progress: number = 0,
|
||||
isAudio: boolean = false) {
|
||||
this.downloadStatus = status
|
||||
DownloadDialog.update({ status: status, totalSize: totalSize, progress: progress, totalCount: this.selectedList.length, index: this.downloadIndex, isAudio: isAudio })
|
||||
DownloadDialog.update({
|
||||
status: status,
|
||||
totalSize: totalSize,
|
||||
progress: progress,
|
||||
totalCount: this.selectedList.length,
|
||||
index: this.downloadIndex,
|
||||
isAudio: isAudio
|
||||
})
|
||||
}
|
||||
|
||||
dismissDownloadDialog() {
|
||||
|
|
@ -396,21 +419,24 @@ struct WxVideoPage {
|
|||
}
|
||||
|
||||
checkBindStatus() {
|
||||
if (this.isPlayback && !ConfigManager.isBindWxPlaybackHelper() || !this.isPlayback && !ConfigManager.isBindWxVideoHelper()) {
|
||||
if (this.isPlayback && !ConfigManager.isBindWxPlaybackHelper() ||
|
||||
!this.isPlayback && !ConfigManager.isBindWxVideoHelper()) {
|
||||
if (LoginManager.getLastUserInfo()?.user_id !== LoginManager.getUserInfo()?.user_id) {
|
||||
TipDialog.show(this.getUIContext(), {title: '提示', content: '系统检测到您更换了账号,请重新添加助手', callback: {
|
||||
confirm: () => {
|
||||
if (this.isPlayback || !ConfigManager.isWxVideoServiceEnable()) {
|
||||
if (ConfigManager.getPlaybackJoinType() === "img") {
|
||||
this.showJoinGroupCourseDialog()
|
||||
TipDialog.show(this.getUIContext(), {
|
||||
title: '提示', content: '系统检测到您更换了账号,请重新添加助手', callback: {
|
||||
confirm: () => {
|
||||
if (this.isPlayback || !ConfigManager.isWxVideoServiceEnable()) {
|
||||
if (ConfigManager.getPlaybackJoinType() === "img") {
|
||||
this.showJoinGroupCourseDialog()
|
||||
} else {
|
||||
this.wxAuth()
|
||||
}
|
||||
} else {
|
||||
this.wxAuth()
|
||||
this.getWxServiceInfo()
|
||||
}
|
||||
} else {
|
||||
this.getWxServiceInfo()
|
||||
}
|
||||
}
|
||||
}})
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -440,7 +466,7 @@ struct WxVideoPage {
|
|||
req.nonAutomatic = true;
|
||||
req.scope = 'snsapi_userinfo';
|
||||
req.state = BuildProfile.BUNDLE_NAME + RandomUtil.getRandomInt(0, 1000) + '_video';
|
||||
req.transaction ='';
|
||||
req.transaction = '';
|
||||
|
||||
await WXApi.sendReq(AppUtil.getContext(), req)
|
||||
EventReportGlobalManager.eventReport(EventConstants.JUMP_TO_SHARE_WX_PLAYBACK, '前往微信分享直播回放')
|
||||
|
|
@ -452,12 +478,12 @@ struct WxVideoPage {
|
|||
try {
|
||||
let wxVideoConfig = ConfigManager.getWxVideoConfig()
|
||||
if (wxVideoConfig != null && LoginManager.getUserInfo()) {
|
||||
PasteboardUtil.setDataText(LoginManager.getUserInfo()!!.user_id)
|
||||
PasteboardUtil.setDataText(`${LoginManager.getUserInfo()!!.user_id}|${Constants.APP_ID}`)
|
||||
|
||||
wxVideoConfig.id = LoginManager.getUserInfo()!!.user_id
|
||||
wxVideoConfig.id = `${LoginManager.getUserInfo()!!.user_id}|${Constants.APP_ID}`
|
||||
let params = encodeURI(JSON.stringify(wxVideoConfig)).replace('+', '%20')
|
||||
let launchMiniProgramReq = new WxOpenSdk.LaunchMiniProgramReq()
|
||||
launchMiniProgramReq.userName = Constants.MINI_PROGRAM_APP_ID //拉起的小程序的原始id
|
||||
launchMiniProgramReq.userName = Constants.MINI_PROGRAM_APP_ID //拉起的小程序的原始id
|
||||
launchMiniProgramReq.path = `pages/index/index?path=share¶m=${params}`
|
||||
launchMiniProgramReq.miniprogramType = 0 //拉起小程序的类型 0-正式版 1-开发版 2-体验版
|
||||
await WXApi.sendReq(AppUtil.getContext(), launchMiniProgramReq)
|
||||
|
|
@ -482,10 +508,10 @@ struct WxVideoPage {
|
|||
* 跳转客服
|
||||
* @param service
|
||||
*/
|
||||
contactWxService(service: WxServiceEntity) {
|
||||
contactWxService(service: WxVideoServiceEntity) {
|
||||
let req = new WxOpenSdk.OpenCustomerServiceChatReq()
|
||||
req.corpId = service.corpid; // 企业ID
|
||||
req.url = service.address; // 客服URL
|
||||
req.corpId = service.corp_id; // 企业ID
|
||||
req.url = service.link; // 客服URL
|
||||
WXApi.sendReq(AppUtil.getContext(), req)
|
||||
}
|
||||
|
||||
|
|
@ -502,12 +528,15 @@ struct WxVideoPage {
|
|||
Column() {
|
||||
TitleBar({ title: this.isPlayback ? '直播回放' : '视频号' })
|
||||
|
||||
Stack({ alignContent: Alignment.TopStart }) {
|
||||
Refresh({refreshing: this.isRefreshing}) {
|
||||
Tabs({ barPosition: BarPosition.Start, controller: this.tabController }) {
|
||||
Refresh({ refreshing: this.isRefreshing }) {
|
||||
Stack({ alignContent: Alignment.TopEnd }) {
|
||||
Tabs({ barPosition: BarPosition.Start, controller: this.tabController, barModifier: this.tabBarModifier }) {
|
||||
TabContent() {
|
||||
WxVideoMaterialPage({mediaList: this.videoList, rowCount: this.videoRowCount, isPlayback: this.isPlayback,
|
||||
onShare:(video) => {
|
||||
WxVideoMaterialPage({
|
||||
mediaList: this.videoList,
|
||||
rowCount: this.videoRowCount,
|
||||
isPlayback: this.isPlayback,
|
||||
onShare: (video) => {
|
||||
this.type = 0
|
||||
this.selectedList.length = 0
|
||||
this.selectedList.push(video)
|
||||
|
|
@ -519,18 +548,24 @@ struct WxVideoPage {
|
|||
this.showSaveTip();
|
||||
},
|
||||
onItemDelete: (video) => {
|
||||
TipDialog.show(this.getUIContext(), {title: '提示', content: this.isPlayback ? '确定删除该直播回放?' : '确定删除该视频号?', callback: {
|
||||
confirm: () => {
|
||||
this.viewModel.deleteWxVideo(video.logid)
|
||||
TipDialog.show(this.getUIContext(), {
|
||||
title: '提示', content: this.isPlayback ? '确定删除该直播回放?' : '确定删除该视频号?', callback: {
|
||||
confirm: () => {
|
||||
this.viewModel.deleteWxVideo(video.logid)
|
||||
}
|
||||
}
|
||||
}})
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
.tabBar(this.tabBuilder(this.titles[0], 0))
|
||||
|
||||
TabContent() {
|
||||
WxImageMaterialPage({mediaList: this.imageList, rowCount: this.imageRowCount, isPlayback: this.isPlayback,
|
||||
onShare:(image) => {
|
||||
WxImageMaterialPage({
|
||||
mediaList: this.imageList,
|
||||
rowCount: this.imageRowCount,
|
||||
isPlayback: this.isPlayback,
|
||||
onShare: (image) => {
|
||||
this.type = 0
|
||||
this.selectedList.length = 0
|
||||
this.selectedList.push(image)
|
||||
|
|
@ -542,35 +577,27 @@ struct WxVideoPage {
|
|||
this.showSaveTip();
|
||||
},
|
||||
onItemDelete: (image) => {
|
||||
TipDialog.show(this.getUIContext(), {title: '提示', content: this.isPlayback ? '确定删除该直播回放?' : '确定删除该视频号?', callback: {
|
||||
confirm: () => {
|
||||
this.viewModel.deleteWxVideo(image.logid)
|
||||
TipDialog.show(this.getUIContext(), {
|
||||
title: '提示', content: this.isPlayback ? '确定删除该直播回放?' : '确定删除该视频号?', callback: {
|
||||
confirm: () => {
|
||||
this.viewModel.deleteWxVideo(image.logid)
|
||||
}
|
||||
}
|
||||
}})
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
.tabBar(this.tabBuilder(this.titles[1], 1))
|
||||
}
|
||||
.scrollable(false)
|
||||
/*.onSelected((index: number) => {
|
||||
.barMode(BarMode.Scrollable)
|
||||
.onSelected((index: number) => {
|
||||
this.currentIndex = index;
|
||||
})*/
|
||||
}
|
||||
.onRefreshing(() => {
|
||||
this.isRefreshing = true
|
||||
this.viewModel.videoList(this.isPlayback ? 'playback' : 'wechatvideo')
|
||||
})
|
||||
.refreshOffset(50)
|
||||
.pullToRefresh(true)
|
||||
|
||||
Row({ space: 40 }) {
|
||||
ForEach(this.titles, (title: string, index) => {
|
||||
this.tab(title, index);
|
||||
})
|
||||
Blank().layoutWeight(1)
|
||||
|
||||
Row() {
|
||||
Image($r('app.media.ic_wx_video_course')).width(16).height(16)
|
||||
Text('视频教程').fontColor($r('app.color.color_80ffffff')).fontSize(12).margin({ left: 4 })
|
||||
Image($r('app.media.ic_video_course')).width(16).height(16)
|
||||
Text('视频教程').fontColor($r('app.color.color_212226')).fontSize(12).margin({ left: 4 })
|
||||
}
|
||||
.onClick(() => {
|
||||
if (this.isPlayback) {
|
||||
|
|
@ -579,24 +606,37 @@ struct WxVideoPage {
|
|||
this.getUIContext().getRouter().pushUrl({url: RouterUrls.VIDEO_PLAYER_PAGE, params: {uri: ConfigManager.getWxVideoCourse(), title: '视频教程'}})
|
||||
}
|
||||
})
|
||||
}.padding({ left: 16, right: 16 })
|
||||
.margin({ top: 10 })
|
||||
}.layoutWeight(1)
|
||||
.height(50)
|
||||
.margin({ top: 3, right: 16 })
|
||||
}
|
||||
}
|
||||
.layoutWeight(1)
|
||||
.onRefreshing(() => {
|
||||
this.isRefreshing = true
|
||||
this.viewModel.videoList()
|
||||
})
|
||||
.refreshOffset(50)
|
||||
.pullToRefresh(true)
|
||||
}
|
||||
|
||||
Row() {
|
||||
Image(this.isPlayback ? $r('app.media.ic_playback_helper') : $r('app.media.ic_video_helper')).width(26).height(26)
|
||||
Text(this.isPlayback ? '添加直播\n回放助手' : '添加助手').margin({left: 6}).fontColor(Color.White).fontSize(12)
|
||||
Image($r('app.media.ic_arrow_dp16')).width(16).height(16).margin({left: 2})
|
||||
Image(this.isPlayback ? $r('app.media.ic_playback_helper') : $r('app.media.ic_video_helper'))
|
||||
.width(26)
|
||||
.height(26)
|
||||
Text(this.isPlayback ? '添加直播\n回放助手' : '添加助手')
|
||||
.margin({ left: 6 })
|
||||
.fontColor(this.isPlayback ? '#FF9614' : '#008EFF')
|
||||
.fontSize(12)
|
||||
Image(this.isPlayback ? $r('app.media.ic_playback_helper_arrow') : $r('app.media.ic_video_helper_arrow')).width(16).height(16).margin({ left: 2 })
|
||||
}
|
||||
.padding(8)
|
||||
.backgroundColor($r('app.color.color_333333'))
|
||||
.borderRadius({topLeft: 10, bottomLeft: 10})
|
||||
.backgroundColor(Color.White)
|
||||
.borderRadius({ topLeft: 10, bottomLeft: 10 })
|
||||
.alignRules({
|
||||
right: {anchor:'__container__', align: HorizontalAlign.End},
|
||||
bottom: {anchor:'__container__', align: VerticalAlign.Bottom},
|
||||
right: { anchor: '__container__', align: HorizontalAlign.End },
|
||||
bottom: { anchor: '__container__', align: VerticalAlign.Bottom },
|
||||
})
|
||||
.margin({bottom: 100})
|
||||
.margin({ bottom: 100 })
|
||||
.onClick(() => {
|
||||
if (this.isPlayback || !ConfigManager.isWxVideoServiceEnable()) {
|
||||
if (ConfigManager.getPlaybackJoinType() === "img") {
|
||||
|
|
@ -615,19 +655,18 @@ struct WxVideoPage {
|
|||
}
|
||||
|
||||
@Builder
|
||||
tab(tabName: string, tabIndex: number) {
|
||||
Row() {
|
||||
Text(tabName)
|
||||
.fontSize(this.currentIndex === tabIndex ? 17 : 14)
|
||||
.fontWeight(this.currentIndex === tabIndex ? FontWeight.Medium : FontWeight.Regular)
|
||||
.lineHeight(24)
|
||||
.fontColor(tabIndex === this.currentIndex ? $r("app.color.color_466afd") : $r('app.color.color_50ffffff'))
|
||||
tabBuilder(title: string, targetIndex: number) {
|
||||
Stack() {
|
||||
if (this.currentIndex === targetIndex) {
|
||||
Image($r('app.media.ic_tab_indicator')).width(27).height(11).margin({ top: 13 })
|
||||
}
|
||||
Text(title)
|
||||
.fontColor(this.currentIndex === targetIndex ? $r("app.color.color_212226") : $r('app.color.color_5c5f6c'))
|
||||
.fontSize(this.currentIndex === targetIndex ? 16 : 14)
|
||||
.fontWeight(this.currentIndex === targetIndex ? FontWeight.Medium : FontWeight.Regular)
|
||||
}
|
||||
.width('auto')
|
||||
.height('auto')
|
||||
.onClick(() => {
|
||||
this.tabController.changeIndex(tabIndex);
|
||||
this.currentIndex = tabIndex;
|
||||
})
|
||||
.height(50)
|
||||
.margin({ left: targetIndex === 0 ? 16 : 40 })
|
||||
}
|
||||
}
|
||||
|
|
@ -55,7 +55,7 @@ export struct WxImageMaterialPage {
|
|||
Row() {
|
||||
Image(this.mediaList.every(item => item.isChecked) ? $r('app.media.ic_check_true') :
|
||||
$r('app.media.ic_check_false')).width(18).height(18)
|
||||
Text('全选').fontColor($r('app.color.color_90ffffff')).fontSize(16).margin({ left: 7 })
|
||||
Text('全选').fontColor($r('app.color.color_212226')).fontSize(16).margin({ left: 7 })
|
||||
}
|
||||
.onClick(() => {
|
||||
this.isCheckAll = !this.isCheckAll;
|
||||
|
|
@ -69,9 +69,12 @@ export struct WxImageMaterialPage {
|
|||
Button('转发', { type: ButtonType.Capsule, stateEffect: true })
|
||||
.width(122)
|
||||
.height(40)
|
||||
.backgroundColor($r('app.color.color_333333'))
|
||||
.fontColor($r('app.color.color_50ffffff'))
|
||||
.fontSize(15)
|
||||
.fontColor($r('app.color.color_466afd'))
|
||||
.fontWeight(FontWeight.Medium)
|
||||
.borderWidth(1)
|
||||
.borderColor($r('app.color.color_466afd'))
|
||||
.backgroundColor(Color.Transparent)
|
||||
.onClick(() => {
|
||||
if (this.onShare) {
|
||||
const list = this.selectedItems();
|
||||
|
|
@ -88,12 +91,10 @@ export struct WxImageMaterialPage {
|
|||
Button('保存', { type: ButtonType.Capsule, stateEffect: true })
|
||||
.width(122)
|
||||
.height(40)
|
||||
.linearGradient({
|
||||
colors: [['#F62C6C', 0.0], ['#FC4F54', 1.0]],
|
||||
direction: GradientDirection.Right
|
||||
})
|
||||
.fontColor($r('app.color.color_90ffffff'))
|
||||
.fontColor(Color.White)
|
||||
.fontSize(15)
|
||||
.fontWeight(FontWeight.Medium)
|
||||
.backgroundColor($r('app.color.color_466afd'))
|
||||
.margin({ left: 12 })
|
||||
.onClick(() => {
|
||||
if (this.onSave) {
|
||||
|
|
@ -106,7 +107,7 @@ export struct WxImageMaterialPage {
|
|||
}
|
||||
})
|
||||
}
|
||||
.backgroundColor($r('app.color.color_222222'))
|
||||
.backgroundColor(Color.White)
|
||||
.padding({
|
||||
left: 16,
|
||||
top: 10,
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ export struct WxVideoMaterialPage {
|
|||
Row() {
|
||||
Image(this.mediaList.every(item => item.isChecked) ? $r('app.media.ic_check_true') :
|
||||
$r('app.media.ic_check_false')).width(18).height(18)
|
||||
Text('全选').fontColor($r('app.color.color_90ffffff')).fontSize(16).margin({ left: 7 })
|
||||
Text('全选').fontColor($r('app.color.color_212226')).fontSize(16).margin({ left: 7 })
|
||||
}
|
||||
.onClick(() => {
|
||||
this.isCheckAll = !this.isCheckAll;
|
||||
|
|
@ -68,9 +68,12 @@ export struct WxVideoMaterialPage {
|
|||
Button('转发', { type: ButtonType.Capsule, stateEffect: true })
|
||||
.width(122)
|
||||
.height(40)
|
||||
.backgroundColor($r('app.color.color_333333'))
|
||||
.fontColor($r('app.color.color_50ffffff'))
|
||||
.fontSize(15)
|
||||
.fontColor($r('app.color.color_466afd'))
|
||||
.fontWeight(FontWeight.Medium)
|
||||
.borderWidth(1)
|
||||
.borderColor($r('app.color.color_466afd'))
|
||||
.backgroundColor(Color.Transparent)
|
||||
.onClick(() => {
|
||||
if (this.onShare) {
|
||||
const list = this.selectedItems();
|
||||
|
|
@ -87,12 +90,10 @@ export struct WxVideoMaterialPage {
|
|||
Button('保存', { type: ButtonType.Capsule, stateEffect: true })
|
||||
.width(122)
|
||||
.height(40)
|
||||
.linearGradient({
|
||||
colors: [['#F62C6C', 0.0], ['#FC4F54', 1.0]],
|
||||
direction: GradientDirection.Right
|
||||
})
|
||||
.fontColor($r('app.color.color_90ffffff'))
|
||||
.fontColor(Color.White)
|
||||
.fontSize(15)
|
||||
.fontWeight(FontWeight.Medium)
|
||||
.backgroundColor($r('app.color.color_466afd'))
|
||||
.margin({ left: 12 })
|
||||
.onClick(() => {
|
||||
if (this.onSave) {
|
||||
|
|
@ -105,7 +106,7 @@ export struct WxVideoMaterialPage {
|
|||
}
|
||||
})
|
||||
}
|
||||
.backgroundColor($r('app.color.color_222222'))
|
||||
.backgroundColor(Color.White)
|
||||
.padding({
|
||||
left: 16,
|
||||
top: 10,
|
||||
|
|
@ -129,9 +130,9 @@ export struct WxVideoMaterialPage {
|
|||
})
|
||||
|
||||
Column() {
|
||||
Text('操作步骤:').fontColor($r('app.color.color_90ffffff')).fontSize(14)
|
||||
Text('操作步骤:').fontColor($r('app.color.color_212226')).fontSize(14).fontWeight(FontWeight.Medium)
|
||||
Text(this.isPlayback ? $r('app.string.wx_playback_course') : $r('app.string.wx_video_course'))
|
||||
.fontColor($r('app.color.color_50ffffff'))
|
||||
.fontColor('#4D4F57')
|
||||
.fontSize(12)
|
||||
.lineHeight(20)
|
||||
.margin({ top: 9 })
|
||||
|
|
|
|||
|
|
@ -1,13 +1,11 @@
|
|||
import { AppUtil, FileUtil, FormatUtil, NumberUtil, PasteboardUtil, StrUtil } from '@pura/harmony-utils';
|
||||
import { AppUtil, PasteboardUtil, StrUtil } from '@pura/harmony-utils';
|
||||
import { EventConstants } from '../../../common/EventConstants';
|
||||
import { RouterUrls } from '../../../common/RouterUrls';
|
||||
import { UserEntity } from '../../../entity/UserEntity';
|
||||
import { LoginManager } from '../../../manager/LoginGlobalManager';
|
||||
import { ToastUtils } from '../../../utils/ToastUtils';
|
||||
import { TextItemView } from '../../../view/TextItemView';
|
||||
import MineViewModel from '../../../viewModel/MineViewModel';
|
||||
import { router } from '@kit.ArkUI';
|
||||
import { TipDialog } from '../../../dialog/TipDialog';
|
||||
import { CommonModifier, router } from '@kit.ArkUI';
|
||||
import { fileIo, storageStatistics } from '@kit.CoreFileKit';
|
||||
import { BusinessError } from '@kit.BasicServicesKit';
|
||||
import { LoadingDialog } from '../../../dialog/LoadingDialog';
|
||||
|
|
@ -16,8 +14,12 @@ import { EventReportGlobalManager } from '../../../manager/EventReportGlobalMana
|
|||
import { WxServiceEntity } from '../../../entity/WxServiceEntity';
|
||||
import { WXApi } from '../../../utils/wechat/WXApiEventHandlerImpl';
|
||||
import * as WxOpenSdk from '@tencent/wechat_open_sdk';
|
||||
import { ScanUtil } from '@pura/picker_utils';
|
||||
import { scanCore } from '@kit.ScanKit';
|
||||
import { Constants } from '../../../common/Constants';
|
||||
import { MenuEntity, mineMenuList } from '../../../entity/MenuEntity';
|
||||
import { MediaAction, MediaType } from '../../../manager/MediaManager';
|
||||
import { VideoRecordPage } from '../record/VideoRecordPage';
|
||||
import { ImageRecordPage } from '../record/ImageRecordPage';
|
||||
import { AudioRecordPage } from '../record/AudioRecordPage';
|
||||
|
||||
@ComponentV2
|
||||
export struct MinePage {
|
||||
|
|
@ -26,11 +28,14 @@ export struct MinePage {
|
|||
@Local isLogin: boolean = LoginManager.isLogin();
|
||||
@Local userinfo?: UserEntity;
|
||||
@Local diamondInfo?: DiamondDetailEntity
|
||||
@Local cacheSize: number = 0
|
||||
@Local currentIndex: number = 0;
|
||||
@Local tabBarModifier: CommonModifier = new CommonModifier()
|
||||
|
||||
scroller: Scroller = new Scroller();
|
||||
private viewModel: MineViewModel = new MineViewModel(this.getUIContext());
|
||||
|
||||
viewModel: MineViewModel = new MineViewModel(this.getUIContext());
|
||||
private scroller: Scroller = new Scroller();
|
||||
private tabController: TabsController = new TabsController();
|
||||
private titles: Array<string> = ['视频', '图片', '音频'];
|
||||
|
||||
|
||||
@Monitor('viewModel.userEntity')
|
||||
|
|
@ -54,8 +59,8 @@ export struct MinePage {
|
|||
}
|
||||
|
||||
aboutToAppear(): void {
|
||||
this.tabBarModifier.align(Alignment.Start)
|
||||
this.initObserver();
|
||||
this.getCache()
|
||||
this.viewModel.userinfo();
|
||||
this.viewModel.getDiamondInfo()
|
||||
}
|
||||
|
|
@ -64,45 +69,9 @@ export struct MinePage {
|
|||
AppUtil.getContext().eventHub.on(EventConstants.MineRefreshEvent, () => {
|
||||
this.isLogin = LoginManager.isLogin();
|
||||
this.viewModel.userinfo();
|
||||
this.getCache();
|
||||
});
|
||||
}
|
||||
|
||||
getCache() {
|
||||
storageStatistics.getCurrentBundleStats((error: BusinessError, bundleStats: storageStatistics.BundleStats) => {
|
||||
if (error) {
|
||||
console.error('getCurrentBundleStats failed with error:' + JSON.stringify(error));
|
||||
} else {
|
||||
console.info('getCurrentBundleStats successfully:' + JSON.stringify(bundleStats));
|
||||
this.cacheSize = bundleStats.cacheSize
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Clear cache
|
||||
clearCache() {
|
||||
LoadingDialog.show(this.getUIContext())
|
||||
let cacheDir = AppUtil.getContext().cacheDir;
|
||||
fileIo.listFile(cacheDir).then((filenames) => {
|
||||
for (let i = 0; i < filenames.length; i++) {
|
||||
let dirPath = cacheDir + '/' + filenames[i];
|
||||
let isDirectory: boolean = false;
|
||||
try {
|
||||
isDirectory = fileIo.statSync(dirPath).isDirectory();
|
||||
} catch (e) {
|
||||
console.error(JSON.stringify(e));
|
||||
}
|
||||
if (isDirectory) {
|
||||
fileIo.rmdirSync(dirPath);
|
||||
} else {
|
||||
fileIo.unlinkSync(dirPath);
|
||||
}
|
||||
}
|
||||
})
|
||||
setTimeout(() => { this.getCache() }, 200)
|
||||
LoadingDialog.dismiss()
|
||||
}
|
||||
|
||||
/**
|
||||
* 跳转客服
|
||||
* @param service
|
||||
|
|
@ -119,27 +88,20 @@ export struct MinePage {
|
|||
Stack() {
|
||||
Image($r('app.media.ic_mine_top_bg'))
|
||||
.width('100%')
|
||||
.aspectRatio(0.8)
|
||||
.aspectRatio(1.465)
|
||||
.id('iv_top_bg')
|
||||
|
||||
Image(this.userinfo?.vip === 3 ? $r('app.media.ic_vip_bg2') : $r('app.media.ic_vip_bg1'))
|
||||
.width('100%')
|
||||
.aspectRatio(1.4)
|
||||
.visibility(this.userinfo?.vip !== 1 ? Visibility.Visible : Visibility.Hidden)
|
||||
.id('iv_vip_bg')
|
||||
|
||||
Column() {
|
||||
RelativeContainer() {
|
||||
Image(StrUtil.isNotEmpty(this.userinfo?.avater) ? this.userinfo?.avater : $r('app.media.ic_default_avatar'))
|
||||
.alignRules({
|
||||
left: { anchor: '__container__', align: HorizontalAlign.Start },
|
||||
right: { anchor: '__container__', align: HorizontalAlign.End }
|
||||
left: { anchor: '__container__', align: HorizontalAlign.Start }
|
||||
})
|
||||
.margin({ top: 20 })
|
||||
.margin({left: 16 })
|
||||
.padding(1)
|
||||
.borderRadius(45)
|
||||
.width(90)
|
||||
.height(90)
|
||||
.borderRadius(28)
|
||||
.width(56)
|
||||
.height(56)
|
||||
.backgroundColor(Color.White)
|
||||
.id('iv_avatar')
|
||||
.onClick(() => {
|
||||
|
|
@ -151,26 +113,20 @@ export struct MinePage {
|
|||
}
|
||||
})
|
||||
|
||||
Text('Hi! 快登录')
|
||||
Text('点击登录')
|
||||
.width(52)
|
||||
.height(18)
|
||||
.fontColor(Color.White)
|
||||
.fontSize(12)
|
||||
.fontSize(10)
|
||||
.textAlign(TextAlign.Center)
|
||||
.alignRules({
|
||||
top: { anchor: '__container__', align: VerticalAlign.Top },
|
||||
left: { anchor: 'iv_avatar', align: HorizontalAlign.End }
|
||||
left: { anchor: 'iv_avatar', align: HorizontalAlign.Start },
|
||||
right: { anchor: 'iv_avatar', align: HorizontalAlign.End },
|
||||
bottom: { anchor: 'iv_avatar', align: VerticalAlign.Bottom }
|
||||
})
|
||||
.padding({
|
||||
left: 6,
|
||||
right: 6,
|
||||
})
|
||||
.margin({ left: -25 })
|
||||
.linearGradient({
|
||||
colors: [['#F62C6C', 0.0], ['#FC4F54', 1.0]],
|
||||
direction: GradientDirection.Right
|
||||
})
|
||||
.borderRadius({ topLeft: 6, topRight: 6, bottomRight: 6 })
|
||||
.width('auto')
|
||||
.height(24)
|
||||
.margin({ bottom: -7 })
|
||||
.borderRadius(9)
|
||||
.backgroundColor($r('app.color.color_466afd'))
|
||||
.visibility(this.isLogin ? Visibility.None : Visibility.Visible)
|
||||
.id('tv_nologin_tip')
|
||||
|
||||
|
|
@ -195,14 +151,14 @@ export struct MinePage {
|
|||
.id('tv_area')
|
||||
|
||||
Text(StrUtil.isNotEmpty(this.userinfo?.name) ? this.userinfo?.name : '游客')
|
||||
.fontColor($r('app.color.color_90ffffff'))
|
||||
.fontSize(18)
|
||||
.fontColor($r('app.color.color_212226'))
|
||||
.fontSize(17)
|
||||
.fontWeight(FontWeight.Medium)
|
||||
.margin({ top: 12 })
|
||||
.margin({ left: 12, top: 4 })
|
||||
.alignRules({
|
||||
top: { anchor: 'iv_avatar', align: VerticalAlign.Bottom },
|
||||
left: { anchor: 'iv_avatar', align: HorizontalAlign.Start },
|
||||
right: { anchor: 'iv_avatar', align: HorizontalAlign.End }
|
||||
top: { anchor: 'iv_avatar', align: VerticalAlign.Top },
|
||||
left: { anchor: 'iv_avatar', align: HorizontalAlign.End },
|
||||
bottom: { anchor: 'tv_user_id', align: VerticalAlign.Top}
|
||||
})
|
||||
.width('auto')
|
||||
.height('auto')
|
||||
|
|
@ -210,7 +166,7 @@ export struct MinePage {
|
|||
|
||||
Row() {
|
||||
Text('ID:' + this.userinfo?.user_id)
|
||||
.fontColor($r('app.color.color_999999'))
|
||||
.fontColor('#53555D')
|
||||
.fontSize(14)
|
||||
.id('tv_user_id')
|
||||
Image($r('app.media.ic_copy_id'))
|
||||
|
|
@ -221,164 +177,243 @@ export struct MinePage {
|
|||
.alignRules({
|
||||
top: { anchor: 'tv_username', align: VerticalAlign.Bottom },
|
||||
left: { anchor: 'tv_username', align: HorizontalAlign.Start },
|
||||
right: { anchor: 'tv_username', align: HorizontalAlign.End }
|
||||
bottom: { anchor: 'iv_avatar', align: VerticalAlign.Bottom }
|
||||
})
|
||||
.margin({ top: 4 })
|
||||
.margin({ bottom: 4 })
|
||||
.width('auto')
|
||||
.id('layout_copy_id')
|
||||
.onClick(() => {
|
||||
if (StrUtil.isNotEmpty(this.userinfo?.user_id)) {
|
||||
PasteboardUtil.setDataTextSync(this.userinfo?.user_id!!)
|
||||
PasteboardUtil.setDataTextSync(`${this.userinfo?.user_id!!}|${Constants.APP_ID}`)
|
||||
ToastUtils.show('复制成功')
|
||||
}
|
||||
})
|
||||
|
||||
Image($r('app.media.ic_scan')).width(24).height(24)
|
||||
.alignRules({
|
||||
top: {anchor: '__container__', align: VerticalAlign.Top},
|
||||
right: {anchor: '__container__', align: HorizontalAlign.End}
|
||||
})
|
||||
.margin({ right: 20 })
|
||||
.onClick(() => {
|
||||
try {
|
||||
ScanUtil.startScanForResult({ scanTypes: [scanCore.ScanType.QR_CODE], enableMultiMode: true, enableAlbum: true})
|
||||
.then((result) => {
|
||||
const code = result.originalValue
|
||||
const array = code.split('-')
|
||||
if (code.length === 36 && array.length === 5) {
|
||||
this.getUIContext().getRouter().pushUrl({ url: RouterUrls.QRCODE_LOGIN_PAGE, params: { code: code }})
|
||||
} else {
|
||||
ToastUtils.show('无效二维码')
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
ToastUtils.show('此设备不支持二维码扫描')
|
||||
})
|
||||
} catch (e) {
|
||||
ToastUtils.show('此设备不支持二维码扫描')
|
||||
}
|
||||
})
|
||||
}
|
||||
.margin({ top: 70 })
|
||||
.width('100%')
|
||||
.height(180)
|
||||
.id('layout_userinfo')
|
||||
|
||||
Row() {
|
||||
Column() {
|
||||
Text(FormatUtil.getFormatFileSize(NumberUtil.toNumber(this.userinfo?.month_download_size!!)))
|
||||
.fontColor($r('app.color.color_90ffffff'))
|
||||
.fontSize(18)
|
||||
.fontFamily('ddp500m')
|
||||
.id('tv_month_size')
|
||||
|
||||
Text('本月流量')
|
||||
.fontColor($r("app.color.color_50ffffff"))
|
||||
.fontSize(12)
|
||||
.margin({ top: 4 })
|
||||
Row() {
|
||||
Image($r('app.media.ic_mine_setting')).width(26).height(26)
|
||||
.onClick(() => {
|
||||
this.getUIContext().getRouter().pushUrl({url: RouterUrls.SETTING_PAGE});
|
||||
EventReportGlobalManager.eventReport(EventConstants.JUMP_TO_SYSTEM_SETTING)
|
||||
})
|
||||
}
|
||||
.layoutWeight(1)
|
||||
.onClick(() => {
|
||||
this.getUIContext().getRouter().pushUrl({url: RouterUrls.DOWNLOAD_HISTORY_PAGE})
|
||||
EventReportGlobalManager.eventReport(EventConstants.JUMP_TO_DOWNLOAD_HISTORY)
|
||||
.alignRules({
|
||||
bottom: {anchor: 'iv_avatar', align: VerticalAlign.Top},
|
||||
right: {anchor: '__container__', align: HorizontalAlign.End}
|
||||
})
|
||||
|
||||
Divider().vertical(true).color('#1affffff').strokeWidth(1).height(26)
|
||||
|
||||
Column() {
|
||||
Text(this.userinfo?.month_download_count)
|
||||
.fontColor($r('app.color.color_90ffffff'))
|
||||
.fontSize(18)
|
||||
.fontFamily('ddp500m')
|
||||
.id('tv_month_count')
|
||||
|
||||
Text('本月下载')
|
||||
.fontColor($r("app.color.color_50ffffff"))
|
||||
.fontSize(12)
|
||||
.margin({ top: 4 })
|
||||
}
|
||||
.layoutWeight(1)
|
||||
.onClick(() => {
|
||||
this.getUIContext().getRouter().pushUrl({url: RouterUrls.DOWNLOAD_HISTORY_PAGE})
|
||||
EventReportGlobalManager.eventReport(EventConstants.JUMP_TO_DOWNLOAD_HISTORY)
|
||||
})
|
||||
|
||||
Divider().vertical(true).color('#1affffff').strokeWidth(1).height(26)
|
||||
|
||||
Column() {
|
||||
Text('0')
|
||||
.fontColor($r('app.color.color_90ffffff'))
|
||||
.fontSize(18)
|
||||
.fontFamily('ddp500m')
|
||||
.id('tv_task_count')
|
||||
|
||||
Text('下载任务')
|
||||
.fontColor($r("app.color.color_50ffffff"))
|
||||
.fontSize(12)
|
||||
.margin({ top: 4 })
|
||||
}
|
||||
.layoutWeight(1)
|
||||
.visibility(Visibility.None)
|
||||
.margin({ right: 20 })
|
||||
}
|
||||
.padding({ top: 9, bottom: 9 })
|
||||
.margin({ top: 100 })
|
||||
.width('100%')
|
||||
.height('auto')
|
||||
.id('layout_download_info')
|
||||
.height(70)
|
||||
|
||||
RelativeContainer() {
|
||||
Text(this.userinfo?.vip === 1 ? '素材魔方·会员' : this.userinfo?.vip_name)
|
||||
.fontColor($r('app.color.color_90ffffff'))
|
||||
.fontSize(18)
|
||||
.fontWeight(FontWeight.Bold)
|
||||
.fontFamily('almmsht')
|
||||
.id('tv_vip_name')
|
||||
.alignRules({
|
||||
bottom: { anchor: '__container__', align: VerticalAlign.Center }
|
||||
})
|
||||
Stack() {
|
||||
Image($r('app.media.ic_mine_vip_bg')).width('100%').aspectRatio(5.01)
|
||||
}
|
||||
.padding({left: 12, right: 12})
|
||||
.alignRules({
|
||||
bottom: { anchor: '__container__', align: VerticalAlign.Bottom}
|
||||
})
|
||||
.id('layout_bg')
|
||||
|
||||
Text(this.userinfo?.vip === 1 ? '点击成为会员解锁所有功能' : this.userinfo?.vip === 2 ? this.userinfo.vip_expire + ' 会员到期' : '享受永久会员专属权益')
|
||||
.fontColor($r('app.color.color_60ffffff'))
|
||||
.fontSize(14)
|
||||
.margin({ top: 8 })
|
||||
.id('tv_vip_expire')
|
||||
.alignRules({
|
||||
top: { anchor: '__container__', align: VerticalAlign.Center }
|
||||
})
|
||||
Image($r('app.media.ic_mine_vip_tag')).width(74).height(69).id('iv_vip_tag')
|
||||
|
||||
Button(this.userinfo?.vip === 1 ? '立即开通' : this.userinfo?.vip === 2 ? '立即续费' : '永久会员' , { type: ButtonType.Capsule, stateEffect: true })
|
||||
.fontColor('#291966')
|
||||
.fontSize(14)
|
||||
.fontWeight(FontWeight.Medium)
|
||||
.alignRules({
|
||||
top: { anchor: '__container__', align: VerticalAlign.Top },
|
||||
bottom: { anchor: '__container__', align: VerticalAlign.Bottom },
|
||||
right: { anchor: '__container__', align: HorizontalAlign.End }
|
||||
})
|
||||
Column() {
|
||||
Row() {
|
||||
Text(this.userinfo?.vip === 1 ? '会员办理' : this.userinfo?.vip_name)
|
||||
.fontSize(18)
|
||||
.fontFamily('ysbth')
|
||||
.blendMode(BlendMode.DST_IN, BlendApplyType.OFFSCREEN)
|
||||
}
|
||||
.linearGradient({
|
||||
colors: [['#D4C4F9', 0.0], ['#E9E6F9', 1.0]],
|
||||
direction: GradientDirection.Top
|
||||
})
|
||||
.width(88)
|
||||
.height(32)
|
||||
.visibility(this.userinfo?.vip === 3 ? Visibility.None : Visibility.Visible)
|
||||
.id('btn_to_vip')
|
||||
.onClick(() => {
|
||||
this.getUIContext().getRouter().pushUrl({url: RouterUrls.VIP_PAGE, params: {origin: 'center'}})
|
||||
EventReportGlobalManager.eventReport(EventConstants.JUMP_TO_MEMBER_RECHARGE, 'center')
|
||||
direction: GradientDirection.Right,
|
||||
colors: [['#FBF1DE', 0.0], ['#C59F78', 1.0]]
|
||||
})
|
||||
.blendMode(BlendMode.SRC_OVER, BlendApplyType.OFFSCREEN)
|
||||
|
||||
Text(this.userinfo?.vip === 1 ? '开通会员解锁所有功能' : this.userinfo?.vip === 2 ? this.userinfo.vip_expire + ' 会员到期' : '享受永久会员专属权益')
|
||||
.fontColor('#FBF1DE')
|
||||
.fontSize(13)
|
||||
}
|
||||
.alignRules({
|
||||
left: { anchor: 'iv_vip_tag', align: HorizontalAlign.End},
|
||||
top: { anchor: 'layout_bg', align: VerticalAlign.Top },
|
||||
bottom: { anchor: 'layout_bg', align: VerticalAlign.Bottom }
|
||||
})
|
||||
.margin({bottom: 12})
|
||||
.alignItems(HorizontalAlign.Start)
|
||||
.justifyContent(FlexAlign.Center)
|
||||
|
||||
Button({ type: ButtonType.Capsule, stateEffect: true }) {
|
||||
Row() {
|
||||
Text(this.userinfo?.vip === 1 ? '开通会员' : this.userinfo?.vip === 2 ? '立即续费' : '永久会员').fontColor('#8F6131').fontSize(14).fontWeight(FontWeight.Medium)
|
||||
Image($r('app.media.ic_mine_vip_arrow')).width(14).height(14).margin({left: 1})
|
||||
}
|
||||
}
|
||||
.alignRules({
|
||||
top: { anchor: 'layout_bg', align: VerticalAlign.Top },
|
||||
bottom: { anchor: 'layout_bg', align: VerticalAlign.Bottom },
|
||||
right: { anchor: 'layout_bg', align: HorizontalAlign.End }
|
||||
})
|
||||
.linearGradient({
|
||||
colors: [['#FFCD9E', 0.0], ['#FFEFDE', 1.0]],
|
||||
direction: GradientDirection.Top
|
||||
})
|
||||
.width('auto')
|
||||
.height(30)
|
||||
.margin({right: 28, bottom: 12})
|
||||
.padding({left: 9, top: 6, right: 7, bottom: 6})
|
||||
.visibility(this.userinfo?.vip === 3 ? Visibility.None : Visibility.Visible)
|
||||
.id('btn_to_vip')
|
||||
.onClick(() => {
|
||||
this.getUIContext().getRouter().pushUrl({url: RouterUrls.VIP_PAGE, params: {origin: 'center'}})
|
||||
EventReportGlobalManager.eventReport(EventConstants.JUMP_TO_MEMBER_RECHARGE, 'center')
|
||||
})
|
||||
}
|
||||
.margin({ left: 16, top: 10, right: 16 })
|
||||
.padding({ left: 16, right: 16 })
|
||||
.backgroundImage($r('app.media.ic_mine_vip_bg'))
|
||||
.backgroundImageSize({ width: '100%' })
|
||||
.aspectRatio(4.28)
|
||||
.id('layout_vip_info')
|
||||
.width('100%')
|
||||
.aspectRatio(4.464)
|
||||
|
||||
Stack({alignContent: Alignment.Top}) {
|
||||
Row()
|
||||
.width('100%')
|
||||
.aspectRatio(3.348)
|
||||
.linearGradient({
|
||||
colors: [['#FFFFFF', 0.0], ['#F3F5F9', 1.0]],
|
||||
direction: GradientDirection.Bottom
|
||||
})
|
||||
.borderRadius({ topLeft: 10, topRight: 10})
|
||||
|
||||
Column() {
|
||||
Text('常用工具').fontColor($r('app.color.color_212226')).fontSize(16).fontWeight(FontWeight.Medium).margin({top: 20})
|
||||
|
||||
Grid() {
|
||||
ForEach(mineMenuList().convertToArray(), (item: MenuEntity) => {
|
||||
GridItem() {
|
||||
Column() {
|
||||
Image(item.icon)
|
||||
.width(26)
|
||||
.height(26)
|
||||
Text(item.title)
|
||||
.fontColor($r('app.color.color_212226'))
|
||||
.fontSize(12)
|
||||
.margin({ top: 8 })
|
||||
}
|
||||
.alignItems(HorizontalAlign.Center)
|
||||
}
|
||||
.width('25%')
|
||||
.onClick(() => {
|
||||
switch (item.alias) {
|
||||
case 'history': {
|
||||
this.getUIContext().getRouter().pushUrl({url: RouterUrls.DOWNLOAD_HISTORY_PAGE});
|
||||
EventReportGlobalManager.eventReport(EventConstants.JUMP_TO_DOWNLOAD_HISTORY, 'center')
|
||||
break
|
||||
}
|
||||
case 'diamond': {
|
||||
this.getUIContext().getRouter().pushUrl({url: RouterUrls.RECHARGE_DIAMOND_PAGE});
|
||||
EventReportGlobalManager.eventReport(EventConstants.JUMP_TO_RECHARGE_DIAMOND, 'center')
|
||||
break
|
||||
}
|
||||
case 'feedback': {
|
||||
this.getUIContext().getRouter().pushUrl({url: RouterUrls.FEEDBACK_PAGE});
|
||||
EventReportGlobalManager.eventReport(EventConstants.JUMP_TO_FEEDBACK, 'center')
|
||||
break
|
||||
}
|
||||
case 'service': {
|
||||
if (!WXApi.isWXAppInstalled()) {
|
||||
ToastUtils.show('未安装微信客户端,请先下载安装微信客户端');
|
||||
return;
|
||||
}
|
||||
this.viewModel.getWxService()
|
||||
break
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
.maxCount(4)
|
||||
.layoutDirection(GridDirection.Row)
|
||||
.backgroundColor(Color.White)
|
||||
.borderRadius(8)
|
||||
.padding({top: 16, bottom: 16})
|
||||
.margin({top: 10})
|
||||
}
|
||||
.width('100%')
|
||||
.padding({left: 12, right: 12})
|
||||
.alignItems(HorizontalAlign.Start)
|
||||
}
|
||||
.margin({top: -12})
|
||||
|
||||
Column() {
|
||||
Row() {
|
||||
Text('我的相册')
|
||||
.fontColor($r('app.color.color_212226'))
|
||||
.fontSize(16)
|
||||
.fontWeight(FontWeight.Medium)
|
||||
.textAlign(TextAlign.Start)
|
||||
.layoutWeight(1)
|
||||
|
||||
Text(this.currentIndex === 2 ? '文件管理/我的手机/Download/素材魔方' : '文件管理/我的手机/Download/图库')
|
||||
.fontColor($r('app.color.color_999999'))
|
||||
.fontSize(12)
|
||||
.onClick(() => {
|
||||
|
||||
})
|
||||
}
|
||||
.margin({left:12, top: 27, right: 12})
|
||||
|
||||
Stack({alignContent: Alignment.TopEnd}) {
|
||||
Tabs({ barPosition: BarPosition.Start, controller: this.tabController, barModifier: this.tabBarModifier }) {
|
||||
TabContent() {
|
||||
VideoRecordPage()
|
||||
}
|
||||
.tabBar(this.tabBuilder(this.titles[0], 0))
|
||||
|
||||
TabContent() {
|
||||
ImageRecordPage()
|
||||
}
|
||||
.tabBar(this.tabBuilder(this.titles[1], 1))
|
||||
|
||||
TabContent() {
|
||||
AudioRecordPage()
|
||||
}
|
||||
.tabBar(this.tabBuilder(this.titles[2], 2))
|
||||
}
|
||||
.scrollable(false)
|
||||
.barMode(BarMode.Scrollable)
|
||||
.onTabBarClick((index) => {
|
||||
this.currentIndex = index;
|
||||
})
|
||||
|
||||
Row() {
|
||||
Image($r('app.media.ic_clear_record')).width(11).height(13)
|
||||
Text('全部清空').fontColor($r('app.color.color_999999')).fontSize(12).margin({left: 4})
|
||||
}
|
||||
.height(50)
|
||||
.margin({ top: 3, right: 16 })
|
||||
.onClick(() => {
|
||||
switch (this.currentIndex) {
|
||||
case 0: {
|
||||
AppUtil.getContext().eventHub.emit(EventConstants.MediaActionEvent, MediaType.VIDEO, MediaAction.CLEAR)
|
||||
}
|
||||
case 1: {
|
||||
AppUtil.getContext().eventHub.emit(EventConstants.MediaActionEvent, MediaType.IMAGE, MediaAction.CLEAR)
|
||||
}
|
||||
case 2: {
|
||||
AppUtil.getContext().eventHub.emit(EventConstants.MediaActionEvent, MediaType.AUDIO, MediaAction.CLEAR)
|
||||
}
|
||||
}
|
||||
})
|
||||
.visibility(this.currentIndex === 2 ? Visibility.Visible : Visibility.None)
|
||||
}
|
||||
}
|
||||
.width('100%')
|
||||
.height('100%')
|
||||
|
||||
/*Column() {
|
||||
TextItemView({ image: $r("app.media.ic_mine_icon1"), leftText: '免单挑战' })
|
||||
.height(60)
|
||||
.id('item_challenge')
|
||||
.visibility(/*this.showChallenge ? Visibility.Visible : Visibility.None*/Visibility.None)
|
||||
.visibility(*//*this.showChallenge ? Visibility.Visible : Visibility.None*//*Visibility.None)
|
||||
TextItemView({ image: $r("app.media.ic_mine_icon2"), leftText: '兑换钻石' })
|
||||
.height(60)
|
||||
.id('item_diamond')
|
||||
|
|
@ -392,7 +427,7 @@ export struct MinePage {
|
|||
TextItemView({ image: $r("app.media.ic_mine_icon4"), leftText: '分享APP' })
|
||||
.height(60)
|
||||
.id('item_share')
|
||||
.visibility(/*this.showShare ? Visibility.Visible : Visibility.None*/Visibility.None)
|
||||
.visibility(*//*this.showShare ? Visibility.Visible : Visibility.None*//*Visibility.None)
|
||||
TextItemView({ image: $r("app.media.ic_mine_icon5"), leftText: '联系客服' }).height(60).id('item_service')
|
||||
.onClick(() => {
|
||||
if (!WXApi.isWXAppInstalled()) {
|
||||
|
|
@ -419,8 +454,7 @@ export struct MinePage {
|
|||
}
|
||||
.margin({ top: 16, left: 16, right: 16 })
|
||||
.backgroundColor('#1E1D24')
|
||||
.borderRadius(8)
|
||||
.id('layout_menu')
|
||||
.borderRadius(8)*/
|
||||
|
||||
Blank().layoutWeight(1)
|
||||
}
|
||||
|
|
@ -433,4 +467,20 @@ export struct MinePage {
|
|||
.height('100%')
|
||||
.backgroundColor($r('app.color.window_background'))
|
||||
}
|
||||
|
||||
@Builder
|
||||
tabBuilder(title: string, targetIndex: number) {
|
||||
Stack() {
|
||||
if (this.currentIndex === targetIndex) {
|
||||
Image($r('app.media.ic_tab_indicator')).width(27).height(11).margin({ top: 13 })
|
||||
}
|
||||
Text(title)
|
||||
.fontColor(this.currentIndex === targetIndex ? $r("app.color.color_212226") : $r('app.color.color_5c5f6c'))
|
||||
.fontSize(this.currentIndex === targetIndex ? 16 : 14)
|
||||
.fontWeight(this.currentIndex === targetIndex ? FontWeight.Medium : FontWeight.Regular)
|
||||
}
|
||||
.width('auto')
|
||||
.height(50)
|
||||
.margin({ left: targetIndex === 0 ? 12 : 30 })
|
||||
}
|
||||
}
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
import { AppUtil } from '@pura/harmony-utils'
|
||||
import { AppUtil, FileUtil } from '@pura/harmony-utils'
|
||||
import { EventConstants } from '../../../../common/EventConstants'
|
||||
import { RouterUrls } from '../../../../common/RouterUrls'
|
||||
import { TipDialog } from '../../../../dialog/TipDialog'
|
||||
|
|
@ -10,12 +10,18 @@ import { TitleBar } from '../../../../view/TitleBar'
|
|||
import { SettingsViewModel } from '../../../../viewModel/SettingsViewModel'
|
||||
import { router } from '@kit.ArkUI'
|
||||
import { EventReportGlobalManager } from '../../../../manager/EventReportGlobalManager'
|
||||
import { fileIo, storageStatistics } from '@kit.CoreFileKit'
|
||||
import { BusinessError } from '@kit.BasicServicesKit'
|
||||
import { LoadingDialog } from '../../../../dialog/LoadingDialog'
|
||||
import { TextItemView } from '../../../../view/TextItemView'
|
||||
|
||||
@Entry
|
||||
@ComponentV2
|
||||
struct SettingsPage {
|
||||
viewModel: SettingsViewModel = new SettingsViewModel(this.getUIContext());
|
||||
|
||||
@Local cacheSize: number = 0
|
||||
|
||||
@Monitor('viewModel.destroy')
|
||||
onDestroy(monitor: IMonitor) {
|
||||
EventReportGlobalManager.eventReport(EventConstants.CANCEL_ACCOUNT)
|
||||
|
|
@ -23,6 +29,46 @@ struct SettingsPage {
|
|||
ToastUtils.show('账户已注销');
|
||||
}
|
||||
|
||||
aboutToAppear(): void {
|
||||
this.getCache()
|
||||
}
|
||||
|
||||
getCache() {
|
||||
storageStatistics.getCurrentBundleStats((error: BusinessError, bundleStats: storageStatistics.BundleStats) => {
|
||||
if (error) {
|
||||
console.error('getCurrentBundleStats failed with error:' + JSON.stringify(error));
|
||||
} else {
|
||||
console.info('getCurrentBundleStats successfully:' + JSON.stringify(bundleStats));
|
||||
this.cacheSize = bundleStats.cacheSize
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Clear cache
|
||||
clearCache() {
|
||||
LoadingDialog.show(this.getUIContext())
|
||||
let cacheDir = AppUtil.getContext().cacheDir;
|
||||
fileIo.listFile(cacheDir).then((filenames) => {
|
||||
for (let i = 0; i < filenames.length; i++) {
|
||||
let dirPath = cacheDir + '/' + filenames[i];
|
||||
let isDirectory: boolean = false;
|
||||
try {
|
||||
isDirectory = fileIo.statSync(dirPath).isDirectory();
|
||||
} catch (e) {
|
||||
console.error(JSON.stringify(e));
|
||||
}
|
||||
if (isDirectory) {
|
||||
fileIo.rmdirSync(dirPath);
|
||||
} else {
|
||||
fileIo.unlinkSync(dirPath);
|
||||
}
|
||||
}
|
||||
})
|
||||
setTimeout(() => { this.getCache() }, 200)
|
||||
LoadingDialog.dismiss()
|
||||
}
|
||||
|
||||
|
||||
logout() {
|
||||
LoginManager.saveLastUserInfo(LoginManager.getUserInfo()!!);
|
||||
ConfigManager.saveBindWxPlaybackHelper(false);
|
||||
|
|
@ -34,30 +80,42 @@ struct SettingsPage {
|
|||
|
||||
build() {
|
||||
Column() {
|
||||
TitleBar({ title: '设置' }).width('100%')
|
||||
TitleBar({ title: '设置' }).width('100%').backgroundColor(Color.White)
|
||||
Scroll() {
|
||||
Column() {
|
||||
TextItemChildView({ text: '意见反馈' }).height(60).margin({ left: 16, right: 16 })
|
||||
.onClick(() => {
|
||||
this.getUIContext().getRouter().pushUrl({url: RouterUrls.FEEDBACK_PAGE})
|
||||
EventReportGlobalManager.eventReport(EventConstants.JUMP_TO_FEEDBACK, 'center')
|
||||
})
|
||||
TextItemChildView({ text: '账号绑定' }).height(60).margin({ left: 16, right: 16 })
|
||||
TextItemChildView({ text: '账号绑定' }).height(60).padding({ left: 16, right: 16 })
|
||||
.backgroundColor(Color.White)
|
||||
.onClick(() => {
|
||||
this.getUIContext().getRouter().pushUrl({url: RouterUrls.BIND_ACCOUNT_PAGE});
|
||||
EventReportGlobalManager.eventReport(EventConstants.JUMP_TO_ACCOUNT_BIND)
|
||||
})
|
||||
TextItemChildView({ text: '账号管理' }).height(60).margin({ left: 16, right: 16 })
|
||||
TextItemChildView({ text: '账号管理' }).height(60).padding({ left: 16, right: 16 })
|
||||
.backgroundColor(Color.White)
|
||||
.onClick(() => {
|
||||
this.getUIContext().getRouter().pushUrl({url: RouterUrls.MANAGE_ACCOUNT_PAGE});
|
||||
EventReportGlobalManager.eventReport(EventConstants.JUMP_TO_ACCOUNT_MANAGE)
|
||||
})
|
||||
TextItemChildView({ text: '关于我们' }).height(60).margin({ left: 16, right: 16 })
|
||||
Divider().strokeWidth(10).color($r('app.color.color_eff2f7'))
|
||||
TextItemChildView({ text: '清除缓存', rightText: FileUtil.getFormatFileSize(this.cacheSize) }).height(60)
|
||||
.backgroundColor(Color.White)
|
||||
.padding({ left: 16, right: 16 })
|
||||
.onClick(() => {
|
||||
if (this.cacheSize > 0) {
|
||||
TipDialog.show(this.getUIContext(), {title: '提示', content: '确定清除缓存?', callback: {
|
||||
confirm: () => {
|
||||
this.clearCache()
|
||||
}
|
||||
}})
|
||||
}
|
||||
})
|
||||
TextItemChildView({ text: '关于我们' }).height(60).padding({ left: 16, right: 16 })
|
||||
.backgroundColor(Color.White)
|
||||
.onClick(() => {
|
||||
this.getUIContext().getRouter().pushUrl({url: RouterUrls.ABOUT_PAGE});
|
||||
EventReportGlobalManager.eventReport(EventConstants.JUMP_TO_ABOUT_US)
|
||||
})
|
||||
TextItemChildView({ text: '注销账号' }).height(60).margin({ left: 16, right: 16 })
|
||||
TextItemChildView({ text: '注销账号' }).height(60).padding({ left: 16, right: 16 })
|
||||
.backgroundColor(Color.White)
|
||||
.onClick(() => {
|
||||
TipDialog.show(this.getUIContext(), {title: '提示', content: '为了您的账户安全,注销账户后将会永久清除与该账户相关的所有信息,服务器不再保存', callback: {
|
||||
confirm: () => {
|
||||
|
|
@ -77,10 +135,7 @@ struct SettingsPage {
|
|||
.fontColor(Color.White)
|
||||
.fontSize(15)
|
||||
.fontWeight(FontWeight.Medium)
|
||||
.linearGradient({
|
||||
colors: [['#F62C6C', 0.0], ['#FC4F54', 1.0]],
|
||||
direction: GradientDirection.Right
|
||||
})
|
||||
.backgroundColor($r('app.color.color_466afd'))
|
||||
.width('100%')
|
||||
.height(46)
|
||||
.onClick(() => {
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ struct AboutPage {
|
|||
TitleBar({ title: '关于' }).width('100%')
|
||||
Image($r('app.media.ic_login_logo')).width(100).height(100).margin({ top: 100 })
|
||||
Text($r('app.string.app_name'))
|
||||
.fontColor(Color.White)
|
||||
.fontColor($r('app.color.color_1a1a1a'))
|
||||
.fontSize(16)
|
||||
.fontWeight(FontWeight.Medium)
|
||||
.margin({ top: 16 })
|
||||
|
|
|
|||
|
|
@ -78,8 +78,8 @@ export struct AudioRecordPage {
|
|||
|
||||
EmptyView({
|
||||
status: this.mediaList.length > 0 ? PageStatus.GONE : PageStatus.NO_DATA,
|
||||
noDataImage: $r('app.media.ic_empty_audio'),
|
||||
noDataText: '暂无音频'
|
||||
noDataImage: $r('app.media.ic_empty_data'),
|
||||
noDataText: '暂无数据'
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -93,8 +93,8 @@ export struct ImageRecordPage {
|
|||
|
||||
EmptyView({
|
||||
status: this.mediaList.length > 0 ? PageStatus.GONE : PageStatus.NO_DATA,
|
||||
noDataImage: $r('app.media.ic_empty_image'),
|
||||
noDataText: '暂无图片'
|
||||
noDataImage: $r('app.media.ic_empty_data'),
|
||||
noDataText: '暂无数据'
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,137 +0,0 @@
|
|||
import { TitleBar } from '../../../view/TitleBar';
|
||||
import { ImageRecordPage } from './ImageRecordPage';
|
||||
import { VideoRecordPage } from './VideoRecordPage';
|
||||
import { AppUtil } from '@pura/harmony-utils';
|
||||
import { EventConstants } from '../../../common/EventConstants';
|
||||
import { MediaAction, MediaType } from '../../../manager/MediaManager';
|
||||
import { AudioRecordPage } from './AudioRecordPage';
|
||||
import { CommonModifier } from '@kit.ArkUI';
|
||||
|
||||
@ComponentV2
|
||||
export struct RecordPage {
|
||||
@Consumer() recordIndex: number = 0;
|
||||
@Local tabBarModifier: CommonModifier = new CommonModifier()
|
||||
@Local currentIndex: number = 0;
|
||||
@Local indicatorLeftMargin: number = 0;
|
||||
@Local indicatorWidth: number = 0;
|
||||
@Local tabsWidth: number = 0;
|
||||
|
||||
tabController: TabsController = new TabsController();
|
||||
titles: Array<string> = ['视频', '图片', '音频'];
|
||||
|
||||
aboutToAppear(): void {
|
||||
this.initObserver()
|
||||
this.tabBarModifier.align(Alignment.Start)
|
||||
}
|
||||
|
||||
initObserver() {
|
||||
AppUtil.getContext().eventHub.on(EventConstants.MediaActionEvent, (type: MediaType, action: MediaAction) => {
|
||||
if (action === MediaAction.ADD) {
|
||||
switch (type) {
|
||||
case MediaType.VIDEO: {
|
||||
if (this.currentIndex !== 0) {
|
||||
this.tabController.changeIndex(0)
|
||||
this.currentIndex = 0
|
||||
}
|
||||
break
|
||||
}
|
||||
case MediaType.IMAGE: {
|
||||
if (this.currentIndex !== 1) {
|
||||
this.tabController.changeIndex(1)
|
||||
this.currentIndex = 1
|
||||
}
|
||||
break
|
||||
}
|
||||
case MediaType.AUDIO: {
|
||||
if (this.currentIndex !== 2) {
|
||||
this.tabController.changeIndex(2)
|
||||
this.currentIndex = 2
|
||||
}
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@Builder
|
||||
tabBuilder(title: string, tabIndex: number) {
|
||||
Text(title)
|
||||
.width('auto')
|
||||
.height(50)
|
||||
.fontColor(this.currentIndex === tabIndex ? $r("app.color.color_466afd") : $r('app.color.color_50ffffff'))
|
||||
.fontSize(this.currentIndex === tabIndex ? 17 : 14)
|
||||
.fontWeight(this.currentIndex === tabIndex ? FontWeight.Medium : FontWeight.Regular)
|
||||
.margin({ left: tabIndex === 0 ? 16 : 40 })
|
||||
}
|
||||
|
||||
build() {
|
||||
Column() {
|
||||
TitleBar({title: '我的记录', showBack: false})
|
||||
Stack({alignContent: Alignment.TopEnd}) {
|
||||
Tabs({ barPosition: BarPosition.Start, controller: this.tabController, barModifier: this.tabBarModifier }) {
|
||||
TabContent() {
|
||||
VideoRecordPage()
|
||||
}
|
||||
.tabBar(this.tabBuilder(this.titles[0], 0))
|
||||
|
||||
TabContent() {
|
||||
ImageRecordPage()
|
||||
}
|
||||
.tabBar(this.tabBuilder(this.titles[1], 1))
|
||||
|
||||
TabContent() {
|
||||
AudioRecordPage()
|
||||
}
|
||||
.tabBar(this.tabBuilder(this.titles[2], 2))
|
||||
}
|
||||
.scrollable(false)
|
||||
.barMode(BarMode.Scrollable)
|
||||
.onTabBarClick((index) => {
|
||||
this.currentIndex = index;
|
||||
})
|
||||
|
||||
Row() {
|
||||
Image($r('app.media.ic_clear_record')).width(16).height(16)
|
||||
Text('全部清空').fontColor($r('app.color.color_80ffffff')).fontSize(12).margin({left: 4})
|
||||
}
|
||||
.height(50)
|
||||
.margin({ top: 3, right: 16 })
|
||||
.onClick(() => {
|
||||
switch (this.currentIndex) {
|
||||
case 0: {
|
||||
AppUtil.getContext().eventHub.emit(EventConstants.MediaActionEvent, MediaType.VIDEO, MediaAction.CLEAR)
|
||||
}
|
||||
case 1: {
|
||||
AppUtil.getContext().eventHub.emit(EventConstants.MediaActionEvent, MediaType.IMAGE, MediaAction.CLEAR)
|
||||
}
|
||||
case 2: {
|
||||
AppUtil.getContext().eventHub.emit(EventConstants.MediaActionEvent, MediaType.AUDIO, MediaAction.CLEAR)
|
||||
}
|
||||
}
|
||||
})
|
||||
.visibility(this.currentIndex === 2 ? Visibility.Visible : Visibility.None)
|
||||
}.layoutWeight(1)
|
||||
}
|
||||
.width('100%')
|
||||
.height('100%')
|
||||
.backgroundColor($r('app.color.window_background'))
|
||||
}
|
||||
|
||||
@Builder
|
||||
tab(tabName: string, tabIndex: number) {
|
||||
Row() {
|
||||
Text(tabName)
|
||||
.fontSize(this.currentIndex === tabIndex ? 17 : 14)
|
||||
.fontWeight(this.currentIndex === tabIndex ? FontWeight.Medium : FontWeight.Regular)
|
||||
.lineHeight(24)
|
||||
.fontColor(tabIndex === this.currentIndex ? $r("app.color.color_466afd") : $r('app.color.color_50ffffff'))
|
||||
}
|
||||
.width('auto')
|
||||
.height('auto')
|
||||
.onClick(() => {
|
||||
this.tabController.changeIndex(tabIndex);
|
||||
this.currentIndex = tabIndex;
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
@ -93,8 +93,8 @@ export struct VideoRecordPage {
|
|||
|
||||
EmptyView({
|
||||
status: this.mediaList.length > 0 ? PageStatus.GONE : PageStatus.NO_DATA,
|
||||
noDataImage: $r('app.media.ic_empty_video'),
|
||||
noDataText: '暂无视频'
|
||||
noDataImage: $r('app.media.ic_empty_data'),
|
||||
noDataText: '暂无数据'
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ struct VideoPlayerPage {
|
|||
|
||||
build() {
|
||||
Column() {
|
||||
TitleBar().width('100%')
|
||||
TitleBar({isDark: true}).width('100%')
|
||||
|
||||
RelativeContainer() {
|
||||
Video({
|
||||
|
|
@ -70,7 +70,7 @@ struct VideoPlayerPage {
|
|||
})
|
||||
.width('100%')
|
||||
.height('100%')
|
||||
.backgroundColor($r('app.color.window_background'))
|
||||
.backgroundColor(Color.Black)
|
||||
.controls(false) // 设置是否显示默认控制条
|
||||
.autoPlay(true) // 设置是否自动播放
|
||||
.loop(false) // 设置是否循环播放
|
||||
|
|
@ -204,6 +204,6 @@ struct VideoPlayerPage {
|
|||
}
|
||||
.width('100%')
|
||||
.height('100%')
|
||||
.backgroundColor($r('app.color.window_background'))
|
||||
.backgroundColor(Color.Black)
|
||||
}
|
||||
}
|
||||
|
|
@ -13,20 +13,9 @@ struct WebPage {
|
|||
@Local url: string = '';
|
||||
|
||||
aboutToAppear(): void {
|
||||
this.windowStage.getMainWindowSync().setWindowSystemBarProperties({
|
||||
statusBarColor: '#00000000',
|
||||
statusBarContentColor: '#000000'
|
||||
});
|
||||
this.initParams();
|
||||
}
|
||||
|
||||
aboutToDisappear(): void {
|
||||
this.windowStage.getMainWindowSync().setWindowSystemBarProperties({
|
||||
statusBarColor: '#00000000',
|
||||
statusBarContentColor: '#ffffff'
|
||||
});
|
||||
}
|
||||
|
||||
initParams() {
|
||||
const params = this.getUIContext().getRouter().getParams() as Record<string, Object>;
|
||||
if (params) {
|
||||
|
|
|
|||
|
|
@ -13,33 +13,35 @@ export struct EmptyView {
|
|||
@Param noDataImage: Resource = $r('app.media.ic_empty_data');
|
||||
@Param noDataText: string = '暂无数据';
|
||||
@Param noDataBtnText: string = ''
|
||||
|
||||
@Param noDataBtnIcon?: Resource = undefined
|
||||
@Param onBtnClick?: () => void = undefined;
|
||||
|
||||
build() {
|
||||
Stack() {
|
||||
Column() {
|
||||
Image(this.noDataImage).width(162).height(162).margin({ top: -50 })
|
||||
Text(this.noDataText).fontColor($r('app.color.color_999999')).fontSize(12).margin({ top: 10 })
|
||||
Button(this.noDataBtnText)
|
||||
.height(30)
|
||||
.fontColor($r("app.color.color_466afd"))
|
||||
.fontSize(14)
|
||||
.borderRadius(20)
|
||||
.borderWidth(1)
|
||||
.borderColor($r("app.color.color_466afd"))
|
||||
.backgroundColor(Color.Transparent)
|
||||
.padding({
|
||||
left: 10,
|
||||
right: 10
|
||||
})
|
||||
.margin({ top: 24 })
|
||||
.visibility(StrUtil.isNotEmpty(this.noDataBtnText) ? Visibility.Visible : Visibility.Hidden)
|
||||
.onClick(() => {
|
||||
if (this.onBtnClick) {
|
||||
this.onBtnClick();
|
||||
Image(this.noDataImage).width(160).height(160).margin({ top: -50 })
|
||||
Text(this.noDataText).fontColor($r('app.color.color_999999')).fontSize(12)
|
||||
Button({ type: ButtonType.Capsule, stateEffect: true }) {
|
||||
Row() {
|
||||
if (this.noDataBtnIcon) {
|
||||
Image(this.noDataBtnIcon).width(22).height(22)
|
||||
}
|
||||
})
|
||||
Text(this.noDataBtnText).fontColor(Color.White).fontSize(16).fontWeight(FontWeight.Medium)
|
||||
}
|
||||
}
|
||||
.height(46)
|
||||
.backgroundColor($r('app.color.color_466afd'))
|
||||
.padding({
|
||||
left: 22,
|
||||
right: 22
|
||||
})
|
||||
.margin({ top: 40 })
|
||||
.visibility(StrUtil.isNotEmpty(this.noDataBtnText) ? Visibility.Visible : Visibility.Hidden)
|
||||
.onClick(() => {
|
||||
if (this.onBtnClick) {
|
||||
this.onBtnClick();
|
||||
}
|
||||
})
|
||||
}.visibility(this.status === PageStatus.NO_DATA ? Visibility.Visible : Visibility.None)
|
||||
|
||||
Column() {
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
import { RouterUrls } from '../common/RouterUrls';
|
||||
import { AudioMaterial, ImageMaterial, TextMaterial, VideoMaterial } from '../entity/MaterialInfoEntity';
|
||||
|
||||
@ComponentV2
|
||||
|
|
@ -13,7 +14,7 @@ export struct VideoMaterialItemView {
|
|||
Image(this.media?.thumb)
|
||||
.width('100%')
|
||||
.height('100%')
|
||||
.borderRadius(6)
|
||||
.borderRadius({topLeft: 10, topRight: 10})
|
||||
.backgroundColor($r('app.color.color_222222'))
|
||||
.id('iv_thumb')
|
||||
|
||||
|
|
@ -26,7 +27,7 @@ export struct VideoMaterialItemView {
|
|||
})
|
||||
.onClick(() => {
|
||||
if (this.media?.play) {
|
||||
|
||||
this.getUIContext().getRouter().pushUrl({url: RouterUrls.VIDEO_PLAYER_PAGE, params: {uri: this.media.url}})
|
||||
}
|
||||
})
|
||||
|
||||
|
|
@ -40,15 +41,17 @@ export struct VideoMaterialItemView {
|
|||
.margin({ top: 6, right: 6 })
|
||||
|
||||
Stack() {
|
||||
Image($r('app.media.ic_delete_material')).height(18).width(18)
|
||||
Image($r('app.media.ic_delete_material')).height(16).width(16)
|
||||
}
|
||||
.width('100%')
|
||||
.height(34)
|
||||
.width(30)
|
||||
.height(30)
|
||||
.borderRadius(15)
|
||||
.backgroundBlurStyle(BlurStyle.Thin, { colorMode: ThemeColorMode.LIGHT })
|
||||
.alignRules({
|
||||
bottom: {anchor: '__container__', align: VerticalAlign.Bottom}
|
||||
top: {anchor: '__container__', align: VerticalAlign.Top},
|
||||
left: {anchor: '__container__', align: HorizontalAlign.Start}
|
||||
})
|
||||
.borderRadius({ bottomLeft: 6, bottomRight: 6 })
|
||||
.backdropBlur(20)
|
||||
.margin({top: 6, left: 6})
|
||||
.visibility(this.isWxVideo ? Visibility.Visible : Visibility.None)
|
||||
.onClick(() => {
|
||||
if (this.onDelete) {
|
||||
|
|
@ -59,14 +62,15 @@ export struct VideoMaterialItemView {
|
|||
|
||||
Text(this.media?.title)
|
||||
.textAlign(TextAlign.Center)
|
||||
.fontColor($r('app.color.color_50ffffff'))
|
||||
.fontColor($r('app.color.color_1a1a1a'))
|
||||
.fontSize(12)
|
||||
.maxLines(2)
|
||||
.maxLines(1)
|
||||
.textOverflow({ overflow: TextOverflow.Ellipsis })
|
||||
.ellipsisMode(EllipsisMode.END)
|
||||
.margin({ top: 10 })
|
||||
.visibility(this.isWxVideo ? Visibility.None : Visibility.Visible)
|
||||
.padding({left: 8, top: 10, right: 8, bottom: 10})
|
||||
}
|
||||
.backgroundColor(Color.White)
|
||||
.borderRadius(10)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -97,15 +101,17 @@ export struct ImageMaterialItemView {
|
|||
.margin({ top: 6, right: 6 })
|
||||
|
||||
Stack() {
|
||||
Image($r('app.media.ic_delete_material')).height(18).width(18)
|
||||
Image($r('app.media.ic_delete_material')).height(16).width(16)
|
||||
}
|
||||
.width('100%')
|
||||
.height(34)
|
||||
.width(30)
|
||||
.height(30)
|
||||
.borderRadius(15)
|
||||
.backgroundBlurStyle(BlurStyle.Thin, { colorMode: ThemeColorMode.LIGHT })
|
||||
.alignRules({
|
||||
bottom: {anchor: '__container__', align: VerticalAlign.Bottom}
|
||||
top: {anchor: '__container__', align: VerticalAlign.Top},
|
||||
left: {anchor: '__container__', align: HorizontalAlign.Start}
|
||||
})
|
||||
.borderRadius({ bottomLeft: 6, bottomRight: 6 })
|
||||
.backdropBlur(20)
|
||||
.margin({top: 6, left: 6})
|
||||
.visibility(this.isWxVideo ? Visibility.Visible : Visibility.None)
|
||||
.onClick(() => {
|
||||
if (this.onDelete) {
|
||||
|
|
@ -125,7 +131,7 @@ export struct AudioMaterialItemView {
|
|||
Row() {
|
||||
Text(this.media?.title)
|
||||
.layoutWeight(1)
|
||||
.fontColor($r('app.color.color_90ffffff'))
|
||||
.fontColor($r('app.color.color_212226'))
|
||||
.fontSize(15)
|
||||
.maxLines(2)
|
||||
.textOverflow({ overflow: TextOverflow.Ellipsis })
|
||||
|
|
@ -133,13 +139,13 @@ export struct AudioMaterialItemView {
|
|||
Image(this.media?.isChecked ? $r('app.media.ic_check_true') : $r('app.media.ic_check_false'))
|
||||
.width(18).height(18).margin({ left: 10 })
|
||||
}
|
||||
.borderRadius(6)
|
||||
.backgroundColor($r('app.color.color_222222'))
|
||||
.borderRadius(10)
|
||||
.backgroundColor(Color.White)
|
||||
.padding({
|
||||
left: 12,
|
||||
top: 16,
|
||||
top: 14,
|
||||
right: 12,
|
||||
bottom: 16
|
||||
bottom: 14
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
@ -152,19 +158,19 @@ export struct TextMaterialItemView {
|
|||
Row() {
|
||||
Text(this.media?.desc)
|
||||
.layoutWeight(1)
|
||||
.fontColor($r('app.color.color_90ffffff'))
|
||||
.fontColor($r('app.color.color_212226'))
|
||||
.fontSize(14)
|
||||
|
||||
Image(this.media?.isChecked ? $r('app.media.ic_check_true') : $r('app.media.ic_check_false'))
|
||||
.width(18).height(18).margin({ left: 10 })
|
||||
}
|
||||
.borderRadius(6)
|
||||
.backgroundColor($r('app.color.color_222222'))
|
||||
.borderRadius(10)
|
||||
.backgroundColor(Color.White)
|
||||
.padding({
|
||||
left: 12,
|
||||
top: 16,
|
||||
top: 14,
|
||||
right: 12,
|
||||
bottom: 16
|
||||
bottom: 14
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
@ -1,16 +1,22 @@
|
|||
@ComponentV2
|
||||
export struct TextItemChildView {
|
||||
@Param text: string = '';
|
||||
@Param rightText: string = '';
|
||||
@Param divider: boolean = true;
|
||||
|
||||
build() {
|
||||
Column() {
|
||||
Row() {
|
||||
Text(this.text)
|
||||
.fontColor($r('app.color.color_90ffffff'))
|
||||
.fontColor($r('app.color.color_1a1a1a'))
|
||||
.fontSize(14)
|
||||
.layoutWeight(1)
|
||||
|
||||
Text(this.rightText)
|
||||
.fontColor($r('app.color.color_666666'))
|
||||
.fontSize(15)
|
||||
.margin({ right: 1 })
|
||||
|
||||
Image($r('app.media.ic_arrow_dp16'))
|
||||
.width(16)
|
||||
.height(16)
|
||||
|
|
@ -18,7 +24,7 @@ export struct TextItemChildView {
|
|||
.layoutWeight(1)
|
||||
|
||||
Divider()
|
||||
.color($r('app.color.color_10ffffff'))
|
||||
.color($r('app.color.color_eff2f7'))
|
||||
.strokeWidth(1)
|
||||
.visibility(this.divider ? Visibility.Visible : Visibility.None)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,13 +14,13 @@ export struct TextItemView {
|
|||
.visibility(this.image ? Visibility.Visible : Visibility.None)
|
||||
|
||||
Text(this.leftText)
|
||||
.fontColor($r('app.color.color_80ffffff'))
|
||||
.fontColor($r('app.color.color_1a1a1a'))
|
||||
.fontSize(15)
|
||||
.layoutWeight(1)
|
||||
.margin({ left: 10 })
|
||||
|
||||
Text(this.rightText)
|
||||
.fontColor(Color.White)
|
||||
.fontColor($r('app.color.color_666666'))
|
||||
.fontSize(15)
|
||||
.margin({ right: 1 })
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ import { ToastUtils } from '../utils/ToastUtils';
|
|||
import { BaseViewModel } from './BaseViewModel';
|
||||
|
||||
@ObservedV2
|
||||
export class LinkRecognizeViewModel extends BaseViewModel {
|
||||
export class TakeMaterialViewModel extends BaseViewModel {
|
||||
@Trace materialInfo?: MaterialInfoEntity;
|
||||
@Trace analysisInfo?: MaterialInfoEntity;
|
||||
@Trace permissionInfo?: VipPermissionEntity;
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
import { plainToInstance } from 'class-transformer';
|
||||
import { VipPermissionEntity } from '../entity/VipPermissionEntity';
|
||||
import { WxServiceEntity } from '../entity/WxServiceEntity';
|
||||
import { WxVideoEntity } from '../entity/WxVideoEntity';
|
||||
import { WxVideoServiceEntity } from '../entity/WxVideoServiceEntity';
|
||||
import { apiService } from '../net/ApiService';
|
||||
import { ToastUtils } from '../utils/ToastUtils';
|
||||
import { BaseViewModel } from './BaseViewModel';
|
||||
|
|
@ -12,13 +12,13 @@ export class WxVideoViewModel extends BaseViewModel {
|
|||
@Trace deleteVideo?: object;
|
||||
@Trace permissionInfo?: VipPermissionEntity;
|
||||
@Trace errorCode: number = 0;
|
||||
@Trace wxService?: WxServiceEntity
|
||||
@Trace wxService?: WxVideoServiceEntity
|
||||
@Trace wxUserinfo?: object
|
||||
|
||||
async videoList(scene: string) {
|
||||
async videoList() {
|
||||
this.showLoading()
|
||||
try {
|
||||
const result = await apiService.wxVideoList(scene)
|
||||
const result = await apiService.wxVideoList()
|
||||
if (result.isSuccess()) {
|
||||
this.wxVideo = plainToInstance(WxVideoEntity, result.data);
|
||||
} else {
|
||||
|
|
@ -81,7 +81,7 @@ export class WxVideoViewModel extends BaseViewModel {
|
|||
try {
|
||||
const result = await apiService.wxVideoService()
|
||||
if (result.isSuccess()) {
|
||||
this.wxService = plainToInstance(WxServiceEntity, result.data)
|
||||
this.wxService = plainToInstance(WxVideoServiceEntity, result.data)
|
||||
} else {
|
||||
ToastUtils.show(result.message, true)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -40,6 +40,14 @@
|
|||
"name": "color_1b1b1b",
|
||||
"value": "#1B1B1B"
|
||||
},
|
||||
{
|
||||
"name": "color_5c5f6c",
|
||||
"value": "#5C5F6C"
|
||||
},
|
||||
{
|
||||
"name": "color_eff2f7",
|
||||
"value": "#EFF2F7"
|
||||
},
|
||||
|
||||
|
||||
{
|
||||
|
|
|
|||
|
Before Width: | Height: | Size: 454 B |
|
After Width: | Height: | Size: 378 B |
|
Before Width: | Height: | Size: 530 B After Width: | Height: | Size: 550 B |
|
Before Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 7.8 KiB |
|
Before Width: | Height: | Size: 9.9 KiB |
|
Before Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 3.5 KiB |
|
Before Width: | Height: | Size: 790 B |
|
After Width: | Height: | Size: 4.2 KiB |
|
Before Width: | Height: | Size: 1014 B |
|
After Width: | Height: | Size: 2.8 KiB |
|
Before Width: | Height: | Size: 892 B |
|
After Width: | Height: | Size: 3.0 KiB |
|
Before Width: | Height: | Size: 990 B |
|
Before Width: | Height: | Size: 948 B |
|
Before Width: | Height: | Size: 588 B |
|
Before Width: | Height: | Size: 808 B |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 41 KiB After Width: | Height: | Size: 48 KiB |
|
After Width: | Height: | Size: 338 B |
|
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 5.6 KiB |
|
After Width: | Height: | Size: 6.7 KiB |
|
After Width: | Height: | Size: 552 B |
|
After Width: | Height: | Size: 422 B |
|
After Width: | Height: | Size: 1.0 KiB |
|
After Width: | Height: | Size: 562 B |
|
Before Width: | Height: | Size: 2.1 KiB |