guide-ble-scroll.vue 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314
  1. <template>
  2. <view>
  3. <uni-nav-bar id="nav-bar" status-bar="true" @clickLeft="onBack()" @clickRight="onNavUpdateDevice()"
  4. title="蓝牙连接指导" color="#000000" fixed="true" :border="false">
  5. <view slot="left">
  6. <view class=" flex align-center margin-left">
  7. <image class="p-left-arrow" src="../../../static/p-left-arrow.png"></image>
  8. </view>
  9. </view>
  10. <!-- <view slot="right">
  11. <view class=" flex align-center " style="margin-right: 10rpx;">
  12. <image style="width: 60rpx;height: 50rpx;" src="../../../static/devicesIconSimple/upgrade.png">
  13. </image>
  14. </view>
  15. </view> -->
  16. </uni-nav-bar>
  17. <view class="swiper">
  18. <!-- 1 -->
  19. <view class="flex justify-center align-center" style="padding-top: 60px;">
  20. <view style="width: 590rpx; height: 626rpx;" class="position-relative">
  21. <view class="bluetooth-guide-number" style="position: absolute;left: 94rpx;top: 8rpx;">1</view>
  22. <!-- <image style="width: 590rpx; height: 626rpx;"
  23. src="../../../static/guide/blutooth/guide-ble-1@2x.png">
  24. </image> -->
  25. <view style="width: 590rpx; height: 512rpx;" class="flex position-relative">
  26. <image style="width: 424rpx;height: 412rpx; margin-top: 100rpx;" src="../../../static/guide/blutooth/guide-ble-tip.png"></image>
  27. <image style="width: 102rpx;height: 102rpx; margin-top: 116rpx; margin-left: 56rpx;" src="../../../static/guide/blutooth/guide-ble-toggle.png"></image>
  28. <view class="position-absolute-right-top">
  29. <image style="width: 406rpx;height: 94rpx; " src="../../../static/guide/blutooth/guide-toggle-tip.png"></image>
  30. <view class="position-absolute-center text-regular" style="width: 438rpx;height: 96rpx;top: 26rpx;left: 40rpx;">
  31. 确保手机蓝牙处于开启状态</view>
  32. </view>
  33. </view>
  34. <view class="position-relative" style="top: 10rpx;">
  35. <image style="width: 520rpx; height:166rpx;top: 10rpx;left: 26rpx;" src="../../../static/guide/blutooth/boxMid@2x.png">
  36. </image>
  37. <view class="position-absolute-center text-regular" style="width: 438rpx;height: 96rpx;top: 18rpx;">
  38. 切记请不要直接连接蓝牙,确保手柄没被任何手机连接,如果有请断开连接。</view>
  39. </view>
  40. </view>
  41. </view>
  42. <!-- 2 -->
  43. <view class="flex justify-center align-center flex-direction" style="margin-top: 80px;">
  44. <image style="width: 354rpx; height: 306rpx; margin-bottom: 28rpx;"
  45. src="../../../static/guide/blutooth/guide-ble-device.png">
  46. </image>
  47. <view class="position-relative">
  48. <image style="width: 520rpx; height:166rpx;" src="../../../static/guide/blutooth/boxMid@2x.png">
  49. </image>
  50. <view class="position-absolute-center text-regular" style="width: 438rpx;height: 96rpx;top: 26rpx;">
  51. 长按游戏设备开关3秒,设备灯连续闪烁为可连接状态</view>
  52. </view>
  53. <view class="bluetooth-guide-number" style="margin-top: 36rpx;">2</view>
  54. </view>
  55. <!-- 3 -->
  56. <view class="flex justify-start align-center flex-direction" style="margin-top: 60px;">
  57. <view class="card-view padding-top padding-bottom" :style="{'z-index': threeZIndex}"
  58. v-for="(item,index) in devicesList" :key="index" :class="item.bRatio?'hardware-border':''"
  59. :id="'task_'+index">
  60. <view class="flex justify-between align-center">
  61. <view class="flex justify-start align-center">
  62. <image style="margin-left: 20rpx; width: 200rpx;height: 120rpx;" :src="item.icon"
  63. mode="aspectFit">
  64. </image>
  65. <view style="width: 350rpx;margin-left: 10rpx;">
  66. <view style="margin: 20rpx 0rpx; font-weight: bold; font-size: 18px; color: #565656;">
  67. {{item.cname}}
  68. </view>
  69. <view style="font-size: 12px; white-space:pre-wrap;" class="make-text-bPurple">
  70. {{item.describe}}
  71. </view>
  72. </view>
  73. </view>
  74. <!-- item.bRatio -->
  75. <image style="margin-right: 60rpx; width: 60rpx;height: 60rpx;"
  76. :src="threeZIndex == 1100?'/static/devicesOther/radio-b.png':'/static/devicesOther/radio-g.png'"
  77. mode="aspectFit"></image>
  78. </view>
  79. </view>
  80. <!-- <view :style="{height:threeTipHeight+'px'}"></view> -->
  81. <view class="flex justify-end">
  82. <view class="bluetooth-guide-number" style="margin-top: 32rpx;">3</view>
  83. <view class="position-relative">
  84. <image style="width: 462rpx; height:206rpx;"
  85. src="../../../static/guide/blutooth/boxRight@2x.png">
  86. </image>
  87. <view class="position-absolute-center text-regular"
  88. style="width: 392rpx;height: 144rpx;top: 44rpx;">选择设备类型连接,按钮勾选上表示手柄连接成功。如果连接失败请重试</view>
  89. </view>
  90. </view>
  91. </view>
  92. <!-- 4 -->
  93. <view class="flex justify-center align-center flex-direction" style="margin-top: 60px;">
  94. <image style="width: 446rpx; height: 384rpx; margin-bottom: 28rpx;"
  95. src="../../../static/guide/blutooth/guide-ble-bind.png">
  96. </image>
  97. <view class="position-relative">
  98. <image style="width: 520rpx; height:166rpx;" src="../../../static/guide/blutooth/boxMid@2x.png">
  99. </image>
  100. <view class="position-absolute-center text-regular" style="width: 438rpx;height: 96rpx;top: 26rpx;">
  101. 请将手柄十字键朝上插入绑带中,用绑带将手柄朝上绑在右脚脚踝上</view>
  102. </view>
  103. <view class="bluetooth-guide-number" style="margin-top: 36rpx;">4</view>
  104. </view>
  105. <!-- 5 -->
  106. <view class="flex justify-start align-center flex-direction" style="padding: 60px 0;">
  107. <!-- <view :style="{height:threeTipHeight+'px'}"></view> -->
  108. <view class="position-relative">
  109. <image style="width: 520rpx; height:162rpx;" src="../../../static/guide/blutooth/boxMid@2x.png">
  110. </image>
  111. <view class="position-absolute-center flex align-center justify-center"
  112. style="width: 438rpx;top: 32rpx;">
  113. <image style="width: 60rpx;height:60rpx;margin-right: 28rpx;"
  114. src="../../../static/guide/blutooth/guide-ble-finish@2x.png"></image>
  115. <view class=" text-regular " style="width: 336rpx;height: 90rpx;">
  116. 您已了解规则,返回主界面选择关卡开始游戏吧</view>
  117. </view>
  118. </view>
  119. <!-- <button class="cu-btn make-bg-bPurple text-white " style="width: 520rpx; height:81rpx;margin-top: 100rpx;"
  120. @click="onBack()">返回上一页</button> -->
  121. </view>
  122. </view>
  123. </view>
  124. </template>
  125. <script>
  126. import config from '@/common/config.js'
  127. import reqUtil from '@/util/util-js/requstUtil.js';
  128. import {
  129. mapState,
  130. mapMutations
  131. } from 'vuex';
  132. export default {
  133. computed: mapState(['BLEInfoList', 'systemInfo']),
  134. data() {
  135. return {
  136. devicesList: [],
  137. circular: true,
  138. videoList: [{
  139. id: "video0",
  140. src: "",
  141. img: ""
  142. },
  143. {
  144. id: "video1",
  145. src: "",
  146. img: ""
  147. },
  148. {
  149. id: "video2",
  150. src: "",
  151. img: ""
  152. }
  153. ],
  154. videoDataList: [],
  155. currentHeight: 0,
  156. threeTipHeight: 0,
  157. threeZIndex: 100,
  158. }
  159. },
  160. onLoad(op) {
  161. this.BLEInfoList.forEach((item, index, selfarr) => {
  162. //item.deviceType == 'BLEHandle' ||
  163. if (item.deviceType == 'BLERope') {
  164. let item = Object.assign({}, selfarr[index]);
  165. this.devicesList.push(item);
  166. }
  167. })
  168. this.currentHeight = this.systemInfo.windowHeight;
  169. // console.log(this.currentHeight);
  170. },
  171. onUnload() {
  172. },
  173. onShow() {
  174. },
  175. onReady() {
  176. let view = uni.createSelectorQuery().select('#task_0');
  177. view.boundingClientRect(data => {
  178. // console.log('参数:' + JSON.stringify(data));
  179. //13 是间隔
  180. this.threeTipHeight = data.top + data.height + 13;
  181. }).exec();
  182. },
  183. onHide() {},
  184. methods: {
  185. ...mapMutations([]),
  186. onBack() {
  187. uni.navigateBack({
  188. delta: 1
  189. })
  190. },
  191. onNavUpdateDevice() {
  192. uni.showToast({
  193. title: '点击此处升级硬件',
  194. icon: 'none'
  195. })
  196. },
  197. onSwiperChange(e) {
  198. let currentIndex = e.detail.current;
  199. // console.log(currentIndex);
  200. if (currentIndex === this._videoIndex) {
  201. return;
  202. }
  203. if (currentIndex === 2) {
  204. setTimeout(() => {
  205. this.threeZIndex = 1100;
  206. }, 200)
  207. } else {
  208. this.threeZIndex = 100;
  209. }
  210. // let isNext = false;
  211. // if (currentIndex === 0 && this._videoIndex === this.videoList.length - 1) {
  212. // isNext = true;
  213. // } else if (currentIndex === this.videoList.length - 1 && this._videoIndex === 0) {
  214. // isNext = false;
  215. // } else if (currentIndex > this._videoIndex) {
  216. // isNext = true;
  217. // }
  218. // if (isNext) {
  219. // this._videoDataIndex++;
  220. // } else {
  221. // this._videoDataIndex--;
  222. // }
  223. // if (this._videoDataIndex < 0) {
  224. // this._videoDataIndex = this.videoDataList.length - 1;
  225. // } else if (this._videoDataIndex >= this.videoDataList.length) {
  226. // this._videoDataIndex = 0;
  227. // }
  228. // this.circular = (this._videoDataIndex != 0);
  229. // if (this._videoIndex >= 0) {
  230. // this._videoContextList[this._videoIndex].pause();
  231. // this._videoContextList[this._videoIndex].seek(0);
  232. // }
  233. // this._videoIndex = currentIndex;
  234. },
  235. onNavtoHome() {
  236. uni.reLaunch({
  237. url: '../../personal-page/personal/personal'
  238. })
  239. }
  240. }
  241. }
  242. </script>
  243. <style>
  244. .hardware-border {
  245. border: 1rpx solid #9898FF;
  246. box-sizing: border-box;
  247. }
  248. .swiper {
  249. flex: 1;
  250. background-color: rgba(0, 0, 0, 0.32);
  251. }
  252. .swiper-item {
  253. flex: 1;
  254. }
  255. .video {
  256. flex: 1;
  257. /* #ifndef APP-PLUS */
  258. width: 100%;
  259. /* #endif */
  260. }
  261. .bluetooth-guide-number {
  262. border-radius: 18px;
  263. border-width: 1rpx;
  264. width: 30px;
  265. height: 30px;
  266. text-align: center;
  267. line-height: 30px;
  268. color: #000000;
  269. /* border-color: #FFFFFF; */
  270. background-color: #FFFFFF;
  271. margin-right: 13px;
  272. }
  273. </style>