new-shop.vue 28 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063
  1. <template>
  2. <view class="shop-index iPhone-bottom flex-direction box-border-box">
  3. <image v-show="!navBgType" class="bg-img" src="@/static/img/order-food/shop-top.png" mode="aspectFill"
  4. :class="scrollTop > newNavHeight?'z-4':'z-3'"></image>
  5. <image v-show="navBgType" class="bg-img-type z-4" src="@/static/img/order-food/shop-top.png" mode="aspectFill"
  6. :style="{height:newNavHeight+'rpx',opacity:opacity}"></image>
  7. <newNav :leftShow="false" :textType='false' class="z-4 mb-32" @navHeight='navHeight'>
  8. <view slot="textContent" class="align-items-center flex-justify-end">
  9. <view class="ss-box b-rad-50 mr-24 align-items-center flex-justify-center">
  10. <image class="shop-search" src="@/static/img/order-food/shop-search.png" mode=""></image>
  11. </view>
  12. <view class="dd-box align-items-center flex-justify-center b-rad-200 mr-24">
  13. <image class="shp-list-img mr-8" src="@/static/img/order-food/shp-list.png" mode=""></image>
  14. <view class="fs-28 fc-f">
  15. 订单
  16. </view>
  17. </view>
  18. </view>
  19. </newNav>
  20. <view class="bgc-f box-border-box plr-32 mb-32 shop-info">
  21. <view class="shop-info-box bgc-f box-border-box p-24 z-3 b-rad-20">
  22. <view class="fs-40 fw-600 text-overflow-ellipsis mb-16">
  23. {{shopsInfo.shop_name || "山海鲜熬老灶麻辣火锅辣火锅辣火11 世家匠心传承店川"}}
  24. </view>
  25. <view class="fs-24 fw-400 fc-9 text-overflow-ellipsis-one">
  26. 公告:{{shopsInfo.notice||"第二份半价是同时下相同商品的第二份可享受半价受"}}
  27. </view>
  28. </view>
  29. </view>
  30. <view class="b-b-eee bgc-f box-border-box p-0-32-12 align-items-center flex-justify-space z-3 shop-type-box">
  31. <view class="align-items-center shop-type-list">
  32. <view class="shop-item fs-36 mb-8 mr-64" @click="seletShopType(item)"
  33. :class="shopType === item.id?'fc-3 fw-600':'fc-6'" v-for="(item,i) in shopTypeList" :key="i">
  34. {{item.name}}
  35. </view>
  36. <view class="shop-item-bs bgc-FF3333" :style="{left:shopTypeBsLeft+'rpx'}"></view>
  37. </view>
  38. <view class="align-items-center">
  39. <image class="zh-icon mr-8" src="@/static/img/order-food/zh-icon.png" mode="aspectFill"></image>
  40. <view class="fw-600 fs-32 fc-3">
  41. 桌号:17
  42. </view>
  43. </view>
  44. </view>
  45. <!-- <view class="bgc-f sticky-nav" :style="{ height: navBgType?`calc(100vh - ${newNavHeight}rpx - ${48}rpx)`:'auto'}"> -->
  46. <view class="bgc-f">
  47. <view class="menu-box box-border-box align-items-flex-start" v-if="shopType === 1">
  48. <view class="menu-box-left" :style="{top: newNavHeight + 'rpx'}">
  49. <view class="menu-box-left-box"
  50. :style="{height: menuLeftType?`calc(100vh - ${newNavHeight}rpx - ${68}rpx)`:''}">
  51. <view class="menu-type-list fs-26 box-border-box align-items-center flex-justify-center"
  52. v-for="(item,i) in categoryData" :key="i" @click="selectType(item)"
  53. :class="type === item.type?'bgc-f fc-3 fw-600':'fc-6 fw-400'" :id="'left-scroll'+ item.type">
  54. {{item.name}}
  55. <view class="menu-type-num fc-f" v-show="item.num > 0">{{item.num > 99?'99+':item.num}}</view>
  56. </view>
  57. </view>
  58. </view>
  59. <view class="menu-box-only">
  60. <view class="" v-for="(item,i) in categoryData" :key="i" :id="'scroll'+ item.type">
  61. <view class="fs-28 fw-600 fc-3 sticky-nav bgc-f p-20 box-border-box" :style="{top: newNavHeight + 'rpx'}">
  62. {{item.name}}
  63. </view>
  64. <view class="menu-list flex-justify-space box-border-box" v-for="(info,k) in item.list" :key="k"
  65. :id="'goods_id'+ info.goods_id">
  66. <image class="flex-shrink0 goods_img" :src="info.goods_image" mode="scaleToFill"></image>
  67. <view class="menu-list-right flex-direction flex-justify-space">
  68. <view class="mb-8">
  69. <view class="mb-4 goods-name text-overflow-ellipsis fs-32 fw-600">{{info.goods_name}}
  70. </view>
  71. <view class="text-overflow-ellipsis-one fw-400 fc-9 fs-24 mb-2 goods-name" v-if="info.spec_type == 1">
  72. {{info.goods_desc?info.goods_desc:''}}
  73. </view>
  74. <view class="fw-400 fc-9 fs-24">月销{{info.sales}}</view>
  75. </view>
  76. <view class="flex-justify-space align-items-flex-end">
  77. <view class="">
  78. <span class="fs-24 fw-400 fc-FB3D03">¥</span>
  79. <span class="fs-40 fw-b fc-FB3D03">{{info.seckill_money>0?info.seckill_money:info.price}}</span>
  80. </view>
  81. <view class="display-flex align-items-center" v-if="info.spec_type == 1">
  82. <image v-show="info.num > 0" class="wh-44" @click="addred(1,i,k,info)"
  83. src="@/static/img/takeout/j.png" mode=""></image>
  84. <view v-show="info.num > 0" class="right-only-right-2 text-align-center fs-28 fw-400">{{info.num}}
  85. </view>
  86. <image class="wh-44" src="@/static/img/takeout/add.png" @click="addred(2,i,k,info)" mode=""></image>
  87. </view>
  88. <view v-else class="right-only-right text-align-center" @click="addred(3,i,k,info)">
  89. <view class="fw-600 fs-28 fc-f">
  90. 选规格
  91. </view>
  92. <view class="selectedNum" v-if="info.num>0">
  93. {{info.num}}
  94. </view>
  95. </view>
  96. </view>
  97. </view>
  98. </view>
  99. </view>
  100. </view>
  101. </view>
  102. <!-- <newMenu style="height: 100%;" v-if="shopType === 1" :menuLeftType='menuLeftType' :newNavHeight='newNavHeight'
  103. :shop_id="shop_id" @setCartData="setCartData" @scrollToCategory='handleCategoryScroll' ref="goodsMenu">
  104. </newMenu> -->
  105. <ShopInfo style="height: 100%;" :shopId='shop_id' v-else-if="shopType === 2"></ShopInfo>
  106. </view>
  107. <!-- <view v-if="shopType === 1" class="shop-buttom-money box-border-box" @click="openBuyCrad()">
  108. <view class="shop-buttom-money-1 flex-justify-space align-items-center">
  109. <image src="@/static/img/takeout/buy-icon.png" mode="scaleToFill"></image>
  110. <view class="shop-buttom-num fs-24 fc-f text-align-center">{{cartData.total_num}}</view>
  111. <view class="">
  112. <view class="">
  113. <span class="fw-600 fs-24 fc-f">¥</span>
  114. <span class="fw-600 fs-44 fc-f">{{cartData.total_price}}</span>
  115. </view>
  116. <view class="fs-24 fc-ADADAD" v-if="delivery_money<=0">免配送</view>
  117. <view class="fs-24 fc-f" v-else>配送费¥{{delivery_money}}</view>
  118. </view>
  119. <view v-if="cartData.is_place_order===1" class="shop-buttom-money-2 text-align-center fc-f fs-32 fw-600"
  120. @click.stop="toConfirmOrder()">去结算
  121. </view>
  122. <view v-else class="err-msg fs-32 fw-600 fc-f mr-30" @click.stop="mustBut">{{cartData.err_msg}}</view>
  123. </view>
  124. </view> -->
  125. </view>
  126. </template>
  127. <script>
  128. import newMenu from './shop-mod/new-menu.vue';
  129. import ShopInfo from './shop-mod/info.vue';
  130. import tools from "@/service/tools";
  131. import EnBlank from "@/components/en-utils/en-blank/en-blank";
  132. import {
  133. receiveCoupon
  134. } from "@/api/coupon.js"
  135. import {
  136. shopInfo
  137. } from "@/api/shop.js"
  138. import {
  139. getDeliveryMoney
  140. } from "@/api/common";
  141. import {
  142. getShopIngList,
  143. setShopIngDel,
  144. shoppingSave
  145. } from "@/api/shopping";
  146. export default {
  147. components: {
  148. newMenu,
  149. ShopInfo,
  150. EnBlank
  151. },
  152. data() {
  153. return {
  154. domHeigjt: 0,
  155. shopTypeList: [{
  156. name: "点单",
  157. id: 1
  158. }, {
  159. name: "商家",
  160. id: 2
  161. }],
  162. shopType: 1, //组件类型
  163. shopTypeBsLeft: 12,
  164. shop_id: '',
  165. operate_id: '',
  166. shopsInfo: {},
  167. cartData: {
  168. total_price: 0,
  169. total_num: 0,
  170. total_goods_money: 0,
  171. pack_price: 0,
  172. must_category: 0,
  173. is_place_order: 0,
  174. err_msg: 0,
  175. goods_list: [],
  176. },
  177. isAjax: false,
  178. newNavHeight: '',
  179. navBgType: false,
  180. menuLeftType: false,
  181. scrollTop: 0,
  182. opacity: 0,
  183. heightOne: '',
  184. heightTwo: '',
  185. topHeight: '',
  186. idMark: '', //滚动自适应参数
  187. idMarkTwo: '', //滚动自适应参数
  188. type: 0, //分类标识
  189. typeList: [],
  190. categoryData: [{
  191. type: 0,
  192. name: '测试1',
  193. list: [{
  194. goods_id: 1,
  195. goods_name: '测试商品1-1',
  196. price: '10',
  197. goods_image: 'https://qcloud.dpfile.com/pc/JvY4fMzO0Km80S9Sn-tNxYin28jkvrNMJV-pUo8YwCctS4AHLKPXFhGyuI2dCwk8.jpg'
  198. }, {
  199. goods_id: 2,
  200. goods_name: '测试商品1-2',
  201. price: '10',
  202. goods_image: 'https://qcloud.dpfile.com/pc/JvY4fMzO0Km80S9Sn-tNxYin28jkvrNMJV-pUo8YwCctS4AHLKPXFhGyuI2dCwk8.jpg'
  203. }, {
  204. goods_id: 3,
  205. goods_name: '测试商品1-3',
  206. price: '10',
  207. goods_image: 'https://qcloud.dpfile.com/pc/JvY4fMzO0Km80S9Sn-tNxYin28jkvrNMJV-pUo8YwCctS4AHLKPXFhGyuI2dCwk8.jpg'
  208. }]
  209. }, {
  210. type: 1,
  211. name: '测试2',
  212. list: [{
  213. goods_id: 4,
  214. goods_name: '测试商品2-1',
  215. price: '10',
  216. goods_image: 'https://qcloud.dpfile.com/pc/JvY4fMzO0Km80S9Sn-tNxYin28jkvrNMJV-pUo8YwCctS4AHLKPXFhGyuI2dCwk8.jpg'
  217. }, {
  218. goods_id: 5,
  219. goods_name: '测试商品2-2',
  220. price: '10',
  221. goods_image: 'https://qcloud.dpfile.com/pc/JvY4fMzO0Km80S9Sn-tNxYin28jkvrNMJV-pUo8YwCctS4AHLKPXFhGyuI2dCwk8.jpg'
  222. }, {
  223. goods_id: 6,
  224. goods_name: '测试商品2-3',
  225. price: '10',
  226. goods_image: 'https://qcloud.dpfile.com/pc/JvY4fMzO0Km80S9Sn-tNxYin28jkvrNMJV-pUo8YwCctS4AHLKPXFhGyuI2dCwk8.jpg'
  227. }]
  228. }, {
  229. type: 2,
  230. name: '测试3',
  231. list: [{
  232. goods_id: 7,
  233. goods_name: '测试商品3',
  234. price: '10',
  235. goods_image: 'https://qcloud.dpfile.com/pc/JvY4fMzO0Km80S9Sn-tNxYin28jkvrNMJV-pUo8YwCctS4AHLKPXFhGyuI2dCwk8.jpg'
  236. }]
  237. }, {
  238. type: 3,
  239. name: '测试4',
  240. list: [{
  241. goods_id: 8,
  242. goods_name: '测试商品4',
  243. price: '10',
  244. goods_image: 'https://qcloud.dpfile.com/pc/JvY4fMzO0Km80S9Sn-tNxYin28jkvrNMJV-pUo8YwCctS4AHLKPXFhGyuI2dCwk8.jpg'
  245. }]
  246. }, {
  247. type: 4,
  248. name: '测试5',
  249. list: [{
  250. goods_id: 9,
  251. goods_name: '测试商品5',
  252. price: '10',
  253. goods_image: 'https://qcloud.dpfile.com/pc/JvY4fMzO0Km80S9Sn-tNxYin28jkvrNMJV-pUo8YwCctS4AHLKPXFhGyuI2dCwk8.jpg'
  254. }]
  255. },
  256. {
  257. type: 5,
  258. name: '测试6',
  259. list: [{
  260. goods_id: 10,
  261. goods_name: '测试商品6',
  262. price: '10',
  263. goods_image: 'https://qcloud.dpfile.com/pc/JvY4fMzO0Km80S9Sn-tNxYin28jkvrNMJV-pUo8YwCctS4AHLKPXFhGyuI2dCwk8.jpg'
  264. }]
  265. },
  266. {
  267. type: 6,
  268. name: '测试7',
  269. list: [{
  270. goods_id: 11,
  271. goods_name: '测试商品7',
  272. price: '10',
  273. goods_image: 'https://qcloud.dpfile.com/pc/JvY4fMzO0Km80S9Sn-tNxYin28jkvrNMJV-pUo8YwCctS4AHLKPXFhGyuI2dCwk8.jpg'
  274. }]
  275. },
  276. {
  277. type: 7,
  278. name: '测试8',
  279. list: [{
  280. goods_id: 12,
  281. goods_name: '测试商品8',
  282. price: '10',
  283. goods_image: 'https://qcloud.dpfile.com/pc/JvY4fMzO0Km80S9Sn-tNxYin28jkvrNMJV-pUo8YwCctS4AHLKPXFhGyuI2dCwk8.jpg'
  284. }]
  285. },
  286. {
  287. type: 8,
  288. name: '测试9',
  289. list: [{
  290. goods_id: 13,
  291. goods_name: '测试商品9',
  292. price: '10',
  293. goods_image: 'https://qcloud.dpfile.com/pc/JvY4fMzO0Km80S9Sn-tNxYin28jkvrNMJV-pUo8YwCctS4AHLKPXFhGyuI2dCwk8.jpg'
  294. }]
  295. },
  296. ],
  297. }
  298. },
  299. onShow() {},
  300. onLoad(e) {},
  301. mounted() {},
  302. onReachBottom(e) {
  303. console.log(e, '页面触底了');
  304. // uni.$emit('shopBottom',true)
  305. },
  306. // 监听页面滚动
  307. onPageScroll(e) {
  308. // e.scrollTop 获取滚动条距离页面顶部的距离
  309. this.scrollTop = e.scrollTop
  310. this.opacity = (Number(this.scrollTop) - 30)
  311. // 可以根据滚动位置执行相应逻辑
  312. if (e.scrollTop > 25) {
  313. this.navBgType = true
  314. } else {
  315. this.navBgType = false
  316. }
  317. if (e.scrollTop > (Number(this.newNavHeight) - 4)) {
  318. this.menuLeftType = true
  319. } else {
  320. this.menuLeftType = false
  321. }
  322. },
  323. methods: {
  324. selectType(item, itemTwo) {
  325. if (this.type != item.type) {
  326. this.type = item.type;
  327. this.idMark = 'scroll' + item.type
  328. // 立即更新
  329. this.$forceUpdate();
  330. // 延迟执行滚动
  331. setTimeout(() => {
  332. this.scrollToCategorySimple(item.type);
  333. }, 100);
  334. }
  335. },
  336. // 滚动方法
  337. scrollToCategorySimple(type) {
  338. const query = uni.createSelectorQuery();
  339. const selector = `#scroll${type}`;
  340. uni.pageScrollTo({
  341. selector: selector,
  342. duration: 300,
  343. });
  344. return
  345. let targetScrollTop = 0
  346. query.select('.shop-info').boundingClientRect(rect => {
  347. console.log('商家详情', rect);
  348. targetScrollTop += rect.height
  349. })
  350. query.select('.shop-type-box').boundingClientRect(rect => {
  351. console.log('详情切换', rect);
  352. targetScrollTop += rect.height + this.newNavHeight
  353. console.log('固定上部分位置', targetScrollTop);
  354. })
  355. query.select(selector).boundingClientRect(rect => {
  356. console.log('id找到元素,top:', rect);
  357. uni.pageScrollTo({
  358. scrollTop: targetScrollTop,
  359. duration: 300,
  360. success: () => {
  361. console.log('滚动完成');
  362. }
  363. });
  364. // 获取当前滚动位置
  365. // query.selectViewport().scrollOffset(res => {
  366. // // 计算目标滚动位置
  367. // // 减去固定元素的高度:导航栏 + 店铺信息 + 分类栏
  368. // const navHeight = this.newNavHeight ? uni.upx2px(this.newNavHeight) : 0;
  369. // const fixedOffset = navHeight + 200 + 100; // 可以根据实际情况调整
  370. // const targetScrollTop = res.scrollTop + rect.top - fixedOffset;
  371. // console.log('当前scrollTop:', res.scrollTop, '目标scrollTop:', targetScrollTop);
  372. // // 滚动到目标位置
  373. // uni.pageScrollTo({
  374. // scrollTop: targetScrollTop,
  375. // duration: 300,
  376. // success: () => {
  377. // console.log('滚动完成');
  378. // }
  379. // });
  380. // }).exec();
  381. }).exec();
  382. },
  383. getHeight() {
  384. const query = uni.createSelectorQuery();
  385. query.select('.shop-info').boundingClientRect(data => {
  386. this.heightOne = data.height;
  387. console.log(this.heightOne, '0000000000');
  388. }).exec();
  389. query.select('.shop-type-box').boundingClientRect(data => {
  390. this.heightTwo = data.height;
  391. this.topHeight = this.heightOne + this.heightTwo + this.newNavHeight
  392. console.log(this.topHeight, '111111');
  393. }).exec();
  394. },
  395. navHeight(e) {
  396. this.newNavHeight = e
  397. console.log(e, '000000000');
  398. },
  399. mustBut() {
  400. // 未点必选品
  401. const item = {
  402. type: this.cartData.must_category
  403. }
  404. this.$refs.goodsMenu.selectType(item)
  405. },
  406. setShopIngDel() {
  407. uni.showModal({
  408. title: '提示',
  409. content: '是否清除购物车商品?',
  410. success: (res) => {
  411. console.log(res)
  412. if (res.confirm) {
  413. setShopIngDel({
  414. 'shop_id': this.shop_id,
  415. 'type': 1,
  416. }).then((res) => {
  417. if (res.code === 1) {
  418. tools.success(res.msg)
  419. this.getShopIngList()
  420. this.$refs.popupBuy.close()
  421. } else {
  422. tools.error(res.msg)
  423. }
  424. })
  425. }
  426. }
  427. });
  428. },
  429. setShoppingSave(item, type) {
  430. if (type === 1) {
  431. // 加
  432. item.goods_number = item.goods_number + 1
  433. } else {
  434. // 减
  435. if (item.goods_number < 0) {
  436. return
  437. }
  438. item.goods_number = item.goods_number - 1
  439. }
  440. if (this.isAjax) {
  441. return
  442. }
  443. this.isAjax = true
  444. shoppingSave({
  445. 'type': 1,
  446. 'goods_id': item.goods_id,
  447. 'shop_id': this.shop_id,
  448. 'category_id': item.category_id,
  449. 'goods_spec_id': item.goods_spec_id,
  450. 'number': item.goods_number,
  451. }).then(res => {
  452. if (res.code == 1) {
  453. this.isAjax = false
  454. this.getShopIngList()
  455. }
  456. }).catch(() => {
  457. this.isAjax = false
  458. })
  459. },
  460. getShopIngList() {
  461. getShopIngList({
  462. 'shop_id': 111,
  463. }).then(res => {
  464. if (res.code === 1) {
  465. this.cartData = res.data
  466. if (this.shopType === 1) {
  467. setTimeout(() => {
  468. console.log('我的数据执行了')
  469. // this.$refs.goodsMenu.setShopIngList(this.cartData)
  470. }, 1000)
  471. }
  472. }
  473. })
  474. },
  475. setCartData(cartData) {
  476. this.cartData = cartData
  477. this.getDeliveryMoney()
  478. },
  479. getDeliveryMoney() {
  480. getDeliveryMoney({
  481. 'school_id': this.operate_id,
  482. 'shop_id': this.shop_id,
  483. }).then(res => {
  484. if (res.code === 1) {
  485. this.delivery_money = res.data.delivery_money * 1
  486. }
  487. })
  488. },
  489. toBack() {
  490. tools.leftClick()
  491. },
  492. getDomH(num) {
  493. this.$nextTick(() => {
  494. let info = uni.createSelectorQuery().select('#shopInfoBox');
  495. info.boundingClientRect((data) => {
  496. if (num === 1) {
  497. this.domHeigjt = data.height + 72
  498. } else {
  499. this.domHeigjt = data.height + 72 + 48
  500. }
  501. }).exec()
  502. })
  503. // setTimeout(() => {
  504. // }, 500)
  505. },
  506. scrolltolower() {
  507. console.log('触底');
  508. },
  509. seletShopType(item) {
  510. if (this.shopType != item.id) {
  511. this.shopType = item.id;
  512. if (this.shopType == 1) {
  513. this.shopTypeBsLeft = 12
  514. } else if (this.shopType == 2) {
  515. this.shopTypeBsLeft = 166
  516. } else {
  517. this.shopTypeBsLeft = 160 * 2
  518. }
  519. }
  520. },
  521. openBuyCrad() {
  522. this.$refs.popupBuy.open()
  523. },
  524. createOrder() {
  525. this.$refs.popupBuy.close()
  526. },
  527. openCoupon() {
  528. this.$refs.popupCoupon.open()
  529. },
  530. closeCoupon() {
  531. this.$refs.popupCoupon.close()
  532. },
  533. toConfirmOrder() {
  534. uni.navigateTo({
  535. url: '/pages-takeout/goods-order?shop_id=' + this.shop_id
  536. })
  537. },
  538. shopInfo() {
  539. const operate_id = uni.getStorageSync('operate_id')
  540. shopInfo({
  541. operate_id: operate_id,
  542. shop_id: this.shop_id
  543. }).then((res) => {
  544. if (res.code == 1) {
  545. this.shopsInfo = res.data
  546. } else {
  547. tools.error(res.msg)
  548. setTimeout(() => {
  549. uni.navigateBack({
  550. delta: 1
  551. })
  552. }, 1500)
  553. }
  554. })
  555. }
  556. },
  557. }
  558. </script>
  559. <style scoped lang="scss">
  560. .zh-icon {
  561. width: 32rpx;
  562. height: 32rpx;
  563. }
  564. .shp-list-img {
  565. width: 40rpx;
  566. height: 40rpx;
  567. }
  568. .dd-box {
  569. width: 144rpx;
  570. padding: 12rpx 0;
  571. background: rgba(0, 0, 0, 0.14);
  572. }
  573. .ss-box {
  574. width: 64rpx;
  575. height: 64rpx;
  576. background: rgba(0, 0, 0, 0.14);
  577. }
  578. .shop-search {
  579. width: 40rpx;
  580. height: 40rpx;
  581. }
  582. .wh-44 {
  583. width: 44rpx;
  584. height: 44rpx;
  585. }
  586. .blank-text {
  587. line-height: 32vh;
  588. }
  589. .box-title {
  590. position: relative;
  591. }
  592. .box-close {
  593. position: absolute;
  594. right: 22rpx;
  595. }
  596. .pop-coupon {
  597. width: 100%;
  598. height: 42vh;
  599. background-color: #F5F4F9;
  600. border-radius: 24rpx 24rpx 0rpx 0rpx;
  601. padding-top: 32rpx !important;
  602. display: flex;
  603. flex-direction: column;
  604. }
  605. .item-right {
  606. padding: 24rpx;
  607. box-sizing: border-box;
  608. border-radius: 20rpx 0 0 20rpx;
  609. position: relative;
  610. }
  611. .item-hr {
  612. width: 0px;
  613. height: auto;
  614. border-right: 1rpx dashed #FB7850;
  615. }
  616. .item-hr-two {
  617. width: 0px;
  618. height: auto;
  619. border-right: 1rpx dashed #999;
  620. }
  621. .item-left {
  622. width: 220rpx;
  623. height: auto;
  624. padding: 20rpx 24rpx;
  625. box-sizing: border-box;
  626. position: relative;
  627. border-radius: 0 20rpx 20rpx 0;
  628. }
  629. .but-box {
  630. width: 152rpx;
  631. height: 52rpx;
  632. line-height: 52rpx;
  633. text-align: center;
  634. background: linear-gradient(225deg, #FB3D03 0%, #FF6901 100%);
  635. border-radius: 200rpx;
  636. }
  637. .ball {
  638. width: 24rpx;
  639. height: 24rpx;
  640. border-radius: 50%;
  641. position: absolute;
  642. top: -12rpx;
  643. left: -12rpx;
  644. background: #F5F5F5;
  645. z-index: 2;
  646. }
  647. .ball-two {
  648. width: 24rpx;
  649. height: 24rpx;
  650. border-radius: 50%;
  651. position: absolute;
  652. background: #F5F5F5;
  653. z-index: 10;
  654. bottom: -12rpx;
  655. left: -12rpx;
  656. }
  657. .shop-index {
  658. width: 100%;
  659. min-height: 100vh;
  660. height: auto;
  661. position: relative;
  662. }
  663. .right-only-right-red {
  664. width: 44rpx;
  665. height: 44rpx;
  666. line-height: 40rpx;
  667. border-radius: 12rpx;
  668. border: 1rpx solid #41ABF5;
  669. color: #41ABF5;
  670. }
  671. .right-only-right-add {
  672. width: 44rpx;
  673. height: 44rpx;
  674. line-height: 40rpx;
  675. background: linear-gradient(117deg, #57CAFF 0%, #41ABF5 100%);
  676. border-radius: 12rpx;
  677. }
  678. .right-only-right-2 {
  679. min-width: 50rpx;
  680. }
  681. .w-514 {
  682. width: 514rpx;
  683. }
  684. .bg-img {
  685. position: fixed;
  686. top: 0;
  687. left: 0;
  688. width: 100%;
  689. height: 300rpx;
  690. transition: linear .3s all;
  691. // height: 300rpx;
  692. }
  693. .bg-img-type {
  694. position: fixed;
  695. top: 0;
  696. left: 0;
  697. width: 100%;
  698. // opacity: 100;
  699. transition: linear .3s all;
  700. }
  701. .mb-box {
  702. position: absolute;
  703. top: 0;
  704. left: 0;
  705. width: 100%;
  706. height: 300rpx;
  707. z-index: -1;
  708. }
  709. .nav-img {
  710. width: 56rpx;
  711. height: 56rpx;
  712. }
  713. .shop-buttom-money {
  714. width: 100%;
  715. height: 140rpx;
  716. background: rgba(255, 255, 255, 0.8);
  717. padding: 20rpx 24rpx;
  718. position: fixed;
  719. left: 0;
  720. bottom: 0;
  721. z-index: 5;
  722. }
  723. .shop-buttom-num {
  724. width: 32rpx;
  725. height: 32rpx;
  726. line-height: 32rpx;
  727. background: #FB3D03;
  728. border-radius: 50%;
  729. position: absolute;
  730. top: 36rpx;
  731. left: 82rpx;
  732. }
  733. .shop-buttom-money-2 {
  734. width: 200rpx;
  735. height: 100rpx;
  736. line-height: 100rpx;
  737. background: #41ABF5;
  738. border-radius: 0rpx 200rpx 200rpx 0rpx;
  739. }
  740. .info-box-top {}
  741. .box-top-right {
  742. width: 100rpx;
  743. height: 100rpx;
  744. border-radius: 12rpx;
  745. }
  746. .box-top-left {}
  747. .top-left-1 {
  748. width: 480rpx;
  749. margin-bottom: 8rpx;
  750. }
  751. .img-x {
  752. width: 24rpx;
  753. height: 24rpx;
  754. }
  755. .buy-card {
  756. height: 828rpx;
  757. background-color: #fff;
  758. border-radius: 24rpx 24rpx 0rpx 0rpx;
  759. }
  760. .buy-card-top {
  761. width: 100%;
  762. height: 92rpx;
  763. background: #FCF5DB;
  764. border-radius: 24rpx 24rpx 0rpx 0rpx;
  765. }
  766. .buy-card-item {
  767. width: 100%;
  768. height: 176rpx;
  769. margin-bottom: 32rpx;
  770. }
  771. .goods_img {
  772. width: 152rpx;
  773. height: 152rpx;
  774. border-radius: 12rpx;
  775. margin-right: 20rpx;
  776. }
  777. .shop-buttom-money-1 {
  778. width: 100%;
  779. height: 100%;
  780. background: #333333;
  781. border-radius: 200rpx;
  782. box-sizing: border-box;
  783. padding-left: 136rpx;
  784. // padding-right: 32rpx;
  785. position: relative;
  786. image {
  787. position: absolute;
  788. bottom: 0;
  789. left: 8rpx;
  790. width: 128rpx;
  791. height: 128rpx;
  792. }
  793. }
  794. .head-box {
  795. width: 100%;
  796. position: relative;
  797. }
  798. .shop-info-box {
  799. box-shadow: 0rpx 8rpx 56rpx 0rpx rgba(154, 152, 152, 0.34);
  800. }
  801. .info-box-quan-list {
  802. width: 164rpx;
  803. height: 48rpx;
  804. margin: 0 8rpx 8rpx 0;
  805. position: relative;
  806. image {
  807. width: 164rpx;
  808. height: 48rpx;
  809. position: absolute;
  810. top: 0;
  811. left: 0;
  812. z-index: 1;
  813. }
  814. }
  815. .quan-list-1 {
  816. position: absolute;
  817. top: 3rpx;
  818. left: 8rpx;
  819. z-index: 2;
  820. }
  821. .quan-list-2 {
  822. position: absolute;
  823. top: 8rpx;
  824. right: 22rpx;
  825. z-index: 2;
  826. }
  827. .shop-type-list {
  828. // height: 88rpx;
  829. position: relative;
  830. }
  831. .shop-item {
  832. position: relative;
  833. }
  834. .pj-num {
  835. position: absolute;
  836. right: -80rpx;
  837. top: 0;
  838. text-align: left;
  839. width: 80rpx;
  840. }
  841. .shop-item-bs {
  842. position: absolute;
  843. bottom: 0;
  844. width: 40rpx;
  845. height: 6rpx;
  846. border-radius: 20rpx;
  847. transition: left 0.5s;
  848. }
  849. .sticky-nav {
  850. width: 100%;
  851. position: sticky;
  852. z-index: 3;
  853. }
  854. .wh-44 {
  855. width: 44rpx;
  856. height: 44rpx;
  857. }
  858. .menu-box-left-f {
  859. position: sticky;
  860. // transition: all .3s ease;
  861. // overflow: auto;
  862. }
  863. .menu-box-left {
  864. width: 160rpx;
  865. height: auto;
  866. position: sticky;
  867. overflow: auto;
  868. // transition: all .3s ease;
  869. // height: 100%;
  870. // background-color: #F7F8FA;
  871. // position: absolute;
  872. // left: 0;
  873. // top: 0;
  874. // border-radius: 0rpx 20rpx 0 0rpx;
  875. }
  876. .menu-box-left-box {
  877. overflow-y: auto;
  878. }
  879. .menu-type-list {
  880. width: 160rpx;
  881. min-height: 108rpx;
  882. padding: 18rpx 28rpx;
  883. position: relative;
  884. z-index: 10;
  885. .menu-type-num {
  886. position: absolute;
  887. top: 2rpx;
  888. right: 8rpx;
  889. padding: 0 6rpx;
  890. min-width: 20rpx;
  891. height: 32rpx;
  892. text-align: center;
  893. line-height: 32rpx;
  894. background: #FB3D03;
  895. border-radius: 50%;
  896. }
  897. }
  898. .menu-type-list-f {
  899. // width: 160rpx;
  900. background-color: #007AFF;
  901. width: 100%;
  902. height: 100%;
  903. overflow-y: auto;
  904. /* 如果分类项很多,允许内部滚动 */
  905. -webkit-overflow-scrolling: touch;
  906. /* 改善移动端滚动体验 */
  907. // height: 100%;
  908. }
  909. .menu-box-only {
  910. // flex: 1;
  911. width: calc(100% - 160rpx);
  912. }
  913. .menu-box-right {
  914. // flex: 1;
  915. width: 100%;
  916. height: 100%;
  917. // padding: 16rpx 0;
  918. // box-sizing: border-box;
  919. // position: relative;
  920. }
  921. .menu-list {
  922. width: 100%;
  923. padding: 0 20rpx 40rpx;
  924. // height: 200rpx;
  925. // margin-bottom: 40rpx;
  926. .goods_img {
  927. width: 200rpx;
  928. height: 200rpx;
  929. border-radius: 12rpx;
  930. margin-right: 16rpx;
  931. }
  932. .menu-list-right {
  933. flex: 1;
  934. .right-only-right {
  935. width: 100rpx;
  936. height: 44rpx;
  937. background: linear-gradient(117deg, #57CAFF 0%, #41ABF5 100%);
  938. border-radius: 12rpx;
  939. line-height: 44rpx;
  940. position: relative;
  941. .selectedNum {
  942. position: absolute;
  943. right: 2rpx;
  944. top: -22rpx;
  945. font-size: 24rpx;
  946. color: #fff;
  947. width: 32rpx;
  948. height: 32rpx;
  949. line-height: 32rpx;
  950. background: #FB3D03;
  951. border-radius: 50%;
  952. }
  953. }
  954. .right-only-right-red {
  955. width: 44rpx;
  956. height: 44rpx;
  957. line-height: 40rpx;
  958. border-radius: 12rpx;
  959. border: 1rpx solid #41ABF5;
  960. color: #41ABF5;
  961. }
  962. .right-only-right-add {
  963. width: 44rpx;
  964. height: 44rpx;
  965. line-height: 40rpx;
  966. background: linear-gradient(117deg, #57CAFF 0%, #41ABF5 100%);
  967. border-radius: 12rpx;
  968. }
  969. .right-only-right-2 {
  970. min-width: 50rpx;
  971. }
  972. }
  973. }
  974. </style>