guide-ble-scroll.vue 8.4 KB

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