detail.vue 129 KB

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