index.vue 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768
  1. <template>
  2. <view>
  3. <view v-if="noticeStatus">
  4. <u-notice-bar :text="noticeText"></u-notice-bar>
  5. </view>
  6. <u-sticky>
  7. <view>
  8. <scroll-view class="scroll-view_H_MY" :scroll-x="true" @scroll="scroll">
  9. <view :class="index=== oneTypeActive ? 'scroll-view-item_H_MY-active':''"
  10. @click="oneTypeClick(item,index)" v-for="(item,index) in giftTypeList"
  11. class="scroll-view-item_H_MY">
  12. {{item.giftTypeName}}
  13. </view>
  14. </scroll-view>
  15. </view>
  16. </u-sticky>
  17. <view style="display: flex;flex-flow: row wrap;">
  18. <view style="width: 20%; text-align: center;background-color: #f0f0f0;">
  19. <scroll-view scroll-y scroll-with-animation :scrollTop="scrollLeftTop"
  20. :style="[{height: containerHeight + 'px'}]">
  21. <view :class="index === twoTypeActive ? 'giftTypeItem-active':''" @click="twoTypeClick(item,index)"
  22. v-for="(item,index) in giftTypeList[oneTypeActive].children" class="giftTypeItem">
  23. {{item.giftTypeName}}
  24. </view>
  25. </scroll-view>
  26. </view>
  27. <view style="width: 80%;background-color: #ffffff;text-align:center;">
  28. <scroll-view scroll-y scroll-with-animation :scrollTop="scrollLeftTop" :lower-threshold="110"
  29. @scrolltolower="refreshGift" :style="[{height: containerHeight + 'px'}]">
  30. <view class="foodBody">
  31. <view style="width: 48%;">
  32. <view v-if="index %2 === 0" class="goodsItem" v-for="(item, index) in list" :key="index">
  33. <img @click="toMorePage(item)" class="cuisineImg" width="100%" height="100%"
  34. :src=" baseURL+item.giftPictrue" mode="widthFix" radius="5"></img>
  35. <view @click="toMorePage(item)" class="goodsName">{{item.giftName}}</view>
  36. <view class="goodsPrice" @click="toMorePage(item)">
  37. <u-row>
  38. <u-col span="6">
  39. <u-icon name="integral" :label="item.giftPrice"
  40. labelColor="rgb(10, 185, 156)" color="rgb(10, 185, 156)"
  41. labelSize="12.5"></u-icon>
  42. </u-col>
  43. <u-col span="6" textAlign="right">
  44. <view
  45. :style="{'font-size': '12px','color': item.amount === 0 ? '#ffac29':'rgb(0, 0, 0)'}">
  46. {{'库存:'+item.amount}}
  47. </view>
  48. </u-col>
  49. </u-row>
  50. </view>
  51. <view class="gwxx">
  52. </view>
  53. <view class="gwxx">
  54. <view style="display: flex;flex-wrap: wrap-reverse;padding: 0 20rpx;">
  55. <view style="border: 1rpx solid rgb(10, 185, 156);
  56. color: rgb(10, 185, 156);font-size: 22rpx; padding: 5rpx 15rpx;
  57. border-radius: 10rpx;" @click="addGoods(item)">
  58. 加入购物车
  59. </view>
  60. </view>
  61. </view>
  62. </view>
  63. </view>
  64. <view style="width: 48%;">
  65. <view v-if="index %2 !== 0" class="goodsItem" v-for="(item, index) in list" :key="index">
  66. <img @click="toMorePage(item)" class="cuisineImg" width="100%" height="100%"
  67. :src=" baseURL+item.giftPictrue" mode="widthFix" radius="5"></img>
  68. <view @click="toMorePage(item)" class="goodsName">{{item.giftName}}</view>
  69. <view class="goodsPrice" @click="toMorePage(item)">
  70. <u-row>
  71. <u-col span="6">
  72. <u-icon name="integral" :label="item.giftPrice"
  73. labelColor="rgb(10, 185, 156)" color="rgb(10, 185, 156)"
  74. labelSize="12.5"></u-icon>
  75. </u-col>
  76. <u-col span="6" textAlign="right">
  77. <view
  78. :style="{'font-size': '12px','color': item.amount === 0 ? '#ffac29':'rgb(0, 0, 0)'}">
  79. {{'库存:'+item.amount}}
  80. </view>
  81. </u-col>
  82. </u-row>
  83. </view>
  84. <view class="gwxx">
  85. <view style="display: flex;flex-wrap: wrap-reverse;padding: 0 20rpx;">
  86. <view style="border: 1rpx solid rgb(10, 185, 156);
  87. color: rgb(10, 185, 156);font-size: 22rpx; padding: 5rpx 15rpx;
  88. border-radius: 10rpx;" @click="addGoods(item)">
  89. 加入购物车
  90. </view>
  91. </view>
  92. </view>
  93. </view>
  94. </view>
  95. </view>
  96. <u-loadmore :status="status" />
  97. </scroll-view>
  98. </view>
  99. </view>
  100. <view class="content">
  101. <!-- @touchstart="handleStart" @touchmove="handleMove" @touchend="handleEnd" -->
  102. <view :style="{'transform':'translate3d('+0+'px,'+-80+'px,0)'}" class="touch">
  103. <view @click="confirm1">
  104. <view :style="gwcNum === 0 ? 'background-color:#c5c5c5;':'background-color:#e93c45;'" style="position: absolute;top:-30rpx; right: 0;
  105. color: #ffffff;font-size: 30rpx;border-radius: 50%;width: 55rpx;height: 55rpx;">
  106. {{gwcNum}}
  107. </view>
  108. <u-icon name="shopping-cart" size="50" class="gwc" color="#ffffff">
  109. </u-icon>
  110. </view>
  111. </view>
  112. </view>
  113. <!-- <wp-tabbar pagePath="/pages/integral/index" :type="type"></wp-tabbar> -->
  114. </view>
  115. </template>
  116. <script>
  117. export default {
  118. data() {
  119. return {
  120. containerHeight: 0,
  121. stickyOffsetTop: 20,
  122. scrollLeftTop: 0,
  123. height: 0,
  124. option: {
  125. page: 1,
  126. size: 10,
  127. auto: true
  128. },
  129. noticeText: '',
  130. page: 1,
  131. oneTypeActive: 0,
  132. twoTypeActive: 0,
  133. list: [],
  134. giftTypeList: [],
  135. total: 0,
  136. from: {
  137. consumerType: uni.getStorageSync("userInfo").userType,
  138. jgid: uni.getStorageSync("orgInfo").organizationCode,
  139. organizationCode: uni.getStorageSync("orgInfo").organizationCode
  140. },
  141. gwcType: 0,
  142. scrollTop: 0,
  143. gwcNum: 0,
  144. xMove: 0,
  145. yMove: -80,
  146. baseURL: this.$BASE_URL,
  147. loading: false,
  148. oName: uni.getStorageSync("orgInfo").organizationName,
  149. maxNum: 0,
  150. timeStop: 0,
  151. goodsList: [],
  152. gwcGoodsList: [],
  153. menuData: {},
  154. status: 'loadmore',
  155. //兑换物品下拉列表锁 避免多次下拉导致出错
  156. loadingLock: 0,
  157. noticeStatus: false
  158. }
  159. },
  160. mounted() {
  161. uni.removeStorageSync('shopData')
  162. // this.load(this.option)
  163. this.getNoticeStatus()
  164. this.getSCN()
  165. this.giftType()
  166. this.getNotice()
  167. let that = this
  168. uni.getSystemInfo({
  169. success: res => {
  170. console.log(res)
  171. const height = that.height
  172. const windowHeight = res.windowHeight // 可使用窗口高度
  173. if (windowHeight) {
  174. // 限制containerHeight的值,避免传入的height值过大而出现滚动条
  175. // const remainHeight = windowHeight - that.stickyOffsetTop // 因设置了offsetTop后剩余的height值
  176. // if (height > remainHeight) {
  177. // this.containerHeight = remainHeight
  178. // } else {
  179. // this.containerHeight = height
  180. // }
  181. // } else {
  182. that.containerHeight = windowHeight
  183. }
  184. }
  185. })
  186. },
  187. onShow() {
  188. },
  189. onPullDownRefresh() {},
  190. onReachBottom() {},
  191. methods: {
  192. refreshGift() {
  193. if (this.total === this.list.length) {
  194. this.status = 'nomore'
  195. return
  196. }
  197. if (this.loadingLock === 0) {
  198. ++this.option.page
  199. this.taskList(this.option)
  200. }
  201. },
  202. oneTypeClick(type, index) {
  203. this.list = []
  204. this.oneTypeActive = index
  205. this.gwcType = index
  206. uni.removeStorageSync('shopData')
  207. this.gwcGoodsList = []
  208. if (this.gwcType === 0) {
  209. this.getSCN()
  210. } else if (this.gwcType === 1) {
  211. this.gwcNum = 0
  212. }
  213. this.twoTypeActive = 0
  214. this.option.page = 1
  215. this.option.size = 10
  216. if (type.giftTypeNo) {
  217. this.option.giftType = 2
  218. } else {
  219. this.option.giftType = 1
  220. }
  221. this.option.giftTypeCode = type.children[0].id
  222. this.taskList(this.option)
  223. },
  224. twoTypeClick(type, index) {
  225. this.list = []
  226. this.twoTypeActive = index
  227. this.option.page = 1
  228. this.option.size = 10
  229. if (type.giftTypeNo) {
  230. this.option.giftType = 2
  231. } else {
  232. this.option.giftType = 1
  233. }
  234. this.option.giftTypeCode = type.id
  235. this.taskList(this.option)
  236. },
  237. myIsNaN(value) {
  238. return typeof value === 'number' && !isNaN(value)
  239. },
  240. changeNum(value) {
  241. this.setGwcNum()
  242. },
  243. toMorePage(item) {
  244. uni.setStorageSync("giftContent", item.giftContent)
  245. uni.navigateTo({
  246. url: "../../pages/integral/more"
  247. })
  248. },
  249. async giftType() {
  250. // 发送请求
  251. const {
  252. data: res
  253. } = await this.$httpRequest({
  254. url: '/app/giftType',
  255. method: 'get',
  256. urlType: this.$getUrlType()
  257. });
  258. if (res.code === 200) {
  259. this.giftTypeList = res.data;
  260. this.option.page = 1
  261. this.option.size = 10
  262. this.option.giftType = 1
  263. this.option.giftTypeCode = res.data[0].children[0].id
  264. this.taskList(this.option)
  265. }
  266. },
  267. async getNoticeStatus() {
  268. // 发送请求
  269. const {
  270. data: res
  271. } = await this.$httpRequest({
  272. url: '/app/getNoticeStatus',
  273. method: 'get',
  274. urlType: this.$getUrlType()
  275. });
  276. if (res.code === 200) {
  277. this.noticeStatus = res.msg !== "false"
  278. if (this.noticeStatus) {
  279. this.containerHeight -= 75
  280. } else {
  281. this.containerHeight -= 40
  282. }
  283. }
  284. },
  285. async addGoods(data) {
  286. let form = {
  287. amount: data.amount,
  288. giftId: data.giftId,
  289. giftName: data.giftName,
  290. giftNumber: data.giftNumber,
  291. giftPictrue: data.giftPictrue,
  292. giftPrice: data.giftPrice,
  293. num: data.num,
  294. plusOrMinus: 0
  295. }
  296. if (this.gwcType === 0) {
  297. form.eventId = data.eventId
  298. form.eventName = data.eventName
  299. form.eventTime = data.eventTime
  300. // 发送请求
  301. const {
  302. data: res
  303. } = await this.$httpRequest({
  304. url: '/app/addShopCar',
  305. method: 'post',
  306. data: form,
  307. urlType: this.$getUrlType()
  308. });
  309. if (res.code === 200) {
  310. uni.showToast({
  311. duration: 1500,
  312. title: '添加成功'
  313. })
  314. this.getSCN()
  315. } else {
  316. this.$showModal(res.msg)
  317. }
  318. } else
  319. if (this.gwcType >= 1) {
  320. let count = 0
  321. let gift = form
  322. if (gift.num < gift.amount) {
  323. if (this.gwcGoodsList.length > 0) {
  324. for (let i = 0; i < this.gwcGoodsList.length; i++) {
  325. if (this.gwcGoodsList[i].giftId === data.giftId) {
  326. this.gwcGoodsList[i].num += 1
  327. count = 1
  328. break;
  329. }
  330. }
  331. }
  332. if (count === 0) {
  333. gift.num += 1
  334. this.gwcGoodsList.push(gift)
  335. }
  336. this.gwcNum = this.gwcGoodsList.length
  337. uni.setStorageSync('shopData', this.gwcGoodsList)
  338. uni.showToast({
  339. duration: 1500,
  340. title: '添加成功'
  341. })
  342. } else {
  343. this.$showModal("库存不足")
  344. }
  345. }
  346. },
  347. async getNotice() {
  348. // 发送请求
  349. const {
  350. data: res
  351. } = await this.$httpRequest({
  352. url: '/app/getNotice',
  353. method: 'get',
  354. urlType: this.$getUrlType()
  355. });
  356. if (res.code === 200) {
  357. this.noticeText = res.msg
  358. }
  359. },
  360. async getSCN() {
  361. // 发送请求
  362. const {
  363. data: res
  364. } = await this.$httpRequest({
  365. url: '/app/getSCN',
  366. method: 'get',
  367. urlType: this.$getUrlType()
  368. });
  369. if (res.code === 200) {
  370. this.gwcNum = res.data
  371. }
  372. },
  373. async taskList(paging) {
  374. this.loadingLock = 1
  375. this.status = 'loading'
  376. this.from.giftType = paging.giftType
  377. this.from.giftTypeCode = paging.giftTypeCode
  378. // 发送请求
  379. const {
  380. data: res
  381. } = await this.$httpRequest({
  382. url: '/app/getGift?pageNum=' + paging.page + '&pageSize=' + paging.size,
  383. method: 'post',
  384. data: this.from,
  385. isNotErrorMsg: true,
  386. urlType: this.$getUrlType()
  387. });
  388. if (res.code === 200) {
  389. if (paging.page === 1) {
  390. this.total = res.total
  391. this.list = res.rows
  392. this.list.forEach(item => {
  393. item.num = 0
  394. })
  395. } else if (paging.page > 1) {
  396. for (var i = 0; i < res.rows.length; i++) {
  397. res.rows[i].num = 0
  398. this.list.push(res.rows[i])
  399. }
  400. }
  401. this.loadingLock = 0
  402. if (this.total === this.list.length) {
  403. this.status = 'nomore'
  404. } else {
  405. this.status = 'loadmore'
  406. }
  407. }
  408. },
  409. setGwcNum() {
  410. console.log("setGwcNum")
  411. let count = 0
  412. const goodsListInfo = this.list;
  413. for (var i = 0; i < goodsListInfo.length; i++) {
  414. if (goodsListInfo[i].num) {
  415. let num = parseInt(goodsListInfo[i].num)
  416. let amount = parseInt(goodsListInfo[i].amount)
  417. if (amount < num) {
  418. goodsListInfo[i].num = amount
  419. num = amount
  420. }
  421. count += num
  422. }
  423. }
  424. this.gwcNum = count
  425. },
  426. toShopListPage() {
  427. if (0 === this.gwcNum) {
  428. this.showToast({
  429. duration: 1500,
  430. message: "请选择商品"
  431. });
  432. return;
  433. }
  434. this.show1 = true;
  435. },
  436. addToCart(type, gift) {
  437. if (type === 0 && gift.num === 0) {
  438. return
  439. }
  440. if (gift.amount === 0) {
  441. this.showToast({
  442. duration: 500,
  443. message: "库存不足"
  444. });
  445. return
  446. }
  447. if (type === 1) {
  448. if (gift.num) {
  449. if (gift.amount <= gift.num) {
  450. this.showToast({
  451. duration: 500,
  452. message: "库存已达最大数量"
  453. });
  454. return
  455. }
  456. gift.num += 1
  457. } else {
  458. gift.num = 1
  459. }
  460. } else {
  461. gift.num -= 1
  462. }
  463. let that = this
  464. setTimeout(() => {
  465. that.setGwcNum()
  466. }, 100)
  467. },
  468. scroll: function(e) {
  469. this.old.scrollTop = e.detail.scrollTop
  470. },
  471. confirm1(e) {
  472. if (this.gwcType === 0) {
  473. uni.setStorageSync('orderType', 1)
  474. uni.navigateTo({
  475. url: '../../pageA/integral/shopcar'
  476. })
  477. } else
  478. if (this.gwcType === 1) {
  479. uni.setStorageSync('orderType', 2)
  480. uni.navigateTo({
  481. url: '../../pageA/integral/shopcarTemporary'
  482. })
  483. }
  484. },
  485. showToast(params) {
  486. this.$refs.uToast.show({
  487. ...params,
  488. complete() {}
  489. })
  490. },
  491. handleStart(ev) {
  492. // console.log('start',ev);
  493. // 记录一开始手指按下的坐标
  494. var touch = ev.changedTouches[0];
  495. startPoint.x = touch.pageX;
  496. startPoint.y = touch.pageY;
  497. },
  498. handleMove(ev) {
  499. // console.log('move',ev);
  500. // 防止页面高度很大,出现滚动条,不能移动-默认拖动滚动条事件
  501. ev.preventDefault();
  502. isTouchMove = true;
  503. var touch = ev.changedTouches[0];
  504. var diffPonit = {}; // 存放差值
  505. var movePonit = {
  506. // 记录移动的距离
  507. x: 0,
  508. y: 0
  509. };
  510. diffPonit.x = touch.pageX - startPoint.x;
  511. diffPonit.y = touch.pageY - startPoint.y;
  512. // 移动的距离 = 差值 + 当前坐标点
  513. movePonit.x = diffPonit.x + curPoint.x;
  514. movePonit.y = diffPonit.y + curPoint.y;
  515. this.move(movePonit.x, movePonit.y);
  516. },
  517. handleEnd(ev) {
  518. // console.log('end', ev);
  519. if (!isTouchMove) return;
  520. // 更新坐标原点
  521. var touch = ev.changedTouches[0];
  522. curPoint.x += touch.pageX - startPoint.x;
  523. curPoint.y += touch.pageY - startPoint.y;
  524. // 重置
  525. isTouchMove = false;
  526. },
  527. move(x, y) {
  528. x = x || 0; // 没有传就是0
  529. y = y || 0;
  530. this.xMove = x;
  531. this.yMove = y;
  532. // translate3d (tx,ty,tz) 在X轴偏移tx,在Y轴偏移ty,在Z轴偏移tz,单位px
  533. },
  534. // 刷新刷剧
  535. refresh() {
  536. this.option.page = 1
  537. this.option.size = 10
  538. this.option.giftType = 1
  539. this.taskList(this.option)
  540. },
  541. scrolltolower(e) {},
  542. load(paging) {
  543. this.taskList(paging)
  544. },
  545. loadSuccess(list) {
  546. this.list = list
  547. }
  548. }
  549. }
  550. </script>
  551. <style lang="scss" scoped>
  552. .foodBody {
  553. padding-top: 10rpx;
  554. padding-left: 10rpx;
  555. display: flex;
  556. flex-flow: row wrap;
  557. justify-content: center;
  558. border-radius: 30rpx;
  559. }
  560. .gwxx {
  561. padding-top: 10rpx;
  562. }
  563. .scroll-view_H_MY {
  564. white-space: nowrap;
  565. width: 100%;
  566. letter-spacing: 10rpx;
  567. // padding: 20rpx;
  568. background-color: rgb(255, 255, 255);
  569. // background: linear-gradient(to bottom right, rgb(47, 203, 198), rgb(127, 241, 209));
  570. }
  571. .scroll-view-item_H_MY {
  572. color: #8c8c8c;
  573. height: 35px;
  574. width: 33.4%;
  575. font-size: 30rpx;
  576. display: inline-flex; // item的外层定义成行内元素才可进行滚动 inline-block / inline-flex 均可
  577. flex-direction: column;
  578. align-items: center;
  579. border-right: 1rpx #f3f3f3 solid;
  580. }
  581. .scroll-view-item_H_MY-active {
  582. // background-color: rgb(153, 241, 224);
  583. border-bottom: 5rpx rgb(96, 182, 158) solid;
  584. }
  585. .giftTypeItem {
  586. color: #8c8c8c;
  587. padding: 20rpx 10rpx;
  588. font-size: 25rpx;
  589. letter-spacing: 5rpx;
  590. background-color: #f0f0f0;
  591. border-bottom: 1rpx #f3f3f3 solid;
  592. }
  593. .giftTypeItem-active {
  594. background-color: #ffffff;
  595. }
  596. .isNumNull {
  597. color: #FF0000;
  598. }
  599. .content {
  600. display: flex;
  601. flex-direction: column;
  602. align-items: center;
  603. justify-content: center;
  604. }
  605. .addGwc:active {
  606. color: #ffffff;
  607. }
  608. .touch {
  609. position: fixed;
  610. right: 40rpx;
  611. bottom: 60rpx;
  612. width: 95rpx;
  613. height: 95rpx;
  614. /* 知识点
  615. line-height是行高,针对的对象是文字,height针对的是容器,
  616. 也就是高度,当height和line-height值相同时会居中,
  617. 当line-height值小于height时文字向上移动,反之向下移动。
  618. */
  619. line-height: 95rpx;
  620. /* 文字垂直居中 */
  621. text-align: center;
  622. /* 水平居中 */
  623. background-color: rgba(0, 0, 0, 0.6);
  624. border-radius: 50%;
  625. color: #fff;
  626. font-size: 60rpx;
  627. /* 去除标签点击事件高亮效果 */
  628. -webkit-tap-highlight-color: transparent;
  629. /* 使用transform: translate3d 处理性能高 GUP */
  630. }
  631. #button_div {
  632. position: fixed;
  633. bottom: var(--window-bottom);
  634. }
  635. .mybackColor {
  636. background-color: #8c8c8c;
  637. }
  638. .shopHand {
  639. font-weight: bold;
  640. font-size: 20px;
  641. height: 20%;
  642. padding: 10% 0 10px 10px;
  643. margin-bottom: 5px;
  644. //background: linear-gradient(to bottom right, #85c1bf, #f1fef9);
  645. //background: rgb(55,186,189);
  646. background: #9ED6CF;
  647. }
  648. .cuisineImg {
  649. border-radius: 10px;
  650. max-height: 600rpx;
  651. height: auto;
  652. width: auto;
  653. padding: 0rpx 5rpx 2rpx;
  654. }
  655. .doFoodConfigView {
  656. width: 93%;
  657. margin: 0 auto;
  658. margin-top: 5px;
  659. padding: 2% 5px;
  660. background-color: #ffffff;
  661. border-radius: 10px;
  662. border: 1px solid #d3d3d3;
  663. }
  664. .gwcNum {
  665. width: 15px;
  666. top: 17px;
  667. left: 21px;
  668. position: relative;
  669. }
  670. /* 商品列表 */
  671. .goodsContent {
  672. width: 100%;
  673. margin: 0 auto;
  674. flex-direction: column;
  675. background: #f3f3f3;
  676. display: flex;
  677. justify-content: center;
  678. }
  679. .goodsItem {
  680. width: 280rpx;
  681. background: #FFFFFF;
  682. // border-radius: 10px;
  683. padding: 10rpx 0;
  684. // margin: 5rpx;
  685. // border: 1px solid #ebebeb;
  686. }
  687. .goodsName {
  688. font-size: 24rpx;
  689. color: #2e2e2e;
  690. padding: 10rpx 20rpx;
  691. overflow: hidden;
  692. text-overflow: ellipsis;
  693. display: -webkit-box;
  694. -webkit-line-clamp: 2;
  695. -webkit-box-orient: vertical;
  696. }
  697. .goodsPrice {
  698. color: #ffac29;
  699. font-size: 24rpx;
  700. padding: 0 15rpx;
  701. }
  702. .addFood {
  703. margin-left: 20rpx;
  704. color: #8c8c8c;
  705. }
  706. .minus {
  707. width: 26px;
  708. height: 26px;
  709. background-color: #efefef;
  710. border-width: 1px;
  711. border-color: #c6c6c6;
  712. border-top-left-radius: 100px;
  713. border-top-right-radius: 100px;
  714. border-bottom-left-radius: 100px;
  715. border-bottom-right-radius: 100px;
  716. @include flex;
  717. justify-content: center;
  718. align-items: center;
  719. }
  720. .input {
  721. padding: 0;
  722. }
  723. .plus {
  724. width: 20px;
  725. height: 20px;
  726. background-color: #FF0000;
  727. border-radius: 50%;
  728. /* #ifndef APP-NVUE */
  729. display: flex;
  730. /* #endif */
  731. justify-content: center;
  732. align-items: center;
  733. }
  734. </style>