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

151 lines
3.4 KiB

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(supplier)">
  4. <image :src="supplier.avatar" v-if="supplier.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">{{ supplier.name }}</view>
  7. <view class="lf-font-28 lf-color-555 lf-m-t-10">{{ supplier.role }}</view>
  8. </view>
  9. <view class="list">
  10. <view class="lf-row-between list-item" hover-class="lf-opacity"
  11. v-for="(item, index) in block_list" :key="index"
  12. @click="$url(item.path)">
  13. <view class="lf-row-center">
  14. <image class="icon-img" :src="item.icon"></image>
  15. <text class="lf-text-vertical lf-m-l-20 lf-font-28 lf-color-black">{{ item.name }}</text>
  16. </view>
  17. <view class="lf-flex">
  18. <view v-if="item.unread">
  19. <view class="message-tag" v-if="item.unread < 99">{{item.unread}}</view>
  20. <view class="message-tag" v-else>99+</view>
  21. </view>
  22. <u-icon name="arrow-right"></u-icon>
  23. </view>
  24. </view>
  25. </view>
  26. <view style="height: 170rpx;"></view>
  27. <view class="btn-bottom exit" v-if="$isRight(supplier)">
  28. <button class="lf-w-100" @click="loginOut">退出登录</button>
  29. </view>
  30. </view>
  31. </template>
  32. <script>
  33. export default {
  34. data(){
  35. return {
  36. supplier: {},
  37. block_list: []
  38. }
  39. },
  40. onShow() {
  41. this.getData();
  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. // 退出登录
  51. loginOut(){
  52. uni.showModal({
  53. title: '温馨提示',
  54. content: '确定退出登录吗?',
  55. confirmColor: '#1833F2',
  56. success: result => {
  57. if(result.confirm){
  58. uni.removeStorageSync('supply_token');
  59. this.$redirectToLogin('您已退出登录, 即将跳转...');
  60. }
  61. }
  62. })
  63. },
  64. // 获取数据
  65. getData(){
  66. this.$http(this.API.API_SUPPLIER_INDEX).then(res => {
  67. this.supplier = res.data.supplier;
  68. this.block_list = res.data.block;
  69. // 不用存supplier_id
  70. // getApp().globalData.supplier_id = res.data.supplier.id;
  71. uni.setNavigationBarTitle({
  72.   title: this.supplier.user.supplier.supplier_name
  73. })
  74. });
  75. }
  76. }
  77. }
  78. </script>
  79. <style>
  80. page{
  81. background-color: #F6F6F6;
  82. }
  83. </style>
  84. <style lang="scss" scoped="scoped">
  85. .message-tag {
  86. width: 60rpx;
  87. height: 40rpx;
  88. font-size: 28rpx;
  89. background-color: red;
  90. border-radius: 20rpx;
  91. margin-right: 10rpx;
  92. text-align: center;
  93. align-items: center;
  94. color: white;
  95. display: flex;
  96. justify-content: space-around;
  97. }
  98. .head{
  99. height: 374rpx;
  100. width: 750rpx;
  101. background-color: #FFFFFF;
  102. image{
  103. width: 200rpx;
  104. height: 200rpx;
  105. border: 2rpx solid #FFFFFF;
  106. border-radius: 50%;
  107. }
  108. }
  109. .list{
  110. margin-top: 20rpx;
  111. padding: 0 32rpx;
  112. background-color: #FFFFFF;
  113. width: 100%;
  114. height: auto;
  115. }
  116. .list-item{
  117. border-bottom: 1rpx solid #EEEEEE;
  118. height: 110rpx;
  119. box-sizing: border-box;
  120. position: relative;
  121. .icon-img{
  122. width: 50rpx;
  123. height: 50rpx;
  124. }
  125. .feedback-btn{
  126. position: absolute;
  127. width: 100%;
  128. height: 100%;
  129. z-index: 1;
  130. background: transparent;
  131. }
  132. &:last-child{
  133. border-bottom: none;
  134. }
  135. }
  136. .exit{
  137. padding: 0 32rpx;
  138. // bottom: 50rpx;
  139. padding-top: 10rpx;
  140. padding-bottom: 50rpx;
  141. box-sizing: border-box;
  142. background-color: #F6F6F6;
  143. button{
  144. background-color: #f0f0f0;
  145. color: #777777;
  146. }
  147. }
  148. </style>