Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
飞
飞鹤小程序
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
FH
飞鹤小程序
Commits
1078b9a8
Commit
1078b9a8
authored
Nov 18, 2025
by
王炽
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
积分页tab默认处理
parent
397a52dc
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
4 deletions
+26
-4
Integral.less
views/Integral.less
+1
-0
Integral.vue
views/Integral.vue
+25
-4
No files found.
views/Integral.less
View file @
1078b9a8
...
@@ -815,6 +815,7 @@
...
@@ -815,6 +815,7 @@
.custom-tabs {
.custom-tabs {
display: flex;
display: flex;
justify-content: space-between;
justify-content: space-between;
white-space: nowrap;
// 当只有两个标签时,居中显示并设置间距
// 当只有两个标签时,居中显示并设置间距
&.tabs-two {
&.tabs-two {
...
...
views/Integral.vue
View file @
1078b9a8
...
@@ -556,14 +556,18 @@
...
@@ -556,14 +556,18 @@
<!-- <view class="
goods
-
container
"> -->
<!-- <view class="
goods
-
container
"> -->
<!-- 页签栏 -->
<!-- 页签栏 -->
<view
<scroll-view
v-if="
goodsDataArr
?.
length
>
1
"
class="
custom
-
tabs
"
class="
custom
-
tabs
"
:class="
{
:class="
{
'tabs-two'
:
goodsDataArr
?.
length
===
2
,
'tabs-two'
:
goodsDataArr
?.
length
===
2
,
'tabs-three'
:
goodsDataArr
?.
length
===
3
,
'tabs-three'
:
goodsDataArr
?.
length
===
3
,
'tabs-many'
:
goodsDataArr
?.
length
>=
4
,
'tabs-many'
:
goodsDataArr
?.
length
>=
4
,
}
"
}
"
v-if="
goodsDataArr
?.
length
>
1
"
scroll-x="
true
"
:scroll-left="
tabsScrollLeft
"
show-scrollbar="
false
"
:enable-flex="
true
"
>
>
<!-- <view v-for="
(
tab
,
index
)
in
tabInfo
.
tabTexts
" :key="
index
" class="
tab
-
item
" :class="
{
-->
<!-- <view v-for="
(
tab
,
index
)
in
tabInfo
.
tabTexts
" :key="
index
" class="
tab
-
item
" :class="
{
-->
<
view
<
view
...
@@ -581,7 +585,7 @@
...
@@ -581,7 +585,7 @@
<!--
<
text
class
=
"tab-line2"
>
{{
tab
?.
line2
}}
<
/text> --
>
<!--
<
text
class
=
"tab-line2"
>
{{
tab
?.
line2
}}
<
/text> --
>
<
view
class
=
"select-line"
v
-
if
=
"activeIndex === index"
><
/view
>
<
view
class
=
"select-line"
v
-
if
=
"activeIndex === index"
><
/view
>
<
/view
>
<
/view
>
<
/view
>
<
/
scroll-
view
>
<
view
<
view
class
=
"goods-content"
class
=
"goods-content"
...
@@ -769,7 +773,7 @@
...
@@ -769,7 +773,7 @@
<
script
setup
>
<
script
setup
>
// 轮播图数据可在此定义(当前使用静态路径)
// 轮播图数据可在此定义(当前使用静态路径)
// "rgba(255,255,255,0.5)"
// "rgba(255,255,255,0.5)"
import
{
ref
,
onMounted
,
onBeforeMount
,
onBeforeUnmount
,
computed
,
watch
}
from
'vue'
;
import
{
ref
,
onMounted
,
onBeforeMount
,
onBeforeUnmount
,
computed
,
watch
,
nextTick
}
from
'vue'
;
import
{
onShareAppMessage
}
from
'@dcloudio/uni-app'
;
import
{
onShareAppMessage
}
from
'@dcloudio/uni-app'
;
import
{
jump
,
JumpType
}
from
'@/utils/index.js'
;
import
{
jump
,
JumpType
}
from
'@/utils/index.js'
;
import
{
useUserStore
}
from
'@/stores/user'
;
import
{
useUserStore
}
from
'@/stores/user'
;
...
@@ -1608,6 +1612,7 @@ const integralData = ref({
...
@@ -1608,6 +1612,7 @@ const integralData = ref({
}
);
}
);
const
goodsDataArr
=
ref
([]);
//商品数据,包括tab内容
const
goodsDataArr
=
ref
([]);
//商品数据,包括tab内容
const
tabsScrollLeft
=
ref
(
0
);
// tabs滚动位置
// const integralData = ref(
{
}
);
// const integralData = ref(
{
}
);
const
showShengriliTipPanel
=
ref
(
false
);
const
showShengriliTipPanel
=
ref
(
false
);
const
quanyitiaozhuanInfo
=
ref
({
}
);
const
quanyitiaozhuanInfo
=
ref
({
}
);
...
@@ -2782,6 +2787,22 @@ const tabItemClick = (index, item) => {
...
@@ -2782,6 +2787,22 @@ const tabItemClick = (index, item) => {
//
}
);
//
}
);
}
;
}
;
// 监听 goodsDataArr 变化,当长度 >= 4 时设置初始滚动位置
watch(
() => goodsDataArr.value?.length,
(newLength) => {
if (newLength >= 4) {
nextTick(() => {
// 设置初始滚动位置为 50rpx
tabsScrollLeft.value = 50;
}
);
}
else {
tabsScrollLeft.value = 0;
}
}
,
{ immediate: true
}
);
// 处理查看更多点击
// 处理查看更多点击
const handleMoreClick = () => {
const handleMoreClick = () => {
const url = clickMore.value.url;
const url = clickMore.value.url;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment