Selaa lähdekoodia

1、推广视频数据同步

huangmp 2 vuotta sitten
vanhempi
commit
2d1aa6f3c2

+ 3 - 0
src/views/modules/promotion/promotionVideo-add-or-update.vue

@@ -156,6 +156,9 @@
               </el-form-item>
             </el-col>
             <el-col :span="10" :offset="1">
+              <el-form-item label="B站bv号" prop="bvid">
+                <el-input v-model="dataForm.bvid"size="small"></el-input>
+              </el-form-item>
             </el-col>
           </el-row>
           <el-row>

+ 36 - 20
src/views/modules/promotion/promotionVideo.vue

@@ -117,28 +117,27 @@
           ref="specListTable"
           :data="dataList"
           header-cell-class-name="table-header"
-          row-class-name="table-row"
-          style="width: 100%">
+          row-class-name="table-row">
           <!-- 视频ID -->
-          <el-table-column label="视频ID" prop="id" align="center">
+          <el-table-column label="视频ID" prop="id" align="center" width="70px">
             <template slot-scope="scope">
               <span>{{ scope.row.id}}</span>
             </template>
           </el-table-column>
           <!-- 推广人名称 -->
-          <el-table-column label="推广人" prop="tgUserName" align="center">
+          <el-table-column label="推广人" prop="tgUserName" align="center" width="70px">
             <template slot-scope="scope">
               <span>{{ scope.row.tgUserName}}</span>
             </template>
           </el-table-column>
           <!-- 店铺名称 -->
-          <el-table-column label="店铺" prop="shopName" align="center">
+          <el-table-column label="店铺" prop="shopName" align="center" width="80px">
             <template slot-scope="scope">
               <span>{{ scope.row.shopName}}</span>
             </template>
           </el-table-column>
           <!-- 博主ID -->
-          <el-table-column label="博主" prop="upId" align="center" width="150px">
+          <el-table-column label="博主" prop="upId" align="center" width="170px">
             <template slot-scope="scope">
               <span>{{ scope.row.upId}}</span>
               <br/>
@@ -146,12 +145,12 @@
             </template>
           </el-table-column>
           <!-- 粉丝数 -->
-          <el-table-column label="粉丝数" prop="fansNum" align="center">
+          <el-table-column label="粉丝数" prop="fansNum" align="center" width="70px">
             <template slot-scope="scope">
               <span>{{ scope.row.fansNum}}</span>
             </template>
           </el-table-column>
-          <el-table-column label="点赞数" prop="likeNum" align="center">
+          <el-table-column label="点赞数" prop="likeNum" align="center" width="70px">
             <template slot-scope="scope">
               <span>{{ scope.row.likeNum}}</span>
             </template>
@@ -169,7 +168,7 @@
             </template>
           </el-table-column>-->
           <!-- 评论数 -->
-          <el-table-column label="评论数" prop="commNum" align="center">
+          <el-table-column label="评论数" prop="commNum" align="center" width="70px">
             <template slot-scope="scope">
               <span>{{ scope.row.commNum}}</span>
             </template>
@@ -189,13 +188,13 @@
           <!-- 总点赞数 -->
 
           <!-- 总播放数 -->
-          <el-table-column label="播放数" prop="playNum" align="center">
+          <el-table-column label="播放数" prop="playNum" align="center" width="70px">
             <template slot-scope="scope">
               <span>{{ scope.row.playNum}}</span>
             </template>
           </el-table-column>
           <!-- 发布平台 -->
-          <el-table-column label="发布平台" prop="publishPlatform" align="center">
+          <el-table-column label="发布平台" prop="publishPlatform" align="center" width="80px">
             <template slot-scope="scope">
               <span>{{ scope.row.publishPlatform}}</span>
             </template>
@@ -211,7 +210,7 @@
             </template>
           </el-table-column>
           <!-- 是否付费,0寄拍,1付费 -->
-          <el-table-column label="寄拍/付费" prop="payType" align="center">
+          <el-table-column label="寄拍/付费" prop="payType" align="center" width="80px">
             <template slot-scope="scope">
               <el-tag v-if="scope.row.payType === '付费'" type="danger">付费:{{scope.row.payAmt}}</el-tag>
               <el-tag v-if="scope.row.payType === '寄拍'" type="primary">寄拍:{{scope.row.payAmt}}</el-tag>
@@ -223,13 +222,13 @@
             </template>
           </el-table-column>-->
           <!-- 结算状态 -->
-          <el-table-column label="结算状态" prop="settleStatus" align="center">
+          <el-table-column label="结算状态" prop="settleStatus" align="center" width="90px">
             <template slot-scope="scope">
               <el-tag v-if="scope.row.settleStatus === '待结算'" type="danger">待结算</el-tag>
               <el-tag v-if="scope.row.settleStatus === '已结算'" type="success">已结算</el-tag>
             </template>
           </el-table-column>
-          <el-table-column label="发布状态" prop="status" align="center">
+          <el-table-column label="发布状态" prop="status" align="center" width="90px">
             <template slot-scope="scope">
               <el-tag v-if="scope.row.status === '待发布'" type="warning">待发布</el-tag>
               <el-tag v-if="scope.row.status === '已发布'" type="success">已发布</el-tag>
@@ -243,11 +242,10 @@
           <el-table-column align="center" fixed="right" :label="$t('publics.operating')" width="auto">
             <template slot-scope="scope">
               <div class="text-btn-con">
-                <div class="default-btn text-btn" @click="addOrUpdateHandle(scope.row.id)"
-                     >{{$t("crud.updateBtn")}}</div>
-                <div class="default-btn text-btn" @click.stop="deleteHandle(scope.row.id)"
-                     >{{$t("text.delBtn")}}</div>
-                </div>
+                <div class="default-btn text-btn" @click="addOrUpdateHandle(scope.row.id)">{{$t("crud.updateBtn")}}</div>
+                <div class="default-btn text-btn" @click.stop="deleteHandle(scope.row.id)">{{$t("text.delBtn")}}</div>
+                <el-button class="default-btn text-btn" :loading="syncVisible" @click.stop="syncHandle(scope.row.id)">同步</el-button>
+              </div>
             </template>
           </el-table-column>
         </el-table>
@@ -286,6 +284,7 @@ export default {
         currentPage: 1, // 当前页数
         pageSize: 10 // 每页显示多少条
       },
+      syncVisible: false,
       shopId: this.$store.state.user.shopId,
       searchForm: {}, // 搜索
       dataListLoading: false,
@@ -317,6 +316,23 @@ export default {
     this.getShopList()
   },
   methods: {
+    syncHandle(videoId){
+      this.syncVisible = true
+      this.$http({
+        url: this.$http.adornUrl('/promotion/promotionVideo/syncVideoData'),
+        method: 'POST',
+        data: this.$http.adornData({id: videoId})
+      }).then(({ data }) => {
+        this.syncVisible = false
+        this.$message({
+          message: this.$i18n.t('publics.operation'),
+          type: 'success',
+        })
+        this.refreshChange()
+      }).catch((error) =>{
+        this.syncVisible = false
+      })
+    },
     openUploadDialog(){
       this.uploadVisible = true
       this.$nextTick(() => {
@@ -437,7 +453,7 @@ export default {
     },
     // 刷新回调
     refreshChange () {
-      this.page.currentPage = 1
+      // this.page.currentPage = 1
       this.getDataList(this.page)
     },
     searchChange (params) {