personal.vue 114 KB

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