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
73ec870e
Commit
73ec870e
authored
Sep 24, 2020
by
yyh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
首页更新
parent
a79e0359
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
37 additions
and
55 deletions
+37
-55
Index.ts
src/mixins/Index.ts
+9
-0
index.ts
src/store/index.ts
+12
-1
Index-cs.vue
src/views/index/Index-cs.vue
+8
-39
Index-sy.vue
src/views/index/Index-sy.vue
+8
-15
No files found.
src/mixins/Index.ts
0 → 100644
View file @
73ec870e
import
{
Component
,
Vue
}
from
'vue-property-decorator'
;
import
{
State
,
Action
}
from
'vuex-class'
;
@
Component
export
default
class
Index
extends
Vue
{
@
Action
(
'getSysTemplateList'
)
private
getSysTemplateList
!
:
()
=>
void
;
public
mounted
()
{
this
.
getSysTemplateList
();
}
}
src/store/index.ts
View file @
73ec870e
...
@@ -14,12 +14,13 @@ export default new Vuex.Store({
...
@@ -14,12 +14,13 @@ export default new Vuex.Store({
authInfo
:
{},
// 个人认证信息
authInfo
:
{},
// 个人认证信息
companyAuthInfo
:
{},
// 企业认证信息
companyAuthInfo
:
{},
// 企业认证信息
proofCount
:
0
,
proofCount
:
0
,
sysTemplateList
:
[],
},
},
getters
:
{
getters
:
{
isPhone
(
{
userInfo
})
{
isPhone
(
{
userInfo
})
{
return
userInfo
.
phone
;
return
userInfo
.
phone
;
},
},
isPhoneStr
(
{
userInfo
})
{
isPhoneStr
(
{
userInfo
})
{
return
userInfo
.
phone
?
'手机号'
:
'邮箱'
;
return
userInfo
.
phone
?
'手机号'
:
'邮箱'
;
},
},
userIcon
(
{
userInfo
}
)
{
userIcon
(
{
userInfo
}
)
{
...
@@ -48,6 +49,9 @@ export default new Vuex.Store({
...
@@ -48,6 +49,9 @@ export default new Vuex.Store({
updateProofCount
(
state
:
any
,
payload
:
any
)
{
updateProofCount
(
state
:
any
,
payload
:
any
)
{
state
.
proofCount
=
payload
;
state
.
proofCount
=
payload
;
},
},
updateSysTemplateList
(
state
:
any
,
payload
:
any
)
{
state
.
sysTemplateList
=
payload
||
[];
},
},
},
actions
:
{
actions
:
{
getUserInfo
({
commit
})
{
getUserInfo
({
commit
})
{
...
@@ -87,6 +91,13 @@ export default new Vuex.Store({
...
@@ -87,6 +91,13 @@ export default new Vuex.Store({
commit
(
'updateCompanyAuthInfo'
,
res
);
commit
(
'updateCompanyAuthInfo'
,
res
);
});
});
},
},
getSysTemplateList
({
commit
,
state
})
{
if
(
state
.
sysTemplateList
.
length
<=
0
)
{
Vue
.
prototype
.
$api
.
template
.
systemList
().
then
(({
results
=
[]})
=>
{
commit
(
'updateSysTemplateList'
,
results
);
});
}
},
},
},
modules
:
{
modules
:
{
},
},
...
...
src/views/index/Index-cs.vue
View file @
73ec870e
...
@@ -16,10 +16,11 @@
...
@@ -16,10 +16,11 @@
</div>
</div>
</
template
>
</
template
>
<
script
lang=
"ts"
>
<
script
lang=
"ts"
>
import
{
Component
,
Prop
,
Vue
,
Watch
,
Inject
}
from
'vue-property-decorator'
;
import
{
Component
,
Prop
,
Vue
,
Watch
,
Inject
,
Mixins
}
from
'vue-property-decorator'
;
import
{
List
,
Image
,
Empty
}
from
'vant'
;
import
{
List
,
Image
,
Empty
}
from
'vant'
;
import
{
TEMPLATETYPE
}
from
'@/const/enum'
;
import
{
TEMPLATETYPE
}
from
'@/const/enum'
;
import
{
State
,
Action
}
from
'vuex-class'
;
import
{
State
,
Action
}
from
'vuex-class'
;
import
IndexMixin
from
'@/mixins/Index'
;
@
Component
({
@
Component
({
components
:
{
components
:
{
[
List
.
name
]:
List
,
[
List
.
name
]:
List
,
...
@@ -27,46 +28,14 @@ import { State, Action } from 'vuex-class';
...
@@ -27,46 +28,14 @@ import { State, Action } from 'vuex-class';
[
Empty
.
name
]:
Empty
,
[
Empty
.
name
]:
Empty
,
},
},
})
})
export
default
class
IndexCs
extends
Vue
{
export
default
class
IndexCs
extends
Mixins
(
IndexMixin
)
{
@
Inject
(
'isSy'
)
private
isSy
!
:
boolean
;
@
State
(
'sysTemplateList'
)
private
systemList
!
:
[];
@
Inject
(
'APP-NAME'
)
private
APP_NAME
!
:
string
;
@
State
(
'isLogin'
)
private
isLogin
!
:
boolean
;
@
State
(
'proofCount'
)
private
proofCount
!
:
number
;
@
Action
(
'getProofCount'
)
private
getProofCount
!
:
any
;
private
charityType
:
any
[]
=
[];
private
charityType
:
any
[]
=
[];
private
list
:
any
[]
=
[];
@
Watch
(
'systemList'
,
{
immediate
:
true
,
deep
:
true
})
private
loading
:
boolean
=
true
;
private
async
onChange
(
newVal
:
any
[],
oldVal
:
any
[])
{
@
Watch
(
'isLogin'
,
{
immediate
:
true
})
if
(
newVal
.
length
)
{
private
async
onIsLoginChange
(
newVal
:
boolean
,
oldVal
:
boolean
)
{
this
.
charityType
=
(
newVal
[
0
]
as
any
).
detail
;
if
(
!
newVal
)
{
this
.
loading
=
false
;
}
}
if
(
newVal
)
{
const
promises
=
Promise
.
all
([
this
.
getProofCount
(),
this
.
$api
.
template
.
folderList
({
template_type
:
1
,
})]);
const
[
,
folderListResult
]
=
await
promises
;
const
{
results
=
[]
}
=
folderListResult
;
const
ids
=
results
.
map
((
folder
:
any
)
=>
folder
.
id
);
const
res
=
await
this
.
$api
.
template
.
list
({
id
:
ids
});
this
.
list
=
res
.
results
||
[];
this
.
loading
=
false
;
}
}
private
toLogin
()
{
this
.
$router
.
push
({
name
:
'Login'
});
}
private
mounted
()
{
this
.
getSystemList
();
}
private
async
getSystemList
()
{
const
{
results
=
[]}
=
await
this
.
$api
.
template
.
systemList
();
this
.
charityType
=
results
[
0
].
detail
;
}
private
goTemplList
(
templList
:
[]
=
[])
{
this
.
$router
.
push
({
name
:
'TemplList'
,
query
:
{
templList
:
JSON
.
stringify
(
templList
)
}
});
}
}
private
goProofDetail
(
templateId
:
string
)
{
private
goProofDetail
(
templateId
:
string
)
{
this
.
$router
.
push
({
name
:
'ProofDetail'
,
query
:
{
templateId
}
});
this
.
$router
.
push
({
name
:
'ProofDetail'
,
query
:
{
templateId
}
});
...
...
src/views/index/Index-sy.vue
View file @
73ec870e
...
@@ -19,13 +19,12 @@
...
@@ -19,13 +19,12 @@
:key="id"
:key="id"
@click="goTemplList(detail)"
@click="goTemplList(detail)"
>
>
<van-image
:src=
"folder_simg_url"
width=
"44px"
fit=
"contain"
></van-image>
<van-image
:src=
"folder_simg_url"
width=
"44px"
height=
"64px"
fit=
"contain"
></van-image>
<div
style=
"font-size:14px;color:#353535;"
>
{{
folder_name
}}
</div>
<div
style=
"font-size:14px;color:#353535;"
>
{{
folder_name
}}
</div>
</li>
</li>
</ul>
</ul>
</div>
</div>
<div
<div
v-if=
"isSy"
style=
"display:flex;flex-direction:row;justify-content:space-between;font-size:16px;color:#353535;margin-top:10px;"
style=
"display:flex;flex-direction:row;justify-content:space-between;font-size:16px;color:#353535;margin-top:10px;"
>
>
<p
style=
"font-weight:500;color:#353535;"
>
我的模版
</p>
<p
style=
"font-weight:500;color:#353535;"
>
我的模版
</p>
...
@@ -44,8 +43,8 @@
...
@@ -44,8 +43,8 @@
description=
"您还未添加模板"
description=
"您还未添加模板"
image=
"@/assets/notemplate.png"
>
image=
"@/assets/notemplate.png"
>
</van-empty>
-->
</van-empty>
-->
<empty
v-if=
"!list.length && !loading
&& isSy
"
name=
"moban"
tip=
"您还未添加模板"
></empty>
<empty
v-if=
"!list.length && !loading"
name=
"moban"
tip=
"您还未添加模板"
></empty>
<div
v-if=
"isSy"
>
<div>
<div
class=
"folder-item"
v-for=
"
{id, folder_simg_url, folder_name, detail} of list" :key="id" @click="goTemplList(detail)">
<div
class=
"folder-item"
v-for=
"
{id, folder_simg_url, folder_name, detail} of list" :key="id" @click="goTemplList(detail)">
<van-image
<van-image
class=
"thumb"
class=
"thumb"
...
@@ -61,10 +60,12 @@
...
@@ -61,10 +60,12 @@
</div>
</div>
</
template
>
</
template
>
<
script
lang=
"ts"
>
<
script
lang=
"ts"
>
import
{
Component
,
Prop
,
Vue
,
Watch
,
Inject
}
from
'vue-property-decorator'
;
import
{
Component
,
Prop
,
Vue
,
Watch
,
Inject
,
Mixins
}
from
'vue-property-decorator'
;
import
{
List
,
Image
,
Empty
}
from
'vant'
;
import
{
List
,
Image
,
Empty
}
from
'vant'
;
import
{
TEMPLATETYPE
}
from
'@/const/enum'
;
import
{
TEMPLATETYPE
}
from
'@/const/enum'
;
import
{
State
,
Action
}
from
'vuex-class'
;
import
{
State
,
Action
}
from
'vuex-class'
;
import
IndexMixin
from
'@/mixins/Index'
;
@
Component
({
@
Component
({
components
:
{
components
:
{
[
List
.
name
]:
List
,
[
List
.
name
]:
List
,
...
@@ -72,13 +73,12 @@ import { State, Action } from 'vuex-class';
...
@@ -72,13 +73,12 @@ import { State, Action } from 'vuex-class';
[
Empty
.
name
]:
Empty
,
[
Empty
.
name
]:
Empty
,
},
},
})
})
export
default
class
IndexSy
extends
Vue
{
export
default
class
IndexSy
extends
Mixins
(
IndexMixin
)
{
@
Inject
(
'isSy'
)
private
isSy
!
:
boolean
;
@
Inject
(
'APP-NAME'
)
private
APP_NAME
!
:
string
;
@
Inject
(
'APP-NAME'
)
private
APP_NAME
!
:
string
;
@
State
(
'isLogin'
)
private
isLogin
!
:
boolean
;
@
State
(
'isLogin'
)
private
isLogin
!
:
boolean
;
@
State
(
'proofCount'
)
private
proofCount
!
:
number
;
@
State
(
'proofCount'
)
private
proofCount
!
:
number
;
@
State
(
'sysTemplateList'
)
private
systemList
!
:
[];
@
Action
(
'getProofCount'
)
private
getProofCount
!
:
any
;
@
Action
(
'getProofCount'
)
private
getProofCount
!
:
any
;
private
systemList
:
any
[]
=
[];
private
list
:
any
[]
=
[];
private
list
:
any
[]
=
[];
private
loading
:
boolean
=
true
;
private
loading
:
boolean
=
true
;
@
Watch
(
'isLogin'
,
{
immediate
:
true
})
@
Watch
(
'isLogin'
,
{
immediate
:
true
})
...
@@ -103,13 +103,6 @@ export default class IndexSy extends Vue {
...
@@ -103,13 +103,6 @@ export default class IndexSy extends Vue {
private
toLogin
()
{
private
toLogin
()
{
this
.
$router
.
push
({
name
:
'Login'
});
this
.
$router
.
push
({
name
:
'Login'
});
}
}
private
mounted
()
{
this
.
getSystemList
();
}
private
async
getSystemList
()
{
const
{
results
=
[]}
=
await
this
.
$api
.
template
.
systemList
();
this
.
systemList
=
results
;
}
private
goTemplList
(
templList
:
[]
=
[])
{
private
goTemplList
(
templList
:
[]
=
[])
{
this
.
$router
.
push
({
name
:
'TemplList'
,
query
:
{
templList
:
JSON
.
stringify
(
templList
)
}
});
this
.
$router
.
push
({
name
:
'TemplList'
,
query
:
{
templList
:
JSON
.
stringify
(
templList
)
}
});
}
}
...
...
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