初始化参股
This commit is contained in:
287
前端/unpackage/dist/dev/mp-weixin/pages/index/index.js
vendored
Normal file
287
前端/unpackage/dist/dev/mp-weixin/pages/index/index.js
vendored
Normal 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
|
||||
10
前端/unpackage/dist/dev/mp-weixin/pages/index/index.json
vendored
Normal file
10
前端/unpackage/dist/dev/mp-weixin/pages/index/index.json
vendored
Normal 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"
|
||||
}
|
||||
}
|
||||
1
前端/unpackage/dist/dev/mp-weixin/pages/index/index.wxml
vendored
Normal file
1
前端/unpackage/dist/dev/mp-weixin/pages/index/index.wxml
vendored
Normal 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"/>
|
||||
144
前端/unpackage/dist/dev/mp-weixin/pages/index/index.wxss
vendored
Normal file
144
前端/unpackage/dist/dev/mp-weixin/pages/index/index.wxss
vendored
Normal 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;
|
||||
}
|
||||
Reference in New Issue
Block a user