自主项目,食堂系统,前端uniapp
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

128 lines
2.7 KiB

  1. <template>
  2. <view>
  3. <view class="lf-row-center lf-flex-column head">
  4. <image :src="canteen.logo"></image>
  5. <view class="lf-m-t-20 lf-font-32 lf-font-bold lf-color-black">{{ canteen.ctl_man }}</view>
  6. <view class="lf-font-28 lf-color-555 lf-m-t-10">{{ canteen.purchase_man }}</view>
  7. </view>
  8. <view class="list">
  9. <view class="lf-row-between list-item" hover-class="lf-opacity"
  10. v-for="(item, index) in block_list" :key="index"
  11. @click="$url(item.path)">
  12. <view class="lf-row-center">
  13. <image class="icon-img" :src="item.icon"></image>
  14. <text class="lf-text-vertical lf-m-l-20 lf-font-28 lf-color-black">{{ item.name }}</text>
  15. </view>
  16. <view>
  17. <u-icon name="arrow-right"></u-icon>
  18. </view>
  19. </view>
  20. </view>
  21. <view style="height: 170rpx;"></view>
  22. <view class="btn-bottom exit">
  23. <button class="lf-w-100" @click="loginOut">退出登录</button>
  24. </view>
  25. </view>
  26. </template>
  27. <script>
  28. export default {
  29. data(){
  30. return {
  31. canteen: {},
  32. block_list: []
  33. }
  34. },
  35. onLoad(){
  36. this.getHomeData();
  37. },
  38. onReady(){
  39. // #ifndef MP
  40. var a = document.getElementsByClassName('uni-page-head-hd')[0];
  41. a.style.display = 'none';
  42. // #endif
  43. },
  44. methods: {
  45. getHomeData(){
  46. this.$http(this.API.API_CANTEEN_INDEX).then(res => {
  47. console.log("getHomeData", res);
  48. this.block_list = res.data.block;
  49. this.canteen = res.data.canteen;
  50. getApp().globalData.canteen_id = res.data.canteen.id;
  51. })
  52. },
  53. // 退出登录
  54. loginOut(){
  55. uni.showModal({
  56. title: '温馨提示',
  57. content: '确定退出登录吗?',
  58. confirmColor: '#11D189',
  59. success: result => {
  60. if(result.confirm){
  61. uni.removeStorageSync('canteen_token');
  62. this.$redirectToLogin('您已退出登录, 即将跳转...');
  63. }
  64. }
  65. })
  66. }
  67. }
  68. }
  69. </script>
  70. <style>
  71. page{
  72. background-color: #F6F6F6;
  73. }
  74. </style>
  75. <style lang="scss" scoped="scoped">
  76. .head{
  77. height: 374rpx;
  78. width: 750rpx;
  79. background-color: #FFFFFF;
  80. image{
  81. width: 200rpx;
  82. height: 200rpx;
  83. border: 2rpx solid #FFFFFF;
  84. border-radius: 50%;
  85. }
  86. }
  87. .list{
  88. margin-top: 20rpx;
  89. padding: 0 32rpx;
  90. background-color: #FFFFFF;
  91. width: 100%;
  92. height: auto;
  93. }
  94. .list-item{
  95. border-bottom: 1rpx solid #EEEEEE;
  96. height: 110rpx;
  97. box-sizing: border-box;
  98. position: relative;
  99. .icon-img{
  100. width: 50rpx;
  101. height: 50rpx;
  102. }
  103. .feedback-btn{
  104. position: absolute;
  105. width: 100%;
  106. height: 100%;
  107. z-index: 1;
  108. background: transparent;
  109. }
  110. &:last-child{
  111. border-bottom: none;
  112. }
  113. }
  114. .exit{
  115. padding: 0 32rpx;
  116. // bottom: 50rpx;
  117. padding-top: 10rpx;
  118. padding-bottom: 50rpx;
  119. box-sizing: border-box;
  120. background-color: #F6F6F6;
  121. button{
  122. background-color: #f0f0f0;
  123. color: #777777;
  124. }
  125. }
  126. </style>