banben.vue 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  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. <ezyActiveVue class="ezy-list-item-active xbb-item-box" v-for="item in data.banbenList" :key="item.id" @aclick="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. </ezyActiveVue>
  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. import ezyActiveVue from "@/components/ezyActive/ezyActive.vue";
  40. const data = reactive({
  41. dengjiId: null,
  42. banbenList: []
  43. })
  44. function getBanbenList() {
  45. shuxueHttp.getShuxueChanpinBanbenList({dengjiId: data.dengjiId}).then(res => {
  46. data.banbenList = res.data;
  47. })
  48. }
  49. function handleBack() {
  50. uni.switchTab({
  51. url: `/pages/chanpinXuanze/index`
  52. })
  53. }
  54. function handleSelect(item) {
  55. if (cacheManager.get('xuexi-shuxue')) {
  56. console.log('清除xuexi-shuxuexuexi-shuxue');
  57. cacheManager.remove("xuexi-shuxue")
  58. }
  59. /* uni.redirectTo({
  60. url: `/pages/chanpinneirong/index?banbenId=${item.id}&danyuanId=1&customType=3&chanpinId=${item.chanpinId}&dengjiId=${item.dengjiId}`
  61. }) */
  62. const opt = {
  63. banbenId: item.id,
  64. danyuanId:1, // 测试需要固定为 1
  65. chanpinId:item.chanpinId,
  66. dengjiId: item.dengjiId
  67. }
  68. cacheManager.updateObject("auth",{
  69. banbenId:item.id,
  70. chanpinId:item.chanpinId,
  71. dengjiId:item.dengjiId,
  72. })
  73. // 跳转
  74. uni.switchTab({
  75. url: "/pages/chanpinneirong/index"
  76. })
  77. }
  78. onLoad((options) => {
  79. data.dengjiId = options.dengjiId;
  80. getBanbenList();
  81. })
  82. </script>
  83. <style>
  84. </style>