detail.vue 103 KB

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