Commit a4b68f60 authored by Mac's avatar Mac

发布页面

parent 28be22b8
......@@ -56,16 +56,13 @@
}
.postDetails .activitytime{
width: 100%;
height: 30px;
border-radius: 2px;
margin-top: 15px;
display: flex;
align-items: center;
justify-content: space-between;
background: #F0F0F0;
font-size: 11px;
color: #111111;
padding: 0 15px;
padding: 15px;
}
.postDetails .content{
font-size: 13px;
......@@ -283,6 +280,23 @@
align-items: center;
justify-content: center;
}
.details-top{
width: 100%;
height: 223px;
}
.activitytime-item{
width: 100%;
display: flex;
align-items: flex-start;
margin-bottom: 10px;
}
.activitytime-item-l{
width: 220rpx;
color: #666666;
}
</style>
<template>
<view class="postDetails">
......@@ -302,8 +316,11 @@
@scroll='inputscroll'
style="height: 100%;"
>
<view class="details-top">
<image style="width: 100%;height: 100%;" :src="details.ImageList[0]" mode="aspectFill"></image>
</view>
<view class="details">
<view class="details-title">{{details.ActivityTitle}}</view>
<view class="details-title"><text v-if="details.Label!=null&& details.Label!='' " :style="{color:mainColor}">【{{details.Label}}</text>{{details.ActivityTitle}}</view>
<view class="details-info">
<view class="details-info-l">
<view style="width: 35px;height: 35px;border-radius: 50%;position: relative;">
......@@ -323,8 +340,40 @@
</view>
</view>
<view class="activitytime" v-if='details.IsOpenEnroll==1'>
<text>活动截止时间:{{details.Deadline}}</text>
<text>{{gettime()}}</text>
<view class="activitytime-item">
<view class="activitytime-item-l">
报名截止时间
</view>
<text>{{details.Deadline}}</text>
</view>
<view class="activitytime-item">
<view class="activitytime-item-l">
开始时间
</view>
<text>{{details.StartTime}}</text>
</view>
<view class="activitytime-item">
<view class="activitytime-item-l">
结束时间
</view>
<text>{{details.EndTime}}</text>
</view>
<view class="activitytime-item">
<view class="activitytime-item-l">
报名人数
</view>
<text>{{details.ManNum}}<text style="margin-left: 10px;">{{details.WoManNum}}</text> </text>
</view>
<view class="activitytime-item" style="margin-bottom: 0;">
<view class="activitytime-item-l">
活动地址
</view>
<view style="display: flex;flex-wrap: wrap;">
<u-icon name="location" :color="mainColor" size="30" ></u-icon>
<text style="margin-left: 5px;">{{details.LocationName}}</text>
</view>
</view>
</view>
<view class="content" v-html="details.Content">
......
......@@ -113,7 +113,8 @@
<view class="postPublishing" :style="{ height: contentHeight }">
<view class="box">
<view class="box-top" @click="scimg()">
<view class="box-top-z" :style="{background:addMsg.ImageList.length>0?'rgba(17, 17, 17, 0.2)':'transparent'}">
<image :src="addMsg.ImageList[0]" style="width: 100%;height: 100%;" mode="aspectFill"></image>
<view class="box-top-z" :style="{'background':addMsg.ImageList.length>0?'rgba(17, 17, 17, 0.2)':'transparent'}">
<image src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/blind_xj.png" style="width: 40px;height: auto;" mode="widthFix"></image>
</view>
......@@ -126,6 +127,22 @@
<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">
<input type="text" v-model="addMsg.ActivityTitle" :min='0' placeholder="活动标题" style="font-size: 12px;text-align: right;">
</view>
</view>
<view class="box-item" style="justify-content: space-between;" >
<text style="font-size:12px;color: #666666;">标签</text>
<view class="flex-row">
<input type="text" v-model="addMsg.Label" :min='0' :maxlength="6" placeholder="活动标签" style="font-size: 12px;text-align: right;margin-right: 5px;">
<text style="color: #999999;font-size: 10px;">
{{addMsg.Label.length}}/6
</text>
</view>
</view>
<view class="box-item" style="justify-content: space-between;" >
<text style="font-size:12px;color: #666666;">是否开启报名</text>
<view class="flex-row">
......@@ -144,7 +161,7 @@
</u-radio-group>
</view>
</view>
<view class="box-item" style="justify-content: space-between;" v-if="addMsg.IsOpenEnroll==1" @click="showtime = true">
<view class="box-item" style="justify-content: space-between;" v-if="addMsg.IsOpenEnroll==1" @click="showtime = true,defaulttime= addMsg.Deadline,timetype=1">
<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>
......@@ -152,11 +169,19 @@
<u-icon name="arrow" color="#A5A4AC" size="30" ></u-icon>
</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="box-item" style="justify-content: space-between;" v-if="addMsg.IsOpenEnroll==1" @click="showtime = true,defaulttime= addMsg.StartTime,timetype=2">
<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.StartTime==''">请选择活动开始时间</text>
<text style="margin-right: 5px;font-size:12px;color: #111111" v-else>{{addMsg.StartTime}}</text>
<u-icon name="arrow" color="#A5A4AC" size="30" ></u-icon>
</view>
</view>
<view class="box-item" style="justify-content: space-between;" v-if="addMsg.IsOpenEnroll==1" @click="showtime = true,defaulttime= addMsg.EndTime,timetype=3">
<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.StartTime}}-{{addMsg.EndTime}}</text>
<text style="margin-right: 5px;font-size:12px;color: #999999" v-if="addMsg.EndTime==''">请选择活动结束时间</text>
<text style="margin-right: 5px;font-size:12px;color: #111111" v-else>{{addMsg.EndTime}}</text>
<u-icon name="arrow" color="#A5A4AC" size="30" ></u-icon>
</view>
</view>
......@@ -174,25 +199,18 @@
</view>
</view>
<view class="box-item" style="justify-content: space-between;" >
<text style="font-size:12px;color: #666666;">主题</text>
<view class="flex-row">
<input type="text" v-model="addMsg.ActivityTitle" :min='0' placeholder="活动标题" style="font-size: 12px;text-align: right;">
</view>
</view>
<view class="box-item" style="justify-content: space-between;" >
<text style="font-size:12px;color: #666666;">标签</text>
<view class="flex-row">
<input type="text" v-model="addMsg.Label" :min='0' :maxlength="6" placeholder="活动标签" style="font-size: 12px;text-align: right;margin-right: 5px;">
<text style="color: #999999;">
{{addMsg.Label.length}}/6
</text>
<view class="box-item" style="justify-content: space-between;" @click="getAddress()">
<text style="font-size:12px;color: #666666;">所在位置</text>
<view class="flex-row">
<u-icon name="location" :color="mainColor" size="30" ></u-icon>
<text style="max-width: calc(100vw - 70px - 40px);white-space: nowrap;text-overflow: ellipsis;overflow: hidden;margin-right: 5px;">{{addMsg.LocationName!=''?addMsg.LocationName:'无'}}</text>
<u-icon name="arrow" color="#A5A4AC" size="30" ></u-icon>
</view>
</view>
<view class="box-item">
<!-- <view class="box-item">
<input type="text" v-model="addMsg.ActivityTitle" placeholder="请将标题写在这里~" style="width: 100%;">
</view>
</view> -->
<view style="height: 135px;width: 100%;padding: 15px 0;" @click="gorichText">
<view v-html='addMsg.Content' v-if="addMsg.Content!=''" style="width: 100%;height: 100px;overflow: hidden;"></view>
<view v-else style="color: #999999;font-size: 14px;">详情描述</view>
......@@ -222,7 +240,7 @@
<u-icon name="cross" color="#555" size="40" @click='show=false'></u-icon>
</view>
<view style="display: flex;flex-direction: column;align-items: center;margin-top: 10px;">
<view style="font-size: 20px;color: #111111;font-weight: 400; ">选择你感兴趣的话题</view>
<view style="font-size: 20px;color: #111111;font-weight: 400; ">选择你感兴趣的贴吧</view>
<view style="font-size: 13px;color: #999999;margin: 10px 0;">贴吧只能选择一个,发布前可更改</view>
</view>
......@@ -235,7 +253,7 @@
</scroll-view>
</view>
</u-popup>
<u-picker v-model="showtime" mode="time" @confirm='confirm' :params="params" :default-time='addMsg.Deadline'></u-picker>
<u-picker v-model="showtime" mode="time" @confirm='confirm' :params="params" :default-time='defaulttime'></u-picker>
<auth v-if="showAuth" @changeuserinfo="reloadUserinfo" @gbAuth= 'gbAuth'></auth>
</view>
</template>
......@@ -286,6 +304,8 @@ export default {
kqlist:[{id:1,name:'开启'},{id:2,name:'不开启'}],
ForumName:'',
action: this.host2 + "/api/File/UploadTencent",
timetype:0,
defaulttime:'',
};
},
created() {
......@@ -364,12 +384,28 @@ export default {
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: '截止时间需要大于当前时间',
title: '时间需要大于当前时间',
icon: 'none',
duration: 2500
})
}else{
if(this.timetype==3 && ((new Date(this.addMsg.StartTime)).getTime() >= (new Date(time)).getTime())){
uni.showToast({
title: '结束时间大于开始时间',
icon: 'none',
duration: 2500
})
}else{
if(this.timetype==1){
this.addMsg.Deadline = time
}else if(this.timetype==2){
this.addMsg.StartTime = time
}else if(this.timetype==3){
this.addMsg.EndTime = time
}
}
}
},
......@@ -454,8 +490,119 @@ export default {
this.addMsg.Content = e
},
scimg(){
let chooseFile = null;
chooseFile = new Promise((resolve, reject) => {
uni.chooseImage({
count: 1,
success: resolve,
fail: reject
});
});
chooseFile
.then((res_c)=>{
// 创建上传对象
uni.compressImage({
src: res_c.tempFilePaths[0],
quality: 80,
success: res_cp => {
const task = uni.uploadFile({
url: this.action,
filePath: res_cp.tempFilePath,
name: 'file',
formData: {
user: 'test'
},
success: (res) => {
let data = JSON.parse(res.data)
console.log(data)
if(this.addMsg.ImageList.length>0){
this.addMsg.ImageList[0] = data.data
}else{
this.addMsg.ImageList.push(data.data)
}
},
fail: (e) => {
console.log(e)
},
});
task.onProgressUpdate((res) => {
});
}
})
})
.catch(error => {
// this.$emit('on-error', error);
});
},
//打开地图
getAddress() {
let that = this;
uni.chooseLocation({
success: function(res) {
that.addMsg.LocationName = res.name;
that.addMsg.LonLat = res.longitude + ',' + res.latitude;
},
fail: function(err) {
that.fetchAgainLocation()
}
});
},
//重新提示用户打开设置对地图授权
fetchAgainLocation() {
let that = this
wx.getSetting({
success: (res) => {
var statu = res.authSetting;
if (!statu['scope.userLocation']) {
wx.showModal({
title: '是否授权当前位置',
content: '需要获取您的地理位置,请确认授权,否则地图功能将无法使用',
success: (tip) => {
if (tip.confirm) {
console.log(tip)
wx.openSetting({
success: (data) => {
console.log(data)
if (data.authSetting["scope.userLocation"] === true) {
wx.showToast({
title: '授权成功',
icon: 'success',
duration: 1000
})
if (that.latitude != '' && that.longitude != '') {
that.getAddress()
} else {
that.getAddress()
}
} else {
wx.showToast({
title: '授权失败',
duration: 1000
})
}
},
fail: (err) => {
console.log(err)
},
complete: () => {}
});
}
}
})
}
},
fail: () => {},
complete: () => {}
})
},
},
......
......@@ -38,7 +38,9 @@
<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>
<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>
......@@ -53,7 +55,9 @@
<!-- 大图模式 -->
<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 style="width: 100%;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;font-size: 16px;color: #111111;padding-top: 10px;">
<text v-if="x.Label!=null && x.Label!=''" :style="{color:mainColor}">【{{x.Label}}</text>
{{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>
......@@ -61,7 +65,10 @@
<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>
<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>
......@@ -352,6 +359,6 @@ export default {
height: 35px;
display: flex;
align-items: center;
margin-top: 15px;
margin-top: 10px;
}
</style>
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