Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cust-app
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
李伟
cust-app
Commits
e5144792
Commit
e5144792
authored
Feb 18, 2025
by
罗林杰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改用户账号停用验证
parent
d4ed96c8
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
194 additions
and
76 deletions
+194
-76
Item.vue
pages/components/article/Item.vue
+16
-3
List.vue
pages/components/article/List.vue
+34
-2
article.vue
pages/tab/article.vue
+32
-21
index.vue
pages/tab/index.vue
+15
-3
articleDetail.vue
pagesArticle/articleDetail.vue
+96
-46
userList.vue
pagesUser/userList.vue
+1
-1
No files found.
pages/components/article/Item.vue
View file @
e5144792
...
...
@@ -104,6 +104,7 @@
<
script
>
import
imageAdaptation
from
'@/components/images-adaptation/imageAdaptation.vue'
import
xzjReadMore
from
"@/components/xzj-readMore/xzj-readMore.vue"
import
{
userDetail
}
from
"../../../api/user"
;
export
default
{
name
:
'ArticleItem'
,
options
:
{
...
...
@@ -180,12 +181,24 @@
// 点赞
praise
(
item
)
{
const
token
=
uni
.
getStorageSync
(
'token'
)
const
userInfo
=
uni
.
getStorageSync
(
'userInfo'
)
//校验token 如果没有token,跳到登录页进行登录
if
(
token
&&
token
!==
''
&&
token
!=
null
){
//已登录
//0:取消点赞/未点赞 1:点赞
item
.
isLike
=
item
.
isLike
==
'0'
?
'1'
:
'0'
this
.
$emit
(
'praise'
,
item
)
userDetail
(
userInfo
.
memberId
).
then
(
res
=>
{
//如果flag=0 被禁用了 踢出该用户
if
(
res
.
data
.
data
.
flag
==
'0'
)
{
uni
.
removeStorageSync
(
'userInfo'
)
uni
.
removeStorageSync
(
'token'
)
uni
.
navigateTo
({
url
:
"/pageslogin/index"
})
}
else
{
//0:取消点赞/未点赞 1:点赞
item
.
isLike
=
item
.
isLike
==
'0'
?
'1'
:
'0'
this
.
$emit
(
'praise'
,
item
)
}
})
}
else
{
//未登录
this
.
isLoginPop
=
true
...
...
pages/components/article/List.vue
View file @
e5144792
...
...
@@ -19,6 +19,8 @@
</view>
<empty
v-if=
"firstLoaded && !dataList.length"
/>
</z-paging>
<!-- 登录弹窗-->
<login
@
change=
"getToLogin"
:isLoginPop=
"isLoginPop"
class=
"my-select"
></login>
</view>
</
template
>
...
...
@@ -29,6 +31,7 @@
import
{
articleList
,
getOssUrl
,
like
}
from
"../../../api/article"
;
import
{
getCity
,
getValue
}
from
"../../../common/options"
;
import
{
calculateAge
,
parseDate
}
from
"../../../common"
;
import
{
userDetail
}
from
"../../../api/user"
;
export
default
{
name
:
'ArticleList'
,
components
:
{
...
...
@@ -80,8 +83,24 @@
console
.
log
(
'this.tabIndex:'
,
this
.
tabIndex
)
if
(
newVal
===
this
.
tabIndex
)
{
if
(
newVal
===
0
){
//关注
this
.
articleType
=
'0'
const
token
=
uni
.
getStorageSync
(
'token'
)
const
userInfo
=
uni
.
getStorageSync
(
'userInfo'
)
if
(
token
!=
''
)
{
userDetail
(
userInfo
.
memberId
).
then
(
res
=>
{
//如果flag=0 被禁用了 踢出该用户
if
(
res
.
data
.
data
.
flag
==
'0'
)
{
uni
.
removeStorageSync
(
'userInfo'
)
uni
.
removeStorageSync
(
'token'
)
this
.
isLoginPop
=
true
}
else
{
//关注
this
.
articleType
=
'0'
}
})
}
else
{
//未登录
this
.
isLoginPop
=
true
}
}
if
(
newVal
===
1
){
//最近
...
...
@@ -279,6 +298,19 @@
let
idx
=
this
.
dataList
.
findIndex
(
obj
=>
obj
.
businessId
==
item
.
businessId
)
this
.
dataList
.
splice
(
idx
,
1
,
item
)
})
},
//登录弹窗
getToLogin
(
e
)
{
if
(
e
==
0
)
{
//取消登录
this
.
isLoginPop
=
false
;
}
else
{
this
.
isLoginPop
=
false
;
//立即登录
uni
.
navigateTo
({
url
:
'/pageslogin/index'
})
}
},
}
}
...
...
pages/tab/article.vue
View file @
e5144792
...
...
@@ -129,29 +129,40 @@
const
token
=
uni
.
getStorageSync
(
'token'
)
const
userInfo
=
uni
.
getStorageSync
(
'userInfo'
)
if
(
token
!=
''
)
{
//已登录 判断授权
if
(
userInfo
&&
userInfo
.
wxNickName
!==
''
&&
userInfo
.
wxNickName
!=
null
)
{
//已授权过
//判断是否完善个人资料 完善之后才可发布动态
userDetail
(
userInfo
.
memberId
).
then
(
res
=>
{
const
memInfo
=
res
.
data
.
data
if
(
memInfo
.
memNickName
!=
null
&&
memInfo
.
memNickName
!=
''
&&
memInfo
.
memBirthday
!=
null
&&
memInfo
.
memMaxEducation
!=
null
&&
memInfo
.
memCareer
!=
''
&&
memInfo
.
memCareer
!=
null
&&
memInfo
.
memResidenceProvince
!=
null
&&
memInfo
.
memResidenceCity
!=
null
){
//已完善个人资料 可以发布动态
uni
.
navigateTo
({
url
:
'/pagesArticle/publishArticle?topicId='
+
this
.
topicId
userDetail
(
userInfo
.
memberId
).
then
(
res
=>
{
//如果flag=0 被禁用了 踢出该用户
if
(
res
.
data
.
data
.
flag
==
'0'
)
{
uni
.
removeStorageSync
(
'userInfo'
)
uni
.
removeStorageSync
(
'token'
)
uni
.
navigateTo
({
url
:
"/pageslogin/index"
})
}
else
{
//已登录 判断授权
if
(
userInfo
&&
userInfo
.
wxNickName
!==
''
&&
userInfo
.
wxNickName
!=
null
)
{
//已授权过
//判断是否完善个人资料 完善之后才可发布动态
userDetail
(
userInfo
.
memberId
).
then
(
res
=>
{
const
memInfo
=
res
.
data
.
data
if
(
memInfo
.
memNickName
!=
null
&&
memInfo
.
memNickName
!=
''
&&
memInfo
.
memBirthday
!=
null
&&
memInfo
.
memMaxEducation
!=
null
&&
memInfo
.
memCareer
!=
''
&&
memInfo
.
memCareer
!=
null
&&
memInfo
.
memResidenceProvince
!=
null
&&
memInfo
.
memResidenceCity
!=
null
){
//已完善个人资料 可以发布动态
uni
.
navigateTo
({
url
:
'/pagesArticle/publishArticle?topicId='
+
this
.
topicId
})
}
else
{
//没完善个人资料 需要去完善
this
.
tipsShow
=
true
}
})
}
else
{
//没完善个人资料 需要去完善
this
.
tipsShow
=
true
}
else
{
//没授权过,需要授权
uni
.
switchTab
({
url
:
'/pages/tab/index'
});
}
})
}
else
{
//没授权过,需要授权
uni
.
switchTab
({
url
:
'/pages/tab/index'
});
}
}
})
}
else
{
//未登录
this
.
isLoginPop
=
true
...
...
pages/tab/index.vue
View file @
e5144792
...
...
@@ -74,7 +74,7 @@
import
LsSwiper
from
'../../components/ls-swiper/index.vue'
;
import
{
noticeList
}
from
'../../api/notice/index'
import
{
bannerList
}
from
'../../api/banner/index'
import
{
userList
}
from
'../../api/user/index'
import
{
user
Detail
,
user
List
}
from
'../../api/user/index'
import
{
getCity
}
from
"../../common/options"
;
import
{
getOssUrl
}
from
"../../api/article"
;
export
default
{
...
...
@@ -105,6 +105,7 @@
this
.
getNoticeList
()
this
.
getBannerList
()
this
.
getUserList
()
this
.
userInfo
=
uni
.
getStorageSync
(
'userInfo'
)
},
methods
:
{
//获取用户列表
...
...
@@ -194,8 +195,19 @@
duration
:
1000
})
}
else
{
uni
.
navigateTo
({
url
:
'/pagesUser/userInfo?memberId='
+
item
.
businessId
userDetail
(
this
.
userInfo
.
memberId
).
then
(
res
=>
{
//如果flag=0 被禁用了 踢出该用户
if
(
res
.
data
.
data
.
flag
==
'0'
)
{
uni
.
removeStorageSync
(
'userInfo'
)
uni
.
removeStorageSync
(
'token'
)
uni
.
navigateTo
({
url
:
"/pageslogin/index"
})
}
else
{
uni
.
navigateTo
({
url
:
'/pagesUser/userInfo?memberId='
+
item
.
businessId
})
}
})
}
},
...
...
pagesArticle/articleDetail.vue
View file @
e5144792
...
...
@@ -107,6 +107,8 @@
<!--
</view>
-->
<!--
</view>
-->
</view>
<!-- 登录弹窗-->
<login
@
change=
"getToLogin"
:isLoginPop=
"isLoginPop"
class=
"my-select"
></login>
</view>
</
template
>
...
...
@@ -115,6 +117,7 @@ import ArticleItem from './components/articleItem.vue'
import
{
articleDetail
,
comment
,
getOssUrl
,
likeComment
}
from
'../api/article/index'
import
{
getCity
,
getValue
}
from
"../common/options"
;
import
{
calculateAge
,
parseDate
}
from
"../common"
;
import
{
userDetail
}
from
"../api/user"
;
export
default
{
components
:
{
ArticleItem
,
...
...
@@ -131,6 +134,7 @@ export default{
articleId
:
''
,
//动态详情
articleInfo
:{},
isLoginPop
:
false
,
//被评论人
commentedUserId
:
null
,
//上级评论ID
...
...
@@ -157,31 +161,49 @@ export default{
},
// 点赞
praise
(
item
)
{
console
.
log
(
'item'
,
item
)
var
type
=
''
if
(
item
.
isLike
==
'1'
)
{
//取消点赞
type
=
'cancel'
const
token
=
uni
.
getStorageSync
(
'token'
)
const
userInfo
=
uni
.
getStorageSync
(
'userInfo'
)
//校验token 如果没有token,跳到登录页进行登录
if
(
token
&&
token
!==
''
&&
token
!=
null
){
//已登录
userDetail
(
userInfo
.
memberId
).
then
(
res
=>
{
//如果flag=0 被禁用了 踢出该用户
if
(
res
.
data
.
data
.
flag
==
'0'
)
{
uni
.
removeStorageSync
(
'userInfo'
)
uni
.
removeStorageSync
(
'token'
)
uni
.
navigateTo
({
url
:
"/pageslogin/index"
})
}
else
{
var
type
=
''
if
(
item
.
isLike
==
'1'
)
{
//取消点赞
type
=
'cancel'
}
else
{
//点赞
type
=
'praise'
}
const
params
=
{
commentId
:
item
.
businessId
,
praiseType
:
type
}
likeComment
(
params
).
then
(
res
=>
{
this
.
getArticleDetail
()
})
}
})
}
else
{
//点赞
type
=
'praise'
}
const
params
=
{
commentId
:
item
.
businessId
,
praiseType
:
type
//未登录
this
.
isLoginPop
=
true
}
likeComment
(
params
).
then
(
res
=>
{
this
.
getArticleDetail
()
})
},
//评论回车事件
handleEnter
(
value
){
const
token
=
uni
.
getStorageSync
(
"token"
)
const
userInfo
=
uni
.
getStorageSync
(
'userInfo'
)
if
(
token
==
null
||
token
==
''
){
uni
.
showToast
({
title
:
'请先登录'
,
icon
:
'none'
})
//未登录
this
.
isLoginPop
=
true
return
;
}
if
(
this
.
commentValue
===
''
){
...
...
@@ -191,34 +213,49 @@ export default{
})
return
;
}
this
.
commentValue
=
''
const
params
=
{
articleId
:
this
.
articleInfo
.
businessId
,
//动态id
commentContent
:
value
,
//评论内容
commentedUserId
:
this
.
commentedUserId
,
//被评论人ID
parentId
:
this
.
parentId
,
//上级评论ID
createDate
:
this
.
articleInfo
.
createDate
//动态发布时间
}
comment
(
params
).
then
(
res
=>
{
if
(
res
.
data
.
code
==
200
){
//方便回到动态页的时候刷新数据
uni
.
setStorageSync
(
"isRefresh"
,
true
)
this
.
getArticleDetail
()
}
else
{
uni
.
showToast
({
title
:
res
.
data
.
message
,
icon
:
'none'
})
}
}).
catch
(
err
=>
{
uni
.
showToast
({
title
:
'评论失败,请稍后再试'
,
icon
:
'none'
//校验token 如果没有token,跳到登录页进行登录
if
(
token
&&
token
!==
''
&&
token
!=
null
){
//已登录
userDetail
(
userInfo
.
memberId
).
then
(
res
=>
{
//如果flag=0 被禁用了 踢出该用户
if
(
res
.
data
.
data
.
flag
==
'0'
)
{
uni
.
removeStorageSync
(
'userInfo'
)
uni
.
removeStorageSync
(
'token'
)
uni
.
navigateTo
({
url
:
"/pageslogin/index"
})
}
else
{
this
.
commentValue
=
''
const
params
=
{
articleId
:
this
.
articleInfo
.
businessId
,
//动态id
commentContent
:
value
,
//评论内容
commentedUserId
:
this
.
commentedUserId
,
//被评论人ID
parentId
:
this
.
parentId
,
//上级评论ID
createDate
:
this
.
articleInfo
.
createDate
//动态发布时间
}
comment
(
params
).
then
(
res
=>
{
if
(
res
.
data
.
code
==
200
){
//方便回到动态页的时候刷新数据
uni
.
setStorageSync
(
"isRefresh"
,
true
)
this
.
getArticleDetail
()
}
else
{
uni
.
showToast
({
title
:
res
.
data
.
message
,
icon
:
'none'
})
}
}).
catch
(
err
=>
{
uni
.
showToast
({
title
:
'评论失败,请稍后再试'
,
icon
:
'none'
})
})
this
.
commentPlaceholder
=
'走心,说点好听的.....'
this
.
commentedUserId
=
null
this
.
parentId
=
null
}
})
})
this
.
commentPlaceholder
=
'走心,说点好听的.....'
this
.
commentedUserId
=
null
this
.
parentId
=
null
}
},
getArticleDetail
(){
articleDetail
(
this
.
articleId
).
then
(
res
=>
{
...
...
@@ -287,7 +324,20 @@ export default{
}
})
},
},
//登录弹窗
getToLogin
(
e
)
{
if
(
e
==
0
)
{
//取消登录
this
.
isLoginPop
=
false
;
}
else
{
this
.
isLoginPop
=
false
;
//立即登录
uni
.
navigateTo
({
url
:
'/pageslogin/index'
})
}
},
}
}
</
script
>
...
...
pagesUser/userList.vue
View file @
e5144792
...
...
@@ -40,7 +40,7 @@
</
template
>
<
script
>
import
{
userList
}
from
"../api/user"
;
import
{
user
Detail
,
user
List
}
from
"../api/user"
;
import
{
getCity
,
getValue
}
from
"../common/options"
;
import
{
calculateAge
,
parseDate
}
from
"../common"
;
import
{
getOssUrl
}
from
"../api/article"
;
...
...
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