Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
groupPurchase-miniapp
Project
Project
Details
Activity
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
彭佳妮(贵阳日报)
groupPurchase-miniapp
Commits
a846f2f0
Commit
a846f2f0
authored
Aug 02, 2024
by
彭佳妮(贵阳日报)
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优惠券
parent
5fe273f8
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
98 additions
and
6 deletions
+98
-6
ticket.js
src/api/ticket.js
+27
-0
index.vue
src/pages/order/components/Payment/index.vue
+1
-1
detail.vue
src/pages/ticket/detail.vue
+22
-1
ticket.vue
src/pages/ticket/ticket.vue
+48
-4
No files found.
src/api/ticket.js
0 → 100644
View file @
a846f2f0
import
{
request
}
from
'../utils/request'
;
// 用户券统计接口
export
function
userCouponStatisticsApi
(
data
)
{
return
request
({
url
:
'/sgyrdd/coupon/getUserCouponSum'
,
method
:
'GET'
,
data
,
});
}
// 用户券列表接口
export
function
myCouponListApi
(
data
)
{
return
request
({
url
:
'/sgyrdd/coupon/getUserCouponPage'
,
method
:
'GET'
,
data
,
});
}
// 商铺优惠券列表接口 data:shopId
export
function
shopCouponList
(
data
)
{
return
request
({
url
:
'/sgyrdd/coupon/couponShopList/'
+
data
,
method
:
'GET'
,
});
}
src/pages/order/components/Payment/index.vue
View file @
a846f2f0
...
...
@@ -37,7 +37,7 @@
<
script
setup
>
const
selectType
=
ref
(
'wx'
);
const
show
=
ref
(
tru
e
);
const
show
=
ref
(
fals
e
);
function
radioChange
(
evt
)
{
const
{
value
}
=
evt
.
detail
;
...
...
src/pages/ticket/detail.vue
View file @
a846f2f0
...
...
@@ -28,7 +28,7 @@
<image
class=
"address"
src=
"@/static/ticket/address.png"
></image>
<view
class=
"infobox"
>
<text
class=
"addr"
>
贵阳市南明区花果园R1区1209
</text>
<text>
距您400米
步行5分钟
</text>
<text>
距您400米
</text>
</view>
<view
class=
"iconbox"
>
<image
class=
"img"
src=
"@/static/ticket/map.png"
></image>
...
...
@@ -49,10 +49,31 @@
</
template
>
<
script
setup
>
import
{
shopCouponList
}
from
'@/api/ticket'
;
import
{
getShopDetail
}
from
'@/api/order'
;
import
Header
from
'@/pages/order/components/Header/index.vue'
;
import
TicketList
from
'@/pages/ticket/components/TicketList/index.vue'
;
const
value
=
ref
(
4
);
const
shopId
=
ref
(
'1626126617850544129'
);
const
getList
=
async
()
=>
{
const
res
=
await
shopCouponList
(
shopId
.
value
);
console
.
log
(
res
);
};
getList
();
/**
* 获取商铺信息
*/
const
shopDetail
=
ref
();
const
getShopMailDetail
=
async
()
=>
{
const
res
=
await
getShopDetail
({
shopId
:
shopId
.
value
});
if
(
res
.
code
===
0
)
{
shopDetail
.
value
=
res
.
data
.
shop
;
}
};
getShopMailDetail
();
</
script
>
<
style
scoped
lang=
"scss"
>
...
...
src/pages/ticket/ticket.vue
View file @
a846f2f0
...
...
@@ -14,7 +14,7 @@
<view
class=
"content"
>
<view
class=
"card"
>
<text
class=
"text"
>
已领取优惠金额(元)
</text>
<text
class=
"price"
>
0.00
</text>
<text
class=
"price"
>
{{
discountAmount
}}
</text>
</view>
<!-- 优惠券状态 -->
...
...
@@ -36,22 +36,66 @@
</
template
>
<
script
setup
>
import
{
myCouponListApi
,
userCouponStatisticsApi
}
from
'@/api/ticket'
;
import
Header
from
'@/pages/order/components/Header/index.vue'
;
import
TicketList
from
'@/pages/ticket/components/TicketList/index.vue'
;
const
fileDomain
=
import
.
meta
.
env
.
VITE_APP_IMG_URL
;
// 主状态
const
tabList
=
[
'有效优惠券'
,
'无效优惠券'
];
const
currentTab
=
ref
(
0
);
const
changeTab
=
(
index
)
=>
{
currentTab
.
value
=
index
;
if
(
currenStatus
.
value
!==
index
)
{
currentTab
.
value
=
index
;
getStatistics
();
}
};
const
statusList
=
[
'全部'
,
'附近可用'
,
'已使用'
,
'未使用'
];
// 子状态
const
statusList
=
[
'全部'
,
'已使用'
,
'未使用'
];
const
currenStatus
=
ref
(
0
);
const
changeStatus
=
(
index
)
=>
{
currenStatus
.
value
=
index
;
if
(
currenStatus
.
value
!==
index
)
{
currenStatus
.
value
=
index
;
getStatistics
();
}
};
/**
* 获取用户统计列表
*/
const
discountAmount
=
ref
(
0.00
);
const
getStatistics
=
async
()
=>
{
const
params
=
{
statuMain
:
currentTab
.
value
,
statuSon
:
currenStatus
.
value
,
};
const
res
=
await
userCouponStatisticsApi
(
params
);
if
(
res
.
code
===
0
)
{
discountAmount
.
value
=
res
.
data
;
}
};
getStatistics
();
/**
* 获取用户统计列表
*/
const
catalog
=
reactive
({
current
:
0
,
size
:
10
,
statuMain
:
0
,
statuSon
:
0
,
});
const
getCouponList
=
async
()
=>
{
catalog
.
statuMain
=
currentTab
.
value
;
catalog
.
statuSon
=
currenStatus
.
value
;
const
res
=
await
myCouponListApi
(
catalog
);
console
.
log
(
res
);
};
getCouponList
();
</
script
>
<
style
scoped
lang=
"scss"
>
...
...
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