Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
U
uniapp_vedio
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
android
uniapp_vedio
Commits
8b6803fd
Commit
8b6803fd
authored
Oct 11, 2023
by
mengcuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加微信登录
parent
f2b83d8e
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
60 additions
and
155 deletions
+60
-155
home.vue
vedio/pages/home.vue
+1
-34
index.vue
vedio/pages/index/index.vue
+31
-96
loading.vue
vedio/pages/loading.vue
+28
-25
No files found.
vedio/pages/home.vue
View file @
8b6803fd
...
...
@@ -84,7 +84,7 @@
},
onShow
()
{
// if (app.globalData.resetLogin && !this.isFirstLoad) {
//
//
this.wxLogin()
// this.wxLogin()
// }
// this.isFirstLoad = false
...
...
@@ -109,9 +109,6 @@
tabChange
(
index
)
{
if
(
this
.
currentPage
==
index
)
return
// if (app.globalData.token == '' || app.globalData.token == null) {
// this.wxLogin()
// }
this
.
currentPage
=
index
;
this
.
loadComponentData
();
},
...
...
@@ -130,36 +127,6 @@
this
.
$refs
.
recommend
.
hide
();
}
},
wxLogin
()
{
let
that
=
this
uni
.
login
({
provider
:
'weixin'
,
success
:
function
(
loginRes
)
{
that
.
post
({
url
:
'/app/wxLogin'
,
data
:
{
code
:
loginRes
.
code
,
inviteUId
:
''
,
},
showLoading
:
false
,
success
:
({
data
})
=>
{
app
.
globalData
.
resetLogin
=
false
uni
.
setStorage
({
key
:
'token'
,
data
:
data
.
session
});
app
.
globalData
.
token
=
data
.
session
;
app
.
globalData
.
userId
=
data
.
userId
;
app
.
globalData
.
userInfo
=
data
;
}
});
}
});
},
showEditBarH
(
b
)
{
this
.
showEditBar
=
b
this
.
isFullChoice
=
false
...
...
vedio/pages/index/index.vue
View file @
8b6803fd
...
...
@@ -164,70 +164,6 @@
},
methods
:
{
show
()
{
console
.
log
(
'123123123'
);
if
(
app
.
globalData
.
userInfo
!=
'undefined'
&&
app
.
globalData
.
userInfo
==
null
)
{
this
.
visitorlogin
();
}
else
{
this
.
loadPost
();
}
},
visitorlogin
()
{
let
that
=
this
var
obj
=
wx
.
getEnterOptionsSync
()
var
tempInviteUId
=
this
.
shareId
;
var
channel
=
''
// 渠道
var
clueToken
=
''
// 归因参数
var
adId
=
''
// 计划id
var
advertiserId
=
''
// 账号id
var
reqId
=
''
// 请求id
var
creativeId
=
''
// 创意id
if
(
obj
.
query
.
clueToken
??
''
!=
''
)
{
channel
=
'tt'
clueToken
=
obj
.
query
.
clueToken
??
''
adId
=
obj
.
query
.
adId
??
''
advertiserId
=
obj
.
query
.
advertiserId
??
''
reqId
=
obj
.
query
.
reqId
??
''
creativeId
=
obj
.
query
.
creativeId
??
''
}
if
(
obj
.
query
.
ksChannel
??
''
!=
''
)
{
channel
=
'kuaishou'
clueToken
=
obj
.
query
.
callback
??
''
adId
=
obj
.
query
.
ksCampaignId
??
''
reqId
=
obj
.
query
.
ksUnitId
??
''
creativeId
=
obj
.
query
.
ksCreativeId
??
''
}
this
.
post
({
url
:
'/user/visitorlogin'
,
data
:
{
channel
:
channel
,
clueToken
:
clueToken
,
adId
:
adId
,
advertiserId
:
advertiserId
,
reqId
:
reqId
,
creativeId
:
creativeId
,
inviteUId
:
tempInviteUId
},
showLoading
:
false
,
success
:
({
data
})
=>
{
app
.
globalData
.
token
=
data
.
token
;
app
.
globalData
.
userId
=
data
.
pk_id
;
app
.
globalData
.
userInfo
=
data
;
that
.
loadPost
();
},
fail
:
(
e
)
=>
{
// 测试使用
that
.
loadPost
();
}
});
},
loadPost
()
{
// 轮播图
this
.
post
({
url
:
'/vedio/topTabs'
,
...
...
@@ -249,19 +185,18 @@
}
});
// 最近观看剧
// this.post({
// url: '/vedio/newest',
// showLoading: false,
// success: ({
// data
// }) => {
// if (data.list != null && data.list.length > 0) {
// this.newRecordBean = data.list[0];
// }
// }
//
});
this
.
post
({
url
:
'/vedio/newest'
,
showLoading
:
false
,
success
:
({
data
})
=>
{
if
(
data
.
list
!=
null
&&
data
.
list
.
length
>
0
)
{
this
.
newRecordBean
=
data
.
list
[
0
];
}
}
});
},
queryList
(
page
,
size
)
{
// 推荐列表
this
.
post
({
...
...
vedio/pages/loading.vue
View file @
8b6803fd
...
...
@@ -46,13 +46,13 @@
},
onLaunch
(
options
)
{},
onShow
(
options
)
{
this
.
visitor
login
();
this
.
wx
login
();
setTimeout
(()
=>
{
redirectTo
(
'home'
);
},
2300
);
},
methods
:
{
visitor
login
()
{
wx
login
()
{
let
that
=
this
var
obj
=
wx
.
getEnterOptionsSync
()
var
tempInviteUId
=
this
.
shareId
;
...
...
@@ -80,8 +80,12 @@
creativeId
=
obj
.
query
.
ksCreativeId
??
''
}
this
.
post
({
url
:
'/user/visitorlogin'
,
uni
.
login
({
provider
:
'weixin'
,
success
:
function
(
loginRes
)
{
that
.
post
({
url
:
'/app/wxLogin'
,
data
:
{
channel
:
channel
,
clueToken
:
clueToken
,
...
...
@@ -89,6 +93,7 @@
advertiserId
:
advertiserId
,
reqId
:
reqId
,
creativeId
:
creativeId
,
code
:
loginRes
.
code
,
inviteUId
:
tempInviteUId
},
showLoading
:
false
,
...
...
@@ -98,11 +103,9 @@
app
.
globalData
.
token
=
data
.
token
;
app
.
globalData
.
userId
=
data
.
pk_id
;
app
.
globalData
.
userInfo
=
data
;
},
fail
:
(
e
)
=>
{
setTimeout
(()
=>
{
redirectTo
(
'home'
);
},
1300
);
}
});
}
});
}
...
...
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