detail_6.vue 127 KB

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