diff --git a/src/App.vue b/src/App.vue index 6be28ea..805bca8 100644 --- a/src/App.vue +++ b/src/App.vue @@ -19,8 +19,7 @@ const routesWithBottomNav = [ '/', '/transfers', '/matching', - '/points-history', - '/profile', + '/mypoints-history', '/shop', '/orders', '/mainpage', diff --git a/src/router/index.js b/src/router/index.js index e866b18..d3bab5f 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -104,15 +104,6 @@ const routes = [ title: '商品详情' } }, - { - path: '/login', - name: 'Login', - component: () => import('@/views/Login.vue'), - meta: { - title: '登录', - hideForAuth: true - } - }, { path: '/register', name: 'Register', @@ -131,15 +122,6 @@ const routes = [ requiresAuth: true } }, - { - path: '/profile', - name: 'Profile', - component: () => import('@/views/Profile.vue'), - meta: { - title: '个人中心', - requiresAuth: true - } - }, { path: '/orders', name: 'Orders', @@ -149,16 +131,6 @@ const routes = [ requiresAuth: true } }, - { - path: '/points-history', - name: 'PointsHistory', - component: () => import('@/views/PointsHistory.vue'), - meta: { - title: '积分记录', - requiresAuth: true - } - }, - { path: '/task-center', name: 'TaskCenter', diff --git a/src/views/Login.vue b/src/views/Login.vue deleted file mode 100644 index 256ba58..0000000 --- a/src/views/Login.vue +++ /dev/null @@ -1,502 +0,0 @@ - - - - - - 用户登录 - 欢迎回到炬融圈 - - - - - - - - - - - - - - - - - - 记住我 - - 忘记密码? - - - - - - - {{ userStore.loading ? '登录中...' : '登录' }} - - - - - - - - - - - - - - - - - 浙ICP备2025186895号 - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/views/MyPointsHistory.vue b/src/views/MyPointsHistory.vue index 1ae714d..d72663a 100644 --- a/src/views/MyPointsHistory.vue +++ b/src/views/MyPointsHistory.vue @@ -272,6 +272,29 @@ const getPointsText = (type, points) => { return isNegative ? `-${points}` : `+${points}` } +const getRecordTitle = (type, description) => { + const titleMap = { + earn: '积分获得', + spend: '积分消费', + task: '任务奖励', + exchange: '商品兑换', + review: '评价奖励', + share: '分享奖励', + refund: '积分退还' + } + + // 如果有特定的描述,可以根据描述生成更具体的标题 + if (description.includes('订单支付')) { + return '订单支付' + } else if (description.includes('转账确认收款')) { + return '转账收款奖励' + } else if (description.includes('订单取消')) { + return '订单取消退款' + } + + return titleMap[type] || '积分变动' +} + const formatDateTime = (date) => { return dayjs(date).format('YYYY-MM-DD HH:mm:ss') } @@ -314,7 +337,18 @@ const getHistory = async (isLoadMore = false) => { } const response = await api.get('/user/points/history', { params }) - const historyData = response.data.history || [] + const records = response.data.data?.records || [] + + // 转换数据格式以匹配模板需求 + const historyData = records.map(record => ({ + id: record.id, + type: record.type, + points: record.amount, + title: getRecordTitle(record.type, record.description), + description: record.description, + createdAt: record.created_at, + orderId: record.order_id + })) if (isLoadMore) { history.value.push(...historyData) @@ -322,8 +356,15 @@ const getHistory = async (isLoadMore = false) => { history.value = historyData } - hasMore.value = response.data.hasMore || false - page.value++ + // 使用pagination对象判断是否还有更多数据 + const pagination = response.data.data?.pagination + if (pagination) { + hasMore.value = pagination.page < pagination.totalPages + page.value = pagination.page + 1 + } else { + hasMore.value = false + page.value++ + } } catch (error) { console.error('获取积分记录失败:', error) ElMessage.error('获取积分记录失败') @@ -585,6 +626,7 @@ onMounted(() => { box-shadow: var(--box-shadow); transition: var(--transition); overflow: hidden; + margin-bottom: 10px; } .history-item:hover { diff --git a/src/views/Pay.vue b/src/views/Pay.vue index 8f58868..3e6cd99 100644 --- a/src/views/Pay.vue +++ b/src/views/Pay.vue @@ -539,9 +539,10 @@ const shouldShowPaymentMethod = (method) => { // 当用户积分足够支付时显示积分支付选项 return totalPointsPrice > 0 && userBalance.value.points >= totalPointsPrice case 'mixed': - // 当用户积分不够但积分+融豆换算足够时显示混合支付选项 + // 当用户积分不够但积分+融豆换算足够时显示混合支付选项,且用户积分必须大于等于10000 const pointsNotEnough = totalPointsPrice > 0 && userBalance.value.points < totalPointsPrice - return pointsNotEnough && isPaymentMethodAvailable('mixed') + const hasEnoughPoints = userBalance.value.points >= 10000 + return pointsNotEnough && hasEnoughPoints && isPaymentMethodAvailable('mixed') default: return false } diff --git a/src/views/PointsHistory.vue b/src/views/PointsHistory.vue deleted file mode 100644 index 020ff9d..0000000 --- a/src/views/PointsHistory.vue +++ /dev/null @@ -1,725 +0,0 @@ - - - - - - 积分记录 - - - - - 商城 - - - - - - - - - - - - - {{ userPoints }} - 当前积分 - - - - - {{ totalEarned }} - 累计获得 - - - {{ totalSpent }} - 累计消费 - - - - - - - - - - {{ tab.label }} - - - - - - - - - - - - - {{ getEmptyText() }} - - 去赚积分 - - - - - - - - - - - - - {{ record.title }} - - {{ getPointsText(record.type, record.points) }} - - - - {{ record.description }} - - {{ formatDateTime(record.createdAt) }} - - 订单号:{{ record.orderId }} - - - - - - - 查看订单 - - - - - - - - - - 加载更多 - - - - - - - - - - - - 1 - - - - 2 - - - - 3 - - - - 4 - - - - 5 - - - - - - - - 商品兑换:按商品标价扣除 - - - - 积分有效期:永久有效 - - - - 积分不可转让,不可提现 - - - - - - - - - - - \ No newline at end of file diff --git a/src/views/Profile.vue b/src/views/Profile.vue deleted file mode 100644 index 0c4039e..0000000 --- a/src/views/Profile.vue +++ /dev/null @@ -1,1180 +0,0 @@ - - - - - - 个人资料 - - - - - - - - - 我的订单 - 积分记录 - 退出登录 - - - - - - - - - - - - - - - 更换头像 - - - - {{ userInfo?.username }} - {{ userInfo?.email }} - - - - - {{ getAuditStatusText(userInfo?.auditStatus) }} - - - 审核通过后可参与匹配 - - - - - - {{ formatNumber(userStats.currentPoints) }} - 积分 - - - {{ formatNumber(userStats.orderCount) }} - 订单 - - - {{ formatNumber(userStats.pointsSpent) }} - 兑换 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 上传微信收款码 - - - - 删除 - - - - - - - - - - - 上传支付宝收款码 - - - - 删除 - - - - - - - - - - - - - - - 上传云闪付收款码 - - - - 删除 - - - - - - - - - - - 上传营业执照 - - - - 删除 - - - - - - - - - - - 上传身份证正面 - - - - 删除 - - - - - - - - - - - 上传身份证反面 - - - - 删除 - - - - - - - 重置 - - 保存资料 - - - - - - - 修改密码 - - - - - - - - - - - - - - - - 重置 - - 修改密码 - - - - - - - - - - - - - - 取消 - - 确定 - - - - - - - - - - \ No newline at end of file
欢迎回到炬融圈
{{ getEmptyText() }}
{{ record.description }}
{{ userInfo?.email }}