Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
Community-Mining-Admin
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
Mining
Community-Mining-Admin
Commits
b34f79a0
Commit
b34f79a0
authored
Aug 27, 2021
by
xhx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
调整
parent
ce0f3334
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
59 additions
and
40 deletions
+59
-40
index.ts
src/router/index.ts
+2
-2
request.ts
src/service/request.ts
+4
-0
utils.ts
src/utils/utils.ts
+1
-1
Home.vue
src/views/Home.vue
+10
-9
Login.vue
src/views/Login.vue
+6
-3
Launch.vue
src/views/mining/Launch.vue
+20
-3
Add.vue
src/views/setting/Add.vue
+2
-7
Info.vue
src/views/user/Info.vue
+14
-15
No files found.
src/router/index.ts
View file @
b34f79a0
...
...
@@ -7,8 +7,8 @@ const routes: Array<RouteConfig> = [
{
path
:
'/'
,
name
:
'App'
,
redirect
:
'/
login
'
,
component
:
()
=>
import
(
/* webpackChunkName: "about" */
'../layout/index.vue'
),
redirect
:
'/
home
'
,
component
:
()
=>
import
(
'../layout/index.vue'
),
children
:
[
{
path
:
'/home'
,
...
...
src/service/request.ts
View file @
b34f79a0
...
...
@@ -106,6 +106,10 @@ export const setOnline = function(data: {id: string}) {
return
service
.
post
(
'/admin/set-online'
,
data
)
}
export
const
setSeq
=
function
(
data
:
{
id
?:
string
})
{
return
service
.
post
(
'/admin/set-seq'
,
data
)
}
/**
* 获取用户列表
* @param data
...
...
src/utils/utils.ts
View file @
b34f79a0
export
const
getDateTime
=
function
(
s
:
string
)
{
const
str
=
s
+
'000'
const
str
=
Number
(
s
+
'000'
)
const
year
=
new
Date
(
str
).
getFullYear
()
const
month
=
new
Date
(
str
).
getMonth
()
>=
10
?
new
Date
(
str
).
getMonth
()
:
'0'
+
new
Date
(
str
).
getMonth
()
const
day
=
new
Date
(
str
).
getDate
()
>=
10
?
new
Date
(
str
).
getDate
()
:
'0'
+
new
Date
(
str
).
getDate
()
...
...
src/views/Home.vue
View file @
b34f79a0
...
...
@@ -4,29 +4,29 @@
<div
class=
"statics-line"
>
<div
class=
"statics-block"
>
<p>
小组长矿池数
</p>
<p>
{{
4
}}
</p>
<p>
{{
info
.
captainPoolNum
}}
</p>
</div>
<div
class=
"statics-block"
>
<p>
官方已发放奖励
</p>
<p>
{{
111
}}
</p>
<p>
{{
info
.
officalAmount
}}
</p>
</div>
<div
class=
"statics-block"
>
<p>
当前所有矿池总票数
</p>
<p>
{{
222
}}
</p>
<p>
{{
info
.
totalPoolTicket
}}
</p>
</div>
</div>
<div
class=
"statics-line"
>
<div
class=
"statics-block"
>
<p>
参与挖矿用户数
</p>
<p>
{{
4
}}
</p>
<p>
{{
info
.
miningPerson
}}
</p>
</div>
<div
class=
"statics-block"
>
<p>
累计推广收益
</p>
<p>
{{
111
}}
</p>
<p>
{{
info
.
totalPopAmount
}}
</p>
</div>
<div
class=
"statics-block"
>
<p>
今日推广收益
</p>
<p>
{{
222
}}
</p>
<p>
{{
info
.
todayPoPAmount
}}
</p>
</div>
</div>
</div>
...
...
@@ -52,9 +52,10 @@ export default Vue.extend({
methods
:
{
getInfo
()
{
// ...
// getStatistic().then(res => {
// this.info = res
// })
getStatistic
().
then
(
res
=>
{
this
.
info
=
res
.
data
console
.
log
(
this
.
info
)
})
console
.
log
(
111
)
}
},
...
...
src/views/Login.vue
View file @
b34f79a0
...
...
@@ -10,7 +10,7 @@
<el-input
v-model=
"form.password"
show-password
></el-input>
</el-form-item>
</el-form>
<el-button
class=
"w-full"
type=
"primary"
@
keypress
.
enter=
"login"
@
click=
"login"
>
登 录
</el-button>
<el-button
class=
"w-full"
type=
"primary"
@
keypress
.
enter=
"login"
:disabled=
"isLogin"
@
click=
"login"
>
登 录
</el-button>
</div>
</div>
</
template
>
...
...
@@ -34,14 +34,14 @@ export default Vue.extend({
{
required
:
true
,
message
:
'请输入密码'
,
trigger
:
'blur'
}
],
},
is
Continue
:
tru
e
is
Login
:
fals
e
}
},
methods
:
{
login
()
{
// success
(
this
.
$refs
[
'form'
]
as
any
).
validate
((
valid
:
any
)
=>
{
if
(
valid
)
{
this
.
isLogin
=
true
login
(
this
.
form
).
then
((
res
:
any
)
=>
{
if
(
res
.
data
.
isSucc
)
{
info
().
then
((
res
:
any
)
=>
{
...
...
@@ -50,6 +50,9 @@ export default Vue.extend({
this
.
$router
.
push
(
'/home'
)
})
}
this
.
isLogin
=
false
}).
catch
(()
=>
{
this
.
isLogin
=
false
})
}
else
{
this
.
$message
.
info
(
'请先填写登录信息'
)
...
...
src/views/mining/Launch.vue
View file @
b34f79a0
...
...
@@ -26,6 +26,7 @@
<el-table-column
prop=
"address"
label=
"矿池到期时间"
>
<template
slot-scope=
"scope"
>
{{
getEndTime
(
scope
.
row
)
}}
</
template
>
</el-table-column>
<el-table-column
prop=
"desc"
...
...
@@ -42,7 +43,7 @@
label=
"委托情况"
>
<
template
slot-scope=
"scope"
>
<!--admin专有-->
<el-button
@
click=
"toTop(scope.row)"
type=
"text"
size=
"small"
>
置顶
</el-button>
<el-button
v-if=
"userType == 2 && +scope.row.seq !== 99"
@
click=
"toTop(scope.row)"
type=
"text"
size=
"small"
>
置顶
</el-button>
<el-button
v-if=
"+scope.row.status !== 2"
@
click=
"statusClick(scope.row)"
type=
"text"
size=
"small"
>
{{
'上线'
}}
</el-button>
<!--
<el-button
@
click=
"statusClick(scope.row)"
type=
"text"
size=
"small"
>
{{
scope
.
row
.
status
===
1
?
'下线'
:
'上线'
}}
</el-button>
-->
<!--
<el-button
@
click=
"editClick(scope.row)"
type=
"text"
size=
"small"
>
编辑
</el-button>
-->
...
...
@@ -110,14 +111,16 @@
<
script
lang=
"ts"
>
import
Vue
from
'vue'
import
Pagination
from
'@/components/Panigation.vue'
import
{
createPool
,
getPoolList
,
removePool
,
setOnline
}
from
'@/service/request'
import
{
createPool
,
getPoolList
,
removePool
,
setOnline
,
setSeq
}
from
'@/service/request'
import
{
getStorage
}
from
'@/utils/storage'
import
{
getDateTime
}
from
'@/utils/utils'
export
default
Vue
.
extend
({
components
:
{
Pagination
},
data
()
{
return
{
userType
:
''
,
list
:
[]
as
any
,
id
:
''
,
total
:
40
,
...
...
@@ -168,10 +171,16 @@ export default Vue.extend({
pageSize
:
this
.
pageSize
,
limit
:
10
}).
then
((
res
:
any
)
=>
{
this
.
list
=
[]
this
.
list
=
(
res
.
data
as
any
)?.
list
||
[]
this
.
total
=
+
res
.
data
.
count
})
},
getEndTime
(
item
:
any
)
{
const
str
=
(
+
item
.
startTime
*
1000
+
+
item
.
days
*
24
*
3600
*
1000
)
/
1000
+
''
console
.
log
(
str
)
return
getDateTime
(
str
)
},
initForm
()
{
this
.
form
=
{
name
:
''
,
...
...
@@ -216,7 +225,13 @@ export default Vue.extend({
this
.
pageSize
=
v
.
pageSize
this
.
getList
()
},
toTop
()
{
toTop
(
item
:
{
id
:
string
})
{
setSeq
({
id
:
item
.
id
}).
then
(
res
=>
{
if
(
res
.
data
.
isSucc
)
{
this
.
$message
.
success
(
'置顶成功'
)
this
.
getList
()
}
})
console
.
log
(
'toTop'
)
},
statusClick
(
item
:
any
)
{
...
...
@@ -254,6 +269,8 @@ export default Vue.extend({
}
},
created
()
{
this
.
userType
=
(
getStorage
(
'type'
)
as
string
).
slice
(
1
,
2
)
console
.
log
(
this
.
userType
)
this
.
getList
()
}
})
...
...
src/views/setting/Add.vue
View file @
b34f79a0
...
...
@@ -71,18 +71,13 @@
import
Vue
from
'vue'
import
Pagination
from
'@/components/Panigation.vue'
import
{
addAdmin
,
getAdminLists
}
from
'@/service/request'
import
{
getDateTime
}
from
'@/utils/utils'
export
default
Vue
.
extend
({
components
:
{
Pagination
},
data
()
{
return
{
list
:
[
{
name
:
1
}
]
as
any
,
list
:
[]
as
any
,
total
:
40
,
dialogVisible
:
false
,
form
:
{
...
...
@@ -163,7 +158,7 @@ export default Vue.extend({
this
.
getList
()
},
statusClick
(
item
:
any
)
{
this
.
dialogVisible
=
true
//
this.dialogVisible = true
},
delClick
()
{
this
.
delVisible
=
true
...
...
src/views/user/Info.vue
View file @
b34f79a0
...
...
@@ -20,9 +20,9 @@
</div>
</div>
<div
class=
"statistics"
>
<span>
当前推荐人下线委托总票数:
{{
2
}}
票
</span>
<span>
推荐人数:
{{
3
}}
票
</span>
<span>
正在挖矿人数:
{{
4
}}
票
</span>
<span>
当前推荐人下线委托总票数:
{{
msg
.
a
||
0
}}
票
</span>
<span>
推荐人数:
{{
msg
.
b
||
0
}}
票
</span>
<span>
正在挖矿人数:
{{
msg
.
c
||
0
}}
票
</span>
</div>
<el-table
:data=
"list"
...
...
@@ -39,6 +39,7 @@
<el-table-column
prop=
"bindTime"
label=
"绑定时间"
>
<template
slot-scope=
"scope"
>
{{
getDateTime
(
scope
.
row
.
bindTime
)
}}
</
template
>
</el-table-column>
<el-table-column
label=
"委托情况"
>
...
...
@@ -72,6 +73,7 @@
import
Vue
from
'vue'
import
Pagination
from
'@/components/Panigation.vue'
import
{
getUserLists
}
from
'@/service/request'
import
{
getDateTime
}
from
'@/utils/utils'
export
default
Vue
.
extend
({
components
:
{
Pagination
...
...
@@ -82,7 +84,8 @@ export default Vue.extend({
type
:
1
,
text
:
''
},
list
:
[
1
]
as
any
,
msg
:
{}
as
any
,
list
:
[]
as
any
,
total
:
40
,
dialogVisible
:
false
,
items
:
[]
as
any
,
...
...
@@ -102,21 +105,17 @@ export default Vue.extend({
this
.
total
=
+
res
.
data
.
count
})
},
getDateTime
(
s
:
string
)
{
let
t
=
''
if
(
!
s
)
{
t
=
'0'
}
return
getDateTime
(
t
)
},
filterList
()
{
this
.
page
=
1
this
.
pageSize
=
10
this
.
getList
()
// if (this.search.type === 1) {
// console.log('type2', this.search.type)
// this.list = this.list.filter((item: { addrs: string }) => {
// item.addrs === this.search.text
// })
// } else {
// console.log('type1', this.search.type)
// this.list = this.list.filter((item: { addr: string }) => {
// item.addr === this.search.text
// })
// }
},
handleClick
()
{
this
.
dialogVisible
=
true
...
...
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