personal.vue 108 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046
  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', '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.bRatio = true;
  1251. this.$store.state.cIndex = i;
  1252. }
  1253. if (eq.ename.indexOf("hotman") > -1 && this.BLEConnectDevice.id == 1) {
  1254. // if (this.$refs.boxingPostRef) {
  1255. // this.$refs.boxingPostRef.onSetMode('pkMode');
  1256. // } else {
  1257. // setTimeout(() => {
  1258. // this.$refs.boxingPostRef.onSetMode('pkMode');
  1259. // }, 500)
  1260. // }
  1261. } else if (eq.ename.indexOf("BLEHandle") > -1 && this.BLEConnectDevice.id == 2) {
  1262. if (this.$refs.boxingPostRef) {
  1263. this.$refs.boxingPostRef.onSetMode('calorieMode');
  1264. } else {
  1265. setTimeout(() => {
  1266. this.$refs.boxingPostRef.onSetMode('calorieMode');
  1267. }, 500)
  1268. }
  1269. } else if (eq.ename.indexOf("rope") > -1 && this.BLEConnectDevice.id == 3) {
  1270. //todo 暂时设置兼容跑步模式
  1271. // if (this.$refs.boxingPostRef) {
  1272. // this.$refs.boxingPostRef.onSetMode('ropeMode');
  1273. // } else {
  1274. // setTimeout(() => {
  1275. // this.$refs.boxingPostRef.onSetMode('ropeMode');
  1276. // }, 500)
  1277. // }
  1278. }
  1279. }
  1280. },
  1281. /**
  1282. * 蓝牙断开连接时候
  1283. */
  1284. callbackCloseBLE() {
  1285. // if (0 == this.currentModeIndex) {
  1286. // //蓝牙断开连接后,直接关闭
  1287. // this.$refs.boxingPostRef.onCloseDevices();
  1288. // }
  1289. },
  1290. //蓝牙状态回调
  1291. callbackBLEState(res) {
  1292. console.log("callbackBLEState==", res);
  1293. if (this.cState != res.state) this.cState = res.state;
  1294. },
  1295. //设备回调事件
  1296. callbackUpdateBLEData(data) {
  1297. //如果在监听状态时候隐藏页面,返回
  1298. if (_self.bHide) return;
  1299. //连接了手柄模式
  1300. //没有开启指令不刷新
  1301. if (!this.instructionState.bOpen) return;
  1302. if (this.BLEConnectDevice.usageMode == "hotman") {
  1303. this.gUpdateSandbagAlgorithm({
  1304. data: data,
  1305. callback: (res) => {
  1306. if (res.type == 'hit') {
  1307. this.$refs.actionHitRef.onBLEHitUpdate(res);
  1308. }
  1309. }
  1310. });
  1311. } else if (this.BLEConnectDevice.usageMode == "general") {
  1312. //这个是普通打击模式
  1313. this.$refs.boxingPostRef.onBLEHandleUpdate(data);
  1314. } else if (this.BLEConnectDevice.usageMode == "ropeSkipping") {
  1315. this.$refs.actionJumpRef.onBLERopeUpdate(data);
  1316. }
  1317. },
  1318. /**
  1319. * 检测获取匹配的设备
  1320. */
  1321. onGetBondDevice() {
  1322. /**
  1323. * 假如手机没有匹配,断开连接
  1324. */
  1325. console.log("****", this.BLEConnectDevice);
  1326. if (!this.BLEConnectDevice) return;
  1327. this.B_GetBondedDevices({
  1328. deviceId: this.BLEConnectDevice.deviceId,
  1329. success: (bondedDevice) => {
  1330. // console.error("===========", bondedDevice);
  1331. // uni.hideToast();
  1332. if (bondedDevice == null) {
  1333. // if (plus.os.name == 'Android')
  1334. {
  1335. //此问题 华为手机容易出现
  1336. //android手机已配对的设备 不存在,但是app 又直接连接成功了。提示,并且断开app连接
  1337. //1.关闭当前连接
  1338. this.onCloseBLEConnection({
  1339. getSuccess: () => {}
  1340. });
  1341. uni.hideToast();
  1342. //2.跳转蓝牙设置
  1343. uni.showModal({
  1344. title: '蓝牙配对失败',
  1345. content: '请跳转后点击配对BGBox_2020,成功后手动跳转回哔蹦重新连接。',
  1346. success: (res) => {
  1347. if (res.confirm) {
  1348. this.B_OpenBLESetting();
  1349. }
  1350. }
  1351. })
  1352. }
  1353. }
  1354. }
  1355. });
  1356. },
  1357. openDeviceList(e) {
  1358. if (this.ConnectBindingDevice) {
  1359. uni.showToast({
  1360. title: '当前已开启数据',
  1361. icon: 'none',
  1362. mask: true
  1363. })
  1364. return;
  1365. }
  1366. //先判断蓝牙是否初始化
  1367. /**
  1368. * 蓝牙部分操作,转全局变量操作
  1369. * */
  1370. // console.log("openDeviceList bOpenBluetooth", this.bOpenBluetooth);
  1371. // #ifdef APP-PLUS
  1372. if (!this.bOpenBluetooth) {
  1373. this.initAdapter(() => {
  1374. uni.navigateTo({
  1375. // url: '../devices-category/devices-category',
  1376. url: '../devices-hardware/devices-hardware',
  1377. success: res => {
  1378. this.bLimitReconnection = true;
  1379. },
  1380. fail: () => {},
  1381. complete: () => {}
  1382. });
  1383. });
  1384. return;
  1385. }
  1386. // #endif
  1387. uni.navigateTo({
  1388. url: '../devices-hardware/devices-hardware',
  1389. success: res => {
  1390. this.bLimitReconnection = true;
  1391. },
  1392. fail: () => {},
  1393. complete: () => {}
  1394. });
  1395. },
  1396. onNavToMore() {
  1397. uni.navigateTo({
  1398. url: '../more/more?index=' + this.cIndex,
  1399. success: res => {},
  1400. fail: () => {},
  1401. complete: () => {}
  1402. });
  1403. },
  1404. onAddDevice() {
  1405. let deviceItem = {
  1406. name: '蹦床',
  1407. icon: '/static/trampoline.png'
  1408. };
  1409. if (this.deviceList.length != 0) {
  1410. this.deviceList = this.deviceList.concat(deviceItem);
  1411. } else {
  1412. this.deviceList = deviceItem;
  1413. }
  1414. },
  1415. onCloseDevice(item, e) {
  1416. //如果不是连接状态,则删除
  1417. if (e.currentTarget.dataset.index != this.cIndex) {
  1418. if (this.cIndex != -1) {
  1419. uni.showToast({
  1420. icon: 'none',
  1421. title: "请先断开已连接设备",
  1422. duration: 2000,
  1423. mask: true
  1424. })
  1425. return;
  1426. }
  1427. uni.showModal({
  1428. title: '设备状态',
  1429. content: '是否删除设备?',
  1430. ConfirmColor: '#A488DC',
  1431. success: res => {
  1432. if (res.confirm) {
  1433. this.$store.commit('deleteBLEDevice', e.currentTarget.dataset.index);
  1434. }
  1435. }
  1436. });
  1437. return;
  1438. }
  1439. uni.showModal({
  1440. title: '设备状态',
  1441. content: '是否断开连接?',
  1442. /**
  1443. * 如果需要强制,不显示取消按钮
  1444. */
  1445. showCancel: true,
  1446. ConfirmColor: '#A488DC',
  1447. success: res => {
  1448. if (res.confirm) {
  1449. this.onCloseBLEConnection({
  1450. getSuccess: () => {}
  1451. });
  1452. }
  1453. }
  1454. });
  1455. },
  1456. onNavDetail(item) {
  1457. console.log(item);
  1458. let temItem = encodeURIComponent(JSON.stringify(item));
  1459. // return;
  1460. uni.navigateTo({
  1461. url: '../../game-page/game-detail/game-detail?item=' + temItem
  1462. });
  1463. },
  1464. onNavToGameMore(e) {
  1465. uni.reLaunch({
  1466. url: '../../game-page/game/game?type=' + e.currentTarget.dataset.type
  1467. });
  1468. },
  1469. //判断是否有其他限制
  1470. onStartCheck(data) {
  1471. //#ifdef H5
  1472. // 直接走测试,如果是h5 APP-PLUS
  1473. if (0 === this.currentModeIndex) {
  1474. // this.onBoxingGuideFinish();
  1475. if (this.currentJumpTask == null) {
  1476. uni.showToast({
  1477. title: '先选一个挑战关卡',
  1478. icon: 'none',
  1479. duration: 2000,
  1480. })
  1481. return;
  1482. }
  1483. if (this.currentMode == 'pkMode' && this.finallySelectFriendInfo == null) {
  1484. uni.showToast({
  1485. title: '选择一个pk好友',
  1486. icon: 'none',
  1487. duration: 2000,
  1488. })
  1489. return;
  1490. }
  1491. //调用开始
  1492. this.onActionHitPlay();
  1493. } else if (1 === this.currentModeIndex) {
  1494. if (this.currentJumpTask == null) {
  1495. uni.showToast({
  1496. title: '先选一个挑战关卡',
  1497. icon: 'none',
  1498. duration: 2000,
  1499. })
  1500. return;
  1501. }
  1502. if (this.currentMode == 'pkMode' && this.finallySelectFriendInfo == null) {
  1503. uni.showToast({
  1504. title: '选择一个pk好友',
  1505. icon: 'none',
  1506. duration: 2000,
  1507. })
  1508. return;
  1509. }
  1510. //调用开始
  1511. this.onActionJumpPlay();
  1512. }
  1513. return;
  1514. //#endif
  1515. //跳和拳击进入
  1516. if (1 === this.currentModeIndex || 0 === this.currentModeIndex) {
  1517. //2.检测是否连接设备 || this.BLEConnectDevice.ename !== 'BT04'
  1518. if (this.cIndex == -1) {
  1519. this.onGetBluetoothConnectView({
  1520. hiddenType: 'none'
  1521. });
  1522. return;
  1523. }
  1524. }
  1525. //3.检测一下计划日期
  1526. console.log("remainingDays == >", this.planData, this.remainingDays);
  1527. if (date.formatDate(new Date()) > this.planData.endTime || this.remainingDays == 0) {
  1528. if (!this.$store.state.bPlanExpired) {
  1529. this.$store.state.bPlanExpired = true;
  1530. setTimeout(() => {
  1531. this.$store.state.bPlanExpired = false;
  1532. }, 3000)
  1533. uni.showModal({
  1534. title: '提醒',
  1535. content: '计划到期,请制定新计划。',
  1536. confirmText: '去制定',
  1537. success: (res) => {
  1538. if (res.confirm) {
  1539. uni.switchTab({
  1540. url: "../plan/plan"
  1541. })
  1542. }
  1543. }
  1544. })
  1545. }
  1546. return;
  1547. }
  1548. if (1 == this.currentModeIndex || 0 === this.currentModeIndex) {
  1549. if (data) {
  1550. let {
  1551. bStartCountDown
  1552. } = data;
  1553. this.bStartCountDown = bStartCountDown;
  1554. }
  1555. if (this.bStartCountDown) {
  1556. this.BoxingPostCountDownText = 3;
  1557. this.b_countDown = setInterval(() => {
  1558. if (this.BoxingPostCountDownText <= 1) {
  1559. if (this.b_countDown) {
  1560. clearInterval(this.b_countDown);
  1561. this.b_countDown = null;
  1562. }
  1563. setTimeout(() => {
  1564. this.personalAudioContext.stop();
  1565. this.personalAudioContext.play();
  1566. //倒计时结束后开始游戏
  1567. //初始化一个沙袋打击对象
  1568. if (this.BLEConnectDevice.usageMode == "hotman") {
  1569. this.gCreateSandbagAlgorithm();
  1570. }
  1571. if (this.BLEConnectDevice.usageMode == "ropeSkipping" ||
  1572. this.BLEConnectDevice.usageMode == "hotman") {
  1573. //打开跳绳模式
  1574. // this.B_OpenRopeSkipping();
  1575. this.onWriteBLEConnectionValue({
  1576. value: "3"
  1577. });
  1578. }
  1579. //监听蓝牙回调
  1580. uni.$on('updateBLEDeviceData', this.callbackUpdateBLEData);
  1581. //调用开始
  1582. if (0 === this.currentModeIndex) {
  1583. //调用开始
  1584. this.onActionHitPlay();
  1585. } else if (1 === this.currentModeIndex) {
  1586. //调用开始
  1587. this.onActionJumpPlay();
  1588. }
  1589. this.bStartCountDown = false;
  1590. }, 800)
  1591. return;
  1592. }
  1593. this.BoxingPostCountDownText--;
  1594. }, 1000)
  1595. } else {
  1596. if (this.BLEConnectDevice.usageMode == "ropeSkipping" ||
  1597. this.BLEConnectDevice.usageMode == "hotman") {
  1598. //打开跳绳模式
  1599. // this.B_OpenRopeSkipping();
  1600. this.onWriteBLEConnectionValue({
  1601. value: "3"
  1602. });
  1603. }
  1604. //监听蓝牙回调
  1605. uni.$on('updateBLEDeviceData', this.callbackUpdateBLEData);
  1606. //调用开始
  1607. if (0 === this.currentModeIndex) {
  1608. //调用开始
  1609. this.onActionHitPlay();
  1610. } else if (1 === this.currentModeIndex) {
  1611. //调用开始
  1612. this.onActionJumpPlay();
  1613. }
  1614. }
  1615. }
  1616. },
  1617. onShowBoxingHitTip() {
  1618. this.$store.state.bGuidePages = true;
  1619. this.guideCurrent = 5;
  1620. this.toView = "boxingHitID";
  1621. this.$store.state.bNewGuide = false;
  1622. },
  1623. //检测是否符合要求,没有的话进行新手提示
  1624. onPersonalCheck(data) {
  1625. if (!this.bShowComplete) {
  1626. console.log('不要点击这么快!!');
  1627. return;
  1628. } else {
  1629. console.error('点击!!');
  1630. }
  1631. this.bShowComplete = false;
  1632. // #ifdef APP-PLUS
  1633. if (1 === this.currentModeIndex || 0 === this.currentModeIndex) {
  1634. if (this.currentJumpTask == null) {
  1635. this.onTipLevel({
  1636. hiddenType: 'normal'
  1637. });
  1638. if (this.guideUnlockState.firstPromptSelectLevel) {
  1639. // this.onTipLevel();
  1640. let guideUnlockState = Object.assign(this.guideUnlockState, {
  1641. firstPromptSelectLevel: false
  1642. });
  1643. this.setGuideUnlockState(guideUnlockState);
  1644. }
  1645. this.bShowComplete = true;
  1646. return;
  1647. }
  1648. if (this.currentMode == 'pkMode' && this.finallySelectFriendInfo == null) {
  1649. //todo 这里没处理 新手提示
  1650. uni.showToast({
  1651. title: '选择一个pk好友',
  1652. icon: 'none',
  1653. duration: 2000,
  1654. })
  1655. this.bShowComplete = true;
  1656. return;
  1657. }
  1658. if (1 === this.currentModeIndex) {
  1659. let _item = this.currentJumpTask.item;
  1660. //第一次选择关卡时候判断
  1661. if (this.guideUnlockState.firstUnlockJumpUp && _item.id == 1) {
  1662. this.showGuide('level-game-tip', {
  1663. levelType: 'midJump',
  1664. hiddenType: 'firstUnlockJumpUp'
  1665. })
  1666. let guideUnlockState = Object.assign(this.guideUnlockState, {
  1667. firstUnlockJumpUp: false
  1668. });
  1669. this.setGuideUnlockState(guideUnlockState);
  1670. return;
  1671. } else if (this.guideUnlockState.firstUnlockLeftAndRightJump && _item.id == 6) {
  1672. this.showGuide('level-game-tip', {
  1673. levelType: 'directionJump',
  1674. hiddenType: 'firstUnlockLeftAndRightJump'
  1675. })
  1676. let guideUnlockState = Object.assign(this.guideUnlockState, {
  1677. firstUnlockLeftAndRightJump: false
  1678. });
  1679. this.setGuideUnlockState(guideUnlockState);
  1680. return;
  1681. } else if (this.guideUnlockState.firstUnlockLeftAndRightRotationJump && _item.id == 9) {
  1682. this.showGuide('level-game-tip', {
  1683. levelType: 'rotationJump',
  1684. hiddenType: 'firstUnlockLeftAndRightRotationJump'
  1685. })
  1686. let guideUnlockState = Object.assign(this.guideUnlockState, {
  1687. firstUnlockLeftAndRightRotationJump: false
  1688. });
  1689. this.setGuideUnlockState(guideUnlockState);
  1690. return;
  1691. }
  1692. }
  1693. }
  1694. // #endif
  1695. //如果上面没有guide弹出
  1696. this.bShowComplete = true;
  1697. this.onStartCheck(data);
  1698. },
  1699. //
  1700. onBoxingGuideFinish() {
  1701. if (this.b_countDown) {
  1702. clearInterval(this.b_countDown);
  1703. this.b_countDown = null;
  1704. }
  1705. //|| this.currentMode == 'ropeMode'
  1706. if (this.currentMode == 'calorieMode') {
  1707. this.personalAudioContext.stop();
  1708. this.personalAudioContext.play();
  1709. setTimeout(() => {
  1710. this.$refs.boxingPostRef.onBoxingPostPlay(true);
  1711. }, 600);
  1712. } else {
  1713. this.BoxingPostCountDownText = 3;
  1714. this.$refs.boxingPostRef.onSetRingAnimation(true);
  1715. uni.showToast({
  1716. title: '匹配中...',
  1717. mask: true,
  1718. icon: 'loading',
  1719. duration: 2000
  1720. })
  1721. setTimeout(() => {
  1722. //ai信息
  1723. this.onGetAiRandom();
  1724. // this.b_countDown = setInterval(() => {
  1725. // if (this.BoxingPostCountDownText <= 1) {
  1726. // if (this.b_countDown) {
  1727. // clearInterval(this.b_countDown);
  1728. // this.b_countDown = null;
  1729. // }
  1730. // setTimeout(() => {
  1731. // this.personalAudioContext.stop();
  1732. // this.personalAudioContext.play();
  1733. // this.$refs.boxingPostRef.onBoxingPostPlay(true);
  1734. // this.$refs.boxingPostRef.onSetRingAnimation(false);
  1735. // uni.hideToast();
  1736. // }, 800)
  1737. // }
  1738. // this.BoxingPostCountDownText--;
  1739. // }, 1000)
  1740. setTimeout(() => {
  1741. this.personalAudioContext.stop();
  1742. this.personalAudioContext.play();
  1743. this.$refs.boxingPostRef.onBoxingPostPlay(true);
  1744. this.$refs.boxingPostRef.onSetRingAnimation(false);
  1745. uni.hideToast();
  1746. }, 800)
  1747. }, 2000);
  1748. }
  1749. },
  1750. //运动时间
  1751. onUpdateSportTime(res) {
  1752. // console.log("同步的运动时间",res);
  1753. this.setLocalSportTime(res);
  1754. },
  1755. //更新运动数据
  1756. onUpdateCaloriePlane(data) {
  1757. // 记录卡路里到本地
  1758. this.addlocalCalorie(data);
  1759. this.updateArcbarData();
  1760. },
  1761. onRoundTrigger(data) {
  1762. // console.log("onRoundTrigger==", data);
  1763. // return;
  1764. let url = '';
  1765. switch (data.item.type) {
  1766. case "personal":
  1767. //个人中心页面
  1768. url = '../../personal-page/personal/personal';
  1769. break;
  1770. case "game":
  1771. url = '../../game-page/game/game';
  1772. break;
  1773. default:
  1774. url = '../../personal-page/personal/personal';
  1775. break;
  1776. }
  1777. uni.reLaunch({
  1778. url: url,
  1779. success: res => {},
  1780. fail: () => {},
  1781. complete: () => {}
  1782. });
  1783. },
  1784. /**
  1785. * 同步本地数据到服务器
  1786. */
  1787. onSyncData() {
  1788. this.syncRequestEvent({
  1789. success: () => {
  1790. this.updateArcbarData();
  1791. }
  1792. });
  1793. // 更新显示日期
  1794. this.originalDate = new Date();
  1795. this.currentDate = date.formatTime(this.originalDate);
  1796. },
  1797. hidePlanTipModal() {
  1798. this.modalName = null;
  1799. if (this.planTipIndex === 1) {
  1800. // 您今天的目标还没完成 是否结束训练
  1801. this.onActionPause(false);
  1802. }
  1803. },
  1804. confirmPlanTipModal() {
  1805. this.modalName = null;
  1806. if (this.planTipIndex === 0) {
  1807. this.onStartCheck()
  1808. } else if (this.planTipIndex === 1) {
  1809. // 您今天的目标还没完成 是否结束训练
  1810. this.onActionPause(true);
  1811. }
  1812. },
  1813. //断开连接时候,关闭
  1814. onCloseBoxingHit() {
  1815. console.log('关闭训练');
  1816. if (this.currentMode == 'pkMode') {
  1817. this.$refs.hitEffectRef.onStop();
  1818. }
  1819. this.onActionPause(true);
  1820. },
  1821. //点击暂停时候,判断一下是否完成目标
  1822. onActionControlPlay(bPlay) {
  1823. if (!bPlay) {
  1824. //跳模块的情况下,暂停计时器
  1825. if (1 == this.currentModeIndex || 0 == this.currentModeIndex)
  1826. this.arcbarCountDownTimeReset();
  1827. if (this.planData.allCalorie < this.planData.calorie) {
  1828. this.modalName = 'showPlanTipModal';
  1829. this.planTipIndex = 1;
  1830. } else {
  1831. //假如完成了目标,更新卡路里
  1832. this.onActionPause(true);
  1833. }
  1834. }
  1835. },
  1836. /**
  1837. * 切换体验模式
  1838. * @param {Object} data
  1839. */
  1840. onModeEvent(data) {
  1841. console.log("当前模式:", data);
  1842. this.currentMode = data.mode;
  1843. this.title = data.name;
  1844. // || this.currentMode == 'ropeMode'
  1845. if (this.currentMode == 'calorieMode') {
  1846. setTimeout(() => {
  1847. this.updateNoLimit();
  1848. }, 0)
  1849. }
  1850. },
  1851. onAiHitEvent(bloodPoint) {
  1852. // this.onPlay({
  1853. // bloodPoint: num,
  1854. // createType: 'red',
  1855. // callback: (res) => {
  1856. // console.log("红色拳头击中对方:", res);
  1857. // }
  1858. // });
  1859. this.$refs.hitFistRef.onPlay({
  1860. bloodPoint: bloodPoint,
  1861. createType: 'red',
  1862. callback: () => {
  1863. if (this.bAiHitShake) return;
  1864. this.bAiHitShake = true;
  1865. this.$refs.aiHitEffectRef.onPlay();
  1866. this.$refs.aiHitEffectRef.onAIHit();
  1867. setTimeout(() => {
  1868. this.bAiHitShake = false;
  1869. }, 500)
  1870. }
  1871. });
  1872. },
  1873. //打击时候头像修改
  1874. onHitEvent(bloodPoint) {
  1875. // console.log("this.bHitShake:",this.bHitShake);
  1876. this.$refs.hitFistRef.onPlay({
  1877. bloodPoint: bloodPoint,
  1878. createType: 'blue',
  1879. callback: () => {
  1880. if (this.bHitShake) return;
  1881. this.bHitShake = true;
  1882. this.$refs.hitEffectRef.onPlay();
  1883. this.$refs.hitEffectRef.onMyHit();
  1884. setTimeout(() => {
  1885. this.bHitShake = false;
  1886. }, 500)
  1887. }
  1888. }
  1889. );
  1890. },
  1891. //弹出目标提示后,进行下一步
  1892. onActionPause(bFinish) {
  1893. if (bFinish) {
  1894. if (this.ConnectBindingDevice) {
  1895. this.gStopSimulateBLEUpdate();
  1896. uni.$off('updateBLEDeviceData', this.callbackUpdateBLEData);
  1897. } else {
  1898. if (0 === this.currentModeIndex) {
  1899. if (this.currentMode == "calorieMode") {
  1900. this.$refs.actionHitRef.onGameOver("none");
  1901. } else {
  1902. this.$refs.actionHitRef.onPKModeGameOver("none");
  1903. }
  1904. } else if (1 === this.currentModeIndex) {
  1905. //todo actionJump
  1906. if (this.currentMode == "calorieMode") {
  1907. this.$refs.actionJumpRef.onGameOver("none");
  1908. } else {
  1909. this.$refs.actionJumpRef.onPKModeGameOver("none");
  1910. }
  1911. }
  1912. }
  1913. if (1 === this.currentModeIndex) {
  1914. if (this.currentMode == "calorieMode") {
  1915. this.syncRequestEvent({
  1916. success: () => {
  1917. this.updateArcbarData();
  1918. }
  1919. });
  1920. }
  1921. } else {
  1922. this.syncRequestEvent({
  1923. success: () => {
  1924. this.updateArcbarData();
  1925. }
  1926. });
  1927. }
  1928. } else {
  1929. //如果不是,继续调用播放
  1930. if (0 === this.currentModeIndex) {
  1931. // this.$refs.boxingPostRef.onBoxingPostPlay(true);
  1932. this.$refs.actionHitRef.onContinueGame();
  1933. if (0 !== this.currentJumpTask.item.limitTime) {
  1934. //0默认不限时,所以限时的才走计时间
  1935. this.arcbarCountDownPlay(false);
  1936. }
  1937. } else if (1 === this.currentModeIndex) {
  1938. //actionJump
  1939. this.$refs.actionJumpRef.onContinueGame();
  1940. if (0 !== this.currentJumpTask.item.limitTime) {
  1941. //0默认不限时,所以限时的才走计时间
  1942. this.arcbarCountDownPlay(false);
  1943. }
  1944. }
  1945. }
  1946. },
  1947. guideHide(e) {
  1948. this.$store.state.bGuidePages = false;
  1949. if (e.current == 0 && !e.onlyHide) {
  1950. //跳转计划页面
  1951. this.openPlan();
  1952. } else if (e.current == 1 && !e.onlyHide) {
  1953. console.log('guideHide:', e.current);
  1954. //跳转搜索设备页面
  1955. // this.openDeviceList();
  1956. } else if (e.current == 3 && !e.onlyHide) {
  1957. // 跳转连接蓝牙页面
  1958. this.openDeviceList();
  1959. } else if (e.current == 5 && !e.onlyHide) {
  1960. console.log("==:", e);
  1961. //todo 跳绳模式 新手引导
  1962. if (this.BLEConnectDevice.usageMode == "ropeSkipping") {
  1963. this.B_OpenRopeSkipping();
  1964. } else {
  1965. //初始化filter快速打击对象
  1966. if (this.BLEConnectDevice.usageMode == "hotman") {
  1967. this.gCreateFilterObj();
  1968. }
  1969. //打开加速计
  1970. this.onWriteBLEConnectionValue({
  1971. value: "3"
  1972. });
  1973. // setTimeout(() => {
  1974. // //设置加速计b:20ms a:10ms
  1975. // this.onWriteBLEConnectionValue({
  1976. // value: config.refreshRate
  1977. // });
  1978. // }, 1000)
  1979. }
  1980. //监听蓝牙回调
  1981. uni.$on('updateBLEDeviceData', this.callbackUpdateBLEData);
  1982. this.onBoxingGuideFinish();
  1983. }
  1984. },
  1985. mainScroll(e) {
  1986. if (_self.toView == "boxingHitID") {
  1987. _self.toView = "";
  1988. // let view = uni.createSelectorQuery().select('#boxingHitID');
  1989. // view.boundingClientRect(data => {
  1990. // _self.$refs.codeElfGuide.setModalObj(data);
  1991. // console.log(data);
  1992. // }).exec();
  1993. } else if (_self.toView == "openAccGyroView") {
  1994. _self.toView = "";
  1995. }
  1996. },
  1997. onGetActionJumpView() {
  1998. this.$nextTick(() => {
  1999. this.toView = "actionJumpID"
  2000. });
  2001. this.toView = '' //不清空再次跳到锚点位置会不起作用
  2002. setTimeout(() => {
  2003. _self.$refs.actionJumpRef.onGetActionJumpPlayView((data) => {
  2004. console.log(JSON.stringify(data));
  2005. // #ifdef APP-PLUS
  2006. _self.showGuide('actionJumpPlay', data);
  2007. // #endif
  2008. });
  2009. }, 200)
  2010. },
  2011. onGetBluetoothConnectView(initData) {
  2012. _self.$refs.roundFabRef.onGetRoundFabView((data) => {
  2013. console.log(JSON.stringify(data), initData.firstInstallation);
  2014. // #ifdef APP-PLUS
  2015. let temp = Object.assign({}, data, initData);
  2016. console.log('当前的temp:', temp);
  2017. _self.showGuide('bluetoothConnect', temp);
  2018. // #endif
  2019. });
  2020. // let view = uni.createSelectorQuery().select('#roundFabID');
  2021. // view.boundingClientRect(data => {
  2022. // console.log(JSON.stringify(data));
  2023. // // #ifdef APP-PLUS
  2024. // _self.showGuide('bluetoothConnect', data);
  2025. // // #endif
  2026. // }).exec();
  2027. },
  2028. //拳击模块的回调
  2029. boxingUpdateCalorie(calorie) {
  2030. if (this.currentMode != 'pkMode') {
  2031. //这里调用一下设置可以播放音效
  2032. this.$refs.personalFruitRef.onCanPlay();
  2033. }
  2034. this.onUpdateCaloriePlane(calorie);
  2035. },
  2036. //扫码添加设备
  2037. openQRCode(callback) {
  2038. let that = this;
  2039. // 允许从相机和相册扫码
  2040. uni.scanCode({
  2041. success: function(res) {
  2042. // console.log('条码类型:' + res.scanType);
  2043. // console.log('条码内容:' + res.result);
  2044. let obj = JSON.parse(res.result)
  2045. let data = {
  2046. type: obj.type,
  2047. uuid: obj.uuid,
  2048. }
  2049. }
  2050. });
  2051. },
  2052. //屏幕抖动
  2053. onScreenShake() {
  2054. this.bEFHitShake = true;
  2055. setTimeout(() => {
  2056. this.bEFHitShake = false;
  2057. }, 500)
  2058. },
  2059. onGetAiRandom() {
  2060. let _self = this;
  2061. let avatarlist = AvatarConfig.getAvatarList().avatarList;
  2062. let _length = avatarlist.length;
  2063. let _index = Math.floor(Math.random() * _length);
  2064. console.log(avatarlist);
  2065. _self.aiObj.name = avatarlist[_index].name;
  2066. _self.aiObj.avatar = avatarlist[_index].url;
  2067. },
  2068. onBoxingGameOver(res) {
  2069. this.$refs.hitEffectRef.onStop();
  2070. this.onActionPause(true);
  2071. //拳击柱部分
  2072. uni.$off('updateBLEDeviceData', this.callbackUpdateBLEData);
  2073. let _title = res.myWin ? "胜利" : "失败";
  2074. let _context = res.myWin ? "你已经赢得PK胜利!" : "你在PK中被打败了!";
  2075. this.modalName = "showModalTip"
  2076. this.$refs.modalTipRef.setShowData({
  2077. title: _title,
  2078. context: _context,
  2079. operationItem: null
  2080. });
  2081. },
  2082. onModalTipHide() {
  2083. this.modalName = null;
  2084. },
  2085. onModalTipConfirm(data) {
  2086. let {
  2087. type,
  2088. operationItem
  2089. } = data;
  2090. this.modalName = null;
  2091. //再来一局
  2092. //提示过关奖励
  2093. console.log('onModalTipConfirm', type, operationItem);
  2094. if (type == 'PASSTHELEVEL') {
  2095. this.showPopup('levelReward', operationItem);
  2096. }
  2097. },
  2098. onTestShare() {
  2099. uni.share({
  2100. provider: "weixin",
  2101. scene: "WXSenceTimeline",
  2102. type: 2,
  2103. imageUrl: "https://img-cdn-qiniu.dcloud.net.cn/uniapp/images/uni@2x.png",
  2104. success: function(res) {
  2105. console.log("success:" + JSON.stringify(res));
  2106. },
  2107. fail: function(err) {
  2108. console.log("fail:" + JSON.stringify(err));
  2109. }
  2110. });
  2111. },
  2112. openAcc() {
  2113. if (!this.globalAcc) {
  2114. AccAndOri.bindAcc((accId) => {
  2115. this.$store.state.globalAcc = accId;
  2116. console.log("初始化:globalAcc=", this.globalAcc);
  2117. });
  2118. }
  2119. if (!this.globalOri) {
  2120. AccAndOri.bindOri((oriId) => {
  2121. this.$store.state.globalOri = oriId;
  2122. console.log("初始化:globalOri=", this.globalOri);
  2123. });
  2124. }
  2125. },
  2126. closeAcc() {
  2127. AccAndOri.unBindAcc(this.globalAcc);
  2128. this.$store.state.globalAcc = null;
  2129. AccAndOri.unBindOri(this.globalOri);
  2130. this.$store.state.globalOri = null;
  2131. },
  2132. outGyro(o) {
  2133. console.log("Orientation\nAlpha:" + o.alpha + "\nBeta:" + o.beta + "\nGamma:" + o.gamma);
  2134. },
  2135. openGyro() {
  2136. if (!this.globalOri) {
  2137. AccAndOri.bindOri((oriId) => {
  2138. this.$store.state.globalOri = oriId;
  2139. console.log("初始化:globalOri=", this.globalOri);
  2140. });
  2141. }
  2142. uni.$on('watchOrientation', this.outGyro);
  2143. },
  2144. stopGyro() {
  2145. uni.$off('watchOrientation', this.outGyro);
  2146. AccAndOri.unBindOri(this.globalOri);
  2147. this.$store.state.globalOri = null;
  2148. },
  2149. onKeyInput: function(event) {
  2150. this.$store.state.LocationGameUrl = event.target.value
  2151. },
  2152. onNavFcGame() {
  2153. // console.log(0);
  2154. uni.navigateTo({
  2155. url: "../../fc-page/fc/fc"
  2156. })
  2157. },
  2158. onNavAppInfo() {
  2159. uni.navigateTo({
  2160. url: '../../info-page/app-info/app-info'
  2161. })
  2162. },
  2163. onNavToSelectFriend() {
  2164. uni.navigateTo({
  2165. url: '../../friend-page/select/select'
  2166. })
  2167. },
  2168. /**
  2169. * 悬停按钮
  2170. */
  2171. fabClick() {
  2172. //如果第一次点击悬停按钮
  2173. if (this.cIndex != -1 && this.BLEConnectDevice != null) {
  2174. //先检测
  2175. uni.showModal({
  2176. title: '设备状态',
  2177. content: '是否断开连接?',
  2178. /**
  2179. * 如果需要强制,不显示取消按钮
  2180. */
  2181. showCancel: true,
  2182. ConfirmColor: '#A488DC',
  2183. success: res => {
  2184. if (res.confirm) {
  2185. this.onCloseBLEConnection({
  2186. getSuccess: () => {}
  2187. });
  2188. }
  2189. }
  2190. });
  2191. } else {
  2192. this.openDeviceList();
  2193. }
  2194. },
  2195. /**
  2196. * action 模块相关数据更新,实时更新
  2197. */
  2198. onActionJumpDataUpdate(obj) {
  2199. // console.log(obj);
  2200. this.AJData.allCount = obj.eliminationCount + obj.faultCount;
  2201. this.AJData.faultCount = obj.faultCount;
  2202. //如果pk模式下,区分两个人的分数
  2203. if (this.currentMode == "pkMode") {
  2204. if (this.AJData.isLeftPlayer) {
  2205. this.AJData.myScore = obj.eliminationCount - obj.faultCount;
  2206. } else {
  2207. this.AJData.otherScore = obj.eliminationCount - obj.faultCount;
  2208. }
  2209. }
  2210. //调用
  2211. if (0 === this.currentModeIndex) {
  2212. //拳击柱
  2213. this.onAddSandbagHitCount();
  2214. }
  2215. // else if (1 === this.currentModeIndex) {
  2216. // //跳
  2217. // }
  2218. // console.log(this.AJData.myUsageTime, this.AJData.otherUsageTime);
  2219. },
  2220. onActionJumpCountDownUpdate(obj) {
  2221. // this.AJData.perCountDown = obj.countDown;
  2222. if (this.currentMode == "pkMode") {
  2223. if (this.AJData.isLeftPlayer) {
  2224. this.AJData.myUsageTime = this.AJData.gameLimitTime - this.AJData.gameCountDown;
  2225. } else {
  2226. this.AJData.otherUsageTime = this.AJData.gameLimitTime - this.AJData.gameCountDown;
  2227. }
  2228. }
  2229. // console.log(this.AJData.myUsageTime, this.AJData.otherUsageTime, this.AJData.gameLimitTime);
  2230. },
  2231. //actionJump 模块跳关卡开始处理
  2232. onActionJumpPlay() {
  2233. //开始时候,设置默认参数
  2234. if (this.AJData.isFinish) {
  2235. //如果下一局,重新设置一下默认参数
  2236. this.onResetDefaultActionJumpData();
  2237. }
  2238. this.onSetActionJumpData();
  2239. this.$refs.actionJumpRef.onActionJumpPlay();
  2240. this.bGamePlaying = true;
  2241. //todo 首先判断时间处理
  2242. if (0 !== this.currentJumpTask.item.limitTime) {
  2243. //0默认不限时,所以限时的才走计时间
  2244. this.arcbarCountDownPlay(true);
  2245. }
  2246. },
  2247. //actionHit 模块跳关卡开始处理
  2248. onActionHitPlay() {
  2249. //开始时候,设置默认参数
  2250. if (this.AJData.isFinish) {
  2251. //如果下一局,重新设置一下默认参数
  2252. this.onResetDefaultActionJumpData();
  2253. }
  2254. this.onSetActionJumpData();
  2255. this.$refs.actionHitRef.onActionPlay();
  2256. this.bGamePlaying = true;
  2257. //todo 首先判断时间处理
  2258. if (0 !== this.currentJumpTask.item.limitTime) {
  2259. //0默认不限时,所以限时的才走计时间
  2260. this.arcbarCountDownPlay(true);
  2261. }
  2262. },
  2263. //重置actionJump数据
  2264. onResetDefaultActionJumpData() {
  2265. this.AJData = Object.assign({}, this.defaultAJData);
  2266. },
  2267. onSetActionJumpData() {
  2268. let _item = this.currentJumpTask.item;
  2269. //这里set只是对应关卡的数据
  2270. this.AJData = Object.assign({}, this.AJData, {
  2271. allCount: 0,
  2272. faultCount: 0,
  2273. perCountDown: 0,
  2274. gameCountDown: 0,
  2275. gameLimitTime: _item.limitTime,
  2276. targetCount: _item.signCount,
  2277. })
  2278. // console.log('onSetActionJumpData'+JSON.stringify(this.AJData)+JSON.stringify(_item));
  2279. },
  2280. /**
  2281. * 游戏结束
  2282. * @param {Object} data
  2283. */
  2284. onActionJumpGameOver(data) {
  2285. let {
  2286. isOffEvent = false
  2287. } = data;
  2288. //游戏结束,重置时间
  2289. this.arcbarCountDownTimeReset();
  2290. //todo 可能区分 levelJump 关卡类型
  2291. if (this.currentMode == "pkMode") {
  2292. //pk模式下面
  2293. if (this.AJData.isLeftPlayer) {
  2294. //如果是左边的.切换下一个玩家
  2295. this.AJData.isLeftPlayer = false;
  2296. uni.showModal({
  2297. title: '切换下一个玩家',
  2298. showCancel: false,
  2299. success: (res) => {
  2300. if (res.confirm) {
  2301. //重新开始计算
  2302. if (0 === this.currentModeIndex) {
  2303. //调用开始
  2304. this.onActionHitPlay();
  2305. } else if (1 === this.currentModeIndex) {
  2306. //调用开始
  2307. this.onActionJumpPlay();
  2308. }
  2309. }
  2310. }
  2311. })
  2312. } else {
  2313. if (isOffEvent) {
  2314. //停止蓝牙加速计
  2315. this.onWriteBLEConnectionValue({
  2316. value: "4"
  2317. });
  2318. uni.$off('updateBLEDeviceData', this.callbackUpdateBLEData);
  2319. console.log('pkMode onActionJumpGameOver 任务结束');
  2320. this.bGamePlaying = false;
  2321. //同步到数据库
  2322. if (0 === this.currentModeIndex) {
  2323. //拳击柱
  2324. this.uploadUserData_hitCount();
  2325. }
  2326. }
  2327. this.AJData.isFinish = true;
  2328. //奖励赢的人 PKLEVELREWARD
  2329. let _item = this.currentJumpTask.item;
  2330. let _curFriend = this.finallySelectFriendInfo;
  2331. console.log('this.finallySelectFriendInfo:', this.finallySelectFriendInfo);
  2332. let isMyWin = true;
  2333. //如果是右边好友,即判断结束。计算胜负关系
  2334. if (this.AJData.myScore > this.AJData.otherScore) {
  2335. isMyWin = true;
  2336. //显示一个提示框
  2337. this.showPopup('pkFinish', {
  2338. name: this.userName,
  2339. url: this.avatarUrl,
  2340. score: this.AJData.myScore,
  2341. consumeTime: Math.abs(this.AJData.myUsageTime),
  2342. hit: this.AJData.allCount - this.AJData.faultCount,
  2343. miss: this.AJData.faultCount
  2344. });
  2345. // console.log({
  2346. // name: this.username,
  2347. // url: this.avatarUrl,
  2348. // score: this.AJData.myScore,
  2349. // consumeTime: Math.abs(this.AJData.myUsageTime),
  2350. // hit: this.AJData.allCount - this.AJData.faultCount,
  2351. // miss: this.AJData.faultCount
  2352. // });
  2353. } else {
  2354. // uni.showToast({
  2355. // title: '好友赢或者平局',
  2356. // duration: 2000
  2357. // })
  2358. isMyWin = false;
  2359. //显示一个提示框
  2360. this.showPopup('pkFinish', {
  2361. name: _curFriend.username,
  2362. url: _curFriend.avatarUrl,
  2363. score: this.AJData.otherScore,
  2364. consumeTime: this.AJData.otherUsageTime,
  2365. hit: this.AJData.allCount - this.AJData.faultCount,
  2366. miss: this.AJData.faultCount
  2367. });
  2368. }
  2369. reqUtil
  2370. .requestData(config.URL.PKLEVELREWARD, {
  2371. levelId: _item.id,
  2372. levelType: 1,
  2373. isMyWin: isMyWin,
  2374. friendId: _curFriend.friendId
  2375. })
  2376. .then(
  2377. res => {
  2378. if (res.code == 0) {
  2379. console.log('PKLEVELREWARD:' + JSON.stringify(res.data));
  2380. this.nextTaskCanUnlock = false;
  2381. for (let i = 0; i < this.currentTaskList.length; i++) {
  2382. if (this.currentTaskList[i].id == _item.id) {
  2383. this.currentTaskList[i].isPassed = true;
  2384. break;
  2385. }
  2386. }
  2387. if (isMyWin) {
  2388. //只有isMyWin的情况下才有这两个字段返回,更新本地金币和钻石
  2389. this.setGoldAndDiamond({
  2390. gold: res.data.gold,
  2391. diamond: res.data.diamond
  2392. });
  2393. }
  2394. }
  2395. },
  2396. e => {
  2397. console.log(e);
  2398. }
  2399. );
  2400. }
  2401. } else {
  2402. if (isOffEvent) {
  2403. //停止蓝牙加速计
  2404. this.onWriteBLEConnectionValue({
  2405. value: "4"
  2406. });
  2407. uni.$off('updateBLEDeviceData', this.callbackUpdateBLEData);
  2408. console.log('onActionJumpGameOver 任务结束');
  2409. this.bGamePlaying = false;
  2410. //同步到数据库
  2411. if (0 === this.currentModeIndex) {
  2412. //拳击柱
  2413. this.uploadUserData_hitCount();
  2414. }
  2415. }
  2416. this.AJData.isFinish = true;
  2417. if (data.myWin) {
  2418. //通过关卡,处理逻辑
  2419. let _item = this.currentJumpTask.item;
  2420. reqUtil
  2421. .requestData(config.URL.PASSTHELEVEL, {
  2422. levelId: _item.id,
  2423. levelType: 1,
  2424. })
  2425. .then(
  2426. res => {
  2427. if (res.code == 0) {
  2428. console.log('PASSTHELEVEL:' + JSON.stringify(res.data));
  2429. //处理 列表数据
  2430. this.nextTaskCanUnlock = false;
  2431. for (let i = 0; i < this.currentTaskList.length; i++) {
  2432. if (this.currentTaskList[i].id == _item.id) {
  2433. this.currentTaskList[i].isPassed = true;
  2434. break;
  2435. }
  2436. }
  2437. let _title = data.myWin ? "胜利" : "失败";
  2438. let _context = data.myWin ? "通关关卡成功!" : "通关关卡失败!";
  2439. this.modalName = "showModalTip"
  2440. if (0 !== res.data.rewardHonor.type || 0 !== res.data.rewardGold || 0 !== res.data
  2441. .rewardDiamond) {
  2442. //todo
  2443. this.$refs.modalTipRef.setShowData({
  2444. title: _title,
  2445. context: _context,
  2446. operationItem: res.data,
  2447. type: 'PASSTHELEVEL'
  2448. });
  2449. //存在任何奖励的情况下直接更新一下返回的金币和钻石数据
  2450. this.setGoldAndDiamond({
  2451. gold: res.data.gold,
  2452. diamond: res.data.diamond
  2453. });
  2454. } else {
  2455. //没有奖励数据
  2456. this.$refs.modalTipRef.setShowData({
  2457. title: _title,
  2458. context: _context,
  2459. operationItem: null,
  2460. type: 'none'
  2461. });
  2462. }
  2463. }
  2464. },
  2465. e => {
  2466. console.log(e);
  2467. }
  2468. );
  2469. }
  2470. }
  2471. },
  2472. showDrawer() {
  2473. this.showDrawerById();
  2474. },
  2475. showPopup(type, item) {
  2476. this.showPopupById({
  2477. type,
  2478. item
  2479. });
  2480. },
  2481. showGuide(type, item) {
  2482. this.showGuideById({
  2483. type,
  2484. item
  2485. });
  2486. },
  2487. /**
  2488. * 任务相关
  2489. */
  2490. selectTask(_index, _item) {
  2491. // console.log(JSON.stringify(_item));
  2492. if (_item.isUnlock) {
  2493. let _data = {
  2494. modeName: this.currentMode, //记录时候记录当前的mode
  2495. index: _index,
  2496. item: _item,
  2497. }
  2498. //记录临时选择的游戏关卡
  2499. this.tempSelectedLevel = _data;
  2500. } else {
  2501. let isCanUnlock = _index == 0 || (_index >= 1 && this.currentTaskList[_index - 1].isUnlock && this
  2502. .currentTaskList[_index - 1].isPassed) ? true : false;
  2503. if (!isCanUnlock) return;
  2504. this.showPopup('unlock', _item);
  2505. }
  2506. },
  2507. updateTaskScroll() {
  2508. /**
  2509. * 获取任务对象
  2510. */
  2511. this.getActionJumpTask();
  2512. //console.error('当前的任务对象===========:' + JSON.stringify(this.currentJumpTask.modeName) + '= '+this.currentMode);
  2513. if (this.currentJumpTask != null && this.currentJumpTask.modeName == this.currentMode) {
  2514. let _index = this.currentJumpTask.index - 1 < 0 ? 0 : this.currentJumpTask.index - 1;
  2515. this.$nextTick(() => {
  2516. this.taskIntoView = "task_" + _index;
  2517. });
  2518. this.taskIntoView = '' //不清空再次跳到锚点位置会不起作用
  2519. }
  2520. },
  2521. switchTaskInfo() {
  2522. if (this.currentMode == 'calorieMode') {
  2523. this.currentTaskList = this.singlePersonList;
  2524. } else if (this.currentMode == 'pkMode') {
  2525. this.currentTaskList = this.multiPersonList;
  2526. }
  2527. },
  2528. onSwitchMode() {
  2529. if (this.currentMode == 'calorieMode') {
  2530. this.currentMode = 'pkMode';
  2531. } else if (this.currentMode == 'pkMode') {
  2532. this.currentMode = 'calorieMode';
  2533. }
  2534. this.switchTaskInfo();
  2535. },
  2536. /**
  2537. * 处理监听数据,比如切换列表后,重置action jump an action hit 等操作;
  2538. */
  2539. onSwitchTaskList() {
  2540. if (this.currentModeIndex != this.oldModeIndex) {
  2541. this.oldModeIndex = this.currentModeIndex;
  2542. this.tempSelectedLevel = null;
  2543. //清空当前选择的任务
  2544. this.resetActionJumpTask();
  2545. this.currentMode = 'calorieMode';
  2546. }
  2547. this.switchTaskInfo();
  2548. console.log("onSwitchTaskList");
  2549. //切换时候,清空当前的任务进度
  2550. this.arcbarCountDownTimeReset();
  2551. this.bGamePlaying = false;
  2552. this.$nextTick(() => {
  2553. if (0 === this.currentModeIndex) {
  2554. this.$refs.actionHitRef.onStopAndClearAction(true);
  2555. //用于刷新 drawBg
  2556. // this.$refs.actionHitRef.onDrawBg(true);
  2557. } else if (1 === this.currentModeIndex) {
  2558. this.$refs.actionJumpRef.onStopAndClearAction(true);
  2559. // this.$refs.actionJumpRef.onDrawBg(true);
  2560. }
  2561. })
  2562. },
  2563. /**
  2564. * @deprecated Test 测试通过关卡
  2565. */
  2566. onPassTheLevel() {
  2567. if (this.currentMode == "pkMode") {
  2568. this.AJData.myScore = 10;
  2569. this.AJData.isLeftPlayer = false;
  2570. }
  2571. this.onActionJumpGameOver({
  2572. myWin: true
  2573. });
  2574. },
  2575. //确认时候选择按钮
  2576. onConfirmSelectionLevel() {
  2577. if (this.tempSelectedLevel == null) {
  2578. uni.showToast({
  2579. icon: 'none',
  2580. title: '先选择一个挑战关卡',
  2581. mask: true
  2582. })
  2583. return;
  2584. }
  2585. //点击确认时候,记录关卡,并且开始游戏
  2586. this.setActionJumpTask(this.tempSelectedLevel);
  2587. this.hideModal();
  2588. setTimeout(() => {
  2589. // 自动调用开始游戏
  2590. this.onPersonalCheck({
  2591. bStartCountDown: true
  2592. });
  2593. }, 300);
  2594. },
  2595. registerPopupEvent() {
  2596. // 接收 popup 的消息
  2597. uni.$on('reward-popup-page', (data) => {
  2598. switch (data.type) {
  2599. case 'interactive':
  2600. uni.showModal({
  2601. title: '来自Popup的消息',
  2602. content: data.info
  2603. })
  2604. break;
  2605. case 'button':
  2606. if (data.messageType == 'prompt') {
  2607. if (data.confirm) {
  2608. console.log('prompt confirm!');
  2609. } else if (data.cancel) {
  2610. }
  2611. } else if (data.messageType == 'unlock') {
  2612. if (data.confirm) {
  2613. let _operationItem = data.operationItem;
  2614. console.log('unlock confirm!', _operationItem);
  2615. uni.showToast({
  2616. title: '正在解锁',
  2617. icon: 'loading',
  2618. duration: 10000
  2619. })
  2620. //todo 处理解锁流程
  2621. reqUtil
  2622. .requestData(config.URL.UNLOCKLEVEL, {
  2623. levelId: _operationItem.id,
  2624. levelType: 1, //levelJump = 1
  2625. numberType: _operationItem.numberType,
  2626. })
  2627. .then(
  2628. res => {
  2629. uni.hideToast();
  2630. console.log('UNLOCKLEVEL:' + JSON.stringify(res));
  2631. if (res.code === 404) {
  2632. uni.showToast({
  2633. title: '金币不足',
  2634. icon: 'none',
  2635. duration: 1000
  2636. })
  2637. } else if (res.code === 405) {
  2638. uni.showToast({
  2639. title: '钻石不足',
  2640. icon: 'none',
  2641. duration: 1000
  2642. })
  2643. } else if (res.code === 0) {
  2644. //解锁成功
  2645. uni.showToast({
  2646. title: '解锁成功',
  2647. icon: 'none',
  2648. duration: 1000
  2649. })
  2650. //更新本地金币和钻石
  2651. this.setGoldAndDiamond({
  2652. gold: res.data.gold,
  2653. diamond: res.data.diamond
  2654. });
  2655. for (let i = 0; i < this.currentTaskList.length; i++) {
  2656. if (this.currentTaskList[i].id == _operationItem.id) {
  2657. this.currentTaskList[i].isUnlock = true;
  2658. break;
  2659. }
  2660. }
  2661. } else if (res.code === 803) {
  2662. if (res.data.length > 0) {
  2663. uni.showToast({
  2664. title: '需要' + res.data[0].explain,
  2665. icon: 'none',
  2666. duration: 2000
  2667. })
  2668. } else {
  2669. uni.showToast({
  2670. title: '关卡条件关联未设置',
  2671. icon: 'none',
  2672. duration: 2000
  2673. })
  2674. }
  2675. } else if (res.code === 802 || res.code === 805) {
  2676. uni.showToast({
  2677. title: res.msg,
  2678. icon: 'none',
  2679. duration: 2000
  2680. })
  2681. }
  2682. },
  2683. e => {
  2684. console.log(e);
  2685. }
  2686. );
  2687. }
  2688. } else if (data.messageType == 'signIn') {
  2689. this.onUserSignIn();
  2690. }
  2691. break;
  2692. default:
  2693. uni.showToast({
  2694. title: data.title,
  2695. })
  2696. break;
  2697. }
  2698. })
  2699. // 监听 drawer 消息
  2700. uni.$on('drawer-page', (data) => {
  2701. uni.showToast({
  2702. title: '点击了第' + data + '项',
  2703. icon: "none"
  2704. });
  2705. })
  2706. uni.$on('guide-popup-page', (data) => {
  2707. console.log('guide-popup-page', JSON.stringify(data));
  2708. setTimeout(() => {
  2709. this.bShowComplete = true;
  2710. console.log('this.bShowComplete', this.bShowComplete);
  2711. }, 250);
  2712. switch (data.type) {
  2713. case 'button':
  2714. if (data.messageType == 'plan') {
  2715. if (data.confirm) {
  2716. //首次安装
  2717. if (data.hiddenType == 'firstInstallation') {
  2718. //跳转提示连接手柄蓝牙
  2719. setTimeout(() => {
  2720. this.onGetBluetoothConnectView({
  2721. hiddenType: 'firstInstallation'
  2722. });
  2723. }, 60)
  2724. console.log('提示连接手柄')
  2725. }
  2726. }
  2727. } else if (data.messageType == 'bluetoothConnect') {
  2728. if (data.confirm) {
  2729. //跳转播放
  2730. // this.onGetActionJumpView();
  2731. //首次安装
  2732. if (data.hiddenType == 'firstInstallation') {
  2733. setTimeout(() => {
  2734. // this.showGuide('device-tip', {
  2735. // hiddenType: 'firstInstallation'
  2736. // });
  2737. this.showGuide('level-button-tip', {
  2738. hiddenType: 'firstInstallation'
  2739. });
  2740. console.log('提示连接关卡')
  2741. }, 60)
  2742. } else if (data.hiddenType == 'firstDisconnectBluetooth') {
  2743. this.fabClick();
  2744. }
  2745. }
  2746. } else if (data.messageType == 'actionJumpPlay') {
  2747. if (data.confirm) {
  2748. }
  2749. } else if (data.messageType == 'device-tip') {
  2750. if (data.confirm) {
  2751. if (data.hiddenType == 'firstInstallation') {
  2752. setTimeout(() => {
  2753. this.showGuide('level-button-tip', {
  2754. hiddenType: 'firstInstallation'
  2755. });
  2756. }, 60)
  2757. }
  2758. }
  2759. } else if (data.messageType == 'level-button-tip') {
  2760. if (data.confirm) {
  2761. }
  2762. }
  2763. break;
  2764. case 'selected':
  2765. console.log('当前操作的类型 selected:', data.messageType)
  2766. if (data.messageType == 'level-button-tip') {
  2767. if (data.isSelected) {
  2768. uni.setStorage({
  2769. key: 'levelButtonPrompt',
  2770. data: {
  2771. isSelected: true
  2772. }
  2773. })
  2774. //如果选择不提示。则隐藏按钮
  2775. this.$refs.actionJumpRef.onUpdateTipLevelValue(false);
  2776. } else {
  2777. uni.setStorage({
  2778. key: 'levelButtonPrompt',
  2779. data: {
  2780. isSelected: false
  2781. }
  2782. })
  2783. //如果选择提示。则显示按钮
  2784. this.$refs.actionJumpRef.onUpdateTipLevelValue(true);
  2785. }
  2786. } else if (data.messageType == 'device-tip') {
  2787. if (data.isSelected) {
  2788. uni.setStorage({
  2789. key: 'deviceDirectionPrompt',
  2790. data: {
  2791. isSelected: true
  2792. }
  2793. })
  2794. //todo 后续处理是否自动提示,true就不自动提示
  2795. } else {
  2796. uni.setStorage({
  2797. key: 'deviceDirectionPrompt',
  2798. data: {
  2799. isSelected: false
  2800. }
  2801. })
  2802. //todo 后续处理是否自动提示,false就自动提示
  2803. }
  2804. }
  2805. break;
  2806. default:
  2807. uni.showToast({
  2808. title: data.title,
  2809. })
  2810. break;
  2811. }
  2812. })
  2813. },
  2814. unregisterPopupEvent() {
  2815. //注销相应的nvue
  2816. this.closeDrawerById();
  2817. this.closePopupById();
  2818. this.closeGuideById();
  2819. uni.$off('reward-popup-page')
  2820. uni.$off('drawer-page')
  2821. uni.$off('guide-popup-page')
  2822. },
  2823. onNavToDirection() {
  2824. uni.navigateTo({
  2825. url: '../directionOfDetection/directionOfDetection'
  2826. })
  2827. },
  2828. moveBoxingHandle() {
  2829. return;
  2830. },
  2831. /**
  2832. * 提示打开关卡
  2833. */
  2834. onTipLevel(value) {
  2835. // #ifdef APP-PLUS
  2836. this.showGuide('level-button-tip', value);
  2837. // #endif
  2838. // #ifdef H5
  2839. console.warn("不支持nvue");
  2840. // #endif
  2841. },
  2842. onShowFirstInstallation() {
  2843. //第一次安装登录。提示 计划
  2844. this.showGuide('plan', {
  2845. hiddenType: 'firstInstallation'
  2846. });
  2847. console.log("guideUnlockState 1=============:", this.guideUnlockState);
  2848. let guideUnlockState = Object.assign(this.guideUnlockState, {
  2849. firstInstallation: false
  2850. });
  2851. this.setGuideUnlockState(guideUnlockState);
  2852. },
  2853. onAddSandbagHitCount() {
  2854. this.addSandbagHitCount({
  2855. count: 1
  2856. });
  2857. },
  2858. onReset() {
  2859. this.$store.state.sandbagHitCount = 0;
  2860. },
  2861. onSendMsg() {
  2862. let msg = [{
  2863. "maxValue": 19.267578125,
  2864. "gyroValue": -1172.607421875,
  2865. "resultant": 23.36043492594914,
  2866. "index": 98,
  2867. "acc": {
  2868. "oAccX": 10.2587890625,
  2869. "oAccY": -8.3203125,
  2870. "oAccZ": -19.267578125
  2871. },
  2872. "gyro": {
  2873. "oGyroX": -13.0615234375,
  2874. "oGyroY": -1172.607421875,
  2875. "oGyroZ": -42.66357421875
  2876. }
  2877. }, {
  2878. "maxValue": 19.267578125,
  2879. "gyroValue": -1172.607421875,
  2880. "resultant": 23.36043492594914,
  2881. "index": 99,
  2882. "acc": {
  2883. "oAccX": 10.2587890625,
  2884. "oAccY": -8.3203125,
  2885. "oAccZ": -19.267578125
  2886. },
  2887. "gyro": {
  2888. "oGyroX": -13.0615234375,
  2889. "oGyroY": -1172.607421875,
  2890. "oGyroZ": -42.66357421875
  2891. }
  2892. }, {
  2893. "maxValue": 6.58203125,
  2894. "gyroValue": -1144.59228515625,
  2895. "resultant": 8.733990874058362,
  2896. "index": 100,
  2897. "acc": {
  2898. "oAccX": 3.740234375,
  2899. "oAccY": -4.35546875,
  2900. "oAccZ": -6.58203125
  2901. },
  2902. "gyro": {
  2903. "oGyroX": -26.91650390625,
  2904. "oGyroY": -1144.59228515625,
  2905. "oGyroZ": -45.10498046875
  2906. }
  2907. }, {
  2908. "maxValue": 6.58203125,
  2909. "gyroValue": -1144.59228515625,
  2910. "resultant": 8.733990874058362,
  2911. "index": 101,
  2912. "acc": {
  2913. "oAccX": 3.740234375,
  2914. "oAccY": -4.35546875,
  2915. "oAccZ": -6.58203125
  2916. },
  2917. "gyro": {
  2918. "oGyroX": -26.91650390625,
  2919. "oGyroY": -1144.59228515625,
  2920. "oGyroZ": -45.10498046875
  2921. }
  2922. }, {
  2923. "maxValue": -1.1376953125,
  2924. "gyroValue": -1038.87939453125,
  2925. "resultant": 3.372542722981424,
  2926. "index": 102,
  2927. "acc": {
  2928. "oAccX": -1.5966796875,
  2929. "oAccY": -2.744140625,
  2930. "oAccZ": 1.1376953125
  2931. },
  2932. "gyro": {
  2933. "oGyroX": -46.93603515625,
  2934. "oGyroY": -1038.87939453125,
  2935. "oGyroZ": -66.162109375
  2936. }
  2937. }, {
  2938. "maxValue": -1.30859375,
  2939. "gyroValue": -951.2939453125,
  2940. "resultant": 10.222525689439594,
  2941. "index": 103,
  2942. "acc": {
  2943. "oAccX": 1.23046875,
  2944. "oAccY": -10.0634765625,
  2945. "oAccZ": 1.30859375
  2946. },
  2947. "gyro": {
  2948. "oGyroX": -54.0771484375,
  2949. "oGyroY": -951.2939453125,
  2950. "oGyroZ": -85.205078125
  2951. }
  2952. }, {
  2953. "maxValue": -1.30859375,
  2954. "gyroValue": -951.2939453125,
  2955. "resultant": 10.222525689439594,
  2956. "index": 104,
  2957. "acc": {
  2958. "oAccX": 1.23046875,
  2959. "oAccY": -10.0634765625,
  2960. "oAccZ": 1.30859375
  2961. },
  2962. "gyro": {
  2963. "oGyroX": -54.0771484375,
  2964. "oGyroY": -951.2939453125,
  2965. "oGyroZ": -85.205078125
  2966. }
  2967. }, {
  2968. "maxValue": 0,
  2969. "gyroValue": -890.2587890625,
  2970. "resultant": 16.96604926042062,
  2971. "index": 105,
  2972. "acc": {
  2973. "oAccX": 4.4384765625,
  2974. "oAccY": -16.3623046875,
  2975. "oAccZ": 0.6494140625
  2976. },
  2977. "gyro": {
  2978. "oGyroX": -47.36328125,
  2979. "oGyroY": -890.2587890625,
  2980. "oGyroZ": -100.15869140625
  2981. }
  2982. }, {
  2983. "maxValue": 0,
  2984. "gyroValue": -890.2587890625,
  2985. "resultant": 16.96604926042062,
  2986. "index": 106,
  2987. "acc": {
  2988. "oAccX": 4.4384765625,
  2989. "oAccY": -16.3623046875,
  2990. "oAccZ": 0.6494140625
  2991. },
  2992. "gyro": {
  2993. "oGyroX": -47.36328125,
  2994. "oGyroY": -890.2587890625,
  2995. "oGyroZ": -100.15869140625
  2996. }
  2997. }, {
  2998. "maxValue": 1.6455078125,
  2999. "gyroValue": -826.47705078125,
  3000. "resultant": 19.088619035995112,
  3001. "index": 107,
  3002. "acc": {
  3003. "oAccX": 6.8798828125,
  3004. "oAccY": -17.7294921875,
  3005. "oAccZ": -1.6455078125
  3006. },
  3007. "gyro": {
  3008. "oGyroX": -32.04345703125,
  3009. "oGyroY": -826.47705078125,
  3010. "oGyroZ": -116.2109375
  3011. }
  3012. }, {
  3013. "maxValue": 0,
  3014. "gyroValue": -754.7607421875,
  3015. "resultant": 12.858333021663745,
  3016. "index": 108,
  3017. "acc": {
  3018. "oAccX": 4.4580078125,
  3019. "oAccY": -12.060546875,
  3020. "oAccZ": -0.078125
  3021. },
  3022. "gyro": {
  3023. "oGyroX": -20.751953125,
  3024. "oGyroY": -754.7607421875,
  3025. "oGyroZ": -133.544921875
  3026. }
  3027. }, {
  3028. "maxValue": 0,
  3029. "gyroValue": -754.7607421875,
  3030. "resultant": 12.858333021663745,
  3031. "index": 109,
  3032. "acc": {
  3033. "oAccX": 4.4580078125,
  3034. "oAccY": -12.060546875,
  3035. "oAccZ": -0.078125
  3036. },
  3037. "gyro": {
  3038. "oGyroX": -20.751953125,
  3039. "oGyroY": -754.7607421875,
  3040. "oGyroZ": -133.544921875
  3041. }
  3042. }, {
  3043. "maxValue": 4.0087890625,
  3044. "gyroValue": -700.1953125,
  3045. "resultant": 4.438586679567735,
  3046. "index": 110,
  3047. "acc": {
  3048. "oAccX": 1.5869140625,
  3049. "oAccY": -1.0546875,
  3050. "oAccZ": -4.0087890625
  3051. },
  3052. "gyro": {
  3053. "oGyroX": -10.43701171875,
  3054. "oGyroY": -700.1953125,
  3055. "oGyroZ": -149.35302734375
  3056. }
  3057. }];
  3058. this.onSendSocketMessage(msg);
  3059. },
  3060. onReadDataNameInput: function(event) {
  3061. this.onSetReadDataName(event.target.value);
  3062. },
  3063. onTestModuleUpdateCallback(res) {
  3064. console.log(JSON.stringify(res));
  3065. if (res.code == 0) {
  3066. if (res.tag == -1) {
  3067. // this.normalText = "测试 msg:" + res.msg + ",return int:" + res.tag + "\n";
  3068. } else {
  3069. //识别到跳
  3070. uni.showToast({
  3071. title: res.tag + ',' + res.msg,
  3072. icon: 'none',
  3073. duration: 1000,
  3074. mask: true
  3075. })
  3076. }
  3077. }
  3078. },
  3079. _jumpIdenModule_DownloadReadData(item) {
  3080. if (this.currentJumpItem)
  3081. this.currentJumpItem.bRatio = false;
  3082. this.currentJumpItem = item;
  3083. this.jumpIdenModule_DownloadReadData({
  3084. data: item,
  3085. callback: (res) => {
  3086. item.bRatio = true;
  3087. }
  3088. });
  3089. }
  3090. }
  3091. };
  3092. </script>
  3093. <style>
  3094. .bg-person {
  3095. /* background-color: #9797ff; */
  3096. background-color: #00003D;
  3097. /* #ifdef H5 */
  3098. /* background-size:750rpx 1622rpx;
  3099. background-image: url(../../../static/modal/action-jump/temp-tip.png); */
  3100. /* #endif */
  3101. }
  3102. .plan-view {
  3103. overflow: hidden;
  3104. /* background-color: #9797ff; */
  3105. }
  3106. .plan-l-tip-view {
  3107. border-radius: 80upx 0 0 80upx;
  3108. background-color: rgba(255, 255, 255, 0.05);
  3109. }
  3110. .plan-r-tip-view {
  3111. border-radius: 0 80upx 80upx 0;
  3112. background-color: rgba(255, 255, 255, 0.05);
  3113. }
  3114. .bottom-view {
  3115. background-color: rgba(246, 243, 249, 255);
  3116. padding-bottom: 20rpx;
  3117. border-radius: 80rpx 80rpx 0 0;
  3118. width: 750rpx;
  3119. overflow: hidden;
  3120. }
  3121. .time-view {
  3122. width: 100%;
  3123. margin-top: 53rpx;
  3124. /* border: 1rpx solid #DD514C; */
  3125. }
  3126. /*样式的width和height一定要与定义的cWidth和cHeight相对应*/
  3127. .qiun-charts-arcbar {
  3128. height: 376rpx;
  3129. position: relative;
  3130. width: 750rpx;
  3131. /* border: 1rpx solid #fff; */
  3132. background-color: RGBA(30, 30, 85, 1);
  3133. }
  3134. .charts-arcbar {
  3135. position: absolute;
  3136. /* margin-left: 81upx;
  3137. */
  3138. left: 0;
  3139. right: 0;
  3140. top: 0;
  3141. bottom: 0;
  3142. margin: auto;
  3143. width: 490rpx;
  3144. height: 480rpx;
  3145. /* border: 1rpx solid #FFFFFF; */
  3146. }
  3147. .charts-arcbar-img {
  3148. position: absolute;
  3149. left: 135upx;
  3150. width: 480upx;
  3151. height: 480upx;
  3152. }
  3153. .charts-pring-bottom {
  3154. position: relative;
  3155. width: 100%;
  3156. display: flex;
  3157. flex-direction: column;
  3158. justify-content: center;
  3159. align-items: center;
  3160. }
  3161. .charts-pring-button {
  3162. width: 178rpx;
  3163. height: 64rpx;
  3164. display: flex;
  3165. flex-direction: row;
  3166. justify-content: start;
  3167. align-items: center;
  3168. border-radius: 0 25px 25px 0;
  3169. }
  3170. /* 心电图 */
  3171. /* .qiun-charts-elect {
  3172. width: 500rpx;
  3173. height: 136rpx;
  3174. } */
  3175. .charts-elect {
  3176. width: 464rpx;
  3177. height: 96rpx;
  3178. border: 1rpx solid #000000;
  3179. }
  3180. .e-button {
  3181. background-color: rgba(255, 255, 255, 0.25);
  3182. border-radius: 45px;
  3183. margin: 5px 12px;
  3184. box-shadow: 1px 1px 3px #888888;
  3185. display: flex;
  3186. justify-content: center;
  3187. }
  3188. /* 曲线图 */
  3189. .qiun-charts-area {
  3190. width: calc(750rpx - 40rpx);
  3191. height: 300upx;
  3192. /* background-color: #007AFF; */
  3193. position: relative;
  3194. }
  3195. .charts-area {
  3196. position: absolute;
  3197. width: 750upx;
  3198. height: 300upx;
  3199. }
  3200. .qiun-charts-bottom-container {
  3201. height: 63px;
  3202. position: relative;
  3203. width: 100%;
  3204. justify-content: center;
  3205. align-items: center;
  3206. display: flex;
  3207. flex-direction: row;
  3208. }
  3209. .qiun-charts-bottom-right {
  3210. position: absolute;
  3211. left: calc(50% + 50rpx);
  3212. top: 15px;
  3213. margin-left: 20rpx;
  3214. }
  3215. /* picker */
  3216. .mpvue-picker-view {
  3217. width: calc(50% - 5px);
  3218. height: 300px;
  3219. /* background-color: rgba(255, 255, 255, 1); */
  3220. border-radius: 20px;
  3221. }
  3222. .item {
  3223. text-align: center;
  3224. width: calc(100% - 0px);
  3225. background-color: rgba(255, 255, 255, 1);
  3226. height: 88upx;
  3227. line-height: 88upx;
  3228. text-overflow: ellipsis;
  3229. white-space: nowrap;
  3230. font-size: 40upx;
  3231. }
  3232. .picker-unit {
  3233. position: absolute;
  3234. right: 70px;
  3235. top: 43%;
  3236. }
  3237. .left-button,
  3238. .right-button {
  3239. margin: 20px 0;
  3240. padding: 10px 30px;
  3241. background-color: #ffffff;
  3242. }
  3243. .left-button {
  3244. border-top-left-radius: 20px;
  3245. border-bottom-left-radius: 20px;
  3246. border-right: 1px solid #e6e6e6;
  3247. }
  3248. .right-button {
  3249. border-top-right-radius: 20px;
  3250. border-bottom-right-radius: 20px;
  3251. }
  3252. .png-size-28 {
  3253. width: 24px;
  3254. height: 24px;
  3255. margin-bottom: 4px;
  3256. }
  3257. .png-size-32 {
  3258. width: 32px;
  3259. height: 32px;
  3260. }
  3261. .png-size-34 {
  3262. width: 34px;
  3263. height: 34px;
  3264. }
  3265. /* 图标大小 */
  3266. .data-play {
  3267. width: 16px;
  3268. height: 16px;
  3269. margin-top: 10rpx;
  3270. }
  3271. .p-data-png {
  3272. width: 16px;
  3273. height: 16px;
  3274. margin: 5rpx 20rpx;
  3275. }
  3276. .data-png {
  3277. width: 16px;
  3278. height: 16px;
  3279. margin: 5rpx;
  3280. }
  3281. .data-png-20 {
  3282. width: 20px;
  3283. height: 20px;
  3284. margin: 0 14rpx;
  3285. }
  3286. .data-png-54 {
  3287. width: 54px;
  3288. height: 54px;
  3289. margin: 0 14rpx;
  3290. }
  3291. .data-png-add {
  3292. position: absolute;
  3293. left: 0;
  3294. top: 0;
  3295. right: 0;
  3296. bottom: 0;
  3297. margin: auto;
  3298. width: 34px;
  3299. height: 37px;
  3300. }
  3301. .time-container {
  3302. margin-top: 13px;
  3303. width: 100%;
  3304. height: 218rpx;
  3305. position: relative;
  3306. /* border: 1rpx solid #007AFF; */
  3307. }
  3308. .time-png {
  3309. width: 503rpx;
  3310. height: 222rpx;
  3311. position: absolute;
  3312. left: 0;
  3313. right: 0;
  3314. top: 0;
  3315. bottom: 0;
  3316. margin: auto;
  3317. z-index: 1;
  3318. }
  3319. .time-text {
  3320. font-size: 9px;
  3321. z-index: 10;
  3322. position: relative;
  3323. height: 100%;
  3324. display: flex;
  3325. justify-content: center;
  3326. align-items: center;
  3327. color: #FFFFFF;
  3328. }
  3329. .padding {
  3330. padding: 10rpx;
  3331. }
  3332. .logo {
  3333. height: 200rpx;
  3334. width: 200rpx;
  3335. margin-top: 200rpx;
  3336. margin-left: auto;
  3337. margin-right: auto;
  3338. margin-bottom: 50rpx;
  3339. }
  3340. .float-png {
  3341. position: absolute;
  3342. right: 15px;
  3343. bottom: 200px;
  3344. width: 56px;
  3345. height: 56px;
  3346. }
  3347. .moveCanvas {
  3348. position: fixed;
  3349. top: 9999rpx;
  3350. left: 0;
  3351. width: 188rpx;
  3352. height: 188rpx;
  3353. }
  3354. .scroll-class {
  3355. width: 100%;
  3356. overflow-x: hidden;
  3357. box-sizing: border-box;
  3358. /* border: 1rpx solid #000000; */
  3359. }
  3360. .homepage-grid-square {
  3361. width: 250rpx;
  3362. /* height: 250rpx; */
  3363. align-items: start;
  3364. }
  3365. .homepage-grid-square image {
  3366. width: 176rpx;
  3367. height: 176rpx;
  3368. }
  3369. .border {
  3370. /* width: 176rpx; */
  3371. font-size: 30rpx;
  3372. color: rgba(175, 175, 175, 1);
  3373. font-weight: 400;
  3374. text-align: center;
  3375. margin-top: 22rpx;
  3376. margin-bottom: 40rpx;
  3377. }
  3378. .item-img {
  3379. border-radius: 20rpx;
  3380. /* border: 1rpx solid #EEEEEE; */
  3381. box-shadow: 0px 1px 2px 0px rgba(113, 113, 219, 0.23);
  3382. }
  3383. .plan-Tip-child {
  3384. height: 120rpx;
  3385. }
  3386. .plan-mode-tip {
  3387. height: 90rpx;
  3388. }
  3389. .plan-grid-square {
  3390. width: 250rpx;
  3391. /* height: 250rpx; */
  3392. align-items: start;
  3393. }
  3394. .plan-grid-square image {
  3395. width: 168rpx;
  3396. height: 58rpx;
  3397. }
  3398. .plan-mode {
  3399. /* height: 54px; */
  3400. border-radius: 10px;
  3401. padding: 3px;
  3402. margin: 0 5px 10px 5px;
  3403. border: 1rpx solid #eeeeee;
  3404. /* box-shadow: 0px 1px 2px 0px rgba(113, 113, 219, 0.23); */
  3405. position: relative;
  3406. }
  3407. .plan-mode-selected {
  3408. /* height: 54px; */
  3409. padding: 3px;
  3410. margin: 0 5px 10px 5px;
  3411. background-size: contain;
  3412. background-clip: border-box;
  3413. background-repeat: no-repeat;
  3414. background-image: url(../../../static/plan-select-bg.png);
  3415. /* box-shadow: 0px 1px 2px 0px rgba(113, 113, 219, 0.23); */
  3416. position: relative;
  3417. }
  3418. .plan-mode-border {
  3419. /* width: 176rpx; */
  3420. font-size: 26rpx;
  3421. color: rgba(151, 151, 255, 1);
  3422. font-weight: 400;
  3423. text-align: center;
  3424. }
  3425. .button-fav {
  3426. background-color: rgba(153, 150, 252, 255);
  3427. color: #ffffff;
  3428. /* border-radius: 10px; */
  3429. /* width: 184rpx; */
  3430. height: 122rpx;
  3431. display: flex;
  3432. justify-content: center;
  3433. text-align: center;
  3434. align-items: center;
  3435. font-size: 14px;
  3436. }
  3437. .card-view-small {
  3438. /* border: 1rpx solid #000000; */
  3439. width: 80%;
  3440. border-radius: 20px;
  3441. margin-left: 50rpx;
  3442. overflow: hidden;
  3443. background-color: #ffffff;
  3444. box-shadow: 0px 2px 4px 0px rgba(113, 113, 219, 0.23);
  3445. }
  3446. .right-bg {
  3447. /* border: 1rpx solid #000000; */
  3448. border-radius: 8px;
  3449. background-color: #9797ff;
  3450. padding: 15rpx;
  3451. position: absolute;
  3452. right: 5%;
  3453. margin-top: 4%;
  3454. }
  3455. .plan-small-child {
  3456. background-color: #f5f5ff;
  3457. border-radius: 20px;
  3458. width: 480rpx;
  3459. height: 90rpx;
  3460. margin: 0 0 30rpx 30rpx;
  3461. /* margin-top: 60rpx; */
  3462. }
  3463. .cu-btn-plan {
  3464. position: relative;
  3465. border: 0upx;
  3466. display: inline-flex;
  3467. align-items: center;
  3468. justify-content: center;
  3469. box-sizing: border-box;
  3470. padding: 4upx 25upx 4upx 4upx;
  3471. margin-left: 5px;
  3472. font-size: 22upx;
  3473. height: 64upx;
  3474. line-height: 1;
  3475. text-align: center;
  3476. text-decoration: none;
  3477. overflow: visible;
  3478. margin-left: initial;
  3479. transform: translate(0upx, 0upx);
  3480. margin-right: initial;
  3481. }
  3482. .cu-btn-plan-child {
  3483. position: relative;
  3484. border: 0upx;
  3485. display: inline-flex;
  3486. align-items: center;
  3487. justify-content: center;
  3488. box-sizing: border-box;
  3489. padding: 0 4upx;
  3490. font-size: 22upx;
  3491. height: 56upx;
  3492. line-height: 1;
  3493. text-align: center;
  3494. text-decoration: none;
  3495. overflow: visible;
  3496. margin-left: initial;
  3497. transform: translate(0upx, 0upx);
  3498. margin-right: initial;
  3499. }
  3500. .cu-btn-plan-right {
  3501. position: relative;
  3502. border: 0upx;
  3503. display: inline-flex;
  3504. align-items: center;
  3505. justify-content: center;
  3506. box-sizing: border-box;
  3507. padding: 4upx 4upx 4upx 19upx;
  3508. margin-left: 5px;
  3509. font-size: 22upx;
  3510. height: 64upx;
  3511. line-height: 1;
  3512. text-align: center;
  3513. text-decoration: none;
  3514. overflow: visible;
  3515. margin-left: initial;
  3516. transform: translate(0upx, 0upx);
  3517. margin-right: initial;
  3518. }
  3519. /* 粗线条 */
  3520. .line-make {
  3521. margin-top: 11px;
  3522. margin-left: 8px;
  3523. border: 4rpx solid #FFFFFF;
  3524. width: 152rpx;
  3525. border-radius: 3px;
  3526. }
  3527. /* 头像背景处理 */
  3528. .avatar-bg-personal {
  3529. width: 34px;
  3530. height: 34px;
  3531. border-radius: 45px;
  3532. border: 2px solid #9997fc;
  3533. background-color: #9997fc;
  3534. box-sizing: border-box;
  3535. }
  3536. .avatar-bg-arrow {
  3537. position: absolute;
  3538. top: 12px;
  3539. left: calc(50% - 10px);
  3540. border-left: 10px solid transparent;
  3541. border-right: 10px solid transparent;
  3542. border-bottom: 10px solid #9997fc;
  3543. }
  3544. .elect-round-image {
  3545. width: 48px;
  3546. height: 48px;
  3547. z-index: 10;
  3548. box-shadow: 1px 1px 3px #888888;
  3549. border-radius: 45px;
  3550. }
  3551. .elect-personal {
  3552. /* width: 100%; */
  3553. height: 120rpx;
  3554. /* margin: 50rpx 0; */
  3555. margin-bottom: 50rpx;
  3556. border-radius: 45px;
  3557. padding: 10rpx;
  3558. border: 1rpx solid rgba(255, 255, 255, 0.11);
  3559. display: flex;
  3560. justify-content: center;
  3561. align-items: center;
  3562. position: relative;
  3563. }
  3564. /* 呼吸灯 */
  3565. .breathing-lamp {
  3566. animation-duration: 1s;
  3567. animation-timing-function: ease-out;
  3568. animation-fill-mode: inherit;
  3569. animation-iteration-count: infinite;
  3570. animation-name: run-lamp;
  3571. animation-play-state: running;
  3572. }
  3573. @keyframes run-lamp {
  3574. 0%,
  3575. 100% {
  3576. opacity: 1;
  3577. transform: scale(1);
  3578. }
  3579. 50% {
  3580. opacity: 0.6;
  3581. transform: scale(0.9);
  3582. }
  3583. }
  3584. .personal-fruit-container {
  3585. position: absolute;
  3586. left: 0;
  3587. top: 0;
  3588. bottom: 0;
  3589. right: 0;
  3590. margin: auto;
  3591. display: flex;
  3592. align-items: center;
  3593. justify-content: center;
  3594. /* border: 1rpx solid #F0F0F0; */
  3595. }
  3596. .screen-jitter {
  3597. animation-duration: 1s;
  3598. animation-timing-function: ease-out;
  3599. animation-fill-mode: inherit;
  3600. animation-iteration-count: infinite;
  3601. animation-name: personal-shake;
  3602. animation-play-state: running;
  3603. }
  3604. .screen-red {
  3605. border: 1rpx solid #ff0000;
  3606. }
  3607. @keyframes personal-shake {
  3608. 0%,
  3609. 100% {
  3610. transform: translateX(0)
  3611. }
  3612. 10% {
  3613. transform: translateX(-9px)
  3614. }
  3615. 20% {
  3616. transform: translateX(8px)
  3617. }
  3618. 30% {
  3619. transform: translateX(-7px)
  3620. }
  3621. 40% {
  3622. transform: translateX(6px)
  3623. }
  3624. 50% {
  3625. transform: translateX(-5px)
  3626. }
  3627. 60% {
  3628. transform: translateX(4px)
  3629. }
  3630. 70% {
  3631. transform: translateX(-3px)
  3632. }
  3633. 80% {
  3634. transform: translateX(2px)
  3635. }
  3636. 90% {
  3637. transform: translateX(-1px)
  3638. }
  3639. }
  3640. .CountDownMask {
  3641. position: absolute;
  3642. top: 0;
  3643. bottom: 0;
  3644. right: 0;
  3645. left: 0;
  3646. background-color: rgba(0, 0, 0, 0.5);
  3647. z-index: 1000;
  3648. display: flex;
  3649. justify-content: center;
  3650. align-items: center;
  3651. font-size: 100px;
  3652. font-weight: bold;
  3653. color: #FFFFFF;
  3654. }
  3655. /**
  3656. * 任务样式
  3657. */
  3658. .task-up-button {
  3659. z-index: 10;
  3660. /* #ifndef APP-PLUS */
  3661. position: absolute;
  3662. /* #endif */
  3663. /* #ifdef APP-PLUS */
  3664. position: fixed;
  3665. /* #endif */
  3666. bottom: -53rpx;
  3667. right: 0;
  3668. left: 0;
  3669. margin: auto;
  3670. width: 100%;
  3671. height: 104rpx;
  3672. /* border: 1rpx solid #000000; */
  3673. }
  3674. .canvas-hidden {
  3675. /* display: none; */
  3676. left: -1000px;
  3677. }
  3678. .canvas-show {
  3679. /* display: block; */
  3680. }
  3681. </style>