new-shop.vue 28 KB

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