金诚优选前端代码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

181 lines
4.7 KiB

  1. <template>
  2. <view>
  3. <lf-nav title="搜索" :showIcon="true" @changeHeight="e => nav_height = e"></lf-nav>
  4. <view class="head">
  5. <u-search placeholder="请输入商品名或商户名" action-text="取消" v-model="value" @custom="customClick"></u-search>
  6. </view>
  7. <view>
  8. <u-tabs :list="tab_list" active-color="#15716E" inactive-color='#777777' :is-scroll="false" :current="tab_current" @change="tabChange"></u-tabs>
  9. </view>
  10. <swiper :current="tab_current" @change="swiperChange" :style="{height: autoHeight}">
  11. <swiper-item v-for="(tab_item, tab_index) in tab_list" :key="tab_index">
  12. <scroll-view :scroll-y="true" :style="{height: autoHeight}">
  13. <view class="scroll-content" v-if="tab_index == 0">
  14. <lf-waterfall :list="goods_list"></lf-waterfall>
  15. </view>
  16. <view class="scroll-content" v-else>
  17. <view class="shop-box" v-for="(item, index) in 3" :key="index">
  18. <image class="shop-img"></image>
  19. <view class="shop-info">
  20. <view class="lf-line-1">luckin coffee 瑞幸咖啡</view>
  21. <view>餐饮·美食</view>
  22. </view>
  23. </view>
  24. </view>
  25. </scroll-view>
  26. </swiper-item>
  27. </swiper>
  28. </view>
  29. </template>
  30. <script>
  31. import lfWaterfall from '@/components/lf-waterfall-shopdetails/lf-waterfall.vue';
  32. export default {
  33. components: {
  34. lfWaterfall
  35. },
  36. data() {
  37. return {
  38. value: '爱慕先生',
  39. tab_current: 0,
  40. tab_list: [{
  41. name: '商品(8)'
  42. },{
  43. name: '商户(1)'
  44. }],
  45. scrollH: 0,
  46. nav_height: 0,
  47. goods_list: [
  48. {
  49. id: 10,
  50. original_price: "4111.00",
  51. picture: "https://hainan.lanzulive.com/storage/images/v2-deb89623e0ee2a2dad34bcded6dfd1ed_1440w.png",
  52. pictures: ["https://hainan.lanzulive.com/storage/images/v2-deb89623e0ee2a2dad34bcded6dfd1ed_1440w.png"],
  53. price: "2412.00",
  54. product_id: 1008,
  55. sale: 0,
  56. title: "三亚悦榕庄(Banyan Tree Sanya Resort and Spa)"
  57. },
  58. {
  59. id: 10,
  60. original_price: "4111.00",
  61. picture: "https://hainan.lanzulive.com/storage/images/v2-deb89623e0ee2a2dad34bcded6dfd1ed_1440w.png",
  62. pictures: ["https://hainan.lanzulive.com/storage/images/v2-deb89623e0ee2a2dad34bcded6dfd1ed_1440w.png"],
  63. price: "2412.00",
  64. product_id: 1008,
  65. sale: 0,
  66. title: "三亚悦榕庄(Banyan Tree Sanya Resort and Spa)"
  67. },
  68. {
  69. id: 10,
  70. original_price: "4111.00",
  71. picture: "https://hainan.lanzulive.com/storage/images/v2-deb89623e0ee2a2dad34bcded6dfd1ed_1440w.png",
  72. pictures: ["https://hainan.lanzulive.com/storage/images/v2-deb89623e0ee2a2dad34bcded6dfd1ed_1440w.png"],
  73. price: "2412.00",
  74. product_id: 1008,
  75. sale: 0,
  76. title: "三亚悦榕庄(Banyan Tree Sanya Resort and Spa)"
  77. },
  78. {
  79. id: 10,
  80. original_price: "4111.00",
  81. picture: "https://hainan.lanzulive.com/storage/images/v2-deb89623e0ee2a2dad34bcded6dfd1ed_1440w.png",
  82. pictures: ["https://hainan.lanzulive.com/storage/images/v2-deb89623e0ee2a2dad34bcded6dfd1ed_1440w.png"],
  83. price: "2412.00",
  84. product_id: 1008,
  85. sale: 0,
  86. title: "三亚悦榕庄(Banyan Tree Sanya Resort and Spa)"
  87. }
  88. ]
  89. }
  90. },
  91. computed: {
  92. autoHeight(){
  93. return `calc(${this.scrollH}px - ${this.nav_height}px - 124rpx - 86rpx)`;
  94. }
  95. },
  96. onLoad(options){
  97. let info = uni.getSystemInfoSync();
  98. this.scrollH = info.screenHeight;
  99. },
  100. methods: {
  101. customClick(){
  102. this.$toBack();
  103. },
  104. tabChange(event){
  105. this.tab_current = event;
  106. },
  107. swiperChange(event){
  108. this.tab_current = event.detail.current;
  109. }
  110. }
  111. }
  112. </script>
  113. <style lang="scss" scoped>
  114. .head{
  115. padding: 30rpx 32rpx;
  116. }
  117. .scroll-content{
  118. padding: 30rpx 32rpx;
  119. }
  120. .shop-box{
  121. width: 100%;
  122. height: 100rpx;
  123. display: flex;
  124. &:nth-child(n+2){
  125. margin-top: 60rpx;
  126. }
  127. .shop-img{
  128. width: 100rpx;
  129. height: 100rpx;
  130. background-color: #EEEEEE;
  131. border-radius: 5rpx;
  132. margin-right: 15rpx;
  133. }
  134. .shop-info{
  135. width: 570rpx;
  136. height: 100rpx;
  137. display: flex;
  138. flex-direction: column;
  139. justify-content: space-between;
  140. &>view:nth-child(1){
  141. font-size: 36rpx;
  142. color: #222222;
  143. font-weight: bold;
  144. }
  145. &>view:nth-child(2){
  146. font-size: 24rpx;
  147. color: #777777;
  148. }
  149. }
  150. }
  151. // tabs 样式修改
  152. /deep/.u-scroll-box {
  153. display: flex;
  154. justify-content: center;
  155. align-items: center;
  156. border-bottom: 1rpx solid rgba(0, 0, 0, 0.1);
  157. }
  158. /deep/.u-scroll-box .u-tab-bar {
  159. background-color: #15716E!important;
  160. width: 80rpx!important;
  161. position: absolute;
  162. left: 0;
  163. bottom: -12rpx;
  164. }
  165. /deep/.special_tab .u-tabs .u-scroll-box .u-tab-bar {
  166. background-color: #15716E!important;
  167. width: 56rpx!important;
  168. position: absolute;
  169. height: 5rpx!important;
  170. left: 8rpx;
  171. bottom: -4rpx;
  172. }
  173. /deep/ .u-tab-item {
  174. font-size: 28rpx!important;
  175. }
  176. </style>