deviceInfo.nvue 31 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268
  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. // 离开页面时解绑音频事件(音频继续播放,不销毁)
  386. this.detachAudio()
  387. // 离开页面时不断开蓝牙连接,仅停止扫描
  388. // 下次进入相同设备可复用连接
  389. this.cleanupOnLeave()
  390. },
  391. methods: {
  392. goBack() {
  393. // 自定义模式下穴位编辑视图,返回切回设备视图而非真正返回页面
  394. if (this.modeType == 2 && this.picMode == 2) {
  395. this.picMode = 1
  396. return
  397. }
  398. uni.navigateBack()
  399. },
  400. /** 加载当前用户信息 */
  401. async loadCurrentUser() {
  402. if (this.deviceType === '2') {
  403. // 公共设备:通过接口获取当前账号个人资料
  404. try {
  405. const profile = await getProfile()
  406. if (profile && profile.name) {
  407. this.currentUserName = profile.name
  408. this.profileId = profile.profileId || profile.id || ''
  409. } else {
  410. this.currentUserName = ''
  411. this.profileId = ''
  412. }
  413. } catch (e) {
  414. console.error('获取个人资料失败:', e)
  415. this.currentUserName = ''
  416. this.profileId = ''
  417. }
  418. } else {
  419. // 家庭设备:从本地缓存读取群组当前用户
  420. const user = uni.getStorageSync('current_manage_user')
  421. if (user && user.name) {
  422. this.currentUserName = user.name
  423. this.profileId = user.id || ''
  424. } else {
  425. this.currentUserName = ''
  426. this.profileId = ''
  427. }
  428. }
  429. },
  430. /** 跳转用户管理页 */
  431. goUserManage() {
  432. if (this.deviceType === '2') {
  433. // 公共设备:跳转体形参数页编辑个人资料
  434. uni.navigateTo({
  435. url: '/pages/device/bodyParams/bodyParams?mode=edit&source=profile'
  436. })
  437. } else {
  438. // 家庭设备:跳转用户管理页
  439. uni.navigateTo({
  440. url: '/pages/device/userManage/userManage?groupId=' + encodeURIComponent(this.groupId || '')
  441. })
  442. }
  443. },
  444. // 座椅角度控制 - 来自 l-sliderRange 组件
  445. onSliderAngleChange(val) {
  446. this.chairAngle = val
  447. this._sendAngleCommand()
  448. },
  449. _sendAngleCommand() {
  450. const angleMap = {
  451. 90: CHAIR_ANGLE.LEVEL_1,
  452. 105: CHAIR_ANGLE.LEVEL_2,
  453. 120: CHAIR_ANGLE.LEVEL_3,
  454. 135: CHAIR_ANGLE.LEVEL_4,
  455. 150: CHAIR_ANGLE.LEVEL_5
  456. }
  457. const level = angleMap[this.chairAngle] || CHAIR_ANGLE.LEVEL_1
  458. if (this.linked) {
  459. this._bleStore.setChairAngle(level).catch(e => console.error('setAngle fail', e))
  460. }
  461. }
  462. }
  463. }
  464. </script>
  465. <style>
  466. .infoBox {
  467. flex: 1;
  468. position: relative;
  469. }
  470. .content-bg {
  471. position: absolute;
  472. left: 0;
  473. top: 0;
  474. width: 750rpx;
  475. height: 2000px;
  476. }
  477. .gradientBg {
  478. position: absolute;
  479. top: 0;
  480. left: 0;
  481. right: 0;
  482. bottom: 0;
  483. }
  484. .pageBg {
  485. position: absolute;
  486. top: 0;
  487. left: 0;
  488. width: 750rpx;
  489. height: 1400rpx;
  490. }
  491. .pageContent {
  492. flex: 1;
  493. background-image: linear-gradient(to bottom, rgba(56,149,136,1), rgba(56,149,136,0.5));
  494. /* background-color: #333; */
  495. }
  496. .status-bar {
  497. background-color: rgba(0,0,0,0);
  498. }
  499. .customHead {
  500. flex-direction: row;
  501. justify-content: space-between;
  502. align-items: center;
  503. height: 88rpx;
  504. padding-left: 30rpx;
  505. padding-right: 30rpx;
  506. }
  507. .back-wrap {
  508. width: 50rpx;
  509. height: 50rpx;
  510. justify-content: center;
  511. align-items: center;
  512. }
  513. .backimg {
  514. width: 50rpx;
  515. height: 50rpx;
  516. }
  517. .customTitle {
  518. font-weight: bold;
  519. font-size: 32rpx;
  520. color: #FFFFFF;
  521. }
  522. .plus {
  523. width: 50rpx;
  524. height: 50rpx;
  525. justify-content: center;
  526. align-items: center;
  527. }
  528. .menuimg {
  529. width: 40rpx;
  530. height: 40rpx;
  531. }
  532. .headRight {
  533. flex-direction: row;
  534. align-items: center;
  535. }
  536. .userSwitchBtn {
  537. background-color: rgba(255,255,255,0.2);
  538. border-radius: 24rpx;
  539. padding-left: 16rpx;
  540. padding-right: 16rpx;
  541. padding-top: 8rpx;
  542. padding-bottom: 8rpx;
  543. margin-right: 12rpx;
  544. }
  545. .userSwitchTxt {
  546. font-size: 24rpx;
  547. color: #FFFFFF;
  548. }
  549. .boxs {
  550. flex: 1;
  551. }
  552. .proBox {
  553. align-items: center;
  554. padding-top: 30rpx;
  555. padding-bottom: 20rpx;
  556. }
  557. .proimg {
  558. width: 600rpx;
  559. height: 500rpx;
  560. }
  561. .pointbox {
  562. margin-top: 20rpx;
  563. align-items: center;
  564. }
  565. .pointContainer {
  566. background-color: #389588;
  567. border-radius: 20rpx;
  568. padding-left: 24rpx;
  569. padding-right: 24rpx;
  570. padding-top: 8rpx;
  571. padding-bottom: 8rpx;
  572. }
  573. .pointLabel {
  574. color: #FFFFFF;
  575. font-size: 24rpx;
  576. }
  577. .prostatus {
  578. margin-top: 20rpx;
  579. font-size: 26rpx;
  580. color: #FFFFFF;
  581. }
  582. /* 座椅角度 */
  583. .angleSection {
  584. padding-left: 38rpx;
  585. padding-right: 38rpx;
  586. padding-top: 20rpx;
  587. padding-bottom: 30rpx;
  588. }
  589. .angleLabel {
  590. font-size: 26rpx;
  591. color: #FFFFFF;
  592. margin-bottom: 10rpx;
  593. }
  594. /* 模式选择 */
  595. .controlMode {
  596. margin-left: 38rpx;
  597. margin-right: 38rpx;
  598. margin-top: 20rpx;
  599. background-color: rgba(255,255,255,0.9);
  600. border-radius: 16rpx;
  601. padding: 30rpx;
  602. }
  603. .modetxt {
  604. font-size: 28rpx;
  605. color: #9BA5B7;
  606. margin-bottom: 20rpx;
  607. }
  608. .modechange {
  609. flex-direction: row;
  610. justify-content: space-between;
  611. align-items: center;
  612. background-color: #389588;
  613. border-radius: 40rpx;
  614. padding-left: 30rpx;
  615. padding-right: 20rpx;
  616. padding-top: 20rpx;
  617. padding-bottom: 20rpx;
  618. }
  619. .modeName {
  620. font-size: 30rpx;
  621. font-weight: bold;
  622. color: #ffffff;
  623. }
  624. .changeBtn {
  625. flex-direction: row;
  626. align-items: center;
  627. }
  628. .changetxt {
  629. font-size: 26rpx;
  630. color: #389588;
  631. margin-right: 8rpx;
  632. }
  633. .changeinmg {
  634. width: 20px;
  635. height: 20px;
  636. }
  637. /* 其他功能 */
  638. .otherSetting {
  639. margin-left: 38rpx;
  640. margin-right: 38rpx;
  641. margin-top: 20rpx;
  642. background-color: #ffffff;
  643. border-radius: 16rpx;
  644. padding: 30rpx;
  645. }
  646. .otherTxt {
  647. font-size: 28rpx;
  648. color: #9BA5B7;
  649. margin-bottom: 20rpx;
  650. }
  651. .func {
  652. flex-direction: row;
  653. flex-wrap: wrap;
  654. }
  655. .funcitem {
  656. width: 200rpx;
  657. align-items: center;
  658. margin-bottom: 20rpx;
  659. }
  660. .funcimg {
  661. width: 60rpx;
  662. height: 60rpx;
  663. }
  664. .functxt {
  665. font-size: 24rpx;
  666. color: #9BA5B7;
  667. margin-top: 10rpx;
  668. }
  669. /* 自定义模式切换 */
  670. .modeChange {
  671. flex-direction: row;
  672. justify-content: center;
  673. margin-top: 30rpx;
  674. margin-bottom: 20rpx;
  675. }
  676. .modeBtn {
  677. width: 160rpx;
  678. height: 60rpx;
  679. background-color: #545F71;
  680. justify-content: center;
  681. align-items: center;
  682. border-radius: 30rpx;
  683. margin-left: 10rpx;
  684. margin-right: 10rpx;
  685. }
  686. .curBtn {
  687. background-color: #FFFFFF;
  688. }
  689. .modeBtnTxt {
  690. font-size: 26rpx;
  691. }
  692. /* 穴位图 */
  693. .acupointPic {
  694. position: relative;
  695. margin-left: 38rpx;
  696. margin-right: 38rpx;
  697. height: 700rpx;
  698. align-items: center;
  699. }
  700. .acupointBg {
  701. width: 300rpx;
  702. height: 650rpx;
  703. }
  704. .acupoint {
  705. position: absolute;
  706. width: 20rpx;
  707. height: 20rpx;
  708. background-color: #389588;
  709. border-radius: 20rpx;
  710. }
  711. .curAcupoint {
  712. background-color: #F65252;
  713. width: 28rpx;
  714. height: 28rpx;
  715. border-radius: 28rpx;
  716. }
  717. .tipsbox {
  718. position: absolute;
  719. background-color: #333;
  720. border-radius: 8rpx;
  721. padding-left: 12rpx;
  722. padding-right: 12rpx;
  723. padding-top: 6rpx;
  724. padding-bottom: 6rpx;
  725. }
  726. .tipsTxt {
  727. color: #FFFFFF;
  728. font-size: 22rpx;
  729. }
  730. /* 白噪音 */
  731. .musicCard {
  732. margin-left: 38rpx;
  733. margin-right: 38rpx;
  734. margin-top: 20rpx;
  735. background-color: rgba(255,255,255,0.9);
  736. border-radius: 16rpx;
  737. padding: 30rpx;
  738. height:100px;
  739. }
  740. .musicname {
  741. font-size: 28rpx;
  742. color: #545F71;
  743. font-weight: bold;
  744. margin-bottom: 20rpx;
  745. }
  746. .musliclist {
  747. flex-direction: row;
  748. flex-wrap: wrap;
  749. }
  750. .musictxt {
  751. font-size: 26rpx;
  752. color: #9BA5B7;
  753. padding-left: 24rpx;
  754. padding-right: 24rpx;
  755. padding-top: 12rpx;
  756. padding-bottom: 12rpx;
  757. margin-right: 20rpx;
  758. border-radius: 24rpx;
  759. background-color: #F5F7FA;
  760. }
  761. .current {
  762. background-color: #389588;
  763. color: #FFFFFF;
  764. }
  765. .musicPlayerFixed {
  766. position: fixed;
  767. left: 0;
  768. right: 0;
  769. bottom: 0;
  770. }
  771. .musicPlayer {
  772. flex-direction: row;
  773. justify-content: space-between;
  774. align-items: center;
  775. background-color: rgba(255,255,255,0.5);
  776. padding-left: 20rpx;
  777. padding-right: 20rpx;
  778. padding-top: 50px;
  779. padding-bottom: 40px;
  780. border-radius:16px 16px 0 0;
  781. }
  782. .leftbox {
  783. flex-direction: row;
  784. align-items: center;
  785. }
  786. .playerimg {
  787. width: 100rpx;
  788. height: 100rpx;
  789. border-radius: 12rpx;
  790. }
  791. .musicnamebox {
  792. margin-left: 16rpx;
  793. }
  794. .mtime {
  795. font-size: 28rpx;
  796. color: #545F71;
  797. }
  798. .rightbox {
  799. flex-direction: row;
  800. align-items: center;
  801. }
  802. .playBtn {
  803. width: 60rpx;
  804. height: 60rpx;
  805. justify-content: center;
  806. align-items: center;
  807. }
  808. .playericon {
  809. width: 28rpx;
  810. height: 28rpx;
  811. }
  812. .menuicon {
  813. width: 80rpx;
  814. height: 80rpx;
  815. margin-left: 20rpx;
  816. }
  817. /* 开始/暂停/停止 */
  818. .startbox {
  819. align-items: center;
  820. margin-top: 40rpx;
  821. padding-bottom: 40rpx;
  822. }
  823. .stop {
  824. align-items: center;
  825. }
  826. .startbtn {
  827. width: 120rpx;
  828. height: 120rpx;
  829. }
  830. .starttxt {
  831. font-size: 28rpx;
  832. color: #FFFFFF;
  833. margin-top: 10rpx;
  834. }
  835. .hot {
  836. flex-direction: row;
  837. align-items: center;
  838. justify-content: space-between;
  839. align-self: stretch;
  840. padding: 0 80rpx;
  841. }
  842. .hotone {
  843. align-items: center;
  844. margin-right: 40rpx;
  845. }
  846. .hoting {
  847. font-size: 28rpx;
  848. color: #FFFFFF;
  849. }
  850. .unfire {
  851. color: #F65252;
  852. }
  853. .hotnum {
  854. font-size: 36rpx;
  855. color: #E0FFF8;
  856. font-weight: bold;
  857. margin-top: 8rpx;
  858. }
  859. .pausebox {
  860. align-items: center;
  861. margin-right: 40rpx;
  862. }
  863. .pauseimg {
  864. width: 80rpx;
  865. height: 80rpx;
  866. }
  867. .pausetxt {
  868. font-size: 24rpx;
  869. color: #FFFFFF;
  870. margin-top: 6rpx;
  871. }
  872. .stopbox {
  873. align-items: center;
  874. }
  875. .stopimg {
  876. width: 80rpx;
  877. height: 80rpx;
  878. }
  879. .stoptext {
  880. font-size: 24rpx;
  881. color: #F65252;
  882. margin-top: 6rpx;
  883. }
  884. .empty {
  885. height: 180rpx;
  886. }
  887. /* 方案选择区 */
  888. .planSection {
  889. margin-left: 38rpx;
  890. margin-right: 38rpx;
  891. margin-top: 20rpx;
  892. background-color: rgba(255,255,255,0.9);
  893. border-radius: 16rpx;
  894. padding: 30rpx;
  895. }
  896. .planSectionTitle {
  897. font-size: 28rpx;
  898. color: #9BA5B7;
  899. }
  900. .planSectionHeader {
  901. flex-direction: row;
  902. justify-content: space-between;
  903. align-items: center;
  904. margin-bottom: 16rpx;
  905. }
  906. .planAddBtn {
  907. background-color: #389588;
  908. border-radius: 24rpx;
  909. padding-left: 20rpx;
  910. padding-right: 20rpx;
  911. padding-top: 8rpx;
  912. padding-bottom: 8rpx;
  913. }
  914. .planAddBtnTxt {
  915. font-size: 24rpx;
  916. color: #FFFFFF;
  917. }
  918. .planCard {
  919. flex-direction: row;
  920. justify-content: space-between;
  921. align-items: center;
  922. background-color: #389588;
  923. border-radius: 40rpx;
  924. padding-left: 30rpx;
  925. padding-right: 24rpx;
  926. padding-top: 20rpx;
  927. padding-bottom: 20rpx;
  928. }
  929. .planCardLeft {
  930. flex: 1;
  931. }
  932. .planCardName {
  933. font-size: 30rpx;
  934. font-weight: bold;
  935. color: #FFFFFF;
  936. }
  937. .planCardDesc {
  938. font-size: 22rpx;
  939. color: rgba(255,255,255,0.7);
  940. margin-top: 6rpx;
  941. }
  942. .planCardRight {
  943. width: 40rpx;
  944. align-items: center;
  945. }
  946. .planCardArrow {
  947. font-size: 40rpx;
  948. color: #FFFFFF;
  949. }
  950. /* 方案选择弹框 */
  951. .planDrawerTitle {
  952. font-size: 32rpx;
  953. color: #545F71;
  954. font-weight: bold;
  955. text-align: center;
  956. }
  957. .planDrawerSub {
  958. font-size: 24rpx;
  959. color: #9BA5B7;
  960. text-align: center;
  961. margin-top: 8rpx;
  962. margin-bottom: 24rpx;
  963. }
  964. .planDrawerList {
  965. max-height: 600rpx;
  966. }
  967. .planDrawerEmpty {
  968. align-items: center;
  969. padding-top: 60rpx;
  970. padding-bottom: 60rpx;
  971. }
  972. .planEmptyTxt {
  973. font-size: 28rpx;
  974. color: #9BA5B7;
  975. }
  976. .planItem {
  977. flex-direction: row;
  978. justify-content: space-between;
  979. align-items: center;
  980. padding-left: 20rpx;
  981. padding-right: 20rpx;
  982. padding-top: 24rpx;
  983. padding-bottom: 24rpx;
  984. border-bottom-width: 1px;
  985. border-bottom-style: solid;
  986. border-bottom-color: #EEF1F4;
  987. border-radius: 12rpx;
  988. }
  989. .planItemActive {
  990. background-color: #F0F8F7;
  991. }
  992. .planItemInfo {
  993. flex: 1;
  994. margin-right: 20rpx;
  995. }
  996. .planItemName {
  997. font-size: 30rpx;
  998. color: #545F71;
  999. font-weight: bold;
  1000. }
  1001. .planItemDesc {
  1002. font-size: 24rpx;
  1003. color: #9BA5B7;
  1004. margin-top: 8rpx;
  1005. }
  1006. .planItemMeta {
  1007. flex-direction: row;
  1008. margin-top: 10rpx;
  1009. }
  1010. .planMetaTxt {
  1011. font-size: 22rpx;
  1012. color: #389588;
  1013. margin-right: 20rpx;
  1014. background-color: rgba(56,149,136,0.1);
  1015. padding-left: 12rpx;
  1016. padding-right: 12rpx;
  1017. padding-top: 4rpx;
  1018. padding-bottom: 4rpx;
  1019. border-radius: 8rpx;
  1020. }
  1021. .planItemCheck {
  1022. width: 50rpx;
  1023. align-items: center;
  1024. }
  1025. /* 方案操作按钮 */
  1026. .planItemActions {
  1027. flex-direction: row;
  1028. align-items: center;
  1029. }
  1030. .planActionBtn {
  1031. font-size: 24rpx;
  1032. padding-left: 16rpx;
  1033. padding-right: 16rpx;
  1034. padding-top: 8rpx;
  1035. padding-bottom: 8rpx;
  1036. border-radius: 16rpx;
  1037. margin-left: 10rpx;
  1038. }
  1039. .planEditBtn {
  1040. color: #389588;
  1041. background-color: rgba(56,149,136,0.1);
  1042. }
  1043. .planDeleteBtn {
  1044. color: #F65252;
  1045. background-color: rgba(246,82,82,0.1);
  1046. }
  1047. /* 弹框样式 */
  1048. .tip1 {
  1049. font-size: 28rpx;
  1050. color: #545F71;
  1051. text-align: center;
  1052. margin-bottom: 10rpx;
  1053. }
  1054. .toptip {
  1055. margin-top: 20rpx;
  1056. font-weight: bold;
  1057. }
  1058. .confirmBtnWrap {
  1059. margin-top: 30rpx;
  1060. align-items: center;
  1061. }
  1062. .confirmBtn {
  1063. font-size: 28rpx;
  1064. color: #FFFFFF;
  1065. background-color: #389588;
  1066. border-radius: 40rpx;
  1067. padding-left: 60rpx;
  1068. padding-right: 60rpx;
  1069. padding-top: 16rpx;
  1070. padding-bottom: 16rpx;
  1071. }
  1072. .confirmTxt {
  1073. font-size: 32rpx;
  1074. color: #545F71;
  1075. font-weight: bold;
  1076. text-align: center;
  1077. }
  1078. .confirmBtns {
  1079. flex-direction: row;
  1080. justify-content: center;
  1081. margin-top: 40rpx;
  1082. }
  1083. .cbtn {
  1084. width: 240rpx;
  1085. height: 80rpx;
  1086. border-radius: 40rpx;
  1087. justify-content: center;
  1088. align-items: center;
  1089. margin-left: 20rpx;
  1090. margin-right: 20rpx;
  1091. background-color: #F3F3F3;
  1092. }
  1093. .redbtn {
  1094. background-color: #F65252;
  1095. }
  1096. .cbtnTxt {
  1097. font-size: 28rpx;
  1098. color: #545F71;
  1099. }
  1100. /* 模式选择弹框 */
  1101. .modeList {
  1102. margin-top: 10rpx;
  1103. }
  1104. .modeItem {
  1105. flex-direction: row;
  1106. justify-content: space-between;
  1107. align-items: center;
  1108. height: 100rpx;
  1109. border-bottom-width: 1px;
  1110. border-bottom-style: solid;
  1111. border-bottom-color: #EEF1F4;
  1112. }
  1113. .modeItemTxt {
  1114. font-size: 30rpx;
  1115. color: #545F71;
  1116. }
  1117. .checkboxCustom {
  1118. width: 36rpx;
  1119. height: 36rpx;
  1120. border-radius: 36rpx;
  1121. border-width: 2px;
  1122. border-style: solid;
  1123. border-color: #389588;
  1124. justify-content: center;
  1125. align-items: center;
  1126. }
  1127. .checkboxCircle {
  1128. width: 20rpx;
  1129. height: 20rpx;
  1130. border-radius: 20rpx;
  1131. background-color: #389588;
  1132. }
  1133. /* 音乐弹窗 */
  1134. .audiolists {
  1135. margin-top: 10rpx;
  1136. }
  1137. .playname {
  1138. font-size: 28rpx;
  1139. color: #9BA5B7;
  1140. margin-bottom: 20rpx;
  1141. }
  1142. .audiolist {
  1143. flex-direction: row;
  1144. justify-content: space-between;
  1145. align-items: center;
  1146. height: 90rpx;
  1147. padding-left: 10rpx;
  1148. padding-right: 10rpx;
  1149. border-radius: 12rpx;
  1150. }
  1151. .curAudio {
  1152. background-color: #F0F8F7;
  1153. }
  1154. .audioTxt {
  1155. font-size: 30rpx;
  1156. color: #545F71;
  1157. }
  1158. .signal-container {
  1159. flex-direction: row;
  1160. align-items: flex-end;
  1161. }
  1162. .signal-bar {
  1163. width: 6rpx;
  1164. margin-left: 4rpx;
  1165. border-radius: 4rpx;
  1166. background-color: #389588;
  1167. }
  1168. .bar1 {
  1169. height: 16rpx;
  1170. }
  1171. .bar2 {
  1172. height: 24rpx;
  1173. }
  1174. .bar3 {
  1175. height: 32rpx;
  1176. }
  1177. /* 时间选择器 */
  1178. .aijiuTime {
  1179. font-size: 32rpx;
  1180. color: #545F71;
  1181. font-weight: bold;
  1182. text-align: center;
  1183. margin-bottom: 30rpx;
  1184. }
  1185. .timePickerRow {
  1186. align-items: center;
  1187. padding-top: 20rpx;
  1188. padding-bottom: 20rpx;
  1189. }
  1190. .timePickerTxt {
  1191. font-size: 32rpx;
  1192. color: #545F71;
  1193. }
  1194. .timeBtns {
  1195. flex-direction: row;
  1196. justify-content: center;
  1197. margin-top: 30rpx;
  1198. }
  1199. .tbtn {
  1200. width: 240rpx;
  1201. height: 80rpx;
  1202. border-radius: 40rpx;
  1203. justify-content: center;
  1204. align-items: center;
  1205. margin-left: 20rpx;
  1206. margin-right: 20rpx;
  1207. background-color: #F3F3F3;
  1208. }
  1209. .confirmBtn2 {
  1210. background-color: #389588;
  1211. }
  1212. .tbtnTxt {
  1213. font-size: 28rpx;
  1214. color: #545F71;
  1215. }
  1216. .confirmBtn2Txt {
  1217. color: #FFFFFF;
  1218. }
  1219. /* 重连遮罩 */
  1220. .maskbg {
  1221. position: fixed;
  1222. left: 0;
  1223. right: 0;
  1224. top: 0;
  1225. bottom: 0;
  1226. background-color: rgba(0,0,0,0.6);
  1227. justify-content: center;
  1228. align-items: center;
  1229. }
  1230. .maskbox {
  1231. background-color: #FFFFFF;
  1232. border-radius: 16rpx;
  1233. padding: 40rpx;
  1234. }
  1235. .maskTxt {
  1236. font-size: 28rpx;
  1237. color: #545F71;
  1238. }
  1239. </style>