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

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