detail1.vue 66 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105
  1. <template>
  2. <view class="content">
  3. <view class="header" style="margin:0;padding: 0px;">
  4. <view class="bg" style="position: fixed;top:0px;bottom:0px;left:0px;right:0px;background-image: url('https://jianyaoji.oss-cn-hangzhou.aliyuncs.com/jianyaoji/images/device/bg.png');background-size: 100% 100%;padding:0 40rpx">
  5. <view style="position: absolute;right:10rpx;top:30rpx">
  6. <u-button @click="reportError" color="#EC6D2F" text="上报异常" type="error" size="mini"></u-button>
  7. </view>
  8. <view style="position: absolute;right:52rpx;top:116rpx;" v-if="deviceInfo.status == 3">
  9. <view>
  10. <u-image :showLoading="true" src="/static/images/device/zaixian.png" width="200rpx" height="200rpx" ></u-image>
  11. </view>
  12. <view style="position: absolute;color:#48C373;top:110rpx;left:70rpx">在线</view>
  13. </view>
  14. <view style="position: absolute;right:52rpx;top:116rpx;" v-if="deviceInfo.status == 4">
  15. <view>
  16. <u-image :showLoading="true" src="/static/images/device/offline.png" width="200rpx" height="200rpx" ></u-image>
  17. </view>
  18. <view style="position: absolute;color:lightgray;top:110rpx;left:70rpx">离线</view>
  19. </view>
  20. <view style="font-weight: bold;font-size: 30rpx;margin-top:20rpx">
  21. {{deviceInfo.deviceName}}
  22. </view>
  23. <view class="prop-text">
  24. <text class="text-left">所属用户:</text>
  25. <text class="text-right">{{sysDept.deptName}}</text>
  26. </view>
  27. <view class="prop-text">
  28. <text class="text-left">设备编号:</text>
  29. <text class="text-right">{{deviceInfo.serialNumber}}</text>
  30. </view>
  31. <view class="prop-text">
  32. <text class="text-left">二维码ID:</text>
  33. <text class="text-right">{{deviceInfo.qrcodeId==null?"未绑定":deviceInfo.qrcodeId}}</text>
  34. </view>
  35. <view class="prop-text">
  36. <text class="text-left">激活时间:</text>
  37. <text class="text-right">{{deviceInfo.activeTime}}</text>
  38. </view>
  39. <view class="prop-text">
  40. <text class="text-left">查看位置:</text>
  41. <view style="position: absolute;top:0px;left:120rpx">
  42. <u-icon name="map-fill" label="查看位置" color="#2979ff" size="20" labelSize="12"></u-icon>
  43. </view>
  44. </view>
  45. <view class="prop-card-area">
  46. <view class="prop-card">
  47. <view class="prop-card-top">{{ deviceInfo.rssi }}</view>
  48. <view class="prop-card-bottom">设备信号</view>
  49. </view>
  50. <view class="prop-card">
  51. <view class="prop-card-top">{{ timeobj.alltime }}</view>
  52. <view class="prop-card-bottom">累计时长</view>
  53. </view>
  54. <view class="prop-card">
  55. <view class="prop-card-top">{{ timeobj.avgtime }}</view>
  56. <view class="prop-card-bottom">平均时长</view>
  57. </view>
  58. </view>
  59. <view class="tab-area">
  60. <!-- <u-tabs lineWidth="80" :activeStyle="{ color: '#3E9CFC' }" :list="summary" keyName="tabName" @change="getDeviceStatus"></u-tabs>-->
  61. <u-tabs lineWidth="80" :activeStyle="{ color: '#3E9CFC' }" :list="tabs" :current="current" keyName="tabName" @change="getNewDeviceStatus"></u-tabs>
  62. <view>
  63. <uni-row class="demo-uni-row">
  64. <uni-col :span="12">
  65. </uni-col>
  66. </uni-row>
  67. <uni-row class="demo-uni-row">
  68. <uni-col :span="12">
  69. </uni-col>
  70. </uni-row>
  71. <!-- 煎药控制 -->
  72. <view class="demo-uni-row" v-if="firstTab">
  73. <!-- 子tab -->
  74. <view style="width:70%;margin:0 auto">
  75. <u-tabs :list="summary" :current="subCurrent" @change="changeSub"></u-tabs>
  76. </view>
  77. <!-- 设备和锁定开关 -->
  78. <view class="demo-uni-row clearfix">
  79. <view style="clear: both"></view>
  80. </view>
  81. <!-- 头部 -->
  82. <view class="decoctControlHeader">
  83. <uni-icons custom-prefix="iconfont" type="icon-fuzhushuxian" size="30"></uni-icons>
  84. <text>煎药控制</text>
  85. </view>
  86. <!-- 腰部 -->
  87. <view>
  88. <!-- 上边部份 -->
  89. <view class="decoctControlTop">
  90. <!-- 左边 -->
  91. <view class="decoctControlTopLeft">
  92. <view>温度设置</view>
  93. <view class="control-input-box">
  94. <view style="width: 80px">
  95. <u-input placeholder="请输入" @change="changeTemperature()" v-model="temperature"></u-input>
  96. </view>
  97. <view class="control-input-box-danwei">℃</view>
  98. </view>
  99. <view class="gap">
  100. <view class="addTemperature" @click="addTemperature(1)">
  101. <u-image src="/static/images/device/up_btn.png" width="60rpx" height="60rpx"></u-image>
  102. </view>
  103. <view class="subTemperature" @click="subTemperature(1)">
  104. <u-image src="/static/images/device/down_btn.png" width="60rpx" height="60rpx"></u-image>
  105. </view>
  106. </view>
  107. </view>
  108. <!-- 右边 -->
  109. <view class="decoctControlTopRight">
  110. <view>煎药时间</view>
  111. <view class="control-input-box">
  112. <view style="width: 80px">
  113. <u-input placeholder="请输入" @change="changeTemperatureTime()" v-model="temperatureTime"></u-input>
  114. </view>
  115. <view class="control-input-box-danwei">min</view>
  116. </view>
  117. <view class="gap">
  118. <view class="addTime" @click="addTemperatureTime">
  119. <u-image src="/static/images/device/up_btn.png" width="60rpx" height="60rpx"></u-image>
  120. </view>
  121. <view class="subTime" @click="subTemperatureTime">
  122. <u-image src="/static/images/device/down_btn.png" width="60rpx" height="60rpx"></u-image>
  123. </view>
  124. </view>
  125. </view>
  126. </view>
  127. <!-- 下边部份 -->
  128. <view class="decoctControlTop" style="height: 220rpx">
  129. <!-- 左边 -->
  130. <view class="decoctControlTopLeft" style="width: 30%">
  131. <text>当前温度</text>
  132. <u-input placeholder="0" disabled :value="currentTemperature+'℃'"></u-input>
  133. </view>
  134. <!-- 右边 -->
  135. <view class="decoctControlTopRight" style="width: 30%">
  136. <text>高温时间</text>
  137. <u-input placeholder="0" disabled :value="hightTemperature+'min'"></u-input>
  138. </view>
  139. <view class="decoctControlTopRight" style="width: 30%">
  140. <text>剩余时间</text>
  141. <u-input placeholder="0" disabled :value="leftJianyaoTime+'min'"></u-input>
  142. </view>
  143. </view>
  144. </view>
  145. <!-- 尾部 -->
  146. <view>
  147. <!-- 上边 -->
  148. <view class="decoctControlBottom" >
  149. <!-- 左边 -->
  150. <view>
  151. <text>开关状态</text>
  152. </view>
  153. <!-- 右边 -->
  154. <view style="display: flex;align-items: center">
  155. <text style="margin-right: 15px" v-if="decoctControlOnOffStatus">已开机</text>
  156. <text style="margin-right: 15px" v-if="!decoctControlOnOffStatus">未开机</text>
  157. <u-switch v-model="decoctControlOnOffStatus" @change="decoctControlOnOffChange"></u-switch>
  158. </view>
  159. </view>
  160. <!-- 下边 -->
  161. <view class="decoctControlBottom">
  162. <!-- 左边 -->
  163. <view>
  164. <text v-if="decoctControlStatus">煎药状态</text>
  165. <text v-else>
  166. <text>
  167. 煎药状态
  168. </text>
  169. <text v-if="leftAppointmentTime>0" style="font-size: 10px">
  170. (已预约,开启煎药后进入倒计时)
  171. </text>
  172. </text>
  173. </view>
  174. <!-- 右边 -->
  175. <view style="display: flex;align-items: center">
  176. <text style="margin-right: 15px" v-if="!decoctControlStatus">
  177. 未煎药</text>
  178. <text v-else>
  179. <text style="margin-right: 15px" v-if="leftAppointmentTime == 0">煎药中</text>
  180. <text style="margin-right: 15px" v-if="leftAppointmentTime >0">已预约,剩余{{leftAppointmentTime}}分钟</text>
  181. </text>
  182. <u-switch v-model="decoctControlStatus" @change="decoctControlChange"></u-switch>
  183. </view>
  184. </view>
  185. </view>
  186. </view>
  187. <!-- 包装控制 -->
  188. <view class="demo-uni-row" v-if="!firstTab">
  189. <view class="demo-uni-row clearfix">
  190. <view style="clear: both"></view>
  191. </view>
  192. <!-- 头部 -->
  193. <view class="decoctControlHeader">
  194. <uni-icons custom-prefix="iconfont" type="icon-fuzhushuxian" size="30"></uni-icons>
  195. <text>包装控制</text>
  196. </view>
  197. <!-- 腰部 -->
  198. <view>
  199. <!-- 上边部份 -->
  200. <view class="decoctControlTop" style="margin:0 30rpx">
  201. <!-- 左边 -->
  202. <view class="decoctControlTopLeft" style="width: 23%;margin:0 5px;">
  203. <view>封边温度</view>
  204. <view class="control-input-box">
  205. <view style="width: 80px">
  206. <u-input placeholder="请输入" @change="changeEdegTemperature" v-model="setEdegTemperature"></u-input>
  207. </view>
  208. <view class="control-input-box-danwei">℃</view>
  209. </view>
  210. <view class="addTemperature baozhuang-add" @click="addEdegTemperature">
  211. <u-image src="/static/images/device/up_btn.png" width="60rpx" height="60rpx"></u-image>
  212. </view>
  213. <view class="subTime baozhuang-sub" @click="subEdegTemperature">
  214. <u-image src="/static/images/device/down_btn.png" width="60rpx" height="60rpx"></u-image>
  215. </view>
  216. </view>
  217. <!-- 右边 -->
  218. <view class="decoctControlTopLeft" style="width: 23%;margin:0 5px;">
  219. <view>封口温度</view>
  220. <view class="control-input-box">
  221. <view style="width: 80px">
  222. <u-input placeholder="请输入" @change="changeSealingTemperature" v-model="setSealingTemperature"></u-input>
  223. </view>
  224. <view class="control-input-box-danwei">℃</view>
  225. </view>
  226. <view class="addTemperature baozhuang-add" @click="addSealingTemperature">
  227. <u-image src="/static/images/device/up_btn.png" width="60rpx" height="60rpx"></u-image>
  228. </view>
  229. <view class="subTime baozhuang-sub" @click="subSealingTemperature">
  230. <u-image src="/static/images/device/down_btn.png" width="60rpx" height="60rpx"></u-image>
  231. </view>
  232. </view>
  233. <view class="decoctControlTopLeft" style="width: 23%;margin:0 5px;">
  234. <view>包装容量</view>
  235. <view class="control-input-box">
  236. <view style="width: 80px">
  237. <u-input placeholder="请输入" @change="changePackageVolume" :value="packageVolume"></u-input>
  238. </view>
  239. <view class="control-input-box-danwei">ml</view>
  240. </view>
  241. <view class="addTemperature baozhuang-add" @click="addPackageVolume">
  242. <u-image src="/static/images/device/up_btn.png" width="60rpx" height="60rpx"></u-image>
  243. </view>
  244. <view class="subTime baozhuang-sub" @click="subPackageVolume">
  245. <u-image src="/static/images/device/down_btn.png" width="60rpx" height="60rpx"></u-image>
  246. </view>
  247. </view>
  248. <!-- 右边 -->
  249. <view style="width:23%;line-height: 2;text-align: center;margin: 0 1px;position: relative">
  250. <view>包装数量</view>
  251. <view class="control-input-box">
  252. <view style="width: 80px">
  253. <u-input placeholder="请输入" @change="changePackageNumber" :value="packageNumber"></u-input>
  254. </view>
  255. <view class="control-input-box-danwei">个</view>
  256. </view>
  257. <view class="addTemperature baozhuang-add" @click="addPackageNumber">
  258. <u-image src="/static/images/device/up_btn.png" width="60rpx" height="60rpx"></u-image>
  259. </view>
  260. <view class="subTime baozhuang-sub" @click="subPackageNumber">
  261. <u-image src="/static/images/device/down_btn.png" width="60rpx" height="60rpx"></u-image>
  262. </view>
  263. </view>
  264. </view>
  265. <!-- 下边部份 -->
  266. <view class="decoctControlTop">
  267. <view class="decoctControlTopLeft" style="width: 40%">
  268. <text>当前封边温度</text>
  269. <u-input placeholder="0" disabled :value="edegTemperature+'℃'"></u-input>
  270. </view>
  271. <!-- 右边 -->
  272. <view class="decoctControlTopRight" style="width: 40%">
  273. <text>当前封口温度</text>
  274. <u-input placeholder="0" disabled :value="sealingTemperature+'℃'"></u-input>
  275. </view>
  276. </view>
  277. </view>
  278. <!-- 尾部 -->
  279. <view>
  280. <!-- 上边 -->
  281. <view class="decoctControlBottom">
  282. <!-- 左边 -->
  283. <view>
  284. <text>开关</text>
  285. </view>
  286. <!-- 右边 -->
  287. <view style="display: flex;align-items: center">
  288. <text style="margin-right: 15px" v-if="decoctControlOnOffStatus">已开机</text>
  289. <text style="margin-right: 15px" v-if="!decoctControlOnOffStatus">未开机</text>
  290. <u-switch v-model="decoctControlOnOffStatus" @change="decoctControlOnOffChange"></u-switch>
  291. </view>
  292. </view>
  293. <view class="decoctControlBottom">
  294. <!-- 左边 -->
  295. <view>
  296. <text>启停开关</text>
  297. </view>
  298. <!-- 右边 -->
  299. <view style="display: flex;align-items: center">
  300. <text style="margin-right: 15px" v-if="!qitingTurn">未开启</text>
  301. <text style="margin-right: 15px" v-if="qitingTurn">已开启</text>
  302. <u-switch v-model="qitingTurn" @change="turnChange(1)"></u-switch>
  303. </view>
  304. </view>
  305. <view class="decoctControlBottom">
  306. <!-- 左边 -->
  307. <view>
  308. <text>包装开关</text>
  309. </view>
  310. <!-- 右边 -->
  311. <view style="display: flex;align-items: center">
  312. <text style="margin-right: 15px" v-if="!baozhuangTurn">未开启</text>
  313. <text style="margin-right: 15px" v-if="baozhuangTurn">已开启</text>
  314. <u-switch v-model="baozhuangTurn" @change="turnChange(2)"></u-switch>
  315. </view>
  316. </view>
  317. <view class="decoctControlBottom">
  318. <!-- 左边 -->
  319. <view>
  320. <text>清洗开关</text>
  321. </view>
  322. <!-- 右边 -->
  323. <view style="display: flex;align-items: center">
  324. <text style="margin-right: 15px" v-if="!qingxiTurn">未开启</text>
  325. <text style="margin-right: 15px" v-if="qingxiTurn">已开启</text>
  326. <u-switch v-model="qingxiTurn" @change="turnChange(3)"></u-switch>
  327. </view>
  328. </view>
  329. <!-- &lt;!&ndash; 下边 &ndash;&gt;-->
  330. <!-- <view class="decoctControlBottom">-->
  331. <!-- &lt;!&ndash; 左边 &ndash;&gt;-->
  332. <!-- <view>-->
  333. <!-- <text>模式</text>-->
  334. <!-- </view>-->
  335. <!-- &lt;!&ndash; 右边 &ndash;&gt;-->
  336. <!-- <view style="display: flex;align-items: center">-->
  337. <!-- <text class="packageControlBottomRight">包装</text>-->
  338. <!-- <text class="packageControlBottomClear">清洗</text>-->
  339. <!-- </view>-->
  340. <!-- </view>-->
  341. </view>
  342. </view>
  343. <view class="action-btn">
  344. <button @click="showDrawer" class="login-btn cu-btn block bg-blue lg round" style="flex: 0 0 auto;width: 55%;margin: 0 auto;margin-top:20px;">高级设置</button>
  345. </view>
  346. <uni-drawer ref="showLeft" :width="320" :maskClick="true" mode="left" @change="change($event,'showLeft')">
  347. <!-- <view class="item" style="padding-top:10rpx">-->
  348. <!-- <u-button v-if="deviceInfo.status==3"-->
  349. <!-- @tap="send(item)"-->
  350. <!-- text="发送"-->
  351. <!-- type="success"-->
  352. <!-- size="mini"-->
  353. <!-- ></u-button>-->
  354. <!-- <u-button v-if="deviceInfo.status!=3"-->
  355. <!-- @tap="send(item)"-->
  356. <!-- text="发送"-->
  357. <!-- type="info"-->
  358. <!-- size="mini"-->
  359. <!-- ></u-button>-->
  360. <!-- </view>-->
  361. <scroll-view style="height: 88%;" scroll-y="true">
  362. <view>
  363. <view class="prop-item" v-if="firstTab">
  364. <view class="prop-item-left">温度校准</view>
  365. <view class="prop-item-right">
  366. <view style="width:120rpx;position: absolute;top:0rpx;">
  367. <button @click="temperNumber" class="login-btn cu-btn block bg-blue lg round send_btn">点击校准</button>
  368. </view>
  369. </view>
  370. </view>
  371. <view class="prop-item" v-if="!firstTab">
  372. <view class="prop-item-left">容量校准</view>
  373. <view class="prop-item-right">
  374. <view style="width:120rpx;position: absolute;top:0rpx;">
  375. <button @click="volumeNumber" class="login-btn cu-btn block bg-blue lg round send_btn">点击校准</button>
  376. </view>
  377. </view>
  378. </view>
  379. <view class="prop-item">
  380. <view class="prop-item-left">恢复出厂</view>
  381. <view class="prop-item-right">
  382. <view style="width:120rpx;position: absolute;top:0rpx;">
  383. <button @click="reset" class="login-btn cu-btn block bg-blue lg round send_btn">点击恢复</button>
  384. </view>
  385. </view>
  386. </view>
  387. <view class="prop-item" v-if="firstTab">
  388. <view class="prop-item-left">工作模式</view>
  389. <view class="prop-item-right">
  390. <view style="width:320rpx;position: absolute;top:0rpx;">
  391. <view style="display: flex;align-items: center">
  392. <text @click="setMode(1)" class="packageControlBottomClear" :class="workMode == 1?'active_btn':''" style="font-size: 10px;width: 50rpx;margin-right:5px">模式1</text>
  393. <text @click="setMode(2)" class="packageControlBottomClear" :class="workMode == 2?'active_btn':''" style="font-size: 10px;width: 50rpx;margin-right:5px">模式2</text>
  394. <text @click="setMode(3)" class="packageControlBottomClear" :class="workMode == 3?'active_btn':''" style="font-size: 10px;width: 50rpx;margin-right:5px">模式3</text>
  395. </view>
  396. </view>
  397. </view>
  398. </view>
  399. <view class="prop-item" v-if="firstTab">
  400. <view class="prop-item-left">预约时间</view>
  401. <view class="prop-item-right">
  402. <view style="width:320rpx;position: absolute;top:0rpx;">
  403. <view style="display: flex;align-items: center">
  404. <view v-if="leftAppointmentTime>0" style=" width:600rpx; left: -28%;position: absolute;top:0rpx;display:flex;margin-top: 5px;font-size: 12px;">
  405. 预约剩余时间:{{leftAppointmentTime}}min
  406. <button @click="cancelPlan" class="login-btn cu-btn block bg-blue lg round " style="margin-top:0px;width: 160rpx;height: 40rpx ;
  407. font-size: 10px ;margin-left:5px">取消预约</button>
  408. </view>
  409. <view v-if="leftAppointmentTime==0" style="width:300rpx;position: absolute;top:0rpx;display: flex;flex-direction: row">
  410. <u-input customStyle="position: relative;width: 50px;left: 0px;top:5px;height: 40rpx;" placeholder="请输入" v-model="planTime"></u-input>
  411. <view style="margin-top: 6px;">min</view>
  412. <button @click="plan" class="login-btn cu-btn block bg-blue lg round " style="margin-left:10rpx;width: 160rpx;height: 40rpx ;
  413. font-size: 10px ;
  414. margin-top: 5px;">预约煎药</button>
  415. </view>
  416. </view>
  417. </view>
  418. </view>
  419. </view>
  420. <view class="prop-item">
  421. <view class="prop-item-left">锁定设备</view>
  422. <view class="prop-item-right">
  423. <view style="width:320rpx;position: absolute;top:0rpx;">
  424. <view style="display: flex;align-items: center">
  425. <view v-if="lock.value == 0" style="margin-top: 4px;">
  426. <text class="packageControlBottomClear" style="font-size: 10px;width: 70rpx;margin-right:5px">未锁定</text>
  427. <text @click="lockCtrl(0)" class="packageControlBottomRight" style="font-size: 10px;width: 70rpx;margin-right:5px">点击锁定</text>
  428. </view>
  429. <view v-if="lock.value == 1" style="margin-top: 4px;">
  430. <text class="packageControlBottomClear" style="font-size: 10px;width: 70rpx;margin-right:5px;background: darkred">已锁定</text>
  431. <text @click="lockCtrl(1)" class="packageControlBottomClear" style="font-size: 10px;width: 70rpx;margin-right:5px;background: #EC6D2F">点击解锁</text>
  432. </view>
  433. </view>
  434. </view>
  435. </view>
  436. </view>
  437. </view>
  438. </scroll-view>
  439. <button @click="closeDrawer" class="login-btn cu-btn block bg-blue lg round">关闭</button>
  440. </uni-drawer>
  441. </view>
  442. </view>
  443. </view>
  444. <u-picker @cancel="show=null" :show="show!=null" :columns="columns" @confirm="confirmItemData" keyName="text"></u-picker>
  445. <u-modal @cancel="cancel" :show="showErrDlg" title="异常上报" :showCancelButton="true" @confirm="doReportError" >
  446. <view class="slot-content">
  447. <view style="margin:10px">
  448. <textarea auto-height ="true" v-model="errorMsg" placeholder="请输入异常内容" ></textarea>
  449. </view>
  450. </view>
  451. </u-modal>
  452. <!-- <u-modal :show="showTimeDlg" title="查看时长" @confirm="closeTime" >-->
  453. <!-- <view class="slot-content">-->
  454. <!-- <view v-if="timeobj!=null && deviceInfo.status == 3">本次运行时长:{{ timeobj.runtime }}</view>-->
  455. <!-- <view v-if="timeobj!=null ">累计时长:{{ timeobj.alltime }}</view>-->
  456. <!-- <view v-if="timeobj!=null ">平均每天运行时长:{{ timeobj.avgtime }}</view>-->
  457. <!-- </view>-->
  458. <!-- </u-modal>-->
  459. </view>
  460. </view>
  461. </template>
  462. <script>
  463. import { getDetail,getDeviceStatus,cacheJsonThingsModel,reportError ,getDeviceRunTime} from '@/api/device/device.js'
  464. import UButton from "../../uni_modules/uview-ui/components/u-button/u-button";
  465. import UForm from "../../uni_modules/uview-ui/components/u--form/u--form";
  466. import UInput from "../../uni_modules/uview-ui/components/u--input/u--input";
  467. import UImage from "../../uni_modules/uview-ui/components/u--image/u--image";
  468. export default {
  469. components: {UImage, UInput, UForm, UButton},
  470. data(){
  471. return {
  472. planTime:10,
  473. setSealingTemperature:160,
  474. setEdegTemperature:160,
  475. sealingTemperature:0,
  476. edegTemperature:0,
  477. hightTemperature:0,
  478. currentTemperature:0,
  479. temperatureTime:0,
  480. temperature:0,
  481. packageNumber:0,
  482. packageVolume:50,
  483. firstTab:true,
  484. decoctControlStatus:false,
  485. decoctControlOnOffStatus:false,
  486. packageControlOnOffStatus:false,
  487. subDecoctTabList:[
  488. {name:'子煎药1'},
  489. {name:'子煎药2'},
  490. {name:'子煎药3'},
  491. ],
  492. DecoctControlStatus:false,
  493. PackagControlStatus:false,
  494. baozhuangTurn:false,
  495. qitingTurn:false,
  496. qingxiTurn:false,
  497. subCurrent:0,
  498. current:0,
  499. inputStyle:{height:'44rpx','fontSize':'20rpx'},
  500. modelKey:['PowerControl','LockControl'],
  501. jianyaoKeys : ["TempSetting","TimeSetting"],
  502. baozhuangKeys:["SetSealTemp","SetBandingTemp","PackageQuantity","PackingVolume"],
  503. power:{
  504. loading:true,
  505. value:0,
  506. },
  507. lock:{
  508. loading:true,
  509. value:0,
  510. },
  511. showTimeDlg:false,
  512. showErrDlg:null,
  513. errorMsg:"asdasdasdasd",
  514. show:null,
  515. value:"",
  516. deviceInfo:{},
  517. id:0,
  518. summary:[
  519. ],
  520. tabs:[
  521. {tabName:"煎药控制"},
  522. {tabName:"包装控制"},
  523. ],
  524. activeName:0,
  525. childId:0,
  526. oneToMul:false,
  527. inputProp:[],
  528. watchProp:[],
  529. columns:[],
  530. location:{},
  531. sysDept:null,
  532. timeobj:{alltime:0,avgtime:0},
  533. publishMsg:false,
  534. checkTimer:null,
  535. functions:[],
  536. properties:[],
  537. propMap:{},
  538. jianyaoTimer:null,
  539. baozhuangTimer:null,
  540. editing:false,
  541. workMode:1,
  542. leftAppointmentTime:0,
  543. leftJianyaoTime:0,
  544. }
  545. },
  546. onLoad: function(opt) {
  547. this.id = opt.id;
  548. // this.id = 61;
  549. this.connectMqtt();
  550. this.getDetail();
  551. },
  552. destroyed() {
  553. // 取消订阅主题
  554. this.mqttUnSubscribe(this.deviceInfo);
  555. clearTimeout(this.checkTimer);
  556. },
  557. methods:{
  558. changePackageVolume(){
  559. if(this.packageVolume<50){
  560. this.packageVolume = 50;
  561. }
  562. if(this.packageVolume>300){
  563. this.packageVolume = 300;
  564. }
  565. this.sendBaozhuang("PackingVolume");
  566. },
  567. changePackageNumber(){
  568. let min = 1;
  569. let max = 999;
  570. if(this.packageNumber<min){
  571. this.packageNumber = min;
  572. }
  573. if(this.packageNumber>max){
  574. this.packageNumber = max;
  575. }
  576. this.sendBaozhuang("PackageQuantity");
  577. },
  578. changeEdegTemperature(){
  579. let min = 80;
  580. let max = 220;
  581. if(this.setEdegTemperature<min){
  582. this.setEdegTemperature = min;
  583. }
  584. if(this.setEdegTemperature>max){
  585. this.setEdegTemperature = max;
  586. }
  587. console.log("current setEdegTemperature is :"+this.setEdegTemperature)
  588. this.sendBaozhuang("SetBandingTemp");
  589. },
  590. changeSealingTemperature(){
  591. let min = 80;
  592. let max = 220;
  593. if(this.setSealingTemperature<min){
  594. this.setSealingTemperature = min;
  595. }
  596. if(this.setSealingTemperature>max){
  597. this.setSealingTemperature = max;
  598. }
  599. console.log("current setSealingTemperature is :"+this.setSealingTemperature)
  600. this.sendBaozhuang("SetSealTemp");
  601. },
  602. changeTemperature(){
  603. let max = 140;
  604. let min = 100;
  605. if(this.workMode == 2){
  606. min = 1;
  607. }
  608. if(this.temperature<min){
  609. this.temperature = min;
  610. }
  611. if(this.temperature>max){
  612. this.temperature = max;
  613. }
  614. console.log("current temperature is :"+this.temperature)
  615. this.sendJianYao("TempSetting");
  616. },
  617. changeTemperatureTime(){
  618. let min = 1;
  619. let max = 600;
  620. if(this.temperatureTime<min){
  621. this.temperatureTime = min;
  622. }
  623. if(this.temperatureTime>max){
  624. this.temperatureTime = max;
  625. }
  626. console.log("current temperatureTime is :"+this.temperatureTime)
  627. this.sendJianYao("TimeSetting");
  628. },
  629. cancelPlan(){
  630. let arr = [];
  631. let obj = {};
  632. obj.id = "AppointmentTime";
  633. obj.shadow = 0;
  634. arr.push(obj);
  635. this.mqttPublish(2,this.deviceInfo,arr,true);
  636. },
  637. plan(){
  638. let self = this;
  639. if(this.planTime>600){
  640. this.$modal.showToast('预约时间最大为600分钟')
  641. return;
  642. }
  643. if(this.planTime == 0){
  644. this.$modal.showToast('预约时间不能为空')
  645. }else{
  646. let arr = [];
  647. let obj = {};
  648. obj.id = "AppointmentTime";
  649. obj.shadow = this.planTime;
  650. arr.push(obj);
  651. this.mqttPublish(2,this.deviceInfo,arr,true);
  652. }
  653. },
  654. lockCtrl(key){
  655. let arr = [];
  656. let obj = {};
  657. obj.id = "LockControl";
  658. if(key == 0){
  659. obj.shadow = 1;
  660. this.lock.value = 1;
  661. }else{
  662. obj.shadow = 0;
  663. this.lock.value = 0;
  664. }
  665. arr.push(obj);
  666. this.mqttPublish(2,this.deviceInfo,arr)
  667. },
  668. setMode(type){
  669. let arr = [];
  670. let obj = {};
  671. obj.id = "WorkMode";
  672. obj.shadow = type;
  673. arr.push(obj);
  674. this.mqttPublish(2,this.deviceInfo,arr,true)
  675. this.workMode = type;
  676. },
  677. temperNumber(){
  678. let arr = [];
  679. let obj = {};
  680. obj.id = "CalibrationTemp";
  681. obj.shadow = 1;
  682. arr.push(obj);
  683. this.mqttPublish(2,this.deviceInfo,arr,true)
  684. },
  685. volumeNumber(){
  686. let arr = [];
  687. let obj = {};
  688. obj.id = "CapacityCalibration";
  689. obj.shadow = 1;
  690. arr.push(obj);
  691. this.mqttPublish(2,this.deviceInfo,arr,true)
  692. },
  693. reset(){
  694. let arr = [];
  695. let obj = {};
  696. obj.id = "RestoreFactory";
  697. obj.shadow = 1;
  698. arr.push(obj);
  699. this.mqttPublish(2,this.deviceInfo,arr)
  700. },
  701. turnChange(type){
  702. let flag = false;
  703. let obj = {};
  704. if(type ==3){
  705. if(this.baozhuangTurn || this.qitingTurn){
  706. this.$modal.showToast("启停、包装、清洗不能同时打开")
  707. this.qingxiTurn = !this.qingxiTurn;
  708. return;
  709. }
  710. flag = this.qingxiTurn;
  711. obj.id = "WashSwitch";
  712. }else if(type == 2){
  713. if(this.qingxiTurn || this.qitingTurn){
  714. this.$modal.showToast("启停、包装、清洗不能同时打开")
  715. this.baozhuangTurn = !this.baozhuangTurn;
  716. return;
  717. }
  718. flag = this.baozhuangTurn;
  719. obj.id = "PackageSwitch";
  720. }else if(type == 1) {
  721. if(this.qingxiTurn || this.baozhuangTurn){
  722. this.$modal.showToast("启停、包装、清洗不能同时打开")
  723. this.qitingTurn = !this.qitingTurn;
  724. return;
  725. }
  726. flag = this.qitingTurn;
  727. obj.id = "CarrybagSwitch";
  728. }
  729. let arr = [];
  730. if(flag){
  731. obj.shadow = 1;
  732. }else{
  733. obj.shadow = 0;
  734. }
  735. arr.push(obj);
  736. this.mqttPublish(2,this.deviceInfo,arr)
  737. },
  738. addPackageVolume(){
  739. this.packageVolume++;
  740. console.log("增加包装容量")
  741. this.changePackageVolume()
  742. },
  743. subPackageVolume(){
  744. this.packageVolume--;
  745. console.log("减少包装容量")
  746. this.changePackageVolume()
  747. },
  748. addPackageNumber(){
  749. this.packageNumber++;
  750. console.log("增加包装数量")
  751. this.changePackageNumber();
  752. },
  753. subPackageNumber(){
  754. this.packageNumber--;
  755. console.log("减少包装数量")
  756. this.changePackageNumber();
  757. },
  758. addSealingTemperature(){
  759. console.log("增加封口温度")
  760. this.setSealingTemperature++;
  761. this.changeSealingTemperature();
  762. },
  763. subSealingTemperature(){
  764. console.log("减少封口温度")
  765. this.setSealingTemperature--;
  766. this.changeSealingTemperature();
  767. },
  768. addEdegTemperature(){
  769. console.log("增加封边温度")
  770. this.editing = true;
  771. this.setEdegTemperature++;
  772. this.changeEdegTemperature();
  773. },
  774. subEdegTemperature(){
  775. console.log("减少封边温度")
  776. this.editing = true;
  777. this.setEdegTemperature--;
  778. this.changeEdegTemperature();
  779. },
  780. addTemperatureTime(){
  781. console.log("增加煎药时间")
  782. this.temperatureTime++;
  783. this.changeTemperatureTime()
  784. },
  785. subTemperatureTime(){
  786. console.log("减少煎药时间")
  787. this.temperatureTime--;
  788. this.changeTemperatureTime()
  789. },
  790. addTemperature(){
  791. console.log("增加煎药温度")
  792. this.temperature++;
  793. this.changeTemperature();
  794. },
  795. subTemperature(type){
  796. console.log("减少煎药温度")
  797. this.temperature--;
  798. this.changeTemperature();
  799. },
  800. sendBaozhuang(targetKey){
  801. let self = this;
  802. let arr = [];
  803. if(this.baozhuangTimer != null){
  804. clearTimeout(this.baozhuangTimer);
  805. }
  806. this.baozhuangTimer = setTimeout(function (){
  807. for (let i = 0; i <this.baozhuangKeys.length; i++) {
  808. let key = this.baozhuangKeys[i];
  809. let obj = {};
  810. obj.id = key;
  811. if(key === "PackingVolume"){
  812. obj.shadow = this.packageVolume;
  813. }
  814. if(key === "PackageQuantity"){
  815. obj.shadow = this.packageNumber;
  816. }
  817. if(key === "SetSealTemp"){
  818. obj.shadow = this.setSealingTemperature;
  819. }
  820. if(key === "SetBandingTemp"){
  821. obj.shadow = this.setEdegTemperature;
  822. }
  823. if(targetKey == key){
  824. arr.push(obj);
  825. break;
  826. }
  827. }
  828. this.mqttPublish(2,this.deviceInfo,arr)
  829. }.bind(this),500);
  830. },
  831. sendJianYao(targetKey){
  832. let arr = [];
  833. if(this.jianyaoTimer != null){
  834. clearTimeout(this.jianyaoTimer);
  835. }
  836. this.jianyaoTimer = setTimeout(function (){
  837. for (let i = 0; i <this.jianyaoKeys.length; i++) {
  838. let key = this.jianyaoKeys[i];
  839. let obj = {};
  840. obj.id = key;
  841. if(key === "TempSetting"){
  842. obj.shadow = this.temperature;
  843. }
  844. if(key === "TimeSetting"){
  845. obj.shadow = this.temperatureTime;
  846. }
  847. if(targetKey == key){
  848. arr.push(obj);
  849. break;
  850. }
  851. }
  852. this.mqttPublish(2,this.deviceInfo,arr,true)
  853. }.bind(this),500);
  854. },
  855. buildPropKey(key){
  856. if(this.childId !=0){
  857. return key+"_"+this.childId;
  858. }else{
  859. return key;
  860. }
  861. },
  862. decoctControlChange(){
  863. let obj = {};
  864. let arr = [];
  865. obj.id = "DecoctingSwitch";
  866. if(this.decoctControlStatus){
  867. obj.shadow = 1;
  868. console.log("煎药状态打开")
  869. }else{
  870. obj.shadow = 0;
  871. console.log("煎药状态关闭")
  872. }
  873. arr.push(obj);
  874. this.mqttPublish(2,this.deviceInfo,arr,true)
  875. },
  876. decoctControlOnOffChange(){
  877. let obj = {};
  878. let arr = [];
  879. obj.id = "PowerControl";
  880. let isMul = false;
  881. if(this.decoctControlStatus){
  882. this.$modal.showToast('请先结束煎药后,再开机')
  883. this.decoctControlOnOffStatus = !this.decoctControlOnOffStatus;
  884. return;
  885. }
  886. if(this.oneToMul && this.firstTab){
  887. obj.id = "PowerCtl";
  888. isMul = true;
  889. }
  890. if(this.decoctControlOnOffStatus){
  891. obj.shadow = 1;
  892. console.log("煎药机开关打开")
  893. }else{
  894. obj.shadow = 0;
  895. console.log("煎药机开关关闭")
  896. }
  897. arr.push(obj);
  898. this.mqttPublish(2,this.deviceInfo,arr,isMul)
  899. },
  900. packageControlOnOffChange(){
  901. let obj = {};
  902. let arr = [];
  903. obj.id = "DecoctingSwitch";
  904. if(this.packageControlOnOffStatus){
  905. obj.shadow = 1;
  906. console.log("包装控制打开")
  907. }else{
  908. obj.shadow = 0;
  909. console.log("包装控制关闭")
  910. }
  911. arr.push(obj);
  912. this.mqttPublish(2,this.deviceInfo,arr)
  913. },
  914. containKey(arr,key){
  915. for (let i = 0; i < arr.length; i++) {
  916. const data = arr[i];
  917. if(data == key){
  918. return true;
  919. }
  920. }
  921. return false;
  922. },
  923. // 抽屉状态发生变化触发
  924. change(e, type) {
  925. console.log(e);
  926. },
  927. showDrawer() {
  928. this.$refs.showLeft.open();
  929. },
  930. closeDrawer() {
  931. this.$refs.showLeft.close();
  932. },
  933. checkItemValue(item){
  934. if(!item.shadow){
  935. item.shadow = 0;
  936. }
  937. if(!item.unit){
  938. item.unit = "";
  939. }
  940. return true;
  941. },
  942. sendProperties(){
  943. let properties = this.properties;
  944. for (let i = 0; i < properties; i++) {
  945. let property = this.properties[i];
  946. let shadow = property.shadow;
  947. if(shadow){
  948. arr.push(property);
  949. }
  950. }
  951. this.mqttPublish(1,this.deviceInfo,arr)
  952. },
  953. sendFunctions(){
  954. let arr = [];
  955. let functions = this.functions;
  956. for (let i = 0; i < functions.length; i++) {
  957. let functionObj = this.functions[i];
  958. let shadow = functionObj.shadow;
  959. if(shadow){
  960. arr.push(functionObj);
  961. }
  962. }
  963. this.mqttPublish(2,this.deviceInfo,arr)
  964. },
  965. changeProp(key,val){
  966. let item = null;
  967. let obj = null;
  968. let oneToMul = this.oneToMul;
  969. if(key === "LockControl"){
  970. this.lock.value = val;
  971. item = this.lock;
  972. }else if(key === "PowerControl"){
  973. this.power.value = val;
  974. item = this.power;
  975. }
  976. let value = val;
  977. obj = item.item;
  978. if(value){
  979. obj.value = 1;
  980. obj.shadow = 1;
  981. }else{
  982. obj.value = 0;
  983. obj.shadow = 0;
  984. }
  985. if(!oneToMul){
  986. }
  987. this.publishThingsModel(this.deviceInfo,obj);
  988. },
  989. checkCommonProp(item){
  990. let id =item.id;
  991. let isCommonKey = this.modelKey.some(res=>{
  992. return id === res;
  993. })
  994. return !isCommonKey;
  995. },
  996. getRunTime(){
  997. let self = this;
  998. getDeviceRunTime(this.id).then(res=>{
  999. self.timeobj = res.data;
  1000. if(self.timeobj.avgtime == ""){
  1001. self.timeobj.avgtime = 0;
  1002. }
  1003. if(self.timeobj.alltime == ""){
  1004. self.timeobj.alltime = 0;
  1005. }
  1006. })
  1007. },
  1008. seeTime(){
  1009. this.showTimeDlg = true;
  1010. this.getRunTime();
  1011. },
  1012. closeTime(){
  1013. this.showTimeDlg = false;
  1014. },
  1015. cancel(){
  1016. this.showErrDlg = false;
  1017. },
  1018. reportError(){
  1019. this.showErrDlg = true;
  1020. },
  1021. doReportError(){
  1022. if(!this.errorMsg){
  1023. this.$modal.showToast('异常信息不能为空')
  1024. }else{
  1025. let self = this;
  1026. let errObj = {};
  1027. errObj.deviceId = this.deviceInfo.deviceId;
  1028. errObj.deviceName = this.deviceInfo.deviceName
  1029. errObj.desc = this.errorMsg;
  1030. errObj.deptId= this.deviceInfo.deptId;
  1031. reportError(errObj).then(res=>{
  1032. self.$modal.showToast(res.msg)
  1033. self.cancel();
  1034. })
  1035. }
  1036. },
  1037. openLocation(){
  1038. uni.openLocation({
  1039. latitude: this.location.latitude,
  1040. longitude: this.location.longitude,
  1041. success: function () {
  1042. console.log('success');
  1043. }
  1044. });
  1045. },
  1046. confirmItemData(e){
  1047. let data = e.value[0];
  1048. this.show.text = data.text;
  1049. this.show.shadow=data.value;
  1050. this.show = null;
  1051. console.log(data);
  1052. },
  1053. send(){
  1054. let shadow = false
  1055. let _arr = []
  1056. this.inputProp.forEach((item)=>{
  1057. _arr.push(item.value)
  1058. })
  1059. // if(_arr.some(val => val === '' || val.length < 0)){
  1060. // shadow = true
  1061. // }
  1062. if(this.deviceInfo.status != 3){
  1063. uni.showToast({
  1064. title:"设备暂未上线",
  1065. icon:"error"
  1066. })
  1067. return;
  1068. }
  1069. if(shadow){
  1070. uni.showToast({
  1071. title:"数据不能为空",
  1072. icon:"error"
  1073. })
  1074. return;
  1075. }
  1076. this.publishThingsModel(this.deviceInfo,this.inputProp.map(item=>{return{"id":item.id,"value":item.value}}))
  1077. },
  1078. /** 更新设备状态 */
  1079. updateDeviceStatus(device) {
  1080. },
  1081. chooseItemData(data){
  1082. if(this.deviceInfo.status != 3){
  1083. uni.showToast({
  1084. title:"设备暂未上线",
  1085. icon:"error"
  1086. })
  1087. return;
  1088. }
  1089. this.columns = [data.enumList];
  1090. this.show =data;
  1091. },
  1092. getDetail(){
  1093. let self = this;
  1094. getDetail(this.id).then(res=>{
  1095. self.deviceInfo = res.data;
  1096. self.location = {
  1097. latitude: self.deviceInfo.latitude,
  1098. longitude: self.deviceInfo.longitude};
  1099. self.sysDept = self.deviceInfo.sysDept;
  1100. self.parseSummay(res.data.summary)
  1101. self.mqttSubscribe(res.data);
  1102. self.getDeviceStatus();
  1103. self.seeTime();
  1104. });
  1105. },
  1106. getDeviceStatus(){
  1107. let self = this;
  1108. if(this.summary.length>1){
  1109. }else{
  1110. this.childId = 0;
  1111. }
  1112. getDeviceStatus(this.id,this.childId).then(res=>{
  1113. let data =res.data;
  1114. this.deviceInfo = data;
  1115. self.parseStatusData(data)
  1116. });
  1117. },
  1118. getNewDeviceStatus(item){
  1119. console.log(item);
  1120. let self = this;
  1121. if(item.index == 0){
  1122. this.firstTab = true;
  1123. this.getDeviceStatus();
  1124. }
  1125. if(item.index == 1){
  1126. this.firstTab = false;
  1127. getDeviceStatus(this.id,0).then(res=>{
  1128. let data =res.data;
  1129. this.deviceInfo = data;
  1130. self.parseStatusData(data)
  1131. });
  1132. }
  1133. },
  1134. changeSub(item){
  1135. this.childId = item.id;
  1136. this.getDeviceStatus()
  1137. },
  1138. parseEnumList(){
  1139. let enumList = this.deviceInfo.enumList;
  1140. for (let enumListElement of enumList) {
  1141. let id = enumListElement.id;
  1142. if(id.indexOf("LockControl") !=-1){
  1143. let shadow = enumListElement.shadow;
  1144. this.lock.item = enumListElement;
  1145. if(shadow == 1){
  1146. this.lock.value = true;
  1147. this.lock.loading = false;
  1148. }else if(shadow == 0){
  1149. this.lock.value = false;
  1150. this.lock.loading = false;
  1151. }else{
  1152. this.lock.loading = true;
  1153. }
  1154. }
  1155. if(id.indexOf("PowerControl") !=-1){
  1156. let shadow = enumListElement.shadow;
  1157. if(this.oneToMul){
  1158. if(!this.firstTab){
  1159. if(shadow == 1){
  1160. this.decoctControlOnOffStatus = true;
  1161. }else if(shadow == 0){
  1162. this.decoctControlOnOffStatus = false;
  1163. }
  1164. }
  1165. }else{
  1166. if(shadow == 1){
  1167. this.decoctControlOnOffStatus = true;
  1168. }else if(shadow == 0){
  1169. this.decoctControlOnOffStatus = false;
  1170. }
  1171. }
  1172. }
  1173. if(id.indexOf("PowerCtl") !=-1){
  1174. if(this.oneToMul && this.firstTab){
  1175. let shadow = enumListElement.shadow;
  1176. if(shadow == 1){
  1177. this.decoctControlOnOffStatus = true;
  1178. }else if(shadow == 0){
  1179. this.decoctControlOnOffStatus = false;
  1180. }
  1181. }
  1182. }
  1183. this.formatValue(id,enumListElement,"DecoctingSwitch","decoctControlStatus")
  1184. this.formatValue(id,enumListElement,"CarrybagSwitch","qitingTurn")
  1185. this.formatValue(id,enumListElement,"WashSwitch","qingxiTurn")
  1186. this.formatValue(id,enumListElement,"PackageSwitch","baozhuangTurn");
  1187. if(id.indexOf("WorkMode") !=-1){
  1188. let shadow = enumListElement.shadow;
  1189. if(!shadow){
  1190. shadow = 1;
  1191. }
  1192. this.workMode = shadow;
  1193. }
  1194. let shadow = enumListElement.shadow
  1195. let valueList = enumListElement.enumList;
  1196. for (let valueObj of valueList){
  1197. if(valueObj.value == shadow){
  1198. enumListElement.text = valueObj.text;
  1199. }
  1200. }
  1201. }
  1202. },
  1203. formatValue(id,enumListElement,key,propkey){
  1204. if(id.indexOf(key) !=-1){
  1205. let shadow = enumListElement.shadow;
  1206. if(shadow == 1){
  1207. this[propkey] = true;
  1208. }else if(shadow == 0){
  1209. this[propkey] = false;
  1210. }
  1211. }
  1212. },
  1213. parseStatusData(data){
  1214. let self = this;
  1215. cacheJsonThingsModel(data.productId).then(res=>{
  1216. let thingsModel = JSON.parse(res.data);
  1217. let arr = [];
  1218. let arrayList = data.arrayList;
  1219. arr = arr.concat(arrayList);
  1220. let enumList = data.enumList;
  1221. arr = arr.concat(enumList);
  1222. let integerList = data.integerList;
  1223. arr = arr.concat(integerList);
  1224. let stringList = data.stringList;
  1225. arr = arr.concat(stringList);
  1226. self.inputProp = arr;
  1227. for (let i = 0; i < thingsModel.functions.length; i++) {
  1228. for (let j = 0; j < arr.length; j++) {
  1229. let model = arr[j];
  1230. if(model.id == thingsModel.functions[i].id){
  1231. self.functions.push(model);
  1232. }
  1233. }
  1234. }
  1235. for (let i = 0; i < thingsModel.properties.length; i++) {
  1236. for (let j = 0; j < arr.length; j++) {
  1237. let model = arr[j];
  1238. if(model.id == thingsModel.properties[i].id){
  1239. self.properties.push(model);
  1240. }
  1241. }
  1242. }
  1243. let readOnlyList = data.readOnlyList;
  1244. self.watchProp = readOnlyList;
  1245. self.parseEnumList();
  1246. self.parseProp();
  1247. })
  1248. },
  1249. parseProp(){
  1250. let self = this;
  1251. for (let i = 0; i <self.inputProp.length; i++) {
  1252. let prop = self.inputProp[i];
  1253. let value = prop.shadow||0;
  1254. let id = prop.id;
  1255. if(id === "TimeSetting"){//温度设置
  1256. self.temperatureTime = value;
  1257. }
  1258. if(id === "TempSetting"){
  1259. self.temperature = value;
  1260. }
  1261. this.setPropValue(id,"PackingVolume","packageVolume",value,50)
  1262. this.setPropValue(id,"PackageQuantity","packageNumber",value,1)
  1263. this.setPropValue(id,"SealTemp","sealingTemperature",value)
  1264. this.setPropValue(id,"BandingTemp","edegTemperature",value)
  1265. this.setPropValue(id,"SetSealTemp","setSealingTemperature",value,160)
  1266. this.setPropValue(id,"SetBandingTemp","setEdegTemperature",value,160)
  1267. this.setPropValue(id,"LeftAppointmentTime","leftAppointmentTime",value,0)
  1268. self.propMap[id] = prop;
  1269. }
  1270. },
  1271. setPropValue(id,key,propKey,value,defaultValue){
  1272. if(!value && defaultValue){
  1273. value = defaultValue;
  1274. }
  1275. if(id === key){
  1276. this[propKey] = value;
  1277. }
  1278. },
  1279. parseSummay(summary){
  1280. let self = this;
  1281. if(!summary){
  1282. summary = "";
  1283. }
  1284. if(summary.length>0){
  1285. this.summary = JSON.parse(summary);
  1286. if(self.summary.length>0){
  1287. this.oneToMul = true;
  1288. for (let i = 0; i < self.summary.length; i++) {
  1289. self.summary[i].tabName = self.summary[i].id+"_"+self.summary[i].name
  1290. }
  1291. let childId = "";
  1292. if(this.oneToMul){
  1293. this.childId = self.summary[0].id;
  1294. }
  1295. }else{
  1296. this.summary = [{name:"详情查看"}]
  1297. }
  1298. }else{
  1299. this.summary = [{name:"详情查看"}]
  1300. }
  1301. },
  1302. goDeviceDetail(id){
  1303. uni.navigateTo({
  1304. url: '/pages/device/detail/detail?id='+id
  1305. });
  1306. },
  1307. async connectMqtt() {
  1308. if (this.$mqttTool.client == null) {
  1309. await this.$mqttTool.connect(this.vuex_token);
  1310. }
  1311. this.mqttCallback();
  1312. this.startCheck();
  1313. },
  1314. /** Mqtt订阅主题 */
  1315. mqttSubscribe(device) {
  1316. // 订阅当前设备状态和实时监测
  1317. let topicStatus = '/' + device.productId + '/' + device.serialNumber + '/status/post';
  1318. let topicProperty = '/' + device.productId + '/' + device.serialNumber + '/property/post';
  1319. let topicFunction = '/' + device.productId + '/' + device.serialNumber + '/function/post';
  1320. let topics = [];
  1321. topics.push(topicStatus);
  1322. topics.push(topicProperty);
  1323. topics.push(topicFunction);
  1324. this.$mqttTool.subscribe(topics);
  1325. },
  1326. /** Mqtt取消订阅主题 */
  1327. mqttUnSubscribe(device) {
  1328. // 订阅当前设备状态和实时监测
  1329. let topicStatus = '/' + device.productId + '/' + device.serialNumber + '/status/post';
  1330. let topicProperty = '/' + device.productId + '/' + device.serialNumber + '/property/post';
  1331. let topicFunction = '/' + device.productId + '/' + device.serialNumber + '/function/post';
  1332. let topics = [];
  1333. topics.push(topicStatus);
  1334. topics.push(topicProperty);
  1335. topics.push(topicFunction);
  1336. console.log('取消订阅', topics);
  1337. this.$mqttTool.unsubscribe(topics);
  1338. },
  1339. /* Mqtt回调处理 */
  1340. mqttCallback() {
  1341. this.$mqttTool.client.on('message', (topic, message, buffer) => {
  1342. let topics = topic.split('/');
  1343. let productId = topics[1];
  1344. let deviceNum = topics[2];
  1345. console.log('接收到内容:'+message);
  1346. message = JSON.parse(message.toString());
  1347. if (topics[3] == 'status') {
  1348. console.log('接收到【设备状态-运行】主题:', topic);
  1349. console.log('接收到【设备状态-运行】内容:', message);
  1350. // 更新列表中设备的状态
  1351. if (this.deviceInfo.serialNumber == deviceNum) {
  1352. this.deviceInfo.status = message.status;
  1353. this.deviceInfo.isShadow = message.isShadow;
  1354. this.deviceInfo.rssi = message.rssi;
  1355. this.updateDeviceStatus(this.deviceInfo);
  1356. }
  1357. }
  1358. if (topics[3] == 'property' || topics[3] == 'function') {
  1359. console.log('接收到【物模型】主题:', topic);
  1360. console.log('接收到【物模型】内容:', message);
  1361. if(this.oneToMul){
  1362. let curTabId = this.childId;
  1363. let msg = [];
  1364. for (let i = 0; i < message.length; i++) {
  1365. let curMsg = message[i];
  1366. let id = curMsg.id;
  1367. let ids = id.split("_");
  1368. let value = curMsg.value;
  1369. if(ids.length == 2){
  1370. if(curTabId == ids[1]){
  1371. msg.push({id:ids[0],value:value});
  1372. }
  1373. }else{
  1374. msg.push(curMsg);
  1375. }
  1376. }
  1377. message = msg;
  1378. }
  1379. // 更新列表中设备的属性
  1380. if (this.deviceInfo.serialNumber == deviceNum) {
  1381. for (let j = 0; j < message.length; j++) {
  1382. let isComplete = false;
  1383. let msgId = message[j].id;
  1384. this.exchangeData(msgId,message[j]);
  1385. // 布尔类型
  1386. for (let k = 0; k < this.deviceInfo.boolList.length && !isComplete; k++) {
  1387. if (this.deviceInfo.boolList[k].id == message[j].id) {
  1388. this.deviceInfo.boolList[k].shadow = message[j].value;
  1389. isComplete = true;
  1390. break;
  1391. }
  1392. }
  1393. // 枚举类型
  1394. for (let k = 0; k < this.deviceInfo.enumList.length && !isComplete; k++) {
  1395. if (this.deviceInfo.enumList[k].id == message[j].id) {
  1396. this.deviceInfo.enumList[k].shadow = message[j].value;
  1397. isComplete = true;
  1398. break;
  1399. }
  1400. }
  1401. // 字符串类型
  1402. for (let k = 0; k < this.deviceInfo.stringList.length && !isComplete; k++) {
  1403. if (this.deviceInfo.stringList[k].id == message[j].id) {
  1404. this.deviceInfo.stringList[k].shadow = message[j].value;
  1405. isComplete = true;
  1406. break;
  1407. }
  1408. }
  1409. // 数组类型
  1410. for (let k = 0; k < this.deviceInfo.arrayList.length && !isComplete; k++) {
  1411. if (this.deviceInfo.arrayList[k].id == message[j].id) {
  1412. this.deviceInfo.arrayList[k].shadow = message[j].value;
  1413. isComplete = true;
  1414. break;
  1415. }
  1416. }
  1417. // 整数类型
  1418. for (let k = 0; k < this.deviceInfo.integerList.length && !isComplete; k++) {
  1419. if (this.deviceInfo.integerList[k].id == message[j].id) {
  1420. this.deviceInfo.integerList[k].shadow = message[j].value;
  1421. isComplete = true;
  1422. break;
  1423. }
  1424. }
  1425. // 小数类型
  1426. for (let k = 0; k < this.deviceInfo.decimalList.length && !isComplete; k++) {
  1427. if (this.deviceInfo.decimalList[k].id == message[j].id) {
  1428. this.deviceInfo.decimalList[k].shadow = message[j].value;
  1429. isComplete = true;
  1430. break;
  1431. }
  1432. }
  1433. // 监测数据
  1434. for (let k = 0; k < this.deviceInfo.readOnlyList.length && !isComplete; k++) {
  1435. if (this.deviceInfo.readOnlyList[k].id == message[j].id) {
  1436. this.deviceInfo.readOnlyList[k].shadow = message[j].value;
  1437. // 更新图表
  1438. // for (let m = 0; m < this.monitorChart.length; m++) {
  1439. // if (message[j].id == this.monitorChart[m].data.id) {
  1440. // let data = [{
  1441. // value: message[j].value,
  1442. // name: this.monitorChart[m].data.name
  1443. // }];
  1444. // this.monitorChart[m].chart.setOption({
  1445. // series: [{
  1446. // data: data
  1447. // }]
  1448. // });
  1449. // break;
  1450. // }
  1451. // }
  1452. isComplete = true;
  1453. break;
  1454. }
  1455. }
  1456. }
  1457. this.parseEnumList();
  1458. }
  1459. this.$forceUpdate();
  1460. }
  1461. });
  1462. },
  1463. exchangeData(msgId,obj){
  1464. if(msgId === "TempSetting"){
  1465. this.temperature = obj.value;
  1466. }
  1467. if(msgId === "TimeSetting"){
  1468. this.temperatureTime = obj.value;
  1469. }
  1470. if(msgId === "CurrentTemp"){
  1471. this.currentTemperature = obj.value;
  1472. }
  1473. if(msgId === "HighTempTime"){
  1474. this.hightTemperature = obj.value;
  1475. }
  1476. if(msgId === "SealTemp"){
  1477. if(!this.editing){
  1478. this.sealingTemperature = obj.value;
  1479. }
  1480. }
  1481. if(msgId === "BandingTemp"){
  1482. if(!this.editing){
  1483. this.edegTemperature = obj.value;
  1484. }
  1485. }
  1486. if(msgId === "PackingVolume"){
  1487. if(!this.editing){
  1488. this.packageVolume = obj.value;
  1489. }
  1490. }
  1491. if(msgId === "PackageQuantity"){
  1492. if(!this.editing){
  1493. this.packageNumber = obj.value;
  1494. }
  1495. }
  1496. if(msgId === "LeftAppointmentTime"){
  1497. this.leftAppointmentTime = obj.value;
  1498. }
  1499. if(msgId === "SlowfireTiem"){
  1500. this.leftJianyaoTime = obj.value;
  1501. }
  1502. },
  1503. /** 发布物模型 类型(1=属性,2=功能) */
  1504. publishThingsModel(device, model) {
  1505. // 获取缓存的Json物模型
  1506. cacheJsonThingsModel(device.productId).then(response => {
  1507. let thingsModel = JSON.parse(response.data);
  1508. let type = 0;
  1509. for (let i = 0; i < thingsModel.functions.length; i++) {
  1510. if (model.id == thingsModel.functions[i].id) {
  1511. type = 2;
  1512. break;
  1513. }
  1514. }
  1515. if (type == 0) {
  1516. for (let i = 0; i < thingsModel.properties.length; i++) {
  1517. if (model.id == thingsModel.properties[i].id) {
  1518. type = 1;
  1519. break;
  1520. }
  1521. }
  1522. }
  1523. if (type != 0) {
  1524. this.mqttPublish(type, device, [model]);
  1525. }
  1526. });
  1527. },
  1528. notifyError(res){
  1529. uni.showToast({
  1530. title:res,
  1531. icon:"error"
  1532. })
  1533. },
  1534. notifySuccess(res){
  1535. uni.showToast({
  1536. title:res,
  1537. icon:"success"
  1538. })
  1539. },
  1540. /**
  1541. * Mqtt发布消息
  1542. * @type 类型(1=属性,2=功能,3=OTA升级,4=实时监测)
  1543. * @device 设备
  1544. * @model 物模型
  1545. * */
  1546. mqttPublish(type, device, modelList,needMore) {
  1547. if(this.deviceInfo.status != 3){
  1548. this.notifyError("请等待设备上线后操作")
  1549. return;
  1550. }
  1551. if(modelList.length == 0){
  1552. return;
  1553. }
  1554. let topic = "";
  1555. let message = ""
  1556. let oneToMul = false;
  1557. if(this.summary.length>1){
  1558. oneToMul = true;
  1559. }
  1560. if(!needMore){
  1561. oneToMul = false;
  1562. }
  1563. if(!this.decoctControlOnOffStatus){
  1564. let isKaijiKey = false;
  1565. if(modelList.length == 1){
  1566. let modelData = modelList[0];
  1567. let curKeyId = modelData.id;
  1568. if(this.firstTab){
  1569. if(oneToMul){
  1570. if(curKeyId.indexOf("PowerCtl") !=-1){
  1571. isKaijiKey = true;
  1572. }
  1573. }else{
  1574. if(curKeyId.indexOf("PowerControl") !=-1){
  1575. isKaijiKey = true;
  1576. }
  1577. }
  1578. }else{
  1579. if(curKeyId.indexOf("PowerControl") !=-1){
  1580. isKaijiKey = true;
  1581. }
  1582. }
  1583. }
  1584. if(!isKaijiKey){
  1585. this.notifyError("请先开机后再进行操作")
  1586. return;
  1587. }
  1588. }
  1589. if (type == 1) {
  1590. if (device.status == 3) {
  1591. // 属性,在线模式
  1592. topic = "/" + device.productId + "/" + device.serialNumber + "/property-online/get";
  1593. }
  1594. } else if (type == 2) {
  1595. if (device.status == 3) {
  1596. // 功能,在线模式
  1597. topic = "/" + device.productId + "/" + device.serialNumber + "/function-online/get";
  1598. }
  1599. } else if (type == 3) {
  1600. // OTA升级
  1601. topic = "/" + device.productId + "/" + device.serialNumber + "/ota/get";
  1602. } else {
  1603. return;
  1604. }
  1605. let title = "";
  1606. if(type == 1){
  1607. title = "属性";
  1608. }else if(type == 2){
  1609. title = "功能";
  1610. }
  1611. if (topic != "") {
  1612. // 发布
  1613. let arr = [];
  1614. for (let i = 0; i <modelList.length; i++) {
  1615. let model = modelList[i];
  1616. let modelId = model.id;
  1617. if(oneToMul){
  1618. let childId = this.childId;
  1619. if(childId){
  1620. modelId = modelId+"_"+childId;
  1621. }
  1622. }
  1623. let shadow = model.shadow+"";
  1624. let modelType = model.type;
  1625. let shadowInt = parseInt(shadow,10);
  1626. let isNumber = false;
  1627. let shadowStr = shadowInt+"";
  1628. if(shadowStr === shadow){
  1629. isNumber = true;
  1630. shadow = shadowInt;
  1631. }
  1632. if(modelType == "integer" && !isNumber){
  1633. this.$modal.showToast(model.name+'的值必须是数字类型')
  1634. return;
  1635. }
  1636. arr.push({id:modelId,value:shadow+""});
  1637. }
  1638. message = JSON.stringify(arr);
  1639. let self = this;
  1640. this.$mqttTool.publish(topic, message,title).then(res => {
  1641. this.notifySuccess(res);
  1642. }).catch(res => {
  1643. this.notifyError(res);
  1644. });
  1645. }
  1646. },
  1647. startCheck(){
  1648. let self = this;
  1649. this.checkTimer = setTimeout(function (){
  1650. self.sendHeart();
  1651. self.startCheck();
  1652. },20000);
  1653. },
  1654. checkActive(){
  1655. let self = this;
  1656. setTimeout(function (){
  1657. if(self.publishMsg){
  1658. self.resetConn()
  1659. }
  1660. },3000);
  1661. },
  1662. sendHeart(){
  1663. console.log("发送心跳111")
  1664. let device = this.deviceInfo;
  1665. let self = this;
  1666. let topic = "/property-offline/post";
  1667. self.publishMsg = true;
  1668. self.checkActive();
  1669. this.$mqttTool.publish(topic, "ok", "heart").then(res => {
  1670. self.publishMsg = false;
  1671. }).catch(res => {
  1672. self.publishMsg = false;
  1673. });
  1674. },
  1675. resetConn(){
  1676. console.log("检测异常,重连")
  1677. this.$mqttTool.end();
  1678. this.$mqttTool.client = null;
  1679. this.connectMqtt();
  1680. this.getDetail();
  1681. }
  1682. }
  1683. }
  1684. </script>
  1685. <style>
  1686. .send_btn{
  1687. width: 160rpx !important;
  1688. height: 40rpx !important;
  1689. font-size: 10px !important;
  1690. margin-top: 5px;
  1691. }
  1692. uni-col{
  1693. width: 150px;
  1694. }
  1695. .header{
  1696. width: 100%;
  1697. background: white;
  1698. padding:0px 20rpx;
  1699. position: relative;
  1700. }
  1701. .content {
  1702. display: flex;
  1703. align-items: center;
  1704. justify-content: center;
  1705. }
  1706. .logo {
  1707. height: 200rpx;
  1708. width: 200rpx;
  1709. margin-top: 200rpx;
  1710. margin-left: auto;
  1711. margin-right: auto;
  1712. margin-bottom: 50rpx;
  1713. }
  1714. .text-area {
  1715. margin:10px;
  1716. padding-bottom: 10px;
  1717. justify-content: center;
  1718. width: 100%;
  1719. }
  1720. .grid-text {
  1721. font-size: 14px;
  1722. color: #909399;
  1723. padding: 10rpx 0 20rpx 0rpx;
  1724. /* #ifndef APP-PLUS */
  1725. box-sizing: border-box;
  1726. /* #endif */
  1727. }
  1728. .title {
  1729. font-size: 36rpx;
  1730. color: #8f8f94;
  1731. }
  1732. .item{
  1733. height: 80rpx;
  1734. line-height: 80rpx;
  1735. }
  1736. .bg{
  1737. position: relative;
  1738. }
  1739. .text-left{
  1740. color: #8A92A5;
  1741. }
  1742. .text-right{
  1743. color: #545454;
  1744. }
  1745. .prop-text{
  1746. position: relative;
  1747. margin:20rpx 0;
  1748. font-size: 26rpx;
  1749. }
  1750. .prop-card-area{
  1751. }
  1752. .prop-card{
  1753. width: 28%;
  1754. height: 100rpx;
  1755. text-align: center;
  1756. display: inline-block;
  1757. background: #F5FCFF;
  1758. box-shadow: 0px 9rpx 8rpx 0px rgba(0,0,0,0.09);
  1759. border-radius: 8rpx;
  1760. margin:0px 15rpx;
  1761. line-height: 48rpx;
  1762. }
  1763. .prop-card-top{
  1764. color: #3E9CFC;
  1765. }
  1766. .prop-card-bottom{
  1767. color: #8A92A5;
  1768. }
  1769. .tab-area {
  1770. background: white;
  1771. position: absolute;
  1772. left: 0px;
  1773. right: 0px;
  1774. top:480rpx;
  1775. bottom:-20px;
  1776. min-height: 200rpx;
  1777. box-shadow: 0rpx 5rpx 27rpx 0rpx rgba(195, 195, 195, 0.4);
  1778. border-radius: 40rpx;
  1779. overflow-y: auto;
  1780. padding-bottom:80rpx;
  1781. }
  1782. .prop-item{
  1783. justify-content:center;
  1784. position: relative;
  1785. border-bottom: 1px solid lightgray;
  1786. height: 80rpx;
  1787. margin:0 20rpx;
  1788. }
  1789. .prop-item-left{
  1790. position: absolute;
  1791. left:10rpx;
  1792. top:22rpx;
  1793. color: #545454;
  1794. width: 50%;
  1795. font-size: 12px;
  1796. }
  1797. .prop-item-right{
  1798. position: absolute;
  1799. right:10rpx;
  1800. top:10rpx;
  1801. width: 50%;
  1802. }
  1803. input::-webkit-input-placeholder,textarea::-webkit-input-placeholder{
  1804. color:#666;
  1805. font-size:12px;
  1806. }
  1807. .clearfix::after {
  1808. content: "";
  1809. display: block;
  1810. clear: both;
  1811. }
  1812. .decoctControlHeader {
  1813. display: flex;
  1814. align-items: center;
  1815. font-weight: 600;
  1816. }
  1817. .decoctControlTop {
  1818. display: flex;
  1819. height: 240rpx;
  1820. border-bottom:1px #B2B2B2 dotted;
  1821. margin:0 40rpx;
  1822. }
  1823. .decoctControlTopLeft {
  1824. width:40%;
  1825. line-height: 2;
  1826. text-align: center;
  1827. margin: 0 15px;
  1828. position: relative;
  1829. }
  1830. .addTemperature {
  1831. border-radius:5px;
  1832. position:absolute;
  1833. background-color: dodgerblue;
  1834. color:white;
  1835. width: 30px;
  1836. height: 30px;
  1837. left:15px;
  1838. top:80px;
  1839. }
  1840. .addTemperatureBtn {
  1841. border-radius:10px;
  1842. position:absolute;
  1843. clip-path: polygon(50% 0,100% 100%,0 100%);
  1844. transform: scale(0.5);
  1845. left: 0;
  1846. top:0;
  1847. bottom: 0;
  1848. right: 0;
  1849. margin: auto;
  1850. }
  1851. .subTemperature {
  1852. border-radius:5px;
  1853. position:absolute;
  1854. background-color: dodgerblue;
  1855. color:white;
  1856. width: 30px;
  1857. height: 30px;
  1858. right:15px;
  1859. top:80px;
  1860. }
  1861. .subTemperatureBtn {
  1862. border-radius:10px;
  1863. position:absolute;
  1864. clip-path: polygon(50% 0,100% 100%,0 100%);
  1865. transform: scale(0.5);
  1866. left: 0;
  1867. top:0;
  1868. bottom: 0;
  1869. right: 0;
  1870. margin: auto;
  1871. }
  1872. .decoctControlTopRight {
  1873. width:40%;
  1874. line-height: 2;
  1875. text-align: center;
  1876. margin: 0 15px;
  1877. position: relative;
  1878. }
  1879. .decoctControlBottom {
  1880. border-bottom:1px #B2B2B2 dotted;
  1881. width:91vw;
  1882. margin:0 auto;
  1883. padding:10px;
  1884. display: flex;
  1885. justify-content:space-between;
  1886. align-items: center;
  1887. }
  1888. .addTime {
  1889. border-radius:5px;
  1890. position:absolute;
  1891. background-color: dodgerblue;
  1892. color:white;
  1893. width: 30px;
  1894. height: 30px;
  1895. left:15px;
  1896. top:80px;
  1897. }
  1898. .addTimeBtn {
  1899. border-radius:10px;
  1900. position:absolute;
  1901. clip-path: polygon(50% 0,100% 100%,0 100%);
  1902. transform: scale(0.5);
  1903. left: 0;
  1904. top:0;
  1905. bottom: 0;
  1906. right: 0;
  1907. margin: auto;
  1908. }
  1909. .subTime {
  1910. border-radius:5px;
  1911. position:absolute;
  1912. background-color: dodgerblue;
  1913. color:white;
  1914. width: 30px;
  1915. height: 30px;
  1916. right:15px;
  1917. top:80px;
  1918. }
  1919. .subTimeBtn {
  1920. border-radius:10px;
  1921. position:absolute;
  1922. clip-path: polygon(50% 0,100% 100%,0 100%);
  1923. transform: scale(0.5);
  1924. left: 0;
  1925. top:0;
  1926. bottom: 0;
  1927. right: 0;
  1928. margin: auto;
  1929. }
  1930. .packageControlBottomRight {
  1931. border-radius:5px;
  1932. padding:5px 10px;
  1933. margin-right: 15px;
  1934. background-color: #3c9cff;
  1935. color: #fff;
  1936. }
  1937. .packageControlBottomClear {
  1938. border-radius:5px;
  1939. padding:5px 10px;
  1940. background-color: #B2B2B2;
  1941. color: #fff;
  1942. }
  1943. .active_btn{
  1944. background-color: #3c9cff;
  1945. }
  1946. .baozhuang-sub{
  1947. right: 10rpx !important;
  1948. }
  1949. .baozhuang-add{
  1950. left: 6rpx !important;
  1951. }
  1952. .control-input-box{
  1953. display: flex;
  1954. flex-direction: row;
  1955. padding-left: 26rpx;
  1956. }
  1957. .control-input-box-danwei{
  1958. padding-top:12rpx;
  1959. margin-left:4rpx;
  1960. }
  1961. </style>