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

286 lines
5.4 KiB

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