酷炫直播运营系统小程序版本

selfIndicators.vue 4.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  1. <template>
  2. <view class="drawerBox">
  3. <view class="explainTitle">设置自定义指标</view>
  4. <view class="explainTitle_small">勾选您关心的直播间数据指标,最少 <text class="css_4">4</text> 项</view>
  5. <view v-for="(d,didx) in dataList" :key="didx" class="dataList_item">
  6. <view class="bigTitle">{{d.group_name}}</view>
  7. <view>
  8. <view class="smallTitle" v-for="l in d.list" :key="l.key">
  9. <view @click="switchBox(l)">
  10. <view v-if="l.checked==1" class="iconfont icon-queren_icon"></view>
  11. <view class="chossenoBox" v-else></view>
  12. </view>
  13. {{l.name}}
  14. </view>
  15. </view>
  16. </view>
  17. <view class="footer">
  18. <view class="cancel" @click="closeDrawer">取消</view>
  19. <view class="confirm" @click="submitSelf">确定</view>
  20. </view>
  21. </view>
  22. </template>
  23. <script>
  24. export default {
  25. name: "selfIndicators",
  26. data(){
  27. return{
  28. dataList:[],
  29. opaFlag:true,//是否可以编辑,true可以
  30. }
  31. },
  32. methods:{
  33. judgeItemLen(){ //判断选中的个数
  34. this.opaFlag = true
  35. let columnok = []
  36. this.dataList.forEach(d=>{
  37. d.list.forEach(l=>{
  38. if(l.checked==1){
  39. columnok.push(l.key)
  40. }
  41. })
  42. })
  43. if(columnok.length <= 4){
  44. uni.showToast({
  45. title:'最少选择4项!',
  46. icon:'none',
  47. duration:2000
  48. })
  49. this.opaFlag = false
  50. }
  51. },
  52. get_all_dot(){
  53. this.$req(this.$api.search_config_all,'get',{
  54. type: "SMALLAPP_LIVE_EFFECT_LIST"
  55. },(res)=>{
  56. if(res && res.errno == 0){
  57. this.dataList = res.rst.seting
  58. }
  59. })
  60. },
  61. switchBox(l){
  62. if(l.checked == 1){
  63. this.judgeItemLen()
  64. if(this.opaFlag){
  65. l.checked = 0
  66. }
  67. }else{
  68. l.checked = 1
  69. }
  70. },
  71. closeDrawer(){
  72. this.$emit('closeindicatorDrawer',0)
  73. },
  74. submitSelf(){
  75. let columnok = []
  76. this.dataList.forEach(d=>{
  77. d.list.forEach(l=>{
  78. if(l.checked==1){
  79. columnok.push(l.key)
  80. }
  81. })
  82. })
  83. this.$req(this.$api.save_checked_status,'post',{
  84. type: "SMALLAPP_LIVE_EFFECT_LIST",
  85. column: columnok
  86. },(res)=>{
  87. uni.showToast({
  88. title:res.err,
  89. icon:'none',
  90. duration:2000
  91. })
  92. if(res&&res.errno == 0){
  93. this.$emit('closeindicatorDrawer',1)
  94. }
  95. })
  96. }
  97. }
  98. }
  99. </script>
  100. <style lang="scss" scoped>
  101. .drawerBox{
  102. background-color: #2A2C3B;
  103. height: 100%;
  104. width: 750rpx;
  105. color: #fff;
  106. padding: 60rpx 50rpx;
  107. .explainTitle{
  108. font-size: 36rpx;
  109. }
  110. .explainTitle_small{
  111. font-size: 24rpx;
  112. color: #757D9C;
  113. margin-top: 10rpx;
  114. .css_4{
  115. font-weight: 600;
  116. color: #fff;
  117. font-size: 34rpx;
  118. padding: 8rpx;
  119. }
  120. }
  121. .dataList_item{
  122. .bigTitle{
  123. font-size: 28rpx;
  124. color: #B1BADC;
  125. margin-top: 46rpx;
  126. }
  127. .smallTitle{
  128. font-size: 28rpx;
  129. width: 50%;
  130. margin-top: 20rpx;
  131. display: inline-flex;
  132. align-items: center;
  133. .chossenoBox{
  134. display: inline-block;
  135. width: 28rpx;
  136. height: 28rpx;
  137. border-radius: 2px;
  138. border: 1px solid #414452;
  139. margin-right: 12rpx;
  140. }
  141. .iconfont{
  142. font-size: 14rpx;
  143. display: inline-block;
  144. width: 28rpx;
  145. height: 28rpx;
  146. border-radius: 2px;
  147. margin-right: 12rpx;
  148. background: #4388FC;
  149. line-height: 28rpx;
  150. text-align: center;
  151. }
  152. }
  153. }
  154. .footer{
  155. margin-top: 80rpx;
  156. display: flex;
  157. align-items: center;
  158. justify-content: center;
  159. .cancel{
  160. font-size: 28rpx;
  161. color: #747474;
  162. border-radius: 4px;
  163. border: 1px solid #747474;
  164. padding: 20rpx 50rpx;
  165. }
  166. .confirm{
  167. font-size: 28rpx;
  168. color: #fff;
  169. border-radius: 4px;
  170. border: 1px solid #5B80F4;
  171. padding: 20rpx 50rpx;
  172. background: #5B80F4;
  173. margin-left: 20rpx;
  174. }
  175. }
  176. }
  177. </style>