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

127 lines
2.6 KiB

  1. <template>
  2. <view>
  3. <view class="lf-row-center lf-flex-column head">
  4. <image :src="supplier.logo"></image>
  5. <view class="lf-m-t-20 lf-font-32 lf-font-bold lf-color-black">{{ supplier.subject_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. getApp().globalData.supplier_id = res.data.supplier.id;
  64. });
  65. }
  66. }
  67. }
  68. </script>
  69. <style>
  70. page{
  71. background-color: #F6F6F6;
  72. }
  73. </style>
  74. <style lang="scss" scoped="scoped">
  75. .head{
  76. height: 326rpx;
  77. width: 750rpx;
  78. background-color: #FFFFFF;
  79. image{
  80. width: 200rpx;
  81. height: 200rpx;
  82. border: 2rpx solid #FFFFFF;
  83. border-radius: 50%;
  84. }
  85. }
  86. .list{
  87. margin-top: 20rpx;
  88. padding: 0 32rpx;
  89. background-color: #FFFFFF;
  90. width: 100%;
  91. height: auto;
  92. }
  93. .list-item{
  94. border-bottom: 1rpx solid #EEEEEE;
  95. height: 110rpx;
  96. box-sizing: border-box;
  97. position: relative;
  98. .icon-img{
  99. width: 50rpx;
  100. height: 50rpx;
  101. }
  102. .feedback-btn{
  103. position: absolute;
  104. width: 100%;
  105. height: 100%;
  106. z-index: 1;
  107. background: transparent;
  108. }
  109. &:last-child{
  110. border-bottom: none;
  111. }
  112. }
  113. .exit{
  114. padding: 0 32rpx;
  115. // bottom: 50rpx;
  116. padding-top: 10rpx;
  117. padding-bottom: 50rpx;
  118. box-sizing: border-box;
  119. background-color: #F6F6F6;
  120. button{
  121. background-color: #f0f0f0;
  122. color: #777777;
  123. }
  124. }
  125. </style>