captain-ui
Version:
有赞vue wap业务组件库
87 lines (82 loc) • 2.46 kB
JavaScript
import "vant/es/cell-group/style";
import _CellGroup from "vant/es/cell-group";
import "vant/es/cell/style";
import _Cell from "vant/es/cell";
var _components;
export default {
render: function render() {
var _vm = this;
var _h = _vm.$createElement;
var _c = _vm._self._c || _h;
return _c('div', {
staticClass: "cap-promo-code"
}, [_c('div', {
staticClass: "cap-promo-code__card"
}, [_c('div', {
staticClass: "cap-promo-code__card-header"
}, [_c('h2', {
staticClass: "cap-promo-code__card-name"
}, [_vm._v("\n " + _vm._s(_vm.name) + "\n ")]), _vm.showShareButton ? _c('div', {
staticClass: "cap-promo-code__card-share",
on: {
"click": _vm.onShare
}
}, [_vm._v("\n 分享\n ")]) : _vm._e()]), _c('p', {
staticClass: "cap-promo-code__value"
}, [_vm._v("\n ¥" + _vm._s(_vm.value) + "\n ")]), _c('p', {
staticClass: "cap-promo-code__limit"
}, [_vm._v("\n " + _vm._s(_vm.limitText) + "\n ")]), _c('p', {
staticClass: "cap-promo-code__date"
}, [_vm._v("\n 有效日期: " + _vm._s(_vm.startAt) + " 至 " + _vm._s(_vm.endAt) + "\n ")])]), _vm._t("default"), _c('div', {
staticClass: "cap-promo-code__des"
}, [_c('h2', {
staticClass: "cap-promo-code__des-title"
}, [_vm._v("\n 使用说明\n ")]), _c('van-cell-group', [_c('van-cell', {
attrs: {
"value": _vm.description
}
})], 1)], 1)], 2);
},
name: 'cap-promo-code',
components: (_components = {}, _components[_Cell.name] = _Cell, _components[_CellGroup.name] = _CellGroup, _components),
props: {
name: {
type: String,
default: '优惠码标题'
},
value: {
type: [String, Number],
default: '0.00'
},
showShareButton: {
type: Boolean,
default: true
},
limit: {
type: [String, Number],
default: 'xx'
},
startAt: {
type: String,
default: '20xx : 00 : 00'
},
endAt: {
type: String,
default: '20xx : 00 : 00'
},
description: {
type: String,
default: '暂无使用说明......'
}
},
computed: {
limitText: function limitText() {
return this.limit ? "\u8BA2\u5355\u6EE1 " + this.limit + " \u5143(\u4E0D\u542B\u8FD0\u8D39)" : '无限制';
}
},
methods: {
onShare: function onShare() {
this.$emit('share');
}
}
};