feat:"完成页面接口的对接"
This commit is contained in:
@@ -15,10 +15,12 @@ class ServiceType extends UTS.UTSType {
|
||||
kind: 2,
|
||||
get fields() {
|
||||
return {
|
||||
id: { type: String, optional: false },
|
||||
id: { type: Number, optional: false },
|
||||
name: { type: String, optional: false },
|
||||
desc: { type: String, optional: false },
|
||||
emoji: { type: String, optional: false }
|
||||
emoji: { type: String, optional: false },
|
||||
type: { type: String, optional: false },
|
||||
basePrice: { type: Number, optional: false }
|
||||
};
|
||||
},
|
||||
name: "ServiceType"
|
||||
@@ -31,6 +33,8 @@ class ServiceType extends UTS.UTSType {
|
||||
this.name = this.__props__.name;
|
||||
this.desc = this.__props__.desc;
|
||||
this.emoji = this.__props__.emoji;
|
||||
this.type = this.__props__.type;
|
||||
this.basePrice = this.__props__.basePrice;
|
||||
delete this.__props__;
|
||||
}
|
||||
}
|
||||
@@ -108,13 +112,14 @@ class FaqItem extends UTS.UTSType {
|
||||
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 serviceTypes = common_vendor.ref([]);
|
||||
const processList = common_vendor.ref([
|
||||
new ProcessItem({ step: 1, title: "在线预约", description: "填写信息,预约上门时间" }),
|
||||
new ProcessItem({ step: 2, title: "上门评估", description: "专业师傅免费上门勘察" }),
|
||||
new ProcessItem({ step: 3, title: "确认方案", description: "沟通翻新方案和价格" }),
|
||||
new ProcessItem({ step: 4, title: "取件翻新", description: "取回沙发进行专业翻新" }),
|
||||
new ProcessItem({ step: 5, title: "送货验收", description: "送货上门,满意付款" })
|
||||
]);
|
||||
const processList = common_vendor.ref([]);
|
||||
const materials = common_vendor.ref([
|
||||
new MaterialItem({
|
||||
name: "头层牛皮",
|
||||
@@ -168,23 +173,41 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
|
||||
expanded: false
|
||||
})
|
||||
]);
|
||||
const fetchServiceProcess = () => {
|
||||
const fetchServices = () => {
|
||||
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"]
|
||||
const res = yield api_index.getActiveServices();
|
||||
if (res.code == 0 && res.data != null) {
|
||||
const data = res.data;
|
||||
const list = data["list"] || [];
|
||||
const emojiMap = new UTSJSONObject({
|
||||
fabric: "🛋️",
|
||||
leather: "💺",
|
||||
cleaning: "✨",
|
||||
repair: "🔧",
|
||||
custom: "💎"
|
||||
});
|
||||
});
|
||||
serviceTypes.value = list.map((item) => {
|
||||
const type = item["type"];
|
||||
return new ServiceType({
|
||||
id: item["id"],
|
||||
name: item["name"],
|
||||
desc: item["description"],
|
||||
emoji: emojiMap[type] || "🛋️",
|
||||
type,
|
||||
basePrice: item["basePrice"]
|
||||
});
|
||||
});
|
||||
}
|
||||
} catch (e) {
|
||||
common_vendor.index.__f__("error", "at pages/service/index.uvue:217", "获取服务流程失败", e);
|
||||
common_vendor.index.__f__("error", "at pages/service/index.uvue:237", "获取服务列表失败", e);
|
||||
}
|
||||
});
|
||||
};
|
||||
const fetchServiceProcess = () => {
|
||||
return common_vendor.__awaiter(this, void 0, void 0, function* () {
|
||||
});
|
||||
};
|
||||
const toggleFaq = (index) => {
|
||||
faqList.value[index].expanded = !faqList.value[index].expanded;
|
||||
};
|
||||
@@ -199,6 +222,7 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
|
||||
});
|
||||
};
|
||||
common_vendor.onLoad(() => {
|
||||
fetchServices();
|
||||
fetchServiceProcess();
|
||||
});
|
||||
return (_ctx, _cache) => {
|
||||
|
||||
@@ -1 +1 @@
|
||||
<view id="{{j}}" change:eS="{{uV.sS}}" eS="{{$eS[j]}}" change:eA="{{uV.sA}}" eA="{{$eA[j]}}" class="{{['page', virtualHostClass]}}" style="{{virtualHostStyle}}" hidden="{{virtualHostHidden || false}}"><scroll-view class="page-scroll" scroll-y enable-flex="true" enhanced="true"><view class="banner"><view class="banner-content"><text class="banner-title">专业沙发翻新服务</text><text class="banner-desc">让旧沙发焕发新生</text></view></view><view class="section"><section-header u-i="7558dcb8-0" bind:__l="__l" u-p="{{a||''}}"></section-header><view class="service-grid"><view wx:for="{{b}}" wx:for-item="item" wx:key="d" class="service-item" bindtap="{{item.e}}"><view class="service-icon-bg"><text class="service-icon">{{item.a}}</text></view><text class="service-name">{{item.b}}</text><text class="service-desc">{{item.c}}</text></view></view></view><view class="section"><section-header u-i="7558dcb8-1" bind:__l="__l" u-p="{{c||''}}"></section-header><view class="process-list"><view wx:for="{{d}}" wx:for-item="item" wx:key="e" class="process-item"><view class="process-step"><text class="step-num">{{item.a}}</text></view><view class="process-content"><text class="process-title">{{item.b}}</text><text class="process-desc">{{item.c}}</text></view><view wx:if="{{item.d}}" class="process-line"></view></view></view></view><view class="section"><section-header u-i="7558dcb8-2" bind:__l="__l" u-p="{{e||''}}"></section-header><view class="material-list"><view wx:for="{{f}}" wx:for-item="item" wx:key="e" class="material-item"><view class="material-header"><text class="material-name">{{item.a}}</text><text class="material-price">{{item.b}}</text></view><text class="material-desc">{{item.c}}</text><view class="material-tags"><text wx:for="{{item.d}}" wx:for-item="tag" wx:key="b" class="material-tag">{{tag.a}}</text></view></view></view></view><view class="section"><section-header u-i="7558dcb8-3" bind:__l="__l" u-p="{{g||''}}"></section-header><view class="faq-list"><view wx:for="{{h}}" wx:for-item="item" wx:key="e" class="faq-item" bindtap="{{item.f}}"><view class="faq-header"><text class="faq-question">{{item.a}}</text><text class="faq-arrow">{{item.b}}</text></view><view wx:if="{{item.c}}" class="faq-answer"><text class="faq-answer-text">{{item.d}}</text></view></view></view></view><view class="bottom-space"></view></scroll-view><view class="bottom-bar"><view class="bar-info"><text class="bar-title">免费上门评估</text><text class="bar-desc">专业师傅为您量身定制方案</text></view><view class="bar-btn" bindtap="{{i}}"><text class="bar-btn-text">立即预约</text></view></view></view><wxs src="/common/uniView.wxs" module="uV"/>
|
||||
<view id="{{j}}" change:eS="{{uV.sS}}" eS="{{$eS[j]}}" change:eA="{{uV.sA}}" eA="{{$eA[j]}}" class="{{['page', virtualHostClass]}}" style="{{virtualHostStyle}}" hidden="{{virtualHostHidden || false}}"><scroll-view class="page-scroll" scroll-y enable-flex="true" enhanced="true"><view class="banner"><view class="banner-content"><text class="banner-title">专业沙发翻新服务</text><text class="banner-desc">让旧沙发焕发新生</text></view></view><view class="section"><section-header u-i="3b972967-0" bind:__l="__l" u-p="{{a||''}}"></section-header><view class="service-grid"><view wx:for="{{b}}" wx:for-item="item" wx:key="d" class="service-item" bindtap="{{item.e}}"><view class="service-icon-bg"><text class="service-icon">{{item.a}}</text></view><text class="service-name">{{item.b}}</text><text class="service-desc">{{item.c}}</text></view></view></view><view class="section"><section-header u-i="3b972967-1" bind:__l="__l" u-p="{{c||''}}"></section-header><view class="process-list"><view wx:for="{{d}}" wx:for-item="item" wx:key="e" class="process-item"><view class="process-step"><text class="step-num">{{item.a}}</text></view><view class="process-content"><text class="process-title">{{item.b}}</text><text class="process-desc">{{item.c}}</text></view><view wx:if="{{item.d}}" class="process-line"></view></view></view></view><view class="section"><section-header u-i="3b972967-2" bind:__l="__l" u-p="{{e||''}}"></section-header><view class="material-list"><view wx:for="{{f}}" wx:for-item="item" wx:key="e" class="material-item"><view class="material-header"><text class="material-name">{{item.a}}</text><text class="material-price">{{item.b}}</text></view><text class="material-desc">{{item.c}}</text><view class="material-tags"><text wx:for="{{item.d}}" wx:for-item="tag" wx:key="b" class="material-tag">{{tag.a}}</text></view></view></view></view><view class="section"><section-header u-i="3b972967-3" bind:__l="__l" u-p="{{g||''}}"></section-header><view class="faq-list"><view wx:for="{{h}}" wx:for-item="item" wx:key="e" class="faq-item" bindtap="{{item.f}}"><view class="faq-header"><text class="faq-question">{{item.a}}</text><text class="faq-arrow">{{item.b}}</text></view><view wx:if="{{item.c}}" class="faq-answer"><text class="faq-answer-text">{{item.d}}</text></view></view></view></view><view class="bottom-space"></view></scroll-view><view class="bottom-bar"><view class="bar-info"><text class="bar-title">免费上门评估</text><text class="bar-desc">专业师傅为您量身定制方案</text></view><view class="bar-btn" bindtap="{{i}}"><text class="bar-btn-text">立即预约</text></view></view></view><wxs src="/common/uniView.wxs" module="uV"/>
|
||||
|
||||
Reference in New Issue
Block a user