voice.js 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. // 语音播报模块
  2. import { httpGet, httpPost } from "@/utils/request.js";
  3. /**
  4. * 语音列表
  5. * @param page_index
  6. * @param page_size
  7. * @param broadcast_id 语音id
  8. * @param section_id 板块id
  9. * @param author_id 作者ID(我的语音播报列表)
  10. * @param mine_status 语音播报状态:0-未发布 1-已发布 2-全部(我的语音播报列表)
  11. */
  12. export const apiVoiceList=params=>{
  13. return httpPost('/voice/broadcast/list',params)
  14. }
  15. /**
  16. * 语音板块列表
  17. */
  18. export const apiVoiceSectionList=()=>{
  19. return httpGet('/voice/broadcast/section/list',{})
  20. }
  21. /**
  22. * 删除语音
  23. * @param broadcast_id
  24. */
  25. export const apiVoiceDel=params=>{
  26. return httpGet('/voice/broadcast/delete',params)
  27. }
  28. /**
  29. * 播放记录
  30. * @param broadcast_id
  31. * @param source 来源平台:1:小程序、2:小程序(pc)、3:公众号、4:官网web(pc)
  32. */
  33. export const apiVoicePlayRecord=params=>{
  34. return httpPost('/voice/broadcast/statistics/add',{...params,source:1})
  35. }
  36. /**
  37. * 语音详情
  38. * @param broadcast_id
  39. */
  40. export const apiVoiceDetail=params=>{
  41. return httpGet('/voice/broadcast/detail',params)
  42. }
  43. /**
  44. * 推送客群、模板消息
  45. * @param broadcast_id
  46. */
  47. export const apiVoiceSendMsg=params=>{
  48. return httpPost('/voice/broadcast/msg_send',params)
  49. }
  50. /**
  51. * 新增语音
  52. * @param broadcast_name 语音标题
  53. * @param section_id 板块ID
  54. * @param section_name 板块名称
  55. * @param variety_id 品种ID
  56. * @param variety_name 品种名称
  57. * @param author_id 作者ID
  58. * @param author 作者名称
  59. * @param imgs 图片:英文逗号拼接
  60. * @param voice_seconds 音频时长
  61. * @param voice_size 音频大小
  62. * @param voice_url 音频地址
  63. */
  64. export const apiVoiceAdd=params=>{
  65. return httpPost('/voice/broadcast/add',params)
  66. }
  67. /**
  68. * 编辑语音
  69. * @param broadcast_id 语音播报ID
  70. * @param broadcast_name 语音标题
  71. * @param section_id 板块ID
  72. * @param section_name 板块名称
  73. * @param variety_id 品种ID
  74. * @param variety_name 品种名称
  75. * @param author_id 作者ID
  76. * @param author 作者名称
  77. * @param imgs 图片:英文逗号拼接
  78. * @param voice_seconds 音频时长
  79. * @param voice_size 音频大小
  80. * @param voice_url 音频地址
  81. */
  82. export const apiVoiceEdit=params=>{
  83. return httpPost('/voice/broadcast/edit',params)
  84. }
  85. /**
  86. * 发布语音
  87. * @param broadcast_id 语音播报ID
  88. * @param publish_type 发布类型:1-发布 2-定时发布
  89. * @param pre_publish_time 预发布时间(类型为定时发布时必填)
  90. */
  91. export const apiVoicePublish=params=>{
  92. return httpPost('/voice/broadcast/publish',params)
  93. }
  94. /**
  95. * 我的语音数量统计
  96. * @param author_id
  97. */
  98. export const apiMyVoiceCount=params=>{
  99. return httpGet('/voice/broadcast/list_count',params)
  100. }