index.vue 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. <template>
  2. <view class="page">
  3. <u-sticky>
  4. <View class=" tabs">
  5. <u-tabs :list="tabList" :scrollable="false"
  6. lineWidth="30"
  7. lineColor="#FFE05C"
  8. :activeStyle="{
  9. color: '#333333',
  10. fontWeight: 'bold',
  11. transform: 'scale(1.05)'
  12. }"
  13. :current="tabIndex" @click="clickTab"></u-tabs>
  14. </View>
  15. </u-sticky>
  16. <!-- 订单列表 -->
  17. <view :style="{'height':windowHeight}" >
  18. <swiper :style="{'height':windowHeight}" :current="tabIndex" @change="swiperChange">
  19. <swiper-item class="swiperItem" v-for="(item,index) in tabList" :key="index" >
  20. <view>
  21. <mescroll-item ref="MescrollItem" :i="index" :index="tabIndex" :tabs="tabList" :height="windowHeight">
  22. </mescroll-item>
  23. </view>
  24. </swiper-item>
  25. </swiper>
  26. </view>
  27. </view>
  28. </template>
  29. <script>
  30. import MescrollItem from "./module/mescrollUni-item.vue";
  31. export default {
  32. components: {
  33. MescrollItem
  34. },
  35. data() {
  36. return {
  37. windowHeight:'',
  38. tabIndex:0,
  39. tabList: [{
  40. name: '可使用'
  41. }, {
  42. name: '已使用'
  43. }, {
  44. name: '已过期'
  45. }],
  46. };
  47. },
  48. onLoad() {
  49. let sysInfo = uni.getSystemInfoSync()
  50. this.windowHeight =sysInfo.windowHeight-44+'px'//除标题栏栏外的屏幕可用高度
  51. },
  52. methods: {
  53. clickTab(e){
  54. this.tabIndex = e.index
  55. },
  56. swiperChange(e){
  57. this.tabIndex = e.detail.current
  58. // if (this.$refs.MescrollItem[e.detail.current].orderList.length>0){
  59. // this.$refs.MescrollItem[e.detail.current].downCallback()
  60. // }
  61. },
  62. }
  63. }
  64. </script>
  65. <style scoped lang="scss">
  66. @import '../../common/css/common.css';
  67. @import './index.rpx.scss';
  68. </style>