1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237 |
- <!-- 新版本跳首页文件修改版本 -->
- <template>
- <view class="bg-person " :class="bEFHitShake?' screen-jitter ':''">
- <uni-nav-bar id="nav-bar" status-bar="true" backgroundColor="RGBA(30, 30, 85, 1)" @clickLeft="showClickEvent()"
- color="#FFFFFF" fixed="true" :border="false">
- <view slot="left">
- <view class=" flex align-center margin-left">
- <image class="png-more" src="/static/more.png"></image>
- </view>
- </view>
- <view slot="right">
- <view class="flex align-center" style="margin-right: 400rpx;">
- <view class="flex align-center justify-between"
- style="margin-right: 40rpx; padding: 0 16rpx; height: 56rpx; background-color: rgba(255, 153, 0, 1); border-radius: 13.5px;">
- <image class="png-more-black" style="margin-right: 16rpx;"
- src="/static/common/sideBar/gold_black@2x.png">
- </image>
- <view class="text-15px text-center" style="line-height: 56rpx; min-width: 100rpx;">{{cGold}}
- </view>
- </view>
- <view class="flex align-center justify-between"
- style="padding: 0 16rpx; height: 56rpx; background-color: rgba(255, 153, 0, 1); border-radius: 13.5px;">
- <image class="png-more-black" style="margin-right: 16rpx; width: 36rpx; height: 38rpx;"
- src="/static/common/sideBar/diamond_black@2x.png">
- </image>
- <view class="text-15px text-center" style="line-height: 56rpx; min-width: 100rpx;">{{cDiamond}}
- </view>
- </view>
- </view>
- </view>
- </uni-nav-bar>
- <!-- 导航栏下面滚动区域 -->
- <scroll-view class="scroll-class" @scroll="mainScroll" :scroll-top="scrollTop" :scroll-into-view="toView"
- scroll-y="true" :style="{ height: scrollviewHight + 'px' }">
- <view class="flex align-center">
- <view class="justify-center">
- <!-- 计划显示 区域 topScrollHight :style="{ height: + '100%' }"-->
- <scroll-view scroll-y="true" style="height: 100%; width: 100%;">
- <view class="plan-view">
- <view class="text-white text-center"
- style="background-color: RGBA(30, 30, 85, 1); z-index: 10;">今日击打次数:{{sandbagHitCount}}
- </view>
- <!-- #ifdef H5 -->
- <button @click="onAddSandbagHitCount()">add</button>
- <button @click="onReset()">onReset</button>
- <button @click="getUserData_hitCount()">getUserData_hitCount</button>
- <button @click="uploadUserData_hitCount()">uploadUserData_hitCount</button>
- <button @click="onSendMsg()">onSendMsg</button>
- <!-- #endif -->
- <!-- pk模式下的跳绳 v-if="1 === currentModeIndex"-->
- <view v-if="currentMode == 'pkMode'" class="position-relative"
- style="height: 128rpx; background-color: RGBA(30, 30, 85, 1); z-index: 10;">
- <view style="height: 14rpx;"></view>
- <view class="position-absolute-center-top flex justify-center" style="height: 148rpx;">
- <view class="flex flex-direction justify-center align-center">
- <view class="cu-avatar-group" style="position: relative;">
- <view class="cu-avatar round xl" :class="bAiHitShake?' screen-jitter':''"
- :style="[{ backgroundImage:'url('+avatarUrl+')' }]"
- style="width: 102.4rpx ;height: 102.4rpx;"></view>
- </view>
- <view style="margin-top: 8rpx; width: 165rpx; "
- class="text-cut text-white text-center">
- {{userName}}
- </view>
- </view>
- <view class="flex justify-center align-center " style=" width: 300rpx;">
- <LEDFont style="" :showValue='AJData.myScore' :size="30" color='#FFFFFF'>
- </LEDFont>
- <view class="text-white text-bold">:</view>
- <LEDFont style="" :showValue='AJData.otherScore' :size="30" color='#FFFFFF'>
- </LEDFont>
- </view>
- <view v-if="finallySelectFriendInfo"
- class="flex flex-direction justify-center align-center"
- @click="onNavToSelectFriend()">
- <view class="cu-avatar-group" style="position: relative;">
- <view class="cu-avatar round xl" :class="bHitShake?' screen-jitter':''"
- :style="[{ backgroundImage:'url('+finallySelectFriendInfo.avatarUrl+')' }]"
- style="width: 102.4rpx ;height: 102.4rpx;">
- </view>
- </view>
- <view style="margin-top: 8rpx; width: 165rpx;"
- class="text-cut text-white text-center">
- {{finallySelectFriendInfo.username}}
- </view>
- </view>
- <view v-else class="flex flex-direction justify-center align-center"
- @click="onNavToSelectFriend()">
- <image style="width: 102.4rpx ;height: 102.4rpx;"
- src="/static/friend/friend-add.png">
- </image>
- <view style="margin-top: 8rpx; width: 165rpx;"
- class="text-cut text-white text-center">
- 选择好友
- </view>
- </view>
- </view>
- </view>
- <!-- 80rpx -->
- <view v-else style="height:14rpx; background-color: RGBA(30, 30, 85, 1);"> </view>
- <!-- 进度条 -->
- <view class="qiun-charts-arcbar">
- <!-- 进度条 -->
- <canvas v-show="false" canvas-id="canvasArcbar" id="canvasArcbar"
- class="charts-arcbar "></canvas>
- <!-- 跳动次数 -->
- <view class="position-absolute-center-bottom flex justify-center"
- style="align-items: flex-end; height: 276rpx; bottom: 40rpx;">
- <LEDFont style="" :showValue='AJData.allCount-AJData.faultCount' :height="120"
- :size="120" color='#FF9900'>
- </LEDFont>
- <LEDFont showValue="/" :height="65" :size="65" color='#FFFFFF'>
- </LEDFont>
- <LEDFont :showValue='AJData.targetCount' :height="65" :size="65" color='#FFFFFF'>
- </LEDFont>
- </view>
- <!-- 计时器 -->
- <view class="position-absolute-right-top" style="top: 76rpx;">
- <arcbarCountDown
- style="margin-right: 104rpx; border: 2px solid rgb(255,255,255); background-color: RGBA(255, 153, 0, 1); padding: 0px 14px; border-radius: 18px;"
- ref="arcbarCountDownRef" :show-day="false" :second="AJData.gameLimitTime"
- color="#FFFFFF" background-color="rgba(255,255,255,0)" border-color="#007AFF"
- :size="29" splitorColor="#FFFFFF" @timeUp="arcbarCountDownTimeUp"
- @timeUpdate="arcbarCountDownTimeUpdate" />
- </view>
- </view>
- <!-- 用于定位 -->
- <view id="boxingHitID" class="charts-pring-bottom" v-if="0 === currentModeIndex">
- <!-- 添加一个 ConnectBindingDevice 测试 -->
- <!-- <boxing-hit ref="boxingPostRef"
- :bUpdate="!bHide&&(ConnectBindingDevice!=null)||(cIndex!=-1 && BLEConnectDevice!=null &&
- (BLEConnectDevice.deviceType == 'mySelf'||BLEConnectDevice.deviceType == 'BLEHandle' || BLEConnectDevice.deviceType == 'BLERope' ))"
- :showTime="localSportTime"
- :bRebound="BLEConnectDevice&&BLEConnectDevice.limitType == 'rebound'"
- @updateCalorie="boxingUpdateCalorie" @boxingPostCheck="onPersonalCheck"
- @shake="onScreenShake" @updateSportTime="onUpdateSportTime"
- @boxingGuideFinish="onBoxingGuideFinish"
- @boxingPostControlPlay="onActionControlPlay" @modeEvent="onModeEvent"
- @hitEvent="onHitEvent" @aiHitEvent="onAiHitEvent" @gameOver="onBoxingGameOver"
- @closeBoxingControl="onCloseBoxingHit"></boxing-hit> -->
- <action-hit ref="actionHitRef"
- :levelData="currentJumpTask!=null?currentJumpTask.item:null"
- :currentMode="currentMode" @actionJumpCheck="onPersonalCheck"
- @actionJumpControllerPlay="onActionControlPlay"
- @actionJumpDataUpdate="onActionJumpDataUpdate" @gameOver="onActionJumpGameOver"
- @tipLevel="onTipLevel">
- </action-hit>
- </view>
- <view id='actionJumpID' class="charts-pring-bottom" v-if="1 === currentModeIndex">
- <action-jump ref="actionJumpRef"
- :levelData="currentJumpTask!=null?currentJumpTask.item:null"
- :currentMode="currentMode" @actionJumpCheck="onPersonalCheck"
- @actionJumpControllerPlay="onActionControlPlay"
- @actionJumpDataUpdate="onActionJumpDataUpdate" @gameOver="onActionJumpGameOver"
- @tipLevel="onTipLevel">
- </action-jump>
- </view>
- </view>
- </scroll-view>
- </view>
- </view>
- <!-- <view class="example">
- <button @click="showGuide('level-game-tip',{levelType:'rotationJump'})">显示 level-game-tip</button>
- </view> -->
- <!-- <view class="example">
- <button @click="onTipLevel">显示 ontipLevel</button>
- </view> -->
- <!-- <view class="example" style="margin-top: 10rpx;">
- <button @click="onNavToDirection">跳转校准页面</button>
- </view> -->
- <!-- <view class="example">
- <button @click="onGetBluetoothConnectView({
- hiddenType: 'firstInstallation'
- })">显示 bluetoothConnect</button>
- </view> -->
- <!-- <view class="example">
- <button @click="onUserSignIn()">签到</button>
- </view> -->
- <!-- <view class="example">
- <button @click="showGuide('plan', {
- hiddenType: 'firstInstallation'
- })">计划</button>
- </view> -->
- <!-- <view class="flex align-center margin text-white">
- <view class="title" style="width: 150rpx;">轨迹名称:</view>
- <input class="uni-input" style="width: 250rpx; border: 1rpx solid #FFFFFF;" :value="readDataName" @input="onReadDataNameInput"
- placeholder="输入轨迹名称" />
- <button type="primary" style="width: 250rpx; height: 50rpx; font-size: 14px; line-height: 50rpx;" @click="jumpIdenModule_SearchData">
- 获取列表
- </button>
- </view>
- <scroll-view scroll-y="true" style="height: 280rpx; background-color: #c6c6c6;">
- <view class="card-view padding-top-sm padding-bottom-sm" v-for="(item,index) in filesList" :key="index"
- :id="'task_'+index" :class="item.bRatio?'hardware-border':''">
- <view class="flex justify-between align-center">
- <view class="flex justify-start align-center">
- <view style="margin-left: 10rpx;">
- <view style="margin: 5rpx; font-weight: bold; font-size: 18px; color: #565656;">
- {{item.cname}}
- </view>
- </view>
- </view>
- <image style="margin-right: 60rpx; width: 60rpx;height: 60rpx;"
- :src="item.bRatio?'/static/devicesOther/radio-b.png':'/static/devicesOther/radio-g.png'"
- mode="aspectFit" @tap="_jumpIdenModule_DownloadReadData(item)"></image>
- </view>
- </view>
- </scroll-view> -->
- <!-- <view class="margin-sm "> -->
- <!-- <button type="primary" @click="jumpIdenModule_onJumpInit">
- 使用本地默认轨迹
- </button>
- <button type="primary" class=" margin-top-sm" @click="jumpIdenModule_onJumpInitLocalData">
- 使用so默认轨迹
- </button> -->
- <!-- onTestUpdate -->
- <!-- <button type="primary" class="margin-top-sm" @click="jumpIdenModule_onTestUpdate">
- 模拟跳数据输入
- </button> -->
- <!-- </view> -->
- <view v-if="false" class="cu-list menu card-menu">
- <view class="cu-item">
- <view class="content">
- <text class="cuIcon-title text-green"></text>
- <text class="text-grey">输入测试参数</text>
- </view>
- </view>
- <checkbox-group class="block" @change="CheckboxChange">
- <view class="cu-form-group">
- <view class="title">是否拦截偶数帧数据({{bIgnore}})({{showMs}} ms)</view>
- <checkbox :class="bIgnore?'checked':''" :checked="bIgnore?true:false" value="A"></checkbox>
- </view>
- </checkbox-group>
- <view class="cu-item">
- <view class="title">frameHitCapacity</view>
- <input type="number" inputmode="numeric" class="uni-input"
- style=" border: 1rpx solid #000;"
- :value="hotmanIntelligentData.frameHitCapacity" @input="onFrameHitCapacityInput"
- placeholder="输入frameHitCapacity" />
- </view>
-
- <view class="cu-item">
- <view class="title">slopeArr</view>
- <input class="uni-input"
- style=" border: 1rpx solid #000;" :value="hotmanIntelligentData.slopeArr"
- @input="onSlopeArrInput" placeholder="输入slopeArr" />
- </view>
-
- <view class="cu-item">
- <view class="content">
- <text class="cuIcon-title text-green"></text>
- <text class="text-grey">新协议</text>
- </view>
- </view>
- <view class="cu-item">
- <view class="content">
- <text class="cuIcon-btn text-green"></text>
- <text class="text-grey">默认 (5B0E02141E141E141E0...05D)</text>
- </view>
- <view class="action">
- <button class="cu-btn round bg-green shadow"
- @click="onSendBLELightNoSet('5B0E02141E141E141E00000000000000005D')"> 发送</button>
- </view>
- </view>
- <view class="cu-item">
- <view class="content">
- <text class="cuIcon-btn text-green"></text>
- <text class="text-grey">退出(5B0E020...05D)</text>
- </view>
- <view class="action">
- <button class="cu-btn round bg-green shadow"
- @click="onSendBLELightNoSet('5B0E0200000000000000000000000000005D')"> 发送</button>
- </view>
- </view>
- <view class="cu-form-group">
- <input placeholder="输入自定义指令" :value="readBLELight" @input="onReadBLELightInput"
- name="input"></input>
- <button class='cu-btn round bg-green shadow' @click="onSendBLELightValue(readBLELight)">发送</button>
- </view>
- <view class="cu-item">
- <view class="content">
- <text class="cuIcon-btn text-green"></text>
- <text class="text-grey">播放一段闪烁</text>
- </view>
- <view class="action">
- <button class="cu-btn round bg-green shadow" @click="onHitOpenBLELightNew"> 确定</button>
- </view>
- </view>
- </view>
- <view v-if="false" class="cu-list menu card-menu">
- <view class="cu-item">
- <view class="content">
- <text class="cuIcon-title text-green"></text>
- <text class="text-grey">旧设备</text>
- </view>
- </view>
- <view class="cu-item">
- <view class="content">
- <text class="cuIcon-btn text-green"></text>
- <text class="text-grey">播放一段闪烁</text>
- </view>
- <view class="action">
- <button class="cu-btn round bg-green shadow" @click="onHitOpenBLELight"> 确定</button>
- </view>
- </view>
- </view>
- <!-- <button type="primary" @click="B_OpenRopeSkipping">
- B_OpenRopeSkipping
- </button> -->
- <view style="height: 250rpx;"></view>
- </scroll-view>
- <!-- 底部中间上滑按钮 -->
- <view class="flex flex-direction justify-start align-center task-up-button" @tap="showModal"
- data-target="slideUpModal">
- <image style="width: 248rpx;height: 104rpx;" class="position-absolute-center"
- src="../../../static/modal/level-tip/level-tip-bg-orange.png"></image>
- <view class="text-blue bg-white radius "
- style="z-index: 10; margin-top: 20rpx; width: 72rpx; height: 12rpx;"></view>
- </view>
- <!-- 右下角导航栏 -->
- <round-fab ref="roundFabRef" :connect="cIndex!=-1 && BLEConnectDevice!=null" @fabClick="fabClick"></round-fab>
- <!-- 侧边栏 如果app使用 nvue 侧边栏 -->
- <!-- #ifdef H5 || MP-WEIXIN -->
- <sideBar ref="sideBar"></sideBar>
- <!-- #endif -->
- <!-- 训练卡 -->
- <view class="cu-modal " :class="modalName == 'sportCompletion' ? '' : ''">
- <view style="
- position: relative;
- width: 586rpx;
- height: 766rpx;
- background-color: #FFFFFF;
- border-radius: 25px;
- display: inline-block;
- vertical-align: middle;
- margin-left: auto;
- margin-right: auto;
- overflow: hidden;">
- <view style="position: relative; width: 100%; height: 328rpx;">
- <image style="position: absolute;top: 0;left: 0; width: 100%;height: 100%;"
- src="../../../static/sidebar_top_bg.png"></image>
- <view class="flex flex-direction justify-around align-center"
- style="position: relative; height: 100%;">
- <view class="text-white">已在哔嘣健身训练了</view>
- <view class="text-white"><span style="font-size: 43px;">{{sportData.time}}</span> 分钟</view>
- <view class="text-white">本次达标率{{sportData.percent}}%</view>
- </view>
- </view>
- <view class="flex justify-around">
- <view class="flex flex-direction justify-around align-center"
- style="position: relative; height: 162rpx;">
- <view class="text-grey">消耗</view>
- <view class="text-grey"><span
- style="font-size: 18px; color: #000000;">{{sportData.calorie}}</span> 卡</view>
- </view>
- <view class="flex flex-direction justify-around align-center"
- style="position: relative; height: 162rpx;">
- <view class="text-grey">踩中</view>
- <view class="text-grey"><span style="font-size: 18px; color: #000000;">{{sportData.hit}}</span>
- 次</view>
- </view>
- <view class="flex flex-direction justify-around align-center"
- style="position: relative; height: 162rpx;">
- <view class="text-grey">失误</view>
- <view class="text-grey"><span style="font-size: 18px; color: #000000;">{{sportData.miss}}</span>
- 次</view>
- </view>
- </view>
- <view class="flex flex-direction justify-around align-center margin-top-sm">
- <view style="position: relative; width: 500rpx; border:1rpx solid #EEEEEE ;"></view>
- </view>
- <view class="flex flex-direction justify-around align-center" style="height: 230rpx;">
- <view class="text-black text-16px">非常优秀,继续加油!</view>
- <view class="flex justify-center align-center text-white make-bg-bPurple round text-16px"
- style="width: 300rpx;height: 80rpx;" @tap="hideModal">确定</view>
- </view>
- </view>
- </view>
- <!-- :class="modalName == 'jumpAnimation' ? 'show' : ''" -->
- <view class="cu-modal " :class="modalName == 'jumpAnimation' ? '' : ''">
- <view style="
- position: relative;
- width: 586rpx;
- height: 400rpx;
- background-color: #FFFFFF;
- border-radius: 4px;
- display: inline-block;
- vertical-align: middle;
- margin-left: auto;
- margin-right: auto;
- overflow: hidden;">
- <view style="height: 100%;display: flex;justify-content: center;align-items: center;">
- <character></character>
- </view>
- </view>
- </view>
- <!-- 引导蒙层 bGuidePages guideCurrent-->
- <!-- <code-elf-guide ref="codeElfGuide" v-if="bGuidePages" @hide="guideHide" @change="onGuideChange"
- :current="guideCurrent" :currentMode="currentMode"></code-elf-guide> -->
- <view v-if="bStartCountDown" class="CountDownMask">
- {{BoxingPostCountDownText}}
- </view>
- <view class="cu-modal " :class="modalName=='showPlanTipModal'?'show':''"
- @touchmove.stop.prevent="moveBoxingHandle">
- <view class="cu-bind-modal">
- <view style="position: absolute; top: 0; left: 0; width: 100%; height:100%;">
- <image style="position: absolute;top: 0;left: 0; width: 100%;height: 100%;"
- src="/static/modelBg.png"></image>
- </view>
- <view class="flex flex-direction justify-between " style="position: relative; height: 100%;">
- <view class="flex justify-around justify-center align-center" style="margin: 170rpx 30rpx 0 30rpx;">
- <view style="width: 80rpx;height: 2rpx;border-radius: 2px; background-color: #cbcdcf;"></view>
- <view class="make-text-bPurple" style=" font-size: 20px;">提示</view>
- <view style="width: 80rpx;height: 2rpx;border-radius: 2px;background-color: #cbcdcf;"></view>
- </view>
- <view class="text-16px" style="align-self: center; max-width: 200px; word-break: break-all;">
- {{planTip[planTipIndex]}}
- </view>
- <view class="flex justify-around align-center"
- style=" border-top: 1rpx solid #EEEEEE; margin-bottom: 2px;">
- <view class="flex justify-center align-center text-16px" style="width: 100%;height: 123rpx;"
- @tap="hidePlanTipModal">取消</view>
- <view style="height: 123rpx;width: 1px;background-color: #EEEEEE;"></view>
- <view class="flex justify-center align-center text-16px" style="width: 100%;height: 123rpx;"
- @tap="confirmPlanTipModal">确定</view>
- </view>
- </view>
- </view>
- </view>
- <ModalTip ref='modalTipRef' :class="modalName=='showModalTip'?' show':''" @hide="onModalTipHide"
- @confirm="onModalTipConfirm"></ModalTip>
- <!-- 任务栏 -->
- <view class="cu-modal bottom-modal" :class="modalName=='slideUpModal'?'show':''" @tap="hideModal">
- <view class="cu-dialog bg-white" style="border-radius: 15px 15px 0 0 ;" @tap.stop="">
- <view class="flex justify-center align-center position-relative"
- style="width: 750rpx; height: 64rpx; background-color: RGBA(255, 153, 0, 1);" @tap="hideModal">
- <view class="text-blue bg-white radius" style="width: 114rpx; height: 12rpx;"></view>
- <!-- <view class="position-absolute-right-top">
- <image style="width: 64rpx;height: 64rpx;" src="../../../static/common/modal/task-close@2x.png">
- </image>
- </view> -->
- </view>
- <view class="flex justify-between" style="width: 100%; padding: 34rpx 60rpx 46rpx 81rpx;">
- <view class="flex align-center justify-center">
- <view class="text-16px text-bold make-text-bPurple"
- style="line-height: 32rpx; margin-right: 18rpx;">{{currentMode == 'pkMode'?'PK模式':'健身模式'}}
- </view>
- <image style="width: 42rpx;height: 24rpx;" src="/static/common/modal/right-arrow.png"></image>
- </view>
- <view>
- <button class="make-bg-bPurple flex justify-center align-center" @click="onSwitchMode">
- <view class="flex align-center justify-center" style="width: 190rpx;height: 60rpx;">
- <image style="width: 24rpx;height: 22rpx; margin-right: 18rpx;"
- src="/static/personal/switchWhite.png"></image>
- <view class="text-14px text-white" style="line-height: 28rpx;">
- {{currentMode !== 'pkMode'?'PK模式':'健身模式'}}
- </view>
- </view>
- </button>
- </view>
- </view>
- <scroll-view scroll-y="true" style="height: 800rpx; max-height: 800rpx;min-height: 460rpx;"
- :style="{ height: modalHeight + 'px' }" :scroll-into-view="taskIntoView"
- :scroll-top="taskScrollTop">
- <!-- :class="!item.isUnlock?'':'make-text-bPurple'" -->
- <view class="my-column-cu-steps">
- <view class="cu-item"
- :class="(tempSelectedLevel!=null&&item.id==tempSelectedLevel.item.id)?'make-bg-bPurple-01':''"
- v-for="(item,index) in currentTaskList" :key="index" :id='"task_"+index'
- @click="selectTask(index,item)">
- <image v-if="item.isUnlock" class="my-column-cu-image"
- src="../../../static/common/modal/unLock.png"></image>
- <image
- v-else-if="index>=1&¤tTaskList[index-1].isUnlock&¤tTaskList[index-1].isPassed"
- class="my-column-cu-image" src="../../../static/common/modal/canUnlock.png">
- </image>
- <image v-else class="my-column-cu-image" src="../../../static/common/modal/lock.png">
- </image>
- <view class="content">
- <view class="text-15px text-bold text-cut text-left text-black text-medium"
- style="margin-left: 48rpx; width: 360rpx;margin-top: 30rpx;">
- {{index+1}}. {{item.name}}
- </view>
- <view class="flex justify-start align-center" style="margin:20rpx 0 20rpx 86rpx;">
- <!-- 居中绘制星星样式 -->
- <view class="flex align-center justify-center"
- style="margin-right: 36rpx;margin-top: 4rpx;">
- <image style="width: 36rpx;height: 36rpx; margin-right: 18rpx;"
- src="/static/common/sideBar/sGold.png"></image>
- <view class="text-13px text-black text-medium" style="line-height: 26rpx;">
- {{item.consumeGold}}
- </view>
- </view>
- <view class="flex align-center justify-center"
- style="margin-right: 36rpx;margin-top: 4rpx;">
- <image style="width: 38rpx;height: 34rpx; margin-right: 18rpx;"
- src="/static/common/sideBar/sDiamond.png"></image>
- <view class="text-13px text-black text-medium" style="line-height: 26rpx;">
- {{item.consumeDiamond}}
- </view>
- </view>
- </view>
- <!-- <view class="text-13px text-grey text-left" style="margin: 20rpx 20rpx 0 86rpx;">
- {{item.conditionPassed.explain}}
- </view> -->
- <view class="flex justify-start align-center" style="margin-left: 86rpx;">
- <view class="flex flex-direction align-center" v-for="(item, index) in 5"
- :key="index">
- <image style="width: 34rpx;height: 32rpx;"
- src="../../../static/modal/action-jump/stars.png">
- </image>
- </view>
- </view>
- </view>
- <image class="my-column-cu-right-image" style="pointer-events:auto;"
- src="../../../static/common/modal/medal.png" @click="showPopup('prompt',item)">
- </image>
- <view v-if="currentJumpTask!=null&&item.id==currentJumpTask.item.id"
- class="position-absolute-right-bottom make-text-bPurple text-13px text-medium "
- style="right: 70rpx;bottom: 24rpx;">游戏中...</view>
- <!-- /static/devicesOther/radio-g -->
- <image class="my-column-cu-image"
- style="left: 140rpx;top: 70rpx; width: 30rpx;height: 30rpx;"
- :src="(tempSelectedLevel!=null&&item.id==tempSelectedLevel.item.id)?'/static/devicesOther/radio-b.png':'.png'"
- mode="aspectFit"></image>
- </view>
- </view>
- </scroll-view>
- <button class="cu-btn make-bg-bPurple text-white margin-top margin-bottom"
- style="width: 604rpx;height: 88rpx;" @tap="onConfirmSelectionLevel">确认</button>
- <!-- <button class="cu-btn make-bg-bPurple text-white margin-top margin-bottom"
- style="width: 604rpx;height: 88rpx;" @tap="onPassTheLevel">点击直接通过所选关卡</button>
- -->
- </view>
- </view>
- <!-- 这里vConsole 是为了解决再页面内显示vconsole -->
- <!-- <view id="vconsole" :prop="vLog" :change:prop="vconsole.updateData"></view> -->
- </view>
- </template>
- <!-- 这里vConsole 是为了解决再页面内显示vconsole -->
- <!--
- // <script module="vconsole" lang="renderjs">
- // import VConsole from '../../../util/util-js/vconsole.min.js'
- // new VConsole();
- // export default {
- // mounted() {
- // // ...
- // },
- // data: {
- // return () {}
- // },
- // methods: {
- // updateData(newValue, oldValue, ownerInstance, instance) {
- // // newValue: 新数据
- // // oldValue: 老数据
- // var log = console.log.bind(console);
- // log(newValue)
- // }
- // }
- // }
- // </script>
-
- -->
- <script>
- // import uniNavBar from '@/components/uni-nav-bar/uni-nav-bar.vue';
- import uCharts from '@/components/u-charts/u-charts.js';
- import myPicker from '@/components/slambb-picker/slambb-picker.vue';
- import pickerData from '@/components/slambb-picker/picker.js';
- import date from '@/util/util-js/date.js';
- import sideBar from '@/components/side-bar/side-bar.vue';
- import reqUtil from '@/util/util-js/requstUtil.js';
- import config from '@/common/config.js';
- import uniCountDown from '@/components/uni-count-down/uni-count-down.vue'
- import character from "@/components/electAni/character.vue"
- import fruit from "@/components/fruitMachine/fruitMachine.vue"
- import promptBox from "@/components/prompt-box/prompt-box.vue"
- import roundFab from "@/components/round-fab/round-fab.vue"
- import codeElfGuide from '@/components/code-elf-guide/code-elf-guide.vue'
- import boxingPost from "@/components/modal/boxing-post/boxing-post.vue"
- import boxingHit from "@/components/modal/boxing-hit/boxing-hit.vue"
- import actionHit from "@/components/modal/action-hit/action-hit.vue"
- import actionJump from "@/components/modal/action-jump/action-jump.vue"
- import AccAndOri from "@/util/util-js/AccAndOri.js"
- import AvatarConfig from "@/util/util-js/avatar.js"
- import HitEffect from "@/components/effectHit/hitEffect.vue"
- import HitFistEffect from "@/components/effectHit/hitFistEffect.vue"
- import ModalTip from "@/components/modal-tip/modalTip.vue"
- import keyboardListener from '@/components/keyboard-listener/keyboard-listener.vue'
- import LEDFont from '@/components/LEDFont/LEDFont.vue'
- import arcbarCountDown from '@/components/uni-count-down/uni-count-down.vue'
- import modalMask from '@/components/modal-mask/modal-mask.vue'
- // 获取 module
- // var testModule = uni.requireNativePlugin("MyAttitude")
- // const modal = uni.requireNativePlugin('modal');
- import {
- mapState,
- mapMutations
- } from 'vuex';
- var _self;
- var canvaArcbar1;
- export default {
- computed: mapState(['bCanvasShow', 'forcedLogin', 'hasLogin', 'userName', 'avatarUrl', 'days', 'remainingDays',
- 'signature', 'weight', 'height', 'planData', 'BLEDeviceShowList', 'BLEConnectDevice', 'bPlanExpired',
- 'bPlanFinish',
- 'bGuidePages',
- 'globalAcc', 'globalOri', 'DeviceBindingList', 'ConnectBindingDevice', 'cIndex', 'bNewGuide',
- 'localSportTime',
- 'currentModeIndex', 'oldArcbarProCalorie', 'oldArcbarAllCalorie', 'bOpenBluetooth', 'bOpenSuccess',
- 'bListenAdapterStateChange', 'bConnection', 'bVerifiedConnection', 'currentInstruction',
- 'instructionState',
- 'LocationGameUrl',
- 'bPhoneMatched',
- 'versionCodeState',
- 'platform',
- 'systemInfo', 'navHeight', 'tabbarHeight',
- 'cDiamond', 'cGold',
- 'finallySelectFriendInfo',
- 'currentJumpTask', 'singlePersonList', 'multiPersonList',
- 'guideUnlockState',
- 'sandbagHitCount',
- 'readDataName',
- 'filesList',
- 'readBLELight',
- 'hotmanData',
- 'hotmanIntelligentData',
- 'bIgnore'
- ]),
- components: {
- // uniNavBar,
- myPicker,
- sideBar,
- uniCountDown,
- character,
- fruit,
- roundFab,
- codeElfGuide,
- boxingPost,
- boxingHit,
- promptBox,
- HitEffect,
- HitFistEffect,
- ModalTip,
- keyboardListener,
- actionHit,
- actionJump,
- LEDFont,
- arcbarCountDown,
- modalMask
- },
- data() {
- return {
- title: 'pk模式', //pk模式 健身模式
- modalName: null,
- originalDate: '', //记录new date
- currentDate: '', //当前日期
- cWidthArcbar: '', //圆弧进度图
- cHeightArcbar: '', //圆弧进度图
- arcbarWidth: '', //圆弧进度图,进度条宽度,此设置可使各端宽度一致
- pixelRatio: 1,
- // textarea: '',
- // arcbarImagePath: '/static/logo.png',
- // cWidth: '',
- // cHeight: '',
- scrollviewHight: '',
- // 顶部区域部分
- topScrollHight: '',
- // 选择器
- pickerObj: {},
- // lineAImagePath: '/static/logo.png',
- // visible: true,
- // indicatorStyle: `height: ${Math.round(uni.getSystemInfoSync().screenWidth / (750 / 100))}px;`,
- //设备列表
- deviceList: [{
- name: '蹦床',
- icon: '/static/trampoline.png'
- }],
- cState: 1,
- //游戏列表
- gameList: [],
- //视频列表,现在视频是和游戏一起管理
- videoList: [],
- //运动数据
- sportData: {
- calorie: 0,
- hit: 0,
- miss: 0,
- percent: 0,
- time: 0,
- allData: 0
- },
- //设置滚动栏高度
- scrollTop: 0,
- //scroll view 跳转到对应的组件上
- toView: '',
- guideCurrent: 0,
- bHide: false,
- //屏幕抖动
- bEFHitShake: false,
- bStartBoxingPost: false,
- bStartCountDown: false,
- BoxingPostCountDownText: 3,
- b_countDown: null,
- countDownUrl: [
- "/static/personal/audio/GO.mp3",
- "/static/personal/audio/1.mp3",
- "/static/personal/audio/2.mp3",
- "/static/personal/audio/3.mp3"
- ],
- threeUrl: "/static/personal/audio/3.mp3",
- twoUrl: "/static/personal/audio/2.mp3",
- oneUrl: "/static/personal/audio/1.mp3",
- goUrl: "/static/personal/audio/GO.mp3",
- dangdang: "/static/personal/audio/dangdang.mp3",
- personalAudioContext: null,
- planTip: [
- '您今天的目标已经达成,是否进行自由训练.',
- '您今天的目标还没完成,是否结束训练.'
- ],
- planTipIndex: 0,
- //匹配的ai信息
- aiObj: {
- name: '匿名',
- avatar: '/static/defaultAvatar.png'
- },
- aiOldObj: {
- name: '匿名',
- avatar: '/static/defaultAvatar.png'
- },
- currentMode: 'calorieMode', //pkMode calorieMode
- bHitShake: false,
- bAiHitShake: false,
- //限制重连,比如去了对应硬件连接页面,限制这个页面的重连操作
- bLimitReconnection: false,
- /**
- * 首页这里连接了蓝牙,然后选择框回来后show会触发,触发时候检测一下是否有对应的
- * 匹配蓝牙
- */
- bGetBondTesting: false,
- basicsList: [{
- cuIcon: 'usefullfill',
- name: '开始',
- bLock: false,
- }, {
- cuIcon: 'radioboxfill',
- name: '等待',
- bLock: true,
- },
- {
- cuIcon: 'roundclosefill',
- name: '错误'
- }, {
- cuIcon: 'roundcheckfill',
- name: '完成'
- },
- {
- cuIcon: 'roundcheckfill',
- name: '完成'
- },
- {
- cuIcon: 'roundcheckfill',
- name: '完成'
- },
- ],
- basics: 3,
- currentTask: null, //当前选择的任务
- taskIntoView: '',
- taskScrollTop: 0,
- currentTaskList: [],
- nextTaskCanUnlock: false, //下一个关卡是否可解锁
- /**
- * actionJump 模块对应的交互参数
- */
- AJData: {
- allCount: 0,
- faultCount: 0,
- targetCount: 0,
- perCountDown: 0,
- gameCountDown: 0,
- //pk部分参数
- myScore: 0, //左边自己的分数
- otherScore: 0, //右边好友的分数
- myUsageTime: 0,
- otherUsageTime: 0,
- isLeftPlayer: true,
- isFinish: false,
- gameLimitTime: 0,
- describe: '', //关卡说明
- },
- defaultAJData: null,
- bGamePlaying: false,
- /**
- * 任务参数
- */
- modalHeight: 300,
- vLog: '',
- /**
- * 任务关卡相关
- */
- tempSelectedLevel: null,
- bShowComplete: false,
- /**
- * 记录一个旧的index
- */
- oldModeIndex: 1,
-
- checkbox: [{
- value: 'A',
- checked: true
- }],
- showMs:0,
- oldMs:0,
- };
- },
- onLoad() {
- //设置self
- _self = this;
- // 圆形进度条样式
- this.cWidthArcbar = uni.upx2px(415); //这里要与样式的宽高对应
- this.cHeightArcbar = uni.upx2px(440); //这里要与样式的宽高对应
- this.arcbarWidth = uni.upx2px(14);
- // 体重数据样式
- // this.cWidth = uni.upx2px(750);
- // this.cHeight = uni.upx2px(300);
- // #ifdef APP-PLUS || H5
- //监听
- uni.$on('updateArcbarData', this.updateArcbarData);
- // #endif
- //监听
- uni.$on('callbackCloseBLE', this.callbackCloseBLE);
- // uni.$on('callbackBLEState', this.callbackBLEState);
- //获得游戏列表
- // reqUtil
- // .requestData(config.URL.GAMERECOMMENDBYPLATFORM, {
- // recommendType: 2,
- // endTime: config.endTime
- // })
- // .then(
- // res => {
- // // console.log('GAMERECOMMEND =====', res);
- // if (res.code == 0) {
- // if (res.data.gameList.length > 3) {
- // this.gameList = this.gameList.concat(res.data.gameList.slice(0, 3));
- // } else {
- // this.gameList = this.gameList.concat(res.data.gameList);
- // }
- // }
- // },
- // e => {
- // console.log(e);
- // }
- // );
- //获得视频列表
- // reqUtil
- // .requestData(config.URL.GAMERECOMMENDBYPLATFORM, {
- // recommendType: 1,
- // endTime: config.endTime
- // })
- // .then(
- // res => {
- // if (res.code == 0) {
- // if (res.data.gameList.length > 3) {
- // this.videoList = this.videoList.concat(res.data.gameList.slice(0, 3));
- // } else {
- // this.videoList = this.videoList.concat(res.data.gameList);
- // }
- // }
- // },
- // e => {
- // console.log(e);
- // }
- // );
- //初始化后设置一下pickerObj
- this.pickerObj = {
- pickerLeftList: pickerData.getWeightList().leftList,
- pickerRightList: pickerData.getWeightList().rightList,
- pickerType: 'doubleItem',
- pickerUnit: '公斤',
- pickerTitle: '记体重',
- defaultValue: this.weight,
- showInput: true,
- };
- this.getPlanData(function() {
- // 如果个人页面直接获取数据
- _self.showArcbar();
- });
- this.personalAudioContext = uni.createInnerAudioContext();
- this.personalAudioContext.autoplay = false;
- this.personalAudioContext.src = this.dangdang;
- this.personalAudioContext.volume = 1;
- //获取本地记录的运动时间
- uni.getStorage({
- key: 'localSportTime',
- success: function(res) {
- // console.log("本地的时间:",res.data);
- _self.$store.state.localSportTime = res.data;
- }
- });
- //获取设备信息,上报服务器
- this.gOnAddClientInfo();
- this.registerPopupEvent();
- //获取任务数据
- this.getLevelList(() => {
- this.switchTaskInfo();
- });
- //钱包信息
- this.getUserWallets();
- //测试socket
- // console.log('test*******************************');
- // this.$testWS.connectSocket(()=>{
- // this.$testWS.sendSocketMessage('unity');
- // });
- //复制一个默认参数
- this.defaultAJData = Object.assign({}, this.AJData);
- //用户签到列表
- this.getSignInList();
- uni.$on("onLog", this.onLog);
- //人物列表变化处理监听
- uni.$on("onSwitchTaskList", this.onSwitchTaskList);
- //获取对应的用户数据,并且设置记录的打击数据
- this.getUserData_hitCount();
- //获取记录的数据
- this.onGetReadDataName();
- plus.globalEvent.addEventListener("onTestModuleUpdate", this.onTestModuleUpdateCallback);
- //初始化一个android数据
- this.jumpIdenModule_onJumpInit();
- //
- this.onGetReadBLELight();
-
- this.onGetHotmanIntelligentData();
- },
- onShow() {
- _self.bHide = false;
- if (canvaArcbar1)
- _self.updateArcbarData();
- //this.bConnection &&
- if (this.bVerifiedConnection && this.BLEConnectDevice) {
- this.updateBLECIndex();
- // setTimeout(() => {
- // /**
- // * 如果是首页连接,则检测
- // */
- // if (this.bGetBondTesting) {
- // this.onGetBondDevice();
- // this.bGetBondTesting = false;
- // }
- // }, 5000)
- }
- //如果是测试数据
- // if (this.ConnectBindingDevice) {
- // if (this.$refs.boxingPostRef) {
- // this.$refs.boxingPostRef.onSetMode('pkMode');
- // } else {
- // setTimeout(() => {
- // this.$refs.boxingPostRef.onSetMode('pkMode');
- // }, 500)
- // }
- // }
- console.log('personal show');
- this.bLimitReconnection = false;
- //测试环境检测,给个modal提示 active
- // if (config.active == 'dev') {
- // function thanDate(date2) {
- // var oDate1 = new Date();
- // console.log("检测日期", oDate1);
- // var oDate2 = new Date(date2);
- // if (oDate1.getTime() > oDate2.getTime()) {
- // return true;
- // } else {
- // return false;
- // }
- // }
- // if (thanDate('2021-05-31 13:10:36')) {
- // uni.showModal({
- // title: "提示",
- // content: "此版本为测试版本,有需要请和开发者联系。微信 sweetdontcry"
- // })
- // }
- // }
- // #ifdef APP-PLUS
- if (this.guideUnlockState.firstInstallation) {
- // 根据onshow 去调用first显示。 由于 onShow生命周期比 onReady 快。所以此时没有 注册 onShowFirstInstallation
- // 即 onShowFirstInstallation 是调用不到的
- uni.$emit("onShowFirstInstallation");
- }
- // #endif
- },
- onReady() {
- //限制开始点击播放
- setTimeout(() => {
- _self.bShowComplete = true;
- // console.log("=============>", _self.bShowComplete);
- }, 500)
- // 计算屏幕剩余高度 填补剩余高度
- // 计算组件的高度
- _self.scrollviewHight = this.systemInfo.windowHeight - this.navHeight - this.tabbarHeight - 10 - this
- .systemInfo
- .statusBarHeight;
- console.log("personal onReady");
- // #ifdef APP-PLUS
- //第一步提示设置计划,之后在回调registerPopupEvent 中处理
- //第一次安装登录。提示 计划,这里注册一次信息
- uni.$on("onShowFirstInstallation", this.onShowFirstInstallation);
- if (this.guideUnlockState.firstInstallation) {
- // 如果新安装便触发一次,新手调用
- uni.$emit("onShowFirstInstallation");
- }
- // #endif
- this.onConnectSocket();
- },
- onUnload() {
- console.log("personal ********* onUnload *********");
- uni.$off("onLog", this.onLog);
- //人物列表变化处理监听
- uni.$off("onSwitchTaskList", this.onSwitchTaskList);
- // #ifndef APP-PLUS||H5
- //监听
- console.log('移除监听');
- uni.$off('updateArcbarData', this.updateArcbarData);
- // #endif
- //*****注释蓝牙操作******
- uni.$off('callbackCloseBLE', this.callbackCloseBLE);
- // uni.$off('callbackBLEState', this.callbackBLEState);
- uni.$off('updateBLEDeviceData', this.callbackUpdateBLEData);
- //unload 时候清除timeout
- this.onUnloadCreateBLEConnectionTimeout();
- this.unregisterPopupEvent();
- uni.$off("onShowFirstInstallation", this.onShowFirstInstallation);
- this.onCloseSocket();
- },
- onHide() {
- _self.bHide = true;
- console.log("personal ******* onHide *******");
- //时间暂停 ,隐藏了 需要判断是否为空
- if (_self.$refs.countDownObj)
- _self.$refs.countDownObj.timePause('pause');
- //心电图暂停
- if (_self.$refs.electRef)
- _self.$refs.electRef.pausedElect(true);
- },
- methods: {
- ...mapMutations(['accountLogin', 'getPlanData', 'addlocalCalorie', 'setLocalCalorie', 'setShowCalorie',
- 'syncLocalDataToServer', 'syncRequestEvent', 'setLocalSportTime',
- 'initAdapter', 'onCreateBLEConnection', 'onUnloadCreateBLEConnectionTimeout', 'onCloseBLEConnection',
- 'gOnAddClientInfo', 'onWriteBLEConnectionValue',
- 'gCreateFilterObj', 'gUpdateFilter', 'B_GetBondedDevices', 'B_OpenBLESetting', 'B_OpenRopeSkipping',
- 'B_CloseRopeSkipping',
- 'gCreateSandbagAlgorithm', 'gUpdateSandbagAlgorithm', 'gIntelligentCreateSandbagAlgorithm',
- 'gIntelligentUpdateSandbagAlgorithm',
- 'gStartSimulateBLEUpdate',
- 'gStopSimulateBLEUpdate',
- 'getActionJumpTask',
- 'setActionJumpTask', 'getLevelList',
- 'getUserWallets', 'setGoldAndDiamond',
- 'onConvertDeviceData',
- 'showDrawerById', 'showPopupById', 'showGuideById',
- 'closeDrawerById', 'closePopupById', 'closeGuideById',
- 'getSignInList', 'onUserSignIn',
- 'setGuideUnlockState',
- 'resetActionJumpTask',
- 'getUserData_hitCount',
- 'uploadUserData_hitCount', 'getUserData_hitCount',
- 'addSandbagHitCount', , 'onConnectSocket', 'onCloseSocket', 'onSendSocketMessage',
- //算法相关START
- 'onGetReadDataName',
- 'onSetReadDataName',
- 'jumpIdenModule_SearchData',
- 'jumpIdenModule_DownloadReadData',
- 'jumpIdenModule_onJumpInit',
- 'jumpIdenModule_onJumpInitLocalData',
- 'jumpIdenModule_onJump6AxisDataUpdate',
- 'jumpIdenModule_onTestUpdate',
- 'jumpIdenModule_onTestJump6AxisDataUpdate',
- //算法相关END
- //灯光
- 'onHitOpenBLELight',
- 'onHitOpenBLELightNew',
- 'onGetReadBLELight',
- 'onSetReadBLELight',
- 'B_WriteHexToBLECharacteristic',
- 'onGetHotmanIntelligentData',
- 'onSaveHotmanIntelligentData'
- ]),
- BasicsSteps() {
- this.basics = this.basics == this.basicsList.length - 1 ? 0 : this.basics + 1
- },
- onLog(value) {
- this.vLog = value;
- },
- onKeyDown(e) {
- console.log(e);
- },
- showClickEvent() {
- // #ifdef APP-PLUS
- this.showDrawer();
- // #endif
- // #ifdef H5 || MP-WEIXIN
- this.$refs.sideBar.showModal();
- this.$store.state.bCanvasShow = false;
- // #endif
- },
- showModal(e) {
- if (e.currentTarget.dataset.target == "slideUpModal" && this.bGamePlaying) {
- /**
- * 判断下游戏是否进行中,进行中不能切换
- */
- uni.showToast({
- title: '游戏进行中,不能选择关卡。',
- icon: 'none',
- mask: true
- })
- return;
- }
- this.modalName = e.currentTarget.dataset.target;
- this.$store.state.bCanvasShow = false;
- if (this.modalName == "slideUpModal") {
- this.updateTaskScroll();
- this.switchTaskInfo();
- }
- },
- hideModal(e) {
- if (this.modalName == "sportCompletion") {
- console.log("关闭卡片");
- this.sportData = {
- calorie: 0,
- hit: 0,
- miss: 0,
- percent: 0,
- time: 0,
- allData: 0,
- }
- } else if (this.modalName == "slideUpModal") {
- this.tempSelectedLevel = this.currentJumpTask;
- }
- this.modalName = null;
- this.$store.state.bCanvasShow = true;
- },
- onTestAddLocalCalorie() {
- let _add = (10 * 1.875) / (4 * 30);
- console.log(_add);
- this.onUpdateCaloriePlane(10);
- },
- /**
- * 首页圆形表部分时间计时器
- */
- arcbarCountDownTimeUp() {
- //todo,涉及到倒计时的关卡。时间到。游戏结束
- if (0 === this.currentModeIndex) {
- if (this.currentMode == "pkMode") {
- this.$refs.actionHitRef.onPKModeGameOver("timeUp");
- } else {
- uni.showToast({
- title: '时间到,游戏结束。',
- icon: 'none',
- duration: 2000,
- mask: true
- })
- this.$refs.actionHitRef.onGameOver("timeUp");
- }
- } else if (1 === this.currentModeIndex) {
- if (this.currentMode == "pkMode") {
- this.$refs.actionJumpRef.onPKModeGameOver("timeUp");
- } else {
- uni.showToast({
- title: '时间到,游戏结束。',
- icon: 'none',
- duration: 2000,
- mask: true
- })
- this.$refs.actionJumpRef.onGameOver("timeUp");
- }
- }
- },
- arcbarCountDownTimeUpdate(data) {
- this.AJData.gameCountDown = data.curSeconds;
- this.updateArcbarDataFromActionJump();
- this.onActionJumpCountDownUpdate();
- },
- arcbarCountDownTimeReset() {
- //清除时间计时器
- this.$refs.arcbarCountDownRef.timePause();
- },
- arcbarCountDownPlay(bResetTime) {
- if (bResetTime) {
- this.$refs.arcbarCountDownRef.startData();
- }
- this.$refs.arcbarCountDownRef.timePlay();
- },
- // 进度条数据
- arcbarData(_planData) {
- let showCal = 0,
- showLCal = 0,
- LCalTip = '',
- showTip = '';
- let series = [{
- name: showTip,
- data: 0,
- color: '#2fc25b'
- }];
- //这里区分进度条数据
- if (1 == this.currentModeIndex || 0 == this.currentModeIndex) {
- showCal = _planData.calorie;
- showLCal = _planData.allCalorie;
- LCalTip = '大卡';
- showTip = '(未达标)';
- // 如果运动的卡路里大于目标卡路里,设置为目标卡路里值,即为Max
- if (showLCal >= showCal) {
- showTip = '(达标)';
- }
- series = [{
- name: showTip,
- data: this.AJData.gameCountDown == 0 ? 0 : this.AJData.gameCountDown / this.AJData
- .gameLimitTime,
- color: '#2fc25b'
- }];
- }
- return {
- showCal,
- showLCal,
- LCalTip,
- showTip,
- series
- }
- },
- // 圆形进度条
- showArcbar() {
- let {
- showCal,
- showLCal,
- LCalTip,
- series
- } = this.arcbarData(_self.planData);
- // console.log("series==", series[0]);
- canvaArcbar1 = new uCharts({
- $this: _self,
- canvasId: 'canvasArcbar',
- type: 'myGradualChangeArcbar',
- fontSize: 11,
- legend: {
- show: false
- },
- background: '#FFFFFF',
- pixelRatio: 1,
- series: series,
- animation: false,
- width: _self.cWidthArcbar,
- height: _self.cHeightArcbar,
- dataLabel: true,
- // Math.round(chartData.series[0].data * 100) + '%'
- // title: {
- // // arcbarDate: date.formatDate(_self.originalDate),
- // name: showLCal,
- // molecularUnit: LCalTip, //单位的分子部分
- // denominatorUnit: showCal, //单位的分母部分
- // unitFontSize: 11, //单位字符大小
- // color: 'rgba(255, 255, 255, 1)',
- // fontSize: 28,
- // offsetX: -30,
- // offsetY: 10
- // },
- // subtitle: {
- // name: series[0].name,
- // color: 'rgba(255, 255, 255, 1)',
- // fontSize: 13,
- // offsetY: -75
- // },
- extra: {
- arcbar: {
- type: 'default',
- backgroundColor: 'rgba(234, 234, 255, 1)',
- backgroundEndColor: 'rgba(234, 234, 255, 1)',
- backgroundMiddle: '#9291FF', //'rgba(158, 158, 255, 1)',
- width: _self.arcbarWidth, //圆弧的宽度
- lineColor: '#51EDFE',
- lineEndColor: '#F7C75D'
- }
- }
- });
- // 更新位置同步
- this.syncLocalDataToServer((res) => {
- this.originalDate = res.newDate;
- this.currentDate = date.formatTime(res.newDate);
- this.updateArcbarData();
- });
- },
- updateArcbarData(data) {
- let {
- showCal,
- showLCal,
- LCalTip,
- series
- } = _self.arcbarData(_self.planData);
- if (showCal == _self.oldArcbarProCalorie && showLCal == _self.oldArcbarAllCalorie) {
- // console.log("没有改变值,不刷新表盘:", showCal, _self.oldArcbarProCalorie, showLCal, _self.oldArcbarAllCalorie);
- return;
- }
- //这个是显示当前的总卡路里
- _self.$store.state.oldArcbarAllCalorie = showLCal;
- //这个是计划的卡路里
- _self.$store.state.oldArcbarProCalorie = showCal;
- canvaArcbar1.updateData({
- series: series
- });
- },
- updateArcbarDataFromActionJump(data) {
- let {
- showCal,
- showLCal,
- LCalTip,
- series
- } = _self.arcbarData(_self.planData);
- canvaArcbar1.updateData({
- series: series
- });
- },
- //没有限制下的更新表盘
- updateNoLimit() {
- let {
- showCal,
- showLCal,
- LCalTip,
- series
- } = _self.arcbarData(_self.planData);
- //这个是显示当前的总卡路里
- _self.$store.state.oldArcbarAllCalorie = showLCal;
- //这个是计划的卡路里
- _self.$store.state.oldArcbarProCalorie = showCal;
- canvaArcbar1.updateData({
- series: series
- });
- },
- // 跳转计划页面
- openPlan(e) {
- uni.navigateTo({
- url: '../plan/plan?newsid=' + 11,
- success: res => {},
- fail: () => {},
- complete: () => {}
- });
- },
- // 跳转转换页面
- onNavConver() {
- uni.reLaunch({
- url: '../../conversion-page/conversion/conversion',
- success: res => {},
- fail: () => {},
- complete: () => {}
- });
- },
- // 跳转我的页面
- onNavMyPage() {
- uni.navigateTo({
- url: '../../my-page/homepage/homepage',
- success: res => {},
- fail: () => {},
- complete: () => {}
- });
- },
- updateBLECIndex() {
- for (let i = 0; i < this.BLEDeviceShowList.length; i++) {
- let eq = this.BLEDeviceShowList[i];
- if ((eq.ename.indexOf("mobilePhoneBandage") > -1 && this.BLEConnectDevice.id == 0) ||
- (eq.ename.indexOf("hotman") > -1 && this.BLEConnectDevice.id == 1) ||
- (eq.ename.indexOf("BLEHandle") > -1 && this.BLEConnectDevice.id == 2) ||
- (eq.ename.indexOf("rope") > -1 && this.BLEConnectDevice.id == 3) ||
- (eq.ename.indexOf("intelligent") > -1 && this.BLEConnectDevice.id == 4)) {
- eq.bRatio = true;
- this.$store.state.cIndex = i;
- }
- if (eq.ename.indexOf("hotman") > -1 && this.BLEConnectDevice.id == 1) {
- // if (this.$refs.boxingPostRef) {
- // this.$refs.boxingPostRef.onSetMode('pkMode');
- // } else {
- // setTimeout(() => {
- // this.$refs.boxingPostRef.onSetMode('pkMode');
- // }, 500)
- // }
- } else if (eq.ename.indexOf("BLEHandle") > -1 && this.BLEConnectDevice.id == 2) {
- if (this.$refs.boxingPostRef) {
- this.$refs.boxingPostRef.onSetMode('calorieMode');
- } else {
- setTimeout(() => {
- this.$refs.boxingPostRef.onSetMode('calorieMode');
- }, 500)
- }
- } else if (eq.ename.indexOf("rope") > -1 && this.BLEConnectDevice.id == 3) {
- //todo 暂时设置兼容跑步模式
- // if (this.$refs.boxingPostRef) {
- // this.$refs.boxingPostRef.onSetMode('ropeMode');
- // } else {
- // setTimeout(() => {
- // this.$refs.boxingPostRef.onSetMode('ropeMode');
- // }, 500)
- // }
- } else if (eq.ename.indexOf("intelligent") > -1 && this.BLEConnectDevice.id == 4) {
- }
- }
- },
- /**
- * 蓝牙断开连接时候
- */
- callbackCloseBLE() {
- // if (0 == this.currentModeIndex) {
- // //蓝牙断开连接后,直接关闭
- // this.$refs.boxingPostRef.onCloseDevices();
- // }
- },
- //蓝牙状态回调
- callbackBLEState(res) {
- console.log("callbackBLEState==", res);
- if (this.cState != res.state) this.cState = res.state;
- },
- //设备回调事件
- callbackUpdateBLEData(data) {
- //如果在监听状态时候隐藏页面,返回
- if (_self.bHide) return;
- //连接了手柄模式
- //没有开启指令不刷新
- if (!this.instructionState.bOpen) return;
- if (this.BLEConnectDevice.usageMode == "hotman") {
- if (this.BLEConnectDevice.deviceType == "BLEIntelligent") {
- this.showMs = data.ms - this.oldMs;
- this.oldMs = data.ms;
- this.gIntelligentUpdateSandbagAlgorithm({
- data: data,
- callback: (res) => {
- if (res.type == 'hit') {
- this.$refs.actionHitRef.onBLEHitUpdate(res);
- }
- }
- });
- } else {
- this.gUpdateSandbagAlgorithm({
- data: data,
- callback: (res) => {
- if (res.type == 'hit') {
- this.$refs.actionHitRef.onBLEHitUpdate(res);
- }
- }
- });
- }
- } else if (this.BLEConnectDevice.usageMode == "general") {
- //这个是普通打击模式
- this.$refs.boxingPostRef.onBLEHandleUpdate(data);
- } else if (this.BLEConnectDevice.usageMode == "ropeSkipping") {
- this.$refs.actionJumpRef.onBLERopeUpdate(data);
- }
- },
- /**
- * 检测获取匹配的设备
- */
- onGetBondDevice() {
- /**
- * 假如手机没有匹配,断开连接
- */
- console.log("****", this.BLEConnectDevice);
- if (!this.BLEConnectDevice) return;
- this.B_GetBondedDevices({
- deviceId: this.BLEConnectDevice.deviceId,
- success: (bondedDevice) => {
- // console.error("===========", bondedDevice);
- // uni.hideToast();
- if (bondedDevice == null) {
- // if (plus.os.name == 'Android')
- {
- //此问题 华为手机容易出现
- //android手机已配对的设备 不存在,但是app 又直接连接成功了。提示,并且断开app连接
- //1.关闭当前连接
- this.onCloseBLEConnection({
- getSuccess: () => {}
- });
- uni.hideToast();
- //2.跳转蓝牙设置
- uni.showModal({
- title: '蓝牙配对失败',
- content: '请跳转后点击配对BGBox_2020,成功后手动跳转回哔蹦重新连接。',
- success: (res) => {
- if (res.confirm) {
- this.B_OpenBLESetting();
- }
- }
- })
- }
- }
- }
- });
- },
- openDeviceList(e) {
- if (this.ConnectBindingDevice) {
- uni.showToast({
- title: '当前已开启数据',
- icon: 'none',
- mask: true
- })
- return;
- }
- //先判断蓝牙是否初始化
- /**
- * 蓝牙部分操作,转全局变量操作
- * */
- // console.log("openDeviceList bOpenBluetooth", this.bOpenBluetooth);
- // #ifdef APP-PLUS
- if (!this.bOpenBluetooth) {
- this.initAdapter(() => {
- uni.navigateTo({
- // url: '../devices-category/devices-category',
- url: '../devices-hardware/devices-hardware',
- success: res => {
- this.bLimitReconnection = true;
- },
- fail: () => {},
- complete: () => {}
- });
- });
- return;
- }
- // #endif
- uni.navigateTo({
- url: '../devices-hardware/devices-hardware',
- success: res => {
- this.bLimitReconnection = true;
- },
- fail: () => {},
- complete: () => {}
- });
- },
- onNavToMore() {
- uni.navigateTo({
- url: '../more/more?index=' + this.cIndex,
- success: res => {},
- fail: () => {},
- complete: () => {}
- });
- },
- onAddDevice() {
- let deviceItem = {
- name: '蹦床',
- icon: '/static/trampoline.png'
- };
- if (this.deviceList.length != 0) {
- this.deviceList = this.deviceList.concat(deviceItem);
- } else {
- this.deviceList = deviceItem;
- }
- },
- onCloseDevice(item, e) {
- //如果不是连接状态,则删除
- if (e.currentTarget.dataset.index != this.cIndex) {
- if (this.cIndex != -1) {
- uni.showToast({
- icon: 'none',
- title: "请先断开已连接设备",
- duration: 2000,
- mask: true
- })
- return;
- }
- uni.showModal({
- title: '设备状态',
- content: '是否删除设备?',
- ConfirmColor: '#A488DC',
- success: res => {
- if (res.confirm) {
- this.$store.commit('deleteBLEDevice', e.currentTarget.dataset.index);
- }
- }
- });
- return;
- }
- uni.showModal({
- title: '设备状态',
- content: '是否断开连接?',
- /**
- * 如果需要强制,不显示取消按钮
- */
- showCancel: true,
- ConfirmColor: '#A488DC',
- success: res => {
- if (res.confirm) {
- this.onCloseBLEConnection({
- getSuccess: () => {}
- });
- }
- }
- });
- },
- onNavDetail(item) {
- console.log(item);
- let temItem = encodeURIComponent(JSON.stringify(item));
- // return;
- uni.navigateTo({
- url: '../../game-page/game-detail/game-detail?item=' + temItem
- });
- },
- onNavToGameMore(e) {
- uni.reLaunch({
- url: '../../game-page/game/game?type=' + e.currentTarget.dataset.type
- });
- },
- //判断是否有其他限制
- onStartCheck(data) {
- //#ifdef H5
- // 直接走测试,如果是h5 APP-PLUS
- if (0 === this.currentModeIndex) {
- // this.onBoxingGuideFinish();
- if (this.currentJumpTask == null) {
- uni.showToast({
- title: '先选一个挑战关卡',
- icon: 'none',
- duration: 2000,
- })
- return;
- }
- if (this.currentMode == 'pkMode' && this.finallySelectFriendInfo == null) {
- uni.showToast({
- title: '选择一个pk好友',
- icon: 'none',
- duration: 2000,
- })
- return;
- }
- //调用开始
- this.onActionHitPlay();
- } else if (1 === this.currentModeIndex) {
- if (this.currentJumpTask == null) {
- uni.showToast({
- title: '先选一个挑战关卡',
- icon: 'none',
- duration: 2000,
- })
- return;
- }
- if (this.currentMode == 'pkMode' && this.finallySelectFriendInfo == null) {
- uni.showToast({
- title: '选择一个pk好友',
- icon: 'none',
- duration: 2000,
- })
- return;
- }
- //调用开始
- this.onActionJumpPlay();
- }
- return;
- //#endif
- //跳和拳击进入
- if (1 === this.currentModeIndex || 0 === this.currentModeIndex) {
- //2.检测是否连接设备 || this.BLEConnectDevice.ename !== 'BT04'
- if (this.cIndex == -1) {
- this.onGetBluetoothConnectView({
- hiddenType: 'none'
- });
- return;
- }
- }
- //3.检测一下计划日期
- console.log("remainingDays == >", this.planData, this.remainingDays);
- if (date.formatDate(new Date()) > this.planData.endTime || this.remainingDays == 0) {
- if (!this.$store.state.bPlanExpired) {
- this.$store.state.bPlanExpired = true;
- setTimeout(() => {
- this.$store.state.bPlanExpired = false;
- }, 3000)
- uni.showModal({
- title: '提醒',
- content: '计划到期,请制定新计划。',
- confirmText: '去制定',
- success: (res) => {
- if (res.confirm) {
- uni.switchTab({
- url: "../plan/plan"
- })
- }
- }
- })
- }
- return;
- }
- if (1 == this.currentModeIndex || 0 === this.currentModeIndex) {
- if (data) {
- let {
- bStartCountDown
- } = data;
- this.bStartCountDown = bStartCountDown;
- }
- if (this.bStartCountDown) {
- this.BoxingPostCountDownText = 3;
- this.b_countDown = setInterval(() => {
- if (this.BoxingPostCountDownText <= 1) {
- if (this.b_countDown) {
- clearInterval(this.b_countDown);
- this.b_countDown = null;
- }
- setTimeout(() => {
- this.personalAudioContext.stop();
- this.personalAudioContext.play();
- //倒计时结束后开始游戏
- //初始化一个沙袋打击对象
- if (this.BLEConnectDevice.usageMode == "hotman") {
- if (this.BLEConnectDevice.deviceType == "BLEIntelligent") {
- this.gIntelligentCreateSandbagAlgorithm();
- } else {
- this.gCreateSandbagAlgorithm();
- }
- }
- if (this.BLEConnectDevice.usageMode == "ropeSkipping" ||
- this.BLEConnectDevice.usageMode == "hotman") {
- //打开跳绳模式
- // this.B_OpenRopeSkipping();
- this.onWriteBLEConnectionValue({
- value: "3"
- });
- }
- //监听蓝牙回调
- uni.$on('updateBLEDeviceData', this.callbackUpdateBLEData);
- //调用开始
- if (0 === this.currentModeIndex) {
- //调用开始
- this.onActionHitPlay();
- } else if (1 === this.currentModeIndex) {
- //调用开始
- this.onActionJumpPlay();
- }
- this.bStartCountDown = false;
- }, 800)
- return;
- }
- this.BoxingPostCountDownText--;
- }, 1000)
- } else {
- if (this.BLEConnectDevice.usageMode == "ropeSkipping" ||
- this.BLEConnectDevice.usageMode == "hotman") {
- //打开跳绳模式
- // this.B_OpenRopeSkipping();
- this.onWriteBLEConnectionValue({
- value: "3"
- });
- }
- //监听蓝牙回调
- uni.$on('updateBLEDeviceData', this.callbackUpdateBLEData);
- //调用开始
- if (0 === this.currentModeIndex) {
- //调用开始
- this.onActionHitPlay();
- } else if (1 === this.currentModeIndex) {
- //调用开始
- this.onActionJumpPlay();
- }
- }
- }
- },
- onShowBoxingHitTip() {
- this.$store.state.bGuidePages = true;
- this.guideCurrent = 5;
- this.toView = "boxingHitID";
- this.$store.state.bNewGuide = false;
- },
- //检测是否符合要求,没有的话进行新手提示
- onPersonalCheck(data) {
- if (!this.bShowComplete) {
- console.log('不要点击这么快!!');
- return;
- } else {
- console.error('点击!!');
- }
- this.bShowComplete = false;
- // #ifdef APP-PLUS
- if (1 === this.currentModeIndex || 0 === this.currentModeIndex) {
- if (this.currentJumpTask == null) {
- this.onTipLevel({
- hiddenType: 'normal'
- });
- if (this.guideUnlockState.firstPromptSelectLevel) {
- // this.onTipLevel();
- let guideUnlockState = Object.assign(this.guideUnlockState, {
- firstPromptSelectLevel: false
- });
- this.setGuideUnlockState(guideUnlockState);
- }
- this.bShowComplete = true;
- return;
- }
- if (this.currentMode == 'pkMode' && this.finallySelectFriendInfo == null) {
- //todo 这里没处理 新手提示
- uni.showToast({
- title: '选择一个pk好友',
- icon: 'none',
- duration: 2000,
- })
- this.bShowComplete = true;
- return;
- }
- if (1 === this.currentModeIndex) {
- let _item = this.currentJumpTask.item;
- //第一次选择关卡时候判断
- if (this.guideUnlockState.firstUnlockJumpUp && _item.id == 1) {
- this.showGuide('level-game-tip', {
- levelType: 'midJump',
- hiddenType: 'firstUnlockJumpUp'
- })
- let guideUnlockState = Object.assign(this.guideUnlockState, {
- firstUnlockJumpUp: false
- });
- this.setGuideUnlockState(guideUnlockState);
- return;
- } else if (this.guideUnlockState.firstUnlockLeftAndRightJump && _item.id == 6) {
- this.showGuide('level-game-tip', {
- levelType: 'directionJump',
- hiddenType: 'firstUnlockLeftAndRightJump'
- })
- let guideUnlockState = Object.assign(this.guideUnlockState, {
- firstUnlockLeftAndRightJump: false
- });
- this.setGuideUnlockState(guideUnlockState);
- return;
- } else if (this.guideUnlockState.firstUnlockLeftAndRightRotationJump && _item.id == 9) {
- this.showGuide('level-game-tip', {
- levelType: 'rotationJump',
- hiddenType: 'firstUnlockLeftAndRightRotationJump'
- })
- let guideUnlockState = Object.assign(this.guideUnlockState, {
- firstUnlockLeftAndRightRotationJump: false
- });
- this.setGuideUnlockState(guideUnlockState);
- return;
- }
- }
- }
- // #endif
- //如果上面没有guide弹出
- this.bShowComplete = true;
- this.onStartCheck(data);
- },
- //
- onBoxingGuideFinish() {
- if (this.b_countDown) {
- clearInterval(this.b_countDown);
- this.b_countDown = null;
- }
- //|| this.currentMode == 'ropeMode'
- if (this.currentMode == 'calorieMode') {
- this.personalAudioContext.stop();
- this.personalAudioContext.play();
- setTimeout(() => {
- this.$refs.boxingPostRef.onBoxingPostPlay(true);
- }, 600);
- } else {
- this.BoxingPostCountDownText = 3;
- this.$refs.boxingPostRef.onSetRingAnimation(true);
- uni.showToast({
- title: '匹配中...',
- mask: true,
- icon: 'loading',
- duration: 2000
- })
- setTimeout(() => {
- //ai信息
- this.onGetAiRandom();
- // this.b_countDown = setInterval(() => {
- // if (this.BoxingPostCountDownText <= 1) {
- // if (this.b_countDown) {
- // clearInterval(this.b_countDown);
- // this.b_countDown = null;
- // }
- // setTimeout(() => {
- // this.personalAudioContext.stop();
- // this.personalAudioContext.play();
- // this.$refs.boxingPostRef.onBoxingPostPlay(true);
- // this.$refs.boxingPostRef.onSetRingAnimation(false);
- // uni.hideToast();
- // }, 800)
- // }
- // this.BoxingPostCountDownText--;
- // }, 1000)
- setTimeout(() => {
- this.personalAudioContext.stop();
- this.personalAudioContext.play();
- this.$refs.boxingPostRef.onBoxingPostPlay(true);
- this.$refs.boxingPostRef.onSetRingAnimation(false);
- uni.hideToast();
- }, 800)
- }, 2000);
- }
- },
- //运动时间
- onUpdateSportTime(res) {
- // console.log("同步的运动时间",res);
- this.setLocalSportTime(res);
- },
- //更新运动数据
- onUpdateCaloriePlane(data) {
- // 记录卡路里到本地
- this.addlocalCalorie(data);
- this.updateArcbarData();
- },
- onRoundTrigger(data) {
- // console.log("onRoundTrigger==", data);
- // return;
- let url = '';
- switch (data.item.type) {
- case "personal":
- //个人中心页面
- url = '../../personal-page/personal/personal';
- break;
- case "game":
- url = '../../game-page/game/game';
- break;
- default:
- url = '../../personal-page/personal/personal';
- break;
- }
- uni.reLaunch({
- url: url,
- success: res => {},
- fail: () => {},
- complete: () => {}
- });
- },
- /**
- * 同步本地数据到服务器
- */
- onSyncData() {
- this.syncRequestEvent({
- success: () => {
- this.updateArcbarData();
- }
- });
- // 更新显示日期
- this.originalDate = new Date();
- this.currentDate = date.formatTime(this.originalDate);
- },
- hidePlanTipModal() {
- this.modalName = null;
- if (this.planTipIndex === 1) {
- // 您今天的目标还没完成 是否结束训练
- this.onActionPause(false);
- }
- },
- confirmPlanTipModal() {
- this.modalName = null;
- if (this.planTipIndex === 0) {
- this.onStartCheck()
- } else if (this.planTipIndex === 1) {
- // 您今天的目标还没完成 是否结束训练
- this.onActionPause(true);
- }
- },
- //断开连接时候,关闭
- onCloseBoxingHit() {
- console.log('关闭训练');
- if (this.currentMode == 'pkMode') {
- this.$refs.hitEffectRef.onStop();
- }
- this.onActionPause(true);
- },
- //点击暂停时候,判断一下是否完成目标
- onActionControlPlay(bPlay) {
- if (!bPlay) {
- //跳模块的情况下,暂停计时器
- if (1 == this.currentModeIndex || 0 == this.currentModeIndex)
- this.arcbarCountDownTimeReset();
- if (this.planData.allCalorie < this.planData.calorie) {
- this.modalName = 'showPlanTipModal';
- this.planTipIndex = 1;
- } else {
- //假如完成了目标,更新卡路里
- this.onActionPause(true);
- }
- }
- },
- /**
- * 切换体验模式
- * @param {Object} data
- */
- onModeEvent(data) {
- console.log("当前模式:", data);
- this.currentMode = data.mode;
- this.title = data.name;
- // || this.currentMode == 'ropeMode'
- if (this.currentMode == 'calorieMode') {
- setTimeout(() => {
- this.updateNoLimit();
- }, 0)
- }
- },
- onAiHitEvent(bloodPoint) {
- // this.onPlay({
- // bloodPoint: num,
- // createType: 'red',
- // callback: (res) => {
- // console.log("红色拳头击中对方:", res);
- // }
- // });
- this.$refs.hitFistRef.onPlay({
- bloodPoint: bloodPoint,
- createType: 'red',
- callback: () => {
- if (this.bAiHitShake) return;
- this.bAiHitShake = true;
- this.$refs.aiHitEffectRef.onPlay();
- this.$refs.aiHitEffectRef.onAIHit();
- setTimeout(() => {
- this.bAiHitShake = false;
- }, 500)
- }
- });
- },
- //打击时候头像修改
- onHitEvent(bloodPoint) {
- // console.log("this.bHitShake:",this.bHitShake);
- this.$refs.hitFistRef.onPlay({
- bloodPoint: bloodPoint,
- createType: 'blue',
- callback: () => {
- if (this.bHitShake) return;
- this.bHitShake = true;
- this.$refs.hitEffectRef.onPlay();
- this.$refs.hitEffectRef.onMyHit();
- setTimeout(() => {
- this.bHitShake = false;
- }, 500)
- }
- }
- );
- },
- //弹出目标提示后,进行下一步
- onActionPause(bFinish) {
- if (bFinish) {
- if (this.ConnectBindingDevice) {
- this.gStopSimulateBLEUpdate();
- uni.$off('updateBLEDeviceData', this.callbackUpdateBLEData);
- } else {
- if (0 === this.currentModeIndex) {
- if (this.currentMode == "calorieMode") {
- this.$refs.actionHitRef.onGameOver("none");
- } else {
- this.$refs.actionHitRef.onPKModeGameOver("none");
- }
- } else if (1 === this.currentModeIndex) {
- //todo actionJump
- if (this.currentMode == "calorieMode") {
- this.$refs.actionJumpRef.onGameOver("none");
- } else {
- this.$refs.actionJumpRef.onPKModeGameOver("none");
- }
- }
- }
- if (1 === this.currentModeIndex) {
- if (this.currentMode == "calorieMode") {
- this.syncRequestEvent({
- success: () => {
- this.updateArcbarData();
- }
- });
- }
- } else {
- this.syncRequestEvent({
- success: () => {
- this.updateArcbarData();
- }
- });
- }
- } else {
- //如果不是,继续调用播放
- if (0 === this.currentModeIndex) {
- // this.$refs.boxingPostRef.onBoxingPostPlay(true);
- this.$refs.actionHitRef.onContinueGame();
- if (0 !== this.currentJumpTask.item.limitTime) {
- //0默认不限时,所以限时的才走计时间
- this.arcbarCountDownPlay(false);
- }
- } else if (1 === this.currentModeIndex) {
- //actionJump
- this.$refs.actionJumpRef.onContinueGame();
- if (0 !== this.currentJumpTask.item.limitTime) {
- //0默认不限时,所以限时的才走计时间
- this.arcbarCountDownPlay(false);
- }
- }
- }
- },
- guideHide(e) {
- this.$store.state.bGuidePages = false;
- if (e.current == 0 && !e.onlyHide) {
- //跳转计划页面
- this.openPlan();
- } else if (e.current == 1 && !e.onlyHide) {
- console.log('guideHide:', e.current);
- //跳转搜索设备页面
- // this.openDeviceList();
- } else if (e.current == 3 && !e.onlyHide) {
- // 跳转连接蓝牙页面
- this.openDeviceList();
- } else if (e.current == 5 && !e.onlyHide) {
- console.log("==:", e);
- //todo 跳绳模式 新手引导
- if (this.BLEConnectDevice.usageMode == "ropeSkipping") {
- this.B_OpenRopeSkipping();
- } else {
- //初始化filter快速打击对象
- if (this.BLEConnectDevice.usageMode == "hotman") {
- this.gCreateFilterObj();
- }
- //打开加速计
- this.onWriteBLEConnectionValue({
- value: "3"
- });
- // setTimeout(() => {
- // //设置加速计b:20ms a:10ms
- // this.onWriteBLEConnectionValue({
- // value: config.refreshRate
- // });
- // }, 1000)
- }
- //监听蓝牙回调
- uni.$on('updateBLEDeviceData', this.callbackUpdateBLEData);
- this.onBoxingGuideFinish();
- }
- },
- mainScroll(e) {
- if (_self.toView == "boxingHitID") {
- _self.toView = "";
- // let view = uni.createSelectorQuery().select('#boxingHitID');
- // view.boundingClientRect(data => {
- // _self.$refs.codeElfGuide.setModalObj(data);
- // console.log(data);
- // }).exec();
- } else if (_self.toView == "openAccGyroView") {
- _self.toView = "";
- }
- },
- onGetActionJumpView() {
- this.$nextTick(() => {
- this.toView = "actionJumpID"
- });
- this.toView = '' //不清空再次跳到锚点位置会不起作用
- setTimeout(() => {
- _self.$refs.actionJumpRef.onGetActionJumpPlayView((data) => {
- console.log(JSON.stringify(data));
- // #ifdef APP-PLUS
- _self.showGuide('actionJumpPlay', data);
- // #endif
- });
- }, 200)
- },
- onGetBluetoothConnectView(initData) {
- _self.$refs.roundFabRef.onGetRoundFabView((data) => {
- console.log(JSON.stringify(data), initData.firstInstallation);
- // #ifdef APP-PLUS
- let temp = Object.assign({}, data, initData);
- console.log('当前的temp:', temp);
- _self.showGuide('bluetoothConnect', temp);
- // #endif
- });
- // let view = uni.createSelectorQuery().select('#roundFabID');
- // view.boundingClientRect(data => {
- // console.log(JSON.stringify(data));
- // // #ifdef APP-PLUS
- // _self.showGuide('bluetoothConnect', data);
- // // #endif
- // }).exec();
- },
- //拳击模块的回调
- boxingUpdateCalorie(calorie) {
- if (this.currentMode != 'pkMode') {
- //这里调用一下设置可以播放音效
- this.$refs.personalFruitRef.onCanPlay();
- }
- this.onUpdateCaloriePlane(calorie);
- },
- //扫码添加设备
- openQRCode(callback) {
- let that = this;
- // 允许从相机和相册扫码
- uni.scanCode({
- success: function(res) {
- // console.log('条码类型:' + res.scanType);
- // console.log('条码内容:' + res.result);
- let obj = JSON.parse(res.result)
- let data = {
- type: obj.type,
- uuid: obj.uuid,
- }
- }
- });
- },
- //屏幕抖动
- onScreenShake() {
- this.bEFHitShake = true;
- setTimeout(() => {
- this.bEFHitShake = false;
- }, 500)
- },
- onGetAiRandom() {
- let _self = this;
- let avatarlist = AvatarConfig.getAvatarList().avatarList;
- let _length = avatarlist.length;
- let _index = Math.floor(Math.random() * _length);
- console.log(avatarlist);
- _self.aiObj.name = avatarlist[_index].name;
- _self.aiObj.avatar = avatarlist[_index].url;
- },
- onBoxingGameOver(res) {
- this.$refs.hitEffectRef.onStop();
- this.onActionPause(true);
- //拳击柱部分
- uni.$off('updateBLEDeviceData', this.callbackUpdateBLEData);
- let _title = res.myWin ? "胜利" : "失败";
- let _context = res.myWin ? "你已经赢得PK胜利!" : "你在PK中被打败了!";
- this.modalName = "showModalTip"
- this.$refs.modalTipRef.setShowData({
- title: _title,
- context: _context,
- operationItem: null
- });
- },
- onModalTipHide() {
- this.modalName = null;
- },
- onModalTipConfirm(data) {
- let {
- type,
- operationItem
- } = data;
- this.modalName = null;
- //再来一局
- //提示过关奖励
- console.log('onModalTipConfirm', type, operationItem);
- if (type == 'PASSTHELEVEL') {
- this.showPopup('levelReward', operationItem);
- }
- },
- onTestShare() {
- uni.share({
- provider: "weixin",
- scene: "WXSenceTimeline",
- type: 2,
- imageUrl: "https://img-cdn-qiniu.dcloud.net.cn/uniapp/images/uni@2x.png",
- success: function(res) {
- console.log("success:" + JSON.stringify(res));
- },
- fail: function(err) {
- console.log("fail:" + JSON.stringify(err));
- }
- });
- },
- openAcc() {
- if (!this.globalAcc) {
- AccAndOri.bindAcc((accId) => {
- this.$store.state.globalAcc = accId;
- console.log("初始化:globalAcc=", this.globalAcc);
- });
- }
- if (!this.globalOri) {
- AccAndOri.bindOri((oriId) => {
- this.$store.state.globalOri = oriId;
- console.log("初始化:globalOri=", this.globalOri);
- });
- }
- },
- closeAcc() {
- AccAndOri.unBindAcc(this.globalAcc);
- this.$store.state.globalAcc = null;
- AccAndOri.unBindOri(this.globalOri);
- this.$store.state.globalOri = null;
- },
- outGyro(o) {
- console.log("Orientation\nAlpha:" + o.alpha + "\nBeta:" + o.beta + "\nGamma:" + o.gamma);
- },
- openGyro() {
- if (!this.globalOri) {
- AccAndOri.bindOri((oriId) => {
- this.$store.state.globalOri = oriId;
- console.log("初始化:globalOri=", this.globalOri);
- });
- }
- uni.$on('watchOrientation', this.outGyro);
- },
- stopGyro() {
- uni.$off('watchOrientation', this.outGyro);
- AccAndOri.unBindOri(this.globalOri);
- this.$store.state.globalOri = null;
- },
- onKeyInput: function(event) {
- this.$store.state.LocationGameUrl = event.target.value
- },
- onNavFcGame() {
- // console.log(0);
- uni.navigateTo({
- url: "../../fc-page/fc/fc"
- })
- },
- onNavAppInfo() {
- uni.navigateTo({
- url: '../../info-page/app-info/app-info'
- })
- },
- onNavToSelectFriend() {
- uni.navigateTo({
- url: '../../friend-page/select/select'
- })
- },
- /**
- * 悬停按钮
- */
- fabClick() {
- //如果第一次点击悬停按钮
- if (this.cIndex != -1 && this.BLEConnectDevice != null) {
- //先检测
- uni.showModal({
- title: '设备状态',
- content: '是否断开连接?',
- /**
- * 如果需要强制,不显示取消按钮
- */
- showCancel: true,
- ConfirmColor: '#A488DC',
- success: res => {
- if (res.confirm) {
- this.onCloseBLEConnection({
- getSuccess: () => {}
- });
- }
- }
- });
- } else {
- this.openDeviceList();
- }
- },
- /**
- * action 模块相关数据更新,实时更新
- */
- onActionJumpDataUpdate(obj) {
- // console.log(obj);
- this.AJData.allCount = obj.eliminationCount + obj.faultCount;
- this.AJData.faultCount = obj.faultCount;
- //如果pk模式下,区分两个人的分数
- if (this.currentMode == "pkMode") {
- if (this.AJData.isLeftPlayer) {
- this.AJData.myScore = obj.eliminationCount - obj.faultCount;
- } else {
- this.AJData.otherScore = obj.eliminationCount - obj.faultCount;
- }
- }
- //调用
- if (0 === this.currentModeIndex) {
- //拳击柱
- this.onAddSandbagHitCount();
- }
- // else if (1 === this.currentModeIndex) {
- // //跳
- // }
- // console.log(this.AJData.myUsageTime, this.AJData.otherUsageTime);
- },
- onActionJumpCountDownUpdate(obj) {
- // this.AJData.perCountDown = obj.countDown;
- if (this.currentMode == "pkMode") {
- if (this.AJData.isLeftPlayer) {
- this.AJData.myUsageTime = this.AJData.gameLimitTime - this.AJData.gameCountDown;
- } else {
- this.AJData.otherUsageTime = this.AJData.gameLimitTime - this.AJData.gameCountDown;
- }
- }
- // console.log(this.AJData.myUsageTime, this.AJData.otherUsageTime, this.AJData.gameLimitTime);
- },
- //actionJump 模块跳关卡开始处理
- onActionJumpPlay() {
- //开始时候,设置默认参数
- if (this.AJData.isFinish) {
- //如果下一局,重新设置一下默认参数
- this.onResetDefaultActionJumpData();
- }
- this.onSetActionJumpData();
- this.$refs.actionJumpRef.onActionJumpPlay();
- this.bGamePlaying = true;
- //todo 首先判断时间处理
- if (0 !== this.currentJumpTask.item.limitTime) {
- //0默认不限时,所以限时的才走计时间
- this.arcbarCountDownPlay(true);
- }
- },
- //actionHit 模块跳关卡开始处理
- onActionHitPlay() {
- //开始时候,设置默认参数
- if (this.AJData.isFinish) {
- //如果下一局,重新设置一下默认参数
- this.onResetDefaultActionJumpData();
- }
- this.onSetActionJumpData();
- this.$refs.actionHitRef.onActionPlay();
- this.bGamePlaying = true;
- //todo 首先判断时间处理
- if (0 !== this.currentJumpTask.item.limitTime) {
- //0默认不限时,所以限时的才走计时间
- this.arcbarCountDownPlay(true);
- }
- },
- //重置actionJump数据
- onResetDefaultActionJumpData() {
- this.AJData = Object.assign({}, this.defaultAJData);
- },
- onSetActionJumpData() {
- let _item = this.currentJumpTask.item;
- //这里set只是对应关卡的数据
- this.AJData = Object.assign({}, this.AJData, {
- allCount: 0,
- faultCount: 0,
- perCountDown: 0,
- gameCountDown: 0,
- gameLimitTime: _item.limitTime,
- targetCount: _item.signCount,
- })
- // console.log('onSetActionJumpData'+JSON.stringify(this.AJData)+JSON.stringify(_item));
- },
- /**
- * 游戏结束
- * @param {Object} data
- */
- onActionJumpGameOver(data) {
- let {
- isOffEvent = false
- } = data;
- //游戏结束,重置时间
- this.arcbarCountDownTimeReset();
- //todo 可能区分 levelJump 关卡类型
- if (this.currentMode == "pkMode") {
- //pk模式下面
- if (this.AJData.isLeftPlayer) {
- //如果是左边的.切换下一个玩家
- this.AJData.isLeftPlayer = false;
- uni.showModal({
- title: '切换下一个玩家',
- showCancel: false,
- success: (res) => {
- if (res.confirm) {
- //重新开始计算
- if (0 === this.currentModeIndex) {
- //调用开始
- this.onActionHitPlay();
- } else if (1 === this.currentModeIndex) {
- //调用开始
- this.onActionJumpPlay();
- }
- }
- }
- })
- } else {
- if (isOffEvent) {
- //停止蓝牙加速计
- this.onWriteBLEConnectionValue({
- value: "4"
- });
- uni.$off('updateBLEDeviceData', this.callbackUpdateBLEData);
- console.log('pkMode onActionJumpGameOver 任务结束');
- this.bGamePlaying = false;
- //同步到数据库
- if (0 === this.currentModeIndex) {
- //拳击柱
- this.uploadUserData_hitCount();
- }
- }
- this.AJData.isFinish = true;
- //奖励赢的人 PKLEVELREWARD
- let _item = this.currentJumpTask.item;
- let _curFriend = this.finallySelectFriendInfo;
- console.log('this.finallySelectFriendInfo:', this.finallySelectFriendInfo);
- let isMyWin = true;
- //如果是右边好友,即判断结束。计算胜负关系
- if (this.AJData.myScore > this.AJData.otherScore) {
- isMyWin = true;
- //显示一个提示框
- this.showPopup('pkFinish', {
- name: this.userName,
- url: this.avatarUrl,
- score: this.AJData.myScore,
- consumeTime: Math.abs(this.AJData.myUsageTime),
- hit: this.AJData.allCount - this.AJData.faultCount,
- miss: this.AJData.faultCount
- });
- // console.log({
- // name: this.username,
- // url: this.avatarUrl,
- // score: this.AJData.myScore,
- // consumeTime: Math.abs(this.AJData.myUsageTime),
- // hit: this.AJData.allCount - this.AJData.faultCount,
- // miss: this.AJData.faultCount
- // });
- } else {
- // uni.showToast({
- // title: '好友赢或者平局',
- // duration: 2000
- // })
- isMyWin = false;
- //显示一个提示框
- this.showPopup('pkFinish', {
- name: _curFriend.username,
- url: _curFriend.avatarUrl,
- score: this.AJData.otherScore,
- consumeTime: this.AJData.otherUsageTime,
- hit: this.AJData.allCount - this.AJData.faultCount,
- miss: this.AJData.faultCount
- });
- }
- reqUtil
- .requestData(config.URL.PKLEVELREWARD, {
- levelId: _item.id,
- levelType: 1,
- isMyWin: isMyWin,
- friendId: _curFriend.friendId
- })
- .then(
- res => {
- if (res.code == 0) {
- console.log('PKLEVELREWARD:' + JSON.stringify(res.data));
- this.nextTaskCanUnlock = false;
- for (let i = 0; i < this.currentTaskList.length; i++) {
- if (this.currentTaskList[i].id == _item.id) {
- this.currentTaskList[i].isPassed = true;
- break;
- }
- }
- if (isMyWin) {
- //只有isMyWin的情况下才有这两个字段返回,更新本地金币和钻石
- this.setGoldAndDiamond({
- gold: res.data.gold,
- diamond: res.data.diamond
- });
- }
- }
- },
- e => {
- console.log(e);
- }
- );
- }
- } else {
- if (isOffEvent) {
- //停止蓝牙加速计
- this.onWriteBLEConnectionValue({
- value: "4"
- });
- uni.$off('updateBLEDeviceData', this.callbackUpdateBLEData);
- console.log('onActionJumpGameOver 任务结束');
- this.bGamePlaying = false;
- //同步到数据库
- if (0 === this.currentModeIndex) {
- //拳击柱
- this.uploadUserData_hitCount();
- }
- }
- this.AJData.isFinish = true;
- if (data.myWin) {
- //通过关卡,处理逻辑
- let _item = this.currentJumpTask.item;
- reqUtil
- .requestData(config.URL.PASSTHELEVEL, {
- levelId: _item.id,
- levelType: 1,
- })
- .then(
- res => {
- if (res.code == 0) {
- console.log('PASSTHELEVEL:' + JSON.stringify(res.data));
- //处理 列表数据
- this.nextTaskCanUnlock = false;
- for (let i = 0; i < this.currentTaskList.length; i++) {
- if (this.currentTaskList[i].id == _item.id) {
- this.currentTaskList[i].isPassed = true;
- break;
- }
- }
- let _title = data.myWin ? "胜利" : "失败";
- let _context = data.myWin ? "通关关卡成功!" : "通关关卡失败!";
- this.modalName = "showModalTip"
- if (0 !== res.data.rewardHonor.type || 0 !== res.data.rewardGold || 0 !== res.data
- .rewardDiamond) {
- //todo
- this.$refs.modalTipRef.setShowData({
- title: _title,
- context: _context,
- operationItem: res.data,
- type: 'PASSTHELEVEL'
- });
- //存在任何奖励的情况下直接更新一下返回的金币和钻石数据
- this.setGoldAndDiamond({
- gold: res.data.gold,
- diamond: res.data.diamond
- });
- } else {
- //没有奖励数据
- this.$refs.modalTipRef.setShowData({
- title: _title,
- context: _context,
- operationItem: null,
- type: 'none'
- });
- }
- }
- },
- e => {
- console.log(e);
- }
- );
- }
- }
- },
- showDrawer() {
- this.showDrawerById();
- },
- showPopup(type, item) {
- this.showPopupById({
- type,
- item
- });
- },
- showGuide(type, item) {
- this.showGuideById({
- type,
- item
- });
- },
- /**
- * 任务相关
- */
- selectTask(_index, _item) {
- // console.log(JSON.stringify(_item));
- if (_item.isUnlock) {
- let _data = {
- modeName: this.currentMode, //记录时候记录当前的mode
- index: _index,
- item: _item,
- }
- //记录临时选择的游戏关卡
- this.tempSelectedLevel = _data;
- } else {
- let isCanUnlock = _index == 0 || (_index >= 1 && this.currentTaskList[_index - 1].isUnlock && this
- .currentTaskList[_index - 1].isPassed) ? true : false;
- if (!isCanUnlock) return;
- this.showPopup('unlock', _item);
- }
- },
- updateTaskScroll() {
- /**
- * 获取任务对象
- */
- this.getActionJumpTask();
- //console.error('当前的任务对象===========:' + JSON.stringify(this.currentJumpTask.modeName) + '= '+this.currentMode);
- if (this.currentJumpTask != null && this.currentJumpTask.modeName == this.currentMode) {
- let _index = this.currentJumpTask.index - 1 < 0 ? 0 : this.currentJumpTask.index - 1;
- this.$nextTick(() => {
- this.taskIntoView = "task_" + _index;
- });
- this.taskIntoView = '' //不清空再次跳到锚点位置会不起作用
- }
- },
- switchTaskInfo() {
- if (this.currentMode == 'calorieMode') {
- this.currentTaskList = this.singlePersonList;
- } else if (this.currentMode == 'pkMode') {
- this.currentTaskList = this.multiPersonList;
- }
- },
- onSwitchMode() {
- if (this.currentMode == 'calorieMode') {
- this.currentMode = 'pkMode';
- } else if (this.currentMode == 'pkMode') {
- this.currentMode = 'calorieMode';
- }
- this.switchTaskInfo();
- },
- /**
- * 处理监听数据,比如切换列表后,重置action jump an action hit 等操作;
- */
- onSwitchTaskList() {
- if (this.currentModeIndex != this.oldModeIndex) {
- this.oldModeIndex = this.currentModeIndex;
- this.tempSelectedLevel = null;
- //清空当前选择的任务
- this.resetActionJumpTask();
- this.currentMode = 'calorieMode';
- }
- this.switchTaskInfo();
- console.log("onSwitchTaskList");
- //切换时候,清空当前的任务进度
- this.arcbarCountDownTimeReset();
- this.bGamePlaying = false;
- this.$nextTick(() => {
- if (0 === this.currentModeIndex) {
- this.$refs.actionHitRef.onStopAndClearAction(true);
- //用于刷新 drawBg
- // this.$refs.actionHitRef.onDrawBg(true);
- } else if (1 === this.currentModeIndex) {
- this.$refs.actionJumpRef.onStopAndClearAction(true);
- // this.$refs.actionJumpRef.onDrawBg(true);
- }
- })
- },
- /**
- * @deprecated Test 测试通过关卡
- */
- onPassTheLevel() {
- if (this.currentMode == "pkMode") {
- this.AJData.myScore = 10;
- this.AJData.isLeftPlayer = false;
- }
- this.onActionJumpGameOver({
- myWin: true
- });
- },
- //确认时候选择按钮
- onConfirmSelectionLevel() {
- if (this.tempSelectedLevel == null) {
- uni.showToast({
- icon: 'none',
- title: '先选择一个挑战关卡',
- mask: true
- })
- return;
- }
- //点击确认时候,记录关卡,并且开始游戏
- this.setActionJumpTask(this.tempSelectedLevel);
- this.hideModal();
- setTimeout(() => {
- // 自动调用开始游戏
- this.onPersonalCheck({
- bStartCountDown: true
- });
- }, 300);
- },
- registerPopupEvent() {
- // 接收 popup 的消息
- uni.$on('reward-popup-page', (data) => {
- switch (data.type) {
- case 'interactive':
- uni.showModal({
- title: '来自Popup的消息',
- content: data.info
- })
- break;
- case 'button':
- if (data.messageType == 'prompt') {
- if (data.confirm) {
- console.log('prompt confirm!');
- } else if (data.cancel) {
- }
- } else if (data.messageType == 'unlock') {
- if (data.confirm) {
- let _operationItem = data.operationItem;
- console.log('unlock confirm!', _operationItem);
- uni.showToast({
- title: '正在解锁',
- icon: 'loading',
- duration: 10000
- })
- //todo 处理解锁流程
- reqUtil
- .requestData(config.URL.UNLOCKLEVEL, {
- levelId: _operationItem.id,
- levelType: 1, //levelJump = 1
- numberType: _operationItem.numberType,
- })
- .then(
- res => {
- uni.hideToast();
- console.log('UNLOCKLEVEL:' + JSON.stringify(res));
- if (res.code === 404) {
- uni.showToast({
- title: '金币不足',
- icon: 'none',
- duration: 1000
- })
- } else if (res.code === 405) {
- uni.showToast({
- title: '钻石不足',
- icon: 'none',
- duration: 1000
- })
- } else if (res.code === 0) {
- //解锁成功
- uni.showToast({
- title: '解锁成功',
- icon: 'none',
- duration: 1000
- })
- //更新本地金币和钻石
- this.setGoldAndDiamond({
- gold: res.data.gold,
- diamond: res.data.diamond
- });
- for (let i = 0; i < this.currentTaskList.length; i++) {
- if (this.currentTaskList[i].id == _operationItem.id) {
- this.currentTaskList[i].isUnlock = true;
- break;
- }
- }
- } else if (res.code === 803) {
- if (res.data.length > 0) {
- uni.showToast({
- title: '需要' + res.data[0].explain,
- icon: 'none',
- duration: 2000
- })
- } else {
- uni.showToast({
- title: '关卡条件关联未设置',
- icon: 'none',
- duration: 2000
- })
- }
- } else if (res.code === 802 || res.code === 805) {
- uni.showToast({
- title: res.msg,
- icon: 'none',
- duration: 2000
- })
- }
- },
- e => {
- console.log(e);
- }
- );
- }
- } else if (data.messageType == 'signIn') {
- this.onUserSignIn();
- }
- break;
- default:
- uni.showToast({
- title: data.title,
- })
- break;
- }
- })
- // 监听 drawer 消息
- uni.$on('drawer-page', (data) => {
- uni.showToast({
- title: '点击了第' + data + '项',
- icon: "none"
- });
- })
- uni.$on('guide-popup-page', (data) => {
- console.log('guide-popup-page', JSON.stringify(data));
- setTimeout(() => {
- this.bShowComplete = true;
- console.log('this.bShowComplete', this.bShowComplete);
- }, 250);
- switch (data.type) {
- case 'button':
- if (data.messageType == 'plan') {
- if (data.confirm) {
- //首次安装
- if (data.hiddenType == 'firstInstallation') {
- //跳转提示连接手柄蓝牙
- setTimeout(() => {
- this.onGetBluetoothConnectView({
- hiddenType: 'firstInstallation'
- });
- }, 60)
- console.log('提示连接手柄')
- }
- }
- } else if (data.messageType == 'bluetoothConnect') {
- if (data.confirm) {
- //跳转播放
- // this.onGetActionJumpView();
- //首次安装
- if (data.hiddenType == 'firstInstallation') {
- setTimeout(() => {
- // this.showGuide('device-tip', {
- // hiddenType: 'firstInstallation'
- // });
- this.showGuide('level-button-tip', {
- hiddenType: 'firstInstallation'
- });
- console.log('提示连接关卡')
- }, 60)
- } else if (data.hiddenType == 'firstDisconnectBluetooth') {
- this.fabClick();
- }
- }
- } else if (data.messageType == 'actionJumpPlay') {
- if (data.confirm) {
- }
- } else if (data.messageType == 'device-tip') {
- if (data.confirm) {
- if (data.hiddenType == 'firstInstallation') {
- setTimeout(() => {
- this.showGuide('level-button-tip', {
- hiddenType: 'firstInstallation'
- });
- }, 60)
- }
- }
- } else if (data.messageType == 'level-button-tip') {
- if (data.confirm) {
- }
- }
- break;
- case 'selected':
- console.log('当前操作的类型 selected:', data.messageType)
- if (data.messageType == 'level-button-tip') {
- if (data.isSelected) {
- uni.setStorage({
- key: 'levelButtonPrompt',
- data: {
- isSelected: true
- }
- })
- //如果选择不提示。则隐藏按钮
- this.$refs.actionJumpRef.onUpdateTipLevelValue(false);
- } else {
- uni.setStorage({
- key: 'levelButtonPrompt',
- data: {
- isSelected: false
- }
- })
- //如果选择提示。则显示按钮
- this.$refs.actionJumpRef.onUpdateTipLevelValue(true);
- }
- } else if (data.messageType == 'device-tip') {
- if (data.isSelected) {
- uni.setStorage({
- key: 'deviceDirectionPrompt',
- data: {
- isSelected: true
- }
- })
- //todo 后续处理是否自动提示,true就不自动提示
- } else {
- uni.setStorage({
- key: 'deviceDirectionPrompt',
- data: {
- isSelected: false
- }
- })
- //todo 后续处理是否自动提示,false就自动提示
- }
- }
- break;
- default:
- uni.showToast({
- title: data.title,
- })
- break;
- }
- })
- },
- unregisterPopupEvent() {
- //注销相应的nvue
- this.closeDrawerById();
- this.closePopupById();
- this.closeGuideById();
- uni.$off('reward-popup-page')
- uni.$off('drawer-page')
- uni.$off('guide-popup-page')
- },
- onNavToDirection() {
- uni.navigateTo({
- url: '../directionOfDetection/directionOfDetection'
- })
- },
- moveBoxingHandle() {
- return;
- },
- /**
- * 提示打开关卡
- */
- onTipLevel(value) {
- // #ifdef APP-PLUS
- this.showGuide('level-button-tip', value);
- // #endif
- // #ifdef H5
- console.warn("不支持nvue");
- // #endif
- },
- onShowFirstInstallation() {
- //第一次安装登录。提示 计划
- this.showGuide('plan', {
- hiddenType: 'firstInstallation'
- });
- console.log("guideUnlockState 1=============:", this.guideUnlockState);
- let guideUnlockState = Object.assign(this.guideUnlockState, {
- firstInstallation: false
- });
- this.setGuideUnlockState(guideUnlockState);
- },
- onAddSandbagHitCount() {
- this.addSandbagHitCount({
- count: 1
- });
- },
- onReset() {
- this.$store.state.sandbagHitCount = 0;
- },
- onSendMsg() {
- let msg = [{
- "maxValue": 19.267578125,
- "gyroValue": -1172.607421875,
- "resultant": 23.36043492594914,
- "index": 98,
- "acc": {
- "oAccX": 10.2587890625,
- "oAccY": -8.3203125,
- "oAccZ": -19.267578125
- },
- "gyro": {
- "oGyroX": -13.0615234375,
- "oGyroY": -1172.607421875,
- "oGyroZ": -42.66357421875
- }
- }, {
- "maxValue": 19.267578125,
- "gyroValue": -1172.607421875,
- "resultant": 23.36043492594914,
- "index": 99,
- "acc": {
- "oAccX": 10.2587890625,
- "oAccY": -8.3203125,
- "oAccZ": -19.267578125
- },
- "gyro": {
- "oGyroX": -13.0615234375,
- "oGyroY": -1172.607421875,
- "oGyroZ": -42.66357421875
- }
- }, {
- "maxValue": 6.58203125,
- "gyroValue": -1144.59228515625,
- "resultant": 8.733990874058362,
- "index": 100,
- "acc": {
- "oAccX": 3.740234375,
- "oAccY": -4.35546875,
- "oAccZ": -6.58203125
- },
- "gyro": {
- "oGyroX": -26.91650390625,
- "oGyroY": -1144.59228515625,
- "oGyroZ": -45.10498046875
- }
- }, {
- "maxValue": 6.58203125,
- "gyroValue": -1144.59228515625,
- "resultant": 8.733990874058362,
- "index": 101,
- "acc": {
- "oAccX": 3.740234375,
- "oAccY": -4.35546875,
- "oAccZ": -6.58203125
- },
- "gyro": {
- "oGyroX": -26.91650390625,
- "oGyroY": -1144.59228515625,
- "oGyroZ": -45.10498046875
- }
- }, {
- "maxValue": -1.1376953125,
- "gyroValue": -1038.87939453125,
- "resultant": 3.372542722981424,
- "index": 102,
- "acc": {
- "oAccX": -1.5966796875,
- "oAccY": -2.744140625,
- "oAccZ": 1.1376953125
- },
- "gyro": {
- "oGyroX": -46.93603515625,
- "oGyroY": -1038.87939453125,
- "oGyroZ": -66.162109375
- }
- }, {
- "maxValue": -1.30859375,
- "gyroValue": -951.2939453125,
- "resultant": 10.222525689439594,
- "index": 103,
- "acc": {
- "oAccX": 1.23046875,
- "oAccY": -10.0634765625,
- "oAccZ": 1.30859375
- },
- "gyro": {
- "oGyroX": -54.0771484375,
- "oGyroY": -951.2939453125,
- "oGyroZ": -85.205078125
- }
- }, {
- "maxValue": -1.30859375,
- "gyroValue": -951.2939453125,
- "resultant": 10.222525689439594,
- "index": 104,
- "acc": {
- "oAccX": 1.23046875,
- "oAccY": -10.0634765625,
- "oAccZ": 1.30859375
- },
- "gyro": {
- "oGyroX": -54.0771484375,
- "oGyroY": -951.2939453125,
- "oGyroZ": -85.205078125
- }
- }, {
- "maxValue": 0,
- "gyroValue": -890.2587890625,
- "resultant": 16.96604926042062,
- "index": 105,
- "acc": {
- "oAccX": 4.4384765625,
- "oAccY": -16.3623046875,
- "oAccZ": 0.6494140625
- },
- "gyro": {
- "oGyroX": -47.36328125,
- "oGyroY": -890.2587890625,
- "oGyroZ": -100.15869140625
- }
- }, {
- "maxValue": 0,
- "gyroValue": -890.2587890625,
- "resultant": 16.96604926042062,
- "index": 106,
- "acc": {
- "oAccX": 4.4384765625,
- "oAccY": -16.3623046875,
- "oAccZ": 0.6494140625
- },
- "gyro": {
- "oGyroX": -47.36328125,
- "oGyroY": -890.2587890625,
- "oGyroZ": -100.15869140625
- }
- }, {
- "maxValue": 1.6455078125,
- "gyroValue": -826.47705078125,
- "resultant": 19.088619035995112,
- "index": 107,
- "acc": {
- "oAccX": 6.8798828125,
- "oAccY": -17.7294921875,
- "oAccZ": -1.6455078125
- },
- "gyro": {
- "oGyroX": -32.04345703125,
- "oGyroY": -826.47705078125,
- "oGyroZ": -116.2109375
- }
- }, {
- "maxValue": 0,
- "gyroValue": -754.7607421875,
- "resultant": 12.858333021663745,
- "index": 108,
- "acc": {
- "oAccX": 4.4580078125,
- "oAccY": -12.060546875,
- "oAccZ": -0.078125
- },
- "gyro": {
- "oGyroX": -20.751953125,
- "oGyroY": -754.7607421875,
- "oGyroZ": -133.544921875
- }
- }, {
- "maxValue": 0,
- "gyroValue": -754.7607421875,
- "resultant": 12.858333021663745,
- "index": 109,
- "acc": {
- "oAccX": 4.4580078125,
- "oAccY": -12.060546875,
- "oAccZ": -0.078125
- },
- "gyro": {
- "oGyroX": -20.751953125,
- "oGyroY": -754.7607421875,
- "oGyroZ": -133.544921875
- }
- }, {
- "maxValue": 4.0087890625,
- "gyroValue": -700.1953125,
- "resultant": 4.438586679567735,
- "index": 110,
- "acc": {
- "oAccX": 1.5869140625,
- "oAccY": -1.0546875,
- "oAccZ": -4.0087890625
- },
- "gyro": {
- "oGyroX": -10.43701171875,
- "oGyroY": -700.1953125,
- "oGyroZ": -149.35302734375
- }
- }];
- this.onSendSocketMessage(msg);
- },
- onReadDataNameInput: function(event) {
- this.onSetReadDataName(event.target.value);
- },
- onTestModuleUpdateCallback(res) {
- console.log(JSON.stringify(res));
- if (res.code == 0) {
- if (res.tag == -1) {
- // this.normalText = "测试 msg:" + res.msg + ",return int:" + res.tag + "\n";
- } else {
- //识别到跳
- uni.showToast({
- title: res.tag + ',' + res.msg,
- icon: 'none',
- duration: 1000,
- mask: true
- })
- }
- }
- },
- _jumpIdenModule_DownloadReadData(item) {
- if (this.currentJumpItem)
- this.currentJumpItem.bRatio = false;
- this.currentJumpItem = item;
- this.jumpIdenModule_DownloadReadData({
- data: item,
- callback: (res) => {
- item.bRatio = true;
- }
- });
- },
- onReadBLELightInput: function(event) {
- this.onSetReadBLELight(event.target.value);
- },
- onSendBLELightNoSet(value) {
- console.log(value);
- this.B_WriteHexToBLECharacteristic({
- value: value
- });
- },
- onSendBLELightValue(value) {
- console.log(value);
- this.B_WriteHexToBLECharacteristic({
- value: value
- });
- this.onSetReadBLELight(value);
- },
- onFrameHitCapacityInput: function(event) {
- this.$store.state.hotmanIntelligentData.frameHitCapacity = event.target.value;
- // console.log( this.hotmanIntelligentData);
- this.onSaveHotmanIntelligentData();
- },
- onSlopeArrInput: function(event) {
- this.$store.state.hotmanIntelligentData.slopeArr = event.target.value.split(',').map(Number);
- // console.log( this.hotmanIntelligentData);
- this.onSaveHotmanIntelligentData();
- },
- CheckboxChange(e) {
- var items = this.checkbox,
- values = e.detail.value;
- let bCheck = false;
- for (var i = 0, lenI = items.length; i < lenI; ++i) {
- items[i].checked = false;
- for (var j = 0, lenJ = values.length; j < lenJ; ++j) {
- if (items[i].value == values[j]) {
- items[i].checked = true;
- bCheck = true;
- break
- }
- }
- }
-
- this.$store.state.bIgnore = bCheck;
- },
- }
- };
- </script>
- <style>
- .bg-person {
- /* background-color: #9797ff; */
- background-color: #00003D;
- /* #ifdef H5 */
- /* background-size:750rpx 1622rpx;
- background-image: url(../../../static/modal/action-jump/temp-tip.png); */
- /* #endif */
- }
- .plan-view {
- overflow: hidden;
- /* background-color: #9797ff; */
- }
- .plan-l-tip-view {
- border-radius: 80upx 0 0 80upx;
- background-color: rgba(255, 255, 255, 0.05);
- }
- .plan-r-tip-view {
- border-radius: 0 80upx 80upx 0;
- background-color: rgba(255, 255, 255, 0.05);
- }
- .bottom-view {
- background-color: rgba(246, 243, 249, 255);
- padding-bottom: 20rpx;
- border-radius: 80rpx 80rpx 0 0;
- width: 750rpx;
- overflow: hidden;
- }
- .time-view {
- width: 100%;
- margin-top: 53rpx;
- /* border: 1rpx solid #DD514C; */
- }
- /*样式的width和height一定要与定义的cWidth和cHeight相对应*/
- .qiun-charts-arcbar {
- height: 376rpx;
- position: relative;
- width: 750rpx;
- /* border: 1rpx solid #fff; */
- background-color: RGBA(30, 30, 85, 1);
- }
- .charts-arcbar {
- position: absolute;
- /* margin-left: 81upx;
- */
- left: 0;
- right: 0;
- top: 0;
- bottom: 0;
- margin: auto;
- width: 490rpx;
- height: 480rpx;
- /* border: 1rpx solid #FFFFFF; */
- }
- .charts-arcbar-img {
- position: absolute;
- left: 135upx;
- width: 480upx;
- height: 480upx;
- }
- .charts-pring-bottom {
- position: relative;
- width: 100%;
- display: flex;
- flex-direction: column;
- justify-content: center;
- align-items: center;
- }
- .charts-pring-button {
- width: 178rpx;
- height: 64rpx;
- display: flex;
- flex-direction: row;
- justify-content: start;
- align-items: center;
- border-radius: 0 25px 25px 0;
- }
- /* 心电图 */
- /* .qiun-charts-elect {
- width: 500rpx;
- height: 136rpx;
- } */
- .charts-elect {
- width: 464rpx;
- height: 96rpx;
- border: 1rpx solid #000000;
- }
- .e-button {
- background-color: rgba(255, 255, 255, 0.25);
- border-radius: 45px;
- margin: 5px 12px;
- box-shadow: 1px 1px 3px #888888;
- display: flex;
- justify-content: center;
- }
- /* 曲线图 */
- .qiun-charts-area {
- width: calc(750rpx - 40rpx);
- height: 300upx;
- /* background-color: #007AFF; */
- position: relative;
- }
- .charts-area {
- position: absolute;
- width: 750upx;
- height: 300upx;
- }
- .qiun-charts-bottom-container {
- height: 63px;
- position: relative;
- width: 100%;
- justify-content: center;
- align-items: center;
- display: flex;
- flex-direction: row;
- }
- .qiun-charts-bottom-right {
- position: absolute;
- left: calc(50% + 50rpx);
- top: 15px;
- margin-left: 20rpx;
- }
- /* picker */
- .mpvue-picker-view {
- width: calc(50% - 5px);
- height: 300px;
- /* background-color: rgba(255, 255, 255, 1); */
- border-radius: 20px;
- }
- .item {
- text-align: center;
- width: calc(100% - 0px);
- background-color: rgba(255, 255, 255, 1);
- height: 88upx;
- line-height: 88upx;
- text-overflow: ellipsis;
- white-space: nowrap;
- font-size: 40upx;
- }
- .picker-unit {
- position: absolute;
- right: 70px;
- top: 43%;
- }
- .left-button,
- .right-button {
- margin: 20px 0;
- padding: 10px 30px;
- background-color: #ffffff;
- }
- .left-button {
- border-top-left-radius: 20px;
- border-bottom-left-radius: 20px;
- border-right: 1px solid #e6e6e6;
- }
- .right-button {
- border-top-right-radius: 20px;
- border-bottom-right-radius: 20px;
- }
- .png-size-28 {
- width: 24px;
- height: 24px;
- margin-bottom: 4px;
- }
- .png-size-32 {
- width: 32px;
- height: 32px;
- }
- .png-size-34 {
- width: 34px;
- height: 34px;
- }
- /* 图标大小 */
- .data-play {
- width: 16px;
- height: 16px;
- margin-top: 10rpx;
- }
- .p-data-png {
- width: 16px;
- height: 16px;
- margin: 5rpx 20rpx;
- }
- .data-png {
- width: 16px;
- height: 16px;
- margin: 5rpx;
- }
- .data-png-20 {
- width: 20px;
- height: 20px;
- margin: 0 14rpx;
- }
- .data-png-54 {
- width: 54px;
- height: 54px;
- margin: 0 14rpx;
- }
- .data-png-add {
- position: absolute;
- left: 0;
- top: 0;
- right: 0;
- bottom: 0;
- margin: auto;
- width: 34px;
- height: 37px;
- }
- .time-container {
- margin-top: 13px;
- width: 100%;
- height: 218rpx;
- position: relative;
- /* border: 1rpx solid #007AFF; */
- }
- .time-png {
- width: 503rpx;
- height: 222rpx;
- position: absolute;
- left: 0;
- right: 0;
- top: 0;
- bottom: 0;
- margin: auto;
- z-index: 1;
- }
- .time-text {
- font-size: 9px;
- z-index: 10;
- position: relative;
- height: 100%;
- display: flex;
- justify-content: center;
- align-items: center;
- color: #FFFFFF;
- }
- .padding {
- padding: 10rpx;
- }
- .logo {
- height: 200rpx;
- width: 200rpx;
- margin-top: 200rpx;
- margin-left: auto;
- margin-right: auto;
- margin-bottom: 50rpx;
- }
- .float-png {
- position: absolute;
- right: 15px;
- bottom: 200px;
- width: 56px;
- height: 56px;
- }
- .moveCanvas {
- position: fixed;
- top: 9999rpx;
- left: 0;
- width: 188rpx;
- height: 188rpx;
- }
- .scroll-class {
- width: 100%;
- overflow-x: hidden;
- box-sizing: border-box;
- /* border: 1rpx solid #000000; */
- }
- .homepage-grid-square {
- width: 250rpx;
- /* height: 250rpx; */
- align-items: start;
- }
- .homepage-grid-square image {
- width: 176rpx;
- height: 176rpx;
- }
- .border {
- /* width: 176rpx; */
- font-size: 30rpx;
- color: rgba(175, 175, 175, 1);
- font-weight: 400;
- text-align: center;
- margin-top: 22rpx;
- margin-bottom: 40rpx;
- }
- .item-img {
- border-radius: 20rpx;
- /* border: 1rpx solid #EEEEEE; */
- box-shadow: 0px 1px 2px 0px rgba(113, 113, 219, 0.23);
- }
- .plan-Tip-child {
- height: 120rpx;
- }
- .plan-mode-tip {
- height: 90rpx;
- }
- .plan-grid-square {
- width: 250rpx;
- /* height: 250rpx; */
- align-items: start;
- }
- .plan-grid-square image {
- width: 168rpx;
- height: 58rpx;
- }
- .plan-mode {
- /* height: 54px; */
- border-radius: 10px;
- padding: 3px;
- margin: 0 5px 10px 5px;
- border: 1rpx solid #eeeeee;
- /* box-shadow: 0px 1px 2px 0px rgba(113, 113, 219, 0.23); */
- position: relative;
- }
- .plan-mode-selected {
- /* height: 54px; */
- padding: 3px;
- margin: 0 5px 10px 5px;
- background-size: contain;
- background-clip: border-box;
- background-repeat: no-repeat;
- background-image: url(../../../static/plan-select-bg.png);
- /* box-shadow: 0px 1px 2px 0px rgba(113, 113, 219, 0.23); */
- position: relative;
- }
- .plan-mode-border {
- /* width: 176rpx; */
- font-size: 26rpx;
- color: rgba(151, 151, 255, 1);
- font-weight: 400;
- text-align: center;
- }
- .button-fav {
- background-color: rgba(153, 150, 252, 255);
- color: #ffffff;
- /* border-radius: 10px; */
- /* width: 184rpx; */
- height: 122rpx;
- display: flex;
- justify-content: center;
- text-align: center;
- align-items: center;
- font-size: 14px;
- }
- .card-view-small {
- /* border: 1rpx solid #000000; */
- width: 80%;
- border-radius: 20px;
- margin-left: 50rpx;
- overflow: hidden;
- background-color: #ffffff;
- box-shadow: 0px 2px 4px 0px rgba(113, 113, 219, 0.23);
- }
- .right-bg {
- /* border: 1rpx solid #000000; */
- border-radius: 8px;
- background-color: #9797ff;
- padding: 15rpx;
- position: absolute;
- right: 5%;
- margin-top: 4%;
- }
- .plan-small-child {
- background-color: #f5f5ff;
- border-radius: 20px;
- width: 480rpx;
- height: 90rpx;
- margin: 0 0 30rpx 30rpx;
- /* margin-top: 60rpx; */
- }
- .cu-btn-plan {
- position: relative;
- border: 0upx;
- display: inline-flex;
- align-items: center;
- justify-content: center;
- box-sizing: border-box;
- padding: 4upx 25upx 4upx 4upx;
- margin-left: 5px;
- font-size: 22upx;
- height: 64upx;
- line-height: 1;
- text-align: center;
- text-decoration: none;
- overflow: visible;
- margin-left: initial;
- transform: translate(0upx, 0upx);
- margin-right: initial;
- }
- .cu-btn-plan-child {
- position: relative;
- border: 0upx;
- display: inline-flex;
- align-items: center;
- justify-content: center;
- box-sizing: border-box;
- padding: 0 4upx;
- font-size: 22upx;
- height: 56upx;
- line-height: 1;
- text-align: center;
- text-decoration: none;
- overflow: visible;
- margin-left: initial;
- transform: translate(0upx, 0upx);
- margin-right: initial;
- }
- .cu-btn-plan-right {
- position: relative;
- border: 0upx;
- display: inline-flex;
- align-items: center;
- justify-content: center;
- box-sizing: border-box;
- padding: 4upx 4upx 4upx 19upx;
- margin-left: 5px;
- font-size: 22upx;
- height: 64upx;
- line-height: 1;
- text-align: center;
- text-decoration: none;
- overflow: visible;
- margin-left: initial;
- transform: translate(0upx, 0upx);
- margin-right: initial;
- }
- /* 粗线条 */
- .line-make {
- margin-top: 11px;
- margin-left: 8px;
- border: 4rpx solid #FFFFFF;
- width: 152rpx;
- border-radius: 3px;
- }
- /* 头像背景处理 */
- .avatar-bg-personal {
- width: 34px;
- height: 34px;
- border-radius: 45px;
- border: 2px solid #9997fc;
- background-color: #9997fc;
- box-sizing: border-box;
- }
- .avatar-bg-arrow {
- position: absolute;
- top: 12px;
- left: calc(50% - 10px);
- border-left: 10px solid transparent;
- border-right: 10px solid transparent;
- border-bottom: 10px solid #9997fc;
- }
- .elect-round-image {
- width: 48px;
- height: 48px;
- z-index: 10;
- box-shadow: 1px 1px 3px #888888;
- border-radius: 45px;
- }
- .elect-personal {
- /* width: 100%; */
- height: 120rpx;
- /* margin: 50rpx 0; */
- margin-bottom: 50rpx;
- border-radius: 45px;
- padding: 10rpx;
- border: 1rpx solid rgba(255, 255, 255, 0.11);
- display: flex;
- justify-content: center;
- align-items: center;
- position: relative;
- }
- /* 呼吸灯 */
- .breathing-lamp {
- animation-duration: 1s;
- animation-timing-function: ease-out;
- animation-fill-mode: inherit;
- animation-iteration-count: infinite;
- animation-name: run-lamp;
- animation-play-state: running;
- }
- @keyframes run-lamp {
- 0%,
- 100% {
- opacity: 1;
- transform: scale(1);
- }
- 50% {
- opacity: 0.6;
- transform: scale(0.9);
- }
- }
- .personal-fruit-container {
- position: absolute;
- left: 0;
- top: 0;
- bottom: 0;
- right: 0;
- margin: auto;
- display: flex;
- align-items: center;
- justify-content: center;
- /* border: 1rpx solid #F0F0F0; */
- }
- .screen-jitter {
- animation-duration: 1s;
- animation-timing-function: ease-out;
- animation-fill-mode: inherit;
- animation-iteration-count: infinite;
- animation-name: personal-shake;
- animation-play-state: running;
- }
- .screen-red {
- border: 1rpx solid #ff0000;
- }
- @keyframes personal-shake {
- 0%,
- 100% {
- transform: translateX(0)
- }
- 10% {
- transform: translateX(-9px)
- }
- 20% {
- transform: translateX(8px)
- }
- 30% {
- transform: translateX(-7px)
- }
- 40% {
- transform: translateX(6px)
- }
- 50% {
- transform: translateX(-5px)
- }
- 60% {
- transform: translateX(4px)
- }
- 70% {
- transform: translateX(-3px)
- }
- 80% {
- transform: translateX(2px)
- }
- 90% {
- transform: translateX(-1px)
- }
- }
- .CountDownMask {
- position: absolute;
- top: 0;
- bottom: 0;
- right: 0;
- left: 0;
- background-color: rgba(0, 0, 0, 0.5);
- z-index: 1000;
- display: flex;
- justify-content: center;
- align-items: center;
- font-size: 100px;
- font-weight: bold;
- color: #FFFFFF;
- }
- /**
- * 任务样式
- */
- .task-up-button {
- z-index: 10;
- /* #ifndef APP-PLUS */
- position: absolute;
- /* #endif */
- /* #ifdef APP-PLUS */
- position: fixed;
- /* #endif */
- bottom: -53rpx;
- right: 0;
- left: 0;
- margin: auto;
- width: 100%;
- height: 104rpx;
- /* border: 1rpx solid #000000; */
- }
- .canvas-hidden {
- /* display: none; */
- left: -1000px;
- }
- .canvas-show {
- /* display: block; */
- }
- </style>
|