index.vue 38 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663
  1. <template>
  2. <view class="container" :style="{ height: winHeight+ 'px' }">
  3. <!-- #ifdef MP -->
  4. <view class="cart_nav">
  5. <nav-bar iconColor='#fff' ref="navBarRef" :navTitle="merchanInfo.name" backgroundColor="#FF6702" :isBackgroundColor="false">
  6. </nav-bar>
  7. </view>
  8. <!-- #endif -->
  9. <view class="main">
  10. <view class="nav">
  11. <view class="header">
  12. <view class="left">
  13. <view class="store-name">
  14. <text style="font-weight: 600;font-size: 35rpx;color: #141414;">{{ merchanInfo.name }}</text>
  15. <view class="iconfont iconarrow-right"></view>
  16. </view>
  17. <view class="store-score" style="margin: 7rpx 0;">
  18. <text style="font-weight: 600;font-size: 27rpx;color: #FD6716;">{{ merchanInfo.starLevel }}分</text>
  19. <text style="font-size: 21rpx;color: #999999;margin-left: 6rpx;">月销 {{ merchanInfo.sales || 0 }}</text>
  20. </view>
  21. <view class="store-addr">
  22. <text style="font-size: 23rpx;color: #141414;">商家地址:{{ merchanInfo.addressDetail }}</text>
  23. </view>
  24. <view class="store-tip" style="padding: 10rpx 30rpx 10rpx 15px ;height: 48rpx;">
  25. <swiper :indicator-dots="false" :autoplay="true" interval="2500" :duration="500" vertical="true" circular="true">
  26. <block v-for="(item,index) in merchanInfo.headline" :key='index'>
  27. <swiper-item catchtouchmove='catchTouchMove'>
  28. <view class='text acea-row row-between-wrapper'>
  29. <view class='newsTitle'>
  30. <text class='iconfont icon-laba ' style="font-size: 24rpx;margin-right: 10rpx;"></text>
  31. <text>{{item.title}}</text>
  32. </view>
  33. </view>
  34. </swiper-item>
  35. </block>
  36. </swiper>
  37. </view>
  38. </view>
  39. </view>
  40. </view>
  41. <view style="width: 100%;height: 10rpx; background-color: #F8F9FD;"></view>
  42. </view>
  43. <view class="content">
  44. <scroll-view style="height: 950rpx" class="menus" scroll-with-animation scroll-y>
  45. <view class="wrapper">
  46. <view class="menu" :id="`menu-${item.id}`" :class="{'current': item.id === currentCateId}" v-for="(item, index) in goods"
  47. :key="index" @tap="handleMenuTap(item.id)">
  48. <text>{{ item.name }}</text>
  49. <view class="dot" v-show="menuCartNum(item.id)">{{ menuCartNum(item.id) }}</view>
  50. </view>
  51. </view>
  52. </scroll-view>
  53. <!-- goods list begin -->
  54. <scroll-view class="goods" scroll-with-animation scroll-y :scroll-top="cateScrollTop" @scroll="handleGoodsScroll"
  55. :scroll-into-view="menuScrollIntoView">
  56. <view class="wrapper">
  57. <view class="list">
  58. <!-- category begin -->
  59. <view style="font-weight: 400;font-size: 21rpx;color: #999999;text-align: center;margin-bottom: 19rpx;">————温馨提示:湿度选择,避免浪费
  60. ————</view>
  61. <view class="category" v-for="(item, index) in goods" :key="index" :id="`cate-${item.id}`">
  62. <view class="title">
  63. <text>{{ item.name }}</text>
  64. <image :src="item.icon" class="icon"></image>
  65. </view>
  66. <view class="items">
  67. <!-- 商品 begin -->
  68. <!-- <view v-if="!item.goodsList">无商品</view> -->
  69. <view class="good" v-for="(good, key) in item.childList" :key="key">
  70. <image :src="good.icon" class="image" @tap="console.log('点击图片')"></image>
  71. <view class="right">
  72. <text class="name">{{ good.name }}</text>
  73. <view class="tips">
  74. <text>销量 {{good.sales}}</text>
  75. <text style="margin-left: 39rpx;">好评率 {{ good.replyChance*100}}%</text>
  76. </view>
  77. <view class="price_and_action">
  78. <text class="price">¥{{ good.price }}</text>
  79. <view class="btn-group">
  80. <button type="primary" class="btn property_btn bg-color" hover-class="none" size="mini" @tap="Selectpox(item, good)">
  81. 选规格
  82. </button>
  83. <!-- <view class="dot" v-show="goodCartNum(good.id)">{{ goodCartNum(good.id) }}</view> -->
  84. </view>
  85. <!-- <view class="btn-group" v-else>
  86. <button type="default" v-show="goodCartNum(good.id)" plain class="btn reduce_btn" size="mini" hover-class="none"
  87. @tap="handleReduceFromCart(item, good)">
  88. <view class="iconfont iconsami-select">-</view>
  89. </button>
  90. <view class="number" v-show="goodCartNum(good.id)">{{ goodCartNum(good.id) }}</view>
  91. <button type="primary" class="btn add_btn bg-color" size="min" hover-class="none" @tap="handleAddToCart(item, good, 1)">
  92. <view class="iconfont iconadd-select">+</view>
  93. </button>
  94. </view> -->
  95. </view>
  96. </view>
  97. </view>
  98. <!-- 商品 end -->
  99. </view>
  100. </view>
  101. <!-- category end -->
  102. </view>
  103. </view>
  104. </scroll-view>
  105. <!-- goods list end -->
  106. </view>
  107. <!-- content end -->
  108. <!-- 购物车栏 begin -->
  109. <view class="cart-box">
  110. <view class="mark">
  111. <image src="/static/img/ic-shopping-cart.png" class="cart-img" @tap="cart.length !== 0 ? lockcatble = !lockcatble : ''"></image>
  112. <view class="tag" v-if="cart.length > 0">{{ getCartGoodsNumber }}</view>
  113. </view>
  114. <view style="font-weight: 500;font-size: 27rpx;color: #999999;" class="price" v-if="cart.length === 0">配送费2元</view>
  115. <view style="font-weight: 600;font-size: 27rpx;color: #FFFFFF;" class="price" v-else>¥{{ getCartGoodsPrice || 0 }}</view>
  116. <button :style="{backgroundColor: disabledPay ? '#000' : ''}" type="primary" class="pay-btn bg-color" @tap="toPay"
  117. :disabled="disabledPay">
  118. {{ disabledPay ? `差${spread}元起送` : '去结算' }}
  119. </button>
  120. </view>
  121. <!-- 购物车栏 end -->
  122. <!-- 打开的购物车 -->
  123. <view class="mode" v-if="cart.length !== 0 && lockcatble" style="z-index: 9;">
  124. <view class="mode-1">
  125. <!-- 判断数量大于0显示 -->
  126. <view class="mode-clear" v-if="getCartGoodsNumber>0">
  127. <text class="mode-txt">数量:<text style="color: #FD6716 ;">({{getCartGoodsNumber}})</text></text>
  128. <text @tap="cart = [], lockcatble = false" class="mode-txt1">清空</text>
  129. </view>
  130. <view class="mode-box">
  131. <view class="items">
  132. <!-- 商品 begin -->
  133. <view class="good" v-for="(good, key) in cart" :key="key">
  134. <image :src="good.icon" class="image" @tap="console.log('点击图片')"></image>
  135. <view class="right" style="margin-left: 50rpx;">
  136. <text class="name">{{ good.name }}</text>
  137. <view class="tips">
  138. <text>销量 {{good.sales}}</text>
  139. <text style="margin-left: 39rpx;">好评率 {{ good.replyChance*100}}%</text>
  140. </view>
  141. <view class="price_and_action">
  142. <text class="price">¥{{ good.price * good.number }}</text>
  143. <view class="btn-group">
  144. <button type="default" v-show="goodCartNum(good.id)" plain class="btn reduce_btn" size="mini" hover-class="none"
  145. @tap="handleReduceFromCart(item, good)">
  146. <view class="iconfont iconsami-select">-</view>
  147. </button>
  148. <view class="number" v-show="goodCartNum(good.id)">{{ goodCartNum(good.id) }}</view>
  149. <button type="primary" class="btn add_btn bg-color" size="min" hover-class="none" @tap="handleAddToCart(item, good, 1)">
  150. <view class="iconfont iconadd-select">+</view>
  151. </button>
  152. </view>
  153. </view>
  154. </view>
  155. </view>
  156. <!-- 商品 end -->
  157. </view>
  158. <view style="height: 200rpx;">
  159. </view>
  160. </view>
  161. </view>
  162. </view>
  163. <!-- 规格弹窗 -->
  164. <view class="mode" v-if="selectble">
  165. <view class="sel-mode-1">
  166. <view class="close" @click="Close">
  167. <text style="padding: 10rpx; 20rpx">x</text>
  168. </view>
  169. <view class="sel-2">
  170. <image class="neximg" :src="specifications.icon" />
  171. <view class="nexbox1 flex-around-center">
  172. <text>销量 {{specifications.sales}}</text>
  173. <text>好评率 {{ specifications.replyChance*100}}%</text>
  174. <text class="nexbox-txt3">¥ {{specifications.price}}</text>
  175. </view>
  176. </view>
  177. <!--规格数组 -->
  178. <view class="sel-3">
  179. <text>规格</text>
  180. <view class="sel-4">
  181. <view class="sel-5" @click="xubox(item.productId)" :style="{background: item.productId == productid ? '#ff9805' : ''}"
  182. v-for="(item,index) in productValue" :key="index">
  183. {{item.optionName}}
  184. </view>
  185. </view>
  186. </view>
  187. <!-- 数量 -->
  188. <view class="sel-6">
  189. <text>数量</text>
  190. <!-- 加入购物车 -->
  191. <view class="btn-group">
  192. <button v-if="!goodCartNum(specifications.id)" type="primary" class="btn property_btn bg-color" size="min"
  193. hover-class="none" @tap="handleAddToCart(specificationsList, specifications, 1)">
  194. 加入购物车
  195. </button>
  196. <template v-else>
  197. <button type="default" v-show="goodCartNum(specifications.id)" plain class="btn reduce_btn" size="mini"
  198. hover-class="none" @tap="handleReduceFromCart(specificationsList, specifications)">
  199. <view class="iconfont iconsami-select">-</view>
  200. </button>
  201. <view class="number" v-show="goodCartNum(specifications.id)">{{ goodCartNum(specifications.id) }}</view>
  202. <button type="primary" class="btn add_btn bg-color" size="min" hover-class="none" @tap="handleAddToCart(specificationsList, specifications, 1)">
  203. <view class="iconfont iconadd-select">+</view>
  204. </button>
  205. </template>
  206. </view>
  207. </view>
  208. </view>
  209. </view>
  210. </view>
  211. </template>
  212. <script>
  213. // +----------------------------------------------------------------------
  214. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  215. // +----------------------------------------------------------------------
  216. // | Copyright (c) 2016~2025 https://www.crmeb.com All rights reserved.
  217. // +----------------------------------------------------------------------
  218. // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
  219. // +----------------------------------------------------------------------
  220. // | Author: CRMEB Team <admin@crmeb.com>
  221. // +----------------------------------------------------------------------
  222. import {
  223. getCategoryCacheTree,
  224. getMerchantInfo,
  225. getMerchantProList
  226. } from '@/api/merchant.js';
  227. import {
  228. getProductDetail
  229. } from '@/api/product.js';
  230. import {
  231. orderCreate,
  232. preOrderApi
  233. } from '@/api/order.js';
  234. import navBar from '@/components/navBar';
  235. let app = getApp();
  236. var statusBarHeight = uni.getSystemInfoSync().statusBarHeight + 'rpx';
  237. export default {
  238. components: {
  239. navBar
  240. },
  241. data() {
  242. return {
  243. merId: 0,
  244. winHeight: 0,
  245. merchanInfo: {},
  246. statusBarHeight: app.globalData.statusBarHeight,
  247. navigationBarHeight: 112,
  248. goods: [], //所有商品
  249. loading: true,
  250. currentCateId: 1, //默认分类
  251. cateScrollTop: 0,
  252. lastScrollTop: 0,
  253. menuScrollIntoView: '',
  254. cart: [], //购物车
  255. goodDetailModalVisible: false, //是否饮品详情模态框
  256. good: {}, //当前饮品
  257. category: {}, //当前饮品所在分类
  258. cartPopupVisible: false,
  259. sizeCalcState: false,
  260. orderType: 'takeout',
  261. store: {
  262. min_price: 0.01
  263. },
  264. specifications: '', //点击的这一项菜品信息
  265. specificationsList: [], //点击的这一项菜品信息的大类
  266. selectble: false, //规格弹窗
  267. productValue: [], //规格数组
  268. productid: '', //选中规格的id
  269. lockcatble: false, // 购物车弹窗
  270. }
  271. },
  272. onLoad(options) {
  273. let that = this;
  274. uni.getSystemInfo({
  275. success: function(res) {
  276. that.winHeight = res.windowHeight
  277. },
  278. });
  279. this.merId = uni.getStorageSync('merId')
  280. //首页数据加载
  281. // 获取商家信息
  282. getMerchantInfo(this.merId).then(res => {
  283. this.merchanInfo = res.data
  284. });
  285. // 获取商品列表
  286. getCategoryCacheTree(this.merId).then(res => {
  287. console.log(res.data)
  288. this.goods = res.data
  289. // this.goods.unshift({
  290. // id: 9999,
  291. // name: '推荐'
  292. // })
  293. this.currentCateId = this.goods[0].id
  294. // this.menuScrollIntoView = `cate-${9999}`
  295. })
  296. // this.getIndexConfig();
  297. // #ifdef MP-WEIXIN
  298. // 获取微信胶囊的位置信息 width,height,top,right,left,bottom
  299. const custom = wx.getMenuButtonBoundingClientRect()
  300. // 导航栏高度(标题栏高度) = 胶囊高度 + (顶部距离 - 状态栏高度) * 2
  301. // this.navigationBarHeight = custom.height + (custom.top - this.statusBarHeight) * 2
  302. // console.log("导航栏高度:"+this.globalData.navigationBarHeight)
  303. // #endif
  304. },
  305. computed: {
  306. goodCartNum() { //计算单个饮品添加到购物车的数量
  307. return (id) => this.cart.reduce((acc, cur) => {
  308. if (cur.id === id) {
  309. return acc += cur.number
  310. }
  311. return acc
  312. }, 0)
  313. },
  314. menuCartNum() {
  315. return (id) => this.cart.reduce((acc, cur) => {
  316. if (cur.cate_id === id) {
  317. return acc += cur.number
  318. }
  319. return acc
  320. }, 0)
  321. },
  322. getCartGoodsNumber() { //计算购物车总数
  323. return this.cart.reduce((acc, cur) => acc + cur.number, 0)
  324. },
  325. getCartGoodsPrice() { //计算购物车总价
  326. return this.cart.reduce((acc, cur) => acc + cur.number * cur.price, 0)
  327. },
  328. disabledPay() { //是否达到起送价
  329. return this.orderType == 'takeout' && (this.getCartGoodsPrice < this.store.min_price) ? true : false
  330. },
  331. spread() { //差多少元起送
  332. if (this.orderType != 'takeout') return
  333. return parseFloat((this.store.min_price - this.getCartGoodsPrice).toFixed(2))
  334. }
  335. },
  336. methods: {
  337. handBack() {
  338. uni.navigateBack({
  339. delta: 1
  340. })
  341. },
  342. handleMenuTap(id) { //点击菜单项事件
  343. this.menuScrollIntoView = `cate-${id}`
  344. if (!this.sizeCalcState) {
  345. this.calcSize()
  346. }
  347. this.$nextTick(() => this.cateScrollTop = this.goods.find(item => item.id == id).top)
  348. },
  349. handleGoodsScroll({
  350. detail
  351. }) { //商品列表滚动事件
  352. if (!this.sizeCalcState) {
  353. this.calcSize()
  354. }
  355. const {
  356. scrollTop
  357. } = detail
  358. let tabs = this.goods.filter(item => item.top <= scrollTop).reverse()
  359. if (tabs.length > 0) {
  360. this.currentCateId = tabs[0].id
  361. }
  362. },
  363. handleFoot($event) {
  364. const nextItems = this.findNextAll(this.goods, item => item.id === this.currentCateId);
  365. if (nextItems.id) {
  366. this.currentCateId = nextItems.id
  367. }
  368. },
  369. findNextAll(arr, condition) {
  370. const index = arr.findIndex(condition);
  371. if (index !== -1) {
  372. return arr[index + 1] || {}; // 返回符合条件之后的记录
  373. }
  374. return {}; // 如果没有找到符合条件的记录,返回空对象
  375. },
  376. calcSize() {
  377. let h = 10
  378. this.goods.forEach(item => {
  379. let view = uni.createSelectorQuery().select(`#cate-${item.id}`)
  380. view.fields({
  381. size: true
  382. }, data => {
  383. // if (data.goodsList) {
  384. item.top = h
  385. h += data.height
  386. item.bottom = h
  387. // }
  388. }).exec()
  389. })
  390. this.sizeCalcState = true
  391. },
  392. showGoodDetailModal(item, good) {
  393. this.good = JSON.parse(JSON.stringify({ ...good,
  394. number: 1
  395. }))
  396. this.category = JSON.parse(JSON.stringify(item))
  397. this.goodDetailModalVisible = true
  398. },
  399. handlePropertyAdd() {
  400. this.good.number += 1
  401. },
  402. handlePropertyReduce() {
  403. if (this.good.number === 1) return
  404. this.good.number -= 1
  405. },
  406. handleAddToCartInModal() {
  407. const product = Object.assign({}, this.good, {
  408. props_text: this.getGoodSelectedProps(this.good),
  409. props: this.getGoodSelectedProps(this.good, 'id')
  410. })
  411. this.handleAddToCart(this.category, product, this.good.number)
  412. this.closeGoodDetailModal()
  413. },
  414. getGoodSelectedProps(good, type = 'text') { //计算当前饮品所选属性
  415. if (good.use_property) {
  416. let props = []
  417. good.property.forEach(({
  418. values
  419. }) => {
  420. values.forEach(value => {
  421. if (value.is_default) {
  422. props.push(type === 'text' ? value.value : value.id)
  423. }
  424. })
  425. })
  426. return type === 'text' ? props.join(',') : props
  427. }
  428. return ''
  429. },
  430. handleReduceFromCart(item, good) {
  431. const index = this.cart.findIndex(item => item.id === good.id)
  432. this.cart[index].number -= 1
  433. if (this.cart[index].number <= 0) {
  434. this.cart.splice(index, 1)
  435. }
  436. },
  437. handleAddToCart(cate, good, num) { //添加到购物车
  438. const index = this.cart.findIndex(item => {
  439. if (good.use_property) {
  440. return (item.id === good.id) && (item.props_text === good.props_text)
  441. } else {
  442. return item.id === good.id
  443. }
  444. })
  445. if (index > -1) {
  446. this.cart[index].number += num
  447. } else {
  448. this.cart.push({
  449. id: good.id,
  450. cate_id: cate.id,
  451. name: good.name,
  452. price: good.price,
  453. number: num,
  454. icon: good.icon,
  455. use_property: good.use_property,
  456. props_text: good.props_text,
  457. props: good.props,
  458. productid: this.productid,
  459. ...good
  460. })
  461. }
  462. console.log(this.cart, '购物车')
  463. },
  464. toPay() {
  465. // if(!this.isLogin) {
  466. // uni.navigateTo({url: '/pages/login/login'})
  467. // return
  468. // }
  469. uni.showLoading({
  470. title: '加载中'
  471. })
  472. let orderDetails = this.cart.map((item) => {
  473. return {
  474. attrValueId: item.productid, //商品规格属性id(立即购买、活动购买必填)
  475. groupBuyActivityId: null, //拼团活动id(拼团下单时必填)
  476. groupBuyRecordId: 0, // 拼团记录id,营销类型2=拼团 时必填 0=开团 实际
  477. productId: item.id, //商品id
  478. productNum: item.number //商品数量
  479. };
  480. });
  481. preOrderApi({
  482. "preOrderType": 'buyNow',
  483. //类型 预下单类型(“shoppingCart”:购物车下单,“buyNow”:
  484. // 立即购买,“video”: 视频号商品下单,“seckill”:秒杀下单,“group”:拼团下单)
  485. "orderDetails": orderDetails //购物车信息
  486. }).then(res => {
  487. console.log('预下单接口', res)
  488. if (res.code == 200) {
  489. let cartList = JSON.stringify(this.cart)
  490. uni.setStorageSync('cart', JSON.parse(JSON.stringify(this.cart)))
  491. uni.navigateTo({
  492. // url: `/pages/goods/order_confirm/index?cartList=${cartList}`
  493. url: '/pages/goods/order_confirm/index?orderNo=' + res.data.orderNo
  494. })
  495. }
  496. })
  497. uni.setStorageSync('cart', JSON.parse(JSON.stringify(this.cart)))
  498. uni.hideLoading()
  499. },
  500. // 选规格打开
  501. Selectpox(item, itemInfo) {
  502. this.specifications = itemInfo //这一项信息
  503. this.specificationsList = item //这一项信息
  504. getProductDetail(
  505. itemInfo.id,
  506. 0, 0, ''
  507. ).then((res) => {
  508. console.log('规格', res)
  509. if (res.code == 200) {
  510. this.productValue = res.data.productAttr[0].optionList //规格数组
  511. this.productid = res.data.productValue.默认.id //默认选择的id
  512. this.selectble = true
  513. }
  514. })
  515. },
  516. // 关闭规格
  517. Close() {
  518. this.specifications = '' //这一项信息
  519. this.specificationsList = [] //这一项信息
  520. this.selectble = false
  521. },
  522. }
  523. }
  524. </script>
  525. <style lang="scss" scoped>
  526. /* #ifdef H5 */
  527. page {
  528. min-height: 100%;
  529. }
  530. /* #endif */
  531. .bg-color {
  532. background-color: $bg-color-primary;
  533. }
  534. .order-nav {
  535. // height: 111rpx;
  536. position: relative;
  537. background-color: #FF6702;
  538. display: flex;
  539. align-items: center;
  540. justify-content: center;
  541. .back-button {
  542. position: absolute;
  543. left: 20rpx;
  544. }
  545. text {
  546. font-weight: 500;
  547. font-size: 35rpx;
  548. color: #FFFFFF;
  549. }
  550. }
  551. .container {
  552. display: flex;
  553. flex-direction: column;
  554. overflow: hidden;
  555. position: relative;
  556. }
  557. .loading {
  558. width: 100%;
  559. height: 100%;
  560. display: flex;
  561. align-items: center;
  562. justify-content: center;
  563. image {
  564. width: 260rpx;
  565. height: 260rpx;
  566. position: relative;
  567. margin-top: -200rpx;
  568. /* #ifdef h5 */
  569. margin-top: 0;
  570. /* #endif */
  571. }
  572. }
  573. .stores {
  574. width: 100%;
  575. display: flex;
  576. flex-direction: column;
  577. justify-content: flex-start;
  578. margin-bottom: -40rpx;
  579. .store {
  580. width: 100%;
  581. background-color: $bg-color-grey;
  582. padding: 20rpx;
  583. display: flex;
  584. align-items: center;
  585. margin-bottom: 20rpx;
  586. border-radius: 6rpx;
  587. .iconfont {
  588. font-size: 50rpx;
  589. margin-right: 15rpx;
  590. &.iconradio-button-off {
  591. color: $text-color-assist;
  592. }
  593. &.iconradio-button-on {
  594. color: $color-primary;
  595. }
  596. }
  597. .infos {
  598. flex: 1;
  599. display: flex;
  600. flex-direction: column;
  601. color: $text-color-base;
  602. overflow: hidden;
  603. .name_and_distance {
  604. width: 100%;
  605. display: flex;
  606. justify-content: space-between;
  607. margin-bottom: 10rpx;
  608. overflow: hidden;
  609. .name {
  610. flex: 1;
  611. flex-shrink: 0;
  612. overflow: hidden;
  613. text-overflow: ellipsis;
  614. white-space: nowrap;
  615. font-size: $font-size-lg;
  616. }
  617. .distance {
  618. flex-shrink: 0;
  619. font-size: $font-size-lg;
  620. font-weight: bold;
  621. margin-left: 20rpx;
  622. }
  623. }
  624. .street {
  625. color: $text-color-assist;
  626. font-size: $font-size-sm;
  627. }
  628. }
  629. }
  630. }
  631. .main {
  632. overflow: hidden;
  633. width: 100%;
  634. display: flex;
  635. flex-direction: column;
  636. }
  637. .nav {
  638. width: 100%;
  639. flex-shrink: 0;
  640. display: flex;
  641. flex-direction: column;
  642. border-radius: 23rpx;
  643. padding: 19rpx 57rpx 38rpx 58rpx;
  644. background-color: #ffffff;
  645. .header {
  646. width: 100%;
  647. display: flex;
  648. align-items: center;
  649. justify-content: space-between;
  650. .left {
  651. flex: 1;
  652. display: flex;
  653. flex-direction: column;
  654. .store-name {
  655. display: flex;
  656. justify-content: flex-start;
  657. align-items: center;
  658. font-size: $font-size-lg;
  659. margin-bottom: 10rpx;
  660. .iconfont {
  661. margin-left: 10rpx;
  662. line-height: 100%;
  663. }
  664. }
  665. .store-tip {
  666. font-weight: 400;
  667. font-size: 21rpx;
  668. color: #858687;
  669. margin-top: 10rpx;
  670. background: #F8F9FB;
  671. border-radius: 4rpx;
  672. }
  673. }
  674. .right {
  675. background-color: $bg-color-grey;
  676. border-radius: 38rpx;
  677. display: flex;
  678. align-items: center;
  679. font-size: $font-size-sm;
  680. padding: 0 38rpx;
  681. color: $text-color-assist;
  682. .dinein,
  683. .takeout {
  684. position: relative;
  685. display: flex;
  686. align-items: center;
  687. &.active {
  688. padding: 14rpx 38rpx;
  689. color: #ffffff;
  690. background-color: $color-primary;
  691. border-radius: 38rpx;
  692. }
  693. }
  694. .takeout {
  695. margin-left: 20rpx;
  696. height: 100%;
  697. flex: 1;
  698. padding: 14rpx 0;
  699. }
  700. .dinein.active {
  701. margin-left: -38rpx;
  702. }
  703. .takeout.active {
  704. margin-right: -38rpx;
  705. }
  706. }
  707. }
  708. .coupon {
  709. flex: 1;
  710. width: 100%;
  711. background-color: $bg-color-primary;
  712. font-size: $font-size-base;
  713. color: $color-primary;
  714. padding: 0 20rpx;
  715. display: flex;
  716. align-items: center;
  717. overflow: hidden;
  718. .title {
  719. flex: 1;
  720. margin-left: 10rpx;
  721. overflow: hidden;
  722. white-space: nowrap;
  723. text-overflow: ellipsis;
  724. }
  725. .iconfont {
  726. line-height: 100%;
  727. }
  728. }
  729. }
  730. .content {
  731. flex: 1;
  732. overflow: hidden;
  733. width: 100%;
  734. display: flex;
  735. border-radius: 23rpx 23rpx 0rpx 0rpx;
  736. .menus {
  737. width: 200rpx;
  738. height: 100%;
  739. overflow: hidden;
  740. background-color: $bg-color-grey;
  741. .wrapper {
  742. width: 100%;
  743. height: 100%;
  744. .menu {
  745. display: flex;
  746. align-items: center;
  747. justify-content: flex-start;
  748. padding: 30rpx 20rpx;
  749. font-size: 26rpx;
  750. color: $text-color-assist;
  751. position: relative;
  752. display: flex;
  753. align-items: center;
  754. justify-content: center;
  755. &:nth-last-child(1) {
  756. margin-bottom: 230rpx;
  757. }
  758. &.current {
  759. background-color: #ffffff;
  760. color: $text-color-base;
  761. }
  762. .dot {
  763. position: absolute;
  764. width: 34rpx;
  765. height: 34rpx;
  766. line-height: 34rpx;
  767. font-size: 22rpx;
  768. background-color: $bg-color-primary;
  769. color: #ffffff;
  770. top: 16rpx;
  771. right: 10rpx;
  772. border-radius: 100%;
  773. text-align: center;
  774. }
  775. }
  776. }
  777. }
  778. .goods {
  779. flex: 1;
  780. height: 100%;
  781. overflow: hidden;
  782. background-color: #ffffff;
  783. .wrapper {
  784. width: 100%;
  785. height: 100%;
  786. padding: 20rpx;
  787. .ads {
  788. height: calc(300 / 550 * 510rpx);
  789. image {
  790. width: 100%;
  791. height: 100%;
  792. border-radius: 8rpx;
  793. }
  794. }
  795. .list {
  796. width: 100%;
  797. font-size: $font-size-base;
  798. padding-bottom: 800rpx;
  799. .category {
  800. width: 100%;
  801. .title {
  802. padding: 30rpx 0;
  803. display: flex;
  804. align-items: center;
  805. color: $text-color-base;
  806. .icon {
  807. width: 38rpx;
  808. height: 38rpx;
  809. margin-left: 10rpx;
  810. }
  811. }
  812. }
  813. .items {
  814. display: flex;
  815. flex-direction: column;
  816. padding-bottom: -30rpx;
  817. .good {
  818. display: flex;
  819. align-items: center;
  820. margin-bottom: 30rpx;
  821. .image {
  822. width: 160rpx;
  823. height: 160rpx;
  824. margin-right: 20rpx;
  825. border-radius: 8rpx;
  826. }
  827. .right {
  828. flex: 1;
  829. // height: 160rpx;
  830. overflow: hidden;
  831. display: flex;
  832. flex-direction: column;
  833. align-items: flex-start;
  834. justify-content: space-between;
  835. padding-right: 14rpx;
  836. .name {
  837. font-size: $font-size-base;
  838. margin-bottom: 10rpx;
  839. }
  840. .tips {
  841. width: 100%;
  842. height: 40rpx;
  843. line-height: 40rpx;
  844. overflow: hidden;
  845. text-overflow: ellipsis;
  846. white-space: nowrap;
  847. font-size: $font-size-sm;
  848. color: $text-color-assist;
  849. margin-bottom: 10rpx;
  850. }
  851. .price_and_action {
  852. width: 100%;
  853. display: flex;
  854. justify-content: space-between;
  855. align-items: center;
  856. .price {
  857. font-size: $font-size-base;
  858. font-weight: 600;
  859. color: $bg-color-primary;
  860. }
  861. .btn-group {
  862. display: flex;
  863. justify-content: space-between;
  864. align-items: center;
  865. position: relative;
  866. .btn {
  867. padding: 0 20rpx;
  868. box-sizing: border-box;
  869. font-size: $font-size-sm;
  870. height: 44rpx;
  871. line-height: 44rpx;
  872. &.property_btn {
  873. border-radius: 24rpx;
  874. }
  875. &.add_btn,
  876. &.reduce_btn {
  877. padding: 0;
  878. width: 44rpx;
  879. border-radius: 44rpx;
  880. }
  881. }
  882. .dot {
  883. position: absolute;
  884. background-color: #ffffff;
  885. border: 1px solid $bg-color-primary;
  886. color: $bg-color-primary;
  887. font-size: $font-size-sm;
  888. width: 36rpx;
  889. height: 36rpx;
  890. line-height: 36rpx;
  891. text-align: center;
  892. border-radius: 100%;
  893. right: -12rpx;
  894. top: -10rpx;
  895. }
  896. .number {
  897. width: 44rpx;
  898. height: 44rpx;
  899. line-height: 44rpx;
  900. text-align: center;
  901. }
  902. }
  903. }
  904. }
  905. }
  906. }
  907. }
  908. }
  909. }
  910. }
  911. .modal-box {
  912. max-height: 90vh;
  913. }
  914. .good-detail-modal {
  915. width: 100%;
  916. height: 100%;
  917. display: flex;
  918. flex-direction: column;
  919. .cover {
  920. height: 320rpx;
  921. padding: 30rpx 0;
  922. display: flex;
  923. justify-content: center;
  924. align-items: center;
  925. position: relative;
  926. .image {
  927. width: 260rpx;
  928. height: 260rpx;
  929. }
  930. .btn-group {
  931. position: absolute;
  932. right: 10rpx;
  933. top: 30rpx;
  934. display: flex;
  935. align-items: center;
  936. justify-content: space-around;
  937. image {
  938. width: 80rpx;
  939. height: 80rpx;
  940. }
  941. }
  942. }
  943. .detail {
  944. width: 100%;
  945. min-height: 1vh;
  946. max-height: calc(90vh - 320rpx - 80rpx - 120rpx);
  947. .wrapper {
  948. width: 100%;
  949. height: 100%;
  950. overflow: hidden;
  951. .basic {
  952. padding: 0 20rpx 30rpx;
  953. display: flex;
  954. flex-direction: column;
  955. .name {
  956. font-size: $font-size-base;
  957. color: $text-color-base;
  958. margin-bottom: 10rpx;
  959. }
  960. .tips {
  961. font-size: $font-size-sm;
  962. color: $text-color-grey;
  963. }
  964. }
  965. .properties {
  966. width: 100%;
  967. border-top: 2rpx solid $bg-color-grey;
  968. padding: 10rpx 30rpx 0;
  969. display: flex;
  970. flex-direction: column;
  971. .property {
  972. width: 100%;
  973. display: flex;
  974. flex-direction: column;
  975. margin-bottom: 30rpx;
  976. padding-bottom: -16rpx;
  977. .title {
  978. width: 100%;
  979. display: flex;
  980. justify-content: flex-start;
  981. align-items: center;
  982. margin-bottom: 20rpx;
  983. .name {
  984. font-size: 26rpx;
  985. color: $text-color-base;
  986. margin-right: 20rpx;
  987. }
  988. .desc {
  989. flex: 1;
  990. font-size: $font-size-sm;
  991. color: $color-primary;
  992. overflow: hidden;
  993. text-overflow: ellipsis;
  994. white-space: nowrap;
  995. }
  996. }
  997. .values {
  998. width: 100%;
  999. display: flex;
  1000. flex-wrap: wrap;
  1001. .value {
  1002. border-radius: 8rpx;
  1003. background-color: $bg-color-grey;
  1004. padding: 16rpx 30rpx;
  1005. font-size: 26rpx;
  1006. color: $text-color-assist;
  1007. margin-right: 16rpx;
  1008. margin-bottom: 16rpx;
  1009. &.default {
  1010. background-color: $color-primary;
  1011. color: $text-color-white;
  1012. }
  1013. }
  1014. }
  1015. }
  1016. }
  1017. }
  1018. }
  1019. .action {
  1020. display: flex;
  1021. align-items: center;
  1022. justify-content: space-between;
  1023. background-color: $bg-color-grey;
  1024. height: 120rpx;
  1025. padding: 0 26rpx;
  1026. .left {
  1027. flex: 1;
  1028. display: flex;
  1029. flex-direction: column;
  1030. justify-content: center;
  1031. margin-right: 20rpx;
  1032. overflow: hidden;
  1033. .price {
  1034. font-size: $font-size-lg;
  1035. color: $text-color-base;
  1036. }
  1037. .props {
  1038. color: $text-color-assist;
  1039. font-size: 24rpx;
  1040. width: 100%;
  1041. overflow: hidden;
  1042. text-overflow: ellipsis;
  1043. white-space: nowrap;
  1044. }
  1045. }
  1046. .btn-group {
  1047. display: flex;
  1048. align-items: center;
  1049. justify-content: space-around;
  1050. .number {
  1051. font-size: $font-size-base;
  1052. width: 44rpx;
  1053. height: 44rpx;
  1054. line-height: 44rpx;
  1055. text-align: center;
  1056. }
  1057. .btn {
  1058. padding: 0;
  1059. font-size: $font-size-base;
  1060. width: 44rpx;
  1061. height: 44rpx;
  1062. line-height: 44rpx;
  1063. border-radius: 100%;
  1064. }
  1065. }
  1066. }
  1067. .add-to-cart-btn {
  1068. display: flex;
  1069. justify-content: center;
  1070. align-items: center;
  1071. background-color: $color-primary;
  1072. color: $text-color-white;
  1073. font-size: $font-size-base;
  1074. height: 80rpx;
  1075. border-radius: 0 0 12rpx 12rpx;
  1076. }
  1077. }
  1078. .cart-box {
  1079. // position: absolute;
  1080. // bottom: 30rpx;
  1081. // left: 30rpx;
  1082. // right: 30rpx;
  1083. height: 96rpx;
  1084. border-radius: 48rpx;
  1085. box-shadow: 0 0 20rpx rgba(0, 0, 0, 0.2);
  1086. background-color: #000;
  1087. display: flex;
  1088. align-items: center;
  1089. justify-content: space-between;
  1090. z-index: 9999;
  1091. .cart-img {
  1092. width: 50rpx;
  1093. height: 47rpx;
  1094. position: relative;
  1095. // margin-top: -48rpx;
  1096. }
  1097. .pay-btn {
  1098. height: 100%;
  1099. padding: 0 30rpx;
  1100. color: #FFFFFF;
  1101. border-radius: 0 50rpx 50rpx 0;
  1102. display: flex;
  1103. align-items: center;
  1104. font-size: $font-size-base;
  1105. }
  1106. .mark {
  1107. padding-left: 46rpx;
  1108. margin-right: 30rpx;
  1109. position: relative;
  1110. .tag {
  1111. background-color: $color-warning;
  1112. color: $text-color-white;
  1113. display: flex;
  1114. justify-content: center;
  1115. align-items: center;
  1116. font-size: $font-size-sm;
  1117. position: absolute;
  1118. right: -13rpx;
  1119. top: -20rpx;
  1120. border-radius: 100%;
  1121. padding: 4rpx;
  1122. width: 27rpx;
  1123. height: 27rpx;
  1124. opacity: .9;
  1125. }
  1126. }
  1127. .price {
  1128. flex: 1;
  1129. color: $text-color-base;
  1130. }
  1131. }
  1132. .cart-popup {
  1133. .top {
  1134. background-color: $bg-color-primary;
  1135. color: $color-primary;
  1136. padding: 10rpx 30rpx;
  1137. font-size: 24rpx;
  1138. text-align: right;
  1139. }
  1140. .cart-list {
  1141. background-color: #FFFFFF;
  1142. width: 100%;
  1143. overflow: hidden;
  1144. min-height: 1vh;
  1145. max-height: 60vh;
  1146. .wrapper {
  1147. height: 100%;
  1148. display: flex;
  1149. flex-direction: column;
  1150. padding: 0 30rpx;
  1151. margin-bottom: 156rpx;
  1152. .item {
  1153. display: flex;
  1154. justify-content: space-between;
  1155. align-items: center;
  1156. padding: 30rpx 0;
  1157. position: relative;
  1158. &::after {
  1159. content: ' ';
  1160. position: absolute;
  1161. bottom: 0;
  1162. left: 0;
  1163. width: 100%;
  1164. background-color: $border-color;
  1165. height: 2rpx;
  1166. transform: scaleY(.6);
  1167. }
  1168. .left {
  1169. flex: 1;
  1170. display: flex;
  1171. flex-direction: column;
  1172. overflow: hidden;
  1173. margin-right: 30rpx;
  1174. .name {
  1175. font-size: $font-size-sm;
  1176. color: $text-color-base;
  1177. }
  1178. .props {
  1179. color: $text-color-assist;
  1180. font-size: 24rpx;
  1181. overflow: hidden;
  1182. text-overflow: ellipsis;
  1183. white-space: nowrap;
  1184. }
  1185. }
  1186. .center {
  1187. margin-right: 120rpx;
  1188. font-size: $font-size-base;
  1189. }
  1190. .right {
  1191. display: flex;
  1192. align-items: center;
  1193. justify-content: space-between;
  1194. .btn {
  1195. width: 46rpx;
  1196. height: 46rpx;
  1197. border-radius: 100%;
  1198. padding: 0;
  1199. text-align: center;
  1200. line-height: 46rpx;
  1201. }
  1202. .number {
  1203. font-size: $font-size-base;
  1204. width: 46rpx;
  1205. height: 46rpx;
  1206. text-align: center;
  1207. line-height: 46rpx;
  1208. }
  1209. }
  1210. }
  1211. }
  1212. }
  1213. }
  1214. .back-button {
  1215. width: 30rpx;
  1216. height: 30rpx;
  1217. border-right: 4rpx solid #fff;
  1218. border-bottom: 4rpx solid #fff;
  1219. transform: rotate(135deg);
  1220. margin-left: 10rpx;
  1221. display: inline-block;
  1222. position: relative;
  1223. }
  1224. .newsTitle {
  1225. display: flex;
  1226. align-items: center;
  1227. }
  1228. .mode {
  1229. position: fixed;
  1230. width: 100%;
  1231. height: 100%;
  1232. left: 0;
  1233. top: 0;
  1234. background: rgba(33, 33, 33, 0.8);
  1235. z-index: 99999;
  1236. display: flex;
  1237. align-items: flex-end;
  1238. }
  1239. .mode-1 {
  1240. width: 100%;
  1241. height: 840rpx;
  1242. background: #FFF;
  1243. display: flex;
  1244. flex-direction: column;
  1245. gap: 20rpx;
  1246. // padding: 30rpx;
  1247. box-sizing: border-box;
  1248. overflow: auto;
  1249. /* 添加这个属性使容器可以滚动 */
  1250. }
  1251. // 规格弹窗
  1252. .sel-mode-1 {
  1253. width: 100%;
  1254. // height: 440rpx;
  1255. background: #FFF;
  1256. display: flex;
  1257. flex-direction: column;
  1258. gap: 20rpx;
  1259. box-sizing: border-box;
  1260. overflow: auto;
  1261. z-index: 99999;
  1262. padding: 20rpx 20rpx 60rpx 20rpx;
  1263. box-sizing: border-box;
  1264. position: relative;
  1265. }
  1266. .close {
  1267. text-align: right;
  1268. font-size: 40rpx;
  1269. }
  1270. .sel-2 {
  1271. display: flex;
  1272. align-items: center;
  1273. gap: 20rpx;
  1274. .nexbox1 {
  1275. flex: 1;
  1276. text-overflow: ellipsis;
  1277. white-space: nowrap;
  1278. color: $text-color-assist;
  1279. }
  1280. }
  1281. .sel-3 {
  1282. display: flex;
  1283. flex-direction: column;
  1284. gap: 10rpx;
  1285. }
  1286. .sel-4 {
  1287. display: flex;
  1288. align-items: center;
  1289. gap: 10rpx;
  1290. }
  1291. .sel-5 {
  1292. width: 80rpx;
  1293. height: 40rpx;
  1294. box-sizing: border-box;
  1295. display: flex;
  1296. align-items: center;
  1297. justify-content: center;
  1298. font-size: 24rpx;
  1299. background: #999999;
  1300. color: #FFF;
  1301. padding: 8rpx;
  1302. border-radius: 8rpx;
  1303. }
  1304. .sel-6 {
  1305. display: flex;
  1306. align-items: center;
  1307. justify-content: space-between;
  1308. }
  1309. .sel-btn {
  1310. display: flex;
  1311. align-items: center;
  1312. justify-content: flex-end;
  1313. }
  1314. .sel-btn1 {
  1315. width: 110px;
  1316. height: 60rpx;
  1317. display: flex;
  1318. align-items: center;
  1319. justify-content: center;
  1320. background: rgba(255, 103, 2, 1);
  1321. color: #FFF;
  1322. font-size: 30rpx;
  1323. border-radius: 10rpx;
  1324. }
  1325. .neximg {
  1326. width: 160rpx;
  1327. height: 160rpx;
  1328. margin-right: 20rpx;
  1329. border-radius: 8rpx;
  1330. /* 保持图片等比例缩放,并且不会裁切 */
  1331. }
  1332. .btn-group {
  1333. display: flex;
  1334. justify-content: space-between;
  1335. align-items: center;
  1336. position: relative;
  1337. .btn {
  1338. padding: 0 20rpx;
  1339. box-sizing: border-box;
  1340. font-size: $font-size-sm;
  1341. height: 44rpx;
  1342. line-height: 44rpx;
  1343. &.property_btn {
  1344. border-radius: 24rpx;
  1345. }
  1346. &.add_btn,
  1347. &.reduce_btn {
  1348. padding: 0;
  1349. width: 44rpx;
  1350. border-radius: 44rpx;
  1351. }
  1352. }
  1353. .dot {
  1354. position: absolute;
  1355. background-color: #ffffff;
  1356. border: 1px solid $bg-color-primary;
  1357. color: $bg-color-primary;
  1358. font-size: $font-size-sm;
  1359. width: 36rpx;
  1360. height: 36rpx;
  1361. line-height: 36rpx;
  1362. text-align: center;
  1363. border-radius: 100%;
  1364. right: -12rpx;
  1365. top: -10rpx;
  1366. }
  1367. .number {
  1368. width: 44rpx;
  1369. height: 44rpx;
  1370. line-height: 44rpx;
  1371. text-align: center;
  1372. }
  1373. }
  1374. .nexbox-txt3 {
  1375. color: $bg-color-primary;
  1376. }
  1377. .mode-box {
  1378. width: 100%;
  1379. display: flex;
  1380. flex-direction: column;
  1381. gap: 20rpx;
  1382. padding: 30rpx;
  1383. box-sizing: border-box;
  1384. }
  1385. .items {
  1386. display: flex;
  1387. flex-direction: column;
  1388. padding-bottom: -30rpx;
  1389. .good {
  1390. display: flex;
  1391. align-items: center;
  1392. margin-bottom: 30rpx;
  1393. .image {
  1394. width: 160rpx;
  1395. height: 160rpx;
  1396. margin-right: 20rpx;
  1397. border-radius: 8rpx;
  1398. }
  1399. .right {
  1400. flex: 1;
  1401. // height: 160rpx;
  1402. overflow: hidden;
  1403. display: flex;
  1404. flex-direction: column;
  1405. align-items: flex-start;
  1406. justify-content: space-between;
  1407. padding-right: 14rpx;
  1408. .name {
  1409. font-size: $font-size-base;
  1410. margin-bottom: 10rpx;
  1411. }
  1412. .tips {
  1413. width: 100%;
  1414. height: 40rpx;
  1415. line-height: 40rpx;
  1416. overflow: hidden;
  1417. text-overflow: ellipsis;
  1418. white-space: nowrap;
  1419. font-size: $font-size-sm;
  1420. color: $text-color-assist;
  1421. margin-bottom: 10rpx;
  1422. }
  1423. .price_and_action {
  1424. width: 100%;
  1425. display: flex;
  1426. justify-content: space-between;
  1427. align-items: center;
  1428. .price {
  1429. font-size: $font-size-base;
  1430. font-weight: 600;
  1431. color: $bg-color-primary;
  1432. }
  1433. .btn-group {
  1434. display: flex;
  1435. justify-content: space-between;
  1436. align-items: center;
  1437. position: relative;
  1438. .btn {
  1439. padding: 0 20rpx;
  1440. box-sizing: border-box;
  1441. font-size: $font-size-sm;
  1442. height: 44rpx;
  1443. line-height: 44rpx;
  1444. &.property_btn {
  1445. border-radius: 24rpx;
  1446. }
  1447. &.add_btn,
  1448. &.reduce_btn {
  1449. padding: 0;
  1450. width: 44rpx;
  1451. border-radius: 44rpx;
  1452. }
  1453. }
  1454. .dot {
  1455. position: absolute;
  1456. background-color: #ffffff;
  1457. border: 1px solid $bg-color-primary;
  1458. color: $bg-color-primary;
  1459. font-size: $font-size-sm;
  1460. width: 36rpx;
  1461. height: 36rpx;
  1462. line-height: 36rpx;
  1463. text-align: center;
  1464. border-radius: 100%;
  1465. right: -12rpx;
  1466. top: -10rpx;
  1467. }
  1468. .number {
  1469. width: 44rpx;
  1470. height: 44rpx;
  1471. line-height: 44rpx;
  1472. text-align: center;
  1473. }
  1474. }
  1475. }
  1476. }
  1477. }
  1478. }
  1479. .mode-clear {
  1480. padding: 30rpx;
  1481. box-sizing: border-box;
  1482. position: sticky;
  1483. z-index: 99;
  1484. top: 0;
  1485. display: flex;
  1486. justify-content: space-between;
  1487. align-items: center;
  1488. background: #FFF;
  1489. border-bottom: 1px solid burlywood;
  1490. }
  1491. .mode-txt {
  1492. display: flex;
  1493. align-items: center;
  1494. gap: 8rpx;
  1495. }
  1496. .mode-txt1 {
  1497. font-weight: 500;
  1498. font-size: 32rpx;
  1499. }
  1500. </style>