detail.vue 129 KB

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