s-goods-column.vue 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721
  1. <!-- 页面 -->
  2. <template>
  3. <view class="ss-goods-wrap">
  4. <!-- xs卡片:横向紧凑型,一行放两个,图片左内容右边 -->
  5. <view
  6. v-if="size === 'xs'"
  7. class="xs-goods-card ss-flex ss-col-stretch"
  8. :style="[elStyles]"
  9. @tap="onClick"
  10. >
  11. <view v-if="tagStyle.show" class="tag-icon-box">
  12. <image class="tag-icon" :src="sheep.$url.cdn(tagStyle.src)"></image>
  13. </view>
  14. <image class="xs-img-box" :src="sheep.$url.cdn(data.image)" mode="aspectFit"></image>
  15. <view
  16. v-if="goodsFields.title?.show || goodsFields.price?.show"
  17. class="xs-goods-content ss-flex-col ss-row-around"
  18. >
  19. <view
  20. v-if="goodsFields.title?.show"
  21. class="xs-goods-title ss-line-1"
  22. :style="[{ color: titleColor, width: titleWidth ? titleWidth + 'rpx' : '' }]"
  23. >
  24. {{ data.title }}
  25. </view>
  26. <view
  27. v-if="goodsFields.price?.show"
  28. class="xs-goods-price font-OPPOSANS"
  29. :style="[{ color: goodsFields.price.color }]"
  30. >
  31. <text class="price-unit ss-font-24">{{ priceUnit }}</text>
  32. {{ isArray(data.price) ? data.price[0] : data.price }}
  33. </view>
  34. </view>
  35. </view>
  36. <!-- sm卡片:竖向紧凑,一行放三个,图上内容下 -->
  37. <view v-if="size === 'sm'" class="sm-goods-card ss-flex-col" :style="[elStyles]" @tap="onClick">
  38. <view v-if="tagStyle.show" class="tag-icon-box">
  39. <image class="tag-icon" :src="sheep.$url.cdn(tagStyle.src)"></image>
  40. </view>
  41. <image class="sm-img-box" :src="sheep.$url.cdn(data.image)" mode="aspectFill"></image>
  42. <view
  43. v-if="goodsFields.title?.show || goodsFields.price?.show"
  44. class="sm-goods-content"
  45. :style="[{ color: titleColor, width: titleWidth ? titleWidth + 'rpx' : '' }]"
  46. >
  47. <view v-if="goodsFields.title?.show" class="sm-goods-title ss-line-1 ss-m-b-16">
  48. {{ data.title }}
  49. </view>
  50. <view
  51. v-if="goodsFields.price?.show"
  52. class="sm-goods-price font-OPPOSANS"
  53. :style="[{ color: goodsFields.price.color }]"
  54. >
  55. <text class="price-unit ss-font-24">{{ priceUnit }}</text>
  56. {{ isArray(data.price) ? data.price[0] : data.price }}
  57. </view>
  58. </view>
  59. </view>
  60. <!-- md卡片:竖向,一行放两个,图上内容下 -->
  61. <view v-if="size === 'md'" class="md-goods-card ss-flex-col" :style="[elStyles]" @tap="onClick">
  62. <view v-if="tagStyle.show" class="tag-icon-box">
  63. <image class="tag-icon" :src="sheep.$url.cdn(tagStyle.src)"></image>
  64. </view>
  65. <image
  66. class="md-img-box"
  67. :src="sheep.$url.cdn(data.image)"
  68. mode="widthFix"
  69. ></image>
  70. <view
  71. class="md-goods-content ss-flex-col ss-row-around ss-p-b-20 ss-p-t-20 ss-p-x-16"
  72. :id="elId"
  73. >
  74. <view
  75. v-if="goodsFields.title?.show"
  76. class="md-goods-title ss-line-1"
  77. :style="[{ color: titleColor, width: titleWidth ? titleWidth + 'rpx' : '' }]"
  78. >
  79. {{ data.title }}
  80. </view>
  81. <view
  82. v-if="goodsFields.subtitle?.show"
  83. class="md-goods-subtitle ss-m-t-16 ss-line-1"
  84. :style="[{ color: subTitleColor, background: subTitleBackground }]"
  85. >
  86. {{ data.subtitle }}
  87. </view>
  88. <slot name="activity">
  89. <view v-if="data.promos?.length" class="tag-box ss-flex-wrap ss-flex ss-col-center">
  90. <view
  91. class="activity-tag ss-m-r-10 ss-m-t-16"
  92. v-for="item in data.promos"
  93. :key="item.id"
  94. >
  95. {{ item.title }}
  96. </view>
  97. </view>
  98. </slot>
  99. <view class="ss-flex ss-col-bottom">
  100. <view
  101. v-if="goodsFields.price?.show"
  102. class="md-goods-price ss-m-t-16 font-OPPOSANS ss-m-r-10"
  103. :style="[{ color: goodsFields.price.color }]"
  104. >
  105. <text class="price-unit ss-font-24">{{ priceUnit }}</text>
  106. {{ isArray(data.price) ? data.price[0] : data.price }}
  107. </view>
  108. <view
  109. v-if="goodsFields.original_price?.show && data.original_price > 0"
  110. class="goods-origin-price ss-m-t-16 font-OPPOSANS ss-flex"
  111. :style="[{ color: originPriceColor }]"
  112. >
  113. <text class="price-unit ss-font-20">{{ priceUnit }}</text>
  114. <view class="ss-m-l-8">{{ data.original_price }}</view>
  115. </view>
  116. </view>
  117. <view class="ss-m-t-16 ss-flex ss-col-center ss-flex-wrap">
  118. <view class="sales-text" style="margin-left: -12px;">
  119. <text style="padding-right: 5px;">{{ salesAndStock }}</text>
  120. <text style="background: #ee1d5a;padding: 3px 5px;border-radius: 3px;color: #fff;">
  121. Cash back
  122. <text style="color:yellow;">{{ data.rate }}%</text>
  123. </text>
  124. </view>
  125. </view>
  126. </view>
  127. <slot name="cart">
  128. </slot>
  129. </view>
  130. <!-- lg卡片:横向型,一行放一个,图片左内容右边 -->
  131. <view
  132. v-if="size === 'lg'"
  133. class="lg-goods-card ss-flex ss-col-stretch"
  134. :style="[elStyles]"
  135. @tap="onClick"
  136. >
  137. <view v-if="tagStyle.show" class="tag-icon-box">
  138. <image class="tag-icon" :src="sheep.$url.cdn(tagStyle.src)"></image>
  139. </view>
  140. <view v-if="seckillTag" class="seckill-tag ss-flex ss-row-center"> {{$t('sheep.auth.seckill')}} </view>
  141. <view v-if="grouponTag" class="groupon-tag ss-flex ss-row-center">
  142. <view class="tag-icon">{{$t('sheep.auth.group')}}</view>
  143. </view>
  144. <image class="lg-img-box" :src="sheep.$url.cdn(data.image)" mode="aspectFill"></image>
  145. <view class="lg-goods-content ss-flex-1 ss-flex-col ss-row-between ss-p-b-10 ss-p-t-20">
  146. <view>
  147. <view
  148. v-if="goodsFields.title?.show"
  149. class="lg-goods-title ss-line-2"
  150. :style="[{ color: titleColor }]"
  151. >
  152. {{ data.title }}
  153. </view>
  154. <view
  155. v-if="goodsFields.subtitle?.show"
  156. class="lg-goods-subtitle ss-m-t-10 ss-line-1"
  157. :style="[{ color: subTitleColor, background: subTitleBackground }]"
  158. >
  159. {{ data.subtitle }}
  160. </view>
  161. </view>
  162. <view>
  163. <slot name="activity">
  164. <view v-if="data.promos?.length" class="tag-box ss-flex ss-col-center">
  165. <view class="activity-tag ss-m-r-10" v-for="item in data.promos" :key="item.id">
  166. {{ item.title }}
  167. </view>
  168. </view>
  169. </slot>
  170. <view class="ss-flex ss-col-bottom ss-m-t-10">
  171. <view
  172. v-if="goodsFields.price?.show"
  173. class="lg-goods-price ss-m-r-12 ss-flex ss-col-bottom font-OPPOSANS"
  174. :style="[{ color: goodsFields.price.color }]"
  175. >
  176. <text class="ss-font-24">{{ priceUnit }}</text>
  177. {{ isArray(data.price) ? data.price[0] : data.price }}
  178. </view>
  179. <view
  180. v-if="goodsFields.original_price?.show && data.original_price > 0"
  181. class="goods-origin-price ss-flex ss-col-bottom font-OPPOSANS"
  182. :style="[{ color: originPriceColor }]"
  183. >
  184. <text class="price-unit ss-font-20">{{ priceUnit }}</text>
  185. <view class="ss-m-l-8">{{ data.original_price }}</view>
  186. </view>
  187. </view>
  188. <view class="ss-m-t-8 ss-flex ss-col-center ss-flex-wrap">
  189. <view class="sales-text">{{ salesAndStock }}</view>
  190. </view>
  191. </view>
  192. </view>
  193. <slot name="cart"
  194. ><view class="buy-box ss-flex ss-col-center ss-row-center" v-if="buttonShow"
  195. >{{$t('sheep.auth.toBuy')}}</view
  196. ></slot
  197. >
  198. </view>
  199. <!-- sl卡片:竖向型,一行放一个,图片上内容下边 -->
  200. <view v-if="size === 'sl'" class="sl-goods-card ss-flex-col" :style="[elStyles]" @tap="onClick">
  201. <view v-if="tagStyle.show" class="tag-icon-box">
  202. <image class="tag-icon" :src="sheep.$url.cdn(tagStyle.src)"></image>
  203. </view>
  204. <image class="sl-img-box" :src="sheep.$url.cdn(data.image)" mode="aspectFill"></image>
  205. <view class="sl-goods-content">
  206. <view>
  207. <view
  208. v-if="goodsFields.title?.show"
  209. class="sl-goods-title ss-line-1"
  210. :style="[{ color: titleColor }]"
  211. >
  212. {{ data.title }}
  213. </view>
  214. <view
  215. v-if="goodsFields.subtitle?.show"
  216. class="sl-goods-subtitle ss-m-t-16"
  217. :style="[{ color: subTitleColor, background: subTitleBackground }]"
  218. >
  219. {{ data.subtitle }}
  220. </view>
  221. </view>
  222. <view>
  223. <slot name="activity">
  224. <view v-if="data.promos?.length" class="tag-box ss-flex ss-col-center ss-flex-wrap">
  225. <view
  226. class="activity-tag ss-m-r-10 ss-m-t-16"
  227. v-for="item in data.promos"
  228. :key="item.id"
  229. >
  230. {{ item.title }}
  231. </view>
  232. </view>
  233. </slot>
  234. <view v-if="goodsFields.price?.show" class="ss-flex ss-col-bottom font-OPPOSANS">
  235. <view class="sl-goods-price ss-m-r-12" :style="[{ color: goodsFields.price.color }]">
  236. <text class="price-unit ss-font-24">{{ priceUnit }}</text>
  237. {{ isArray(data.price) ? data.price[0] : data.price }}
  238. </view>
  239. <view
  240. v-if="goodsFields.original_price?.show && data.original_price > 0"
  241. class="goods-origin-price ss-m-t-16 font-OPPOSANS ss-flex"
  242. :style="[{ color: originPriceColor }]"
  243. >
  244. <text class="price-unit ss-font-20">{{ priceUnit }}</text>
  245. <view class="ss-m-l-8">{{ data.original_price }}</view>
  246. </view>
  247. </view>
  248. <view class="ss-m-t-16 ss-flex ss-flex-wrap">
  249. <view class="sales-text">{{ salesAndStock }}</view>
  250. </view>
  251. </view>
  252. </view>
  253. <slot name="cart"
  254. ><view class="buy-box ss-flex ss-col-center ss-row-center">{{$t('sheep.auth.toBuy')}}</view></slot
  255. >
  256. </view>
  257. </view>
  258. </template>
  259. <script setup>
  260. /**
  261. * 商品卡片
  262. *
  263. * @property {Array} size = [xs | sm | md | lg | sl ] - 列表数据
  264. * @property {String} tag - md及以上才有
  265. * @property {String} img - 图片
  266. * @property {String} background - 背景色
  267. * @property {String} topRadius - 上圆角
  268. * @property {String} bottomRadius - 下圆角
  269. * @property {String} title - 标题
  270. * @property {String} titleColor - 标题颜色
  271. * @property {Number} titleWidth = 0 - 标题宽度,默认0,单位rpx
  272. * @property {String} subTitle - 副标题
  273. * @property {String} subTitleColor - 副标题颜色
  274. * @property {String} subTitleBackground - 副标题背景
  275. * @property {String | Number} price - 价格
  276. * @property {String} priceColor - 价格颜色
  277. * @property {String | Number} originPrice - 原价/划线价
  278. * @property {String} originPriceColor - 原价颜色
  279. * @property {String | Number} sales - 销售数量
  280. * @property {String} salesColor - 销售数量颜色
  281. *
  282. * @slots activity - 活动插槽
  283. * @slots cart - 购物车插槽,默认包含文字,背景色,文字颜色 || 图片 || 行为
  284. *
  285. * @event {Function()} click - 点击卡片
  286. *
  287. */
  288. import { computed, reactive, getCurrentInstance,onMounted, nextTick } from 'vue';
  289. import sheep from '@/sheep';
  290. import { formatSales } from '@/sheep/hooks/useGoods';
  291. import { formatStock } from '@/sheep/hooks/useGoods';
  292. import goodsCollectVue from '@/pages/user/goods-collect.vue';
  293. import { isArray } from 'lodash';
  294. // 数据
  295. const state = reactive({});
  296. // 接收参数
  297. const props = defineProps({
  298. goodsFields: {
  299. type: [Array, Object],
  300. default() {
  301. return {
  302. title: { show: true },
  303. subtitle: { show: true },
  304. price: { show: true },
  305. original_price: { show: true },
  306. sales: { show: true },
  307. stock: { show: true },
  308. };
  309. },
  310. },
  311. tagStyle: {
  312. type: Object,
  313. default: {},
  314. },
  315. data: {
  316. type: Object,
  317. default: {},
  318. },
  319. size: {
  320. type: String,
  321. default: 'sl',
  322. },
  323. background: {
  324. type: String,
  325. default: '',
  326. },
  327. topRadius: {
  328. type: Number,
  329. default: 0,
  330. },
  331. bottomRadius: {
  332. type: Number,
  333. default: 0,
  334. },
  335. titleWidth: {
  336. type: Number,
  337. default: 0,
  338. },
  339. titleColor: {
  340. type: String,
  341. default: '#333',
  342. },
  343. priceColor: {
  344. type: String,
  345. default: '',
  346. },
  347. originPriceColor: {
  348. type: String,
  349. default: '#C4C4C4',
  350. },
  351. priceUnit: {
  352. type: String,
  353. default: '¥',
  354. },
  355. subTitleColor: {
  356. type: String,
  357. default: '#999999',
  358. },
  359. subTitleBackground: {
  360. type: String,
  361. default: '',
  362. },
  363. buttonShow: {
  364. type: Boolean,
  365. default: true,
  366. },
  367. seckillTag: {
  368. type: Boolean,
  369. default: false,
  370. },
  371. grouponTag: {
  372. type: Boolean,
  373. default: false,
  374. },
  375. });
  376. // 组件样式
  377. const elStyles = computed(() => {
  378. return {
  379. background: props.background,
  380. 'border-top-left-radius': props.topRadius + 'px',
  381. 'border-top-right-radius': props.topRadius + 'px',
  382. 'border-bottom-left-radius': props.bottomRadius + 'px',
  383. 'border-bottom-right-radius': props.bottomRadius + 'px',
  384. };
  385. });
  386. // 格式化销量、库存信息
  387. const salesAndStock = computed(() => {
  388. let text = [];
  389. if (props.goodsFields.sales?.show) {
  390. text.push(formatSales(props.data.sales_show_type, props.data.sales));
  391. }
  392. if (props.goodsFields.stock?.show) {
  393. text.push(formatStock(props.data.stock_show_type, props.data.stock));
  394. }
  395. return text.join(' | ');
  396. });
  397. // 返回事件
  398. const emits = defineEmits(['click', 'getHeight']);
  399. const onClick = () => {
  400. emits('click');
  401. };
  402. // 获取卡片实时高度
  403. const { proxy } = getCurrentInstance();
  404. const elId = `sheep_${Math.ceil(Math.random() * 10e5).toString(36)}`;
  405. function getGoodsPriceCardWH() {
  406. if (props.size === 'md') {
  407. const view = uni.createSelectorQuery().in(proxy);
  408. view.select(`#${elId}`).fields({ size: true, scrollOffset: true });
  409. view.exec((data) => {
  410. let totalHeight = 0;
  411. const goodsPriceCard = data[0];
  412. if(props.data.image_wh) {
  413. totalHeight = (goodsPriceCard.width / props.data.image_wh.w) * props.data.image_wh.h + goodsPriceCard.height
  414. }else {
  415. totalHeight = goodsPriceCard.width;
  416. }
  417. emits('getHeight', totalHeight);
  418. });
  419. }
  420. }
  421. onMounted(() => {
  422. nextTick(() => {
  423. getGoodsPriceCardWH()
  424. });
  425. });
  426. </script>
  427. <style lang="scss" scoped>
  428. .tag-icon-box {
  429. position: absolute;
  430. left: 0;
  431. top: 0;
  432. z-index: 2;
  433. .tag-icon {
  434. width: 72rpx;
  435. height: 44rpx;
  436. }
  437. }
  438. .seckill-tag {
  439. position: absolute;
  440. left: 0;
  441. top: 0;
  442. z-index: 2;
  443. width: 68rpx;
  444. height: 38rpx;
  445. background: linear-gradient(90deg, #ff5854 0%, #ff2621 100%);
  446. border-radius: 10rpx 0px 10rpx 0px;
  447. font-size: 24rpx;
  448. font-weight: 500;
  449. color: #ffffff;
  450. line-height: 32rpx;
  451. }
  452. .groupon-tag {
  453. position: absolute;
  454. left: 0;
  455. top: 0;
  456. z-index: 2;
  457. width: 68rpx;
  458. height: 38rpx;
  459. background: linear-gradient(90deg, #fe832a 0%, #ff6600 100%);
  460. border-radius: 10rpx 0px 10rpx 0px;
  461. font-size: 24rpx;
  462. font-weight: 500;
  463. color: #ffffff;
  464. line-height: 32rpx;
  465. }
  466. .goods-img {
  467. width: 100%;
  468. height: 100%;
  469. background-color: #f5f5f5;
  470. }
  471. .price-unit {
  472. margin-right: -4px;
  473. }
  474. .sales-text {
  475. display: table;
  476. font-size: 24rpx;
  477. transform: scale(0.8);
  478. margin-left: 0rpx;
  479. color: #c4c4c4;
  480. }
  481. .activity-tag {
  482. font-size: 20rpx;
  483. color: #ff0000;
  484. line-height: 30rpx;
  485. padding: 0 10rpx;
  486. border: 1px solid rgba(#ff0000, 0.25);
  487. border-radius: 4px;
  488. flex-shrink: 0;
  489. }
  490. .goods-origin-price {
  491. font-size: 20rpx;
  492. color: #c4c4c4;
  493. line-height: 36rpx;
  494. text-decoration: line-through;
  495. }
  496. // xs
  497. .xs-goods-card {
  498. overflow: hidden;
  499. // max-width: 375rpx;
  500. background-color: $white;
  501. position: relative;
  502. .xs-img-box {
  503. width: 128rpx;
  504. height: 128rpx;
  505. margin-right: 20rpx;
  506. }
  507. .xs-goods-title {
  508. font-size: 26rpx;
  509. color: #333;
  510. font-weight: 500;
  511. }
  512. .xs-goods-price {
  513. font-size: 30rpx;
  514. color: $red;
  515. }
  516. }
  517. // sm
  518. .sm-goods-card {
  519. overflow: hidden;
  520. // width: 223rpx;
  521. // width: 100%;
  522. background-color: $white;
  523. position: relative;
  524. .sm-img-box {
  525. // width: 228rpx;
  526. width: 100%;
  527. height: 208rpx;
  528. }
  529. .sm-goods-content {
  530. padding: 20rpx 16rpx;
  531. box-sizing: border-box;
  532. }
  533. .sm-goods-title {
  534. font-size: 26rpx;
  535. color: #333;
  536. }
  537. .sm-goods-price {
  538. font-size: 30rpx;
  539. color: $red;
  540. }
  541. }
  542. // md
  543. .md-goods-card {
  544. overflow: hidden;
  545. width: 100%;
  546. position: relative;
  547. z-index: 1;
  548. background-color: $white;
  549. position: relative;
  550. .md-img-box {
  551. width: 100%;
  552. }
  553. .md-goods-title {
  554. font-size: 26rpx;
  555. color: #333;
  556. width: 100%;
  557. }
  558. .md-goods-subtitle {
  559. font-size: 24rpx;
  560. font-weight: 400;
  561. color: #999999;
  562. }
  563. .md-goods-price {
  564. font-size: 30rpx;
  565. color: $red;
  566. line-height: 36rpx;
  567. }
  568. .cart-box {
  569. width: 54rpx;
  570. height: 54rpx;
  571. background: linear-gradient(90deg, #fe8900, #ff5e00);
  572. border-radius: 50%;
  573. position: absolute;
  574. bottom: 50rpx;
  575. right: 20rpx;
  576. z-index: 2;
  577. .cart-icon {
  578. width: 30rpx;
  579. height: 30rpx;
  580. }
  581. }
  582. }
  583. // lg
  584. .lg-goods-card {
  585. overflow: hidden;
  586. position: relative;
  587. z-index: 1;
  588. background-color: $white;
  589. height: 280rpx;
  590. .lg-img-box {
  591. width: 280rpx;
  592. height: 280rpx;
  593. margin-right: 20rpx;
  594. }
  595. .lg-goods-title {
  596. font-size: 28rpx;
  597. font-weight: 500;
  598. color: #333333;
  599. // line-height: 36rpx;
  600. // width: 410rpx;
  601. }
  602. .lg-goods-subtitle {
  603. font-size: 24rpx;
  604. font-weight: 400;
  605. color: #999999;
  606. // line-height: 30rpx;
  607. // width: 410rpx;
  608. }
  609. .lg-goods-price {
  610. font-size: 30rpx;
  611. color: $red;
  612. line-height: 36rpx;
  613. }
  614. .buy-box {
  615. position: absolute;
  616. bottom: 20rpx;
  617. right: 20rpx;
  618. z-index: 2;
  619. width: 120rpx;
  620. height: 50rpx;
  621. background: linear-gradient(90deg, #fe8900, #ff5e00);
  622. border-radius: 25rpx;
  623. font-size: 24rpx;
  624. color: #ffffff;
  625. }
  626. .tag-box {
  627. width: 100%;
  628. }
  629. }
  630. // sl
  631. .sl-goods-card {
  632. overflow: hidden;
  633. position: relative;
  634. z-index: 1;
  635. width: 100%;
  636. background-color: $white;
  637. .sl-goods-content {
  638. padding: 20rpx 20rpx;
  639. box-sizing: border-box;
  640. }
  641. .sl-img-box {
  642. width: 100%;
  643. height: 360rpx;
  644. }
  645. .sl-goods-title {
  646. font-size: 26rpx;
  647. color: #333;
  648. font-weight: 500;
  649. }
  650. .sl-goods-subtitle {
  651. font-size: 24rpx;
  652. font-weight: 400;
  653. color: #999999;
  654. line-height: 30rpx;
  655. }
  656. .sl-goods-price {
  657. font-size: 30rpx;
  658. color: $red;
  659. line-height: 36rpx;
  660. }
  661. .buy-box {
  662. position: absolute;
  663. bottom: 20rpx;
  664. right: 20rpx;
  665. z-index: 2;
  666. width: 148rpx;
  667. height: 50rpx;
  668. background: linear-gradient(90deg, #fe8900, #ff5e00);
  669. border-radius: 25rpx;
  670. font-size: 24rpx;
  671. color: #ffffff;
  672. }
  673. }
  674. </style>