diff --git a/src/apps/AppActive/ActiveDetail.vue b/src/apps/AppActive/ActiveDetail.vue index 0d275707..f62834bd 100644 --- a/src/apps/AppActive/ActiveDetail.vue +++ b/src/apps/AppActive/ActiveDetail.vue @@ -1,52 +1,149 @@ @@ -60,130 +157,156 @@ export default { }, data() { return { - info: {}, - pageShow: false, id: '', - supportFlag: true, - showReply: false, - content: '', - lastReplyId: '', - lastReplyName: '', + detail: {}, + activeList: [], + imgList: [], + list: [ + { + name: '活动详情', + }, + { + name: '活动动态', + }, + ], + current: 0, } }, - - onLoad(query) { - this.id = query.id - this.getInfo() - uni.$emit('refresh') + onLoad(option) { + this.id = option.id + this.$dict.load(['newActivityStatus']).then(() => { + this.getDetail() + }) }, - methods: { - getInfo() { - this.$loading() - this.$http.post(`/app/apppostinfo/queryDetailById?id=${this.id}`).then((res) => { - if (res.code === 0) { - this.info = res.data + 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 (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 + if (this.activeList) { + let imagesList = [] + this.activeList.map((item) => { + if (item.images) { + item.images = JSON.parse(item.images || '[]') + imagesList.push(item.images) } - } - }) - } - }, - 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() + return item + }) + this.imgList = imagesList + } } }) }, - replyClick(e) { + 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: `是否回复${e.createUserName}的评论?`, + content: `${text}`, confirmText: '确定', - success: (res) => { - if (res.confirm) { - uni.$emit('refresh') - this.showReply = true - this.lastReplyId = e.id - this.lastReplyName = e.createUserName + success: (e) => { + if (status == 1) { + //发布 + this.changeStatusConfirm(status) + } + if (status == 2) { + //报名 + this.report() + } + if (status == 3) { + //取消报名 + this.cancelReport() } }, }) }, - del() { - uni.showModal({ - title: '提示', - content: `是否删除该帖子?`, - confirmText: '确定', - success: (res) => { - if (res.confirm) { - this.confirmDel() + cancelReport() { + this.$instance + .post(`/app/appactivityuser/removeReport`, { + activityId: this.id, + partyId: this.user.partyId, + }) + .then((res) => { + if (res.code == 0) { + this.$toast('提交成功') + this.getDetail() } - }, - }) + }) }, - 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) - } - }) + 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({ @@ -194,193 +317,286 @@ export default { }, } - diff --git a/src/apps/AppResidentActivitie/AppResidentActivities.vue b/src/apps/AppResidentActivitie/AppResidentActivities.vue new file mode 100644 index 00000000..810fd720 --- /dev/null +++ b/src/apps/AppResidentActivitie/AppResidentActivities.vue @@ -0,0 +1,194 @@ + + + + + diff --git a/src/apps/AppResidentActivitie/Detail.vue b/src/apps/AppResidentActivitie/Detail.vue new file mode 100644 index 00000000..9b973710 --- /dev/null +++ b/src/apps/AppResidentActivitie/Detail.vue @@ -0,0 +1,25 @@ + + + + + diff --git a/src/apps/AppResidentActivitie/yan.jpg b/src/apps/AppResidentActivitie/yan.jpg new file mode 100644 index 00000000..bf6a5a2c Binary files /dev/null and b/src/apps/AppResidentActivitie/yan.jpg differ