帧视界壹通告,付费看视频的微信小程序
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.

188 lines
3.3 KiB

  1. <template>
  2. <view class="publishPost">
  3. <navbar
  4. leftClick
  5. @leftClick="$utils.navigateBack"
  6. title="发布帖子"/>
  7. <view class="images box">
  8. <uv-upload
  9. :fileList="fileList"
  10. :maxCount="5"
  11. multiple
  12. width="150rpx"
  13. height="150rpx"
  14. @delete="deleteImage"
  15. @afterRead="afterRead"
  16. :previewFullImage="true"></uv-upload>
  17. </view>
  18. <view class="title-input box">
  19. <input type="text" placeholder="添加标题"/>
  20. </view>
  21. <view class="content-input">
  22. <uv-textarea
  23. v-model="form.content"
  24. :maxlength="200"
  25. autoHeight
  26. count
  27. placeholder="添加正文"></uv-textarea>
  28. </view>
  29. <view class="upTop">
  30. <view class="title">
  31. <uv-icon name="pushpin-fill"></uv-icon>
  32. 是否置顶
  33. </view>
  34. <uv-radio-group v-model="form.upTop">
  35. <view class="list">
  36. <view class="item"
  37. v-for="(item, index) in upTopList"
  38. :key="index">
  39. <view class="left">
  40. {{ item.info }}
  41. </view>
  42. <view class="right">
  43. <uv-radio
  44. size="35rpx"
  45. icon-size="35rpx"
  46. :name="item.id">
  47. </uv-radio>
  48. </view>
  49. </view>
  50. </view>
  51. </uv-radio-group>
  52. </view>
  53. <submit
  54. @submit="submit"
  55. @preview="preview"
  56. @draft="draft"
  57. submitTitle="发布帖子"
  58. />
  59. </view>
  60. </template>
  61. <script>
  62. import submit from '@/components/content/submit.vue'
  63. import uvUpload from '@/uni_modules/uv-upload/components/uv-upload/uv-upload.vue'
  64. export default {
  65. components : {
  66. submit,
  67. uvUpload,
  68. },
  69. data() {
  70. return {
  71. upTopList : [
  72. {
  73. info : '置顶1天3元',
  74. id : 1,
  75. },
  76. {
  77. info : '置顶2天3元',
  78. id : 4,
  79. },
  80. {
  81. info : '置顶3天3元',
  82. id : 3,
  83. },
  84. {
  85. info : '置顶4天3元',
  86. id : 2,
  87. },
  88. ],
  89. form : {
  90. image : [],
  91. content : '',
  92. upTop : '',
  93. },
  94. fileList: [
  95. {
  96. url: 'https://cdn.uviewui.com/uview/swiper/2.jpg'
  97. },
  98. ],
  99. };
  100. },
  101. methods : {
  102. //上传图片
  103. uploadImage(){
  104. let self = this
  105. this.$Oss.ossUploadImage({
  106. success(res){
  107. self.form.images.push(res)
  108. }
  109. })
  110. },
  111. deleteImage(e){
  112. this.fileList.splice(e.index, 1)
  113. },
  114. afterRead(e){
  115. let self = this
  116. e.file.forEach(file => {
  117. self.$Oss.ossUpload(file.url).then(url => {
  118. self.fileList.push({
  119. url
  120. })
  121. })
  122. })
  123. },
  124. submit(){},
  125. preview(){},
  126. draft(){},
  127. }
  128. }
  129. </script>
  130. <style lang="scss" scoped>
  131. .publishPost{
  132. background-color: #fff;
  133. min-height: 100vh;
  134. font-size: 28rpx;
  135. /deep/ .uv-textarea{
  136. background-color: transparent;
  137. border: none;
  138. }
  139. /deep/ .uv-textarea__count{
  140. background-color: transparent !important;
  141. }
  142. .box{
  143. padding: 0 20rpx;
  144. }
  145. .images{
  146. display: flex;
  147. flex-wrap: wrap;
  148. padding: 20rpx;
  149. }
  150. .title-input{
  151. border-bottom: 1px solid #00000015;
  152. padding-bottom: 25rpx;
  153. margin-bottom: 15rpx;
  154. }
  155. .content-input{
  156. min-height: 400rpx;
  157. }
  158. .upTop{
  159. .title{
  160. padding-top: 20rpx;
  161. padding-left: 30rpx;
  162. border-top: 1px solid #00000015;
  163. display: flex;
  164. align-items: center;
  165. }
  166. .list{
  167. padding-top: 30rpx;
  168. width: 100%;
  169. .item{
  170. display: flex;
  171. padding: 20rpx;
  172. padding-left: 80rpx;
  173. justify-content: space-between;
  174. width: 600rpx;
  175. border-bottom: 1px solid #00000015;
  176. align-items: center;
  177. }
  178. }
  179. }
  180. }
  181. </style>