status.vue 39 KB

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