Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
weixin_47563380
NodeJS_629197
提交
8e21641c
N
NodeJS_629197
项目概览
weixin_47563380
/
NodeJS_629197
与 Fork 源项目一致
Fork自
inscode / NodeJS
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
N
NodeJS_629197
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
8e21641c
编写于
8月 16, 2024
作者:
W
weixin_47563380
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fri Aug 16 14:28:00 CST 2024 inscode
上级
eff3ce09
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
183 addition
and
0 deletion
+183
-0
test/pages/mulbutton/mulbutton.js
test/pages/mulbutton/mulbutton.js
+86
-0
test/pages/mulbutton/mulbutton.json
test/pages/mulbutton/mulbutton.json
+3
-0
test/pages/mulbutton/mulbutton.wxml
test/pages/mulbutton/mulbutton.wxml
+26
-0
test/pages/mulbutton/mulbutton.wxss
test/pages/mulbutton/mulbutton.wxss
+68
-0
未找到文件。
test/pages/mulbutton/mulbutton.js
0 → 100644
浏览文件 @
8e21641c
// pages/mulbutton/mulbutton.js
Page
({
/**
* 页面的初始数据
*/
data
:
{
buttons
:
[
{
text
:
'
按钮1
'
,
active
:
false
},
{
text
:
'
按钮2
'
,
active
:
false
},
{
text
:
'
按钮3
'
,
active
:
false
},
],
selectedIndex
:
null
,
// 记录当前选中的按钮索引
},
handleClick
:
function
(
e
)
{
const
index
=
e
.
currentTarget
.
dataset
.
index
;
// 先将所有按钮置为非激活状态
let
buttons
=
this
.
data
.
buttons
.
map
(
button
=>
{
button
.
active
=
false
;
return
button
;
});
// 将当前点击的按钮置为激活状态
buttons
[
index
].
active
=
true
;
// 更新数据和页面
this
.
setData
({
buttons
,
selectedIndex
:
index
,
});
},
/**
* 生命周期函数--监听页面加载
*/
onLoad
(
options
)
{
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady
()
{
},
/**
* 生命周期函数--监听页面显示
*/
onShow
()
{
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide
()
{
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload
()
{
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh
()
{
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom
()
{
},
/**
* 用户点击右上角分享
*/
onShareAppMessage
()
{
}
})
\ No newline at end of file
test/pages/mulbutton/mulbutton.json
0 → 100644
浏览文件 @
8e21641c
{
"usingComponents"
:
{}
}
\ No newline at end of file
test/pages/mulbutton/mulbutton.wxml
0 → 100644
浏览文件 @
8e21641c
<view class="test">
<view class="buttontype" wx:for="{{buttons}}" wx:key="index" data-index="{{index}}" bindtap="handleClick" style="{{item.active ? 'background-color: #14cfdc; color: white;' : 'background-color: #f0f0f0; color: black;'}}">
{{item.text}}
</view>
</view>
<view class="test">
<text class="textbutton" wx:for="{{buttons}}" wx:key="index" data-index="{{index}}" bindtap="handleClick" style="{{item.active ? 'background-color: #007aff; color: white;' : 'background-color: #f0f0f0; color: black;'}}">
{{item.text}}
</text>
</view>
<view class="test">
<text class="textbutton">11
</text>
<text class="textbutton">11
</text>
<text class="textbutton">11
</text>
</view>
<view class="bottom">
<button size="mini" class="zhuanfa1">转发评分</button>
<button size="mini" class="jisuan">计算得分</button>
<button size="mini" class="chakan">查看记录</button>
</view>
\ No newline at end of file
test/pages/mulbutton/mulbutton.wxss
0 → 100644
浏览文件 @
8e21641c
/* pages/mulbutton/mulbutton.wxss */
.container {
width: 320px;
height: 30%;
/*justify-content: space-around; 按钮之间的间隔平均分布,也可以根据需要调整 */
align-items: center; /* 垂直居中,如果按钮高度不一致时有用 */
padding: 10px; /* 容器内边距 */
}
.container button {
width: 85px;
padding: 5px 5px;
margin: 5px;
background-color: #f0f0f0; /* 默认颜色 */
border: none;
outline: none;
}
.test{
display: flex; /* 使用Flexbox布局 */
padding: 5px 5px;
align-items: center; /* 垂直居中,如果按钮高度不一致时有用 */
background-color: rgb(130, 238, 229);
}
.textbutton{
padding: 5px 5px;
margin: 5px;
width: 80px;
height: 40px;
text-align: center; /* 使文本居中 */
background-color: rgb(109, 219, 95);
justify-content: center;
border-radius:10PX;
}
.buttontype{
padding: 5px 5px;
width: 85px;
margin: 10px;
text-align: center; /* 使文本居中 */
justify-content: center;
border-radius:8PX;
border: 1px solid;
}
.bottom{
position: fixed;
width: 90%;
margin: 0 5%;
display: flex;/* 如果把盒子设置为弹性盒子,必须要加的 */
flex-direction: row;/* 设置一个大盒子内容垂直排列*/
align-items: center;/* 设置一个大盒子内容居中排列*/
bottom: 20rpx;
}
.jisuan{
color:#14cfdc;
border: 1px solid #DC143C;
}
.zhuanfa1{
position: absolute;
color: #228B22;
border: 1px solid #228B22;
}
.chakan{
position: absolute;
right: 0%;
color: #000000;
border: 1px solid #000000;
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录