初始化参股

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,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;
}