Browse Source

修改bug

dev
岳鹏龙 1 year ago
parent
commit
3b81067886
  1. 2
      src/pages/myElection/index.vue
  2. 40
      src/pages/votingElection/index.vue

2
src/pages/myElection/index.vue

@ -182,7 +182,7 @@
.election-item {
margin-bottom: 30rpx;
padding: 40rpx;
padding: 34rpx;
border-radius: 24rpx;
background: linear-gradient(0deg, rgba(0, 0, 0, 0.001), rgba(0, 0, 0, 0.001)), #FFFFFF;
box-sizing: border-box;

40
src/pages/votingElection/index.vue

@ -1,5 +1,5 @@
<script setup lang="ts">
const doSearch = (_formData: { page: number; limit: number }, onSuccess: Function) => {
const doSearch = (_formData : { page : number; limit : number }, onSuccess : Function) => {
// const submitData = { ...formData }
// listApi(submitData, userStore.useType).then((res) => {
// const { data } = res as { data: { data: any; total: number } }
@ -47,10 +47,10 @@ const doSearch = (_formData: { page: number; limit: number }, onSuccess: Functio
total: 0
}
})
}
}
const selectIndex = ref(0)
const buttlist = ref([
const selectIndex = ref(0)
const buttlist = ref([
{
type: 'agree',
butname: '同意'
@ -63,14 +63,25 @@ const buttlist = ref([
type: 'neutral',
butname: '弃权'
}
])
])
const selectBut = (data: any, cardid: any,type: string) => {
const target = data.find((card: { id: any; }) => card.id === cardid);
const selectBut = (data : any, cardid : any, type : string, butname: string) => {
const target = data.find((card : { id : any; }) => card.id === cardid);
uni.showModal({
title: '您本轮选举投' + butname + '票',
content: '确定吗?',
success: function (res) {
if (res.confirm) {
if (target) {
target.yijian = target.yijian === type ? null : type;
}
}
} else if (res.cancel) {
console.log('用户点击取消');
}
}
});
}
</script>
<template>
@ -97,13 +108,8 @@ const selectBut = (data: any, cardid: any,type: string) => {
</view>
</view>
<view class="bottomp">
<view
class="minbut"
v-for="(item, ele) in buttlist"
:key="ele"
@click="selectBut(data,row.id,item.type)"
:class="{ active: row.yijian === item.type }"
>
<view class="minbut" v-for="(item, ele) in buttlist" :key="ele"
@click="selectBut(data,row.id,item.type,item.butname)" :class="{ active: row.yijian === item.type }">
{{ item.butname }}
</view>
</view>
@ -119,7 +125,7 @@ const selectBut = (data: any, cardid: any,type: string) => {
</template>
<style scoped lang="scss">
.box {
.box {
width: 100%;
background-color: #f9fafb;
@ -349,5 +355,5 @@ const selectBut = (data: any, cardid: any,type: string) => {
bottom: 0;
border-top: 2rpx solid #ebebec;
}
}
}
</style>
Loading…
Cancel
Save