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

560 lines
12 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 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 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.name" />
  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="Y">
  67. </uv-radio>
  68. <uv-radio size="35rpx"
  69. icon-size="35rpx"
  70. label="经纪人发布"
  71. labelSize="28rpx" name="N">
  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="Y">
  83. </uv-radio>
  84. <uv-radio size="35rpx" icon-size="35rpx" label="否" labelSize="28rpx" name="N">
  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="textarea">
  94. <uv-radio-group v-model="form.isTop">
  95. <uv-radio size="35rpx" icon-size="35rpx" label="是" labelSize="28rpx" name="1">
  96. </uv-radio>
  97. <uv-radio size="35rpx" icon-size="35rpx" label="否" labelSize="28rpx" name="0">
  98. </uv-radio>
  99. </uv-radio-group>
  100. </view>
  101. </view> -->
  102. <view class="upTop">
  103. <view class="title">
  104. <uv-icon name="pushpin-fill"></uv-icon>
  105. 是否置顶
  106. </view>
  107. <uv-radio-group v-model="form.topId">
  108. <view class="list">
  109. <view class="item">
  110. <view class="left">
  111. 不需要置顶
  112. </view>
  113. <view class="right">
  114. <uv-radio
  115. size="35rpx"
  116. icon-size="35rpx"
  117. :disabled="!!id"
  118. :name="0">
  119. </uv-radio>
  120. </view>
  121. </view>
  122. <view class="item"
  123. v-for="(item, index) in upTopList"
  124. :key="index">
  125. <view class="left">
  126. 置顶{{ item.day }}{{ item.money }}
  127. </view>
  128. <view class="right">
  129. <uv-radio
  130. size="35rpx"
  131. icon-size="35rpx"
  132. :disabled="!!id"
  133. :name="item.id">
  134. </uv-radio>
  135. </view>
  136. </view>
  137. </view>
  138. </uv-radio-group>
  139. </view>
  140. <view class="form-item-content" v-if="isVedio">
  141. <view class="label">
  142. 代表作
  143. </view>
  144. <view class="upload">
  145. <view class="">
  146. </view>
  147. <uv-upload :fileList="fileList" :maxCount="4" multiple accept="video" width="150rpx" height="150rpx"
  148. @delete="deleteImage" @afterRead="afterRead" :previewFullImage="true"></uv-upload>
  149. <view class="input"
  150. v-for="(item, index) in inputs">
  151. <input type="text" v-model="item.title"
  152. :placeholder="`请输入第${index + 1}个代表作的名称`"/>
  153. </view>
  154. </view>
  155. </view>
  156. </view>
  157. <submit @submit="submit" @preview="preview" @draft="draft"
  158. :submitTitle="id ? '修改' : '发布'"/>
  159. <confirmationPopup
  160. ref="confirmationPopup"
  161. title="提示"
  162. @confirm="pay"
  163. confirmText="确认支付">
  164. <view class="confirmationPopup">
  165. <image src="/static/image/publish/pay.png"
  166. style="width: 150rpx;height: 150rpx;"
  167. mode=""></image>
  168. <view class="info">
  169. 确认支付{{ topInfo.money }}可置顶{{ topInfo.day }}
  170. </view>
  171. </view>
  172. </confirmationPopup>
  173. <confirmationPopup ref="confirmationPopupUpload" title="提示" confirmText="确认" @confirm="confirm()">
  174. <view class="confirmationPopup">
  175. <image src="/static/image/publish/upload.png" style="width: 150rpx;height: 150rpx;" mode=""></image>
  176. <view class="info">
  177. 已由平台进行审核时间周期为24小时
  178. </view>
  179. </view>
  180. </confirmationPopup>
  181. </view>
  182. </template>
  183. <script>
  184. import submit from '@/components/content/submit.vue'
  185. import confirmationPopup from '@/components/toast/confirmationPopup.vue'
  186. import { mapGetters } from 'vuex'
  187. import {
  188. mapState
  189. } from 'vuex'
  190. export default {
  191. components: {
  192. submit,
  193. confirmationPopup
  194. },
  195. data() {
  196. return {
  197. form: {
  198. money: '',
  199. name : '',
  200. phone : '',
  201. isUser : 'Y',//是否本人发布
  202. phonePay : 'Y',//联系方式是否付费查看
  203. photographerContent : '',//演员介绍
  204. topId : 0,
  205. },
  206. fileList: [//代表作
  207. // {
  208. // url: 'https://cdn.uviewui.com/uview/swiper/2.jpg'
  209. // },
  210. ],
  211. fileListImage: [],//封面
  212. upTopList: [],
  213. inputs : [],
  214. id : 0,
  215. };
  216. },
  217. onLoad(options) {
  218. // this.$route.query的参数
  219. this.id = options.id
  220. },
  221. computed : {
  222. topInfo(){
  223. for (var i = 0; i < this.upTopList.length; i++) {
  224. if(this.upTopList[i].id == this.form.topId){
  225. return this.upTopList[i]
  226. }
  227. }
  228. return {}
  229. },
  230. ...mapGetters(['isVedio']),
  231. },
  232. onShow() {
  233. this.indexTopPayList()
  234. this.getDateil()
  235. },
  236. methods: {
  237. getDateil(){
  238. if(!this.id){
  239. return
  240. }
  241. let self = this
  242. this.$api('indexGetActorDetail', {
  243. id : this.id
  244. }, res => {
  245. if (res.code == 200) {
  246. res.result.details.image.split(',')
  247. .forEach(url => {
  248. self.fileListImage.push({
  249. url
  250. })
  251. })
  252. res.result.details.isImage.split(',')
  253. .forEach(url => {
  254. self.fileList.push({
  255. url
  256. })
  257. })
  258. res.result.details.workName && res.result.details.workName.split(',')
  259. .forEach(title => {
  260. self.inputs.push({
  261. title
  262. })
  263. })
  264. res.result.details.topId = res.result.details.topId || 0
  265. this.form = res.result.details
  266. }
  267. })
  268. },
  269. // 获取置顶方式
  270. indexTopPayList() {
  271. this.$api('indexTopPayList', res => {
  272. if (res.code == 200) {
  273. this.upTopList = res.result
  274. }
  275. })
  276. },
  277. // 删除图片
  278. deleteImage(e) {
  279. this.fileList.splice(e.index, 1)
  280. this.inputs.splice(e.index, 1)
  281. },
  282. // 上传作品
  283. afterRead(e) {
  284. let self = this
  285. e.file.forEach(file => {
  286. self.$Oss.ossUpload(file.url).then(url => {
  287. self.fileList.push({
  288. url
  289. })
  290. self.inputs.push({
  291. title : '',
  292. })
  293. })
  294. })
  295. },
  296. deleteImage2(e) {
  297. this.fileListImage.splice(e.index, 1)
  298. },
  299. afterRead2(e) {
  300. let self = this
  301. e.file.forEach(file => {
  302. self.$Oss.ossUpload(file.url).then(url => {
  303. self.fileListImage.push({
  304. url
  305. })
  306. })
  307. })
  308. },
  309. pay() {
  310. let self = this
  311. let data = {
  312. // ...this.form,
  313. money: this.form.money,
  314. name : this.form.name,
  315. phone : this.form.phone,
  316. isUser : this.form.isUser,//是否本人发布
  317. phonePay : this.form.phonePay,//联系方式是否付费查看
  318. photographerContent : this.form.photographerContent,//演员介绍
  319. topId : this.form.topId,
  320. state : 0,
  321. isCard: 'N',
  322. isImage : this.fileList.map((item) => item.url).join(","),//代表作视频列表
  323. image : this.fileListImage.map((item) => item.url).join(","),//封面
  324. workName : this.inputs.map((item) => item.title).join(","),//代表作名称列表
  325. isTop : this.form.topId ? 'Y' : 'N',
  326. }
  327. if(this.id){
  328. data.id = this.id
  329. }
  330. this.$api('publishActor', data,
  331. res => {
  332. if (res.code == 200) {
  333. // this.$refs.confirmationPopupUpload.open()
  334. if(self.form.topId && !this.id){
  335. uni.requestPayment({
  336. provider: 'wxpay', // 服务提提供商
  337. timeStamp: res.result.timeStamp, // 时间戳
  338. nonceStr: res.result.nonceStr, // 随机字符串
  339. package: res.result.packageValue,
  340. signType: res.result.signType, // 签名算法
  341. paySign: res.result.paySign, // 签名
  342. success: function (res) {
  343. console.log('支付成功',res);
  344. self.$refs.confirmationPopupUpload.open()
  345. // self.$refs.confirmationPopup.close()
  346. },
  347. fail: function (err) {
  348. console.log('支付失败',err);
  349. self.$refs.confirmationPopup.close()
  350. uni.showToast({
  351. icon:'none',
  352. title:"支付失败"
  353. })
  354. }
  355. });
  356. }else{
  357. self.$refs.confirmationPopupUpload.open()
  358. }
  359. }
  360. })
  361. },
  362. submit() {
  363. if(this.fileListImage.length == 0){
  364. return uni.showToast({
  365. title: '请上传封面',
  366. icon : 'none'
  367. })
  368. }
  369. // if(!this.$utils.verificationPhone(this.form.phone)){
  370. // return uni.showToast({
  371. // title: `请输入正确的手机号`,
  372. // icon : 'none'
  373. // })
  374. // }
  375. if (this.$utils.verificationAll(this.form, {
  376. name: '请输入演员名称',
  377. photographerContent: '请输入演员介绍',
  378. phone: '请输入手机号',
  379. money: '请输入价格',
  380. })) {
  381. return
  382. }
  383. if(this.fileList.length == 0 && this.isVedio){
  384. return uni.showToast({
  385. title: '请上传代表作',
  386. icon : 'none'
  387. })
  388. }
  389. for(let i = 0; i < this.inputs.length; i++){
  390. if(!this.inputs[i].title){
  391. return uni.showToast({
  392. title: `请输入第${i + 1}个代表作的名称`,
  393. icon : 'none'
  394. })
  395. }
  396. }
  397. if(this.form.topId && !this.id){
  398. // 选择付费模式
  399. this.$refs.confirmationPopup.open()
  400. }else{
  401. // 没有选择付费
  402. this.pay()
  403. }
  404. },
  405. confirm() {
  406. // this.$refs.confirmationPopupUpload.close()
  407. // uni.navigateTo({
  408. // url: "/pages/index/index"
  409. // })
  410. uni.navigateBack(-1)
  411. },
  412. }
  413. }
  414. </script>
  415. <style lang="scss" scoped>
  416. .actorRelease {
  417. background-color: #fff;
  418. min-height: 100vh;
  419. font-size: 28rpx;
  420. padding-bottom: 150rpx;
  421. /deep/ .uv-radio {
  422. margin-right: 25rpx;
  423. margin-top: 10rpx;
  424. }
  425. .box {
  426. padding: 0 20rpx;
  427. }
  428. .avatarFace {
  429. width: 150rpx;
  430. height: 150rpx;
  431. // border: 1px solid #000000;
  432. margin-left: 10rpx;
  433. }
  434. .upTop{
  435. margin-top: 40rpx;
  436. .title{
  437. padding-top: 20rpx;
  438. padding-left: 30rpx;
  439. border-top: 1px solid #00000015;
  440. display: flex;
  441. align-items: center;
  442. }
  443. .list{
  444. padding-top: 30rpx;
  445. width: 100%;
  446. .item{
  447. display: flex;
  448. padding: 20rpx;
  449. padding-left: 80rpx;
  450. justify-content: space-between;
  451. width: 600rpx;
  452. border-bottom: 1px solid #00000015;
  453. align-items: center;
  454. }
  455. }
  456. }
  457. .form {
  458. .label {
  459. padding: 20rpx;
  460. }
  461. .form-item {
  462. display: flex;
  463. align-items: center;
  464. justify-content: space-between;
  465. padding: 20rpx 0;
  466. padding-right: 30rpx;
  467. input {
  468. text-align: right;
  469. flex: 1;
  470. }
  471. }
  472. .form-item-content {
  473. padding-right: 30rpx;
  474. padding-top: 30rpx;
  475. .textarea {
  476. padding-left: 20rpx;
  477. }
  478. .upload {
  479. padding-left: 20rpx;
  480. .input{
  481. margin: 20rpx auto;
  482. border: 1px solid #00000022;
  483. padding: 20rpx;
  484. border-radius: 15rpx;
  485. input{
  486. }
  487. }
  488. }
  489. }
  490. }
  491. .confirmationPopup {
  492. display: flex;
  493. flex-direction: column;
  494. align-items: center;
  495. justify-content: center;
  496. width: 100%;
  497. height: 300rpx;
  498. image {
  499. margin-top: 40rpx;
  500. }
  501. .info {
  502. margin-top: 40rpx;
  503. font-size: 26rpx;
  504. }
  505. }
  506. }
  507. </style>