Skip to content

Commit

Permalink
图书借阅页修改,调整素质签到位置到我的页面
Browse files Browse the repository at this point in the history
  • Loading branch information
iwh718 committed Nov 17, 2019
1 parent 94dbeb9 commit 9cb4248
Show file tree
Hide file tree
Showing 5 changed files with 85 additions and 46 deletions.
33 changes: 15 additions & 18 deletions pages/library/library.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,18 @@ Page({
* 页面的初始数据
*/
data: {
booklist: []
booklist: [{
book_name:"001",
book_year:"2019-12-11",
book_time:"2019-12-20",
book_author:"test"
},
{
book_name:"001",
book_year:"2019-12-11",
book_time:"2019-12-20",
book_author:"test"
}]
},

/**
Expand Down Expand Up @@ -42,7 +53,7 @@ Page({
},

onLoad: function (options) {
this.getBooks()
// this.getBooks()
},

/**
Expand All @@ -56,7 +67,7 @@ Page({
* 生命周期函数--监听页面显示
*/
onShow: function () {
this.getBooks()
// this.getBooks()
},

/**
Expand Down Expand Up @@ -94,21 +105,7 @@ Page({

},

navigateToLecture: function(){
var ifbind = wx.getStorageSync("ifbindlibrary")
if(ifbind == ""){
wx.showToast({
title: '请先登录!',
icon: "none",
duration: 2000
})
}
else{
wx.navigateTo({
url: '/pages/liblecture/liblecture',
})
}
},


navigateToLogin: function(){
var ifbind = wx.getStorageSync("ifbindlibrary")
Expand Down
55 changes: 30 additions & 25 deletions pages/library/library.wxml
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
<!--pages/library/library.wxml-->
<view class="padding text-center">
<view class="padding-xl radius shadow-warp bg-white margin-top">
<button class="cu-btn bg-blue lg" style="width: 90%;" bindtap="navigateToLogin">绑定图书馆账号</button>
<view class="padding"></view>
<button class="cu-btn bg-red lg" style="width: 90%;" bindtap="quit">解绑图书馆账号</button>
</view>
</view>
<!--<view class="padding text-center">-->
<!--<view class="padding-xl radius shadow-warp bg-white margin-top">-->
<!--<button class="cu-btn bg-blue lg" style="width: 90%;" bindtap="navigateToLogin">绑定图书馆账号</button>-->
<!--<view class="padding"></view>-->
<!--<button class="cu-btn bg-red lg" style="width: 90%;" bindtap="quit">解绑图书馆账号</button>-->
<!--</view>-->
<!--</view>-->

<view class="padding text-center">
<view class="padding-xl radius shadow-warp bg-white margin-top">
<button class="cu-btn bg-blue lg" style="width: 90%;" bindtap="navigateToLecture">素质教育签到</button>
</view>
</view>
<!--<view class="padding text-center">-->
<!--<view class="padding-xl radius shadow-warp bg-white margin-top">-->
<!--<button class="cu-btn bg-blue lg" style="width: 90%;" bindtap="navigateToLecture">素质教育签到</button>-->
<!--</view>-->
<!--</view>-->

<view class="padding text-center">
<view class="cu-capsule round">
<view class="cu-tag bg-blue ">
借书数量
</view>
<view class="cu-tag line-blue">
{{booklist[0]['book_count']}}
</view>
</view>
</view>
<!--<view class="padding text-center">-->
<!--<view class="cu-capsule round">-->
<!--<view class="cu-tag bg-blue ">-->
<!--借书数量-->
<!--</view>-->
<!--<view class="cu-tag line-blue">-->
<!--{{booklist[0]['book_count']}}-->
<!--</view>-->
<!--</view>-->
<!--</view>-->

<scroll-view scroll-y="true" class="scroll">
<view wx:for="{{booklist[1]}}" wx:key="book_name">
<view class="padding text-center">
<view class="padding-xl radius shadow-warp bg-white margin-top">
<view wx:for="{{booklist}}" wx:key="book_name">
<view class="padding ">
<view class="padding-xl radius shadow bg-white ">
<view>书名: {{item.book_name}}</view>
<view>出版年份: {{item.book_year}}</view>
<view>应还日期: {{item.book_time}}</view>
Expand All @@ -36,3 +36,8 @@
</view>
</view>
</scroll-view>

<view class="fixed_box">
<view class="current_order">在借:{{booklist.length}}册</view>
<view class="quit_btn" bindtap="quit"> 【注销】</view>
</view>
21 changes: 21 additions & 0 deletions pages/library/library.wxss
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,25 @@
.scroll {
height: 3000px;
z-index: 101;
}

.fixed_box{
padding: 15rpx;
-webkit-border-radius: 20rpx;
-moz-border-radius: 20rpx;
border-radius: 20rpx;
display: flex;
position: fixed;
z-index: 99999!important;
right: 5%;
color:#fff;
bottom: 15%;
-webkit-box-shadow: 0 1px 2px 2px rgba(0,0,0,0.1) ;
-moz-box-shadow: 0 1px 2px 2px rgba(0,0,0,0.1);
box-shadow: 0 1px 2px 2px rgba(0,0,0,0.1) ;
background: #6f89c5;
}
.quit_btn{
margin-left: 20rpx;
margin-right: 20rpx;
}
18 changes: 17 additions & 1 deletion pages/me/me.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,22 @@ Page({
this.setData({
emailStatus:!this.data.emailStatus
})
}
},
//教育素质签到
navigateToLecture: function(){
var ifbind = wx.getStorageSync("ifbindlibrary")
if(ifbind == ""){
wx.showToast({
title: '请先登录!',
icon: "none",
duration: 2000
})
}
else{
wx.navigateTo({
url: '/pages/liblecture/liblecture',
})
}
},

})
4 changes: 2 additions & 2 deletions pages/me/me.wxml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
<view hidden="{{!loginStatus}}" class="user_nick email_service"><text>{{emailStatus ? "已开启人文邮件服务":"已关闭人文邮件服务"}}</text><switch color="#6f89c5" checked="{{emailStatus}}" bindchange="emailsSwitch"></switch></view>

<view class="cu-item arrow">
<button class="cu-btn content" >
<button class="cu-btn content" bindtap="navigateToLecture">
<text class="cuIcon-writefill text-cyan"></text>
<text class="text-grey">功能1</text>
<text class="text-grey">教育素质签到</text>
</button>
</view>
<view class="cu-item arrow">
Expand Down

0 comments on commit 9cb4248

Please sign in to comment.