123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395 |
- <template>
- <view>
- <nav-bar title="模考预约" class="nav"></nav-bar>
- <view class="tabs">
- <view class="tab" :class="{ active: index == 2 }" data-index="2">
- <view class="dateRange">
- <picker mode="date" :value="dateFrom" :start="startDate" :end="endDate" @change="bindDateFromChange">
- <view class="uni-input">{{dateFrom}}</view>
- </picker>
- -
- <picker mode="date" :value="dateTo" :start="startDate" :end="endDate" @change="bindDateToChange">
- <view class="uni-input">{{dateTo}}</view>
- </picker></view>
- <u-icon class="icon" name="calendar"></u-icon>
- </view>
- <view class="tab" :class="{ active: index == 1 }" data-index="1" @click="tab(1)">
- <view>全部</view>
- <u-icon class="icon" :class="index ==1? 'animals':''" name="arrow-down"></u-icon>
- </view>
-
- </view>
-
- <view class="record">
- <view class="item" v-for="(item,index) in 5" :key="index">
- <view class="item__header">
- <view class="note">
- <image src="../static/living.png" mode="widthFix"></image>
- 直播中
- </view>
- <image class="img" src="/static/questionBank.png" ></image>
- </view>
- <view class="item__body">
- <view class="title">
- 二建模考-法律讲解直播-三级标题
- </view>
- <view class="desc">直播时间</view>
- <view class="desc">2022/4/15 20:00-21:00 </view>
- </view>
- </view>
- </view>
-
- <view class="modal" :style="{top:modalTop+'px'}" v-if="index == 1">
- <view class="content">
- <scroll-view scroll-y="true" style="height:100%">
- <view class="top" :class="activeIndex === 0 ? 'activesty' : ''" @click="testClick(3)">全部</view>
- <view class="list">
- <view class="item" :class="activeIndex == listItem.goodsId ? 'activesty' : ''" v-for="(listItem,listIndex) in list" :key="listIndex" @click="testClick(listItem)">
- {{ listItem.goodsName }}
- </view>
- </view>
- </scroll-view>
-
- </view>
- <view class="modal_wrap" @click="index = 0"></view>
- </view>
-
- <view class="notice_modal" :style="{top:modalTop+'px'}" v-if="index == 2">
- <view class="content">
- <scroll-view scroll-y="true" style="height:100%">
- <view class="top" :class="typeIndex === 0 ? 'activesty' : ''" @click="paperClick(3)">全部试卷类型</view>
- <view class="list">
- <view class="item" :class="typeIndex == listItem.paperId ? 'activesty' : ''" v-for="(listItem,listIndex) in list1" :key="listIndex" @click="paperClick(listItem)">{{ listItem.paperName }}</view>
- </view>
- </scroll-view>
- </view>
- <view class="modal_wrap" @click="index = 0"></view>
- </view>
-
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- openAppoint:false,
- appointModal:false,
- noticeModal:false,
- index: 0,
- list: [],
- list1: [],
- recordList: [],
- goodsData: {},
- param: {
- pageNum: 1,
- pageSize: 10
- },
- dateFrom:'',
- dateTo:'',
- isRepeat:false,
- total: 0,
- activeIndex: 0,
- typeIndex:0,
- itemIndex:'',
- modalTop:0,
- endDate:'',
- };
- },
- onLoad(option) {
- this.dateFrom = this.$method.timestampToTime(new Date().getTime() / 1000).replace(/-/g,'/');
- this.dateTo = this.$method.timestampToTime(new Date().getTime() / 1000).replace(/-/g,'/');
- this.endDate = this.$method.timestampToTime(new Date().getTime() / 1000).replace(/-/g,'/');
-
- uni.getSystemInfo({
- success:(e) => {
- let info = uni.createSelectorQuery().select(".nav");
- info.boundingClientRect((navData) => { //data - 各种参数
-
- let info = uni.createSelectorQuery().select(".tabs");
- info.boundingClientRect((tabData) => { //data - 各种参数
- this.modalTop = navData.height + tabData.height
- console.log(navData) // 获取元素宽度
- console.log(tabData) // 获取元素宽度
- }).exec()
- }).exec()
- }
- })
- },
- onPullDownRefresh() {
- let that = this;
- this.param = {
- pageNum: 1,
- pageSize: 10
- };
- this.getExamRecordList();
- setTimeout(function() {
- uni.stopPullDownRefresh();
- }, 500);
- },
- onReachBottom() {
- if (this.recordList.length < this.total) {
- this.param.pageNum++;
- this.getExamRecordList();
- }
- },
- onShow() {
- if(this.isRepeat) {
- this.addRecord();
- } else {
- if(this.itemIndex !== '') {
- this.refreshByIndex();
- }
- }
-
- },
- methods: {
- refreshByIndex() {
- this.$api.examRecordGroupList({
- pageNum: this.itemIndex+1,
- pageSize: 1
- }).then(res => {
- this.$set(this.recordList,this.itemIndex,res.data.rows[0])
- this.itemIndex = ''
- });
- },
-
- appoint(item) {
- this.appointModal = true;
- },
- tab(index) {
- console.log(index,this.index)
- if(this.index == index) {
- this.index = 0;
- return;
- }
- this.index = index;
- console.log(this.index);
- },
- bindDateFromChange(e) {
- this.dateFrom = e.detail.value
- },
-
- bindDateToChange(e) {
- this.dateTo = e.detail.value
- }
- }
- };
- </script>
- <style>
- page {
- background: #eaeef1;
- }
- </style>
- <style lang="scss" scope>
- .animals{
- transition: all 0.3s;
- transform: rotate(180deg);
- }
- .tabs {
- position: fixed;
- padding:18rpx 0;
- left: 0;
- width: 100%;
- display: flex;
- z-index: 10;
- background: #ffffff;
- .tab {
- padding:0 18rpx;
- flex: 1;
- display: flex;
- justify-content: space-between;
- background: #ffffff;
- font-size: 24rpx;
- color: #999999;
-
- &:nth-of-type(1) {
- border-right:1px solid #EEEEEE;
- }
-
- .dateRange {
- display: flex;
- justify-content: space-between;
- }
- &.active {
- color: #333333;
- .icon{
- transform: rotate(180deg);
- }
- }
- }
- }
- .record {
- margin-top:80rpx;
- padding: 16rpx 16rpx;
- display: flex;
- flex-wrap: wrap;
- .item {
- margin-bottom: 16rpx;
- width:351rpx;
- background: #ffffff;
- border-radius: 16rpx;
- position: relative;
-
- &:nth-of-type(2n) {
- margin-left:16rpx;
-
- }
- &__header {
- width: 100%;
- height: 170rpx;
- position:relative;
-
- .note {
- position:absolute;
- left:0;
- top:0;
- width: 136rpx;
- height: 40rpx;
- background: linear-gradient(90deg, #B37FEB, #722ED1);
- box-shadow: 3rpx 3rpx 6rpx 0rpx rgba(239, 219, 255, 0.6);
- border-radius: 16rpx 0rpx 8rpx 0rpx;
- text-align: center;
- color:#fff;
-
- image {
- width:24rpx;
- vertical-align: middle;
- }
- }
-
- .img {
- width:100%;
- height:100%;
- }
- }
-
- &__body {
- padding:16rpx;
-
- .title {
- font-size: 30rpx;
- color: #333333;
- line-height: 48rpx;
- font-weight: bold;
- }
-
- .desc {
- margin-top:10rpx;
- font-size: 24rpx;
- color: #666666;
- line-height: 36rpx;
- }
-
- .btn {
- margin-top:30rpx;
- background: #FFFFFF;
- border-radius: 16rpx;
- height: 64rpx;
- line-height: 62rpx;
- text-align: center;
- font-size: 28rpx;
- border: 1px solid #D9D9D9;
- color:#D9D9D9;
-
- &.active {
-
- border: 1px solid #007AFF;
- color:#007AFF;
- }
- }
- }
- }
- }
- .notice {
- position:fixed;
- right:0;
- top:50%;
- width: 48rpx;
- height: 200rpx;
- background: #52C41A;
- box-shadow: 0px 3rpx 16rpx 0rpx rgba(44, 121, 7, 0.5);
- border-radius: 24rpx;
- display: flex;
- flex-direction: column;
- align-items: center;
- justify-content: center;
- padding:10rpx 0;
-
- .text {
- flex:1;
- color:#fff;
- text-align: center;
- }
- }
- .modal {
- bottom:0;
- z-index: 199999999;
- position: fixed;
- left: 0;
- width: 100%;
- .content {
- height:80%;
- overflow: hidden;
- position: relative;
- z-index: 10;
- background: #fff;
- padding: 8rpx 12rpx 20rpx;
- display: flex;
- flex-wrap: wrap;
- .top {
- margin: 0 auto;
- width: 726rpx;
- height: 80rpx;
- background: #f5f5f5;
- color: #666666;
- border-radius: 16rpx;
- text-align: center;
- line-height: 80rpx;
- font-size: 32rpx;
- }
- .list {
- width:100%;
- margin-top: 16rpx;
- display: flex;
- flex-wrap: wrap;
- justify-content: space-between;
- .item {
- padding: 25rpx 20rpx;
- width: 49%;
- background: #f5f5f5;
- border-radius: 16rpx;
- font-size: 32rpx;
- color: #666666;
- margin: 8rpx 0;
- }
- }
- }
- .modal_wrap {
- position: absolute;
- left: 0;
- width: 100%;
- top: 0;
- height: 100%;
- background: rgba(0, 0, 0, 0.3);
- }
- }
- .activesty {
- background: #007aff !important;
- color: #fff !important;
- }
- </style>
|