banben.vue 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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="ezy-no-sj">
  23. <icon></icon>
  24. <text>暂无数据</text>
  25. </view>
  26. </template>
  27. </view>
  28. <CustomTabBar :currentTabNumber="0"></CustomTabBar>
  29. </view>
  30. </template>
  31. <script setup>
  32. import {reactive} from "vue";
  33. import {onLoad} from "@dcloudio/uni-app"
  34. import * as shuxueHttp from "@/api/chanpinShuxue.js"
  35. import CustomTabBar from "@/components/custom-tabbar/custom-tabbar.vue";
  36. const data = reactive({
  37. dengjiId: null,
  38. banbenList: []
  39. })
  40. function getBanbenList() {
  41. shuxueHttp.getShuxueChanpinBanbenList({dengjiId: data.dengjiId}).then(res => {
  42. data.banbenList = res.data;
  43. })
  44. }
  45. function handleBack() {
  46. uni.redirectTo({
  47. url: `/pages/chanpinXuanze/index`
  48. })
  49. }
  50. function handleSelect(item) {
  51. uni.redirectTo({
  52. url: `/pages/chanpinneirong/index?banbenId=${item.id}&danyuanId=1&customType=3&chanpinId=${item.chanpinId}&dengjiId=${item.dengjiId}`
  53. })
  54. }
  55. onLoad((options) => {
  56. data.dengjiId = options.dengjiId;
  57. getBanbenList();
  58. })
  59. </script>
  60. <style>
  61. </style>