feat(style): 移除 postcss-mobile-forever 插件并调整签名功能

- 移除了 nuxt 配置中的 postcss-mobile-forever 插件- 在 package.json 和 pnpm-lock.yaml 中添加了 postcss-px-to-viewport 依赖
-调整了签名面板的样式,为 VueSignaturePad 添加了高度属性
- 移除了签名确认时的冗余代码,优化了确认流程
This commit is contained in:
xingyy 2025-02-26 19:03:15 +08:00
parent f1c7c2a66d
commit c8899348a4
5 changed files with 26 additions and 23 deletions

View File

@ -51,6 +51,7 @@ const confirm=async ()=>{
<client-only>
<VueSignaturePad
width="100%"
height="93%"
class="signature bg-#fff rounded-10px mb-10px"
ref="signaturePad"
/>

View File

@ -50,15 +50,8 @@ const submitSignature = () => {
}
const { data } = signaturePad.value?.saveSignature(); // base64
imgUrl.value = data;
show.value = true;
nextTick(() => {
const overlay = document.querySelector('.signature-container .van-overlay');
if (overlay) {
overlay.style.width = '100vw';
overlay.style.left = '0';
overlay.style.right = '0';
}
})
confirm()
};
const confirm = async () => {
const res = await signOnline({

View File

@ -36,20 +36,17 @@ export default defineNuxtConfig({
postcss: {
plugins: {
'autoprefixer': {},
// https://github.com/wswmsword/postcss-mobile-forever
'postcss-mobile-forever': {
appSelector: '#__nuxt',
viewportWidth: 375,
// devtools excluded
exclude: /@nuxt/,
border: true,
rootContainingBlockSelectorList: [
'van-tabbar',
'van-popup',
'van-overlay',
],
},
'postcss-px-to-viewport': {
viewportWidth: 375, // 设计稿宽度
viewportUnit: 'vmin', // 关键配置
fontViewportUnit: 'vmin', // 字体单位
unitPrecision: 5,
propList: ['*'],
selectorBlackList: [],
minPixelValue: 1,
mediaQuery: false,
exclude: /@nuxt/
}
},
},
i18n: {

View File

@ -49,6 +49,7 @@
"cross-env": "^7.0.3",
"ipx": "^3.0.1",
"postcss-mobile-forever": "^4.3.1",
"postcss-px-to-viewport": "^1.1.1",
"sass": "^1.83.1",
"sass-loader": "^16.0.4",
"sharp": "^0.33.5",

View File

@ -102,6 +102,9 @@ importers:
postcss-mobile-forever:
specifier: ^4.3.1
version: 4.3.2(postcss@8.5.2)
postcss-px-to-viewport:
specifier: ^1.1.1
version: 1.1.1
sass:
specifier: ^1.83.1
version: 1.85.0
@ -3675,6 +3678,9 @@ packages:
peerDependencies:
postcss: ^8.4.31
postcss-px-to-viewport@1.1.1:
resolution: {integrity: sha512-2x9oGnBms+e0cYtBJOZdlwrFg/mLR4P1g2IFu7jYKvnqnH/HLhoKyareW2Q/x4sg0BgklHlP1qeWo2oCyPm8FQ==}
postcss-reduce-initial@7.0.2:
resolution: {integrity: sha512-pOnu9zqQww7dEKf62Nuju6JgsW2V0KRNBHxeKohU+JkHd/GAH5uvoObqFLqkeB2n20mr6yrlWDvo5UBU5GnkfA==}
engines: {node: ^18.12.0 || ^20.9.0 || >=22.0}
@ -8812,6 +8818,11 @@ snapshots:
postcss: 8.5.2
postcss-value-parser: 4.2.0
postcss-px-to-viewport@1.1.1:
dependencies:
object-assign: 4.1.1
postcss: 8.5.2
postcss-reduce-initial@7.0.2(postcss@8.5.2):
dependencies:
browserslist: 4.24.4