personal.vue 112 KB

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