menu.vue 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795
  1. <template>
  2. <view class="menu-box display-flex">
  3. <scroll-view scroll-y="true" class="menu-box-left" :scroll-into-view="idMark" :scroll-with-animation='true'>
  4. <view class="menu-type-list-f">
  5. <view class="menu-type-list fs-26 box-border-box align-items-center flex-justify-center"
  6. v-for="(item,i) in categoryData" :key="i" @click="selectType(item)"
  7. :class="type === item.type?'bgc-f fc-3 fw-600':'fc-6 fw-400'" :id="'scroll'+ item.type">
  8. {{item.name}}
  9. <view class="menu-type-num fc-f" v-show="item.num > 0">{{item.num > 99?'99+':item.num}}</view>
  10. </view>
  11. </view>
  12. </scroll-view>
  13. <scroll-view :scroll-y="true" :scroll-with-animation='true' :scroll-into-view="idMarkTwo" @scroll="menuScroll">
  14. <view class="menu-box-right">
  15. <view class="menu-box-only" v-for="(item,i) in categoryData" :key="i" :id="'scroll'+ item.type">
  16. <view class="mb-32 fs-30">{{item.name}}</view>
  17. <view class="menu-list flex-justify-space" v-for="(info,k) in item.list" :key="k"
  18. :id="'scroll'+ info.goods_id">
  19. <image class="flex-shrink0 goods_img" :src="info.goods_image" mode="scaleToFill"></image>
  20. <view class="menu-list-right flex-direction flex-justify-space">
  21. <view class="mb-8">
  22. <view class="mb-4 goods-name text-overflow-ellipsis fs-32 fw-600">{{info.goods_name}}
  23. </view>
  24. <view class="text-overflow-ellipsis-one fw-400 fc-9 fs-24 mb-2 goods-name"
  25. v-if="info.spec_type == 1">
  26. {{info.goods_desc}}
  27. </view>
  28. <view class="fw-400 fc-9 fs-24">月销{{info.sales}}</view>
  29. </view>
  30. <view class="flex-justify-space align-items-flex-end">
  31. <view class="">
  32. <span class="fs-24 fw-400 fc-FB3D03">¥</span>
  33. <span
  34. class="fs-40 fw-b fc-FB3D03">{{info.seckill_money>0?info.seckill_money:info.price}}</span>
  35. <!-- <view class="">
  36. <span class="fs-24 fc-9 fw-400 text-line-through">¥{{info.line_price}}</span>
  37. </view> -->
  38. </view>
  39. <view class="display-flex align-items-center" v-if="info.spec_type == 1">
  40. <image v-show="info.num > 0" class="wh-44" @click="addred(1,i,k,info)"
  41. src="@/static/img/takeout/j.png" mode=""></image>
  42. <view v-show="info.num > 0"
  43. class="right-only-right-2 text-align-center fs-28 fw-400">{{info.num}}</view>
  44. <image class="wh-44" src="@/static/img/takeout/add.png" @click="addred(2,i,k,info)"
  45. mode=""></image>
  46. </view>
  47. <view v-else class="right-only-right text-align-center" @click="addred(3,i,k,info)">
  48. <view class="fw-600 fs-28 fc-f">
  49. 选规格
  50. </view>
  51. <view class="selectedNum" v-if="info.num>0">
  52. {{info.num}}
  53. </view>
  54. </view>
  55. </view>
  56. </view>
  57. </view>
  58. </view>
  59. </view>
  60. </scroll-view>
  61. <uni-popup ref="popupGG" type="bottom">
  62. <view class="gg-box flex-index-css">
  63. <view class="flex-justify-space box-border-box p-32">
  64. <view class="fs-32 fw-500 fc-0">商品详情规格</view>
  65. <view class="" @click="gbPop">
  66. <uni-icons type="closeempty" size="20"></uni-icons>
  67. </view>
  68. </view>
  69. <view class="goods-info flex-justify-space mb-32 box-border-box plr-32">
  70. <image v-if="popData.goodsItem.goods_image" :src="popData.goodsItem.goods_image" mode="scaleToFill">
  71. </image>
  72. <view class="flex-1">
  73. <view style="width: 446rpx;" class="fw-600 fs-34 text-overflow-ellipsis-one">
  74. {{popData.goodsItem.goods_name}}
  75. </view>
  76. <view class="fw-400 fc-9 fs-24 mb-2 text-overflow-ellipsis-t">
  77. {{popData.goodsItem.goods_desc}}
  78. </view>
  79. <view class="fw-400 fc-9 fs-24">月销{{popData.goodsItem.sales}}</view>
  80. </view>
  81. </view>
  82. <scroll-view scroll-y="true" class="scroll-view-css box-border-box plr-32">
  83. <view class="" v-for="(item,i) in popData.spec_attr" :key="i">
  84. <view class="fs-32 fw-500 fc-0 mb-32">{{item.group_name}}</view>
  85. <view class="flex-wrap-wrap">
  86. <view class="spec-item text-align-center fs-28"
  87. :class="popData.spec_ids.indexOf(info.item_id)>=0?'s-item':'n-item'"
  88. v-for="(info,k) in item.spec_items" :key="k" @click="selectSpec(info,i)">
  89. {{info.spec_value}}
  90. </view>
  91. </view>
  92. </view>
  93. </scroll-view>
  94. <!-- <view class="scroll-view-css box-border-box plr-32">
  95. <view class="" v-for="(item,i) in popData.spec_attr" :key="i">
  96. <view class="fs-32 fw-500 fc-0 mb-32">{{item.group_name}}</view>
  97. <view class="flex-wrap-wrap">
  98. <view class="spec-item text-align-center fs-28"
  99. :class="popData.spec_ids.indexOf(info.item_id)>=0?'s-item':'n-item'"
  100. v-for="(info,k) in item.spec_items" :key="k" @click="selectSpec(info,i)">
  101. {{info.spec_value}}
  102. </view>
  103. </view>
  104. </view>
  105. </view> -->
  106. <view class="pop-buttom box-border-box plr-32">
  107. <view class="flex-justify-space mb-28">
  108. <view class="pop-buttom-left">
  109. <view class="">
  110. <span class="fw-600 fs-32 fc-ED301D">¥</span>
  111. <span class="fw-600 fs-48 fc-ED301D">{{popData.price}}</span>
  112. </view>
  113. <view class="">
  114. <span class="fw-400 fs-24 fc-9">已选规格:</span>
  115. <span class="fw-400 fs-24">{{popData.spec_name.join(';')}}</span>
  116. </view>
  117. </view>
  118. <view class="display-flex align-items-center">
  119. <image class="wh-44" @click.stop="setSpecNum(1)" src="@/static/img/takeout/j.png" mode="">
  120. </image>
  121. <view class="right-only-right-2 text-align-center fs-28 fw-400">{{popData.num}}</view>
  122. <image class="wh-44" src="@/static/img/takeout/add.png" @click.stop="setSpecNum(2)" mode="">
  123. </image>
  124. </view>
  125. </view>
  126. <view class="pop-buttom-2 text-align-center fs-32 fw-600 fc-f" @click="addred(4)">选好了</view>
  127. </view>
  128. </view>
  129. </uni-popup>
  130. </view>
  131. </template>
  132. <script>
  133. import tools from "@/service/tools";
  134. import {
  135. shopCategory,
  136. shopGoods,
  137. shopGoodsSpec
  138. } from "@/api/shop";
  139. import {
  140. getShopIngList,
  141. setShopIngAdd,
  142. setShopIngDel,
  143. setShopIngNumber
  144. } from "@/api/shopping";
  145. export default {
  146. name: 'menu-box',
  147. props: {
  148. 'shop_id': {
  149. default: 0
  150. }
  151. },
  152. data() {
  153. return {
  154. idMark: '', //滚动自适应参数
  155. idMarkTwo: '', //滚动自适应参数
  156. type: 1, //分类标识
  157. typeList: [],
  158. categoryData: [],
  159. menuList: [],
  160. cartData: {
  161. total_price: 0,
  162. total_num: 0,
  163. total_goods_money: 0,
  164. pack_price: 0,
  165. must_category: 0,
  166. is_place_order: 0,
  167. err_msg: 0,
  168. goods_list: [],
  169. },
  170. isAjax: false,
  171. operate_id: '',
  172. popData: {
  173. goodsItem: {},
  174. price: '0.00',
  175. line_price: '',
  176. num: 0,
  177. goods_id: '',
  178. is_quota: 0,
  179. is_infinite: 0,
  180. quota_num: 0,
  181. payNum: 0,
  182. stock: 0,
  183. spec_key: '',
  184. goods_spec_id: '',
  185. spec_name: [],
  186. spec_ids: [],
  187. spec_list: [],
  188. spec_attr: [],
  189. },
  190. selectedNum: 1
  191. }
  192. },
  193. watch: {
  194. 'shop_id': function() {
  195. this.getShopGoods();
  196. }
  197. },
  198. mounted() {
  199. this.operate_id = uni.getStorageSync('operate_id')
  200. this.getShopGoods();
  201. this.getShopIngList(true);
  202. },
  203. methods: {
  204. setSpecNum(type) {
  205. if (!this.popData.goods_spec_id) {
  206. tools.error('请选择规格')
  207. return;
  208. }
  209. if (type === 1) {
  210. // 减
  211. if (this.popData.num > 0) {
  212. --this.popData.num;
  213. } else {
  214. this.isAjax = false
  215. }
  216. } else {
  217. if (this.popData.is_infinite === 0 && this.popData.payNum > this.popData.stock) {
  218. tools.error('商品库存' + this.popData.stock + '件')
  219. } else if (this.popData.is_quota > 0 && this.popData.payNum > this.popData.quota_num) {
  220. tools.error('限购' + this.popData.quota_num + '件')
  221. } else {
  222. // 加
  223. ++this.popData.num;
  224. }
  225. }
  226. },
  227. getShopGoodsSpec(item) {
  228. shopGoodsSpec({
  229. 'goods_id': item.goods_id
  230. }).then(res => {
  231. this.popData.goodsItem = item
  232. if (this.popData.goods_id !== item.goods_id) {
  233. this.popData.goods_id = item.goods_id
  234. this.popData.spec_name = []
  235. this.popData.price = '0.00'
  236. this.popData.line_price = ''
  237. this.popData.spec_key = ''
  238. this.popData.num = 1
  239. this.popData.spec_ids = []
  240. } else {
  241. this.popData.num = 1;
  242. if (this.cartData.goods_list.length > 0) {
  243. this.cartData.goods_list.forEach(item => {
  244. if (item.spec_sku_id === this.popData.spec_key) {
  245. this.popData.num = item.goods_number
  246. }
  247. })
  248. }
  249. }
  250. this.popData.spec_list = res.data.spec_list
  251. this.popData.spec_attr = res.data.spec_attr
  252. this.$refs.popupGG.open();
  253. this.setGoodsSpecPrice()
  254. this.isAjax = false
  255. }).catch(() => {
  256. tools.error('规格信息异常')
  257. this.isAjax = false
  258. })
  259. },
  260. setGoodsSpecPrice() {
  261. console.log(this.popData.spec_ids)
  262. if (this.popData.spec_ids.length > 0) {
  263. let spec_ids = JSON.parse(JSON.stringify(this.popData.spec_ids))
  264. spec_ids.sort((a, b) => a - b);
  265. let spec_key = spec_ids.join('_')
  266. this.popData.spec_key = spec_key
  267. console.log('this.popData.spec_list[spec_key]', this.popData.spec_list[spec_key])
  268. if (this.popData.spec_list[spec_key] !== undefined) {
  269. this.popData.price = this.popData.spec_list[spec_key].seckill_money > 0 ? this.popData.spec_list[
  270. spec_key].seckill_money : this.popData.spec_list[spec_key].price
  271. this.popData.line_price = this.popData.spec_list[spec_key].line_price
  272. if (this.popData.goods_spec_id !== this.popData.spec_list[spec_key].goods_spec_id + '') {
  273. this.popData.num = 1
  274. }
  275. this.popData.goods_spec_id = this.popData.spec_list[spec_key].goods_spec_id + ''
  276. let cartKey = this.cartData.goods_list.findIndex(row => this.popData.goods_spec_id * 1 === row
  277. .goods_spec_id * 1)
  278. if (cartKey >= 0) {
  279. this.popData.num = this.cartData.goods_list[cartKey].goods_number
  280. }
  281. } else {
  282. this.popData.line_price = '0.00'
  283. this.popData.price = '0.00'
  284. this.popData.num = 0
  285. this.popData.goods_spec_id = ''
  286. }
  287. } else {
  288. this.popData.price = '0.00'
  289. this.popData.line_price = '0.00'
  290. this.popData.num = 0
  291. this.popData.goods_spec_id = ''
  292. }
  293. },
  294. setShopIngList(cartData) {
  295. this.cartData = cartData
  296. this.setGoodsNum()
  297. },
  298. getShopIngList(isStart) {
  299. getShopIngList({
  300. 'shop_id': this.shop_id,
  301. }).then(res => {
  302. if (res.code === 1) {
  303. this.cartData = res.data
  304. this.$emit('setCartData', this.cartData)
  305. this.setGoodsNum()
  306. }
  307. })
  308. },
  309. setGoodsNum() {
  310. if (this.cartData.goods_list.length > 0) {
  311. let goodsIds = []
  312. this.categoryData.forEach(categoryItem => {
  313. categoryItem.list.forEach(goodsItem => {
  314. goodsItem.num = 0
  315. this.cartData.goods_list.forEach(item => {
  316. if (item.goods_id === goodsItem.goods_id) {
  317. if (goodsIds.indexOf(item.goods_id) < 0) {
  318. goodsIds.push(item.goods_id)
  319. goodsItem.num = item.goods_number * 1
  320. } else {
  321. goodsItem.num += item.goods_number * 1
  322. }
  323. }
  324. })
  325. })
  326. })
  327. } else {
  328. //购物车数据清除
  329. this.categoryData.forEach(categoryItem => {
  330. categoryItem.list.forEach(goodsItem => {
  331. goodsItem.num = 0
  332. })
  333. })
  334. }
  335. },
  336. getShopGoods() {
  337. if (this.shop_id < 0 || !this.operate_id) {
  338. return;
  339. }
  340. shopGoods({
  341. 'shop_id': this.shop_id,
  342. operate_id: this.operate_id,
  343. }).then(res => {
  344. if (res.code === 1) {
  345. this.categoryData = res.data
  346. const category_id = uni.getStorageSync('category_id')
  347. const goods_id = uni.getStorageSync('goods_id')
  348. if (category_id.type && category_id.type != 'undefined') {
  349. console.log('走跳转');
  350. this.selectType(category_id, goods_id)
  351. } else {
  352. console.log('没走跳转');
  353. this.selectType(this.categoryData[0])
  354. }
  355. // if (this.categoryData.length > 0) {
  356. // this.selectType(this.categoryData[0])
  357. // }
  358. this.categoryData.forEach(categoryItem => {
  359. categoryItem.list.forEach(goodsItem => {
  360. goodsItem.payNum = 0
  361. goodsItem.spec = []
  362. })
  363. })
  364. setTimeout(() => {
  365. this.setGoodsNum()
  366. }, 1000)
  367. }
  368. })
  369. },
  370. selectType(item, itemTwo) {
  371. console.log(item, itemTwo);
  372. if (this.type != item.type) {
  373. this.type = item.type;
  374. this.idMark = 'scroll' + item.type
  375. if (itemTwo) {
  376. this.idMarkTwo = 'scroll' + itemTwo.goodsId
  377. } else {
  378. this.idMarkTwo = this.idMark
  379. }
  380. this.$forceUpdate()
  381. }
  382. },
  383. menuScroll(e) {
  384. let _this = this;
  385. let query = uni.createSelectorQuery().in(this);
  386. const goods_id = uni.getStorageSync('goods_id')
  387. console.log(goods_id, "))))))))))))");
  388. if (goods_id.goodsId && goods_id.goodsId != 'undefined') {
  389. query.selectAll(".menu-list").boundingClientRect(data => {
  390. data.forEach((v) => {
  391. if (data[this.categoryData.length - 1].top <= 392) {
  392. return
  393. }
  394. if (v.top < 332 && v.top > 0) {
  395. // _this.idMark = v.id;
  396. let arr = v.id.split('scroll');
  397. }
  398. })
  399. uni.setStorageSync('category_id', '')
  400. uni.setStorageSync('goods_id', '')
  401. }).exec();
  402. } else {
  403. query.selectAll(".menu-box-only").boundingClientRect(data => {
  404. // console.log(data);
  405. data.forEach((v) => {
  406. if (data[this.categoryData.length - 1].top <= 392) {
  407. return
  408. }
  409. // console.log(data[this.categoryData.length - 1].top, '^^^^^^^^^^^^^^');
  410. // console.log(v.top, '^^^^^^^^^^^^^^');
  411. if (v.top < 332 && v.top > 0) {
  412. // _this.idMark = v.id;
  413. let arr = v.id.split('scroll');
  414. _this.type = Number(arr[1]);
  415. }
  416. })
  417. }).exec();
  418. }
  419. },
  420. addred(type, i, k, item) {
  421. if (this.isAjax) {
  422. return
  423. }
  424. this.isAjax = true
  425. if (type === 1) {
  426. // 减
  427. if (item.num > 0) {
  428. // --item.num;
  429. this.setSub(item, type);
  430. } else {
  431. this.isAjax = false
  432. }
  433. } else if (type === 2) {
  434. // 加
  435. if (item.is_infinite === 0 && item.num >= item.stock) {
  436. tools.error('商品库存' + item.stock + '件')
  437. this.isAjax = false
  438. } else if (item.is_quota > 0 && item.num >= item.quota_num) {
  439. tools.error('限购' + item.quota_num + '件')
  440. this.isAjax = false
  441. } else {
  442. this.setSub(item, type);
  443. }
  444. } else if (type === 3) {
  445. // 选规格
  446. console.log(item)
  447. this.popData.is_quota = item.is_quota
  448. this.popData.quota_num = item.quota_num
  449. this.popData.is_infinite = item.is_infinite
  450. this.popData.payNum = item.num
  451. this.popData.stock = item.stock
  452. this.getShopGoodsSpec(item)
  453. } else {
  454. this.$refs.popupGG.close();
  455. console.log('this.popData.goods_spec_id')
  456. console.log(this.popData.goods_spec_id)
  457. if (this.popData.goods_spec_id) {
  458. if (this.popData.is_infinite === 0 && this.popData.payNum > this.popData.stock) {
  459. tools.error('商品库存' + this.popData.stock + '件')
  460. this.popData.num = this.popData.stock
  461. } else if (this.popData.is_quota > 0 && this.popData.payNum > this.popData.quota_num) {
  462. tools.error('限购' + this.popData.quota_num + '件')
  463. this.popData.num = this.popData.quota_num
  464. } else {
  465. let cartKey = this.cartData.goods_list.findIndex(row => this.popData.goods_spec_id === row
  466. .goods_spec_id)
  467. console.log(cartKey)
  468. let addType = this.popData.num > 0 ? 2 : 1
  469. console.log('addType:' + addType)
  470. if (addType === 2 && cartKey < 0) {
  471. this.setShopIngAdd(this.popData.goods_id, this.popData.goodsItem.category_id, this.popData
  472. .goods_spec_id, this.popData.num)
  473. } else {
  474. this.setShopIngNumber(this.popData.goods_id, this.popData.goodsItem.category_id, type, this
  475. .popData
  476. .goods_spec_id, this.popData.num)
  477. }
  478. }
  479. } else {
  480. console.log('无规格信息')
  481. }
  482. this.isAjax = false
  483. }
  484. },
  485. gbPop() {
  486. this.$refs.popupGG.close();
  487. },
  488. setSub(item, type) {
  489. let cartKey = this.cartData.goods_list.findIndex(row => row.goods_id === item.goods_id)
  490. if (type === 2 && cartKey < 0) {
  491. this.setShopIngAdd(item.goods_id, item.category_id, '', 1, item)
  492. } else {
  493. this.setShopIngNumber(item.goods_id, item.category_id, type, '', 1, item)
  494. }
  495. },
  496. setShopIngAdd(goodsId, categoryId, goodsSpecId, number, item) {
  497. setShopIngAdd({
  498. 'type': 1,
  499. 'goods_id': goodsId,
  500. 'shop_id': this.shop_id,
  501. 'category_id': categoryId,
  502. 'goods_spec_id': goodsSpecId,
  503. 'number': number,
  504. }).then(res => {
  505. this.isAjax = false
  506. if (res.code === 1) {
  507. if (item) {
  508. ++item.num;
  509. }
  510. this.getShopIngList()
  511. } else if (res.code === 2) {
  512. tools.error(res.msg)
  513. if (item) {
  514. ++item.num;
  515. }
  516. this.getShopIngList()
  517. } else {
  518. tools.error(res.msg)
  519. }
  520. }).catch(() => {
  521. this.isAjax = false
  522. })
  523. },
  524. setShopIngNumber(goodsId, categoryId, operation, goodsSpecId, number, item) {
  525. setShopIngNumber({
  526. 'type': 1,
  527. 'goods_id': goodsId,
  528. 'shop_id': this.shop_id,
  529. 'category_id': categoryId,
  530. 'goods_spec_id': goodsSpecId,
  531. 'number': number,
  532. 'operation': operation === 2 ? 1 : 2,
  533. }).then(res => {
  534. this.isAjax = false
  535. if (res.code === 1) {
  536. if (item) {
  537. if (operation === 2) {
  538. ++item.num;
  539. } else {
  540. --item.num;
  541. }
  542. }
  543. this.getShopIngList()
  544. } else if (res.code === 2) {
  545. tools.error(res.msg)
  546. if (item) {
  547. if (operation === 2) {
  548. ++item.num;
  549. } else {
  550. --item.num;
  551. }
  552. }
  553. this.getShopIngList()
  554. } else {
  555. tools.error(res.msg)
  556. }
  557. }).catch(() => {
  558. this.isAjax = false
  559. })
  560. },
  561. setShopIngDel() {},
  562. // -------弹窗选择规格-----------
  563. selectSpec(info, groupKey) {
  564. let specKey = this.popData.spec_ids.indexOf(info.item_id)
  565. if (specKey >= 0) {
  566. this.popData.spec_ids.splice(specKey, 1)
  567. this.popData.spec_name.splice(specKey, 1)
  568. } else {
  569. this.popData.spec_ids.push(info.item_id)
  570. this.popData.spec_name.push(info.spec_value)
  571. for (const attrKey in this.popData.spec_attr[groupKey].spec_items) {
  572. if (this.popData.spec_attr[groupKey].spec_items[attrKey].item_id !== info.item_id) {
  573. let oldKey = this.popData.spec_ids.indexOf(this.popData.spec_attr[groupKey].spec_items[attrKey]
  574. .item_id)
  575. if (oldKey >= 0) {
  576. this.popData.spec_ids.splice(oldKey, 1)
  577. this.popData.spec_name.splice(oldKey, 1)
  578. }
  579. }
  580. }
  581. }
  582. // this.spec_ids = this.popData.spec_list.join('_')
  583. this.setGoodsSpecPrice()
  584. },
  585. },
  586. }
  587. </script>
  588. <style scoped lang="scss">
  589. .wh-44 {
  590. width: 44rpx;
  591. height: 44rpx;
  592. }
  593. .menu-box {
  594. height: 100%;
  595. .menu-box-left {
  596. width: 160rpx;
  597. height: 100%;
  598. background-color: #F7F8FA;
  599. // border-radius: 0rpx 20rpx 0 0rpx;
  600. .menu-type-list-f {
  601. width: 160rpx;
  602. height: 100%;
  603. .menu-type-list {
  604. width: 160rpx;
  605. min-height: 108rpx;
  606. padding: 18rpx 28rpx;
  607. position: relative;
  608. .menu-type-num {
  609. position: absolute;
  610. top: 2rpx;
  611. right: 8rpx;
  612. padding: 0 6rpx;
  613. min-width: 20rpx;
  614. height: 32rpx;
  615. text-align: center;
  616. line-height: 32rpx;
  617. background: #FB3D03;
  618. border-radius: 50%;
  619. }
  620. }
  621. }
  622. }
  623. .menu-box-right {
  624. // flex: 1;
  625. width: 100%;
  626. height: 100%;
  627. padding: 16rpx 12rpx 16rpx 16rpx;
  628. box-sizing: border-box;
  629. .menu-list {
  630. width: 100%;
  631. // height: 200rpx;
  632. margin-bottom: 40rpx;
  633. .goods_img {
  634. width: 200rpx;
  635. height: 200rpx;
  636. border-radius: 12rpx;
  637. margin-right: 16rpx;
  638. }
  639. .menu-list-right {
  640. flex: 1;
  641. .right-only-right {
  642. width: 100rpx;
  643. height: 44rpx;
  644. background: linear-gradient(117deg, #57CAFF 0%, #41ABF5 100%);
  645. border-radius: 12rpx;
  646. line-height: 44rpx;
  647. position: relative;
  648. .selectedNum {
  649. position: absolute;
  650. right: 2rpx;
  651. top: -22rpx;
  652. font-size: 24rpx;
  653. color: #fff;
  654. width: 32rpx;
  655. height: 32rpx;
  656. line-height: 32rpx;
  657. background: #FB3D03;
  658. border-radius: 50%;
  659. }
  660. }
  661. .right-only-right-red {
  662. width: 44rpx;
  663. height: 44rpx;
  664. line-height: 40rpx;
  665. border-radius: 12rpx;
  666. border: 1rpx solid #41ABF5;
  667. color: #41ABF5;
  668. }
  669. .right-only-right-add {
  670. width: 44rpx;
  671. height: 44rpx;
  672. line-height: 40rpx;
  673. background: linear-gradient(117deg, #57CAFF 0%, #41ABF5 100%);
  674. border-radius: 12rpx;
  675. }
  676. .right-only-right-2 {
  677. min-width: 50rpx;
  678. }
  679. }
  680. }
  681. }
  682. .gg-box {
  683. width: 750rpx;
  684. height: 1208rpx;
  685. background: #FFFFFF;
  686. border-radius: 24rpx 24rpx 0rpx 0rpx;
  687. .goods-info {
  688. border-bottom: 1rpx solid #EEEEEE;
  689. image {
  690. width: 170rpx;
  691. height: 160rpx;
  692. border-radius: 8rpx;
  693. margin-right: 22rpx;
  694. margin-bottom: 32rpx;
  695. }
  696. }
  697. .pop-buttom {
  698. width: 100%;
  699. // height: 250rpx;
  700. box-shadow: 0rpx 0rpx 20rpx 0rpx rgba(51, 51, 51, 0.1);
  701. .pop-buttom-left {
  702. padding-top: 12rpx;
  703. }
  704. .pop-buttom-2 {
  705. width: 100%;
  706. height: 96rpx;
  707. line-height: 96rpx;
  708. background: #41ABF5;
  709. border-radius: 200rpx
  710. }
  711. .right-only-right-red {
  712. width: 44rpx;
  713. height: 44rpx;
  714. line-height: 40rpx;
  715. border-radius: 12rpx;
  716. border: 1rpx solid #41ABF5;
  717. color: #41ABF5;
  718. }
  719. .right-only-right-add {
  720. width: 44rpx;
  721. height: 44rpx;
  722. line-height: 40rpx;
  723. background: linear-gradient(117deg, #57CAFF 0%, #41ABF5 100%);
  724. border-radius: 12rpx;
  725. }
  726. .right-only-right-2 {
  727. min-width: 50rpx;
  728. }
  729. }
  730. .spec-item {
  731. min-width: 210rpx;
  732. height: 66rpx;
  733. line-height: 66rpx;
  734. box-sizing: border-box;
  735. border-radius: 12rpx;
  736. margin: 0 26rpx 26rpx 0;
  737. padding: 0 10rpx;
  738. }
  739. .spec-item:nth-child(3) {
  740. margin-right: 0rpx !important;
  741. }
  742. .s-item {
  743. background-color: #ECF7FE;
  744. border: 2rpx solid #41ABF5;
  745. color: #41ABF5;
  746. }
  747. .n-item {
  748. border: 2rpx solid #EEEEEE;
  749. color: #000;
  750. }
  751. }
  752. }
  753. .goods-name {
  754. max-width: 310rpx;
  755. }
  756. </style>