Commit 25162e1b authored by Mac's avatar Mac

帖子的内容

parent 61292887
......@@ -567,6 +567,10 @@
"path":"postbar"//贴吧列表
},{
"path":"postPublishing"//贴吧发布
},{
"path":"postDetails"//招募贴详情
},{
"path":"sendimg"//评论图片发布
}]
},
//韩国馆项目 { "root": "pages/kotra", "pages": [{ "path": "contanctus" },{ "path": "contanctDetail" },{ "path": "compInformation" },{
......
This diff is collapsed.
......@@ -15,12 +15,12 @@
display: flex;
align-items: center;
}
.pubox{
.postPublishing .pubox{
width: 100%;
height:calc(100vh * 0.8) ;
padding:0 15px;
}
.pubox-top{
.postPublishing .pubox-top{
width: 100%;
height: 45px;
display: flex;
......@@ -34,7 +34,7 @@
display:none;
}
.foritem{
.postPublishing .foritem{
width: 100%;
height: 45px;
display: flex;
......@@ -42,18 +42,76 @@
align-items: center;
justify-content: space-between;
}
.postPublishing .flex-row{
display: flex;align-items: center;
}
.postPublishing .slot-btn{
width: 200rpx;
height: 200rpx;
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
background: rgb(244, 245, 246);
border-radius: 10rpx;
margin-left: 5px;
}
.postPublishing .slot-btn .mian-title {
font-size: 28rpx;
color: #888;
font-weight: 600;
margin: 10rpx 0;
}
.postPublishing .release{
width: 100%;
height: 45px;
border-radius: 22px;
display: flex;
align-items: center;
justify-content: center;
font-size: 16px;
color: #FFFFFF;
margin: 30px 0;
}
</style>
<template>
<view class="postPublishing" :style="{ height: contentHeight }">
<view class="box">
<view class="box-item" style="justify-content: space-between;" @click="show=true">
<view style="display: flex;align-items: center;">
<text style="font-size:12px;color: #666666;">选择分类</text>
<text style="margin-left: 25px;font-size:12px;color: #999999" v-if="addMsg.ForumId==0">选择合适的贴吧</text>
<text style="margin-left: 25px;font-size:12px;color: #111111" v-if="addMsg.ForumId>0">{{ForumName}}</text>
<text style="font-size:12px;color: #666666;">选择分类</text>
<view class="flex-row" >
<text style="margin-right: 5px;font-size:12px;color: #999999" v-if="addMsg.ForumId==0">选择合适的贴吧</text>
<text style="margin-right: 5px;font-size:12px;color: #111111" v-if="addMsg.ForumId>0">{{ForumName}}</text>
<u-icon name="arrow" color="#A5A4AC" size="30" ></u-icon>
</view>
</view>
<view class="box-item" style="justify-content: space-between;" >
<text style="font-size:12px;color: #666666;">是否开启报名</text>
<view class="flex-row">
<u-radio-group v-model="addMsg.IsOpenEnroll" >
<u-radio
shape="circle"
v-for="(item, index) in kqlist" :key="index"
:name="item.id"
:active-color="mainColor"
icon-size='34'
label-size='24'
>
{{item.name}}
</u-radio>
</u-radio-group>
</view>
</view>
<view class="box-item" style="justify-content: space-between;" v-if="addMsg.IsOpenEnroll==1" @click="showtime = true">
<text style="font-size:12px;color: #666666;">报名截止日期</text>
<view class="flex-row">
<text style="margin-right: 5px;font-size:12px;color: #999999" v-if="addMsg.Deadline==''">请选择时间</text>
<text style="margin-right: 5px;font-size:12px;color: #111111" v-else>{{addMsg.Deadline}}</text>
<u-icon name="arrow" color="#A5A4AC" size="30" ></u-icon>
</view>
<u-icon name="arrow" color="#A5A4AC" size="30" ></u-icon>
</view>
<view class="box-item">
<input type="text" v-model="addMsg.ActivityTitle" placeholder="请将标题写在这里~" style="width: 100%;">
......@@ -64,32 +122,46 @@
style="height: 100px;width: 100%;padding: 15px 0;"
placeholder="来吧,尽情发挥吧..."
v-model="addMsg.Content"
maxlength='2000'
/>
</view>
<view style="width: 100%;margin-top: 15px;">
<u-upload :action="action" :file-list="fileList" @on-remove="onRemove1" :custom-btn="true"
@on-success="uploadSuccessHandler">
<view slot="addBtn" class="slot-btn">
<u-icon name="photograph" size="40" color="#888"></u-icon>
<view class="mian-title">上传图片</view>
</view>
</u-upload>
</view>
<view class="release" @click="releasebtn" :style="{background:mainColor}">
发布
</view>
</view>
<u-popup v-model="show" mode="bottom" border-radius="20">
<view class="pubox" >
<view class="pubox-top">
<view></view>
<text >选择吧</text>
<u-icon name="cross" color="#555" size="40" @click='show=false'></u-icon>
</view>
<scroll-view scroll-y="true" style="height: calc(100vh * 0.8 - 65px);padding-bottom: 20px;">
<view>
<view v-for="(x,y) in forumList" :key="y" class="foritem" @click="select(x)">
<div style='display: flex;align-items: center;'>
<image :src="x.Icon" style="width: 30px;height: 30px;border-radius: 5px;"></image>
<text style="font-size: 14px;color: #111;margin-left: 10px;">{{x.Name}}</text>
</div>
<view >
<u-icon name="success" :color="mainColor" size="40" @click='show=false' v-if='addMsg.ForumId == x.Id'></u-icon>
</view>
<view class="pubox" >
<view class="pubox-top">
<view></view>
<text >选择吧</text>
<u-icon name="cross" color="#555" size="40" @click='show=false'></u-icon>
</view>
<scroll-view scroll-y="true" style="height: calc(100vh * 0.8 - 65px);padding-bottom: 20px;">
<view>
<view v-for="(x,y) in forumList" :key="y" class="foritem" @click="select(x)">
<div style='display: flex;align-items: center;'>
<image :src="x.Icon" style="width: 30px;height: 30px;border-radius: 5px;"></image>
<text style="font-size: 14px;color: #111;margin-left: 10px;">{{x.Name}}</text>
</div>
<view >
<u-icon name="success" :color="mainColor" size="40" @click='show=false' v-if='addMsg.ForumId == x.Id'></u-icon>
</view>
</view>
</scroll-view>
</view>
</u-popup>
<auth v-if="showAuth" @changeuserinfo="reloadUserinfo" @gbAuth= 'gbAuth'></auth>
</view>
</scroll-view>
</view>
</u-popup>
<u-picker v-model="showtime" mode="time" @confirm='confirm' :params="params" :default-time='addMsg.Deadline'></u-picker>
<auth v-if="showAuth" @changeuserinfo="reloadUserinfo" @gbAuth= 'gbAuth'></auth>
</view>
</template>
......@@ -105,10 +177,12 @@ export default {
showAuth:false,
show:false,
u:{},
fileList:[],
list: [],
mainColor: "",
contentHeight: 0,
forumList:[],
showtime:false,
addMsg:{
Id:0,
ForumId:0,
......@@ -116,8 +190,19 @@ export default {
Content:'',
ImageList:[],
Deadline:'',
IsOpenEnroll:1,//1 是开启 2 是不开启
},
params: {
year: true,
month: true,
day: true,
hour: true,
minute: true,
second: true
},
kqlist:[{id:1,name:'开启'},{id:2,name:'不开启'}],
ForumName:'',
action: this.host2 + "/api/File/UploadTencent",
};
},
created() {
......@@ -138,6 +223,8 @@ export default {
uni.setNavigationBarTitle({
title: this.pageTitle,
});
let MallBaseId = uni.getStorageSync("mall_UserInfo").MallBaseId ? uni.getStorageSync("mall_UserInfo").MallBaseId : 1;
this.action = this.host2 + '/api/File/UploadTencent?MallBaseId=' + MallBaseId
},
onLoad: function (option) {
this.u = uni.getStorageSync("mall_UserInfo");
......@@ -184,6 +271,86 @@ export default {
gbAuth(){
uni.navigateBack()
},
onRemove1(index) {
this.addMsg.ImageList.splice(index, 1);
},
uploadSuccessHandler(data, index, lists) {
let r = JSON.parse(data);
this.addMsg.ImageList.push(r.data);
},
confirm(val){
let time = val.year + '-' + val.month + '-' + val.day +' ' + val.hour + ':' + val.minute + ':' + val.second;
if((new Date()).getTime() >= (new Date(time)).getTime()){
uni.showToast({
title: '截止时间需要大于当前时间',
icon: 'none',
duration: 2500
})
}else{
this.addMsg.Deadline = time
}
},
releasebtn(){
if(this.addMsg.ForumId == 0){
uni.showToast({
title: '请选择分类板块',
icon: 'none',
})
return
}
if(this.addMsg.ActivityTitle == ''){
uni.showToast({
title: '编辑不能为空',
icon: 'none',
})
return
}
if(this.addMsg.Content == ''){
uni.showToast({
title: '内容不能为空',
icon: 'none',
})
return
}
if(this.addMsg.IsOpenEnroll==1 && this.addMsg.Deadline == ''){
uni.showToast({
title: '请选择报名截止时间',
icon: 'none',
})
return
}
let pages = getCurrentPages(); // 当前页面
let beforePage = pages[pages.length - 2]; // 前一个页面
uni.showLoading({
title:'发布中~'
})
this.request2(
{
url: '/api/AppletMiai/SetActivityInfo',
data: this.addMsg
},
res => {
uni.hideLoading()
if(res.resultCode==1){
uni.showToast({
title: '发布成功',
icon: 'success',
})
let that = this
setTimeout(()=>{
uni.navigateBack({
success: function() {
beforePage.$vm.Children(that.addMsg.ForumId); // 执行前一个页面的方法
}
});
},1000)
}
}
);
}
},
......
......@@ -23,13 +23,57 @@
:enable-back-to-top="true"
:enable-flex="true"
@scrolltolower="lower"
:style="{ height: '100%' }"
style="height: 100%;"
>
<view class="details">
<view class="item" v-for="(x, i) in g" :key="i" >
<!-- 小图模式 -->
<view class="item-minbox" v-if="showtype==1" @click="gopostdetails(x)">
<view class="minbox-l">
<text class="minbox-l-t">{{x.ActivityTitle}}</text>
<view style="display: flex;align-items: center;margin-top: 20px;">
<view style="width: 30px;height: 30px;border-radius: 15px;position: relative;">
<image :src="x.Photo" style="width: 100%;height: 100%;border-radius: 15px;"></image>
<image class="gstyle" v-if="x.Sex==1" src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/basic-nan-b.png" ></image>
<image class="gstyle" v-if="x.Sex==2" src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/basic-nv-b.png" ></image>
</view>
<view style="margin-left: 5px;display: flex;flex-direction: column;height: 30px;justify-content: space-between;">
<text style="width: calc(100vw - 75px - 310rpx);overflow: hidden;white-space: nowrap;text-overflow: ellipsis;font-size: 12px;color: #111111;">{{x.UserName}}</text>
<view style="display: flex;align-items: center;font-size: 10px;color: #858687;">
<text>报名{{x.EnrollNum}}</text>
<text style="margin-left: 5px;">{{x.ReplyNum}}留言</text>
</view>
</view>
</view>
</view>
<view class="minbox-r">
<image :src="x.ImageList[0]" mode="aspectFill" style="width: 100%;height: 100%;border-radius: 15px;"></image>
</view>
</view>
<!-- 大图模式 -->
<view v-if="showtype==2" class="maxbox" @click="gopostdetails(x)">
<image :src="x.ImageList[0]" mode="aspectFill" style="width: 100%;height: 410rpx;border-radius: 15px;"></image>
<view style="width: 100%;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;font-size: 16px;color: #111111;padding-top: 15px;">{{x.ActivityTitle}}</view>
<view class="max-b">
<view style="width: 35px;height: 35px;border-radius: 15px;position: relative;">
<image :src="x.Photo" style="width: 100%;height: 100%;border-radius: 15px;"></image>
<image class="gstyle" v-if="x.Sex==1" src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/basic-nan-b.png" ></image>
<image class="gstyle" v-if="x.Sex==2" src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/basic-nv-b.png" ></image>
</view>
<view style="margin-left: 10px;display: flex;flex-direction: column;height: 35px;justify-content: space-between;">
<text style="width: calc(100vw - 75px);overflow: hidden;white-space: nowrap;text-overflow: ellipsis;font-size: 14px;color: #111111;">{{x.UserName}}</text>
<view style="display: flex;align-items: center;justify-content: space-between;font-size: 11px;color: #858687;">
<view style="display: flex;align-items: center;">
<text>报名{{x.EnrollNum}}</text>
<text style="margin-left: 5px;">{{x.ReplyNum}}留言</text>
</view>
<text v-if="x.IsOpenEnroll==1">{{x.Deadline}}截止</text>
</view>
</view>
</view>
</view>
</view>
</view>
<u-loadmore
......@@ -40,10 +84,11 @@
:margin-bottom="20"
bg-color="#FFF"
/>
<view style="width: 100%;height: 50px;"></view>
</scroll-view>
</view>
<view class="release" :style="{background:mainColor}" @click="gopublishing()">
<view class="release" :style="{background:mainColor}" @click.stop="gopublishing()">
发布
</view>
<!-- 加载中 -->
......@@ -53,15 +98,18 @@
</view>
<!-- 取消提示 -->
<u-toast ref="uToast" />
<tabbar ></tabbar>
<auth v-if="showAuth" @changeuserinfo="reloadUserinfo" @gbAuth= 'gbAuth'></auth>
</view>
</template>
<script>
import auth from "@/components/auth/index.vue";
import tabbar from "@/components/tabbar/index";
export default {
components: {
auth
auth,
tabbar
},
data() {
return {
......@@ -88,6 +136,7 @@ export default {
nomore: "没有更多了",
},
forumList:[],
showtype:2,
};
},
created() {
......@@ -131,6 +180,18 @@ export default {
this.loading = true;
this.init();
},
Children(Id){//发布成功了返回刷新列表
this.msg.ForumId = Id
this.forumList.forEach((x,y)=>{
if(x.Id == Id){
this.current = y
}
})
this.msg.pageIndex = 1;
this.g = [];
this.loading = true;
this.init();
},
GetForumList(){
this.request2(
{
......@@ -194,6 +255,11 @@ export default {
gbAuth(){
uni.navigateBack()
},
gopostdetails(x){//招募贴的
uni.navigateTo({
url: '/pages/blindDate/postDetails?Id='+x.Id
})
}
},
......@@ -205,6 +271,7 @@ export default {
height: 100%;
background: #FFF;
position: relative;
font-family: aa;
}
.postbar .loading {
......@@ -224,7 +291,7 @@ export default {
z-index: 999;
}
.postbar .details{
padding: 15px;
padding:0 15px;
display: flex;
flex-direction: column;
......@@ -241,38 +308,54 @@ export default {
display: flex;
align-items: center;
justify-content: center;
}
.item-minbox{
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
width: 100%;
height: 94px;
margin: 15px 0;
}
.item-minbox .minbox-l{
width: calc(100vw - 40px - 310rpx);
height: 94px;
display: flex;
flex-direction: column;
}
.postbar .item {
display: flex;
margin-bottom: 10px;
align-items: flex-start;
background: #fff;
border-radius: 5px;
box-shadow:0 4px 6px 1px rgba(76, 76, 76, 0.1);
}
.postbar .details .item .detail .coupond .rule{
font-size: 11px;
color:#777;
margin-top: 5px;
.item-minbox .minbox-l-t{
font-size: 15px;
color: #111111;
width: 100%;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 1;
-webkit-box-orient: vertical;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
}
.postbar .gstyle{
position: absolute;right: 0;bottom: 0;
width: 13px;
height: 13px;
}
.postbar .minbox-r{
width: 310rpx;
height: 94px;
border-radius: 15px;
}
.postbar .maxbox{
width: 100%;
margin-top: 20px;
}
.postbar .max-b{
width: 100%;
height: 35px;
display: flex;
align-items: center;
margin-top: 15px;
}
</style>
<style>
.postPublishing {
width: 100%;
height: 100%;
background: #FFF;
}
.postPublishing .box{
padding: 0 15px;
}
.postPublishing .box-item{
width: 100%;
height: 50px;
border-bottom: 1px solid #E2E2E2;
display: flex;
align-items: center;
}
.postPublishing .pubox{
width: 100%;
height:calc(100vh * 0.8) ;
padding:0 15px;
}
.postPublishing .pubox-top{
width: 100%;
height: 45px;
display: flex;
align-items: center;
justify-content: space-between;
font-size: 14px;
color: #111;
}
::-webkit-scrollbar{
display:none;
}
.postPublishing .foritem{
width: 100%;
height: 45px;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
}
.postPublishing .flex-row{
display: flex;align-items: center;
}
.postPublishing .slot-btn{
width: 200rpx;
height: 200rpx;
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
background: rgb(244, 245, 246);
border-radius: 10rpx;
margin-left: 5px;
}
.postPublishing .slot-btn .mian-title {
font-size: 28rpx;
color: #888;
font-weight: 600;
margin: 10rpx 0;
}
.postPublishing .release{
width: 100%;
height: 45px;
border-radius: 22px;
display: flex;
align-items: center;
justify-content: center;
font-size: 16px;
color: #FFFFFF;
margin: 30px 0;
}
</style>
<template>
<view class="postPublishing" :style="{ height: contentHeight }">
<view class="box">
<view>
<textarea
style="height: 100px;width: 100%;padding: 15px 0;"
placeholder="来吧,尽情发挥吧..."
v-model="addMsg.Content"
maxlength='2000'
/>
</view>
<view style="width: 100%;margin-top: 15px;">
<u-upload :action="action" :file-list="fileList" @on-remove="onRemove1" :custom-btn="true"
@on-success="uploadSuccessHandler">
<view slot="addBtn" class="slot-btn">
<u-icon name="photograph" size="40" color="#888"></u-icon>
<view class="mian-title">上传图片</view>
</view>
</u-upload>
</view>
<view class="release" @click="releasebtn" :style="{background:mainColor}">
发表
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
pageTitle: "发表图文",
action: this.host2 + "/api/File/UploadTencent",
mainColor:'',
fileList:[],
addMsg:{}
};
},
created() {
this.mainColor = this.$uiConfig.mainColor;
},
mounted() {
uni.setNavigationBarTitle({
title: this.pageTitle,
});
let MallBaseId = uni.getStorageSync("mall_UserInfo").MallBaseId ? uni.getStorageSync("mall_UserInfo").MallBaseId : 1;
this.action = this.host2 + '/api/File/UploadTencent?MallBaseId=' + MallBaseId
},
onLoad: function (option) {
this.addMsg = JSON.parse(decodeURIComponent(option.sendMsg))
},
methods: {
onRemove1(index) {
this.addMsg.ImageList.splice(index, 1);
},
uploadSuccessHandler(data, index, lists) {
let r = JSON.parse(data);
this.addMsg.ImageList.push(r.data);
},
releasebtn(){
let pages = getCurrentPages(); // 当前页面
let beforePage = pages[pages.length - 2]; // 前一个页面
uni.showLoading({
title:'发表中~'
})
this.request2(
{
url: '/api/AppletMiai/SgetActivityDiscussInfo',
data: this.addMsg
},
res => {
uni.hideLoading()
uni.showToast({
title: '发表成功',
icon: 'none',
})
let that = this
setTimeout(()=>{
uni.navigateBack({
success: function() {
beforePage.$vm.Children(); // 执行前一个页面的方法
}
});
},1000)
}
);
},
},
};
</script>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment