Compare commits

...

26 Commits

Author SHA1 Message Date
a12afc6bc1 优化kl-card-picture组件文本颜色样式 2025-10-16 23:09:12 +08:00
ae57f28357 优化排行榜组件并添加全局错误处理 2025-10-16 22:40:19 +08:00
3265c00fba feat: 启用排行榜组件并优化微信登录参数 2025-10-16 20:13:58 +08:00
ab92461635 优化微信扫码登录openId字段命名 2025-10-15 22:49:48 +08:00
3c6ed5a72c 优化微信扫码登录功能及token获取逻辑 2025-10-15 22:40:23 +08:00
9e225417a6 优化微信扫码登录功能实现 2025-10-15 22:27:12 +08:00
94f1828620 优化微信扫码登录组件UI及交互 2025-10-14 22:15:46 +08:00
58d3f2e890 feat: 添加微信授权成功通知功能 2025-10-14 08:58:36 +08:00
5baae7652f feat: 添加微信扫码登录功能 2025-10-13 23:03:55 +08:00
3f3ea878b9 优化提现手续费动态配置 2025-10-08 22:22:54 +08:00
89f3b9679d 优化交易中心UI展示 2025-10-08 21:16:07 +08:00
b0e5244a79 feat: 统一路由路径规范 2025-10-08 21:12:51 +08:00
f8176abaad 优化收益展示字段及数值 2025-10-08 20:50:30 +08:00
575f6fa2f1 优化VIP价格显示及移除工具函数 2025-10-08 20:39:51 +08:00
5ee69038fa 优化聊天页面UI及API接口调用 2025-09-30 22:20:07 +08:00
2bc5a11946 优化热门绘画组件查询参数处理 2025-09-29 09:37:36 +08:00
b23a85b9ec 优化首页组件代码及调试信息 2025-09-29 09:12:34 +08:00
f2c4d14007 feat: sosososs 2025-09-27 21:59:11 +08:00
82b6f4d63b feat: sosososs 2025-09-27 20:36:51 +08:00
d995ac2b37 feat: sosososs 2025-09-27 19:57:02 +08:00
01392a6329 feat: sosososs 2025-09-27 19:18:52 +08:00
689d12e632 feat: sosososs 2025-09-27 19:09:46 +08:00
8c50ffd479 优化评论功能API接口参数处理 2025-09-26 23:06:31 +08:00
ca7982c974 优化工具箱详情页评论功能及API接口 2025-09-26 22:13:28 +08:00
6c85256b96 优化详情页功能及API接口参数 2025-09-26 21:47:51 +08:00
972bd2c8b8 优化个人中心交易记录显示 2025-09-25 22:12:36 +08:00
35 changed files with 602 additions and 134 deletions

View File

@ -64,7 +64,7 @@ export const getChannelDetail = (params: { id: string }) => {
* @return {Promise} * @return {Promise}
*/ */
export const postscommentpage = (params: { postsId: string; pageNo: number; pageSize: number }) => { export const postscommentpage = (params: { postsId: string; pageNo: number; pageSize: number }) => {
return useFetchRequest.get<IResponse<PageResultPostsCommentRespVO>>('/prod-api/app-api/business/posts-comment/page', { query: params }) return useDollarFetchRequest.get<IResponse<PageResultPostsCommentRespVO>>('/prod-api/app-api/business/posts-comment/page', { query: params })
} }
/** /**
* 创建帖子评论 * 创建帖子评论

View File

@ -7,22 +7,22 @@ import type { ProjectRespVO, PageResultProjectCommentResVO, ProjectDrawPageRespV
* @return {Promise} * @return {Promise}
*/ */
export const getDetail = (params: { id?: number | string }) => { export const getDetail = (params: { id?: number | string }) => {
return useFetchRequest.get<IResponse<ProjectRespVO>>('/prod-api/app-api/business/app/project-draw/preview', { query:params }) return useFetchRequest.get<IResponse<ProjectRespVO>>('/prod-api/app-api/business/app/project-draw/preview', { query: params })
} }
/** /**
* 获取评论列表 * 获取评论列表
* @return {Promise} * @return {Promise}
*/ */
export const getCommentList = (params: { relationId?: number | string; pageNum?: number; pageSize?: number }) => { export const getCommentList = (params: { relationId?: number | string; pageNum?: number; pageSize?: number; type: number }) => {
return useDollarFetchRequest.get<IResponse<PageResultProjectCommentResVO>>('/prod-api/app-api/business/app/project-comment/page', { query:params }) return useDollarFetchRequest.get<IResponse<PageResultProjectCommentResVO>>('/prod-api/app-api/business/app/project-comment/page', { query: params })
} }
/** /**
* 发表评论 * 发表评论
* @return {Promise} * @return {Promise}
*/ */
export const createComment = (params: { relationId?: number | string; content?: string; projectId?: number | string }) => { export const createComment = (params: { relationId?: number | string; content?: string; projectId?: number | string; type: number }) => {
return useDollarFetchRequest.post<IResponse<boolean>>('/prod-api/app-api/business/app/project-comment/create', params) return useDollarFetchRequest.post<IResponse<boolean>>('/prod-api/app-api/business/app/project-comment/create', params)
} }
@ -31,14 +31,14 @@ export const createComment = (params: { relationId?: number | string; content?:
* @return {Promise} * @return {Promise}
*/ */
export const getRelationRecommend = (params: { type?: number | string; projectType?: number | string }) => { export const getRelationRecommend = (params: { type?: number | string; projectType?: number | string }) => {
return useFetchRequest.get<IResponse<ProjectDrawPageRespVO[]>>('/prod-api/app-api/business/app/project-draw/top-list', { query:params }) return useFetchRequest.get<IResponse<ProjectDrawPageRespVO[]>>('/prod-api/app-api/business/app/project-draw/top-list', { query: params })
} }
/** /**
* 举报 * 举报
* @return {Promise} * @return {Promise}
*/ */
export const report = (params: { id?: number | string; title?: string; comments?: string; files?: any; projectId: any; drawId: any }) => { export const report = (params: { id?: number | string; title?: string; comments?: string; files?: any; projectId?: any; drawId: any; type: any }) => {
return useDollarFetchRequest.post<IResponse<boolean>>('/prod-api/app-api/business/project-report/create', params) return useDollarFetchRequest.post<IResponse<boolean>>('/prod-api/app-api/business/project-report/create', params)
} }
@ -50,6 +50,14 @@ export const getUserInfo = (params: { id?: number | string }) => {
return useFetchRequest.get<IResponse<UserExtendSimpleRespDTO>>('/prod-api/app-api/business/app/project-draw/preview-user-info', { params }) return useFetchRequest.get<IResponse<UserExtendSimpleRespDTO>>('/prod-api/app-api/business/app/project-draw/preview-user-info', { params })
} }
/**
* 获取工具发布人信息
*/
export const getToolUserInfo = (params: { id?: number | string }) => {
return useFetchRequest.get<IResponse<UserExtendSimpleRespDTO>>('/prod-api/app-api/business/resource/publish-user-info', { params })
}
/** /**
* 当前用户的主要作品内容 * 当前用户的主要作品内容
*/ */
@ -59,7 +67,7 @@ export const getMainWork = (params: { id?: number | string; limit: number; membe
/** /**
* 创建内容信息 * 创建内容信息
*/ */
export const createContent = (params: { projectId: any; drawId: any }) => { export const createContent = (params: { projectId?: any; drawId: any; type: any }) => {
return useDollarFetchRequest.post<IResponse<boolean>>('/prod-api/app-api/business/project-member-favorites/create', params) return useDollarFetchRequest.post<IResponse<boolean>>('/prod-api/app-api/business/project-member-favorites/create', params)
} }

View File

@ -137,6 +137,7 @@ export interface UserExtendSimpleRespDTO {
files: any[] files: any[]
fansCount: number fansCount: number
projectCount: number projectCount: number
postsNum?: number
} }
export interface ProjectDrawMemberRespVO { export interface ProjectDrawMemberRespVO {

View File

@ -28,13 +28,17 @@ export const loginByMobile = (params: { mobile: string; code: string; socialCode
* 发送邮箱验证码 * 发送邮箱验证码
*/ */
export const sendEmailCode = (data: { email: string }) => { export const sendEmailCode = (data: { email: string }) => {
return useDollarFetchRequest.post<IResponse<any>>('/prod-api/app-api/member/auth/send-email-code?email=' + data.email, {},{ return useDollarFetchRequest.post<IResponse<any>>(
headers: { '/prod-api/app-api/member/auth/send-email-code?email=' + data.email,
'Content-Type': 'application/x-www-form-urlencoded', {},
'Accept': 'application/json, text/plain, */*', {
'Access-Control-Allow-Origin-Type': '*', headers: {
'Content-Type': 'application/x-www-form-urlencoded',
Accept: 'application/json, text/plain, */*',
'Access-Control-Allow-Origin-Type': '*',
},
} }
}) )
} }
/** /**
@ -50,3 +54,10 @@ export const loginByEmail = (params: { email: string; code: string }) => {
export const resetPassword = (params: { password: string; code: string }) => { export const resetPassword = (params: { password: string; code: string }) => {
return useDollarFetchRequest.put<IResponse<boolean>>('/prod-api/app-api/member/user/update-password', params) return useDollarFetchRequest.put<IResponse<boolean>>('/prod-api/app-api/member/user/update-password', params)
} }
/**
* 授权成功通知后台
*/
export const notifyAuthSuccess = (params: { code: string; state: string }) => {
return useDollarFetchRequest.get<IResponse<any>>('/prod-api/app-api/member/auth/wx-login-url', { query: params })
}

View File

@ -36,26 +36,26 @@ export const createOrder = (params: { spuId: number }) => {
* 获得钱包充值套餐列表 * 获得钱包充值套餐列表
*/ */
export const listWalletRechargePackage = () => { export const listWalletRechargePackage = () => {
return useDollarFetchRequest.get<IResponse<AppPayWalletPackageRespVO[]>>('/prod-api/app-api/pay/wallet-recharge-package/list', {}) return useDollarFetchRequest.get<IResponse<AppPayWalletPackageRespVO[]>>('/prod-api/app-api/pay/wallet-recharge-package/list', {})
} }
/** /**
* 获取支付状态 * 获取支付状态
*/ */
export const getPayStatus = (params: { id: number }) => { export const getPayStatus = (params: { id: number }) => {
return useDollarFetchRequest.get<IResponse<PayOrderRespVO>>('/prod-api/app-api/pay/order/get', {query:params}) return useDollarFetchRequest.get<IResponse<PayOrderRespVO>>('/prod-api/app-api/pay/order/get', { query: params })
} }
/** /**
* 通过code获取token * 通过code获取token
*/ */
export const getTokenByCode = (params: { type: number; code: string; state: string }) => { export const getTokenByCode = (params: { type: number; code: string; state: string }) => {
return useDollarFetchRequest.post<IResponse<string>>('/prod-api/app-api/member/auth/token-by-code', params) return useDollarFetchRequest.post<IResponse<string>>('/prod-api/app-api/member/auth/token-by-code', params)
} }
/** /**
* 社交快捷登录,使用 code 授权码 * 社交快捷登录,使用 code 授权码
*/ */
export const socialLoginByCode = (params: { type: number; code: string; state: string }) => { export const socialLoginByCode = (params: { type?: number; code?: string; state?: string; openId?: string; sceneStr?: string }) => {
return useDollarFetchRequest.post< return useDollarFetchRequest.post<
IResponse<{ IResponse<{
accessToken: string accessToken: string
@ -71,5 +71,5 @@ export const socialLoginByCode = (params: { type: number; code: string; state: s
* 获得钱包充值记录分页 * 获得钱包充值记录分页
*/ */
export const getWalletRechargeRecordPage = (params: { pageNo: number; pageSize: number }) => { export const getWalletRechargeRecordPage = (params: { pageNo: number; pageSize: number }) => {
return useDollarFetchRequest.get<IResponse<PageResultAppPayWalletRechargeRespVO>>('/prod-api/app-api/pay/wallet-transaction/page', {query:params}) return useDollarFetchRequest.get<IResponse<PageResultAppPayWalletRechargeRespVO>>('/prod-api/app-api/pay/wallet-transaction/page', { query: params })
} }

View File

@ -164,3 +164,35 @@ export const cancelSocialBind = (params: { type: number; openid: string }) => {
export const userLogout = () => { export const userLogout = () => {
return useDollarFetchRequest.del<IResponse<boolean>>('/prod-api/app-api/member/user/unregister-user', {}) return useDollarFetchRequest.del<IResponse<boolean>>('/prod-api/app-api/member/user/unregister-user', {})
} }
/**
* 获取钱包配置
*/
export const getWalletConfig = () => {
return useDollarFetchRequest.get<
IResponse<{
rechargeRate: number
commissionRate: number
withdrawRateOfRecharge: number
withdrawRateOfEarn: number
}>
>('/prod-api/app-api/pay/wallet/get-config', {})
}
/**
* 微信登录二维码链接
*/
export const getLoginQrcode = () => {
return useDollarFetchRequest.get<IResponse<{ sceneStr: string; qrCodeUrl: string }>>('/prod-api/app-api/member/auth/wx-login-url', {})
}
/***
* member/auth/checkScanStatus
* 检查扫码登录状态
*/
export const checkScanStatus = (params: { sceneStr: string }) => {
return useDollarFetchRequest.get<IResponse<{ status: string; openId: string | null; message: string }>>('/prod-api/app-api/member/auth/checkScanStatus', {
query: params,
})
}

View File

@ -155,6 +155,7 @@ export interface UserStatisticsCountRespVO {
currencyCount: number currencyCount: number
previewCount: number previewCount: number
revenueCount: number revenueCount: number
revenueBalance: number
} }
export interface PageResultProjectMemberFavoritesRespVO { export interface PageResultProjectMemberFavoritesRespVO {

View File

@ -75,6 +75,8 @@ export interface ProjectResourceRespVO {
favoriteId?: number favoriteId?: number
downloadId?: string downloadId?: string
sourceType: number sourceType: number
ownedUserName?: string
ownedUserAvatar?: string
ownedUserIdInfo: { ownedUserIdInfo: {
id: number id: number
nickName: string nickName: string

View File

@ -1,6 +1,8 @@
<template> <template>
<div class="mt-[30px] w-[100%]"> <div class="mt-[30px] w-[100%]">
<div class="h-[48px] w-[100%] rounded-[1px] bg-[#F8F8F8] pl-[10px] text-[16px] text-[#333333] font-normal line-height-[50px]"> 共有{{ result.total || 0 }}条评论 </div> <div class="h-[48px] w-[100%] rounded-[1px] bg-[#F8F8F8] pl-[10px] text-[16px] text-[#333333] font-normal line-height-[50px]">
共有{{ result.total || 0 }}条评论
</div>
<div v-for="item in result.list" :key="item.id" class="mt-[20px] border-b-[1px] border-b-[#eee] border-b-solid pb-[14px]"> <div v-for="item in result.list" :key="item.id" class="mt-[20px] border-b-[1px] border-b-[#eee] border-b-solid pb-[14px]">
<div class="flex items-start"> <div class="flex items-start">
<el-avatar :src="item.creatorInfo.avatar" alt="" srcset="" class="h-[50px] w-[49px] rounded-full" /> <el-avatar :src="item.creatorInfo.avatar" alt="" srcset="" class="h-[50px] w-[49px] rounded-full" />
@ -44,7 +46,7 @@
}, },
projectId: { projectId: {
type: Number, type: Number,
required: true, required: false,
}, },
}) })
@ -66,7 +68,12 @@
// 获取评论列表 // 获取评论列表
const handleGetCommentList = async () => { const handleGetCommentList = async () => {
const res = await getCommentList({ relationId: props.relationId, pageNum: query.value.pageNo, pageSize: query.value.pageSize }) const res = await getCommentList({
relationId: props.relationId,
pageNum: query.value.pageNo,
pageSize: query.value.pageSize,
type: props.projectId ? 1 : 2,
})
if (res.code === 0) { if (res.code === 0) {
result.value.list = res.data.list result.value.list = res.data.list
result.value.total = res.data.total result.value.total = res.data.total
@ -75,7 +82,7 @@
// 发表评论 // 发表评论
const handleCreateComment = async () => { const handleCreateComment = async () => {
const res = await createComment({ relationId: props.relationId, content: commentContent.value, projectId: props.projectId }) const res = await createComment({ relationId: props.relationId, content: commentContent.value, projectId: props.projectId || props.relationId, type: props.projectId ? 1 : 2 })
if (res.code === 0) { if (res.code === 0) {
commentContent.value = '' commentContent.value = ''
query.value.pageNo = 1 query.value.pageNo = 1
@ -87,8 +94,9 @@
() => props.relationId, () => props.relationId,
() => { () => {
handleGetCommentList() handleGetCommentList()
},{ },
immediate: true {
immediate: true,
} }
) )
</script> </script>

View File

@ -11,7 +11,7 @@
<img v-if="props.itemInfo.source === 1" src="~/assets/images/yuan.png" alt="" srcset="" class="mr-[2px] w-[20px] relative bottom-[-4px]" /> <img v-if="props.itemInfo.source === 1" src="~/assets/images/yuan.png" alt="" srcset="" class="mr-[2px] w-[20px] relative bottom-[-4px]" />
{{ props.itemInfo.title }} {{ props.itemInfo.title }}
</div> </div>
<div class="mt-[8px] text-[15px] text-[#999999] font-normal">by {{ props.itemInfo?.ownedUserIdInfo?.nickName }}</div> <div class="mt-[8px] text-[15px] text-[#666] font-normal">by {{ props.itemInfo?.ownedUserIdInfo?.nickName }}</div>
<div class="mt-[4px] text-[13px] text-[#999999] font-normal">{{ dayjs(props.itemInfo.createTime).format('YYYY-MM-DD HH:mm:ss') }}</div> <div class="mt-[4px] text-[13px] text-[#999999] font-normal">{{ dayjs(props.itemInfo.createTime).format('YYYY-MM-DD HH:mm:ss') }}</div>
</div> </div>
<div><img :src="props.itemInfo?.ownedUserIdInfo?.avatar" alt="" srcset="" class="h-[40px] w-[40px] rd-[50%]" /></div> <div><img :src="props.itemInfo?.ownedUserIdInfo?.avatar" alt="" srcset="" class="h-[40px] w-[40px] rd-[50%]" /></div>

View File

@ -62,12 +62,12 @@
// 用户中心 // 用户中心
const handleUserCenter = () => { const handleUserCenter = () => {
navigateTo('/personal-Center/info') navigateTo('/personal-center/info')
} }
// 消息中心 // 消息中心
const handleMessageCenter = () => { const handleMessageCenter = () => {
navigateTo('/personal-Center/message-center') navigateTo('/personal-center/message-center')
} }
</script> </script>
<style scoped> <style scoped>

View File

@ -168,7 +168,7 @@
userStore.logout() userStore.logout()
userStore.$reset() userStore.$reset()
} else if (command === '个人中心') { } else if (command === '个人中心') {
navigateTo('/personal-Center/info') navigateTo('/personal-center/info')
} }
} }

View File

@ -11,7 +11,7 @@
<!-- <div class="vip-card-subtitle">中小微企业</div> --> <!-- <div class="vip-card-subtitle">中小微企业</div> -->
</div> </div>
<div class="vip-card-price"> <div class="vip-card-price">
<span class="price">{{ accDiv(item.payPrice || 0, 100) }}</span> <span class="price">{{ item.payPrice }}</span>
<span class="per">/1</span> <span class="per">/1</span>
</div> </div>
<ul class="vip-card-features"> <ul class="vip-card-features">
@ -36,7 +36,7 @@
<script setup lang="ts"> <script setup lang="ts">
import { ref, watch, onMounted } from 'vue' import { ref, watch, onMounted } from 'vue'
import { listVip, submitPayOrder, getPayStatus } from '~/api/pay/index' import { listVip, submitPayOrder, getPayStatus } from '~/api/pay/index'
import { accDiv } from '~/utils/utils' // import { accDiv } from '~/utils/utils'
import { Close } from '@element-plus/icons-vue' import { Close } from '@element-plus/icons-vue'
import type { AppPayWalletPackageRespVO } from '~/api/pay/types' import type { AppPayWalletPackageRespVO } from '~/api/pay/types'
// @ts-ignore // @ts-ignore

View File

@ -0,0 +1,62 @@
<template>
<el-dialog v-model="dialogVisible" title="提现申请" width="600" :before-close="handleClose">
<el-form :model="form" label-width="80px">
<el-form-item label="收款账户" prop="amount">
<el-input v-model="form.amount" placeholder="微信手机账号" />
<div class="text-12px color-#A8ABB2">*仅支持微信收款用户需在微信[收付款>向手机号转账>手机号收款设置]开启收款开关*</div>
</el-form-item>
<el-form-item label="提现类型" prop="amount">
<el-radio-group v-model="form.amount">
<el-radio :label="1">收益提现</el-radio>
<el-radio :label="2">全部提现</el-radio>
</el-radio-group>
<div class="text-12px color-#A8ABB2">*收益提现将收益金币提现全部提现可将充值金币提现*</div>
</el-form-item>
<el-form-item label="提现金额" prop="amount">
<div class="flex items-center">
<el-input-number v-model="form.amount" :controls="false" :min="0" placeholder="请输入提现金额" class="w-150px!" />
<div class="ml-10px">[可提现金币数<span class="text-red">1200</span>=<span class="text-red">120</span> ]</div>
</div>
<div class="text-12px color-#A8ABB2">*提现金币比例10金币=1元最低提现额度100元*</div>
</el-form-item>
</el-form>
<div class="text-12px color-red">
提示:收益金币提现正常收取平台手续费{{ walletConfig?.withdrawRateOfEarn }}%如需将充值金币提现选择全部提现选项因涉及充值赠送金额将收取{{ walletConfig?.withdrawRateOfRecharge }}%高额手续费如果恶意套利提现将提现审核不通过!
</div>
<template #footer>
<div class="dialog-footer">
<el-button @click="dialogVisible = false">取消</el-button>
<el-button type="primary" @click="dialogVisible = false"> 立即申请 </el-button>
</div>
</template>
</el-dialog>
</template>
<script setup lang="ts">
import { getWalletConfig } from '~/api/personal-center/index'
const dialogVisible = defineModel('modelValue', {
default: false,
})
const form = reactive({
amount: 0,
})
const handleClose = (done: () => void) => {
done()
}
const walletConfig = ref<{
rechargeRate: number
commissionRate: number
withdrawRateOfRecharge: number
withdrawRateOfEarn: number
}>()
onMounted(() => {
getWalletConfig().then((res) => {
walletConfig.value = res.data
})
})
</script>
<style lang="scss" scoped></style>

99
components/wx.vue Normal file
View File

@ -0,0 +1,99 @@
<!-- 二维码弹窗 -->
<template>
<div>
<el-dialog title="微信登录" v-model="visible" width="30%" :close-on-click-modal="false" :close-on-press-escape="false" @before-close="close">
<qrcode-vue :value="qrcode" :size="300" :margin="2" colorDark="#2c3e50" colorLight="#f8f9fa" errorCorrectionLevel="H" />
<!-- 扫码状态 -->
<div class="text-center">
<span>{{ checkLoginStatus }}</span>
</div>
</el-dialog>
</div>
</template>
<script setup lang="ts">
import useUserStore from '~/stores/user'
import { getLoginQrcode, checkScanStatus } from '~/api/personal-center/index'
import QrcodeVue from 'qrcode.vue'
const store = useUserStore()
const visible = defineModel('visible', {
default: false,
})
const checkLoginStatus = computed(() => {
const type = {
EXPIRED: '已过期',
CONFIRMED: '已确认',
SCANNED: '已扫码',
WAITING: '等待扫码',
SUCCESS: '登录成功',
}
if (checkLoginInfo.value) {
return type[checkLoginInfo.value.status as keyof typeof type]
}
return '微信扫码登录'
})
const qrcode = ref('')
const sceneStr = ref('')
const timer = ref<any>()
const getQrcode = async () => {
// 获取二维码
const res = await getLoginQrcode()
if (res.code === 0) {
const jsonurl = res.data.qrCodeUrl
const qrCodeUrl = jsonurl ? JSON.parse(jsonurl) : ''
if (qrCodeUrl?.qrCodeUrl) {
qrcode.value = qrCodeUrl.qrCodeUrl
sceneStr.value = res.data.sceneStr
// 轮询检查扫码状态
getCheckScanStatus()
}
}
}
const checkLoginInfo = ref<{ status: string; openId: string | null; message: string }>()
const getCheckScanStatus = async () => {
// 轮询检查扫码状态
timer.value = setInterval(async () => {
const response = await checkScanStatus({ sceneStr: sceneStr.value })
if (response.code === 0) {
checkLoginInfo.value = response.data
if (checkLoginInfo.value.status === 'SCANNED') {
// 登录
await store.getTokenV2({ openId: checkLoginInfo.value.openId as string, sceneStr: sceneStr.value })
// 扫码成功
visible.value = false
clearInterval(timer.value)
} else if (checkLoginInfo.value.status === 'EXPIRED') {
// 二维码过期
clearInterval(timer.value)
// 重新获取二维码
getQrcode()
}
}
}, 5000)
}
const close = () => {
visible.value = false
qrcode.value = ''
}
onMounted(() => {
// 获取二维码
getQrcode()
})
// 关闭定时器
onUnmounted(() => {
clearInterval(timer.value)
})
</script>
<style lang="scss" scoped>
:deep(.el-dialog__body) {
text-align: center !important;
}
</style>

View File

@ -1,18 +1,20 @@
import { useFetch } from '#app' import { useFetch } from '#app'
import type { UseFetchOptions } from '#app' import type { UseFetchOptions } from '#app'
import { isArray } from '~/utils/utils' import { isArray } from '~/utils/utils'
import useUserStore from '~/stores/user'
const useServerRequest = async <T>(url: string, opts?: UseFetchOptions<T, unknown>) => { const useServerRequest = async <T>(url: string, opts?: UseFetchOptions<T, unknown>) => {
const token = useToken() const token = useToken()
const runtimeConfig = useRuntimeConfig() const runtimeConfig = useRuntimeConfig()
const userStore = useUserStore()
const defaultOptions: UseFetchOptions<unknown> = { const defaultOptions: UseFetchOptions<unknown> = {
baseURL: runtimeConfig.public.apiBase, baseURL: runtimeConfig.public.apiBase,
onRequest({ options }) { onRequest({ options }) {
options.headers = options.headers || {} options.headers = options.headers || {}
if (token.value) { if (token.value || userStore.token) {
options.headers.set('Authorization', `Bearer ${token.value}`) options.headers.set('Authorization', `Bearer ${token.value || userStore.token}`)
} }
}, },
onResponse({ response }) { onResponse({ response }) {

20
layouts/success.vue Normal file
View File

@ -0,0 +1,20 @@
<template>
<div class="layout-wrap">
<div class="flex flex-1 flex-col">
<slot></slot>
</div>
</div>
</template>
<script lang="ts" setup></script>
<style lang="scss" scoped>
.layout-wrap {
flex: 1;
display: flex;
flex-direction: column;
background-color: #fbfcff;
width: 100%;
margin: auto;
}
</style>

View File

@ -0,0 +1,139 @@
<template>
<div class="auth-success-container">
<!-- 顶部成功图标 -->
<div class="success-icon">
<svg width="80" height="80" viewBox="0 0 80 80" fill="none" xmlns="http://www.w3.org/2000/svg">
<circle cx="40" cy="40" r="40" fill="#4CD964" />
<path d="M25 40L35 50L55 30" stroke="white" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" />
</svg>
</div>
<!-- 标题和描述 -->
<div class="text-content">
<h1 class="title">授权成功</h1>
<p class="desc">
您已完成微信授权<br />
请返回电脑端继续操作
</p>
</div>
<!-- 倒计时提示 -->
<!-- <div class="countdown" v-if="countdown > 0">
<p>页面将在 {{ countdown }} 秒后自动关闭</p>
</div> -->
<!-- 底部按钮 -->
<!-- <div class="btn-group">
<button class="close-btn" @click="closePage">立即关闭</button>
</div> -->
</div>
</template>
<script setup lang="ts">
import { notifyAuthSuccess } from '~/api/login/index'
import { ref, onMounted } from 'vue'
import { useRoute } from 'vue-router'
const route = useRoute()
definePageMeta({
layout: 'success',
})
onMounted(() => {
notifyAuthSuccess({ code: route.query.code as string, state: route.query.state as string }).then(() => {
console.log('Notified backend of auth success')
})
})
</script>
<style scoped>
.auth-success-container {
min-height: 100vh;
box-sizing: border-box;
padding: 20px;
background-color: #f5f7fa;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.success-icon {
margin-bottom: 30px;
animation: pop 0.5s ease-out;
}
@keyframes pop {
0% {
transform: scale(0.8);
opacity: 0;
}
70% {
transform: scale(1.1);
}
100% {
transform: scale(1);
opacity: 1;
}
}
.text-content {
text-align: center;
margin-bottom: 40px;
}
.title {
font-size: 24px;
font-weight: 600;
color: #333;
margin: 0 0 15px 0;
}
.desc {
font-size: 16px;
color: #666;
line-height: 1.6;
margin: 0;
}
.countdown {
margin-bottom: 50px;
color: #999;
font-size: 14px;
}
.btn-group {
width: 100%;
max-width: 300px;
}
.close-btn {
width: 100%;
height: 48px;
background-color: #07c160;
color: white;
border: none;
border-radius: 24px;
font-size: 16px;
font-weight: 500;
cursor: pointer;
transition: background-color 0.3s;
}
.close-btn:hover {
background-color: #06b355;
}
/* 适配小屏手机 */
@media (max-width: 320px) {
.title {
font-size: 22px;
}
.desc {
font-size: 15px;
}
.close-btn {
height: 44px;
font-size: 15px;
}
}
</style>

View File

@ -13,15 +13,15 @@
</div> </div>
<div class="mt-[19px] flex items-center justify-between"> <div class="mt-[19px] flex items-center justify-between">
<div class="flex items-center"> <div class="flex items-center">
<img src="~/assets/images/look.png" alt="" srcset="" class="mr-[4px] h-[17px]" /> <img src="~/assets/images/look.png" alt="" srcset="" class="mr-[4px] h-[14px]" />
<span class="text-[#666666]">{{ channelDetail?.likeNum || 0 }}人赞过</span> <span class="text-[#666666]">{{ channelDetail?.likeNum || 0 }}人赞过</span>
<div class="ml-[16px] flex items-center"> <div class="ml-[16px] flex items-center">
<img src="~/assets/images/add.png" alt="" class="mr-[4px] h-[23px]" /> <img src="~/assets/images/add.png" alt="" class="mr-[4px] h-[20px]" />
<span class="text-[#666666]">{{ channelDetail?.commentNum || 0 }}评论</span> <span class="text-[#666666]">{{ channelDetail?.commentNum || 0 }}评论</span>
</div> </div>
</div> </div>
<div class="ml-[16px] flex items-center"> <div class="ml-[16px] flex items-center">
<img src="~/assets/images/chat.png" alt="" srcset="" class="mr-[4px] h-[17px]" /> <img src="~/assets/images/chat.png" alt="" srcset="" class="mr-[4px] h-[14px]" />
<span class="text-[#666666]">{{ channelDetail?.browseNum || 0 }}人看过</span> <span class="text-[#666666]">{{ channelDetail?.browseNum || 0 }}人看过</span>
</div> </div>
</div> </div>
@ -104,7 +104,6 @@
const channelId = computed(() => route.params.channelId as string) const channelId = computed(() => route.params.channelId as string)
const pageNo = computed(() => Number(route.params.pageNo)) const pageNo = computed(() => Number(route.params.pageNo))
console.log(channelId.value, pageNo.value)
// const channelDetail = ref<TGetChannelPostsRes>() // const channelDetail = ref<TGetChannelPostsRes>()
// const commentList = reactive<PageResultPostsCommentRespVO>({ // const commentList = reactive<PageResultPostsCommentRespVO>({

View File

@ -11,14 +11,14 @@
<div <div
class="box-border h-[60px] w-[1019px] flex items-center justify-between border border-[#EEEEEE] rounded-[12px] border-solid bg-[#FFFFFF] px-[27px] py-[24px]" class="box-border h-[60px] w-[1019px] flex items-center justify-between border border-[#EEEEEE] rounded-[12px] border-solid bg-[#FFFFFF] px-[27px] py-[24px]"
> >
<div class="text-[20px] text-[#333333] font-normal"> {{ detail?.title }}</div> <div class="text-[16px] text-[#333333] font-normal"> {{ detail?.title }}</div>
<div class="flex items-center"> <div class="flex items-center">
<img :src="detail?.ownedUserIdInfo?.avatar" alt="" srcset="" class="h-[30px] w-[30px] rd-[50%]" /> <img :src="detail?.ownedUserIdInfo?.avatar" alt="" srcset="" class="h-[30px] w-[30px] rd-[50%]" />
<span class="ml-[12px] color-[#999999]">by {{ detail?.ownedUserIdInfo?.nickName }}</span> <span class="ml-[12px] color-[#999999]">by {{ detail?.ownedUserIdInfo?.nickName }}</span>
</div> </div>
</div> </div>
<div class="ml-[23px] flex flex-1 text-[18px] text-[#FFFFFF] font-normal"> <div class="ml-[23px] flex flex-1 text-[16px] text-[#FFFFFF] font-normal">
<div class="h-[60px] w-[160px] flex cursor-pointer items-center justify-center rounded-[8px] bg-[#1A65FF]" @click="handleDownload"> <div class="h-[60px] w-[160px] flex cursor-pointer items-center justify-center rounded-[8px] bg-[#1A65FF]" @click="handleDownload">
<img src="~/assets/images/download.png" alt="" srcset="" class="mr-[4px] h-[22px] w-[27px]" /> <img src="~/assets/images/download.png" alt="" srcset="" class="mr-[4px] h-[22px] w-[27px]" />
{{ detail?.points === 0 ? '免费下载' : '立即下载' }} {{ detail?.points === 0 ? '免费下载' : '立即下载' }}
@ -45,16 +45,16 @@
<div> <div>
<ThumBnail :data="detail?.coverImages" :type="detail?.type"></ThumBnail> <ThumBnail :data="detail?.coverImages" :type="detail?.type"></ThumBnail>
</div> </div>
<div class="mb-[20px] mt-[34px] flex items-center text-[16px] text-[#333333] font-normal"> <div class="mb-[20px] mt-[34px] flex items-center text-[14px] text-[#333333] font-normal">
<div class="h-[24px] w-[4px] rounded-[1px] bg-[#1A65FF]"></div><span class="ml-[10px]">{{ detail?.title }}描述</span></div <div class="h-[20px] w-[4px] rounded-[1px] bg-[#1A65FF]"></div><span class="ml-[10px]">{{ detail?.title }}描述</span></div
> >
<div <div
class="box-border min-h-[90px] w-[1019px] border border-[#EEEEEE] rounded-[6px] border-solid bg-[#FFFFFF] pa-[24px] text-[14px] text-[#333333] font-normal" class="box-border min-h-[90px] w-[1019px] border border-[#EEEEEE] rounded-[6px] border-solid bg-[#FFFFFF] pa-[24px] text-[14px] text-[#333333] font-normal"
> >
{{ detail?.description }} {{ detail?.description }}
</div> </div>
<div id="section1" class="mb-[20px] mt-[34px] flex items-center text-[16px] text-[#333333] font-normal"> <div id="section1" class="mb-[20px] mt-[34px] flex items-center text-[14px] text-[#333333] font-normal">
<div class="h-[24px] w-[4px] rounded-[1px] bg-[#1A65FF]"></div><span class="ml-[10px]">{{ detail?.title }}附件</span></div <div class="h-[20px] w-[4px] rounded-[1px] bg-[#1A65FF]"></div><span class="ml-[10px]">{{ detail?.title }}附件</span></div
> >
<div class="box-border w-[1019px] border border-[#EEEEEE] rounded-[6px] border-solid bg-[#FFFFFF] pa-[24px]"> <div class="box-border w-[1019px] border border-[#EEEEEE] rounded-[6px] border-solid bg-[#FFFFFF] pa-[24px]">
<div class="border-b-[1px] border-b-[#eee] border-b-solid p-b-[10px]"> <div class="border-b-[1px] border-b-[#eee] border-b-solid p-b-[10px]">
@ -86,8 +86,8 @@
</div> </div>
</div> </div>
<!-- 关联项目 --> <!-- 关联项目 -->
<div class="mb-[20px] mt-[34px] flex items-center text-[16px] text-[#333333] font-normal"> <div class="mb-[20px] mt-[34px] flex items-center text-[14px] text-[#333333] font-normal">
<div class="h-[24px] w-[4px] rounded-[1px] bg-[#1A65FF]"></div <div class="h-[20px] w-[4px] rounded-[1px] bg-[#1A65FF]"></div
><span class="ml-[10px]">关联{{ detail?.type === 1 ? '图纸' : detail?.type === 2 ? '文本' : '模型' }}</span></div ><span class="ml-[10px]">关联{{ detail?.type === 1 ? '图纸' : detail?.type === 2 ? '文本' : '模型' }}</span></div
> >
<el-row :gutter="20"> <el-row :gutter="20">
@ -97,8 +97,8 @@
</el-row> </el-row>
<el-empty v-if="!detail?.relationDraws?.length" description="暂无数据"></el-empty> <el-empty v-if="!detail?.relationDraws?.length" description="暂无数据"></el-empty>
<!-- 关联模型 --> <!-- 关联模型 -->
<div class="mb-[20px] mt-[34px] flex items-center text-[16px] text-[#333333] font-normal"> <div class="mb-[20px] mt-[34px] flex items-center text-[14px] text-[#333333] font-normal">
<div class="h-[24px] w-[4px] rounded-[1px] bg-[#1A65FF]"></div <div class="h-[20px] w-[4px] rounded-[1px] bg-[#1A65FF]"></div
><span class="ml-[10px]">相关{{ detail?.type === 1 ? '图纸' : detail?.type === 2 ? '文本' : '模型' }}推荐</span></div ><span class="ml-[10px]">相关{{ detail?.type === 1 ? '图纸' : detail?.type === 2 ? '文本' : '模型' }}推荐</span></div
> >
<el-row :gutter="20"> <el-row :gutter="20">
@ -146,7 +146,7 @@
<div class="h-[20px]"> <div class="h-[20px]">
<img src="~/assets/images/user4.png" alt="fans" class="w-[80%] rounded-full vertical-top" /> <img src="~/assets/images/user4.png" alt="fans" class="w-[80%] rounded-full vertical-top" />
</div> </div>
<div class="relative top-[-3px] ml-[8px] text-[14px] text-[#666] font-normal">粉丝: {{ userInfo.fansCount || 0 }}</div> <div class="relative top-[-3px] ml-[8px] text-[14px] text-[#666] font-normal">发帖数: {{ userInfo.postsNum || 0 }}</div>
</div> </div>
</div> </div>
@ -163,8 +163,8 @@
<div class="mt-[20px] h-[1px] w-[336px] rounded-[1px] bg-[#EEEEEE]"></div> <div class="mt-[20px] h-[1px] w-[336px] rounded-[1px] bg-[#EEEEEE]"></div>
<div class="mt-[20px] flex items-center"> <div class="mt-[20px] flex items-center">
<div class="h-[24px] w-[4px] rounded-[1px] bg-[#1A65FF]"></div> <div class="h-[20px] w-[4px] rounded-[1px] bg-[#1A65FF]"></div>
<span class="ml-[10px] text-[16px]">最新发布</span> <span class="ml-[10px] text-[14px]">最新发布</span>
</div> </div>
<div class="mt-[10px]"> <div class="mt-[10px]">
<div <div
@ -361,6 +361,7 @@
comments: value, comments: value,
projectId: detail.value?.projectId, projectId: detail.value?.projectId,
drawId: detail.value?.id, drawId: detail.value?.id,
type: detail.value?.type,
}).then((res) => { }).then((res) => {
if (res.code === 0) { if (res.code === 0) {
ElMessage.success('举报成功') ElMessage.success('举报成功')
@ -380,6 +381,7 @@
: await createContent({ : await createContent({
projectId: detail.value?.projectId, projectId: detail.value?.projectId,
drawId: detail.value?.id, drawId: detail.value?.id,
type: detail.value?.type,
}) })
if (res.code === 0) { if (res.code === 0) {
ElMessage.success(`${detail.value?.favoriteId ? '取消' : '收藏'}成功`) ElMessage.success(`${detail.value?.favoriteId ? '取消' : '收藏'}成功`)

View File

@ -10,8 +10,8 @@
<div class="swiper-button-prev"></div> <div class="swiper-button-prev"></div>
</div> </div>
</div> </div>
<div class="mb-[20px] mt-[34px] flex items-center text-[16px] text-[#333333] font-normal"> <div class="mb-[20px] mt-[34px] flex items-center text-[14px] text-[#333333] font-normal">
<div class="h-[24px] w-[4px] rounded-[1px] bg-[#1A65FF]"></div> <div class="h-[20px] w-[4px] rounded-[1px] bg-[#1A65FF]"></div>
<span class="ml-[10px]">{{ props.type === 1 ? '图纸' : props.type === 2 ? '文本' : '模型' }}</span> <span class="ml-[10px]">{{ props.type === 1 ? '图纸' : props.type === 2 ? '文本' : '模型' }}</span>
</div> </div>
<div class="box-border h-[126px] w-[1019px] border border-[#EEEEEE] rounded-[6px] border-solid bg-[#FFFFFF] pa-[23px]"> <div class="box-border h-[126px] w-[1019px] border border-[#EEEEEE] rounded-[6px] border-solid bg-[#FFFFFF] pa-[23px]">

View File

@ -79,7 +79,7 @@
<div class="text-[15px] color-[#999]">{{ dayjs(item.createTime).format('MM-DD') }}</div> <div class="text-[15px] color-[#999]">{{ dayjs(item.createTime).format('MM-DD') }}</div>
</div> </div>
<!-- 暂无数据 --> <!-- 暂无数据 -->
<el-empty v-if="!newDrawList.length" description="暂无数据"></el-empty> <el-empty v-if="!newDrawList?.length" description="暂无数据"></el-empty>
</div> </div>
</div> </div>
</div> </div>

View File

@ -64,7 +64,7 @@
</div> </div>
<div v-if="!isLogin" class="mt-[30px] flex justify-between px-[20px]"> <div v-if="!isLogin" class="mt-[30px] flex justify-between px-[20px]">
<img src="~/assets/images/qq-v2.png" alt="QQ登录" class="social-icon" @click="handleLoginQQ" /> <img src="~/assets/images/qq-v2.png" alt="QQ登录" class="social-icon" @click="handleLoginQQ" />
<img src="~/assets/images/weixin-v2.png" alt="微信登录" class="social-icon" @click="handleLoginWechat" /> <img src="~/assets/images/weixin-v2.png" alt="微信登录" class="social-icon" @click="handleLoginWechatV2" />
<img src="~/assets/images/email-v2.png" alt="邮箱登录" class="social-icon" @click="handleLoginEmail" /> <img src="~/assets/images/email-v2.png" alt="邮箱登录" class="social-icon" @click="handleLoginEmail" />
<img src="~/assets/images/phone-v2.png" alt="手机登录" class="social-icon" @click="handleLoginPhone" /> <img src="~/assets/images/phone-v2.png" alt="手机登录" class="social-icon" @click="handleLoginPhone" />
</div> </div>
@ -73,6 +73,9 @@
<img src="~/assets/images/sign.png" alt="签到奖励" class="bonus-image" /> <img src="~/assets/images/sign.png" alt="签到奖励" class="bonus-image" />
</div> </div>
</div> </div>
<!-- wx二维码弹窗 -->
<wx v-model:visible="visible" v-if="visible" />
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
@ -90,6 +93,12 @@
return !!userStore.token return !!userStore.token
}) })
// 打开微信二维码
const visible = ref<boolean>(false)
const handleLoginWechatV2 = () => {
visible.value = true
}
// 获取用户统计信息 // 获取用户统计信息
const userStaticInfo = ref<UserStatisticsCountRespVO>() const userStaticInfo = ref<UserStatisticsCountRespVO>()
const fetchUserStatistics = async () => { const fetchUserStatistics = async () => {

View File

@ -44,7 +44,6 @@
} }
const { data: noticeList } = await getNoticeList() const { data: noticeList } = await getNoticeList()
console.log(noticeList)
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">

View File

@ -155,7 +155,7 @@
const all = [{ id: '0', name: '全部分类', children: [] }] const all = [{ id: '0', name: '全部分类', children: [] }]
if (Array.isArray(res.data) && res.data?.length > 0) { if (Array.isArray(res.data) && res.data?.length > 0) {
const total = [...res.data, ...all] const total = [...res.data, ...all]
// query.projectTypeDay = total[0]?.id || '' query.projectTypeDay = total[0]?.id || ''
// query.projectType = total[0]!.children?.[0]?.id || '' // query.projectType = total[0]!.children?.[0]?.id || ''
return total return total
} }
@ -206,10 +206,10 @@
// } // }
const handleHover = (item: ProjectDictNodeVO) => { const handleHover = (item: ProjectDictNodeVO) => {
query.projectTypeDay = item.id || ''
if (item.name === '全部分类') return if (item.name === '全部分类') return
query.projectTypeDay = item.id || ''
// projectTypeListChildren.value = item.children || [] // projectTypeListChildren.value = item.children || []
query.projectType = item.children?.[0].id || '' // query.projectType = item.id || ''
// 热门数据 // 热门数据
getHotTop() getHotTop()
} }

View File

@ -44,8 +44,6 @@
const sideMenu = ref() const sideMenu = ref()
const menuItemRefs = ref<HTMLElement[]>([]) const menuItemRefs = ref<HTMLElement[]>([])
// const menuItems = ref<ProjectDictNodeVO[]>([]);
// 等待数据加载完成再进行渲染 :courseData 对data进行别名赋值 // 等待数据加载完成再进行渲染 :courseData 对data进行别名赋值
const { const {
data: menuItems, data: menuItems,
@ -64,9 +62,6 @@
}) })
const showSubMenu = (index: number) => { const showSubMenu = (index: number) => {
// if (menuItems.value.length === index + 1) {
// return
// }
activeIndex.value = index activeIndex.value = index
const dom = menuItemRefs.value[index].getBoundingClientRect() const dom = menuItemRefs.value[index].getBoundingClientRect()
console.log(dom) console.log(dom)
@ -78,21 +73,6 @@
} }
const handleSubmenuClick = (primary: ProjectDictNodeVO) => { const handleSubmenuClick = (primary: ProjectDictNodeVO) => {
// const normal = { id: "0", name: "图纸库", isChildren: false };
// const level = [primary, secondary, tertiary]
// .filter(Boolean)
// .map((item) => ({
// id: item?.id,
// name: item?.name,
// isChildren: item?.children?.length ? false : true,
// }));
// if (primary?.id === "0") {
// level[0].name = "图纸库";
// } else {
// level.unshift(normal);
// }
// navigateTo(`/drawe?level=${JSON.stringify(level)}`)
navigateTo(`/drawe/${primary.id}/1/12/-1`) navigateTo(`/drawe/${primary.id}/1/12/-1`)
} }

View File

@ -4,9 +4,9 @@
<div <div
class="left mt-[25px] box-border h-[370px] w-[260px] border border-[#EEEEEE] rounded-[4px] border-solid bg-[#FFFFFF] text-[15px] text-[#333333] font-medium" class="left mt-[25px] box-border h-[370px] w-[260px] border border-[#EEEEEE] rounded-[4px] border-solid bg-[#FFFFFF] text-[15px] text-[#333333] font-medium"
> >
<nuxt-link to="/personal-Center/info" class="flex items-center justify-between py-[14px]"> <nuxt-link to="/personal-center/info" class="flex items-center justify-between py-[14px]">
<div class="flex items-center pl-[20px]"> <div class="flex items-center pl-[20px]">
<img v-if="route.path.startsWith('/personal-Center/info')" src="~/assets/images/user3.png" alt="" srcset="" class="h-[20px]" /> <img v-if="route.path.startsWith('/personal-center/info')" src="~/assets/images/user3.png" alt="" srcset="" class="h-[20px]" />
<img v-else src="~/assets/images/个人.png" alt="" srcset="" class="h-[20px]" /> <img v-else src="~/assets/images/个人.png" alt="" srcset="" class="h-[20px]" />
<span class="ml-[10px]">个人中心</span> <span class="ml-[10px]">个人中心</span>
</div> </div>
@ -15,9 +15,9 @@
</div> </div>
</nuxt-link> </nuxt-link>
<!-- <nuxt-link to="/personal-Center/personal-profile" class="flex items-center justify-between py-[14px]"> <!-- <nuxt-link to="/personal-center/personal-profile" class="flex items-center justify-between py-[14px]">
<div class="flex items-center pl-[20px]"> <div class="flex items-center pl-[20px]">
<img v-if="!route.path.startsWith('/personal-Center/personal-profile')" src="~/assets/images/user_zl.png" alt="" srcset="" class="h-[16px]" /> <img v-if="!route.path.startsWith('/personal-center/personal-profile')" src="~/assets/images/user_zl.png" alt="" srcset="" class="h-[16px]" />
<img v-else src="~/assets/images/个人资料 (1).png" alt="" srcset="" class="h-[16px]" /> <img v-else src="~/assets/images/个人资料 (1).png" alt="" srcset="" class="h-[16px]" />
<span class="ml-[10px]">个人资料</span> <span class="ml-[10px]">个人资料</span>
</div> </div>
@ -25,9 +25,9 @@
<el-icon><ArrowRight /></el-icon> <el-icon><ArrowRight /></el-icon>
</div> </div>
</nuxt-link> </nuxt-link>
<nuxt-link to="/personal-Center/account-security" class="flex items-center justify-between py-[14px]"> <nuxt-link to="/personal-center/account-security" class="flex items-center justify-between py-[14px]">
<div class="flex items-center pl-[20px]"> <div class="flex items-center pl-[20px]">
<img v-if="!route.path.startsWith('/personal-Center/account-security')" src="~/assets/images/account.png" alt="" srcset="" class="h-[20px]" /> <img v-if="!route.path.startsWith('/personal-center/account-security')" src="~/assets/images/account.png" alt="" srcset="" class="h-[20px]" />
<img v-else src="~/assets/images/账户安全.png" alt="" srcset="" class="h-[20px]" /> <img v-else src="~/assets/images/账户安全.png" alt="" srcset="" class="h-[20px]" />
<span class="ml-[14px]">账户与安全</span> <span class="ml-[14px]">账户与安全</span>
</div> </div>
@ -35,9 +35,9 @@
<el-icon><ArrowRight /></el-icon> <el-icon><ArrowRight /></el-icon>
</div> </div>
</nuxt-link> --> </nuxt-link> -->
<nuxt-link to="/personal-Center/account-management" class="flex items-center justify-between py-[14px]"> <nuxt-link to="/personal-center/account-management" class="flex items-center justify-between py-[14px]">
<div class="flex items-center pl-[20px]"> <div class="flex items-center pl-[20px]">
<img v-if="!route.path.startsWith('/personal-Center/account-management')" src="~/assets/images/account.png" alt="" srcset="" class="h-[20px]" /> <img v-if="!route.path.startsWith('/personal-center/account-management')" src="~/assets/images/account.png" alt="" srcset="" class="h-[20px]" />
<img v-else src="~/assets/images/账户安全.png" alt="" srcset="" class="h-[20px]" /> <img v-else src="~/assets/images/账户安全.png" alt="" srcset="" class="h-[20px]" />
<span class="ml-[14px]">账户管理</span> <span class="ml-[14px]">账户管理</span>
</div> </div>
@ -45,9 +45,9 @@
<el-icon><ArrowRight /></el-icon> <el-icon><ArrowRight /></el-icon>
</div> </div>
</nuxt-link> </nuxt-link>
<nuxt-link to="/personal-Center/resource-center" class="flex items-center justify-between py-[14px]"> <nuxt-link to="/personal-center/resource-center" class="flex items-center justify-between py-[14px]">
<div class="flex items-center pl-[20px]"> <div class="flex items-center pl-[20px]">
<img v-if="!route.path.startsWith('/personal-Center/resource-center')" src="~/assets/images/ziyuan.png" alt="" srcset="" class="h-[18px]" /> <img v-if="!route.path.startsWith('/personal-center/resource-center')" src="~/assets/images/ziyuan.png" alt="" srcset="" class="h-[18px]" />
<img v-else src="~/assets/images/资源.png" alt="" srcset="" class="h-[18px]" /> <img v-else src="~/assets/images/资源.png" alt="" srcset="" class="h-[18px]" />
<span class="ml-[12px]">资源中心</span> <span class="ml-[12px]">资源中心</span>
</div> </div>
@ -55,19 +55,19 @@
<el-icon><ArrowRight /></el-icon> <el-icon><ArrowRight /></el-icon>
</div> </div>
</nuxt-link> </nuxt-link>
<nuxt-link to="/personal-Center/trading-center" class="flex items-center justify-between py-[14px]"> <nuxt-link to="/personal-center/trading-center" class="flex items-center justify-between py-[14px]">
<div class="flex items-center pl-[20px]"> <div class="flex items-center pl-[20px]">
<img v-if="!route.path.startsWith('/personal-Center/trading-center')" src="~/assets/images/pay.png" alt="" srcset="" class="h-[20px]" /> <img v-if="!route.path.startsWith('/personal-center/trading-center')" src="~/assets/images/pay.png" alt="" srcset="" class="h-[20px]" />
<img v-else src="~/assets/images/交易管理.png" alt="" srcset="" class="h-[20px]" /> <img v-else src="~/assets/images/交易管理.png" alt="" srcset="" class="h-[20px]" />
<span class="ml-[12px]">交易中心</span> <span class="ml-[12px]">交易记录</span>
</div> </div>
<div class="pr-[20px]"> <div class="pr-[20px]">
<el-icon><ArrowRight /></el-icon> <el-icon><ArrowRight /></el-icon>
</div> </div>
</nuxt-link> </nuxt-link>
<nuxt-link to="/personal-Center/message-center" class="flex items-center justify-between py-[14px]"> <nuxt-link to="/personal-center/message-center" class="flex items-center justify-between py-[14px]">
<div class="flex items-center pl-[20px]"> <div class="flex items-center pl-[20px]">
<img v-if="!route.path.startsWith('/personal-Center/message-center')" src="~/assets/images/message.png" alt="" srcset="" class="h-[18px]" /> <img v-if="!route.path.startsWith('/personal-center/message-center')" src="~/assets/images/message.png" alt="" srcset="" class="h-[18px]" />
<img v-else src="~/assets/images/消息.png" alt="" srcset="" class="h-[18px]" /> <img v-else src="~/assets/images/消息.png" alt="" srcset="" class="h-[18px]" />
<span class="ml-[14px]">消息通知</span> <span class="ml-[14px]">消息通知</span>
</div> </div>

View File

@ -17,7 +17,14 @@
<!-- 分页 --> <!-- 分页 -->
<div class="pagination mt-15px"> <div class="pagination mt-15px">
<el-pagination v-model:current-page="query.pageNo" :page-size="10" :total="result.total" background layout="prev, pager, next, jumper" /> <el-pagination
v-model:current-page="query.pageNo"
:page-size="10"
:total="result.total"
background
layout="prev, pager, next, jumper"
@current-change="handeClickCurrent"
/>
</div> </div>
</template> </template>
@ -51,6 +58,12 @@
} }
} }
getTradeRecords() getTradeRecords()
// 点击分页
const handeClickCurrent = (pageNo: number) => {
query.pageNo = pageNo
getTradeRecords()
}
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
:deep(.el-pagination) { :deep(.el-pagination) {

View File

@ -11,12 +11,12 @@
<!-- <div class="vip-card-subtitle">中小微企业</div> --> <!-- <div class="vip-card-subtitle">中小微企业</div> -->
</div> </div>
<div class="vip-card-price"> <div class="vip-card-price">
<span class="price">{{ accDiv(item.payPrice || 0, 100) }}</span> <span class="price">{{ item.payPrice }}</span>
<!-- <span class="per">/1</span> --> <!-- <span class="per">/1</span> -->
</div> </div>
<ul class="vip-card-features"> <ul class="vip-card-features">
<li <li
>赠送<span class="color-red">{{ accDiv(item.bonusPrice || 0, 100) }}</span></li >赠送<span class="color-red">{{ item.bonusPrice }}</span></li
> >
<!-- <li>1. {{ item.profile }}</li> <!-- <li>1. {{ item.profile }}</li>
<li <li
@ -39,7 +39,7 @@
<script setup lang="ts"> <script setup lang="ts">
import { ref, watch, onMounted } from 'vue' import { ref, watch, onMounted } from 'vue'
import { listWalletRechargePackage, submitPayOrder, getPayStatus } from '~/api/pay/index' import { listWalletRechargePackage, submitPayOrder, getPayStatus } from '~/api/pay/index'
import { accDiv } from '~/utils/utils' // import { accDiv } from '~/utils/utils'
import { Close } from '@element-plus/icons-vue' import { Close } from '@element-plus/icons-vue'
import type { AppPayWalletPackageRespVO } from '~/api/pay/types' import type { AppPayWalletPackageRespVO } from '~/api/pay/types'
// @ts-ignore // @ts-ignore

View File

@ -125,7 +125,7 @@
fetchUserStatistics() fetchUserStatistics()
const handleClick = () => { const handleClick = () => {
router.push({ path: '/personal-Center/account-management' }) router.push({ path: '/personal-center/account-management' })
} }
const payVisible = ref(false) const payVisible = ref(false)

View File

@ -1,24 +1,49 @@
<template> <template>
<div class="account-balance"> <div class="account-balance">
<!-- 余额展示区域 --> <!-- 余额展示区域 -->
<div class="balance-section"> <div class="balance-section flex h-206px!">
<div class="balance-title"> <div>
<span>我的金币</span> <div class="balance-title">
<el-tag size="small" type="primary">资产和使用</el-tag> <span>我的金币</span>
<el-tag size="small" type="primary">资产和使用</el-tag>
</div>
<div class="balance-amount">{{ userStaticInfo?.currencyCount || 0 }}</div>
<div class="balance-actions">
<el-button type="primary" @click="handlePay">充值</el-button>
<el-button type="danger" @click="handleWithdraw">提现</el-button>
<el-button type="warning">兑换</el-button>
</div>
<div class="balance-tip">提示最低提现金额100 一元=10金币</div>
</div> </div>
<div class="balance-amount">{{ userStaticInfo?.currencyCount || 0 }}</div> <el-divider direction="vertical" class="h-100%! mx-30px!" border-style="dashed"></el-divider>
<div class="balance-actions"> <div>
<el-button type="primary" @click="handlePay">充值</el-button> <div class="balance-title">
<el-button>提现</el-button> <span>我的收益</span>
<el-tag size="small" type="primary">收益金币数额展示</el-tag>
</div>
<div class="balance-amount">{{ userStaticInfo?.revenueBalance || 0 }}</div>
<div class="balance-actions">
<!-- <el-button type="primary" @click="handlePay">充值</el-button>
<el-button>提现</el-button> -->
</div>
<!-- <div class="balance-tip">提示最低提现金额100 一元=10金币</div> -->
</div> </div>
<div class="balance-tip">提示最低提现金额100 一元=10金币</div>
</div> </div>
<!-- 广告海报swiper -->
<el-carousel height="150px" class="rounded-[8px] rounded-[6px] border border-solid border-[#eeeeee] box-borders mb-20px">
<el-carousel-item>
<el-image src="https://static.tuxixi.net/tuxixi_banner3.png" alt="" class="w-100%" fit="contain" />
</el-carousel-item>
<el-carousel-item>
<el-image src="https://static.tuxixi.net/tuxixi_banner2.jpg" alt="" class="w-100%" fit="cover" />
</el-carousel-item>
</el-carousel>
<!-- 交易记录区域 --> <!-- 交易记录区域 -->
<div class="transaction-section"> <div class="transaction-section">
<div class="transaction-tabs"> <div class="transaction-tabs">
<el-tabs v-model="activeTab"> <el-tabs v-model="activeTab">
<el-tab-pane label="充值记录" name="purchase"> <el-tab-pane label="交易记录" name="purchase">
<!-- 组件 --> <!-- 组件 -->
<PayRecords></PayRecords> <PayRecords></PayRecords>
</el-tab-pane> </el-tab-pane>
@ -32,8 +57,14 @@
</div> --> </div> -->
</div> </div>
</div> </div>
<!-- 提示 -->
<div class="color-red pa-10px text-13px">
温馨提示交易未到账紧急联系客服,金币为虚拟积分不支持退款,但支持高额手续费提现抵制恶性充值提现操作金币使用没有时间限制,平台作品交易仅供学习参考,用于商业用途请与原作者联系!
</div>
<!-- 充值弹窗 --> <!-- 充值弹窗 -->
<Pay v-if="payVisible" v-model="payVisible" @refresh="fetchUserStatistics"></Pay> <Pay v-if="payVisible" v-model="payVisible" @refresh="fetchUserStatistics"></Pay>
<!-- 提现弹窗 -->
<Withdraw v-if="withdrawVisible" v-model="withdrawVisible"></Withdraw>
</div> </div>
</template> </template>
@ -60,6 +91,12 @@
payVisible.value = true payVisible.value = true
// router.push({ path: '/personal/trading/center' }) // router.push({ path: '/personal/trading/center' })
} }
const withdrawVisible = ref(false)
const handleWithdraw = () => {
withdrawVisible.value = true
// router.push({ path: '/personal/trading/center' })
}
</script> </script>
<style scoped> <style scoped>

View File

@ -11,14 +11,14 @@
<div <div
class="box-border h-[60px] w-[1019px] flex items-center justify-between border border-[#EEEEEE] rounded-[12px] border-solid bg-[#FFFFFF] px-[27px] py-[24px]" class="box-border h-[60px] w-[1019px] flex items-center justify-between border border-[#EEEEEE] rounded-[12px] border-solid bg-[#FFFFFF] px-[27px] py-[24px]"
> >
<div class="text-[20px] text-[#333333] font-normal"> {{ detail?.title }}</div> <div class="text-[16px] text-[#333333] font-normal"> {{ detail?.title }}</div>
<div class="flex items-center"> <div class="flex items-center">
<img :src="detail?.ownedUserIdInfo?.avatar" alt="" srcset="" class="h-[30px] w-[30px] rd-[50%]" /> <img :src="detail?.ownedUserAvatar" alt="" srcset="" class="h-[30px] w-[30px] rd-[50%]" />
<span class="ml-[12px] color-[#999999]">by {{ detail?.ownedUserIdInfo?.nickName }}</span> <span class="ml-[8px] color-[#999999]">by {{ detail?.ownedUserName }}</span>
</div> </div>
</div> </div>
<div class="ml-[23px] flex flex-1 text-[18px] text-[#FFFFFF] font-normal"> <div class="ml-[23px] flex flex-1 text-[16px] text-[#FFFFFF] font-normal">
<div class="h-[60px] w-[160px] flex cursor-pointer items-center justify-center rounded-[8px] bg-[#1A65FF]" @click="handleDownload"> <div class="h-[60px] w-[160px] flex cursor-pointer items-center justify-center rounded-[8px] bg-[#1A65FF]" @click="handleDownload">
<img src="~/assets/images/download.png" alt="" srcset="" class="mr-[4px] h-[22px] w-[27px]" /> <img src="~/assets/images/download.png" alt="" srcset="" class="mr-[4px] h-[22px] w-[27px]" />
{{ detail?.points === 0 ? '免费下载' : '立即下载' }} {{ detail?.points === 0 ? '免费下载' : '立即下载' }}
@ -45,16 +45,16 @@
<div> <div>
<ThumBnail :data="detail?.coverImages"></ThumBnail> <ThumBnail :data="detail?.coverImages"></ThumBnail>
</div> </div>
<div class="mb-[20px] mt-[34px] flex items-center text-[16px] text-[#333333] font-normal"> <div class="mb-[20px] mt-[34px] flex items-center text-[14px] text-[#333333] font-normal">
<div class="h-[24px] w-[4px] rounded-[1px] bg-[#1A65FF]"></div><span class="ml-[10px]">{{ detail?.title }}描述</span></div <div class="h-[20px] w-[4px] rounded-[1px] bg-[#1A65FF]"></div><span class="ml-[10px]">工具使用介绍</span></div
> >
<div <div
class="box-border min-h-[90px] w-[1019px] border border-[#EEEEEE] rounded-[6px] border-solid bg-[#FFFFFF] pa-[24px] text-[14px] text-[#333333] font-normal" class="box-border min-h-[90px] w-[1019px] border border-[#EEEEEE] rounded-[6px] border-solid bg-[#FFFFFF] pa-[24px] text-[14px] text-[#333333] font-normal"
> >
{{ detail?.description }} {{ detail?.description }}
</div> </div>
<div id="section1" class="mb-[20px] mt-[34px] flex items-center text-[16px] text-[#333333] font-normal"> <div id="section1" class="mb-[20px] mt-[34px] flex items-center text-[14px] text-[#333333] font-normal">
<div class="h-[24px] w-[4px] rounded-[1px] bg-[#1A65FF]"></div><span class="ml-[10px]">{{ detail?.title }}</span></div <div class="h-[20px] w-[4px] rounded-[1px] bg-[#1A65FF]"></div><span class="ml-[10px]">工具文</span></div
> >
<div class="box-border w-[1019px] border border-[#EEEEEE] rounded-[6px] border-solid bg-[#FFFFFF] pa-[24px]"> <div class="box-border w-[1019px] border border-[#EEEEEE] rounded-[6px] border-solid bg-[#FFFFFF] pa-[24px]">
<div class="border-b-[1px] border-b-[#eee] border-b-solid p-b-[10px]"> 包含的文件 </div> <div class="border-b-[1px] border-b-[#eee] border-b-solid p-b-[10px]"> 包含的文件 </div>
@ -81,10 +81,10 @@
</div> </div>
<!-- 评论 --> <!-- 评论 -->
<!-- <CommentSection :relation-id="detail!.id" :project-id="detail!.projectId" /> --> <CommentSection :relation-id="detail!.id" />
</div> </div>
<div class="ml-[22px]"> <div class="ml-[22px]">
<div class="box-border min-h-[269px] w-[397px] border border-[#EEEEEE] rounded-[12px] border-solid bg-[#FFFFFF] pa-[22px]"> <div class="box-border min-h-[180px] w-[397px] border border-[#EEEEEE] rounded-[12px] border-solid bg-[#FFFFFF] pa-[22px]">
<div class="mb-[10px]">工具ID: {{ detail?.no }}</div> <div class="mb-[10px]">工具ID: {{ detail?.no }}</div>
<!-- <div class="mb-[10px]">文件大小{{ detail?.filesInfo?.fileSize || 0 }} </div> --> <!-- <div class="mb-[10px]">文件大小{{ detail?.filesInfo?.fileSize || 0 }} </div> -->
<!-- <div class="mb-10px">图纸版本{{ detail.editionsName }} </div> --> <!-- <div class="mb-10px">图纸版本{{ detail.editionsName }} </div> -->
@ -99,33 +99,33 @@
<img src="~/assets/images/banner.png" alt="" srcset="" class="w-[100%]" /> <img src="~/assets/images/banner.png" alt="" srcset="" class="w-[100%]" />
<div class="box-border border border-[#EEEEEE] border-rd-[10px_10px_0px_0px] border-solid border-t-none bg-[#FFFFFF] pa-[18px]"> <div class="box-border border border-[#EEEEEE] border-rd-[10px_10px_0px_0px] border-solid border-t-none bg-[#FFFFFF] pa-[18px]">
<div class="flex flex-wrap items-start"> <div class="flex flex-wrap items-start">
<div v-if="userInfo.nickname" class="text-[18px] text-[#333333] font-bold">{{ userInfo.nickname }}</div> <div v-if="userInfo?.nickname" class="text-[18px] text-[#333333] font-bold">{{ userInfo.nickname }}</div>
<div <div
v-for="item in userInfo.labels" v-for="item in userInfo?.labels"
:key="item" :key="item"
class="mb-[10px] ml-[10px] box-border border border-[#1A65FF] rounded-[13px] border-solid px-[8px] py-[3px] color-[#1a65ff]" class="mb-[10px] ml-[10px] box-border border border-[#1A65FF] rounded-[13px] border-solid px-[8px] py-[3px] color-[#1a65ff]"
>{{ item }}</div >{{ item }}</div
> >
</div> </div>
<div v-if="userInfo.description" class="mb-[20px] text-[14px] text-[#333333] font-normal">{{ userInfo.description }}</div> <div v-if="userInfo?.description" class="mb-[20px] text-[14px] text-[#333333] font-normal">{{ userInfo.description }}</div>
<!-- 显示作品 粉丝 荣誉证书 --> <!-- 显示作品 粉丝 荣誉证书 -->
<div class="flex items-center gap-[40px]"> <div class="flex items-center gap-[40px]">
<div class="flex items-center"> <div class="flex items-center">
<div class="h-[20px]"> <div class="h-[20px]">
<img src="~/assets/images/folder.png" alt="works" class="w-[80%]" /> <img src="~/assets/images/folder.png" alt="works" class="w-[80%]" />
</div> </div>
<div class="ml-[8px] mt-[-4px] text-[14px] text-[#666] font-normal">作品: {{ userInfo.projectCount || 0 }}</div> <div class="ml-[8px] mt-[-4px] text-[14px] text-[#666] font-normal">作品: {{ userInfo?.projectCount || 0 }}</div>
</div> </div>
<div class="flex items-center"> <div class="flex items-center">
<div class="h-[20px]"> <div class="h-[20px]">
<img src="~/assets/images/user4.png" alt="fans" class="w-[80%] rounded-full vertical-top" /> <img src="~/assets/images/user4.png" alt="fans" class="w-[80%] rounded-full vertical-top" />
</div> </div>
<div class="relative top-[-3px] ml-[8px] text-[14px] text-[#666] font-normal">粉丝: {{ userInfo.fansCount || 0 }}</div> <div class="relative top-[-3px] ml-[8px] text-[14px] text-[#666] font-normal">发帖数: {{ userInfo?.fansCount || 0 }}</div>
</div> </div>
</div> </div>
<!-- 3个图片一排 超过换下一行 --> <!-- 3个图片一排 超过换下一行 -->
<div v-if="userInfo.files?.length" class="mt-[20px] flex flex-wrap gap-[16px]"> <div v-if="userInfo?.files?.length" class="mt-[20px] flex flex-wrap gap-[16px]">
<div v-for="i in userInfo.files" :key="i" class="flex-1"> <div v-for="i in userInfo.files" :key="i" class="flex-1">
<div <div
class="box-border h-[200px] w-full overflow-hidden border border-[#E5E7EB] rounded-[8px] border-solid from-[#FFFFFF] to-[#F5F7FA] bg-gradient-to-b p-[16px]" class="box-border h-[200px] w-full overflow-hidden border border-[#E5E7EB] rounded-[8px] border-solid from-[#FFFFFF] to-[#F5F7FA] bg-gradient-to-b p-[16px]"
@ -137,8 +137,8 @@
<div class="mt-[20px] h-[1px] w-[336px] rounded-[1px] bg-[#EEEEEE]"></div> <div class="mt-[20px] h-[1px] w-[336px] rounded-[1px] bg-[#EEEEEE]"></div>
<div class="mt-[20px] flex items-center"> <div class="mt-[20px] flex items-center">
<div class="h-[24px] w-[4px] rounded-[1px] bg-[#1A65FF]"></div> <div class="h-[20px] w-[4px] rounded-[1px] bg-[#1A65FF]"></div>
<span class="ml-[10px] text-[16px]">最新发布</span> <span class="ml-[10px] text-[14px]">最新发布</span>
</div> </div>
<div class="mt-[10px]"> <div class="mt-[10px]">
<div <div
@ -167,10 +167,10 @@
import CardPicture from '~/components/kl-card-picture/index.vue' import CardPicture from '~/components/kl-card-picture/index.vue'
import { getDictTree } from '~/api/home/index' import { getDictTree } from '~/api/home/index'
import { get } from '@/api/toolbox/index' import { get } from '@/api/toolbox/index'
import { getDetail, getRelationRecommend, report, getUserInfo, getMainWork, createContent, createUserProject, deleteProject } from '~/api/drawe-detail/index' import { getDetail, getRelationRecommend, report, getToolUserInfo, getMainWork, createContent, createUserProject, deleteProject } from '~/api/drawe-detail/index'
import KlNavTab from '~/components/kl-nav-tab/index.vue' import KlNavTab from '~/components/kl-nav-tab/index.vue'
import ThumBnail from './components/swiper.vue' import ThumBnail from './components/swiper.vue'
// import CommentSection from '~/components/comment-section/index.vue' import CommentSection from '~/components/comment-section/index.vue'
import { useRoute } from 'vue-router' import { useRoute } from 'vue-router'
import useUserStore from '~/stores/user' import useUserStore from '~/stores/user'
const message = useMessage() const message = useMessage()
@ -198,7 +198,7 @@
const [{ data: mainWork }, { data: userInfo }] = await Promise.all([ const [{ data: mainWork }, { data: userInfo }] = await Promise.all([
getMainWork({ id: detail.value?.id, limit: 10, memberId: detail.value?.ownedUserId }), getMainWork({ id: detail.value?.id, limit: 10, memberId: detail.value?.ownedUserId }),
getUserInfo({ id: detail.value?.id }), getToolUserInfo({ id: detail.value?.id }),
]) ])
// 获取最新发布 // 获取最新发布
@ -300,8 +300,8 @@
title: detail.value?.title, title: detail.value?.title,
files: detail.value?.files, files: detail.value?.files,
comments: value, comments: value,
projectId: detail.value?.projectId,
drawId: detail.value?.id, drawId: detail.value?.id,
type: 4,
}).then((res) => { }).then((res) => {
if (res.code === 0) { if (res.code === 0) {
ElMessage.success('举报成功') ElMessage.success('举报成功')
@ -319,8 +319,8 @@
const res = detail.value?.favoriteId const res = detail.value?.favoriteId
? await deleteProject({ id: detail.value.favoriteId }) ? await deleteProject({ id: detail.value.favoriteId })
: await createContent({ : await createContent({
projectId: detail.value?.projectId,
drawId: detail.value?.id, drawId: detail.value?.id,
type: 4,
}) })
if (res.code === 0) { if (res.code === 0) {
ElMessage.success(`${detail.value?.favoriteId ? '取消' : '收藏'}成功`) ElMessage.success(`${detail.value?.favoriteId ? '取消' : '收藏'}成功`)

View File

@ -10,9 +10,9 @@
<div class="swiper-button-prev"></div> <div class="swiper-button-prev"></div>
</div> </div>
</div> </div>
<div class="mb-[20px] mt-[34px] flex items-center text-[16px] text-[#333333] font-normal"> <div class="mb-[20px] mt-[34px] flex items-center text-[14px] text-[#333333] font-normal">
<div class="h-[24px] w-[4px] rounded-[1px] bg-[#1A65FF]"></div> <div class="h-[20px] w-[4px] rounded-[1px] bg-[#1A65FF]"></div>
<span class="ml-[10px]">工具</span> <span class="ml-[10px]">工具截图</span>
</div> </div>
<div class="box-border h-[126px] w-[1019px] border border-[#EEEEEE] rounded-[6px] border-solid bg-[#FFFFFF] pa-[23px]"> <div class="box-border h-[126px] w-[1019px] border border-[#EEEEEE] rounded-[6px] border-solid bg-[#FFFFFF] pa-[23px]">
<div thumbsSlider="" class="swiper mySwiper"> <div thumbsSlider="" class="swiper mySwiper">

11
plugins/error-handler.ts Normal file
View File

@ -0,0 +1,11 @@
export default defineNuxtPlugin((nuxtApp) => {
nuxtApp.vueApp.config.errorHandler = (error, instance, info) => {
// 处理错误,例如发送报告到服务
console.log(error)
}
// 也可以这样做
// nuxtApp.hook('vue:error', (error, instance, info) => {
// // 处理错误,例如发送报告到服务
// })
})

View File

@ -99,6 +99,39 @@ export default defineStore('useUserStore', {
console.error('getToken error:', error) console.error('getToken error:', error)
} }
}, },
async getTokenV2(row: any) {
const app = useNuxtApp()
try {
const res = await socialLoginByCode({
openId: row.openId,
sceneStr: row.sceneStr,
type: 32
})
const { code, data } = res
if (code === 0) {
// 打开登录界面
if (!data.accessToken) {
ElMessage.error('因你未绑定手机号,请先绑定手机号')
app.$openLogin('verify', row.code, row.type, row.state)
} else {
refreshToken.setToken(data.accessToken, data.refreshToken)
refreshToken.setUserId(data.userId.toString())
// refreshToken.setUserName(loginForm.mobile)
this.setToken(data.accessToken)
this.setUserId(data.userId.toString())
// userStore.setUserName(loginForm.mobile)
this.setRefreshToken(data.refreshToken)
// 获取信息
await this.getUserInfo()
}
} else {
console.error('获取token失败:', res.msg)
}
} catch (error) {
console.error('getToken error:', error)
}
},
}, },
persist: import.meta.client && { persist: import.meta.client && {
key: 'tuxixi-store', key: 'tuxixi-store',