feat: 修改字母描红逻辑,添加字母手写字体
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"navigationBarTitleText": "数感启蒙",
|
||||
"navigationBarTextStyle": "black",
|
||||
"navigationBarBackgroundColor": "#FFD719",
|
||||
"homeButton": true,
|
||||
"backgroundColor": "#F6F6F6",
|
||||
"enablePullDownRefresh": false,
|
||||
"usingComponents": {
|
||||
"add-to-miniprogram-tip": "../../components/add-to-miniprogram-tip/add-to-miniprogram-tip"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,161 @@
|
||||
page {
|
||||
background-color: #f6f6f6;
|
||||
}
|
||||
|
||||
.page-container {
|
||||
background-color: #f6f6f6;
|
||||
padding: 0 24rpx;
|
||||
box-sizing: border-box;
|
||||
|
||||
.empty {
|
||||
height: 190rpx;
|
||||
}
|
||||
}
|
||||
|
||||
/* 数学页面标题和描述 */
|
||||
.math-page-header {
|
||||
text-align: center;
|
||||
padding: 28rpx 0;
|
||||
}
|
||||
|
||||
.math-page-title {
|
||||
font-size: 36rpx;
|
||||
font-weight: 600;
|
||||
color: #141414;
|
||||
margin-bottom: 16rpx;
|
||||
}
|
||||
|
||||
.math-page-subtitle {
|
||||
font-size: 24rpx;
|
||||
color: #666666;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
/* 数学功能列表样式 - 两列瀑布流 */
|
||||
.math-functions-list {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
flex-wrap: wrap;
|
||||
gap: 22rpx;
|
||||
margin-bottom: 40rpx;
|
||||
}
|
||||
|
||||
.math-function-item {
|
||||
background: #ffffff;
|
||||
border: 2rpx solid #e8e8e8;
|
||||
border-radius: 24rpx;
|
||||
padding: 24rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: 18rpx;
|
||||
flex: 0 0 calc(50% - 12rpx);
|
||||
box-sizing: border-box;
|
||||
transition: all 0.2s ease-in-out;
|
||||
box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.05);
|
||||
position: relative;
|
||||
|
||||
&::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
border-radius: 24rpx;
|
||||
opacity: 0;
|
||||
background: rgba(147, 211, 51, 0.1);
|
||||
transition: opacity 0.2s ease-in-out;
|
||||
}
|
||||
|
||||
&:active {
|
||||
&::after {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
border-color: #93d333;
|
||||
box-shadow: 0 8rpx 24rpx rgba(147, 211, 51, 0.2);
|
||||
}
|
||||
}
|
||||
|
||||
.function-item-img-wrapper {
|
||||
width: 100%;
|
||||
height: 310rpx;
|
||||
flex-shrink: 0;
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
border-radius: 16rpx;
|
||||
overflow: hidden;
|
||||
background-color: #f5f5f5;
|
||||
// border: 1rpx solid #e8e8e8;
|
||||
}
|
||||
|
||||
.function-item-img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.function-item-title {
|
||||
font-size: 30rpx;
|
||||
font-weight: 600;
|
||||
color: #141414;
|
||||
line-height: 1.4;
|
||||
text-align: left;
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
width: 100%;
|
||||
margin-top: 4rpx;
|
||||
}
|
||||
|
||||
.function-item-desc {
|
||||
font-size: 24rpx;
|
||||
color: #666666;
|
||||
line-height: 1.5;
|
||||
text-align: left;
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
/* 使用提示 */
|
||||
.usage-hint {
|
||||
background: linear-gradient(135deg, #fff7e6 0%, #fffbe6 100%);
|
||||
border: 2rpx solid #ffd719;
|
||||
border-radius: 24rpx;
|
||||
padding: 32rpx;
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
gap: 24rpx;
|
||||
box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.05);
|
||||
}
|
||||
|
||||
.hint-icon {
|
||||
font-size: 40rpx;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.hint-text {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.hint-title {
|
||||
font-size: 28rpx;
|
||||
font-weight: 600;
|
||||
color: #141414;
|
||||
margin-bottom: 8rpx;
|
||||
}
|
||||
|
||||
.hint-desc {
|
||||
font-size: 24rpx;
|
||||
color: #666666;
|
||||
line-height: 1.5;
|
||||
|
||||
view {
|
||||
margin-bottom: 8rpx;
|
||||
|
||||
&:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
import { MATH_FUNCTION_TYPES } from '../../constants/mathFunctions';
|
||||
import tracker from '../../utils/tracker';
|
||||
import { defaultShareConfig } from '../../config/config';
|
||||
|
||||
Page({
|
||||
data: {
|
||||
functionList: MATH_FUNCTION_TYPES,
|
||||
},
|
||||
|
||||
onLoad() {
|
||||
// 页面加载
|
||||
},
|
||||
|
||||
/**
|
||||
* 打开数学功能页面
|
||||
*/
|
||||
openMathFunction(e: WechatMiniprogram.TouchEvent) {
|
||||
const functionId = e.currentTarget.dataset.function;
|
||||
const functionItem = this.data.functionList.find(
|
||||
(item) => item.id === functionId,
|
||||
);
|
||||
|
||||
if (!functionItem) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 如果有page字段,跳转到对应页面
|
||||
if (functionItem.page) {
|
||||
wx.navigateTo({
|
||||
url: `/mathPages/${functionItem.page}/${functionItem.page}?id=${functionId}`,
|
||||
});
|
||||
} else {
|
||||
wx.showToast({
|
||||
title: `功能开发中,敬请期待`,
|
||||
icon: 'none',
|
||||
duration: 2500,
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
onShareAppMessage() {
|
||||
// 上报分享埋点
|
||||
tracker.reportShare('数感启蒙');
|
||||
|
||||
return {
|
||||
...defaultShareConfig,
|
||||
path: `/pages/mathIndex/mathIndex`,
|
||||
};
|
||||
},
|
||||
onShareTimeline() {
|
||||
// 上报分享埋点
|
||||
tracker.reportShare('数感启蒙');
|
||||
|
||||
return {
|
||||
...defaultShareConfig,
|
||||
query: `/pages/mathIndex/mathIndex`,
|
||||
};
|
||||
},
|
||||
});
|
||||
@@ -0,0 +1,46 @@
|
||||
<view class="page-container">
|
||||
<!-- 页面标题和描述 -->
|
||||
<view class="math-page-header">
|
||||
<!-- <view class="math-page-title">数感启蒙</view> -->
|
||||
<view class="math-page-subtitle">
|
||||
选择功能,生成可打印的数感启蒙涂鸦卡
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 功能列表 -->
|
||||
<view class="math-functions-list">
|
||||
<view
|
||||
class="math-function-item"
|
||||
wx:for="{{functionList}}"
|
||||
wx:key="id"
|
||||
data-function="{{item.id}}"
|
||||
bind:tap="openMathFunction"
|
||||
>
|
||||
<view class="function-item-img-wrapper">
|
||||
<image
|
||||
class="function-item-img"
|
||||
src="{{item.img}}"
|
||||
mode="aspectFill"
|
||||
></image>
|
||||
</view>
|
||||
<view class="function-item-title">{{item.title}}</view>
|
||||
<view class="function-item-desc">{{item.desc}}</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 使用提示 -->
|
||||
<view class="usage-hint">
|
||||
<view class="hint-icon">💡</view>
|
||||
<view class="hint-text">
|
||||
<view class="hint-title">使用提示</view>
|
||||
<view class="hint-desc">
|
||||
<view>1. 点击上方功能卡片选择要生成的涂鸦卡类型</view>
|
||||
<view>2. 选择数字等参数</view>
|
||||
<view>3. 预览生成的涂鸦卡效果</view>
|
||||
<view>4. 下载A4格式PNG图片,打印后使用</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="empty"></view>
|
||||
<add-to-miniprogram-tip />
|
||||
</view>
|
||||
Reference in New Issue
Block a user