Browse Source

增加代码逻辑

Young 2 years ago
parent
commit
6426c7cfce

+ 23 - 0
src/api/author.js

@@ -8,6 +8,14 @@ export function fetchList (query) {
   })
 }
 
+export function fetchVideoList (query) {
+  return axios({
+    url: '/admin/author-video/page',
+    method: 'get',
+    params: query
+  })
+}
+
 export function fetchFeedList (query) {
   return axios({
     url: '/admin/author-video/page',
@@ -31,6 +39,21 @@ export function fetchAuthor (id) {
   })
 }
 
+export function fetchAuthorByFinderUin (FinderUin) {
+  return axios({
+    url: `/admin/author/finderUin/${FinderUin}`,
+    method: 'get'
+  })
+}
+
+export function saveAuthorVideo (data) {
+  return axios({
+    url: '/admin/author-video/save',
+    method: 'post',
+    data
+  })
+}
+
 export function deleteAuthor (id) {
   return axios({
     url: `/admin/author/${id}`,

+ 60 - 98
src/views/put/PutDetails.vue

@@ -3,27 +3,29 @@
     <a-col :span="6">
       <div style="width: 200px">
         <div class="flex flex-col justify-center" style="margin-bottom: 10px">
-          <div class="text-center"><a-avatar :size="80">央</a-avatar></div>
-          <div class="username text-center">央视新闻</div>
+          <div class="text-center">
+            <a-avatar :size="80" :src="this.authorInfo.avatar">央</a-avatar>
+          </div>
+          <div class="username text-center">{{ this.authorInfo.videoAccountName }}</div>
         </div>
         <div class="flex justify-around text-center" style="margin-bottom: 5px">
           <div>
             <div>粉丝数</div>
-            <div class="num"><span>10000W</span>-<span>2000W</span></div>
+            <div class="num"><span>{{ this.authorInfo.fansCount }}</span></div>
           </div>
           <div>
             <div>发表数</div>
-            <div class="num">3128</div>
+            <div class="num">{{ this.authorInfo.sendVideoCount }}</div>
           </div>
         </div>
-        <div class="flex justify-around text-center"style="margin-bottom: 5px">
+        <div class="flex justify-around text-center" style="margin-bottom: 5px">
           <div>
             <div>投放条数</div>
-            <div class="num">3128</div>
+            <div class="num">{{ this.authorInfo.putCount }}</div>
           </div>
           <div>
-            <div>投放量</div>
-            <div class="num">3128</div>
+            <div>投放量</div>
+            <div class="num">{{ this.authorInfo.putLevelCount }}</div>
           </div>
         </div>
 
@@ -49,38 +51,38 @@
           <a-row style="background: white; margin-bottom: 20px; padding: 10px;">
 
             <a-col :span="12" style="padding-right: 20px;">
-              <div style="margin-bottom: 5px">{{ item.title }}</div>
+              <div style="margin-bottom: 5px">{{ item.desc }}</div>
               <div>{{ item.sendTime }}</div>
               <a-row>
                 <a-col :span="12">有效曝光次数:{{ item.exposureCount }}</a-col>
                 <a-col :span="12">投放量级:{{ item.putCountLevel }}</a-col>
               </a-row>
               <a-row>
-                <a-col :span="12">点赞次数:{{ item.exposureCount }}</a-col>
+                <a-col :span="12">点赞次数:{{ item.likeCount }}</a-col>
                 <a-col :span="12">投放标签:</a-col>
               </a-row>
               <a-row>
-                <a-col :span="12">完播次数:{{ item.exposureCount }}</a-col>
+                <a-col :span="12">完播次数:{{ item.playCount }}</a-col>
                 <a-col :span="12">投放年龄:</a-col>
               </a-row>
               <a-row>
-                <a-col :span="12">关注次数:{{ item.exposureCount }}</a-col>
+                <a-col :span="12">关注次数:{{ item.followCount }}</a-col>
                 <a-col :span="12">投放城市:</a-col>
               </a-row>
               <a-row>
-                <a-col :span="12">收藏次数:{{ item.exposureCount }}</a-col>
+                <a-col :span="12">收藏次数:{{ item.collectCount }}</a-col>
                 <a-col :span="12">投放性别:</a-col>
               </a-row>
               <a-row>
-                <a-col :span="12">评论次数:{{ item.exposureCount }}</a-col>
+                <a-col :span="12">评论次数:{{ item.commentCount }}</a-col>
                 <a-col :span="12">投放人:</a-col>
               </a-row>
               <a-row>
-                <a-col :span="12">点赞率:{{ 100 }}%</a-col>
+                <a-col :span="12">点赞率:{{ item.playCount / item.likeCount }}%</a-col>
                 <a-col :span="12"></a-col>
               </a-row>
               <a-row>
-                <a-col :span="12">关注率:{{ 100 }}%</a-col>
+                <a-col :span="12">关注率:{{ item.playCount / item.followCount }}%</a-col>
                 <a-col :span="12"></a-col>
               </a-row>
 
@@ -89,7 +91,9 @@
             <a-col :span="12">
               <div>
                 <video :src="item.link" style="width: 100%" controls></video>
-                <div><a-button type="primary" ghost @click="handleClickPush">投放</a-button></div>
+                <div>
+                  <a-button type="primary" ghost @click="handleClickPush(item)">投放</a-button>
+                </div>
               </div>
             </a-col>
           </a-row>
@@ -101,92 +105,33 @@
 </template>
 
 <script>
-import { fetchList } from '@/api/author'
+import { fetchVideoList, fetchAuthorByFinderUin, saveAuthorVideo } from '@/api/author'
 
 export default {
   data () {
     return {
+      loadData: parameter => {
+        console.log('loadData.parameter', parameter)
+        return fetchVideoList(Object.assign(parameter, this.queryParam)).then(res => {
+          return res
+        })
+      },
+      authorInfo: {},
       formData: {
         startTime: 0,
         endTime: 0,
-        searchValue: ''
-      },
-      tableList: [{
-        'title': '冬奥温暖瞬间冬奥温暖瞬间冬奥温暖瞬间冬奥温暖瞬间冬奥温暖瞬间冬奥温暖瞬间冬奥温暖瞬间冬奥温暖瞬间冬奥温暖瞬间冬奥温暖瞬间',
-        'sendTime': '',
-        'exposureCount': 100,
-        'likeCount': 100,
-        'playCount': 100,
-        'followCount': 100,
-        'collectCount': 100,
-        'commentCount': 100,
-        'putCountLevel': 1,
-        'putTags': '投放标签',
-        'putAge': '10-10',
-        'putCity': '北京市',
-        'putGender': 0,
-        'putUser': 'v-duzi',
-        'feedId': '231232132131321',
-        'link': 'https://cos.nosum.cn/deliver/1646557198523604.mp4'
+        searchValue: '',
+        status: 0,
+        size: 10000
       },
-      {
-        'title': '冬奥温暖瞬间冬奥温暖瞬间冬奥温暖瞬间冬奥温暖瞬间冬奥温暖瞬间冬奥温暖瞬间冬奥温暖瞬间冬奥温暖瞬间冬奥温暖瞬间冬奥温暖瞬间',
-        'sendTime': '',
-        'exposureCount': 100,
-        'likeCount': 100,
-        'playCount': 100,
-        'followCount': 100,
-        'collectCount': 100,
-        'commentCount': 100,
-        'putCountLevel': 1,
-        'putTags': '投放标签',
-        'putAge': '10-10',
-        'putCity': '北京市',
-        'putGender': 0,
-        'putUser': 'v-duzi',
-        'feedId': '231232132131321',
-        'link': 'https://cos.nosum.cn/deliver/1646557198523604.mp4'
-      },
-      {
-        'title': '冬奥温暖瞬间冬奥温暖瞬间冬奥温暖瞬间冬奥温暖瞬间冬奥温暖瞬间冬奥温暖瞬间冬奥温暖瞬间冬奥温暖瞬间冬奥温暖瞬间冬奥温暖瞬间',
-        'sendTime': '',
-        'exposureCount': 100,
-        'likeCount': 100,
-        'playCount': 100,
-        'followCount': 100,
-        'collectCount': 100,
-        'commentCount': 100,
-        'putCountLevel': 1,
-        'putTags': '投放标签',
-        'putAge': '10-10',
-        'putCity': '北京市',
-        'putGender': 0,
-        'putUser': 'v-duzi',
-        'feedId': '231232132131321',
-        'link': 'https://cos.nosum.cn/deliver/1646557198523604.mp4'
-      },
-      {
-        'title': '冬奥温暖瞬间冬奥温暖瞬间冬奥温暖瞬间冬奥温暖瞬间冬奥温暖瞬间冬奥温暖瞬间冬奥温暖瞬间冬奥温暖瞬间冬奥温暖瞬间冬奥温暖瞬间',
-        'sendTime': '',
-        'exposureCount': 100,
-        'likeCount': 100,
-        'playCount': 100,
-        'followCount': 100,
-        'collectCount': 100,
-        'commentCount': 100,
-        'putCountLevel': 1,
-        'putTags': '投放标签',
-        'putAge': '10-10',
-        'putCity': '北京市',
-        'putGender': 0,
-        'putUser': 'v-duzi',
-        'feedId': '231232132131321',
-        'link': 'https://cos.nosum.cn/deliver/1646557198523604.mp4'
-      }]
+      tableList: []
     }
   },
   created () {
-    console.log(this.$route.params)
+    console.log('参数' + this.$route.query.id)
+    fetchAuthorByFinderUin(this.$route.query.id).then(res => {
+      this.authorInfo = res.model
+    })
   },
   methods: {
     /**
@@ -194,6 +139,7 @@ export default {
      */
     handleClickSearch () {
       console.log(this.formData)
+      this.reloadData()
     },
     handleChangePicker (date, dateString) {
       console.log(date, dateString)
@@ -203,15 +149,23 @@ export default {
         this.handleClickPush()
       }
     },
-    handleClickPush () {
+    handleClickPush (item) {
       console.log(this.formData)
+      item.status = 1
+      saveAuthorVideo(item)
+      this.reloadData()
+    },
+
+    reloadData () {
       // const parems = {
       //   startXXX: this.formData.startTime
       // }
-      // this.tableList = []
-      // fetchList(Object.assign(parameter, this.queryParam)).then(res => {
-      // this.tableList = res.data
-      // })
+      this.tableList = []
+      console.log('formData = ' + JSON.stringify(this.formData))
+      fetchVideoList(this.formData).then(res => {
+        this.tableList = res.models
+        console.log(res)
+      })
     }
   }
 }
@@ -221,28 +175,36 @@ export default {
 .flex {
   display: flex;
 }
+
 .flex-col {
   flex-direction: column;
 }
+
 .flex-1 {
   flex: 1;
 }
+
 .justify-around {
   justify-content: space-around;
 }
+
 .justify-center {
   justify-content: center;
 }
+
 .items-center {
   align-items: center;
 }
+
 .text-center {
   text-align: center;
 }
+
 .num {
   color: #00A0E9;
 }
-.username{
+
+.username {
 
 }
 </style>

+ 5 - 1
src/views/put/PutFeedList.vue

@@ -6,7 +6,7 @@
         ref="table"
         size="default"
         rowKey="id"
-        :scroll="{ x: 1300 }"
+        :scroll="{ x: 2300 }"
         :columns="columns"
         :data="loadData"
         :alert="options.alert"
@@ -14,6 +14,10 @@
         showPagination="true"
       >
 
+        <span slot="summary" slot-scope="text">
+          <ellipsis :length="10" tooltip>{{ text }}</ellipsis>
+        </span>
+
         <span slot="avatar" slot-scope="text">
           <template>
             <avatar-list size="large"><avatar-list-item :src="text"/></avatar-list>

+ 2 - 2
src/views/put/PutList.vue

@@ -14,9 +14,9 @@
         showPagination="true"
       >
 
-        <span slot="avatar" slot-scope="text">
+        <span slot="avatar" slot-scope="text, record">
           <template>
-            <avatar-list size="large"><avatar-list-item style="cursor: pointer" :src="text" @click.native="$router.push(`/put/list/details?id=${text}`)" /></avatar-list>
+            <avatar-list size="large"><avatar-list-item style="cursor: pointer" :src="text" @click.native="$router.push(`/put/list/details?id=${record.finderUin}`)" /></avatar-list>
           </template>
         </span>
 

+ 4 - 2
src/views/put/putFeed-constants.js

@@ -13,12 +13,14 @@ const table = {
     {
       title: '视频',
       align: 'center',
-      dataIndex: 'link'
+      dataIndex: 'link',
+      scopedSlots: { customRender: 'summary' }
     },
     {
       title: '文案',
       align: 'center',
-      dataIndex: 'desc'
+      dataIndex: 'desc',
+      scopedSlots: { customRender: 'summary' }
     },
     {
       title: '开始时间',