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

155 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. <lf-image class="image" :src="canteen.avatar" errSrc="../../static/images/default_avatar.png"></lf-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. this.getHomeData();
  40. },
  41. onReady() {
  42. // #ifndef MP
  43. var a = document.getElementsByClassName('uni-page-head-hd')[0];
  44. a.style.display = 'none';
  45. // #endif
  46. },
  47. methods: {
  48. getHomeData() {
  49. this.$http(this.API.API_CANTEEN_INDEX).then(res => {
  50. console.log("getHomeData", res);
  51. this.block_list = res.data.block;
  52. this.canteen = res.data.canteen;
  53. uni.setNavigationBarTitle({
  54. title: this.canteen.user.canteen.canteen_name
  55. })
  56. })
  57. },
  58. // 退出登录
  59. loginOut() {
  60. uni.showModal({
  61. title: '温馨提示',
  62. content: '确定退出登录吗?',
  63. confirmColor: '#11D189',
  64. success: result => {
  65. if (result.confirm) {
  66. uni.removeStorageSync('canteen_token');
  67. this.$redirectToLogin('您已退出登录, 即将跳转...');
  68. }
  69. }
  70. })
  71. }
  72. }
  73. }
  74. </script>
  75. <style>
  76. page {
  77. background-color: #F6F6F6;
  78. }
  79. </style>
  80. <style lang="scss" scoped="scoped">
  81. .message-tag {
  82. width: 60rpx;
  83. height: 40rpx;
  84. font-size: 28rpx;
  85. background-color: red;
  86. border-radius: 20rpx;
  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>