personal.vue 93 KB

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