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
66c06886
Commit
66c06886
authored
Oct 25, 2025
by
spc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fxied
parent
5758ab6b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
61 additions
and
22 deletions
+61
-22
goodDetail.vue
v3/goodDetail/goodDetail.vue
+61
-22
No files found.
v3/goodDetail/goodDetail.vue
View file @
66c06886
...
...
@@ -22,13 +22,17 @@
<text
class=
"points-value"
>
{{
goodsData
.
points
}}
</text>
<text
class=
"points-unit"
>
{{
goodsData
.
creditsTypeName
||
'积分'
}}
</text>
</view>
<text
class=
"exchange-count"
>
已兑换
{{
formatCount
(
goodsData
.
exchang
eCount
)
}}
件
</text>
<text
class=
"exchange-count"
>
已兑换
{{
formatCount
(
goodsData
.
sal
eCount
)
}}
件
</text>
</view>
<!-- 会员标签 -->
<view
class=
"member-tags"
v-if=
"goodsData.memberLevel || goodsData.limit"
>
<text
class=
"member-level"
v-if=
"goodsData.memberLevel"
>
{{
goodsData
.
memberLevel
}}
</text>
<text
class=
"purchase-limit"
v-if=
"goodsData.limit"
>
每人限
{{
goodsData
.
limit
}}
件
</text>
<view
class=
"member-tags"
v-if=
"goodsData.vipLimit && goodsData.vipLimit.length > 0"
>
<text
class=
"member-level"
v-for=
"(level, index) in goodsData.vipLimit"
:key=
"index"
>
{{
level
}}
</text>
</view>
<!-- 购买限制 -->
<view
class=
"purchase-limit-section"
v-if=
"goodsData.goodsLimit"
>
<text
class=
"purchase-limit"
>
每人限
{{
goodsData
.
goodsLimit
}}
件
</text>
</view>
<!-- 优惠券名称 -->
...
...
@@ -69,7 +73,7 @@
<view
class=
"product-details"
>
<text
class=
"product-points"
>
{{
goodsData
.
points
}}{{
goodsData
.
creditsTypeName
||
'积分'
}}
</text>
<text
class=
"product-stock"
>
库存
{{
formatCount
(
goodsData
.
exchang
eCount
)
}}
件
</text>
<text
class=
"product-stock"
>
库存
{{
formatCount
(
goodsData
.
sal
eCount
)
}}
件
</text>
</view>
</view>
...
...
@@ -86,12 +90,12 @@
<!-- 数量选择 -->
<view
class=
"quantity-section"
v-if=
"!isSeckill"
>
<text
class=
"quantity-label"
>
选择数量
<text
class=
"limit-text"
>
(限购
{{
goodsData
.
l
imit
}}
件)
</text></text>
<text
class=
"quantity-label"
>
选择数量
<text
class=
"limit-text"
v-if=
"goodsData.goodsLimit"
>
(限购
{{
goodsData
.
goodsL
imit
}}
件)
</text></text>
<view
class=
"quantity-selector"
>
<view
class=
"quantity-btn "
@
click=
"decreaseQuantity"
:disabled=
"quantity
<
=
1
"
>
-
</view>
<text
class=
"quantity-value"
>
{{
quantity
}}
</text>
<view
class=
"quantity-btn "
@
click=
"increaseQuantity"
:disabled=
"
quantity >= parseInt(goodsData.l
imit)"
>
+
</view>
:disabled=
"
goodsData.goodsLimit && quantity >= parseInt(goodsData.goodsL
imit)"
>
+
</view>
</view>
</view>
<!-- 秒杀商品数量显示(固定为1) -->
...
...
@@ -138,8 +142,11 @@ export default {
id
:
''
,
points
:
0
,
exchangeCount
:
0
,
saleCount
:
0
,
// 已兑换数量
memberLevel
:
''
,
vipLimit
:
[],
// 会员限制数组
limit
:
''
,
goodsLimit
:
false
,
// 商品购买限制
name
:
''
,
couponName
:
''
,
expireDate
:
''
,
...
...
@@ -222,17 +229,18 @@ export default {
}
}
// 3. 用户等级不足
if
(
this
.
goodsData
.
memberLevel
&&
this
.
userStore
&&
this
.
userStore
.
userInfo
)
{
// 3. 用户等级不足
(检查vipLimit数组)
if
(
this
.
goodsData
.
vipLimit
&&
this
.
goodsData
.
vipLimit
.
length
>
0
&&
this
.
userStore
&&
this
.
userStore
.
userInfo
)
{
const
userLevel
=
this
.
userStore
.
userInfo
.
grade
||
1
;
const
requiredLevel
=
this
.
getRequiredLevel
(
this
.
goodsData
.
memberLevel
);
if
(
userLevel
<
requiredLevel
)
{
const
userLevelName
=
this
.
getUserLevelName
(
userLevel
);
// 检查用户等级是否在vipLimit中
if
(
!
this
.
goodsData
.
vipLimit
.
includes
(
userLevelName
))
{
return
false
;
}
}
// 4. 用户达到兑换上限
if
(
this
.
goodsData
.
l
imit
&&
this
.
userBuyLimit
)
{
// 4. 用户达到兑换上限
(使用goodsLimit)
if
(
this
.
goodsData
.
goodsL
imit
&&
this
.
userBuyLimit
)
{
return
false
;
}
...
...
@@ -264,17 +272,18 @@ export default {
}
}
// 3. 用户等级不足
if
(
this
.
goodsData
.
memberLevel
&&
this
.
userStore
&&
this
.
userStore
.
userInfo
)
{
// 3. 用户等级不足
(检查vipLimit数组)
if
(
this
.
goodsData
.
vipLimit
&&
this
.
goodsData
.
vipLimit
.
length
>
0
&&
this
.
userStore
&&
this
.
userStore
.
userInfo
)
{
const
userLevel
=
this
.
userStore
.
userInfo
.
grade
||
1
;
const
requiredLevel
=
this
.
getRequiredLevel
(
this
.
goodsData
.
memberLevel
);
if
(
userLevel
<
requiredLevel
)
{
const
userLevelName
=
this
.
getUserLevelName
(
userLevel
);
// 检查用户等级是否在vipLimit中
if
(
!
this
.
goodsData
.
vipLimit
.
includes
(
userLevelName
))
{
return
'insufficientLevel'
;
}
}
// 4. 用户达到兑换上限
if
(
this
.
goodsData
.
l
imit
&&
this
.
userBuyLimit
)
{
// 4. 用户达到兑换上限
(使用goodsLimit)
if
(
this
.
goodsData
.
goodsL
imit
&&
this
.
userBuyLimit
)
{
return
'exchangeLimit'
;
}
...
...
@@ -426,8 +435,11 @@ export default {
id
:
data
.
id
||
''
,
points
:
parseInt
(
data
.
credits
)
||
0
,
exchangeCount
:
data
.
stock
||
0
,
saleCount
:
data
.
saleCount
||
0
,
// 已兑换数量
memberLevel
:
this
.
getMemberLevel
(
data
.
state
),
vipLimit
:
data
.
vipLimit
||
[],
// 会员限制数组
limit
:
data
.
groupCount
?
data
.
groupCount
.
toString
()
:
'1'
,
goodsLimit
:
data
.
goodsLimit
||
false
,
// 商品购买限制
name
:
data
.
goodsName
||
data
.
name
||
''
,
couponName
:
data
.
goodsName
||
data
.
name
||
''
,
expireDate
:
data
.
expireTime
&&
data
.
expireTime
.
length
>
0
?
data
.
expireTime
[
0
]
:
''
,
...
...
@@ -498,8 +510,11 @@ export default {
id
:
data
.
id
||
''
,
points
:
parseInt
(
data
.
credits
)
||
0
,
exchangeCount
:
data
.
stock
||
0
,
saleCount
:
data
.
saleCount
||
0
,
// 已兑换数量
memberLevel
:
this
.
getMemberLevel
(
data
.
state
),
vipLimit
:
data
.
vipLimit
||
[],
// 会员限制数组
limit
:
data
.
groupCount
?
data
.
groupCount
.
toString
()
:
'1'
,
goodsLimit
:
data
.
goodsLimit
||
false
,
// 商品购买限制
name
:
data
.
goodsName
||
data
.
name
||
''
,
couponName
:
data
.
goodsName
||
data
.
name
||
''
,
expireDate
:
data
.
expireTime
&&
data
.
expireTime
.
length
>
0
?
data
.
expireTime
[
0
]
:
''
,
...
...
@@ -580,6 +595,17 @@ export default {
return
levelMap
[
memberLevelName
]
||
1
;
},
// 根据等级数字获取等级名称
getUserLevelName
(
level
)
{
const
levelMap
=
{
1
:
'普通会员'
,
2
:
'黄金会员'
,
3
:
'铂金会员'
,
4
:
'钻石会员'
};
return
levelMap
[
level
]
||
'普通会员'
;
},
// 计算剩余天数
calculateRemainDays
(
expireTime
)
{
if
(
!
expireTime
||
expireTime
.
length
===
0
)
return
0
;
...
...
@@ -796,9 +822,10 @@ export default {
// 增加数量
increaseQuantity
()
{
if
(
this
.
quantity
<
parseInt
(
this
.
goodsData
.
l
imit
))
{
this
.
quantity
++
;
if
(
this
.
goodsData
.
goodsLimit
&&
this
.
quantity
>=
parseInt
(
this
.
goodsData
.
goodsL
imit
))
{
return
;
}
this
.
quantity
++
;
},
// 减少数量
...
...
@@ -1276,7 +1303,19 @@ export default {
margin-bottom
:
20
rpx
;
}
.member-level
,
.member-level
{
font-size
:
24
rpx
;
color
:
#D3A458
;
background-color
:
#FCF2E2
;
padding
:
8
rpx
16
rpx
;
border-radius
:
20
rpx
;
}
/* 购买限制区域 */
.purchase-limit-section
{
margin-bottom
:
20
rpx
;
}
.purchase-limit
{
font-size
:
24
rpx
;
color
:
#D3A458
;
...
...
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