Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
glsx
/
scrm-wx-merchant-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 4ba9eecf
authored
Jul 28, 2022
by
李伟康
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
提交代码
1 parent
5923c07f
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
13 deletions
src/api/wxConfig.js
src/main.js
src/views/crowdfunding/index.vue
src/api/wxConfig.js
View file @
4ba9eec
...
@@ -8,7 +8,6 @@ const WxConfig = {
...
@@ -8,7 +8,6 @@ const WxConfig = {
if
(
e
==
'chooseImage'
)
jsApiList
.
push
(
'getLocalImgData'
)
if
(
e
==
'chooseImage'
)
jsApiList
.
push
(
'getLocalImgData'
)
})
})
let
[
redirectUrl
]
=
window
.
location
.
href
.
split
(
'#'
)
let
[
redirectUrl
]
=
window
.
location
.
href
.
split
(
'#'
)
let
appId
=
util
.
getAppId
()
if
(
isWxWork
)
{
if
(
isWxWork
)
{
const
STORAGE_PARAMS
=
util
.
getLocalStorage
(
'wx_scrm_link_params'
)
const
STORAGE_PARAMS
=
util
.
getLocalStorage
(
'wx_scrm_link_params'
)
let
data
=
{
let
data
=
{
...
@@ -17,6 +16,9 @@ const WxConfig = {
...
@@ -17,6 +16,9 @@ const WxConfig = {
url
:
redirectUrl
,
url
:
redirectUrl
,
appCode
:
'DJQWGJ'
appCode
:
'DJQWGJ'
}
}
this
.
getWxConfig
(
jsApiList
).
then
(()
=>
{
console
.
log
(
'wxconfig'
)
wx
.
ready
(()
=>
{
window
.
$HTTP
({
window
.
$HTTP
({
url
:
'/rop-scrm-wechat/router'
,
url
:
'/rop-scrm-wechat/router'
,
data
data
...
@@ -30,11 +32,11 @@ const WxConfig = {
...
@@ -30,11 +32,11 @@ const WxConfig = {
signature
:
obj
.
signature
,
// 必填,签名,见附录-JS-SDK使用权限签名算法,
signature
:
obj
.
signature
,
// 必填,签名,见附录-JS-SDK使用权限签名算法,
jsApiList
:
[
'getContext'
,
...
jsApiList
],
jsApiList
:
[
'getContext'
,
...
jsApiList
],
success
(
res
)
{
success
(
res
)
{
console
.
log
(
res
,
'wx
_config'
)
console
.
log
(
res
,
'ww
_config'
)
resolve
()
resolve
()
},
},
fail
(
err
)
{
fail
(
err
)
{
console
.
log
(
err
,
'wx
_config'
)
console
.
log
(
err
,
'ww
_config'
)
reject
(
err
)
reject
(
err
)
}
}
})
})
...
@@ -42,12 +44,23 @@ const WxConfig = {
...
@@ -42,12 +44,23 @@ const WxConfig = {
Notify
(
'网络异常'
)
Notify
(
'网络异常'
)
}
}
})
})
})
})
}
else
{
}
else
{
return
window
.
$HTTP
({
return
this
.
getWxConfig
(
jsApiList
).
then
(()
=>
{
resolve
()
})
}
})
},
getWxConfig
(
jsApiList
)
{
let
[
redirectUrl
]
=
window
.
location
.
href
.
split
(
'#'
)
return
new
Promise
((
resolve
,
reject
)
=>
{
window
.
$HTTP
({
url
:
'/rop-scrm-equity/router'
,
url
:
'/rop-scrm-equity/router'
,
data
:
{
data
:
{
url
:
redirectUrl
,
url
:
redirectUrl
,
appI
d
,
appId
:
window
.
$fetchConfig
.
appi
d
,
method
:
'scrm.api.equity.common.wechat.jsconfig'
method
:
'scrm.api.equity.common.wechat.jsconfig'
}
}
}).
then
(
data
=>
{
}).
then
(
data
=>
{
...
@@ -67,8 +80,6 @@ const WxConfig = {
...
@@ -67,8 +80,6 @@ const WxConfig = {
Notify
(
'网络异常'
)
Notify
(
'网络异常'
)
}
}
})
})
}
})
})
},
},
ready
(
callBack
)
{
ready
(
callBack
)
{
...
...
src/main.js
View file @
4ba9eec
...
@@ -47,8 +47,8 @@ let body = document.getElementsByTagName('head')[0],
...
@@ -47,8 +47,8 @@ let body = document.getElementsByTagName('head')[0],
WXJDK
.
src
=
'//res.wx.qq.com/open/js/jweixin-1.6.0.js'
WXJDK
.
src
=
'//res.wx.qq.com/open/js/jweixin-1.6.0.js'
if
(
Boolean
(
ua
.
match
(
/MicroMessenger/i
))
&&
Boolean
(
ua
.
match
(
/wxwork/i
)))
{
//是否企微
if
(
Boolean
(
ua
.
match
(
/MicroMessenger/i
))
&&
Boolean
(
ua
.
match
(
/wxwork/i
)))
{
//是否企微
WXJDK
.
src
=
'//res.wx.qq.com/open/js/jweixin-1.2.0.js'
WXJDK
.
src
=
'//res.wx.qq.com/open/js/jweixin-1.2.0.js'
//
WWJDK.src = '//open.work.weixin.qq.com/wwopen/js/jwxwork-1.0.0.js'
WWJDK
.
src
=
'//open.work.weixin.qq.com/wwopen/js/jwxwork-1.0.0.js'
WWJDK
.
src
=
'//res.wx.qq.com/wwopen/js/jsapi/jweixin-1.0.0.js'
//
WWJDK.src = '//res.wx.qq.com/wwopen/js/jsapi/jweixin-1.0.0.js'
ISWXWORK
=
true
ISWXWORK
=
true
}
}
window
.
$ISWXWORK
=
ISWXWORK
window
.
$ISWXWORK
=
ISWXWORK
...
@@ -70,12 +70,10 @@ fetchConfig(!isMock).then(res => {
...
@@ -70,12 +70,10 @@ fetchConfig(!isMock).then(res => {
util
.
clearSessionId
()
util
.
clearSessionId
()
store
.
dispatch
(
'navigation'
)
store
.
dispatch
(
'navigation'
)
}
}
WXJDK
.
onload
=
function
()
{
window
.
vm
=
new
Vue
({
window
.
vm
=
new
Vue
({
el
:
'#app'
,
el
:
'#app'
,
router
,
router
,
store
,
store
,
render
:
h
=>
h
(
App
)
render
:
h
=>
h
(
App
)
})
})
}
})
})
src/views/crowdfunding/index.vue
View file @
4ba9eec
...
@@ -224,8 +224,8 @@ export default {
...
@@ -224,8 +224,8 @@ export default {
}
,
}
,
mounted
()
{
mounted
()
{
let
_this
=
this
let
_this
=
this
let
jsApiList
=
window
.
$ISWXWORK
?
[
'launchMiniprogram'
]
:
[
'updateAppMessageShareData'
]
let
jsApiList
=
[
'getLocation'
,
'openLocation'
,
'getNetworkType'
,
'onMenuShareAppMessage'
,
'launchMiniprogram'
,
'updateAppMessageShareData'
]
wxConfig
.
init
(
[
'getLocation'
,
'openLocation'
,
'getNetworkType'
,
'onMenuShareAppMessage'
,
...
jsApiList
]
).
then
(()
=>
{
wxConfig
.
init
(
jsApiList
).
then
(()
=>
{
wxConfig
.
ready
(()
=>
{
wxConfig
.
ready
(()
=>
{
this
.
getActivityDetail
()
this
.
getActivityDetail
()
}
)
}
)
...
...
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