detail_new_5.vue 128 KB

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