From fbbb30040e24ee2648403bc58043b590f429e673 Mon Sep 17 00:00:00 2001 From: xingyy <64720302+Concur-max@users.noreply.github.com> Date: Fri, 17 Jan 2025 14:07:19 +0800 Subject: [PATCH 1/2] =?UTF-8?q?feat(auth):=20=E5=AE=9E=E7=8E=B0=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E7=99=BB=E5=BD=95=E5=92=8C=E5=AE=9E=E5=90=8D=E8=AE=A4?= =?UTF-8?q?=E8=AF=81=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 新增用户登录接口和相关逻辑 - 实现实名认证页面,包括表单填写和提交功能 - 添加用户信息存储和展示 - 优化页面样式和交互 --- app/api/auth/index.js | 14 +++ app/api/http.js | 4 +- app/pages/login/index.vue | 56 +++++---- app/pages/realAuth/components/detail.vue | 65 ++++++++++ app/pages/realAuth/index.vue | 144 +++++++++++++++-------- 5 files changed, 212 insertions(+), 71 deletions(-) create mode 100644 app/pages/realAuth/components/detail.vue diff --git a/app/api/auth/index.js b/app/api/auth/index.js index b974d76..5187568 100644 --- a/app/api/auth/index.js +++ b/app/api/auth/index.js @@ -7,3 +7,17 @@ export async function senCode(data) { body: data, }) } +export async function userLogin(data) { + const http = getHttp() + return await http('/api/v1/m/user/login', { + method: 'POST', + body: data, + }) +} +export async function userUpdate(data) { + const http = getHttp() + return await http('/api/v1/m/user/update', { + method: 'POST', + body: data, + }) +} \ No newline at end of file diff --git a/app/api/http.js b/app/api/http.js index d9ec74b..db74379 100644 --- a/app/api/http.js +++ b/app/api/http.js @@ -18,7 +18,6 @@ export function setupHttp() { headers: { 'Content-Type': 'application/json' }, async onRequest({ options }) { const token = localStorage.getItem('token') - options.headers = { ...options.headers, ...(token && { Authorization: token }), @@ -26,11 +25,10 @@ export function setupHttp() { }, async onResponse({ response }) { if (response._data.status===1){ - message.warning(response._data.msg) + message.error(response._data.msg) } }, async onResponseError({ response }) { - console.log('error错误') const { message } = response._data if (Array.isArray(message)) { message.forEach((item) => { diff --git a/app/pages/login/index.vue b/app/pages/login/index.vue index 6ee9289..9f16851 100644 --- a/app/pages/login/index.vue +++ b/app/pages/login/index.vue @@ -2,8 +2,9 @@ import { useRouter, useRoute } from 'vue-router'; import { useI18n } from 'vue-i18n' import countryCode from '../countryRegion/data/index.js' -import {senCode} from "@/api/auth/index.js"; - +import {senCode, userLogin} from "@/api/auth/index.js"; +import {authStore} from "~/stores/auth/index.js"; +const {userInfo,token}= authStore() const router = useRouter(); const route = useRoute(); const { locale } = useI18n() @@ -30,8 +31,8 @@ const startCountdown=()=> { }, 1000); } const countdown = ref(0); -const phoneNum = ref('') -const code = ref('') +const phoneNum = ref('17630920520') +const code = ref('655119') const pane = ref(0) const showKeyboard = ref(false); // 根据语言获取默认国家 @@ -78,19 +79,23 @@ watch(locale, () => { }) const vanSwipeRef=ref(null) const getCode =async () => { - loadingRef.value.loading1=true - const res=await senCode({ - telNum:phoneNum.value, - zone:selectedZone.value - }) - loadingRef.value.loading1=false - if (res.status===0){ - pane.value = 1 - vanSwipeRef.value?.swipeTo(pane.value) - showKeyboard.value=true - startCountdown(); - - } + // loadingRef.value.loading1=true + // const res=await senCode({ + // telNum:phoneNum.value, + // zone:selectedZone.value + // }) + // loadingRef.value.loading1=false + // if (res.status===0){ + // pane.value = 1 + // vanSwipeRef.value?.swipeTo(pane.value) + // showKeyboard.value=true + // startCountdown(); + // + // } + pane.value = 1 + vanSwipeRef.value?.swipeTo(pane.value) + showKeyboard.value=true + startCountdown(); } const goBack = () => { @@ -98,9 +103,20 @@ const goBack = () => { pane.value = 0 vanSwipeRef.value?.swipeTo(pane.value) } -const goLogin = () => { - router.push('/realAuth'); -} +const goLogin =async () => { + const res=await userLogin({ + telNum:phoneNum.value, + zone:selectedZone.value, + code:code.value + }) + if (res.status===0){ + userInfo.value=res.data.accountInfo + token.value=res.data.token + if (!res.data.isReal){ + router.push('/realAuth'); + } + } +} </script> <template> diff --git a/app/pages/realAuth/components/detail.vue b/app/pages/realAuth/components/detail.vue new file mode 100644 index 0000000..7032c1b --- /dev/null +++ b/app/pages/realAuth/components/detail.vue @@ -0,0 +1,65 @@ +<script setup> +import {authStore} from "@/stores/auth/index.js"; + +const props = defineProps({ + type: { + type: Number, + default: 0 + } +}) +const {userInfo}= authStore() + +</script> + +<template> + <div class="text-#1A1A1A text-16px"> + <template v-if="type===0"> + <div class="flex mb-20px" > + <div class="mr-10px">姓名:</div> + <div>{{userInfo.realName}}</div> + </div> + <div class="flex mb-20px"> + <div class="mr-10px">性别:</div> + <div>{{userInfo.sex}}</div> + </div> + <div class="flex mb-20px"> + <div class="mr-10px">出生日期:</div> + <div>{{userInfo.birthDate}}</div> + </div> + <div class="flex"> + <div class="mr-10px">身份证号:</div> + <div>{{userInfo.idNum}}</div> + </div> + </template> + <template v-if="type===1"> + <div class="flex mb-20px" > + <div class="mr-10px">姓名:</div> + <div>{{userInfo.realName}}</div> + </div> + <div class="flex mb-20px"> + <div class="mr-10px">性别:</div> + <div>{{userInfo.sex}}</div> + </div> + <div class="flex mb-20px"> + <div class="mr-10px">出生日期:</div> + <div>{{userInfo.birthDate}}</div> + </div> + <div class="flex"> + <div class="mr-10px">家庭住址:</div> + <div>{{userInfo.idNum}}</div> + </div> + <div class="flex"> + <div class="mr-10px">所属银行:</div> + <div>{{userInfo.idNum}}</div> + </div> + <div class="flex"> + <div class="mr-10px">银行卡号码:</div> + <div>{{userInfo.idNum}}</div> + </div> + </template> + </div> +</template> + +<style scoped> + +</style> \ No newline at end of file diff --git a/app/pages/realAuth/index.vue b/app/pages/realAuth/index.vue index bdd9401..1c16313 100644 --- a/app/pages/realAuth/index.vue +++ b/app/pages/realAuth/index.vue @@ -1,34 +1,78 @@ <script setup> import { useRouter, useRoute } from 'vue-router'; import { useI18n } from 'vue-i18n' - +import {userUpdate} from "~/api/auth/index.js"; +import {message} from '@/components/x-message/useMessage.js' +import detail from './components/detail.vue' +import {authStore} from "~/stores/auth/index.js"; const router = useRouter(); const route = useRoute(); const showPicker = ref(false); -const pickerValue = ref([]); -const gender = ref('男') -const birthday = ref('') +const {userInfo}= authStore() const birthdayDate = ref([]) const showBirthdayPicker = ref(false) const minDate = new Date(1950, 0, 1) const maxDate = new Date(2025, 12, 31) - +const active=ref(0) const { t } = useI18n() - -const columns = computed(() => [ - { text: t('realAuth.male'), value: t('realAuth.male') }, - { text: t('realAuth.female'), value: t('realAuth.female') }, -]); +const form=ref({ + idNum: "", + realName: "", + sex:'', + birthDate:'', + userExtend: { + address: "", + bankName: "", + bankNo: "" + } +}) +const form1=ref({ + idNum:'', + realName:'' +}) +const columns=ref([ + { text: t('realAuth.male'), value: 1 }, + { text: t('realAuth.female'), value: 2 }, +]) const onConfirm = ({ selectedValues, selectedOptions }) => { - pickerValue.value = selectedValues - gender.value = selectedOptions[0].text +form.value.sex=selectedValues?.[0] showPicker.value = false } const onBirthdayConfirm = (value) => { - birthdayDate.value = value.selectedValues - birthday.value = value.selectedValues.join('-') + form.value.birthDate=value.selectedValues.join('-') showBirthdayPicker.value = false } + +function isFormComplete(obj) { + for (const key in obj) { + if (typeof obj[key] === 'object' && obj[key] !== null) { + if (!isFormComplete(obj[key])) { + return false; + } + } else if (obj[key] === "") { + return false; + } + } + return true; +} +const statusCode=ref(0) +const confirm=async ()=>{ + const thatForm=active.value===0?form1.value:form.value + if (isFormComplete(thatForm)){ + const res=await userUpdate(thatForm) + if (res.status===0){ + userInfo.value=res.data + message.success('提交成功') + statusCode.value=1 + } + }else { + message.error('请填写身份证相关信息') + } +} + +const goHome=()=>{ + router.push('/') +} definePageMeta({ title: '实名认证', i18n: 'realAuth.title', @@ -36,27 +80,21 @@ definePageMeta({ </script> <template> - <div class="px-[31px] bg-#fff w-100vw h-100vh pt-[46px]"> - <van-tabs animated swipeable> + <div class="px-[31px] bg-[url('@/static/images/asdfsdd.png')] bg-cover w-100vw flex-grow-1 pt-[46px] relative flex flex-col"> + <van-tabs v-if="statusCode===0" v-model:active="active" animated swipeable> <van-tab :title="$t('realAuth.cnTab')" class="pt-[80px]"> - <div class="text-[#BDBDBD] text-[16px] mb-[34px]">{{ $t('realAuth.cnTabDesc') }}</div> - <div class="mb-[100px]"> - <div class="border-b-[1.7px] mt-[8px]"> - <van-field :label="$t('realAuth.idCard')" clearable - :placeholder="$t('realAuth.idCardPlaceholder')"></van-field> + <template v-if="statusCode===0"> + <div class="text-[#BDBDBD] text-[16px] mb-[34px]">{{ $t('realAuth.cnTabDesc') }}</div> + <div class="mb-[100px]"> + <div class="border-b-[1.7px] mt-[8px]"> + <van-field v-model="form1.idNum" :label="$t('realAuth.idCard')" clearable + :placeholder="$t('realAuth.idCardPlaceholder')"></van-field> + </div> + <div class="border-b-[1.7px] mt-[8px]"> + <van-field v-model="form1.realName" :label="$t('realAuth.name')" clearable :placeholder="$t('realAuth.namePlaceholder')"></van-field> + </div> </div> - <div class="border-b-[1.7px] mt-[8px]"> - <van-field :label="$t('realAuth.name')" clearable :placeholder="$t('realAuth.namePlaceholder')"></van-field> - </div> - </div> - <div class="flex justify-between"> - <van-button style="width: 151px;height: 48px" color="#E9F1F8"> - <div class="text-#2B53AC text-16px">{{ $t('realAuth.cancel') }}</div> - </van-button> - <van-button style="width: 151px;height: 48px" color="#2B53AC"> - <div class="text-#FFFFFF text-16px">{{ $t('realAuth.confirm') }}</div> - </van-button> - </div> + </template> </van-tab> <van-tab :title="$t('realAuth.otherTab')" class="pt-[80px]"> <div class="text-[#BDBDBD] text-[16px] mb-[34px]">{{ $t('realAuth.otherTabDesc') }}</div> @@ -65,39 +103,49 @@ definePageMeta({ <van-field :label="$t('realAuth.name')" clearable :placeholder="$t('realAuth.namePlaceholder')"></van-field> </div> <div class="border-b-[1.7px] mt-[8px]"> - <van-field v-model="gender" is-link readonly name="picker" :label="$t('realAuth.gender')" + <van-field :modelValue="columns.find(x=>x.value===form.sex)?.text" is-link readonly name="picker" :label="$t('realAuth.gender')" @click="showPicker = true" /> - </div> <div class="border-b-[1.7px] mt-[8px]"> - <van-field v-model="birthday" is-link readonly name="birthdayPicker" :label="$t('realAuth.birthday')" + <van-field v-model="form.birthDate" is-link readonly name="birthdayPicker" :label="$t('realAuth.birthday')" :placeholder="$t('realAuth.birthdayPlaceholder')" @click="showBirthdayPicker = true" /> </div> <div class="border-b-[1.7px] mt-[8px]"> - <van-field :label="$t('realAuth.adress')" clearable + <van-field v-model="form.userExtend.address" :label="$t('realAuth.adress')" clearable :placeholder="$t('realAuth.adressPlaceholder')"></van-field> </div> <div class="border-b-[1.7px] mt-[8px]"> - <van-field :label="$t('realAuth.bank')" clearable :placeholder="$t('realAuth.bankPlaceholder')"></van-field> + <van-field v-model="form.userExtend.bankName" :label="$t('realAuth.bank')" clearable :placeholder="$t('realAuth.bankPlaceholder')"></van-field> </div> <div class="border-b-[1.7px] mt-[8px]"> - <van-field :label="$t('realAuth.bankCard')" clearable + <van-field v-model="form.userExtend.bankNo" :label="$t('realAuth.bankCard')" clearable :placeholder="$t('realAuth.bankCardPlaceholder')"></van-field> </div> - <div class="flex justify-between mt-[100px]"> - <van-button style="width: 151px;height: 48px" color="#E9F1F8"> - <div class="text-#2B53AC text-16px">{{ $t('realAuth.cancel') }}</div> - </van-button> - <van-button style="width: 151px;height: 48px" color="#2B53AC"> - <div class="text-#FFFFFF text-16px">{{ $t('realAuth.confirm') }}</div> - </van-button> - </div> </div> </van-tab> </van-tabs> + <van-tabs v-else-if="statusCode===1" v-model:active="active" animated swipeable> + <van-tab :title="$t('realAuth.cnTab')" class="pt-[80px]"> + <detail :type="active"></detail> + </van-tab> + <van-tab :title="$t('realAuth.otherTab')" class="pt-[80px]"> + <detail :type="active"></detail> + </van-tab> + </van-tabs> + <div class="flex justify-between" v-if="statusCode===0"> + <van-button style="width: 151px;height: 48px" color="#E9F1F8"> + <div class="text-#2B53AC text-16px">{{ $t('realAuth.cancel') }}</div> + </van-button> + <van-button @click="confirm" style="width: 151px;height: 48px" color="#2B53AC"> + <div class="text-#FFFFFF text-16px">{{ $t('realAuth.confirm') }}</div> + </van-button> + </div> + <div v-else class="mt-auto pb-94px"> + <van-button color="#E9F1F8" @click="goHome" style="color: #2B53AC;font-weight: 600" block>去首页</van-button> + </div> <van-popup v-model:show="showPicker" destroy-on-close position="bottom"> - <van-picker :columns="columns" :model-value="pickerValue" @confirm="onConfirm" @cancel="showPicker = false" /> + <van-picker :columns="columns" @confirm="onConfirm" @cancel="showPicker = false" /> </van-popup> <van-popup v-model:show="showBirthdayPicker" destroy-on-close position="bottom"> <van-date-picker v-model="birthdayDate" :min-date="minDate" :max-date="maxDate" From 6f67273a9a12bb2568a3b9e551b5de666d06a83c Mon Sep 17 00:00:00 2001 From: xingyy <64720302+Concur-max@users.noreply.github.com> Date: Fri, 17 Jan 2025 16:56:13 +0800 Subject: [PATCH 2/2] =?UTF-8?q?refactor(store):=20=E9=87=8D=E6=9E=84=20hom?= =?UTF-8?q?e=20store=20=E5=B9=B6=E6=94=B9=E5=90=8D=E4=B8=BA=20goods=20stor?= =?UTF-8?q?e?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 将 home store 重命名为 goods store,以更准确地反映其用途 - 更新了相关文件中的导入路径和引用 -调整了首页布局和组件以适应新的 goods store 结构 - 新增了 goods store 中的 actionDetails 和 itemList 属性 --- app/api/goods/index.js | 16 ++++++++++++++++ app/api/http.js | 6 +++--- app/components/AppHeader.vue | 4 ++-- app/layouts/README.md | 2 +- app/layouts/default.vue | 2 +- app/pages/home/components/Cescribe/index.vue | 15 +++++++++++++++ app/pages/home/components/Column/index.vue | 8 ++++++-- app/pages/home/components/index.vue | 2 +- app/pages/home/index.vue | 15 +++++++-------- app/stores/{home => goods}/index.js | 7 +++++-- 10 files changed, 57 insertions(+), 20 deletions(-) create mode 100644 app/api/goods/index.js create mode 100644 app/pages/home/components/Cescribe/index.vue rename app/stores/{home => goods}/index.js (95%) diff --git a/app/api/goods/index.js b/app/api/goods/index.js new file mode 100644 index 0000000..7f9adea --- /dev/null +++ b/app/api/goods/index.js @@ -0,0 +1,16 @@ +import { getHttp } from '~/api/http.js' + +export async function artworkList(data) { + const http = getHttp() + return await http('/api/v1/m/auction/default/artwork/list', { + method: 'POST', + body: data, + }) +} +export async function defaultDetail(data) { + const http = getHttp() + return await http('/api/v1/m/auction/default/detail', { + method: 'POST', + body: data, + }) +} \ No newline at end of file diff --git a/app/api/http.js b/app/api/http.js index db74379..85ca5bd 100644 --- a/app/api/http.js +++ b/app/api/http.js @@ -2,6 +2,7 @@ import { useRuntimeConfig } from '#app' import { ofetch } from 'ofetch' import {message} from '@/components/x-message/useMessage.js' +import {authStore} from "@/stores/auth/index.js"; let httpStatusErrorHandler let http @@ -12,15 +13,14 @@ export function setupHttp() { const config = useRuntimeConfig() const baseURL = config.public.NUXT_PUBLIC_API_BASE - + const {token}= authStore() http = ofetch.create({ baseURL, headers: { 'Content-Type': 'application/json' }, async onRequest({ options }) { - const token = localStorage.getItem('token') options.headers = { ...options.headers, - ...(token && { Authorization: token }), + Authorization:token.value } }, async onResponse({ response }) { diff --git a/app/components/AppHeader.vue b/app/components/AppHeader.vue index 9a047ac..4c058c7 100644 --- a/app/components/AppHeader.vue +++ b/app/components/AppHeader.vue @@ -1,6 +1,6 @@ <script setup> import { useAppHeaderRouteNames as routeWhiteList } from '~/config' -import { homeStore } from "@/stores/home/index.js"; +import { homeStore } from "@/stores/goods/index.js"; const { fullLive } = homeStore() const route = useRoute() const router = useRouter() @@ -40,7 +40,7 @@ const showLeftArrow = computed(() => route.name && routeWhiteList.includes(route placeholder clickable fixed @click-left="onBack" > - <template #title v-if="route.meta.i18n==='menu.home'"> + <template #title v-if="route.meta.i18n==='menu.goods'"> <div class="flex flex-col items-center justify-center"> <div class="text-#000000 text-17px mb-5px font-600">{{ title }}</div> diff --git a/app/layouts/README.md b/app/layouts/README.md index 2be4436..ff0c124 100644 --- a/app/layouts/README.md +++ b/app/layouts/README.md @@ -7,7 +7,7 @@ By default, `default.vue` will be used unless an alternative is specified in the ```vue <script setup lang="ts"> definePageMeta({ - layout: 'home', + layout: 'goods', }) </script> ``` diff --git a/app/layouts/default.vue b/app/layouts/default.vue index c20d956..c29e7ce 100644 --- a/app/layouts/default.vue +++ b/app/layouts/default.vue @@ -8,6 +8,6 @@ </main> </template> <script setup > -import { homeStore } from "@/stores/home/index.js"; +import { homeStore } from "@/stores/goods/index.js"; const { fullLive } = homeStore() </script> \ No newline at end of file diff --git a/app/pages/home/components/Cescribe/index.vue b/app/pages/home/components/Cescribe/index.vue new file mode 100644 index 0000000..20594f0 --- /dev/null +++ b/app/pages/home/components/Cescribe/index.vue @@ -0,0 +1,15 @@ +<script setup> + +</script> + +<template> + <div class="px-16px pt-14px"> + <div class="text-#575757 text-14px"> + 这里是后台富文本配置的说明,啊即可打开三等奖撒度老师的湿答答是快乐的阿四大皆空 + </div> + </div> +</template> + +<style scoped> + +</style> \ No newline at end of file diff --git a/app/pages/home/components/Column/index.vue b/app/pages/home/components/Column/index.vue index 0a98be6..84f87a6 100644 --- a/app/pages/home/components/Column/index.vue +++ b/app/pages/home/components/Column/index.vue @@ -16,7 +16,7 @@ <div class="absolute left-[8px] top-[8px] h-[17px] w-[45px] flex items-center justify-center bg-[#2b53ac] text-[12px] text-[#fff]" > - LOT{{ index + 1 }} + LOT{{ item.index+1 }} </div> </div> <div class="pt-[8px]"> @@ -39,7 +39,11 @@ <script setup> const props = defineProps({ - items: Array + items: Array, + colIndex: { + type: Number, + default: 0 + } }); const emit = defineEmits(['openShow']); diff --git a/app/pages/home/components/index.vue b/app/pages/home/components/index.vue index 819d6af..e05f768 100644 --- a/app/pages/home/components/index.vue +++ b/app/pages/home/components/index.vue @@ -27,7 +27,7 @@ const openShow = () => { <div class="absolute left-[8px] top-[8px] h-[17px] w-[45px] flex items-center justify-center bg-[#2b53ac] text-[12px] text-[#fff]" > - LOT{{ index + 1 }} + LOT{{ item.index + 1 }} </div> </div> <div class="pt-[8px]"> diff --git a/app/pages/home/index.vue b/app/pages/home/index.vue index bfe89fb..64f2ca3 100644 --- a/app/pages/home/index.vue +++ b/app/pages/home/index.vue @@ -2,12 +2,10 @@ import {useRect} from '@vant/use'; import LiveRoom from '@/pages/LiveRoom/index.client.vue'; import itemDetail from '@/components/itemDetail/index.vue'; -import {homeStore} from "@/stores/home/index.js"; +import {homeStore} from "@/stores/goods/index.js"; import Column from './components/Column/index.vue' const {fullLive} = homeStore(); - - definePageMeta({ layout: 'default', i18n: 'menu.home', @@ -21,17 +19,17 @@ const show = ref(false); const showHeight = ref(''); const list = ref([{ image: 'https://e-cdn.fontree.cn/fonchain-main/prod/file/default/setting/637d95b4-2ae9-4a74-bd60-a3a9d2ca2ca0.png', - title: '张天赐 | 日出而作,日落而息', + title: '张天赐 | 日出而作,日落而息1', startingPrice: 'RMB 1,000', transactionPrice: 'RMB 10,000', }, { image: 'https://e-cdn.fontree.cn/fonchain-main/prod/file/default/setting/f7b65e23-ce21-41b4-8e58-9e6dc6950727.png', - title: '张天赐 | 日出而作,日落而息', + title: '张天赐 | 日出而作,日落而息2', startingPrice: 'RMB 1,000', transactionPrice: '', }, { image: 'https://e-cdn.fontree.cn/fonchain-main/prod/file/default/setting/41eceb23-d168-4049-ae8e-48c5328b192f.png', - title: '张天赐 | 日出而作,日落而息', + title: '张天赐 | 日出而作,日落而息3', startingPrice: 'RMB 1,000', transactionPrice: '', }, { @@ -75,7 +73,8 @@ const onRefresh = () => { const columns = computed(() => { const result = [[], []]; list.value.forEach((item, index) => { - result[index % 2].push(item); + // 为每个项目添加一个 index 属性 + result[index % 2].push({ ...item, index }); }); return result; }); @@ -108,7 +107,7 @@ const changeLive = () => { <van-pull-refresh> <van-list v-model:loading="loading" :finished="finished" finished-text="没有更多了" @load="loadData"> <div class="w-full flex gap-[16px]"> - <Column v-for="(column, colIndex) in columns" :key="colIndex" :items="column" @openShow="openShow"/> + <Column v-for="(column, colIndex) in columns" :key="colIndex" :colIndex="colIndex" :items="column" @openShow="openShow"/> </div> </van-list> </van-pull-refresh> diff --git a/app/stores/home/index.js b/app/stores/goods/index.js similarity index 95% rename from app/stores/home/index.js rename to app/stores/goods/index.js index dae33b7..d307b71 100644 --- a/app/stores/home/index.js +++ b/app/stores/goods/index.js @@ -1,7 +1,8 @@ import { createGlobalState } from '@vueuse/core' export const homeStore = createGlobalState(() => { + const actionDetails=ref({}) const fullLive=ref(false) - const list = ref([{ + const itemList = ref([{ image: 'https://e-cdn.fontree.cn/fonchain-main/prod/file/default/setting/637d95b4-2ae9-4a74-bd60-a3a9d2ca2ca0.png', title: '张天赐 | 日出而作,日落而息', startingPrice: 'RMB 1,000', @@ -42,8 +43,10 @@ export const homeStore = createGlobalState(() => { startingPrice: 'RMB 1,000', transactionPrice: 'RMB 10,000', }]) + return{ - list, + actionDetails, + itemList, fullLive } }) \ No newline at end of file