92 lines
2.7 KiB
JavaScript
92 lines
2.7 KiB
JavaScript
|
"use strict";
|
||
|
const common_vendor = require("../../../common/vendor.js");
|
||
|
const sheep_index = require("../../index.js");
|
||
|
if (!Array) {
|
||
|
const _easycom_su_popup2 = common_vendor.resolveComponent("su-popup");
|
||
|
_easycom_su_popup2();
|
||
|
}
|
||
|
const _easycom_su_popup = () => "../../ui/su-popup/su-popup.js";
|
||
|
if (!Math) {
|
||
|
_easycom_su_popup();
|
||
|
}
|
||
|
const _sfc_main = {
|
||
|
__name: "s-discount-list",
|
||
|
props: {
|
||
|
promoInfo: {
|
||
|
type: Array,
|
||
|
default: () => []
|
||
|
},
|
||
|
goodsList: {
|
||
|
type: Array,
|
||
|
default: () => []
|
||
|
},
|
||
|
modelValue: {
|
||
|
type: Object,
|
||
|
default() {
|
||
|
}
|
||
|
},
|
||
|
show: {
|
||
|
type: Boolean,
|
||
|
default: false
|
||
|
}
|
||
|
},
|
||
|
emits: ["close"],
|
||
|
setup(__props, { emit: __emit }) {
|
||
|
const props = __props;
|
||
|
const emits = __emit;
|
||
|
const state = common_vendor.reactive({
|
||
|
orderInfo: common_vendor.computed(() => props.modelValue)
|
||
|
});
|
||
|
const getGoodsImg = (e) => {
|
||
|
let goodsImg = "";
|
||
|
state.orderInfo.goods_list.forEach((i) => {
|
||
|
if (e == i.goods_id) {
|
||
|
goodsImg = i.goods.image;
|
||
|
}
|
||
|
});
|
||
|
return goodsImg;
|
||
|
};
|
||
|
return (_ctx, _cache) => {
|
||
|
return {
|
||
|
a: common_vendor.f(state.orderInfo.promo_infos, (item, index, i0) => {
|
||
|
return common_vendor.e({
|
||
|
a: common_vendor.t(item.goods_ids.length),
|
||
|
b: item.activity_type === "full_discount"
|
||
|
}, item.activity_type === "full_discount" ? {
|
||
|
c: common_vendor.t(item.discount_rule.full),
|
||
|
d: common_vendor.t(item.discount_rule.discount)
|
||
|
} : {}, {
|
||
|
e: item.activity_type === "full_gift"
|
||
|
}, item.activity_type === "full_gift" ? {} : {}, {
|
||
|
f: item.activity_type === "full_reduce"
|
||
|
}, item.activity_type === "full_reduce" ? {
|
||
|
g: common_vendor.t(item.discount_rule.full),
|
||
|
h: common_vendor.t(item.discount_rule.discount)
|
||
|
} : {}, {
|
||
|
i: common_vendor.t(item.promo_discount_money || "0.00"),
|
||
|
j: common_vendor.f(item.goods_ids, (i, k1, i1) => {
|
||
|
return {
|
||
|
a: common_vendor.unref(sheep_index.sheep).$url.cdn(getGoodsImg(i)),
|
||
|
b: i
|
||
|
};
|
||
|
}),
|
||
|
k: index
|
||
|
});
|
||
|
}),
|
||
|
b: common_vendor.o(($event) => emits("close")),
|
||
|
c: common_vendor.o(($event) => emits("close")),
|
||
|
d: common_vendor.p({
|
||
|
show: __props.show,
|
||
|
type: "bottom",
|
||
|
round: "20",
|
||
|
showClose: true,
|
||
|
backgroundColor: "#f2f2f2"
|
||
|
})
|
||
|
};
|
||
|
};
|
||
|
}
|
||
|
};
|
||
|
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-cff21bac"]]);
|
||
|
wx.createComponent(Component);
|
||
|
//# sourceMappingURL=s-discount-list.js.map
|