style: 购物车、我的页面ui

This commit is contained in:
2026-06-02 14:00:17 +08:00
parent 1fe0a6351c
commit f83068a3fc
12 changed files with 274 additions and 82 deletions
+10 -1
View File
@@ -10,7 +10,9 @@
<view class="title size36 flex1 center" :style="[{ color: textColor }]">{{ <view class="title size36 flex1 center" :style="[{ color: textColor }]">{{
props.title props.title
}}</view> }}</view>
<view> </view> <view class="cardRight" :style="{ color: textColor }">
<slot name="right" />
</view>
</view> </view>
</view> </view>
</template> </template>
@@ -102,4 +104,11 @@
left: 20rpx; left: 20rpx;
transform: translateY(50%); transform: translateY(50%);
} }
.cardRight {
position: absolute;
bottom: 44rpx;
right: 20rpx;
transform: translateY(50%);
}
</style> </style>
+10
View File
@@ -8,6 +8,9 @@
</view> </view>
</view> </view>
<view class="title size36 flex1 center" :style="[{ color: textColor }]">{{ props.title }}</view> <view class="title size36 flex1 center" :style="[{ color: textColor }]">{{ props.title }}</view>
<view class="cardRight" :style="{ color: textColor }">
<slot name="right" />
</view>
</view> </view>
</view> </view>
</template> </template>
@@ -111,4 +114,11 @@
left: 20rpx; left: 20rpx;
transform: translateY(50%); transform: translateY(50%);
} }
.cardRight {
position: absolute;
bottom: 44rpx;
right: 20rpx;
transform: translateY(50%);
}
</style> </style>
@@ -8,6 +8,9 @@
</view> </view>
</view> </view>
<view class="title size36 flex1 center" :style="[{ color: textColor }]">{{ props.title }}</view> <view class="title size36 flex1 center" :style="[{ color: textColor }]">{{ props.title }}</view>
<view class="cardRight" :style="{ color: textColor }">
<slot name="right" />
</view>
</view> </view>
</view> </view>
</template> </template>
@@ -123,4 +126,11 @@
left: 20rpx; left: 20rpx;
transform: translateY(50%); transform: translateY(50%);
} }
.cardRight {
position: absolute;
bottom: 44rpx;
right: 20rpx;
transform: translateY(50%);
}
</style> </style>
+94 -21
View File
@@ -1,5 +1,19 @@
<template> <template>
<s-pages tabbar="/pages/cart/cart" title="购物车" :showLeftButton="false" color="#ffffff"> <s-pages
:pink_bg="false"
tabbar="/pages/cart/cart"
title="购物车"
:showLeftButton="false"
color="#EEF1FE"
>
<template #navRight>
<view v-if="state.list.length" class="cart-nav-right">
<view v-if="state.editMode" class="cart-nav-right__btn" @tap="onChangeEditMode(false)">
取消
</view>
<view v-else class="cart-nav-right__btn f500" @tap="onChangeEditMode(true)">管理</view>
</view>
</template>
<s-empty <s-empty
v-if="state.list.length === 0" v-if="state.list.length === 0"
icon="/static/cart-empty.png" icon="/static/cart-empty.png"
@@ -8,13 +22,6 @@
<!-- 头部 --> <!-- 头部 -->
<view v-if="state.list.length" class="cart-box ss-flex ss-flex-col ss-row-between"> <view v-if="state.list.length" class="cart-box ss-flex ss-flex-col ss-row-between">
<view class="cart-header ss-flex ss-col-center ss-row-between ss-p-x-30">
<view></view>
<view class="header-right">
<view v-if="state.editMode" class="" @tap="onChangeEditMode(false)"> 取消 </view>
<view v-else class="f500" @tap="onChangeEditMode(true)"> 管理 </view>
</view>
</view>
<!-- 内容 --> <!-- 内容 -->
<view class="cart-content ss-flex-1 ss-p-x-30 ss-m-b-40 m-b-100"> <view class="cart-content ss-flex-1 ss-p-x-30 ss-m-b-40 m-b-100">
<view <view
@@ -73,8 +80,8 @@
:min="0" :min="0"
:step="1" :step="1"
@change="onNumberChange($event, item)" @change="onNumberChange($event, item)"
background="var(--color18)" background="#ffffff"
color="var(--color34)" color="#333333"
/> />
</template> </template>
</s-goods-item> </s-goods-item>
@@ -82,7 +89,14 @@
</view> </view>
</view> </view>
<!-- 底部 --> <!-- 底部 -->
<su-fixed v-if="state.list.length > 0" :isInset="false" :val="valNum" bottom placeholder> <su-fixed
v-if="state.list.length > 0"
:isInset="false"
:val="valNum"
:zIndex="70"
bottom
placeholder
>
<view class="cart-footer ss-flex ss-col-center ss-row-between ss-p-x-30 border-bottom"> <view class="cart-footer ss-flex ss-col-center ss-row-between ss-p-x-30 border-bottom">
<view class="ss-flex ss-col-center flex1"> <view class="ss-flex ss-col-center flex1">
<label class="check-box ss-flex ss-col-center ss-p-r-30 flex1" @tap="onSelectAll"> <label class="check-box ss-flex ss-col-center ss-p-r-30 flex1" @tap="onSelectAll">
@@ -117,7 +131,11 @@
> >
删除 删除
</button> </button>
<button v-else class="ss-reset-button pay-btn ui-Shadow-Main" @tap="onConfirm"> <button
v-else
class="ss-reset-button pay-btn ui-Shadow-Main checkout-btn"
@tap="onConfirm"
>
去结算 去结算
{{ state.selectedIds?.length ? `(${state.selectedIds.length})` : '' }} {{ state.selectedIds?.length ? `(${state.selectedIds.length})` : '' }}
</button> </button>
@@ -284,14 +302,7 @@
url: '/pages/goods/info?id=' + id, url: '/pages/goods/info?id=' + id,
}); });
}; };
let valNum = ref(0); const valNum = ref(uni.upx2px(100));
// #ifdef APP-PLUS
valNum.value = 0;
// #endif
// #ifndef APP-PLUS
valNum.value = 50;
// #endif
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@@ -299,6 +310,19 @@
height: 72rpx; height: 72rpx;
} }
.cart-nav-right {
display: flex;
align-items: center;
justify-content: flex-end;
height: 100%;
}
.cart-nav-right__btn {
font-size: 28rpx;
line-height: 1;
padding: 10rpx 8rpx;
}
.cart-box { .cart-box {
width: 100%; width: 100%;
box-sizing: border-box; box-sizing: border-box;
@@ -345,7 +369,56 @@
} }
} }
.ss-reset-button { .ss-reset-button {
background: linear-gradient(270deg, #f7772e 0%, #ee0a24 99%);
color: #ffffff; color: #ffffff;
} }
.ss-reset-button,
.ss-reset-button.checkout-btn {
background: linear-gradient(
to bottom right,
var(--accent-grad-start) 0%,
var(--accent-grad-end) 100%
);
}
:deep(.uni-numbox) {
height: 48rpx;
border-radius: 999rpx;
border: 2rpx solid rgba(0, 0, 0, 0.12);
background: #ffffff;
padding: 0;
box-sizing: border-box;
}
:deep(.uni-numbox__value) {
height: 44rpx;
line-height: 44rpx;
margin: 0;
width: 60rpx;
background: transparent !important;
font-size: 26rpx;
color: #333333 !important;
}
:deep(.uni-numbox .move-round),
:deep(.uni-numbox .add-round) {
width: 44rpx;
height: 44rpx;
line-height: 44rpx;
background: transparent !important;
font-size: 30rpx;
color: #333333 !important;
border-radius: 50%;
box-sizing: border-box;
}
:deep(.uni-numbox .move-round) {
border-right: 2rpx solid rgba(0, 0, 0, 0.12);
border-radius: 999rpx 0 0 999rpx;
}
:deep(.uni-numbox .add-round) {
border-left: 2rpx solid rgba(0, 0, 0, 0.12);
border-radius: 0 999rpx 999rpx 0;
}
</style> </style>
+3
View File
@@ -391,6 +391,7 @@
}; };
const fetchTrend = async () => { const fetchTrend = async () => {
return
const params = buildTrendParams(); const params = buildTrendParams();
const res: any = await api.goldSeedTrend(params); const res: any = await api.goldSeedTrend(params);
if (res?.code !== 0) { if (res?.code !== 0) {
@@ -512,6 +513,7 @@
return has0 || has1; return has0 || has1;
}); });
const fetchPoolGrowth = async () => { const fetchPoolGrowth = async () => {
return
const res: any = await api.goldSeedPoolGrowth(); const res: any = await api.goldSeedPoolGrowth();
if (res?.code !== 0) { if (res?.code !== 0) {
poolGrowthData.value = null; poolGrowthData.value = null;
@@ -592,6 +594,7 @@
return n >= 0 ? '#e54035' : '#777777'; return n >= 0 ? '#e54035' : '#777777';
}); });
const fetchFluctuation = async () => { const fetchFluctuation = async () => {
return
const res: any = await api.goldSeedFluctuation(); const res: any = await api.goldSeedFluctuation();
if (res?.code !== 0) { if (res?.code !== 0) {
fluctuationData.value = null; fluctuationData.value = null;
+70 -30
View File
@@ -1,7 +1,7 @@
<template> <template>
<view class="pages theme-ai"> <view class="pages theme-ai">
<view class="bc"> <view class="bc">
<image src="/static/home/bc.png" mode="scaleToFill" /> <!-- <image src="/static/home/bc.png" mode="scaleToFill" /> -->
</view> </view>
<view class="con" :style="{ paddingTop: paddingTop + 'px' }"> <view class="con" :style="{ paddingTop: paddingTop + 'px' }">
<view class="con_top flex-center ju-flex-start"> <view class="con_top flex-center ju-flex-start">
@@ -13,7 +13,7 @@
</view> </view>
<view class="con_info flex-between w100"> <view class="con_info flex-between w100">
<view class="con_left"> <view class="con_left">
<view class="con_name ju-flex-start"> <view class="con_name c_fff ju-flex-start">
{{ dataInfo?.nickname || '昵称' }} {{ dataInfo?.nickname || '昵称' }}
<image <image
:src="`${$url}home/${dataInfo.type}.svg`" :src="`${$url}home/${dataInfo.type}.svg`"
@@ -35,26 +35,36 @@
</view> </view>
</view> </view>
</view> </view>
<view class="card_money flex-center ju-between p-x-32" @click="go('/pages/home/wallet')"> <view class="b_fff" style="border-radius: 20rpx;">
<!-- <view <view class="card_money flex-center ju-between p-x-32" @click="go('/pages/home/wallet')">
<!-- <view
class="card_money flex-center ju-between p-x-32" class="card_money flex-center ju-between p-x-32"
@click="go('/pages/home/pointsDetail?type=5')" @click="go('/pages/home/pointsDetail?type=5')"
> --> > -->
<view> <view>
<view class="flex-center ju-flex-start m-b-8"> <view class="flex-center ju-flex-start m-b-8">
<view class="line34 size28" style="margin-right: 18rpx">钱包</view> <view class="line34 size28 m-r-18">钱包</view>
<view class="moneyNum line36 size36">¥ {{ $fen2yuan(dataInfo.wallet || 0) }}</view> <view class="moneyNum line36 size36">¥ {{ $fen2yuan(dataInfo.wallet || 0) }}</view>
</view>
<!-- <view class="c_fff line34">邀请好友下单得奖励</view> -->
</view> </view>
<!-- <view class="c_fff line34">邀请好友下单得奖励</view> --> <!-- <view class="moneyBtn" @click="go('/pages/home/pointsDetail?type=5')">立即提现</view> -->
</view> </view>
<!-- <view class="moneyBtn" @click="go('/pages/home/pointsDetail?type=5')">立即提现</view> --> <view class="card3 flex-center ju-evenly color_5">
</view> <view
<view class="card3 flex-center ju-evenly color_5"> v-for="(v, i) in moneyArr"
<view v-for="(v, i) in moneyArr" :key="i" class="center" @click="go(v.url)"> :key="i"
<view class="card3_num m-b-8" class="center card3_item"
>{{ dataInfo[v.value] }}<text>{{ v.unit }}</text></view :class="{ 'card3_item--split': i !== 0 }"
@click="go(v.url)"
> >
<view>{{ v.name || 0 }}</view> <view
class="card3_num m-b-8"
:style="{ color: v.color || '' }"
>{{ dataInfo[v.value] }}<text>{{ v.unit }}</text></view
>
<view class="size32">{{ v.name || 0 }}</view>
</view>
</view> </view>
</view> </view>
<view class="card card4 bg24"> <view class="card card4 bg24">
@@ -101,7 +111,6 @@
</view> </view>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
<cardTabber path="/pages/index/user" placeholder /> <cardTabber path="/pages/index/user" placeholder />
@@ -143,6 +152,7 @@
name: '绿色积分', name: '绿色积分',
value: 'point', value: 'point',
url: '/pages/home/pointsDetail?type=1', url: '/pages/home/pointsDetail?type=1',
color: '#0ED72C',
}, },
// { // {
// id: 2, // id: 2,
@@ -163,6 +173,7 @@
name: '消费金', name: '消费金',
value: 'consumptionGold', value: 'consumptionGold',
url: '/pages/home/pointsDetail?type=4', url: '/pages/home/pointsDetail?type=4',
color: '#FE5200',
}, },
]); ]);
let orderList = ref([ let orderList = ref([
@@ -313,7 +324,9 @@
top: 0; top: 0;
left: 0; left: 0;
width: 100%; width: 100%;
height: 484rpx; height: 380rpx;
background: #00f;
border-radius: 0 0 30rpx 30rpx;
image { image {
width: 100%; width: 100%;
@@ -325,7 +338,7 @@
position: absolute; position: absolute;
top: 0; top: 0;
left: 0; left: 0;
padding: 0rpx 30rpx; padding: 0rpx 40rpx;
box-sizing: border-box; box-sizing: border-box;
padding-bottom: 0; padding-bottom: 0;
width: 100%; width: 100%;
@@ -334,7 +347,7 @@
.con_top { .con_top {
margin-bottom: 36rpx; margin-bottom: 36rpx;
align-items: flex-end; align-items: center;
.head { .head {
width: 130rpx; width: 130rpx;
@@ -351,22 +364,32 @@
.con_info { .con_info {
margin-left: 24rpx; margin-left: 24rpx;
display: flex; display: flex;
flex-direction: column; flex: 1;
align-items: flex-start; flex-direction: row;
align-items: center;
justify-content: space-between;
// .con_left { // .con_left {
// display: flex; // display: flex;
// justify-content: center; // justify-content: center;
// align-items: flex-start; // align-items: flex-start;
// } // }
.con_left {
display: flex;
flex-direction: column;
justify-content: center;
align-items: flex-start;
min-width: 0;
}
.con_id { .con_id {
background: linear-gradient(90deg, #50504e 0%, #292b28 100%); // background: linear-gradient(90deg, #50504e 0%, #292b28 100%);
border-radius: 40rpx; border-radius: 40rpx;
font-size: 20rpx; font-size: 26rpx;
color: #ffffff; color: #ffffff;
// line-height: 36rpx; // line-height: 36rpx;
// text-align: center; // text-align: center;
padding: 7rpx 16rpx; // padding: 7rpx 16rpx;
display: flex; display: flex;
align-items: center; align-items: center;
display: inline-flex; display: inline-flex;
@@ -394,11 +417,11 @@
.auth-btn-type1 { .auth-btn-type1 {
background: #fff; background: #fff;
color: #fb4d32; color: var(--brand-blue);
} }
.auth-btn-type2 { .auth-btn-type2 {
background: linear-gradient(130deg, #fa8735 0%, #fe3b48 100%); background: linear-gradient(130deg, var(--auth-grad-start) 0%, var(--auth-grad-end) 100%);
color: #fff; color: #fff;
} }
@@ -425,11 +448,12 @@
} }
.card_money { .card_money {
height: 120rpx; height: 100rpx;
box-sizing: border-box; box-sizing: border-box;
color: #ffe3b1; color: #ffffff;
background: url('/static/home/img1.png'); background: linear-gradient(150deg, var(--wallet-grad-start) 0%, var(--wallet-grad-end) 100%);
font-size: 24rpx; font-size: 24rpx;
border-radius: 20rpx;
.moneyNum { .moneyNum {
font-size: 30rpx; font-size: 30rpx;
@@ -463,6 +487,22 @@
} }
} }
.card3_item {
position: relative;
flex: 1;
}
.card3_item--split::before {
content: '';
position: absolute;
left: 0;
top: 50%;
width: 2rpx;
height: 90rpx;
background: rgba(0, 0, 0, 0.22);
transform: translateY(-50%);
}
.card4 { .card4 {
.card4_icon { .card4_icon {
width: 68rpx; width: 68rpx;
+32 -19
View File
@@ -4,14 +4,14 @@
<slot name="top"></slot> <slot name="top"></slot>
</view> </view>
<view <view
class="ss-order-card-warp ss-flex ss-col-stretch ss-row-between" class="ss-order-card-warp b_fff ss-flex ss-col-stretch ss-row-between"
:style="[{ borderRadius: radius + 'rpx', marginBottom: marginBottom + 'rpx' }]" :style="[{ borderRadius: radius + 'rpx', marginBottom: marginBottom + 'rpx' }]"
> >
<view class="img-box ss-m-r-24"> <view class="img-box ss-m-r-24">
<image class="order-img" :src="sheep.$url.cdn(img)" mode="aspectFill"></image> <image class="order-img" :src="sheep.$url.cdn(img)" mode="aspectFill"></image>
</view> </view>
<view <view
class="box-right ss-flex-col ss-row-between" class="box-right p-y-20 ss-flex-col ss-row-between"
:style="[{ width: titleWidth ? titleWidth + 'rpx' : '' }]" :style="[{ width: titleWidth ? titleWidth + 'rpx' : '' }]"
> >
<view> <view>
@@ -22,9 +22,9 @@
<view class="groupon-box"> <view class="groupon-box">
<slot name="groupon"></slot> <slot name="groupon"></slot>
</view> </view>
<view class="ss-flex"> <view class="price-row ss-flex ss-col-center ss-row-between">
<view class="ss-flex ss-col-center"> <view class="price-left ss-flex ss-col-center">
<view class="" :style="[{ color: '#EE0A24' }]" v-if="price && Number(price) > 0"> <view class="" :style="[{ color: 'var(--money)' }]" v-if="price && Number(price) > 0">
<span class="f500" style="font-size: 24rpx">¥</span> <span class="f500" style="font-size: 24rpx">¥</span>
<span class="priceNum">{{ fen2yuan(price) }}</span> <span class="priceNum">{{ fen2yuan(price) }}</span>
</view> </view>
@@ -39,9 +39,9 @@
<view v-if="num" class="total-text ss-flex ss-col-center">x {{ num }}</view> <view v-if="num" class="total-text ss-flex ss-col-center">x {{ num }}</view>
<slot name="priceSuffix"></slot> <slot name="priceSuffix"></slot>
</view> </view>
</view> <view class="tool-box">
<view class="tool-box"> <slot name="tool"></slot>
<slot name="tool"></slot> </view>
</view> </view>
<view> <view>
<slot name="rightBottom"></slot> <slot name="rightBottom"></slot>
@@ -127,17 +127,18 @@
margin: 0 4rpx; margin: 0 4rpx;
} }
.ss-order-card-warp { .ss-order-card-warp {
padding: 0 16rpx; padding: 0 16rpx 0 0;
border-radius: 30rpx;
.img-box { .img-box {
width: 180rpx; width: 220rpx;
height: 180rpx; height: 220rpx;
border-radius: 10rpx; border-radius: 10rpx;
overflow: hidden; overflow: hidden;
display: block;
.order-img { .order-img {
width: 180rpx; width: 100%;
height: 180rpx; height: 100%;
} }
} }
@@ -146,12 +147,24 @@
// width: 500rpx; // width: 500rpx;
// height: 164rpx; // height: 164rpx;
position: relative; position: relative;
}
.tool-box { .price-row {
position: absolute; gap: 12rpx;
right: 0rpx; }
bottom: -10rpx;
} .price-left {
flex: 1;
min-width: 0;
flex-wrap: wrap;
gap: 6rpx;
}
.tool-box {
flex-shrink: 0;
display: flex;
align-items: center;
justify-content: flex-end;
} }
.title-text { .title-text {
+15 -3
View File
@@ -11,7 +11,11 @@
:color="navBarColors.color" :color="navBarColors.color"
@clickLeft="onClickLeft" @clickLeft="onClickLeft"
:index="props.index" :index="props.index"
/> >
<template #right>
<slot name="navRight" />
</template>
</cardNavbar>
<innerNavbar <innerNavbar
v-if="navbar === 'inner'" v-if="navbar === 'inner'"
:title="title" :title="title"
@@ -22,7 +26,11 @@
:scrollColor="navBarColors.scrollColor" :scrollColor="navBarColors.scrollColor"
@clickLeft="onClickLeft" @clickLeft="onClickLeft"
:index="props.index" :index="props.index"
/> >
<template #right>
<slot name="navRight" />
</template>
</innerNavbar>
<transparentNavbar <transparentNavbar
v-if="navbar === 'transparent'" v-if="navbar === 'transparent'"
:title="title" :title="title"
@@ -33,7 +41,11 @@
:scrollColor="navBarColors.scrollColor" :scrollColor="navBarColors.scrollColor"
@clickLeft="onClickLeft" @clickLeft="onClickLeft"
:index="props.index" :index="props.index"
/> >
<template #right>
<slot name="navRight" />
</template>
</transparentNavbar>
<!-- 页面内容插槽 --> <!-- 页面内容插槽 -->
<!-- :style="{ paddingTop: paddingTop + 'px' }" --> <!-- :style="{ paddingTop: paddingTop + 'px' }" -->
+3
View File
@@ -9,6 +9,9 @@
:tabbar="props.tabbar" :tabbar="props.tabbar"
@onClickLeft="onClickLeft" @onClickLeft="onClickLeft"
> >
<template #navRight>
<slot name="navRight" />
</template>
<!-- <Agreement /> --> <!-- <Agreement /> -->
<view class="theme-ai pages"> <view class="theme-ai pages">
<view class="card1 w100"> <view class="card1 w100">
+9 -2
View File
@@ -19,7 +19,7 @@
--color10: #0e517c; --color10: #0e517c;
--color11: #1675b2; --color11: #1675b2;
--color12: #777777; --color12: #777777;
--color13: #ee0a24; --color13: #ff5b0d;
--color14: #26243e; --color14: #26243e;
--color15: #ff393a; --color15: #ff393a;
--color16: #ffffff; --color16: #ffffff;
@@ -42,7 +42,14 @@
--color34: #333333; --color34: #333333;
--color35: #ff2e2e; --color35: #ff2e2e;
--color36: #969696; --color36: #969696;
--money: #ee0a24; --money: #ff5b0d;
--accent-grad-start: #fd9d72;
--accent-grad-end: #fe5108;
--brand-blue: #2456ec;
--auth-grad-start: #fa8735;
--auth-grad-end: #fe3b48;
--wallet-grad-start: #fd9d72;
--wallet-grad-end: #ff4e00;
--fff: #ffffff; --fff: #ffffff;
} }
+4 -2
View File
@@ -61,7 +61,7 @@ page {
color: #ffffff; color: #ffffff;
} }
.c_EE0A24 { .c_EE0A24 {
color: #ee0a24; color: #ff5b0d;
} }
.c_primary { .c_primary {
color: #fa7e31; color: #fa7e31;
@@ -87,7 +87,9 @@ page {
.c_money { .c_money {
color: var(--money); color: var(--money);
} }
.b_fff {
background-color: #fff;
}
.submit-btn { .submit-btn {
width: 100%; width: 100%;
height: 100rpx; height: 100rpx;
+13 -3
View File
@@ -9,7 +9,7 @@
left: sticky ? 'auto' : '0px', left: sticky ? 'auto' : '0px',
top: state.fixed && !bottom ? (noNav ? val : val + sys_navBar) + 'px' : 'auto', top: state.fixed && !bottom ? (noNav ? val : val + sys_navBar) + 'px' : 'auto',
bottom: insetHeight, bottom: insetHeight,
zIndex: index + sheep.$zIndex.navbar, zIndex: resolvedZIndex,
}, },
!alway ? { opacity: state.opacityVal } : '', !alway ? { opacity: state.opacityVal } : '',
]" ]"
@@ -17,7 +17,7 @@
<view <view
class="ui-fixed-content" class="ui-fixed-content"
@tap="toTop" @tap="toTop"
:style="[{ zIndex: index + sheep.$zIndex.navbar }]" :style="[{ zIndex: resolvedZIndex }]"
> >
<slot></slot> <slot></slot>
<view <view
@@ -31,7 +31,7 @@
class="ui-fixed-bg" class="ui-fixed-bg"
:class="[ui, bg]" :class="[ui, bg]"
:style="[ :style="[
{ zIndex: index + sheep.$zIndex.navbar - 1 }, { zIndex: resolvedZIndex - 1 },
bgStyles, bgStyles,
opacity ? { opacity: state.opacityVal } : '', opacity ? { opacity: state.opacityVal } : '',
]" ]"
@@ -134,9 +134,19 @@
type: Boolean, type: Boolean,
default: true, default: true,
}, },
zIndex: {
type: [Number, String],
default: null,
},
}); });
state.fixed = !unref(props.sticky); state.fixed = !unref(props.sticky);
const resolvedZIndex = computed(() => {
if (props.zIndex !== null && props.zIndex !== undefined && props.zIndex !== '') {
return Number(props.zIndex);
}
return unref(props.index) + sheep.$zIndex.navbar;
});
onPageScroll((e) => { onPageScroll((e) => {
let top = e.scrollTop; let top = e.scrollTop;
state.scrollTop = top; state.scrollTop = top;