code-elf-guide.vue 14 KB

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