1
0
mirror of https://github.com/ialley-workshop-open/uni-halo.git synced 2026-06-11 12:49:30 +08:00

feat: 新增投票功能

This commit is contained in:
小莫唐尼
2025-08-20 21:56:34 +08:00
parent 9c6a054b12
commit c0d8cb2c3b
12 changed files with 2939 additions and 1266 deletions
+34
View File
@@ -0,0 +1,34 @@
const UnihaloVoteUid = "unihalo_vote_uid"
export const voteCacheUtil = {
getAll() {
const data = uni.getStorageSync(UnihaloVoteUid)
if (!data) {
return null
}
return JSON.parse(data)
},
get(name) {
const data = this.getAll()
if (!data) {
return null
}
return data[name]
},
has(name) {
const data = this.getAll()
if (!data) return false
return data[name] != undefined
},
set(name, value) {
let data = this.getAll()
if (!data) {
data = {
[name]: value
}
} else {
data[name] = value
}
uni.setStorageSync(UnihaloVoteUid, JSON.stringify(data))
}
}