Browse Source

feat: 入群欢迎语

zhengxy 11 months ago
parent
commit
81c60cffe3

+ 5 - 0
project/src/assets/config/interface_api.js

@@ -498,6 +498,11 @@ var api = {
498 498
   sendData_chatGroupMassMsg: '/api/service/chatGroupMassMsg', // 群发送达数据 - 客户群群发
499 499
   sendData_PeriodMassMsg: '/api/service/periodMassMsg', // 群发送达数据 - 智能群发
500 500
 
501
+  welcomeGroup_list: '/api/chatGroup/welcomeTemplateList', // 入群欢迎语 - 配置列表
502
+  welcomeGroup_del: '/api/chatGroup/delWelcomeTemplate', // 入群欢迎语 - 删除配置
503
+  welcomeGroup_set: '/api/chatGroup/setWelcomeTemplate', // 入群欢迎语 - 设置配置
504
+  welcomeGroup_detail: '/api/chatGroup/welcomeTemplateDetail', // 入群欢迎语 - 配置详情
505
+
501 506
 };
502 507
 
503 508
 export { api };

File diff suppressed because it is too large
+ 1230 - 0
project/src/components/assembly/editConWelGroup.vue


+ 120 - 0
project/src/components/welcomeGroup/create.scss

@@ -0,0 +1,120 @@
1
+.backBox {
2
+  background: #ffffff;
3
+  padding: 15px;
4
+  margin-bottom: 10px;
5
+  .back {
6
+    font-size: 16px;
7
+    font-weight: bold;
8
+    color: #333333;
9
+    cursor: pointer;
10
+    display: inline-block;
11
+  }
12
+}
13
+.bigTitle {
14
+  color: #333333;
15
+  font-size: 16px;
16
+  line-height: 22px;
17
+  font-weight: bold;
18
+}
19
+.createMassMsg{
20
+  width: 100%;
21
+  min-height: 400px;
22
+ 
23
+  .line {
24
+    width: 730px;
25
+    height: 1px;
26
+    background: #e9e9e9;
27
+    margin: 40px 0 20px;
28
+  }
29
+  .regulations {
30
+    display: flex;
31
+    align-items: flex-start;
32
+    margin-top: 28px;
33
+    label {
34
+      width: 100px;
35
+      color: #333333;
36
+      font-size: 14px;
37
+      line-height: 28px;
38
+      em {
39
+        color: #ff0000;
40
+      }
41
+    }
42
+  }
43
+  .regulations2 {
44
+    label {
45
+      width: 70px;
46
+      line-height: 30px;
47
+    }
48
+  }
49
+}
50
+.detail_status{
51
+  line-height: 30px;
52
+  height: 30px;
53
+  padding: 3px 10px;
54
+  border-radius: 21px;
55
+  font-size: 12px;
56
+  margin-left: 20px;
57
+}
58
+.status_wait{
59
+  background: #FFF2ED;
60
+  border: 1px solid #FF864F;
61
+  color: #FF864F;
62
+}
63
+.status_del{
64
+  background: #FFF5F5;
65
+  border: 1px solid #FF604D;
66
+  color: #FF604D;
67
+}
68
+.status_fail{
69
+  background: #F4F4F4;
70
+  border: 1px solid #ADADAD;
71
+  color: #ADADAD;
72
+}
73
+.status_ing{
74
+  background: #F4FAFF;
75
+  border: 1px solid #007AFE;
76
+  color: #007AFE;
77
+}
78
+.status_success{
79
+  background: #EEFFF3;
80
+  border: 1px solid #00B38A;
81
+  color: #00B38A;
82
+}
83
+.splitLine {
84
+  width: 100%;
85
+  height: 10px;
86
+  background: #f5f6f8;
87
+}
88
+// .switch_self{
89
+//   display: flex;
90
+//   align-items: center;
91
+//   height: 30px;
92
+//   font-size: 13px;
93
+//   .switch_self_button{
94
+//     color: #333333;
95
+//     padding: 0 8px;
96
+//     border: 1px solid #e9e9e9;
97
+//     height: 100%;
98
+//     line-height: 28px;
99
+//     border-right: none;
100
+//     cursor: pointer;
101
+//     &:last-of-type{
102
+//       border-top-right-radius: 4px;
103
+//       border-bottom-right-radius: 4px;
104
+//       border-right: 1px solid #e9e9e9;
105
+//     }
106
+//     &:first-of-type{
107
+//       border-top-left-radius: 4px;
108
+//       border-bottom-left-radius: 4px;
109
+//     }
110
+//     &.switch_self_button_active{
111
+//       background: #43B083;
112
+//       border-color: #43B083;
113
+//       color: #ffffff;
114
+//     }
115
+//   }
116
+// }
117
+// <div class="switch_self">
118
+// <div class="switch_self_button switch_self_button_active">全部员工</div>
119
+// <div class="switch_self_button">部分员工</div>
120
+// </div>

+ 284 - 0
project/src/components/welcomeGroup/detail.vue

@@ -0,0 +1,284 @@
1
+<template>
2
+  <div class="createMassMsg" v-loading="loading">
3
+    <div v-if="!loading" class="bg-ffffff" style="padding: 15px;">
4
+      <div class="line" style="margin-top:20px"></div>
5
+      <h3 class="bigTitle">入群欢迎语素材</h3>
6
+      <div class="regulations">
7
+        <label><em>*</em>欢迎语标题</label>
8
+        <el-input placeholder="例:活动推送/拉新等" style="width:300px" v-model.trim="name" clearable size="small" />
9
+      </div>
10
+      <div class="regulations">
11
+        <label style="margin-top:4px"><em>*</em>欢迎语</label>
12
+        <editConWelGroup ref="editConWelGroup" source="welcom" :afferent_content='content' :afferent_attachments='attachments' :isKHHYY="true" @editContent="(val)=>{content = val}" @changeAttachment='getAttachment' />
13
+        <!-- isKHHYY 是否为"客户欢迎语" -->
14
+      </div>
15
+      <button class="button" @click="welcomeMsg_set">保存</button>
16
+    </div>
17
+  </div>
18
+</template>
19
+<script>
20
+import selfCustomerservice from '@/components/assembly/screen/customerService.vue'
21
+import editConWelGroup from '@/components/assembly/editConWelGroup.vue'
22
+
23
+export default {
24
+  props: {
25
+    template_id: {
26
+      type: String | Number,
27
+      default: () => '',
28
+    },
29
+  },
30
+  components: { selfCustomerservice, editConWelGroup },
31
+  data () {
32
+    return {
33
+      isCopy: this.$route.path.indexOf('welcom_message_copy') != -1,
34
+      loading: false,
35
+      editFlag: true,
36
+      is_day_parting: false,
37
+      name: '',
38
+      deleteTimeIntervalList: [],//删除的分时段列表
39
+      timeIntervalList: [],//分时段列表
40
+      init_welcom_con: {
41
+        is_day_parting: 1,//是否为分时段欢迎语 0:否 1:是
42
+        weeks: [1, 2, 3, 4, 5, 6, 0],
43
+        start_time: '',
44
+        end_time: '',
45
+        content: '',
46
+        attachments: [],
47
+      },
48
+      content: '',
49
+      attachments: [],
50
+      dataInfo: {},
51
+      key_we_index:1
52
+    }
53
+  },
54
+  created () {
55
+    if (this.template_id) {//详情
56
+      this.detail()
57
+    } else {
58
+      this.loading = false;
59
+    }
60
+  },
61
+  mounted() {
62
+  },
63
+  methods: {
64
+    detail () {//详情
65
+      this.loading = true
66
+      this.$axios.get(this.URL.BASEURL + this.URL.welcomeGroup_detail, {
67
+        params: {
68
+          template_id: this.template_id
69
+        }
70
+      }).then((res) => {
71
+        var res = res.data
72
+        this.loading = false
73
+        if (res && res.errno == 0) {
74
+          console.log('res.rst => ', res.rst)
75
+          this.dataInfo = res.rst;
76
+          this.name = res.rst.name;
77
+          // S 坑:部分浏览器不支持 replaceAll 方法
78
+          if (String.prototype.replaceAll) {
79
+            this.content = res.rst.content ? res.rst.content.replaceAll('%NICKNAME%', '「客户昵称」') : '';
80
+          } else {
81
+            this.content = res.rst.content ? res.rst.content.replace(/\%NICKNAME\%/g, '「客户昵称」') : '';
82
+          }
83
+          // E 坑:部分浏览器不支持 replaceAll 方法
84
+          if (res.rst.attachments['image']) {
85
+            this.attachments = [
86
+              {
87
+                image: {
88
+                  media_id: res.rst.attachments['image'].media_id,
89
+                  pic_url: res.rst.attachments['image'].media_url,
90
+                },
91
+                msgtype: 'image'
92
+              }
93
+            ]
94
+          } else if (res.rst.attachments['promote']) {
95
+            this.attachments = [
96
+              {
97
+                promote: {
98
+                  title: res.rst.attachments['promote'].title,
99
+                  jump_url: res.rst.attachments['promote'].url,
100
+                  picurl: res.rst.attachments['promote'].picurl,
101
+                  desc: res.rst.attachments['promote'].desc,
102
+                },
103
+                msgtype: 'promote'
104
+              }
105
+            ]
106
+          } else if (res.rst.attachments['link']) {
107
+            this.attachments = [
108
+              {
109
+                link: {
110
+                  title: res.rst.attachments['link'].title,
111
+                  url: res.rst.attachments['link'].url,
112
+                  picurl: res.rst.attachments['link'].picurl,
113
+                  desc: res.rst.attachments['link'].desc,
114
+                },
115
+                msgtype: 'link'
116
+              }
117
+            ]
118
+          }
119
+
120
+          console.log('this.attachments => ', this.attachments)
121
+
122
+        } else if (res.errno != 4002) {
123
+          this.$message({
124
+            message: res.err,
125
+            type: "warning"
126
+          })
127
+        }
128
+      }).catch((err) => {
129
+        this.loading = false
130
+      });
131
+    },
132
+    getAttachment (val) {
133
+      this.attachments = val;
134
+    },
135
+    getWelcomEdit (val, index) {//分时段编辑
136
+      this.$set(this.timeIntervalList, index, val)
137
+    },
138
+    deleteWelcomCon (index) {//删除分时段
139
+      if (this.$route.params.rule_id && this.timeIntervalList[index].msg_id) {//删除的分时段内容
140
+        let obj = JSON.parse(JSON.stringify(this.timeIntervalList[index]))
141
+        obj.operate = 'del';
142
+        this.deleteTimeIntervalList.push(obj)
143
+      }
144
+      this.timeIntervalList.splice(index, 1)
145
+      this.key_we_index++;
146
+    },
147
+    addWelcom () {//添加分时段
148
+      this.timeIntervalList.push(this.init_welcom_con)
149
+      this.key_we_index++;
150
+    },
151
+    switchChange () {//分时段开关打开
152
+      if (this.is_day_parting && this.timeIntervalList.length == 0) {
153
+        this.timeIntervalList.push(this.init_welcom_con)
154
+      }
155
+    },
156
+    welcomeMsg_set () {//保存
157
+      if (this.name == '') {
158
+        this.$message({
159
+          message: '请输入欢迎语标题!',
160
+          type: "warning"
161
+        })
162
+        return
163
+      }
164
+      if (this.content == '') {
165
+        this.$message({
166
+          message: '请输入欢迎语内容!',
167
+          type: "warning"
168
+        })
169
+        return
170
+      }
171
+      if (this.content != '' && this.$getStrBytes(this.content) > 3000) {
172
+        this.$message({
173
+          message: '请检查欢迎语内容,最多3000个字节,已超出!',
174
+          type: "error"
175
+        })
176
+        return
177
+      }
178
+
179
+      if (!this.attachments || !this.attachments.length) {
180
+        this.$message({
181
+          message: '请添加欢迎语附件',
182
+          type: 'error',
183
+        })
184
+        return
185
+      }
186
+
187
+      // S 坑:部分浏览器不支持 replaceAll 方法
188
+      if (String.prototype.replaceAll) {
189
+        this.content = this.content.replaceAll('「客户昵称」', '%NICKNAME%')
190
+      } else {
191
+        this.content = this.content.replace(/「客户昵称」/g, '%NICKNAME%')
192
+      }
193
+      // E 坑:部分浏览器不支持 replaceAll 方法
194
+
195
+      const params = {
196
+        template_id: this.template_id ? this.template_id : '',
197
+        name: this.name,
198
+        content: this.content,
199
+      }
200
+
201
+      console.log('this.attachments => ', JSON.parse(JSON.stringify(this.attachments)))
202
+      if (this.attachments[0].msgtype === 'image') {
203
+        params.attachments = {
204
+          "image": {
205
+            "media_id": this.attachments[0].image.media_id
206
+          }
207
+        }
208
+      } else if (this.attachments[0].msgtype === 'link') {
209
+        params.attachments = {
210
+          "link": {
211
+            "title": this.attachments[0].link.title,
212
+            "picurl": this.attachments[0].link.picurl,
213
+            "desc": this.attachments[0].link.desc,
214
+            "url": this.attachments[0].link.url,
215
+          }
216
+        }
217
+      } else if (this.attachments[0].msgtype === 'promote') {
218
+        params.attachments = {
219
+          "promote": {
220
+            "title": this.attachments[0].promote.title,
221
+            "picurl": this.attachments[0].promote.picurl,
222
+            "desc": this.attachments[0].promote.desc,
223
+            "url": this.attachments[0].promote.jump_url,
224
+          }
225
+        }
226
+      } else if (this.attachments[0].msgtype === 'miniprogram') {
227
+        params.attachments = {
228
+          "miniprogram": {
229
+            "title": this.attachments[0].miniprogram.title,
230
+            "pic_media_id": this.attachments[0].miniprogram.pic_media_id,
231
+            "appid": this.attachments[0].miniprogram.appid,
232
+            "page": this.attachments[0].miniprogram.page,
233
+          }
234
+        }
235
+      }
236
+      params.attachments = JSON.stringify(params.attachments)
237
+      console.log('params => ', JSON.parse(JSON.stringify(params)))
238
+      this.$loading(this.$loadingConfig)
239
+      this.$axios.post(this.URL.BASEURL + this.URL.welcomeGroup_set, params).then((res) => {
240
+        var res = res.data
241
+        this.$loading(this.$loadingConfig).close()
242
+        if (res && res.errno == 0) {
243
+          this.$emit('close', { isEdit: !!this.template_id })
244
+        } else if (res.errno != 4002) {
245
+          this.$message({
246
+            message: res.err,
247
+            type: "warning"
248
+          })
249
+        }
250
+      }).catch((err) => {
251
+        this.$loading(this.$loadingConfig).close()
252
+      });
253
+    },
254
+    handleGoBack() {
255
+      this.$router.replace({
256
+        path: '/welcomeMsg'
257
+      })
258
+    },
259
+  }
260
+}
261
+</script>
262
+<style lang="scss" scoped>
263
+@import "./create.scss";
264
+.button {
265
+  width: 178px;
266
+  height: 40px;
267
+  background: #00b38a;
268
+  border-radius: 5px;
269
+  color: #ffffff;
270
+  font-size: 14px;
271
+  border: none;
272
+  margin: 40px 100px;
273
+}
274
+.add_welcom_hint {
275
+  color: #00b38a;
276
+  font-size: 16px;
277
+  font-weight: bold;
278
+  margin-left: 90px;
279
+  margin-top: 10px;
280
+  margin-bottom: 20px;
281
+  cursor: pointer;
282
+  display: inline-block;
283
+}
284
+</style>

+ 333 - 0
project/src/components/welcomeGroup/index.vue

@@ -0,0 +1,333 @@
1
+<template>
2
+  <div v-loading="loading" class="welcomeGroup-wrap">
3
+    <div class="screenBox">
4
+      <div class="filter-wrap">
5
+        <!-- 标题 -->
6
+        <selfInputV2 v-model="filter.keyword" label_name="标题" placeholder="请输入标题" :labelWidth="true" @change="onChangeKeyword" style="width: auto" />
7
+        <!-- 创建人 -->
8
+        <selfChannelV2 v-model="filter.creator_id" title="创建人" type="circleCreate" placeholder="请选择创建人" :labelWidth="true" @change="onChangeCreatorId" />
9
+      </div>
10
+      <el-button type="primary" size="mini" @click="onClickCreateBtn" >新建入群欢迎语</el-button>
11
+    </div>
12
+    <el-table :height="height" :data="list" tooltip-effect="dark" style="width: 100%; margin-top: 10px">
13
+      <el-table-column label="标题" prop="name" min-width="100" align="center" fixed="left" show-overflow-tooltip />
14
+      <el-table-column label="文本内容" prop="content" align="center" min-width="150" show-overflow-tooltip />
15
+      <el-table-column label="附件内容" align="left" min-width="180">
16
+        <template slot-scope="{ row }">
17
+          <template v-if="row.attachments">
18
+            <!-- 图片 -->
19
+            <template v-if="row.attachments.image">
20
+              <el-image style="width: 40px; height: 40px;" :src="row.attachments.image.media_url" :preview-src-list="[row.attachments.image.media_url]" />
21
+            </template>
22
+
23
+            <!-- 视频 -->
24
+            <template v-else-if="row.attachments.video">
25
+              <div class="flex-align-center">
26
+                <img src="@/assets/img/video_bg.svg" style="width: 50px; height: 40px; margin-left: -4px" />
27
+                <el-button v-if="row.attachments.video.media_url" type="text" size="mini" @click="onClickShowVideo(row.attachments.video.media_url)" >查看视频</el-button>
28
+              </div>
29
+            </template>
30
+
31
+            <!-- 文件 -->
32
+            <template v-else-if="row.attachments.file">
33
+              <div class="flex-align-center">
34
+                <img src="@/assets/img/video_bg.svg" style="width: 50px; height: 40px; margin-left: -4px" />
35
+                <el-button v-if="row.attachments.file.media_url" type="text" size="mini" @click="onClickShowfile(row.attachments.file.media_url)">下载文件</el-button>
36
+              </div>
37
+            </template>
38
+
39
+            <!-- 图文 -->
40
+            <template v-else-if="row.attachments.link">
41
+              <div class="flex-align-center">
42
+                <el-image style="width: 40px; height: 40px;margin-right: 10px;flex-shrink: 0;" :src="row.attachments.link.picurl" :preview-src-list="[row.attachments.link.picurl]" />
43
+                <span style="line-height: 16px; cursor: pointer">
44
+                  <a :href="row.attachments.link.url" target="_blank" class="c-676C97">
45
+                  <el-tooltip class="disinblock" :content="row.attachments.link.desc" :disabled="row.attachments.link.desc && row.attachments.link.desc.length < 34" placement="top">
46
+                      <span class="clampTwo">{{
47
+                        row.attachments.link.desc
48
+                          ? row.attachments.link.desc
49
+                          : "-"
50
+                      }}</span>
51
+                    </el-tooltip>
52
+                  </a>
53
+                </span>
54
+              </div>
55
+            </template>
56
+
57
+            <!-- 推广链接 -->
58
+            <template v-else-if="row.attachments.promote">
59
+              <div class="flex-align-center">
60
+                 <el-image style="width: 40px; height: 40px;margin-right: 10px;flex-shrink: 0;" :src="row.attachments.promote.picurl" :preview-src-list="[row.attachments.promote.picurl]" />
61
+                <span style="line-height: 16px; cursor: pointer">
62
+                  <a :href="row.attachments.promote.url" target="_blank" class="c-676C97">
63
+                    <el-tooltip class="disinblock" :content="row.attachments.promote.desc" :disabled="row.attachments.promote.desc && row.attachments.promote.desc.length < 34" placement="top">
64
+                      <span class="clampTwo">{{
65
+                        row.attachments.promote.desc
66
+                          ? row.attachments.promote.desc
67
+                          : "-"
68
+                      }}</span>
69
+                    </el-tooltip>
70
+                  </a>
71
+                </span>
72
+              </div>
73
+            </template>
74
+
75
+            <!-- 小程序 -->
76
+            <template v-else-if="row.attachments.miniprogram">
77
+              <div class="flex-align-center">
78
+                <el-image style="width: 40px; height: 40px;margin-right: 10px;flex-shrink: 0;" :src="row.attachments.miniprogram.pic_media_url" :preview-src-list="[row.attachments.miniprogram.pic_media_url]" />
79
+                <span style="line-height: 16px; cursor: pointer">
80
+                  <span target="_blank" class="c-676C97">
81
+                    <el-tooltip class="disinblock" :content="row.attachments.miniprogram.title" :disabled="row.attachments.miniprogram.title && row.attachments.miniprogram.title.length < 34" placement="top">
82
+                      <span class="clampTwo">{{
83
+                        row.attachments.miniprogram.title
84
+                          ? row.attachments.miniprogram.title
85
+                          : "-"
86
+                      }}</span>
87
+                    </el-tooltip>
88
+                  </span>
89
+                </span>
90
+              </div>
91
+            </template>
92
+          </template>
93
+        </template>
94
+      </el-table-column>
95
+      <el-table-column label="创建人" align="center" min-width="140">
96
+        <template slot-scope="{ row }">
97
+          <div class="customerServiceTagBox">
98
+            <div class="customerServiceTag">
99
+              <i class="el-icon-user-solid" /> {{ row.creator }}
100
+            </div>
101
+          </div>
102
+        </template>
103
+      </el-table-column>
104
+      <el-table-column label="更新时间" prop="update_time" min-width="160" show-overflow-tooltip align="center" />
105
+      <el-table-column label="操作" min-width="160" align="center" fixed="right">
106
+        <template slot-scope="{ row }">
107
+          <span class="btn c-00b38a" @click="onClickEditBtn(row)">编辑</span>
108
+          <span class="btn c-FF604D" @click="onClickDelBtn(row)">删除</span>
109
+        </template>
110
+      </el-table-column>
111
+    </el-table>
112
+    <div class="pagination" v-show="pagination.total > 0">
113
+      <el-pagination background :current-page="pagination.page" @current-change="handleCurrentChange" layout="prev, pager, next" :page-count="Number(pagination.pages)" />
114
+    </div>
115
+
116
+    <!-- S 查看视频 -->
117
+    <videoDialog
118
+      :dialogVisible="videoDialogVisible"
119
+      :link="currentVideoLink"
120
+      @close="onCloseVideo"
121
+    />
122
+    <!-- E 查看视频 -->
123
+
124
+    <!-- 详情 -->
125
+    <el-drawer size="1200px" :visible.sync="detailVisible" :with-header="false">
126
+      <detail ref="detail" v-if="detailVisible" :template_id='crtTemplateId' @close="detailClose" />
127
+    </el-drawer>
128
+  </div>
129
+</template>
130
+
131
+<script>
132
+import selfInputV2 from "@/components/assembly/screen/inputV2.vue";
133
+import selfChannelV2 from "@/components/assembly/screen/channelV2.vue";
134
+import videoDialog from "./videoDialog.vue";
135
+import detail from "./detail.vue";
136
+
137
+export default {
138
+  name: "welcomeGroup",
139
+  components: {
140
+    selfInputV2,
141
+    selfChannelV2,
142
+    videoDialog,
143
+    detail,
144
+  },
145
+  data() {
146
+    return {
147
+      height: "",
148
+      loading: false,
149
+      pagination: {
150
+        page: 1,
151
+        page_size: 20,
152
+        pages: 0,
153
+        total: 0,
154
+      },
155
+      filter: {
156
+        keyword: "",
157
+        creator_id: "",
158
+      },
159
+      list: [],
160
+
161
+      videoDialogVisible: false,
162
+      currentVideoLink: "",
163
+
164
+      detailVisible: false,
165
+      crtTemplateId: '',
166
+
167
+    };
168
+  },
169
+  created() {
170
+    this.height = document.documentElement.clientHeight - 200;
171
+    this.handleGetList();
172
+  },
173
+  methods: {
174
+    // 获取列表数据
175
+    async handleGetList() {
176
+      try {
177
+        this.loading = true;
178
+        const url = `${this.URL.BASEURL}${this.URL.welcomeGroup_list}`;
179
+        const params = {
180
+          keyword: this.filter.keyword,
181
+          creator_id: this.filter.creator_id,
182
+          page: this.pagination.page,
183
+          page_size: this.pagination.page_size,
184
+        };
185
+        const { data: res = {} } = await this.$axios.get(url, { params });
186
+        if (res && res.errno == 0 && Array.isArray(res.rst.data)) {
187
+          this.list = res.rst.data;
188
+          this.pagination.total = res.rst.pageInfo.total;
189
+          this.pagination.pages = res.rst.pageInfo.pages;
190
+        } else if (res.errno != 4002) {
191
+          this.$message.warning(res.err);
192
+          this.list = [];
193
+          this.pagination.total = 0;
194
+          this.pagination.pages = 0;
195
+        }
196
+      } catch (error) {
197
+        console.log(error);
198
+        this.list = [];
199
+        this.pagination.total = 0;
200
+        this.pagination.pages = 0;
201
+      } finally {
202
+        this.loading = false;
203
+      }
204
+    },
205
+    onChangeKeyword(val) {
206
+      this.filter.keyword = val;
207
+      this.pagination.page = 1;
208
+      this.handleGetList();
209
+    },
210
+    onChangeCreatorId(val) {
211
+      this.filter.creator_id = val || "";
212
+      this.pagination.page = 1;
213
+      this.handleGetList();
214
+    },
215
+
216
+    // 监听当前页数变化
217
+    handleCurrentChange(currentPage) {
218
+      this.pagination.page = currentPage;
219
+      this.handleGetList();
220
+    },
221
+
222
+    // 监听点击“新建配置”
223
+    onClickCreateBtn() {
224
+      console.log("onClickCreateBtn => ");
225
+      this.crtTemplateId = ''
226
+      this.detailVisible = true
227
+    },
228
+    // 监听点击“编辑配置”
229
+    onClickEditBtn(row) {
230
+      console.log("onClickEditBtn => row ", JSON.parse(JSON.stringify(row)));
231
+      this.crtTemplateId = row.template_id
232
+      this.detailVisible = true
233
+    },
234
+    detailClose({ isEdit }) {
235
+      console.log('detailClose => ', )
236
+      this.crtTemplateId = ''
237
+      this.detailVisible = false
238
+      if (!isEdit) {
239
+        this.pagination.page = 1;
240
+      }
241
+      this.handleGetList();
242
+    },
243
+
244
+    // 监听点击"删除"
245
+    async onClickDelBtn({ name, template_id }) {
246
+      try {
247
+        await this.$confirm(`确定删除【${name}】?`, '提示', {
248
+          confirmButtonText: '确定',
249
+          cancelButtonText: '取消',
250
+          type: 'warning'
251
+        })
252
+        this.handleDelRule(template_id)
253
+      } catch (error) {
254
+        console.log('error => ', error)
255
+      }
256
+    },
257
+    async handleDelRule(template_id) {
258
+      try {
259
+        const url = `${this.URL.BASEURL}${this.URL.welcomeGroup_del}`
260
+        const params = { template_id }
261
+        const { data: res = {} } = await this.$axios.post(url, params)
262
+        if (res && res.errno == 0) {
263
+          this.$message.success('操作成功')
264
+          this.handleGetList();
265
+        } else if (res.errno != 4002) {
266
+          this.$message.warning(res.err)
267
+        }
268
+      } catch (error) {
269
+        console.log('error => ', error)
270
+      }
271
+    },
272
+
273
+    onClickShowVideo(videoLink) {
274
+      if (!videoLink) return false;
275
+      this.currentVideoLink = videoLink;
276
+      this.videoDialogVisible = true;
277
+    },
278
+    onCloseVideo() {
279
+      this.currentVideoLink = "";
280
+      this.videoDialogVisible = false;
281
+    },
282
+    onClickShowfile(fileLink) {
283
+      window.open(fileLink, '_blank')
284
+    },
285
+  },
286
+};
287
+</script>
288
+
289
+<style lang="scss" scoped>
290
+@import "@/style/list.scss";
291
+.welcomeGroup-wrap {
292
+  /deep/ .el-switch.is-disabled .el-switch__core {
293
+    cursor: pointer;
294
+  }
295
+  /deep/ .el-switch.is-disabled {
296
+    opacity: 1;
297
+  }
298
+  .screenBox {
299
+    background: #fff;
300
+    padding: 5px 20px;
301
+    display: flex;
302
+    justify-content: space-between;
303
+    align-items: center;
304
+    .filter-wrap {
305
+      flex: 1;
306
+      display: flex;
307
+      flex-wrap: wrap;
308
+    }
309
+  }
310
+  .btn {
311
+    cursor: pointer;
312
+    margin-right: 4px;
313
+    &:last-child {
314
+      margin-right: 0;
315
+    }
316
+  }
317
+  .lableBox_dad {
318
+    display: flex;
319
+    align-items: center;
320
+    justify-content: center;
321
+    flex-wrap: wrap;
322
+
323
+    .lableBox {
324
+      font-size: 12px;
325
+      background-color: #f0f0f0;
326
+      padding: 4px 8px;
327
+      margin-top: 5px;
328
+      margin-right: 4px;
329
+      border-radius: 4px;
330
+    }
331
+  }
332
+}
333
+</style>

+ 75 - 0
project/src/components/welcomeGroup/videoDialog.vue

@@ -0,0 +1,75 @@
1
+<template>
2
+  <el-dialog
3
+    :visible.sync="dialogVisible"
4
+    :before-close="handleCancel"
5
+    class="video-dialog"
6
+    :title="title"
7
+    width="550px"
8
+    :close-on-click-modal="false"
9
+  >
10
+    <div class="content-wrap" v-loading="loading">
11
+      <video :src="link" width="60%" controls />
12
+    </div>
13
+    <div slot="footer" class="dialog-footer">
14
+      <el-button size="mini" type="primary" @click="handleCancel">关 闭</el-button>
15
+    </div>
16
+  </el-dialog>
17
+</template>
18
+
19
+<script>
20
+export default {
21
+  props: {
22
+    // 控制弹框是否显示
23
+    dialogVisible: {
24
+      type: Boolean,
25
+      default: () => false
26
+    },
27
+    link: {
28
+      type: String,
29
+      default: () => ''
30
+    }
31
+  },
32
+  data() {
33
+    return {
34
+      loading: false,
35
+    }
36
+  },
37
+  computed: {
38
+    title() {
39
+      return ``
40
+    },
41
+  },
42
+  watch: {
43
+    dialogVisible(isShow) {
44
+      if (isShow) {
45
+        // 获取表单数据
46
+        // this.handleGetFormData()
47
+      }
48
+    },
49
+  },
50
+  methods: {
51
+    handleCancel() {
52
+      // this.handleClearFormData()
53
+      this.$emit('close')
54
+    },
55
+    // 清空弹框表单数据
56
+    handleClearFormData() {
57
+      this.form.app_id = ''
58
+      this.form.account_id = []
59
+    },
60
+  },
61
+};
62
+</script>
63
+
64
+<style lang="scss" scoped>
65
+.video-dialog {
66
+  .content-wrap {
67
+    display: flex;
68
+    align-items: center;
69
+    justify-content: center;
70
+  }
71
+  .dialog-footer {
72
+    text-align: center;
73
+  }
74
+}
75
+</style>

+ 11 - 0
project/src/router/allRouter.js

@@ -119,6 +119,7 @@ const customerWarn = () => import(/* webpackChunkName: 'customerWarn' */ '@/comp
119 119
 
120 120
 const InviteIntoGroup = () => import(/* webpackChunkName: 'InviteIntoGroup' */ '@/components/manage/InviteIntoGroup/index.vue')
121 121
 const groupTransfer = () => import(/* webpackChunkName: 'groupTransfer' */ '@/components/groupTransfer/index.vue')
122
+const welcomeGroup = () => import(/* webpackChunkName: 'welcomeGroup' */ '@/components/welcomeGroup/index.vue')
122 123
 
123 124
 // name与菜单配置的页面路由一致
124 125
 // meta下isData:true为数据看板,否则为助手
@@ -1072,6 +1073,16 @@ export var allRouter = [
1072 1073
           title: '客户群分配'
1073 1074
         }
1074 1075
       },
1076
+      {
1077
+        path: 'welcomeGroup',
1078
+        name: 'welcomeGroup',
1079
+        component: welcomeGroup,
1080
+        meta: {
1081
+          keepAlive: false,
1082
+          isLogin: true,
1083
+          title: '入群欢迎语'
1084
+        }
1085
+      },
1075 1086
     ]
1076 1087
   }
1077 1088
 ]