detail.vue 40 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536
  1. <template>
  2. <view class="bigBox">
  3. <u-tabs
  4. :list="list"
  5. :is-scroll="false"
  6. :current="current"
  7. @change="change"
  8. active-color="#14A478"
  9. ></u-tabs>
  10. <view class="infoBox" v-if="current == 0">
  11. <view :class="['info', equipInfo.status == 1 ? 'on' : 'off']">
  12. <p @click="copy(equipInfo.imei || equipInfo.device_id || equipInfo.id)">
  13. 设备ID:{{ equipInfo.imei || equipInfo.device_id || equipInfo.id }}
  14. <image
  15. :src="$imageURL+'/bigdata_app/image/environment/fuzhi.png'"
  16. mode=""
  17. class="tishi"
  18. >
  19. </image>
  20. </p>
  21. <p>
  22. 设备名称:{{
  23. equipInfo.device_name || equipInfo.name || '无'
  24. }}
  25. </p>
  26. <p>最新上报时间:{{ equipInfo.addtime | timeFormat }}</p>
  27. <p>最新地址:{{ equipInfo.address }}</p>
  28. <p class="fillin">诱芯名称:{{ equipInfo.decoy }}</p>
  29. <!-- <p @click="glass_show=true">诱芯更换时间:<span style="margin:0 20rpx;">{{yxchangetime}}</span><u-icon
  30. name="edit-pen" color="#f0ad4e" size="28"></u-icon></p> -->
  31. <p>诱芯到期时间:{{ equipInfo.xy_expire }}</p>
  32. <!-- <u-calendar v-model="glass_show" mode="date" :max-date="date" @change="timeChange"></u-calendar>
  33. <u-calendar v-model="glass_showtwo" mode="date" :max-date="date" @change="timeChangetwo"></u-calendar> -->
  34. </view>
  35. <view class="cardInfo">
  36. <text class="title">设备控制</text>
  37. <view class="controlCard">
  38. <view class="preBtn" v-for="btn in btnList" :key="btn.class">
  39. <view :class="`btnBox ${btn.class}`" @click="btnFun(btn.code)">
  40. <text :class="btn.icon"></text>
  41. </view>
  42. <view>{{ btn.text }}</view>
  43. </view>
  44. </view>
  45. </view>
  46. <view class="cardInfo">
  47. <text class="title">监测数据</text>
  48. <view class="controlCard noBg">
  49. <u-row gutter="30" justify="between">
  50. <u-col
  51. span="5.8"
  52. class="preInfo"
  53. v-for="btn in dataList"
  54. :key="btn.icon"
  55. >
  56. <view class="btnBox">
  57. <text :class="btn.icon"></text>
  58. </view>
  59. <view class="textBox">
  60. <view>
  61. {{ newDataObj[btn.unit] || ''}}
  62. </view>
  63. <view class="name">{{ btn.text }}</view>
  64. </view>
  65. </u-col>
  66. </u-row>
  67. </view>
  68. </view>
  69. <view class="cardInfo" v-if="JSON.stringify(deviceObj) != '{}'">
  70. <text class="title">设备信息</text>
  71. <view class="controlCard noBg">
  72. <u-cell-group>
  73. <u-cell-item
  74. v-for="btn in deviceDataList"
  75. :key="btn.text"
  76. :title="btn.text"
  77. :value="deviceObj[btn.key]"
  78. :arrow="false"
  79. :border-bottom="true"
  80. ></u-cell-item>
  81. </u-cell-group>
  82. </view>
  83. </view>
  84. </view>
  85. <!-- 数据统计 -->
  86. <view class="infoBox" v-if="current == 1">
  87. <view class="cardInfo">
  88. <text class="title">统计数据</text>
  89. <view class="chartBox">
  90. <view class="timeBox">
  91. <u-icon name="calendar" size="30" class="iconBox"></u-icon>
  92. <view class="text" @click="showRangeTime = true">{{
  93. photoTimeRangeText
  94. }}</view>
  95. <u-icon
  96. name="arrow-right"
  97. v-if="photoTimeRangeText == '请选择日期'"
  98. ></u-icon>
  99. <u-icon name="close" v-else @click="clearTimeFun('chart')"></u-icon>
  100. </view>
  101. <u-calendar
  102. v-model="showRangeTime"
  103. mode="range"
  104. range-color="#999"
  105. btn-type="success"
  106. active-bg-color="#0BBC58"
  107. range-bg-color="rgba(11,188,88,0.13)"
  108. @change="(e) => changePhotoTime(e, 'chart')"
  109. ></u-calendar>
  110. <canvas
  111. v-if="showCanvas"
  112. canvas-id="canvasColumnA"
  113. id="canvasColumnA"
  114. class="charts"
  115. @touchstart="touchLineA($event)"
  116. @touchmove="moveLineA($event)"
  117. @touchend="touchEndLineA($event)"
  118. disable-scroll="true"
  119. :style="{
  120. width: cWidth * pixelRatio + 'px',
  121. height: cHeight * pixelRatio + 'px',
  122. transform: 'scale(' + 1 / pixelRatio + ')',
  123. 'margin-left': (-cWidth * (pixelRatio - 1)) / 2 + 'px',
  124. 'margin-top': (-cHeight * (pixelRatio - 1)) / 2 + 'px',
  125. }"
  126. >
  127. </canvas>
  128. <view class="noEmpty" v-else> 暂无数据 </view>
  129. </view>
  130. </view>
  131. <view class="cardInfo">
  132. <text class="title">虫情分析</text>
  133. <view class="chartBox">
  134. <view class="pestInfo">
  135. <view class="pest">
  136. <text>害虫种类</text>
  137. <text class="name">{{ analyInfo.decoy }}</text>
  138. </view>
  139. <view class="pest">
  140. <text>日杀虫数量</text>
  141. <text class="name">{{ analyInfo.count }}头</text>
  142. </view>
  143. <view class="pest">
  144. <text>处理意见</text>
  145. <text class="name">{{ analyInfo.advice }}</text>
  146. </view>
  147. </view>
  148. <view class="pestStatus">
  149. <view :class="['block', analyInfo.count < 30 ? 'active' : '']">
  150. <view class="iconBox green">
  151. <text class="yficonfont icon-small"></text>
  152. </view>
  153. <view class="blueText">
  154. <view>平静期</view>
  155. <view>0-30</view>
  156. </view>
  157. </view>
  158. <view
  159. :class="[
  160. 'block',
  161. analyInfo.count >= 30 && analyInfo.count < 60 ? 'active' : '',
  162. ]"
  163. >
  164. <view class="iconBox yellow">
  165. <text class="yficonfont icon-middle"></text>
  166. </view>
  167. <view class="yellowText">
  168. <view>始发期</view>
  169. <view>30-60</view>
  170. </view>
  171. </view>
  172. <view :class="['block', analyInfo.count >= 60 ? 'active' : '']">
  173. <view class="iconBox danger">
  174. <text class="yficonfont icon-most"></text>
  175. </view>
  176. <view class="redText">
  177. <view>爆发期</view>
  178. <view>≥60</view>
  179. </view>
  180. </view>
  181. </view>
  182. </view>
  183. </view>
  184. </view>
  185. <!-- 图片列表 -->
  186. <view class="infoBox" v-if="current == 2">
  187. <view class="imgList">
  188. <view
  189. class="preImg"
  190. v-for="(img, index) in photoList"
  191. :key="img.addtime"
  192. >
  193. <text class="text">{{ img.addtime }}</text>
  194. <u-image
  195. width="100%"
  196. height="226rpx"
  197. :src="img.addr"
  198. @click="examine(index)"
  199. ></u-image>
  200. </view>
  201. <u-loadmore
  202. class="loadBox"
  203. :status="loadStatus"
  204. :icon-type="iconType"
  205. :load-text="loadText"
  206. @loadmore="loadMore"
  207. />
  208. </view>
  209. <view class="timeBox">
  210. <u-icon name="calendar" size="30" class="iconBox"></u-icon>
  211. <view class="text" @click="showRangeTime = true">{{
  212. photoTimeRangeText
  213. }}</view>
  214. <u-icon
  215. name="arrow-right"
  216. v-if="photoTimeRangeText == '请选择日期'"
  217. ></u-icon>
  218. <u-icon name="close" v-else @click="clearTimeFun('photo')"></u-icon>
  219. </view>
  220. <u-calendar
  221. v-if="showRangeTime"
  222. v-model="showRangeTime"
  223. mode="range"
  224. range-color="#999"
  225. btn-type="success"
  226. active-bg-color="#0BBC58"
  227. range-bg-color="rgba(11,188,88,0.13)"
  228. @change="(e) => changePhotoTime(e, 'photo')"
  229. ></u-calendar>
  230. </view>
  231. <!-- 设备控制 -->
  232. <view class="bgColor" v-if="current == 3">
  233. <u-form :model="equipContrlForm1" :label-width="180">
  234. <view class="" v-if="myuser_type">
  235. <u-divider>管理员操作</u-divider>
  236. <u-form-item label="升级文件地址" :label-width="220">
  237. <u-input v-model="ota_url" />
  238. </u-form-item>
  239. <u-button
  240. size="mini"
  241. type="primary"
  242. @click="equipBtnControl('reboot')"
  243. >重启</u-button
  244. >
  245. <u-button
  246. size="mini"
  247. class="btn"
  248. type="primary"
  249. @click="equipBtnControl('update')"
  250. >升级</u-button
  251. >
  252. <u-divider>设备控制</u-divider>
  253. </view>
  254. <!-- <u-form-item label="设备名称"><u-input v-model="equipContrlForm1.devname" /></u-form-item> -->
  255. <u-form-item label="高压包开关状态" :label-width="240">
  256. <u-radio-group v-model="equipContrlForm1.dev_work_onoff">
  257. <u-radio :name="1">开</u-radio>
  258. <u-radio :name="0">关</u-radio>
  259. </u-radio-group>
  260. </u-form-item>
  261. <u-form-item label="工作模式" :label-width="240">
  262. <u-radio-group v-model="equipContrlForm1.dev_work_mode">
  263. <u-radio :name="1">自动</u-radio>
  264. <u-radio :name="2">手动</u-radio>
  265. <u-radio :name="3">定时</u-radio>
  266. </u-radio-group>
  267. </u-form-item>
  268. <u-form-item
  269. label="定时时长"
  270. :label-width="240"
  271. v-if="equipContrlForm1.dev_work_mode == 3"
  272. >
  273. <text @click="equipContrlForm1.show_st = true">{{
  274. equipContrlForm1.st
  275. }}</text
  276. >-
  277. <text @click="equipContrlForm1.show_et = true">{{
  278. equipContrlForm1.et
  279. }}</text>
  280. <u-picker
  281. mode="time"
  282. v-model="equipContrlForm1.show_st"
  283. :default-time="equipContrlForm1.st"
  284. :params="params"
  285. @confirm="(e) => changeControlTime(e, 'st')"
  286. ></u-picker>
  287. <u-picker
  288. mode="time"
  289. v-model="equipContrlForm1.show_et"
  290. :default-time="equipContrlForm1.et"
  291. :params="params"
  292. @confirm="(e) => changeControlTime(e, 'et')"
  293. ></u-picker>
  294. </u-form-item>
  295. <!-- <u-form-item label="SIM卡号" :label-width="200">
  296. <u-input v-model="equipContrlForm1.sim" />
  297. </u-form-item> -->
  298. <u-form-item label="心跳间隔(S)" :label-width="200">
  299. <u-input v-model="equipContrlForm1.heart_time" type="number" />
  300. </u-form-item>
  301. <u-form-item label="太阳能电压阈值(V)" :label-width="280">
  302. <u-input v-model="equipContrlForm1.solar_threshold" type="number" />
  303. </u-form-item>
  304. <u-form-item label="太阳能电压最大值(V)" :label-width="300">
  305. <u-input v-model="equipContrlForm1.solarmax" type="number" />
  306. </u-form-item>
  307. <u-form-item label="数据上传频率(min)" :label-width="300">
  308. <u-input v-model="equipContrlForm1.upload_time" type="number" />
  309. </u-form-item>
  310. <u-button size="medium " type="primary" @click="equipControlSubm"
  311. >保存</u-button
  312. >
  313. </u-form>
  314. </view>
  315. <!-- 拍照定时 -->
  316. <u-modal
  317. v-model="photoTimeLayer"
  318. width="80%"
  319. :async-close="true"
  320. :show-cancel-button="true"
  321. @confirm="devicePhotoTime"
  322. >
  323. <view class="slot-content">
  324. <view class="expireBox">
  325. <u-tag text="注意:00:00为不拍照" mode="dark" type="warning" />
  326. <u-form>
  327. <u-form-item
  328. :label="`时间${index + 1}`"
  329. :label-width="180"
  330. v-for="(time, index) in photoTimeArray"
  331. :key="time.key"
  332. >
  333. <text @click="time.show = true">{{ time.value }}</text>
  334. <u-picker
  335. mode="time"
  336. v-model="time.show"
  337. :default-time="time.value"
  338. :params="params"
  339. @confirm="(e) => changeSnapTime(e, time.key, index)"
  340. ></u-picker>
  341. </u-form-item>
  342. <!-- <u-button size="mini" type="primary" @click="addTime(photoTimeArray.length)">添加</u-button> -->
  343. </u-form>
  344. </view>
  345. </view>
  346. </u-modal>
  347. <!-- 信息素弹框 -->
  348. <u-modal
  349. v-model="expireInfoLayer"
  350. width="90%"
  351. :async-close="true"
  352. :show-cancel-button="true"
  353. @confirm="changeExpireFun"
  354. >
  355. <view class="slot-content">
  356. <view class="expireBox">
  357. <u-form ref="uForm">
  358. <u-form-item label="信息素名称" :label-width="180">
  359. <u-input
  360. v-model="decoy"
  361. type="text"
  362. :border="true"
  363. placeholder="请输入信息素名称"
  364. />
  365. </u-form-item>
  366. <u-form-item label="新信息素可使用时间" :label-width="280">
  367. <u-radio-group v-model="xy_expire_time">
  368. <u-radio
  369. v-for="(item, index) in expireTimeList"
  370. :key="index"
  371. :name="item.value"
  372. >
  373. {{ item.label }}
  374. </u-radio>
  375. </u-radio-group>
  376. </u-form-item>
  377. </u-form>
  378. </view>
  379. </view>
  380. </u-modal>
  381. </view>
  382. </template>
  383. <script>
  384. import uCharts from '../../../components/js_sdk/u-charts/u-charts/u-charts.js';
  385. var canvaColumnA = null;
  386. export default {
  387. data() {
  388. return {
  389. myuser_type: '',
  390. equipInfoImei: '',
  391. equipInfo_d_id: '',
  392. btnList: [
  393. {
  394. text: '更换信息素',
  395. icon: 'yficonfont icon-weimingming-34',
  396. class: 'green',
  397. code: 'changeInfo',
  398. },
  399. ],
  400. list: [
  401. {
  402. name: '基本信息',
  403. },
  404. ],
  405. current: 0,
  406. equipInfo: {},
  407. dataList: [
  408. {
  409. text: '空气温度', // 中文
  410. unit: 'air_temp', // 对应字段
  411. data: '',
  412. icon: 'yficonfont icon-kongqiwendu', // iconclass名称
  413. },
  414. {
  415. text: '空气湿度',
  416. unit: 'air_humi',
  417. data: '',
  418. icon: 'yficonfont icon-shuizhi',
  419. },
  420. {
  421. text: '风力',
  422. unit: 'wind_force',
  423. isSmall: true,
  424. data: '',
  425. icon: 'yficonfont icon-fengli',
  426. },
  427. {
  428. text: '风向',
  429. unit: 'wind_dir',
  430. isSmall: true,
  431. data: '',
  432. icon: 'yficonfont icon-fengxiang',
  433. },
  434. {
  435. text: '害虫数量',
  436. unit: 'bugcnt',
  437. data: '',
  438. icon: 'yficonfont icon-chouchongbug',
  439. },
  440. {
  441. text: '光照强度',
  442. unit: 'light',
  443. data: '',
  444. isSmall: true,
  445. icon: 'yficonfont icon-qingtian',
  446. },
  447. {
  448. text: '降雨',
  449. unit: 'rain_status',
  450. data: '',
  451. icon: 'yficonfont icon-yu',
  452. },
  453. {
  454. text: '电池电量',
  455. unit: 'bat_level',
  456. data: '',
  457. icon: 'yficonfont icon-80dianliang',
  458. },
  459. {
  460. text: '信号强度',
  461. unit: 'gprs',
  462. data: '',
  463. icon: 'yficonfont icon-wifi',
  464. },
  465. {
  466. text: '定位信噪比',
  467. unit: 'cn0',
  468. data: '',
  469. isSmall: true,
  470. icon: 'yficonfont icon-dingwei1',
  471. },
  472. {
  473. text: '太阳能电压',
  474. unit: 'solar_voltage',
  475. data: '',
  476. icon: 'yficonfont icon-guangfuzujianshuliang',
  477. },
  478. {
  479. text: '蓄电池电压',
  480. unit: 'bat_val',
  481. data: '',
  482. icon: 'yficonfont icon-xudianchi',
  483. },
  484. ],
  485. dataLoading: true,
  486. newDataObj: {},
  487. deviceDataList: [
  488. {
  489. text: '设备名',
  490. key: 'devname',
  491. },
  492. {
  493. text: '设备版本号',
  494. key: 'version',
  495. },
  496. {
  497. text: '心跳间隔',
  498. key: 'heart_time',
  499. },
  500. {
  501. text: '太阳能电压阀值',
  502. key: 'solar_threshold',
  503. },
  504. {
  505. text: '太阳能电压最大值',
  506. key: 'solarmax',
  507. },
  508. {
  509. text: '数据上传频率',
  510. key: 'upload_time',
  511. },
  512. {
  513. text: '工作模式',
  514. key: 'dev_work_mode',
  515. },
  516. {
  517. text: '定时模式时间',
  518. key: 'dev_work_time',
  519. },
  520. {
  521. text: '高压包开关状态',
  522. key: 'dev_work_onoff',
  523. },
  524. {
  525. text: 'SIM卡号',
  526. key: 'sim',
  527. },
  528. ],
  529. deviceLoading: true,
  530. deviceObj: {},
  531. photoTimeArray: [],
  532. photoTimeLayer: false,
  533. expireInfoLayer: false,
  534. xy_expire_time: 2, // 时间
  535. decoy: '', // 诱芯名称
  536. expireTimeList: [
  537. {
  538. label: '1个月',
  539. value: 1,
  540. },
  541. {
  542. label: '2个月',
  543. value: 2,
  544. },
  545. {
  546. label: '3个月',
  547. value: 3,
  548. },
  549. {
  550. label: '4个月',
  551. value: 4,
  552. },
  553. ],
  554. params: {
  555. year: false,
  556. month: false,
  557. day: false,
  558. hour: true,
  559. minute: true,
  560. second: false,
  561. },
  562. //设备控制
  563. equipContrlForm1: {
  564. devname: '',
  565. heart_time: '',
  566. solar_threshold: '',
  567. solarmax: '',
  568. upload_time: 0,
  569. dev_work_mode: '',
  570. dev_work_timeArray: '',
  571. dev_work_onoff: '',
  572. sim: '',
  573. et: '',
  574. st: '',
  575. show_st: false,
  576. show_et: false,
  577. // st: '', //时控开始时间
  578. // et: '', //时控结束时间
  579. // dat_f: null ,//数据上传时间间隔
  580. // ds:''//开关,1开机,0关机
  581. },
  582. ota_url: '',
  583. photoList: [],
  584. photoLoading: true,
  585. showRangeTime: false,
  586. photoTimeRange: '',
  587. photoTimeRangeText: '请选择日期',
  588. page: 1,
  589. total: 0,
  590. loadStatus: '',
  591. iconType: 'flower',
  592. loadText: {
  593. loadmore: '点击加载更多',
  594. loading: '努力加载中',
  595. nomore: '没有更多啦~',
  596. },
  597. cWidth: '400',
  598. cHeight: '400',
  599. pixelRatio: 1,
  600. showCanvas: false,
  601. analyInfo: {
  602. decoy: '',
  603. count: '',
  604. },
  605. };
  606. },
  607. onLoad(option) {
  608. this.cWidth = uni.upx2px(650);
  609. this.cHeight = uni.upx2px(500);
  610. uni.getStorage({
  611. key: 'jurisdiction',
  612. success: (res) => {
  613. let items = JSON.parse(res.data).filter((item) => {
  614. return item.pur_id == 36;
  615. });
  616. var arr = items[0].children;
  617. for (var i = 0; i < arr.length; i++) {
  618. switch (arr[i].pur_id) {
  619. case 338:
  620. let newChildren = arr[i].children;
  621. let hasImg = newChildren.some((item) => {
  622. return item.pur_id == 341;
  623. });
  624. let hasControl = newChildren.some((item) => {
  625. return item.pur_id == 340;
  626. });
  627. if (hasImg) {
  628. this.list.push(
  629. {
  630. name: '数据分析',
  631. },
  632. {
  633. name: '图片列表',
  634. }
  635. );
  636. this.btnList.push(
  637. {
  638. text: '拍照定时',
  639. icon: 'yficonfont icon-dingshi',
  640. class: 'blue',
  641. code: 'photoTime',
  642. },
  643. {
  644. text: '一键拍照',
  645. icon: 'yficonfont icon-paizhao-xianxing',
  646. class: 'yellow',
  647. code: 'tackPhoto',
  648. }
  649. );
  650. }
  651. if (hasControl) {
  652. this.list.push({
  653. name: '设备控制',
  654. });
  655. this.btnList.push({
  656. text: '设备清虫',
  657. icon: 'yficonfont icon-chouchongbug',
  658. class: 'danger',
  659. code: 'clear',
  660. });
  661. }
  662. break;
  663. }
  664. }
  665. },
  666. });
  667. const detail = JSON.parse(option.detail);
  668. this.equipInfoImei = detail.imei || detail.device_id || detail.id || '无';
  669. this.equipInfo_d_id = detail.d_id;
  670. this.getEquipInfo();
  671. // console.log(this.equipInfo);
  672. this.getData();
  673. this.getDeviceData();
  674. uni.getStorage({
  675. key: 'myuser_type',
  676. success: (res) => {
  677. if (Number(res.data) == 1) {
  678. this.myuser_type = true;
  679. }
  680. },
  681. });
  682. },
  683. methods: {
  684. showColumn(id, xtitle, xinfo) {
  685. var _self = this;
  686. console.log(_self.cWidth, '_self.cWidth');
  687. const ctx = uni.createCanvasContext(id, this);
  688. canvaColumnA = new uCharts({
  689. context: ctx,
  690. type: 'line',
  691. legend: {
  692. position: 'top',
  693. },
  694. fontSize: 11,
  695. background: '#FFFFFF',
  696. pixelRatio: 1,
  697. animation: true,
  698. dataLabel: false,
  699. categories: xtitle,
  700. series: xinfo,
  701. enableScroll: true, //开启图表拖拽功能
  702. xAxis: {
  703. disableGrid: true,
  704. type: 'grid',
  705. gridType: 'dash',
  706. itemCount: 4, //x轴单屏显示数据的数量,默认为5个
  707. scrollShow: true, //新增是否显示滚动条,默认false
  708. // scrollAlign: 'left', //滚动条初始位置
  709. scrollBackgroundColor: '#F7F7FF', //默认为 #EFEBEF
  710. scrollColor: '#DEE7F7', //默认为 #A6A6A6
  711. },
  712. width: _self.cWidth * 1,
  713. height: _self.cHeight * 1,
  714. yAxis: {},
  715. extra: {
  716. line: {
  717. type: 'curve',
  718. },
  719. },
  720. });
  721. },
  722. touchLineA(e) {
  723. console.log(e);
  724. canvaColumnA.scrollStart(e);
  725. },
  726. moveLineA(e) {
  727. canvaColumnA.scroll(e);
  728. },
  729. touchEndLineA(e) {
  730. canvaColumnA.scrollEnd(e);
  731. //下面是toolTip事件,如果滚动后不需要显示,可不填写
  732. canvaColumnA.showToolTip(e, {
  733. format: function (item, category) {
  734. return category + ' ' + item.name + ':' + item.data;
  735. },
  736. });
  737. },
  738. async lineChartPest(type) {
  739. let { photoTimeRange } = this;
  740. let res = await this.$myRequest({
  741. method: 'post',
  742. url: '/api/api_gateway?method=lpsxy.views.pest_count',
  743. data: {
  744. d_id: this.equipInfo_d_id,
  745. start: photoTimeRange ? photoTimeRange[0] / 1000 : '',
  746. end: photoTimeRange ? photoTimeRange[1] / 1000 : '',
  747. },
  748. });
  749. if (res.length > 0) {
  750. this.showCanvas = true;
  751. let name = [];
  752. let ydata = [];
  753. res.forEach((item) => {
  754. name.push(item.date);
  755. ydata.push(item.total);
  756. });
  757. var obj = [
  758. {
  759. name: '诱虫数量',
  760. data: ydata,
  761. color: '#FF3F3F',
  762. },
  763. ];
  764. if (type == 'search') {
  765. // 当前是搜索
  766. this.showColumn('canvasColumnA', name, obj);
  767. } else {
  768. this.showColumn('canvasColumnA', name, obj);
  769. }
  770. } else {
  771. this.showCanvas = false;
  772. }
  773. },
  774. examine(index) {
  775. var imgarr = [];
  776. for (var i = 0; i < this.photoList.length; i++) {
  777. imgarr.push(this.photoList[i].addr);
  778. }
  779. // console.log(imgarr)
  780. uni.previewImage({
  781. urls: imgarr,
  782. current: index,
  783. });
  784. },
  785. async getEquipInfo() {
  786. let res = await this.$myRequest({
  787. method: 'post',
  788. url: '/api/api_gateway?method=forecast.worm_lamp.lamp_list',
  789. data: {
  790. device_id: this.equipInfoImei,
  791. page: 1,
  792. page_size: 10,
  793. device_model: 0,
  794. device_type_id: 25,
  795. },
  796. });
  797. console.log(res);
  798. // console.log(res.data.data);
  799. this.equipInfo = res.data[0];
  800. },
  801. async getAnsyInfo() {
  802. let res = await this.$myRequest({
  803. method: 'post',
  804. url: '/api/api_gateway?method=lpsxy.views.pest_info',
  805. data: {
  806. d_id: this.equipInfo_d_id,
  807. },
  808. });
  809. console.log(res);
  810. // console.log(res.data.data);
  811. this.analyInfo = res;
  812. },
  813. btnFun(code) {
  814. switch (code) {
  815. case 'clear':
  816. this.takePhoto(3);
  817. break;
  818. case 'tackPhoto':
  819. this.takePhoto(1);
  820. break;
  821. case 'photoTime':
  822. this.getPhotoTime();
  823. this.photoTimeLayer = true;
  824. break;
  825. case 'changeInfo':
  826. this.decoy = '';
  827. this.xy_expire_time = 2;
  828. this.expireInfoLayer = true;
  829. break;
  830. default:
  831. break;
  832. }
  833. // if(code == 'clear') {
  834. // this.takePhoto(3)
  835. // }
  836. },
  837. async getData() {
  838. let res = await this.$myRequest({
  839. method: 'post',
  840. url: '/api/api_gateway?method=lpsxy.views.monitor_data',
  841. data: {
  842. device_id: this.equipInfoImei,
  843. },
  844. });
  845. console.log(res);
  846. // console.log(res.data.data);
  847. this.newDataObj = res;
  848. },
  849. async getDeviceData() {
  850. let res = await this.$myRequest({
  851. method: 'post',
  852. url: '/api/api_gateway?method=lpsxy.views.device_config',
  853. data: {
  854. d_id: this.equipInfo_d_id,
  855. },
  856. });
  857. console.log(res);
  858. this.deviceObj = res;
  859. console.log(this.deviceObj);
  860. },
  861. // 获取当前拍照时间控制
  862. async getPhotoTime() {
  863. this.photoTimeLayer = true;
  864. this.photoTimeArray = [];
  865. let res = await this.$myRequest({
  866. method: 'POST',
  867. url: '/api/api_gateway?method=lpsxy.views.device_config',
  868. data: {
  869. d_id: this.equipInfo_d_id,
  870. config_type: 1,
  871. },
  872. });
  873. if (res && Object.keys(res).length > 0) {
  874. let data = res;
  875. for (const key in data) {
  876. if (key.includes('snaptime')) {
  877. let text = (data[key] + '').padStart(4, '0');
  878. // console.log(`${text.substring(0, 2)}${text.substring(2, 4)}`);
  879. this.photoTimeArray.push({
  880. value: `${text.substring(0, 2)}:${text.substring(2, 4)}`,
  881. key,
  882. show: false,
  883. });
  884. }
  885. }
  886. // console.log(this.photoTimeArray);
  887. }
  888. },
  889. removeTime(index) {
  890. this.photoTimeArray.splice(index, 1);
  891. },
  892. addTime(index) {
  893. this.photoTimeArray.push({
  894. value: `00:00`,
  895. key: `snaptime${index}`,
  896. show: false,
  897. });
  898. },
  899. changeSnapTime(e, key, index) {
  900. this.photoTimeArray[index].value = `${e.hour}:${e.minute}`;
  901. },
  902. changeControlTime(e, type) {
  903. this.equipContrlForm1[type] = `${e.hour}:${e.minute}`;
  904. },
  905. async devicePhotoTime() {
  906. // console.log(this.photoTimeArray);
  907. let obj = {};
  908. this.photoTimeArray.forEach((item, index) => {
  909. if (item.value) {
  910. obj[`snaptime${index + 1}`] = item.value.replace(/:/g, '') * 1;
  911. }
  912. });
  913. // console.log(obj);
  914. let res = await this.$myRequest({
  915. method: 'post',
  916. url: '/api/api_gateway?method=lpsxy.views.device_control',
  917. data: {
  918. device_id: this.equipInfoImei,
  919. ...obj,
  920. },
  921. });
  922. if (res) {
  923. uni.showToast({
  924. title: '指令下发成功',
  925. duration: 1000,
  926. icon: 'none',
  927. });
  928. // this.$message.success('指令下发成功');
  929. this.photoTimeLayer = false;
  930. } else {
  931. uni.showToast({
  932. title: '指令下发失败',
  933. icon: 'none',
  934. duration: 1000,
  935. });
  936. // this.$message.error(res.data.message);
  937. }
  938. },
  939. async takePhoto(order_type) {
  940. let res = await this.$myRequest({
  941. method: 'post',
  942. url: '/api/api_gateway?method=lpsxy.views.send_control',
  943. data: {
  944. device_id: this.equipInfoImei,
  945. order_type,
  946. },
  947. });
  948. if (res) {
  949. uni.showToast({
  950. title: '指令下发成功',
  951. duration: 1000,
  952. icon: 'none',
  953. });
  954. // this.$message.success('指令下发成功');
  955. } else {
  956. uni.showToast({
  957. title: '指令下发失败',
  958. icon: 'none',
  959. duration: 1000,
  960. });
  961. // this.$message.error(res.data.message);
  962. }
  963. },
  964. async changeExpireFun() {
  965. if (this.decoy == '') {
  966. uni.showToast({
  967. title: '请输入信息素名称',
  968. duration: 1000,
  969. icon: 'none',
  970. });
  971. // this.$message.error('请输入信息素名称');
  972. return;
  973. }
  974. let res = await this.$myRequest({
  975. method: 'post',
  976. url: '/api/api_gateway?method=lpsxy.views.update_xy_expire_time',
  977. data: {
  978. device_id: this.equipInfoImei,
  979. xy_expire_time: this.xy_expire_time,
  980. decoy: this.decoy,
  981. },
  982. });
  983. if (res) {
  984. uni.showToast({
  985. title: '操作成功',
  986. icon: 'none',
  987. duration: 1000,
  988. });
  989. // this.$message.success('操作成功');
  990. this.expireInfoLayer = false;
  991. this.getEquipInfo();
  992. } else {
  993. uni.showToast({
  994. title: '操作失败',
  995. icon: 'none',
  996. duration: 1000,
  997. });
  998. // this.$message.error(res.data.message);
  999. }
  1000. },
  1001. async getPhotoList(search) {
  1002. let { photoTimeRange } = this;
  1003. // console.log(photoTimeRange);
  1004. // if(photoTimeRange) {
  1005. // this.page = 1;
  1006. // }
  1007. // 当筛选的时候 清空图片列表
  1008. if (search) {
  1009. this.page = 1;
  1010. this.photoList = [];
  1011. }
  1012. let res = await this.$myRequest({
  1013. method: 'post',
  1014. url: '/api/api_gateway?method=lpsxy.views.photo_list',
  1015. data: {
  1016. d_id: this.equipInfo_d_id,
  1017. page: this.page,
  1018. start: photoTimeRange ? photoTimeRange[0] / 1000 : '',
  1019. end: photoTimeRange ? photoTimeRange[1] / 1000 : '',
  1020. },
  1021. });
  1022. this.photoLoading = false;
  1023. if (res) {
  1024. this.photoList = [...this.photoList, ...res.data];
  1025. this.total = res.count;
  1026. if (this.total > this.page * 10) {
  1027. this.loadStatus = 'loadmore';
  1028. } else if (this.total <= this.page * 10) {
  1029. this.loadStatus = 'nomore';
  1030. }
  1031. } else {
  1032. uni.showToast({
  1033. title: '请求失败',
  1034. icon: 'none',
  1035. duration: 1000,
  1036. });
  1037. }
  1038. },
  1039. changePhotoTime(dateObj, type) {
  1040. console.log(dateObj);
  1041. this.photoTimeRangeText = `${dateObj.startDate}~${dateObj.endDate}`;
  1042. this.photoTimeRange = [
  1043. new Date(dateObj.startDate).getTime(),
  1044. new Date(dateObj.endDate).getTime(),
  1045. ];
  1046. if (type == 'photo') {
  1047. this.getPhotoList('search');
  1048. } else {
  1049. this.lineChartPest('search');
  1050. }
  1051. },
  1052. clearTimeFun(type) {
  1053. this.photoTimeRangeText = '请选择日期';
  1054. this.photoTimeRange = '';
  1055. if (type == 'photo') {
  1056. this.getPhotoList('search');
  1057. } else {
  1058. this.lineChartPest('search');
  1059. }
  1060. },
  1061. loadMore() {
  1062. this.page++;
  1063. this.getPhotoList();
  1064. },
  1065. change(index) {
  1066. this.current = index;
  1067. if (index == 3) {
  1068. this.getControlInfo();
  1069. } else if (index == 2) {
  1070. this.photoList = [];
  1071. this.page = 1;
  1072. this.photoTimeRangeText = '请选择日期';
  1073. this.photoTimeRange = '';
  1074. this.getPhotoList();
  1075. } else if (index == 1) {
  1076. this.photoTimeRangeText = '请选择日期';
  1077. this.photoTimeRange = '';
  1078. this.lineChartPest();
  1079. this.getAnsyInfo();
  1080. }
  1081. },
  1082. copy(item) {
  1083. console.log(item);
  1084. uni.setClipboardData({
  1085. data: item,
  1086. success: function () {
  1087. console.log('success');
  1088. },
  1089. });
  1090. },
  1091. async getControlInfo() {
  1092. let res = await this.$myRequest({
  1093. method: 'POST',
  1094. url: '/api/api_gateway?method=lpsxy.views.device_config',
  1095. data: {
  1096. d_id: this.equipInfo_d_id,
  1097. config_type: 1,
  1098. },
  1099. });
  1100. if (res && Object.keys(res).length > 0) {
  1101. let data = res;
  1102. console.log(data);
  1103. let newObj = {
  1104. ...data,
  1105. show_st: false,
  1106. show_et: false,
  1107. };
  1108. newObj.dev_work_time = data.dev_work_time + '';
  1109. newObj.dev_work_time =
  1110. newObj.dev_work_time.length > 7
  1111. ? newObj.dev_work_time
  1112. : newObj.dev_work_time.padStart(8, '0');
  1113. newObj.st = `${newObj.dev_work_time.substring(
  1114. 0,
  1115. 2
  1116. )}:${newObj.dev_work_time.substring(2, 4)}`;
  1117. newObj.et = `${newObj.dev_work_time.substring(
  1118. 4,
  1119. 6
  1120. )}:${newObj.dev_work_time.substring(6, 8)}`;
  1121. // console.log(newObj);
  1122. this.equipContrlForm1 = newObj;
  1123. }
  1124. },
  1125. async equipControlSubm() {
  1126. let newForm = Object.assign({}, this.equipContrlForm1); //深拷贝
  1127. newForm.dev_work_time = (newForm.st + newForm.et).replace(/:/g, '') * 1;
  1128. console.log(newForm);
  1129. // console.log(obj);
  1130. let res = await this.$myRequest({
  1131. method: 'POST',
  1132. url: '/api/api_gateway?method=lpsxy.views.device_control',
  1133. data: {
  1134. device_id: this.equipInfoImei,
  1135. ...newForm,
  1136. },
  1137. });
  1138. if (res) {
  1139. uni.showToast({
  1140. title: '指令下发成功',
  1141. duration: 1000,
  1142. icon: 'none',
  1143. });
  1144. // this.$message.success('指令下发成功');
  1145. } else {
  1146. uni.showToast({
  1147. title: '指令下发失败',
  1148. icon: 'none',
  1149. duration: 1000,
  1150. });
  1151. // this.$message.error(res.data.message);
  1152. }
  1153. },
  1154. async equipBtnControl(cmd) {
  1155. if (this.ota_url == '') {
  1156. uni.showToast({
  1157. title: '请输入地址',
  1158. duration: 1000,
  1159. icon: 'none',
  1160. });
  1161. return;
  1162. }
  1163. let op_type = '';
  1164. if (cmd == 'reboot') {
  1165. var name = '重启';
  1166. op_type = 1;
  1167. } else if (cmd == 'update') {
  1168. var name = '升级';
  1169. op_type = 2;
  1170. }
  1171. let res = await this.$myRequest({
  1172. method: 'POST',
  1173. url: '/api/api_gateway?method=lpsxy.views.device_root_control',
  1174. data: {
  1175. op_type,
  1176. d_id: this.equipInfo_d_id,
  1177. ota_url: this.ota_url,
  1178. },
  1179. });
  1180. if (res) {
  1181. uni.showToast({
  1182. title: '指令下发成功',
  1183. duration: 1000,
  1184. icon: 'none',
  1185. });
  1186. // this.$message.success('指令下发成功');
  1187. } else {
  1188. uni.showToast({
  1189. title: '指令下发失败',
  1190. icon: 'none',
  1191. duration: 1000,
  1192. });
  1193. // this.$message.error(res.data.message);
  1194. }
  1195. },
  1196. },
  1197. };
  1198. </script>
  1199. <style lang="less" scoped>
  1200. ::v-deep .u-calendar__action {
  1201. display: flex;
  1202. justify-content: space-between;
  1203. }
  1204. .green {
  1205. background: #14a478;
  1206. }
  1207. .yellow {
  1208. background: #f4a72f;
  1209. }
  1210. .danger {
  1211. background: #ff5951;
  1212. }
  1213. .blue {
  1214. background: #1890ff;
  1215. }
  1216. .bigBox {
  1217. position: relative;
  1218. width: 100vw;
  1219. height: calc(100vh);
  1220. background: #f7f7f7;
  1221. overflow: hidden;
  1222. }
  1223. .info {
  1224. padding: 20rpx 40rpx;
  1225. color: #fff;
  1226. line-height: 50rpx;
  1227. font-size: 26rpx;
  1228. background-size: 100% auto;
  1229. background-repeat: no-repeat;
  1230. background-color: #0dc6b6;
  1231. background-position: top left;
  1232. box-sizing: border-box;
  1233. width: 100%;
  1234. border-radius: 5rpx;
  1235. margin: 0 auto;
  1236. p:first-child {
  1237. font-size: 32rpx;
  1238. }
  1239. .expiretishi {
  1240. font-size: 24rpx;
  1241. color: #ff0000;
  1242. }
  1243. .tishi {
  1244. width: 28rpx;
  1245. height: 28rpx;
  1246. margin: 0rpx 0 0 20rpx;
  1247. }
  1248. .fillin {
  1249. display: flex;
  1250. input {
  1251. width: 200rpx;
  1252. font-size: 24rpx;
  1253. height: 50rpx;
  1254. line-height: 50rpx;
  1255. text-indent: 1em;
  1256. }
  1257. }
  1258. }
  1259. .on {
  1260. background-image: url('https://s3.hnyfwlw.com/webstaticimg/bigdata_app/image/cb/onBg.png');
  1261. }
  1262. .off {
  1263. background-image: url('https://s3.hnyfwlw.com/webstaticimg/bigdata_app/image/cb/offBg.png');
  1264. }
  1265. .infoBox {
  1266. width: 100%;
  1267. padding: 10rpx 24rpx;
  1268. height: calc(100vh - 80rpx);
  1269. box-sizing: border-box;
  1270. overflow: auto;
  1271. .timeBox {
  1272. display: flex;
  1273. justify-content: space-between;
  1274. align-items: center;
  1275. padding: 30rpx 32rpx;
  1276. border: 1rpx #e5ebe9 solid;
  1277. background: #fff;
  1278. color: #666;
  1279. font-size: 30rpx;
  1280. height: 100rpx;
  1281. box-sizing: border-box;
  1282. .iconBox {
  1283. display: flex;
  1284. align-items: center;
  1285. margin-top: 4rpx;
  1286. }
  1287. .text {
  1288. width: 80vw;
  1289. margin-left: 16rpx;
  1290. }
  1291. }
  1292. }
  1293. .cardInfo {
  1294. margin-top: 24rpx;
  1295. width: 100%;
  1296. .title {
  1297. font-size: 28rpx;
  1298. color: #999;
  1299. }
  1300. .controlCard {
  1301. display: flex;
  1302. align-items: center;
  1303. justify-content: space-between;
  1304. width: 100%;
  1305. margin-top: 30rpx;
  1306. background: #fff;
  1307. box-sizing: border-box;
  1308. .preBtn {
  1309. display: flex;
  1310. align-items: center;
  1311. justify-content: space-around;
  1312. flex-direction: column;
  1313. width: 22%;
  1314. padding: 20rpx;
  1315. height: 80px;
  1316. font-size: 24rpx;
  1317. }
  1318. .btnBox {
  1319. display: flex;
  1320. align-items: center;
  1321. justify-content: center;
  1322. height: 48px;
  1323. width: 48px;
  1324. border-radius: 48px;
  1325. color: #fff;
  1326. .text {
  1327. display: inline-block;
  1328. width: 80vw;
  1329. font-size: 20px;
  1330. }
  1331. }
  1332. .preInfo {
  1333. display: flex;
  1334. align-items: center;
  1335. box-sizing: border-box;
  1336. padding: 32rpx !important;
  1337. background: #fff;
  1338. margin-bottom: 32rpx;
  1339. .btnBox {
  1340. width: 72rpx;
  1341. height: 72rpx;
  1342. background: #14a478;
  1343. }
  1344. .textBox {
  1345. margin-left: 40rpx;
  1346. font-size: 32rpx;
  1347. .name {
  1348. font-size: 24rpx;
  1349. color: #999;
  1350. }
  1351. }
  1352. }
  1353. }
  1354. .noBg {
  1355. background: none;
  1356. }
  1357. .u-border-bottom:after,
  1358. .u-border-left:after,
  1359. .u-border-right:after,
  1360. .u-border-top-bottom:after,
  1361. .u-border-top:after,
  1362. .u-border:after {
  1363. content: ' ';
  1364. position: absolute;
  1365. left: 0;
  1366. top: 0;
  1367. pointer-events: none;
  1368. box-sizing: border-box;
  1369. -webkit-transform-origin: 0 0;
  1370. transform-origin: 0 0;
  1371. width: 199.8%;
  1372. height: 199.7%;
  1373. -webkit-transform: scale(0.5);
  1374. transform: scale(0.5);
  1375. border: 0.5px solid #e5ebe9;
  1376. z-index: 2;
  1377. }
  1378. }
  1379. .expireBox {
  1380. width: 80%;
  1381. margin: 0 auto;
  1382. padding: 20rpx;
  1383. box-sizing: border-box;
  1384. max-height: 60vh;
  1385. overflow: auto;
  1386. }
  1387. .bgColor {
  1388. width: 100%;
  1389. box-sizing: border-box;
  1390. background: #fff;
  1391. padding: 0 20rpx;
  1392. .u-form {
  1393. height: calc(100vh - 68rpx);
  1394. overflow: auto;
  1395. box-sizing: border-box;
  1396. padding: 20rpx 0;
  1397. }
  1398. .btn {
  1399. margin-left: 20rpx;
  1400. }
  1401. }
  1402. .chartBox {
  1403. min-height: 400rpx;
  1404. background: #fff;
  1405. margin: 20rpx 0;
  1406. padding: 32rpx;
  1407. box-sizing: border-box;
  1408. background: #fff;
  1409. width: 100%;
  1410. .noEmpty {
  1411. height: 400rpx;
  1412. display: flex;
  1413. justify-content: center;
  1414. align-items: center;
  1415. }
  1416. .pestInfo {
  1417. padding: 32rpx 0;
  1418. box-sizing: border-box;
  1419. .pest {
  1420. font-size: 24rpx;
  1421. color: #666;
  1422. margin-bottom: 16rpx;
  1423. .name {
  1424. margin-left: 10rpx;
  1425. color: #333;
  1426. font-weight: 600;
  1427. }
  1428. }
  1429. }
  1430. .pestStatus {
  1431. box-sizing: border-box;
  1432. display: flex;
  1433. align-items: center;
  1434. justify-content: space-between;
  1435. background: #fff;
  1436. height: 284rpx;
  1437. .block {
  1438. display: flex;
  1439. align-items: center;
  1440. flex-direction: column;
  1441. justify-content: space-around;
  1442. width: 33%;
  1443. height: 100%;
  1444. text-align: center;
  1445. }
  1446. .active {
  1447. background: #f7f7f7;
  1448. }
  1449. .iconBox {
  1450. display: flex;
  1451. align-items: center;
  1452. justify-content: center;
  1453. width: 128rpx;
  1454. height: 128rpx;
  1455. border-radius: 128rpx;
  1456. color: #fff;
  1457. .yficonfont {
  1458. font-size: 80rpx;
  1459. }
  1460. }
  1461. .blueText {
  1462. color: #14a478;
  1463. }
  1464. .yellowText {
  1465. color: #f4a72f;
  1466. }
  1467. .redText {
  1468. color: #ff0000;
  1469. }
  1470. }
  1471. }
  1472. .imgList {
  1473. height: calc(100vh - 220rpx);
  1474. overflow: auto;
  1475. box-sizing: border-box;
  1476. padding: 20rpx 0;
  1477. .preImg {
  1478. position: relative;
  1479. float: left;
  1480. width: 49%;
  1481. margin-right: 2%;
  1482. margin-bottom: 20rpx;
  1483. .text {
  1484. position: absolute;
  1485. bottom: 0;
  1486. left: 0;
  1487. width: 100%;
  1488. height: 40rpx;
  1489. line-height: 40rpx;
  1490. text-align: center;
  1491. color: #fff;
  1492. background: rgba(0, 0, 0, 0.4);
  1493. font-size: 24rpx;
  1494. z-index: 2;
  1495. }
  1496. }
  1497. .preImg:nth-child(2n) {
  1498. margin-right: 0; /* 每个第 3 个元素的右边距为 0 */
  1499. }
  1500. .loadBox {
  1501. width: 100%;
  1502. }
  1503. ::v-deep .u-calendar__action {
  1504. display: flex;
  1505. justify-content: space-between;
  1506. }
  1507. }
  1508. </style>