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

营销活动-活动数据面板修改

DELL 3 лет назад
Родитель
Сommit
22257b50fa

+ 9 - 1
src/api/business/marketing.js

@@ -71,8 +71,16 @@ export function setMarketingStatusOff(data) {
     },
   })
 }
-
 //查询活动数据列表
+export function getMarketingDataCodeList(id) {
+  return request({
+    url: `/api/v1/mp/admin/marketing/data/codeList/${id}`,
+    method: 'post',
+    headers: {
+      'Content-Type': 'application/x-www-form-urlencoded'
+    },
+  })
+}
 export function getMarketingData(id) {
   return request({
     url: `/api/v1/mp/admin/marketing/data/${id}`,

+ 15 - 32
src/views/business/marketing/components/ActivityTable.vue

@@ -1,20 +1,21 @@
 <template>
   <div>
     <el-dialog
-      :title="this.ids.title"
+      :title="marketingData.title"
       width="1000px"
       :visible.sync="dialogVisible"
       :before-close="close"
     >
       <div class="dialog-search">
-        <div>参与用户数量:{{this.ids.realNum}}</div>
+        <div>参与用户数量:{{marketingData.realNum}}</div>
         <div class="ge"></div>
-        <div>抽奖码数量:{{marketingTotal}}</div>
+        <div>新用户数(助力用户数):{{marketingData.newUserCount}}</div>
+        <div class="ge"></div>
+        <div>抽奖码数量:{{marketingData.codeCount}}</div>
       </div>
       <el-table
         v-loading="loading"
         :data="marketingList"
-        @selection-change="handleSelectionCoupon"
         class="el-table"
       >
         <el-table-column label="用户编号" prop="userId" min-width="80" />
@@ -53,8 +54,7 @@
   </div>
 </template>
 <script>
-import { publicFileGetUrl } from "@/api/common";
-import { getMarketingData } from '@/api/business/marketing'
+import { getMarketingData, getMarketingDataCodeList } from '@/api/business/marketing'
 export default {
   name: "CouponAdd",
   props: {
@@ -70,50 +70,33 @@ export default {
   data() {
     return {
       loading: false,
-      marketingTitle: "", // 券名称
-      marketingList: [], // 卡券列表
-      marketingTotal: 0, // 卡券总数
-      selectCouponList: [], // 选中卡券
+      marketingList: [], // 列表
+      marketingTotal: 0, // 总数
       pageParams: {
         pageNum: 1,
         pageSize: 10,
       },
+      marketingData: {},//
     };
   },
   created() {
     this.getMarketingData();
   },
   methods: {
-    // 卡券列表
+    // 列表
     getMarketingData() {
       this.loading = true;
-      getMarketingData(this.ids.id ).then((res) => {
+      getMarketingDataCodeList(this.ids.id ).then((res) => {
         this.marketingList = res.rows
         this.marketingTotal = res.total;
         this.loading = false;
       });
-    },
-
-    // 选中卡券
-    handleSelectionCoupon(e) {
-      this.selectCouponList = e.map((item) => {
-        return {
-          couponNum: 1,
-          couponId: item.couponId,
-          title: item.title,
-          createdTime: item.createdTime,
-          updatedTime: item.updatedTime,
-          type: item.type,
-          discount: item.discount,
-          dueDays: item.dueDays
-        };
+      getMarketingData(this.ids.id ).then((res) => {
+        if(res.code == 0){
+          this.marketingData = res.data
+        }
       });
-    },
 
-    // 确认选中卡券
-    confirmCoupon() {
-      this.$emit("confirmCoupon", this.selectCouponList);
-      this.close()
     },
 
     close() {