shop.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392
  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-if="shopType === 1"></Menu>
  53. <Evaluate style="height: 100%;" v-else-if="shopType === 2"></Evaluate>
  54. <ShopInfo style="height: 100%;" v-else-if="shopType === 3"></ShopInfo>
  55. </view>
  56. <view class="shop-buttom-money box-border-box" @click="openBuyCrad()">
  57. <view class="shop-buttom-money-1 flex-justify-space align-items-center">
  58. <image src="@/static/img/takeout/buy-icon.png" mode="scaleToFill"></image>
  59. <view class="shop-buttom-num fs-24 fc-f text-align-center">3</view>
  60. <view class="">
  61. <view class="">
  62. <span class="fw-600 fs-24 fc-f">¥</span>
  63. <span class="fw-600 fs-44 fc-f">19.26</span>
  64. </view>
  65. <!-- <view class="fs-24 fc-ADADAD">免配送</view> -->
  66. <view class="fs-24 fc-ff3939">配送费¥10</view>
  67. </view>
  68. <view class="fs-32 fw-600 fc-f mr-30">20元起送</view>
  69. <!-- <view class="shop-buttom-money-2 text-align-center fc-f fs-32 fw-600">去结算</view> -->
  70. </view>
  71. </view>
  72. <uni-popup ref="popupBuy" type="bottom">
  73. <view class="buy-card flex-index-css">
  74. <view class="buy-card-top box-border-box plr-32 flex-justify-space align-items-center">
  75. <view class="">
  76. <span class="fs-32 fc-3 mr-12">已选商品</span>
  77. <span class="fs-32 fc-9">(打包费<span class="fs-32 fc-FB3D03">8元</span>)</span>
  78. </view>
  79. <view class="fs-28 fw-400 fc-9 align-items-center">
  80. <view class="">
  81. <uni-icons type="trash" size="18" color="#999"></uni-icons>
  82. </view>
  83. <view class="fs-28 fw-400 fc-9">清空</view>
  84. </view>
  85. </view>
  86. <view class="scroll-view-css box-border-box p-32">
  87. <view class="buy-card-item display-flex" v-for="(item,i) in 5" :key="i">
  88. <image src="@/static/img/my/bg.png" mode="scaleToFill"></image>
  89. <view class="flex-1">
  90. <view class="w-514 text-overflow-ellipsis-one fs-34 fw-600 mb-12">[畅销款]奥尔1良烤肉牛油拌饭拌饭[畅销款]奥尔1良烤肉牛油拌饭拌饭</view>
  91. <view class="w-514 text-overflow-ellipsis-one fs-24 fw-400 fc-9 mb-18">不辣,加辣</view>
  92. <view class="flex-justify-space">
  93. <view class="">
  94. <span class="fs-24 fc-FB3D03 fw-400">¥</span>
  95. <span class="fs-40 fc-FB3D03 fw-b">3.99</span>
  96. </view>
  97. <view class="display-flex align-items-center">
  98. <view class="right-only-right-red fw-500 text-align-center fs-36 fc-f">-</view>
  99. <view class="right-only-right-2 text-align-center fs-28 fw-400">1</view>
  100. <view class="right-only-right-add fw-500 text-align-center fs-36 fc-f">+</view>
  101. </view>
  102. </view>
  103. </view>
  104. </view>
  105. </view>
  106. <view class="shop-buttom-money box-border-box" @click="createOrder()">
  107. <view class="shop-buttom-money-1 flex-justify-space align-items-center">
  108. <image src="@/static/img/takeout/buy-icon.png" mode="scaleToFill"></image>
  109. <view class="shop-buttom-num fs-24 fc-f text-align-center">3</view>
  110. <view class="">
  111. <view class="">
  112. <span class="fw-600 fs-24 fc-f">¥</span>
  113. <span class="fw-600 fs-44 fc-f">19.26</span>
  114. </view>
  115. <!-- <view class="fs-24 fc-ADADAD">免配送</view> -->
  116. <view class="fs-24 fc-ff3939">配送费¥10</view>
  117. </view>
  118. <!-- <view class="fs-32 fw-600 fc-f mr-30">20元起送</view> -->
  119. <view class="shop-buttom-money-2 text-align-center fs-32 fc-f fw-600">去结算</view>
  120. </view>
  121. </view>
  122. </view>
  123. </uni-popup>
  124. </view>
  125. </template>
  126. <script>
  127. import Menu from './shop-mod/menu.vue';
  128. import Evaluate from './shop-mod/evaluate.vue';
  129. import ShopInfo from './shop-mod/info.vue';
  130. import tools from "@/service/tools";
  131. export default {
  132. components:{Menu,Evaluate,ShopInfo},
  133. data(){
  134. return{
  135. domHeigjt:224,
  136. shopTypeList:[{name:"点菜",id:1},{name:"评价",id:2},{name:"店铺",id:3},],
  137. shopType:1,//组件类型
  138. shopTypeBsLeft:12,
  139. }
  140. },
  141. onLoad(e) {
  142. },
  143. mounted() {
  144. this.getDomH();
  145. },
  146. methods:{
  147. toBack(){
  148. tools.leftClick()
  149. },
  150. getDomH(){
  151. let info = uni.createSelectorQuery().select('#shopInfoBox');
  152. info.boundingClientRect((data)=>{
  153. this.domHeigjt = data.height * 2 - 34
  154. }).exec()
  155. },
  156. scrolltolower(){
  157. console.log('触底');
  158. },
  159. seletShopType(item){
  160. if(this.shopType!=item.id){
  161. this.shopType = item.id;
  162. if(this.shopType == 1){
  163. this.shopTypeBsLeft = 12
  164. }else if(this.shopType == 2){
  165. this.shopTypeBsLeft = 166
  166. }else{
  167. this.shopTypeBsLeft = 160*2
  168. }
  169. }
  170. },
  171. openBuyCrad(){
  172. this.$refs.popupBuy.open()
  173. },
  174. createOrder(){
  175. },
  176. },
  177. }
  178. </script>
  179. <style scoped lang="scss">
  180. .shop-index{
  181. position: relative;
  182. .right-only-right-red{
  183. width: 44rpx;
  184. height: 44rpx;
  185. line-height: 40rpx;
  186. border-radius: 12rpx;
  187. border: 1rpx solid #41ABF5;
  188. color: #41ABF5;
  189. }
  190. .right-only-right-add{
  191. width: 44rpx;
  192. height: 44rpx;
  193. line-height: 40rpx;
  194. background: linear-gradient( 117deg, #57CAFF 0%, #41ABF5 100%);
  195. border-radius: 12rpx;
  196. }
  197. .right-only-right-2{
  198. min-width: 50rpx;
  199. }
  200. .w-514{
  201. width: 514rpx;
  202. }
  203. .bg-img{
  204. position: absolute;
  205. top: 0;
  206. left: 0;
  207. width: 100%;
  208. height: 280rpx;
  209. z-index: -1;
  210. }
  211. .nav-box{
  212. margin-bottom: 110rpx;
  213. .nav-img{
  214. width: 56rpx;
  215. height: 56rpx;
  216. }
  217. }
  218. .shop-buttom-money{
  219. width: 100%;
  220. height: 140rpx;
  221. background: rgba(255,255,255,0.8);
  222. padding: 20rpx 24rpx;
  223. .shop-buttom-money-1{
  224. width: 100%;
  225. height: 100%;
  226. background: #333333;
  227. border-radius: 200rpx;
  228. box-sizing: border-box;
  229. padding-left: 136rpx;
  230. // padding-right: 32rpx;
  231. position: relative;
  232. image{
  233. position: absolute;
  234. bottom: 0;
  235. left: 8rpx;
  236. width: 128rpx;
  237. height: 128rpx;
  238. }
  239. .shop-buttom-num{
  240. width: 32rpx;
  241. height: 32rpx;
  242. line-height: 32rpx;
  243. background: #FB3D03;
  244. border-radius: 50%;
  245. position: absolute;
  246. top: 36rpx;
  247. left: 82rpx;
  248. }
  249. .shop-buttom-money-2{
  250. width: 200rpx;
  251. height: 100rpx;
  252. line-height: 100rpx;
  253. background: #41ABF5;
  254. border-radius: 0rpx 200rpx 200rpx 0rpx;
  255. }
  256. }
  257. }
  258. .head-box{
  259. width: 100%;
  260. position: relative;
  261. .shop-info-box{
  262. position: absolute;
  263. top: -50rpx;
  264. left: 24rpx;
  265. width: 702rpx;
  266. min-height: 258rpx;
  267. border-radius: 20rpx;
  268. box-shadow: 0rpx 0rpx 20rpx 0rpx rgba(0,0,0,0.1);
  269. .info-box-top{
  270. .box-top-left{
  271. .top-left-1{
  272. width: 480rpx;
  273. margin-bottom: 8rpx;
  274. }
  275. .img-x{
  276. width: 24rpx;
  277. height: 24rpx;
  278. }
  279. }
  280. .box-top-right{
  281. width: 100rpx;
  282. height: 100rpx;
  283. border-radius: 12rpx;
  284. }
  285. }
  286. .info-box-quan-list{
  287. width: 124rpx;
  288. height: 48rpx;
  289. margin: 0 8rpx 8rpx 0;
  290. position: relative;
  291. image{
  292. width: 124rpx;
  293. height: 48rpx;
  294. position: absolute;
  295. top: 0;
  296. left: 0;
  297. z-index: 1;
  298. }
  299. .quan-list-1{
  300. position: absolute;
  301. top: 3rpx;
  302. left: 8rpx;
  303. z-index: 2;
  304. }
  305. .quan-list-2{
  306. position: absolute;
  307. top: 8rpx;
  308. right: 12rpx;
  309. z-index: 2;
  310. }
  311. }
  312. }
  313. }
  314. .head-box-1{
  315. width: 100%;
  316. height: 88rpx;
  317. border-bottom: 1rpx solid #eee;
  318. .shop-type-list{
  319. height: 88rpx;
  320. position: relative;
  321. .shop-item-bs{
  322. position: absolute;
  323. bottom: 0;
  324. width: 40rpx;
  325. height: 6rpx;
  326. border-radius: 20rpx;
  327. background-color: #41ABF5;
  328. transition: left 0.5s;
  329. }
  330. .shop-item{
  331. margin-right: 90rpx;
  332. position: relative;
  333. .pj-num{
  334. position: absolute;
  335. right: -80rpx;
  336. top: 0;
  337. text-align: left;
  338. width: 80rpx;
  339. }
  340. }
  341. .s-item{
  342. font-weight: 600;
  343. }
  344. .n-item{
  345. font-weight: 400;
  346. color: #666666;
  347. }
  348. }
  349. }
  350. .buy-card{
  351. height: 828rpx;
  352. background-color: #fff;
  353. border-radius: 24rpx 24rpx 0rpx 0rpx;
  354. .buy-card-top{
  355. width: 100%;
  356. height: 92rpx;
  357. background: #FCF5DB;
  358. border-radius: 24rpx 24rpx 0rpx 0rpx;
  359. }
  360. .buy-card-item{
  361. width: 100%;
  362. height: 176rpx;
  363. margin-bottom: 32rpx;
  364. image{
  365. width: 152rpx;
  366. height: 152rpx;
  367. border-radius: 12rpx;
  368. margin-right: 20rpx;
  369. }
  370. }
  371. }
  372. }
  373. </style>