预定餐
This commit is contained in:
parent
e07abea6b1
commit
ffbe5aec8f
12
App.vue
12
App.vue
|
|
@ -32,17 +32,11 @@ export default {
|
|||
<style lang="scss">
|
||||
@import '@/uni_modules/uview-ui/index.scss';
|
||||
@import '@/static/scss/index.scss';
|
||||
page {
|
||||
box-sizing: border-box;
|
||||
background-color: #fff;
|
||||
height: auto;
|
||||
white-space: pre-wrap;
|
||||
word-wrap: break-word;
|
||||
}
|
||||
::v-deep .uni-system-preview-image {
|
||||
z-index: 10080 !important;
|
||||
}
|
||||
.u-navbar__content__right__text {
|
||||
color: $u-primary !important;
|
||||
* {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -16,4 +16,13 @@ export function getAccountBalance(params) {
|
|||
method: 'get',
|
||||
params
|
||||
});
|
||||
}
|
||||
|
||||
// 获取菜单列表
|
||||
export function getMenuList(params) {
|
||||
return request({
|
||||
url: '/leopen/recipe/query',
|
||||
method: 'get',
|
||||
params
|
||||
});
|
||||
}
|
||||
39
pages.json
39
pages.json
|
|
@ -180,24 +180,29 @@
|
|||
}
|
||||
},
|
||||
{
|
||||
"path" : "pages/remainingSum/index",
|
||||
"style" :
|
||||
{
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
"path": "pages/remainingSum/index",
|
||||
"style": {
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/code/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "个人二维码"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/weeklyMenu/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "一周菜谱"
|
||||
}
|
||||
}
|
||||
{
|
||||
"path": "pages/code/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "个人二维码"
|
||||
}
|
||||
},
|
||||
// {
|
||||
// "path": "pages/weeklyMenu/index",
|
||||
// "style": {
|
||||
// "navigationBarTitleText": "一周菜谱"
|
||||
// }
|
||||
// },
|
||||
{
|
||||
"path": "pages/advanceOrder/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "预订单"
|
||||
}
|
||||
}
|
||||
],
|
||||
"tabBar": {
|
||||
"color": "#000000",
|
||||
|
|
|
|||
|
|
@ -0,0 +1,275 @@
|
|||
<template>
|
||||
<view>
|
||||
<div class="top-cont flex justify-between align-center">
|
||||
<div class="flex align-center">
|
||||
<u-icon name="../../static/images/time.png" size="16"></u-icon>
|
||||
<span style="margin-left: 5px">{{ newDate }}</span>
|
||||
</div>
|
||||
<div class="top-right-cont">
|
||||
<span class="right-item" :class="{ active: active == 1 }" @click="active = 1">自取</span>
|
||||
<span class="right-item" :class="{ active: active == 2 }" @click="active = 2">外卖</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="balance-area" v-for="(book, index) in cookbook" :key="index">
|
||||
<div class="left-balance" :class="{ active: current == index }" @click="scrollToDetail(index)">
|
||||
{{ handleRecipeType(book.recipeType) }}
|
||||
</div>
|
||||
<div
|
||||
class="right-balance"
|
||||
:ref="'detail-' + index + '-' + itemIndex"
|
||||
v-for="(item, itemIndex) in book.recipeDetailList"
|
||||
:key="itemIndex"
|
||||
>
|
||||
<div class="top-name">{{ item.intervalName }}</div>
|
||||
<div v-for="(food, foodIndex) in item.mealList">
|
||||
{{ food.mealName }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
current: 0,
|
||||
newDate: '',
|
||||
active: 1, // 1 自取 2 外卖
|
||||
// 菜谱
|
||||
cookbook: [
|
||||
{
|
||||
recipeType: 1, // 菜谱类型(1默认,2按天,3按周,4按月)
|
||||
// 菜谱详情
|
||||
recipeDetailList: [
|
||||
{
|
||||
intervalName: '午餐', // 餐次名称
|
||||
// 菜品列表
|
||||
mealList: [
|
||||
{
|
||||
mealName: '西红柿炒鸡蛋', // 菜品名称
|
||||
imageUrl: 'https://img.yzcdn.cn/vant/apple-1.jpg', // 菜品图片
|
||||
saleNum: 100,
|
||||
supplyNum: 100, // 库存
|
||||
restrictNum: 2, // 限购数量
|
||||
salePrice: 10.2 // 菜品价格
|
||||
},
|
||||
{
|
||||
mealName: '西红柿炒鸡蛋', // 菜品名称
|
||||
imageUrl: 'https://img.yzcdn.cn/vant/apple-1.jpg', // 菜品图片
|
||||
saleNum: 100,
|
||||
supplyNum: 100, // 库存
|
||||
restrictNum: 2, // 限购数量
|
||||
salePrice: 10.2 // 菜品价格
|
||||
},
|
||||
{
|
||||
mealName: '西红柿炒鸡蛋', // 菜品名称
|
||||
imageUrl: 'https://img.yzcdn.cn/vant/apple-1.jpg', // 菜品图片
|
||||
saleNum: 100,
|
||||
supplyNum: 100, // 库存
|
||||
restrictNum: 2, // 限购数量
|
||||
salePrice: 10.2 // 菜品价格
|
||||
},
|
||||
{
|
||||
mealName: '西红柿炒鸡蛋', // 菜品名称
|
||||
imageUrl: 'https://img.yzcdn.cn/vant/apple-1.jpg', // 菜品图片
|
||||
saleNum: 100,
|
||||
supplyNum: 100, // 库存
|
||||
restrictNum: 2, // 限购数量
|
||||
salePrice: 10.2 // 菜品价格
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
recipeType: 2, // 菜谱类型(1默认,2按天,3按周,4按月)
|
||||
// 菜谱详情
|
||||
recipeDetailList: [
|
||||
{
|
||||
intervalName: '晚餐', // 餐次名称
|
||||
// 菜品列表
|
||||
mealList: [
|
||||
{
|
||||
mealName: '西红柿炒鸡蛋', // 菜品名称
|
||||
imageUrl: 'https://img.yzcdn.cn/vant/apple-1.jpg', // 菜品图片
|
||||
saleNum: 100,
|
||||
supplyNum: 100, // 库存
|
||||
restrictNum: 2, // 限购数量
|
||||
salePrice: 10.2 // 菜品价格
|
||||
},
|
||||
{
|
||||
mealName: '西红柿炒鸡蛋', // 菜品名称
|
||||
imageUrl: 'https://img.yzcdn.cn/vant/apple-1.jpg', // 菜品图片
|
||||
saleNum: 100,
|
||||
supplyNum: 100, // 库存
|
||||
restrictNum: 2, // 限购数量
|
||||
salePrice: 10.2 // 菜品价格
|
||||
},
|
||||
{
|
||||
mealName: '西红柿炒鸡蛋', // 菜品名称
|
||||
imageUrl: 'https://img.yzcdn.cn/vant/apple-1.jpg', // 菜品图片
|
||||
saleNum: 100,
|
||||
supplyNum: 100, // 库存
|
||||
restrictNum: 2, // 限购数量
|
||||
salePrice: 10.2 // 菜品价格
|
||||
},
|
||||
{
|
||||
mealName: '西红柿炒鸡蛋', // 菜品名称
|
||||
imageUrl: 'https://img.yzcdn.cn/vant/apple-1.jpg', // 菜品图片
|
||||
saleNum: 100,
|
||||
supplyNum: 100, // 库存
|
||||
restrictNum: 2, // 限购数量
|
||||
salePrice: 10.2 // 菜品价格
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
recipeType: 3, // 菜谱类型(1默认,2按天,3按周,4按月)
|
||||
// 菜谱详情
|
||||
recipeDetailList: [
|
||||
{
|
||||
intervalName: '默认', // 餐次名称
|
||||
// 菜品列表
|
||||
mealList: [
|
||||
{
|
||||
mealName: '西红柿炒鸡蛋', // 菜品名称
|
||||
imageUrl: 'https://img.yzcdn.cn/vant/apple-1.jpg', // 菜品图片
|
||||
saleNum: 100,
|
||||
supplyNum: 100, // 库存
|
||||
restrictNum: 2, // 限购数量
|
||||
salePrice: 10.2 // 菜品价格
|
||||
},
|
||||
{
|
||||
mealName: '西红柿炒鸡蛋', // 菜品名称
|
||||
imageUrl: 'https://img.yzcdn.cn/vant/apple-1.jpg', // 菜品图片
|
||||
saleNum: 100,
|
||||
supplyNum: 100, // 库存
|
||||
restrictNum: 2, // 限购数量
|
||||
salePrice: 10.2 // 菜品价格
|
||||
},
|
||||
{
|
||||
mealName: '西红柿炒鸡蛋', // 菜品名称
|
||||
imageUrl: 'https://img.yzcdn.cn/vant/apple-1.jpg', // 菜品图片
|
||||
saleNum: 100,
|
||||
supplyNum: 100, // 库存
|
||||
restrictNum: 2, // 限购数量
|
||||
salePrice: 10.2 // 菜品价格
|
||||
},
|
||||
{
|
||||
mealName: '西红柿炒鸡蛋', // 菜品名称
|
||||
imageUrl: 'https://img.yzcdn.cn/vant/apple-1.jpg', // 菜品图片
|
||||
saleNum: 100,
|
||||
supplyNum: 100, // 库存
|
||||
restrictNum: 2, // 限购数量
|
||||
salePrice: 10.2 // 菜品价格
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
this.getNowFormatDate()
|
||||
},
|
||||
methods: {
|
||||
// 获取当前时间
|
||||
getNowFormatDate() {
|
||||
let date = new Date()
|
||||
let year = date.getFullYear()
|
||||
let month = (date.getMonth() + 1).toString().padStart(2, '0')
|
||||
let day = date.getDate().toString().padStart(2, '0')
|
||||
let week = date.getDay()
|
||||
let weeks = ['日', '一', '二', '三', '四', '五', '六']
|
||||
this.newDate = `${month}-${day} 星期${weeks[week]}`
|
||||
},
|
||||
// 处理recipeType
|
||||
handleRecipeType(type) {
|
||||
if (type === 1) {
|
||||
return '默认'
|
||||
} else if (type === 2) {
|
||||
return '按天'
|
||||
} else if (type === 3) {
|
||||
return '按周'
|
||||
} else if (type === 4) {
|
||||
return '按月'
|
||||
}
|
||||
},
|
||||
scrollToDetail(index) {
|
||||
console.log('🚀 ~ scrollToDetail ~ index', index)
|
||||
this.current = index
|
||||
const detailElement = this.$refs['detail-' + index + '-0'][0]
|
||||
if (detailElement) {
|
||||
detailElement.scrollIntoView({ behavior: 'smooth' })
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
page {
|
||||
/* padding-top: env(safe-area-inset-top); */
|
||||
background: #f9fbff;
|
||||
}
|
||||
.top-cont {
|
||||
padding: 0 16px 16px;
|
||||
background: #fff;
|
||||
.top-right-cont {
|
||||
background: rgba(15, 39, 75, 0.05);
|
||||
border-radius: 11px 11px 11px 11px;
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
color: #0f274b;
|
||||
font-size: 12px;
|
||||
.right-item {
|
||||
padding: 3px 10px;
|
||||
border-radius: 11px 11px 11px 11px;
|
||||
cursor: pointer;
|
||||
&.active {
|
||||
background: linear-gradient(180deg, #ffae82 0%, #ff6816 100%);
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.balance-area {
|
||||
display: flex;
|
||||
|
||||
.left-balance {
|
||||
width: 88px;
|
||||
height: 44px;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
font-weight: 500;
|
||||
font-size: 14px;
|
||||
color: #0f274b;
|
||||
|
||||
&.active {
|
||||
background: #fff;
|
||||
}
|
||||
}
|
||||
|
||||
.right-balance {
|
||||
width: calc(100vw - 88px);
|
||||
/* min-height: 90vh; */
|
||||
overflow: auto;
|
||||
padding: 0 8px;
|
||||
background-color: #fff;
|
||||
.top-name {
|
||||
height: 44px;
|
||||
font-weight: 400;
|
||||
font-size: 12px;
|
||||
color: rgba(15, 39, 75, 0.6);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -90,7 +90,7 @@
|
|||
goToOrder() {
|
||||
// 跳转到订餐页面
|
||||
uni.navigateTo({
|
||||
url: '/pages/order/index'
|
||||
url: '/pages/advanceOrder/index'
|
||||
})
|
||||
},
|
||||
goCode() {
|
||||
|
|
|
|||
|
|
@ -174,7 +174,7 @@ export default {
|
|||
justify-content: space-between;
|
||||
.box-item {
|
||||
margin-bottom: 12px;
|
||||
width: 109px;
|
||||
width: 30%;
|
||||
height: 66px;
|
||||
border-radius: 4px 4px 4px 4px;
|
||||
border: 1px solid rgba(15, 39, 75, 0.4);
|
||||
|
|
|
|||
201
pages/system.vue
201
pages/system.vue
|
|
@ -1,68 +1,167 @@
|
|||
<template>
|
||||
<view class="system">
|
||||
<div class="top-img">
|
||||
<u-image src="../static/images/system/top.png" width="351px" height="146px" />
|
||||
</div>
|
||||
<div class="cont-img">
|
||||
<div class="item" @click="handleItem(1)">
|
||||
<u-icon name="../static/images/system/1.png" size="38"></u-icon>
|
||||
<div>就餐服务</div>
|
||||
</div>
|
||||
<div class="item">
|
||||
<u-icon name="../static/images/system/2.png" size="38"></u-icon>
|
||||
<div>志愿者服务</div>
|
||||
</div>
|
||||
<div class="item">
|
||||
<u-icon name="../static/images/system/3.png" size="38"></u-icon>
|
||||
<div>驿站服务</div>
|
||||
</div>
|
||||
</div>
|
||||
<view class="index_main" :style="{ minHeight: screenH + 'px' }">
|
||||
<view class="back-top"></view>
|
||||
<!-- 轮播图 -->
|
||||
<view class="swiper_nav">
|
||||
<swiper autoplay :duration="1000">
|
||||
<swiper-item v-for="(item, index) in swiperImg" :key="index">
|
||||
<image :src="item" style="width: 100%; height: 100%"></image>
|
||||
</swiper-item>
|
||||
</swiper>
|
||||
</view>
|
||||
<!-- 皖送e餐 志愿者服务 -->
|
||||
<view class="main_menu">
|
||||
<view class="main_menu_item" v-for="(item, index) in firstMenus" :key="index" @click="handleItem(index)">
|
||||
<image :src="item.icon"></image>
|
||||
<view class="main_menu_name">{{ item.name }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {}
|
||||
return {
|
||||
screenH: '',
|
||||
swiperImg: [require('../static/images/system/top.png')],
|
||||
firstMenus: [
|
||||
{
|
||||
name: '就餐服务',
|
||||
icon: require('../static/images/system/1.png')
|
||||
},
|
||||
{
|
||||
name: '志愿者服务',
|
||||
icon: require('../static/images/system/2.png')
|
||||
},
|
||||
{
|
||||
name: '驿站服务',
|
||||
icon: require('../static/images/system/3.png')
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleItem(index) {
|
||||
if (index === 1) {
|
||||
this.$tab.reLaunch('/pages/index')
|
||||
}
|
||||
}
|
||||
}
|
||||
mounted() {
|
||||
uni.getSystemInfo({
|
||||
success: res => {
|
||||
this.screenH = res.windowHeight
|
||||
}
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
handleItem(index) {
|
||||
if (index === 0) {
|
||||
this.$tab.reLaunch('/pages/index')
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
page {
|
||||
min-height: 100vh;
|
||||
background-image: url("../static/images/system/bg.png");
|
||||
background-image: url('../static/images/system/bg.png');
|
||||
}
|
||||
.system {
|
||||
padding: 18px;
|
||||
.top-img {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
.cont-img {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
margin-top: 15px;
|
||||
.item {
|
||||
padding: 15px 0;
|
||||
width: 109px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
background-color: #fff;
|
||||
border-radius: 10px;
|
||||
div {
|
||||
margin-top: 10px;
|
||||
}
|
||||
}
|
||||
}
|
||||
.index_main {
|
||||
/* background: #f2f6fa; */
|
||||
overflow: auto;
|
||||
padding: 24rpx 0;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.back-top {
|
||||
position: fixed;
|
||||
width: 100%;
|
||||
height: 578rpx;
|
||||
/* background: linear-gradient(180deg, #d2eaff 0%, rgba(208, 233, 254, 0) 100%); */
|
||||
top: 0;
|
||||
left: 0;
|
||||
}
|
||||
.swiper_nav {
|
||||
width: 100%;
|
||||
height: 300rpx;
|
||||
/* background: #ffffff; */
|
||||
border-radius: 20rpx;
|
||||
padding: 0 24rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.main_menu {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
margin-top: 24px;
|
||||
padding: 0 12rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.main_menu_item {
|
||||
z-index: 99;
|
||||
margin: 0 12rpx;
|
||||
padding: 28rpx 0;
|
||||
flex: 1;
|
||||
height: 208rpx;
|
||||
background: #ffffff;
|
||||
border-radius: 20rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
.main_menu_name {
|
||||
font-family: PingFang SC, PingFang SC;
|
||||
font-weight: bold;
|
||||
font-size: 30rpx;
|
||||
color: #0e1a24;
|
||||
font-style: normal;
|
||||
text-transform: none;
|
||||
}
|
||||
image {
|
||||
display: flex;
|
||||
width: 88rpx;
|
||||
height: 88rpx;
|
||||
border-radius: 34rpx;
|
||||
}
|
||||
}
|
||||
.yiz_menu {
|
||||
width: calc(100% - 48rpx);
|
||||
min-height: 480rpx;
|
||||
background: #ffffff;
|
||||
border-radius: 20rpx;
|
||||
margin-top: 24rpx;
|
||||
margin-left: 24rpx;
|
||||
}
|
||||
.yiz_menu_tle {
|
||||
font-family: PingFang SC, PingFang SC;
|
||||
font-weight: bold;
|
||||
font-size: 32rpx;
|
||||
color: #0e1a24;
|
||||
font-style: normal;
|
||||
text-transform: none;
|
||||
padding: 28rpx 28rpx 0 28rpx;
|
||||
}
|
||||
.yiz_menu_nav {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-wrap: wrap;
|
||||
.yiz_menu_nav_item {
|
||||
width: calc(100% / 4);
|
||||
margin-top: 48rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
image {
|
||||
display: block;
|
||||
width: 88rpx;
|
||||
height: 88rpx;
|
||||
border-radius: 34rpx;
|
||||
}
|
||||
.yiz_menu_name {
|
||||
font-family: PingFang SC, PingFang SC;
|
||||
font-weight: 400;
|
||||
font-size: 28rpx;
|
||||
color: #0e1a24;
|
||||
font-style: normal;
|
||||
text-transform: none;
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -24,7 +24,8 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<div style="margin-top: 91px; padding: 0 16px;">
|
||||
<div style="height: 56px;"></div>
|
||||
<div style="padding: 0 16px;">
|
||||
<div class="order-list" v-for="(item, index) in tableList" :key="index">
|
||||
<div class="flex justify-between">
|
||||
<div class="order-source">订单来源:{{ item.sourceType }}</div>
|
||||
|
|
@ -201,14 +202,14 @@ export default {
|
|||
|
||||
<style lang="scss" scoped>
|
||||
.content {
|
||||
/* padding: 0 16px; */
|
||||
background: #f9fbff;
|
||||
height: 100%;
|
||||
min-height: 100vh;
|
||||
/* position: relative; */
|
||||
|
||||
.top-wrapper {
|
||||
position: fixed;
|
||||
top: 44px;
|
||||
/* top: 44px; */
|
||||
top: 0;
|
||||
width: 100vw;
|
||||
background: #f9fbff;
|
||||
z-index: 999;
|
||||
|
|
|
|||
Binary file not shown.
|
After Width: | Height: | Size: 959 B |
Loading…
Reference in New Issue