personal.vue 112 KB

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