接入基础方法
parent
2676308b90
commit
e275e1ca7e
|
|
@ -56,6 +56,8 @@
|
||||||
"@dcloudio/uni-quickapp-webview": "3.0.0-alpha-4010520240507001",
|
"@dcloudio/uni-quickapp-webview": "3.0.0-alpha-4010520240507001",
|
||||||
"clipboard": "^2.0.11",
|
"clipboard": "^2.0.11",
|
||||||
"dayjs": "^1.11.11",
|
"dayjs": "^1.11.11",
|
||||||
|
"pinia": "2.0.33",
|
||||||
|
"pinia-plugin-persistedstate": "^3.2.1",
|
||||||
"tiny-emitter": "^2.1.0",
|
"tiny-emitter": "^2.1.0",
|
||||||
"uview-plus": "^3.1.41",
|
"uview-plus": "^3.1.41",
|
||||||
"vue": "^3.4.21",
|
"vue": "^3.4.21",
|
||||||
|
|
@ -71,6 +73,8 @@
|
||||||
"@vue/runtime-core": "^3.4.21",
|
"@vue/runtime-core": "^3.4.21",
|
||||||
"sass": "^1.69.7",
|
"sass": "^1.69.7",
|
||||||
"sass-loader": "10",
|
"sass-loader": "10",
|
||||||
|
"unocss": "^0.58.5",
|
||||||
|
"unocss-applet": "^0.8.2",
|
||||||
"vite": "5.2.8"
|
"vite": "5.2.8"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -125,9 +125,6 @@ button::after {
|
||||||
|
|
||||||
// 页面布局相关 外边距
|
// 页面布局相关 外边距
|
||||||
|
|
||||||
.p-16 {
|
|
||||||
padding: 16px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.pt-24 {
|
.pt-24 {
|
||||||
padding-top: 20px;
|
padding-top: 20px;
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,7 @@ dayjs.locale('zh-cn');
|
||||||
|
|
||||||
import mpShare from 'uview-plus/libs/mixin/mpShare'
|
import mpShare from 'uview-plus/libs/mixin/mpShare'
|
||||||
import mixin_common, { goToPage } from '@/utils/mixins/mixin_common';
|
import mixin_common, { goToPage } from '@/utils/mixins/mixin_common';
|
||||||
|
import 'uno.css'
|
||||||
|
|
||||||
export function createApp() {
|
export function createApp() {
|
||||||
const app = createSSRApp(App);
|
const app = createSSRApp(App);
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@
|
||||||
<image class="icon" src="../../static//images/error.png" />
|
<image class="icon" src="../../static//images/error.png" />
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="p-16 text-xs text-4e text-center ">
|
<view class="p-base text-xs text-4e text-center ">
|
||||||
{{ props.rules }}
|
{{ props.rules }}
|
||||||
</view>
|
</view>
|
||||||
<view class="flex items-center">
|
<view class="flex items-center">
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@
|
||||||
}"
|
}"
|
||||||
>
|
>
|
||||||
<view class="mine-page">
|
<view class="mine-page">
|
||||||
<view class="p-16">
|
<view class="p-base">
|
||||||
<view class="userinfo-box">
|
<view class="userinfo-box">
|
||||||
<view class="userinfo" @click="handleClickUserInfo">
|
<view class="userinfo" @click="handleClickUserInfo">
|
||||||
<up-avatar
|
<up-avatar
|
||||||
|
|
@ -217,7 +217,12 @@ const upCallback = (mescroll) => {
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
.phone {
|
.phone {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
|
// #ifdef MP-WEIXIN
|
||||||
bottom: 50rpx;
|
bottom: 50rpx;
|
||||||
|
// #endif
|
||||||
|
// #ifdef H5
|
||||||
|
bottom: 180rpx;
|
||||||
|
// #endif
|
||||||
z-index: 9999;
|
z-index: 9999;
|
||||||
left: 0;
|
left: 0;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,56 @@
|
||||||
|
|
||||||
|
import { defineConfig, presetAttributify } from 'unocss'
|
||||||
|
|
||||||
|
import {
|
||||||
|
presetApplet,
|
||||||
|
presetRemRpx,
|
||||||
|
transformerAttributify,
|
||||||
|
} from 'unocss-applet'
|
||||||
|
|
||||||
|
// uni-app
|
||||||
|
const isApplet = process.env?.UNI_PLATFORM?.startsWith('mp-') ?? false
|
||||||
|
|
||||||
|
const presets = []
|
||||||
|
const transformers = []
|
||||||
|
|
||||||
|
if (isApplet) {
|
||||||
|
presets.push(presetApplet())
|
||||||
|
presets.push(presetRemRpx())
|
||||||
|
transformers.push(transformerAttributify({ ignoreAttributes: ['block'] }))
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
presets.push(presetApplet())
|
||||||
|
presets.push(presetAttributify())
|
||||||
|
presets.push(presetRemRpx({ mode: 'rpx2rem' }))
|
||||||
|
}
|
||||||
|
|
||||||
|
export default defineConfig({
|
||||||
|
shortcuts: {
|
||||||
|
'flex-center': 'flex items-center justify-center',
|
||||||
|
},
|
||||||
|
theme: {
|
||||||
|
colors: {
|
||||||
|
primary: '#ee2c37',
|
||||||
|
|
||||||
|
},
|
||||||
|
spacing: {
|
||||||
|
'base': '30rpx'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
rules: [
|
||||||
|
[
|
||||||
|
'p-safe',
|
||||||
|
{
|
||||||
|
padding: 'env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left)',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
['pt-safe', { 'padding-top': 'env(safe-area-inset-top)' }],
|
||||||
|
['pb-safe', { 'padding-bottom': 'env(safe-area-inset-bottom)' }],
|
||||||
|
],
|
||||||
|
presets: [
|
||||||
|
...presets,
|
||||||
|
],
|
||||||
|
transformers: [
|
||||||
|
...transformers,
|
||||||
|
],
|
||||||
|
})
|
||||||
|
|
@ -1,8 +1,10 @@
|
||||||
import { defineConfig } from 'vite'
|
import { defineConfig } from 'vite'
|
||||||
import uni from '@dcloudio/vite-plugin-uni'
|
import uni from '@dcloudio/vite-plugin-uni'
|
||||||
|
import UnoCSS from 'unocss/vite'
|
||||||
// https://vitejs.dev/config/
|
// https://vitejs.dev/config/
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
plugins: [
|
plugins: [
|
||||||
uni(),
|
uni(),
|
||||||
|
UnoCSS()
|
||||||
],
|
],
|
||||||
})
|
})
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue