index.vue 40 KB

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