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