Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
aixianling
2021-12-17 15:19:34 +08:00
30 changed files with 4164 additions and 266 deletions

View File

@@ -0,0 +1,603 @@
<template>
<div class="page">
<div class="header-content">
<div class="header-top">
<img :src="detail.url" alt="" />
</div>
<div class="header-middle">
<div class="img-title">{{ detail.title }}</div>
<div class="header-middle-bottom">
<div class="left">
<div class="left-btn" :class="'status' + detail.status">{{ $dict.getLabel('newActivityStatus', detail.status) }}</div>
</div>
<div class="right">
<img :src="detail.avatar" alt="" />
<span>{{ detail.createUserName }}</span>
</div>
</div>
<div class="cards">
<div class="cards-left">活动时间</div>
<div class="cards-right">{{ detail.beginTime }}-{{ detail.endTime }}</div>
</div>
<div class="cards">
<div class="cards-left">活动人数</div>
<div class="cards-right" @click="toSignUser()">
<span>
<span :style="{ color: detail.realNum == detail.total ? '#FF4466 ' : '#1C6BDF' }">{{ detail.realNum || 0 }}</span>
<span v-if="detail.total != 0">/{{ detail.total }}</span>
<span v-else>/不限</span>
</span>
<u-icon name="arrow-right" color="#DDDDDD" size="28" style="margin-left: 8px"></u-icon>
</div>
</div>
<div class="cards">
<div class="cards-left">活动地点</div>
<div class="cards-right" style="width: 75%; text-align: right">{{ detail.address }}</div>
</div>
</div>
<div class="header-bottom">
<!-- v-if="detail.status == 1 || detail.status == 2 || detail.status == 3" -->
<div class="tab-title">
<span :class="current == 0 ? 'active' : ''" @click="change(0)">活动详情</span>
<span :class="current == 1 ? 'active' : ''" @click="change(1)">活动动态</span>
</div>
<!-- <div class="info-title" v-else>活动详情</div> -->
<div class="content-details" v-if="current == 0">
<div v-html="detail.content"></div>
</div>
<div class="content-trends" v-if="current == 1">
<div class="details" v-if="activeList.length > 0">
<div class="card" v-for="(item, index) in activeList" :key="index" @click="toDetail(item.id)">
<div class="card-nav">
<div class="avatar">
<img :src="item.avatar" alt="" style="width: 100%; height: 100%" v-if="item.avatar" />
<span v-else>
<span v-if="item.name">{{ item.name.substring(item.name.length, item.name.length - 2) }}</span>
</span>
</div>
<div class="right">
<span class="name">{{ item.name }}</span>
<span class="time">{{ item.createTime }}</span>
</div>
</div>
<div class="card-font">
{{ item.content }}
</div>
<div class="card-img">
<img :src="e.url" v-for="(e, i) in imgList[index]" :key="i" alt="" @click.stop="previewImage(info.images, item.url)" />
</div>
<div class="card-icon">
<div>
<i class="iconfont">&#xe69d;</i>
<span>{{ item.viewNum ? item.viewNum : 0 }}</span>
</div>
<div>
<i class="iconfont">&#xe6a2;</i>
<span>{{ item.replyNum ? item.replyNum : 0 }}</span>
</div>
<div>
<i class="iconfont">&#xe698;</i>
<span>{{ item.supportNum ? item.supportNum : 0 }}</span>
</div>
</div>
</div>
<div class="card-bottom"></div>
</div>
<AiEmpty v-else />
</div>
</div>
</div>
<div class="addicon" @click="toPublicPage()">
<u-icon name="plus" color="#1365DD" size="50"></u-icon>
</div>
<div class="btn" v-if="detail.status == 0 && detail.createUserId == user.partyId">
<div class="edit" @click="editActive">编辑</div>
<div class="public" style="background: #3671ee" @click="changeStatus(1, '是否发布?')">发布活动</div>
</div>
<div class="btn" v-if="detail.realNum < detail.total && detail.status == 1 && detail.myReport == 0">
<div class="edit" @click="callPhone(detail.contactPhone)">电话咨询</div>
<div class="public" style="background: #3671ee" @click="changeStatus(2, '是否报名?')">立即报名</div>
</div>
<div class="btn" v-if="detail.status == 1 && detail.myReport == 0 && detail.total == 0">
<div class="edit" @click="callPhone(detail.contactPhone)">电话咨询</div>
<div class="public" style="background: #3671ee" @click="changeStatus(2, '是否报名?')">立即报名</div>
</div>
<div class="btn" v-if="detail.status == 1 && detail.myReport == 1">
<div class="edit" @click="callPhone(detail.contactPhone)">电话咨询</div>
<div class="public" style="background: #3671ee" @click="changeStatus(3, '是否取消报名?取消报名无法重新报名!')">取消报名</div>
</div>
<div class="btn" v-if="detail.realNum == detail.total && detail.status == 1 && detail.status == 1 && detail.total != 0">
<div class="max">已满员</div>
</div>
<div class="btn" v-if="detail.myReport == 1 && detail.status == 2">
<div class="edit" @click="callPhone(detail.contactPhone)">联系负责人</div>
<div class="public" style="background: #ffd8df; color: #ff4466" v-if="detail.allow1 == 0">未签到</div>
<div class="public" style="background: #3671ee; color: #ffffff" v-if="detail.allow1 == 1" @click="sign(0)">签到</div>
<div class="public" style="background: #cbead9; color: #20bc65" v-if="detail.allow1 == 2">已签到</div>
</div>
<div class="btn" v-if="detail.status == 5">
<div class="edit" @click="callPhone(detail.contactPhone)">联系负责人</div>
<div class="public" style="background: #cbead9; color: #20bc65" v-if="detail.allow2 == 1" @click="sign(1)">离场签到</div>
<div class="public" style="background: #cbead9; color: #20bc65" v-if="detail.allow2 == 2">已离场签到</div>
<div class="public" style="background: #ffd8df; color: #ff4466" v-if="detail.allow2 == 0">未离场签到</div>
</div>
</div>
</template>
<script>
import { mapState } from 'vuex'
export default {
name: 'ActiveDetail',
computed: {
...mapState(['user']),
},
data() {
return {
id: '',
detail: {},
activeList: [],
imgList: [],
list: [
{
name: '活动详情',
},
{
name: '活动动态',
},
],
current: 0,
}
},
onLoad(option) {
this.id = option.id
this.$dict.load(['newActivityStatus']).then(() => {
this.getDetail()
})
},
methods: {
getDetail() {
this.$instance.post(`/app/appactivityinfo/queryDetailById?id=${this.id}&partyId=${this.user.partyId}`).then((res) => {
if (res?.data) {
res.data.beginTime = res.data.beginTime.substring(0, 16)
res.data.endTime = res.data.endTime.substring(0, 16)
this.detail = res.data
this.getActiveList()
}
})
},
getActiveList() {
this.$instance.post(`/app/apppostinfo/list?activityId=${this.id}`).then((res) => {
if (res?.data) {
this.activeList = res.data.records
if (this.activeList) {
let imagesList = []
this.activeList.map((item) => {
if (item.images) {
item.images = JSON.parse(item.images || '[]')
imagesList.push(item.images)
}
return item
})
this.imgList = imagesList
}
}
})
},
change(index) {
this.current = index
},
toPublicPage() {
uni.navigateTo({
url: `./AddPosts?id=${this.id}`,
})
},
editActive() {
uni.navigateTo({ url: `./AddActive?id=${this.id}` })
},
changeStatus(status, text) {
uni.showModal({
title: '提示',
content: `${text}`,
confirmText: '确定',
success: (e) => {
if (status == 1) {
//发布
this.changeStatusConfirm(status)
}
if (status == 2) {
//报名
this.report()
}
if (status == 3) {
//取消报名
this.cancelReport()
}
},
})
},
cancelReport() {
this.$instance
.post(`/app/appactivityuser/removeReport`, {
activityId: this.id,
partyId: this.user.partyId,
})
.then((res) => {
if (res.code == 0) {
this.$toast('提交成功')
this.getDetail()
}
})
},
changeStatusConfirm(status) {
this.$instance
.post(`/app/appactivityinfo/changeStatus`, {
id: this.id,
status: status,
})
.then((res) => {
if (res.code == 0) {
this.$toast('提交成功')
this.getDetail()
}
})
},
callPhone(phone) {
uni.makePhoneCall({ phoneNumber: phone })
},
report() {
this.$instance
.post(`/app/appactivityuser/report`, {
activityId: this.id,
partyId: this.user.partyId,
name: this.user.realName,
orgId: this.user.partyOrgId,
orgName: this.user.partyOrgName,
phone: this.user.phone,
communityId: this.user.communityId,
})
.then((res) => {
if (res.code == 0) {
this.$toast('报名成功')
this.getDetail()
}
})
},
toSignUser() {
var isAdmin = this.detail.createUserId == this.user.partyId ? 1 : 0
uni.navigateTo({ url: `./SignUser?id=${this.id}&isAdmin=${isAdmin}&status=${this.detail.status}` })
},
sign(status) {
//status 0开始签到 1离场签到
this.$instance
.post(`/app/appactivityuser/sign`, {
activityId: this.id,
partyId: this.user.partyId,
})
.then((res) => {
if (res.code == 0) {
this.$toast(status == 1 ? '离场签到成功' : '签到成功')
this.getDetail()
}
})
},
toDetail(id) {
this.linkTo(`./detail?id=${id}`)
},
previewImage(images, img) {
uni.previewImage({
urls: images.map((v) => v.url),
current: img,
})
},
},
}
</script>
<style scoped lang="scss">
.page {
width: 100%;
height: 100%;
background-color: #fff;
.info-title {
padding-left: 32px;
line-height: 108px;
font-size: 32px;
font-family: PingFangSC-Semibold, PingFang SC;
font-weight: 600;
color: #333;
}
.tab-title {
line-height: 108px;
font-size: 32px;
font-family: PingFangSC-Semibold, PingFang SC;
font-weight: 600;
color: #333;
span {
display: inline-block;
width: 192px;
text-align: center;
}
.active {
color: #3671ee;
border-bottom: 4px solid #3671ee;
}
}
.status0 {
background: #000;
}
.status1 {
background: #ff883c;
}
.status3 {
background: #1aaaff;
}
.status2 {
background: #42d784;
}
.status4,
.status5 {
background: #e4e4e4;
}
.header-content {
padding-bottom: 150px;
.header-top {
width: 100%;
height: 440px;
img {
width: 100%;
height: 100%;
}
}
.header-middle {
padding: 32px 32px 0 32px;
.img-title {
font-size: 36px;
font-weight: 600;
}
.header-middle-bottom {
display: flex;
justify-content: space-between;
margin-top: 32px;
.left {
.left-btn {
padding: 4px 8px;
border-radius: 8px;
font-size: 26px;
color: #ffffff;
text-align: center;
}
}
.right {
img {
width: 40px;
height: 40px;
border-radius: 50%;
vertical-align: text-top;
margin-right: 8px;
}
}
}
.cards {
display: flex;
justify-content: space-between;
border-bottom: 2px solid #eee;
padding: 36px 0;
line-height: 40px;
font-size: 28px;
.cards-left {
color: #999;
}
.cards-right {
color: #333;
}
}
}
.header-bottom {
background: #fff;
.content-details {
padding: 32px 32px 80px 32px;
.font {
margin-top: 32px;
font-size: 30px;
line-height: 1.5;
}
.font-img {
margin-top: 26px;
width: 100%;
height: 480px;
}
}
.content-trends {
// padding-bottom: 40px;
.details {
.card {
padding: 26px 32px 28px 32px;
.card-nav {
display: flex;
.avatar {
width: 64px;
height: 64px;
line-height: 60px;
background: #4e8eee;
border-radius: 50%;
text-align: center;
font-size: 24px;
font-weight: 500;
color: #ffffff;
margin-right: 16px;
}
.right {
// display: inline;
display: flex;
flex-direction: column;
.name {
font-size: 26px;
font-weight: 500;
}
.time {
font-size: 22px;
color: #999999;
}
}
}
.card-font {
margin-top: 36px;
line-height: 1.6;
text-overflow: -o-ellipsis-lastline;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
line-clamp: 2;
-webkit-box-orient: vertical;
}
.card-img {
margin-top: 16px;
img {
width: 224px;
height: 224px;
margin-right: 8px;
}
img:last-child {
margin-right: 0;
}
}
.card-icon {
display: flex;
justify-content: space-between;
margin-top: 28px;
div {
display: flex;
align-items: center;
span {
font-size: 24px;
}
}
}
}
}
::v-deep .emptyWrap {
// background-color: pink;
padding-bottom: 50px;
}
.noDeatil {
background-color: #f3f6f9;
img {
width: 400px;
height: 240px;
transform: translate(50%, 25%);
padding-bottom: 156px;
}
}
.card-bottom {
height: 20px;
background-color: #f3f6f9;
}
}
}
}
.addicon {
position: fixed;
bottom: 280px;
right: 30px;
background: #fefefe;
box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2);
border-radius: 50%;
padding: 26px 24px 22px 24px;
}
.btn {
position: fixed;
bottom: 0;
width: 100%;
// height: 112px;
background: #f3f6f9;
display: flex;
justify-content: space-between;
padding: 32px 0;
text-align: center;
.edit {
width: 254px;
height: 92px;
line-height: 92px;
background: #ffffff;
border-radius: 8px;
border: 2px solid #3671ee;
font-size: 34px;
font-weight: 500;
color: #3671ee;
margin-left: 32px;
}
.public {
width: 400px;
line-height: 92px;
border-radius: 8px;
font-size: 34px;
font-weight: 500;
color: #ffffff;
margin-right: 32px;
}
.max {
margin: 0 auto;
width: 686px;
height: 92px;
line-height: 92px;
background: #cbddf9;
border-radius: 8px;
font-size: 34px;
font-weight: 500;
color: #ffffff;
}
}
}
</style>

View File

@@ -0,0 +1,466 @@
<template>
<div class="page">
<div class="textarea-div border">
<div class="title mar-b32"><span>*</span>活动标题</div>
<div class="pad-l20">
<u-input type="textarea" v-model="params.title" :border="false" height="44" :auto-height="true" placeholder="请输入标题60字以内" :placeholder-style="placeholderStyle" maxlength="60" />
</div>
</div>
<div class="textarea-div mar-b16">
<div class="title mar-b32"><span>*</span>活动详情</div>
<div class="pad-l20">
<u-input type="textarea" v-model="params.content" :border="false" :height="140" :auto-height="true" placeholder="请输入活动详情500字以内" :placeholder-style="placeholderStyle" maxlength="500" />
</div>
</div>
<div class="textarea-div mar-b16">
<div class="title mar-b32"><span>*</span>活动封面图</div>
<div class="pad-l20">
<AiUploader v-model="files"></AiUploader>
</div>
</div>
<div class="input-div">
<div class="border-content border">
<div class="title"><span>*</span>活动主题</div>
<div class="value" @click="selectClick(topicList, 'target')">
<span :class="params.target ? '' : 'color-999'">{{ params.target || '请选择' }}</span>
<img src="https://cdn.cunwuyun.cn/img/right-icon-999.png" alt="" class="right-icon" />
</div>
</div>
</div>
<div class="input-div">
<div class="border-content border">
<div class="title"><span>*</span>活动类型</div>
<div class="value" @click="selectClick(activeTypeList, 'type')">
<span :class="params.type ? '' : 'color-999'">{{ params.type || '请选择' }}</span>
<img src="https://cdn.cunwuyun.cn/img/right-icon-999.png" alt="" class="right-icon" />
</div>
</div>
</div>
<div class="input-div">
<div class="border-content border">
<div class="title"><span>*</span>报名范围</div>
<div class="value" @click="selectClick($dict.getDict('activityScope'), 'scope')">
<span :class="params.scope === '' ? 'color-999' : ''">{{ $dict.getLabel('activityScope', params.scope) || '请选择' }}</span>
<img src="https://cdn.cunwuyun.cn/img/right-icon-999.png" alt="" class="right-icon" />
</div>
</div>
</div>
<div class="input-div" v-if="params.scope == 1">
<div class="border-content border">
<div class="title"><span>*</span>发布单位</div>
<div class="value">
<AIsEarchPopup title="请选择发布单位" placeholder="搜索单位名称" :ops="{ label: 'name', search: 'name' }" url="/admin/partyOrganization/queryPartyOrganizationListByName" @select="(v) => (selectedOrg = v)">
<div class="picker-input" slot="btn">
<view class="uni-input color-999" v-if="!selectedOrg.id">请选择</view>
<view class="uni-input" v-else>{{ selectedOrg.name }}</view>
<image src="https://cdn.cunwuyun.cn/img/right-icon-999.png" class="right-icon"></image>
</div>
</AIsEarchPopup>
</div>
</div>
</div>
<div class="input-div" v-if="params.scope == 2">
<div class="border-content border">
<div class="title"><span>*</span>发布小区</div>
<div class="value" @click="estateSelect = true">
<span :class="params.communityName ? '' : 'color-999'">{{ params.communityName || '请选择' }}</span>
<img src="https://cdn.cunwuyun.cn/img/right-icon-999.png" alt="" class="right-icon" />
</div>
</div>
</div>
<u-select v-model="estateSelect" mode="mutil-column-auto" :list="estateTreeData" @confirm="handleBindEstate" value-name="id" label-name="name" />
<div class="input-div mar-b16">
<div class="border-content">
<div class="title"><span>*</span>活动名额</div>
<div class="value">
<u-input type="input" v-model="params.total" :border="false" :height="44" :auto-height="true" placeholder="如不限制人数填写0" input-align="right" :placeholder-style="placeholderStyle" maxlength="5" />
</div>
</div>
</div>
<div class="input-div">
<div class="border-content border">
<div class="title"><span>*</span>开始时间</div>
<div class="value" @click="selectDate('beginTime')">
<span :class="params.beginTime ? '' : 'color-999'">{{ params.beginTime || '请选择' }}</span>
<img src="https://cdn.cunwuyun.cn/img/right-icon-999.png" alt="" class="right-icon" />
</div>
</div>
</div>
<div class="input-div">
<div class="border-content border">
<div class="title"><span>*</span>结束时间</div>
<div class="value" @click="selectDate('endTime')">
<span :class="params.endTime ? '' : 'color-999'">{{ params.endTime || '请选择' }}</span>
<img src="https://cdn.cunwuyun.cn/img/right-icon-999.png" alt="" class="right-icon" />
</div>
</div>
</div>
<div class="input-div">
<div class="border-content border">
<div class="title"><span>*</span>报名截止时间</div>
<div class="value" @click="selectDate('stopSignupTime')">
<span :class="params.stopSignupTime ? '' : 'color-999'">{{ params.stopSignupTime || '请选择' }}</span>
<img src="https://cdn.cunwuyun.cn/img/right-icon-999.png" alt="" class="right-icon" />
</div>
</div>
</div>
<div class="input-div mar-b16">
<div class="border-content">
<div class="title"><span>*</span>活动地点</div>
<div class="value">
<input type="text" maxlength="20" v-model="params.address" :border="false" :height="44" :auto-height="true" placeholder="请输入" input-align="right" :placeholder-style="placeholderStyle" />
</div>
</div>
</div>
<div class="input-div">
<div class="border-content border">
<div class="title"><span>*</span>联系人</div>
<div class="value">
<u-input type="input" v-model="params.contactPerson" :border="false" :height="44" :auto-height="true" placeholder="请输入" input-align="right" :placeholder-style="placeholderStyle" maxlength="10" />
</div>
</div>
</div>
<div class="input-div mar-b16 pad-b220">
<div class="border-content">
<div class="title"><span>*</span>联系方式</div>
<div class="value">
<u-input type="input" v-model="params.contactPhone" :border="false" :height="44" :auto-height="true" placeholder="请输入" input-align="right" :placeholder-style="placeholderStyle" maxlength="11" />
</div>
</div>
</div>
<div class="footer-btn">
<div class="btn" @click="add">保存</div>
</div>
<u-select v-model="showSelect" :list="selectList" label-name="dictName" value-name="dictValue" @confirm="selectConfirm"></u-select>
<u-picker mode="time" v-model="showDate" :start-year="startYear" @confirm="dateConfirm" :params="timeParams"></u-picker>
</div>
</template>
<script>
import { mapState } from 'vuex'
export default {
name: 'AddActive',
components: {},
computed: {
...mapState(['user', 'global']),
},
data() {
return {
files: [],
showSelect: false,
selectList: [],
topicList: [], //活动主题分类
activeTypeList: [],
selectData: '',
showDate: false,
startYear: '',
beginTimestamp: '',
params: {
title: '',
content: '',
url: '',
target: '',
type: '',
scope: '',
total: '',
address: '',
beginTime: '',
endTime: '',
stopSignupTime: '',
contactPerson: '',
contactPhone: '',
status: 0,
createUserId: '',
createUserName: '',
orgName: '',
avatar: '',
id: '',
orgId: '',
orgName: '',
communityId: '',
communityName: '',
},
timeParams: {
year: true,
month: true,
day: true,
hour: true,
minute: true,
second: true,
timestamp: true,
},
placeholderStyle: 'color:#999;font-size:16px;',
selectedOrg: {},
estateTreeData: [],
estateSelect: false,
}
},
onLoad(option) {
this.$dict.load('activityScope').then(() => {
this.getTopicList()
console.log(option)
if (option.id) {
uni.setNavigationBarTitle({ title: '编辑活动' })
this.params.id = option.id
this.getDetail()
} else {
this.params.contactPerson = this.user.realName
this.params.contactPhone = this.user.phone
}
})
var date = new Date()
this.startYear = date.getFullYear()
this.getEstates()
},
methods: {
getEstates() {
this.$http.post(`/app/appvanguardcommunityinfo/getTree?type=1&areaId=${this.global.areaId}`).then((res) => {
if (res?.data) {
this.estateTreeData = res.data?.children
}
})
},
handleBindEstate(e) {
this.params.communityId = e[2].value
this.params.communityName = e[2].label
},
getDetail() {
this.$http.post(`/app/appactivityinfo/queryDetailById?id=${this.params.id}`).then((res) => {
if (res?.data) {
this.files = [
{
url: res.data.url,
},
]
this.params = res.data
}
})
},
getTopicList() {
this.$http.post(`/app/appactivitytopic/list?status=1&size=1000`).then((res) => {
if (res.code == 0) {
res.data.records.map((item) => {
;(item.dictName = item.name), (item.dictValue = item.content)
})
this.topicList = res.data.records
}
})
},
selectClick(list, data) {
if (data == 'type' && !list.length) {
//活动类型
return this.$toast('请先选择活动主题')
}
this.selectData = data
this.selectList = list
this.showSelect = true
},
selectConfirm(e) {
console.log(e)
if (this.selectData == 'target' || this.selectData == 'type') {
this.params[this.selectData] = e[0].label
} else {
this.params[this.selectData] = e[0].value
}
if (this.selectData == 'target') {
//选择主题分类
var content = e[0].value.split(',')
this.activeTypeList = []
this.type = ''
content.map((items) => {
var info = { dictName: items }
this.activeTypeList.push(info)
})
}
},
selectDate(data) {
if (data == 'endTime' && !this.params.beginTime) {
return this.$toast('请先选择活动开始时间')
}
if (data == 'stopSignupTime' && !this.params.beginTime) {
return this.$toast('请先选择活动开始时间')
}
this.selectData = data
this.showDate = true
},
dateConfirm(e) {
console.log(e)
if (this.selectData == 'beginTime') {
this.beginTimestamp = e.timestamp
this.params.endTime = ''
this.params.stopSignupTime = ''
}
if (this.selectData == 'endTime' && e.timestamp < this.beginTimestamp) {
return this.$toast('活动结束时间不能晚于开始时间')
}
if (this.selectData == 'stopSignupTime' && e.timestamp > this.beginTimestamp) {
return this.$toast('报名截止时间不能早于开始时间')
}
this.params[this.selectData] = `${e.year}-${e.month}-${e.day} ${e.hour}:${e.minute}:${e.second}`
},
add() {
if (!this.params.title) {
return this.$toast('请输入活动标题')
}
if (!this.params.content) {
return this.$toast('请输入活动标题')
}
if (!this.files.length) {
return this.$toast('请上传活动封面')
}
if (!this.params.target) {
return this.$toast('请选择活动主题')
}
if (!this.params.type) {
return this.$toast('请选择活动类型')
}
if (this.params.scope === '') {
return this.$toast('请选择报名范围')
}
if (this.params.scope == 1 && !this.selectedOrg.id) {
return this.$toast('请选择发布单位')
}
if (this.params.scope == 2 && !this.params.communityId) {
return this.$toast('请选择发布小区')
}
if (!this.params.total) {
return this.$toast('请输入活动名额')
}
if (!this.params.address) {
return this.$toast('请输入活动地点')
}
if (!this.params.beginTime) {
return this.$toast('请选择开始时间')
}
if (!this.params.endTime) {
return this.$toast('请选择结束时间')
}
if (!this.params.stopSignupTime) {
return this.$toast('请选择报名截止时间')
}
if (!this.params.contactPerson) {
return this.$toast('请输入联系人')
}
if (!this.params.contactPhone) {
return this.$toast('请输入联系方式')
}
if (this.params.scope == 1) {
this.params.orgId = this.selectedOrg.id
this.params.orgName = this.selectedOrg.name
}
this.params.url = this.files[0].url
this.params.createUserId = this.user.partyId
this.params.createUserName = this.user.realName
this.params.orgName = this.user.partyOrgName
this.params.avatar = this.user.avatarUrl
this.confirmAdd()
},
confirmAdd() {
this.$http.post(`/app/appactivityinfo/addOrUpdate`, this.params).then((res) => {
if (res.code == 0) {
this.$toast(this.params.id ? '活动编辑成功' : '活动新增成功')
setTimeout(() => {
uni.$emit('refresh')
uni.navigateBack()
}, 2000)
}
})
},
},
}
</script>
<style lang="scss" scoped>
.textarea-div {
width: 100%;
padding: 32px 32px 38px 32px;
box-sizing: border-box;
background-color: #fff;
}
.input-div {
width: 100%;
padding-left: 32px;
box-sizing: border-box;
background-color: #fff;
.border-content {
display: flex;
justify-content: space-between;
line-height: 44px;
color: #333;
padding: 34px 32px 34px 0;
.right-icon {
width: 32px;
height: 32px;
margin-left: 8px;
vertical-align: middle;
}
.color-999 {
color: #999;
}
}
}
.title {
font-size: 32px;
font-family: PingFangSC-Regular, PingFang SC;
color: #333;
line-height: 44px;
span {
font-family: PingFangSC-Regular, PingFang SC;
color: #ff4466;
margin-right: 4px;
}
}
.border {
border-bottom: 2px solid #ddd;
}
.mar-b32 {
margin-bottom: 32px;
}
.pad-l20 {
padding-left: 20px;
}
.mar-b16 {
margin-bottom: 16px;
}
.pad-b220 {
padding-bottom: 220px;
}
.footer-btn {
width: 100%;
padding: 116px 32px 32px;
box-sizing: border-box;
position: fixed;
bottom: 0;
left: 0;
background-color: #f3f6f9;
z-index: 99;
.btn {
width: 100%;
height: 92px;
line-height: 92px;
text-align: center;
background: #1365dd;
border-radius: 8px;
font-size: 34px;
color: #fff;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
}
}
.value {
width: calc(100% - 240px);
text-align: right;
}
::v-deep ai-search-popup {
width: 100%;
.uni-input {
display: inline-block;
}
}
</style>

View File

@@ -0,0 +1,137 @@
<template>
<div class="page">
<div class="textarea-div mar-b16">
<div class="title mar-b32"><span></span>帖子内容</div>
<div class="pad-l20">
<u-input v-model="form.content" type="textarea" :border="false" :height="140" :auto-height="true" placeholder="请输入内容1000字以内" placeholder-style="color:#999;font-size:16px;" maxLength="140" />
</div>
</div>
<div class="textarea-div pad-b208">
<div class="title mar-b32"><span></span>图片最多9张</div>
<div class="pad-l20">
<AiUploader :limit="9" v-model="form.images"></AiUploader>
</div>
</div>
<div class="footer-btn">
<div class="btn" @click="addPost">立即发布</div>
</div>
</div>
</template>
<script>
import { mapState } from 'vuex'
export default {
name: 'AddPosts',
components: {},
computed: {
...mapState(['user']),
},
data() {
return {
files: [],
id: '',
flag: false,
form: {
content: '',
images: [],
},
}
},
onLoad(o) {
this.id = o.id || ''
},
methods: {
addPost() {
if (this.flag) return
if (!this.form.content && !this.form.images.length) {
return this.$u.toast('帖子内容不能为空')
}
this.flag = true
let imagesList = []
if (this.form.images) {
this.form.images.map((item) => {
imagesList.push({ id: item.id, url: item.url })
})
}
this.$http
.post(`/app/apppostinfo/addOrUpdate`, {
content: this.form.content,
avatar: this.user.avatarUrl,
name: this.user.realName,
phone: this.user.phone ? this.user.phone : '',
userId: this.user.partyId,
activityId: this.id,
images: JSON.stringify(imagesList),
})
.then((res) => {
if (res.code == 0) {
this.$u.toast('发布成功')
this.flag = false
uni.$emit('refresh')
uni.navigateBack()
}
})
},
},
}
</script>
<style lang="scss" scoped>
.textarea-div {
width: 100%;
padding: 32px 32px 38px 32px;
box-sizing: border-box;
background-color: #fff;
}
.title {
font-size: 32px;
font-family: PingFangSC-Regular, PingFang SC;
color: #333;
line-height: 44px;
span {
font-family: PingFangSC-Regular, PingFang SC;
color: #ff4466;
margin-right: 4px;
}
}
.border {
border-bottom: 2px solid #ddd;
}
.mar-b32 {
margin-bottom: 32px;
}
.pad-l20 {
padding-left: 20px;
}
.mar-b16 {
margin-bottom: 16px;
}
.pad-b208 {
padding-bottom: 208px;
}
.footer-btn {
width: 100%;
padding: 116px 32px 32px;
box-sizing: border-box;
position: fixed;
bottom: 0;
left: 0;
background-color: #f3f6f9;
z-index: 99;
.btn {
width: 100%;
height: 92px;
line-height: 92px;
text-align: center;
background: #1365dd;
border-radius: 8px;
font-size: 34px;
color: #fff;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
}
}
</style>

View File

@@ -1,176 +1,370 @@
<template>
<div class="AppActive">
<u-tabs :list="tabList" :is-scroll="false" :current="currentTabs" height="96" bg-color="#3975C6" inactive-color="#fff" active-color="#fff" @change="change"></u-tabs>
<div class="dataTop">
<div class="dataLeft">活动列表</div>
<div class="dataRight">
<span></span>
<span class="specialColor">12</span>
<span>个活动</span>
<div class="page">
<div class="po-f">
<view class="nav-box flex-row">
<view
class="nav-item"
:class="tabIndex == index ? 'active' : ''"
v-for="(item, index) in tabList"
:key="index"
@click="tabClick(index)"
>{{ item }}<span></span
></view>
</view>
<div v-if="tabIndex == 0" class="header-tab">
<div class="header-info" v-if="newsList.length">
<span class="tips">公告</span>
<div class="text-content">
<u-notice-bar @click="noticeClick"
mode="vertical"
:list="newsList"
:volume-icon="false"
type="none"
color="#333"
></u-notice-bar>
</div>
</div>
<template v-if="datas.length < 1">
<AiCard v-for="(item, i) in 6" :key="i" @click.native="toDetail(item, 1)">
<template #custom>
<div class="left">
<div class="titles">敬老爱幼带你在洞庭湖兜兜风 寻觅江豚的身影</div>
<div class="nums">
<span class="specialColor">6</span>
<span>已报名</span>
<div class="header-title">
<p class="text">帖子列表</p>
<!-- <div class="right-select" @click="showSelect=true">
{{selectText}}<img src="../../static/img/right-icon-666.png" alt="" />
</div> -->
</div>
<div class="times">
<span class="timesCont">2021-12-16</span>
<span>| 2</span>
</div>
<div class="areaNmae">湖南省岳阳市岳阳县荣家湾镇六湖南省岳阳市岳阳县荣家湾镇六</div>
<div v-if="tabIndex == 1" class="header-tab">
<div class="header-info">活动报名大于{{num}}人时组团成功人数不足时活动失效</div>
<div class="header-title">
<p class="text">活动列表</p>
<div class="right-select" @click="showSelect=true">
{{selectText}}<img src="./components/right-icon-666.png" alt="" />
</div>
<img src="./yan.jpg" alt="" />
</template>
</AiCard>
</template>
</div>
</div>
<div v-if="tabIndex == 2" class="header-tab">
<!-- <AiHeaderSearchBar placeholder="请输入活动标题或者地点" barBgColor="#fff" inputBgColor="#F5F5F5" inputColor="#333" inputPlaceholderColor="#999" searchIconColor="#ccc" @change="search"></AiHeaderSearchBar> -->
</div>
</div>
<div class="list-content">
<div v-if="tabIndex == 0" :class="isPadding ? 'pad-t308' : 'pad-t200'">
<div class="forum-list">
<div class="forum-item" v-for="(item, index) in list" :key="index" @click="toBBSDetail(item.id)">
<div class="user-info">
<image :src="item.avatar" class="user-name-bg"></image>
<div class="info">
<div>{{ item.name }}</div>
<p>{{ item.createTime }}</p>
</div>
</div>
<p class="conent-text">{{ item.content }}</p>
<div class="img-list" v-if="item.images.length">
<image v-for="(img, i) in item.images" :key="i" :src="img.url" @click.stop="previewImage(item.images, img.url)" v-if="i<3">
</div>
<div class="bottom-icon">
<div>
<i class="iconfont">&#xe69d;</i>
<span>{{ item.viewNum }}</span>
</div>
<div>
<i class="iconfont">&#xe6a2;</i>
<span>{{ item.replyNum }}</span>
</div>
<!-- <div @click.stop="support(item, index)">
<AiIcon icon="iconpraiseactive2x" size="18" v-if="item.mySupport==1" style="vertical-align: middle;" />
<i class="iconfont" v-else>&#xe698;</i>
<span>{{ item.supportNum }}</span>
</div> -->
</div>
</div>
</div>
</div>
<div v-if="tabIndex == 1" class="pad-t308">
<div class="active-list mar-t32">
<div class="active-item" v-for="(item, index) in list" :key="index" @click="toActiveDetail(item)">
<div class="img-div">
<div class="status" :class="'status'+item.status">{{ $dict.getLabel('newActivityStatus', item.status) }}</div>
<img :src="item.url" alt="">
</div>
<div class="right-info">
<p class="title">{{ item.title }}</p>
<div class="time"><span>{{ item.realNum }}</span>已报名</div>
<div class="time">{{ item.beginTime }} </div>
<div class="time address">{{ item.address }}</div>
</div>
</div>
</div>
</div>
<div v-if="tabIndex == 2" class="pad-t200">
<div class="active-list mar-t32">
<div class="active-item" v-for="(item, index) in list" :key="index" @click="toActiveDetail(item)">
<div class="img-div">
<div class="status" :class="'status'+item.status">{{ $dict.getLabel('newActivityStatus', item.status) }}</div>
<img :src="item.url" alt="">
</div>
<div class="right-info">
<p class="title">{{ item.title }}</p>
<div class="time"><span>{{ item.realNum }}</span>已报名</div>
<div class="time">{{ item.beginTime }} </div>
<div class="time address">{{ item.address }}</div>
</div>
</div>
</div>
</div>
<AiEmpty v-if="!list.length"/>
</div>
<u-select v-model="showSelect" mode="mutil-column-auto" :list="selectList" @confirm="confirmSelect" />
<!-- <img src="../../static/img/add-icon.png" alt="" class="add-icon" @click="toAdd"> -->
<AiFixedBtn>
<div class="addBtn iconfont iconfont-iconfangda" @tap.stop="toAdd()" />
</AiFixedBtn>
<u-back-top :scrollTop="scrollTop" :iconStyle="iconStyle" icon="arrow-up" :customStyle="customStyle" bottom="72" right="32"></u-back-top>
</div>
</template>
<script>
import { mapState } from 'vuex'
export default {
name: 'AppActive',
appName: '居民活动',
appName: '居民议事',
components: {},
props: {},
computed: {
...mapState(['user']),
},
data() {
return {
datas: [],
tabList: [
{
name: '全部活动',
list: [],
isMore: false,
current: 0,
pageShow: false,
tabIndex: 0,
tabList: ["论坛", "活动", "动态"],
list: [],
newsList: [],
iconStyle: {
fontSize: '56rpx',
color: '#1365DD',
fontWeight: '700'
},
{
name: '我发布的',
customStyle: {
width: '96rpx',
height: '96rpx',
backgroundColor: '#fff',
boxShadow: '0px 8rpx 16rpx 0px rgba(0, 0, 0, 0.2)',
},
],
currentTabs: 0,
current: 1,
scrollTop: 0,
supportFlag: true,
num: '',
title: '',
selectText: '最新活动',
showSelect: false,
selectList: [{label: '最新活动'}, {label: '我的活动'}],
noticeList: [],
isPadding: false
};
},
onLoad(option) {
if(option.tabIndex) {
this.tabIndex = option.tabIndex
}
},
computed: {},
watch: {},
onLoad() {
this.$dict.load(['newActivityStatus']).then(() => {
this.getList()
this.getActiveNum()
})
uni.$on('refresh', () => {
this.getListInit()
})
this.getNewList()
},
mounted() {},
methods: {
getList() {},
search(v) {
this.title = v
this.getListInit()
},
confirmSelect(e) {
this.selectText = e[0].label
this.getListInit()
},
tabClick(index) {
this.tabIndex = index
this.getListInit()
},
change(index) {
this.currentTabs = index
toBBSDetail (id) {
uni.navigateTo({
url: `./Detail?id=${id}`
})
},
toAdd () {
if (this.tabIndex == 0) {
uni.navigateTo({
url: `./AddPosts`
})
} else {
uni.navigateTo({
url: `./AddActive`
})
}
},
previewImage (images, img) {
uni.previewImage({
urls: images.map(v => v.url),
current: img
})
},
getListInit() {
this.current = 0
this.isMore = false
this.getList()
},
getList () {
if (this.isMore) return
toAdd() {
uni.navigateTo({ url: `./Add` })
},
this.$loading()
let url = this.tabIndex == 0 ? `/app/apppostinfo/list` : `/app/appactivityinfo/list`
let params = `&searchUserId=${this.user.partyId}`
toDetail(item) {
uni.navigateTo({ url: `./Detail` })
// uni.navigateTo({ url: `./Detail?id=${item.id}` })
},
},
onReachBottom() {
if(this.tabIndex == 1 && this.selectText == '我的活动') { //我的活动
params = `&createUserId=${this.user.partyId}`
}
if (this.tabIndex == 2) {
params = `&status=5&title=${this.title}`
}
this.$http.post(`${url}?size=10&current=${this.current + 1}${params}`).then(res => {
if (res.code === 0) {
if (!this.current) {
this.list = []
}
if (!res.data.records.length) {
this.$hideLoading()
this.isMore = true
this.$nextTick(() => {
this.pageShow = true
})
return false
}
const data = res.data.records.map(item => {
if (this.tabIndex == 0) {
if (item.images) {
item.images = JSON.parse(item.images)
}
}
return item
})
this.list.push(...data)
this.current = this.current + 1
this.$hideLoading()
this.$nextTick(() => {
this.pageShow = true
})
} else {
this.$hideLoading()
}
}).catch(() => {
this.$hideLoading()
})
},
support(e, index) {
if (this.supportFlag) {
this.supportFlag = false;
this.$http.post(`/app/apppostsupport/support`, {
postId: e.id,
createUserId: this.user.partyId
}).then(res => {
if (res.code == 0) {
this.supportFlag = true
if(e.mySupport == 1) {
this.list[index].mySupport = 0
this.list[index].supportNum = this.list[index].supportNum-1
}else {
this.list[index].mySupport = 1
this.list[index].supportNum = this.list[index].supportNum+1
}
}
})
}
},
toActiveDetail(e) {
uni.navigateTo({url: `./ActiveDetail?id=${e.id}`})
},
getActiveNum() {
this.$http.post(`/app/appactivityconfig/queryDetail`).then(res => {
if(res.code == 0) {
this.num = res.data.num
}
})
},
getNewList() {
this.$http.post(`/app/apppolicypromotion/listWechat`, {
type: 3,
areaId: this.$areaId,
current: 1,
size: 5
}).then(res => {
if(res.code == 0) {
if(res.data && res.data.records.length) {
this.isPadding = true
this.noticeList = res.data.records
res.data.records.map((item) => {
this.newsList.push(item.title)
})
}
}
})
},
noticeClick(e) {
console.log(e)
this.linkTo(`./notice?id=${this.noticeList[0].id}`)
}
},
onReachBottom (){
this.getList()
},
}
onPageScroll(e) {
this.scrollTop = e.scrollTop;
},
};
</script>
<style scoped lang="scss">
uni-page-body {
<style lang="scss" scoped>
.po-f{
position: fixed;
top: 0;
left: 0;
width: 100%;
z-index: 99;
}
.pad-t200{
padding-top: 200rpx;
}
.pad-t308{
padding-top: 308rpx;
}
.header-tab{
width: 100%;
height: 100%;
}
.AppActive {
height: 100%;
background: #f3f6f9;
.dataTop {
display: flex;
justify-content: space-between;
align-items: center;
margin-top: 48px;
margin-bottom: 8px;
padding: 0 32px;
.dataLeft {
font-size: 38px;
font-weight: 600;
}
.dataRight {
font-size: 28px;
color: #666666;
.specialColor {
color: #4181ff;
}
}
}
::v-deep .AiCard {
background: #f3f6f9;
.start {
background: #fff;
padding: 32px;
border-radius: 16px;
.fill {
display: flex;
justify-content: space-between;
// align-items: center;
.left {
width: calc(100% - 205px);
// background: pink;
.titles {
margin-bottom: 8px;
color: #333333;
font-weight: 500;
font-size: 30px;
line-height: 1.3;
word-break: break-all;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
overflow: hidden;
}
.nums {
.specialColor {
color: #4181ff;
}
}
.times {
.timesCont {
margin-right: 10px;
}
}
.areaNmae {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
}
img {
width: 182px;
height: 182px;
}
}
}
}
.list-content{
// padding-top: 96px;
}
.AiFixedBtn {
.movableArea {
@@ -190,5 +384,261 @@ uni-page-body {
}
}
}
.nav-box {
background-color: #3671ee;
height: 96px;
box-sizing: border-box;
display: flex;
.active {
display: block;
position: relative;
span {
position: absolute;
top: 78px;
left: 50%;
margin-left: -20px;
width: 40px;
height: 4px;
background-color: #fff;
}
}
}
.nav-item {
flex: 1;
color: #ffffff;
font-size: 28px;
line-height: 96px;
text-align: center;
}
.header-info {
width: 100%;
height: 112px;
padding: 32px;
box-sizing: border-box;
background: #fefaea;
color: #FFA13E;
font-size: 28px;
.tips {
display: inline-block;
width: 104px;
height: 48px;
line-height: 48px;
text-align: center;
background: #ffa13e;
border-radius: 16px;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: #fff;
vertical-align: top;
margin-right: 16px;
}
.text-content {
display: inline-block;
width: calc(100% - 122px);
margin-top: -10px;
}
}
.header-title {
width: 100%;
height: 108px;
padding: 32px;
box-sizing: border-box;
background: #fff;
display: flex;
justify-content: space-between;
border-bottom: 2px solid #f3f6f9;
.text {
font-size: 32px;
font-family: PingFangSC-Semibold, PingFang SC;
font-weight: 600;
color: #333;
line-height: 44px;
}
.right-select {
font-size: 26px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #666;
line-height: 36px;
img {
width: 32px;
height: 32px;
margin-left: 8px;
vertical-align: middle;
}
}
}
.forum-item{
padding: 26px 30px 28px;
background-color: #fff;
.user-info{
display: flex;
margin-bottom: 32px;
.user-name-bg{
width: 64px;
height: 64px;
line-height: 64px;
text-align: center;
background: #4E8EEE;
font-size: 24px;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: #FFF;
margin-right: 16px;
border-radius: 50%;
}
.info{
div{
font-size: 26px;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: #333;
line-height: 26px;
margin-bottom: 10px;
}
p{
font-size: 22px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #999;
line-height: 22px;
}
}
}
.conent-text{
font-size: 26px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #333;
line-height: 42px;
word-break: break-all;
text-overflow: -o-ellipsis-lastline;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 4;
line-clamp: 4;
-webkit-box-orient: vertical;
margin-bottom: 16px;
}
.img-list{
image {
width: 224px;
height: 224px;
margin-right: 8px;
}
img:nth-of-type(3n){
margin-right: 0;
}
}
.bottom-icon{
display: flex;
justify-content: space-between;
.iconfont{
display: inline-block;
width: 40px;
vertical-align: middle;
}
span{
font-size: 24px;
font-family: PingFangSC-Regular, PingFang SC;
color: #333;
line-height: 40px;
}
}
}
.active-item{
padding: 24px;
display: flex;
background-color: #fff;
width: 686px;
background: #FFF;
box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.02);
border-radius: 4px;
margin: 0 0 32px 32px;
box-sizing: border-box;
.img-div{
width: 200px;
height: 200px;
margin-right: 24px;
position: relative;
img{
width: 200px;
height: 200px;
border-radius: 4px;
}
.status{
position: absolute;
top: 0;
left: 0;
height: 44px;
padding: 0 8px;
font-size: 26px;
font-family: PingFangSC-Regular, PingFang SC;
color: #FFF;
}
.status0{
background: #000;
}
.status1{
background: #FF883C;
}
.status3{
background: #1AAAFF;
}
.status2{
background: #42D784;
}
.status4, .status5{
background: #E4E4E4;
}
}
.right-info{
width: calc(100% - 224px);
.title{
font-size: 32px;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: #333;
line-height: 44px;
word-break: break-all;
margin-bottom: 8px;
text-overflow: -o-ellipsis-lastline;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
line-clamp: 2;
-webkit-box-orient: vertical;
}
.time{
font-size: 26px;
font-family: PingFangSC-Regular, PingFang SC;
color: #666;
line-height: 36px;
margin-bottom: 4px;
word-break: break-all;
span{
color: #3376FD;
}
}
.address{
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
word-break: break-all;
}
}
}
.add-icon{
position: fixed;
right: 16px;
bottom: 160px;
width: 128px;
height: 128px;
}
.mar-t32{
margin-top: 32px;
}
</style>

View File

@@ -1,25 +1,387 @@
<template>
<div class="Detail">Detail</div>
<div class="page" v-if="pageShow">
<div class="header">
<div class="user-info">
<image class="user-name-bg" :src="info.avatar" />
<div class="info">
<div>{{ info.name }}</div>
<p>{{ info.createTime }}<span v-if="info.userId == user.id" @click="del">删除帖子</span></p>
</div>
</div>
<p class="text-content">{{ info.content }}</p>
<div class="img-list" v-if="info.images.length">
<img :src="item.url" :key="index" v-for="(item, index) in info.images" @click.stop="previewImage(info.images, item.url)" />
</div>
</div>
<div class="reply-list">
<div class="item" v-for="(item, index) in info.replyList" :key="index" @click="replyClick(item)">
<div class="user-img">
<img :src="item.headPortrait" alt="" />
</div>
<div class="item-info">
<div class="user-info">
<span class="user-name">{{ item.createUserName }}</span>
<span class="time">{{ item.createTime }}</span>
</div>
<p class="text">
<span v-if="item.lastReplyName"
>回复<span class="color-365D92">{{ item.lastReplyName }}</span></span
>{{ item.content }}
</p>
</div>
</div>
</div>
<div class="reply-bottom">
<div class="input" @click="showReply = true">我来说两句</div>
<div class="support" @click="support()">
<!-- <AiIcon icon="iconpraiseactive2x" size="18" v-if="info.mySupport == 1" style="vertical-align: middle" />
<i class="iconfont" v-else>&#xe698;</i> -->
</div>
</div>
<u-popup v-model="showReply" mode="bottom">
<div class="reply-content">
<u-input v-model.trim="content" type="textarea" :height="144" :auto-height="true" placeholder="写下你的想法…" placeholder-style="color:#999999;font-size:24rpx;" maxlength="1000" />
<div class="btn">
<span class="clear" @click="content = ''">清空内容</span>
<span class="confirm" @click="confirmReply()">发表</span>
</div>
</div>
</u-popup>
</div>
</template>
<script>
import { mapState } from 'vuex'
export default {
name: 'Detail',
components: {},
props: {},
data() {
return {}
computed: {
...mapState(['user']),
},
data() {
return {
info: {},
pageShow: false,
id: '',
supportFlag: true,
showReply: false,
content: '',
lastReplyId: '',
lastReplyName: '',
}
},
onLoad(query) {
this.id = query.id
this.getInfo()
uni.$emit('refresh')
},
methods: {
getInfo() {
this.$loading()
this.$http.post(`/app/apppostinfo/queryDetailById?id=${this.id}`).then((res) => {
if (res.code === 0) {
this.info = res.data
if (res.data.images) {
this.info.images = JSON.parse(res.data.images)
} else {
this.info.images = []
}
if (res.data.replyList.length) {
res.data.replyList.map((item) => {
item.createTime = item.createTime.substring(0, 19)
})
}
uni.setNavigationBarTitle({ title: this.info.userId == this.user.id ? '我的帖子' : 'Ta的帖子' })
this.$nextTick(() => {
this.pageShow = true
})
}
})
},
support() {
if (this.supportFlag) {
this.supportFlag = false
this.$http
.post(`/app/apppostsupport/support`, {
postId: this.id,
createUserId: this.user.partyId,
})
.then((res) => {
if (res.code == 0) {
uni.$emit('refresh')
this.supportFlag = true
if (this.info.mySupport == 1) {
this.info.mySupport = 0
} else {
this.info.mySupport = 1
}
}
})
}
},
confirmReply() {
if (!this.content) {
return this.$toast('请输入回复内容')
}
var params = {
postId: this.id,
content: this.content,
createUserId: this.user.partyId,
createUserName: this.user.realName,
headPortrait: this.user.avatarUrl,
lastReplyId: this.lastReplyId ? this.lastReplyId : '',
lastReplyName: this.lastReplyName ? this.lastReplyName : '',
}
this.$http.post(`/app/apppostreply/addOrUpdate`, params).then((res) => {
if (res.code == 0) {
uni.$emit('refresh')
this.$toast('提交成功')
this.lastReplyId = ''
this.lastReplyName = ''
this.content = ''
this.showReply = false
this.getInfo()
}
})
},
replyClick(e) {
uni.showModal({
title: '提示',
content: `是否回复${e.createUserName}的评论?`,
confirmText: '确定',
success: (res) => {
if (res.confirm) {
uni.$emit('refresh')
this.showReply = true
this.lastReplyId = e.id
this.lastReplyName = e.createUserName
}
},
})
},
del() {
uni.showModal({
title: '提示',
content: `是否删除该帖子?`,
confirmText: '确定',
success: (res) => {
if (res.confirm) {
this.confirmDel()
}
},
})
},
confirmDel() {
this.$http.post(`/app/apppostinfo/delete?id=${this.id}`).then((res) => {
if (res.code == 0) {
this.$toast('删除成功')
setTimeout(() => {
uni.$emit('refresh')
uni.navigateBack({ delta: 1 })
}, 3000)
}
})
},
previewImage(images, img) {
uni.previewImage({
urls: images.map((v) => v.url),
current: img,
})
},
},
computed: {},
watch: {},
created() {},
mounted() {},
methods: {},
}
</script>
<style scoped lang="scss">
.Detail {
<style lang="scss" scoped>
.page {
width: 100%;
height: 100%;
background-color: #f6f7f9;
}
.color-365D92 {
color: #365d92;
}
.header {
background-color: #fff;
padding: 26px 30px 32px;
.user-info {
display: flex;
margin-bottom: 32px;
.user-name-bg {
width: 64px;
height: 64px;
line-height: 64px;
text-align: center;
background: #4e8eee;
font-size: 24px;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: #fff;
margin-right: 16px;
border-radius: 50%;
}
.info {
div {
font-size: 26px;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: #333;
line-height: 26px;
margin-bottom: 10px;
}
p {
font-size: 22px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #999;
line-height: 22px;
}
span {
color: #3376fd;
margin-left: 16px;
}
}
}
.text-content {
font-size: 26px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #333;
line-height: 42px;
word-break: break-all;
}
.img-list {
margin-top: 16px;
img {
width: 224px;
height: 224px;
margin-right: 8px;
}
img:nth-of-type(3n) {
margin-right: 0;
}
}
}
.reply-list {
padding: 0 32px 112px;
.item {
display: flex;
padding: 32px 0;
border-bottom: 2px solid #eee;
.user-img {
width: 96px;
height: 96px;
margin-right: 24px;
img {
width: 96px;
height: 96px;
border-radius: 50%;
}
}
.item-info {
width: calc(100% - 116px);
}
.user-info {
display: flex;
justify-content: space-between;
margin-bottom: 10px;
.user-name {
font-size: 30px;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: #365d92;
line-height: 42px;
}
.time {
font-size: 22px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #999;
line-height: 42px;
}
}
.text {
font-size: 28px;
font-family: PingFangSC-Regular, PingFang SC;
color: #333;
line-height: 40px;
word-break: break-all;
}
}
}
.reply-bottom {
position: fixed;
bottom: 0;
left: 0;
width: 100%;
height: 104px;
padding: 22px 30px 24px;
box-sizing: border-box;
background-color: #fff;
font-size: 30px;
font-family: PingFangSC-Regular, PingFang SC;
color: #333;
line-height: 58px;
.input {
display: inline-block;
width: 580px;
height: 58px;
line-height: 58px;
text-align: center;
background: #f0f0f0;
border-radius: 30px;
font-size: 26px;
font-family: PingFangSC-Regular, PingFang SC;
color: #666;
margin-right: 42px;
}
.support {
display: inline-block;
}
.iconfont {
display: inline-block;
width: 36px;
height: 36px;
font-size: 36px;
color: #333;
margin-right: 8px;
}
}
.reply-content {
width: 100%;
padding: 32px;
box-sizing: border-box;
background: #fff;
::v-deep .u-input {
background-color: #f7f7f7 !important;
border-radius: 8px !important;
padding: 24px !important;
font-size: 26px !important;
}
.btn {
display: flex;
justify-content: space-between;
padding: 24px 0;
span {
line-height: 64px;
}
.clear {
font-size: 26px;
font-family: PingFangSC-Regular, PingFang SC;
color: #666;
}
.confirm {
width: 144px;
height: 64px;
text-align: center;
background: #135ab8;
border-radius: 32px;
font-size: 28px;
font-family: PingFangSC-Regular, PingFang SC;
color: #fff;
}
}
}
</style>

View File

@@ -0,0 +1,164 @@
<template>
<div class="page">
<!-- <div class="title">已签到2</div>
<div class="user-list">
<div class="item">
<div class="item-border">
<div class="left">
<span class="user-name-bg">李毅</span>李毅
</div>
<div class="right">
<span>157****8456</span>
<img src="../../static/img/phone-icon.png" alt="">
<img src="../../static/img/del-icon.png" alt="">
</div>
</div>
</div>
</div>
<div class="title">未签到3</div> -->
<div class="user-list" v-for="(item, index) in list" :key="index">
<div class="item">
<div class="item-border">
<div class="left">
<span class="user-name-bg">{{$formatName(item.name)}}</span>{{item.name}}
</div>
<div class="right">
<span>{{formatPhone(item.phone)}}</span>
<img src="./components/phone-icon.png" alt="" v-if="isAdmin" @click="callPhone(item.phone)">
<img src="./components/del-icon.png" alt="" v-if="isAdmin && status < 2" @click="del(item.id)">
</div>
</div>
</div>
</div>
<AiEmpty description="暂无活动报名人员" v-if="!list.length" />
</div>
</template>
<script>
export default {
data() {
return {
isAdmin: 0,
id: '',
list: [],
status: 0
}
},
onLoad(option) {
this.id = option.id
this.isAdmin = option.isAdmin
this.status = Number(option.status)
console.log(option)
this.getUserList()
},
methods: {
getUserList() {
this.$http.post(`/app/appactivityuser/list?activityId=${this.id}&status=1`).then(res => {
if (res.code == 0) {
this.list = res.data.records
}
})
},
formatPhone(value) {
const start = value.slice(0, 3)
const end = value.slice(-4)
return `${start}****${end}`
},
callPhone(phone) {
uni.makePhoneCall({phoneNumber: phone})
},
del(id) {
uni.showModal({
title: '提示',
content: `是否删除该报名人?`,
confirmText: "确定",
success: (res) => {
if (res.confirm) {
this.confirmDel(id)
}
}
});
},
confirmDel(id) {
this.$http.post(`/app/appactivityuser/removeReport`, {
id: id
}).then(res => {
if (res.code == 0) {
this.$toast('删除成功')
this.getUserList()
}
})
}
}
}
</script>
<style lang="scss" scoped>
.title{
width: 100%;
height: 108px;
line-height: 108px;
background: #FFF;
padding-left: 32px;
font-size: 32px;
font-family: PingFangSC-Semibold, PingFang SC;
font-weight: 600;
color: #333;
margin-top: 20px;
}
.item{
padding: 0 32px;
background-color: #fff;
.item-border{
border-bottom: 2px solid #ddd;
display: flex;
justify-content: space-between;
padding: 20px 0;
.left{
line-height: 80px;
font-size: 32px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #333;
.user-name-bg{
display: inline-block;
width: 80px;
height: 80px;
border-radius: 50%;
line-height: 80px;
text-align: center;
background: #4E8EEE;
font-size: 28px;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: #FFF;
margin-right: 16px;
}
}
.right{
span{
font-size: 28px;
font-family: PingFangSC-Regular, PingFang SC;
color: #999;
line-height: 80px;
}
img{
width: 56px;
height: 56px;
border-radius: 50%;
margin-left: 32px;
vertical-align: middle;
}
.iconfont{
display: inline-block;
font-size: 26px;
color: #3671EE;
}
.bg-blue{
// width: 56px;
// height: 56px;
// background: #EAF0FD;
}
}
}
}
</style>

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 267 B

View File

@@ -10,10 +10,10 @@ export default {
data() {
return {}
},
computed: {},
onLoad: {},
watch: {},
created() {},
mounted() {},
onShow() {},
methods: {},
}
</script>

View File

@@ -0,0 +1,224 @@
<template>
<div class="AppGoodDeeds">
<template v-if="datas.length > 0">
<AiCard v-for="(item, i) in datas" :key="i" @click.native="toAdd(item, 1)">
<template #custom>
<div class="titles">{{ item.createUserName }}</div>
<div class="contents">生活中有多少点点滴滴人生的每一天会有几滴生活中有那么多点点滴滴你会记得多少最难忘的事情是什么我记得有一生活中有多少点点滴滴人生的每一天会有几滴生活中有那么多点点滴滴你会记得多少最难忘的事情是什么我记得有</div>
<div class="imgs">
<img src="./yan.jpg" alt="" v-for="(items, i) in 4" :key="i" />
<!-- <img :src="items.url" alt="" v-for="(items, i) in item.images" :key="i" @click.stop="previewImage(item.images, items.url)" /> -->
</div>
<div class="imgBottom">
<div>2021_12_17_13_23</div>
<div class="right">
<div class="right-left">
<u-icon name="eye"></u-icon>
<span class="hint">24</span>
</div>
<div class="right-right">
<u-icon name="thumb-up" color="red"></u-icon>
<span class="hint">4</span>
</div>
</div>
</div>
</template>
<template #menu>
<div class="menu" @tap.stop="toAdd(item, 2)">编辑</div>
<div class="menu" @tap.stop="toDetele(item)">删除</div>
</template>
</AiCard>
<u-loadmore :status="loadmore" color="#999" font-size="24" margin-top="32" margin-bottom="80" />
</template>
<AiEmpty description="暂无数据" v-else></AiEmpty>
<AiFixedBtn :y="740">
<div class="addBtn iconfont iconfont-iconfangda" @tap.stop="toAdd()" />
</AiFixedBtn>
<u-modal v-model="deletShow" content="您确认要删除该条信息吗?" :show-cancel-button="true" :mask-close-able="true" :show-title="false" @confirm="delet"></u-modal>
</div>
</template>
<script>
export default {
name: 'AppGoodDeeds',
appName: '好人好事',
components: {},
props: {},
data() {
return {
datas: [],
currentTabs: 0,
current: 1,
current: 1,
size: 10,
pages: 0,
deletShow: false,
deletId: '',
}
},
computed: {
loadmore() {
return this.pages <= this.current ? 'loading ' : 'nomore'
},
},
watch: {},
onLoad() {
this.getList()
},
mounted() {},
methods: {
getList() {
this.$http
.post('/app/appvisitvondolence/list', null, {
params: {
size: 6,
current: this.current,
areaId: this.areaId,
title: this.keyword,
},
})
.then((res) => {
if (res.code == 0) {
this.datas = this.current > 1 ? [...this.datas, ...res.data.records] : res.data.records
this.pages = res.data.pages
}
})
},
toAdd(item, type) {
if (type == '1') {
console.log('详情')
uni.navigateTo({ url: `./Detail?id=${item.id}` })
}
if (type == '2') {
console.log('编辑')
uni.navigateTo({ url: `./Add?id=${item.id}` })
}
if (type == null) {
console.log('添加')
uni.navigateTo({ url: `./Add` })
}
},
toDetele(item) {
this.deletShow = true
this.deletId = item.id
},
delet() {
this.$http.post(`/app/appvisitvondolence/delete?ids=${this.deletId}`).then((res) => {
if (res.code == 0) {
this.$u.toast('删除成功!')
this.getList()
}
})
},
},
onReachBottom() {
this.current = this.current + 1
this.getList()
},
}
</script>
<style scoped lang="scss">
uni-page-body {
height: 100%;
}
.AppGoodDeeds {
height: 100%;
::v-deep .AiCard {
background: #f3f6f9;
.start {
background: #fff;
padding: 32px;
border-radius: 16px;
.titles {
font-size: 32px;
font-weight: 500;
color: #333333;
margin-bottom: 16px;
}
.contents {
line-height: 1.4;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 3;
-webkit-box-orient: vertical;
}
.imgs {
margin-top: 24px;
img {
width: 200px;
height: 200px;
margin-right: 8px;
}
img:nth-child(3n) {
margin-right: 0;
}
}
.imgBottom {
display: flex;
justify-content: space-between;
margin-top: 24px;
.right {
display: flex;
justify-content: space-between;
.right-right,
.right-left {
margin-left: 48px;
.hint {
margin-left: 8px;
}
}
}
}
}
.mask {
.moreMenu {
transform: translate(-175px, 30px);
.menu {
text-align: center;
line-height: 80px;
width: 192px;
height: 80px;
font-size: 28px;
font-weight: 400;
color: #333333;
}
}
}
}
.AiFixedBtn {
.movableArea {
.addBtn {
display: flex;
justify-content: center;
align-items: center;
width: 96px;
height: 96px;
flex-shrink: 0;
background: $uni-color-primary;
box-shadow: 0 8px 16px 0 rgba(0, 0, 0, 0.2);
font-size: 60px;
color: #1365dd;
background: #fff;
border-radius: 50%;
}
}
}
}
</style>

View File

@@ -0,0 +1,25 @@
<template>
<div class="Detail">Detail</div>
</template>
<script>
export default {
name: 'Detail',
components: {},
props: {},
data() {
return {}
},
computed: {},
watch: {},
onLoad() {},
onShow() {},
methods: {},
}
</script>
<style scoped lang="scss">
.Detail {
height: 100%;
}
</style>

View File

Before

Width:  |  Height:  |  Size: 88 KiB

After

Width:  |  Height:  |  Size: 88 KiB

View File

@@ -0,0 +1,323 @@
<template>
<div class="add">
<div class="header-description">
<u-form :model="forms" ref="uForm" label-width="auto" :border-bottom="false">
<u-form-item label="标题" prop="title" required :border-bottom="false" class="titles" label-position="top">
<u-input v-model="forms.title" placeholder="请输入标题(30字以内)" type="textarea" auto-height height="60" maxlength="30" />
</u-form-item>
<u-form-item label="活动详情" prop="content" required :border-bottom="false" label-position="top" class="contents">
<u-input v-model="forms.content" placeholder="请输入活动详情(500字以内)" type="textarea" auto-height height="100" maxlength="500" />
</u-form-item>
<div class="line"></div>
<u-form-item label="活动封面图" prop="fileIds" required :border-bottom="false" class="avatars" label-position="top">
<AiUploader :def.sync="forms.fileIds" multiple placeholder="上传图片" :limit="9"></AiUploader>
</u-form-item>
<div class="line"></div>
<u-form-item label="活动类型" prop="status" required :border-bottom="false" right-icon="arrow-right">
<u-input v-model="forms.status" disabled placeholder="请选择活动类型" @click="showStstus = true" />
<u-select v-model="showStstus" :list="$dict.getDict('realityStatus')" value-name="dictValue" label-name="dictName" @confirm="selectStatus"></u-select>
</u-form-item>
<u-form-item label="报名范围" prop="fanwe" required :border-bottom="false" right-icon="arrow-right">
<u-input v-model="forms.fanwe" disabled placeholder="请选择报名范围" @click="showStstus = true" />
<u-select v-model="showStstus" :list="$dict.getDict('realityStatus')" value-name="dictValue" label-name="dictName" @confirm="selectStatus"></u-select>
</u-form-item>
<u-form-item label="活动名额" prop="nums" required :border-bottom="false">
<u-input v-model="forms.nums" type="number" placeholder="如不限制人数填写0" />
</u-form-item>
<div class="line"></div>
<u-form-item label="开始时间" prop="startTime" required :border-bottom="false" right-icon="arrow-right">
<u-input v-model="forms.startTime" placeholder="请选择开始时间" @click="showStartTime = true" />
<u-picker mode="time" :params="params" v-model="showStartTime" @confirm="confirm"></u-picker>
</u-form-item>
<u-form-item label="结束时间" prop="endTime" required :border-bottom="false" right-icon="arrow-right">
<u-input v-model="forms.endTime" placeholder="请选择结束时间" @click="showEndTime = true" />
<u-picker mode="time" :params="params" v-model="showEndTime" @confirm="confirm"></u-picker>
</u-form-item>
<u-form-item label="报名截止时间" prop="deadTime" required :border-bottom="false" right-icon="arrow-right">
<u-input v-model="forms.deadTime" placeholder="请选择报名截止时间" @click="showDeadTime = true" />
<u-picker mode="time" :params="params" v-model="showDeadTime" @confirm="confirm"></u-picker>
</u-form-item>
<u-form-item label="活动地点" prop="areaNmae" required :border-bottom="false" label-position="top" class="areaNmaes">
<u-input v-model="forms.areaNmae" placeholder="请输入活动地点" type="textarea" auto-height height="70" />
</u-form-item>
<div class="line"></div>
<u-form-item label="联系人" prop="people" required :border-bottom="false">
<u-input v-model="forms.people" placeholder="请输入联系人" maxlength="30" />
</u-form-item>
<u-form-item label="联系方式" prop="phone" required :border-bottom="false">
<u-input v-model="forms.phone" placeholder="请输入联系方式" maxlength="16" />
</u-form-item>
</u-form>
</div>
<div class="btn" @click="submit">保存</div>
<AiBack></AiBack>
</div>
</template>
<script>
import { mapState } from 'vuex'
export default {
name: 'Add',
components: {},
props: {},
data() {
return {
id: '',
forms: {
title: '',
content: '',
fileIds: [],
status: '',
statusValue: '',
fanwe: '',
nums: '',
startTime: '',
endTime: '',
deadTime: '',
areaNmae: '',
people: '',
phone: '',
},
showStstus: false,
showStartTime: false,
showEndTime: false,
showDeadTime: false,
flag: false,
params: {
year: true,
month: true,
day: true,
hour: true,
minute: true,
second: true,
timestamp: true,
},
id: '',
}
},
computed: { ...mapState(['user']) },
onLoad(o) {
console.log(o)
this.id = o.id
this.$dict.load('realityStatus').then(() => {
// this.getDetail()
})
},
mounted() {},
methods: {
// getDetail() {
// this.$http.post(`/app/appvisitvondolence/queryDetailById?id=${this.id}`).then((res) => {
// if (res?.data) {
// this.forms = res.data
// this.forms.statusValue = res.data.status
// this.forms.status = this.$dict.getLabel('realityStatus', res.data.status)
// if (res.data.images) {
// this.forms.images = JSON.parse(res.data.images || '[]')
// }
// }
// })
// },
submit() {
if (this.flag) return
this.$refs.uForm.validate((valid) => {
if (valid) {
if (!this.forms.title) {
return this.$u.toast('请输入标题')
}
if (!this.forms.content) {
return this.$u.toast('请输入活动详情')
}
if (this.forms.fileIds.length == 0) {
return this.$u.toast('请输入活动详情')
}
if (!this.forms.status) {
return this.$u.toast('请选择活动类型')
}
if (!this.forms.fanwe) {
return this.$u.toast('请选择报名范围')
}
if (!this.forms.nums) {
return this.$u.toast('请输入活动名额')
}
if (!this.forms.startTime) {
return this.$u.toast('请选择开始时间')
}
if (!this.forms.endTime) {
return this.$u.toast('请选择结束时间')
}
if (!this.forms.deadTime) {
return this.$u.toast('请选择报名截止时间')
}
if (!this.forms.areaNmae) {
return this.$u.toast('请输入活动地点')
}
if (!this.forms.people) {
return this.$u.toast('请输入联系人')
}
if (!this.forms.phone) {
return this.$u.toast('请输入联系方式')
}
const imgs = []
if (this.forms.fileIds) {
this.forms.fileIds.map((e) => {
imgs.push({ url: e.url, id: e.id })
})
}
this.flag = true
this.$http
.post(`/app/appvisitvondolence/addOrUpdate`, {
title: this.forms.title,
content: this.forms.content,
// images: JSON.stringify(imgs) || [],
images: imgs || [],
status: this.forms.statusValue ? this.forms.statusValue : this.forms.status,
fanwe: this.forms.fanwe,
nums: this.forms.fanumsnwe,
startTime: this.forms.startTime,
endTime: this.forms.endTime,
deadTime: this.forms.deadTime,
areaNmae: this.forms.areaNmae,
people: this.forms.people,
phone: this.forms.phone,
id: this.id,
})
.then((res) => {
if (res.code == 0) {
this.$u.toast('发布成功')
this.flag = false
uni.navigateTo({ url: `./AppActive` })
}
})
} else {
this.$u.toast('失败')
}
})
},
confirm(e) {
if (this.showStartTime == true) {
console.log(1, e.year + '-' + e.month + '-' + e.day + ' ' + e.hour + ':' + e.minute + ':' + e.second)
this.forms.startTime = e.year + '-' + e.month + '-' + e.day + ' ' + e.hour + ':' + e.minute + ':' + e.second
}
if (this.showEndTime == true) {
console.log(2, e.year + '-' + e.month + '-' + e.day + ' ' + e.hour + ':' + e.minute + ':' + e.second)
this.forms.endTime = e.year + '-' + e.month + '-' + e.day + ' ' + e.hour + ':' + e.minute + ':' + e.second
}
if (this.showDeadTime == true) {
console.log(3, e.year + '-' + e.month + '-' + e.day + ' ' + e.hour + ':' + e.minute + ':' + e.second)
this.forms.deadTime = e.year + '-' + e.month + '-' + e.day + ' ' + e.hour + ':' + e.minute + ':' + e.second
}
},
selectStatus(e) {
this.forms.status = e[0].label
this.forms.statusValue = e[0].value
},
},
}
</script>
<style lang="scss" scoped>
.add {
height: 100%;
padding-bottom: 112px;
.header-description {
::v-deep .u-form {
.u-form-item {
padding: 0 45px !important;
.u-form-item__body {
.u-form-item--right__content__slot {
padding-bottom: 0;
.u-input {
text-align: right !important;
}
}
}
}
.u-form-item:last-child {
margin-bottom: 40px;
}
.titles,
.contents,
.areaNmaes {
.u-form-item__body {
.u-form-item--right__content__slot {
.u-input {
text-align: left !important;
}
}
}
}
.avatars,
.areaNmaes,
.contents {
padding-bottom: 20px !important;
}
.avatars {
.u-form-item__body {
.default {
width: 160px;
height: 160px;
}
}
}
.line {
height: 16px;
background: #f3f6f9;
}
}
}
.btn {
position: fixed;
bottom: 0;
width: 100%;
height: 112px;
line-height: 112px;
background: #1365dd;
text-align: center;
font-size: 32px;
font-weight: 500;
color: #ffffff;
}
}
</style>

View File

@@ -0,0 +1,194 @@
<template>
<div class="AppActive">
<u-tabs :list="tabList" :is-scroll="false" :current="currentTabs" height="96" bg-color="#3975C6" inactive-color="#fff" active-color="#fff" @change="change"></u-tabs>
<div class="dataTop">
<div class="dataLeft">活动列表</div>
<div class="dataRight">
<span></span>
<span class="specialColor">12</span>
<span>个活动</span>
</div>
</div>
<template v-if="datas.length < 1">
<AiCard v-for="(item, i) in 6" :key="i" @click.native="toDetail(item, 1)">
<template #custom>
<div class="left">
<div class="titles">敬老爱幼带你在洞庭湖兜兜风 寻觅江豚的身影</div>
<div class="nums">
<span class="specialColor">6</span>
<span>已报名</span>
</div>
<div class="times">
<span class="timesCont">2021-12-16</span>
<span>| 2</span>
</div>
<div class="areaNmae">湖南省岳阳市岳阳县荣家湾镇六湖南省岳阳市岳阳县荣家湾镇六</div>
</div>
<img src="./yan.jpg" alt="" />
</template>
</AiCard>
</template>
<AiFixedBtn>
<div class="addBtn iconfont iconfont-iconfangda" @tap.stop="toAdd()" />
</AiFixedBtn>
</div>
</template>
<script>
export default {
name: 'AppResidentActivities',
appName: '居民活动',
components: {},
props: {},
data() {
return {
datas: [],
tabList: [
{
name: '全部活动',
},
{
name: '我发布的',
},
],
currentTabs: 0,
current: 1,
}
},
computed: {},
watch: {},
onLoad() {
this.getList()
},
mounted() {},
methods: {
getList() {},
change(index) {
this.currentTabs = index
this.getList()
},
toAdd() {
uni.navigateTo({ url: `./Add` })
},
toDetail(item) {
uni.navigateTo({ url: `./Detail` })
// uni.navigateTo({ url: `./Detail?id=${item.id}` })
},
},
onReachBottom() {
this.current = this.current + 1
this.getList()
},
}
</script>
<style scoped lang="scss">
uni-page-body {
height: 100%;
}
.AppActive {
height: 100%;
background: #f3f6f9;
.dataTop {
display: flex;
justify-content: space-between;
align-items: center;
margin-top: 48px;
margin-bottom: 8px;
padding: 0 32px;
.dataLeft {
font-size: 38px;
font-weight: 600;
}
.dataRight {
font-size: 28px;
color: #666666;
.specialColor {
color: #4181ff;
}
}
}
::v-deep .AiCard {
background: #f3f6f9;
.start {
background: #fff;
padding: 32px;
border-radius: 16px;
.fill {
display: flex;
justify-content: space-between;
// align-items: center;
.left {
width: calc(100% - 205px);
// background: pink;
.titles {
margin-bottom: 8px;
color: #333333;
font-weight: 500;
font-size: 30px;
line-height: 1.3;
word-break: break-all;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
overflow: hidden;
}
.nums {
.specialColor {
color: #4181ff;
}
}
.times {
.timesCont {
margin-right: 10px;
}
}
.areaNmae {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
}
img {
width: 182px;
height: 182px;
}
}
}
}
.AiFixedBtn {
.movableArea {
.addBtn {
display: flex;
justify-content: center;
align-items: center;
width: 96px;
height: 96px;
flex-shrink: 0;
background: $uni-color-primary;
box-shadow: 0 8px 16px 0 rgba(0, 0, 0, 0.2);
font-size: 48px;
background: #fff;
color: #1365dd;
border-radius: 50%;
}
}
}
}
</style>

View File

@@ -0,0 +1,607 @@
<template>
<div class="page">
<div class="header-content">
<div class="header-top">
<img :src="detail.url" alt="" />
</div>
<div class="header-middle">
<div class="img-title">{{ detail.title }}</div>
<div class="header-middle-bottom">
<div class="left">
<div class="left-btn" :class="'status' + detail.status">{{ $dict.getLabel('newActivityStatus', detail.status) }}</div>
</div>
<div class="right">
<img :src="detail.avatar" alt="" />
<span>{{ detail.createUserName }}</span>
</div>
</div>
<div class="cards">
<div class="cards-left">活动时间</div>
<div class="cards-right">{{ detail.beginTime }}-{{ detail.endTime }}</div>
</div>
<div class="cards">
<div class="cards-left">活动人数</div>
<div class="cards-right" @click="toSignUser()">
<span>
<span :style="{ color: detail.realNum == detail.total ? '#FF4466 ' : '#1C6BDF' }">{{ detail.realNum || 0 }}</span>
<span v-if="detail.total != 0">/{{ detail.total }}</span>
<span v-else>/不限</span>
</span>
<u-icon name="arrow-right" color="#DDDDDD" size="28" style="margin-left: 8px"></u-icon>
</div>
</div>
<div class="cards">
<div class="cards-left">活动地点</div>
<div class="cards-right" style="width: 75%; text-align: right">{{ detail.address }}</div>
</div>
</div>
<div class="header-bottom">
<!-- v-if="detail.status == 1 || detail.status == 2 || detail.status == 3" -->
<div class="tab-title">
<span :class="current == 0 ? 'active' : ''" @click="change(0)">活动详情</span>
<span :class="current == 1 ? 'active' : ''" @click="change(1)">活动动态</span>
</div>
<!-- <div class="info-title" v-else>活动详情</div> -->
<div class="content-details" v-if="current == 0">
<div v-html="detail.content"></div>
</div>
<div class="content-trends" v-if="current == 1">
<div class="details" v-if="activeList.length > 0">
<div class="card" v-for="(item, index) in activeList" :key="index" @click="toDetail(item.id)">
<div class="card-nav">
<div class="avatar">
<img :src="item.avatar" alt="" style="width: 100%; height: 100%" v-if="item.avatar" />
<span v-else>
<span v-if="item.name">{{ item.name.substring(item.name.length, item.name.length - 2) }}</span>
</span>
</div>
<div class="right">
<span class="name">{{ item.name }}</span>
<span class="time">{{ item.createTime }}</span>
</div>
</div>
<div class="card-font">
{{ item.content }}
</div>
<div class="card-img">
<img :src="e.url" v-for="(e, i) in imgList[index]" :key="i" alt="" @click.stop="previewImage(info.images, item.url)" />
</div>
<div class="card-icon">
<div>
<i class="iconfont">&#xe69d;</i>
<span>{{ item.viewNum ? item.viewNum : 0 }}</span>
</div>
<div>
<i class="iconfont">&#xe6a2;</i>
<span>{{ item.replyNum ? item.replyNum : 0 }}</span>
</div>
<div>
<i class="iconfont">&#xe698;</i>
<span>{{ item.supportNum ? item.supportNum : 0 }}</span>
</div>
</div>
</div>
<div class="card-bottom"></div>
</div>
<AiEmpty v-else />
</div>
</div>
</div>
<div class="addicon" @click="toPublicPage()">
<u-icon name="plus" color="#1365DD" size="50"></u-icon>
</div>
<div class="btn" v-if="detail.status == 0 && detail.createUserId == user.partyId">
<div class="edit" @click="editActive">编辑</div>
<div class="public" style="background: #3671ee" @click="changeStatus(1, '是否发布?')">发布活动</div>
</div>
<div class="btn" v-if="detail.realNum < detail.total && detail.status == 1 && detail.myReport == 0">
<div class="edit" @click="callPhone(detail.contactPhone)">电话咨询</div>
<div class="public" style="background: #3671ee" @click="changeStatus(2, '是否报名?')">立即报名</div>
</div>
<div class="btn" v-if="detail.status == 1 && detail.myReport == 0 && detail.total == 0">
<div class="edit" @click="callPhone(detail.contactPhone)">电话咨询</div>
<div class="public" style="background: #3671ee" @click="changeStatus(2, '是否报名?')">立即报名</div>
</div>
<div class="btn" v-if="detail.status == 1 && detail.myReport == 1">
<div class="edit" @click="callPhone(detail.contactPhone)">电话咨询</div>
<div class="public" style="background: #3671ee" @click="changeStatus(3, '是否取消报名?取消报名无法重新报名!')">取消报名</div>
</div>
<div class="btn" v-if="detail.realNum == detail.total && detail.status == 1 && detail.status == 1 && detail.total != 0">
<div class="max">已满员</div>
</div>
<div class="btn" v-if="detail.myReport == 1 && detail.status == 2">
<div class="edit" @click="callPhone(detail.contactPhone)">联系负责人</div>
<div class="public" style="background: #ffd8df; color: #ff4466" v-if="detail.allow1 == 0">未签到</div>
<div class="public" style="background: #3671ee; color: #ffffff" v-if="detail.allow1 == 1" @click="sign(0)">签到</div>
<div class="public" style="background: #cbead9; color: #20bc65" v-if="detail.allow1 == 2">已签到</div>
</div>
<div class="btn" v-if="detail.status == 5">
<div class="edit" @click="callPhone(detail.contactPhone)">联系负责人</div>
<div class="public" style="background: #cbead9; color: #20bc65" v-if="detail.allow2 == 1" @click="sign(1)">离场签到</div>
<div class="public" style="background: #cbead9; color: #20bc65" v-if="detail.allow2 == 2">已离场签到</div>
<div class="public" style="background: #ffd8df; color: #ff4466" v-if="detail.allow2 == 0">未离场签到</div>
</div>
</div>
</template>
<script>
import { mapState } from 'vuex'
export default {
name: 'Detail',
computed: {
...mapState(['user']),
},
data() {
return {
id: '',
detail: {},
activeList: [],
imgList: [],
list: [
{
name: '活动详情',
},
{
name: '活动动态',
},
],
current: 0,
}
},
onLoad(option) {
this.id = option.id
this.$dict.load(['newActivityStatus']).then(() => {
this.getDetail()
})
},
methods: {
getDetail() {
this.$instance.post(`/app/appactivityinfo/queryDetailById?id=${this.id}&partyId=${this.user.partyId}`).then((res) => {
if (res?.data) {
res.data.beginTime = res.data.beginTime.substring(0, 16)
res.data.endTime = res.data.endTime.substring(0, 16)
this.detail = res.data
this.getActiveList()
}
})
},
getActiveList() {
this.$instance.post(`/app/apppostinfo/list?activityId=${this.id}`).then((res) => {
if (res?.data) {
this.activeList = res.data.records
if (this.activeList) {
let imagesList = []
this.activeList.map((item) => {
if (item.images) {
item.images = JSON.parse(item.images || '[]')
imagesList.push(item.images)
}
return item
})
this.imgList = imagesList
}
}
})
},
change(index) {
this.current = index
},
toPublicPage() {
uni.navigateTo({
url: `./AddPosts?id=${this.id}`,
})
},
editActive() {
uni.navigateTo({ url: `./Add?id=${this.id}` })
},
changeStatus(status, text) {
uni.showModal({
title: '提示',
content: `${text}`,
confirmText: '确定',
success: (e) => {
if (status == 1) {
//发布
this.changeStatusConfirm(status)
}
if (status == 2) {
//报名
this.report()
}
if (status == 3) {
//取消报名
this.cancelReport()
}
},
})
},
cancelReport() {
this.$instance
.post(`/app/appactivityuser/removeReport`, {
activityId: this.id,
partyId: this.user.partyId,
})
.then((res) => {
if (res.code == 0) {
this.$toast('提交成功')
this.getDetail()
}
})
},
changeStatusConfirm(status) {
this.$instance
.post(`/app/appactivityinfo/changeStatus`, {
id: this.id,
status: status,
})
.then((res) => {
if (res.code == 0) {
this.$toast('提交成功')
this.getDetail()
}
})
},
callPhone(phone) {
uni.makePhoneCall({ phoneNumber: phone })
},
report() {
this.$instance
.post(`/app/appactivityuser/report`, {
activityId: this.id,
partyId: this.user.partyId,
name: this.user.realName,
orgId: this.user.partyOrgId,
orgName: this.user.partyOrgName,
phone: this.user.phone,
communityId: this.user.communityId,
})
.then((res) => {
if (res.code == 0) {
this.$toast('报名成功')
this.getDetail()
}
})
},
toSignUser() {
var isAdmin = this.detail.createUserId == this.user.partyId ? 1 : 0
uni.navigateTo({ url: `./SignUser?id=${this.id}&isAdmin=${isAdmin}&status=${this.detail.status}` })
},
sign(status) {
//status 0开始签到 1离场签到
this.$instance
.post(`/app/appactivityuser/sign`, {
activityId: this.id,
partyId: this.user.partyId,
})
.then((res) => {
if (res.code == 0) {
this.$toast(status == 1 ? '离场签到成功' : '签到成功')
this.getDetail()
}
})
},
toDetail(id) {
this.linkTo(`./detail?id=${id}`)
},
previewImage(images, img) {
uni.previewImage({
urls: images.map((v) => v.url),
current: img,
})
},
},
}
</script>
<style scoped lang="scss">
.page {
width: 100%;
height: 100%;
background-color: #fff;
.info-title {
padding-left: 32px;
line-height: 108px;
font-size: 32px;
font-family: PingFangSC-Semibold, PingFang SC;
font-weight: 600;
color: #333;
}
.tab-title {
line-height: 108px;
font-size: 32px;
font-family: PingFangSC-Semibold, PingFang SC;
font-weight: 600;
color: #333;
span {
display: inline-block;
width: 192px;
text-align: center;
}
.active {
color: #3671ee;
border-bottom: 4px solid #3671ee;
}
}
.status0 {
background: #000;
}
.status1 {
background: #ff883c;
}
.status3 {
background: #1aaaff;
}
.status2 {
background: #42d784;
}
.status4,
.status5 {
background: #e4e4e4;
}
.header-content {
padding-bottom: 150px;
.header-top {
width: 100%;
height: 440px;
img {
width: 100%;
height: 100%;
}
}
.header-middle {
padding: 32px 32px 0 32px;
.img-title {
font-size: 36px;
font-weight: 600;
}
.header-middle-bottom {
display: flex;
justify-content: space-between;
margin-top: 32px;
.left {
.left-btn {
padding: 4px 8px;
border-radius: 8px;
font-size: 26px;
color: #ffffff;
text-align: center;
}
}
.right {
img {
width: 40px;
height: 40px;
border-radius: 50%;
vertical-align: text-top;
margin-right: 8px;
}
}
}
.cards {
display: flex;
justify-content: space-between;
border-bottom: 2px solid #eee;
padding: 36px 0;
line-height: 40px;
font-size: 28px;
.cards-left {
color: #999;
}
.cards-right {
color: #333;
}
}
}
.header-bottom {
background: #fff;
.content-details {
padding: 32px 32px 80px 32px;
.font {
margin-top: 32px;
font-size: 30px;
line-height: 1.5;
}
.font-img {
margin-top: 26px;
width: 100%;
height: 480px;
}
}
.content-trends {
// padding-bottom: 40px;
.details {
.card {
padding: 26px 32px 28px 32px;
.card-nav {
display: flex;
.avatar {
width: 64px;
height: 64px;
line-height: 60px;
background: #4e8eee;
border-radius: 50%;
text-align: center;
font-size: 24px;
font-weight: 500;
color: #ffffff;
margin-right: 16px;
}
.right {
// display: inline;
display: flex;
flex-direction: column;
.name {
font-size: 26px;
font-weight: 500;
}
.time {
font-size: 22px;
color: #999999;
}
}
}
.card-font {
margin-top: 36px;
line-height: 1.6;
text-overflow: -o-ellipsis-lastline;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
line-clamp: 2;
-webkit-box-orient: vertical;
}
.card-img {
margin-top: 16px;
img {
width: 224px;
height: 224px;
margin-right: 8px;
}
img:last-child {
margin-right: 0;
}
}
.card-icon {
display: flex;
justify-content: space-between;
margin-top: 28px;
div {
display: flex;
align-items: center;
span {
font-size: 24px;
}
}
}
}
}
::v-deep .emptyWrap {
// background-color: pink;
padding-bottom: 50px;
}
.noDeatil {
background-color: #f3f6f9;
img {
width: 400px;
height: 240px;
transform: translate(50%, 25%);
padding-bottom: 156px;
}
}
.card-bottom {
height: 20px;
background-color: #f3f6f9;
}
}
}
}
.addicon {
position: fixed;
bottom: 280px;
right: 30px;
background: #fefefe;
box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2);
border-radius: 50%;
padding: 26px 24px 22px 24px;
}
.btn {
position: fixed;
bottom: 0;
width: 100%;
// height: 112px;
background: #f3f6f9;
display: flex;
justify-content: space-between;
padding: 32px 0;
text-align: center;
.edit {
width: 254px;
height: 92px;
line-height: 92px;
background: #ffffff;
border-radius: 8px;
border: 2px solid #3671ee;
font-size: 34px;
font-weight: 500;
color: #3671ee;
margin-left: 32px;
}
.public {
width: 400px;
line-height: 92px;
border-radius: 8px;
font-size: 34px;
font-weight: 500;
color: #ffffff;
margin-right: 32px;
}
.max {
margin: 0 auto;
width: 686px;
height: 92px;
line-height: 92px;
background: #cbddf9;
border-radius: 8px;
font-size: 34px;
font-weight: 500;
color: #ffffff;
}
}
}
</style>

Binary file not shown.

After

Width:  |  Height:  |  Size: 88 KiB

View File

@@ -10,7 +10,7 @@
<template v-if="datas.length > 0">
<AiCard v-for="(item, i) in datas" :key="i" @click.native="toAdd(item, 1)">
<template #custom>
<div class="title">{{ item.createUserName }}</div>
<div class="titles">{{ item.createUserName }}</div>
<div class="flex">
<span class="left">
@@ -168,7 +168,7 @@ uni-page-body {
background: #fff;
padding: 32px;
border-radius: 16px;
.title {
.titles {
font-size: 32px;
font-weight: 500;
color: #333333;

View File

@@ -3,102 +3,384 @@
<div class="pad-l32">
<div class="item">
<span class="label"><span class="tips">*</span>类型</span>
<div class="value">
<span class="color-999">请选择</span>
<div class="value" @click="showType=true">
<span :class="appId ? '' : 'color-999'">{{appName}}</span>
<u-icon name="arrow-right" color="#cccccc" size="14"></u-icon>
</div>
</div>
<div class="item">
<span class="label"><span class="tips">*</span>姓名</span>
<div class="info-content" v-for="(items, indexs) in formDataList" :key="indexs">
<div v-for="(item, index) in items" :key="index">
<!-- input输入框 -->
<div class="item" v-if="item.type == 'input' || item.type == 'name' || item.type == 'phone'">
<span class="label"><span class="tips">{{item.mustFill == 1 ? '*' : ''}}</span>{{item.fieldName}}</span>
<div class="value">
<u-input type="text" placeholder="请输入" input-align="right" placeholder-style="color:#999;font-size:16px;" height="48" />
<u-input type="text" placeholder="请输入" input-align="right" placeholder-style="color:#999;font-size:16px;" height="48" v-model="formData[item.fieldDbName]" :maxlength="item.maxLength" />
</div>
</div>
<div class="item">
<span class="label"><span class="tips">*</span>身份证号</span>
<!-- number 输入框 -->
<div class="item" v-if="item.type == 'number'">
<span class="label"><span class="tips">{{item.mustFill == 1 ? '*' : ''}}</span>{{item.fieldName}}</span>
<div class="value">
<u-input type="text" placeholder="请输入" input-align="right" placeholder-style="color:#999;font-size:16px;" height="48" />
<u-input type="number" placeholder="请输入" input-align="right" placeholder-style="color:#999;font-size:16px;" height="48" v-model="formData[item.fieldDbName]" :maxlength="item.maxLength" />
</div>
</div>
<div class="item">
<span class="label"><span class="tips">*</span>性别</span>
<!-- 身份证输入框 -->
<div class="item" v-if="item.type == 'idNumber'">
<span class="label"><span class="tips">{{item.mustFill == 1 ? '*' : ''}}</span>{{item.fieldName}}</span>
<div class="value">
<span class="color-999">请选择</span>
<u-input type="idcard" placeholder="请输入" input-align="right" placeholder-style="color:#999;font-size:16px;" height="48" v-model="formData[item.fieldDbName]" :maxlength="item.maxLength" />
</div>
</div>
<!-- textarea输入框 富文本-->
<div class="textarea" v-if="item.type == 'textarea' || item.type == 'text' || item.type == 'rtf'">
<span class="label"><span class="tips">{{item.mustFill == 1 ? '*' : ''}}</span>{{item.fieldName}}</span>
<div class="value">
<u-input type="textarea" placeholder="请输入请输入" placeholder-style="color:#999;font-size:16px;" height="200" v-model="formData[item.fieldDbName]" :maxlength="item.maxLength" />
</div>
</div>
<!-- 字典下拉选择 -->
<div class="item" v-if="item.type == 'dict'">
<span class="label"><span class="tips">{{item.mustFill == 1 ? '*' : ''}}</span>{{item.fieldName}}</span>
<div class="value" @click="selectClick(item.fieldDbName, item.dict)">
<span :class="formData[item.fieldDbName] ? '' : 'color-999'">{{$dict.getLabel(item.dict, formData[item.fieldDbName]) || '请选择'}}</span>
<u-icon name="arrow-right area-icon" color="#cccccc" size="14"></u-icon>
</div>
</div>
<!-- 单选radio -->
<div class="item" v-if="item.type == 'radio'">
<span class="label"><span class="tips">{{item.mustFill == 1 ? '*' : ''}}</span>{{item.fieldName}}</span>
<div class="value">
<u-radio-group v-model="formData[item.fieldDbName]">
<u-radio :name="item.dictValue" v-for="(item, index) in $dict.getDict(item.dict)" :key="index">
{{ item.dictName }}
</u-radio>
</u-radio-group>
</div>
</div>
<!-- 开关onOff -->
<div class="item" v-if="item.type == 'onOff'">
<span class="label"><span class="tips">{{item.mustFill == 1 ? '*' : ''}}</span>{{item.fieldName}}</span>
<div class="value">
<u-switch v-model="formData[item.fieldDbName]"></u-switch>
</div>
</div>
<!-- 多选checkbox -->
<div class="textarea" v-if="item.type == 'checkbox'">
<span class="label"><span class="tips">{{item.mustFill == 1 ? '*' : ''}}</span>{{item.fieldName}}</span>
<div class="value">
<u-checkbox-group>
<u-checkbox
v-model="e.checked"
v-for="(e, i) in item.checkList" :key="i"
:name="item.dictValue"
@change="checkboxChange(indexs, index, i)"
>{{e.dictName}}</u-checkbox>
</u-checkbox-group>
</div>
</div>
<!-- 附件 -->
<div class="textarea" v-if="item.type == 'upload'">
<span class="label"><span class="tips">{{item.mustFill == 1 ? '*' : ''}}</span>{{item.fieldName}}</span>
<div class="value">
<AiUploader :multiple="true" type="image" :limit="9" placeholder="上传图片" :def.sync="formData[item.fieldDbName]"
action="/admin/file/add2"></AiUploader>
</div>
</div>
<!-- 地区选择 -->
<div class="item area" v-if="item.type == 'area'">
<span class="label"><span class="tips">{{item.mustFill == 1 ? '*' : ''}}</span>{{item.fieldName}}</span>
<div class="value">
<AiAreaPicker v-model="formData[item.fieldDbName]" :areaId="user.areaId"></AiAreaPicker>
<u-icon name="arrow-right area-icon" color="#cccccc" size="14"></u-icon>
</div>
</div>
<!-- 人员选择 -->
<div class="item" v-if="item.type == 'user'">
<span class="label"><span class="tips">{{item.mustFill == 1 ? '*' : ''}}</span>{{item.fieldName}}</span>
<div class="value" @click="handleSelectUser(item.fieldDbName)">
<template v-if="!formData[item.fieldDbName].length">
<span>请选择</span>
</template>
<template v-else>
已选择<em>{{ formData[item.fieldDbName].map(e => e.name).slice(0, 2).join("、") }}</em><em>{{
formData[item.fieldDbName].length
}}</em>
</template>
<u-icon name="arrow-right" color="#cccccc" size="14"></u-icon>
</div>
</div>
<div class="item">
<span class="label"><span class="tips">*</span>出生日期</span>
<div class="value">
<span class="color-999">请选择</span>
<u-icon name="arrow-right" color="#cccccc" size="14"></u-icon>
<!-- 日期选择 / 日期带时分秒选择 / 时间-时分秒选择 -->
<div class="item" v-if="item.type == 'date' || item.type == 'datetime' || item.type == 'time'">
<span class="label"><span class="tips">{{item.mustFill == 1 ? '*' : ''}}</span>{{item.fieldName}}</span>
<div class="value" @click="dateClick(indexs, index)">
<span :class="formData[item.fieldDbName] ? '' : 'color-999'">{{formData[item.fieldDbName] || '请选择'}}</span>
<u-icon name="arrow-right area-icon" color="#cccccc" size="14"></u-icon>
</div>
</div>
<div class="item">
<span class="label"><span class="tips">*</span>联系电话</span>
<div class="value">
<u-input type="text" placeholder="请输入" input-align="right" placeholder-style="color:#999;font-size:16px;" height="48" />
</div>
</div>
<div class="item">
<span class="label"><span class="tips">*</span>所属区域</span>
<div class="value">
<span class="color-999">请选择</span>
<u-icon name="arrow-right" color="#cccccc" size="14"></u-icon>
</div>
</div>
<div class="item">
<span class="label"><span class="tips">*</span></span>
<div class="value">
<span class="color-999">请选择</span>
<u-icon name="arrow-right" color="#cccccc" size="14"></u-icon>
</div>
</div>
<div class="item">
<span class="label"><span class="tips"></span>所属网格</span>
<div class="value">
<span class="color-999">请选择</span>
<u-icon name="arrow-right" color="#cccccc" size="14"></u-icon>
</div>
</div>
<div class="item">
<span class="label"><span class="tips"></span>小区</span>
<div class="value">
<span class="color-999">请选择</span>
<u-icon name="arrow-right" color="#cccccc" size="14"></u-icon>
</div>
</div>
<div class="item">
<span class="label"><span class="tips"></span>详细地址</span>
<div class="value">
<span class="color-999">请选择</span>
<u-icon name="arrow-right" color="#cccccc" size="14"></u-icon>
<u-picker mode="time" v-model="dateShow" :params="deteParams" start-year="2010" @confirm="dateConfirm" >请选择</u-picker>
</div>
</div>
</div>
<div class="footer">
<u-select v-model="selectShow" mode="single-column" :list="selectList" label-name="dictName" value-name="dictValue" @confirm="selectConfirm"></u-select>
<u-select v-model="showType" :list="typeList" label-name="applicationName" value-name="id" @confirm="typeConfirm"></u-select>
<div class="footer" @click="submit" v-if="appId">
<div class="btn">保存</div>
</div>
</div>
</template>
<script>
import { mapState } from 'vuex'
import { mapState, mapActions } from 'vuex'
export default {
data() {
return {
appId: '',
appName: '请选择',
showType: false,
typeList: [],
formDataList: [],
formData: {},
pageShow: false,
dateShow: false,
deteParams: {},
datePropIndex: '', //时间选择 formDataList索引
dateIndex: '', //时间选择 formDataList 数组里面的索引
selectName: '',
selectList: [],
selectShow: false,
id: ''
}
},
computed: { ...mapState(['user']) },
mounted() {
created() {
this.getType()
},
methods: {
...mapActions(['selectEnterpriseContact']),
handleSelectUser(fieldDbName) {
this.selectEnterpriseContact({
fromDepartmentId: 0,
type: ["user"],
selectedUserIds: this.form[fieldDbName]?.map(e => e.id)
}).then(res => {
this.form[fieldDbName] = res?.userList || []
})
},
getType() {
this.$http.post(`/app/appapplicationinfo/queryApplicationListByType?type=0`).then((res) => {
if (res?.data) {
this.typeList = res.data
}
})
},
typeConfirm(e) {
this.appId = e[0].value
this.appName = e[0].label
this.$http.post(`/app/appapplicationinfo/queryApplicationInfo?appId=${this.appId}`).then((res) => {
if (res?.data) {
var data = res.data
let dictList = []
let formList = {}
data.tableInfos.map((item) => {
let colItem
if (item.dictionaryCode) {
dictList.push(item.dictionaryCode)
}
if (item.dictionaryCode && item.type != 'radio' && item.type != 'checkbox' && item.type != 'onOff') {
colItem = {
...item,
type: 'dict',
dict: item.dictionaryCode,
fieldValue: item.defaultValue || ''
}
} else if (item.type == 'radio') {
colItem = {
...item,
dict: item.dictionaryCode,
fieldValue: item.defaultValue || ''
}
} else if (item.type == 'checkbox') {
colItem = {
...item,
dict: item.dictionaryCode,
fieldValue: ''
}
if (item.defaultValue) {
var val = item.defaultValue?.split('`')
colItem.fieldValue = val
}
} else if (item.type == 'onOff') {
colItem = {
...item,
fieldValue: false
}
} else if (item.type == 'number') {
colItem = {
...item,
type: item.type,
min: item.minValue || '',
max: item.maxValue || '',
fieldValue: Number(item.defaultValue) || 0
}
}else if(item.type == 'upload' || item.type == 'user') {
colItem = {
...item,
type: item.type,
fieldValue: []
}
}else if(item.type == 'area') {
colItem = {
...item,
type: item.type,
fieldValue: this.user.areaId
}
}else {
if (item.type == 'date') {
item.params = { year: true, month: true, day: true, hour: false, minute: false, second: false}
}
if (item.type == 'datetime') {
item.params = { year: true, month: true, day: true, hour: true, minute: true, second: true}
}
if (item.type == 'time') {
item.params = { year: false, month: false, day: false, hour: true, minute: true, second: true}
}
colItem = {
...item,
type: item.type,
}
colItem.fieldValue = item.defaultValue || ''
}
formList[item.groupIndex]?.push(colItem) || (formList[item.groupIndex] = [colItem])
this.$set(this.formData, colItem.fieldDbName, colItem.fieldValue || "")
})
this.formDataList = Object.values(formList)
if (dictList.length) {
this.getDictList(dictList)
} else {
this.formDataList.map((item)=> {
item.map((e) => {
if (e.type == 'onOff') { //开关
this.formData[e.fieldDbName] = false
}
})
})
this.$forceUpdate()
this.pageShow = true
}
}
})
},
getDictList(listName) {
this.$dict.load(listName.join(',')).then(() => {
this.formDataList.map((item)=> {
item.map((e) => {
if(e.type == 'checkbox') { //多选
var list = this.$dict.getDict(e.dict)
console.log(list)
list.map((items) => {
items.checked = false
})
e.checkList = list
}
if (e.type == 'onOff') { //开关
this.formData[e.fieldDbName] = false
}
})
})
this.$forceUpdate()
this.pageShow = true
})
},
selectClick(name, dictName) {
this.selectName = name
this.selectList = this.$dict.getDict(dictName)
this.selectShow = true
},
selectConfirm(e) {
this.formData[this.selectName] = e[0].value
},
checkboxChange(indexs, index, i) {
this.formDataList[indexs][index].checkList[i].checked = !this.formDataList[indexs][index].checkList[i].checked
this.$forceUpdate()
},
dateClick(indexs, index) {
this.dateShow = true
this.deteParams = this.formDataList[indexs][index].params
this.datePropIndex = indexs
this.dateIndex = index
},
dateConfirm(e) {
var fieldDbName = this.formDataList[this.datePropIndex][this.dateIndex].fieldDbName
if(this.formDataList[this.datePropIndex][this.dateIndex].type == 'date') { //年月日
this.formData[fieldDbName] = `${e.year}-${e.month}-${e.day}`
}
if(this.formDataList[this.datePropIndex][this.dateIndex].type == 'datetime') { //年月日时分秒
this.formData[fieldDbName] = `${e.year}-${e.month}-${e.day} ${e.hour}-${e.minute}-${e.second}`
}
if(this.formDataList[this.datePropIndex][this.dateIndex].type == 'time') { //时分秒
this.formData[fieldDbName] = `${e.hour}-${e.minute}-${e.second}`
}
console.log(e)
},
submit() {
var isValid = true
this.formDataList.map((item) => {
if (item.length) {
item.map((items) => {
if (items.type == 'checkbox') { //多选
this.formData[items.fieldDbName] = ''
var list = []
items.checkList.map((e) => {
if(e.checked) {
list.push(e.dictValue)
}
})
this.formData[items.fieldDbName] = list?.toString()
}
if (items.type == 'upload' && this.formData[items.fieldDbName].length) { //附件 只传id
var files = []
this.formData[items.fieldDbName].map((item) => {
files.push(item.id)
})
this.formData[items.fieldDbName] = files.join(',')
}
if (items.type == 'onOff') { //开关
this.formData[items.fieldDbName] = this.formData[items.fieldDbName] ? '1' : '0'
}
})
}
})
this.formDataList.map((item) => {
item.map((items) => {
if(items.mustFill == 1 && this.formData[items.fieldDbName] === '') {
isValid = false
return this.$u.toast(`${items.fieldName}为必填项`)
}
})
})
if (!isValid) return
this.$http.post(`/app/appapplicationinfo/addOrUpdate?appId=${this.appId}`, {
...this.formData,
id: this.id || ''
}).then((res) => {
if (res.code == 0) {
this.$u.toast('提交成功')
setTimeout(() => {
this.onBack(true)
}, 600)
}
})
},
}
}
</script>
@@ -145,6 +427,16 @@ export default {
color: #333;
line-height: 44px;
box-sizing: border-box;
position: relative;
.value{
.u-icon{
margin-left: 16px;
}
::v-deep .u-input{
font-size: 32px;
}
}
}
.color-999{
color: #999;
}
@@ -157,14 +449,50 @@ export default {
color: #F46;
line-height: 44px;
}
.value{
.u-icon{
margin-left: 16px;
}
::v-deep .u-input{
.textarea{
width: 100%;
padding: 34px 32px 34px 0;
background: #FFFFFF;
border-bottom: 1px solid #D8DDE6;
.label{
display: inline-block;
font-size: 32px;
font-family: PingFangSC-Regular, PingFang SC;
color: #333;
line-height: 44px;
margin-bottom: 8px;
}
.value{
padding: 0 16px;
}
}
::v-deep .default{
width: 160px!important;
height: 160px!important;
}
.area{
padding: 16px 54px 16px 0;
.label{
display: inline-block;
line-height: 78px!important;
}
.u-icon{
vertical-align: super;
position: absolute;
top: 38px;
right: 16px;
}
}
::v-deep .AiAreaPicker{
display: inline-block;
line-height: 78px;
margin-top: -8px;
}
.area-icon{
vertical-align: super;
position: absolute;
top: 10px;
right: 0;
}
.footer{
width: 100%;

View File

@@ -1,20 +1,19 @@
<template>
<div class="detail">
<div class="tab-select">
<div class="item active">统计信息<span></span></div>
<div class="item">人员信息<span></span></div>
<div class="item" :class="tabIndex == index ? 'active' : ''" v-for="(item, index) in tabs" :key="index" @click="tabClick(index)">{{item}}<span></span></div>
</div>
<div class="area-select">
<div class="select-content">
<div class="area-content">
<AiAreaPicker ref="areaIds" :areaId="areaId" mode="custom" all @select="areaSelect">
<AiAreaPicker :areaId="user.areaId" v-model="areaId" @select="areaSelect">
<img src="./img/local-icon.png" alt="">
<span class="label" v-if="addressArea">{{ addressArea }}</span>
<span class="label" v-if="areaName">{{ areaName }}</span>
<span v-else>请选择</span>
<u-icon name="arrow-down" color="#666" size="24" />
</AiAreaPicker>
</div>
<div class="search-input">
<div class="search-input" v-if="tabIndex">
<img src="./img/search-icon.png" alt="">
<u-input type="text" placeholder="请输入姓名" placeholder-style="color:#999;font-size:13px;" height="18" />
</div>
@@ -72,7 +71,7 @@
</div>
</div>
</div>
<div>
<div v-else>
<div class="item-content">
<div class="title">
<h2>精神病患者</h2>
@@ -93,7 +92,7 @@
</div>
</div>
</div>
<div class="footer">
<div class="footer" @click="toAdd">
<div class="btn">新增特殊人群信息</div>
</div>
</div>
@@ -107,21 +106,47 @@ export default {
data() {
return {
areaId: '',
tabIndex: 1,
addressArea: ''
tabs: ['统计信息', '人员信息'],
tabIndex: 0,
addressArea: '',
}
},
computed: { ...mapState(['user']) },
mounted() {
this.areaId = this.user.areaId
this.areaName = this.user.areaName
this.getStatistic()
this.getUserList()
},
methods: {
areaSelect() {
areaSelect(e) {
this.areaId = e.id
this.areaName = e.name
},
tabClick(index) {
this.tabIndex = index
},
getStatistic() {
this.$http.post(`/app/appapplicationinfo/specialStatistic?areaId=${this.areaId}&type=0`).then((res) => {
if (res.code == 0) {
}
})
},
getUserList() {
this.$http.post(`/app/appapplicationinfo/queryPeople?areaId=${this.areaId}&type=0`).then((res) => {
if (res.code == 0) {
}
})
},
toAdd() {
this.$emit('change', {
type: 'Add',
})
}
}
}
</script>

View File

@@ -119,7 +119,6 @@
</div>
</div>
</u-popup>
<AiBack custom @back="back"/>
</div>
<div class="detail" v-if="isShowConfig">
<component

View File

@@ -61,7 +61,6 @@
</div>
</div>
</div>
<AiBack custom @back="$emit('back')"/>
</div>
</template>

View File

@@ -28,7 +28,6 @@
</div>
</div>
</template>
<AiBack/>
</div>
</template>

View File

@@ -83,7 +83,6 @@
</div>
</div>
<u-picker mode="time" v-model="show" :params="options" @confirm="confirm"></u-picker>
<AiBack ref="aiBack" v-if="!userSelect"/>
</div>
</template>

View File

@@ -38,7 +38,6 @@
<AiEmpty/>
</template>
</div>
<AiBack/>
</div>
</template>

View File

@@ -94,7 +94,6 @@
</div>
</template>
<u-modal v-model="show" title="提示" show-cancel-button content='是否要取消该会议?' @confirm="onConfirm"></u-modal>
<AiBack/>
</div>
</template>

View File

@@ -35,7 +35,6 @@
</div>
<u-loadmore :status="status" v-if="list.length"/>
<AiEmpty v-if="!list.length"></AiEmpty>
<AiBack/>
</div>
</template>

View File

@@ -61,7 +61,6 @@
<div @click="add(1)">立即发布</div>
</div>
</div>
<AiBack ref="aiBack" v-if="!userSelect"/>
<u-picker v-model="show" mode="time" :params="options" @confirm="confirm"></u-picker>
</div>
</template>

View File

@@ -55,7 +55,6 @@
</div>
</template>
<AiEmpty description="该通知已撤回" v-else/>
<AiBack/>
</div>
</template>

View File

@@ -9,7 +9,6 @@
<AiOpenData type="userName" :openid="item.id"></AiOpenData>
</div>
</div>
<AiBack/>
</div>
</template>