status.vue 38 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567
  1. <template>
  2. <view class="container">
  3. <view style="height: 0vh;place-items: center;display: grid;">
  4. <image style="height: 3vh;width: 27vw;margin-top: 1vh;top: 3vh;"
  5. src="../../../static/images/new/starts/login/backImg2.png"></image>
  6. <text @click="clickRight()"
  7. style="font-size: 15px;margin: -5px 0 0 30vh;font-weight: bold;z-index: 9999;"><uni-icons v-show="!show" style="color: #ffffff;" size="30" type="more-filled"></uni-icons><uni-icons size="30" v-show="show" style="color: #57B03D;" type="more-filled"></uni-icons></text>
  8. <!-- <uni-drawer @change="changeDrawer" style="top:20vh;height: 100vh" ref="showRight" mode="right"
  9. :mask-click="true">
  10. </uni-drawer> -->
  11. </view>
  12. <view >
  13. <u-popup :show="show" mode="right" customStyle="top:14vh;bottom:200px;" :overlayOpacity="0" :closeOnClickOverlay="true" :zIndex="100" ref="showRight" :overlay="false" >
  14. <view style="width: 100vw;height: 100vh;">
  15. <scroll-view style="background: linear-gradient(#000000, #161615);font-size: 20px;height: 100vh;" scroll-y="true">
  16. <view class="prop-item" @click="handleLogout()">
  17. <!-- <view class="prop-item-image">
  18. <image :src="imgUrl+'/logout.png'" style="width: 30%;height:100%;" />
  19. </view> -->
  20. <view class="prop-item-right">{{i18('退出登录')}}</view>
  21. <view class="prop-item-left">
  22. <!-- <uni-icons type="forward" color="lightgray" size="16"></uni-icons> -->
  23. </view>
  24. </view>
  25. <u-divider />
  26. <view class="prop-item" @click="skipPage(3)">
  27. <!-- <view class="prop-item-image">
  28. <image :src="imgUrl+'/logout.png'" style="width: 30%;height:100%;" />
  29. </view> -->
  30. <view class="prop-item-right">{{i18('关于我们')}}</view>
  31. <view class="prop-item-left">
  32. <!-- <uni-icons type="forward" color="lightgray" size="16"></uni-icons> -->
  33. </view>
  34. </view>
  35. <u-divider />
  36. <view class="prop-item" @click="skipPage(4)">
  37. <!-- <view class="prop-item-image">
  38. <image :src="imgUrl+'/logout.png'" style="width: 30%;height:100%;" />
  39. </view> -->
  40. <view class="prop-item-right">{{i18('帮助')}}</view>
  41. <view class="prop-item-left">
  42. <!-- <uni-icons type="forward" color="lightgray" size="16"></uni-icons> -->
  43. </view>
  44. </view>
  45. <u-divider />
  46. </scroll-view>
  47. </view>
  48. </u-popup>
  49. </view>
  50. <view style=" position: relative;top: 10vh;margin-top: 4vh;text-align: center;display: flex;flex-direction: row;justify-content: center;">
  51. <view class="progress_box" style="text-align: center">
  52. <!-- <canvas class="progress_bg" canvas-id="cpbg"></canvas> -->
  53. <view >
  54. <image class="progress-barup" src="../../../static/images/new/starts/kedu.png"></image>
  55. <canvas class="progress_bar" canvas-id="cpbar"></canvas>
  56. </view>
  57. <!-- <canvas class="progress_line" canvas-id="cpline"></canvas> -->
  58. <view class="progress_txt">
  59. <view class="progress_info">
  60. <view class="p0" style="color: azure;" st="">{{ deviceInfo.qrcode}}</view>
  61. <view class="p1">
  62. <view v-if="portStatus == 2" style="position: relative;">
  63. {{$t('charge.charging')}}
  64. </view>
  65. <view v-else-if="portStatus == 6" style="position: relative;">
  66. {{$t('charge.planed')}}
  67. </view>
  68. <view v-else-if="portStatus == 5" style="position: relative;">
  69. {{$t('charge.connected')}}
  70. </view>
  71. <view v-else>
  72. {{$t('charge.nocharge')}}
  73. </view>
  74. </view>
  75. </view>
  76. </view>
  77. </view>
  78. <!-- <view class="dtop">
  79. <view class="can" style="background-image: url(/static/images/new/quan.png);">
  80. <view class="box">
  81. <view class="three">
  82. <view class="four"></view>
  83. <view class="five"></view>
  84. <view class="six"></view>
  85. </view>
  86. <view class="dot"></view>
  87. <view class="dot"></view>
  88. <view class="dot"></view>
  89. <view class="dot"></view>
  90. <view class="dot"></view>
  91. </view>
  92. <view class="stip">
  93. <view class="p0" st="">{{ deviceInfo.qrcode}}</view>
  94. <view class="p1">
  95. <view v-if="portStatus == 2">
  96. {{$t('charge.charging')}}
  97. </view>
  98. <view v-else-if="portStatus == 6">
  99. {{$t('charge.planed')}}
  100. </view>
  101. <view v-else-if="portStatus == 5">
  102. {{$t('charge.connected')}}
  103. </view>
  104. <view v-else>
  105. {{$t('charge.nocharge')}}
  106. </view>
  107. </view>
  108. </view>
  109. </view>
  110. </view>-->
  111. </view>
  112. <view style="display: flex;align-items: center;flex-direction: column;color: aliceblue;margin-top: 5vh;">
  113. <view
  114. style="background-color: #494E51;justify-content: center;display: flex;justify-items: center;flex-direction: row;text-align: center;width: 76vw;;border-radius: 27px;">
  115. <view span="3" style="width: 19vw;">
  116. <view class="item-value">{{ deviceV }}V</view>
  117. <span class="item-text">{{$t('charge.voltage')}}</span>
  118. </view>
  119. <u-line direction="col" color="#6F84AC" length="50"></u-line>
  120. <view span="3" style="width: 19vw;">
  121. <view class="item-value">{{ gonglv }}W</view>
  122. <span class="item-text">{{$t('charge.power')}}</span>
  123. </view>
  124. <u-line direction="col" color="#6F84AC" length="50"></u-line>
  125. <view span="3" style="width: 19vw;">
  126. <view class="item-value">{{deviceTemp}}℃</view>
  127. <span class="item-text">{{$t('charge.devtemper')}}</span>
  128. </view>
  129. <u-line direction="col" color="#6F84AC" length="50"></u-line>
  130. <view span="3" style="width: 19vw;">
  131. <view class="item-value" v-if="portDetail.voltage == 0">0 {{ i18('度') }}</view>
  132. <view class="item-value" v-else>{{ dianliang }} {{ i18('度') }}</view>
  133. <span class="item-text">{{$t('charge.elec')}}</span>
  134. </view>
  135. </view>
  136. </view>
  137. <view style="display: flex;align-items: center;flex-direction: column;color: aliceblue;margin-top: 3vh;">
  138. <view
  139. style="position:relative;justify-content: center;display: flex;justify-items: center;flex-direction: row;text-align: center;width: 100%;height: 6vh;}">
  140. <view style="width: 27vw;left:5vw;position: absolute;font-size: 11px;">
  141. <view style="margin-left: 1vh;">
  142. <view><span v-if="portDetail.portStatus == 6">{{i18('剩余时间')}}</span>
  143. <span v-else>{{$t('charge.chargetime')}}</span></view>
  144. <view class="demo-layout bg-purple"
  145. style="border-radius: 8px;background-color: aliceblue;color: #000;">
  146. <view >{{ chargeTime }}{{ i18('分钟') }}</view>
  147. </view>
  148. </view>
  149. </view>
  150. <view span="2" style=";left:34vw;position: absolute">
  151. <view v-if="portDetail.portStatus == 2"
  152. style="text-align: center;position: absolute;margin:-1vh 2vw;border: 0ch;height: 20vh;">
  153. <u-button @click="toPage()" shape="circle"
  154. style="background: #ec3e41;color:white;width: 28vw;border: 0ch;height: 6vh;">Charge</u-button>
  155. </view>
  156. <view v-if="portDetail.portStatus != 2"
  157. style="text-align: center;position: absolute;margin:-1vh 2vw;border: 0ch;height: 20vh;">
  158. <u-button @click="toPage()" shape="circle"
  159. style="background: #57B03D;color:white;width: 28vw;border: 0ch;height: 6vh;">Charge</u-button>
  160. </view>
  161. <!-- <view class="control-btn" @click="trigger()" v-if="portDetail.portStatus == 2">
  162. <image class="btn-image" src="/static/images/new/start/stop.png" >
  163. </image>
  164. <view>{{ i18('停止充电') }}</view>
  165. </view>
  166. <view class="control-btn" @click="trigger()" v-if="portDetail.portStatus != 2">
  167. <image class="btn-image" src="/static/images/new/start/using.png" >
  168. </image>
  169. <view>{{ i18('立即充电') }}</view>
  170. </view> -->
  171. </view>
  172. <view span="3" style="width: 26vw;left:65%;position: absolute">
  173. <view style="margin-left: 3vw;font-size: 11px;">
  174. <view> Ampere</view>
  175. <view class="demo-layout bg-purple"
  176. style="border-radius: 8px;background-color: aliceblue;color: #000;">
  177. <view v-if="deviceV == 0">0A</view>
  178. <view v-else>{{currentValue}}A</view>
  179. </view>
  180. </view>
  181. </view>
  182. </view>
  183. </view>
  184. <view style="display: flex;align-items: center;justify-content: center;margin-top: 0vh;">
  185. <view @click="toSetting">
  186. <image src="../../../static/images/new/starts/status/Setting.png"
  187. style="width: 60px;height: 60px;margin: 2vh 2vh;"></image>
  188. </view>
  189. <!-- <view class="" @click="wifi">
  190. <image src="../../../static/images/new/starts/status/WiFi.png"
  191. style="width: 60px;height: 60px;margin: 2vh 0.2vh;"></image>
  192. </view> -->
  193. <!-- <view class="">
  194. <image src="../../../static/images/new/starts/status/Lock/Unlocked.png"
  195. style="width: 60px;height: 60px;margin: 2vh 2vh;"></image>
  196. </view> -->
  197. <view class="" @click="getInfo">
  198. <image src="../../../static/images/new/starts/status/Refresh.png"
  199. style="width: 60px;height: 60px;margin: 2vh 2vh;;"></image>
  200. </view>
  201. <!-- <view class="">
  202. <image src="../../../static/images/new/starts/status/Link.png"
  203. style="width: 60px;height: 60px;margin: 2vh 0.2vh;"></image>
  204. </view> -->
  205. </view>
  206. <view style="position:fixed;bottom:10px;display: flex;align-items: center;justify-content: center;text-align: center;left:0px;right:0px;">
  207. <view @click="skipPage(0)">
  208. <image src="../../../static/images/new/starts/tabbar/one_off.png"
  209. style="width: 60px;height: 60px;margin: 2vh 0.2vh;"></image>
  210. </view>
  211. <view @click="skipPage(1)">
  212. <image src="../../../static/images/new/starts/tabbar/two_off.png"
  213. style="width: 60px;height: 60px;margin: 2vh 0.2vh;"></image>
  214. </view>
  215. <view @click="skipPage(2)">
  216. <image src="../../../static/images/new/starts/tabbar/three_off.png"
  217. style="width: 60px;height: 60px;margin: 2vh 0.2vh;"></image>
  218. </view>
  219. </view>
  220. <!-- <view style="display: flex;flex-direction: row;margin:0 33%;" v-if="curPort.length>1">
  221. <view class="port_item" :class="item.id==choosePort?'selected_item':''" v-for="item in curPort"
  222. @click="selectPort(item.id);">{{ i18(item.text )}}</view>
  223. </view>
  224. <view class="dstatus">
  225. <view class="ditem">
  226. <image class="itemimg" src="/static/images/new/tmp.png" />
  227. <view class="item-value">{{deviceTemp}}℃</view>
  228. <span class="item-text">{{$t('charge.devtemper')}}</span>
  229. </view>
  230. <view class="ditem">
  231. <image class="itemimg" src="/static/images/new/dianya.png" />
  232. <view class="item-value">{{ deviceV }}V</view>
  233. <span class="item-text">{{$t('charge.voltage')}}</span>
  234. </view>
  235. <view class="ditem">
  236. <image class="itemimg" src="/static/images/new/dianliu.png" />
  237. <view class="item-value" v-if="deviceV == 0">0A</view>
  238. <view class="item-value" v-else>{{currentValue}}A</view>
  239. <span class="item-text">{{$t('charge.current')}}</span>
  240. </view>
  241. <view class="ditem">
  242. <image class="itemimg" src="/static/images/new/shjian.png" />
  243. <view class="item-value">{{ chargeTime }}{{ i18('分钟') }}</view>
  244. <span class="item-text" v-if="portDetail.portStatus == 6">{{i18('剩余时间')}}</span>
  245. <span class="item-text" v-else>{{$t('charge.chargetime')}}</span>
  246. </view>
  247. <view class="ditem">
  248. <image class="itemimg" src="/static/images/new/gonglv.png" />
  249. <view class="item-value">{{ gonglv }}W</view>
  250. <span class="item-text">{{$t('charge.power')}}</span>
  251. </view>
  252. <view class="ditem">
  253. <image class="itemimg" src="/static/images/new/dianliang.png" />
  254. <view class="item-value" v-if="portDetail.voltage == 0">0 {{ i18('度') }}</view>
  255. <view class="item-value" v-else>{{ dianliang }} {{ i18('度') }}</view>
  256. <span class="item-text">{{$t('charge.elec')}}</span>
  257. </view>
  258. </view>
  259. <view class="dbtns">
  260. <view class="start" @click="toPage">
  261. <image style="width:25px;height: 25px;margin-right: 5px;" src="/static/images/new/start.png" />
  262. <span>{{$t('charge.startcharge')}}</span>
  263. </view>
  264. <view class="get" @click="getInfo">
  265. <image style="width:25px;height: 25px;margin-right: 5px;" src="/static/images/new/get.png" />
  266. <span>{{$t('charge.getinfo')}}</span>
  267. </view>
  268. </view> -->
  269. <!-- <view class="dtip">
  270. <view style="margin:10px 0px;color: #1A87FF;"><img style="width: 13px;height: 13px"
  271. src="/static/images/new/tip.png">{{i18('温馨提示')}}</view>
  272. <view>1,{{i18('桩控制最大输出电流,当功率没有达到请检查车的状态或者车的设置')}};</view>
  273. <view>2,{{i18('启动充电-&gt;设备管理->可设置设备最大输出电流')}}</view>
  274. <view>3,{{i18('为保障您远程启动正常充电,请确保枪头完全连接充电口,同时确认您的爱车处于立即充电状态下')}};</view>
  275. <view>4,{{i18('注意规范安全充电,停好车,锁好车。')}}</view>
  276. </view> -->
  277. </view>
  278. </template>
  279. <script>
  280. import {
  281. getDeviceInfo,
  282. getPortDetail,
  283. startCharge,
  284. stopCharge,
  285. sendPortDetailCmd,
  286. checkStatusChange,
  287. getPlanInfo,
  288. cancelPlan
  289. } from "@/api/device/device";
  290. import websocket from '@/utils/websocket'
  291. import i18 from '@/utils/i18.js'
  292. export default {
  293. data() {
  294. return {
  295. refreshTimer: null,
  296. curPort: [],
  297. chargeTime: 0,
  298. deviceTemp: 0,
  299. deviceV: 0,
  300. currentValue: 0,
  301. gonglv: 0,
  302. dianliang: 0,
  303. portStatus: 0,
  304. deviceInfo: {},
  305. visitTime: "",
  306. timer: null,
  307. showPort: false,
  308. portDetail: {
  309. portStatus: 0,
  310. POWER: 0,
  311. voltage: 0
  312. },
  313. statusTimer: "",
  314. connected: false,
  315. scriptTask: null,
  316. choosePort: 1,
  317. portList: [
  318. [{
  319. port: 1,
  320. text: "端口一"
  321. }]
  322. ],
  323. planInfo: null,
  324. days: ["", "周一", "周二", "周三", "周四", "周五", "周六", "周日"],
  325. clickRightTag: 0,
  326. show:false,
  327. timeFlg:true
  328. }
  329. },
  330. computed: {
  331. imgUrl() {
  332. return getApp().globalData.config.imgUrl;
  333. }
  334. },
  335. onLoad(opt) {
  336. this.deviceInfo.deviceId = opt.id;
  337. this.deviceInfo.ccid = opt.ccid;
  338. this.deviceInfo.qrcode = opt.qrcode;
  339. this.startTimer();
  340. },
  341. onShow() {
  342. this.getInfo();
  343. this.getPlanInfo();
  344. },
  345. onUnload() {
  346. this.closeSocket();
  347. if (this.refreshTimer != null) {
  348. clearTimeout(this.refreshTimer)
  349. }
  350. },
  351. mounted: function() {
  352. this.drawCircle(25);
  353. this.drawProgressbg();
  354. //参数为1-100
  355. this.drawLine();
  356. },
  357. methods: {
  358. resetMainboard() {
  359. let deviceId = this.deviceId;
  360. // 恢复默认配置
  361. let self = this;
  362. this.$modal.loading("正在重置,请稍等...");
  363. reset({deviceId:deviceId,ccid:this.ccid}).then(res => {
  364. this.$modal.loading("正在重置,请稍等...");
  365. setTimeout(function(){
  366. self.sendMainboardCmd();
  367. },5000)
  368. })
  369. },
  370. skipPage(type){
  371. if(type==0){
  372. uni.navigateTo({
  373. url:'/pages/index'
  374. })
  375. }else if(type==1){
  376. uni.navigateTo({
  377. url:'/pages/weitiandi/deviceList'
  378. })
  379. }else if(type==2){
  380. uni.navigateTo({
  381. url:'/pages/mine/index'
  382. })
  383. }else{
  384. this.$modal.showToast("功能开发中..");
  385. }
  386. },
  387. handleLogout() {
  388. this.$modal.confirm('确定注销并退出系统吗?').then(() => {
  389. this.$store.dispatch('LogOut').then(() => {
  390. uni.setStorageSync("loginInfo",'');
  391. this.$tab.reLaunch('/pages/index')
  392. })
  393. })
  394. },
  395. close(){
  396. this.show=false
  397. },
  398. open(){
  399. this.show=true
  400. },
  401. // clickRight() {
  402. // this.show=true
  403. // },
  404. // changeDrawer(event) {
  405. // if (event) {
  406. // // 抽屉打开时的逻辑
  407. // this.clickRightTag = 1
  408. // } else {
  409. // // 抽屉关闭时的逻辑
  410. // this.clickRightTag = 0
  411. // }
  412. // },
  413. // //自定义头右操作函数
  414. clickRight() {
  415. //打开抽屉
  416. this.show=!this.show
  417. // if (this.clickRightTag == 0) {
  418. // this.show=true
  419. // this.clickRightTag = 1
  420. // } else {
  421. // this.show=false
  422. // this.clickRightTag = 0
  423. // }
  424. },
  425. //开始充电按钮
  426. trigger() {
  427. let portStatus = this.portDetail.portStatus;
  428. if (portStatus == 2) { //需要停止充电
  429. this.$modal.confirm("需要停止充电么?").then(res => {
  430. this.stopCharge();
  431. })
  432. } else {
  433. if (portStatus == 1) {
  434. this.$modal.msg("请先将充电枪插入后再点击充电");
  435. }
  436. if (portStatus == 5) {
  437. this.$modal.confirm("确认开始充电么?").then(res => {
  438. this.startCharge();
  439. })
  440. }
  441. }
  442. },
  443. drawProgressbg: function() {
  444. // 自定义组件实例 this ,表示在这个自定义组件下查找拥有 canvas-id 的 <canvas/>
  445. var ctx = uni.createCanvasContext('cpbg', this);
  446. ctx.setLineWidth(20); // 设置圆环的宽度
  447. ctx.setStrokeStyle('#35383A'); // 设置圆环的颜色
  448. // ctx.setLineCap('round'); // 设置圆环端点的形状
  449. ctx.setLineCap('square'); // 设置圆环端点的形状
  450. ctx.beginPath(); //开始一个新的路径
  451. ctx.arc(100, 100, 90, 0 * Math.PI, 2 * Math.PI, false);
  452. //设置一个原点(110,110),半径为100的圆的路径到当前路径
  453. ctx.stroke(); //对当前路径进行描边
  454. ctx.draw();
  455. },
  456. drawCircle: function(step) {
  457. var ctx = uni.createCanvasContext('cpbar', this);
  458. // 进度条的渐变(中心x坐标-半径-边宽,中心Y坐标,中心x坐标+半径+边宽,中心Y坐标)
  459. var gradient = ctx.createLinearGradient(0, 0, 120, 0);
  460. let increase = 0.15;
  461. let end = (150 /100) * 2 * Math.PI ; // 最后的角度
  462. let current = (50 / 100) * 2 * Math.PI-Math.PI/2 ; // 起始角度
  463. if(this.portDetail.portStatus == 2){
  464. if(this.timeFlg){
  465. this.timeFlg=false
  466. let timer = setInterval(() => {
  467. gradient.addColorStop('0', '#57B03D');
  468. gradient.addColorStop('1.0', '#57B03D');
  469. ctx.setLineWidth(10);
  470. ctx.setStrokeStyle(gradient);
  471. ctx.setLineCap('square');
  472. ctx.beginPath();
  473. // 参数step 为绘制的百分比
  474. if (current < end) {
  475. current = current + increase;
  476. }
  477. if (current >= end) {
  478. //current = end;
  479. if(this.portDetail.portStatus != 2){
  480. clearInterval(timer);
  481. this.timeFlg=true
  482. }else{
  483. end = (150 /100) * 2 * Math.PI ; // 最后的角度
  484. current = (50 / 100) * 2 * Math.PI-Math.PI/2 ; // 起始角度
  485. }
  486. }
  487. ctx.arc(100, 100, 90, (50 / 100) * 2 * Math.PI-Math.PI/2, current, false);
  488. ctx.stroke();
  489. ctx.draw();
  490. }, 20);
  491. }
  492. }
  493. },
  494. toPage() {
  495. let imei = this.deviceInfo.deviceId;
  496. let ccid = this.deviceInfo.ccid;
  497. this.closeSocket();
  498. uni.navigateTo({
  499. url: '/pages/weitiandi/device/index?id=' + imei + '&ccid=' + ccid
  500. });
  501. },
  502. toSetting(){
  503. let imei = this.deviceInfo.deviceId;
  504. let ccid = this.deviceInfo.ccid;
  505. this.closeSocket();
  506. uni.navigateTo({
  507. url: '/pages/weitiandi/device/setting?id=' + imei + '&ccid=' + ccid
  508. });
  509. },
  510. i18(text) {
  511. return i18(text)
  512. },
  513. planCharge() {
  514. if (this.planInfo != null) {
  515. this.$modal.confirm("确认取消预约?").then(res => {
  516. this.cancelPlan();
  517. })
  518. } else {
  519. this.toPlan()
  520. }
  521. },
  522. cancelPlan() {
  523. cancelPlan(this.planInfo.id).then(res => {
  524. this.$modal.msg("取消成功");
  525. this.planInfo = null;
  526. this.getPlanInfo();
  527. })
  528. },
  529. getPlanInfo() {
  530. getPlanInfo(this.deviceInfo.deviceId, this.choosePort).then(res => {
  531. let data = res.data;
  532. if (data != null) {
  533. let planType = data.planType;
  534. if (planType == 1) { //单次预约
  535. let planInfo = {};
  536. planInfo.runTime = data.runTime;
  537. this.planInfo = planInfo;
  538. this.planInfo.id = data.id;
  539. } else {
  540. let planInfo = {};
  541. planInfo.runTime = data.runTime;
  542. let repeatDays = data.repeatDays;
  543. let days = repeatDays.split(",")
  544. let strs = "";
  545. for (let i = 0; i < days.length; i++) {
  546. if (strs.length > 0) {
  547. strs += ",";
  548. }
  549. strs += this.days[days[i]];
  550. }
  551. this.planInfo = planInfo;
  552. this.planInfo.runTime = strs + " " + data.repeatTime;
  553. this.planInfo.id = data.id;
  554. }
  555. }
  556. })
  557. },
  558. startTimer() {
  559. let self = this;
  560. if (this.refreshTimer != null) {
  561. clearTimeout(this.refreshTimer);
  562. }
  563. self.refreshTimer = setTimeout(function() {
  564. self.getInfo();
  565. self.startTimer();
  566. }, 30000);
  567. },
  568. confirmPort(e) {
  569. let value = e.value[0]
  570. this.choosePort = value.port;
  571. this.showPort = false;
  572. this.getInfo()
  573. },
  574. parsePortCmd(real_data) {
  575. let self = this;
  576. self.portDetail = real_data;
  577. self.portList = [
  578. []
  579. ];
  580. self.curPort = [];
  581. let port_first_status = self.portDetail["port_first_status"];
  582. let port_second_status = self.portDetail["port_second_status"]
  583. if (port_first_status) {
  584. self.portList[0].push({
  585. port: 1,
  586. text: "端口一"
  587. });
  588. self.curPort.push({
  589. text: "端口一",
  590. status: port_first_status,
  591. id: 1,
  592. })
  593. let power = self.portDetail.power;
  594. let voltage = parseInt(self.portDetail.voltage);
  595. if (voltage > 0) {
  596. let current = power / voltage;
  597. current = current.toFixed(1);
  598. self.portDetail.currentValue = current;
  599. }
  600. }
  601. if (port_second_status) {
  602. self.portList[0].push({
  603. port: 2,
  604. text: "端口二"
  605. });
  606. self.curPort.push({
  607. text: "端口二",
  608. status: port_second_status,
  609. id: 2
  610. })
  611. let power = self.portDetail.power_1;
  612. let voltage = parseInt(self.portDetail.voltage);
  613. if (voltage > 0) {
  614. let current = power / voltage;
  615. current = current.toFixed(1);
  616. self.portDetail.currentValue_1 = current;
  617. }
  618. }
  619. let choosePort = self.choosePort
  620. /**
  621. * chargeTime:0,
  622. * deviceTemp:0,
  623. * deviceV:0,
  624. * currentValue:0,
  625. * gonglv:0,
  626. * dianliang:0,
  627. * portStatus:0,
  628. */
  629. if (choosePort == 1) {
  630. self.portDetail.portStatus = port_first_status;
  631. self.chargeTime = self.portDetail.time;
  632. self.gonglv = self.portDetail.power;
  633. self.dianliang = self.portDetail.elec / 100;
  634. self.currentValue = self.portDetail.currentValue;
  635. if (port_first_status != 2) {
  636. self.chargeTime = 0;
  637. if (port_first_status == 6) {
  638. self.chargeTime = self.portDetail.time;
  639. }
  640. self.gonglv = 0;
  641. self.dianliang = 0;
  642. self.currentValue = 0;
  643. }
  644. } else if (choosePort == 2) {
  645. self.portDetail.portStatus = port_second_status;
  646. self.chargeTime = self.portDetail.time_1;
  647. self.gonglv = self.portDetail.power_1;
  648. self.dianliang = self.portDetail.elec_1 / 100;
  649. self.currentValue = self.portDetail.currentValue_1;
  650. if (port_second_status != 2) {
  651. self.chargeTime = 0;
  652. if (port_first_status == 6) {
  653. self.chargeTime = self.portDetail.time_1;
  654. }
  655. self.gonglv = 0;
  656. self.dianliang = 0;
  657. self.currentValue = 0;
  658. }
  659. }
  660. self.portStatus = self.portDetail.portStatus;
  661. self.deviceTemp = self.portDetail.dev_temper;
  662. self.deviceV = self.portDetail.voltage;
  663. self.$modal.closeLoading();
  664. if(self.portDetail.portStatus==2){
  665. this.drawCircle(25);
  666. }
  667. },
  668. initSocket(key) {
  669. let self = this;
  670. let socketUrl = getApp().globalData.config.socketUrl
  671. this.scriptTask = websocket({
  672. url: "/" + key + "/",
  673. });
  674. let scriptTask = this.scriptTask;
  675. scriptTask.onOpen(function(res) {
  676. console.log('WebSocket连接已打开!');
  677. self.connected = true;
  678. });
  679. scriptTask.onError(function(res) {
  680. self.connected = false;
  681. console.log(res);
  682. });
  683. scriptTask.onMessage(function(res) {
  684. let data = JSON.parse(res.data);
  685. let type = data.type;
  686. let real_data = data.real_data;
  687. if (type == 103) {
  688. self.parsePortCmd(real_data);
  689. }
  690. if (type == 116) {
  691. self.$modal.closeLoading();
  692. self.getInfo();
  693. }
  694. if (type == 113) {
  695. self.$modal.closeLoading();
  696. self.getInfo();
  697. }
  698. if (type == 96) {
  699. self.mainBoardInfo = real_data;
  700. self.formatMainboardData();
  701. self.$modal.closeLoading();
  702. }
  703. self.$forceUpdate();
  704. console.log('收到服务器内容:' + JSON.stringify(data));
  705. });
  706. scriptTask.onClose(function(res) {
  707. console.log('WebSocket 已关闭!');
  708. });
  709. },
  710. toSet() {
  711. this.closeSocket();
  712. uni.navigateTo({
  713. url: '/pages/weitiandi/device/setting?id=' + this.deviceInfo.deviceId + "&ccid=" + this
  714. .deviceInfo.ccid
  715. });
  716. },
  717. toPlan() {
  718. uni.navigateTo({
  719. url: '/pages/weitiandi/device/plan?port=' + this.choosePort + '&id=' + this.deviceInfo
  720. .deviceId + "&ccid=" + this.deviceInfo.ccid
  721. });
  722. },
  723. trigger() {
  724. let portStatus = this.portDetail.portStatus;
  725. if (portStatus == 2) { //需要停止充电
  726. this.$modal.confirm("需要停止充电么?").then(res => {
  727. this.stopCharge();
  728. this.drawCircle(0);
  729. })
  730. } else {
  731. if (portStatus == 1) {
  732. this.$modal.msg("请先将充电枪插入后再点击充电");
  733. }
  734. if (portStatus == 5) {
  735. this.$modal.confirm("确认开始充电么?").then(res => {
  736. this.startCharge();
  737. this.drawCircle(50); //参数为1-100
  738. })
  739. }
  740. }
  741. },
  742. getInfo() {
  743. let self = this;
  744. this.$modal.loading("正在获取状态,请稍等...",true);
  745. sendPortDetailCmd(this.deviceInfo).then(res => {
  746. this.$modal.loading("正在获取状态,请稍等...",true);
  747. this.visitTime = res.msg;
  748. if (!this.visitTime) {
  749. this.$modal.msg("请重新进入页面");
  750. return;
  751. }
  752. if (!this.scriptTask) {
  753. this.initSocket(this.deviceInfo.deviceId);
  754. }
  755. setTimeout(function() {
  756. getPortDetail(self.deviceInfo, self.visitTime).then(res => {
  757. let data = res.data;
  758. if (data != null) {
  759. self.parsePortCmd(data);
  760. } else {}
  761. });
  762. }, 500)
  763. })
  764. this.drawCircle(25)
  765. },
  766. stopCharge() {
  767. let self = this;
  768. this.deviceInfo.port = this.choosePort;
  769. stopCharge(this.deviceInfo).then(() => {
  770. self.$modal.loading("停止成功");
  771. setTimeout((() => {
  772. self.getInfo();
  773. }), 1000);
  774. })
  775. },
  776. startCharge() {
  777. let self = this;
  778. this.deviceInfo.port = this.choosePort;
  779. startCharge(this.deviceInfo).then(res => {
  780. self.$modal.loading("启动成功");
  781. setTimeout((() => {
  782. self.getInfo();
  783. }), 1000);
  784. })
  785. },
  786. getPortInfo() {
  787. this.startPortDetailTimer();
  788. },
  789. startPortDetailTimer() {
  790. let self = this;
  791. this.timer = setTimeout(function() {
  792. getPortDetail(self.deviceInfo, self.visitTime).then(res => {
  793. let data = res.data;
  794. if (data != null) {
  795. self.portDetail = data;
  796. self.checkStatusCheck();
  797. self.$modal.closeLoading();
  798. } else {
  799. self.startPortDetailTimer();
  800. }
  801. });
  802. }, 1000);
  803. },
  804. checkStatusCheck() {
  805. this.statusChangeTimer();
  806. },
  807. checkOnPage() {
  808. var pages = getCurrentPages() // 获取栈实例
  809. let currentRoute = pages[pages.length - 1].route; // 获取当前页面路由
  810. if ("pages/weitiandi/device/index" != currentRoute) {
  811. return false;
  812. }
  813. return true;
  814. },
  815. closeSocket() {
  816. this.scriptTask.close();
  817. this.scriptTask = null;
  818. },
  819. statusChangeTimer() {
  820. let self = this;
  821. this.statusTimer = setTimeout(function() {
  822. if (!this.checkOnPage()) {
  823. return;
  824. }
  825. checkStatusChange(self.deviceInfo, self.visitTime).then(res => {
  826. let data = res.data;
  827. if (data != null) {
  828. self.getInfo();
  829. } else {
  830. self.statusChangeTimer();
  831. }
  832. });
  833. }, 3000);
  834. },
  835. wifi() {
  836. uni.navigateTo({
  837. url: '/pages/bluetooth/index/wifi'
  838. });
  839. },
  840. }
  841. }
  842. </script>
  843. <style>
  844. .container {
  845. /* //background: rgb(208, 208, 208); */
  846. background-image: url('../../../static/images/new/starts/bg1.jpg');
  847. inset: 0;
  848. position: absolute;
  849. background-size: cover;
  850. background-repeat: no-repeat;
  851. }
  852. .prop-item {
  853. position: relative;
  854. display: flex;
  855. flex-direction: row;
  856. height: 40px;
  857. line-height: 40px;
  858. margin: 0 20rpx;
  859. }
  860. .prop-item-left {
  861. color: #BCBCBF;
  862. ;
  863. width: 30%;
  864. font-size: 14px;
  865. //margin-left: 36px;
  866. }
  867. .prop-item-image {
  868. width: 15px;
  869. height: 15px;
  870. position: absolute;
  871. left: 2vw;
  872. top: 0.5vh;
  873. }
  874. .prop-item-right {
  875. position: absolute;
  876. right: 10rpx;
  877. top: 5rpx;
  878. color: #BCBCBF;
  879. }
  880. .progress_box {
  881. /* position: relative; */
  882. width: 52vw;
  883. height: 35vh;
  884. /* background-color: red; */
  885. display: flex;
  886. text-align: center;
  887. flex-direction: row;
  888. }
  889. .pcds {
  890. margin-top: 90rpx;
  891. color: black;
  892. }
  893. .progress_bg {
  894. position: absolute;
  895. width: 60vw;
  896. height: 50vh;
  897. }
  898. .progress_txt {
  899. position: absolute;
  900. z-index: 99;
  901. width: 55vw;
  902. /* text-align: center;
  903. font-size: 28upx;
  904. margin: 16vw;
  905. /* margin-top: 54px;
  906. margin-left: 74px;
  907. color: #999999; */
  908. }
  909. .progress_bar {
  910. position: absolute;
  911. width: 60vw;
  912. margin: 2px;
  913. height: 50vh;
  914. }
  915. .progress-barup{
  916. position: absolute;
  917. width: 200px;
  918. margin: 2px;
  919. height: 196px;
  920. z-index: 1;
  921. }
  922. .progress_line {
  923. position: absolute;
  924. width: 60vw;
  925. height: 50vh;
  926. }
  927. .progress_info {
  928. display: flex;
  929. font-size: 10px;
  930. margin: 70px 30px;
  931. align-items: center;
  932. flex-direction: column;
  933. /* height: 14vh; */
  934. width: 35vw;
  935. }
  936. .header {
  937. position: relative;
  938. margin-top: 4vw;
  939. }
  940. .header-status-desc {
  941. position: absolute;
  942. text-align: center;
  943. width: 100%;
  944. bottom: 1vh;
  945. font-size: 5vw;
  946. font-weight: bold;
  947. color: #0E9F9B;
  948. margin-bottom: 5vw;
  949. }
  950. .header-status {
  951. font-weight: bold;
  952. text-align: center;
  953. }
  954. .chong-active {
  955. color: #0E9F9B
  956. }
  957. .header-img {
  958. width: 100%;
  959. padding: 5% 10%;
  960. text-align: center;
  961. }
  962. .header-img image {
  963. width: 100%;
  964. height: 23vh;
  965. }
  966. .info-body {
  967. background: #0E9F9B;
  968. height: 20vh;
  969. margin: 0 2%;
  970. border-radius: 1vw;
  971. margin-top: 2vh;
  972. color: #F8FCFF;
  973. line-height: 3vh;
  974. }
  975. .info-content {
  976. display: inline-block;
  977. width: 23%;
  978. text-align: center;
  979. margin: 1%;
  980. margin-top: 2.5vh;
  981. }
  982. .info-content-value {
  983. font-weight: bold;
  984. }
  985. .info-content-text {}
  986. .info-summary {
  987. display: flex;
  988. flex-direction: row;
  989. text-align: center;
  990. margin: 3vh 0;
  991. }
  992. .summary {
  993. width: 33%;
  994. line-height: 2.5vh;
  995. }
  996. .charge-num {
  997. color: #0E9F9B;
  998. font-weight: bold;
  999. font-size: 4.5vw;
  1000. }
  1001. .charge-title {
  1002. color: #B2B2B2;
  1003. font-weight: 400;
  1004. }
  1005. .btn-image {
  1006. width: 90%;
  1007. height: 100%;
  1008. }
  1009. .info-bottom-btn {
  1010. display: flex;
  1011. flex-direction: row;
  1012. text-align: center;
  1013. position: relative;
  1014. margin-top: 10vh;
  1015. }
  1016. .btn-area {
  1017. width: 50%;
  1018. height: 50px;
  1019. }
  1020. .left {
  1021. position: relative;
  1022. left: 10px;
  1023. text-align: right;
  1024. }
  1025. .right {
  1026. text-align: left;
  1027. position: relative;
  1028. right: 10px;
  1029. }
  1030. .info-plan {
  1031. text-align: center;
  1032. color: #0E9F9B;
  1033. margin-top: 1vh;
  1034. font-weight: 400;
  1035. }
  1036. .setting {
  1037. position: fixed;
  1038. right: -1px;
  1039. top: 10vh;
  1040. z-index: 999;
  1041. background: rgb(227, 243, 245);
  1042. color: #0E9F9B;
  1043. font-size: 10px;
  1044. border-radius: 5px;
  1045. padding: 3px;
  1046. }
  1047. .port {
  1048. height: 70px;
  1049. background: #F8FCFF;
  1050. border: 0px solid #F8FCFF;
  1051. box-shadow: 0px 0px 6px 1px rgba(101, 101, 101, 0.29);
  1052. border-radius: 4px;
  1053. margin: 0 10px;
  1054. position: relative;
  1055. margin-top: 10px;
  1056. }
  1057. .plan {
  1058. height: 70px;
  1059. background: #F8FCFF;
  1060. border: 0px solid #F8FCFF;
  1061. box-shadow: 0px 0px 6px 1px rgba(101, 101, 101, 0.29);
  1062. border-radius: 4px;
  1063. margin: 0 10px;
  1064. position: relative;
  1065. margin-top: 15px;
  1066. }
  1067. .port-image {
  1068. height: 40px;
  1069. width: 40px;
  1070. position: absolute;
  1071. top: 15px;
  1072. left: 20px;
  1073. }
  1074. .port-text {
  1075. position: absolute;
  1076. top: 13px;
  1077. left: 75px;
  1078. font-weight: bold;
  1079. }
  1080. .port-num {
  1081. position: absolute;
  1082. top: 38px;
  1083. left: 75px;
  1084. color: #B2B2B2;
  1085. }
  1086. .port-icon {
  1087. position: absolute;
  1088. top: 30px;
  1089. right: 5px;
  1090. width: 10px;
  1091. height: 16px;
  1092. }
  1093. .port-icon image {
  1094. width: 90%;
  1095. }
  1096. .body-bottom {
  1097. padding: 0 22px;
  1098. }
  1099. .body-bottom .info-content {
  1100. width: 30%;
  1101. }
  1102. .bottom-control {
  1103. height: 22vh;
  1104. margin: 0 2%;
  1105. margin-top: 2vh;
  1106. line-height: 3vh;
  1107. background: #F8FCFF;
  1108. border: 0px solid #F8FCFF;
  1109. box-shadow: 0px 0px 6px 1px rgba(101, 101, 101, 0.29);
  1110. border-radius: 4px;
  1111. padding: 3%;
  1112. }
  1113. .control-btn {
  1114. display: inline-block;
  1115. ;
  1116. height: 60px;
  1117. width: 25%;
  1118. padding: 10px 20px;
  1119. text-align: center;
  1120. font-size: 12px;
  1121. color: black;
  1122. }
  1123. .control-btn .btn-image {}
  1124. #box {
  1125. /* width: 300px; */
  1126. height: 280px;
  1127. position: relative;
  1128. /* 背景色 */
  1129. /* background: #f7f6f6; */
  1130. overflow: hidden;
  1131. /* padding: 50px 0; */
  1132. box-sizing: border-box;
  1133. ;
  1134. }
  1135. .box {
  1136. width: 100%;
  1137. height: 100%;
  1138. position: absolute;
  1139. display: flex;
  1140. justify-content: center;
  1141. /* 此处尽量不要设置背景色,可以选择在父标签上设置背景色,否则没有黏黏的效果 */
  1142. filter: url("#goo");
  1143. }
  1144. /* 电量文字 */
  1145. .text {
  1146. font-weight: 200;
  1147. font-size: 20px;
  1148. margin-top: 5px;
  1149. text-align: center;
  1150. color: #ff6600;
  1151. }
  1152. /* 电量文字 */
  1153. .text span {
  1154. font-size: 15px;
  1155. }
  1156. /* 顶部的两个旋转小球 */
  1157. .top_ball {
  1158. width: 200px;
  1159. height: 200px;
  1160. border-radius: 35%;
  1161. opacity: 0.5;
  1162. position: absolute;
  1163. top: 20px;
  1164. z-index: 10;
  1165. /* 从中心向外剪切圆,相当于掏空 */
  1166. -webkit-mask: radial-gradient(transparent 95px, white 0px);
  1167. }
  1168. /* 顶部的两个旋转小球 */
  1169. .top_ball.one {
  1170. background: var(--c);
  1171. animation: ballZhuan 5s linear infinite;
  1172. }
  1173. /* 顶部的两个旋转小球 */
  1174. .top_ball.two {
  1175. background: var(--c);
  1176. animation: ballZhuan 8s linear infinite;
  1177. }
  1178. .three {
  1179. width: 170px;
  1180. height: 170px;
  1181. border-radius: 300px;
  1182. opacity: 1;
  1183. position: absolute;
  1184. top: 20px;
  1185. z-index: 10;
  1186. /* 从中心向外剪切圆,相当于掏空 */
  1187. /* -webkit-mask: radial-gradient(transparent 95px, white 0px); */
  1188. background: #ffffff;
  1189. /* animation: ballZhuan 9s linear infinite; */
  1190. overflow: hidden;
  1191. box-shadow: 0px 0px 19px 1px #2196f3;
  1192. }
  1193. .four {
  1194. width: 200px;
  1195. height: 200px;
  1196. border-radius: 80px;
  1197. opacity: 0.3;
  1198. position: absolute;
  1199. top: 10px;
  1200. z-index: 10;
  1201. /* 从中心向外剪切圆,相当于掏空 */
  1202. /* -webkit-mask: radial-gradient(transparent 95px, white 0px); */
  1203. background: #2196f3;
  1204. animation: ballZhuan1 linear infinite;
  1205. animation-duration: 11s;
  1206. }
  1207. .five {
  1208. width: 270px;
  1209. height: 270px;
  1210. border-radius: 99px;
  1211. opacity: 0.6;
  1212. position: absolute;
  1213. top: 30px;
  1214. z-index: 10;
  1215. /* 从中心向外剪切圆,相当于掏空 */
  1216. /* -webkit-mask: radial-gradient(transparent 95px, white 0px); */
  1217. background: #2196f3;
  1218. animation: ballZhuan1 linear infinite;
  1219. /* transform: rotate(120deg); */
  1220. animation-duration: 9s;
  1221. left: -67px;
  1222. }
  1223. .six {
  1224. width: 270px;
  1225. height: 270px;
  1226. border-radius: 99px;
  1227. opacity: 0.6;
  1228. position: absolute;
  1229. top: 30px;
  1230. z-index: 10;
  1231. /* 从中心向外剪切圆,相当于掏空 */
  1232. /* -webkit-mask: radial-gradient(transparent 95px, white 0px); */
  1233. background: #2196f3;
  1234. animation: ballZhuan1 7s linear infinite;
  1235. /* transform: rotate(120deg); */
  1236. right: -67px;
  1237. }
  1238. @keyframes ballZhuan {
  1239. 100% {
  1240. transform: rotate(360deg);
  1241. }
  1242. }
  1243. @keyframes ballZhuan1 {
  1244. 100% {
  1245. transform: rotate(360deg);
  1246. }
  1247. }
  1248. /* 底部的小球 */
  1249. .dot {
  1250. display: block;
  1251. width: 20px;
  1252. height: 20px;
  1253. border-radius: 50%;
  1254. background: rgba(101, 192, 255, 0.28);
  1255. position: absolute;
  1256. z-index: 1000;
  1257. bottom: -50px;
  1258. }
  1259. .dot:nth-of-type(1) {
  1260. width: 40px;
  1261. height: 40px;
  1262. right: 116px;
  1263. animation: dotMove 5s linear infinite;
  1264. }
  1265. .dot:nth-of-type(2) {
  1266. width: 50px;
  1267. height: 50px;
  1268. left: 120px;
  1269. animation: dotMove 4s linear infinite;
  1270. }
  1271. .dot:nth-of-type(3) {
  1272. animation: dotMove 2s linear infinite;
  1273. }
  1274. .dot:nth-of-type(4) {
  1275. width: 15px;
  1276. height: 15px;
  1277. left: 130px;
  1278. animation: dotMove 2s linear infinite;
  1279. }
  1280. .dot:nth-of-type(5) {
  1281. width: 30px;
  1282. height: 30px;
  1283. animation: dotMove 3s linear infinite;
  1284. }
  1285. @keyframes dotMove {
  1286. 0% {
  1287. transform: translateY(0px);
  1288. opacity: 1;
  1289. }
  1290. 98% {
  1291. opacity: 1;
  1292. }
  1293. 100% {
  1294. transform: translateY(-260px);
  1295. opacity: 0;
  1296. }
  1297. }
  1298. .w-flex {
  1299. display: -webkit-box;
  1300. display: -webkit-flex;
  1301. display: flex;
  1302. padding: 0px 25px;
  1303. }
  1304. .w-flex__item {
  1305. -webkit-box-flex: 1;
  1306. -webkit-flex: 1;
  1307. flex: 1;
  1308. }
  1309. .w-item {
  1310. text-align: center;
  1311. padding: 5px;
  1312. }
  1313. .w-item-tit {
  1314. font-size: 14px;
  1315. color: #888;
  1316. }
  1317. .w-item-num {
  1318. font-size: 18px;
  1319. color: #111;
  1320. }
  1321. .can {
  1322. position: relative;
  1323. z-index: 0;
  1324. width: 211px;
  1325. height: 211px;
  1326. background-size: cover;
  1327. display: flex;
  1328. justify-content: center;
  1329. align-items: center;
  1330. }
  1331. .dtop {
  1332. background: url(/static/images/new/box1.png);
  1333. background-size: cover;
  1334. width: 260px;
  1335. height: 236px;
  1336. display: flex;
  1337. justify-content: center;
  1338. align-items: center;
  1339. left: 15%;
  1340. position: relative;
  1341. }
  1342. .dstatus {
  1343. margin-top: 0.1rem;
  1344. display: flex;
  1345. flex-wrap: wrap;
  1346. justify-content: space-evenly;
  1347. align-content: center;
  1348. }
  1349. .ditem {
  1350. width: 30%;
  1351. display: flex;
  1352. flex-direction: column;
  1353. align-items: center;
  1354. margin-bottom: 0.3rem;
  1355. margin-top: 10px;
  1356. }
  1357. .itemimg {
  1358. width: 50px;
  1359. height: 50px;
  1360. }
  1361. .item-value {
  1362. font-weight: bold;
  1363. font-size: 15px;
  1364. margin: 4px 0;
  1365. }
  1366. .item-text {
  1367. font-size: 11px;
  1368. margin: 1px 0;
  1369. color: aliceblue;
  1370. }
  1371. .start {
  1372. background: #1A87FF;
  1373. color: #fff;
  1374. width: 45%;
  1375. height: 50px;
  1376. min-height: 40px;
  1377. border-radius: 50px;
  1378. display: flex;
  1379. justify-content: center;
  1380. align-items: center;
  1381. font-size: 20px;
  1382. font-weight: bold;
  1383. }
  1384. .dbtns {
  1385. display: flex;
  1386. margin-top: 10px;
  1387. justify-content: space-between;
  1388. padding: 0 30px;
  1389. }
  1390. .get {
  1391. background: #fff;
  1392. border: 1px solid #1A87FF;
  1393. color: #1A87FF;
  1394. width: 45%;
  1395. height: 50px;
  1396. min-height: 40px;
  1397. border-radius: 50px;
  1398. display: flex;
  1399. justify-content: center;
  1400. align-items: center;
  1401. font-size: 20px;
  1402. font-weight: bold;
  1403. }
  1404. .dtip {
  1405. margin: 20px 20px;
  1406. padding: 10px;
  1407. background: rgba(127, 200, 251, 0.1);
  1408. border: 1px solid #7FC8FB;
  1409. box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.19);
  1410. border-radius: 5px;
  1411. font-size: 17px;
  1412. font-weight: 400;
  1413. color: #B8B9BA;
  1414. margin-bottom: 10px;
  1415. }
  1416. .p1 {
  1417. font-size: 20px;
  1418. color: white;
  1419. font-weight: bold;
  1420. margin-top: 10px;
  1421. /* margin-left: -1vh;; */
  1422. }
  1423. .stip {
  1424. text-align: center;
  1425. z-index: 9999;
  1426. }
  1427. </style>