123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322 |
- <template>
- <view>
- <u-navbar title="缴费记录"></u-navbar>
- <view class="screen">
- <view class="date" @click="show = true">
- <view class="text">
- {{year}}年
- </view>
- <view class="icon">
- <u-icon name="arrow-down-fill" color="#999999" size="10"></u-icon>
- </view>
- </view>
- <u-line color="#999999" direction="col" length="40" margin="auto" />
- <view class="course" @click="courseShow = true">
- <view class="text">
- {{studentName}}
- </view>
- <view class="icon">
- <u-icon name="arrow-down-fill" color="#999999" size="10"></u-icon>
- </view>
- </view>
- </view>
- <u-picker mode="time" v-model="show" :params="params" :defaultTime="defaultTime" @confirm="confirm">
- </u-picker>
- <u-select v-model="courseShow" mode="single-column" :list="studentList" @confirm="courseConfirm"></u-select>
- <view class="main">
-
-
- <view class="item" v-for="(item,index) in paymentList" :key="index"
- @click="gotoUrl('pages/youth/course/paymentDetail?id=' + item.billNum + '&studentId=' + item.studentId)">
- <view class="date">
- {{item.buyTime}}
- </view>
- <view class="infos">
- <view class="picture">
- <img v-if="item.posterUrl != null" :src="item.posterUrl" alt="">
- <img v-else src="../../../assets/img/picture1.png" alt="">
- </view>
- <view class="course">
- <view class="name">
- {{item.className}}
- </view>
- <view class="season-hour">
- <view class="season">
- {{item.packageName}}
- </view>
- <!-- <view class="hour">
- {{item.buyTime}}课时
- </view> -->
- </view>
- </view>
- <view class="price">
- {{item.realPay!=null ? item.realPay.toFixed(2) : ''}}
- </view>
- </view>
- </view>
- </view>
- <!-- <u-divider v-if="paymentList.length == recordsTotal && recordsTotal != 0" style="margin-top: 10px">没有更多数据了
- </u-divider> -->
- </view>
- </template>
- <script>
- import * as courseApi from '@/apis/youth/course.js'
- import * as mineApi from '@/apis/youth/mine.js'
- export default {
- data() {
- return {
- courseName: '全部课程',
- courseShow: false,
- courseList: [],
- courseId: '',
- pageNum: 1,
- pageSize: 5,
- recordsTotal: 0,
- paymentList: [],
- studentId: '',
- year: '',
- defaultTime: '',
- params: {
- year: true,
- month: false,
- day: false,
- hour: false,
- minute: false,
- second: false,
- timestamp: true
- },
- show: false,
- studentId: '',
- studentName: '全部',
- studentList: []
- }
- },
- onReady() {
- var date = new Date();
- this.year = date.getFullYear();
- // this.studentId = this.carhelp.getStudentId().studentId;
- // this.getLoadMyBuyLog();
- // this.getCourseList();
- this.getStudentList();
- },
- // onReachBottom() {
- // if (this.paymentList.length < this.recordsTotal) {
- // this.myLoadmore();
- // }
- // },
- methods: {
- courseConfirm(e) {
- this.studentId = e[0].value;
- this.studentName = e[0].label;
- if(this.studentName == '全部') {
- this.getStudentList();
- } else {
- this.getLoadMyBuyLog();
- }
- },
- getStudentList() {
- this.studentList = [];
- uni.showLoading({
- title: "加载中",
- mask: true,
- })
- mineApi.studentList().then((res) => {
- uni.hideLoading();
- var list = res.data.studentList;
- var list2 = [];
- this.studentList.push({
- value: '',
- label: '全部'
- });
- for (var i = 0; i < list.length; i++) {
- this.studentList.push({
- value: list[i].studentId,
- label: list[i].studentName
- })
- this.studentId = list[i].studentId;
- this.getLoadMyBuyLog();
- }
- }).catch(error => {
- uni.showToast({
- title: error,
- icon: "none"
- })
- })
- },
- getCourseList() {
- this.courseList = [];
- uni.showLoading({
- title: "加载中",
- mask: true,
- })
- courseApi.loadMyBuyCourseNames({
- studentId: this.studentId
- }).then((res) => {
- uni.hideLoading();
- var list = res.data;
- this.courseList.push({
- value: '',
- label: '全部'
- });
- for (var i = 0; i < list.length; i++) {
- this.courseList.push({
- value: list[i].courseId,
- label: list[i].courseName
- });
- }
- }).catch(error => {
- uni.showToast({
- title: error,
- icon: "none"
- })
- })
- },
- // myLoadmore() {
- // this.pageNum += 1;
- // this.getLoadMyBuyLog()
- // },
- confirm(params) {
- this.year = params.year;
- this.getLoadMyBuyLog();
- },
- getLoadMyBuyLog() {
- this.paymentList = [];
-
- uni.showLoading({
- title: "加载中",
- mask: true,
- })
- // if (bl) {
- // this.paymentList = [];
- // this.pageNum = 1;
- // }
- courseApi.loadMyBuyLog({
- studentId: this.studentId,
- year: this.year,
- courseId: this.courseId,
- pageNum: 1,
- pageSize: 1000
- }).then((res) => {
- uni.hideLoading();
- // this.paymentList = [
- // ...this.paymentList,
- // ...res.data.data
- // ];
- // this.recordsTotal = res.data.recordsTotal;
- var list = res.data.data;
- for (var i = 0; i < list.length; i++) {
- this.paymentList.push(list[i]);
- }
- // this.paymentList = res.data.data;
- }).catch(error => {
- uni.showToast({
- title: error,
- icon: "none"
- })
- })
- },
- }
- }
- </script>
- <style lang="scss" scoped>
- .screen {
- background-color: #fff;
- display: flex;
- justify-content: space-between;
- text-align: center;
- height: 44px;
- line-height: 44px;
- position:fixed;
- top: 88rpx;
- left: 0;
- right: 0;
- z-index: 999;
-
- .date {
- flex: 1;
- display: flex;
- align-items: center;
- justify-content: center;
- .text {
- margin-right: 8rpx;
- }
- }
- .course {
- display: flex;
- flex: 1;
- align-items: center;
- justify-content: center;
- .text {
- margin-right: 8rpx;
- }
- }
- }
- .main {
- margin-top:88rpx;
- .item {
- .date {
- padding: 24rpx 32rpx;
- color: rgba(119, 119, 119, 1);
- }
- .infos {
- background-color: #fff;
- padding: 24rpx 36rpx;
- display: flex;
- align-items: center;
- .picture {
- width: 92rpx;
- height: 92rpx;
- img {
- width: 100%;
- height: 100%;
- }
- }
- .course {
- margin-left: 24rpx;
- .name {
- color: rgba(51, 51, 51, 1);
- font-size: 16px;
- font-weight: bold;
- }
- .season-hour {
- display: flex;
- color: rgba(119, 119, 119, 1);
- margin-top: 8rpx;
- .hour {
- margin-left: 8rpx;
- }
- }
- }
- .price {
- color: rgba(16, 16, 16, 1);
- font-size: 18px;
- font-weight: bold;
- margin-left: auto;
- }
- }
- }
- }
- </style>
|