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

367 lines
7.8 KiB

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.photographerContent" :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. <!-- <confirmationPopup
  101. ref="confirmationPopup"
  102. title="提示"
  103. @confirm="pay"
  104. confirmText="确认支付">
  105. <view class="confirmationPopup">
  106. <image src="/static/image/publish/pay.png"
  107. style="width: 150rpx;height: 150rpx;"
  108. mode=""></image>
  109. <view class="info">
  110. 确认支付{{ topInfo.money }}可置顶{{ topInfo.day }}
  111. </view>
  112. </view>
  113. </confirmationPopup> -->
  114. <confirmationPopup ref="confirmationPopupUpload" title="提示" confirmText="确认" @confirm="confirm()">
  115. <view class="confirmationPopup">
  116. <image src="/static/image/publish/upload.png" style="width: 150rpx;height: 150rpx;" mode=""></image>
  117. <view class="info">
  118. 已由平台进行审核时间周期为24小时
  119. </view>
  120. </view>
  121. </confirmationPopup>
  122. </view>
  123. </template>
  124. <script>
  125. import submit from '@/components/content/submit.vue'
  126. import confirmationPopup from '@/components/toast/confirmationPopup.vue'
  127. import {
  128. mapState
  129. } from 'vuex'
  130. export default {
  131. components: {
  132. submit,
  133. confirmationPopup
  134. },
  135. data() {
  136. return {
  137. form: {
  138. title : '',
  139. photographerContent : '',//演员介绍
  140. },
  141. fileList: [//代表作
  142. // {
  143. // url: 'https://cdn.uviewui.com/uview/swiper/2.jpg'
  144. // },
  145. ],
  146. fileListImage: [],//封面
  147. upTopList: [],
  148. };
  149. },
  150. computed : {
  151. topInfo(){
  152. for (var i = 0; i < this.upTopList.length; i++) {
  153. if(this.upTopList[i].id == this.form.topId){
  154. return this.upTopList[i]
  155. }
  156. }
  157. return {}
  158. }
  159. },
  160. onShow() {
  161. // this.indexTopPayList()
  162. },
  163. methods: {
  164. // 获取置顶方式
  165. indexTopPayList() {
  166. this.$api('indexTopPayList', res => {
  167. if (res.code == 200) {
  168. this.upTopList = res.result
  169. }
  170. })
  171. },
  172. // 删除图片
  173. deleteImage(e) {
  174. this.fileList.splice(e.index, 1)
  175. },
  176. // 上传作品
  177. afterRead(e) {
  178. let self = this
  179. e.file.forEach(file => {
  180. self.$Oss.ossUpload(file.url).then(url => {
  181. self.fileList.push({
  182. url
  183. })
  184. })
  185. })
  186. },
  187. deleteImage2(e) {
  188. this.fileListImage.splice(e.index, 1)
  189. },
  190. afterRead2(e) {
  191. let self = this
  192. e.file.forEach(file => {
  193. self.$Oss.ossUpload(file.url).then(url => {
  194. self.fileListImage.push({
  195. url
  196. })
  197. })
  198. })
  199. },
  200. pay() {
  201. let data = {
  202. ...this.form,
  203. isCard: 1,
  204. isImage : this.fileList.map((item) => item.url).join(","),
  205. image : this.fileListImage.map((item) => item.url).join(","),
  206. isTop : this.form.topId ? 'Y' : 'N',
  207. }
  208. this.$api('publishActor', data,
  209. res => {
  210. if (res.code == 200) {
  211. this.$refs.confirmationPopupUpload.open()
  212. }
  213. })
  214. },
  215. submit() {
  216. if(this.fileListImage.length == 0){
  217. return uni.showToast({
  218. title: '请上传封面',
  219. icon : 'none'
  220. })
  221. }
  222. if(this.fileList.length == 0){
  223. return uni.showToast({
  224. title: '请上传代表作',
  225. icon : 'none'
  226. })
  227. }
  228. if (this.$utils.verificationAll(this.form, {
  229. title: '请输入标题',
  230. photographerContent: '请输入演员介绍',
  231. phone: '请输入手机号',
  232. money: '请输入价格',
  233. })) {
  234. return
  235. }
  236. if(this.form.topId){
  237. // 选择付费模式
  238. this.$refs.confirmationPopup.open()
  239. }else{
  240. // 没有选择付费
  241. this.pay()
  242. }
  243. },
  244. confirm() {
  245. // this.$refs.confirmationPopupUpload.close()
  246. uni.navigateTo({
  247. url: "/pages/index/index"
  248. })
  249. },
  250. }
  251. }
  252. </script>
  253. <style lang="scss" scoped>
  254. .actorRelease {
  255. background-color: #fff;
  256. min-height: 100vh;
  257. font-size: 28rpx;
  258. padding-bottom: 150rpx;
  259. /deep/ .uv-radio {
  260. margin-right: 25rpx;
  261. margin-top: 10rpx;
  262. }
  263. .box {
  264. padding: 0 20rpx;
  265. }
  266. .avatarFace {
  267. width: 150rpx;
  268. height: 150rpx;
  269. // border: 1px solid #000000;
  270. margin-left: 10rpx;
  271. }
  272. .upTop{
  273. margin-top: 40rpx;
  274. .title{
  275. padding-top: 20rpx;
  276. padding-left: 30rpx;
  277. border-top: 1px solid #00000015;
  278. display: flex;
  279. align-items: center;
  280. }
  281. .list{
  282. padding-top: 30rpx;
  283. width: 100%;
  284. .item{
  285. display: flex;
  286. padding: 20rpx;
  287. padding-left: 80rpx;
  288. justify-content: space-between;
  289. width: 600rpx;
  290. border-bottom: 1px solid #00000015;
  291. align-items: center;
  292. }
  293. }
  294. }
  295. .form {
  296. .label {
  297. padding: 20rpx;
  298. }
  299. .form-item {
  300. display: flex;
  301. align-items: center;
  302. justify-content: space-between;
  303. padding: 20rpx 0;
  304. padding-right: 30rpx;
  305. input {
  306. text-align: right;
  307. flex: 1;
  308. }
  309. }
  310. .form-item-content {
  311. padding-right: 30rpx;
  312. padding-top: 30rpx;
  313. .textarea {
  314. padding-left: 20rpx;
  315. }
  316. .upload {
  317. padding-left: 20rpx;
  318. }
  319. }
  320. }
  321. .confirmationPopup {
  322. display: flex;
  323. flex-direction: column;
  324. align-items: center;
  325. justify-content: center;
  326. width: 100%;
  327. height: 300rpx;
  328. image {
  329. margin-top: 40rpx;
  330. }
  331. .info {
  332. margin-top: 40rpx;
  333. font-size: 26rpx;
  334. }
  335. }
  336. }
  337. </style>