feat(env): 添加生产环境和测试环境配置

- 新增 .env.prod 和 .env.test 文件,分别用于生产环境和测试环境
- 配置文件中包含了 API基础 URL、WebSocket URL 和阿里云播放器配置等信息- 添加了首页组件 Column 和首页主组件,用于展示拍卖品列表
This commit is contained in:
xingyy 2025-01-16 16:28:21 +08:00
parent 4ab0a5ca81
commit 2e73eb7e34
7 changed files with 129 additions and 3 deletions

0
app/config/live/index.js Normal file
View File

View File

@ -0,0 +1,50 @@
<template>
<div class="flex flex-1 flex-col gap-[16px]">
<div
v-for="(item, index) in items"
:key="index"
class="w-full"
@click="openShow"
>
<div class="relative w-full">
<van-image
:src="item.image"
:style="{ aspectRatio: item.ratio }"
fit="cover"
class="w-full"
/>
<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 }}
</div>
</div>
<div class="pt-[8px]">
<div class="text-[14px] text-[#000000] leading-[20px]">
{{ item.title }}
</div>
<div class="mt-[4px] text-[12px] text-[#575757]">
起拍价{{ item.startingPrice }}
</div>
<div
v-if="item.transactionPrice"
class="mt-[4px] text-[12px] text-[#b58047]"
>
成交价{{ item.transactionPrice }}
</div>
</div>
</div>
</div>
</template>
<script setup>
const props = defineProps({
items: Array
});
const emit = defineEmits(['openShow']);
const openShow = () => {
emit('openShow');
};
</script>

View File

@ -0,0 +1,50 @@
<script setup>
const props = defineProps({
items: Array
});
const emit = defineEmits(['openShow']);
const openShow = () => {
emit('openShow');
};
</script>
<template>
<div class="flex flex-1 flex-col gap-[16px]">
<div
v-for="(item, index) in items"
:key="index"
class="w-full"
@click="openShow"
>
<div class="relative w-full">
<van-image
:src="item.image"
:style="{ aspectRatio: item.ratio }"
fit="cover"
class="w-full"
/>
<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 }}
</div>
</div>
<div class="pt-[8px]">
<div class="text-[14px] text-[#000000] leading-[20px]">
{{ item.title }}
</div>
<div class="mt-[4px] text-[12px] text-[#575757]">
起拍价{{ item.startingPrice }}
</div>
<div
v-if="item.transactionPrice"
class="mt-[4px] text-[12px] text-[#b58047]"
>
成交价{{ item.transactionPrice }}
</div>
</div>
</div>
</div>
</template>

View File

@ -19,6 +19,17 @@ const isReal=ref(false) //isReal 是否实名过
function goToPage() { function goToPage() {
router.push('/countryRegion'); router.push('/countryRegion');
} }
const startCountdown=()=> {
countdown.value = 60;
const interval = setInterval(() => {
if (countdown.value > 0) {
countdown.value--;
} else {
clearInterval(interval);
}
}, 1000);
}
const countdown = ref(0);
const phoneNum = ref('') const phoneNum = ref('')
const code = ref('') const code = ref('')
const pane = ref(0) const pane = ref(0)
@ -74,10 +85,11 @@ const getCode =async () => {
}) })
loadingRef.value.loading1=false loadingRef.value.loading1=false
if (res.status===0){ if (res.status===0){
pane.value = 1 pane.value = 1
vanSwipeRef.value?.swipeTo(pane.value) vanSwipeRef.value?.swipeTo(pane.value)
showKeyboard.value=true showKeyboard.value=true
startCountdown();
} }
} }
@ -132,8 +144,8 @@ const goLogin = () => {
<div class="text-[16px] text-[#000]">+{{ selectedZone }} {{ phoneNum }}</div> <div class="text-[16px] text-[#000]">+{{ selectedZone }} {{ phoneNum }}</div>
</div> </div>
<van-password-input :value="code" :gutter="10" :mask="false" focused @focus="showKeyboard = true" /> <van-password-input :value="code" :gutter="10" :mask="false" focused @focus="showKeyboard = true" />
<div class="text-#2B53AC text-14px"> <div :class="`${countdown>0?'text-#BDBDBD':'text-#2B53AC'} text-14px`">
{{ $t('login.reSend') }} {{ $t('login.reSend') }}<span v-if="countdown>0">({{countdown}})</span>
</div> </div>
<div class="mt-[17px]"> <div class="mt-[17px]">
<van-button v-if="code.length === 6" type="primary" block style="height: 48px" @click="goLogin">{{ <van-button v-if="code.length === 6" type="primary" block style="height: 48px" @click="goLogin">{{

Binary file not shown.

After

Width:  |  Height:  |  Size: 818 B

7
env/.env.prod vendored Normal file
View File

@ -0,0 +1,7 @@
# 生产环境配置
NUXT_PUBLIC_API_BASE=http://api.example.com
NUXT_PUBLIC_WS_URL=ws://ws.example.com
NUXT_API_SECRET=prod-secret
# 阿里云播放器配置
NUXT_PUBLIC_PLAYER_SOURCE=artc://live-pull-sh-01.szjixun.cn/live/live?auth_key=1736748343-0-0-feef65166e5cc62957c35b6e3eec82a1

7
env/.env.test vendored Normal file
View File

@ -0,0 +1,7 @@
# 测试环境配置
NUXT_PUBLIC_API_BASE=http://192.168.88.139:9021
NUXT_PUBLIC_WS_URL=ws://test-ws.example.com
NUXT_API_SECRET=test-secret
# 阿里云播放器配置
NUXT_PUBLIC_PLAYER_SOURCE=artc://live-pull-sh-01.szjixun.cn/live/live?auth_key=1736748343-0-0-feef65166e5cc62957c35b6e3eec82a1