Commit b649ee41 authored by xhx's avatar xhx

界面

parent 062bbc5c
This diff is collapsed.
...@@ -23,7 +23,12 @@ ...@@ -23,7 +23,12 @@
<div class=' text-xs'>当前票数 <span>{{ cardContent.score }}</span></div> <div class=' text-xs'>当前票数 <span>{{ cardContent.score }}</span></div>
</div> </div>
<div class='flex-grow-0'> <div class='flex-grow-0'>
<app-btn :text='voteText' class="bg-app-blue-2 rounded" border="border-none"></app-btn> <div v-if="showClose" class="py-3" @click.stop="goClose(cardContent.id)">
<div class="w-4 h-4 border border-white border-solid rounded-full flex items-center justify-center">
<app-icon customize size="10px" color="#fff" type='icon-guanbi'></app-icon>
</div>
</div>
<app-btn v-else :text='voteText' class="bg-app-blue-2 rounded" border="border-none"></app-btn>
</div> </div>
</div> </div>
<div class="bottom bg-app-blue-3 rounded-bl-xl rounded-br-xl px-5 py-5"> <div class="bottom bg-app-blue-3 rounded-bl-xl rounded-br-xl px-5 py-5">
...@@ -49,18 +54,27 @@ export default Vue.extend({ ...@@ -49,18 +54,27 @@ export default Vue.extend({
status: { status: {
type: Number, type: Number,
default: 2 default: 2
},
showClose: {
type: Boolean,
default: false
} }
}, },
data() { data() {
return { return {
lists: [require('@/assets/1.png'),require('@/assets/2.png'),require('@/assets/3.png'),require('@/assets/4.png'),], lists: [require('@/assets/1.png'),require('@/assets/2.png'),require('@/assets/3.png'),require('@/assets/4.png'),],
voteText: '投票' voteText: '投票',
optionId: ''
} }
}, },
methods:{ methods:{
goClose(id: string) {
this.$emit('closeOption', id)
}
}, },
components:{ components:{
'app-btn':()=>import('@/components/common/Btn.vue') 'app-btn':()=>import('@/components/common/Btn.vue'),
'app-icon':() => import('@/components/common/Icon.vue')
}, },
watch: { watch: {
status(n) { status(n) {
......
...@@ -7,15 +7,19 @@ ...@@ -7,15 +7,19 @@
class="w-full inline-block text-white" class="w-full inline-block text-white"
:class="[ item.type === 1 ? 'mb-3' : '' ]" :class="[ item.type === 1 ? 'mb-3' : '' ]"
> >
<template v-if="item.type === 1"> <template v-if="tab < 3">
<div @click.stop="goPage(item)"> <template v-if="item.type === 1">
<card :cardContent="item" :showEdit="needEdit" :blockTime="blockTime" :blockHeight="blockHeight"></card> <div @click.stop="goPage(item)">
</div> <card :cardContent="item" :showEdit="needEdit" :blockTime="blockTime" :blockHeight="blockHeight"></card>
</div>
</template>
</template> </template>
<template v-else> <template v-else>
<div v-for="(i, index) in item.voteOptions" :key="index" class="w-full inline-block mb-3 text-white" @click="goPage(item, i)"> <template v-if="item.type === 2">
<card-two :cardContent="i"></card-two> <div v-for="(i, index) in item.voteOptions" :key="index" class="w-full inline-block mb-3 text-white" @click="goPage(item, i)">
</div> <card-two :cardContent="i" :showClose="tab === 3 ? true : false" @closeOption="closeOption"></card-two>
</div>
</template>
</template> </template>
</div> </div>
</template> </template>
...@@ -35,6 +39,7 @@ import Card from '@/components/Card.vue' ...@@ -35,6 +39,7 @@ import Card from '@/components/Card.vue'
import CardTwo from '@/components/Card_two.vue' import CardTwo from '@/components/Card_two.vue'
import { service } from '@/service/index' import { service } from '@/service/index'
import { test } from '@/constants/test' import { test } from '@/constants/test'
import { Dialog } from 'vant'
export default Vue.extend({ export default Vue.extend({
components: { components: {
Card, Card,
...@@ -81,6 +86,17 @@ export default Vue.extend({ ...@@ -81,6 +86,17 @@ export default Vue.extend({
this.$router.push({path: '/Mine/AttendProject', query: {voteID: item.ID, optionId: '' }}) this.$router.push({path: '/Mine/AttendProject', query: {voteID: item.ID, optionId: '' }})
} }
}, },
closeOption(v: string) {
Dialog.confirm({
title: '提示',
message: '确认删除当前活动报名?关闭后,你报名活动的相关数据以及投票数据将被清空。',
}).then(() => {
// on confirm
console.log(v)
}).catch(() => {
// on cancel
});
},
setRank() { setRank() {
for (const item of this.lists) { for (const item of this.lists) {
if (item.type === 2) { if (item.type === 2) {
...@@ -100,7 +116,7 @@ export default Vue.extend({ ...@@ -100,7 +116,7 @@ export default Vue.extend({
}) })
}, },
// 发起 // 发起
getSetList() { getSetList(fn?: any) {
service.voteList({ service.voteList({
execer: 'user.p.szhtest.rankvote', execer: 'user.p.szhtest.rankvote',
funcName: 'GetRankVoteList', funcName: 'GetRankVoteList',
...@@ -115,6 +131,7 @@ export default Vue.extend({ ...@@ -115,6 +131,7 @@ export default Vue.extend({
this.lists = res.data.result && res.data.result.list || [] this.lists = res.data.result && res.data.result.list || []
this.setRank() this.setRank()
this.filterSetList() this.filterSetList()
if (fn) fn()
}) })
}, },
// 参与 // 参与
...@@ -136,36 +153,62 @@ export default Vue.extend({ ...@@ -136,36 +153,62 @@ export default Vue.extend({
} }
}, },
watch: { watch: {
tab(n) { // tab(n) {
this.getBlockHeight() // console.log(n)
if (n === 1) { // this.getBlockHeight()
// if (n === 1) {
// this.needEdit = true
// this.lists = []
// this.getSetList()
// } else if (n === 2) {
// this.needEdit = false
// this.lists = []
// this.getAttendList()
// } else if (n === 3) {
// this.lists = []
// this.getSetList()
// } else {
// this.lists = []
// }
// },
// $route(n) {
// console.log('run------------------------------')
// // ...code
// if (n.path !== '/Mine') return
// if (this.tab === 1) {
// this.needEdit = true
// this.lists = []
// this.getSetList()
// } else {
// this.needEdit = false
// this.lists = []
// this.getAttendList()
// }
// }
},
created() {
console.log('tab: ', this.tab)
// this.getSetList()
this.getBlockHeight()
// this.needEdit = true
if (this.tab === 1) {
this.needEdit = true this.needEdit = true
this.lists = [] this.lists = []
this.getSetList() this.getSetList()
} else { } else if (this.tab === 2) {
this.needEdit = false this.needEdit = false
this.lists = [] this.lists = []
this.getAttendList() this.getAttendList()
} } else if (this.tab === 3) {
}, console.log('=======================')
$route(n) {
// ...code
if (n.path !== '/Mine') return
if (this.tab === 1) {
this.needEdit = true
this.lists = [] this.lists = []
this.getSetList() this.getSetList(() => {
this.lists = this.lists.filter(item => item.type === 2)
})
console.log(this.lists)
} else { } else {
this.needEdit = false
this.lists = [] this.lists = []
this.getAttendList()
} }
}
},
created() {
this.getSetList()
this.getBlockHeight()
this.needEdit = true
} }
}) })
</script> </script>
......
...@@ -7,10 +7,11 @@ ...@@ -7,10 +7,11 @@
<div class="w-10/12 text-center"> <div class="w-10/12 text-center">
{{meta.text}} {{meta.text}}
</div> </div>
<div class="w-1/12" > <div class="text-sm flex items-center flex-shrink-0 pr-1.5" @click="rightHandle">
{{ rightText }}
</div> </div>
</div> </div>
<slot></slot> <slot></slot>
</div> </div>
</template> </template>
...@@ -32,12 +33,20 @@ export default Vue.extend({ ...@@ -32,12 +33,20 @@ export default Vue.extend({
meta:{} meta:{}
} }
}, },
props: {
rightText: {
type: String
}
},
mounted(){ mounted(){
this.meta = this.$route.meta this.meta = this.$route.meta
}, },
methods:{ methods:{
navigatTo(){ navigatTo(){
this.$router.go(-1) this.$router.go(-1)
},
rightHandle() {
this.$emit('rightHandle')
} }
} }
}); });
......
...@@ -338,7 +338,10 @@ export default Vue.extend({ ...@@ -338,7 +338,10 @@ export default Vue.extend({
$route: { $route: {
immediate: true, immediate: true,
handler(n, o) { handler(n, o) {
// if (n?.path !== '/Initiate' || n?.path.indexOf('MyInitiate') <= -1) return if (n?.path !== '/Initiate') return
// if (n?.path.indexOf('MyInitiate') <= -1) return
console.log(o)
console.log(n)
if (o?.path !== '/Initiate/Member') { if (o?.path !== '/Initiate/Member') {
this.checked = true this.checked = true
this.init() this.init()
...@@ -349,6 +352,7 @@ export default Vue.extend({ ...@@ -349,6 +352,7 @@ export default Vue.extend({
} }
}, },
formContent(n) { formContent(n) {
// 重新发起时的数据渲染
this.form = n this.form = n
this.checked = (this.form as any).isOpen this.checked = (this.form as any).isOpen
this.options = (this.form as any).voteOptions this.options = (this.form as any).voteOptions
......
<template> <template>
<div> <div>
<child-view> <child-view rightText="参与投票" @rightHandle="goVote">
<div class="sub-page"> <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="mt-0.5 mx-4 py-5 bg-app-dark-2 border border-app-blue-3 border-solid rounded-lg">
<div class="border-0 border-b border-app-blue-3 border-solid px-4 pb-3"> <div class="border-0 border-b border-app-blue-3 border-solid px-4 pb-3">
...@@ -57,6 +57,9 @@ export default Vue.extend({ ...@@ -57,6 +57,9 @@ export default Vue.extend({
} }
}, },
methods: { methods: {
goVote() {
this.$router.push({ path: '/Home/CommunityVote', query: { ...this.$route.query }})
},
sliceStr(i: string) { sliceStr(i: string) {
if (!i) return '' if (!i) return ''
return i.slice(0,9) + '...' + i.slice(-4) return i.slice(0,9) + '...' + i.slice(-4)
......
<template> <template>
<child-view> <child-view rightText="参与投票" @rightHandle="goVote">
<div ref="box" class="sub-page mx-4"> <div ref="box" class="sub-page mx-4">
<div class="bg-app-dark-2 border border-app-blue-3 border-solid rounded-lg"> <div class="bg-app-dark-2 border border-app-blue-3 border-solid rounded-lg">
<div class="p-4 border-0 border-b border-app-blue-3 border-solid"> <div class="p-4 border-0 border-b border-app-blue-3 border-solid">
...@@ -82,6 +82,9 @@ export default Vue.extend({ ...@@ -82,6 +82,9 @@ export default Vue.extend({
} }
}, },
methods: { methods: {
goVote() {
this.$router.push({ path: '/Square/SquareVote', query: { ...this.$route.query }})
},
goProject(id: string) { goProject(id: string) {
this.$router.push({path: '/Browser/ProjectDetails', query: {...this.$route.query, optionId: id}}) this.$router.push({path: '/Browser/ProjectDetails', query: {...this.$route.query, optionId: id}})
}, },
......
...@@ -9,17 +9,17 @@ ...@@ -9,17 +9,17 @@
<attend :tab="tab" /> <attend :tab="tab" />
</keep-alive> --> </keep-alive> -->
<van-tabs class="bg-transparent" :swipe-threshold="3"> <van-tabs class="bg-transparent" :swipe-threshold="3">
<van-tab title="我发起的案"> <van-tab title="我发起的案">
<attend :tab="1" /> <attend :tab="1" />
</van-tab> </van-tab>
<van-tab title="我参与的案"> <van-tab title="我参与的案">
<attend :tab="2" /> <attend :tab="2" />
</van-tab> </van-tab>
<van-tab title="我报名的活动"> <van-tab title="我报名的活动">
<attend :tab="3" /> <attend :tab="3" />
</van-tab> </van-tab>
<van-tab title="我参与的活动"> <van-tab title="我参与的活动">
<attend :tab="4" /> <attend :tab="4" />
</van-tab> </van-tab>
</van-tabs> </van-tabs>
......
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