Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Hooke
/
swx_weapp
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Network
Create a new issue
Commits
Issue Boards
Authored by
hookehuyr
2022-10-24 16:56:38 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
0dee728959482b141cc5926aefaacdfde57779e8
0dee7289
1 parent
4ccf2737
主办方管理页面功能优化
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
70 additions
and
18 deletions
src/pages/projectManage/index.less
src/pages/projectManage/index.vue
src/pages/projectManage/index.less
View file @
0dee728
...
...
@@ -32,6 +32,13 @@
text-align: center;
margin-top: 0.5rem;
}
.delete-btn {
color: #E32525;
border: 1px solid #E32525;
border-radius: 2rem;
text-align: center;
margin-top: 0.5rem;
}
}
}
.join-box {
...
...
src/pages/projectManage/index.vue
View file @
0dee728
<!--
* @Date: 2022-09-19 14:11:06
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2022-10-
10 14:12:13
* @LastEditTime: 2022-10-
24 16:56:16
* @FilePath: /swx/src/pages/projectManage/index.vue
* @Description: 主办方管理页面
-->
...
...
@@ -15,7 +15,7 @@
<view class="create-box">
<view class="create-item" v-for="(item, index) in create_list" :key="index">
<van-row>
<van-col span="
20
">
<van-col span="
15
">
<view>
<van-icon :name="icon_p" size="2.25rem" color="" style="vertical-align: middle;" />
<text class="name"> {{ item.name }}</text>
...
...
@@ -24,6 +24,9 @@
<van-col span="4">
<view class="manage-btn" @tap="onManage(item)">管理</view>
</van-col>
<van-col span="4" offset="1">
<view class="delete-btn" @tap="onDelete(item)">删除</view>
</van-col>
</van-row>
</view>
</view>
...
...
@@ -47,13 +50,28 @@
</view>
</view>
<bottom-button @on-submit="onSubmit">新建主办方</bottom-button>
<van-dialog id="van-dialog" />
</template>
<script setup>
import Taro from '@tarojs/taro'
import { ref } from "vue";
import { ref
, onMounted
} from "vue";
import icon_p from '@/images/icon/zhubanfang@2x.png'
import bottomButton from "@/components/bottom-button";
import { deleteHostAPI, hostListAPI } from '@/api/Host/index';
import Dialog from '@/components/vant-weapp/dialog/dialog';
const create_list = ref([]);
const join_list = ref([]);
onMounted(async () => {
const { code, data } = await hostListAPI();
if (code) {
create_list.value = data.my_hosts;
join_list.value = data.join_hosts;
}
})
const onSubmit = () => {
Taro.navigateTo({
...
...
@@ -66,34 +84,61 @@ const onManage = (item) => {
url: '../userManage/index?id=' + item.id + '&name=' + decodeURIComponent(item.name)
})
}
const onDelete = (item) => {
Dialog.confirm({
title: '温馨提示',
message: '是否确认删除主办方?',
confirmButtonColor: '#199a74'
})
.then(async () => {
// on confirm
const { code, data } = await deleteHostAPI({ i: item.id });
if (code) {
Taro.showToast({
title: '删除成功',
icon: 'success',
duration: 2000
});
const { code, data } = await hostListAPI();
if (code) {
create_list.value = data.my_hosts;
}
}
})
.catch(() => {
// on cancel
});
}
</script>
<script>
import "./index.less";
import request from '../../utils/request';
// import request from '../../utils/request';
import mixin from '@/utils/mixin';
export default {
name: "projectManagePage",
mixins: [mixin.init],
data () {
return {
create_list: [],
join_list: [],
//
create_list: [],
//
join_list: [],
}
},
onShow() {
// 保存主办方信息
request.get('/srv/?a=host_list')
.then(res => {
if (res.data.code) {
this.create_list = res.data.data.my_hosts;
this.join_list = res.data.data.join_hosts;
} else {
console.warn(res.data.msg);
}
})
.catch(err => {
console.error(err);
});
//
request.get('/srv/?a=host_list')
//
.then(res => {
//
if (res.data.code) {
//
this.create_list = res.data.data.my_hosts;
//
this.join_list = res.data.data.join_hosts;
//
} else {
//
console.warn(res.data.msg);
//
}
//
})
//
.catch(err => {
//
console.error(err);
//
});
},
};
</script>
...
...
Please
register
or
login
to post a comment