talk_appAmin/pages/work/activity_sh/activity_info.vue

492 lines
9.7 KiB
Vue
Raw Normal View History

2024-06-29 22:16:16 +08:00
<template>
<view class="">
<!-- 审核的信息 -->
2024-06-30 11:33:39 +08:00
<view class="shenghe_item">
<image v-if="actiInfoList.auditStatus == 0" src="../../../static/images/icon/pass.png" mode=""
class="pass_unpass pass"></image>
<image v-if="actiInfoList.auditStatus == 4" src="../../../static/images/icon/unpass.png" mode=""
class="pass_unpass unpass">
2024-06-29 22:16:16 +08:00
</image>
<view class="user_header">
<view class="">
<view class="user_img">
2024-06-30 10:51:17 +08:00
<image :src="avatarIcon(actiInfoList.avatarInfo)" mode=""></image>
2024-06-29 22:16:16 +08:00
</view>
<view class="user_msg">
2024-06-30 10:51:17 +08:00
<h4>{{ actiInfoList.nickName }}</h4>
2024-06-30 11:33:39 +08:00
<p>{{ timeAgo(actiInfoList.createTime) }}·{{ actiInfoList.infoSchool }}</p>
2024-06-29 22:16:16 +08:00
</view>
</view>
<view class="text_style">
</view>
</view>
<!-- 审核的文章标题 -->
<view class="shenghe_title">
2024-06-30 10:51:17 +08:00
<h4>{{ actiInfoList.acTitle }}</h4>
<p>活动时间{{ actiInfoList.startTime }} - {{ actiInfoList.endTime }}</p>
<p>活动地点{{ actiInfoList.addres }}</p>
2024-06-29 22:16:16 +08:00
</view>
<!-- 活动内容 -->
<view class="text_msg">
2024-06-30 10:51:17 +08:00
<up-text size="15" color="#000000" lineHeight="23" :text="actiInfoList.acContent"></up-text>
2024-06-30 11:33:39 +08:00
2024-06-29 22:16:16 +08:00
</view>
2024-06-30 10:51:17 +08:00
<view class="cardx" v-for="(item, index) in toimage(actiInfoList.file)" :key="index">
2024-06-30 11:33:39 +08:00
<image :src="item" class="image"></image>
</view>
<view>
2024-06-29 22:16:16 +08:00
</view>
<!-- 审核未通过的提示框 -->
2024-06-30 11:33:39 +08:00
<view class="tishi_box" v-if="actiInfoList.auditStatus == 3 | actiInfoList.auditStatus == 4">
<h2>审核未通过</h2>
<p>未通过原因:{{ actiInfoList.auditAdvice }}</p>
2024-06-29 22:16:16 +08:00
</view>
</view>
2024-06-30 11:33:39 +08:00
2024-06-29 22:16:16 +08:00
<footer>
2024-06-30 14:52:10 +08:00
<view class="footer_top" v-if="actiInfoList.auditStatus != 0 && actiInfoList.auditStatus != 4">
2024-06-30 11:33:39 +08:00
<view class="footer_btn footer_btn_left" @click="actiAudit">
2024-06-29 22:16:16 +08:00
通过
</view>
<view class="footer_btn footer_btn_right" @click="show = true">
不通过
</view>
</view>
<view class="footer_bottom">
</view>
</footer>
<!-- 弹窗显示不通过原因 -->
2024-06-30 11:33:39 +08:00
<up-popup :show="show" @close="show = false" @open="openAudit" mode="center" :round="12">
<view class="popup">
<!-- 标题 -->
<h4>未通过原因</h4>
<!-- 输入区域0 -->
<up-textarea v-model="value2" placeholder="请输入内容" count class="input_area"></up-textarea>
<view class="popup_btns">
<view class="popup_btns_left popup_btn" @click="close()">
取消
</view>
<view class="popup_btns_right popup_btn" @click="UNpass">
确认
2024-06-29 22:16:16 +08:00
</view>
</view>
2024-06-30 11:33:39 +08:00
</view>
</up-popup>
2024-06-29 22:16:16 +08:00
</view>
</template>
<script setup>
2024-06-30 10:51:17 +08:00
import { getTakePartsInfoByacId, gotoQrcode, gotoSing1, gotoSing2 } from "@/api/activityInfo/activityTakeInfo";
2024-06-30 11:33:39 +08:00
import { listInfo, getInfo, getInfoall, delInfo, addInfo, updateAuditInfo } from "@/api/activityInfo/info";
2024-06-30 10:51:17 +08:00
import { getDicts } from "@/api/system/dict/data";
import { onShow, onLoad } from '@dcloudio/uni-app';
import { ref, reactive, getCurrentInstance, toRefs, computed } from 'vue';
import { useStore } from 'vuex';
const showqr = ref(false)
const { proxy } = getCurrentInstance();
const iconConfig = proxy.iconConfig;
const style = ref({
2024-06-30 11:33:39 +08:00
p: 'font-weight: 400;font-size: 24rpx;color: #000000 !important;',
2024-06-30 10:51:17 +08:00
});
const activityState = ref([]); // 字典 activity_state 活动状态
const takePartState = ref([]); // 字典 take_part_state 活动参与状态
const open = ref(false);
const store = useStore();
const QNDomain = store.state.user.QNDomain;
const actiInfoList = ref({});
const activityAttendInfo = ref({});
const qrcodeInfo = ref();
2024-06-30 11:33:39 +08:00
var value2 = ref('')
//判断文章状态根据 1 2 3 v-if判断
var page_type = ref(1)
// 创建响应式数据
const show = ref(false);
// 定义方法 弹出打开
function openAudit() {
// 打开逻辑,比如设置 show 为 true
show.value = true;
value2.value = actiInfoList.value.auditAdvice
// console.log('open');
}
//弹出关闭
function close() {
// 关闭逻辑,设置 show 为 false
show.value = false;
// console.log('close');
2024-06-30 10:51:17 +08:00
}
2024-06-30 11:33:39 +08:00
const avatarIcon = (e) => {
return QNDomain + e;
};
2024-06-30 10:51:17 +08:00
onLoad((options) => {
2024-06-30 11:33:39 +08:00
const _id = options.id;
getInfo(_id).then(response => {
actiInfoList.value = response.data;
console.log("actiInfoList:", actiInfoList.value);
});
getDicts('activity_state').then(e => {
activityState.value = e.data;
});
getDicts('take_part_state').then(e => {
takePartState.value = e.data;
});
2024-06-30 10:51:17 +08:00
});
const leftClick = () => {
2024-06-30 11:33:39 +08:00
proxy.$tab.navigateBack(1);
2024-06-30 10:51:17 +08:00
};
const toimage = (url) => {
2024-06-30 11:33:39 +08:00
if (typeof url === 'string') {
let info = url.split(",");
let processedInfo = info.map(item => QNDomain + item);
console.log("processedInfo", processedInfo);
return processedInfo;
}
return null;
2024-06-30 10:51:17 +08:00
};
function timeAgo(input) {
2024-06-30 11:33:39 +08:00
const date = new Date(input);
if (isNaN(date)) {
throw new Error('Invalid date');
}
const now = new Date();
const diff = now - date;
const minutes = Math.floor(diff / 60000); // 1 minute = 60000 ms
const hours = Math.floor(diff / 3600000); // 1 hour = 3600000 ms
const days = Math.floor(diff / 86400000); // 1 day = 86400000 ms
if (diff < 0) {
return formatDate(date);
}
if (minutes < 60) {
if (minutes == 0) {
return '刚刚';
2024-06-30 10:51:17 +08:00
}
2024-06-30 11:33:39 +08:00
return `${minutes}分钟前`;
} else if (hours < 24) {
return `${hours}小时前`;
} else if (days < 3) {
return `${days}天前`;
} else {
return formatDate(date);
2024-06-30 10:51:17 +08:00
}
2024-06-30 11:33:39 +08:00
}
function formatDate(input) {
const date = new Date(input);
if (isNaN(date)) {
throw new Error('Invalid date');
}
const year = date.getFullYear();
const month = String(date.getMonth() + 1).padStart(2, '0');
const day = String(date.getDate()).padStart(2, '0');
return `${year}.${month}.${day}`;
}
const actiAudit = () => {
proxy.$modal.loading("数据提交中~")
console.log("通过:", actiInfoList.value);
let form = {
id: actiInfoList.value.id,
auditStatus: 0
}
updateAuditInfo(form).then(e => {
proxy.$modal.closeLoading()
if (e.code == 200) {
proxy.$modal.msgSuccess('审核通过')
getInfo(actiInfoList.value.id).then(response => {
actiInfoList.value = response.data;
});
2024-06-30 10:51:17 +08:00
}
2024-06-30 11:33:39 +08:00
console.log("通过:", e);
})
}
// 未通过弹窗的确定点击事件
function UNpass() {
proxy.$modal.loading("数据提交中~")
let form = {
id: actiInfoList.value.id,
auditStatus: 4,
auditAdvice: value2.value
}
updateAuditInfo(form).then(e => {
proxy.$modal.closeLoading()
if (e.code == 200) {
proxy.$modal.msgSuccess('审核成功')
getInfo(actiInfoList.value.id).then(response => {
actiInfoList.value = response.data;
});
}
})
close()
}
2024-06-30 10:51:17 +08:00
2024-06-29 22:16:16 +08:00
</script>
<style lang="scss" scoped>
2024-06-30 11:33:39 +08:00
.cardx {
margin-top: 48rpx;
2024-06-29 22:16:16 +08:00
2024-06-30 11:33:39 +08:00
.image {
width: 686rpx;
border-radius: 24rpx;
height: 720rpx;
2024-06-29 22:16:16 +08:00
}
2024-06-30 11:33:39 +08:00
}
2024-06-29 22:16:16 +08:00
2024-06-30 11:33:39 +08:00
page {
background-color: #fff;
}
2024-06-29 22:16:16 +08:00
2024-06-30 11:33:39 +08:00
.shenghe_item {
width: 750rpx;
background: #ffffff;
padding: 30rpx 32rpx 216rpx 32rpx;
position: relative;
}
2024-06-29 22:16:16 +08:00
2024-06-30 11:33:39 +08:00
.pass_unpass {
position: absolute;
right: 0;
2024-06-29 22:16:16 +08:00
2024-06-30 11:33:39 +08:00
}
2024-06-29 22:16:16 +08:00
2024-06-30 11:33:39 +08:00
.pass {
width: 263rpx;
height: 200rpx;
}
.unpass {
width: 230rpx;
height: 200rpx;
}
.user_header {
width: 100%;
display: flex;
justify-content: space-between;
height: 84rpx;
.user_img {
width: 84rpx;
2024-06-29 22:16:16 +08:00
height: 84rpx;
2024-06-30 11:33:39 +08:00
margin-right: 19rpx;
2024-06-29 22:16:16 +08:00
2024-06-30 11:33:39 +08:00
image {
2024-06-29 22:16:16 +08:00
width: 84rpx;
height: 84rpx;
2024-06-30 11:33:39 +08:00
border-radius: 50%;
}
}
2024-06-29 22:16:16 +08:00
2024-06-30 11:33:39 +08:00
.user_msg {
h4 {
font-weight: 600;
height: 31rpx;
font-size: 30rpx;
text-align: left;
color: #000000 100%;
margin-bottom: 18rpx;
2024-06-29 22:16:16 +08:00
}
2024-06-30 11:33:39 +08:00
p {
height: 30rpx;
font-size: 30rpx;
color: #999999;
2024-06-29 22:16:16 +08:00
}
2024-06-30 11:33:39 +08:00
}
2024-06-29 22:16:16 +08:00
2024-06-30 11:33:39 +08:00
.text_style {
2024-06-29 22:16:16 +08:00
2024-06-30 11:33:39 +08:00
right: 0;
font-weight: 400;
width: 84rpx;
height: 28rpx;
font-size: 28rpx;
text-align: left;
color: #6AA2FF;
2024-06-29 22:16:16 +08:00
}
2024-06-30 11:33:39 +08:00
}
2024-06-29 22:16:16 +08:00
2024-06-30 11:33:39 +08:00
.user_header>view {
display: flex;
2024-06-29 22:16:16 +08:00
2024-06-30 11:33:39 +08:00
}
2024-06-29 22:16:16 +08:00
2024-06-30 11:33:39 +08:00
.shenghe_title {
h4 {
2024-06-29 22:16:16 +08:00
font-weight: 400;
2024-06-30 11:33:39 +08:00
width: 100%;
font-size: 32rpx;
text-align: left;
color: #000000;
margin-top: 32rpx;
margin-bottom: 28rpx;
2024-06-29 22:16:16 +08:00
}
2024-06-30 11:33:39 +08:00
}
2024-06-29 22:16:16 +08:00
2024-06-30 11:33:39 +08:00
.shenghe_title p {
font-weight: 400;
2024-06-29 22:16:16 +08:00
2024-06-30 11:33:39 +08:00
height: 24rpx;
font-size: 24rpx;
color: #999999;
margin-bottom: 12rpx;
}
2024-06-29 22:16:16 +08:00
2024-06-30 11:33:39 +08:00
.text_msg {
font-size: 24rpx;
margin-top: 48rpx;
}
2024-06-29 22:16:16 +08:00
2024-06-30 11:33:39 +08:00
.image_box {
width: 686rpx;
height: 720rpx;
border-radius: 24rpx 24rpx 24rpx 24rpx;
background: #caf6f5;
margin-top: 48rpx;
}
2024-06-29 22:16:16 +08:00
2024-06-30 11:33:39 +08:00
footer {
position: fixed;
bottom: 0px;
border-top: 4rpx solid #f6f6f6;
2024-06-29 22:16:16 +08:00
2024-06-30 11:33:39 +08:00
}
2024-06-29 22:16:16 +08:00
2024-06-30 11:33:39 +08:00
.footer_top {
width: 750rpx;
height: 94rpx;
background: #ffffff;
display: flex;
align-items: center;
justify-content: space-around;
}
2024-06-29 22:16:16 +08:00
2024-06-30 11:33:39 +08:00
.footer_bottom {
width: 750rpx;
height: 68rpx;
background: #f6f6f6;
}
2024-06-29 22:16:16 +08:00
2024-06-30 11:33:39 +08:00
.footer_btn {
width: 300rpx;
height: 60rpx;
border-radius: 30rpx 30rpx 30rpx 30rpx;
display: flex;
align-items: center;
justify-content: center;
color: #fff;
font-size: 28rpx;
font-weight: 600;
}
2024-06-29 22:16:16 +08:00
2024-06-30 11:33:39 +08:00
.footer_btn_left {
background: #6aa2ff;
}
2024-06-29 22:16:16 +08:00
2024-06-30 11:33:39 +08:00
.footer_btn_right {
background: #fa3939;
}
2024-06-29 22:16:16 +08:00
2024-06-30 11:33:39 +08:00
.popup {
width: 600rpx;
height: 470rpx;
border-radius: 24rpx 24rpx 24rpx 24rpx;
background: #ffffff;
2024-06-29 22:16:16 +08:00
2024-06-30 11:33:39 +08:00
}
2024-06-29 22:16:16 +08:00
2024-06-30 11:33:39 +08:00
.popup {}
2024-06-29 22:16:16 +08:00
2024-06-30 11:33:39 +08:00
.popup h4 {
font-weight: 600;
text-align: center;
height: 31rpx;
font-size: 30rpx;
color: #000000 100%;
margin-top: 32rpx;
}
.input_area {
width: 552rpx;
height: 246rpx;
border-radius: 16rpx 16rpx 16rpx 16rpx;
background: #f4f5f6;
margin: 31rpx auto;
}
.popup_btns {
width: 100%;
display: flex;
align-items: center;
justify-content: space-around;
}
.popup_btn {
width: 180rpx;
height: 50rpx;
border-radius: 16rpx 16rpx 16rpx 16rpx;
display: flex;
align-items: center;
justify-content: space-around;
font-weight: 600;
font-size: 24rpx;
margin-top: 48rpx;
color: #FFFFFF;
}
.popup_btns_left {
background-color: #6AA2FF;
}
.popup_btns_right {
background-color: #FA3939;
}
.tishi_box {
width: 686rpx;
height: 134rpx;
border-radius: 24rpx 24rpx 24rpx 24rpx;
background: #ffffff;
box-shadow: 0rpx 0rpx 20rpx #ececed;
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
color: #FA3939;
}
.tishi_box h2 {
font-size: 36rpx;
}
.tishi_box p {
font-size: 24rpx;
margin-top: 16rpx;
}
2024-06-29 22:16:16 +08:00
</style>