s-goods-column.vue 19 KB

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