first
This commit is contained in:
1
node_modules/vant/lib/card/index.css
generated
vendored
Normal file
1
node_modules/vant/lib/card/index.css
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
.van-card{position:relative;box-sizing:border-box;padding:8px 16px;color:#323233;font-size:12px;background-color:#fafafa}.van-card:not(:first-child){margin-top:8px}.van-card__header{display:-webkit-box;display:-webkit-flex;display:flex}.van-card__thumb{position:relative;-webkit-box-flex:0;-webkit-flex:none;flex:none;width:88px;height:88px;margin-right:8px}.van-card__thumb img{border-radius:8px}.van-card__content{position:relative;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-flex:1;-webkit-flex:1;flex:1;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;flex-direction:column;-webkit-box-pack:justify;-webkit-justify-content:space-between;justify-content:space-between;min-width:0;min-height:88px}.van-card__content--centered{-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center}.van-card__desc,.van-card__title{word-wrap:break-word}.van-card__title{max-height:32px;font-weight:500;line-height:16px}.van-card__desc{max-height:20px;color:#646566;line-height:20px}.van-card__bottom{line-height:20px}.van-card__price{display:inline-block;color:#323233;font-weight:500;font-size:12px}.van-card__price-integer{font-size:16px;font-family:Avenir-Heavy,PingFang SC,Helvetica Neue,Arial,sans-serif}.van-card__price-decimal{font-family:Avenir-Heavy,PingFang SC,Helvetica Neue,Arial,sans-serif}.van-card__origin-price{display:inline-block;margin-left:5px;color:#969799;font-size:10px;text-decoration:line-through}.van-card__num{float:right;color:#969799}.van-card__tag{position:absolute;top:2px;left:0}.van-card__footer{-webkit-box-flex:0;-webkit-flex:none;flex:none;text-align:right}.van-card__footer .van-button{margin-left:5px}
|
172
node_modules/vant/lib/card/index.js
generated
vendored
Normal file
172
node_modules/vant/lib/card/index.js
generated
vendored
Normal file
@ -0,0 +1,172 @@
|
||||
"use strict";
|
||||
|
||||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
||||
|
||||
exports.__esModule = true;
|
||||
exports.default = void 0;
|
||||
|
||||
var _babelHelperVueJsxMergeProps = _interopRequireDefault(require("@vue/babel-helper-vue-jsx-merge-props"));
|
||||
|
||||
var _utils = require("../utils");
|
||||
|
||||
var _functional = require("../utils/functional");
|
||||
|
||||
var _tag = _interopRequireDefault(require("../tag"));
|
||||
|
||||
var _image = _interopRequireDefault(require("../image"));
|
||||
|
||||
// Utils
|
||||
// Components
|
||||
var _createNamespace = (0, _utils.createNamespace)('card'),
|
||||
createComponent = _createNamespace[0],
|
||||
bem = _createNamespace[1];
|
||||
|
||||
function Card(h, props, slots, ctx) {
|
||||
var _slots$priceTop;
|
||||
|
||||
var thumb = props.thumb;
|
||||
var showNum = slots.num || (0, _utils.isDef)(props.num);
|
||||
var showPrice = slots.price || (0, _utils.isDef)(props.price);
|
||||
var showOriginPrice = slots['origin-price'] || (0, _utils.isDef)(props.originPrice);
|
||||
var showBottom = showNum || showPrice || showOriginPrice || slots.bottom;
|
||||
|
||||
function onThumbClick(event) {
|
||||
(0, _functional.emit)(ctx, 'click-thumb', event);
|
||||
}
|
||||
|
||||
function ThumbTag() {
|
||||
if (slots.tag || props.tag) {
|
||||
return h("div", {
|
||||
"class": bem('tag')
|
||||
}, [slots.tag ? slots.tag() : h(_tag.default, {
|
||||
"attrs": {
|
||||
"mark": true,
|
||||
"type": "danger"
|
||||
}
|
||||
}, [props.tag])]);
|
||||
}
|
||||
}
|
||||
|
||||
function Thumb() {
|
||||
if (slots.thumb || thumb) {
|
||||
return h("a", {
|
||||
"attrs": {
|
||||
"href": props.thumbLink
|
||||
},
|
||||
"class": bem('thumb'),
|
||||
"on": {
|
||||
"click": onThumbClick
|
||||
}
|
||||
}, [slots.thumb ? slots.thumb() : h(_image.default, {
|
||||
"attrs": {
|
||||
"src": thumb,
|
||||
"width": "100%",
|
||||
"height": "100%",
|
||||
"fit": "cover",
|
||||
"lazy-load": props.lazyLoad
|
||||
}
|
||||
}), ThumbTag()]);
|
||||
}
|
||||
}
|
||||
|
||||
function Title() {
|
||||
if (slots.title) {
|
||||
return slots.title();
|
||||
}
|
||||
|
||||
if (props.title) {
|
||||
return h("div", {
|
||||
"class": [bem('title'), 'van-multi-ellipsis--l2']
|
||||
}, [props.title]);
|
||||
}
|
||||
}
|
||||
|
||||
function Desc() {
|
||||
if (slots.desc) {
|
||||
return slots.desc();
|
||||
}
|
||||
|
||||
if (props.desc) {
|
||||
return h("div", {
|
||||
"class": [bem('desc'), 'van-ellipsis']
|
||||
}, [props.desc]);
|
||||
}
|
||||
}
|
||||
|
||||
function PriceContent() {
|
||||
var priceArr = props.price.toString().split('.');
|
||||
return h("div", [h("span", {
|
||||
"class": bem('price-currency')
|
||||
}, [props.currency]), h("span", {
|
||||
"class": bem('price-integer')
|
||||
}, [priceArr[0]]), ".", h("span", {
|
||||
"class": bem('price-decimal')
|
||||
}, [priceArr[1]])]);
|
||||
}
|
||||
|
||||
function Price() {
|
||||
if (showPrice) {
|
||||
return h("div", {
|
||||
"class": bem('price')
|
||||
}, [slots.price ? slots.price() : PriceContent()]);
|
||||
}
|
||||
}
|
||||
|
||||
function OriginPrice() {
|
||||
if (showOriginPrice) {
|
||||
var slot = slots['origin-price'];
|
||||
return h("div", {
|
||||
"class": bem('origin-price')
|
||||
}, [slot ? slot() : props.currency + " " + props.originPrice]);
|
||||
}
|
||||
}
|
||||
|
||||
function Num() {
|
||||
if (showNum) {
|
||||
return h("div", {
|
||||
"class": bem('num')
|
||||
}, [slots.num ? slots.num() : "x" + props.num]);
|
||||
}
|
||||
}
|
||||
|
||||
function Footer() {
|
||||
if (slots.footer) {
|
||||
return h("div", {
|
||||
"class": bem('footer')
|
||||
}, [slots.footer()]);
|
||||
}
|
||||
}
|
||||
|
||||
return h("div", (0, _babelHelperVueJsxMergeProps.default)([{
|
||||
"class": bem()
|
||||
}, (0, _functional.inherit)(ctx, true)]), [h("div", {
|
||||
"class": bem('header')
|
||||
}, [Thumb(), h("div", {
|
||||
"class": bem('content', {
|
||||
centered: props.centered
|
||||
})
|
||||
}, [h("div", [Title(), Desc(), slots.tags == null ? void 0 : slots.tags()]), showBottom && h("div", {
|
||||
"class": "van-card__bottom"
|
||||
}, [(_slots$priceTop = slots['price-top']) == null ? void 0 : _slots$priceTop.call(slots), Price(), OriginPrice(), Num(), slots.bottom == null ? void 0 : slots.bottom()])])]), Footer()]);
|
||||
}
|
||||
|
||||
Card.props = {
|
||||
tag: String,
|
||||
desc: String,
|
||||
thumb: String,
|
||||
title: String,
|
||||
centered: Boolean,
|
||||
lazyLoad: Boolean,
|
||||
thumbLink: String,
|
||||
num: [Number, String],
|
||||
price: [Number, String],
|
||||
originPrice: [Number, String],
|
||||
currency: {
|
||||
type: String,
|
||||
default: '¥'
|
||||
}
|
||||
};
|
||||
|
||||
var _default = createComponent(Card);
|
||||
|
||||
exports.default = _default;
|
109
node_modules/vant/lib/card/index.less
generated
vendored
Normal file
109
node_modules/vant/lib/card/index.less
generated
vendored
Normal file
@ -0,0 +1,109 @@
|
||||
@import '../style/var';
|
||||
|
||||
.van-card {
|
||||
position: relative;
|
||||
box-sizing: border-box;
|
||||
padding: @card-padding;
|
||||
color: @card-text-color;
|
||||
font-size: @card-font-size;
|
||||
background-color: @card-background-color;
|
||||
|
||||
&:not(:first-child) {
|
||||
margin-top: @padding-xs;
|
||||
}
|
||||
|
||||
&__header {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
&__thumb {
|
||||
position: relative;
|
||||
flex: none;
|
||||
width: @card-thumb-size;
|
||||
height: @card-thumb-size;
|
||||
margin-right: @padding-xs;
|
||||
|
||||
img {
|
||||
border-radius: @card-thumb-border-radius;
|
||||
}
|
||||
}
|
||||
|
||||
&__content {
|
||||
position: relative;
|
||||
display: flex;
|
||||
flex: 1;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
min-width: 0; /* hack for flex box ellipsis */
|
||||
min-height: @card-thumb-size;
|
||||
|
||||
&--centered {
|
||||
justify-content: center;
|
||||
}
|
||||
}
|
||||
|
||||
&__title,
|
||||
&__desc {
|
||||
word-wrap: break-word;
|
||||
}
|
||||
|
||||
&__title {
|
||||
max-height: 32px;
|
||||
font-weight: @font-weight-bold;
|
||||
line-height: @card-title-line-height;
|
||||
}
|
||||
|
||||
&__desc {
|
||||
max-height: @card-desc-line-height;
|
||||
color: @card-desc-color;
|
||||
line-height: @card-desc-line-height;
|
||||
}
|
||||
|
||||
&__bottom {
|
||||
line-height: @line-height-md;
|
||||
}
|
||||
|
||||
&__price {
|
||||
display: inline-block;
|
||||
color: @card-price-color;
|
||||
font-weight: @font-weight-bold;
|
||||
font-size: @card-price-font-size;
|
||||
}
|
||||
|
||||
&__price-integer {
|
||||
font-size: @card-price-integer-font-size;
|
||||
font-family: @card-price-font-family;
|
||||
}
|
||||
|
||||
&__price-decimal {
|
||||
font-family: @card-price-font-family;
|
||||
}
|
||||
|
||||
&__origin-price {
|
||||
display: inline-block;
|
||||
margin-left: 5px;
|
||||
color: @card-origin-price-color;
|
||||
font-size: @card-origin-price-font-size;
|
||||
text-decoration: line-through;
|
||||
}
|
||||
|
||||
&__num {
|
||||
float: right;
|
||||
color: @card-num-color;
|
||||
}
|
||||
|
||||
&__tag {
|
||||
position: absolute;
|
||||
top: 2px;
|
||||
left: 0;
|
||||
}
|
||||
|
||||
&__footer {
|
||||
flex: none;
|
||||
text-align: right;
|
||||
|
||||
.van-button {
|
||||
margin-left: 5px;
|
||||
}
|
||||
}
|
||||
}
|
6
node_modules/vant/lib/card/style/index.js
generated
vendored
Normal file
6
node_modules/vant/lib/card/style/index.js
generated
vendored
Normal file
@ -0,0 +1,6 @@
|
||||
require('../../style/base.css');
|
||||
require('../../info/index.css');
|
||||
require('../../icon/index.css');
|
||||
require('../../image/index.css');
|
||||
require('../../tag/index.css');
|
||||
require('../index.css');
|
6
node_modules/vant/lib/card/style/less.js
generated
vendored
Normal file
6
node_modules/vant/lib/card/style/less.js
generated
vendored
Normal file
@ -0,0 +1,6 @@
|
||||
require('../../style/base.less');
|
||||
require('../../info/index.less');
|
||||
require('../../icon/index.less');
|
||||
require('../../image/index.less');
|
||||
require('../../tag/index.less');
|
||||
require('../index.less');
|
Reference in New Issue
Block a user