detail_6.vue 127 KB

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