feat:生产初版页面
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
.category-tabs {
|
||||
background: #fff;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.category-tabs__scroll {
|
||||
width: 100%;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.category-tabs__inner {
|
||||
display: inline-flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
gap: 16rpx;
|
||||
padding: 16rpx 24rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.category-tabs__pill {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 12rpx 32rpx;
|
||||
border-radius: 32rpx;
|
||||
background: #f5f5f5;
|
||||
font-size: 28rpx;
|
||||
color: rgba(0, 0, 0, 0.65);
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.category-tabs__pill--active {
|
||||
background: #f7ee47;
|
||||
font-weight: 600;
|
||||
color: rgba(0, 0, 0, 0.88);
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
Component({
|
||||
options: {
|
||||
styleIsolation: 'apply-shared',
|
||||
},
|
||||
properties: {
|
||||
tabs: {
|
||||
type: Array,
|
||||
value: [],
|
||||
},
|
||||
activeTab: {
|
||||
type: String,
|
||||
value: '',
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
onTabTap(e: WechatMiniprogram.TouchEvent) {
|
||||
const id = (e.currentTarget.dataset.id as string) || '';
|
||||
if (!id) return;
|
||||
this.triggerEvent('change', { id });
|
||||
},
|
||||
},
|
||||
});
|
||||
@@ -0,0 +1,15 @@
|
||||
<view class="category-tabs">
|
||||
<scroll-view class="category-tabs__scroll" scroll-x>
|
||||
<view class="category-tabs__inner">
|
||||
<view
|
||||
wx:for="{{tabs}}"
|
||||
wx:key="id"
|
||||
class="category-tabs__pill {{activeTab === item.id ? 'category-tabs__pill--active' : ''}}"
|
||||
data-id="{{item.id}}"
|
||||
bindtap="onTabTap"
|
||||
>
|
||||
{{item.name}}
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {}
|
||||
}
|
||||
@@ -0,0 +1,104 @@
|
||||
.detail-card {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: stretch;
|
||||
background: #fff;
|
||||
border-radius: 32rpx;
|
||||
box-shadow: 0 8rpx 32rpx rgba(0, 0, 0, 0.08);
|
||||
overflow: hidden;
|
||||
transition: transform 0.15s ease;
|
||||
}
|
||||
|
||||
.detail-card--active {
|
||||
transform: scale(0.98);
|
||||
}
|
||||
|
||||
.detail-card__preview {
|
||||
width: 240rpx;
|
||||
min-height: 200rpx;
|
||||
flex-shrink: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.detail-card__preview-text {
|
||||
font-size: 56rpx;
|
||||
line-height: 1.2;
|
||||
text-align: center;
|
||||
padding: 16rpx;
|
||||
color: rgba(0, 0, 0, 0.45);
|
||||
}
|
||||
|
||||
.detail-card__body {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
padding: 24rpx 24rpx 24rpx 16rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
gap: 12rpx;
|
||||
}
|
||||
|
||||
.detail-card__title {
|
||||
font-size: 28rpx;
|
||||
font-weight: 600;
|
||||
color: rgba(0, 0, 0, 0.88);
|
||||
line-height: 1.4;
|
||||
}
|
||||
|
||||
.detail-card__meta {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 8rpx;
|
||||
}
|
||||
|
||||
.detail-card__badge {
|
||||
font-size: 20rpx;
|
||||
line-height: 1.4;
|
||||
padding: 4rpx 12rpx;
|
||||
border-radius: 8rpx;
|
||||
}
|
||||
|
||||
.detail-card__badge--age {
|
||||
background: #e3f2fd;
|
||||
color: #1976d2;
|
||||
}
|
||||
|
||||
.detail-card__badge--diff {
|
||||
background: #fff8e1;
|
||||
color: #f57f17;
|
||||
}
|
||||
|
||||
.detail-card__stats {
|
||||
font-size: 22rpx;
|
||||
color: rgba(0, 0, 0, 0.45);
|
||||
}
|
||||
|
||||
.detail-card__actions {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
gap: 16rpx;
|
||||
margin-top: 8rpx;
|
||||
}
|
||||
|
||||
.detail-card__btn {
|
||||
font-size: 24rpx;
|
||||
line-height: 1.4;
|
||||
padding: 12rpx 28rpx;
|
||||
border-radius: 40rpx;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.detail-card__btn--primary {
|
||||
background: #f7ee47;
|
||||
color: rgba(0, 0, 0, 0.88);
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.detail-card__btn--ghost {
|
||||
background: #f5f5f5;
|
||||
color: rgba(0, 0, 0, 0.65);
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
Component({
|
||||
properties: {
|
||||
title: {
|
||||
type: String,
|
||||
value: '',
|
||||
},
|
||||
previewBg: {
|
||||
type: String,
|
||||
value: '#f5f5f5',
|
||||
},
|
||||
previewText: {
|
||||
type: String,
|
||||
value: '',
|
||||
},
|
||||
ageRange: {
|
||||
type: String,
|
||||
value: '',
|
||||
},
|
||||
difficulty: {
|
||||
type: String,
|
||||
value: '',
|
||||
},
|
||||
downloads: {
|
||||
type: String,
|
||||
value: '',
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
onTap() {
|
||||
this.triggerEvent('tap');
|
||||
},
|
||||
onGenerate() {
|
||||
this.triggerEvent('generate');
|
||||
},
|
||||
onFav() {
|
||||
this.triggerEvent('fav');
|
||||
},
|
||||
},
|
||||
});
|
||||
@@ -0,0 +1,22 @@
|
||||
<view
|
||||
class="detail-card"
|
||||
hover-class="detail-card--active"
|
||||
hover-stay-time="100"
|
||||
bindtap="onTap"
|
||||
>
|
||||
<view class="detail-card__preview" style="background-color: {{previewBg}}">
|
||||
<text class="detail-card__preview-text">{{previewText}}</text>
|
||||
</view>
|
||||
<view class="detail-card__body">
|
||||
<view class="detail-card__title">{{title}}</view>
|
||||
<view class="detail-card__meta">
|
||||
<view wx:if="{{ageRange}}" class="detail-card__badge detail-card__badge--age">{{ageRange}}</view>
|
||||
<view wx:if="{{difficulty}}" class="detail-card__badge detail-card__badge--diff">{{difficulty}}</view>
|
||||
</view>
|
||||
<view wx:if="{{downloads}}" class="detail-card__stats">{{downloads}}</view>
|
||||
<view class="detail-card__actions">
|
||||
<view class="detail-card__btn detail-card__btn--primary" catchtap="onGenerate">生成</view>
|
||||
<view class="detail-card__btn detail-card__btn--ghost" catchtap="onFav">收藏</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {}
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
.worksheet-card {
|
||||
background: #fff;
|
||||
border-radius: 24rpx;
|
||||
box-shadow: 0 8rpx 32rpx rgba(0, 0, 0, 0.08);
|
||||
overflow: hidden;
|
||||
transition: transform 0.15s ease;
|
||||
}
|
||||
|
||||
.worksheet-card--active {
|
||||
transform: scale(0.96);
|
||||
}
|
||||
|
||||
.worksheet-card__preview {
|
||||
position: relative;
|
||||
height: 160rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.worksheet-card__img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.worksheet-card__preview-text {
|
||||
font-size: 48rpx;
|
||||
line-height: 1.2;
|
||||
text-align: center;
|
||||
padding: 0 24rpx;
|
||||
color: rgba(0, 0, 0, 0.65);
|
||||
}
|
||||
|
||||
.worksheet-card__title {
|
||||
padding: 20rpx 24rpx 12rpx;
|
||||
font-size: 24rpx;
|
||||
font-weight: 600;
|
||||
color: rgba(0, 0, 0, 0.88);
|
||||
line-height: 1.4;
|
||||
}
|
||||
|
||||
.worksheet-card__tags {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 12rpx;
|
||||
padding: 0 24rpx 24rpx;
|
||||
}
|
||||
|
||||
.worksheet-card__tag {
|
||||
font-size: 20rpx;
|
||||
line-height: 1.4;
|
||||
padding: 6rpx 16rpx;
|
||||
border-radius: 8rpx;
|
||||
}
|
||||
|
||||
.worksheet-card__tag--age {
|
||||
background: #e3f2fd;
|
||||
color: #1976d2;
|
||||
}
|
||||
|
||||
.worksheet-card__tag--diff {
|
||||
background: #fff8e1;
|
||||
color: #f57f17;
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
Component({
|
||||
options: {
|
||||
styleIsolation: 'apply-shared',
|
||||
},
|
||||
properties: {
|
||||
title: {
|
||||
type: String,
|
||||
value: '',
|
||||
},
|
||||
previewBg: {
|
||||
type: String,
|
||||
value: '#f5f5f5',
|
||||
},
|
||||
previewText: {
|
||||
type: String,
|
||||
value: '',
|
||||
},
|
||||
ageRange: {
|
||||
type: String,
|
||||
value: '',
|
||||
},
|
||||
difficulty: {
|
||||
type: String,
|
||||
value: '',
|
||||
},
|
||||
img: {
|
||||
type: String,
|
||||
value: '',
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
onTap() {
|
||||
this.triggerEvent('tap');
|
||||
},
|
||||
},
|
||||
});
|
||||
@@ -0,0 +1,21 @@
|
||||
<view
|
||||
class="worksheet-card"
|
||||
hover-class="worksheet-card--active"
|
||||
hover-stay-time="100"
|
||||
bindtap="onTap"
|
||||
>
|
||||
<view class="worksheet-card__preview" style="background-color: {{previewBg}}">
|
||||
<image
|
||||
wx:if="{{img}}"
|
||||
class="worksheet-card__img"
|
||||
src="{{img}}"
|
||||
mode="aspectFill"
|
||||
/>
|
||||
<text wx:else class="worksheet-card__preview-text">{{previewText}}</text>
|
||||
</view>
|
||||
<view class="worksheet-card__title">{{title}}</view>
|
||||
<view class="worksheet-card__tags">
|
||||
<view wx:if="{{ageRange}}" class="worksheet-card__tag worksheet-card__tag--age">{{ageRange}}</view>
|
||||
<view wx:if="{{difficulty}}" class="worksheet-card__tag worksheet-card__tag--diff">{{difficulty}}</view>
|
||||
</view>
|
||||
</view>
|
||||
Reference in New Issue
Block a user