detail.vue 103 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365
  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}}
  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}}<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. debugger;
  780. // this.id = 61;
  781. this.connectMqtt();
  782. this.getDetail();
  783. this.imgUrl = config.imgUrl
  784. this.fixStyle();
  785. // this.fixImage();
  786. // console.log = function(){}
  787. },
  788. destroyed() {
  789. // 取消订阅主题
  790. this.mqttUnSubscribe(this.deviceInfo);
  791. clearTimeout(this.checkTimer);
  792. },
  793. watch: {
  794. turnPercent(newvalue){
  795. // this.lineProgreeStyle = ""
  796. this.lineProgreeStyle = "width:"+newvalue+"%;background:#50ACFF;height: 100%;";
  797. },
  798. pressTurn(newVal,oldValue) {
  799. let self= this;
  800. if(newVal == 1){
  801. setTimeout(function(){
  802. self.startProgressTimer(1);
  803. },200);
  804. }else{
  805. clearInterval(this.lineTimer)
  806. this.turnPercent = 0;
  807. }
  808. },
  809. resetTurn(newVal){
  810. let self= this;
  811. if(newVal == 1){
  812. setTimeout(function(){
  813. self.startProgressTimer(2);
  814. },200);
  815. }else{
  816. clearInterval(this.lineTimer)
  817. this.turnPercent = 0;
  818. }
  819. }
  820. },
  821. methods:{
  822. closeliuzhuanPop(){
  823. this.liuzhuanPopDlg = false;
  824. },
  825. confirmLiuzhuannCurrent(){
  826. if(this.setTurnCurrent<200 || this.setTurnCurrent>400){
  827. this.notifyError("扭力范围为200-400")
  828. return;
  829. }
  830. let arr = [];
  831. let pressObj = {};
  832. pressObj.id = "TurnCurrent";
  833. pressObj.shadow = this.setTurnCurrent;
  834. arr.push(pressObj);
  835. this.mqttPublish(2,this.deviceInfo,arr)
  836. this.closeliuzhuanPop();
  837. },
  838. setPressTurn(){
  839. let self = this;
  840. if(!this.decoctControlOnOffStatus){
  841. this.notifyError("请先开机后再进行操作")
  842. return;
  843. }
  844. let arr = [];
  845. let currentPresturn = this.pressTurn;
  846. let pressObj = {};
  847. if(this.resetTurn == 1){
  848. this.resetTurn = 0;
  849. }
  850. if(currentPresturn == 1){//代表要关闭
  851. pressObj.id = "PressTurn";
  852. pressObj.shadow = 0;
  853. arr.push(pressObj);
  854. this.turnPercent = 0;
  855. this.pressTurn = 0;
  856. }else{//代表要开启
  857. pressObj.id = "PressTurn";
  858. pressObj.shadow = 1;
  859. arr.push(pressObj);
  860. this.pressTurn = 1;
  861. this.resetTurn = 0;
  862. }
  863. this.mqttPublish(2,this.deviceInfo,arr)
  864. this.$forceUpdate()
  865. this.canGetPrsValue = true;
  866. setTimeout(function(){
  867. self.canGetPrsValue = false;
  868. },3000);
  869. },
  870. startProgressTimer(type){
  871. let self = this;
  872. if(self.lineTimer != null){
  873. clearInterval(self.lineTimer)
  874. }
  875. if(type == 1){
  876. self.lineTimer = setInterval(function(){
  877. if(self.turnPercent >=100){
  878. self.turnPercent = 1;
  879. clearInterval(self.lineTimer);
  880. self.startProgressTimer(1);
  881. }
  882. self.turnPercent +=2;
  883. },100);
  884. }else{
  885. self.lineTimer = setInterval(function(){
  886. if(self.turnPercent >=100){
  887. self.turnPercent = 1;
  888. clearInterval(self.lineTimer);
  889. self.startProgressTimer(2);
  890. }
  891. self.turnPercent +=2;
  892. },100);
  893. }
  894. },
  895. setResetTurn(){
  896. let self = this;
  897. if(!this.decoctControlOnOffStatus){
  898. this.notifyError("请先开机后再进行操作")
  899. return;
  900. }
  901. if(this.pressTurn == 1){
  902. this.pressTurn = 0;
  903. }
  904. let arr = [];
  905. if(this.resetTurn == 1){
  906. let pressObj = {};
  907. pressObj.id = "ResetTurn";
  908. pressObj.shadow = 0;
  909. this.resetTurn = 0;
  910. this.turnPercent = 0;
  911. arr.push(pressObj);
  912. }else{
  913. let pressObj = {};
  914. pressObj.id = "ResetTurn";
  915. pressObj.shadow = 1;
  916. this.resetTurn = 1;
  917. this.pressTurn = 0;
  918. let self= this;
  919. arr.push(pressObj);
  920. }
  921. this.mqttPublish(2,this.deviceInfo,arr)
  922. this.$forceUpdate()
  923. this.canGetPrsValue = true;
  924. this.canGetPrsValue = true;
  925. setTimeout(function(){
  926. self.canGetPrsValue = false;
  927. },3000);
  928. },
  929. fixImage(heng){
  930. let self = this;
  931. wx.getSystemInfo({
  932. success: res => {
  933. const { windowWidth, windowHeight, statusBarHeight } = res;
  934. if(heng){
  935. let rate = 0.35;
  936. if(windowHeight<800){
  937. rate = 0.30;
  938. }
  939. let imgHeight = windowWidth*0.85;
  940. let imageWidth = windowWidth * 1;
  941. self.productSize = ";width:"+imageWidth+"px;height:"+imgHeight+"px;";
  942. }else{
  943. let rate = 0.35;
  944. if(windowHeight<800){
  945. rate = 0.30;
  946. }
  947. let imgHeight = windowHeight*rate;
  948. let imageWidth = imgHeight * 0.6;
  949. self.productSize = ";width:"+imageWidth+"px;height:"+imgHeight+"px;";
  950. }
  951. }
  952. })
  953. },
  954. propChange(type){
  955. // if(type == 1){
  956. // }
  957. },
  958. propFocus(type){
  959. if(type == 1){
  960. this.jianyaoWenduSetting = true;
  961. }
  962. if(type == 2){
  963. this.jianyaoShijianSetting = true;
  964. }
  965. if(type == 3){
  966. this.baozhuangFengbianSetting = true;
  967. this.tempFengBianWendu = this.edegTemperature;
  968. this.edegTemperature = this.setEdegTemperature;
  969. }
  970. if(type == 4){
  971. this.baozhuangFengkouSetting = true;
  972. this.tempFengkouWendu = this.sealingTemperature;
  973. this.sealingTemperature = this.setSealingTemperature;
  974. }
  975. if(type == 5){
  976. this.baozhuangRongLiangSetting = true;
  977. }
  978. if(type == 6){
  979. this.baozhuangShuLIangSetting = true;
  980. }
  981. },
  982. autoBlur(type){
  983. },
  984. propBlur(type){
  985. if(type == 1){
  986. this.jianyaoWenduSetting = false;
  987. this.changeTemperature();
  988. }
  989. if(type == 2){
  990. this.temperatureTime = this.leftJianyaoTime;
  991. this.changeTemperatureTime();
  992. }
  993. if(type == 3){
  994. this.setEdegTemperature = this.edegTemperature;
  995. this.changeEdegTemperature();
  996. }
  997. if(type == 4){
  998. this.setSealingTemperature = this.sealingTemperature;
  999. this.changeSealingTemperature();
  1000. }
  1001. if(type == 5){
  1002. this.changePackageVolume()
  1003. }
  1004. if(type == 6){
  1005. this.changePackageNumber();
  1006. }
  1007. },
  1008. modifyName(){
  1009. let self = this;
  1010. uni.showModal({
  1011. title: "修改设备名称",
  1012. editable: true,
  1013. placeholderText: "请输入设备名称",
  1014. content: this.deviceInfo.deviceName,
  1015. showCancel: true,
  1016. success: function (res) {
  1017. console.log(res);
  1018. if(res.confirm){
  1019. let content = res.content;
  1020. let obj = {"deviceId":self.id,deviceName:content};
  1021. editDeviceName(obj).then(res=>{
  1022. if(res.code == 200){
  1023. self.deviceInfo.deviceName = content;
  1024. self.$modal.showToast('修改成功')
  1025. }else{
  1026. self.$modal.showToast('修改失败,请稍后再试')
  1027. }
  1028. });
  1029. }
  1030. },
  1031. fail: function (res) {
  1032. console.log(res);
  1033. }
  1034. })
  1035. },
  1036. showWorkPicker(){
  1037. let self = this;
  1038. uni.showModal({
  1039. title: "提 示",
  1040. content: "非专业人员修改可能导致机器损坏",
  1041. confirmText:"确认",
  1042. success: function (res) {
  1043. if(res.confirm){
  1044. self.showModelPicker = true;
  1045. }
  1046. },
  1047. })
  1048. },
  1049. skip(type){
  1050. if(type == 1){
  1051. wx.navigateToMiniProgram({
  1052. appId: this.appid,
  1053. path: 'pages/news_details/help?id=25',
  1054. success(res) {
  1055. // 打开成功
  1056. },
  1057. fail(res){
  1058. console.log(res);
  1059. }
  1060. })
  1061. }else if(type == 2){
  1062. wx.openCustomerServiceChat({
  1063. extInfo: {url: 'https://work.weixin.qq.com/kfid/kfc4202b8764df71c0c'},
  1064. corpId: 'ww8e678fbe6f1079ba',
  1065. success(res) {
  1066. },
  1067. fail(res){
  1068. console.log(res);
  1069. }
  1070. })
  1071. }
  1072. },
  1073. isMulTab(index){
  1074. let type = this.deviceType;
  1075. if(index == 2){
  1076. if(type == 4 || type == 5){
  1077. return true;
  1078. }
  1079. }
  1080. if(index == 3){
  1081. if(type == 5){
  1082. return true;
  1083. }
  1084. }
  1085. return false;
  1086. },
  1087. isPage(index){
  1088. if(this.tabIndex == index){
  1089. return true;
  1090. }
  1091. return false;
  1092. },
  1093. getUpdateInfo(){
  1094. let self = this;
  1095. getLatestFirmware(this.id).then(res=>{
  1096. self.firmware = res.data;
  1097. let curVersion = self.deviceInfo.firmwareVersion;
  1098. let onlineVersion = self.firmware.version
  1099. if(curVersion>=onlineVersion){
  1100. this.$modal.showToast('当前已经是最新版本')
  1101. }else{
  1102. uni.showModal({
  1103. title: '检测到新版本',
  1104. content: "当前版本:"+curVersion+",新版本:"+onlineVersion,
  1105. cancelText: '取消',
  1106. confirmText: '升级',
  1107. success: function(res) {
  1108. if (res.confirm) {
  1109. self.doUpdate();
  1110. }
  1111. }
  1112. })
  1113. }
  1114. });
  1115. },
  1116. doUpdate(){
  1117. if(this.deviceInfo.status != 3){
  1118. this.notifyError("请等待设备上线后操作")
  1119. return;
  1120. }
  1121. let device = this.deviceInfo;
  1122. let message = "";
  1123. let topic = "";
  1124. let title = "升级";
  1125. topic = "/" + device.productId + "/" + device.serialNumber + "/ota/get";
  1126. message = '{"version":"' + this.firmware.version + '","downloadUrl":"' + this.getDownloadUrl(this.firmware.filePath) + '","size":"'+this.firmware.size+'"}';
  1127. this.$mqttTool.publish(topic, message,title).then(res => {
  1128. this.notifySuccess(res);
  1129. }).catch(res => {
  1130. this.notifyError(res);
  1131. });
  1132. },
  1133. getStatusText(){
  1134. if(this.baozhuangRunning()){
  1135. return "工作中";
  1136. }
  1137. if(this.jianyaoIng()){
  1138. return "工作中";
  1139. }
  1140. if(this.leftAppointmentTime>0){
  1141. return "已预约";
  1142. }
  1143. return "空闲中";
  1144. },
  1145. closeYuyueIngPop(){
  1146. this.yuyueIngPop = false;
  1147. },
  1148. confirmMode(item){
  1149. console.log(item)
  1150. this.workMode = item.value[0].id;
  1151. this.setMode(this.workMode);
  1152. this.closeModelPicker();
  1153. },
  1154. closeModelPicker(){
  1155. this.showModelPicker = false;
  1156. },
  1157. confirmJiaozhunTemp(){
  1158. this.jiaozhunTemp = this.jiaozhunTemp_temp;
  1159. this.temperNumber();
  1160. this.closejiaozhunPop();
  1161. },
  1162. addJiaoZhunTemperature(){
  1163. this.jiaozhunTemp_temp ++;
  1164. if(this.jiaozhunTemp_temp>20){
  1165. this.jiaozhunTemp_temp = 20;
  1166. }
  1167. },
  1168. subJiaoZhunTemperature(){
  1169. this.jiaozhunTemp_temp --;
  1170. if(this.jiaozhunTemp_temp<-20){
  1171. this.jiaozhunTemp_temp = -20;
  1172. }
  1173. },
  1174. closejiaozhunPop(){
  1175. this.jiaozhunPopDlg = false;
  1176. },
  1177. showLiuProp(){
  1178. let self = this;
  1179. uni.showModal({
  1180. title: "提 示",
  1181. content: "非专业人员修改可能导致机器损坏",
  1182. confirmText:"确认",
  1183. success: function (res) {
  1184. if(res.confirm){
  1185. self.liuzhuanPopDlg = true;
  1186. }
  1187. },
  1188. })
  1189. },
  1190. showJiaozhunProp(){
  1191. let self = this;
  1192. uni.showModal({
  1193. title: "提 示",
  1194. content: "非专业人员修改可能导致机器损坏",
  1195. confirmText:"确认",
  1196. success: function (res) {
  1197. if(res.confirm){
  1198. self.jiaozhunTemp_temp = self.jiaozhunTemp;
  1199. self.jiaozhunPopDlg = true;
  1200. }
  1201. },
  1202. })
  1203. },
  1204. fixStyle(){
  1205. let self = this;
  1206. wx.getSystemInfo({
  1207. success: res => {
  1208. const { windowWidth, windowHeight, statusBarHeight } = res;
  1209. // 在这里可以获取到屏幕的宽度和高度
  1210. console.log(windowWidth, windowHeight, statusBarHeight);
  1211. if(windowWidth<=350){
  1212. self.unitFixedStyle = ";padding-top:6px;left: 28vw;";
  1213. self.unitFixedStyle1 = ";padding-top:6px;left: 28vw;";
  1214. }else if(windowWidth>=360){
  1215. self.unitFixedStyle = ";padding-top:10rpx;";
  1216. self.unitFixedStyle1 = ";padding-top:10rpx;left: 32vw;";
  1217. }
  1218. self.maxWidth = windowWidth;
  1219. }
  1220. })
  1221. },
  1222. closePlanIngPop(){
  1223. this.jianyaoPopClose = false;
  1224. this.planIngPopDlg = false;
  1225. },
  1226. closePlanPop(){
  1227. this.planPopDlg = false;
  1228. },
  1229. showBaozhuangDlg(type){
  1230. this.popDlg = true;
  1231. if(type == 1){
  1232. this.fengbianDlgShow = true;
  1233. }else if(type == 2){
  1234. this.fengkouDlgShow = true;
  1235. }else if(type == 3){
  1236. this.wenhuoTimeDlgShow = true;
  1237. }
  1238. },
  1239. closePop(){
  1240. this.popDlg = false;
  1241. this.fengbianDlgShow = false;
  1242. this.fengkouDlgShow = false;
  1243. this.wenhuoTimeDlgShow = false;
  1244. },
  1245. changeTab(index,tag){
  1246. if(!tag){
  1247. return;
  1248. }
  1249. let type = this.deviceType;
  1250. let self = this;
  1251. if(index == 2 || index == 3){
  1252. if(!this.isMulTab(index)){
  1253. return;
  1254. }
  1255. }
  1256. this.resetChoose();
  1257. if(index == 4){
  1258. uni.showLoading({title:"加载中"});
  1259. getDeviceStatus(this.id,0).then(res=>{
  1260. let data =res.data;
  1261. this.deviceInfo = data;
  1262. self.parseStatusData(data)
  1263. setTimeout(function () {
  1264. uni.hideLoading();
  1265. self.firstTab = false;
  1266. },100);
  1267. });
  1268. }else{
  1269. let arr = ["a","b","c"]
  1270. if(type == 4 || type == 5){
  1271. this.childId =arr[index-1];
  1272. this.getDeviceStatus(function(){
  1273. self.tabIndex = index;
  1274. self.firstTab = true;
  1275. self.tabActive[index-1] = true;
  1276. self.$forceUpdate();
  1277. });
  1278. }else{
  1279. this.getDeviceStatus(function(){
  1280. self.tabIndex = index;
  1281. self.firstTab = true;
  1282. self.tabActive[index-1] = true;
  1283. self.$forceUpdate();
  1284. })
  1285. }
  1286. console.log(this.tabActive)
  1287. }
  1288. },
  1289. resetChoose(){
  1290. this.tabIndex = 0;
  1291. for (let i = 0; i < 3; i++) {
  1292. this.tabActive[i] = false;
  1293. }
  1294. },
  1295. changePackageVolume(){
  1296. if(this.packageVolume<50){
  1297. this.packageVolume = 50;
  1298. }
  1299. if(this.packageVolume>300){
  1300. this.packageVolume = 300;
  1301. }
  1302. this.sendBaozhuang("PackingVolume");
  1303. },
  1304. changePackageNumber(){
  1305. let min = 1;
  1306. let max = 999;
  1307. if(this.packageNumber<min){
  1308. this.packageNumber = min;
  1309. }
  1310. if(this.packageNumber>max){
  1311. this.packageNumber = max;
  1312. }
  1313. this.sendBaozhuang("PackageQuantity");
  1314. },
  1315. changeEdegTemperature(){
  1316. let min = 80;
  1317. let max = 220;
  1318. if(this.setEdegTemperature<min){
  1319. this.setEdegTemperature = min;
  1320. }
  1321. if(this.setEdegTemperature>max){
  1322. this.setEdegTemperature = max;
  1323. }
  1324. console.log("current setEdegTemperature is :"+this.setEdegTemperature)
  1325. this.sendBaozhuang("SetBandingTemp");
  1326. },
  1327. changeSealingTemperature(){
  1328. let min = 80;
  1329. let max = 220;
  1330. if(this.setSealingTemperature<min){
  1331. this.setSealingTemperature = min;
  1332. }
  1333. if(this.setSealingTemperature>max){
  1334. this.setSealingTemperature = max;
  1335. }
  1336. console.log("current setSealingTemperature is :"+this.setSealingTemperature)
  1337. this.sendBaozhuang("SetSealTemp");
  1338. },
  1339. changeTemperature(){
  1340. let max = 140;
  1341. let min = 100;
  1342. if(this.workMode == 2){
  1343. min = 1;
  1344. }
  1345. if(this.temperature<min){
  1346. this.temperature = min;
  1347. }
  1348. if(this.temperature>max){
  1349. this.temperature = max;
  1350. }
  1351. console.log("current temperature is :"+this.temperature)
  1352. this.sendJianYao("TempSetting");
  1353. },
  1354. changeTemperatureTime(){
  1355. let min = 1;
  1356. let max = 600;
  1357. if(this.temperatureTime<min){
  1358. this.temperatureTime = min;
  1359. }
  1360. if(this.temperatureTime>max){
  1361. this.temperatureTime = max;
  1362. }
  1363. console.log("current temperatureTime is :"+this.temperatureTime)
  1364. this.sendJianYao("TimeSetting");
  1365. },
  1366. jianyaoOpen(){
  1367. if(this.decoctControlOnOffStatus){
  1368. return true;
  1369. }
  1370. return false;
  1371. },
  1372. baozhuangOpen(){
  1373. if(this.packageControlOnOffStatus){
  1374. return true;
  1375. }
  1376. return false;
  1377. },
  1378. baozhuangRunning(){
  1379. if(this.qingxiTurn || this.baozhuangTurn || this.qitingTurn){
  1380. return true;
  1381. }
  1382. return false;
  1383. },
  1384. jianyaoIng(){
  1385. if(this.decoctControlStatus){
  1386. return true;
  1387. }
  1388. return false;
  1389. },
  1390. cancelPlan(){
  1391. let arr = [];
  1392. let obj = {};
  1393. obj.id = "AppointmentTime";
  1394. obj.shadow = 0;
  1395. arr.push(obj);
  1396. let self = this;
  1397. self.kongzhiJianyao(false,arr);
  1398. this.mqttPublish(2,this.deviceInfo,arr,true);
  1399. this.closeYuyueIngPop();
  1400. },
  1401. toPlan(){
  1402. if(!this.jianyaoOpen()){
  1403. this.$modal.showToast('煎药机已经关机')
  1404. return;
  1405. }
  1406. if(this.leftAppointmentTime>0){
  1407. this.yuyueIngPop = true;
  1408. }else{
  1409. if(this.jianyaoIng()){
  1410. this.$modal.showToast('正在煎药')
  1411. return;
  1412. }
  1413. this.planPopDlg = true;
  1414. }
  1415. },
  1416. calcuStep(){
  1417. if(this.leftAppointmentTime>0){
  1418. this.step = 0;
  1419. return 0;
  1420. }
  1421. if(this.leftJianyaoTime == 0){
  1422. this.step = 100;
  1423. return ;
  1424. }
  1425. let currentTemperature = this.currentTemperature;
  1426. let hightTemperature = this.temperatureTime-this.leftJianyaoTime;//设置的高温时间
  1427. let targetTemperature =100;// this.temperature;
  1428. let targetTemperatureTime = this.temperatureTime;//倒计时
  1429. if(targetTemperature>100){
  1430. targetTemperature = 100;
  1431. }
  1432. let step = 0;
  1433. if(currentTemperature<100){
  1434. let tem = currentTemperature/200*100;
  1435. step = tem;
  1436. }else{
  1437. step = 50;
  1438. let rate = hightTemperature/targetTemperatureTime;
  1439. rate = rate/2;
  1440. rate = rate*100;
  1441. rate = rate.toFixed(2)
  1442. step = step + parseFloat(rate);
  1443. }
  1444. this.step = step.toFixed(2);
  1445. },
  1446. plan(){
  1447. let self = this;
  1448. if(this.planTime>600){
  1449. this.$modal.showToast('预约时间最大为600分钟')
  1450. return;
  1451. }
  1452. if(this.planTime == 0){
  1453. this.$modal.showToast('预约时间不能为空')
  1454. }else{
  1455. let arr = [];
  1456. let obj = {};
  1457. obj.id = "AppointmentTime";
  1458. obj.shadow = this.planTime;
  1459. arr.push(obj);
  1460. this.kongzhiJianyao(true,arr);
  1461. this.mqttPublish(2,this.deviceInfo,arr,true);
  1462. }
  1463. this.$modal.showToast('预约成功')
  1464. this.planPopDlg = false;
  1465. },
  1466. lockCtrl(key){
  1467. let arr = [];
  1468. let obj = {};
  1469. obj.id = "LockControl";
  1470. if(key == 0){
  1471. obj.shadow = 1;
  1472. this.lock.value = 1;
  1473. }else{
  1474. obj.shadow = 0;
  1475. this.lock.value = 0;
  1476. }
  1477. arr.push(obj);
  1478. this.mqttPublish(2,this.deviceInfo,arr)
  1479. },
  1480. setMode(type){
  1481. let arr = [];
  1482. let obj = {};
  1483. obj.id = "WorkMode";
  1484. obj.shadow = type;
  1485. arr.push(obj);
  1486. this.mqttPublish(2,this.deviceInfo,arr,true)
  1487. this.workMode = type;
  1488. },
  1489. temperNumber(value){
  1490. let arr = [];
  1491. let obj = {};
  1492. obj.id = "CalibrationTemp";
  1493. obj.shadow = this.jiaozhunTemp;
  1494. arr.push(obj);
  1495. this.mqttPublish(2,this.deviceInfo,arr,true)
  1496. },
  1497. volumeNumber(){
  1498. let arr = [];
  1499. let obj = {};
  1500. obj.id = "CapacityCalibration";
  1501. obj.shadow = 1;
  1502. arr.push(obj);
  1503. this.mqttPublish(2,this.deviceInfo,arr,true)
  1504. },
  1505. showConfirm(title,content,yes,no){
  1506. uni.showModal({
  1507. title: title,
  1508. content: content,
  1509. success: function (res) {
  1510. if (res.confirm) {
  1511. yes();
  1512. } else if (res.cancel) {
  1513. no();
  1514. }
  1515. }
  1516. });
  1517. },
  1518. reset(){
  1519. let self = this;
  1520. uni.showModal({
  1521. title: "提 示",
  1522. content: "非专业人员修改可能导致机器损坏",
  1523. confirmText:"确认",
  1524. success: function (res) {
  1525. if(res.confirm){
  1526. let arr = [];
  1527. let obj = {};
  1528. obj.id = "RestoreFactory";
  1529. obj.shadow = 1;
  1530. arr.push(obj);
  1531. self.mqttPublish(2,self.deviceInfo,arr)
  1532. }
  1533. },
  1534. })
  1535. },
  1536. turnChange(type){
  1537. let flag = false;
  1538. let obj = {};
  1539. if(type ==3){
  1540. if(this.baozhuangTurn || this.qitingTurn){
  1541. this.$modal.showToast("启停、包装、清洗不能同时打开")
  1542. return;
  1543. }
  1544. flag = this.qingxiTurn;
  1545. obj.id = "WashSwitch";
  1546. }else if(type == 2){
  1547. if(this.qingxiTurn || this.qitingTurn){
  1548. this.$modal.showToast("启停、包装、清洗不能同时打开")
  1549. return;
  1550. }
  1551. flag = this.baozhuangTurn;
  1552. obj.id = "PackageSwitch";
  1553. }else if(type == 1) {
  1554. if(this.qingxiTurn || this.baozhuangTurn){
  1555. this.$modal.showToast("启停、包装、清洗不能同时打开")
  1556. return;
  1557. }
  1558. flag = this.qitingTurn;
  1559. obj.id = "CarrybagSwitch";
  1560. }
  1561. flag = !flag;
  1562. let arr = [];
  1563. if(flag){
  1564. obj.shadow = 1;
  1565. }else{
  1566. obj.shadow = 0;
  1567. }
  1568. arr.push(obj);
  1569. this.mqttPublish(2,this.deviceInfo,arr)
  1570. },
  1571. addPackageVolume(){
  1572. this.packageVolume++;
  1573. if(this.packageVolume>300){
  1574. this.packageVolume = 50;
  1575. }
  1576. console.log("增加包装容量")
  1577. this.changePackageVolume()
  1578. },
  1579. subPackageVolume(){
  1580. this.packageVolume--;
  1581. if( this.packageVolume<50){
  1582. this.packageVolume = 300;
  1583. }
  1584. console.log("减少包装容量")
  1585. this.changePackageVolume()
  1586. },
  1587. addPackageNumber(){
  1588. this.packageNumber++;
  1589. if(this.packageNumber>999){
  1590. this.packageNumber = 1;
  1591. }
  1592. console.log("增加包装数量")
  1593. this.changePackageNumber();
  1594. },
  1595. subPackageNumber(){
  1596. this.packageNumber--;
  1597. if(this.packageNumber<1){
  1598. this.packageNumber = 999;
  1599. }
  1600. console.log("减少包装数量")
  1601. this.changePackageNumber();
  1602. },
  1603. addSealingTemperature(){
  1604. console.log("增加封口温度")
  1605. if(!this.fengkouDlgShow){
  1606. this.fengkouDlgShow = true;
  1607. }
  1608. this.setSealingTemperature++;
  1609. this.changeSealingTemperature();
  1610. },
  1611. subSealingTemperature(){
  1612. console.log("减少封口温度")
  1613. if(!this.fengkouDlgShow){
  1614. this.fengkouDlgShow = true;
  1615. }
  1616. this.setSealingTemperature--;
  1617. this.changeSealingTemperature();
  1618. },
  1619. addEdegTemperature(){
  1620. console.log("增加封边温度")
  1621. this.editing = true;
  1622. if(!this.fengbianDlgShow){
  1623. this.fengbianDlgShow = true;
  1624. }
  1625. this.setEdegTemperature++;
  1626. this.changeEdegTemperature();
  1627. },
  1628. subEdegTemperature(){
  1629. console.log("减少封边温度")
  1630. this.editing = true;
  1631. if(!this.fengbianDlgShow){
  1632. this.fengbianDlgShow = true;
  1633. }
  1634. this.setEdegTemperature--;
  1635. this.changeEdegTemperature();
  1636. },
  1637. addTemperatureTime(){
  1638. console.log("增加煎药时间")
  1639. if(!this.wenhuoTimeDlgShow){
  1640. this.wenhuoTimeDlgShow = true;
  1641. this.temperatureTime = this.leftJianyaoTime;
  1642. }
  1643. this.temperatureTime++;
  1644. this.changeTemperatureTime()
  1645. },
  1646. subTemperatureTime(){
  1647. console.log("减少煎药时间")
  1648. if(!this.wenhuoTimeDlgShow){
  1649. this.wenhuoTimeDlgShow = true;
  1650. this.temperatureTime = this.leftJianyaoTime;
  1651. }
  1652. this.temperatureTime--;
  1653. if(this.temperatureTime<=0){
  1654. this.temperatureTime = 1;
  1655. }
  1656. this.changeTemperatureTime()
  1657. },
  1658. addTemperature(){
  1659. console.log("增加煎药温度")
  1660. this.temperature++;
  1661. this.changeTemperature();
  1662. },
  1663. subTemperature(type){
  1664. console.log("减少煎药温度")
  1665. this.temperature--;
  1666. this.changeTemperature();
  1667. },
  1668. addPlanTime(){
  1669. console.log("增加预约时间")
  1670. this.planTime++;
  1671. },
  1672. subPlanTime(){
  1673. console.log("减少预约时间")
  1674. this.planTime--;
  1675. },
  1676. sendBaozhuang(targetKey){
  1677. let self = this;
  1678. let arr = [];
  1679. if(this.baozhuangTimer != null){
  1680. clearTimeout(this.baozhuangTimer);
  1681. }
  1682. this.baozhuangTimer = setTimeout(function (){
  1683. for (let i = 0; i <this.baozhuangKeys.length; i++) {
  1684. let key = this.baozhuangKeys[i];
  1685. let obj = {};
  1686. obj.id = key;
  1687. if(key === "PackingVolume"){
  1688. obj.shadow = this.packageVolume;
  1689. setTimeout(function (){
  1690. self.baozhuangRongLiangSetting = false;
  1691. },self.resetDuration);
  1692. }
  1693. if(key === "PackageQuantity"){
  1694. obj.shadow = this.packageNumber;
  1695. setTimeout(function (){
  1696. self.baozhuangShuLIangSetting = false;
  1697. },self.resetDuration);
  1698. }
  1699. if(key === "SetSealTemp"){
  1700. obj.shadow = this.setSealingTemperature;
  1701. setTimeout(function (){
  1702. self.fengkouDlgShow = false;
  1703. self.baozhuangFengkouSetting = false;
  1704. self.sealingTemperature = self.tempFengKouWendu;;
  1705. },self.resetDuration);
  1706. }
  1707. if(key === "SetBandingTemp"){
  1708. obj.shadow = this.setEdegTemperature;
  1709. setTimeout(function (){
  1710. self.fengbianDlgShow = false;
  1711. self.baozhuangFengbianSetting = false;
  1712. self.edegTemperature = self.tempFengBianWendu;
  1713. },self.resetDuration);
  1714. }
  1715. if(targetKey == key){
  1716. arr.push(obj);
  1717. break;
  1718. }
  1719. }
  1720. this.mqttPublish(2,this.deviceInfo,arr)
  1721. }.bind(this),500);
  1722. },
  1723. sendJianYao(targetKey){
  1724. let self = this;
  1725. let arr = [];
  1726. if(this.jianyaoTimer != null){
  1727. clearTimeout(this.jianyaoTimer);
  1728. }
  1729. this.jianyaoTimer = setTimeout(function (){
  1730. for (let i = 0; i <this.jianyaoKeys.length; i++) {
  1731. let key = this.jianyaoKeys[i];
  1732. let obj = {};
  1733. obj.id = key;
  1734. if(key === "TempSetting"){
  1735. obj.shadow = this.temperature;
  1736. // setTimeout(function(){
  1737. // self.wenhuoTimeDlgShow = false;
  1738. // self.jianyaoShijianSetting = false;
  1739. // },self.resetDuration)
  1740. }
  1741. if(key === "TimeSetting"){
  1742. obj.shadow = this.temperatureTime;
  1743. self.leftJianyaoTime = this.temperatureTime;;
  1744. setTimeout(function(){
  1745. self.wenhuoTimeDlgShow = false;
  1746. self.jianyaoShijianSetting = false;
  1747. },self.resetDuration)
  1748. }
  1749. if(targetKey == key){
  1750. arr.push(obj);
  1751. break;
  1752. }
  1753. }
  1754. this.mqttPublish(2,this.deviceInfo,arr,true)
  1755. }.bind(this),500);
  1756. },
  1757. buildPropKey(key){
  1758. if(this.childId !=0){
  1759. return key+"_"+this.childId;
  1760. }else{
  1761. return key;
  1762. }
  1763. },
  1764. decoctControlChange(){
  1765. let obj = {};
  1766. let arr = [];
  1767. if(!this.decoctControlOnOffStatus){
  1768. this.notifyError("请先开机后再进行操作")
  1769. return;
  1770. }
  1771. if(this.decoctControlStatus){
  1772. this.showJianyao();
  1773. return;
  1774. }
  1775. this.decoctControlStatus = !this.decoctControlStatus;
  1776. obj.id = "DecoctingSwitch";
  1777. if(this.decoctControlStatus){
  1778. obj.shadow = 1;
  1779. console.log("煎药状态打开")
  1780. this.checkJianyao();
  1781. }else{
  1782. obj.shadow = 0;
  1783. console.log("煎药状态关闭")
  1784. }
  1785. arr.push(obj);
  1786. this.mqttPublish(2,this.deviceInfo,arr,true)
  1787. },
  1788. kongzhiJianyao(flag,arr){//不判断煎药状态
  1789. let obj = {};
  1790. if(!this.decoctControlOnOffStatus){
  1791. this.notifyError("请先开机后再进行操作")
  1792. return;
  1793. }
  1794. obj.id = "DecoctingSwitch";
  1795. if(flag){
  1796. obj.shadow = 1;
  1797. console.log("煎药状态打开")
  1798. this.checkJianyao();
  1799. }else{
  1800. obj.shadow = 0;
  1801. console.log("煎药状态关闭")
  1802. }
  1803. arr.push(obj);
  1804. },
  1805. stopDecoctControlChange(){
  1806. let obj = {};
  1807. let arr = [];
  1808. if(!this.decoctControlOnOffStatus){
  1809. this.notifyError("请先开机后再进行操作")
  1810. return;
  1811. }
  1812. if(!this.decoctControlStatus){
  1813. return;
  1814. }
  1815. this.decoctControlStatus = !this.decoctControlStatus;
  1816. obj.id = "DecoctingSwitch";
  1817. if(this.decoctControlStatus){
  1818. obj.shadow = 1;
  1819. console.log("煎药状态打开")
  1820. }else{
  1821. obj.shadow = 0;
  1822. console.log("煎药状态关闭")
  1823. }
  1824. arr.push(obj);
  1825. let obj2 = {};
  1826. obj2.id = "AppointmentTime";
  1827. obj2.shadow = 0;
  1828. arr.push(obj2);
  1829. this.mqttPublish(2,this.deviceInfo,arr,true)
  1830. },
  1831. decoctControlOnOffChange(){
  1832. let obj = {};
  1833. this.decoctControlOnOffStatus = !this.decoctControlOnOffStatus;
  1834. let arr = [];
  1835. obj.id = "PowerControl";
  1836. let isMul = false;
  1837. if(this.decoctControlStatus){
  1838. this.$modal.showToast('请先结束煎药后操作')
  1839. this.decoctControlOnOffStatus = !this.decoctControlOnOffStatus;
  1840. return;
  1841. }
  1842. if(this.oneToMul && this.firstTab){
  1843. obj.id = "PowerCtl";
  1844. isMul = true;
  1845. }
  1846. if(this.decoctControlOnOffStatus){
  1847. obj.shadow = 1;
  1848. console.log("煎药机开关打开")
  1849. }else{
  1850. obj.shadow = 0;
  1851. console.log("煎药机开关关闭")
  1852. }
  1853. arr.push(obj);
  1854. this.mqttPublish(2,this.deviceInfo,arr,isMul)
  1855. },
  1856. packageControlOnOffChange(){
  1857. let obj = {};
  1858. let arr = [];
  1859. if(this.baozhuangRunning()){
  1860. this.$modal.showToast('请先停止运行后操作')
  1861. return;
  1862. }
  1863. obj.id = "PackagePowerControl";
  1864. this.packageControlOnOffStatus = !this.packageControlOnOffStatus;
  1865. if(this.packageControlOnOffStatus){
  1866. console.log("包装机器开关打开")
  1867. obj.shadow = 1;
  1868. }else{
  1869. console.log("包装机器开关关闭")
  1870. obj.shadow = 0;
  1871. }
  1872. arr.push(obj);
  1873. this.mqttPublish(2,this.deviceInfo,arr)
  1874. },
  1875. containKey(arr,key){
  1876. for (let i = 0; i < arr.length; i++) {
  1877. const data = arr[i];
  1878. if(data == key){
  1879. return true;
  1880. }
  1881. }
  1882. return false;
  1883. },
  1884. // 抽屉状态发生变化触发
  1885. change(e, type) {
  1886. console.log(e);
  1887. },
  1888. showDrawer() {
  1889. this.$refs.showLeft.open();
  1890. },
  1891. closeDrawer() {
  1892. this.$refs.showLeft.close();
  1893. },
  1894. checkItemValue(item){
  1895. if(!item.shadow){
  1896. item.shadow = 0;
  1897. }
  1898. if(!item.unit){
  1899. item.unit = "";
  1900. }
  1901. return true;
  1902. },
  1903. sendProperties(){
  1904. let properties = this.properties;
  1905. for (let i = 0; i < properties; i++) {
  1906. let property = this.properties[i];
  1907. let shadow = property.shadow;
  1908. if(shadow){
  1909. arr.push(property);
  1910. }
  1911. }
  1912. this.mqttPublish(1,this.deviceInfo,arr)
  1913. },
  1914. sendFunctions(){
  1915. let arr = [];
  1916. let functions = this.functions;
  1917. for (let i = 0; i < functions.length; i++) {
  1918. let functionObj = this.functions[i];
  1919. let shadow = functionObj.shadow;
  1920. if(shadow){
  1921. arr.push(functionObj);
  1922. }
  1923. }
  1924. this.mqttPublish(2,this.deviceInfo,arr)
  1925. },
  1926. changeProp(key,val){
  1927. let item = null;
  1928. let obj = null;
  1929. let oneToMul = this.oneToMul;
  1930. if(key === "LockControl"){
  1931. this.lock.value = val;
  1932. item = this.lock;
  1933. }else if(key === "PowerControl"){
  1934. this.power.value = val;
  1935. item = this.power;
  1936. }
  1937. let value = val;
  1938. obj = item.item;
  1939. if(value){
  1940. obj.value = 1;
  1941. obj.shadow = 1;
  1942. }else{
  1943. obj.value = 0;
  1944. obj.shadow = 0;
  1945. }
  1946. if(!oneToMul){
  1947. }
  1948. this.publishThingsModel(this.deviceInfo,obj);
  1949. },
  1950. checkCommonProp(item){
  1951. let id =item.id;
  1952. let isCommonKey = this.modelKey.some(res=>{
  1953. return id === res;
  1954. })
  1955. return !isCommonKey;
  1956. },
  1957. getRunTime(){
  1958. let self = this;
  1959. getDeviceRunTime(this.id).then(res=>{
  1960. self.timeobj = res.data;
  1961. if(self.timeobj.avgtime == ""){
  1962. self.timeobj.avgtime = 0;
  1963. }
  1964. if(self.timeobj.alltime == ""){
  1965. self.timeobj.alltime = 0;
  1966. }
  1967. })
  1968. },
  1969. seeTime(){
  1970. this.showTimeDlg = true;
  1971. this.getRunTime();
  1972. },
  1973. closeTime(){
  1974. this.showTimeDlg = false;
  1975. },
  1976. cancel(){
  1977. this.showErrDlg = false;
  1978. },
  1979. reportError(){
  1980. this.showErrDlg = true;
  1981. },
  1982. doReportError(){
  1983. if(!this.errorMsg){
  1984. this.$modal.showToast('异常信息不能为空')
  1985. }else{
  1986. let self = this;
  1987. let errObj = {};
  1988. errObj.deviceId = this.deviceInfo.deviceId;
  1989. errObj.deviceName = this.deviceInfo.deviceName
  1990. errObj.desc = this.errorMsg;
  1991. errObj.deptId= this.deviceInfo.deptId;
  1992. reportError(errObj).then(res=>{
  1993. self.$modal.showToast(res.msg)
  1994. self.cancel();
  1995. })
  1996. }
  1997. },
  1998. openLocation(){
  1999. uni.openLocation({
  2000. latitude: this.location.latitude,
  2001. longitude: this.location.longitude,
  2002. success: function () {
  2003. console.log('success');
  2004. }
  2005. });
  2006. },
  2007. confirmItemData(e){
  2008. let data = e.value[0];
  2009. this.show.text = data.text;
  2010. this.show.shadow=data.value;
  2011. this.show = null;
  2012. console.log(data);
  2013. },
  2014. send(){
  2015. let shadow = false
  2016. let _arr = []
  2017. this.inputProp.forEach((item)=>{
  2018. _arr.push(item.value)
  2019. })
  2020. // if(_arr.some(val => val === '' || val.length < 0)){
  2021. // shadow = true
  2022. // }
  2023. if(this.deviceInfo.status != 3){
  2024. uni.showToast({
  2025. title:"设备暂未上线",
  2026. icon:"error"
  2027. })
  2028. return;
  2029. }
  2030. if(shadow){
  2031. uni.showToast({
  2032. title:"数据不能为空",
  2033. icon:"error"
  2034. })
  2035. return;
  2036. }
  2037. this.publishThingsModel(this.deviceInfo,this.inputProp.map(item=>{return{"id":item.id,"value":item.value}}))
  2038. },
  2039. /** 更新设备状态 */
  2040. updateDeviceStatus(device) {
  2041. },
  2042. chooseItemData(data){
  2043. if(this.deviceInfo.status != 3){
  2044. uni.showToast({
  2045. title:"设备暂未上线",
  2046. icon:"error"
  2047. })
  2048. return;
  2049. }
  2050. this.columns = [data.enumList];
  2051. this.show =data;
  2052. },
  2053. getDetail(){
  2054. let self = this;
  2055. getDetail(this.id).then(res=>{
  2056. self.deviceInfo = res.data;
  2057. self.deviceType = res.data.type;
  2058. let productId = self.deviceInfo.productId;
  2059. if(productId === 57){
  2060. self.boardType = 5;
  2061. }
  2062. let online = self.deviceInfo.status == 3?true:false;
  2063. if(!online){
  2064. if(!self.onlineStatus){
  2065. uni.showModal({
  2066. title: '系统提示',
  2067. content: "设备未在线,无法操作",
  2068. confirmText: '确定',
  2069. showCancel:false,
  2070. success(res){
  2071. if(res.confirm){
  2072. self.onlineStatus = true;
  2073. }
  2074. },
  2075. })
  2076. }
  2077. }
  2078. console.log("当前设备类型:"+JSON.stringify(self.deviceInfo.type))
  2079. self.location = {
  2080. latitude: self.deviceInfo.latitude,
  2081. longitude: self.deviceInfo.longitude};
  2082. self.sysDept = self.deviceInfo.sysDept;
  2083. self.parseSummay(res.data.summary)
  2084. self.mqttSubscribe(res.data);
  2085. self.getDeviceStatus();
  2086. self.seeTime();
  2087. let heng = false;
  2088. self.productImage = self.imgUrl+'/detail/product.png'
  2089. if(self.deviceType == 4 ||self.deviceType == 5 ){
  2090. self.secondMachine = true;
  2091. }
  2092. if(self.deviceType == 5){
  2093. self.thirdMachine = true;
  2094. }
  2095. if(self.deviceType == 4){
  2096. self.productImage = self.imgUrl+'/product/YJCX20-2&1.png'
  2097. heng = true;
  2098. }
  2099. if(self.deviceType == 1 || self.deviceType == 7){
  2100. self.forthMachine = false;
  2101. self.productImage = self.imgUrl+'/product/YJH20.png'
  2102. }
  2103. if(self.deviceType == 10){
  2104. self.productImage = self.imgUrl+'/product/YJZ20.png'
  2105. }
  2106. let typeArr = [7,8,9,10,11,12];
  2107. for (let i = 0; i < typeArr.length; i++) {
  2108. let typeMa = typeArr[i];
  2109. if(typeMa == self.deviceType){
  2110. self.forthMachine = false;
  2111. }
  2112. }
  2113. self.fixImage(heng);
  2114. self.$forceUpdate();
  2115. });
  2116. },
  2117. getDeviceStatus(func){
  2118. let self = this;
  2119. if(this.summary.length>1){
  2120. }else{
  2121. this.childId = 0;
  2122. }
  2123. uni.showLoading({title:"加载中"});
  2124. getDeviceStatus(this.id,this.childId).then(res=>{
  2125. let data =res.data;
  2126. this.deviceInfo = data;
  2127. self.parseStatusData(data)
  2128. setTimeout(function () {
  2129. uni.hideLoading();
  2130. if(typeof func == "function"){
  2131. func();
  2132. }
  2133. },50);
  2134. });
  2135. },
  2136. getNewDeviceStatus(item){
  2137. console.log(item);
  2138. let self = this;
  2139. if(item.index == 0){
  2140. this.firstTab = true;
  2141. this.getDeviceStatus();
  2142. }
  2143. if(item.index == 1){
  2144. this.firstTab = false;
  2145. getDeviceStatus(this.id,0).then(res=>{
  2146. let data =res.data;
  2147. this.deviceInfo = data;
  2148. self.parseStatusData(data)
  2149. });
  2150. }
  2151. },
  2152. changeSub(item){
  2153. this.childId = item.id;
  2154. this.getDeviceStatus()
  2155. },
  2156. parseEnumList(flag){
  2157. let enumList = this.deviceInfo.enumList;
  2158. for (let enumListElement of enumList) {
  2159. let id = enumListElement.id;
  2160. if(id == 'LockControl'){
  2161. let shadow = enumListElement.shadow;
  2162. this.lock.item = enumListElement;
  2163. if(shadow == 1){
  2164. this.lock.value = true;
  2165. this.lock.loading = false;
  2166. }else if(shadow == 0){
  2167. this.lock.value = false;
  2168. this.lock.loading = false;
  2169. }else{
  2170. this.lock.loading = true;
  2171. }
  2172. }
  2173. if(id == 'PowerControl'){
  2174. let shadow = enumListElement.shadow;
  2175. if(this.oneToMul){
  2176. if(!this.firstTab){
  2177. if(shadow == 1){
  2178. this.decoctControlOnOffStatus = true;
  2179. }else if(shadow == 0){
  2180. this.decoctControlOnOffStatus = false;
  2181. }
  2182. }
  2183. }else{
  2184. if(shadow == 1){
  2185. this.decoctControlOnOffStatus = true;
  2186. }else if(shadow == 0){
  2187. this.decoctControlOnOffStatus = false;
  2188. }
  2189. }
  2190. }
  2191. if(id == 'PowerCtl'){
  2192. if(this.oneToMul && this.firstTab){
  2193. let shadow = enumListElement.shadow;
  2194. if(shadow == 1){
  2195. this.decoctControlOnOffStatus = true;
  2196. }else if(shadow == 0){
  2197. this.decoctControlOnOffStatus = false;
  2198. }
  2199. }
  2200. }
  2201. this.formatValue(id,enumListElement,"PackagePowerControl","packageControlOnOffStatus")
  2202. this.formatValue(id,enumListElement,"DecoctingSwitch","decoctControlStatus")
  2203. this.formatValue(id,enumListElement,"CarrybagSwitch","qitingTurn")
  2204. this.formatValue(id,enumListElement,"WashSwitch","qingxiTurn")
  2205. this.formatValue(id,enumListElement,"PackageSwitch","baozhuangTurn");
  2206. //pressTurn resetTurn
  2207. if(!this.canGetPrsValue){
  2208. if(id == 'PressTurn'){
  2209. let shadow = enumListElement.shadow;
  2210. if(!shadow){
  2211. shadow = 0;
  2212. }
  2213. if(shadow == 1){
  2214. this.pressTurn = 1;
  2215. this.resetTurn = 0;
  2216. }else{
  2217. this.pressTurn = 0;
  2218. }
  2219. }
  2220. if(id == 'ResetTurn'){
  2221. let shadow = enumListElement.shadow;
  2222. if(!shadow){
  2223. shadow = 0;
  2224. }
  2225. if(shadow == 1){
  2226. this.resetTurn = 1;
  2227. this.pressTurn = 0;
  2228. }else{
  2229. this.resetTurn = 0;
  2230. }
  2231. }
  2232. }
  2233. if(id == 'WorkMode'){
  2234. let shadow = enumListElement.shadow;
  2235. if(!shadow){
  2236. shadow = 1;
  2237. }
  2238. this.workMode = shadow;
  2239. }
  2240. let shadow = enumListElement.shadow
  2241. let valueList = enumListElement.enumList;
  2242. for (let valueObj of valueList){
  2243. if(valueObj.value == shadow){
  2244. enumListElement.text = valueObj.text;
  2245. }
  2246. }
  2247. }
  2248. },
  2249. formatValue(id,enumListElement,key,propkey){
  2250. if(id == key){
  2251. let shadow = enumListElement.shadow;
  2252. if(shadow == 1){
  2253. this[propkey] = true;
  2254. }else if(shadow == 0){
  2255. this[propkey] = false;
  2256. }
  2257. }
  2258. },
  2259. parseStatusData(data){
  2260. let self = this;
  2261. cacheJsonThingsModel(data.productId).then(res=>{
  2262. let thingsModel = JSON.parse(res.data);
  2263. let arr = [];
  2264. let arrayList = data.arrayList;
  2265. arr = arr.concat(arrayList);
  2266. let enumList = data.enumList;
  2267. arr = arr.concat(enumList);
  2268. let integerList = data.integerList;
  2269. arr = arr.concat(integerList);
  2270. let stringList = data.stringList;
  2271. arr = arr.concat(stringList);
  2272. self.inputProp = arr;
  2273. for (let i = 0; i < thingsModel.functions.length; i++) {
  2274. for (let j = 0; j < arr.length; j++) {
  2275. let model = arr[j];
  2276. if(model.id == thingsModel.functions[i].id){
  2277. self.functions.push(model);
  2278. }
  2279. }
  2280. }
  2281. for (let i = 0; i < thingsModel.properties.length; i++) {
  2282. for (let j = 0; j < arr.length; j++) {
  2283. let model = arr[j];
  2284. if(model.id == thingsModel.properties[i].id){
  2285. self.properties.push(model);
  2286. }
  2287. }
  2288. }
  2289. let readOnlyList = data.readOnlyList;
  2290. self.watchProp = readOnlyList;
  2291. self.parseEnumList();
  2292. self.parseProp();
  2293. self.checkJianyao();
  2294. })
  2295. },
  2296. showJianyao(){
  2297. this.calcuStep();
  2298. this.planIngPopDlg = true;
  2299. },
  2300. parseProp(){
  2301. let self = this;
  2302. for (let i = 0; i <self.inputProp.length; i++) {
  2303. let prop = self.inputProp[i];
  2304. let value = prop.shadow||0;
  2305. let id = prop.id;
  2306. if(id === "TimeSetting"){//温度设置
  2307. self.temperatureTime = value;
  2308. }
  2309. if(!self.jianyaoWenduSetting){
  2310. if(id === "TempSetting"){
  2311. self.temperature = value;
  2312. }
  2313. }
  2314. this.setPropValue(id,"SlowfireTiem","leftJianyaoTime",value,0)
  2315. this.setPropValue(id,"HighTempTime","hightTemperature",value,0)
  2316. this.setPropValue(id,"CurrentTemp","currentTemperature",value,0)
  2317. this.setPropValue(id,"CalibrationTemp","jiaozhunTemp",value,0)
  2318. this.setPropValue(id,"PackingVolume","packageVolume",value,50)
  2319. this.setPropValue(id,"PackageQuantity","packageNumber",value,1)
  2320. //封边温度
  2321. this.setPropValue(id,"BandingTemp","edegTemperature",value);
  2322. this.setPropValue(id,"BandingTemp","tempFengBianWendu",value)
  2323. //封口温度
  2324. this.setPropValue(id,"SealTemp","sealingTemperature",value);
  2325. this.setPropValue(id,"SealTemp","tempFengKouWendu",value)
  2326. this.setPropValue(id,"LeftAppointmentTime","leftAppointmentTime",value,0)
  2327. this.setPropValue(id,"ValidCurrent","validCurrent",value,0)
  2328. this.setPropValue(id,"TurnCurrent","turnCurrent",value,0)
  2329. self.propMap[id] = prop;
  2330. }
  2331. },
  2332. setPropValue(id,key,propKey,value,defaultValue){
  2333. if(!value && defaultValue){
  2334. value = defaultValue;
  2335. }
  2336. if(id === key){
  2337. this[propKey] = value;
  2338. }
  2339. },
  2340. parseSummay(summary){
  2341. let self = this;
  2342. if(!summary){
  2343. summary = "";
  2344. }
  2345. if(summary.length>0){
  2346. this.summary = JSON.parse(summary);
  2347. if(self.summary.length>0){
  2348. this.oneToMul = true;
  2349. for (let i = 0; i < self.summary.length; i++) {
  2350. self.summary[i].tabName = self.summary[i].name
  2351. }
  2352. let childId = "";
  2353. if(this.oneToMul){
  2354. this.childId = self.summary[0].id;
  2355. }
  2356. }else{
  2357. this.summary = [{name:"煎药机一"}]
  2358. }
  2359. }else{
  2360. this.summary = [{name:"煎药机一"}]
  2361. }
  2362. },
  2363. goDeviceDetail(id){
  2364. uni.navigateTo({
  2365. url: '/pages/device/detail/detail?id='+id
  2366. });
  2367. },
  2368. async connectMqtt() {
  2369. if (this.$mqttTool.client == null) {
  2370. await this.$mqttTool.connect(this.vuex_token);
  2371. }
  2372. this.mqttCallback();
  2373. this.startCheck();
  2374. },
  2375. /** Mqtt订阅主题 */
  2376. mqttSubscribe(device) {
  2377. // 订阅当前设备状态和实时监测
  2378. let topicStatus = '/' + device.productId + '/' + device.serialNumber + '/status/post';
  2379. let topicProperty = '/' + device.productId + '/' + device.serialNumber + '/property/post';
  2380. let topicFunction = '/' + device.productId + '/' + device.serialNumber + '/function/post';
  2381. let topics = [];
  2382. topics.push(topicStatus);
  2383. topics.push(topicProperty);
  2384. topics.push(topicFunction);
  2385. this.$mqttTool.subscribe(topics);
  2386. },
  2387. /** Mqtt取消订阅主题 */
  2388. mqttUnSubscribe(device) {
  2389. // 订阅当前设备状态和实时监测
  2390. let topicStatus = '/' + device.productId + '/' + device.serialNumber + '/status/post';
  2391. let topicProperty = '/' + device.productId + '/' + device.serialNumber + '/property/post';
  2392. let topicFunction = '/' + device.productId + '/' + device.serialNumber + '/function/post';
  2393. let topics = [];
  2394. topics.push(topicStatus);
  2395. topics.push(topicProperty);
  2396. topics.push(topicFunction);
  2397. console.log('取消订阅', topics);
  2398. this.$mqttTool.unsubscribe(topics);
  2399. },
  2400. /* Mqtt回调处理 */
  2401. mqttCallback() {
  2402. this.$mqttTool.client.on('message', (topic, message, buffer) => {
  2403. let topics = topic.split('/');
  2404. let productId = topics[1];
  2405. let deviceNum = topics[2];
  2406. console.log('接收到内容:'+message);
  2407. message = JSON.parse(message.toString());
  2408. if (topics[3] == 'status') {
  2409. console.log('接收到【设备状态-运行】主题:', topic);
  2410. console.log('接收到【设备状态-运行】内容:', message);
  2411. // 更新列表中设备的状态
  2412. if (this.deviceInfo.serialNumber == deviceNum) {
  2413. this.deviceInfo.status = message.status;
  2414. this.deviceInfo.isShadow = message.isShadow;
  2415. this.deviceInfo.rssi = message.rssi;
  2416. this.updateDeviceStatus(this.deviceInfo);
  2417. }
  2418. }
  2419. if (topics[3] == 'property' || topics[3] == 'function') {
  2420. console.log('接收到【物模型】主题:', topic);
  2421. console.log('接收到【物模型】内容:', message);
  2422. if(this.oneToMul){
  2423. let curTabId = this.childId;
  2424. let msg = [];
  2425. for (let i = 0; i < message.length; i++) {
  2426. let curMsg = message[i];
  2427. let id = curMsg.id;
  2428. let ids = id.split("_");
  2429. let value = curMsg.value;
  2430. if(ids.length == 2){
  2431. if(curTabId == ids[1]){
  2432. msg.push({id:ids[0],value:value});
  2433. }
  2434. }else{
  2435. msg.push(curMsg);
  2436. }
  2437. }
  2438. message = msg;
  2439. }
  2440. // 更新列表中设备的属性
  2441. if (this.deviceInfo.serialNumber == deviceNum) {
  2442. for (let j = 0; j < message.length; j++) {
  2443. let isComplete = false;
  2444. let msgId = message[j].id;
  2445. this.exchangeData(msgId,message[j]);
  2446. // 布尔类型
  2447. for (let k = 0; k < this.deviceInfo.boolList.length && !isComplete; k++) {
  2448. if (this.deviceInfo.boolList[k].id == message[j].id) {
  2449. this.deviceInfo.boolList[k].shadow = message[j].value;
  2450. isComplete = true;
  2451. break;
  2452. }
  2453. }
  2454. // 枚举类型
  2455. for (let k = 0; k < this.deviceInfo.enumList.length && !isComplete; k++) {
  2456. if (this.deviceInfo.enumList[k].id == message[j].id) {
  2457. this.deviceInfo.enumList[k].shadow = message[j].value;
  2458. isComplete = true;
  2459. break;
  2460. }
  2461. }
  2462. // 字符串类型
  2463. for (let k = 0; k < this.deviceInfo.stringList.length && !isComplete; k++) {
  2464. if (this.deviceInfo.stringList[k].id == message[j].id) {
  2465. this.deviceInfo.stringList[k].shadow = message[j].value;
  2466. isComplete = true;
  2467. break;
  2468. }
  2469. }
  2470. // 数组类型
  2471. for (let k = 0; k < this.deviceInfo.arrayList.length && !isComplete; k++) {
  2472. if (this.deviceInfo.arrayList[k].id == message[j].id) {
  2473. this.deviceInfo.arrayList[k].shadow = message[j].value;
  2474. isComplete = true;
  2475. break;
  2476. }
  2477. }
  2478. // 整数类型
  2479. for (let k = 0; k < this.deviceInfo.integerList.length && !isComplete; k++) {
  2480. if (this.deviceInfo.integerList[k].id == message[j].id) {
  2481. this.deviceInfo.integerList[k].shadow = message[j].value;
  2482. isComplete = true;
  2483. break;
  2484. }
  2485. }
  2486. // 小数类型
  2487. for (let k = 0; k < this.deviceInfo.decimalList.length && !isComplete; k++) {
  2488. if (this.deviceInfo.decimalList[k].id == message[j].id) {
  2489. this.deviceInfo.decimalList[k].shadow = message[j].value;
  2490. isComplete = true;
  2491. break;
  2492. }
  2493. }
  2494. // 监测数据
  2495. for (let k = 0; k < this.deviceInfo.readOnlyList.length && !isComplete; k++) {
  2496. if (this.deviceInfo.readOnlyList[k].id == message[j].id) {
  2497. this.deviceInfo.readOnlyList[k].shadow = message[j].value;
  2498. // 更新图表
  2499. // for (let m = 0; m < this.monitorChart.length; m++) {
  2500. // if (message[j].id == this.monitorChart[m].data.id) {
  2501. // let data = [{
  2502. // value: message[j].value,
  2503. // name: this.monitorChart[m].data.name
  2504. // }];
  2505. // this.monitorChart[m].chart.setOption({
  2506. // series: [{
  2507. // data: data
  2508. // }]
  2509. // });
  2510. // break;
  2511. // }
  2512. // }
  2513. isComplete = true;
  2514. break;
  2515. }
  2516. }
  2517. }
  2518. this.parseEnumList(true);
  2519. this.checkJianyao();
  2520. if(this.planIngPopDlg){
  2521. this.calcuStep();
  2522. }
  2523. }
  2524. this.$forceUpdate();
  2525. }
  2526. });
  2527. },
  2528. checkJianyao(){
  2529. // if(!this.jianyaoPopClose){
  2530. // return;
  2531. // }
  2532. // let self = this;
  2533. // setTimeout(function(){
  2534. // if(self.decoctControlStatus){
  2535. // self.showJianyao();
  2536. // }
  2537. // },1000);
  2538. },
  2539. exchangeData(msgId,obj){
  2540. if(msgId === "TempSetting"){
  2541. this.temperature = obj.value;
  2542. }
  2543. if(msgId === "TimeSetting"){
  2544. this.temperatureTime = obj.value;
  2545. }
  2546. if(msgId === "CurrentTemp"){
  2547. this.currentTemperature = obj.value;
  2548. }
  2549. if(msgId === "HighTempTime"){
  2550. this.hightTemperature = obj.value;
  2551. }
  2552. if(msgId === "SealTemp"){//封口温度
  2553. if(!this.editing){
  2554. if(this.baozhuangFengkouSetting){
  2555. this.tempFengkouWendu = obj.value;
  2556. }else{
  2557. this.sealingTemperature = obj.value;
  2558. }
  2559. }
  2560. }
  2561. if(msgId === "BandingTemp"){//封边温度
  2562. if(!this.editing){
  2563. if(this.baozhuangFengbianSetting){
  2564. this.tempFengBianWendu = obj.value;
  2565. }else{
  2566. this.edegTemperature = obj.value;
  2567. }
  2568. }
  2569. }
  2570. if(msgId === "PackingVolume"){
  2571. if(!this.editing){
  2572. if(this.baozhuangRongLiangSetting){
  2573. }else{
  2574. this.packageVolume = obj.value;
  2575. }
  2576. }
  2577. }
  2578. if(msgId === "PackageQuantity"){
  2579. if(!this.editing){
  2580. if(this.baozhuangShuLIangSetting){
  2581. }else{
  2582. this.packageNumber = obj.value;
  2583. }
  2584. }
  2585. }
  2586. if(msgId === "LeftAppointmentTime"){
  2587. this.leftAppointmentTime = obj.value;
  2588. }
  2589. if(msgId === "SlowfireTiem"){
  2590. this.leftJianyaoTime = obj.value;
  2591. }
  2592. if(msgId === "CalibrationTemp"){
  2593. this.jiaozhunTemp = obj.value;
  2594. }
  2595. if(msgId === "TurnCurrent"){
  2596. this.turnCurrent = obj.value;
  2597. }
  2598. if(msgId === "ValidCurrent"){
  2599. this.validCurrent = obj.value;
  2600. }
  2601. },
  2602. /** 发布物模型 类型(1=属性,2=功能) */
  2603. publishThingsModel(device, model) {
  2604. // 获取缓存的Json物模型
  2605. cacheJsonThingsModel(device.productId).then(response => {
  2606. let thingsModel = JSON.parse(response.data);
  2607. let type = 0;
  2608. for (let i = 0; i < thingsModel.functions.length; i++) {
  2609. if (model.id == thingsModel.functions[i].id) {
  2610. type = 2;
  2611. break;
  2612. }
  2613. }
  2614. if (type == 0) {
  2615. for (let i = 0; i < thingsModel.properties.length; i++) {
  2616. if (model.id == thingsModel.properties[i].id) {
  2617. type = 1;
  2618. break;
  2619. }
  2620. }
  2621. }
  2622. if (type != 0) {
  2623. this.mqttPublish(type, device, [model]);
  2624. }
  2625. });
  2626. },
  2627. notifyError(res){
  2628. uni.showToast({
  2629. title:res,
  2630. icon:"error"
  2631. })
  2632. },
  2633. notifySuccess(res){
  2634. uni.showToast({
  2635. title:res,
  2636. icon:"success"
  2637. })
  2638. },
  2639. getDownloadUrl(path){
  2640. return this.firmware.downUrl +"/iot/tool/download?fileName="+ path;
  2641. },
  2642. /**
  2643. * Mqtt发布消息
  2644. * @type 类型(1=属性,2=功能,3=OTA升级,4=实时监测)
  2645. * @device 设备
  2646. * @model 物模型
  2647. * */
  2648. mqttPublish(type, device, modelList,needMore) {
  2649. if(this.deviceInfo.status != 3){
  2650. this.notifyError("请等待设备上线后操作")
  2651. return;
  2652. }
  2653. if(modelList.length == 0){
  2654. return;
  2655. }
  2656. let topic = "";
  2657. let message = ""
  2658. let oneToMul = false;
  2659. if(this.summary.length>1){
  2660. oneToMul = true;
  2661. }
  2662. if(!needMore){
  2663. oneToMul = false;
  2664. }
  2665. if(this.firstTab){
  2666. let isKaijiKey = false;
  2667. if(modelList.length >0){
  2668. let modelData = modelList[0];
  2669. let curKeyId = modelData.id;
  2670. if(!this.decoctControlOnOffStatus){
  2671. if(oneToMul){
  2672. if(curKeyId == 'PowerCtl'){
  2673. isKaijiKey = true;
  2674. }
  2675. }else{
  2676. if(curKeyId == 'PowerControl'){
  2677. isKaijiKey = true;
  2678. }
  2679. }
  2680. }else{
  2681. isKaijiKey = true;
  2682. }
  2683. }
  2684. if(!isKaijiKey){
  2685. this.notifyError("请先开机后再进行操作")
  2686. return;
  2687. }
  2688. }else{
  2689. let isKaijiKey = false;
  2690. if(modelList.length >0){
  2691. let modelData = modelList[0];
  2692. let curKeyId = modelData.id;
  2693. if(!this.packageControlOnOffStatus){
  2694. if(curKeyId == 'PackagePowerControl'){
  2695. isKaijiKey = true;
  2696. }
  2697. }else{
  2698. isKaijiKey = true;
  2699. }
  2700. }
  2701. if(!isKaijiKey){
  2702. this.notifyError("请先开机后再进行操作")
  2703. return;
  2704. }
  2705. }
  2706. if (type == 1) {
  2707. if (device.status == 3) {
  2708. // 属性,在线模式
  2709. topic = "/" + device.productId + "/" + device.serialNumber + "/property-online/get";
  2710. }
  2711. } else if (type == 2) {
  2712. if (device.status == 3) {
  2713. // 功能,在线模式
  2714. topic = "/" + device.productId + "/" + device.serialNumber + "/function-online/get";
  2715. }
  2716. } else if (type == 3) {
  2717. // OTA升级
  2718. topic = "/" + device.productId + "/" + device.serialNumber + "/ota/get";
  2719. } else {
  2720. return;
  2721. }
  2722. let title = "";
  2723. if(type == 1){
  2724. title = "属性";
  2725. }else if(type == 2){
  2726. title = "功能";
  2727. }else if(type == 3){
  2728. title = "升级";
  2729. }
  2730. if (topic != "") {
  2731. // 发布
  2732. let arr = [];
  2733. for (let i = 0; i <modelList.length; i++) {
  2734. let model = modelList[i];
  2735. let modelId = model.id;
  2736. if(oneToMul){
  2737. let childId = this.childId;
  2738. if(childId){
  2739. modelId = modelId+"_"+childId;
  2740. }
  2741. }
  2742. let shadow = model.shadow+"";
  2743. let modelType = model.type;
  2744. let shadowInt = parseInt(shadow,10);
  2745. let isNumber = false;
  2746. let shadowStr = shadowInt+"";
  2747. if(shadowStr === shadow){
  2748. isNumber = true;
  2749. shadow = shadowInt;
  2750. }
  2751. if(modelType == "integer" && !isNumber){
  2752. this.$modal.showToast(model.name+'的值必须是数字类型')
  2753. return;
  2754. }
  2755. arr.push({id:modelId,value:shadow+""});
  2756. }
  2757. message = JSON.stringify(arr);
  2758. let self = this;
  2759. this.$mqttTool.publish(topic, message,title).then(res => {
  2760. this.notifySuccess(res);
  2761. }).catch(res => {
  2762. this.notifyError(res);
  2763. });
  2764. }
  2765. },
  2766. startCheck(){
  2767. let self = this;
  2768. this.checkTimer = setTimeout(function (){
  2769. self.sendHeart();
  2770. self.startCheck();
  2771. },20000);
  2772. },
  2773. checkActive(){
  2774. let self = this;
  2775. setTimeout(function (){
  2776. if(self.publishMsg){
  2777. self.resetConn()
  2778. }
  2779. },3000);
  2780. },
  2781. sendHeart(){
  2782. console.log("发送心跳111")
  2783. let device = this.deviceInfo;
  2784. let self = this;
  2785. let topic = "/property-offline/post";
  2786. self.publishMsg = true;
  2787. self.checkActive();
  2788. this.$mqttTool.publish(topic, "ok", "heart").then(res => {
  2789. self.publishMsg = false;
  2790. }).catch(res => {
  2791. self.publishMsg = false;
  2792. });
  2793. },
  2794. resetConn(){
  2795. console.log("检测异常,重连")
  2796. this.$mqttTool.end();
  2797. this.$mqttTool.client = null;
  2798. this.connectMqtt();
  2799. this.getDetail();
  2800. }
  2801. }
  2802. }
  2803. </script>
  2804. <style>
  2805. .send_btn{
  2806. width: 160rpx !important;
  2807. height: 40rpx !important;
  2808. font-size: 10px !important;
  2809. margin-top: 5px;
  2810. }
  2811. uni-col{
  2812. width: 150px;
  2813. }
  2814. .header{
  2815. width: 100%;
  2816. background: white;
  2817. padding:0px 20rpx;
  2818. position: relative;
  2819. height: 100vh;
  2820. position: relative;
  2821. }
  2822. .content {
  2823. display: flex;
  2824. align-items: center;
  2825. justify-content: center;
  2826. color: #060B25;
  2827. }
  2828. .logo {
  2829. height: 200rpx;
  2830. width: 200rpx;
  2831. margin-top: 200rpx;
  2832. margin-left: auto;
  2833. margin-right: auto;
  2834. margin-bottom: 50rpx;
  2835. }
  2836. .text-area {
  2837. margin:10px;
  2838. padding-bottom: 10px;
  2839. justify-content: center;
  2840. width: 100%;
  2841. }
  2842. .grid-text {
  2843. font-size: 14px;
  2844. color: #909399;
  2845. padding: 10rpx 0 20rpx 0rpx;
  2846. /* #ifndef APP-PLUS */
  2847. box-sizing: border-box;
  2848. /* #endif */
  2849. }
  2850. .title {
  2851. font-size: 36rpx;
  2852. color: #8f8f94;
  2853. }
  2854. .item{
  2855. height: 80rpx;
  2856. line-height: 80rpx;
  2857. }
  2858. .bg{
  2859. position: relative;
  2860. }
  2861. .text-left{
  2862. color: #8A92A5;
  2863. }
  2864. .text-right{
  2865. color: #545454;
  2866. }
  2867. .prop-text{
  2868. position: relative;
  2869. margin:20rpx 0;
  2870. font-size: 26rpx;
  2871. }
  2872. .prop-card-area{
  2873. }
  2874. .prop-card{
  2875. width: 28%;
  2876. height: 100rpx;
  2877. text-align: center;
  2878. display: inline-block;
  2879. background: #F5FCFF;
  2880. box-shadow: 0px 9rpx 8rpx 0px rgba(0,0,0,0.09);
  2881. border-radius: 8rpx;
  2882. margin:0px 15rpx;
  2883. line-height: 48rpx;
  2884. }
  2885. .prop-card-top{
  2886. color: #3E9CFC;
  2887. }
  2888. .prop-card-bottom{
  2889. color: #8A92A5;
  2890. }
  2891. .tab-area {
  2892. background: white;
  2893. position: absolute;
  2894. left: 0px;
  2895. right: 0px;
  2896. top:480rpx;
  2897. bottom:-20px;
  2898. min-height: 200rpx;
  2899. box-shadow: 0rpx 5rpx 27rpx 0rpx rgba(195, 195, 195, 0.4);
  2900. border-radius: 40rpx;
  2901. overflow-y: auto;
  2902. padding-bottom:80rpx;
  2903. }
  2904. .prop-item{
  2905. position: relative;
  2906. display: flex;
  2907. flex-direction: row;
  2908. height: 100rpx;
  2909. line-height: 100rpx;
  2910. margin:0 20rpx;
  2911. }
  2912. .prop-item-left{
  2913. color: #545454;
  2914. width: 100%;
  2915. font-size: 16px;
  2916. border-bottom: 1px solid lightgray;
  2917. margin-left: 120rpx;
  2918. }
  2919. .prop-item-image{
  2920. width: 120rpx;
  2921. height: 120rpx;
  2922. position: absolute;
  2923. bottom:-10rpx;
  2924. }
  2925. .prop-item-right{
  2926. position: absolute;
  2927. right:10rpx;
  2928. top:5rpx;
  2929. }
  2930. input::-webkit-input-placeholder,textarea::-webkit-input-placeholder{
  2931. color:#666;
  2932. font-size:12px;
  2933. }
  2934. .clearfix::after {
  2935. content: "";
  2936. display: block;
  2937. clear: both;
  2938. }
  2939. .decoctControlHeader {
  2940. display: flex;
  2941. align-items: center;
  2942. font-weight: 600;
  2943. }
  2944. .decoctControlTop {
  2945. display: flex;
  2946. height: 240rpx;
  2947. border-bottom:1px #B2B2B2 dotted;
  2948. margin:0 40rpx;
  2949. }
  2950. .decoctControlTopLeft {
  2951. width:40%;
  2952. line-height: 2;
  2953. text-align: center;
  2954. margin: 0 15px;
  2955. position: relative;
  2956. }
  2957. .addTemperature {
  2958. border-radius:5px;
  2959. position:absolute;
  2960. background-color: dodgerblue;
  2961. color:white;
  2962. width: 30px;
  2963. height: 30px;
  2964. left:15px;
  2965. top:80px;
  2966. }
  2967. .addTemperatureBtn {
  2968. border-radius:10px;
  2969. position:absolute;
  2970. clip-path: polygon(50% 0,100% 100%,0 100%);
  2971. transform: scale(0.5);
  2972. left: 0;
  2973. top:0;
  2974. bottom: 0;
  2975. right: 0;
  2976. margin: auto;
  2977. }
  2978. .subTemperature {
  2979. border-radius:5px;
  2980. position:absolute;
  2981. background-color: dodgerblue;
  2982. color:white;
  2983. width: 30px;
  2984. height: 30px;
  2985. right:15px;
  2986. top:80px;
  2987. }
  2988. .subTemperatureBtn {
  2989. border-radius:10px;
  2990. position:absolute;
  2991. clip-path: polygon(50% 0,100% 100%,0 100%);
  2992. transform: scale(0.5);
  2993. left: 0;
  2994. top:0;
  2995. bottom: 0;
  2996. right: 0;
  2997. margin: auto;
  2998. }
  2999. .decoctControlTopRight {
  3000. width:40%;
  3001. line-height: 2;
  3002. text-align: center;
  3003. margin: 0 15px;
  3004. position: relative;
  3005. }
  3006. .decoctControlBottom {
  3007. border-bottom:1px #B2B2B2 dotted;
  3008. width:91vw;
  3009. margin:0 auto;
  3010. padding:10px;
  3011. display: flex;
  3012. justify-content:space-between;
  3013. align-items: center;
  3014. }
  3015. .addTime {
  3016. border-radius:5px;
  3017. position:absolute;
  3018. background-color: dodgerblue;
  3019. color:white;
  3020. width: 30px;
  3021. height: 30px;
  3022. left:15px;
  3023. top:80px;
  3024. }
  3025. .addTimeBtn {
  3026. border-radius:10px;
  3027. position:absolute;
  3028. clip-path: polygon(50% 0,100% 100%,0 100%);
  3029. transform: scale(0.5);
  3030. left: 0;
  3031. top:0;
  3032. bottom: 0;
  3033. right: 0;
  3034. margin: auto;
  3035. }
  3036. .subTime {
  3037. border-radius:5px;
  3038. position:absolute;
  3039. background-color: dodgerblue;
  3040. color:white;
  3041. width: 30px;
  3042. height: 30px;
  3043. right:15px;
  3044. top:80px;
  3045. }
  3046. .subTimeBtn {
  3047. border-radius:10px;
  3048. position:absolute;
  3049. clip-path: polygon(50% 0,100% 100%,0 100%);
  3050. transform: scale(0.5);
  3051. left: 0;
  3052. top:0;
  3053. bottom: 0;
  3054. right: 0;
  3055. margin: auto;
  3056. }
  3057. .packageControlBottomRight {
  3058. border-radius:5px;
  3059. padding:5px 10px;
  3060. margin-right: 15px;
  3061. background-color: #3c9cff;
  3062. color: #fff;
  3063. }
  3064. .packageControlBottomClear {
  3065. border-radius:5px;
  3066. padding:5px 10px;
  3067. background-color: #B2B2B2;
  3068. color: #fff;
  3069. }
  3070. .active_btn{
  3071. background-color: #3c9cff;
  3072. }
  3073. .baozhuang-sub{
  3074. right: 10rpx !important;
  3075. }
  3076. .baozhuang-add{
  3077. left: 6rpx !important;
  3078. }
  3079. .control-input-box{
  3080. display: flex;
  3081. flex-direction: row;
  3082. padding-left: 26rpx;
  3083. }
  3084. .control-input-box-danwei{
  3085. padding-top:12rpx;
  3086. margin-left:4rpx;
  3087. }
  3088. .tabs{
  3089. position: relative;
  3090. top:15vh;
  3091. }
  3092. .child_tab{
  3093. position: relative;
  3094. display: inline-block;
  3095. width: 25%;
  3096. height: 180rpx;
  3097. }
  3098. .child_img{
  3099. width: 50rpx;
  3100. height: 50rpx;
  3101. left: 66rpx;
  3102. top: 66rpx;
  3103. position: relative;
  3104. }
  3105. .child_title{
  3106. position: absolute;
  3107. left: 0px;
  3108. right: 0px;
  3109. text-align: center;
  3110. font-size: 12px;
  3111. bottom: -12rpx;
  3112. color: #060B25;
  3113. }
  3114. .control{
  3115. width: 100%;
  3116. position: relative;
  3117. }
  3118. .control_item{
  3119. position: relative;
  3120. width: 50%;
  3121. display: inline-block;
  3122. height: 150rpx;
  3123. }
  3124. .control_item_detail{
  3125. position: relative;
  3126. top:22rpx;
  3127. }
  3128. .control_item_left{
  3129. position:absolute;;
  3130. left:22%;
  3131. font-size: 55px;
  3132. z-index: 999;
  3133. top:-30rpx
  3134. }
  3135. .control_item_center{
  3136. position:absolute;;
  3137. left:34%;
  3138. top:0vh;
  3139. }
  3140. .control_item_right{
  3141. position:absolute;;
  3142. left:67%;
  3143. font-size: 34px;
  3144. z-index: 999;
  3145. }
  3146. .control_item_center_unit{
  3147. position: absolute;
  3148. left:26vw;
  3149. top: 0.8vh;
  3150. width:200rpx;
  3151. }
  3152. .control_item_title{
  3153. position: absolute;
  3154. bottom:34rpx;
  3155. font-size: 12px;
  3156. width: 100%;
  3157. text-align: center;
  3158. }
  3159. .bottom{
  3160. height: 190rpx;
  3161. position: absolute;
  3162. left: 0px;
  3163. width: 100%;
  3164. padding-top: 18rpx;
  3165. }
  3166. .bottom_item{
  3167. display: inline-block;
  3168. width: 25%;
  3169. font-size: 12px;
  3170. height: 100%;
  3171. position: relative;
  3172. text-align: center;
  3173. margin-top: 2vh;
  3174. }
  3175. .active_on{
  3176. color: #50ACFF;
  3177. }
  3178. .status_info{
  3179. position: absolute;
  3180. left: 5vw;
  3181. top: 10vh;
  3182. }
  3183. .status_detail{
  3184. display: flex;
  3185. flex-direction: row;
  3186. }
  3187. .status_text{
  3188. font-size: 16px;
  3189. }
  3190. .online_text{
  3191. font-size: 12px;
  3192. padding-top: 3px;
  3193. }
  3194. .online{
  3195. color: #017128;
  3196. }
  3197. .device_info{
  3198. font-size: 13px;
  3199. }
  3200. .control_area{
  3201. position: relative;
  3202. top:19vh;
  3203. }
  3204. .disabled_tab{
  3205. opacity: 0.4;
  3206. }
  3207. .roate{
  3208. transform: rotate(180deg);
  3209. }
  3210. </style>