Browse Source

上传动态发布

master
前端-胡立永 11 months ago
parent
commit
a51667df95
5 changed files with 251 additions and 34 deletions
  1. +72
    -0
      components/content/submit.vue
  2. +1
    -2
      manifest.json
  3. +1
    -3
      package.json
  4. +9
    -26
      pages.json
  5. +168
    -3
      pages/publish/publishPost.vue

+ 72
- 0
components/content/submit.vue View File

@ -0,0 +1,72 @@
<template>
<view class="submit">
<view class="">
<uv-icon
size="40rpx"
name="file-text"></uv-icon>
<view class="">
存草稿
</view>
</view>
<view class="">
<uv-icon
size="40rpx"
name="eye-fill"></uv-icon>
<view class="">
预览
</view>
</view>
<view class="btn">
{{ submiitTitle }}
</view>
</view>
</template>
<script>
export default {
name:"submit",
props : {
submiitTitle : {
default : '发布',
type : String,
}
},
data() {
return {
}
},
methods: {
}
}
</script>
<style lang="scss" scoped>
.submit{
position: fixed;
bottom: 0;
left: 0;
width: 100vw;
background-color: #fff;
height: 100rpx;
display: flex;
justify-content: center;
align-items: center;
.btn{
background: $uni-linear-gradient-btn-color;
width: 400rpx;
height: 70rpx;
color: #fff;
border-radius: 15rpx;
}
view{
width: 100rpx;
margin: 0 10rpx;
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
}
}
</style>

+ 1
- 2
manifest.json View File

@ -55,8 +55,7 @@
"appid" : "wxe7ae8cbe1673834c",
"setting" : {
"urlCheck" : false,
"ignoreDevUnusedFiles":false
"ignoreDevUnusedFiles" : false
},
"usingComponents" : true,
"permission" : {}


+ 1
- 3
package.json View File

@ -14,9 +14,7 @@
"author": "",
"license": "ISC",
"dependencies": {
"@climblee/uv-ui": "^1.1.20",
"ali-oss": "^6.21.0",
"dayjs": "^1.11.12",
"uview-ui": "^2.0.36"
"dayjs": "^1.11.12"
}
}

+ 9
- 26
pages.json View File

@ -1,16 +1,16 @@
{
"easycom": {
"autoscan": true,
"custom": {
"^uv-(.*)": "@climblee/uv-ui/components/uv-$1/uv-$1.vue"
},
"^u-(.*)": "uview-ui/components/u-$1/u-$1.vue"
},
"pages": [
{
"path": "pages/index/index",
"style": {
"navigationBarTitleText": "unapp模板"
"navigationBarTitleText": ""
}
},
{
"path" : "pages/publish/publishPost",
"style" :
{
"navigationBarTitleText" : ""
}
},
{
@ -90,13 +90,6 @@
"navigationBarTitleText" : ""
}
},
{
"path" : "pages/publish/publishPost",
"style" :
{
"navigationBarTitleText" : ""
}
},
{
"path" : "pages/publish/actorRelease",
"style" :
@ -161,15 +154,5 @@
"backgroundColor": "#F8F8F8",
"navigationStyle": "custom"
},
"uniIdRouter": {},
"condition" : { //
"current": 0, //(list )
"list": [
{
"name": "", //
"path": "", //
"query": "" //onLoad
}
]
}
"uniIdRouter": {}
}

+ 168
- 3
pages/publish/publishPost.vue View File

@ -4,20 +4,185 @@
leftClick
@leftClick="$utils.navigateBack"
title="发布帖子"/>
发布帖子
<view class="images box">
<!-- <view class="image"
v-for="(src, index) in form.image"
:key="index">
<image src="src" mode=""></image>
</view>
<view class="add">
<uv-icon name="plus"></uv-icon>
</view> -->
<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="添加标题"/>
</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=""></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.info }}
</view>
<view class="right">
<uv-radio
size="35rpx"
icon-size="35rpx"
:name="item.id">
</uv-radio>
</view>
</view>
</view>
</uv-radio-group>
</view>
<submit
@submit="submit"
@preview="preview"
@draft="draft"
submitTitle="发布帖子"
/>
</view>
</template>
<script>
import submit from '@/components/content/submit.vue'
import uvUpload from '@/uni_modules/uv-upload/components/uv-upload/uv-upload.vue'
export default {
components : {
submit,
uvUpload
},
data() {
return {
upTopList : [
{
info : '置顶1天3元',
id : 1,
},
{
info : '置顶2天3元',
id : 4,
},
{
info : '置顶3天3元',
id : 3,
},
{
info : '置顶4天3元',
id : 2,
},
],
form : {
image : [],
content : '',
upTop : '',
},
fileList: [
{
url: 'https://cdn.uviewui.com/uview/swiper/1.jpg',
name : '132',
},
{
url: 'https://cdn.uviewui.com/uview/swiper/2.jpg'
},
{
url: 'https://cdn.uviewui.com/uview/swiper/2.jpg'
},
{
url: 'https://cdn.uviewui.com/uview/swiper/2.jpg'
},
],
};
},
methods : {
deleteImage(e){
this.fileList.splice(e.index, 1)
},
afterRead(e){
this.fileList.push(...e.file)
},
submit(){},
preview(){},
draft(){},
}
}
</script>
<style lang="scss" scoped>
.publishPost{
background-color: #fff;
min-height: 100vh;
font-size: 28rpx;
/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;
}
.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;
}
}
}
}
</style>

Loading…
Cancel
Save