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

156 lines
3.3 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
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 v-if="item.unread">
  17. <view class="message-tag" v-if="item.unread < 99">{{item.unread}}</view>
  18. <view class="message-tag" v-else>99+</view>
  19. </view>
  20. <u-icon name="arrow-right"></u-icon>
  21. </view>
  22. </view>
  23. </view>
  24. <view style="height: 170rpx;"></view>
  25. <view class="btn-bottom exit" v-if="$isRight(canteen)">
  26. <button class="lf-w-100" @click="loginOut">退出登录</button>
  27. </view>
  28. </view>
  29. </template>
  30. <script>
  31. export default {
  32. data() {
  33. return {
  34. canteen: {},
  35. block_list: []
  36. }
  37. },
  38. onLoad() {
  39. // todo 优化:显示订单角标
  40. this.getHomeData();
  41. },
  42. onReady() {
  43. // #ifndef MP
  44. var a = document.getElementsByClassName('uni-page-head-hd')[0];
  45. a.style.display = 'none';
  46. // #endif
  47. },
  48. methods: {
  49. getHomeData() {
  50. this.$http(this.API.API_CANTEEN_INDEX).then(res => {
  51. console.log("getHomeData", res);
  52. this.block_list = res.data.block;
  53. this.canteen = res.data.canteen;
  54. uni.setNavigationBarTitle({
  55. title: this.canteen.user.canteen.canteen_name
  56. })
  57. })
  58. },
  59. // 退出登录
  60. loginOut() {
  61. uni.showModal({
  62. title: '温馨提示',
  63. content: '确定退出登录吗?',
  64. confirmColor: '#11D189',
  65. success: result => {
  66. if (result.confirm) {
  67. uni.removeStorageSync('canteen_token');
  68. this.$redirectToLogin('您已退出登录, 即将跳转...');
  69. }
  70. }
  71. })
  72. }
  73. }
  74. }
  75. </script>
  76. <style>
  77. page {
  78. background-color: #F6F6F6;
  79. }
  80. </style>
  81. <style lang="scss" scoped="scoped">
  82. .message-tag {
  83. width: 60rpx;
  84. height: 60rpx;
  85. background-color: red;
  86. border-radius: 50%;
  87. margin-right: 10rpx;
  88. text-align: center;
  89. align-items: center;
  90. color: white;
  91. display: flex;
  92. justify-content: space-around;
  93. }
  94. .head {
  95. height: 374rpx;
  96. width: 750rpx;
  97. background-color: #FFFFFF;
  98. image {
  99. width: 200rpx;
  100. height: 200rpx;
  101. border: 2rpx solid #FFFFFF;
  102. border-radius: 50%;
  103. }
  104. }
  105. .list {
  106. margin-top: 20rpx;
  107. padding: 0 32rpx;
  108. background-color: #FFFFFF;
  109. width: 100%;
  110. height: auto;
  111. }
  112. .list-item {
  113. border-bottom: 1rpx solid #EEEEEE;
  114. height: 110rpx;
  115. box-sizing: border-box;
  116. position: relative;
  117. .icon-img {
  118. width: 50rpx;
  119. height: 50rpx;
  120. }
  121. .feedback-btn {
  122. position: absolute;
  123. width: 100%;
  124. height: 100%;
  125. z-index: 1;
  126. background: transparent;
  127. }
  128. &:last-child {
  129. border-bottom: none;
  130. }
  131. }
  132. .exit {
  133. padding: 0 32rpx;
  134. // bottom: 50rpx;
  135. padding-top: 10rpx;
  136. padding-bottom: 50rpx;
  137. box-sizing: border-box;
  138. background-color: #F6F6F6;
  139. button {
  140. background-color: #f0f0f0;
  141. color: #777777;
  142. }
  143. }
  144. </style>