UNPKG

captain-ui

Version:

有赞vue wap业务组件库

89 lines (86 loc) 2.52 kB
import "vant/es/icon/style"; import _Icon from "vant/es/icon"; import ContentItem from './content-item'; import { BASE_URL } from './constants'; export default { render: function render() { var _vm = this; var _h = _vm.$createElement; var _c = _vm._self._c || _h; return _c('div', [_c('div', { staticClass: "paid-content-container" }, [_vm.showTitle ? _c('div', { staticClass: "paid-content__header" }, [_vm.showTitleAll ? _c('a', { staticClass: "paid-content__view-all", attrs: { "href": _vm.showTitleAllLink } }, [_vm._v("\n 全部"), _c('van-icon', { attrs: { "name": "arrow" } })], 1) : _vm._e(), _c('h3', { staticClass: "paid-content__title" }, [_vm._v(_vm._s(_vm.title))])]) : _vm._e(), _vm.contentList.length ? _c('div', { staticClass: "paid-content__list" }, _vm._l(_vm.contentList, function (content) { return _c('content-item', { key: content.title + content.publish_at, attrs: { "kdt-id": _vm.kdtId, "base-url": _vm.baseUrl, "title": content.title, "alias": content.alias, "cover": content.cover, "publish-at": content.publish_at, "is-free": content.is_free, "summary": content.summary, "column-title": content.column_title, "subscriptions-count": content.subscriptions_count, "price": content.price, "has-buy": content.isBought == 1, "discount": content.isVipDiscount, "is-vip": content.isVip == 1, "is-groupon": content.isGroupOn == 1, "groupon-num": content.groupOnNum } }); }), 1) : _c('div', { staticClass: "paid-content__no-data-page" }, [_c('p', [_vm._v("还没有相关内容哦")])])])]); }, name: 'cap-paid-content', components: { ContentItem: ContentItem, 'van-icon': _Icon }, props: { baseUrl: { type: String, default: BASE_URL }, kdtId: { type: [String, Number], default: '' }, showTitle: Boolean, showTitleAll: Boolean, title: { type: String, default: '' }, contentList: { type: Array, default: function _default() { return []; } } }, computed: { showTitleAllLink: function showTitleAllLink() { if (!this.kdtId) return 'javascript:;'; return this.baseUrl + "/ump/paidcontent?kdt_id=" + this.kdtId + "#/allcontents"; } } };