productDialog.vue 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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 " :key="index">
  11. <img :src="item.cover" class="mall-image mt-20" />
  12. <view class="content-body-box">
  13. <view class="content-name">
  14. <view class="name-text">{{item.levelName}}</view>
  15. </view>
  16. </view>
  17. </view>
  18. </view>
  19. </view>
  20. </view>
  21. </uni-popup>
  22. </template>
  23. <script setup>
  24. import {
  25. orderInfo
  26. } from "@/api/order.js"
  27. import {
  28. toast,
  29. debounce,
  30. getUserIdentity
  31. } from "@/utils/common";
  32. import {
  33. ref
  34. } from 'vue';
  35. import cacheManager from '@/utils/cacheManager.js';
  36. const $emit = defineEmits(['payBtn'])
  37. const detailPopup = ref(null); // 索引
  38. let productList = ref([])
  39. // 打开弹窗
  40. function detailShow(data) {
  41. productList.value = data
  42. detailPopup.value.open();
  43. }
  44. function goDao(data,index){
  45. console.log('data',data);
  46. console.log('index',index);
  47. cacheManager.updateObject('auth', {
  48. typeId: data.typeId,
  49. levelId: data.levelId,
  50. subjectId: data.subjectId,
  51. currentZhang: 0
  52. })
  53. cacheManager.remove('daoPageCache')
  54. uni.redirectTo({
  55. url: `/pages/study/index`
  56. })
  57. }
  58. // 开启提分之旅按钮
  59. function detailPayBtn() {
  60. $emit('payBtn')
  61. }
  62. function detailCloseBtn() {
  63. detailPopup.value.close();
  64. }
  65. defineExpose({
  66. detailShow
  67. })
  68. </script>