flow-detail.vue 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332
  1. <template>
  2. <view class="">
  3. <view class="box-pack-between header-hg100 flex-y-center ">
  4. <text class="ft32">展示时间</text>
  5. <view class="flex-y-center ft26 header-text">
  6. <text data-text="1" :class="act_index==1?'act':''" @click="bindDeta">近7日</text>
  7. <text data-text="2" :class="act_index==2?'act':''" @click="bindDeta">近30日</text>
  8. <view class="flex-y-center" data-text="3" :class="act_index==3?'act':''" @click="bindDeta">
  9. 自定义
  10. <image class="sanjiao" :src="'../../static/images/'+(act_index==3?'sanjian2':'sanjian')+'.png'" mode=""></image>
  11. </view>
  12. </view>
  13. </view>
  14. <!-- <view class="model" @click="bindMedel" v-if="is_model">
  15. <view class="" @click.stop="bindMedes">
  16. <view class=" model-item ">
  17. <picker mode='date' :value="start" :start="startDate"
  18. :end="endDate" @change="bindDateChange1">
  19. <view class="box-pack-between">
  20. <text>开始时间</text>
  21. <text :style="'color:'+(start=='请选择'?'#999':'')">{{start}}</text>
  22. </view>
  23. </picker>
  24. </view>
  25. <view class=" model-item ">
  26. <picker mode='date' :value="end" :start="startDate" :end="endDate" @change="bindDateChange2">
  27. <view class="box-pack-between">
  28. <text>结束时间</text>
  29. <text :style="'color:'+(end=='请选择'?'#999':'')">{{end}}</text>
  30. </view>
  31. </picker>
  32. </view>
  33. </view>
  34. </view> -->
  35. <uni-popup-top ref="popup" type="top" :top="top" :maskClass="maskClass">
  36. <view class="model">
  37. <view class="flex-y-center box-pack-between model-date">
  38. <view class="model-item" :class="time_index==1?'act':''">
  39. <picker mode='date' :value="start" :start="startDate" :end="endDate" @change="bindDateChange1" data-index="1">
  40. <view class="flex-center">
  41. <text>{{start}}</text>
  42. </view>
  43. </picker>
  44. </view>
  45. <text>至</text>
  46. <view class="model-item" :class="time_index2==2?'act':''">
  47. <picker mode='date' :value="end" :start="startDate" :end="endDate" @change="bindDateChange2" data-index="2">
  48. <view class="flex-center">
  49. <text>{{end}}</text>
  50. </view>
  51. </picker>
  52. </view>
  53. </view>
  54. <view class="model-btn flex-center" @click="sure">
  55. 确定
  56. </view>
  57. </view>
  58. </uni-popup-top>
  59. <view style="height: 172rpx"></view>
  60. <view class="main-flow">
  61. <view class="row tab-h sticky">
  62. <view class="td">日期</view>
  63. <view class="td">曝光量</view>
  64. <view class="td">收入</view>
  65. <view class="td">eCPM</view>
  66. </view>
  67. <view class="row" v-for="(item,index) in list" :key="item.id">
  68. <view class="td">{{item.date}}</view>
  69. <view class="td">{{item.count}}</view>
  70. <view class="td">{{item.money}}</view>
  71. <view class="td">{{item.ecpm}}</view>
  72. </view>
  73. </view>
  74. </view>
  75. </template>
  76. <script>
  77. import uniPopupTop from '@/components/zx-uni-popup/uni-popup-top.vue'
  78. export default {
  79. components: {
  80. uniPopupTop,
  81. },
  82. data() {
  83. return {
  84. startDate: "2020-10-01",
  85. endDate: "2030-10-01",
  86. list: [
  87. ],
  88. time_index: 0,
  89. time_index2: 0,
  90. act_index: 1,
  91. start: "开始时间",
  92. end: "结束时间",
  93. day:7,
  94. page:1,
  95. top:"100rpx",
  96. maskClass: {
  97. 'position': 'fixed',
  98. 'bottom': 0,
  99. 'top': "100rpx",
  100. 'left': 0,
  101. 'right': 0,
  102. 'backgroundColor': 'rgba(0, 0, 0, 0.4)'
  103. },
  104. }
  105. },
  106. onLoad() {
  107. this.AdvertiserLog();
  108. },
  109. onReachBottom(e) {
  110. this.AdvertiserLog();
  111. },
  112. methods: {
  113. bindDeta(e) {
  114. this.act_index = e.currentTarget.dataset.text;
  115. this.day=this.act_index==1?7:this.act_index==2?30:'';
  116. if (this.act_index == 3) {
  117. this.$refs.popup.open();
  118. return
  119. }
  120. this.start ="开始时间";
  121. this.end ="结束时间";
  122. this.time_index =0;
  123. this.time_index2 =0;
  124. this.clear();
  125. // this.AdvertiserLog();
  126. },
  127. // bindDateChange1(e) {
  128. // this.start = e.target.value;
  129. // this.page=1;
  130. // this.list =[];
  131. // this.AdvertiserLog();
  132. // },
  133. // bindDateChange2(e) {
  134. // this.end = e.target.value;
  135. // this.page=1;
  136. // this.list =[];
  137. // this.AdvertiserLog();
  138. // },
  139. bindDateChange1(e) {
  140. this.time_index = e.currentTarget.dataset.index;
  141. this.start = e.target.value;
  142. },
  143. bindDateChange2(e) {
  144. this.time_index2 = e.currentTarget.dataset.index;
  145. this.end = e.target.value;
  146. },
  147. sure(e) {
  148. // this.time = this.start + " - " + this.end;
  149. this.clear();
  150. this.$refs.popup.close();
  151. },
  152. clear() {
  153. this.page = 1;
  154. this.list = [];
  155. this.AdvertiserLog();
  156. },
  157. AdvertiserLog() {
  158. this.request({
  159. url: "Advertiser/AdvertiserLog",
  160. data: {
  161. token: uni.getStorageSync("token"),
  162. day:this.day,
  163. start:this.start=='开始时间'?'':this.start,
  164. end:this.end=='结束时间'?'':this.end,
  165. page:this.page,
  166. limit:20,
  167. },
  168. }).then(res => {
  169. console.log(res, "res")
  170. if (res.code === '200') {
  171. this.page=this.page+1;
  172. this.list =this.list.concat(res.data);
  173. }
  174. }).catch((res) => {
  175. uni.showToast({
  176. title: res.message,
  177. icon: 'none'
  178. })
  179. });
  180. },
  181. }
  182. }
  183. </script>
  184. <style lang="scss">
  185. .model {
  186. width: 100%;
  187. z-index: 10;
  188. background: #FFFFFF;
  189. padding-bottom: 20rpx;
  190. .model-date {
  191. width: 100%;
  192. padding: 20rpx 80rpx;
  193. border-bottom: 1rpx solid #F1F1F1;
  194. .model-item {
  195. width: 225rpx;
  196. text-align: center;
  197. font-size: 28rpx;
  198. color: #999;
  199. position: relative;
  200. padding: 10rpx 0;
  201. text-align: center;
  202. border-radius: 8rpx;
  203. border: 1rpx solid #999;
  204. }
  205. .act {
  206. color: #FFFFFF;
  207. background: #FFBE2C;
  208. border: 1rpx solid #FFBE2C;
  209. }
  210. }
  211. .model-btn {
  212. text-align: center;
  213. color: #FFFFFF;
  214. height: 80rpx;
  215. border-radius: none;
  216. width: 80%;
  217. opacity: 1;
  218. background: linear-gradient(315deg, #3387ff 2%, #569bff 99%);
  219. border-radius: 8rpx;
  220. box-shadow: 0px 0px 8rpx 0px rgba(51, 135, 255, 0.20);
  221. margin: 0 auto;
  222. margin-top: 20rpx;
  223. }
  224. }
  225. .header-hg100 {
  226. height: 100rpx;
  227. padding: 0 40rpx;
  228. position: fixed;
  229. top: 0;
  230. width: 100%;
  231. z-index: 999;
  232. background: #fff;
  233. }
  234. .header-text text {
  235. margin-left: 30rpx;
  236. }
  237. .header-text view {
  238. margin-left: 30rpx;
  239. }
  240. .header-text .act {
  241. color: #007AFF;
  242. }
  243. .main-flow {
  244. background-color: #fff;
  245. display: table;
  246. width: 100%;
  247. box-sizing: border-box;
  248. }
  249. .main-flow .row {
  250. display: flex;
  251. flex-flow: row nowrap;
  252. justify-content: flex-start;
  253. align-items: center;
  254. height: 72rpx;
  255. padding: 0 40rpx;
  256. }
  257. .sticky {
  258. background-color: #f5f5f5;
  259. color: #ccc;
  260. position: fixed;
  261. top: 100rpx;
  262. width: 100%;
  263. z-index: 2;
  264. }
  265. .main-flow .row .td {
  266. text-align: left;
  267. font-size: 30rpx;
  268. }
  269. .main-flow .row.tab-h .td {
  270. color: #999999;
  271. text-align: left;
  272. }
  273. .main-flow .row .td:nth-child(1) {
  274. width: 40%;
  275. }
  276. .main-flow .row .td:nth-child(2) {
  277. width: 20%;
  278. }
  279. .main-flow .row .td:nth-child(3) {
  280. width: 20%;
  281. }
  282. .main-flow .row .td:nth-child(4) {
  283. width: 20%;
  284. }
  285. .sanjiao {
  286. width: 40rpx;
  287. height: 40rpx;
  288. }
  289. </style>