refactor: 抽取首页品牌与宣言模块
This commit is contained in:
1 parent
3d3e8c95f5
commit
48f64a85c5
11 files changed
+12
-4
No files matched your search
@@ -0,0 +1 @@
|
||||
Component({ properties: { hero: { type: Object, value: {} } }, methods: { explore() { this.triggerEvent("explore"); } } });
|
||||
@@ -0,0 +1 @@
|
||||
{"component":true}
|
||||
@@ -0,0 +1 @@
|
||||
<view class="hero"><image class="hero-image" src="{{hero.image}}" mode="aspectFill"/><view class="hero-shade"/><view class="hero-copy"><text class="eyebrow">{{hero.eyebrow}}</text><text class="hero-title">{{hero.title}}</text><text class="hero-slogan">{{hero.slogan}}</text><button class="hero-button" bindtap="explore">{{hero.cta}}</button></view></view>
|
||||
@@ -0,0 +1 @@
|
||||
.hero{position:relative;overflow:hidden;margin-top:22rpx;height:560rpx;border-radius:16rpx;background:#202221}.hero-image{width:100%;height:100%;display:block}.hero-shade{position:absolute;inset:0;background:linear-gradient(180deg,transparent 30%,rgba(32,34,33,.9))}.hero-copy{position:absolute;left:28rpx;right:28rpx;bottom:28rpx;color:#fff}.eyebrow{display:block;color:#d9c8b2;font-size:20rpx;letter-spacing:3rpx}.hero-title{display:block;margin-top:14rpx;font:40rpx serif}.hero-slogan{display:block;margin-top:10rpx;color:#ddd5cb;font-size:23rpx}.hero-button{margin:24rpx 0 0 0;padding:0 22rpx;border:1rpx solid #d9c8b2;border-radius:0;background:transparent;color:#fff;font-size:24rpx}
|
||||
@@ -0,0 +1 @@
|
||||
Component({ properties: { content: { type: Object, value: {} } } });
|
||||
@@ -0,0 +1 @@
|
||||
{"component":true}
|
||||
@@ -0,0 +1 @@
|
||||
<view class="trust"><text class="eyebrow">林境门作品质宣言</text><text class="section-title light">拒绝流水线拼装</text><view wx:for="{{content.pillars}}" wx:key="title"><text class="work-name light">{{item.title}}</text><text class="body light-body">{{item.desc}}</text></view></view>
|
||||
@@ -0,0 +1 @@
|
||||
.trust{margin-top:22rpx;padding:32rpx;background:#202221;color:#fff;border-radius:16rpx}.eyebrow{display:block;color:#d9c8b2;font-size:20rpx;letter-spacing:3rpx}.section-title{display:block;margin-top:12rpx;font:42rpx serif}.light{color:#fff}.work-name{display:block;margin-top:24rpx;font:29rpx serif}.body{display:block;margin-top:8rpx;color:#77736b;font-size:24rpx;line-height:1.7}.light-body{color:#c8c5bf}
|
||||
@@ -1,7 +1,7 @@
|
||||
const { brand, trustContent, offerings } = require("../../utils/linjing-data");
|
||||
const { loadWorkspaceWithFallback } = require("../../utils/runtime-workspace");
|
||||
Page({
|
||||
data: { brand, trustContent, offerings, modules: [], theme: {}, loading: false },
|
||||
data: { brand, trustContent, offerings, modules: [], theme: {}, hero: { image: "https://images.unsplash.com/photo-1600585154340-be6161a56a0c?auto=format&fit=crop&w=900&q=80", eyebrow: "年度落成实景 · 莫干山庄园", title: "万籁系列 · 铸铜冷锻双轴入户门", slogan: "门高 3.4m · 德国静音地轴", cta: "探索全系作品 →" }, loading: false },
|
||||
onLoad() { this.setData({ loading: true }); loadWorkspaceWithFallback().then((workspace) => { this.setData({ brand: workspace.brand, trustContent: workspace.trustContent || trustContent, offerings: workspace.offerings || offerings, modules: workspace.modules || [], theme: workspace.theme || {}, loading: false }); wx.setNavigationBarTitle({ title: workspace.brand.name || brand.name }); }); },
|
||||
selectOffering(e) { const id = e.detail ? e.detail.id : e.currentTarget.dataset.id; wx.navigateTo({ url: "/pages/offering/detail?id=" + id }); },
|
||||
goWorks() { wx.switchTab({ url: "/pages/services/index" }); },
|
||||
|
||||
@@ -1 +1 @@
|
||||
{"navigationBarTitleText":"品牌首页","usingComponents":{"founder-card":"/components/modules/founder-card/founder-card","trust-proof":"/components/modules/trust-proof/trust-proof","offering-list":"/components/modules/offering-list/offering-list"}}
|
||||
{"navigationBarTitleText":"品牌首页","usingComponents":{"founder-card":"/components/modules/founder-card/founder-card","brand-hero":"/components/modules/brand-hero/brand-hero","trust-proof":"/components/modules/trust-proof/trust-proof","trust-manifesto":"/components/modules/trust-manifesto/trust-manifesto","offering-list":"/components/modules/offering-list/offering-list"}}
|
||||
@@ -1,7 +1,7 @@
|
||||
<view class="page">
|
||||
<founder-card brand="{{brand}}" />
|
||||
<view class="hero"><image class="hero-image" src="https://images.unsplash.com/photo-1600585154340-be6161a56a0c?auto=format&fit=crop&w=900&q=80" mode="aspectFill"/><view class="hero-shade"/><view class="hero-copy"><text class="eyebrow">年度落成实景 · 莫干山庄园</text><text class="hero-title">万籁系列 · 铸铜冷锻双轴入户门</text><text class="hero-slogan">门高 3.4m · 德国静音地轴</text><button class="hero-button" bindtap="goWorks">探索全系作品 →</button></view></view>
|
||||
<brand-hero hero="{{hero}}" bind:explore="goWorks" />
|
||||
<trust-proof content="{{trustContent}}" />
|
||||
<view class="trust"><text class="eyebrow">林境门作品质宣言</text><text class="section-title light">拒绝流水线拼装</text><view wx:for="{{trustContent.pillars}}" wx:key="title"><text class="work-name light">{{item.title}}</text><text class="body light-body">{{item.desc}}</text></view></view>
|
||||
<trust-manifesto content="{{trustContent}}" />
|
||||
<offering-list offerings="{{offerings}}" bind:open="selectOffering" bind:more="goWorks" />
|
||||
</view>
|
||||
Reference in new issue
Block a user