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
d7d657f0
Commit
d7d657f0
authored
Sep 10, 2024
by
jyx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
代码优化
parent
74bec2b7
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
46 additions
and
22 deletions
+46
-22
userServices.js
vedio/common/services/userServices.js
+20
-2
book-content.vue
vedio/page-subs/sub_A/book-content/book-content.vue
+6
-1
home.vue
vedio/pages/home.vue
+2
-2
loading.vue
vedio/pages/loading.vue
+18
-17
No files found.
vedio/common/services/userServices.js
View file @
d7d657f0
...
@@ -240,6 +240,22 @@ function logout(callback, exprireOut = false) {
...
@@ -240,6 +240,22 @@ function logout(callback, exprireOut = false) {
// }
// }
}
}
const
KEY_STORAGE_ACTIVITY
=
"ACTIVITY"
let
LOCAL_ACTIVITY
;
function
saveActivity
(
activity
)
{
LOCAL_ACTIVITY
=
activity
;
saveStorage
(
KEY_STORAGE_ACTIVITY
,
activity
);
}
function
readaActivity
()
{
if
(
!
LOCAL_ACTIVITY
)
{
LOCAL_ACTIVITY
=
readStorage
(
KEY_STORAGE_ACTIVITY
)
}
return
LOCAL_ACTIVITY
;
}
const
KEY_STORAGE_TOKEN
=
"TOKEN"
const
KEY_STORAGE_TOKEN
=
"TOKEN"
let
LOCAL_TOKEN
;
let
LOCAL_TOKEN
;
...
@@ -315,8 +331,8 @@ function removeUserInfoChangeWatch(observer) {
...
@@ -315,8 +331,8 @@ function removeUserInfoChangeWatch(observer) {
}
}
// 展示登录弹窗
// 展示登录弹窗
function
showLoginView
()
{
function
showLoginView
()
{
reLaunch
(
`loading`
)
reLaunch
(
`loading`
)
// postNotification(KEY_NOTIFICATION_LOGIN_SHOW, {
// postNotification(KEY_NOTIFICATION_LOGIN_SHOW, {
...
@@ -339,4 +355,6 @@ module.exports = {
...
@@ -339,4 +355,6 @@ module.exports = {
removeUserInfoChangeWatch
,
removeUserInfoChangeWatch
,
saveToken
,
saveToken
,
readToken
,
readToken
,
saveActivity
,
readaActivity
}
}
\ No newline at end of file
vedio/page-subs/sub_A/book-content/book-content.vue
View file @
d7d657f0
...
@@ -62,7 +62,8 @@
...
@@ -62,7 +62,8 @@
watchUserInfoChange
,
watchUserInfoChange
,
removeUserInfoChangeWatch
,
removeUserInfoChangeWatch
,
refreshUserInfo
,
refreshUserInfo
,
postPhone
postPhone
,
readaActivity
}
from
"../../../common/services/userServices.js"
}
from
"../../../common/services/userServices.js"
import
{
import
{
noticeCollectionListChange
,
noticeCollectionListChange
,
...
@@ -250,6 +251,10 @@
...
@@ -250,6 +251,10 @@
// setTimeout(() => {
// setTimeout(() => {
// uni.stopPullDownRefresh();
// uni.stopPullDownRefresh();
if
(
success
)
{
if
(
success
)
{
if
(
readaActivity
()
!=
1
)
{
data
.
isUnlock
=
1
}
this
.
bookData
=
new
BookDetail
(
data
);
this
.
bookData
=
new
BookDetail
(
data
);
// console.log('bookData=' + JSON.stringify(this.bookData));
// console.log('bookData=' + JSON.stringify(this.bookData));
}
}
...
...
vedio/pages/home.vue
View file @
d7d657f0
<
template
>
<
template
>
<view
v-if=
"localActiviteFlag==1"
class=
"body"
>
<view
v-if=
"localActiviteFlag==1"
class=
"body"
>
<view
style=
"height: 92%;"
>
<view
style=
"height: 92%;"
>
<bookshelf
v-show=
"currentPage==0"
ref=
"shelf"
v-on:showEditBarH=
"showEditBarH"
/>
<bookshelf
v-show=
"currentPage==0"
ref=
"shelf"
v-on:showEditBarH=
"showEditBarH"
/>
...
@@ -156,7 +156,7 @@
...
@@ -156,7 +156,7 @@
}
else
if
(
this
.
currentPage
==
3
)
{
}
else
if
(
this
.
currentPage
==
3
)
{
this
.
$refs
.
user
.
show
();
this
.
$refs
.
user
.
show
();
}
}
}
else
{
}
else
{
this
.
$refs
.
recommend2
.
show
();
this
.
$refs
.
recommend2
.
show
();
}
}
},
},
...
...
vedio/pages/loading.vue
View file @
d7d657f0
...
@@ -38,7 +38,8 @@
...
@@ -38,7 +38,8 @@
<
script
>
<
script
>
import
{
import
{
saveToken
saveToken
,
saveActivity
}
from
'../common/services/userServices.js'
}
from
'../common/services/userServices.js'
import
{
import
{
...
@@ -69,23 +70,22 @@
...
@@ -69,23 +70,22 @@
},
},
onShow
(
options
)
{
onShow
(
options
)
{
this
.
ttLoging
()
this
.
ttLoging
()
this
.
isVipStatus
()
},
},
methods
:
{
methods
:
{
isVipStatus
()
{
isVipStatus
()
{
this
.
post
({
if
(
this
.
sourceType
==
'android'
&&
this
.
localToken
)
{
url
:
'/user/baseMsg'
,
let
that
=
this
;
showLoading
:
false
,
this
.
post
({
success
:
({
url
:
'/vip/getVipProducts/cyc/forVApp'
,
data
showLoading
:
false
,
})
=>
{
success
:
({
if
(
data
.
expireTime
>
0
)
{
data
this
.
isVip
=
true
})
=>
{
}
else
{
that
.
isVip
=
data
.
vip
this
.
isVip
=
false
}
}
}
}
);
}
);
}
},
},
ttLoging
()
{
ttLoging
()
{
var
that
=
this
;
var
that
=
this
;
...
@@ -128,6 +128,7 @@
...
@@ -128,6 +128,7 @@
})
=>
{
})
=>
{
app
.
globalData
.
userId
=
data
.
idcode
;
app
.
globalData
.
userId
=
data
.
idcode
;
saveToken
(
data
.
token
)
saveToken
(
data
.
token
)
saveActivity
(
data
.
activiteFlag
)
// saveToken(
// saveToken(
// 'A5CFAE67AF32E71D10CA6127546E82C20A8DE7C0EAAA5697BEEC2AC2E333F9945F433703067DF5142735505C42F58997'
// 'A5CFAE67AF32E71D10CA6127546E82C20A8DE7C0EAAA5697BEEC2AC2E333F9945F433703067DF5142735505C42F58997'
// )
// )
...
@@ -199,9 +200,9 @@
...
@@ -199,9 +200,9 @@
appId
:
"wxbd687630cd02ce1d"
,
appId
:
"wxbd687630cd02ce1d"
,
path
:
'pages/index/index'
,
path
:
'pages/index/index'
,
extraData
:
wxData
.
params
,
extraData
:
wxData
.
params
,
success
(
res
)
{
success
(
res
)
{
setTimeout
(()
=>
{
setTimeout
(()
=>
{
that
.
isVipStatus
()
that
.
isVipStatus
()
},
1000
);
},
1000
);
},
},
fail
(
res
)
{
fail
(
res
)
{
...
...
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