|
|
|
@ -65,11 +65,22 @@ const buttlist = ref([ |
|
|
|
} |
|
|
|
]) |
|
|
|
|
|
|
|
const selectBut = (data: any, cardid: any,type: string) => { |
|
|
|
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> |
|
|
|
|
|
|
|
@ -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> |
|
|
|
|