index.vue 24 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048
  1. <template>
  2. <view>
  3. <view class="navbar-tit">{{title}}</view>
  4. <view class="statisticsData">
  5. <view class="statisticsData-item">
  6. <h3 style="font-size: 20px;">{{info.merchantAccountName}}</h3>
  7. </view>
  8. <view class="statisticsDataMain" v-if="indexData">
  9. <view class="statisticsData-item">
  10. <view class="statisticsData-head" @click="gotoUrl('pagesFinance/detailed/index')">
  11. <p>今日充电流水</p>
  12. <u-icon name="arrow-right-s-line" custom-prefix="custom-icon" color="#637AA2" size="36">
  13. </u-icon>
  14. </view>
  15. <view class="statisticsData-main">
  16. <h2>{{indexData.todayAmount?indexData.todayAmount.toFixed(2):0}}元</h2>
  17. </view>
  18. <view class="statisticsData-foot">
  19. <p>昨日</p>
  20. <h2 style="margin-left: 10px;">
  21. {{indexData.yesterdayAmount?indexData.yesterdayAmount.toFixed(2):0}}元</h2>
  22. </view>
  23. </view>
  24. <view class="statisticsData-item">
  25. <view>
  26. <h3>&nbsp;</h3>
  27. </view>
  28. <view class="statisticsData-head">
  29. <p>今日充电笔数</p>
  30. </view>
  31. <view class="statisticsData-main">
  32. <h2>{{indexData.todayEQNum?indexData.todayEQNum:0}}笔</h2>
  33. </view>
  34. <view class="statisticsData-foot">
  35. <p>本月</p>
  36. <h2 style="margin-left: 10px;">
  37. {{indexData.thisMonthAmount?indexData.thisMonthAmount.toFixed(2):0}}元</h2>
  38. </view>
  39. </view>
  40. </view>
  41. </view>
  42. <u-popup v-model="popupShow" mode="top" height="30%">
  43. <view class="popup-screen">
  44. <view class="screen">
  45. <view class="screen-item">
  46. <view class="screen-head">查询日期</view>
  47. <view class="screen-main2">
  48. <u-input :value="startTime?startTime+'至'+endTime:'选择时间筛选'" :type="type" :border="border"
  49. @click="showdate = true,popupShow=false" />
  50. <!--
  51. <u-action-sheet :list="actionSheetList" v-model="show" @click="actionSheetCallback"></u-action-sheet>
  52. -->
  53. </view>
  54. </view>
  55. <view class="screen-item" v-if="false">
  56. <view class="screen-head">充电桩类型</view>
  57. <view class="screen-main">
  58. <view :class="{
  59. active:selecttype==''
  60. }" @click="selecttype=''" class="screen-entry ">全部</view>
  61. <view :class="{
  62. active:selecttype=='0'
  63. }" @click="selecttype='0'" class="screen-entry type1">自行车充电</view>
  64. <view :class="{
  65. active:selecttype=='2'
  66. }" @click="selecttype='2'" class="screen-entry type3">交流慢充</view>
  67. <view :class="{
  68. active:selecttype=='1'
  69. }" @click="selecttype='1'" class="screen-entry type2">直流快充</view>
  70. </view>
  71. </view>
  72. <view class="screen-item" v-if="false">
  73. <view class="screen-head">站点</view>
  74. <view class="screen-main">
  75. <view class="screen-entry " :class="{
  76. active:selectstationId==''
  77. }" @click="selectstationId=''">全部</view>
  78. <view v-for="(item,i) in stationList" :key="i" :class="{
  79. active:selectstationId==item.id
  80. }" @click="selectstationId=item.id,selectdeviceNo=''" class="screen-entry">{{item.name}}</view>
  81. </view>
  82. </view>
  83. <view class="screen-item" v-if="false">
  84. <view class="screen-head">桩号</view>
  85. <view class="screen-main">
  86. <view class="screen-entry " :class="{
  87. active:selectdeviceNo==''
  88. }" @click="selectdeviceNo=''">全部</view>
  89. <view v-for="(item,i) in stationListSon" :key="i"
  90. v-show="selectstationId?(selectstationId==item.stationId):true" :class="{
  91. active:selectdeviceNo==item.deviceNo
  92. }" @click="selectdeviceNo=item.deviceNo" class="screen-entry">{{item.name}}</view>
  93. </view>
  94. </view>
  95. </view>
  96. <view class="screen-foot">
  97. <view class="screen-btn-l" @click="resetBtn">重置</view>
  98. <view class="screen-btn-r" @click="okbtn">确定</view>
  99. </view>
  100. </view>
  101. </u-popup>
  102. <u-calendar v-model="showdate" mode="range" @change="changedate"></u-calendar>
  103. <u-calendar v-model="showdate2" mode="range" @change="changedate2"></u-calendar>
  104. <u-popup v-model="popupShow2" mode="top" height="50%">
  105. <view class="popup-screen">
  106. <view class="screen">
  107. <view class="screen-item">
  108. <view class="screen-head">查询日期</view>
  109. <view class="screen-main2">
  110. <u-input :value="startTime2?startTime2+'至'+endTime2:'选择时间筛选'" :type="type" :border="border"
  111. @click="showdate2 = true,popupShow2=false" />
  112. <!--
  113. <u-action-sheet :list="actionSheetList" v-model="show" @click="actionSheetCallback"></u-action-sheet>
  114. -->
  115. </view>
  116. </view>
  117. <view class="screen-item">
  118. <view class="screen-head">站点</view>
  119. <view class="screen-main">
  120. <view class="screen-entry " :class="{
  121. active:selectstationId2==''
  122. }" @click="selectstationId2=''">全部</view>
  123. <view v-for="(item,i) in stationList" :key="i" :class="{
  124. active:selectstationId2==item.id
  125. }" @click="selectstationId2=item.id,selectdeviceNo=''" class="screen-entry">{{item.name}}</view>
  126. </view>
  127. </view>
  128. </view>
  129. <view class="screen-foot">
  130. <view class="screen-btn-l" @click="resetBtn2">重置</view>
  131. <view class="screen-btn-r" @click="okbtn2">确定</view>
  132. </view>
  133. </view>
  134. </u-popup>
  135. <view class="statisticsChart">
  136. <view class="statisticsChart-head" style="margin-top: 20px;">
  137. <h4>流水统计</h4>
  138. <!-- <view class="navbar-screen" >
  139. {{startTime}}至{{endTime}}
  140. </view> -->
  141. <view class="navbar-screen" @click="popupShow = true"><span>筛选</span><u-icon name="filter-2-fill" custom-prefix="custom-icon" color="#b0b8c8" size="32"></u-icon></view>
  142. </view>
  143. <view class="details detailstable">
  144. <p style="text-align: center; margin-bottom: 5px;">{{startTime}}至{{endTime}} </p>
  145. <u-collapse :headStyle="{
  146. color:'#101010',
  147. fontWeight: 'bold',
  148. padding:'12px 0',
  149. borderBottom: '1px solid #ededed'
  150. }"
  151. v-if="stationFlowList.length">
  152. <u-collapse-item
  153. v-for="(item, index) in stationFlowList" :open="index==0" :title="item.stationName+' 总收入'+item.actualMoney.toFixed(2)+'元'" :key="index">
  154. <!-- -->
  155. <view class="detailsline">
  156. <view class="details-row details-row-1">
  157. <view class="span1">电费</view>
  158. <view class="span2">{{item.elecMoney.toFixed(2)}}<span>元</span></view>
  159. </view>
  160. <view class="details-row">
  161. <view class="span1">服务费</view>
  162. <view class="span2">{{item.serviceMoney.toFixed(2)}}<span>元</span></view>
  163. </view>
  164. </view>
  165. <view class="detailsline">
  166. <view class="details-row details-row-1">
  167. <view class="span1">总用电量</view>
  168. <view class="span2">{{(item.eq/10000).toFixed(3)}}<span>度</span></view>
  169. </view>
  170. <view class="details-row">
  171. <view class="span1">充电枪数量</view>
  172. <view class="span2">快充{{item.fastNum}}/慢充{{item.slowNum}}</view>
  173. </view>
  174. </view>
  175. <view class="detailsline" v-if="item.fastNum&&item.slowNum">
  176. <view class="details-row details-row-1">
  177. <view class="span1">快充枪平均充电量</view>
  178. <view class="span2" v-if="item.fastNum">{{(item.eqFast/nowTime/item.fastNum/10000).toFixed(3)}}<span>度/枪/天</span></view>
  179. <view class="span2" v-else>0<span>度/枪/天</span></view>
  180. </view>
  181. <view class="details-row">
  182. <view class="span1">慢充枪平均充电量</view>
  183. <view class="span2" v-if="item.slowNum" >{{(item.eqSlow/nowTime/item.slowNum/10000).toFixed(3)}}<span>度/枪/天</span></view>
  184. <view class="span2" v-else>0<span>度/枪/天</span></view>
  185. </view>
  186. </view>
  187. </u-collapse-item>
  188. </u-collapse>
  189. </view>
  190. <view class="statisticsChart-head" v-if="false">
  191. <h4>流水占比</h4>
  192. <view class="navbar-screen" @click="popupShow = true"><span>筛选</span>
  193. <u-icon name="filter-2-fill" custom-prefix="custom-icon" color="#b0b8c8" size="32"></u-icon>
  194. </view>
  195. </view>
  196. <view class="statisticsChart-main" v-if="false">
  197. <!-- <u-calendar v-model="showdate" mode="range" @change="changedate"></u-calendar>
  198. -->
  199. <view class="statisticsChart-time" style="
  200. text-align: center; margin-bottom: 5px;
  201. ">
  202. <p>{{startTime}} 至 {{endTime}} </p>
  203. </view>
  204. <u-subsection :list="subsection" @change="changesub" :current="current" button-color="#2E7Dff"
  205. active-color="#fff"></u-subsection>
  206. <p v-if="step==0" style="text-align: center;">双击饼图进入详情</p>
  207. <p v-if="step==1" style="text-align: center;">
  208. <span v-if="step==1" style="position: absolute;left: 30px;" @click="step=0,getPie()">
  209. <u-icon name="arrow-left-double"></u-icon>
  210. 返回
  211. </span>{{stepname}}
  212. </p>
  213. <cover-view id="pieEcharts" style="min-height:250px;">
  214. </cover-view>
  215. </view>
  216. <view class="statisticsChart-head" style="margin-top: 20px;">
  217. <h4>收益统计</h4>
  218. <!-- <view class="navbar-screen" >
  219. {{startTime}}至{{endTime}}
  220. </view> -->
  221. <view class="navbar-screen" @click="popupShow2 = true"><span>筛选</span>
  222. <u-icon name="filter-2-fill" custom-prefix="custom-icon" color="#b0b8c8" size="32"></u-icon>
  223. </view>
  224. </view>
  225. <view class="details" v-if="indexData2&&indexData2.incomeMap">
  226. <p style="text-align: center; margin-bottom: 5px;">{{startTime2}}至{{endTime2}} </p>
  227. <view class="details-row">
  228. <p>投资人收入</p>
  229. <span>{{indexData2.incomeMap.incomeAmount.toFixed(2)}}元</span>
  230. </view>
  231. <view class="details-row" v-if="false">
  232. <p>用电度数</p>
  233. <span>{{indexData2.incomeMap.electricQuantity/10000}}度</span>
  234. </view>
  235. <view class="details-row">
  236. <p>预估电费</p>
  237. <span>{{indexData2.incomeMap.costAmount.toFixed(2)}}元</span>
  238. </view>
  239. <view class="details-row">
  240. <p>服务费收益</p>
  241. <span><b>{{indexData2.incomeMap.serviceAmount.toFixed(2)}}元</b></span>
  242. </view>
  243. </view>
  244. </view>
  245. <Tabbar :current="0" ref="tabbarMain"></Tabbar>
  246. <!-- <u-tabbar v-model="current" :list="tabbarList" active-color="#185ac6"></u-tabbar>
  247. -->
  248. </view>
  249. </template>
  250. <script>
  251. import Tabbar from '@/components/TabbarFinance.vue'
  252. import * as API from '@/apis/finance.js'
  253. import * as echarts from "echarts";
  254. //require("@/apis/echarts-5-3.min.js")
  255. //import * as echarts from "@/apis/echarts-5-3.min.js";
  256. import {
  257. daysDistance,
  258. beforeTimeStamp,
  259. currentTimeStamp,
  260. parseUnixTime
  261. } from '@/utils'
  262. export default {
  263. data() {
  264. return {
  265. isinit: true,
  266. form: {},
  267. form2: {},
  268. selecttype: "",
  269. selectstationId: "",
  270. selectdeviceNo: "",
  271. popupShow2: false,
  272. popupShow: false,
  273. nowTime:0,
  274. selectstationId2: "",
  275. info: {},
  276. title: "",
  277. showdate: false,
  278. showdate2: false,
  279. startTime: "",
  280. indexData: {},
  281. endTime: "",
  282. startTime2: "",
  283. indexData2: null,
  284. endTime2: "",
  285. myChart: null,
  286. myChartReady: false,
  287. myChartTime: false,
  288. subsection: [{
  289. name: '金额'
  290. },
  291. {
  292. name: '笔数'
  293. }
  294. ],
  295. stationFlowList: [],
  296. stationList: [],
  297. stationListSon: [],
  298. tabbarList: [{
  299. iconPath: "bar-chart-box-fill",
  300. selectedIconPath: "bar-chart-box-fill",
  301. text: '统计',
  302. count: 0,
  303. isDot: true,
  304. customIcon: true,
  305. },
  306. {
  307. iconPath: "article-fill",
  308. selectedIconPath: "article-fill",
  309. text: '明细',
  310. midButton: true,
  311. customIcon: true,
  312. },
  313. {
  314. iconPath: "account-pin-box-fill",
  315. selectedIconPath: "account-pin-box-fill",
  316. text: '我的',
  317. count: 0,
  318. isDot: false,
  319. customIcon: true,
  320. },
  321. ],
  322. current: 0,
  323. background: {
  324. background: 'none'
  325. },
  326. value: '',
  327. type: 'select',
  328. show: false,
  329. border: true,
  330. step: 0,
  331. stepname: '',
  332. stepid: 0,
  333. }
  334. },
  335. onShow() {
  336. if (this.$refs.tabbarMain) {
  337. this.$refs.tabbarMain.setcount(0);
  338. }
  339. },
  340. onLoad() {
  341. this.title = "收益统计"
  342. this.info = this.carhelp.getPersonInfo("merchantUser")
  343. },
  344. components: {
  345. Tabbar
  346. },
  347. onReady() {
  348. var date=new Date();
  349. this.nowTime=7
  350. this.startTime = parseUnixTime(beforeTimeStamp(6), '{y}-{m}-{d}')
  351. this.endTime = parseUnixTime(currentTimeStamp(), '{y}-{m}-{d}')
  352. this.startTime2 = parseUnixTime(beforeTimeStamp(6), '{y}-{m}-{d}')
  353. this.endTime2 = parseUnixTime(currentTimeStamp(), '{y}-{m}-{d}')
  354. this.getStation()
  355. },
  356. methods: {
  357. getStation(bl) {
  358. API.stationList().then((res) => {
  359. this.stationList = res.data.stationList
  360. this.stationListSon = res.data.deviceList
  361. this.getDataHome()
  362. this.getData()
  363. this.getData2()
  364. }).catch(error => {
  365. uni.showToast({
  366. title: error
  367. })
  368. })
  369. },
  370. resetBtn() {
  371. this.nowTime=7
  372. this.startTime = parseUnixTime(beforeTimeStamp(6), '{y}-{m}-{d}')
  373. this.endTime = parseUnixTime(currentTimeStamp(), '{y}-{m}-{d}')
  374. this.selecttype = ""
  375. this.selectstationId = ""
  376. this.selectdeviceNo = ""
  377. this.form = {
  378. type: this.selecttype,
  379. stationId: this.selectstationId,
  380. deviceNo: this.selectdeviceNo,
  381. };
  382. this.popupShow = false;
  383. this.list = [];
  384. this.getData()
  385. },
  386. okbtn() {
  387. this.popupShow = false;
  388. this.form = {
  389. type: this.selecttype,
  390. stationId: this.selectstationId,
  391. deviceNo: this.selectdeviceNo,
  392. };
  393. this.list = [];
  394. this.getData()
  395. },
  396. resetBtn2() {
  397. this.startTime2 = parseUnixTime(beforeTimeStamp(6), '{y}-{m}-{d}')
  398. this.endTime2 = parseUnixTime(currentTimeStamp(), '{y}-{m}-{d}')
  399. this.selectstationId2 = ""
  400. this.form2 = {
  401. stationId: this.selectstationId2,
  402. };
  403. this.popupShow2 = false;
  404. this.getData2()
  405. },
  406. okbtn2() {
  407. this.popupShow2 = false;
  408. this.form2 = {
  409. stationId: this.selectstationId2,
  410. };
  411. this.getData2()
  412. },
  413. getDataHome() {
  414. API.homeHeadStatistics().then((res) => {
  415. this.indexData = res.data;
  416. }).catch(error => {
  417. uni.showToast({
  418. title: error
  419. })
  420. })
  421. },
  422. getData() {
  423. this.form.startDate = this.startTime,
  424. this.form.endDate = this.endTime
  425. API.homeFlowStatistics(this.form).then((res) => {
  426. this.stationFlowList = res.data.stationFlowList;
  427. this.nowTime=daysDistance(this.startTime, this.endTime)+1;
  428. console.log(this.nowTime)
  429. }).catch(error => {
  430. uni.showToast({
  431. title: error
  432. })
  433. })
  434. },
  435. getData2() {
  436. uni.showLoading({
  437. title: "加载中",
  438. mask: true,
  439. })
  440. this.form2.startDate = this.startTime2,
  441. this.form2.endDate = this.endTime2
  442. API.homeIncomeStatistics(this.form2).then((res) => {
  443. this.indexData2 = res.data
  444. uni.hideLoading()
  445. }).catch(error => {
  446. uni.showToast({
  447. title: error
  448. })
  449. })
  450. },
  451. changesub(e) {
  452. this.current = e
  453. this.getPie()
  454. },
  455. changedate(e) {
  456. this.startTime = e.startDate
  457. this.endTime = e.endDate
  458. this.popupShow = true
  459. this.okbtn()
  460. },
  461. changedate2(e) {
  462. this.startTime2 = e.startDate
  463. this.endTime2 = e.endDate
  464. this.popupShow2 = true
  465. },
  466. getPie1(list) {
  467. var getData = [];
  468. var map = new Map()
  469. var stationNum = 0;
  470. list.forEach(item => {
  471. var value = this.current ? item.eqNum : item.amount
  472. if (value) {
  473. var stationName = ""
  474. var obj = this.stationListSon.find(item2 => {
  475. return item2.deviceNo == item.deviceNo
  476. })
  477. if (obj && obj.stationId) {
  478. var obj2 = this.stationList.find(item3 => {
  479. return item3.id == obj.stationId
  480. })
  481. if (obj2 && obj2.name) {
  482. stationName = obj2.name;
  483. }
  484. if (!map.has(obj.stationId)) {
  485. map.set(obj.stationId, {
  486. id: obj.stationId,
  487. value: value,
  488. name: stationName,
  489. })
  490. this.stepid = obj.stationId;
  491. stationNum++;
  492. } else {
  493. var omap = map.get(obj.stationId)
  494. var addvalue = (omap.value * 100 + value * 100) / 100
  495. map.set(obj.stationId, {
  496. id: obj.stationId,
  497. value: addvalue,
  498. name: stationName,
  499. })
  500. }
  501. }
  502. }
  503. })
  504. map.forEach((item, i) => {
  505. getData.push(item)
  506. })
  507. if (stationNum == 1) {
  508. this.step = 2; //只有一个站, 就不拆分了
  509. } else {
  510. this.stepid = 0;
  511. }
  512. return getData;
  513. },
  514. getPie2(list) {
  515. var getData = [];
  516. var sz = ['自行车充电桩', '直流汽车充电桩', '交流汽车充电桩']
  517. list.forEach(item => {
  518. var value = this.current ? item.eqNum : item.amount
  519. if (value) {
  520. var typeName = "";
  521. var stationName = ""
  522. var obj = this.stationListSon.find(item2 => {
  523. return item2.deviceNo == item.deviceNo
  524. })
  525. if (this.stepid != obj.stationId) {
  526. return
  527. }
  528. if (obj && obj.stationId) {
  529. var obj2 = this.stationList.find(item3 => {
  530. return item3.id == obj.stationId
  531. })
  532. if (obj2 && obj2.name) {
  533. stationName = obj2.name;
  534. }
  535. }
  536. if (obj && obj.type) {
  537. typeName = sz[obj.type]
  538. }
  539. getData.push({
  540. id: item.id,
  541. value: value,
  542. name: item.deviceName,
  543. typeName: typeName,
  544. stationName: stationName
  545. })
  546. }
  547. })
  548. return getData;
  549. },
  550. getPie() {
  551. var list = this.indexData.pieChart;
  552. var unit = this.current ? '笔' : '元'
  553. var getData = [];
  554. if (this.step == 0) {
  555. getData = this.getPie1(list)
  556. }
  557. if (this.step == 1 || this.step == 2) {
  558. getData = this.getPie2(list)
  559. }
  560. if (!this.myChart) {
  561. this.myChart = echarts.init(document.getElementById('pieEcharts'));
  562. }
  563. // 指定图表的配置项和数据
  564. var option = {
  565. tooltip: {
  566. trigger: 'item',
  567. formatter: (value) => {
  568. var info = value.data;
  569. var showvalue = info.value;
  570. if (!this.current) {
  571. showvalue = info.value.toFixed(2)
  572. }
  573. if (this.step == 0) {
  574. if (!info) {
  575. return ""
  576. }
  577. return info.name + ' <br/> ' + showvalue + unit
  578. }
  579. if (this.step == 1 || this.step == 2) {
  580. return info.stationName + ' <br/> ' + info.name + ' <br/> ' + showvalue + unit +
  581. ' <br/> ' + info.typeName
  582. }
  583. },
  584. position: function(point, params, dom, rect, size) {
  585. return ['10%', '0%']
  586. }
  587. },
  588. series: [{
  589. //name: 'Access From',
  590. type: 'pie',
  591. radius: '40%',
  592. data: getData,
  593. emphasis: {
  594. itemStyle: {
  595. shadowBlur: 10,
  596. shadowOffsetX: 0,
  597. shadowColor: 'rgba(0, 0, 0, 0.5)'
  598. }
  599. },
  600. label: {
  601. fontWeight: "bold",
  602. fontSize: 14,
  603. }
  604. }]
  605. };
  606. // 使用刚指定的配置项和数据显示图表。
  607. this.myChart.setOption(option);
  608. var _this = this;
  609. if (!this.myChartReady) {
  610. this.myChartReady = true;
  611. //双击事件不能生效 , 改为多次点击
  612. this.myChart.on('click', function(params) {
  613. var tid = _this.stepid; //上一次
  614. _this.stepid = params.data.id
  615. if (!_this.myChartTime || tid != _this.stepid) {
  616. _this.stepid = params.data.id
  617. _this.myChartTime = true;
  618. setTimeout(function() {
  619. console.log("setTimeout")
  620. _this.myChartTime = false;
  621. }, 500)
  622. return
  623. }
  624. if (_this.step == 0) {
  625. _this.step = 1
  626. _this.stepname = params.data.name
  627. _this.myChart.clear()
  628. _this.getPie()
  629. } else if (_this.step == 1) {
  630. //_this.step=0
  631. }
  632. // window.open('https://www.baidu.com/s?wd=' + encodeURIComponent(params.name));
  633. });
  634. }
  635. }
  636. }
  637. }
  638. </script>
  639. <style>
  640. page {
  641. background: url(../../assets/img/index_header_bg.png) no-repeat top center #f7f7f7;
  642. background-size: 100%;
  643. }
  644. </style>
  645. <style lang="scss" scoped>
  646. .detailstable {
  647. font-size: 16px;
  648. p{
  649. font-size: 14px;
  650. }
  651. .details-row-main{
  652. border-bottom: 1px solid #ededed;
  653. padding: 10px 0;
  654. }
  655. .detailsline {
  656. border-bottom: 1px solid #ededed;
  657. display: flex;
  658. .details-row {
  659. width: 48%;
  660. display: flex;
  661. justify-content: space-between;
  662. flex-direction: column;
  663. padding-left: 10px;
  664. margin-bottom: 10px;
  665. .span1 {
  666. color: rgba(136, 136, 136, 100);
  667. font-size: 14px;
  668. width: 100%;
  669. }
  670. .span2{
  671. font-size: 18px;
  672. width: 100%;
  673. color: #101010;
  674. span{
  675. font-size: 12px;
  676. }
  677. }
  678. }
  679. }
  680. .details-row-1 {
  681. padding-left: 0px !important;
  682. border-right: 1px solid #ededed;
  683. }
  684. }
  685. .details {
  686. margin-top: 16px;
  687. padding: 20px;
  688. background-color: #fff;
  689. border-radius: 8px;
  690. }
  691. .details-title {
  692. margin-bottom: 16px;
  693. h4 {
  694. font-weight: normal;
  695. font-size: 16px;
  696. position: relative;
  697. padding-left: 10px;
  698. &::after {
  699. content: '';
  700. position: absolute;
  701. height: 12px;
  702. width: 4px;
  703. background-color: #27B148;
  704. left: 0;
  705. top: 5px;
  706. }
  707. }
  708. }
  709. .details-row {
  710. display: flex;
  711. justify-content: space-between;
  712. align-items: center;
  713. margin-top: 15px;
  714. p {
  715. color: #37393c;
  716. font-weight: bold;
  717. }
  718. }
  719. .popup-screen {
  720. padding: 20px;
  721. position: relative;
  722. .screen {
  723. padding-bottom: 30px;
  724. }
  725. .screen-item {
  726. margin-bottom: 20px;
  727. .screen-head {
  728. margin-bottom: 8px;
  729. font-size: 16px;
  730. }
  731. .screen-main {
  732. display: flex;
  733. // display: -webkit-box;
  734. flex-wrap: wrap;
  735. }
  736. .screen-entry {
  737. width: 29%;
  738. padding: 6px 0;
  739. display: flex;
  740. align-items: center;
  741. justify-content: center;
  742. background-color: #F2F5FA;
  743. text-align: center;
  744. margin-bottom: 10px;
  745. border-radius: 3px;
  746. margin-right: 6px;
  747. }
  748. .screen-entry.active {
  749. background-color: #185AC6;
  750. color: #fff;
  751. }
  752. }
  753. .screen-foot {
  754. position: fixed;
  755. left: 0;
  756. right: 0;
  757. bottom: 0;
  758. display: flex;
  759. height: 50px;
  760. border-top: 1px solid #ededed;
  761. .screen-btn-l {
  762. background-color: #fff;
  763. flex: 0.2;
  764. text-align: center;
  765. line-height: 50px;
  766. }
  767. .screen-btn-r {
  768. flex: 0.8;
  769. text-align: center;
  770. line-height: 50px;
  771. background-color: #185AC6;
  772. color: #fff;
  773. }
  774. }
  775. }
  776. .navbar-tit {
  777. color: #fff;
  778. font-size: 24px;
  779. padding-left: 15px;
  780. padding-top: 10px;
  781. }
  782. .statisticsData {
  783. background-color: #fff;
  784. margin: 12px;
  785. padding: 12px;
  786. border-radius: 8px;
  787. margin-top: 60px;
  788. }
  789. .statisticsDataMain {
  790. display: flex;
  791. }
  792. .statisticsData-item {
  793. flex: 1;
  794. .statisticsData-head {
  795. display: flex;
  796. align-items: center;
  797. p {
  798. color: #637AA2;
  799. font-size: 12px;
  800. }
  801. }
  802. .statisticsData-main {
  803. margin-top: 4px;
  804. font-size: 20px;
  805. }
  806. .statisticsData-foot {
  807. display: flex;
  808. align-items: center;
  809. margin-top: 16px;
  810. p {
  811. color: #637AA2;
  812. }
  813. h4 {
  814. margin-left: 8px;
  815. }
  816. }
  817. }
  818. .statisticsChart {
  819. margin: 16px;
  820. .statisticsChart-head {
  821. margin-bottom: 5px;
  822. display: flex;
  823. justify-content: space-between;
  824. align-items: center;
  825. h4 {
  826. font-weight: normal;
  827. font-size: 16px;
  828. position: relative;
  829. padding-left: 10px;
  830. &::after {
  831. content: '';
  832. position: absolute;
  833. height: 12px;
  834. width: 4px;
  835. background-color: #4E8DF6;
  836. left: 0;
  837. top: 5px;
  838. }
  839. }
  840. .statisticsChart-time {
  841. display: flex;
  842. align-items: center;
  843. p {
  844. color: #666;
  845. }
  846. }
  847. }
  848. .statisticsChart-main {
  849. background-color: #fff;
  850. padding: 10px 16px 16px 16px;
  851. border-radius: 8px;
  852. }
  853. }
  854. </style>