From bd3ce2d0cecc0f8b53f5205da21dc00f71daa6f6 Mon Sep 17 00:00:00 2001
From: Hx <2294602187@qq.com>
Date: Mon, 31 Mar 2025 09:37:17 +0800
Subject: [PATCH 1/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9BUG?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/api/votingElection.ts | 13 +-
src/components/ex-tags/ex-tags.vue | 61 ---
src/pages/mine/index.vue | 1 -
src/pages/myElection/index.vue | 23 +-
src/pages/votingElection/index.vue | 824 +++++++++++++++--------------
src/store/user.ts | 2 +-
6 files changed, 443 insertions(+), 481 deletions(-)
delete mode 100644 src/components/ex-tags/ex-tags.vue
diff --git a/src/api/votingElection.ts b/src/api/votingElection.ts
index dc80f82..269e9e3 100644
--- a/src/api/votingElection.ts
+++ b/src/api/votingElection.ts
@@ -1,12 +1,10 @@
import { request } from '@/utils/http'
-
-
// 获取投票选举(正在进行)
export function getVoteprogress() {
return request.http({
url: '/api/vote_progress',
- method: "GET"
+ method: 'GET'
})
}
@@ -19,11 +17,10 @@ export function voteMember(data: any) {
}
// 获取我的选举
-export function getMyvote(data:any) {
+export function getMyvote(data: any) {
return request.http({
url: '/api/my_vote',
- method: "GET",
- data
-
+ method: 'GET',
+ data
})
-}
\ No newline at end of file
+}
diff --git a/src/components/ex-tags/ex-tags.vue b/src/components/ex-tags/ex-tags.vue
deleted file mode 100644
index 119e414..0000000
--- a/src/components/ex-tags/ex-tags.vue
+++ /dev/null
@@ -1,61 +0,0 @@
-
-
-
- {{ label }}
-
-
-
-
-
-
-
-
-
diff --git a/src/pages/mine/index.vue b/src/pages/mine/index.vue
index 8615d16..50af5a5 100644
--- a/src/pages/mine/index.vue
+++ b/src/pages/mine/index.vue
@@ -79,7 +79,6 @@ const save = () => {
onShow(() => {
reset()
-
getAdminPhone().then((res) => {
const { data } = res as { data: string }
amdinPhone.value = data || ''
diff --git a/src/pages/myElection/index.vue b/src/pages/myElection/index.vue
index d85fd15..1815e69 100644
--- a/src/pages/myElection/index.vue
+++ b/src/pages/myElection/index.vue
@@ -15,7 +15,7 @@
: 'background: #F3F4F6;color: #4B5563'
"
>
- {{ item.vote_title==1?'未开始':(item.vote_title==2?'进行中':'已结束') }}
+ {{ item.vote_title == 1 ? '未开始' : item.vote_title == 2 ? '进行中' : '已结束' }}
@@ -34,7 +34,7 @@
{{ candidate.position }}
-
+
我的选择:
{{ choiceText(candidate.vote_result) }}
@@ -108,18 +108,18 @@ const getList = async () => {
try {
loading.value = true
- let param = {
- openid: userStore.openId,
- page: page.value,
- limit: pageSize.value
- }
+ let param = {
+ openid: userStore.openId,
+ page: page.value,
+ limit: pageSize.value
+ }
// 模拟接口请求(替换为你的真实接口)
const mockData = await getMyvote(param)
- // 处理数据
- electionList.value = [...electionList.value, ...mockData.data.data]
- // electionList.value.push(mockData)
-
+ // 处理数据
+ electionList.value = [...electionList.value, ...mockData.data.data]
+ // electionList.value.push(mockData)
+
// 判断是否还有数据
noMoreData.value = mockData.data.data.length < pageSize.value
} finally {
@@ -137,7 +137,6 @@ const loadMore = () => {
onShow(() => {
getList()
})
-
\ No newline at end of file
+
+
+
+
+
+
+ {{ xjList.title }}
+ 投票开始时间:{{ xjList.start_time }}
+ 投票截止时间:{{ xjList.end_time }}
+
+
+
+
+
+
+
+
+
+ {{ row.name }}
+
+
+ {{ row.position }}
+
+
+
+
+
+ {{ item.butname }}
+
+
+
+
+
+
+
+ 全部同意
+ 提交投票
+
+
+
+
+ 暂时没有选举 请刷新重试
+
+
+ 请您签到之后再进行投票!
+
+
+
+
diff --git a/src/store/user.ts b/src/store/user.ts
index 7aa721a..b7cfb50 100644
--- a/src/store/user.ts
+++ b/src/store/user.ts
@@ -36,7 +36,7 @@ export default defineStore(
.then((res) => {
const { data } = res as { data: userInfoStoreInt }
- userInfo.value = data
+ userInfo.value = data || {}
resolve({ code: 1, data, message: 'SUCCESS' })
})
From 77a7de37df292b016c1d885d9da3975f1a51ff7e Mon Sep 17 00:00:00 2001
From: Hx <2294602187@qq.com>
Date: Mon, 31 Mar 2025 10:12:48 +0800
Subject: [PATCH 2/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9BUG?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/pages/votingElection/index.vue | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/src/pages/votingElection/index.vue b/src/pages/votingElection/index.vue
index 5beef7e..e6f4fcb 100644
--- a/src/pages/votingElection/index.vue
+++ b/src/pages/votingElection/index.vue
@@ -111,9 +111,7 @@ onShow(() => {
uni.navigateTo({
url: '/pages/login/login'
})
- }
-
- if (isEmptyObject(userStore.userInfo)) {
+ } else if (isEmptyObject(userStore.userInfo)) {
showDialog.value = true
}
})
From aef69496cea39d9a78372e267714e87a0d569e67 Mon Sep 17 00:00:00 2001
From: Hx <2294602187@qq.com>
Date: Mon, 31 Mar 2025 14:53:09 +0800
Subject: [PATCH 3/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=AD=BE=E5=88=B0?=
=?UTF-8?q?=E5=8A=9F=E8=83=BD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/pages/mine/add.vue | 4 +++-
src/pages/mine/index.vue | 2 +-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/pages/mine/add.vue b/src/pages/mine/add.vue
index fc58bd7..b017f89 100644
--- a/src/pages/mine/add.vue
+++ b/src/pages/mine/add.vue
@@ -31,7 +31,9 @@ const onSubmit = uni.$util.debounce(() => {
addAPi(formData).then(() => {
uni.hideLoading()
- uni.switchTab({ url: '/pages/mine/index' })
+ uni.showToast({ title: '签到成功,等待投票!', icon: 'none' })
+
+ setTimeout(() => uni.switchTab({ url: '/pages/mine/index' }), 1000)
})
}
})
diff --git a/src/pages/mine/index.vue b/src/pages/mine/index.vue
index 50af5a5..39b7a44 100644
--- a/src/pages/mine/index.vue
+++ b/src/pages/mine/index.vue
@@ -38,7 +38,7 @@ const updateUserInfo = () => {
userStore.bindUser(list.value[activeKey.value].id as number).then(() => {
reset()
userStore.getUserInfo()
- uni.showToast({ title: '绑定成功', icon: 'none' })
+ uni.showToast({ title: '签到成功,等待投票!', icon: 'none' })
})
}