setting.vue 119 KB

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