Ver código fonte

可以直接跳转到qq群

onecold 1 ano atrás
pai
commit
0a5839fb28

+ 2 - 2
AppScope/app.json5

@@ -2,8 +2,8 @@
   "app": {
     "bundleName": "com.xgplayer.ttmusic.hm",
     "vendor": "example",
-    "versionCode": 20250605,
-    "versionName": "1.3.9",
+    "versionCode": 20250616,
+    "versionName": "1.4.0",
     "icon": "$media:app_icon",
     "label": "$string:app_name",
     "multiAppMode": {

+ 2 - 0
entry/src/main/ets/common/constants/CommonConstants.ets

@@ -64,6 +64,8 @@ export class CommonConstants {
   static readonly TAG: string = '[UserAuth]';
   static readonly MILLISECONDS_TO_SECONDS: number = 1;
 
+  static readonly QQ_GROUP: string= "685109858"; // 替换为实际群号
+
   static readonly BREAKPOINT_TYPES: string[] = ['xs', 'sm', 'md', 'lg', 'xl'];
 
   static readonly VIDEO_FORMAT = ['.mp4','.mov','.m4v','.avi','.3gv','.wmv',

+ 6 - 3
entry/src/main/ets/pages/AboutPage.ets

@@ -3,7 +3,7 @@ import { router } from '@kit.ArkUI'
 import { CommonConstants } from '../common/constants/CommonConstants'
 import { AppUtil, DeviceUtil, DisplayUtil, ToastUtil } from '@pura/harmony-utils'
 import { Utility } from '../common/util/Utility'
-import { ConfigurationConstant } from '@kit.AbilityKit'
+import { common, ConfigurationConstant } from '@kit.AbilityKit'
 import { BreakpointTypeEnum } from '../common/util/BreakpointSystem'
 import { resourceManager } from '@kit.LocalizationKit'
 
@@ -116,8 +116,11 @@ export struct AboutPage{
               pressed: { opacity: 0.6 }
             })
             .onClick(()=>{
-              ToastUtil.showToast('复制群号成功!')
-              Utility.copyText('685109858')
+              // ToastUtil.showToast('复制群号成功!')
+              // Utility.copyText('685109858')
+              const qqUrl = `mqqapi://card/show_pslcard?src_type=internal&version=1&uin=${CommonConstants.QQ_GROUP}&card_type=group&source=external`;
+              let context = this.getUIContext().getHostContext() as common.UIAbilityContext;
+              context.openLink(qqUrl, {})
             })
 
           Button('用户反馈', { type: ButtonType.Capsule, stateEffect: false })

+ 19 - 14
entry/src/main/ets/pages/ScanFilePage.ets

@@ -69,13 +69,17 @@ export struct ScanFilePage{
 
   }
 
-  endScan(){
+  endScan(isOnekey:boolean){
     const eventData: emitter.EventData = {};
     emitter.emit({ eventId: 101 }, eventData); // 发送视频打开广播事件
 
     ToastUtil.showToast('扫描文件入库成功!')
-    this.isStart = false
-    this.isStartCover = false
+    if(isOnekey){
+      this.isStartCover = false
+    }else{
+      this.isStart = false
+
+    }
     this.strText = ''
     //结束动画
     lottie.pause()
@@ -106,22 +110,25 @@ export struct ScanFilePage{
       router.back()
 
     })
-  initState(){
+  initState(isOnekey:boolean){
 
     this.initLottie(this.path,true)
-    this.isStart = true
-    this.isStartCover = true
+    if(isOnekey){
+      this.isStartCover = true
+    }else{
+      this.isStart = true
+    }
     this.strText = Utility.resourceToString(getContext(this),$r('app.string.scaning'))
     lottie.play()
   }
 
-  doOptimize(){
+  doOptimize(isOnekey:boolean){
 
-    this.initState()
+    this.initState(isOnekey)
     const task = new taskpool.Task(scanDirectoryTask, getContext(this), this.rootPath,
       this.lockPath,PreferencesUtil.getStringSync('COVER_API',''));
     taskpool.execute(task, taskpool.Priority.HIGH).then(()=>{
-      this.endScan()
+      this.endScan(isOnekey)
     }).catch((e:object)=>{
       console.info("task1 catch e: " + e);
     })
@@ -236,7 +243,7 @@ export struct ScanFilePage{
               })
               .enabled(this.isStart ?false:true)
               .onClick(() => {
-                this.doOptimize()
+                this.doOptimize(false)
 
               })
               .alignSelf(ItemAlign.Center)
@@ -256,7 +263,7 @@ export struct ScanFilePage{
                   this.showTipsDialog()
                   return
                 }
-                this.doOptimize()
+                this.doOptimize(true)
 
               })
               .alignSelf(ItemAlign.Center)
@@ -299,7 +306,7 @@ export struct ScanFilePage{
         .fontSize(16)
 
       Row() {
-        Button('教程')
+        Button('取消')
           .fontColor(Color.White)
           .backgroundColor($r('app.color.title_bar_bg'))//.linearGradient( { direction: GradientDirection.Right, colors:[['#ff37a0fc',0.0],['#67e667',0.5],['#f5856e',1.0]]})
           .height(50)
@@ -307,8 +314,6 @@ export struct ScanFilePage{
           .stateEffect(true)
           .margin({ right: 6 })
           .onClick(() => {
-            ToastUtil.showToast('欢迎进群学习教程,复制Q群号成功!')
-            Utility.copyText('685109858')
             DialogHelper.closeDialog('tips'); //关闭弹框
           })
         Button('跳转')

+ 6 - 3
entry/src/main/ets/pages/SettingPage.ets

@@ -633,15 +633,18 @@ export struct SettingPage {
                 .margin({ left: 18, right: 6 })
                 .fontSize(15)
                 .fontColor(Color.Gray)
-              Text('欢迎进Q群讨论:685109858')
+              Text('点击进Q群讨论:685109858')
                 .margin({ right: 10 })
                 .fontSize(15)
                 .fontColor(Color.Gray)
                 .layoutWeight(1)
             }
             .onClick(() => {
-              ToastUtil.showToast('复制群号成功!')
-              Utility.copyText('685109858')
+              const qqUrl = `mqqapi://card/show_pslcard?src_type=internal&version=1&uin=${CommonConstants.QQ_GROUP}&card_type=group&source=external`;
+              let context = this.getUIContext().getHostContext() as common.UIAbilityContext;
+              context.openLink(qqUrl, {})
+              // ToastUtil.showToast('复制群号成功!')
+              // Utility.copyText('685109858')
             })
             .justifyContent(FlexAlign.Center)
             .height(55)

+ 3 - 4
entry/src/main/ets/view/LocalMusic.ets

@@ -6887,7 +6887,7 @@ export struct LocalMusic {
         .fontSize(16)
 
       Row() {
-        Button('教程')
+        Button('取消')
           .fontColor(Color.White)
           .backgroundColor($r('app.color.title_bar_bg'))//.linearGradient( { direction: GradientDirection.Right, colors:[['#ff37a0fc',0.0],['#67e667',0.5],['#f5856e',1.0]]})
           .height(50)
@@ -6895,8 +6895,6 @@ export struct LocalMusic {
           .stateEffect(true)
           .margin({ right: 6 })
           .onClick(() => {
-            ToastUtil.showToast('欢迎进群学习教程,复制Q群号成功!')
-            Utility.copyText('685109858')
             DialogHelper.closeDialog('tips'); //关闭弹框
           })
         Button('跳转')
@@ -7412,9 +7410,10 @@ export struct LocalMusic {
         this.curError = $r('app.string.current_error_hint');
         break;
       case PiPWindow.PiPState.STOPPED:
-        this.isOpenPip = false
         this.curState = 'STOPPED';
         this.curError = $r('app.string.current_error_hint');
+        this.stopPip()
+        this.destroyPipController()
         break;
       case PiPWindow.PiPState.ABOUT_TO_RESTORE:
         this.curState = 'ABOUT_TO_RESTORE';