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

558 lines
12 KiB

11 months ago
10 months ago
10 months ago
10 months ago
10 months ago
11 months ago
11 months ago
11 months ago
10 months ago
11 months ago
10 months ago
11 months ago
11 months ago
10 months ago
11 months ago
10 months ago
10 months ago
11 months ago
10 months ago
10 months ago
11 months ago
11 months ago
11 months ago
10 months ago
11 months ago
10 months ago
11 months ago
11 months ago
11 months ago
10 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 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
11 months ago
11 months ago
10 months ago
10 months ago
10 months ago
11 months ago
10 months ago
10 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
10 months ago
10 months ago
10 months ago
10 months ago
11 months ago
10 months ago
11 months ago
10 months ago
10 months ago
10 months ago
11 months ago
11 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
11 months ago
10 months ago
11 months ago
10 months ago
11 months ago
10 months ago
11 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
11 months ago
11 months ago
11 months ago
10 months ago
11 months ago
10 months ago
11 months ago
11 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.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">
  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 {
  187. mapState
  188. } from 'vuex'
  189. export default {
  190. components: {
  191. submit,
  192. confirmationPopup
  193. },
  194. data() {
  195. return {
  196. form: {
  197. money: '',
  198. name : '',
  199. phone : '',
  200. isUser : 'Y',//是否本人发布
  201. phonePay : 'Y',//联系方式是否付费查看
  202. photographerContent : '',//演员介绍
  203. topId : 0,
  204. },
  205. fileList: [//代表作
  206. // {
  207. // url: 'https://cdn.uviewui.com/uview/swiper/2.jpg'
  208. // },
  209. ],
  210. fileListImage: [],//封面
  211. upTopList: [],
  212. inputs : [],
  213. id : 0,
  214. };
  215. },
  216. onLoad(options) {
  217. // this.$route.query的参数
  218. this.id = options.id
  219. },
  220. computed : {
  221. topInfo(){
  222. for (var i = 0; i < this.upTopList.length; i++) {
  223. if(this.upTopList[i].id == this.form.topId){
  224. return this.upTopList[i]
  225. }
  226. }
  227. return {}
  228. }
  229. },
  230. onShow() {
  231. this.indexTopPayList()
  232. this.getDateil()
  233. },
  234. methods: {
  235. getDateil(){
  236. if(!this.id){
  237. return
  238. }
  239. let self = this
  240. this.$api('indexGetActorDetail', {
  241. id : this.id
  242. }, res => {
  243. if (res.code == 200) {
  244. res.result.details.image.split(',')
  245. .forEach(url => {
  246. self.fileListImage.push({
  247. url
  248. })
  249. })
  250. res.result.details.isImage.split(',')
  251. .forEach(url => {
  252. self.fileList.push({
  253. url
  254. })
  255. })
  256. res.result.details.workName && res.result.details.workName.split(',')
  257. .forEach(title => {
  258. self.inputs.push({
  259. title
  260. })
  261. })
  262. res.result.details.topId = res.result.details.topId || 0
  263. this.form = res.result.details
  264. }
  265. })
  266. },
  267. // 获取置顶方式
  268. indexTopPayList() {
  269. this.$api('indexTopPayList', res => {
  270. if (res.code == 200) {
  271. this.upTopList = res.result
  272. }
  273. })
  274. },
  275. // 删除图片
  276. deleteImage(e) {
  277. this.fileList.splice(e.index, 1)
  278. this.inputs.splice(e.index, 1)
  279. },
  280. // 上传作品
  281. afterRead(e) {
  282. let self = this
  283. e.file.forEach(file => {
  284. self.$Oss.ossUpload(file.url).then(url => {
  285. self.fileList.push({
  286. url
  287. })
  288. self.inputs.push({
  289. title : '',
  290. })
  291. })
  292. })
  293. },
  294. deleteImage2(e) {
  295. this.fileListImage.splice(e.index, 1)
  296. },
  297. afterRead2(e) {
  298. let self = this
  299. e.file.forEach(file => {
  300. self.$Oss.ossUpload(file.url).then(url => {
  301. self.fileListImage.push({
  302. url
  303. })
  304. })
  305. })
  306. },
  307. pay() {
  308. let self = this
  309. let data = {
  310. // ...this.form,
  311. money: this.form.money,
  312. name : this.form.name,
  313. phone : this.form.phone,
  314. isUser : this.form.isUser,//是否本人发布
  315. phonePay : this.form.phonePay,//联系方式是否付费查看
  316. photographerContent : this.form.photographerContent,//演员介绍
  317. topId : this.form.topId,
  318. state : 0,
  319. isCard: 'N',
  320. isImage : this.fileList.map((item) => item.url).join(","),//代表作视频列表
  321. image : this.fileListImage.map((item) => item.url).join(","),//封面
  322. workName : this.inputs.map((item) => item.title).join(","),//代表作名称列表
  323. isTop : this.form.topId ? 'Y' : 'N',
  324. }
  325. if(this.id){
  326. data.id = this.id
  327. }
  328. this.$api('publishActor', data,
  329. res => {
  330. if (res.code == 200) {
  331. // this.$refs.confirmationPopupUpload.open()
  332. if(self.form.topId && !this.id){
  333. uni.requestPayment({
  334. provider: 'wxpay', // 服务提提供商
  335. timeStamp: res.result.timeStamp, // 时间戳
  336. nonceStr: res.result.nonceStr, // 随机字符串
  337. package: res.result.packageValue,
  338. signType: res.result.signType, // 签名算法
  339. paySign: res.result.paySign, // 签名
  340. success: function (res) {
  341. console.log('支付成功',res);
  342. self.$refs.confirmationPopupUpload.open()
  343. // self.$refs.confirmationPopup.close()
  344. },
  345. fail: function (err) {
  346. console.log('支付失败',err);
  347. self.$refs.confirmationPopup.close()
  348. uni.showToast({
  349. icon:'none',
  350. title:"支付失败"
  351. })
  352. }
  353. });
  354. }else{
  355. self.$refs.confirmationPopupUpload.open()
  356. }
  357. }
  358. })
  359. },
  360. submit() {
  361. if(this.fileListImage.length == 0){
  362. return uni.showToast({
  363. title: '请上传封面',
  364. icon : 'none'
  365. })
  366. }
  367. // if(!this.$utils.verificationPhone(this.form.phone)){
  368. // return uni.showToast({
  369. // title: `请输入正确的手机号`,
  370. // icon : 'none'
  371. // })
  372. // }
  373. if (this.$utils.verificationAll(this.form, {
  374. name: '请输入演员名称',
  375. photographerContent: '请输入演员介绍',
  376. phone: '请输入手机号',
  377. money: '请输入价格',
  378. })) {
  379. return
  380. }
  381. if(this.fileList.length == 0){
  382. return uni.showToast({
  383. title: '请上传代表作',
  384. icon : 'none'
  385. })
  386. }
  387. for(let i = 0; i < this.inputs.length; i++){
  388. if(!this.inputs[i].title){
  389. return uni.showToast({
  390. title: `请输入第${i + 1}个代表作的名称`,
  391. icon : 'none'
  392. })
  393. }
  394. }
  395. if(this.form.topId && !this.id){
  396. // 选择付费模式
  397. this.$refs.confirmationPopup.open()
  398. }else{
  399. // 没有选择付费
  400. this.pay()
  401. }
  402. },
  403. confirm() {
  404. // this.$refs.confirmationPopupUpload.close()
  405. // uni.navigateTo({
  406. // url: "/pages/index/index"
  407. // })
  408. uni.navigateBack(-1)
  409. },
  410. }
  411. }
  412. </script>
  413. <style lang="scss" scoped>
  414. .actorRelease {
  415. background-color: #fff;
  416. min-height: 100vh;
  417. font-size: 28rpx;
  418. padding-bottom: 150rpx;
  419. /deep/ .uv-radio {
  420. margin-right: 25rpx;
  421. margin-top: 10rpx;
  422. }
  423. .box {
  424. padding: 0 20rpx;
  425. }
  426. .avatarFace {
  427. width: 150rpx;
  428. height: 150rpx;
  429. // border: 1px solid #000000;
  430. margin-left: 10rpx;
  431. }
  432. .upTop{
  433. margin-top: 40rpx;
  434. .title{
  435. padding-top: 20rpx;
  436. padding-left: 30rpx;
  437. border-top: 1px solid #00000015;
  438. display: flex;
  439. align-items: center;
  440. }
  441. .list{
  442. padding-top: 30rpx;
  443. width: 100%;
  444. .item{
  445. display: flex;
  446. padding: 20rpx;
  447. padding-left: 80rpx;
  448. justify-content: space-between;
  449. width: 600rpx;
  450. border-bottom: 1px solid #00000015;
  451. align-items: center;
  452. }
  453. }
  454. }
  455. .form {
  456. .label {
  457. padding: 20rpx;
  458. }
  459. .form-item {
  460. display: flex;
  461. align-items: center;
  462. justify-content: space-between;
  463. padding: 20rpx 0;
  464. padding-right: 30rpx;
  465. input {
  466. text-align: right;
  467. flex: 1;
  468. }
  469. }
  470. .form-item-content {
  471. padding-right: 30rpx;
  472. padding-top: 30rpx;
  473. .textarea {
  474. padding-left: 20rpx;
  475. }
  476. .upload {
  477. padding-left: 20rpx;
  478. .input{
  479. margin: 20rpx auto;
  480. border: 1px solid #00000022;
  481. padding: 20rpx;
  482. border-radius: 15rpx;
  483. input{
  484. }
  485. }
  486. }
  487. }
  488. }
  489. .confirmationPopup {
  490. display: flex;
  491. flex-direction: column;
  492. align-items: center;
  493. justify-content: center;
  494. width: 100%;
  495. height: 300rpx;
  496. image {
  497. margin-top: 40rpx;
  498. }
  499. .info {
  500. margin-top: 40rpx;
  501. font-size: 26rpx;
  502. }
  503. }
  504. }
  505. </style>