聚星移动端

detialIndex.vue 4.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  1. <template>
  2. <view class="pageCon">
  3. <scroll-view scroll-y="true" class="dataBoxFather">
  4. <view v-for="(item,index) in dataList" :key="index" class="tMar20">
  5. <view class="infoBox">
  6. <view>
  7. <img v-if="item.img" :src="item.img" alt="" class="img">
  8. <img v-else src="../../static/defaultAvatar.png" alt="" class="img">
  9. </view>
  10. <view style="width: 100%">
  11. <view class="bigFont">{{item.name || '-'}}</view>
  12. <view class="flex-bewteen smallFont">
  13. <view>粉丝数:{{$NumberHandle(item.fans)}}</view>
  14. <view>任务ID:{{item.taskId || '-'}}</view>
  15. </view>
  16. </view>
  17. </view>
  18. <view class="dataBox">
  19. <view v-for="(sub,index) in item.list" :key="sub.key" class="itemBox">
  20. <view class="num">{{$NumberHandle(sub.val)}} <text v-if="sub.hasPercent">%</text></view>
  21. <view class="name">{{sub.name || '-'}}</view>
  22. </view>
  23. </view>
  24. </view>
  25. <theEnd v-if="dataList&&dataList.length>3"></theEnd>
  26. <noData v-if="dataList&&dataList.length==0&&showNoData"></noData>
  27. </scroll-view>
  28. </view>
  29. </template>
  30. <script>
  31. export default {
  32. data () {
  33. return {
  34. dataList:[],
  35. showNoData:true
  36. }
  37. },
  38. components:{},
  39. onLoad (option) {
  40. this.showNoData = false
  41. uni.setNavigationBarTitle({title: option.date + '(' + option.cusName + ')' })
  42. this.init(option)
  43. },
  44. onPullDownRefresh(){
  45. },
  46. onShow(){
  47. },
  48. onHide(){
  49. },
  50. onUnload(){
  51. },
  52. methods: {
  53. init(option){
  54. if(!option.cust_id || !option.date){
  55. uni.showToast({
  56. title: '传参错误',
  57. icon: 'none',
  58. duration: 2000
  59. })
  60. return
  61. }
  62. let paramsModel = {
  63. cust_id:option.cust_id,
  64. date:option.date,
  65. }
  66. this.$req(this.$api.Traffic_dailyList_detial, 'get', paramsModel,(res)=>{
  67. if (res && res.code == 0) {
  68. let resNew = res.data
  69. this.dataList = []
  70. if(resNew&&resNew.length>0){
  71. this.showNoData = false
  72. resNew.forEach(item=>{
  73. this.dataList.push({
  74. img:item.head_url,
  75. name:item.star_name,
  76. fans:item.fan,
  77. taskId:item.task_id,
  78. list:[
  79. {name:'消耗',val:item.consume_amount,key:'consume_amount'},
  80. {name:'播放数',val:item.play,key:'play'},
  81. {name:'行为数',val:item.action,key:'action'},
  82. {name:'激活数',val:item.conversion,key:'conversion'},
  83. {name:'表单提交数',val:item.submissions_number,key:'submissions_number'},
  84. {name:'表单提交数成本',val:item.sub_cpa,key:'sub_cpa'},
  85. {name:'行为率',val:item.ctr,key:'ctr',hasPercent:true},
  86. {name:'CPM',val:item.cpm,key:'cpm'},
  87. {name:'行为成本',val:item.cpc,key:'cpc'},
  88. {name:'激活成本',val:item.cpa,key:'cpa'},
  89. ]
  90. })
  91. })
  92. }else{
  93. this.showNoData = true
  94. }
  95. } else {
  96. uni.showToast({
  97. title: res.msg,
  98. icon: 'none',
  99. duration: 2000
  100. })
  101. }
  102. })
  103. },
  104. }
  105. }
  106. </script>
  107. <style>
  108. </style>
  109. <style lang="scss" scoped>
  110. .pageCon{
  111. background: #fff;
  112. height: 100vh;
  113. .dataBoxFather{
  114. height: 100vh;
  115. overflow-y: auto;
  116. padding: 0 40rpx;
  117. .infoBox{
  118. display: flex;
  119. align-items: center;
  120. .img{
  121. width: 88rpx;
  122. height: 88rpx;
  123. background: #D8D8D8;
  124. margin-right: 16rpx;
  125. border-radius: 50%;
  126. flex-shrink: 0;
  127. }
  128. .bigFont{
  129. font-size: 28rpx;
  130. font-weight: 600;
  131. color: #0D1546;
  132. }
  133. .smallFont{
  134. font-size: 24rpx;
  135. color: #666FA7;
  136. margin-top: 10rpx;
  137. }
  138. }
  139. .dataBox{
  140. background: #F0F7FF;
  141. border-radius: 12rpx;
  142. display: flex;
  143. flex-wrap: wrap;
  144. padding: 0;
  145. padding-bottom: 40rpx;
  146. margin-top: 12rpx;
  147. .itemBox{
  148. text-align: center;
  149. margin-top: 40rpx;
  150. width: 25%;
  151. .num{
  152. font-size: 32rpx;
  153. font-weight: 600;
  154. color: #0D1546;
  155. }
  156. .name{
  157. font-size: 24rpx;
  158. margin-top: 5rpx;
  159. color: rgba(13, 21, 70, .5);
  160. }
  161. }
  162. .rMar0{
  163. margin-right: 0;
  164. }
  165. }
  166. }
  167. }
  168. </style>