Просмотр исходного кода

1、优化优惠卷领取记录页面
2、调整直播上传大小限制页面调整

yys 6 дней назад
Родитель
Сommit
0de4f8b89d

+ 1 - 1
package.json

@@ -107,7 +107,7 @@
     "screenfull": "5.0.2",
     "sortablejs": "1.10.2",
     "tt-uploader": "^1.5.5",
-    "vod-js-sdk-v6": "^1.7.0",
+    "vod-js-sdk-v6": "1.7.0",
     "vue": "2.6.12",
     "vue-baidu-map": "^0.21.22",
     "vue-count-to": "1.0.13",

+ 17 - 1
src/components/LiveVideoUpload/index.vue

@@ -10,6 +10,7 @@
           :limit="1"
           :on-remove="handleRemove"
           :on-change="handleChange"
+          :before-upload="beforeVideoUpload"
           :auto-upload="false"
           :key="uploadKey"
         >
@@ -40,7 +41,7 @@
           <!--              status="success">-->
           <!--            </el-progress>-->
           <!--          </div>-->
-          <div slot="tip" class="el-upload__tip">只能上传mp4文件,且不超过500M</div>
+          <div slot="tip" class="el-upload__tip">只能上传mp4文件,且不超过2GB</div>
         </el-upload>
       </div>
     </el-form-item>
@@ -66,6 +67,8 @@
 import { uploadObject } from "@/utils/cos.js";
 import Pagination from "@/components/Pagination";
 
+const MAX_VIDEO_SIZE = 2 * 1024 * 1024 * 1024;
+
 export default {
   components: {
     Pagination
@@ -163,7 +166,20 @@ export default {
       this.$refs.upload.clearFiles();
       // 重置其他状态...
     },
+    beforeVideoUpload(file) {
+      if (file.size > MAX_VIDEO_SIZE) {
+        this.$message.error("上传视频大小不能超过2GB");
+        return false;
+      }
+      return true;
+    },
     handleChange(file, fileList) {
+      if (file.raw && file.raw.size > MAX_VIDEO_SIZE) {
+        this.$message.error("上传视频大小不能超过2GB");
+        this.$refs.upload.clearFiles();
+        this.fileList = [];
+        return;
+      }
       this.fileList = fileList;
       this.getVideoDuration(file.raw);
     },

+ 1 - 1
src/components/LiveVideoUpload/single.vue

@@ -43,7 +43,7 @@
 <!--              status="success">-->
 <!--            </el-progress>-->
 <!--          </div>-->
-          <div slot="tip" class="el-upload__tip">只能上传mp4文件,且不超过500M</div>
+          <div slot="tip" class="el-upload__tip">只能上传mp4文件,且不超过2GB</div>
 <!--        </el-upload>-->
       </div>
     </el-form-item>

+ 1 - 1
src/utils/cos.js

@@ -26,7 +26,7 @@ export const uploadObject = async (file, onProgress, type, callBackUp) => {
     }
 
     const cos = new COS({
-      Timeout: 1200 * 1000,
+      Timeout: 7200 * 1000,
       getAuthorization: (options, callback) => {
         callback({
           TmpSecretId: credentials.tmpSecretId,

+ 66 - 18
src/views/live/liveCouponUser/index.vue

@@ -52,24 +52,41 @@
 	  <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
 
-    <el-table   height="500" border   v-loading="loading" :data="storeCouponUserList" @selection-change="handleSelectionChange">
-      <el-table-column type="selection" width="55" align="center" />
-      <el-table-column label="ID" align="center" prop="id" />
-      <el-table-column label="会员昵称" align="center" prop="nickname" />
-      <el-table-column label="会员手机号" align="center" prop="phone" />
-      <el-table-column label="优惠券名称" align="center" prop="couponTitle" />
-      <el-table-column label="优惠券的面值" align="center" prop="couponPrice" />
-      <el-table-column label="最低消费" align="center" prop="useMinPrice" />
-      <el-table-column label="优惠券结束时间" align="center" prop="limitTime" width="180">
+    <el-table
+      height="500"
+      border
+      size="mini"
+      v-loading="loading"
+      :data="storeCouponUserList"
+    >
+      <el-table-column label="会员" min-width="120" show-overflow-tooltip>
+        <template slot-scope="scope">
+          <div class="cell-main">{{ scope.row.nickname || '-' }}</div>
+          <div class="cell-sub">{{ scope.row.phone || '-' }}</div>
+        </template>
       </el-table-column>
-      <el-table-column label="领取时间" align="center" prop="createTime" width="180"></el-table-column>
-      <el-table-column label="使用时间" align="center" prop="useTime" width="180">
+      <el-table-column label="优惠券" min-width="140" show-overflow-tooltip>
+        <template slot-scope="scope">
+          <div class="cell-main">{{ scope.row.couponTitle || '-' }}</div>
+          <div class="cell-sub">面值 {{ scope.row.couponPrice }} / 满 {{ scope.row.useMinPrice }}</div>
+        </template>
       </el-table-column>
-      <!-- <el-table-column label="获取方式" align="center" prop="type" /> -->
-      <el-table-column label="状态" align="center" prop="status" >
-          <template slot-scope="scope">
-              <el-tag prop="status" v-for="(item, index) in statusOptions"    v-if="scope.row.status==item.dictValue">{{item.dictLabel}}</el-tag>
-          </template>
+      <el-table-column label="领取/有效期" min-width="150">
+        <template slot-scope="scope">
+          <div class="cell-sub">领:{{ formatTime(scope.row.createTime) }}</div>
+          <div class="cell-sub">止:{{ formatTime(scope.row.limitTime) }}</div>
+        </template>
+      </el-table-column>
+      <el-table-column label="核销信息" min-width="150">
+        <template slot-scope="scope">
+          <div class="cell-main">{{ scope.row.verifyUserName || '-' }}</div>
+          <div class="cell-sub">{{ formatTime(scope.row.verifyTime || scope.row.useTime) }}</div>
+        </template>
+      </el-table-column>
+      <el-table-column label="状态" width="80" align="center">
+        <template slot-scope="scope">
+          <el-tag size="mini" :type="statusTagType(scope.row.status)">{{ statusLabel(scope.row.status) }}</el-tag>
+        </template>
       </el-table-column>
     </el-table>
 
@@ -165,12 +182,31 @@ export default {
     };
   },
   created() {
-    this.getDicts("store_coupon_user_status").then((response) => {
-      this.statusOptions = response.data;
+    this.getDicts("live_coupon_user_status").then((response) => {
+      this.statusOptions = response.data || [];
     });
     this.getList();
   },
   methods: {
+    statusLabel(status) {
+      const hit = (this.statusOptions || []).find(item => String(item.dictValue) === String(status));
+      if (hit) {
+        return hit.dictLabel;
+      }
+      const fallback = { 0: "未核销", 1: "已核销", 2: "已过期" };
+      return fallback[status] != null ? fallback[status] : status;
+    },
+    statusTagType(status) {
+      const map = { 0: "info", 1: "success", 2: "danger" };
+      return map[status] || "info";
+    },
+    formatTime(val) {
+      if (!val) {
+        return "-";
+      }
+      const text = String(val).replace("T", " ");
+      return text.length >= 16 ? text.substring(0, 16) : text;
+    },
     /** 查询优惠券发放记录列表 */
     getList() {
       this.loading = true;
@@ -291,3 +327,15 @@ export default {
   }
 };
 </script>
+
+<style scoped>
+.cell-main {
+  line-height: 18px;
+  color: #303133;
+}
+.cell-sub {
+  line-height: 18px;
+  font-size: 12px;
+  color: #909399;
+}
+</style>