第二次提交

main
xuan 4 months ago
parent 672164d1fe
commit 2e0dc37993

@ -2,6 +2,7 @@
"pages": [
"pages/index/index",
"pages/home_page/home_page",
"pages/regist/regist",
"pages/logs/logs"
],
"window": {

@ -64,7 +64,38 @@ Page({
}
})
},
class_begin(e){
this.pageRouter.navigateTo({
url: "../regist/regist"
})
},
modify_name(e){
const course = this.data.course
const modify_name = e.target.dataset.info
wx.showModal({
title: '修改',
editable: true,
placeholderText: "修改名称",
complete: (res) => {
if (res.cancel) {
}
if (res.confirm) {
console.log(modify_name)
console.log(course)
for(let i=0,ILen=course.length;i<ILen;i++){
if(course[i]['name'] == modify_name){
course[i]['name'] = res.content
break
}
}
this.setData({
course: course
})
}
}
})
},
/**
* 生命周期函数--监听页面加载

@ -18,13 +18,13 @@
<image class="picture-style" src="./img/3.jpg" mode="aspectFill"/>
<label class="name-text">{{item.name}} | {{item.num}}</label>
<view class="classBtn-layout">
<button class="class-btn">上课</button>
<button class="class-btn" bindtap="class_begin">上课</button>
<button class="class-btn">导入</button>
</view>
</view>
<view class="down-composition">
<view>
<button class="arrow-btn">修改</button>
<button class="arrow-btn" bindtap="modify_name" data-info="{{item.name}}">修改</button>
</view>
<view>
<image class="arrow-icon" src="./img/箭头.png" mode="aspectFill"/>

@ -0,0 +1,66 @@
// pages/regist/regist.js
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})

@ -0,0 +1,3 @@
{
"usingComponents": {}
}

@ -0,0 +1,36 @@
<!--pages/regist/regist.wxml-->
<view class="container1">
<view class="title-block">点名系统</view>
<view class="middle-block">
<view class="name_style">某人姓名</view>
<view>
<button class="begin_tyle">开始点明</button>
</view>
<view class="line_tyle"></view>
<view class="btn_layout">
<view>
<button class="btn_sytle">通勤</button>
</view>
<view>
<button class="btn_sytle">缺勤</button>
</view>
</view>
<view class="btn_layout">
<view>
<button class="btn_sytle">正确</button>
</view>
<view>
<button class="btn_sytle">错误</button>
</view>
</view>
<view class="btn_layout">
<view>
<button class="btn_sytle">开小差</button>
</view>
</view>
</view>
<view class="tip-block">
</view>
</view>

@ -0,0 +1,97 @@
/* pages/regist/regist.wxss */
.container1{
display: flex;
flex-direction: column;
align-items: center;
justify-content: space-around;
}
.title-block{
/* 设置尺寸色块 */
height: 50px;
width: 100%;
background-color: lightskyblue;
/* 制作文本样式 */
line-height: 50px;
text-align: center;
font-size: x-large;
font-weight: 600;
color: white;
letter-spacing: 3px;
/* 编辑位置样式 */
margin-top: 0px;
top: 0px;
/* position: fixed; */ /*如果固定页面则不算在布局里面*/
}
.tip-block{
width: 100%;
height: 60px;
background-color: lightskyblue;
line-height: 90px;
display: flex;
flex-direction: row;
justify-content: space-around;
/* align-items: center; */
/* margin-top: 700px; */
bottom: 0px; /*置于底部之前需要设置一个标尺先这里的标尺线是line-height*/
position: fixed;
}
.middle-block{
width: 90%;
height: 600px;
/* background-color: aqua; */
display: flex;
flex-direction: column;
justify-content: space-around;
align-items: center;
margin-top: 10px;
}
.name_style{
width: 60%;
height: 200px;
line-height: 200px;
text-align: center;
background-color: rgb(87, 170, 197);
border-radius: 50%;
font-size: xx-large;
font-weight: bold;
color: white;
}
.begin_tyle{
width: 60%;
height: 50px;
line-height: 45px;
text-align: center;
padding: 0px;
background-color: rgb(87, 170, 197);
font-size: 25px;
border-radius: 20px;
border: 1px solid white;
color: white;
}
.line_tyle{
width: 100%;
height: 1px;
background-color: gray;
}
.btn_layout{
width: 80%;
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
}
.btn_sytle{
width: 100px !important;
height: 35px;
line-height: 35px;
text-align: center;
padding: 0px 0px 0px 10px;
background-color: rgb(87, 170, 197);
letter-spacing: 10px;
font-size: 20px;
color: white;
}
Loading…
Cancel
Save