group-shop.vue 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. <template>
  2. <view class="flex-common-css">
  3. <Nav :leftShow='false' :customNav='true' :bgckgroundBox='scrollTopNum>30?"#fff":"transparent"' class="nav-box">
  4. <template>
  5. <view slot="custom" class="align-items-center" @click="leftClick">
  6. <view class="nav-left-box text-align-center" v-show="scrollTopNum<30">
  7. <uni-icons color="#fff" type="left" size="15"></uni-icons>
  8. </view>
  9. <uni-icons class="mr-30" color="#000" type="left" size="15" v-show="scrollTopNum>30"></uni-icons>
  10. <view class="fs-34 fw-600 fc-3" v-show="scrollTopNum>30">
  11. 团购商家
  12. </view>
  13. </view>
  14. </template>
  15. </Nav>
  16. <scroll-view :scroll-y="true" class="scroll-view-box" @scroll='scroll' @scrolltolower="scrolltolower">
  17. <view class="uni-margin-wrap">
  18. <swiper class="swiper" :circular='true' :autoplay="true" :interval="3000" :duration="500">
  19. <swiper-item>
  20. <view class="swiper-item bgc-B3DDFB">A</view>
  21. </swiper-item>
  22. <swiper-item>
  23. <view class="swiper-item bgc-3">B</view>
  24. </swiper-item>
  25. <swiper-item>
  26. <view class="swiper-item fc-65420c">C</view>
  27. </swiper-item>
  28. </swiper>
  29. </view>
  30. <view class="shop-box p-24 box-border-box bgc-f">
  31. <view class="fs-38 fw-600 fc-3 letter-spacing-6">
  32. {{shopInfo.shop_name || ''}}
  33. </view>
  34. </view>
  35. </scroll-view>
  36. </view>
  37. </template>
  38. <script>
  39. import {
  40. groupShopInfo,
  41. groupLists
  42. } from '@/api/group.js'
  43. import tools from '@/service/tools';
  44. export default {
  45. components: {},
  46. data() {
  47. return {
  48. scrollTopNum: 0, //当前滚动条高度
  49. fromData: {
  50. operate_id: '',
  51. lat: '',
  52. lon: '',
  53. shop_id: ''
  54. },
  55. shopInfo: {}
  56. };
  57. },
  58. onLoad(data) {
  59. if (data) {
  60. this.fromData.shop_id = data.shop_id
  61. this.groupShopInfo()
  62. }
  63. },
  64. mounted() {},
  65. methods: {
  66. leftClick() {
  67. tools.leftClick()
  68. },
  69. scroll(e) {
  70. this.scrollTopNum = e.detail.scrollTop
  71. },
  72. scrolltolower() {
  73. console.log('触底');
  74. },
  75. groupShopInfo(fromData) {
  76. this.fromData.operate_id = uni.getStorageSync('operate_id');
  77. this.fromData.lon = uni.getStorageSync('lon');
  78. this.fromData.lat = uni.getStorageSync('lat');
  79. groupShopInfo(this.fromData).then((res) => {
  80. if (res.code === 1) {
  81. this.shopInfo = res.data
  82. }
  83. })
  84. }
  85. },
  86. }
  87. </script>
  88. <style lang="scss" scoped>
  89. .scroll-view-box {
  90. width: 100%;
  91. height: 100vh;
  92. position: fixed;
  93. overflow: auto;
  94. }
  95. .nav-box {
  96. transition: all 0.3s ease-in-out;
  97. }
  98. .uni-margin-wrap {
  99. width: 100%;
  100. // position: absolute;
  101. // left: 0;
  102. // top: 0;
  103. }
  104. .swiper {
  105. height: 400rpx;
  106. }
  107. .swiper-item {
  108. display: block;
  109. height: 400rpx;
  110. line-height: 400rpx;
  111. text-align: center;
  112. }
  113. .nav-left-box {
  114. width: 50rpx;
  115. height: 50rpx;
  116. line-height: 50rpx;
  117. background: #9A9A9A;
  118. border-radius: 18rpx;
  119. }
  120. .shop-box {
  121. width: 100%;
  122. // height: 100vh;
  123. position: relative;
  124. top: -10rpx;
  125. border-radius: 15rpx 15rpx 0 0;
  126. }
  127. </style>