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

364 lines
7.8 KiB

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