personal.vue 92 KB

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