captain-ui
Version:
有赞vue wap业务组件库
102 lines (98 loc) • 2.28 kB
JavaScript
import GrouponGoods from './components/GrouponGoods';
var SIZE_MAP = {
0: 'big',
1: 'small',
2: 'list'
};
export default {
render: function render() {
var _vm = this;
var _h = _vm.$createElement;
var _c = _vm._self._c || _h;
return _c('div', {
class: {
'cap-ump-groupon--preview': _vm.isPreview
}
}, [_c('ul', {
staticClass: "cap-ump-groupon",
class: (_obj = {}, _obj["cap-ump-groupon--" + _vm.sizeType] = true, _obj)
}, _vm._l(_vm.grouponGoodsList, function (goods) {
return _c('groupon-goods', {
key: goods.goods_id,
attrs: {
"goods": goods,
"size": _vm.size,
"show-buy-btn": _vm.showBuyBtn,
"buy-btn-type": _vm.buyBtnType,
"show-title": _vm.showTitle,
"show-groupon-num": _vm.showGrouponNum,
"ratio": _vm.ratio,
"image-fill-style": _vm.imageFillStyle,
"is-preview": _vm.isPreview
}
});
}), 1), _vm.isShowViewMore ? _c('div', {
staticClass: "cap-ump-groupon__view-more"
}, [_c('a', {
staticClass: "cap-ump-groupon__view-more-text",
attrs: {
"href": _vm.allGrouponUrl
}
}, [_vm._v("\n 查看全部\n ")])]) : _vm._e()]);
var _obj;
},
name: 'cap-ump-groupon',
components: {
GrouponGoods: GrouponGoods
},
props: {
grouponGoodsList: {
type: Array,
default: function _default() {
return [];
}
},
isShowViewMore: Boolean,
size: {
type: Number,
default: 0
},
showBuyBtn: {
type: Number,
default: 1
},
buyBtnType: {
type: Number,
default: 1
},
showTitle: {
type: Number,
default: 1
},
showGrouponNum: {
type: Number,
default: 1
},
isPreview: {
type: Boolean,
default: false
},
ratio: {
type: String,
default: '1,1'
},
imageFillStyle: {
type: Number,
default: 2
},
imageIcon: String
},
computed: {
sizeType: function sizeType() {
return SIZE_MAP[this.size];
},
allGrouponUrl: function allGrouponUrl() {
return this.isPreview ? '' : 'https://h5.youzan.com/v2/ump/groupon/list';
}
}
};