整合提交

main
尕宋 2024-06-07 17:39:49 +08:00
commit 746b801587
16 changed files with 1322 additions and 281 deletions

View File

@ -0,0 +1,74 @@
import request from '@/utils/request'
// 查询活动参与表列表
export function listActivityTakeInfo(query) {
return request({
url: '/activityInfo/activityTakeInfo/list',
method: 'get',
params: query
})
}
// 查询活动参与表详细
export function getActivityTakeInfo(id) {
return request({
url: '/activityInfo/activityTakeInfo/' + id,
method: 'get'
})
}
// 查询活动参与表详细
export function getTakePartsInfoByacId(id) {
return request({
url: '/activityInfo/activityTakeInfo/ByacId/' + id,
method: 'get'
})
}
// 新增活动参与表
export function addActivityTakeInfo(data) {
return request({
url: '/activityInfo/activityTakeInfo',
method: 'post',
data: data
})
}
// 修改活动参与表
export function updateActivityTakeInfo(data) {
return request({
url: '/activityInfo/activityTakeInfo',
method: 'put',
data: data
})
}
// 删除活动参与表
export function delActivityTakeInfo(id) {
return request({
url: '/activityInfo/activityTakeInfo/' + id,
method: 'delete'
})
}
// 报名
export function gotoSing1(id) {
return request({
url: '/activityInfo/activityTakeInfo/goSing1/' + id,
method: 'get'
})
}
// 取消报名
export function gotoSing2(id) {
return request({
url: '/activityInfo/activityTakeInfo/goSing2/' + id,
method: 'get'
})
}
// 签到
export function gotoQrcode(data) {
return request({
url: '/activityInfo/activityTakeInfo/goQrcode',
method: 'put',
data: data
})
}

View File

@ -12,7 +12,7 @@ export function listInfo(query) {
// 查询活动详情详细 // 查询活动详情详细
export function getInfo(id) { export function getInfo(id) {
return request({ return request({
url: '/activityInfo/info/' + id, url: '/activityInfo/info/app/' + id,
method: 'get' method: 'get'
}) })
} }

View File

@ -4,6 +4,7 @@ import store from './store' // store
import { install } from './plugins' // plugins import { install } from './plugins' // plugins
import './permission.js' // permission import './permission.js' // permission
import iconConfig from './utils/icon/icon.js' import iconConfig from './utils/icon/icon.js'
// main.js // main.js
import uviewPlus from 'uview-plus' import uviewPlus from 'uview-plus'
import { parseTime, resetForm, addDateRange, handleTree, selectDictLabel, selectDictLabels } from '@/utils/ruoyi' import { parseTime, resetForm, addDateRange, handleTree, selectDictLabel, selectDictLabels } from '@/utils/ruoyi'

View File

@ -7,8 +7,36 @@
"^u-([^-].*)": "uview-plus/components/u-$1/u-$1.vue" "^u-([^-].*)": "uview-plus/components/u-$1/u-$1.vue"
} }
}, },
<<<<<<< HEAD
"pages": [{ "pages": [{
"path": "pages/Friend/violationreporting", "path": "pages/Friend/violationreporting",
=======
"pages": [
{
"path": "pages/index",
"style": {
"navigationBarTitleText": "若依移动端框架",
"navigationStyle": "custom",
"navigationBarTextStyle": "white"
}
},
{
"path" : "pages/post/postInfo/postInfo",
"style" :
{
"navigationBarTitleText" : "话题详情"
}
},
{
"path" : "pages/post/postPublish/postPublish",
"style" :
{
"navigationBarTitleText" : "发布话题"
}
},
{
"path": "pages/signln/harvestaddress",
>>>>>>> fc6726a74b5811cc7e918233ea3a847aadb88d7d
"style": { "style": {
"navigationBarTitleText": "违规举报", "navigationBarTitleText": "违规举报",
"navigationStyle": "custom" "navigationStyle": "custom"
@ -52,11 +80,18 @@
} }
}, },
{ {
<<<<<<< HEAD
"path": "pages/index", "path": "pages/index",
"style": { "style": {
"navigationBarTitleText": "若依移动端框架", "navigationBarTitleText": "若依移动端框架",
"navigationStyle": "custom", "navigationStyle": "custom",
"navigationBarTextStyle": "white" "navigationBarTextStyle": "white"
=======
"path": "pages/signln/signid",
"style": {
"navigationBarTitleText": "签到任务",
"navigationStyle": "custom"
>>>>>>> fc6726a74b5811cc7e918233ea3a847aadb88d7d
} }
}, },
{ {

View File

@ -157,8 +157,10 @@ function getList() {
queryParams.value.params = {}; queryParams.value.params = {};
listInfo(queryParams.value).then(response => { listInfo(queryParams.value).then(response => {
console.log(response);
actiInfoList.value = response.rows; actiInfoList.value = response.rows;
response.rows.forEach(item => {
actiInfoList.value.push(item)
})
total.value = response.total; total.value = response.total;
}); });
} }
@ -170,15 +172,31 @@ onShow(() => {
console.log('Page onShow') console.log('Page onShow')
}) })
const scrolltolower = () => { // dataisLoading
console.log("scrolltolower"); const isLoading = ref(false);
actiInfoList.value.push({
title: '怎么评论爱德华·艾尔加这位音乐家及其他的作品,欢迎大家发表自己的看法?', const scrolltolower = async () => {
startTime: '2023-05-01 15:00', //
endTime: '2023-05-01 16:00', if (queryParams.value.pageNum * queryParams.value.pageSize < total.value) {
state: '2', //
addrs: '天津电子信息职业技术学院操场东面' if (isLoading.value) return;
}) isLoading.value = true;
queryParams.value.pageNum += 1;
try {
const response = await listInfo(queryParams.value);
// 使Array.prototype.push.applyactiInfoList
Array.prototype.push.apply(actiInfoList.value, response.rows);
console.log(actiInfoList.value);
} catch (error) {
console.error("加载更多数据时发生错误:", error);
} finally {
isLoading.value = false;
}
} else {
//
console.log("没有更多数据了");
}
}; };
@ -190,10 +208,7 @@ function toESearch() {
</script> </script>
<style lang="scss"> <style lang="scss">
.fixed-header { .fixed-header {}
}
.leftinfo { .leftinfo {

View File

@ -2,7 +2,6 @@
<view class="fixed-header"> <view class="fixed-header">
<!-- 顶部导航栏 --> <!-- 顶部导航栏 -->
<up-navbar leftText="" title="" :placeholder="true" :safeAreaInsetTop="true" @leftClick="leftClick"> <up-navbar leftText="" title="" :placeholder="true" :safeAreaInsetTop="true" @leftClick="leftClick">
<template #center> <template #center>
<div class="navbarcenter"><span>活动详情</span></div> <div class="navbarcenter"><span>活动详情</span></div>
</template> </template>
@ -17,7 +16,10 @@
<view class="addrs">活动地点{{ actiInfoList.addres }}</view> <view class="addrs">活动地点{{ actiInfoList.addres }}</view>
</view> </view>
<view class="cardz"> <view class="cardz">
<up-parse :content="actiInfoList.acContent" :tagStyle="style"></up-parse> <!-- <up-parse :content="processContent(actiInfoList.acContent)" :tagStyle="style"></up-parse> -->
<view v-if="textopen" v-html="actiInfoList.acContent" class="acContentstyle"></view>
<up-text size="15" color="#000000" lineHeight="23" v-else :text="actiInfoList.acContent"></up-text>
</view> </view>
<view class="cardx" v-for="(item, index) in toimage(actiInfoList.file)" :key="index"> <view class="cardx" v-for="(item, index) in toimage(actiInfoList.file)" :key="index">
<image :src="item" class="image"></image> <image :src="item" class="image"></image>
@ -25,19 +27,47 @@
</view> </view>
</view> </view>
<view class="dictAuto"> <view class="dictAuto">
<view v-if="actiInfoList.state === '0'">
<view class="state1"> <view class="state3"
<up-button color="#c0f0ec" size="large" shape="circle" @click="btnClick"><span v-if="activityAttendInfo.attendState === '0' || activityAttendInfo.attendState === '1'">
<up-button color="#F1F1F1" size="large" shape="circle"><span class="btnText">未参加</span></up-button>
</view>
<view class="state3" v-else-if="activityAttendInfo.attendState === '2'">
<up-button color="#F1F1F1" size="large" shape="circle"><span class="btnText">已参加</span></up-button>
</view>
</view>
<view v-else-if="actiInfoList.state === '2'">
<view class="state1" v-if="activityAttendInfo.attendState === '0'">
<up-button color="#C0F0EC" size="large" shape="circle" @click="goSing(1)"><span
class="btnText">立即报名</span></up-button> class="btnText">立即报名</span></up-button>
</view> </view>
<view class="state2" v-else-if="activityAttendInfo.attendState === '1'">
<up-button color="#FDE2E2" size="large" shape="circle" @click="goQrcode(1)"><span
class="btnText">扫码签到</span></up-button>
</view>
<view class="state2" v-else-if="activityAttendInfo.attendState === '2'">
<up-button color="#FDE2E2" size="large" shape="circle"><span class="btnText">已签到</span></up-button>
</view>
</view>
<view v-else-if="actiInfoList.state === '1'">
<view class="state1" v-if="activityAttendInfo.attendState === '0'">
<up-button color="#C0F0EC" size="large" shape="circle" @click="goSing(1)"><span
class="btnText">立即报名</span></up-button>
</view>
<view class="state1" v-else-if="activityAttendInfo.attendState === '1'">
<up-button color="#C0F0EC" size="large" shape="circle" @click="goSing(0)"><span
class="btnText">取消报名</span></up-button>
</view>
</view>
</view> </view>
</view> </view>
<view class="infox"> <view class="infox">
<view class="infoavatar"><up-avatar size="60rpx" :src="QNDomain + actiInfoList.launchAvatarsurl"></up-avatar> <view class="infoavatar">
<up-avatar size="60rpx" :src="QNDomain + actiInfoList.avatarInfo" />
<view style="margin-left: 24rpx;">
<view class="launchName">{{ actiInfoList.nickName }}</view>
<view class="launchAddres">{{ actiInfoList.infoSchool }}</view>
</view> </view>
<view>
<view class="launchName">{{ actiInfoList.launchName }}</view>
<view class="launchAddres">{{ actiInfoList.launchAddres }}</view>
</view> </view>
<view class="elroll">已报名{{ actiInfoList.elroll }}</view> <view class="elroll">已报名{{ actiInfoList.elroll }}</view>
</view> </view>
@ -45,87 +75,142 @@
<up-modal :show="open" :title="title" width="600rpx" :content='content' confirmText="签到" cancelText="取消" <up-modal :show="open" :title="title" width="600rpx" :content='content' confirmText="签到" cancelText="取消"
confirmColor="#3477FC" showCancelButton closeOnClickOverlay @confirm="confirm" @cancel="cancel"></up-modal> confirmColor="#3477FC" showCancelButton closeOnClickOverlay @confirm="confirm" @cancel="cancel"></up-modal>
</view> </view>
</template> </template>
<script setup> <script setup>
import { getTakePartsInfoByacId, gotoQrcode, gotoSing1, gotoSing2 } from "@/api/activityInfo/activityTakeInfo";
import { listInfo, getInfo, delInfo, addInfo, updateInfo } from "@/api/activityInfo/info"; import { listInfo, getInfo, delInfo, addInfo, updateInfo } from "@/api/activityInfo/info";
import { onShow, onLoad } from '@dcloudio/uni-app' import { getDicts } from "@/api/system/dict/data";
import { ref, reactive, getCurrentInstance,toRefs } from 'vue' import { onShow, onLoad } from '@dcloudio/uni-app';
import { ref, reactive, getCurrentInstance, toRefs, computed } from 'vue';
import { useStore } from 'vuex'; import { useStore } from 'vuex';
const { proxy } = getCurrentInstance(); const { proxy } = getCurrentInstance();
const iconConfig = proxy.iconConfig; const iconConfig = proxy.iconConfig;
const tu21 = iconConfig.tu21;
const tu22 = iconConfig.tu22;
const tu51 = iconConfig.tu51;
const tu52 = iconConfig.tu52;
const tu53 = iconConfig.tu53;
const style = ref({ const style = ref({
p: 'font-weight: 400;font-size: 24rpx;color: #000000 !important;', p: 'font-weight: 400;font-size: 24rpx;color: #000000 !important;',
});
const activityState = ref([]); // activity_state
}) const takePartState = ref([]); // take_part_state
const open = ref(false) const open = ref(false);
const title = ref('确认签到'); const title = ref('确认签到');
const content = ref('请您确认活动签到,祝您玩的愉快!'); const content = ref('请您确认活动签到,祝您玩的愉快!');
// ref('#001f3f')
const bgColor = ref(''); const bgColor = ref('');
const store = useStore();
const QNDomain = store.state.user.QNDomain;
const store = useStore()
const QNDomain = store.state.user.QNDomain
const actiInfoList = ref({}); const actiInfoList = ref({});
const activityAttendInfo = ref({});
const qrcodeInfo = ref();
function getAvatar() {
return QNDomain + actiInfoList.value.avatarInfo;
}
function isHTML(str) {
const htmlRegex = /<[^>]*>/;
return htmlRegex.test(str);
}
const textopen = ref(false)
onLoad((options) => { onLoad((options) => {
const _id = options.id const _id = options.id;
getInfo(_id).then(response => { getInfo(_id).then(response => {
actiInfoList.value = response.data; actiInfoList.value = response.data;
textopen.value = isHTML(actiInfoList.value.acContent);
console.log("actiInfoList:", actiInfoList.value); console.log("actiInfoList:", actiInfoList.value);
}); });
}) getDicts('activity_state').then(e => {
activityState.value = e.data;
});
getDicts('take_part_state').then(e => {
takePartState.value = e.data;
});
checkStatus(options.id);
});
const checkStatus = (id) => {
getTakePartsInfoByacId(id).then(e => {
activityAttendInfo.value = e.data;
console.log("个人信息:", activityAttendInfo.value)
});
};
const leftClick = () => { const leftClick = () => {
proxy.$tab.navigateBack(1) proxy.$tab.navigateBack(1);
};
const toimage = (url) => {
if (typeof url === 'string') {
let info = url.split(",");
let processedInfo = info.map(item => QNDomain + item);
console.log("processedInfo", processedInfo);
return processedInfo;
} }
const qrcodeInfo = ref() return null;
const btnClick = () => { };
function cancel() {
open.value = !open.value;
}
const getDictLabelByValue = (state) => {
const dict = activityState.value.find((dict) => dict.dictValue === state);
return dict ? dict : '未知状态';
};
const goSing = (e) => {
if (e === 0) {
//
gotoSing2(activityAttendInfo.value.id).then(e => {
proxy.$modal.msgSuccess("取消报名成功!");
actiInfoList.value.elroll -= 1
})
}
if (e === 1) {
//
gotoSing1(activityAttendInfo.value.id).then(e => {
proxy.$modal.msgSuccess("报名成功!");
actiInfoList.value.elroll += 1
})
}
//
checkStatus(actiInfoList.value.id);
}
const goQrcode = () => {
uni.scanCode({ uni.scanCode({
onlyFromCamera: true, onlyFromCamera: true,
success: (res) => { success: (res) => {
console.log('扫描二维码成功,结果:', res); console.log('扫描二维码成功,结果:', res);
toqrcode(res); toqrcode(res);
open.value = !open.value
}, },
error: (res) => { error: (res) => {
console.log('扫描二维码出现错误') console.log('扫描二维码出现错误');
} }
}) });
} }
const toimage = (url) => {
console.log(QNDomain); function confirm() {
if (typeof url === 'string') { open.value = !open.value;
let info = url.split(","); activityAttendInfo.value.qrcodeInfo = JSON.stringify(qrcodeInfo.value)
// 使mapdomainName
let processedInfo = info.map(item => QNDomain + item); gotoQrcode(activityAttendInfo.value).then(e => {
console.log("processedInfo", processedInfo); proxy.$modal.msgSuccess("签到成功!");
// 使join使 //
return processedInfo; checkStatus(actiInfoList.value.id);
} })
return null; //
} }
const toqrcode = (e) => { const toqrcode = (e) => {
qrcodeInfo.value = JSON.parse(e.result) qrcodeInfo.value = JSON.parse(e.result);
if (actiInfoList.value.id !== qrcodeInfo.value.id) {
proxy.$modal.msgError('二维码不匹配!')
return;
} else {
open.value = !open.value;
console.log("信息:", qrcodeInfo.value); console.log("信息:", qrcodeInfo.value);
} }
//
function confirm() {
open.value = !open.value
}
//
function cancel() {
open.value = !open.value
}
};
</script> </script>
<style lang="scss"> <style lang="scss">
.navbarcenter { .navbarcenter {
@ -202,6 +287,32 @@ function cancel() {
color: #00CCBE !important; color: #00CCBE !important;
} }
} }
.state2 {
width: 686rpx;
height: 80rpx;
margin: 0 auto;
.btnText {
font-weight: 400;
width: 120rpx;
font-size: 30rpx;
color: #FFABAB !important;
}
}
.state3 {
width: 686rpx;
height: 80rpx;
margin: 0 auto;
.btnText {
font-weight: 400;
width: 120rpx;
font-size: 30rpx;
color: #7E7E7E !important;
}
}
} }
.infox { .infox {
@ -225,6 +336,10 @@ function cancel() {
background-color: white; background-color: white;
/* 背景色设置为白色,防止透明背景导致内容重叠可见 */ /* 背景色设置为白色,防止透明背景导致内容重叠可见 */
z-index: 10; z-index: 10;
.infoavatar {
display: flex;
}
} }
.infox2 { .infox2 {
@ -242,4 +357,12 @@ function cancel() {
z-index: 10002; z-index: 10002;
/* 确保在最上层 */ /* 确保在最上层 */
} }
.acContentstyle {
color: #000000 !important;
font-weight: 400;
font-size: 24rpx;
text-align: left;
line-height: 46rpx;
}
</style> </style>

View File

@ -1,61 +1,68 @@
<template> <template>
<view> <view>
<!-- 顶部导航栏 --> <!-- 顶部导航栏 -->
<up-navbar leftText="" title="" :placeholder="true" :safeAreaInsetTop="true" @leftClick="leftClick" <up-navbar leftText="" title="" :placeholder="true" :safeAreaInsetTop="true" @leftClick="leftClick"
:bgColor="bgColor"> :bgColor="bgColor">
<template #center> <template #center>
<div class="navbarcenter"><span>发布活动</span></div> <div class="navbarcenter"><span>发布活动</span></div>
</template> </template>
</up-navbar> </up-navbar>
</view> </view>
<view class="bgc"></view> <view class="bgc"></view>
<up-form :model="form" :rules="rules" ref="uFormRef">
<view class="cardz"> <view class="cardz">
<view class="titleInfo"> <view class="titleInfo">
<up-input placeholder="输入活动标题~5~20个字" v-model="title" border="none" maxlength="20" fontSize="34rpx" <up-form-item label="" prop="acTitle" borderBottom>
color="#C0C0C0" clearable></up-input> <up-input placeholder="输入活动标题~5~20个字" v-model="form.acTitle" border="none" maxlength="20"
fontSize="34rpx" color="#C0C0C0" clearable></up-input>
</up-form-item>
<view class="xian"></view> <view class="xian"></view>
</view> </view>
<view class="contentInfo"> <view class="contentInfo">
<up-textarea v-model="content" placeholder=" <up-form-item label="" prop="acContent" borderBottom>
<up-textarea v-model="form.acContent" placeholder="
活动图片最多可发布两张 活动图片最多可发布两张
输入准确定位可以更好提供活动信息奥安全指南请勿发布带有个人信息住址" count border="none" height="270" maxlength="500" 输入准确定位可以更好提供活动信息奥安全指南请勿发布带有个人信息住址" count border="none" height="270" maxlength="500"
placeholderStyle="color: #c0c0c0;font-size: 30rpx; background:none;"></up-textarea> placeholderStyle="color: #c0c0c0;font-size: 30rpx; background:none;"></up-textarea>
</up-form-item>
</view> </view>
<up-form-item label="" prop="file" borderBottom>
<view class="cardzfile"> <view class="cardzfile">
<fileUpload v-model="fileList1" :fileTypeInfo="fileTypeInfo1" :limit="2"></fileUpload> <fileUpload v-model="form.file" :fileTypeInfo="fileTypeInfo1" :limit="2"></fileUpload>
</view> </view>
</up-form-item>
</view> </view>
<view class="cardx"> <view class="cardx">
<up-cell-group :border="false"> <up-cell-group :border="false">
<up-cell :isLink="true" :center="true" @click="startTime"> <up-form-item label="" prop="startTime" borderBottom @click="showStartTime =! showStartTime">
<template #title style="margin-top: 2rpx;width: 100%;height: 30rpx;display: flex;align-items: center;"> <view style="margin-top: 2rpx;width: 100%;height: 30rpx;display: flex;align-items: center;">
<image v-if="showtext1" :src="tu52" style="width: 30rpx; height: 32rpx;"></image> <image v-if="showtext1" :src="tu52" style="width: 30rpx; height: 32rpx; margin-right: 12rpx;"></image>
<image v-else :src="tu522" style="width: 30rpx; height: 32rpx;"></image> <image v-else :src="tu522" style="width: 30rpx; height: 32rpx; margin-right: 12rpx;"></image>
<span v-if="showtext1" >请选择活动开始时间</span> <up-input v-model="form.startTime" disabled disabledColor="#ffffff" color="#C9F6F5"
<span v-else class="text2">{{parseTime(StartTime, '{y}-{m}-{d} {h}:{i}:{s}')}}</span> placeholder="请选择活动开始时间" placeholderStyle="color: #333333 !important;font-size: 30rpx;"
<up-datetime-picker :show="showStartTime" v-model="newData" border="none">
:modelValue="newData" <span v-if="showtext2"></span>
@confirm="confirm1" </up-input>
@cancel="cancel" <up-icon slot="right" name="arrow-right"></up-icon>
mode="datetime"></up-datetime-picker> </view>
</template> </up-form-item>
</up-cell> <up-form-item label="" prop="endTime" borderBottom @click="showEndTime = !showEndTime">
<up-cell :isLink="true" :center="true" @click="showEndTime =!showEndTime "> <view style="margin-top: 2rpx;width: 100%;height: 30rpx;display: flex;align-items: center;">
<template #title style="margin-top: 2rpx;width: 100%;height: 30rpx;display: flex;align-items: center;"> <image v-if="showtext2" :src="tu53" style="width: 30rpx; height: 32rpx;margin-right: 12rpx;"></image>
<image v-if="showtext2" :src="tu53" style="width: 30rpx; height: 32rpx;"></image> <image v-else :src="tu532" style="width: 30rpx; height: 32rpx; margin-right: 12rpx;"></image>
<image v-else :src="tu532" style="width: 30rpx; height: 32rpx;"></image> <up-input v-model="form.endTime" disabled disabledColor="#ffffff" color="#C9F6F5"
placeholder="请选择活动结束时间" placeholderStyle="color: #333333 !important;font-size: 30rpx;"
border="none">
<span v-if="showtext2"></span> <span v-if="showtext2"></span>
<span v-else class="text2"> {{parseTime(EndTime, '{y}-{m}-{d} {h}:{i}:{s}')}}</span> </up-input>
<up-datetime-picker :show="showEndTime" v-model="newData" @confirm="confirm2" <up-icon slot="right" name="arrow-right"></up-icon>
:modelValue="newData" </view>
@cancel="cancel" </up-form-item>
mode="datetime"></up-datetime-picker>
</template>
</up-cell>
<up-cell :border="false" :isLink="true" :center="true"> <up-cell :border="false" :isLink="true" :center="true">
<template #title style="margin-top: 2rpx;width: 100%;height: 30rpx;display: flex;align-items: center;"> <template #title
style="margin-top: 2rpx;width: 100%;height: 30rpx;display: flex;align-items: center;">
<image v-if="showtext3" :src="tu51" style="width: 30rpx; height: 32rpx;"></image> <image v-if="showtext3" :src="tu51" style="width: 30rpx; height: 32rpx;"></image>
<image v-else :src="tu512" style="width: 30rpx; height: 32rpx;"></image> <image v-else :src="tu512" style="width: 30rpx; height: 32rpx;"></image>
<span>添加活动具体位置</span> <span>添加活动具体位置</span>
@ -63,20 +70,25 @@
</up-cell> </up-cell>
</up-cell-group> </up-cell-group>
</view> </view>
<up-datetime-picker :show="showStartTime" v-model="newData" :modelValue="newData" @confirm="confirm1" format="YYYY-MM-DD HH:mm:ss"
@cancel="cancel" mode="datetime"></up-datetime-picker>
<up-datetime-picker :show="showEndTime" v-model="newData" @confirm="confirm2" :modelValue="newData" format="YYYY-MM-DD HH:mm:ss"
@cancel="cancel" mode="datetime"></up-datetime-picker>
<view class="cardxx"> <view class="cardxx">
<up-button color="#C9F6F5" size="large" shape="circle" @click="publish"><span <up-button color="#C9F6F5" size="large" shape="circle" @click="publish" throttleTime="500"><span
class="fbText">发布</span></up-button> class="fbText">发布</span></up-button>
<view style="width: 26rpx;height: 80rpx;"></view> <view style="width: 26rpx;height: 80rpx;"></view>
<up-button color="#F8F8E3" size="large" shape="circle" @click="draft" style="margin-left: 26rpx;"><span <up-button color="#F8F8E3" size="large" shape="circle" @click="draft" style="margin-left: 26rpx;"><span
class="cgText">存草稿</span></up-button> class="cgText">存草稿</span></up-button>
</view> </view>
</up-form>
</template> </template>
<script setup> <script setup>
import { listInfo, getInfo, delInfo, addInfo, updateInfo } from "@/api/activityInfo/info";
import fileUpload from '../common/file/fileUpload' import fileUpload from '../common/file/fileUpload'
import { onShow, onLoad } from '@dcloudio/uni-app' import { onShow, onLoad } from '@dcloudio/uni-app'
import { ref, reactive, getCurrentInstance,computed } from 'vue' import { ref, reactive, getCurrentInstance, computed, toRefs } from 'vue'
import { useStore } from 'vuex'; import { useStore } from 'vuex';
const { proxy } = getCurrentInstance(); const { proxy } = getCurrentInstance();
const iconConfig = proxy.iconConfig; const iconConfig = proxy.iconConfig;
@ -88,56 +100,137 @@ const tu53 = iconConfig.tu53;
const tu532 = iconConfig.tu532; const tu532 = iconConfig.tu532;
const title = ref('') const title = ref('')
const content = ref(''); const content = ref('');
const data = reactive({
form: {
acTitle: '',
acContent: '',
startTime: null,
endTime: null,
file: null,
state: null,
},
rules: {
acTitle: [
{ required: true, message: '请输入活动标题', trigger: 'blur' },
{ min: 5, max: 20, message: '标题长度在 5 到 20 个字符', trigger: 'blur' }
],
acContent: [
{ required: true, message: '请输入活动内容', trigger: 'blur' },
{ max: 500, message: '内容不能超过 500 字', trigger: 'blur' }
],
startTime: [
{ required: true, message: '请选择活动开始时间', trigger: 'change' }
],
endTime: [
{ required: true, message: '请选择活动结束时间', trigger: 'change' },
{ validator: (rule, value, callback) => {
console.log(form.value.startTime," ",value," ",value <= form.value.startTime)
if (value <= form.value.startTime) {
callback( proxy.$modal.msgError('时间选择错误') );
} else {
callback();
}
}, trigger: 'change' }
]
}
});
const { form, rules } = toRefs(data);
const fileList1 = ref([]) const fileList1 = ref([])
const fileTypeInfo1 = ref('image') const fileTypeInfo1 = ref('image')
const bgColor = ref(''); const bgColor = ref('');
bgColor.value = 'rgba(170, 0, 0, 0)' bgColor.value = 'rgba(170, 0, 0, 0)'
const showStartTime = ref(false); const showStartTime = ref(false);
const showEndTime = ref(false); const showEndTime = ref(false);
const StartTime = ref('请选择活动开始时间') const StartTime = ref('请选择活动开始时间');
const showtext1 = ref(true) const showtext1 = ref(true);
const showtext2 = ref(true) const showtext2 = ref(true);
const showtext3 = ref(true) const showtext3 = ref(true);
const EndTime = ref('请选择活动结束时间') const EndTime = ref('请选择活动结束时间');
const newData = ref(new Date().getTime()) const newData = ref(new Date().getTime());
const timeFormat = uni.$u.timeFormat;
//
const uFormRef = ref(null);
onLoad((options) => { onLoad((options) => {
console.log("页面参数:", options.id); console.log("页面参数:", options.id);
}) })
const leftClick = () => { const leftClick = () => {
proxy.$tab.navigateBack(1) proxy.$tab.navigateBack(1)
} }
const draft = () => { const draft = () => {
form.value.auditStatus = "5"
submitForm('draft');
console.log("存草稿"); console.log("存草稿");
} }
const publish = () => { const publish = () => {
form.value.auditStatus = "1"
submitForm('publish');
console.log("发布"); console.log("发布");
} }
const submitForm = (type) => {
if (uFormRef.value) {
uFormRef.value.validate().then(valid => {
if (valid) {
console.log('表单验证通过:', form.value);
proxy.$modal.loading('正在提交数据,请稍候...');
//
if (type === 'publish') {
console.log("调用发布接口", form.value);
//
addInfo(form.value).then(response => {
proxy.$modal.closeLoading();
proxy.$modal.msgSuccess("发布成功");
proxy.$tab.navigateTo('/pages/common/talkState/publish')
});
} else {
// 稿
addInfo(form.value).then(response => {
proxy.$modal.closeLoading();
proxy.$modal.msgSuccess("存草稿成功");
});
}
} else {
console.log('表单验证失败');
}
}).catch(error => {
console.log('表单验证错误:', error);
});
} else {
console.log('表单引用未定义');
}
}
const startTime = (e) => { const startTime = (e) => {
showStartTime.value = !showStartTime.value showStartTime.value = !showStartTime.value
} }
const confirm1 = (e) => { const confirm1 = (e) => {
console.log(e); console.log(e);
showtext1.value = false; showtext1.value = false;
StartTime.value = e.value StartTime.value = e.value
showStartTime.value = false form.value.startTime = timeFormat(e.value,'yyyy-mm-dd hh:MM:ss');
showStartTime.value = !showStartTime.value
} }
const confirm2 = (e) => { const confirm2 = (e) => {
console.log(e); console.log(e);
showtext2.value = false; showtext2.value = false;
EndTime.value = e.value EndTime.value = e.value
showEndTime.value = false form.value.endTime = timeFormat(e.value,'yyyy-mm-dd hh:MM:ss');
showEndTime.value = !showEndTime.value
} }
const cancel = (e) => { const cancel = (e) => {
showStartTime.value = false showStartTime.value = false;
showEndTime.value = false showEndTime.value = false;
} }
</script> </script>
<style lang="scss"> <style lang="scss">
.navbarcenter { .navbarcenter {
font-weight: 400; font-weight: 400;
font-size: 36rpx; font-size: 36rpx;
text-align: left; text-align: left;
color: #000000; color: #000000;
@ -190,9 +283,6 @@ const cancel = (e) => {
display: flex; display: flex;
align-items: center; align-items: center;
} }
} }
.cardxx { .cardxx {
@ -207,16 +297,13 @@ const cancel = (e) => {
color: #FBFBFB !important; color: #FBFBFB !important;
} }
.cgText { .cgText {
font-weight: 400; font-weight: 400;
font-size: 30rpx; font-size: 30rpx;
color: #999999 !important; color: #999999 !important;
} }
} }
.text2 { .text2 {
margin-left: 12rpx; margin-left: 12rpx;
font-weight: 400; font-weight: 400;

View File

View File

@ -104,7 +104,7 @@ const afterRead = async (event) => {
url: store.state.user.QNDomain + result, url: store.state.user.QNDomain + result,
furl: result furl: result
}); });
emit("update:modelValue", fileList1.value); emit("update:modelValue", listToString(fileList1.value));
fileListLen++; fileListLen++;
} catch (error) { } catch (error) {
console.error("上传失败:", error); console.error("上传失败:", error);
@ -219,7 +219,7 @@ const typeInfo = () => {
separator = separator || ","; separator = separator || ",";
for (let i in list) { for (let i in list) {
if (list[i].url) { if (list[i].url) {
strs += list[i].url + separator; strs += list[i].furl + separator;
} }
} }
return strs != '' ? strs.substr(0, strs.length - 1) : ''; return strs != '' ? strs.substr(0, strs.length - 1) : '';

View File

@ -1,6 +1,6 @@
<template> <template>
<!-- 话题 --> <!-- 话题 -->
<view class="center-content-post"> <view class="center-content-post" @click="toPostInfoView()">
<view class="center-content-post-padding"> <view class="center-content-post-padding">
<view class="center-content-post-head"> <view class="center-content-post-head">
<!-- 左对齐 --> <!-- 左对齐 -->
@ -18,8 +18,8 @@
</view> </view>
<!-- 右对齐 --> <!-- 右对齐 -->
<view class="flex alignCenter" v-if="postViewIndex != 0"> <view class="flex alignCenter" v-if="postViewIndex != 0">
<text class="no-focus-text" v-if="postValue.isFocus" @click="addFocus(index)"></text> <text class="no-focus-text" v-if="postValue.isFocus" @click.stop="addFocus(index)"></text>
<text class="focus-text" v-else @click="cancelFocus()"></text> <text class="focus-text" v-else @click.stop="cancelFocus()">已关</text>
</view> </view>
</view> </view>
<text class="center-content-post-title" v-if="postValue.title">{{postValue.title}}</text> <text class="center-content-post-title" v-if="postValue.title">{{postValue.title}}</text>
@ -29,7 +29,7 @@
<!--一张图片--> <!--一张图片-->
<block v-if="postValue.media.length == 1"> <block v-if="postValue.media.length == 1">
<image :lazy-load="true" mode="aspectFill" class="img-style-1" :src="postValue.media[0]" <image :lazy-load="true" mode="aspectFill" class="img-style-1" :src="postValue.media[0]"
@tap="previewImage(postValue.media[0], postValue.media)"></image> @tap.stop="previewImage(postValue.media[0], postValue.media)"></image>
</block> </block>
<!--二张图片--> <!--二张图片-->
<block v-if="postValue.media.length == 2"> <block v-if="postValue.media.length == 2">
@ -62,7 +62,7 @@
<view class="flex alignCenter"> <view class="flex alignCenter">
<view v-if="postValue.isLike" class="p-item" @click.stop="cancelCollection()"> <view v-if="postValue.isLike" class="p-item" @click.stop="cancelCollection()">
<image style="width: 40rpx; height: 40rpx;" src="../static/images/icon/tu3-8.png" mode=""></image> <image style="width: 40rpx; height: 40rpx;" src="../static/images/icon/tu3-8.png" mode=""></image>
<text class="count">{{ postValue.likeCount }}</text> <text class="count-like">{{ postValue.likeCount }}</text>
</view> </view>
<!-- 靠右对齐 --> <!-- 靠右对齐 -->
@ -80,7 +80,7 @@
<!-- 靠右对齐 --> <!-- 靠右对齐 -->
<view class="p-item margin50" v-if="postValue.ifFavorite" @click.stop="cancelFavorite()"> <view class="p-item margin50" v-if="postValue.ifFavorite" @click.stop="cancelFavorite()">
<image style="width: 40rpx; height: 40rpx;" src="../static/images/icon/tu3-2.png" mode=""></image> <image style="width: 40rpx; height: 40rpx;" src="../static/images/icon/tu3-2.png" mode=""></image>
<text class="count">{{ postValue.favoriteCount }}</text> <text class="count-favorite">{{ postValue.favoriteCount }}</text>
</view> </view>
<!-- 靠右对齐 --> <!-- 靠右对齐 -->
@ -91,7 +91,6 @@
</view> </view>
</view> </view>
</view> </view>
<u-line></u-line>
</view> </view>
</template> </template>
@ -128,6 +127,13 @@
// favoriteCount: 136 // favoriteCount: 136
// } // }
// ); // );
const { proxy } = getCurrentInstance();
const toPostInfoView = () => {
if(props.postViewType == 1) {
return;
}
proxy.$tab.navigateTo('/pages/post/postInfo/postInfo')
}
const previewImage = (url, urls) => { const previewImage = (url, urls) => {
uni.previewImage({ uni.previewImage({
@ -170,7 +176,7 @@
.center-content-post { .center-content-post {
} }
.center-content-post-padding { .center-content-post-padding {
padding: 46rpx 32rpx; padding: 46rpx 32rpx 28rpx 32rpx;
} }
.center-content-post-head { .center-content-post-head {
display: flex; display: flex;
@ -238,7 +244,7 @@
font-weight: 400; font-weight: 400;
/* width: 670rpx; */ /* width: 670rpx; */
// height: 80rpx; // height: 80rpx;
font-size: 32rpx; font-size: 30rpx;
text-align: left; text-align: left;
color: #333333; color: #333333;
margin-top: 18rpx; margin-top: 18rpx;
@ -253,7 +259,7 @@
font-weight: 400; font-weight: 400;
/* width: 670rpx; */ /* width: 670rpx; */
// height: 80rpx; // height: 80rpx;
font-size: 32rpx; font-size: 30rpx;
text-align: left; text-align: left;
color: #333333; color: #333333;
margin-top: 18rpx; margin-top: 18rpx;
@ -278,11 +284,12 @@
.center-content-post-tab{ .center-content-post-tab{
margin-top: 20rpx; margin-top: 20rpx;
margin-bottom: 20rpx; // margin-bottom: 20rpx;
} }
.post-list-bottom { .post-list-bottom {
margin-top: 20rpx;
display: flex; display: flex;
justify-content: center; /* 水平居中 */ justify-content: center; /* 水平居中 */
} }
@ -326,6 +333,30 @@
margin-left: 10rpx; margin-left: 10rpx;
} }
.count-like{
font-weight: 400;
width: 48rpx;
/* height: 23rpx; */
font-size: 28rpx;
text-align: left;
color: #FA3939;
margin-left: 10rpx;
}
.count-favorite{
font-weight: 400;
width: 48rpx;
/* height: 23rpx; */
font-size: 28rpx;
text-align: left;
color: #FFC729;
margin-left: 10rpx;
}
.avatar-container {
position: relative;
}
.avatar-1 { .avatar-1 {
position: relative; position: relative;
} }

View File

@ -39,7 +39,10 @@ const bgColor = ref('');
bgColor.value = 'rgba(170, 0, 0, 0)' bgColor.value = 'rgba(170, 0, 0, 0)'
const leftClick = () => { const leftClick = () => {
proxy.$tab.navigateBack(1) proxy.$tab.switchTab("/pages/index")
}
const publish = () => {
proxy.$tab.switchTab("/pages/index")
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>

View File

@ -65,6 +65,7 @@
<view class="" v-for="(postItem, postIndex) in postList" :key="postIndex"> <view class="" v-for="(postItem, postIndex) in postList" :key="postIndex">
<PostView :postValue="postItem" :postViewIndex="viewIndex" :postViewType="0"></PostView> <PostView :postValue="postItem" :postViewIndex="viewIndex" :postViewType="0"></PostView>
<u-line></u-line>
</view> </view>
</view> </view>
@ -245,7 +246,10 @@ import PostView from "@/pages/common/postview/index.vue";
]); ]);
const publishTalk = (item) => { const publishTalk = (item) => {
console.log() if(item.id === 1){
//todo
proxy.$tab.navigateTo('/pages/post/postPublish/postPublish')
}
if(item.id === 2){ if(item.id === 2){
//todo //todo
proxy.$tab.navigateTo('/pages/activity/publish') proxy.$tab.navigateTo('/pages/activity/publish')
@ -530,22 +534,6 @@ import PostView from "@/pages/common/postview/index.vue";
border-color: #91b4ff; border-color: #91b4ff;
} }
.avatar-container {
position: relative;
}
.avatar-1 {
position: relative;
}
.official-1 {
position: absolute;
width: 32rpx;
height: 32rpx;
bottom: 0;
right: 0;
}
.image-container { .image-container {
display: inline-block; display: inline-block;
position: relative; /* 设置父元素为相对定位 */ position: relative; /* 设置父元素为相对定位 */

View File

@ -0,0 +1,512 @@
<template>
<view>
<PostView :postValue="postValue" :postViewIndex="1" :postViewType="1"></PostView>
<view class="center-content-focus-line"></view>
<view class="comment">
<view class="flex justifyBetween alignCenter commentTop">
<text class="commentLabel">全部评论</text>
<text class="report">举报</text>
</view>
<view v-if="!postList" class="no-comment">
<image class="no-comment-img" src="../../../static/images/icon/no_comment.png" mode=""></image>
<text class="no-comment-text">暂无评论快去做评论第一人吧</text>
<view class="no-comment-bt">
<text class="no-comment-bt-text">快去抢沙发</text>
</view>
</view>
<view v-else class="have-comment" v-for="(item, index) in postList" :key="index">
<view class="flex alignCenter">
<!-- 头像 -->
<view class="have-comment-avatar-container">
<u-avatar class="have-comment-avatar-1" size="60rpx" :src="item.avatar"></u-avatar>
<image v-if="item.isOfficial" class="have-comment-official-1" src="../../../static/images/icon/tu3-6.png"></image>
</view>
<view class="flex flexColumn">
<text class="have-comment-uname">{{item.uname}}</text>
<text class="have-comment-address">{{item.address}}</text>
</view>
</view>
<view class="have-comment-content">
<text class="have-comment-content-text-1">{{item.content}}</text>
<view class="have-comment-content-text-2">
<text>{{item.createTime}}</text>
<text class="have-comment-content-text-2-hf" @click="toAnswer(item.uname)"></text>
</view>
</view>
<view class="" v-if="item.answerCommentList.length != 0">
<text v-if="!item.isDeployment" class="deploymentAnswer-text" @click="deploymentAnswer(index)">---</text>
<view v-if="item.isDeployment" class="have-comment-answer" v-for="answer in item.answerCommentList" :key="answer">
<view class="flex alignCenter">
<!-- 头像 -->
<view class="have-comment-answer-avatar-container">
<u-avatar class="have-comment-answer-avatar-1" size="48rpx" :src="answer.avatar"></u-avatar>
<image v-if="answer.isOfficial" class="have-comment-answer-official-1" src="../../../static/images/icon/tu3-6.png"></image>
</view>
<text class="have-comment-answer-uname">{{answer.uname}}</text>
<text v-if="answer.toUserName" class="have-comment-answer-uname">-></text>
<text v-if="answer.toUserName" class="have-comment-answer-uname">{{answer.toUserName}}</text>
</view>
<view class="have-comment-answer-content">
<text class="have-comment-answer-content-text-1">{{answer.content}}</text>
<view class="have-comment-answer-content-text-2">
<text>{{answer.createTime}}</text>
<text class="have-comment-answer-content-text-2-hf" @click="toAnswer(answer.uname)"></text>
</view>
</view>
</view>
<text v-if="item.isDeployment" class="deploymentAnswer-text" @click="putAnswer(index)">---</text>
</view>
</view>
</view>
</view>
<!-- 评论区输入框 -->
<up-popup :show="showInput" duration="0" @close="close" @open="open" class="comment-po">
<view class="flex justifyBetween comment-input" :style="{ paddingBottom: bottomVal + 'px' }">
<view class="input-in flex alignCenter justifyCenter">
<input class="input-in-text" v-if="showInputText" focus="true" maxlength="55" :placeholder="placeholderInput" :adjust-position="false" />
</view>
<view class="input-bt flex alignCenter justifyCenter">
<text class="input-bt-text">发送</text>
</view>
</view>
</up-popup>
<!-- 底部操作栏 -->
<up-tabbar
:fixed="true"
:placeholder="true"
:safeAreaInsetBottom="true"
>
<!-- <view class="flex justifyCenter"> -->
<view class="flex alignCenter justifyCenter">
<view class="flex justifyCenter alignCenter commentInput" @click="toInput()">
<image class="commentInput-img" src="../../../static/logo.png" mode=""></image>
<text class="commentInput-text">友好评论~</text>
</view>
</view>
<view v-if="postValue.isLike" @click.stop="cancelCollection()" class="flex alignCenter justifyCenter flexColumn">
<image class="commentInput-img" src="../../../static/images/icon/tu3-8.png" mode=""></image>
<text class="commentInput-txt-like">{{postValue.likeCount}}</text>
</view>
<view v-if="!postValue.isLike" @click.stop="addCollection()" class="flex alignCenter justifyCenter flexColumn">
<image class="commentInput-img" src="../../../static/images/icon/tu3-7.png" mode=""></image>
<text class="commentInput-txt">{{postValue.likeCount}}</text>
</view>
<view v-if="postValue.ifFavorite" @click.stop="cancelFavorite()" class="flex alignCenter justifyCenter flexColumn">
<image class="commentInput-img" src="../../../static/images/icon/tu3-2.png" mode=""></image>
<text class="commentInput-txt-favorite">{{postValue.favoriteCount}}</text>
</view>
<view v-if="!postValue.ifFavorite" @click.stop="addFavorite()" class="flex alignCenter justifyCenter flexColumn">
<image class="commentInput-img" src="../../../static/images/icon/tu3-1.png" mode=""></image>
<text class="commentInput-txt">{{postValue.favoriteCount}}</text>
</view>
<view class="flex alignCenter justifyCenter flexColumn">
<image class="commentInput-img" src="../../../static/images/icon/tu2-9.png" mode=""></image>
<text class="commentInput-txt">转发</text>
</view>
<!-- </view> -->
</up-tabbar>
</template>
<script setup>
import { ref, reactive, computed, onMounted, getCurrentInstance } from 'vue';
import PostView from "@/pages/common/postview/index.vue";
const bottomVal = ref(0);
//
uni.onKeyboardHeightChange(res => {
if(res.height == 0) {
bottomVal.value = 0;
return;
}
bottomVal.value = res.height - 20;
console.log(bottomVal.value)
});
const postList = reactive([{
avatar: 'https://k.sinaimg.cn/n/sports/transform/400/w600h600/20220130/dd38-eed53ba750d1d8c87eca8b57eda879a5.jpg/w700d1q75cms.jpg?by=cms_fixed_width',
uname: '爱吃饭的小张',
address: '南开大学',
content: '大家来评论',
createTime: '7分钟前',
isOfficial: true,
isDeployment: false,
answerCommentList: [{
avatar: 'https://picx.zhimg.com/v2-02f89d05a781ffed9fd2e32654d93135_720w.jpg?source=172ae18b',
uname: '恋爱60秒',
createTime: '2024.05.04',
isOfficial: false,
address: '理工大学',
content: '来了',
},
{
avatar: 'https://oss.1381801.com/forum/202308/11/093616ccxkx99wchwrrw1a.jpg',
uname: '喜欢你没道理',
createTime: '2024.05.04',
isOfficial: false,
address: '理工大学',
content: '你干嘛~',
toUserName: '恋爱60秒',
},
]
},
{
avatar: 'https://picx.zhimg.com/v2-02f89d05a781ffed9fd2e32654d93135_720w.jpg?source=172ae18b',
uname: '恋爱60秒',
createTime: '2024.05.04',
isOfficial: false,
isDeployment: false,
address: '理工大学',
content: '评论区上线了',
answerCommentList: []
}]);
const postValue = reactive(
{
avatar: 'https://k.sinaimg.cn/n/sports/transform/400/w600h600/20220130/dd38-eed53ba750d1d8c87eca8b57eda879a5.jpg/w700d1q75cms.jpg?by=cms_fixed_width',
uname: '爱吃饭的小张',
createTime: '11分钟前',
address: '南开大学',
isFocus: false,
isOfficial: true,
title: '怎么评论爱德华·艾尔加这位音乐家及其他的作品,欢迎大家发表自己的看法?',
content: '八年前,学弟在工地上杀了一个工友,上杀了一个工友,杀人前,他给警察打了电话,预告杀人的时间和地点,和地点,并......',
type: '1',
media: [
'https://tu.sioe.cn/gj/qiege/image.jpg',
'https://picx.zhimg.com/v2-3b4fc7e3a1195a081d0259246c38debc_720w.jpg?source=172ae18b',
'https://bpic.51yuansu.com/backgd/cover/00/63/09/64b52b1426fff_800.jpg?x-oss-process=image/resize,w_780/sharpen,100',
'https://tu.sioe.cn/gj/qiege/image.jpg',
],
tab: ['学术讨论组', '校园风景'],
transmitCount: 136,
isLike: true,
likeCount: 999,
commentCount: 136,
ifFavorite: true,
favoriteCount: 136
}
);
const placeholderInput = ref('')
//
const showInput = ref(false);
const showInputText = ref(false)
//
function open() {
// show true
showInput.value = true;
setTimeout(() => {
showInputText.value = true;
}, 50);
// console.log('open');
}
function close() {
// show false
showInput.value = false;
showInputText.value = false;
// console.log('close');
}
const toInput = () => {
placeholderInput.value = '发布评论'
open();
}
const toAnswer = (toUser) => {
placeholderInput.value = '回复:' + toUser;
open();
}
const cancelCollection = () => {
postValue.likeCount -= 1;
postValue.isLike = !postValue.isLike;
};
const addCollection = () => {
postValue.likeCount += 1;
postValue.isLike = !postValue.isLike;
};
const cancelFavorite = () => {
postValue.favoriteCount -= 1;
postValue.ifFavorite = !postValue.ifFavorite;
};
const addFavorite = () => {
postValue.favoriteCount += 1;
postValue.ifFavorite = !postValue.ifFavorite;
};
const deploymentAnswer = (index) => {
postList[index].isDeployment = true;
};
const putAnswer = (index) => {
postList[index].isDeployment = false;
};
</script>
<style lang="scss">
.data-v-6fcabaad {
border-radius: 20rpx 20rpx 20rpx 20rpx !important;
/* width: 200rpx !important;
height: 200rpx !important; */
}
.center-content-focus-line{
height: 8rpx;
background: #f4f5f6;
}
.comment{
padding: 32rpx;
}
.commentLabel{
font-weight: 400;
/* width: 265rpx; */
/* height: 38rpx; */
font-size: 36rpx;
/* text-align: left; */
color: #000000;
}
.report{
font-weight: 400;
/* width: 52rpx; */
/* height: 26rpx; */
font-size: 26rpx;
/* text-align: left; */
color: #999999;
}
.no-comment {
display: flex;
flex-direction: column;
align-items: center; /* 水平居中 */
justify-content: center; /* 垂直居中 */
}
.no-comment-img{
margin-top: 44rpx;
width: 200rpx;
height: 145rpx;
}
.no-comment-text{
margin-top: 8rpx;
font-weight: 400;
font-size: 26rpx;
color: #999999;
}
.no-comment-bt{
margin-top: 36rpx;
width: 308rpx;
height: 82rpx;
border-radius: 40rpx 40rpx 40rpx 40rpx;
border-width: 2rpx;
border-color: #C9F6F5;
background: #ffffff;
display: flex;
align-items: center; /* 垂直居中 */
justify-content: center; /* 水平居中 */
}
.no-comment-bt-text{
font-weight: 400;
font-size: 32rpx;
color: #CBF6F5;
}
.commentInput{
width: 364rpx;
height: 80rpx;
border-radius: 40rpx 40rpx 40rpx 40rpx;
background: #f7f8fa;
}
.commentInput-img{
width: 40rpx;
height: 40rpx;
}
.commentInput-text{
font-weight: 400;
font-size: 30rpx;
color: #999999;
}
.commentInput-txt{
font-weight: 400;
font-size: 28rpx;
color: #787878;
}
.commentInput-txt-like{
font-weight: 400;
font-size: 28rpx;
color: #FA3939;
}
.commentInput-txt-favorite{
font-weight: 400;
font-size: 28rpx;
color: #FFC729;
}
.have-comment{
margin-top: 30rpx;
}
.have-comment-avatar-container {
position: relative;
width: 60rpx;
margin-right: 20rpx;
}
.have-comment-avatar-1 {
position: relative;
}
.have-comment-official-1 {
position: absolute;
width: 24rpx;
height: 24rpx;
bottom: 0;
right: 0;
}
.have-comment-uname{
font-weight: 400;
font-size: 26rpx;
color: #999999;
}
.have-comment-address{
font-weight: 400;
font-size: 24rpx;
color: #999999;
}
.have-comment-content{
margin-left: 80rpx;
margin-top: 10rpx;
}
.have-comment-content-text-1 {
font-weight: 400;
font-size: 30rpx;
color: #333333;
}
.have-comment-content-text-2 {
font-weight: 400;
font-size: 24rpx;
color: #999999;
margin-top: 12rpx;
}
.have-comment-content-text-2-hf {
margin-left: 32rpx;
}
.have-comment-answer{
margin-top: 24rpx;
margin-left: 80rpx;
}
.have-comment-answer-avatar-container {
position: relative;
width: 48rpx;
margin-right: 20rpx;
}
.have-comment-answer-avatar-1 {
position: relative;
}
.have-comment-answer-official-1 {
position: absolute;
width: 16rpx;
height: 16rpx;
bottom: 0;
right: 0;
}
.have-comment-answer-uname{
font-weight: 400;
font-size: 26rpx;
color: #999999;
}
.have-comment-answer-content{
margin-left: 80rpx;
margin-top: 10rpx;
}
.have-comment-answer-content-text-1 {
font-weight: 400;
font-size: 30rpx;
color: #333333;
}
.have-comment-answer-content-text-2 {
font-weight: 400;
font-size: 24rpx;
color: #999999;
margin-top: 12rpx;
}
.have-comment-answer-content-text-2-hf {
margin-left: 32rpx;
}
.deploymentAnswer-text{
margin-left: 80rpx;
font-weight: 400;
font-size: 24rpx;
color: #999999;
}
.input-in{
width: 560rpx;
height: 70rpx;
border-radius: 37rpx 37rpx 37rpx 37rpx;
background: #f7f8fa;
}
.input-in-text{
width: 520rpx;
}
.input-bt{
width: 120rpx;
height: 74rpx;
border-radius: 37rpx 37rpx 37rpx 37rpx;
background: #3477fc;
}
.input-text{
font-weight: 400;
font-size: 30rpx;
color: #FFFFFF;
}
.comment-input{
padding: 24rpx;
// margin-bottom: 800rpx;
}
.comment-po{
// height: 500rpx;
}
</style>

View File

@ -0,0 +1,172 @@
<template>
<view>
<!-- 顶部导航栏 -->
<!-- <up-navbar leftText="" title="" :placeholder="true" :safeAreaInsetTop="true" @leftClick="leftClick"
:bgColor="bgColor">
<template #center>
<div class="navbarcenter"><span>发布活动</span></div>
</template>
</up-navbar> -->
</view>
<view class="bgc"></view>
<view class="cardz">
<view class="titleInfo">
<up-input placeholder="输入标题会更受欢迎奥~5~20个字" v-model="title" border="none" maxlength="20" fontSize="34rpx"
color="#C0C0C0" clearable></up-input>
<view class="xian"></view>
</view>
<view class="contentInfo">
<up-textarea v-model="content" placeholder="输入你想发布的内容吧 图片精美、有看点的内容更容易获得推荐最多发布8张照片 安全指南:请勿发布带有个人信息(如:住址)" count border="none" height="270" maxlength="200"
placeholderStyle="color: #c0c0c0;font-size: 30rpx; background:none;"></up-textarea>
</view>
<view class="cardzfile">
<fileUpload v-model="fileList1" :fileTypeInfo="fileTypeInfo1"></fileUpload>
</view>
</view>
<view class="cardx">
<up-cell-group :border="false">
<up-cell :isLink="true" :center="true">
<template #title style="margin-top: 2rpx;width: 100%;height: 30rpx;display: flex;align-items: center;">
<image :src="tu52" style="width: 30rpx; height: 32rpx;"></image>
<span>添加话题(最多可添加2条)</span>
</template>
</up-cell>
<!-- <up-cell :isLink="true" :center="true">
<template #title style="margin-top: 2rpx;width: 100%;height: 30rpx;display: flex;align-items: center;">
<image :src="tu53" style="width: 30rpx; height: 32rpx;"></image>
<span>请选择活动结束时间</span>
</template>
</up-cell> -->
<up-cell :border="false" :isLink="true" :center="true">
<template #title style="margin-top: 2rpx;width: 100%;height: 30rpx;display: flex;align-items: center;">
<image :src="tu51" style="width: 30rpx; height: 32rpx;"></image>
<span>添加定位</span>
</template>
</up-cell>
</up-cell-group>
</view>
<view class="cardxx">
<up-button color="#C9F6F5" size="large" shape="circle" @click="publish"><span
class="fbText">发布</span></up-button>
<view style="width: 26rpx;height: 80rpx;"></view>
<up-button color="#F8F8E3" size="large" shape="circle" @click="draft" style="margin-left: 26rpx;"><span
class="cgText">存草稿</span></up-button>
</view>
</template>
<script setup>
import fileUpload from '@/pages/common/file/fileUpload'
import { onShow, onLoad } from '@dcloudio/uni-app'
import { ref, reactive, getCurrentInstance } from 'vue'
import { useStore } from 'vuex';
const { proxy } = getCurrentInstance();
const iconConfig = proxy.iconConfig;
const tu51 = iconConfig.tu51;
const tu52 = iconConfig.tu52;
const tu53 = iconConfig.tu53;
const title = ref('')
const content = ref('');
const fileList1 = ref([])
const fileTypeInfo1 = ref('image')
const bgColor = ref('');
bgColor.value = 'rgba(170, 0, 0, 0)'
onLoad((options) => {
console.log("页面参数:", options.id);
})
const leftClick = () => {
proxy.$tab.navigateBack(1)
}
const draft = () => {
console.log("存草稿");
}
const publish = () => {
console.log("发布");
}
</script>
<style lang="scss" >
.navbarcenter {
font-weight: 400;
font-size: 36rpx;
text-align: left;
color: #000000;
}
.bgc {
width: 100%;
height: 500rpx;
background: linear-gradient(-180deg, #c9f6f5, #ffffff);
position: fixed;
top: 0rpx;
left: 0rpx;
z-index: -1;
}
.cardz {
margin-left: 32rpx;
margin-right: 32rpx;
.titleInfo {
margin-top: 40rpx;
.xian {
margin-top: 32rpx;
height: 2rpx;
border-radius: 1rpx 1rpx 1rpx 1rpx;
background: #ffffff;
}
}
.contentInfo {
margin-top: 46rpx;
}
.cardzfile {
background-color: #FFFFFF;
}
}
.cardx {
background-color: #FFFFFF;
padding-top: 72rpx;
margin-left: 32rpx;
margin-right: 32rpx;
.c1 {
margin-top: 2rpx;
width: 100%;
height: 102rpx;
display: flex;
align-items: center;
}
}
.cardxx {
display: flex;
margin-left: 32rpx;
margin-right: 32rpx;
margin-top: 80rpx;
.fbText {
font-weight: 400;
font-size: 30rpx;
color: #FBFBFB !important;
}
.cgText {
font-weight: 400;
font-size: 30rpx;
color: #999999 !important;
}
}
</style>

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB