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

132 lines
3.3 KiB

  1. <template>
  2. <view>
  3. <view class="tabs">
  4. <u-tabs :list="tab_list" :is-scroll="false" :current="current" bg-color="#f6f6f6" active-color="#11D189" @change="tabsChange"></u-tabs>
  5. </view>
  6. <swiper :style="{height: 'calc('+ windowHeight +'px - 110rpx)', width: '750rpx'}"
  7. :current="current" @change="swiperChange">
  8. <swiper-item v-for="(tabItem, tabIndex) in tab_list" :key="tabIndex">
  9. <scroll-view class="lf-w-100 lf-h-100 lf-p-l-32 lf-p-r-32 lf-border-box" :scroll-y="true">
  10. <view class="card" v-for="(item, index) in tabItem.list" :key="item.id" @click="$url('/pages/canteen/delivery/detail?id='+ item.id)">
  11. <view class="lf-row-between item">
  12. <view class="lf-color-gray">申请人</view>
  13. <view class="lf-color-black">{{ item.o_name }}</view>
  14. </view>
  15. <view class="lf-row-between item">
  16. <view class="lf-color-gray">申请时间</view>
  17. <!-- todo 申请时间和种类 -->
  18. <view class="lf-color-black">{{ item.o_sn }}</view>
  19. </view>
  20. <view class="lf-row-between item">
  21. <view class="lf-color-gray">商品种类</view>
  22. <view class="lf-color-black">8</view>
  23. </view>
  24. <view class="lf-row-between item">
  25. <view class="lf-color-gray">订单状态</view>
  26. <view class="quoted-price">{{ item.state }}</view>
  27. </view>
  28. </view>
  29. <view class="loading-more">
  30. <text v-if="tabItem.list.length" :class="{'loading-more-text': tabItem.loading_class}">{{ tabItem.loading_text }}</text>
  31. <lf-nocontent v-else class="lf-m-t-50"></lf-nocontent>
  32. </view>
  33. </scroll-view>
  34. </swiper-item>
  35. </swiper>
  36. </view>
  37. </template>
  38. <script>
  39. export default {
  40. data(){
  41. return {
  42. current: 0,
  43. tab_list: [{
  44. name: '全部',
  45. loading_class: true,
  46. loading_text: '正在加载中...',
  47. page: 1,
  48. isPage: true,
  49. list: []
  50. },{
  51. name: '申请中',
  52. loading_class: true,
  53. loading_text: '正在加载中...',
  54. page: 1,
  55. isPage: true,
  56. list: []
  57. },{
  58. name: '已出库',
  59. loading_class: true,
  60. loading_text: '正在加载中...',
  61. page: 1,
  62. isPage: true,
  63. list: []
  64. }],
  65. page_size: 10,
  66. windowHeight: 0
  67. }
  68. },
  69. onLoad(){
  70. this.windowHeight = uni.getSystemInfoSync().windowHeight;
  71. this.getData();
  72. },
  73. methods: {
  74. getData(){
  75. this.$http(this.API.API_CANTEEN_WAREHOUSEOUTLIST).then(res => {
  76. console.log("getData", res);
  77. this.tab_list[this.current].list = res.data.list || [];
  78. });
  79. },
  80. tabsChange(current){
  81. this.current = current;
  82. },
  83. swiperChange(event){
  84. this.current = event.detail.current;
  85. }
  86. }
  87. }
  88. </script>
  89. <style>
  90. page{
  91. background-color: #f6f6f6;
  92. }
  93. </style>
  94. <style lang="scss" scoped="scoped">
  95. .card{
  96. width: 100%;
  97. height: max-content;
  98. background-color: #FFFFFF;
  99. border-radius: 20rpx;
  100. padding: 0 20rpx;
  101. box-sizing: border-box;
  102. margin-bottom: 30rpx;
  103. .item{
  104. padding: 20rpx 0;
  105. box-sizing: border-box;
  106. width: 100%;
  107. border-bottom: 1rpx solid #E5E5E5;
  108. font-size: 28rpx;
  109. &:last-child{
  110. border-bottom: none;
  111. }
  112. }
  113. // 已报价,等待审核
  114. .quoted-price{
  115. color: #777777;
  116. }
  117. // 等待报价
  118. .wait{
  119. color: #1833F2;
  120. }
  121. // 已通过审核
  122. .passed{
  123. color: #0BCE5F;
  124. }
  125. // 报价被拒绝
  126. .refuse{
  127. color: #FF0000;
  128. }
  129. }
  130. </style>