|
@@ -15,49 +15,52 @@
|
|
|
<ie-image src="/pagesStudy/static/image/icon-edit-pen.png" custom-class="w-24 h-24" mode="aspectFill" />
|
|
<ie-image src="/pagesStudy/static/image/icon-edit-pen.png" custom-class="w-24 h-24" mode="aspectFill" />
|
|
|
</view> -->
|
|
</view> -->
|
|
|
</view>
|
|
</view>
|
|
|
- <view v-if="hasDirectedSchool" class="px-30">
|
|
|
|
|
- <l-drag ref="dragRef" :list="directedSchoolList" :column="1" gridHeight="104px" :touchHandle="touchHandle" ghost
|
|
|
|
|
- handle @change="changeSort">
|
|
|
|
|
- <!-- // 每一项的插槽 grid 的 content 您传入的数据 -->
|
|
|
|
|
- <template #grid="{ active, content, index }">
|
|
|
|
|
- <!-- // grid.active 是否为当前拖拽项目 根据自己需要写样式 -->
|
|
|
|
|
- <view class="bg-white rounded-10 py-28 pl-30 pr-20 relative flex items-center gap-x-16 mb-20"
|
|
|
|
|
- :class="{ 'border border-solid border-primary': active }">
|
|
|
|
|
- <view class="w-44 text-64 text-primary font-bold absolute top-6 left-14 italic leading-[1] opacity-30 z-1">
|
|
|
|
|
- {{ index + 1 }}
|
|
|
|
|
- </view>
|
|
|
|
|
- <view slot="handle" @touchstart="touchHandle = true" @touchend="touchHandle = false">
|
|
|
|
|
- <ie-image src="/pagesStudy/static/image/icon-drag.png" custom-class="w-46 h-46" mode="aspectFill" />
|
|
|
|
|
- </view>
|
|
|
|
|
- <view class="flex-1 min-w-1 flex items-center gap-x-20">
|
|
|
|
|
- <ie-image :src="content.universityLogo" custom-class="w-96 h-96" mode="aspectFill" />
|
|
|
|
|
- <view class="flex-1 min-w-1">
|
|
|
|
|
- <view class="text-28 text-fore-title font-bold">{{ content.universityName }}</view>
|
|
|
|
|
- <view class="mt-8 w-fit text-20 text-primary border border-solid border-primary rounded-4 px-10 py-4">
|
|
|
|
|
- {{ content.majorName }}
|
|
|
|
|
- </view>
|
|
|
|
|
- <view class="flex items-center justify-between text-20">
|
|
|
|
|
- <view class="mt-8 text-fore-light">{{ content.majorAncestors }}</view>
|
|
|
|
|
- <view v-if="index === 0"
|
|
|
|
|
- class="flex items-center gap-x-4 text-white bg-gradient-to-r from-[#FED448] to-[#F9942F] rounded-full px-12 py-4">
|
|
|
|
|
- <ie-image src="/pagesStudy/static/image/icon-check-white.png" custom-class="w-24 h-24" />
|
|
|
|
|
- <text>定向学习中</text>
|
|
|
|
|
|
|
+ <view class="relative">
|
|
|
|
|
+ <view class="px-30">
|
|
|
|
|
+ <l-drag ref="dragRef" :list="sortList" :column="1" gridHeight="104px" :touchHandle="touchHandle" ghost handle
|
|
|
|
|
+ @change="changeSort">
|
|
|
|
|
+ <!-- // 每一项的插槽 grid 的 content 您传入的数据 -->
|
|
|
|
|
+ <template #grid="{ active, content, index }">
|
|
|
|
|
+ <!-- // grid.active 是否为当前拖拽项目 根据自己需要写样式 -->
|
|
|
|
|
+ <view class="bg-white rounded-10 py-28 pl-30 pr-20 relative flex items-center gap-x-16 mb-20"
|
|
|
|
|
+ :class="{ 'border border-solid border-primary': active }">
|
|
|
|
|
+ <view
|
|
|
|
|
+ class="w-44 text-64 text-primary font-bold absolute top-6 left-14 italic leading-[1] opacity-30 z-1">
|
|
|
|
|
+ {{ index + 1 }}
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <view slot="handle" @touchstart="touchHandle = true" @touchend="touchHandle = false">
|
|
|
|
|
+ <ie-image src="/pagesStudy/static/image/icon-drag.png" custom-class="w-46 h-46" mode="aspectFill" />
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <view class="flex-1 min-w-1 flex items-center gap-x-20">
|
|
|
|
|
+ <ie-image :src="content.universityLogo" custom-class="w-96 h-96" mode="aspectFill" />
|
|
|
|
|
+ <view class="flex-1 min-w-1">
|
|
|
|
|
+ <view class="text-28 text-fore-title font-bold">{{ content.universityName }}</view>
|
|
|
|
|
+ <view class="mt-8 w-fit text-20 text-primary border border-solid border-primary rounded-4 px-10 py-4">
|
|
|
|
|
+ {{ content.majorName }}
|
|
|
</view>
|
|
</view>
|
|
|
- <view v-else class="flex items-center gap-x-4 text-22 text-primary px-12 py-4"
|
|
|
|
|
- @click="handleSetDirectedSchool(content, index)">
|
|
|
|
|
- <text>设置定向</text>
|
|
|
|
|
|
|
+ <view class="flex items-center justify-between text-20">
|
|
|
|
|
+ <view class="mt-8 text-fore-light">{{ content.majorAncestors }}</view>
|
|
|
|
|
+ <view v-if="index === 0"
|
|
|
|
|
+ class="flex items-center gap-x-4 text-white bg-gradient-to-r from-[#FED448] to-[#F9942F] rounded-full px-12 py-4">
|
|
|
|
|
+ <ie-image src="/pagesStudy/static/image/icon-check-white.png" custom-class="w-24 h-24" />
|
|
|
|
|
+ <text>定向学习中</text>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <view v-else class="flex items-center gap-x-4 text-22 text-primary px-12 py-4"
|
|
|
|
|
+ @click="handleSetDirectedSchool(content, index)">
|
|
|
|
|
+ <text>设置定向</text>
|
|
|
|
|
+ </view>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
- </view>
|
|
|
|
|
- </template>
|
|
|
|
|
- <template #ghots></template>
|
|
|
|
|
- </l-drag>
|
|
|
|
|
- </view>
|
|
|
|
|
- <view v-else class="flex-1 flex flex-col items-center justify-center gap-y-50">
|
|
|
|
|
- <ie-image src="/pagesStudy/static/image/icon-empty.png" custom-class="w-364 h-252 mx-auto" mode="aspectFill" />
|
|
|
|
|
- <text class="text-30 text-fore-light text-center">目前暂无定向院校~</text>
|
|
|
|
|
|
|
+ </template>
|
|
|
|
|
+ <template #ghots></template>
|
|
|
|
|
+ </l-drag>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <view v-if="sortList.length === 0" class="flex-1 flex flex-col items-center justify-center gap-y-50">
|
|
|
|
|
+ <ie-image src="/pagesStudy/static/image/icon-empty.png" custom-class="w-364 h-252 mx-auto" mode="aspectFill" />
|
|
|
|
|
+ <text class="text-30 text-fore-light text-center">目前暂无定向院校~</text>
|
|
|
|
|
+ </view>
|
|
|
</view>
|
|
</view>
|
|
|
<ie-safe-toolbar v-if="directedSchoolList.length < 3" :height="84" :shadow="false">
|
|
<ie-safe-toolbar v-if="directedSchoolList.length < 3" :height="84" :shadow="false">
|
|
|
<view class="px-46 pt-24">
|
|
<view class="px-46 pt-24">
|
|
@@ -74,6 +77,7 @@ import { getDirectedSchool, saveDirectedSchool } from '@/api/modules/study';
|
|
|
const { transferTo } = useTransferPage();
|
|
const { transferTo } = useTransferPage();
|
|
|
const loading = ref(true);
|
|
const loading = ref(true);
|
|
|
const directedSchoolList = ref<DirectedSchool[]>([]);
|
|
const directedSchoolList = ref<DirectedSchool[]>([]);
|
|
|
|
|
+const sortList = ref<DirectedSchool[]>([]);
|
|
|
const touchHandle = ref(false)
|
|
const touchHandle = ref(false)
|
|
|
const hasDirectedSchool = computed(() => directedSchoolList.value.length > 0);
|
|
const hasDirectedSchool = computed(() => directedSchoolList.value.length > 0);
|
|
|
const handleSetDirectedSchool = async (item: DirectedSchool, index: number) => {
|
|
const handleSetDirectedSchool = async (item: DirectedSchool, index: number) => {
|
|
@@ -90,18 +94,18 @@ const handleAdd = () => {
|
|
|
}
|
|
}
|
|
|
}).then(async res => {
|
|
}).then(async res => {
|
|
|
if (res) {
|
|
if (res) {
|
|
|
-
|
|
|
|
|
|
|
+ uni.$ie.showLoading();
|
|
|
|
|
+ directedSchoolList.value.push({
|
|
|
|
|
+ ...res,
|
|
|
|
|
+ code: (res as SelectedUniversityMajor).universityId
|
|
|
|
|
+ } as DirectedSchool);
|
|
|
setTimeout(() => {
|
|
setTimeout(() => {
|
|
|
dragRef.value.push({
|
|
dragRef.value.push({
|
|
|
...res,
|
|
...res,
|
|
|
code: (res as SelectedUniversityMajor).universityId
|
|
code: (res as SelectedUniversityMajor).universityId
|
|
|
} as DirectedSchool);
|
|
} as DirectedSchool);
|
|
|
- // directedSchoolList.value = [...directedSchoolList.value, {
|
|
|
|
|
- // ...res,
|
|
|
|
|
- // code: (res as SelectedUniversityMajor).universityId
|
|
|
|
|
- // } as DirectedSchool];
|
|
|
|
|
- // save(directedSchoolList.value);
|
|
|
|
|
- }, 500);
|
|
|
|
|
|
|
+ uni.$ie.hideLoading();
|
|
|
|
|
+ }, 300);
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
@@ -113,14 +117,20 @@ const changeSort = (e: any) => {
|
|
|
const save = async (list: DirectedSchool[]) => {
|
|
const save = async (list: DirectedSchool[]) => {
|
|
|
uni.$ie.showLoading();
|
|
uni.$ie.showLoading();
|
|
|
await saveDirectedSchool(list);
|
|
await saveDirectedSchool(list);
|
|
|
- await loadData();
|
|
|
|
|
|
|
+ await refresh();
|
|
|
uni.$ie.hideLoading();
|
|
uni.$ie.hideLoading();
|
|
|
uni.$ie.showSuccess('设置成功');
|
|
uni.$ie.showSuccess('设置成功');
|
|
|
loading.value = false;
|
|
loading.value = false;
|
|
|
}
|
|
}
|
|
|
-const loadData = async () => {
|
|
|
|
|
|
|
+const refresh = async () => {
|
|
|
const { data } = await getDirectedSchool();
|
|
const { data } = await getDirectedSchool();
|
|
|
directedSchoolList.value = data || [];
|
|
directedSchoolList.value = data || [];
|
|
|
|
|
+ sortList.value = [...directedSchoolList.value];
|
|
|
|
|
+}
|
|
|
|
|
+const loadData = async () => {
|
|
|
|
|
+ uni.$ie.showLoading();
|
|
|
|
|
+ await refresh();
|
|
|
|
|
+ uni.$ie.hideLoading();
|
|
|
}
|
|
}
|
|
|
loadData();
|
|
loadData();
|
|
|
</script>
|
|
</script>
|