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