index.vue 40 KB

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