浏览代码

添加歌手名显示

DESKTOP-SVI9JE1\muzen 1 年之前
父节点
当前提交
f72ea00ed9
共有 2 个文件被更改,包括 7 次插入3 次删除
  1. 6 2
      src/components/my-audio/my-audio.vue
  2. 1 1
      src/pages/content/index.vue

+ 6 - 2
src/components/my-audio/my-audio.vue

@@ -4,7 +4,7 @@
     <image class="pic" :src="pic" />
     <image class="pic" :src="pic" />
     <view class="info">
     <view class="info">
       <view class="song">{{ name }}</view>
       <view class="song">{{ name }}</view>
-      <view class="singer">暂无歌手名</view>
+      <view class="singer">{{ singer }}</view>
     </view>
     </view>
     <image v-if="newStatus === 1" class="btn" src="../../static/stop.png" @click="getPlay" />
     <image v-if="newStatus === 1" class="btn" src="../../static/stop.png" @click="getPlay" />
     <image v-else class="btn" src="../../static/play.png" @click="getPlay" />
     <image v-else class="btn" src="../../static/play.png" @click="getPlay" />
@@ -17,7 +17,11 @@ export default {
     bg: String,
     bg: String,
     pic: String,
     pic: String,
     name: String,
     name: String,
-    status: Number
+    status: Number,
+    singer: {
+      type: String,
+      default: '暂无歌手名'
+    }
   },
   },
   data() {
   data() {
     return {
     return {

+ 1 - 1
src/pages/content/index.vue

@@ -10,7 +10,7 @@
           <img v-if="item.layoutType === 0" mode="aspectFit" :src="item.contentPic" />
           <img v-if="item.layoutType === 0" mode="aspectFit" :src="item.contentPic" />
           <!-- 音频 -->
           <!-- 音频 -->
           <my-audio v-if="item.layoutType === 1" :ref="`video${item.sort}`" :bg="form.audioBackgroundImage"
           <my-audio v-if="item.layoutType === 1" :ref="`video${item.sort}`" :bg="form.audioBackgroundImage"
-            :pic="item.contentPic" :name="item.contentName" :status="item.playStatus" @click="getPlay($event, item)" />
+            :pic="item.contentPic" :name="item.contentName" :singer="item.contentInfo.singerName" :status="item.playStatus" @click="getPlay($event, item)" />
           <!-- 歌单 、专辑 -->
           <!-- 歌单 、专辑 -->
           <my-list v-if="item.layoutType === 2" :pic="item.contentPic" :name="item.contentName" :data="item.contentInfo"
           <my-list v-if="item.layoutType === 2" :pic="item.contentPic" :name="item.contentName" :data="item.contentInfo"
             :type="item.contentType" @click="getOpen(item)" />
             :type="item.contentType" @click="getOpen(item)" />