shop.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599
  1. <template>
  2. <view class="shop-index iPhone-bottom flex-common-css box-border-box">
  3. <image class="bg-img" :src="shopsInfo.shop_logo" mode="aspectFill"></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"
  9. mode="scaleToFill"></image>
  10. </view>
  11. </template>
  12. </Nav>
  13. </view>
  14. <view class="head-box bgc-f box-border-box plr-24" :style="{height:domHeigjt + 'rpx'}">
  15. <view id="shopInfoBox" class="shop-info-box bgc-f box-border-box p-24">
  16. <view class="info-box-top flex-justify-space">
  17. <view class="box-top-left">
  18. <view class="top-left-1 fs-40 fw-600 text-overflow-ellipsis-one">{{shopsInfo.shop_name}}
  19. </view>
  20. <view class="align-items-center mb-8">
  21. <image class="img-x mr-12" src="@/static/img/my/wdpj.png" mode=""></image>
  22. <view class="fs-26 fw-600 fc-FF7F00 mr-12">{{shopsInfo.shop_score}}分</view>
  23. <view class="fc-6 fs-24 mr-12">| 预计{{shopsInfo.delivery_time}}分钟 |</view>
  24. <view class="fc-6 fs-24 mr-12">{{shopsInfo.shop_sales}}人购买</view>
  25. </view>
  26. </view>
  27. <image class="box-top-right" :src="shopsInfo.shop_logo" mode="scaleToFill"></image>
  28. </view>
  29. <view class="fs-24 fw-400 fc-9 mb-20 text-overflow-ellipsis-one">
  30. 公告:{{shopsInfo.notice}}
  31. </view>
  32. <view class="flex-wrap-wrap">
  33. <view class="info-box-quan-list" v-for="(item,i) in couponData" :key="i" @click="openCoupon">
  34. <image src="@/static/img/takeout/quan-bg.png" mode=""></image>
  35. <view class="quan-list-1 fw-b fs-32 fc-f">
  36. <span class="fw-b fs-20 fc-f">¥</span>{{item.money}}
  37. </view>
  38. <view class="quan-list-2 fw-400 fs-24 fc-f">领</view>
  39. </view>
  40. </view>
  41. </view>
  42. </view>
  43. <view class="head-box-1 bgc-f box-border-box plr-24">
  44. <view class="align-items-center shop-type-list">
  45. <view class="shop-item fs-32" @click="seletShopType(item)"
  46. :class="shopType === item.id?'s-item':'n-item'" v-for="(item,i) in shopTypeList" :key="i">
  47. {{item.name}}
  48. <!-- <view v-if="item.id == 2" class="pj-num" :class="shopType === item.id?'s-item':'n-item'">999+</view> -->
  49. </view>
  50. <view class="shop-item-bs" :style="{left:shopTypeBsLeft+'rpx'}"></view>
  51. </view>
  52. </view>
  53. <view class="common-view-css bgc-f" style="overflow: hidden;">
  54. <Menu style="height: 100%;" v-if="shopType === 1"></Menu>
  55. <Evaluate style="height: 100%;" :shopId='shop_id' :shopScore='shopsInfo.shop_score' v-else-if="shopType === 2"></Evaluate>
  56. <ShopInfo style="height: 100%;" :shopId='shop_id' v-else-if="shopType === 3"></ShopInfo>
  57. </view>
  58. <view class="shop-buttom-money box-border-box" @click="openBuyCrad()">
  59. <view class="shop-buttom-money-1 flex-justify-space align-items-center">
  60. <image src="@/static/img/takeout/buy-icon.png" mode="scaleToFill"></image>
  61. <view class="shop-buttom-num fs-24 fc-f text-align-center">3</view>
  62. <view class="">
  63. <view class="">
  64. <span class="fw-600 fs-24 fc-f">¥</span>
  65. <span class="fw-600 fs-44 fc-f">19.26</span>
  66. </view>
  67. <!-- <view class="fs-24 fc-ADADAD">免配送</view> -->
  68. <view class="fs-24 fc-ff3939">配送费¥10</view>
  69. </view>
  70. <view class="fs-32 fw-600 fc-f mr-30">20元起送</view>
  71. <!-- <view class="shop-buttom-money-2 text-align-center fc-f fs-32 fw-600">去结算</view> -->
  72. </view>
  73. </view>
  74. <uni-popup ref="popupBuy" type="bottom">
  75. <view class="buy-card flex-index-css">
  76. <view class="buy-card-top box-border-box plr-32 flex-justify-space align-items-center">
  77. <view class="">
  78. <span class="fs-32 fc-3 mr-12">已选商品</span>
  79. <span class="fs-32 fc-9">(打包费<span class="fs-32 fc-FB3D03">8元</span>)</span>
  80. </view>
  81. <view class="fs-28 fw-400 fc-9 align-items-center">
  82. <view class="">
  83. <uni-icons type="trash" size="18" color="#999"></uni-icons>
  84. </view>
  85. <view class="fs-28 fw-400 fc-9">清空</view>
  86. </view>
  87. </view>
  88. <view class="scroll-view-css box-border-box p-32">
  89. <view class="buy-card-item display-flex" v-for="(item,i) in 5" :key="i">
  90. <image src="@/static/img/my/bg.png" mode="scaleToFill"></image>
  91. <view class="flex-1">
  92. <view class="w-514 text-overflow-ellipsis-one fs-34 fw-600 mb-12">
  93. [畅销款]奥尔1良烤肉牛油拌饭拌饭[畅销款]奥尔1良烤肉牛油拌饭拌饭</view>
  94. <view class="w-514 text-overflow-ellipsis-one fs-24 fw-400 fc-9 mb-18">不辣,加辣</view>
  95. <view class="flex-justify-space">
  96. <view class="">
  97. <span class="fs-24 fc-FB3D03 fw-400">¥</span>
  98. <span class="fs-40 fc-FB3D03 fw-b">3.99</span>
  99. </view>
  100. <view class="display-flex align-items-center">
  101. <view class="right-only-right-red fw-500 text-align-center fs-36 fc-f">-</view>
  102. <view class="right-only-right-2 text-align-center fs-28 fw-400">1</view>
  103. <view class="right-only-right-add fw-500 text-align-center fs-36 fc-f">+</view>
  104. </view>
  105. </view>
  106. </view>
  107. </view>
  108. </view>
  109. <view class="shop-buttom-money box-border-box" @click="createOrder()">
  110. <view class="shop-buttom-money-1 flex-justify-space align-items-center">
  111. <image src="@/static/img/takeout/buy-icon.png" mode="scaleToFill"></image>
  112. <view class="shop-buttom-num fs-24 fc-f text-align-center">3</view>
  113. <view class="">
  114. <view class="">
  115. <span class="fw-600 fs-24 fc-f">¥</span>
  116. <span class="fw-600 fs-44 fc-f">19.26</span>
  117. </view>
  118. <!-- <view class="fs-24 fc-ADADAD">免配送</view> -->
  119. <view class="fs-24 fc-ff3939">配送费¥10</view>
  120. </view>
  121. <!-- <view class="fs-32 fw-600 fc-f mr-30">20元起送</view> -->
  122. <view class="shop-buttom-money-2 text-align-center fs-32 fc-f fw-600" @click="toConfirmOrder()">
  123. 去结算</view>
  124. </view>
  125. </view>
  126. </view>
  127. </uni-popup>
  128. <uni-popup ref="popupCoupon" type="bottom">
  129. <view class="pop-coupon box-border-box p-24">
  130. <view class="text-align-center fs-36 fw-600 box-title mb-32">
  131. 本店优惠券
  132. <uni-icons @click="closeCoupon" class="box-close" type="closeempty" size="20"></uni-icons>
  133. </view>
  134. <view class="scroll-view-css">
  135. <view class="item-box display-flex mb-20" v-for="(item,index) in 10" :key="index">
  136. <view class="item-right flex-direction flex-justify-center flex-1 bgc-f">
  137. <view class="fs-28 mb-12 ticket-name text-overflow-ellipsis fc-3 fw-600">
  138. 优惠券名称优惠券名称优惠券名称优惠券名称优
  139. </view>
  140. <view class="fs-24 fc-6">
  141. 有效时间:2024.05.08-2024.05.24
  142. </view>
  143. </view>
  144. <view class="item-hr"></view>
  145. <view class="item-left flex-direction align-items-center flex-justify-center bgc-FCE7E2">
  146. <view class="align-items-center">
  147. <view class="fs-30 fw-600 fc-FB3D03">¥</view>
  148. <view class="fs-48 fw-600 fc-FB3D03">10</view>
  149. </view>
  150. <view class="fs-24 mb-18 fc-6">
  151. 满90元可用
  152. </view>
  153. <view class="but-box fs-28 fc-f">
  154. 立即领取
  155. </view>
  156. <view class="ball"></view>
  157. <view class="ball-two"></view>
  158. </view>
  159. </view>
  160. </view>
  161. </view>
  162. </uni-popup>
  163. </view>
  164. </template>
  165. <script>
  166. import Menu from './shop-mod/menu.vue';
  167. import Evaluate from './shop-mod/evaluate.vue';
  168. import ShopInfo from './shop-mod/info.vue';
  169. import tools from "@/service/tools";
  170. import {
  171. shopInfo,
  172. shopCoupon
  173. } from "@/api/shop.js"
  174. export default {
  175. components: {
  176. Menu,
  177. Evaluate,
  178. ShopInfo
  179. },
  180. data() {
  181. return {
  182. domHeigjt: 224,
  183. shopTypeList: [{
  184. name: "点菜",
  185. id: 1
  186. }, {
  187. name: "评价",
  188. id: 2
  189. }, {
  190. name: "店铺",
  191. id: 3
  192. }, ],
  193. shopType: 1, //组件类型
  194. shopTypeBsLeft: 12,
  195. shop_id: '',
  196. shopsInfo: {},
  197. couponData: [] // 可领优惠卷
  198. }
  199. },
  200. onLoad(e) {
  201. if (e) {
  202. this.shop_id = e.shop_id
  203. this.shopInfo()
  204. }
  205. },
  206. mounted() {
  207. this.getDomH();
  208. this.shopCoupon()
  209. },
  210. methods: {
  211. toBack() {
  212. tools.leftClick()
  213. },
  214. getDomH() {
  215. let info = uni.createSelectorQuery().select('#shopInfoBox');
  216. info.boundingClientRect((data) => {
  217. this.domHeigjt = data.height * 2 - 34
  218. }).exec()
  219. },
  220. scrolltolower() {
  221. console.log('触底');
  222. },
  223. seletShopType(item) {
  224. if (this.shopType != item.id) {
  225. this.shopType = item.id;
  226. if (this.shopType == 1) {
  227. this.shopTypeBsLeft = 12
  228. } else if (this.shopType == 2) {
  229. this.shopTypeBsLeft = 166
  230. } else {
  231. this.shopTypeBsLeft = 160 * 2
  232. }
  233. }
  234. },
  235. openBuyCrad() {
  236. this.$refs.popupBuy.open()
  237. },
  238. createOrder() {
  239. },
  240. openCoupon() {
  241. this.$refs.popupCoupon.open()
  242. },
  243. closeCoupon() {
  244. this.$refs.popupCoupon.close()
  245. },
  246. toConfirmOrder() {
  247. uni.navigateTo({
  248. url: '/pages-takeout/confirm-order'
  249. })
  250. },
  251. shopInfo() {
  252. const operate_id = uni.getStorageSync('operate_id')
  253. shopInfo({
  254. operate_id: operate_id,
  255. shop_id: this.shop_id
  256. }).then((res) => {
  257. if (res.code == 1) {
  258. this.shopsInfo = res.data
  259. }
  260. })
  261. },
  262. shopCoupon() {
  263. const operate_id = uni.getStorageSync('operate_id')
  264. shopCoupon({
  265. operate_id: operate_id,
  266. shop_id: this.shop_id
  267. }).then((res) => {
  268. if (res.code == 1) {
  269. this.couponData = res.data
  270. }
  271. })
  272. }
  273. },
  274. }
  275. </script>
  276. <style scoped lang="scss">
  277. .pop-coupon {
  278. width: 100%;
  279. height: 42vh;
  280. background-color: #F5F4F9;
  281. border-radius: 24rpx 24rpx 0rpx 0rpx;
  282. padding-top: 32rpx !important;
  283. display: flex;
  284. flex-direction: column;
  285. .box-title {
  286. position: relative;
  287. .box-close {
  288. position: absolute;
  289. right: 22rpx;
  290. }
  291. }
  292. .item-right {
  293. padding: 24rpx;
  294. box-sizing: border-box;
  295. border-radius: 20rpx 0 0 20rpx;
  296. position: relative;
  297. }
  298. .item-hr {
  299. width: 0px;
  300. height: auto;
  301. border-right: 1rpx dashed #FB7850;
  302. }
  303. .item-hr-two {
  304. width: 0px;
  305. height: auto;
  306. border-right: 1rpx dashed #999;
  307. }
  308. .item-left {
  309. width: 200rpx;
  310. height: auto;
  311. padding: 20rpx 24rpx;
  312. box-sizing: border-box;
  313. position: relative;
  314. border-radius: 0 20rpx 20rpx 0;
  315. }
  316. .but-box {
  317. width: 152rpx;
  318. height: 52rpx;
  319. line-height: 52rpx;
  320. text-align: center;
  321. background: linear-gradient(225deg, #FB3D03 0%, #FF6901 100%);
  322. border-radius: 200rpx;
  323. }
  324. .ball {
  325. width: 24rpx;
  326. height: 24rpx;
  327. border-radius: 50%;
  328. position: absolute;
  329. top: -12rpx;
  330. left: -12rpx;
  331. background: #F5F5F5;
  332. z-index: 2;
  333. }
  334. .ball-two {
  335. width: 24rpx;
  336. height: 24rpx;
  337. border-radius: 50%;
  338. position: absolute;
  339. background: #F5F5F5;
  340. z-index: 10;
  341. bottom: -12rpx;
  342. left: -12rpx;
  343. }
  344. }
  345. .shop-index {
  346. position: relative;
  347. .right-only-right-red {
  348. width: 44rpx;
  349. height: 44rpx;
  350. line-height: 40rpx;
  351. border-radius: 12rpx;
  352. border: 1rpx solid #41ABF5;
  353. color: #41ABF5;
  354. }
  355. .right-only-right-add {
  356. width: 44rpx;
  357. height: 44rpx;
  358. line-height: 40rpx;
  359. background: linear-gradient(117deg, #57CAFF 0%, #41ABF5 100%);
  360. border-radius: 12rpx;
  361. }
  362. .right-only-right-2 {
  363. min-width: 50rpx;
  364. }
  365. .w-514 {
  366. width: 514rpx;
  367. }
  368. .bg-img {
  369. position: absolute;
  370. top: 0;
  371. left: 0;
  372. width: 100%;
  373. height: 280rpx;
  374. z-index: -1;
  375. }
  376. .nav-box {
  377. margin-bottom: 110rpx;
  378. .nav-img {
  379. width: 56rpx;
  380. height: 56rpx;
  381. }
  382. }
  383. .shop-buttom-money {
  384. width: 100%;
  385. height: 140rpx;
  386. background: rgba(255, 255, 255, 0.8);
  387. padding: 20rpx 24rpx;
  388. .shop-buttom-money-1 {
  389. width: 100%;
  390. height: 100%;
  391. background: #333333;
  392. border-radius: 200rpx;
  393. box-sizing: border-box;
  394. padding-left: 136rpx;
  395. // padding-right: 32rpx;
  396. position: relative;
  397. image {
  398. position: absolute;
  399. bottom: 0;
  400. left: 8rpx;
  401. width: 128rpx;
  402. height: 128rpx;
  403. }
  404. .shop-buttom-num {
  405. width: 32rpx;
  406. height: 32rpx;
  407. line-height: 32rpx;
  408. background: #FB3D03;
  409. border-radius: 50%;
  410. position: absolute;
  411. top: 36rpx;
  412. left: 82rpx;
  413. }
  414. .shop-buttom-money-2 {
  415. width: 200rpx;
  416. height: 100rpx;
  417. line-height: 100rpx;
  418. background: #41ABF5;
  419. border-radius: 0rpx 200rpx 200rpx 0rpx;
  420. }
  421. }
  422. }
  423. .head-box {
  424. width: 100%;
  425. position: relative;
  426. .shop-info-box {
  427. position: absolute;
  428. top: -50rpx;
  429. left: 24rpx;
  430. width: 702rpx;
  431. min-height: 258rpx;
  432. border-radius: 20rpx;
  433. box-shadow: 0rpx 0rpx 20rpx 0rpx rgba(0, 0, 0, 0.1);
  434. .info-box-top {
  435. .box-top-left {
  436. .top-left-1 {
  437. width: 480rpx;
  438. margin-bottom: 8rpx;
  439. }
  440. .img-x {
  441. width: 24rpx;
  442. height: 24rpx;
  443. }
  444. }
  445. .box-top-right {
  446. width: 100rpx;
  447. height: 100rpx;
  448. border-radius: 12rpx;
  449. }
  450. }
  451. .info-box-quan-list {
  452. width: 164rpx;
  453. height: 48rpx;
  454. margin: 0 8rpx 8rpx 0;
  455. position: relative;
  456. image {
  457. width: 164rpx;
  458. height: 48rpx;
  459. position: absolute;
  460. top: 0;
  461. left: 0;
  462. z-index: 1;
  463. }
  464. .quan-list-1 {
  465. position: absolute;
  466. top: 3rpx;
  467. left: 8rpx;
  468. z-index: 2;
  469. }
  470. .quan-list-2 {
  471. position: absolute;
  472. top: 8rpx;
  473. right: 22rpx;
  474. z-index: 2;
  475. }
  476. }
  477. }
  478. }
  479. .head-box-1 {
  480. width: 100%;
  481. height: 88rpx;
  482. border-bottom: 1rpx solid #eee;
  483. .shop-type-list {
  484. height: 88rpx;
  485. position: relative;
  486. .shop-item-bs {
  487. position: absolute;
  488. bottom: 0;
  489. width: 40rpx;
  490. height: 6rpx;
  491. border-radius: 20rpx;
  492. background-color: #41ABF5;
  493. transition: left 0.5s;
  494. }
  495. .shop-item {
  496. margin-right: 90rpx;
  497. position: relative;
  498. .pj-num {
  499. position: absolute;
  500. right: -80rpx;
  501. top: 0;
  502. text-align: left;
  503. width: 80rpx;
  504. }
  505. }
  506. .s-item {
  507. font-weight: 600;
  508. color: 333;
  509. }
  510. .n-item {
  511. font-weight: 400;
  512. color: #999;
  513. }
  514. }
  515. }
  516. .buy-card {
  517. height: 828rpx;
  518. background-color: #fff;
  519. border-radius: 24rpx 24rpx 0rpx 0rpx;
  520. .buy-card-top {
  521. width: 100%;
  522. height: 92rpx;
  523. background: #FCF5DB;
  524. border-radius: 24rpx 24rpx 0rpx 0rpx;
  525. }
  526. .buy-card-item {
  527. width: 100%;
  528. height: 176rpx;
  529. margin-bottom: 32rpx;
  530. image {
  531. width: 152rpx;
  532. height: 152rpx;
  533. border-radius: 12rpx;
  534. margin-right: 20rpx;
  535. }
  536. }
  537. }
  538. }
  539. </style>