status.vue 42 KB

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