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

412 lines
8.6 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 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 year ago
1 year ago
1 year 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" v-if="isVedio">
  90. <view class="label">
  91. 作品
  92. </view>
  93. <view class="upload">
  94. <uv-upload :fileList="fileList" :maxCount="4" 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 { mapGetters } from 'vuex'
  129. import {
  130. mapState
  131. } from 'vuex'
  132. export default {
  133. components: {
  134. submit,
  135. confirmationPopup
  136. },
  137. data() {
  138. return {
  139. form: {
  140. title : '',
  141. context : '',//演员介绍
  142. },
  143. fileList: [//代表作
  144. // {
  145. // url: 'https://cdn.uviewui.com/uview/swiper/2.jpg'
  146. // },
  147. ],
  148. fileListImage: [],//封面
  149. upTopList: [],
  150. id: 0,
  151. };
  152. },
  153. computed : {
  154. topInfo(){
  155. for (var i = 0; i < this.upTopList.length; i++) {
  156. if(this.upTopList[i].id == this.form.topId){
  157. return this.upTopList[i]
  158. }
  159. }
  160. return {}
  161. },
  162. ...mapGetters(['isVedio']),
  163. },
  164. onLoad(options) {
  165. // this.$route.query的参数
  166. this.id = options.id
  167. },
  168. onShow() {
  169. this.getDateil()
  170. },
  171. methods: {
  172. getDateil(){
  173. if(!this.id){
  174. return
  175. }
  176. let self = this
  177. this.$api('indexGetGetWorkDetail', {
  178. id : this.id
  179. }, res => {
  180. if (res.code == 200) {
  181. res.result.details.image.split(',')
  182. .forEach(url => {
  183. self.fileListImage.push({
  184. url
  185. })
  186. })
  187. res.result.details.vod.split(',')
  188. .forEach(url => {
  189. self.fileList.push({
  190. url
  191. })
  192. })
  193. res.result.details.topId = res.result.details.topId || 0
  194. this.form = res.result.details
  195. }
  196. })
  197. },
  198. // 获取置顶方式
  199. indexTopPayList() {
  200. this.$api('indexTopPayList', res => {
  201. if (res.code == 200) {
  202. this.upTopList = res.result
  203. }
  204. })
  205. },
  206. // 删除图片
  207. deleteImage(e) {
  208. this.fileList.splice(e.index, 1)
  209. },
  210. // 上传作品
  211. afterRead(e) {
  212. let self = this
  213. e.file.forEach(file => {
  214. self.$Oss.ossUpload(file.url).then(url => {
  215. self.fileList.push({
  216. url
  217. })
  218. })
  219. })
  220. },
  221. deleteImage2(e) {
  222. this.fileListImage.splice(e.index, 1)
  223. },
  224. afterRead2(e) {
  225. let self = this
  226. e.file.forEach(file => {
  227. self.$Oss.ossUpload(file.url).then(url => {
  228. self.fileListImage.push({
  229. url
  230. })
  231. })
  232. })
  233. },
  234. pay() {
  235. let data = {
  236. // ...this.form,
  237. title : this.form.title,
  238. context : this.form.context,//演员介绍
  239. state : 0,
  240. vod : this.fileList.map((item) => item.url).join(","),
  241. image : this.fileListImage.map((item) => item.url).join(","),
  242. }
  243. if(this.id){
  244. data.id = this.id
  245. }
  246. this.$api('releaseWorks', data,
  247. res => {
  248. if (res.code == 200) {
  249. this.$refs.confirmationPopupUpload.open()
  250. }
  251. })
  252. },
  253. submit() {
  254. if(this.fileListImage.length == 0){
  255. return uni.showToast({
  256. title: '请上传封面',
  257. icon : 'none'
  258. })
  259. }
  260. if(this.fileList.length == 0 && this.isVedio){
  261. return uni.showToast({
  262. title: '请上传作品',
  263. icon : 'none'
  264. })
  265. }
  266. if (this.$utils.verificationAll(this.form, {
  267. title: '请输入标题',
  268. context: '请输入介绍',
  269. })) {
  270. return
  271. }
  272. if(this.form.topId){
  273. // 选择付费模式
  274. this.$refs.confirmationPopup.open()
  275. }else{
  276. // 没有选择付费
  277. this.pay()
  278. }
  279. },
  280. confirm() {
  281. // this.$refs.confirmationPopupUpload.close()
  282. // uni.navigateTo({
  283. // url: "/pages_mine/publish/competition"
  284. // })
  285. uni.navigateBack(-1)
  286. },
  287. }
  288. }
  289. </script>
  290. <style lang="scss" scoped>
  291. .actorRelease {
  292. background-color: #fff;
  293. min-height: 100vh;
  294. font-size: 28rpx;
  295. padding-bottom: 150rpx;
  296. /deep/ .uv-radio {
  297. margin-right: 25rpx;
  298. margin-top: 10rpx;
  299. }
  300. .box {
  301. padding: 0 20rpx;
  302. }
  303. .avatarFace {
  304. width: 150rpx;
  305. height: 150rpx;
  306. // border: 1px solid #000000;
  307. margin-left: 10rpx;
  308. }
  309. .upTop{
  310. margin-top: 40rpx;
  311. .title{
  312. padding-top: 20rpx;
  313. padding-left: 30rpx;
  314. border-top: 1px solid #00000015;
  315. display: flex;
  316. align-items: center;
  317. }
  318. .list{
  319. padding-top: 30rpx;
  320. width: 100%;
  321. .item{
  322. display: flex;
  323. padding: 20rpx;
  324. padding-left: 80rpx;
  325. justify-content: space-between;
  326. width: 600rpx;
  327. border-bottom: 1px solid #00000015;
  328. align-items: center;
  329. }
  330. }
  331. }
  332. .form {
  333. .label {
  334. padding: 20rpx;
  335. }
  336. .form-item {
  337. display: flex;
  338. align-items: center;
  339. justify-content: space-between;
  340. padding: 20rpx 0;
  341. padding-right: 30rpx;
  342. input {
  343. text-align: right;
  344. flex: 1;
  345. }
  346. }
  347. .form-item-content {
  348. padding-right: 30rpx;
  349. padding-top: 30rpx;
  350. .textarea {
  351. padding-left: 20rpx;
  352. }
  353. .upload {
  354. padding-left: 20rpx;
  355. }
  356. }
  357. }
  358. .confirmationPopup {
  359. display: flex;
  360. flex-direction: column;
  361. align-items: center;
  362. justify-content: center;
  363. width: 100%;
  364. height: 300rpx;
  365. image {
  366. margin-top: 40rpx;
  367. }
  368. .info {
  369. margin-top: 40rpx;
  370. font-size: 26rpx;
  371. }
  372. }
  373. }
  374. </style>