Commit b649ee41 authored by xhx's avatar xhx

界面

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