eatlistday.vue 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233
  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. // 3c8cadac11af4f1298a2882addc8788d
  103. },
  104. onShow() {},
  105. methods: {
  106. checkPermi,
  107. checkRole,
  108. getBack() {
  109. uni.navigateBack({
  110. delta: 1
  111. })
  112. },
  113. time(){
  114. var date = new Date();
  115. var y = date.getFullYear();
  116. var m = date.getMonth() + 1;
  117. var d = date.getDate();
  118. // var h = date.getHours();
  119. // var min = date.getMinutes();
  120. // var s = date.getSeconds();
  121. // var week = date.getDay(); //获取当前星期X(0-6,0代表星期天)
  122. // var weeks = ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"];
  123. var yearStr = y + '-' + (m < 10 ? ('0' + m) : m) + '-' + (d < 10 ? ('0' + d) : d)
  124. // var timeStr = (h < 10 ? ('0' + h) : h) + ':' + (min < 10 ? ('0' + min) : min) + ':' + (s < 10 ? (
  125. // '0' + s) : s);
  126. this.year=y;
  127. this.month=m < 10 ? ('0' + m) : m;
  128. this.kaTime = yearStr
  129. },
  130. dayChange(e){
  131. if(e.daySign&&e.daySign.length){
  132. var daySign=e.daySign[0];
  133. this.datainfo=JSON.parse(JSON.stringify(daySign))
  134. }
  135. },
  136. monthChange(e){
  137. var y=e.year;
  138. var m=e.month;
  139. if(y==this.year&&m==this.month){
  140. this.getCalendarList()
  141. this.changetime='';
  142. }else{
  143. var time=y + '-' + m + '-' + '01'
  144. this.changetime=time
  145. this.getCalendarList(time)
  146. }
  147. },
  148. // 选中的日期
  149. getIsSelDayFn(e){
  150. if(e.sign&&e.sign.length){
  151. var date=e.sign[0].date;
  152. if(date==this.kaTime){
  153. var daySign=e.sign[0];
  154. this.datainfo=JSON.parse(JSON.stringify(daySign))
  155. }
  156. }
  157. },
  158. shrinkClick(e){
  159. console.log(e,3)
  160. },
  161. init() {
  162. // 就餐类型
  163. getDictionaryFn('jiucan').then(res=>{
  164. if(res.code==200){
  165. this.jclxlist = res.data.map(v => {
  166. return {
  167. label: v.dictLabel,
  168. value: v.dictValue
  169. }
  170. })
  171. }
  172. })
  173. },
  174. getCalendarList(itime) {
  175. var time=this.kaTime
  176. if(itime){
  177. time=itime
  178. }
  179. var params = {
  180. orderFoodTime: time,
  181. }
  182. params.orderFoodUserId=this.userId;
  183. getFoodRiLi(params).then(res => {
  184. if (res.code == 200) {
  185. this.signList=res.data;
  186. } else {
  187. this.$toast(res.msg)
  188. }
  189. })
  190. },
  191. },
  192. }
  193. </script>
  194. <style>
  195. /* page {
  196. background: #ffffff;
  197. } */
  198. </style>
  199. <style lang="scss" scoped>
  200. .navbox{position: fixed;left: 0;right: 0;top: 0;z-index: 4; }
  201. .navbg{width: 100%;height: 692rpx;}
  202. .zxmain{position: relative;padding: 20rpx 32rpx 40rpx;box-sizing: border-box;display: flex;}
  203. .ytbox{width: 684rpx;margin: 0 auto;padding-top: 24rpx;position: relative;flex: 1;overflow: auto;background-color: #ffffff;padding-bottom: 12rpx;border-radius: 14rpx;
  204. .ytop{padding: 16rpx 0 24rpx 16rpx;
  205. .tit{width: 62rpx;height: 62rpx;background: #0391FD;border-radius: 6rpx;font-weight: 500;
  206. font-size: 34rpx;color: #FFFFFF;margin-right: 18rpx;text-align: center;line-height: 62rpx;flex: 0 0 auto;}
  207. .cent{
  208. flex: 1;
  209. .ctit{font-weight: bold;font-size: 28rpx;color: #161616;margin-bottom: 6rpx;}
  210. .ctime{font-weight: 500;font-size: 18rpx;color: #666666;}
  211. }
  212. }
  213. .tips{font-weight: 500;font-size: 26rpx;color: #888888;padding-left: 34rpx;margin-bottom: 24rpx;}
  214. // 步骤条
  215. .steps{position: relative;display: flex;padding-bottom:40rpx;
  216. &::after{
  217. content: '';position: absolute;left:6rpx;top: 34rpx;bottom: 4rpx;background-color: #DADADA;width: 2rpx;
  218. }
  219. .cir{width: 14rpx;height: 14rpx;background: #AFAFAF;border-radius: 50%;flex: 0 0 auto;margin-right: 38rpx;margin-top: 13rpx;}
  220. .stepsa{flex: 1;
  221. .steptit{font-weight: bold;font-size: 28rpx;color: #161616;margin-bottom: 20rpx;}
  222. .steptxt{display: flex;
  223. image{width: 20rpx;height: 20rpx;margin-right: 14rpx;flex: 0 0 auto;margin-top: 7rpx;}
  224. view{font-weight: bold;font-size: 26rpx;color: #888888;}
  225. }
  226. }
  227. }
  228. }
  229. </style>