list.vue 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. <template>
  2. <view>
  3. <van-sticky>
  4. <view class="top-wrap">
  5. <van-tabs swipeable id="tabs" :active="status" title-active-color="#3385FF" color="#3385FF" @change="typeChange">
  6. <van-tab title="待审批" name="待审批"></van-tab>
  7. <van-tab title="已审批" name="已审批"></van-tab>
  8. </van-tabs>
  9. </view>
  10. </van-sticky>
  11. <van-empty description="暂无数据" :image="require('@/static/empty.png')" v-if="finished&&list.length===0"/>
  12. <view class="list-wrap" v-else>
  13. <view class="item white-wrap" v-for="item in list" :key="item.id">
  14. <view class="title flex">
  15. <image src="../../static/man.png" mode="aspectFill" class="icon"></image>
  16. <view>{{item.title}}</view>
  17. </view>
  18. <view class="content">
  19. <view class="info">申请类型:{{item.applyType}}</view>
  20. <view class="info">申请销售:{{item.saller}}</view>
  21. <view class="info">提交时间:{{item.submitTime|formatTime}}</view>
  22. </view>
  23. <view class="status approve-list-status-wait" v-if="item.status==='待审批'">待审批</view>
  24. </view>
  25. </view>
  26. </view>
  27. </template>
  28. <script>
  29. export default {
  30. data () {
  31. return {
  32. status: '待审批',
  33. list:[],
  34. page:1,
  35. finished:false,
  36. }
  37. },
  38. onLoad(options) {
  39. this.getList()
  40. },
  41. onShow() {
  42. this.selectComponent('#tabs').resize();// 解决初始渲染 vant tab 底部条
  43. },
  44. methods: {
  45. typeChange(e){
  46. this.status=e.detail.name
  47. this.page=1
  48. this.finished=false
  49. this.list=[]
  50. this.getList()
  51. },
  52. async getList(){
  53. let arr=[
  54. {
  55. title:"标题",
  56. saller:'销售一',
  57. submitTime:'',
  58. approveTime:'',
  59. backTime:'',
  60. cancelTime:'',
  61. status:'待审批',
  62. applyType:'线上路演',
  63. id:1,
  64. type:'activity'
  65. }
  66. ]
  67. this.list=arr
  68. }
  69. }
  70. }
  71. </script>
  72. <style lang="scss" scoped>
  73. .list-wrap {
  74. padding: 20rpx;
  75. .item {
  76. padding: 30rpx;
  77. box-shadow: 0px 3px 12px rgba(175, 175, 175, 0.16);
  78. border-radius: 8px;
  79. margin-bottom: 20rpx;
  80. .title {
  81. font-size: 16px;
  82. font-weight: bold;
  83. margin-bottom: 30rpx;
  84. .icon {
  85. width: 31rpx;
  86. height: 34rpx;
  87. flex-shrink: 0;
  88. margin-right: 10rpx;
  89. position: relative;
  90. top: 4rpx;
  91. }
  92. }
  93. .content {
  94. font-size: 14px;
  95. color: #666;
  96. .info {
  97. margin-bottom: 16rpx;
  98. }
  99. .info:last-child {
  100. margin-bottom: 0;
  101. }
  102. }
  103. .status {
  104. text-align: right;
  105. }
  106. }
  107. }
  108. </style>