Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
traceSourceMb
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
yanyanhong
traceSourceMb
Commits
ac26cd87
Commit
ac26cd87
authored
Dec 25, 2020
by
chenqikuai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 修复退出后查看首页仍然后可以看到自创文件夹的bug、修复首页刷新时还未加载数据就显示“您还未添加模板”的bug
N
parent
7f4d53fe
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
45 additions
and
19 deletions
+45
-19
index.ts
src/store/index.ts
+2
-0
template.ts
src/store/modules/template.ts
+5
-0
Index-sy.vue
src/views/index/Index-sy.vue
+31
-19
AccountNum.vue
src/views/userCenter/AccountNum.vue
+7
-0
No files found.
src/store/index.ts
View file @
ac26cd87
...
...
@@ -6,6 +6,7 @@ import { template } from './modules/template';
export
default
new
Vuex
.
Store
({
state
:
{
isLogin
:
false
,
isLogin2
:
null
,
isSetPwd
:
0
,
// 0 未设置 1 已设置
userInfo
:
{
phone
:
''
,
...
...
@@ -33,6 +34,7 @@ export default new Vuex.Store({
mutations
:
{
updateIsLogin
(
state
:
any
,
payLoad
:
any
)
{
state
.
isLogin
=
payLoad
;
state
.
isLogin2
=
payLoad
;
},
updateUserInfo
(
state
:
any
,
payLoad
:
any
)
{
state
.
userInfo
=
{
...
state
.
userInfo
,
...
payLoad
};
...
...
src/store/modules/template.ts
View file @
ac26cd87
...
...
@@ -29,6 +29,11 @@ const mutations = {
...
payload
,
};
},
clearData
(
state
:
any
)
{
state
.
userFolderList
=
[];
state
.
isFinished
=
false
;
state
.
page
=
0
;
},
};
const
actions
=
{
async
getSysTemplateList
({
commit
}:
any
)
{
...
...
src/views/index/Index-sy.vue
View file @
ac26cd87
...
...
@@ -54,7 +54,11 @@
name=
"moban"
tip=
"您还未添加模板"
></empty>
<folder-list
:mode=
"EFolderListMode.SHOW"
:handleClickFolder=
"handleClickFolder"
/>
<folder-list
v-if=
"!loading && isLogin"
:mode=
"EFolderListMode.SHOW"
:handleClickFolder=
"handleClickFolder"
/>
<more-action
:show
.
sync=
"show"
:menuList=
"actionList"
...
...
@@ -95,7 +99,7 @@ import IndexMixin from '@/mixins/Index';
import
AddFolder
from
'@/views/template/components/AddFolder.vue'
;
import
SysFolderItem
from
'./components/SysFolderItem.vue'
;
import
UserFolderItem
from
'./components/UserFolderItem.vue'
;
import
FolderList
from
"@/views/components/FolderList.vue"
;
import
FolderList
from
'@/views/components/FolderList.vue'
;
import
{
IGetUserFoldersPayload
}
from
'@/store/modules/types'
;
import
{
EFolderListMode
}
from
'../components/types'
;
...
...
@@ -106,17 +110,19 @@ const Template = namespace('template');
AddFolder
,
SysFolderItem
,
UserFolderItem
,
FolderList
FolderList
,
},
})
export
default
class
IndexSy
extends
Mixins
(
IndexMixin
)
{
@
Inject
(
'APP-NAME'
)
private
APP_NAME
!
:
string
;
@
State
(
'isLogin'
)
private
isLogin
!
:
boolean
;
@
State
(
'isLogin
2
'
)
private
isLogin
!
:
boolean
;
@
Proof
.
State
(
'proofCount'
)
private
proofCount
!
:
number
;
@
Proof
.
Action
(
'getProofCount'
)
private
getProofCount
!
:
any
;
@
Template
.
Action
(
'getUserFoldersFixed'
)
private
getUserFolders
!
:
(
payload
?:
IGetUserFoldersPayload
)
=>
void
;
@
Template
.
Mutation
(
'setPage'
)
private
setPage
!
:(
page
:
number
)
=>
void
;
@
Template
.
State
(
'page'
)
private
page
!
:
number
;
@
Template
.
Action
(
'getUserFoldersFixed'
)
private
getUserFolders
!
:
(
payload
?:
IGetUserFoldersPayload
)
=>
void
;
@
Template
.
Mutation
(
'setPage'
)
private
setPage
!
:
(
page
:
number
)
=>
void
;
@
Template
.
State
(
'page'
)
private
page
!
:
number
;
@
Template
.
State
(
'userFolderList'
)
private
list
!
:
any
[];
private
currentFolder
:
object
=
{};
private
show
:
boolean
=
false
;
...
...
@@ -125,14 +131,18 @@ export default class IndexSy extends Mixins(IndexMixin) {
private
showAddFolder
:
boolean
=
false
;
private
EFolderListMode
=
EFolderListMode
;
@
Watch
(
'isLogin'
,
{
immediate
:
true
})
private
async
onIsLoginChange
(
newVal
:
boolean
,
oldVal
:
boolean
)
{
if
(
!
newVal
)
{
this
.
loading
=
false
;
}
else
{
this
.
setPage
(
1
);
const
promises
=
[
this
.
getProofCount
(),
this
.
getUserFolders
()];
await
Promise
.
all
(
promises
);
this
.
loading
=
false
;
private
async
onIsLoginChange
(
newIsLogin
:
boolean
|
null
,
oldVal
:
boolean
)
{
if
(
newIsLogin
===
null
)
{
//
}
else
if
(
typeof
newIsLogin
===
'boolean'
)
{
if
(
!
newIsLogin
)
{
this
.
loading
=
false
;
}
else
{
this
.
setPage
(
1
);
const
promises
=
[
this
.
getProofCount
(),
this
.
getUserFolders
()];
await
Promise
.
all
(
promises
);
this
.
loading
=
false
;
}
}
}
private
getFolderById
(
folderId
:
number
)
{
...
...
@@ -157,10 +167,13 @@ export default class IndexSy extends Mixins(IndexMixin) {
await
this
.
getUserFolders
({
page
:
this
.
page
});
}
private
handleClickFolder
(
folder
:
any
){
this
.
$router
.
push
({
name
:
'TemplList'
,
query
:
{
folderName
:
folder
.
name
,
id
:
folder
.
id
}
});
private
handleClickFolder
(
folder
:
any
)
{
this
.
$router
.
push
({
name
:
'TemplList'
,
query
:
{
folderName
:
folder
.
name
,
id
:
folder
.
id
},
});
}
private
toLogin
()
{
this
.
$router
.
push
({
name
:
'Login'
});
}
...
...
@@ -234,5 +247,4 @@ export default class IndexSy extends Mixins(IndexMixin) {
border-radius
:
6px
!
important
;
}
}
</
style
>
src/views/userCenter/AccountNum.vue
View file @
ac26cd87
...
...
@@ -21,10 +21,14 @@
</
template
>
<
script
lang=
"ts"
>
import
{
Component
,
Prop
,
Vue
}
from
'vue-property-decorator'
;
import
{
namespace
}
from
"vuex-class"
import
{
Button
,
Image
}
from
'vant'
;
import
{
State
,
Getter
,
Action
,
Mutation
}
from
'vuex-class'
;
import
{
Route
}
from
'vue-router'
;
import
H5Cropper
from
'vue-cropper-h5'
;
const
Template
=
namespace
(
'template'
);
@
Component
({
components
:
{
[
Button
.
name
]:
Button
,
...
...
@@ -40,6 +44,8 @@ export default class AccountNum extends Vue {
@
Action
(
'getUserInfo'
)
private
getUserInfo
!
:
()
=>
void
;
@
Mutation
(
'updateIsLogin'
)
private
updateIsLogin
!
:
(
isLogin
:
boolean
)
=>
void
;
@
Mutation
(
'updateUserInfo'
)
private
updateUserInfo
!
:
(
userInfo
:
any
)
=>
void
;
@
Template
.
Mutation
(
"clearData"
)
private
clearTemplateData
!
:
()
=>
void
;
private
option
:
any
=
{
ceilbutton
:
true
,
canMoveBox
:
true
,
...
...
@@ -58,6 +64,7 @@ export default class AccountNum extends Vue {
localStorage
.
removeItem
(
'userInfo'
);
this
.
updateIsLogin
(
false
);
this
.
updateUserInfo
({});
this
.
clearTemplateData
();
this
.
$router
.
replace
({
path
:
'/'
});
}
}
...
...
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