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"> <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>
<view class="content-input"> <view class="content-input">
@ -17,7 +32,7 @@
:maxlength="200" :maxlength="200"
autoHeight autoHeight
count count
placeholder="添加正文"></uv-textarea>
placeholder="说点什么吧"></uv-textarea>
</view> </view>
<view class="images box"> <view class="images box">
@ -79,14 +94,7 @@
发布须知 发布须知
</view> </view>
<!-- <submit
@submit="submit"
@preview="preview"
@draft="draft"
:submitTitle="id ? '修改帖子' : '发布帖子'"
/> -->
<configPopup <configPopup
ref="configPopup" ref="configPopup"
/> />
@ -95,14 +103,11 @@
</template> </template>
<script> <script>
// import submit from '@/components/content/submit.vue'
export default { export default {
components : { components : {
// submit,
}, },
data() { data() {
return { return {
upTopList : [],
form : { form : {
// image : [], // image : [],
content : '', content : '',
@ -115,26 +120,36 @@
// }, // },
], ],
id : 0, id : 0,
categoryIndex : 0,
category : [
{
name : '圈子动态',
},
{
name : '二手集市',
},
],
}; };
}, },
computed : { 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) { onLoad(args) {
this.id = args.id this.id = args.id
}, },
onShow() { onShow() {
this.indexTopPayList()
this.getDateil()
}, },
methods : { methods : {
clickCategory(item, index){
this.categoryIndex = index
},
getDateil(){ getDateil(){
if(!this.id){ if(!this.id){
return return
@ -146,17 +161,6 @@
id : this.id id : this.id
}, res => { }, res => {
if (res.code == 200) { 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(){ payOrder(){
@ -251,13 +248,6 @@
return return
} }
if(this.form.topId && !this.id){
//
this.$refs.confirmationPopup.open()
}else{
//
this.payOrder()
}
}, },
preview(){}, preview(){},
draft(){}, 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> </style>

Loading…
Cancel
Save