fix: msg
This commit is contained in:
@@ -1,5 +1,27 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="make-page" :style="{ paddingTop: getBavBarHeight() + 'px' }">
|
<view class="make-page" :style="{ paddingTop: getBavBarHeight() + 'px' }">
|
||||||
|
<!-- 顶部步骤条 -->
|
||||||
|
<view class="top-steps">
|
||||||
|
<view class="step-bar">
|
||||||
|
<view
|
||||||
|
v-for="(tool, idx) in tools"
|
||||||
|
:key="idx"
|
||||||
|
class="step-item"
|
||||||
|
:class="{ active: activeTool === tool.type }"
|
||||||
|
@tap="openTool(tool.type)"
|
||||||
|
>
|
||||||
|
<view class="step-num-wrap">
|
||||||
|
<view class="step-line" v-if="idx > 0"></view>
|
||||||
|
<view class="step-num">
|
||||||
|
<text v-if="activeTool === tool.type && showPanel">{{ tool.icon }}</text>
|
||||||
|
<text v-else>{{ tool.step }}</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<text class="step-text">{{ tool.text }}</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
<!-- 预览卡片 -->
|
<!-- 预览卡片 -->
|
||||||
<view class="card-preview">
|
<view class="card-preview">
|
||||||
<image
|
<image
|
||||||
@@ -22,7 +44,7 @@
|
|||||||
/>
|
/>
|
||||||
<view
|
<view
|
||||||
class="bubble"
|
class="bubble"
|
||||||
@tap="activeTool = 'text'"
|
@tap="openTool('text')"
|
||||||
:style="{
|
:style="{
|
||||||
marginTop: 230 + bubbleOffsetY + 'rpx',
|
marginTop: 230 + bubbleOffsetY + 'rpx',
|
||||||
maxWidth: bubbleMaxWidth + 80 + 'rpx',
|
maxWidth: bubbleMaxWidth + 80 + 'rpx',
|
||||||
@@ -57,11 +79,8 @@
|
|||||||
<text>分享或保存即可去除水印</text>
|
<text>分享或保存即可去除水印</text>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 编辑工具区 -->
|
<!-- 底部固定按钮 -->
|
||||||
<view class="editor-panel">
|
<view class="bottom-actions-fixed">
|
||||||
<view class="drag-handle"></view>
|
|
||||||
|
|
||||||
<!-- 主操作按钮 -->
|
|
||||||
<view class="main-actions">
|
<view class="main-actions">
|
||||||
<button class="btn secondary" @tap="preview">
|
<button class="btn secondary" @tap="preview">
|
||||||
<uni-icons type="cloud-download" size="20" color="#888"></uni-icons>
|
<uni-icons type="cloud-download" size="20" color="#888"></uni-icons>
|
||||||
@@ -76,26 +95,13 @@
|
|||||||
<view>分享给好友</view>
|
<view>分享给好友</view>
|
||||||
</button>
|
</button>
|
||||||
</view>
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
<!-- 功能入口 (步骤条式) -->
|
<!-- 弹出编辑面板 -->
|
||||||
<view class="step-bar">
|
<view class="panel-container" :class="{ show: showPanel }">
|
||||||
<view
|
<view class="panel-mask" @tap="closePanel"></view>
|
||||||
v-for="(tool, idx) in tools"
|
<view class="panel-content" :class="{ 'glass-effect': activeTool === 'text' || activeTool === 'position' }">
|
||||||
:key="idx"
|
<view class="panel-handle" @tap="closePanel"></view>
|
||||||
class="step-item"
|
|
||||||
:class="{ active: activeTool === tool.type }"
|
|
||||||
@tap="activeTool = tool.type"
|
|
||||||
>
|
|
||||||
<view class="step-num-wrap">
|
|
||||||
<view class="step-line" v-if="idx > 0"></view>
|
|
||||||
<view class="step-num">
|
|
||||||
<text v-if="activeTool === tool.type">{{ tool.icon }}</text>
|
|
||||||
<text v-else>{{ tool.step }}</text>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<text class="step-text">{{ tool.text }}</text>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
<!-- 标题选择区 -->
|
<!-- 标题选择区 -->
|
||||||
<view v-if="activeTool === 'title'" class="section">
|
<view v-if="activeTool === 'title'" class="section">
|
||||||
@@ -155,7 +161,7 @@
|
|||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 下一步引导 -->
|
<!-- 下一步引导 -->
|
||||||
<view class="next-step-tip" @tap="activeTool = 'template'">
|
<view class="next-step-tip" @tap="openTool('title')">
|
||||||
<text>选好标题了,去选模板</text>
|
<text>选好标题了,去选模板</text>
|
||||||
<uni-icons type="arrow-right" size="14" color="#ff3b30"></uni-icons>
|
<uni-icons type="arrow-right" size="14" color="#ff3b30"></uni-icons>
|
||||||
</view>
|
</view>
|
||||||
@@ -190,8 +196,8 @@
|
|||||||
>
|
>
|
||||||
</view>
|
</view>
|
||||||
<!-- 下一步引导 -->
|
<!-- 下一步引导 -->
|
||||||
<view class="next-step-tip" @tap="activeTool = 'text'">
|
<view class="next-step-tip" @tap="openTool('title')">
|
||||||
<text>选好模板了,去修改文字</text>
|
<text>选好模板了,去选标题</text>
|
||||||
<uni-icons type="arrow-right" size="14" color="#ff3b30"></uni-icons>
|
<uni-icons type="arrow-right" size="14" color="#ff3b30"></uni-icons>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -224,7 +230,7 @@
|
|||||||
v-for="(text, index) in displayedGreetings"
|
v-for="(text, index) in displayedGreetings"
|
||||||
:key="index"
|
:key="index"
|
||||||
class="greeting-card"
|
class="greeting-card"
|
||||||
:class="{ active: blessingText === text.content }"
|
:class="{ active: blessingText.content === text.content }"
|
||||||
@tap="selectGreeting(text)"
|
@tap="selectGreeting(text)"
|
||||||
>
|
>
|
||||||
<text class="greeting-text">{{ text.content }}</text>
|
<text class="greeting-text">{{ text.content }}</text>
|
||||||
@@ -302,7 +308,67 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 署名颜色 -->
|
<!-- 下一步引导 -->
|
||||||
|
<view class="next-step-tip" @tap="openTool('position')">
|
||||||
|
<text>文字改好了,去调位置</text>
|
||||||
|
<uni-icons type="arrow-right" size="14" color="#ff3b30"></uni-icons>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<!-- 位置调整 -->
|
||||||
|
<view v-if="activeTool === 'position'" class="section position-section">
|
||||||
|
<view class="section-title">
|
||||||
|
<text>调整位置</text>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="form-item" style="margin-top: 20rpx;">
|
||||||
|
<text class="label">祝福语气泡 (上下)</text>
|
||||||
|
<slider
|
||||||
|
:value="bubbleOffsetY"
|
||||||
|
min="-200"
|
||||||
|
max="400"
|
||||||
|
show-value
|
||||||
|
@change="(e) => (bubbleOffsetY = e.detail.value)"
|
||||||
|
activeColor="#ff3b30"
|
||||||
|
/>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="form-item">
|
||||||
|
<text class="label">祝福语气泡宽度</text>
|
||||||
|
<slider
|
||||||
|
:value="bubbleMaxWidth"
|
||||||
|
min="200"
|
||||||
|
max="460"
|
||||||
|
show-value
|
||||||
|
@change="(e) => (bubbleMaxWidth = e.detail.value)"
|
||||||
|
activeColor="#ff3b30"
|
||||||
|
/>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="form-item">
|
||||||
|
<text class="label">个人信息 (上下)</text>
|
||||||
|
<slider
|
||||||
|
:value="userOffsetY"
|
||||||
|
min="-100"
|
||||||
|
max="200"
|
||||||
|
show-value
|
||||||
|
@change="(e) => (userOffsetY = e.detail.value)"
|
||||||
|
activeColor="#ff3b30"
|
||||||
|
/>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="form-item">
|
||||||
|
<text class="label">个人信息 (左右)</text>
|
||||||
|
<slider
|
||||||
|
:value="userOffsetX"
|
||||||
|
min="-100"
|
||||||
|
max="100"
|
||||||
|
show-value
|
||||||
|
@change="(e) => (userOffsetX = e.detail.value)"
|
||||||
|
activeColor="#ff3b30"
|
||||||
|
/>
|
||||||
|
</view>
|
||||||
|
|
||||||
<view class="form-item">
|
<view class="form-item">
|
||||||
<text class="label">署名颜色</text>
|
<text class="label">署名颜色</text>
|
||||||
<view class="color-list">
|
<view class="color-list">
|
||||||
@@ -317,67 +383,6 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 下一步引导 -->
|
|
||||||
<view class="next-step-tip" @tap="activeTool = 'position'">
|
|
||||||
<text>文字写好了,去微调位置</text>
|
|
||||||
<uni-icons type="arrow-right" size="14" color="#ff3b30"></uni-icons>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
<!-- 位置调整 -->
|
|
||||||
<view v-if="activeTool === 'position'" class="section position-section">
|
|
||||||
<view class="form-item">
|
|
||||||
<text class="label">祝福语位置 (上下)</text>
|
|
||||||
<slider
|
|
||||||
:value="bubbleOffsetY"
|
|
||||||
min="-200"
|
|
||||||
max="200"
|
|
||||||
show-value
|
|
||||||
@change="(e) => (bubbleOffsetY = e.detail.value)"
|
|
||||||
activeColor="#ff3b30"
|
|
||||||
/>
|
|
||||||
</view>
|
|
||||||
<view class="form-item">
|
|
||||||
<text class="label">祝福语宽度</text>
|
|
||||||
<slider
|
|
||||||
:value="bubbleMaxWidth"
|
|
||||||
min="200"
|
|
||||||
max="460"
|
|
||||||
show-value
|
|
||||||
@change="(e) => (bubbleMaxWidth = e.detail.value)"
|
|
||||||
activeColor="#ff3b30"
|
|
||||||
/>
|
|
||||||
</view>
|
|
||||||
<view class="form-item">
|
|
||||||
<text class="label">署名位置 (左右)</text>
|
|
||||||
<slider
|
|
||||||
:value="userOffsetX"
|
|
||||||
min="-200"
|
|
||||||
max="200"
|
|
||||||
show-value
|
|
||||||
@change="(e) => (userOffsetX = e.detail.value)"
|
|
||||||
activeColor="#ff3b30"
|
|
||||||
/>
|
|
||||||
</view>
|
|
||||||
<view class="form-item">
|
|
||||||
<text class="label">署名位置 (上下)</text>
|
|
||||||
<slider
|
|
||||||
:value="userOffsetY"
|
|
||||||
min="-200"
|
|
||||||
max="200"
|
|
||||||
show-value
|
|
||||||
@change="(e) => (userOffsetY = e.detail.value)"
|
|
||||||
activeColor="#ff3b30"
|
|
||||||
/>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
<!-- 头像挂饰 -->
|
|
||||||
<view v-if="activeTool === 'avatar'" class="section">
|
|
||||||
<view class="section-title"><text>头像挂饰</text></view>
|
|
||||||
<view class="row">
|
|
||||||
<button class="btn" @tap="toggleAvatarDecor">切换挂饰</button>
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -735,6 +740,16 @@ const tools = [
|
|||||||
{ type: "position", text: "4. 调位置", icon: "🎯", step: 4 },
|
{ type: "position", text: "4. 调位置", icon: "🎯", step: 4 },
|
||||||
];
|
];
|
||||||
const activeTool = ref("template");
|
const activeTool = ref("template");
|
||||||
|
const showPanel = ref(false);
|
||||||
|
|
||||||
|
const openTool = (toolType) => {
|
||||||
|
activeTool.value = toolType;
|
||||||
|
showPanel.value = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
const closePanel = () => {
|
||||||
|
showPanel.value = false;
|
||||||
|
};
|
||||||
|
|
||||||
const templates = ref([]);
|
const templates = ref([]);
|
||||||
|
|
||||||
@@ -1106,14 +1121,9 @@ function drawUserBubble(ctx, options) {
|
|||||||
|
|
||||||
function drawRoundRect(ctx, x, y, w, h, r, color) {
|
function drawRoundRect(ctx, x, y, w, h, r, color) {
|
||||||
ctx.beginPath();
|
ctx.beginPath();
|
||||||
// ctx.setFillStyle(color)
|
ctx.fillStyle = color || "rgba(255,255,255,0.18)";
|
||||||
ctx.fillStyle = "rgba(255,255,255,0.18)";
|
|
||||||
ctx.fill();
|
|
||||||
|
|
||||||
// 描边(非常关键)
|
|
||||||
ctx.strokeStyle = "rgba(255,255,255,0.35)";
|
ctx.strokeStyle = "rgba(255,255,255,0.35)";
|
||||||
ctx.lineWidth = 1;
|
ctx.lineWidth = 1;
|
||||||
ctx.stroke();
|
|
||||||
|
|
||||||
ctx.moveTo(x + r, y);
|
ctx.moveTo(x + r, y);
|
||||||
ctx.lineTo(x + w - r, y);
|
ctx.lineTo(x + w - r, y);
|
||||||
@@ -1136,11 +1146,19 @@ function drawRoundRect(ctx, x, y, w, h, r, color) {
|
|||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* 顶部提示 */
|
||||||
|
.tip-line {
|
||||||
|
text-align: center;
|
||||||
|
color: #999;
|
||||||
|
font-size: 22rpx;
|
||||||
|
margin-bottom: 140rpx; /* 为底部固定按钮留出空间 */
|
||||||
|
}
|
||||||
|
|
||||||
/* 卡片预览 */
|
/* 卡片预览 */
|
||||||
.card-preview {
|
.card-preview {
|
||||||
margin: 24rpx auto;
|
margin: 30rpx auto 20rpx;
|
||||||
height: 960rpx;
|
height: 900rpx;
|
||||||
width: 540rpx;
|
width: 506rpx; /* 保持 9:16 比例并稍微缩小一点 */
|
||||||
border-radius: 30rpx;
|
border-radius: 30rpx;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
position: relative;
|
position: relative;
|
||||||
@@ -1229,36 +1247,84 @@ function drawRoundRect(ctx, x, y, w, h, r, color) {
|
|||||||
opacity: 0.6;
|
opacity: 0.6;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 顶部提示 */
|
/* 顶部步骤条 */
|
||||||
.tip-line {
|
.top-steps {
|
||||||
text-align: center;
|
|
||||||
color: #999;
|
|
||||||
font-size: 22rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 编辑工具区 */
|
|
||||||
.editor-panel {
|
|
||||||
margin: 20rpx 24rpx 40rpx;
|
|
||||||
border-radius: 30rpx 30rpx 0 0;
|
|
||||||
background: #fff;
|
background: #fff;
|
||||||
box-shadow: 0 -10rpx 30rpx rgba(0, 0, 0, 0.06);
|
padding: 10rpx 0;
|
||||||
padding-bottom: env(safe-area-inset-bottom);
|
box-shadow: 0 4rpx 20rpx rgba(0, 0, 0, 0.05);
|
||||||
|
position: relative;
|
||||||
|
z-index: 10;
|
||||||
}
|
}
|
||||||
.drag-handle {
|
|
||||||
width: 120rpx;
|
|
||||||
height: 8rpx;
|
|
||||||
border-radius: 999rpx;
|
|
||||||
background: #eee;
|
|
||||||
margin: 12rpx auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 步骤条工具 */
|
|
||||||
.step-bar {
|
.step-bar {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
padding: 20rpx 60rpx 10rpx;
|
padding: 10rpx 40rpx;
|
||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* 底部固定按钮 */
|
||||||
|
.bottom-actions-fixed {
|
||||||
|
position: fixed;
|
||||||
|
bottom: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
background: #fff;
|
||||||
|
padding-bottom: env(safe-area-inset-bottom);
|
||||||
|
z-index: 90;
|
||||||
|
box-shadow: 0 -10rpx 30rpx rgba(0, 0, 0, 0.05);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 弹出编辑面板 */
|
||||||
|
.panel-container {
|
||||||
|
position: fixed;
|
||||||
|
inset: 0;
|
||||||
|
z-index: 100;
|
||||||
|
visibility: hidden;
|
||||||
|
pointer-events: none;
|
||||||
|
transition: all 0.3s;
|
||||||
|
}
|
||||||
|
.panel-container.show {
|
||||||
|
visibility: visible;
|
||||||
|
pointer-events: auto;
|
||||||
|
}
|
||||||
|
.panel-mask {
|
||||||
|
position: absolute;
|
||||||
|
inset: 0;
|
||||||
|
background: rgba(0, 0, 0, 0.4);
|
||||||
|
opacity: 0;
|
||||||
|
transition: opacity 0.3s;
|
||||||
|
}
|
||||||
|
.panel-container.show .panel-mask {
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
.panel-content {
|
||||||
|
position: absolute;
|
||||||
|
bottom: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
background: #fff;
|
||||||
|
border-radius: 40rpx 40rpx 0 0;
|
||||||
|
padding: 30rpx 40rpx calc(40rpx + env(safe-area-inset-bottom));
|
||||||
|
transform: translateY(100%);
|
||||||
|
transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1);
|
||||||
|
max-height: 80vh;
|
||||||
|
overflow-y: auto;
|
||||||
|
}
|
||||||
|
.panel-container.show .panel-content {
|
||||||
|
transform: translateY(0);
|
||||||
|
}
|
||||||
|
.panel-content.glass-effect {
|
||||||
|
background: rgba(255, 255, 255, 0.85);
|
||||||
|
backdrop-filter: blur(20rpx);
|
||||||
|
-webkit-backdrop-filter: blur(20rpx);
|
||||||
|
}
|
||||||
|
.panel-handle {
|
||||||
|
width: 80rpx;
|
||||||
|
height: 8rpx;
|
||||||
|
background: #ddd;
|
||||||
|
border-radius: 4rpx;
|
||||||
|
margin: 0 auto 30rpx;
|
||||||
|
}
|
||||||
.step-item {
|
.step-item {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
|||||||
Reference in New Issue
Block a user