deviceInfo.nvue 31 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267
  1. <template>
  2. <view class="infoBox">
  3. <image class="content-bg" src="/static/device/devicebg.png" mode="scaleToFill"></image>
  4. <view class="pageContent">
  5. <view class="status-bar" :style="{height: statusBarHeight + 'px'}"></view>
  6. <view class="customHead">
  7. <view class="back-wrap" @click="goBack">
  8. <image src="/static/public/back.png" mode="aspectFill" class="backimg"></image>
  9. </view>
  10. <text class="customTitle">调试{{deviceType}}{{picMode===1?'我的艾灸椅':'穴位编辑'}}</text>
  11. <view class="headRight">
  12. <view class="userSwitchBtn" @click="goUserManage">
  13. <text class="userSwitchTxt">{{currentUserName || '选择用户'}}</text>
  14. </view>
  15. <navigator :url="'/pages/device/detail/detail?name='+deviceName+'&deviceId='+deviceId+'&rssi='+rssi+'&id='+id"
  16. class="plus">
  17. <image v-if="picMode===1" src="/static/public/view-list.png" mode="aspectFill" class="menuimg"></image>
  18. </navigator>
  19. </view>
  20. </view>
  21. <scroll-view class="boxs" scroll-y="true">
  22. <view class="proBox" v-if="picMode == 1">
  23. <image class="proimg" src="/static/device/aijiuyi2.png" mode="aspectFill"></image>
  24. <view class="pointbox" v-if="deviceStatus == 3">
  25. <view class="pointContainer">
  26. <text class="pointLabel" v-if="acupointList.length > 0 && curCaseIndex < acupointList.length">{{acupointList[curCaseIndex].name}}</text>
  27. </view>
  28. </view>
  29. <text class="prostatus">蓝牙{{linked?'已':'未'}}连接</text>
  30. </view>
  31. <!-- 座椅角度 -->
  32. <view class="angleSection" v-if="picMode == 1">
  33. <text class="angleLabel">座椅角度(拖动滑块调整)</text>
  34. <l-sliderRange ref="slideRange" :anglenum="chairAngle" :min="90" :max="150" :step="15" @change="onSliderAngleChange"></l-sliderRange>
  35. </view>
  36. <!-- 模式选择 -->
  37. <view class="controlMode" v-if="picMode == 1">
  38. <text class="modetxt">选择模式</text>
  39. <view class="modechange" @click="isShowDrawer2 = true">
  40. <text class="modeName">{{modelist[modeType]}}</text>
  41. <view class="changeBtn">
  42. <text class="changetxt">切换</text>
  43. <image class="changeinmg" src="/static/device/change.png" mode="aspectFill"></image>
  44. </view>
  45. </view>
  46. </view>
  47. <!-- 方案选择 -->
  48. <view class="planSection" v-if="modeType != 0 && picMode == 1">
  49. <view class="planSectionHeader">
  50. <text class="planSectionTitle">选择方案</text>
  51. <view class="planAddBtn" v-if="modeType == 2" @click="goAddCustomPlan">
  52. <text class="planAddBtnTxt">+ 新增</text>
  53. </view>
  54. </view>
  55. <view class="planCard" @click="showPlanDrawer">
  56. <view class="planCardLeft">
  57. <text class="planCardName">{{selectedPlan ? selectedPlan.name : '点击选择方案'}}</text>
  58. <text class="planCardDesc" v-if="selectedPlan && selectedPlan.description">{{selectedPlan.description}}</text>
  59. </view>
  60. <view class="planCardRight">
  61. <text class="planCardArrow">›</text>
  62. </view>
  63. </view>
  64. </view>
  65. <!-- 其他功能 -->
  66. <view class="otherSetting" v-if="modeType != 0 && picMode == 1">
  67. <text class="otherTxt">其他功能</text>
  68. <view class="func">
  69. <navigator v-if="modeType == 3" url="/pages/device/mycases/mycases" class="funcitem" hover-class="none">
  70. <image class="funcimg" src="/static/device/gongneng3.png" mode="aspectFill"></image>
  71. <text class="functxt">我的方案</text>
  72. </navigator>
  73. <navigator :url="`/pages/device/moxibustion/moxibustion?p1=${otherSetting.aijiuNum}&tab=p1`" class="funcitem" hover-class="none">
  74. <image class="funcimg" src="/static/device/gongneng1.png" mode="aspectFill"></image>
  75. <text class="functxt">艾灸余量</text>
  76. </navigator>
  77. <navigator :url="`/pages/device/moxibustion/moxibustion?p2=${otherSetting.lvxinNum}&tab=p2`" class="funcitem" hover-class="none">
  78. <image class="funcimg" src="/static/device/gongneng2.png" mode="aspectFill"></image>
  79. <text class="functxt">滤芯状态</text>
  80. </navigator>
  81. <navigator :url="`/pages/device/moxibustion/moxibustion?p3=${otherSetting.huishouNum}&tab=p3`" class="funcitem" hover-class="none">
  82. <image class="funcimg" src="/static/device/gongneng2.png" mode="aspectFill"></image>
  83. <text class="functxt">回收仓占用</text>
  84. </navigator>
  85. </view>
  86. </view>
  87. <!-- 自定义模式切换按钮 -->
  88. <view class="modeChange" v-if="modeType == 2">
  89. <view class="modeBtn" v-if="picMode===2" @click="picModeChange(1)" :class="picMode===1?'curBtn':''">
  90. <text class="modeBtnTxt" :style="{color:picMode===1?'#545F71':'#fff'}">设备</text>
  91. </view>
  92. <!--<view class="modeBtn" @click="picModeChange(2)" :class="picMode===2?'curBtn':''">
  93. <text class="modeBtnTxt" :style="{color:picMode===2?'#545F71':'#fff'}">穴位</text>
  94. </view>-->
  95. </view>
  96. <!-- 穴位图 -->
  97. <view class="acupointPic" v-if="modeType == 2 && picMode == 2">
  98. <image class="acupointBg" src="/static/device/persionbg.png" mode="aspectFill"></image>
  99. <view class="acupoint" :class="index == acupointIndex ? 'curAcupoint':''" @click="showTimeDraw(index)"
  100. v-for="(item,index) in acupointList" :key="index"
  101. :style="{left:item.x+'rpx',top:item.y+'rpx'}">
  102. </view>
  103. <view class="tipsbox" v-if="acupointIndex != -1"
  104. :style="{left:50+acupointList[acupointIndex].x+'rpx',top:-50+acupointList[acupointIndex].y+'rpx'}">
  105. <text class="tipsTxt">{{acupointList[acupointIndex].name}}</text>
  106. </view>
  107. </view>
  108. <!-- 白噪音 -->
  109. <view class="musicCard" v-if="modeType == 0 && picMode == 1">
  110. <text class="musicname">白噪音</text>
  111. <view class="musliclist">
  112. <text class="musictxt" :class="{'current':curAudioInx==inx}" v-for="(itm,inx) in audiolist"
  113. :key="inx" @click="changeAudio(itm.url,inx)">{{itm.name}}</text>
  114. </view>
  115. </view>
  116. <!-- 开始/暂停/停止 -->
  117. <view class="startbox" v-if="modeType != 0">
  118. <view class="stop" v-if="deviceStatus==0">
  119. <image class="startbtn" @click="startDeviceEvt()" src="/static/device/start.png" mode="aspectFill"></image>
  120. <text class="starttxt">开始</text>
  121. </view>
  122. <view class="hot" v-if="deviceStatus==1">
  123. <view class="hotone">
  124. <text class="hoting">{{ispreHot == false?'正在预热':'点火中'}}</text>
  125. <text class="hotnum">{{hotPercentage}}</text>
  126. </view>
  127. <view class="stopbox" @click="stopPreHot">
  128. <image class="stopimg" src="/static/device/stop.png" mode="aspectFill"></image>
  129. <text class="stoptext">结束</text>
  130. </view>
  131. </view>
  132. <view class="hot" v-if="deviceStatus==3 || deviceStatus==5">
  133. <view class="hotone" v-if="deviceStatus==3">
  134. <text class="hoting">正在艾灸</text>
  135. <text class="hotnum">{{subTime}}</text>
  136. </view>
  137. <view class="hotone" v-if="deviceStatus==5">
  138. <text class="hoting">已暂停</text>
  139. <text class="hotnum">{{subTime}}</text>
  140. </view>
  141. <view class="pausebox" @click="stopAijiu">
  142. <image class="pauseimg" :src="deviceStatus==5?'/static/device/start.png':'/static/device/pause.png'" mode="aspectFill"></image>
  143. <text class="pausetxt">{{deviceStatus==5?'开始':'暂停'}}</text>
  144. </view>
  145. <view class="stopbox" @click="stopPreHot">
  146. <image class="stopimg" src="/static/device/stop.png" mode="aspectFill"></image>
  147. <text class="stoptext">结束</text>
  148. </view>
  149. </view>
  150. <view class="hot" v-if="deviceStatus==4">
  151. <view class="hotone">
  152. <text class="hoting unfire">正在灭火中,请勿操作</text>
  153. </view>
  154. </view>
  155. </view>
  156. <view class="empty" v-if="modeType == 0"></view>
  157. </scroll-view>
  158. </view>
  159. <!-- 音乐播放器 - 固定底部 -->
  160. <view class="musicPlayerFixed" v-if="modeType == 0">
  161. <view class="musicPlayer">
  162. <view class="leftbox">
  163. <image class="playerimg" :src="audiolist[curAudioInx].posterimg" mode="aspectFill"></image>
  164. <view class="musicnamebox">
  165. <text class="mtime">{{formatTime(currentTime)}}</text>
  166. </view>
  167. </view>
  168. <view class="rightbox">
  169. <view class="playBtn" @click="playAudio">
  170. <image class="playericon"
  171. :src="ispause?'/static/device/playerbtn.png':'/static/device/pauseicon.png'"
  172. mode="aspectFit"></image>
  173. </view>
  174. <image @click="isShowDrawer3 = true" class="menuicon" src="/static/device/menubtn.png"
  175. mode="aspectFill"></image>
  176. </view>
  177. </view>
  178. </view>
  179. <!-- 异常提示弹框 -->
  180. <customPopup :isShow="excepDrawer" @closePop="excepDrawer=false">
  181. <text class="tip1 toptip" v-if="exceTxt == 1">检查到有异物</text>
  182. <text class="tip1" v-if="exceTxt == 1">已暂停艾灸,清理后重试</text>
  183. <text class="tip1 toptip" v-if="exceTxt == 2">艾条识别错误</text>
  184. <text class="tip1" v-if="exceTxt == 2">已暂停艾灸,重新插入艾条后重试</text>
  185. <text class="tip1 toptip" v-if="exceTxt == 3">上艾失败</text>
  186. <text class="tip1 toptip" v-if="exceTxt == 4">点火失败</text>
  187. <view class="confirmBtnWrap">
  188. <text class="confirmBtn" @click="excepDrawer = false; exceTxt = 0;">我知道了</text>
  189. </view>
  190. </customPopup>
  191. <!-- 确认结束弹框 -->
  192. <customPopup :isShow="isShowConfirm" @closePop="isShowConfirm=false">
  193. <text class="confirmTxt toptip">确认结束艾灸?</text>
  194. <view class="confirmBtns">
  195. <view class="cbtn" @click="isShowConfirm=false">
  196. <text class="cbtnTxt">取消</text>
  197. </view>
  198. <view class="cbtn redbtn" @click="confirmStop">
  199. <text class="cbtnTxt">结束</text>
  200. </view>
  201. </view>
  202. </customPopup>
  203. <!-- 模式选择弹框 -->
  204. <customPopup :isShow="isShowDrawer2" @closePop="isShowDrawer2=false">
  205. <view class="modeList">
  206. <view class="modeItem" @click="changeMode(0)">
  207. <text class="modeItemTxt">无艾灸模式</text>
  208. <view class="checkboxCustom">
  209. <view v-if="modeType == 0" class="checkboxCircle"></view>
  210. </view>
  211. </view>
  212. <view class="modeItem" @click="changeMode(1)">
  213. <text class="modeItemTxt">专业模式</text>
  214. <view class="checkboxCustom">
  215. <view v-if="modeType == 1" class="checkboxCircle"></view>
  216. </view>
  217. </view>
  218. <view class="modeItem" @click="changeMode(2)">
  219. <text class="modeItemTxt">自定义模式</text>
  220. <view class="checkboxCustom">
  221. <view v-if="modeType == 2" class="checkboxCircle"></view>
  222. </view>
  223. </view>
  224. <view class="modeItem" @click="changeMode(3)">
  225. <text class="modeItemTxt">延年圣手模式</text>
  226. <view class="checkboxCustom">
  227. <view v-if="modeType == 3" class="checkboxCircle"></view>
  228. </view>
  229. </view>
  230. </view>
  231. </customPopup>
  232. <!-- 音乐弹窗 -->
  233. <customPopup :isShow="isShowDrawer3" @closePop="isShowDrawer3=false">
  234. <view class="audiolists">
  235. <text class="playname">当前播放</text>
  236. <view class="audiolist" :class="curAudioInx==inx?'curAudio':''" v-for="(itm,inx) in audiolist"
  237. :key="inx" @click="changeAudio(itm.url,inx)">
  238. <text class="audioTxt">{{itm.name}}</text>
  239. <view class="signal-container" v-if="curAudioInx==inx">
  240. <view class="signal-bar bar1"></view>
  241. <view class="signal-bar bar2"></view>
  242. <view class="signal-bar bar3"></view>
  243. </view>
  244. </view>
  245. </view>
  246. </customPopup>
  247. <!-- 方案选择弹框 -->
  248. <customPopup :isShow="isShowPlanDrawer" @closePop="isShowPlanDrawer=false">
  249. <text class="planDrawerTitle">选择方案</text>
  250. <text class="planDrawerSub">{{modelist[modeType]}} - 可用方案</text>
  251. <scroll-view class="planDrawerList" scroll-y="true">
  252. <view class="planDrawerEmpty" v-if="planList.length === 0 && !planLoading">
  253. <text class="planEmptyTxt">暂无可用方案</text>
  254. </view>
  255. <view class="planDrawerEmpty" v-if="planLoading">
  256. <text class="planEmptyTxt">加载中...</text>
  257. </view>
  258. <view class="planItem" :class="selectedPlan && selectedPlan.id === item.id ? 'planItemActive' : ''"
  259. v-for="(item, index) in planList" :key="index">
  260. <view class="planItemInfo" @click="selectPlan(item)">
  261. <text class="planItemName">{{item.name}}</text>
  262. <text class="planItemDesc" v-if="item.description">{{item.description}}</text>
  263. <view class="planItemMeta" v-if="item.steps || item.duration">
  264. <text class="planMetaTxt" v-if="item.steps">{{item.steps}}步</text>
  265. <text class="planMetaTxt" v-if="item.duration">约{{item.duration}}分钟</text>
  266. </view>
  267. </view>
  268. <view class="planItemActions" v-if="modeType == 2">
  269. <text class="planActionBtn planEditBtn" @click="goEditCustomPlan(item)">编辑</text>
  270. <text class="planActionBtn planDeleteBtn" @click="confirmDeletePlan(item)">删除</text>
  271. </view>
  272. <view class="planItemCheck" v-else @click="selectPlan(item)">
  273. <view class="checkboxCustom">
  274. <view v-if="selectedPlan && selectedPlan.id === item.id" class="checkboxCircle"></view>
  275. </view>
  276. </view>
  277. </view>
  278. </scroll-view>
  279. </customPopup>
  280. <!-- 时间配置器 -->
  281. <customPopup :isShow="isShowTimeDrawer" @closePop="isShowTimeDrawer=false">
  282. <text class="aijiuTime">选择灸疗时间</text>
  283. <view class="timePickerRow">
  284. <picker mode="multiSelector" :range="timeRange" @change="bindTimeChange">
  285. <text class="timePickerTxt">{{selectedHour}}小时 {{selectedMinute}}分钟</text>
  286. </picker>
  287. </view>
  288. <view class="timeBtns">
  289. <view class="tbtn" @click="cancelAijiuTime(0)">
  290. <text class="tbtnTxt">取消</text>
  291. </view>
  292. <view class="tbtn confirmBtn2" @click="cancelAijiuTime(1)">
  293. <text class="tbtnTxt confirmBtn2Txt">确认</text>
  294. </view>
  295. </view>
  296. </customPopup>
  297. <!-- 重连弹框 -->
  298. <view class="maskbg" v-if="reconnectDrawer" @click.stop="">
  299. <view class="maskbox">
  300. <text class="maskTxt">蓝牙连接断开,第{{reconnectCount}}次重连中...</text>
  301. </view>
  302. </view>
  303. <ay-toast ref="ayToast" />
  304. </view>
  305. </template>
  306. <script>
  307. import customPopup from '@/components/customPopup/customPopup.nvue'
  308. import ayToast from '@/components/ay-toast/ay-toast.nvue'
  309. import lSliderRange from '@/components/l-sliderRange/l-sliderRange.nvue'
  310. import bleMixin from './mixins/ble-mixin.js'
  311. import audioMixin from './mixins/audio-mixin.js'
  312. import acupointMixin from './mixins/acupoint-mixin.js'
  313. import planMixin from './mixins/plan-mixin.js'
  314. import { useBleStore } from '@/stores/ble'
  315. import { CHAIR_ANGLE } from '@/utils/ble/constants.js'
  316. import { getProfile } from '@/utils/api/user.js'
  317. export default {
  318. components: {
  319. customPopup,
  320. ayToast,
  321. lSliderRange
  322. },
  323. mixins: [bleMixin, audioMixin, acupointMixin, planMixin],
  324. data() {
  325. return {
  326. statusBarHeight: 44,
  327. deviceId: '',
  328. deviceName: '',
  329. deviceType:'',//1=家庭设备,2=公共设备'
  330. id:'',
  331. rssi: '',
  332. advertisData: '',
  333. isShowDrawer2: false,
  334. modelist: ['无艾灸模式', '专业模式', '自定义模式', '延年圣手模式'],
  335. currentUserName: '',
  336. groupId: '',
  337. profileId: ''
  338. }
  339. },
  340. computed: {
  341. _bleStore() {
  342. return useBleStore()
  343. },
  344. subTime() {
  345. return this._bleStore.subTime
  346. },
  347. modeType: {
  348. get() { return this._bleStore.modeType },
  349. set(val) { this._bleStore.modeType = val }
  350. },
  351. chairAngle: {
  352. get() { return this._bleStore.chairAngle },
  353. set(val) { this._bleStore.chairAngle = val }
  354. },
  355. otherSetting() {
  356. return this._bleStore.otherSetting
  357. }
  358. },
  359. onLoad(options) {
  360. const sysInfo = uni.getSystemInfoSync()
  361. this.statusBarHeight = sysInfo.statusBarHeight || 44
  362. this.deviceId = decodeURIComponent(options.deviceId || '')
  363. this.deviceName = decodeURIComponent(options.name || '')
  364. this.rssi = decodeURIComponent(options.rssi || '')
  365. this.id= decodeURIComponent(options.id || '')
  366. this.deviceType=decodeURIComponent(options.deviceType || '')
  367. this.advertisData = decodeURIComponent(options.advertisData || '')
  368. this.groupId = decodeURIComponent(options.groupId || '')
  369. this.profileId = decodeURIComponent(options.profileId || '')
  370. // TODO: 后续接口确定后实现 - 下载穴位列表
  371. // TODO: 后续接口确定后实现 - 下载专业模式推荐方案
  372. this.loadCurrentUser()
  373. this.initAudio()
  374. this.initBle()
  375. },
  376. onShow() {
  377. // 返回页面时刷新当前用户
  378. this.loadCurrentUser()
  379. // 自定义模式下刷新方案列表(可能从新增/编辑页返回)
  380. if (this.modeType === 2) {
  381. this.loadPlanList(2)
  382. }
  383. },
  384. onUnload() {
  385. this.destroyAudio()
  386. // 离开页面时不断开蓝牙连接,仅停止扫描
  387. // 下次进入相同设备可复用连接
  388. this.cleanupOnLeave()
  389. },
  390. methods: {
  391. goBack() {
  392. // 自定义模式下穴位编辑视图,返回切回设备视图而非真正返回页面
  393. if (this.modeType == 2 && this.picMode == 2) {
  394. this.picMode = 1
  395. return
  396. }
  397. uni.navigateBack()
  398. },
  399. /** 加载当前用户信息 */
  400. async loadCurrentUser() {
  401. if (this.deviceType === '2') {
  402. // 公共设备:通过接口获取当前账号个人资料
  403. try {
  404. const profile = await getProfile()
  405. if (profile && profile.name) {
  406. this.currentUserName = profile.name
  407. this.profileId = profile.profileId || profile.id || ''
  408. } else {
  409. this.currentUserName = ''
  410. this.profileId = ''
  411. }
  412. } catch (e) {
  413. console.error('获取个人资料失败:', e)
  414. this.currentUserName = ''
  415. this.profileId = ''
  416. }
  417. } else {
  418. // 家庭设备:从本地缓存读取群组当前用户
  419. const user = uni.getStorageSync('current_manage_user')
  420. if (user && user.name) {
  421. this.currentUserName = user.name
  422. this.profileId = user.id || ''
  423. } else {
  424. this.currentUserName = ''
  425. this.profileId = ''
  426. }
  427. }
  428. },
  429. /** 跳转用户管理页 */
  430. goUserManage() {
  431. if (this.deviceType === '2') {
  432. // 公共设备:跳转体形参数页编辑个人资料
  433. uni.navigateTo({
  434. url: '/pages/device/bodyParams/bodyParams?mode=edit&source=profile'
  435. })
  436. } else {
  437. // 家庭设备:跳转用户管理页
  438. uni.navigateTo({
  439. url: '/pages/device/userManage/userManage?groupId=' + encodeURIComponent(this.groupId || '')
  440. })
  441. }
  442. },
  443. // 座椅角度控制 - 来自 l-sliderRange 组件
  444. onSliderAngleChange(val) {
  445. this.chairAngle = val
  446. this._sendAngleCommand()
  447. },
  448. _sendAngleCommand() {
  449. const angleMap = {
  450. 90: CHAIR_ANGLE.LEVEL_1,
  451. 105: CHAIR_ANGLE.LEVEL_2,
  452. 120: CHAIR_ANGLE.LEVEL_3,
  453. 135: CHAIR_ANGLE.LEVEL_4,
  454. 150: CHAIR_ANGLE.LEVEL_5
  455. }
  456. const level = angleMap[this.chairAngle] || CHAIR_ANGLE.LEVEL_1
  457. if (this.linked) {
  458. this._bleStore.setChairAngle(level).catch(e => console.error('setAngle fail', e))
  459. }
  460. }
  461. }
  462. }
  463. </script>
  464. <style>
  465. .infoBox {
  466. flex: 1;
  467. position: relative;
  468. }
  469. .content-bg {
  470. position: absolute;
  471. left: 0;
  472. top: 0;
  473. width: 750rpx;
  474. height: 2000px;
  475. }
  476. .gradientBg {
  477. position: absolute;
  478. top: 0;
  479. left: 0;
  480. right: 0;
  481. bottom: 0;
  482. }
  483. .pageBg {
  484. position: absolute;
  485. top: 0;
  486. left: 0;
  487. width: 750rpx;
  488. height: 1400rpx;
  489. }
  490. .pageContent {
  491. flex: 1;
  492. background-image: linear-gradient(to bottom, rgba(56,149,136,1), rgba(56,149,136,0.5));
  493. /* background-color: #333; */
  494. }
  495. .status-bar {
  496. background-color: rgba(0,0,0,0);
  497. }
  498. .customHead {
  499. flex-direction: row;
  500. justify-content: space-between;
  501. align-items: center;
  502. height: 88rpx;
  503. padding-left: 30rpx;
  504. padding-right: 30rpx;
  505. }
  506. .back-wrap {
  507. width: 50rpx;
  508. height: 50rpx;
  509. justify-content: center;
  510. align-items: center;
  511. }
  512. .backimg {
  513. width: 50rpx;
  514. height: 50rpx;
  515. }
  516. .customTitle {
  517. font-weight: bold;
  518. font-size: 32rpx;
  519. color: #FFFFFF;
  520. }
  521. .plus {
  522. width: 50rpx;
  523. height: 50rpx;
  524. justify-content: center;
  525. align-items: center;
  526. }
  527. .menuimg {
  528. width: 40rpx;
  529. height: 40rpx;
  530. }
  531. .headRight {
  532. flex-direction: row;
  533. align-items: center;
  534. }
  535. .userSwitchBtn {
  536. background-color: rgba(255,255,255,0.2);
  537. border-radius: 24rpx;
  538. padding-left: 16rpx;
  539. padding-right: 16rpx;
  540. padding-top: 8rpx;
  541. padding-bottom: 8rpx;
  542. margin-right: 12rpx;
  543. }
  544. .userSwitchTxt {
  545. font-size: 24rpx;
  546. color: #FFFFFF;
  547. }
  548. .boxs {
  549. flex: 1;
  550. }
  551. .proBox {
  552. align-items: center;
  553. padding-top: 30rpx;
  554. padding-bottom: 20rpx;
  555. }
  556. .proimg {
  557. width: 600rpx;
  558. height: 500rpx;
  559. }
  560. .pointbox {
  561. margin-top: 20rpx;
  562. align-items: center;
  563. }
  564. .pointContainer {
  565. background-color: #389588;
  566. border-radius: 20rpx;
  567. padding-left: 24rpx;
  568. padding-right: 24rpx;
  569. padding-top: 8rpx;
  570. padding-bottom: 8rpx;
  571. }
  572. .pointLabel {
  573. color: #FFFFFF;
  574. font-size: 24rpx;
  575. }
  576. .prostatus {
  577. margin-top: 20rpx;
  578. font-size: 26rpx;
  579. color: #FFFFFF;
  580. }
  581. /* 座椅角度 */
  582. .angleSection {
  583. padding-left: 38rpx;
  584. padding-right: 38rpx;
  585. padding-top: 20rpx;
  586. padding-bottom: 30rpx;
  587. }
  588. .angleLabel {
  589. font-size: 26rpx;
  590. color: #FFFFFF;
  591. margin-bottom: 10rpx;
  592. }
  593. /* 模式选择 */
  594. .controlMode {
  595. margin-left: 38rpx;
  596. margin-right: 38rpx;
  597. margin-top: 20rpx;
  598. background-color: rgba(255,255,255,0.9);
  599. border-radius: 16rpx;
  600. padding: 30rpx;
  601. }
  602. .modetxt {
  603. font-size: 28rpx;
  604. color: #9BA5B7;
  605. margin-bottom: 20rpx;
  606. }
  607. .modechange {
  608. flex-direction: row;
  609. justify-content: space-between;
  610. align-items: center;
  611. background-color: #389588;
  612. border-radius: 40rpx;
  613. padding-left: 30rpx;
  614. padding-right: 20rpx;
  615. padding-top: 20rpx;
  616. padding-bottom: 20rpx;
  617. }
  618. .modeName {
  619. font-size: 30rpx;
  620. font-weight: bold;
  621. color: #ffffff;
  622. }
  623. .changeBtn {
  624. flex-direction: row;
  625. align-items: center;
  626. }
  627. .changetxt {
  628. font-size: 26rpx;
  629. color: #389588;
  630. margin-right: 8rpx;
  631. }
  632. .changeinmg {
  633. width: 20px;
  634. height: 20px;
  635. }
  636. /* 其他功能 */
  637. .otherSetting {
  638. margin-left: 38rpx;
  639. margin-right: 38rpx;
  640. margin-top: 20rpx;
  641. background-color: #ffffff;
  642. border-radius: 16rpx;
  643. padding: 30rpx;
  644. }
  645. .otherTxt {
  646. font-size: 28rpx;
  647. color: #9BA5B7;
  648. margin-bottom: 20rpx;
  649. }
  650. .func {
  651. flex-direction: row;
  652. flex-wrap: wrap;
  653. }
  654. .funcitem {
  655. width: 200rpx;
  656. align-items: center;
  657. margin-bottom: 20rpx;
  658. }
  659. .funcimg {
  660. width: 60rpx;
  661. height: 60rpx;
  662. }
  663. .functxt {
  664. font-size: 24rpx;
  665. color: #9BA5B7;
  666. margin-top: 10rpx;
  667. }
  668. /* 自定义模式切换 */
  669. .modeChange {
  670. flex-direction: row;
  671. justify-content: center;
  672. margin-top: 30rpx;
  673. margin-bottom: 20rpx;
  674. }
  675. .modeBtn {
  676. width: 160rpx;
  677. height: 60rpx;
  678. background-color: #545F71;
  679. justify-content: center;
  680. align-items: center;
  681. border-radius: 30rpx;
  682. margin-left: 10rpx;
  683. margin-right: 10rpx;
  684. }
  685. .curBtn {
  686. background-color: #FFFFFF;
  687. }
  688. .modeBtnTxt {
  689. font-size: 26rpx;
  690. }
  691. /* 穴位图 */
  692. .acupointPic {
  693. position: relative;
  694. margin-left: 38rpx;
  695. margin-right: 38rpx;
  696. height: 700rpx;
  697. align-items: center;
  698. }
  699. .acupointBg {
  700. width: 300rpx;
  701. height: 650rpx;
  702. }
  703. .acupoint {
  704. position: absolute;
  705. width: 20rpx;
  706. height: 20rpx;
  707. background-color: #389588;
  708. border-radius: 20rpx;
  709. }
  710. .curAcupoint {
  711. background-color: #F65252;
  712. width: 28rpx;
  713. height: 28rpx;
  714. border-radius: 28rpx;
  715. }
  716. .tipsbox {
  717. position: absolute;
  718. background-color: #333;
  719. border-radius: 8rpx;
  720. padding-left: 12rpx;
  721. padding-right: 12rpx;
  722. padding-top: 6rpx;
  723. padding-bottom: 6rpx;
  724. }
  725. .tipsTxt {
  726. color: #FFFFFF;
  727. font-size: 22rpx;
  728. }
  729. /* 白噪音 */
  730. .musicCard {
  731. margin-left: 38rpx;
  732. margin-right: 38rpx;
  733. margin-top: 20rpx;
  734. background-color: rgba(255,255,255,0.9);
  735. border-radius: 16rpx;
  736. padding: 30rpx;
  737. height:100px;
  738. }
  739. .musicname {
  740. font-size: 28rpx;
  741. color: #545F71;
  742. font-weight: bold;
  743. margin-bottom: 20rpx;
  744. }
  745. .musliclist {
  746. flex-direction: row;
  747. flex-wrap: wrap;
  748. }
  749. .musictxt {
  750. font-size: 26rpx;
  751. color: #9BA5B7;
  752. padding-left: 24rpx;
  753. padding-right: 24rpx;
  754. padding-top: 12rpx;
  755. padding-bottom: 12rpx;
  756. margin-right: 20rpx;
  757. border-radius: 24rpx;
  758. background-color: #F5F7FA;
  759. }
  760. .current {
  761. background-color: #389588;
  762. color: #FFFFFF;
  763. }
  764. .musicPlayerFixed {
  765. position: fixed;
  766. left: 0;
  767. right: 0;
  768. bottom: 0;
  769. }
  770. .musicPlayer {
  771. flex-direction: row;
  772. justify-content: space-between;
  773. align-items: center;
  774. background-color: rgba(255,255,255,0.5);
  775. padding-left: 20rpx;
  776. padding-right: 20rpx;
  777. padding-top: 50px;
  778. padding-bottom: 40px;
  779. border-radius:16px 16px 0 0;
  780. }
  781. .leftbox {
  782. flex-direction: row;
  783. align-items: center;
  784. }
  785. .playerimg {
  786. width: 100rpx;
  787. height: 100rpx;
  788. border-radius: 12rpx;
  789. }
  790. .musicnamebox {
  791. margin-left: 16rpx;
  792. }
  793. .mtime {
  794. font-size: 28rpx;
  795. color: #545F71;
  796. }
  797. .rightbox {
  798. flex-direction: row;
  799. align-items: center;
  800. }
  801. .playBtn {
  802. width: 60rpx;
  803. height: 60rpx;
  804. justify-content: center;
  805. align-items: center;
  806. }
  807. .playericon {
  808. width: 28rpx;
  809. height: 28rpx;
  810. }
  811. .menuicon {
  812. width: 80rpx;
  813. height: 80rpx;
  814. margin-left: 20rpx;
  815. }
  816. /* 开始/暂停/停止 */
  817. .startbox {
  818. align-items: center;
  819. margin-top: 40rpx;
  820. padding-bottom: 40rpx;
  821. }
  822. .stop {
  823. align-items: center;
  824. }
  825. .startbtn {
  826. width: 120rpx;
  827. height: 120rpx;
  828. }
  829. .starttxt {
  830. font-size: 28rpx;
  831. color: #FFFFFF;
  832. margin-top: 10rpx;
  833. }
  834. .hot {
  835. flex-direction: row;
  836. align-items: center;
  837. justify-content: space-between;
  838. align-self: stretch;
  839. padding: 0 80rpx;
  840. }
  841. .hotone {
  842. align-items: center;
  843. margin-right: 40rpx;
  844. }
  845. .hoting {
  846. font-size: 28rpx;
  847. color: #FFFFFF;
  848. }
  849. .unfire {
  850. color: #F65252;
  851. }
  852. .hotnum {
  853. font-size: 36rpx;
  854. color: #E0FFF8;
  855. font-weight: bold;
  856. margin-top: 8rpx;
  857. }
  858. .pausebox {
  859. align-items: center;
  860. margin-right: 40rpx;
  861. }
  862. .pauseimg {
  863. width: 80rpx;
  864. height: 80rpx;
  865. }
  866. .pausetxt {
  867. font-size: 24rpx;
  868. color: #FFFFFF;
  869. margin-top: 6rpx;
  870. }
  871. .stopbox {
  872. align-items: center;
  873. }
  874. .stopimg {
  875. width: 80rpx;
  876. height: 80rpx;
  877. }
  878. .stoptext {
  879. font-size: 24rpx;
  880. color: #F65252;
  881. margin-top: 6rpx;
  882. }
  883. .empty {
  884. height: 180rpx;
  885. }
  886. /* 方案选择区 */
  887. .planSection {
  888. margin-left: 38rpx;
  889. margin-right: 38rpx;
  890. margin-top: 20rpx;
  891. background-color: rgba(255,255,255,0.9);
  892. border-radius: 16rpx;
  893. padding: 30rpx;
  894. }
  895. .planSectionTitle {
  896. font-size: 28rpx;
  897. color: #9BA5B7;
  898. }
  899. .planSectionHeader {
  900. flex-direction: row;
  901. justify-content: space-between;
  902. align-items: center;
  903. margin-bottom: 16rpx;
  904. }
  905. .planAddBtn {
  906. background-color: #389588;
  907. border-radius: 24rpx;
  908. padding-left: 20rpx;
  909. padding-right: 20rpx;
  910. padding-top: 8rpx;
  911. padding-bottom: 8rpx;
  912. }
  913. .planAddBtnTxt {
  914. font-size: 24rpx;
  915. color: #FFFFFF;
  916. }
  917. .planCard {
  918. flex-direction: row;
  919. justify-content: space-between;
  920. align-items: center;
  921. background-color: #389588;
  922. border-radius: 40rpx;
  923. padding-left: 30rpx;
  924. padding-right: 24rpx;
  925. padding-top: 20rpx;
  926. padding-bottom: 20rpx;
  927. }
  928. .planCardLeft {
  929. flex: 1;
  930. }
  931. .planCardName {
  932. font-size: 30rpx;
  933. font-weight: bold;
  934. color: #FFFFFF;
  935. }
  936. .planCardDesc {
  937. font-size: 22rpx;
  938. color: rgba(255,255,255,0.7);
  939. margin-top: 6rpx;
  940. }
  941. .planCardRight {
  942. width: 40rpx;
  943. align-items: center;
  944. }
  945. .planCardArrow {
  946. font-size: 40rpx;
  947. color: #FFFFFF;
  948. }
  949. /* 方案选择弹框 */
  950. .planDrawerTitle {
  951. font-size: 32rpx;
  952. color: #545F71;
  953. font-weight: bold;
  954. text-align: center;
  955. }
  956. .planDrawerSub {
  957. font-size: 24rpx;
  958. color: #9BA5B7;
  959. text-align: center;
  960. margin-top: 8rpx;
  961. margin-bottom: 24rpx;
  962. }
  963. .planDrawerList {
  964. max-height: 600rpx;
  965. }
  966. .planDrawerEmpty {
  967. align-items: center;
  968. padding-top: 60rpx;
  969. padding-bottom: 60rpx;
  970. }
  971. .planEmptyTxt {
  972. font-size: 28rpx;
  973. color: #9BA5B7;
  974. }
  975. .planItem {
  976. flex-direction: row;
  977. justify-content: space-between;
  978. align-items: center;
  979. padding-left: 20rpx;
  980. padding-right: 20rpx;
  981. padding-top: 24rpx;
  982. padding-bottom: 24rpx;
  983. border-bottom-width: 1px;
  984. border-bottom-style: solid;
  985. border-bottom-color: #EEF1F4;
  986. border-radius: 12rpx;
  987. }
  988. .planItemActive {
  989. background-color: #F0F8F7;
  990. }
  991. .planItemInfo {
  992. flex: 1;
  993. margin-right: 20rpx;
  994. }
  995. .planItemName {
  996. font-size: 30rpx;
  997. color: #545F71;
  998. font-weight: bold;
  999. }
  1000. .planItemDesc {
  1001. font-size: 24rpx;
  1002. color: #9BA5B7;
  1003. margin-top: 8rpx;
  1004. }
  1005. .planItemMeta {
  1006. flex-direction: row;
  1007. margin-top: 10rpx;
  1008. }
  1009. .planMetaTxt {
  1010. font-size: 22rpx;
  1011. color: #389588;
  1012. margin-right: 20rpx;
  1013. background-color: rgba(56,149,136,0.1);
  1014. padding-left: 12rpx;
  1015. padding-right: 12rpx;
  1016. padding-top: 4rpx;
  1017. padding-bottom: 4rpx;
  1018. border-radius: 8rpx;
  1019. }
  1020. .planItemCheck {
  1021. width: 50rpx;
  1022. align-items: center;
  1023. }
  1024. /* 方案操作按钮 */
  1025. .planItemActions {
  1026. flex-direction: row;
  1027. align-items: center;
  1028. }
  1029. .planActionBtn {
  1030. font-size: 24rpx;
  1031. padding-left: 16rpx;
  1032. padding-right: 16rpx;
  1033. padding-top: 8rpx;
  1034. padding-bottom: 8rpx;
  1035. border-radius: 16rpx;
  1036. margin-left: 10rpx;
  1037. }
  1038. .planEditBtn {
  1039. color: #389588;
  1040. background-color: rgba(56,149,136,0.1);
  1041. }
  1042. .planDeleteBtn {
  1043. color: #F65252;
  1044. background-color: rgba(246,82,82,0.1);
  1045. }
  1046. /* 弹框样式 */
  1047. .tip1 {
  1048. font-size: 28rpx;
  1049. color: #545F71;
  1050. text-align: center;
  1051. margin-bottom: 10rpx;
  1052. }
  1053. .toptip {
  1054. margin-top: 20rpx;
  1055. font-weight: bold;
  1056. }
  1057. .confirmBtnWrap {
  1058. margin-top: 30rpx;
  1059. align-items: center;
  1060. }
  1061. .confirmBtn {
  1062. font-size: 28rpx;
  1063. color: #FFFFFF;
  1064. background-color: #389588;
  1065. border-radius: 40rpx;
  1066. padding-left: 60rpx;
  1067. padding-right: 60rpx;
  1068. padding-top: 16rpx;
  1069. padding-bottom: 16rpx;
  1070. }
  1071. .confirmTxt {
  1072. font-size: 32rpx;
  1073. color: #545F71;
  1074. font-weight: bold;
  1075. text-align: center;
  1076. }
  1077. .confirmBtns {
  1078. flex-direction: row;
  1079. justify-content: center;
  1080. margin-top: 40rpx;
  1081. }
  1082. .cbtn {
  1083. width: 240rpx;
  1084. height: 80rpx;
  1085. border-radius: 40rpx;
  1086. justify-content: center;
  1087. align-items: center;
  1088. margin-left: 20rpx;
  1089. margin-right: 20rpx;
  1090. background-color: #F3F3F3;
  1091. }
  1092. .redbtn {
  1093. background-color: #F65252;
  1094. }
  1095. .cbtnTxt {
  1096. font-size: 28rpx;
  1097. color: #545F71;
  1098. }
  1099. /* 模式选择弹框 */
  1100. .modeList {
  1101. margin-top: 10rpx;
  1102. }
  1103. .modeItem {
  1104. flex-direction: row;
  1105. justify-content: space-between;
  1106. align-items: center;
  1107. height: 100rpx;
  1108. border-bottom-width: 1px;
  1109. border-bottom-style: solid;
  1110. border-bottom-color: #EEF1F4;
  1111. }
  1112. .modeItemTxt {
  1113. font-size: 30rpx;
  1114. color: #545F71;
  1115. }
  1116. .checkboxCustom {
  1117. width: 36rpx;
  1118. height: 36rpx;
  1119. border-radius: 36rpx;
  1120. border-width: 2px;
  1121. border-style: solid;
  1122. border-color: #389588;
  1123. justify-content: center;
  1124. align-items: center;
  1125. }
  1126. .checkboxCircle {
  1127. width: 20rpx;
  1128. height: 20rpx;
  1129. border-radius: 20rpx;
  1130. background-color: #389588;
  1131. }
  1132. /* 音乐弹窗 */
  1133. .audiolists {
  1134. margin-top: 10rpx;
  1135. }
  1136. .playname {
  1137. font-size: 28rpx;
  1138. color: #9BA5B7;
  1139. margin-bottom: 20rpx;
  1140. }
  1141. .audiolist {
  1142. flex-direction: row;
  1143. justify-content: space-between;
  1144. align-items: center;
  1145. height: 90rpx;
  1146. padding-left: 10rpx;
  1147. padding-right: 10rpx;
  1148. border-radius: 12rpx;
  1149. }
  1150. .curAudio {
  1151. background-color: #F0F8F7;
  1152. }
  1153. .audioTxt {
  1154. font-size: 30rpx;
  1155. color: #545F71;
  1156. }
  1157. .signal-container {
  1158. flex-direction: row;
  1159. align-items: flex-end;
  1160. }
  1161. .signal-bar {
  1162. width: 6rpx;
  1163. margin-left: 4rpx;
  1164. border-radius: 4rpx;
  1165. background-color: #389588;
  1166. }
  1167. .bar1 {
  1168. height: 16rpx;
  1169. }
  1170. .bar2 {
  1171. height: 24rpx;
  1172. }
  1173. .bar3 {
  1174. height: 32rpx;
  1175. }
  1176. /* 时间选择器 */
  1177. .aijiuTime {
  1178. font-size: 32rpx;
  1179. color: #545F71;
  1180. font-weight: bold;
  1181. text-align: center;
  1182. margin-bottom: 30rpx;
  1183. }
  1184. .timePickerRow {
  1185. align-items: center;
  1186. padding-top: 20rpx;
  1187. padding-bottom: 20rpx;
  1188. }
  1189. .timePickerTxt {
  1190. font-size: 32rpx;
  1191. color: #545F71;
  1192. }
  1193. .timeBtns {
  1194. flex-direction: row;
  1195. justify-content: center;
  1196. margin-top: 30rpx;
  1197. }
  1198. .tbtn {
  1199. width: 240rpx;
  1200. height: 80rpx;
  1201. border-radius: 40rpx;
  1202. justify-content: center;
  1203. align-items: center;
  1204. margin-left: 20rpx;
  1205. margin-right: 20rpx;
  1206. background-color: #F3F3F3;
  1207. }
  1208. .confirmBtn2 {
  1209. background-color: #389588;
  1210. }
  1211. .tbtnTxt {
  1212. font-size: 28rpx;
  1213. color: #545F71;
  1214. }
  1215. .confirmBtn2Txt {
  1216. color: #FFFFFF;
  1217. }
  1218. /* 重连遮罩 */
  1219. .maskbg {
  1220. position: fixed;
  1221. left: 0;
  1222. right: 0;
  1223. top: 0;
  1224. bottom: 0;
  1225. background-color: rgba(0,0,0,0.6);
  1226. justify-content: center;
  1227. align-items: center;
  1228. }
  1229. .maskbox {
  1230. background-color: #FFFFFF;
  1231. border-radius: 16rpx;
  1232. padding: 40rpx;
  1233. }
  1234. .maskTxt {
  1235. font-size: 28rpx;
  1236. color: #545F71;
  1237. }
  1238. </style>