Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas_plus
/
dj-car-life-h5-ailipay
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit b935c210
authored
Apr 18, 2022
by
李伟康
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
修改缓存
1 parent
8ebf22a7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
8 deletions
src/utils/util.js
src/views/coupon/index.vue
src/utils/util.js
View file @
b935c21
...
...
@@ -103,7 +103,6 @@ const dialog = (params = {}) => {
const
makePhoneCall
=
phoneNumber
=>
{
window
.
location
.
href
=
`tel://
${
phoneNumber
}
`
}
/**是否全面屏 */
const
isFullSucreen
=
()
=>
{
let
result
=
false
...
...
@@ -121,7 +120,7 @@ const jumpChildrenPage = (to, params) => {
const
setClipboardData
=
data
=>
{
wx
.
setClipboardData
({
data
,
success
(
res
)
{
success
(
res
)
{
Toast
(
'复制成功'
)
}
})
...
...
@@ -165,6 +164,27 @@ const watchPageBack = () => {
const
centsToyuan
=
price
=>
{
return
decimal
(
price
/
100
,
2
).
toFixed
(
2
)
}
/**设置cookie */
const
setCookie
=
(
c_name
,
value
,
expiredays
=
365
)
=>
{
let
exdate
=
new
Date
()
console
.
log
(
c_name
,
value
)
exdate
.
setDate
(
exdate
.
getDate
()
+
expiredays
)
document
.
cookie
=
c_name
+
'='
+
value
+
((
expiredays
==
null
)
?
''
:
';expires='
+
exdate
.
toGMTString
())
}
/**获取cookie */
const
getCookie
=
c_name
=>
{
if
(
document
.
cookie
.
length
>
0
)
{
let
c_start
=
document
.
cookie
.
indexOf
(
c_name
+
'='
)
if
(
c_start
!=
-
1
)
{
c_start
=
c_start
+
c_name
.
length
+
1
let
c_end
=
document
.
cookie
.
indexOf
(
';'
,
c_start
)
if
(
c_end
==
-
1
)
c_end
=
document
.
cookie
.
length
return
unescape
(
document
.
cookie
.
substring
(
c_start
,
c_end
))
}
}
return
''
}
const
utils
=
{
removeLocalStorage
,
setClipboardData
,
...
...
@@ -184,6 +204,8 @@ const utils = {
touchstart
,
showToast
,
getParams
,
setCookie
,
getCookie
,
getQuery
,
touchend
,
throttle
,
...
...
src/views/coupon/index.vue
View file @
b935c21
...
...
@@ -126,11 +126,11 @@ export default {
mounted
()
{
let
{
corpId
}
=
this
.
getQuery
()
if
(
!
corpId
)
corpId
=
this
.
getLocalStorage
(
'dj_scrm_corpId'
).
corpId
const
tomorrow
=
this
.
getLocalStorage
(
`coupon_tips_
${
corpId
}
`
)
const
couponModal
=
this
.
getLocalStorage
(
`coupon_modal_
${
corpId
}
`
)
const
now
=
new
Date
().
getTime
()
const
tomorrow
=
this
.
getLocalStorage
(
`tips_
${
corpId
}
`
)
const
couponModal
=
this
.
getLocalStorage
(
`modal_
${
corpId
}
`
)
this
.
corpId
=
corpId
if
(
tomorrow
)
this
.
showTips
=
now
>=
tomorrow
console
.
log
(
couponModal
,
tomorrow
,
corpId
)
if
(
tomorrow
)
this
.
showTips
=
new
Date
().
getTime
()
>=
tomorrow
this
.
showCouponModal
=
!
couponModal
},
methods
:
{
...
...
@@ -150,12 +150,12 @@ export default {
let
{
corpId
}
=
this
this
.
showTips
=
false
let
tomorrow
=
new
Date
(
`
${
new
Date
(
new
Date
().
setDate
(
new
Date
().
getDate
()
+
1
)).
format
(
'yyyy/MM/dd'
)}
00:00:00`
).
getTime
()
this
.
setLocalStorage
(
`
coupon_
tips_
${
corpId
}
`
,
tomorrow
)
this
.
setLocalStorage
(
`tips_
${
corpId
}
`
,
tomorrow
)
},
closeCouponModal
()
{
let
{
modalChecked
,
corpId
}
=
this
if
(
!
modalChecked
)
return
this
.
setLocalStorage
(
`
coupon_
modal_
${
corpId
}
`
,
true
)
this
.
setLocalStorage
(
`modal_
${
corpId
}
`
,
true
)
}
}
}
...
...
Write
Preview
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