|
|
@@ -2,7 +2,7 @@
|
|
|
import Loading from '@/components/loading.uvue'
|
|
|
import Back from '@/components/back.uvue'
|
|
|
import { ref, onMounted } from 'vue'
|
|
|
-import { querySubjectInfo, querySubjectInfoNoLogin } from '@/services/subject/info'
|
|
|
+import { querySubjectInfo, querySubjectInfoNoLogin, querySubjectUnit } from '@/services/subject/info'
|
|
|
import type { SubjectInfoResult } from '@/services/subject/info'
|
|
|
import { router, debounce, user } from "@/.cool";
|
|
|
|
|
|
@@ -10,15 +10,8 @@ const isLoading = ref(true)
|
|
|
const dataList = ref<any[]>([])
|
|
|
|
|
|
async function getDataList() {
|
|
|
- const filePath = 'https://oss.xiaoxiongcode.com/physics-unit-practice/unit-pic.txt'
|
|
|
- uni.request({
|
|
|
- url: filePath,
|
|
|
- method: 'GET',
|
|
|
- success: (res) => {
|
|
|
- dataList.value = res.data as any[]
|
|
|
- console.log(dataList.value)
|
|
|
- }
|
|
|
- })
|
|
|
+ const res = await querySubjectUnit()
|
|
|
+ dataList.value = res || []
|
|
|
}
|
|
|
onMounted(async () => {
|
|
|
try {
|
|
|
@@ -61,7 +54,8 @@ function handleDetail(item: any) {
|
|
|
<scroll-view class="scroll-view_H" direction="horizontal" :show-scrollbar="false" ref="cardsScrollView">
|
|
|
<view class="scroll-view-item_H bg-[white]" v-for="course in dataList || []" :key="course.id"
|
|
|
@tap="handleDetail(course)">
|
|
|
- <cl-image :src="course?.ossPath" mode="heightFix" class="!w-full !h-[30vh] mb-[10px] rounded-xl"></cl-image>
|
|
|
+ <cl-image :src="course?.unitPicPath" mode="heightFix"
|
|
|
+ class="!w-full !h-[30vh] mb-[10px] rounded-xl"></cl-image>
|
|
|
<text class="text-[4vh] font-bold">{{ course.sortNum }} 、{{
|
|
|
course.name }}</text>
|
|
|
</view>
|