index.vue 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. <template>
  2. <view class="ExpressServiceContainer">
  3. <NavHeader :BindClick="goBack"></NavHeader>
  4. <!-- 用于填充因定位而失去的高度 -->
  5. <!-- <view class="NavHeader"></view> -->
  6. <view class="main">
  7. <IndexView ref="IndexView" :isFixed="isFixed" :ECList="ECList"></IndexView>
  8. </view>
  9. <SubsetTabbar :currIndex="currIndex" :BindClick="CheckTabbar"></SubsetTabbar>
  10. <!-- 用于填充因定位而失去的高度 -->
  11. <view class="SubsetTabbar"></view>
  12. </view>
  13. </template>
  14. <script>
  15. import IndexView from "./components/IndexView.vue";
  16. import DeliveryExpress from "./components/DeliveryExpress.vue"
  17. import MyExpress from "./components/MyExpress.vue";
  18. import SubsetTabbar from "./components/SubsetTabbar.vue";
  19. import NavHeader from "./components/header.vue";
  20. import { ECList } from "./ExpressData.js"
  21. // import {
  22. // // getBianminRecordKuaidiApi, // 查询我个人寄快递的记录
  23. // // getKuaidi100ComApi, // 获取可使用快递公司编码
  24. // getKuaidi100PriceApi, // C端寄件下单-价格查询
  25. // addKuaidi100CorderApi, // C端寄件下单
  26. // orderCancelApi // C端寄件下单-取消
  27. // } from '@/api/convenient-services';
  28. export default {
  29. name: 'KuaiDi',
  30. components: {
  31. IndexView,
  32. DeliveryExpress,
  33. MyExpress,
  34. NavHeader,
  35. SubsetTabbar
  36. },
  37. props: {
  38. },
  39. data() {
  40. return {
  41. currIndex: 0,
  42. seletyuanH: uni.upx2px(540), // 用于判定初始位置的值
  43. isFixed: false,
  44. ECList // 可用快递公司列表
  45. }
  46. },
  47. created() {
  48. // getKuaidi100PriceApi({
  49. // "kuaidicom": "shunfeng",
  50. // "recManPrintAddr": "广东省深圳市",
  51. // "sendManPrintAddr": "广东省深圳市",
  52. // "serviceType": "顺丰标快",
  53. // "weight": "1"
  54. // }).then(res => {
  55. // console.log(res)
  56. // })
  57. },
  58. onPullDownRefresh () { // 下拉刷新
  59. // console.log('refresh');
  60. // setTimeout(function () {
  61. // uni.stopPullDownRefresh();
  62. // }, 1000);
  63. },
  64. onReachBottom() {
  65. this.$refs.IndexView.myExpressData?this.$refs.IndexView.getMyExpressList():''
  66. },
  67. methods: {
  68. goBack() {
  69. uni.navigateBack()
  70. },
  71. CheckTabbar(ev, index) {
  72. this.currIndex = index
  73. // console.log(this.currIndex)
  74. }
  75. },
  76. onPageScroll(e) {
  77. // 判断位置 完成吸顶效果
  78. if (this.seletyuanH > e.scrollTop) {
  79. // console.log(false)
  80. this.isFixed = false
  81. } else {
  82. // console.log(true)
  83. this.isFixed = true
  84. }
  85. }
  86. }
  87. </script>
  88. <style lang="less" scoped>
  89. .ExpressServiceContainer {
  90. position: relative;
  91. // width: 100%;
  92. min-height: 100vh;
  93. box-sizing: border-box;
  94. background: linear-gradient(180deg, #ffffff 0%, #f6f6f6 10%);
  95. }
  96. .NavHeader {
  97. height: 88rpx;
  98. }
  99. .SubsetTabbar {
  100. height: 113rpx;
  101. }
  102. </style>