index.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562
  1. <template>
  2. <view>
  3. <view class="navbox">
  4. <uni-nav-bar color="#ffffff" leftWidth='340rpx' :background-color="backgroundColor" :border="false" statusBar='true' fixed="true">
  5. </uni-nav-bar>
  6. </view>
  7. <!-- 主体 -->
  8. <image :src="navbg" class="navbg"></image>
  9. <view class="yymain" :style="'margin-top:-'+marTop+'rpx;'">
  10. <!-- 顶部 -->
  11. <view class="yqtop flexcj">
  12. <view class="yqtopl">
  13. <view class="tit mb10">潜山经济开发区</view>
  14. <view class="txt">安徽中新云智慧园区服务平台</view>
  15. </view>
  16. <view class="yqtopr">
  17. <view class="flexc mb4">
  18. <image class="wimg" :src="weathericon"></image>
  19. <view class="txt ml6">7月18日</view>
  20. </view>
  21. <view class="txt">农历六月十三</view>
  22. </view>
  23. </view>
  24. <!-- 卡片 -->
  25. <view class="yqcard">
  26. <view class="yqctop flexcj">
  27. <view class="yqctopl flexc">
  28. <image :src="headimg"></image>
  29. <view class="over">何小西</view>
  30. </view>
  31. <view class="yqctopr flexcc">
  32. <image :src="newsimg"></image>
  33. <view class="tit">消息</view>
  34. <view class="cir"></view>
  35. </view>
  36. </view>
  37. <view class="pdlr2">
  38. <view class="yqcbox">
  39. <view class="yqcba" @click="getClockFn">
  40. <view class="aimg"><image :src="htabaimg" class="imga"></image></view>
  41. <view class="atit">打卡记录</view>
  42. </view>
  43. <view class="yqcba" @click="getMeetFn">
  44. <view class="aimg"><image :src="htabbimg" class="imgb"></image></view>
  45. <view class="atit">会议预订</view>
  46. </view>
  47. <view class="yqcba" @click="getEatFn">
  48. <view class="aimg"><image :src="htabcimg" class="imgc"></image></view>
  49. <view class="atit">订餐预订</view>
  50. </view>
  51. <view class="yqcba">
  52. <view class="aimg"><image :src="htabdimg" class="imgd"></image></view>
  53. <view class="atit">访客预约</view>
  54. </view>
  55. <view class="yqcba">
  56. <view class="aimg"><image :src="htabeimg" class="imge"></image></view>
  57. <view class="atit">预约管理</view>
  58. </view>
  59. <view class="yqcba">
  60. <view class="aimg"><image :src="htabfimg" class="imgf"></image></view>
  61. <view class="atit">访客管理</view>
  62. </view>
  63. <view class="yqcba">
  64. <view class="aimg"><image :src="htabgimg" class="imgg"></image></view>
  65. <view class="atit">访客记录</view>
  66. </view>
  67. <view class="yqcba">
  68. <view class="aimg"><image :src="htabhimg" class="imgh"></image></view>
  69. <view class="atit">敬请期待</view>
  70. </view>
  71. </view>
  72. </view>
  73. </view>
  74. <!-- 通知 -->
  75. <view class="mb10">
  76. <notice :noticelist="noticelist" :activeColor="activeColor" :nactiveColor="nactiveColor" :autoplay='autoplay' @getNoticeDet="getNoticeDet"></notice>
  77. </view>
  78. <!-- 统计 -->
  79. <view class="yqcont yqconta">
  80. <view class="yqcl">
  81. <view class="yqcla">
  82. <image :src="hbgaimg" class="cbgimg"></image>
  83. <view class="cbox">
  84. <view class="tit mb5">来访数</view>
  85. <view class="tit"><text>613</text>位</view>
  86. </view>
  87. </view>
  88. <view class="yqcla">
  89. <image :src="hbgbimg" class="cbgimg"></image>
  90. <view class="cbox">
  91. <view class="tit mb5">本月预约</view>
  92. <view class="tit"><text>613</text>位</view>
  93. </view>
  94. </view>
  95. <view class="yqcla">
  96. <image :src="hbgcimg" class="cbgimg"></image>
  97. <view class="cbox">
  98. <view class="tit mb5">今日来访</view>
  99. <view class="tit"><text>613</text>位</view>
  100. </view>
  101. </view>
  102. <view class="yqcla">
  103. <image :src="hbgdimg" class="cbgimg"></image>
  104. <view class="cbox">
  105. <view class="tit mb5">今日预约</view>
  106. <view class="tit"><text>613</text>位</view>
  107. </view>
  108. </view>
  109. </view>
  110. <view class="yqcr">
  111. <image :src="hbgeimg" class="cbgimg"></image>
  112. <view class="cbox">
  113. <view class="cboxa flexc">
  114. <image :src="dayimg" class="dayimg"></image>
  115. <view class="num">1,037</view>
  116. </view>
  117. <view class="flexcc">
  118. <view class="cboxb">
  119. <view class="tit mb5">中餐</view>
  120. <view class="tit"><text>732</text>位</view>
  121. </view>
  122. <view class="cboxb">
  123. <view class="tit mb5">晚餐</view>
  124. <view class="tit"><text>732</text>位</view>
  125. </view>
  126. </view>
  127. </view>
  128. </view>
  129. </view>
  130. <!-- 普通用户看到的 -->
  131. <view class="yqcont">
  132. <view class="yqcb">
  133. <image :src="hbgfimg" class="cbgimg"></image>
  134. <view class="cbox flexc">
  135. <view class="cboxb flexc pl10">
  136. <image :src="dayimg" class="dayimg"></image>
  137. <view class="num pr4">1,037</view>
  138. </view>
  139. <view class="cboxb">
  140. <view class="tit"><view class="tita">中餐</view><text>732</text>位</view>
  141. <view class="tit"><view class="tita">晚餐</view><text>732</text>位</view>
  142. </view>
  143. </view>
  144. </view>
  145. </view>
  146. <!-- 管理员 -->
  147. <view class="yylists">
  148. <view class="yyltab flexcj">
  149. <view class="left flexc">待审批列表<image :src="listline"></image></view>
  150. <view class="right" @click="getMoreFn">查看更多 >></view>
  151. </view>
  152. <!-- 列表 -->
  153. <view>
  154. <y-list type='order' :datalist="list" :wtdt="wtdt" @getDetail='getDetail' :adrlist="adrlist" @getDelFn="getDelFn" @gettypeFn="gettypeFn"></y-list>
  155. </view>
  156. </view>
  157. <!-- 普通用户 -->
  158. <view class="yylists">
  159. <view class="yyltab flexcj">
  160. <view class="left flexc">本周打卡记录<image :src="listline"></image></view>
  161. <view class="right" @click="getMoreFn">查看更多 >></view>
  162. </view>
  163. <!-- 列表 -->
  164. <view>
  165. <y-list type='record' :datalist="list" :wtdt="wtdt" @getDetail='getDetail' :adrlist="adrlist" @getDelFn="getDelFn" @gettypeFn="gettypeFn"></y-list>
  166. </view>
  167. </view>
  168. </view>
  169. <footers v-if="isfootflag" :footerindex="footerindex"></footers>
  170. </view>
  171. </template>
  172. <script>
  173. import { checkPermi, checkRole } from "@/utils/permission"; // 权限判断函数
  174. import self from '@/utils/location.js';
  175. import yList from "@/components/order/list.vue"
  176. import notice from "@/components/swiper/notice.vue"
  177. let { calendar } = require("@/components/lunc-calendar/calendar.js");
  178. import {getReservatcountl,getReservatList,getReservatDel,getReservatSh} from "@/api/mine/order.js"
  179. import {getDictionaryFn} from "@/api/mine/register.js"
  180. import footers from '@/components/footer/footer.vue'
  181. export default {
  182. components:{notice,yList,footers},
  183. data(){
  184. return{
  185. footerindex:'home',
  186. isfootflag:true,
  187. navbg:require("@/static/images/navbg.png"),
  188. headimg:require("@/static/images/home/head.png"),
  189. htabaimg:require("@/static/images/home/htaba.png"),
  190. htabbimg:require("@/static/images/home/htabb.png"),
  191. htabcimg:require("@/static/images/home/htabc.png"),
  192. htabdimg:require("@/static/images/home/htabd.png"),
  193. htabeimg:require("@/static/images/home/htabe.png"),
  194. htabfimg:require("@/static/images/home/htabf.png"),
  195. htabgimg:require("@/static/images/home/htabg.png"),
  196. htabhimg:require("@/static/images/home/htabh.png"),
  197. hbgaimg:require("@/static/images/home/hbga.png"),
  198. hbgbimg:require("@/static/images/home/hbgb.png"),
  199. hbgcimg:require("@/static/images/home/hbgc.png"),
  200. hbgdimg:require("@/static/images/home/hbgd.png"),
  201. hbgeimg:require("@/static/images/home/hbge.png"),
  202. hbgfimg:require("@/static/images/home/hbgf.png"),
  203. hbggimg:require("@/static/images/home/hbgg.png"),
  204. hbghimg:require("@/static/images/home/hbgh.png"),
  205. newsimg:require("@/static/images/home/news.png"),
  206. timeimg:require("@/static/images/home/time.png"),
  207. dayimg:require("@/static/images/home/day.png"),
  208. listline:require("@/static/images/order/staff/listline.png"),
  209. autoplay:false,
  210. activeColor:'#A7CDF9',
  211. nactiveColor:'#DADADA',
  212. backgroundColor: "transparent",
  213. city:'',
  214. weather:'',
  215. temperature:'',
  216. list:[{visitType:1,visitName:'王一',createTime:"2024-01-20 17:12:38",visitDate:"2024-01-21",
  217. visitTime:'10:00 - 11:00',visitPhone:'18956988888',visitNum:'1',appointmentSite:"总经理办公室",visitReason:'会议'
  218. }],
  219. noticelist:[{noticeTitle:'您今日还未订餐喔,请立即前往预订…',createTime:'07-17'},{noticeTitle:'您今日还未订餐喔,请立即前往预订…',createTime:'07-17'}],
  220. adrlist:[],
  221. pageSize: 10,
  222. pageNum: 1,
  223. reachflag: false,
  224. nvaHeight:44,
  225. marTop:0,//距离顶部的距离
  226. stubarHeight:0,//
  227. wtdt:'',
  228. daytime:'',
  229. lunar:'',
  230. weathericon:require("@/static/images/weather/weaionf.png"),
  231. }
  232. },
  233. onPageScroll(e) {
  234. var scrollTop = Number(e.scrollTop);
  235. if (scrollTop > 0) {
  236. this.backgroundColor = '#0491FD'
  237. } else {
  238. this.backgroundColor = 'transparent'
  239. }
  240. },
  241. onUnload() {
  242. uni.$off('refreshdatalist')
  243. },
  244. onLoad: function() {
  245. uni.getSystemInfo({
  246. success: (e) => {
  247. this.stubarHeight=Number(e.statusBarHeight);
  248. this.nvaHeight = Number(e.statusBarHeight)+44;
  249. this.marTop=692-Number(this.nvaHeight*2)-16;
  250. }
  251. })
  252. return
  253. uni.$on('refreshdatalist',(e) => {
  254. this.reachflag=false;
  255. this.pageNum=1;
  256. this.list=[];
  257. this.getDataFn();
  258. // this.getcount();
  259. })
  260. this.init()
  261. // this.getcount()
  262. this.getDataFn()
  263. uni.getSystemInfo({
  264. success: (e) => {
  265. this.stubarHeight=Number(e.statusBarHeight);
  266. this.nvaHeight = Number(e.statusBarHeight)+44;
  267. this.marTop=692-Number(this.nvaHeight*2)-16;
  268. }
  269. })
  270. },
  271. mounted() {
  272. this.getHeightFn()
  273. },
  274. onShow() {
  275. var that=this;
  276. this.time();
  277. // #ifndef H5
  278. self.getLocation(function(res){
  279. if(res==-1){
  280. that.setflag=true
  281. }else{
  282. // that.getAdrinfoFn(res)
  283. // that.location = `${res.lng},${res.lat}`
  284. that.city=res.city;
  285. that.temperature=res.temperature;
  286. that.weather=res.weather;
  287. that.weathericon=res.icon;
  288. }
  289. })
  290. // #endif
  291. },
  292. mounted() {
  293. },
  294. // 上拉触底加载更多触发事件
  295. onReachBottom() {
  296. if (this.reachflag) {
  297. this.pageNum++
  298. this.getDataFn()
  299. }
  300. },
  301. methods:{
  302. checkPermi, checkRole,
  303. getHeightFn(){
  304. let query = uni.createSelectorQuery().in(this);
  305. //需要给黄色区域设置一个id标识,在这里是demo
  306. query.select('.navbox').boundingClientRect(data => {
  307. var top=data.top<0 ? -data.top : data.top;
  308. var stubarHeight=Number(this.stubarHeight);
  309. if (top <=this.nvaHeight) {
  310. const opacity = top / 100 // 计算透明度值
  311. const color = `rgba(4, 145, 253, ${opacity})`
  312. this.backgroundColor = color // 更新盒子背景颜色
  313. } else {
  314. this.backgroundColor = '#00A9F0'
  315. }
  316. }).exec();
  317. },
  318. getNoticeDet(e){
  319. // this.$tab.navigateTo("/pages/index/noticedetail?type=xttz&id="+e)
  320. },
  321. //打卡记录
  322. getClockFn(){
  323. this.$tab.navigateTo("/work/pages/record/clockin")
  324. },
  325. // 就餐预定
  326. getEatFn(){
  327. this.$tab.navigateTo("/work/pages/yyorder/eat")
  328. },
  329. // 会议预定
  330. getMeetFn(){
  331. this.$tab.navigateTo("/work/pages/yyorder/meeting")
  332. },
  333. init(){
  334. // 记录来源
  335. getDictionaryFn('jluly').then(res=>{
  336. if(res.code==200){
  337. this.adrlist = res.data.map(v => {
  338. return {
  339. dictLabel: v.dictLabel,
  340. dictValue: Number(v.dictValue)
  341. }
  342. })
  343. }
  344. })
  345. },
  346. getMoreFn(){
  347. this.$tab.navigateTo("/pages/order/list")
  348. },
  349. getDelFn(id){
  350. var that=this;
  351. getReservatDel(id).then(res=>{
  352. if(res.code==200){
  353. that.$toast('删除成功')
  354. setTimeout(function(){
  355. that.reachflag=true;
  356. that.pageNum=1;
  357. that.list=[];
  358. that.getDataFn();
  359. // that.getcount();
  360. },1500)
  361. }else{
  362. that.$toast(res.msg)
  363. }
  364. })
  365. },
  366. gettypeFn(ite){
  367. var that=this;
  368. var params={
  369. reservatId:ite.id,
  370. visitType:ite.type
  371. }
  372. getReservatSh(params).then(res=>{
  373. if(res.code==200){
  374. that.$toast('审核成功')
  375. setTimeout(function(){
  376. that.reachflag=true;
  377. that.pageNum=1;
  378. that.list=[];
  379. that.getDataFn();
  380. // that.getcount();
  381. },1500)
  382. }else{
  383. that.$toast(res.msg)
  384. }
  385. })
  386. },
  387. time() {
  388. var date = new Date();
  389. var y = date.getFullYear();
  390. var m = date.getMonth() + 1;
  391. var d = date.getDate();
  392. let lunar = calendar.solar2lunar(y, m, d); //农历
  393. this.lunar=lunar.IMonthCn+lunar.IDayCn;
  394. this.daytime=m+'月'+d+"日";
  395. // var h = date.getHours();
  396. // var min = date.getMinutes();
  397. // var s = date.getSeconds();
  398. // var week = date.getDay(); //获取当前星期X(0-6,0代表星期天)
  399. // var weeks = ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"];
  400. // var yearStr = y + '-' + (m < 10 ? ('0' + m) : m) + '-' + (d < 10 ? ('0' + d) : d)
  401. // var timeStr = (h < 10 ? ('0' + h) : h) + ':' + (min < 10 ? ('0' + min) : min) + ':' + (s < 10 ? (
  402. // '0' + s) : s);
  403. // this.kaTime = yearStr + ' ' + timeStr;
  404. },
  405. getcount(){
  406. getReservatcountl().then(res=>{
  407. if(res.code==200){
  408. this.conuntinfo=res.data
  409. }else{
  410. this.$toast(res.msg)
  411. }
  412. })
  413. },
  414. getDetail(data){
  415. this.$tab.navigateTo('/pages/order/staffcode?type=look&id='+data)
  416. },
  417. getDataFn(){
  418. var params={
  419. pageSize:this.pageSize,
  420. pageNum: this.pageNum,
  421. // visitType:3
  422. }
  423. getReservatList(params).then(res=>{
  424. if(res.code==200){
  425. if (res.rows.length < this.pageSize) {
  426. this.reachflag = false
  427. this.wtdt = '到底了~';
  428. } else {
  429. var num = parseInt(res.rows.length) + parseInt(this.pageSize) * parseInt(this.pageNum - 1)
  430. if (num < res.total) {
  431. this.reachflag = true
  432. this.wtdt = '上拉加载更多'
  433. } else {
  434. this.reachflag = false
  435. this.wtdt = '到底了~';
  436. }
  437. }
  438. if (this.pageNum == 1) {
  439. this.list = res.rows;
  440. } else {
  441. this.list = this.list.concat(res.rows)
  442. }
  443. }else{
  444. this.$toast(res.msg)
  445. }
  446. })
  447. },
  448. },
  449. }
  450. </script>
  451. <style lang="scss" scoped>
  452. // .navbox{
  453. // .navbg{width: 100%;height: 692rpx;position: fixed;left: 0;right: 0;top: 0;z-index: 1;}
  454. // }
  455. .navbox{position: fixed;left: 0;right: 0;top: 0;z-index: 4; }
  456. .navbg{width: 100%;height: 692rpx;}
  457. .navleft{padding-left: 12rpx;
  458. view{font-weight: bold;font-size: 26rpx;color: #FFFFFF;line-height: 36rpx;}
  459. }
  460. .navright{width: 40rpx;height: 40rpx;}
  461. .yymain{flex: 1;z-index: 2;position: relative;padding: 0 32rpx;}
  462. // 时间
  463. .yqtop{margin-bottom: 16rpx;
  464. .yqtopl{
  465. .tit{font-weight: bold;font-size: 30rpx;color: #FFFFFF;}
  466. }
  467. .yqtopr{
  468. .wimg{width: 34rpx;height: 34rpx;}
  469. }
  470. .txt{font-weight: 500;font-size: 26rpx;color: #FFFFFF;}
  471. }
  472. .yqcard{background: #FFFFFF;margin-bottom: 20rpx;box-shadow: 0px 0px 6rpx 0px #DEDEDE;padding: 0 26rpx;border-radius: 14rpx;
  473. .yqctop{padding: 28rpx 0;
  474. .yqctopl{flex: 1;overflow: auto;
  475. image{width: 50rpx;height: 50rpx;border-radius: 50%;margin-right: 18rpx;}
  476. view{font-weight: 500;font-size: 26rpx;color: #161616;}
  477. }
  478. .yqctopr{position: relative;min-width: 118rpx;height: 48rpx;background: #DFEEFF;border-radius: 24rpx;
  479. image{width: 18rpx;height: 22rpx;margin-right: 10rpx;}
  480. .tit{font-weight: bold;font-size: 22rpx;color: #0391FD;}
  481. .cir{width: 14rpx;height: 14rpx;background: #FF5161;border-radius: 6rpx;right: 0rpx;top: -2rpx;position: absolute;
  482. }
  483. }
  484. }
  485. .yqcbox{border-top: 2rpx solid #E6E6E6;display: flex;flex-wrap: wrap;padding: 16rpx 0 14rpx;
  486. .yqcba{display: flex;flex-direction: column;align-items: center;padding: 24rpx 0;width: 25%;
  487. .aimg{width: 62rpx;height: 62rpx;display: flex;align-items: center;justify-content: center;margin-bottom: 24rpx;
  488. .imga{width: 60rpx;height: 60rpx;}
  489. .imgb{width: 54rpx;height: 62rpx;}
  490. .imgc{width: 60rpx;height: 58rpx;}
  491. .imgd{width: 58rpx;height: 62rpx;}
  492. .imge{width: 62rpx;height: 56rpx;}
  493. .imgf{width: 56rpx;height: 60rpx;}
  494. .imgg{width: 56rpx;height: 62rpx;}
  495. .imgh{width: 54rpx;height: 60rpx;}
  496. }
  497. .atit{font-weight: 500;font-size: 22rpx;color: #161616;}
  498. }
  499. }
  500. }
  501. // 统计
  502. .yqcont{padding: 16rpx;background: #FFFFFF;box-shadow: 0px 0px 6rpx 0px #DEDEDE;border-radius: 14rpx;display: flex;justify-content: space-between;box-sizing: border-box;
  503. &.yqconta{padding-bottom: 0;min-height: 244rpx;}
  504. .cbgimg{width: 100%;height: 100%;}
  505. .cbox{position: absolute;left: 0;right: 0;top: 0;bottom: 0;box-sizing: border-box;padding: 16rpx 24rpx;
  506. .tit{font-weight: bold;font-size: 18rpx;color: #6A7582;
  507. text{font-size: 30rpx;color: #32415F;font-weight: bold;margin-right: 10rpx;}
  508. }
  509. }
  510. .dayimg{width: 76rpx;height: 44rpx;flex: 0 0 auto;}
  511. .num{font-weight: bold;font-size: 30rpx;color: #0A84FF;font-style: italic;flex: 1;text-align: center;}
  512. .cboxb{width: 50%;position: relative;padding-left: 24rpx;box-sizing: border-box;
  513. &::after{width: 2rpx;height: 28rpx;background: #AEB9CB;content: '';position: absolute;right: 0;top: 50%;margin-top: -14rpx;}
  514. &:nth-of-type(2n){
  515. &::after{display: none;}
  516. }
  517. .tit{
  518. text{margin-right: 8rpx;font-size: 20rpx;}
  519. }
  520. }
  521. .yqcl{flex: 1;display: flex;flex-wrap: wrap;
  522. .yqcla{width: 200rpx;height: 98rpx;position: relative;margin:0 16rpx 16rpx 0;
  523. }
  524. }
  525. .yqcr{
  526. position: relative;width: 218rpx;height:210rpx;flex: 0 0 auto;
  527. .cbox{padding: 0;padding-top: 18rpx;}
  528. .cboxa{margin-bottom: 16rpx;padding-left: 24rpx; }
  529. }
  530. .yqcb{width: 100%;height: 98rpx;position: relative;
  531. .cbox{padding-left: 0;
  532. .cboxb{min-width: 216rpx;width: auto;
  533. .tit{padding-left: 10rpx;display: flex;align-items: center;
  534. .tita{flex:0 0 auto;}
  535. text{margin-left: 26rpx;}
  536. }
  537. }
  538. }
  539. }
  540. }
  541. // 列表
  542. .yylists{width: 100%;margin: 42rpx auto 0;
  543. .yyltab{margin-bottom: 28rpx;
  544. .left{font-weight: bold;font-size: 15px;color: #161616;
  545. image{width: 110rpx;height: 14rpx;margin-left: 16rpx;}
  546. }
  547. .right{font-size: 500;font-size: 22rpx;color: #AAAAAA;}
  548. }
  549. }
  550. </style>