123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802 |
- "use strict";
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
- exports.__esModule = true;
- exports.default = void 0;
- var _extends5 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
- var _vue = _interopRequireDefault(require("vue"));
- var _popup = _interopRequireDefault(require("../popup"));
- var _toast = _interopRequireDefault(require("../toast"));
- var _imagePreview = _interopRequireDefault(require("../image-preview"));
- var _SkuHeader = _interopRequireDefault(require("./components/SkuHeader"));
- var _SkuHeaderItem = _interopRequireDefault(require("./components/SkuHeaderItem"));
- var _SkuRow = _interopRequireDefault(require("./components/SkuRow"));
- var _SkuRowItem = _interopRequireDefault(require("./components/SkuRowItem"));
- var _SkuRowPropItem = _interopRequireDefault(require("./components/SkuRowPropItem"));
- var _SkuStepper = _interopRequireDefault(require("./components/SkuStepper"));
- var _SkuMessages = _interopRequireDefault(require("./components/SkuMessages"));
- var _SkuActions = _interopRequireDefault(require("./components/SkuActions"));
- var _utils = require("../utils");
- var _skuHelper = require("./utils/sku-helper");
- var _constants = require("./constants");
- var namespace = (0, _utils.createNamespace)('sku');
- var createComponent = namespace[0],
- bem = namespace[1],
- t = namespace[2];
- var QUOTA_LIMIT = _constants.LIMIT_TYPE.QUOTA_LIMIT;
- var _default2 = createComponent({
- props: {
- sku: Object,
- goods: Object,
- value: Boolean,
- buyText: String,
- goodsId: [Number, String],
- priceTag: String,
- lazyLoad: Boolean,
- hideStock: Boolean,
- properties: Array,
- addCartText: String,
- stepperTitle: String,
- getContainer: [String, Function],
- hideQuotaText: Boolean,
- hideSelectedText: Boolean,
- resetStepperOnHide: Boolean,
- customSkuValidator: Function,
- disableStepperInput: Boolean,
- resetSelectedSkuOnHide: Boolean,
- quota: {
- type: Number,
- default: 0
- },
- quotaUsed: {
- type: Number,
- default: 0
- },
- startSaleNum: {
- type: Number,
- default: 1
- },
- initialSku: {
- type: Object,
- default: function _default() {
- return {};
- }
- },
- stockThreshold: {
- type: Number,
- default: 50
- },
- showSoldoutSku: {
- type: Boolean,
- default: true
- },
- showAddCartBtn: {
- type: Boolean,
- default: true
- },
- disableSoldoutSku: {
- type: Boolean,
- default: true
- },
- customStepperConfig: {
- type: Object,
- default: function _default() {
- return {};
- }
- },
- showHeaderImage: {
- type: Boolean,
- default: true
- },
- previewOnClickImage: {
- type: Boolean,
- default: true
- },
- safeAreaInsetBottom: {
- type: Boolean,
- default: true
- },
- closeOnClickOverlay: {
- type: Boolean,
- default: true
- },
- bodyOffsetTop: {
- type: Number,
- default: 200
- },
- messageConfig: {
- type: Object,
- default: function _default() {
- return {
- initialMessages: {},
- placeholderMap: {},
- uploadImg: function uploadImg() {
- return Promise.resolve();
- },
- uploadMaxSize: 5
- };
- }
- }
- },
- data: function data() {
- return {
- selectedSku: {},
- selectedProp: {},
- selectedNum: 1,
- show: this.value
- };
- },
- watch: {
- show: function show(val) {
- this.$emit('input', val);
- if (!val) {
- this.$emit('sku-close', {
- selectedSkuValues: this.selectedSkuValues,
- selectedNum: this.selectedNum,
- selectedSkuComb: this.selectedSkuComb
- });
- if (this.resetStepperOnHide) {
- this.resetStepper();
- }
- if (this.resetSelectedSkuOnHide) {
- this.resetSelectedSku();
- }
- }
- },
- value: function value(val) {
- this.show = val;
- },
- skuTree: 'resetSelectedSku',
- initialSku: function initialSku() {
- this.resetStepper();
- this.resetSelectedSku();
- }
- },
- computed: {
- skuGroupClass: function skuGroupClass() {
- return ['van-sku-group-container', {
- 'van-sku-group-container--hide-soldout': !this.showSoldoutSku
- }];
- },
- bodyStyle: function bodyStyle() {
- if (this.$isServer) {
- return;
- }
- var maxHeight = window.innerHeight - this.bodyOffsetTop;
- return {
- maxHeight: maxHeight + 'px'
- };
- },
- isSkuCombSelected: function isSkuCombSelected() {
- var _this = this;
- // SKU 未选完
- if (this.hasSku && !(0, _skuHelper.isAllSelected)(this.skuTree, this.selectedSku)) {
- return false;
- } // 属性未全选
- return !this.propList.filter(function (i) {
- return i.is_necessary !== false;
- }).some(function (i) {
- return (_this.selectedProp[i.k_id] || []).length === 0;
- });
- },
- isSkuEmpty: function isSkuEmpty() {
- return Object.keys(this.sku).length === 0;
- },
- hasSku: function hasSku() {
- return !this.sku.none_sku;
- },
- hasSkuOrAttr: function hasSkuOrAttr() {
- return this.hasSku || this.propList.length > 0;
- },
- selectedSkuComb: function selectedSkuComb() {
- var skuComb = null;
- if (this.isSkuCombSelected) {
- if (this.hasSku) {
- skuComb = (0, _skuHelper.getSkuComb)(this.skuList, this.selectedSku);
- } else {
- skuComb = {
- id: this.sku.collection_id,
- price: Math.round(this.sku.price * 100),
- stock_num: this.sku.stock_num
- };
- }
- if (skuComb) {
- skuComb.properties = (0, _skuHelper.getSelectedProperties)(this.propList, this.selectedProp);
- skuComb.property_price = this.selectedPropValues.reduce(function (acc, cur) {
- return acc + (cur.price || 0);
- }, 0);
- }
- }
- return skuComb;
- },
- selectedSkuValues: function selectedSkuValues() {
- return (0, _skuHelper.getSelectedSkuValues)(this.skuTree, this.selectedSku);
- },
- selectedPropValues: function selectedPropValues() {
- return (0, _skuHelper.getSelectedPropValues)(this.propList, this.selectedProp);
- },
- price: function price() {
- if (this.selectedSkuComb) {
- return ((this.selectedSkuComb.price + this.selectedSkuComb.property_price) / 100).toFixed(2);
- } // sku.price是一个格式化好的价格区间
- return this.sku.price;
- },
- originPrice: function originPrice() {
- if (this.selectedSkuComb && this.selectedSkuComb.origin_price) {
- return ((this.selectedSkuComb.origin_price + this.selectedSkuComb.property_price) / 100).toFixed(2);
- }
- return this.sku.origin_price;
- },
- skuTree: function skuTree() {
- return this.sku.tree || [];
- },
- skuList: function skuList() {
- return this.sku.list || [];
- },
- propList: function propList() {
- return this.properties || [];
- },
- imageList: function imageList() {
- var imageList = [this.goods.picture];
- if (this.skuTree.length > 0) {
- this.skuTree.forEach(function (treeItem) {
- if (!treeItem.v) {
- return;
- }
- treeItem.v.forEach(function (vItem) {
- var imgUrl = vItem.previewImgUrl || vItem.imgUrl || vItem.img_url;
- if (imgUrl && imageList.indexOf(imgUrl) === -1) {
- imageList.push(imgUrl);
- }
- });
- });
- }
- return imageList;
- },
- stock: function stock() {
- var stockNum = this.customStepperConfig.stockNum;
- if (stockNum !== undefined) {
- return stockNum;
- }
- if (this.selectedSkuComb) {
- return this.selectedSkuComb.stock_num;
- }
- return this.sku.stock_num;
- },
- stockText: function stockText() {
- var h = this.$createElement;
- var stockFormatter = this.customStepperConfig.stockFormatter;
- if (stockFormatter) {
- return stockFormatter(this.stock);
- }
- return [t('stock') + " ", h("span", {
- "class": bem('stock-num', {
- highlight: this.stock < this.stockThreshold
- })
- }, [this.stock]), " " + t('stockUnit')];
- },
- selectedText: function selectedText() {
- var _this2 = this;
- if (this.selectedSkuComb) {
- var values = this.selectedSkuValues.concat(this.selectedPropValues);
- return t('selected') + " " + values.map(function (item) {
- return item.name;
- }).join(' ');
- }
- var unselectedSku = this.skuTree.filter(function (item) {
- return _this2.selectedSku[item.k_s] === _constants.UNSELECTED_SKU_VALUE_ID;
- }).map(function (item) {
- return item.k;
- });
- var unselectedProp = this.propList.filter(function (item) {
- return (_this2.selectedProp[item.k_id] || []).length < 1;
- }).map(function (item) {
- return item.k;
- });
- return t('select') + " " + unselectedSku.concat(unselectedProp).join(' ');
- }
- },
- created: function created() {
- var skuEventBus = new _vue.default();
- this.skuEventBus = skuEventBus;
- skuEventBus.$on('sku:select', this.onSelect);
- skuEventBus.$on('sku:propSelect', this.onPropSelect);
- skuEventBus.$on('sku:numChange', this.onNumChange);
- skuEventBus.$on('sku:previewImage', this.onPreviewImage);
- skuEventBus.$on('sku:overLimit', this.onOverLimit);
- skuEventBus.$on('sku:stepperState', this.onStepperState);
- skuEventBus.$on('sku:addCart', this.onAddCart);
- skuEventBus.$on('sku:buy', this.onBuy);
- this.resetStepper();
- this.resetSelectedSku(); // 组件初始化后的钩子,抛出skuEventBus
- this.$emit('after-sku-create', skuEventBus);
- },
- methods: {
- resetStepper: function resetStepper() {
- var skuStepper = this.$refs.skuStepper;
- var selectedNum = this.initialSku.selectedNum;
- var num = selectedNum != null ? selectedNum : this.startSaleNum; // 用来缓存不合法的情况
- this.stepperError = null;
- if (skuStepper) {
- skuStepper.setCurrentNum(num);
- } else {
- // 当首次加载(skuStepper 为空)时,传入数量如果不合法,可能会存在问题
- this.selectedNum = num;
- }
- },
- // @exposed-api
- resetSelectedSku: function resetSelectedSku() {
- var _this3 = this;
- this.selectedSku = {}; // 重置 selectedSku
- this.skuTree.forEach(function (item) {
- _this3.selectedSku[item.k_s] = _constants.UNSELECTED_SKU_VALUE_ID;
- });
- this.skuTree.forEach(function (item) {
- var key = item.k_s; // 规格值只有1个时,优先判断
- var valueId = item.v.length === 1 ? item.v[0].id : _this3.initialSku[key];
- if (valueId && (0, _skuHelper.isSkuChoosable)(_this3.skuList, _this3.selectedSku, {
- key: key,
- valueId: valueId
- })) {
- _this3.selectedSku[key] = valueId;
- }
- });
- var skuValues = this.selectedSkuValues;
- if (skuValues.length > 0) {
- this.$nextTick(function () {
- _this3.$emit('sku-selected', {
- skuValue: skuValues[skuValues.length - 1],
- selectedSku: _this3.selectedSku,
- selectedSkuComb: _this3.selectedSkuComb
- });
- });
- } // 重置商品属性
- this.selectedProp = {};
- var _this$initialSku$sele = this.initialSku.selectedProp,
- selectedProp = _this$initialSku$sele === void 0 ? {} : _this$initialSku$sele; // 选中外部传入信息
- this.propList.forEach(function (item) {
- if (selectedProp[item.k_id]) {
- _this3.selectedProp[item.k_id] = selectedProp[item.k_id];
- }
- });
- if ((0, _utils.isEmpty)(this.selectedProp)) {
- this.propList.forEach(function (item) {
- var _item$v;
- // 没有加价的属性,默认选中第一个
- if ((item == null ? void 0 : (_item$v = item.v) == null ? void 0 : _item$v.length) > 0) {
- var v = item.v,
- k_id = item.k_id;
- var isHasConfigPrice = v.some(function (i) {
- return +i.price !== 0;
- }); // 没有加价属性
- if (!isHasConfigPrice) {
- // 找到第一个不被禁用的属性
- // 历史如果没有 text_status 字段的,就相当于沿用直接原来的逻辑取第一个属性
- var firstEnableProp = v.find(function (prop) {
- return prop.text_status !== 0;
- });
- if (firstEnableProp) {
- _this3.selectedProp[k_id] = [firstEnableProp.id];
- }
- }
- }
- });
- }
- var propValues = this.selectedPropValues;
- if (propValues.length > 0) {
- this.$emit('sku-prop-selected', {
- propValue: propValues[propValues.length - 1],
- selectedProp: this.selectedProp,
- selectedSkuComb: this.selectedSkuComb
- });
- } // 抛出重置事件
- this.$emit('sku-reset', {
- selectedSku: this.selectedSku,
- selectedProp: this.selectedProp,
- selectedSkuComb: this.selectedSkuComb
- });
- this.centerInitialSku();
- },
- getSkuMessages: function getSkuMessages() {
- return this.$refs.skuMessages ? this.$refs.skuMessages.getMessages() : {};
- },
- getSkuCartMessages: function getSkuCartMessages() {
- return this.$refs.skuMessages ? this.$refs.skuMessages.getCartMessages() : {};
- },
- validateSkuMessages: function validateSkuMessages() {
- return this.$refs.skuMessages ? this.$refs.skuMessages.validateMessages() : '';
- },
- validateSku: function validateSku() {
- if (this.selectedNum === 0) {
- return t('unavailable');
- }
- if (this.isSkuCombSelected) {
- return this.validateSkuMessages();
- } // 自定义sku校验
- if (this.customSkuValidator) {
- var err = this.customSkuValidator(this);
- if (err) return err;
- }
- return t('selectSku');
- },
- onSelect: function onSelect(skuValue) {
- var _extends2, _extends3;
- // 点击已选中的sku时则取消选中
- this.selectedSku = this.selectedSku[skuValue.skuKeyStr] === skuValue.id ? (0, _extends5.default)({}, this.selectedSku, (_extends2 = {}, _extends2[skuValue.skuKeyStr] = _constants.UNSELECTED_SKU_VALUE_ID, _extends2)) : (0, _extends5.default)({}, this.selectedSku, (_extends3 = {}, _extends3[skuValue.skuKeyStr] = skuValue.id, _extends3));
- this.$emit('sku-selected', {
- skuValue: skuValue,
- selectedSku: this.selectedSku,
- selectedSkuComb: this.selectedSkuComb
- });
- },
- onPropSelect: function onPropSelect(propValue) {
- var _extends4;
- var arr = this.selectedProp[propValue.skuKeyStr] || [];
- var pos = arr.indexOf(propValue.id);
- if (pos > -1) {
- arr.splice(pos, 1);
- } else if (propValue.multiple) {
- arr.push(propValue.id);
- } else {
- arr.splice(0, 1, propValue.id);
- }
- this.selectedProp = (0, _extends5.default)({}, this.selectedProp, (_extends4 = {}, _extends4[propValue.skuKeyStr] = arr, _extends4));
- this.$emit('sku-prop-selected', {
- propValue: propValue,
- selectedProp: this.selectedProp,
- selectedSkuComb: this.selectedSkuComb
- });
- },
- onNumChange: function onNumChange(num) {
- this.selectedNum = num;
- },
- onPreviewImage: function onPreviewImage(selectedValue) {
- var _this4 = this;
- var imageList = this.imageList;
- var index = 0;
- var indexImage = imageList[0];
- if (selectedValue && selectedValue.imgUrl) {
- this.imageList.some(function (image, pos) {
- if (image === selectedValue.imgUrl) {
- index = pos;
- return true;
- }
- return false;
- });
- indexImage = selectedValue.imgUrl;
- }
- var params = (0, _extends5.default)({}, selectedValue, {
- index: index,
- imageList: this.imageList,
- indexImage: indexImage
- });
- this.$emit('open-preview', params);
- if (!this.previewOnClickImage) {
- return;
- }
- (0, _imagePreview.default)({
- images: this.imageList,
- startPosition: index,
- onClose: function onClose() {
- _this4.$emit('close-preview', params);
- }
- });
- },
- onOverLimit: function onOverLimit(data) {
- var action = data.action,
- limitType = data.limitType,
- quota = data.quota,
- quotaUsed = data.quotaUsed;
- var handleOverLimit = this.customStepperConfig.handleOverLimit;
- if (handleOverLimit) {
- handleOverLimit(data);
- return;
- }
- if (action === 'minus') {
- if (this.startSaleNum > 1) {
- (0, _toast.default)(t('minusStartTip', this.startSaleNum));
- } else {
- (0, _toast.default)(t('minusTip'));
- }
- } else if (action === 'plus') {
- if (limitType === QUOTA_LIMIT) {
- if (quotaUsed > 0) {
- (0, _toast.default)(t('quotaUsedTip', quota, quotaUsed));
- } else {
- (0, _toast.default)(t('quotaTip', quota));
- }
- } else {
- (0, _toast.default)(t('soldout'));
- }
- }
- },
- onStepperState: function onStepperState(data) {
- this.stepperError = data.valid ? null : (0, _extends5.default)({}, data, {
- action: 'plus'
- });
- },
- onAddCart: function onAddCart() {
- this.onBuyOrAddCart('add-cart');
- },
- onBuy: function onBuy() {
- this.onBuyOrAddCart('buy-clicked');
- },
- onBuyOrAddCart: function onBuyOrAddCart(type) {
- // sku 不符合购买条件
- if (this.stepperError) {
- return this.onOverLimit(this.stepperError);
- }
- var error = this.validateSku();
- if (error) {
- (0, _toast.default)(error);
- } else {
- this.$emit(type, this.getSkuData());
- }
- },
- // @exposed-api
- getSkuData: function getSkuData() {
- return {
- goodsId: this.goodsId,
- messages: this.getSkuMessages(),
- selectedNum: this.selectedNum,
- cartMessages: this.getSkuCartMessages(),
- selectedSkuComb: this.selectedSkuComb
- };
- },
- // 当 popup 完全打开后执行
- onOpened: function onOpened() {
- this.centerInitialSku();
- },
- centerInitialSku: function centerInitialSku() {
- var _this5 = this;
- (this.$refs.skuRows || []).forEach(function (it) {
- var _ref = it.skuRow || {},
- k_s = _ref.k_s;
- it.centerItem(_this5.initialSku[k_s]);
- });
- }
- },
- render: function render() {
- var _this6 = this;
- var h = arguments[0];
- if (this.isSkuEmpty) {
- return;
- }
- var sku = this.sku,
- skuList = this.skuList,
- goods = this.goods,
- price = this.price,
- lazyLoad = this.lazyLoad,
- originPrice = this.originPrice,
- skuEventBus = this.skuEventBus,
- selectedSku = this.selectedSku,
- selectedProp = this.selectedProp,
- selectedNum = this.selectedNum,
- stepperTitle = this.stepperTitle,
- selectedSkuComb = this.selectedSkuComb,
- showHeaderImage = this.showHeaderImage,
- disableSoldoutSku = this.disableSoldoutSku;
- var slotsProps = {
- price: price,
- originPrice: originPrice,
- selectedNum: selectedNum,
- skuEventBus: skuEventBus,
- selectedSku: selectedSku,
- selectedSkuComb: selectedSkuComb
- };
- var slots = function slots(name) {
- return _this6.slots(name, slotsProps);
- };
- var Header = slots('sku-header') || h(_SkuHeader.default, {
- "attrs": {
- "sku": sku,
- "goods": goods,
- "skuEventBus": skuEventBus,
- "selectedSku": selectedSku,
- "showHeaderImage": showHeaderImage
- }
- }, [h("template", {
- "slot": "sku-header-image-extra"
- }, [slots('sku-header-image-extra')]), slots('sku-header-price') || h("div", {
- "class": "van-sku__goods-price"
- }, [h("span", {
- "class": "van-sku__price-symbol"
- }, ["\uFFE5"]), h("span", {
- "class": "van-sku__price-num"
- }, [price]), this.priceTag && h("span", {
- "class": "van-sku__price-tag"
- }, [this.priceTag])]), slots('sku-header-origin-price') || originPrice && h(_SkuHeaderItem.default, [t('originPrice'), " \uFFE5", originPrice]), !this.hideStock && h(_SkuHeaderItem.default, [h("span", {
- "class": "van-sku__stock"
- }, [this.stockText])]), this.hasSkuOrAttr && !this.hideSelectedText && h(_SkuHeaderItem.default, [this.selectedText]), slots('sku-header-extra')]);
- var Group = slots('sku-group') || this.hasSkuOrAttr && h("div", {
- "class": this.skuGroupClass
- }, [this.skuTree.map(function (skuTreeItem) {
- return h(_SkuRow.default, {
- "attrs": {
- "skuRow": skuTreeItem
- },
- "ref": "skuRows",
- "refInFor": true
- }, [skuTreeItem.v.map(function (skuValue) {
- return h(_SkuRowItem.default, {
- "attrs": {
- "skuList": skuList,
- "lazyLoad": lazyLoad,
- "skuValue": skuValue,
- "skuKeyStr": skuTreeItem.k_s,
- "selectedSku": selectedSku,
- "skuEventBus": skuEventBus,
- "disableSoldoutSku": disableSoldoutSku,
- "largeImageMode": skuTreeItem.largeImageMode
- }
- });
- })]);
- }), this.propList.map(function (skuTreeItem) {
- return h(_SkuRow.default, {
- "attrs": {
- "skuRow": skuTreeItem
- }
- }, [skuTreeItem.v.map(function (skuValue) {
- return h(_SkuRowPropItem.default, {
- "attrs": {
- "skuValue": skuValue,
- "skuKeyStr": skuTreeItem.k_id + '',
- "selectedProp": selectedProp,
- "skuEventBus": skuEventBus,
- "multiple": skuTreeItem.is_multiple,
- "disabled": skuValue.text_status === 0
- }
- });
- })]);
- })]);
- var Stepper = slots('sku-stepper') || h(_SkuStepper.default, {
- "ref": "skuStepper",
- "attrs": {
- "stock": this.stock,
- "quota": this.quota,
- "quotaUsed": this.quotaUsed,
- "startSaleNum": this.startSaleNum,
- "skuEventBus": skuEventBus,
- "selectedNum": selectedNum,
- "stepperTitle": stepperTitle,
- "skuStockNum": sku.stock_num,
- "disableStepperInput": this.disableStepperInput,
- "customStepperConfig": this.customStepperConfig,
- "hideQuotaText": this.hideQuotaText
- },
- "on": {
- "change": function change(event) {
- _this6.$emit('stepper-change', event);
- }
- }
- });
- var Messages = slots('sku-messages') || h(_SkuMessages.default, {
- "ref": "skuMessages",
- "attrs": {
- "goodsId": this.goodsId,
- "messageConfig": this.messageConfig,
- "messages": sku.messages
- }
- });
- var Actions = slots('sku-actions') || h(_SkuActions.default, {
- "attrs": {
- "buyText": this.buyText,
- "skuEventBus": skuEventBus,
- "addCartText": this.addCartText,
- "showAddCartBtn": this.showAddCartBtn
- }
- });
- return h(_popup.default, {
- "attrs": {
- "round": true,
- "closeable": true,
- "position": "bottom",
- "getContainer": this.getContainer,
- "closeOnClickOverlay": this.closeOnClickOverlay,
- "safeAreaInsetBottom": this.safeAreaInsetBottom
- },
- "class": "van-sku-container",
- "on": {
- "opened": this.onOpened
- },
- "model": {
- value: _this6.show,
- callback: function callback($$v) {
- _this6.show = $$v;
- }
- }
- }, [Header, h("div", {
- "class": "van-sku-body",
- "style": this.bodyStyle
- }, [slots('sku-body-top'), Group, slots('extra-sku-group'), Stepper, slots('before-sku-messages'), Messages, slots('after-sku-messages')]), slots('sku-actions-top'), Actions]);
- }
- });
- exports.default = _default2;
|