eatlistday.vue 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232
  1. <template>
  2. <view :style="'padding-top:'+nvaHeight+'px;'">
  3. <view class="navbox">
  4. <uni-nav-bar color="#ffffff" left-icon="left" title="我的订餐记录" :background-color="backgroundColor"
  5. :border="false" statusBar='true' fixed="true" @clickLeft='getBack'>
  6. </uni-nav-bar>
  7. </view>
  8. <image :src="navbg" class="navbg"></image>
  9. <view class="zxmain">
  10. <view class="ytbox">
  11. <!-- <view class="ytop flexc">
  12. <view class="tit">{{visitName.charAt(0)}}</view>
  13. <view class="cent">
  14. <view class="ctit">{{visitName}}</view>
  15. <view class="ctime">最新打卡:2024-07-18</view>
  16. </view>
  17. </view> -->
  18. <!-- 日历 -->
  19. <view class="mb24">
  20. <lunc-calendar ref="calendar" :showLunar="false" :configWeek="configWeek" :configHoliday="configHoliday" :firstDayOfWeek="firstDayOfWeek" :showMonthBg="false" :showShrink="true" :signList="signList"
  21. @dayChange="dayChange" weekType="" @monthChange="monthChange" @getIsSelDayFn="getIsSelDayFn" @shrinkClick="shrinkClick">
  22. </lunc-calendar>
  23. </view>
  24. <!-- 步骤条 -->
  25. <view class="mb16 plr18">
  26. <view class="steps">
  27. <view class="cir"></view>
  28. <view class="stepsa">
  29. <view class="steptit">中餐预订</view>
  30. <view class="steptxt">
  31. <image :src="cirimg"></image>
  32. <view>{{datainfo.am}}</view>
  33. </view>
  34. </view>
  35. </view>
  36. <view class="steps">
  37. <view class="cir"></view>
  38. <view class="stepsa">
  39. <view class="steptit">晚餐预订</view>
  40. <view class="steptxt">
  41. <image :src="cirimg"></image>
  42. <view>{{datainfo.pm}}</view>
  43. </view>
  44. </view>
  45. </view>
  46. </view>
  47. </view>
  48. </view>
  49. </view>
  50. </template>
  51. <script>
  52. import {checkPermi,checkRole} from "@/utils/permission"; // 权限判断函数
  53. import {getDictionaryFn} from "@/api/mine/register.js"
  54. import {getFoodRiLi} from "@/api/mine/work.js"
  55. import luncCalendar from "@/work/components/lunc-calendar/foodlunc-calendar.vue"
  56. export default {
  57. components: {luncCalendar},
  58. data() {
  59. return {
  60. cirimg:require("@/static/images/home/chose.png"),
  61. navbg:require("@/static/images/navbg.png"),
  62. backgroundColor: "transparent",
  63. datainfo:{},
  64. nvaHeight: 44,
  65. marTop: 0, //距离顶部的距离
  66. stubarHeight: 0, //
  67. visitName:'林涵宇',
  68. jclxlist:[],//就餐类型
  69. kaTime:'',
  70. signList: [],
  71. configWeek:[],
  72. configHoliday:'Y',
  73. firstDayOfWeek:'sunday',
  74. // dayflag:false,
  75. // month:'',
  76. // year:'',
  77. // kaTime:'',
  78. changetime:'',//改变的日期
  79. // timeday:'',//选择的日期
  80. // visitDate:'',
  81. userId:this.$store.state.user.userId,
  82. }
  83. },
  84. onPageScroll(e) {
  85. var scrollTop = Number(e.scrollTop);
  86. if (scrollTop > 0) {
  87. this.backgroundColor = '#0491FD'
  88. } else {
  89. this.backgroundColor = 'transparent'
  90. }
  91. },
  92. onLoad: function() {
  93. // this.init()
  94. this.time()
  95. this.getCalendarList()
  96. uni.getSystemInfo({
  97. success: (e) => {
  98. this.stubarHeight = Number(e.statusBarHeight);
  99. this.nvaHeight = Number(e.statusBarHeight) + 44;
  100. }
  101. })
  102. },
  103. onShow() {},
  104. methods: {
  105. checkPermi,
  106. checkRole,
  107. getBack() {
  108. uni.navigateBack({
  109. delta: 1
  110. })
  111. },
  112. time(){
  113. var date = new Date();
  114. var y = date.getFullYear();
  115. var m = date.getMonth() + 1;
  116. var d = date.getDate();
  117. // var h = date.getHours();
  118. // var min = date.getMinutes();
  119. // var s = date.getSeconds();
  120. // var week = date.getDay(); //获取当前星期X(0-6,0代表星期天)
  121. // var weeks = ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"];
  122. var yearStr = y + '-' + (m < 10 ? ('0' + m) : m) + '-' + (d < 10 ? ('0' + d) : d)
  123. // var timeStr = (h < 10 ? ('0' + h) : h) + ':' + (min < 10 ? ('0' + min) : min) + ':' + (s < 10 ? (
  124. // '0' + s) : s);
  125. this.year=y;
  126. this.month=m < 10 ? ('0' + m) : m;
  127. this.kaTime = yearStr
  128. },
  129. dayChange(e){
  130. if(e.daySign&&e.daySign.length){
  131. var daySign=e.daySign[0];
  132. this.datainfo=JSON.parse(JSON.stringify(daySign))
  133. }
  134. },
  135. monthChange(e){
  136. var y=e.year;
  137. var m=e.month;
  138. if(y==this.year&&m==this.month){
  139. this.getCalendarList()
  140. this.changetime='';
  141. }else{
  142. var time=y + '-' + m + '-' + '01'
  143. this.changetime=time
  144. this.getCalendarList(time)
  145. }
  146. },
  147. // 选中的日期
  148. getIsSelDayFn(e){
  149. if(e.sign&&e.sign.length){
  150. var date=e.sign[0].date;
  151. if(date==this.kaTime){
  152. var daySign=e.sign[0];
  153. this.datainfo=JSON.parse(JSON.stringify(daySign))
  154. }
  155. }
  156. },
  157. shrinkClick(e){
  158. console.log(e,3)
  159. },
  160. init() {
  161. // 就餐类型
  162. getDictionaryFn('jiucan').then(res=>{
  163. if(res.code==200){
  164. this.jclxlist = res.data.map(v => {
  165. return {
  166. label: v.dictLabel,
  167. value: v.dictValue
  168. }
  169. })
  170. }
  171. })
  172. },
  173. getCalendarList(itime) {
  174. var time=this.kaTime
  175. if(itime){
  176. time=itime
  177. }
  178. var params = {
  179. orderFoodTime: time,
  180. }
  181. params.orderFoodUserId=this.userId;
  182. getFoodRiLi(params).then(res => {
  183. if (res.code == 200) {
  184. this.signList=res.data;
  185. } else {
  186. this.$toast(res.msg)
  187. }
  188. })
  189. },
  190. },
  191. }
  192. </script>
  193. <style>
  194. /* page {
  195. background: #ffffff;
  196. } */
  197. </style>
  198. <style lang="scss" scoped>
  199. .navbox{position: fixed;left: 0;right: 0;top: 0;z-index: 4; }
  200. .navbg{width: 100%;height: 692rpx;}
  201. .zxmain{position: relative;padding: 20rpx 32rpx 40rpx;box-sizing: border-box;display: flex;}
  202. .ytbox{width: 684rpx;margin: 0 auto;padding-top: 24rpx;position: relative;flex: 1;overflow: auto;background-color: #ffffff;padding-bottom: 12rpx;border-radius: 14rpx;
  203. .ytop{padding: 16rpx 0 24rpx 16rpx;
  204. .tit{width: 62rpx;height: 62rpx;background: #0391FD;border-radius: 6rpx;font-weight: 500;
  205. font-size: 34rpx;color: #FFFFFF;margin-right: 18rpx;text-align: center;line-height: 62rpx;flex: 0 0 auto;}
  206. .cent{
  207. flex: 1;
  208. .ctit{font-weight: bold;font-size: 28rpx;color: #161616;margin-bottom: 6rpx;}
  209. .ctime{font-weight: 500;font-size: 18rpx;color: #666666;}
  210. }
  211. }
  212. .tips{font-weight: 500;font-size: 26rpx;color: #888888;padding-left: 34rpx;margin-bottom: 24rpx;}
  213. // 步骤条
  214. .steps{position: relative;display: flex;padding-bottom:40rpx;
  215. &::after{
  216. content: '';position: absolute;left:6rpx;top: 34rpx;bottom: 4rpx;background-color: #DADADA;width: 2rpx;
  217. }
  218. .cir{width: 14rpx;height: 14rpx;background: #AFAFAF;border-radius: 50%;flex: 0 0 auto;margin-right: 38rpx;margin-top: 13rpx;}
  219. .stepsa{flex: 1;
  220. .steptit{font-weight: bold;font-size: 28rpx;color: #161616;margin-bottom: 20rpx;}
  221. .steptxt{display: flex;
  222. image{width: 20rpx;height: 20rpx;margin-right: 14rpx;flex: 0 0 auto;margin-top: 7rpx;}
  223. view{font-weight: bold;font-size: 26rpx;color: #888888;}
  224. }
  225. }
  226. }
  227. }
  228. </style>