index.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514
  1. <template>
  2. <view>
  3. <u-navbar v-show="false" title="首页" title-color="#101010"></u-navbar>
  4. <view class="navbar">
  5. 智泊e家 运管端
  6. </view>
  7. <view class="tabs-box">
  8. </view>
  9. <view class="main">
  10. <view class="statistics ">
  11. <view class="title">
  12. <view class="icon">
  13. <image class="img" src="@/assets/img/circleCopy1@1x.png" mode=""></image>
  14. </view>
  15. <view class="text">
  16. 综合统计
  17. </view>
  18. </view>
  19. <view class="content">
  20. <jpContent :status="jpContentMap.body1">
  21. <view class="body1pie-table">
  22. <view class="tr">
  23. <view class="td td1" >
  24. <view id="body1pie1" class="body1pie">
  25. </view>
  26. </view>
  27. <view class="td td2">
  28. <view class="td td3">
  29. <view class="td td4">空闲<span class="body1pie-num color53B56B">5</span>台</view>
  30. <view class="td td4">占用<span class="body1pie-num colorAAAAAA">5</span>台</view>
  31. </view>
  32. <view class="td td3">
  33. <view class="td td4">公共车位<span class="body1pie-num colorEF8132">5</span>台</view>
  34. <view class="td td4">私家车位<span class="body1pie-num colorDC4441">5</span>台</view>
  35. </view>
  36. </view>
  37. </view>
  38. <view class="tr" >
  39. <view class="td td1" >
  40. <view id="body1pie2" class="body1pie">
  41. </view>
  42. </view>
  43. <view class="td td2" >
  44. <view class="td td3" >
  45. <view class="td td4">正常<span class="body1pie-num color53B56B">5</span>台</view>
  46. <view class="td td4">离线<span class="body1pie-num colorAAAAAA">5</span>台</view>
  47. </view>
  48. <view class="td td3" >
  49. <view class="td td4">故障<span class="body1pie-num colorEF8132">5</span>台</view>
  50. <view class="td td4">低电量<span class="body1pie-num colorDC4441">5</span>台</view>
  51. </view>
  52. </view>
  53. </view>
  54. <view class="tr">
  55. <view class="td td1">
  56. <view id="body1pie3" class="body1pie">
  57. </view>
  58. </view>
  59. <view class="td td2" >
  60. <view class="td td3" >
  61. <view class="td td4">管理员<span class="body1pie-num color307AF6">5</span>人</view>
  62. <view class="td td4">白名单<span class="body1pie-num color53B56B">5</span>人</view>
  63. </view>
  64. <view class="td td3" >
  65. <view class="td td4">游客<span class="body1pie-num colorEF8375">5</span>人次</view>
  66. <view class="td td4"></view>
  67. </view>
  68. </view>
  69. </view>
  70. </view>
  71. </jpContent>
  72. </view>
  73. </view>
  74. </view>
  75. <tabbar :current="0"></tabbar>
  76. </view>
  77. </template>
  78. <script>
  79. import Tabbar from '@/components/Tabbar.vue'
  80. import jpContent from '@/components/JPcontent.vue'
  81. import * as echarts from 'echarts';
  82. import * as API from '@/apis/pagejs/index.js'
  83. export default {
  84. components: {
  85. Tabbar,
  86. jpContent
  87. },
  88. data() {
  89. return {
  90. isReady: false,
  91. echartsList: {
  92. },
  93. jpContentMap: {
  94. body1: 2
  95. }
  96. }
  97. },
  98. onLoad() {
  99. },
  100. onReady() {
  101. this.getfindByOpenId();
  102. },
  103. methods: {
  104. getbody1pie1() {
  105. var img=require("@/assets/img/index/pie1-1.svg")
  106. var key = "body1pie1"
  107. var myChart = this.echartsList[key];
  108. if (!myChart) {
  109. myChart = echarts.init(document.getElementById(key), null, {
  110. width: uni.upx2px(88),
  111. height: uni.upx2px(88)
  112. })
  113. }
  114. myChart.clear()
  115. var option = {
  116. series: [{
  117. silent: true,
  118. type: 'pie',
  119. radius: ['70%', '100%'],
  120. label: {
  121. show: false,
  122. },
  123. data: [{
  124. value: 1048,
  125. itemStyle: { color: '#AAAAAA' }
  126. },
  127. {
  128. value: 735 ,
  129. itemStyle: { color: '#53B56B' }
  130. }
  131. ]
  132. }],
  133. grid: {
  134. top: 0,
  135. left: 0,
  136. right: 0,
  137. bottom: 0,
  138. containLabel: true
  139. },
  140. graphic: [{
  141. type: 'image',
  142. id: 'logo',
  143. left: 'center',
  144. top: 'center',
  145. style: {
  146. image: img, // 图片路径
  147. width: uni.upx2px(40),
  148. height: uni.upx2px(40)
  149. }
  150. }]
  151. }
  152. myChart.setOption(option);
  153. this.echartsList[key] = myChart;
  154. },
  155. getbody1pie2() {
  156. var img=require("@/assets/img/index/pie1-2.svg")
  157. var key = "body1pie2"
  158. var myChart = this.echartsList[key];
  159. if (!myChart) {
  160. myChart = echarts.init(document.getElementById(key), null, {
  161. width: uni.upx2px(88),
  162. height: uni.upx2px(88)
  163. })
  164. }
  165. myChart.clear()
  166. var option = {
  167. series: [{
  168. silent: true,
  169. type: 'pie',
  170. radius: ['70%', '100%'],
  171. label: {
  172. show: false,
  173. },
  174. data: [{
  175. value: 1048,
  176. itemStyle: { color: '#AAAAAA' }
  177. },
  178. {
  179. value: 735 ,
  180. itemStyle: { color: '#53B56B' }
  181. },
  182. {
  183. value: 1048,
  184. itemStyle: { color: '#EF8132' }
  185. },
  186. {
  187. value: 735 ,
  188. itemStyle: { color: '#DC4441' }
  189. }
  190. ]
  191. }],
  192. grid: {
  193. top: 0,
  194. left: 0,
  195. right: 0,
  196. bottom: 0,
  197. containLabel: true
  198. },
  199. graphic: [{
  200. type: 'image',
  201. id: 'logo',
  202. left: 'center',
  203. top: 'center',
  204. style: {
  205. image: img, // 图片路径
  206. width: uni.upx2px(40),
  207. height: uni.upx2px(40)
  208. }
  209. }]
  210. }
  211. myChart.setOption(option);
  212. this.echartsList[key] = myChart;
  213. },
  214. getbody1pie3() {
  215. var img=require("@/assets/img/index/pie1-3.svg")
  216. var key = "body1pie3"
  217. var myChart = this.echartsList[key];
  218. if (!myChart) {
  219. myChart = echarts.init(document.getElementById(key), null, {
  220. width: uni.upx2px(88),
  221. height: uni.upx2px(88)
  222. })
  223. }
  224. myChart.clear()
  225. var option = {
  226. series: [{
  227. type: 'pie',
  228. silent: true, // 禁用交互效果
  229. radius: ['70%', '100%'],
  230. label: {
  231. show: false,
  232. },
  233. data: [
  234. {
  235. value: 735 ,
  236. itemStyle: { color: '#53B56B' }
  237. },
  238. {
  239. value: 735 ,
  240. itemStyle: { color: '#EF8375' }
  241. },
  242. {
  243. value: 735 ,
  244. itemStyle: { color: '#307AF6' }
  245. }
  246. ]
  247. }],
  248. grid: {
  249. top: 0,
  250. left: 0,
  251. right: 0,
  252. bottom: 0,
  253. containLabel: true
  254. },
  255. graphic: [{
  256. type: 'image',
  257. id: 'logo',
  258. left: 'center',
  259. top: 'center',
  260. style: {
  261. image: img, // 图片路径
  262. width: uni.upx2px(40),
  263. height: uni.upx2px(40)
  264. }
  265. }]
  266. }
  267. myChart.setOption(option);
  268. this.echartsList[key] = myChart;
  269. },
  270. init() {
  271. this.getbody1pie1()
  272. this.getbody1pie2()
  273. this.getbody1pie3()
  274. },
  275. getfindByOpenId() {
  276. uni.showLoading({
  277. title: "加载中",
  278. mask: true,
  279. })
  280. API.findByOpenId({
  281. openId: this.jphelp.getOpenId(),
  282. }).then((response) => {
  283. uni.hideLoading();
  284. this.isReady = true;
  285. this.loginset(response)
  286. try {
  287. this.init()
  288. } catch (e) {
  289. console.log(e)
  290. uni.showToast({
  291. title: e,
  292. icon: "none"
  293. })
  294. }
  295. }).catch(error => {
  296. uni.showToast({
  297. title: error,
  298. icon: "none"
  299. })
  300. uni.redirectTo({
  301. url: '/pages/login/login'
  302. })
  303. })
  304. }
  305. }
  306. }
  307. </script>
  308. <style scoped lang="scss">
  309. .color307AF6{
  310. color:#307AF6
  311. }
  312. .color53B56B{
  313. color:#53B56B
  314. }
  315. .colorAAAAAA{
  316. color:#AAAAAA
  317. }
  318. .colorEF8132{
  319. color:#EF8132
  320. }
  321. .colorDC4441{
  322. color:#DC4441
  323. }
  324. .colorEF8375{
  325. color:#EF8375
  326. }
  327. .body1pie-table{
  328. color: rgba(51,51,51,1);
  329. font-size: 32rpx;
  330. font-weight: bold;
  331. .tr{
  332. .td1{
  333. padding-right: 24rpx;
  334. }
  335. display: flex;
  336. margin-bottom: 40rpx;
  337. .td2{
  338. width: 100%;
  339. .td3{
  340. display: flex;
  341. .td4{
  342. width: 120px;
  343. }
  344. }
  345. }
  346. }
  347. // td{
  348. // padding-right: 24rpx;
  349. // }
  350. .body1pie{
  351. }
  352. .body1pie-num{
  353. margin: 0 8rpx;
  354. }
  355. }
  356. // 导航栏
  357. .navbar {
  358. box-shadow: 0px 4px 4px 0px rgba(0, 0, 0, 0.15);
  359. background-color: rgba(22, 119, 255, 1);
  360. color: #fff;
  361. line-height: 88rpx;
  362. display: flex;
  363. justify-content: space-between;
  364. align-items: center;
  365. padding: 0 32rpx;
  366. color: rgba(255, 255, 255, 1);
  367. font-size: 36rpx;
  368. position: fixed;
  369. left: 0;
  370. right: 0;
  371. top: 0;
  372. z-index: 999999;
  373. font-weight: bold;
  374. }
  375. .main {
  376. border-radius: 16px 16px 0px 0px;
  377. background: linear-gradient(180deg, rgba(242, 244, 246, 1) 61%, rgba(255, 255, 255, 0) 100%);
  378. margin-top: -24rpx;
  379. padding: 32rpx;
  380. .statistics {
  381. border-radius: 8px;
  382. background-color: rgba(255, 255, 255, 1);
  383. box-shadow: 0px 1px 6px 0px rgba(0, 59, 142, 0.05);
  384. margin-bottom: 24rpx;
  385. padding: 40rpx;
  386. .title {
  387. display: flex;
  388. align-items: center;
  389. margin-bottom: 32rpx;
  390. .img {
  391. width: 36rpx;
  392. height: 36rpx;
  393. vertical-align: middle;
  394. border-radius: 999px;
  395. }
  396. .change {
  397. display: flex;
  398. align-items: center;
  399. .change-img {
  400. width: 32rpx;
  401. height: 32rpx;
  402. vertical-align: middle;
  403. }
  404. text {
  405. margin-left: 8rpx;
  406. }
  407. }
  408. .text {
  409. color: rgba(16, 16, 16, 1);
  410. font-size: 36rpx;
  411. margin-left: 16rpx;
  412. font-weight: bold;
  413. }
  414. .change {
  415. margin-left: 16rpx;
  416. font-size: 24rpx;
  417. color: #838383;
  418. }
  419. .check-all {
  420. margin-left: auto;
  421. color: rgba(131, 131, 131, 1);
  422. font-size: 24rpx;
  423. }
  424. }
  425. }
  426. .statistics-end {
  427. padding-bottom: 0;
  428. }
  429. }
  430. .tabs-box {
  431. padding: 32rpx 0;
  432. margin-top: 66rpx;
  433. padding-right: 32rpx;
  434. background-color: rgba(22, 119, 255, 1);
  435. display: flex;
  436. align-items: center;
  437. justify-content: space-between;
  438. .tabs {
  439. width: 97%;
  440. }
  441. .more {
  442. padding-right: 12rpx;
  443. }
  444. }
  445. </style>