banben.vue 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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. <view class="xbb-item-box" v-for="item in data.banbenList" :key="item.id">
  9. <!-- 封面 -->
  10. <image class="item-img-box" :src="item.cover" mode=""></image>
  11. <view class="item-content-box">
  12. <!-- 名称+等级 -->
  13. <view class="item-name">{{item.chanpinName}} {{item.dengjiName}}</view>
  14. <!-- 版本名称 -->
  15. <view class="item-bb">{{item.name}}</view>
  16. </view>
  17. <view class="item-play-btn" @click="handleSelect(item)"></view>
  18. </view>
  19. </view>
  20. <CustomTabBar :currentTabNumber="0"></CustomTabBar>
  21. </view>
  22. </template>
  23. <script setup>
  24. import {reactive} from "vue";
  25. import {onLoad} from "@dcloudio/uni-app"
  26. import * as shuxueHttp from "@/api/chanpinShuxue.js"
  27. import CustomTabBar from "@/components/custom-tabbar/custom-tabbar.vue";
  28. const data = reactive({
  29. dengjiId: null,
  30. banbenList: []
  31. })
  32. function getBanbenList() {
  33. shuxueHttp.getShuxueChanpinBanbenList({dengjiId: data.dengjiId}).then(res => {
  34. data.banbenList = res.data;
  35. })
  36. }
  37. function handleBack() {
  38. uni.navigateBack()
  39. }
  40. function handleSelect(item) {
  41. uni.redirectTo({
  42. url: `/pages/chanpinXuanze/xuexi?banbenId=${item.id}`
  43. })
  44. }
  45. onLoad((options) => {
  46. data.dengjiId = options.dengjiId;
  47. getBanbenList();
  48. })
  49. </script>
  50. <style>
  51. </style>