Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
group-buy-ui
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ui
group-buy-ui
Commits
4ab6516e
Commit
4ab6516e
authored
Sep 24, 2021
by
beisir
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feat/group-buy' of git.quantgroup.cn:ui/group-buy-ui into feat/group-buy
parents
f96e4f7c
ef4cb324
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
53 additions
and
4 deletions
+53
-4
goodsCheck.mixin.js
src/mixins/goodsCheck.mixin.js
+6
-2
index.vue
src/views/goodsDetail/index.vue
+47
-2
No files found.
src/mixins/goodsCheck.mixin.js
View file @
4ab6516e
...
...
@@ -17,8 +17,12 @@ export default {
const
appData
=
json
.
data
||
{};
if
(
appData
&&
appData
.
token
)
{
localStorage
.
set
(
'
vccToken
'
,
appData
.
token
);
const
location
=
window
.
location
;
window
.
location
.
href
=
location
.
href
;
this
.
nativeBridge
.
openNewUrl
({
event
:
'
openNewUrl
'
,
data
:
{
newUrl
:
window
.
location
.
href
//需要打开的新链接
}
});
}
}
};
...
...
src/views/goodsDetail/index.vue
View file @
4ab6516e
...
...
@@ -195,7 +195,10 @@ import groupDescInfo from './components/groupDescInfo';
import
{
mapState
}
from
'
vuex
'
;
import
sharePic
from
'
@/components/sharePic
'
;
import
localStorage
from
'
@/service/localStorage.service
'
;
import
goodsCheckMixin
from
'
@/mixins/goodsCheck.mixin
'
;
// import goodsCheckMixin from '@/mixins/goodsCheck.mixin';
import
Bridge
from
'
@qg/js-bridge
'
;
import
MpBridge
from
'
@/service/mp
'
;
import
{
isWxMp
,
isApp
}
from
'
@/service/validation.service
'
;
export
default
{
// eslint-disable-next-line vue/name-property-casing
name
:
'
goodDetail
'
,
...
...
@@ -213,7 +216,7 @@ export default {
filters
:
{
Img2Thumb
},
mixins
:
[
goodsCheckMixin
],
//
mixins: [goodsCheckMixin],
data
()
{
return
{
timestemp
:
''
,
// 大活动结束时间
...
...
@@ -284,6 +287,48 @@ export default {
},
5000
);
},
methods
:
{
getToken
()
{
window
.
xyqbNativeEvent
=
function
(
res
)
{
const
json
=
typeof
res
===
'
string
'
?
JSON
.
parse
(
res
)
:
res
;
if
(
json
.
event
===
'
getTokenSuccess
'
)
{
const
appData
=
json
.
data
||
{};
if
(
appData
&&
appData
.
token
)
{
localStorage
.
set
(
'
vccToken
'
,
appData
.
token
);
window
.
location
.
reload
();
}
}
};
this
.
nativeBridge
.
getToken
();
},
checkLogin
()
{
const
vccToken
=
localStorage
.
get
(
'
vccToken
'
);
const
needLogin
=
vccToken
?
false
:
true
;
if
(
needLogin
)
{
if
(
isApp
)
this
.
nativeBridge
=
new
Bridge
();
else
if
(
isWxMp
)
this
.
nativeBridge
=
new
MpBridge
();
this
.
$dialog
({
message
:
'
参与拼团活动需要您先进行登录哦~
'
,
title
:
''
,
showCancelButton
:
false
,
confirmButtonText
:
'
登录
'
,
onConfirm
:
()
=>
{
if
(
isWxMp
)
{
this
.
nativeBridge
.
getToken
();
}
else
if
(
isApp
)
{
// native调用getToken
this
.
getToken
();
}
else
{
this
.
$dialog
({
message
:
'
请在App或小程序中参与活动~
'
,
title
:
''
,
showCancelButton
:
false
,
confirmButtonText
:
'
我知道了
'
});
}
}
});
}
},
onChange
(
index
)
{
this
.
swiperCurrent
=
index
;
},
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment