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

133 lines
2.9 KiB

5 years ago
  1. <template>
  2. <view>
  3. <view class="lf-row-center lf-flex-column head">
  4. <image :src="supplier.avatar"></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>
  17. <u-icon name="arrow-right"></u-icon>
  18. </view>
  19. </view>
  20. </view>
  21. <view style="height: 170rpx;"></view>
  22. <view class="btn-bottom exit" v-if="$isRight(supplier)">
  23. <button class="lf-w-100" @click="loginOut">退出登录</button>
  24. </view>
  25. </view>
  26. </template>
  27. <script>
  28. export default {
  29. data(){
  30. return {
  31. supplier: {},
  32. block_list: []
  33. }
  34. },
  35. onLoad(){
  36. // todo 优化:显示订单角标
  37. this.getData();
  38. },
  39. onReady(){
  40. // #ifndef MP
  41. var a = document.getElementsByClassName('uni-page-head-hd')[0];
  42. a.style.display = 'none'; // 去掉返回按钮
  43. // #endif
  44. },
  45. methods: {
  46. // 退出登录
  47. loginOut(){
  48. uni.showModal({
  49. title: '温馨提示',
  50. content: '确定退出登录吗?',
  51. confirmColor: '#1833F2',
  52. success: result => {
  53. if(result.confirm){
  54. uni.removeStorageSync('supply_token');
  55. this.$redirectToLogin('您已退出登录, 即将跳转...');
  56. }
  57. }
  58. })
  59. },
  60. // 获取数据
  61. getData(){
  62. this.$http(this.API.API_SUPPLIER_INDEX).then(res => {
  63. this.supplier = res.data.supplier;
  64. this.block_list = res.data.block;
  65. // 不用存supplier_id
  66. // getApp().globalData.supplier_id = res.data.supplier.id;
  67. uni.setNavigationBarTitle({
  68.   title: this.supplier.user.supplier.supplier_name
  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. .head{
  82. height: 326rpx;
  83. width: 750rpx;
  84. background-color: #FFFFFF;
  85. image{
  86. width: 200rpx;
  87. height: 200rpx;
  88. border: 2rpx solid #FFFFFF;
  89. border-radius: 50%;
  90. }
  91. }
  92. .list{
  93. margin-top: 20rpx;
  94. padding: 0 32rpx;
  95. background-color: #FFFFFF;
  96. width: 100%;
  97. height: auto;
  98. }
  99. .list-item{
  100. border-bottom: 1rpx solid #EEEEEE;
  101. height: 110rpx;
  102. box-sizing: border-box;
  103. position: relative;
  104. .icon-img{
  105. width: 50rpx;
  106. height: 50rpx;
  107. }
  108. .feedback-btn{
  109. position: absolute;
  110. width: 100%;
  111. height: 100%;
  112. z-index: 1;
  113. background: transparent;
  114. }
  115. &:last-child{
  116. border-bottom: none;
  117. }
  118. }
  119. .exit{
  120. padding: 0 32rpx;
  121. // bottom: 50rpx;
  122. padding-top: 10rpx;
  123. padding-bottom: 50rpx;
  124. box-sizing: border-box;
  125. background-color: #F6F6F6;
  126. button{
  127. background-color: #f0f0f0;
  128. color: #777777;
  129. }
  130. }
  131. </style>