detail.vue 128 KB

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