zxl
2025-05-23 5d5b0f7ab0f34019e11901ddcd59cd8b51ea9ff9
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
<template>
  <div>
    <div class="content-goods-publish">
      <Form ref="form" :label-width="70">
        <div class="base-info-item">
          <h4>优惠券活动详情</h4>
          <div class="form-item-view">
            <FormItem label="活动名称">
              <span>{{ couponActivity.promotionName }}</span>
            </FormItem>
            <FormItem label="活动类型">
              <span v-if="couponActivity.couponActivityType === 'REGISTERED'"
                >新人发券</span
              >
              <span v-else-if="couponActivity.couponActivityType === 'AUTO_COUPON'">自动发券</span>
              <spin v-else>精确发券</spin>
            </FormItem>
            <FormItem label="领取频率" v-if="couponActivity.couponFrequencyEnum != '' && couponActivity.couponFrequencyEnum != null && couponActivity.couponFrequencyEnum != undefined">
              <span v-if="couponActivity.couponFrequencyEnum === 'DAY'"
                >每日</span
              >
              <span v-else-if="couponActivity.couponFrequencyEnum === 'WEEK'">每周一次</span>
              <span v-else>每月一次</span>
            </FormItem>
            <FormItem
              label="活动范围"
              v-if="couponActivity.couponActivityType === 'SPECIFY' || couponActivity.couponActivityType === 'AUTO_COUPON'"
            >
              <span v-if="couponActivity.activityScope === 'ALL'">全部会员</span>
              <spin v-else>指定会员</spin>
            </FormItem>
            <FormItem label="活动时间">
              <span>{{ couponActivity.startTime }}~{{ couponActivity.endTime }}</span>
            </FormItem>
            <FormItem label="活动状态">
              <span v-if="couponActivity.promotionStatus === 'NEW'">未开始</span>
              <span v-if="couponActivity.promotionStatus === 'START'">已开始</span>
              <span v-if="couponActivity.promotionStatus === 'END'">已结束</span>
              <span v-if="couponActivity.promotionStatus === 'CLOSE'">已关闭</span>
            </FormItem>
          </div>
          <h4>优惠券列表</h4>
          <Table :columns="couponColumn" :data="couponData" ref="table"> </Table>
          <template v-if="couponActivity.activityScopeInfo && memberData.length > 0">
            <h4 class="mt_10">会员列表列表</h4>
            <Table :columns="memberColumn" :data="memberData"></Table>
          </template>
        </div>
      </Form>
    </div>
 
    <div class="footer">
      <Button type="primary" @click="back">返回活动列表</Button>
    </div>
  </div>
</template>
 
<script>
import { getCouponActivity } from "@/api/promotion";
 
export default {
  name: "coupon-activity-info",
  data() {
    return {
      id: this.$route.query.id, //表单id
      couponActivity: {}, //券活动
      couponColumn: [
        {
          title: "优惠券名称",
          key: "couponName",
        },
        {
          title: "优惠券金额",
          key: "price",
          render: (h, params) => {
            let text = "未知";
            if (params.row.couponType === "DISCOUNT") {
              text = params.row.couponDiscount + "折";
              return h("div", [text]);
            } else if (params.row.couponType === "PRICE") {
              return h("priceColorScheme", {props:{value:params.row.price,color:this.$mainColor}} );
 
            }else{
              return h("div", [text]);
            }
 
 
 
          },
        },
        {
          title: "优惠券类型",
          key: "couponType",
          render: (h, params) => {
            let text = "未知";
            if (params.row.couponType == "DISCOUNT") {
              text = "打折";
            } else if (params.row.couponType == "PRICE") {
              text = "减免现金";
            }
            return h("div", [text]);
          },
        },
        {
          title: "赠送数量",
          key: "num",
        },
      ],
      couponData: [],
      memberColumn: [
        {
          title: "会员id",
          key: "id",
        },
        {
          title: "昵称",
          key: "nickName",
        },
      ],
      memberData: [],
    };
  },
  mounted() {
    this.getCouponActivity();
  },
  methods: {
    //获取优惠券活动
    getCouponActivity() {
      getCouponActivity(this.id).then((res) => {
        this.couponActivity = res.result;
        this.couponData = this.couponActivity.couponActivityItems;
        this.memberData = JSON.parse(this.couponActivity.activityScopeInfo);
      });
    },
    back() {
      this.$store.commit("removeTag", "coupon-activity");
      this.$router.go(-1);
    },
  },
};
</script>
 
<style lang="scss" scoped>
/*选择商品品类*/
.content-goods-publish {
  padding: 15px;
  margin: 0 auto;
  text-align: center;
  border: 1px solid #ddd;
  background: none repeat 0 0 #fff;
  height: 100%;
  margin-bottom: 20px;
}
 
div.base-info-item {
  h4 {
    margin-bottom: 10px;
    padding: 0 10px;
    border: 1px solid #ddd;
    background-color: #f8f8f8;
    font-weight: bold;
    color: #333;
    font-size: 14px;
    line-height: 40px;
    text-align: left;
  }
 
  .form-item-view {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: space-between;
    padding-left: 40px;
 
    .shop-category-text {
      font-size: 12px;
    }
  }
}
/** 底部步骤 */
.footer {
  width: 88.7%;
  padding: 10px;
  background-color: #ffc;
  position: fixed;
  bottom: 0px;
  left: 10%;
  text-align: center;
  z-index: 9999;
}
</style>