Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
H
h5-base
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
new-sing
h5-base
Commits
a5a39a67
Commit
a5a39a67
authored
Jan 09, 2019
by
wangwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
神策登录接口调整
parent
ea00a311
Changes
9
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
426 additions
and
38 deletions
+426
-38
activity.vue
src/components/buy/activity.vue
+2
-4
activityInvite.vue
src/components/buy/activityInvite.vue
+7
-8
buy.vue
src/components/buy/buy.vue
+2
-4
index.vue
src/components/buy/index.vue
+2
-4
index.vue
src/components/index.vue
+2
-5
mine.vue
src/components/mine.vue
+1
-4
share.vue
src/components/newLesson/share.vue
+402
-0
share.vue
src/components/share.vue
+0
-1
index.js
src/router/index.js
+8
-8
No files found.
src/components/buy/activity.vue
View file @
a5a39a67
...
...
@@ -40,7 +40,7 @@
<
script
>
import
QRCode
from
'qrcodejs2'
import
{
Indicator
}
from
'mint-ui'
;
import
{
getwechatParam
,
getGoodsDetailApi
,
getGroupDetailApi
,
getStatusWechatApi
,
get
UserDetailApi
,
get
InviteResultApi
,
getInviteListApi
}
from
"../../service/api"
;
import
{
getwechatParam
,
getGoodsDetailApi
,
getGroupDetailApi
,
getStatusWechatApi
,
getInviteResultApi
,
getInviteListApi
}
from
"../../service/api"
;
import
refBg
from
'../../assets/refBg.png'
import
moreUrl
from
'../../assets/moreIcon.png'
import
refIcon
from
'../../assets/refIcon.png'
...
...
@@ -157,8 +157,7 @@
if
(
!
this
.
invite_code
){
this
.
invite_code
=
'CC-USER'
}
getUserDetailApi
().
then
(
res
=>
{
this
.
user_id
=
res
.
user_id
;
this
.
user_id
=
JSON
.
parse
(
localStorage
.
getItem
(
'userDesc'
)).
user_id
;
let
invite_code
=
this
.
invite_code
.
split
(
'-'
);
if
(
invite_code
.
length
>
2
&&
invite_code
[
1
]
===
'TEACHER'
){
invite_code
[
1
]
=
'USER'
...
...
@@ -200,7 +199,6 @@
}
})
});
},
500
)
}
else
{
...
...
src/components/buy/activityInvite.vue
View file @
a5a39a67
...
...
@@ -10,7 +10,7 @@
</div>
</div>
<img
:src=
"dataURL"
class=
"cvs-img"
id=
"cvs-img"
/>
<div
class=
"inviteBtn"
id=
"inviteBtn"
>
<div
class=
"content-text"
>
<h3>
长按保存海报 或发送给好友
</h3>
...
...
@@ -49,7 +49,7 @@
import
{
swiper
,
swiperSlide
}
from
'vue-awesome-swiper'
import
QRCode
from
'qrcodejs2'
import
{
Indicator
}
from
'mint-ui'
;
import
{
getwechatParam
,
getGoodsDetailApi
,
getGroupDetailApi
,
getStatusWechatApi
,
getUserDetailApi
}
from
"../../service/api"
;
import
{
getwechatParam
,
getGoodsDetailApi
,
getGroupDetailApi
,
getStatusWechatApi
}
from
"../../service/api"
;
import
refBg
from
'../../assets/refBg.png'
import
moreUrl
from
'../../assets/moreIcon.png'
import
refIcon
from
'../../assets/refIcon.png'
...
...
@@ -154,8 +154,7 @@
if
(
!
this
.
invite_code
){
this
.
invite_code
=
'CC-USER'
}
getUserDetailApi
().
then
(
res
=>
{
this
.
user_id
=
res
.
user_id
;
this
.
user_id
=
JSON
.
parse
(
localStorage
.
getItem
(
'userDesc'
)).
user_id
;
let
_that
=
this
;
let
invite_code
=
this
.
invite_code
.
split
(
'-'
);
if
(
invite_code
.
length
>
2
&&
invite_code
[
1
]
===
'TEACHER'
){
...
...
@@ -163,14 +162,15 @@
}
let
code
=
`
${
invite_code
[
0
]}
-
${
invite_code
[
1
]}
`
;
let
URL
=
`
${
process
.
env
.
BUY_URL
}
shopId=
${
this
.
shopId
}
&invite_code=
${
code
}
-
${
this
.
user_id
}
`
;
if
(
this
.
groupId
&&
this
.
groupId
!==
'null'
){
URL
+=
`&groupId=
${
this
.
groupId
}
`
}
this
.
onNewShare
(
URL
);
this
.
toDataURLBase64
(
res
.
avatar
.
replace
(
'http://'
,
'https://'
),
function
(
avatar
)
{
this
.
toDataURLBase64
(
JSON
.
parse
(
localStorage
.
getItem
(
'userDesc'
))
.
avatar
.
replace
(
'http://'
,
'https://'
),
function
(
avatar
)
{
_that
.
avatar
=
avatar
});
_that
.
qrcode
(
URL
);
this
.
refVisible
=
true
;
this
.
$nextTick
(()
=>
{
...
...
@@ -204,14 +204,13 @@
}).
catch
(
res
=>
{
alert
(
res
);
console
.
log
()});
}
})
},
500
)
}
else
{
}
})
});
}
else
{
let
query
=
{
retUrl
:
this
.
$route
.
fullPath
,
is_new_user_url
:
'1'
};
this
.
$router
.
push
({
name
:
'author'
,
query
:
query
})
...
...
src/components/buy/buy.vue
View file @
a5a39a67
...
...
@@ -65,7 +65,7 @@
<
script
>
import
{
Toast
,
MessageBox
}
from
'mint-ui'
import
{
getUserAdressApi
,
getGoodsDetailApi
,
payApi
,
getwechatParam
,
getStatusWechatApi
,
getCouponListApi
,
getUserDetailApi
}
from
"../../service/api"
;
import
{
getUserAdressApi
,
getGoodsDetailApi
,
payApi
,
getwechatParam
,
getStatusWechatApi
,
getCouponListApi
}
from
"../../service/api"
;
import
addAddress
from
'./address'
import
youHuiUrl
from
'../../assets/shop/youHui.png'
import
saleDiv
from
'./sale'
...
...
@@ -235,8 +235,7 @@
this
.
addressPop
=
true
},
initPage
(){
getUserDetailApi
().
then
(
res
=>
{
if
(
!
res
.
mobile
||
res
.
mobile
===
''
){
if
(
!
JSON
.
parse
(
localStorage
.
getItem
(
'userDesc'
)).
mobile
||
JSON
.
parse
(
localStorage
.
getItem
(
'userDesc'
)).
mobile
===
''
){
this
.
$router
.
push
({
name
:
'bindMobile'
,
query
:{
retUrl
:
this
.
$route
.
fullPath
}})
}
else
{
getwechatParam
({
api_list
:
'chooseWXPay'
}).
then
(
res
=>
{
...
...
@@ -285,7 +284,6 @@
});
this
.
orderFlag
=
true
}
});
}
}
}
...
...
src/components/buy/index.vue
View file @
a5a39a67
...
...
@@ -121,7 +121,7 @@
import
{
swiper
,
swiperSlide
}
from
'vue-awesome-swiper'
import
QRCode
from
'qrcodejs2'
import
{
Indicator
}
from
'mint-ui'
;
import
{
getwechatParam
,
getGoodsDetailApi
,
getGroupDetailApi
,
getStatusWechatApi
,
getUserDetailApi
}
from
"../../service/api"
;
import
{
getwechatParam
,
getGoodsDetailApi
,
getGroupDetailApi
,
getStatusWechatApi
}
from
"../../service/api"
;
import
refBg
from
'../../assets/refBg.png'
import
moreUrl
from
'../../assets/moreIcon.png'
import
weChatIcon
from
'../../assets/wechatIcon.png'
...
...
@@ -361,8 +361,7 @@
this
.
invite_code_f
=
false
}
}
getUserDetailApi
().
then
(
res
=>
{
this
.
user_id
=
res
.
user_id
;
this
.
user_id
=
JSON
.
parse
(
localStorage
.
getItem
(
'userDesc'
)).
user_id
;
if
(
window
.
location
.
href
.
indexOf
(
'shopId'
)
>-
1
){
this
.
shopId
=
this
.
$route
.
query
.
shopId
;
getGoodsDetailApi
(
this
.
shopId
).
then
(
res
=>
{
...
...
@@ -427,7 +426,6 @@
}
})
}
});
},
showTeacher
(){
this
.
popType
=
false
;
...
...
src/components/index.vue
View file @
a5a39a67
...
...
@@ -76,7 +76,7 @@
import
guidePage
from
'./guide/index'
import
'swiper/dist/css/swiper.css'
import
{
swiper
,
swiperSlide
}
from
'vue-awesome-swiper'
import
{
getBannerListApi
,
getUser
DetailApi
,
getUser
LessonApi
,
getTeacherApi
,
getNewApi
,
getRedirectApi
}
from
"../service/api"
;
import
{
getBannerListApi
,
getUserLessonApi
,
getTeacherApi
,
getNewApi
,
getRedirectApi
}
from
"../service/api"
;
import
{
IndexImage
}
from
"../util/imgUrl"
;
import
bottomTab
from
'./public/bottomTab'
;
import
{
Toast
}
from
'mint-ui'
;
...
...
@@ -157,10 +157,7 @@
window
.
location
.
href
=
res
}
});
getUserDetailApi
().
then
(
res
=>
{
this
.
user_id
=
res
.
user_id
;
// this.$sa.login(this.user_id)
});
this
.
user_id
=
JSON
.
parse
(
localStorage
.
getItem
(
'userDesc'
)).
user_id
;
getBannerListApi
().
then
(
res
=>
{
this
.
bannerList
=
res
.
list
});
...
...
src/components/mine.vue
View file @
a5a39a67
...
...
@@ -23,7 +23,6 @@
<
script
>
import
bottomTab
from
'./public/bottomTab'
;
import
{
mineImage
}
from
"../util/imgUrl"
;
import
{
getUserDetailApi
}
from
"../service/api"
;
import
{
Toast
}
from
'mint-ui'
;
export
default
{
name
:
"mine"
,
...
...
@@ -41,9 +40,7 @@
},
methods
:{
initPage
(){
getUserDetailApi
().
then
(
res
=>
{
this
.
userDetail
=
res
})
this
.
userDetail
=
JSON
.
parse
(
localStorage
.
getItem
(
'userDesc'
))
},
clearBoth
(){
this
.
$sa
.
track
(
'buttonClick'
,{
...
...
src/components/newLesson/share.vue
0 → 100644
View file @
a5a39a67
This diff is collapsed.
Click to expand it.
src/components/share.vue
View file @
a5a39a67
...
...
@@ -4,7 +4,6 @@
<
script
>
import
{
share
}
from
"../util/imgUrl"
;
import
{
getUserWatchApi
,
getUserDetailApi
}
from
"../service/api"
;
export
default
{
name
:
"share"
,
data
(){
...
...
src/router/index.js
View file @
a5a39a67
...
...
@@ -86,7 +86,7 @@ const router =new Router({
name
:
'buyDetail'
,
component
:
e
=>
require
([
'@/components/buy/index'
],
e
),
meta
:{
skip_login
:
tru
e
,
skip_login
:
fals
e
,
noNew
:
true
,
deep
:
10
}
...
...
@@ -218,22 +218,22 @@ router.beforeEach((to,from,next)=> {
let
token
=
common
.
getUrlParam
().
token
||
to
.
query
.
token
;
store
.
dispatch
(
'setToken'
,
token
);
getUserDetailApi
().
then
(
res
=>
{
localStorage
.
setItem
(
'user
Id'
,
res
.
user_id
);
localStorage
.
setItem
(
'user
Desc'
,
JSON
.
stringify
(
res
)
);
sa
.
login
(
res
.
user_id
);
goOn
()
});
goOn
()
// 通过cookie获取token
}
else
if
(
localStorage
.
getItem
(
'cc_token'
))
{
store
.
dispatch
(
'setToken'
,
localStorage
.
getItem
(
'cc_token'
));
if
(
localStorage
.
getItem
(
'userId'
)){
sa
.
login
(
localStorage
.
getItem
(
'userId'
));
if
(
localStorage
.
getItem
(
'userDesc'
)){
sa
.
login
(
JSON
.
parse
(
localStorage
.
getItem
(
'userDesc'
)).
user_id
);
goOn
()
}
else
{
getUserDetailApi
().
then
(
res
=>
{
localStorage
.
setItem
(
'user
Id'
,
res
.
user_id
);
localStorage
.
setItem
(
'user
Desc'
,
JSON
.
stringify
(
res
)
);
sa
.
login
(
res
.
user_id
);
goOn
()
});
}
goOn
()
// 无需token登录页面
}
else
if
(
to
.
meta
.
skip_login
){
goOn
()
...
...
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