shop.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515
  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" @click="openCoupon">
  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" @click="toConfirmOrder()">去结算</view>
  120. </view>
  121. </view>
  122. </view>
  123. </uni-popup>
  124. <uni-popup ref="popupCoupon" type="bottom">
  125. <view class="pop-coupon box-border-box p-24">
  126. <view class="text-align-center fs-36 fw-600 box-title mb-32">
  127. 本店优惠券
  128. <uni-icons @click="closeCoupon" class="box-close" type="closeempty" size="20"></uni-icons>
  129. </view>
  130. <view class="fs-28 fw-400 mb-24">免费领券</view>
  131. <view class="scroll-view-css">
  132. <view class="item-box display-flex mb-20" v-for="(item,index) in 10" :key="index">
  133. <view class="item-right flex-direction flex-justify-center flex-1 bgc-f">
  134. <view class="fs-28 mb-12 ticket-name text-overflow-ellipsis fc-3 fw-600">
  135. 优惠券名称优惠券名称优惠券名称优惠券名称优
  136. </view>
  137. <view class="fs-24 fc-6">
  138. 有效时间:2024.05.08-2024.05.24
  139. </view>
  140. </view>
  141. <view class="item-hr"></view>
  142. <view class="item-left flex-direction align-items-center flex-justify-center bgc-FCE7E2">
  143. <view class="align-items-center">
  144. <view class="fs-30 fw-600 fc-FB3D03">¥</view>
  145. <view class="fs-48 fw-600 fc-FB3D03">10</view>
  146. </view>
  147. <view class="fs-24 mb-18 fc-6">
  148. 满90元可用
  149. </view>
  150. <view class="but-box fs-28 fc-f">
  151. 立即领取
  152. </view>
  153. <view class="ball"></view>
  154. <view class="ball-two"></view>
  155. </view>
  156. </view>
  157. </view>
  158. </view>
  159. </uni-popup>
  160. </view>
  161. </template>
  162. <script>
  163. import Menu from './shop-mod/menu.vue';
  164. import Evaluate from './shop-mod/evaluate.vue';
  165. import ShopInfo from './shop-mod/info.vue';
  166. import tools from "@/service/tools";
  167. export default {
  168. components:{Menu,Evaluate,ShopInfo},
  169. data(){
  170. return{
  171. domHeigjt:224,
  172. shopTypeList:[{name:"点菜",id:1},{name:"评价",id:2},{name:"店铺",id:3},],
  173. shopType:1,//组件类型
  174. shopTypeBsLeft:12,
  175. }
  176. },
  177. onLoad(e) {
  178. },
  179. mounted() {
  180. this.getDomH();
  181. },
  182. methods:{
  183. toBack(){
  184. tools.leftClick()
  185. },
  186. getDomH(){
  187. let info = uni.createSelectorQuery().select('#shopInfoBox');
  188. info.boundingClientRect((data)=>{
  189. this.domHeigjt = data.height * 2 - 34
  190. }).exec()
  191. },
  192. scrolltolower(){
  193. console.log('触底');
  194. },
  195. seletShopType(item){
  196. if(this.shopType!=item.id){
  197. this.shopType = item.id;
  198. if(this.shopType == 1){
  199. this.shopTypeBsLeft = 12
  200. }else if(this.shopType == 2){
  201. this.shopTypeBsLeft = 166
  202. }else{
  203. this.shopTypeBsLeft = 160*2
  204. }
  205. }
  206. },
  207. openBuyCrad(){
  208. this.$refs.popupBuy.open()
  209. },
  210. createOrder(){
  211. },
  212. openCoupon(){
  213. this.$refs.popupCoupon.open()
  214. },
  215. closeCoupon(){
  216. this.$refs.popupCoupon.close()
  217. },
  218. toConfirmOrder(){
  219. uni.navigateTo({
  220. url:'/pages-takeout/confirm-order'
  221. })
  222. },
  223. },
  224. }
  225. </script>
  226. <style scoped lang="scss">
  227. .pop-coupon{
  228. width: 100%;
  229. height: 40vh;
  230. background-color: #F5F4F9;
  231. border-radius: 24rpx 24rpx 0rpx 0rpx;
  232. padding-top: 32rpx !important;
  233. display: flex;
  234. flex-direction: column;
  235. .box-title{
  236. position: relative;
  237. .box-close{
  238. position: absolute;
  239. right: 22rpx;
  240. }
  241. }
  242. .item-right {
  243. padding: 24rpx;
  244. box-sizing: border-box;
  245. border-radius: 20rpx 0 0 20rpx;
  246. position: relative;
  247. }
  248. .item-hr {
  249. width: 0px;
  250. height: auto;
  251. border-right: 1rpx dashed #FB7850;
  252. }
  253. .item-hr-two {
  254. width: 0px;
  255. height: auto;
  256. border-right: 1rpx dashed #999;
  257. }
  258. .item-left {
  259. width: 200rpx;
  260. height: auto;
  261. padding: 20rpx 24rpx;
  262. box-sizing: border-box;
  263. position: relative;
  264. border-radius: 0 20rpx 20rpx 0;
  265. }
  266. .but-box {
  267. width: 152rpx;
  268. height: 52rpx;
  269. line-height: 52rpx;
  270. text-align: center;
  271. background: linear-gradient(225deg, #FB3D03 0%, #FF6901 100%);
  272. border-radius: 200rpx;
  273. }
  274. .ball {
  275. width: 24rpx;
  276. height: 24rpx;
  277. border-radius: 50%;
  278. position: absolute;
  279. top: -12rpx;
  280. left: -12rpx;
  281. background: #F5F5F5;
  282. z-index: 2;
  283. }
  284. .ball-two {
  285. width: 24rpx;
  286. height: 24rpx;
  287. border-radius: 50%;
  288. position: absolute;
  289. background: #F5F5F5;
  290. z-index: 10;
  291. bottom: -12rpx;
  292. left: -12rpx;
  293. }
  294. }
  295. .shop-index{
  296. position: relative;
  297. .right-only-right-red{
  298. width: 44rpx;
  299. height: 44rpx;
  300. line-height: 40rpx;
  301. border-radius: 12rpx;
  302. border: 1rpx solid #41ABF5;
  303. color: #41ABF5;
  304. }
  305. .right-only-right-add{
  306. width: 44rpx;
  307. height: 44rpx;
  308. line-height: 40rpx;
  309. background: linear-gradient( 117deg, #57CAFF 0%, #41ABF5 100%);
  310. border-radius: 12rpx;
  311. }
  312. .right-only-right-2{
  313. min-width: 50rpx;
  314. }
  315. .w-514{
  316. width: 514rpx;
  317. }
  318. .bg-img{
  319. position: absolute;
  320. top: 0;
  321. left: 0;
  322. width: 100%;
  323. height: 280rpx;
  324. z-index: -1;
  325. }
  326. .nav-box{
  327. margin-bottom: 110rpx;
  328. .nav-img{
  329. width: 56rpx;
  330. height: 56rpx;
  331. }
  332. }
  333. .shop-buttom-money{
  334. width: 100%;
  335. height: 140rpx;
  336. background: rgba(255,255,255,0.8);
  337. padding: 20rpx 24rpx;
  338. .shop-buttom-money-1{
  339. width: 100%;
  340. height: 100%;
  341. background: #333333;
  342. border-radius: 200rpx;
  343. box-sizing: border-box;
  344. padding-left: 136rpx;
  345. // padding-right: 32rpx;
  346. position: relative;
  347. image{
  348. position: absolute;
  349. bottom: 0;
  350. left: 8rpx;
  351. width: 128rpx;
  352. height: 128rpx;
  353. }
  354. .shop-buttom-num{
  355. width: 32rpx;
  356. height: 32rpx;
  357. line-height: 32rpx;
  358. background: #FB3D03;
  359. border-radius: 50%;
  360. position: absolute;
  361. top: 36rpx;
  362. left: 82rpx;
  363. }
  364. .shop-buttom-money-2{
  365. width: 200rpx;
  366. height: 100rpx;
  367. line-height: 100rpx;
  368. background: #41ABF5;
  369. border-radius: 0rpx 200rpx 200rpx 0rpx;
  370. }
  371. }
  372. }
  373. .head-box{
  374. width: 100%;
  375. position: relative;
  376. .shop-info-box{
  377. position: absolute;
  378. top: -50rpx;
  379. left: 24rpx;
  380. width: 702rpx;
  381. min-height: 258rpx;
  382. border-radius: 20rpx;
  383. box-shadow: 0rpx 0rpx 20rpx 0rpx rgba(0,0,0,0.1);
  384. .info-box-top{
  385. .box-top-left{
  386. .top-left-1{
  387. width: 480rpx;
  388. margin-bottom: 8rpx;
  389. }
  390. .img-x{
  391. width: 24rpx;
  392. height: 24rpx;
  393. }
  394. }
  395. .box-top-right{
  396. width: 100rpx;
  397. height: 100rpx;
  398. border-radius: 12rpx;
  399. }
  400. }
  401. .info-box-quan-list{
  402. width: 124rpx;
  403. height: 48rpx;
  404. margin: 0 8rpx 8rpx 0;
  405. position: relative;
  406. image{
  407. width: 124rpx;
  408. height: 48rpx;
  409. position: absolute;
  410. top: 0;
  411. left: 0;
  412. z-index: 1;
  413. }
  414. .quan-list-1{
  415. position: absolute;
  416. top: 3rpx;
  417. left: 8rpx;
  418. z-index: 2;
  419. }
  420. .quan-list-2{
  421. position: absolute;
  422. top: 8rpx;
  423. right: 12rpx;
  424. z-index: 2;
  425. }
  426. }
  427. }
  428. }
  429. .head-box-1{
  430. width: 100%;
  431. height: 88rpx;
  432. border-bottom: 1rpx solid #eee;
  433. .shop-type-list{
  434. height: 88rpx;
  435. position: relative;
  436. .shop-item-bs{
  437. position: absolute;
  438. bottom: 0;
  439. width: 40rpx;
  440. height: 6rpx;
  441. border-radius: 20rpx;
  442. background-color: #41ABF5;
  443. transition: left 0.5s;
  444. }
  445. .shop-item{
  446. margin-right: 90rpx;
  447. position: relative;
  448. .pj-num{
  449. position: absolute;
  450. right: -80rpx;
  451. top: 0;
  452. text-align: left;
  453. width: 80rpx;
  454. }
  455. }
  456. .s-item{
  457. font-weight: 600;
  458. }
  459. .n-item{
  460. font-weight: 400;
  461. color: #666666;
  462. }
  463. }
  464. }
  465. .buy-card{
  466. height: 828rpx;
  467. background-color: #fff;
  468. border-radius: 24rpx 24rpx 0rpx 0rpx;
  469. .buy-card-top{
  470. width: 100%;
  471. height: 92rpx;
  472. background: #FCF5DB;
  473. border-radius: 24rpx 24rpx 0rpx 0rpx;
  474. }
  475. .buy-card-item{
  476. width: 100%;
  477. height: 176rpx;
  478. margin-bottom: 32rpx;
  479. image{
  480. width: 152rpx;
  481. height: 152rpx;
  482. border-radius: 12rpx;
  483. margin-right: 20rpx;
  484. }
  485. }
  486. }
  487. }
  488. </style>