Browse Source

feat(字体缩放): 实现全局字体缩放功能并优化样式变量

添加字体缩放比例状态管理,实现字体大小动态调整功能
修改uni.scss样式文件,使用CSS变量计算字体大小
更新多个页面组件以支持字体缩放功能
优化购物车和个人中心页面布局
master
wei 5 days ago
parent
commit
b916a46f8e
  1. 8
      App.vue
  2. 4
      components/custom-tab-bar/my-tab-bar.vue
  3. 16
      components/nav/nav.vue
  4. 10
      libs/utils/index.js
  5. 47
      pages/allDish/allDish.scss
  6. 26
      pages/home/home.vue
  7. 4
      pages/login/login.vue
  8. 354
      pages/personalInformation/personalInformation.vue
  9. 40
      pages/personalInformation/personallInformation.scss
  10. 28
      pages/shoppingCart/shoppingCart.vue
  11. 6
      store/index.js
  12. 49
      uni.scss

8
App.vue

@ -1,12 +1,20 @@
<script>
import { increaseFontScale } from "@/libs/utils/index.js";
import useStore from "@/store";
export default {
onLaunch() {
// console.log("App Launch");
const store = useStore();
store.fontScale = uni.getStorageSync("fontScale") || 1;
increaseFontScale(store.fontScale - 1);
},
onShow() {
// console.log("App Show");
},
onHide() {
const store = useStore();
uni.setStorageSync("fontScale", store.fontScale);
// console.log("App Hide");
},
};

4
components/custom-tab-bar/my-tab-bar.vue

@ -168,7 +168,7 @@ onReady(() => {
.name {
font-weight: 400;
font-size: $text-base;
// font-size: 26rpx;
// font-size: $text-lg;
color: #979996;
line-height: 1;
margin-top: 6rpx;
@ -184,7 +184,7 @@ onReady(() => {
background: #FF261F;
border-radius: 24rpx;
font-weight: 500;
font-size: 22rpx;
font-size: $text-sm;
color: #FFFFFF;
padding: 8rpx 20rpx;
box-sizing: border-box;

16
components/nav/nav.vue

@ -2,9 +2,9 @@
import { onLoad } from "@dcloudio/uni-app";
import { ref } from "vue";
import { useHeight } from "@/libs/utils";
// import useStore from "@/store";
import useStore from "@/store";
// const store = useStore();
const store = useStore();
const safeHeight = ref({
status: 0,
@ -14,6 +14,8 @@ const safeHeight = ref({
bottom: 0,
});
// const fontScale = computed(() => uni.getStorageSync("fontScale") || 1);
onLoad(() => {
const height = useHeight();
// console.log(height);
@ -27,7 +29,11 @@ onLoad(() => {
</script>
<template>
<view>
<view
:style="{
'--font-scale': store.fontScale,
}"
>
<slot
:status="safeHeight.status"
:menu="safeHeight.menu"
@ -53,3 +59,7 @@ onLoad(() => {
/>
</view>
</template>
<style lang="scss">
@import '../../uni.scss';
</style>

10
libs/utils/index.js

@ -1,4 +1,5 @@
// import { isAsync } from "./isPending";
import useStore from "@/store";
const _promiseThrottleMap = {};
@ -179,3 +180,12 @@ export function validates(validators, toastConfig = { icon: "none", returnBoolea
// })();
// }
}
/**
* 增加字体缩放比例
* @param {number} incScale 缩放增量默认0.1
*/
export function increaseFontScale(incScale = 0.1) {
const store = useStore();
store.fontScale += incScale;
}

47
pages/allDish/allDish.scss

@ -62,7 +62,7 @@ page {
/* position: fixed; */
/* top: 0; left: 0; */
z-index: 99;
font-size: 24rpx;
font-size: $text-base;
}
.nav-item-box {
@ -135,7 +135,7 @@ page {
/* margin-top: 68rpx; */
width: 100%;
height: calc(100% - 240rpx);
font-size: 24rpx;
font-size: $text-base;
}
.content-left {
@ -149,7 +149,8 @@ page {
.noneData {
text-align: center;
font-size: 36rpx;
font-size: $text-5xl;
font-weight: bold;
line-height: 100rpx;
}
@ -223,7 +224,7 @@ page {
.info-stock {
float: right;
font-size: 24rpx;
font-size: $text-base;
}
}
@ -243,7 +244,7 @@ page {
.unit-price {
width: 100%;
font-size: 24rpx;
font-size: $text-base;
float: left;
}
@ -297,7 +298,7 @@ page {
border: solid 4rpx #3aa24b;
color: #3aa24b;
padding: 10rpx 16rpx;
font-size: 24rpx;
font-size: $text-base;
margin-top: -50rpx;
}
@ -339,7 +340,7 @@ page {
}
.other-price {
font-size: 24rpx;
font-size: $text-base;
color: #b6b6b6;
}
@ -428,7 +429,7 @@ page {
align-items: center;
justify-content: center;
color: #666666;
// font-size: 24rpx;
// font-size: $text-base;
font-size: $text-base;
margin-top: 30rpx;
@ -508,7 +509,7 @@ page {
padding: 0 6rpx;
color: #fff;
font-weight: 500;
font-size: 24rpx;
font-size: $text-base;
font-family: PingFang SC, Helvetica Neue, Arial, sans-serif;
line-height: 28rpx;
text-align: center;
@ -817,7 +818,7 @@ page {
.text {
font-weight: 400;
font-size: 26rpx;
font-size: $text-lg;
color: #4D4D4D;
}
@ -892,7 +893,7 @@ page {
align-items: center;
justify-content: center;
color: #666666;
font-size: 24rpx;
font-size: $text-base;
margin-top: 30rpx;
.left {
@ -910,7 +911,7 @@ page {
overflow-y: scroll;
font-weight: 400;
font-size: $text-base;
// font-size: 26rpx;
// font-size: $text-lg;
color: #333333;
background: #F8FAF7;
padding-top: 14rpx;
@ -983,7 +984,7 @@ page {
transform: translateX(-50%) translateY(-50%);
top: 50%;
font-weight: 400;
font-size: 26rpx;
font-size: $text-lg;
color: #FFFFFF;
background-color: rgba(0, 0, 0, 0.3);
border-radius: 60rpx;
@ -1012,7 +1013,7 @@ page {
.inventory {
font-weight: 400;
font-size: 22rpx;
font-size: $text-sm;
color: #999999;
margin-top: 13rpx;
}
@ -1032,17 +1033,17 @@ page {
.price {
font-weight: bold;
font-size: 26rpx;
font-size: $text-lg;
color: #FF261F;
text {
font-size: 36rpx;
font-size: $text-5xl;
}
}
.original {
text-decoration-line: line-through;
font-size: 22rpx;
font-size: $text-sm;
color: #959595;
margin-left: 9rpx;
display: flex;
@ -1050,7 +1051,7 @@ page {
}
.no-original {
font-size: 22rpx;
font-size: $text-sm;
color: #959595;
margin-left: 9rpx;
display: flex;
@ -1115,7 +1116,7 @@ page {
}
.specifications {
font-size: 26rpx;
font-size: $text-lg;
color: #FFFFFF;
width: 125rpx;
height: 58rpx;
@ -1149,13 +1150,13 @@ page {
.price {
font-weight: bold;
font-size: 36rpx;
font-size: $text-5xl;
color: #FF261F;
line-height: 1;
}
.original {
font-size: 22rpx;
font-size: $text-sm;
color: #959595;
margin-left: 20rpx;
display: flex;
@ -1163,7 +1164,7 @@ page {
}
.no-original {
font-size: 22rpx;
font-size: $text-sm;
color: #959595;
margin-left: 9rpx;
display: flex;
@ -1243,7 +1244,7 @@ page {
.no-stock {
font-weight: 400;
font-size: 26rpx;
font-size: $text-lg;
color: #FFFFFF;
background-color: rgba(0, 0, 0, 0.3);
border-radius: 60rpx;

26
pages/home/home.vue

@ -15,8 +15,11 @@ import {
getSystemSettingApi,
// myOrdersApi,
} from "@/libs/api";
import useStore from "@/store";
// import permissionPopup from "@/components/permissionPopup/permissionPopup.vue";
// import checkUpdate from "@/uni_modules/uni-upgrade-center-app/utils/check-update";
const store = useStore();
/**
* 顶部安全距离
*/
@ -431,7 +434,10 @@ onShow(() => {
<template>
<view
class="main"
:style="{ paddingBottom: statusBarHeight ? `${statusBarHeight + 45}px` : '89px' }"
:style="{
'paddingBottom': statusBarHeight ? `${statusBarHeight + 45}px` : '89px',
'--font-scale': store.fontScale,
}"
>
<view
class="header-box"
@ -1067,7 +1073,7 @@ onShow(() => {
margin-top: 26rpx;
}
.inventory {
// font-size: 22rpx;
// font-size: $text-sm;
font-size: $text-sm;
color: #999999;
margin-top: 20rpx;
@ -1085,17 +1091,17 @@ onShow(() => {
flex-wrap: wrap;
.price {
font-weight: bold;
// font-size: 36rpx;
// font-size: $text-5xl;
font-size: $text-2xl;
color: #FF261F;
line-height: 1;
text {
font-size: 26rpx;
font-size: $text-lg;
}
}
.original {
text-decoration-line: line-through;
// font-size: 22rpx;
// font-size: $text-sm;
font-size: $text-sm;
color: #959595;
margin-left: 20rpx;
@ -1103,7 +1109,7 @@ onShow(() => {
align-items: center;
}
.no-original {
// font-size: 22rpx;
// font-size: $text-sm;
font-size: $text-sm;
color: #959595;
margin-left: 20rpx;
@ -1112,7 +1118,7 @@ onShow(() => {
}
}
.specifications {
font-size: 26rpx;
font-size: $text-lg;
color: #FFFFFF;
width: 125rpx;
height: 58rpx;
@ -1201,13 +1207,13 @@ onShow(() => {
flex-wrap: wrap;
.price {
font-weight: bold;
// font-size: 36rpx;
// font-size: $text-5xl;
font-size: $text-2xl;
color: #FF261F;
line-height: 1;
}
.original {
// font-size: 22rpx;
// font-size: $text-sm;
font-size: $text-sm;
color: #959595;
margin-left: 20rpx;
@ -1216,7 +1222,7 @@ onShow(() => {
}
.no-original {
font-size: $text-sm;
// font-size: 22rpx;
// font-size: $text-sm;
color: #959595;
margin-left: 20rpx;
display: flex;

4
pages/login/login.vue

@ -467,7 +467,7 @@ input {
}
.code_button{
width:200rpx;
font-size: 24rpx;
font-size: $text-base;
line-height: 40rpx;
height:auto;
padding: 6rpx;
@ -495,7 +495,7 @@ input {
}
.main {
padding: 44px 50rpx 0;
// font-size: 24rpx;
// font-size: $text-base;
font-size: $text-base;
.title {
font-size: $text-9xl;

354
pages/personalInformation/personalInformation.vue

@ -2,8 +2,10 @@
import { onLoad } from "@dcloudio/uni-app";
import { ref } from "vue";
import customTabBar from "@/components/custom-tab-bar/my-tab-bar.vue";
import navigation from "@/components/navigation/navigation.vue";
import navv from "@/components/nav/nav.vue";
// import navigation from "@/components/navigation/navigation.vue";
import { getUserInfoApi, yesterdayOrderApi } from "@/libs/api";
import { increaseFontScale } from "@/libs/utils";
/**
* 判断登录状态
@ -352,195 +354,211 @@ onLoad(() => {
</script>
<template>
<view class="w-full main">
<!-- 登录 头像 -->
<view class="header-box">
<image class="back-img" src="/static/personalInformation/juxing.png" mode="widthFix" />
<navigation
title="个人中心"
background="#05b259"
:title-style="{ color: 'white' }"
:icon-style="{ display: 'none' }"
/>
<!-- <uv-navbar title="个人中心" /> -->
<view class="userinfo">
<view class="left">
<image
class="avatar"
:src="userInfo.image ? userInfo.image : '/static/personalInformation/touxiang1.png'"
mode="aspectFill"
/>
<navv>
<template #default="{ status, menu }">
<!-- 登录 头像 -->
<view class="header-box">
<image class="back-img" src="/static/personalInformation/juxing.png" mode="widthFix" />
<view
class="title"
:style="{
paddingTop: `${status}px`,
height: menu ? `${menu}px` : 'auto',
}"
>
个人中心
</view>
<!-- <navigation
title="个人中心"
background="#05b259"
:title-style="{ color: 'white' }"
:icon-style="{ display: 'none' }"
/> -->
<!-- <uv-navbar title="个人中心" /> -->
<view class="userinfo">
<view class="left">
<image
class="avatar"
:src="userInfo.image ? userInfo.image : '/static/personalInformation/touxiang1.png'"
mode="aspectFill"
/>
<!-- telephone true -->
<view v-if="userInfo.telephone" class="information">
<view class="name">
{{ userInfo.username }}
</view>
<view v-if="company" class="company">
{{ company.name }}
<!-- telephone true -->
<view v-if="userInfo.telephone" class="information">
<view class="name">
{{ userInfo.username }}
</view>
<view v-if="company" class="company">
{{ company.name }}
</view>
<view v-else class="add-company" @click="onJoinEnterprise">
<text>加入企业</text>
<uv-icon color="white" name="arrow-right" size="28rpx" />
</view>
</view>
<view v-else class="add-company" @click="onJoinEnterprise">
<text>加入企业</text>
<uv-icon color="white" name="arrow-right" size="28rpx" />
</view>
</view>
<!-- telephone false -->
<view v-else class="btns">
<view v-if="isLogin" class="add-company" @click="onJoinEnterprise">
<text>加入企业</text>
<uv-icon color="white" name="arrow-right" size="28rpx" />
</view>
<view v-else class="login-btn" @click="onGotoLogin">
<text> 登录 </text>
<uv-icon color="white" name="arrow-right" size="28rpx" />
<!-- telephone false -->
<view v-else class="btns">
<view v-if="isLogin" class="add-company" @click="onJoinEnterprise">
<text>加入企业</text>
<uv-icon color="white" name="arrow-right" size="28rpx" />
</view>
<view v-else class="login-btn" @click="onGotoLogin">
<text> 登录 </text>
<uv-icon color="white" name="arrow-right" size="28rpx" />
</view>
</view>
</view>
</view>
<view v-if="userInfo.telephone" class="right">
<image
class="icon-one"
src="/static/personalInformation/fujingqiy.png"
mode="widthFix"
@click="onOpenFriends"
/>
<image
class="icon-two"
src="/static/personalInformation/shezhi.png"
mode="widthFix"
@click="onOpenMyInfo"
/>
<view v-if="userInfo.telephone" class="right">
<image
class="icon-one"
src="/static/personalInformation/fujingqiy.png"
mode="widthFix"
@click="onOpenFriends"
/>
<image
class="icon-two"
src="/static/personalInformation/shezhi.png"
mode="widthFix"
@click="onOpenMyInfo"
/>
</view>
</view>
</view>
</view>
<view class="order-cart-box">
<text class="title">
常用订单
</text>
<view class="order-list-box">
<view
v-for="item in commonOrders"
:key="item.title"
class="order-list"
@click="onGotoOrder"
>
<view v-if="item.title === 'dfk'" class="order-tag">
{{ dfkDataLength }}
<view class="order-cart-box">
<text class="title">
常用订单
</text>
<view class="order-list-box">
<view
v-for="item in commonOrders"
:key="item.title"
class="order-list"
@click="onGotoOrder"
>
<view v-if="item.title === 'dfk'" class="order-tag">
{{ dfkDataLength }}
</view>
<image class="icon" :src="item.url" mode="aspectFit" />
<text class="name">
{{ item.text }}
</text>
</view>
<image class="icon" :src="item.url" mode="aspectFit" />
<text class="name">
{{ item.text }}
</view>
<view v-if="position" class="order-list-box-position" @click="onGetPosition">
<text class="text">
你有订单正在配送点击查看位置
</text>
<image class="icon" src="/static/personalInformation/arrow-two.png" mode="" />
</view>
</view>
<view v-if="position" class="order-list-box-position" @click="onGetPosition">
<text class="text">
你有订单正在配送点击查看位置
</text>
<image class="icon" src="/static/personalInformation/arrow-two.png" mode="" />
</view>
</view>
<view class="tool-box">
<block
v-for="(parent, parentIndex) in commonTools"
:key="parentIndex"
>
<text v-if="parentIndex === 0" class="title">
账号管理
</text>
<text v-if="parentIndex === 1" class="title">
充值管理
</text>
<text v-if="parentIndex === 2" class="title">
财务管理
</text>
<text v-if="parentIndex === 3" class="title">
常用工具
</text>
<view class="tool-list-box">
<template v-for="(item) in parent" :key="item.title">
<block
v-if="(item.auth && userInfo.comBoss) || !item.auth"
>
<button
v-if="item.type === 'tap'"
class="tool-list"
@click="exportDeliveryNote"
>
<image class="icon" :src="item.url" mode="aspectFit" />
<text class="name">
{{ item.text }}
</text>
</button>
<button
v-if="item.type === 'other'"
class="tool-list"
data-item="{{item}}"
@click="handleOther"
>
<image class="icon" :src="item.url" mode="aspectFit" />
<text class="name">
{{ item.text }}
</text>
</button>
<navigator
v-if="
item.type !== 'tap'
&& item.type !== 'share'
&& item.type !== 'switchTab'
&& item.type !== 'other'
"
style="display: flex;flex-direction: column;width: 25%;margin-bottom: 48rpx;"
url="{{item.path}}"
:open-type="item.type"
hover-class="other-navigator-hover"
<view class="tool-box">
<view>
<uv-button @click="() => increaseFontScale(0.1)">
加大字体
</uv-button>
<uv-button @click="() => increaseFontScale(-0.1)">
减小字体
</uv-button>
</view>
<block
v-for="(parent, parentIndex) in commonTools"
:key="parentIndex"
>
<text v-if="parentIndex === 0" class="title">
账号管理
</text>
<text v-if="parentIndex === 1" class="title">
充值管理
</text>
<text v-if="parentIndex === 2" class="title">
财务管理
</text>
<text v-if="parentIndex === 3" class="title">
常用工具
</text>
<view class="tool-list-box">
<template v-for="(item) in parent" :key="item.title">
<block
v-if="(item.auth && userInfo.comBoss) || !item.auth"
>
<button class="tool-list" style="width: 100%;margin-bottom: 0;">
<button
v-if="item.type === 'tap'"
class="tool-list"
@click="exportDeliveryNote"
>
<image class="icon" :src="item.url" mode="aspectFit" />
<text class="name">
{{ item.text }}
</text>
</button>
</navigator>
<button
v-if="item.type === 'switchTab'"
class="tool-list"
@click="openSwitchTab"
>
<image class="icon" :src="item.url" mode="aspectFit" />
<text class="name">
{{ item.text }}
</text>
</button>
<button
v-if="item.type === 'share'"
class="tool-list"
data-name="shareBtn"
open-type="share"
>
<image class="icon" :src="item.url" mode="aspectFit" />
<text class="name">
{{ item.text }}
</text>
</button>
</block>
</template>
</view>
</block>
</view>
<view>
<uv-button>加大字体</uv-button>
<uv-button>减小字体</uv-button>
</view>
<button
v-if="item.type === 'other'"
class="tool-list"
data-item="{{item}}"
@click="handleOther"
>
<image class="icon" :src="item.url" mode="aspectFit" />
<text class="name">
{{ item.text }}
</text>
</button>
<navigator
v-if="
item.type !== 'tap'
&& item.type !== 'share'
&& item.type !== 'switchTab'
&& item.type !== 'other'
"
style="display: flex;flex-direction: column;width: 25%;margin-bottom: 48rpx;"
url="{{item.path}}"
:open-type="item.type"
hover-class="other-navigator-hover"
>
<button class="tool-list" style="width: 100%;margin-bottom: 0;">
<image class="icon" :src="item.url" mode="aspectFit" />
<text class="name">
{{ item.text }}
</text>
</button>
</navigator>
<button
v-if="item.type === 'switchTab'"
class="tool-list"
@click="openSwitchTab"
>
<image class="icon" :src="item.url" mode="aspectFit" />
<text class="name">
{{ item.text }}
</text>
</button>
<button
v-if="item.type === 'share'"
class="tool-list"
data-name="shareBtn"
open-type="share"
>
<image class="icon" :src="item.url" mode="aspectFit" />
<text class="name">
{{ item.text }}
</text>
</button>
</block>
</template>
</view>
</block>
</view>
<customTabBar tab-index="4" />
</view>
<customTabBar tab-index="4" />
</template>
</navv>
</template>
<style lang="scss" scoped>
@import './personallInformation.scss'
@import '../../uni.scss';
@import './personallInformation.scss';
</style>

40
pages/personalInformation/personallInformation.scss

@ -19,7 +19,7 @@
}
.info {
font-size: 24rpx;
font-size: $text-base;
float: left;
view {
@ -77,7 +77,7 @@
// padding-bottom: 20rpx;
border-bottom: solid 1px #f8f8f8;
font-weight: bold;
font-size: 36rpx;
font-size: $text-5xl;
}
.weui-grids {
@ -212,7 +212,7 @@
border-radius: 30rpx;
padding: 12rpx 30rpx;
margin-bottom: 10rpx;
font-size: 24rpx;
font-size: $text-base;
image {
width: 24rpx;
@ -263,7 +263,7 @@
padding: 0 6rpx;
color: #fff;
font-weight: 500;
font-size: 24rpx;
font-size: $text-base;
font-family: PingFang SC, Helvetica Neue, Arial, sans-serif;
line-height: 28rpx;
text-align: center;
@ -321,7 +321,7 @@
.select_text {
color: #999999;
font-size: 24rpx;
font-size: $text-base;
line-height: 68rpx;
flex: 1;
text-overflow: ellipsis;
@ -348,7 +348,7 @@
background: rgba(0, 0, 0, 0.6);
z-index: 999;
float: left;
font-size: 24rpx;
font-size: $text-base;
}
.option_team {
@ -362,7 +362,7 @@
.option {
display: block;
line-height: 80rpx;
font-size: 24rpx;
font-size: $text-base;
color: #777777;
border-top: 1px solid #efefef;
border-bottom: 1px solid #efefef;
@ -377,7 +377,7 @@
}
.email_input {
font-size: 24rpx;
font-size: $text-base;
padding: 8rpx 20rpx;
color: #999999;
background: #f6f6f6;
@ -426,6 +426,16 @@
height: 449rpx;
z-index: -1;
}
.title {
background: '#05b259';
display: flex;
align-items: center;
// justify-content: center;
margin-left: 29rpx;
font-weight: bold;
font-size: $text-3xl;
color: #FFFFFF;
}
.box {
display: flex;
@ -433,7 +443,7 @@
.text {
font-weight: bold;
font-size: 33rpx;
font-size: $text-3xl;
color: #FFFFFF;
margin-left: 28rpx;
}
@ -465,7 +475,7 @@
align-items: center;
font-weight: 400;
font-size: $text-base;
// font-size: 26rpx;
// font-size: $text-lg;
color: #FFFFFF;
}
@ -548,7 +558,7 @@
.name {
font-weight: 400;
font-size: $text-base;
// font-size: 26rpx;
// font-size: $text-lg;
color: #666666;
margin-top: 22rpx;
}
@ -567,7 +577,7 @@
.text {
color: #ff9126;
font-size: 26rpx;
font-size: $text-lg;
font-weight: 400;
padding: 15rpx;
box-sizing: border-box;
@ -625,7 +635,7 @@
.name {
font-weight: 400;
font-size: $text-base;
// font-size: 26rpx;
// font-size: $text-lg;
color: #666666;
margin-top: 22rpx;
}
@ -666,7 +676,7 @@
.text {
font-weight: 500;
font-size: 26rpx;
font-size: $text-lg;
color: #333333;
margin-left: 16rpx;
}
@ -697,7 +707,7 @@
.left {
font-weight: 400;
font-size: 26rpx;
font-size: $text-lg;
color: #4D4D4D;
}

28
pages/shoppingCart/shoppingCart.vue

@ -1,9 +1,10 @@
<script setup>
import { onLoad } from "@dcloudio/uni-app";
import customTabBar from "@/components/custom-tab-bar/my-tab-bar.vue";
import navv from "@/components/nav/nav.vue";
import topTitle from "@/components/topTitle/topTitle.vue";
onLoad(() => {
// #ifdef APP
uni.hideTabBar();
@ -13,17 +14,24 @@ onLoad(() => {
<template>
<navv>
<template #default="{ menu, status }">
<view>
购物车
<template #default="{ fixStyle, padStyle }">
<topTitle title="购物车" :style="{ ...fixStyle, backgroundColor: '#fff' }" />
<view :style="padStyle">
<view
v-for="(item, index) in 1000" :key="index"
>
{{ item }}
</view>
</view>
<customTabBar tab-index="3" />
</template>
</navv>
<!-- <view class="w-full h-full">
购物车
<customTabBar tab-index="3" />
</view> -->
</template>
<style lang="scss" scoped></style>
<style lang="scss" scoped>
:deep(.left .icon-back) {
display: none;
}
</style>

6
store/index.js

@ -11,6 +11,7 @@ import { ref } from "vue";
* @property {string} showVoice - 是否显示语音弹窗
* @property {string} tabbarBottomHeight - 底部导航高度
* @property {string} tabbarItemWidth - 底部导航每个的宽度
* @property {string} fontScale - 字体缩放比例
* @property {method} increment - 增加购物车角标数量
* @property {method} getCartTotalQuantity - 获取购物车商品数量
* @property {method} changeCartList - 修改购物车列表
@ -61,6 +62,10 @@ export default defineStore("store",
* 底部导航每个的宽度
*/
const tabbarItemWidth = ref(82);
/**
* 字体缩放比例
*/
const fontScale = ref(1);
/**
* 修改购物车数量
@ -127,6 +132,7 @@ export default defineStore("store",
showVoice,
tabbarBottomHeight,
tabbarItemWidth,
fontScale,
increment,
changeSearchValue,
clearSearchValue,

49
uni.scss

@ -37,25 +37,40 @@ $uni-bg-color-mask:rgba(0, 0, 0, 0.4);//遮罩颜色
/* 边框颜色 */
$uni-border-color:#c8c7cc;
/* 尺寸变量 */
// /* 尺寸变量 */
// :root {
// --font-scale: 1
// }
/* 文字尺寸 */
$uni-font-size-sm:12px;
$uni-font-size-base:14px;
$uni-font-size-lg:16px;
$text-xs: 20rpx;
$text-sm: 22rpx;
$text-base: 24rpx;
$text-lg: 26rpx;
$text-xl: 28rpx;
$text-2xl: 30rpx;
$text-3xl: 32rpx;
$text-4xl: 34rpx;
$text-5xl: 36rpx;
$text-6xl: 38rpx;
$text-7xl: 40rpx;
$text-8xl: 42rpx;
$text-9xl: 44rpx;
$uni-font-size-sm: calc(var(--font-scale, 1) * 12px);
$uni-font-size-base: calc(var(--font-scale, 1) * 14px);
$uni-font-size-lg: calc(var(--font-scale, 1) * 16px);
$text-xs: calc(var(--font-scale, 1) * 20rpx);
$text-sm: calc(var(--font-scale, 1) * 22rpx);
$text-base: calc(var(--font-scale, 1) * 24rpx);
$text-lg: calc(var(--font-scale, 1) * 26rpx);
$text-xl: calc(var(--font-scale, 1) * 28rpx);
$text-2xl: calc(var(--font-scale, 1) * 30rpx);
$text-3xl: calc(var(--font-scale, 1) * 32rpx);
$text-4xl: calc(var(--font-scale, 1) * 34rpx);
$text-5xl: calc(var(--font-scale, 1) * 36rpx);
$text-6xl: calc(var(--font-scale, 1) * 38rpx);
$text-7xl: calc(var(--font-scale, 1) * 40rpx);
$text-8xl: calc(var(--font-scale, 1) * 42rpx);
$text-9xl: calc(var(--font-scale, 1) * 44rpx);
// $text-sm: 22rpx;
// $text-base: 24rpx;
// $text-lg: 26rpx;
// $text-xl: 28rpx;
// $text-2xl: 30rpx;
// $text-3xl: 32rpx;
// $text-4xl: 34rpx;
// $text-5xl: 36rpx;
// $text-6xl: 38rpx;
// $text-7xl: 40rpx;
// $text-8xl: 42rpx;
// $text-9xl: 44rpx;
// $text-2xl: 40rpx;
// $text-3xl: 44rpx;
// $text-4xl: 48rpx;

Loading…
Cancel
Save