Files
ShaFaFanXin/前端/unpackage/dist/dev/mp-weixin/pages/service/index.js
2026-01-27 18:06:04 +08:00

277 lines
9.5 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

"use strict";
const common_vendor = require("../../common/vendor.js");
const api_index = require("../../api/index.js");
if (!Array) {
const _easycom_section_header_1 = common_vendor.resolveComponent("section-header");
_easycom_section_header_1();
}
const _easycom_section_header = () => "../../components/section-header/section-header.js";
if (!Math) {
_easycom_section_header();
}
class ServiceType extends UTS.UTSType {
static get$UTSMetadata$() {
return {
kind: 2,
get fields() {
return {
id: { type: String, optional: false },
name: { type: String, optional: false },
desc: { type: String, optional: false },
emoji: { type: String, optional: false }
};
},
name: "ServiceType"
};
}
constructor(options, metadata = ServiceType.get$UTSMetadata$(), isJSONParse = false) {
super();
this.__props__ = UTS.UTSType.initProps(options, metadata, isJSONParse);
this.id = this.__props__.id;
this.name = this.__props__.name;
this.desc = this.__props__.desc;
this.emoji = this.__props__.emoji;
delete this.__props__;
}
}
class ProcessItem extends UTS.UTSType {
static get$UTSMetadata$() {
return {
kind: 2,
get fields() {
return {
step: { type: Number, optional: false },
title: { type: String, optional: false },
description: { type: String, optional: false }
};
},
name: "ProcessItem"
};
}
constructor(options, metadata = ProcessItem.get$UTSMetadata$(), isJSONParse = false) {
super();
this.__props__ = UTS.UTSType.initProps(options, metadata, isJSONParse);
this.step = this.__props__.step;
this.title = this.__props__.title;
this.description = this.__props__.description;
delete this.__props__;
}
}
class MaterialItem extends UTS.UTSType {
static get$UTSMetadata$() {
return {
kind: 2,
get fields() {
return {
name: { type: String, optional: false },
price: { type: String, optional: false },
desc: { type: String, optional: false },
tags: { type: UTS.UTSType.withGenerics(Array, [String]), optional: false }
};
},
name: "MaterialItem"
};
}
constructor(options, metadata = MaterialItem.get$UTSMetadata$(), isJSONParse = false) {
super();
this.__props__ = UTS.UTSType.initProps(options, metadata, isJSONParse);
this.name = this.__props__.name;
this.price = this.__props__.price;
this.desc = this.__props__.desc;
this.tags = this.__props__.tags;
delete this.__props__;
}
}
class FaqItem extends UTS.UTSType {
static get$UTSMetadata$() {
return {
kind: 2,
get fields() {
return {
question: { type: String, optional: false },
answer: { type: String, optional: false },
expanded: { type: Boolean, optional: false }
};
},
name: "FaqItem"
};
}
constructor(options, metadata = FaqItem.get$UTSMetadata$(), isJSONParse = false) {
super();
this.__props__ = UTS.UTSType.initProps(options, metadata, isJSONParse);
this.question = this.__props__.question;
this.answer = this.__props__.answer;
this.expanded = this.__props__.expanded;
delete this.__props__;
}
}
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
__name: "index",
setup(__props) {
const serviceTypes = common_vendor.ref([
new ServiceType({ id: "repair", name: "局部修复", desc: "破损、划痕修复", emoji: "🔧" }),
new ServiceType({ id: "recolor", name: "改色翻新", desc: "皮面改色换新", emoji: "🎨" }),
new ServiceType({ id: "refurbish", name: "整体翻新", desc: "全面翻新升级", emoji: "✨" }),
new ServiceType({ id: "custom", name: "定制换皮", desc: "个性化定制", emoji: "💎" })
]);
const processList = common_vendor.ref([]);
const materials = common_vendor.ref([
new MaterialItem({
name: "头层牛皮",
price: "¥800-1500/平",
desc: "采用进口头层牛皮,质地柔软,透气性好,使用寿命长",
tags: ["进口原料", "透气舒适", "耐用耐磨"]
}),
new MaterialItem({
name: "二层牛皮",
price: "¥400-800/平",
desc: "经济实惠的选择,经过特殊处理后外观与头层相近",
tags: ["性价比高", "外观精美", "易打理"]
}),
new MaterialItem({
name: "科技布",
price: "¥200-500/平",
desc: "新型环保面料,防水防污,清洁方便,触感舒适",
tags: ["防水防污", "易清洁", "环保健康"]
}),
new MaterialItem({
name: "棉麻布艺",
price: "¥150-400/平",
desc: "天然面料,透气舒适,适合追求自然风格的客户",
tags: ["天然环保", "透气清爽", "风格多样"]
})
]);
const faqList = common_vendor.ref([
new FaqItem({
question: "翻新需要多长时间?",
answer: "根据沙发的大小和翻新程度不同一般需要3-10个工作日。局部修复1-3天整体翻新5-10天。",
expanded: false
}),
new FaqItem({
question: "翻新后能保证多久?",
answer: "我们提供2年质保服务质保期内如有非人为损坏免费维修。头层牛皮正常使用可达10年以上。",
expanded: false
}),
new FaqItem({
question: "可以上门取送吗?",
answer: "是的,我们提供免费上门取送服务(市区范围内),郊区会收取少量运输费用。",
expanded: false
}),
new FaqItem({
question: "如何报价?",
answer: "我们提供免费上门评估服务,师傅会根据沙发的实际情况给出详细报价,价格透明无隐形消费。",
expanded: false
}),
new FaqItem({
question: "定金和尾款如何支付?",
answer: "确认订单后支付30%定金,翻新完成验收满意后支付尾款。支持微信、支付宝、银行转账等多种方式。",
expanded: false
})
]);
const fetchServiceProcess = () => {
return common_vendor.__awaiter(this, void 0, void 0, function* () {
try {
const res = yield api_index.getServiceProcess();
const data = res.data;
processList.value = data.map((item) => {
return new ProcessItem({
step: item["step"],
title: item["title"],
description: item["description"]
});
});
} catch (e) {
common_vendor.index.__f__("error", "at pages/service/index.uvue:217", "获取服务流程失败", e);
}
});
};
const toggleFaq = (index) => {
faqList.value[index].expanded = !faqList.value[index].expanded;
};
const handleServiceClick = (item) => {
common_vendor.index.navigateTo({
url: "/pages/booking/index"
});
};
const goToBooking = () => {
common_vendor.index.navigateTo({
url: "/pages/booking/index"
});
};
common_vendor.onLoad(() => {
fetchServiceProcess();
});
return (_ctx, _cache) => {
"raw js";
const __returned__ = {
a: common_vendor.p({
title: "服务类型"
}),
b: common_vendor.f(common_vendor.unref(serviceTypes), (item, k0, i0) => {
return {
a: common_vendor.t(item.emoji),
b: common_vendor.t(item.name),
c: common_vendor.t(item.desc),
d: item.id,
e: common_vendor.o(($event) => {
return handleServiceClick();
}, item.id)
};
}),
c: common_vendor.p({
title: "服务流程"
}),
d: common_vendor.f(common_vendor.unref(processList), (item, index, i0) => {
return common_vendor.e({
a: common_vendor.t(item.step),
b: common_vendor.t(item.title),
c: common_vendor.t(item.description),
d: index < common_vendor.unref(processList).length - 1
}, index < common_vendor.unref(processList).length - 1 ? {} : {}, {
e: item.step
});
}),
e: common_vendor.p({
title: "材质说明"
}),
f: common_vendor.f(common_vendor.unref(materials), (item, k0, i0) => {
return {
a: common_vendor.t(item.name),
b: common_vendor.t(item.price),
c: common_vendor.t(item.desc),
d: common_vendor.f(item.tags, (tag, k1, i1) => {
return {
a: common_vendor.t(tag),
b: tag
};
}),
e: item.name
};
}),
g: common_vendor.p({
title: "常见问题"
}),
h: common_vendor.f(common_vendor.unref(faqList), (item, index, i0) => {
return common_vendor.e({
a: common_vendor.t(item.question),
b: common_vendor.t(item.expanded ? "" : "+"),
c: item.expanded
}, item.expanded ? {
d: common_vendor.t(item.answer)
} : {}, {
e: index,
f: common_vendor.o(($event) => {
return toggleFaq(index);
}, index)
});
}),
i: common_vendor.o(goToBooking),
j: common_vendor.sei(common_vendor.gei(_ctx, ""), "view")
};
return __returned__;
};
}
});
wx.createPage(_sfc_main);
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/service/index.js.map