feat: 初始化 uni-app 移动端项目
- cashier-mobile: 收银系统移动端(uni-app) - customer-mobile: 顾客端移动端(uni-app) - 包含基础页面结构:首页、订单、会员 - 更新 AGENTS.md 配置
This commit is contained in:
@@ -0,0 +1,80 @@
|
||||
<template>
|
||||
<view class="container">
|
||||
<view class="header">
|
||||
<text class="title">欢迎光临</text>
|
||||
</view>
|
||||
<view class="content">
|
||||
<view class="menu-list">
|
||||
<view v-for="item in menuList" :key="item.id" class="menu-item" @click="goToDetail(item)">
|
||||
<image :src="item.image" class="menu-image" mode="aspectFill" />
|
||||
<text class="menu-name">{{ item.name }}</text>
|
||||
<text class="menu-price">¥{{ item.price }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref } from 'vue'
|
||||
|
||||
const menuList = ref([
|
||||
{ id: 1, name: '招牌奶茶', price: '18.00', image: '/static/logo.png' },
|
||||
{ id: 2, name: '美式咖啡', price: '22.00', image: '/static/logo.png' },
|
||||
{ id: 3, name: '芝士蛋糕', price: '28.00', image: '/static/logo.png' }
|
||||
])
|
||||
|
||||
const goToDetail = (item) => {
|
||||
uni.navigateTo({
|
||||
url: `/pages/order/order?id=${item.id}`
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.container {
|
||||
padding: 20rpx;
|
||||
}
|
||||
|
||||
.header {
|
||||
text-align: center;
|
||||
margin-bottom: 40rpx;
|
||||
}
|
||||
|
||||
.title {
|
||||
font-size: 36rpx;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.menu-list {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 20rpx;
|
||||
}
|
||||
|
||||
.menu-item {
|
||||
width: calc(50% - 10rpx);
|
||||
background: #fff;
|
||||
border-radius: 12rpx;
|
||||
overflow: hidden;
|
||||
box-shadow: 0 2rpx 10rpx rgba(0,0,0,0.1);
|
||||
}
|
||||
|
||||
.menu-image {
|
||||
width: 100%;
|
||||
height: 200rpx;
|
||||
}
|
||||
|
||||
.menu-name {
|
||||
display: block;
|
||||
padding: 10rpx;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
|
||||
.menu-price {
|
||||
display: block;
|
||||
padding: 0 10rpx 10rpx;
|
||||
color: #ff0000;
|
||||
font-weight: bold;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,84 @@
|
||||
<template>
|
||||
<view class="container">
|
||||
<view class="header">
|
||||
<text class="title">会员中心</text>
|
||||
</view>
|
||||
<view class="member-info">
|
||||
<view class="avatar-section">
|
||||
<image src="/static/logo.png" class="avatar" />
|
||||
<text class="nickname">张三</text>
|
||||
<text class="level">黄金会员</text>
|
||||
</view>
|
||||
<view class="stats">
|
||||
<view class="stat-item">
|
||||
<text class="stat-value">100</text>
|
||||
<text class="stat-label">积分</text>
|
||||
</view>
|
||||
<view class="stat-item">
|
||||
<text class="stat-value">5</text>
|
||||
<text class="stat-label">优惠券</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
// 会员中心逻辑
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.container {
|
||||
padding: 20rpx;
|
||||
}
|
||||
|
||||
.member-info {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.avatar-section {
|
||||
margin-bottom: 40rpx;
|
||||
}
|
||||
|
||||
.avatar {
|
||||
width: 120rpx;
|
||||
height: 120rpx;
|
||||
border-radius: 60rpx;
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
|
||||
.nickname {
|
||||
display: block;
|
||||
font-size: 32rpx;
|
||||
font-weight: bold;
|
||||
margin-bottom: 10rpx;
|
||||
}
|
||||
|
||||
.level {
|
||||
display: block;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.stats {
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
margin-top: 40rpx;
|
||||
}
|
||||
|
||||
.stat-item {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.stat-value {
|
||||
display: block;
|
||||
font-size: 36rpx;
|
||||
font-weight: bold;
|
||||
color: #007AFF;
|
||||
}
|
||||
|
||||
.stat-label {
|
||||
display: block;
|
||||
color: #999;
|
||||
margin-top: 10rpx;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,45 @@
|
||||
<template>
|
||||
<view class="container">
|
||||
<view class="header">
|
||||
<text class="title">我的订单</text>
|
||||
</view>
|
||||
<view class="order-list">
|
||||
<view v-for="order in orders" :key="order.id" class="order-item">
|
||||
<text class="order-no">{{ order.orderNo }}</text>
|
||||
<text class="order-amount">¥{{ order.amount }}</text>
|
||||
<text class="order-status">{{ order.status }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref } from 'vue'
|
||||
|
||||
const orders = ref([
|
||||
{ id: 1, orderNo: 'O202401010001', amount: '199.99', status: '已完成' },
|
||||
{ id: 2, orderNo: 'O202401010002', amount: '99.99', status: '待支付' }
|
||||
])
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.container {
|
||||
padding: 20rpx;
|
||||
}
|
||||
|
||||
.order-list {
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
|
||||
.order-item {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
padding: 20rpx;
|
||||
border-bottom: 1rpx solid #eee;
|
||||
}
|
||||
|
||||
.order-amount {
|
||||
color: #ff0000;
|
||||
font-weight: bold;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user