Commit 350c6ff3 authored by xhx's avatar xhx

调整-14

parent ec9b4133
......@@ -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(){
......
......@@ -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)
}
},
......
......@@ -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()
})
},
......
......@@ -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'
console.log(process.env)
console.log(process.env.NODE_ENV)
const 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
})
......
......@@ -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
},
......
<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
......@@ -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 - 380px) !important
height: calc(100vh - 400px) !important
}
.attend-form{
height: calc(100vh - 160px)
......
......@@ -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.creator"
v-clipboard:copy="$route.query.addr"
v-clipboard:success="onCopy"
v-clipboard:error="onError">
<app-icon customize size="16px" color="#FFBB00" type='icon-fuzhi'></app-icon>
......
......@@ -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 => {
......
<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">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment