73 lines
2.4 KiB
JavaScript
73 lines
2.4 KiB
JavaScript
"use strict";
|
|
const common_vendor = require("../../common/vendor.js");
|
|
class CaseItem extends UTS.UTSType {
|
|
static get$UTSMetadata$() {
|
|
return {
|
|
kind: 2,
|
|
get fields() {
|
|
return {
|
|
id: { type: String, optional: false },
|
|
title: { type: String, optional: false },
|
|
category: { type: String, optional: false },
|
|
categoryName: { type: String, optional: false },
|
|
coverImage: { type: String, optional: false },
|
|
material: { type: String, optional: false },
|
|
duration: { type: String, optional: false },
|
|
price: { type: String, optional: false },
|
|
views: { type: Number, optional: false },
|
|
likes: { type: Number, optional: false }
|
|
};
|
|
},
|
|
name: "CaseItem"
|
|
};
|
|
}
|
|
constructor(options, metadata = CaseItem.get$UTSMetadata$(), isJSONParse = false) {
|
|
super();
|
|
this.__props__ = UTS.UTSType.initProps(options, metadata, isJSONParse);
|
|
this.id = this.__props__.id;
|
|
this.title = this.__props__.title;
|
|
this.category = this.__props__.category;
|
|
this.categoryName = this.__props__.categoryName;
|
|
this.coverImage = this.__props__.coverImage;
|
|
this.material = this.__props__.material;
|
|
this.duration = this.__props__.duration;
|
|
this.price = this.__props__.price;
|
|
this.views = this.__props__.views;
|
|
this.likes = this.__props__.likes;
|
|
delete this.__props__;
|
|
}
|
|
}
|
|
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
|
|
__name: "case-card",
|
|
props: {
|
|
caseData: {}
|
|
},
|
|
emits: ["click"],
|
|
setup(__props, _a) {
|
|
var __emit = _a.emit;
|
|
const props = __props;
|
|
const emit = __emit;
|
|
const handleClick = () => {
|
|
emit("click", props.caseData.id);
|
|
};
|
|
return (_ctx, _cache) => {
|
|
"raw js";
|
|
const __returned__ = {
|
|
a: _ctx.caseData.coverImage,
|
|
b: common_vendor.t(_ctx.caseData.categoryName),
|
|
c: common_vendor.t(_ctx.caseData.title),
|
|
d: common_vendor.t(_ctx.caseData.material),
|
|
e: common_vendor.t(_ctx.caseData.duration),
|
|
f: common_vendor.t(_ctx.caseData.price),
|
|
g: common_vendor.t(_ctx.caseData.views),
|
|
h: common_vendor.t(_ctx.caseData.likes),
|
|
i: common_vendor.sei(common_vendor.gei(_ctx, ""), "view"),
|
|
j: common_vendor.o(handleClick)
|
|
};
|
|
return __returned__;
|
|
};
|
|
}
|
|
});
|
|
wx.createComponent(_sfc_main);
|
|
//# sourceMappingURL=../../../.sourcemap/mp-weixin/components/case-card/case-card.js.map
|