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
13c5c1be
Commit
13c5c1be
authored
Oct 24, 2025
by
spc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed
parent
2ec95e00
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
184 additions
and
49 deletions
+184
-49
goodsDetail.vue
pages/goodsDetail/goodsDetail.vue
+96
-3
addressList.vue
v3/addressList/addressList.vue
+19
-8
goodDetail.vue
v3/goodDetail/goodDetail.vue
+9
-14
orderList.vue
v3/orderList/orderList.vue
+24
-14
payResultPage.vue
v3/payResultPage/payResultPage.vue
+34
-8
My.vue
views/My.vue
+2
-2
No files found.
pages/goodsDetail/goodsDetail.vue
View file @
13c5c1be
...
...
@@ -7,13 +7,20 @@
</view>
<!-- 商品信息区域 -->
<view
class=
"product-info"
v-if=
"currentProduct"
@
tap=
"openSpecModal"
>
<view
class=
"product-info"
v-if=
"currentProduct"
>
<view
class=
"product-name"
>
{{
currentProduct
.
name
}}
</view>
<view
class=
"product-stock"
>
库存
{{
currentProduct
.
stock
||
0
}}
件
</view>
<view
class=
"product-price"
>
{{
currentProduct
.
price
||
'0'
}}
积分
</view>
<view
class=
"exchange-hint"
>
点击选择规格
</view>
</view>
<!-- 兑换按钮 -->
<view
class=
"exchange-section"
v-if=
"currentProduct"
>
<view
class=
"exchange-btn"
@
tap=
"handleExchange"
>
<text
class=
"exchange-btn-text"
>
{{
getExchangeButtonText
()
}}
</text>
</view>
</view>
<!-- 固定底部按钮区域 -->
<view
class=
"fixed-bottom"
>
<view
class=
"button-group"
>
...
...
@@ -78,12 +85,18 @@
<
script
setup
>
import
{
ref
,
onMounted
,
computed
,
getCurrentInstance
}
from
'vue'
import
{
getProductById
,
getProductImagesById
,
getShareImageById
,
getShareTextById
,
shareBtn
,
rightsBtn
}
from
'@/utils/constant.js'
import
{
useUserStore
}
from
'@/stores/user'
import
{
jump
,
JumpType
}
from
'@/utils'
// 响应式数据
const
productId
=
ref
(
''
)
const
currentProduct
=
ref
(
null
)
const
isLoading
=
ref
(
true
)
// 用户状态
const
userStore
=
ref
(
null
)
const
isLoggedIn
=
ref
(
false
)
// 规格选择相关数据
const
showSpecModal
=
ref
(
false
)
const
selectedNetContent
=
ref
(
''
)
...
...
@@ -96,7 +109,10 @@ const productImages = computed(() => {
})
// 页面加载时获取商品ID和产品信息
onMounted
(()
=>
{
onMounted
(
async
()
=>
{
// 初始化用户状态
await
initUserStatus
()
// 获取页面参数
const
pages
=
getCurrentPages
()
const
currentPage
=
pages
[
pages
.
length
-
1
]
...
...
@@ -110,7 +126,6 @@ onMounted(() => {
if
(
productId
.
value
)
{
loadProductInfo
()
}
})
// 加载产品信息
...
...
@@ -122,7 +137,63 @@ const loadProductInfo = () => {
}
else
{
console
.
warn
(
'未找到对应的产品信息:'
,
productId
.
value
)
}
}
// 初始化用户状态
const
initUserStatus
=
async
()
=>
{
// 获取用户store实例
userStore
.
value
=
useUserStore
()
// 加载会员信息
await
userStore
.
value
.
loadMemberInfo
()
// 检查用户状态
checkLoginStatus
()
}
// 检查登录状态
const
checkLoginStatus
=
()
=>
{
if
(
!
userStore
.
value
)
{
isLoggedIn
.
value
=
false
return
}
// 检查用户信息是否存在且有效
const
userInfo
=
userStore
.
value
.
userInfo
const
memberId
=
userInfo
?.
memberId
// 如果memberId为"not_login"或不存在,则未登录
if
(
!
memberId
||
memberId
===
"not_login"
)
{
isLoggedIn
.
value
=
false
}
else
{
isLoggedIn
.
value
=
true
}
console
.
log
(
'登录状态检查:'
,
{
userInfo
,
memberId
,
isLoggedIn
:
isLoggedIn
.
value
})
}
// 获取兑换按钮文本
const
getExchangeButtonText
=
()
=>
{
return
isLoggedIn
.
value
?
'马上兑换'
:
'马上兑换'
}
// 处理兑换按钮点击
const
handleExchange
=
()
=>
{
if
(
!
isLoggedIn
.
value
)
{
// 未登录,跳转到登录注册页面
jump
({
type
:
JumpType
.
INNER
,
url
:
"/pages/activity/register"
,
})
return
}
// 已登录,显示规格选择弹窗
openSpecModal
()
}
// 图片加载成功
...
...
@@ -330,6 +401,28 @@ export default {
text-align
:
center
;
}
/* 兑换按钮样式 */
.exchange-section
{
padding
:
0
30rpx
;
margin-bottom
:
20rpx
;
}
.exchange-btn
{
width
:
100%
;
height
:
88rpx
;
background-color
:
#D3A458
;
border-radius
:
44rpx
;
display
:
flex
;
align-items
:
center
;
justify-content
:
center
;
}
.exchange-btn-text
{
font-size
:
32rpx
;
color
:
#ffffff
;
font-weight
:
500
;
}
/* 规格选择弹窗样式 */
.spec-modal-overlay
{
position
:
fixed
;
...
...
v3/addressList/addressList.vue
View file @
13c5c1be
...
...
@@ -11,7 +11,8 @@
</view>
<text
class=
"address-detail"
>
{{
address
.
address
}}
</text>
<view
class=
"address-footer"
>
<text
class=
"default-tag"
:class=
"
{ 'active': address.isDefault, 'inactive': !address.isDefault }">默认
</text>
<text
class=
"default-tag"
:class=
"
{ 'active': address.isDefault, 'inactive': !address.isDefault }">默认
</text>
<view
class=
"action-buttons"
>
<view
class=
"edit-btn"
@
tap=
"editAddress(address.id)"
>
编辑
</view>
<view
class=
"delete-btn"
@
tap=
"confirmDelete(index)"
>
删除
</view>
...
...
@@ -71,7 +72,7 @@ export default {
console
.
log
(
'地址列表接口返回:'
,
response
);
if
(
response
.
ok
&&
response
.
success
&&
response
.
data
)
{
// 处理API返回的地址数据
// 处理API返回的地址数据
,并倒序排列
this
.
addressList
=
response
.
data
.
map
(
address
=>
({
id
:
address
.
id
,
name
:
address
.
name
,
...
...
@@ -87,9 +88,9 @@ export default {
isDefault
:
address
.
current
,
// 构建完整地址字符串
address
:
this
.
buildFullAddress
(
address
)
}))
;
}))
.
reverse
();
// 倒序排列,最新的地址在前面
console
.
log
(
'处理后的地址列表:'
,
this
.
addressList
);
console
.
log
(
'处理后的地址列表
(倒序)
:'
,
this
.
addressList
);
}
else
{
uni
.
showToast
({
title
:
response
.
msg
||
'获取地址列表失败'
,
...
...
@@ -128,6 +129,16 @@ export default {
// 添加地址
addAddress
()
{
// 检查地址数量限制
if
(
this
.
addressList
.
length
>=
20
)
{
uni
.
showToast
({
title
:
'地址添加已经达到上限啦~'
,
icon
:
'none'
,
duration
:
2000
});
return
;
}
uni
.
navigateTo
({
url
:
'/v3/addressList/addressEdit'
});
...
...
v3/goodDetail/goodDetail.vue
View file @
13c5c1be
...
...
@@ -465,11 +465,6 @@ export default {
// 获取按钮文本
getButtonText
()
{
// 未登录状态
if
(
!
this
.
cfgStatus
.
isRegister
)
{
return
'请先登录'
;
}
// 优先使用API返回的按钮文本
return
this
.
goodsData
.
buttonText
||
'立即兑换'
;
},
...
...
v3/orderList/orderList.vue
View file @
13c5c1be
...
...
@@ -28,7 +28,7 @@
<view
class=
"product-details"
>
<view
class=
"product-name-row"
>
<text
class=
"product-name"
>
{{
order
.
productName
}}
</text>
<text
class=
"product-points"
>
{{
order
.
points
}}
积分
</text>
<text
class=
"product-points"
>
{{
order
.
points
}}
{{
order
.
creditsTypeName
}}
</text>
</view>
<text
class=
"product-description"
>
{{
order
.
description
}}
</text>
...
...
@@ -96,6 +96,7 @@ export default {
productName
:
'商品名称—实物'
,
description
:
'商品描述文案占位'
,
points
:
200
,
creditsTypeName
:
'积分'
,
exchangeTime
:
'2025.09.10 23:23:23'
,
productImage
:
''
},
...
...
@@ -106,6 +107,7 @@ export default {
productName
:
'商品名称—实物'
,
description
:
'商品描述文案占位'
,
points
:
300
,
creditsTypeName
:
'积分'
,
exchangeTime
:
'2025.09.10 23:23:23'
,
countdown
:
'23:59:59'
,
productImage
:
''
...
...
@@ -117,6 +119,7 @@ export default {
productName
:
'商品名称—实物'
,
description
:
'商品描述文案占位'
,
points
:
150
,
creditsTypeName
:
'积分'
,
exchangeTime
:
'2025.09.10 23:23:23'
,
productImage
:
''
},
...
...
@@ -127,6 +130,7 @@ export default {
productName
:
'商品名称—卡券'
,
description
:
'商品描述文案占位'
,
points
:
100
,
creditsTypeName
:
'积分'
,
exchangeTime
:
'2025.09.10 23:23:23'
,
validUntil
:
'2025.09.10 23:23:23'
,
productImage
:
''
...
...
@@ -207,6 +211,7 @@ export default {
productName
:
item
.
bizDesc
||
''
,
description
:
item
.
bizDesc
||
''
,
points
:
item
.
credits
||
0
,
creditsTypeName
:
item
.
creditsTypeName
||
'积分'
,
exchangeTime
:
this
.
formatTime
(
item
.
createTime
),
productImage
:
item
.
bizIcon
||
''
,
countdown
:
this
.
calculateCountdown
(
item
.
expireTime
),
...
...
@@ -220,9 +225,10 @@ export default {
'1'
:
'pending_payment'
,
// 待付款
'2'
:
'pending_shipment'
,
// 待发货
'3'
:
'completed'
,
// 已完成
'4'
:
'cancelled'
// 已取消
'4'
:
'cancelled'
,
// 已取消
'99'
:
'completed'
// 特殊状态,按已完成处理
};
return
statusMap
[
flowState
]
||
'completed'
;
return
statusMap
[
flowState
.
toString
()
]
||
'completed'
;
},
// 映射业务类型到商品类型
...
...
@@ -359,6 +365,7 @@ export default {
.order-card
{
background-color
:
#ffffff
;
border-radius
:
16
rpx
;
border
:
1
rpx
solid
#EFEFEF
;
padding
:
30
rpx
;
box-shadow
:
0
2
rpx
8
rpx
rgba
(
0
,
0
,
0
,
0.05
);
}
...
...
@@ -369,25 +376,28 @@ export default {
justify-content
:
space-between
;
align-items
:
center
;
margin-bottom
:
20
rpx
;
padding-bottom
:
20
rpx
;
border-bottom
:
1
rpx
solid
#EFEFEF
;
}
.order-number
{
font-size
:
28
rpx
;
color
:
#
333333
;
color
:
#
b9b9b9
;
font-weight
:
500
;
}
.order-status
{
font-size
:
28
rpx
;
color
:
#b9b9b9
;
font-weight
:
500
;
}
.status-pending_shipment
{
color
:
#
333333
;
color
:
#
b9b9b9
;
}
.status-pending_payment
{
color
:
#
FF6B35
;
color
:
#
D3A458
;
}
.status-completed
{
...
...
@@ -440,7 +450,7 @@ export default {
.product-points
{
font-size
:
28
rpx
;
color
:
#
FF6B35
;
color
:
#
D3A458
;
font-weight
:
500
;
}
...
...
@@ -476,24 +486,24 @@ export default {
.countdown-text
{
font-size
:
26
rpx
;
color
:
#
FF6B35
;
color
:
#
D3A458
;
font-weight
:
500
;
}
.pay-btn
,
.action-btn
{
background-color
:
#
FFE9C5
;
border-radius
:
8
rpx
;
padding
:
16
rpx
32
rpx
;
min-width
:
120
rpx
;
background-color
:
#
D3A458
;
border-radius
:
50
rpx
;
width
:
1
32
rpx
;
height
:
52
rpx
;
display
:
flex
;
align-items
:
center
;
justify-content
:
center
;
}
.btn-text
{
font-size
:
2
8
rpx
;
color
:
#
333333
;
font-size
:
2
4
rpx
;
color
:
#
ffffff
;
font-weight
:
500
;
}
...
...
v3/payResultPage/payResultPage.vue
View file @
13c5c1be
...
...
@@ -57,8 +57,9 @@ export default {
// 支付结果数据 - 可根据实际需要修改
resultData
:
{
isSuccess
:
true
,
// true: 成功, false: 失败
pointsValue
:
'12000'
,
failureReason
:
'失败原因:XXXXXXXX'
pointsValue
:
''
,
failureReason
:
''
,
orderId
:
''
// 订单ID,用于跳转订单详情
}
}
},
...
...
@@ -98,15 +99,39 @@ export default {
return
this
.
isSuccess
?
'查看订单'
:
'返回首页'
;
}
},
onLoad
(
options
)
{
// 处理页面参数
if
(
options
.
isSuccess
!==
undefined
)
{
this
.
resultData
.
isSuccess
=
options
.
isSuccess
===
'true'
;
}
if
(
options
.
pointsValue
)
{
this
.
resultData
.
pointsValue
=
options
.
pointsValue
;
}
if
(
options
.
failureReason
)
{
this
.
resultData
.
failureReason
=
decodeURIComponent
(
options
.
failureReason
);
}
if
(
options
.
orderId
)
{
this
.
resultData
.
orderId
=
options
.
orderId
;
}
console
.
log
(
'支付结果页面参数:'
,
options
);
console
.
log
(
'支付结果数据:'
,
this
.
resultData
);
},
methods
:
{
// 处理操作按钮点击
handleAction
()
{
if
(
this
.
isSuccess
)
{
// 查看订单
uni
.
showToast
({
title
:
'查看订单'
,
icon
:
'none'
// 查看订单 - 跳转到订单详情页面
if
(
this
.
resultData
.
orderId
)
{
uni
.
navigateTo
({
url
:
`/v3/orderDetail/orderDetail?orderId=
${
this
.
resultData
.
orderId
}
`
});
}
else
{
// 如果没有订单ID,跳转到订单列表页面
uni
.
navigateTo
({
url
:
'/v3/orderList/orderList'
});
}
}
else
{
// 返回首页
uni
.
reLaunch
({
...
...
@@ -116,10 +141,11 @@ export default {
},
// 设置支付结果 - 供外部调用
setPaymentResult
(
isSuccess
,
pointsValue
=
''
,
failureReason
=
''
)
{
setPaymentResult
(
isSuccess
,
pointsValue
=
''
,
failureReason
=
''
,
orderId
=
''
)
{
this
.
resultData
.
isSuccess
=
isSuccess
;
this
.
resultData
.
pointsValue
=
pointsValue
;
this
.
resultData
.
failureReason
=
failureReason
;
this
.
resultData
.
orderId
=
orderId
;
}
}
}
...
...
views/My.vue
View file @
13c5c1be
...
...
@@ -16,7 +16,7 @@
<image
class=
"banner_cover"
:src=
"$baseUrl + 'my/cover_white.png'"
mode=
"aspectFill"
/>
</view>
<view
v-if=
"!cfgStatus.isRegister"
class=
"
phone-button
"
@
click=
"clickRegisterShield"
/>
<view
v-if=
"!cfgStatus.isRegister"
class=
"
bg-container
"
@
click=
"clickRegisterShield"
/>
<!-- 用户信息区域 -->
<view
class=
"user-info"
:style=
"
{ 'min-height': cfgStatus.showDetail ? '343rpx' : '180rpx' }">
...
...
@@ -165,7 +165,7 @@
<text
class=
"menu-title"
>
我的优惠券
</text>
<text
class=
"menu-arrow"
>
〉
</text>
</view>
<view
class=
"menu-item"
@
click=
"navigateTo('/v3/more/index')"
:data-log=
"{
<view
class=
"menu-item"
@
click=
"navigateTo
WithLogin
('/v3/more/index')"
:data-log=
"{
xcxClick: '我的页面点击',
pageName: '我的页面',
buttonName: '更多'
...
...
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