Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Codet
mini-vote
提交
34038c66
M
mini-vote
项目概览
Codet
/
mini-vote
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
M
mini-vote
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
34038c66
编写于
9月 16, 2020
作者:
Codet
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(*): add vote-button
上级
8d41ca55
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
71 addition
and
15 deletion
+71
-15
src/components/vote-button/vote-button.vue
src/components/vote-button/vote-button.vue
+18
-0
src/components/vote-item/vote-item.vue
src/components/vote-item/vote-item.vue
+12
-6
src/pages.json
src/pages.json
+7
-1
src/pages/detail/detail.vue
src/pages/detail/detail.vue
+12
-0
src/pages/login/login.vue
src/pages/login/login.vue
+22
-8
未找到文件。
src/components/vote-button/vote-button.vue
浏览文件 @
34038c66
<
template
>
<view
@
click=
"handleClick"
>
<slot></slot>
</view>
</
template
>
<
script
lang=
"ts"
>
import
Vue
from
"
vue
"
export
default
Vue
.
extend
({
methods
:
{
handleClick
()
{
console
.
log
(
"
触发点击
"
)
},
},
})
</
script
>
<
style
scoped
></
style
>
src/components/vote-item/vote-item.vue
浏览文件 @
34038c66
...
...
@@ -36,12 +36,14 @@
class=
"flex-1 border border-solid border-gray-500 bg-purple-300 text-white p-2"
>
{{
item
.
stats
[
0
].
value
}}
</view
>
<view
class=
"flex-1 border border-solid border-orange-500 bg-orange-500 text-white p-2"
@
click=
"vote"
>
投票
</view>
<vote-button>
<view
class=
"flex-1 border border-solid border-orange-500 bg-orange-500 text-white p-2"
@
click=
"vote"
>
投票
</view>
</vote-button>
</view>
</view>
</view>
...
...
@@ -49,7 +51,11 @@
<
script
lang=
"ts"
>
import
Vue
from
"
vue
"
import
voteButton
from
"
@/components/vote-button/vote-button.vue
"
export
default
Vue
.
extend
({
components
:
{
voteButton
,
},
data
()
{
return
{}
},
...
...
src/pages.json
浏览文件 @
34038c66
{
"pages"
:
[
{
"path"
:
"pages/
home/home
"
,
"path"
:
"pages/
login/login
"
,
"style"
:
{
"navigationBarTitleText"
:
"微投票"
}
},
{
"path"
:
"pages/home/home"
,
"style"
:
{
"navigationBarTitleText"
:
"婉美投票"
}
},
{
"path"
:
"pages/index/index"
,
"style"
:
{
...
...
src/pages/detail/detail.vue
浏览文件 @
34038c66
...
...
@@ -135,6 +135,18 @@ export default Vue.extend({
provider
:
"
weixin
"
,
success
:
infoRes
=>
{
console
.
log
(
"
用户信息为:
"
,
infoRes
)
//TODO: 传值给后端
uni
.
showToast
({
title
:
"
投票成功!
"
,
icon
:
"
success
"
})
},
fail
:
err
=>
{
console
.
error
(
"
获取用户信息失败
"
,
err
)
uni
.
showToast
({
title
:
`获取用户信息失败,没法进行投票哦!`
,
icon
:
"
none
"
})
}
})
}
...
...
src/pages/login/login.vue
浏览文件 @
34038c66
<
template
>
$END$
<view>
婉美投票
<button
class=
""
open-type=
"getUserInfo"
@
getuserinfo=
"getuserinfo"
>
授权使用微信头像、昵称
</button>
</view>
</
template
>
<
script
>
export
default
{
name
:
"
login.vue
"
}
</
script
>
<
script
lang=
"ts"
>
import
Vue
from
"
vue
"
<
style
scoped
>
export
default
Vue
.
extend
({
methods
:
{
getuserinfo
()
{
uni
.
authorize
({
scope
:
"
scope.userinfo
"
,
success
:
res
=>
{
console
.
log
(
"
授权成功
"
,
res
)
}
})
}
},
})
</
script
>
</
style
>
\ No newline at end of file
<
style
scoped
></
style
>
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录