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

157 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
  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. onShow() {
  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: 52rpx;
  84. height: 52rpx;
  85. font-size: 16rpx;
  86. background-color: red;
  87. border-radius: 50%;
  88. margin-right: 10rpx;
  89. text-align: center;
  90. align-items: center;
  91. color: white;
  92. display: flex;
  93. justify-content: space-around;
  94. }
  95. .head {
  96. height: 374rpx;
  97. width: 750rpx;
  98. background-color: #FFFFFF;
  99. image {
  100. width: 200rpx;
  101. height: 200rpx;
  102. border: 2rpx solid #FFFFFF;
  103. border-radius: 50%;
  104. }
  105. }
  106. .list {
  107. margin-top: 20rpx;
  108. padding: 0 32rpx;
  109. background-color: #FFFFFF;
  110. width: 100%;
  111. height: auto;
  112. }
  113. .list-item {
  114. border-bottom: 1rpx solid #EEEEEE;
  115. height: 110rpx;
  116. box-sizing: border-box;
  117. position: relative;
  118. .icon-img {
  119. width: 50rpx;
  120. height: 50rpx;
  121. }
  122. .feedback-btn {
  123. position: absolute;
  124. width: 100%;
  125. height: 100%;
  126. z-index: 1;
  127. background: transparent;
  128. }
  129. &:last-child {
  130. border-bottom: none;
  131. }
  132. }
  133. .exit {
  134. padding: 0 32rpx;
  135. // bottom: 50rpx;
  136. padding-top: 10rpx;
  137. padding-bottom: 50rpx;
  138. box-sizing: border-box;
  139. background-color: #F6F6F6;
  140. button {
  141. background-color: #f0f0f0;
  142. color: #777777;
  143. }
  144. }
  145. </style>