detail_new_20250528.vue 168 KB

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