feat(collect-code): 新增收款二维码功能
- 添加新的 API接口和相关组件 - 实现用户认证和艺术品列表展示- 新增个人资料填写页面- 优化首页和登录页面样式
This commit is contained in:
parent
41ad9aeed8
commit
2e08e6efcb
25
app/api-collect-code/auth/index.js
Normal file
25
app/api-collect-code/auth/index.js
Normal file
@ -0,0 +1,25 @@
|
||||
import { request } from '@/api/http.js'
|
||||
|
||||
export async function senCode(data) {
|
||||
|
||||
return await request({
|
||||
url:'/api/v1/m/user/send',
|
||||
method: 'POST',
|
||||
data
|
||||
})
|
||||
}
|
||||
export async function userLogin(data) {
|
||||
|
||||
return await request( {
|
||||
url:'/api/v1/m/user/login',
|
||||
method: 'POST',
|
||||
data
|
||||
})
|
||||
}
|
||||
export async function userUpdate(data) {
|
||||
return await request( {
|
||||
url:'/api/v1/m/user/update',
|
||||
method: 'POST',
|
||||
data
|
||||
})
|
||||
}
|
32
app/api-collect-code/goods/index.js
Normal file
32
app/api-collect-code/goods/index.js
Normal file
@ -0,0 +1,32 @@
|
||||
import { request } from '@/api/http.js'
|
||||
|
||||
export async function artworkList(data) {
|
||||
return await request( {
|
||||
url:'/api/v1/m/auction/default/artwork/list',
|
||||
method: 'POST',
|
||||
data
|
||||
})
|
||||
}
|
||||
export async function defaultDetail(data) {
|
||||
return await request ({
|
||||
url:'/api/v1/m/auction/default/detail',
|
||||
method: 'POST',
|
||||
data
|
||||
})
|
||||
}
|
||||
export async function artworkDetail(data) {
|
||||
|
||||
return await request( {
|
||||
url:'/api/v1/m/artwork/detail',
|
||||
method: 'POST',
|
||||
data,
|
||||
})
|
||||
}
|
||||
export async function userArtworks(data) {
|
||||
|
||||
return await request( {
|
||||
url:'/api/v1/m/user/artworks',
|
||||
method: 'POST',
|
||||
data
|
||||
})
|
||||
}
|
128
app/api-collect-code/http.js
Normal file
128
app/api-collect-code/http.js
Normal file
@ -0,0 +1,128 @@
|
||||
import {useRuntimeConfig} from '#app'
|
||||
import {ofetch} from 'ofetch'
|
||||
import {message} from '@/components/x-message/useMessage.js'
|
||||
import {codeAuthStore} from "@/stores-collect-code/auth/index.js"
|
||||
|
||||
let httpStatusErrorHandler
|
||||
let http
|
||||
|
||||
// HTTP 状态码映射
|
||||
const HTTP_STATUS_MAP = {
|
||||
400: '请求参数错误',
|
||||
401: '未授权或登录过期',
|
||||
403: '访问被禁止',
|
||||
404: '请求的资源不存在',
|
||||
500: '服务器内部错误',
|
||||
502: '网关错误',
|
||||
503: '服务暂时不可用',
|
||||
504: '网关超时'
|
||||
}
|
||||
|
||||
export function setupHttp() {
|
||||
if (http) return http
|
||||
const {token}= codeAuthStore()
|
||||
const config = useRuntimeConfig()
|
||||
const baseURL = config.public.NUXT_PUBLIC_API_COLLECT_CODE
|
||||
|
||||
const router = useRouter()
|
||||
|
||||
const defaultOptions = {
|
||||
baseURL,
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
timeout: 15000, // 15秒超时
|
||||
retry: 3,
|
||||
retryDelay: 1000,
|
||||
}
|
||||
|
||||
http = ofetch.create({
|
||||
...defaultOptions,
|
||||
|
||||
// 请求拦截
|
||||
async onRequest({ options, request }) {
|
||||
// 添加 token
|
||||
options.headers = {
|
||||
...options.headers,
|
||||
Authorization: token.value
|
||||
}
|
||||
|
||||
// GET 请求添加时间戳防止缓存
|
||||
if (request.toLowerCase().includes('get')) {
|
||||
options.params = {
|
||||
...options.params,
|
||||
_t: Date.now()
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
// 响应拦截
|
||||
async onResponse({ response }) {
|
||||
const data = response._data
|
||||
|
||||
// 处理业务错误
|
||||
if (data.status === 1) {
|
||||
message.error(data.msg || '操作失败')
|
||||
}
|
||||
|
||||
// 处理登录失效
|
||||
if (data.status === 401) {
|
||||
message.error('登录已过期,请重新登录')
|
||||
token.value = '' // 清除 token
|
||||
router.replace('/collectCode/login')
|
||||
}
|
||||
|
||||
return response
|
||||
},
|
||||
|
||||
// 响应错误处理
|
||||
async onResponseError({ response, request }) {
|
||||
// 网络错误
|
||||
if (!response) {
|
||||
message.error('网络连接失败,请检查网络设置')
|
||||
return Promise.reject(new Error('网络错误'))
|
||||
}
|
||||
const status = response.status
|
||||
const data = response._data
|
||||
|
||||
// 处理 HTTP 状态错误
|
||||
const errorMessage = data.msg || HTTP_STATUS_MAP[status] || '请求失败'
|
||||
|
||||
if (Array.isArray(data.msg)) {
|
||||
data.msg.forEach(item => {
|
||||
httpStatusErrorHandler?.(item, status)
|
||||
})
|
||||
} else {
|
||||
httpStatusErrorHandler?.(errorMessage, status)
|
||||
}
|
||||
|
||||
message.error(errorMessage)
|
||||
return Promise.reject(data)
|
||||
},
|
||||
})
|
||||
|
||||
return http
|
||||
}
|
||||
|
||||
export function createAbortController() {
|
||||
return new AbortController()
|
||||
}
|
||||
|
||||
export function injectHttpStatusErrorHandler(handler) {
|
||||
httpStatusErrorHandler = handler
|
||||
}
|
||||
|
||||
export function getHttp() {
|
||||
if (!http) {
|
||||
throw new Error('HTTP client not initialized. Call setupHttp first.')
|
||||
}
|
||||
return http
|
||||
}
|
||||
|
||||
// 导出请求工具函数
|
||||
export async function request({url,...options}) {
|
||||
const http = getHttp()
|
||||
try {
|
||||
return await http(url, {...options,body:options.data})
|
||||
} catch (error) {
|
||||
throw error
|
||||
}
|
||||
}
|
@ -51,6 +51,9 @@ provide('slideDirection', slideDirection)
|
||||
</template>
|
||||
|
||||
<style>
|
||||
:root:root {
|
||||
--van-dialog-radius: 8px
|
||||
}
|
||||
.slide-left-enter-active,
|
||||
.slide-left-leave-active,
|
||||
.slide-right-enter-active,
|
||||
@ -79,4 +82,5 @@ provide('slideDirection', slideDirection)
|
||||
:root {
|
||||
--safe-area-inset-bottom: env(safe-area-inset-bottom);
|
||||
}
|
||||
|
||||
</style>
|
@ -36,7 +36,6 @@ const showImage = () => {
|
||||
<template>
|
||||
|
||||
<nuxt-img
|
||||
v-if="src"
|
||||
loading="lazy"
|
||||
v-bind="{ ...props, ...$attrs }"
|
||||
style="object-fit: cover"
|
||||
@ -48,7 +47,6 @@ const showImage = () => {
|
||||
:quality="quality"
|
||||
placeholder
|
||||
/>
|
||||
<van-empty v-else description="暂无" />
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
|
109
app/components/x-van-date/index.vue
Normal file
109
app/components/x-van-date/index.vue
Normal file
@ -0,0 +1,109 @@
|
||||
<script setup>
|
||||
import { ref, computed } from 'vue'
|
||||
import dayjs from 'dayjs'
|
||||
|
||||
const props = defineProps({
|
||||
modelValue: {
|
||||
type: [Date, String, Number],
|
||||
default: () => new Date() // 默认当前日期
|
||||
},
|
||||
label: {
|
||||
type: String,
|
||||
default: '日期'
|
||||
},
|
||||
required: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
placeholder: {
|
||||
type: String,
|
||||
default: '请选择日期'
|
||||
},
|
||||
disabled: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
minDate: {
|
||||
type: Date,
|
||||
default: () => new Date(1900, 0, 1)
|
||||
},
|
||||
maxDate: {
|
||||
type: Date,
|
||||
default: () => new Date(2100, 11, 31)
|
||||
},
|
||||
format: {
|
||||
type: String,
|
||||
default: 'YYYY-MM-DD'
|
||||
}
|
||||
})
|
||||
|
||||
const emit = defineEmits(['update:modelValue', 'change'])
|
||||
const show = ref(false)
|
||||
|
||||
// 显示文本
|
||||
const displayText = computed(() => {
|
||||
return dayjs(props.modelValue).format(props.format)
|
||||
})
|
||||
|
||||
// 默认值
|
||||
const defaultValue = computed(() => {
|
||||
const date = props.modelValue || new Date()
|
||||
return [
|
||||
date.getFullYear(),
|
||||
date.getMonth() + 1,
|
||||
date.getDate()
|
||||
]
|
||||
})
|
||||
|
||||
// 确认选择
|
||||
const onConfirm = ({ selectedValues }) => {
|
||||
show.value = false
|
||||
const date = new Date(selectedValues[0], selectedValues[1] - 1, selectedValues[2])
|
||||
emit('update:modelValue', date)
|
||||
emit('change', date)
|
||||
}
|
||||
|
||||
// 取消选择
|
||||
const onCancel = () => {
|
||||
show.value = false
|
||||
}
|
||||
|
||||
// 重置为当前日期
|
||||
const reset = () => {
|
||||
emit('update:modelValue', new Date())
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
reset
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<van-field
|
||||
:model-value="displayText"
|
||||
@click="show = true"
|
||||
readonly
|
||||
:disabled="disabled"
|
||||
:required="required"
|
||||
:placeholder="placeholder"
|
||||
:label="label"
|
||||
class="mb-10px"
|
||||
is-link
|
||||
/>
|
||||
|
||||
<van-popup
|
||||
v-model:show="show"
|
||||
position="bottom"
|
||||
>
|
||||
<van-date-picker
|
||||
:min-date="minDate"
|
||||
:max-date="maxDate"
|
||||
:model-value="defaultValue"
|
||||
@confirm="onConfirm"
|
||||
@cancel="onCancel"
|
||||
title="选择日期"
|
||||
/>
|
||||
</van-popup>
|
||||
</div>
|
||||
</template>
|
88
app/components/x-van-select/index.vue
Normal file
88
app/components/x-van-select/index.vue
Normal file
@ -0,0 +1,88 @@
|
||||
<script setup>
|
||||
import { ref } from 'vue'
|
||||
const props = defineProps({
|
||||
value: {
|
||||
type: [Number, String]
|
||||
},
|
||||
columns: {
|
||||
type: Array,
|
||||
default: () => []
|
||||
},
|
||||
|
||||
label: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
|
||||
required: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
|
||||
placeholder: {
|
||||
type: String,
|
||||
default: '请选择'
|
||||
},
|
||||
|
||||
disabled: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
})
|
||||
|
||||
const emit = defineEmits(['update:value', 'change'])
|
||||
|
||||
const show = ref(false)
|
||||
|
||||
const onConfirm = (value) => {
|
||||
show.value = false
|
||||
emit('update:value', value.value)
|
||||
emit('change', value)
|
||||
}
|
||||
|
||||
const displayText = computed(() => {
|
||||
const selected = props.columns.find(x => x.value === props.value)
|
||||
return selected?.text || ''
|
||||
})
|
||||
|
||||
const reset = () => {
|
||||
emit('update:value', undefined)
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
reset
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<van-field
|
||||
:model-value="displayText"
|
||||
@click="show = true"
|
||||
readonly
|
||||
:disabled="disabled"
|
||||
:required="required"
|
||||
:placeholder="placeholder"
|
||||
:label="label"
|
||||
class="mb-10px"
|
||||
is-link
|
||||
/>
|
||||
|
||||
<van-popup
|
||||
v-model:show="show"
|
||||
destroy-on-close
|
||||
position="bottom"
|
||||
safe-area-inset-bottom
|
||||
>
|
||||
<van-picker
|
||||
:columns="columns"
|
||||
@confirm="onConfirm"
|
||||
@cancel="show = false"
|
||||
:default-index="columns.findIndex(x => x.value === value)"
|
||||
title="请选择"
|
||||
confirm-button-text="确定"
|
||||
cancel-button-text="取消"
|
||||
/>
|
||||
</van-popup>
|
||||
</div>
|
||||
</template>
|
@ -10,10 +10,6 @@ const { userInfo, token,fingerprint } = authStore()
|
||||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
const { locale } = useI18n()
|
||||
definePageMeta({
|
||||
title: '登录',
|
||||
i18n: 'login.title',
|
||||
})
|
||||
const loadingRef = ref({
|
||||
loading1: false,
|
||||
loading2: false,
|
||||
@ -137,7 +133,6 @@ const goLogin = async () => {
|
||||
<div class="text-[14px] text-[#2B53AC]">
|
||||
{{ loginType === 0 ? '密码登录' : '验证码登录' }}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div />
|
||||
</div>
|
||||
|
@ -1,10 +1,9 @@
|
||||
<script setup>
|
||||
import { userArtworks } from "@/api/goods/index.js";
|
||||
import { authStore } from "@/stores/auth/index.js";
|
||||
|
||||
import XImage from '@/components/x-image/index.vue'
|
||||
definePageMeta({
|
||||
layout: 'default',
|
||||
title: '收款二维码',
|
||||
i18n: 'menu.profile',
|
||||
})
|
||||
const { userInfo } = authStore()
|
||||
@ -14,11 +13,19 @@ const initData = async () => {
|
||||
|
||||
}
|
||||
}
|
||||
const show=ref(true)
|
||||
const close=()=>{
|
||||
show.value=false
|
||||
|
||||
}
|
||||
const confirm=()=>{
|
||||
show.value=true
|
||||
}
|
||||
initData()
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="w-[100vw] bg-[url('@/static/images/3532@2x.png')] bg-cover pt-43px flex-grow-1 flex flex-col">
|
||||
<div class="w-[100vw] bg-[url('@/static/images/3532@2x.png')] h-screen-nav bg-cover pt-43px flex-grow-1 flex flex-col">
|
||||
<div class="flex items-center px-16px mb-43px">
|
||||
<div class="mr-23px">
|
||||
<img class="w-57px h-57px" src="@/static/images/5514@2x.png" alt="">
|
||||
@ -27,29 +34,193 @@ initData()
|
||||
<div class="text-18px text-#181818">{{ userInfo.realName }}</div>
|
||||
<div class="text-#575757 text-14px">{{ userInfo.telNum }}</div>
|
||||
</div>
|
||||
<div class="flex-grow-1 flex justify-end">
|
||||
<div class="grow-1 flex justify-end">
|
||||
<img class="w-40px h-40px" src="@/static/images/logout.png" alt="">
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-grow-1">
|
||||
<div class="border-b-1px border-b-#D3D3D3 px-16px flex">
|
||||
<div class="text-#000 text-16px border-b-3 border-b-#2B53AC h-36px">线下付款二维码 </div>
|
||||
</div>
|
||||
<div class="grow-1 flex flex-col overflow-hidden py-15px">
|
||||
<div class="overflow-auto">
|
||||
<van-pull-refresh>
|
||||
<van-list finished-text="没有更多了">
|
||||
<van-swipe-cell>
|
||||
|
||||
<van-cell :border="false" title="单元格" value="内容" />
|
||||
<van-list finished-text="没有更多了" class="px-14px">
|
||||
<van-swipe-cell class="mb-14px">
|
||||
<div class="flex flex-col h-120px bg-#F7F7F7 rounded-4px px-13px">
|
||||
<div class="flex h-40px border-b border-b-#F0F0F0 items-center justify-between px-8px">
|
||||
<div class="text-14px text-#000">¥ 980,000/980,000</div>
|
||||
<div class="text-12px text-#18A058">已付款</div>
|
||||
</div>
|
||||
<div class="flex flex-grow-1 px-8px py-11px">
|
||||
<div class="mr-8px">
|
||||
<XImage class="w-57px h-56px rounded-4px" src=""></XImage>
|
||||
</div>
|
||||
<div class="text-12px text-#1E1E1E">
|
||||
<div>Lot:22</div>
|
||||
<div>创建人:张三丰</div>
|
||||
<div>创建时间:2024-09-06 12:12:12</div>
|
||||
</div>
|
||||
<div class="flex flex-col justify-end ml-auto ">
|
||||
<div class="flex w-55px h-26px bg-#2B53AC rounded-4px justify-center items-center">
|
||||
<div class="text-12px text-#fff line-height-none mt-0.5px mr-5px">查看</div>
|
||||
<div>
|
||||
<img class="w-12px h-12px" src="@/static/images/icon-design-42@3x.png" alt="">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<template #right>
|
||||
<van-button square type="danger" text="删除" />
|
||||
<van-button square type="primary" text="收藏" />
|
||||
<div class="w-65px h-full bg-#CF3050 flex items-center justify-center">
|
||||
<img class="w-22px h-24px" src="@/static/images/delete3@.png" alt="">
|
||||
</div>
|
||||
</template>
|
||||
</van-swipe-cell>
|
||||
<van-swipe-cell class="mb-14px">
|
||||
<div class="flex flex-col h-120px bg-#F7F7F7 rounded-4px px-13px">
|
||||
<div class="flex h-40px border-b border-b-#F0F0F0 items-center justify-between px-8px">
|
||||
<div class="text-14px text-#000">¥ 980,000/980,000</div>
|
||||
<div class="text-12px text-#18A058">已付款</div>
|
||||
</div>
|
||||
<div class="flex flex-grow-1 px-8px py-11px">
|
||||
<div class="mr-8px">
|
||||
<XImage class="w-57px h-56px rounded-4px" src=""></XImage>
|
||||
</div>
|
||||
<div class="text-12px text-#1E1E1E">
|
||||
<div>Lot:22</div>
|
||||
<div>创建人:张三丰</div>
|
||||
<div>创建时间:2024-09-06 12:12:12</div>
|
||||
</div>
|
||||
<div class="flex flex-col justify-end ml-auto ">
|
||||
<div class="flex w-55px h-26px bg-#2B53AC rounded-4px justify-center items-center">
|
||||
<div class="text-12px text-#fff line-height-none mt-0.5px mr-5px">查看</div>
|
||||
<div>
|
||||
<img class="w-12px h-12px" src="@/static/images/icon-design-42@3x.png" alt="">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<template #right>
|
||||
<div class="w-65px h-full bg-#CF3050 flex items-center justify-center">
|
||||
<img class="w-22px h-24px" src="@/static/images/delete3@.png" alt="">
|
||||
</div>
|
||||
</template>
|
||||
</van-swipe-cell>
|
||||
<van-swipe-cell class="mb-14px">
|
||||
<div class="flex flex-col h-120px bg-#F7F7F7 rounded-4px px-13px">
|
||||
<div class="flex h-40px border-b border-b-#F0F0F0 items-center justify-between px-8px">
|
||||
<div class="text-14px text-#000">¥ 980,000/980,000</div>
|
||||
<div class="text-12px text-#18A058">已付款</div>
|
||||
</div>
|
||||
<div class="flex flex-grow-1 px-8px py-11px">
|
||||
<div class="mr-8px">
|
||||
<XImage class="w-57px h-56px rounded-4px" src=""></XImage>
|
||||
</div>
|
||||
<div class="text-12px text-#1E1E1E">
|
||||
<div>Lot:22</div>
|
||||
<div>创建人:张三丰</div>
|
||||
<div>创建时间:2024-09-06 12:12:12</div>
|
||||
</div>
|
||||
<div class="flex flex-col justify-end ml-auto ">
|
||||
<div class="flex w-55px h-26px bg-#2B53AC rounded-4px justify-center items-center">
|
||||
<div class="text-12px text-#fff line-height-none mt-0.5px mr-5px">查看</div>
|
||||
<div>
|
||||
<img class="w-12px h-12px" src="@/static/images/icon-design-42@3x.png" alt="">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<template #right>
|
||||
<div class="w-65px h-full bg-#CF3050 flex items-center justify-center">
|
||||
<img class="w-22px h-24px" src="@/static/images/delete3@.png" alt="">
|
||||
</div>
|
||||
</template>
|
||||
</van-swipe-cell>
|
||||
<van-swipe-cell class="mb-14px">
|
||||
<div class="flex flex-col h-120px bg-#F7F7F7 rounded-4px px-13px">
|
||||
<div class="flex h-40px border-b border-b-#F0F0F0 items-center justify-between px-8px">
|
||||
<div class="text-14px text-#000">¥ 980,000/980,000</div>
|
||||
<div class="text-12px text-#18A058">已付款</div>
|
||||
</div>
|
||||
<div class="flex flex-grow-1 px-8px py-11px">
|
||||
<div class="mr-8px">
|
||||
<XImage class="w-57px h-56px rounded-4px" src=""></XImage>
|
||||
</div>
|
||||
<div class="text-12px text-#1E1E1E">
|
||||
<div>Lot:22</div>
|
||||
<div>创建人:张三丰</div>
|
||||
<div>创建时间:2024-09-06 12:12:12</div>
|
||||
</div>
|
||||
<div class="flex flex-col justify-end ml-auto ">
|
||||
<div class="flex w-55px h-26px bg-#2B53AC rounded-4px justify-center items-center">
|
||||
<div class="text-12px text-#fff line-height-none mt-0.5px mr-5px">查看</div>
|
||||
<div>
|
||||
<img class="w-12px h-12px" src="@/static/images/icon-design-42@3x.png" alt="">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<template #right>
|
||||
<div class="w-65px h-full bg-#CF3050 flex items-center justify-center">
|
||||
<img class="w-22px h-24px" src="@/static/images/delete3@.png" alt="">
|
||||
</div>
|
||||
</template>
|
||||
</van-swipe-cell>
|
||||
</van-list>
|
||||
</van-pull-refresh>
|
||||
</div>
|
||||
</div>
|
||||
<div class="h-81px w-full flex justify-center shrink-0 pt-10px">
|
||||
<div class="w-213px h-38px bg-#2B53AC text-#fff flex justify-center items-center text-14px rounded-4px" @click="show=true">
|
||||
新增
|
||||
</div>
|
||||
</div>
|
||||
<van-dialog v-model:show="show" show-cancel-button @close="close" @confirm="confirm">
|
||||
<div class="pt-18px pb-24px px-24px">
|
||||
<div class="text-16px text-#000 font-bold text-center mb-26px">新增收款二维码</div>
|
||||
<div class="">
|
||||
<div class="flex mb-6px items-center">
|
||||
<div class="w-58px">
|
||||
<div class="text-#1A1A1A text-16px">金额</div>
|
||||
<div class="text-#939393 text-12px">RMB</div>
|
||||
</div>
|
||||
<div>
|
||||
<input class="w-214px h-48px bg-#F3F3F3 rounded-4px px-11px text-16px" placeholder="请输入金额">
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-center">
|
||||
<div class="w-58px">
|
||||
<div class="text-#1A1A1A text-16px">Lot号</div>
|
||||
</div>
|
||||
<div>
|
||||
<input class="w-214px h-48px bg-#F3F3F3 rounded-4px px-11px text-16px" placeholder="请输入拍品序号">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex flex-col items-center">
|
||||
<div class="text-#CF3050 text-12px mb-8px mt-4px">*该拍品号当前已存在收款二维码,确定要创建吗?</div>
|
||||
<div>
|
||||
<XImage class="w-116px h-116px rounded-4px mb-9px" src=""></XImage>
|
||||
<div class="text-12px text-#575757 flex flex-col items-center">
|
||||
<div>日出而作,日落而息</div>
|
||||
<div>张天赐</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</van-dialog>
|
||||
</div>
|
||||
</template>
|
||||
<style scoped>
|
||||
|
||||
<style scoped lang="scss">
|
||||
:deep(.van-hairline--top.van-dialog__footer){
|
||||
&>.van-button{
|
||||
border-top: 1px solid #E7E7E7;
|
||||
&.van-dialog__cancel{
|
||||
border-right: 1px solid #E7E7E7;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
52
app/pages/collectCode/signature/personal-Info/index.vue
Normal file
52
app/pages/collectCode/signature/personal-Info/index.vue
Normal file
@ -0,0 +1,52 @@
|
||||
<script setup>
|
||||
import {useI18n} from "vue-i18n";
|
||||
import XVanSelect from '@/components/x-van-select/index.vue'
|
||||
import XVanDate from '@/components/x-van-date/index.vue'
|
||||
|
||||
definePageMeta({
|
||||
layout: 'default',
|
||||
i18n: 'menu.profile',
|
||||
})
|
||||
const {t} = useI18n()
|
||||
const showPicker = ref(false)
|
||||
const showPicker1 = ref(false)
|
||||
const onConfirm = () => {
|
||||
|
||||
}
|
||||
const columns = ref([
|
||||
{text: t('realAuth.male'), value: 1},
|
||||
{text: t('realAuth.female'), value: 2},
|
||||
])
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div
|
||||
class="w-[100vw] bg-[url('@/static/images/asdfsdd.png')] h-screen-nav bg-cover pt-43px flex-grow-1 flex flex-col px-34px">
|
||||
<div class="text-16px text-#191919">
|
||||
请填写个人相关信息
|
||||
</div>
|
||||
<div>
|
||||
<van-field type="tel" :label-width="161" label="文本" class="mb-10px" placeholder="请输入手机号">
|
||||
<template #label>
|
||||
<div class="flex">
|
||||
<div class="mr-41px whitespace-nowrap">手机号</div>
|
||||
<div>
|
||||
<span class="mr-13px">+ 86</span>
|
||||
<van-icon name="arrow-down" class="text-#777777"/>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</van-field>
|
||||
<van-field label="姓名" class="mb-10px" placeholder="请输入姓名"/>
|
||||
<x-van-select label="性别" :columns="columns"/>
|
||||
<x-van-date label="出生日期"/>
|
||||
<van-field label="家庭住址" class="mb-10px" placeholder="请输入家庭住址"/>
|
||||
<van-field label="所属银行" class="mb-10px" placeholder="请输入所属银行"/>
|
||||
<van-field label="银行卡号码" class="mb-10px" placeholder="请输入银行卡号码"/>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
@ -9,6 +9,10 @@ const props = defineProps({
|
||||
show: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
detailInfo: {
|
||||
type: Object,
|
||||
default: null
|
||||
}
|
||||
})
|
||||
|
||||
@ -19,6 +23,6 @@ const handleClose = () => {
|
||||
</script>
|
||||
<template>
|
||||
<xPopup :show="show" title="拍品详情" @update:show="handleClose">
|
||||
<ItemDetail :detailInfo="artWorkDetail" />
|
||||
<ItemDetail :detailInfo="detailInfo" />
|
||||
</xPopup>
|
||||
</template>
|
@ -104,7 +104,7 @@ const openShow = async (item) => {
|
||||
</div>
|
||||
</van-list>
|
||||
</van-pull-refresh>
|
||||
<DetailPopup v-model:show="localState.showDetail"></DetailPopup>
|
||||
<DetailPopup v-model:show="localState.showDetail" :detailInfo="artWorkDetail"></DetailPopup>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
@ -13,14 +13,17 @@ const props = defineProps({
|
||||
}
|
||||
})
|
||||
const emit = defineEmits(['update:show'])
|
||||
|
||||
const showDetailInfo=ref(null)
|
||||
const close = () => emit('update:show', false);
|
||||
const openShow=()=>{
|
||||
const openShow=(item)=>{
|
||||
showDetailInfo.value=item
|
||||
showDetail.value=true
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<x-popup :show="show" @update:show="close">
|
||||
<template #title>
|
||||
<div class="text-#000 text-16px">拍品列表</div>
|
||||
@ -31,7 +34,7 @@ const openShow=()=>{
|
||||
v-for="(item,index) of itemList"
|
||||
:key="item.uuid"
|
||||
class="flex mb-21px"
|
||||
@click="openShow"
|
||||
@click="openShow(item)"
|
||||
>
|
||||
<div
|
||||
class="mr-10px flex-shrink-0 rounded-4px overflow-hidden cursor-pointer"
|
||||
@ -54,7 +57,8 @@ const openShow=()=>{
|
||||
</div>
|
||||
</div>
|
||||
</x-popup>
|
||||
<DetailPopup v-model:show="showDetail"></DetailPopup>
|
||||
<DetailPopup v-model:show="showDetail" :detail-info="showDetailInfo"></DetailPopup>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
|
@ -135,11 +135,7 @@ watch(()=>{
|
||||
|
||||
</div>
|
||||
</template>
|
||||
<style>
|
||||
:root:root {
|
||||
--van-dialog-radius: 8px
|
||||
}
|
||||
</style>
|
||||
|
||||
<style scoped>
|
||||
.v-enter-active,
|
||||
.v-leave-active {
|
||||
|
@ -132,7 +132,7 @@ const goLogin =async () => {
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="h-[100vh] w-[100vw] bg-[url('@/static/images/asdfsdd.png')] bg-cover px-[31px] pt-[86px]">
|
||||
<div class="h-screen-nav w-[100vw] bg-[url('@/static/images/asdfsdd.png')] bg-cover px-[31px] pt-[86px]">
|
||||
<div class="w-full flex justify-center mb-[100px]">
|
||||
<img class="h-[105px] w-[189px]" src="@/static/images/ghfggff.png" alt="">
|
||||
</div>
|
||||
|
BIN
app/static/images/delete3@.png
Normal file
BIN
app/static/images/delete3@.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.5 KiB |
BIN
app/static/images/icon-design-42@3x.png
Normal file
BIN
app/static/images/icon-design-42@3x.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 686 B |
13
app/stores-collect-code/auth/index.js
Normal file
13
app/stores-collect-code/auth/index.js
Normal file
@ -0,0 +1,13 @@
|
||||
import { createGlobalState,useLocalStorage } from '@vueuse/core'
|
||||
export const codeAuthStore = createGlobalState(() => {
|
||||
const token=useLocalStorage('token','')
|
||||
const RefreshToken=useLocalStorage('RefreshToken','')
|
||||
const userInfo=useLocalStorage('userInfo',{})
|
||||
const fingerprint=useLocalStorage('fingerprint','')
|
||||
return{
|
||||
userInfo,
|
||||
RefreshToken,
|
||||
token,
|
||||
fingerprint
|
||||
}
|
||||
})
|
114
app/stores-collect-code/goods/index.js
Normal file
114
app/stores-collect-code/goods/index.js
Normal file
@ -0,0 +1,114 @@
|
||||
import { createGlobalState } from '@vueuse/core'
|
||||
import { ref } from 'vue'
|
||||
import { artworkList, defaultDetail, artworkDetail } from "@/api/goods/index.js"
|
||||
|
||||
export const goodStore = createGlobalState(() => {
|
||||
// 状态定义
|
||||
const actionDetails = ref({})
|
||||
const fullLive = ref(false)
|
||||
const currentItem = ref({})
|
||||
const myArtWorks = ref([])
|
||||
const pageRef = ref({
|
||||
page: 0,
|
||||
pageSize: 5,
|
||||
itemCount: 0
|
||||
})
|
||||
const artWorkDetail = ref(null)
|
||||
const itemList = ref([])
|
||||
const auctionDetail = ref({})
|
||||
const loading = ref(false)
|
||||
const error = ref(null)
|
||||
|
||||
// 重置分页
|
||||
const resetPage = () => {
|
||||
pageRef.value.page = 1
|
||||
pageRef.value.pageSize=5
|
||||
pageRef.value.itemCount = 0
|
||||
}
|
||||
|
||||
// 获取拍卖详情
|
||||
const getAuctionDetail = async () => {
|
||||
try {
|
||||
loading.value = true
|
||||
const res = await defaultDetail({})
|
||||
if (res.status === 0) {
|
||||
auctionDetail.value = res.data
|
||||
}
|
||||
} catch (err) {
|
||||
console.error('获取拍卖详情错误:', err)
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
// 获取艺术品列表
|
||||
const getArtworkList = async (isRefresh = false) => {
|
||||
if (isRefresh) {
|
||||
resetPage()
|
||||
}
|
||||
try {
|
||||
loading.value = true
|
||||
const res = await artworkList({
|
||||
auctionUuid: auctionDetail.value.uuid,
|
||||
page: pageRef.value.page,
|
||||
pageSize: pageRef.value.pageSize
|
||||
})
|
||||
if (res.status === 0) {
|
||||
const newItems = res.data.data || []
|
||||
|
||||
if (isRefresh) {
|
||||
itemList.value = newItems
|
||||
} else {
|
||||
itemList.value = [...itemList.value, ...newItems]
|
||||
}
|
||||
|
||||
pageRef.value.itemCount = res.data.count || 0
|
||||
return {
|
||||
finished: !newItems.length || newItems.length < pageRef.value.pageSize,
|
||||
items: newItems
|
||||
}
|
||||
}
|
||||
return { finished: true, items: [] }
|
||||
} catch (err) {
|
||||
console.error('获取艺术品列表错误:', err)
|
||||
return { finished: true, items: [] }
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
// 获取艺术品详情
|
||||
const getArtworkDetail = async (uuid) => {
|
||||
try {
|
||||
loading.value = true
|
||||
const res = await artworkDetail({ uuid })
|
||||
if (res.status === 0) {
|
||||
artWorkDetail.value = res.data
|
||||
}
|
||||
} catch (err) {
|
||||
console.error('获取艺术品详情错误:', err)
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
// 状态
|
||||
actionDetails,
|
||||
fullLive,
|
||||
|
||||
currentItem,
|
||||
myArtWorks,
|
||||
pageRef,
|
||||
artWorkDetail,
|
||||
itemList,
|
||||
auctionDetail,
|
||||
loading,
|
||||
error,
|
||||
// 方法
|
||||
getAuctionDetail,
|
||||
getArtworkList,
|
||||
getArtworkDetail,
|
||||
resetPage
|
||||
}
|
||||
})
|
43
app/stores-collect-code/live/index.js
Normal file
43
app/stores-collect-code/live/index.js
Normal file
@ -0,0 +1,43 @@
|
||||
import { createGlobalState } from '@vueuse/core'
|
||||
import {ref} from "vue";
|
||||
import {goodStore} from "@/stores/goods/index.js";
|
||||
import {authStore} from "@/stores/auth/index.js";
|
||||
|
||||
export const liveStore = createGlobalState(() => {
|
||||
const {auctionDetail,getAuctionDetail} = goodStore();
|
||||
const { token } = authStore()
|
||||
const quoteStatus = ref(false)
|
||||
const show = ref(false)
|
||||
const show1=ref(true)
|
||||
const playerId=ref('J_prismPlayer')
|
||||
const auctionData=ref({})
|
||||
const getSocketData=async ()=>{
|
||||
if (!auctionDetail.value.uuid){
|
||||
await getAuctionDetail()
|
||||
}
|
||||
const { ws, messages, onMessage } = useWebSocket()
|
||||
|
||||
// 连接
|
||||
ws.connect('/api/v1/m/auction/live',{auctionUuid: auctionDetail.value.uuid,token:token.value})
|
||||
|
||||
/*// 发送消息
|
||||
ws.send({ type: 'chat', content: 'Hello!' })*/
|
||||
// 监听消息
|
||||
onMessage((data) => {
|
||||
console.log('收到消息:', data)
|
||||
auctionData.value = data
|
||||
})
|
||||
}
|
||||
const changeStatus = () => {
|
||||
quoteStatus.value = !quoteStatus.value
|
||||
}
|
||||
return{
|
||||
auctionData,
|
||||
getSocketData,
|
||||
show1,
|
||||
playerId,
|
||||
show,
|
||||
quoteStatus,
|
||||
changeStatus
|
||||
}
|
||||
})
|
1
env/.env.test
vendored
1
env/.env.test
vendored
@ -1,5 +1,6 @@
|
||||
# 测试环境配置
|
||||
NUXT_PUBLIC_API_BASE=http://172.16.100.99:8005
|
||||
NUXT_PUBLIC_API_COLLECT_CODE=https://auction-test.szjixun.cn
|
||||
NUXT_PUBLIC_WS_URL=ws://test-ws.example.com
|
||||
NUXT_API_SECRET=test-secret
|
||||
NUXT_PUBLIC_SOCKET_URL=ws://172.16.100.99:8005
|
||||
|
@ -23,6 +23,7 @@
|
||||
"@yeger/vue-masonry-wall": "^5.0.17",
|
||||
"aliyun-aliplayer": "^2.28.5",
|
||||
"axios": "^1.7.9",
|
||||
"dayjs": "^1.11.13",
|
||||
"dotenv": "^16.4.7",
|
||||
"nuxt": "^3.15.0",
|
||||
"pinyin": "4.0.0-alpha.2",
|
||||
|
@ -29,6 +29,9 @@ importers:
|
||||
axios:
|
||||
specifier: ^1.7.9
|
||||
version: 1.7.9
|
||||
dayjs:
|
||||
specifier: ^1.11.13
|
||||
version: 1.11.13
|
||||
dotenv:
|
||||
specifier: ^16.4.7
|
||||
version: 16.4.7
|
||||
@ -781,8 +784,8 @@ packages:
|
||||
resolution: {integrity: sha512-8tR1xe7ZEbkabTuE/tNhzpolygUn9OaYp9yuYAF4MgDNZg06C3Qny80bes2/e9/Wm3aVkPUlCw6WgU7mQd0yEg==}
|
||||
engines: {node: '>= 16'}
|
||||
|
||||
'@intlify/shared@11.0.1':
|
||||
resolution: {integrity: sha512-lH164+aDDptHZ3dBDbIhRa1dOPQUp+83iugpc+1upTOWCnwyC1PVis6rSWNMMJ8VQxvtHQB9JMib48K55y0PvQ==}
|
||||
'@intlify/shared@11.1.0':
|
||||
resolution: {integrity: sha512-DvpNSxiMrFqYMaGSRDDnQgO/L0MqNH4KWw9CUx8LRHHIdWp08En9DpmSRNpauUOxKpHAhyJJxx92BHZk9J84EQ==}
|
||||
engines: {node: '>= 16'}
|
||||
|
||||
'@intlify/unplugin-vue-i18n@6.0.3':
|
||||
@ -2047,6 +2050,9 @@ packages:
|
||||
csstype@3.1.3:
|
||||
resolution: {integrity: sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==}
|
||||
|
||||
dayjs@1.11.13:
|
||||
resolution: {integrity: sha512-oaMBel6gjolK862uaPQOVTA7q3TZhuSvuMQAAglQDOWYO9A91IrAOUJEyKVlqJlHE0vq5p5UXxzdPfMH/x6xNg==}
|
||||
|
||||
db0@0.2.1:
|
||||
resolution: {integrity: sha512-BWSFmLaCkfyqbSEZBQINMVNjCVfrogi7GQ2RSy1tmtfK9OXlsup6lUMwLsqSD7FbAjD04eWFdXowSHHUp6SE/Q==}
|
||||
peerDependencies:
|
||||
@ -4994,14 +5000,14 @@ snapshots:
|
||||
|
||||
'@intlify/shared@11.0.0-rc.1': {}
|
||||
|
||||
'@intlify/shared@11.0.1': {}
|
||||
'@intlify/shared@11.1.0': {}
|
||||
|
||||
'@intlify/unplugin-vue-i18n@6.0.3(@vue/compiler-dom@3.5.13)(eslint@9.18.0(jiti@2.4.2))(rollup@4.31.0)(typescript@5.7.3)(vue-i18n@10.0.5(vue@3.5.13(typescript@5.7.3)))(vue@3.5.13(typescript@5.7.3))':
|
||||
dependencies:
|
||||
'@eslint-community/eslint-utils': 4.4.1(eslint@9.18.0(jiti@2.4.2))
|
||||
'@intlify/bundle-utils': 10.0.0(vue-i18n@10.0.5(vue@3.5.13(typescript@5.7.3)))
|
||||
'@intlify/shared': 11.0.1
|
||||
'@intlify/vue-i18n-extensions': 8.0.0(@intlify/shared@11.0.1)(@vue/compiler-dom@3.5.13)(vue-i18n@10.0.5(vue@3.5.13(typescript@5.7.3)))(vue@3.5.13(typescript@5.7.3))
|
||||
'@intlify/shared': 11.1.0
|
||||
'@intlify/vue-i18n-extensions': 8.0.0(@intlify/shared@11.1.0)(@vue/compiler-dom@3.5.13)(vue-i18n@10.0.5(vue@3.5.13(typescript@5.7.3)))(vue@3.5.13(typescript@5.7.3))
|
||||
'@rollup/pluginutils': 5.1.4(rollup@4.31.0)
|
||||
'@typescript-eslint/scope-manager': 8.21.0
|
||||
'@typescript-eslint/typescript-estree': 8.21.0(typescript@5.7.3)
|
||||
@ -5025,11 +5031,11 @@ snapshots:
|
||||
|
||||
'@intlify/utils@0.13.0': {}
|
||||
|
||||
'@intlify/vue-i18n-extensions@8.0.0(@intlify/shared@11.0.1)(@vue/compiler-dom@3.5.13)(vue-i18n@10.0.5(vue@3.5.13(typescript@5.7.3)))(vue@3.5.13(typescript@5.7.3))':
|
||||
'@intlify/vue-i18n-extensions@8.0.0(@intlify/shared@11.1.0)(@vue/compiler-dom@3.5.13)(vue-i18n@10.0.5(vue@3.5.13(typescript@5.7.3)))(vue@3.5.13(typescript@5.7.3))':
|
||||
dependencies:
|
||||
'@babel/parser': 7.26.5
|
||||
optionalDependencies:
|
||||
'@intlify/shared': 11.0.1
|
||||
'@intlify/shared': 11.1.0
|
||||
'@vue/compiler-dom': 3.5.13
|
||||
vue: 3.5.13(typescript@5.7.3)
|
||||
vue-i18n: 10.0.5(vue@3.5.13(typescript@5.7.3))
|
||||
@ -6717,6 +6723,8 @@ snapshots:
|
||||
|
||||
csstype@3.1.3: {}
|
||||
|
||||
dayjs@1.11.13: {}
|
||||
|
||||
db0@0.2.1: {}
|
||||
|
||||
debug@2.6.9:
|
||||
|
@ -13,6 +13,9 @@ import {
|
||||
|
||||
// https://unocss.dev/guide/config-file
|
||||
export default defineConfig({
|
||||
rules: [
|
||||
['h-screen-nav', { height: 'calc(100vh - var(--van-nav-bar-height))' }]
|
||||
],
|
||||
shortcuts: [
|
||||
// shortcuts to multiple utilities
|
||||
['btn', 'px-6 py-3 rounded-3 inline-block bg-primary text-white cursor-pointer hover:bg-primary-hover disabled:cursor-default disabled:bg-gray-600 disabled:opacity-50'],
|
||||
|
Loading…
Reference in New Issue
Block a user