53 lines
2.2 KiB
JavaScript
53 lines
2.2 KiB
JavaScript
|
"use strict";
|
||
|
const common_vendor = require("../../../common/vendor.js");
|
||
|
const sheep_index = require("../../index.js");
|
||
|
const sheep_hooks_useGoods = require("../../hooks/useGoods.js");
|
||
|
const _sfc_main = {
|
||
|
__name: "s-wallet-card",
|
||
|
props: {
|
||
|
// 装修数据
|
||
|
data: {
|
||
|
type: Object,
|
||
|
default: () => ({})
|
||
|
},
|
||
|
// 装修样式
|
||
|
styles: {
|
||
|
type: Object,
|
||
|
default: () => ({})
|
||
|
}
|
||
|
},
|
||
|
setup(__props) {
|
||
|
const props = __props;
|
||
|
const bgStyle = common_vendor.computed(() => {
|
||
|
const { bgType, bgImg, bgColor } = props.styles;
|
||
|
return {
|
||
|
background: bgType === "img" ? `url(${bgImg}) no-repeat top center / 100% 100%` : bgColor
|
||
|
};
|
||
|
});
|
||
|
const userWallet = common_vendor.computed(() => sheep_index.sheep.$store("user").userWallet);
|
||
|
const userInfo = common_vendor.computed(() => sheep_index.sheep.$store("user").userInfo);
|
||
|
const numData = common_vendor.computed(() => sheep_index.sheep.$store("user").numData);
|
||
|
return (_ctx, _cache) => {
|
||
|
return {
|
||
|
a: common_vendor.t(common_vendor.unref(sheep_hooks_useGoods.fen2yuan)(userWallet.value.balance) || "0.00"),
|
||
|
b: common_vendor.o(($event) => common_vendor.unref(sheep_index.sheep).$router.go("/modules/mall/user/wallet/money")),
|
||
|
c: common_vendor.t(userInfo.value.point || 0),
|
||
|
d: common_vendor.o(($event) => common_vendor.unref(sheep_index.sheep).$router.go("/modules/mall/user/wallet/score")),
|
||
|
e: common_vendor.t(numData.value.unusedCouponCount),
|
||
|
f: common_vendor.o(($event) => common_vendor.unref(sheep_index.sheep).$router.go("/modules/mall/coupon/list", {
|
||
|
type: "geted"
|
||
|
})),
|
||
|
g: common_vendor.unref(sheep_index.sheep).$url.static("/static/img/shop/user/wallet_icon.png"),
|
||
|
h: common_vendor.o(($event) => common_vendor.unref(sheep_index.sheep).$router.go("/modules/mall/user/wallet/money")),
|
||
|
i: common_vendor.s(bgStyle.value),
|
||
|
j: common_vendor.s({
|
||
|
marginLeft: `${__props.data.space}px`
|
||
|
})
|
||
|
};
|
||
|
};
|
||
|
}
|
||
|
};
|
||
|
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-d1b74d4f"]]);
|
||
|
wx.createComponent(Component);
|
||
|
//# sourceMappingURL=s-wallet-card.js.map
|