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 31ce98f4
authored
Feb 24, 2022
by
xinla
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
--no commit message
1 parent
21fc1735
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
35 additions
and
42 deletions
linkwe-mobile/src/config.js
linkwe-mobile/src/utils/index.js
linkwe-mobile/src/views/authCallback.vue
linkwe-mobile/src/views/redPacket/index.vue
linkwe-mobile/src/views/redPacket/receive.vue
linkwe-taskMobile/src/js/utils.js
linkwe-mobile/src/config.js
View file @
31ce98f
const
config
=
{
/**
* @description token在Cookie中存储的天数,默认1天
*/
cookieExpires
:
1
,
/**
* @description 默认打开的首页的路由name值,默认为home
*/
homeName
:
'home'
,
}
config
.
services
=
{
wecom
:
'/wecom'
,
appId
:
'wx863c031a74f589a0'
,
// 微信公众号id
cookieExpires
:
1
,
//token在Cookie中存储的天数,默认1天
homeName
:
'home'
,
//默认打开的首页的路由name值,默认为home
services
=
{
wecom
:
'/wecom'
,
}
}
export
default
config
linkwe-mobile/src/utils/index.js
View file @
31ce98f
...
...
@@ -56,7 +56,7 @@ export function getQueryValue(name) {
return
''
}
export
function
getWxCode
()
{
export
async
function
getWxCode
()
{
let
userinfo
=
localStorage
.
getItem
(
'userinfo'
)
//取缓存中的用户信息
if
(
userinfo
)
{
...
...
@@ -86,13 +86,12 @@ export function getWxCode() {
// window.location.href =
// `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${appid}&redirect_uri=${encodeURIComponent(local)}&response_type=code&scope=snsapi_userinfo&state=1#wechat_redirect`;
}
// getUserOpenid(code)
// .then(({ data }) => {
// if (data && data.openId) {
// localStorage.setItem('userinfo', JSON.stringify(data))
// return getWechatUserInfo(data.openId)
// }
// })
let
{
data
}
=
getUserOpenid
(
code
)
if
(
data
&&
data
.
openId
)
{
localStorage
.
setItem
(
'userinfo'
,
JSON
.
stringify
(
data
))
return
data
.
openId
// return getWechatUserInfo(data.openId)
}
// .then(({ data }) => {
// let unionId = data.unionId
// })
...
...
linkwe-mobile/src/views/authCallback.vue
View file @
31ce98f
...
...
@@ -27,7 +27,7 @@ export default {
methods
:
{
getWxCode
()
{
try
{
let
appid
=
'wx863c031a74f589a0'
// 公众号appid
let
appid
=
window
.
CONFIG
.
appId
// 公众号appid
// let appid = 'wx8bfe6bc2ca5c45ae' // 公众号appid
alert
(
2
)
let
code
=
getQueryValue
(
'code'
)
//是否存在code
...
...
linkwe-mobile/src/views/redPacket/index.vue
View file @
31ce98f
<
script
>
import
{
getList
,
sendCustomerPersonalRedPacket
,
sendCustomerEnterpriseRedPacket
,
sendCustomerGroupPersonalRedPacket
,
sendCustomerGroupEnterpriseRedPacket
,
}
from
'@/api/redPacket.js'
import
{
getList
}
from
'@/api/redPacket.js'
import
{
obj2query
,
param2Obj
}
from
'@/utils/index.js'
export
default
{
name
:
''
,
...
...
@@ -85,6 +79,7 @@ export default {
wx
.
invoke
(
'getCurExternalContact'
,
{},
(
res
)
=>
{
if
(
res
.
err_msg
==
'getCurExternalContact:ok'
)
{
that
.
form
.
externalUserid
=
res
.
userId
//返回当前外部联系人userId
that
.
form
.
chatId
=
res
.
chatId
//返回当前客户群的群聊ID
}
else
{
//错误处理
that
.
$dialog
({
message
:
'进入失败:'
+
JSON
.
stringify
(
res
)
})
...
...
@@ -129,8 +124,8 @@ export default {
this
.
loadFail
=
true
})
},
showDialog
(
type
,
row
)
{
this
.
form
=
Object
.
assign
({
redEnvelopeAmount
:
row
.
money
},
row
||
{})
showDialog
(
type
,
row
=
{}
)
{
this
.
form
=
{
redEnvelopeAmount
:
row
.
money
,
redenvelopesId
:
row
.
id
}
this
.
redPacketType
=
type
this
.
visible
=
true
},
...
...
@@ -142,14 +137,13 @@ export default {
let
mes
=
{}
try
{
let
form
=
Object
.
assign
({},
this
.
form
)
form
.
sendUserId
=
this
.
userId
// 单位换算 元转分
form
.
redEnvelopeAmount
*=
100
let
query
=
param2Obj
(
window
.
location
.
search
)
let
hash
=
param2Obj
(
window
.
location
.
hash
)
Object
.
assign
(
form
,
{
sceneType
:
this
.
sceneType
,
redPacketType
:
this
.
redPacketType
},
{
s
endUserId
:
this
.
userId
,
s
ceneType
:
this
.
sceneType
,
redPacketType
:
this
.
redPacketType
},
query
,
hash
)
...
...
linkwe-mobile/src/views/redPacket/receive.vue
View file @
31ce98f
...
...
@@ -16,6 +16,12 @@ export default {
list
:
[],
opened
:
false
,
redPacket
:
{},
form
:
{
orderNo
:
''
,
// 订单id
openId
:
''
,
// 客户公众号id
appId
:
window
.
CONFIG
.
appId
,
// 微信公众号id
externalUserid
:
''
,
// 客户企微id
},
}
},
computed
:
{},
...
...
@@ -27,31 +33,31 @@ export default {
mounted
()
{},
methods
:
{
init
()
{
getWxCode
()
getWxCode
()
.
then
((
openId
)
=>
(
this
.
form
.
openId
=
openId
))
},
sendRedPacket
()
{
this
.
$toast
.
loading
({
duration
:
0
,
forbidClick
:
true
,
})
let
form
=
{}
let
query
=
param2Obj
(
window
.
location
.
search
)
let
hash
=
param2Obj
(
window
.
location
.
hash
)
Object
.
assign
(
form
,
query
,
hash
)
this
.
redPacket
=
form
Object
.
assign
(
query
,
hash
)
this
.
redPacket
=
query
this
.
form
.
externalUserid
=
query
.
externalUserid
let
request
=
''
if
(
form
.
sceneType
==
1
)
{
if
(
query
.
sceneType
==
1
)
{
request
=
{
personal
:
sendCustomerPersonalRedPacket
,
enterprise
:
sendCustomerEnterpriseRedPacket
,
}[
form
.
redPacketType
]
}[
query
.
redPacketType
]
}
else
{
request
=
{
personal
:
sendCustomerGroupPersonalRedPacket
,
enterprise
:
sendCustomerGroupEnterpriseRedPacket
,
}[
form
.
redPacketType
]
}[
query
.
redPacketType
]
}
request
(
form
).
then
((
res
)
=>
{
request
(
query
).
then
((
res
)
=>
{
this
.
$toast
.
clear
()
})
},
...
...
linkwe-taskMobile/src/js/utils.js
View file @
31ce98f
...
...
@@ -8,8 +8,8 @@ export function getUrlParam(name) {
return
null
}
export
function
getWxCode
()
{
let
appid
=
'wx863c031a74f589a0'
// 公众号appid
//
let appid = 'wx8bfe6bc2ca5c45ae' // 公众号appid
//
let appid = 'wx863c031a74f589a0' // 公众号appid
let
appid
=
'wx8bfe6bc2ca5c45ae'
// 公众号appid
let
code
=
getUrlParam
(
'code'
)
//是否存在code
let
local
=
window
.
location
.
origin
.
includes
(
'localhost'
)
?
'http://h5.linkwechat.cn/test.html'
...
...
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