personal.vue 109 KB

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