audioPlayListSet.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. <template>
  2. <view class="audio-play-list-set-page" @click.self="closeAttention">
  3. <view class="opt-intro-box" @click.stop="showAttention=true">
  4. <image class="icon" src="./static/icon-1.png" mode="aspectFill"/>
  5. <text>操作说明</text>
  6. </view>
  7. <view class="item" v-for="item in list" :key="item.report_chapter_id">
  8. <view>{{item.report_chapter_type_name}}</view>
  9. <switch :checked="item.is_close==0?true:false" color="#E3B377" style="transform:scale(0.9)" @change="handleStatusChange(item)"/>
  10. </view>
  11. <view class="attention-box" v-if="showAttention">
  12. <view>
  13. <text>章节音频</text>
  14. <text style="color:#E3B377">开启</text>
  15. <text>,表示添加到待播放列表;</text>
  16. </view>
  17. <view>
  18. <text style="color:#E3B377">点击此处关闭</text>
  19. <text>,表示从待播放列表中清除;</text>
  20. </view>
  21. <view>您可以根据自己关注的品种进行选择~</view>
  22. <image class="close-icon" src="./static/close2.png" mode="aspectFill" @click="closeAttention"/>
  23. </view>
  24. </view>
  25. </template>
  26. <script>
  27. import {apiReportDetail,apiReportChapterAudioSet} from '@/api/report'
  28. export default {
  29. data() {
  30. return {
  31. id:0,
  32. list:[],
  33. showAttention:false,
  34. }
  35. },
  36. onLoad(opt){
  37. this.id=opt.reportId||0
  38. this.getDetail()
  39. const show=uni.getStorageSync('showAttention')||'';
  40. if(!show){
  41. this.showAttention=true
  42. }
  43. },
  44. methods: {
  45. getDetail(){
  46. apiReportDetail({report_id:Number(this.id)}).then(res=>{
  47. if(res.code===200){
  48. this.list=res.data.report_chapter_list||[]
  49. }
  50. })
  51. },
  52. closeAttention(){
  53. uni.setStorageSync('showAttention', 'true');
  54. this.showAttention=false
  55. },
  56. handleStatusChange(item){
  57. console.log(item);
  58. apiReportChapterAudioSet({
  59. type_id:item.type_id,
  60. is_close:item.is_close==0?1:0
  61. }).then(res=>{
  62. if(res.code==200){
  63. item.is_close=item.is_close==0?1:0
  64. }
  65. })
  66. }
  67. },
  68. }
  69. </script>
  70. <style lang="scss" scoped>
  71. .audio-play-list-set-page{
  72. .item{
  73. display: flex;
  74. align-items: center;
  75. justify-content: space-between;
  76. border-bottom: 1px solid #e5e5e5;
  77. padding: 25rpx 34rpx;
  78. }
  79. .attention-box{
  80. position: fixed;
  81. top: 300rpx;
  82. right: 40rpx;
  83. z-index: 99;
  84. box-shadow: 0px 0px 10rpx 4rpx rgba(0, 0, 0, 0.16);
  85. background-color: #fff;
  86. padding: 20rpx 54rpx 20rpx 20rpx;
  87. border-radius: 4rpx;
  88. .close-icon{
  89. position: absolute;
  90. top: 50%;
  91. right: 20rpx;
  92. transform: translateY(-50%);
  93. width: 24rpx;
  94. height: 24rpx;
  95. }
  96. &::after{
  97. content: '';
  98. display: block;
  99. width: 0;
  100. height: 0;
  101. border: 10rpx solid transparent;
  102. border-bottom-color: #fff;
  103. position: absolute;
  104. top: -20rpx;
  105. right: 20rpx;
  106. }
  107. }
  108. .opt-intro-box{
  109. display: flex;
  110. justify-content: flex-end;
  111. padding-right: 34rpx;
  112. padding-top: 20rpx;
  113. padding-bottom: 20rpx;
  114. border-bottom: 1px solid #e5e5e5;
  115. .icon{
  116. width: 40rpx;
  117. height: 40rpx;
  118. }
  119. }
  120. }
  121. </style>