detail.vue 102 KB

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