detail.vue 102 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328
  1. <template>
  2. <view class="content" >
  3. <view class="header" :style='"background-image:url("+imgUrl+"/detail/bg.png);background-repeat: no-repeat;background-size: 100% 200%;"'>
  4. <view class="status_info">
  5. <view class="status_detail">
  6. <view class="status_text">{{ getStatusText() }}</view>
  7. <view v-if="deviceInfo.status == 3" class="online_text online">·在线</view>
  8. <view v-if="deviceInfo.status == 4" class="online_text">·离线</view>
  9. </view>
  10. <view class="device_info">机器编号: {{deviceInfo.serialNumber}}</view>
  11. </view>
  12. <view style="position: absolute;right:10vw;top:12vh;z-index: 9" @click="showDrawer">
  13. <image :src="imgUrl+'/detail/setting2.png'" style="width: 50rpx;height: 50rpx;"/>
  14. </view>
  15. <view style="position: relative;top:15vh;width: 100%;text-align: center">
  16. <image :src="productImage" :style="productSize"/>
  17. </view>
  18. <view class="tabs">
  19. <view class="child_tab" :class="firstMachine?'':'disabled_tab'" @click="changeTab(1,firstMachine)">
  20. <image :src="imgUrl+'/detail/tab.png'" style="width: 100%;height:100%;position: absolute;top:0px;"/>
  21. <image class="child_img" v-if="tabActive[0]" :src="imgUrl+'/detail/jianyao_on.png'" />
  22. <image class="child_img" v-if="!tabActive[0]" :src="imgUrl+'/detail/jianyao_off.png'" />
  23. <view class="child_title" :class="tabActive[0]?'active_on':''">
  24. 煎药机一
  25. </view>
  26. </view>
  27. <view class="child_tab" :class="secondMachine?'':'disabled_tab'" @click="changeTab(2,secondMachine)">
  28. <image :src="imgUrl+'/detail/tab.png'" style="width: 100%;height:100%;position: absolute;top:0px;"/>
  29. <image class="child_img" v-if="tabActive[1]" :src="imgUrl+'/detail/jianyao_on.png'" />
  30. <image class="child_img" v-if="!tabActive[1]" :src="imgUrl+'/detail/jianyao_off.png'" />
  31. <view class="child_title" :class="isPage(2)?'active_on':''">
  32. 煎药机二
  33. </view>
  34. </view>
  35. <view class="child_tab" :class="thirdMachine?'':'disabled_tab'" @click="changeTab(3,thirdMachine)">
  36. <image :src="imgUrl+'/detail/tab.png'" style="width: 100%;height:100%;position: absolute;top:0px;"/>
  37. <image class="child_img" v-if="tabActive[2]" :src="imgUrl+'/detail/jianyao_on.png'" />
  38. <image class="child_img" v-if="!tabActive[2]" :src="imgUrl+'/detail/jianyao_off.png'" />
  39. <view class="child_title" :class="tabActive[2]?'active_on':''">
  40. 煎药机三
  41. </view>
  42. </view>
  43. <view class="child_tab" :class="forthMachine?'':'disabled_tab'" @click="changeTab(4,forthMachine)">
  44. <image :src="imgUrl+'/detail/tab.png'" style="width: 100%;height:100%;position: absolute;top:0px;"/>
  45. <image class="child_img" v-if="firstTab" :src="imgUrl+'/detail/baozhuang_off.png'" />
  46. <image class="child_img" v-if="!firstTab" :src="imgUrl+'/detail/baozhuang_on.png'" />
  47. <view class="child_title" :class="firstTab?'':'active_on'">
  48. 包装机
  49. </view>
  50. </view>
  51. </view>
  52. <view class="control_area" v-if="firstTab">
  53. <view class="control">
  54. <view class="control_item">
  55. <image :src="imgUrl+'/detail/bg_mid.png'" style="width: 100%;height:100%;position: absolute;top:0px;"/>
  56. <view class="control_item_detail">
  57. <view class="control_item_left" @click="subTemperature(1)">-</view>
  58. <view class="control_item_center">
  59. <view style="position: absolute">
  60. <u-input customStyle="width:150rpx;border:0px;" disabledColor="white" @change="propChange(1)" @focus="propFocus(1)" @confirm="propBlur(1)" @blur="propBlur(1)" v-model="temperature"></u-input>
  61. </view>
  62. </view>
  63. <view class="control_item_center_unit" :style="unitFixedStyle">℃</view>
  64. <view class="control_item_right" @click="addTemperature(1)">+</view>
  65. </view>
  66. <view class="control_item_title">
  67. 设置温度
  68. </view>
  69. </view>
  70. <view class="control_item" v-if="wenhuoTimeDlgShow">
  71. <image :src="imgUrl+'/detail/bg_mid.png'" style="width: 100%;height:100%;position: absolute;top:0px;"/>
  72. <view class="control_item_detail">
  73. <view class="control_item_left" @click="subTemperatureTime(1)">-</view>
  74. <view class="control_item_center">
  75. <view style="position: absolute;z-index: 999">
  76. <u-input customStyle="width:150rpx;border:0px;z-index: 999" disabledColor="white" v-model="temperatureTime"></u-input>
  77. </view>
  78. </view>
  79. <view class="control_item_center_unit" :style="unitFixedStyle">分钟</view>
  80. <view class="control_item_right" style="left: 74%;" @click="addTemperatureTime(1)">+</view>
  81. </view>
  82. <view class="control_item_title">
  83. 时间设置
  84. </view>
  85. </view>
  86. <view class="control_item" v-if="!wenhuoTimeDlgShow">
  87. <image :src="imgUrl+'/detail/bg_mid.png'" style="width: 100%;height:100%;position: absolute;top:0px;"/>
  88. <view class="control_item_detail">
  89. <view class="control_item_left" @click="subTemperatureTime(1)">-</view>
  90. <view class="control_item_center">
  91. <view style="position: absolute">
  92. <u-input customStyle="width:150rpx;border:0px;" disabledColor="white" @change="propChange(1)" @focus="propFocus(2)" @confirm="propBlur(2)" @blur="propBlur(2)" v-model="leftJianyaoTime"></u-input>
  93. </view>
  94. </view>
  95. <view class="control_item_center_unit" :style="unitFixedStyle">分钟</view>
  96. <view class="control_item_right" style="left: 74%;" @click="addTemperatureTime(1)">+</view>
  97. </view>
  98. <view class="control_item_title">
  99. 时间设置
  100. </view>
  101. </view>
  102. <view class="control_item">
  103. <image :src="imgUrl+'/detail/bg_mid.png'" style="width: 100%;height:100%;position: absolute;top:0px;"/>
  104. <view class="control_item_detail">
  105. <view class="control_item_center">
  106. <u-input disabled customStyle="width:150rpx;border:0px;" disabledColor="white" :value="currentTemperature"></u-input>
  107. </view>
  108. <view class="control_item_center_unit" :style="unitFixedStyle">℃</view>
  109. </view>
  110. <view class="control_item_title">
  111. 当前温度
  112. </view>
  113. </view>
  114. <view class="control_item" v-if="boardType == 4">
  115. <image :src="imgUrl+'/detail/bg_mid.png'" style="width: 100%;height:100%;position: absolute;top:0px;"/>
  116. <view class="control_item_detail">
  117. <view class="control_item_center">
  118. <u-input disabled customStyle="width:150rpx;border:0px;" disabledColor="white" :value="hightTemperature"></u-input>
  119. </view>
  120. <view class="control_item_center_unit" :style="unitFixedStyle">分钟</view>
  121. </view>
  122. <view class="control_item_title">
  123. 高温时间
  124. </view>
  125. </view>
  126. <view class="control_item" v-if="boardType == 5">
  127. <image :src="imgUrl+'/detail/bg_mid.png'" style="width: 100%;height:100%;position: absolute;top:0px;"/>
  128. <view class="control_item_detail" style="">
  129. <view style="width: 50px;height: 150rpx;display: inline-block" >
  130. <image @click="setPressTurn" :src="imgUrl+'/detail/left_on.png'" v-if="pressTurn == 1" style="top:20rpx;
  131. left: 40rpx;width: 20px;height:15px;position: absolute;"/>
  132. <image @click="setPressTurn" :src="imgUrl+'/detail/left.png'" v-if="pressTurn == 0" style="top:20rpx;
  133. left: 40rpx;width: 20px;height:15px;position: absolute;"/>
  134. <view style="position: absolute;top:68rpx;left:40rpx;font-size: 12px;" :class="pressTurn == 1?'active_on':''">挤压</view>
  135. </view>
  136. <view style="display: inline-block; position: absolute;top:30rpx;width: 150rpx" v-if="pressTurn == 1" class="roate"> <u-line-progress :percentage="turnPercent" activeColor="#50ACFF" height="6" :showText="false"></u-line-progress>
  137. </view>
  138. <view style="display: inline-block; position: absolute;top:30rpx;width: 150rpx" v-if="resetTurn == 1"> <u-line-progress :percentage="turnPercent" activeColor="#50ACFF" height="6" :showText="false"></u-line-progress>
  139. </view>
  140. <view style="display: inline-block; position: absolute;top:30rpx;width: 150rpx" v-if="resetTurn == 0 && pressTurn == 0"> <u-line-progress :percentage="turnPercent" activeColor="#50ACFF" height="6" :showText="false"></u-line-progress>
  141. </view>
  142. <view style="width: 50px;height: 150rpx;display: inline-block">
  143. <image @click="setResetTurn" :src="imgUrl+'/detail/right_on.png'" v-if="resetTurn == 1" style="top:20rpx;
  144. right: 40rpx;width: 20px;height:15px;position: absolute;;display: inline-block;"/>
  145. <image @click="setResetTurn" :src="imgUrl+'/detail/right.png'" v-if="resetTurn == 0" style="top:20rpx;
  146. right: 40rpx;width: 20px;height:15px;position: absolute;;display: inline-block;"/>
  147. <view style="position: absolute;top:68rpx;right:40rpx;font-size: 12px;" :class="resetTurn == 1?'active_on':''">复位</view>
  148. </view>
  149. </view>
  150. <view class="control_item_title">
  151. 电动挤压
  152. </view>
  153. </view>
  154. </view>
  155. <view class="bottom">
  156. <image :src="imgUrl+'/detail/bg_large.png'" style="width: 100%;height:100%;position: absolute;top:0px;"/>
  157. <view class="bottom_item" @click="decoctControlOnOffChange">
  158. <image v-if="decoctControlOnOffStatus" :src="imgUrl+'/detail/open_on.png'" style="width: 32%;height:32%;"/>
  159. <image v-if="!decoctControlOnOffStatus" :src="imgUrl+'/detail/open_off.png'" style="width: 32%;height:32%;"/>
  160. <view :class="decoctControlOnOffStatus?'active_on':''">开关</view>
  161. </view>
  162. <view class="bottom_item" @click="decoctControlChange">
  163. <image v-if="decoctControlStatus" :src="imgUrl+'/detail/jianing_on.png'" style="width: 32%;height:32%;"/>
  164. <image v-if="!decoctControlStatus" :src="imgUrl+'/detail/jianing_off.png'" style="width: 32%;height:32%;"/>
  165. <view :class="decoctControlStatus?'active_on':''">煎药</view>
  166. </view>
  167. <view class="bottom_item" @click="stopDecoctControlChange">
  168. <image v-if="!decoctControlStatus" :src="imgUrl+'/detail/stop_on.png'" style="width: 32%;height:32%;"/>
  169. <image v-if="decoctControlStatus" :src="imgUrl+'/detail/stop_off.png'" style="width: 32%;height:32%;"/>
  170. <view :class="!decoctControlStatus?'active_on':''">停止</view>
  171. </view>
  172. <view class="bottom_item" @click="toPlan">
  173. <image v-if="leftAppointmentTime>0" :src="imgUrl+'/detail/plan_on.png'" style="width: 32%;height:32%;"/>
  174. <image v-else :src="imgUrl+'/detail/plan_off.png'" style="width: 32%;height:32%;"/>
  175. <view :class="leftAppointmentTime>0?'active_on':''">预约</view>
  176. </view>
  177. </view>
  178. </view>
  179. <view class="control_area" v-if="!firstTab">
  180. <view class="control">
  181. <view class="control_item" v-if="fengbianDlgShow">
  182. <image :src="imgUrl+'/detail/bg_mid.png'" style="width: 100%;height:100%;position: absolute;top:0px;"/>
  183. <view class="control_item_detail">
  184. <view class="control_item_left" @click="subEdegTemperature(1)">-</view>
  185. <view class="control_item_center">
  186. <u-input customStyle="width:150rpx;border:0px;background:none;" disabledColor="white" placeholder="0" @confirm="propBlur(3)" v-model="setEdegTemperature"></u-input>
  187. </view>
  188. <view class="control_item_center_unit" :style="unitFixedStyle">℃</view>
  189. <view class="control_item_right" @click="addEdegTemperature(1)">+</view>
  190. </view>
  191. <view class="control_item_title">
  192. 设置温度
  193. </view>
  194. </view>
  195. <view class="control_item" v-if="!fengbianDlgShow">
  196. <image :src="imgUrl+'/detail/bg_mid.png'" style="width: 100%;height:100%;position: absolute;top:0px;"/>
  197. <view class="control_item_detail">
  198. <view class="control_item_left" @click="subEdegTemperature(1)">-</view>
  199. <view class="control_item_center">
  200. <u-input customStyle="width:150rpx;border:0px;background:none;" disabledColor="white" placeholder="0" @focus="propFocus(3)" @blur="propBlur(3)" v-model="edegTemperature"></u-input>
  201. </view>
  202. <view class="control_item_center_unit" :style="unitFixedStyle">℃</view>
  203. <view class="control_item_right" @click="addEdegTemperature(1)">+</view>
  204. </view>
  205. <view class="control_item_title">
  206. <view v-if="!baozhuangFengbianSetting">
  207. 封边温度
  208. </view>
  209. <view v-if="baozhuangFengbianSetting">
  210. 设置温度
  211. </view>
  212. </view>
  213. </view>
  214. <view class="control_item" v-if="fengkouDlgShow">
  215. <image :src="imgUrl+'/detail/bg_mid.png'" style="width: 100%;height:100%;position: absolute;top:0px;"/>
  216. <view class="control_item_detail">
  217. <view class="control_item_left" @click="subSealingTemperature(1)">-</view>
  218. <view class="control_item_center">
  219. <u-input customStyle="width:150rpx;border:0px;background:none;" disabledColor="white" placeholder="0" @blur="propBlur(4)" @confirm="propBlur(4)" v-model="setSealingTemperature"></u-input>
  220. </view>
  221. <view class="control_item_center_unit" :style="unitFixedStyle">℃</view>
  222. <view class="control_item_right" @click="addSealingTemperature(1)">+</view>
  223. </view>
  224. <view class="control_item_title">
  225. 设置温度
  226. </view>
  227. </view>
  228. <view class="control_item" v-if="!fengkouDlgShow">
  229. <image :src="imgUrl+'/detail/bg_mid.png'" style="width: 100%;height:100%;position: absolute;top:0px;"/>
  230. <view class="control_item_detail">
  231. <view class="control_item_left" @click="subSealingTemperature(1)">-</view>
  232. <view class="control_item_center">
  233. <u-input customStyle="width:150rpx;border:0px;background:none;" disabledColor="white" placeholder="0" @change="propChange(1)" @focus="propFocus(4)" @blur="propBlur(4)" v-model="sealingTemperature"></u-input>
  234. </view>
  235. <view class="control_item_center_unit" :style="unitFixedStyle">℃</view>
  236. <view class="control_item_right" @click="addSealingTemperature(1)">+</view>
  237. </view>
  238. <view class="control_item_title">
  239. <view v-if="!baozhuangFengkouSetting">
  240. 封口温度
  241. </view>
  242. <view v-if="baozhuangFengkouSetting">
  243. 设置温度
  244. </view>
  245. </view>
  246. </view>
  247. <view class="control_item">
  248. <image :src="imgUrl+'/detail/bg_mid.png'" style="width: 100%;height:100%;position: absolute;top:0px;"/>
  249. <view class="control_item_detail">
  250. <view class="control_item_left" @click="subPackageVolume()">-</view>
  251. <view class="control_item_center">
  252. <view style="position: absolute">
  253. <u-input customStyle="width:150rpx;border:0px;" disabledColor="white" @focus="propFocus(5)" @confirm="propBlur(5)" @blur="propBlur(5)" v-model="packageVolume"></u-input>
  254. </view>
  255. </view>
  256. <view class="control_item_center_unit" :style="unitFixedStyle">ml</view>
  257. <view class="control_item_right" @click="addPackageVolume()">+</view>
  258. </view>
  259. <view class="control_item_title">
  260. 包装容量
  261. </view>
  262. </view>
  263. <view class="control_item">
  264. <image :src="imgUrl+'/detail/bg_mid.png'" style="width: 100%;height:100%;position: absolute;top:0px;"/>
  265. <view class="control_item_detail">
  266. <view class="control_item_left" @click="subPackageNumber()">-</view>
  267. <view class="control_item_center">
  268. <view style="position: absolute">
  269. <u-input customStyle="width:150rpx;border:0px;" disabledColor="white" @focus="propFocus(6)" @confirm="propBlur(6)" @blur="propBlur(6)" v-model="packageNumber"></u-input>
  270. </view>
  271. </view>
  272. <view class="control_item_center_unit" :style="unitFixedStyle">袋</view>
  273. <view class="control_item_right" @click="addPackageNumber()">+</view>
  274. </view>
  275. <view class="control_item_title">
  276. 包装数量
  277. </view>
  278. </view>
  279. </view>
  280. <view class="bottom">
  281. <image :src="imgUrl+'/detail/bg_large.png'" style="width: 100%;height:100%;position: absolute;top:0px;"/>
  282. <view class="bottom_item" @click="packageControlOnOffChange">
  283. <image v-if="packageControlOnOffStatus" :src="imgUrl+'/detail/open_on.png'" style="width: 32%;height:32%;"/>
  284. <image v-if="!packageControlOnOffStatus" :src="imgUrl+'/detail/open_off.png'" style="width: 32%;height:32%;"/>
  285. <view :class="packageControlOnOffStatus?'active_on':''">开关</view>
  286. </view>
  287. <view class="bottom_item" @click="turnChange(1)">
  288. <image v-if="qitingTurn" :src="imgUrl+'/detail/open_on.png'" style="width: 32%;height:32%;"/>
  289. <image v-if="!qitingTurn" :src="imgUrl+'/detail/open_off.png'" style="width: 32%;height:32%;"/>
  290. <view :class="qitingTurn?'active_on':''">启停</view>
  291. </view>
  292. <view class="bottom_item" @click="turnChange(2)">
  293. <image v-if="baozhuangTurn" :src="imgUrl+'/detail/bao_on.png'" style="width: 32%;height:32%;"/>
  294. <image v-if="!baozhuangTurn" :src="imgUrl+'/detail/bao_off.png'" style="width: 32%;height:32%;"/>
  295. <view :class="baozhuangTurn?'active_on':''">包装</view>
  296. </view>
  297. <view class="bottom_item" @click="turnChange(3)">
  298. <image v-if="qingxiTurn" :src="imgUrl+'/detail/xi_on.png'" style="width: 32%;height:32%;"/>
  299. <image v-if="!qingxiTurn" :src="imgUrl+'/detail/xi_off.png'" style="width: 32%;height:32%;"/>
  300. <view :class="qingxiTurn?'active_on':''">清洗</view>
  301. </view>
  302. </view>
  303. </view>
  304. </view>
  305. <u-popup :show="false" @close="closePop" mode="center" bgColor="transparent" :closeable="true">
  306. <view style="position: relative;width: 500rpx;height:300rpx;background: none">
  307. <view class="control_item" style="width: 100%" v-if="fengbianDlgShow">
  308. <image :src="imgUrl+'/detail/bg_mid.png'" style="width: 100%;height:100%;position: absolute;top:0px;"/>
  309. <view class="control_item_detail">
  310. <view class="control_item_left" @click="subEdegTemperature(1)">-</view>
  311. <view class="control_item_center">
  312. <u-input customStyle="width:150rpx;border:0px;" disabledColor="white" @change="changeEdegTemperature" v-model="setEdegTemperature"></u-input>
  313. </view>
  314. <view class="control_item_center_unit" :style="unitFixedStyle1">℃</view>
  315. <view class="control_item_right" @click="addEdegTemperature(1)">+</view>
  316. </view>
  317. <view class="control_item_title">
  318. 封边温度设置
  319. </view>
  320. </view>
  321. <view class="control_item" style="width: 100%" v-if="fengkouDlgShow">
  322. <image :src="imgUrl+'/detail/bg_mid.png'" style="width: 100%;height:100%;position: absolute;top:0px;"/>
  323. <view class="control_item_detail">
  324. <view class="control_item_left" @click="subSealingTemperature(1)">-</view>
  325. <view class="control_item_center">
  326. <u-input customStyle="width:150rpx;border:0px;" disabledColor="white" @change="changeSealingTemperature" v-model="setSealingTemperature"></u-input>
  327. </view>
  328. <view class="control_item_center_unit" :style="unitFixedStyle1">℃</view>
  329. <view class="control_item_right" @click="addSealingTemperature(1)">+</view>
  330. </view>
  331. <view class="control_item_title">
  332. 封口温度设置
  333. </view>
  334. </view>
  335. <view class="control_item" style="width: 100%" v-if="wenhuoTimeDlgShow">
  336. <image :src="imgUrl+'/detail/bg_mid.png'" style="width: 100%;height:100%;position: absolute;top:0px;"/>
  337. <view class="control_item_detail">
  338. <view class="control_item_left" @click="subTemperatureTime()">-</view>
  339. <view class="control_item_center">
  340. <u-input customStyle="width:150rpx;border:0px;" disabledColor="white" @change="changeTemperatureTime()" v-model="temperatureTime"></u-input>
  341. </view>
  342. <view class="control_item_center_unit" :style="unitFixedStyle1">℃</view>
  343. <view class="control_item_right" @click="addTemperatureTime()">+</view>
  344. </view>
  345. <view class="control_item_title">
  346. 文火时间
  347. </view>
  348. </view>
  349. </view>
  350. </u-popup>
  351. <u-popup :show="planPopDlg" @close="closePlanPop" mode="center" :closeable="true">
  352. <view style="position: relative;width: 400rpx;background: none;padding:40rpx;">
  353. <view class="control_item" style="width: 100%">
  354. <image :src="imgUrl+'/detail/bg_mid.png'" style="width: 100%;height:100%;position: absolute;top:0px;"/>
  355. <view class="control_item_detail">
  356. <view class="control_item_left" @click="subPlanTime(1)" style="left: 18%;">-</view>
  357. <view class="control_item_center">
  358. <view style="position: absolute">
  359. <u-input customStyle="width:150rpx;border:0px;" disabledColor="white" v-model="planTime"></u-input>
  360. </view>
  361. </view>
  362. <view class="control_item_center_unit" :style="unitFixedStyle">分钟</view>
  363. <view class="control_item_right" style="left: 80%;" @click="addPlanTime(1)">+</view>
  364. </view>
  365. <view class="control_item_title">
  366. 预约时间
  367. </view>
  368. </view>
  369. <view class="control_item" style="width: 100%">
  370. <image :src="imgUrl+'/detail/bg_mid.png'" style="width: 100%;height:100%;position: absolute;top:0px;"/>
  371. <view class="control_item_detail">
  372. <view class="control_item_left" @click="subTemperatureTime()" style="left: 18%;">-</view>
  373. <view class="control_item_center">
  374. <view style="position: absolute">
  375. <u-input customStyle="width:150rpx;border:0px;" disabledColor="white" @change="changeTemperatureTime()" v-model="temperatureTime"></u-input>
  376. </view>
  377. </view>
  378. <view class="control_item_center_unit" :style="unitFixedStyle">分钟</view>
  379. <view class="control_item_right" @click="addTemperatureTime()" style="left: 80%;">+</view>
  380. </view>
  381. <view class="control_item_title">
  382. 时间设置
  383. </view>
  384. </view>
  385. <view>
  386. <button style="background: white;" @click="plan">确认</button>
  387. </view>
  388. </view>
  389. </u-popup>
  390. <!-- 预约框-->
  391. <u-popup :show="yuyueIngPop" @close="closeYuyueIngPop" mode="center" :closeable="true">
  392. <view style="position: relative;width: 400rpx;background: none;padding:40rpx;">
  393. <view class="control_item" style="width: 100%">
  394. <image :src="imgUrl+'/detail/bg_mid.png'" style="width: 100%;height:100%;position: absolute;top:0px;"/>
  395. <view class="control_item_detail">
  396. <view class="control_item_center">
  397. <u-input customStyle="width:150rpx;border:0px;padding:0px" disabledColor="white" :value="leftAppointmentTime"></u-input>
  398. </view>
  399. <view class="control_item_center_unit" :style="unitFixedStyle">℃</view>
  400. </view>
  401. <view class="control_item_title">
  402. 剩余时间
  403. </view>
  404. </view>
  405. <view>
  406. <button style="background: white;" @click="cancelPlan">取消</button>
  407. </view>
  408. </view>
  409. </u-popup>
  410. <u-popup :show="planIngPopDlg" @close="closePlanIngPop" mode="center" :closeable="true">
  411. <view style="position: relative;width: 400rpx;background: none;padding:40rpx;">
  412. <view class="control_item" style="width: 100%">
  413. <image :src="imgUrl+'/detail/bg_mid.png'" style="width: 100%;height:100%;position: absolute;top:0px;"/>
  414. <view class="control_item_detail" style="width: 100%; padding: 40rpx;margin-bottom:10rpx;">
  415. <u-line-progress :percentage="step" activeColor="#50ACFF"></u-line-progress>
  416. </view>
  417. <view class="control_item_title" v-if="leftAppointmentTime>0">
  418. 预约煎药中,倒计时{{leftAppointmentTime}}分钟
  419. </view>
  420. <view class="control_item_title" v-else>
  421. <view v-if="leftJianyaoTime>0">
  422. 正在熬制,请稍等
  423. </view>
  424. <view v-else>
  425. 煎药完成
  426. </view>
  427. </view>
  428. </view>
  429. <view class="control_item" style="width: 100%">
  430. <image :src="imgUrl+'/detail/bg_mid.png'" style="width: 100%;height:100%;position: absolute;top:0px;"/>
  431. <view class="control_item_detail">
  432. <view class="control_item_center">
  433. <u-input customStyle="width:150rpx;border:0px;" disabledColor="white" :value="currentTemperature"></u-input>
  434. </view>
  435. <view class="control_item_center_unit" :style="unitFixedStyle">℃</view>
  436. </view>
  437. <view class="control_item_title">
  438. 当前温度
  439. </view>
  440. </view>
  441. <view class="control_item" style="width: 100%">
  442. <image :src="imgUrl+'/detail/bg_mid.png'" style="width: 100%;height:100%;position: absolute;top:0px;"/>
  443. <view class="control_item_detail">
  444. <view class="control_item_center">
  445. <u-input customStyle="width:150rpx;border:0px;" disabledColor="white" :value="leftJianyaoTime"></u-input>
  446. </view>
  447. <view class="control_item_center_unit" :style="unitFixedStyle">分钟</view>
  448. </view>
  449. <view class="control_item_title">
  450. 文火倒计时
  451. </view>
  452. </view>
  453. <!-- <view>-->
  454. <!-- <button style="background: white;" @click="cancelPlan">暂停</button>-->
  455. <!-- </view>-->
  456. </view>
  457. </u-popup>
  458. <uni-drawer ref="showLeft" :width="320" :maskClick="true" mode="right" @change="change($event,'showLeft')">
  459. <scroll-view style="height: 88%;padding:20% 0%;" scroll-y="true">
  460. <view style="text-align:center">设置</view>
  461. <view>
  462. <view class="prop-item">
  463. <view class="prop-item-image">
  464. <image :src="imgUrl+'/setting/net.png'" style="width: 100%;height:100%;"/>
  465. </view>
  466. <view class="prop-item-left">网络连接</view>
  467. <view class="prop-item-right">
  468. <view v-if="deviceInfo.status == 3">
  469. 已连接
  470. </view>
  471. <view v-else>
  472. 未连接
  473. <!-- <uni-icons type="forward" size="16"></uni-icons>-->
  474. </view>
  475. </view>
  476. </view>
  477. <view class="prop-item" v-if="firstTab">
  478. <view class="prop-item-image">
  479. <image :src="imgUrl+'/setting/oper_temp.png'" style="width: 100%;height:100%;"/>
  480. </view>
  481. <view class="prop-item-left">温度校准</view>
  482. <view class="prop-item-right" @click="showJiaozhunProp">
  483. {{jiaozhunTemp}}℃<uni-icons type="forward" size="16"></uni-icons>
  484. </view>
  485. </view>
  486. <view class="prop-item" v-if="firstTab && boardType == 5">
  487. <view class="prop-item-image">
  488. <image :src="imgUrl+'/setting/current_icon6.png'" style="width: 100%;height:100%;"/>
  489. </view>
  490. <view class="prop-item-left">有效电流值</view>
  491. <view class="prop-item-right" >
  492. {{validCurrent}}MA
  493. </view>
  494. </view>
  495. <view class="prop-item" v-if="firstTab && boardType == 5">
  496. <view class="prop-item-image">
  497. <image :src="imgUrl+'/setting/current_icon5.png'" style="width: 100%;height:100%;"/>
  498. </view>
  499. <view class="prop-item-left">扭力</view>
  500. <view class="prop-item-right" @click="showLiuProp">
  501. {{turnCurrent}}MA<uni-icons type="forward" size="16"></uni-icons>
  502. </view>
  503. </view>
  504. <view class="prop-item" v-if="firstTab">
  505. <view class="prop-item-image">
  506. <image :src="imgUrl+'/setting/list.png'" style="width: 100%;height:100%;"/>
  507. </view>
  508. <view class="prop-item-left">工作模式</view>
  509. <view class="prop-item-right" @click="showWorkPicker">
  510. <view v-if="workMode == 1">
  511. 1<uni-icons type="forward" size="16"></uni-icons>
  512. </view>
  513. <view v-if="workMode == 2">
  514. 2<uni-icons type="forward" size="16"></uni-icons>
  515. </view>
  516. <view v-if="workMode == 3">
  517. 3<uni-icons type="forward" size="16"></uni-icons>
  518. </view>
  519. </view>
  520. </view>
  521. <view class="prop-item">
  522. <view class="prop-item-image">
  523. <image :src="imgUrl+'/setting/no.png'" style="width: 100%;height:100%;"/>
  524. </view>
  525. <view class="prop-item-left">二维码编号</view>
  526. <view class="prop-item-right">
  527. <text class="text-right">{{deviceInfo.qrcodeId==null?"未绑定":deviceInfo.qrcodeId}}</text>
  528. </view>
  529. </view>
  530. <view class="prop-item">
  531. <view class="prop-item-image">
  532. <image :src="imgUrl+'/setting/learn.png'" style="width: 100%;height:100%;"/>
  533. </view>
  534. <view class="prop-item-left">使用教程</view>
  535. <view class="prop-item-right" @click="skip(1)">
  536. <uni-icons type="forward" size="16"></uni-icons>
  537. </view>
  538. </view>
  539. <view class="prop-item">
  540. <view class="prop-item-image">
  541. <image :src="imgUrl+'/setting/video.png'" style="width: 100%;height:100%;"/>
  542. </view>
  543. <view class="prop-item-left">维修视频</view>
  544. <view class="prop-item-right" @click="skip(1)">
  545. <uni-icons type="forward" size="16"></uni-icons>
  546. </view>
  547. </view>
  548. <view class="prop-item">
  549. <view class="prop-item-image">
  550. <image :src="imgUrl+'/setting/upload.png'" style="width: 100%;height:100%;"/>
  551. </view>
  552. <view class="prop-item-left">在线升级</view>
  553. <view class="prop-item-right" @click="getUpdateInfo">
  554. <uni-icons type="forward" size="16"></uni-icons>
  555. </view>
  556. </view>
  557. <view class="prop-item">
  558. <view class="prop-item-image">
  559. <image :src="imgUrl+'/setting/shou.png'" style="width: 100%;height:100%;"/>
  560. </view>
  561. <view class="prop-item-left">售后服务</view>
  562. <view class="prop-item-right" @click="skip(2)">
  563. <uni-icons type="forward" size="16"></uni-icons>
  564. </view>
  565. </view>
  566. <view class="prop-item">
  567. <view class="prop-item-image">
  568. <image :src="imgUrl+'/setting/reset.png'" style="width: 100%;height:100%;"/>
  569. </view>
  570. <view class="prop-item-left">恢复出厂</view>
  571. <view class="prop-item-right" @click="reset">
  572. <uni-icons type="forward" size="16"></uni-icons>
  573. </view>
  574. </view>
  575. <view class="prop-item">
  576. <view class="prop-item-image">
  577. <image :src="imgUrl+'/setting/runinfo.png'" style="width: 100%;height:100%;"/>
  578. </view>
  579. <view class="prop-item-left">修改名称</view>
  580. <view class="prop-item-right" @click="modifyName">
  581. <uni-icons type="forward" size="16"></uni-icons>
  582. </view>
  583. </view>
  584. </view>
  585. </scroll-view>
  586. </uni-drawer>
  587. <u-popup :show="jiaozhunPopDlg" @close="closejiaozhunPop" mode="center" :closeable="true">
  588. <view style="position: relative;width: 400rpx;background: none;padding:40rpx;">
  589. <view class="control_item" style="width: 100%">
  590. <image :src="imgUrl+'/detail/bg_mid.png'" style="width: 100%;height:100%;position: absolute;top:0px;"/>
  591. <view class="control_item_detail">
  592. <view class="control_item_left" @click="subJiaoZhunTemperature(1)" style="left: 18%;">-</view>
  593. <view class="control_item_center">
  594. <view style="position: absolute">
  595. <u-input customStyle="width:150rpx;border:0px;" disabledColor="white" v-model="jiaozhunTemp_temp"></u-input>
  596. </view>
  597. </view>
  598. <view class="control_item_center_unit" :style="unitFixedStyle">℃</view>
  599. <view class="control_item_right" @click="addJiaoZhunTemperature(1)" style="left: 80%;">+</view>
  600. </view>
  601. <view class="control_item_title">
  602. 校准温度
  603. </view>
  604. </view>
  605. <view>
  606. <button style="background: white;" @click="confirmJiaozhunTemp">确认</button>
  607. </view>
  608. </view>
  609. </u-popup>
  610. <u-popup :show="liuzhuanPopDlg" @close="closeliuzhuanPop" mode="center" :closeable="true">
  611. <view style="position: relative;width: 400rpx;background: none;padding:40rpx;">
  612. <view class="control_item" style="width: 100%">
  613. <image :src="imgUrl+'/detail/bg_mid.png'" style="width: 100%;height:100%;position: absolute;top:0px;"/>
  614. <view class="control_item_detail">
  615. <view class="control_item_center">
  616. <view style="position: absolute">
  617. <u-input customStyle="width:150rpx;border:0px;" disabledColor="white" v-model="setTurnCurrent"></u-input>
  618. </view>
  619. </view>
  620. <view class="control_item_center_unit" :style="unitFixedStyle">MA</view>
  621. </view>
  622. <view class="control_item_title">
  623. 扭力
  624. </view>
  625. </view>
  626. <view>
  627. <button style="background: white;" @click="confirmLiuzhuannCurrent">确认</button>
  628. </view>
  629. </view>
  630. </u-popup>
  631. <u-picker :show="showModelPicker" @cancel="closeModelPicker" @confirm="confirmMode" :columns="modeList" keyName="text"></u-picker>
  632. </view>
  633. </template>
  634. <script>
  635. import { getDetail,getDeviceStatus,cacheJsonThingsModel,reportError ,getDeviceRunTime,getLatestFirmware,bingDeviceDept,editDeviceName} from '@/api/device/device.js'
  636. import config from '@/config'
  637. export default {
  638. data(){
  639. return {
  640. liuzhuanPopDlg:false,
  641. turnPercent:1,
  642. onlineStatus:false,
  643. modeList:[[
  644. {id:1,text:"1"},
  645. {id:2,text:"2"},
  646. {id:3,text:"3"},
  647. ]],
  648. productSize:"",
  649. productImage:"",
  650. showModelPicker:false,
  651. unitFixedStyle:"",
  652. unitFixedStyle1:"",
  653. planTime:10,
  654. setSealingTemperature:160,
  655. setEdegTemperature:160,
  656. sealingTemperature:0,
  657. edegTemperature:0,
  658. hightTemperature:0,
  659. currentTemperature:0,
  660. temperatureTime:1,
  661. temperature:0,
  662. packageNumber:1,
  663. packageVolume:50,
  664. firstTab:true,
  665. decoctControlStatus:false,
  666. decoctControlOnOffStatus:false,
  667. packageControlOnOffStatus:false,
  668. subDecoctTabList:[
  669. {name:'子煎药1'},
  670. {name:'子煎药2'},
  671. {name:'子煎药3'},
  672. ],
  673. DecoctControlStatus:false,
  674. PackagControlStatus:false,
  675. baozhuangTurn:false,
  676. qitingTurn:false,
  677. qingxiTurn:false,
  678. subCurrent:0,
  679. current:0,
  680. inputStyle:{height:'44rpx','fontSize':'20rpx'},
  681. modelKey:['PowerControl','LockControl'],
  682. jianyaoKeys : ["TempSetting","TimeSetting"],
  683. baozhuangKeys:["SetSealTemp","SetBandingTemp","PackageQuantity","PackingVolume"],
  684. power:{
  685. loading:true,
  686. value:0,
  687. },
  688. lock:{
  689. loading:true,
  690. value:0,
  691. },
  692. showTimeDlg:false,
  693. showErrDlg:null,
  694. errorMsg:"asdasdasdasd",
  695. show:null,
  696. value:"",
  697. deviceInfo:{},
  698. id:0,
  699. summary:[
  700. ],
  701. tabs:[
  702. {tabName:"煎药控制"},
  703. {tabName:"包装控制"},
  704. ],
  705. activeName:0,
  706. childId:0,
  707. oneToMul:false,
  708. inputProp:[],
  709. watchProp:[],
  710. columns:[],
  711. location:{},
  712. sysDept:null,
  713. timeobj:{alltime:0,avgtime:0},
  714. publishMsg:false,
  715. checkTimer:null,
  716. functions:[],
  717. properties:[],
  718. propMap:{},
  719. jianyaoTimer:null,
  720. baozhuangTimer:null,
  721. editing:false,
  722. workMode:2,
  723. leftAppointmentTime:0,
  724. leftJianyaoTime:0,
  725. imgUrl:"",
  726. popDlg:false,
  727. fengbianDlgShow:false,
  728. fengkouDlgShow:false,
  729. wenhuoTimeDlgShow:false,
  730. planPopDlg:false,
  731. planIngPopDlg:false,
  732. maxWidth:320,
  733. jiaozhunTemp:0,//校准温度,
  734. jiaozhunTemp_temp:0,//校准温度,
  735. jiaozhunPopDlg:false,
  736. step:0,
  737. yuyueIngPop:false,
  738. firmware:{},
  739. jianyaoPopClose:true,
  740. tabIndex:1,
  741. appid:"wxfd7b1a0e03e9b7e9",
  742. firstMachine:true,
  743. secondMachine:false,
  744. thirdMachine:false,
  745. forthMachine:true,
  746. deviceType:1,
  747. tabActive:[true,false,false],
  748. resetDuration:4000,
  749. jianyaoWenduSetting:false,
  750. jianyaoShijianSetting:false,
  751. baozhuangFengbianSetting:false,
  752. baozhuangFengkouSetting:false,
  753. baozhuangRongLiangSetting:false,
  754. baozhuangShuLIangSetting:false,
  755. tempFengkouWendu:0,
  756. tempFengBianWendu:0,
  757. boardType:4,//板子类型
  758. lineTimer:null,
  759. validCurrent:0,//有效电流值
  760. turnCurrent:0,//堵转电流值
  761. setTurnCurrent:0,
  762. pressTurn:0,
  763. resetTurn:0,
  764. }
  765. },
  766. onLoad: function(opt) {
  767. this.id = opt.id;
  768. // this.id = 61;
  769. this.connectMqtt();
  770. this.getDetail();
  771. this.imgUrl = config.imgUrl
  772. this.fixStyle();
  773. // this.fixImage();
  774. // console.log = function(){}
  775. },
  776. destroyed() {
  777. // 取消订阅主题
  778. this.mqttUnSubscribe(this.deviceInfo);
  779. clearTimeout(this.checkTimer);
  780. },
  781. watch: {
  782. pressTurn(newVal,oldValue) {
  783. let self= this;
  784. if(newVal == 1){
  785. setTimeout(function(){
  786. self.startProgressTimer(1);
  787. },200);
  788. }else{
  789. clearInterval(this.lineTimer)
  790. this.turnPercent = 0;
  791. }
  792. },
  793. resetTurn(newVal){
  794. let self= this;
  795. if(newVal == 1){
  796. setTimeout(function(){
  797. self.startProgressTimer(2);
  798. },200);
  799. }else{
  800. clearInterval(this.lineTimer)
  801. this.turnPercent = 0;
  802. }
  803. }
  804. },
  805. methods:{
  806. closeliuzhuanPop(){
  807. this.liuzhuanPopDlg = false;
  808. },
  809. confirmLiuzhuannCurrent(){
  810. if(this.setTurnCurrent<200 || this.setTurnCurrent>400){
  811. this.notifyError("扭力范围为200-400")
  812. return;
  813. }
  814. let arr = [];
  815. let pressObj = {};
  816. pressObj.id = "TurnCurrent";
  817. pressObj.shadow = this.setTurnCurrent;
  818. arr.push(pressObj);
  819. this.mqttPublish(2,this.deviceInfo,arr)
  820. this.closeliuzhuanPop();
  821. },
  822. setPressTurn(){
  823. if(!this.decoctControlOnOffStatus){
  824. this.notifyError("请先开机后再进行操作")
  825. return;
  826. }
  827. let arr = [];
  828. let currentPresturn = this.pressTurn;
  829. let pressObj = {};
  830. if(this.resetTurn == 1){
  831. this.resetTurn = 0;
  832. }
  833. if(currentPresturn == 1){//代表要关闭
  834. pressObj.id = "PressTurn";
  835. pressObj.shadow = 0;
  836. arr.push(pressObj);
  837. this.turnPercent = 0;
  838. this.pressTurn = 0;
  839. }else{//代表要开启
  840. pressObj.id = "PressTurn";
  841. pressObj.shadow = 1;
  842. arr.push(pressObj);
  843. this.pressTurn = 1;
  844. this.resetTurn = 0;
  845. }
  846. this.mqttPublish(2,this.deviceInfo,arr)
  847. this.$forceUpdate()
  848. },
  849. startProgressTimer(type){
  850. let self = this;
  851. if(self.lineTimer != null){
  852. clearInterval(self.lineTimer)
  853. }
  854. if(type == 1){
  855. self.lineTimer = setInterval(function(){
  856. if(self.turnPercent >=100){
  857. self.turnPercent = 1;
  858. clearInterval(self.lineTimer);
  859. setTimeout(function(){
  860. self.startProgressTimer(1);
  861. },500);
  862. }
  863. self.turnPercent +=5;
  864. },200);
  865. }else{
  866. self.lineTimer = setInterval(function(){
  867. if(self.turnPercent >=100){
  868. self.turnPercent = 1;
  869. clearInterval(self.lineTimer);
  870. setTimeout(function(){
  871. self.startProgressTimer(2);
  872. },500);
  873. }
  874. self.turnPercent +=5;
  875. },200);
  876. }
  877. },
  878. setResetTurn(){
  879. debugger;
  880. if(!this.decoctControlOnOffStatus){
  881. this.notifyError("请先开机后再进行操作")
  882. return;
  883. }
  884. if(this.pressTurn == 1){
  885. this.pressTurn = 0;
  886. }
  887. let arr = [];
  888. if(this.resetTurn == 1){
  889. let pressObj = {};
  890. pressObj.id = "ResetTurn";
  891. pressObj.shadow = 0;
  892. this.resetTurn = 0;
  893. this.turnPercent = 0;
  894. arr.push(pressObj);
  895. }else{
  896. let pressObj = {};
  897. pressObj.id = "ResetTurn";
  898. pressObj.shadow = 1;
  899. this.resetTurn = 1;
  900. this.pressTurn = 0;
  901. let self= this;
  902. arr.push(pressObj);
  903. }
  904. this.mqttPublish(2,this.deviceInfo,arr)
  905. this.$forceUpdate()
  906. },
  907. fixImage(heng){
  908. let self = this;
  909. wx.getSystemInfo({
  910. success: res => {
  911. const { windowWidth, windowHeight, statusBarHeight } = res;
  912. if(heng){
  913. let rate = 0.35;
  914. if(windowHeight<800){
  915. rate = 0.30;
  916. }
  917. let imgHeight = windowWidth*0.85;
  918. let imageWidth = windowWidth * 1;
  919. self.productSize = ";width:"+imageWidth+"px;height:"+imgHeight+"px;";
  920. }else{
  921. let rate = 0.35;
  922. if(windowHeight<800){
  923. rate = 0.30;
  924. }
  925. let imgHeight = windowHeight*rate;
  926. let imageWidth = imgHeight * 0.6;
  927. self.productSize = ";width:"+imageWidth+"px;height:"+imgHeight+"px;";
  928. }
  929. }
  930. })
  931. },
  932. propChange(type){
  933. // if(type == 1){
  934. // }
  935. },
  936. propFocus(type){
  937. if(type == 1){
  938. this.jianyaoWenduSetting = true;
  939. }
  940. if(type == 2){
  941. this.jianyaoShijianSetting = true;
  942. }
  943. if(type == 3){
  944. this.baozhuangFengbianSetting = true;
  945. this.tempFengBianWendu = this.edegTemperature;
  946. this.edegTemperature = this.setEdegTemperature;
  947. }
  948. if(type == 4){
  949. this.baozhuangFengkouSetting = true;
  950. this.tempFengkouWendu = this.sealingTemperature;
  951. this.sealingTemperature = this.setSealingTemperature;
  952. }
  953. if(type == 5){
  954. this.baozhuangRongLiangSetting = true;
  955. }
  956. if(type == 6){
  957. this.baozhuangShuLIangSetting = true;
  958. }
  959. },
  960. autoBlur(type){
  961. },
  962. propBlur(type){
  963. if(type == 1){
  964. this.jianyaoWenduSetting = false;
  965. this.changeTemperature();
  966. }
  967. if(type == 2){
  968. this.temperatureTime = this.leftJianyaoTime;
  969. this.changeTemperatureTime();
  970. }
  971. if(type == 3){
  972. this.setEdegTemperature = this.edegTemperature;
  973. this.changeEdegTemperature();
  974. }
  975. if(type == 4){
  976. this.setSealingTemperature = this.sealingTemperature;
  977. this.changeSealingTemperature();
  978. }
  979. if(type == 5){
  980. this.changePackageVolume()
  981. }
  982. if(type == 6){
  983. this.changePackageNumber();
  984. }
  985. },
  986. modifyName(){
  987. let self = this;
  988. uni.showModal({
  989. title: "修改设备名称",
  990. editable: true,
  991. placeholderText: "请输入设备名称",
  992. content: this.deviceInfo.deviceName,
  993. showCancel: true,
  994. success: function (res) {
  995. console.log(res);
  996. if(res.confirm){
  997. let content = res.content;
  998. let obj = {"deviceId":self.id,deviceName:content};
  999. editDeviceName(obj).then(res=>{
  1000. if(res.code == 200){
  1001. self.deviceInfo.deviceName = content;
  1002. self.$modal.showToast('修改成功')
  1003. }else{
  1004. self.$modal.showToast('修改失败,请稍后再试')
  1005. }
  1006. });
  1007. }
  1008. },
  1009. fail: function (res) {
  1010. console.log(res);
  1011. }
  1012. })
  1013. },
  1014. showWorkPicker(){
  1015. let self = this;
  1016. uni.showModal({
  1017. title: "提示",
  1018. content: "该功能请在专业人士指导下使用,是否继续",
  1019. confirmText:"是",
  1020. success: function (res) {
  1021. if(res.confirm){
  1022. self.showModelPicker = true;
  1023. }
  1024. },
  1025. })
  1026. },
  1027. skip(type){
  1028. if(type == 1){
  1029. wx.navigateToMiniProgram({
  1030. appId: this.appid,
  1031. path: 'pages/news_details/help?id=25',
  1032. success(res) {
  1033. // 打开成功
  1034. },
  1035. fail(res){
  1036. console.log(res);
  1037. }
  1038. })
  1039. }else if(type == 2){
  1040. wx.openCustomerServiceChat({
  1041. extInfo: {url: 'https://work.weixin.qq.com/kfid/kfc4202b8764df71c0c'},
  1042. corpId: 'ww8e678fbe6f1079ba',
  1043. success(res) {
  1044. },
  1045. fail(res){
  1046. console.log(res);
  1047. }
  1048. })
  1049. }
  1050. },
  1051. isMulTab(index){
  1052. let type = this.deviceType;
  1053. if(index == 2){
  1054. if(type == 4 || type == 5){
  1055. return true;
  1056. }
  1057. }
  1058. if(index == 3){
  1059. if(type == 5){
  1060. return true;
  1061. }
  1062. }
  1063. return false;
  1064. },
  1065. isPage(index){
  1066. if(this.tabIndex == index){
  1067. return true;
  1068. }
  1069. return false;
  1070. },
  1071. getUpdateInfo(){
  1072. let self = this;
  1073. getLatestFirmware(this.id).then(res=>{
  1074. self.firmware = res.data;
  1075. let curVersion = self.deviceInfo.firmwareVersion;
  1076. let onlineVersion = self.firmware.version
  1077. if(curVersion>=onlineVersion){
  1078. this.$modal.showToast('当前已经是最新版本')
  1079. }else{
  1080. uni.showModal({
  1081. title: '检测到新版本',
  1082. content: "当前版本:"+curVersion+",新版本:"+onlineVersion,
  1083. cancelText: '取消',
  1084. confirmText: '升级',
  1085. success: function(res) {
  1086. if (res.confirm) {
  1087. self.doUpdate();
  1088. }
  1089. }
  1090. })
  1091. }
  1092. });
  1093. },
  1094. doUpdate(){
  1095. if(this.deviceInfo.status != 3){
  1096. this.notifyError("请等待设备上线后操作")
  1097. return;
  1098. }
  1099. let device = this.deviceInfo;
  1100. let message = "";
  1101. let topic = "";
  1102. let title = "升级";
  1103. topic = "/" + device.productId + "/" + device.serialNumber + "/ota/get";
  1104. message = '{"version":"' + this.firmware.version + '","downloadUrl":"' + this.getDownloadUrl(this.firmware.filePath) + '","size":"'+this.firmware.size+'"}';
  1105. this.$mqttTool.publish(topic, message,title).then(res => {
  1106. this.notifySuccess(res);
  1107. }).catch(res => {
  1108. this.notifyError(res);
  1109. });
  1110. },
  1111. getStatusText(){
  1112. if(this.baozhuangRunning()){
  1113. return "工作中";
  1114. }
  1115. if(this.jianyaoIng()){
  1116. return "工作中";
  1117. }
  1118. if(this.leftAppointmentTime>0){
  1119. return "已预约";
  1120. }
  1121. return "空闲中";
  1122. },
  1123. closeYuyueIngPop(){
  1124. this.yuyueIngPop = false;
  1125. },
  1126. confirmMode(item){
  1127. console.log(item)
  1128. this.workMode = item.value[0].id;
  1129. this.setMode(this.workMode);
  1130. this.closeModelPicker();
  1131. },
  1132. closeModelPicker(){
  1133. this.showModelPicker = false;
  1134. },
  1135. confirmJiaozhunTemp(){
  1136. this.jiaozhunTemp = this.jiaozhunTemp_temp;
  1137. this.temperNumber();
  1138. this.closejiaozhunPop();
  1139. },
  1140. addJiaoZhunTemperature(){
  1141. this.jiaozhunTemp_temp ++;
  1142. if(this.jiaozhunTemp_temp>20){
  1143. this.jiaozhunTemp_temp = 20;
  1144. }
  1145. },
  1146. subJiaoZhunTemperature(){
  1147. this.jiaozhunTemp_temp --;
  1148. if(this.jiaozhunTemp_temp<-20){
  1149. this.jiaozhunTemp_temp = -20;
  1150. }
  1151. },
  1152. closejiaozhunPop(){
  1153. this.jiaozhunPopDlg = false;
  1154. },
  1155. showLiuProp(){
  1156. let self = this;
  1157. uni.showModal({
  1158. title: "提示",
  1159. content: "该功能请在专业人士指导下使用,是否继续",
  1160. confirmText:"是",
  1161. success: function (res) {
  1162. if(res.confirm){
  1163. self.liuzhuanPopDlg = true;
  1164. }
  1165. },
  1166. })
  1167. },
  1168. showJiaozhunProp(){
  1169. let self = this;
  1170. uni.showModal({
  1171. title: "提示",
  1172. content: "该功能请在专业人士指导下使用,是否继续",
  1173. confirmText:"是",
  1174. success: function (res) {
  1175. if(res.confirm){
  1176. self.jiaozhunTemp_temp = self.jiaozhunTemp;
  1177. self.jiaozhunPopDlg = true;
  1178. }
  1179. },
  1180. })
  1181. },
  1182. fixStyle(){
  1183. let self = this;
  1184. wx.getSystemInfo({
  1185. success: res => {
  1186. const { windowWidth, windowHeight, statusBarHeight } = res;
  1187. // 在这里可以获取到屏幕的宽度和高度
  1188. console.log(windowWidth, windowHeight, statusBarHeight);
  1189. if(windowWidth<=350){
  1190. self.unitFixedStyle = ";padding-top:6px;left: 28vw;";
  1191. self.unitFixedStyle1 = ";padding-top:6px;left: 28vw;";
  1192. }else if(windowWidth>=360){
  1193. self.unitFixedStyle = ";padding-top:10rpx;";
  1194. self.unitFixedStyle1 = ";padding-top:10rpx;left: 32vw;";
  1195. }
  1196. self.maxWidth = windowWidth;
  1197. }
  1198. })
  1199. },
  1200. closePlanIngPop(){
  1201. this.jianyaoPopClose = false;
  1202. this.planIngPopDlg = false;
  1203. },
  1204. closePlanPop(){
  1205. this.planPopDlg = false;
  1206. },
  1207. showBaozhuangDlg(type){
  1208. this.popDlg = true;
  1209. if(type == 1){
  1210. this.fengbianDlgShow = true;
  1211. }else if(type == 2){
  1212. this.fengkouDlgShow = true;
  1213. }else if(type == 3){
  1214. this.wenhuoTimeDlgShow = true;
  1215. }
  1216. },
  1217. closePop(){
  1218. this.popDlg = false;
  1219. this.fengbianDlgShow = false;
  1220. this.fengkouDlgShow = false;
  1221. this.wenhuoTimeDlgShow = false;
  1222. },
  1223. changeTab(index,tag){
  1224. if(!tag){
  1225. return;
  1226. }
  1227. let type = this.deviceType;
  1228. let self = this;
  1229. if(index == 2 || index == 3){
  1230. if(!this.isMulTab(index)){
  1231. return;
  1232. }
  1233. }
  1234. this.resetChoose();
  1235. if(index == 4){
  1236. uni.showLoading({title:"加载中"});
  1237. getDeviceStatus(this.id,0).then(res=>{
  1238. let data =res.data;
  1239. this.deviceInfo = data;
  1240. self.parseStatusData(data)
  1241. setTimeout(function () {
  1242. uni.hideLoading();
  1243. self.firstTab = false;
  1244. },100);
  1245. });
  1246. }else{
  1247. let arr = ["a","b","c"]
  1248. if(type == 4 || type == 5){
  1249. this.childId =arr[index-1];
  1250. this.getDeviceStatus(function(){
  1251. self.tabIndex = index;
  1252. self.firstTab = true;
  1253. self.tabActive[index-1] = true;
  1254. self.$forceUpdate();
  1255. });
  1256. }else{
  1257. this.getDeviceStatus(function(){
  1258. self.tabIndex = index;
  1259. self.firstTab = true;
  1260. self.tabActive[index-1] = true;
  1261. self.$forceUpdate();
  1262. })
  1263. }
  1264. console.log(this.tabActive)
  1265. }
  1266. },
  1267. resetChoose(){
  1268. this.tabIndex = 0;
  1269. for (let i = 0; i < 3; i++) {
  1270. this.tabActive[i] = false;
  1271. }
  1272. },
  1273. changePackageVolume(){
  1274. if(this.packageVolume<50){
  1275. this.packageVolume = 50;
  1276. }
  1277. if(this.packageVolume>300){
  1278. this.packageVolume = 300;
  1279. }
  1280. this.sendBaozhuang("PackingVolume");
  1281. },
  1282. changePackageNumber(){
  1283. let min = 1;
  1284. let max = 999;
  1285. if(this.packageNumber<min){
  1286. this.packageNumber = min;
  1287. }
  1288. if(this.packageNumber>max){
  1289. this.packageNumber = max;
  1290. }
  1291. this.sendBaozhuang("PackageQuantity");
  1292. },
  1293. changeEdegTemperature(){
  1294. let min = 80;
  1295. let max = 220;
  1296. if(this.setEdegTemperature<min){
  1297. this.setEdegTemperature = min;
  1298. }
  1299. if(this.setEdegTemperature>max){
  1300. this.setEdegTemperature = max;
  1301. }
  1302. console.log("current setEdegTemperature is :"+this.setEdegTemperature)
  1303. this.sendBaozhuang("SetBandingTemp");
  1304. },
  1305. changeSealingTemperature(){
  1306. let min = 80;
  1307. let max = 220;
  1308. if(this.setSealingTemperature<min){
  1309. this.setSealingTemperature = min;
  1310. }
  1311. if(this.setSealingTemperature>max){
  1312. this.setSealingTemperature = max;
  1313. }
  1314. console.log("current setSealingTemperature is :"+this.setSealingTemperature)
  1315. this.sendBaozhuang("SetSealTemp");
  1316. },
  1317. changeTemperature(){
  1318. let max = 140;
  1319. let min = 100;
  1320. if(this.workMode == 2){
  1321. min = 1;
  1322. }
  1323. if(this.temperature<min){
  1324. this.temperature = min;
  1325. }
  1326. if(this.temperature>max){
  1327. this.temperature = max;
  1328. }
  1329. console.log("current temperature is :"+this.temperature)
  1330. this.sendJianYao("TempSetting");
  1331. },
  1332. changeTemperatureTime(){
  1333. let min = 1;
  1334. let max = 600;
  1335. if(this.temperatureTime<min){
  1336. this.temperatureTime = min;
  1337. }
  1338. if(this.temperatureTime>max){
  1339. this.temperatureTime = max;
  1340. }
  1341. console.log("current temperatureTime is :"+this.temperatureTime)
  1342. this.sendJianYao("TimeSetting");
  1343. },
  1344. jianyaoOpen(){
  1345. if(this.decoctControlOnOffStatus){
  1346. return true;
  1347. }
  1348. return false;
  1349. },
  1350. baozhuangOpen(){
  1351. if(this.packageControlOnOffStatus){
  1352. return true;
  1353. }
  1354. return false;
  1355. },
  1356. baozhuangRunning(){
  1357. if(this.qingxiTurn || this.baozhuangTurn || this.qitingTurn){
  1358. return true;
  1359. }
  1360. return false;
  1361. },
  1362. jianyaoIng(){
  1363. if(this.decoctControlStatus){
  1364. return true;
  1365. }
  1366. return false;
  1367. },
  1368. cancelPlan(){
  1369. let arr = [];
  1370. let obj = {};
  1371. obj.id = "AppointmentTime";
  1372. obj.shadow = 0;
  1373. arr.push(obj);
  1374. let self = this;
  1375. self.kongzhiJianyao(false,arr);
  1376. this.mqttPublish(2,this.deviceInfo,arr,true);
  1377. this.closeYuyueIngPop();
  1378. },
  1379. toPlan(){
  1380. if(!this.jianyaoOpen()){
  1381. this.$modal.showToast('煎药机已经关机')
  1382. return;
  1383. }
  1384. if(this.leftAppointmentTime>0){
  1385. this.yuyueIngPop = true;
  1386. }else{
  1387. if(this.jianyaoIng()){
  1388. this.$modal.showToast('正在煎药')
  1389. return;
  1390. }
  1391. this.planPopDlg = true;
  1392. }
  1393. },
  1394. calcuStep(){
  1395. if(this.leftAppointmentTime>0){
  1396. this.step = 0;
  1397. return 0;
  1398. }
  1399. if(this.leftJianyaoTime == 0){
  1400. this.step = 100;
  1401. return ;
  1402. }
  1403. let currentTemperature = this.currentTemperature;
  1404. let hightTemperature = this.temperatureTime-this.leftJianyaoTime;//设置的高温时间
  1405. let targetTemperature =100;// this.temperature;
  1406. let targetTemperatureTime = this.temperatureTime;//倒计时
  1407. if(targetTemperature>100){
  1408. targetTemperature = 100;
  1409. }
  1410. let step = 0;
  1411. if(currentTemperature<100){
  1412. let tem = currentTemperature/200*100;
  1413. step = tem;
  1414. }else{
  1415. step = 50;
  1416. let rate = hightTemperature/targetTemperatureTime;
  1417. rate = rate/2;
  1418. rate = rate*100;
  1419. rate = rate.toFixed(2)
  1420. step = step + parseFloat(rate);
  1421. }
  1422. this.step = step.toFixed(2);
  1423. },
  1424. plan(){
  1425. let self = this;
  1426. if(this.planTime>600){
  1427. this.$modal.showToast('预约时间最大为600分钟')
  1428. return;
  1429. }
  1430. if(this.planTime == 0){
  1431. this.$modal.showToast('预约时间不能为空')
  1432. }else{
  1433. let arr = [];
  1434. let obj = {};
  1435. obj.id = "AppointmentTime";
  1436. obj.shadow = this.planTime;
  1437. arr.push(obj);
  1438. this.kongzhiJianyao(true,arr);
  1439. this.mqttPublish(2,this.deviceInfo,arr,true);
  1440. }
  1441. this.$modal.showToast('预约成功')
  1442. this.planPopDlg = false;
  1443. },
  1444. lockCtrl(key){
  1445. let arr = [];
  1446. let obj = {};
  1447. obj.id = "LockControl";
  1448. if(key == 0){
  1449. obj.shadow = 1;
  1450. this.lock.value = 1;
  1451. }else{
  1452. obj.shadow = 0;
  1453. this.lock.value = 0;
  1454. }
  1455. arr.push(obj);
  1456. this.mqttPublish(2,this.deviceInfo,arr)
  1457. },
  1458. setMode(type){
  1459. let arr = [];
  1460. let obj = {};
  1461. obj.id = "WorkMode";
  1462. obj.shadow = type;
  1463. arr.push(obj);
  1464. this.mqttPublish(2,this.deviceInfo,arr,true)
  1465. this.workMode = type;
  1466. },
  1467. temperNumber(value){
  1468. let arr = [];
  1469. let obj = {};
  1470. obj.id = "CalibrationTemp";
  1471. obj.shadow = this.jiaozhunTemp;
  1472. arr.push(obj);
  1473. this.mqttPublish(2,this.deviceInfo,arr,true)
  1474. },
  1475. volumeNumber(){
  1476. let arr = [];
  1477. let obj = {};
  1478. obj.id = "CapacityCalibration";
  1479. obj.shadow = 1;
  1480. arr.push(obj);
  1481. this.mqttPublish(2,this.deviceInfo,arr,true)
  1482. },
  1483. showConfirm(title,content,yes,no){
  1484. uni.showModal({
  1485. title: title,
  1486. content: content,
  1487. success: function (res) {
  1488. if (res.confirm) {
  1489. yes();
  1490. } else if (res.cancel) {
  1491. no();
  1492. }
  1493. }
  1494. });
  1495. },
  1496. reset(){
  1497. let self = this;
  1498. this.showConfirm("提示","确认恢复出厂吗",function(){
  1499. let arr = [];
  1500. let obj = {};
  1501. obj.id = "RestoreFactory";
  1502. obj.shadow = 1;
  1503. arr.push(obj);
  1504. self.mqttPublish(2,self.deviceInfo,arr)
  1505. },function(){});
  1506. },
  1507. turnChange(type){
  1508. let flag = false;
  1509. let obj = {};
  1510. if(type ==3){
  1511. if(this.baozhuangTurn || this.qitingTurn){
  1512. this.$modal.showToast("启停、包装、清洗不能同时打开")
  1513. return;
  1514. }
  1515. flag = this.qingxiTurn;
  1516. obj.id = "WashSwitch";
  1517. }else if(type == 2){
  1518. if(this.qingxiTurn || this.qitingTurn){
  1519. this.$modal.showToast("启停、包装、清洗不能同时打开")
  1520. return;
  1521. }
  1522. flag = this.baozhuangTurn;
  1523. obj.id = "PackageSwitch";
  1524. }else if(type == 1) {
  1525. if(this.qingxiTurn || this.baozhuangTurn){
  1526. this.$modal.showToast("启停、包装、清洗不能同时打开")
  1527. return;
  1528. }
  1529. flag = this.qitingTurn;
  1530. obj.id = "CarrybagSwitch";
  1531. }
  1532. flag = !flag;
  1533. let arr = [];
  1534. if(flag){
  1535. obj.shadow = 1;
  1536. }else{
  1537. obj.shadow = 0;
  1538. }
  1539. arr.push(obj);
  1540. this.mqttPublish(2,this.deviceInfo,arr)
  1541. },
  1542. addPackageVolume(){
  1543. this.packageVolume++;
  1544. if(this.packageVolume>300){
  1545. this.packageVolume = 50;
  1546. }
  1547. console.log("增加包装容量")
  1548. this.changePackageVolume()
  1549. },
  1550. subPackageVolume(){
  1551. this.packageVolume--;
  1552. if( this.packageVolume<50){
  1553. this.packageVolume = 300;
  1554. }
  1555. console.log("减少包装容量")
  1556. this.changePackageVolume()
  1557. },
  1558. addPackageNumber(){
  1559. this.packageNumber++;
  1560. if(this.packageNumber>999){
  1561. this.packageNumber = 1;
  1562. }
  1563. console.log("增加包装数量")
  1564. this.changePackageNumber();
  1565. },
  1566. subPackageNumber(){
  1567. this.packageNumber--;
  1568. if(this.packageNumber<1){
  1569. this.packageNumber = 999;
  1570. }
  1571. console.log("减少包装数量")
  1572. this.changePackageNumber();
  1573. },
  1574. addSealingTemperature(){
  1575. console.log("增加封口温度")
  1576. if(!this.fengkouDlgShow){
  1577. this.fengkouDlgShow = true;
  1578. }
  1579. this.setSealingTemperature++;
  1580. this.changeSealingTemperature();
  1581. },
  1582. subSealingTemperature(){
  1583. console.log("减少封口温度")
  1584. if(!this.fengkouDlgShow){
  1585. this.fengkouDlgShow = true;
  1586. }
  1587. this.setSealingTemperature--;
  1588. this.changeSealingTemperature();
  1589. },
  1590. addEdegTemperature(){
  1591. console.log("增加封边温度")
  1592. this.editing = true;
  1593. if(!this.fengbianDlgShow){
  1594. this.fengbianDlgShow = true;
  1595. }
  1596. this.setEdegTemperature++;
  1597. this.changeEdegTemperature();
  1598. },
  1599. subEdegTemperature(){
  1600. console.log("减少封边温度")
  1601. this.editing = true;
  1602. if(!this.fengbianDlgShow){
  1603. this.fengbianDlgShow = true;
  1604. }
  1605. this.setEdegTemperature--;
  1606. this.changeEdegTemperature();
  1607. },
  1608. addTemperatureTime(){
  1609. console.log("增加煎药时间")
  1610. if(!this.wenhuoTimeDlgShow){
  1611. this.wenhuoTimeDlgShow = true;
  1612. this.temperatureTime = this.leftJianyaoTime;
  1613. }
  1614. this.temperatureTime++;
  1615. this.changeTemperatureTime()
  1616. },
  1617. subTemperatureTime(){
  1618. console.log("减少煎药时间")
  1619. if(!this.wenhuoTimeDlgShow){
  1620. this.wenhuoTimeDlgShow = true;
  1621. this.temperatureTime = this.leftJianyaoTime;
  1622. }
  1623. this.temperatureTime--;
  1624. if(this.temperatureTime<=0){
  1625. this.temperatureTime = 1;
  1626. }
  1627. this.changeTemperatureTime()
  1628. },
  1629. addTemperature(){
  1630. console.log("增加煎药温度")
  1631. this.temperature++;
  1632. this.changeTemperature();
  1633. },
  1634. subTemperature(type){
  1635. console.log("减少煎药温度")
  1636. this.temperature--;
  1637. this.changeTemperature();
  1638. },
  1639. addPlanTime(){
  1640. console.log("增加预约时间")
  1641. this.planTime++;
  1642. },
  1643. subPlanTime(){
  1644. console.log("减少预约时间")
  1645. this.planTime--;
  1646. },
  1647. sendBaozhuang(targetKey){
  1648. let self = this;
  1649. let arr = [];
  1650. if(this.baozhuangTimer != null){
  1651. clearTimeout(this.baozhuangTimer);
  1652. }
  1653. this.baozhuangTimer = setTimeout(function (){
  1654. for (let i = 0; i <this.baozhuangKeys.length; i++) {
  1655. let key = this.baozhuangKeys[i];
  1656. let obj = {};
  1657. obj.id = key;
  1658. if(key === "PackingVolume"){
  1659. obj.shadow = this.packageVolume;
  1660. setTimeout(function (){
  1661. self.baozhuangRongLiangSetting = false;
  1662. },self.resetDuration);
  1663. }
  1664. if(key === "PackageQuantity"){
  1665. obj.shadow = this.packageNumber;
  1666. setTimeout(function (){
  1667. self.baozhuangShuLIangSetting = false;
  1668. },self.resetDuration);
  1669. }
  1670. if(key === "SetSealTemp"){
  1671. obj.shadow = this.setSealingTemperature;
  1672. setTimeout(function (){
  1673. self.fengkouDlgShow = false;
  1674. self.baozhuangFengkouSetting = false;
  1675. self.sealingTemperature = self.tempFengKouWendu;;
  1676. },self.resetDuration);
  1677. }
  1678. if(key === "SetBandingTemp"){
  1679. obj.shadow = this.setEdegTemperature;
  1680. setTimeout(function (){
  1681. self.fengbianDlgShow = false;
  1682. self.baozhuangFengbianSetting = false;
  1683. self.edegTemperature = self.tempFengBianWendu;
  1684. },self.resetDuration);
  1685. }
  1686. if(targetKey == key){
  1687. arr.push(obj);
  1688. break;
  1689. }
  1690. }
  1691. this.mqttPublish(2,this.deviceInfo,arr)
  1692. }.bind(this),500);
  1693. },
  1694. sendJianYao(targetKey){
  1695. let self = this;
  1696. let arr = [];
  1697. if(this.jianyaoTimer != null){
  1698. clearTimeout(this.jianyaoTimer);
  1699. }
  1700. this.jianyaoTimer = setTimeout(function (){
  1701. for (let i = 0; i <this.jianyaoKeys.length; i++) {
  1702. let key = this.jianyaoKeys[i];
  1703. let obj = {};
  1704. obj.id = key;
  1705. if(key === "TempSetting"){
  1706. obj.shadow = this.temperature;
  1707. // setTimeout(function(){
  1708. // self.wenhuoTimeDlgShow = false;
  1709. // self.jianyaoShijianSetting = false;
  1710. // },self.resetDuration)
  1711. }
  1712. if(key === "TimeSetting"){
  1713. obj.shadow = this.temperatureTime;
  1714. self.leftJianyaoTime = this.temperatureTime;;
  1715. setTimeout(function(){
  1716. self.wenhuoTimeDlgShow = false;
  1717. self.jianyaoShijianSetting = false;
  1718. },self.resetDuration)
  1719. }
  1720. if(targetKey == key){
  1721. arr.push(obj);
  1722. break;
  1723. }
  1724. }
  1725. this.mqttPublish(2,this.deviceInfo,arr,true)
  1726. }.bind(this),500);
  1727. },
  1728. buildPropKey(key){
  1729. if(this.childId !=0){
  1730. return key+"_"+this.childId;
  1731. }else{
  1732. return key;
  1733. }
  1734. },
  1735. decoctControlChange(){
  1736. let obj = {};
  1737. let arr = [];
  1738. if(!this.decoctControlOnOffStatus){
  1739. this.notifyError("请先开机后再进行操作")
  1740. return;
  1741. }
  1742. if(this.decoctControlStatus){
  1743. this.showJianyao();
  1744. return;
  1745. }
  1746. this.decoctControlStatus = !this.decoctControlStatus;
  1747. obj.id = "DecoctingSwitch";
  1748. if(this.decoctControlStatus){
  1749. obj.shadow = 1;
  1750. console.log("煎药状态打开")
  1751. this.checkJianyao();
  1752. }else{
  1753. obj.shadow = 0;
  1754. console.log("煎药状态关闭")
  1755. }
  1756. arr.push(obj);
  1757. this.mqttPublish(2,this.deviceInfo,arr,true)
  1758. },
  1759. kongzhiJianyao(flag,arr){//不判断煎药状态
  1760. let obj = {};
  1761. if(!this.decoctControlOnOffStatus){
  1762. this.notifyError("请先开机后再进行操作")
  1763. return;
  1764. }
  1765. obj.id = "DecoctingSwitch";
  1766. if(flag){
  1767. obj.shadow = 1;
  1768. console.log("煎药状态打开")
  1769. this.checkJianyao();
  1770. }else{
  1771. obj.shadow = 0;
  1772. console.log("煎药状态关闭")
  1773. }
  1774. arr.push(obj);
  1775. },
  1776. stopDecoctControlChange(){
  1777. let obj = {};
  1778. let arr = [];
  1779. if(!this.decoctControlOnOffStatus){
  1780. this.notifyError("请先开机后再进行操作")
  1781. return;
  1782. }
  1783. if(!this.decoctControlStatus){
  1784. return;
  1785. }
  1786. this.decoctControlStatus = !this.decoctControlStatus;
  1787. obj.id = "DecoctingSwitch";
  1788. if(this.decoctControlStatus){
  1789. obj.shadow = 1;
  1790. console.log("煎药状态打开")
  1791. }else{
  1792. obj.shadow = 0;
  1793. console.log("煎药状态关闭")
  1794. }
  1795. arr.push(obj);
  1796. let obj2 = {};
  1797. obj2.id = "AppointmentTime";
  1798. obj2.shadow = 0;
  1799. arr.push(obj2);
  1800. this.mqttPublish(2,this.deviceInfo,arr,true)
  1801. },
  1802. decoctControlOnOffChange(){
  1803. let obj = {};
  1804. this.decoctControlOnOffStatus = !this.decoctControlOnOffStatus;
  1805. let arr = [];
  1806. obj.id = "PowerControl";
  1807. let isMul = false;
  1808. if(this.decoctControlStatus){
  1809. this.$modal.showToast('请先结束煎药后操作')
  1810. this.decoctControlOnOffStatus = !this.decoctControlOnOffStatus;
  1811. return;
  1812. }
  1813. if(this.oneToMul && this.firstTab){
  1814. obj.id = "PowerCtl";
  1815. isMul = true;
  1816. }
  1817. if(this.decoctControlOnOffStatus){
  1818. obj.shadow = 1;
  1819. console.log("煎药机开关打开")
  1820. }else{
  1821. obj.shadow = 0;
  1822. console.log("煎药机开关关闭")
  1823. }
  1824. arr.push(obj);
  1825. this.mqttPublish(2,this.deviceInfo,arr,isMul)
  1826. },
  1827. packageControlOnOffChange(){
  1828. let obj = {};
  1829. let arr = [];
  1830. if(this.baozhuangRunning()){
  1831. this.$modal.showToast('请先停止运行后操作')
  1832. return;
  1833. }
  1834. obj.id = "PackagePowerControl";
  1835. this.packageControlOnOffStatus = !this.packageControlOnOffStatus;
  1836. if(this.packageControlOnOffStatus){
  1837. console.log("包装机器开关打开")
  1838. obj.shadow = 1;
  1839. }else{
  1840. console.log("包装机器开关关闭")
  1841. obj.shadow = 0;
  1842. }
  1843. arr.push(obj);
  1844. this.mqttPublish(2,this.deviceInfo,arr)
  1845. },
  1846. containKey(arr,key){
  1847. for (let i = 0; i < arr.length; i++) {
  1848. const data = arr[i];
  1849. if(data == key){
  1850. return true;
  1851. }
  1852. }
  1853. return false;
  1854. },
  1855. // 抽屉状态发生变化触发
  1856. change(e, type) {
  1857. console.log(e);
  1858. },
  1859. showDrawer() {
  1860. this.$refs.showLeft.open();
  1861. },
  1862. closeDrawer() {
  1863. this.$refs.showLeft.close();
  1864. },
  1865. checkItemValue(item){
  1866. if(!item.shadow){
  1867. item.shadow = 0;
  1868. }
  1869. if(!item.unit){
  1870. item.unit = "";
  1871. }
  1872. return true;
  1873. },
  1874. sendProperties(){
  1875. let properties = this.properties;
  1876. for (let i = 0; i < properties; i++) {
  1877. let property = this.properties[i];
  1878. let shadow = property.shadow;
  1879. if(shadow){
  1880. arr.push(property);
  1881. }
  1882. }
  1883. this.mqttPublish(1,this.deviceInfo,arr)
  1884. },
  1885. sendFunctions(){
  1886. let arr = [];
  1887. let functions = this.functions;
  1888. for (let i = 0; i < functions.length; i++) {
  1889. let functionObj = this.functions[i];
  1890. let shadow = functionObj.shadow;
  1891. if(shadow){
  1892. arr.push(functionObj);
  1893. }
  1894. }
  1895. this.mqttPublish(2,this.deviceInfo,arr)
  1896. },
  1897. changeProp(key,val){
  1898. let item = null;
  1899. let obj = null;
  1900. let oneToMul = this.oneToMul;
  1901. if(key === "LockControl"){
  1902. this.lock.value = val;
  1903. item = this.lock;
  1904. }else if(key === "PowerControl"){
  1905. this.power.value = val;
  1906. item = this.power;
  1907. }
  1908. let value = val;
  1909. obj = item.item;
  1910. if(value){
  1911. obj.value = 1;
  1912. obj.shadow = 1;
  1913. }else{
  1914. obj.value = 0;
  1915. obj.shadow = 0;
  1916. }
  1917. if(!oneToMul){
  1918. }
  1919. this.publishThingsModel(this.deviceInfo,obj);
  1920. },
  1921. checkCommonProp(item){
  1922. let id =item.id;
  1923. let isCommonKey = this.modelKey.some(res=>{
  1924. return id === res;
  1925. })
  1926. return !isCommonKey;
  1927. },
  1928. getRunTime(){
  1929. let self = this;
  1930. getDeviceRunTime(this.id).then(res=>{
  1931. self.timeobj = res.data;
  1932. if(self.timeobj.avgtime == ""){
  1933. self.timeobj.avgtime = 0;
  1934. }
  1935. if(self.timeobj.alltime == ""){
  1936. self.timeobj.alltime = 0;
  1937. }
  1938. })
  1939. },
  1940. seeTime(){
  1941. this.showTimeDlg = true;
  1942. this.getRunTime();
  1943. },
  1944. closeTime(){
  1945. this.showTimeDlg = false;
  1946. },
  1947. cancel(){
  1948. this.showErrDlg = false;
  1949. },
  1950. reportError(){
  1951. this.showErrDlg = true;
  1952. },
  1953. doReportError(){
  1954. if(!this.errorMsg){
  1955. this.$modal.showToast('异常信息不能为空')
  1956. }else{
  1957. let self = this;
  1958. let errObj = {};
  1959. errObj.deviceId = this.deviceInfo.deviceId;
  1960. errObj.deviceName = this.deviceInfo.deviceName
  1961. errObj.desc = this.errorMsg;
  1962. errObj.deptId= this.deviceInfo.deptId;
  1963. reportError(errObj).then(res=>{
  1964. self.$modal.showToast(res.msg)
  1965. self.cancel();
  1966. })
  1967. }
  1968. },
  1969. openLocation(){
  1970. uni.openLocation({
  1971. latitude: this.location.latitude,
  1972. longitude: this.location.longitude,
  1973. success: function () {
  1974. console.log('success');
  1975. }
  1976. });
  1977. },
  1978. confirmItemData(e){
  1979. let data = e.value[0];
  1980. this.show.text = data.text;
  1981. this.show.shadow=data.value;
  1982. this.show = null;
  1983. console.log(data);
  1984. },
  1985. send(){
  1986. let shadow = false
  1987. let _arr = []
  1988. this.inputProp.forEach((item)=>{
  1989. _arr.push(item.value)
  1990. })
  1991. // if(_arr.some(val => val === '' || val.length < 0)){
  1992. // shadow = true
  1993. // }
  1994. if(this.deviceInfo.status != 3){
  1995. uni.showToast({
  1996. title:"设备暂未上线",
  1997. icon:"error"
  1998. })
  1999. return;
  2000. }
  2001. if(shadow){
  2002. uni.showToast({
  2003. title:"数据不能为空",
  2004. icon:"error"
  2005. })
  2006. return;
  2007. }
  2008. this.publishThingsModel(this.deviceInfo,this.inputProp.map(item=>{return{"id":item.id,"value":item.value}}))
  2009. },
  2010. /** 更新设备状态 */
  2011. updateDeviceStatus(device) {
  2012. },
  2013. chooseItemData(data){
  2014. if(this.deviceInfo.status != 3){
  2015. uni.showToast({
  2016. title:"设备暂未上线",
  2017. icon:"error"
  2018. })
  2019. return;
  2020. }
  2021. this.columns = [data.enumList];
  2022. this.show =data;
  2023. },
  2024. getDetail(){
  2025. let self = this;
  2026. getDetail(this.id).then(res=>{
  2027. self.deviceInfo = res.data;
  2028. self.deviceType = res.data.type;
  2029. let productId = self.deviceInfo.productId;
  2030. if(productId === 57){
  2031. self.boardType = 5;
  2032. }
  2033. let online = self.deviceInfo.status == 3?true:false;
  2034. if(!online){
  2035. if(!self.onlineStatus){
  2036. uni.showModal({
  2037. title: '系统提示',
  2038. content: "设备未在线,无法操作",
  2039. confirmText: '确定',
  2040. showCancel:false,
  2041. success(res){
  2042. if(res.confirm){
  2043. self.onlineStatus = true;
  2044. }
  2045. },
  2046. })
  2047. }
  2048. }
  2049. console.log("当前设备类型:"+JSON.stringify(self.deviceInfo.type))
  2050. self.location = {
  2051. latitude: self.deviceInfo.latitude,
  2052. longitude: self.deviceInfo.longitude};
  2053. self.sysDept = self.deviceInfo.sysDept;
  2054. self.parseSummay(res.data.summary)
  2055. self.mqttSubscribe(res.data);
  2056. self.getDeviceStatus();
  2057. self.seeTime();
  2058. let heng = false;
  2059. self.productImage = self.imgUrl+'/detail/product.png'
  2060. if(self.deviceType == 4 ||self.deviceType == 5 ){
  2061. self.secondMachine = true;
  2062. }
  2063. if(self.deviceType == 5){
  2064. self.thirdMachine = true;
  2065. }
  2066. if(self.deviceType == 1 || self.deviceType == 7){
  2067. self.forthMachine = false;
  2068. self.productImage = self.imgUrl+'/product/YJH20.png'
  2069. }
  2070. let typeArr = [7,8,9,10,11,12];
  2071. for (let i = 0; i < typeArr.length; i++) {
  2072. let typeMa = typeArr[i];
  2073. if(typeMa == self.deviceType){
  2074. self.forthMachine = false;
  2075. }
  2076. }
  2077. self.fixImage(heng);
  2078. self.$forceUpdate();
  2079. });
  2080. },
  2081. getDeviceStatus(func){
  2082. let self = this;
  2083. if(this.summary.length>1){
  2084. }else{
  2085. this.childId = 0;
  2086. }
  2087. uni.showLoading({title:"加载中"});
  2088. getDeviceStatus(this.id,this.childId).then(res=>{
  2089. let data =res.data;
  2090. this.deviceInfo = data;
  2091. self.parseStatusData(data)
  2092. setTimeout(function () {
  2093. uni.hideLoading();
  2094. if(typeof func == "function"){
  2095. func();
  2096. }
  2097. },50);
  2098. });
  2099. },
  2100. getNewDeviceStatus(item){
  2101. console.log(item);
  2102. let self = this;
  2103. if(item.index == 0){
  2104. this.firstTab = true;
  2105. this.getDeviceStatus();
  2106. }
  2107. if(item.index == 1){
  2108. this.firstTab = false;
  2109. getDeviceStatus(this.id,0).then(res=>{
  2110. let data =res.data;
  2111. this.deviceInfo = data;
  2112. self.parseStatusData(data)
  2113. });
  2114. }
  2115. },
  2116. changeSub(item){
  2117. this.childId = item.id;
  2118. this.getDeviceStatus()
  2119. },
  2120. parseEnumList(flag){
  2121. let enumList = this.deviceInfo.enumList;
  2122. for (let enumListElement of enumList) {
  2123. let id = enumListElement.id;
  2124. if(id == 'LockControl'){
  2125. let shadow = enumListElement.shadow;
  2126. this.lock.item = enumListElement;
  2127. if(shadow == 1){
  2128. this.lock.value = true;
  2129. this.lock.loading = false;
  2130. }else if(shadow == 0){
  2131. this.lock.value = false;
  2132. this.lock.loading = false;
  2133. }else{
  2134. this.lock.loading = true;
  2135. }
  2136. }
  2137. if(id == 'PowerControl'){
  2138. let shadow = enumListElement.shadow;
  2139. if(this.oneToMul){
  2140. if(!this.firstTab){
  2141. if(shadow == 1){
  2142. this.decoctControlOnOffStatus = true;
  2143. }else if(shadow == 0){
  2144. this.decoctControlOnOffStatus = false;
  2145. }
  2146. }
  2147. }else{
  2148. if(shadow == 1){
  2149. this.decoctControlOnOffStatus = true;
  2150. }else if(shadow == 0){
  2151. this.decoctControlOnOffStatus = false;
  2152. }
  2153. }
  2154. }
  2155. if(id == 'PowerCtl'){
  2156. if(this.oneToMul && this.firstTab){
  2157. let shadow = enumListElement.shadow;
  2158. if(shadow == 1){
  2159. this.decoctControlOnOffStatus = true;
  2160. }else if(shadow == 0){
  2161. this.decoctControlOnOffStatus = false;
  2162. }
  2163. }
  2164. }
  2165. this.formatValue(id,enumListElement,"PackagePowerControl","packageControlOnOffStatus")
  2166. this.formatValue(id,enumListElement,"DecoctingSwitch","decoctControlStatus")
  2167. this.formatValue(id,enumListElement,"CarrybagSwitch","qitingTurn")
  2168. this.formatValue(id,enumListElement,"WashSwitch","qingxiTurn")
  2169. this.formatValue(id,enumListElement,"PackageSwitch","baozhuangTurn");
  2170. //pressTurn resetTurn
  2171. if(!flag){
  2172. if(id == 'PressTurn'){
  2173. let shadow = enumListElement.shadow;
  2174. if(!shadow){
  2175. shadow = 0;
  2176. }
  2177. if(shadow == 1){
  2178. this.pressTurn = 1;
  2179. this.resetTurn = 0;
  2180. }
  2181. }
  2182. if(id == 'ResetTurn'){
  2183. let shadow = enumListElement.shadow;
  2184. if(!shadow){
  2185. shadow = 0;
  2186. }
  2187. if(shadow == 1){
  2188. this.resetTurn = 1;
  2189. this.pressTurn = 0;
  2190. }
  2191. }
  2192. }
  2193. if(id == 'WorkMode'){
  2194. let shadow = enumListElement.shadow;
  2195. if(!shadow){
  2196. shadow = 1;
  2197. }
  2198. this.workMode = shadow;
  2199. }
  2200. let shadow = enumListElement.shadow
  2201. let valueList = enumListElement.enumList;
  2202. for (let valueObj of valueList){
  2203. if(valueObj.value == shadow){
  2204. enumListElement.text = valueObj.text;
  2205. }
  2206. }
  2207. }
  2208. },
  2209. formatValue(id,enumListElement,key,propkey){
  2210. if(id == key){
  2211. let shadow = enumListElement.shadow;
  2212. if(shadow == 1){
  2213. this[propkey] = true;
  2214. }else if(shadow == 0){
  2215. this[propkey] = false;
  2216. }
  2217. }
  2218. },
  2219. parseStatusData(data){
  2220. let self = this;
  2221. cacheJsonThingsModel(data.productId).then(res=>{
  2222. let thingsModel = JSON.parse(res.data);
  2223. let arr = [];
  2224. let arrayList = data.arrayList;
  2225. arr = arr.concat(arrayList);
  2226. let enumList = data.enumList;
  2227. arr = arr.concat(enumList);
  2228. let integerList = data.integerList;
  2229. arr = arr.concat(integerList);
  2230. let stringList = data.stringList;
  2231. arr = arr.concat(stringList);
  2232. self.inputProp = arr;
  2233. for (let i = 0; i < thingsModel.functions.length; i++) {
  2234. for (let j = 0; j < arr.length; j++) {
  2235. let model = arr[j];
  2236. if(model.id == thingsModel.functions[i].id){
  2237. self.functions.push(model);
  2238. }
  2239. }
  2240. }
  2241. for (let i = 0; i < thingsModel.properties.length; i++) {
  2242. for (let j = 0; j < arr.length; j++) {
  2243. let model = arr[j];
  2244. if(model.id == thingsModel.properties[i].id){
  2245. self.properties.push(model);
  2246. }
  2247. }
  2248. }
  2249. let readOnlyList = data.readOnlyList;
  2250. self.watchProp = readOnlyList;
  2251. self.parseEnumList();
  2252. self.parseProp();
  2253. self.checkJianyao();
  2254. })
  2255. },
  2256. showJianyao(){
  2257. this.calcuStep();
  2258. this.planIngPopDlg = true;
  2259. },
  2260. parseProp(){
  2261. let self = this;
  2262. for (let i = 0; i <self.inputProp.length; i++) {
  2263. let prop = self.inputProp[i];
  2264. let value = prop.shadow||0;
  2265. let id = prop.id;
  2266. if(id === "TimeSetting"){//温度设置
  2267. self.temperatureTime = value;
  2268. }
  2269. if(!self.jianyaoWenduSetting){
  2270. if(id === "TempSetting"){
  2271. self.temperature = value;
  2272. }
  2273. }
  2274. this.setPropValue(id,"SlowfireTiem","leftJianyaoTime",value,0)
  2275. this.setPropValue(id,"HighTempTime","hightTemperature",value,0)
  2276. this.setPropValue(id,"CurrentTemp","currentTemperature",value,0)
  2277. this.setPropValue(id,"CalibrationTemp","jiaozhunTemp",value,0)
  2278. this.setPropValue(id,"PackingVolume","packageVolume",value,50)
  2279. this.setPropValue(id,"PackageQuantity","packageNumber",value,1)
  2280. //封边温度
  2281. this.setPropValue(id,"BandingTemp","edegTemperature",value);
  2282. this.setPropValue(id,"BandingTemp","tempFengBianWendu",value)
  2283. //封口温度
  2284. this.setPropValue(id,"SealTemp","sealingTemperature",value);
  2285. this.setPropValue(id,"SealTemp","tempFengKouWendu",value)
  2286. this.setPropValue(id,"LeftAppointmentTime","leftAppointmentTime",value,0)
  2287. this.setPropValue(id,"ValidCurrent","validCurrent",value,0)
  2288. this.setPropValue(id,"TurnCurrent","turnCurrent",value,0)
  2289. self.propMap[id] = prop;
  2290. }
  2291. },
  2292. setPropValue(id,key,propKey,value,defaultValue){
  2293. if(!value && defaultValue){
  2294. value = defaultValue;
  2295. }
  2296. if(id === key){
  2297. this[propKey] = value;
  2298. }
  2299. },
  2300. parseSummay(summary){
  2301. let self = this;
  2302. if(!summary){
  2303. summary = "";
  2304. }
  2305. if(summary.length>0){
  2306. this.summary = JSON.parse(summary);
  2307. if(self.summary.length>0){
  2308. this.oneToMul = true;
  2309. for (let i = 0; i < self.summary.length; i++) {
  2310. self.summary[i].tabName = self.summary[i].name
  2311. }
  2312. let childId = "";
  2313. if(this.oneToMul){
  2314. this.childId = self.summary[0].id;
  2315. }
  2316. }else{
  2317. this.summary = [{name:"煎药机一"}]
  2318. }
  2319. }else{
  2320. this.summary = [{name:"煎药机一"}]
  2321. }
  2322. },
  2323. goDeviceDetail(id){
  2324. uni.navigateTo({
  2325. url: '/pages/device/detail/detail?id='+id
  2326. });
  2327. },
  2328. async connectMqtt() {
  2329. if (this.$mqttTool.client == null) {
  2330. await this.$mqttTool.connect(this.vuex_token);
  2331. }
  2332. this.mqttCallback();
  2333. this.startCheck();
  2334. },
  2335. /** Mqtt订阅主题 */
  2336. mqttSubscribe(device) {
  2337. // 订阅当前设备状态和实时监测
  2338. let topicStatus = '/' + device.productId + '/' + device.serialNumber + '/status/post';
  2339. let topicProperty = '/' + device.productId + '/' + device.serialNumber + '/property/post';
  2340. let topicFunction = '/' + device.productId + '/' + device.serialNumber + '/function/post';
  2341. let topics = [];
  2342. topics.push(topicStatus);
  2343. topics.push(topicProperty);
  2344. topics.push(topicFunction);
  2345. this.$mqttTool.subscribe(topics);
  2346. },
  2347. /** Mqtt取消订阅主题 */
  2348. mqttUnSubscribe(device) {
  2349. // 订阅当前设备状态和实时监测
  2350. let topicStatus = '/' + device.productId + '/' + device.serialNumber + '/status/post';
  2351. let topicProperty = '/' + device.productId + '/' + device.serialNumber + '/property/post';
  2352. let topicFunction = '/' + device.productId + '/' + device.serialNumber + '/function/post';
  2353. let topics = [];
  2354. topics.push(topicStatus);
  2355. topics.push(topicProperty);
  2356. topics.push(topicFunction);
  2357. console.log('取消订阅', topics);
  2358. this.$mqttTool.unsubscribe(topics);
  2359. },
  2360. /* Mqtt回调处理 */
  2361. mqttCallback() {
  2362. this.$mqttTool.client.on('message', (topic, message, buffer) => {
  2363. let topics = topic.split('/');
  2364. let productId = topics[1];
  2365. let deviceNum = topics[2];
  2366. console.log('接收到内容:'+message);
  2367. message = JSON.parse(message.toString());
  2368. if (topics[3] == 'status') {
  2369. console.log('接收到【设备状态-运行】主题:', topic);
  2370. console.log('接收到【设备状态-运行】内容:', message);
  2371. // 更新列表中设备的状态
  2372. if (this.deviceInfo.serialNumber == deviceNum) {
  2373. this.deviceInfo.status = message.status;
  2374. this.deviceInfo.isShadow = message.isShadow;
  2375. this.deviceInfo.rssi = message.rssi;
  2376. this.updateDeviceStatus(this.deviceInfo);
  2377. }
  2378. }
  2379. if (topics[3] == 'property' || topics[3] == 'function') {
  2380. console.log('接收到【物模型】主题:', topic);
  2381. console.log('接收到【物模型】内容:', message);
  2382. if(this.oneToMul){
  2383. let curTabId = this.childId;
  2384. let msg = [];
  2385. for (let i = 0; i < message.length; i++) {
  2386. let curMsg = message[i];
  2387. let id = curMsg.id;
  2388. let ids = id.split("_");
  2389. let value = curMsg.value;
  2390. if(ids.length == 2){
  2391. if(curTabId == ids[1]){
  2392. msg.push({id:ids[0],value:value});
  2393. }
  2394. }else{
  2395. msg.push(curMsg);
  2396. }
  2397. }
  2398. message = msg;
  2399. }
  2400. // 更新列表中设备的属性
  2401. if (this.deviceInfo.serialNumber == deviceNum) {
  2402. for (let j = 0; j < message.length; j++) {
  2403. let isComplete = false;
  2404. let msgId = message[j].id;
  2405. this.exchangeData(msgId,message[j]);
  2406. // 布尔类型
  2407. for (let k = 0; k < this.deviceInfo.boolList.length && !isComplete; k++) {
  2408. if (this.deviceInfo.boolList[k].id == message[j].id) {
  2409. this.deviceInfo.boolList[k].shadow = message[j].value;
  2410. isComplete = true;
  2411. break;
  2412. }
  2413. }
  2414. // 枚举类型
  2415. for (let k = 0; k < this.deviceInfo.enumList.length && !isComplete; k++) {
  2416. if (this.deviceInfo.enumList[k].id == message[j].id) {
  2417. this.deviceInfo.enumList[k].shadow = message[j].value;
  2418. isComplete = true;
  2419. break;
  2420. }
  2421. }
  2422. // 字符串类型
  2423. for (let k = 0; k < this.deviceInfo.stringList.length && !isComplete; k++) {
  2424. if (this.deviceInfo.stringList[k].id == message[j].id) {
  2425. this.deviceInfo.stringList[k].shadow = message[j].value;
  2426. isComplete = true;
  2427. break;
  2428. }
  2429. }
  2430. // 数组类型
  2431. for (let k = 0; k < this.deviceInfo.arrayList.length && !isComplete; k++) {
  2432. if (this.deviceInfo.arrayList[k].id == message[j].id) {
  2433. this.deviceInfo.arrayList[k].shadow = message[j].value;
  2434. isComplete = true;
  2435. break;
  2436. }
  2437. }
  2438. // 整数类型
  2439. for (let k = 0; k < this.deviceInfo.integerList.length && !isComplete; k++) {
  2440. if (this.deviceInfo.integerList[k].id == message[j].id) {
  2441. this.deviceInfo.integerList[k].shadow = message[j].value;
  2442. isComplete = true;
  2443. break;
  2444. }
  2445. }
  2446. // 小数类型
  2447. for (let k = 0; k < this.deviceInfo.decimalList.length && !isComplete; k++) {
  2448. if (this.deviceInfo.decimalList[k].id == message[j].id) {
  2449. this.deviceInfo.decimalList[k].shadow = message[j].value;
  2450. isComplete = true;
  2451. break;
  2452. }
  2453. }
  2454. // 监测数据
  2455. for (let k = 0; k < this.deviceInfo.readOnlyList.length && !isComplete; k++) {
  2456. if (this.deviceInfo.readOnlyList[k].id == message[j].id) {
  2457. this.deviceInfo.readOnlyList[k].shadow = message[j].value;
  2458. // 更新图表
  2459. // for (let m = 0; m < this.monitorChart.length; m++) {
  2460. // if (message[j].id == this.monitorChart[m].data.id) {
  2461. // let data = [{
  2462. // value: message[j].value,
  2463. // name: this.monitorChart[m].data.name
  2464. // }];
  2465. // this.monitorChart[m].chart.setOption({
  2466. // series: [{
  2467. // data: data
  2468. // }]
  2469. // });
  2470. // break;
  2471. // }
  2472. // }
  2473. isComplete = true;
  2474. break;
  2475. }
  2476. }
  2477. }
  2478. this.parseEnumList(true);
  2479. this.checkJianyao();
  2480. if(this.planIngPopDlg){
  2481. this.calcuStep();
  2482. }
  2483. }
  2484. this.$forceUpdate();
  2485. }
  2486. });
  2487. },
  2488. checkJianyao(){
  2489. // if(!this.jianyaoPopClose){
  2490. // return;
  2491. // }
  2492. // let self = this;
  2493. // setTimeout(function(){
  2494. // if(self.decoctControlStatus){
  2495. // self.showJianyao();
  2496. // }
  2497. // },1000);
  2498. },
  2499. exchangeData(msgId,obj){
  2500. if(msgId === "TempSetting"){
  2501. this.temperature = obj.value;
  2502. }
  2503. if(msgId === "TimeSetting"){
  2504. this.temperatureTime = obj.value;
  2505. }
  2506. if(msgId === "CurrentTemp"){
  2507. this.currentTemperature = obj.value;
  2508. }
  2509. if(msgId === "HighTempTime"){
  2510. this.hightTemperature = obj.value;
  2511. }
  2512. if(msgId === "SealTemp"){//封口温度
  2513. if(!this.editing){
  2514. if(this.baozhuangFengkouSetting){
  2515. this.tempFengkouWendu = obj.value;
  2516. }else{
  2517. this.sealingTemperature = obj.value;
  2518. }
  2519. }
  2520. }
  2521. if(msgId === "BandingTemp"){//封边温度
  2522. if(!this.editing){
  2523. if(this.baozhuangFengbianSetting){
  2524. this.tempFengBianWendu = obj.value;
  2525. }else{
  2526. this.edegTemperature = obj.value;
  2527. }
  2528. }
  2529. }
  2530. if(msgId === "PackingVolume"){
  2531. if(!this.editing){
  2532. if(this.baozhuangRongLiangSetting){
  2533. }else{
  2534. this.packageVolume = obj.value;
  2535. }
  2536. }
  2537. }
  2538. if(msgId === "PackageQuantity"){
  2539. if(!this.editing){
  2540. if(this.baozhuangShuLIangSetting){
  2541. }else{
  2542. this.packageNumber = obj.value;
  2543. }
  2544. }
  2545. }
  2546. if(msgId === "LeftAppointmentTime"){
  2547. this.leftAppointmentTime = obj.value;
  2548. }
  2549. if(msgId === "SlowfireTiem"){
  2550. this.leftJianyaoTime = obj.value;
  2551. }
  2552. if(msgId === "CalibrationTemp"){
  2553. this.jiaozhunTemp = obj.value;
  2554. }
  2555. if(msgId === "TurnCurrent"){
  2556. this.turnCurrent = obj.value;
  2557. }
  2558. if(msgId === "ValidCurrent"){
  2559. this.validCurrent = obj.value;
  2560. }
  2561. },
  2562. /** 发布物模型 类型(1=属性,2=功能) */
  2563. publishThingsModel(device, model) {
  2564. // 获取缓存的Json物模型
  2565. cacheJsonThingsModel(device.productId).then(response => {
  2566. let thingsModel = JSON.parse(response.data);
  2567. let type = 0;
  2568. for (let i = 0; i < thingsModel.functions.length; i++) {
  2569. if (model.id == thingsModel.functions[i].id) {
  2570. type = 2;
  2571. break;
  2572. }
  2573. }
  2574. if (type == 0) {
  2575. for (let i = 0; i < thingsModel.properties.length; i++) {
  2576. if (model.id == thingsModel.properties[i].id) {
  2577. type = 1;
  2578. break;
  2579. }
  2580. }
  2581. }
  2582. if (type != 0) {
  2583. this.mqttPublish(type, device, [model]);
  2584. }
  2585. });
  2586. },
  2587. notifyError(res){
  2588. uni.showToast({
  2589. title:res,
  2590. icon:"error"
  2591. })
  2592. },
  2593. notifySuccess(res){
  2594. uni.showToast({
  2595. title:res,
  2596. icon:"success"
  2597. })
  2598. },
  2599. getDownloadUrl(path){
  2600. return this.firmware.downUrl +"/iot/tool/download?fileName="+ path;
  2601. },
  2602. /**
  2603. * Mqtt发布消息
  2604. * @type 类型(1=属性,2=功能,3=OTA升级,4=实时监测)
  2605. * @device 设备
  2606. * @model 物模型
  2607. * */
  2608. mqttPublish(type, device, modelList,needMore) {
  2609. if(this.deviceInfo.status != 3){
  2610. this.notifyError("请等待设备上线后操作")
  2611. return;
  2612. }
  2613. if(modelList.length == 0){
  2614. return;
  2615. }
  2616. let topic = "";
  2617. let message = ""
  2618. let oneToMul = false;
  2619. if(this.summary.length>1){
  2620. oneToMul = true;
  2621. }
  2622. if(!needMore){
  2623. oneToMul = false;
  2624. }
  2625. if(this.firstTab){
  2626. let isKaijiKey = false;
  2627. if(modelList.length >0){
  2628. let modelData = modelList[0];
  2629. let curKeyId = modelData.id;
  2630. if(!this.decoctControlOnOffStatus){
  2631. if(oneToMul){
  2632. if(curKeyId == 'PowerCtl'){
  2633. isKaijiKey = true;
  2634. }
  2635. }else{
  2636. if(curKeyId == 'PowerControl'){
  2637. isKaijiKey = true;
  2638. }
  2639. }
  2640. }else{
  2641. isKaijiKey = true;
  2642. }
  2643. }
  2644. if(!isKaijiKey){
  2645. this.notifyError("请先开机后再进行操作")
  2646. return;
  2647. }
  2648. }else{
  2649. let isKaijiKey = false;
  2650. if(modelList.length >0){
  2651. let modelData = modelList[0];
  2652. let curKeyId = modelData.id;
  2653. if(!this.packageControlOnOffStatus){
  2654. if(curKeyId == 'PackagePowerControl'){
  2655. isKaijiKey = true;
  2656. }
  2657. }else{
  2658. isKaijiKey = true;
  2659. }
  2660. }
  2661. if(!isKaijiKey){
  2662. this.notifyError("请先开机后再进行操作")
  2663. return;
  2664. }
  2665. }
  2666. if (type == 1) {
  2667. if (device.status == 3) {
  2668. // 属性,在线模式
  2669. topic = "/" + device.productId + "/" + device.serialNumber + "/property-online/get";
  2670. }
  2671. } else if (type == 2) {
  2672. if (device.status == 3) {
  2673. // 功能,在线模式
  2674. topic = "/" + device.productId + "/" + device.serialNumber + "/function-online/get";
  2675. }
  2676. } else if (type == 3) {
  2677. // OTA升级
  2678. topic = "/" + device.productId + "/" + device.serialNumber + "/ota/get";
  2679. } else {
  2680. return;
  2681. }
  2682. let title = "";
  2683. if(type == 1){
  2684. title = "属性";
  2685. }else if(type == 2){
  2686. title = "功能";
  2687. }else if(type == 3){
  2688. title = "升级";
  2689. }
  2690. if (topic != "") {
  2691. // 发布
  2692. let arr = [];
  2693. for (let i = 0; i <modelList.length; i++) {
  2694. let model = modelList[i];
  2695. let modelId = model.id;
  2696. if(oneToMul){
  2697. let childId = this.childId;
  2698. if(childId){
  2699. modelId = modelId+"_"+childId;
  2700. }
  2701. }
  2702. let shadow = model.shadow+"";
  2703. let modelType = model.type;
  2704. let shadowInt = parseInt(shadow,10);
  2705. let isNumber = false;
  2706. let shadowStr = shadowInt+"";
  2707. if(shadowStr === shadow){
  2708. isNumber = true;
  2709. shadow = shadowInt;
  2710. }
  2711. if(modelType == "integer" && !isNumber){
  2712. this.$modal.showToast(model.name+'的值必须是数字类型')
  2713. return;
  2714. }
  2715. arr.push({id:modelId,value:shadow+""});
  2716. }
  2717. message = JSON.stringify(arr);
  2718. let self = this;
  2719. this.$mqttTool.publish(topic, message,title).then(res => {
  2720. this.notifySuccess(res);
  2721. }).catch(res => {
  2722. this.notifyError(res);
  2723. });
  2724. }
  2725. },
  2726. startCheck(){
  2727. let self = this;
  2728. this.checkTimer = setTimeout(function (){
  2729. self.sendHeart();
  2730. self.startCheck();
  2731. },20000);
  2732. },
  2733. checkActive(){
  2734. let self = this;
  2735. setTimeout(function (){
  2736. if(self.publishMsg){
  2737. self.resetConn()
  2738. }
  2739. },3000);
  2740. },
  2741. sendHeart(){
  2742. console.log("发送心跳111")
  2743. let device = this.deviceInfo;
  2744. let self = this;
  2745. let topic = "/property-offline/post";
  2746. self.publishMsg = true;
  2747. self.checkActive();
  2748. this.$mqttTool.publish(topic, "ok", "heart").then(res => {
  2749. self.publishMsg = false;
  2750. }).catch(res => {
  2751. self.publishMsg = false;
  2752. });
  2753. },
  2754. resetConn(){
  2755. console.log("检测异常,重连")
  2756. this.$mqttTool.end();
  2757. this.$mqttTool.client = null;
  2758. this.connectMqtt();
  2759. this.getDetail();
  2760. }
  2761. }
  2762. }
  2763. </script>
  2764. <style>
  2765. .send_btn{
  2766. width: 160rpx !important;
  2767. height: 40rpx !important;
  2768. font-size: 10px !important;
  2769. margin-top: 5px;
  2770. }
  2771. uni-col{
  2772. width: 150px;
  2773. }
  2774. .header{
  2775. width: 100%;
  2776. background: white;
  2777. padding:0px 20rpx;
  2778. position: relative;
  2779. height: 100vh;
  2780. position: relative;
  2781. }
  2782. .content {
  2783. display: flex;
  2784. align-items: center;
  2785. justify-content: center;
  2786. color: #060B25;
  2787. }
  2788. .logo {
  2789. height: 200rpx;
  2790. width: 200rpx;
  2791. margin-top: 200rpx;
  2792. margin-left: auto;
  2793. margin-right: auto;
  2794. margin-bottom: 50rpx;
  2795. }
  2796. .text-area {
  2797. margin:10px;
  2798. padding-bottom: 10px;
  2799. justify-content: center;
  2800. width: 100%;
  2801. }
  2802. .grid-text {
  2803. font-size: 14px;
  2804. color: #909399;
  2805. padding: 10rpx 0 20rpx 0rpx;
  2806. /* #ifndef APP-PLUS */
  2807. box-sizing: border-box;
  2808. /* #endif */
  2809. }
  2810. .title {
  2811. font-size: 36rpx;
  2812. color: #8f8f94;
  2813. }
  2814. .item{
  2815. height: 80rpx;
  2816. line-height: 80rpx;
  2817. }
  2818. .bg{
  2819. position: relative;
  2820. }
  2821. .text-left{
  2822. color: #8A92A5;
  2823. }
  2824. .text-right{
  2825. color: #545454;
  2826. }
  2827. .prop-text{
  2828. position: relative;
  2829. margin:20rpx 0;
  2830. font-size: 26rpx;
  2831. }
  2832. .prop-card-area{
  2833. }
  2834. .prop-card{
  2835. width: 28%;
  2836. height: 100rpx;
  2837. text-align: center;
  2838. display: inline-block;
  2839. background: #F5FCFF;
  2840. box-shadow: 0px 9rpx 8rpx 0px rgba(0,0,0,0.09);
  2841. border-radius: 8rpx;
  2842. margin:0px 15rpx;
  2843. line-height: 48rpx;
  2844. }
  2845. .prop-card-top{
  2846. color: #3E9CFC;
  2847. }
  2848. .prop-card-bottom{
  2849. color: #8A92A5;
  2850. }
  2851. .tab-area {
  2852. background: white;
  2853. position: absolute;
  2854. left: 0px;
  2855. right: 0px;
  2856. top:480rpx;
  2857. bottom:-20px;
  2858. min-height: 200rpx;
  2859. box-shadow: 0rpx 5rpx 27rpx 0rpx rgba(195, 195, 195, 0.4);
  2860. border-radius: 40rpx;
  2861. overflow-y: auto;
  2862. padding-bottom:80rpx;
  2863. }
  2864. .prop-item{
  2865. position: relative;
  2866. display: flex;
  2867. flex-direction: row;
  2868. height: 100rpx;
  2869. line-height: 100rpx;
  2870. margin:0 20rpx;
  2871. }
  2872. .prop-item-left{
  2873. color: #545454;
  2874. width: 100%;
  2875. font-size: 16px;
  2876. border-bottom: 1px solid lightgray;
  2877. margin-left: 120rpx;
  2878. }
  2879. .prop-item-image{
  2880. width: 120rpx;
  2881. height: 120rpx;
  2882. position: absolute;
  2883. bottom:-10rpx;
  2884. }
  2885. .prop-item-right{
  2886. position: absolute;
  2887. right:10rpx;
  2888. top:5rpx;
  2889. }
  2890. input::-webkit-input-placeholder,textarea::-webkit-input-placeholder{
  2891. color:#666;
  2892. font-size:12px;
  2893. }
  2894. .clearfix::after {
  2895. content: "";
  2896. display: block;
  2897. clear: both;
  2898. }
  2899. .decoctControlHeader {
  2900. display: flex;
  2901. align-items: center;
  2902. font-weight: 600;
  2903. }
  2904. .decoctControlTop {
  2905. display: flex;
  2906. height: 240rpx;
  2907. border-bottom:1px #B2B2B2 dotted;
  2908. margin:0 40rpx;
  2909. }
  2910. .decoctControlTopLeft {
  2911. width:40%;
  2912. line-height: 2;
  2913. text-align: center;
  2914. margin: 0 15px;
  2915. position: relative;
  2916. }
  2917. .addTemperature {
  2918. border-radius:5px;
  2919. position:absolute;
  2920. background-color: dodgerblue;
  2921. color:white;
  2922. width: 30px;
  2923. height: 30px;
  2924. left:15px;
  2925. top:80px;
  2926. }
  2927. .addTemperatureBtn {
  2928. border-radius:10px;
  2929. position:absolute;
  2930. clip-path: polygon(50% 0,100% 100%,0 100%);
  2931. transform: scale(0.5);
  2932. left: 0;
  2933. top:0;
  2934. bottom: 0;
  2935. right: 0;
  2936. margin: auto;
  2937. }
  2938. .subTemperature {
  2939. border-radius:5px;
  2940. position:absolute;
  2941. background-color: dodgerblue;
  2942. color:white;
  2943. width: 30px;
  2944. height: 30px;
  2945. right:15px;
  2946. top:80px;
  2947. }
  2948. .subTemperatureBtn {
  2949. border-radius:10px;
  2950. position:absolute;
  2951. clip-path: polygon(50% 0,100% 100%,0 100%);
  2952. transform: scale(0.5);
  2953. left: 0;
  2954. top:0;
  2955. bottom: 0;
  2956. right: 0;
  2957. margin: auto;
  2958. }
  2959. .decoctControlTopRight {
  2960. width:40%;
  2961. line-height: 2;
  2962. text-align: center;
  2963. margin: 0 15px;
  2964. position: relative;
  2965. }
  2966. .decoctControlBottom {
  2967. border-bottom:1px #B2B2B2 dotted;
  2968. width:91vw;
  2969. margin:0 auto;
  2970. padding:10px;
  2971. display: flex;
  2972. justify-content:space-between;
  2973. align-items: center;
  2974. }
  2975. .addTime {
  2976. border-radius:5px;
  2977. position:absolute;
  2978. background-color: dodgerblue;
  2979. color:white;
  2980. width: 30px;
  2981. height: 30px;
  2982. left:15px;
  2983. top:80px;
  2984. }
  2985. .addTimeBtn {
  2986. border-radius:10px;
  2987. position:absolute;
  2988. clip-path: polygon(50% 0,100% 100%,0 100%);
  2989. transform: scale(0.5);
  2990. left: 0;
  2991. top:0;
  2992. bottom: 0;
  2993. right: 0;
  2994. margin: auto;
  2995. }
  2996. .subTime {
  2997. border-radius:5px;
  2998. position:absolute;
  2999. background-color: dodgerblue;
  3000. color:white;
  3001. width: 30px;
  3002. height: 30px;
  3003. right:15px;
  3004. top:80px;
  3005. }
  3006. .subTimeBtn {
  3007. border-radius:10px;
  3008. position:absolute;
  3009. clip-path: polygon(50% 0,100% 100%,0 100%);
  3010. transform: scale(0.5);
  3011. left: 0;
  3012. top:0;
  3013. bottom: 0;
  3014. right: 0;
  3015. margin: auto;
  3016. }
  3017. .packageControlBottomRight {
  3018. border-radius:5px;
  3019. padding:5px 10px;
  3020. margin-right: 15px;
  3021. background-color: #3c9cff;
  3022. color: #fff;
  3023. }
  3024. .packageControlBottomClear {
  3025. border-radius:5px;
  3026. padding:5px 10px;
  3027. background-color: #B2B2B2;
  3028. color: #fff;
  3029. }
  3030. .active_btn{
  3031. background-color: #3c9cff;
  3032. }
  3033. .baozhuang-sub{
  3034. right: 10rpx !important;
  3035. }
  3036. .baozhuang-add{
  3037. left: 6rpx !important;
  3038. }
  3039. .control-input-box{
  3040. display: flex;
  3041. flex-direction: row;
  3042. padding-left: 26rpx;
  3043. }
  3044. .control-input-box-danwei{
  3045. padding-top:12rpx;
  3046. margin-left:4rpx;
  3047. }
  3048. .tabs{
  3049. position: relative;
  3050. top:15vh;
  3051. }
  3052. .child_tab{
  3053. position: relative;
  3054. display: inline-block;
  3055. width: 25%;
  3056. height: 180rpx;
  3057. }
  3058. .child_img{
  3059. width: 50rpx;
  3060. height: 50rpx;
  3061. left: 66rpx;
  3062. top: 66rpx;
  3063. position: relative;
  3064. }
  3065. .child_title{
  3066. position: absolute;
  3067. left: 0px;
  3068. right: 0px;
  3069. text-align: center;
  3070. font-size: 12px;
  3071. bottom: -12rpx;
  3072. color: #060B25;
  3073. }
  3074. .control{
  3075. width: 100%;
  3076. position: relative;
  3077. }
  3078. .control_item{
  3079. position: relative;
  3080. width: 50%;
  3081. display: inline-block;
  3082. height: 150rpx;
  3083. }
  3084. .control_item_detail{
  3085. position: relative;
  3086. top:22rpx;
  3087. }
  3088. .control_item_left{
  3089. position:absolute;;
  3090. left:22%;
  3091. font-size: 55px;
  3092. z-index: 999;
  3093. top:-30rpx
  3094. }
  3095. .control_item_center{
  3096. position:absolute;;
  3097. left:34%;
  3098. top:0vh;
  3099. }
  3100. .control_item_right{
  3101. position:absolute;;
  3102. left:67%;
  3103. font-size: 34px;
  3104. z-index: 999;
  3105. }
  3106. .control_item_center_unit{
  3107. position: absolute;
  3108. left:26vw;
  3109. top: 0.8vh;
  3110. width:200rpx;
  3111. }
  3112. .control_item_title{
  3113. position: absolute;
  3114. bottom:34rpx;
  3115. font-size: 12px;
  3116. width: 100%;
  3117. text-align: center;
  3118. }
  3119. .bottom{
  3120. height: 190rpx;
  3121. position: absolute;
  3122. left: 0px;
  3123. width: 100%;
  3124. padding-top: 18rpx;
  3125. }
  3126. .bottom_item{
  3127. display: inline-block;
  3128. width: 25%;
  3129. font-size: 12px;
  3130. height: 100%;
  3131. position: relative;
  3132. text-align: center;
  3133. margin-top: 2vh;
  3134. }
  3135. .active_on{
  3136. color: #50ACFF;
  3137. }
  3138. .status_info{
  3139. position: absolute;
  3140. left: 5vw;
  3141. top: 10vh;
  3142. }
  3143. .status_detail{
  3144. display: flex;
  3145. flex-direction: row;
  3146. }
  3147. .status_text{
  3148. font-size: 16px;
  3149. }
  3150. .online_text{
  3151. font-size: 12px;
  3152. padding-top: 3px;
  3153. }
  3154. .online{
  3155. color: #017128;
  3156. }
  3157. .device_info{
  3158. font-size: 13px;
  3159. }
  3160. .control_area{
  3161. position: relative;
  3162. top:19vh;
  3163. }
  3164. .disabled_tab{
  3165. opacity: 0.4;
  3166. }
  3167. .roate{
  3168. transform: rotate(180deg);
  3169. }
  3170. </style>