feat:首页输入框、文字卡片

This commit is contained in:
2025-05-30 20:49:35 +08:00
parent c00c45a9be
commit 419818eb24
22 changed files with 517 additions and 288 deletions
+7
View File
@@ -0,0 +1,7 @@
{
"navigationBarTitleText": "首页",
"navigationBarBackgroundColor": "#d2e7d8",
"homeButton": true,
"backgroundColor": "#e8eddb",
"enablePullDownRefresh": false
}
+33
View File
@@ -0,0 +1,33 @@
/**index.less**/
page {
height: 100vh;
display: flex;
flex-direction: column;
}
.scroll-view {
flex: 1;
overflow-y: hidden;
}
.card {
margin: 10px;
padding: 10px;
background-color: #fff;
border-radius: 10px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
width: calc(33.33% - 20px);
/* Adjust width for three cards per row */
box-sizing: border-box;
/* Ensure padding and margin are included in the width */
display: inline-block;
/* Allow cards to sit next to each other */
vertical-align: top;
/* Align cards to the top */
.card-title {
font-size: 18px;
font-weight: bold;
color: #333;
}
}
+32
View File
@@ -0,0 +1,32 @@
Page({
data: {
cards: [
{
key: 0,
title: '文本绘制',
url: '/demoPages/textPaint/textPaint',
},
{
key: 1,
title: '文本绘制2',
url: '/demoPages/textPaint2/textPaint',
},
{
key: 2,
title: '文本绘制',
url: '/demoPages/textPaint/textPaint',
},
{
key: 3,
title: '文本绘制',
url: '/demoPages/textPaint/textPaint',
},
],
},
tapCard(e: WechatMiniprogram.TouchEvent) {
const { url } = e.currentTarget.dataset;
console.log('navigateTo url:', url);
wx.navigateTo({ url });
},
});
+12
View File
@@ -0,0 +1,12 @@
<!--index.wxml-->
<scroll-view class="scroll-view" scroll-y type="list">
<view
class="card"
wx:for="{{cards}}"
wx:for-item="card"
wx:key="*this"
bindtap="tapCard"
data-url="{{card.url}}">
<view class="card-title">{{card.title}}</view>
</view>
</scroll-view>