banben.vue 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. <template>
  2. <view class="ezy-xbb-page">
  3. <view class="icon-title-navBar-box">
  4. <view class="nav-bar-icon" @click="handleBack"></view>
  5. <view class="nav-bar-title">选择版本</view>
  6. </view>
  7. <view class="xbb-list-box">
  8. <template v-if="data.banbenList.length">
  9. <view class="xbb-item-box" v-for="item in data.banbenList" :key="item.id" @click="handleSelect(item)">
  10. <!-- 封面 -->
  11. <image class="item-img-box" :src="item.cover" mode=""></image>
  12. <view class="item-content-box">
  13. <!-- 名称+等级 -->
  14. <view class="item-name">{{item.chanpinName}} {{item.dengjiName}}</view>
  15. <!-- 版本名称 -->
  16. <view class="item-bb">{{item.name}}</view>
  17. </view>
  18. <view class="item-play-btn"></view>
  19. </view>
  20. </template>
  21. <template v-else>
  22. <view class="shiti-frame-box">
  23. <view class="ezy-no-sj">
  24. <icon></icon>
  25. <text>暂无数据</text>
  26. </view>
  27. </view>
  28. </template>
  29. </view>
  30. <!-- <CustomTabBar :currentTabNumber="0"></CustomTabBar> -->
  31. </view>
  32. </template>
  33. <script setup>
  34. import {reactive} from "vue";
  35. import {onLoad} from "@dcloudio/uni-app"
  36. import * as shuxueHttp from "@/api/chanpinShuxue.js"
  37. // import CustomTabBar from "@/components/custom-tabbar/custom-tabbar.vue";
  38. import cacheManager from "@/utils/cacheManager.js";
  39. const data = reactive({
  40. dengjiId: null,
  41. banbenList: []
  42. })
  43. function getBanbenList() {
  44. shuxueHttp.getShuxueChanpinBanbenList({dengjiId: data.dengjiId}).then(res => {
  45. data.banbenList = res.data;
  46. })
  47. }
  48. function handleBack() {
  49. uni.redirectTo({
  50. url: `/pages/chanpinXuanze/index`
  51. })
  52. }
  53. function handleSelect(item) {
  54. if (cacheManager.get('xuexi-shuxue')) {
  55. cacheManager.remove("xuexi-shuxue")
  56. }
  57. /* uni.redirectTo({
  58. url: `/pages/chanpinneirong/index?banbenId=${item.id}&danyuanId=1&customType=3&chanpinId=${item.chanpinId}&dengjiId=${item.dengjiId}`
  59. }) */
  60. const opt = {
  61. banbenId: item.id,
  62. danyuanId:1, // 测试需要固定为 1
  63. chanpinId:item.chanpinId,
  64. dengjiId: item.dengjiId
  65. }
  66. // 跳转
  67. uni.switchTab({
  68. url: "/pages/chanpinneirong/index"
  69. })
  70. }
  71. onLoad((options) => {
  72. data.dengjiId = options.dengjiId;
  73. getBanbenList();
  74. })
  75. </script>
  76. <style>
  77. </style>