detail.vue 128 KB

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