personal.vue 109 KB

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