帧视界壹通告,付费看视频的微信小程序
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

299 lines
5.8 KiB

<template>
<view class="publishPost">
<navbar
leftClick
@leftClick="$utils.navigateBack"
title="发布帖子"/>
<view class="images box">
<uv-upload
:fileList="fileList"
:maxCount="5"
multiple
width="150rpx"
height="150rpx"
@delete="deleteImage"
@afterRead="afterRead"
:previewFullImage="true"></uv-upload>
</view>
<view class="title-input box">
<input type="text" placeholder="添加标题" v-model="form.title"/>
</view>
<view class="content-input">
<uv-textarea
v-model="form.content"
:maxlength="200"
autoHeight
count
placeholder="添加正文"></uv-textarea>
</view>
<view class="upTop">
<!-- <view class="title">
<uv-icon name="pushpin-fill"></uv-icon>
是否置顶
</view>
<uv-radio-group v-model="form.upTop">
<view class="list">
<view class="item"
v-for="(item, index) in upTopList"
:key="index">
<view class="left">
置顶{{ item.day }}{{ item.money }}
</view>
<view class="right">
<uv-radio
size="35rpx"
icon-size="35rpx"
:name="item.id">
</uv-radio>
</view>
</view>
</view>
</uv-radio-group> -->
<view class="label">
是否置顶
</view>
<view class="textarea">
<uv-radio-group v-model="form.isTop">
<uv-radio size="35rpx" icon-size="35rpx" label="是" labelSize="28rpx" name="1">
</uv-radio>
<uv-radio size="35rpx" icon-size="35rpx" label="否" labelSize="28rpx" name="0">
</uv-radio>
</uv-radio-group>
</view>
</view>
<view class="configBtn"
@click="$refs.configPopup.open()">
发布须知
</view>
<submit
@submit="submit"
@preview="preview"
@draft="draft"
submitTitle="发布帖子"
/>
<confirmationPopup
ref="confirmationPopup"
title="提示"
@confirm="pay"
confirmText="确认支付">
<view class="confirmationPopup">
<image src="/static/image/publish/pay.png"
style="width: 150rpx;height: 150rpx;"
mode=""></image>
<view class="info">
确认支付3元可置顶1天
</view>
</view>
</confirmationPopup>
<confirmationPopup
ref="confirmationPopupUpload"
title="提示"
@confirm="$utils.navigateTo('/index/index')"
confirmText="确认">
<view class="confirmationPopup">
<image src="/static/image/publish/upload.png"
style="width: 150rpx;height: 150rpx;"
mode=""></image>
<view class="info">
已由平台进行审核时间周期为24小时
</view>
</view>
</confirmationPopup>
<configPopup
ref="configPopup"
/>
</view>
</template>
<script>
import submit from '@/components/content/submit.vue'
import confirmationPopup from '@/components/toast/confirmationPopup.vue'
export default {
components : {
submit,
confirmationPopup
},
data() {
return {
upTopList : [],
form : {
// image : [],
content : '',
// upTop : '',
title : '',
},
fileList: [
// {
// url: 'https://cdn.uviewui.com/uview/swiper/2.jpg'
// },
],
};
},
onShow() {
// this.indexTopPayList()
},
methods : {
deleteImage(e){
this.fileList.splice(e.index, 1)
},
afterRead(e){
let self = this
e.file.forEach(file => {
self.$Oss.ossUpload(file.url).then(url => {
self.fileList.push({
url
})
})
})
},
indexTopPayList(){
this.$api('indexTopPayList', res => {
if(res.code == 200){
this.upTopList = res.result
}
})
},
pay(){
let arr = []
this.fileList.forEach(n => {
arr.push(n.url)
})
let data = {
...this.form,
isCard : 1,
image : arr.join(',')
}
this.$api('infoReleaseTrends', data,
res => {
if(res.code == 200){
this.$refs.confirmationPopupUpload.open()
}
})
},
submit(){
console.log(this.form);
if(this.fileList.length == 0){
return uni.showToast({
title: '请上传图片',
icon : 'none'
})
}
if (this.$utils.verificationAll(this.form, {
title: '请输入标题',
content: '请输入正文',
})) {
return
}
console.log("图片集", this.fileList.map((item) => item.url).join(","))
this.form.image = this.fileList.map((item) => item.url).join(",")
this.$api('publishDynamicState', this.form, res => {
if (res.code == 200) {
this.$refs.confirmationPopupUpload.open()
}
})
// if(this.form.upTop){
// }else{
// this.$refs.confirmationPopup.open()
// }
},
preview(){},
draft(){},
}
}
</script>
<style lang="scss" scoped>
.publishPost{
background-color: #fff;
min-height: 100vh;
font-size: 28rpx;
padding-bottom: 150rpx;
/deep/ .uv-textarea{
background-color: transparent;
border: none;
}
/deep/ .uv-textarea__count{
background-color: transparent !important;
}
.box{
padding: 0 20rpx;
}
.images{
display: flex;
flex-wrap: wrap;
padding: 20rpx;
}
.title-input{
border-bottom: 1px solid #00000015;
padding-bottom: 25rpx;
margin-bottom: 15rpx;
}
.content-input{
min-height: 400rpx;
}
.upTop{
.title{
padding-top: 20rpx;
padding-left: 30rpx;
border-top: 1px solid #00000015;
display: flex;
align-items: center;
}
.list{
padding-top: 30rpx;
width: 100%;
.item{
display: flex;
padding: 20rpx;
padding-left: 80rpx;
justify-content: space-between;
width: 600rpx;
border-bottom: 1px solid #00000015;
align-items: center;
}
}
}
.configBtn{
padding: 20rpx;
color: #777;
padding-top: 40rpx;
font-size: 28rpx;
}
.confirmationPopup{
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
width: 100%;
height: 300rpx;
image{
margin-top: 40rpx;
}
.info{
margin-top: 40rpx;
font-size: 26rpx;
}
}
}
</style>