提交 bbedef8b authored 作者: 王鹏飞's avatar 王鹏飞

chroe: 组织调整

上级 347c76c9
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
"version": "0.1.0", "version": "0.1.0",
"private": true, "private": true,
"scripts": { "scripts": {
"serve": "vue-cli-service serve", "serve": "vue-cli-service serve --open",
"build": "vue-cli-service build", "build": "vue-cli-service build",
"lint": "vue-cli-service lint", "lint": "vue-cli-service lint",
"dev-build": "vue-cli-service build --mode dev" "dev-build": "vue-cli-service build --mode dev"
...@@ -11,15 +11,15 @@ ...@@ -11,15 +11,15 @@
"dependencies": { "dependencies": {
"axios": "^0.19.2", "axios": "^0.19.2",
"core-js": "^3.6.5", "core-js": "^3.6.5",
"dayjs": "^1.8.24", "dayjs": "^1.8.28",
"js-cookie": "^2.2.1", "js-cookie": "^2.2.1",
"md5": "^2.2.1", "md5": "^2.2.1",
"qs": "^6.9.3", "qs": "^6.9.4",
"timeago.js": "^4.0.2", "timeago.js": "^4.0.2",
"vant": "^2.8.5", "vant": "^2.8.6",
"vue": "^2.6.11", "vue": "^2.6.11",
"vue-meta": "^2.3.3", "vue-meta": "^2.4.0",
"vue-router": "^3.1.6" "vue-router": "^3.3.4"
}, },
"devDependencies": { "devDependencies": {
"@vue/cli-plugin-babel": "~4.4.1", "@vue/cli-plugin-babel": "~4.4.1",
......
...@@ -32,3 +32,7 @@ export function sendResetPasswordCode(data) { ...@@ -32,3 +32,7 @@ export function sendResetPasswordCode(data) {
data data
}) })
} }
// 登出
export function logout() {
return httpRequest.get('/api/passport/rest/logout')
}
...@@ -41,37 +41,27 @@ export function getPublishList(params) { ...@@ -41,37 +41,27 @@ export function getPublishList(params) {
// 获取活动详情 // 获取活动详情
export function getActivity(id) { export function getActivity(id) {
return httpRequest({ return httpRequest.get(`/api/alumni/v1/activities2/detail/${id}`)
url: `/api/alumni/v1/activities/${id}`,
method: 'get'
})
} }
// 报名活动 // 报名活动
export function joinActivity(data) { export function joinActivity(id) {
return httpRequest({ return httpRequest.post(`/api/alumni/v1/activities2/join/${id}`)
url: '/api/alumni/v1/activities/join', }
method: 'post',
data // 取消报名活动
}) export function cancelJoinActivity(id) {
return httpRequest.post(`/api/alumni/v1/activities2/cancel/${id}`)
} }
// 创建活动 // 创建活动
export function createActivity(data) { export function createActivity(data) {
return httpRequest({ return httpRequest.post('/api/alumni/v1/activities2/add', data)
url: '/api/alumni/v1/activities/create',
method: 'post',
data
})
} }
// 修改活动 // 修改活动
export function updateActivity(id, data) { export function updateActivity(id, data) {
return httpRequest({ return httpRequest.post(`/api/alumni/v1/activities2/edit/${id}`, data)
url: `/api/alumni/v1/activities/${id}`,
method: 'post',
data
})
} }
// 删除活动 // 删除活动
......
...@@ -154,7 +154,7 @@ export default { ...@@ -154,7 +154,7 @@ export default {
return return
} }
this.$router.push({ this.$router.push({
name: 'comment', name: 'activityComment',
params: { commentId: this.data.id } params: { commentId: this.data.id }
}) })
} }
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
</div> </div>
<div class="comment-bd"> <div class="comment-bd">
<template v-if="dataList.length"> <template v-if="dataList.length">
<comment-card <comment-item
v-for="item in dataList" v-for="item in dataList"
:hasReply="hasReply" :hasReply="hasReply"
:hasRemove="hasRemove" :hasRemove="hasRemove"
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
:key="item.id" :key="item.id"
@reply="onReply" @reply="onReply"
@remove="onRemove" @remove="onRemove"
></comment-card> ></comment-item>
</template> </template>
<p class="tips" v-else>暂无内容</p> <p class="tips" v-else>暂无内容</p>
</div> </div>
...@@ -61,10 +61,10 @@ ...@@ -61,10 +61,10 @@
</template> </template>
<script> <script>
import CommentCard from './CommentCard' import CommentItem from './CommentItem'
import * as api from '@/api/index' import * as api from '@/api/index'
export default { export default {
components: { CommentCard }, components: { CommentItem },
props: { props: {
activityId: String, activityId: String,
data: { data: {
......
<template>
<div class="card" @click="onClick">
<div class="card-main">
<div class="card-title line-clamp">{{ data.activity_name }}</div>
<div class="card-publish">
<div class="card-user">
<div class="card-user__avatar">
<img :src="data.initiator.avatar | avatar" />
</div>
<div class="card-user__nickname">{{ data.initiator.nickname }}</div>
</div>
<div class="card-publish__time">{{ datetimeText }}</div>
</div>
</div>
<div class="card-pic" v-if="data.activity_image">
<img :src="data.activity_image" />
</div>
</div>
</template>
<script>
import { format } from 'timeago.js'
export default {
name: 'Card',
props: { data: Object },
computed: {
datetimeText() {
return format(this.data.created_time, 'zh_CN')
}
},
methods: {
onClick() {
this.$router.push({ name: 'item', params: { id: this.data.id } })
}
}
}
</script>
<style lang="scss" scoped>
.card {
display: flex;
margin: 0 20px;
padding: 20px 0;
border-bottom: 1px solid #f5f5f5;
}
.card-title {
font-size: 14px;
color: #666;
}
.card-main {
flex: 1;
display: flex;
flex-direction: column;
justify-content: space-between;
overflow: hidden;
}
.card-publish {
display: flex;
align-items: center;
margin-top: 15px;
}
.card-user {
display: flex;
align-items: center;
flex: 1;
overflow: hidden;
}
.card-user__avatar {
width: 25px;
height: 25px;
background-color: #ccc;
border-radius: 50%;
overflow: hidden;
img {
width: 100%;
height: 100%;
}
}
.card-user__nickname {
padding-left: 10px;
font-size: 12px;
color: #ccc;
}
.card-publish__time {
padding-left: 10px;
font-size: 12px;
color: #ccc;
}
.card-pic {
width: 138px;
height: 78px;
margin-left: 10px;
overflow: hidden;
img {
width: 100%;
height: 100%;
object-fit: cover;
}
}
</style>
<template>
<div class="card" @click="onClick">
<div class="card-hd">
<div class="card-title line-clamp">{{ data.activity_name }}</div>
<div class="card-tools">
<span class="status">已报名</span>
</div>
</div>
<div class="card-bd">
<template v-if="data.activity_type === '10'">
<div class="p-item">
<div class="p-title">时间:</div>
<div class="p-content" style="color:#333;">
{{ data.activity_time }}
</div>
</div>
<div class="p-item">
<div class="p-title">地点:</div>
<div class="p-content">
{{ data.activity_city }}-{{ data.activity_address }}
</div>
</div>
</template>
<template v-if="data.activity_type === '20'">
<div class="p-item">
<div class="p-title">类型:</div>
<div class="p-content">{{ demandTypeText }}</div>
</div>
<div class="p-item">
<div class="p-title">内容:</div>
<div class="p-content">{{ data.activity_contents }}</div>
</div>
</template>
<div class="p-item">
<div class="p-title">发起人:</div>
<div class="p-content">{{ data.initiator.nickname }}</div>
</div>
</div>
</div>
</template>
<script>
export default {
name: 'JoinCard',
props: { data: Object },
computed: {
demandTypeText() {
const map = {
'10': '行业资讯',
'11': '就业招聘',
'12': '需求对接'
}
return map[this.data.activity_demand_type] || ''
}
},
methods: {
onClick() {
this.$router.push({ name: 'item', params: { id: this.data.id } })
}
}
}
</script>
<style lang="scss" scoped>
.card {
margin: 15px 0 20px;
padding: 10px 20px 20px;
background: rgba(255, 255, 255, 1);
box-shadow: 0px 3px 15px 0px rgba(0, 0, 0, 0.06);
}
.card-hd {
display: flex;
}
.card-title {
flex: 1;
font-size: 15px;
color: #333;
}
.card-tools {
padding-left: 10px;
.status {
font-size: 15px;
color: #67c23a;
}
}
.p-item {
margin-top: 10px;
display: flex;
}
.p-title {
font-size: 12px;
color: #999;
white-space: nowrap;
}
.p-content {
font-size: 12px;
color: #999;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
}
</style>
<template>
<div class="card">
<div class="card-hd">
<div class="card-hd__pic">
<img :src="data.avatar | avatar" />
</div>
<div class="card-hd__content">
<span class="nickname">{{ data.nickname }}</span>
<span :class="genderClass"></span>
</div>
</div>
<div class="card-bd">
<div class="p-item">
<div class="p-title">班级:</div>
<div class="p-content">{{ data.class_name }}</div>
</div>
<div class="p-item">
<div class="p-title">联系方式:</div>
<div class="p-content">{{ data.contacts }}</div>
</div>
<div class="p-item">
<div class="p-title">自我介绍:</div>
<div class="p-content">{{ data.self_introduction }}</div>
</div>
</div>
</div>
</template>
<script>
export default {
name: 'JoinedCard',
props: { data: Object },
computed: {
genderClass() {
return {
gender: true,
'is-female': this.data.gender === '0',
'is-male': this.data.gender === '1'
}
}
}
}
</script>
<style lang="scss" scoped>
.card {
margin-bottom: 20px;
padding: 10px 20px 20px;
background: rgba(255, 255, 255, 1);
box-shadow: 0px 3px 15px 0px rgba(0, 0, 0, 0.06);
}
.card-hd {
display: flex;
align-items: center;
}
.card-hd__pic {
width: 40px;
height: 40px;
border-radius: 50%;
overflow: hidden;
background-color: #bfbfbf;
img {
width: 100%;
height: 100%;
}
}
.card-hd__content {
padding-left: 10px;
display: flex;
align-items: center;
.nickname {
color: #999;
}
.gender {
display: inline-block;
margin-left: 5px;
width: 15px;
height: 15px;
}
}
.is-male {
background: url('~@/assets/img/icon_male.png') no-repeat center;
background-size: contain;
}
.is-female {
background: url('~@/assets/img/icon_female.png') no-repeat center;
background-size: contain;
}
.card-bd {
padding-left: 50px;
margin-top: 10px;
}
.p-item {
margin-top: 10px;
display: flex;
}
.p-title {
font-size: 12px;
color: #999;
white-space: nowrap;
}
.p-content {
font-size: 12px;
color: #333;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
}
</style>
<template>
<div class="main-layout">
<header class="main-header">
<menu class="menu" :class="{ 'is-show': menuVisible }">
<div class="inner">
<div class="menu-icon" @click="toggleMenu">
<span></span><span></span><span></span>
</div>
<ul class="menu-list">
<li @click="toPage({ name: 'index', query: { tab: '0' } })">
热门推荐
</li>
<li @click="toPage({ name: 'index', query: { tab: '1' } })">
我参与的
</li>
<li @click="toPage({ name: 'index', query: { tab: '2' } })">
我发起的
</li>
<li @click="$router.back()">返回上一页</li>
</ul>
</div>
</menu>
</header>
<div class="main-body">
<router-view />
</div>
</div>
</template>
<script>
export default {
name: 'PageContainer',
data() {
return {
menuVisible: false
}
},
methods: {
toggleMenu() {
this.menuVisible = !this.menuVisible
},
toPage(route) {
this.menuVisible = false
this.$router.push({
name: route.name,
query: route.query
})
}
}
}
</script>
<style lang="scss">
.menu {
height: 60px;
}
.menu .inner {
position: fixed;
left: 0;
top: 0;
right: 0;
min-width: 70px;
max-width: 750px;
height: 60px;
margin: 0 auto;
padding: 0 20px;
z-index: 100;
display: flex;
align-items: center;
justify-content: flex-end;
background-color: #fff;
// border-top-left-radius: 30px;
// border-bottom-left-radius: 30px;
// box-shadow: 0px 2px 10px 0px rgba(0, 0, 0, 0.06);
}
.menu.is-show {
.menu-list {
display: block;
}
.menu-icon {
width: 18px;
height: 20px;
flex-direction: inherit;
}
.menu-icon span {
width: 2px;
height: 18px;
}
}
.menu-icon {
width: 20px;
height: 18px;
cursor: pointer;
display: flex;
flex-direction: column;
justify-content: space-between;
}
.menu-icon span {
width: 20px;
height: 2px;
background: #333;
}
.menu-list {
position: absolute;
top: 20px;
right: 20px;
display: none;
margin-top: 30px;
width: 180px;
background: #fff;
box-shadow: 0px 2px 20px 0px rgba(0, 0, 0, 0.2);
li {
height: 60px;
line-height: 60px;
color: #333;
text-align: center;
border-top: 1px solid #f5f5f5;
cursor: pointer;
&:first-child {
border: 0;
}
}
&::before {
position: absolute;
top: -6px;
right: 8px;
content: ' ';
display: block;
width: 0;
height: 0;
border-color: transparent;
border-style: solid;
border-width: 6px;
border-top-width: 0;
border-bottom-color: #fff;
}
}
</style>
...@@ -43,7 +43,7 @@ ...@@ -43,7 +43,7 @@
</template> </template>
<!-- 正常的活动 --> <!-- 正常的活动 -->
<template v-else> <template v-else>
<li v-if="data.is_mine"> <li v-if="data.is_mine && data.approve_status !== '1'">
<div class="button default-button" @click.stop="onClick">管理</div> <div class="button default-button" @click.stop="onClick">管理</div>
</li> </li>
<li v-else> <li v-else>
......
<template>
<div class="card" @click="onClick">
<div class="card-hd">
<div class="card-title line-clamp">{{ data.activity_name }}</div>
<div class="card-tools">
<span class="status" :class="{ 'is-green': isPass }">
{{ statusText }}
</span>
</div>
</div>
<div class="card-bd">
<div class="card-main">
<template v-if="data.activity_type === '10'">
<div class="p-item">
<div class="p-title">时间:</div>
<div class="p-content" style="color:#333;">
{{ data.activity_time }}
</div>
</div>
<div class="p-item">
<div class="p-title">地点:</div>
<div class="p-content">
{{ data.activity_city }}-{{ data.activity_address }}
</div>
</div>
</template>
<template v-if="data.activity_type === '20'">
<div class="p-item">
<div class="p-title">类型:</div>
<div class="p-content">{{ demandTypeText }}</div>
</div>
<div class="p-item">
<div class="p-title">内容:</div>
<div class="p-content">{{ data.activity_contents }}</div>
</div>
</template>
<div class="p-item">
<div class="p-title">发起人:</div>
<div class="p-content">{{ data.initiator.nickname }}</div>
</div>
<div class="p-item" v-if="data.approve_remark">
<div class="p-title">备注:</div>
<div class="p-content is-red">{{ data.approve_remark }}</div>
</div>
</div>
<div class="card-aside" v-if="!isPass">
<div class="card-button" @click.stop="onEdit">编辑</div>
<div class="card-button" @click.stop="onRemove">删除</div>
</div>
</div>
<div class="card-ft" v-if="hasJoined">
<div class="join-button" @click.stop="toJoinPage">
{{ data.participant_count }}人已报名,去查看
</div>
</div>
</div>
</template>
<script>
export default {
name: 'JoinCard',
props: { data: Object },
computed: {
statusText() {
const map = {
'-1': '待审核',
'0': '审核未通过',
'1': '已发布'
}
return map[this.data.approve_status]
},
demandTypeText() {
const map = {
'10': '行业资讯',
'11': '就业招聘',
'12': '需求对接'
}
return map[this.data.activity_demand_type] || ''
},
isPass() {
return this.data.approve_status === '1'
},
hasJoined() {
return parseInt(this.data.participant_count) > 0
}
},
methods: {
onClick() {
this.$router.push({ name: 'item', params: { id: this.data.id } })
},
toJoinPage() {
this.$router.push({ name: 'joined', params: { id: this.data.id } })
},
onEdit() {
this.$router.push({ name: 'edit', params: { id: this.data.id } })
},
onRemove() {
this.$emit('remove', this.data)
}
}
}
</script>
<style lang="scss" scoped>
.card {
margin: 15px 0 20px;
padding: 10px 20px 20px;
background: rgba(255, 255, 255, 1);
box-shadow: 0px 3px 15px 0px rgba(0, 0, 0, 0.06);
}
.card-hd {
display: flex;
}
.card-title {
flex: 1;
font-size: 15px;
color: #333;
}
.card-tools {
padding-left: 10px;
.status {
font-size: 15px;
color: #999;
}
}
.card-bd {
display: flex;
align-items: flex-end;
}
.card-main {
flex: 1;
}
.p-item {
margin-top: 10px;
display: flex;
}
.p-title {
font-size: 12px;
color: #999;
white-space: nowrap;
}
.p-content {
font-size: 12px;
color: #999;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
}
.is-red {
color: #ab2824 !important;
}
.is-green {
color: #67c23a !important;
}
.card-ft {
margin: 10px -20px -20px;
padding: 10px 20px;
text-align: right;
border-top: 1px solid #f5f5f5;
.join-button {
display: inline-block;
padding: 0 20px;
font-size: 12px;
color: #999;
line-height: 26px;
border: 1px solid #999;
border-radius: 4px;
cursor: pointer;
}
}
.card-aside {
width: 60px;
margin-left: 20px;
}
.card-button {
margin-top: 10px;
width: 60px;
height: 25px;
font-size: 12px;
line-height: 25px;
text-align: center;
color: #999;
border-radius: 5px;
border: 1px solid rgba(153, 153, 153, 1);
cursor: pointer;
&:first-child {
margin-top: 0;
}
}
</style>
...@@ -9,7 +9,11 @@ ...@@ -9,7 +9,11 @@
> >
首页 首页
</li> </li>
<li class="tab-bar-item" @click="$router.push('create')"> <li
class="tab-bar-item"
@click="$router.push({ name: 'createActivity' })"
v-if="hasCreate"
>
<div class="tab-bar-item-create"> <div class="tab-bar-item-create">
<div class="tab-bar-item-create__icon"></div> <div class="tab-bar-item-create__icon"></div>
<div class="tab-bar-item-create__title">创建</div> <div class="tab-bar-item-create__title">创建</div>
...@@ -28,14 +32,31 @@ ...@@ -28,14 +32,31 @@
</template> </template>
<script> <script>
import * as api from '@/api'
export default { export default {
data() { data() {
return {} return {
groupList: []
}
},
computed: {
hasCreate() {
return !!this.groupList.find(item => item.is_mine)
}
}, },
methods: { methods: {
isActive(path) { isActive(path) {
return this.$route.name === path return this.$route.name === path
},
// 获取我加入的组织
getJoinedGroupes() {
api.getJoinedGroupes().then(response => {
this.groupList = Array.isArray(response) ? response : []
})
} }
},
beforeMount() {
this.getJoinedGroupes()
} }
} }
</script> </script>
......
import Vue from 'vue' import Vue from 'vue'
import VueRouter from 'vue-router' import VueRouter from 'vue-router'
import Layout from '@/components/Layout.vue'
Vue.use(VueRouter) Vue.use(VueRouter)
...@@ -12,60 +11,6 @@ const routes = [ ...@@ -12,60 +11,6 @@ const routes = [
component: () => import('@/views/Login.vue') component: () => import('@/views/Login.vue')
}, },
// 首页 // 首页
// {
// name: 'index',
// path: '/',
// component: () => import('@/views/Index.vue')
// },
// 创建
// {
// path: '/create',
// component: Layout,
// children: [
// {
// name: 'create',
// path: '',
// component: () => import('@/views/Create.vue')
// }
// ]
// },
// 详情
{
path: '/activity/item/:id',
component: Layout,
children: [
{
path: '',
name: 'item',
component: () => import('@/views/Item.vue')
},
// 修改
{
path: 'update',
name: 'edit',
component: () => import('@/views/Edit.vue')
},
// 加入活动
{
path: 'join',
name: 'join',
component: () => import('@/views/Join.vue')
},
// 查看已加入
{
path: 'joined',
name: 'joined',
component: () => import('@/views/Joined.vue')
},
// 全部回复
{
path: 'comment/:commentId',
name: 'comment',
component: () => import('@/views/Comment.vue')
}
]
},
// 首页
{ {
path: '/', path: '/',
name: 'home', name: 'home',
...@@ -155,6 +100,12 @@ const routes = [ ...@@ -155,6 +100,12 @@ const routes = [
name: 'activityItem', name: 'activityItem',
component: () => import('@/views/activity/Item.vue') component: () => import('@/views/activity/Item.vue')
}, },
// 活动评论
{
path: '/activity/:id/comment/:commentId',
name: 'activityComment',
component: () => import('@/views/activity/Comment.vue')
},
// 编辑活动 // 编辑活动
{ {
path: '/activity/:id/update', path: '/activity/:id/update',
......
<template>
<div class="main">
<v-form ref="form" :fields="page.form.fields" @submit="onSubmit"></v-form>
<div class="fixed-box">
<div class="fixed-inner">
<div class="fixed-button" @click="handleSubmit">提交</div>
</div>
</div>
</div>
</template>
<script>
import VForm from '@/components/Form'
import * as api from '@/api/index'
const pages = {
10: {
title: '发布活动',
form: {
fields: [
{
name: 'activity_name',
label: '主题',
required: true,
placeholder: '请输入活动主题',
rules: [{ required: true, message: '请输入活动主题' }]
},
{
fieldType: 'uploader',
name: 'activity_image',
label: '封面',
placeholder: '请上传活动封面'
},
{
type: 'textarea',
name: 'activity_contents',
label: '内容',
required: true,
placeholder: '请输入活动内容',
autosize: { maxHeight: 120, minHeight: 120 },
rules: [{ required: true, message: '请输入活动内容' }]
},
{
fieldType: 'datetime',
name: 'activity_time',
label: '时间',
required: true,
placeholder: '请选择活动时间',
rules: [{ required: true, message: '请选择活动时间' }]
},
{
name: 'activity_city',
label: '城市',
required: true,
placeholder: '请输入活动城市',
rules: [{ required: true, message: '请输入活动城市' }]
},
{
name: 'activity_address',
label: '具体地址',
required: true,
placeholder: '请输入活动具体地址',
rules: [{ required: true, message: '请输入活动具体地址' }]
},
{
type: 'digit',
name: 'participator_limit',
label: '希望人数',
required: true,
placeholder: '请输入希望人数',
rules: [{ required: true, message: '请输入希望人数' }]
}
]
}
},
20: {
title: '发布需求',
form: {
fields: [
{
fieldType: 'select',
name: 'activity_demand_type',
label: '类型',
required: true,
placeholder: '请选择需求类型',
rules: [{ required: true, message: '请选择需求类型' }],
values: [
{ name: '10', text: '行业资讯' },
{ name: '11', text: '就业招聘' },
{ name: '12', text: '需求对接' }
],
valueKey: 'name'
},
{
name: 'activity_name',
label: '主题',
required: true,
placeholder: '请输入需求主题',
rules: [{ required: true, message: '请输入需求主题' }]
},
{
type: 'textarea',
name: 'activity_contents',
label: '内容',
required: true,
placeholder: '请输入需求内容',
autosize: { maxHeight: 160, minHeight: 120 },
rules: [{ required: true, message: '请输入需求内容' }]
}
]
}
}
}
export default {
name: 'Create',
components: { VForm },
metaInfo() {
return {
title: this.page.title
}
},
data() {
return {}
},
computed: {
publishType() {
return this.$route.query.publish_type || '10'
},
page() {
return pages[this.publishType] || {}
}
},
methods: {
handleSubmit() {
this.$refs.form.submit()
},
onSubmit(data) {
const ruleForm = this.$refs.form.ruleForm
if (data.activity_image) {
const [first = { url: '' }] = data.activity_image
data.activity_image = first.url
}
data.activity_type = this.publishType
data.activity_demand_type = ruleForm.activity_demand_type || 0
api.createActivity(data).then(response => {
if (response.success) {
this.$dialog
.alert({
confirmButtonText: '确定',
message: '提交成功,可在“我发起的”里查看审核结果'
})
.then(() => {
this.$router.push({ name: 'index', query: { tab: '2' } })
})
} else {
this.$toast(response.message)
}
})
}
}
}
</script>
<style lang="scss"></style>
<template>
<div class="main">
<v-form
ref="form"
:model="formModel"
:fields="page.form.fields"
@submit="onSubmit"
></v-form>
<div class="fixed-box">
<div class="fixed-inner">
<div class="fixed-button" @click="handleSubmit">提交</div>
</div>
</div>
</div>
</template>
<script>
import VForm from '@/components/Form'
import * as api from '@/api/index'
const pages = {
10: {
title: '编辑活动',
form: {
fields: [
{
name: 'activity_name',
label: '主题',
required: true,
placeholder: '请输入活动主题',
rules: [{ required: true, message: '请输入活动主题' }]
},
{
fieldType: 'uploader',
name: 'activity_image',
label: '封面',
placeholder: '请上传活动封面'
},
{
type: 'textarea',
name: 'activity_contents',
label: '内容',
required: true,
placeholder: '请输入活动内容',
autosize: { maxHeight: 120, minHeight: 120 },
rules: [{ required: true, message: '请输入活动内容' }]
},
{
fieldType: 'datetime',
name: 'activity_time',
label: '时间',
required: true,
placeholder: '请选择活动时间',
rules: [{ required: true, message: '请选择活动时间' }]
},
{
name: 'activity_city',
label: '城市',
required: true,
placeholder: '请输入活动城市',
rules: [{ required: true, message: '请输入活动城市' }]
},
{
name: 'activity_address',
label: '具体地址',
required: true,
placeholder: '请输入活动具体地址',
rules: [{ required: true, message: '请输入活动具体地址' }]
},
{
type: 'digit',
name: 'participator_limit',
label: '希望人数',
required: true,
placeholder: '请输入希望人数',
rules: [{ required: true, message: '请输入希望人数' }]
}
]
}
},
20: {
title: '编辑需求',
form: {
fields: [
{
fieldType: 'select',
name: 'activity_demand_type',
label: '类型',
required: true,
placeholder: '请选择需求类型',
rules: [{ required: true, message: '请选择需求类型' }],
values: [
{ name: '10', text: '行业资讯' },
{ name: '11', text: '就业招聘' },
{ name: '12', text: '需求对接' }
],
valueKey: 'name'
},
{
name: 'activity_name',
label: '主题',
required: true,
placeholder: '请输入需求主题',
rules: [{ required: true, message: '请输入需求主题' }]
},
{
type: 'textarea',
name: 'activity_contents',
label: '内容',
required: true,
placeholder: '请输入需求内容',
autosize: { maxHeight: 160, minHeight: 120 },
rules: [{ required: true, message: '请输入需求内容' }]
}
]
}
}
}
export default {
name: 'Edit',
components: { VForm },
metaInfo() {
return {
title: this.page.title
}
},
data() {
return {
formModel: {}
}
},
computed: {
publishType() {
return this.formModel.activity_type || '10'
},
page() {
return pages[this.publishType] || {}
},
pid() {
return this.$route.params.id
}
},
methods: {
handleSubmit() {
this.$refs.form.submit()
},
onSubmit(data) {
const ruleForm = this.$refs.form.ruleForm
if (data.activity_image) {
const [first = { url: '' }] = data.activity_image
data.activity_image = first.url
}
data.activity_type = this.publishType
data.activity_demand_type = ruleForm.activity_demand_type || 0
api.updateActivity(this.pid, data).then(response => {
if (response.success) {
this.$dialog
.alert({
confirmButtonText: '确定',
message: '提交成功,可在“我发起的”里查看审核结果'
})
.then(() => {
this.$router.push({ name: 'index', query: { tab: '2' } })
})
} else {
this.$toast(response.message)
}
})
},
getDetail() {
const toast = this.$toast.loading({
message: '加载中...',
forbidClick: true,
duration: 0
})
api
.getActivity(this.pid)
.then(response => {
this.formModel = response
toast.clear()
})
.catch(toast.clear)
}
},
beforeMount() {
this.getDetail()
}
}
</script>
<style lang="scss"></style>
<template>
<div class="list">
<van-list
v-model="loading"
:finished="finished"
@load="onLoad"
v-if="list.length"
>
<hot-card v-for="item in list" :data="item" :key="item.id"></hot-card>
</van-list>
<div class="empty" v-else>暂无热门推荐</div>
</div>
</template>
<script>
import * as api from '@/api/index'
import HotCard from '@/components/HotCard'
export default {
components: { HotCard },
data() {
return {
list: [],
loading: false,
finished: false,
page: { offset: 0, limit: 10 }
}
},
methods: {
getList() {
this.loading = true
api
.getHotList(this.page)
.then(response => {
if (response.length) {
this.list = this.list.concat(response)
}
this.loading = false
this.finished = response.length < this.page.limit
})
.catch(() => {
this.loading = false
this.finished = true
})
},
onLoad() {
this.page.offset = this.page.offset + this.page.limit
this.getList()
}
},
beforeMount() {
this.getList()
}
}
</script>
<template>
<div class="main-list">
<van-tabs v-model="tabActive" sticky @click="onTabClick">
<van-tab title="热门推荐" name="0">
<hot-list />
</van-tab>
<van-tab title="我参与的" name="1">
<join-list />
</van-tab>
<van-tab title="我发起的" name="2">
<publish-list />
</van-tab>
</van-tabs>
<div class="publish-button" @click="publishVisible = true"></div>
<van-popup v-model="publishVisible" position="bottom">
<div class="publish">
<ul>
<li @click="toCreatePage('10')">
<img src="~@/assets/img/icon_publish1.png" />发布活动
</li>
<li @click="toCreatePage('20')">
<img src="~@/assets/img/icon_publish2.png" />发布需求
</li>
</ul>
<div class="close" @click="publishVisible = false"></div>
</div>
</van-popup>
</div>
</template>
<script>
import HotList from './HotList'
import JoinList from './JoinList'
import PublishList from './PublishList'
export default {
components: { HotList, JoinList, PublishList },
metaInfo: {
title: '紫荆校友圈'
},
data() {
return {
tabActive: '0',
publishVisible: false
}
},
watch: {
$route: {
immediate: true,
depp: true,
handler(route) {
this.tabActive = route.query.tab || '0'
}
}
},
methods: {
onTabClick(name) {
this.$router.push({ query: { tab: name } })
},
toCreatePage(type) {
this.$router.push({ name: 'create', query: { publish_type: type } })
}
}
}
</script>
<style lang="scss" scoped>
.main-list {
padding-bottom: 100px;
}
.publish-button {
position: fixed;
left: 50%;
bottom: 20px;
width: 72px;
height: 72px;
margin-bottom: env(safe-area-inset-bottom);
background: url('~@/assets/img/icon_plus.png') no-repeat;
background-size: contain;
z-index: 100;
cursor: pointer;
transform: translateX(-50%);
}
.publish {
ul {
padding: 24px 0 30px;
display: flex;
align-items: center;
justify-content: center;
border-bottom: 1px solid #f5f5f5;
}
li {
width: 70px;
margin: 0 35px;
text-align: center;
color: #f38580;
}
img {
width: 100%;
}
.close {
height: 50px;
background: url('~@/assets/img/icon_close.png') no-repeat center center;
background-size: 15px;
}
}
::v-deep .van-tab--active {
color: #f38580;
}
::v-deep .van-tabs__line {
background-color: #f38580;
}
</style>
<template>
<div class="detail">
<!-- 作者 -->
<div class="detail-user" v-if="detail.initiator">
<div class="detail-user__pic">
<img :src="detail.initiator.avatar | avatar" />
</div>
<div class="detail-user__content">
<p>{{ detail.initiator.nickname }}</p>
<p>{{ datetimeText }}</p>
</div>
<div class="detail-user__tool" v-if="canJoin">
<span class="join-button" v-if="detail.has_joined">已报名</span>
<span
class="join-button"
@click="$router.push({ name: 'join', params: { id: pid } })"
v-else
>报名</span
>
</div>
</div>
<!-- 标题 -->
<div class="detail-title">
<h1>{{ detail.activity_name }}</h1>
</div>
<!-- 封面 -->
<div class="detail-pic" v-if="detail.activity_image">
<img :src="detail.activity_image" />
</div>
<!-- 内容 -->
<div class="detail-content" v-html="contentHtml"></div>
<div class="detail-form" v-if="detail.activity_type === '10'">
<div class="detail-form__item" v-if="detail.activity_time">
<div class="detail-form__label">
<span class="detail-form-icon detail-form-icon__clock"></span>
时间:
</div>
<div class="detail-form__content">{{ detail.activity_time }}</div>
</div>
<div class="detail-form__item" v-if="detail.activity_address">
<div class="detail-form__label">
<span class="detail-form-icon detail-form-icon__address"></span>
地点:
</div>
<div class="detail-form__content">{{ detail.activity_address }}</div>
</div>
<div class="detail-form__item" v-if="detail.participator_limit">
<div class="detail-form__label">
<span class="detail-form-icon detail-form-icon__peoples"></span>
希望人数:
</div>
<div class="detail-form__content">
{{ detail.participator_limit }}
</div>
</div>
</div>
<!-- 评论 -->
<div class="detail-comments" v-if="hasComment">
<comment-list
relatedType="1"
:activityId="pid"
:data="commentList"
@update="getCommentList"
></comment-list>
</div>
</div>
</template>
<script>
import CommentList from '@/components/CommentList'
import * as api from '@/api/index'
import { format } from 'timeago.js'
export default {
components: { CommentList },
metaInfo: {
title: '紫荆校友圈'
},
data() {
return {
detail: {
activity_contents: ''
},
commentList: []
}
},
computed: {
pid() {
return this.$route.params.id
},
datetimeText() {
return format(this.detail.created_time, 'zh_CN')
},
isPass() {
return this.detail.approve_status === '1'
},
isMyPublished() {
return !!this.detail.my_published
},
hasComment() {
return false
// return this.detail.comment_switch === '1'
},
contentHtml() {
const content = this.detail.activity_contents || ''
return content.replace(/\r\n|\n/gi, '<br />')
},
canJoin() {
return (
this.isPass && !this.isMyPublished && this.detail.activity_type === '10'
)
}
},
methods: {
// 详情
getDetail() {
const toast = this.$toast.loading({
message: '加载中...',
forbidClick: true,
duration: 0
})
api
.getActivity(this.pid)
.then(response => {
this.detail = response
toast.clear()
})
.catch(toast.clear)
},
// 热门评论
getCommentList() {
api.getCommentList(this.pid).then(response => {
this.commentList = response
})
}
},
beforeMount() {
this.getDetail()
this.getCommentList()
}
}
</script>
<style lang="scss" scoped>
.detail {
padding: 0 20px;
}
.detail-pic {
margin-left: -20px;
margin-right: -20px;
margin-top: 20px;
img {
width: 100%;
}
}
.detail-user {
display: flex;
align-items: center;
}
.detail-user__pic {
width: 40px;
height: 40px;
background-color: #ccc;
border-radius: 50%;
overflow: hidden;
img {
width: 100%;
height: 100%;
}
}
.detail-user__content {
flex: 1;
padding-left: 20px;
p {
font-size: 13px;
color: #999;
}
}
.join-button {
display: inline-block;
height: 30px;
padding: 0 20px;
line-height: 30px;
color: #fff;
background: linear-gradient(
180deg,
rgba(255, 155, 150, 1) 0%,
rgba(206, 62, 58, 1) 100%
);
border-radius: 20px;
cursor: pointer;
}
.detail-title {
margin-top: 20px;
h1 {
font-size: 18px;
color: #333;
line-height: 26px;
}
}
.detail-content {
margin-top: 20px;
font-size: 15px;
color: #666;
line-height: 30px;
p {
font-size: 15px;
color: #666;
line-height: 30px;
text-indent: 2em;
}
}
.detail-form__item {
display: flex;
align-items: flex-start;
margin-top: 20px;
line-height: 20px;
}
.detail-form__label {
display: flex;
}
.detail-form__content {
flex: 1;
overflow: hidden;
}
.detail-form-icon {
display: inline-block;
width: 20px;
height: 20px;
margin-right: 10px;
}
.detail-form-icon__clock {
background: url('~@/assets/img/icon_clock.png') no-repeat center;
background-size: contain;
}
.detail-form-icon__address {
background: url('~@/assets/img/icon_address.png') no-repeat center;
background-size: contain;
}
.detail-form-icon__peoples {
background: url('~@/assets/img/icon_peoples.png') no-repeat center;
background-size: contain;
}
</style>
<template>
<div class="main">
<v-form
ref="form"
:model="formModel"
:fields="fields"
@submit="onSubmit"
></v-form>
<div class="fixed-box">
<div class="fixed-inner">
<div class="fixed-button" @click="handleSubmit">提交</div>
</div>
</div>
</div>
</template>
<script>
import VForm from '@/components/Form'
import * as api from '@/api/index'
export default {
name: 'Join',
components: { VForm },
metaInfo: {
title: '活动报名'
},
data() {
return {
formModel: {
self_introduction: '申请参加活动,感谢~'
},
fields: [
{
name: 'personal_name',
label: '姓名',
required: true,
placeholder: '请输入姓名',
rules: [{ required: true, message: '请输入姓名' }]
},
{
type: 'tel',
name: 'mobile',
label: '手机号码',
required: true,
placeholder: '请输入手机号码',
rules: [{ required: true, message: '请输入手机号码' }]
},
{
name: 'contacts',
label: '联系方式',
required: true,
placeholder: '请输入手机号或微信号,仅发起人可见',
rules: [{ required: true, message: '请输入手机号或微信号' }]
},
{
fieldType: 'radio',
name: 'gender',
label: '真实性别',
required: true,
placeholder: '请选择性别',
rules: [{ required: true, message: '请选择性别' }],
values: [
{ name: '1', text: '男' },
{ name: '0', text: '女' }
]
},
{
name: 'class_name',
label: '班级名称',
required: true,
placeholder: '请输入班级名称',
rules: [{ required: true, message: '请输入班级名称' }]
},
{
type: 'textarea',
name: 'self_introduction',
label: '自我介绍(选填)',
placeholder:
'发起人会根据您的自我介绍来判断是否与 你同行,请认真诚恳的介绍下自己',
autosize: { maxHeight: 160, minHeight: 120 }
}
]
}
},
computed: {
pid() {
return this.$route.params.id
}
},
methods: {
handleSubmit() {
this.$refs.form.submit()
},
onSubmit(data) {
data.activity_id = this.pid
api.joinActivity(data).then(response => {
if (response.success) {
this.$dialog
.alert({
confirmButtonText: '确定',
message: '提交成功,可在“我参与的”里查看申请记录'
})
.then(() => {
this.$router.push({ name: 'index', query: { tab: '1' } })
})
} else {
this.$toast(response.message)
}
})
}
}
}
</script>
<style lang="scss" scoped>
::v-deep .van-radio-group--horizontal {
flex: 1;
.van-radio--horizontal {
flex: 1;
justify-content: center;
height: 40px;
border: 1px solid #999;
&[aria-checked='true'] {
background-color: #f38580;
border: 1px solid #f38580;
&:first-child {
background-color: #1989fa;
border: 1px solid #1989fa;
}
.van-radio__label {
color: #fff;
}
}
&:last-child {
margin-right: 0;
}
.van-radio__icon {
display: none;
}
}
}
</style>
<template>
<div class="list">
<van-list
v-model="loading"
:finished="finished"
@load="onLoad"
v-if="list.length"
>
<join-card v-for="item in list" :data="item" :key="item.id"></join-card>
</van-list>
<div class="empty" v-else>您还没有参与过活动哟</div>
</div>
</template>
<script>
import * as api from '@/api/index'
import JoinCard from '@/components/JoinCard'
export default {
components: { JoinCard },
data() {
return {
list: [],
loading: false,
finished: false,
page: { offset: 0, limit: 10 }
}
},
methods: {
getList() {
this.loading = true
api
.getJoinList(this.page)
.then(response => {
if (response.length) {
this.list = this.list.concat(response)
}
this.loading = false
this.finished = response.length < this.page.limit
})
.catch(() => {
this.loading = false
this.finished = true
})
},
onLoad() {
this.page.offset = this.page.offset + this.page.limit
this.getList()
}
},
beforeMount() {
this.getList()
}
}
</script>
<template>
<div class="main">
<joined-card
v-for="(item, index) in detail.participant_list"
:data="item"
:key="index"
></joined-card>
</div>
</template>
<script>
import * as api from '@/api/index'
import JoinedCard from '@/components/JoinedCard'
export default {
components: { JoinedCard },
metaInfo: {
title: '查看已报名'
},
data() {
return {
detail: {
participant_list: []
}
}
},
computed: {
pid() {
return this.$route.params.id
}
},
methods: {
getDetail() {
api.getActivity(this.pid).then(response => {
this.detail = response
})
}
},
beforeMount() {
this.getDetail()
}
}
</script>
<style lang="scss" scoped></style>
<template>
<div class="list">
<van-list
v-model="loading"
:finished="finished"
@load="onLoad"
v-if="list.length"
>
<publish-card
v-for="item in list"
:data="item"
:key="item.id"
@remove="onRemove"
></publish-card>
</van-list>
<div class="empty" v-else>您还没有发起过活动哟</div>
</div>
</template>
<script>
import * as api from '@/api/index'
import PublishCard from '@/components/PublishCard'
export default {
components: { PublishCard },
data() {
return {
list: [],
loading: false,
finished: false,
page: { offset: 0, limit: 10 }
}
},
methods: {
getList() {
this.loading = true
api
.getPublishList(this.page)
.then(response => {
if (response.length) {
this.list = this.list.concat(response)
}
this.loading = false
this.finished = response.length < this.page.limit
})
.catch(() => {
this.loading = false
this.finished = true
})
},
onLoad() {
this.page.offset = this.page.offset + this.page.limit
this.getList()
},
onRemove(data) {
this.$dialog
.confirm({
confirmButtonText: '确定',
message: '确定要删除吗?'
})
.then(() => {
api.deleteActivity(data.id).then(response => {
if (response.success) {
this.$toast('删除成功')
this.list = this.list.filter(item => item.id !== data.id)
} else {
this.$toast(response.message)
}
})
})
.catch(() => {
// on cancel
})
}
},
beforeMount() {
this.getList()
}
}
</script>
<template> <template>
<div class="main-comment" v-if="detail.id"> <div class="main" v-if="detail.id">
<!-- 当前评论 --> <!-- 当前评论 -->
<div class="comment-detail"> <div class="comment-detail">
<h2>当前评论</h2> <h2>当前评论</h2>
<comment-card <comment-item
relatedType="1" relatedType="1"
:data="detail" :data="detail"
:activityId="activityId" :activityId="activityId"
:hasReply="false" :hasReply="false"
:hasRemove="false" :hasRemove="false"
:clickDisabled="true" :clickDisabled="true"
></comment-card> ></comment-item>
</div> </div>
<!-- 全部回复 --> <!-- 全部回复 -->
<comment-list <comment-list
...@@ -29,11 +29,11 @@ ...@@ -29,11 +29,11 @@
<script> <script>
import CommentList from '@/components/CommentList' import CommentList from '@/components/CommentList'
import CommentCard from '@/components/CommentCard' import CommentItem from '@/components/CommentItem'
import * as api from '@/api/index' import * as api from '@/api/index'
export default { export default {
components: { CommentList, CommentCard }, components: { CommentList, CommentItem },
metaInfo: { metaInfo: {
title: '全部回复' title: '全部回复'
}, },
...@@ -76,10 +76,8 @@ export default { ...@@ -76,10 +76,8 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.main-comment {
padding: 0 20px;
}
.comment-detail { .comment-detail {
padding-top: 20px;
h2 { h2 {
font-size: 18px; font-size: 18px;
font-weight: normal; font-weight: normal;
......
...@@ -14,13 +14,18 @@ ...@@ -14,13 +14,18 @@
<p>{{ datetimeText }}</p> <p>{{ datetimeText }}</p>
</div> </div>
<div class="detail-user__tool" v-if="canJoin"> <div class="detail-user__tool" v-if="canJoin">
<span class="join-button" v-if="detail.has_joined">已报名</span>
<span <span
class="join-button" class="join-button"
@click="$router.push({ name: 'join', params: { id: pid } })" @click="joinActivity"
v-else v-if="detail.button_show === 1"
>报名</span >报名</span
> >
<span
class="join-button"
v-if="detail.button_show === 2"
@click="cancelJoinActivity"
>已报名</span
>
</div> </div>
</div> </div>
<!-- 封面 --> <!-- 封面 -->
...@@ -95,7 +100,7 @@ export default { ...@@ -95,7 +100,7 @@ export default {
return this.detail.approve_status === '1' return this.detail.approve_status === '1'
}, },
isMyPublished() { isMyPublished() {
return !!this.detail.my_published return !!this.detail.is_mine
}, },
hasComment() { hasComment() {
return this.detail.comment_switch === '1' return this.detail.comment_switch === '1'
...@@ -105,8 +110,11 @@ export default { ...@@ -105,8 +110,11 @@ export default {
return content.replace(/\r\n|\n/gi, '<br />') return content.replace(/\r\n|\n/gi, '<br />')
}, },
canJoin() { canJoin() {
// 1显示报名2显示取消3均不显示
return ( return (
this.isPass && !this.isMyPublished && this.detail.activity_type === '10' this.isPass &&
!this.isMyPublished &&
[1, 2].includes(this.detail.button_show)
) )
} }
}, },
...@@ -131,6 +139,18 @@ export default { ...@@ -131,6 +139,18 @@ export default {
api.getCommentList(this.pid).then(response => { api.getCommentList(this.pid).then(response => {
this.commentList = response this.commentList = response
}) })
},
// 报名
joinActivity() {
api.joinActivity(this.pid).then(() => {
this.getDetail()
})
},
// 取消报名
cancelJoinActivity() {
api.cancelJoinActivity(this.pid).then(() => {
this.getDetail()
})
} }
}, },
beforeMount() { beforeMount() {
......
...@@ -79,7 +79,12 @@ export default { ...@@ -79,7 +79,12 @@ export default {
rules: [{ required: true, message: '请选择审核本活动的上级组织' }], rules: [{ required: true, message: '请选择审核本活动的上级组织' }],
labelKey: 'org_name', labelKey: 'org_name',
valueKey: 'id', valueKey: 'id',
remote: { method: api.getJoinedGroupes } remote: {
method: api.getJoinedGroupes,
callback(response) {
return response.filter(item => item.is_mine)
}
}
}, },
{ {
fieldType: 'select', fieldType: 'select',
......
...@@ -180,6 +180,10 @@ export default { ...@@ -180,6 +180,10 @@ export default {
.getGroup(this.pid) .getGroup(this.pid)
.then(response => { .then(response => {
this.formModel = response this.formModel = response
// 城市设置
if (['1', '3'].includes(response.org_type)) {
this.formModel.area = `${response.org_province}-${response.org_city}`
}
toast.clear() toast.clear()
}) })
.catch(toast.clear) .catch(toast.clear)
......
...@@ -11,7 +11,9 @@ ...@@ -11,7 +11,9 @@
</ul> </ul>
</div> </div>
<div class="user"> <div class="user">
<div class="user-avatar"><img :src="user.avatar | avatar" /></div> <div class="user-avatar">
<img :src="user.avatar | avatar" />
</div>
<div class="user-content"> <div class="user-content">
<div class="user-content__name">{{ user.personal_name }}</div> <div class="user-content__name">{{ user.personal_name }}</div>
<div class="user-content__info">{{ user.class_name }}</div> <div class="user-content__info">{{ user.class_name }}</div>
...@@ -25,10 +27,13 @@ ...@@ -25,10 +27,13 @@
<dt>{{ detail.act_stu_total }}</dt> <dt>{{ detail.act_stu_total }}</dt>
<dd>活动</dd> <dd>活动</dd>
</dl> </dl>
<dl @click="$router.push({ name: 'myApprove' })"> <!-- <dl @click="$router.push({ name: 'myApprove' })">
<dt>{{ detail.act_check_total }}</dt> <dt>
{{ detail.act_check_total }}
<span class="badge" v-if="hasBadge"></span>
</dt>
<dd>审批</dd> <dd>审批</dd>
</dl> </dl>-->
</div> </div>
</div> </div>
<van-tabs v-model="tabActive" :line-height="2"> <van-tabs v-model="tabActive" :line-height="2">
...@@ -38,9 +43,13 @@ ...@@ -38,9 +43,13 @@
<van-tab title="我的活动" name="1"> <van-tab title="我的活动" name="1">
<my-activity-list></my-activity-list> <my-activity-list></my-activity-list>
</van-tab> </van-tab>
<van-tab title="我的审批" name="2"> <!-- <van-tab title="我的审批" name="2">
<template #title
>我的审批
<span class="badge" style="top:-10px;" v-if="hasBadge"></span>
</template>
<my-approve-list></my-approve-list> <my-approve-list></my-approve-list>
</van-tab> </van-tab>-->
</van-tabs> </van-tabs>
<tab-bar></tab-bar> <tab-bar></tab-bar>
</div> </div>
...@@ -51,12 +60,11 @@ ...@@ -51,12 +60,11 @@
import TabBar from '@/components/TabBar' import TabBar from '@/components/TabBar'
import MyGroupList from '@/components/MyGroupList' import MyGroupList from '@/components/MyGroupList'
import MyActivityList from '@/components/MyActivityList' import MyActivityList from '@/components/MyActivityList'
import MyApproveList from '@/components/MyApproveList'
import * as api from '@/api' import * as api from '@/api'
export default { export default {
name: 'MyIndex', name: 'MyIndex',
components: { TabBar, MyGroupList, MyActivityList, MyApproveList }, components: { TabBar, MyGroupList, MyActivityList },
data() { data() {
return { return {
tabActive: '0', tabActive: '0',
...@@ -75,6 +83,9 @@ export default { ...@@ -75,6 +83,9 @@ export default {
computed: { computed: {
user() { user() {
return this.detail.user || {} return this.detail.user || {}
},
hasBadge() {
return !!parseInt(this.detail.act_uncheck_total)
} }
}, },
methods: { methods: {
...@@ -149,8 +160,19 @@ export default { ...@@ -149,8 +160,19 @@ export default {
dd { dd {
color: #999; color: #999;
} }
.badge {
top: -15px;
}
} }
.my .list { .my .list {
margin-top: 20px; margin-top: 20px;
} }
.badge {
position: relative;
display: inline-block;
width: 4px;
height: 4px;
background: rgba(255, 103, 103, 1);
border-radius: 50%;
}
</style> </style>
...@@ -3,14 +3,14 @@ ...@@ -3,14 +3,14 @@
<card title="我的组织"> <card title="我的组织">
<my-group-list @finished="onFinished"></my-group-list> <my-group-list @finished="onFinished"></my-group-list>
<template v-if="finished"> <template v-if="finished">
<div <!-- <div
class="create-button" class="create-button"
v-if="list.length < 6" v-if="list.length < 6"
@click="$router.push({ name: 'createGroup' })" @click="$router.push({ name: 'createGroup' })"
> >
<i class="icon"></i> <i class="icon"></i>
<span>创建新组织</span> <span>创建新组织</span>
</div> </div> -->
<p class="tips"> <p class="tips">
没有更多啦,<router-link :to="{ name: 'group' }" 没有更多啦,<router-link :to="{ name: 'group' }"
>去逛逛排行榜吧~</router-link >去逛逛排行榜吧~</router-link
......
...@@ -15,7 +15,8 @@ ...@@ -15,7 +15,8 @@
v-if="tabActive === '0'" v-if="tabActive === '0'"
> >
<template #empty> <template #empty>
<div class="search-empty">暂时没有内容哦,来做第一人吧~</div> <div class="search-empty">暂时没有内容哦,换个搜索词试试吧~</div>
<!-- <div class="search-empty">暂时没有内容哦,来做第一人吧~</div>
<div class="group-create"> <div class="group-create">
<input <input
type="button" type="button"
...@@ -30,7 +31,7 @@ ...@@ -30,7 +31,7 @@
>我的组织~</router-link >我的组织~</router-link
> >
</p> </p>
</div> </div> -->
</template> </template>
</group-list> </group-list>
</van-tab> </van-tab>
......
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
<script> <script>
import Card from '@/components/Card' import Card from '@/components/Card'
import * as api from '@/api/account'
export default { export default {
name: 'Settings', name: 'Settings',
components: { Card }, components: { Card },
...@@ -23,7 +24,9 @@ export default { ...@@ -23,7 +24,9 @@ export default {
methods: { methods: {
// 退出登录 // 退出登录
logout() { logout() {
this.$router.push({ name: 'login' }) api.logout().then(() => {
this.$router.push({ name: 'login' })
})
} }
} }
} }
......
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论