detail.vue 105 KB

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