123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170 |
- <template>
- <view>
- <view class="search" v-if="show">
- <u-divider text="展开搜索"></u-divider>
- <u--input v-model="param.xx" placeholder="输入条件" class="input" clearable></u--input>
- <u--input v-model="param.xx" placeholder="输入条件" class="input" clearable></u--input>
- <u--input v-model="param.xx" placeholder="输入条件" class="input" clearable></u--input>
- <u--input v-model="param.xx" placeholder="输入条件" class="input" clearable></u--input>
- <u--input v-model="param.xx" placeholder="输入条件" class="input" clearable></u--input>
- <view class="flex">
- <view class="f"><button class="btn c" @click="clear()">重置</button></view>
- <view class="f"><button class="btn" @click="search()">搜索</button></view>
- </view>
- </view>
- <view class="list">
- <view class="item" v-for="(item, index) in list" :key="index" @click="detail(item.id)">
- <view class="title">
- <text class="tv">便携式储能电源</text>
- <text class="icon"></text>
- <view class="clear"></view>
- </view>
- <view class="con">
- <view class="it">
- <view class="label">设备型号:</view>
- <view class="name">PMQ104M10005</view>
- </view>
- <view class="it">
- <view class="label">借用人部门:</view>
- <view class="name">工业设计与操纵环境研究所</view>
- </view>
- <view class="it">
- <view class="label">借用人:</view>
- <view class="name">腾飞</view>
- </view>
- <view class="tag">撰写</view>
- </view>
- </view>
- <view class="loading" v-if="loadMore"><u-loadmore :status="loadMore ? 'loading' : 'nomore'" /></view>
- <u-empty v-if="!loadMore && list.length == 0"></u-empty>
- </view>
- <view class="footer">
- <view class="flex">
- <view class="f"><button class="btn br" @click="go('/pages/model/return?op=设备归还')">归还设备</button></view>
- <view class="f"><button class="btn br" @click="go('/pages/model/return?op=设备借用')">借用设备</button></view>
- </view>
- </view>
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- param: { pageNum: 1, pageSize: 10, userId: this.getUser().id, orderByColumn: 'createTime', isAsc: 'desc' },
- list: [{}, {}, {}, {}, {}],
- show: false,
- loadMore: true
- };
- },
- onLoad(e) {
- //this.getData();
- },
- methods: {
- getData() {
- this.http.request({
- url: this.http.urls.user_task_record_list,
- data: this.param,
- loading: 'false',
- success: res => {
- this.loadMore = res.data.pages > this.param.pageNum ? true : false;
- res.data.rows.forEach(item => {
- this.list.push(item);
- });
- }
- });
- },
- //刷新数据
- refresh() {
- this.loadMore = true;
- this.param.pageNum = 1;
- this.list = [];
- this.getData();
- },
- //跳转到详情
- detail(id) {
- uni.navigateTo({
- url: '/pages/index/detail?id=' + id
- });
- },
- go(url) {
- uni.navigateTo({
- url: url
- });
- }
- },
- //下拉刷新
- onPullDownRefresh() {
- setTimeout(() => {
- this.refresh();
- uni.stopPullDownRefresh();
- }, 1000);
- },
- //上拉加载
- onReachBottom() {
- if (this.loadMore) {
- this.param.pageNum++;
- this.getData();
- }
- },
- //展开搜索
- onNavigationBarButtonTap() {
- this.show = !this.show;
- }
- };
- </script>
- <style lang="scss">
- page {
- background-color: #f2f3f5;
- }
- .list {
- padding: 0px 15px 80px 15px;
- .item {
- margin-top: 10px;
- background-color: white;
- border-radius: 5px;
- overflow: hidden;
- padding-bottom: 5px;
- box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
- .title {
- border-bottom: 1px solid #efefef;
- padding: 12px;
- color: $font-c1;
- .tv {
- float: left;
- width: 90%;
- }
- }
- .con {
- position: relative;
- .it {
- font-size: 14px;
- padding: 5px 12px 5px 12px;
- .label {
- float: left;
- color: #969696;
- width: 90px;
- text-align: right;
- }
- .name{
- color: $font-c;
- }
- }
- .tag {
- position: absolute;
- top: 10%;
- right: 0px;
- padding: 3px 10px;
- background-color: #F44336;
- color: white;
- font-size: 14px;
- border-radius: 15px 0px 0px 15px;
- }
- }
- }
- }
- .br {
- border-radius: 25px;
- }
- </style>
|