guide.vue 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. <template>
  2. <view>
  3. <uni-nav-bar id="nav-bar" status-bar="true" @clickLeft="onBack()" :title="title" color="#000000" fixed="true"
  4. :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. </uni-nav-bar>
  11. <view class="card-view settings-item" v-for="(item,index) in list" :key="index">
  12. <view class="content position-relative" @tap="onNavTo(item)">
  13. <text class="text-black text-regular text-16px margin-left-xl">{{item.gameName}}</text>
  14. <view class="only-arrow"></view>
  15. </view>
  16. </view>
  17. </view>
  18. </template>
  19. <script>
  20. import reqUtil from "@/util/util-js/requstUtil.js"
  21. import config from "@/common/config.js"
  22. import {
  23. mapState,
  24. mapMutations
  25. } from 'vuex';
  26. export default {
  27. computed: mapState(['guideUnlockState']),
  28. data() {
  29. return {
  30. list: [{
  31. gameName: '新手指导',
  32. navType: 'personalGuide'
  33. }, {
  34. gameName: '蓝牙连接指导',
  35. navType: 'bluetoothConnect'
  36. },
  37. // {
  38. // gameName: '游戏手柄校准指导',
  39. // navType: 'feedback'
  40. // },
  41. {
  42. gameName: '关卡指导',
  43. navType: 'levelGuide'
  44. }
  45. ],
  46. title: "新手指导",
  47. type: '',
  48. }
  49. },
  50. onLoad(option) {
  51. },
  52. methods: {
  53. ...mapMutations(['setGuideUnlockState']),
  54. onBack() {
  55. uni.navigateBack({
  56. delta: 1
  57. })
  58. },
  59. onNavTo(item) {
  60. // console.log(item);
  61. let url = '';
  62. switch (item.navType) {
  63. case 'personalGuide':
  64. //跳回首页时候,重置新手教程
  65. let guideUnlockState = Object.assign(this.guideUnlockState, {
  66. //是否首次安装
  67. firstInstallation: true,
  68. // firstDisconnectBluetooth: true,
  69. firstUnlockJumpUp: true,
  70. firstUnlockLeftAndRightJump: true,
  71. firstUnlockLeftAndRightRotationJump: true,
  72. firstPromptSelectLevel:true
  73. });
  74. this.setGuideUnlockState(guideUnlockState);
  75. uni.switchTab({
  76. url: '../../personal-page/personal/personal',
  77. success: res => {},
  78. fail: () => {},
  79. complete: () => {}
  80. });
  81. return;
  82. case 'bluetoothConnect':
  83. url = './guide-ble-scroll';
  84. break;
  85. case 'levelGuide':
  86. url = './guide-level-scroll';
  87. break;
  88. }
  89. uni.navigateTo({
  90. url: url,
  91. success: res => {},
  92. fail: () => {},
  93. complete: () => {}
  94. });
  95. }
  96. }
  97. }
  98. </script>
  99. <style>
  100. .content {
  101. display: flex;
  102. flex-direction: row;
  103. align-items: center;
  104. height: 50px;
  105. }
  106. .settings-item {
  107. position: relative;
  108. background-color: #FFFFFF;
  109. border-radius: 10px;
  110. }
  111. </style>