Commit 480a5ab7 authored by Mac's avatar Mac

1

parent f1c104ce
...@@ -563,6 +563,10 @@ ...@@ -563,6 +563,10 @@
} }
},{ },{
"path":"personal/editmaterial"//资料编辑 "path":"personal/editmaterial"//资料编辑
},{
"path":"postbar"//贴吧列表
},{
"path":"postPublishing"//贴吧发布
}] }]
}, },
//韩国馆项目 { "root": "pages/kotra", "pages": [{ "path": "contanctus" },{ "path": "contanctDetail" },{ "path": "compInformation" },{ //韩国馆项目 { "root": "pages/kotra", "pages": [{ "path": "contanctus" },{ "path": "contanctDetail" },{ "path": "compInformation" },{
......
<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;
}
.pubox{
width: 100%;
height:calc(100vh * 0.8) ;
padding:0 15px;
}
.pubox-top{
width: 100%;
height: 45px;
display: flex;
align-items: center;
justify-content: space-between;
font-size: 14px;
color: #111;
}
::-webkit-scrollbar{
display:none;
}
.foritem{
width: 100%;
height: 45px;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
}
</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>
</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%;">
</view>
<view>
<textarea
style="height: 100px;width: 100%;padding: 15px 0;"
placeholder="来吧,尽情发挥吧..."
v-model="addMsg.Content"
/>
</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>
</view>
</scroll-view>
</view>
</u-popup>
<auth v-if="showAuth" @changeuserinfo="reloadUserinfo" @gbAuth= 'gbAuth'></auth>
</view>
</template>
<script>
import auth from "@/components/auth/index.vue";
export default {
components: {
auth
},
data() {
return {
pageTitle: "发布帖子",
showAuth:false,
show:false,
u:{},
list: [],
mainColor: "",
contentHeight: 0,
forumList:[],
addMsg:{
Id:0,
ForumId:0,
ActivityTitle:'',
Content:'',
ImageList:[],
Deadline:'',
},
ForumName:'',
};
},
created() {
this.contentHeight = this.$utils.calcContentHeight(-40) + "px";
this.mainColor = this.$uiConfig.mainColor;
},
mounted() {
let currentPages = getCurrentPages();
let u = "/" + currentPages[currentPages.length - 1].route;
let pages = wx.getStorageSync("basedata")
? wx.getStorageSync("basedata").bar_title
: [];
pages.forEach((x) => {
if (x.value == u) {
this.pageTitle = x.new_name ? x.new_name : x.name;
}
});
uni.setNavigationBarTitle({
title: this.pageTitle,
});
},
onLoad: function (option) {
this.u = uni.getStorageSync("mall_UserInfo");
if (!this.u) {
this.u = {
nickName: "未登录",
avatarUrl: ""
};
this.showAuth = true;
} else{
this.GetForumList()
}
},
methods: {
GetForumList(){
this.request2(
{
url: '/api/AppletMiai/GetForumList',
data: {}
},
res => {
if(res.resultCode==1){
this.forumList = res.data
}
}
);
},
select(x){
this.addMsg.ForumId =x.Id;
this.ForumName =x.Name;
this.show = false;
},
reloadUserinfo() {
this.u = uni.getStorageSync("mall_UserInfo");
// this.showAuth=false;
this.GetForumList();
},
//关闭登录窗口
gbAuth(){
uni.navigateBack()
},
},
};
</script>
<template>
<view class="postbar" :style="{ height: contentHeight }">
<u-tabs
:list="list"
:is-scroll="true"
:current="current"
@change="change"
:active-color="mainColor"
></u-tabs>
<u-empty v-if="g.length == 0" text="暂无内容" mode="list"></u-empty>
<view
v-if="g.length > 0"
style="
height: calc(100vh - 50px);
width: calc(100vw);
overflow: hidden;
padding-bottom: 50px;
"
>
<scroll-view
:scroll-y="true"
:enable-back-to-top="true"
:enable-flex="true"
@scrolltolower="lower"
:style="{ height: '100%' }"
>
<view class="details">
<view class="item" v-for="(x, i) in g" :key="i" >
</view>
</view>
<u-loadmore
:status="status"
:load-text="loadText"
:font-size="24"
:margin-top="20"
:margin-bottom="20"
bg-color="#FFF"
/>
</scroll-view>
</view>
<view class="release" :style="{background:mainColor}" @click="gopublishing()">
发布
</view>
<!-- 加载中 -->
<view class="loading" v-if="loading">
<u-loading mode="flower" size="48">></u-loading>
<Text style="color: #fff; margin-top: 10rpx;">加载中...</Text>
</view>
<!-- 取消提示 -->
<u-toast ref="uToast" />
<auth v-if="showAuth" @changeuserinfo="reloadUserinfo" @gbAuth= 'gbAuth'></auth>
</view>
</template>
<script>
import auth from "@/components/auth/index.vue";
export default {
components: {
auth
},
data() {
return {
pageTitle: "贴吧",
showAuth:false,
u:{},
list: [],
mainColor: "",
contentHeight: 0,
current:0,
msg:{
pageIndex: 1,
pageSize:10,
ForumId:0,
ActivityTitle:'',
},
page_count: 1,
g: [],
loading: false,
status: "loadmore",
loadText: {
loadmore: "轻轻上拉,加载更多",
loading: "努力加载中",
nomore: "没有更多了",
},
forumList:[],
};
},
created() {
this.contentHeight = this.$utils.calcContentHeight(-40) + "px";
this.mainColor = this.$uiConfig.mainColor;
},
mounted() {
let currentPages = getCurrentPages();
let u = "/" + currentPages[currentPages.length - 1].route;
let pages = wx.getStorageSync("basedata")
? wx.getStorageSync("basedata").bar_title
: [];
pages.forEach((x) => {
if (x.value == u) {
this.pageTitle = x.new_name ? x.new_name : x.name;
}
});
uni.setNavigationBarTitle({
title: this.pageTitle,
});
},
onLoad: function (option) {
this.u = uni.getStorageSync("mall_UserInfo");
if (!this.u) {
this.u = {
nickName: "未登录",
avatarUrl: ""
};
this.showAuth = true;
} else{
this.GetForumList()
}
},
methods: {
change(index) {
this.msg.ForumId = this.forumList[index].Id;
this.current = index;
this.msg.pageIndex = 1;
this.g = [];
this.loading = true;
this.init();
},
GetForumList(){
this.request2(
{
url: '/api/AppletMiai/GetForumList',
data: {}
},
res => {
if(res.resultCode==1){
this.forumList = res.data
this.list =[]
res.data.forEach(x=>{
let obj ={name:x.Name}
this.list.push(obj)
})
this.msg.ForumId = this.forumList[0].Id;
this.init();
}
}
);
},
init() {
this.request2(
{
url: '/api/AppletMiai/GetActivityPageList',
data: this.msg
},
res => {
this.loading = false;
if(res.resultCode==1){
this.g = this.g.concat(res.data.pageData);
this.page_count = res.data.pageCount;
if (this.page_count == 1) {
this.status = "nomore";
}
}
}
);
},
lower(e) {
if (this.msg.pageIndex < this.page_count) {
this.msg.pageIndex++;
this.status = "loading";
this.init();
} else {
this.status = "nomore";
}
},
gopublishing(){//发帖
uni.navigateTo({
url: '/pages/blindDate/postPublishing'
})
},
reloadUserinfo() {
this.u = uni.getStorageSync("mall_UserInfo");
// this.showAuth=false;
this.GetForumList();
},
//关闭登录窗口
gbAuth(){
uni.navigateBack()
},
},
};
</script>
<style>
.postbar {
width: 100%;
height: 100%;
background: #FFF;
position: relative;
}
.postbar .loading {
width: 180rpx;
height: 180rpx;
background: #000000;
opacity: 0.7;
border-radius: 10rpx;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
position: fixed;
left: 50%;
top: 30%;
margin-left: -100rpx;
z-index: 999;
}
.postbar .details{
padding: 15px;
display: flex;
flex-direction: column;
}
.postbar .release{
width: 120px;
height: 44px;
border-radius: 22px;
font-size: 16px;
color: #FFF;
position: fixed;
right: 15px;
bottom: 120px;
display: flex;
align-items: center;
justify-content: center;
}
.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;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 1;
-webkit-box-orient: vertical;
}
</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