初始化参股

This commit is contained in:
2026-01-27 18:06:04 +08:00
commit 2774a539bf
254 changed files with 33255 additions and 0 deletions

View File

@@ -0,0 +1,181 @@
"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 FeatureItem extends UTS.UTSType {
static get$UTSMetadata$() {
return {
kind: 2,
get fields() {
return {
title: { type: String, optional: false },
desc: { type: String, optional: false }
};
},
name: "FeatureItem"
};
}
constructor(options, metadata = FeatureItem.get$UTSMetadata$(), isJSONParse = false) {
super();
this.__props__ = UTS.UTSType.initProps(options, metadata, isJSONParse);
this.title = this.__props__.title;
this.desc = this.__props__.desc;
delete this.__props__;
}
}
class CompanyInfo extends UTS.UTSType {
static get$UTSMetadata$() {
return {
kind: 2,
get fields() {
return {
name: { type: String, optional: false },
slogan: { type: String, optional: false },
description: { type: String, optional: false },
phone: { type: String, optional: false },
wechat: { type: String, optional: false },
address: { type: String, optional: false },
workTime: { type: String, optional: false },
features: { type: UTS.UTSType.withGenerics(Array, [FeatureItem]), optional: false }
};
},
name: "CompanyInfo"
};
}
constructor(options, metadata = CompanyInfo.get$UTSMetadata$(), isJSONParse = false) {
super();
this.__props__ = UTS.UTSType.initProps(options, metadata, isJSONParse);
this.name = this.__props__.name;
this.slogan = this.__props__.slogan;
this.description = this.__props__.description;
this.phone = this.__props__.phone;
this.wechat = this.__props__.wechat;
this.address = this.__props__.address;
this.workTime = this.__props__.workTime;
this.features = this.__props__.features;
delete this.__props__;
}
}
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
__name: "index",
setup(__props) {
const companyInfo = common_vendor.ref(new CompanyInfo({
name: "优艺家沙发翻新",
slogan: "让旧沙发焕发新生",
description: "",
phone: "400-888-8888",
wechat: "youyijia2026",
address: "",
workTime: "",
features: []
}));
const fetchCompanyInfo = () => {
return common_vendor.__awaiter(this, void 0, void 0, function* () {
try {
const res = yield api_index.getCompanyInfo();
const data = res.data;
const featuresData = data["features"];
const features = featuresData.map((item) => {
return new FeatureItem({
title: item["title"],
desc: item["desc"]
});
});
companyInfo.value = new CompanyInfo({
name: data["name"],
slogan: data["slogan"],
description: data["description"],
phone: data["phone"],
wechat: data["wechat"],
address: data["address"],
workTime: data["workTime"],
features
});
} catch (e) {
common_vendor.index.__f__("error", "at pages/about/index.uvue:148", "获取公司信息失败", e);
}
});
};
const callPhone = () => {
common_vendor.index.makePhoneCall({
phoneNumber: companyInfo.value.phone,
fail: () => {
common_vendor.index.showToast({
title: "拨打电话失败",
icon: "none"
});
}
});
};
const copyWechat = () => {
common_vendor.index.setClipboardData({
data: companyInfo.value.wechat,
success: () => {
common_vendor.index.showToast({
title: "微信号已复制",
icon: "success"
});
}
});
};
const openLocation = () => {
common_vendor.index.openLocation({
latitude: 31.2,
longitude: 121.5,
name: companyInfo.value.name,
address: companyInfo.value.address,
fail: () => {
common_vendor.index.showToast({
title: "无法打开地图",
icon: "none"
});
}
});
};
common_vendor.onLoad(() => {
fetchCompanyInfo();
});
return (_ctx, _cache) => {
"raw js";
const __returned__ = {
a: common_vendor.t(common_vendor.unref(companyInfo).name),
b: common_vendor.t(common_vendor.unref(companyInfo).slogan),
c: common_vendor.p({
title: "公司简介"
}),
d: common_vendor.t(common_vendor.unref(companyInfo).description),
e: common_vendor.p({
title: "我们的优势"
}),
f: common_vendor.f(common_vendor.unref(companyInfo).features, (item, k0, i0) => {
return {
a: common_vendor.t(item.title),
b: common_vendor.t(item.desc),
c: item.title
};
}),
g: common_vendor.p({
title: "联系我们"
}),
h: common_vendor.t(common_vendor.unref(companyInfo).phone),
i: common_vendor.o(callPhone),
j: common_vendor.t(common_vendor.unref(companyInfo).wechat),
k: common_vendor.o(copyWechat),
l: common_vendor.t(common_vendor.unref(companyInfo).address),
m: common_vendor.o(openLocation),
n: common_vendor.t(common_vendor.unref(companyInfo).workTime),
o: common_vendor.sei(common_vendor.gei(_ctx, ""), "view")
};
return __returned__;
};
}
});
wx.createPage(_sfc_main);
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/about/index.js.map

View File

@@ -0,0 +1,6 @@
{
"navigationBarTitleText": "关于我们",
"usingComponents": {
"section-header": "../../components/section-header/section-header"
}
}

View File

@@ -0,0 +1 @@
<view id="{{o}}" change:eS="{{uV.sS}}" eS="{{$eS[o]}}" change:eA="{{uV.sA}}" eA="{{$eA[o]}}" class="{{['page', virtualHostClass]}}" style="{{virtualHostStyle}}" hidden="{{virtualHostHidden || false}}"><scroll-view class="page-scroll" scroll-y enable-flex="true" enhanced="true"><view class="header-section"><view class="company-logo"><text class="logo-text">优艺家</text></view><text class="company-name">{{a}}</text><text class="company-slogan">{{b}}</text></view><view class="section"><section-header u-i="00470dc0-0" bind:__l="__l" u-p="{{c||''}}"></section-header><view class="intro-card"><text class="intro-text">{{d}}</text></view></view><view class="section"><section-header u-i="00470dc0-1" bind:__l="__l" u-p="{{e||''}}"></section-header><view class="features-grid"><view wx:for="{{f}}" wx:for-item="item" wx:key="c" class="feature-item"><view class="feature-icon-bg"><text class="feature-icon">✓</text></view><text class="feature-title">{{item.a}}</text><text class="feature-desc">{{item.b}}</text></view></view></view><view class="section"><section-header u-i="00470dc0-2" bind:__l="__l" u-p="{{g||''}}"></section-header><view class="contact-card"><view class="contact-item" bindtap="{{i}}"><view class="contact-icon-bg"><text class="contact-icon">📞</text></view><view class="contact-info"><text class="contact-label">客服电话</text><text class="contact-value">{{h}}</text></view><text class="contact-arrow"></text></view><view class="contact-item" bindtap="{{k}}"><view class="contact-icon-bg"><text class="contact-icon">💬</text></view><view class="contact-info"><text class="contact-label">微信号</text><text class="contact-value">{{j}}</text></view><text class="contact-arrow"></text></view><view class="contact-item" bindtap="{{m}}"><view class="contact-icon-bg"><text class="contact-icon">📍</text></view><view class="contact-info"><text class="contact-label">公司地址</text><text class="contact-value">{{l}}</text></view><text class="contact-arrow"></text></view><view class="contact-item"><view class="contact-icon-bg"><text class="contact-icon">🕐</text></view><view class="contact-info"><text class="contact-label">营业时间</text><text class="contact-value">{{n}}</text></view></view></view></view><view class="bottom-space"></view></scroll-view></view><wxs src="/common/uniView.wxs" module="uV"/>

View File

@@ -0,0 +1,169 @@
@import "../../uvue.wxss";
:host{display:flex;flex-direction:column}
/**
* 优艺家沙发翻新 - 全局样式变量
*/
/* ========== 项目主题色 ========== */
/* 辅助色 */
/* 文字颜色 */
/* 背景色 */
/* 边框颜色 */
/* 间距 */
/* 圆角 */
/* 阴影 */
/* ========== uni-app 内置变量 ========== */
/* 行为相关颜色 */
/* 文字基本颜色 */
/* 背景颜色 */
/* 边框颜色 */
/* 尺寸变量 */
/* 文字尺寸 */
/* 图片尺寸 */
/* Border Radius */
/* 水平间距 */
/* 垂直间距 */
/* 透明度 */
/* 文章场景相关 */
.page {
flex: 1;
background-color: #f5f5f5;
}
.page-scroll {
flex: 1;
}
/* 头部区域 */
.header-section {
background: linear-gradient(135deg, #D4A574 0%, #B8895A 100%);
padding: 60rpx 32rpx;
align-items: center;
}
.company-logo {
width: 140rpx;
height: 140rpx;
background-color: #ffffff;
border-radius: 50%;
align-items: center;
justify-content: center;
margin-bottom: 24rpx;
}
.logo-text {
font-size: 36rpx;
font-weight: 600;
color: #D4A574;
}
.company-name {
font-size: 40rpx;
font-weight: 600;
color: #ffffff;
margin-bottom: 12rpx;
}
.company-slogan {
font-size: 28rpx;
color: rgba(255, 255, 255, 0.8);
}
/* 通用section */
.section {
padding: 0 24rpx;
margin-bottom: 24rpx;
}
/* 公司介绍 */
.intro-card {
background-color: #ffffff;
border-radius: 16rpx;
padding: 32rpx;
}
.intro-text {
font-size: 28rpx;
color: #606266;
line-height: 48rpx;
}
/* 优势 */
.features-grid {
flex-direction: row;
flex-wrap: wrap;
background-color: #ffffff;
border-radius: 16rpx;
padding: 16rpx;
}
.feature-item {
width: 50%;
padding: 24rpx;
align-items: center;
}
.feature-icon-bg {
width: 80rpx;
height: 80rpx;
background-color: #D4A574;
border-radius: 50%;
align-items: center;
justify-content: center;
margin-bottom: 16rpx;
}
.feature-icon {
font-size: 40rpx;
color: #ffffff;
}
.feature-title {
font-size: 30rpx;
font-weight: 600;
color: #333333;
margin-bottom: 8rpx;
}
.feature-desc {
font-size: 24rpx;
color: #909399;
}
/* 联系方式 */
.contact-card {
background-color: #ffffff;
border-radius: 16rpx;
}
.contact-item {
flex-direction: row;
align-items: center;
padding: 32rpx;
border-bottom-width: 1rpx;
border-bottom-style: solid;
border-bottom-color: #EBEEF5;
}
.contact-item:last-child {
border-bottom-width: 0;
}
.contact-icon-bg {
width: 72rpx;
height: 72rpx;
background-color: #FDF6EE;
border-radius: 50%;
align-items: center;
justify-content: center;
margin-right: 24rpx;
}
.contact-icon {
font-size: 36rpx;
}
.contact-info {
flex: 1;
}
.contact-label {
font-size: 24rpx;
color: #909399;
margin-bottom: 8rpx;
}
.contact-value {
font-size: 30rpx;
color: #333333;
}
.contact-arrow {
font-size: 36rpx;
color: #909399;
}
/* 底部间距 */
.bottom-space {
height: 60rpx;
}

View File

@@ -0,0 +1,221 @@
"use strict";
const common_vendor = require("../../common/vendor.js");
const api_index = require("../../api/index.js");
const utils_config = require("../../utils/config.js");
class FormData extends UTS.UTSType {
static get$UTSMetadata$() {
return {
kind: 2,
get fields() {
return {
userName: { type: String, optional: false },
phone: { type: String, optional: false },
address: { type: String, optional: false },
sofaType: { type: String, optional: false },
problem: { type: String, optional: false }
};
},
name: "FormData"
};
}
constructor(options, metadata = FormData.get$UTSMetadata$(), isJSONParse = false) {
super();
this.__props__ = UTS.UTSType.initProps(options, metadata, isJSONParse);
this.userName = this.__props__.userName;
this.phone = this.__props__.phone;
this.address = this.__props__.address;
this.sofaType = this.__props__.sofaType;
this.problem = this.__props__.problem;
delete this.__props__;
}
}
class SofaType extends UTS.UTSType {
static get$UTSMetadata$() {
return {
kind: 2,
get fields() {
return {
id: { type: String, optional: false },
name: { type: String, optional: false }
};
},
name: "SofaType"
};
}
constructor(options, metadata = SofaType.get$UTSMetadata$(), isJSONParse = false) {
super();
this.__props__ = UTS.UTSType.initProps(options, metadata, isJSONParse);
this.id = this.__props__.id;
this.name = this.__props__.name;
delete this.__props__;
}
}
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
__name: "index",
setup(__props) {
const formData = common_vendor.ref(new FormData({
userName: "",
phone: "",
address: "",
sofaType: "",
problem: ""
}));
const imageList = common_vendor.ref([]);
const sofaTypes = common_vendor.ref([]);
const submitting = common_vendor.ref(false);
const initSofaTypes = () => {
sofaTypes.value = utils_config.SOFA_CATEGORIES.filter((item) => {
return item.id != "all";
}).map((item) => {
return new SofaType({
id: item.id,
name: item.name
});
});
};
const selectSofaType = (id) => {
formData.value.sofaType = id;
};
const chooseImage = () => {
common_vendor.index.chooseImage(new UTSJSONObject({
count: 9 - imageList.value.length,
sizeType: ["compressed"],
sourceType: ["album", "camera"],
success: (res) => {
imageList.value = [...imageList.value, ...res.tempFilePaths];
}
}));
};
const deleteImage = (index) => {
imageList.value.splice(index, 1);
};
const validateForm = () => {
if (formData.value.userName.trim() == "") {
common_vendor.index.showToast({
title: "请输入您的姓名",
icon: "none"
});
return false;
}
const phone = formData.value.phone.trim();
if (phone == "") {
common_vendor.index.showToast({
title: "请输入联系电话",
icon: "none"
});
return false;
}
if (phone.length != 11) {
common_vendor.index.showToast({
title: "请输入正确的手机号",
icon: "none"
});
return false;
}
if (formData.value.address.trim() == "") {
common_vendor.index.showToast({
title: "请输入您的地址",
icon: "none"
});
return false;
}
return true;
};
const handleSubmit = () => {
return common_vendor.__awaiter(this, void 0, void 0, function* () {
if (!validateForm())
return Promise.resolve(null);
if (submitting.value)
return Promise.resolve(null);
submitting.value = true;
try {
const data = new UTSJSONObject({
userName: formData.value.userName,
phone: formData.value.phone,
address: formData.value.address,
sofaType: formData.value.sofaType,
problem: formData.value.problem,
images: imageList.value
});
const res = yield api_index.submitBooking(data);
const result = res.data;
common_vendor.index.showModal(new UTSJSONObject({
title: "预约成功",
content: result["message"],
showCancel: false,
success: () => {
common_vendor.index.navigateBack(new UTSJSONObject({
fail: () => {
common_vendor.index.switchTab({
url: "/pages/index/index"
});
}
}));
}
}));
} catch (e) {
common_vendor.index.__f__("error", "at pages/booking/index.uvue:270", "提交预约失败", e);
common_vendor.index.showToast({
title: "提交失败,请重试",
icon: "none"
});
}
submitting.value = false;
});
};
common_vendor.onLoad(() => {
initSofaTypes();
});
return (_ctx, _cache) => {
"raw js";
const __returned__ = common_vendor.e({
a: common_vendor.unref(formData).userName,
b: common_vendor.o(($event) => {
return common_vendor.unref(formData).userName = $event.detail.value;
}),
c: common_vendor.unref(formData).phone,
d: common_vendor.o(($event) => {
return common_vendor.unref(formData).phone = $event.detail.value;
}),
e: common_vendor.unref(formData).address,
f: common_vendor.o(($event) => {
return common_vendor.unref(formData).address = $event.detail.value;
}),
g: common_vendor.f(common_vendor.unref(sofaTypes), (item, k0, i0) => {
return {
a: common_vendor.t(item.name),
b: common_vendor.unref(formData).sofaType == item.id ? 1 : "",
c: common_vendor.unref(formData).sofaType == item.id ? 1 : "",
d: item.id,
e: common_vendor.o(($event) => {
return selectSofaType(item.id);
}, item.id)
};
}),
h: common_vendor.unref(formData).problem,
i: common_vendor.o(($event) => {
return common_vendor.unref(formData).problem = $event.detail.value;
}),
j: common_vendor.t(common_vendor.unref(formData).problem.length),
k: common_vendor.f(common_vendor.unref(imageList), (item, index, i0) => {
return {
a: item,
b: common_vendor.o(($event) => {
return deleteImage(index);
}, index),
c: index
};
}),
l: common_vendor.unref(imageList).length < 9
}, common_vendor.unref(imageList).length < 9 ? {
m: common_vendor.o(chooseImage)
} : {}, {
n: common_vendor.o(handleSubmit),
o: common_vendor.sei(common_vendor.gei(_ctx, ""), "view")
});
return __returned__;
};
}
});
wx.createPage(_sfc_main);
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/booking/index.js.map

View File

@@ -0,0 +1,4 @@
{
"navigationBarTitleText": "预约咨询",
"usingComponents": {}
}

View File

@@ -0,0 +1 @@
<view id="{{o}}" change:eS="{{uV.sS}}" eS="{{$eS[o]}}" change:eA="{{uV.sA}}" eA="{{$eA[o]}}" class="{{['page', virtualHostClass]}}" style="{{virtualHostStyle}}" hidden="{{virtualHostHidden || false}}"><scroll-view class="page-scroll" scroll-y enable-flex="true" enhanced="true"><view class="header-section"><text class="header-title">预约翻新服务</text><text class="header-desc">填写以下信息,我们会尽快与您联系</text></view><view class="form-section"><view class="form-item"><text class="form-label"><text class="required">*</text> 您的姓名 </text><input class="form-input" type="text" placeholder="请输入您的姓名" placeholder-class="placeholder" value="{{a}}" bindinput="{{b}}"/></view><view class="form-item"><text class="form-label"><text class="required">*</text> 联系电话 </text><input class="form-input" type="number" placeholder="请输入您的手机号" placeholder-class="placeholder" maxlength="11" value="{{c}}" bindinput="{{d}}"/></view><view class="form-item"><text class="form-label"><text class="required">*</text> 您的地址 </text><input class="form-input" type="text" placeholder="请输入详细地址" placeholder-class="placeholder" value="{{e}}" bindinput="{{f}}"/></view><view class="form-item"><text class="form-label">沙发类型</text><view class="type-grid"><view wx:for="{{g}}" wx:for-item="item" wx:key="d" class="{{['type-item', item.c && 'type-active']}}" bindtap="{{item.e}}"><text class="{{['type-text', item.b && 'type-text-active']}}">{{item.a}}</text></view></view></view><view class="form-item"><text class="form-label">问题描述</text><block wx:if="{{r0}}"><textarea class="form-textarea" placeholder="请描述沙发的问题(如:皮面开裂、褪色、塌陷等)" placeholder-class="placeholder" maxlength="500" value="{{h}}" bindinput="{{i}}"></textarea></block><text class="textarea-count">{{j}}/500</text></view><view class="form-item"><text class="form-label">上传图片(可选)</text><view class="upload-grid"><view wx:for="{{k}}" wx:for-item="item" wx:key="c" class="upload-item"><image class="upload-image" src="{{item.a}}" mode="aspectFill"></image><view class="upload-delete" bindtap="{{item.b}}"><text class="delete-icon">×</text></view></view><view wx:if="{{l}}" class="upload-add" bindtap="{{m}}"><text class="add-icon">+</text><text class="add-text">添加图片</text></view></view><text class="upload-tip">最多可上传9张图片</text></view></view><view class="bottom-space"></view></scroll-view><view class="submit-bar"><view class="submit-btn" bindtap="{{n}}"><text class="submit-text">提交预约</text></view></view></view><wxs src="/common/uniView.wxs" module="uV"/>

View File

@@ -0,0 +1,206 @@
@import "../../uvue.wxss";
:host{display:flex;flex-direction:column}
/**
* 优艺家沙发翻新 - 全局样式变量
*/
/* ========== 项目主题色 ========== */
/* 辅助色 */
/* 文字颜色 */
/* 背景色 */
/* 边框颜色 */
/* 间距 */
/* 圆角 */
/* 阴影 */
/* ========== uni-app 内置变量 ========== */
/* 行为相关颜色 */
/* 文字基本颜色 */
/* 背景颜色 */
/* 边框颜色 */
/* 尺寸变量 */
/* 文字尺寸 */
/* 图片尺寸 */
/* Border Radius */
/* 水平间距 */
/* 垂直间距 */
/* 透明度 */
/* 文章场景相关 */
.page {
flex: 1;
background-color: #f5f5f5;
}
.page-scroll {
flex: 1;
}
/* 头部 */
.header-section {
background: linear-gradient(135deg, #D4A574 0%, #B8895A 100%);
padding: 48rpx 32rpx;
align-items: center;
}
.header-title {
font-size: 40rpx;
font-weight: 600;
color: #ffffff;
margin-bottom: 12rpx;
}
.header-desc {
font-size: 28rpx;
color: rgba(255, 255, 255, 0.8);
}
/* 表单区域 */
.form-section {
background-color: #ffffff;
margin: 24rpx;
border-radius: 16rpx;
padding: 32rpx;
}
.form-item {
margin-bottom: 32rpx;
}
.form-label {
font-size: 28rpx;
font-weight: 600;
color: #333333;
margin-bottom: 16rpx;
}
.required {
color: #F56C6C;
margin-right: 4rpx;
}
.form-input {
background-color: #f5f5f5;
border-radius: 12rpx;
padding: 24rpx;
font-size: 28rpx;
height: 40px;
}
.placeholder {
color: #C0C4CC;
}
/* 沙发类型选择 */
.type-grid {
flex-direction: row;
flex-wrap: wrap;
}
.type-item {
padding: 16rpx 32rpx;
background-color: #f5f5f5;
border-radius: 8rpx;
margin-right: 16rpx;
margin-bottom: 16rpx;
}
.type-active {
background-color: #D4A574;
}
.type-text {
font-size: 26rpx;
color: #606266;
}
.type-text-active {
color: #ffffff;
}
/* 文本域 */
.form-textarea {
background-color: #f5f5f5;
border-radius: 12rpx;
padding: 24rpx;
font-size: 28rpx;
height: 200rpx;
width: 100%;
}
.textarea-count {
font-size: 24rpx;
color: #909399;
text-align: right;
margin-top: 8rpx;
}
/* 图片上传 */
.upload-grid {
flex-direction: row;
flex-wrap: wrap;
}
.upload-item {
width: 200rpx;
height: 200rpx;
margin-right: 16rpx;
margin-bottom: 16rpx;
position: relative;
}
.upload-image {
width: 100%;
height: 100%;
border-radius: 12rpx;
}
.upload-delete {
position: absolute;
top: -16rpx;
right: -16rpx;
width: 40rpx;
height: 40rpx;
background-color: #F56C6C;
border-radius: 50%;
align-items: center;
justify-content: center;
}
.delete-icon {
font-size: 28rpx;
color: #ffffff;
}
.upload-add {
width: 200rpx;
height: 200rpx;
background-color: #f5f5f5;
border-radius: 12rpx;
align-items: center;
justify-content: center;
border-width: 2rpx;
border-style: dashed;
border-color: #DCDFE6;
}
.add-icon {
font-size: 48rpx;
color: #909399;
}
.add-text {
font-size: 24rpx;
color: #909399;
margin-top: 8rpx;
}
.upload-tip {
font-size: 24rpx;
color: #909399;
margin-top: 16rpx;
}
/* 底部间距 */
.bottom-space {
height: 160rpx;
}
/* 提交按钮 */
.submit-bar {
position: fixed;
bottom: 0;
left: 0;
right: 0;
background-color: #ffffff;
padding: 24rpx 32rpx;
padding-bottom: 48rpx;
box-shadow: 0 -4rpx 16rpx rgba(0, 0, 0, 0.08);
}
.submit-btn {
background-color: #D4A574;
border-radius: 999rpx;
padding: 28rpx 0;
align-items: center;
}
.submit-text {
font-size: 32rpx;
font-weight: 600;
color: #ffffff;
}

View File

@@ -0,0 +1,186 @@
"use strict";
const common_vendor = require("../../common/vendor.js");
const api_index = require("../../api/index.js");
if (!Array) {
const _easycom_before_after_1 = common_vendor.resolveComponent("before-after");
_easycom_before_after_1();
}
const _easycom_before_after = () => "../../components/before-after/before-after.js";
if (!Math) {
_easycom_before_after();
}
class CaseDetail 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 },
beforeImages: { type: UTS.UTSType.withGenerics(Array, [String]), optional: false },
afterImages: { type: UTS.UTSType.withGenerics(Array, [String]), optional: false },
description: { 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 },
createTime: { type: String, optional: false }
};
},
name: "CaseDetail"
};
}
constructor(options, metadata = CaseDetail.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.beforeImages = this.__props__.beforeImages;
this.afterImages = this.__props__.afterImages;
this.description = this.__props__.description;
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;
this.createTime = this.__props__.createTime;
delete this.__props__;
}
}
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
__name: "detail",
setup(__props) {
const caseId = common_vendor.ref("");
const caseDetail = common_vendor.ref(new CaseDetail({
id: "",
title: "",
category: "",
categoryName: "",
beforeImages: [],
afterImages: [],
description: "",
material: "",
duration: "",
price: "",
views: 0,
likes: 0,
createTime: ""
}));
const isFavorite = common_vendor.ref(false);
const fetchCaseDetail = () => {
return common_vendor.__awaiter(this, void 0, void 0, function* () {
try {
const res = yield api_index.getCaseDetail(caseId.value);
const data = res.data;
caseDetail.value = new CaseDetail(
{
id: data["id"],
title: data["title"],
category: data["category"],
categoryName: data["categoryName"],
beforeImages: data["beforeImages"],
afterImages: data["afterImages"],
description: data["description"],
material: data["material"],
duration: data["duration"],
price: data["price"],
views: data["views"],
likes: data["likes"],
createTime: data["createTime"]
}
// 更新标题
);
common_vendor.index.setNavigationBarTitle({
title: caseDetail.value.title
});
} catch (e) {
common_vendor.index.__f__("error", "at pages/cases/detail.uvue:173", "获取案例详情失败", e);
}
});
};
const previewImages = (index) => {
common_vendor.index.previewImage({
current: index,
urls: caseDetail.value.afterImages
});
};
const handleFavorite = () => {
isFavorite.value = !isFavorite.value;
common_vendor.index.showToast({
title: isFavorite.value ? "已收藏" : "已取消收藏",
icon: "none"
});
};
const handleShare = () => {
common_vendor.index.showToast({
title: "分享功能开发中",
icon: "none"
});
};
const handleContact = () => {
common_vendor.index.makePhoneCall({
phoneNumber: "400-888-8888",
fail: () => {
common_vendor.index.showToast({
title: "拨打电话失败",
icon: "none"
});
}
});
};
const goToBooking = () => {
common_vendor.index.navigateTo({
url: "/pages/booking/index"
});
};
common_vendor.onLoad((options) => {
var _a;
caseId.value = (_a = options["id"]) !== null && _a !== void 0 ? _a : "";
if (caseId.value != "") {
fetchCaseDetail();
}
});
return (_ctx, _cache) => {
"raw js";
const __returned__ = {
a: common_vendor.f(common_vendor.unref(caseDetail).afterImages, (item, index, i0) => {
return {
a: item,
b: common_vendor.o(($event) => {
return previewImages(index);
}, index),
c: index
};
}),
b: common_vendor.t(common_vendor.unref(caseDetail).categoryName),
c: common_vendor.t(common_vendor.unref(caseDetail).title),
d: common_vendor.t(common_vendor.unref(caseDetail).price),
e: common_vendor.t(common_vendor.unref(caseDetail).views),
f: common_vendor.t(common_vendor.unref(caseDetail).likes),
g: common_vendor.p({
beforeImage: common_vendor.unref(caseDetail).beforeImages[0] || "",
afterImage: common_vendor.unref(caseDetail).afterImages[0] || "",
showTitle: true
}),
h: common_vendor.t(common_vendor.unref(caseDetail).material),
i: common_vendor.t(common_vendor.unref(caseDetail).duration),
j: common_vendor.t(common_vendor.unref(caseDetail).createTime),
k: common_vendor.t(common_vendor.unref(caseDetail).description),
l: common_vendor.t(common_vendor.unref(isFavorite) ? "❤️" : "🤍"),
m: common_vendor.o(handleFavorite),
n: common_vendor.o(handleShare),
o: common_vendor.o(handleContact),
p: common_vendor.o(goToBooking),
q: common_vendor.sei(common_vendor.gei(_ctx, ""), "view")
};
return __returned__;
};
}
});
wx.createPage(_sfc_main);
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/cases/detail.js.map

View File

@@ -0,0 +1,7 @@
{
"navigationBarTitleText": "案例详情",
"navigationBarBackgroundColor": "#ffffff",
"usingComponents": {
"before-after": "../../components/before-after/before-after"
}
}

View File

@@ -0,0 +1 @@
<view id="{{q}}" change:eS="{{uV.sS}}" eS="{{$eS[q]}}" change:eA="{{uV.sA}}" eA="{{$eA[q]}}" class="{{['page', virtualHostClass]}}" style="{{virtualHostStyle}}" hidden="{{virtualHostHidden || false}}"><scroll-view class="page-scroll" scroll-y enable-flex="true" enhanced="true"><view class="gallery-section"><swiper class="gallery-swiper" circular indicator-dots indicator-color="rgba(255,255,255,0.5)" indicator-active-color="#ffffff"><swiper-item wx:for="{{a}}" wx:for-item="item" wx:key="c"><image class="gallery-image" src="{{item.a}}" mode="aspectFill" bindtap="{{item.b}}"></image></swiper-item></swiper><view class="gallery-tag"><text class="gallery-tag-text">{{b}}</text></view></view><view class="info-section"><text class="case-title">{{c}}</text><view class="case-meta"><text class="case-price">{{d}}</text><view class="case-stats"><text class="stat-text">👁 {{e}}</text><text class="stat-text">❤ {{f}}</text></view></view></view><view class="compare-section"><before-after u-i="eec33e1e-0" bind:__l="__l" u-p="{{g||''}}"></before-after></view><view class="detail-section"><view class="detail-header"><text class="detail-title">翻新详情</text></view><view class="detail-list"><view class="detail-item"><text class="detail-label">使用材质</text><text class="detail-value">{{h}}</text></view><view class="detail-item"><text class="detail-label">翻新工期</text><text class="detail-value">{{i}}</text></view><view class="detail-item"><text class="detail-label">完成日期</text><text class="detail-value">{{j}}</text></view></view><view class="detail-desc"><text class="desc-title">案例描述</text><text class="desc-content">{{k}}</text></view></view><view class="bottom-space"></view></scroll-view><view class="bottom-bar"><view class="bar-left"><view class="bar-btn" bindtap="{{m}}"><text class="bar-icon">{{l}}</text><text class="bar-label">收藏</text></view><view class="bar-btn" bindtap="{{n}}"><text class="bar-icon">📤</text><text class="bar-label">分享</text></view></view><view class="bar-right"><view class="contact-btn" bindtap="{{o}}"><text class="contact-text">在线咨询</text></view><view class="booking-btn" bindtap="{{p}}"><text class="booking-text">立即预约</text></view></view></view></view><wxs src="/common/uniView.wxs" module="uV"/>

View File

@@ -0,0 +1,202 @@
@import "../../uvue.wxss";
:host{display:flex;flex-direction:column}
/**
* 优艺家沙发翻新 - 全局样式变量
*/
/* ========== 项目主题色 ========== */
/* 辅助色 */
/* 文字颜色 */
/* 背景色 */
/* 边框颜色 */
/* 间距 */
/* 圆角 */
/* 阴影 */
/* ========== uni-app 内置变量 ========== */
/* 行为相关颜色 */
/* 文字基本颜色 */
/* 背景颜色 */
/* 边框颜色 */
/* 尺寸变量 */
/* 文字尺寸 */
/* 图片尺寸 */
/* Border Radius */
/* 水平间距 */
/* 垂直间距 */
/* 透明度 */
/* 文章场景相关 */
.page {
flex: 1;
background-color: #f5f5f5;
}
.page-scroll {
flex: 1;
}
/* 图片画廊 */
.gallery-section {
position: relative;
}
.gallery-swiper {
height: 500rpx;
}
.gallery-image {
width: 100%;
height: 100%;
}
.gallery-tag {
position: absolute;
top: 24rpx;
left: 24rpx;
background-color: rgba(212, 165, 116, 0.9);
padding: 8rpx 20rpx;
border-radius: 8rpx;
}
.gallery-tag-text {
font-size: 24rpx;
color: #ffffff;
}
/* 基本信息 */
.info-section {
background-color: #ffffff;
padding: 32rpx;
margin-bottom: 24rpx;
}
.case-title {
font-size: 36rpx;
font-weight: 600;
color: #333333;
margin-bottom: 24rpx;
}
.case-meta {
flex-direction: row;
justify-content: space-between;
align-items: center;
}
.case-price {
font-size: 40rpx;
font-weight: 600;
color: #D4A574;
}
.case-stats {
flex-direction: row;
}
.stat-text {
font-size: 26rpx;
color: #909399;
margin-left: 24rpx;
}
/* 对比区域 */
.compare-section {
padding: 0 24rpx;
}
/* 详细信息 */
.detail-section {
background-color: #ffffff;
margin: 24rpx;
border-radius: 16rpx;
padding: 32rpx;
}
.detail-header {
margin-bottom: 24rpx;
}
.detail-title {
font-size: 32rpx;
font-weight: 600;
color: #333333;
}
.detail-list {
margin-bottom: 32rpx;
}
.detail-item {
flex-direction: row;
justify-content: space-between;
padding: 16rpx 0;
border-bottom-width: 1rpx;
border-bottom-style: solid;
border-bottom-color: #EBEEF5;
}
.detail-label {
font-size: 28rpx;
color: #909399;
}
.detail-value {
font-size: 28rpx;
color: #333333;
}
.detail-desc {
padding-top: 16rpx;
}
.desc-title {
font-size: 28rpx;
font-weight: 600;
color: #333333;
margin-bottom: 16rpx;
}
.desc-content {
font-size: 28rpx;
color: #606266;
line-height: 48rpx;
}
/* 底部间距 */
.bottom-space {
height: 160rpx;
}
/* 底部操作栏 */
.bottom-bar {
position: fixed;
bottom: 0;
left: 0;
right: 0;
flex-direction: row;
align-items: center;
justify-content: space-between;
background-color: #ffffff;
padding: 16rpx 24rpx;
padding-bottom: 32rpx;
box-shadow: 0 -4rpx 16rpx rgba(0, 0, 0, 0.08);
}
.bar-left {
flex-direction: row;
}
.bar-btn {
align-items: center;
padding: 0 24rpx;
}
.bar-icon {
font-size: 40rpx;
}
.bar-label {
font-size: 22rpx;
color: #606266;
margin-top: 4rpx;
}
.bar-right {
flex-direction: row;
flex: 1;
justify-content: flex-end;
}
.contact-btn {
background-color: #f5f5f5;
padding: 20rpx 40rpx;
border-radius: 999rpx;
margin-right: 16rpx;
}
.contact-text {
font-size: 28rpx;
color: #606266;
}
.booking-btn {
background-color: #D4A574;
padding: 20rpx 48rpx;
border-radius: 999rpx;
}
.booking-text {
font-size: 28rpx;
font-weight: 600;
color: #ffffff;
}

View File

@@ -0,0 +1,193 @@
"use strict";
const common_vendor = require("../../common/vendor.js");
const api_index = require("../../api/index.js");
const utils_config = require("../../utils/config.js");
if (!Array) {
const _easycom_case_card_1 = common_vendor.resolveComponent("case-card");
_easycom_case_card_1();
}
const _easycom_case_card = () => "../../components/case-card/case-card.js";
if (!Math) {
_easycom_case_card();
}
class CategoryItem extends UTS.UTSType {
static get$UTSMetadata$() {
return {
kind: 2,
get fields() {
return {
id: { type: String, optional: false },
name: { type: String, optional: false }
};
},
name: "CategoryItem"
};
}
constructor(options, metadata = CategoryItem.get$UTSMetadata$(), isJSONParse = false) {
super();
this.__props__ = UTS.UTSType.initProps(options, metadata, isJSONParse);
this.id = this.__props__.id;
this.name = this.__props__.name;
delete this.__props__;
}
}
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: "list",
setup(__props) {
const categories = common_vendor.ref([]);
const currentCategory = common_vendor.ref("all");
const caseList = common_vendor.ref([]);
const page = common_vendor.ref(1);
const total = common_vendor.ref(0);
const loading = common_vendor.ref(false);
const noMore = common_vendor.ref(false);
const initCategories = () => {
categories.value = utils_config.SOFA_CATEGORIES.map((item) => {
return new CategoryItem({
id: item.id,
name: item.name
});
});
};
const selectCategory = (id) => {
if (currentCategory.value == id)
return null;
currentCategory.value = id;
page.value = 1;
caseList.value = [];
noMore.value = false;
fetchCaseList();
};
const fetchCaseList = () => {
return common_vendor.__awaiter(this, void 0, void 0, function* () {
if (loading.value || noMore.value)
return Promise.resolve(null);
loading.value = true;
try {
const params = new UTSJSONObject({
category: currentCategory.value,
page: page.value,
pageSize: utils_config.PAGE_SIZE
});
const res = yield api_index.getCaseList(params);
const data = res.data;
const list = data["items"] || [];
total.value = data["total"] || 0;
const newList = list.map((item) => {
return new CaseItem({
id: item["id"],
title: item["title"],
category: item["category"],
categoryName: item["categoryName"],
coverImage: item["coverImage"],
material: item["material"],
duration: item["duration"],
price: item["price"],
views: item["views"],
likes: item["likes"]
});
});
if (page.value == 1) {
caseList.value = newList;
} else {
caseList.value = [...caseList.value, ...newList];
}
if (caseList.value.length >= total.value) {
noMore.value = true;
}
} catch (e) {
common_vendor.index.__f__("error", "at pages/cases/list.uvue:160", "获取案例列表失败", e);
}
loading.value = false;
});
};
const loadMore = () => {
if (!noMore.value && !loading.value) {
page.value++;
fetchCaseList();
}
};
const goToDetail = (id) => {
common_vendor.index.navigateTo({
url: `/pages/cases/detail?id=${id}`
});
};
common_vendor.onLoad(() => {
initCategories();
fetchCaseList();
});
return (_ctx, _cache) => {
"raw js";
const __returned__ = common_vendor.e({
a: common_vendor.f(common_vendor.unref(categories), (item, k0, i0) => {
return {
a: common_vendor.t(item.name),
b: common_vendor.unref(currentCategory) == item.id ? 1 : "",
c: common_vendor.unref(currentCategory) == item.id ? 1 : "",
d: item.id,
e: common_vendor.o(($event) => {
return selectCategory(item.id);
}, item.id)
};
}),
b: common_vendor.f(common_vendor.unref(caseList), (item, k0, i0) => {
return {
a: item.id,
b: common_vendor.o(goToDetail, item.id),
c: "15d594f8-0-" + i0,
d: common_vendor.p({
caseData: item
})
};
}),
c: common_vendor.unref(loading)
}, common_vendor.unref(loading) ? {} : common_vendor.unref(noMore) ? {} : {}, {
d: common_vendor.unref(noMore),
e: !common_vendor.unref(loading) && common_vendor.unref(caseList).length == 0
}, !common_vendor.unref(loading) && common_vendor.unref(caseList).length == 0 ? {} : {}, {
f: common_vendor.o(loadMore),
g: common_vendor.sei(common_vendor.gei(_ctx, ""), "view")
});
return __returned__;
};
}
});
wx.createPage(_sfc_main);
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/cases/list.js.map

View File

@@ -0,0 +1,6 @@
{
"navigationBarTitleText": "案例展示",
"usingComponents": {
"case-card": "../../components/case-card/case-card"
}
}

View File

@@ -0,0 +1 @@
<view id="{{g}}" change:eS="{{uV.sS}}" eS="{{$eS[g]}}" change:eA="{{uV.sA}}" eA="{{$eA[g]}}" class="{{['page', virtualHostClass]}}" style="{{virtualHostStyle}}" hidden="{{virtualHostHidden || false}}"><view class="category-bar"><scroll-view class="category-scroll" scroll-x enable-flex="true" enhanced="true"><view class="category-list"><view wx:for="{{a}}" wx:for-item="item" wx:key="d" class="{{['category-item', item.c && 'category-active']}}" bindtap="{{item.e}}"><text class="{{['category-text', item.b && 'category-text-active']}}">{{item.a}}</text></view></view></scroll-view></view><scroll-view class="case-scroll" scroll-y bindscrolltolower="{{f}}" enable-flex="true" enhanced="true"><view class="case-list"><case-card wx:for="{{b}}" wx:for-item="item" wx:key="a" bindclick="{{item.b}}" u-i="{{item.c}}" bind:__l="__l" u-p="{{item.d||''}}"></case-card></view><view class="load-status"><text wx:if="{{c}}" class="load-text">加载中...</text><text wx:elif="{{d}}" class="load-text">没有更多了</text></view><view wx:if="{{e}}" class="empty-state"><text class="empty-icon">📭</text><text class="empty-text">暂无相关案例</text></view><view class="bottom-space"></view></scroll-view></view><wxs src="/common/uniView.wxs" module="uV"/>

View File

@@ -0,0 +1,102 @@
@import "../../uvue.wxss";
:host{display:flex;flex-direction:column}
/**
* 优艺家沙发翻新 - 全局样式变量
*/
/* ========== 项目主题色 ========== */
/* 辅助色 */
/* 文字颜色 */
/* 背景色 */
/* 边框颜色 */
/* 间距 */
/* 圆角 */
/* 阴影 */
/* ========== uni-app 内置变量 ========== */
/* 行为相关颜色 */
/* 文字基本颜色 */
/* 背景颜色 */
/* 边框颜色 */
/* 尺寸变量 */
/* 文字尺寸 */
/* 图片尺寸 */
/* Border Radius */
/* 水平间距 */
/* 垂直间距 */
/* 透明度 */
/* 文章场景相关 */
.page {
flex: 1;
background-color: #f5f5f5;
}
/* 分类栏 */
.category-bar {
background-color: #ffffff;
padding: 24rpx 0;
border-bottom-width: 1rpx;
border-bottom-style: solid;
border-bottom-color: #EBEEF5;
}
.category-scroll {
flex-direction: row;
}
.category-scroll ::-webkit-scrollbar {
display: none;
}
.category-list {
flex-direction: row;
padding: 0 24rpx;
}
.category-item {
padding: 16rpx 32rpx;
margin-right: 16rpx;
border-radius: 999rpx;
background-color: #f5f5f5;
}
.category-active {
background-color: #D4A574;
}
.category-text {
font-size: 28rpx;
color: #606266;
}
.category-text-active {
color: #ffffff;
}
/* 案例列表 */
.case-scroll {
flex: 1;
}
.case-list {
padding: 24rpx;
}
/* 加载状态 */
.load-status {
padding: 32rpx 0;
align-items: center;
}
.load-text {
font-size: 26rpx;
color: #909399;
}
/* 空状态 */
.empty-state {
padding: 120rpx 0;
align-items: center;
}
.empty-icon {
font-size: 80rpx;
margin-bottom: 24rpx;
}
.empty-text {
font-size: 28rpx;
color: #909399;
}
/* 底部间距 */
.bottom-space {
height: 120rpx;
}

View File

@@ -0,0 +1,287 @@
"use strict";
const common_vendor = require("../../common/vendor.js");
const api_index = require("../../api/index.js");
const utils_config = require("../../utils/config.js");
if (!Array) {
const _easycom_nav_bar_1 = common_vendor.resolveComponent("nav-bar");
const _easycom_service_card_1 = common_vendor.resolveComponent("service-card");
const _easycom_section_header_1 = common_vendor.resolveComponent("section-header");
const _easycom_case_card_1 = common_vendor.resolveComponent("case-card");
(_easycom_nav_bar_1 + _easycom_service_card_1 + _easycom_section_header_1 + _easycom_case_card_1)();
}
const _easycom_nav_bar = () => "../../components/nav-bar/nav-bar.js";
const _easycom_service_card = () => "../../components/service-card/service-card.js";
const _easycom_section_header = () => "../../components/section-header/section-header.js";
const _easycom_case_card = () => "../../components/case-card/case-card.js";
if (!Math) {
(_easycom_nav_bar + _easycom_service_card + _easycom_section_header + _easycom_case_card)();
}
class BannerItem extends UTS.UTSType {
static get$UTSMetadata$() {
return {
kind: 2,
get fields() {
return {
id: { type: String, optional: false },
image: { type: String, optional: false },
title: { type: String, optional: false },
link: { type: String, optional: false }
};
},
name: "BannerItem"
};
}
constructor(options, metadata = BannerItem.get$UTSMetadata$(), isJSONParse = false) {
super();
this.__props__ = UTS.UTSType.initProps(options, metadata, isJSONParse);
this.id = this.__props__.id;
this.image = this.__props__.image;
this.title = this.__props__.title;
this.link = this.__props__.link;
delete this.__props__;
}
}
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__;
}
}
class ServiceType extends UTS.UTSType {
static get$UTSMetadata$() {
return {
kind: 2,
get fields() {
return {
id: { type: String, optional: false },
name: { type: String, optional: false },
icon: { 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.icon = this.__props__.icon;
delete this.__props__;
}
}
class AdvantageItem extends UTS.UTSType {
static get$UTSMetadata$() {
return {
kind: 2,
get fields() {
return {
icon: { type: String, optional: false },
title: { type: String, optional: false },
desc: { type: String, optional: false }
};
},
name: "AdvantageItem"
};
}
constructor(options, metadata = AdvantageItem.get$UTSMetadata$(), isJSONParse = false) {
super();
this.__props__ = UTS.UTSType.initProps(options, metadata, isJSONParse);
this.icon = this.__props__.icon;
this.title = this.__props__.title;
this.desc = this.__props__.desc;
delete this.__props__;
}
}
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
__name: "index",
setup(__props) {
const bannerList = common_vendor.ref([]);
const serviceTypes = common_vendor.ref([]);
const hotCases = common_vendor.ref([]);
const advantages = common_vendor.ref([
new AdvantageItem({ icon: "👨‍🔧", title: "专业团队", desc: "10年+经验" }),
new AdvantageItem({ icon: "✅", title: "品质保证", desc: "质保2年" }),
new AdvantageItem({ icon: "🚗", title: "上门服务", desc: "免费评估" }),
new AdvantageItem({ icon: "💰", title: "价格透明", desc: "无隐形消费" })
]);
const initServiceTypes = () => {
serviceTypes.value = utils_config.SERVICE_TYPES.map((item) => {
return new ServiceType({
id: item.id,
name: item.name,
icon: item.icon
});
});
};
const fetchBanners = () => {
return common_vendor.__awaiter(this, void 0, void 0, function* () {
try {
const res = yield api_index.getBanners();
const data = res.data;
bannerList.value = data.map((item) => {
return new BannerItem({
id: item["id"],
image: item["image"],
title: item["title"],
link: item["link"]
});
});
} catch (e) {
common_vendor.index.__f__("error", "at pages/index/index.uvue:174", "获取轮播图失败", e);
}
});
};
const fetchHotCases = () => {
return common_vendor.__awaiter(this, void 0, void 0, function* () {
try {
const res = yield api_index.getHotCases();
const data = res.data;
const list = data["items"] || [];
hotCases.value = list.map((item) => {
return new CaseItem({
id: item["id"],
title: item["title"],
category: item["category"],
categoryName: item["categoryName"],
coverImage: item["coverImage"],
material: item["material"],
duration: item["duration"],
price: item["price"],
views: item["views"],
likes: item["likes"]
});
});
} catch (e) {
common_vendor.index.__f__("error", "at pages/index/index.uvue:200", "获取热门案例失败", e);
}
});
};
const handleBannerClick = (item) => {
if (item.link != "") {
common_vendor.index.navigateTo({
url: item.link,
fail: () => {
common_vendor.index.switchTab({
url: item.link
});
}
});
}
};
const handleServiceClick = (id) => {
common_vendor.index.switchTab({
url: "/pages/service/index"
});
};
const goToCaseList = () => {
common_vendor.index.switchTab({
url: "/pages/cases/list"
});
};
const goToCaseDetail = (id) => {
common_vendor.index.navigateTo({
url: `/pages/cases/detail?id=${id}`
});
};
const goToBooking = () => {
common_vendor.index.navigateTo({
url: "/pages/booking/index"
});
};
common_vendor.onLoad(() => {
initServiceTypes();
fetchBanners();
fetchHotCases();
});
return (_ctx, _cache) => {
"raw js";
const __returned__ = {
a: common_vendor.p({
title: "优艺家沙发翻新"
}),
b: common_vendor.f(common_vendor.unref(bannerList), (item, k0, i0) => {
return {
a: item.image,
b: common_vendor.o(($event) => {
return handleBannerClick(item);
}, item.id),
c: item.id
};
}),
c: common_vendor.f(common_vendor.unref(serviceTypes), (item, k0, i0) => {
return {
a: item.id,
b: item.id,
c: common_vendor.o(handleServiceClick, item.id),
d: "767a328a-1-" + i0,
e: common_vendor.p({
id: item.id,
name: item.name,
icon: item.icon
})
};
}),
d: common_vendor.f(common_vendor.unref(advantages), (item, k0, i0) => {
return {
a: common_vendor.t(item.icon),
b: common_vendor.t(item.title),
c: common_vendor.t(item.desc),
d: item.title
};
}),
e: common_vendor.o(goToCaseList),
f: common_vendor.p({
title: "热门案例",
showMore: true
}),
g: common_vendor.f(common_vendor.unref(hotCases), (item, k0, i0) => {
return {
a: item.id,
b: common_vendor.o(goToCaseDetail, item.id),
c: "767a328a-3-" + i0,
d: common_vendor.p({
caseData: item
})
};
}),
h: common_vendor.o(goToBooking),
i: common_vendor.sei(common_vendor.gei(_ctx, ""), "view")
};
return __returned__;
};
}
});
wx.createPage(_sfc_main);
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/index/index.js.map

View File

@@ -0,0 +1,10 @@
{
"navigationBarTitleText": "优艺家沙发翻新",
"navigationStyle": "custom",
"usingComponents": {
"nav-bar": "../../components/nav-bar/nav-bar",
"service-card": "../../components/service-card/service-card",
"section-header": "../../components/section-header/section-header",
"case-card": "../../components/case-card/case-card"
}
}

View File

@@ -0,0 +1 @@
<view id="{{i}}" change:eS="{{uV.sS}}" eS="{{$eS[i]}}" change:eA="{{uV.sA}}" eA="{{$eA[i]}}" class="{{['page', virtualHostClass]}}" style="{{virtualHostStyle}}" hidden="{{virtualHostHidden || false}}"><nav-bar u-i="767a328a-0" bind:__l="__l" u-p="{{a||''}}"></nav-bar><scroll-view class="page-content" scroll-y enable-flex="true" enhanced="true"><view class="banner-section"><swiper class="banner-swiper" circular autoplay indicator-dots indicator-color="rgba(255,255,255,0.5)" indicator-active-color="#ffffff"><swiper-item wx:for="{{b}}" wx:for-item="item" wx:key="c"><image class="banner-image" src="{{item.a}}" mode="aspectFill" bindtap="{{item.b}}"></image></swiper-item></swiper></view><view class="service-section"><view class="service-grid"><service-card wx:for="{{c}}" wx:for-item="item" wx:key="b" id="{{item.a}}" virtualHostId="{{item.a}}" bindclick="{{item.c}}" u-i="{{item.d}}" bind:__l="__l" u-p="{{item.e||''}}"></service-card></view></view><view class="advantage-section"><view class="advantage-list"><view wx:for="{{d}}" wx:for-item="item" wx:key="d" class="advantage-item"><text class="advantage-icon">{{item.a}}</text><view class="advantage-info"><text class="advantage-title">{{item.b}}</text><text class="advantage-desc">{{item.c}}</text></view></view></view></view><view class="case-section"><section-header bindmore="{{e}}" u-i="767a328a-2" bind:__l="__l" u-p="{{f||''}}"></section-header><view class="case-list"><case-card wx:for="{{g}}" wx:for-item="item" wx:key="a" bindclick="{{item.b}}" u-i="{{item.c}}" bind:__l="__l" u-p="{{item.d||''}}"></case-card></view></view><view class="booking-section" bindtap="{{h}}"><view class="booking-content"><view class="booking-left"><text class="booking-title">免费上门评估</text><text class="booking-desc">专业师傅免费上门,为您的沙发量身定制翻新方案</text></view><view class="booking-btn"><text class="booking-btn-text">立即预约</text></view></view></view><view class="bottom-space"></view></scroll-view></view><wxs src="/common/uniView.wxs" module="uV"/>

View File

@@ -0,0 +1,144 @@
@import "../../uvue.wxss";
:host{display:flex;flex-direction:column}
/**
* 优艺家沙发翻新 - 全局样式变量
*/
/* ========== 项目主题色 ========== */
/* 辅助色 */
/* 文字颜色 */
/* 背景色 */
/* 边框颜色 */
/* 间距 */
/* 圆角 */
/* 阴影 */
/* ========== uni-app 内置变量 ========== */
/* 行为相关颜色 */
/* 文字基本颜色 */
/* 背景颜色 */
/* 边框颜色 */
/* 尺寸变量 */
/* 文字尺寸 */
/* 图片尺寸 */
/* Border Radius */
/* 水平间距 */
/* 垂直间距 */
/* 透明度 */
/* 文章场景相关 */
.page {
flex: 1;
background-color: #f5f5f5;
}
.page-content {
flex: 1;
}
/* 轮播图 */
.banner-section {
padding: 24rpx;
}
.banner-swiper {
height: 320rpx;
border-radius: 16rpx;
overflow: hidden;
}
.banner-image {
width: 100%;
height: 100%;
}
/* 服务入口 */
.service-section {
padding: 0 24rpx 24rpx;
}
.service-grid {
flex-direction: row;
justify-content: space-between;
background-color: #ffffff;
border-radius: 16rpx;
padding: 24rpx 16rpx;
}
/* 公司优势 */
.advantage-section {
padding: 0 24rpx 24rpx;
}
.advantage-list {
flex-direction: row;
flex-wrap: wrap;
background-color: #ffffff;
border-radius: 16rpx;
padding: 24rpx;
}
.advantage-item {
width: 50%;
flex-direction: row;
align-items: center;
padding: 16rpx 0;
}
.advantage-icon {
font-size: 48rpx;
margin-right: 16rpx;
}
.advantage-info {
flex: 1;
}
.advantage-title {
font-size: 28rpx;
font-weight: 600;
color: #333333;
margin-bottom: 4rpx;
}
.advantage-desc {
font-size: 24rpx;
color: #909399;
}
/* 热门案例 */
.case-section {
padding: 0 24rpx;
}
.case-list {
padding-bottom: 24rpx;
}
/* 预约入口 */
.booking-section {
margin: 0 24rpx 24rpx;
background: linear-gradient(135deg, #D4A574 0%, #B8895A 100%);
border-radius: 16rpx;
padding: 32rpx;
}
.booking-content {
flex-direction: row;
align-items: center;
justify-content: space-between;
}
.booking-left {
flex: 1;
}
.booking-title {
font-size: 34rpx;
font-weight: 600;
color: #ffffff;
margin-bottom: 8rpx;
}
.booking-desc {
font-size: 24rpx;
color: rgba(255, 255, 255, 0.8);
}
.booking-btn {
background-color: #ffffff;
padding: 16rpx 32rpx;
border-radius: 999rpx;
margin-left: 24rpx;
}
.booking-btn-text {
font-size: 28rpx;
font-weight: 600;
color: #D4A574;
}
/* 底部间距 */
.bottom-space {
height: 120rpx;
}

View File

@@ -0,0 +1,276 @@
"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

View File

@@ -0,0 +1,6 @@
{
"navigationBarTitleText": "服务介绍",
"usingComponents": {
"section-header": "../../components/section-header/section-header"
}
}

View File

@@ -0,0 +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 File

@@ -0,0 +1,281 @@
@import "../../uvue.wxss";
:host{display:flex;flex-direction:column}
/**
* 优艺家沙发翻新 - 全局样式变量
*/
/* ========== 项目主题色 ========== */
/* 辅助色 */
/* 文字颜色 */
/* 背景色 */
/* 边框颜色 */
/* 间距 */
/* 圆角 */
/* 阴影 */
/* ========== uni-app 内置变量 ========== */
/* 行为相关颜色 */
/* 文字基本颜色 */
/* 背景颜色 */
/* 边框颜色 */
/* 尺寸变量 */
/* 文字尺寸 */
/* 图片尺寸 */
/* Border Radius */
/* 水平间距 */
/* 垂直间距 */
/* 透明度 */
/* 文章场景相关 */
.page {
flex: 1;
background-color: #f5f5f5;
}
.page-scroll {
flex: 1;
}
/* 顶部横幅 */
.banner {
height: 280rpx;
background: linear-gradient(135deg, #D4A574 0%, #B8895A 100%);
justify-content: center;
align-items: center;
}
.banner-content {
align-items: center;
}
.banner-title {
font-size: 40rpx;
font-weight: 600;
color: #ffffff;
margin-bottom: 16rpx;
}
.banner-desc {
font-size: 28rpx;
color: rgba(255, 255, 255, 0.8);
}
/* 通用section */
.section {
padding: 0 24rpx;
margin-bottom: 24rpx;
}
/* 服务类型 */
.service-grid {
flex-direction: row;
flex-wrap: wrap;
background-color: #ffffff;
border-radius: 16rpx;
padding: 16rpx;
}
.service-item {
width: 50%;
padding: 24rpx;
align-items: center;
}
.service-icon-bg {
width: 100rpx;
height: 100rpx;
background-color: #FDF6EE;
border-radius: 50%;
align-items: center;
justify-content: center;
margin-bottom: 16rpx;
}
.service-icon {
font-size: 48rpx;
}
.service-name {
font-size: 30rpx;
font-weight: 600;
color: #333333;
margin-bottom: 8rpx;
}
.service-desc {
font-size: 24rpx;
color: #909399;
}
/* 服务流程 */
.process-list {
background-color: #ffffff;
border-radius: 16rpx;
padding: 32rpx;
}
.process-item {
flex-direction: row;
position: relative;
padding-bottom: 32rpx;
}
.process-step {
width: 48rpx;
height: 48rpx;
background-color: #D4A574;
border-radius: 50%;
align-items: center;
justify-content: center;
margin-right: 24rpx;
z-index: 1;
}
.step-num {
font-size: 24rpx;
font-weight: 600;
color: #ffffff;
}
.process-content {
flex: 1;
}
.process-title {
font-size: 30rpx;
font-weight: 600;
color: #333333;
margin-bottom: 8rpx;
}
.process-desc {
font-size: 26rpx;
color: #909399;
}
.process-line {
position: absolute;
left: 22rpx;
top: 56rpx;
width: 4rpx;
height: 60rpx;
background-color: #E8C9A8;
}
/* 材质说明 */
.material-list {
background-color: #ffffff;
border-radius: 16rpx;
}
.material-item {
padding: 32rpx;
border-bottom-width: 1rpx;
border-bottom-style: solid;
border-bottom-color: #EBEEF5;
}
.material-item:last-child {
border-bottom-width: 0;
}
.material-header {
flex-direction: row;
justify-content: space-between;
align-items: center;
margin-bottom: 12rpx;
}
.material-name {
font-size: 30rpx;
font-weight: 600;
color: #333333;
}
.material-price {
font-size: 28rpx;
color: #D4A574;
font-weight: 600;
}
.material-desc {
font-size: 26rpx;
color: #606266;
margin-bottom: 16rpx;
line-height: 40rpx;
}
.material-tags {
flex-direction: row;
flex-wrap: wrap;
}
.material-tag {
font-size: 22rpx;
color: #D4A574;
background-color: #FDF6EE;
padding: 8rpx 16rpx;
border-radius: 8rpx;
margin-right: 16rpx;
margin-bottom: 8rpx;
}
/* 常见问题 */
.faq-list {
background-color: #ffffff;
border-radius: 16rpx;
}
.faq-item {
padding: 32rpx;
border-bottom-width: 1rpx;
border-bottom-style: solid;
border-bottom-color: #EBEEF5;
}
.faq-item:last-child {
border-bottom-width: 0;
}
.faq-header {
flex-direction: row;
justify-content: space-between;
align-items: center;
}
.faq-question {
font-size: 28rpx;
font-weight: 600;
color: #333333;
flex: 1;
}
.faq-arrow {
font-size: 36rpx;
color: #909399;
margin-left: 16rpx;
}
.faq-answer {
margin-top: 16rpx;
padding-top: 16rpx;
border-top-width: 1rpx;
border-top-style: dashed;
border-top-color: #EBEEF5;
}
.faq-answer-text {
font-size: 26rpx;
color: #606266;
line-height: 44rpx;
}
/* 底部间距 */
.bottom-space {
height: 160rpx;
}
/* 底部操作栏 */
.bottom-bar {
position: fixed;
bottom: 0;
left: 0;
right: 0;
z-index: 2;
flex-direction: row;
align-items: center;
justify-content: space-between;
background-color: #ffffff;
padding: 20rpx 32rpx;
padding-bottom: 40rpx;
box-shadow: 0 -4rpx 16rpx rgba(0, 0, 0, 0.08);
}
.bar-info {
flex: 1;
}
.bar-title {
font-size: 30rpx;
font-weight: 600;
color: #333333;
}
.bar-desc {
font-size: 24rpx;
color: #909399;
margin-top: 4rpx;
}
.bar-btn {
background-color: #D4A574;
padding: 24rpx 56rpx;
border-radius: 999rpx;
}
.bar-btn-text {
font-size: 30rpx;
font-weight: 600;
color: #ffffff;
}

View File

@@ -0,0 +1,228 @@
"use strict";
const common_vendor = require("../../common/vendor.js");
const utils_config = require("../../utils/config.js");
class UserInfo extends UTS.UTSType {
static get$UTSMetadata$() {
return {
kind: 2,
get fields() {
return {
id: { type: String, optional: false },
nickName: { type: String, optional: false },
avatar: { type: String, optional: false },
phone: { type: String, optional: false }
};
},
name: "UserInfo"
};
}
constructor(options, metadata = UserInfo.get$UTSMetadata$(), isJSONParse = false) {
super();
this.__props__ = UTS.UTSType.initProps(options, metadata, isJSONParse);
this.id = this.__props__.id;
this.nickName = this.__props__.nickName;
this.avatar = this.__props__.avatar;
this.phone = this.__props__.phone;
delete this.__props__;
}
}
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
__name: "index",
setup(__props) {
const userInfo = common_vendor.ref(new UserInfo({
id: "",
nickName: "",
avatar: "",
phone: ""
}));
const isLoggedIn = common_vendor.ref(false);
const bookingCount = common_vendor.ref(0);
const favoriteCount = common_vendor.ref(0);
const cacheSize = common_vendor.ref("0KB");
const checkLoginStatus = () => {
var _a, _b, _c, _d;
const token = common_vendor.index.getStorageSync(utils_config.STORAGE_KEYS.TOKEN);
isLoggedIn.value = token != "";
if (isLoggedIn.value) {
const info = common_vendor.index.getStorageSync(utils_config.STORAGE_KEYS.USER_INFO);
if (info != null) {
userInfo.value = new UserInfo({
id: (_a = info["id"]) !== null && _a !== void 0 ? _a : "",
nickName: (_b = info["nickName"]) !== null && _b !== void 0 ? _b : "",
avatar: (_c = info["avatar"]) !== null && _c !== void 0 ? _c : "",
phone: (_d = info["phone"]) !== null && _d !== void 0 ? _d : ""
});
}
}
};
const getCacheSize = () => {
common_vendor.index.getStorageInfo(new UTSJSONObject({
success: (res) => {
const size = res.currentSize;
if (size < 1024) {
cacheSize.value = `${size}KB`;
} else {
cacheSize.value = `${(size / 1024).toFixed(2)}MB`;
}
}
}));
};
const handleLogin = () => {
common_vendor.index.getUserProfile(new UTSJSONObject({
desc: "用于完善用户资料",
success: (res = null) => {
userInfo.value = new UserInfo(
{
id: "",
nickName: res.userInfo.nickName,
avatar: res.userInfo.avatarUrl,
phone: ""
}
// 保存用户信息
);
common_vendor.index.setStorageSync(utils_config.STORAGE_KEYS.USER_INFO, new UTSJSONObject({
nickName: res.userInfo.nickName,
avatar: res.userInfo.avatarUrl
}));
common_vendor.index.setStorageSync(utils_config.STORAGE_KEYS.TOKEN, "mock_token_" + Date.now().toString());
isLoggedIn.value = true;
common_vendor.index.showToast({
title: "登录成功",
icon: "success"
});
},
fail: () => {
common_vendor.index.showToast({
title: "登录失败",
icon: "none"
});
}
}));
};
const handleLogout = () => {
common_vendor.index.showModal(new UTSJSONObject({
title: "提示",
content: "确定要退出登录吗?",
success: (res) => {
if (res.confirm) {
common_vendor.index.removeStorageSync(utils_config.STORAGE_KEYS.TOKEN);
common_vendor.index.removeStorageSync(utils_config.STORAGE_KEYS.USER_INFO);
isLoggedIn.value = false;
userInfo.value = new UserInfo({
id: "",
nickName: "",
avatar: "",
phone: ""
});
common_vendor.index.showToast({
title: "已退出登录",
icon: "success"
});
}
}
}));
};
const goToBookingList = () => {
common_vendor.index.showToast({
title: "功能开发中",
icon: "none"
});
};
const goToFavorites = () => {
common_vendor.index.showToast({
title: "功能开发中",
icon: "none"
});
};
const goToAbout = () => {
common_vendor.index.navigateTo({
url: "/pages/about/index"
});
};
const callService = () => {
common_vendor.index.makePhoneCall({
phoneNumber: "400-888-8888",
fail: () => {
common_vendor.index.showToast({
title: "拨打电话失败",
icon: "none"
});
}
});
};
const openFeedback = () => {
common_vendor.index.showToast({
title: "功能开发中",
icon: "none"
});
};
const checkUpdate = () => {
common_vendor.index.showToast({
title: "已是最新版本",
icon: "success"
});
};
const clearCache = () => {
common_vendor.index.showModal(new UTSJSONObject({
title: "提示",
content: "确定要清除缓存吗?",
success: (res) => {
if (res.confirm) {
common_vendor.index.clearStorage(new UTSJSONObject({
success: () => {
cacheSize.value = "0KB";
common_vendor.index.showToast({
title: "清除成功",
icon: "success"
});
}
}));
}
}
}));
};
common_vendor.onShow(() => {
checkLoginStatus();
getCacheSize();
});
return (_ctx, _cache) => {
"raw js";
const __returned__ = common_vendor.e({
a: common_vendor.unref(userInfo).avatar || "/static/images/default-avatar.png",
b: common_vendor.t(common_vendor.unref(userInfo).nickName || "点击登录"),
c: common_vendor.unref(userInfo).phone
}, common_vendor.unref(userInfo).phone ? {
d: common_vendor.t(common_vendor.unref(userInfo).phone)
} : {}, {
e: !common_vendor.unref(isLoggedIn)
}, !common_vendor.unref(isLoggedIn) ? {
f: common_vendor.o(handleLogin)
} : {}, {
g: common_vendor.unref(bookingCount) > 0
}, common_vendor.unref(bookingCount) > 0 ? {
h: common_vendor.t(common_vendor.unref(bookingCount))
} : {}, {
i: common_vendor.o(goToBookingList),
j: common_vendor.unref(favoriteCount) > 0
}, common_vendor.unref(favoriteCount) > 0 ? {
k: common_vendor.t(common_vendor.unref(favoriteCount))
} : {}, {
l: common_vendor.o(goToFavorites),
m: common_vendor.o(goToAbout),
n: common_vendor.o(callService),
o: common_vendor.o(openFeedback),
p: common_vendor.o(checkUpdate),
q: common_vendor.t(common_vendor.unref(cacheSize)),
r: common_vendor.o(clearCache),
s: common_vendor.unref(isLoggedIn)
}, common_vendor.unref(isLoggedIn) ? {
t: common_vendor.o(handleLogout)
} : {}, {
v: common_vendor.sei(common_vendor.gei(_ctx, ""), "view")
});
return __returned__;
};
}
});
wx.createPage(_sfc_main);
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/user/index.js.map

View File

@@ -0,0 +1,4 @@
{
"navigationBarTitleText": "我的",
"usingComponents": {}
}

View File

@@ -0,0 +1 @@
<view id="{{v}}" change:eS="{{uV.sS}}" eS="{{$eS[v]}}" change:eA="{{uV.sA}}" eA="{{$eA[v]}}" class="{{['page', virtualHostClass]}}" style="{{virtualHostStyle}}" hidden="{{virtualHostHidden || false}}"><scroll-view class="page-scroll" scroll-y enable-flex="true" enhanced="true"><view class="user-section"><view class="user-card"><view class="avatar-wrapper"><image class="user-avatar" src="{{a}}" mode="aspectFill"></image></view><view class="user-info"><text class="user-name">{{b}}</text><text wx:if="{{c}}" class="user-phone">{{d}}</text></view><view wx:if="{{e}}" class="user-action" bindtap="{{f}}"><text class="action-text">登录</text></view></view></view><view class="menu-section"><view class="menu-group"><view class="menu-item" bindtap="{{i}}"><view class="menu-left"><text class="menu-icon">📋</text><text class="menu-text">我的预约</text></view><view class="menu-right"><text wx:if="{{g}}" class="menu-badge">{{h}}</text><text class="menu-arrow"></text></view></view><view class="menu-item" bindtap="{{l}}"><view class="menu-left"><text class="menu-icon">❤️</text><text class="menu-text">我的收藏</text></view><view class="menu-right"><text wx:if="{{j}}" class="menu-badge">{{k}}</text><text class="menu-arrow"></text></view></view></view><view class="menu-group"><view class="menu-item" bindtap="{{m}}"><view class="menu-left"><text class="menu-icon">🏠</text><text class="menu-text">关于我们</text></view><view class="menu-right"><text class="menu-arrow"></text></view></view><view class="menu-item" bindtap="{{n}}"><view class="menu-left"><text class="menu-icon">📞</text><text class="menu-text">联系客服</text></view><view class="menu-right"><text class="menu-value">400-888-8888</text><text class="menu-arrow"></text></view></view><view class="menu-item" bindtap="{{o}}"><view class="menu-left"><text class="menu-icon">💬</text><text class="menu-text">意见反馈</text></view><view class="menu-right"><text class="menu-arrow"></text></view></view></view><view class="menu-group"><view class="menu-item" bindtap="{{p}}"><view class="menu-left"><text class="menu-icon">🔄</text><text class="menu-text">检查更新</text></view><view class="menu-right"><text class="menu-value">v1.0.0</text><text class="menu-arrow"></text></view></view><view class="menu-item" bindtap="{{r}}"><view class="menu-left"><text class="menu-icon">🧹</text><text class="menu-text">清除缓存</text></view><view class="menu-right"><text class="menu-value">{{q}}</text><text class="menu-arrow"></text></view></view></view></view><view wx:if="{{s}}" class="logout-section"><view class="logout-btn" bindtap="{{t}}"><text class="logout-text">退出登录</text></view></view><view class="bottom-space"></view></scroll-view></view><wxs src="/common/uniView.wxs" module="uV"/>

View File

@@ -0,0 +1,156 @@
@import "../../uvue.wxss";
:host{display:flex;flex-direction:column}
/**
* 优艺家沙发翻新 - 全局样式变量
*/
/* ========== 项目主题色 ========== */
/* 辅助色 */
/* 文字颜色 */
/* 背景色 */
/* 边框颜色 */
/* 间距 */
/* 圆角 */
/* 阴影 */
/* ========== uni-app 内置变量 ========== */
/* 行为相关颜色 */
/* 文字基本颜色 */
/* 背景颜色 */
/* 边框颜色 */
/* 尺寸变量 */
/* 文字尺寸 */
/* 图片尺寸 */
/* Border Radius */
/* 水平间距 */
/* 垂直间距 */
/* 透明度 */
/* 文章场景相关 */
.page {
flex: 1;
background-color: #f5f5f5;
}
.page-scroll {
flex: 1;
}
/* 用户信息 */
.user-section {
background: linear-gradient(135deg, #D4A574 0%, #B8895A 100%);
padding: 48rpx 32rpx 64rpx;
}
.user-card {
flex-direction: row;
align-items: center;
}
.avatar-wrapper {
width: 120rpx;
height: 120rpx;
border-radius: 50%;
overflow: hidden;
border-width: 4rpx;
border-style: solid;
border-color: rgba(255, 255, 255, 0.5);
}
.user-avatar {
width: 100%;
height: 100%;
}
.user-info {
flex: 1;
margin-left: 24rpx;
}
.user-name {
font-size: 36rpx;
font-weight: 600;
color: #ffffff;
}
.user-phone {
font-size: 26rpx;
color: rgba(255, 255, 255, 0.8);
margin-top: 8rpx;
}
.user-action {
background-color: rgba(255, 255, 255, 0.2);
padding: 16rpx 32rpx;
border-radius: 999rpx;
}
.action-text {
font-size: 28rpx;
color: #ffffff;
}
/* 菜单区域 */
.menu-section {
margin-top: -32rpx;
padding: 0 24rpx;
}
.menu-group {
background-color: #ffffff;
border-radius: 16rpx;
margin-bottom: 24rpx;
overflow: hidden;
}
.menu-item {
flex-direction: row;
align-items: center;
justify-content: space-between;
padding: 32rpx;
border-bottom-width: 1rpx;
border-bottom-style: solid;
border-bottom-color: #EBEEF5;
}
.menu-item:last-child {
border-bottom-width: 0;
}
.menu-left {
flex-direction: row;
align-items: center;
}
.menu-icon {
font-size: 40rpx;
margin-right: 24rpx;
}
.menu-text {
font-size: 30rpx;
color: #333333;
}
.menu-right {
flex-direction: row;
align-items: center;
}
.menu-value {
font-size: 26rpx;
color: #909399;
margin-right: 8rpx;
}
.menu-badge {
background-color: #F56C6C;
color: #ffffff;
font-size: 22rpx;
padding: 4rpx 12rpx;
border-radius: 999rpx;
margin-right: 8rpx;
}
.menu-arrow {
font-size: 32rpx;
color: #909399;
}
/* 退出登录 */
.logout-section {
padding: 24rpx;
}
.logout-btn {
background-color: #ffffff;
border-radius: 16rpx;
padding: 28rpx 0;
align-items: center;
}
.logout-text {
font-size: 30rpx;
color: #F56C6C;
}
/* 底部间距 */
.bottom-space {
height: 120rpx;
}