fix(mini-user): address textarea freeze, input align, wechat share invoke
CI / verify (pull_request) Has been cancelled

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-07-15 20:48:33 +08:00
parent 966ddc9219
commit 9a3ccabcc9
10 changed files with 299 additions and 46 deletions
@@ -0,0 +1,56 @@
.share-guide {
position: fixed;
inset: 0;
z-index: 10000;
background: rgba(0, 0, 0, 0.55);
display: flex;
flex-direction: column;
align-items: flex-end;
padding: 12px 16px;
box-sizing: border-box;
}
.share-guide__arrow {
width: 0;
height: 0;
margin-right: 18px;
border-left: 10px solid transparent;
border-right: 10px solid transparent;
border-bottom: 14px solid #fff;
filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.12));
}
.share-guide__card {
margin-top: 0;
margin-right: 8px;
max-width: 260px;
padding: 16px 18px;
border-radius: 12px;
background: #fff;
box-shadow: 0 8px 28px rgba(0, 0, 0, 0.18);
text-align: left;
}
.share-guide__title {
display: block;
font-size: 16px;
font-weight: 700;
color: #1a1a1a;
margin-bottom: 8px;
}
.share-guide__desc {
display: block;
font-size: 13px;
line-height: 1.5;
color: #666;
}
.share-guide__ok {
display: block;
margin-top: 14px;
text-align: right;
font-size: 14px;
font-weight: 600;
color: #a61d24;
}
@@ -1,5 +1,7 @@
import { useState } from 'react';
import { Button, Text, View } from '@tarojs/components';
import { handleShareButtonClick, type PageSharePayload } from '../lib/wechat-share';
import './ShareGuide.css';
type ShareNavButtonProps = {
payload?: PageSharePayload;
@@ -8,9 +10,11 @@ type ShareNavButtonProps = {
/**
* 顶栏分享:
* - 小程序:open-type=share 弹出微信分享面板
* - H5 微信:JSSDK 配置后提示点右上角 ···
* - H5 微信:JSSDK share / 右上角引导蒙层
*/
export default function ShareNavButton({ payload }: ShareNavButtonProps) {
const [guideVisible, setGuideVisible] = useState(false);
if (process.env.TARO_ENV === 'weapp') {
return (
<Button className="page-nav-bar__btn page-nav-bar__share-btn" openType="share" hoverClass="none">
@@ -20,13 +24,27 @@ export default function ShareNavButton({ payload }: ShareNavButtonProps) {
}
return (
<View
className="page-nav-bar__btn"
onClick={() => {
void handleShareButtonClick(payload);
}}
>
<Text className="page-nav-bar__icon page-nav-bar__icon--share"></Text>
</View>
<>
<View
className="page-nav-bar__btn"
onClick={() => {
void handleShareButtonClick(payload).then((res) => {
if (res.showGuide) setGuideVisible(true);
});
}}
>
<Text className="page-nav-bar__icon page-nav-bar__icon--share"></Text>
</View>
{guideVisible ? (
<View className="share-guide" onClick={() => setGuideVisible(false)}>
<View className="share-guide__arrow" />
<View className="share-guide__card">
<Text className="share-guide__title"></Text>
<Text className="share-guide__desc"> ··· </Text>
<Text className="share-guide__ok"></Text>
</View>
</View>
) : null}
</>
);
}