code-elf-guide.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475
  1. <template>
  2. <view class="content">
  3. <view class="swiper">
  4. <!-- 计划 -->
  5. <view class="swiper-item" v-if="thisCurrent==0">
  6. <view class="swiper-project" :class="thisCurrent==0&&bShow?'active':''">
  7. <view style="display: flex;flex-direction: column;" :style="{'margin-top' :projectTop+'px'}">
  8. <view @tap="launchFlag(false)">
  9. <image style="margin-top: -35rpx;" :style="{width:projectWith+'px', height:projectHeight+'px'}" src="/static/guide/project_target.png"></image>
  10. </view>
  11. <image style="width: 80rpx;height: 80rpx; margin: 35rpx 0 0 75rpx;" src="/static/guide/project_handle.png" mode="aspectFit"></image>
  12. </view>
  13. <view style="display: flex; flex-direction: column;margin-top: 200rpx;">
  14. <image style="width: 120rpx;height: 80rpx;" src="/static/guide/project_arrow.png" mode="aspectFit"></image>
  15. <image style="margin-left: 90rpx; width: 340rpx;height: 200rpx;" src="/static/guide/project_tip.png" mode="aspectFit"></image>
  16. </view>
  17. </view>
  18. <view style="position: absolute; bottom: 200rpx; width: 100%; display:flex; justify-content: center;">
  19. <view @tap="launchFlag(true)">
  20. <image style="width: 120px;height: 45px;" src="/static/guide/BLE_tip.png"></image>
  21. </view>
  22. </view>
  23. </view>
  24. <!-- 下滑连接蓝牙提示 -->
  25. <view class="swiper-item" v-if="thisCurrent==1">
  26. <view class="swiper-bluetooth">
  27. <image style="margin: 10rpx; width: 50rpx;height: 50rpx;" src="/static/guide/BLE_arrow.png" mode="aspectFit"></image>
  28. <image style="width: 292rpx;height: 48rpx;" src="/static/guide/BLE_text_1.png" mode="aspectFit"></image>
  29. <image style="width: 80rpx;height: 80rpx; margin: 188rpx 0 17rpx 0;" src="/static/guide/BLE_icon.png" mode="aspectFit"></image>
  30. <image style="width: 571rpx;height: 52rpx;" src="/static/guide/BLE_text_2.png" mode="aspectFit"></image>
  31. <view @tap="launchFlag(true)">
  32. <image style=" width: 243rpx;height: 90rpx;margin-top: 54rpx;" src="/static/guide/BLE_tip.png"></image>
  33. </view>
  34. </view>
  35. </view>
  36. <!-- 提示调整添加蓝牙设备 -->
  37. <view class="swiper-item" v-if="thisCurrent==3">
  38. <!-- <button>{{deviceTop}}</button> -->
  39. <view class="swiper-device active">
  40. <view style="display: flex;flex-direction: column;margin-top: 403px;" :style="{'margin-top' :deviceTop+'px'}">
  41. <view @tap="launchFlag(false)">
  42. <image style="margin-top: -35rpx;" :style="{width:deviceWith+'px', height:deviceHeight+'px'}" src="/static/guide/device_target.png"></image>
  43. </view>
  44. <image style="width: 80rpx;height: 80rpx; margin: 35rpx 0 0 75rpx;" src="/static/guide/project_handle.png" mode="aspectFit"></image>
  45. </view>
  46. <view style="display: flex; flex-direction: row; margin-top: -500rpx;">
  47. <image style="margin: 90rpx 30rpx 0 150rpx; width: 120rpx;height: 80rpx;" src="/static/guide/device_arrow.png"
  48. mode="aspectFit"></image>
  49. <image style="width: 394rpx;height: 123rpx;" src="/static/guide/device_tip.png" mode="aspectFit"></image>
  50. </view>
  51. <view style="display: flex;align-self: center;margin-top: -200px;">
  52. <view @tap="launchFlag(true)">
  53. <image style="width: 120px;height: 45px;" src="/static/guide/BLE_tip.png"></image>
  54. </view>
  55. </view>
  56. </view>
  57. </view>
  58. <!-- 连接设备提示 -->
  59. <view class="swiper-item" v-if="thisCurrent==4">
  60. <!-- <button>{{deviceTop}}</button> -->
  61. <view class="swiper-device active">
  62. <!-- <view style="display: flex;align-self: center;margin-top: 80px;"> -->
  63. <!-- <view @tap="launchFlag(true)">
  64. <image style="width: 120px;height: 45px;" src="/static/guide/BLE_tip.png"></image>
  65. </view> -->
  66. <!-- </view> -->
  67. <!-- 125 -->
  68. <view style="display: flex;flex-direction: column;margin-top: 403px;" :style="{'margin-top' :deviceTop+'px'}">
  69. <view @tap="launchFlag(false)">
  70. <image style="margin-top: -35rpx;" :style="{width:deviceWith+'px', height:deviceHeight+'px'}" src="/static/guide/device_target.png"></image>
  71. </view>
  72. <image style="width: 80rpx;height: 80rpx; margin: 35rpx 0 0 75rpx;" src="/static/guide/project_handle.png" mode="aspectFit"></image>
  73. </view>
  74. <view style="display: flex; flex-direction: row; margin-top: -500rpx;">
  75. <image style="margin: 90rpx 30rpx 0 150rpx; width: 120rpx;height: 80rpx;" src="/static/guide/device_arrow.png"
  76. mode="aspectFit"></image>
  77. <image style="width: 394rpx;height: 123rpx;" src="/static/guide/device_tip.png" mode="aspectFit"></image>
  78. </view>
  79. <view style="display: flex;align-self: center;margin-top: 200px;">
  80. <view @tap="launchFlag(true)">
  81. <image style="width: 120px;height: 45px;" src="/static/guide/BLE_tip.png"></image>
  82. </view>
  83. </view>
  84. </view>
  85. </view>
  86. <!-- 拳击血量提示 -->
  87. <view class="swiper-item" v-if="thisCurrent==5">
  88. <view class="swiper-device active">
  89. <view class="guide-vertical-container">
  90. <view class="guide-vertical-bar">
  91. <view class="guide-vertical-child" v-for="(item, index) in 15" :key="index">
  92. <view :class="20>=index+1? 'guide-vertical-active':'guide-vertical-inactive'"></view>
  93. <!-- :class="index%5 == 0?'':'guide-text-hidden'" -->
  94. <view class="guide-vertical-text guide-text-hidden">{{index+1}}</view>
  95. </view>
  96. <view style="height:30rpx"></view>
  97. <image class="guide-vertical-boxing" src="/static/guide/boxingHitUp.png"></image>
  98. </view>
  99. <view class="guide-vertical-mid ">
  100. <view style="margin: 80rpx 0 120rpx 30rpx; position: relative;" @tap="launchFlag(false)">
  101. <image style="position: relative; width: 280rpx;height: 88rpx;" src="/static/guide/boxingHitButton.png"></image>
  102. <view style="position: absolute;top: 25rpx; left: 120rpx;right:35rpx; color: #FFF;">立即体验</view>
  103. </view>
  104. <view style="position: relative;" >
  105. <image style="position: relative; width: 400rpx;height: 170rpx;" src="/static/guide/boxingHitMid.png"></image>
  106. <!-- 打击拳击柱越快或力量越大力量条会越快增长哦! -->
  107. <view v-if="thisCurrentMode == 'calorieMode'" style="position: absolute;top: 70rpx; left: 45rpx;right:35rpx; color: #000;">跑的越快速度条会增长越快哦!</view>
  108. <view v-else style="position: absolute;top: 70rpx; left: 45rpx;right:35rpx; color: #000;">对着沙袋拳拳到肉,让对方的飙血吧!</view>
  109. </view>
  110. </view>
  111. <view class="guide-vertical-bar">
  112. <view class="guide-vertical-child" v-for="(item, index) in 15" :key="index">
  113. <!-- :class="index%5 == 0?'':'guide-text-hidden'" -->
  114. <view class="guide-vertical-text guide-text-hidden">{{index+16}}</view>
  115. <view :class="20>=index+16? 'guide-vertical-active':'guide-vertical-inactive'"></view>
  116. </view>
  117. <image class="guide-vertical-boxing" src="/static/guide/boxingHitUp.png"></image>
  118. </view>
  119. </view>
  120. </view>
  121. </view>
  122. </view>
  123. <!-- <swiper v-if="false" class="swiper" :autoplay="autoplay" :duration="duration" :current="thisCurrent" @change="onChange">
  124. <swiper-item>
  125. <view class="swiper-project" :class="thisCurrent==0&&bShow?'active':''">
  126. <view style="display: flex;flex-direction: column;" :style="{'margin-top' :projectTop+'px'}">
  127. <image @tap="launchFlag(false)" style="margin-top: -35rpx;" :style="{width:projectWith+'px', height:projectHeight+'px'}" src="/static/guide/project_target.png"></image>
  128. <image style="width: 80rpx;height: 80rpx; margin: 35rpx 0 0 75rpx;" src="/static/guide/project_handle.png"
  129. mode="aspectFit"></image>
  130. </view>
  131. <view style="display: flex; flex-direction: column;margin-top: 200rpx;">
  132. <image style="width: 120rpx;height: 80rpx;" src="/static/guide/project_arrow.png" mode="aspectFit"></image>
  133. <image style="margin-left: 90rpx; width: 340rpx;height: 200rpx;" src="/static/guide/project_tip.png" mode="aspectFit"></image>
  134. </view>
  135. </view>
  136. <view style="position: absolute; bottom: 200rpx; width: 100%; display:flex; justify-content: center;">
  137. <image @tap="launchFlag(true)" style="width: 120px;height: 45px;" src="/static/guide/BLE_tip.png"></image>
  138. </view>
  139. </swiper-item>
  140. <swiper-item v-if="false">
  141. <view class="swiper-device" :class="thisCurrent==1&&bShow?'':''">
  142. <view style="display: flex;align-self: center;margin-top: 80px;">
  143. <image @tap="launchFlag(true)" style="width: 120px;height: 45px;" src="/static/guide/BLE_tip.png"></image>
  144. </view>
  145. <view style="display: flex;flex-direction: column;margin-top: 403px;" :style="{'margin-top' :deviceTop-125+'px'}">
  146. <image @tap="launchFlag(false)" style="margin-top: -35rpx;" :style="{width:deviceWith+'px', height:deviceHeight+'px'}" src="/static/guide/device_target.png"></image>
  147. <image style="width: 80rpx;height: 80rpx; margin: 35rpx 0 0 75rpx;" src="/static/guide/project_handle.png"
  148. mode="aspectFit"></image>
  149. </view>
  150. <view style="display: flex; flex-direction: row; margin-top: -500rpx;">
  151. <image style="margin: 90rpx 30rpx 0 150rpx; width: 120rpx;height: 80rpx;" src="/static/guide/device_arrow.png"
  152. mode="aspectFit"></image>
  153. <image style="width: 394rpx;height: 123rpx;" src="/static/guide/device_tip.png" mode="aspectFit"></image>
  154. </view>
  155. </view>
  156. </swiper-item>
  157. <swiper-item>
  158. <view class="swiper-bluetooth">
  159. <image style="margin: 10rpx; width: 50rpx;height: 50rpx;" src="/static/guide/BLE_arrow.png" mode="aspectFit"></image>
  160. <image style="width: 292rpx;height: 48rpx;" src="/static/guide/BLE_text_1.png" mode="aspectFit"></image>
  161. <image style="width: 80rpx;height: 80rpx; margin: 188rpx 0 17rpx 0;" src="/static/guide/BLE_icon.png" mode="aspectFit"></image>
  162. <image style="width: 571rpx;height: 52rpx;" src="/static/guide/BLE_text_2.png" mode="aspectFit"></image>
  163. <image @tap="launchFlag(true)" style="width: 243rpx;height: 90rpx;margin-top: 54rpx;" src="/static/guide/BLE_tip.png"></image>
  164. </view>
  165. </swiper-item>
  166. </swiper> -->
  167. </view>
  168. </template>
  169. <script>
  170. export default {
  171. props: {
  172. current: {
  173. type: Number,
  174. default: 0
  175. },
  176. modeIndex: {
  177. type: Number,
  178. default: 0
  179. },
  180. currentMode:{
  181. type: String,
  182. default:"calorieMode"
  183. }
  184. },
  185. data() {
  186. return {
  187. background: ['color1', 'color2', 'color3'],
  188. autoplay: false,
  189. duration: 0,
  190. thisCurrent: 0,
  191. bShow: false,
  192. jumpover: '跳过',
  193. experience: '立即体验',
  194. deviceWith: 202,
  195. deviceHeight: 103,
  196. deviceTop: 503,
  197. projectTop: 95,
  198. projectWith: 106,
  199. projectHeight: 60,
  200. //设备对象
  201. DeviceObj: null,
  202. modalObj:null,
  203. thisCurrentMode:'',
  204. }
  205. },
  206. created() {
  207. this.thisCurrent = this.current;
  208. this.thisCurrentMode = this.currentMode;
  209. },
  210. watch: {
  211. current(val) {
  212. // console.log("====",val);
  213. this.thisCurrent = val;
  214. },
  215. currentMode(val) {
  216. // console.log("====",val);
  217. this.thisCurrentMode = val;
  218. }
  219. },
  220. methods: {
  221. setProjectObj(val) {
  222. this.bShow = true;
  223. this.projectTop = val.top;
  224. this.projectWith = val.width + 20;
  225. this.projectHeight = val.height + 30;
  226. },
  227. setDeviceObj(val) {
  228. this.bShow = true;
  229. this.deviceWith = val.width + 40;
  230. this.deviceHeight = val.height + 40;
  231. this.deviceTop = val.top;
  232. this.DeviceObj = val;
  233. },
  234. setModalObj(val){
  235. console.log("setModalObj:",val);
  236. this.modalObj = val;
  237. },
  238. setCurrent(val) {
  239. // console.log("设置val:",val);
  240. this.thisCurrent = val;
  241. },
  242. launchFlag: function(bOnlyHide) {
  243. /**
  244. * 向本地存储中设置launchFlag的值,即启动标识;
  245. */
  246. // uni.setStorage({
  247. // key: 'launchFlag',
  248. // data: true,1
  249. // });
  250. console.log(bOnlyHide, this.thisCurrent);
  251. this.bShow = false;
  252. this.$emit("hide", {
  253. current: this.thisCurrent,
  254. onlyHide: bOnlyHide,
  255. device: this.DeviceObj
  256. });
  257. },
  258. onChange(e) {
  259. this.thisCurrent = e.detail.current;
  260. // console.log("this.thisCurrent=",this.thisCurrent);
  261. this.$emit("change", e);
  262. }
  263. }
  264. }
  265. </script>
  266. <style>
  267. .content {
  268. position: absolute;
  269. left: 0;
  270. right: 0;
  271. top: 0;
  272. bottom: 0;
  273. width: 100%;
  274. height: 100%;
  275. background-size: 100% auto;
  276. padding: 0;
  277. z-index: 9999;
  278. box-sizing: border-box;
  279. }
  280. .swiper {
  281. width: 100%;
  282. height: 100%;
  283. background: rgba(0, 0, 0, 0.71);
  284. }
  285. .swiper-item {
  286. width: 100%;
  287. height: 100%;
  288. position: relative;
  289. display: flex;
  290. justify-content: center;
  291. align-content: center;
  292. align-items: center;
  293. flex-direction: column;
  294. /* border: 1rpx solid #FFFFFF; */
  295. }
  296. .swiper-project {
  297. width: 100%;
  298. height: 100%;
  299. position: relative;
  300. display: flex;
  301. /* justify-content: center; */
  302. align-items: flex-start;
  303. flex-direction: row;
  304. opacity: 0;
  305. transition: opacity 1s;
  306. }
  307. .swiper-device {
  308. width: 100%;
  309. height: 100%;
  310. position: relative;
  311. display: flex;
  312. align-items: flex-start;
  313. flex-direction: column;
  314. opacity: 0;
  315. transition: opacity 1s;
  316. }
  317. .active {
  318. opacity: 1;
  319. }
  320. .swiper-bluetooth {
  321. width: 100%;
  322. height: 100%;
  323. position: relative;
  324. display: flex;
  325. align-items: center;
  326. flex-direction: column;
  327. }
  328. .swiper-item-img {
  329. width: 100%;
  330. height: auto;
  331. margin: 0 auto;
  332. }
  333. .swiper-item-img image {
  334. width: 80%;
  335. height: 500rpx;
  336. border: 1rpx solid #000000;
  337. }
  338. .uniapp-img {
  339. height: 20%;
  340. background: #FFFFFF;
  341. display: flex;
  342. justify-content: center;
  343. align-items: center;
  344. overflow: hidden;
  345. }
  346. .uniapp-img image {
  347. width: 40%;
  348. }
  349. .jump-over,
  350. .experience {
  351. position: absolute;
  352. height: 60upx;
  353. line-height: 60upx;
  354. padding: 0 40upx;
  355. border-radius: 30upx;
  356. font-size: 32upx;
  357. color: #FFFFFF;
  358. border: 1px solid #FFFFFF;
  359. z-index: 999;
  360. }
  361. .jump-over {
  362. right: 45upx;
  363. top: 125upx;
  364. }
  365. .experience {
  366. right: 50%;
  367. margin-right: -105upx;
  368. bottom: 125upx;
  369. }
  370. /* Loader Bar */
  371. .guide-vertical-container {
  372. display: flex;
  373. position: absolute;
  374. top: 390rpx;
  375. left: 0;
  376. right: 0;
  377. /* bottom: 0; */
  378. display: flex;
  379. justify-content: space-between;
  380. /* border: 1rpx solid #000000; */
  381. /* pointer-events: none; */
  382. }
  383. .guide-vertical-bar {
  384. display: flex;
  385. flex-direction: column-reverse;
  386. position: relative;
  387. }
  388. .guide-vertical-mid{
  389. display: flex;
  390. flex-direction: column-reverse;
  391. position: relative;
  392. }
  393. .guide-vertical-boxing{
  394. position: absolute;
  395. /* top: 0; */
  396. left: 0;
  397. right: 0;
  398. bottom: -30rpx;
  399. height: 560rpx;
  400. }
  401. .guide-vertical-child {
  402. /* position: relative; */
  403. width: 70rpx;
  404. height: 20rpx;
  405. margin: 14rpx 24rpx 0 24rpx;
  406. display: flex;
  407. /* align-content: center; */
  408. justify-content: space-between;
  409. }
  410. .guide-vertical-text {
  411. color: #FFFFFF;
  412. font-size: 8px;
  413. }
  414. .guide-text-hidden {
  415. visibility: hidden;
  416. }
  417. .guide-vertical-active {
  418. background-color: #FFFFFF;
  419. width: 30rpx;
  420. height: 100%;
  421. }
  422. .guide-vertical-inactive {
  423. width: 30rpx;
  424. height: 100%;
  425. background: rgba(255, 255, 255, 0.3);
  426. }
  427. </style>