123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189 |
- <template>
- <view class="pr">
- <image :src="bgimg" class="bgimg"></image>
- <view class="cookbox">
- <view class="cboxs">
- <view class="ctopimg">
- <image :src="ctopimg"></image>
- <view class="tit">{{startDate}} - {{endDate}}</view>
- </view>
- <image :src="cbgimg" class="cbgimg"></image>
- <view class="cline">
- <image :src="cline"></image>
- </view>
- <view class="clists" v-for="(ite,idx) in list" :key="idx">
- <image :src="cooka" class="cookimg hea" v-if="kaType(ite.menuFoodTime,weeklist)=='1'"></image>
- <image :src="cookb" class="cookimg heb" v-if="kaType(ite.menuFoodTime,weeklist)=='2'"></image>
- <image :src="cookc" class="cookimg hec" v-if="kaType(ite.menuFoodTime,weeklist)=='3'"></image>
- <image :src="cookd" class="cookimg hed" v-if="kaType(ite.menuFoodTime,weeklist)=='4'"></image>
- <image :src="cooke" class="cookimg heb" v-if="kaType(ite.menuFoodTime,weeklist)=='5'"></image>
- <image :src="cookf" class="cookimg heb" v-if="kaType(ite.menuFoodTime,weeklist)=='6'"></image>
- <image :src="cookg" class="cookimg hed" v-if="kaType(ite.menuFoodTime,weeklist)=='7'"></image>
- <view class="clist">
- <!-- <view class="list">
- <view class="tit bgb">早餐</view>
- <view class="txt">{{ite.menuFoodDetailBk||"无"}}</view>
- </view> -->
- <view class="list">
- <view class="tit bga">午餐</view>
- <view class="txt">{{ite.menuFoodDetailLu||"无"}}</view>
- </view>
- <view class="list">
- <view class="tit bgb">晚餐</view>
- <view class="txt">{{ite.menuFoodDetailDi||"无"}}</view>
- </view>
- </view>
- </view>
- <image :src="cfotimg" class="cfotimg"></image>
- </view>
- </view>
- </view>
- </template>
- <script>
- import {getMenuRecordList,getMenuList} from "@/api/mine/order.js"
- import {getDictionaryFn} from "@/api/mine/register.js"
- import { selectDictLabel } from '@/utils/common.js';
- export default {
- data(){
- return{
- bgimg:require("@/work/static/yuy/bg.png"),
- cbgimg:require("@/work/static/yuy/cbg.png"),
- ctopimg:require("@/work/static/yuy/ctop.png"),
- cfotimg:require("@/work/static/yuy/cfot.png"),
- cline:require("@/work/static/yuy/cline.png"),
- cooka:require("@/work/static/yuy/menua.png"),
- cookb:require("@/work/static/yuy/menub.png"),
- cookc:require("@/work/static/yuy/menuc.png"),
- cookd:require("@/work/static/yuy/menud.png"),
- cooke:require("@/work/static/yuy/menue.png"),
- cookf:require("@/work/static/yuy/menuf.png"),
- cookg:require("@/work/static/yuy/menug.png"),
- list:[],
- startDate:'',
- endDate:'',
- weeklist:'',
- }
- },
- onLoad: function() {
- this.init()
- this.getWeeksDay()
- },
- methods:{
- kaType(data, list) {
- return selectDictLabel(list, data);
- },
- init(){
- // 食谱日期
- getDictionaryFn('week').then(res=>{
- if(res.code==200){
- this.weeklist = res.data.map(v => {
- return {
- dictLabel: v.dictLabel,
- dictValue: v.dictValue,
-
- }
- })
- }
- })
- },
- getWeeksDay(){
- var date = new Date();
- var y = date.getFullYear();
- var m = date.getMonth();
- var d = date.getDate();
- var week = date.getDay(); //获取当前星期X(0-6,0代表星期天)
- var startDate,endDate
- if(week==0){
- startDate=new Date(y,m,d-week-6)
- endDate=new Date(y,m,d-week)
- }else{
- startDate=new Date(y,m,d-week+1)
- endDate=new Date(y,m,d-week+7)
- }
- this.startDate=this.formatDate(startDate)
- this.endDate=this.formatDate(endDate)
- this.getDataFn()
- // console.log(this.formatDate(startDate),this.formatDate(endDate))
- },
- formatDate(date){
- const year = date.getFullYear();
- const month = ('0' + (date.getMonth() + 1)).slice(-2);
- const day = ('0' + date.getDate()).slice(-2);
-
- return month + '-' + day;
- },
- getDataFn() {
- var params = {
- pageSize: this.pageSize,
- pageNum: this.pageNum,
- isUse:'Y'
- }
- getMenuRecordList(params).then(res => {
- if (res.code == 200) {
- // if (res.rows.length < this.pageSize) {
- // this.reachflag = false
- // this.wtdt = '到底了~';
- // } else {
- // var num = parseInt(res.rows.length) + parseInt(this.pageSize) * parseInt(this.pageNum -
- // 1)
- // if (num < res.total) {
- // this.reachflag = true
- // this.wtdt = '上拉加载更多'
- // } else {
- // this.reachflag = false
- // this.wtdt = '到底了~';
- // }
- // }
- if (this.pageNum == 1) {
- this.list = res.rows;
- } else {
- this.list = this.list.concat(res.rows)
- }
- } else {
- this.$toast(res.msg)
- }
- })
-
- },
- },
-
- }
- </script>
- <style lang="scss" scoped>
- .bgimg{width: 100%;min-height: 100vh;z-index: -2;position: absolute;left: 0;right: 0;top: 0;bottom: 0;height: auto;}
- .cookbox{padding: 172rpx 36rpx 54rpx 64rpx;box-sizing: border-box;
- .cboxs{position: relative;width: 100%;min-height: calc(100vh - 226rpx);padding: 152rpx 50rpx 154rpx 66rpx;box-sizing: border-box;
- .ctopimg{width: 548rpx;height: 296rpx;position: absolute;left: 50%;top: -154rpx;z-index: 1;margin-left: -274rpx;
- image{width: 100%;height: 100%;}
- .tit{font-size: 30rpx;color: #FFFFFE;text-stroke: 2rpx #291313;-webkit-text-stroke: 2rpx #291313;font-weight: bold;
- position: absolute;bottom: 80rpx;font-family: FZZhengHeiS-EB-GB;left: 144rpx;right: 172rpx;text-align: center;line-height: 40rpx;
- }
- }
- .cfotimg{width: 582rpx;height: 264rpx;position: absolute;right: -12rpx;bottom: -42rpx;}
- .cbgimg{width: 100%;height: 100%;position: absolute;left: 0;right: 0;top: 0;bottom: 0;z-index: -1;}
- .cline{width: 62rpx;height: auto;position: absolute;top: 252rpx;bottom: 270rpx;left:-24rpx;overflow: hidden;display: flex;align-items: center;
- //min-height: 370rpx;
- image{height: 1638rpx;width: 100%;}
- }
- // 主体
- .clists{padding-bottom: 12rpx;
- .cookimg{width: 532rpx;margin-bottom: 26rpx;
- &.hea{height: 56rpx;width: 534rpx;}
- &.heb{height: 60rpx;}
- &.hec{height: 64rpx;}
- &.hed{height: 66rpx;width: 534rpx;}
- }
- .list{padding-left: 6rpx;display: flex;align-items: flex-start;margin-bottom: 18rpx;
- .tit{font-size: 26rpx;min-width: 76rpx;padding: 0 8rpx;text-align: center;line-height: 34rpx;box-sizing: border-box;height: 34rpx;border-radius: 16rpx;flex: 0 0 auto;margin-right: 20rpx;color: #161616;
- &.bga{background: #FFE0AE;}
- &.bgb{background: #DCF1FF;}
- }
- .txt{font-size: 26rpx;font-family: FZKaTong-M19S;color: #382324;}
- }
- }
- }
- }
- </style>
|