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

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