Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
杨炀
/
ztx_wx_gzt
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
bb440033
authored
2026-04-15 14:42:25 +0800
by
张猛
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
个人会员缴费
1 parent
7d6c26f4
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
36 deletions
personal/order.vue
personal/order.vue
View file @
bb44003
<
template
>
<view
class=
"order-page"
:class=
"
{ 'no-scroll': isPopupOpen }
">
<view
:class=
"
{ 'no-scroll': isPopupOpen }" class="order-page
">
<!-- 订单列表 -->
<scroll-view
scroll-y
class=
"order-list-scroll"
:enhanced=
"true"
:show-scrollbar=
"false"
:scroll-enabled=
"!isPopupOpen"
:show-scrollbar=
"false"
class=
"order-list-scroll"
scroll-y
>
<view
class=
"order-list"
>
<!-- 有数据才循环 -->
...
...
@@ -19,16 +19,17 @@
<!-- 订单头部:日期 + 状态 -->
<view
class=
"card-header"
>
<view
class=
"date"
>
<image
:src=
"config.baseUrl_api + '/fs/static/calendar@2x.png'"
v-if=
"item.payTime"
mode=
"widthFix"
style=
"width:30rpx;height:30rpx;"
/>
<text
class=
"date-text"
v-if=
"item.payTime"
>
{{
item
.
payTime
}}
</text>
<image
v-if=
"item.payTime"
:src=
"config.baseUrl_api + '/fs/static/calendar@2x.png'"
mode=
"widthFix"
style=
"width:30rpx;height:30rpx;"
/>
<text
v-if=
"item.payTime"
class=
"date-text"
>
{{
item
.
payTime
}}
</text>
</view>
<view
class=
"status-tag"
:class=
"
{
success: item.payStatus == 1,
danger: item.payStatus == 2,
pending: item.payStatus == 0
}"
class="status-tag"
>
{{
getStatusText
(
item
.
payStatus
)
}}
</view>
...
...
@@ -45,7 +46,7 @@
</view>
<!-- 核心:个人会员仅展示缴费年限 -->
<view
class=
"info-section flex f-j-s"
v-if=
"item.content
"
>
<view
v-if=
"item.content"
class=
"info-section flex f-j-s
"
>
<view
class=
"single-info"
>
<view
class=
"label"
>
缴费年限:
</view>
<view
class=
"value"
>
{{
item
.
content
.
yearCount
||
0
}}
</view>
...
...
@@ -65,31 +66,31 @@
<!-- 按钮组:靠右紧凑展示 -->
<view
class=
"btn-group"
>
<
button
class=
"btn btn-delete"
@
click=
"handleDelete(item)"
>
删除
</button
>
<
!--
<button
class=
"btn btn-delete"
@
click=
"handleDelete(item)"
>
删除
</button>
--
>
<!-- 已缴费:申请开票/已开票 -->
<template
v-if=
"item.payStatus == 1"
>
<button
class=
"btn btn-invoice"
@
click=
"makeInvoiceFN(item)"
:disabled=
"item.invoiceStatus === 1
"
>
<button
:disabled=
"item.invoiceStatus === 1"
class=
"btn btn-invoice"
@
click=
"makeInvoiceFN(item)
"
>
{{
item
.
invoiceStatus
===
1
?
'已开票'
:
'申请开票'
}}
</button>
</
template
>
<!--
未缴费:去缴费 + 取消订单
-->
<
template
v-if=
"item.payStatus == 0"
>
<button
class=
"btn btn-cancel"
@
click=
"handleCancel(item)"
>
取消订单
</button
>
<button
class=
"btn btn-pay"
@
click=
"handlePay(item)"
>
去缴费
</button
>
<
/
template
>
<!--
<!– 未缴费:去缴费 + 取消订单 –>
-->
<
!-- <template v-if="item.payStatus == 0">--
>
<!-- <button class="btn btn-cancel" @click="handleCancel(item)">取消订单</button>--
>
<!-- <button class="btn btn-pay" @click="handlePay(item)">去缴费</button>--
>
<
!-- </template>--
>
</view>
</view>
</view>
<!-- 空状态 -->
<view
v-else
class=
"empty"
>
<image
class=
"empty-img"
mode=
"aspectFit"
:src=
"config.baseUrl_api + '/fs/static/nodata.png'
"
></image>
<image
:src=
"config.baseUrl_api + '/fs/static/nodata.png'"
class=
"empty-img"
mode=
"aspectFit
"
></image>
<text
class=
"empty-text"
>
暂无订单记录
</text>
</view>
<!-- 加载/无更多提示 -->
<view
class=
"loading-tip"
v-if=
"loading
"
>
加载中...
</view>
<view
class=
"no-more"
v-if=
"!loading && !hasMore && list.length
"
>
没有更多了
</view>
<view
v-if=
"loading"
class=
"loading-tip
"
>
加载中...
</view>
<view
v-if=
"!loading && !hasMore && list.length"
class=
"no-more
"
>
没有更多了
</view>
</view>
</scroll-view>
...
...
@@ -120,11 +121,12 @@
</template>
<
script
setup
>
import
{
ref
,
reactive
,
onMounted
,
computed
}
from
'vue'
;
import
{
onReachBottom
}
from
'@dcloudio/uni-app'
import
{
useUserStore
}
from
"../store/modules/user"
;
import
{
ref
,
reactive
,
onMounted
,
computed
}
from
'vue'
;
import
{
onReachBottom
}
from
'@dcloudio/uni-app'
import
{
useUserStore
}
from
"../store/modules/user"
;
import
*
as
api
from
'@/common/api.js'
import
config
from
'@/config.js'
const
userStore
=
useUserStore
()
// 数据与分页配置
const
list
=
ref
([]);
...
...
@@ -158,12 +160,14 @@ const currentOrder = ref(null);
// 页面挂载初始化
onMounted
(()
=>
{
// 获取用户信息
if
(
userInfo
.
value
&&
userInfo
.
value
.
perId
)
{
queryParams
.
perId
=
userInfo
.
value
.
perId
;
// if (userInfo.value && userInfo.value.perId) {
// queryParams.perId = userInfo.value.perId;
// initData();
// } else {
// uni.showToast({title: '获取用户信息失败', icon: 'none'});
// }
initData
();
}
else
{
uni
.
showToast
({
title
:
'获取用户信息失败'
,
icon
:
'none'
});
}
});
// 小程序原生触底加载
...
...
@@ -215,7 +219,7 @@ const initData = async () => {
hasMore
.
value
=
list
.
value
.
length
<
(
res
.
total
||
0
);
}
catch
(
e
)
{
console
.
error
(
'订单加载异常:'
,
e
);
uni
.
showToast
({
title
:
'加载失败'
,
icon
:
'none'
});
uni
.
showToast
({
title
:
'加载失败'
,
icon
:
'none'
});
}
finally
{
loading
.
value
=
false
;
}
...
...
@@ -234,13 +238,13 @@ const confirmDel = async () => {
if
(
!
currentOrder
.
value
)
return
;
try
{
await
api
.
deleteOrder
(
currentOrder
.
value
.
id
);
uni
.
showToast
({
title
:
'删除成功'
,
icon
:
'success'
});
uni
.
showToast
({
title
:
'删除成功'
,
icon
:
'success'
});
pageNum
.
value
=
1
;
list
.
value
=
[];
initData
();
closeDelPopup
();
}
catch
(
e
)
{
uni
.
showToast
({
title
:
'删除失败'
,
icon
:
'error'
});
uni
.
showToast
({
title
:
'删除失败'
,
icon
:
'error'
});
}
};
...
...
@@ -255,16 +259,16 @@ const closeDelPopup = () => {
const
handlePay
=
async
(
item
)
=>
{
if
(
item
.
payStatus
!==
0
)
return
;
try
{
await
api
.
goPay
({
id
:
item
.
id
});
uni
.
navigateTo
({
url
:
`/pages/pay/pay?orderId=
${
item
.
id
}
`
});
await
api
.
goPay
({
id
:
item
.
id
});
uni
.
navigateTo
({
url
:
`/pages/pay/pay?orderId=
${
item
.
id
}
`
});
}
catch
(
e
)
{
uni
.
showToast
({
title
:
'发起支付失败'
,
icon
:
'none'
});
uni
.
showToast
({
title
:
'发起支付失败'
,
icon
:
'none'
});
}
};
// 申请开票
const
makeInvoiceFN
=
(
item
)
=>
{
uni
.
navigateTo
({
url
:
`/pages/invoice/apply?orderId=
${
item
.
id
}
amount=
${
item
.
price
}
`
});
uni
.
navigateTo
({
url
:
`/pages/invoice/apply?orderId=
${
item
.
id
}
amount=
${
item
.
price
}
`
});
};
// 取消订单
...
...
@@ -280,13 +284,13 @@ const confirmCancel = async () => {
if
(
!
currentOrder
.
value
)
return
;
try
{
await
api
.
cancelPay
(
currentOrder
.
value
.
id
);
uni
.
showToast
({
title
:
'取消成功'
,
icon
:
'success'
});
uni
.
showToast
({
title
:
'取消成功'
,
icon
:
'success'
});
pageNum
.
value
=
1
;
list
.
value
=
[];
initData
();
closeCancelPopup
();
}
catch
(
e
)
{
uni
.
showToast
({
title
:
'取消失败'
,
icon
:
'error'
});
uni
.
showToast
({
title
:
'取消失败'
,
icon
:
'error'
});
}
};
...
...
@@ -402,15 +406,18 @@ const closeCancelPopup = () => {
justify-content
:
space-around
;
margin
:
20
rpx
0
;
}
.line
{
.line
{
width
:
1
rpx
;
height
:
90%
;
background
:
#eee
;
}
.single-info
{
padding
:
16
rpx
20
rpx
;
border-radius
:
8
rpx
;
font-size
:
26
rpx
;
.label
{
color
:
#999
;
text-align
:
center
;
...
...
Write
Preview
Styling with
Markdown
is supported
Attach a file
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 post a comment