shop.vue 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312
  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" @click="toBack()" 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 class="info-box-top flex-justify-space">
  16. <view class="box-top-left">
  17. <view class="top-left-1 fs-40 fw-600 text-overflow-ellipsis-one">猪油拌猪油拌饭猪油拌猪油拌饭猪油拌饭猪油拌(回兴店)</view>
  18. <view class="align-items-center mb-8">
  19. <image class="img-x mr-12" src="@/static/img/my/wdpj.png" mode=""></image>
  20. <view class="fs-26 fw-600 fc-FF7F00 mr-12">4.5分</view>
  21. <view class="fc-6 fs-24 mr-12">| 预计38分钟 |</view>
  22. <view class="fc-6 fs-24 mr-12">855人购买</view>
  23. </view>
  24. </view>
  25. <image class="box-top-right" src="@/static/img/my/bg.png" mode="scaleToFill"></image>
  26. </view>
  27. <view class="fs-24 fw-400 fc-9 mb-20">
  28. 公告:公告内容公告内容公告内容公告内容公告内11容公公告内容公告内容公告内容公告内容公告内公告内容公告内容公告内容公告内容公告内
  29. </view>
  30. <view class="flex-wrap-wrap">
  31. <view class="info-box-quan-list" v-for="(item,i) in 4" :key="i">
  32. <image src="@/static/img/takeout/quan-bg.png" mode=""></image>
  33. <view class="quan-list-1 fw-b fs-32 fc-f">
  34. <span class="fw-b fs-20 fc-f">¥</span>10</view>
  35. <view class="quan-list-2 fw-400 fs-24 fc-f">领</view>
  36. </view>
  37. </view>
  38. </view>
  39. </view>
  40. <view class="head-box-1 bgc-f box-border-box plr-24">
  41. <view class="align-items-center shop-type-list">
  42. <view class="shop-item fs-32" @click="seletShopType(item)"
  43. :class="shopType === item.id?'s-item':'n-item'"
  44. v-for="(item,i) in shopTypeList" :key="i">
  45. {{item.name}}
  46. <view v-if="item.id == 2" class="pj-num" :class="shopType === item.id?'s-item':'n-item'">999+</view>
  47. </view>
  48. <view class="shop-item-bs" :style="{left:shopTypeBsLeft+'rpx'}"></view>
  49. </view>
  50. </view>
  51. <view class="common-view-css bgc-f" style="overflow: hidden;">
  52. <Menu style="height: 100%;" v-show="shopType === 1"></Menu>
  53. </view>
  54. <view class="shop-buttom-money box-border-box" @click="openBuyCrad()">
  55. <view class="shop-buttom-money-1 flex-justify-space align-items-center">
  56. <image src="@/static/img/takeout/buy-icon.png" mode="scaleToFill"></image>
  57. <view class="shop-buttom-num fs-24 fc-f text-align-center">3</view>
  58. <view class="">
  59. <view class="">
  60. <span class="fw-600 fs-24 fc-f">¥</span>
  61. <span class="fw-600 fs-44 fc-f">19.26</span>
  62. </view>
  63. <!-- <view class="fs-24 fc-ADADAD">免配送</view> -->
  64. <view class="fs-24 fc-ff3939">配送费¥10</view>
  65. </view>
  66. <view class="fs-32 fw-600 fc-f">20元起送</view>
  67. </view>
  68. </view>
  69. <uni-popup ref="popupBuy" type="bottom">
  70. <view class="buy-card">
  71. <view class="buy-card-top box-border-box plr-32 flex-justify-space align-items-center">
  72. <view class="">
  73. <span class="fs-32 fc-3 mr-12">已选商品</span>
  74. <span class="fs-32 fc-9">(打包费<span class="fs-32 fc-FB3D03">8元</span>)</span>
  75. </view>
  76. <view class="fs-28 fw-400 fc-9 align-items-center">
  77. <view class="">
  78. <uni-icons type="trash" size="18" color="#999"></uni-icons>
  79. </view>
  80. <view class="fs-28 fw-400 fc-9">清空</view>
  81. </view>
  82. </view>
  83. <view class="scroll-view-css">
  84. </view>
  85. </view>
  86. </uni-popup>
  87. </view>
  88. </template>
  89. <script>
  90. import Menu from './shop-mod/menu.vue';
  91. import tools from "@/service/tools";
  92. export default {
  93. components:{Menu},
  94. data(){
  95. return{
  96. domHeigjt:224,
  97. shopTypeList:[{name:"点菜",id:1},{name:"评价",id:2},{name:"店铺",id:3},],
  98. shopType:1,//组件类型
  99. shopTypeBsLeft:12,
  100. }
  101. },
  102. onLoad(e) {
  103. },
  104. mounted() {
  105. this.getDomH();
  106. },
  107. methods:{
  108. toBack(){
  109. tools.leftClick()
  110. },
  111. getDomH(){
  112. let info = uni.createSelectorQuery().select('#shopInfoBox');
  113. info.boundingClientRect((data)=>{
  114. this.domHeigjt = data.height * 2 - 34
  115. }).exec()
  116. },
  117. scrolltolower(){
  118. console.log('触底');
  119. },
  120. seletShopType(item){
  121. if(this.shopType!=item.id){
  122. this.shopType = item.id;
  123. if(this.shopType == 1){
  124. this.shopTypeBsLeft = 12
  125. }else if(this.shopType == 2){
  126. this.shopTypeBsLeft = 166
  127. }else{
  128. this.shopTypeBsLeft = 160*2
  129. }
  130. }
  131. },
  132. openBuyCrad(){
  133. this.$refs.popupBuy.open()
  134. },
  135. },
  136. }
  137. </script>
  138. <style scoped lang="scss">
  139. .shop-index{
  140. position: relative;
  141. .bg-img{
  142. position: absolute;
  143. top: 0;
  144. left: 0;
  145. width: 100%;
  146. height: 280rpx;
  147. z-index: -1;
  148. }
  149. .nav-box{
  150. margin-bottom: 110rpx;
  151. .nav-img{
  152. width: 56rpx;
  153. height: 56rpx;
  154. }
  155. }
  156. .shop-buttom-money{
  157. width: 100%;
  158. height: 140rpx;
  159. background: rgba(255,255,255,0.8);
  160. padding: 20rpx 24rpx;
  161. .shop-buttom-money-1{
  162. width: 100%;
  163. height: 100%;
  164. background: #333333;
  165. border-radius: 200rpx;
  166. box-sizing: border-box;
  167. padding-left: 136rpx;
  168. padding-right: 32rpx;
  169. position: relative;
  170. image{
  171. position: absolute;
  172. bottom: 0;
  173. left: 8rpx;
  174. width: 128rpx;
  175. height: 128rpx;
  176. }
  177. .shop-buttom-num{
  178. width: 32rpx;
  179. height: 32rpx;
  180. line-height: 32rpx;
  181. background: #FB3D03;
  182. border-radius: 50%;
  183. position: absolute;
  184. top: 36rpx;
  185. left: 82rpx;
  186. }
  187. }
  188. }
  189. .head-box{
  190. width: 100%;
  191. position: relative;
  192. .shop-info-box{
  193. position: absolute;
  194. top: -50rpx;
  195. left: 24rpx;
  196. width: 702rpx;
  197. min-height: 258rpx;
  198. border-radius: 20rpx;
  199. box-shadow: 0rpx 0rpx 20rpx 0rpx rgba(0,0,0,0.1);
  200. .info-box-top{
  201. .box-top-left{
  202. .top-left-1{
  203. width: 480rpx;
  204. margin-bottom: 8rpx;
  205. }
  206. .img-x{
  207. width: 24rpx;
  208. height: 24rpx;
  209. }
  210. }
  211. .box-top-right{
  212. width: 100rpx;
  213. height: 100rpx;
  214. border-radius: 12rpx;
  215. }
  216. }
  217. .info-box-quan-list{
  218. width: 124rpx;
  219. height: 48rpx;
  220. margin: 0 8rpx 8rpx 0;
  221. position: relative;
  222. image{
  223. width: 124rpx;
  224. height: 48rpx;
  225. position: absolute;
  226. top: 0;
  227. left: 0;
  228. z-index: 1;
  229. }
  230. .quan-list-1{
  231. position: absolute;
  232. top: 3rpx;
  233. left: 8rpx;
  234. z-index: 2;
  235. }
  236. .quan-list-2{
  237. position: absolute;
  238. top: 8rpx;
  239. right: 12rpx;
  240. z-index: 2;
  241. }
  242. }
  243. }
  244. }
  245. .head-box-1{
  246. width: 100%;
  247. height: 88rpx;
  248. border-bottom: 1rpx solid #eee;
  249. .shop-type-list{
  250. height: 88rpx;
  251. position: relative;
  252. .shop-item-bs{
  253. position: absolute;
  254. bottom: 0;
  255. width: 40rpx;
  256. height: 6rpx;
  257. border-radius: 20rpx;
  258. background-color: #41ABF5;
  259. transition: left 0.5s;
  260. }
  261. .shop-item{
  262. margin-right: 90rpx;
  263. position: relative;
  264. .pj-num{
  265. position: absolute;
  266. right: -80rpx;
  267. top: 0;
  268. text-align: left;
  269. width: 80rpx;
  270. }
  271. }
  272. .s-item{
  273. font-weight: 600;
  274. }
  275. .n-item{
  276. font-weight: 400;
  277. color: #666666;
  278. }
  279. }
  280. }
  281. .buy-card{
  282. height: 828rpx;
  283. background-color: #fff;
  284. border-radius: 24rpx 24rpx 0rpx 0rpx;
  285. .buy-card-top{
  286. width: 100%;
  287. height: 92rpx;
  288. background: #FCF5DB;
  289. border-radius: 24rpx 24rpx 0rpx 0rpx;
  290. }
  291. }
  292. }
  293. </style>