detail_new_5.vue 128 KB

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