feat: 我的页面正在编写中

master
xjs 2025-03-20 18:02:12 +08:00
parent ed37c3cddd
commit 6078950093
18 changed files with 883 additions and 224 deletions

View File

@ -24,8 +24,8 @@
:style="[ :style="[
{ 'z-index': activeIndex === index ? 9 : 1 }, { 'z-index': activeIndex === index ? 9 : 1 },
{ top: activeIndex === index ? scrollInfo.y + 'px' : 0 }, { top: activeIndex === index ? scrollInfo.y + 'px' : 0 },
isList ? { height: item.height + 'px' } : getItemStyle, isList ? { height: item.height + 'px' } : getItemStyle,
{ position: 'absolute' },
]" ]"
class="base-drag-wrapper" class="base-drag-wrapper"
> >
@ -58,7 +58,6 @@
{ 'z-index': activeIndex === index ? 9 : 1 }, { 'z-index': activeIndex === index ? 9 : 1 },
{ top: activeIndex === index ? scrollInfo.y + 'px' : 0 }, { top: activeIndex === index ? scrollInfo.y + 'px' : 0 },
isList ? { height: item.height + 'px' } : getItemStyle, isList ? { height: item.height + 'px' } : getItemStyle,
{ position: 'absolute' },
]" ]"
class="base-drag-wrapper" class="base-drag-wrapper"
> >
@ -261,13 +260,10 @@ const getAreaStyle = computed(() => {
const w = getRealWidth(width.value) const w = getRealWidth(width.value)
let h: string | number = props.height let h: string | number = props.height
if (h === 'auto') { if (h === 'auto') {
if (isList.value) { // / * = 使viewMaxHeightitem item
// h = isList.value
h = showList.value.reduce((total, item) => total + (item.height || defaultHeight), 0) ? viewMaxHeight.value
} else { : Math.ceil(showList.value.length / props.column) * getItemHeight.value
//
h = Math.ceil(showList.value.length / props.column) * getItemHeight.value
}
} }
let style = { let style = {
width: w + 'px', width: w + 'px',
@ -333,174 +329,56 @@ const getPosition = (index: number, list = cloneList.value): [number, number] =>
return [x, y] return [x, y]
} }
// //
interface Task { const initList = (list: ItemType[] = [], changeheight: boolean = false) => {
index: number const newList = deepCopy(list)
priority: number showList.value = newList.map((item, index) => {
timestamp: number const [x, y] = getPosition(index)
let data = {
...item,
x,
y,
dropId: index + 1,
} }
let key = 'slot' + Math.random() + index
const taskQueue = ref<Task[]>([]) // xykey
const isProcessing = ref(false) if (x === item?.x && y === item?.y) {
const lastFrameTime = ref(0) if (activeIndex.value !== index) {
const FRAME_DURATION = 16 // 16ms // key
const IDLE_TIMEOUT = 50 // key = item.key
const defaultHeight = 400 // 400rpx
const viewportTop = ref(0)
const viewportHeight = ref(0)
const viewportBottom = computed(() => viewportTop.value + viewportHeight.value)
//
const calculatePriority = (index: number, y: number, height: number): number => {
let priority = 0
//
if (y <= viewportBottom.value && y + height >= viewportTop.value) {
priority = 3
} }
//
else if (y < viewportBottom.value + 200) {
priority = 2
} }
// data.key = key
else { return data
priority = 1 })
} cloneList.value = deepCopy(showList.value)
return priority nextTick(() => {
} showArea.value = true
})
// if (changeheight && props.itemHeight === 'auto') {
const processTask = (task: Task) => {
return new Promise<void>((resolve) => {
const item = showList.value[task.index]
if (!item) {
resolve()
return
}
//
const query = uni.createSelectorQuery().in(instance.proxy) const query = uni.createSelectorQuery().in(instance.proxy)
query query
.selectAll('.slotContent') .selectAll('.slotContent')
.boundingClientRect((data) => { .boundingClientRect((data) => {
if (data && Array.isArray(data) && data[task.index]) { let domList = JSON.parse(JSON.stringify(data))
// let max = 0
item.height = data[task.index].height let _viewMaxHeight = 0
for (let i = 0; i < domList.length; i++) {
// y let height = domList[i].height
let y = 0 if (isList.value) {
for (let i = 0; i < task.index; i++) { cloneList.value[i].height = height
y += data[i].height || defaultHeight
} }
_viewMaxHeight += height
// x if (height > max) {
const x = (task.index % props.column) * Number(getItemWidth.value) max = height
//
item.x = x
item.y = y
//
showList.value[task.index] = { ...item }
console.log('更新高度和位置:', task.index, item.height, item.x, item.y)
} }
resolve() }
viewMaxHeight.value = _viewMaxHeight //
itemMaxHeight.value = max + 'px'
initList(cloneList.value)
}) })
.exec() .exec()
})
} }
//
const scheduleTask = async () => {
if (isProcessing.value || taskQueue.value.length === 0) return
isProcessing.value = true
const currentTime = Date.now()
const timeSinceLastFrame = currentTime - lastFrameTime.value
//
if (timeSinceLastFrame < FRAME_DURATION) {
await new Promise((resolve) => setTimeout(resolve, FRAME_DURATION - timeSinceLastFrame))
}
//
const task = taskQueue.value.reduce((prev, curr) => (prev.priority > curr.priority ? prev : curr))
//
taskQueue.value = taskQueue.value.filter((t) => t.index !== task.index)
//
await processTask(task)
lastFrameTime.value = Date.now()
isProcessing.value = false
//
if (taskQueue.value.length > 0) {
setTimeout(() => {
scheduleTask()
}, 0)
}
}
//
const initList = (list: ItemType[] = [], changeheight: boolean = false): Promise<void> => {
return new Promise((resolve) => {
const newList = deepCopy(list)
// 使
showList.value = newList.map((item, index) => {
let y = 0
//
for (let i = 0; i < index; i++) {
y += newList[i]?.height || defaultHeight
}
const x = (index % props.column) * Number(getItemWidth.value)
return {
...item,
x,
y,
height: item.height || defaultHeight,
dropId: index + 1,
key: 'slot' + Math.random() + index,
}
})
cloneList.value = deepCopy(showList.value)
if (changeheight && props.itemHeight === 'auto') {
//
taskQueue.value = showList.value.map((_, index) => ({
index,
priority: 0,
timestamp: Date.now(),
}))
//
nextTick(() => {
console.log('开始处理任务队列:', taskQueue.value.length)
scheduleTask()
})
} else {
resolve()
}
})
}
//
const handleScroll = (e: any) => {
const scrollTop = e.detail.scrollTop
viewportTop.value = scrollTop
//
taskQueue.value = taskQueue.value.map((task) => ({
...task,
priority: calculatePriority(
task.index,
showList.value[task.index].y,
showList.value[task.index].height,
),
}))
} }
// //
@ -509,6 +387,10 @@ const showPlaceholder = (i: number): boolean => {
// , // ,
let isShow = false let isShow = false
if (moveToIndex.value > activeIndex.value) { if (moveToIndex.value > activeIndex.value) {
// i-1;
if (moveToIndex.value === i - 1) {
isShow = true
}
} else if (moveToIndex.value === activeIndex.value) { } else if (moveToIndex.value === activeIndex.value) {
return false // return false //
} else if (moveToIndex.value < activeIndex.value) { } else if (moveToIndex.value < activeIndex.value) {
@ -734,10 +616,8 @@ const getViewCallback = (data: any, size: number) => {
return return
} }
width.value = data.width width.value = data.width
showArea.value = true //
nextTick(() => { nextTick(() => {
console.log('初始化列表,数据长度:', showList.value.length) initList(showList.value, true) // dom
initList(showList.value, true)
}) })
} }
@ -766,10 +646,8 @@ showList.value = deepCopy(props.list) || []
// //
onMounted(() => { onMounted(() => {
nextTick(() => {
setLeoDrag() setLeoDrag()
}) })
})
// //
defineExpose({ defineExpose({
@ -787,21 +665,12 @@ defineExpose({
display: flex; display: flex;
align-items: center; align-items: center;
transition: top 0.4s; transition: top 0.4s;
position: absolute;
left: 0;
top: 0;
flex-wrap: wrap; flex-wrap: wrap;
/* #ifndef APP-NVUE */ /* #ifndef APP-NVUE */
width: 100%; width: 100%;
/* #endif */ /* #endif */
} }
.movable-area {
position: relative;
width: 100%;
overflow: hidden;
}
.slotContent { .slotContent {
display: flex; display: flex;
/* #ifndef APP-NVUE */ /* #ifndef APP-NVUE */

View File

@ -42,7 +42,7 @@
<text class="text-[32rpx] font-semibold">[{{ item.yxdm }}]{{ item.yxmc }}</text> <text class="text-[32rpx] font-semibold">[{{ item.yxdm }}]{{ item.yxmc }}</text>
<text class="text-[22rpx] text-[#505050]">{{ item.cityname }}·{{ item.ulevel }}</text> <text class="text-[22rpx] text-[#505050]">{{ item.cityname }}·{{ item.ulevel }}</text>
<text class="text-[#8F959E] text-[22rpx] my-[6rpx]"> <text class="text-[#8F959E] text-[22rpx] my-[6rpx]">
{{ item.featuretag?.split('/').slice(0, 4).join('/') }}/ 排名68 {{ item.featuretag?.split('/').slice(0, 4).join('/') }}/ 排名{{ item.zytjRank }}
</text> </text>
</view> </view>
</view> </view>

View File

@ -88,6 +88,7 @@ const rankDiff = (index: number, item) => {
} }
const recompileData = computed(() => { const recompileData = computed(() => {
if (!props.data) return []
let _data = props.data.map((item, index) => { let _data = props.data.map((item, index) => {
item['rankDiff'] = rankDiff(index, item) item['rankDiff'] = rankDiff(index, item)
item['lineDiff'] = item['score'] - props.score item['lineDiff'] = item['score'] - props.score

View File

@ -65,6 +65,7 @@
<view <view
class="overflow-auto transition-all duration-300" class="overflow-auto transition-all duration-300"
:style="{ maxHeight: isCollapsed ? '0' : '100vh' }" :style="{ maxHeight: isCollapsed ? '0' : '100vh' }"
v-if="!isCollapsed"
> >
<DragSort v-model:list="college.vItems" ref="majorDrop" @get-list="getMajorList"> <DragSort v-model:list="college.vItems" ref="majorDrop" @get-list="getMajorList">
<template #content="{ data }"> <template #content="{ data }">

View File

@ -100,23 +100,21 @@ const handleMove = (index) => {
myDrop.value.handleLongpress(index) myDrop.value.handleLongpress(index)
} }
const handleDelete = async (index) => { const handleDelete = (index) => {
// //
wishList.value.splice(index, 1) wishList.value.splice(index, 1)
await myDrop.value.initList(wishList.value, true) myDrop.value.initList(wishList.value)
} }
const handleUpdateHeight = async () => { const handleUpdateHeight = () => {
// DragSort // DragSort
await myDrop.value?.initList(wishList.value, true) myDrop.value?.initList(wishList.value, true)
} }
const handleDeleteMajor = async (index, majorIndex) => { const handleDeleteMajor = async (index, majorIndex) => {
wishList.value[index].vItems.splice(majorIndex, 1) wishList.value[index].vItems.splice(majorIndex, 1)
userStore.sortWishMajorList({ list: wishList.value[index].vItems, uIndex: index }) userStore.sortWishMajorList({ list: wishList.value[index].vItems, uIndex: index })
myDrop.value?.initList(wishList.value, true).then(() => { myDrop.value?.initList(wishList.value, true)
handleUpdateHeight()
})
} }
const handleSave = () => { const handleSave = () => {
@ -148,13 +146,14 @@ const addWishList = () => {
} }
}) })
let params = { let params = {
cId: userStore.userInfo.estimatedAchievement.id, cId: userStore.userInfo.estimatedAchievement.wxId,
tableName: wishListName.value, tableName: wishListName.value,
batchName: userStore.userInfo.batchName, batchName: userStore.userInfo.batchName,
type: typeName, type: typeName,
subjectClaim: userStore.userInfo.estimatedAchievement.subjectGroup, subjectClaim: userStore.userInfo.estimatedAchievement.subjectGroup,
score: +userStore.userInfo.estimatedAchievement.expectedScore, score: +userStore.userInfo.estimatedAchievement.expectedScore,
vTbDetails: _vTbDetails, vTbDetails: _vTbDetails,
LocationCode: userStore.userInfo.estimatedAchievement.provinceCode,
} }
saveWishList(params).then((res) => { saveWishList(params).then((res) => {
if (res.code === 200) { if (res.code === 200) {

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

@ -0,0 +1,76 @@
<route lang="json5" type="page">
{
style: {
navigationBarTitleText: '我的预约',
},
}
</route>
<template>
<scroll-view scroll-y class="pb-safe bg-[#f8f8f8]">
<view class="item-wrapper" v-for="(item, index) in wishList" :key="index">
<view class="flex gap-[24rpx] wish-border justify-between p-[32rpx] rounded-[8rpx]">
<view class="flex flex-col gap-[14rpx]">
<text class="text-[#303030] text-[32rpx] font-semibold">
{{ item.tableName }}
</text>
<text class="text-[22rpx] text-[#303030]">{{ item.createTime || '时间消失了' }}</text>
</view>
<view class="flex flex-col justify-between items-center">
<button class="download-btn" @click="handleDelete(item, index)">取消预约</button>
</view>
</view>
</view>
</scroll-view>
</template>
<script setup lang="ts">
import { deleteWishList, getWishList } from '@/service/index/api'
import { useUserStore } from '@/store'
const userStore = useUserStore()
const wishList = ref([])
onLoad(() => {
getWishList().then((res) => {
if (res.code === 200) {
wishList.value = res.result as any[]
}
})
})
const handleDelete = (item, index) => {
deleteWishList({ id: item.vId }).then((res) => {
if (res.code === 200) {
wishList.value.splice(index, 1)
uni.showToast({ title: '删除成功' })
}
})
}
</script>
<style lang="scss" scoped>
.download-btn {
border-radius: 8rpx;
border: 2rpx solid #1580ff;
font-size: 22rpx;
display: flex;
align-items: center;
justify-content: center;
gap: 8rpx;
line-height: 1;
padding: 12rpx 16rpx;
height: max-content;
color: #1580ff;
}
.item-wrapper {
padding: 32rpx;
}
.wish-border {
background-color: #ffffff;
border-radius: 8rpx;
}
</style>

View File

@ -0,0 +1,62 @@
<route lang="json5" type="page">
{
style: {
navigationBarTitleText: '测评结果',
},
}
</route>
<template>
<scroll-view scroll-y class="pb-safe bg-[#f8f8f8]">
<view class="item-wrapper" v-for="(item, index) in wishList" :key="index">
<view class="flex gap-[24rpx] wish-border justify-between p-[32rpx] rounded-[8rpx]">
<view class="flex flex-col gap-[14rpx]">
<text class="text-[#303030] text-[32rpx] font-semibold">
{{ item.tableName }}
</text>
<text class="text-[22rpx] text-[#303030]">{{ item.createTime || '时间消失了' }}</text>
</view>
<view class="flex flex-col justify-between items-end">
<view class="i-carbon-trash-can" @click="handleDelete(item, index)"></view>
</view>
</view>
</view>
</scroll-view>
</template>
<script setup lang="ts">
import { deleteWishList, getWishList } from '@/service/index/api'
import { useUserStore } from '@/store'
const userStore = useUserStore()
const wishList = ref([])
onLoad(() => {
getWishList().then((res) => {
if (res.code === 200) {
wishList.value = res.result as any[]
}
})
})
const handleDelete = (item, index) => {
deleteWishList({ id: item.vId }).then((res) => {
if (res.code === 200) {
wishList.value.splice(index, 1)
uni.showToast({ title: '删除成功' })
}
})
}
</script>
<style lang="scss" scoped>
.item-wrapper {
padding: 32rpx;
}
.wish-border {
background-color: #ffffff;
border-radius: 8rpx;
}
</style>

View File

@ -1,11 +0,0 @@
<route lang="json5" type="page">
{
style: {
navigationBarTitleText: '六纬VIP会员卡',
},
}
</route>
<template></template>
<script setup lang="ts"></script>

View File

@ -0,0 +1,159 @@
<route lang="json5" type="page">
{
style: {
navigationBarTitleText: '我的收藏',
},
}
</route>
<template>
<z-paging
ref="paging"
use-virtual-list
:force-close-inner-list="true"
cell-height-mode="dynamic"
@virtualListChange="virtualListChange"
@query="queryList"
:auto-show-system-loading="true"
>
<template #top>
<z-tabs
:current="currentTab"
:list="tabsList"
:scrollCount="4"
inactive-color="#BFBFBF"
active-color="#303030"
:bar-style="{ backgroundColor: '#1580FF' }"
:tabsStyle="{ position: 'sticky', top: '0', zIndex: '9' }"
@change="handleTabChange"
v-bind="{} as any"
/>
</template>
<view
class="item-wrapper"
:id="`zp-id-${item.zp_index}`"
:key="item.zp_index"
v-for="(item, index) in starList"
>
<view class="flex gap-[24rpx] py-[40rpx] border-bt" v-if="currentTab === 0">
<image class="w-[112rpx] h-[112rpx]" :src="item.logo" mode="scaleToFill" />
<view class="flex justify-between items-center flex-1">
<view class="flex flex-col" hover-class="none">
<text class="text-[28rpx] text-[#333] font-semibold mb-[6rpx]">
{{ item.name }}
</text>
<view class="flex items-center gap-[8rpx] mb-[16rpx]">
<view
class="truncate max-w-[176rpx] bg-[#f8f8f8] rounded-[4rpx] text-[20rpx] px-[8rpx] py-[2rpx]"
v-for="(fea, fIndex) in item.features.slice(0, 5)"
:key="fIndex"
>
{{ fea }}
</view>
</view>
<text class="text-[22rpx] text-[#999] font-normal">
{{ item.cityName }}.{{ item.nature }}
</text>
</view>
</view>
<button class="collect-btn" plain @click.stop="handleStar(item)">
<view class="i-carbon-star-filled text-[#FFB032]" v-if="item.isStar"></view>
<view class="i-carbon-star" v-else></view>
收藏
</button>
</view>
<view class="flex gap-[24rpx] py-[40rpx] border-bt" v-if="currentTab === 1">
<view class="flex flex-col">
<view>
<text></text>
<text>专业代码001121</text>
</view>
<text>本科批·四年</text>
</view>
<button class="collect-btn" plain @click="handleStar(item)">
<view class="i-carbon-star-filled text-[#FFB032]" v-if="item.isStar"></view>
<view class="i-carbon-star" v-else></view>
收藏
</button>
</view>
</view>
</z-paging>
</template>
<script setup lang="ts">
import zTabs from '@/pages-sub/uni_modules/z-tabs/components/z-tabs/z-tabs.vue'
import { addUnCollection, deleteUnCollection, getUnCollectionList } from '@/service/index/api'
import { useUserStore } from '@/store'
const userStore = useUserStore()
const tabsList = ['院校']
const currentTab = ref(0)
const handleTabChange = (index: number) => {
currentTab.value = index
}
const starList = ref([])
const paging = ref(null)
const queryList = (page: number, pageSize: number) => {
getUnCollectionList({
Page: page,
PageSize: pageSize,
SearchKey: '',
}).then((res) => {
if (res.code === 200) {
paging.value.complete((res.result as any[]).map((item) => ({ ...item, isStar: true })))
}
})
}
const virtualListChange = (_vList) => {
starList.value = _vList
}
const handleStar = (item: any) => {
if (item.isStar) {
deleteUnCollection({
wxId: userStore.userInfo.estimatedAchievement.wxId,
uId: item._id,
}).then((resp) => {
if (resp.code === 200) {
item.isStar = false
}
})
} else {
addUnCollection({
wxId: userStore.userInfo.estimatedAchievement.wxId,
uId: item._id,
}).then((resp) => {
if (resp.code === 200) {
item.isStar = true
}
})
}
}
</script>
<style lang="scss" scoped>
.collect-btn {
border-radius: 8rpx;
border: 2rpx solid #eeeeee;
font-size: 22rpx;
display: flex;
align-items: center;
justify-content: center;
gap: 8rpx;
line-height: 1;
padding: 8rpx 12rpx;
height: max-content;
}
.item-wrapper {
padding: 0 32rpx;
align-items: center;
}
.border-bt {
border-bottom: 2rpx solid #eeeeee;
}
</style>

View File

@ -0,0 +1,166 @@
<template>
<view class="vip-table-container">
<!-- VIP专栏背景 -->
<view class="vip-column-bg"></view>
<!-- 表格内容 -->
<view class="vip-table">
<!-- 表头 -->
<view class="vip-table-header">
<view class="feature-column">功能</view>
<view class="vip-column vip-header">
<image src="@/pages-sub/static/images/ucenter/vip-crown.png" class="vip-icon"></image>
</view>
<view class="normal-column">普通用户</view>
</view>
<!-- 表格内容 -->
<view class="vip-table-body">
<view class="vip-table-row" v-for="(item, index) in featureList" :key="index">
<view class="feature-name">{{ item.name }}</view>
<view class="vip-access">
<text v-if="item.vipAccess" class="check-icon"></text>
<text v-else>-</text>
</view>
<view class="normal-access">{{ item.normalAccess }}</view>
</view>
</view>
</view>
</view>
</template>
<script setup>
import { ref } from 'vue'
const featureList = ref([
{
name: '志愿填报表AI解读',
vipAccess: true,
normalAccess: '—',
},
{
name: '11项测评报告AI解读',
vipAccess: true,
normalAccess: '—',
},
{
name: '高考信息咨询AI咨询',
vipAccess: true,
normalAccess: '次数限制',
},
])
</script>
<style scoped>
.vip-table-container {
font-size: 24rpx;
position: relative;
margin-top: 30rpx;
margin-bottom: 30rpx;
color: #333333;
}
.vip-column-bg {
position: absolute;
width: 19%;
left: 50%;
top: -30rpx;
bottom: -30rpx;
background: linear-gradient(180deg, rgba(254, 235, 192, 0.8) 0%, rgba(255, 204, 104, 0.8) 100%);
z-index: 0;
border-radius: 20rpx;
}
.vip-table {
position: relative;
z-index: 0;
overflow: hidden;
border-radius: 20rpx;
box-shadow: 0 4rpx 24rpx rgba(0, 0, 0, 0.05);
}
.vip-table-header,
.vip-table-row {
display: flex;
width: 100%;
font-weight: 500;
}
.vip-table-header {
background-color: transparent;
font-weight: 500;
}
.feature-column,
.feature-name {
flex: 4;
text-align: left;
padding: 24rpx 32rpx;
background-color: #fff;
font-weight: 500;
display: flex;
align-items: center;
}
.vip-column,
.vip-access {
flex: 2;
display: flex;
justify-content: center;
align-items: center;
padding: 24rpx 0;
background-color: transparent;
position: relative;
z-index: 3;
}
.normal-column,
.normal-access {
flex: 3;
display: flex;
justify-content: center;
align-items: center;
padding: 24rpx 0;
color: #666;
background-color: #fff;
}
.vip-header {
display: flex;
justify-content: center;
align-items: center;
}
.vip-icon {
width: 66rpx;
height: 46rpx;
background-color: transparent;
}
.check-icon {
color: #8b5a00;
font-weight: bold;
font-size: 36rpx;
}
.vip-table-body {
background-color: transparent;
}
.vip-table-row:last-child {
border-bottom: none;
}
.feature-column,
.normal-column {
border-radius: 20rpx 0 0 0;
}
.feature-column:not(:last-child),
.feature-name:not(:last-child) {
border-bottom: 1rpx solid #f5f5f5;
}
.normal-access,
.normal-column {
border-bottom: 1rpx solid #f5f5f5;
}
</style>

View File

@ -0,0 +1,148 @@
<route lang="json5" type="page">
{
style: {
navigationBarTitleText: '六纬VIP会员卡',
},
}
</route>
<template>
<view class="h-screen flex flex-col bg-[#f8f8f8]">
<view class="px-[32rpx]">
<image
src="@/pages-sub/static/images/ucenter/vip-back.png"
class="mt-[32rpx] h-[400rpx]"
mode="aspectFit"
/>
<view
class="flex flex-col rounded-[16rpx] bg-[#fff] mt-[30rpx] pt-[24rpx] pl-[18rpx] pr-[20rpx] pb-[32rpx]"
>
<view class="flex items-center gap-[16rpx]">
<view class="text-[32rpx] font-semibold">
<text class="text-[#303030]">六纬VIP</text>
<text class="text-[#784B0F]">会员权益</text>
</view>
<text class="text-[20rpx] text-[#636363]">服务截止2025.9.1</text>
</view>
<view class="text-[28rpx] font-semibold flex gap-[12rpx] mt-[16rpx]">
<view
class="flex flex-col items-center justify-center text-item gap-[16rpx] w-[208rpx] h-[124rpx] rounded-[16rpx]"
>
<view>
<text class="text-[#784B0F]">志愿</text>
<text>填报表</text>
</view>
<text>AI解读</text>
</view>
<view
class="flex flex-col items-center justify-center text-item gap-[16rpx] w-[208rpx] h-[124rpx] rounded-[16rpx]"
>
<view>
<text class="text-[#784B0F]">11项测评</text>
<text>报告</text>
</view>
<text>AI解读</text>
</view>
<view
class="flex flex-col items-center justify-center text-item gap-[16rpx] w-[208rpx] h-[124rpx] rounded-[16rpx]"
>
<view>
<text class="text-[#784B0F]">高考信息</text>
<text>资讯</text>
</view>
<text>AI咨询</text>
</view>
</view>
</view>
<VipTable class="mt-[40rpx]" />
</view>
<view
class="pb-safe bottom-0 left-0 mt-auto px-[32rpx] pt-[24rpx] bg-[#fff] text-[22rpx] flex flex-col gap-[16rpx] items-center"
>
<text class="text-[22rpx] text-[#303030]">生涯测评+志愿填报报告无限解读</text>
<button
class="custom-button-bg text-[#9D5800] text-[28rpx] font-semibold rounded-[8rpx] h-[80rpx]! w-full!"
@tap="handleOpenVip"
>
{{ productionList.price }} Vip会员
</button>
<view>
<text class="text-[#636363]">开通会员表示同意</text>
<text class="text-[#9D5800]">会员协议</text>
</view>
</view>
</view>
</template>
<script setup lang="ts">
import VipTable from './components/VipTable.vue'
import { getProductionList, payTransaction } from '@/service/index/api'
import { useUserStore } from '@/store/user'
const userStore = useUserStore()
const productionList = ref({ price: 0, name: '' })
const handleOpenVip = () => {
payTransaction({
total: productionList.value.price * 100,
openId: userStore.userInfo.openid,
description: productionList.value.name,
}).then((res) => {
if (res.code === 200) {
requestPay(res.result)
} else {
uni.showToast({
title: res.message,
icon: 'none',
})
}
})
}
const requestPay = (res) => {
uni.requestPayment({
provider: 'wxpay',
timeStamp: res.timeStamp,
orderInfo: '',
nonceStr: res.nonceStr, //32
package: res.package, //prepay_id prepay_id=xx
signType: res.signType, //MD5
paySign: res.paySign, //
success: (result) => {
uni.showToast({
title: '支付成功!',
icon: 'success',
})
uni.navigateBack()
},
fail: (error) => {
console.log(error)
},
})
}
onLoad(() => {
getProductionList({ Id: '653695577120837' }).then((res) => {
if (res.code === 200) {
productionList.value = res.result as { price: number; name: string }
}
})
})
</script>
<style scoped lang="scss">
.text-item {
background: linear-gradient(45deg, #fdf8ee 0%, #fff5dc 100%);
}
.custom-button-bg {
display: flex;
justify-content: center;
align-items: center;
background: linear-gradient(270deg, #f9e1b5 0%, #e4be80 100%);
}
</style>

View File

@ -0,0 +1,119 @@
<route lang="json5" type="page">
{
style: {
navigationBarTitleText: '我的志愿表',
},
}
</route>
<template>
<scroll-view scroll-y class="pb-safe bg-[#f8f8f8]">
<view class="item-wrapper" v-for="(item, index) in wishList" :key="index">
<view class="flex gap-[24rpx] wish-border justify-between p-[32rpx] rounded-[8rpx]">
<view>
<view class="flex gap-[18rpx] items-center">
<text class="text-[#303030] text-[32rpx] font-semibold">{{ item.tableName }}</text>
<view
class="bg-[#F8F8F8] text-[20rpx] text-[#636363] px-[8rpx] py-[4rpx] rounded-[8rpx]"
>
{{ userStore.userInfo.estimatedAchievement.provinceName }}·{{ item.type }}
</view>
</view>
<view class="text-[22rpx] text-[#303030] mt-[14rpx] mb-[22rpx]">
<text>{{ item.score }}</text>
<text class="ml-[24rpx]">{{ item.subjectClaim.split(',').join('/') }}</text>
</view>
<text class="text-[22rpx] text-[#303030]">{{ item.createTime || '时间消失了' }}</text>
</view>
<view class="flex flex-col justify-between items-end">
<view class="i-carbon-trash-can" @click="handleDelete(item, index)"></view>
<button class="download-btn" @click="handleDownload(item)">PDF</button>
</view>
</view>
</view>
</scroll-view>
</template>
<script setup lang="ts">
import { deleteWishList, getWishList } from '@/service/index/api'
import { useUserStore } from '@/store'
const userStore = useUserStore()
const wishList = ref([])
onLoad(() => {
getWishList().then((res) => {
if (res.code === 200) {
wishList.value = res.result as any[]
}
})
})
const handleDelete = (item, index) => {
deleteWishList({ id: item.vId }).then((res) => {
if (res.code === 200) {
wishList.value.splice(index, 1)
uni.showToast({ title: '删除成功' })
}
})
}
const handleDownload = (item) => {
uni.downloadFile({
url: '',
success: function (res) {
console.log(res)
let filepathss = res.tempFilePath
setTimeout(
() =>
uni.openDocument({
filePath: filepathss,
showMenu: false,
success: function () {
console.log('打开文档成功')
uni.hideLoading()
},
fail: function () {
uni.showToast({
title: '暂不支持此类型',
duration: 2000,
icon: 'none',
})
uni.hideLoading()
},
}),
1000,
)
},
fail: function (res) {
console.log(res) //
},
})
}
</script>
<style lang="scss" scoped>
.download-btn {
border-radius: 8rpx;
border: 2rpx solid #1580ff;
font-size: 22rpx;
display: flex;
align-items: center;
justify-content: center;
gap: 8rpx;
line-height: 1;
padding: 12rpx 16rpx;
height: max-content;
color: #1580ff;
}
.item-wrapper {
padding: 32rpx;
}
.wish-border {
background-color: #ffffff;
border-radius: 8rpx;
}
</style>

View File

@ -114,13 +114,6 @@
{ {
"root": "pages-sub", "root": "pages-sub",
"pages": [ "pages": [
{
"path": "ucenter/openVip",
"type": "page",
"style": {
"navigationBarTitleText": "六纬VIP会员卡"
}
},
{ {
"path": "customerService/index/index", "path": "customerService/index/index",
"type": "page", "type": "page",
@ -262,6 +255,41 @@
"style": { "style": {
"navigationBarTitleText": "当前志愿表" "navigationBarTitleText": "当前志愿表"
} }
},
{
"path": "ucenter/appointment/appointment",
"type": "page",
"style": {
"navigationBarTitleText": "我的预约"
}
},
{
"path": "ucenter/evaluate/evaluateList",
"type": "page",
"style": {
"navigationBarTitleText": "测评结果"
}
},
{
"path": "ucenter/star/myStar",
"type": "page",
"style": {
"navigationBarTitleText": "我的收藏"
}
},
{
"path": "ucenter/vip/openVip",
"type": "page",
"style": {
"navigationBarTitleText": "六纬VIP会员卡"
}
},
{
"path": "ucenter/wishList/wishList",
"type": "page",
"style": {
"navigationBarTitleText": "我的志愿表"
}
} }
] ]
}, },

View File

@ -51,7 +51,7 @@
<view <view
class="mx-[32rpx] flex items-center justify-center text-[#303030] text-[24rpx] bg-[#fff] pt-[24rpx] pb-[18rpx] gap-[144rpx] rounded-[8rpx]" class="mx-[32rpx] flex items-center justify-center text-[#303030] text-[24rpx] bg-[#fff] pt-[24rpx] pb-[18rpx] gap-[144rpx] rounded-[8rpx]"
> >
<view class="flex flex-col items-center gap-[16rpx]"> <view class="flex flex-col items-center gap-[16rpx]" @click="goWishList">
<image <image
src="@/pages-sub/static/images/ucenter/wish-list.png" src="@/pages-sub/static/images/ucenter/wish-list.png"
class="w-[51rpx] h-[51rpx]" class="w-[51rpx] h-[51rpx]"
@ -59,7 +59,7 @@
/> />
<text>志愿表</text> <text>志愿表</text>
</view> </view>
<view class="flex flex-col items-center gap-[16rpx]"> <view class="flex flex-col items-center gap-[16rpx]" @click="goEvaluate">
<image <image
src="@/pages-sub/static/images/ucenter/evaluation-list.png" src="@/pages-sub/static/images/ucenter/evaluation-list.png"
class="w-[51rpx] h-[51rpx]" class="w-[51rpx] h-[51rpx]"
@ -67,7 +67,7 @@
/> />
<text>测评结果</text> <text>测评结果</text>
</view> </view>
<view class="flex flex-col items-center gap-[16rpx]"> <view class="flex flex-col items-center gap-[16rpx]" @click="goStar">
<image <image
src="@/pages-sub/static/images/ucenter/star.png" src="@/pages-sub/static/images/ucenter/star.png"
class="w-[51rpx] h-[51rpx]" class="w-[51rpx] h-[51rpx]"
@ -78,12 +78,15 @@
</view> </view>
<view class="mx-[32rpx] bg-[#fff] rounded-[8rpx]"> <view class="mx-[32rpx] bg-[#fff] rounded-[8rpx]">
<view class="flex items-center justify-between mx-[32rpx] py-[28rpx] not-last-child"> <view
class="flex items-center justify-between mx-[32rpx] py-[28rpx] not-last-child"
@click="goAppointment"
>
<text>我的预约</text> <text>我的预约</text>
<view class="i-carbon-chevron-down rotate-270 text-[#BFBFBF]"></view> <view class="i-carbon-chevron-down rotate-270 text-[#BFBFBF]"></view>
</view> </view>
<view class="flex items-center justify-between mx-[32rpx] py-[28rpx]"> <view class="flex items-center justify-between mx-[32rpx] py-[28rpx]">
<text>我的预约</text> <text>激活记录</text>
<view class="i-carbon-chevron-down rotate-270 text-[#BFBFBF]"></view> <view class="i-carbon-chevron-down rotate-270 text-[#BFBFBF]"></view>
</view> </view>
</view> </view>
@ -113,7 +116,7 @@ const goVip = () => {
switch (platform) { switch (platform) {
case 'android': case 'android':
uni.navigateTo({ uni.navigateTo({
url: '/pages-sub/ucenter/openVip', url: '/pages-sub/ucenter/vip/openVip',
}) })
break break
case 'ios': case 'ios':
@ -123,11 +126,35 @@ const goVip = () => {
break break
default: default:
uni.navigateTo({ uni.navigateTo({
url: '/pages-sub/ucenter/openVip', url: '/pages-sub/ucenter/vip/openVip',
}) })
break break
} }
} }
const goStar = () => {
uni.navigateTo({
url: '/pages-sub/ucenter/star/myStar',
})
}
const goWishList = () => {
uni.navigateTo({
url: '/pages-sub/ucenter/wishList/wishList',
})
}
const goEvaluate = () => {
uni.navigateTo({
url: '/pages-sub/ucenter/evaluate/evaluateList',
})
}
const goAppointment = () => {
uni.navigateTo({
url: '/pages-sub/ucenter/appointment/appointment',
})
}
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>

View File

@ -289,6 +289,7 @@ type WishListParams = {
type: string type: string
subjectClaim: string subjectClaim: string
score: number score: number
LocationCode: string
vTbDetails: { vTbDetails: {
unId: number unId: number
unName: string unName: string
@ -309,3 +310,19 @@ type WishListParams = {
export const saveWishList = (params: WishListParams) => { export const saveWishList = (params: WishListParams) => {
return http.post('/api/volunTb/post', params) return http.post('/api/volunTb/post', params)
} }
export const getProductionList = (params: { Id: string }) => {
return http.get('/api/busProduct/detail', params)
}
export const payTransaction = (params: { total: number; openId: string; description: string }) => {
return http.post('/api/sysWechatPay/payTransaction', params)
}
export const getWishList = () => {
return http.get('/api/volunTb/list')
}
export const deleteWishList = (params: { id: number }) => {
return http.post('/api/volunTb/delete', params)
}

View File

@ -9,7 +9,6 @@ interface NavigateToOptions {
"/pages/evaluation/index/index" | "/pages/evaluation/index/index" |
"/pages/expert/index/index" | "/pages/expert/index/index" |
"/pages/ucenter/index/index" | "/pages/ucenter/index/index" |
"/pages-sub/ucenter/openVip" |
"/pages-sub/customerService/index/index" | "/pages-sub/customerService/index/index" |
"/pages-sub/home/autoFill/index" | "/pages-sub/home/autoFill/index" |
"/pages-sub/home/career/index" | "/pages-sub/home/career/index" |
@ -30,6 +29,11 @@ interface NavigateToOptions {
"/pages-sub/home/schoolRank/index" | "/pages-sub/home/schoolRank/index" |
"/pages-sub/home/wishesList/index" | "/pages-sub/home/wishesList/index" |
"/pages-sub/home/wishesList/wishesList" | "/pages-sub/home/wishesList/wishesList" |
"/pages-sub/ucenter/appointment/appointment" |
"/pages-sub/ucenter/evaluate/evaluateList" |
"/pages-sub/ucenter/star/myStar" |
"/pages-sub/ucenter/vip/openVip" |
"/pages-sub/ucenter/wishList/wishList" |
"/login-sub/index" | "/login-sub/index" |
"/pages-evaluation-sub/index" | "/pages-evaluation-sub/index" |
"/pages-evaluation-sub/aiAutoFill/index" | "/pages-evaluation-sub/aiAutoFill/index" |

View File

@ -1,6 +0,0 @@
// 枚举定义
export enum TestEnum {
A = '1',
B = '2',
}