personal.vue 113 KB

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