s-goods-column.vue 21 KB

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