Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
glsx
/
dj-scrm-wx-work-attachment-activity
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 ebe0c4e7
authored
Nov 11, 2021
by
liwk
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
commit
1 parent
50db7b42
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
141 additions
and
70 deletions
src/api/boutiquecouponApi.js
src/assets/css/sprite.scss
src/components/Poster.vue
src/components/SearchBox.vue
src/components/Share.vue
src/components/VipDialog.vue
src/plugins/vant.js
src/store/modules/app.js
src/utils/util.js
src/views/coupon/verificationList.vue
src/api/boutiquecouponApi.js
View file @
ebe0c4e
...
...
@@ -19,4 +19,13 @@ export default {
data
})
},
/** 分页查询用户券列表(待核销、已核销) */
getCustomerCouponList
(
data
)
{
data
.
method
=
'scrm.api.boutiquecoupon.wework.customerCoupon.page'
data
.
pageSize
=
10
return
window
.
$HTTP
({
url
,
data
})
},
}
\ No newline at end of file
src/assets/css/sprite.scss
View file @
ebe0c4e
.sprite-icon
{
background-image
:
url(../images/sprite.png)
;
background-size
:
250px
212px
;}
.icon-coupon-0
{
width
:
32px
;
height
:
32px
;
background-position
:
0px
-180px
;}
.icon-coupon-1
{
width
:
32px
;
height
:
32px
;
background-position
:
-42px
-180px
;}
.icon-coupon-lose
{
width
:
70px
;
height
:
70px
;
background-position
:
-180px
0px
;}
.icon-coupon-success
{
width
:
70px
;
height
:
70px
;
background-position
:
-180px
-80px
;}
.icon-coupon
{
width
:
80px
;
height
:
80px
;
background-position
:
0px
0px
;}
.icon-discount
{
width
:
80px
;
height
:
80px
;
background-position
:
-90px
0px
;}
.icon-down
{
width
:
12px
;
height
:
12px
;
background-position
:
-170px
-180px
;}
.icon-exchange
{
width
:
80px
;
height
:
80px
;
background-position
:
0px
-90px
;}
.icon-poster-close
{
width
:
20px
;
height
:
20px
;
background-position
:
-84px
-180px
;}
.icon-share
{
width
:
20px
;
height
:
20px
;
background-position
:
-114px
-180px
;}
.icon-vip
{
width
:
80px
;
height
:
80px
;
background-position
:
-90px
-90px
;}
.icon-scan
{
width
:
16px
;
height
:
16px
;
background-position
:
-144px
-180px
;}
.icon-coupon-0
{
width
:
32px
;
height
:
32px
;
background-position
:
0px
-180px
;}
.icon-coupon-1
{
width
:
32px
;
height
:
32px
;
background-position
:
-42px
-180px
;}
.icon-coupon-lose
{
width
:
70px
;
height
:
70px
;
background-position
:
-180px
0px
;}
.icon-coupon-success
{
width
:
70px
;
height
:
70px
;
background-position
:
-180px
-80px
;}
\ No newline at end of file
.icon-share
{
width
:
20px
;
height
:
20px
;
background-position
:
-114px
-180px
;}
.icon-vip
{
width
:
80px
;
height
:
80px
;
background-position
:
-90px
-90px
;}
\ No newline at end of file
src/components/Poster.vue
View file @
ebe0c4e
<
template
>
<van-overlay
:show=
"show"
z-index=
"
2013
"
z-index=
"
9999999
"
>
<div
class=
"wrapper"
...
...
@@ -13,7 +13,7 @@
@
click
.
prevent=
"close"
></div>
<van-image
:src=
"
img ||
activityData.posterUrl"
:src=
"activityData.posterUrl"
width=
"100%"
height=
"100%"
>
...
...
@@ -40,7 +40,6 @@
</template>
<
script
type=
'text/ecmascript-6'
>
import
{
shopmallApi
}
from
'@/api'
export
default
{
name
:
'Poster'
,
props
:
[
'value'
,
'apiName'
,
'currentItem'
,
'activityData'
],
...
...
@@ -55,9 +54,6 @@ export default {
watch
:
{
'value'
(
n
)
{
this
.
show
=
n
if
(
n
)
{
if
(
this
.
apiName
==
'shopmallApi'
)
this
.
getGoodsPoster
(
this
.
currentItem
.
id
)
}
},
},
methods
:
{
...
...
@@ -80,13 +76,6 @@ export default {
this
.
showToast
(
'发送成功'
)
})
},
getGoodsPoster
(
id
)
{
this
.
img
=
''
shopmallApi
.
getGoodsPoster
({
id
}).
then
(
res
=>
{
console
.
log
(
res
)
this
.
img
=
res
})
}
}
}
...
...
src/components/SearchBox.vue
View file @
ebe0c4e
...
...
@@ -21,9 +21,9 @@
<
script
type=
'text/ecmascript-6'
>
export
default
{
name
:
'SearchBox'
,
props
:
[
'keyword'
],
data
()
{
return
{
keyword
:
''
,
value
:
0
,
option
:
[
{
text
:
'优惠券'
,
value
:
0
},
...
...
src/components/Share.vue
View file @
ebe0c4e
...
...
@@ -78,6 +78,12 @@ export default {
url
:
data
}
})
shopmallApi
.
getGoodsPoster
({
id
}).
then
(
res
=>
{
console
.
log
(
res
)
this
.
activityData
=
{
posterUrl
:
res
}
})
}
this
.
showShare
=
true
}
...
...
@@ -141,6 +147,7 @@ export default {
this
.
showPoster
=
true
break
;
case
3
:
let
{
id
}
=
currentItem
this
.
showLoading
()
if
(
apiName
==
'shopmallApi'
)
{
let
{
activityData
}
=
this
...
...
@@ -150,11 +157,15 @@ export default {
}
else
if
(
apiName
==
'liveApi'
)
{
this
.
setClipboardData
(
activityData
.
pagePath
)
}
else
if
(
apiName
==
'couponApi'
)
{
this
.
couponShare
(
currentItem
.
id
,
0
,
3
)
this
.
couponShare
(
currentItem
,
0
,
3
)
}
else
if
(
apiName
==
'boutiquecouponApi'
)
{
this
.
getBoutiqueCoupon
(
currentItem
.
id
,
res
=>
{
this
.
getBoutiqueCoupon
(
id
,
res
=>
{
this
.
setClipboardData
(
res
)
})
}
else
{
equityApi
.
getEquityShared
({
id
}).
then
(
res
=>
{
this
.
setClipboardData
(
res
.
url
)
})
}
break
;
}
...
...
@@ -213,8 +224,4 @@ export default {
.van-share-sheet__option.disabled
{
opacity
:
0.5
;
}
.share
{
position
:
relative
;
z-index
:
2003
;
}
</
style
>
\ No newline at end of file
src/components/VipDialog.vue
View file @
ebe0c4e
...
...
@@ -26,7 +26,7 @@
<template
v-if=
"i.effectiveType == 1"
>
有效期:
{{
i
.
effectiveDays
}}
天
</
template
>
<
template
v-if=
"i.effectiveType == 2"
>
<
template
v-
else-
if=
"i.effectiveType == 2"
>
有效期:
{{
new
Date
(
i
.
effectiveStartTime
).
format
(
'yyyy-MM-dd'
)
}}
~
{{
new
Date
(
i
.
effectiveEndTime
).
format
(
'yyyy-MM-dd'
)
}}
</
template
>
<
template
v-else
>
...
...
src/plugins/vant.js
View file @
ebe0c4e
...
...
@@ -14,8 +14,6 @@ import {
Tabbar
,
TabbarItem
,
NavBar
,
Lazyload
,
Toast
,
Search
,
ActionSheet
,
CellGroup
,
...
...
src/store/modules/app.js
View file @
ebe0c4e
...
...
@@ -84,25 +84,26 @@ const actions = {
util
.
setLocalStorage
(
'dj_scrm_accountList'
,
data
.
loginList
)
let
redirect_uri
=
encodeURI
(
`
${
redirectUrl
}${
route
}
`
)
console
.
log
(
data
)
//先注释 window.location.replace(`${url}common/accountList?redirect_uri=${redirect_uri}`)
// 先注释
window
.
location
.
replace
(
`
${
url
}
common/accountList?redirect_uri=
${
redirect_uri
}
`
)
//以下是 本地调试多账号
let
userInfo
=
data
.
loginList
[
1
]
let
{
merchantId
,
accountName
}
=
userInfo
let
loginAccount
=
accountName
ssoApi
.
selectAccount
({
loginAccount
,
merchantId
,
loginToken
:
data
.
loginToken
,
loginSource
:
'WW'
,
loginType
:
3
}).
then
(
res
=>
{
util
.
removeLocalStorage
(
'dj_scrm_loginToken'
)
util
.
removeLocalStorage
(
'dj_scrm_accountList'
)
util
.
setLocalStorage
(
'dj_scrm_userInfo'
,
res
.
data
)
util
.
setSessionId
(
res
.
data
.
sessionId
)
dispatch
(
'registerHttp'
,
res
.
data
.
sessionId
)
window
.
location
.
replace
(
`
${
url
}${
route
}
`
)
})
//
let userInfo = data.loginList[1]
//
let { merchantId, accountName } = userInfo
//
let loginAccount = accountName
//
ssoApi.selectAccount({
//
loginAccount,
//
merchantId,
//
loginToken: data.loginToken,
//
loginSource: 'WW',
//
loginType: 3
//
}).then(res => {
//
util.removeLocalStorage('dj_scrm_loginToken')
//
util.removeLocalStorage('dj_scrm_accountList')
//
util.setLocalStorage('dj_scrm_userInfo', res.data)
//
util.setSessionId(res.data.sessionId)
//
dispatch('registerHttp', res.data.sessionId)
//
window.location.replace(`${url}${route}`)
//
})
}
else
{
let
[
userInfo
]
=
data
.
loginList
util
.
setLocalStorage
(
'dj_scrm_userInfo'
,
userInfo
)
...
...
src/utils/util.js
View file @
ebe0c4e
...
...
@@ -129,7 +129,7 @@ const setClipboardData = data => {
if
(
document
.
execCommand
(
'copy'
))
document
.
execCommand
(
'copy'
)
hideLoading
()
transfer
.
blur
()
Toast
(
'
内容已复制
'
)
Toast
(
'
复制成功
'
)
document
.
body
.
removeChild
(
transfer
)
}
...
...
@@ -156,6 +156,9 @@ const toTop = () => {
const
getParams
=
()
=>
{
return
window
.
vm
.
$route
.
params
}
const
getQuery
=
()
=>
{
return
window
.
vm
.
$route
.
query
}
const
watchPageBack
=
()
=>
{
return
new
Promise
(
resolve
=>
{
if
(
window
.
$back
)
{
...
...
@@ -183,6 +186,7 @@ const utils = {
touchstart
,
showToast
,
getParams
,
getQuery
,
touchend
,
throttle
,
decimal
,
...
...
src/views/coupon/verificationList.vue
View file @
ebe0c4e
...
...
@@ -3,14 +3,13 @@
<search-box
@
change=
"changeType"
@
search=
"search"
:keyword=
"userName"
></search-box>
<template
v-if=
"type == 0"
>
<tab
:list=
"tab"
@
change=
"change"
:updata=
"updata"
/>
</
template
>
<tab
:list=
"type == 0?tab:tab2"
@
change=
"change"
:updata=
"updata"
/>
<template
v-if=
"flag"
>
<template
v-if=
"list.length"
>
<scroll-view
...
...
@@ -24,21 +23,31 @@
class=
"item"
>
<div
class=
"title flex"
>
{{
item
.
userName
}}
{{
item
.
userName
||
item
.
customerName
}}
<div
class=
"time"
>
<template
v-if=
"tabIndex == 0"
>
核销时间:
{{
new
Date
(
item
.
verificationTime
).
format
(
'yyyy/MM/dd'
)
}}
</
template
>
<
template
v-else-if=
"tabIndex == 1"
>
领取时间:
{{
new
Date
(
item
.
receiveTime
).
format
(
'yyyy/MM/dd'
)
}}
<template
v-if=
"type == 0"
>
<template
v-if=
"tabIndex == 0"
>
核销时间:
{{
new
Date
(
item
.
verificationTime
).
format
(
'yyyy/MM/dd'
)
}}
</
template
>
<
template
v-else-if=
"tabIndex == 1"
>
领取时间:
{{
new
Date
(
item
.
receiveTime
).
format
(
'yyyy/MM/dd'
)
}}
</
template
>
<
template
v-else
>
发放时间:
{{
new
Date
(
item
.
issueDate
).
format
(
'yyyy/MM/dd'
)
}}
</
template
>
</template>
<
template
v-else
>
发放时间:
{{
new
Date
(
item
.
issueDate
).
format
(
'yyyy/MM/dd'
)
}}
<template
v-if=
"tabIndex == 0"
>
核销时间:
{{
new
Date
(
item
.
usedTime
).
format
(
'yyyy/MM/dd'
)
}}
</
template
>
<
template
v-else
>
领券时间:
{{
new
Date
(
item
.
createdDate
).
format
(
'yyyy/MM/dd'
)
}}
</
template
>
</template>
</div>
</div>
<div
class=
"info"
>
<
template
v-for=
"(i,ind) in
itemObj
"
>
<
template
v-for=
"(i,ind) in
type == 0?itemObj:itemObj2
"
>
<div
:key=
"ind"
class=
"li flex"
...
...
@@ -55,10 +64,13 @@
<div
:class=
"['sprite-icon','coupon-icon',`icon-coupon-$
{item.discountType== 4?1:0}`]">
</div>
</
template
>
<
template
v-else
>
<div
:class=
"['sprite-icon','coupon-icon',`icon-coupon-success`]"
></div>
<template
v-if=
"tabIndex == 0"
>
<div
:class=
"['sprite-icon','coupon-icon',item.upgradeFlag == 'Y'?'icon-coupon-success':'icon-coupon-lose']"
></div>
</
template
>
</template>
</div>
</div>
</template>
</scroll-view>
</template>
...
...
@@ -74,11 +86,17 @@
<div
class=
"sprite-icon icon-scan"
></div>
扫码核销
</div>
<div
class=
"tips text-center"
v-if=
"type == 0 && tabIndex == 2"
>
仅从聊天侧边栏发送优惠券,可查看未领取记录
</div>
</div>
</template>
<
script
type=
'text/ecmascript-6'
>
import
{
couponApi
,
wxConfig
}
from
'@/api'
import
{
couponApi
,
boutiquecouponApi
,
wxConfig
}
from
'@/api'
const
itemObj
=
[
{
label
:
'券名'
,
...
...
@@ -87,9 +105,6 @@ const itemObj = [
{
label
:
'发放人'
,
key
:
'issueName'
,
// format () {
// return '<span class=\"text-hide w84\">好借好还好借好还好借好还</span><b class=\"line\"></b><span class=\"text-hide w66\">恒河猴</span>'
// }
},
{
label
:
'核销人'
,
...
...
@@ -101,6 +116,7 @@ export default {
data
()
{
return
{
tab
:
[
''
,
''
,
''
],
tab2
:
[
''
,
''
],
list
:
[],
updata
:
new
Date
().
getTime
(),
tabIndex
:
0
,
...
...
@@ -109,7 +125,21 @@ export default {
itemObj
,
total
:
0
,
flag
:
false
,
userName
:
''
userName
:
''
,
itemObj2
:
[
{
label
:
'券名'
,
key
:
'couponName'
},
{
label
:
'发放人'
,
key
:
'employeeName'
,
},
{
label
:
'核销人'
,
key
:
'sellerName'
,
}
]
}
},
mounted
()
{
...
...
@@ -123,6 +153,8 @@ export default {
this
.
getVerificationList
()
this
.
getUserCouponList
(
0
,
false
)
this
.
getUserCouponList
(
1
,
false
)
this
.
getCustomerCouponList
(
'Y'
,
false
)
this
.
getCustomerCouponList
(
'N'
,
false
)
},
search
(
e
)
{
this
.
userName
=
e
...
...
@@ -136,6 +168,8 @@ export default {
changeType
(
e
)
{
this
.
showLoading
()
this
.
type
=
e
this
.
updata
=
new
Date
().
getTime
()
this
.
userName
=
''
this
.
clearData
()
},
clearData
()
{
...
...
@@ -152,7 +186,7 @@ export default {
if
(
tabIndex
==
0
)
this
.
getVerificationList
()
else
this
.
getUserCouponList
(
tabIndex
==
1
?
1
:
0
)
}
else
{
this
.
getCustomerCouponList
(
tabIndex
==
0
?
'Y'
:
'N'
)
}
},
getVerificationList
()
{
...
...
@@ -187,6 +221,25 @@ export default {
})
},
/**精品礼券 */
getCustomerCouponList
(
usedFlag
,
setDate
=
true
)
{
let
{
list
,
pageNum
,
userName
}
=
this
boutiquecouponApi
.
getCustomerCouponList
({
currentPage
:
pageNum
,
customerName
:
userName
,
usedFlag
}).
then
(
res
=>
{
console
.
log
(
res
)
if
(
setDate
)
{
this
.
list
=
list
.
concat
(
res
.
list
)
this
.
flag
=
true
}
if
(
usedFlag
==
'Y'
)
{
this
.
tab2
[
0
]
=
`已核销(
${
res
.
total
}
)`
}
else
{
this
.
tab2
[
1
]
=
`待核销(
${
res
.
total
}
)`
}
this
.
updata
=
new
Date
().
getTime
()
this
.
total
=
res
.
total
this
.
hideLoading
()
})
},
onReachBottom
()
{
let
{
total
,
pageNum
,
list
}
=
this
this
.
$refs
.
scrollView
.
loading
=
false
...
...
@@ -294,4 +347,14 @@ export default {
margin-right
:
8px
;
}
}
.tips
{
width
:
100%
;
height
:
24px
;
background
:
rgba
(
88
,
80
,
255
,
0.7
);
position
:
fixed
;
bottom
:
0
;
left
:
0
;
color
:
#fff
;
font-size
:
12px
;
}
</
style
>
\ No newline at end of file
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