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

152 lines
3.5 KiB

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. // todo 优化:显示订单角标
  42. this.getData();
  43. },
  44. onReady(){
  45. // #ifndef MP
  46. var a = document.getElementsByClassName('uni-page-head-hd')[0];
  47. a.style.display = 'none'; // 去掉返回按钮
  48. // #endif
  49. },
  50. methods: {
  51. // 退出登录
  52. loginOut(){
  53. uni.showModal({
  54. title: '温馨提示',
  55. content: '确定退出登录吗?',
  56. confirmColor: '#1833F2',
  57. success: result => {
  58. if(result.confirm){
  59. uni.removeStorageSync('supply_token');
  60. this.$redirectToLogin('您已退出登录, 即将跳转...');
  61. }
  62. }
  63. })
  64. },
  65. // 获取数据
  66. getData(){
  67. this.$http(this.API.API_SUPPLIER_INDEX).then(res => {
  68. this.supplier = res.data.supplier;
  69. this.block_list = res.data.block;
  70. // 不用存supplier_id
  71. // getApp().globalData.supplier_id = res.data.supplier.id;
  72. uni.setNavigationBarTitle({
  73.   title: this.supplier.user.supplier.supplier_name
  74. })
  75. });
  76. }
  77. }
  78. }
  79. </script>
  80. <style>
  81. page{
  82. background-color: #F6F6F6;
  83. }
  84. </style>
  85. <style lang="scss" scoped="scoped">
  86. .message-tag {
  87. width: 52rpx;
  88. height: 52rpx;
  89. font-size: 16rpx;
  90. background-color: red;
  91. border-radius: 50%;
  92. margin-right: 10rpx;
  93. text-align: center;
  94. align-items: center;
  95. color: white;
  96. display: flex;
  97. justify-content: space-around;
  98. }
  99. .head{
  100. height: 374rpx;
  101. width: 750rpx;
  102. background-color: #FFFFFF;
  103. image{
  104. width: 200rpx;
  105. height: 200rpx;
  106. border: 2rpx solid #FFFFFF;
  107. border-radius: 50%;
  108. }
  109. }
  110. .list{
  111. margin-top: 20rpx;
  112. padding: 0 32rpx;
  113. background-color: #FFFFFF;
  114. width: 100%;
  115. height: auto;
  116. }
  117. .list-item{
  118. border-bottom: 1rpx solid #EEEEEE;
  119. height: 110rpx;
  120. box-sizing: border-box;
  121. position: relative;
  122. .icon-img{
  123. width: 50rpx;
  124. height: 50rpx;
  125. }
  126. .feedback-btn{
  127. position: absolute;
  128. width: 100%;
  129. height: 100%;
  130. z-index: 1;
  131. background: transparent;
  132. }
  133. &:last-child{
  134. border-bottom: none;
  135. }
  136. }
  137. .exit{
  138. padding: 0 32rpx;
  139. // bottom: 50rpx;
  140. padding-top: 10rpx;
  141. padding-bottom: 50rpx;
  142. box-sizing: border-box;
  143. background-color: #F6F6F6;
  144. button{
  145. background-color: #f0f0f0;
  146. color: #777777;
  147. }
  148. }
  149. </style>