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

410 lines
8.5 KiB

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
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
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
  1. <template>
  2. <view class="actorRelease">
  3. <navbar leftClick @leftClick="$utils.navigateBack" title="作品发布" />
  4. <view class="images box">
  5. <view class="">
  6. 封面
  7. </view>
  8. <uv-upload
  9. :fileList="fileListImage"
  10. :maxCount="1"
  11. multiple
  12. width="150rpx"
  13. height="150rpx"
  14. @delete="deleteImage2"
  15. @afterRead="afterRead2"
  16. :previewFullImage="true"></uv-upload>
  17. </view>
  18. <view class="form">
  19. <view class="form-item">
  20. <view class="label">
  21. 标题
  22. </view>
  23. <input type="text" placeholder="请输入标题" v-model="form.title" />
  24. </view>
  25. <!-- <view class="form-item">
  26. <view class="label">
  27. 价格
  28. </view>
  29. <input type="number" placeholder="请输入价格" v-model="form.money" />
  30. </view> -->
  31. <!-- <view class="form-item">
  32. <view class="label">
  33. 地点
  34. </view>
  35. <input type="text" placeholder="请输入地点"/>
  36. </view>
  37. <view class="form-item">
  38. <view class="label">
  39. 时间
  40. </view>
  41. <input type="text" placeholder="请选择时间"/>
  42. </view> -->
  43. <!-- <view class="form-item">
  44. <view class="label">
  45. 联系方式
  46. </view>
  47. <input type="text" placeholder="请输入联系方式" v-model="form.phone" />
  48. </view> -->
  49. <view class="form-item-content">
  50. <view class="label">
  51. 详情介绍
  52. </view>
  53. <view class="textarea">
  54. <uv-textarea v-model="form.context" :maxlength="200" count placeholder="输入详情介绍"></uv-textarea>
  55. </view>
  56. </view>
  57. <!-- <view class="form-item-content">
  58. <view class="label">
  59. 发布人
  60. </view>
  61. <view class="textarea">
  62. <uv-radio-group v-model="form.isUser">
  63. <uv-radio size="35rpx"
  64. icon-size="35rpx"
  65. label="本人发布"
  66. labelSize="28rpx" name="1">
  67. </uv-radio>
  68. <uv-radio size="35rpx"
  69. icon-size="35rpx"
  70. label="经纪人发布"
  71. labelSize="28rpx" name="0">
  72. </uv-radio>
  73. </uv-radio-group>
  74. </view>
  75. </view> -->
  76. <!-- <view class="form-item-content">
  77. <view class="label">
  78. 联系方式是否付费查看建议付费避免无效联系
  79. </view>
  80. <view class="textarea">
  81. <uv-radio-group v-model="form.phonePay">
  82. <uv-radio size="35rpx" icon-size="35rpx" label="是" labelSize="28rpx" name="1">
  83. </uv-radio>
  84. <uv-radio size="35rpx" icon-size="35rpx" label="否" labelSize="28rpx" name="0">
  85. </uv-radio>
  86. </uv-radio-group>
  87. </view>
  88. </view> -->
  89. <view class="form-item-content">
  90. <view class="label">
  91. 作品
  92. </view>
  93. <view class="upload">
  94. <uv-upload :fileList="fileList" :maxCount="5" multiple accept="video" width="150rpx" height="150rpx"
  95. @delete="deleteImage" @afterRead="afterRead" :previewFullImage="true"></uv-upload>
  96. </view>
  97. </view>
  98. </view>
  99. <submit @submit="submit" @preview="preview" @draft="draft"
  100. :submitTitle="id ? '修改' : '发布'"/>
  101. <!-- <confirmationPopup
  102. ref="confirmationPopup"
  103. title="提示"
  104. @confirm="pay"
  105. confirmText="确认支付">
  106. <view class="confirmationPopup">
  107. <image src="/static/image/publish/pay.png"
  108. style="width: 150rpx;height: 150rpx;"
  109. mode=""></image>
  110. <view class="info">
  111. 确认支付{{ topInfo.money }}可置顶{{ topInfo.day }}
  112. </view>
  113. </view>
  114. </confirmationPopup> -->
  115. <confirmationPopup ref="confirmationPopupUpload" title="提示" confirmText="确认" @confirm="confirm()">
  116. <view class="confirmationPopup">
  117. <image src="/static/image/publish/upload.png" style="width: 150rpx;height: 150rpx;" mode=""></image>
  118. <view class="info">
  119. 已由平台进行审核时间周期为24小时
  120. </view>
  121. </view>
  122. </confirmationPopup>
  123. </view>
  124. </template>
  125. <script>
  126. import submit from '@/components/content/submit.vue'
  127. import confirmationPopup from '@/components/toast/confirmationPopup.vue'
  128. import {
  129. mapState
  130. } from 'vuex'
  131. export default {
  132. components: {
  133. submit,
  134. confirmationPopup
  135. },
  136. data() {
  137. return {
  138. form: {
  139. title : '',
  140. context : '',//演员介绍
  141. },
  142. fileList: [//代表作
  143. // {
  144. // url: 'https://cdn.uviewui.com/uview/swiper/2.jpg'
  145. // },
  146. ],
  147. fileListImage: [],//封面
  148. upTopList: [],
  149. id: 0,
  150. };
  151. },
  152. computed : {
  153. topInfo(){
  154. for (var i = 0; i < this.upTopList.length; i++) {
  155. if(this.upTopList[i].id == this.form.topId){
  156. return this.upTopList[i]
  157. }
  158. }
  159. return {}
  160. }
  161. },
  162. onLoad(options) {
  163. // this.$route.query的参数
  164. this.id = options.id
  165. },
  166. onShow() {
  167. this.getDateil()
  168. },
  169. methods: {
  170. getDateil(){
  171. if(!this.id){
  172. return
  173. }
  174. let self = this
  175. this.$api('indexGetGetWorkDetail', {
  176. id : this.id
  177. }, res => {
  178. if (res.code == 200) {
  179. res.result.details.image.split(',')
  180. .forEach(url => {
  181. self.fileListImage.push({
  182. url
  183. })
  184. })
  185. res.result.details.vod.split(',')
  186. .forEach(url => {
  187. self.fileList.push({
  188. url
  189. })
  190. })
  191. res.result.details.topId = res.result.details.topId || 0
  192. this.form = res.result.details
  193. }
  194. })
  195. },
  196. // 获取置顶方式
  197. indexTopPayList() {
  198. this.$api('indexTopPayList', res => {
  199. if (res.code == 200) {
  200. this.upTopList = res.result
  201. }
  202. })
  203. },
  204. // 删除图片
  205. deleteImage(e) {
  206. this.fileList.splice(e.index, 1)
  207. },
  208. // 上传作品
  209. afterRead(e) {
  210. let self = this
  211. e.file.forEach(file => {
  212. self.$Oss.ossUpload(file.url).then(url => {
  213. self.fileList.push({
  214. url
  215. })
  216. })
  217. })
  218. },
  219. deleteImage2(e) {
  220. this.fileListImage.splice(e.index, 1)
  221. },
  222. afterRead2(e) {
  223. let self = this
  224. e.file.forEach(file => {
  225. self.$Oss.ossUpload(file.url).then(url => {
  226. self.fileListImage.push({
  227. url
  228. })
  229. })
  230. })
  231. },
  232. pay() {
  233. let data = {
  234. // ...this.form,
  235. title : this.form.title,
  236. context : this.form.context,//演员介绍
  237. state : 0,
  238. vod : this.fileList.map((item) => item.url).join(","),
  239. image : this.fileListImage.map((item) => item.url).join(","),
  240. }
  241. if(this.id){
  242. data.id = this.id
  243. }
  244. this.$api('releaseWorks', data,
  245. res => {
  246. if (res.code == 200) {
  247. this.$refs.confirmationPopupUpload.open()
  248. }
  249. })
  250. },
  251. submit() {
  252. if(this.fileListImage.length == 0){
  253. return uni.showToast({
  254. title: '请上传封面',
  255. icon : 'none'
  256. })
  257. }
  258. if(this.fileList.length == 0){
  259. return uni.showToast({
  260. title: '请上传作品',
  261. icon : 'none'
  262. })
  263. }
  264. if (this.$utils.verificationAll(this.form, {
  265. title: '请输入标题',
  266. context: '请输入介绍',
  267. })) {
  268. return
  269. }
  270. if(this.form.topId){
  271. // 选择付费模式
  272. this.$refs.confirmationPopup.open()
  273. }else{
  274. // 没有选择付费
  275. this.pay()
  276. }
  277. },
  278. confirm() {
  279. // this.$refs.confirmationPopupUpload.close()
  280. // uni.navigateTo({
  281. // url: "/pages_mine/publish/competition"
  282. // })
  283. uni.navigateBack(-1)
  284. },
  285. }
  286. }
  287. </script>
  288. <style lang="scss" scoped>
  289. .actorRelease {
  290. background-color: #fff;
  291. min-height: 100vh;
  292. font-size: 28rpx;
  293. padding-bottom: 150rpx;
  294. /deep/ .uv-radio {
  295. margin-right: 25rpx;
  296. margin-top: 10rpx;
  297. }
  298. .box {
  299. padding: 0 20rpx;
  300. }
  301. .avatarFace {
  302. width: 150rpx;
  303. height: 150rpx;
  304. // border: 1px solid #000000;
  305. margin-left: 10rpx;
  306. }
  307. .upTop{
  308. margin-top: 40rpx;
  309. .title{
  310. padding-top: 20rpx;
  311. padding-left: 30rpx;
  312. border-top: 1px solid #00000015;
  313. display: flex;
  314. align-items: center;
  315. }
  316. .list{
  317. padding-top: 30rpx;
  318. width: 100%;
  319. .item{
  320. display: flex;
  321. padding: 20rpx;
  322. padding-left: 80rpx;
  323. justify-content: space-between;
  324. width: 600rpx;
  325. border-bottom: 1px solid #00000015;
  326. align-items: center;
  327. }
  328. }
  329. }
  330. .form {
  331. .label {
  332. padding: 20rpx;
  333. }
  334. .form-item {
  335. display: flex;
  336. align-items: center;
  337. justify-content: space-between;
  338. padding: 20rpx 0;
  339. padding-right: 30rpx;
  340. input {
  341. text-align: right;
  342. flex: 1;
  343. }
  344. }
  345. .form-item-content {
  346. padding-right: 30rpx;
  347. padding-top: 30rpx;
  348. .textarea {
  349. padding-left: 20rpx;
  350. }
  351. .upload {
  352. padding-left: 20rpx;
  353. }
  354. }
  355. }
  356. .confirmationPopup {
  357. display: flex;
  358. flex-direction: column;
  359. align-items: center;
  360. justify-content: center;
  361. width: 100%;
  362. height: 300rpx;
  363. image {
  364. margin-top: 40rpx;
  365. }
  366. .info {
  367. margin-top: 40rpx;
  368. font-size: 26rpx;
  369. }
  370. }
  371. }
  372. </style>