detail_6.vue 126 KB

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