dishDetail.vue 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050
  1. <template>
  2. <view class="container">
  3. <view class="carousel">
  4. <swiper indicator-active-color="#2AAC34" indicator-dots circular=true duration="400">
  5. <swiper-item class="swiper-item">
  6. <view class="image-wrapper">
  7. <image v-if="dish.img && dish.img.length > 0" :src="JSON.parse(dish.img)[0].url" class="loaded" mode="aspectFit"></image>
  8. </view>
  9. </swiper-item>
  10. </swiper>
  11. </view>
  12. <view class="introduce-section">
  13. <view class="text-2-cut " style="font-size: 36rpx;font-weight: bold; line-height: 50rpx;color: #333333;width: 686rpx;"
  14. >{{dish.title}}</view>
  15. <view class="flex align-start justify-between padding-top-sm">
  16. <view class="text-cut" style="width: 580rpx;font-size: 28rpx;line-height: 40rpx;color: #8D8E99;">
  17. {{ dish.score }}综合评分
  18. </view>
  19. <view class="text-cut" style="width: 580rpx;font-size: 28rpx;line-height: 40rpx;color: #8D8E99;">
  20. {{dish.sales}}人做过
  21. </view>
  22. </view>
  23. <view class="flex align-start justify-between padding-top-sm">
  24. <view class="text-cut" style="width: 580rpx;font-size: 28rpx;line-height: 40rpx;color: #8D8E99;">
  25. {{dish.detail}}
  26. </view>
  27. </view>
  28. </view>
  29. <view class="c-list" style="padding: 0 34rpx 0 30rpx;">
  30. <view class="c-row b-b" style="align-items: flex-start;">
  31. </view>
  32. </view>
  33. <view class="detail-desc padding-lr">
  34. <!-- <view class="d-header">
  35. <text>图文详情</text>
  36. </view> -->
  37. <view class="text-black padding-tb-lg " style="line-height: 50rpx;font-size: 36rpx;font-weight: bold;">
  38. 用料
  39. <view @click="addCartAll()" style="font-size: 28rpx;line-height: 40rpx;width: 200rpx;height: 64rpx;float: right;border-radius: 25px;"
  40. class="flex align-center justify-center bg-green ">
  41. 丢进菜篮子
  42. </view>
  43. </view>
  44. <view v-for="(item,index) in dish.dishSpuDOS" :key="index"
  45. class="margin-lr padding-tb-sm padding-lr-xs flex"
  46. style="border-bottom: solid #E6E6E6 1rpx;">
  47. <view style="padding-top: 4rpx;padding-bottom: 2rpx;flex-grow: 1;">
  48. <view class="flex justify-between" style="width: 100%;padding-top: 12rpx;">
  49. <view style="flex-grow: 1;" class="flex align-center">
  50. <view class="text-black padding-right-sm"
  51. style="font-size: 30rpx;line-height: 42rpx;width: 120px"
  52. >{{item.productAttrName}}</view>
  53. <view class="text-black padding-left-sm"
  54. style="font-size: 30rpx;line-height: 42rpx;"
  55. >{{item.unit}}</view>
  56. </view>
  57. <uni-number-box
  58. class="number-box"
  59. :min="0"
  60. :value="item.num"
  61. :isMin="item.num==0"
  62. :index="index"
  63. @eventChange="numberChange"
  64. v-if="item.num!=0"
  65. ></uni-number-box>
  66. <image @click.stop="addCart(item,index)" src="/static/add.png" mode="aspectFit"
  67. style="width: 44rpx;height: 44rpx;" v-if="item.num==0"></image>
  68. </view>
  69. </view>
  70. </view>
  71. </view>
  72. <view class="detail-desc padding-lr">
  73. <!-- <view class="d-header">
  74. <text>图文详情</text>
  75. </view> -->
  76. <view class="text-black padding-tb-lg " style="line-height: 50rpx;font-size: 36rpx;font-weight: bold;">
  77. 步骤详情
  78. </view>
  79. <!-- <u-parse className="rich-img" :content="goods.detail"></u-parse> -->
  80. <rich-text style="font-size: 28rpx;" :nodes="dish.description"></rich-text>
  81. </view>
  82. <view class="bg-white flex align-end"
  83. style="position: fixed;bottom: 0;width: 750rpx;height: 98rpx;padding-left: 38rpx;">
  84. <view @click="navToCart" class="flex align-end" style="width: 346rpx;height: 98rpx;padding-bottom: 16rpx;">
  85. <view style="position: relative;">
  86. <image src="../../static/tab-icon/tab3_2.png" mode="aspectFit"
  87. style="width: 56rpx;height: 52rpx;" ></image>
  88. <view v-if="cartNum" class="badge round"
  89. >{{cartNum}}</view>
  90. </view>
  91. <view style="font-size: 28rpx;line-height: 40rpx;color: #8D8E99;padding-left: 40rpx;">
  92. 已选{{cartNum}}件
  93. </view>
  94. </view>
  95. <view @click="navToCart" style="font-size: 28rpx;line-height: 40rpx;width: 404rpx;height: 98rpx;"
  96. class="flex align-center justify-center bg-green ">
  97. 去购物车
  98. </view>
  99. </view>
  100. </view>
  101. </template>
  102. <script>
  103. import uParse from '@/components/u-parse/u-parse.vue';
  104. import uniNumberBox from '@/components/uni-number-box.vue'
  105. import {mapState} from 'vuex'
  106. export default {
  107. components: {
  108. uParse,
  109. uniNumberBox
  110. },
  111. data() {
  112. return {
  113. dish: {
  114. freightTemplate: 0,
  115. skuList: [],
  116. categoryList: [],
  117. img: '',
  118. appraisePage: undefined
  119. },
  120. isVip: false,
  121. specClass: 'none',
  122. specSelected: [],
  123. selectedSku: {},
  124. selectedSkuIndex: -1,
  125. toggleCallback: undefined,
  126. maskState: 0, //优惠券面板显示状态
  127. couponList: [],
  128. submiting: false,
  129. cartNum:0,
  130. shareShow:0,
  131. zhekou:-1
  132. };
  133. },
  134. onShow() {
  135. this.isVip = this.$api.isVip()
  136. },
  137. computed:{
  138. ...mapState(['storageId'])
  139. },
  140. onLoad(options) {
  141. console.log(options)
  142. const that = this
  143. uni.showLoading({
  144. title: '正在加载'
  145. })
  146. that.$api.request('get', 'dish/composition/app/'+options.id, {
  147. }, failres => {
  148. that.$api.msg(failres.errmsg)
  149. uni.hideLoading()
  150. }).then(res => {
  151. that.dish = res.data
  152. this.loadCartData()
  153. uni.hideLoading()
  154. })
  155. this.countCart()
  156. },
  157. methods: {
  158. //统计购物车数量
  159. countCart(){
  160. this.$api.request('get', 'cart/app/countCart', {
  161. storageId:this.$store.state.storageId
  162. }).then(res=>{
  163. this.cartNum = res.data
  164. }).catch(err=>{
  165. this.$api.msg('请求失败,请稍后再试')
  166. })
  167. },
  168. //删除
  169. deleteCartItem(index){
  170. const that = this
  171. that.$api.request('cart', 'removeCartItem', {
  172. cartId: that.dish.dishSpuDOS[index].cartId
  173. }).then(res => {
  174. // that.tlist.splice(index, 1);
  175. // that.calcTotal();
  176. that.dish.dishSpuDOS[index].num = 0
  177. that.countCart()
  178. this.countTabNum()
  179. //uni.hideLoading();
  180. })
  181. },
  182. numberChange(data){
  183. const that = this
  184. const index = data.index;
  185. const item = that.dish.dishSpuDOS[data.index];
  186. // 如果正在更新,直接返回
  187. if (item.isUpdating) return;
  188. // 标记为更新中
  189. item.isUpdating = true;
  190. if (data.number == 0) {
  191. this.deleteCartItem(data.index)
  192. item.isUpdating = false; // 删除操作后重置状态
  193. return
  194. }
  195. that.$api.request('get', 'cart/app/updateCartItemNum', {
  196. cartId: that.dish.dishSpuDOS[data.index].cartId,
  197. num: data.number
  198. }).then(res => {
  199. this.dish.dishSpuDOS[data.index].num=data.number
  200. this.cartNumFn()
  201. this.countTabNum()
  202. }).catch(err => {
  203. console.error("更新购物车失败:", err);
  204. }).finally(() => {
  205. item.isUpdating = false; // 无论成功失败,重置状态
  206. });
  207. },
  208. cartNumFn() {
  209. let cartNum = 0
  210. this.dish.dishSpuDOS.forEach((item, i) => {
  211. cartNum += item.num
  212. })
  213. this.cartNum = cartNum
  214. },
  215. countTabNum() {
  216. this.$api.request('get', 'cart/app/countCart', {
  217. storageId: this.$store.state.storageId
  218. }).then(res => {
  219. if (res.data > 0) {
  220. uni.setTabBarBadge({
  221. index: 2,
  222. text: res.data + ''
  223. })
  224. } else if (res.data <= 0) {
  225. uni.removeTabBarBadge({
  226. index: 2
  227. })
  228. }
  229. this.$store.commit('addCart', res.data)
  230. }).catch(err => {
  231. // this.$api.msg('请求失败,请稍后再试')
  232. })
  233. },
  234. navToCart(id){
  235. // console.log()
  236. uni.switchTab({
  237. url:`../cart/cart`
  238. })
  239. },
  240. loadCartData(){
  241. const that = this
  242. that.$api.request('get', 'cart/app/getCartList',{
  243. storageId:this.$store.state.storageId
  244. }).then(res => {
  245. //遍历查询当前展示的商品中是否有数量
  246. var cartIds = []
  247. var goodsIds = []
  248. for (var i = 0; i < res.data.length; i++) {
  249. cartIds.push(res.data[i].productId)
  250. for (var j = 0; j < that.dish.dishSpuDOS.length; j++) {
  251. if(that.dish.dishSpuDOS[j].productId == res.data[i].productId){
  252. that.dish.dishSpuDOS[j].num = res.data[i].cartNum
  253. that.dish.dishSpuDOS[j].cartId = res.data[i].id
  254. }
  255. }
  256. }
  257. //触发视图更新
  258. console.log(that.dish.dishSpuDOS)
  259. console.log("触发视图更新")
  260. })
  261. },
  262. //加入购物车
  263. addCart(item,e) {
  264. //不再按规格
  265. const that = this
  266. that.$api.request('get', 'cart/app/addCartItem', {
  267. productId: item.productId,
  268. num: 1
  269. }).then(res => {
  270. that.$api.msg('添加购物车成功')
  271. item.num ++
  272. this.countCart()
  273. item.cartId = res.data.id
  274. var cartNum = this.$store.state.cartNum+1
  275. that.$store.commit('addCart',cartNum)
  276. uni.setTabBarBadge({
  277. index:2,
  278. text:cartNum+''
  279. })
  280. })
  281. },
  282. addCartAll(){
  283. //增加一次的销量
  284. const that = this
  285. this.$api.request('post', 'dish/composition/app/addSale/'+that.dish.id, {
  286. id: that.dish.id
  287. }).then(res => {
  288. })
  289. this.dish.dishSpuDOS.forEach((item,i)=>{
  290. this.addCart(item,i)
  291. })
  292. }
  293. },
  294. }
  295. </script>
  296. <style lang='scss'>
  297. page {
  298. background: $page-color-base;
  299. padding-bottom: 160upx;
  300. }
  301. .badge{
  302. background-color: #FF473C;
  303. width: 32rpx;
  304. height: 32rpx;
  305. color: #fff;
  306. font-size: 22rpx;line-height: 32rpx;text-align: center;
  307. position: absolute;
  308. left: 42rpx;
  309. bottom: 32rpx;
  310. }
  311. .bg-gradual-orange {
  312. background-image: linear-gradient(180deg, #FE9F43, #FC6620);
  313. color: #fff;
  314. }
  315. .icon-you {
  316. font-size: $font-base + 2upx;
  317. color: #888;
  318. }
  319. .carousel {
  320. height: 414rpx;
  321. position: relative;
  322. swiper {
  323. height: 100%;
  324. }
  325. .image-wrapper {
  326. width: 100%;
  327. height: 100%;
  328. }
  329. .swiper-item {
  330. display: flex;
  331. justify-content: center;
  332. align-content: center;
  333. height: 750upx;
  334. overflow: hidden;
  335. image {
  336. width: 100%;
  337. height: 100%;
  338. }
  339. }
  340. }
  341. /* 标题简介 */
  342. .introduce-section {
  343. background: #fff;
  344. padding: 32rpx 34rpx 0 30rpx;
  345. .title {
  346. font-size: 32upx;
  347. color: $font-color-dark;
  348. height: 50upx;
  349. line-height: 50upx;
  350. }
  351. .price-box {
  352. display: flex;
  353. align-items: baseline;
  354. height: 64upx;
  355. padding: 10upx 0;
  356. font-size: 26upx;
  357. color: $uni-color-primary;
  358. }
  359. .price {
  360. font-size: $font-lg + 2upx;
  361. }
  362. .m-price {
  363. margin: 0 12upx;
  364. color: $font-color-light;
  365. text-decoration: line-through;
  366. }
  367. .coupon-tip {
  368. align-items: center;
  369. padding: 4upx 10upx;
  370. background: $uni-color-primary;
  371. font-size: $font-sm;
  372. color: #fff;
  373. border-radius: 6upx;
  374. line-height: 1;
  375. transform: translateY(-4upx);
  376. }
  377. .bot-row {
  378. display: flex;
  379. align-items: center;
  380. height: 50upx;
  381. font-size: $font-sm;
  382. color: $font-color-light;
  383. text {
  384. flex: 1;
  385. }
  386. }
  387. }
  388. /* 分享 */
  389. .share-section {
  390. display: flex;
  391. align-items: center;
  392. color: $font-color-base;
  393. background: linear-gradient(left, #fdf5f6, #fbebf6);
  394. padding: 12upx 30upx;
  395. .share-icon {
  396. display: flex;
  397. align-items: center;
  398. width: 70upx;
  399. height: 30upx;
  400. line-height: 1;
  401. border: 1px solid $uni-color-primary;
  402. border-radius: 4upx;
  403. position: relative;
  404. overflow: hidden;
  405. font-size: 22upx;
  406. color: $uni-color-primary;
  407. &:after {
  408. content: '';
  409. width: 50upx;
  410. height: 50upx;
  411. border-radius: 50%;
  412. left: -20upx;
  413. top: -12upx;
  414. position: absolute;
  415. background: $uni-color-primary;
  416. }
  417. }
  418. .icon-xingxing {
  419. position: relative;
  420. z-index: 1;
  421. font-size: 24upx;
  422. margin-left: 2upx;
  423. margin-right: 10upx;
  424. color: #fff;
  425. line-height: 1;
  426. }
  427. .tit {
  428. font-size: 28rpx;
  429. line-height: 40rpx;
  430. /* margin-left: 10upx; */
  431. color: #8D8E99;
  432. font-weight: bold;
  433. }
  434. .icon-bangzhu1 {
  435. padding: 10upx;
  436. font-size: 30upx;
  437. line-height: 1;
  438. }
  439. .share-btn {
  440. flex: 1;
  441. text-align: right;
  442. font-size: $font-sm;
  443. color: $uni-color-primary;
  444. }
  445. .icon-you {
  446. font-size: $font-sm;
  447. margin-left: 4upx;
  448. color: $uni-color-primary;
  449. }
  450. }
  451. .c-list {
  452. font-size: $font-sm + 2upx;
  453. color: $font-color-base;
  454. background: #fff;
  455. .c-row {
  456. display: flex;
  457. align-items: center;
  458. padding: 28upx 6rpx 34rpx 8rpx;
  459. position: relative;
  460. }
  461. .tit {
  462. width: 140upx;
  463. font-size: 28rpx;
  464. line-height: 40rpx;
  465. /* margin-left: 10upx; */
  466. color: #8D8E99;
  467. font-weight: 550;
  468. }
  469. .con {
  470. flex: 1;
  471. color: $font-color-dark;
  472. .selected-text {
  473. margin-right: 10upx;
  474. }
  475. }
  476. .bz-list {
  477. height: 40upx;
  478. font-size: $font-sm+2upx;
  479. color: $font-color-dark;
  480. text {
  481. display: inline-block;
  482. margin-right: 30upx;
  483. }
  484. }
  485. .con-list {
  486. flex: 1;
  487. display: flex;
  488. flex-direction: column;
  489. color: $font-color-dark;
  490. line-height: 40upx;
  491. }
  492. .red {
  493. color: $uni-color-primary;
  494. }
  495. }
  496. /* 评价 */
  497. .eva-section {
  498. display: flex;
  499. flex-direction: column;
  500. padding: 20upx 30upx;
  501. background: #fff;
  502. margin-top: 16upx;
  503. .e-header {
  504. display: flex;
  505. align-items: center;
  506. height: 70upx;
  507. font-size: $font-sm + 2upx;
  508. color: $font-color-light;
  509. .tit {
  510. font-size: $font-base + 2upx;
  511. color: $font-color-dark;
  512. margin-right: 4upx;
  513. }
  514. .tip {
  515. flex: 1;
  516. text-align: right;
  517. }
  518. .icon-you {
  519. margin-left: 10upx;
  520. }
  521. }
  522. }
  523. .eva-box {
  524. display: flex;
  525. padding: 20upx 0;
  526. .portrait {
  527. flex-shrink: 0;
  528. width: 80upx;
  529. height: 80upx;
  530. border-radius: 100px;
  531. }
  532. .right {
  533. flex: 1;
  534. display: flex;
  535. flex-direction: column;
  536. font-size: $font-base;
  537. color: $font-color-base;
  538. padding-left: 26upx;
  539. .con {
  540. font-size: $font-base;
  541. color: $font-color-dark;
  542. padding: 20upx 0;
  543. }
  544. .bot {
  545. display: flex;
  546. justify-content: space-between;
  547. font-size: $font-sm;
  548. color: $font-color-light;
  549. }
  550. }
  551. }
  552. /* 详情 */
  553. .detail-desc {
  554. background: #fff;
  555. margin-top: 16upx;
  556. width: 750upx;
  557. .d-header {
  558. display: flex;
  559. justify-content: center;
  560. align-items: center;
  561. height: 80upx;
  562. font-size: $font-base + 2upx;
  563. color: $font-color-dark;
  564. position: relative;
  565. text {
  566. padding: 0 20upx;
  567. background: #fff;
  568. position: relative;
  569. z-index: 1;
  570. }
  571. &:after {
  572. position: absolute;
  573. left: 50%;
  574. top: 50%;
  575. transform: translateX(-50%);
  576. width: 300upx;
  577. height: 0;
  578. content: '';
  579. border-bottom: 1px solid #ccc;
  580. }
  581. }
  582. }
  583. /* 规格选择弹窗 */
  584. .attr-content {
  585. padding: 10upx 30upx;
  586. .a-t {
  587. display: flex;
  588. image {
  589. width: 170upx;
  590. height: 170upx;
  591. flex-shrink: 0;
  592. margin-top: -40upx;
  593. border-radius: 8upx;
  594. ;
  595. }
  596. .right {
  597. display: flex;
  598. flex-direction: column;
  599. padding-left: 24upx;
  600. font-size: $font-sm + 2upx;
  601. color: $font-color-base;
  602. line-height: 42upx;
  603. .price {
  604. font-size: $font-lg;
  605. color: $uni-color-primary;
  606. margin-bottom: 10upx;
  607. }
  608. .selected-text {
  609. margin-right: 10upx;
  610. }
  611. }
  612. }
  613. .attr-list {
  614. display: flex;
  615. flex-direction: column;
  616. font-size: $font-base + 2upx;
  617. color: $font-color-base;
  618. padding-top: 30upx;
  619. padding-left: 10upx;
  620. }
  621. .item-list {
  622. padding: 20upx 0 0;
  623. display: flex;
  624. flex-wrap: wrap;
  625. text {
  626. display: flex;
  627. align-items: center;
  628. justify-content: center;
  629. background: #eee;
  630. margin-right: 20upx;
  631. margin-bottom: 20upx;
  632. border-radius: 100upx;
  633. min-width: 60upx;
  634. height: 60upx;
  635. padding: 0 20upx;
  636. font-size: $font-base;
  637. color: $font-color-dark;
  638. }
  639. .selected {
  640. background: #fbebee;
  641. color: $uni-color-primary;
  642. }
  643. }
  644. }
  645. /* 弹出层 */
  646. .popup {
  647. position: fixed;
  648. left: 0;
  649. top: 0;
  650. right: 0;
  651. bottom: 0;
  652. z-index: 99;
  653. &.show {
  654. display: block;
  655. .mask {
  656. animation: showPopup 0.2s linear both;
  657. }
  658. .layer {
  659. animation: showLayer 0.2s linear both;
  660. }
  661. }
  662. &.hide {
  663. .mask {
  664. animation: hidePopup 0.2s linear both;
  665. }
  666. .layer {
  667. animation: hideLayer 0.2s linear both;
  668. }
  669. }
  670. &.none {
  671. display: none;
  672. }
  673. .mask {
  674. position: fixed;
  675. top: 0;
  676. width: 100%;
  677. height: 60%;
  678. z-index: 1;
  679. background-color: rgba(0, 0, 0, 0.4);
  680. }
  681. .layer {
  682. position: fixed;
  683. z-index: 99;
  684. bottom: 0;
  685. width: 100%;
  686. min-height: 40vh;
  687. border-radius: 10upx 10upx 0 0;
  688. background-color: #fff;
  689. .btn {
  690. height: 66upx;
  691. line-height: 66upx;
  692. border-radius: 100upx;
  693. background: $uni-color-primary;
  694. font-size: $font-base + 2upx;
  695. color: #fff;
  696. margin: 30upx auto 20upx;
  697. }
  698. }
  699. @keyframes showPopup {
  700. 0% {
  701. opacity: 0;
  702. }
  703. 100% {
  704. opacity: 1;
  705. }
  706. }
  707. @keyframes hidePopup {
  708. 0% {
  709. opacity: 1;
  710. }
  711. 100% {
  712. opacity: 0;
  713. }
  714. }
  715. @keyframes showLayer {
  716. 0% {
  717. transform: translateY(120%);
  718. }
  719. 100% {
  720. transform: translateY(0%);
  721. }
  722. }
  723. @keyframes hideLayer {
  724. 0% {
  725. transform: translateY(0);
  726. }
  727. 100% {
  728. transform: translateY(120%);
  729. }
  730. }
  731. }
  732. /* 底部操作菜单 */
  733. .page-bottom {
  734. position: fixed;
  735. left: 30upx;
  736. bottom: 30upx;
  737. z-index: 95;
  738. display: flex;
  739. justify-content: center;
  740. align-items: center;
  741. width: 690upx;
  742. height: 100upx;
  743. background: rgba(255, 255, 255, .9);
  744. box-shadow: 0 0 20upx 0 rgba(0, 0, 0, .5);
  745. border-radius: 16upx;
  746. .p-b-btn {
  747. display: flex;
  748. flex-direction: column;
  749. align-items: center;
  750. justify-content: center;
  751. font-size: $font-sm;
  752. color: $font-color-base;
  753. width: 96upx;
  754. height: 80upx;
  755. .yticon {
  756. font-size: 40upx;
  757. line-height: 48upx;
  758. color: $font-color-light;
  759. }
  760. &.active,
  761. &.active .yticon {
  762. color: $uni-color-primary;
  763. }
  764. .icon-fenxiang2 {
  765. font-size: 42upx;
  766. transform: translateY(-2upx);
  767. }
  768. .icon-shoucang {
  769. font-size: 46upx;
  770. }
  771. }
  772. .action-btn-group {
  773. display: flex;
  774. height: 76upx;
  775. border-radius: 100px;
  776. overflow: hidden;
  777. box-shadow: 0 20upx 40upx -16upx #fa436a;
  778. box-shadow: 1px 2px 5px rgba(219, 63, 96, 0.4);
  779. background: linear-gradient(to right, #ffac30, #fa436a, #F56C6C);
  780. margin-left: 20upx;
  781. position: relative;
  782. &:after {
  783. content: '';
  784. position: absolute;
  785. top: 50%;
  786. right: 50%;
  787. transform: translateY(-50%);
  788. height: 28upx;
  789. width: 0;
  790. border-right: 1px solid rgba(255, 255, 255, .5);
  791. }
  792. .action-btn {
  793. display: flex;
  794. align-items: center;
  795. justify-content: center;
  796. width: 180upx;
  797. height: 100%;
  798. font-size: $font-base;
  799. padding: 0;
  800. border-radius: 0;
  801. background: transparent;
  802. }
  803. }
  804. }
  805. /* 优惠券面板 */
  806. .mask {
  807. display: flex;
  808. align-items: flex-end;
  809. position: fixed;
  810. left: 0;
  811. top: var(--window-top);
  812. bottom: 0;
  813. width: 100%;
  814. background: rgba(0, 0, 0, 0);
  815. z-index: 9995;
  816. transition: .3s;
  817. .mask-content {
  818. width: 100%;
  819. min-height: 30vh;
  820. max-height: 70vh;
  821. background: #f3f3f3;
  822. transform: translateY(100%);
  823. transition: .3s;
  824. overflow-y: scroll;
  825. }
  826. &.none {
  827. display: none;
  828. }
  829. &.show {
  830. background: rgba(0, 0, 0, .4);
  831. .mask-content {
  832. transform: translateY(0);
  833. }
  834. }
  835. }
  836. /* 优惠券列表 */
  837. .coupon-item {
  838. display: flex;
  839. flex-direction: column;
  840. margin: 20upx 24upx;
  841. background: #fff;
  842. .con {
  843. display: flex;
  844. align-items: center;
  845. position: relative;
  846. height: 120upx;
  847. padding: 0 30upx;
  848. &:after {
  849. position: absolute;
  850. left: 0;
  851. bottom: 0;
  852. content: '';
  853. width: 100%;
  854. height: 0;
  855. border-bottom: 1px dashed #f3f3f3;
  856. transform: scaleY(50%);
  857. }
  858. }
  859. .left {
  860. display: flex;
  861. flex-direction: column;
  862. justify-content: center;
  863. flex: 1;
  864. overflow: hidden;
  865. height: 100upx;
  866. }
  867. .title {
  868. font-size: 32upx;
  869. color: $font-color-dark;
  870. margin-bottom: 10upx;
  871. }
  872. .time {
  873. font-size: 24upx;
  874. color: $font-color-light;
  875. }
  876. .right {
  877. display: flex;
  878. flex-direction: column;
  879. justify-content: center;
  880. align-items: center;
  881. font-size: 26upx;
  882. color: $font-color-base;
  883. height: 100upx;
  884. }
  885. .price {
  886. font-size: 44upx;
  887. color: $base-color;
  888. &:before {
  889. content: '¥';
  890. font-size: 34upx;
  891. }
  892. }
  893. .tips {
  894. font-size: 24upx;
  895. color: $font-color-light;
  896. line-height: 60upx;
  897. padding-left: 30upx;
  898. }
  899. .circle {
  900. position: absolute;
  901. left: -6upx;
  902. bottom: -10upx;
  903. z-index: 10;
  904. width: 20upx;
  905. height: 20upx;
  906. background: #f3f3f3;
  907. border-radius: 100px;
  908. &.r {
  909. left: auto;
  910. right: -6upx;
  911. }
  912. }
  913. }
  914. .rich-img {
  915. width: 100%;
  916. height: auto;
  917. margin: 0;
  918. padding: 0;
  919. line-height: 0px;
  920. }
  921. button::after {
  922. border: none;
  923. }
  924. </style>