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 71cb1b4e
authored
Jun 22, 2022
by
张权
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
dev:0704定向礼包开发
1 parent
05ef3969
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
250 additions
and
54 deletions
src/api/giftApi.js
src/assets/images/icon/more.png
src/views/gift/create.vue
src/views/gift/detail.vue
src/views/gift/index.vue
src/api/giftApi.js
View file @
71cb1b4
...
...
@@ -2,7 +2,7 @@
const
url
=
'/rop-scrm-coupon/router'
const
pageSize
=
10
export
default
{
/**根据条件获取
定向礼包
列表(企微) */
/**根据条件获取
可发送
列表(企微) */
getGiftList
(
data
)
{
data
.
method
=
'scrm.api.coupon.weChat.directional.gift.list'
data
.
pageSize
=
pageSize
...
...
@@ -11,6 +11,24 @@ export default {
data
})
},
/**根据条件获取待完善发送列表(企微) */
getUnPerfectGiftList
(
data
)
{
data
.
method
=
'scrm.api.coupon.weChat.unPerfect.directional.gift.list'
data
.
pageSize
=
pageSize
return
window
.
$HTTP
({
url
,
data
})
},
/**根据条件获取已领取列表(企微) */
getReceivedGiftList
(
data
)
{
data
.
method
=
'scrm.api.coupon.weChat.user.directional.gift.list'
data
.
pageSize
=
pageSize
return
window
.
$HTTP
({
url
,
data
})
},
/** 获取审批中列表 */
getInApproveGiftList
(
data
)
{
data
.
method
=
'scrm.api.coupon.weChat.directional.gift.approve.in.list'
...
...
@@ -47,6 +65,17 @@ export default {
data
})
},
/**根据id获取定向礼包详情(企微) */
getUserGiftDetail
(
id
)
{
let
data
=
{
method
:
'scrm.api.coupon.weChat.user.directional.gift.detail'
,
id
}
return
window
.
$HTTP
({
url
,
data
})
},
/**定向礼包专用优惠券列表(嘀加后台和企微) */
getCouponList
(
data
)
{
data
.
method
=
'scrm.api.coupon.directional.gift.coupon.list'
...
...
src/assets/images/icon/more.png
0 → 100644
View file @
71cb1b4
202 Bytes
src/views/gift/create.vue
View file @
71cb1b4
...
...
@@ -7,6 +7,7 @@
<div
class=
"value"
>
<van-field
v-model=
"obj.name"
:disabled=
"disabledList.includes('name')"
input-align=
"right"
maxlength=
"15"
placeholder=
"请输入礼包名称"
...
...
@@ -23,6 +24,7 @@
<van-field
v-model=
"obj.remarkName"
input-align=
"right"
:disabled=
"disabledList.includes('remark')"
maxlength=
"30"
placeholder=
"可按车主姓名+手机号形式备注"
@
input=
"input"
...
...
@@ -60,14 +62,14 @@
数量:
x
{{
e
.
couponAmount
}}
<
div
class
=
"price"
>
¥
{{
centsToyuan
(
e
.
couponAnticipatedCost
*
e
.
couponAmount
)
}}
<
/div
>
<
/div
>
<
div
class
=
"del sprite-icon icon-gift-del"
@
click
=
"delCoupon(e)"
><
/div
>
<
div
class
=
"del sprite-icon icon-gift-del"
v
-
if
=
"!disabledList.includes('add')"
@
click
=
"delCoupon(e)"
><
/div
>
<
/div
>
<
/template>
<
/div
>
<
/template
>
<
/div
>
<
/template
>
<
div
:
class
=
"
[
'add-box text-center'
,{
'add-line'
:
obj
.
couponList
.
length
}
]
">
<
div
v
-
if
=
"!disabledList.includes('add')"
:
class
=
"
[
'add-box text-center'
,{
'add-line'
:
obj
.
couponList
.
length
}
]
">
<div
class="
add
-
btn
text
-
center
"
@click="
showGiftModal
"
...
...
@@ -142,6 +144,7 @@ export default {
return
{
flag
:
false
,
disabled
:
true
,
disabledList
:[],
obj
:
{
receiveWay
:
1
,
couponList
:
[]
...
...
@@ -156,12 +159,15 @@ export default {
}
}
,
mounted
()
{
let
{
id
}
=
this
.
getQuery
()
let
{
id
,
perfectFlag
}
=
this
.
getQuery
()
if
(
id
)
{
this
.
getDetail
(
id
)
this
.
id
=
id
}
else
this
.
flag
=
true
if
(
perfectFlag
==
2
){
this
.
disabledList
=
[
'name'
,
'remark'
,
'add'
]
}
wxConfig
.
init
([
'thirdPartyOpenPage'
,
'onHistoryBack'
])
}
,
methods
:
{
...
...
@@ -283,10 +289,14 @@ export default {
receiveWay
:
obj
.
receiveWay
,
giveReason
:
obj
.
giveReason
,
couponCreateRequests
,
receiveDetails
:
obj
.
receiveWay
==
1
?
obj
.
phone
:
obj
.
vin
stock
:
1
,
receiveDetailList
:
obj
.
receiveWay
==
1
?
obj
.
phone
:
obj
.
vin
}
if
(
id
){
params
.
id
=
id
params
.
approveFlag
=
obj
.
approveFlag
params
.
receiveRule
=
obj
.
receiveRule
params
.
stock
=
obj
.
stock
}
params
.
requestSource
=
2
this
.
showLoading
(
'提交中...'
)
...
...
src/views/gift/detail.vue
View file @
71cb1b4
...
...
@@ -77,11 +77,21 @@
<
/template
>
<
/div
>
<
/div
>
<
div
class
=
"box readonly-box"
>
<
div
class
=
"box readonly-box"
v
-
if
=
"obj.receiveRule!=3"
>
<
div
class
=
"title"
>
领取条件
<
/div
>
<
div
class
=
"item"
>
指定
{{
obj
.
receiveWay
==
1
?
'手机号'
:
'车架号'
}}
<
div
class
=
"value"
>
{{
obj
.
receiveDetails
}}
<
/div
>
<!--
<
div
:
class
=
"[perfectFlag==1?'tel-list-box':'item']"
>
-->
<
div
class
=
"tel-list-box"
>
<
span
class
=
"rule"
>
指定
{{
obj
.
receiveWay
==
1
?
'手机号'
:
'车架号'
}}
<
/span
>
<
div
class
=
"more-wrap"
:
style
=
"
{
'padding-bottom'
:(
!
showMoreTel
&&
receiveDetailList
.
length
>
6
)?
'30px'
:
'0'
}
">
<div class="
tel
-
list
" :style="
{
'height'
:(
showMoreTel
||
receiveDetailList
.
length
<
6
)?
'unset'
:
'48px'
}
">
<span class="
tel
" v-for="
(
telItem
,
idx
)
in
receiveDetailList
" :key="
idx
"
>
{{
telItem
}}
<
/span
>
<
/div
>
<
div
v
-
if
=
"!showMoreTel && receiveDetailList.length>6"
class
=
"more-btn"
@
click
.
stop
=
"showMoreTel=true"
>
展开全部
<
img
src
=
"../../assets/images/icon/more.png"
alt
=
""
>
<
/div
>
<
/div
>
<!--
<
div
v
-
else
class
=
"value"
>
{{
obj
.
receiveDetails
}}
<
/div> --
>
<
/div
>
<
/div
>
<
div
class
=
"box readonly-box"
>
...
...
@@ -127,12 +137,12 @@
<
/div
>
<
/div
>
<
/template
>
<
div
v
-
if
=
"obj.receivedFlag == 1 && approveStatus != 1"
class
=
"submit-btn"
>
<
div
v
-
if
=
"obj.receivedFlag == 1 && approveStatus != 1
&& tabIndex!=1
"
class
=
"submit-btn"
>
<
div
:
class
=
"
isShowApprovalDetail? '': 'white'"
class
=
"text-center sub-btn"
:
class
=
"
!isShowApprovalDetail&&perfectFlag == 0&&isSend!=1? 'white': ''"
class
=
"text-center sub-btn"
@
click
=
"changeGift"
>
修改
<
/div
>
<
div
v
-
if
=
"!isShowApprovalDetail"
>
{{
perfectFlag
==
0
?
'修改'
:
perfectFlag
==
1
?
'提交申请'
:
'去指定领取条件'
}}
<
/div
>
<
div
v
-
if
=
"!isShowApprovalDetail
&& perfectFlag == 0&&isSend!=1
"
class
=
"text-center sub-btn"
@
click
=
"pushApproval"
>
提交审批
<
/div
>
...
...
@@ -157,17 +167,26 @@ export default {
data
()
{
return
{
infoList
:[],
showMoreTel
:
false
,
receiveDetailList
:[],
flag
:
false
,
obj
:
{
}
,
total
:
0
,
lineHeight
:
0
,
approveStatus
:
0
,
isShowApprovalDetail
:
true
perfectFlag
:
0
,
isShowApprovalDetail
:
true
,
tabIndex
:
0
,
isSend
:
0
,
}
}
,
mounted
()
{
const
{
approveStatus
}
=
this
.
getQuery
()
const
{
approveStatus
,
perfectFlag
,
tabIndex
,
isSend
}
=
this
.
getQuery
()
this
.
approveStatus
=
approveStatus
this
.
perfectFlag
=
perfectFlag
||
0
//待完善跳过来,1是已完善信息未审批,2是未完善
this
.
tabIndex
=
tabIndex
||
0
//1是已领取 其他值不用管
this
.
isSend
=
isSend
||
0
//1是可发送 2是待完善
console
.
log
(
perfectFlag
,
this
.
perfectFlag
)
this
.
showLoading
()
this
.
getDetail
()
wxConfig
.
init
([
'thirdPartyOpenPage'
])
...
...
@@ -193,12 +212,14 @@ export default {
return
res
}
,
getDetail
()
{
let
{
id
}
=
this
.
getQuery
()
giftApi
.
getGiftDetail
(
id
).
then
(
res
=>
{
let
{
id
,
tabIndex
}
=
this
.
getQuery
()
let
API
=
tabIndex
==
1
?
giftApi
.
getUserGiftDetail
:
giftApi
.
getGiftDetail
API
(
id
).
then
(
res
=>
{
this
.
hideLoading
()
res
=
this
.
setCouponData
(
res
)
this
.
flag
=
true
this
.
obj
=
res
res
.
receiveDetails
&&
(
this
.
receiveDetailList
=
res
.
receiveDetails
.
split
(
','
))
if
(
res
.
approveUserInfo
==
null
&&
res
.
weChatOpenApprovalDataResponse
==
null
){
this
.
isShowApprovalDetail
=
false
}
...
...
@@ -243,7 +264,6 @@ export default {
}
}
)
}
)
}
)
}
,
pushApproval
(){
...
...
@@ -260,8 +280,16 @@ export default {
}
)
}
,
changeGift
()
{
let
{
id
}
=
this
.
getQuery
()
this
.
$router
.
replace
({
name
:
'gift.create'
,
query
:
{
id
}
}
)
let
{
id
,
perfectFlag
}
=
this
.
getQuery
()
if
(
perfectFlag
==
1
){
this
.
pushApproval
()
}
else
{
let
query
=
{
}
query
.
id
=
id
if
(
perfectFlag
==
2
)
query
.
perfectFlag
=
perfectFlag
this
.
$router
.
replace
({
name
:
'gift.create'
,
query
:
{
id
,
perfectFlag
}
}
)
}
}
,
setApprovalStatus
(
id
){
// 1-审批中;2-已同意;3-已驳回;4-已转审
...
...
@@ -297,6 +325,45 @@ export default {
<
style
scoped
lang
=
'scss'
>
@
import
'@/assets/css/gift-detail.scss'
;
.
tel
-
list
-
box
{
.
tel
,.
rule
{
font
-
size
:
14
px
;
font
-
family
:
PingFangSC
-
Regular
,
PingFang
SC
;
font
-
weight
:
400
;
color
:
#
333333
;
line
-
height
:
24
px
;
}
.
more
-
wrap
{
position
:
relative
;
.
tel
-
list
{
display
:
grid
;
grid
-
template
-
columns
:
1
fr
1
fr
1
fr
;
overflow
:
hidden
;
}
.
more
-
btn
{
position
:
absolute
;
left
:
50
%
;
bottom
:
0
;
transform
:
translateX
(
-
50
%
);
width
:
110
px
;
height
:
23
px
;
display
:
flex
;
align
-
items
:
center
;
justify
-
content
:
center
;
border
-
radius
:
12
px
;
border
:
1
px
solid
#
3975
C6
;
font
-
size
:
12
px
;
font
-
family
:
PingFangSC
-
Regular
,
PingFang
SC
;
font
-
weight
:
400
;
color
:
#
3975
C6
;
img
{
width
:
8
px
;
height
:
8
px
;
margin
-
left
:
5
px
;
}
}
}
}
.
submit
-
btn
{
z
-
index
:
3
;
position
:
fixed
;
...
...
src/views/gift/index.vue
View file @
71cb1b4
...
...
@@ -11,6 +11,12 @@
@
change=
"change"
ref=
"myTab"
/>
<div
class=
"secondary-tab"
v-if=
"tabIndex===0"
>
<div
class=
"tab-btn"
>
<span
class=
"tab-item"
:class=
"[activeTab ==1?'activeTab':'']"
@
click=
"setSecondTab(1)"
>
可发送
</span>
<span
class=
"tab-item"
:class=
"[activeTab ==2?'activeTab':'']"
@
click=
"setSecondTab(2)"
>
待完善发送
</span>
</div>
</div>
<template
v-if=
"flag"
>
<template
v-if=
"list.length"
>
<scroll-view
...
...
@@ -28,20 +34,24 @@
<van-swipe-cell>
<div
class=
"title flex"
>
{{
i
.
name
}}
<span
@
click
.
stop=
"send(i)"
>
发送
</span>
<span
v-if=
"activeTab==1"
@
click
.
stop=
"send(i)"
>
发送
</span>
</div>
<div
class=
"content"
>
<div
class=
"icon"
>
<div
class=
"sprite-icon icon-gift-bg"
></div>
</div>
<div
class=
"info"
>
<div
class=
"text"
>
指定领取
{{
i
.
receiveWay
==
1
?
'手机号'
:
'车架号'
}}
:
{{
i
.
receiveDetails
}}
</div>
<div
class=
"text-name"
><span
style=
"white-space:nowrap;"
>
备注名称:
</span><div
class=
"remark"
>
{{
i
.
remarkName
}}
</div></div>
<div
class=
"qr-text"
@
click
.
stop=
"createQr(i)"
>
领取二维码
</div>
<div
v-if=
"i.perfectFlag!=2"
class=
"text"
>
指定领取
{{
i
.
receiveWay
==
1
?
'手机号'
:
'车架号'
}}
:
{{
i
.
receiveDetails
||
'--'
}}
</div>
<div
v-if=
"i.perfectFlag!=2"
class=
"text-name"
><span
style=
"white-space:nowrap;"
>
备注名称:
</span><div
class=
"remark"
>
{{
i
.
remarkName
}}
</div></div>
<div
v-if=
"i.perfectFlag==2"
style=
"color:red;"
>
赠送给客户时需指定领取条件
</div>
<div
class=
"qr-text"
@
click
.
stop=
"createQr(i)"
>
{{
activeTab
==
1
?
'领取二维码'
:
i
.
perfectFlag
==
1
?
'申请赠送'
:
'去指定领取条件'
}}
</div>
</div>
</div>
<template
#
right
>
<div
class=
"remainNum"
style=
"display:flex;"
>
<span>
剩余礼包:
<span
style=
"color: #3975C6;"
>
{{
i
.
stock
-
i
.
receivedStock
}}
</span></span>
<span>
已领礼包:
{{
i
.
receivedStock
}}
</span>
</div>
<!--
<template
#
right
>
<van-button
square
type=
"danger"
...
...
@@ -49,7 +59,7 @@
@
click
.
stop=
"del(i)"
class=
"delete-button"
/>
</
template
>
</
template
>
-->
</van-swipe-cell>
</template>
<
template
v-if=
"tabIndex == 1"
>
...
...
@@ -75,7 +85,7 @@
</div>
<div
class=
"gift-box"
>
<div
class=
"title"
>
{{i.name}}
</div>
<div
class=
"text"
>
指定领取{{i.receiveWay == 1?'手机号':'车架号'}}:{{i.receiveDetail
s
}}
</div>
<div
class=
"text"
>
指定领取{{i.receiveWay == 1?'手机号':'车架号'}}:{{i.receiveDetail}}
</div>
<div
class=
"text"
>
备注名称:{{i.remarkName}}
</div>
</div>
<div
class=
"time flex"
>
{{new Date(i.receivedDate).format('yyyy-MM-dd hh:mm:ss')}}
</div>
...
...
@@ -148,7 +158,8 @@ export default {
name
:
''
,
data
()
{
return
{
tab
:
[
'待领取'
,
'已领取'
,
'审批中'
],
tab
:
[
'礼包中心'
,
'已领取'
,
'审批中'
],
activeTab
:
1
,
name
:
''
,
flag
:
false
,
tabIndex
:
0
,
...
...
@@ -182,6 +193,10 @@ export default {
wxConfig
.
init
([
'shareAppMessage'
,
'thirdPartyOpenPage'
])
},
methods
:
{
setSecondTab
(
val
){
this
.
activeTab
=
val
this
.
clearData
()
},
toAppprove
({
id
}){
giftApi
.
toApproveById
({
id
}).
then
(
res
=>
{
if
(
res
.
approveFlag
===
2
){
...
...
@@ -202,7 +217,7 @@ export default {
let
{
pageNum
,
tabIndex
,
list
,
name
,
giftToast
}
=
this
if
(
giftToast
)
this
.
giftToast
=
''
if
(
type
!==
'inApprove'
)
this
.
showLoading
()
const
apiFunc
=
(
type
===
'inApprove'
||
tabIndex
===
2
)
?
giftApi
.
getInApproveGiftList
:
giftApi
.
getGiftList
const
apiFunc
=
tabIndex
===
1
?
giftApi
.
getReceivedGiftList
:((
type
===
'inApprove'
||
tabIndex
===
2
)
?
giftApi
.
getInApproveGiftList
:
(
this
.
activeTab
==
1
?
giftApi
.
getGiftList
:
giftApi
.
getUnPerfectGiftList
))
apiFunc
({
pageNum
,
name
,
...
...
@@ -228,6 +243,9 @@ export default {
},
change
(
e
)
{
this
.
tabIndex
=
e
if
(
e
===
0
){
this
.
activeTab
=
1
}
this
.
clearData
()
},
clearData
()
{
...
...
@@ -261,12 +279,19 @@ export default {
this
.
getList
()
},
jump
(
item
)
{
const
params
=
{
id
:
item
.
id
}
const
params
=
{
id
:
item
.
id
,
tabIndex
:
this
.
tabIndex
}
if
(
this
.
tabIndex
==
2
){
params
.
approveStatus
=
item
.
approveStatus
}
else
{
params
.
approveStatus
=
0
}
if
(
this
.
tabIndex
==
0
){
if
(
this
.
activeTab
==
1
){
params
.
isSend
=
this
.
activeTab
}
else
{
params
.
perfectFlag
=
item
.
perfectFlag
}
}
this
.
$router
.
push
({
name
:
'gift.detail'
,
query
:
params
})
},
getMiniParams
(
e
)
{
...
...
@@ -305,22 +330,33 @@ export default {
})
},
createQr
(
e
)
{
const
{
envVersion
}
=
window
.
$fetchConfig
let
{
query
,
appId
}
=
this
.
getMiniParams
(
e
)
// 正式版为:release 体验版为:trial 开发版为:develop
giftApi
.
createQr
({
appId
,
path
:
'packageEquity/pages/directional/directional'
,
envVersion
,
scene
:
query
}).
then
(
img
=>
{
this
.
hideLoading
()
this
.
showQr
=
true
this
.
qr
=
{
name
:
e
.
name
,
img
if
(
this
.
activeTab
==
2
&&
e
.
perfectFlag
==
1
){
this
.
toAppprove
(
e
)
}
else
if
(
this
.
activeTab
==
2
&&
e
.
perfectFlag
==
2
){
let
params
=
{
id
:
e
.
id
,
perfectFlag
:
e
.
perfectFlag
}
})
this
.
$router
.
push
({
name
:
'gift.create'
,
query
:
params
})
}
else
{
const
{
envVersion
}
=
window
.
$fetchConfig
let
{
query
,
appId
}
=
this
.
getMiniParams
(
e
)
// 正式版为:release 体验版为:trial 开发版为:develop
giftApi
.
createQr
({
appId
,
path
:
'packageEquity/pages/directional/directional'
,
envVersion
,
scene
:
query
}).
then
(
img
=>
{
this
.
hideLoading
()
this
.
showQr
=
true
this
.
qr
=
{
name
:
e
.
name
,
img
}
})
}
}
}
}
...
...
@@ -332,8 +368,45 @@ export default {
color
:
#CDD1D4
;
}
}
.secondary-tab
{
width
:
100%
;
height
:
28px
;
padding
:
0
16px
;
margin-top
:
10px
;
box-sizing
:
border-box
;
.tab-btn{
background-color
:
#EBEFF5
;
border-radius
:
6px
;
height
:
100%
;
display
:
flex
;
align-items
:
center
;
padding
:
2px
;
.tab-item{
flex
:
1
;
width
:
168px
;
height
:
24px
;
text-align
:
center
;
color
:
#666666
;
font-size
:
14px
;
line-height
:
28px
;
border-radius
:
4px
;
font-weight
:
400
;
font-family
:
PingFangSC-Regular
,
PingFang
SC
;
border
:
1px
solid
#EBEFF5
;
}
.activeTab
{
background
:
#FFFFFF
;
box-shadow
:
0px
1px
2px
0px
rgba
(
94
,
97
,
102
,
0.2
);
border
:
1px
solid
rgba
(
0
,
0
,
0
,
0.04
);
font-weight
:
500
;
color
:
#3975C6
;
}
}
}
.list-box
{
height
:
calc
(
100vh
-
100px
);
height
:
calc
(
100vh
-
110px
);
margin-top
:
10px
;
padding
:
0
16px
16px
;
.item
{
background
:
#ffffff
;
box-shadow
:
0px
4px
8px
0px
rgba
(
224
,
224
,
224
,
0.5
);
...
...
@@ -349,7 +422,26 @@ export default {
}
}
.type-0
{
height
:
calc
(
100vh
-
148px
);
.item
{
.remainNum{
display
:
flex
;
justify-content
:
space-between
;
height
:
36px
;
padding
:
0
10px
;
align-items
:
center
;
border-top
:
1px
solid
rgba
(
195
,
195
,
195
,
0.3
);
span{
font-size
:
12px
;
font-family
:
PingFangSC-Regular
,
PingFang
SC
;
font-weight
:
400
;
color
:
#666666
;
line-height
:
16px
;
}
span
:last-child
{
color
:
#999
;
}
}
.delete-button
{
height
:
100%
;
}
...
...
@@ -383,9 +475,13 @@ export default {
font-size
:
12px
;
color
:
#999999
;
position
:
relative
;
width
:
calc
(
100%
-
90px
);
.text
{
line-height
:
16px
;
margin-bottom
:
8px
;
overflow
:
hidden
;
white-space
:
nowrap
;
text-overflow
:
ellipsis
;
}
.text-name
{
line-height
:
16px
;
...
...
@@ -399,19 +495,13 @@ export default {
}
.qr-text
{
position
:
absolute
;
lef
t
:
0
;
righ
t
:
0
;
bottom
:
0
;
padding
:
0
5px
;
height
:
22px
;
background
:
rgba
(
57
,
117
,
198
,
0.1
);
border-radius
:
11px
;
width
:
60px
;
font-size
:
12px
;
font-family
:
PingFangSC-Regular
,
PingFang
SC
;
font-weight
:
400
;
color
:
#3975C6
;
text-align
:
center
;
line-height
:
22px
;
}
}
...
...
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