Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
Community-Mining-Client
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-Client
Commits
8051a625
Commit
8051a625
authored
Sep 02, 2021
by
xhx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
委托限制
parent
685167f1
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
122 additions
and
25 deletions
+122
-25
App.vue
src/App.vue
+26
-2
ListLine.vue
src/components/ListLine.vue
+18
-0
MiningCard.vue
src/components/MiningCard.vue
+2
-1
chain33.ts
src/service/chain33.ts
+17
-1
pool.ts
src/service/pool.ts
+9
-0
bridge.ts
src/utils/bridge.ts
+2
-0
test.ts
src/utils/test.ts
+1
-1
DetailsBar.vue
src/views/Details/DetailsBar.vue
+28
-0
DetailsCard.vue
src/views/Details/DetailsCard.vue
+5
-14
DetailsFooter.vue
src/views/Details/DetailsFooter.vue
+1
-1
DetailsList.vue
src/views/Details/DetailsList.vue
+2
-2
PoolList.vue
src/views/Home/PoolList.vue
+11
-2
index.vue
src/views/Mine/index.vue
+0
-1
No files found.
src/App.vue
View file @
8051a625
...
...
@@ -6,16 +6,40 @@
<
script
lang=
"ts"
>
import
Vue
from
'vue'
import
{
isBind
}
from
'@/service/pool'
import
service
from
'@/service/chain33'
import
{
closeWebview
}
from
'@/utils/bridge'
// import { getCurrentBTYAddress } from '@/utils/bridge' // 币钱包环境
import
{
test
}
from
'@/utils/test'
// 本地测试
import
{
Toast
}
from
'vant'
export
default
Vue
.
extend
({
mounted
()
{
methods
:
{
// 账号是否能进入挖矿
async
hasPoolAddr
(
addr
:
string
)
{
const
response
=
await
service
.
getTicketAddress
(
addr
)
console
.
log
(
response
)
if
(
response
.
data
.
result
?.
data
)
{
isBind
(
response
.
data
.
result
?.
data
).
catch
((
res
:
any
)
=>
{
console
.
log
(
res
.
response
)
const
reason
=
res
.
response
.
data
.
reason
if
(
reason
)
{
Toast
(
'该用户已开启挖矿'
)
setTimeout
(()
=>
{
closeWebview
()
},
1000
)
}
})
}
}
},
created
()
{
// getCurrentBTYAddress('',(res: any) => {
// console.log('res', res)
// this.$store.commit('app/SET_ADDRESS', res)
//
console.log(this.$store.state.app.addres
s)
//
this.hasPoolAddr(re
s)
// })
this
.
$store
.
commit
(
'app/SET_ADDRESS'
,
test
.
addr
)
this
.
hasPoolAddr
(
test
.
addr
)
}
})
</
script
>
...
...
src/components/ListLine.vue
0 → 100644
View file @
8051a625
<
template
>
<div
class=
""
>
</div>
</
template
>
<
script
lang=
"ts"
>
import
Vue
from
'vue'
export
default
Vue
.
extend
({
props
:
{
height
:
{
type
:
String
,
default
:
''
}
}
})
</
script
>
\ No newline at end of file
src/components/MiningCard.vue
View file @
8051a625
...
...
@@ -47,7 +47,8 @@ export default Vue.extend({
},
methods
:
{
goMining
()
{
this
.
$router
.
push
({
path
:
'/details'
,
query
:
{
id
:
(
this
.
info
as
any
).
id
||
'1'
}})
this
.
$emit
(
'goDetails'
,
(
this
.
info
as
any
).
id
)
// this.$router.push({ path: '/details', query: { id: (this.info as any).id || '1' }})
}
}
})
...
...
src/service/chain33.ts
View file @
8051a625
...
...
@@ -2,7 +2,6 @@ import { request } from "./service";
import
axios
from
'axios'
import
{
sign
}
from
'@/utils/bridge'
import
{
rawTransaction
}
from
"@/type/request"
;
import
{
Toast
}
from
"vant"
;
// import { test } from '@/utils/test'
const
service
=
request
(
'http://172.16.100.59:8801'
)
...
...
@@ -155,5 +154,21 @@ export default {
txs
:
any
})
{
return
chainRequire
(
'Chain33.CreateRawTxGroup'
,
[
data
])
},
getTicketAddress
:
function
(
addr
:
string
)
{
return
service
.
request
({
data
:
{
method
:
'Chain33.Query'
,
params
:
[{
execer
:
'ticket'
,
funcName
:
'MinerAddress'
,
payload
:
{
data
:
addr
}
}]
},
method
:
'POST'
})
}
}
\ No newline at end of file
src/service/pool.ts
View file @
8051a625
...
...
@@ -44,6 +44,15 @@ export const checkBind = function(id: string) {
}
/**
* 用户是否绑定挖矿
* @param id
* @returns
*/
export
const
isBind
=
function
(
addr
:
string
)
{
return
service
.
get
(
'/web/is-bind'
,
{
params
:
{
addr
}})
}
/**
* 矿池信息
* @param id
* @returns
...
...
src/utils/bridge.ts
View file @
8051a625
...
...
@@ -4,3 +4,4 @@ const _jsBridge = new jsBridge()
export
const
sign
=
(
params
:
any
,
fn
?:
Function
)
=>
_jsBridge
.
sign
(
params
,
fn
)
export
const
getCurrentBTYAddress
=
(
params
:
any
,
fn
?:
Function
)
=>
_jsBridge
.
getCurrentBTYAddress
(
params
,
fn
)
export
const
signGroup
=
(
params
:
any
,
fn
?:
Function
)
=>
_jsBridge
.
signTxGroup
(
params
,
fn
)
export
const
closeWebview
=
()
=>
_jsBridge
.
closeCurrentWebview
()
\ No newline at end of file
src/utils/test.ts
View file @
8051a625
// export const test = {
// addr: '1
6htvcBNSEA7fZhAdLJphDwQRQJaHpyHTp
',
// addr: '1
3SnepxL5RELnLwxGTWFkMJMgMJqJhP4FV
',
// privateKey: '0xCC38546E9E659D15E6B4893F0AB32A06D103931A8230B0BDE71459D2B27D6944'
// }
// export const test = {
...
...
src/views/Details/DetailsBar.vue
0 → 100644
View file @
8051a625
<
template
>
<div
class=
"bg-gradient-7 py-2 text-13px text-brown3 flex items-center justify-between rounded"
>
<div
class=
"flex-grow border-r border-solid border-card2-color"
>
<div>
挖矿门槛
</div>
<div>
最低
{{
info
.
minTicket
||
10
}}
票
</div>
</div>
<div
class=
"flex-grow border-r border-solid border-card2-color"
>
<div>
矿机周期
</div>
<div>
{{
info
.
days
}}
天
</div>
</div>
<div
class=
"flex-grow"
>
<div>
技术服务费
</div>
<div
class=
"special"
>
限时免费
</div>
</div>
</div>
</
template
>
<
script
lang=
"ts"
>
import
Vue
from
'vue'
export
default
Vue
.
extend
({
props
:
{
info
:
{
type
:
Object
}
}
})
</
script
>
\ No newline at end of file
src/views/Details/DetailsCard.vue
View file @
8051a625
...
...
@@ -13,26 +13,17 @@
<p
class=
"text-base text-red1 font-semibold"
>
已实际出矿收益为准
</p>
</div>
</div>
<div
class=
"bg-gradient-7 py-2 text-13px text-brown3 flex items-center justify-between rounded"
>
<div
class=
"flex-grow border-r border-solid border-card2-color"
>
<div>
挖矿门槛
</div>
<div>
最低
{{
info
.
minTicket
||
10
}}
票
</div>
</div>
<div
class=
"flex-grow border-r border-solid border-card2-color"
>
<div>
矿机周期
</div>
<div>
{{
info
.
days
}}
天
</div>
</div>
<div
class=
"flex-grow"
>
<div>
技术服务费
</div>
<div
class=
"special"
>
限时免费
</div>
</div>
</div>
<details-bar
:info=
"info"
/>
</div>
</
template
>
<
script
lang=
"ts"
>
import
Vue
from
'vue'
import
DetailsBar
from
'@/views/Details/DetailsBar.vue'
export
default
Vue
.
extend
({
components
:
{
DetailsBar
},
props
:
{
info
:
{
type
:
Object
...
...
src/views/Details/DetailsFooter.vue
View file @
8051a625
...
...
@@ -26,7 +26,7 @@ export default Vue.extend({
},
max
:
{
type
:
Number
,
default
:
60
default
:
Infinity
},
min
:
{
type
:
[
Number
,
String
],
...
...
src/views/Details/DetailsList.vue
View file @
8051a625
...
...
@@ -26,11 +26,11 @@
<div
class=
"py-2"
>
<p
class=
"details-item"
>
<span
class=
"flex-shrink-0 mr-3"
>
矿池地址
</span>
<span
class=
"flex-grow-0 hide"
>
{{
info
.
minerAddr
}}
</span>
<span
class=
"flex-grow-0 hide"
>
{{
info
.
minerAddr
||
'-'
}}
</span>
</p>
<p
class=
"details-item"
>
<span
class=
"flex-shrink-0 mr-3"
>
发起人挖矿地址
</span>
<span
class=
"flex-grow-0 hide"
>
{{
info
.
selfAddr
}}
</span>
<span
class=
"flex-grow-0 hide"
>
{{
info
.
selfAddr
||
'-'
}}
</span>
</p>
<p
class=
"details-item"
>
<span>
发起人委托票数
</span>
...
...
src/views/Home/PoolList.vue
View file @
8051a625
...
...
@@ -15,7 +15,7 @@
v-model=
"isLoading"
success-text=
"刷新成功"
@
refresh=
"onRefresh"
>
<MiningCard
v-for=
"(i, index) in lists"
:key=
"index"
:info=
"i"
/>
<MiningCard
v-for=
"(i, index) in lists"
:key=
"index"
:info=
"i"
@
goDetails=
"goDetails"
/>
</van-pull-refresh>
</div>
</
template
>
...
...
@@ -35,7 +35,7 @@ import Vue from 'vue'
import
MiningCard
from
'@/components/MiningCard.vue'
import
Popup
from
'@/components/Popup.vue'
import
Bus
from
'@/utils/bus'
import
{
invitePool
,
poolList
}
from
'@/service/pool'
import
{
invitePool
,
poolList
,
checkBind
}
from
'@/service/pool'
import
{
PullRefresh
,
Toast
}
from
'vant'
export
default
Vue
.
extend
({
components
:
{
...
...
@@ -102,6 +102,15 @@ export default Vue.extend({
this
.
onRefresh
()
},
this
.
waiter
)
},
goDetails
(
val
:
string
)
{
checkBind
(
val
).
then
(
res
=>
{
if
(
res
.
data
.
data
.
isSucc
)
{
this
.
$router
.
push
({
path
:
'/details'
,
query
:
{
id
:
val
||
'1'
}})
}
}).
catch
(()
=>
{
Toast
(
'该账号已绑定过矿池'
)
})
},
addInvite
(
val
:
string
)
{
const
regexp
=
/^
(
1|3
)[
a-zA-Z
\d]{24,33}
$/
if
(
!
val
)
{
...
...
src/views/Mine/index.vue
View file @
8051a625
...
...
@@ -27,7 +27,6 @@ export default Vue.extend({
}
},
methods
:
{
onClickLeft
()
{
this
.
$router
.
back
()
},
...
...
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