shop.vue 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. <template>
  2. <view class="shop-index iPhone-bottom flex-common-css box-border-box">
  3. <image class="bg-img" src="@/static/img/my/lqzx-bg.png" mode="scaleToFill"></image>
  4. <view class="nav-box">
  5. <Nav :leftShow='false' :customNav='true' bgckgroundBox='transparent'>
  6. <template>
  7. <view slot="custom" class="">
  8. <image class="nav-img" src="@/static/img/takeout/bg-back.png" mode="scaleToFill"></image>
  9. </view>
  10. </template>
  11. </Nav>
  12. </view>
  13. <view class="head-box bgc-f box-border-box plr-24" :style="{height:domHeigjt + 'rpx'}">
  14. <view id="shopInfoBox" class="shop-info-box bgc-f box-border-box p-24">
  15. </view>
  16. </view>
  17. <view class="head-box-1 bgc-f box-border-box plr-24">
  18. <view class="align-items-center shop-type-list">
  19. <view class="shop-item fs-32" @click="seletShopType(item)"
  20. :class="shopType === item.id?'s-item':'n-item'"
  21. v-for="(item,i) in shopTypeList" :key="i">
  22. {{item.name}}
  23. <view v-if="item.id == 2" class="pj-num" :class="shopType === item.id?'s-item':'n-item'">999+</view>
  24. </view>
  25. <view class="shop-item-bs" :style="{left:shopTypeBsLeft+'rpx'}"></view>
  26. </view>
  27. </view>
  28. <view class="common-view-css bgc-f" style="overflow: hidden;">
  29. <Menu style="height: 100%;" v-show="shopType === 1"></Menu>
  30. </view>
  31. <view class="shop-buttom-money">
  32. </view>
  33. </view>
  34. </template>
  35. <script>
  36. import Menu from './shop-mod/menu.vue';
  37. import tools from "@/service/tools";
  38. export default {
  39. components:{Menu},
  40. data(){
  41. return{
  42. domHeigjt:224,
  43. shopTypeList:[{name:"点菜",id:1},{name:"评价",id:2},{name:"店铺",id:3},],
  44. shopType:1,//组件类型
  45. shopTypeBsLeft:12,
  46. }
  47. },
  48. onLoad(e) {
  49. },
  50. mounted() {
  51. this.getDomH();
  52. },
  53. methods:{
  54. getDomH(){
  55. let info = uni.createSelectorQuery().select('#shopInfoBox');
  56. info.boundingClientRect((data)=>{
  57. this.domHeigjt = data.height * 2 - 34
  58. }).exec()
  59. },
  60. scrolltolower(){
  61. console.log('触底');
  62. },
  63. seletShopType(item){
  64. if(this.shopType!=item.id){
  65. this.shopType = item.id;
  66. if(this.shopType == 1){
  67. this.shopTypeBsLeft = 12
  68. }else if(this.shopType == 2){
  69. this.shopTypeBsLeft = 166
  70. }else{
  71. this.shopTypeBsLeft = 160*2
  72. }
  73. }
  74. },
  75. },
  76. }
  77. </script>
  78. <style scoped lang="scss">
  79. .shop-index{
  80. position: relative;
  81. .bg-img{
  82. position: absolute;
  83. top: 0;
  84. left: 0;
  85. width: 100%;
  86. height: 280rpx;
  87. z-index: -1;
  88. }
  89. .nav-box{
  90. margin-bottom: 110rpx;
  91. .nav-img{
  92. width: 56rpx;
  93. height: 56rpx;
  94. }
  95. }
  96. .shop-buttom-money{
  97. width: 100%;
  98. height: 140rpx;
  99. // background: rgba(255,255,255,0.8);
  100. background-color: #ccc;
  101. }
  102. .head-box{
  103. width: 100%;
  104. position: relative;
  105. .shop-info-box{
  106. position: absolute;
  107. top: -50rpx;
  108. left: 24rpx;
  109. width: 702rpx;
  110. min-height: 258rpx;
  111. border-radius: 20rpx;
  112. box-shadow: 0rpx 0rpx 20rpx 0rpx rgba(0,0,0,0.1);
  113. }
  114. }
  115. .head-box-1{
  116. width: 100%;
  117. height: 88rpx;
  118. border-bottom: 1rpx solid #eee;
  119. .shop-type-list{
  120. height: 88rpx;
  121. position: relative;
  122. .shop-item-bs{
  123. position: absolute;
  124. bottom: 0;
  125. width: 40rpx;
  126. height: 6rpx;
  127. border-radius: 20rpx;
  128. background-color: #41ABF5;
  129. transition: left 0.5s;
  130. }
  131. .shop-item{
  132. margin-right: 90rpx;
  133. position: relative;
  134. .pj-num{
  135. position: absolute;
  136. right: -80rpx;
  137. top: 0;
  138. text-align: left;
  139. width: 80rpx;
  140. }
  141. }
  142. .s-item{
  143. font-weight: 600;
  144. }
  145. .n-item{
  146. font-weight: 400;
  147. color: #666666;
  148. }
  149. }
  150. }
  151. }
  152. </style>