index.vue
2.64 KB
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
<!--
* @Date: 2022-09-19 14:11:06
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2022-10-10 14:12:13
* @FilePath: /swx/src/pages/projectManage/index.vue
* @Description: 主办方管理页面
-->
<template>
<view class="project-manage-page">
<view class="activity-title">
<view class="box">
<text class="bg-gradient" style="font-size: 1rem;">我创建的主办方</text>
</view>
</view>
<view class="create-box">
<view class="create-item" v-for="(item, index) in create_list" :key="index">
<van-row>
<van-col span="20">
<view>
<van-icon :name="icon_p" size="2.25rem" color="" style="vertical-align: middle;" />
<text class="name"> {{ item.name }}</text>
</view>
</van-col>
<van-col span="4">
<view class="manage-btn" @tap="onManage(item)">管理</view>
</van-col>
</van-row>
</view>
</view>
<view style="height: 1rem;"></view>
<view class="activity-title">
<view class="box">
<text class="bg-gradient" style="font-size: 1rem;">我加入的主办方</text>
</view>
</view>
<view class="join-box">
<view class="join-item" v-for="(item, index) in join_list" :key="index">
<van-row>
<van-col span="24">
<view>
<van-icon :name="icon_p" size="2.25rem" color="" style="vertical-align: middle;" />
<text class="name"> {{ item.name }}</text>
</view>
</van-col>
</van-row>
</view>
</view>
</view>
<bottom-button @on-submit="onSubmit">新建主办方</bottom-button>
</template>
<script setup>
import Taro from '@tarojs/taro'
import { ref } from "vue";
import icon_p from '@/images/icon/zhubanfang@2x.png'
import bottomButton from "@/components/bottom-button";
const onSubmit = () => {
Taro.navigateTo({
url: '../createProject/index'
})
}
const onManage = (item) => {
Taro.navigateTo({
url: '../userManage/index?id=' + item.id + '&name=' + decodeURIComponent(item.name)
})
}
</script>
<script>
import "./index.less";
import request from '../../utils/request';
export default {
name: "projectManagePage",
data () {
return {
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);
});
},
};
</script>