setting.vue 118 KB

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