captain-ui
Version:
有赞vue wap业务组件库
87 lines (82 loc) • 2.64 kB
JavaScript
import "vant/es/loading/style";
import _Loading from "vant/es/loading";
import "vant/es/icon/style";
import _Icon from "vant/es/icon";
var _components;
export default {
render: function render() {
var _vm = this;
var _h = _vm.$createElement;
var _c = _vm._self._c || _h;
return _c('div', [_c('div', {
staticClass: "cap-taglist__group-title"
}, [_vm._v(_vm._s(_vm.tag.title))]), _vm._l(_vm.goodsList, function (goods, index) {
return _c('a', {
key: index,
staticClass: "cap-taglist__card",
class: {
'cap-taglist__card--skeleton': !goods.title
},
attrs: {
"href": goods.url
}
}, [_vm.isThumbCover && goods.thumb ? _c('div', {
directives: [{
name: "lazy",
rawName: "v-lazy:background-image",
value: goods.thumb,
expression: "goods.thumb",
arg: "background-image"
}],
staticClass: "cap-taglist__thumb",
attrs: {
"data-lazy-log-id": goods.id
}
}) : _c('div', {
staticClass: "cap-taglist__thumb"
}, [goods.thumb ? _c('img', {
directives: [{
name: "lazy",
rawName: "v-lazy",
value: goods.thumb,
expression: "goods.thumb"
}],
attrs: {
"data-lazy-log-id": goods.id
}
}) : _vm._e()]), goods.isSoldOut ? _c('div', {
staticClass: "cap-taglist__sold-out"
}) : _vm._e(), _c('h3', [_vm._v(_vm._s(goods.title))]), _c('h4', [_vm._v("¥" + _vm._s(goods.price))]), _vm.tag.alias === _vm.loadingGoods.alias && index === _vm.loadingGoods.index ? _c('van-loading', {
attrs: {
"type": "spinner"
}
}) : _c('van-icon', {
attrs: {
"name": "add"
},
on: {
"click": function click($event) {
_vm.onAddClick($event, index);
}
}
})], 1);
}), !_vm.goodsList.length ? _c('div', {
staticClass: "cap-taglist__empty"
}, [_vm._v("\n " + _vm._s(_vm.tag.loading ? '加载中...' : '此类下暂时没有商品') + "\n ")]) : _vm._e()], 2);
},
name: 'cap-taglist-goods',
components: (_components = {}, _components[_Icon.name] = _Icon, _components[_Loading.name] = _Loading, _components),
props: {
goodsList: Array,
tag: Object,
loadingGoods: Object,
isThumbCover: Boolean
},
methods: {
onAddClick: function onAddClick(event, index) {
event.stopImmediatePropagation();
event.preventDefault();
this.$emit('click', this.goodsList[index], this.tag, index);
}
}
};