s-goods-column.vue 21 KB

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