Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
江名洋
/
linkwe-scrm
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 71f28655
authored
Mar 03, 2022
by
xinla
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
--no commit message
1 parent
4a89aaec
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
70 additions
and
23 deletions
linkwe-mobile/src/api/redPacket.js
linkwe-mobile/src/views/redPacket/receive.vue
linkwe-ui/.env.test
linkwe-mobile/src/api/redPacket.js
View file @
71f2865
...
@@ -123,6 +123,22 @@ export function receiveRedPacket(params) {
...
@@ -123,6 +123,22 @@ export function receiveRedPacket(params) {
}
}
/**
/**
* 校验客户是否已领取过红包
* @param {*}
{
"orderNo": "1494182309006471169", // 订单id
"openId": "76", // 客户公众号id
}
* @returns 返回true的时候客户已领取过红包,false客户未领取红包
*/
export
function
getReceiveStatus
(
params
)
{
return
request
({
url
:
service
+
'/checkRecevieRedEnvelopes'
,
params
,
})
}
/**
* 红包领取列表
* 红包领取列表
* @param {*}
* @param {*}
{
{
...
...
linkwe-mobile/src/views/redPacket/receive.vue
View file @
71f2865
<
script
>
<
script
>
import
{
receiveRedPacket
,
getReceiveList
,
getRedPacketInfo
}
from
'@/api/redPacket.js'
import
{
receiveRedPacket
,
getReceiveList
,
getRedPacketInfo
,
getReceiveStatus
,
}
from
'@/api/redPacket.js'
import
{
param2Obj
,
getWxCode
}
from
'@/utils/index.js'
import
{
param2Obj
,
getWxCode
}
from
'@/utils/index.js'
export
default
{
export
default
{
name
:
''
,
name
:
''
,
...
@@ -50,6 +55,7 @@ export default {
...
@@ -50,6 +55,7 @@ export default {
if
(
openId
)
{
if
(
openId
)
{
this
.
openId
=
openId
this
.
openId
=
openId
this
.
getRedPacketInfo
()
this
.
getRedPacketInfo
()
this
.
getReceiveStatus
()
}
else
{
}
else
{
this
.
$toast
.
clear
()
this
.
$toast
.
clear
()
}
}
...
@@ -65,8 +71,15 @@ export default {
...
@@ -65,8 +71,15 @@ export default {
Object
.
assign
(
query
,
hash
)
Object
.
assign
(
query
,
hash
)
this
.
redPacket
=
query
this
.
redPacket
=
query
Object
.
assign
(
this
.
redPacket
,
data
)
Object
.
assign
(
this
.
redPacket
,
data
)
})
this
.
$toast
.
clear
()
},
getReceiveStatus
()
{
let
form
=
{
orderNo
:
this
.
redPacket
.
orderId
,
// 订单id
openId
:
this
.
openId
,
// 客户公众号id
}
getReceiveStatus
(
form
).
then
(({
data
})
=>
{
data
&&
this
.
getReceiveList
(
true
)
})
})
},
},
receive
()
{
receive
()
{
...
@@ -85,33 +98,46 @@ export default {
...
@@ -85,33 +98,46 @@ export default {
chatId
:
this
.
redPacket
.
chatId
,
// 客户企微id
chatId
:
this
.
redPacket
.
chatId
,
// 客户企微id
externalUserid
:
this
.
redPacket
.
externalUserid
,
// 客户企微id
externalUserid
:
this
.
redPacket
.
externalUserid
,
// 客户企微id
}
}
receiveRedPacket
(
form
)
receiveRedPacket
(
form
).
then
((
data
)
=>
{
.
then
((
data
)
=>
{
if
(
data
.
code
===
200
)
{
if
(
data
.
code
===
200
)
{
return
this
.
getReceiveList
()
return
getReceiveList
(
form
)
}
else
{
}
else
{
this
.
errorMsg
=
data
.
msg
this
.
errorMsg
=
data
.
msg
this
.
$toast
.
clear
()
this
.
$toast
.
clear
()
// return Promise.reject()
return
Promise
.
reject
()
}
}
})
},
getReceiveList
(
isOpened
)
{
let
form
=
{
orderNo
:
this
.
redPacket
.
orderId
,
// 订单id
openId
:
this
.
openId
,
// 客户公众号id
appId
:
window
.
CONFIG
.
appId
,
// 微信公众号id
chatId
:
this
.
redPacket
.
chatId
,
// 客户群企微id
externalUserid
:
this
.
redPacket
.
externalUserid
,
// 客户企微id
}
getReceiveList
(
form
).
then
(({
data
})
=>
{
data
.
currentAcceptMoney
/=
100
data
.
totalMoney
/=
100
data
.
accpectMoney
/=
100
data
.
accpestCustomerList
.
forEach
((
element
)
=>
{
element
.
accpectMoney
/=
100
})
})
.
then
(({
data
})
=>
{
this
.
$toast
.
clear
()
data
.
currentAcceptMoney
/=
100
data
.
totalMoney
/=
100
if
(
isOpened
)
{
data
.
accpectMoney
/=
100
this
.
opened
=
true
data
.
accpestCustomerList
.
forEach
((
element
)
=>
{
Object
.
assign
(
this
.
redPacket
,
data
)
element
.
accpectMoney
/=
100
}
else
{
})
this
.
$refs
.
audio
.
play
()
this
.
$refs
.
audio
.
play
()
this
.
$toast
.
clear
()
this
.
animate
=
true
this
.
animate
=
true
setTimeout
(()
=>
{
setTimeout
(()
=>
{
this
.
opened
=
true
this
.
opened
=
true
Object
.
assign
(
this
.
redPacket
,
data
)
Object
.
assign
(
this
.
redPacket
,
data
)
},
1500
)
},
1500
)
})
}
})
},
},
dateFormat
(
value
)
{
dateFormat
(
value
)
{
return
value
.
substring
(
0
,
19
).
replace
(
/
[
T
]
/g
,
' '
)
return
value
.
substring
(
0
,
19
).
replace
(
/
[
T
]
/g
,
' '
)
},
},
...
...
linkwe-ui/.env.test
View file @
71f2865
# 测试环境配置
# 测试环境配置
ENV = 'test'
# 打包环境变量
NODE_ENV = 'production'
# 运行环境变量
VUE_APP_ENV = 'test'
# 基础api
# 基础api
VUE_APP_DOMAIN = 'http://demo.linkwechat.cn'
VUE_APP_DOMAIN = 'http://demo.linkwechat.cn'
...
...
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