s-goods-column.vue 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751
  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></slot
  278. >
  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 goodsCollectVue from '@/pages/user/goods-collect.vue';
  316. import { isArray } from 'lodash-es';
  317. // 数据
  318. const state = reactive({});
  319. // 接收参数
  320. const props = defineProps({
  321. goodsFields: {
  322. type: [Array, Object],
  323. default() {
  324. return {
  325. // 商品价格
  326. price: { show: true },
  327. // 库存
  328. stock: { show: true },
  329. // 商品名称
  330. name: { show: true },
  331. // 商品介绍
  332. introduction: { show: true },
  333. // 市场价
  334. marketPrice: { show: true },
  335. // 销量
  336. salesCount: { show: true },
  337. };
  338. },
  339. },
  340. tagStyle: {
  341. type: Object,
  342. default: {},
  343. },
  344. data: {
  345. type: Object,
  346. default: {},
  347. },
  348. size: {
  349. type: String,
  350. default: 'sl',
  351. },
  352. background: {
  353. type: String,
  354. default: '',
  355. },
  356. topRadius: {
  357. type: Number,
  358. default: 0,
  359. },
  360. bottomRadius: {
  361. type: Number,
  362. default: 0,
  363. },
  364. titleWidth: {
  365. type: Number,
  366. default: 0,
  367. },
  368. titleColor: {
  369. type: String,
  370. default: '#333',
  371. },
  372. priceColor: {
  373. type: String,
  374. default: '',
  375. },
  376. originPriceColor: {
  377. type: String,
  378. default: '#C4C4C4',
  379. },
  380. priceUnit: {
  381. type: String,
  382. default: '¥',
  383. },
  384. subTitleColor: {
  385. type: String,
  386. default: '#999999',
  387. },
  388. subTitleBackground: {
  389. type: String,
  390. default: '',
  391. },
  392. buttonShow: {
  393. type: Boolean,
  394. default: true,
  395. },
  396. seckillTag: {
  397. type: Boolean,
  398. default: false,
  399. },
  400. grouponTag: {
  401. type: Boolean,
  402. default: false,
  403. },
  404. });
  405. // 组件样式
  406. const elStyles = computed(() => {
  407. return {
  408. background: props.background,
  409. 'border-top-left-radius': props.topRadius + 'px',
  410. 'border-top-right-radius': props.topRadius + 'px',
  411. 'border-bottom-left-radius': props.bottomRadius + 'px',
  412. 'border-bottom-right-radius': props.bottomRadius + 'px',
  413. };
  414. });
  415. // 格式化销量、库存信息
  416. const salesAndStock = computed(() => {
  417. let text = [];
  418. if (props.goodsFields.salesCount?.show) {
  419. text.push(formatSales(props.data.sales_show_type, props.data.salesCount));
  420. }
  421. if (props.goodsFields.stock?.show) {
  422. text.push(formatStock(props.data.stock_show_type, props.data.stock));
  423. }
  424. return text.join(' | ');
  425. });
  426. // 返回事件
  427. const emits = defineEmits(['click', 'getHeight']);
  428. const onClick = () => {
  429. emits('click');
  430. };
  431. // 获取卡片实时高度
  432. const { proxy } = getCurrentInstance();
  433. const elId = `sheep_${Math.ceil(Math.random() * 10e5).toString(36)}`;
  434. function getGoodsPriceCardWH() {
  435. if (props.size === 'md') {
  436. const view = uni.createSelectorQuery().in(proxy);
  437. view.select(`#${elId}`).fields({ size: true, scrollOffset: true });
  438. view.exec((data) => {
  439. let totalHeight = 0;
  440. const goodsPriceCard = data[0];
  441. if (props.data.image_wh) {
  442. totalHeight =
  443. (goodsPriceCard.width / props.data.image_wh.w) * props.data.image_wh.h +
  444. goodsPriceCard.height;
  445. } else {
  446. totalHeight = goodsPriceCard.width;
  447. }
  448. emits('getHeight', totalHeight);
  449. });
  450. }
  451. }
  452. onMounted(() => {
  453. nextTick(() => {
  454. getGoodsPriceCardWH();
  455. });
  456. });
  457. </script>
  458. <style lang="scss" scoped>
  459. .tag-icon-box {
  460. position: absolute;
  461. left: 0;
  462. top: 0;
  463. z-index: 2;
  464. .tag-icon {
  465. width: 72rpx;
  466. height: 44rpx;
  467. }
  468. }
  469. .seckill-tag {
  470. position: absolute;
  471. left: 0;
  472. top: 0;
  473. z-index: 2;
  474. width: 68rpx;
  475. height: 38rpx;
  476. background: linear-gradient(90deg, #ff5854 0%, #ff2621 100%);
  477. border-radius: 10rpx 0px 10rpx 0px;
  478. font-size: 24rpx;
  479. font-weight: 500;
  480. color: #ffffff;
  481. line-height: 32rpx;
  482. }
  483. .groupon-tag {
  484. position: absolute;
  485. left: 0;
  486. top: 0;
  487. z-index: 2;
  488. width: 68rpx;
  489. height: 38rpx;
  490. background: linear-gradient(90deg, #fe832a 0%, #ff6600 100%);
  491. border-radius: 10rpx 0px 10rpx 0px;
  492. font-size: 24rpx;
  493. font-weight: 500;
  494. color: #ffffff;
  495. line-height: 32rpx;
  496. }
  497. .goods-img {
  498. width: 100%;
  499. height: 100%;
  500. background-color: #f5f5f5;
  501. }
  502. .price-unit {
  503. margin-right: -4px;
  504. }
  505. .sales-text {
  506. display: table;
  507. font-size: 24rpx;
  508. transform: scale(0.8);
  509. margin-left: 0rpx;
  510. color: #c4c4c4;
  511. }
  512. .activity-tag {
  513. font-size: 20rpx;
  514. color: #ff0000;
  515. line-height: 30rpx;
  516. padding: 0 10rpx;
  517. border: 1px solid rgba(#ff0000, 0.25);
  518. border-radius: 4px;
  519. flex-shrink: 0;
  520. }
  521. .goods-origin-price {
  522. font-size: 20rpx;
  523. color: #c4c4c4;
  524. line-height: 36rpx;
  525. text-decoration: line-through;
  526. }
  527. // xs
  528. .xs-goods-card {
  529. overflow: hidden;
  530. // max-width: 375rpx;
  531. background-color: $white;
  532. position: relative;
  533. .xs-img-box {
  534. width: 128rpx;
  535. height: 128rpx;
  536. margin-right: 20rpx;
  537. }
  538. .xs-goods-title {
  539. font-size: 26rpx;
  540. color: #333;
  541. font-weight: 500;
  542. }
  543. .xs-goods-price {
  544. font-size: 30rpx;
  545. color: $red;
  546. }
  547. }
  548. // sm
  549. .sm-goods-card {
  550. overflow: hidden;
  551. // width: 223rpx;
  552. // width: 100%;
  553. background-color: $white;
  554. position: relative;
  555. .sm-img-box {
  556. // width: 228rpx;
  557. width: 100%;
  558. height: 208rpx;
  559. }
  560. .sm-goods-content {
  561. padding: 20rpx 16rpx;
  562. box-sizing: border-box;
  563. }
  564. .sm-goods-title {
  565. font-size: 26rpx;
  566. color: #333;
  567. }
  568. .sm-goods-price {
  569. font-size: 30rpx;
  570. color: $red;
  571. }
  572. }
  573. // md
  574. .md-goods-card {
  575. overflow: hidden;
  576. width: 100%;
  577. position: relative;
  578. z-index: 1;
  579. background-color: $white;
  580. position: relative;
  581. .md-img-box {
  582. width: 100%;
  583. }
  584. .md-goods-title {
  585. font-size: 26rpx;
  586. color: #333;
  587. width: 100%;
  588. }
  589. .md-goods-subtitle {
  590. font-size: 24rpx;
  591. font-weight: 400;
  592. color: #999999;
  593. }
  594. .md-goods-price {
  595. font-size: 30rpx;
  596. color: $red;
  597. line-height: 36rpx;
  598. }
  599. .cart-box {
  600. width: 54rpx;
  601. height: 54rpx;
  602. background: linear-gradient(90deg, #fe8900, #ff5e00);
  603. border-radius: 50%;
  604. position: absolute;
  605. bottom: 50rpx;
  606. right: 20rpx;
  607. z-index: 2;
  608. .cart-icon {
  609. width: 30rpx;
  610. height: 30rpx;
  611. }
  612. }
  613. }
  614. // lg
  615. .lg-goods-card {
  616. overflow: hidden;
  617. position: relative;
  618. z-index: 1;
  619. background-color: $white;
  620. height: 280rpx;
  621. .lg-img-box {
  622. width: 280rpx;
  623. height: 280rpx;
  624. margin-right: 20rpx;
  625. }
  626. .lg-goods-title {
  627. font-size: 28rpx;
  628. font-weight: 500;
  629. color: #333333;
  630. // line-height: 36rpx;
  631. // width: 410rpx;
  632. }
  633. .lg-goods-subtitle {
  634. font-size: 24rpx;
  635. font-weight: 400;
  636. color: #999999;
  637. // line-height: 30rpx;
  638. // width: 410rpx;
  639. }
  640. .lg-goods-price {
  641. font-size: 30rpx;
  642. color: $red;
  643. line-height: 36rpx;
  644. }
  645. .buy-box {
  646. position: absolute;
  647. bottom: 20rpx;
  648. right: 20rpx;
  649. z-index: 2;
  650. width: 120rpx;
  651. height: 50rpx;
  652. background: linear-gradient(90deg, #fe8900, #ff5e00);
  653. border-radius: 25rpx;
  654. font-size: 24rpx;
  655. color: #ffffff;
  656. }
  657. .tag-box {
  658. width: 100%;
  659. }
  660. }
  661. // sl
  662. .sl-goods-card {
  663. overflow: hidden;
  664. position: relative;
  665. z-index: 1;
  666. width: 100%;
  667. background-color: $white;
  668. .sl-goods-content {
  669. padding: 20rpx 20rpx;
  670. box-sizing: border-box;
  671. }
  672. .sl-img-box {
  673. width: 100%;
  674. height: 360rpx;
  675. }
  676. .sl-goods-title {
  677. font-size: 26rpx;
  678. color: #333;
  679. font-weight: 500;
  680. }
  681. .sl-goods-subtitle {
  682. font-size: 24rpx;
  683. font-weight: 400;
  684. color: #999999;
  685. line-height: 30rpx;
  686. }
  687. .sl-goods-price {
  688. font-size: 30rpx;
  689. color: $red;
  690. line-height: 36rpx;
  691. }
  692. .buy-box {
  693. position: absolute;
  694. bottom: 20rpx;
  695. right: 20rpx;
  696. z-index: 2;
  697. width: 148rpx;
  698. height: 50rpx;
  699. background: linear-gradient(90deg, #fe8900, #ff5e00);
  700. border-radius: 25rpx;
  701. font-size: 24rpx;
  702. color: #ffffff;
  703. }
  704. }
  705. </style>