status.vue 37 KB

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