personal.vue 105 KB

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