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

331 lines
6.5 KiB

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