banben.vue 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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">
  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" @click="handleSelect(item)"></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. const data = reactive({
  39. dengjiId: null,
  40. banbenList: []
  41. })
  42. function getBanbenList() {
  43. shuxueHttp.getShuxueChanpinBanbenList({dengjiId: data.dengjiId}).then(res => {
  44. data.banbenList = res.data;
  45. })
  46. }
  47. function handleBack() {
  48. uni.redirectTo({
  49. url: `/pages/chanpinXuanze/index`
  50. })
  51. }
  52. function handleSelect(item) {
  53. if (cacheManager.get('xuexi-shuxue')) {
  54. cacheManager.remove("xuexi-shuxue")
  55. }
  56. uni.redirectTo({
  57. url: `/pages/chanpinneirong/index?banbenId=${item.id}&danyuanId=1&customType=3&chanpinId=${item.chanpinId}&dengjiId=${item.dengjiId}`
  58. })
  59. }
  60. onLoad((options) => {
  61. data.dengjiId = options.dengjiId;
  62. getBanbenList();
  63. })
  64. </script>
  65. <style>
  66. </style>