Browse Source

上传

master
前端-胡立永 4 months ago
parent
commit
ad4803d611
1 changed files with 60 additions and 47 deletions
  1. +60
    -47
      pages_order/post/addPost.vue

+ 60
- 47
pages_order/post/addPost.vue View File

@ -8,7 +8,22 @@
<view class="title-input box">
<input type="text" placeholder="添加标题" v-model="form.title"/>
<input type="text" placeholder="取个吸引人的标题吧" v-model="form.title"/>
</view>
<view class="category">
<view class="title">
选择分区
</view>
<view class="tagList">
<view
:class="{act : i == categoryIndex}"
@click="clickCategory(item, i)"
v-for="(t, i) in category"
:key="i">
{{ t.name }}
</view>
</view>
</view>
<view class="content-input">
@ -17,7 +32,7 @@
:maxlength="200"
autoHeight
count
placeholder="添加正文"></uv-textarea>
placeholder="说点什么吧"></uv-textarea>
</view>
<view class="images box">
@ -79,14 +94,7 @@
发布须知
</view>
<!-- <submit
@submit="submit"
@preview="preview"
@draft="draft"
:submitTitle="id ? '修改帖子' : '发布帖子'"
/> -->
<configPopup
ref="configPopup"
/>
@ -95,14 +103,11 @@
</template>
<script>
// import submit from '@/components/content/submit.vue'
export default {
components : {
// submit,
},
data() {
return {
upTopList : [],
form : {
// image : [],
content : '',
@ -115,26 +120,36 @@
// },
],
id : 0,
categoryIndex : 0,
category : [
{
name : '圈子动态',
},
{
name : '二手集市',
},
],
};
},
computed : {
topInfo(){
for (var i = 0; i < this.upTopList.length; i++) {
if(this.upTopList[i].id == this.form.topId){
return this.upTopList[i]
}
}
return {}
},
// topInfo(){
// for (var i = 0; i < this.upTopList.length; i++) {
// if(this.upTopList[i].id == this.form.topId){
// return this.upTopList[i]
// }
// }
// return {}
// },
},
onLoad(args) {
this.id = args.id
},
onShow() {
this.indexTopPayList()
this.getDateil()
},
methods : {
clickCategory(item, index){
this.categoryIndex = index
},
getDateil(){
if(!this.id){
return
@ -146,17 +161,6 @@
id : this.id
}, res => {
if (res.code == 200) {
res.result.details.image.split(',')
.forEach(url => {
self.fileList.push({
url
})
})
res.result.details.topId = res.result.details.topId || 0
this.form = res.result.details
}
})
},
@ -173,13 +177,6 @@
})
})
},
indexTopPayList(){
this.$api('indexTopPayList', res => {
if(res.code == 200){
this.upTopList = res.result
}
})
},
//
payOrder(){
@ -251,13 +248,6 @@
return
}
if(this.form.topId && !this.id){
//
this.$refs.confirmationPopup.open()
}else{
//
this.payOrder()
}
},
preview(){},
draft(){},
@ -340,4 +330,27 @@
}
}
}
.category{
padding: 20rpx;
.title{
// font-weight: 900;
// font-size: 30rpx;
}
.tagList{
display: flex;
flex-wrap: wrap;
padding: 10rpx 0;
view{
background: rgba($uni-color, 0.1);
padding: 10rpx 20rpx;
margin: 10rpx;
border-radius: 10rpx;
font-size: 26rpx;
}
.act{
color: #fff;
background: $uni-color;
}
}
}
</style>

Loading…
Cancel
Save