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
f4e8146e
Commit
f4e8146e
authored
Aug 14, 2024
by
彭佳妮(贵阳日报)
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优惠券页面登录
parent
37b3f92c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
2 deletions
+26
-2
ticket.vue
src/pages/ticket/ticket.vue
+26
-2
No files found.
src/pages/ticket/ticket.vue
View file @
f4e8146e
...
...
@@ -121,10 +121,21 @@
<
script
setup
>
import
{
myCouponListApi
,
userCouponStatisticsApi
}
from
'@/api/ticket'
;
import
{
signIn
}
from
'@/utils/signIn'
;
import
Header
from
'@/pages/order/components/Header/index.vue'
;
import
testJson
from
'@/static/json/test.json'
;
import
{
getTokenUser
}
from
'@/api/index'
;
import
{
getToken
}
from
'@/utils/auth'
;
const
fileDomain
=
import
.
meta
.
env
.
VITE_APP_IMG_URL
;
onLoad
(
async
()
=>
{
if
(
!
getToken
())
await
signIn
();
// if (!getToken()) await signIn2();
getStatistics
();
getCouponList
();
});
// 优惠券状态 0:失效 2:已使用,3-未使用
const
iconUrl
=
ref
({
0
:
'@/static/ticket/past-icon.png'
,
...
...
@@ -173,7 +184,6 @@ const getStatistics = async () => {
discountAmount
.
value
=
res
.
data
;
}
};
getStatistics
();
/**
* 获取用户优惠券列表
...
...
@@ -213,7 +223,21 @@ const getCouponList = async () => {
// state.value = 'finished';
xma
.
hideLoading
();
};
getCouponList
();
// 登录
const
signIn2
=
()
=>
{
xma
.
showLoading
({
title
:
'加载中'
,
mask
:
true
,
});
return
getTokenUser
(
testJson
).
then
((
res
)
=>
{
const
token
=
res
.
data
.
access_token
;
const
userInfo
=
res
.
data
.
user_info
;
xma
.
setStorageSync
(
'Authorization'
,
token
);
xma
.
setStorageSync
(
'userInfo'
,
userInfo
);
console
.
log
(
'登录...'
);
});
};
// 下拉刷新
onPullDownRefresh
(()
=>
{
...
...
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