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

153 lines
3.2 KiB

5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
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" v-for="(item, index) in block_list"
  10. :key="index" @click="$url(item.path)">
  11. <view class="lf-row-center">
  12. <image class="icon-img" :src="item.icon"></image>
  13. <text class="lf-text-vertical lf-m-l-20 lf-font-28 lf-color-black">{{ item.name }}</text>
  14. </view>
  15. <view class="lf-flex">
  16. <view class="message-tag" v-if="index == 1">1</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. .message-tag {
  80. width: 36rpx;
  81. height: 36rpx;
  82. background-color: red;
  83. border-radius: 50%;
  84. margin-right: 10rpx;
  85. text-align: center;
  86. align-content: center;
  87. color: white;
  88. display: flex;
  89. justify-content: space-around;
  90. }
  91. .head {
  92. height: 374rpx;
  93. width: 750rpx;
  94. background-color: #FFFFFF;
  95. image {
  96. width: 200rpx;
  97. height: 200rpx;
  98. border: 2rpx solid #FFFFFF;
  99. border-radius: 50%;
  100. }
  101. }
  102. .list {
  103. margin-top: 20rpx;
  104. padding: 0 32rpx;
  105. background-color: #FFFFFF;
  106. width: 100%;
  107. height: auto;
  108. }
  109. .list-item {
  110. border-bottom: 1rpx solid #EEEEEE;
  111. height: 110rpx;
  112. box-sizing: border-box;
  113. position: relative;
  114. .icon-img {
  115. width: 50rpx;
  116. height: 50rpx;
  117. }
  118. .feedback-btn {
  119. position: absolute;
  120. width: 100%;
  121. height: 100%;
  122. z-index: 1;
  123. background: transparent;
  124. }
  125. &:last-child {
  126. border-bottom: none;
  127. }
  128. }
  129. .exit {
  130. padding: 0 32rpx;
  131. // bottom: 50rpx;
  132. padding-top: 10rpx;
  133. padding-bottom: 50rpx;
  134. box-sizing: border-box;
  135. background-color: #F6F6F6;
  136. button {
  137. background-color: #f0f0f0;
  138. color: #777777;
  139. }
  140. }
  141. </style>