shopDetail.vue 41 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555
  1. <template>
  2. <view class="orderFood">
  3. <view class="shop-info">
  4. <view class="shop-name">
  5. {{shopInfo.shopName}}
  6. </view>
  7. <view class="address">
  8. {{shopInfo.address}}
  9. </view>
  10. </view>
  11. <view class="content">
  12. <scroll-view :scroll-y="true" class="left" :scroll-into-view="scrollTo1" scroll-with-animation>
  13. <!-- <view class="left"> -->
  14. <view class="item" :class="[active == index?'active':'']" v-for="(item,index) in list" :id="'tab'+index" :key="index" @click="handleTab(index)">
  15. <image class="icon" :src="item.imageCnUrl" mode=""></image>
  16. <view class="name">
  17. {{item.topName}}
  18. </view>
  19. </view>
  20. <!-- </view> -->
  21. </scroll-view>
  22. <scroll-view :scroll-y="true" class="right" :scroll-into-view="scrollTo" scroll-with-animation @scroll="scroll">
  23. <!-- <view class="test">
  24. </view> -->
  25. <!-- <view class="right"> -->
  26. <view class="section" v-for="(item,index) in list" :key="index">
  27. <view class="section-name" :class="'title'+index" :id="'title'+index" >
  28. {{item.topName}}
  29. </view>
  30. <!-- <zs-title :title="item.topName" :value="index" :class="'title'+index" :id="'title'+index" @changeTag="chooseTag"></zs-title> -->
  31. <view class="item" v-for="(i,d) in item.menuVoList" :key="d" >
  32. <image class="img" :src="i.imageUrl" mode=""></image>
  33. <view class="info">
  34. <view class="title">
  35. {{i.nameCn}}
  36. </view>
  37. <view class="btn-box">
  38. <view class="price-box">
  39. <view class="price">
  40. <view class="unit">
  41. </view>
  42. <view class="num">
  43. {{i.priceHead}}
  44. </view>
  45. </view>
  46. <view class="old-price">
  47. ¥{{i.price}}
  48. </view>
  49. </view>
  50. <image class="btn" @click.stop="add(i,1,item)" src="../static/add-active.png" mode=""></image>
  51. </view>
  52. </view>
  53. </view>
  54. </view>
  55. <!-- </view> -->
  56. </scroll-view>
  57. </view>
  58. <view class="total-box">
  59. <view class="price-box" @click="handleCar">
  60. <view class="car-box">
  61. <image class="icon" src="../static/shop-car.png" mode=""></image>
  62. <view class="num" v-if="totalNum">
  63. {{totalNum}}
  64. </view>
  65. </view>
  66. <view class="price">
  67. <view class="unit">
  68. </view>
  69. <view class="num">
  70. {{total}}
  71. </view>
  72. </view>
  73. </view>
  74. <button class="buy" :class="[!carList.length?'disabled':'']" :disabled="!carList.length" type="default" @click="buy">{{carList.length?'选好了':'未选择商品'}}</button>
  75. </view>
  76. <!-- 购物车 -->
  77. <u-popup :show="show" round="32rpx" mode="bottom" @close="close('show')">
  78. <view class="popup-title-box" >
  79. <view class="title">
  80. 已选商品
  81. </view>
  82. <view class="clear" v-if="carList.length" @click="clear">
  83. 清空
  84. </view>
  85. </view>
  86. <u-empty
  87. mode="car"
  88. icon="http://cdn.uviewui.com/uview/empty/car.png"
  89. v-if="!carList.length"
  90. >
  91. </u-empty>
  92. <view class="car-content" v-else>
  93. <view class="item" v-for="(item,index) in carList" :key="index">
  94. <image class="img" :src="item.imageUrl" mode=""></image>
  95. <view class="info">
  96. <view class="title">
  97. {{item.nameCn}}
  98. </view>
  99. <view class="type" v-if="item.config">
  100. {{item.config}}
  101. </view>
  102. <view class="btn-box">
  103. <view class="price-box">
  104. <view class="price">
  105. <view class="unit">
  106. </view>
  107. <view class="num">
  108. {{item.sellPrice}}
  109. </view>
  110. </view>
  111. <view class="old-price">
  112. ¥{{item.orgPrice}}
  113. </view>
  114. </view>
  115. <view class="count-box">
  116. <image class="btn" src="../static/remove.png" v-if="item.quantity" @click="add(item,-1,{},index)" mode=""></image>
  117. <view class="num">
  118. {{item.quantity}}
  119. </view>
  120. <image class="btn" src="../static/add-active.png" @click="add(item,1,{},index)" mode=""></image>
  121. </view>
  122. </view>
  123. </view>
  124. </view>
  125. </view>
  126. <view class="total-box total-box1">
  127. <view class="price-box" @click="handleCar">
  128. <view class="car-box">
  129. <image class="icon" src="../static/shop-car.png" mode=""></image>
  130. <view class="num" v-if="totalNum">
  131. {{totalNum}}
  132. </view>
  133. </view>
  134. <view class="price">
  135. <view class="unit">
  136. </view>
  137. <view class="num">
  138. {{total}}
  139. </view>
  140. </view>
  141. </view>
  142. <button class="buy" :class="[!carList.length?'disabled':'']" :disabled="!carList.length" type="default" @click="buy">{{carList.length?'选好了':'未选择商品'}}</button>
  143. </view>
  144. </u-popup>
  145. <!-- 商品详情 -->
  146. <u-popup :show="show2" round="32rpx" mode="bottom" @close="close('show2')">
  147. <view class="popup-goodsDetail">
  148. <view class="box">
  149. <image class="img" :src="goodsInfo.product_img" mode="aspectFit"></image>
  150. <view class="popup-content">
  151. <view class="title">
  152. {{goodsInfo.product_name}}
  153. </view>
  154. <view class="desc" v-html="goodsInfo.product_description" v-if="goodsInfo.product_description">
  155. {{goodsInfo.product_description}}
  156. </view>
  157. <view class="choose-box" v-if="goodsInfo.details&&ot == 'NXDC'">
  158. <view class="choose-item" v-for="item in goodsInfo.details.spu_specs" :key="item.code">
  159. <view class="choose-title">
  160. {{item.name}}
  161. </view>
  162. <view class="item-box">
  163. <view class="item" :class="[i.code == chooseInfo[item.code].code?'active':'',isDisable(i,'NXDC',item)?'disable':'']" v-for="i in item.values" :key="i.code" @click="choose(i,item.code)">
  164. {{i.name}} {{i.price?`¥${i.price}`:''}}
  165. </view>
  166. </view>
  167. </view>
  168. </view>
  169. <view class="choose-box" v-else-if="ot == 'MDL'">
  170. <view class="choose-item" v-for="item in goodsInfo.details.optional" :key="item.code">
  171. <view class="choose-title">
  172. {{item.name}}
  173. </view>
  174. <view class="item-box">
  175. <view class="item" :class="[i.id == chooseInfo[item.name+'-'+item.id].id?'active':'',i.disable?'disable':'']" v-for="i in item.sku_infos" :key="i.id" @click="()=>choose(i,item.name+'-'+item.id)">
  176. {{i.name}} {{i.price?`¥${i.price}`:''}}
  177. </view>
  178. </view>
  179. </view>
  180. <view class="choose-item" >
  181. <view class="choose-title">
  182. 套餐内容
  183. </view>
  184. <view class="item-box">
  185. <view class="item active" v-for="i in goodsInfo.details.required" :key="i.id">
  186. {{i.product_name}}x{{i.amount}}
  187. </view>
  188. </view>
  189. </view>
  190. </view>
  191. <view class="choose-box" v-else-if="ot == 'XBK'">
  192. <view class="choose-item" v-for="item in goodsInfo.details.optional" :key="item.code">
  193. <view class="choose-title">
  194. {{item.name}}
  195. </view>
  196. <view class="item-box">
  197. <view class="item" :class="[i.id == chooseInfo[item.id].id?'active':'',i.disable?'disable':'']" v-for="i in item.sku_infos" :key="i.id" @click="()=>choose(i,item.id)">
  198. {{i.name}} {{i.price?`¥${i.price}`:''}}
  199. </view>
  200. </view>
  201. </view>
  202. </view>
  203. <view class="choose-box" v-else-if="goodsInfo.details&&goodsInfo.details.specifications&&ot == 'XC'">
  204. <view class="choose-item" v-for="item in goodsInfo.details.specifications" :key="item.id">
  205. <view class="choose-title">
  206. {{item.name}}
  207. </view>
  208. <view class="item-box">
  209. <!-- ,isDisable(i.id,'XC')?'disable':'' -->
  210. <view class="item " :class="[i.id == chooseInfo[item.id].id?'active':'',isDisable(i.id,'XC')?'disable':'']" v-for="i in item.values" :key="i.id" @click="choose(i,item.id,item)">
  211. {{i.name}} {{i.price?`¥${i.price}`:''}}
  212. </view>
  213. </view>
  214. </view>
  215. </view>
  216. <view class="choose-box" v-else-if="ot == 'RXKF'">
  217. <view class="choose-item" v-for="item in goodsInfo.details.specifications" :key="item.code">
  218. <view class="choose-title">
  219. {{item.name}}
  220. </view>
  221. <view class="item-box">
  222. <view class="item" :class="[i.name == chooseInfo[item.name].name?'active':'']" v-for="(i,d) in item.ingredients" :key="d" @click="()=>choose(i,item.name,item)">
  223. {{i.name}} {{i.price?`¥${i.price}`:''}}
  224. </view>
  225. </view>
  226. </view>
  227. </view>
  228. <view class="choose-box" v-else-if="ot == 'KD'">
  229. <view class="choose-item" v-for="item in goodsInfo.specItems" :key="item.specItemNo">
  230. <view class="choose-title">
  231. {{item.specItemName}}
  232. </view>
  233. <view class="item-box">
  234. <view class="item" :class="[i.name == chooseInfo[item.specItemNo].specItemValueName?'active':'',isDisable(i,'KD')?'disable':'']" v-for="(i,d) in item.specValueList" :key="d" @click="()=>choose(i,item.specItemNo,item)">
  235. {{i.name}}
  236. </view>
  237. </view>
  238. </view>
  239. </view>
  240. </view>
  241. </view>
  242. <view class="btn-box">
  243. <view class="order-info">
  244. <view class="left">
  245. <view class="price-box">
  246. <view class="price">
  247. ¥{{(itemPrice.price*10000)*num/10000}}
  248. </view>
  249. <view class="old-price">
  250. ¥{{ (itemPrice.oldPrice*10000)*num/10000}}
  251. </view>
  252. </view>
  253. <view class="choose">
  254. {{config}}
  255. </view>
  256. </view>
  257. <view class="count-box">
  258. <image class="btn1" src="../static/remove.png" v-if="num" @click="add1(-1)" mode=""></image>
  259. <view class="num">
  260. {{num}}
  261. </view>
  262. <image class="btn1" src="../static/add-active.png" @click="add1(1)" mode=""></image>
  263. </view>
  264. </view>
  265. <button class="btn" type="default" @click="handleAdd">加入购物车</button>
  266. </view>
  267. </view>
  268. </u-popup>
  269. <u-modal :show="show1" :title="shopInfo.shopName" confirmColor="#FF4D3A" confirmText="更换门店" @confirm="confirm">
  270. <view class="modal-box">
  271. <view class="shopName">
  272. 店铺暂未营业或已暂停营业
  273. </view>
  274. <view class="notice">
  275. 请尝试更换门店~
  276. </view>
  277. </view>
  278. </u-modal>
  279. <u-modal :show="show3" title="提示" confirmColor="#FF4D3A" confirmText="更换门店" @confirm="goShopList">
  280. <view class="modal-box">
  281. <view class="notice">
  282. 当前门店暂时无商品上架,您可以切换至其他门店进行购买。
  283. </view>
  284. </view>
  285. </u-modal>
  286. </view>
  287. </template>
  288. <script>
  289. import {shopDetail,menuList,foodGoodsDetail} from '@/api/orderFood.js'
  290. export default {
  291. data() {
  292. return {
  293. shopId:"63836999-5117-4980-8632-497f007808ef",
  294. show:false,
  295. show1:false,
  296. show2:false,
  297. show3:false,
  298. active:0,
  299. list:[],
  300. shopInfo:{
  301. shopName:'',
  302. address:'',
  303. },
  304. carList:[],
  305. scrollTo:'title0',
  306. scrollTo1:'',
  307. topList:[],
  308. offsetTop:0,//顶部距离
  309. cateName:'',//跳转过来携带的分类名称
  310. ot:uni.getStorageSync('ot'),
  311. goodsInfo:{},
  312. num:1,
  313. chooseInfo:{},
  314. item:{},//弹窗内商品信息
  315. productId:'',
  316. itemPrice:{//弹窗内商品价格
  317. price:0,
  318. oldPrice:0
  319. },
  320. test:false
  321. };
  322. },
  323. computed: {
  324. totalNum(){
  325. let total = 0
  326. this.carList.map(item=>{
  327. total+=item.quantity
  328. })
  329. return total
  330. },
  331. total() {
  332. let total = 0
  333. this.carList.map(item=>{
  334. total+=(item.sellPrice*10000*item.quantity)
  335. })
  336. return total/10000
  337. },
  338. // 选择的规格文字 同时计算当前选择的价格
  339. config(){
  340. console.log('config');
  341. let str = ''
  342. for (let key in this.chooseInfo) {
  343. if(this.ot == 'KD'){
  344. str +=this.chooseInfo[key].specItemValueName +'/'
  345. }else{
  346. str +=this.chooseInfo[key].name +'/'
  347. }
  348. }
  349. if(this.goodsInfo.details&&this.goodsInfo.details.sku_infos&&this.ot=='NXDC'){
  350. let {productId,price,oldPrice} = this.findData()
  351. this.productId = productId
  352. this.itemPrice = {
  353. price,
  354. oldPrice
  355. }
  356. }else if(this.ot=='XC'&&this.goodsInfo.details&&this.goodsInfo.details.specifications){
  357. let addPrice = 0
  358. for (let key in this.chooseInfo) {
  359. addPrice += this.chooseInfo[key].price
  360. }
  361. this.itemPrice = {
  362. price:this.item.priceHead+addPrice,
  363. oldPrice:this.item.price+addPrice
  364. }
  365. }else if(this.ot == 'MDL'){
  366. this.itemPrice = {
  367. price:this.item.priceHead,
  368. oldPrice:this.item.price
  369. }
  370. }else if(this.ot == 'XBK'){
  371. let addPrice = 0
  372. for (let key in this.chooseInfo) {
  373. addPrice += this.chooseInfo[key].price
  374. }
  375. this.itemPrice = {
  376. price:this.item.priceHead+addPrice,
  377. oldPrice:this.item.price+addPrice
  378. }
  379. }else if(this.goodsInfo.details&&this.goodsInfo.details.sku_infos&&this.ot == 'RXKF'){
  380. let {productId,price,oldPrice} = this.findData1()
  381. this.productId = productId
  382. this.itemPrice = {
  383. price,
  384. oldPrice
  385. }
  386. }else if(this.goodsInfo.skuCombinList&&this.ot == 'KD'){
  387. this.productId = this.findData2()
  388. this.itemPrice = {
  389. price:this.item.priceHead,
  390. oldPrice:this.item.price
  391. }
  392. }
  393. return str
  394. }
  395. },
  396. methods: {
  397. isDisable(item,type,data){
  398. console.log('isDisable');
  399. if(type == 'KD'){
  400. let flag = true
  401. this.goodsInfo.skuCombinList.map(skuItem=>{
  402. skuItem.skusSpecs.map(skuIt=>{
  403. if(skuIt.specItemValueName == item.name){
  404. flag = false
  405. }
  406. })
  407. })
  408. return flag
  409. }else if(type == 'XC'){
  410. let flag = false
  411. for (let key in this.chooseInfo) {
  412. if(this.chooseInfo[key].exclusives.length){
  413. this.chooseInfo[key].exclusives.map(i=>{
  414. i.values.map(it=>{
  415. if(it.id == item){
  416. flag = true
  417. }
  418. })
  419. })
  420. }
  421. }
  422. return flag
  423. }else if(type == 'NXDC'){
  424. let flag = true
  425. let cur = {}
  426. for (let key in this.chooseInfo) {
  427. if(data.code == key){
  428. cur[key] = item.code
  429. }else{
  430. cur[key] = this.chooseInfo[key].code
  431. }
  432. }
  433. this.goodsInfo.details.sku_infos.map(item=>{
  434. let obj = {}
  435. item.specs.map(i=>{
  436. obj[i.code] = i.spec_code
  437. })
  438. if(this.areObjectsEqual(cur,obj)){
  439. flag = false
  440. }
  441. })
  442. return flag
  443. }
  444. },
  445. // 选择规格
  446. choose(item,key,data){
  447. console.log(item,key,data,this.chooseInfo);
  448. if(this.ot == 'XC'){
  449. if(this.chooseInfo[key]&&this.chooseInfo[key].id == item.id &&!data.mandatory){
  450. this.$delete(this.chooseInfo,key)
  451. }else{
  452. this.$set(this.chooseInfo,key,item)
  453. }
  454. }else if(this.ot == 'MDL'){
  455. if(this.chooseInfo[key]&&this.chooseInfo[key].id == item.id){//麦当劳不能不选择
  456. // this.$delete(this.chooseInfo,key)
  457. }else{
  458. this.$set(this.chooseInfo,key,item)
  459. }
  460. }
  461. else if(this.ot == 'XBK'){
  462. if(this.chooseInfo[key]&&this.chooseInfo[key].id == item.id){//星巴克不能不选择
  463. // this.$delete(this.chooseInfo,key)
  464. }else{
  465. this.$set(this.chooseInfo,key,item)
  466. }
  467. }
  468. else if(this.ot == 'KD'){
  469. let flag = false
  470. this.goodsInfo.skuCombinList.map(skuItem=>{
  471. skuItem.skusSpecs.map(skuIt=>{
  472. if(skuIt.specItemValueName == item.name){
  473. flag = true
  474. }
  475. })
  476. })
  477. // 在sku内有的才能选择
  478. if(flag){
  479. // 把数据组装成自己转换成skusSpecs格式对象
  480. this.$set(this.chooseInfo,key,
  481. {specItemName: data.specItemName,
  482. specItemNo: key,
  483. specItemValue: item.value,
  484. specItemValueName: item.name})
  485. }
  486. }
  487. else{//奈雪的茶 瑞幸
  488. this.$set(this.chooseInfo,key,item)
  489. }
  490. },
  491. confirm(){
  492. this.show1 = false
  493. uni.navigateTo({
  494. url:'./shopList'
  495. })
  496. },
  497. goShopList(){
  498. this.show3 = false
  499. uni.navigateTo({
  500. url:'./shopList'
  501. })
  502. },
  503. // 滚动的选择商品
  504. scroll(val){
  505. if(!this.offsetTop){
  506. this.offsetTop = val.currentTarget.offsetTop
  507. }
  508. this.topList.map((item,index)=>{
  509. if(index!=this.topList.length-1){
  510. if(val.detail.scrollTop>= (item-this.offsetTop)&&(val.detail.scrollTop <=this.topList[index+1]-this.offsetTop)){
  511. this.scrollTo1 = 'tab'+index
  512. this.active = index
  513. }
  514. }else{
  515. if(val.detail.scrollTop>= (item-this.offsetTop)){
  516. this.scrollTo1 = 'tab'+index
  517. this.active = index
  518. }
  519. }
  520. })
  521. },
  522. clear(){
  523. this.carList = []
  524. },
  525. // 购物车内添加数量 商品添加数量 选择规格时不走这里 但是选择规格的购物车内数量操作走这里
  526. add(item,num,data={},idx){//item:当前操作item num:增加或者减少 data:当前item的上层栏目,idx:购物车内当前操作商品index 方便删除
  527. console.log('add',item);
  528. // 如果需要选择规格
  529. if(data.childClassList) return this.handleItem(item,data)
  530. // 影响逻辑太大 暂时不改
  531. // if(item.menuFlag == "C") return this.handleItem(item,data)
  532. // 肯德基
  533. if(this.ot == 'Kfc'){
  534. if(this.carList.some(i=>item.productId == i.productId)){
  535. this.carList.forEach((row,index)=>{
  536. if(item.productId == row.productId){
  537. row.quantity+=num
  538. if(row.quantity == 0){
  539. this.carList.splice(index,1)
  540. }
  541. }
  542. })
  543. }else{
  544. let obj ={
  545. "imageUrl": item.imageUrl,
  546. "nameCn": item.nameCn,
  547. "productId": item.productId,
  548. "quantity": 1,
  549. "sellPrice": item.priceHead,
  550. "orgPrice": item.price,
  551. }
  552. this.carList.push(obj)
  553. }
  554. // }else if(this.ot == 'NXDC'){
  555. }else{
  556. if(this.carList.some((i,d)=>item.productId == i.productId)){
  557. this.carList.forEach((row,index)=>{
  558. if(index == idx){
  559. row.quantity+=num
  560. if(row.quantity == 0){
  561. this.carList.splice(index,1)
  562. }
  563. }
  564. })
  565. }else{//单品直接添加
  566. console.log(2222);
  567. this.chooseInfo = {}
  568. this.itemPrice = {
  569. price:this.item.priceHead,
  570. oldPrice:this.item.price
  571. }
  572. this.item = item
  573. this.handleAdd()
  574. }
  575. }
  576. },
  577. // 商品详情内数量操作
  578. add1(num){
  579. this.num+=num
  580. },
  581. // 计算奈雪当前选择规格价格和code
  582. findData(){
  583. let productId = ''
  584. let cur = {}
  585. let price = 0
  586. let oldPrice = 0
  587. let addPrice = 0
  588. for (let key in this.chooseInfo) {
  589. cur[key] = this.chooseInfo[key].code
  590. addPrice += this.chooseInfo[key].price
  591. }
  592. this.goodsInfo.details.sku_infos.map(item=>{
  593. let obj = {}
  594. item.specs.map(i=>{
  595. obj[i.code] = i.spec_code
  596. })
  597. if(this.areObjectsEqual(cur,obj)){
  598. price = item.salePrice
  599. oldPrice = item.price
  600. return productId = item.code
  601. }
  602. })
  603. console.log('找到对应的',productId,price);
  604. return {
  605. productId,
  606. price:price+addPrice,
  607. oldPrice:oldPrice+addPrice
  608. }
  609. },
  610. // 计算瑞幸当前选择规格价格和code
  611. findData1(){
  612. let productId = ''
  613. let cur = {}
  614. let price = 0
  615. let oldPrice = 0
  616. let addPrice = 0
  617. for (let key in this.chooseInfo) {
  618. cur[key] = this.chooseInfo[key].name
  619. addPrice += this.chooseInfo[key].price
  620. }
  621. this.goodsInfo.details.sku_infos.map(item=>{
  622. let obj = {}
  623. item.values.map(i=>{
  624. obj[i.name] = i.spec_name
  625. })
  626. if(this.areObjectsEqual(cur,obj)){
  627. price = this.item.priceHead
  628. oldPrice = this.item.price
  629. return productId = item.code
  630. }
  631. })
  632. console.log('找到对应的1',productId,price);
  633. return {
  634. productId,
  635. price:price+addPrice,
  636. oldPrice:oldPrice+addPrice
  637. }
  638. },
  639. // 计算库迪当前选择规格
  640. findData2(){
  641. let productId = ''
  642. let cur = {}
  643. for (let key in this.chooseInfo) {
  644. cur[key] = this.chooseInfo[key].specItemValue
  645. }
  646. this.goodsInfo.skuCombinList.map(item=>{
  647. let obj = {}
  648. item.skusSpecs.map(i=>{
  649. obj[i.specItemNo] = i.specItemValue
  650. })
  651. console.log(cur,obj);
  652. if(this.areObjectsEqual(cur,obj)){
  653. return productId = item.skuNo
  654. }
  655. })
  656. console.log('找到对应的3',productId);
  657. return productId
  658. },
  659. // 选择规格后,加入购物车
  660. handleAdd(){
  661. this.show2 = false
  662. // let {productId,price,addPrice} = this.findData()
  663. let obj = {}
  664. if(this.ot == 'NXDC'){
  665. obj ={
  666. "imageUrl": this.item.imageUrl,
  667. "nameCn": this.item.nameCn,
  668. "productId": this.item.productId,
  669. "quantity": this.num,
  670. "sellPrice": this.itemPrice.price,//市场价(如果存在套餐选项加价,这里的金额需要计算加价)
  671. "orgPrice": this.itemPrice.oldPrice,
  672. "config": JSON.parse(JSON.stringify(this.config)) , //这里只是为了直观展示套餐选项,实际下单可以传空
  673. "selected": [
  674. {
  675. "round": 0, //奈雪产品round目前没有使用,传0
  676. "products": [
  677. {
  678. "linkId": "",
  679. "productId": this.productId, //套餐选项skuID,商品详情的sku列表里面已经包含所有选项组合
  680. "quantity": 1
  681. }
  682. ]
  683. }
  684. ]
  685. }
  686. }else if(this.ot == 'XC'){
  687. let products = []
  688. for (let key in this.chooseInfo) {
  689. products.push(
  690. { "linkId": key, "productId": this.chooseInfo[key].id, "quantity": 1 }
  691. )
  692. }
  693. obj ={
  694. "imageUrl": this.item.imageUrl,
  695. "nameCn": this.item.nameCn,
  696. "productId": this.item.productId,
  697. "quantity": this.num,
  698. "sellPrice": this.itemPrice.price,//市场价(如果存在套餐选项加价,这里的金额需要计算加价)
  699. "orgPrice": this.itemPrice.oldPrice,
  700. "config": JSON.parse(JSON.stringify(this.config)) , //这里只是为了直观展示套餐选项,实际下单可以传空
  701. "selected": [
  702. {
  703. "round": 0,//喜茶产品round目前没有使用,传0
  704. "products": products
  705. }
  706. ]
  707. }
  708. }else if(this.ot == 'MDL'){
  709. let products = []
  710. if(this.goodsInfo.details.optional.length){//有可选才添加 没有默认空数组
  711. for (let key in this.chooseInfo) {
  712. products.push(
  713. {
  714. "linkId": key.split('-')[1],//下单参数linkId(有时会和主商品id相同)
  715. "productId": this.chooseInfo[key].id,//套餐选项商品id
  716. "quantity": 1
  717. }
  718. )
  719. }
  720. obj ={
  721. "imageUrl": this.item.imageUrl,
  722. "nameCn": this.item.nameCn,
  723. "productId": this.item.productId,
  724. "quantity": this.num,
  725. "sellPrice": this.itemPrice.price,//市场价(如果存在套餐选项加价,这里的金额需要计算加价)
  726. "orgPrice": this.itemPrice.oldPrice,
  727. "config": JSON.parse(JSON.stringify(this.config)) , //这里只是为了直观展示套餐选项,实际下单可以传空
  728. "selected": [
  729. {
  730. "round": 0,//喜茶产品round目前没有使用,传0
  731. "products": products
  732. }
  733. ]
  734. }
  735. }else{
  736. obj ={
  737. "imageUrl": this.item.imageUrl,
  738. "nameCn": this.item.nameCn,
  739. "productId": this.item.productId,
  740. "quantity": this.num,
  741. "sellPrice": this.itemPrice.price,//市场价(如果存在套餐选项加价,这里的金额需要计算加价)
  742. "orgPrice": this.itemPrice.oldPrice,
  743. "config": JSON.parse(JSON.stringify(this.config)) , //这里只是为了直观展示套餐选项,实际下单可以传空
  744. "selected": []
  745. }
  746. }
  747. }
  748. else if(this.ot == 'XBK'){
  749. let products = []
  750. for (let key in this.chooseInfo) {
  751. products.push(
  752. {
  753. "linkId": key,
  754. "productId": this.chooseInfo[key].id,//套餐选项商品id
  755. "quantity": 1
  756. }
  757. )
  758. }
  759. obj ={
  760. "imageUrl": this.item.imageUrl,
  761. "nameCn": this.item.nameCn,
  762. "productId": this.item.productId,
  763. "quantity": this.num,
  764. "sellPrice": this.itemPrice.price,//市场价(如果存在套餐选项加价,这里的金额需要计算加价)
  765. "orgPrice": this.itemPrice.oldPrice,
  766. "config": JSON.parse(JSON.stringify(this.config)) , //这里只是为了直观展示套餐选项,实际下单可以传空
  767. "selected": [
  768. {
  769. "round": 0,//喜茶产品round目前没有使用,传0
  770. "products": products
  771. }
  772. ]
  773. }
  774. }else if(this.ot == 'RXKF'){
  775. obj ={
  776. "imageUrl": this.item.imageUrl,
  777. "nameCn": this.item.nameCn,
  778. "productId": this.item.productId,
  779. "quantity": this.num,
  780. "sellPrice": this.itemPrice.price,//市场价(如果存在套餐选项加价,这里的金额需要计算加价)
  781. "orgPrice": this.itemPrice.oldPrice,
  782. "config": JSON.parse(JSON.stringify(this.config)) , //这里只是为了直观展示套餐选项,实际下单可以传空
  783. "selected": [
  784. {
  785. "round": 0, //奈雪产品round目前没有使用,传0
  786. "products": [
  787. {
  788. "productId": this.productId, //套餐选项skuID,商品详情的sku列表里面已经包含所有选项组合
  789. "quantity": 1
  790. }
  791. ]
  792. }
  793. ]
  794. }
  795. }else if(this.ot == 'KD'){
  796. obj ={
  797. "linkId": this.productId,//套餐选项skuID(必须)
  798. "imageUrl": this.item.imageUrl,
  799. "nameCn": this.item.nameCn,
  800. "productId": this.item.productId,
  801. "quantity": this.num,
  802. "sellPrice": this.itemPrice.price,//市场价(如果存在套餐选项加价,这里的金额需要计算加价)
  803. "orgPrice": this.itemPrice.oldPrice,
  804. "config": JSON.parse(JSON.stringify(this.config)) , //这里只是为了直观展示套餐选项,实际下单可以传空
  805. "selected": [
  806. {
  807. "round": 0,//库迪产品round目前没有使用,传0
  808. "products": [{ "productId": this.productId, "quantity": 1 }]//套餐选项skuID,跟外层的linkId值相同
  809. }
  810. ]
  811. }
  812. }
  813. this.carList.push(obj)
  814. },
  815. // 对比两个对象是否内容相同
  816. areObjectsEqual(obj1, obj2) {
  817. const keys1 = Object.keys(obj1);
  818. const keys2 = Object.keys(obj2);
  819. if (keys1.length!== keys2.length) {
  820. return false;
  821. }
  822. for (const key in obj1) {
  823. if (obj1.hasOwnProperty(key)) {
  824. if (obj1[key]!== obj2[key]) {
  825. return false;
  826. }
  827. }
  828. }
  829. return true;
  830. },
  831. close(key){
  832. this[key] = false
  833. },
  834. handleItem(i,item){
  835. console.log(item);
  836. this.num = 1
  837. this.item = i
  838. if(!item.childClassList) return
  839. this.show2 = true
  840. this.chooseInfo = {}
  841. foodGoodsDetail({productId:i.productId,shopId:this.shopId}).then(res=>{
  842. if(res.state = 'Success'){
  843. this.goodsInfo = res.content.data
  844. if(this.goodsInfo.details&&this.goodsInfo.details.spu_specs&&this.ot=='NXDC'){//奈雪的茶
  845. this.goodsInfo.details.spu_specs.map(item=>{
  846. this.$set(this.chooseInfo,item.code,item.values[0])
  847. })
  848. }else if(this.goodsInfo.details&&this.goodsInfo.details.specifications&&this.ot=='XC'){//喜茶
  849. this.goodsInfo.details.specifications.map(item=>{
  850. item.values.map(i=>{
  851. if(i.checked){
  852. this.$set(this.chooseInfo,item.id,item.values[0])
  853. }
  854. })
  855. })
  856. }else if(this.goodsInfo.details&&this.goodsInfo.details.optional&&this.goodsInfo.details.optional.length&&this.ot=='XBK'){//星巴克
  857. this.goodsInfo.details.optional.map(item=>{
  858. item.sku_infos.map(i=>{
  859. if(i.checked){
  860. this.$set(this.chooseInfo,item.id,i)
  861. }
  862. })
  863. // this.$set(this.chooseInfo,item.id,item.sku_infos[0])
  864. })
  865. }else if(this.goodsInfo.details&&this.goodsInfo.details.optional&&this.goodsInfo.details.optional.length){//麦当劳
  866. this.goodsInfo.details.optional.map(item=>{
  867. item.sku_infos.map(i=>{
  868. if(i.checked){
  869. this.$set(this.chooseInfo,item.name+'-'+item.id,i)
  870. }
  871. })
  872. // id可能相同 所以加上类目的name 方便创建订单时能取到id
  873. // this.$set(this.chooseInfo,item.name+'-'+item.id,item.sku_infos[0])
  874. })
  875. }else if(this.goodsInfo.details&&this.goodsInfo.details.specifications&&this.ot=='RXKF'){//瑞幸
  876. this.goodsInfo.details.specifications.map(item=>{
  877. item.ingredients.map(i=>{
  878. if(i.checked){
  879. this.$set(this.chooseInfo,item.name,i)
  880. }
  881. })
  882. // this.$set(this.chooseInfo,item.name,item.ingredients[0])
  883. })
  884. }else if(this.goodsInfo.firstSku&&this.goodsInfo.firstSku.skusSpecs&&this.ot=='KD'){//库迪
  885. this.goodsInfo.product_img = this.goodsInfo.detailImgUrl
  886. this.goodsInfo.product_name = this.goodsInfo.title
  887. this.goodsInfo.firstSku.skusSpecs.map(item=>{
  888. this.$set(this.chooseInfo,item.specItemNo,item)
  889. })
  890. }
  891. console.log(this.chooseInfo);
  892. }
  893. })
  894. },
  895. handleCar(){
  896. this.show = true
  897. },
  898. handleTab(index){
  899. this.active = index
  900. this.scrollTo = 'title'+index
  901. },
  902. chooseTag(val){
  903. console.log('当前',val);
  904. },
  905. menuList(){
  906. uni.showLoading({
  907. title:'加载中'
  908. })
  909. menuList(this.shopId).then(res=>{
  910. uni.hideLoading()
  911. if(res.state = 'Success'){
  912. this.list = res.content.data
  913. if(!this.list.length){
  914. this.show3 = true
  915. }
  916. this.list.map((item,index)=>{
  917. if(this.ot != 'Kfc'&&item.childClassList){
  918. item.menuVoList = JSON.parse(JSON.stringify(item.childClassList[0].menuVoList))
  919. // delete item.childClassList
  920. }
  921. // 滚动到对应栏目
  922. if(this.cateName&&(item.topName == this.cateName)){
  923. this.handleTab(index)
  924. }
  925. })
  926. this.$nextTick(()=>{
  927. let query = uni.createSelectorQuery().in(this);
  928. query.selectAll('.section-name').boundingClientRect(data=>{
  929. this.topList =data.map(item=>{
  930. return item.top
  931. })
  932. }).exec();
  933. })
  934. }
  935. })
  936. },
  937. shopDetail(){
  938. shopDetail({"id": this.shopId,
  939. "lat": "",
  940. "lon": ""}).then(res=>{
  941. if(res.state = 'Success'){
  942. this.shopInfo.shopName = res.content.data.shopName
  943. this.shopInfo.address = res.content.data.address
  944. //是否在营业时间内
  945. if(res.content.data.openTime&&res.content.data.closeTime&&!this.isInBusinessHours(res.content.data.openTime,res.content.data.closeTime)){
  946. this.show1 = true
  947. }
  948. }
  949. })
  950. },
  951. buy() {
  952. let that = this
  953. if (uni.getStorageSync('token')) {
  954. if(JSON.parse(uni.getStorageSync('userInfo')).setMealCode != 0&&JSON.parse(uni.getStorageSync('userInfo')).setMealCode){
  955. let info ={
  956. shopName:this.shopInfo.shopName,
  957. address:this.shopInfo.address,
  958. shopId:this.shopId,
  959. products:this.carList,
  960. total:this.total,
  961. openTime:this.shopInfo.openTime,
  962. closeTime:this.shopInfo.closeTime,
  963. totalNum:this.totalNum
  964. }
  965. uni.navigateTo({
  966. url:`/orderFood/pay`,
  967. success: function(res) {
  968. // 通过eventChannel向被打开页面传送数据
  969. res.eventChannel.emit('pay', info)
  970. }
  971. })
  972. }else{
  973. uni.showModal({
  974. title:'此商品需要开通会员才能购买',
  975. cancelText:'下次再说',
  976. confirmText:'立即开通',
  977. success(res) {
  978. if(res.confirm){
  979. uni.navigateTo({
  980. url:'/my/memberCenter/index'
  981. })
  982. }
  983. }
  984. })
  985. }
  986. }else{
  987. uni.showModal({
  988. title:'请登录',
  989. confirmText:'去登录',
  990. success(res){
  991. console.log(res);
  992. if(res.confirm){
  993. uni.navigateTo({
  994. url:`/login/login/login?redirect=/orderFood/shopDetail&id=${that.shopId}`
  995. })
  996. }
  997. }
  998. })
  999. }
  1000. },
  1001. isInBusinessHours(openTimeStr, closeTimeStr) {
  1002. let open = openTimeStr
  1003. let close = closeTimeStr
  1004. if(open.indexOf('.') != -1){
  1005. let index = open.indexOf('.')
  1006. open = open.substr(0,index)
  1007. }
  1008. if(close.indexOf('.') != -1){
  1009. let index = close.indexOf('.')
  1010. close = close.substr(0,index)
  1011. }
  1012. const now = new Date();
  1013. const openTime = new Date(open);
  1014. const closeTime = new Date(close);
  1015. // 获取当前时间的时分秒
  1016. const nowHours = now.getHours();
  1017. const nowMinutes = now.getMinutes();
  1018. const nowSeconds = now.getSeconds();
  1019. // 获取开店时间的时分秒
  1020. const openHours = openTime.getHours();
  1021. const openMinutes = openTime.getMinutes();
  1022. const openSeconds = openTime.getSeconds();
  1023. // 获取关店时间的时分秒
  1024. const closeHours = closeTime.getHours();
  1025. const closeMinutes = closeTime.getMinutes();
  1026. const closeSeconds = closeTime.getSeconds();
  1027. // 将当前时间、开店时间和关店时间转换为秒数
  1028. const nowSecondsTotal = nowHours * 3600 + nowMinutes * 60 + nowSeconds;
  1029. const openSecondsTotal = openHours * 3600 + openMinutes * 60 + openSeconds;
  1030. const closeSecondsTotal = closeHours * 3600 + closeMinutes * 60 + closeSeconds;
  1031. if ( openSecondsTotal <nowSecondsTotal && nowSecondsTotal<closeSecondsTotal ) {
  1032. return true
  1033. } else {
  1034. return false
  1035. }
  1036. }
  1037. },
  1038. onLoad(options) {
  1039. console.log(this.isInBusinessHours("2019-08-24T09:15:22.123Z","2019-08-24T14:15:22.123"));
  1040. this.cateName = options.cateName
  1041. this.shopId = options.id || "63836999-5117-4980-8632-497f007808ef"
  1042. // this.shopId = "63836999-5117-4980-8632-497f007808ef"
  1043. this.shopDetail()
  1044. this.menuList()
  1045. },
  1046. onReady () {
  1047. // this.Observer = uni.createIntersectionObserver(this)
  1048. // this.Observer.relativeTo('.test',{bottom: 0}).observe('.title0', (res) => {
  1049. // console.log(12312);
  1050. // // this.$emit('changeTag',this.value)
  1051. // })
  1052. }
  1053. }
  1054. </script>
  1055. <style lang="scss" >
  1056. .orderFood{
  1057. .shop-info{
  1058. width: 100%;
  1059. height: 140rpx;
  1060. padding: 20rpx 24rpx;
  1061. box-sizing: border-box;
  1062. border-bottom: 2rpx solid #F0F0F0;
  1063. // position: fixed;
  1064. // top: 0%;
  1065. // left: 0%;
  1066. // z-index: 9;
  1067. background: #fff;
  1068. .shop-name{
  1069. font-weight: bold;
  1070. font-size: 32rpx;
  1071. color: #222222;
  1072. }
  1073. .address{
  1074. font-size: 24rpx;
  1075. color: #AAAAAA;
  1076. margin-top: 8rpx;
  1077. }
  1078. }
  1079. .content{
  1080. height: calc(100vh - 140rpx);
  1081. display: flex;
  1082. overflow: auto;
  1083. box-sizing: border-box;
  1084. padding-bottom: calc(98rpx + env(safe-area-inset-bottom)) ;
  1085. .left{
  1086. flex: 0 0 176rpx;
  1087. background: #F7F7F7;
  1088. .item{
  1089. text-align: center;
  1090. padding: 16rpx 0;
  1091. .icon{
  1092. width: 76rpx;
  1093. height: 76rpx;
  1094. }
  1095. .name{
  1096. font-size: 24rpx;
  1097. color: #AAAAAA;
  1098. }
  1099. }
  1100. .item.active{
  1101. background: #FFFFFF;
  1102. .name{
  1103. color: #222222;
  1104. }
  1105. }
  1106. }
  1107. .right{
  1108. flex: 1;
  1109. padding: 0 24rpx;
  1110. overflow: auto;
  1111. position: relative;
  1112. .test{
  1113. width: 100%;
  1114. height: 60rpx;
  1115. background: red;
  1116. position: fixed;
  1117. }
  1118. .section{
  1119. .section-name{
  1120. font-weight: bold;
  1121. font-size: 28rpx;
  1122. color: #222222;
  1123. padding-top: 30rpx;
  1124. }
  1125. .item{
  1126. display: flex;
  1127. margin-top: 28rpx;
  1128. .img{
  1129. width: 160rpx;
  1130. height: 160rpx;
  1131. border-radius: 8rpx 8rpx 8rpx 8rpx;
  1132. }
  1133. .info{
  1134. flex: 1;
  1135. margin-left: 26rpx;
  1136. display: flex;
  1137. flex-direction: column;
  1138. justify-content: space-around;
  1139. .title{
  1140. font-weight: bold;
  1141. font-size: 32rpx;
  1142. color: #222222;
  1143. }
  1144. .btn-box{
  1145. display: flex;
  1146. justify-content: space-between;
  1147. .price-box{
  1148. display: flex;
  1149. align-items: center;
  1150. .price{
  1151. display: flex;
  1152. align-items: flex-end;
  1153. color: #FF4D3A;
  1154. .unit{
  1155. font-size: 20rpx;
  1156. }
  1157. .num{
  1158. font-weight: bold;
  1159. font-size: 36rpx;
  1160. }
  1161. }
  1162. .old-price{
  1163. font-weight: normal;
  1164. font-size: 24rpx;
  1165. color: #AAAAAA;
  1166. text-decoration: line-through;
  1167. margin-left: 16rpx;
  1168. }
  1169. }
  1170. .btn{
  1171. width: 40rpx;
  1172. height: 40rpx;
  1173. }
  1174. }
  1175. }
  1176. }
  1177. }
  1178. }
  1179. }
  1180. .total-box1{
  1181. position: inherit!important;
  1182. padding-bottom: 0!important;
  1183. }
  1184. .total-box{
  1185. position: fixed;
  1186. left: 0%;
  1187. bottom: 0;
  1188. width: 100%;
  1189. padding: 10rpx 24rpx env(safe-area-inset-bottom);
  1190. box-sizing: border-box;
  1191. display: flex;
  1192. align-items: center;
  1193. justify-content: space-between;
  1194. border-top: 1rpx solid #EEEEEE;
  1195. .price-box{
  1196. display: flex;
  1197. .car-box{
  1198. position: relative;
  1199. display: flex;
  1200. align-items: center;
  1201. .icon{
  1202. width: 48rpx;
  1203. height: 48rpx;
  1204. }
  1205. .num{
  1206. position: absolute;
  1207. top: -18rpx;
  1208. right: -18rpx;
  1209. min-width: 36rpx;
  1210. height: 36rpx;
  1211. line-height: 36rpx;
  1212. text-align: center;
  1213. border-radius: 18rpx;
  1214. background: #222222;
  1215. font-weight: bold;
  1216. font-size: 24rpx;
  1217. color: #FFFFFF;
  1218. margin-left: 20rpx;
  1219. }
  1220. }
  1221. .price{
  1222. display: flex;
  1223. align-items: flex-end;
  1224. color: #FF4D3A;
  1225. .unit{
  1226. font-size: 20rpx;
  1227. }
  1228. .num{
  1229. font-weight: bold;
  1230. font-size: 36rpx;
  1231. }
  1232. }
  1233. }
  1234. .buy{
  1235. width: 200rpx;
  1236. height: 80rpx;
  1237. line-height: 80rpx;
  1238. text-align: center;
  1239. background: #EE4320;
  1240. border-radius: 40rpx 40rpx 40rpx 40rpx;
  1241. font-weight: bold;
  1242. font-size: 28rpx;
  1243. color: #FFFFFF;
  1244. margin: 0;
  1245. }
  1246. .buy::after{
  1247. border: none;
  1248. outline: none;
  1249. }
  1250. .buy.disabled{
  1251. background: #F6F6F6;
  1252. color: #AAAAAA;
  1253. }
  1254. }
  1255. .popup-title-box{
  1256. display: flex;
  1257. justify-content: space-between;
  1258. padding: 24rpx;
  1259. .title{
  1260. font-weight: bold;
  1261. font-size: 28rpx;
  1262. color: #222222;
  1263. }
  1264. .clear{
  1265. font-size: 28rpx;
  1266. color: #AAAAAA;
  1267. }
  1268. }
  1269. .u-empty{
  1270. padding: 30rpx 0;
  1271. }
  1272. .car-content{
  1273. padding-bottom: 30rpx;
  1274. max-height: 700rpx;
  1275. overflow: auto;
  1276. .item{
  1277. display: flex;
  1278. margin-top: 28rpx;
  1279. padding: 0 24rpx;
  1280. .img{
  1281. width: 160rpx;
  1282. height: 160rpx;
  1283. border-radius: 8rpx 8rpx 8rpx 8rpx;
  1284. }
  1285. .info{
  1286. flex: 1;
  1287. margin-left: 26rpx;
  1288. display: flex;
  1289. flex-direction: column;
  1290. justify-content: space-between;
  1291. .title{
  1292. font-weight: bold;
  1293. font-size: 32rpx;
  1294. color: #222222;
  1295. }
  1296. .type{
  1297. font-weight: normal;
  1298. font-size: 24rpx;
  1299. color: #AAAAAA;
  1300. }
  1301. .btn-box{
  1302. display: flex;
  1303. justify-content: space-between;
  1304. .price-box{
  1305. display: flex;
  1306. align-items: center;
  1307. .price{
  1308. display: flex;
  1309. align-items: flex-end;
  1310. color: #FF4D3A;
  1311. .unit{
  1312. font-size: 20rpx;
  1313. }
  1314. .num{
  1315. font-weight: bold;
  1316. font-size: 36rpx;
  1317. }
  1318. }
  1319. .old-price{
  1320. font-weight: normal;
  1321. font-size: 24rpx;
  1322. color: #AAAAAA;
  1323. text-decoration: line-through;
  1324. margin-left: 16rpx;
  1325. }
  1326. }
  1327. .count-box{
  1328. display: flex;
  1329. align-items: center;
  1330. .num{
  1331. width: 100rpx;
  1332. text-align: center;
  1333. font-size: 28rpx;
  1334. color: #222222;
  1335. }
  1336. .btn{
  1337. width: 40rpx;
  1338. height: 40rpx;
  1339. }
  1340. }
  1341. }
  1342. }
  1343. }
  1344. }
  1345. .modal-box{
  1346. .shop-name{
  1347. font-weight: 600;
  1348. font-size: 32rpx;
  1349. color: #181818;
  1350. width: 100%;
  1351. text-align: center;
  1352. }
  1353. .address{
  1354. font-weight: 300;
  1355. font-size: 24rpx;
  1356. color: #AAAAAA;
  1357. margin-top: 4rpx;
  1358. width: 100%;
  1359. text-align: center;
  1360. }
  1361. .notice{
  1362. margin-top: 20rpx;
  1363. font-weight: 300;
  1364. font-size: 24rpx;
  1365. color: #AAAAAA;
  1366. text-align: center;
  1367. }
  1368. }
  1369. .popup-goodsDetail{
  1370. padding-bottom: env(safe-area-inset-bottom);
  1371. .img{
  1372. width: 750rpx;
  1373. height: 400rpx;
  1374. vertical-align: bottom;
  1375. }
  1376. .box{
  1377. max-height: 60vh;
  1378. overflow: auto;
  1379. }
  1380. .popup-content{
  1381. padding: 0 24rpx;
  1382. .title{
  1383. font-weight: 800;
  1384. font-size: 32rpx;
  1385. color: #222222;
  1386. margin-top: 24rpx;
  1387. }
  1388. .desc{
  1389. font-size: 24rpx;
  1390. color: #222222;
  1391. margin: 24rpx 0;
  1392. }
  1393. .choose-box{
  1394. margin-top: 20rpx;
  1395. .choose-item{
  1396. .choose-title{
  1397. font-size: 28rpx;
  1398. color: #222222;
  1399. }
  1400. .item-box{
  1401. display: flex;
  1402. flex-wrap: wrap;
  1403. padding: 20rpx 0;
  1404. .item{
  1405. font-size: 24rpx;
  1406. color: #222222;
  1407. padding: 0 20rpx;
  1408. line-height: 44rpx;
  1409. height: 44rpx;
  1410. background: #fff;
  1411. border-radius: 8rpx 8rpx 8rpx 8rpx;
  1412. border: 2rpx solid #F0F0F0;
  1413. margin-right: 20rpx;
  1414. margin-bottom: 10rpx;
  1415. }
  1416. .item.active{
  1417. border: 2rpx solid #EE4320;
  1418. background: #FEECE8;
  1419. }
  1420. .item.disable{
  1421. color: #AAAAAA;
  1422. pointer-events: none;
  1423. }
  1424. }
  1425. }
  1426. }
  1427. }
  1428. .btn-box{
  1429. padding: 20rpx 24rpx;
  1430. border-top: 1rpx solid #EEEEEE;
  1431. .order-info{
  1432. display: flex;
  1433. align-items: center;
  1434. justify-content: space-between;
  1435. .left{
  1436. .price-box{
  1437. display: flex;
  1438. align-items: center;
  1439. .price{
  1440. font-weight: bold;
  1441. font-size: 28rpx;
  1442. color: #222222;
  1443. }
  1444. .old-price{
  1445. font-size: 22rpx;
  1446. color: #AAAAAA;
  1447. text-decoration: line-through;
  1448. }
  1449. }
  1450. .choose{
  1451. font-size: 20rpx;
  1452. color: #AAAAAA;
  1453. margin-top: 8rpx;
  1454. }
  1455. }
  1456. .count-box{
  1457. display: flex;
  1458. align-items: center;
  1459. .num{
  1460. width: 100rpx;
  1461. text-align: center;
  1462. font-size: 28rpx;
  1463. color: #222222;
  1464. }
  1465. .btn1{
  1466. width: 40rpx;
  1467. height: 40rpx;
  1468. }
  1469. }
  1470. }
  1471. .btn{
  1472. width: 702rpx;
  1473. height: 80rpx;
  1474. background: #EE4320;
  1475. font-weight: bold;
  1476. font-size: 28rpx;
  1477. color: #FFFFFF;
  1478. margin-top: 24rpx;
  1479. }
  1480. }
  1481. }
  1482. }
  1483. </style>