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
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
<template>
  <div>
    <el-tabs type="border-card" v-model="activeName" class="drawer-tabs pt16">
      <el-tab-pane label="活动信息" name="detail">
        <div class="section">
          <div class="common-form" v-if="!is_edit">活动信息</div>
          <div class="table-wrap" v-if="!is_edit">
            <el-row>
              <el-col :span="12">
                <div class="pb16 d-s-c">
                  <div class="gray9 item-title">活动标题:</div>
                  <span>{{ detailData.name }}</span>
                </div>
              </el-col>
              <el-col :span="12">
                <div class="pb16 d-s-c">
                  <div class="gray9 item-title">所属连盟:</div>
                  <span v-if="detailData.branch">{{ detailData.branch.name }}</span>
                </div>
              </el-col>
              <el-col :span="12">
                <div class="pb16 d-s-c">
                  <div class="gray9 item-title">活动分类:</div>
                  <span v-if="detailData.category">{{ detailData.category.name }}</span>
                </div>
              </el-col>
              <el-col :span="12">
                <div class="pb16 d-s-c">
                  <div class="gray9 item-title">是否显示:</div>
                  <span>{{ detailData.status ? '显示' : '不显示' }}</span>
                </div>
              </el-col>
              <el-col :span="12">
                <div class="pb16 d-s-c">
                  <div class="gray9 item-title">报名时间:</div>
                  <span>{{ detailData.register_time_text }}</span>
                </div>
              </el-col>
              <el-col :span="12">
                <div class="pb16 d-s-c">
                  <div class="gray9 item-title">活动时间:</div>
                  <span>{{ detailData.activity_time_text }}</span>
                </div>
              </el-col>
              <el-col :span="24">
                <div class="pb16 d-s-s">
                  <div class="gray9 item-title">活动简介:</div>
                  <span class="flex-1">{{ detailData.describe }}</span>
                </div>
              </el-col>
              <el-col :span="12">
                <div class="pb16 d-s-s">
                  <div class="gray9 item-title">封面图:</div>
                  <span class="flex-1" v-if="detailData.image">
                    <img v-img-url="detailData.image.file_path" height="100" />
                  </span>
                </div>
              </el-col>
              <el-col :span="12">
                <div class="pb16 d-s-s">
                  <div class="gray9 item-title">分享海报:</div>
                  <span class="flex-1" v-if="detailData.pic">
                    <el-image :src="detailData.pic.file_path" title="点击可预览" style="height:100px" :preview-src-list="[detailData.pic.file_path]" ></el-image>
                  </span>
                </div>
              </el-col>
              <el-col :span="12">
                <div class="pb16 d-s-s">
                  <div class="gray9 item-title">活动地址:</div>
                  <span class="flex-1">{{ detailData.address }}</span>
                </div>
              </el-col>
              <el-col :span="12">
                <div class="pb16 d-s-s">
                  <div class="gray9 item-title">联系电话:</div>
                  <span class="flex-1">{{ detailData.phone }}</span>
                </div>
              </el-col>
              <el-col :span="12">
                <div class="pb16 d-s-s">
                  <div class="gray9 item-title">是否走访企业:</div>
                  <span class="flex-1">{{ detailData.is_visit ? '是' : '否' }}</span>
                </div>
              </el-col>
              <el-col :span="12" v-if="detailData.is_visit">
                <div class="pb16 d-s-s">
                  <div class="gray9 item-title">走访企业对象:</div>
                  <span class="flex-1">{{ detailData.visit_supplier_id ? detailData.visitSupplier.name : '' }}</span>
                </div>
              </el-col>
              <el-col :span="12" v-else>
                <div class="pb16 d-s-s">
                  <div class="gray9 item-title">提供场地企业:</div>
                  <span class="flex-1">{{ detailData.space_supplier_id ? detailData.spaceSupplier.name : '无' }}</span>
                </div>
              </el-col>
              <el-col :span="12">
                <div class="pb16 d-s-s">
                  <div class="gray9 item-title">页面背景色:</div>
                  <div class="color-show-box">
                    <div :style="'background:'+detailData.background_color"></div>
                  </div>
                </div>
              </el-col>
              <el-col :span="12">
                <div class="pb16 d-s-c">
                  <div class="gray9 item-title">排序:</div>
                  <span>{{ detailData.sort }}</span>
                </div>
              </el-col>
              <el-col :span="24" v-if="detailData.product_list.length > 0">
                <div class="pb16 d-s-s">
                  <div class="gray9 item-title">促销商品:</div>
                  <div class="table-wrap ww100">
                    <el-table size="small" :data="detailData.product_list" border style="width: 100%">
                      <el-table-column prop="product_name" label="商品">
                        <template slot-scope="scope">
                          <div class="product-info">
                            <div class="pic"><img v-img-url="scope.row.image" /></div>
                            <div class="info">
                              <div class="name">{{ scope.row.product_name }}</div>
                              <div class="gray9" v-if="scope.row.spec_sku_id>0">{{scope.row.product_sku_name}}</div>
                            </div>
                          </div>
                        </template>
                      </el-table-column>
                      <el-table-column prop="product_price" label="原价" width="120"></el-table-column>
                      <el-table-column prop="product_new_price" label="活动价" width="120"></el-table-column>
                    </el-table>
                  </div>
                </div>
              </el-col>
              <el-col :span="24">
                <div class="pb16 d-s-s">
                  <div class="gray9 item-title">活动内容:</div>
                  <div class="flex-1" v-html="detailData.content"></div>
                </div>
              </el-col>
            </el-row>
          </div>
          <div v-else>
            <Edit ref="editForm" :form="detailData" :category="category" @success="success"></Edit>
          </div>
        </div>
      </el-tab-pane>
      <el-tab-pane label="报名统计" name="user" v-if="!is_edit">
        <User ref="userStatistics" :activity_id="activity_id"></User>
      </el-tab-pane>
      <el-tab-pane label="活动相册" name="pic" v-if="!is_edit">
        <Pic ref="activityPic" :activity_id="activity_id"></Pic>
      </el-tab-pane>
      <el-tab-pane label="活动视频" name="video" v-if="!is_edit">
        <Video ref="activityVideo" :activity_id="activity_id"></Video>
      </el-tab-pane>
    </el-tabs>
 
  </div>
</template>
 
<script>
  import Edit from './edit.vue';
  import User from './user.vue';
  import Pic from './pic.vue';
  import Video from './video.vue';
  export default {
    components: {
      Edit,
      User,
      Pic,
      Video,
    },
    data() {
      return {
        loading: true,
        activeName: 'detail',
        // activity_id: '',
        userForm: {
          keyword: ""
        }
      };
    },
    props: ['is_edit', 'detailData', 'category', 'activity_id'],
 
    methods: {
      // 编辑成功回调
      success(){
        this.$emit('success')
      },
 
      onSubmit(id){
        this.$refs.editForm.onSubmit(id);
      },
 
      setFormData() {
        this.$nextTick(()=>{
          this.activeName = 'detail';
          this.$refs.editForm.formatData();
        }) 
      },
    }
 
  };
</script>
 
<style lang="scss" scoped>
  .drawer-tabs {
    border: 0;
    box-shadow: none;
    margin-left: -15px;
    margin-right: -15px;
  }
  .drawer-tabs>.el-tabs__header .el-tabs__item.is-active:before {
    content: "";
    display: block;
    width: 100%;
    height: 2px;
    background: #409EFF;
    position: absolute;
    top: 0;
    left: 0
  }
  .item-title {
    width: 90px;
    text-align: right;
  }
  .color-show-box {
    border: 1px solid #e6e6e6;
    border-radius: 3px;
    padding: 3px;
  }
  .color-show-box > div {
    width: 25px;
    height: 25px;
    border-radius: 2px;
  }
  .table-wrap .product-info .pic {
    width: 50px;
    height: 50px;
  }
</style>