status.vue 37 KB

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