favorites.vue 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. <!-- 蓝牙平台限制 todo https://uniapp.dcloud.io/api/system/bluetooth?id=stopbluetoothdevicesdiscovery -->
  2. <template>
  3. <view>
  4. <uni-nav-bar id="nav-bar" status-bar="true" @clickLeft="onBack()" 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. </uni-nav-bar>
  11. <view v-if="gameList.length==0" class="text-xs text-center text-gray margin-top">
  12. <text>下拉刷新列表</text>
  13. </view>
  14. <view v-else class="cu-list menu margin-top">
  15. <view class="cu-item" :class="true?'arrow':''" v-for="(item,index) in gameList" :key="index">
  16. <view v-if="platform == gamePlatform[item.platform] || item.platform == 2" class="content" @tap="_onConnectDevice(item,$event)">
  17. <image :src="item.icon" mode="aspectFit"></image>
  18. <text class="text-grey">{{item.name}}</text>
  19. </view>
  20. </view>
  21. </view>
  22. </view>
  23. </template>
  24. <script>
  25. import reqUtil from "@/util/util-js/requstUtil.js"
  26. import config from "@/common/config.js"
  27. import {
  28. mapState
  29. } from 'vuex';
  30. export default {
  31. computed: mapState(['platform','gamePlatform']),
  32. data() {
  33. return {
  34. gameList: []
  35. }
  36. },
  37. onLoad() {
  38. // reqUtil.requestData(config.URL.FAVORITESGET).then(res => {
  39. // console.log('FAVORITESADD =====', res);
  40. // if (res.code == 0) {
  41. // }
  42. // },
  43. // e => {
  44. // console.log(e)
  45. // });
  46. // reqUtil.requestData(config.URL.RECENTLYPLAYINGADD).then(res => {
  47. // console.log('RECENTLYPLAYINGADD =====', res);
  48. // if (res.code == 0) {
  49. // }
  50. // },
  51. // e => {
  52. // console.log(e)
  53. // });
  54. reqUtil.requestData(config.URL.RECENTLYPLAYINGGETBYPLATFORM).then(res => {
  55. console.log('RECENTLYPLAYINGGETBYPLATFORM =====', res);
  56. if (res.code == 0) {
  57. }
  58. },
  59. e => {
  60. console.log(e)
  61. });
  62. },
  63. methods: {
  64. onPullDownRefresh(e) {
  65. reqUtil.requestData(config.URL.FAVORITESGETBYPLATFORM).then(res => {
  66. console.log('FAVORITESGETBYPLATFORM =====', res);
  67. if (res.code == 0) {
  68. }
  69. },
  70. e => {
  71. console.log(e)
  72. });
  73. },
  74. onBack(){
  75. uni.navigateBack({
  76. delta:1
  77. })
  78. }
  79. }
  80. }
  81. </script>
  82. <style>
  83. </style>