Ver código fonte

修改问题

lex 1 ano atrás
pai
commit
2b487153ae

+ 2 - 1
src/views/creation/api.ts

@@ -41,7 +41,8 @@ export const api_userMusicSave = (params: any): Promise<any> => {
 
 /** 删除 */
 export const api_userMusicRemove = (params: any): Promise<any> => {
-  return request.get('/edu-app/userMusic/remove', {
+  return request.post('/edu-app/userMusic/remove', {
+    requestType: 'form',
     params
   });
 };

+ 4 - 4
src/views/creation/edit/index.tsx

@@ -29,10 +29,10 @@ export default defineComponent({
         //   "videoUrl": "www.baidu.com",
         //   "jsonConfig": "{\"test\": \"test\"}"
         // }
-        if (!state.desc) {
-          showToast('请输入详情');
-          return;
-        }
+        // if (!state.desc) {
+        //   showToast('请输入详情');
+        //   return;
+        // }
 
         await api_userMusicSave({
           id: state.id,

+ 13 - 10
src/views/creation/index-share.tsx

@@ -118,6 +118,7 @@ export default defineComponent({
         const res = await api_openUserMusicPage({
           type: 'FORMAL',
           exclusionId: state.id,
+          sort: 1,
           ...state.params
         });
         state.listState.loading = false;
@@ -198,7 +199,6 @@ export default defineComponent({
           const res = await api_verification({
             token: Authorization
           });
-          console.log(res, 'res');
           state.loginTag = res.data;
           if (!res.data) {
             removeAuth();
@@ -210,7 +210,8 @@ export default defineComponent({
         state.musicDetail = data;
         getList();
         // 判断是视频还是音频
-        if (data.videoFilePath) {
+
+        if (data.videoUrl.lastIndexOf('mp4') !== -1) {
           state.playType = 'Video';
         } else {
           state.playType = 'Audio';
@@ -219,8 +220,9 @@ export default defineComponent({
             initAudio();
           });
         }
-      } catch {
+      } catch (err) {
         //
+        state.listState.dataShow = false;
       }
     };
 
@@ -232,16 +234,12 @@ export default defineComponent({
       state.id = to.query.id;
       state.playType = '';
       state.params.page = 1;
+      if (audioDom) audioDom.currentTime = 0;
+      state.list = [];
       __init();
     });
     return () => (
       <div class={styles.creation}>
-        <MSticky position="top">
-          <MHeader
-            border={false}
-            isBack={route.query.platformType != 'ANALYSIS'}
-          />
-        </MSticky>
         <div class={styles.playSection}>
           {state.playType === 'Video' && (
             <MVideo
@@ -328,7 +326,12 @@ export default defineComponent({
               </div>
             ),
             value: () => (
-              <div class={styles.zan} onClick={onStarChange}>
+              <div
+                class={[
+                  styles.zan,
+                  state.musicDetail.starFlag && styles.zanActive
+                ]}
+                onClick={onStarChange}>
                 <img
                   src={state.musicDetail.starFlag ? iconZanActive : iconZan}
                   class={styles.iconZan}

+ 7 - 2
src/views/creation/index.module.less

@@ -192,15 +192,20 @@
   }
 
   .zan {
-    background: #F7EEEE;
+    background: #FFFFFF;
     border-radius: 13px;
     font-size: 14px;
-    color: #FF6A6A;
+    color: #777777;
     line-height: 20px;
     padding: 4px 9px 3px;
     display: inline-flex;
     align-items: center;
 
+    &.zanActive {
+      background: #F7EEEE;
+      color: #FF6A6A;
+    }
+
     .iconZan {
       width: 18px;
       height: 18px;

+ 3 - 2
src/views/creation/index.tsx

@@ -171,6 +171,7 @@ export default defineComponent({
         await api_userMusicRemove({ id: state.id });
 
         setTimeout(() => {
+          state.deleteStatus = false;
           showToast('删除成功');
         }, 100);
 
@@ -214,7 +215,7 @@ export default defineComponent({
         state.musicDetail = data;
         getStarList();
         // 判断是视频还是音频
-        if (data.videoFilePath) {
+        if (data.videoUrl.lastIndexOf('mp4') !== -1) {
           state.playType = 'Video';
         } else {
           state.playType = 'Audio';
@@ -321,7 +322,7 @@ export default defineComponent({
               </div>
             ),
             value: () => (
-              <div class={styles.zan}>
+              <div class={[styles.zan, styles.zanActive]}>
                 <img src={iconZanActive} class={styles.iconZan} />
                 {state.musicDetail.likeNum}
               </div>

+ 1 - 1
src/views/creation/share-model/index.tsx

@@ -204,7 +204,7 @@ export default defineComponent({
             <GridItem
               icon={iconDownload}
               text="保存本地"
-              onClick={onSavePath}></GridItem>
+              onClick={() => onSavePath('')}></GridItem>
             {/* <GridItem icon={iconFirend} text="群聊"></GridItem> */}
             <GridItem
               icon={iconWeChat}