personal.vue 114 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237
  1. <!-- 新版本跳首页文件修改版本 -->
  2. <template>
  3. <view class="bg-person " :class="bEFHitShake?' screen-jitter ':''">
  4. <uni-nav-bar id="nav-bar" status-bar="true" backgroundColor="RGBA(30, 30, 85, 1)" @clickLeft="showClickEvent()"
  5. color="#FFFFFF" fixed="true" :border="false">
  6. <view slot="left">
  7. <view class=" flex align-center margin-left">
  8. <image class="png-more" src="/static/more.png"></image>
  9. </view>
  10. </view>
  11. <view slot="right">
  12. <view class="flex align-center" style="margin-right: 400rpx;">
  13. <view class="flex align-center justify-between"
  14. style="margin-right: 40rpx; padding: 0 16rpx; height: 56rpx; background-color: rgba(255, 153, 0, 1); border-radius: 13.5px;">
  15. <image class="png-more-black" style="margin-right: 16rpx;"
  16. src="/static/common/sideBar/gold_black@2x.png">
  17. </image>
  18. <view class="text-15px text-center" style="line-height: 56rpx; min-width: 100rpx;">{{cGold}}
  19. </view>
  20. </view>
  21. <view class="flex align-center justify-between"
  22. style="padding: 0 16rpx; height: 56rpx; background-color: rgba(255, 153, 0, 1); border-radius: 13.5px;">
  23. <image class="png-more-black" style="margin-right: 16rpx; width: 36rpx; height: 38rpx;"
  24. src="/static/common/sideBar/diamond_black@2x.png">
  25. </image>
  26. <view class="text-15px text-center" style="line-height: 56rpx; min-width: 100rpx;">{{cDiamond}}
  27. </view>
  28. </view>
  29. </view>
  30. </view>
  31. </uni-nav-bar>
  32. <!-- 导航栏下面滚动区域 -->
  33. <scroll-view class="scroll-class" @scroll="mainScroll" :scroll-top="scrollTop" :scroll-into-view="toView"
  34. scroll-y="true" :style="{ height: scrollviewHight + 'px' }">
  35. <view class="flex align-center">
  36. <view class="justify-center">
  37. <!-- 计划显示 区域 topScrollHight :style="{ height: + '100%' }"-->
  38. <scroll-view scroll-y="true" style="height: 100%; width: 100%;">
  39. <view class="plan-view">
  40. <view class="text-white text-center"
  41. style="background-color: RGBA(30, 30, 85, 1); z-index: 10;">今日击打次数:{{sandbagHitCount}}
  42. </view>
  43. <!-- #ifdef H5 -->
  44. <button @click="onAddSandbagHitCount()">add</button>
  45. <button @click="onReset()">onReset</button>
  46. <button @click="getUserData_hitCount()">getUserData_hitCount</button>
  47. <button @click="uploadUserData_hitCount()">uploadUserData_hitCount</button>
  48. <button @click="onSendMsg()">onSendMsg</button>
  49. <!-- #endif -->
  50. <!-- pk模式下的跳绳 v-if="1 === currentModeIndex"-->
  51. <view v-if="currentMode == 'pkMode'" class="position-relative"
  52. style="height: 128rpx; background-color: RGBA(30, 30, 85, 1); z-index: 10;">
  53. <view style="height: 14rpx;"></view>
  54. <view class="position-absolute-center-top flex justify-center" style="height: 148rpx;">
  55. <view class="flex flex-direction justify-center align-center">
  56. <view class="cu-avatar-group" style="position: relative;">
  57. <view class="cu-avatar round xl" :class="bAiHitShake?' screen-jitter':''"
  58. :style="[{ backgroundImage:'url('+avatarUrl+')' }]"
  59. style="width: 102.4rpx ;height: 102.4rpx;"></view>
  60. </view>
  61. <view style="margin-top: 8rpx; width: 165rpx; "
  62. class="text-cut text-white text-center">
  63. {{userName}}
  64. </view>
  65. </view>
  66. <view class="flex justify-center align-center " style=" width: 300rpx;">
  67. <LEDFont style="" :showValue='AJData.myScore' :size="30" color='#FFFFFF'>
  68. </LEDFont>
  69. <view class="text-white text-bold">:</view>
  70. <LEDFont style="" :showValue='AJData.otherScore' :size="30" color='#FFFFFF'>
  71. </LEDFont>
  72. </view>
  73. <view v-if="finallySelectFriendInfo"
  74. class="flex flex-direction justify-center align-center"
  75. @click="onNavToSelectFriend()">
  76. <view class="cu-avatar-group" style="position: relative;">
  77. <view class="cu-avatar round xl" :class="bHitShake?' screen-jitter':''"
  78. :style="[{ backgroundImage:'url('+finallySelectFriendInfo.avatarUrl+')' }]"
  79. style="width: 102.4rpx ;height: 102.4rpx;">
  80. </view>
  81. </view>
  82. <view style="margin-top: 8rpx; width: 165rpx;"
  83. class="text-cut text-white text-center">
  84. {{finallySelectFriendInfo.username}}
  85. </view>
  86. </view>
  87. <view v-else class="flex flex-direction justify-center align-center"
  88. @click="onNavToSelectFriend()">
  89. <image style="width: 102.4rpx ;height: 102.4rpx;"
  90. src="/static/friend/friend-add.png">
  91. </image>
  92. <view style="margin-top: 8rpx; width: 165rpx;"
  93. class="text-cut text-white text-center">
  94. 选择好友
  95. </view>
  96. </view>
  97. </view>
  98. </view>
  99. <!-- 80rpx -->
  100. <view v-else style="height:14rpx; background-color: RGBA(30, 30, 85, 1);"> </view>
  101. <!-- 进度条 -->
  102. <view class="qiun-charts-arcbar">
  103. <!-- 进度条 -->
  104. <canvas v-show="false" canvas-id="canvasArcbar" id="canvasArcbar"
  105. class="charts-arcbar "></canvas>
  106. <!-- 跳动次数 -->
  107. <view class="position-absolute-center-bottom flex justify-center"
  108. style="align-items: flex-end; height: 276rpx; bottom: 40rpx;">
  109. <LEDFont style="" :showValue='AJData.allCount-AJData.faultCount' :height="120"
  110. :size="120" color='#FF9900'>
  111. </LEDFont>
  112. <LEDFont showValue="/" :height="65" :size="65" color='#FFFFFF'>
  113. </LEDFont>
  114. <LEDFont :showValue='AJData.targetCount' :height="65" :size="65" color='#FFFFFF'>
  115. </LEDFont>
  116. </view>
  117. <!-- 计时器 -->
  118. <view class="position-absolute-right-top" style="top: 76rpx;">
  119. <arcbarCountDown
  120. style="margin-right: 104rpx; border: 2px solid rgb(255,255,255); background-color: RGBA(255, 153, 0, 1); padding: 0px 14px; border-radius: 18px;"
  121. ref="arcbarCountDownRef" :show-day="false" :second="AJData.gameLimitTime"
  122. color="#FFFFFF" background-color="rgba(255,255,255,0)" border-color="#007AFF"
  123. :size="29" splitorColor="#FFFFFF" @timeUp="arcbarCountDownTimeUp"
  124. @timeUpdate="arcbarCountDownTimeUpdate" />
  125. </view>
  126. </view>
  127. <!-- 用于定位 -->
  128. <view id="boxingHitID" class="charts-pring-bottom" v-if="0 === currentModeIndex">
  129. <!-- 添加一个 ConnectBindingDevice 测试 -->
  130. <!-- <boxing-hit ref="boxingPostRef"
  131. :bUpdate="!bHide&&(ConnectBindingDevice!=null)||(cIndex!=-1 && BLEConnectDevice!=null &&
  132. (BLEConnectDevice.deviceType == 'mySelf'||BLEConnectDevice.deviceType == 'BLEHandle' || BLEConnectDevice.deviceType == 'BLERope' ))"
  133. :showTime="localSportTime"
  134. :bRebound="BLEConnectDevice&&BLEConnectDevice.limitType == 'rebound'"
  135. @updateCalorie="boxingUpdateCalorie" @boxingPostCheck="onPersonalCheck"
  136. @shake="onScreenShake" @updateSportTime="onUpdateSportTime"
  137. @boxingGuideFinish="onBoxingGuideFinish"
  138. @boxingPostControlPlay="onActionControlPlay" @modeEvent="onModeEvent"
  139. @hitEvent="onHitEvent" @aiHitEvent="onAiHitEvent" @gameOver="onBoxingGameOver"
  140. @closeBoxingControl="onCloseBoxingHit"></boxing-hit> -->
  141. <action-hit ref="actionHitRef"
  142. :levelData="currentJumpTask!=null?currentJumpTask.item:null"
  143. :currentMode="currentMode" @actionJumpCheck="onPersonalCheck"
  144. @actionJumpControllerPlay="onActionControlPlay"
  145. @actionJumpDataUpdate="onActionJumpDataUpdate" @gameOver="onActionJumpGameOver"
  146. @tipLevel="onTipLevel">
  147. </action-hit>
  148. </view>
  149. <view id='actionJumpID' class="charts-pring-bottom" v-if="1 === currentModeIndex">
  150. <action-jump ref="actionJumpRef"
  151. :levelData="currentJumpTask!=null?currentJumpTask.item:null"
  152. :currentMode="currentMode" @actionJumpCheck="onPersonalCheck"
  153. @actionJumpControllerPlay="onActionControlPlay"
  154. @actionJumpDataUpdate="onActionJumpDataUpdate" @gameOver="onActionJumpGameOver"
  155. @tipLevel="onTipLevel">
  156. </action-jump>
  157. </view>
  158. </view>
  159. </scroll-view>
  160. </view>
  161. </view>
  162. <!-- <view class="example">
  163. <button @click="showGuide('level-game-tip',{levelType:'rotationJump'})">显示 level-game-tip</button>
  164. </view> -->
  165. <!-- <view class="example">
  166. <button @click="onTipLevel">显示 ontipLevel</button>
  167. </view> -->
  168. <!-- <view class="example" style="margin-top: 10rpx;">
  169. <button @click="onNavToDirection">跳转校准页面</button>
  170. </view> -->
  171. <!-- <view class="example">
  172. <button @click="onGetBluetoothConnectView({
  173. hiddenType: 'firstInstallation'
  174. })">显示 bluetoothConnect</button>
  175. </view> -->
  176. <!-- <view class="example">
  177. <button @click="onUserSignIn()">签到</button>
  178. </view> -->
  179. <!-- <view class="example">
  180. <button @click="showGuide('plan', {
  181. hiddenType: 'firstInstallation'
  182. })">计划</button>
  183. </view> -->
  184. <!-- <view class="flex align-center margin text-white">
  185. <view class="title" style="width: 150rpx;">轨迹名称:</view>
  186. <input class="uni-input" style="width: 250rpx; border: 1rpx solid #FFFFFF;" :value="readDataName" @input="onReadDataNameInput"
  187. placeholder="输入轨迹名称" />
  188. <button type="primary" style="width: 250rpx; height: 50rpx; font-size: 14px; line-height: 50rpx;" @click="jumpIdenModule_SearchData">
  189. 获取列表
  190. </button>
  191. </view>
  192. <scroll-view scroll-y="true" style="height: 280rpx; background-color: #c6c6c6;">
  193. <view class="card-view padding-top-sm padding-bottom-sm" v-for="(item,index) in filesList" :key="index"
  194. :id="'task_'+index" :class="item.bRatio?'hardware-border':''">
  195. <view class="flex justify-between align-center">
  196. <view class="flex justify-start align-center">
  197. <view style="margin-left: 10rpx;">
  198. <view style="margin: 5rpx; font-weight: bold; font-size: 18px; color: #565656;">
  199. {{item.cname}}
  200. </view>
  201. </view>
  202. </view>
  203. <image style="margin-right: 60rpx; width: 60rpx;height: 60rpx;"
  204. :src="item.bRatio?'/static/devicesOther/radio-b.png':'/static/devicesOther/radio-g.png'"
  205. mode="aspectFit" @tap="_jumpIdenModule_DownloadReadData(item)"></image>
  206. </view>
  207. </view>
  208. </scroll-view> -->
  209. <!-- <view class="margin-sm "> -->
  210. <!-- <button type="primary" @click="jumpIdenModule_onJumpInit">
  211. 使用本地默认轨迹
  212. </button>
  213. <button type="primary" class=" margin-top-sm" @click="jumpIdenModule_onJumpInitLocalData">
  214. 使用so默认轨迹
  215. </button> -->
  216. <!-- onTestUpdate -->
  217. <!-- <button type="primary" class="margin-top-sm" @click="jumpIdenModule_onTestUpdate">
  218. 模拟跳数据输入
  219. </button> -->
  220. <!-- </view> -->
  221. <view v-if="false" class="cu-list menu card-menu">
  222. <view class="cu-item">
  223. <view class="content">
  224. <text class="cuIcon-title text-green"></text>
  225. <text class="text-grey">输入测试参数</text>
  226. </view>
  227. </view>
  228. <checkbox-group class="block" @change="CheckboxChange">
  229. <view class="cu-form-group">
  230. <view class="title">是否拦截偶数帧数据({{bIgnore}})({{showMs}} ms)</view>
  231. <checkbox :class="bIgnore?'checked':''" :checked="bIgnore?true:false" value="A"></checkbox>
  232. </view>
  233. </checkbox-group>
  234. <view class="cu-item">
  235. <view class="title">frameHitCapacity</view>
  236. <input type="number" inputmode="numeric" class="uni-input"
  237. style=" border: 1rpx solid #000;"
  238. :value="hotmanIntelligentData.frameHitCapacity" @input="onFrameHitCapacityInput"
  239. placeholder="输入frameHitCapacity" />
  240. </view>
  241. <view class="cu-item">
  242. <view class="title">slopeArr</view>
  243. <input class="uni-input"
  244. style=" border: 1rpx solid #000;" :value="hotmanIntelligentData.slopeArr"
  245. @input="onSlopeArrInput" placeholder="输入slopeArr" />
  246. </view>
  247. <view class="cu-item">
  248. <view class="content">
  249. <text class="cuIcon-title text-green"></text>
  250. <text class="text-grey">新协议</text>
  251. </view>
  252. </view>
  253. <view class="cu-item">
  254. <view class="content">
  255. <text class="cuIcon-btn text-green"></text>
  256. <text class="text-grey">默认 (5B0E02141E141E141E0...05D)</text>
  257. </view>
  258. <view class="action">
  259. <button class="cu-btn round bg-green shadow"
  260. @click="onSendBLELightNoSet('5B0E02141E141E141E00000000000000005D')"> 发送</button>
  261. </view>
  262. </view>
  263. <view class="cu-item">
  264. <view class="content">
  265. <text class="cuIcon-btn text-green"></text>
  266. <text class="text-grey">退出(5B0E020...05D)</text>
  267. </view>
  268. <view class="action">
  269. <button class="cu-btn round bg-green shadow"
  270. @click="onSendBLELightNoSet('5B0E0200000000000000000000000000005D')"> 发送</button>
  271. </view>
  272. </view>
  273. <view class="cu-form-group">
  274. <input placeholder="输入自定义指令" :value="readBLELight" @input="onReadBLELightInput"
  275. name="input"></input>
  276. <button class='cu-btn round bg-green shadow' @click="onSendBLELightValue(readBLELight)">发送</button>
  277. </view>
  278. <view class="cu-item">
  279. <view class="content">
  280. <text class="cuIcon-btn text-green"></text>
  281. <text class="text-grey">播放一段闪烁</text>
  282. </view>
  283. <view class="action">
  284. <button class="cu-btn round bg-green shadow" @click="onHitOpenBLELightNew"> 确定</button>
  285. </view>
  286. </view>
  287. </view>
  288. <view v-if="false" class="cu-list menu card-menu">
  289. <view class="cu-item">
  290. <view class="content">
  291. <text class="cuIcon-title text-green"></text>
  292. <text class="text-grey">旧设备</text>
  293. </view>
  294. </view>
  295. <view class="cu-item">
  296. <view class="content">
  297. <text class="cuIcon-btn text-green"></text>
  298. <text class="text-grey">播放一段闪烁</text>
  299. </view>
  300. <view class="action">
  301. <button class="cu-btn round bg-green shadow" @click="onHitOpenBLELight"> 确定</button>
  302. </view>
  303. </view>
  304. </view>
  305. <!-- <button type="primary" @click="B_OpenRopeSkipping">
  306. B_OpenRopeSkipping
  307. </button> -->
  308. <view style="height: 250rpx;"></view>
  309. </scroll-view>
  310. <!-- 底部中间上滑按钮 -->
  311. <view class="flex flex-direction justify-start align-center task-up-button" @tap="showModal"
  312. data-target="slideUpModal">
  313. <image style="width: 248rpx;height: 104rpx;" class="position-absolute-center"
  314. src="../../../static/modal/level-tip/level-tip-bg-orange.png"></image>
  315. <view class="text-blue bg-white radius "
  316. style="z-index: 10; margin-top: 20rpx; width: 72rpx; height: 12rpx;"></view>
  317. </view>
  318. <!-- 右下角导航栏 -->
  319. <round-fab ref="roundFabRef" :connect="cIndex!=-1 && BLEConnectDevice!=null" @fabClick="fabClick"></round-fab>
  320. <!-- 侧边栏 如果app使用 nvue 侧边栏 -->
  321. <!-- #ifdef H5 || MP-WEIXIN -->
  322. <sideBar ref="sideBar"></sideBar>
  323. <!-- #endif -->
  324. <!-- 训练卡 -->
  325. <view class="cu-modal " :class="modalName == 'sportCompletion' ? '' : ''">
  326. <view style="
  327. position: relative;
  328. width: 586rpx;
  329. height: 766rpx;
  330. background-color: #FFFFFF;
  331. border-radius: 25px;
  332. display: inline-block;
  333. vertical-align: middle;
  334. margin-left: auto;
  335. margin-right: auto;
  336. overflow: hidden;">
  337. <view style="position: relative; width: 100%; height: 328rpx;">
  338. <image style="position: absolute;top: 0;left: 0; width: 100%;height: 100%;"
  339. src="../../../static/sidebar_top_bg.png"></image>
  340. <view class="flex flex-direction justify-around align-center"
  341. style="position: relative; height: 100%;">
  342. <view class="text-white">已在哔嘣健身训练了</view>
  343. <view class="text-white"><span style="font-size: 43px;">{{sportData.time}}</span> 分钟</view>
  344. <view class="text-white">本次达标率{{sportData.percent}}%</view>
  345. </view>
  346. </view>
  347. <view class="flex justify-around">
  348. <view class="flex flex-direction justify-around align-center"
  349. style="position: relative; height: 162rpx;">
  350. <view class="text-grey">消耗</view>
  351. <view class="text-grey"><span
  352. style="font-size: 18px; color: #000000;">{{sportData.calorie}}</span> 卡</view>
  353. </view>
  354. <view class="flex flex-direction justify-around align-center"
  355. style="position: relative; height: 162rpx;">
  356. <view class="text-grey">踩中</view>
  357. <view class="text-grey"><span style="font-size: 18px; color: #000000;">{{sportData.hit}}</span>
  358. 次</view>
  359. </view>
  360. <view class="flex flex-direction justify-around align-center"
  361. style="position: relative; height: 162rpx;">
  362. <view class="text-grey">失误</view>
  363. <view class="text-grey"><span style="font-size: 18px; color: #000000;">{{sportData.miss}}</span>
  364. 次</view>
  365. </view>
  366. </view>
  367. <view class="flex flex-direction justify-around align-center margin-top-sm">
  368. <view style="position: relative; width: 500rpx; border:1rpx solid #EEEEEE ;"></view>
  369. </view>
  370. <view class="flex flex-direction justify-around align-center" style="height: 230rpx;">
  371. <view class="text-black text-16px">非常优秀,继续加油!</view>
  372. <view class="flex justify-center align-center text-white make-bg-bPurple round text-16px"
  373. style="width: 300rpx;height: 80rpx;" @tap="hideModal">确定</view>
  374. </view>
  375. </view>
  376. </view>
  377. <!-- :class="modalName == 'jumpAnimation' ? 'show' : ''" -->
  378. <view class="cu-modal " :class="modalName == 'jumpAnimation' ? '' : ''">
  379. <view style="
  380. position: relative;
  381. width: 586rpx;
  382. height: 400rpx;
  383. background-color: #FFFFFF;
  384. border-radius: 4px;
  385. display: inline-block;
  386. vertical-align: middle;
  387. margin-left: auto;
  388. margin-right: auto;
  389. overflow: hidden;">
  390. <view style="height: 100%;display: flex;justify-content: center;align-items: center;">
  391. <character></character>
  392. </view>
  393. </view>
  394. </view>
  395. <!-- 引导蒙层 bGuidePages guideCurrent-->
  396. <!-- <code-elf-guide ref="codeElfGuide" v-if="bGuidePages" @hide="guideHide" @change="onGuideChange"
  397. :current="guideCurrent" :currentMode="currentMode"></code-elf-guide> -->
  398. <view v-if="bStartCountDown" class="CountDownMask">
  399. {{BoxingPostCountDownText}}
  400. </view>
  401. <view class="cu-modal " :class="modalName=='showPlanTipModal'?'show':''"
  402. @touchmove.stop.prevent="moveBoxingHandle">
  403. <view class="cu-bind-modal">
  404. <view style="position: absolute; top: 0; left: 0; width: 100%; height:100%;">
  405. <image style="position: absolute;top: 0;left: 0; width: 100%;height: 100%;"
  406. src="/static/modelBg.png"></image>
  407. </view>
  408. <view class="flex flex-direction justify-between " style="position: relative; height: 100%;">
  409. <view class="flex justify-around justify-center align-center" style="margin: 170rpx 30rpx 0 30rpx;">
  410. <view style="width: 80rpx;height: 2rpx;border-radius: 2px; background-color: #cbcdcf;"></view>
  411. <view class="make-text-bPurple" style=" font-size: 20px;">提示</view>
  412. <view style="width: 80rpx;height: 2rpx;border-radius: 2px;background-color: #cbcdcf;"></view>
  413. </view>
  414. <view class="text-16px" style="align-self: center; max-width: 200px; word-break: break-all;">
  415. {{planTip[planTipIndex]}}
  416. </view>
  417. <view class="flex justify-around align-center"
  418. style=" border-top: 1rpx solid #EEEEEE; margin-bottom: 2px;">
  419. <view class="flex justify-center align-center text-16px" style="width: 100%;height: 123rpx;"
  420. @tap="hidePlanTipModal">取消</view>
  421. <view style="height: 123rpx;width: 1px;background-color: #EEEEEE;"></view>
  422. <view class="flex justify-center align-center text-16px" style="width: 100%;height: 123rpx;"
  423. @tap="confirmPlanTipModal">确定</view>
  424. </view>
  425. </view>
  426. </view>
  427. </view>
  428. <ModalTip ref='modalTipRef' :class="modalName=='showModalTip'?' show':''" @hide="onModalTipHide"
  429. @confirm="onModalTipConfirm"></ModalTip>
  430. <!-- 任务栏 -->
  431. <view class="cu-modal bottom-modal" :class="modalName=='slideUpModal'?'show':''" @tap="hideModal">
  432. <view class="cu-dialog bg-white" style="border-radius: 15px 15px 0 0 ;" @tap.stop="">
  433. <view class="flex justify-center align-center position-relative"
  434. style="width: 750rpx; height: 64rpx; background-color: RGBA(255, 153, 0, 1);" @tap="hideModal">
  435. <view class="text-blue bg-white radius" style="width: 114rpx; height: 12rpx;"></view>
  436. <!-- <view class="position-absolute-right-top">
  437. <image style="width: 64rpx;height: 64rpx;" src="../../../static/common/modal/task-close@2x.png">
  438. </image>
  439. </view> -->
  440. </view>
  441. <view class="flex justify-between" style="width: 100%; padding: 34rpx 60rpx 46rpx 81rpx;">
  442. <view class="flex align-center justify-center">
  443. <view class="text-16px text-bold make-text-bPurple"
  444. style="line-height: 32rpx; margin-right: 18rpx;">{{currentMode == 'pkMode'?'PK模式':'健身模式'}}
  445. </view>
  446. <image style="width: 42rpx;height: 24rpx;" src="/static/common/modal/right-arrow.png"></image>
  447. </view>
  448. <view>
  449. <button class="make-bg-bPurple flex justify-center align-center" @click="onSwitchMode">
  450. <view class="flex align-center justify-center" style="width: 190rpx;height: 60rpx;">
  451. <image style="width: 24rpx;height: 22rpx; margin-right: 18rpx;"
  452. src="/static/personal/switchWhite.png"></image>
  453. <view class="text-14px text-white" style="line-height: 28rpx;">
  454. {{currentMode !== 'pkMode'?'PK模式':'健身模式'}}
  455. </view>
  456. </view>
  457. </button>
  458. </view>
  459. </view>
  460. <scroll-view scroll-y="true" style="height: 800rpx; max-height: 800rpx;min-height: 460rpx;"
  461. :style="{ height: modalHeight + 'px' }" :scroll-into-view="taskIntoView"
  462. :scroll-top="taskScrollTop">
  463. <!-- :class="!item.isUnlock?'':'make-text-bPurple'" -->
  464. <view class="my-column-cu-steps">
  465. <view class="cu-item"
  466. :class="(tempSelectedLevel!=null&&item.id==tempSelectedLevel.item.id)?'make-bg-bPurple-01':''"
  467. v-for="(item,index) in currentTaskList" :key="index" :id='"task_"+index'
  468. @click="selectTask(index,item)">
  469. <image v-if="item.isUnlock" class="my-column-cu-image"
  470. src="../../../static/common/modal/unLock.png"></image>
  471. <image
  472. v-else-if="index>=1&&currentTaskList[index-1].isUnlock&&currentTaskList[index-1].isPassed"
  473. class="my-column-cu-image" src="../../../static/common/modal/canUnlock.png">
  474. </image>
  475. <image v-else class="my-column-cu-image" src="../../../static/common/modal/lock.png">
  476. </image>
  477. <view class="content">
  478. <view class="text-15px text-bold text-cut text-left text-black text-medium"
  479. style="margin-left: 48rpx; width: 360rpx;margin-top: 30rpx;">
  480. {{index+1}}. {{item.name}}
  481. </view>
  482. <view class="flex justify-start align-center" style="margin:20rpx 0 20rpx 86rpx;">
  483. <!-- 居中绘制星星样式 -->
  484. <view class="flex align-center justify-center"
  485. style="margin-right: 36rpx;margin-top: 4rpx;">
  486. <image style="width: 36rpx;height: 36rpx; margin-right: 18rpx;"
  487. src="/static/common/sideBar/sGold.png"></image>
  488. <view class="text-13px text-black text-medium" style="line-height: 26rpx;">
  489. {{item.consumeGold}}
  490. </view>
  491. </view>
  492. <view class="flex align-center justify-center"
  493. style="margin-right: 36rpx;margin-top: 4rpx;">
  494. <image style="width: 38rpx;height: 34rpx; margin-right: 18rpx;"
  495. src="/static/common/sideBar/sDiamond.png"></image>
  496. <view class="text-13px text-black text-medium" style="line-height: 26rpx;">
  497. {{item.consumeDiamond}}
  498. </view>
  499. </view>
  500. </view>
  501. <!-- <view class="text-13px text-grey text-left" style="margin: 20rpx 20rpx 0 86rpx;">
  502. {{item.conditionPassed.explain}}
  503. </view> -->
  504. <view class="flex justify-start align-center" style="margin-left: 86rpx;">
  505. <view class="flex flex-direction align-center" v-for="(item, index) in 5"
  506. :key="index">
  507. <image style="width: 34rpx;height: 32rpx;"
  508. src="../../../static/modal/action-jump/stars.png">
  509. </image>
  510. </view>
  511. </view>
  512. </view>
  513. <image class="my-column-cu-right-image" style="pointer-events:auto;"
  514. src="../../../static/common/modal/medal.png" @click="showPopup('prompt',item)">
  515. </image>
  516. <view v-if="currentJumpTask!=null&&item.id==currentJumpTask.item.id"
  517. class="position-absolute-right-bottom make-text-bPurple text-13px text-medium "
  518. style="right: 70rpx;bottom: 24rpx;">游戏中...</view>
  519. <!-- /static/devicesOther/radio-g -->
  520. <image class="my-column-cu-image"
  521. style="left: 140rpx;top: 70rpx; width: 30rpx;height: 30rpx;"
  522. :src="(tempSelectedLevel!=null&&item.id==tempSelectedLevel.item.id)?'/static/devicesOther/radio-b.png':'.png'"
  523. mode="aspectFit"></image>
  524. </view>
  525. </view>
  526. </scroll-view>
  527. <button class="cu-btn make-bg-bPurple text-white margin-top margin-bottom"
  528. style="width: 604rpx;height: 88rpx;" @tap="onConfirmSelectionLevel">确认</button>
  529. <!-- <button class="cu-btn make-bg-bPurple text-white margin-top margin-bottom"
  530. style="width: 604rpx;height: 88rpx;" @tap="onPassTheLevel">点击直接通过所选关卡</button>
  531. -->
  532. </view>
  533. </view>
  534. <!-- 这里vConsole 是为了解决再页面内显示vconsole -->
  535. <!-- <view id="vconsole" :prop="vLog" :change:prop="vconsole.updateData"></view> -->
  536. </view>
  537. </template>
  538. <!-- 这里vConsole 是为了解决再页面内显示vconsole -->
  539. <!--
  540. // <script module="vconsole" lang="renderjs">
  541. // import VConsole from '../../../util/util-js/vconsole.min.js'
  542. // new VConsole();
  543. // export default {
  544. // mounted() {
  545. // // ...
  546. // },
  547. // data: {
  548. // return () {}
  549. // },
  550. // methods: {
  551. // updateData(newValue, oldValue, ownerInstance, instance) {
  552. // // newValue: 新数据
  553. // // oldValue: 老数据
  554. // var log = console.log.bind(console);
  555. // log(newValue)
  556. // }
  557. // }
  558. // }
  559. // </script>
  560. -->
  561. <script>
  562. // import uniNavBar from '@/components/uni-nav-bar/uni-nav-bar.vue';
  563. import uCharts from '@/components/u-charts/u-charts.js';
  564. import myPicker from '@/components/slambb-picker/slambb-picker.vue';
  565. import pickerData from '@/components/slambb-picker/picker.js';
  566. import date from '@/util/util-js/date.js';
  567. import sideBar from '@/components/side-bar/side-bar.vue';
  568. import reqUtil from '@/util/util-js/requstUtil.js';
  569. import config from '@/common/config.js';
  570. import uniCountDown from '@/components/uni-count-down/uni-count-down.vue'
  571. import character from "@/components/electAni/character.vue"
  572. import fruit from "@/components/fruitMachine/fruitMachine.vue"
  573. import promptBox from "@/components/prompt-box/prompt-box.vue"
  574. import roundFab from "@/components/round-fab/round-fab.vue"
  575. import codeElfGuide from '@/components/code-elf-guide/code-elf-guide.vue'
  576. import boxingPost from "@/components/modal/boxing-post/boxing-post.vue"
  577. import boxingHit from "@/components/modal/boxing-hit/boxing-hit.vue"
  578. import actionHit from "@/components/modal/action-hit/action-hit.vue"
  579. import actionJump from "@/components/modal/action-jump/action-jump.vue"
  580. import AccAndOri from "@/util/util-js/AccAndOri.js"
  581. import AvatarConfig from "@/util/util-js/avatar.js"
  582. import HitEffect from "@/components/effectHit/hitEffect.vue"
  583. import HitFistEffect from "@/components/effectHit/hitFistEffect.vue"
  584. import ModalTip from "@/components/modal-tip/modalTip.vue"
  585. import keyboardListener from '@/components/keyboard-listener/keyboard-listener.vue'
  586. import LEDFont from '@/components/LEDFont/LEDFont.vue'
  587. import arcbarCountDown from '@/components/uni-count-down/uni-count-down.vue'
  588. import modalMask from '@/components/modal-mask/modal-mask.vue'
  589. // 获取 module
  590. // var testModule = uni.requireNativePlugin("MyAttitude")
  591. // const modal = uni.requireNativePlugin('modal');
  592. import {
  593. mapState,
  594. mapMutations
  595. } from 'vuex';
  596. var _self;
  597. var canvaArcbar1;
  598. export default {
  599. computed: mapState(['bCanvasShow', 'forcedLogin', 'hasLogin', 'userName', 'avatarUrl', 'days', 'remainingDays',
  600. 'signature', 'weight', 'height', 'planData', 'BLEDeviceShowList', 'BLEConnectDevice', 'bPlanExpired',
  601. 'bPlanFinish',
  602. 'bGuidePages',
  603. 'globalAcc', 'globalOri', 'DeviceBindingList', 'ConnectBindingDevice', 'cIndex', 'bNewGuide',
  604. 'localSportTime',
  605. 'currentModeIndex', 'oldArcbarProCalorie', 'oldArcbarAllCalorie', 'bOpenBluetooth', 'bOpenSuccess',
  606. 'bListenAdapterStateChange', 'bConnection', 'bVerifiedConnection', 'currentInstruction',
  607. 'instructionState',
  608. 'LocationGameUrl',
  609. 'bPhoneMatched',
  610. 'versionCodeState',
  611. 'platform',
  612. 'systemInfo', 'navHeight', 'tabbarHeight',
  613. 'cDiamond', 'cGold',
  614. 'finallySelectFriendInfo',
  615. 'currentJumpTask', 'singlePersonList', 'multiPersonList',
  616. 'guideUnlockState',
  617. 'sandbagHitCount',
  618. 'readDataName',
  619. 'filesList',
  620. 'readBLELight',
  621. 'hotmanData',
  622. 'hotmanIntelligentData',
  623. 'bIgnore'
  624. ]),
  625. components: {
  626. // uniNavBar,
  627. myPicker,
  628. sideBar,
  629. uniCountDown,
  630. character,
  631. fruit,
  632. roundFab,
  633. codeElfGuide,
  634. boxingPost,
  635. boxingHit,
  636. promptBox,
  637. HitEffect,
  638. HitFistEffect,
  639. ModalTip,
  640. keyboardListener,
  641. actionHit,
  642. actionJump,
  643. LEDFont,
  644. arcbarCountDown,
  645. modalMask
  646. },
  647. data() {
  648. return {
  649. title: 'pk模式', //pk模式 健身模式
  650. modalName: null,
  651. originalDate: '', //记录new date
  652. currentDate: '', //当前日期
  653. cWidthArcbar: '', //圆弧进度图
  654. cHeightArcbar: '', //圆弧进度图
  655. arcbarWidth: '', //圆弧进度图,进度条宽度,此设置可使各端宽度一致
  656. pixelRatio: 1,
  657. // textarea: '',
  658. // arcbarImagePath: '/static/logo.png',
  659. // cWidth: '',
  660. // cHeight: '',
  661. scrollviewHight: '',
  662. // 顶部区域部分
  663. topScrollHight: '',
  664. // 选择器
  665. pickerObj: {},
  666. // lineAImagePath: '/static/logo.png',
  667. // visible: true,
  668. // indicatorStyle: `height: ${Math.round(uni.getSystemInfoSync().screenWidth / (750 / 100))}px;`,
  669. //设备列表
  670. deviceList: [{
  671. name: '蹦床',
  672. icon: '/static/trampoline.png'
  673. }],
  674. cState: 1,
  675. //游戏列表
  676. gameList: [],
  677. //视频列表,现在视频是和游戏一起管理
  678. videoList: [],
  679. //运动数据
  680. sportData: {
  681. calorie: 0,
  682. hit: 0,
  683. miss: 0,
  684. percent: 0,
  685. time: 0,
  686. allData: 0
  687. },
  688. //设置滚动栏高度
  689. scrollTop: 0,
  690. //scroll view 跳转到对应的组件上
  691. toView: '',
  692. guideCurrent: 0,
  693. bHide: false,
  694. //屏幕抖动
  695. bEFHitShake: false,
  696. bStartBoxingPost: false,
  697. bStartCountDown: false,
  698. BoxingPostCountDownText: 3,
  699. b_countDown: null,
  700. countDownUrl: [
  701. "/static/personal/audio/GO.mp3",
  702. "/static/personal/audio/1.mp3",
  703. "/static/personal/audio/2.mp3",
  704. "/static/personal/audio/3.mp3"
  705. ],
  706. threeUrl: "/static/personal/audio/3.mp3",
  707. twoUrl: "/static/personal/audio/2.mp3",
  708. oneUrl: "/static/personal/audio/1.mp3",
  709. goUrl: "/static/personal/audio/GO.mp3",
  710. dangdang: "/static/personal/audio/dangdang.mp3",
  711. personalAudioContext: null,
  712. planTip: [
  713. '您今天的目标已经达成,是否进行自由训练.',
  714. '您今天的目标还没完成,是否结束训练.'
  715. ],
  716. planTipIndex: 0,
  717. //匹配的ai信息
  718. aiObj: {
  719. name: '匿名',
  720. avatar: '/static/defaultAvatar.png'
  721. },
  722. aiOldObj: {
  723. name: '匿名',
  724. avatar: '/static/defaultAvatar.png'
  725. },
  726. currentMode: 'calorieMode', //pkMode calorieMode
  727. bHitShake: false,
  728. bAiHitShake: false,
  729. //限制重连,比如去了对应硬件连接页面,限制这个页面的重连操作
  730. bLimitReconnection: false,
  731. /**
  732. * 首页这里连接了蓝牙,然后选择框回来后show会触发,触发时候检测一下是否有对应的
  733. * 匹配蓝牙
  734. */
  735. bGetBondTesting: false,
  736. basicsList: [{
  737. cuIcon: 'usefullfill',
  738. name: '开始',
  739. bLock: false,
  740. }, {
  741. cuIcon: 'radioboxfill',
  742. name: '等待',
  743. bLock: true,
  744. },
  745. {
  746. cuIcon: 'roundclosefill',
  747. name: '错误'
  748. }, {
  749. cuIcon: 'roundcheckfill',
  750. name: '完成'
  751. },
  752. {
  753. cuIcon: 'roundcheckfill',
  754. name: '完成'
  755. },
  756. {
  757. cuIcon: 'roundcheckfill',
  758. name: '完成'
  759. },
  760. ],
  761. basics: 3,
  762. currentTask: null, //当前选择的任务
  763. taskIntoView: '',
  764. taskScrollTop: 0,
  765. currentTaskList: [],
  766. nextTaskCanUnlock: false, //下一个关卡是否可解锁
  767. /**
  768. * actionJump 模块对应的交互参数
  769. */
  770. AJData: {
  771. allCount: 0,
  772. faultCount: 0,
  773. targetCount: 0,
  774. perCountDown: 0,
  775. gameCountDown: 0,
  776. //pk部分参数
  777. myScore: 0, //左边自己的分数
  778. otherScore: 0, //右边好友的分数
  779. myUsageTime: 0,
  780. otherUsageTime: 0,
  781. isLeftPlayer: true,
  782. isFinish: false,
  783. gameLimitTime: 0,
  784. describe: '', //关卡说明
  785. },
  786. defaultAJData: null,
  787. bGamePlaying: false,
  788. /**
  789. * 任务参数
  790. */
  791. modalHeight: 300,
  792. vLog: '',
  793. /**
  794. * 任务关卡相关
  795. */
  796. tempSelectedLevel: null,
  797. bShowComplete: false,
  798. /**
  799. * 记录一个旧的index
  800. */
  801. oldModeIndex: 1,
  802. checkbox: [{
  803. value: 'A',
  804. checked: true
  805. }],
  806. showMs:0,
  807. oldMs:0,
  808. };
  809. },
  810. onLoad() {
  811. //设置self
  812. _self = this;
  813. // 圆形进度条样式
  814. this.cWidthArcbar = uni.upx2px(415); //这里要与样式的宽高对应
  815. this.cHeightArcbar = uni.upx2px(440); //这里要与样式的宽高对应
  816. this.arcbarWidth = uni.upx2px(14);
  817. // 体重数据样式
  818. // this.cWidth = uni.upx2px(750);
  819. // this.cHeight = uni.upx2px(300);
  820. // #ifdef APP-PLUS || H5
  821. //监听
  822. uni.$on('updateArcbarData', this.updateArcbarData);
  823. // #endif
  824. //监听
  825. uni.$on('callbackCloseBLE', this.callbackCloseBLE);
  826. // uni.$on('callbackBLEState', this.callbackBLEState);
  827. //获得游戏列表
  828. // reqUtil
  829. // .requestData(config.URL.GAMERECOMMENDBYPLATFORM, {
  830. // recommendType: 2,
  831. // endTime: config.endTime
  832. // })
  833. // .then(
  834. // res => {
  835. // // console.log('GAMERECOMMEND =====', res);
  836. // if (res.code == 0) {
  837. // if (res.data.gameList.length > 3) {
  838. // this.gameList = this.gameList.concat(res.data.gameList.slice(0, 3));
  839. // } else {
  840. // this.gameList = this.gameList.concat(res.data.gameList);
  841. // }
  842. // }
  843. // },
  844. // e => {
  845. // console.log(e);
  846. // }
  847. // );
  848. //获得视频列表
  849. // reqUtil
  850. // .requestData(config.URL.GAMERECOMMENDBYPLATFORM, {
  851. // recommendType: 1,
  852. // endTime: config.endTime
  853. // })
  854. // .then(
  855. // res => {
  856. // if (res.code == 0) {
  857. // if (res.data.gameList.length > 3) {
  858. // this.videoList = this.videoList.concat(res.data.gameList.slice(0, 3));
  859. // } else {
  860. // this.videoList = this.videoList.concat(res.data.gameList);
  861. // }
  862. // }
  863. // },
  864. // e => {
  865. // console.log(e);
  866. // }
  867. // );
  868. //初始化后设置一下pickerObj
  869. this.pickerObj = {
  870. pickerLeftList: pickerData.getWeightList().leftList,
  871. pickerRightList: pickerData.getWeightList().rightList,
  872. pickerType: 'doubleItem',
  873. pickerUnit: '公斤',
  874. pickerTitle: '记体重',
  875. defaultValue: this.weight,
  876. showInput: true,
  877. };
  878. this.getPlanData(function() {
  879. // 如果个人页面直接获取数据
  880. _self.showArcbar();
  881. });
  882. this.personalAudioContext = uni.createInnerAudioContext();
  883. this.personalAudioContext.autoplay = false;
  884. this.personalAudioContext.src = this.dangdang;
  885. this.personalAudioContext.volume = 1;
  886. //获取本地记录的运动时间
  887. uni.getStorage({
  888. key: 'localSportTime',
  889. success: function(res) {
  890. // console.log("本地的时间:",res.data);
  891. _self.$store.state.localSportTime = res.data;
  892. }
  893. });
  894. //获取设备信息,上报服务器
  895. this.gOnAddClientInfo();
  896. this.registerPopupEvent();
  897. //获取任务数据
  898. this.getLevelList(() => {
  899. this.switchTaskInfo();
  900. });
  901. //钱包信息
  902. this.getUserWallets();
  903. //测试socket
  904. // console.log('test*******************************');
  905. // this.$testWS.connectSocket(()=>{
  906. // this.$testWS.sendSocketMessage('unity');
  907. // });
  908. //复制一个默认参数
  909. this.defaultAJData = Object.assign({}, this.AJData);
  910. //用户签到列表
  911. this.getSignInList();
  912. uni.$on("onLog", this.onLog);
  913. //人物列表变化处理监听
  914. uni.$on("onSwitchTaskList", this.onSwitchTaskList);
  915. //获取对应的用户数据,并且设置记录的打击数据
  916. this.getUserData_hitCount();
  917. //获取记录的数据
  918. this.onGetReadDataName();
  919. plus.globalEvent.addEventListener("onTestModuleUpdate", this.onTestModuleUpdateCallback);
  920. //初始化一个android数据
  921. this.jumpIdenModule_onJumpInit();
  922. //
  923. this.onGetReadBLELight();
  924. this.onGetHotmanIntelligentData();
  925. },
  926. onShow() {
  927. _self.bHide = false;
  928. if (canvaArcbar1)
  929. _self.updateArcbarData();
  930. //this.bConnection &&
  931. if (this.bVerifiedConnection && this.BLEConnectDevice) {
  932. this.updateBLECIndex();
  933. // setTimeout(() => {
  934. // /**
  935. // * 如果是首页连接,则检测
  936. // */
  937. // if (this.bGetBondTesting) {
  938. // this.onGetBondDevice();
  939. // this.bGetBondTesting = false;
  940. // }
  941. // }, 5000)
  942. }
  943. //如果是测试数据
  944. // if (this.ConnectBindingDevice) {
  945. // if (this.$refs.boxingPostRef) {
  946. // this.$refs.boxingPostRef.onSetMode('pkMode');
  947. // } else {
  948. // setTimeout(() => {
  949. // this.$refs.boxingPostRef.onSetMode('pkMode');
  950. // }, 500)
  951. // }
  952. // }
  953. console.log('personal show');
  954. this.bLimitReconnection = false;
  955. //测试环境检测,给个modal提示 active
  956. // if (config.active == 'dev') {
  957. // function thanDate(date2) {
  958. // var oDate1 = new Date();
  959. // console.log("检测日期", oDate1);
  960. // var oDate2 = new Date(date2);
  961. // if (oDate1.getTime() > oDate2.getTime()) {
  962. // return true;
  963. // } else {
  964. // return false;
  965. // }
  966. // }
  967. // if (thanDate('2021-05-31 13:10:36')) {
  968. // uni.showModal({
  969. // title: "提示",
  970. // content: "此版本为测试版本,有需要请和开发者联系。微信 sweetdontcry"
  971. // })
  972. // }
  973. // }
  974. // #ifdef APP-PLUS
  975. if (this.guideUnlockState.firstInstallation) {
  976. // 根据onshow 去调用first显示。 由于 onShow生命周期比 onReady 快。所以此时没有 注册 onShowFirstInstallation
  977. // 即 onShowFirstInstallation 是调用不到的
  978. uni.$emit("onShowFirstInstallation");
  979. }
  980. // #endif
  981. },
  982. onReady() {
  983. //限制开始点击播放
  984. setTimeout(() => {
  985. _self.bShowComplete = true;
  986. // console.log("=============>", _self.bShowComplete);
  987. }, 500)
  988. // 计算屏幕剩余高度 填补剩余高度
  989. // 计算组件的高度
  990. _self.scrollviewHight = this.systemInfo.windowHeight - this.navHeight - this.tabbarHeight - 10 - this
  991. .systemInfo
  992. .statusBarHeight;
  993. console.log("personal onReady");
  994. // #ifdef APP-PLUS
  995. //第一步提示设置计划,之后在回调registerPopupEvent 中处理
  996. //第一次安装登录。提示 计划,这里注册一次信息
  997. uni.$on("onShowFirstInstallation", this.onShowFirstInstallation);
  998. if (this.guideUnlockState.firstInstallation) {
  999. // 如果新安装便触发一次,新手调用
  1000. uni.$emit("onShowFirstInstallation");
  1001. }
  1002. // #endif
  1003. this.onConnectSocket();
  1004. },
  1005. onUnload() {
  1006. console.log("personal ********* onUnload *********");
  1007. uni.$off("onLog", this.onLog);
  1008. //人物列表变化处理监听
  1009. uni.$off("onSwitchTaskList", this.onSwitchTaskList);
  1010. // #ifndef APP-PLUS||H5
  1011. //监听
  1012. console.log('移除监听');
  1013. uni.$off('updateArcbarData', this.updateArcbarData);
  1014. // #endif
  1015. //*****注释蓝牙操作******
  1016. uni.$off('callbackCloseBLE', this.callbackCloseBLE);
  1017. // uni.$off('callbackBLEState', this.callbackBLEState);
  1018. uni.$off('updateBLEDeviceData', this.callbackUpdateBLEData);
  1019. //unload 时候清除timeout
  1020. this.onUnloadCreateBLEConnectionTimeout();
  1021. this.unregisterPopupEvent();
  1022. uni.$off("onShowFirstInstallation", this.onShowFirstInstallation);
  1023. this.onCloseSocket();
  1024. },
  1025. onHide() {
  1026. _self.bHide = true;
  1027. console.log("personal ******* onHide *******");
  1028. //时间暂停 ,隐藏了 需要判断是否为空
  1029. if (_self.$refs.countDownObj)
  1030. _self.$refs.countDownObj.timePause('pause');
  1031. //心电图暂停
  1032. if (_self.$refs.electRef)
  1033. _self.$refs.electRef.pausedElect(true);
  1034. },
  1035. methods: {
  1036. ...mapMutations(['accountLogin', 'getPlanData', 'addlocalCalorie', 'setLocalCalorie', 'setShowCalorie',
  1037. 'syncLocalDataToServer', 'syncRequestEvent', 'setLocalSportTime',
  1038. 'initAdapter', 'onCreateBLEConnection', 'onUnloadCreateBLEConnectionTimeout', 'onCloseBLEConnection',
  1039. 'gOnAddClientInfo', 'onWriteBLEConnectionValue',
  1040. 'gCreateFilterObj', 'gUpdateFilter', 'B_GetBondedDevices', 'B_OpenBLESetting', 'B_OpenRopeSkipping',
  1041. 'B_CloseRopeSkipping',
  1042. 'gCreateSandbagAlgorithm', 'gUpdateSandbagAlgorithm', 'gIntelligentCreateSandbagAlgorithm',
  1043. 'gIntelligentUpdateSandbagAlgorithm',
  1044. 'gStartSimulateBLEUpdate',
  1045. 'gStopSimulateBLEUpdate',
  1046. 'getActionJumpTask',
  1047. 'setActionJumpTask', 'getLevelList',
  1048. 'getUserWallets', 'setGoldAndDiamond',
  1049. 'onConvertDeviceData',
  1050. 'showDrawerById', 'showPopupById', 'showGuideById',
  1051. 'closeDrawerById', 'closePopupById', 'closeGuideById',
  1052. 'getSignInList', 'onUserSignIn',
  1053. 'setGuideUnlockState',
  1054. 'resetActionJumpTask',
  1055. 'getUserData_hitCount',
  1056. 'uploadUserData_hitCount', 'getUserData_hitCount',
  1057. 'addSandbagHitCount', , 'onConnectSocket', 'onCloseSocket', 'onSendSocketMessage',
  1058. //算法相关START
  1059. 'onGetReadDataName',
  1060. 'onSetReadDataName',
  1061. 'jumpIdenModule_SearchData',
  1062. 'jumpIdenModule_DownloadReadData',
  1063. 'jumpIdenModule_onJumpInit',
  1064. 'jumpIdenModule_onJumpInitLocalData',
  1065. 'jumpIdenModule_onJump6AxisDataUpdate',
  1066. 'jumpIdenModule_onTestUpdate',
  1067. 'jumpIdenModule_onTestJump6AxisDataUpdate',
  1068. //算法相关END
  1069. //灯光
  1070. 'onHitOpenBLELight',
  1071. 'onHitOpenBLELightNew',
  1072. 'onGetReadBLELight',
  1073. 'onSetReadBLELight',
  1074. 'B_WriteHexToBLECharacteristic',
  1075. 'onGetHotmanIntelligentData',
  1076. 'onSaveHotmanIntelligentData'
  1077. ]),
  1078. BasicsSteps() {
  1079. this.basics = this.basics == this.basicsList.length - 1 ? 0 : this.basics + 1
  1080. },
  1081. onLog(value) {
  1082. this.vLog = value;
  1083. },
  1084. onKeyDown(e) {
  1085. console.log(e);
  1086. },
  1087. showClickEvent() {
  1088. // #ifdef APP-PLUS
  1089. this.showDrawer();
  1090. // #endif
  1091. // #ifdef H5 || MP-WEIXIN
  1092. this.$refs.sideBar.showModal();
  1093. this.$store.state.bCanvasShow = false;
  1094. // #endif
  1095. },
  1096. showModal(e) {
  1097. if (e.currentTarget.dataset.target == "slideUpModal" && this.bGamePlaying) {
  1098. /**
  1099. * 判断下游戏是否进行中,进行中不能切换
  1100. */
  1101. uni.showToast({
  1102. title: '游戏进行中,不能选择关卡。',
  1103. icon: 'none',
  1104. mask: true
  1105. })
  1106. return;
  1107. }
  1108. this.modalName = e.currentTarget.dataset.target;
  1109. this.$store.state.bCanvasShow = false;
  1110. if (this.modalName == "slideUpModal") {
  1111. this.updateTaskScroll();
  1112. this.switchTaskInfo();
  1113. }
  1114. },
  1115. hideModal(e) {
  1116. if (this.modalName == "sportCompletion") {
  1117. console.log("关闭卡片");
  1118. this.sportData = {
  1119. calorie: 0,
  1120. hit: 0,
  1121. miss: 0,
  1122. percent: 0,
  1123. time: 0,
  1124. allData: 0,
  1125. }
  1126. } else if (this.modalName == "slideUpModal") {
  1127. this.tempSelectedLevel = this.currentJumpTask;
  1128. }
  1129. this.modalName = null;
  1130. this.$store.state.bCanvasShow = true;
  1131. },
  1132. onTestAddLocalCalorie() {
  1133. let _add = (10 * 1.875) / (4 * 30);
  1134. console.log(_add);
  1135. this.onUpdateCaloriePlane(10);
  1136. },
  1137. /**
  1138. * 首页圆形表部分时间计时器
  1139. */
  1140. arcbarCountDownTimeUp() {
  1141. //todo,涉及到倒计时的关卡。时间到。游戏结束
  1142. if (0 === this.currentModeIndex) {
  1143. if (this.currentMode == "pkMode") {
  1144. this.$refs.actionHitRef.onPKModeGameOver("timeUp");
  1145. } else {
  1146. uni.showToast({
  1147. title: '时间到,游戏结束。',
  1148. icon: 'none',
  1149. duration: 2000,
  1150. mask: true
  1151. })
  1152. this.$refs.actionHitRef.onGameOver("timeUp");
  1153. }
  1154. } else if (1 === this.currentModeIndex) {
  1155. if (this.currentMode == "pkMode") {
  1156. this.$refs.actionJumpRef.onPKModeGameOver("timeUp");
  1157. } else {
  1158. uni.showToast({
  1159. title: '时间到,游戏结束。',
  1160. icon: 'none',
  1161. duration: 2000,
  1162. mask: true
  1163. })
  1164. this.$refs.actionJumpRef.onGameOver("timeUp");
  1165. }
  1166. }
  1167. },
  1168. arcbarCountDownTimeUpdate(data) {
  1169. this.AJData.gameCountDown = data.curSeconds;
  1170. this.updateArcbarDataFromActionJump();
  1171. this.onActionJumpCountDownUpdate();
  1172. },
  1173. arcbarCountDownTimeReset() {
  1174. //清除时间计时器
  1175. this.$refs.arcbarCountDownRef.timePause();
  1176. },
  1177. arcbarCountDownPlay(bResetTime) {
  1178. if (bResetTime) {
  1179. this.$refs.arcbarCountDownRef.startData();
  1180. }
  1181. this.$refs.arcbarCountDownRef.timePlay();
  1182. },
  1183. // 进度条数据
  1184. arcbarData(_planData) {
  1185. let showCal = 0,
  1186. showLCal = 0,
  1187. LCalTip = '',
  1188. showTip = '';
  1189. let series = [{
  1190. name: showTip,
  1191. data: 0,
  1192. color: '#2fc25b'
  1193. }];
  1194. //这里区分进度条数据
  1195. if (1 == this.currentModeIndex || 0 == this.currentModeIndex) {
  1196. showCal = _planData.calorie;
  1197. showLCal = _planData.allCalorie;
  1198. LCalTip = '大卡';
  1199. showTip = '(未达标)';
  1200. // 如果运动的卡路里大于目标卡路里,设置为目标卡路里值,即为Max
  1201. if (showLCal >= showCal) {
  1202. showTip = '(达标)';
  1203. }
  1204. series = [{
  1205. name: showTip,
  1206. data: this.AJData.gameCountDown == 0 ? 0 : this.AJData.gameCountDown / this.AJData
  1207. .gameLimitTime,
  1208. color: '#2fc25b'
  1209. }];
  1210. }
  1211. return {
  1212. showCal,
  1213. showLCal,
  1214. LCalTip,
  1215. showTip,
  1216. series
  1217. }
  1218. },
  1219. // 圆形进度条
  1220. showArcbar() {
  1221. let {
  1222. showCal,
  1223. showLCal,
  1224. LCalTip,
  1225. series
  1226. } = this.arcbarData(_self.planData);
  1227. // console.log("series==", series[0]);
  1228. canvaArcbar1 = new uCharts({
  1229. $this: _self,
  1230. canvasId: 'canvasArcbar',
  1231. type: 'myGradualChangeArcbar',
  1232. fontSize: 11,
  1233. legend: {
  1234. show: false
  1235. },
  1236. background: '#FFFFFF',
  1237. pixelRatio: 1,
  1238. series: series,
  1239. animation: false,
  1240. width: _self.cWidthArcbar,
  1241. height: _self.cHeightArcbar,
  1242. dataLabel: true,
  1243. // Math.round(chartData.series[0].data * 100) + '%'
  1244. // title: {
  1245. // // arcbarDate: date.formatDate(_self.originalDate),
  1246. // name: showLCal,
  1247. // molecularUnit: LCalTip, //单位的分子部分
  1248. // denominatorUnit: showCal, //单位的分母部分
  1249. // unitFontSize: 11, //单位字符大小
  1250. // color: 'rgba(255, 255, 255, 1)',
  1251. // fontSize: 28,
  1252. // offsetX: -30,
  1253. // offsetY: 10
  1254. // },
  1255. // subtitle: {
  1256. // name: series[0].name,
  1257. // color: 'rgba(255, 255, 255, 1)',
  1258. // fontSize: 13,
  1259. // offsetY: -75
  1260. // },
  1261. extra: {
  1262. arcbar: {
  1263. type: 'default',
  1264. backgroundColor: 'rgba(234, 234, 255, 1)',
  1265. backgroundEndColor: 'rgba(234, 234, 255, 1)',
  1266. backgroundMiddle: '#9291FF', //'rgba(158, 158, 255, 1)',
  1267. width: _self.arcbarWidth, //圆弧的宽度
  1268. lineColor: '#51EDFE',
  1269. lineEndColor: '#F7C75D'
  1270. }
  1271. }
  1272. });
  1273. // 更新位置同步
  1274. this.syncLocalDataToServer((res) => {
  1275. this.originalDate = res.newDate;
  1276. this.currentDate = date.formatTime(res.newDate);
  1277. this.updateArcbarData();
  1278. });
  1279. },
  1280. updateArcbarData(data) {
  1281. let {
  1282. showCal,
  1283. showLCal,
  1284. LCalTip,
  1285. series
  1286. } = _self.arcbarData(_self.planData);
  1287. if (showCal == _self.oldArcbarProCalorie && showLCal == _self.oldArcbarAllCalorie) {
  1288. // console.log("没有改变值,不刷新表盘:", showCal, _self.oldArcbarProCalorie, showLCal, _self.oldArcbarAllCalorie);
  1289. return;
  1290. }
  1291. //这个是显示当前的总卡路里
  1292. _self.$store.state.oldArcbarAllCalorie = showLCal;
  1293. //这个是计划的卡路里
  1294. _self.$store.state.oldArcbarProCalorie = showCal;
  1295. canvaArcbar1.updateData({
  1296. series: series
  1297. });
  1298. },
  1299. updateArcbarDataFromActionJump(data) {
  1300. let {
  1301. showCal,
  1302. showLCal,
  1303. LCalTip,
  1304. series
  1305. } = _self.arcbarData(_self.planData);
  1306. canvaArcbar1.updateData({
  1307. series: series
  1308. });
  1309. },
  1310. //没有限制下的更新表盘
  1311. updateNoLimit() {
  1312. let {
  1313. showCal,
  1314. showLCal,
  1315. LCalTip,
  1316. series
  1317. } = _self.arcbarData(_self.planData);
  1318. //这个是显示当前的总卡路里
  1319. _self.$store.state.oldArcbarAllCalorie = showLCal;
  1320. //这个是计划的卡路里
  1321. _self.$store.state.oldArcbarProCalorie = showCal;
  1322. canvaArcbar1.updateData({
  1323. series: series
  1324. });
  1325. },
  1326. // 跳转计划页面
  1327. openPlan(e) {
  1328. uni.navigateTo({
  1329. url: '../plan/plan?newsid=' + 11,
  1330. success: res => {},
  1331. fail: () => {},
  1332. complete: () => {}
  1333. });
  1334. },
  1335. // 跳转转换页面
  1336. onNavConver() {
  1337. uni.reLaunch({
  1338. url: '../../conversion-page/conversion/conversion',
  1339. success: res => {},
  1340. fail: () => {},
  1341. complete: () => {}
  1342. });
  1343. },
  1344. // 跳转我的页面
  1345. onNavMyPage() {
  1346. uni.navigateTo({
  1347. url: '../../my-page/homepage/homepage',
  1348. success: res => {},
  1349. fail: () => {},
  1350. complete: () => {}
  1351. });
  1352. },
  1353. updateBLECIndex() {
  1354. for (let i = 0; i < this.BLEDeviceShowList.length; i++) {
  1355. let eq = this.BLEDeviceShowList[i];
  1356. if ((eq.ename.indexOf("mobilePhoneBandage") > -1 && this.BLEConnectDevice.id == 0) ||
  1357. (eq.ename.indexOf("hotman") > -1 && this.BLEConnectDevice.id == 1) ||
  1358. (eq.ename.indexOf("BLEHandle") > -1 && this.BLEConnectDevice.id == 2) ||
  1359. (eq.ename.indexOf("rope") > -1 && this.BLEConnectDevice.id == 3) ||
  1360. (eq.ename.indexOf("intelligent") > -1 && this.BLEConnectDevice.id == 4)) {
  1361. eq.bRatio = true;
  1362. this.$store.state.cIndex = i;
  1363. }
  1364. if (eq.ename.indexOf("hotman") > -1 && this.BLEConnectDevice.id == 1) {
  1365. // if (this.$refs.boxingPostRef) {
  1366. // this.$refs.boxingPostRef.onSetMode('pkMode');
  1367. // } else {
  1368. // setTimeout(() => {
  1369. // this.$refs.boxingPostRef.onSetMode('pkMode');
  1370. // }, 500)
  1371. // }
  1372. } else if (eq.ename.indexOf("BLEHandle") > -1 && this.BLEConnectDevice.id == 2) {
  1373. if (this.$refs.boxingPostRef) {
  1374. this.$refs.boxingPostRef.onSetMode('calorieMode');
  1375. } else {
  1376. setTimeout(() => {
  1377. this.$refs.boxingPostRef.onSetMode('calorieMode');
  1378. }, 500)
  1379. }
  1380. } else if (eq.ename.indexOf("rope") > -1 && this.BLEConnectDevice.id == 3) {
  1381. //todo 暂时设置兼容跑步模式
  1382. // if (this.$refs.boxingPostRef) {
  1383. // this.$refs.boxingPostRef.onSetMode('ropeMode');
  1384. // } else {
  1385. // setTimeout(() => {
  1386. // this.$refs.boxingPostRef.onSetMode('ropeMode');
  1387. // }, 500)
  1388. // }
  1389. } else if (eq.ename.indexOf("intelligent") > -1 && this.BLEConnectDevice.id == 4) {
  1390. }
  1391. }
  1392. },
  1393. /**
  1394. * 蓝牙断开连接时候
  1395. */
  1396. callbackCloseBLE() {
  1397. // if (0 == this.currentModeIndex) {
  1398. // //蓝牙断开连接后,直接关闭
  1399. // this.$refs.boxingPostRef.onCloseDevices();
  1400. // }
  1401. },
  1402. //蓝牙状态回调
  1403. callbackBLEState(res) {
  1404. console.log("callbackBLEState==", res);
  1405. if (this.cState != res.state) this.cState = res.state;
  1406. },
  1407. //设备回调事件
  1408. callbackUpdateBLEData(data) {
  1409. //如果在监听状态时候隐藏页面,返回
  1410. if (_self.bHide) return;
  1411. //连接了手柄模式
  1412. //没有开启指令不刷新
  1413. if (!this.instructionState.bOpen) return;
  1414. if (this.BLEConnectDevice.usageMode == "hotman") {
  1415. if (this.BLEConnectDevice.deviceType == "BLEIntelligent") {
  1416. this.showMs = data.ms - this.oldMs;
  1417. this.oldMs = data.ms;
  1418. this.gIntelligentUpdateSandbagAlgorithm({
  1419. data: data,
  1420. callback: (res) => {
  1421. if (res.type == 'hit') {
  1422. this.$refs.actionHitRef.onBLEHitUpdate(res);
  1423. }
  1424. }
  1425. });
  1426. } else {
  1427. this.gUpdateSandbagAlgorithm({
  1428. data: data,
  1429. callback: (res) => {
  1430. if (res.type == 'hit') {
  1431. this.$refs.actionHitRef.onBLEHitUpdate(res);
  1432. }
  1433. }
  1434. });
  1435. }
  1436. } else if (this.BLEConnectDevice.usageMode == "general") {
  1437. //这个是普通打击模式
  1438. this.$refs.boxingPostRef.onBLEHandleUpdate(data);
  1439. } else if (this.BLEConnectDevice.usageMode == "ropeSkipping") {
  1440. this.$refs.actionJumpRef.onBLERopeUpdate(data);
  1441. }
  1442. },
  1443. /**
  1444. * 检测获取匹配的设备
  1445. */
  1446. onGetBondDevice() {
  1447. /**
  1448. * 假如手机没有匹配,断开连接
  1449. */
  1450. console.log("****", this.BLEConnectDevice);
  1451. if (!this.BLEConnectDevice) return;
  1452. this.B_GetBondedDevices({
  1453. deviceId: this.BLEConnectDevice.deviceId,
  1454. success: (bondedDevice) => {
  1455. // console.error("===========", bondedDevice);
  1456. // uni.hideToast();
  1457. if (bondedDevice == null) {
  1458. // if (plus.os.name == 'Android')
  1459. {
  1460. //此问题 华为手机容易出现
  1461. //android手机已配对的设备 不存在,但是app 又直接连接成功了。提示,并且断开app连接
  1462. //1.关闭当前连接
  1463. this.onCloseBLEConnection({
  1464. getSuccess: () => {}
  1465. });
  1466. uni.hideToast();
  1467. //2.跳转蓝牙设置
  1468. uni.showModal({
  1469. title: '蓝牙配对失败',
  1470. content: '请跳转后点击配对BGBox_2020,成功后手动跳转回哔蹦重新连接。',
  1471. success: (res) => {
  1472. if (res.confirm) {
  1473. this.B_OpenBLESetting();
  1474. }
  1475. }
  1476. })
  1477. }
  1478. }
  1479. }
  1480. });
  1481. },
  1482. openDeviceList(e) {
  1483. if (this.ConnectBindingDevice) {
  1484. uni.showToast({
  1485. title: '当前已开启数据',
  1486. icon: 'none',
  1487. mask: true
  1488. })
  1489. return;
  1490. }
  1491. //先判断蓝牙是否初始化
  1492. /**
  1493. * 蓝牙部分操作,转全局变量操作
  1494. * */
  1495. // console.log("openDeviceList bOpenBluetooth", this.bOpenBluetooth);
  1496. // #ifdef APP-PLUS
  1497. if (!this.bOpenBluetooth) {
  1498. this.initAdapter(() => {
  1499. uni.navigateTo({
  1500. // url: '../devices-category/devices-category',
  1501. url: '../devices-hardware/devices-hardware',
  1502. success: res => {
  1503. this.bLimitReconnection = true;
  1504. },
  1505. fail: () => {},
  1506. complete: () => {}
  1507. });
  1508. });
  1509. return;
  1510. }
  1511. // #endif
  1512. uni.navigateTo({
  1513. url: '../devices-hardware/devices-hardware',
  1514. success: res => {
  1515. this.bLimitReconnection = true;
  1516. },
  1517. fail: () => {},
  1518. complete: () => {}
  1519. });
  1520. },
  1521. onNavToMore() {
  1522. uni.navigateTo({
  1523. url: '../more/more?index=' + this.cIndex,
  1524. success: res => {},
  1525. fail: () => {},
  1526. complete: () => {}
  1527. });
  1528. },
  1529. onAddDevice() {
  1530. let deviceItem = {
  1531. name: '蹦床',
  1532. icon: '/static/trampoline.png'
  1533. };
  1534. if (this.deviceList.length != 0) {
  1535. this.deviceList = this.deviceList.concat(deviceItem);
  1536. } else {
  1537. this.deviceList = deviceItem;
  1538. }
  1539. },
  1540. onCloseDevice(item, e) {
  1541. //如果不是连接状态,则删除
  1542. if (e.currentTarget.dataset.index != this.cIndex) {
  1543. if (this.cIndex != -1) {
  1544. uni.showToast({
  1545. icon: 'none',
  1546. title: "请先断开已连接设备",
  1547. duration: 2000,
  1548. mask: true
  1549. })
  1550. return;
  1551. }
  1552. uni.showModal({
  1553. title: '设备状态',
  1554. content: '是否删除设备?',
  1555. ConfirmColor: '#A488DC',
  1556. success: res => {
  1557. if (res.confirm) {
  1558. this.$store.commit('deleteBLEDevice', e.currentTarget.dataset.index);
  1559. }
  1560. }
  1561. });
  1562. return;
  1563. }
  1564. uni.showModal({
  1565. title: '设备状态',
  1566. content: '是否断开连接?',
  1567. /**
  1568. * 如果需要强制,不显示取消按钮
  1569. */
  1570. showCancel: true,
  1571. ConfirmColor: '#A488DC',
  1572. success: res => {
  1573. if (res.confirm) {
  1574. this.onCloseBLEConnection({
  1575. getSuccess: () => {}
  1576. });
  1577. }
  1578. }
  1579. });
  1580. },
  1581. onNavDetail(item) {
  1582. console.log(item);
  1583. let temItem = encodeURIComponent(JSON.stringify(item));
  1584. // return;
  1585. uni.navigateTo({
  1586. url: '../../game-page/game-detail/game-detail?item=' + temItem
  1587. });
  1588. },
  1589. onNavToGameMore(e) {
  1590. uni.reLaunch({
  1591. url: '../../game-page/game/game?type=' + e.currentTarget.dataset.type
  1592. });
  1593. },
  1594. //判断是否有其他限制
  1595. onStartCheck(data) {
  1596. //#ifdef H5
  1597. // 直接走测试,如果是h5 APP-PLUS
  1598. if (0 === this.currentModeIndex) {
  1599. // this.onBoxingGuideFinish();
  1600. if (this.currentJumpTask == null) {
  1601. uni.showToast({
  1602. title: '先选一个挑战关卡',
  1603. icon: 'none',
  1604. duration: 2000,
  1605. })
  1606. return;
  1607. }
  1608. if (this.currentMode == 'pkMode' && this.finallySelectFriendInfo == null) {
  1609. uni.showToast({
  1610. title: '选择一个pk好友',
  1611. icon: 'none',
  1612. duration: 2000,
  1613. })
  1614. return;
  1615. }
  1616. //调用开始
  1617. this.onActionHitPlay();
  1618. } else if (1 === this.currentModeIndex) {
  1619. if (this.currentJumpTask == null) {
  1620. uni.showToast({
  1621. title: '先选一个挑战关卡',
  1622. icon: 'none',
  1623. duration: 2000,
  1624. })
  1625. return;
  1626. }
  1627. if (this.currentMode == 'pkMode' && this.finallySelectFriendInfo == null) {
  1628. uni.showToast({
  1629. title: '选择一个pk好友',
  1630. icon: 'none',
  1631. duration: 2000,
  1632. })
  1633. return;
  1634. }
  1635. //调用开始
  1636. this.onActionJumpPlay();
  1637. }
  1638. return;
  1639. //#endif
  1640. //跳和拳击进入
  1641. if (1 === this.currentModeIndex || 0 === this.currentModeIndex) {
  1642. //2.检测是否连接设备 || this.BLEConnectDevice.ename !== 'BT04'
  1643. if (this.cIndex == -1) {
  1644. this.onGetBluetoothConnectView({
  1645. hiddenType: 'none'
  1646. });
  1647. return;
  1648. }
  1649. }
  1650. //3.检测一下计划日期
  1651. console.log("remainingDays == >", this.planData, this.remainingDays);
  1652. if (date.formatDate(new Date()) > this.planData.endTime || this.remainingDays == 0) {
  1653. if (!this.$store.state.bPlanExpired) {
  1654. this.$store.state.bPlanExpired = true;
  1655. setTimeout(() => {
  1656. this.$store.state.bPlanExpired = false;
  1657. }, 3000)
  1658. uni.showModal({
  1659. title: '提醒',
  1660. content: '计划到期,请制定新计划。',
  1661. confirmText: '去制定',
  1662. success: (res) => {
  1663. if (res.confirm) {
  1664. uni.switchTab({
  1665. url: "../plan/plan"
  1666. })
  1667. }
  1668. }
  1669. })
  1670. }
  1671. return;
  1672. }
  1673. if (1 == this.currentModeIndex || 0 === this.currentModeIndex) {
  1674. if (data) {
  1675. let {
  1676. bStartCountDown
  1677. } = data;
  1678. this.bStartCountDown = bStartCountDown;
  1679. }
  1680. if (this.bStartCountDown) {
  1681. this.BoxingPostCountDownText = 3;
  1682. this.b_countDown = setInterval(() => {
  1683. if (this.BoxingPostCountDownText <= 1) {
  1684. if (this.b_countDown) {
  1685. clearInterval(this.b_countDown);
  1686. this.b_countDown = null;
  1687. }
  1688. setTimeout(() => {
  1689. this.personalAudioContext.stop();
  1690. this.personalAudioContext.play();
  1691. //倒计时结束后开始游戏
  1692. //初始化一个沙袋打击对象
  1693. if (this.BLEConnectDevice.usageMode == "hotman") {
  1694. if (this.BLEConnectDevice.deviceType == "BLEIntelligent") {
  1695. this.gIntelligentCreateSandbagAlgorithm();
  1696. } else {
  1697. this.gCreateSandbagAlgorithm();
  1698. }
  1699. }
  1700. if (this.BLEConnectDevice.usageMode == "ropeSkipping" ||
  1701. this.BLEConnectDevice.usageMode == "hotman") {
  1702. //打开跳绳模式
  1703. // this.B_OpenRopeSkipping();
  1704. this.onWriteBLEConnectionValue({
  1705. value: "3"
  1706. });
  1707. }
  1708. //监听蓝牙回调
  1709. uni.$on('updateBLEDeviceData', this.callbackUpdateBLEData);
  1710. //调用开始
  1711. if (0 === this.currentModeIndex) {
  1712. //调用开始
  1713. this.onActionHitPlay();
  1714. } else if (1 === this.currentModeIndex) {
  1715. //调用开始
  1716. this.onActionJumpPlay();
  1717. }
  1718. this.bStartCountDown = false;
  1719. }, 800)
  1720. return;
  1721. }
  1722. this.BoxingPostCountDownText--;
  1723. }, 1000)
  1724. } else {
  1725. if (this.BLEConnectDevice.usageMode == "ropeSkipping" ||
  1726. this.BLEConnectDevice.usageMode == "hotman") {
  1727. //打开跳绳模式
  1728. // this.B_OpenRopeSkipping();
  1729. this.onWriteBLEConnectionValue({
  1730. value: "3"
  1731. });
  1732. }
  1733. //监听蓝牙回调
  1734. uni.$on('updateBLEDeviceData', this.callbackUpdateBLEData);
  1735. //调用开始
  1736. if (0 === this.currentModeIndex) {
  1737. //调用开始
  1738. this.onActionHitPlay();
  1739. } else if (1 === this.currentModeIndex) {
  1740. //调用开始
  1741. this.onActionJumpPlay();
  1742. }
  1743. }
  1744. }
  1745. },
  1746. onShowBoxingHitTip() {
  1747. this.$store.state.bGuidePages = true;
  1748. this.guideCurrent = 5;
  1749. this.toView = "boxingHitID";
  1750. this.$store.state.bNewGuide = false;
  1751. },
  1752. //检测是否符合要求,没有的话进行新手提示
  1753. onPersonalCheck(data) {
  1754. if (!this.bShowComplete) {
  1755. console.log('不要点击这么快!!');
  1756. return;
  1757. } else {
  1758. console.error('点击!!');
  1759. }
  1760. this.bShowComplete = false;
  1761. // #ifdef APP-PLUS
  1762. if (1 === this.currentModeIndex || 0 === this.currentModeIndex) {
  1763. if (this.currentJumpTask == null) {
  1764. this.onTipLevel({
  1765. hiddenType: 'normal'
  1766. });
  1767. if (this.guideUnlockState.firstPromptSelectLevel) {
  1768. // this.onTipLevel();
  1769. let guideUnlockState = Object.assign(this.guideUnlockState, {
  1770. firstPromptSelectLevel: false
  1771. });
  1772. this.setGuideUnlockState(guideUnlockState);
  1773. }
  1774. this.bShowComplete = true;
  1775. return;
  1776. }
  1777. if (this.currentMode == 'pkMode' && this.finallySelectFriendInfo == null) {
  1778. //todo 这里没处理 新手提示
  1779. uni.showToast({
  1780. title: '选择一个pk好友',
  1781. icon: 'none',
  1782. duration: 2000,
  1783. })
  1784. this.bShowComplete = true;
  1785. return;
  1786. }
  1787. if (1 === this.currentModeIndex) {
  1788. let _item = this.currentJumpTask.item;
  1789. //第一次选择关卡时候判断
  1790. if (this.guideUnlockState.firstUnlockJumpUp && _item.id == 1) {
  1791. this.showGuide('level-game-tip', {
  1792. levelType: 'midJump',
  1793. hiddenType: 'firstUnlockJumpUp'
  1794. })
  1795. let guideUnlockState = Object.assign(this.guideUnlockState, {
  1796. firstUnlockJumpUp: false
  1797. });
  1798. this.setGuideUnlockState(guideUnlockState);
  1799. return;
  1800. } else if (this.guideUnlockState.firstUnlockLeftAndRightJump && _item.id == 6) {
  1801. this.showGuide('level-game-tip', {
  1802. levelType: 'directionJump',
  1803. hiddenType: 'firstUnlockLeftAndRightJump'
  1804. })
  1805. let guideUnlockState = Object.assign(this.guideUnlockState, {
  1806. firstUnlockLeftAndRightJump: false
  1807. });
  1808. this.setGuideUnlockState(guideUnlockState);
  1809. return;
  1810. } else if (this.guideUnlockState.firstUnlockLeftAndRightRotationJump && _item.id == 9) {
  1811. this.showGuide('level-game-tip', {
  1812. levelType: 'rotationJump',
  1813. hiddenType: 'firstUnlockLeftAndRightRotationJump'
  1814. })
  1815. let guideUnlockState = Object.assign(this.guideUnlockState, {
  1816. firstUnlockLeftAndRightRotationJump: false
  1817. });
  1818. this.setGuideUnlockState(guideUnlockState);
  1819. return;
  1820. }
  1821. }
  1822. }
  1823. // #endif
  1824. //如果上面没有guide弹出
  1825. this.bShowComplete = true;
  1826. this.onStartCheck(data);
  1827. },
  1828. //
  1829. onBoxingGuideFinish() {
  1830. if (this.b_countDown) {
  1831. clearInterval(this.b_countDown);
  1832. this.b_countDown = null;
  1833. }
  1834. //|| this.currentMode == 'ropeMode'
  1835. if (this.currentMode == 'calorieMode') {
  1836. this.personalAudioContext.stop();
  1837. this.personalAudioContext.play();
  1838. setTimeout(() => {
  1839. this.$refs.boxingPostRef.onBoxingPostPlay(true);
  1840. }, 600);
  1841. } else {
  1842. this.BoxingPostCountDownText = 3;
  1843. this.$refs.boxingPostRef.onSetRingAnimation(true);
  1844. uni.showToast({
  1845. title: '匹配中...',
  1846. mask: true,
  1847. icon: 'loading',
  1848. duration: 2000
  1849. })
  1850. setTimeout(() => {
  1851. //ai信息
  1852. this.onGetAiRandom();
  1853. // this.b_countDown = setInterval(() => {
  1854. // if (this.BoxingPostCountDownText <= 1) {
  1855. // if (this.b_countDown) {
  1856. // clearInterval(this.b_countDown);
  1857. // this.b_countDown = null;
  1858. // }
  1859. // setTimeout(() => {
  1860. // this.personalAudioContext.stop();
  1861. // this.personalAudioContext.play();
  1862. // this.$refs.boxingPostRef.onBoxingPostPlay(true);
  1863. // this.$refs.boxingPostRef.onSetRingAnimation(false);
  1864. // uni.hideToast();
  1865. // }, 800)
  1866. // }
  1867. // this.BoxingPostCountDownText--;
  1868. // }, 1000)
  1869. setTimeout(() => {
  1870. this.personalAudioContext.stop();
  1871. this.personalAudioContext.play();
  1872. this.$refs.boxingPostRef.onBoxingPostPlay(true);
  1873. this.$refs.boxingPostRef.onSetRingAnimation(false);
  1874. uni.hideToast();
  1875. }, 800)
  1876. }, 2000);
  1877. }
  1878. },
  1879. //运动时间
  1880. onUpdateSportTime(res) {
  1881. // console.log("同步的运动时间",res);
  1882. this.setLocalSportTime(res);
  1883. },
  1884. //更新运动数据
  1885. onUpdateCaloriePlane(data) {
  1886. // 记录卡路里到本地
  1887. this.addlocalCalorie(data);
  1888. this.updateArcbarData();
  1889. },
  1890. onRoundTrigger(data) {
  1891. // console.log("onRoundTrigger==", data);
  1892. // return;
  1893. let url = '';
  1894. switch (data.item.type) {
  1895. case "personal":
  1896. //个人中心页面
  1897. url = '../../personal-page/personal/personal';
  1898. break;
  1899. case "game":
  1900. url = '../../game-page/game/game';
  1901. break;
  1902. default:
  1903. url = '../../personal-page/personal/personal';
  1904. break;
  1905. }
  1906. uni.reLaunch({
  1907. url: url,
  1908. success: res => {},
  1909. fail: () => {},
  1910. complete: () => {}
  1911. });
  1912. },
  1913. /**
  1914. * 同步本地数据到服务器
  1915. */
  1916. onSyncData() {
  1917. this.syncRequestEvent({
  1918. success: () => {
  1919. this.updateArcbarData();
  1920. }
  1921. });
  1922. // 更新显示日期
  1923. this.originalDate = new Date();
  1924. this.currentDate = date.formatTime(this.originalDate);
  1925. },
  1926. hidePlanTipModal() {
  1927. this.modalName = null;
  1928. if (this.planTipIndex === 1) {
  1929. // 您今天的目标还没完成 是否结束训练
  1930. this.onActionPause(false);
  1931. }
  1932. },
  1933. confirmPlanTipModal() {
  1934. this.modalName = null;
  1935. if (this.planTipIndex === 0) {
  1936. this.onStartCheck()
  1937. } else if (this.planTipIndex === 1) {
  1938. // 您今天的目标还没完成 是否结束训练
  1939. this.onActionPause(true);
  1940. }
  1941. },
  1942. //断开连接时候,关闭
  1943. onCloseBoxingHit() {
  1944. console.log('关闭训练');
  1945. if (this.currentMode == 'pkMode') {
  1946. this.$refs.hitEffectRef.onStop();
  1947. }
  1948. this.onActionPause(true);
  1949. },
  1950. //点击暂停时候,判断一下是否完成目标
  1951. onActionControlPlay(bPlay) {
  1952. if (!bPlay) {
  1953. //跳模块的情况下,暂停计时器
  1954. if (1 == this.currentModeIndex || 0 == this.currentModeIndex)
  1955. this.arcbarCountDownTimeReset();
  1956. if (this.planData.allCalorie < this.planData.calorie) {
  1957. this.modalName = 'showPlanTipModal';
  1958. this.planTipIndex = 1;
  1959. } else {
  1960. //假如完成了目标,更新卡路里
  1961. this.onActionPause(true);
  1962. }
  1963. }
  1964. },
  1965. /**
  1966. * 切换体验模式
  1967. * @param {Object} data
  1968. */
  1969. onModeEvent(data) {
  1970. console.log("当前模式:", data);
  1971. this.currentMode = data.mode;
  1972. this.title = data.name;
  1973. // || this.currentMode == 'ropeMode'
  1974. if (this.currentMode == 'calorieMode') {
  1975. setTimeout(() => {
  1976. this.updateNoLimit();
  1977. }, 0)
  1978. }
  1979. },
  1980. onAiHitEvent(bloodPoint) {
  1981. // this.onPlay({
  1982. // bloodPoint: num,
  1983. // createType: 'red',
  1984. // callback: (res) => {
  1985. // console.log("红色拳头击中对方:", res);
  1986. // }
  1987. // });
  1988. this.$refs.hitFistRef.onPlay({
  1989. bloodPoint: bloodPoint,
  1990. createType: 'red',
  1991. callback: () => {
  1992. if (this.bAiHitShake) return;
  1993. this.bAiHitShake = true;
  1994. this.$refs.aiHitEffectRef.onPlay();
  1995. this.$refs.aiHitEffectRef.onAIHit();
  1996. setTimeout(() => {
  1997. this.bAiHitShake = false;
  1998. }, 500)
  1999. }
  2000. });
  2001. },
  2002. //打击时候头像修改
  2003. onHitEvent(bloodPoint) {
  2004. // console.log("this.bHitShake:",this.bHitShake);
  2005. this.$refs.hitFistRef.onPlay({
  2006. bloodPoint: bloodPoint,
  2007. createType: 'blue',
  2008. callback: () => {
  2009. if (this.bHitShake) return;
  2010. this.bHitShake = true;
  2011. this.$refs.hitEffectRef.onPlay();
  2012. this.$refs.hitEffectRef.onMyHit();
  2013. setTimeout(() => {
  2014. this.bHitShake = false;
  2015. }, 500)
  2016. }
  2017. }
  2018. );
  2019. },
  2020. //弹出目标提示后,进行下一步
  2021. onActionPause(bFinish) {
  2022. if (bFinish) {
  2023. if (this.ConnectBindingDevice) {
  2024. this.gStopSimulateBLEUpdate();
  2025. uni.$off('updateBLEDeviceData', this.callbackUpdateBLEData);
  2026. } else {
  2027. if (0 === this.currentModeIndex) {
  2028. if (this.currentMode == "calorieMode") {
  2029. this.$refs.actionHitRef.onGameOver("none");
  2030. } else {
  2031. this.$refs.actionHitRef.onPKModeGameOver("none");
  2032. }
  2033. } else if (1 === this.currentModeIndex) {
  2034. //todo actionJump
  2035. if (this.currentMode == "calorieMode") {
  2036. this.$refs.actionJumpRef.onGameOver("none");
  2037. } else {
  2038. this.$refs.actionJumpRef.onPKModeGameOver("none");
  2039. }
  2040. }
  2041. }
  2042. if (1 === this.currentModeIndex) {
  2043. if (this.currentMode == "calorieMode") {
  2044. this.syncRequestEvent({
  2045. success: () => {
  2046. this.updateArcbarData();
  2047. }
  2048. });
  2049. }
  2050. } else {
  2051. this.syncRequestEvent({
  2052. success: () => {
  2053. this.updateArcbarData();
  2054. }
  2055. });
  2056. }
  2057. } else {
  2058. //如果不是,继续调用播放
  2059. if (0 === this.currentModeIndex) {
  2060. // this.$refs.boxingPostRef.onBoxingPostPlay(true);
  2061. this.$refs.actionHitRef.onContinueGame();
  2062. if (0 !== this.currentJumpTask.item.limitTime) {
  2063. //0默认不限时,所以限时的才走计时间
  2064. this.arcbarCountDownPlay(false);
  2065. }
  2066. } else if (1 === this.currentModeIndex) {
  2067. //actionJump
  2068. this.$refs.actionJumpRef.onContinueGame();
  2069. if (0 !== this.currentJumpTask.item.limitTime) {
  2070. //0默认不限时,所以限时的才走计时间
  2071. this.arcbarCountDownPlay(false);
  2072. }
  2073. }
  2074. }
  2075. },
  2076. guideHide(e) {
  2077. this.$store.state.bGuidePages = false;
  2078. if (e.current == 0 && !e.onlyHide) {
  2079. //跳转计划页面
  2080. this.openPlan();
  2081. } else if (e.current == 1 && !e.onlyHide) {
  2082. console.log('guideHide:', e.current);
  2083. //跳转搜索设备页面
  2084. // this.openDeviceList();
  2085. } else if (e.current == 3 && !e.onlyHide) {
  2086. // 跳转连接蓝牙页面
  2087. this.openDeviceList();
  2088. } else if (e.current == 5 && !e.onlyHide) {
  2089. console.log("==:", e);
  2090. //todo 跳绳模式 新手引导
  2091. if (this.BLEConnectDevice.usageMode == "ropeSkipping") {
  2092. this.B_OpenRopeSkipping();
  2093. } else {
  2094. //初始化filter快速打击对象
  2095. if (this.BLEConnectDevice.usageMode == "hotman") {
  2096. this.gCreateFilterObj();
  2097. }
  2098. //打开加速计
  2099. this.onWriteBLEConnectionValue({
  2100. value: "3"
  2101. });
  2102. // setTimeout(() => {
  2103. // //设置加速计b:20ms a:10ms
  2104. // this.onWriteBLEConnectionValue({
  2105. // value: config.refreshRate
  2106. // });
  2107. // }, 1000)
  2108. }
  2109. //监听蓝牙回调
  2110. uni.$on('updateBLEDeviceData', this.callbackUpdateBLEData);
  2111. this.onBoxingGuideFinish();
  2112. }
  2113. },
  2114. mainScroll(e) {
  2115. if (_self.toView == "boxingHitID") {
  2116. _self.toView = "";
  2117. // let view = uni.createSelectorQuery().select('#boxingHitID');
  2118. // view.boundingClientRect(data => {
  2119. // _self.$refs.codeElfGuide.setModalObj(data);
  2120. // console.log(data);
  2121. // }).exec();
  2122. } else if (_self.toView == "openAccGyroView") {
  2123. _self.toView = "";
  2124. }
  2125. },
  2126. onGetActionJumpView() {
  2127. this.$nextTick(() => {
  2128. this.toView = "actionJumpID"
  2129. });
  2130. this.toView = '' //不清空再次跳到锚点位置会不起作用
  2131. setTimeout(() => {
  2132. _self.$refs.actionJumpRef.onGetActionJumpPlayView((data) => {
  2133. console.log(JSON.stringify(data));
  2134. // #ifdef APP-PLUS
  2135. _self.showGuide('actionJumpPlay', data);
  2136. // #endif
  2137. });
  2138. }, 200)
  2139. },
  2140. onGetBluetoothConnectView(initData) {
  2141. _self.$refs.roundFabRef.onGetRoundFabView((data) => {
  2142. console.log(JSON.stringify(data), initData.firstInstallation);
  2143. // #ifdef APP-PLUS
  2144. let temp = Object.assign({}, data, initData);
  2145. console.log('当前的temp:', temp);
  2146. _self.showGuide('bluetoothConnect', temp);
  2147. // #endif
  2148. });
  2149. // let view = uni.createSelectorQuery().select('#roundFabID');
  2150. // view.boundingClientRect(data => {
  2151. // console.log(JSON.stringify(data));
  2152. // // #ifdef APP-PLUS
  2153. // _self.showGuide('bluetoothConnect', data);
  2154. // // #endif
  2155. // }).exec();
  2156. },
  2157. //拳击模块的回调
  2158. boxingUpdateCalorie(calorie) {
  2159. if (this.currentMode != 'pkMode') {
  2160. //这里调用一下设置可以播放音效
  2161. this.$refs.personalFruitRef.onCanPlay();
  2162. }
  2163. this.onUpdateCaloriePlane(calorie);
  2164. },
  2165. //扫码添加设备
  2166. openQRCode(callback) {
  2167. let that = this;
  2168. // 允许从相机和相册扫码
  2169. uni.scanCode({
  2170. success: function(res) {
  2171. // console.log('条码类型:' + res.scanType);
  2172. // console.log('条码内容:' + res.result);
  2173. let obj = JSON.parse(res.result)
  2174. let data = {
  2175. type: obj.type,
  2176. uuid: obj.uuid,
  2177. }
  2178. }
  2179. });
  2180. },
  2181. //屏幕抖动
  2182. onScreenShake() {
  2183. this.bEFHitShake = true;
  2184. setTimeout(() => {
  2185. this.bEFHitShake = false;
  2186. }, 500)
  2187. },
  2188. onGetAiRandom() {
  2189. let _self = this;
  2190. let avatarlist = AvatarConfig.getAvatarList().avatarList;
  2191. let _length = avatarlist.length;
  2192. let _index = Math.floor(Math.random() * _length);
  2193. console.log(avatarlist);
  2194. _self.aiObj.name = avatarlist[_index].name;
  2195. _self.aiObj.avatar = avatarlist[_index].url;
  2196. },
  2197. onBoxingGameOver(res) {
  2198. this.$refs.hitEffectRef.onStop();
  2199. this.onActionPause(true);
  2200. //拳击柱部分
  2201. uni.$off('updateBLEDeviceData', this.callbackUpdateBLEData);
  2202. let _title = res.myWin ? "胜利" : "失败";
  2203. let _context = res.myWin ? "你已经赢得PK胜利!" : "你在PK中被打败了!";
  2204. this.modalName = "showModalTip"
  2205. this.$refs.modalTipRef.setShowData({
  2206. title: _title,
  2207. context: _context,
  2208. operationItem: null
  2209. });
  2210. },
  2211. onModalTipHide() {
  2212. this.modalName = null;
  2213. },
  2214. onModalTipConfirm(data) {
  2215. let {
  2216. type,
  2217. operationItem
  2218. } = data;
  2219. this.modalName = null;
  2220. //再来一局
  2221. //提示过关奖励
  2222. console.log('onModalTipConfirm', type, operationItem);
  2223. if (type == 'PASSTHELEVEL') {
  2224. this.showPopup('levelReward', operationItem);
  2225. }
  2226. },
  2227. onTestShare() {
  2228. uni.share({
  2229. provider: "weixin",
  2230. scene: "WXSenceTimeline",
  2231. type: 2,
  2232. imageUrl: "https://img-cdn-qiniu.dcloud.net.cn/uniapp/images/uni@2x.png",
  2233. success: function(res) {
  2234. console.log("success:" + JSON.stringify(res));
  2235. },
  2236. fail: function(err) {
  2237. console.log("fail:" + JSON.stringify(err));
  2238. }
  2239. });
  2240. },
  2241. openAcc() {
  2242. if (!this.globalAcc) {
  2243. AccAndOri.bindAcc((accId) => {
  2244. this.$store.state.globalAcc = accId;
  2245. console.log("初始化:globalAcc=", this.globalAcc);
  2246. });
  2247. }
  2248. if (!this.globalOri) {
  2249. AccAndOri.bindOri((oriId) => {
  2250. this.$store.state.globalOri = oriId;
  2251. console.log("初始化:globalOri=", this.globalOri);
  2252. });
  2253. }
  2254. },
  2255. closeAcc() {
  2256. AccAndOri.unBindAcc(this.globalAcc);
  2257. this.$store.state.globalAcc = null;
  2258. AccAndOri.unBindOri(this.globalOri);
  2259. this.$store.state.globalOri = null;
  2260. },
  2261. outGyro(o) {
  2262. console.log("Orientation\nAlpha:" + o.alpha + "\nBeta:" + o.beta + "\nGamma:" + o.gamma);
  2263. },
  2264. openGyro() {
  2265. if (!this.globalOri) {
  2266. AccAndOri.bindOri((oriId) => {
  2267. this.$store.state.globalOri = oriId;
  2268. console.log("初始化:globalOri=", this.globalOri);
  2269. });
  2270. }
  2271. uni.$on('watchOrientation', this.outGyro);
  2272. },
  2273. stopGyro() {
  2274. uni.$off('watchOrientation', this.outGyro);
  2275. AccAndOri.unBindOri(this.globalOri);
  2276. this.$store.state.globalOri = null;
  2277. },
  2278. onKeyInput: function(event) {
  2279. this.$store.state.LocationGameUrl = event.target.value
  2280. },
  2281. onNavFcGame() {
  2282. // console.log(0);
  2283. uni.navigateTo({
  2284. url: "../../fc-page/fc/fc"
  2285. })
  2286. },
  2287. onNavAppInfo() {
  2288. uni.navigateTo({
  2289. url: '../../info-page/app-info/app-info'
  2290. })
  2291. },
  2292. onNavToSelectFriend() {
  2293. uni.navigateTo({
  2294. url: '../../friend-page/select/select'
  2295. })
  2296. },
  2297. /**
  2298. * 悬停按钮
  2299. */
  2300. fabClick() {
  2301. //如果第一次点击悬停按钮
  2302. if (this.cIndex != -1 && this.BLEConnectDevice != null) {
  2303. //先检测
  2304. uni.showModal({
  2305. title: '设备状态',
  2306. content: '是否断开连接?',
  2307. /**
  2308. * 如果需要强制,不显示取消按钮
  2309. */
  2310. showCancel: true,
  2311. ConfirmColor: '#A488DC',
  2312. success: res => {
  2313. if (res.confirm) {
  2314. this.onCloseBLEConnection({
  2315. getSuccess: () => {}
  2316. });
  2317. }
  2318. }
  2319. });
  2320. } else {
  2321. this.openDeviceList();
  2322. }
  2323. },
  2324. /**
  2325. * action 模块相关数据更新,实时更新
  2326. */
  2327. onActionJumpDataUpdate(obj) {
  2328. // console.log(obj);
  2329. this.AJData.allCount = obj.eliminationCount + obj.faultCount;
  2330. this.AJData.faultCount = obj.faultCount;
  2331. //如果pk模式下,区分两个人的分数
  2332. if (this.currentMode == "pkMode") {
  2333. if (this.AJData.isLeftPlayer) {
  2334. this.AJData.myScore = obj.eliminationCount - obj.faultCount;
  2335. } else {
  2336. this.AJData.otherScore = obj.eliminationCount - obj.faultCount;
  2337. }
  2338. }
  2339. //调用
  2340. if (0 === this.currentModeIndex) {
  2341. //拳击柱
  2342. this.onAddSandbagHitCount();
  2343. }
  2344. // else if (1 === this.currentModeIndex) {
  2345. // //跳
  2346. // }
  2347. // console.log(this.AJData.myUsageTime, this.AJData.otherUsageTime);
  2348. },
  2349. onActionJumpCountDownUpdate(obj) {
  2350. // this.AJData.perCountDown = obj.countDown;
  2351. if (this.currentMode == "pkMode") {
  2352. if (this.AJData.isLeftPlayer) {
  2353. this.AJData.myUsageTime = this.AJData.gameLimitTime - this.AJData.gameCountDown;
  2354. } else {
  2355. this.AJData.otherUsageTime = this.AJData.gameLimitTime - this.AJData.gameCountDown;
  2356. }
  2357. }
  2358. // console.log(this.AJData.myUsageTime, this.AJData.otherUsageTime, this.AJData.gameLimitTime);
  2359. },
  2360. //actionJump 模块跳关卡开始处理
  2361. onActionJumpPlay() {
  2362. //开始时候,设置默认参数
  2363. if (this.AJData.isFinish) {
  2364. //如果下一局,重新设置一下默认参数
  2365. this.onResetDefaultActionJumpData();
  2366. }
  2367. this.onSetActionJumpData();
  2368. this.$refs.actionJumpRef.onActionJumpPlay();
  2369. this.bGamePlaying = true;
  2370. //todo 首先判断时间处理
  2371. if (0 !== this.currentJumpTask.item.limitTime) {
  2372. //0默认不限时,所以限时的才走计时间
  2373. this.arcbarCountDownPlay(true);
  2374. }
  2375. },
  2376. //actionHit 模块跳关卡开始处理
  2377. onActionHitPlay() {
  2378. //开始时候,设置默认参数
  2379. if (this.AJData.isFinish) {
  2380. //如果下一局,重新设置一下默认参数
  2381. this.onResetDefaultActionJumpData();
  2382. }
  2383. this.onSetActionJumpData();
  2384. this.$refs.actionHitRef.onActionPlay();
  2385. this.bGamePlaying = true;
  2386. //todo 首先判断时间处理
  2387. if (0 !== this.currentJumpTask.item.limitTime) {
  2388. //0默认不限时,所以限时的才走计时间
  2389. this.arcbarCountDownPlay(true);
  2390. }
  2391. },
  2392. //重置actionJump数据
  2393. onResetDefaultActionJumpData() {
  2394. this.AJData = Object.assign({}, this.defaultAJData);
  2395. },
  2396. onSetActionJumpData() {
  2397. let _item = this.currentJumpTask.item;
  2398. //这里set只是对应关卡的数据
  2399. this.AJData = Object.assign({}, this.AJData, {
  2400. allCount: 0,
  2401. faultCount: 0,
  2402. perCountDown: 0,
  2403. gameCountDown: 0,
  2404. gameLimitTime: _item.limitTime,
  2405. targetCount: _item.signCount,
  2406. })
  2407. // console.log('onSetActionJumpData'+JSON.stringify(this.AJData)+JSON.stringify(_item));
  2408. },
  2409. /**
  2410. * 游戏结束
  2411. * @param {Object} data
  2412. */
  2413. onActionJumpGameOver(data) {
  2414. let {
  2415. isOffEvent = false
  2416. } = data;
  2417. //游戏结束,重置时间
  2418. this.arcbarCountDownTimeReset();
  2419. //todo 可能区分 levelJump 关卡类型
  2420. if (this.currentMode == "pkMode") {
  2421. //pk模式下面
  2422. if (this.AJData.isLeftPlayer) {
  2423. //如果是左边的.切换下一个玩家
  2424. this.AJData.isLeftPlayer = false;
  2425. uni.showModal({
  2426. title: '切换下一个玩家',
  2427. showCancel: false,
  2428. success: (res) => {
  2429. if (res.confirm) {
  2430. //重新开始计算
  2431. if (0 === this.currentModeIndex) {
  2432. //调用开始
  2433. this.onActionHitPlay();
  2434. } else if (1 === this.currentModeIndex) {
  2435. //调用开始
  2436. this.onActionJumpPlay();
  2437. }
  2438. }
  2439. }
  2440. })
  2441. } else {
  2442. if (isOffEvent) {
  2443. //停止蓝牙加速计
  2444. this.onWriteBLEConnectionValue({
  2445. value: "4"
  2446. });
  2447. uni.$off('updateBLEDeviceData', this.callbackUpdateBLEData);
  2448. console.log('pkMode onActionJumpGameOver 任务结束');
  2449. this.bGamePlaying = false;
  2450. //同步到数据库
  2451. if (0 === this.currentModeIndex) {
  2452. //拳击柱
  2453. this.uploadUserData_hitCount();
  2454. }
  2455. }
  2456. this.AJData.isFinish = true;
  2457. //奖励赢的人 PKLEVELREWARD
  2458. let _item = this.currentJumpTask.item;
  2459. let _curFriend = this.finallySelectFriendInfo;
  2460. console.log('this.finallySelectFriendInfo:', this.finallySelectFriendInfo);
  2461. let isMyWin = true;
  2462. //如果是右边好友,即判断结束。计算胜负关系
  2463. if (this.AJData.myScore > this.AJData.otherScore) {
  2464. isMyWin = true;
  2465. //显示一个提示框
  2466. this.showPopup('pkFinish', {
  2467. name: this.userName,
  2468. url: this.avatarUrl,
  2469. score: this.AJData.myScore,
  2470. consumeTime: Math.abs(this.AJData.myUsageTime),
  2471. hit: this.AJData.allCount - this.AJData.faultCount,
  2472. miss: this.AJData.faultCount
  2473. });
  2474. // console.log({
  2475. // name: this.username,
  2476. // url: this.avatarUrl,
  2477. // score: this.AJData.myScore,
  2478. // consumeTime: Math.abs(this.AJData.myUsageTime),
  2479. // hit: this.AJData.allCount - this.AJData.faultCount,
  2480. // miss: this.AJData.faultCount
  2481. // });
  2482. } else {
  2483. // uni.showToast({
  2484. // title: '好友赢或者平局',
  2485. // duration: 2000
  2486. // })
  2487. isMyWin = false;
  2488. //显示一个提示框
  2489. this.showPopup('pkFinish', {
  2490. name: _curFriend.username,
  2491. url: _curFriend.avatarUrl,
  2492. score: this.AJData.otherScore,
  2493. consumeTime: this.AJData.otherUsageTime,
  2494. hit: this.AJData.allCount - this.AJData.faultCount,
  2495. miss: this.AJData.faultCount
  2496. });
  2497. }
  2498. reqUtil
  2499. .requestData(config.URL.PKLEVELREWARD, {
  2500. levelId: _item.id,
  2501. levelType: 1,
  2502. isMyWin: isMyWin,
  2503. friendId: _curFriend.friendId
  2504. })
  2505. .then(
  2506. res => {
  2507. if (res.code == 0) {
  2508. console.log('PKLEVELREWARD:' + JSON.stringify(res.data));
  2509. this.nextTaskCanUnlock = false;
  2510. for (let i = 0; i < this.currentTaskList.length; i++) {
  2511. if (this.currentTaskList[i].id == _item.id) {
  2512. this.currentTaskList[i].isPassed = true;
  2513. break;
  2514. }
  2515. }
  2516. if (isMyWin) {
  2517. //只有isMyWin的情况下才有这两个字段返回,更新本地金币和钻石
  2518. this.setGoldAndDiamond({
  2519. gold: res.data.gold,
  2520. diamond: res.data.diamond
  2521. });
  2522. }
  2523. }
  2524. },
  2525. e => {
  2526. console.log(e);
  2527. }
  2528. );
  2529. }
  2530. } else {
  2531. if (isOffEvent) {
  2532. //停止蓝牙加速计
  2533. this.onWriteBLEConnectionValue({
  2534. value: "4"
  2535. });
  2536. uni.$off('updateBLEDeviceData', this.callbackUpdateBLEData);
  2537. console.log('onActionJumpGameOver 任务结束');
  2538. this.bGamePlaying = false;
  2539. //同步到数据库
  2540. if (0 === this.currentModeIndex) {
  2541. //拳击柱
  2542. this.uploadUserData_hitCount();
  2543. }
  2544. }
  2545. this.AJData.isFinish = true;
  2546. if (data.myWin) {
  2547. //通过关卡,处理逻辑
  2548. let _item = this.currentJumpTask.item;
  2549. reqUtil
  2550. .requestData(config.URL.PASSTHELEVEL, {
  2551. levelId: _item.id,
  2552. levelType: 1,
  2553. })
  2554. .then(
  2555. res => {
  2556. if (res.code == 0) {
  2557. console.log('PASSTHELEVEL:' + JSON.stringify(res.data));
  2558. //处理 列表数据
  2559. this.nextTaskCanUnlock = false;
  2560. for (let i = 0; i < this.currentTaskList.length; i++) {
  2561. if (this.currentTaskList[i].id == _item.id) {
  2562. this.currentTaskList[i].isPassed = true;
  2563. break;
  2564. }
  2565. }
  2566. let _title = data.myWin ? "胜利" : "失败";
  2567. let _context = data.myWin ? "通关关卡成功!" : "通关关卡失败!";
  2568. this.modalName = "showModalTip"
  2569. if (0 !== res.data.rewardHonor.type || 0 !== res.data.rewardGold || 0 !== res.data
  2570. .rewardDiamond) {
  2571. //todo
  2572. this.$refs.modalTipRef.setShowData({
  2573. title: _title,
  2574. context: _context,
  2575. operationItem: res.data,
  2576. type: 'PASSTHELEVEL'
  2577. });
  2578. //存在任何奖励的情况下直接更新一下返回的金币和钻石数据
  2579. this.setGoldAndDiamond({
  2580. gold: res.data.gold,
  2581. diamond: res.data.diamond
  2582. });
  2583. } else {
  2584. //没有奖励数据
  2585. this.$refs.modalTipRef.setShowData({
  2586. title: _title,
  2587. context: _context,
  2588. operationItem: null,
  2589. type: 'none'
  2590. });
  2591. }
  2592. }
  2593. },
  2594. e => {
  2595. console.log(e);
  2596. }
  2597. );
  2598. }
  2599. }
  2600. },
  2601. showDrawer() {
  2602. this.showDrawerById();
  2603. },
  2604. showPopup(type, item) {
  2605. this.showPopupById({
  2606. type,
  2607. item
  2608. });
  2609. },
  2610. showGuide(type, item) {
  2611. this.showGuideById({
  2612. type,
  2613. item
  2614. });
  2615. },
  2616. /**
  2617. * 任务相关
  2618. */
  2619. selectTask(_index, _item) {
  2620. // console.log(JSON.stringify(_item));
  2621. if (_item.isUnlock) {
  2622. let _data = {
  2623. modeName: this.currentMode, //记录时候记录当前的mode
  2624. index: _index,
  2625. item: _item,
  2626. }
  2627. //记录临时选择的游戏关卡
  2628. this.tempSelectedLevel = _data;
  2629. } else {
  2630. let isCanUnlock = _index == 0 || (_index >= 1 && this.currentTaskList[_index - 1].isUnlock && this
  2631. .currentTaskList[_index - 1].isPassed) ? true : false;
  2632. if (!isCanUnlock) return;
  2633. this.showPopup('unlock', _item);
  2634. }
  2635. },
  2636. updateTaskScroll() {
  2637. /**
  2638. * 获取任务对象
  2639. */
  2640. this.getActionJumpTask();
  2641. //console.error('当前的任务对象===========:' + JSON.stringify(this.currentJumpTask.modeName) + '= '+this.currentMode);
  2642. if (this.currentJumpTask != null && this.currentJumpTask.modeName == this.currentMode) {
  2643. let _index = this.currentJumpTask.index - 1 < 0 ? 0 : this.currentJumpTask.index - 1;
  2644. this.$nextTick(() => {
  2645. this.taskIntoView = "task_" + _index;
  2646. });
  2647. this.taskIntoView = '' //不清空再次跳到锚点位置会不起作用
  2648. }
  2649. },
  2650. switchTaskInfo() {
  2651. if (this.currentMode == 'calorieMode') {
  2652. this.currentTaskList = this.singlePersonList;
  2653. } else if (this.currentMode == 'pkMode') {
  2654. this.currentTaskList = this.multiPersonList;
  2655. }
  2656. },
  2657. onSwitchMode() {
  2658. if (this.currentMode == 'calorieMode') {
  2659. this.currentMode = 'pkMode';
  2660. } else if (this.currentMode == 'pkMode') {
  2661. this.currentMode = 'calorieMode';
  2662. }
  2663. this.switchTaskInfo();
  2664. },
  2665. /**
  2666. * 处理监听数据,比如切换列表后,重置action jump an action hit 等操作;
  2667. */
  2668. onSwitchTaskList() {
  2669. if (this.currentModeIndex != this.oldModeIndex) {
  2670. this.oldModeIndex = this.currentModeIndex;
  2671. this.tempSelectedLevel = null;
  2672. //清空当前选择的任务
  2673. this.resetActionJumpTask();
  2674. this.currentMode = 'calorieMode';
  2675. }
  2676. this.switchTaskInfo();
  2677. console.log("onSwitchTaskList");
  2678. //切换时候,清空当前的任务进度
  2679. this.arcbarCountDownTimeReset();
  2680. this.bGamePlaying = false;
  2681. this.$nextTick(() => {
  2682. if (0 === this.currentModeIndex) {
  2683. this.$refs.actionHitRef.onStopAndClearAction(true);
  2684. //用于刷新 drawBg
  2685. // this.$refs.actionHitRef.onDrawBg(true);
  2686. } else if (1 === this.currentModeIndex) {
  2687. this.$refs.actionJumpRef.onStopAndClearAction(true);
  2688. // this.$refs.actionJumpRef.onDrawBg(true);
  2689. }
  2690. })
  2691. },
  2692. /**
  2693. * @deprecated Test 测试通过关卡
  2694. */
  2695. onPassTheLevel() {
  2696. if (this.currentMode == "pkMode") {
  2697. this.AJData.myScore = 10;
  2698. this.AJData.isLeftPlayer = false;
  2699. }
  2700. this.onActionJumpGameOver({
  2701. myWin: true
  2702. });
  2703. },
  2704. //确认时候选择按钮
  2705. onConfirmSelectionLevel() {
  2706. if (this.tempSelectedLevel == null) {
  2707. uni.showToast({
  2708. icon: 'none',
  2709. title: '先选择一个挑战关卡',
  2710. mask: true
  2711. })
  2712. return;
  2713. }
  2714. //点击确认时候,记录关卡,并且开始游戏
  2715. this.setActionJumpTask(this.tempSelectedLevel);
  2716. this.hideModal();
  2717. setTimeout(() => {
  2718. // 自动调用开始游戏
  2719. this.onPersonalCheck({
  2720. bStartCountDown: true
  2721. });
  2722. }, 300);
  2723. },
  2724. registerPopupEvent() {
  2725. // 接收 popup 的消息
  2726. uni.$on('reward-popup-page', (data) => {
  2727. switch (data.type) {
  2728. case 'interactive':
  2729. uni.showModal({
  2730. title: '来自Popup的消息',
  2731. content: data.info
  2732. })
  2733. break;
  2734. case 'button':
  2735. if (data.messageType == 'prompt') {
  2736. if (data.confirm) {
  2737. console.log('prompt confirm!');
  2738. } else if (data.cancel) {
  2739. }
  2740. } else if (data.messageType == 'unlock') {
  2741. if (data.confirm) {
  2742. let _operationItem = data.operationItem;
  2743. console.log('unlock confirm!', _operationItem);
  2744. uni.showToast({
  2745. title: '正在解锁',
  2746. icon: 'loading',
  2747. duration: 10000
  2748. })
  2749. //todo 处理解锁流程
  2750. reqUtil
  2751. .requestData(config.URL.UNLOCKLEVEL, {
  2752. levelId: _operationItem.id,
  2753. levelType: 1, //levelJump = 1
  2754. numberType: _operationItem.numberType,
  2755. })
  2756. .then(
  2757. res => {
  2758. uni.hideToast();
  2759. console.log('UNLOCKLEVEL:' + JSON.stringify(res));
  2760. if (res.code === 404) {
  2761. uni.showToast({
  2762. title: '金币不足',
  2763. icon: 'none',
  2764. duration: 1000
  2765. })
  2766. } else if (res.code === 405) {
  2767. uni.showToast({
  2768. title: '钻石不足',
  2769. icon: 'none',
  2770. duration: 1000
  2771. })
  2772. } else if (res.code === 0) {
  2773. //解锁成功
  2774. uni.showToast({
  2775. title: '解锁成功',
  2776. icon: 'none',
  2777. duration: 1000
  2778. })
  2779. //更新本地金币和钻石
  2780. this.setGoldAndDiamond({
  2781. gold: res.data.gold,
  2782. diamond: res.data.diamond
  2783. });
  2784. for (let i = 0; i < this.currentTaskList.length; i++) {
  2785. if (this.currentTaskList[i].id == _operationItem.id) {
  2786. this.currentTaskList[i].isUnlock = true;
  2787. break;
  2788. }
  2789. }
  2790. } else if (res.code === 803) {
  2791. if (res.data.length > 0) {
  2792. uni.showToast({
  2793. title: '需要' + res.data[0].explain,
  2794. icon: 'none',
  2795. duration: 2000
  2796. })
  2797. } else {
  2798. uni.showToast({
  2799. title: '关卡条件关联未设置',
  2800. icon: 'none',
  2801. duration: 2000
  2802. })
  2803. }
  2804. } else if (res.code === 802 || res.code === 805) {
  2805. uni.showToast({
  2806. title: res.msg,
  2807. icon: 'none',
  2808. duration: 2000
  2809. })
  2810. }
  2811. },
  2812. e => {
  2813. console.log(e);
  2814. }
  2815. );
  2816. }
  2817. } else if (data.messageType == 'signIn') {
  2818. this.onUserSignIn();
  2819. }
  2820. break;
  2821. default:
  2822. uni.showToast({
  2823. title: data.title,
  2824. })
  2825. break;
  2826. }
  2827. })
  2828. // 监听 drawer 消息
  2829. uni.$on('drawer-page', (data) => {
  2830. uni.showToast({
  2831. title: '点击了第' + data + '项',
  2832. icon: "none"
  2833. });
  2834. })
  2835. uni.$on('guide-popup-page', (data) => {
  2836. console.log('guide-popup-page', JSON.stringify(data));
  2837. setTimeout(() => {
  2838. this.bShowComplete = true;
  2839. console.log('this.bShowComplete', this.bShowComplete);
  2840. }, 250);
  2841. switch (data.type) {
  2842. case 'button':
  2843. if (data.messageType == 'plan') {
  2844. if (data.confirm) {
  2845. //首次安装
  2846. if (data.hiddenType == 'firstInstallation') {
  2847. //跳转提示连接手柄蓝牙
  2848. setTimeout(() => {
  2849. this.onGetBluetoothConnectView({
  2850. hiddenType: 'firstInstallation'
  2851. });
  2852. }, 60)
  2853. console.log('提示连接手柄')
  2854. }
  2855. }
  2856. } else if (data.messageType == 'bluetoothConnect') {
  2857. if (data.confirm) {
  2858. //跳转播放
  2859. // this.onGetActionJumpView();
  2860. //首次安装
  2861. if (data.hiddenType == 'firstInstallation') {
  2862. setTimeout(() => {
  2863. // this.showGuide('device-tip', {
  2864. // hiddenType: 'firstInstallation'
  2865. // });
  2866. this.showGuide('level-button-tip', {
  2867. hiddenType: 'firstInstallation'
  2868. });
  2869. console.log('提示连接关卡')
  2870. }, 60)
  2871. } else if (data.hiddenType == 'firstDisconnectBluetooth') {
  2872. this.fabClick();
  2873. }
  2874. }
  2875. } else if (data.messageType == 'actionJumpPlay') {
  2876. if (data.confirm) {
  2877. }
  2878. } else if (data.messageType == 'device-tip') {
  2879. if (data.confirm) {
  2880. if (data.hiddenType == 'firstInstallation') {
  2881. setTimeout(() => {
  2882. this.showGuide('level-button-tip', {
  2883. hiddenType: 'firstInstallation'
  2884. });
  2885. }, 60)
  2886. }
  2887. }
  2888. } else if (data.messageType == 'level-button-tip') {
  2889. if (data.confirm) {
  2890. }
  2891. }
  2892. break;
  2893. case 'selected':
  2894. console.log('当前操作的类型 selected:', data.messageType)
  2895. if (data.messageType == 'level-button-tip') {
  2896. if (data.isSelected) {
  2897. uni.setStorage({
  2898. key: 'levelButtonPrompt',
  2899. data: {
  2900. isSelected: true
  2901. }
  2902. })
  2903. //如果选择不提示。则隐藏按钮
  2904. this.$refs.actionJumpRef.onUpdateTipLevelValue(false);
  2905. } else {
  2906. uni.setStorage({
  2907. key: 'levelButtonPrompt',
  2908. data: {
  2909. isSelected: false
  2910. }
  2911. })
  2912. //如果选择提示。则显示按钮
  2913. this.$refs.actionJumpRef.onUpdateTipLevelValue(true);
  2914. }
  2915. } else if (data.messageType == 'device-tip') {
  2916. if (data.isSelected) {
  2917. uni.setStorage({
  2918. key: 'deviceDirectionPrompt',
  2919. data: {
  2920. isSelected: true
  2921. }
  2922. })
  2923. //todo 后续处理是否自动提示,true就不自动提示
  2924. } else {
  2925. uni.setStorage({
  2926. key: 'deviceDirectionPrompt',
  2927. data: {
  2928. isSelected: false
  2929. }
  2930. })
  2931. //todo 后续处理是否自动提示,false就自动提示
  2932. }
  2933. }
  2934. break;
  2935. default:
  2936. uni.showToast({
  2937. title: data.title,
  2938. })
  2939. break;
  2940. }
  2941. })
  2942. },
  2943. unregisterPopupEvent() {
  2944. //注销相应的nvue
  2945. this.closeDrawerById();
  2946. this.closePopupById();
  2947. this.closeGuideById();
  2948. uni.$off('reward-popup-page')
  2949. uni.$off('drawer-page')
  2950. uni.$off('guide-popup-page')
  2951. },
  2952. onNavToDirection() {
  2953. uni.navigateTo({
  2954. url: '../directionOfDetection/directionOfDetection'
  2955. })
  2956. },
  2957. moveBoxingHandle() {
  2958. return;
  2959. },
  2960. /**
  2961. * 提示打开关卡
  2962. */
  2963. onTipLevel(value) {
  2964. // #ifdef APP-PLUS
  2965. this.showGuide('level-button-tip', value);
  2966. // #endif
  2967. // #ifdef H5
  2968. console.warn("不支持nvue");
  2969. // #endif
  2970. },
  2971. onShowFirstInstallation() {
  2972. //第一次安装登录。提示 计划
  2973. this.showGuide('plan', {
  2974. hiddenType: 'firstInstallation'
  2975. });
  2976. console.log("guideUnlockState 1=============:", this.guideUnlockState);
  2977. let guideUnlockState = Object.assign(this.guideUnlockState, {
  2978. firstInstallation: false
  2979. });
  2980. this.setGuideUnlockState(guideUnlockState);
  2981. },
  2982. onAddSandbagHitCount() {
  2983. this.addSandbagHitCount({
  2984. count: 1
  2985. });
  2986. },
  2987. onReset() {
  2988. this.$store.state.sandbagHitCount = 0;
  2989. },
  2990. onSendMsg() {
  2991. let msg = [{
  2992. "maxValue": 19.267578125,
  2993. "gyroValue": -1172.607421875,
  2994. "resultant": 23.36043492594914,
  2995. "index": 98,
  2996. "acc": {
  2997. "oAccX": 10.2587890625,
  2998. "oAccY": -8.3203125,
  2999. "oAccZ": -19.267578125
  3000. },
  3001. "gyro": {
  3002. "oGyroX": -13.0615234375,
  3003. "oGyroY": -1172.607421875,
  3004. "oGyroZ": -42.66357421875
  3005. }
  3006. }, {
  3007. "maxValue": 19.267578125,
  3008. "gyroValue": -1172.607421875,
  3009. "resultant": 23.36043492594914,
  3010. "index": 99,
  3011. "acc": {
  3012. "oAccX": 10.2587890625,
  3013. "oAccY": -8.3203125,
  3014. "oAccZ": -19.267578125
  3015. },
  3016. "gyro": {
  3017. "oGyroX": -13.0615234375,
  3018. "oGyroY": -1172.607421875,
  3019. "oGyroZ": -42.66357421875
  3020. }
  3021. }, {
  3022. "maxValue": 6.58203125,
  3023. "gyroValue": -1144.59228515625,
  3024. "resultant": 8.733990874058362,
  3025. "index": 100,
  3026. "acc": {
  3027. "oAccX": 3.740234375,
  3028. "oAccY": -4.35546875,
  3029. "oAccZ": -6.58203125
  3030. },
  3031. "gyro": {
  3032. "oGyroX": -26.91650390625,
  3033. "oGyroY": -1144.59228515625,
  3034. "oGyroZ": -45.10498046875
  3035. }
  3036. }, {
  3037. "maxValue": 6.58203125,
  3038. "gyroValue": -1144.59228515625,
  3039. "resultant": 8.733990874058362,
  3040. "index": 101,
  3041. "acc": {
  3042. "oAccX": 3.740234375,
  3043. "oAccY": -4.35546875,
  3044. "oAccZ": -6.58203125
  3045. },
  3046. "gyro": {
  3047. "oGyroX": -26.91650390625,
  3048. "oGyroY": -1144.59228515625,
  3049. "oGyroZ": -45.10498046875
  3050. }
  3051. }, {
  3052. "maxValue": -1.1376953125,
  3053. "gyroValue": -1038.87939453125,
  3054. "resultant": 3.372542722981424,
  3055. "index": 102,
  3056. "acc": {
  3057. "oAccX": -1.5966796875,
  3058. "oAccY": -2.744140625,
  3059. "oAccZ": 1.1376953125
  3060. },
  3061. "gyro": {
  3062. "oGyroX": -46.93603515625,
  3063. "oGyroY": -1038.87939453125,
  3064. "oGyroZ": -66.162109375
  3065. }
  3066. }, {
  3067. "maxValue": -1.30859375,
  3068. "gyroValue": -951.2939453125,
  3069. "resultant": 10.222525689439594,
  3070. "index": 103,
  3071. "acc": {
  3072. "oAccX": 1.23046875,
  3073. "oAccY": -10.0634765625,
  3074. "oAccZ": 1.30859375
  3075. },
  3076. "gyro": {
  3077. "oGyroX": -54.0771484375,
  3078. "oGyroY": -951.2939453125,
  3079. "oGyroZ": -85.205078125
  3080. }
  3081. }, {
  3082. "maxValue": -1.30859375,
  3083. "gyroValue": -951.2939453125,
  3084. "resultant": 10.222525689439594,
  3085. "index": 104,
  3086. "acc": {
  3087. "oAccX": 1.23046875,
  3088. "oAccY": -10.0634765625,
  3089. "oAccZ": 1.30859375
  3090. },
  3091. "gyro": {
  3092. "oGyroX": -54.0771484375,
  3093. "oGyroY": -951.2939453125,
  3094. "oGyroZ": -85.205078125
  3095. }
  3096. }, {
  3097. "maxValue": 0,
  3098. "gyroValue": -890.2587890625,
  3099. "resultant": 16.96604926042062,
  3100. "index": 105,
  3101. "acc": {
  3102. "oAccX": 4.4384765625,
  3103. "oAccY": -16.3623046875,
  3104. "oAccZ": 0.6494140625
  3105. },
  3106. "gyro": {
  3107. "oGyroX": -47.36328125,
  3108. "oGyroY": -890.2587890625,
  3109. "oGyroZ": -100.15869140625
  3110. }
  3111. }, {
  3112. "maxValue": 0,
  3113. "gyroValue": -890.2587890625,
  3114. "resultant": 16.96604926042062,
  3115. "index": 106,
  3116. "acc": {
  3117. "oAccX": 4.4384765625,
  3118. "oAccY": -16.3623046875,
  3119. "oAccZ": 0.6494140625
  3120. },
  3121. "gyro": {
  3122. "oGyroX": -47.36328125,
  3123. "oGyroY": -890.2587890625,
  3124. "oGyroZ": -100.15869140625
  3125. }
  3126. }, {
  3127. "maxValue": 1.6455078125,
  3128. "gyroValue": -826.47705078125,
  3129. "resultant": 19.088619035995112,
  3130. "index": 107,
  3131. "acc": {
  3132. "oAccX": 6.8798828125,
  3133. "oAccY": -17.7294921875,
  3134. "oAccZ": -1.6455078125
  3135. },
  3136. "gyro": {
  3137. "oGyroX": -32.04345703125,
  3138. "oGyroY": -826.47705078125,
  3139. "oGyroZ": -116.2109375
  3140. }
  3141. }, {
  3142. "maxValue": 0,
  3143. "gyroValue": -754.7607421875,
  3144. "resultant": 12.858333021663745,
  3145. "index": 108,
  3146. "acc": {
  3147. "oAccX": 4.4580078125,
  3148. "oAccY": -12.060546875,
  3149. "oAccZ": -0.078125
  3150. },
  3151. "gyro": {
  3152. "oGyroX": -20.751953125,
  3153. "oGyroY": -754.7607421875,
  3154. "oGyroZ": -133.544921875
  3155. }
  3156. }, {
  3157. "maxValue": 0,
  3158. "gyroValue": -754.7607421875,
  3159. "resultant": 12.858333021663745,
  3160. "index": 109,
  3161. "acc": {
  3162. "oAccX": 4.4580078125,
  3163. "oAccY": -12.060546875,
  3164. "oAccZ": -0.078125
  3165. },
  3166. "gyro": {
  3167. "oGyroX": -20.751953125,
  3168. "oGyroY": -754.7607421875,
  3169. "oGyroZ": -133.544921875
  3170. }
  3171. }, {
  3172. "maxValue": 4.0087890625,
  3173. "gyroValue": -700.1953125,
  3174. "resultant": 4.438586679567735,
  3175. "index": 110,
  3176. "acc": {
  3177. "oAccX": 1.5869140625,
  3178. "oAccY": -1.0546875,
  3179. "oAccZ": -4.0087890625
  3180. },
  3181. "gyro": {
  3182. "oGyroX": -10.43701171875,
  3183. "oGyroY": -700.1953125,
  3184. "oGyroZ": -149.35302734375
  3185. }
  3186. }];
  3187. this.onSendSocketMessage(msg);
  3188. },
  3189. onReadDataNameInput: function(event) {
  3190. this.onSetReadDataName(event.target.value);
  3191. },
  3192. onTestModuleUpdateCallback(res) {
  3193. console.log(JSON.stringify(res));
  3194. if (res.code == 0) {
  3195. if (res.tag == -1) {
  3196. // this.normalText = "测试 msg:" + res.msg + ",return int:" + res.tag + "\n";
  3197. } else {
  3198. //识别到跳
  3199. uni.showToast({
  3200. title: res.tag + ',' + res.msg,
  3201. icon: 'none',
  3202. duration: 1000,
  3203. mask: true
  3204. })
  3205. }
  3206. }
  3207. },
  3208. _jumpIdenModule_DownloadReadData(item) {
  3209. if (this.currentJumpItem)
  3210. this.currentJumpItem.bRatio = false;
  3211. this.currentJumpItem = item;
  3212. this.jumpIdenModule_DownloadReadData({
  3213. data: item,
  3214. callback: (res) => {
  3215. item.bRatio = true;
  3216. }
  3217. });
  3218. },
  3219. onReadBLELightInput: function(event) {
  3220. this.onSetReadBLELight(event.target.value);
  3221. },
  3222. onSendBLELightNoSet(value) {
  3223. console.log(value);
  3224. this.B_WriteHexToBLECharacteristic({
  3225. value: value
  3226. });
  3227. },
  3228. onSendBLELightValue(value) {
  3229. console.log(value);
  3230. this.B_WriteHexToBLECharacteristic({
  3231. value: value
  3232. });
  3233. this.onSetReadBLELight(value);
  3234. },
  3235. onFrameHitCapacityInput: function(event) {
  3236. this.$store.state.hotmanIntelligentData.frameHitCapacity = event.target.value;
  3237. // console.log( this.hotmanIntelligentData);
  3238. this.onSaveHotmanIntelligentData();
  3239. },
  3240. onSlopeArrInput: function(event) {
  3241. this.$store.state.hotmanIntelligentData.slopeArr = event.target.value.split(',').map(Number);
  3242. // console.log( this.hotmanIntelligentData);
  3243. this.onSaveHotmanIntelligentData();
  3244. },
  3245. CheckboxChange(e) {
  3246. var items = this.checkbox,
  3247. values = e.detail.value;
  3248. let bCheck = false;
  3249. for (var i = 0, lenI = items.length; i < lenI; ++i) {
  3250. items[i].checked = false;
  3251. for (var j = 0, lenJ = values.length; j < lenJ; ++j) {
  3252. if (items[i].value == values[j]) {
  3253. items[i].checked = true;
  3254. bCheck = true;
  3255. break
  3256. }
  3257. }
  3258. }
  3259. this.$store.state.bIgnore = bCheck;
  3260. },
  3261. }
  3262. };
  3263. </script>
  3264. <style>
  3265. .bg-person {
  3266. /* background-color: #9797ff; */
  3267. background-color: #00003D;
  3268. /* #ifdef H5 */
  3269. /* background-size:750rpx 1622rpx;
  3270. background-image: url(../../../static/modal/action-jump/temp-tip.png); */
  3271. /* #endif */
  3272. }
  3273. .plan-view {
  3274. overflow: hidden;
  3275. /* background-color: #9797ff; */
  3276. }
  3277. .plan-l-tip-view {
  3278. border-radius: 80upx 0 0 80upx;
  3279. background-color: rgba(255, 255, 255, 0.05);
  3280. }
  3281. .plan-r-tip-view {
  3282. border-radius: 0 80upx 80upx 0;
  3283. background-color: rgba(255, 255, 255, 0.05);
  3284. }
  3285. .bottom-view {
  3286. background-color: rgba(246, 243, 249, 255);
  3287. padding-bottom: 20rpx;
  3288. border-radius: 80rpx 80rpx 0 0;
  3289. width: 750rpx;
  3290. overflow: hidden;
  3291. }
  3292. .time-view {
  3293. width: 100%;
  3294. margin-top: 53rpx;
  3295. /* border: 1rpx solid #DD514C; */
  3296. }
  3297. /*样式的width和height一定要与定义的cWidth和cHeight相对应*/
  3298. .qiun-charts-arcbar {
  3299. height: 376rpx;
  3300. position: relative;
  3301. width: 750rpx;
  3302. /* border: 1rpx solid #fff; */
  3303. background-color: RGBA(30, 30, 85, 1);
  3304. }
  3305. .charts-arcbar {
  3306. position: absolute;
  3307. /* margin-left: 81upx;
  3308. */
  3309. left: 0;
  3310. right: 0;
  3311. top: 0;
  3312. bottom: 0;
  3313. margin: auto;
  3314. width: 490rpx;
  3315. height: 480rpx;
  3316. /* border: 1rpx solid #FFFFFF; */
  3317. }
  3318. .charts-arcbar-img {
  3319. position: absolute;
  3320. left: 135upx;
  3321. width: 480upx;
  3322. height: 480upx;
  3323. }
  3324. .charts-pring-bottom {
  3325. position: relative;
  3326. width: 100%;
  3327. display: flex;
  3328. flex-direction: column;
  3329. justify-content: center;
  3330. align-items: center;
  3331. }
  3332. .charts-pring-button {
  3333. width: 178rpx;
  3334. height: 64rpx;
  3335. display: flex;
  3336. flex-direction: row;
  3337. justify-content: start;
  3338. align-items: center;
  3339. border-radius: 0 25px 25px 0;
  3340. }
  3341. /* 心电图 */
  3342. /* .qiun-charts-elect {
  3343. width: 500rpx;
  3344. height: 136rpx;
  3345. } */
  3346. .charts-elect {
  3347. width: 464rpx;
  3348. height: 96rpx;
  3349. border: 1rpx solid #000000;
  3350. }
  3351. .e-button {
  3352. background-color: rgba(255, 255, 255, 0.25);
  3353. border-radius: 45px;
  3354. margin: 5px 12px;
  3355. box-shadow: 1px 1px 3px #888888;
  3356. display: flex;
  3357. justify-content: center;
  3358. }
  3359. /* 曲线图 */
  3360. .qiun-charts-area {
  3361. width: calc(750rpx - 40rpx);
  3362. height: 300upx;
  3363. /* background-color: #007AFF; */
  3364. position: relative;
  3365. }
  3366. .charts-area {
  3367. position: absolute;
  3368. width: 750upx;
  3369. height: 300upx;
  3370. }
  3371. .qiun-charts-bottom-container {
  3372. height: 63px;
  3373. position: relative;
  3374. width: 100%;
  3375. justify-content: center;
  3376. align-items: center;
  3377. display: flex;
  3378. flex-direction: row;
  3379. }
  3380. .qiun-charts-bottom-right {
  3381. position: absolute;
  3382. left: calc(50% + 50rpx);
  3383. top: 15px;
  3384. margin-left: 20rpx;
  3385. }
  3386. /* picker */
  3387. .mpvue-picker-view {
  3388. width: calc(50% - 5px);
  3389. height: 300px;
  3390. /* background-color: rgba(255, 255, 255, 1); */
  3391. border-radius: 20px;
  3392. }
  3393. .item {
  3394. text-align: center;
  3395. width: calc(100% - 0px);
  3396. background-color: rgba(255, 255, 255, 1);
  3397. height: 88upx;
  3398. line-height: 88upx;
  3399. text-overflow: ellipsis;
  3400. white-space: nowrap;
  3401. font-size: 40upx;
  3402. }
  3403. .picker-unit {
  3404. position: absolute;
  3405. right: 70px;
  3406. top: 43%;
  3407. }
  3408. .left-button,
  3409. .right-button {
  3410. margin: 20px 0;
  3411. padding: 10px 30px;
  3412. background-color: #ffffff;
  3413. }
  3414. .left-button {
  3415. border-top-left-radius: 20px;
  3416. border-bottom-left-radius: 20px;
  3417. border-right: 1px solid #e6e6e6;
  3418. }
  3419. .right-button {
  3420. border-top-right-radius: 20px;
  3421. border-bottom-right-radius: 20px;
  3422. }
  3423. .png-size-28 {
  3424. width: 24px;
  3425. height: 24px;
  3426. margin-bottom: 4px;
  3427. }
  3428. .png-size-32 {
  3429. width: 32px;
  3430. height: 32px;
  3431. }
  3432. .png-size-34 {
  3433. width: 34px;
  3434. height: 34px;
  3435. }
  3436. /* 图标大小 */
  3437. .data-play {
  3438. width: 16px;
  3439. height: 16px;
  3440. margin-top: 10rpx;
  3441. }
  3442. .p-data-png {
  3443. width: 16px;
  3444. height: 16px;
  3445. margin: 5rpx 20rpx;
  3446. }
  3447. .data-png {
  3448. width: 16px;
  3449. height: 16px;
  3450. margin: 5rpx;
  3451. }
  3452. .data-png-20 {
  3453. width: 20px;
  3454. height: 20px;
  3455. margin: 0 14rpx;
  3456. }
  3457. .data-png-54 {
  3458. width: 54px;
  3459. height: 54px;
  3460. margin: 0 14rpx;
  3461. }
  3462. .data-png-add {
  3463. position: absolute;
  3464. left: 0;
  3465. top: 0;
  3466. right: 0;
  3467. bottom: 0;
  3468. margin: auto;
  3469. width: 34px;
  3470. height: 37px;
  3471. }
  3472. .time-container {
  3473. margin-top: 13px;
  3474. width: 100%;
  3475. height: 218rpx;
  3476. position: relative;
  3477. /* border: 1rpx solid #007AFF; */
  3478. }
  3479. .time-png {
  3480. width: 503rpx;
  3481. height: 222rpx;
  3482. position: absolute;
  3483. left: 0;
  3484. right: 0;
  3485. top: 0;
  3486. bottom: 0;
  3487. margin: auto;
  3488. z-index: 1;
  3489. }
  3490. .time-text {
  3491. font-size: 9px;
  3492. z-index: 10;
  3493. position: relative;
  3494. height: 100%;
  3495. display: flex;
  3496. justify-content: center;
  3497. align-items: center;
  3498. color: #FFFFFF;
  3499. }
  3500. .padding {
  3501. padding: 10rpx;
  3502. }
  3503. .logo {
  3504. height: 200rpx;
  3505. width: 200rpx;
  3506. margin-top: 200rpx;
  3507. margin-left: auto;
  3508. margin-right: auto;
  3509. margin-bottom: 50rpx;
  3510. }
  3511. .float-png {
  3512. position: absolute;
  3513. right: 15px;
  3514. bottom: 200px;
  3515. width: 56px;
  3516. height: 56px;
  3517. }
  3518. .moveCanvas {
  3519. position: fixed;
  3520. top: 9999rpx;
  3521. left: 0;
  3522. width: 188rpx;
  3523. height: 188rpx;
  3524. }
  3525. .scroll-class {
  3526. width: 100%;
  3527. overflow-x: hidden;
  3528. box-sizing: border-box;
  3529. /* border: 1rpx solid #000000; */
  3530. }
  3531. .homepage-grid-square {
  3532. width: 250rpx;
  3533. /* height: 250rpx; */
  3534. align-items: start;
  3535. }
  3536. .homepage-grid-square image {
  3537. width: 176rpx;
  3538. height: 176rpx;
  3539. }
  3540. .border {
  3541. /* width: 176rpx; */
  3542. font-size: 30rpx;
  3543. color: rgba(175, 175, 175, 1);
  3544. font-weight: 400;
  3545. text-align: center;
  3546. margin-top: 22rpx;
  3547. margin-bottom: 40rpx;
  3548. }
  3549. .item-img {
  3550. border-radius: 20rpx;
  3551. /* border: 1rpx solid #EEEEEE; */
  3552. box-shadow: 0px 1px 2px 0px rgba(113, 113, 219, 0.23);
  3553. }
  3554. .plan-Tip-child {
  3555. height: 120rpx;
  3556. }
  3557. .plan-mode-tip {
  3558. height: 90rpx;
  3559. }
  3560. .plan-grid-square {
  3561. width: 250rpx;
  3562. /* height: 250rpx; */
  3563. align-items: start;
  3564. }
  3565. .plan-grid-square image {
  3566. width: 168rpx;
  3567. height: 58rpx;
  3568. }
  3569. .plan-mode {
  3570. /* height: 54px; */
  3571. border-radius: 10px;
  3572. padding: 3px;
  3573. margin: 0 5px 10px 5px;
  3574. border: 1rpx solid #eeeeee;
  3575. /* box-shadow: 0px 1px 2px 0px rgba(113, 113, 219, 0.23); */
  3576. position: relative;
  3577. }
  3578. .plan-mode-selected {
  3579. /* height: 54px; */
  3580. padding: 3px;
  3581. margin: 0 5px 10px 5px;
  3582. background-size: contain;
  3583. background-clip: border-box;
  3584. background-repeat: no-repeat;
  3585. background-image: url(../../../static/plan-select-bg.png);
  3586. /* box-shadow: 0px 1px 2px 0px rgba(113, 113, 219, 0.23); */
  3587. position: relative;
  3588. }
  3589. .plan-mode-border {
  3590. /* width: 176rpx; */
  3591. font-size: 26rpx;
  3592. color: rgba(151, 151, 255, 1);
  3593. font-weight: 400;
  3594. text-align: center;
  3595. }
  3596. .button-fav {
  3597. background-color: rgba(153, 150, 252, 255);
  3598. color: #ffffff;
  3599. /* border-radius: 10px; */
  3600. /* width: 184rpx; */
  3601. height: 122rpx;
  3602. display: flex;
  3603. justify-content: center;
  3604. text-align: center;
  3605. align-items: center;
  3606. font-size: 14px;
  3607. }
  3608. .card-view-small {
  3609. /* border: 1rpx solid #000000; */
  3610. width: 80%;
  3611. border-radius: 20px;
  3612. margin-left: 50rpx;
  3613. overflow: hidden;
  3614. background-color: #ffffff;
  3615. box-shadow: 0px 2px 4px 0px rgba(113, 113, 219, 0.23);
  3616. }
  3617. .right-bg {
  3618. /* border: 1rpx solid #000000; */
  3619. border-radius: 8px;
  3620. background-color: #9797ff;
  3621. padding: 15rpx;
  3622. position: absolute;
  3623. right: 5%;
  3624. margin-top: 4%;
  3625. }
  3626. .plan-small-child {
  3627. background-color: #f5f5ff;
  3628. border-radius: 20px;
  3629. width: 480rpx;
  3630. height: 90rpx;
  3631. margin: 0 0 30rpx 30rpx;
  3632. /* margin-top: 60rpx; */
  3633. }
  3634. .cu-btn-plan {
  3635. position: relative;
  3636. border: 0upx;
  3637. display: inline-flex;
  3638. align-items: center;
  3639. justify-content: center;
  3640. box-sizing: border-box;
  3641. padding: 4upx 25upx 4upx 4upx;
  3642. margin-left: 5px;
  3643. font-size: 22upx;
  3644. height: 64upx;
  3645. line-height: 1;
  3646. text-align: center;
  3647. text-decoration: none;
  3648. overflow: visible;
  3649. margin-left: initial;
  3650. transform: translate(0upx, 0upx);
  3651. margin-right: initial;
  3652. }
  3653. .cu-btn-plan-child {
  3654. position: relative;
  3655. border: 0upx;
  3656. display: inline-flex;
  3657. align-items: center;
  3658. justify-content: center;
  3659. box-sizing: border-box;
  3660. padding: 0 4upx;
  3661. font-size: 22upx;
  3662. height: 56upx;
  3663. line-height: 1;
  3664. text-align: center;
  3665. text-decoration: none;
  3666. overflow: visible;
  3667. margin-left: initial;
  3668. transform: translate(0upx, 0upx);
  3669. margin-right: initial;
  3670. }
  3671. .cu-btn-plan-right {
  3672. position: relative;
  3673. border: 0upx;
  3674. display: inline-flex;
  3675. align-items: center;
  3676. justify-content: center;
  3677. box-sizing: border-box;
  3678. padding: 4upx 4upx 4upx 19upx;
  3679. margin-left: 5px;
  3680. font-size: 22upx;
  3681. height: 64upx;
  3682. line-height: 1;
  3683. text-align: center;
  3684. text-decoration: none;
  3685. overflow: visible;
  3686. margin-left: initial;
  3687. transform: translate(0upx, 0upx);
  3688. margin-right: initial;
  3689. }
  3690. /* 粗线条 */
  3691. .line-make {
  3692. margin-top: 11px;
  3693. margin-left: 8px;
  3694. border: 4rpx solid #FFFFFF;
  3695. width: 152rpx;
  3696. border-radius: 3px;
  3697. }
  3698. /* 头像背景处理 */
  3699. .avatar-bg-personal {
  3700. width: 34px;
  3701. height: 34px;
  3702. border-radius: 45px;
  3703. border: 2px solid #9997fc;
  3704. background-color: #9997fc;
  3705. box-sizing: border-box;
  3706. }
  3707. .avatar-bg-arrow {
  3708. position: absolute;
  3709. top: 12px;
  3710. left: calc(50% - 10px);
  3711. border-left: 10px solid transparent;
  3712. border-right: 10px solid transparent;
  3713. border-bottom: 10px solid #9997fc;
  3714. }
  3715. .elect-round-image {
  3716. width: 48px;
  3717. height: 48px;
  3718. z-index: 10;
  3719. box-shadow: 1px 1px 3px #888888;
  3720. border-radius: 45px;
  3721. }
  3722. .elect-personal {
  3723. /* width: 100%; */
  3724. height: 120rpx;
  3725. /* margin: 50rpx 0; */
  3726. margin-bottom: 50rpx;
  3727. border-radius: 45px;
  3728. padding: 10rpx;
  3729. border: 1rpx solid rgba(255, 255, 255, 0.11);
  3730. display: flex;
  3731. justify-content: center;
  3732. align-items: center;
  3733. position: relative;
  3734. }
  3735. /* 呼吸灯 */
  3736. .breathing-lamp {
  3737. animation-duration: 1s;
  3738. animation-timing-function: ease-out;
  3739. animation-fill-mode: inherit;
  3740. animation-iteration-count: infinite;
  3741. animation-name: run-lamp;
  3742. animation-play-state: running;
  3743. }
  3744. @keyframes run-lamp {
  3745. 0%,
  3746. 100% {
  3747. opacity: 1;
  3748. transform: scale(1);
  3749. }
  3750. 50% {
  3751. opacity: 0.6;
  3752. transform: scale(0.9);
  3753. }
  3754. }
  3755. .personal-fruit-container {
  3756. position: absolute;
  3757. left: 0;
  3758. top: 0;
  3759. bottom: 0;
  3760. right: 0;
  3761. margin: auto;
  3762. display: flex;
  3763. align-items: center;
  3764. justify-content: center;
  3765. /* border: 1rpx solid #F0F0F0; */
  3766. }
  3767. .screen-jitter {
  3768. animation-duration: 1s;
  3769. animation-timing-function: ease-out;
  3770. animation-fill-mode: inherit;
  3771. animation-iteration-count: infinite;
  3772. animation-name: personal-shake;
  3773. animation-play-state: running;
  3774. }
  3775. .screen-red {
  3776. border: 1rpx solid #ff0000;
  3777. }
  3778. @keyframes personal-shake {
  3779. 0%,
  3780. 100% {
  3781. transform: translateX(0)
  3782. }
  3783. 10% {
  3784. transform: translateX(-9px)
  3785. }
  3786. 20% {
  3787. transform: translateX(8px)
  3788. }
  3789. 30% {
  3790. transform: translateX(-7px)
  3791. }
  3792. 40% {
  3793. transform: translateX(6px)
  3794. }
  3795. 50% {
  3796. transform: translateX(-5px)
  3797. }
  3798. 60% {
  3799. transform: translateX(4px)
  3800. }
  3801. 70% {
  3802. transform: translateX(-3px)
  3803. }
  3804. 80% {
  3805. transform: translateX(2px)
  3806. }
  3807. 90% {
  3808. transform: translateX(-1px)
  3809. }
  3810. }
  3811. .CountDownMask {
  3812. position: absolute;
  3813. top: 0;
  3814. bottom: 0;
  3815. right: 0;
  3816. left: 0;
  3817. background-color: rgba(0, 0, 0, 0.5);
  3818. z-index: 1000;
  3819. display: flex;
  3820. justify-content: center;
  3821. align-items: center;
  3822. font-size: 100px;
  3823. font-weight: bold;
  3824. color: #FFFFFF;
  3825. }
  3826. /**
  3827. * 任务样式
  3828. */
  3829. .task-up-button {
  3830. z-index: 10;
  3831. /* #ifndef APP-PLUS */
  3832. position: absolute;
  3833. /* #endif */
  3834. /* #ifdef APP-PLUS */
  3835. position: fixed;
  3836. /* #endif */
  3837. bottom: -53rpx;
  3838. right: 0;
  3839. left: 0;
  3840. margin: auto;
  3841. width: 100%;
  3842. height: 104rpx;
  3843. /* border: 1rpx solid #000000; */
  3844. }
  3845. .canvas-hidden {
  3846. /* display: none; */
  3847. left: -1000px;
  3848. }
  3849. .canvas-show {
  3850. /* display: block; */
  3851. }
  3852. </style>