card.vue 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <template>
  2. <view class="sx-card-box">
  3. <view class="card-head-box">
  4. <!-- 封面 -->
  5. <image :src="item.cover" class="head-img"></image>
  6. <view class="head-right-box">
  7. <!-- 名称 -->
  8. <view class="head-title">{{item.name}}</view>
  9. <!-- 简介 -->
  10. <view class="head-content">{{item.intro}}</view>
  11. <!-- 共计 -->
  12. <view class="head-content">{{item.gongji}}</view>
  13. </view>
  14. </view>
  15. <view class="card-body-box">
  16. <view class="body-title">请选择学习等级</view>
  17. <view class="dj-item-row">
  18. <ezyActiveVue v-for="cItem in item.levelList" class="ezy-btn-active dj-item"
  19. @aclick="handleSelect(cItem)" :class="{active: cItem.active}">{{cItem.levelName}}</ezyActiveVue>
  20. </view>
  21. </view>
  22. </view>
  23. </template>
  24. <script setup>
  25. import * as jisuanHttp from "@/api/chanpinJiSuanTeXun.js"
  26. import ezyActiveVue from "@/components/ezyActive/ezyActive.vue";
  27. import cacheManager from "@/utils/cacheManager.js";
  28. const porps = defineProps({
  29. item: {
  30. type: Object
  31. }
  32. })
  33. // 选择产品等级
  34. function handleSelect(item) {
  35. const opt = {
  36. dengjiId: item.dengjiId,
  37. }
  38. jisuanHttp.getChanpin2DengjiSave(opt).then(res => {
  39. if (!res.data) {
  40. return;
  41. }
  42. cacheManager.get('contentInfo') && cacheManager.remove('contentInfo');
  43. // 跳转
  44. uni.switchTab({
  45. url: "/pages/chanpinneirong/index"
  46. })
  47. })
  48. }
  49. </script>
  50. <style scoped>
  51. </style>