自主项目,食堂系统,前端uniapp
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.

128 lines
2.7 KiB

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