detail_6.vue 127 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096
  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 v-if="isH5" @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. isH5:false
  944. }
  945. },
  946. onLoad: function(opt) {
  947. this.id = opt.id;
  948. // this.id = 61;
  949. this.connectMqtt();
  950. this.getDetail();
  951. this.imgUrl = config.imgUrl
  952. this.fixStyle();
  953. this.setSystemInfo();
  954. // this.fixImage();
  955. // console.log = function(){}
  956. },
  957. destroyed() {
  958. // 取消订阅主题
  959. this.mqttUnSubscribe(this.deviceInfo);
  960. clearTimeout(this.checkTimer);
  961. },
  962. watch: {
  963. turnPercent(newvalue){
  964. // this.lineProgreeStyle = ""
  965. this.lineProgreeStyle = "width:"+newvalue+"%;background:#50ACFF;height: 100%;";
  966. },
  967. pressTurn(newVal,oldValue) {
  968. // this.pressTurnChangeEvent(newVal);
  969. },
  970. resetTurn(newVal){
  971. // this.resetTurnChnageEvent(newVal);
  972. },
  973. decoctControlStatus(newVal,oldValue){
  974. console.log(newVal+",煎药");
  975. this.setStatusText();
  976. },
  977. currentTemperature(newVal){
  978. console.log(newVal+",当前温度");
  979. this.setStatusText();
  980. },
  981. temperature(newVal){
  982. console.log(newVal+",实时温度");
  983. this.setStatusText();
  984. }
  985. },
  986. methods:{
  987. setSystemInfo(){
  988. const systemInfo = uni.getSystemInfoSync();
  989. let uniPlatform = systemInfo.uniPlatform;
  990. if(uniPlatform == 'web' || uniPlatform == 'h5'){
  991. this.isH5 = true;
  992. }else{
  993. this.isH5 = false;
  994. }
  995. },
  996. setStatusText(){
  997. if(!this.jianyaoIng()){
  998. this.workText = "·在线";
  999. return;
  1000. }
  1001. if(this.currentTemperature>=this.temperature){
  1002. this.workText = "·文火煎药";
  1003. }else{
  1004. this.workText = "·武火煎药";
  1005. }
  1006. },
  1007. goBack(){
  1008. uni.navigateBack();
  1009. },
  1010. pressTurnChangeEvent(newVal){
  1011. let self= this;
  1012. if(newVal == 1){
  1013. setTimeout(function(){
  1014. self.startProgressTimer(1);
  1015. },200);
  1016. }else{
  1017. clearInterval(this.lineTimer)
  1018. this.turnPercent = 0;
  1019. }
  1020. },
  1021. resetTurnChnageEvent(newVal){
  1022. let self= this;
  1023. if(newVal == 1){
  1024. setTimeout(function(){
  1025. self.startProgressTimer(2);
  1026. },200);
  1027. }else{
  1028. clearInterval(this.lineTimer)
  1029. this.turnPercent = 0;
  1030. }
  1031. },
  1032. closeDeviceYuyueIngPop(){
  1033. this.deviceYuyueIngPop = false;
  1034. },
  1035. closeDevicePlanPop(){
  1036. this.devicePlanPopDlg = false;
  1037. },
  1038. devicePlan(){
  1039. let self = this;
  1040. if(this.devicePlanTime>600){
  1041. this.$modal.showToast('预约时间最大为600分钟')
  1042. return;
  1043. }
  1044. if(this.devicePlanTime == 0){
  1045. this.$modal.showToast('预约时间不能为空')
  1046. }else{
  1047. let child = this.childId;
  1048. let obj = {deviceNo:this.deviceInfo.serialNumber+"&&"+child,minute:this.devicePlanTime};
  1049. addDevicePlan(obj).then(res=>{
  1050. self.getDevicePlanInfo();
  1051. self.$modal.showToast('预约成功')
  1052. self.devicePlanPopDlg = false;
  1053. });
  1054. }
  1055. },
  1056. closeliuzhuanPop(){
  1057. this.liuzhuanPopDlg = false;
  1058. },
  1059. addBaowenTime(){
  1060. console.log("增加保温时间")
  1061. this.baowenTime++;
  1062. this.sendBaowenSetting();
  1063. },
  1064. subBaowenTime(){
  1065. console.log("减少保温时间")
  1066. this.baowenTime--;
  1067. if(this.baowenTime < 0){
  1068. this.baowenTime = 0;
  1069. }
  1070. this.sendBaowenSetting();
  1071. },
  1072. subBaowenTemp(){
  1073. this.baowenTemp--;
  1074. if(this.baowenTemp<0){
  1075. this.baowenTemp = 1;
  1076. }
  1077. console.log("减少保温温度")
  1078. this.sendBaowenSetting();
  1079. },
  1080. addBaowenTemp(){
  1081. console.log("增加保温温度")
  1082. this.baowenTemp++;
  1083. this.sendBaowenSetting();
  1084. },
  1085. closeBaowenPopDlg(){
  1086. this.baowenPopDlg = false;
  1087. },
  1088. sendBaowenSetting(){
  1089. this.resetBaowenTimer();
  1090. if(this.baowenSettingSendTimer){
  1091. clearTimeout(this.baowenSettingSendTimer);
  1092. }
  1093. let self = this;
  1094. this.baowenSettingSendTimer = setTimeout(function(){
  1095. self.doBaowenSeting();
  1096. },500)
  1097. },
  1098. //6号板子的保温功能
  1099. doBaowenSeting(){
  1100. let arr = [];
  1101. let pressObj = {};
  1102. pressObj.id = "HoldingTemp";
  1103. pressObj.shadow = this.baowenTemp;
  1104. let baowen = {};
  1105. baowen.id = "HoldingTime";
  1106. baowen.shadow = this.baowenTime;
  1107. arr.push(pressObj);
  1108. arr.push(baowen);
  1109. this.mqttPublish(2,this.deviceInfo,arr,true)
  1110. },
  1111. addBaowenSetting(){
  1112. let self = this;
  1113. let obj = {};
  1114. obj.baowenTemp = this.baowenTemp;
  1115. obj.baowenTime = this.baowenTime;
  1116. obj.childId = this.childId;
  1117. obj.productId = this.deviceInfo.productId;
  1118. obj.status = 0;
  1119. obj.deviceNo = this.deviceInfo.serialNumber;
  1120. saveBaowenSetting(obj).then(res=>{
  1121. let code = res.code;
  1122. if(code == 200){
  1123. self.$modal.showToast('添加成功')
  1124. this.closeBaowenPopDlg();
  1125. }else{
  1126. self.$modal.showToast('已经存在保温设置')
  1127. }
  1128. });
  1129. },
  1130. editBaowenSetting(){
  1131. let obj = {};
  1132. obj.baowenTemp = this.baowenTemp;
  1133. obj.baowenTime = this.baowenTime;
  1134. obj.childId = this.childId;
  1135. obj.productId = this.deviceInfo.productId;
  1136. obj.status = 0;
  1137. obj.id = this.baowenId;
  1138. obj.deviceNo = this.deviceInfo.serialNumber;
  1139. editBaowenSetting(obj).then(res=>{
  1140. this.closeBaowenPopDlg();
  1141. });
  1142. },
  1143. delBaowenSetting(){
  1144. let obj = {};
  1145. obj.id = this.baowenId;
  1146. obj.status = 1;
  1147. editBaowenSetting(obj).then(res=>{
  1148. this.hasBaowen = false;
  1149. this.baowenId = 0;
  1150. this.closeBaowenPopDlg();
  1151. });
  1152. },
  1153. confirmLiuzhuannCurrent(){
  1154. if(this.setTurnCurrent<200 || this.setTurnCurrent>400){
  1155. this.notifyError("扭力范围为200-400")
  1156. return;
  1157. }
  1158. let arr = [];
  1159. let pressObj = {};
  1160. pressObj.id = "TurnCurrent";
  1161. pressObj.shadow = this.setTurnCurrent;
  1162. arr.push(pressObj);
  1163. this.mqttPublish(2,this.deviceInfo,arr)
  1164. this.closeliuzhuanPop();
  1165. },
  1166. setPressTurn(){
  1167. let self = this;
  1168. if(!this.decoctControlOnOffStatus){
  1169. this.notifyError("请先开机后再进行操作")
  1170. return;
  1171. }
  1172. let arr = [];
  1173. let currentPresturn = this.pressTurn;
  1174. let pressObj = {};
  1175. if(this.resetTurn == 1){
  1176. this.resetTurn = 0;
  1177. }
  1178. if(currentPresturn == 1){//代表要关闭
  1179. pressObj.id = "PressTurn";
  1180. pressObj.shadow = 0;
  1181. arr.push(pressObj);
  1182. this.turnPercent = 0;
  1183. this.pressTurn = 0;
  1184. }else{//代表要开启
  1185. pressObj.id = "PressTurn";
  1186. pressObj.shadow = 1;
  1187. arr.push(pressObj);
  1188. this.pressTurn = 1;
  1189. this.resetTurn = 0;
  1190. }
  1191. this.mqttPublish(2,this.deviceInfo,arr,true);
  1192. this.$forceUpdate()
  1193. this.canGetPrsValue = true;
  1194. setTimeout(function(){
  1195. self.canGetPrsValue = false;
  1196. },3000);
  1197. },
  1198. startProgressTimer(type){
  1199. let self = this;
  1200. if(self.lineTimer != null){
  1201. clearInterval(self.lineTimer)
  1202. }
  1203. if(type == 1){
  1204. self.lineTimer = setInterval(function(){
  1205. if(self.turnPercent >=100){
  1206. self.turnPercent = 1;
  1207. clearInterval(self.lineTimer);
  1208. self.startProgressTimer(1);
  1209. }
  1210. self.turnPercent +=2;
  1211. },100);
  1212. }else{
  1213. self.lineTimer = setInterval(function(){
  1214. if(self.turnPercent >=100){
  1215. self.turnPercent = 1;
  1216. clearInterval(self.lineTimer);
  1217. self.startProgressTimer(2);
  1218. }
  1219. self.turnPercent +=2;
  1220. },100);
  1221. }
  1222. },
  1223. setResetTurn(){
  1224. let self = this;
  1225. if(!this.decoctControlOnOffStatus){
  1226. this.notifyError("请先开机后再进行操作")
  1227. return;
  1228. }
  1229. if(this.pressTurn == 1){
  1230. this.pressTurn = 0;
  1231. }
  1232. let arr = [];
  1233. if(this.resetTurn == 1){
  1234. let pressObj = {};
  1235. pressObj.id = "ResetTurn";
  1236. pressObj.shadow = 0;
  1237. this.resetTurn = 0;
  1238. this.turnPercent = 0;
  1239. arr.push(pressObj);
  1240. }else{
  1241. let pressObj = {};
  1242. pressObj.id = "ResetTurn";
  1243. pressObj.shadow = 1;
  1244. this.resetTurn = 1;
  1245. this.pressTurn = 0;
  1246. let self= this;
  1247. arr.push(pressObj);
  1248. }
  1249. this.mqttPublish(2,this.deviceInfo,arr,true);
  1250. this.$forceUpdate()
  1251. this.canGetPrsValue = true;
  1252. this.canGetPrsValue = true;
  1253. setTimeout(function(){
  1254. self.canGetPrsValue = false;
  1255. },3000);
  1256. },
  1257. fixImage(heng){
  1258. let self = this;
  1259. wx.getSystemInfo({
  1260. success: res => {
  1261. const { windowWidth, windowHeight, statusBarHeight } = res;
  1262. if(heng){
  1263. let rate = 0.35;
  1264. if(windowHeight<800){
  1265. rate = 0.30;
  1266. }
  1267. let imgHeight = windowWidth*0.85;
  1268. let imageWidth = windowWidth * 1;
  1269. self.productSize = ";width:"+imageWidth+"px;height:"+imgHeight+"px;";
  1270. }else{
  1271. let rate = 0.35;
  1272. if(windowHeight<800){
  1273. rate = 0.30;
  1274. }
  1275. let imgHeight = windowHeight*rate;
  1276. let imageWidth = imgHeight * 0.6;
  1277. self.productSize = ";width:"+imageWidth+"px;height:"+imgHeight+"px;";
  1278. }
  1279. }
  1280. })
  1281. },
  1282. propChange(type){
  1283. // if(type == 1){
  1284. // }
  1285. },
  1286. propFocus(type){
  1287. if(type == 1){
  1288. this.jianyaoWenduSetting = true;
  1289. }
  1290. if(type == 2){
  1291. this.jianyaoShijianSetting = true;
  1292. }
  1293. if(type == 3){
  1294. this.baozhuangFengbianSetting = true;
  1295. this.tempFengBianWendu = this.edegTemperature;
  1296. this.edegTemperature = this.setEdegTemperature;
  1297. }
  1298. if(type == 4){
  1299. this.baozhuangFengkouSetting = true;
  1300. this.tempFengkouWendu = this.sealingTemperature;
  1301. this.sealingTemperature = this.setSealingTemperature;
  1302. }
  1303. if(type == 5){
  1304. this.baozhuangRongLiangSetting = true;
  1305. }
  1306. if(type == 6){
  1307. this.baozhuangShuLIangSetting = true;
  1308. }
  1309. },
  1310. autoBlur(type){
  1311. },
  1312. propBlur(type){
  1313. if(type == 1){
  1314. this.jianyaoWenduSetting = false;
  1315. this.changeTemperature();
  1316. }
  1317. if(type == 2){
  1318. this.temperatureTime = this.leftJianyaoTime;
  1319. this.changeTemperatureTime();
  1320. }
  1321. if(type == 3){
  1322. this.setEdegTemperature = this.edegTemperature;
  1323. this.changeEdegTemperature();
  1324. }
  1325. if(type == 4){
  1326. this.setSealingTemperature = this.sealingTemperature;
  1327. this.changeSealingTemperature();
  1328. }
  1329. if(type == 5){
  1330. this.changePackageVolume()
  1331. }
  1332. if(type == 6){
  1333. this.changePackageNumber();
  1334. }
  1335. if(type ==7){
  1336. this.sendWaterVolume();
  1337. }
  1338. if(type == 8){
  1339. this.sendPlanTime();
  1340. }
  1341. if(type == 9){
  1342. this.sendPlanTime(2);
  1343. }
  1344. if(type == 10){
  1345. this.sendBaowenSetting();
  1346. }
  1347. if(type == 11){
  1348. this.sendBaowenSetting();
  1349. }
  1350. },
  1351. modifyName(){
  1352. let self = this;
  1353. uni.showModal({
  1354. title: "修改设备名称",
  1355. editable: true,
  1356. placeholderText: "请输入设备名称",
  1357. content: this.deviceInfo.deviceName,
  1358. showCancel: true,
  1359. success: function (res) {
  1360. console.log(res);
  1361. if(res.confirm){
  1362. let content = res.content;
  1363. let obj = {"deviceId":self.id,deviceName:content};
  1364. editDeviceName(obj).then(res=>{
  1365. if(res.code == 200){
  1366. self.deviceInfo.deviceName = content;
  1367. self.$modal.showToast('修改成功')
  1368. }else{
  1369. self.$modal.showToast('修改失败,请稍后再试')
  1370. }
  1371. });
  1372. }
  1373. },
  1374. fail: function (res) {
  1375. console.log(res);
  1376. }
  1377. })
  1378. },
  1379. showWorkPicker(){
  1380. let self = this;
  1381. uni.showModal({
  1382. title: "提 示",
  1383. content: "非专业人员修改可能导致机器损坏",
  1384. confirmText:"确认",
  1385. success: function (res) {
  1386. if(res.confirm){
  1387. self.showModelPicker = true;
  1388. }
  1389. },
  1390. })
  1391. },
  1392. skip(type){
  1393. if(type == 1){
  1394. wx.navigateToMiniProgram({
  1395. appId: this.appid,
  1396. path: 'pages/news_details/help?id=25',
  1397. success(res) {
  1398. // 打开成功
  1399. },
  1400. fail(res){
  1401. console.log(res);
  1402. }
  1403. })
  1404. }else if(type == 2){
  1405. wx.openCustomerServiceChat({
  1406. extInfo: {url: 'https://work.weixin.qq.com/kfid/kfc4202b8764df71c0c'},
  1407. corpId: 'ww8e678fbe6f1079ba',
  1408. success(res) {
  1409. },
  1410. fail(res){
  1411. console.log(res);
  1412. }
  1413. })
  1414. }
  1415. },
  1416. isMulTab(index){
  1417. let type = this.deviceType;
  1418. if(this.secondMachine || this.secondMachine){
  1419. return true;
  1420. }
  1421. return false;
  1422. },
  1423. isPage(index){
  1424. if(this.tabIndex == index){
  1425. return true;
  1426. }
  1427. return false;
  1428. },
  1429. getUpdateInfo(){
  1430. let self = this;
  1431. getLatestFirmware(this.id).then(res=>{
  1432. self.firmware = res.data;
  1433. let curVersion = self.deviceInfo.firmwareVersion;
  1434. let onlineVersion = self.firmware.version
  1435. if(curVersion>=onlineVersion){
  1436. this.$modal.showToast('当前已经是最新版本')
  1437. }else{
  1438. uni.showModal({
  1439. title: '检测到新版本',
  1440. content: "当前版本:"+curVersion+",新版本:"+onlineVersion,
  1441. cancelText: '取消',
  1442. confirmText: '升级',
  1443. success: function(res) {
  1444. if (res.confirm) {
  1445. self.doUpdate();
  1446. }
  1447. }
  1448. })
  1449. }
  1450. });
  1451. },
  1452. doUpdate(){
  1453. if(this.deviceInfo.status != 3){
  1454. this.notifyError("请等待设备上线后操作")
  1455. return;
  1456. }
  1457. let device = this.deviceInfo;
  1458. let message = "";
  1459. let topic = "";
  1460. let title = "升级";
  1461. topic = "/" + device.productId + "/" + device.serialNumber + "/ota/get";
  1462. message = '{"version":"' + this.firmware.version + '","downloadUrl":"' + this.getDownloadUrl(this.firmware.filePath) + '","size":"'+this.firmware.size+'"}';
  1463. this.$mqttTool.publish(topic, message,title).then(res => {
  1464. this.notifySuccess(res);
  1465. }).catch(res => {
  1466. this.notifyError(res);
  1467. });
  1468. },
  1469. getStatusText(){
  1470. if(this.baozhuangRunning()){
  1471. return "工作中";
  1472. }
  1473. if(this.jianyaoIng()){
  1474. return "工作中";
  1475. }
  1476. if(this.leftAppointmentTime>0){
  1477. return "已预约";
  1478. }
  1479. return "空闲中";
  1480. },
  1481. closeYuyueIngPop(){
  1482. this.yuyueIngPop = false;
  1483. },
  1484. confirmMode(item){
  1485. console.log(item)
  1486. this.workMode = item.value[0].id;
  1487. this.setMode(this.workMode);
  1488. this.closeModelPicker();
  1489. },
  1490. closeModelPicker(){
  1491. this.showModelPicker = false;
  1492. },
  1493. confirmJiaozhunTemp(){
  1494. this.jiaozhunTemp = this.jiaozhunTemp_temp;
  1495. this.temperNumber();
  1496. this.closejiaozhunPop();
  1497. },
  1498. addJiaoZhunTemperature(){
  1499. this.jiaozhunTemp_temp ++;
  1500. if(this.jiaozhunTemp_temp>20){
  1501. this.jiaozhunTemp_temp = 20;
  1502. }
  1503. },
  1504. subJiaoZhunTemperature(){
  1505. this.jiaozhunTemp_temp --;
  1506. if(this.jiaozhunTemp_temp<-20){
  1507. this.jiaozhunTemp_temp = -20;
  1508. }
  1509. },
  1510. closejiaozhunPop(){
  1511. this.jiaozhunPopDlg = false;
  1512. },
  1513. showLiuProp(){
  1514. let self = this;
  1515. uni.showModal({
  1516. title: "提 示",
  1517. content: "非专业人员修改可能导致机器损坏",
  1518. confirmText:"确认",
  1519. success: function (res) {
  1520. if(res.confirm){
  1521. self.liuzhuanPopDlg = true;
  1522. }
  1523. },
  1524. })
  1525. },
  1526. showJiaozhunProp(){
  1527. let self = this;
  1528. uni.showModal({
  1529. title: "提 示",
  1530. content: "非专业人员修改可能导致机器损坏",
  1531. confirmText:"确认",
  1532. success: function (res) {
  1533. if(res.confirm){
  1534. self.jiaozhunTemp_temp = self.jiaozhunTemp;
  1535. self.jiaozhunPopDlg = true;
  1536. }
  1537. },
  1538. })
  1539. },
  1540. resetBaowenTimer(){
  1541. let self = this;
  1542. this.baowenSettingMode = true;
  1543. if(this.baowenSettingTimer != null){
  1544. clearTimeout(this.baowenSettingTimer)
  1545. }
  1546. this.baowenSettingTimer = setTimeout(function(){
  1547. self.baowenSettingMode = false;
  1548. },3000);
  1549. },
  1550. jinBaowenMode(){
  1551. let self = this;
  1552. if(!this.jianyaoOpen()){
  1553. this.notifyError("请先开机后再进行操作")
  1554. return;
  1555. }
  1556. if(this.jianyaoIng()){
  1557. this.$modal.showToast('必须在非煎药模式下才能设置')
  1558. return;
  1559. }
  1560. let arr = [];
  1561. let obj = {};
  1562. obj.id = "HoldingSwitch";
  1563. if(!this.baowenTurn){
  1564. obj.shadow = 1;
  1565. this.baowenTurn = true;
  1566. console.log("保温状态打开")
  1567. this.resetBaowenTimer();
  1568. }else{
  1569. this.baowenTurn = false;
  1570. obj.shadow = 0;
  1571. console.log("保温状态关闭")
  1572. }
  1573. arr.push(obj);
  1574. this.mqttPublish(2,this.deviceInfo,arr,true)
  1575. },
  1576. showBaowenProp(){
  1577. if(this.jianyaoIng()){
  1578. this.$modal.showToast('必须非煎药模式下才能设置')
  1579. return;
  1580. }
  1581. let obj = {};
  1582. obj.childId = this.childId;
  1583. obj.status =0;
  1584. obj.deviceNo = this.deviceInfo.serialNumber;
  1585. getBaoWen(obj).then(res=>{
  1586. let data = res.data;
  1587. if(data != null){
  1588. this.baowenTime = data.baowenTime;
  1589. this.baowenTemp = data.baowenTemp;
  1590. this.baowenId = data.id;
  1591. this.hasBaowen = true;
  1592. }else{
  1593. this.hasBaowen = false;
  1594. this.baowenId = 0;
  1595. }
  1596. this.baowenPopDlg = true;
  1597. });
  1598. },
  1599. fixStyle(){
  1600. let self = this;
  1601. wx.getSystemInfo({
  1602. success: res => {
  1603. const { windowWidth, windowHeight, statusBarHeight } = res;
  1604. // 在这里可以获取到屏幕的宽度和高度
  1605. console.log(windowWidth, windowHeight, statusBarHeight);
  1606. if(windowWidth<=350){
  1607. self.unitFixedStyle = ";padding-top:6px;left: 28vw;";
  1608. self.unitFixedStyle1 = ";padding-top:6px;left: 28vw;";
  1609. }else if(windowWidth>=360){
  1610. self.unitFixedStyle = ";padding-top:10rpx;";
  1611. self.unitFixedStyle1 = ";padding-top:10rpx;left: 32vw;";
  1612. }
  1613. self.maxWidth = windowWidth;
  1614. }
  1615. })
  1616. },
  1617. closePlanIngPop(){
  1618. this.jianyaoPopClose = false;
  1619. this.planIngPopDlg = false;
  1620. },
  1621. closePlanPop(){
  1622. this.planPopDlg = false;
  1623. },
  1624. showBaozhuangDlg(type){
  1625. this.popDlg = true;
  1626. if(type == 1){
  1627. this.fengbianDlgShow = true;
  1628. }else if(type == 2){
  1629. this.fengkouDlgShow = true;
  1630. }else if(type == 3){
  1631. this.wenhuoTimeDlgShow = true;
  1632. }
  1633. },
  1634. closePop(){
  1635. this.popDlg = false;
  1636. this.fengbianDlgShow = false;
  1637. this.fengkouDlgShow = false;
  1638. this.wenhuoTimeDlgShow = false;
  1639. },
  1640. changeTab(index,tag){
  1641. if(!tag){
  1642. return;
  1643. }
  1644. let type = this.deviceType;
  1645. let self = this;
  1646. if(index == 2 || index == 3){
  1647. if(!this.isMulTab(index)){
  1648. return;
  1649. }
  1650. }
  1651. this.resetChoose();
  1652. if(index == 4){
  1653. if(!this.forthMachine){
  1654. return;
  1655. }
  1656. uni.showLoading({title:"加载中"});
  1657. getDeviceStatus(this.id,0).then(res=>{
  1658. let data =res.data;
  1659. this.deviceInfo = data;
  1660. self.parseStatusData(data)
  1661. setTimeout(function () {
  1662. uni.hideLoading();
  1663. self.firstTab = false;
  1664. },100);
  1665. });
  1666. }else{
  1667. this.resetResetFunc();
  1668. let arr = ["a","b","c"]
  1669. if(this.isMulTab(index)){
  1670. this.childId =arr[index-1];
  1671. this.getDeviceStatus(function(){
  1672. self.tabIndex = index;
  1673. self.firstTab = true;
  1674. self.tabActive[index-1] = true;
  1675. self.$forceUpdate();
  1676. });
  1677. }else{
  1678. this.getDeviceStatus(function(){
  1679. self.tabIndex = index;
  1680. self.firstTab = true;
  1681. self.tabActive[index-1] = true;
  1682. self.$forceUpdate();
  1683. })
  1684. }
  1685. console.log(this.tabActive)
  1686. }
  1687. },
  1688. resetResetFunc(){
  1689. let self = this;
  1690. if(self.lineTimer != null){
  1691. clearInterval(self.lineTimer)
  1692. }
  1693. this.turnPercent = 0;
  1694. },
  1695. resetChoose(){
  1696. this.tabIndex = 0;
  1697. for (let i = 0; i < 3; i++) {
  1698. this.tabActive[i] = false;
  1699. }
  1700. },
  1701. changePackageVolume(){
  1702. if(this.packageVolume<50){
  1703. this.packageVolume = 50;
  1704. }
  1705. if(this.packageVolume>300){
  1706. this.packageVolume = 300;
  1707. }
  1708. this.sendBaozhuang("PackingVolume");
  1709. },
  1710. changePackageNumber(){
  1711. let min = 1;
  1712. let max = 999;
  1713. if(this.packageNumber<min){
  1714. this.packageNumber = min;
  1715. }
  1716. if(this.packageNumber>max){
  1717. this.packageNumber = max;
  1718. }
  1719. this.sendBaozhuang("PackageQuantity");
  1720. },
  1721. changeEdegTemperature(){
  1722. let min = 80;
  1723. let max = 220;
  1724. if(this.setEdegTemperature<min){
  1725. this.setEdegTemperature = min;
  1726. }
  1727. if(this.setEdegTemperature>max){
  1728. this.setEdegTemperature = max;
  1729. }
  1730. console.log("current setEdegTemperature is :"+this.setEdegTemperature)
  1731. this.sendBaozhuang("SetBandingTemp");
  1732. },
  1733. changeSealingTemperature(){
  1734. let min = 80;
  1735. let max = 220;
  1736. if(this.setSealingTemperature<min){
  1737. this.setSealingTemperature = min;
  1738. }
  1739. if(this.setSealingTemperature>max){
  1740. this.setSealingTemperature = max;
  1741. }
  1742. console.log("current setSealingTemperature is :"+this.setSealingTemperature)
  1743. this.sendBaozhuang("SetSealTemp");
  1744. },
  1745. changeTemperature(){
  1746. let max = 140;
  1747. let min = 100;
  1748. if(this.workMode == 2){
  1749. min = 1;
  1750. }
  1751. if(this.temperature<min){
  1752. this.temperature = min;
  1753. }
  1754. if(this.temperature>max){
  1755. this.temperature = max;
  1756. }
  1757. console.log("current temperature is :"+this.temperature)
  1758. this.sendJianYao("TempSetting");
  1759. },
  1760. changeTemperatureTime(){
  1761. let min = 1;
  1762. let max = 600;
  1763. if(this.temperatureTime<min){
  1764. this.temperatureTime = min;
  1765. }
  1766. if(this.temperatureTime>max){
  1767. this.temperatureTime = max;
  1768. }
  1769. console.log("current temperatureTime is :"+this.temperatureTime)
  1770. this.sendJianYao("TimeSetting");
  1771. },
  1772. jianyaoOpen(){
  1773. if(this.decoctControlOnOffStatus){
  1774. return true;
  1775. }
  1776. return false;
  1777. },
  1778. baozhuangOpen(){
  1779. if(this.packageControlOnOffStatus){
  1780. return true;
  1781. }
  1782. return false;
  1783. },
  1784. baozhuangRunning(){
  1785. if(this.qingxiTurn || this.baozhuangTurn || this.qitingTurn){
  1786. return true;
  1787. }
  1788. return false;
  1789. },
  1790. jianyaoIng(){
  1791. if(this.decoctControlStatus){
  1792. return true;
  1793. }
  1794. return false;
  1795. },
  1796. cancelPlan(){
  1797. let arr = [];
  1798. let obj = {};
  1799. obj.id = "AppointmentTime";
  1800. obj.shadow = 0;
  1801. arr.push(obj);
  1802. let self = this;
  1803. self.kongzhiJianyao(false,arr);
  1804. this.mqttPublish(2,this.deviceInfo,arr,true);
  1805. this.closeYuyueIngPop();
  1806. },
  1807. toPlan(){
  1808. if(!this.jianyaoOpen()){
  1809. this.$modal.showToast('煎药机已经关机')
  1810. return;
  1811. }
  1812. if(this.leftAppointmentTime>0){
  1813. this.yuyueIngPop = true;
  1814. }else{
  1815. if(this.jianyaoIng()){
  1816. this.$modal.showToast('正在煎药')
  1817. return;
  1818. }
  1819. this.planPopDlg = true;
  1820. }
  1821. },
  1822. toDevicePlan(){
  1823. let self = this;
  1824. if(this.decoctControlOnOffStatus){
  1825. this.$modal.showToast('请先关闭煎药后再预约')
  1826. return;
  1827. }
  1828. getDevicePlan(this.deviceInfo.serialNumber+"&&"+this.childId).then(res=>{
  1829. if(res.data != null){
  1830. self.deviceYuyueIngPop = true;
  1831. self.devicePlanInfo = res.data;
  1832. let minute = self.devicePlanInfo.minute;
  1833. if(minute<0){
  1834. minute = 10;
  1835. }
  1836. self.devicePlanInfo.minute = minute;
  1837. }else{
  1838. self.devicePlanPopDlg = true;
  1839. }
  1840. });
  1841. },
  1842. cancelDevicePlan(){
  1843. delDevicePlan(this.devicePlanInfo.id).then(res=>{
  1844. this.$modal.showToast('取消成功')
  1845. this.deviceYuyueIngPop = false;
  1846. this.devicePlanInfo = null;
  1847. })
  1848. },
  1849. getDevicePlanInfo(){
  1850. if(this.boardType != 4){
  1851. return;
  1852. }
  1853. let self = this;
  1854. self.devicePlanInfo = null;
  1855. getDevicePlan(this.deviceInfo.serialNumber+"&&"+self.childId).then(res=>{
  1856. if(res.data != null){
  1857. self.devicePlanInfo = res.data;
  1858. let minute = self.devicePlanInfo.minute;
  1859. if(minute<0){
  1860. minute = 10;
  1861. }
  1862. self.devicePlanInfo.minute = minute;
  1863. }
  1864. });
  1865. },
  1866. calcuStep(){
  1867. if(this.leftAppointmentTime>0){
  1868. this.step = 0;
  1869. return 0;
  1870. }
  1871. if(this.leftJianyaoTime == 0){
  1872. this.step = 100;
  1873. return ;
  1874. }
  1875. let currentTemperature = this.currentTemperature;
  1876. let hightTemperature = this.temperatureTime-this.leftJianyaoTime;//设置的高温时间
  1877. let targetTemperature =100;// this.temperature;
  1878. let targetTemperatureTime = this.temperatureTime;//倒计时
  1879. if(targetTemperature>100){
  1880. targetTemperature = 100;
  1881. }
  1882. let step = 0;
  1883. if(currentTemperature<100){
  1884. let tem = currentTemperature/200*100;
  1885. step = tem;
  1886. }else{
  1887. step = 50;
  1888. let rate = hightTemperature/targetTemperatureTime;
  1889. rate = rate/2;
  1890. rate = rate*100;
  1891. rate = rate.toFixed(2)
  1892. step = step + parseFloat(rate);
  1893. }
  1894. this.step = step.toFixed(2);
  1895. },
  1896. plan(){
  1897. let self = this;
  1898. if(this.planTime>600){
  1899. this.$modal.showToast('预约时间最大为600分钟')
  1900. return;
  1901. }
  1902. if(this.planTime == 0){
  1903. this.$modal.showToast('预约时间不能为空')
  1904. }else{
  1905. let arr = [];
  1906. let obj = {};
  1907. obj.id = "AppointmentTime";
  1908. obj.shadow = this.planTime;
  1909. arr.push(obj);
  1910. this.kongzhiJianyao(true,arr);
  1911. this.mqttPublish(2,this.deviceInfo,arr,true);
  1912. }
  1913. this.$modal.showToast('预约成功')
  1914. this.planPopDlg = false;
  1915. },
  1916. lockCtrl(key){
  1917. let arr = [];
  1918. let obj = {};
  1919. obj.id = "LockControl";
  1920. if(key == 0){
  1921. obj.shadow = 1;
  1922. this.lock.value = 1;
  1923. }else{
  1924. obj.shadow = 0;
  1925. this.lock.value = 0;
  1926. }
  1927. arr.push(obj);
  1928. this.mqttPublish(2,this.deviceInfo,arr)
  1929. },
  1930. setMode(type){
  1931. let arr = [];
  1932. let obj = {};
  1933. obj.id = "WorkMode";
  1934. obj.shadow = type;
  1935. arr.push(obj);
  1936. this.mqttPublish(2,this.deviceInfo,arr,true)
  1937. this.workMode = type;
  1938. },
  1939. temperNumber(value){
  1940. let arr = [];
  1941. let obj = {};
  1942. obj.id = "CalibrationTemp";
  1943. obj.shadow = this.jiaozhunTemp;
  1944. arr.push(obj);
  1945. this.mqttPublish(2,this.deviceInfo,arr,true)
  1946. },
  1947. volumeNumber(){
  1948. let arr = [];
  1949. let obj = {};
  1950. obj.id = "CapacityCalibration";
  1951. obj.shadow = 1;
  1952. arr.push(obj);
  1953. this.mqttPublish(2,this.deviceInfo,arr,true)
  1954. },
  1955. showConfirm(title,content,yes,no){
  1956. uni.showModal({
  1957. title: title,
  1958. content: content,
  1959. success: function (res) {
  1960. if (res.confirm) {
  1961. yes();
  1962. } else if (res.cancel) {
  1963. no();
  1964. }
  1965. }
  1966. });
  1967. },
  1968. reset(){
  1969. let self = this;
  1970. uni.showModal({
  1971. title: "提 示",
  1972. content: "非专业人员修改可能导致机器损坏",
  1973. confirmText:"确认",
  1974. success: function (res) {
  1975. if(res.confirm){
  1976. let arr = [];
  1977. let obj = {};
  1978. obj.id = "RestoreFactory";
  1979. obj.shadow = 1;
  1980. arr.push(obj);
  1981. self.mqttPublish(2,self.deviceInfo,arr)
  1982. }
  1983. },
  1984. })
  1985. },
  1986. turnChange(type){
  1987. let flag = false;
  1988. let obj = {};
  1989. if(type ==3){
  1990. if(this.baozhuangTurn || this.qitingTurn){
  1991. this.$modal.showToast("启停、包装、清洗不能同时打开")
  1992. return;
  1993. }
  1994. flag = this.qingxiTurn;
  1995. obj.id = "WashSwitch";
  1996. }else if(type == 2){
  1997. if(this.qingxiTurn || this.qitingTurn){
  1998. this.$modal.showToast("启停、包装、清洗不能同时打开")
  1999. return;
  2000. }
  2001. flag = this.baozhuangTurn;
  2002. obj.id = "PackageSwitch";
  2003. }else if(type == 1) {
  2004. if(this.qingxiTurn || this.baozhuangTurn){
  2005. this.$modal.showToast("启停、包装、清洗不能同时打开")
  2006. return;
  2007. }
  2008. flag = this.qitingTurn;
  2009. obj.id = "CarrybagSwitch";
  2010. }
  2011. flag = !flag;
  2012. let arr = [];
  2013. if(flag){
  2014. obj.shadow = 1;
  2015. }else{
  2016. obj.shadow = 0;
  2017. }
  2018. arr.push(obj);
  2019. this.mqttPublish(2,this.deviceInfo,arr)
  2020. },
  2021. addPackageVolume(){
  2022. this.packageVolume++;
  2023. if(this.packageVolume>300){
  2024. this.packageVolume = 50;
  2025. }
  2026. console.log("增加包装容量")
  2027. this.changePackageVolume()
  2028. },
  2029. subPackageVolume(){
  2030. this.packageVolume--;
  2031. if( this.packageVolume<50){
  2032. this.packageVolume = 300;
  2033. }
  2034. console.log("减少包装容量")
  2035. this.changePackageVolume()
  2036. },
  2037. addPackageNumber(){
  2038. this.packageNumber++;
  2039. if(this.packageNumber>999){
  2040. this.packageNumber = 1;
  2041. }
  2042. console.log("增加包装数量")
  2043. this.changePackageNumber();
  2044. },
  2045. subPackageNumber(){
  2046. this.packageNumber--;
  2047. if(this.packageNumber<1){
  2048. this.packageNumber = 999;
  2049. }
  2050. console.log("减少包装数量")
  2051. this.changePackageNumber();
  2052. },
  2053. addSealingTemperature(){
  2054. console.log("增加封口温度")
  2055. if(!this.fengkouDlgShow){
  2056. this.fengkouDlgShow = true;
  2057. }
  2058. this.setSealingTemperature++;
  2059. this.changeSealingTemperature();
  2060. },
  2061. subSealingTemperature(){
  2062. console.log("减少封口温度")
  2063. if(!this.fengkouDlgShow){
  2064. this.fengkouDlgShow = true;
  2065. }
  2066. this.setSealingTemperature--;
  2067. this.changeSealingTemperature();
  2068. },
  2069. addEdegTemperature(){
  2070. console.log("增加封边温度")
  2071. this.editing = true;
  2072. if(!this.fengbianDlgShow){
  2073. this.fengbianDlgShow = true;
  2074. }
  2075. this.setEdegTemperature++;
  2076. this.changeEdegTemperature();
  2077. },
  2078. subEdegTemperature(){
  2079. console.log("减少封边温度")
  2080. this.editing = true;
  2081. if(!this.fengbianDlgShow){
  2082. this.fengbianDlgShow = true;
  2083. }
  2084. this.setEdegTemperature--;
  2085. this.changeEdegTemperature();
  2086. },
  2087. addTemperatureTime(){
  2088. console.log("增加煎药时间")
  2089. if(!this.wenhuoTimeDlgShow){
  2090. this.wenhuoTimeDlgShow = true;
  2091. this.temperatureTime = this.leftJianyaoTime;
  2092. }
  2093. this.temperatureTime++;
  2094. this.changeTemperatureTime()
  2095. },
  2096. subTemperatureTime(){
  2097. console.log("减少煎药时间")
  2098. if(!this.wenhuoTimeDlgShow){
  2099. this.wenhuoTimeDlgShow = true;
  2100. this.temperatureTime = this.leftJianyaoTime;
  2101. }
  2102. this.temperatureTime--;
  2103. if(this.temperatureTime<=0){
  2104. this.temperatureTime = 1;
  2105. }
  2106. this.changeTemperatureTime()
  2107. },
  2108. addTemperature(){
  2109. console.log("增加煎药温度")
  2110. this.temperature++;
  2111. this.wenduSetting = true;
  2112. this.changeTemperature();
  2113. },
  2114. resetShowWendu(){
  2115. let self = this;
  2116. if(this.wenduSettingTimer){
  2117. clearTimeout(this.wenduSettingTimer);
  2118. }
  2119. this.wenduSettingTimer = setTimeout(function(){
  2120. self.wenduSetting = false;
  2121. },3000)
  2122. },
  2123. subWaterVolume(){
  2124. this.waterVolume = parseFloat(this.waterVolume) -0.1;
  2125. this.waterVolume = this.waterVolume.toFixed(1);
  2126. this.sendWaterVolume();
  2127. },
  2128. addWaterVolume(){
  2129. this.waterVolume = parseFloat(this.waterVolume) +0.1;
  2130. this.waterVolume = this.waterVolume.toFixed(1);
  2131. this.sendWaterVolume();
  2132. },
  2133. sendWaterVolume(){
  2134. if(this.waterVolume<0){
  2135. this.waterVolume = 0;
  2136. }
  2137. this.sendJianYao("WaterVolume");
  2138. },
  2139. subTemperature(type){
  2140. console.log("减少煎药温度")
  2141. this.temperature--;
  2142. this.wenduSetting = true;
  2143. this.changeTemperature();
  2144. },
  2145. addPlanTime(type){
  2146. console.log("增加预约时间")
  2147. if(type == 2){
  2148. this.planTime = this.leftAppointmentTime;
  2149. }
  2150. this.planTime++;
  2151. this.sendPlanTime(type);
  2152. },
  2153. subPlanTime(type){
  2154. console.log("减少预约时间")
  2155. if(type == 2){
  2156. this.planTime = this.leftAppointmentTime;
  2157. }
  2158. this.planTime--;
  2159. this.sendPlanTime(type);
  2160. },
  2161. sendPlanTime(type){
  2162. if(this.planTime<0){
  2163. this.planTime = 0;
  2164. }
  2165. if(type == 2){
  2166. this.leftAppointmentTime = this.planTime;
  2167. }
  2168. this.sendJianYao("AppointmentTime");
  2169. },
  2170. subDevicePlanTime(){
  2171. this.devicePlanTime--;
  2172. if(this.devicePlanTime<0){
  2173. this.devicePlanTime = 1;
  2174. }
  2175. console.log("减少预约时间")
  2176. },
  2177. addDevicePlanTime(){
  2178. console.log("增加预约时间")
  2179. this.devicePlanTime++;
  2180. },
  2181. sendBaozhuang(targetKey){
  2182. let self = this;
  2183. let arr = [];
  2184. if(this.baozhuangTimer != null){
  2185. clearTimeout(this.baozhuangTimer);
  2186. }
  2187. this.baozhuangTimer = setTimeout(function (){
  2188. for (let i = 0; i <this.baozhuangKeys.length; i++) {
  2189. let key = this.baozhuangKeys[i];
  2190. let obj = {};
  2191. obj.id = key;
  2192. if(key === "PackingVolume"){
  2193. obj.shadow = this.packageVolume;
  2194. setTimeout(function (){
  2195. self.baozhuangRongLiangSetting = false;
  2196. },self.resetDuration);
  2197. }
  2198. if(key === "PackageQuantity"){
  2199. obj.shadow = this.packageNumber;
  2200. setTimeout(function (){
  2201. self.baozhuangShuLIangSetting = false;
  2202. },self.resetDuration);
  2203. }
  2204. if(key === "SetSealTemp"){
  2205. obj.shadow = this.setSealingTemperature;
  2206. setTimeout(function (){
  2207. self.fengkouDlgShow = false;
  2208. self.baozhuangFengkouSetting = false;
  2209. self.sealingTemperature = self.tempFengKouWendu;;
  2210. },self.resetDuration);
  2211. }
  2212. if(key === "SetBandingTemp"){
  2213. obj.shadow = this.setEdegTemperature;
  2214. setTimeout(function (){
  2215. self.fengbianDlgShow = false;
  2216. self.baozhuangFengbianSetting = false;
  2217. self.edegTemperature = self.tempFengBianWendu;
  2218. },self.resetDuration);
  2219. }
  2220. if(targetKey == key){
  2221. arr.push(obj);
  2222. break;
  2223. }
  2224. }
  2225. this.mqttPublish(2,this.deviceInfo,arr)
  2226. }.bind(this),500);
  2227. },
  2228. sendJianYao(targetKey){
  2229. let self = this;
  2230. let arr = [];
  2231. if(this.jianyaoTimer != null){
  2232. clearTimeout(this.jianyaoTimer);
  2233. }
  2234. this.jianyaoTimer = setTimeout(function (){
  2235. for (let i = 0; i <this.jianyaoKeys.length; i++) {
  2236. let key = this.jianyaoKeys[i];
  2237. let obj = {};
  2238. obj.id = key;
  2239. if(key === "TempSetting"){
  2240. obj.shadow = this.temperature;
  2241. // setTimeout(function(){
  2242. // self.wenhuoTimeDlgShow = false;
  2243. // self.jianyaoShijianSetting = false;
  2244. // },self.resetDuration)
  2245. self.resetShowWendu();
  2246. }
  2247. if(key === "WaterVolume"){
  2248. obj.shadow = this.waterVolume*10;
  2249. }
  2250. if(key === "AppointmentTime"){
  2251. obj.shadow = this.planTime;
  2252. }
  2253. if(key === "TimeSetting"){
  2254. obj.shadow = this.temperatureTime;
  2255. self.leftJianyaoTime = this.temperatureTime;;
  2256. setTimeout(function(){
  2257. self.wenhuoTimeDlgShow = false;
  2258. self.jianyaoShijianSetting = false;
  2259. },self.resetDuration)
  2260. }
  2261. if(targetKey == key){
  2262. arr.push(obj);
  2263. break;
  2264. }
  2265. }
  2266. this.mqttPublish(2,this.deviceInfo,arr,true)
  2267. }.bind(this),500);
  2268. },
  2269. buildPropKey(key){
  2270. if(this.childId !=0){
  2271. return key+"_"+this.childId;
  2272. }else{
  2273. return key;
  2274. }
  2275. },
  2276. addWater(){
  2277. if(!this.jianyaoOpen()){
  2278. this.notifyError("请先开机后再进行操作")
  2279. return;
  2280. }
  2281. if(this.jianyaoIng()){
  2282. this.$modal.showToast('必须在非煎药模式下才能设置')
  2283. return;
  2284. }
  2285. let obj = {};
  2286. let arr = [];
  2287. obj.id = "WaterSwitch";
  2288. if(!this.jiashuiTurn){
  2289. obj.shadow = 1;
  2290. console.log("加水状态打开")
  2291. }else{
  2292. obj.shadow = 0;
  2293. console.log("加水状态关闭")
  2294. }
  2295. arr.push(obj);
  2296. this.mqttPublish(2,this.deviceInfo,arr,true)
  2297. },
  2298. decoctControlChange(){
  2299. if(!this.decoctControlOnOffStatus){
  2300. this.notifyError("请先开机后再进行操作")
  2301. return;
  2302. }
  2303. if(this.decoctControlStatus){
  2304. this.stopDecoctControlChange();
  2305. return;
  2306. }
  2307. this.decoctControlStatus = !this.decoctControlStatus;
  2308. let arr = [];
  2309. let obj = {};
  2310. obj.id = "DecoctingSwitch";
  2311. if(this.decoctControlStatus){
  2312. obj.shadow = 1;
  2313. console.log("煎药状态打开")
  2314. this.checkJianyao();
  2315. }else{
  2316. obj.shadow = 0;
  2317. console.log("煎药状态关闭")
  2318. }
  2319. arr.push(obj);
  2320. this.mqttPublish(2,this.deviceInfo,arr,true)
  2321. },
  2322. kongzhiJianyao(flag,arr){//不判断煎药状态
  2323. let obj = {};
  2324. if(!this.decoctControlOnOffStatus){
  2325. this.notifyError("请先开机后再进行操作")
  2326. return;
  2327. }
  2328. obj.id = "DecoctingSwitch";
  2329. if(flag){
  2330. obj.shadow = 1;
  2331. console.log("煎药状态打开")
  2332. this.checkJianyao();
  2333. }else{
  2334. obj.shadow = 0;
  2335. console.log("煎药状态关闭")
  2336. }
  2337. arr.push(obj);
  2338. },
  2339. stopDecoctControlChange(){
  2340. let obj = {};
  2341. let arr = [];
  2342. if(!this.decoctControlOnOffStatus){
  2343. this.notifyError("请先开机后再进行操作")
  2344. return;
  2345. }
  2346. if(!this.decoctControlStatus){
  2347. return;
  2348. }
  2349. this.decoctControlStatus = !this.decoctControlStatus;
  2350. obj.id = "DecoctingSwitch";
  2351. if(this.decoctControlStatus){
  2352. obj.shadow = 1;
  2353. console.log("煎药状态打开")
  2354. }else{
  2355. obj.shadow = 0;
  2356. console.log("煎药状态关闭")
  2357. }
  2358. arr.push(obj);
  2359. let obj2 = {};
  2360. obj2.id = "AppointmentTime";
  2361. obj2.shadow = 0;
  2362. arr.push(obj2);
  2363. this.mqttPublish(2,this.deviceInfo,arr,true);
  2364. this.cancelBaowen();
  2365. },
  2366. cancelBaowen(){
  2367. let obj = {};
  2368. obj.childId = this.childId;
  2369. obj.productId = this.deviceInfo.productId;
  2370. obj.status = 0;
  2371. obj.deviceNo = this.deviceInfo.serialNumber;
  2372. cancelBaowen(obj);
  2373. },
  2374. decoctControlOnOffChange(){
  2375. let obj = {};
  2376. //4号板子预约是无法开启煎药的
  2377. if(!this.decoctControlOnOffStatus){
  2378. if(this.boardType == 4){
  2379. if(this.devicePlanInfo != null){
  2380. this.$modal.showToast('请先取消预约后再开机');
  2381. return;
  2382. }
  2383. }
  2384. }
  2385. this.decoctControlOnOffStatus = !this.decoctControlOnOffStatus;
  2386. let arr = [];
  2387. obj.id = "PowerControl";
  2388. let isMul = false;
  2389. if(this.boardType != 4){
  2390. if(this.decoctControlStatus){
  2391. this.$modal.showToast('请先结束煎药后操作')
  2392. this.decoctControlOnOffStatus = !this.decoctControlOnOffStatus;
  2393. return;
  2394. }
  2395. }
  2396. if(this.oneToMul && this.firstTab){
  2397. obj.id = "PowerCtl";
  2398. isMul = true;
  2399. }
  2400. if(this.decoctControlOnOffStatus){
  2401. obj.shadow = 1;
  2402. console.log("煎药机开关打开")
  2403. }else{
  2404. obj.shadow = 0;
  2405. console.log("煎药机开关关闭")
  2406. }
  2407. arr.push(obj);
  2408. this.mqttPublish(2,this.deviceInfo,arr,isMul)
  2409. },
  2410. packageControlOnOffChange(){
  2411. let obj = {};
  2412. let arr = [];
  2413. if(this.baozhuangRunning()){
  2414. this.$modal.showToast('请先停止运行后操作')
  2415. return;
  2416. }
  2417. obj.id = "PackagePowerControl";
  2418. this.packageControlOnOffStatus = !this.packageControlOnOffStatus;
  2419. if(this.packageControlOnOffStatus){
  2420. console.log("包装机器开关打开")
  2421. obj.shadow = 1;
  2422. }else{
  2423. console.log("包装机器开关关闭")
  2424. obj.shadow = 0;
  2425. }
  2426. arr.push(obj);
  2427. this.mqttPublish(2,this.deviceInfo,arr)
  2428. },
  2429. containKey(arr,key){
  2430. for (let i = 0; i < arr.length; i++) {
  2431. const data = arr[i];
  2432. if(data == key){
  2433. return true;
  2434. }
  2435. }
  2436. return false;
  2437. },
  2438. // 抽屉状态发生变化触发
  2439. change(e, type) {
  2440. console.log(e);
  2441. },
  2442. showDrawer() {
  2443. this.$refs.showLeft.open();
  2444. },
  2445. closeDrawer() {
  2446. this.$refs.showLeft.close();
  2447. },
  2448. checkItemValue(item){
  2449. if(!item.shadow){
  2450. item.shadow = 0;
  2451. }
  2452. if(!item.unit){
  2453. item.unit = "";
  2454. }
  2455. return true;
  2456. },
  2457. sendProperties(){
  2458. let properties = this.properties;
  2459. for (let i = 0; i < properties; i++) {
  2460. let property = this.properties[i];
  2461. let shadow = property.shadow;
  2462. if(shadow){
  2463. arr.push(property);
  2464. }
  2465. }
  2466. this.mqttPublish(1,this.deviceInfo,arr)
  2467. },
  2468. sendFunctions(){
  2469. let arr = [];
  2470. let functions = this.functions;
  2471. for (let i = 0; i < functions.length; i++) {
  2472. let functionObj = this.functions[i];
  2473. let shadow = functionObj.shadow;
  2474. if(shadow){
  2475. arr.push(functionObj);
  2476. }
  2477. }
  2478. this.mqttPublish(2,this.deviceInfo,arr)
  2479. },
  2480. changeProp(key,val){
  2481. let item = null;
  2482. let obj = null;
  2483. let oneToMul = this.oneToMul;
  2484. if(key === "LockControl"){
  2485. this.lock.value = val;
  2486. item = this.lock;
  2487. }else if(key === "PowerControl"){
  2488. this.power.value = val;
  2489. item = this.power;
  2490. }
  2491. let value = val;
  2492. obj = item.item;
  2493. if(value){
  2494. obj.value = 1;
  2495. obj.shadow = 1;
  2496. }else{
  2497. obj.value = 0;
  2498. obj.shadow = 0;
  2499. }
  2500. if(!oneToMul){
  2501. }
  2502. this.publishThingsModel(this.deviceInfo,obj);
  2503. },
  2504. checkCommonProp(item){
  2505. let id =item.id;
  2506. let isCommonKey = this.modelKey.some(res=>{
  2507. return id === res;
  2508. })
  2509. return !isCommonKey;
  2510. },
  2511. getRunTime(){
  2512. let self = this;
  2513. getDeviceRunTime(this.id).then(res=>{
  2514. self.timeobj = res.data;
  2515. if(self.timeobj.avgtime == ""){
  2516. self.timeobj.avgtime = 0;
  2517. }
  2518. if(self.timeobj.alltime == ""){
  2519. self.timeobj.alltime = 0;
  2520. }
  2521. })
  2522. },
  2523. seeTime(){
  2524. this.showTimeDlg = true;
  2525. this.getRunTime();
  2526. },
  2527. closeTime(){
  2528. this.showTimeDlg = false;
  2529. },
  2530. cancel(){
  2531. this.showErrDlg = false;
  2532. },
  2533. reportError(){
  2534. this.showErrDlg = true;
  2535. },
  2536. doReportError(){
  2537. if(!this.errorMsg){
  2538. this.$modal.showToast('异常信息不能为空')
  2539. }else{
  2540. let self = this;
  2541. let errObj = {};
  2542. errObj.deviceId = this.deviceInfo.deviceId;
  2543. errObj.deviceName = this.deviceInfo.deviceName
  2544. errObj.desc = this.errorMsg;
  2545. errObj.deptId= this.deviceInfo.deptId;
  2546. reportError(errObj).then(res=>{
  2547. self.$modal.showToast(res.msg)
  2548. self.cancel();
  2549. })
  2550. }
  2551. },
  2552. openLocation(){
  2553. uni.openLocation({
  2554. latitude: this.location.latitude,
  2555. longitude: this.location.longitude,
  2556. success: function () {
  2557. console.log('success');
  2558. }
  2559. });
  2560. },
  2561. confirmItemData(e){
  2562. let data = e.value[0];
  2563. this.show.text = data.text;
  2564. this.show.shadow=data.value;
  2565. this.show = null;
  2566. console.log(data);
  2567. },
  2568. send(){
  2569. let shadow = false
  2570. let _arr = []
  2571. this.inputProp.forEach((item)=>{
  2572. _arr.push(item.value)
  2573. })
  2574. // if(_arr.some(val => val === '' || val.length < 0)){
  2575. // shadow = true
  2576. // }
  2577. if(this.deviceInfo.status != 3){
  2578. uni.showToast({
  2579. title:"设备暂未上线",
  2580. icon:"error"
  2581. })
  2582. return;
  2583. }
  2584. if(shadow){
  2585. uni.showToast({
  2586. title:"数据不能为空",
  2587. icon:"error"
  2588. })
  2589. return;
  2590. }
  2591. this.publishThingsModel(this.deviceInfo,this.inputProp.map(item=>{return{"id":item.id,"value":item.value}}))
  2592. },
  2593. /** 更新设备状态 */
  2594. updateDeviceStatus(device) {
  2595. },
  2596. chooseItemData(data){
  2597. if(this.deviceInfo.status != 3){
  2598. uni.showToast({
  2599. title:"设备暂未上线",
  2600. icon:"error"
  2601. })
  2602. return;
  2603. }
  2604. this.columns = [data.enumList];
  2605. this.show =data;
  2606. },
  2607. getDetail(){
  2608. let self = this;
  2609. getDetail(this.id).then(res=>{
  2610. self.deviceInfo = res.data;
  2611. self.deviceType = res.data.type;
  2612. let msg = res.msg;
  2613. if(msg){
  2614. try{
  2615. msg = JSON.parse(msg+"");
  2616. }catch (e){
  2617. msg = null;
  2618. }
  2619. }
  2620. let productId = self.deviceInfo.productId;
  2621. if(productId === 57){
  2622. self.boardType = 5;
  2623. }
  2624. let online = self.deviceInfo.status == 3?true:false;
  2625. if(!online){
  2626. if(!self.onlineStatus){
  2627. uni.showModal({
  2628. title: '系统提示',
  2629. content: "设备未在线,无法操作",
  2630. confirmText: '确定',
  2631. showCancel:false,
  2632. success(res){
  2633. if(res.confirm){
  2634. self.onlineStatus = true;
  2635. }
  2636. },
  2637. })
  2638. }
  2639. }
  2640. if(msg != null){
  2641. let b = msg.b;
  2642. let c = msg.c;
  2643. let a = msg.a;
  2644. let d = msg.d;
  2645. if(a == 1){
  2646. self.firstMachine = true;
  2647. }else if(a == 0){
  2648. self.firstMachine = false;
  2649. }
  2650. if(b == 1){
  2651. self.secondMachine = true;
  2652. }else if(b == 0){
  2653. self.secondMachine = false;
  2654. }
  2655. if(c == 1){
  2656. self.thirdMachine = true;
  2657. }else if(c == 0){
  2658. self.thirdMachine = false;
  2659. }
  2660. if(d == 1){
  2661. self.forthMachine = true;
  2662. }else if(d==0){
  2663. self.forthMachine = false;
  2664. }
  2665. }
  2666. console.log("当前设备类型:"+JSON.stringify(self.deviceInfo.type))
  2667. self.location = {
  2668. latitude: self.deviceInfo.latitude,
  2669. longitude: self.deviceInfo.longitude};
  2670. self.sysDept = self.deviceInfo.sysDept;
  2671. self.parseSummay(res.data.summary)
  2672. self.mqttSubscribe(res.data);
  2673. self.getDeviceStatus();
  2674. self.seeTime();
  2675. let heng = false;
  2676. self.productImage = self.imgUrl+'/detail/product.png'
  2677. if(self.deviceType == 13 || self.deviceType == 14 || self.deviceType == 15){
  2678. self.boardType = 4;
  2679. }
  2680. if(self.deviceType == 16 || self.deviceType == 17 || self.deviceType == 18){
  2681. self.boardType = 6;
  2682. }
  2683. if(self.deviceType == 14 ){
  2684. self.secondMachine = true;
  2685. }
  2686. if(self.deviceType == 4 ||self.deviceType == 5 ){
  2687. self.secondMachine = true;
  2688. }
  2689. if(self.deviceType == 5){
  2690. self.thirdMachine = true;
  2691. }
  2692. if(self.deviceType == 4){
  2693. self.productImage = self.imgUrl+'/product/YJCX20-2&1.png'
  2694. heng = true;
  2695. }
  2696. if(self.deviceType == 1 || self.deviceType == 7){
  2697. self.forthMachine = false;
  2698. self.productImage = self.imgUrl+'/product/YJH20.png'
  2699. }
  2700. if(self.deviceType == 10){
  2701. self.productImage = self.imgUrl+'/product/YJZ20.png'
  2702. }
  2703. heng = self.setImage(self.deviceType);
  2704. let typeArr = [7,8,9,10,11,12,15];//单煎药机类型
  2705. for (let i = 0; i < typeArr.length; i++) {
  2706. let typeMa = typeArr[i];
  2707. if(typeMa == self.deviceType){
  2708. self.forthMachine = false;
  2709. }
  2710. }
  2711. self.fixImage(heng);
  2712. if(self.boardType == 4){
  2713. self.boardStyle = ";top:15vh;";
  2714. self.modeList=[[
  2715. {id:1,text:"1"},
  2716. {id:2,text:"2"}
  2717. ]];
  2718. }
  2719. self.$forceUpdate();
  2720. });
  2721. },
  2722. getDeviceStatus(func){
  2723. let self = this;
  2724. if(this.summary.length>1){
  2725. }else{
  2726. this.childId = 0;
  2727. }
  2728. uni.showLoading({title:"加载中"});
  2729. getDeviceStatus(this.id,this.childId).then(res=>{
  2730. let data =res.data;
  2731. this.deviceInfo = data;
  2732. self.parseStatusData(data)
  2733. self.getDevicePlanInfo();
  2734. setTimeout(function () {
  2735. uni.hideLoading();
  2736. if(typeof func == "function"){
  2737. func();
  2738. }
  2739. },50);
  2740. });
  2741. },
  2742. setImage(type){
  2743. let heng = false;
  2744. let self = this;
  2745. if(type == 1){
  2746. self.productImage = self.imgUrl+'/product/YJDX20.png'
  2747. }else if(type == 2){
  2748. self.productImage = self.imgUrl+'/product/YJDJ20-20.png'
  2749. heng = true;
  2750. }else if(type == 3){
  2751. self.productImage = self.imgUrl+'/product/YJCX20-1&1.png'
  2752. }else if(type == 4){
  2753. self.productImage = self.imgUrl+'/product/YJCX20-2&1.png'
  2754. heng = true;
  2755. } else if(type == 5){
  2756. self.productImage = self.imgUrl+'/product/YJCX20-3&1.png'
  2757. heng = true;
  2758. }else if(type == 6){
  2759. self.productImage = self.imgUrl+'/product/YB50-300.png'
  2760. }else if(type == 7){
  2761. self.productImage = self.imgUrl+'/product/YJH20.png'
  2762. }else if(type == 8){
  2763. self.productImage = self.imgUrl+'/product/YJH20-20.png'
  2764. heng = true;
  2765. }else if(type == 9){
  2766. self.productImage = self.imgUrl+'/product/YJH20-20-20.png'
  2767. heng = true;
  2768. }else if(type == 10){
  2769. self.productImage = self.imgUrl+'/product/YJZ20.png'
  2770. }else if(type == 11){
  2771. self.productImage = self.imgUrl+'/product/YJZ20-20.png'
  2772. heng = true;
  2773. }else if(type == 12){
  2774. self.productImage = self.imgUrl+'/product/YJZ20-20-20.png'
  2775. heng = true;
  2776. }else if(type == 13){
  2777. self.productImage = self.imgUrl+'/product/YJCL20-1&1.png'
  2778. }else if(type == 14){
  2779. self.productImage = self.imgUrl+'/product/YJCL20-2&1.png'
  2780. heng = true;
  2781. }else if(type == 15){
  2782. self.productImage = self.imgUrl+'/product/15.png'
  2783. } else if(self.deviceType == 16 ){
  2784. self.productImage = self.imgUrl+'/product/16.png'
  2785. }
  2786. else if(self.deviceType == 17){
  2787. self.productImage = self.imgUrl+'/product/YJCX20-2&1.png'
  2788. heng = true;
  2789. }
  2790. else if(self.deviceType == 18){
  2791. self.productImage = self.imgUrl+'/product/YJCX20-3&1.png'
  2792. heng = true;
  2793. }
  2794. else if(self.deviceType == 19){
  2795. self.productImage = self.imgUrl+'/product/YJDX20.png'
  2796. }
  2797. return heng;
  2798. },
  2799. getNewDeviceStatus(item){
  2800. console.log(item);
  2801. let self = this;
  2802. if(item.index == 0){
  2803. this.firstTab = true;
  2804. this.getDeviceStatus();
  2805. }
  2806. if(item.index == 1){
  2807. this.firstTab = false;
  2808. getDeviceStatus(this.id,0).then(res=>{
  2809. let data =res.data;
  2810. this.deviceInfo = data;
  2811. self.parseStatusData(data)
  2812. });
  2813. }
  2814. },
  2815. changeSub(item){
  2816. this.childId = item.id;
  2817. this.getDeviceStatus()
  2818. },
  2819. parseEnumList(flag){
  2820. let enumList = this.deviceInfo.enumList;
  2821. for (let enumListElement of enumList) {
  2822. let id = enumListElement.id;
  2823. if(id == 'LockControl'){
  2824. let shadow = enumListElement.shadow;
  2825. this.lock.item = enumListElement;
  2826. if(shadow == 1){
  2827. this.lock.value = true;
  2828. this.lock.loading = false;
  2829. }else if(shadow == 0){
  2830. this.lock.value = false;
  2831. this.lock.loading = false;
  2832. }else{
  2833. this.lock.loading = true;
  2834. }
  2835. }
  2836. if(id == 'PowerControl'){
  2837. let shadow = enumListElement.shadow;
  2838. if(this.oneToMul){
  2839. if(!this.firstTab){
  2840. if(shadow == 1){
  2841. this.decoctControlOnOffStatus = true;
  2842. this.getDevicePlanInfo();
  2843. }else if(shadow == 0){
  2844. this.decoctControlOnOffStatus = false;
  2845. }
  2846. }
  2847. }else{
  2848. if(shadow == 1){
  2849. this.decoctControlOnOffStatus = true;
  2850. this.getDevicePlanInfo();
  2851. }else if(shadow == 0){
  2852. this.decoctControlOnOffStatus = false;
  2853. }
  2854. }
  2855. }
  2856. if(id == 'PowerCtl'){
  2857. if(this.oneToMul && this.firstTab){
  2858. let shadow = enumListElement.shadow;
  2859. if(shadow == 1){
  2860. this.decoctControlOnOffStatus = true;
  2861. this.getDevicePlanInfo();
  2862. }else if(shadow == 0){
  2863. this.decoctControlOnOffStatus = false;
  2864. }
  2865. }
  2866. }
  2867. this.formatValue(id,enumListElement,"PackagePowerControl","packageControlOnOffStatus")
  2868. this.formatValue(id,enumListElement,"DecoctingSwitch","decoctControlStatus")
  2869. this.formatValue(id,enumListElement,"CarrybagSwitch","qitingTurn")
  2870. this.formatValue(id,enumListElement,"WashSwitch","qingxiTurn")
  2871. this.formatValue(id,enumListElement,"PackageSwitch","baozhuangTurn");
  2872. //6号
  2873. this.formatValue(id,enumListElement,"WaterSwitch","jiashuiTurn");
  2874. this.formatValue(id,enumListElement,"HoldingSwitch","baowenTurn")
  2875. this.formatValue(id,enumListElement,"SlowHighswitch","wenwuhuoTurn")
  2876. //pressTurn resetTurn
  2877. if(!this.canGetPrsValue){
  2878. if(id == 'PressTurn'){
  2879. let shadow = enumListElement.shadow;
  2880. if(!shadow){
  2881. shadow = 0;
  2882. }
  2883. if(shadow == 1){
  2884. this.pressTurn = 1;
  2885. this.resetTurn = 0;
  2886. }else{
  2887. this.pressTurn = 0;
  2888. }
  2889. this.pressTurnChangeEvent(shadow);
  2890. }
  2891. if(id == 'ResetTurn'){
  2892. let shadow = enumListElement.shadow;
  2893. if(!shadow){
  2894. shadow = 0;
  2895. }
  2896. if(shadow == 1){
  2897. this.resetTurn = 1;
  2898. this.pressTurn = 0;
  2899. }else{
  2900. this.resetTurn = 0;
  2901. }
  2902. this.resetTurnChnageEvent(shadow);
  2903. }
  2904. }
  2905. if(id == 'WorkMode'){
  2906. let shadow = enumListElement.shadow;
  2907. if(!shadow){
  2908. shadow = 1;
  2909. }
  2910. this.workMode = shadow;
  2911. }
  2912. let shadow = enumListElement.shadow
  2913. let valueList = enumListElement.enumList;
  2914. for (let valueObj of valueList){
  2915. if(valueObj.value == shadow){
  2916. enumListElement.text = valueObj.text;
  2917. }
  2918. }
  2919. }
  2920. },
  2921. formatValue(id,enumListElement,key,propkey){
  2922. if(id == key){
  2923. let shadow = enumListElement.shadow;
  2924. if(shadow == 1){
  2925. this[propkey] = true;
  2926. }else if(shadow == 0){
  2927. this[propkey] = false;
  2928. }
  2929. }
  2930. },
  2931. parseStatusData(data){
  2932. let self = this;
  2933. cacheJsonThingsModel(data.productId).then(res=>{
  2934. let thingsModel = JSON.parse(res.data);
  2935. let arr = [];
  2936. let arrayList = data.arrayList;
  2937. arr = arr.concat(arrayList);
  2938. let enumList = data.enumList;
  2939. arr = arr.concat(enumList);
  2940. let integerList = data.integerList;
  2941. arr = arr.concat(integerList);
  2942. let stringList = data.stringList;
  2943. arr = arr.concat(stringList);
  2944. self.inputProp = arr;
  2945. for (let i = 0; i < thingsModel.functions.length; i++) {
  2946. for (let j = 0; j < arr.length; j++) {
  2947. let model = arr[j];
  2948. if(model.id == thingsModel.functions[i].id){
  2949. self.functions.push(model);
  2950. }
  2951. }
  2952. }
  2953. for (let i = 0; i < thingsModel.properties.length; i++) {
  2954. for (let j = 0; j < arr.length; j++) {
  2955. let model = arr[j];
  2956. if(model.id == thingsModel.properties[i].id){
  2957. self.properties.push(model);
  2958. }
  2959. }
  2960. }
  2961. let readOnlyList = data.readOnlyList;
  2962. self.watchProp = readOnlyList;
  2963. self.parseEnumList();
  2964. self.parseProp();
  2965. self.checkJianyao();
  2966. })
  2967. },
  2968. showJianyao(){
  2969. this.calcuStep();
  2970. this.planIngPopDlg = true;
  2971. },
  2972. parseProp(){
  2973. let self = this;
  2974. for (let i = 0; i <self.inputProp.length; i++) {
  2975. let prop = self.inputProp[i];
  2976. let value = prop.shadow||0;
  2977. let id = prop.id;
  2978. if(id === "TimeSetting"){//温度设置
  2979. self.temperatureTime = value;
  2980. }
  2981. if(!self.jianyaoWenduSetting){
  2982. if(id === "TempSetting"){
  2983. self.temperature = value;
  2984. }
  2985. }
  2986. if(id == "WaterVolume"){
  2987. this.waterVolume = parseInt(value)/10;
  2988. }
  2989. this.setPropValue(id,"SlowfireTiem","leftJianyaoTime",value,0)
  2990. this.setPropValue(id,"HighTempTime","hightTemperature",value,0)
  2991. this.setPropValue(id,"CurrentTemp","currentTemperature",value,0)
  2992. this.setPropValue(id,"CalibrationTemp","jiaozhunTemp",value,0)
  2993. this.setPropValue(id,"PackingVolume","packageVolume",value,50)
  2994. this.setPropValue(id,"PackageQuantity","packageNumber",value,1)
  2995. //封边温度
  2996. this.setPropValue(id,"BandingTemp","edegTemperature",value);
  2997. this.setPropValue(id,"BandingTemp","tempFengBianWendu",value)
  2998. //封口温度
  2999. this.setPropValue(id,"SealTemp","sealingTemperature",value);
  3000. this.setPropValue(id,"SealTemp","tempFengKouWendu",value)
  3001. this.setPropValue(id,"LeftAppointmentTime","leftAppointmentTime",value,0)
  3002. this.setPropValue(id,"ValidCurrent","validCurrent",value,0)
  3003. this.setPropValue(id,"TurnCurrent","turnCurrent",value,0)
  3004. this.setPropValue(id,"HoldingTemp","baowenTemp",value,0)
  3005. this.setPropValue(id,"HoldingTime","baowenTime",value,0)
  3006. this.setPropValue(id,"AppointmentTime","planTime",value,0)
  3007. self.propMap[id] = prop;
  3008. }
  3009. },
  3010. setPropValue(id,key,propKey,value,defaultValue){
  3011. if(!value && defaultValue){
  3012. value = defaultValue;
  3013. }
  3014. if(id === key){
  3015. this[propKey] = value;
  3016. }
  3017. },
  3018. parseSummay(summary){
  3019. let self = this;
  3020. if(!summary){
  3021. summary = "";
  3022. }
  3023. if(summary.length>0){
  3024. this.summary = JSON.parse(summary);
  3025. if(self.summary.length>0){
  3026. this.oneToMul = true;
  3027. for (let i = 0; i < self.summary.length; i++) {
  3028. self.summary[i].tabName = self.summary[i].name
  3029. }
  3030. let childId = "";
  3031. if(this.oneToMul){
  3032. this.childId = self.summary[0].id;
  3033. }
  3034. }else{
  3035. this.summary = [{name:"煎药机一"}]
  3036. }
  3037. }else{
  3038. this.summary = [{name:"煎药机一"}]
  3039. }
  3040. },
  3041. goDeviceDetail(id){
  3042. uni.navigateTo({
  3043. url: '/pages/device/detail/detail?id='+id
  3044. });
  3045. },
  3046. async connectMqtt() {
  3047. if (this.$mqttTool.client == null) {
  3048. await this.$mqttTool.connect(this.vuex_token);
  3049. }
  3050. this.mqttCallback();
  3051. this.startCheck();
  3052. },
  3053. /** Mqtt订阅主题 */
  3054. mqttSubscribe(device) {
  3055. // 订阅当前设备状态和实时监测
  3056. let topicStatus = '/' + device.productId + '/' + device.serialNumber + '/status/post';
  3057. let topicProperty = '/' + device.productId + '/' + device.serialNumber + '/property/post';
  3058. let topicFunction = '/' + device.productId + '/' + device.serialNumber + '/function/post';
  3059. let topics = [];
  3060. topics.push(topicStatus);
  3061. topics.push(topicProperty);
  3062. topics.push(topicFunction);
  3063. this.$mqttTool.subscribe(topics);
  3064. },
  3065. /** Mqtt取消订阅主题 */
  3066. mqttUnSubscribe(device) {
  3067. // 订阅当前设备状态和实时监测
  3068. let topicStatus = '/' + device.productId + '/' + device.serialNumber + '/status/post';
  3069. let topicProperty = '/' + device.productId + '/' + device.serialNumber + '/property/post';
  3070. let topicFunction = '/' + device.productId + '/' + device.serialNumber + '/function/post';
  3071. let topics = [];
  3072. topics.push(topicStatus);
  3073. topics.push(topicProperty);
  3074. topics.push(topicFunction);
  3075. console.log('取消订阅', topics);
  3076. this.$mqttTool.unsubscribe(topics);
  3077. },
  3078. /* Mqtt回调处理 */
  3079. mqttCallback() {
  3080. this.$mqttTool.client.on('message', (topic, message, buffer) => {
  3081. let topics = topic.split('/');
  3082. let productId = topics[1];
  3083. let deviceNum = topics[2];
  3084. console.log('接收到内容:'+message);
  3085. message = JSON.parse(message.toString());
  3086. if (topics[3] == 'status') {
  3087. console.log('接收到【设备状态-运行】主题:', topic);
  3088. console.log('接收到【设备状态-运行】内容:', message);
  3089. // 更新列表中设备的状态
  3090. if (this.deviceInfo.serialNumber == deviceNum) {
  3091. this.deviceInfo.status = message.status;
  3092. this.deviceInfo.isShadow = message.isShadow;
  3093. this.deviceInfo.rssi = message.rssi;
  3094. this.updateDeviceStatus(this.deviceInfo);
  3095. }
  3096. }
  3097. if (topics[3] == 'property' || topics[3] == 'function') {
  3098. console.log('接收到【物模型】主题:', topic);
  3099. console.log('接收到【物模型】内容:', message);
  3100. if(this.oneToMul){
  3101. let curTabId = this.childId;
  3102. let msg = [];
  3103. for (let i = 0; i < message.length; i++) {
  3104. let curMsg = message[i];
  3105. let id = curMsg.id;
  3106. let ids = id.split("_");
  3107. let value = curMsg.value;
  3108. if(ids.length == 2){
  3109. if(curTabId == ids[1]){
  3110. msg.push({id:ids[0],value:value});
  3111. }
  3112. }else{
  3113. msg.push(curMsg);
  3114. }
  3115. }
  3116. message = msg;
  3117. }
  3118. // 更新列表中设备的属性
  3119. if (this.deviceInfo.serialNumber == deviceNum) {
  3120. for (let j = 0; j < message.length; j++) {
  3121. let isComplete = false;
  3122. let msgId = message[j].id;
  3123. this.exchangeData(msgId,message[j]);
  3124. // 布尔类型
  3125. if(this.deviceInfo.boolList == null){
  3126. return;
  3127. }
  3128. for (let k = 0; k < this.deviceInfo.boolList.length && !isComplete; k++) {
  3129. if (this.deviceInfo.boolList[k].id == message[j].id) {
  3130. this.deviceInfo.boolList[k].shadow = message[j].value;
  3131. isComplete = true;
  3132. break;
  3133. }
  3134. }
  3135. // 枚举类型
  3136. for (let k = 0; k < this.deviceInfo.enumList.length && !isComplete; k++) {
  3137. if (this.deviceInfo.enumList[k].id == message[j].id) {
  3138. this.deviceInfo.enumList[k].shadow = message[j].value;
  3139. isComplete = true;
  3140. break;
  3141. }
  3142. }
  3143. // 字符串类型
  3144. for (let k = 0; k < this.deviceInfo.stringList.length && !isComplete; k++) {
  3145. if (this.deviceInfo.stringList[k].id == message[j].id) {
  3146. this.deviceInfo.stringList[k].shadow = message[j].value;
  3147. isComplete = true;
  3148. break;
  3149. }
  3150. }
  3151. // 数组类型
  3152. for (let k = 0; k < this.deviceInfo.arrayList.length && !isComplete; k++) {
  3153. if (this.deviceInfo.arrayList[k].id == message[j].id) {
  3154. this.deviceInfo.arrayList[k].shadow = message[j].value;
  3155. isComplete = true;
  3156. break;
  3157. }
  3158. }
  3159. // 整数类型
  3160. for (let k = 0; k < this.deviceInfo.integerList.length && !isComplete; k++) {
  3161. if (this.deviceInfo.integerList[k].id == message[j].id) {
  3162. this.deviceInfo.integerList[k].shadow = message[j].value;
  3163. isComplete = true;
  3164. break;
  3165. }
  3166. }
  3167. // 小数类型
  3168. for (let k = 0; k < this.deviceInfo.decimalList.length && !isComplete; k++) {
  3169. if (this.deviceInfo.decimalList[k].id == message[j].id) {
  3170. this.deviceInfo.decimalList[k].shadow = message[j].value;
  3171. isComplete = true;
  3172. break;
  3173. }
  3174. }
  3175. // 监测数据
  3176. for (let k = 0; k < this.deviceInfo.readOnlyList.length && !isComplete; k++) {
  3177. if (this.deviceInfo.readOnlyList[k].id == message[j].id) {
  3178. this.deviceInfo.readOnlyList[k].shadow = message[j].value;
  3179. // 更新图表
  3180. // for (let m = 0; m < this.monitorChart.length; m++) {
  3181. // if (message[j].id == this.monitorChart[m].data.id) {
  3182. // let data = [{
  3183. // value: message[j].value,
  3184. // name: this.monitorChart[m].data.name
  3185. // }];
  3186. // this.monitorChart[m].chart.setOption({
  3187. // series: [{
  3188. // data: data
  3189. // }]
  3190. // });
  3191. // break;
  3192. // }
  3193. // }
  3194. isComplete = true;
  3195. break;
  3196. }
  3197. }
  3198. }
  3199. this.parseEnumList(true);
  3200. this.checkJianyao();
  3201. if(this.planIngPopDlg){
  3202. this.calcuStep();
  3203. }
  3204. }
  3205. this.$forceUpdate();
  3206. }
  3207. });
  3208. },
  3209. checkJianyao(){
  3210. // if(!this.jianyaoPopClose){
  3211. // return;
  3212. // }
  3213. // let self = this;
  3214. // setTimeout(function(){
  3215. // if(self.decoctControlStatus){
  3216. // self.showJianyao();
  3217. // }
  3218. // },1000);
  3219. },
  3220. exchangeData(msgId,obj){
  3221. if(msgId === "TempSetting"){
  3222. this.temperature = obj.value;
  3223. }
  3224. if(msgId === "TimeSetting"){
  3225. this.temperatureTime = obj.value;
  3226. }
  3227. if(msgId === "CurrentTemp"){
  3228. this.currentTemperature = obj.value;
  3229. }
  3230. if(msgId === "HighTempTime"){
  3231. this.hightTemperature = obj.value;
  3232. }
  3233. if(msgId === "SealTemp"){//封口温度
  3234. if(!this.editing){
  3235. if(this.baozhuangFengkouSetting){
  3236. this.tempFengkouWendu = obj.value;
  3237. }else{
  3238. this.sealingTemperature = obj.value;
  3239. }
  3240. }
  3241. }
  3242. if(msgId === "BandingTemp"){//封边温度
  3243. if(!this.editing){
  3244. if(this.baozhuangFengbianSetting){
  3245. this.tempFengBianWendu = obj.value;
  3246. }else{
  3247. this.edegTemperature = obj.value;
  3248. }
  3249. }
  3250. }
  3251. if(msgId === "PackingVolume"){
  3252. if(!this.editing){
  3253. if(this.baozhuangRongLiangSetting){
  3254. }else{
  3255. this.packageVolume = obj.value;
  3256. }
  3257. }
  3258. }
  3259. if(msgId === "PackageQuantity"){
  3260. if(!this.editing){
  3261. if(this.baozhuangShuLIangSetting){
  3262. }else{
  3263. this.packageNumber = obj.value;
  3264. }
  3265. }
  3266. }
  3267. if(msgId === "LeftAppointmentTime"){
  3268. this.leftAppointmentTime = obj.value;
  3269. }
  3270. if(msgId === "SlowfireTiem"){
  3271. this.leftJianyaoTime = obj.value;
  3272. }
  3273. if(msgId === "CalibrationTemp"){
  3274. this.jiaozhunTemp = obj.value;
  3275. }
  3276. if(msgId === "TurnCurrent"){
  3277. this.turnCurrent = obj.value;
  3278. }
  3279. if(msgId === "ValidCurrent"){
  3280. this.validCurrent = obj.value;
  3281. }
  3282. if(msgId === "WaterVolume"){
  3283. this.waterVolume = parseInt(obj.value)/10;
  3284. }
  3285. if(msgId === "HoldingTemp"){
  3286. this.baowenTemp = obj.value;
  3287. }
  3288. if(msgId === "HoldingTime"){
  3289. this.baowenTime = obj.value
  3290. }
  3291. if(msgId === "AppointmentTime"){
  3292. this.planTime = obj.value
  3293. }
  3294. },
  3295. /** 发布物模型 类型(1=属性,2=功能) */
  3296. publishThingsModel(device, model) {
  3297. // 获取缓存的Json物模型
  3298. cacheJsonThingsModel(device.productId).then(response => {
  3299. let thingsModel = JSON.parse(response.data);
  3300. let type = 0;
  3301. for (let i = 0; i < thingsModel.functions.length; i++) {
  3302. if (model.id == thingsModel.functions[i].id) {
  3303. type = 2;
  3304. break;
  3305. }
  3306. }
  3307. if (type == 0) {
  3308. for (let i = 0; i < thingsModel.properties.length; i++) {
  3309. if (model.id == thingsModel.properties[i].id) {
  3310. type = 1;
  3311. break;
  3312. }
  3313. }
  3314. }
  3315. if (type != 0) {
  3316. this.mqttPublish(type, device, [model]);
  3317. }
  3318. });
  3319. },
  3320. notifyError(res){
  3321. uni.showToast({
  3322. title:res,
  3323. icon:"error"
  3324. })
  3325. },
  3326. notifySuccess(res){
  3327. uni.showToast({
  3328. title:res,
  3329. icon:"success"
  3330. })
  3331. },
  3332. getDownloadUrl(path){
  3333. return this.firmware.downUrl +"/iot/tool/download?fileName="+ path;
  3334. },
  3335. /**
  3336. * Mqtt发布消息
  3337. * @type 类型(1=属性,2=功能,3=OTA升级,4=实时监测)
  3338. * @device 设备
  3339. * @model 物模型
  3340. * */
  3341. mqttPublish(type, device, modelList,needMore) {
  3342. if(this.deviceInfo.status != 3){
  3343. this.notifyError("请等待设备上线后操作")
  3344. return;
  3345. }
  3346. if(modelList.length == 0){
  3347. return;
  3348. }
  3349. let topic = "";
  3350. let message = ""
  3351. let oneToMul = false;
  3352. if(this.summary.length>1){
  3353. oneToMul = true;
  3354. }
  3355. if(!needMore){
  3356. oneToMul = false;
  3357. }
  3358. if(this.firstTab){
  3359. let isKaijiKey = false;
  3360. if(modelList.length >0){
  3361. let modelData = modelList[0];
  3362. let curKeyId = modelData.id;
  3363. if(!this.decoctControlOnOffStatus){
  3364. if(oneToMul){
  3365. if(curKeyId == 'PowerCtl'){
  3366. isKaijiKey = true;
  3367. }
  3368. }else{
  3369. if(curKeyId == 'PowerControl'){
  3370. isKaijiKey = true;
  3371. }
  3372. }
  3373. }else{
  3374. isKaijiKey = true;
  3375. }
  3376. }
  3377. if(!isKaijiKey){
  3378. this.notifyError("请先开机后再进行操作")
  3379. return;
  3380. }
  3381. }else{
  3382. let isKaijiKey = false;
  3383. if(modelList.length >0){
  3384. let modelData = modelList[0];
  3385. let curKeyId = modelData.id;
  3386. if(!this.packageControlOnOffStatus){
  3387. if(curKeyId == 'PackagePowerControl'){
  3388. isKaijiKey = true;
  3389. }
  3390. }else{
  3391. isKaijiKey = true;
  3392. }
  3393. }
  3394. if(!isKaijiKey){
  3395. this.notifyError("请先开机后再进行操作")
  3396. return;
  3397. }
  3398. }
  3399. if (type == 1) {
  3400. if (device.status == 3) {
  3401. // 属性,在线模式
  3402. topic = "/" + device.productId + "/" + device.serialNumber + "/property-online/get";
  3403. }
  3404. } else if (type == 2) {
  3405. if (device.status == 3) {
  3406. // 功能,在线模式
  3407. topic = "/" + device.productId + "/" + device.serialNumber + "/function-online/get";
  3408. }
  3409. } else if (type == 3) {
  3410. // OTA升级
  3411. topic = "/" + device.productId + "/" + device.serialNumber + "/ota/get";
  3412. } else {
  3413. return;
  3414. }
  3415. let title = "";
  3416. if(type == 1){
  3417. title = "属性";
  3418. }else if(type == 2){
  3419. title = "功能";
  3420. }else if(type == 3){
  3421. title = "升级";
  3422. }
  3423. if (topic != "") {
  3424. // 发布
  3425. let arr = [];
  3426. for (let i = 0; i <modelList.length; i++) {
  3427. let model = modelList[i];
  3428. let modelId = model.id;
  3429. if(oneToMul){
  3430. let childId = this.childId;
  3431. if(childId){
  3432. modelId = modelId+"_"+childId;
  3433. }
  3434. }
  3435. let shadow = model.shadow+"";
  3436. let modelType = model.type;
  3437. let shadowInt = parseInt(shadow,10);
  3438. let isNumber = false;
  3439. let shadowStr = shadowInt+"";
  3440. if(shadowStr === shadow){
  3441. isNumber = true;
  3442. shadow = shadowInt;
  3443. }
  3444. if(modelType == "integer" && !isNumber){
  3445. this.$modal.showToast(model.name+'的值必须是数字类型')
  3446. return;
  3447. }
  3448. arr.push({id:modelId,value:shadow+""});
  3449. }
  3450. message = JSON.stringify(arr);
  3451. let self = this;
  3452. this.$mqttTool.publish(topic, message,title).then(res => {
  3453. this.notifySuccess(res);
  3454. }).catch(res => {
  3455. this.notifyError(res);
  3456. });
  3457. }
  3458. },
  3459. startCheck(){
  3460. let self = this;
  3461. this.checkTimer = setTimeout(function (){
  3462. self.sendHeart();
  3463. self.startCheck();
  3464. },20000);
  3465. },
  3466. checkActive(){
  3467. let self = this;
  3468. setTimeout(function (){
  3469. if(self.publishMsg){
  3470. self.resetConn()
  3471. }
  3472. },3000);
  3473. },
  3474. sendHeart(){
  3475. console.log("发送心跳111")
  3476. let device = this.deviceInfo;
  3477. let self = this;
  3478. let topic = "/property-offline/post";
  3479. self.publishMsg = true;
  3480. self.checkActive();
  3481. this.$mqttTool.publish(topic, "ok", "heart").then(res => {
  3482. self.publishMsg = false;
  3483. }).catch(res => {
  3484. self.publishMsg = false;
  3485. });
  3486. },
  3487. resetConn(){
  3488. console.log("检测异常,重连")
  3489. this.$mqttTool.end();
  3490. this.$mqttTool.client = null;
  3491. this.connectMqtt();
  3492. this.getDetail();
  3493. }
  3494. }
  3495. }
  3496. </script>
  3497. <style>
  3498. .send_btn{
  3499. width: 160rpx !important;
  3500. height: 40rpx !important;
  3501. font-size: 10px !important;
  3502. margin-top: 5px;
  3503. }
  3504. uni-col{
  3505. width: 150px;
  3506. }
  3507. .header{
  3508. width: 100%;
  3509. background: white;
  3510. padding:0px 20rpx;
  3511. position: relative;
  3512. height: 100vh;
  3513. position: relative;
  3514. }
  3515. .content {
  3516. display: flex;
  3517. align-items: center;
  3518. justify-content: center;
  3519. color: #060B25;
  3520. }
  3521. .logo {
  3522. height: 200rpx;
  3523. width: 200rpx;
  3524. margin-top: 200rpx;
  3525. margin-left: auto;
  3526. margin-right: auto;
  3527. margin-bottom: 50rpx;
  3528. }
  3529. .text-area {
  3530. margin:10px;
  3531. padding-bottom: 10px;
  3532. justify-content: center;
  3533. width: 100%;
  3534. }
  3535. .grid-text {
  3536. font-size: 14px;
  3537. color: #909399;
  3538. padding: 10rpx 0 20rpx 0rpx;
  3539. /* #ifndef APP-PLUS */
  3540. box-sizing: border-box;
  3541. /* #endif */
  3542. }
  3543. .title {
  3544. font-size: 36rpx;
  3545. color: #8f8f94;
  3546. }
  3547. .item{
  3548. height: 80rpx;
  3549. line-height: 80rpx;
  3550. }
  3551. .bg{
  3552. position: relative;
  3553. }
  3554. .text-left{
  3555. color: #8A92A5;
  3556. }
  3557. .text-right{
  3558. color: #545454;
  3559. }
  3560. .prop-text{
  3561. position: relative;
  3562. margin:20rpx 0;
  3563. font-size: 26rpx;
  3564. }
  3565. .prop-card-area{
  3566. }
  3567. .prop-card{
  3568. width: 28%;
  3569. height: 100rpx;
  3570. text-align: center;
  3571. display: inline-block;
  3572. background: #F5FCFF;
  3573. box-shadow: 0px 9rpx 8rpx 0px rgba(0,0,0,0.09);
  3574. border-radius: 8rpx;
  3575. margin:0px 15rpx;
  3576. line-height: 48rpx;
  3577. }
  3578. .prop-card-top{
  3579. color: #3E9CFC;
  3580. }
  3581. .prop-card-bottom{
  3582. color: #8A92A5;
  3583. }
  3584. .tab-area {
  3585. background: white;
  3586. position: absolute;
  3587. left: 0px;
  3588. right: 0px;
  3589. top:480rpx;
  3590. bottom:-20px;
  3591. min-height: 200rpx;
  3592. box-shadow: 0rpx 5rpx 27rpx 0rpx rgba(195, 195, 195, 0.4);
  3593. border-radius: 40rpx;
  3594. overflow-y: auto;
  3595. padding-bottom:80rpx;
  3596. }
  3597. .prop-item{
  3598. position: relative;
  3599. display: flex;
  3600. flex-direction: row;
  3601. height: 100rpx;
  3602. line-height: 100rpx;
  3603. margin:0 20rpx;
  3604. }
  3605. .prop-item-left{
  3606. color: #545454;
  3607. width: 100%;
  3608. font-size: 16px;
  3609. border-bottom: 1px solid lightgray;
  3610. margin-left: 120rpx;
  3611. }
  3612. .prop-item-image{
  3613. width: 120rpx;
  3614. height: 120rpx;
  3615. position: absolute;
  3616. bottom:-10rpx;
  3617. }
  3618. .prop-item-right{
  3619. position: absolute;
  3620. right:10rpx;
  3621. top:5rpx;
  3622. }
  3623. input::-webkit-input-placeholder,textarea::-webkit-input-placeholder{
  3624. color:#666;
  3625. font-size:12px;
  3626. }
  3627. .clearfix::after {
  3628. content: "";
  3629. display: block;
  3630. clear: both;
  3631. }
  3632. .decoctControlHeader {
  3633. display: flex;
  3634. align-items: center;
  3635. font-weight: 600;
  3636. }
  3637. .decoctControlTop {
  3638. display: flex;
  3639. height: 240rpx;
  3640. border-bottom:1px #B2B2B2 dotted;
  3641. margin:0 40rpx;
  3642. }
  3643. .decoctControlTopLeft {
  3644. width:40%;
  3645. line-height: 2;
  3646. text-align: center;
  3647. margin: 0 15px;
  3648. position: relative;
  3649. }
  3650. .addTemperature {
  3651. border-radius:5px;
  3652. position:absolute;
  3653. background-color: dodgerblue;
  3654. color:white;
  3655. width: 30px;
  3656. height: 30px;
  3657. left:15px;
  3658. top:80px;
  3659. }
  3660. .addTemperatureBtn {
  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. .subTemperature {
  3672. border-radius:5px;
  3673. position:absolute;
  3674. background-color: dodgerblue;
  3675. color:white;
  3676. width: 30px;
  3677. height: 30px;
  3678. right:15px;
  3679. top:80px;
  3680. }
  3681. .subTemperatureBtn {
  3682. border-radius:10px;
  3683. position:absolute;
  3684. clip-path: polygon(50% 0,100% 100%,0 100%);
  3685. transform: scale(0.5);
  3686. left: 0;
  3687. top:0;
  3688. bottom: 0;
  3689. right: 0;
  3690. margin: auto;
  3691. }
  3692. .decoctControlTopRight {
  3693. width:40%;
  3694. line-height: 2;
  3695. text-align: center;
  3696. margin: 0 15px;
  3697. position: relative;
  3698. }
  3699. .decoctControlBottom {
  3700. border-bottom:1px #B2B2B2 dotted;
  3701. width:91vw;
  3702. margin:0 auto;
  3703. padding:10px;
  3704. display: flex;
  3705. justify-content:space-between;
  3706. align-items: center;
  3707. }
  3708. .addTime {
  3709. border-radius:5px;
  3710. position:absolute;
  3711. background-color: dodgerblue;
  3712. color:white;
  3713. width: 30px;
  3714. height: 30px;
  3715. left:15px;
  3716. top:80px;
  3717. }
  3718. .addTimeBtn {
  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. .subTime {
  3730. border-radius:5px;
  3731. position:absolute;
  3732. background-color: dodgerblue;
  3733. color:white;
  3734. width: 30px;
  3735. height: 30px;
  3736. right:15px;
  3737. top:80px;
  3738. }
  3739. .subTimeBtn {
  3740. border-radius:10px;
  3741. position:absolute;
  3742. clip-path: polygon(50% 0,100% 100%,0 100%);
  3743. transform: scale(0.5);
  3744. left: 0;
  3745. top:0;
  3746. bottom: 0;
  3747. right: 0;
  3748. margin: auto;
  3749. }
  3750. .packageControlBottomRight {
  3751. border-radius:5px;
  3752. padding:5px 10px;
  3753. margin-right: 15px;
  3754. background-color: #3c9cff;
  3755. color: #fff;
  3756. }
  3757. .packageControlBottomClear {
  3758. border-radius:5px;
  3759. padding:5px 10px;
  3760. background-color: #B2B2B2;
  3761. color: #fff;
  3762. }
  3763. .active_btn{
  3764. background-color: #3c9cff;
  3765. }
  3766. .baozhuang-sub{
  3767. right: 10rpx !important;
  3768. }
  3769. .baozhuang-add{
  3770. left: 6rpx !important;
  3771. }
  3772. .control-input-box{
  3773. display: flex;
  3774. flex-direction: row;
  3775. padding-left: 26rpx;
  3776. }
  3777. .control-input-box-danwei{
  3778. padding-top:12rpx;
  3779. margin-left:4rpx;
  3780. }
  3781. .tabs{
  3782. position: relative;
  3783. top:15vh;
  3784. }
  3785. .child_tab{
  3786. position: relative;
  3787. display: inline-block;
  3788. width: 25%;
  3789. height: 180rpx;
  3790. }
  3791. .child_img{
  3792. width: 50rpx;
  3793. height: 50rpx;
  3794. left: 66rpx;
  3795. top: 66rpx;
  3796. position: relative;
  3797. }
  3798. .child_title{
  3799. position: absolute;
  3800. left: 0px;
  3801. right: 0px;
  3802. text-align: center;
  3803. font-size: 12px;
  3804. bottom: -12rpx;
  3805. color: #060B25;
  3806. }
  3807. .control{
  3808. width: 100%;
  3809. position: relative;
  3810. }
  3811. .control_item{
  3812. position: relative;
  3813. width: 50%;
  3814. display: inline-block;
  3815. height: 150rpx;
  3816. }
  3817. .control_item_detail{
  3818. position: relative;
  3819. top:22rpx;
  3820. }
  3821. .control_item_left{
  3822. position:absolute;;
  3823. left:22%;
  3824. font-size: 55px;
  3825. z-index: 999;
  3826. top:-30rpx
  3827. }
  3828. .control_item_center{
  3829. position:absolute;;
  3830. left:34%;
  3831. top:0vh;
  3832. }
  3833. .control_item_right{
  3834. position:absolute;;
  3835. left:67%;
  3836. font-size: 34px;
  3837. z-index: 999;
  3838. }
  3839. .control_item_center_unit{
  3840. position: absolute;
  3841. left:26vw;
  3842. top: 0.8vh;
  3843. width:200rpx;
  3844. }
  3845. .control_item_title{
  3846. position: absolute;
  3847. bottom:34rpx;
  3848. font-size: 12px;
  3849. width: 100%;
  3850. text-align: center;
  3851. }
  3852. .bottom{
  3853. height: 190rpx;
  3854. position: absolute;
  3855. left: 0px;
  3856. width: 100%;
  3857. padding-top: 18rpx;
  3858. }
  3859. .bottom_item{
  3860. display: inline-block;
  3861. width: 25%;
  3862. font-size: 12px;
  3863. height: 100%;
  3864. position: relative;
  3865. text-align: center;
  3866. margin-top: 2vh;
  3867. }
  3868. .active_on{
  3869. color: #50ACFF;
  3870. }
  3871. .status_info{
  3872. position: absolute;
  3873. left: 5vw;
  3874. top: 10vh;
  3875. }
  3876. .status_detail{
  3877. display: flex;
  3878. flex-direction: row;
  3879. }
  3880. .status_text{
  3881. font-size: 16px;
  3882. }
  3883. .online_text{
  3884. font-size: 12px;
  3885. padding-top: 3px;
  3886. }
  3887. .online{
  3888. color: #017128;
  3889. }
  3890. .device_info{
  3891. font-size: 13px;
  3892. }
  3893. .control_area{
  3894. position: relative;
  3895. top:19vh;
  3896. }
  3897. .disabled_tab{
  3898. opacity: 0.4;
  3899. }
  3900. .roate{
  3901. transform: rotate(180deg);
  3902. }
  3903. </style>