detail1.vue 116 KB

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