Skip to content

Commit

Permalink
feature: 样式修改详情页面
Browse files Browse the repository at this point in the history
  • Loading branch information
xumengqi committed Apr 3, 2021
1 parent 9258f3f commit bb726d8
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 19 deletions.
10 changes: 5 additions & 5 deletions components/bookcase/bookcase.wxml
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@
<van-card custom-class="myCard" wx:for="{{ bookcaseList }}" wx:key="id" price="{{ item.bookDTO.bookDeposit }}.00"
currency="押金:" desc="{{ item.gmtCreateStr }}" title="{{ item.bookDTO.bookName }}"
thumb="{{ item.bookDTO.bookImageUrl }}">
<van-tag mark type="primary" wx:if="{{ item.bookDTO.bookStatus == '1' }}" slot="tag"
<van-tag mark type="primary" color="#ff8260" wx:if="{{ item.bookDTO.bookStatus == '1' }}" slot="tag"
custom-class="custom-tag-of-card">空闲
</van-tag>
<van-tag mark type="success" wx:if="{{ item.bookDTO.bookStatus == '2' }}" slot="tag"
<van-tag mark type="success" color="#ff4057" wx:if="{{ item.bookDTO.bookStatus == '2' }}" slot="tag"
custom-class="custom-tag-of-card">受理中
</van-tag>
<van-tag mark type="danger" wx:if="{{ item.bookDTO.bookStatus == '3' }}" slot="tag"
<van-tag mark type="danger" color="#900048" wx:if="{{ item.bookDTO.bookStatus == '3' }}" slot="tag"
custom-class="custom-tag-of-card">异常
</van-tag>
<van-tag mark type="warning" wx:if="{{ item.bookDTO.bookStatus == '4' }}" slot="tag"
<van-tag mark type="warning" color="#900048" wx:if="{{ item.bookDTO.bookStatus == '4' }}" slot="tag"
custom-class="custom-tag-of-card">已下架
</van-tag>
<van-tag mark type="warning" wx:if="{{ item.bookDTO.bookStatus == '5' }}" slot="tag"
<van-tag mark type="warning" color="#900048" wx:if="{{ item.bookDTO.bookStatus == '5' }}" slot="tag"
custom-class="custom-tag-of-card">已删除
</van-tag>
<view slot="tags">
Expand Down
6 changes: 4 additions & 2 deletions pages/book_detail/book_deatil.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ Page({
// 状态
borrowLoading: false,
addLoading: false,
bookcaseShow: false
bookcaseShow: false,
isMe: false
},
onCloseBookcase() {
this.setData({
Expand Down Expand Up @@ -56,7 +57,8 @@ Page({
bookDeposit: bookInfo.bookDeposit,
userFullName: bookInfo.userFullName,
schoolName: bookInfo.schoolName,
bookStatus: bookInfo.bookStatus
bookStatus: bookInfo.bookStatus,
isMe: bookInfo.userId == globalData.userId
})
}
})
Expand Down
37 changes: 25 additions & 12 deletions pages/book_detail/book_deatil.wxml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,21 @@
<van-col span="24">
<view class="title">
<van-row>
<van-col span="24">
<van-col span="20">
<text style="color: #ff4057; font-size: 18px">¥{{ bookDeposit }}.00</text>
</van-col>
<van-col span="4">
<van-tag round color="#ff8260" wx:if="{{ bookStatus == 1 }}">空闲
</van-tag>
<van-tag round type="success" wx:if="{{ bookStatus == 2 }}">受理中
</van-tag>
<van-tag round color="#900048" wx:if="{{ bookStatus == 3 }}">异常
</van-tag>
<van-tag round color="#900048" wx:if="{{ bookStatus == 4 }}">已下架
</van-tag>
<van-tag round color="#900048" wx:if="{{ bookStatus == 5 }}">已删除
</van-tag>
</van-col>
</van-row>
<van-row custom-class="title-book-name">
<van-col span="24">
Expand All @@ -28,21 +40,22 @@
<van-row>
<van-col span="24">
<van-cell-group custom-class="myCellGroup" border="{{false}}">
<van-cell title="ISBN" value="{{ bookIsbn }}" title-class="myTitle" value-class="myValue"
border="{{false}}">
<van-icon name="money-o" slot="right-icon" />
</van-cell>
<van-cell title="书籍类别" value="{{ bookCatalogName }}" title-class="myTitle" value-class="myValue"
border="{{false}}" />
<van-cell title="最大共享天数" title-class="myTitle" value-class="myValue" border="{{false}}">
<van-tag type="danger" color="#ff8260" round>T+{{ bookMaxPeriod }}</van-tag>
</van-cell>
<van-cell title="所需押金" title-class="myTitle" value-class="myValue"
border="{{false}}">
<van-cell title="所需押金" title-class="myTitle" value-class="myValue" border="{{false}}">
<van-tag round plain type="primary" wx:if="{{ bookDeposit == 0}}">免押金</van-tag>
<text wx:if="{{bookDeposit != 0}}">{{ bookDeposit }}.00</text>
</van-cell>
<van-cell title="共享者" value="{{ userFullName }}" title-class="myTitle" value-class="myValue"
<van-cell title="共享者" title-class="myTitle" value-class="myValue" border="{{false}}">
<van-tag round plain type="primary" color="#ff4057" wx:if="{{ isMe == true}}">我</van-tag>
<text wx:if="{{ isMe == false}}">{{ userFullName }}</text>
</van-cell>
<van-cell title="ISBN" value="{{ bookIsbn }}" title-class="myTitle" value-class="myValue"
border="{{false}}">
<van-icon name="money-o" slot="right-icon" />
</van-cell>
<van-cell title="书籍类别" value="{{ bookCatalogName }}" title-class="myTitle" value-class="myValue"
border="{{false}}" />
</van-cell-group>
</van-col>
Expand Down Expand Up @@ -76,8 +89,8 @@
<van-goods-action-icon icon="/resources/images/tabbar/bookcase.png" text="书箱" bind:click="showPopupBookcase" />
<van-goods-action-button text="加入书箱" type="warning" bind:click="addToBookcase" wx:if="{{ !addLoading }}" />
<van-goods-action-button type="warning" loading wx:if="{{ addLoading }}" />
<van-goods-action-button text="立即借阅" bind:click="borrowBook" wx:if="{{ !borrowLoading && bookStatus == 1 }}" />
<van-goods-action-button loading wx:if="{{ borrowLoading && bookStatus == 1 }}" />
<van-goods-action-button text="立即借阅" bind:click="borrowBook" wx:if="{{ !borrowLoading && bookStatus == 1 && isMe == false}}" />
<van-goods-action-button loading wx:if="{{ borrowLoading && bookStatus == 1 && isMe == false}}" />
</van-goods-action>
</van-col>
</van-row>
Expand Down

0 comments on commit bb726d8

Please sign in to comment.