volunteer-secondary/src/pages-sub/wishlist/create/saveSecondBatchWishList.vue

140 lines
6.1 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<script lang="ts" setup>
import MxDialog from "@/pages-sub/components/dialog/index.vue"
import { getMyScore, saveWishlist } from "@/service"
import { useWishlistStore } from "@/store"
import { storeToRefs } from "pinia"
definePage({
style: {
navigationBarTitleText: '我的志愿表'
},
excludeLoginPath: true,
})
const show = ref(false)
const handleSave = () => {
show.value = true
}
const wishlistStore = useWishlistStore()
const {extendWishlist} = storeToRefs(wishlistStore)
const content = JSON.parse(extendWishlist.value.contents)
const schools = ref(content.schools)
const wishListName = ref("")
const totalScore = ref(0)
const handleSubmit = () =>{
saveWishlist({data:{title:wishListName.value,contents:extendWishlist.value.contents,batchName:'第二批次',TotalScore:totalScore.value}}).then(resp => {
if(resp.code === 200){
show.value = false
wishlistStore.clearExtendWishlist();
uni.switchTab({url:"/pages/index/index"})
}
})
}
const navigateToHome = () => {
wishlistStore.clearExtendWishlist();
uni.switchTab({url:"/pages/index/index"})
}
onShow(() => {
getMyScore().then(resp => {
if (resp.code === 200 && resp.result) {
totalScore.value = resp.result.totalScore
}
})
})
onBackPress(() => {
wishlistStore.clearExtendWishlist();
})
</script>
<template>
<view class="flex flex-col h-screen ">
<view class="pb-safe flex-1 flex flex-col overflow-hidden">
<view class="flex-1 overflow-y-auto px-[30rpx] bg-[#F8F8F8]">
<view v-for="(val, index) in schools" :key="index" class="flex mt-[26rpx]">
<view
class="py-[29rpx] text-[30rpx] text-[#333] grid gap-[8rpx] bg-white px-[30rpx] py-[20rpx] not-last:mb-[30rpx] rounded-[16rpx] w-full">
<view class="text-[32rpx] font-600">{{ val.schoolName }}</view>
<view class="text-[24rpx] text-[#333]">{{new Date().getFullYear()}}计划招生:{{ val.planCount }}人</view>
<!-- <view class="flex items-center">
<view class="text-[#666] bg-[#F8F8F8] rounded-[8rpx] px-[10rpx] py-[4rpx]"
v-for="value in 2" :key="value"></view>
</view> -->
<view class="text-[#333] text-[24rpx]">
{{ val.region }}·{{ val.schoolNature }}
</view>
</view>
</view>
<view class=" bg-[#FEF6F6] rounded-[16rpx] mt-[30rpx]">
<view class="h-[52rpx] w-[178rpx] flex items-center m-[-8rpx] ml-[20rpx]">
<image src="https://lwzk.ycymedu.com/img/tianbao/tb_shuoming.png"
mode="scaleToFill" class="h-[52rpx] w-[178rpx]" />
</view>
<view class="flex flex-col text-[#E03C33] py-[20rpx] pl-[26rpx] pr-[34rpx]">
<view class="text-[26rpx] mt-[4rpx]">
<view>
二志愿录取成功后不再进入后续批次
</view>
<view>
建议选择目标明确的学校同时关注第三批次平行志愿机会
</view>
</view>
</view>
</view>
</view>
<view class="grid grid-cols-2 gap-[20rpx] px-[28rpx] py-[16rpx]">
<view class="rounded-[16rpx] bg-[#f5f5f5] text-[#333] text-[36rpx] py-[18rpx] text-center" @click="navigateToHome"></view>
<view class="rounded-[16rpx] bg-[#1580FF] text-white text-[36rpx] py-[18rpx] text-center"
@click="handleSave"></view>
</view>
</view>
<MxDialog v-model:show="show" title="" :defaultPadding="false" defaultWidth="80%" rootClass="rounded-[40rpx]">
<template>
<view class="rounded-[40rpx] bg-white p-[40rpx] custom-background"
style="--status-bar-height:56rpx; --start-color:#ebf1ff">
<view class="text-[40rpx] font-500 text-center">志愿表名称</view>
<view class="rounded-full py-[20rpx] px-[30rpx] bg-[#F3F4F8] border-[#E5E5E5] border-solid border-[1rpx] flex items-center justify-between my-[60rpx]">
<input type="text" v-model="wishListName" placeholder="请输入志愿表名称" confirm-type="done"
placeholder-style="color:#C5C8D1;font-size:30rpx;text-align:left;" class="text-left flex-1">
<view class="w-[40rpx] h-[40rpx] flex items-center" v-if="wishListName" @click="wishListName = ''">
<image
src="https://lwzk.ycymedu.com/img/tianbao/tb_shanchu.png"
mode="scaleToFill"
class="w-[40rpx] h-[40rpx]"
/>
</view>
</view>
<view class="grid grid-cols-2 items-center mx-[40rpx] gap-[24rpx]">
<view
class="text-[34rpx] font-500 text-[#999] bg-white rounded-full py-[20rpx] text-center border border-[#eee] border-solid"
@click="show = false">取消</view>
<view class="text-[34rpx] font-500 text-white bg-[#1580FF] rounded-full py-[20rpx] text-center"
@click="handleSubmit"></view>
</view>
</view>
</template>
</MxDialog>
</view>
</template>
<style lang="scss" scoped>
.custom-background {
background: linear-gradient(180deg, #ecf2ff 0%,#f6f8ff 40rpx, #fff 128rpx);
background-position: 50% 50%;
background-origin: padding-box;
background-clip: border-box;
background-size: auto auto;
}
</style>