feat:下载分享检查

This commit is contained in:
R524809
2025-11-21 17:17:36 +08:00
parent ddab64bb20
commit ec773a650c
27 changed files with 267 additions and 181076 deletions
+6 -6
View File
@@ -37,17 +37,17 @@
"selectedIconPath": "assets/tabBar/icon-word-active.png",
"text": "识字"
},
{
"pagePath": "pages/shape/index",
"iconPath": "assets/tabBar/icon-shape.png",
"selectedIconPath": "assets/tabBar/icon-shape-active.png",
"text": "图形"
},
{
"pagePath": "pages/copyBook/copyBook",
"iconPath": "assets/tabBar/icon-edit.png",
"selectedIconPath": "assets/tabBar/icon-edit-active.png",
"text": "练字"
},
{
"pagePath": "pages/shape/index",
"iconPath": "assets/tabBar/icon-shape.png",
"selectedIconPath": "assets/tabBar/icon-shape-active.png",
"text": "图形"
}
]
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 486 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.2 KiB

-6
View File
@@ -1,6 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="60" height="60" viewBox="0 0 60 60" fill="none">
<path d="M30.5 52C42.3741 52 52 42.3741 52 30.5C52 18.6259 42.3741 9 30.5 9C18.6259 9 9 18.6259 9 30.5C9 42.3741 18.6259 52 30.5 52ZM30.5 10C41.8218 10 51 19.1782 51 30.5C51 41.8218 41.8218 51 30.5 51C19.1782 51 10 41.8218 10 30.5C10 19.1782 19.1782 10 30.5 10Z" fill-rule="evenodd" fill="#000000" >
</path>
<circle cx="30.5" cy="30.5" r="20.5" fill="#FC0000" >
</circle>
</svg>

Before

Width:  |  Height:  |  Size: 521 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 579 B

-4
View File
@@ -1,4 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="60" height="60" viewBox="0 0 60 60" fill="none">
<path d="M52 38C52 25.8497 42.1503 16 30 16C17.8497 16 8 25.8497 8 38L52 38Z" stroke="rgba(20, 20, 20, 1)" stroke-width="1" >
</path>
</svg>

Before

Width:  |  Height:  |  Size: 282 B

@@ -0,0 +1,7 @@
{
"component": true,
"styleIsolation": "isolated",
"usingComponents": {
"van-popup": "@vant/weapp/popup/index"
}
}
@@ -0,0 +1,59 @@
.share-guide-popup {
.share-guide-popup-content {
padding: 60rpx 40rpx 40rpx;
width: 600rpx;
box-sizing: border-box;
}
.share-guide-popup-title {
font-size: 36rpx;
font-weight: 600;
color: #323233;
text-align: center;
margin-bottom: 30rpx;
}
.share-guide-popup-message {
font-size: 28rpx;
color: #646566;
line-height: 1.6;
text-align: center;
margin-bottom: 20rpx;
}
.share-guide-popup-hint {
font-size: 24rpx;
color: #969799;
line-height: 1.5;
text-align: center;
margin-bottom: 50rpx;
}
.share-guide-popup-buttons {
display: flex;
flex-direction: column;
gap: 20rpx;
}
.share-button {
width: 100%;
height: 88rpx;
line-height: 88rpx;
border-radius: 8rpx;
font-size: 32rpx;
font-weight: 500;
border: none;
box-sizing: border-box;
padding: 0;
margin: 0;
&::after {
border: none;
}
&--primary {
background: linear-gradient(135deg, #07c160 0%, #06ad56 100%);
color: #ffffff;
}
}
}
@@ -0,0 +1,40 @@
import { recordShareSuccess } from '../../utils/shareGuide';
Component({
options: {},
/**
* 组件的属性列表
*/
properties: {
show: {
type: Boolean,
value: false,
},
},
/**
* 组件的初始数据
*/
data: {},
/**
* 组件的方法列表
*/
methods: {
/** 关闭弹窗 */
onClose() {
this.triggerEvent('onClose');
},
/** 点击遮罩层关闭 */
onOverlayClick() {
this.onClose();
},
/** 点击分享按钮 */
onShare() {
// 记录分享成功(用户点击了分享按钮,视为已分享)
recordShareSuccess();
// 关闭弹窗并通知父组件分享成功(不触发下载,用户需要重新点击下载按钮)
this.triggerEvent('onShareSuccess');
},
},
});
@@ -0,0 +1,25 @@
<van-popup
show="{{show}}"
position="center"
round
closeable
close-on-click-overlay
bind:close="onClose"
bind:click-overlay="onOverlayClick"
custom-class="share-guide-popup">
<view class="share-guide-popup-content">
<view class="share-guide-popup-title">分享解锁下载</view>
<view class="share-guide-popup-message"> 今日免费下载次数已用完 </view>
<view class="share-guide-popup-hint">
分享给好友后,可重新点击“下载打印”按钮继续下载
</view>
<view class="share-guide-popup-buttons">
<button
class="share-button share-button--primary"
open-type="share"
bind:tap="onShare">
分享给好友
</button>
</view>
</view>
</van-popup>
-137
View File
@@ -1,137 +0,0 @@
{
"其": [
"M8.1 14.04 L9.72 15.66 L27 13.5 L44.82 11.88 L42.66 10.26 L39.96 10.8 L27 12.42 Z",
"M18.36 35.1 L18.36 7.02 L19.44 4.86 L16.2 1.62 L16.74 7.02 L16.74 35.1 Z",
"M34.56 18.9 L34.56 5.4 L35.64 3.24 L32.4 0 L32.94 5.4 L32.94 18.9 L31.86 34.02 L33.48 34.02 Z",
"M17.82 20.52 L18.9 21.6 L24.3 21.06 L29.7 20.52 L27.54 18.9 L25.38 19.44 L24.3 19.98 Z",
"M17.82 28.08 L18.9 29.16 L24.3 28.62 L29.7 28.08 L28.08 26.46 L24.3 27.54 Z",
"M2.7 36.18 L4.32 37.8 L26.46 35.64 L48.6 34.02 L45.9 31.86 L43.2 32.94 L26.46 34.56 Z",
"M19.98 38.34 L18.9 40.5 L16.74 42.66 L11.34 46.98 L8.1 49.14 L4.86 50.76 L6.48 50.76 L10.26 48.6 L16.74 44.28 L21.06 42.12 Z",
"M41.58 49.14 L41.58 45.36 L35.1 41.58 L28.62 38.34 Z"
],
"值": [
"M15.12 9.18 L17.82 5.94 L15.66 2.16 L14.58 6.48 L10.26 14.58 L4.32 22.14 L1.08 25.38 L2.16 25.38 L7.56 19.98 Z",
"M11.88 42.66 L11.88 14.58 L10.8 14.58 L10.8 42.66 L9.72 46.44 L11.88 50.22 Z",
"M16.74 12.42 L18.36 14.04 L31.86 11.88 L45.36 10.8 L43.2 8.64 L39.42 9.72 L31.86 10.8 Z",
"M31.32 9.18 L31.32 5.94 L32.4 3.78 L29.16 0.54 L29.7 5.94 L29.7 9.18 L29.16 18.36 L30.24 18.36 Z",
"M23.22 44.82 L23.22 19.98 L23.22 18.9 L21.6 16.2 L21.6 18.36 L22.14 19.98 L22.14 44.82 Z",
"M38.34 43.74 L39.96 19.44 L41.58 17.82 L39.42 15.66 L37.26 17.82 L23.76 18.9 L23.76 19.98 L38.34 18.9 L36.72 43.74 Z",
"M22.68 25.38 L23.76 26.46 L29.16 25.92 L34.56 24.84 L33.48 23.76 L29.16 24.84 Z",
"M22.68 31.32 L23.76 32.4 L28.62 31.86 L34.02 31.32 L32.94 30.24 L28.62 30.78 Z",
"M22.68 37.8 L23.76 38.88 L28.62 38.34 L34.02 37.26 L32.94 36.18 L28.62 37.26 Z",
"M14.04 45.36 L15.66 46.98 L31.86 45.36 L48.06 44.82 L45.9 42.66 L42.12 43.74 L31.86 44.28 Z"
],
"窿": [
"M27 5.94 L27.54 3.24 L22.68 0.54 Z",
"M9.72 4.86 L8.64 9.72 L6.48 14.04 L7.56 16.2 L8.64 14.04 L9.72 10.26 Z",
"M42.66 8.64 L43.2 7.56 L45.36 5.4 L43.2 3.24 L41.04 5.4 L10.26 8.1 L10.26 9.18 L41.58 6.48 L41.04 8.64 L39.96 11.34 Z",
"M7.56 18.9 L15.12 15.12 L19.44 12.42 L21.06 11.34 L20.52 8.64 L16.2 12.96 L11.34 16.2 L7.02 18.9 Z",
"M30.24 9.18 L29.7 9.18 L36.18 12.96 L41.58 16.74 L40.5 13.5 Z",
"M17.82 22.68 L18.9 20.52 L21.06 18.36 L18.9 16.2 L16.74 18.36 L10.26 19.44 L10.26 20.52 L17.82 19.44 L16.74 22.68 L15.12 25.92 L16.74 27.54 L18.36 30.78 L18.36 32.94 L17.82 35.64 L11.88 32.94 L17.28 38.34 L18.9 36.72 L19.44 34.56 L19.44 30.78 L17.28 26.46 L16.2 25.38 Z",
"M10.8 43.2 L10.8 21.06 L10.8 19.98 L9.18 17.28 L9.18 19.44 L9.72 21.06 L9.72 43.2 L8.64 46.98 L10.8 50.76 Z",
"M21.06 25.38 L25.92 19.98 L27.54 16.2 L29.7 14.04 L27.54 10.8 L27.54 13.5 L24.84 19.98 L20.52 25.38 Z",
"M35.64 20.52 L37.26 18.36 L38.88 16.74 L36.72 15.12 L34.56 16.74 L27 17.28 L27 18.36 L35.64 17.82 L34.02 20.52 L29.16 25.38 L25.38 28.08 L19.98 31.32 L19.98 31.86 L26.46 28.62 L32.4 23.76 Z",
"M42.12 31.32 L49.68 29.7 L42.12 29.16 L36.18 25.92 L29.16 20.52 L27 20.52 L30.24 22.68 Z",
"M24.84 29.16 L25.92 30.24 L31.86 29.16 L37.8 28.08 L36.72 27 L34.02 27.54 L31.86 28.08 Z",
"M19.98 42.12 L23.76 36.72 L25.38 32.94 L23.76 31.32 L23.22 35.1 L19.44 42.12 Z",
"M23.22 35.1 L24.3 36.18 L32.94 35.1 L42.12 34.02 L39.96 32.4 L36.72 33.48 L32.94 34.02 Z",
"M23.76 41.04 L24.84 42.12 L32.94 41.04 L41.04 40.5 L38.88 38.88 L36.72 39.42 L32.94 39.96 Z",
"M32.4 47.52 L32.4 32.4 L32.94 30.78 L30.24 28.08 L30.24 29.16 L30.78 32.4 L30.78 47.52 Z",
"M17.82 48.06 L19.44 49.68 L32.94 48.06 L46.44 46.98 L44.28 45.36 L41.58 45.9 L32.94 46.98 Z"
],
"怪": [
"M7.02 12.42 L5.4 19.44 L3.78 23.76 L4.86 26.46 L5.4 25.38 L6.48 21.06 Z",
"M19.98 17.82 L19.44 14.58 L12.96 11.88 Z",
"M12.96 43.74 L12.96 24.84 L12.96 5.4 L14.04 2.7 L10.8 0.54 L11.34 2.16 L11.88 5.4 L11.88 24.3 L11.88 43.74 L10.26 46.98 L12.42 50.76 L12.96 47.52 Z",
"M37.26 10.26 L39.42 7.02 L41.58 4.86 L39.42 2.7 L37.26 4.86 L25.92 6.48 L20.52 7.02 L23.22 8.64 L25.92 7.56 L37.8 5.94 L35.64 10.26 L29.7 18.36 L22.68 25.38 L14.58 31.32 L15.66 31.32 L23.22 25.92 L31.32 18.9 Z",
"M41.58 28.62 L50.22 27.54 L44.28 26.46 L39.96 24.3 L34.02 19.98 L25.38 11.88 L24.84 10.8 L22.14 10.8 L25.92 13.5 Z",
"M19.44 35.1 L21.06 36.72 L31.32 35.1 L42.12 34.02 L39.96 31.86 L36.18 32.94 L31.32 34.02 Z",
"M31.32 44.82 L31.32 28.08 L32.4 25.38 L30.24 23.76 L29.16 22.68 L28.62 22.68 L29.16 26.46 L29.7 28.08 L29.7 44.82 Z",
"M15.12 45.36 L16.74 46.98 L32.4 45.9 L48.06 44.82 L45.9 42.66 L42.12 43.74 L32.4 44.82 Z"
],
"活": [
"M9.72 5.4 L9.18 5.4 L12.42 9.18 L15.12 12.96 L15.66 9.18 Z",
"M5.94 19.44 L4.86 19.44 L7.56 22.14 L10.8 25.92 L11.34 22.68 Z",
"M18.36 19.44 L18.36 17.82 L10.26 42.66 L9.72 43.2 L5.94 39.96 L5.4 39.96 L10.8 46.44 Z",
"M41.58 5.4 L38.34 2.7 L35.1 5.4 L27 8.64 L18.9 11.34 L23.76 10.8 Z",
"M18.36 21.06 L19.98 22.68 L33.48 20.52 L46.98 19.44 L44.82 17.28 L41.04 18.36 L33.48 19.44 Z",
"M31.86 16.74 L31.86 11.88 L32.4 10.26 L29.7 7.56 L29.7 8.64 L30.24 11.88 L30.24 16.74 L29.7 31.32 L31.32 31.32 Z",
"M23.76 44.28 L23.76 32.4 L23.76 31.32 L22.14 28.62 L22.14 30.78 L22.68 32.4 L22.68 44.28 L21.6 46.98 L23.22 49.68 L23.76 46.44 Z",
"M38.34 42.66 L39.96 32.4 L42.12 30.24 L39.96 28.62 L38.34 30.24 L23.76 32.4 L23.76 33.48 L38.34 31.32 L36.72 42.66 Z",
"M23.22 44.28 L24.3 45.36 L31.86 44.82 L39.96 44.28 L38.34 42.66 L31.86 43.74 Z"
],
"甜": [
"M23.22 7.02 L21.06 4.86 L18.9 7.02 L4.32 12.96 L5.4 12.96 Z",
"M2.16 20.52 L3.78 22.14 L14.04 19.98 L24.84 18.36 L22.68 16.74 L19.44 17.82 L14.04 18.9 Z",
"M15.12 29.16 L15.12 9.72 L13.5 9.72 L13.5 29.16 Z",
"M9.72 42.12 L9.72 31.86 L9.72 30.24 L7.56 26.46 L7.56 28.62 L8.1 31.86 L8.1 42.12 L7.56 44.28 L9.72 46.98 Z",
"M19.44 39.96 L19.98 29.7 L21.6 28.08 L19.44 26.46 L17.82 28.08 L9.72 29.16 L9.72 30.24 L18.36 29.16 L17.82 39.96 Z",
"M9.18 41.04 L10.26 42.12 L15.66 41.04 L21.06 40.5 L19.98 39.42 L15.66 39.96 Z",
"M21.6 21.06 L23.22 22.68 L36.18 20.52 L49.14 18.9 L46.98 17.28 L44.28 17.82 L36.18 19.44 Z",
"M29.7 43.74 L29.7 25.38 L29.7 6.48 L30.24 4.86 L27.54 2.16 L27.54 3.24 L28.08 6.48 L28.08 24.84 L28.08 43.74 L27 46.44 L29.16 50.22 L29.7 46.44 Z",
"M42.12 8.1 L42.12 6.48 L43.2 4.32 L39.96 1.08 L40.5 6.48 L40.5 8.1 L38.88 40.5 L37.8 45.9 L39.42 48.6 L40.5 40.5 Z",
"M28.62 31.86 L29.7 32.94 L32.94 32.4 L36.72 31.86 L35.64 30.78 L32.94 31.32 Z",
"M28.62 44.82 L29.7 45.9 L33.48 45.36 L37.26 44.82 L35.64 43.2 L33.48 44.28 Z"
],
"赛": [
"M24.84 0.54 L24.3 0.54 L25.92 3.78 L27 7.02 L28.62 4.32 Z",
"M11.88 5.94 L10.8 10.26 L8.64 14.04 L10.26 16.2 L10.8 14.58 L11.88 10.26 Z",
"M43.2 9.18 L44.28 7.56 L45.9 5.94 L43.74 4.32 L42.12 5.94 L12.42 8.64 L12.42 9.72 L42.66 7.02 L41.58 9.18 L39.42 11.88 L40.5 11.88 Z",
"M12.96 14.58 L14.04 15.66 L26.46 14.58 L38.88 13.5 L36.72 11.88 L34.56 12.42 L26.46 13.5 Z",
"M14.04 19.44 L15.12 20.52 L27 19.44 L39.42 18.36 L37.26 16.74 L35.1 17.28 L27 18.36 Z",
"M22.14 23.76 L22.14 14.04 L22.68 11.34 L19.98 8.64 L20.52 10.26 L21.06 14.04 L21.06 23.76 Z",
"M31.86 16.2 L31.86 11.88 L32.4 10.26 L29.7 7.56 L29.7 8.64 L30.24 11.88 L30.24 16.2 L29.7 23.76 L30.78 23.76 Z",
"M5.94 25.38 L7.56 27 L26.46 24.84 L45.9 23.22 L43.74 21.6 L40.5 22.68 L26.46 23.76 Z",
"M17.28 26.46 L12.42 31.32 L7.02 35.1 L2.16 37.8 L3.24 37.8 L9.18 34.56 L14.04 31.32 L17.82 28.08 L20.52 25.38 Z",
"M42.12 35.64 L49.14 35.1 L43.2 33.48 L38.34 30.24 L32.4 24.3 L30.78 24.3 Z",
"M18.9 38.88 L18.9 32.4 L18.9 31.32 L17.28 28.62 L17.28 30.78 L17.82 32.4 L17.82 38.88 L17.28 40.5 L18.9 42.12 Z",
"M34.02 36.72 L34.02 30.78 L35.1 29.7 L33.48 28.08 L32.4 29.16 L18.36 30.78 L18.36 31.86 L32.94 30.24 L32.94 36.72 L31.86 40.5 L33.48 42.12 L34.02 38.88 Z",
"M24.84 32.94 L24.84 36.18 L22.68 42.12 L19.98 45.36 L16.2 48.06 L10.8 50.76 L13.5 50.22 L19.44 46.98 L23.22 43.2 L25.38 38.88 L27 34.56 Z",
"M28.08 42.66 L34.56 46.98 L38.34 49.68 L37.8 46.44 L31.86 43.74 L28.62 42.66 Z"
],
"省": [
"M25.92 11.88 L25.92 5.4 L27 2.7 L23.76 0.54 L24.3 2.16 L24.84 5.4 L24.84 11.88 L23.76 15.12 L25.92 17.28 Z",
"M17.82 6.48 L16.2 10.26 L12.96 14.04 L5.94 21.06 L7.56 20.52 L11.88 16.74 L17.82 10.8 L19.44 9.72 L19.44 9.18 Z",
"M41.04 12.96 L43.74 16.2 L44.28 12.42 L38.88 8.64 L34.56 6.48 Z",
"M34.02 9.72 L32.94 11.34 L28.62 15.66 L21.06 21.06 L17.28 23.76 L9.72 28.08 L2.7 31.32 L3.78 31.32 L7.02 30.24 L11.34 28.08 L17.28 24.84 L22.68 21.6 L29.16 16.74 L35.1 12.96 Z",
"M17.28 45.36 L17.28 28.62 L17.28 27.54 L15.66 24.84 L15.66 27 L16.2 28.62 L16.2 45.36 L15.12 48.06 L16.74 50.76 L17.28 47.52 Z",
"M36.72 39.42 L37.26 25.38 L38.88 23.76 L36.72 21.6 L34.56 23.76 L17.28 26.46 L17.28 27.54 L35.64 24.84 L35.1 39.42 L34.56 43.2 L34.02 46.98 L35.64 49.68 L36.18 45.9 Z",
"M16.74 32.94 L17.82 34.02 L24.84 32.94 L32.4 32.4 L30.78 30.78 L24.84 31.86 Z",
"M16.74 39.42 L17.82 40.5 L24.84 39.42 L31.86 38.88 L30.24 37.26 L24.84 38.34 Z",
"M17.28 45.9 L18.36 46.98 L25.92 46.44 L34.02 45.9 L31.86 44.28 L29.7 44.82 L25.92 45.36 Z"
],
"边": [
"M38.34 28.62 L40.5 17.82 L42.12 14.58 L39.96 12.96 L38.34 15.12 L24.3 17.28 L23.76 17.28 L18.9 17.82 L20.52 18.9 L23.76 18.36 L24.3 18.36 L38.88 16.2 L36.72 28.62 L34.56 36.72 L34.02 37.26 L32.4 36.18 L30.24 34.02 L28.62 33.48 L30.24 35.1 L32.4 38.34 L34.02 41.04 L36.72 35.1 Z",
"M31.32 10.8 L31.32 6.48 L32.94 3.78 L29.16 0.54 L29.7 6.48 L29.7 10.8 L29.16 15.66 L27.54 24.3 L25.38 29.7 L22.14 36.18 L18.9 39.42 L19.98 39.42 L22.68 36.72 L27.54 28.62 L28.62 25.38 L30.78 15.66 Z",
"M9.72 6.48 L9.18 6.48 L11.88 9.72 L13.5 11.34 L15.66 14.58 L16.74 10.8 Z",
"M1.62 23.22 L3.78 24.84 L14.04 22.68 L11.88 30.24 L14.04 34.56 L13.5 37.8 L11.88 40.5 L12.96 40.5 L14.58 36.18 L15.12 35.1 L15.12 33.48 L12.96 29.7 L16.2 22.68 L17.28 21.06 L15.66 19.44 L12.96 22.14 Z",
"M11.88 40.5 L2.7 40.5 L4.86 42.66 L8.1 41.58 L12.42 41.58 L22.68 43.74 L27.54 44.82 L39.96 49.14 L48.6 46.44 L42.66 46.44 L38.88 46.44 L35.1 45.9 L25.38 43.2 L17.28 41.58 L12.96 40.5 Z"
],
"兰": [
"M15.12 3.78 L14.58 3.78 L16.74 7.02 L20.52 15.12 L22.14 11.88 Z",
"M34.02 1.08 L34.02 2.7 L33.48 4.86 L28.62 17.82 L29.7 17.82 L34.56 7.56 L36.18 5.94 Z",
"M8.64 19.98 L10.26 21.6 L26.46 19.44 L43.2 18.9 L40.5 16.74 L37.8 17.82 L26.46 18.36 Z",
"M12.96 31.32 L14.58 32.94 L25.92 31.32 L37.26 30.24 L35.1 28.62 L32.94 29.16 L25.92 30.24 Z",
"M3.78 45.36 L5.4 46.98 L25.38 45.9 L45.9 44.82 L43.74 42.66 L39.96 43.74 L25.38 44.82 Z"
],
"掌": [
"M25.92 11.88 L25.92 4.86 L27 2.16 L23.76 0 L24.3 1.62 L24.84 4.86 L24.84 11.88 Z",
"M18.9 10.8 L19.44 7.56 L14.04 3.24 L13.5 3.24 Z",
"M35.1 1.62 L34.56 2.7 L34.02 5.4 L30.24 11.34 L30.78 11.34 L34.56 6.48 L36.72 4.86 Z",
"M10.26 9.72 L9.72 11.88 L9.18 15.12 L7.02 19.98 L8.1 22.68 L9.18 20.52 L10.26 15.12 Z",
"M42.66 10.8 L27 11.88 L9.72 14.04 L10.8 15.12 L27 12.96 L42.525 11.88 L43.2 11.88 L40.5 17.82 L44.28 12.96 L46.98 10.8 L44.82 8.64 L43.2 10.26 Z",
"M18.9 23.76 L18.9 19.98 L18.9 18.9 L17.28 16.2 L17.28 18.36 L17.82 19.98 L17.82 23.76 L17.28 25.38 L18.9 27 Z",
"M32.4 21.6 L32.94 17.82 L34.56 16.2 L32.4 14.58 L30.78 16.2 L18.9 17.82 L18.9 18.9 L31.86 17.28 L31.32 21.6 Z",
"M18.36 23.76 L19.44 24.84 L26.46 23.76 L33.48 22.68 L32.4 21.6 L26.46 22.68 Z",
"M9.18 31.32 L16.2 30.78 L37.8 26.46 L35.64 24.84 L31.32 26.46 Z",
"M12.96 34.56 L14.04 35.64 L26.46 33.48 L38.88 32.4 L36.72 30.78 L34.56 31.32 L26.46 32.4 Z",
"M4.86 39.42 L6.48 41.04 L25.92 38.88 L45.36 37.26 L43.2 35.1 L39.42 36.18 L25.92 37.8 Z",
"M26.46 47.52 L26.46 28.62 L24.84 28.62 L24.84 47.52 L24.3 48.06 L17.28 44.82 L25.38 51.3 Z"
],
"从": [
"M18.9 9.72 L18.9 8.1 L20.52 5.4 L16.74 2.16 L17.28 8.1 L17.28 9.72 L16.2 17.82 L15.12 24.3 L12.96 30.78 L10.8 36.18 L5.4 44.28 L2.16 47.52 L3.78 46.98 L6.48 44.28 L11.88 36.18 L14.04 30.78 L16.74 22.68 Z",
"M16.2 22.68 L16.74 24.3 L20.52 28.08 L23.76 31.86 L24.3 28.62 Z",
"M34.02 13.5 L34.02 6.48 L35.64 3.78 L31.86 0.54 L32.4 6.48 L32.4 13.5 L31.32 18.9 L30.24 25.38 L27.54 32.94 L24.84 38.88 L21.06 44.28 L16.2 49.14 L17.82 48.6 L23.22 43.2 L27.54 36.72 L30.24 29.16 L32.4 22.14 Z",
"M42.12 45.36 L49.68 44.82 L45.9 43.74 L43.2 42.66 L38.88 35.1 L32.4 22.14 L31.86 23.22 Z"
]
}
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+2 -1
View File
@@ -11,6 +11,7 @@
"word-input": "/components/word-input/word-input",
"word-card": "/components/word-card/word-card",
"word-picker": "/components/word-picker/word-picker",
"empty-state": "/components/empty-state/empty-state"
"empty-state": "/components/empty-state/empty-state",
"share-guide-popup": "/components/share-guide-popup/share-guide-popup"
}
}
+20 -47
View File
@@ -1,9 +1,6 @@
import WordDrawService from '../../service/wordDrawService';
import { checkAndSaveImage } from '../../utils/saveImage';
import {
shouldShowShareGuide,
recordShareSuccess,
} from '../../utils/shareGuide';
import { shouldShowShareGuide } from '../../utils/shareGuide';
import { PAPER_SIZE } from '../../constants/colors';
import { getWordsSvgData } from '../../utils/getWordsSvgJson';
import { WORDS } from '../../constants/words';
@@ -347,6 +344,9 @@ Page({
return characterData;
},
/** 记录待下载状态(当需要分享引导时) */
pendingDownload: false,
// 下载打印练字贴
exportToPrint() {
if (!this.canvas) {
@@ -369,54 +369,27 @@ Page({
this.setData({ showShareDialog: false });
},
/** 点击转发按钮 */
onShareToFriend() {
// 记录分享成功(用户点击了分享按钮,视为已分享)
recordShareSuccess();
this.setData({ showShareDialog: false });
// 允许继续下载
if (this.canvas) {
checkAndSaveImage(this.canvas);
}
wx.showToast({
title: '分享后即可继续下载',
icon: 'success',
duration: 2000,
});
},
/** 点击分享到朋友圈按钮 */
onShareToTimeline() {
// 记录分享成功(用户点击了分享按钮,视为已分享)
recordShareSuccess();
this.setData({ showShareDialog: false });
// 允许继续下载
if (this.canvas) {
checkAndSaveImage(this.canvas);
}
wx.showToast({
title: '分享后即可继续下载',
icon: 'success',
duration: 2000,
});
},
// 分享功能
onShareAppMessage() {
// 记录分享成功(用户真正分享了)
recordShareSuccess();
return {
title: '涂鸦丫-练字|识字|打印',
path: '/pages/copyBook/index',
title: '涂鸦丫-涂色|练字|识字|打印',
path: '/pages/copyBook/copyBook',
imageUrl:
'https://cdn.joeyone.cn/doodle/share-img/index-share-v2.png',
};
},
onShareTimeline() {
return {
title: '涂鸦丫-涂色|练字|识字|打印',
query: '/pages/copyBook/copyBook',
imageUrl:
'https://cdn.joeyone.cn/doodle/share-img/index-share-v2.png',
};
},
onShareTimeline() {
// 记录分享成功(用户真正分享了)
recordShareSuccess();
return {
title: '涂鸦丫-练字|识字|打印',
query: '/pages/copyBook/index',
};
/** 分享成功回调(由组件触发) */
onShareSuccess() {
// 只关闭弹窗,不触发下载
this.setData({ showShareDialog: false });
},
});
+3 -9
View File
@@ -91,16 +91,10 @@
max="11"
bind:onClose="closeSelectWordPopup"
bind:onChange="onChangeWord" />
<van-dialog
<share-guide-popup
show="{{showShareDialog}}"
title="分享解锁下载"
message="今日免费下载次数已用完,分享给好友或朋友圈后即可继续免费下载"
show-cancel-button
confirm-button-text="转发给好友"
cancel-button-text="分享到朋友圈"
bind:confirm="onShareToFriend"
bind:cancel="onShareToTimeline"
bind:close="onCloseShareDialog" />
bind:onClose="onCloseShareDialog"
bind:onShareSuccess="onShareSuccess" />
<view class="empty"></view>
</view>
+1
View File
@@ -13,6 +13,7 @@
"word-card": "../../components/word-card/word-card",
"color-picker": "../../components/color-picker/color-picker",
"introduction-popup": "../../components/introduction-popup/introduction-popup",
"share-guide-popup": "../../components/share-guide-popup/share-guide-popup",
"toy-button": "../../ui/button/button",
"word-picker": "../../components/word-picker/word-picker",
"empty-state": "../../components/empty-state/empty-state"
+7 -37
View File
@@ -6,10 +6,7 @@ import {
TemplateType,
} from '../../service/drawServiceFactory';
import { checkAndSaveImage } from '../../utils/saveImage';
import {
shouldShowShareGuide,
recordShareSuccess,
} from '../../utils/shareGuide';
import { shouldShowShareGuide } from '../../utils/shareGuide';
Page({
canvas: null as Canvas | null,
@@ -304,36 +301,9 @@ Page({
this.setData({ showShareDialog: false });
},
/** 点击转发按钮 */
onShareToFriend() {
// 记录分享成功(用户点击了分享按钮,视为已分享)
recordShareSuccess();
/** 分享成功回调(由组件触发) */
onShareSuccess() {
this.setData({ showShareDialog: false });
// 允许继续下载
if (this.canvas && this.data.cardList.length > 0) {
checkAndSaveImage(this.canvas);
}
wx.showToast({
title: '分享后即可继续下载',
icon: 'success',
duration: 2000,
});
},
/** 点击分享到朋友圈按钮 */
onShareToTimeline() {
// 记录分享成功(用户点击了分享按钮,视为已分享)
recordShareSuccess();
this.setData({ showShareDialog: false });
// 允许继续下载
if (this.canvas && this.data.cardList.length > 0) {
checkAndSaveImage(this.canvas);
}
wx.showToast({
title: '分享后即可继续下载',
icon: 'success',
duration: 2000,
});
},
onColorTap(e: WechatMiniprogram.CustomEvent) {
@@ -374,19 +344,19 @@ Page({
},
onShareAppMessage() {
// 记录分享成功(用户真正分享了)
recordShareSuccess();
return {
title: '涂鸦丫-涂色|识字|画画|打印',
path: '/pages/index/index',
imageUrl:
'https://cdn.joeyone.cn/doodle/share-img/index-share-v2.png',
};
},
onShareTimeline() {
// 记录分享成功(用户真正分享了)
recordShareSuccess();
return {
title: '涂鸦丫-涂色|识字|画画|打印',
query: '/pages/index/index',
imageUrl:
'https://cdn.joeyone.cn/doodle/share-img/index-share-v2.png',
};
},
+7 -13
View File
@@ -135,16 +135,10 @@
下载打印
</toy-button>
</view>
<introduction-popup
wx:if="{{showIntroductionPopup}}"
bind:onClose="onCloseIntroductionPopup" />
<van-dialog
show="{{showShareDialog}}"
title="分享解锁下载"
message="今日免费下载次数已用完,分享给好友或朋友圈后即可继续免费下载"
show-cancel-button
confirm-button-text="转发给好友"
cancel-button-text="分享到朋友圈"
bind:confirm="onShareToFriend"
bind:cancel="onShareToTimeline"
bind:close="onCloseShareDialog" />
<introduction-popup
wx:if="{{showIntroductionPopup}}"
bind:onClose="onCloseIntroductionPopup" />
<share-guide-popup
show="{{showShareDialog}}"
bind:onClose="onCloseShareDialog"
bind:onShareSuccess="onShareSuccess" />
+2 -1
View File
@@ -12,6 +12,7 @@
"toy-button": "../../ui/button/button",
"shape-card": "../../components/shape-card/shape-card",
"shape-picker": "../../components/shape-picker/shape-picker",
"color-picker": "../../components/color-picker/color-picker"
"color-picker": "../../components/color-picker/color-picker",
"share-guide-popup": "../../components/share-guide-popup/share-guide-popup"
}
}
+81 -90
View File
@@ -2,11 +2,7 @@ import { SHAPES, ShapeCard } from '../../constants/shapes';
import { WATER_COLORS, PAPER_SIZE } from '../../constants/colors';
import ShapeDrawService from '../../service/shapeDrawService';
import { checkAndSaveImage } from '../../utils/saveImage';
import {
shouldShowShareGuide,
recordShareSuccess,
} from '../../utils/shareGuide';
import { shouldShowShareGuide } from '../../utils/shareGuide';
Page({
canvas: null as Canvas | null,
@@ -73,7 +69,10 @@ Page({
this.canvas = canvas;
this.ctx = ctx;
// const rect = res[0];
this.shapeDrawService = new ShapeDrawService(canvas, ctx);
this.shapeDrawService = new ShapeDrawService(
canvas,
ctx,
);
// shapeDrawService.draw();
this.setData({ boxWidth, boxHeight });
@@ -86,7 +85,7 @@ Page({
/** 变更shapeList 并更新canvas */
drawCanvas(
updatedShapeList?: ShapeCard[],
callback: () => void = () => { },
callback: () => void = () => {},
) {
if (updatedShapeList) {
this.setData({ shapeList: updatedShapeList }, () => {
@@ -102,7 +101,7 @@ Page({
handleSelectShape() {
this.setData({
showSelectShapePopup: true,
selectedShapeIndex: -1
selectedShapeIndex: -1,
});
},
@@ -110,7 +109,7 @@ Page({
const { index } = e.detail;
this.setData({
showSelectShapePopup: true,
selectedShapeIndex: index
selectedShapeIndex: index,
});
},
@@ -133,7 +132,7 @@ Page({
// 替换为新选中的 shape,保留原有 fillColor
return {
...shapes[0],
fillColor: item.fillColor
fillColor: item.fillColor,
};
} else {
// 其他 shape 不变
@@ -143,16 +142,20 @@ Page({
} else {
// 多选模式,原有逻辑
// 获取所有可用颜色
const colorList = WATER_COLORS.basic12.map(item => item.hex);
const colorList = WATER_COLORS.basic12.map((item) => item.hex);
// 记录已被使用的颜色(只考虑当前 shapeList 中的 fillColor
const usedColors = prevShapeList.map(item => item.fillColor).filter(Boolean);
const usedColors = prevShapeList
.map((item) => item.fillColor)
.filter(Boolean);
// 记录已分配的颜色,避免重复
const assignedColors = [...usedColors];
// 先将 shapes 转为 Map,方便查找
const prevShapeMap = new Map(prevShapeList.map(item => [item.id, item]));
const prevShapeMap = new Map(
prevShapeList.map((item) => [item.id, item]),
);
// 随机打乱剩余可用颜色
function shuffle(arr: string[]) {
@@ -164,7 +167,9 @@ Page({
}
// 计算未被占用的颜色
let availableColors = colorList.filter(color => !assignedColors.includes(color));
let availableColors = colorList.filter(
(color) => !assignedColors.includes(color),
);
availableColors = shuffle(availableColors);
shapes.forEach((item: ShapeCard) => {
@@ -172,7 +177,7 @@ Page({
// 已存在,保留原有 fillColor
newShapeList.push({
...item,
fillColor: prevShapeMap.get(item.id)!.fillColor
fillColor: prevShapeMap.get(item.id)!.fillColor,
});
} else {
// 新增,分配未被占用的颜色
@@ -180,19 +185,22 @@ Page({
assignedColors.push(color);
newShapeList.push({
...item,
fillColor: color
fillColor: color,
});
}
});
}
// 先关闭弹窗
this.setData({
showSelectShapePopup: false,
shapeList: newShapeList,
}, () => {
this.drawCanvas();
});
this.setData(
{
showSelectShapePopup: false,
shapeList: newShapeList,
},
() => {
this.drawCanvas();
},
);
},
/**
* 随机生成6个图形
@@ -207,7 +215,7 @@ Page({
const selectedShapes = shapesCopy.slice(0, 6);
// 随机取6个颜色
const colorList = WATER_COLORS.basic12.map(item => item.hex);
const colorList = WATER_COLORS.basic12.map((item) => item.hex);
const colorsCopy = [...colorList];
for (let i = colorsCopy.length - 1; i > 0; i--) {
const j = Math.floor(Math.random() * (i + 1));
@@ -218,70 +226,62 @@ Page({
// 分配颜色到图形
const shapeList = selectedShapes.map((shape, idx) => ({
...shape,
fillColor: selectedColors[idx]
fillColor: selectedColors[idx],
}));
// 更新数据
this.setData({
shapeList
}, () => {
// 绘制canvas
this.drawCanvas();
});
this.setData(
{
shapeList,
},
() => {
// 绘制canvas
this.drawCanvas();
},
);
},
onDelete(e: any) {
const { index } = e.detail;
const newShapeList = this.data.shapeList.filter((item, i) => i !== index);
this.setData({
shapeList: newShapeList
}, () => {
// 绘制canvas
this.drawCanvas();
});
const newShapeList = this.data.shapeList.filter((_, i) => i !== index);
this.setData(
{
shapeList: newShapeList,
},
() => {
// 绘制canvas
this.drawCanvas();
},
);
},
onColorTap(e: any) {
const { index, fillColor } = e.detail;
this.setData({
showColorPopup: true,
currentColor: fillColor,
selectedShapeIndex: index
selectedShapeIndex: index,
});
},
onCloseColorPopup() {
this.setData({
showColorPopup: false,
currentColor: '',
selectedShapeIndex: 0
selectedShapeIndex: 0,
});
},
onChangeColor(e: any) {
const { color } = e.detail;
const { selectedShapeIndex } = this.data;
this.setData({
showColorPopup: false,
[`shapeList[${selectedShapeIndex}].fillColor`]: color
}, () => {
// 绘制canvas
this.drawCanvas();
})
},
onShareAppMessage() {
// 记录分享成功(用户真正分享了)
recordShareSuccess();
return {
title: '涂鸦丫-涂色|识字|画画|打印',
path: '/pages/index/index',
};
},
onShareTimeline() {
// 记录分享成功(用户真正分享了)
recordShareSuccess();
return {
title: '涂鸦丫-涂色|识字|画画|打印',
query: '/pages/index/index',
};
this.setData(
{
showColorPopup: false,
[`shapeList[${selectedShapeIndex}].fillColor`]: color,
},
() => {
// 绘制canvas
this.drawCanvas();
},
);
},
/** 下载打印 */
@@ -305,36 +305,27 @@ Page({
this.setData({ showShareDialog: false });
},
/** 点击转发按钮 */
onShareToFriend() {
// 记录分享成功(用户点击了分享按钮,视为已分享)
recordShareSuccess();
this.setData({ showShareDialog: false });
// 允许继续下载
if (this.canvas && this.data.shapeList.length > 0) {
checkAndSaveImage(this.canvas);
}
wx.showToast({
title: '分享后即可继续下载',
icon: 'success',
duration: 2000,
});
onShareAppMessage() {
return {
title: '涂鸦丫-涂色|识字|图形|打印',
path: '/pages/shape/index',
imageUrl:
'https://cdn.joeyone.cn/doodle/share-img/index-share-v2.png',
};
},
onShareTimeline() {
return {
title: '涂鸦丫-涂色|识字|图形|打印',
query: '/pages/shape/index',
imageUrl:
'https://cdn.joeyone.cn/doodle/share-img/index-share-v2.png',
};
},
/** 点击分享到朋友圈按钮 */
onShareToTimeline() {
// 记录分享成功(用户点击了分享按钮,视为已分享)
recordShareSuccess();
/** 分享成功回调(由组件触发) */
onShareSuccess() {
// 只关闭弹窗,不触发下载
this.setData({ showShareDialog: false });
// 允许继续下载
if (this.canvas && this.data.shapeList.length > 0) {
checkAndSaveImage(this.canvas);
}
wx.showToast({
title: '分享后即可继续下载',
icon: 'success',
duration: 2000,
});
},
onUnload() {
+3 -9
View File
@@ -67,16 +67,10 @@
</view>
<view class="empty"></view>
</view>
<van-dialog
<share-guide-popup
show="{{showShareDialog}}"
title="分享解锁下载"
message="今日免费下载次数已用完,分享给好友或朋友圈后即可继续免费下载"
show-cancel-button
confirm-button-text="转发给好友"
cancel-button-text="分享到朋友圈"
bind:confirm="onShareToFriend"
bind:cancel="onShareToTimeline"
bind:close="onCloseShareDialog" />
bind:onClose="onCloseShareDialog"
bind:onShareSuccess="onShareSuccess" />
<view class="bottom-btn-box">
<toy-button
openType="share"
+2 -2
View File
@@ -86,7 +86,7 @@ class FindWordDrawService {
appName: '涂鸦丫小程序',
appHint: '识字|识图|练字|打印',
title: '找一找 涂 色',
subTitle: '给文字涂上相同的颜色',
subTitle: '找出相同的文字涂色',
...options,
};
// 从options中读取debug参数,如果没有则使用全局DEBUG常量
@@ -132,7 +132,7 @@ class FindWordDrawService {
appName: this.options.appName || '涂鸦丫小程序',
appHint: this.options.appHint || '识字|识图|练字|打印',
title: this.options.title || '找一找 涂 色',
subTitle: this.options.subTitle || '给文字涂上相同的颜色',
subTitle: this.options.subTitle || '找出相同的文字涂色',
},
onHeaderDrawn: (currentY) => {
this.currentY = currentY;
+2 -1
View File
@@ -61,6 +61,8 @@ export function recordShareSuccess(): void {
* @returns true表示需要显示分享引导,false表示不需要
*/
export function shouldShowShareGuide(): boolean {
// TODO: 开启分享引导
// return true;
// 如果今天已经分享过,不需要显示引导
if (hasSharedToday()) {
return false;
@@ -68,4 +70,3 @@ export function shouldShowShareGuide(): boolean {
// 如果今天已经下载过,需要显示引导
return hasDownloadedToday();
}