| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- <template>
- <uni-popup ref="popupRef" :animation="false" :is-mask-click="false"
- mask-background-color="rgba(255, 255, 255, 0.1);" type="bottom">
- <view class="xuexi-dagang-page">
- <!-- 头部 -->
- <view class="dagang-title">
- <text></text>
- <icon @click="goUpPage"></icon>
- </view>
- <!-- 目录 -->
- <view class="xuexi-dagang-body">
- <view v-for="item in list" @click="handleSelect" :key="item.danyuanId"></view>
- </view>
- </view>
- </uni-popup>
- </template>
- <script setup>
- import {
- ref
- } from 'vue';
- const list = [];
- const popupRef = ref(null)
- const emits = defineEmits(['close', 'select'])
- import * as httpApi from "@/api/chanpinShuxue.js";
-
- function goUpPage() {
- this.$refs.popupRef.close();
- emits('close')
- }
-
- function showPopup(banbenId) {
- list.value = [];
- httpApi.getShuxueChanpinDanyuanMulu({banbenId}).then(res => {
- list.value = res.data;
- popupRef.value.open();
- })
- }
-
- function closePopup() {
- popupRef.value.close();
- }
-
- function handleSelect(item) {
- emits('select', item)
- closePopup();
- }
-
- defineExpose({
- showPopup
- })
- </script>
- <style>
- </style>
|