detail.vue 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760
  1. <template>
  2. <view class="device-detail" v-show="!loading">
  3. <view class="device-detail__header">
  4. <u-icon
  5. size="36"
  6. class="arrow-left"
  7. name="arrow-left"
  8. @click="handleBack"
  9. ></u-icon>
  10. {{ deviceInfo.name }}
  11. </view>
  12. <view class="operation" @click.stop="isShowOperation = !isShowOperation">操作</view>
  13. <view class="operation-container" v-if="isShowOperation" @click="closeOperationHandler">
  14. <view class="operation-background"></view>
  15. <view class="operation-content">
  16. <view class="operation-item" v-if="isShowPhoto" @click="handlePhotoClick">
  17. <image :src="photoIcon" class="operation-icon"></image>
  18. 拍照
  19. </view>
  20. <view class="operation-item" @click="handleServiceClick">
  21. <image :src="serviceIcon" class="operation-icon"></image>
  22. 维修
  23. </view>
  24. <view class="operation-item" @click="handleSettingClick">
  25. <image :src="settingIcon" class="operation-icon"></image>
  26. 设置
  27. </view>
  28. <view class="operation-item" @click="handleSimClick">
  29. <image :src="simIcon" class="operation-icon"></image>
  30. SIM卡
  31. </view>
  32. <view class="operation-item" @click="modification">
  33. <image :src="editIcon" class="operation-icon"></image>
  34. 修改
  35. </view>
  36. </view>
  37. </view>
  38. <view class="device-detail__body">
  39. <DeviceCard
  40. :dataSource="deviceInfo"
  41. :collectTime="time"
  42. :title="deviceInfo.name"
  43. :deviceType="deviceType"
  44. />
  45. <view class="tabs">
  46. <view class="tab-container" v-if="isShowTab">
  47. <view class="tab-item" :class="activeTab === 'pestAnalysis'?'active':''" @click="handleTabClick('pestAnalysis')" v-if="disableShow">
  48. 害虫分析
  49. </view>
  50. <view class="tab-item" :class="activeTab === 'aiAnalysis'?'active':''" @click="handleTabClick('aiAnalysis')" v-if="disableShow">
  51. AI智能分析
  52. </view>
  53. <view class="tab-item" :class="activeTab === 'viewImage'?'active':''" @click="handleTabClick('viewImage')">
  54. 查看图片
  55. </view>
  56. <view class="tab-item" :class="activeTab === 'deviceData'?'active':''" @click="handleTabClick('deviceData')">
  57. 设备数据
  58. </view>
  59. </view>
  60. <view class="select-timer-container">
  61. <view class="select-year">
  62. <view class="select-year-item" @click="showPicker = true">
  63. {{ currentYear }}
  64. <u-icon name="arrow-down" size="18" class="arrow-down"></u-icon>
  65. </view>
  66. </view>
  67. <view class="tabs-timer-container" @click="showCalendar">
  68. <view class="tabs-timer-item">
  69. {{startDate}}
  70. </view>
  71. 至
  72. <view class="tabs-timer-item">
  73. {{endDate}}
  74. </view>
  75. <u-icon name="calendar" size="36" class="calendar-icon"></u-icon>
  76. </view>
  77. </view>
  78. </view>
  79. <view v-show="activeTab === 'pestAnalysis'" class="tab-content">
  80. <PestDiscern
  81. :total="total"
  82. :pest_order="pest_order"
  83. />
  84. <PestEchart
  85. :pest_order="pest_order"
  86. @getInfo="getInfo"
  87. :endDate="endDate"
  88. :d_id="deviceInfo.d_id"
  89. :day="day"
  90. :pest="pest"
  91. />
  92. <PestArchive
  93. :pest_info="pestInfo"
  94. />
  95. <view v-if="!pests.length">
  96. <u-empty text="暂无数据"></u-empty>
  97. </view>
  98. </view>
  99. <view v-show="activeTab === 'viewImage'">
  100. <scroll-view class="scroll-view" scroll-y style="height: 60vh;" @scrolltolower="handleReachBottom">
  101. <photoImage
  102. :images="imageList"
  103. :pestList="pestList"
  104. :disableShow="disableShow"
  105. @changeTab="changeTab"
  106. :currentYear="currentYear"
  107. :deviceInfo="deviceInfo"
  108. />
  109. </scroll-view>
  110. </view>
  111. <view v-if="activeTab === 'aiAnalysis'">
  112. <AiChat
  113. :pestMessage="pestMessage"
  114. />
  115. </view>
  116. <view v-show="activeTab === 'deviceData'">
  117. <DeviceData
  118. :activeTabLabel="activeTab"
  119. :deviceStatic="deviceStatic"
  120. :deviceInfo="deviceInfo"
  121. :polylineList="polylineList"
  122. :deviceHistoryList="deviceHistoryList"
  123. :totalPage="totalPage"
  124. :currentPage="page"
  125. :page_size="page_size"
  126. @prevPage="prevPage"
  127. @nextPage="nextPage"
  128. />
  129. </view>
  130. </view>
  131. <u-calendar v-model="show" :mode="mode" range-color="#999" btn-type="success" active-bg-color="#0BBC58" range-bg-color="rgba(11,188,88,0.13)" @change="handleChange" :max-date="maxDate" :min-date="minDate"></u-calendar>
  132. <u-picker v-model="showPicker" mode="selector" :range="selectorRange" range-key="id" :default-selector="[0]" @confirm="confirmHandler"></u-picker>
  133. </view>
  134. </template>
  135. <script>
  136. import DeviceCard from './components/DeviceCard.vue';
  137. import PestDiscern from './components/pestDiscern.vue';
  138. import PestEchart from './components/pestEchart.vue';
  139. import PestArchive from './components/pestArchive.vue';
  140. import photoImage from './components/photoImage.vue';
  141. import DeviceData from './components/deviceData.vue';
  142. import AiChat from './components/aiChat.vue';
  143. export default {
  144. components: {
  145. DeviceCard,
  146. PestDiscern,
  147. AiChat,
  148. PestEchart,
  149. PestArchive,
  150. photoImage,
  151. DeviceData,
  152. },
  153. data(){
  154. return {
  155. isShowTab:false,
  156. showPicker: false,
  157. loading: false,
  158. disableShow: false,
  159. isShowOperation: false,
  160. photoIcon:'https://s3.hnyfwlw.com/webstaticimg/bigdata_app/newImg/home/photoIcon.png',
  161. editIcon:'https://s3.hnyfwlw.com/webstaticimg/bigdata_app/newImg/home/editIcon.png',
  162. serviceIcon:'https://s3.hnyfwlw.com/webstaticimg/bigdata_app/newImg/home/serviceIcon.png',
  163. simIcon:'https://s3.hnyfwlw.com/webstaticimg/bigdata_app/newImg/home/simIcon.png',
  164. settingIcon:'https://s3.hnyfwlw.com/webstaticimg/bigdata_app/newImg/home/settingIcon.png',
  165. totalPage:0,
  166. currentYear: new Date().getFullYear(),
  167. selectorRange: [],
  168. maxDate: this.formatDate(new Date()),
  169. minDate: this.formatDate(new Date(new Date().getFullYear(), 0, 1)),
  170. show: false,
  171. showSim: false,
  172. // 当前日期向前推30天 格式2026-01-01 月份和日期小于10的时候前面加个0
  173. startDate: this.formatDate(new Date(new Date().getTime() - 30 * 24 * 60 * 60 * 1000)),
  174. endDate: this.formatDate(new Date()),
  175. mode: 'range',
  176. imageList: [],
  177. pest_order:{},
  178. pestMessage:'',
  179. deviceInfo: {},
  180. pestInfo: {},
  181. time: '',
  182. activeTab: 'pestAnalysis',
  183. deviceType: '',
  184. location: '',
  185. total: 0,
  186. imgTotal: 0,
  187. day: [],
  188. pest: [],
  189. page:1,
  190. is_pest:'',
  191. page_size:24,
  192. pestList:[],
  193. pest_names:'',
  194. pests:[],
  195. polylineList:[],
  196. isShowPhoto:false,
  197. deviceHistoryList:[],
  198. deviceStatic:{}
  199. }
  200. },
  201. onLoad(options){
  202. this.deviceInfo = JSON.parse(options.info);
  203. const newVal = this.deviceInfo;
  204. if (newVal.device_model == '11'){
  205. this.isShowPhoto = true
  206. } else if(newVal.device_model == '12'){
  207. this.isShowPhoto = false
  208. } else if(newVal.device_model == '13'){
  209. this.isShowPhoto = true
  210. } else if(newVal.device_model == '14'){
  211. this.isShowPhoto = true
  212. } else if(newVal.device_model == '15'){
  213. this.isShowPhoto = false
  214. } else{
  215. this.isShowPhoto = true
  216. }
  217. this.isShow();
  218. const currentYear = new Date().getFullYear();
  219. this.selectorRange = [];
  220. for(let i = 0;i<50;i++){
  221. const item = {
  222. label: currentYear - i,
  223. id: currentYear - i
  224. }
  225. this.selectorRange.push(item);
  226. }
  227. },
  228. methods: {
  229. formatePestMessage(data) {
  230. if (data.length === 0) {
  231. this.pestMessage = '';
  232. return;
  233. }
  234. // 先拼好整段再一次性赋值,避免循环里多次 += 反复触发 pestMessage watcher(连带 AI 连接被反复触发)
  235. let msg = `当前设备位置为${this.deviceInfo.address},在${this.startDate}至${this.endDate} 监测到的害虫如下:`;
  236. data.forEach((item, index) => {
  237. if(index === data.length - 1){
  238. msg += `${item.name}:${item.value}头.`;
  239. } else {
  240. msg += `${item.name}:${item.value}头,`;
  241. }
  242. });
  243. this.pestMessage = msg;
  244. },
  245. handleReachBottom(){
  246. if (this.activeTab === 'viewImage') {
  247. if(this.imageList.length >= this.imgTotal){
  248. return
  249. }
  250. this.initImageList(true);
  251. }
  252. },
  253. handleSimClick(){
  254. // this.showSim = true;
  255. //`/pages/deviceDetails/weatherStation/${type}?deviceInfo=${encodeURIComponent(JSON.stringify(this.deviceInfo))}`
  256. uni.navigateTo({
  257. url:
  258. '/pages/deviceDetails/weatherStation/simDetail?deviceInfo=' +
  259. encodeURIComponent(JSON.stringify(this.deviceInfo))
  260. });
  261. },
  262. modification() {
  263. uni.navigateTo({
  264. url:
  265. '/pages/equipList2/seabox/modification?data=' +
  266. JSON.stringify(this.deviceInfo) +
  267. '&id=' +
  268. this.deviceInfo.type,
  269. });
  270. },
  271. async handlePhotoClick(){
  272. const res = await this.$myRequest({
  273. url: '/api/api_gateway?method=forecast.send_control.admin_device_control',
  274. method: 'POST',
  275. data: {
  276. device_type_id: this.deviceInfo.type,
  277. d_id: this.deviceInfo.d_id,
  278. cmd: 'takephoto',
  279. },
  280. });
  281. if(res){
  282. this.$u.toast('拍照成功')
  283. }
  284. },
  285. handleServiceClick(){
  286. uni.navigateTo({
  287. url: '/pages/afterSale/addafter?d_id=' + this.deviceInfo.d_id +'&device_id='+this.deviceInfo.id + '&device_type=' + this.deviceInfo.type,
  288. })
  289. },
  290. handleSettingClick(){
  291. uni.navigateTo({
  292. url: '/pages/cbd/deviceControl?deviceId=' + this.deviceInfo.id + '&d_id=' + this.deviceInfo.d_id,
  293. });
  294. },
  295. closeOperationHandler(){
  296. this.isShowOperation = false;
  297. },
  298. isShow(){
  299. // disable == 0 或者 device_model == 15 表示不可以查看
  300. if(!this.deviceInfo.d_id){
  301. return false;
  302. }
  303. let showStatus = true;
  304. if(this.deviceInfo.device_model == 15 || this.deviceInfo.device_model == 12){
  305. showStatus = false;
  306. }
  307. if(showStatus){
  308. this.activeTab = 'pestAnalysis';
  309. }else{
  310. this.activeTab = 'deviceData';
  311. }
  312. this.initAction();
  313. // initAction 只在 pestAnalysis 分支取害虫数据;其余初始 tab 也需要 pestMessage 供 AI 分析用,补取一次
  314. if (this.activeTab !== 'pestAnalysis') {
  315. this.getPestAnalysis();
  316. }
  317. this.isShowTab = showStatus;
  318. if(this.deviceInfo.disable == 0){
  319. this.disableShow = false;
  320. if(showStatus){
  321. this.activeTab = 'viewImage';
  322. this.handleTabClick('viewImage');
  323. }
  324. }else{
  325. this.disableShow = true;
  326. }
  327. },
  328. prevPage(e){
  329. if(e == 1){
  330. return
  331. }
  332. this.page = e-=1;
  333. this.getDeviceHistoryData();
  334. },
  335. nextPage(e){
  336. if(e * this.page_size >= this.totalPage){
  337. return
  338. }
  339. this.page = e+=1;
  340. this.getDeviceHistoryData();
  341. },
  342. changeTab(pestList){
  343. let pest_names = pestList.map(item => item.pest_name);
  344. this.pest_names = pest_names.join(',');
  345. this.initImageList();
  346. },
  347. confirmHandler(e){
  348. this.currentYear = this.selectorRange[e].id;
  349. if(this.currentYear == new Date().getFullYear()){
  350. // 结束日期为this.endDate的月份和日期加上选择的年份
  351. const timeDate = this.currentYear + '-' + this.endDate.split('-')[1] + '-' + this.endDate.split('-')[2];
  352. this.endDate = this.formatDate(new Date(timeDate));
  353. // 开始日期为结束日期前30天
  354. this.startDate = this.formatDate(new Date(new Date(this.endDate).getTime() - 30 * 24 * 60 * 60 * 1000));
  355. this.maxDate = this.formatDate(new Date());
  356. this.minDate = this.formatDate(new Date(new Date().getFullYear(), 0, 1));
  357. }else{
  358. // 结束日期为this.endDate的月份和日期加上选择的年份
  359. const timeDate = this.currentYear + '-' + this.endDate.split('-')[1] + '-' + this.endDate.split('-')[2];
  360. this.endDate = this.formatDate(new Date(timeDate));
  361. // 开始日期为结束日期前30天
  362. this.startDate = this.formatDate(new Date(new Date(this.endDate).getTime() - 30 * 24 * 60 * 60 * 1000));
  363. this.maxDate = this.formatDate(new Date(this.currentYear, 11, 31));
  364. this.minDate = this.formatDate(new Date(this.currentYear, 0, 1));
  365. }
  366. this.initAction();
  367. this.showPicker = false;
  368. },
  369. getInfo(info){
  370. this.pestInfo = info;
  371. },
  372. // 格式化日期为YYYY-MM-DD格式,月份和日期小于10时前面加0
  373. formatDate(date) {
  374. const year = date.getFullYear();
  375. const month = String(date.getMonth() + 1).padStart(2, '0');
  376. const day = String(date.getDate()).padStart(2, '0');
  377. return `${year}-${month}-${day}`;
  378. },
  379. handleChange(e){
  380. this.startDate = e.startDate;
  381. this.endDate = e.endDate;
  382. this.page = 1;
  383. this.initAction();
  384. },
  385. showCalendar(){
  386. this.show = true;
  387. },
  388. handleBack() {
  389. uni.navigateBack({
  390. delta: 1
  391. });
  392. },
  393. initAction(){
  394. this.pest_order = {}
  395. if(this.activeTab === 'pestAnalysis'){
  396. this.getPestAnalysis();
  397. }else if(this.activeTab === 'aiAnalysis'){
  398. this.getAiAnalysis();
  399. }else if(this.activeTab === 'viewImage'){
  400. this.initPest();
  401. this.initImageList();
  402. }else if(this.activeTab === 'deviceData'){
  403. this.getDeviceData();
  404. this.getPolylineData();
  405. this.getDeviceHistoryData();
  406. }
  407. },
  408. getAiAnalysis(){
  409. },
  410. handleTabClick(tab) {
  411. this.activeTab = tab;
  412. this.initAction();
  413. },
  414. async getDeviceData(){
  415. const res = await this.$myRequest({
  416. url: '/api/api_gateway?method=forecast.worm_lamp.device_status_data',
  417. method: 'POST',
  418. data: {
  419. device_id: this.deviceInfo.id,
  420. },
  421. });
  422. this.deviceStatic = res;
  423. },
  424. async initImageList(isLoadMore){
  425. if(isLoadMore){
  426. this.page++;
  427. }
  428. uni.showLoading({
  429. title: '加载中',
  430. })
  431. const res = await this.$myRequest({
  432. url: '/api/api_gateway?method=forecast.new_cbd.photo_list',
  433. method: 'POST',
  434. data: {
  435. page:this.page,
  436. page_size:this.page_size,
  437. device_id: this.deviceInfo.id,
  438. is_pest: this.is_pest,
  439. identify_model: 'B',
  440. pest_names: this.pest_names,
  441. time_begin: this.formatDate(new Date(this.startDate)) + ' 00:00:00',// 格式化开始时间YYYY-MM-DD HH:MM:SS
  442. time_end: this.formatDate(new Date(this.endDate)) + ' 23:59:59',// 格式化结束时间YYYY-MM-DD HH:MM:SS
  443. },
  444. });
  445. const data = res?.data || [];
  446. uni.hideLoading();
  447. this.imgTotal = res?.num || 0;
  448. if (isLoadMore) {
  449. this.imageList = [...this.imageList, ...data];
  450. } else {
  451. this.imageList = data;
  452. }
  453. },
  454. async initPest(){
  455. const res = await this.$myRequest({
  456. url: '/api/api_gateway?method=forecast.new_cbd.pest_type_list',
  457. method: 'POST',
  458. data:{
  459. page:1,
  460. page_size:999999,
  461. device_id: this.deviceInfo.id,
  462. identify_model: 'B',
  463. time_begin: this.formatDate(new Date(this.startDate)) + ' 00:00:00',// 格式化开始时间YYYY-MM-DD HH:MM:SS
  464. time_end: this.formatDate(new Date(this.endDate)) + ' 23:59:59',// 格式化结束时间YYYY-MM-DD HH:MM:SS
  465. },
  466. });
  467. const data = res?.data || [];
  468. this.pestList = data
  469. },
  470. async getPolylineData(){
  471. this.loading = true;
  472. const res = await this.$myRequest({
  473. url: '/api/api_gateway?method=forecast.worm_lamp.device_polyline_data',
  474. method: 'POST',
  475. data: {
  476. device_type_id: this.deviceInfo.type_id,
  477. d_id: this.deviceInfo.d_id,
  478. start_time: new Date(this.startDate + ' 00:00:00').getTime()/1000,// 转成毫秒
  479. end_time: new Date(this.endDate + ' 23:59:59').getTime()/1000,// 转成毫秒
  480. },
  481. });
  482. this.loading = false;
  483. const data = res || [];
  484. this.polylineList = data
  485. },
  486. async getDeviceHistoryData(){
  487. const res = await this.$myRequest({
  488. url: '/api/api_gateway?method=forecast.worm_lamp.device_history_data',
  489. method: 'POST',
  490. data: {
  491. device_type_id: this.deviceInfo.type_id,
  492. device_id: this.deviceInfo.id,
  493. start_time: new Date(this.startDate + ' 00:00:00').getTime()/1000,
  494. end_time: new Date(this.endDate + ' 23:59:59').getTime()/1000,
  495. page: this.page,
  496. page_size: this.page_size,
  497. },
  498. });
  499. const data = res?.data || [];
  500. this.totalPage = res.counts;
  501. this.deviceHistoryList = data
  502. },
  503. async getPestAnalysis(){
  504. const res = await this.$myRequest({
  505. url: '/api/api_gateway?method=forecast.cbd_analysis.analysis_pest_result',
  506. method: 'POST',
  507. data: {
  508. d_id: this.deviceInfo.d_id,
  509. start: this.startDate,
  510. end: this.endDate,
  511. model: 'B'
  512. },
  513. });
  514. const pest_order = res?.pest_order;
  515. this.getInfo({});
  516. let total = 0;
  517. this.pests = [];
  518. const data = [];
  519. for(let key in pest_order){
  520. total += pest_order[key] || 0;
  521. this.pests.push({
  522. name: key,
  523. percent: (pest_order[key] / total) * 100
  524. })
  525. data.push({
  526. name: key,
  527. value: pest_order[key] || 0
  528. })
  529. }
  530. this.pest_order = pest_order;
  531. this.formatePestMessage([...data.reverse()]);
  532. this.day = res?.day || [];
  533. const pest = res?.pest || [];
  534. this.pest = pest;
  535. // pest.forEach(p =>{
  536. // for(let i = 0;i< p.length;i++){
  537. // this.pest.push(p[i]);
  538. // }
  539. // })
  540. this.total = total;
  541. }
  542. }
  543. }
  544. </script>
  545. <style scoped lang="scss">
  546. ::v-deep .u-calendar__action{
  547. display:flex;
  548. justify-content: space-between;
  549. }
  550. ::v-deep .u-hover-class{
  551. .u-calendar__content__item__inner{
  552. color:#aaa !important;
  553. }
  554. }
  555. .operation-container{
  556. position: fixed;
  557. right: 0;
  558. top: 0;
  559. width: 100%;
  560. height: 100%;
  561. z-index: 99;
  562. }
  563. .operation{
  564. position: fixed;
  565. top: 260rpx;
  566. right: 0;
  567. z-index: 999;
  568. width:48rpx;
  569. height: 100rpx;
  570. line-height: 50rpx;
  571. border-radius: 8px 0 0 8px;
  572. border-top: 4rpx solid #FFF;
  573. border-bottom: 4rpx solid #FFF;
  574. border-left: 4rpx solid #FFF;
  575. background: #dddfe6a3;
  576. color: #515153;
  577. text-align: center;
  578. font-family: "Source Han Sans CN VF";
  579. font-size: 24rpx;
  580. font-weight: 500;
  581. writing-mode: vertical-rl;
  582. }
  583. .operation-background{
  584. position: fixed;
  585. right: 0;
  586. top: 0;
  587. width: 100%;
  588. height: 100%;
  589. z-index: 998;
  590. background: #00000040;
  591. }
  592. .operation-content{
  593. position: fixed;
  594. top: 240rpx;
  595. right: 80rpx;
  596. height: 126rpx;
  597. display: flex;
  598. padding: 16rpx 32rpx;
  599. align-items: center;
  600. gap: 64rpx;
  601. z-index: 999;
  602. border-radius: 32rpx;
  603. border: 2rpx solid #FFF;
  604. background: #FFF;
  605. backdrop-filter: blur(8rpx);
  606. .operation-item{
  607. display: flex;
  608. flex-direction: column;
  609. align-items: center;
  610. justify-content: center;
  611. color: #333333;
  612. text-align: center;
  613. font-family: "Source Han Sans CN VF";
  614. font-size: 24rpx;
  615. font-weight: 400;
  616. }
  617. .operation-icon{
  618. width: 58rpx;
  619. height: 58rpx;
  620. }
  621. }
  622. .device-detail {
  623. display: flex;
  624. width: 100%;
  625. min-height: calc(100vh - 112rpx);
  626. padding-top: 112rpx;
  627. flex-direction: column;
  628. align-items: center;
  629. background: linear-gradient(180deg, #ffffff00 0%, #F5F6FA 23.64%, #F5F6FA 100%), linear-gradient(102deg, #BFEADD 6.77%, #B8F1E7 40.15%, #B9EEF5 84.02%);
  630. .device-detail__header {
  631. width: 100%;
  632. font-size: 28rpx;
  633. color: #999;
  634. color: #042118;
  635. font-family: 'Source Han Sans CN VF';
  636. font-weight: 700;
  637. position: relative;
  638. text-align: center;
  639. .arrow-left {
  640. position: absolute;
  641. left: 32rpx;
  642. margin-right: 12rpx;
  643. }
  644. }
  645. .device-detail__body {
  646. width: calc(100% - 64rpx);
  647. margin: 0 auto;
  648. border-radius: 16rpx;
  649. overflow-x: hidden;
  650. overflow-y: auto;
  651. // 隐藏滚动条
  652. -ms-overflow-style: none;
  653. scrollbar-width: none;
  654. }
  655. .tab-content{
  656. width: 100%;
  657. padding-bottom: 32rpx;
  658. }
  659. .tabs {
  660. background: #ffffff;
  661. margin: 24rpx 0;
  662. border-radius: 16rpx;
  663. padding: 16rpx 0;
  664. padding-top: 0;
  665. .tab-container{
  666. display: flex;
  667. width: 100%;
  668. height: 88rpx;
  669. line-height: 88rpx;
  670. text-align: center;
  671. font-size: 28rpx;
  672. font-weight: 700;
  673. color: #042118;
  674. font-family: 'Source Han Sans CN VF';
  675. }
  676. .select-timer-container{
  677. display:flex;
  678. align-items: center;
  679. padding-left: 32rpx;
  680. .select-year{
  681. width: 110rpx;
  682. text-align: center;
  683. height: 64rpx;
  684. border-radius: 32rpx;
  685. font-family: 'Source Han Sans CN VF';
  686. line-height: 64rpx;
  687. background: #F1F4F8;
  688. padding: 0 32rpx;
  689. .select-year-item{
  690. color: #656565;
  691. font-size: 24rpx;
  692. display: flex;
  693. align-items: center;
  694. justify-content: space-around;
  695. }
  696. }
  697. }
  698. .tabs-timer-container{
  699. display: flex;
  700. align-items: center;
  701. width: calc(100% - 256rpx);
  702. height: 64rpx;
  703. line-height: 64rpx;
  704. text-align: center;
  705. font-size: 24rpx;
  706. font-weight: 500;
  707. font-family: 'Source Han Sans CN VF';
  708. border-radius: 32rpx;
  709. background: #F1F4F8;
  710. padding: 0 32rpx;
  711. color: #656565;
  712. margin: 16rpx;
  713. position: relative;
  714. .tabs-timer-item{
  715. width: 42%;
  716. color: #656565;
  717. text-align: center;
  718. font-family: "Source Han Sans CN VF";
  719. font-size: 24rpx;
  720. font-weight: 400;
  721. }
  722. .calendar-icon{
  723. margin-left: 24rpx;
  724. }
  725. }
  726. .tab-item {
  727. flex: 1;
  728. color: #999999;
  729. text-align: center;
  730. font-family: "Source Han Sans CN VF";
  731. font-size: 28rpx;
  732. font-weight: 400;
  733. }
  734. .active{
  735. position: relative;
  736. color: #303133;
  737. text-align: center;
  738. font-family: "Source Han Sans CN VF";
  739. font-size: 28rpx;
  740. font-weight: 700;
  741. &::after {
  742. content: '';
  743. position: absolute;
  744. bottom: 0;
  745. left: 50%;
  746. -webkit-transform: translateX(-50%);
  747. transform: translateX(-50%);
  748. width: 36rpx;
  749. height: 36rpx;
  750. border: 6rpx solid #0BBC58;
  751. border-radius: 50%;
  752. border-color: transparent;
  753. border-bottom-color: #0BBC58;
  754. }
  755. }
  756. }
  757. }
  758. </style>