deviceControl.vue 25 KB

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