Commit 98470a8b authored by caoxu's avatar caoxu

Initial commit: 博物馆奇妙夜项目

parents
Pipeline #506 canceled with stages
module.exports = {
root: true,
env: {
node: true,
browser: true
},
extends: [
'eslint:recommended',
'plugin:vue/vue3-recommended',
'prettier'
],
plugins: [
'vue',
'prettier'
],
rules: {
'prettier/prettier': 'error',
'vue/multi-word-component-names': 'off'
},
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module'
}
}
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*
# Dependencies
node_modules
.pnp
.pnp.js
# Build outputs
dist
dist-ssr
*.local
# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
# Environment variables
.env
.env.local
.env.*.local
# Testing
coverage
.nyc_output
# Misc
*.pid
*.seed
*.pid.lock
# Optional npm cache directory
.npm
# Optional eslint cache
.eslintcache
# Optional REPL history
.node_repl_history
# Output of 'npm pack'
*.tgz
# Yarn Integrity file
.yarn-integrity
# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache
# Next.js build output
.next
out
# Nuxt.js build / generate output
.nuxt
# Gatsby files
.cache/
# vuepress build output
.vuepress/dist
# Serverless directories
.serverless/
# FuseBox cache
.fusebox/
# DynamoDB Local files
.dynamodb/
# TernJS port file
.tern-port
# Stores VSCode versions used for testing VSCode extensions
.vscode-test
# yarn v2
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*
module.exports = {
singleQuote: true,
semi: false,
tabWidth: 2,
trailingComma: 'es5',
printWidth: 80,
arrowParens: 'avoid'
}
{
"recommendations": ["Vue.volar"]
}
# Vue 3 + Vite
This template should help get you started developing with Vue 3 in Vite. The template uses Vue 3 `<script setup>` SFCs, check out the [script setup docs](https://v3.vuejs.org/api/sfc-script-setup.html#sfc-script-setup) to learn more.
Learn more about IDE Support for Vue in the [Vue Docs Scaling up Guide](https://vuejs.org/guide/scaling-up/tooling.html#ide-support).
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>prddemo</title>
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/main.js"></script>
</body>
</html>
This diff is collapsed.
{
"name": "prddemo",
"private": true,
"version": "0.0.0",
"type": "module",
"scripts": {
"dev": "vite",
"build": "vite build",
"preview": "vite preview"
},
"dependencies": {
"pinia": "^3.0.4",
"vue": "^3.5.24",
"vue-router": "^4.6.4"
},
"devDependencies": {
"@vitejs/plugin-vue": "^5.0.4",
"eslint": "^9.39.2",
"eslint-config-prettier": "^10.1.8",
"eslint-plugin-prettier": "^5.5.4",
"eslint-plugin-vue": "^10.6.2",
"prettier": "^3.7.4",
"vite": "^6.0.1"
}
}
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>
\ No newline at end of file
<script setup>
import Layout from './components/layout/Layout.vue'
</script>
<template>
<Layout />
</template>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: Arial, sans-serif;
line-height: 1.6;
color: #333;
background-color: #f5f5f5;
/* Ensure no horizontal overflow on mobile */
overflow-x: hidden;
}
/* Remove default focus outline for better mobile experience */
:focus {
outline: none;
}
</style>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="37.07" height="36" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 198"><path fill="#41B883" d="M204.8 0H256L128 220.8L0 0h97.92L128 51.2L157.44 0h47.36Z"></path><path fill="#41B883" d="m0 0l128 220.8L256 0h-51.2L128 132.48L50.56 0H0Z"></path><path fill="#35495E" d="M50.56 0L128 133.12L204.8 0h-47.36L128 51.2L97.92 0H50.56Z"></path></svg>
\ No newline at end of file
<script setup>
import { ref } from 'vue'
defineProps({
msg: String,
})
const count = ref(0)
</script>
<template>
<h1>{{ msg }}</h1>
<div class="card">
<button type="button" @click="count++">count is {{ count }}</button>
<p>
Edit
<code>components/HelloWorld.vue</code> to test HMR
</p>
</div>
<p>
Check out
<a href="https://vuejs.org/guide/quick-start.html#local" target="_blank"
>create-vue</a
>, the official Vue + Vite starter
</p>
<p>
Learn more about IDE Support for Vue in the
<a
href="https://vuejs.org/guide/scaling-up/tooling.html#ide-support"
target="_blank"
>Vue Docs Scaling up Guide</a
>.
</p>
<p class="read-the-docs">Click on the Vite and Vue logos to learn more</p>
</template>
<style scoped>
.read-the-docs {
color: #888;
}
</style>
<template>
<footer class="footer">
<div class="container">
<p>&copy; {{ currentYear }} Vue3 Basic Framework. All rights reserved.</p>
</div>
</footer>
</template>
<script setup>
import { ref, onMounted } from 'vue'
const currentYear = ref(new Date().getFullYear())
</script>
<style scoped>
.footer {
background-color: #333;
color: white;
padding: 2.13vw 0; /* 16px / 7.5 = 2.13vw */
text-align: center;
margin-top: auto;
}
.container {
margin: 0 auto;
padding: 0 2.13vw; /* 16px / 7.5 = 2.13vw */
}
p {
margin: 0;
font-size: 1.92vw; /* 14.4px / 7.5 = 1.92vw */
opacity: 0.8;
}
</style>
<template>
<header class="header">
<div class="container">
<div class="logo">
<h1>墨鱼旅行</h1>
</div>
<nav class="nav">
<router-link to="/service-details" class="nav-link">产品PRD</router-link>
</nav>
</div>
</header>
</template>
<script setup>
// Header component logic
</script>
<style scoped>
.header {
background-color: #42b883;
color: white;
padding: 2.13vw 0; /* 16px / 7.5 = 2.13vw */
box-shadow: 0 0.27vw 0.53vw rgba(0, 0, 0, 0.1); /* 2px / 7.5 = 0.27vw, 4px / 7.5 = 0.53vw */
}
.container {
width: 100%;
margin: 0 auto;
padding: 0 2.13vw; /* 16px / 7.5 = 2.13vw */
display: flex;
justify-content: space-between;
align-items: center;
}
.logo h1 {
margin: 0;
font-size: 18px;
font-size: clamp(16px, 2.4vw, 24px);
}
.nav {
display: flex;
gap: 3.2vw; /* 24px / 7.5 = 3.2vw */
}
.nav-link {
color: white;
text-decoration: none;
font-weight: 500;
transition: all 0.3s ease;
padding: 1.33vw 2.13vw; /* 10px / 7.5 = 1.33vw, 16px / 7.5 = 2.13vw */
border-radius: 0.8vw;
}
.nav-link:hover {
opacity: 0.8;
background-color: rgba(255, 255, 255, 0.1);
}
.nav-link.router-link-active {
background-color: rgba(255, 255, 255, 0.2);
text-decoration: none;
}
</style>
<template>
<div class="app-container">
<Header />
<main class="main-content">
<router-view />
</main>
<Footer />
</div>
</template>
<script setup>
import Header from './Header.vue'
import Footer from './Footer.vue'
</script>
<style scoped>
.app-container {
display: flex;
flex-direction: column;
min-height: 100vh;
width: 100%;
max-width: 750px;
margin: 0 auto;
background-color: white;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}
.main-content {
flex: 1;
padding: 10px;
background-color: #f9f9f9;
}
</style>
import { createApp } from 'vue'
import './style.css'
import App from './App.vue'
import router from './router'
import pinia from './stores'
const app = createApp(App)
app.use(router)
app.use(pinia)
app.mount('#app')
import { createRouter, createWebHistory } from 'vue-router'
const router = createRouter({
history: createWebHistory(import.meta.env.BASE_URL),
routes: [
{
path: '/',
redirect: '/service-details'
},
{
path: '/service-details',
name: 'serviceDetails',
component: () => import('../views/ServiceDetailsView.vue')
},
{
path: '/museum-night',
name: 'museumNight',
component: () => import('../views/MuseumNightView.vue')
}
]
})
export default router
import { defineStore } from 'pinia'
export const useCounterStore = defineStore('counter', {
state: () => ({
count: 0,
message: 'Hello Pinia!'
}),
getters: {
doubleCount: (state) => state.count * 2,
getMessage: (state) => state.message
},
actions: {
increment() {
this.count++
},
decrement() {
this.count--
},
reset() {
this.count = 0
},
updateMessage(newMessage) {
this.message = newMessage
}
}
})
import { createPinia } from 'pinia'
const pinia = createPinia()
export default pinia
import { defineStore } from 'pinia'
import { ref } from 'vue'
export const useOrderStore = defineStore('order', () => {
const orders = ref([])
const addOrder = (order) => {
const newOrder = {
id: Date.now(),
...order,
status: 'paid',
createdAt: new Date().toISOString()
}
orders.value.push(newOrder)
saveOrdersToStorage()
return newOrder
}
const getOrders = () => {
return orders.value
}
const getOrderById = (id) => {
return orders.value.find(order => order.id === id)
}
const updateOrderStatus = (id, status) => {
const order = orders.value.find(order => order.id === id)
if (order) {
order.status = status
if (status === 'verified') {
order.verifiedAt = new Date().toISOString()
} else if (status === 'refunded') {
order.refundedAt = new Date().toISOString()
}
saveOrdersToStorage()
}
}
const saveOrdersToStorage = () => {
localStorage.setItem('museum_orders', JSON.stringify(orders.value))
}
const loadOrdersFromStorage = () => {
orders.value = [
{
id: 1,
date: '1月15日 周六',
productName: '1大1小',
price: 1680,
verificationCode: 'ABC12345',
status: 'paid',
createdAt: new Date().toISOString()
},
{
id: 2,
date: '1月22日 周六',
productName: '2大1小',
price: 2280,
verificationCode: 'XYZ67890',
status: 'verified',
createdAt: new Date().toISOString(),
verifiedAt: new Date().toISOString()
},
{
id: 3,
date: '1月29日 周六',
productName: '1大1小',
price: 1680,
verificationCode: 'DEF24680',
status: 'refunded',
createdAt: new Date().toISOString(),
refundedAt: new Date().toISOString()
}
]
saveOrdersToStorage()
}
loadOrdersFromStorage()
return {
orders,
addOrder,
getOrders,
getOrderById,
updateOrderStatus
}
})
:root {
font-family: system-ui, Avenir, Helvetica, Arial, sans-serif;
line-height: 1.5;
font-weight: 400;
font-size: 15pt; /* 2.67vw * 5.625 = 15pt,增大基础字体大小 */
color-scheme: light dark;
color: rgba(255, 255, 255, 0.87);
background-color: #242424;
font-synthesis: none;
text-rendering: optimizeLegibility;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
a {
font-weight: 500;
color: #646cff;
text-decoration: inherit;
}
a:hover {
color: #535bf2;
}
body {
margin: 0;
display: block; /* Change from flex to block for mobile layout */
min-width: 320px;
min-height: 100vh;
}
h1 {
font-size: 2em; /* Reduced for mobile */
line-height: 1.2;
}
h2 {
font-size: 1.5em;
}
h3 {
font-size: 1.25em;
}
button {
border-radius: 6pt; /* 1.07vw * 5.625 = 6pt */
border: 0.75pt solid transparent; /* 0.13vw * 5.625 = 0.75pt */
padding: 0.6em 1.2em;
font-size: 1em;
font-weight: 500;
font-family: inherit;
background-color: #1a1a1a;
cursor: pointer;
transition: border-color 0.25s;
}
button:hover {
border-color: #646cff;
}
button:focus,
button:focus-visible {
outline: 3pt auto -webkit-focus-ring-color; /* 0.53vw * 5.625 = 3pt */
}
.card {
padding: 1.5em; /* Reduced padding for mobile */
}
#app {
max-width: 750px; /* Match our fixed width */
margin: 0 auto;
text-align: left; /* Change to left align for mobile */
width: 100%;
}
@media (prefers-color-scheme: light) {
:root {
color: #213547;
background-color: #ffffff;
}
a:hover {
color: #747bff;
}
button {
background-color: #f9f9f9;
}
}
This diff is collapsed.
This diff is collapsed.
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
// https://vite.dev/config/
export default defineConfig({
plugins: [vue()],
})
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment