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

11 months ago
11 months ago
10 months ago
11 months ago
11 months ago
11 months ago
10 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
10 months ago
11 months ago
10 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
10 months ago
11 months ago
10 months ago
11 months ago
10 months ago
11 months ago
10 months ago
11 months ago
11 months ago
11 months ago
10 months ago
10 months ago
11 months ago
11 months ago
10 months ago
11 months ago
10 months ago
10 months ago
10 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
  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="添加标题" v-model="form.title"/>
  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.day }}{{ item.money }}
  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 class="label">
  53. 是否置顶
  54. </view>
  55. <view class="textarea">
  56. <uv-radio-group v-model="form.isTop">
  57. <uv-radio size="35rpx" icon-size="35rpx" label="是" labelSize="28rpx" name="1">
  58. </uv-radio>
  59. <uv-radio size="35rpx" icon-size="35rpx" label="否" labelSize="28rpx" name="0">
  60. </uv-radio>
  61. </uv-radio-group>
  62. </view>
  63. </view>
  64. <view class="configBtn"
  65. @click="$refs.configPopup.open()">
  66. 发布须知
  67. </view>
  68. <submit
  69. @submit="submit"
  70. @preview="preview"
  71. @draft="draft"
  72. submitTitle="发布帖子"
  73. />
  74. <confirmationPopup
  75. ref="confirmationPopup"
  76. title="提示"
  77. @confirm="pay"
  78. confirmText="确认支付">
  79. <view class="confirmationPopup">
  80. <image src="/static/image/publish/pay.png"
  81. style="width: 150rpx;height: 150rpx;"
  82. mode=""></image>
  83. <view class="info">
  84. 确认支付3元可置顶1天
  85. </view>
  86. </view>
  87. </confirmationPopup>
  88. <confirmationPopup
  89. ref="confirmationPopupUpload"
  90. title="提示"
  91. @confirm="$utils.navigateTo('/index/index')"
  92. confirmText="确认">
  93. <view class="confirmationPopup">
  94. <image src="/static/image/publish/upload.png"
  95. style="width: 150rpx;height: 150rpx;"
  96. mode=""></image>
  97. <view class="info">
  98. 已由平台进行审核时间周期为24小时
  99. </view>
  100. </view>
  101. </confirmationPopup>
  102. <configPopup
  103. ref="configPopup"
  104. />
  105. </view>
  106. </template>
  107. <script>
  108. import submit from '@/components/content/submit.vue'
  109. import confirmationPopup from '@/components/toast/confirmationPopup.vue'
  110. export default {
  111. components : {
  112. submit,
  113. confirmationPopup
  114. },
  115. data() {
  116. return {
  117. upTopList : [],
  118. form : {
  119. // image : [],
  120. content : '',
  121. // upTop : '',
  122. title : '',
  123. },
  124. fileList: [
  125. // {
  126. // url: 'https://cdn.uviewui.com/uview/swiper/2.jpg'
  127. // },
  128. ],
  129. };
  130. },
  131. onShow() {
  132. // this.indexTopPayList()
  133. },
  134. methods : {
  135. deleteImage(e){
  136. this.fileList.splice(e.index, 1)
  137. },
  138. afterRead(e){
  139. let self = this
  140. e.file.forEach(file => {
  141. self.$Oss.ossUpload(file.url).then(url => {
  142. self.fileList.push({
  143. url
  144. })
  145. })
  146. })
  147. },
  148. indexTopPayList(){
  149. this.$api('indexTopPayList', res => {
  150. if(res.code == 200){
  151. this.upTopList = res.result
  152. }
  153. })
  154. },
  155. pay(){
  156. let arr = []
  157. this.fileList.forEach(n => {
  158. arr.push(n.url)
  159. })
  160. let data = {
  161. ...this.form,
  162. isCard : 1,
  163. image : arr.join(',')
  164. }
  165. this.$api('infoReleaseTrends', data,
  166. res => {
  167. if(res.code == 200){
  168. this.$refs.confirmationPopupUpload.open()
  169. }
  170. })
  171. },
  172. submit(){
  173. console.log(this.form);
  174. if(this.fileList.length == 0){
  175. return uni.showToast({
  176. title: '请上传图片',
  177. icon : 'none'
  178. })
  179. }
  180. if (this.$utils.verificationAll(this.form, {
  181. title: '请输入标题',
  182. content: '请输入正文',
  183. })) {
  184. return
  185. }
  186. console.log("图片集", this.fileList.map((item) => item.url).join(","))
  187. this.form.image = this.fileList.map((item) => item.url).join(",")
  188. this.$api('publishDynamicState', this.form, res => {
  189. if (res.code == 200) {
  190. this.$refs.confirmationPopupUpload.open()
  191. }
  192. })
  193. // if(this.form.upTop){
  194. // }else{
  195. // this.$refs.confirmationPopup.open()
  196. // }
  197. },
  198. preview(){},
  199. draft(){},
  200. }
  201. }
  202. </script>
  203. <style lang="scss" scoped>
  204. .publishPost{
  205. background-color: #fff;
  206. min-height: 100vh;
  207. font-size: 28rpx;
  208. padding-bottom: 150rpx;
  209. /deep/ .uv-textarea{
  210. background-color: transparent;
  211. border: none;
  212. }
  213. /deep/ .uv-textarea__count{
  214. background-color: transparent !important;
  215. }
  216. .box{
  217. padding: 0 20rpx;
  218. }
  219. .images{
  220. display: flex;
  221. flex-wrap: wrap;
  222. padding: 20rpx;
  223. }
  224. .title-input{
  225. border-bottom: 1px solid #00000015;
  226. padding-bottom: 25rpx;
  227. margin-bottom: 15rpx;
  228. }
  229. .content-input{
  230. min-height: 400rpx;
  231. }
  232. .upTop{
  233. .title{
  234. padding-top: 20rpx;
  235. padding-left: 30rpx;
  236. border-top: 1px solid #00000015;
  237. display: flex;
  238. align-items: center;
  239. }
  240. .list{
  241. padding-top: 30rpx;
  242. width: 100%;
  243. .item{
  244. display: flex;
  245. padding: 20rpx;
  246. padding-left: 80rpx;
  247. justify-content: space-between;
  248. width: 600rpx;
  249. border-bottom: 1px solid #00000015;
  250. align-items: center;
  251. }
  252. }
  253. }
  254. .configBtn{
  255. padding: 20rpx;
  256. color: #777;
  257. padding-top: 40rpx;
  258. font-size: 28rpx;
  259. }
  260. .confirmationPopup{
  261. display: flex;
  262. flex-direction: column;
  263. align-items: center;
  264. justify-content: center;
  265. width: 100%;
  266. height: 300rpx;
  267. image{
  268. margin-top: 40rpx;
  269. }
  270. .info{
  271. margin-top: 40rpx;
  272. font-size: 26rpx;
  273. }
  274. }
  275. }
  276. </style>