hookehuyr

🐞 fix: 主办方新增后回到主办方管理列表更新优化

1 <!-- 1 <!--
2 * @Date: 2022-09-19 14:11:06 2 * @Date: 2022-09-19 14:11:06
3 * @LastEditors: hookehuyr hookehuyr@gmail.com 3 * @LastEditors: hookehuyr hookehuyr@gmail.com
4 - * @LastEditTime: 2022-10-31 13:13:21 4 + * @LastEditTime: 2022-11-01 11:06:35
5 * @FilePath: /swx/src/pages/projectManage/index.vue 5 * @FilePath: /swx/src/pages/projectManage/index.vue
6 * @Description: 主办方管理页面 6 * @Description: 主办方管理页面
7 --> 7 -->
...@@ -63,17 +63,6 @@ import bottomButton from "@/components/bottom-button"; ...@@ -63,17 +63,6 @@ import bottomButton from "@/components/bottom-button";
63 import { deleteHostAPI, hostListAPI } from '@/api/Host/index'; 63 import { deleteHostAPI, hostListAPI } from '@/api/Host/index';
64 import Dialog from '@/components/vant-weapp/dialog/dialog'; 64 import Dialog from '@/components/vant-weapp/dialog/dialog';
65 65
66 -const create_list = ref([]);
67 -const join_list = ref([]);
68 -
69 -onMounted(async () => {
70 - const { code, data } = await hostListAPI({ is_join: 1 });
71 - if (code) {
72 - create_list.value = data.my_hosts;
73 - join_list.value = data.join_hosts;
74 - }
75 -})
76 -
77 const onSubmit = () => { 66 const onSubmit = () => {
78 Taro.navigateTo({ 67 Taro.navigateTo({
79 url: '../createProject/index' 68 url: '../createProject/index'
...@@ -85,7 +74,30 @@ const onManage = (item) => { ...@@ -85,7 +74,30 @@ const onManage = (item) => {
85 url: '../userManage/index?host_id=' + item.id + '&name=' + decodeURIComponent(item.name) 74 url: '../userManage/index?host_id=' + item.id + '&name=' + decodeURIComponent(item.name)
86 }) 75 })
87 } 76 }
88 -const onDelete = (item) => { 77 +</script>
78 +
79 +<script>
80 +import "./index.less";
81 +import mixin from '@/utils/mixin';
82 +
83 +export default {
84 + name: "projectManagePage",
85 + mixins: [mixin.init],
86 + data () {
87 + return {
88 + create_list: [],
89 + join_list: [],
90 + }
91 + },
92 + async onShow() {
93 + const { code, data } = await hostListAPI({ is_join: 1 });
94 + if (code) {
95 + this.create_list = data.my_hosts;
96 + this.join_list = data.join_hosts;
97 + }
98 + },
99 + methods: {
100 + onDelete (item) {
89 Dialog.confirm({ 101 Dialog.confirm({
90 title: '温馨提示', 102 title: '温馨提示',
91 message: '是否确认删除主办方?', 103 message: '是否确认删除主办方?',
...@@ -102,28 +114,14 @@ const onDelete = (item) => { ...@@ -102,28 +114,14 @@ const onDelete = (item) => {
102 }); 114 });
103 const { code, data } = await hostListAPI(); 115 const { code, data } = await hostListAPI();
104 if (code) { 116 if (code) {
105 - create_list.value = data.my_hosts; 117 + this.create_list = data.my_hosts;
106 } 118 }
107 } 119 }
108 }) 120 })
109 .catch(() => { 121 .catch(() => {
110 // on cancel 122 // on cancel
111 }); 123 });
112 -}
113 -</script>
114 -
115 -<script>
116 -import "./index.less";
117 -import mixin from '@/utils/mixin';
118 -
119 -export default {
120 - name: "projectManagePage",
121 - mixins: [mixin.init],
122 - data () {
123 - return {
124 } 124 }
125 - }, 125 + }
126 - onShow() {
127 - },
128 }; 126 };
129 </script> 127 </script>
......