captain-ui
Version:
有赞vue wap业务组件库
90 lines (85 loc) • 2.48 kB
JavaScript
import "vant/es/action-sheet/style";
import _ActionSheet from "vant/es/action-sheet";
import "vant/es/popup/style";
import _Popup from "vant/es/popup";
import "vant/es/cell/style";
import _Cell from "vant/es/cell";
var _components;
import { getTotalPrice } from '../utils';
import PriceDetail from './price-detail';
export default {
render: function render() {
var _vm = this;
var _h = _vm.$createElement;
var _c = _vm._self._c || _h;
return _c('van-cell', {
staticClass: "cap-order-goods-price",
class: {
'cap-order-goods-price--with-detail': _vm.showPriceDetail
},
attrs: {
"title": "合计",
"is-link": _vm.showPriceDetail
},
nativeOn: {
"click": function click($event) {
return _vm.onPriceDetailClick($event);
}
}
}, [_c('span', [_vm._v(_vm._s(_vm.totalPrice))]), _vm.showPriceDetail ? _c('span', {
staticClass: "cap-order-goods-price__detail-link"
}, [_vm._v("\n 明细\n ")]) : _vm._e(), _vm.showPriceDetail ? _c('van-action-sheet', {
staticClass: "cap-order-goods-price__detail",
attrs: {
"title": "费用明细",
"get-container": _vm.getContainer
},
model: {
value: _vm.showDetailPopup,
callback: function callback($$v) {
_vm.showDetailPopup = $$v;
},
expression: "showDetailPopup"
}
}, [_c('cap-order-goods-price-detail', {
attrs: {
"price": _vm.price,
"item-list": _vm.itemList
}
})], 1) : _vm._e()], 1);
},
name: 'cap-order-goods-price',
components: (_components = {}, _components[_Cell.name] = _Cell, _components[_Popup.name] = _Popup, _components[_ActionSheet.name] = _ActionSheet, _components[PriceDetail.name] = PriceDetail, _components),
props: {
price: Number,
points: Number,
isPoints: Boolean,
showPriceDetail: Boolean,
itemList: {
type: Array,
default: function _default() {
return [];
}
}
},
data: function data() {
return {
showDetailPopup: false
};
},
computed: {
totalPrice: function totalPrice() {
return getTotalPrice(this.price, this.points, this.isPoints);
}
},
methods: {
onPriceDetailClick: function onPriceDetailClick() {
if (this.showPriceDetail) {
this.showDetailPopup = true;
}
},
getContainer: function getContainer() {
return document.body;
}
}
};