shop.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607
  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" :shop_id="shop_id"></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, shopCategory, shopGoods
  173. } from "@/api/shop.js"
  174. import {getGoodsList} from "@/api/goods";
  175. export default {
  176. components: {
  177. Menu,
  178. Evaluate,
  179. ShopInfo
  180. },
  181. data() {
  182. return {
  183. domHeigjt: 224,
  184. shopTypeList: [{
  185. name: "点菜",
  186. id: 1
  187. }, {
  188. name: "评价",
  189. id: 2
  190. }, {
  191. name: "店铺",
  192. id: 3
  193. }, ],
  194. shopType: 1, //组件类型
  195. shopTypeBsLeft: 12,
  196. shop_id: '',
  197. operate_id: '',
  198. shopsInfo: {},
  199. couponData: [], // 可领优惠卷
  200. goodsData: [], // 可领优惠卷
  201. categoryData: [], // 可领优惠卷
  202. }
  203. },
  204. onLoad(e) {
  205. if (e) {
  206. this.shop_id = e.shop_id
  207. this.operate_id = uni.getStorageSync('operate_id')
  208. this.shopInfo()
  209. }
  210. },
  211. mounted() {
  212. this.getDomH();
  213. this.shopCoupon()
  214. },
  215. methods: {
  216. toBack() {
  217. tools.leftClick()
  218. },
  219. getDomH() {
  220. let info = uni.createSelectorQuery().select('#shopInfoBox');
  221. info.boundingClientRect((data) => {
  222. this.domHeigjt = data.height * 2 - 34
  223. }).exec()
  224. },
  225. scrolltolower() {
  226. console.log('触底');
  227. },
  228. seletShopType(item) {
  229. if (this.shopType != item.id) {
  230. this.shopType = item.id;
  231. if (this.shopType == 1) {
  232. this.shopTypeBsLeft = 12
  233. } else if (this.shopType == 2) {
  234. this.shopTypeBsLeft = 166
  235. } else {
  236. this.shopTypeBsLeft = 160 * 2
  237. }
  238. }
  239. },
  240. openBuyCrad() {
  241. this.$refs.popupBuy.open()
  242. },
  243. createOrder() {
  244. },
  245. openCoupon() {
  246. this.$refs.popupCoupon.open()
  247. },
  248. closeCoupon() {
  249. this.$refs.popupCoupon.close()
  250. },
  251. toConfirmOrder() {
  252. uni.navigateTo({
  253. url: '/pages-takeout/confirm-order'
  254. })
  255. },
  256. shopInfo() {
  257. const operate_id = uni.getStorageSync('operate_id')
  258. shopInfo({
  259. operate_id: operate_id,
  260. shop_id: this.shop_id
  261. }).then((res) => {
  262. if (res.code == 1) {
  263. this.shopsInfo = res.data
  264. }else {
  265. tools.error(res.msg)
  266. tools.leftClick()
  267. }
  268. })
  269. },
  270. shopCoupon() {
  271. shopCoupon({
  272. operate_id: this.operate_id,
  273. shop_id: this.shop_id
  274. }).then((res) => {
  275. if (res.code == 1) {
  276. this.couponData = res.data
  277. }
  278. })
  279. }
  280. },
  281. }
  282. </script>
  283. <style scoped lang="scss">
  284. .pop-coupon {
  285. width: 100%;
  286. height: 42vh;
  287. background-color: #F5F4F9;
  288. border-radius: 24rpx 24rpx 0rpx 0rpx;
  289. padding-top: 32rpx !important;
  290. display: flex;
  291. flex-direction: column;
  292. .box-title {
  293. position: relative;
  294. .box-close {
  295. position: absolute;
  296. right: 22rpx;
  297. }
  298. }
  299. .item-right {
  300. padding: 24rpx;
  301. box-sizing: border-box;
  302. border-radius: 20rpx 0 0 20rpx;
  303. position: relative;
  304. }
  305. .item-hr {
  306. width: 0px;
  307. height: auto;
  308. border-right: 1rpx dashed #FB7850;
  309. }
  310. .item-hr-two {
  311. width: 0px;
  312. height: auto;
  313. border-right: 1rpx dashed #999;
  314. }
  315. .item-left {
  316. width: 200rpx;
  317. height: auto;
  318. padding: 20rpx 24rpx;
  319. box-sizing: border-box;
  320. position: relative;
  321. border-radius: 0 20rpx 20rpx 0;
  322. }
  323. .but-box {
  324. width: 152rpx;
  325. height: 52rpx;
  326. line-height: 52rpx;
  327. text-align: center;
  328. background: linear-gradient(225deg, #FB3D03 0%, #FF6901 100%);
  329. border-radius: 200rpx;
  330. }
  331. .ball {
  332. width: 24rpx;
  333. height: 24rpx;
  334. border-radius: 50%;
  335. position: absolute;
  336. top: -12rpx;
  337. left: -12rpx;
  338. background: #F5F5F5;
  339. z-index: 2;
  340. }
  341. .ball-two {
  342. width: 24rpx;
  343. height: 24rpx;
  344. border-radius: 50%;
  345. position: absolute;
  346. background: #F5F5F5;
  347. z-index: 10;
  348. bottom: -12rpx;
  349. left: -12rpx;
  350. }
  351. }
  352. .shop-index {
  353. position: relative;
  354. .right-only-right-red {
  355. width: 44rpx;
  356. height: 44rpx;
  357. line-height: 40rpx;
  358. border-radius: 12rpx;
  359. border: 1rpx solid #41ABF5;
  360. color: #41ABF5;
  361. }
  362. .right-only-right-add {
  363. width: 44rpx;
  364. height: 44rpx;
  365. line-height: 40rpx;
  366. background: linear-gradient(117deg, #57CAFF 0%, #41ABF5 100%);
  367. border-radius: 12rpx;
  368. }
  369. .right-only-right-2 {
  370. min-width: 50rpx;
  371. }
  372. .w-514 {
  373. width: 514rpx;
  374. }
  375. .bg-img {
  376. position: absolute;
  377. top: 0;
  378. left: 0;
  379. width: 100%;
  380. height: 280rpx;
  381. z-index: -1;
  382. }
  383. .nav-box {
  384. margin-bottom: 110rpx;
  385. .nav-img {
  386. width: 56rpx;
  387. height: 56rpx;
  388. }
  389. }
  390. .shop-buttom-money {
  391. width: 100%;
  392. height: 140rpx;
  393. background: rgba(255, 255, 255, 0.8);
  394. padding: 20rpx 24rpx;
  395. .shop-buttom-money-1 {
  396. width: 100%;
  397. height: 100%;
  398. background: #333333;
  399. border-radius: 200rpx;
  400. box-sizing: border-box;
  401. padding-left: 136rpx;
  402. // padding-right: 32rpx;
  403. position: relative;
  404. image {
  405. position: absolute;
  406. bottom: 0;
  407. left: 8rpx;
  408. width: 128rpx;
  409. height: 128rpx;
  410. }
  411. .shop-buttom-num {
  412. width: 32rpx;
  413. height: 32rpx;
  414. line-height: 32rpx;
  415. background: #FB3D03;
  416. border-radius: 50%;
  417. position: absolute;
  418. top: 36rpx;
  419. left: 82rpx;
  420. }
  421. .shop-buttom-money-2 {
  422. width: 200rpx;
  423. height: 100rpx;
  424. line-height: 100rpx;
  425. background: #41ABF5;
  426. border-radius: 0rpx 200rpx 200rpx 0rpx;
  427. }
  428. }
  429. }
  430. .head-box {
  431. width: 100%;
  432. position: relative;
  433. .shop-info-box {
  434. position: absolute;
  435. top: -50rpx;
  436. left: 24rpx;
  437. width: 702rpx;
  438. min-height: 258rpx;
  439. border-radius: 20rpx;
  440. box-shadow: 0rpx 0rpx 20rpx 0rpx rgba(0, 0, 0, 0.1);
  441. .info-box-top {
  442. .box-top-left {
  443. .top-left-1 {
  444. width: 480rpx;
  445. margin-bottom: 8rpx;
  446. }
  447. .img-x {
  448. width: 24rpx;
  449. height: 24rpx;
  450. }
  451. }
  452. .box-top-right {
  453. width: 100rpx;
  454. height: 100rpx;
  455. border-radius: 12rpx;
  456. }
  457. }
  458. .info-box-quan-list {
  459. width: 164rpx;
  460. height: 48rpx;
  461. margin: 0 8rpx 8rpx 0;
  462. position: relative;
  463. image {
  464. width: 164rpx;
  465. height: 48rpx;
  466. position: absolute;
  467. top: 0;
  468. left: 0;
  469. z-index: 1;
  470. }
  471. .quan-list-1 {
  472. position: absolute;
  473. top: 3rpx;
  474. left: 8rpx;
  475. z-index: 2;
  476. }
  477. .quan-list-2 {
  478. position: absolute;
  479. top: 8rpx;
  480. right: 22rpx;
  481. z-index: 2;
  482. }
  483. }
  484. }
  485. }
  486. .head-box-1 {
  487. width: 100%;
  488. height: 88rpx;
  489. border-bottom: 1rpx solid #eee;
  490. .shop-type-list {
  491. height: 88rpx;
  492. position: relative;
  493. .shop-item-bs {
  494. position: absolute;
  495. bottom: 0;
  496. width: 40rpx;
  497. height: 6rpx;
  498. border-radius: 20rpx;
  499. background-color: #41ABF5;
  500. transition: left 0.5s;
  501. }
  502. .shop-item {
  503. margin-right: 90rpx;
  504. position: relative;
  505. .pj-num {
  506. position: absolute;
  507. right: -80rpx;
  508. top: 0;
  509. text-align: left;
  510. width: 80rpx;
  511. }
  512. }
  513. .s-item {
  514. font-weight: 600;
  515. color: 333;
  516. }
  517. .n-item {
  518. font-weight: 400;
  519. color: #999;
  520. }
  521. }
  522. }
  523. .buy-card {
  524. height: 828rpx;
  525. background-color: #fff;
  526. border-radius: 24rpx 24rpx 0rpx 0rpx;
  527. .buy-card-top {
  528. width: 100%;
  529. height: 92rpx;
  530. background: #FCF5DB;
  531. border-radius: 24rpx 24rpx 0rpx 0rpx;
  532. }
  533. .buy-card-item {
  534. width: 100%;
  535. height: 176rpx;
  536. margin-bottom: 32rpx;
  537. image {
  538. width: 152rpx;
  539. height: 152rpx;
  540. border-radius: 12rpx;
  541. margin-right: 20rpx;
  542. }
  543. }
  544. }
  545. }
  546. </style>