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 17d67254
authored
Aug 22, 2022
by
李伟康
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
同步短链代码
1 parent
c49945ba
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
6 deletions
src/main.js
src/views/crowdfunding/components/Action.vue
src/main.js
View file @
17d6725
...
...
@@ -44,7 +44,8 @@ let body = document.getElementsByTagName('head')[0],
WXJDK
=
document
.
createElement
(
'script'
),
WWJDK
=
document
.
createElement
(
'script'
),
ISWXWORK
=
false
,
IsIOS
=
/
(
iPhone|iPad|iPod|iOS
)
/i
.
test
(
navigator
.
userAgent
)
IsIOS
=
/
(
iPhone|iPad|iPod|iOS
)
/i
.
test
(
navigator
.
userAgent
),
ISMiniprogram
=
window
.
__wxjs_environment
===
'miniprogram'
WXJDK
.
src
=
'//res.wx.qq.com/open/js/jweixin-1.2.0.js'
if
(
Boolean
(
ua
.
match
(
/MicroMessenger/i
))
&&
Boolean
(
ua
.
match
(
/wxwork/i
)))
{
//是否企微
// WXJDK.src = '//res.wx.qq.com/open/js/jweixin-1.2.0.js'
...
...
@@ -59,6 +60,8 @@ body.appendChild(WXJDK)
if
(
WWJDK
.
src
)
body
.
appendChild
(
WWJDK
)
window
.
$IsIOS
=
IsIOS
Vue
.
prototype
.
IsIOS
=
IsIOS
window
.
$ISMiniprogram
=
ISMiniprogram
Vue
.
prototype
.
ISMiniprogram
=
ISMiniprogram
const
isMock
=
[
'prod'
,
'production'
].
includes
(
process
.
env
.
NODE_ENV
)
fetchConfig
(
!
isMock
).
then
(
res
=>
{
// 从配置服务器获取动态配置
...
...
src/views/crowdfunding/components/Action.vue
View file @
17d6725
...
...
@@ -16,7 +16,7 @@
<span
class=
"unit"
>
¥
</span>
{{
detail
.
price
}}
<span>
.
{{
detail
.
decimal
}}
</span>
</div>
<div
:class=
"['btn text-center',
{'disabled': detail.activityStatus == 3 || detail.buyFlag == 2},{'short':detail.buyFlag == 3}]"
:class=
"['btn text-center',
{'disabled':
iSMiniprogram ||
detail.activityStatus == 3 || detail.buyFlag == 2},{'short':detail.buyFlag == 3}]"
@click="submit"
@touchstart="touchstart"
@touchend="touchend"
...
...
@@ -125,14 +125,20 @@ export default {
formList
:
[],
payStatus
:
Date
.
now
(),
posterImg
:
''
,
carInfo
:
{}
carInfo
:
{},
iSMiniprogram
:
true
}
},
mounted
()
{
this
.
iSMiniprogram
=
window
.
__wxjs_environment
===
'miniprogram'
},
methods
:
{
submit
()
{
let
{
detail
}
=
this
let
{
detail
,
iSMiniprogram
}
=
this
if
(
iSMiniprogram
)
{
this
.
showToast
(
'参团请拨打短信中咨询热线'
)
return
}
if
(
detail
.
buyFlag
==
2
||
detail
.
activityStatus
!=
2
)
return
this
.
showModal
=
true
},
...
...
@@ -172,6 +178,8 @@ export default {
orderCode
:
orderInfo
.
orderCode
}).
then
(({
code
,
data
,
message
})
=>
{
this
.
hideLoading
()
let
[
url
]
=
window
.
location
.
href
.
split
(
'?'
)
let
redirectUrl
=
`
${
url
}
/success`
if
(
code
==
'0'
)
{
this
.
showModal
=
false
let
{
needPay
,
payParams
}
=
data
...
...
@@ -183,8 +191,24 @@ export default {
timestamp
:
payParams
.
timeStamp
,
packages
:
payParams
.
packages
}
wxConfig
.
chooseWXPay
(
params
).
then
(()
=>
this
.
to
(
'crowdfunding.success'
,
{
orderInfo
}))
}
else
this
.
to
(
'crowdfunding.success'
,
{
orderInfo
})
if
(
window
.
$ISMiniprogram
)
{
wx
.
miniProgram
.
navigateTo
({
url
:
`/pages/h5Pay/h5Pay?payData=
${
encodeURIComponent
(
JSON
.
stringify
({
nonceStr
:
payParams
.
nonceStr
,
paySign
:
payParams
.
paySign
,
signType
:
payParams
.
signType
,
timeStamp
:
payParams
.
timeStamp
,
package
:
payParams
.
packages
}))}
&redirectUrl=
${
redirectUrl
}
`
})
}
else
wxConfig
.
chooseWXPay
(
params
).
then
(()
=>
this
.
$router
.
push
({
name
:
'crowdfunding.success'
}))
}
else
{
if
(
window
.
$ISMiniprogram
)
wx
.
miniProgram
.
navigateTo
({
url
:
`/pages/webView/webView?url=
${
encodeURIComponent
(
redirectUrl
)}
`
})
else
this
.
$router
.
push
({
name
:
'crowdfunding.success'
})
}
}
else
this
.
showToast
(
message
)
})
},
...
...
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