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
82ac4b9b
Commit
82ac4b9b
authored
Oct 24, 2025
by
spc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed
parent
4cd446d5
Changes
8
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
425 additions
and
171 deletions
+425
-171
.DS_Store
.DS_Store
+0
-0
address.js
api/address.js
+19
-1
user.js
api/user.js
+5
-1
addressEdit.vue
v3/addressList/addressEdit.vue
+309
-31
addressList.vue
v3/addressList/addressList.vue
+14
-82
goodDetail.vue
v3/goodDetail/goodDetail.vue
+54
-30
index.vue
v3/more/index.vue
+4
-0
orderList.vue
v3/orderList/orderList.vue
+20
-26
No files found.
.DS_Store
View file @
82ac4b9b
No preview for this file type
api/address.js
View file @
82ac4b9b
...
...
@@ -145,4 +145,22 @@ export const setDefaultAddress = (data) => api.post('/c/user/address/current', d
* @response {string} response.data.postalCode - 邮政编码
* @response {string} response.data.floorNo - 门牌号
*/
export
const
getAddressDetail
=
(
data
)
=>
api
.
get
(
'/c/user/address/detail'
,
data
);
\ No newline at end of file
export
const
getAddressDetail
=
(
data
)
=>
api
.
get
(
'/c/user/address/detail'
,
data
);
/**
* 获取省市区数据
* @param {Object} params - 请求参数
* @param {number} [params.id=0] - 上级地区ID,初始传0获取省份列表,后续使用上级接口返回的id查询下级
* @returns {Promise} API响应
* @description 根据上级地区ID获取下级地区列表
* @response {Object} 响应数据
* @response {boolean} response.ok - 请求是否成功
* @response {boolean} response.success - 操作是否成功
* @response {string} response.msg - 响应消息
* @response {string} response.code - 响应代码
* @response {Array} response.data - 地区列表
* @response {number} response.data[].id - 地区ID(用于查询下级)
* @response {number} response.data[].code - 地区代码
* @response {string} response.data[].name - 地区名称
*/
export
const
getRegionList
=
(
params
=
{})
=>
api
.
get
(
'/c/common/region'
,
params
);
\ No newline at end of file
api/user.js
View file @
82ac4b9b
...
...
@@ -64,4 +64,8 @@ export const doTerminate = () => api.post('/c/user/terminate');
* @param {number} [params.nextId] - 下一页ID,不传则为第一页
* @returns {Promise} 返回兑换记录列表
*/
export
const
getExchangeList
=
(
params
=
{})
=>
api
.
get
(
'/c/user/exchange/list'
,
{
params
});
\ No newline at end of file
export
const
getExchangeList
=
(
params
=
{})
=>
api
.
get
(
'/c/user/exchange/list'
,
{
params
});
export
const
getRegionsQuery
=
(
data
)
=>
api
.
get
(
'/c/regions/query'
,
data
);
\ No newline at end of file
v3/addressList/addressEdit.vue
View file @
82ac4b9b
This diff is collapsed.
Click to expand it.
v3/addressList/addressList.vue
View file @
82ac4b9b
...
...
@@ -11,12 +11,8 @@
</view>
<text
class=
"address-detail"
>
{{
address
.
address
}}
</text>
<view
class=
"address-footer"
>
<text
v-if=
"address.isDefault"
class=
"default-tag
"
>
默认
</text>
<text
class=
"default-tag"
:class=
"
{ 'active': address.isDefault, 'inactive': !address.isDefault }
">默认
</text>
<view
class=
"action-buttons"
>
<view
v-if=
"!address.isDefault"
class=
"set-default-btn not-default"
@
tap=
"setDefaultAddress(index)"
>
设置默认
</view>
<view
class=
"edit-btn"
@
tap=
"editAddress(address.id)"
>
编辑
</view>
<view
class=
"delete-btn"
@
tap=
"confirmDelete(index)"
>
删除
</view>
</view>
...
...
@@ -46,7 +42,7 @@
</
template
>
<
script
>
import
{
getAddressList
,
deleteAddress
,
setDefaultAddress
}
from
'@/api/address.js'
;
import
{
getAddressList
,
deleteAddress
}
from
'@/api/address.js'
;
export
default
{
data
()
{
...
...
@@ -60,6 +56,12 @@ export default {
onLoad
()
{
this
.
fetchAddressList
();
},
onShow
()
{
// 每次页面显示时刷新地址列表,避免重复请求
if
(
!
this
.
isLoading
)
{
this
.
fetchAddressList
();
}
},
methods
:
{
// 获取地址列表
async
fetchAddressList
()
{
...
...
@@ -173,40 +175,6 @@ export default {
}
this
.
showDeleteConfirm
=
false
;
this
.
currentDeleteIndex
=
-
1
;
},
// 设置默认地址
async
setDefaultAddress
(
index
)
{
const
address
=
this
.
addressList
[
index
];
try
{
const
response
=
await
setDefaultAddress
({
id
:
address
.
id
});
console
.
log
(
'设置默认地址接口返回:'
,
response
);
if
(
response
.
ok
&&
response
.
success
)
{
// 先将所有地址的默认状态取消
this
.
addressList
.
forEach
(
item
=>
{
item
.
isDefault
=
false
;
});
// 设置当前地址为默认
this
.
addressList
[
index
].
isDefault
=
true
;
uni
.
showToast
({
title
:
'设置成功'
,
icon
:
'success'
});
}
else
{
uni
.
showToast
({
title
:
response
.
msg
||
'设置失败'
,
icon
:
'none'
});
}
}
catch
(
error
)
{
console
.
error
(
'设置默认地址失败:'
,
error
);
uni
.
showToast
({
title
:
'网络错误,请重试'
,
icon
:
'none'
});
}
}
}
};
...
...
@@ -214,7 +182,6 @@ export default {
<
style
scoped
>
.address-list-container
{
padding-top
:
120
rpx
;
/* 为fixed头部留出空间 */
padding-bottom
:
150
rpx
;
}
...
...
@@ -262,6 +229,7 @@ export default {
.address-footer
{
display
:
flex
;
align-items
:
center
;
justify-content
:
space-between
;
padding-top
:
20
rpx
;
padding-bottom
:
20
rpx
;
border-bottom
:
1
rpx
solid
#f0f0f0
;
...
...
@@ -296,55 +264,19 @@ export default {
flex
:
none
;
order
:
0
;
flex-grow
:
0
;
margin-right
:
auto
;
padding
:
0
;
gap
:
0
;
}
.action-buttons
{
display
:
flex
;
align-items
:
center
;
.default-tag.inactive
{
/* 非默认状态 - 置灰 */
background
:
#E5E5E5
;
color
:
#999999
;
}
.set-default-btn
{
/* 小按钮-深 可点击 - 已设为默认状态 */
/* Auto layout */
.action-buttons
{
display
:
flex
;
flex-direction
:
row
;
justify-content
:
center
;
align-items
:
center
;
/* 宽高设置 */
width
:
106
rpx
;
height
:
38
rpx
;
/* 背景和圆角 */
background
:
#D3A458
;
border-radius
:
36
rpx
;
/* 字体样式 */
font-family
:
'PingFang SC'
;
font-style
:
normal
;
font-weight
:
500
;
font-size
:
24
rpx
;
/* 12px */
line-height
:
38
rpx
;
color
:
#FFFFFF
;
/* 布局 */
flex
:
none
;
order
:
0
;
flex-grow
:
0
;
margin-right
:
20
rpx
;
padding
:
0
;
gap
:
0
;
}
/* 非默认状态按钮样式 */
.set-default-btn.not-default
{
/* 小按钮-深 可点击 - 非默认状态 */
background
:
#A8A8A8
;
/* 其他属性与默认状态相同 */
}
.edit-btn
{
...
...
v3/goodDetail/goodDetail.vue
View file @
82ac4b9b
...
...
@@ -20,7 +20,7 @@
<view
class=
"points-row"
>
<view
class=
"points-left"
>
<text
class=
"points-value"
>
{{
goodsData
.
points
}}
</text>
<text
class=
"points-unit"
>
积分
</text>
<text
class=
"points-unit"
>
{{
goodsData
.
creditsTypeName
||
'积分'
}}
</text>
</view>
<text
class=
"exchange-count"
>
已兑换
{{
formatCount
(
goodsData
.
exchangeCount
)
}}
件
</text>
</view>
...
...
@@ -67,7 +67,8 @@
<text
class=
"image-placeholder"
>
商品图片
</text>
</view>
<view
class=
"product-details"
>
<text
class=
"product-points"
>
{{
goodsData
.
points
}}
积分
</text>
<text
class=
"product-points"
>
{{
goodsData
.
points
}}{{
goodsData
.
creditsTypeName
||
'积分'
}}
</text>
<text
class=
"product-stock"
>
库存
{{
formatCount
(
goodsData
.
exchangeCount
)
}}
件
</text>
</view>
</view>
...
...
@@ -103,7 +104,7 @@
<view
class=
"modal-overlay"
v-if=
"showConfirmModal"
@
click=
"closeModal"
>
<view
class=
"modal-content"
@
click
.
stop
>
<view
class=
"modal-title"
>
兑换确认
</view>
<view
class=
"modal-message"
>
本次兑换需要消耗
{{
goodsData
.
points
}}
积分
</view>
<view
class=
"modal-message"
>
本次兑换需要消耗
{{
goodsData
.
points
}}
{{
goodsData
.
creditsTypeName
||
'积分'
}}
</view>
<view
class=
"modal-buttons"
>
<button
class=
"modal-btn cancel-btn"
@
click=
"closeModal"
>
取消
</button>
<button
class=
"modal-btn confirm-btn"
@
click=
"confirmExchange"
>
确定
</button>
...
...
@@ -126,30 +127,49 @@ export default {
return
{
goodsData
:
{
id
:
''
,
points
:
1200
0
,
exchangeCount
:
15800
0
,
memberLevel
:
'
铂金会员
'
,
limit
:
'
2
'
,
name
:
'
优惠券名称占位优惠券名称占位
'
,
couponName
:
'
淘票票电影代金券
'
,
expireDate
:
'
2017-07-12
'
,
points
:
0
,
exchangeCount
:
0
,
memberLevel
:
''
,
limit
:
''
,
name
:
''
,
couponName
:
''
,
expireDate
:
''
,
remainDays
:
18
,
isSoldOut
:
false
isSoldOut
:
false
,
goodsType
:
''
,
goodsContent
:
''
,
goodsDeclare
:
''
,
goodsIcon
:
''
,
goodsImage
:
[],
creditsType
:
''
,
creditsTypeName
:
''
,
priceMarket
:
''
,
priceSale
:
''
,
buttonText
:
'立即兑换'
,
address
:
null
,
phone
:
''
,
stores
:
[],
skus
:
[],
amount
:
[],
checkRule
:
{},
failRule
:
{},
exchangeTime
:
{},
virtualConfig
:
{},
matnr
:
''
,
groupEnable
:
false
},
isLoading
:
true
,
showConfirmModal
:
false
,
showSpecModal
:
false
,
userPoints
:
800
0
,
// 用户当前积分
userLevel
:
'
黄金会员
'
,
// 用户当前等级
userPoints
:
0
,
// 用户当前积分
userLevel
:
''
,
// 用户当前等级
userBuyLimit
:
false
,
// 用户购买限制
goodsLimit
:
false
,
// 商品限购
// 规格选择相关
specOptions
:
[
{
label
:
'750g'
,
value
:
'750g'
},
{
label
:
'900g'
,
value
:
'900g'
},
{
label
:
'1200g'
,
value
:
'1200g'
}
],
selectedSpec
:
'
750g
'
,
selectedSpec
:
''
,
quantity
:
1
,
// 订单相关
orderParams
:
{},
// 订单参数
...
...
@@ -264,22 +284,23 @@ export default {
points
:
parseInt
(
data
.
credits
)
||
0
,
exchangeCount
:
data
.
stock
||
0
,
memberLevel
:
this
.
getMemberLevel
(
data
.
state
),
limit
:
data
.
g
oodsLimit
?
'1'
:
'2
'
,
name
:
data
.
goodsN
ame
||
''
,
couponName
:
data
.
goodsN
ame
||
''
,
limit
:
data
.
g
roupCount
?
data
.
groupCount
.
toString
()
:
'1
'
,
name
:
data
.
n
ame
||
''
,
couponName
:
data
.
n
ame
||
''
,
expireDate
:
data
.
expireTime
&&
data
.
expireTime
.
length
>
0
?
data
.
expireTime
[
0
]
:
''
,
remainDays
:
this
.
calculateRemainDays
(
data
.
expireTime
),
isSoldOut
:
data
.
stock
<=
0
||
data
.
state
===
0
||
data
.
buttonText
.
includes
(
'库存不足'
)
,
isInsufficientCredits
:
data
.
button
Text
.
includes
(
'碳能量不足'
)
||
data
.
buttonT
ext
.
includes
(
'积分不足'
),
goodsType
:
data
.
goodsT
ype
||
''
,
goodsContent
:
data
.
goodsC
ontent
||
''
,
isSoldOut
:
data
.
stock
<=
0
,
isInsufficientCredits
:
data
.
button
_t
ext
.
includes
(
'积分不足'
),
goodsType
:
data
.
t
ype
||
''
,
goodsContent
:
data
.
c
ontent
||
''
,
goodsDeclare
:
data
.
goodsDeclare
||
''
,
goodsIcon
:
data
.
goodsI
con
||
''
,
goodsImage
:
data
.
goodsI
mage
||
[],
goodsIcon
:
data
.
i
con
||
''
,
goodsImage
:
data
.
i
mage
||
[],
creditsType
:
data
.
creditsType
||
''
,
priceMarket
:
data
.
priceMarket
||
''
,
priceSale
:
data
.
priceSale
||
''
,
buttonText
:
data
.
buttonText
||
'立即兑换'
,
creditsTypeName
:
data
.
creditsTypeName
||
''
,
priceMarket
:
data
.
price_market
||
''
,
priceSale
:
data
.
price_sale
||
''
,
buttonText
:
data
.
button_text
||
'立即兑换'
,
address
:
data
.
address
||
null
,
phone
:
data
.
phone
||
''
,
stores
:
data
.
stores
||
[],
...
...
@@ -288,7 +309,9 @@ export default {
checkRule
:
data
.
checkRule
||
{},
failRule
:
data
.
failRule
||
{},
exchangeTime
:
data
.
exchangeTime
||
{},
virtualConfig
:
data
.
virtualConfig
||
{}
virtualConfig
:
data
.
virtualConfig
||
{},
matnr
:
data
.
matnr
||
''
,
groupEnable
:
data
.
groupEnable
||
false
};
// 更新用户购买限制状态
...
...
@@ -630,6 +653,7 @@ export default {
success
:
isSuccess
,
orderId
:
orderData
?
orderData
.
orderId
:
''
,
points
:
this
.
goodsData
.
points
,
creditsTypeName
:
this
.
goodsData
.
creditsTypeName
||
'积分'
,
goodsName
:
this
.
goodsData
.
name
};
...
...
v3/more/index.vue
View file @
82ac4b9b
...
...
@@ -130,6 +130,10 @@ export default {
case
'feedback'
:
// 跳转到意见反馈页面
// uni.navigateTo({ url: '/pages/feedback/index' })
jump
({
type
:
JumpType
.
H5
,
url
:
'https://china-feihe.feishu.cn/share/base/form/shrcnXo3nSF0NFpHA68TIEhdzRb'
});
break
case
'userPolicy'
:
// 跳转到用户政策页面
...
...
v3/orderList/orderList.vue
View file @
82ac4b9b
...
...
@@ -5,31 +5,25 @@
<text
class=
"page-title"
>
仅展示星妈会全积分兑换记录
</text>
<view
class=
"view-preferred"
@
tap=
"viewPreferredOrders"
>
<text
class=
"preferred-text"
>
查看优选订单
</text>
<text
class=
"arrow"
>
>
</text>
<text
class=
"arrow"
>
{{
">"
}}
</text>
</view>
</view>
<!-- 订单列表 -->
<view
class=
"order-list"
>
<view
v-for=
"(order, index) in orderList"
:key=
"order.orderId"
class=
"order-card"
>
<view
v-for=
"(order, index) in orderList"
:key=
"order.orderId"
class=
"order-card"
>
<!-- 订单头部 -->
<view
class=
"order-header"
>
<text
class=
"order-number"
>
订单号
{{
order
.
orderId
}}
</text>
<text
class=
"order-status"
:class=
"getStatusClass(order.status)"
>
{{
getStatusText
(
order
.
status
)
}}
</text>
<text
class=
"order-status"
:class=
"getStatusClass(order.status)"
>
{{
getStatusText
(
order
.
status
)
}}
</text>
</view>
<!-- 商品信息 -->
<view
class=
"product-info"
>
<view
class=
"product-image"
>
<image
:src=
"order.productImage || $baseUrl + 'placeholder/product.png'"
mode=
"aspectFill"
class=
"product-img"
/>
<image
:src=
"order.productImage || $baseUrl + 'placeholder/product.png'"
mode=
"aspectFill"
class=
"product-img"
/>
</view>
<view
class=
"product-details"
>
<view
class=
"product-name-row"
>
...
...
@@ -37,12 +31,12 @@
<text
class=
"product-points"
>
{{
order
.
points
}}
积分
</text>
</view>
<text
class=
"product-description"
>
{{
order
.
description
}}
</text>
<!-- 卡券有效期 -->
<text
v-if=
"order.productType === 'coupon' && order.validUntil"
class=
"validity-period"
>
有效期
{{
order
.
validUntil
}}
前使用
</text>
<text
class=
"exchange-time"
>
兑换时间
{{
order
.
exchangeTime
}}
</text>
</view>
</view>
...
...
@@ -56,7 +50,7 @@
<text
class=
"btn-text"
>
去付款
</text>
</view>
</view>
<!-- 其他状态的操作按钮 -->
<view
v-else
class=
"action-btn"
@
tap=
"viewOrderDetail(order)"
>
<text
class=
"btn-text"
>
查看详情
</text>
...
...
@@ -77,7 +71,6 @@
<!-- 空状态 -->
<view
v-if=
"orderList.length === 0"
class=
"empty-state"
>
<image
:src=
"$baseUrl + 'empty/order_empty.png'"
mode=
"aspectFit"
class=
"empty-image"
/>
<text
class=
"empty-text"
>
暂无兑换记录
</text>
</view>
</view>
...
...
@@ -152,9 +145,9 @@ export default {
// 加载兑换记录列表
async
loadExchangeList
(
isRefresh
=
false
)
{
if
(
this
.
loading
)
return
;
this
.
loading
=
true
;
try
{
const
params
=
{};
if
(
isRefresh
)
{
...
...
@@ -165,18 +158,18 @@ export default {
// 加载更多时传递nextId
params
.
nextId
=
this
.
nextId
;
}
const
response
=
await
getExchangeList
(
params
);
if
(
response
.
ok
)
{
const
newList
=
this
.
mapApiDataToOrderList
(
response
.
data
.
list
||
[]);
if
(
isRefresh
)
{
this
.
orderList
=
newList
;
}
else
{
this
.
orderList
=
[...
this
.
orderList
,
...
newList
];
}
// 更新nextId,判断是否还有更多数据
this
.
nextId
=
response
.
data
.
nextId
||
null
;
this
.
hasMore
=
!!
this
.
nextId
;
...
...
@@ -257,13 +250,13 @@ export default {
const
now
=
new
Date
().
getTime
();
const
expire
=
new
Date
(
expireTime
).
getTime
();
const
diff
=
expire
-
now
;
if
(
diff
<=
0
)
return
'00:00:00'
;
const
hours
=
Math
.
floor
(
diff
/
(
1000
*
60
*
60
));
const
minutes
=
Math
.
floor
((
diff
%
(
1000
*
60
*
60
))
/
(
1000
*
60
));
const
seconds
=
Math
.
floor
((
diff
%
(
1000
*
60
))
/
1000
);
return
`
${
hours
.
toString
().
padStart
(
2
,
'0'
)}
:
${
minutes
.
toString
().
padStart
(
2
,
'0'
)}
:
${
seconds
.
toString
().
padStart
(
2
,
'0'
)}
`
;
},
...
...
@@ -476,7 +469,8 @@ export default {
font-weight
:
500
;
}
.pay-btn
,
.action-btn
{
.pay-btn
,
.action-btn
{
background-color
:
#FFE9C5
;
border-radius
:
8
rpx
;
padding
:
16
rpx
32
rpx
;
...
...
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