index.vue 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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(e) {
  49. let sysInfo = uni.getSystemInfoSync()
  50. this.windowHeight =sysInfo.windowHeight-44+'px'//除标题栏栏外的屏幕可用高度
  51. },
  52. onShow(){
  53. //退款成功后,刷新列表监听事件
  54. uni.$off('rechargeRecordDownCallback')
  55. uni.$on('rechargeRecordDownCallback',this.downCallback)
  56. },
  57. methods: {
  58. downCallback(){
  59. this.$refs.MescrollItem[this.tabIndex].downCallback()
  60. },
  61. clickTab(e){
  62. this.tabIndex = e.index
  63. },
  64. swiperChange(e){
  65. this.tabIndex = e.detail.current
  66. // if (this.$refs.MescrollItem[e.detail.current].list.length>0){
  67. // this.$refs.MescrollItem[e.detail.current].downCallback()
  68. // }
  69. },
  70. },
  71. };
  72. </script>
  73. <style lang="scss" scoped>
  74. @import '../../common/css/common.css';
  75. @import './index.rpx.css';
  76. </style>