s-goods-column.vue 20 KB

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