detail.vue 103 KB

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