2025-01-03 13:17:48 +08:00
|
|
|
|
<template>
|
2025-04-03 11:12:42 +08:00
|
|
|
|
<page-meta :page-font-size="fontValue+'px'" :root-font-size="fontValue+'px'"></page-meta>
|
2025-01-16 16:25:17 +08:00
|
|
|
|
<view class="work-container">
|
|
|
|
|
|
<!-- 第一个条目 -->
|
2025-02-19 09:34:34 +08:00
|
|
|
|
<view class="item" v-for="item in weekCookList" :key="item.recipeId" @click="goMenuList(item)">
|
|
|
|
|
|
<image class="image" :src="item.canteenImgUrl"></image>
|
2025-01-16 16:25:17 +08:00
|
|
|
|
<view class="content">
|
|
|
|
|
|
<text class="title">本周菜谱</text>
|
|
|
|
|
|
<text class="sub-title">食堂:{{ item.canteenName }}</text>
|
2025-02-19 09:34:34 +08:00
|
|
|
|
<text class="sub-title">档口:{{ item.stallName }}</text>
|
2025-01-16 16:25:17 +08:00
|
|
|
|
</view>
|
|
|
|
|
|
</view>
|
2025-01-03 13:17:48 +08:00
|
|
|
|
|
2025-01-16 16:25:17 +08:00
|
|
|
|
<!-- 第二个条目 -->
|
|
|
|
|
|
<!-- <view class="item">
|
|
|
|
|
|
<image class="image" src="/static/images/weeklyMenu/banner1.png"></image>
|
|
|
|
|
|
<view class="content">
|
|
|
|
|
|
<text class="title">午,中档口</text>
|
|
|
|
|
|
<text class="sub-title">食堂:宏源大厦</text>
|
|
|
|
|
|
<text class="sub-title">档口:午,中档口</text>
|
|
|
|
|
|
</view>
|
|
|
|
|
|
</view> -->
|
|
|
|
|
|
</view>
|
2025-01-03 13:17:48 +08:00
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<script>
|
2025-01-16 16:25:17 +08:00
|
|
|
|
import { getWeekCookbookAPI } from '../../api/week-menu/index'
|
2025-04-27 15:58:51 +08:00
|
|
|
|
|
2025-01-16 16:25:17 +08:00
|
|
|
|
export default {
|
|
|
|
|
|
data() {
|
|
|
|
|
|
return {
|
2025-04-27 15:58:51 +08:00
|
|
|
|
fontValue:uni.getStorageSync('fontSize') || 8,
|
2025-01-16 16:25:17 +08:00
|
|
|
|
qrCodeUrl: '/static/images/code.png', // 替换为实际的二维码URL
|
|
|
|
|
|
weekCookList: [], // 一周菜谱
|
|
|
|
|
|
queryParams: {
|
|
|
|
|
|
// startDate: '2025-1-13',
|
|
|
|
|
|
// endDate: '2025-1-19'
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
methods: {
|
|
|
|
|
|
refreshQrCode() {
|
|
|
|
|
|
// 模拟刷新二维码
|
|
|
|
|
|
this.qrCodeUrl = `/static/images/code.png`
|
|
|
|
|
|
},
|
|
|
|
|
|
// 获取一周菜谱
|
|
|
|
|
|
async getWeekCookbookData() {
|
2025-04-27 15:58:51 +08:00
|
|
|
|
this.queryParams.custId = uni.getStorageSync('custId')
|
2025-02-19 09:34:34 +08:00
|
|
|
|
const res = await getWeekCookbookAPI(this.queryParams)
|
|
|
|
|
|
this.weekCookList = res.data
|
|
|
|
|
|
console.log(res, '一周菜谱')
|
|
|
|
|
|
},
|
|
|
|
|
|
goMenuList(item){
|
|
|
|
|
|
uni.navigateTo({
|
|
|
|
|
|
url: `/pages/weeklyMenu/menuList?params=${JSON.stringify(item)}`
|
|
|
|
|
|
})
|
|
|
|
|
|
}
|
2025-01-16 16:25:17 +08:00
|
|
|
|
},
|
|
|
|
|
|
created() {
|
|
|
|
|
|
this.getWeekCookbookData()
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2025-01-03 13:17:48 +08:00
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
<style scoped>
|
2025-01-16 16:25:17 +08:00
|
|
|
|
page {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
|
box-sizing: border-box;
|
|
|
|
|
|
background-color: #f9fbff;
|
2025-06-17 16:19:23 +08:00
|
|
|
|
height: 100vh;
|
|
|
|
|
|
overflow-y: auto;
|
2025-01-16 16:25:17 +08:00
|
|
|
|
}
|
2025-01-03 13:17:48 +08:00
|
|
|
|
|
2025-01-16 16:25:17 +08:00
|
|
|
|
.work-container {
|
|
|
|
|
|
background-color: #f9fbff;
|
|
|
|
|
|
text-align: center;
|
|
|
|
|
|
}
|
2025-01-03 13:17:48 +08:00
|
|
|
|
|
2025-01-16 16:25:17 +08:00
|
|
|
|
.item {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
margin: 0 40rpx 40rpx 40rpx;
|
|
|
|
|
|
background-color: #fff;
|
|
|
|
|
|
border-radius: 8rpx;
|
|
|
|
|
|
box-shadow: 0 2rpx 4rpx rgba(0, 0, 0, 0.1);
|
|
|
|
|
|
}
|
2025-01-03 13:17:48 +08:00
|
|
|
|
|
2025-01-16 16:25:17 +08:00
|
|
|
|
.image {
|
|
|
|
|
|
width: 200rpx;
|
|
|
|
|
|
height: 200rpx;
|
|
|
|
|
|
border-radius: 8rpx;
|
|
|
|
|
|
margin: 20rpx;
|
|
|
|
|
|
}
|
2025-01-03 13:17:48 +08:00
|
|
|
|
|
2025-01-16 16:25:17 +08:00
|
|
|
|
/* 确保所有文本默认左对齐 */
|
|
|
|
|
|
.content {
|
|
|
|
|
|
flex: 1;
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
|
justify-content: space-evenly;
|
|
|
|
|
|
/* 添加以下样式以确保内容左对齐 */
|
|
|
|
|
|
align-items: flex-start; /* 确保子元素水平方向上左对齐 */
|
|
|
|
|
|
}
|
2025-01-03 13:17:48 +08:00
|
|
|
|
|
2025-01-16 16:25:17 +08:00
|
|
|
|
.title,
|
|
|
|
|
|
.sub-title {
|
|
|
|
|
|
text-align: left; /* 确保文本左对齐 */
|
|
|
|
|
|
margin: 0; /* 移除任何可能存在的默认边距 */
|
|
|
|
|
|
}
|
2025-01-03 13:17:48 +08:00
|
|
|
|
|
2025-01-16 16:25:17 +08:00
|
|
|
|
.title {
|
2025-04-03 11:12:42 +08:00
|
|
|
|
font-size: 36rpx;
|
2025-01-16 16:25:17 +08:00
|
|
|
|
color: #333;
|
|
|
|
|
|
font-weight: 600;
|
|
|
|
|
|
margin-bottom: 5rpx;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.sub-title {
|
2025-04-03 11:12:42 +08:00
|
|
|
|
font-size: 32rpx;
|
2025-01-16 16:25:17 +08:00
|
|
|
|
color: #444;
|
|
|
|
|
|
}
|
|
|
|
|
|
</style>
|