feat(postcss): 添加插件移除微信小程序不兼容Tailwind规则

- 实现 postcss-remove-wxss-incompatible 插件
- 移除反斜杠转义的重要性修饰符类选择器(.\!xxx)
- 删除依赖 :not 和兄弟选择器的 .space-[x|y]-* 规则
- 删除依赖 :not 和兄弟选择器的 .divide-[x|y]-* 规则
- 解决微信小程序 WXSS 不支持的 CSS 特性问题
This commit is contained in:
2026-06-30 16:38:54 +08:00
parent e4524154e0
commit 5f71295aae
9 changed files with 114 additions and 20 deletions

View File

@@ -233,7 +233,7 @@ const QRScanModal: React.FC<QRScanModalProps> = ({
)}
{status === 'error' && (
<View className="space-y-2">
<View className="flex flex-col gap-2">
<Button
type="primary"
size="large"

View File

@@ -126,7 +126,7 @@ const InviteStatsPage: React.FC = () => {
// 渲染统计概览
const renderStatsOverview = () => (
<View className="px-4 space-y-4">
<View className="px-4 flex flex-col gap-4">
{/* 核心数据卡片 */}
<Card className="bg-white rounded-2xl shadow-sm">
<View className="p-4">
@@ -182,7 +182,7 @@ const InviteStatsPage: React.FC = () => {
<Card className="bg-white rounded-2xl shadow-sm">
<View className="p-4">
<Text className="text-lg font-semibold text-gray-800 mb-4"></Text>
<View className="space-y-3">
<View className="flex flex-col gap-3">
{inviteStats.sourceStats.map((source, index) => (
<View key={index} className="flex items-center justify-between p-3 bg-gray-50 rounded-lg">
<View className="flex items-center">
@@ -208,7 +208,7 @@ const InviteStatsPage: React.FC = () => {
const renderInviteRecords = () => (
<View className="px-4">
{inviteRecords.length > 0 ? (
<View className="space-y-3">
<View className="flex flex-col gap-3">
{inviteRecords.map((record, index) => (
<Card key={record.id || index} className="bg-white rounded-xl shadow-sm">
<View className="p-4">
@@ -253,7 +253,7 @@ const InviteStatsPage: React.FC = () => {
</View>
{ranking.length > 0 ? (
<View className="space-y-3">
<View className="flex flex-col gap-3">
{ranking.map((item, index) => (
<Card key={item.inviterId} className="bg-white rounded-xl shadow-sm">
<View className="p-4 flex items-center">

View File

@@ -377,7 +377,7 @@ const DealerQrcode: React.FC = () => {
{/* 推广说明 */}
<View className="bg-white rounded-2xl p-4 mt-6 hidden">
<Text className="font-semibold text-gray-800 mb-3">广</Text>
<View className="space-y-2">
<View className="flex flex-col gap-2">
<View className="flex items-start">
<View className="w-2 h-2 bg-blue-500 rounded-full mt-2 mr-3 flex-shrink-0"></View>
<Text className="text-sm text-gray-600">
@@ -408,7 +408,7 @@ const DealerQrcode: React.FC = () => {
{/* <Text className="text-gray-500 mt-2">加载中...</Text>*/}
{/* </View>*/}
{/* ) : inviteStats ? (*/}
{/* <View className="space-y-4">*/}
{/* <View className="flex flex-col gap-4">*/}
{/* <View className="grid grid-cols-2 gap-4">*/}
{/* <View className="text-center">*/}
{/* <Text className="text-2xl font-bold text-blue-500">*/}
@@ -443,7 +443,7 @@ const DealerQrcode: React.FC = () => {
{/* {inviteStats.sourceStats && inviteStats.sourceStats.length > 0 && (*/}
{/* <View className="mt-4">*/}
{/* <Text className="text-sm font-medium text-gray-700 mb-2">邀请来源分布</Text>*/}
{/* <View className="space-y-2">*/}
{/* <View className="flex flex-col gap-2">*/}
{/* {inviteStats.sourceStats.map((source, index) => (*/}
{/* <View key={index} className="flex items-center justify-between py-2 px-3 bg-gray-50 rounded-lg">*/}
{/* <View className="flex items-center">*/}

View File

@@ -241,7 +241,7 @@ const PayPage: React.FC = () => {
<Divider />
<View className="flex items-start px-4 py-2">
<Tips className="text-orange-500 mr-2 mt-0.5" size="16" />
<Tips className="text-orange-500 mr-2 mt-1" size="16" />
<Text className="text-sm text-gray-500">
使
</Text>

View File

@@ -83,7 +83,7 @@ const ThemeSelector: React.FC = () => {
>
<Text className="text-lg font-bold mb-2"></Text>
<Text className="text-sm opacity-90 px-2">{currentTheme.description}</Text>
<View className="mt-4 flex justify-center space-x-4">
<View className="mt-4 flex justify-center">
<View
className="w-8 h-8 rounded-full"
style={{ backgroundColor: currentTheme.primary }}

View File

@@ -50,11 +50,15 @@ export function copyText(text: string) {
Taro.setClipboardData({
data: text,
success: function () {
Taro.showToast({
title: '复制成功',
icon: 'success',
duration: 2000
});
// 微信小程序调用 setClipboardData 成功后,系统会自带「内容已复制」提示。
// 为避免重复 Toast 影响用户体验,小程序端不再额外显示自定义 Toast。
if (process.env.TARO_ENV !== 'weapp') {
Taro.showToast({
title: '复制成功',
icon: 'success',
duration: 2000
});
}
},
fail: function () {
Taro.showToast({