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

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