wangxy 1 month ago
parent
commit
1c6405d80b
1 changed files with 56 additions and 0 deletions
  1. 56 0
      pages/xinshuxue/components/danyuanMulu.vue

+ 56 - 0
pages/xinshuxue/components/danyuanMulu.vue

@@ -0,0 +1,56 @@
+<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() {
+		list.value = [];
+		httpApi.getShuxueChanpinDanyuanMulu().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>