productDialog.vue 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. <template>
  2. <uni-popup ref="detailPopup" :animation="false" :is-mask-click="false"
  3. mask-background-color="rgba(51, 137, 217, 0.65);" style="z-index: 101;">
  4. <view class="mall-detail-dialog">
  5. <view class="detail-content-box">
  6. <icon class="cpmx-title"></icon>
  7. <icon class="dialog-close-btn" @click="detailCloseBtn"></icon>
  8. <view class="product-body-box">
  9. <!-- ↓需要换成从接口中取得 wgy -->
  10. <view class="detail-item-box" @click="goDao(item,index)" v-for="(item,index) in productList "
  11. :key="index">
  12. <img :src="item.cover" class="mall-image mt-20" />
  13. <view class="content-body-box">
  14. <view class="content-name">
  15. <view class="name-text">{{item.levelName}}</view>
  16. </view>
  17. </view>
  18. </view>
  19. </view>
  20. </view>
  21. </view>
  22. </uni-popup>
  23. </template>
  24. <script setup>
  25. import {
  26. orderInfo
  27. } from "@/api/order.js"
  28. import {
  29. toast,
  30. debounce,
  31. getUserIdentity
  32. } from "@/utils/common";
  33. import {
  34. ref
  35. } from 'vue';
  36. import cacheManager from '@/utils/cacheManager.js';
  37. const $emit = defineEmits(['payBtn'])
  38. const detailPopup = ref(null); // 索引
  39. let productList = ref([])
  40. // 打开弹窗
  41. function detailShow(data) {
  42. productList.value = data
  43. detailPopup.value.open();
  44. }
  45. function goDao(data, index) {
  46. console.log('data', data);
  47. console.log('index', index);
  48. cacheManager.updateObject('auth', {
  49. typeId: data.typeId,
  50. levelId: data.levelId,
  51. subjectId: data.subjectId,
  52. })
  53. if (data.subjectId == 2 && data.typeId == 1) {
  54. cacheManager.remove('zhangInfo')
  55. uni.redirectTo({
  56. url: `/pages/selectVersion/selectVersion`
  57. })
  58. } else {
  59. cacheManager.remove('zhangInfo')
  60. uni.redirectTo({
  61. url: `/pages/study/index`
  62. })
  63. }
  64. }
  65. // 开启提分之旅按钮
  66. function detailPayBtn() {
  67. $emit('payBtn')
  68. }
  69. function detailCloseBtn() {
  70. detailPopup.value.close();
  71. }
  72. defineExpose({
  73. detailShow
  74. })
  75. </script>