Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
community_vote
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
hanfeng zhang
community_vote
Commits
350c6ff3
Commit
350c6ff3
authored
Jul 14, 2021
by
xhx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
调整-14
parent
ec9b4133
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
46 additions
and
20 deletions
+46
-20
App.vue
src/App.vue
+3
-1
Card_two.vue
src/components/Card_two.vue
+1
-0
Attend.vue
src/components/mine/Attend.vue
+0
-3
index.ts
src/service/index.ts
+9
-6
index.ts
src/store/app/index.ts
+3
-0
Error.vue
src/views/Error.vue
+18
-0
Home.vue
src/views/Home.vue
+9
-3
PersonVote.vue
src/views/browser/PersonVote.vue
+1
-1
user_initiate.vue
src/views/initiate_comp/user_initiate.vue
+1
-5
AttendCommunity.vue
src/views/mine/AttendCommunity.vue
+1
-1
No files found.
src/App.vue
View file @
350c6ff3
...
...
@@ -4,6 +4,7 @@
<router-view
v-if=
"!cabilityChecked"
></router-view>
<app-wait
v-else-if=
"cabilityChecked === 2"
/>
<app-res
v-else-if=
"cabilityChecked === 3"
:type=
"type"
:res=
"res"
:text=
"text"
/>
<app-error
v-else-if=
"cabilityChecked === 4"
/>
<van-loading
v-else
class=
"w-full h-full flex items-center justify-center bg-app-drak-1"
type=
"spinner"
/>
</keep-alive>
</div>
...
...
@@ -18,7 +19,8 @@ Vue.use(Loading)
export
default
Vue
.
extend
({
components
:
{
'app-wait'
:
()
=>
import
(
'@/components/Wait.vue'
),
'app-res'
:
()
=>
import
(
'@/components/Result.vue'
)
'app-res'
:
()
=>
import
(
'@/components/Result.vue'
),
'app-error'
:
()
=>
import
(
'@/views/Error.vue'
)
},
name
:
'Home'
,
data
(){
...
...
src/components/Card_two.vue
View file @
350c6ff3
...
...
@@ -76,6 +76,7 @@ export default Vue.extend({
methods
:{
goClose
(
id
:
string
)
{
if
(
this
.
status
===
4
)
return
if
(
this
.
status
<
4
&&
this
.
isClose
)
return
this
.
$emit
(
'closeOption'
,
id
)
}
},
...
...
src/components/mine/Attend.vue
View file @
350c6ff3
...
...
@@ -139,7 +139,6 @@ export default Vue.extend({
if
(
item
.
type
===
2
)
{
this
.
voteId
=
item
.
ID
item
.
voteOptions
=
item
.
voteOptions
.
filter
((
items
:
{
creator
:
string
})
=>
items
.
creator
===
this
.
$store
.
state
.
app
.
address
)
// item.voteOptions = item.voteOptions.filter((items: { creator: string }) => items.creator === test.addr)
}
})
},
...
...
@@ -199,7 +198,6 @@ export default Vue.extend({
this
.
lists
.
forEach
((
item
:
any
)
=>
{
item
.
description
=
item
.
desc
})
console
.
log
(
this
.
lists
)
// this.setRank()
})
},
...
...
@@ -220,7 +218,6 @@ export default Vue.extend({
this
.
lists
.
forEach
((
item
:
any
)
=>
{
item
.
description
=
item
.
desc
})
console
.
log
(
this
.
lists
)
// this.setRank()
})
},
...
...
src/service/index.ts
View file @
350c6ff3
...
...
@@ -18,8 +18,8 @@ function isSame(w: any, c: any) {
return
false
}
// const url = process.env.NODE_ENV === 'development' ? 'http://172.16.100.93:8901' : 'http://172.16.100.93:8901'
cons
ole
.
log
(
process
.
env
)
console
.
log
(
process
.
env
.
NODE_ENV
)
cons
t
url
=
process
.
env
.
NODE_ENV
===
'development'
?
'http://172.16.100.93:8901'
:
'http://172.16.100.93:8901'
interface
Account
{
address
:
string
...
...
@@ -55,9 +55,10 @@ class ChainService {
}
return
res
},
error
=>
{
Toast
(
'网络异常'
)
loading
.
hideLoading
()
return
Promise
.
reject
(
error
)
Toast
(
'网络异常'
)
loading
.
hideLoading
()
// store.commit('app/SET_ERROR')
return
Promise
.
reject
(
error
)
})
}
...
...
@@ -251,6 +252,8 @@ class ChainService {
/**
* 获取投票活动详情
* @param data
* @param b 是否开启 cancelToken
* @param t cancelToken 回调 this
* @returns
*/
async
voteDetails
(
data
:
voteDetails
,
b
?:
boolean
,
t
?:
any
)
{
...
...
@@ -400,7 +403,7 @@ class ChainService {
}
}
export
const
service
=
new
ChainService
(
'http://172.16.100.93:8901'
,
{
export
const
service
=
new
ChainService
(
url
,
{
address
:
test
.
addr
,
privateKey
:
test
.
privateKey
})
...
...
src/store/app/index.ts
View file @
350c6ff3
...
...
@@ -62,6 +62,9 @@ export const appStore = {
SET_RES
(
state
:
AppType
)
{
state
.
loading
=
3
},
SET_ERROR
(
state
:
AppType
)
{
state
.
loading
=
4
},
SET_TYPE
(
state
:
AppType
,
i
:
number
)
{
state
.
type
=
i
},
...
...
src/views/Error.vue
0 → 100644
View file @
350c6ff3
<
template
>
<div
class=
"w-full h-screen bg-app-drak-1 bg-homeBanner bg-top bg-contain bg-no-repeat flex flex-col items-center justify-center"
>
<div
class=
"text-sm text-center text-white mb-4"
>
页面加载失败
</div>
<button
class=
"text-xs text-center text-white py-1 px-2 border rounded"
@
click=
"refresh"
>
重新加载
</button>
</div>
</
template
>
<
script
lang=
"ts"
>
import
Vue
from
'vue'
export
default
Vue
.
extend
({
methods
:
{
refresh
()
{
window
.
location
.
reload
()
}
}
})
</
script
>
\ No newline at end of file
src/views/Home.vue
View file @
350c6ff3
...
...
@@ -6,12 +6,14 @@
<div
class=
"bot w-11.5/12 mt-3 mx-auto"
ref=
"botbox"
v-if=
'!attendShow'
>
<!--
<app-search
v-if=
'showSearch'
class=
' w-11/12 mx-auto'
@
search=
"search"
></app-search>
-->
<app-search
class=
' w-11/12 mx-auto'
@
search=
"search"
></app-search>
<div
class=
'border-2 border-app-blue-3 h-auto mx-auto mt-5 relative rounded-xl'
ref=
'borderBox'
:class=
"[lists.length > 0 ? status
<
3
?
'
list-contianer
'
:
'
list-contianer1
'
:
'
list-none
']"
>
<div
class=
'border-2 border-app-blue-3 h-auto mx-auto mt-5 relative rounded-xl'
ref=
'borderBox'
:class=
"[ status
<
3
?
'
list-contianer
'
:
'
list-contianer1
']"
>
<!--
<div
class=
'border-2 border-app-blue-3 h-auto mx-auto mt-5 relative rounded-xl'
ref=
'borderBox'
:class=
"[lists.length > 0 ? status
<
3
?
'
list-contianer
'
:
'
list-contianer1
'
:
'
list-none
']"
>
-->
<div
class=
'img-holder w-full absolute -top-4 '
>
<div
class=
' absolute w-full top-2 text-center text-sm '
>
排行榜
</div>
<img
src=
"@/assets/home/rank-title.png"
alt=
""
class=
"w-48 mx-auto "
>
</div>
<div
class=
'w-11.5/12 mx-auto my-8 pb-2'
@
scroll=
"scrollStart"
ref=
'scrollBox'
:class=
"[lists.length > 0 ? status
<
3
?
'
list1
'
:
'
list11
'
:
'
list1-none
']"
>
<div
class=
'w-11.5/12 mx-auto my-8 pb-2'
@
scroll=
"scrollStart"
ref=
'scrollBox'
:class=
"[ status
<
3
?
'
list1
'
:
'
list11
'
]"
>
<!--
<div
class=
'w-11.5/12 mx-auto my-8 pb-2'
@
scroll=
"scrollStart"
ref=
'scrollBox'
:class=
"[lists.length > 0 ? status
<
3
?
'
list1
'
:
'
list11
'
:
'
list1-none
']"
>
-->
<template
v-if=
"lists.length > 0"
>
<div
v-for=
"(i, index) in lists"
:key=
"index"
@
click=
"goVote(i.id)"
>
<app-card2
class=
"mb-2"
:cardContent=
"i"
:status=
"status"
/>
...
...
@@ -134,6 +136,7 @@ export default Vue.extend({
},
getList
(
v
?:
string
,
vid
?:
string
)
{
// if (typeof this.cancelAjax === 'function') {
// console.log(this.cancelAjax)
// this.cancelAjax()
// }
service
.
voteDetails
({
...
...
@@ -145,6 +148,7 @@ export default Vue.extend({
}
}).
then
(
res
=>
{
if
(
res
.
data
.
error
!=
null
)
{
clearInterval
(
this
.
timer
)
return
}
this
.
res
=
res
.
data
.
result
...
...
@@ -186,6 +190,8 @@ export default Vue.extend({
this
.
timeStamp
=
res
.
data
.
result
.
mainBlockTime
*
1000
+
(
+
end
-
v
)
*
5000
+
''
}
})
}).
catch
(()
=>
{
clearInterval
(
this
.
timer
)
})
}
},
...
...
@@ -206,7 +212,7 @@ export default Vue.extend({
height
:
calc
(
100vh
-
340px
)
}
.list-none
{
height
:
calc
(
100vh
-
38
0px
)
!important
height
:
calc
(
100vh
-
40
0px
)
!important
}
.attend-form
{
height
:
calc
(
100vh
-
160px
)
...
...
src/views/browser/PersonVote.vue
View file @
350c6ff3
...
...
@@ -7,7 +7,7 @@
<div
class=
"flex items-center justify-between mb-0 text-xs"
>
<span
class=
"inline-block mr-2 tracking-tighter"
>
ID:
{{
$route
.
query
.
addr
}}
</span>
<div
v-clipboard:copy=
"
message.creato
r"
v-clipboard:copy=
"
$route.query.add
r"
v-clipboard:success=
"onCopy"
v-clipboard:error=
"onError"
>
<app-icon
customize
size=
"16px"
color=
"#FFBB00"
type=
'icon-fuzhi'
></app-icon>
...
...
src/views/initiate_comp/user_initiate.vue
View file @
350c6ff3
...
...
@@ -230,7 +230,6 @@ export default Vue.extend({
})
},
checkName
()
{
console
.
log
(
this
.
form
)
if
(
!
this
.
form
.
name
)
return
service
.
checkName
(
this
.
form
.
name
).
then
(
res
=>
{
if
(
res
.
data
.
result
)
{
...
...
@@ -326,7 +325,6 @@ export default Vue.extend({
}
console
.
log
(
params
)
service
.
createVote
(
params
,
()
=>
{
// this.$store.commit('app/SET_INDEX', 2)
this
.
$store
.
commit
(
'app/SET_TEXT1'
,
'提案'
)
this
.
$store
.
commit
(
'app/CLEAR_MEMBER'
)
this
.
$store
.
commit
(
'app/CLEAR_FORM'
)
...
...
@@ -390,14 +388,11 @@ export default Vue.extend({
if
(
Object
.
keys
(
this
.
$store
.
state
.
app
.
form
).
length
>
0
)
{
this
.
form
=
this
.
$store
.
state
.
app
.
form
}
// this.options = this.form.options
console
.
log
(
this
.
form
)
}
},
formContent
(
n
)
{
// 重新发起时的数据渲染
const
status
=
Object
.
keys
(
this
.
$store
.
state
.
app
.
form
)
console
.
log
(
status
)
if
(
status
.
length
>
0
)
{
// 人员编辑完成
this
.
checked
=
false
...
...
@@ -415,6 +410,7 @@ export default Vue.extend({
this
.
checked
=
(
this
.
form
as
any
).
isOpen
this
.
$store
.
commit
(
'app/SET_MEMBER'
,
n
.
members
)
this
.
options
=
(
this
.
form
as
any
).
voteOptions
this
.
form
.
options
=
this
.
options
delete
(
this
.
form
as
any
).
voteOptions
this
.
num
=
this
.
$store
.
state
.
app
.
members
?.
length
service
.
getHeight
().
then
(
res
=>
{
...
...
src/views/mine/AttendCommunity.vue
View file @
350c6ff3
<
template
>
<div>
<child-view>
<child-view
rightText=
"参与投票"
@
rightHandle=
"goVote"
>
<div
class=
"sub-page"
>
<div
class=
"mt-0.5 mx-4 py-5 bg-app-dark-2 border border-app-blue-3 border-solid rounded-lg"
>
<div
class=
"px-4"
>
...
...
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