自主产品,供应链食堂系统。将两个端拆开了。
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.

132 lines
2.8 KiB

5 years ago
  1. <template>
  2. <view>
  3. <view class="lf-row-center lf-flex-column head" v-if="$isRight(canteen)">
  4. <image :src="canteen.avatar"></image>
  5. <view class="lf-m-t-20 lf-font-32 lf-font-bold lf-color-black">{{ canteen.name }}</view>
  6. <view class="lf-font-28 lf-color-555 lf-m-t-10">{{ canteen.role }}</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" v-if="$isRight(canteen)">
  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. // todo 优化:显示订单角标
  37. this.getHomeData();
  38. },
  39. onReady(){
  40. // #ifndef MP
  41. var a = document.getElementsByClassName('uni-page-head-hd')[0];
  42. a.style.display = 'none';
  43. // #endif
  44. },
  45. methods: {
  46. getHomeData(){
  47. this.$http(this.API.API_CANTEEN_INDEX).then(res => {
  48. console.log("getHomeData", res);
  49. this.block_list = res.data.block;
  50. this.canteen = res.data.canteen;
  51. uni.setNavigationBarTitle({
  52.   title: this.canteen.user.canteen.canteen_name
  53. })
  54. })
  55. },
  56. // 退出登录
  57. loginOut(){
  58. uni.showModal({
  59. title: '温馨提示',
  60. content: '确定退出登录吗?',
  61. confirmColor: '#11D189',
  62. success: result => {
  63. if(result.confirm){
  64. uni.removeStorageSync('canteen_token');
  65. this.$redirectToLogin('您已退出登录, 即将跳转...');
  66. }
  67. }
  68. })
  69. }
  70. }
  71. }
  72. </script>
  73. <style>
  74. page{
  75. background-color: #F6F6F6;
  76. }
  77. </style>
  78. <style lang="scss" scoped="scoped">
  79. .head{
  80. height: 374rpx;
  81. width: 750rpx;
  82. background-color: #FFFFFF;
  83. image{
  84. width: 200rpx;
  85. height: 200rpx;
  86. border: 2rpx solid #FFFFFF;
  87. border-radius: 50%;
  88. }
  89. }
  90. .list{
  91. margin-top: 20rpx;
  92. padding: 0 32rpx;
  93. background-color: #FFFFFF;
  94. width: 100%;
  95. height: auto;
  96. }
  97. .list-item{
  98. border-bottom: 1rpx solid #EEEEEE;
  99. height: 110rpx;
  100. box-sizing: border-box;
  101. position: relative;
  102. .icon-img{
  103. width: 50rpx;
  104. height: 50rpx;
  105. }
  106. .feedback-btn{
  107. position: absolute;
  108. width: 100%;
  109. height: 100%;
  110. z-index: 1;
  111. background: transparent;
  112. }
  113. &:last-child{
  114. border-bottom: none;
  115. }
  116. }
  117. .exit{
  118. padding: 0 32rpx;
  119. // bottom: 50rpx;
  120. padding-top: 10rpx;
  121. padding-bottom: 50rpx;
  122. box-sizing: border-box;
  123. background-color: #F6F6F6;
  124. button{
  125. background-color: #f0f0f0;
  126. color: #777777;
  127. }
  128. }
  129. </style>