Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
J
jz_Travel
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
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
zhengke
jz_Travel
Commits
ac611249
Commit
ac611249
authored
Feb 11, 2025
by
youjie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优惠券 领取中心
parent
0c6242aa
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
352 additions
and
159 deletions
+352
-159
flex.css
asset/css/flex.css
+3
-0
pages.json
pages.json
+7
-1
details.vue
pages/coupon/details/details.vue
+29
-19
list.vue
pages/coupon/list/list.vue
+289
-139
utils.js
plugin/utils.js
+24
-0
No files found.
asset/css/flex.css
View file @
ac611249
...
...
@@ -59,6 +59,9 @@
.items-center
{
align-items
:
center
;
}
.justify-center
{
justify-content
:
center
;
}
.flex1
,
.col
{
flex
:
1
;
}
...
...
pages.json
View file @
ac611249
...
...
@@ -203,7 +203,13 @@
{
"root"
:
"pages/coupon"
,
"pages"
:
[{
"path"
:
"list/list"
"path"
:
"list/list"
,
"style"
:
{
"navigationStyle"
:
"custom"
},
"globalStyle"
:
{
"navigationStyle"
:
"custom"
}
},
{
"path"
:
"details/details"
,
...
...
pages/coupon/details/details.vue
View file @
ac611249
...
...
@@ -46,11 +46,20 @@
<view
class=
"cdTiaojianBRight"
>
<view
class=
"cdTiaojianBRTitle"
>
使用说明
</view>
<view
class=
"cdTiaojianBRText"
>
券类型:
{{
g
.
couponsType
==
1
?
'抵用券'
:
'折扣券'
}}
</view>
<view
class=
"cdTiaojianBRText"
>
使用范围:
{{
g
.
couponsUseScopeName
}}
</view>
<view
class=
"cdTiaojianBRText"
>
使用范围:
<template
v-if=
"g.couponsUseScopeName"
>
{{
g
.
couponsUseScopeName
}}
</
template
>
<
template
v-if=
"g.couponsUseScope"
>
{{
g
.
couponsUseScope
}}
</
template
>
</view>
<view
class=
"cdTiaojianBRText"
v-if=
"g.remark&&g.remark!=''"
>
备注:{{ g.remark }}
</view>
</view>
</view>
<view
class=
"cdTiaojianButtom"
@
click=
"gouseUrl(g)"
>
立即使用
</view>
<view
class=
"cdTiaojianButtom"
v-if=
"type==1"
@
click=
"gouseUrl(g)"
>
立即使用
</view>
<view
class=
"cdTiaojianButtom"
v-else
@
click=
"g.couponReceiveCount==0?receive(g.couponReceiveCount):gouseUrl(g)"
>
{{ g.couponReceiveCount==0?'立即领取':'立即使用' }}
</view>
</view>
</view>
</template>
...
...
@@ -98,26 +107,27 @@
console
.
log
(
"this.g"
,
this
.
g
);
},
methods
:
{
receive
(
id
)
{
this
.
request2
({
url
:
'/api/AppletUser/GrantCoupon'
,
data
:
{
CouponId
:
id
}
},
(
res
)
=>
{
if
(
res
.
resultCode
==
1
)
{
uni
.
showToast
({
title
:
res
.
message
,
icon
:
"none"
});
this
.
g
.
IsReceive
=
1
;
}
receive
(
id
){
this
.
apipost
(
"b2c_post_CustomerGrantCoupon"
,
{
Id
:
id
},
(
res
)
=>
{
if
(
res
.
resultCode
==
1
)
{
uni
.
showToast
({
title
:
res
.
message
,
icon
:
"none"
});
this
.
g
.
couponReceiveCount
=
1
;
}
);
},
(
failed
)
=>
{
uni
.
showToast
({
title
:
failed
.
message
,
icon
:
"none"
,
});
},
(
error
)
=>
{
})
},
gouseUrl
(
g
)
{
uni
.
redirectTo
({
url
:
'/pages/index/index'
...
...
pages/coupon/list/list.vue
View file @
ac611249
This diff is collapsed.
Click to expand it.
plugin/utils.js
View file @
ac611249
...
...
@@ -148,6 +148,29 @@ function VersionUpdate() {
}
}
//方法二
function
formatDates
(
date
,
fmt
)
{
if
(
/
(
y+
)
/
.
test
(
fmt
))
{
fmt
=
fmt
.
replace
(
RegExp
.
$1
,
(
date
.
getFullYear
()
+
''
).
substr
(
4
-
RegExp
.
$1
.
length
));
}
let
o
=
{
'M+'
:
date
.
getMonth
()
+
1
,
'd+'
:
date
.
getDate
(),
'h+'
:
date
.
getHours
(),
'm+'
:
date
.
getMinutes
(),
's+'
:
date
.
getSeconds
()
};
for
(
let
k
in
o
)
{
if
(
new
RegExp
(
`(
${
k
}
)`
).
test
(
fmt
))
{
let
str
=
o
[
k
]
+
''
;
fmt
=
fmt
.
replace
(
RegExp
.
$1
,
(
RegExp
.
$1
.
length
===
1
)
?
str
:
padLeftZero
(
str
));
}
}
return
fmt
;
};
function
padLeftZero
(
str
)
{
return
(
'00'
+
str
).
substr
(
str
.
length
);
}
export
default
{
calcContentHeight
,
SystemInfo
,
...
...
@@ -157,4 +180,5 @@ export default {
SubscribeMsgAli
,
// #endif
VersionUpdate
,
formatDates
,
}
\ No newline at end of file
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