소스 검색

chore(uniapp): 提交本地前端 UI 改动

涉及文件 (非本次会话改动):
- my-uniapp-vue3/src/components/MiniPlayer.vue      (+28)
- my-uniapp-vue3/src/manifest.json                  (+2/-1)
- my-uniapp-vue3/src/pages/player/index.vue         (+56/-12)

Co-Authored-By: Claude <noreply@anthropic.com>
MyFramework User 1 개월 전
부모
커밋
652eb0bd45
3개의 변경된 파일74개의 추가작업 그리고 12개의 파일을 삭제
  1. 28 0
      my-uniapp-vue3/src/components/MiniPlayer.vue
  2. 1 1
      my-uniapp-vue3/src/manifest.json
  3. 45 11
      my-uniapp-vue3/src/pages/player/index.vue

+ 28 - 0
my-uniapp-vue3/src/components/MiniPlayer.vue

@@ -13,6 +13,9 @@
 
     <!-- 控制按钮 -->
     <view class="mini-controls">
+      <view class="mini-rate-btn" @click.stop="goToPlayer">
+        <text class="mini-rate-text">{{ audioStore.playRate }}x</text>
+      </view>
       <view class="control-btn" @click.stop="togglePlay">
         <text>{{ audioStore.isPlaying ? '⏸' : '▶' }}</text>
       </view>
@@ -166,4 +169,29 @@ function goToPlayer() {
   transform: scale(0.9);
   background: rgba(79, 70, 229, 0.18);
 }
+
+.mini-rate-btn {
+  height: 48rpx;
+  padding: 0 14rpx;
+  border-radius: 24rpx;
+  background: linear-gradient(135deg, rgba(79, 70, 229, 0.2) 0%, rgba(129, 140, 248, 0.15) 100%);
+  border: 1.5rpx solid rgba(129, 140, 248, 0.3);
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  margin-right: 6rpx;
+  transition: all 0.2s;
+}
+
+.mini-rate-btn:active {
+  transform: scale(0.9);
+  background: rgba(79, 70, 229, 0.3);
+}
+
+.mini-rate-text {
+  font-size: 22rpx;
+  color: #4f46e5;
+  font-weight: 700;
+  white-space: nowrap;
+}
 </style>

+ 1 - 1
my-uniapp-vue3/src/manifest.json

@@ -1,6 +1,6 @@
 {
     "name" : "声工坊",
-    "appid" : "__UNI__AUDIOBOOK",
+    "appid" : "__UNI__1A82A51",
     "description" : "AI有声书生成应用",
     "versionName" : "1.0.0",
     "versionCode" : "100",

+ 45 - 11
my-uniapp-vue3/src/pages/player/index.vue

@@ -15,8 +15,9 @@
         <view class="nav-btn" @click="showSleepTimerPicker = true">
           <text class="nav-icon">⏰</text>
         </view>
-        <view class="nav-btn" @click="showLyrics = !showLyrics">
+        <view class="nav-btn nav-btn-lyrics" @click="showLyrics = !showLyrics">
           <text class="nav-icon">{{ showLyrics ? '📖' : '📕' }}</text>
+          <text class="nav-btn-label">{{ showLyrics ? '隐藏歌词' : '显示歌词' }}</text>
         </view>
       </view>
     </view>
@@ -81,8 +82,9 @@
     <view class="controls">
       <!-- 左侧按钮:播放速度、下载 -->
       <view class="controls-side">
-        <view class="control-btn" @click="showRatePicker = true">
-          <text class="control-text">{{ playRate }}x</text>
+        <view class="control-btn speed-display-btn" @click="showRatePicker = true">
+          <text class="speed-label">倍速</text>
+          <text class="speed-value">{{ playRate }}x</text>
         </view>
         <AudioDownload
           :url="getFullUrl(audio?.audioUrl || '')"
@@ -194,10 +196,11 @@
 </template>
 
 <script setup lang="ts">
-import { ref, computed, watch, onMounted, onUnmounted } from 'vue';
+import { ref, watch, onMounted, onUnmounted } from 'vue';
 import { onShow } from '@dcloudio/uni-app';
 import { onLoad } from '@dcloudio/uni-app';
 import { useAudioStore } from '../../store/audio';
+import { storeToRefs } from 'pinia';
 import { get, put, post, getFullUrl } from '../../utils/request';
 import { trackEvent, AnalyticsEvents } from '../../utils/analytics';
 import type { AudioItem } from '../../types';
@@ -388,13 +391,7 @@ watch(() => audioStore.currentTime, (time) => {
 });
 
 // 从 store 获取状态
-const isPlaying = computed(() => audioStore.isPlaying);
-const currentTime = computed(() => audioStore.currentTime);
-const duration = computed(() => audioStore.duration);
-const playRate = computed(() => audioStore.playRate);
-const hasPrev = computed(() => audioStore.hasPrev);
-const hasNext = computed(() => audioStore.hasNext);
-const playlist = computed(() => audioStore.playlist);
+const { isPlaying, currentTime, duration, playRate, hasPrev, hasNext, playlist } = storeToRefs(audioStore);
 
 // 页面加载
 onMounted(async () => {
@@ -970,6 +967,18 @@ function copyShareLink(): string {
   color: #ffffff;
 }
 
+.nav-btn-lyrics {
+  width: auto;
+  padding: 0 16rpx;
+  gap: 4rpx;
+}
+
+.nav-btn-label {
+  font-size: 20rpx;
+  color: #a5b4fc;
+  white-space: nowrap;
+}
+
 .nav-title {
   font-size: 32rpx;
   font-weight: 600;
@@ -1095,6 +1104,7 @@ function copyShareLink(): string {
 
 .controls-side {
   margin-right: 16rpx;
+  gap: 12rpx;
 }
 
 .controls-center {
@@ -1134,6 +1144,30 @@ function copyShareLink(): string {
   font-weight: 600;
 }
 
+/* 播放速度显示按钮 */
+.speed-display-btn {
+  width: auto;
+  min-width: 120rpx;
+  height: 70rpx;
+  padding: 0 20rpx;
+  border-radius: 35rpx;
+  gap: 6rpx;
+  background: linear-gradient(135deg, rgba(79, 70, 229, 0.35) 0%, rgba(129, 140, 248, 0.25) 100%);
+  border: 2rpx solid rgba(129, 140, 248, 0.3);
+}
+
+.speed-label {
+  font-size: 20rpx;
+  color: #a5b4fc;
+  font-weight: 500;
+}
+
+.speed-value {
+  font-size: 28rpx;
+  color: #ffffff;
+  font-weight: 700;
+}
+
 .control-icon {
   font-size: 36rpx;
   color: #ffffff;