personal.vue 109 KB

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