deviceControl.vue 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777
  1. <template>
  2. <view class="device-detail">
  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. {{ title }}
  11. </view>
  12. <view class="device-detail__body">
  13. <view class="tabs">
  14. <view class="tab-container">
  15. <view class="tab-item" v-if="myuser_type" :class="activeTab === 'pestAnalysis'?'active':''" @click="handleTabClick('pestAnalysis')">
  16. 管理员
  17. </view>
  18. <view class="tab-item" :class="activeTab === 'viewImage'?'active':''" @click="handleTabClick('viewImage')">
  19. 设置
  20. </view>
  21. </view>
  22. </view>
  23. <view class="device-detail-content" v-if="activeTab === 'pestAnalysis'">
  24. <view class="device-detail-item">
  25. <text class="device-detail-label">联网模块</text>
  26. <view class="device-detail-btn-container">
  27. <view class="device-detail-btn" @click="setDeviceContorl('update_stm32')">主板升级</view>
  28. <view class="device-detail-btn" @click="setDeviceContorl('update')">物联网模块升级</view>
  29. <view class="device-detail-btn" @click="setDeviceContorl('reboot')">重启</view>
  30. <view class="device-detail-btn" @click="setDeviceContorl('test')">一键测试</view>
  31. <view class="device-detail-btn" @click="setDeviceContorl('yfwlw')">平台切换</view>
  32. <view class="device-detail-btn" @click="setDeviceContorl('paramconf1')">标配物联网</view>
  33. <view class="device-detail-btn" @click="setDeviceContorl('paramconf2')">物联网自清虫</view>
  34. <view class="device-detail-btn" @click="setDeviceContorl('paramconf3')">物联网光控</view>
  35. <view class="device-detail-btn" @click="setDeviceContorl('paramconf4')">物联网光控自清虫</view>
  36. <!-- <view class="device-detail-btn" @click="showMqttConfig">MQTT配置</view> -->
  37. </view>
  38. </view>
  39. <!-- <view class="device-detail-item">
  40. <text class="device-detail-label">板子设置</text>
  41. <view class="device-detail-btn-container">
  42. <view class="device-detail-btn" @click="showMqttConfig('imei')">更改IMEI</view>
  43. </view>
  44. </view>
  45. <view class="device-detail-item">
  46. <text class="device-detail-label">强制操作</text>
  47. <view class="device-detail-btn-container">
  48. <view class="device-detail-btn force-btn" @click="setDeviceContorl('takephoto')">拍照</view>
  49. <view class="device-detail-btn force-btn" @click="setDeviceContorl('update')">升级</view>
  50. <view class="device-detail-btn force-btn" @click="setDeviceContorl('reboot')">重启</view>
  51. <view class="device-detail-btn force-btn" @click="setDeviceContorl('autotakephoto')">对焦拍照</view>
  52. <view class="device-detail-btn force-btn" @click="setDeviceContorl('turn')">转仓</view>
  53. </view>
  54. </view> -->
  55. </view>
  56. <view class="device-detail-content" style="padding-bottom: 50rpx" v-if="activeTab === 'viewImage'">
  57. <!-- <view class="device-detail-viewImage">
  58. <text class="device-detail-label" style="margin-left: 10rpx">
  59. 设备编号
  60. </text>
  61. <view class="clear-btn">{{ equipContrlForm.imei || '-' }}</view>
  62. </view>
  63. <view class="device-detail-viewImage">
  64. <text class="device-detail-label" style="margin-left: 10rpx">
  65. 设备名称
  66. </text>
  67. <view class="clear-btn">{{ equipContrlForm.device_name || '-' }}</view>
  68. </view> -->
  69. <view class="device-detail-viewImage">
  70. <text class="device-detail-label" style="margin-left: 10rpx">
  71. 主板版本号
  72. </text>
  73. <view class="clear-btn">{{ equipContrlForm.stm8vs || '-' }}</view>
  74. </view>
  75. <view class="device-detail-viewImage">
  76. <text class="device-detail-label" style="margin-left: 10rpx">
  77. 联网版本号
  78. </text>
  79. <view class="clear-btn">{{ equipContrlForm.dver || '-' }}</view>
  80. </view>
  81. <view class="device-detail-viewImage">
  82. <text class="device-detail-label" style="margin-left: 10rpx">
  83. 设备开关
  84. </text>
  85. <u-switch
  86. v-model="equipContrlForm.ds"
  87. size="32"
  88. :active-value="1"
  89. :inactive-value="0"
  90. active-color="#0bbc58"
  91. style="position:absolute;right:0"
  92. ></u-switch>
  93. </view>
  94. <view class="device-detail-viewImage">
  95. <text class="device-detail-label" style="margin-left: 10rpx">
  96. 定时模式
  97. </text>
  98. <view class="clear-btn" @click="timeSet('ts')">{{ equipContrlForm.ts === '0' ? '光控' : '时控' }}</view>
  99. </view>
  100. <view class="device-detail-viewImage" v-if="equipContrlForm.ts !== '1'">
  101. <u-icon name="clock" color="#0bbc58" size="46"></u-icon>
  102. <text class="device-detail-label" style="margin-left: 10rpx">
  103. 定时时长(h)
  104. </text>
  105. <view class="clear-btn" @click="timeSetLang('tt')">{{ equipContrlForm.tt == '0'?'常亮':equipContrlForm.tt || '-' }}</view>
  106. </view>
  107. <view v-if="equipContrlForm.ts === '1'">
  108. <text class="device-detail-label" style="margin-left: 10rpx">
  109. 开始结束时间
  110. </text>
  111. </view>
  112. <view class="time-container" v-if="equipContrlForm.ts === '1'">
  113. <view class="start-time" @click="showPickerHandler('start_time')">{{start_time_label || '开始时间'}}</view>-
  114. <view class="end-time" @click="showPickerHandler('end_time')">{{end_time_label || '结束时间'}}
  115. </view><u-icon name="clock" color="#4E5969" size="26" style="padding-right: 20rpx"></u-icon>
  116. </view>
  117. <view class="device-detail-viewImage">
  118. <text class="device-detail-label">数据间隔(min)
  119. {{ sliderField === 'dattim' && sliderDragValue !== null ? sliderDragValue : equipContrlForm.dattim }}</text>
  120. </view>
  121. <!-- <view class="slider-container">
  122. <view class="slider-min-value">50</view>
  123. <u-slider :value="equipContrlForm.dattim" @input="e => equipContrlForm.dattim = e" class="slider" :min="10" :max="120" active-color="#0bbc58"></u-slider>
  124. <view class="slider-max-value">70</view>
  125. </view> -->
  126. <view class="slider-container">
  127. <view class="slider-min-value">10</view>
  128. <view
  129. class="custom-progress"
  130. @touchstart.stop="onSliderTouchStart($event, 'dattim', 10, 120, 10)"
  131. @touchmove.stop.prevent="onSliderTouchMove($event, 10, 120, 10)"
  132. @touchend.stop="onSliderTouchEnd"
  133. @tap.stop="onSliderTap($event, 'dattim', 10, 120, 10)"
  134. >
  135. <view class="progress-track">
  136. <view class="progress-fill" :style="{ width: getProgressWidth(sliderField === 'dattim' && sliderDragValue !== null ? sliderDragValue : equipContrlForm.dattim, 10, 120) + '%' }"></view>
  137. <view class="progress-thumb" :style="{ left: getProgressWidth(sliderField === 'dattim' && sliderDragValue !== null ? sliderDragValue : equipContrlForm.dattim, 10, 120) + '%' }"></view>
  138. </view>
  139. </view>
  140. <view class="slider-max-value">120</view>
  141. </view>
  142. <view class="device-detail-viewImage">
  143. <text class="device-detail-label">清虫间隔(min)
  144. {{ sliderField === 'clt' && sliderDragValue !== null ? sliderDragValue : equipContrlForm.clt }}</text>
  145. </view>
  146. <!-- <view class="slider-container">
  147. <view class="slider-min-value">-30</view>
  148. <u-slider :value="equipContrlForm.clt" @input="e => equipContrlForm.clt = e" class="slider" :min="10" :max="120" active-color="#0bbc58"></u-slider>
  149. <view class="slider-max-value">20</view>
  150. </view> -->
  151. <view class="slider-container">
  152. <view class="slider-min-value">10</view>
  153. <view
  154. class="custom-progress"
  155. @touchstart.stop="onSliderTouchStart($event, 'clt', 10, 120, 1)"
  156. @touchmove.stop.prevent="onSliderTouchMove($event, 10, 120, 1)"
  157. @touchend.stop="onSliderTouchEnd"
  158. @tap.stop="onSliderTap($event, 'clt', 10, 120, 1)"
  159. >
  160. <view class="progress-track">
  161. <view class="progress-fill" :style="{ width: getProgressWidth(sliderField === 'clt' && sliderDragValue !== null ? sliderDragValue : equipContrlForm.clt, 10, 120) + '%' }"></view>
  162. <view class="progress-thumb" :style="{ left: getProgressWidth(sliderField === 'clt' && sliderDragValue !== null ? sliderDragValue : equipContrlForm.clt, 10, 120) + '%' }"></view>
  163. </view>
  164. </view>
  165. <view class="slider-max-value">120</view>
  166. </view>
  167. </view>
  168. </view>
  169. <view class="device-detail-btn-footer" v-if="activeTab === 'viewImage'">
  170. <view class="device-detail-btn" @click="saveSettings">保存</view>
  171. </view>
  172. <u-popup v-model="show" mode="bottom">
  173. <view class="device-detail-content" style="height: 50vh">
  174. <view class="device-detail-item">
  175. <text class="device-detail-label">请输入imei</text>
  176. <u-input v-model="equipContrlForm.imei" placeholder="请输入imei"></u-input>
  177. </view>
  178. </view>
  179. <view class="device-detail-btn-footer">
  180. <view class="device-detail-btn" @click="setDeviceContorl('imei')">保存</view>
  181. </view>
  182. </u-popup>
  183. <u-select v-model="showPicker" :list="timeList" @confirm="confirmPicker"></u-select>
  184. <u-select v-model="showTimePicker" :list="list" @confirm="confirmTimePicker"></u-select>
  185. <u-select v-model="showTimeLangPicker" :list="list2" @confirm="confirmTimeLangPicker"></u-select>
  186. </view>
  187. </template>
  188. <script>
  189. export default {
  190. data(){
  191. return {
  192. showPicker: false,
  193. value: 10,
  194. timeList: [],
  195. imageList: [],
  196. start_time_label: '',
  197. end_time_label: '',
  198. start_time: '',
  199. end_time: '',
  200. list: [{
  201. value: '0',
  202. label: '光控'
  203. },
  204. {
  205. value: '1',
  206. label: '时控'
  207. }],
  208. list2: [{
  209. value: '0',
  210. label: '常亮'
  211. },
  212. {
  213. value: '1',
  214. label: '1'
  215. },
  216. {
  217. value: '2',
  218. label: '2'
  219. },
  220. {
  221. value: '3',
  222. label: '3'
  223. },
  224. {
  225. value: '4',
  226. label: '4'
  227. },
  228. {
  229. value: '5',
  230. label: '5'
  231. },
  232. {
  233. value: '6',
  234. label: '6'
  235. },
  236. {
  237. value: '7',
  238. label: '7'
  239. }],
  240. coll_time:[{
  241. start_time: '',
  242. start_time_label: '',
  243. end_time: '',
  244. end_time_label: '',
  245. }],
  246. equipContrlForm: {
  247. },
  248. time: '',
  249. activeTab: 'pestAnalysis',
  250. title: '设置控制',
  251. deviceType: '',
  252. location: '',
  253. d_id: '',
  254. show: false,
  255. checked: false,
  256. showTimePicker: false,
  257. showTimeLangPicker: false,
  258. currentIndex: -1,
  259. myuser_type: false,
  260. currentType: '',
  261. sliderDragValue: null,
  262. sliderRect: null,
  263. sliderField: '',
  264. sliderMin: 0,
  265. sliderMax: 100,
  266. sliderStep: 1
  267. }
  268. },
  269. onLoad(options){
  270. this.d_id = options.d_id;
  271. this.getControlDeviceConfigInfo();
  272. this.timeList = [];
  273. for(let i = 0;i<24;i++){
  274. this.timeList.push({
  275. value:i,
  276. label:i < 10 ? '0' + i + ':00' : i + ':00'
  277. })
  278. }
  279. uni.getStorage({
  280. key:"myuser_type",
  281. success:(res)=>{
  282. if(Number(res.data) == 1){
  283. this.myuser_type = true
  284. this.activeTab = 'pestAnalysis'
  285. }else{
  286. this.activeTab = 'viewImage'
  287. this.$nextTick(() => {
  288. this.cacheSliderRect()
  289. })
  290. }
  291. }
  292. })
  293. },
  294. methods: {
  295. getProgressWidth(value, min, max) {
  296. if (max === min) return 0
  297. return ((value - min) / (max - min)) * 100
  298. },
  299. // Cache slider rect once to avoid async query on every touch
  300. cacheSliderRect() {
  301. const query = uni.createSelectorQuery().in(this)
  302. query.select('.custom-progress').boundingClientRect(rect => {
  303. if (rect) {
  304. this.sliderRect = rect
  305. }
  306. }).exec()
  307. },
  308. onSliderTouchStart(e, field, min, max, step) {
  309. this.sliderField = field
  310. this.sliderMin = min
  311. this.sliderMax = max
  312. this.sliderStep = step || 1
  313. this._lastUpdateTime = 0
  314. this._touchX = e.touches[0].clientX
  315. if (!this.sliderRect) {
  316. const query = uni.createSelectorQuery().in(this)
  317. query.select('.custom-progress').boundingClientRect(rect => {
  318. this.sliderRect = rect
  319. this._applyDragValue(e.touches[0].clientX)
  320. }).exec()
  321. } else {
  322. this._applyDragValue(e.touches[0].clientX)
  323. }
  324. },
  325. onSliderTouchMove(e, min, max, step) {
  326. if (!this.sliderField || !this.sliderRect) return
  327. // Always track the latest finger position (non-reactive, no setData cost)
  328. this._touchX = e.touches[0].clientX
  329. // Throttle: only push to the renderer at ~30fps to avoid flooding the bridge
  330. const now = Date.now()
  331. if (now - this._lastUpdateTime < 33) return
  332. this._lastUpdateTime = now
  333. this._applyDragValue(e.touches[0].clientX)
  334. },
  335. onSliderTouchEnd(e) {
  336. // Use the final finger position from changedTouches, falling back to tracked _touchX
  337. const clientX = (e.changedTouches && e.changedTouches[0])
  338. ? e.changedTouches[0].clientX
  339. : this._touchX
  340. if (this.sliderField && this.sliderRect && clientX != null) {
  341. const ratio = Math.max(0, Math.min(1,
  342. (clientX - this.sliderRect.left) / this.sliderRect.width))
  343. const value = this._snapToStep(Math.round(this.sliderMin + ratio * (this.sliderMax - this.sliderMin)))
  344. this.$set(this.equipContrlForm, this.sliderField, value)
  345. }
  346. this.sliderField = ''
  347. this.sliderDragValue = null
  348. this._lastUpdateTime = 0
  349. this._touchX = 0
  350. },
  351. onSliderTap(e, field, min, max, step) {
  352. const snap = step || 1
  353. const apply = (rect) => {
  354. const ratio = Math.max(0, Math.min(1, e.detail.x / rect.width))
  355. const raw = Math.round(min + ratio * (max - min))
  356. const snapped = Math.round((raw - min) / snap) * snap + min
  357. this.$set(this.equipContrlForm, field, Math.max(min, Math.min(max, snapped)))
  358. }
  359. if (!this.sliderRect) {
  360. const query = uni.createSelectorQuery().in(this)
  361. query.select('.custom-progress').boundingClientRect(rect => {
  362. this.sliderRect = rect
  363. apply(rect)
  364. }).exec()
  365. } else {
  366. apply(this.sliderRect)
  367. }
  368. },
  369. // Non-reactive visual update — only touches sliderDragValue (flat scalar = cheap setData)
  370. _applyDragValue(clientX) {
  371. const ratio = Math.max(0, Math.min(1,
  372. (clientX - this.sliderRect.left) / this.sliderRect.width))
  373. const raw = Math.round(this.sliderMin + ratio * (this.sliderMax - this.sliderMin))
  374. this.sliderDragValue = this._snapToStep(raw)
  375. },
  376. _snapToStep(value) {
  377. const step = this.sliderStep || 1
  378. const snapped = Math.round((value - this.sliderMin) / step) * step + this.sliderMin
  379. return Math.max(this.sliderMin, Math.min(this.sliderMax, snapped))
  380. },
  381. confirmTimePicker(e){
  382. const value = e[0].value;
  383. this.equipContrlForm.ts = value;
  384. },
  385. confirmTimeLangPicker(e){
  386. const value = e[0].value;
  387. this.equipContrlForm.tt = value;
  388. },
  389. timeSet(){
  390. this.showTimePicker = true;
  391. },
  392. timeSetLang(type){
  393. this.showTimeLangPicker = true;
  394. },
  395. clearTime(){
  396. this.coll_time.forEach(item => {
  397. item.start_time = '';
  398. item.start_time_label = '';
  399. item.end_time = '';
  400. item.end_time_label = '';
  401. })
  402. },
  403. confirmPicker(e){
  404. const value = e[0].value;
  405. const label = e[0].label;
  406. if(this.currentType == 'start_time'){
  407. this.start_time_label = label
  408. this.start_time = value
  409. }else{
  410. this.end_time_label = label
  411. this.end_time = value
  412. }
  413. },
  414. showPickerHandler(type){
  415. this.currentType = type
  416. this.showPicker = true;
  417. },
  418. closePicker(){
  419. this.showPicker = false;
  420. this.currentType = ''
  421. this.currentIndex = -1
  422. },
  423. handleBack() {
  424. uni.navigateBack({
  425. delta: 1
  426. });
  427. },
  428. handleTabClick(tab) {
  429. this.activeTab = tab;
  430. if (tab === 'viewImage') {
  431. this.$nextTick(() => {
  432. this.cacheSliderRect()
  433. })
  434. }
  435. },
  436. showMqttConfig(){
  437. this.show = true;
  438. },
  439. closeMqttConfig(){
  440. this.show = false;
  441. },
  442. async setDeviceContorl(cmd){
  443. this.$myRequest({
  444. url: '/api/api_gateway?method=forecast.send_control.admin_device_control',
  445. method: 'POST',
  446. data: {
  447. device_type_id: 2,
  448. d_id: this.d_id,
  449. cmd
  450. }
  451. }).then(res => {
  452. this.closeMqttConfig()
  453. if (res) {
  454. uni.showToast({
  455. title: '设备控制修改成功!',
  456. icon: 'success',
  457. });
  458. } else {
  459. uni.showToast({
  460. title: '设备控制修改失败',
  461. icon: 'error',
  462. });
  463. }
  464. });
  465. },
  466. saveSettings(){
  467. let newForm = Object.assign({}, this.equipContrlForm) // 深拷贝
  468. newForm.ds = newForm.ds ? '1' : '0'
  469. newForm.st = this.start_time
  470. newForm.et = this.end_time
  471. newForm.clt = String(newForm.clt)
  472. newForm.dattim = String(newForm.dattim)
  473. this.$myRequest({
  474. url: '/api/api_gateway?method=forecast.send_control.device_control',
  475. method: 'POST',
  476. data: {
  477. device_type_id: 2,
  478. d_id: this.d_id,
  479. config: JSON.stringify(newForm)
  480. }
  481. }).then(res => {
  482. if (res) {
  483. // 设备控制修改成功
  484. uni.showToast({
  485. title: '设备控制修改成功!',
  486. icon: 'success',
  487. });
  488. } else {
  489. uni.showToast({
  490. title: '设备控制修改失败',
  491. icon: 'error',
  492. });
  493. }
  494. })
  495. },
  496. async getControlDeviceConfigInfo(){
  497. const res = await this.$myRequest({
  498. url: '/api/api_gateway?method=forecast.send_control.device_control_info',
  499. method: 'POST',
  500. data: {
  501. d_id: this.d_id,
  502. cmd:'paramconf'
  503. },
  504. });
  505. this.equipContrlForm = {
  506. st: res.st,
  507. et: res.et,
  508. ds: res.ds,
  509. ts: res.ts,
  510. tt: res.tt,
  511. dver: res.dver,
  512. dattim: res.dat_f,
  513. clt: res.clt_t,
  514. stm8vs: res.stm8vs
  515. };
  516. this.start_time = res?.st || ''
  517. this.end_time = res?.et || ''
  518. this.start_time_label = this.start_time >= 10 ? this.start_time + ':00' : '0' + this.start_time + ':00'
  519. this.end_time_label = this.end_time >= 10 ? this.end_time + ':00' : '0' + this.end_time + ':00'
  520. // const coll_time = res?.coll_time || [];
  521. // for(let i = 0;i< coll_time.length;i++){
  522. // const coll_item = coll_time[i];
  523. // const start_time = coll_item.split('-')[0];
  524. // const end_time = coll_item.split('-')[1];
  525. // this.coll_time[i]['start_time'] = start_time;
  526. // this.coll_time[i]['end_time'] = end_time;
  527. // this.coll_time[i]['start_time_label'] = start_time >= 10 ? start_time + ':00' : '0' + start_time + ':00';
  528. // this.coll_time[i]['end_time_label'] = end_time >= 10 ? end_time + ':00' : '0' + end_time + ':00';
  529. // }
  530. // 确保值是数字类型,并且使用默认值时也要在合理范围内
  531. },
  532. }
  533. }
  534. </script>
  535. <style scoped lang="scss">
  536. .device-detail {
  537. display: flex;
  538. width: 100%;
  539. height: calc(100vh - 112rpx);
  540. padding-top: 112rpx;
  541. flex-direction: column;
  542. align-items: center;
  543. background: linear-gradient(180deg, #ffffff00 0%, #F5F6FA 23.64%, #F5F6FA 100%), linear-gradient(102deg, #BFEADD 6.77%, #B8F1E7 40.15%, #B9EEF5 84.02%);
  544. .device-detail__header {
  545. width: 100%;
  546. font-size: 28rpx;
  547. color: #999;
  548. color: #042118;
  549. font-family: 'Source Han Sans CN VF';
  550. font-weight: 700;
  551. position: relative;
  552. text-align: center;
  553. .arrow-left {
  554. position: absolute;
  555. left: 32rpx;
  556. margin-right: 12rpx;
  557. }
  558. }
  559. .time-container{
  560. display: flex;
  561. justify-content: center;
  562. align-items: center;
  563. color: #999999;
  564. border-radius: 8rpx;
  565. background:#F6F8FC;
  566. gap: 12rpx;
  567. .start-time{
  568. width: 250rpx;
  569. height: 50rpx;
  570. line-height: 50rpx;
  571. text-align: left;
  572. font-size: 24rpx;
  573. color: #999999;
  574. font-family: 'Source Han Sans CN VF';
  575. border-radius: 16rpx;
  576. padding: 0 24rpx;
  577. }
  578. .end-time{
  579. width: 200rpx;
  580. height: 50rpx;
  581. line-height: 50rpx;
  582. text-align: left;
  583. font-size: 24rpx;
  584. color: #999999;
  585. font-family: 'Source Han Sans CN VF';
  586. border-radius: 16rpx;
  587. padding: 0 24rpx;
  588. }
  589. }
  590. .device-detail__body {
  591. width: calc(100% - 64rpx);
  592. margin: 0 auto;
  593. border-radius: 16rpx;
  594. overflow-x: hidden;
  595. overflow-y: auto;
  596. // 隐藏滚动条
  597. -ms-overflow-style: none;
  598. scrollbar-width: none;
  599. }
  600. .tabs {
  601. margin: 24rpx 0;
  602. border-radius: 16rpx;
  603. padding: 16rpx 0;
  604. padding-top: 0;
  605. .tab-container{
  606. display: flex;
  607. width: 100%;
  608. height: 88rpx;
  609. line-height: 88rpx;
  610. text-align: center;
  611. font-size: 28rpx;
  612. color: #042118;
  613. font-family: 'Source Han Sans CN VF';
  614. }
  615. .tab-item {
  616. margin-right: 40rpx;
  617. color:#999999;
  618. }
  619. .active{
  620. position: relative;
  621. color: #0bbc58;
  622. text-align: center;
  623. font-family: "Source Han Sans CN VF";
  624. font-size: 28rpx;
  625. font-weight: 700;
  626. &::after {
  627. content: '';
  628. position: absolute;
  629. bottom: 10rpx;
  630. left: 50%;
  631. transform: translateX(-50%);
  632. width: 100%;
  633. height: 36rpx;
  634. border-bottom: 6rpx solid #0bbc58;
  635. }
  636. }
  637. }
  638. .device-detail-content{
  639. display: flex;
  640. padding: 24rpx;
  641. flex-direction: column;
  642. align-items: flex-start;
  643. gap: 20rpx;
  644. border-radius: 16rpx;
  645. background: #FFF;
  646. .device-detail-item{
  647. .device-detail-label{
  648. color: #303133;
  649. font-family: "Source Han Sans CN VF";
  650. font-size: 28rpx;
  651. font-weight: 400;
  652. }
  653. .device-detail-btn-container{
  654. display: grid;
  655. grid-template-columns: repeat(3, 1fr);
  656. gap: 24rpx;
  657. margin-top: 12rpx;
  658. }
  659. .device-detail-btn{
  660. display: flex;
  661. padding: 10rpx;
  662. justify-content: center;
  663. align-items: center;
  664. gap: 16rpx;
  665. border-radius: 16rpx;
  666. background: #0bbc58;
  667. color: #ffffff;
  668. font-family: "Source Han Sans CN VF";
  669. font-size: 24rpx;
  670. font-weight: 400;
  671. }
  672. .force-btn{
  673. background: #FB4E52;
  674. }
  675. }
  676. .device-detail-viewImage{
  677. width: 100%;
  678. display: flex;
  679. align-items: center;
  680. padding-bottom: 20rpx;
  681. position: relative;
  682. .clear-btn{
  683. position: absolute;
  684. right: 0rpx;
  685. border-radius: 8rpx;
  686. padding: 4rpx 12rpx;
  687. font-size: 26rpx;
  688. font-family: 'Source Han Sans CN VF';
  689. font-weight: 400;
  690. }
  691. }
  692. }
  693. .slider-container{
  694. position: relative;
  695. margin-bottom: 20rpx;
  696. .slider-min-value{
  697. position: absolute;
  698. left: 0;
  699. top: -50rpx;
  700. }
  701. .slider{
  702. width: 600rpx;
  703. }
  704. .slider-max-value{
  705. position: absolute;
  706. right: 0;
  707. top: -50rpx;
  708. }
  709. }
  710. .custom-progress{
  711. width: 600rpx;
  712. padding: 0;
  713. .progress-track{
  714. position: relative;
  715. height: 12rpx;
  716. background-color: #ebedf0;
  717. border-radius: 6rpx;
  718. }
  719. .progress-fill{
  720. position: absolute;
  721. left: 0;
  722. top: 0;
  723. height: 100%;
  724. background-color: #0BBC58;
  725. border-radius: 6rpx;
  726. }
  727. .progress-thumb{
  728. position: absolute;
  729. top: 50%;
  730. width: 28rpx;
  731. height: 28rpx;
  732. margin-left: -14rpx;
  733. margin-top: -14rpx;
  734. border-radius: 50%;
  735. background-color: #fff;
  736. box-shadow: 0 1px 4px rgba(0,0,0,0.3);
  737. }
  738. }
  739. .device-detail-btn-footer{
  740. position: fixed;
  741. bottom: 0;
  742. left: 0;
  743. width: 100%;
  744. height: 112rpx;
  745. line-height: 112rpx;
  746. text-align: center;
  747. font-size: 28rpx;
  748. font-weight: 700;
  749. color: #042118;
  750. font-family: 'Source Han Sans CN VF';
  751. background: #ffffff;
  752. display: flex;
  753. justify-content: center;
  754. align-items: center;
  755. .device-detail-btn{
  756. display: flex;
  757. height: 80rpx;
  758. width: 90%;
  759. margin: 0 auto;
  760. padding: 0rpx 20rpx;
  761. justify-content: center;
  762. align-items: center;
  763. gap: 8rpx;
  764. border-radius: 16rpx;
  765. background:#0bbc58;
  766. color: #ffffff;
  767. text-align: center;
  768. font-family: "Source Han Sans CN VF";
  769. font-size: 14px;
  770. font-style: normal;
  771. font-weight: 500;
  772. }
  773. }
  774. }
  775. </style>