浏览代码

feat: #发送邮件

loki 3 年之前
父节点
当前提交
8b4d099181
共有 2 个文件被更改,包括 29 次插入1 次删除
  1. 3 0
      src/api/scene/index.js
  2. 26 1
      src/views/sceneManagement/sceneList/index.vue

+ 3 - 0
src/api/scene/index.js

@@ -17,3 +17,6 @@ export const delItem = ({ id, ...params }) =>
 	api.del(`/yxl-back-end/admin/kindergarten/${id}`, params);
 export const auditItem = ({ id, ...params }) =>
 	api.put(`/yxl-back-end/admin/kindergarten/${id}/audit`, params);
+
+export const sendCode = ({ id, ...params }) =>
+	api.put(`/yxl-back-end/admin/kindergarten/${id}/send-qrcode`, params);

+ 26 - 1
src/views/sceneManagement/sceneList/index.vue

@@ -19,7 +19,7 @@
 <script>
 import toolbar from './toolbar';
 import mxFilterList from '@/mixins/filterList';
-import { getPage, delItem } from '@/api/scene';
+import { getPage, delItem, sendCode } from '@/api/scene';
 
 export default {
   name: 'SceneList',
@@ -143,6 +143,23 @@ export default {
             );
             action.push(
               h(
+                'el-button',
+                {
+                  props: {
+                    type: 'text'
+                  },
+                  on: {
+                    click: () =>
+                      this.handleSend({
+                        id: row.id
+                      })
+                  }
+                },
+                '发送邮件'
+              )
+            );
+            action.push(
+              h(
                 'BaseBtn',
                 {
                   props: {
@@ -178,6 +195,14 @@ export default {
     handleAdd() {
       this.$SceneItemModal();
     },
+    async handleSend(id) {
+      const { success, msg } = await sendCode({
+        id
+      });
+      if (success) {
+        this.$success('发送成功!');
+      }
+    },
     async handleDelItem(item) {
       const { success, msg } = await delItem({
         id: item.id