475 lines
21 KiB
HTML
475 lines
21 KiB
HTML
<!--#
|
||
layout("/mobile/platform.html"){
|
||
#-->
|
||
|
||
<style>
|
||
|
||
.van-index-bar__sidebar {
|
||
display: none;
|
||
}
|
||
|
||
.van-doc-card {
|
||
margin: 14px;
|
||
padding: 12px 12px 12px 12px;
|
||
background-color: #fff;
|
||
border-radius: 10px;
|
||
box-shadow: 0 8px 12px #ebedf0;
|
||
line-height: 20px;
|
||
font-size: 13px;
|
||
position: relative;
|
||
}
|
||
|
||
.van-divider {
|
||
margin: 6px 0 6px 0px;
|
||
border-color: lightgray;
|
||
}
|
||
|
||
.van-button--small {
|
||
border-top-right-radius: 16px;
|
||
border-bottom-left-radius: 16px;
|
||
height: 26px;
|
||
}
|
||
|
||
.van-col {
|
||
line-height: 24px;
|
||
}
|
||
|
||
.title_span {
|
||
font-size: 16px;
|
||
font-weight: bold;
|
||
position: absolute;
|
||
left: -1px;
|
||
top: 11px;
|
||
color: #1867b0;
|
||
}
|
||
|
||
.title {
|
||
font-size: 13px;
|
||
font-weight: bold;
|
||
flex: 1;
|
||
overflow: hidden;
|
||
white-space: nowrap;
|
||
}
|
||
|
||
.cus_overflow {
|
||
overflow: hidden;
|
||
white-space: nowrap;
|
||
text-overflow: ellipsis;
|
||
}
|
||
|
||
.van-dropdown-menu__item {
|
||
flex: auto;
|
||
}
|
||
|
||
p {
|
||
margin: 0 !important;
|
||
}
|
||
|
||
.van-cell__title {
|
||
width: 30%;
|
||
}
|
||
|
||
.van-cell__title, .van-cell__value{
|
||
flex: none;
|
||
}
|
||
|
||
.van-cell__value {
|
||
width: 70%;
|
||
}
|
||
|
||
.footer {
|
||
background-color: white;
|
||
width: 100%;
|
||
height: 60px;
|
||
display: flex;
|
||
justify-content: space-evenly;
|
||
align-items: center;
|
||
left: 0;
|
||
}
|
||
|
||
.footer .van-button {
|
||
height: 34px;
|
||
border-radius: 6px;
|
||
width: 90% !important;
|
||
}
|
||
|
||
.join {
|
||
background-color: #0e78c5;
|
||
color: white;
|
||
}
|
||
|
||
</style>
|
||
|
||
<div id="app" v-cloak>
|
||
|
||
<m-page-loading v-if="mLoading"></m-page-loading>
|
||
|
||
<!--top栏-->
|
||
<van-nav-bar
|
||
title="加入社团"
|
||
left-arrow
|
||
placeholder
|
||
fixed
|
||
@click-left="history.go(-1)"
|
||
safe-area-inset-top
|
||
></van-nav-bar>
|
||
|
||
<!--筛选框-->
|
||
<div class="search-fixed">
|
||
<van-search
|
||
v-model="pageForm.searchKeyword"
|
||
shape="round"
|
||
maxlength="10"
|
||
@search="doSearch"
|
||
placeholder="请输入社团名称进行查询"
|
||
>
|
||
</van-search>
|
||
|
||
<van-dropdown-menu>
|
||
<van-dropdown-item v-model="pageForm.isjr" :options="clubType"
|
||
@change="doSearch"></van-dropdown-item>
|
||
<van-dropdown-item v-model="pageForm.clubType" :options="typeOptions"
|
||
@change="doSearch"></van-dropdown-item>
|
||
</van-dropdown-menu>
|
||
</div>
|
||
|
||
<!--列表-->
|
||
<div style="margin-top: 116px">
|
||
<van-list
|
||
v-model="loading"
|
||
:finished="finished" :immediate-check="false" @load="onLoad"
|
||
:finished-text="tableData.length>0?'没有更多了':''">
|
||
|
||
<div class="van-doc-card" v-for="o in tableData">
|
||
<div>
|
||
|
||
<div style="display: flex; justify-content: space-between">
|
||
<div style="width: 74%">
|
||
<div class="van-ellipsis title">
|
||
<span class="title_span">|</span>
|
||
<span>{{o.name}}</span>
|
||
</div>
|
||
<div style="color: grey">{{o.location}}</div>
|
||
</div>
|
||
<div style="color: #1867b0; white-space: nowrap;">
|
||
<span v-if="o.status==1">待社团审核</span>
|
||
<span v-if="o.status==2" style="color: red">社团拒绝</span>
|
||
<span v-if="o.status==3">待校工会审核</span>
|
||
<span v-if="o.status==4" style="color: red">校工会拒绝</span>
|
||
<span v-if="o.status==5" style="color: green">审核通过</span>
|
||
</div>
|
||
</div>
|
||
|
||
<div style="margin-top: 4px">
|
||
<van-row>
|
||
<van-col span="12"><span style="color: grey">联 系 人:</span>{{o.fzrname}}</van-col>
|
||
<van-col span="12">
|
||
<span style="color: grey">电  话:</span>
|
||
<span>{{o.fzr_mobile}}</span>
|
||
</van-col>
|
||
</van-row>
|
||
<van-row>
|
||
<van-col span="12"><span style="color: grey">会  长:</span>{{o.hz}}</van-col>
|
||
<van-col span="12">
|
||
<span style="color: grey">成立时间:</span>
|
||
<span>{{moment(o.foundTime).format('YYYY-MM-DD')}}</span>
|
||
</van-col>
|
||
</van-row>
|
||
</div>
|
||
|
||
<van-divider></van-divider>
|
||
|
||
<div style="display: flex; justify-content: flex-end">
|
||
<div>
|
||
<van-button @click="openInfo(o, 'view')" color="#1867b0"
|
||
size="small" style="margin-right: 8px" type="primary">
|
||
查看
|
||
</van-button>
|
||
<van-button @click="rollback(o)" color="#1867b0"
|
||
size="small" style="margin-right: 8px" type="primary"
|
||
v-if="pageForm.isjr === true && (o.status==1 || o.status==3)">撤销申请
|
||
</van-button>
|
||
<van-button @click="openInfo(o, 'join')"
|
||
color="#1867b0" v-if="pageForm.isjr === false"
|
||
size="small" style="margin-right: 8px" type="primary">
|
||
我要加入
|
||
</van-button>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</van-list>
|
||
<van-empty
|
||
v-if="mLoading==false&&tableData.length==0"
|
||
class="custom-image"
|
||
image="/none.svg"
|
||
description="暂无数据"
|
||
></van-empty>
|
||
</div>
|
||
|
||
<van-popup v-model="infoShow" get-container="#app" position="right" :style="{ height: '100%', width: '100%' }">
|
||
<van-nav-bar
|
||
title="社团详细信息"
|
||
left-arrow
|
||
placeholder
|
||
fixed
|
||
@click-left="infoShow = false"
|
||
safe-area-inset-top></van-nav-bar>
|
||
<van-tabs v-model="infoActive">
|
||
<van-tab title="社团信息">
|
||
<van-cell-group inset>
|
||
<van-cell title="社团名称">{{ detailData.name }}</van-cell>
|
||
<van-cell title="成立时间">{{ detailData.foundtime }}</van-cell>
|
||
<van-cell title="报名联系人">{{ detailData.fzrname }}</van-cell>
|
||
<van-cell title="所属单位">{{ detailData.fzr_unit_name }}</van-cell>
|
||
<van-cell title="联系人电话">{{ detailData.concatpersonmobile }}</van-cell>
|
||
<van-cell title="联系人邮箱">{{ detailData.concatpersonemail }}</van-cell>
|
||
<van-cell title="会费标准">{{ detailData.dues_standard }}</van-cell>
|
||
<van-cell title="当前人数">{{ detailData.cynum }}</van-cell>
|
||
<van-cell title="QQ群二维码" @click="showCode('QQ')">
|
||
<span style="cursor: pointer; color: #236eb4">点击查看</span>
|
||
</van-cell>
|
||
<van-cell title="微信群二维码" @click="showCode('weChat')">
|
||
<span style="cursor: pointer; color: #236eb4">点击查看</span>
|
||
</van-cell>
|
||
</van-cell-group>
|
||
</van-tab>
|
||
<van-tab v-if="viewType === 'join'" title="个人信息">
|
||
<van-form @submit="needJoin" ref="form" :show-error-message="false">
|
||
<van-cell-group inset class="mt10">
|
||
<van-field readonly v-model="formData.username" name="username"
|
||
label="姓名" :rules="[{ required: true }]"></van-field>
|
||
<van-field readonly v-model="formData.sex" name="sex"
|
||
label="性别" :rules="[{ required: true }]"></van-field>
|
||
<van-field v-model="formData.birthday" name="birthday" required
|
||
@click="showPicker = true"
|
||
placeholder="请填写出生年月" label="出生年月" :rules="[{ required: true }]">
|
||
</van-field>
|
||
<van-popup v-model="showPicker" position="bottom">
|
||
<van-datetime-picker
|
||
type="date"
|
||
title="选择年月日"
|
||
@confirm="(val) => {formData.birthday = moment(val).format('YYYY-MM-DD'); showPicker = false}"
|
||
@cancel="showPicker = false"
|
||
></van-datetime-picker>
|
||
</van-popup>
|
||
<van-field v-model="formData.birthPlace" name="birthPlace" required
|
||
placeholder="请填写出生地" label="出生地" :rules="[{ required: true }]"></van-field>
|
||
<van-field v-model="formData.education" name="education" required
|
||
placeholder="请填写文化程度" label="文化程度" :rules="[{ required: true }]"></van-field>
|
||
<van-field v-model="formData.hobby" name="hobby" required
|
||
placeholder="请填写爱好" label="爱好" :rules="[{ required: true }]"></van-field>
|
||
<van-field v-model="formData.unitName" name="unitName" required
|
||
readonly label="工作部门" :rules="[{ required: true }]"></van-field>
|
||
<van-field v-model="formData.position" name="position" required
|
||
placeholder="请填写职务" label="职务" :rules="[{ required: true }]"></van-field>
|
||
<van-field v-model="formData.mobile" name="mobile" required
|
||
placeholder="请填写电话" label="电话" :rules="[{ required: true }]"></van-field>
|
||
<van-field v-model="formData.email" name="email" required
|
||
placeholder="请填写电子邮箱" label="电子邮箱" :rules="[{ required: true }]"></van-field>
|
||
<van-field v-model="formData.homeAddress" name="homeAddress" required
|
||
placeholder="请填写家庭住址" label="家庭住址" :rules="[{ required: true }]"></van-field>
|
||
<van-field v-model="formData.QQNumber" name="QQNumber" required
|
||
placeholder="请填写QQ" label="QQ" :rules="[{ required: true }]"></van-field>
|
||
<van-field v-model="formData.bodyHeight" name="bodyHeight" required
|
||
placeholder="请填写身高" label="身高" :rules="[{ required: true }]"></van-field>
|
||
<van-field v-model="formData.bodyWeight" name="bodyWeight" required
|
||
placeholder="请填写体重" label="体重" :rules="[{ required: true }]"></van-field>
|
||
<van-field v-model="formData.health" name="health" required
|
||
placeholder="请填写身体状况" label="身体状况" :rules="[{ required: true }]"></van-field>
|
||
<van-field v-model="formData.sport" name="sport" required
|
||
placeholder="请填写经常从事的运动" label="经常从事的运动" :rules="[{ required: true }]"></van-field>
|
||
<van-field name="medicalHistory" required
|
||
placeholder="是否有过特殊病史" label="是否有过特殊病史">
|
||
<template #input>
|
||
<van-radio-group v-model="formData.medicalHistory" direction="horizontal">
|
||
<van-radio :name="true">是</van-radio>
|
||
<van-radio :name="false">否</van-radio>
|
||
</van-radio-group>
|
||
</template>
|
||
</van-field>
|
||
<van-field name="joinActivity" required
|
||
placeholder="是否愿意参加本协会的活动" label="是否愿意参加本协会的活动">
|
||
<template #input>
|
||
<van-radio-group v-model="formData.joinActivity" direction="horizontal">
|
||
<van-radio :name="true">是</van-radio>
|
||
<van-radio :name="false">否</van-radio>
|
||
</van-radio-group>
|
||
</template>
|
||
</van-field>
|
||
<van-field v-model="formData.otherThing" name="otherThing"
|
||
rows="1"
|
||
autosize
|
||
type="textarea"
|
||
placeholder="是否有特别需要说明的问题(身体或心理)" label="是否有特别需要说明的问题"></van-field>
|
||
<van-field v-model="formData.remark" name="remark"
|
||
rows="1"
|
||
autosize
|
||
type="textarea"
|
||
placeholder="备注" label="备注"></van-field>
|
||
<van-field name="photo" label="两寸登记照" required
|
||
style="flex-flow: column" input-align="left">
|
||
<template #label>
|
||
<div class="mb10">两寸登记照</div>
|
||
</template>
|
||
<template #input>
|
||
<vant-file-upload
|
||
:max="1"
|
||
:files.sync="formData.photo"></vant-file-upload>
|
||
</template>
|
||
</van-field>
|
||
</van-cell-group>
|
||
<div class="footer">
|
||
<van-button class="join join_submit" native-type="submit">申请加入</van-button>
|
||
</div>
|
||
</van-form>
|
||
</van-tab>
|
||
</van-tabs>
|
||
</van-popup>
|
||
|
||
</div>
|
||
|
||
<script>
|
||
var vue = new Vue({
|
||
el: '#app',
|
||
mixins: [mobileMixins],
|
||
data() {
|
||
return {
|
||
showPicker: false,
|
||
infoActive: 0,
|
||
clickRow: {},
|
||
typeOptions: [],
|
||
clubType: [{text: '未加入', value: false}, {text: '已加入', value: true}],
|
||
infoShow: false,
|
||
detailData: {},
|
||
viewType: '',
|
||
}
|
||
},
|
||
methods: {
|
||
showCode(type) {
|
||
if(type === 'QQ' && this.clickRow.qqgroupcode) {
|
||
const ids = JSON.parse(this.clickRow.qqgroupcode).map(o => FILE_DOMAIN + '/fileStreamPreview?id=' + o.id)
|
||
vant.ImagePreview({images: ids})
|
||
} else if(type === 'weChat' && this.clickRow.wechatgroupcode) {
|
||
const ids = JSON.parse(this.clickRow.wechatgroupcode).map(o => FILE_DOMAIN + '/fileStreamPreview?id=' + o.id)
|
||
vant.ImagePreview({images: ids})
|
||
}
|
||
},
|
||
doSearch() {
|
||
this.pageForm.pageNumber = 1
|
||
this.tableData = []
|
||
this.finished = false
|
||
this.onLoad()
|
||
},
|
||
async onLoad() {
|
||
this.loading = true
|
||
$.post('/platform/sys/club/sq/pageData', this.pageForm).then(res => {
|
||
if (res.code === 0) {
|
||
this.tableData = this.tableData.concat(res.data.list)
|
||
if (this.tableData.length === res.data.totalCount) {
|
||
this.finished = true
|
||
} else {
|
||
this.pageForm.pageNumber++
|
||
}
|
||
}
|
||
this.loading = false
|
||
})
|
||
},
|
||
openInfo(row, type) {
|
||
this.viewType = type
|
||
this.infoActive = type === 'view' ? 0 : 1
|
||
if(type === 'join') {
|
||
this.formData = {
|
||
username: "${@shiro.getPrincipalProperty('username')}",
|
||
sex: "${@shiro.getPrincipalProperty('sex')}",
|
||
birthday: "${@shiro.getPrincipalProperty('birthday')}",
|
||
birthPlace: "${@shiro.getPrincipalProperty('birthPlace')}",
|
||
education: "${@shiro.getPrincipalProperty('education')}",
|
||
hobby: "${@shiro.getPrincipalProperty('hobby')}",
|
||
unitName: "${@shiro.getPrincipalProperty('unit').getName()}",
|
||
position: "${@shiro.getPrincipalProperty('position')}",
|
||
mobile: "${@shiro.getPrincipalProperty('mobile')}",
|
||
email: "${@shiro.getPrincipalProperty('email')}",
|
||
homeAddress: "${@shiro.getPrincipalProperty('homeAddress')}",
|
||
}
|
||
}
|
||
this.clickRow = row
|
||
$.get("/platform/sys/club/mange/findOne", {id: row.id}, (data) => {
|
||
if (data.code === 0) {
|
||
this.detailData = data.data
|
||
this.infoShow = true
|
||
}
|
||
}, "json");
|
||
},
|
||
async needJoin() {
|
||
const row = this.clickRow
|
||
if(this.formData.medicalHistory === '' || this.formData.medicalHistory === undefined || this.formData.medicalHistory === null) {
|
||
vant.Toast('请选择是否有过特殊病史')
|
||
return
|
||
}
|
||
if(this.formData.joinActivity === '' || this.formData.joinActivity === undefined || this.formData.joinActivity === null) {
|
||
vant.Toast('请选择是否愿意参加本协会的活动')
|
||
return
|
||
}
|
||
if(this.formData.photo === '' || this.formData.photo === undefined || this.formData.photo === null) {
|
||
vant.Toast('请上传两寸登记照')
|
||
return
|
||
}
|
||
const {code, data} = await $.post('/platform/sys/club/sq/getInClubByCurUser')
|
||
let str = ''
|
||
if (data && data.length > 0) {
|
||
str = '您已经加入了'
|
||
data.forEach((item) => {
|
||
str += '【' + item.name + '】'
|
||
})
|
||
str += ','
|
||
}
|
||
str += '请确认是否申请加入【' + row.name + '】?'
|
||
vant.Dialog.confirm({title: '提示', message: str,}).then(() => {
|
||
this.formData.clubid = row.id
|
||
this.formData.photo = this.formData.photo[0].filepath
|
||
$.post("/platform/sys/club/sq/submit", this.formData, (data) => {
|
||
if (data.code === 0) {
|
||
vant.Toast(data.msg)
|
||
this.doSearch()
|
||
this.infoShow = false
|
||
} else {
|
||
vant.Toast(data.msg)
|
||
}
|
||
}, "json");
|
||
}).catch(() => {
|
||
});
|
||
},
|
||
rollback(o) {
|
||
vant.Dialog.confirm({title: '提示', message: '请确定是否撤销申请?',}).then(() => {
|
||
const id = o.id
|
||
$.post("/platform/sys/club/sq/revocation", {id}, (data) => {
|
||
if (data.code === 0) {
|
||
vant.Toast('撤销申请成功');
|
||
this.doSearch();
|
||
} else {
|
||
vant.Toast(data.msg);
|
||
}
|
||
}, "json");
|
||
}).catch(() => {
|
||
});
|
||
}
|
||
},
|
||
async created() {
|
||
const data = await getClubType()
|
||
data.forEach(item => {
|
||
this.typeOptions.push({text: item.name, value: item.code})
|
||
})
|
||
this.typeOptions.unshift({text: '全部类型'})
|
||
this.$set(this.pageForm, "clubType", this.typeOptions[0].value)
|
||
this.$set(this.pageForm, "isjr", this.clubType[0].value)
|
||
this.pageForm.searchName = 'club.name'
|
||
this.onLoad()
|
||
}
|
||
})
|
||
</script>
|
||
|
||
<!--#
|
||
}
|
||
#-->
|