fix(ticket): 优化检票记录页面

- 添加背景装饰样式,提升页面视觉效果
- 修复查询条件重置逻辑,优化用户体验
- 优化代码格式,提高可读性
main
Tuzki 7 months ago
parent ba9c1ba234
commit 9d2844292a
  1. 1
      pages/addUserinfo/addUserinfo.vue
  2. 174
      pages/ticketCheckingRecord.vue

@ -359,6 +359,7 @@ export default {
this.needCount = 0
} else {
uni.removeStorageSync('oldTicket')
that.allTicket.push(that.ticket)
uni.setStorageSync('ALL_TICKET', that.allTicket)
uni.navigateBack({

@ -1,7 +1,7 @@
<template>
<view class="m-content">
<uni-nav-bar dark :fixed="true" shadow background-color="#007AFF" status-bar left-icon="left" left-text="" title="检票记录" @clickLeft="back" />
<view class="m-search-bar">
<view class="m-search-bar g-both">
<uni-row>
<uni-col :span="4">
<uni-data-select class="m-select" :clear="false" v-model="selectValue" :localdata="range" @change="change"></uni-data-select>
@ -14,7 +14,7 @@
v-model="queryParams.ticketNumber"
placeholder="请输入票号"
@clear="clearInput"
@confirm = "enterInput"
@confirm="enterInput"
></uni-easyinput>
<uni-easyinput
:inputBorder="false"
@ -23,7 +23,7 @@
v-model="queryParams.touristInfo"
placeholder="请输入姓名"
@clear="clearInput"
@confirm = "enterInput"
@confirm="enterInput"
></uni-easyinput>
</uni-col>
<uni-col :span="6">
@ -82,7 +82,7 @@ export default {
{ value: 1, text: '姓名' }
],
//
total:0,
total: 0,
// 1
pageNo: 1,
@ -91,7 +91,7 @@ export default {
queryParams: {
ticketNumber: '',
touristInfo: '',
checkedTime: []
checkedTime: [this.initParseTime(new Date(), 1), this.initParseTime(new Date(), 2)]
}
};
},
@ -111,13 +111,13 @@ export default {
}
},
methods: {
clearInput(){
this.queryParams.ticketNumber = ''
this.queryParams.touristInfo = ''
this.pullDown(this.queryParams)
clearInput() {
this.queryParams.ticketNumber = '';
this.queryParams.touristInfo = '';
this.pullDown(this.queryParams);
},
enterInput(){
this.pullDown(this.queryParams)
enterInput() {
this.pullDown(this.queryParams);
},
back() {
uni.navigateBack({
@ -127,6 +127,9 @@ export default {
parseTime(time) {
return parseTime(time, '{h}:{i}:{s}');
},
initParseTime(time, when) {
return parseTime(time, when == 1 ? '{y}-{m}-{d} 00:00:00' : '{y}-{m}-{d} 23:59:59');
},
pageRefresh() {
let myThis = this;
this.$nextTick(() => {
@ -148,60 +151,62 @@ export default {
let reqData = {
ticketNumber: pullScrollData.ticketNumber,
touristInfo: pullScrollData.touristInfo,
checkedTime: pullScrollData.checkedTime,
checkedTime: pullScrollData.checkedTime ? pullScrollData.checkedTime : this.queryParams.checkedTime,
pageSize: 10,
pageNo: this.pageNo
};
let myThis = this;
getTicketCheckedList(reqData).then(res=>{
console.log(res)
myThis.projectList = res.data.list
//
myThis.total = res.data.total;
//
if (myThis.pageNo * 10 >= myThis.total) {
myThis.$refs.pullScroll.finish();
} else {
//
myThis.$refs.pullScroll.success();
}
}).catch(err=>{
console.log(err)
})
getTicketCheckedList(reqData)
.then((res) => {
console.log(res);
myThis.projectList = res.data.list;
//
myThis.total = res.data.total;
//
if (myThis.pageNo * 10 >= myThis.total) {
myThis.$refs.pullScroll.finish();
} else {
//
myThis.$refs.pullScroll.success();
}
})
.catch((err) => {
console.log(err);
});
// setTimeout(function () {
//
// for (let i = 0; i < 10; i++) {
// myThis.projectList.push({
// id: i,
// ticketname: '',
// ticketNumber: 'SC202407131023107317096',
// salesAmount: 80.0,
// settlementAmount: 80.0,
// ticketChecksNums: 1,
// ticketCheckedNums: 1,
// startdate: 1721215919000,
// enddate: 1721907121000,
// startTimeslot: '00:00',
// endTimeslot: '00:00',
// distributionChannel: '1',
// distributorname: null,
// orderTime: 1720675580000,
// checkedTime: 1721907258000,
// stationname: '1',
// username: '',
// orderNumber: '202407111326201730472'
// });
// }
//
// myThis.total = 10;
// //
// if (myThis.pageNo * 10 >= myThis.total) {
// myThis.$refs.pullScroll.finish();
// } else {
// //
// myThis.$refs.pullScroll.success();
// }
//
// for (let i = 0; i < 10; i++) {
// myThis.projectList.push({
// id: i,
// ticketname: '',
// ticketNumber: 'SC202407131023107317096',
// salesAmount: 80.0,
// settlementAmount: 80.0,
// ticketChecksNums: 1,
// ticketCheckedNums: 1,
// startdate: 1721215919000,
// enddate: 1721907121000,
// startTimeslot: '00:00',
// endTimeslot: '00:00',
// distributionChannel: '1',
// distributorname: null,
// orderTime: 1720675580000,
// checkedTime: 1721907258000,
// stationname: '1',
// username: '',
// orderNumber: '202407111326201730472'
// });
// }
//
// myThis.total = 10;
// //
// if (myThis.pageNo * 10 >= myThis.total) {
// myThis.$refs.pullScroll.finish();
// } else {
// //
// myThis.$refs.pullScroll.success();
// }
// }, 600);
},
formattedDate(dateStr) {
@ -214,7 +219,7 @@ export default {
this.date = e.detail.value;
this.queryParams.checkedTime = [e.detail.value + ' 00:00:00', e.detail.value + ' 23:59:59'];
console.log(this.queryParams);
this.pullDown(this.queryParams)
this.pullDown(this.queryParams);
},
getDate(type) {
const date = new Date();
@ -232,16 +237,16 @@ export default {
return `${year}-${month}-${day}`;
},
change(val) {
if(val == 1){
this.queryParams.ticketNumber = ''
}else{
this.queryParams.touristInfo = ''
if (val == 1) {
this.queryParams.ticketNumber = '';
} else {
this.queryParams.touristInfo = '';
}
this.pullDown(this.queryParams)
this.pullDown(this.queryParams);
},
goDetail(val) {
uni.navigateTo({
url: '/pages/ticketDetail/ticketDetail?checkId='+val.id+'&touristId='+val.touristId
url: '/pages/ticketDetail/ticketDetail?checkId=' + val.id + '&touristId=' + val.touristId
});
}
}
@ -249,8 +254,43 @@ export default {
</script>
<style lang="scss" scoped>
.g-both {
position: relative;
}
.g-both::before {
content: '';
position: absolute;
top: 50%;
left: 5%;
right: 5%;
bottom: 35%;
border-radius: 10upx;
background: hsl(199, 7%, 76%);
transform: translate(0, -20%) rotate(-4deg);
transform-origin: center center;
box-shadow: 0 0 10upx 7upx hsl(199, 7%, 76%);
z-index: -1;
}
.g-both::after {
content: '';
position: absolute;
top: 50%;
left: 5%;
right: 5%;
bottom: 35%;
border-radius: 10upx;
background: hsl(199, 7%, 76%);
transform: translate(0, -20%) rotate(4deg);
transform-origin: center center;
box-shadow: 0 0 10upx 7upx hsl(199, 7%, 76%);
z-index: -1;
}
.m-search-bar {
padding: 24upx;
position: fixed;
z-index: 9;
::v-deep .m-select {
background-color: #fff;
@ -285,7 +325,7 @@ export default {
}
.list-box {
margin: 0 24upx;
margin: 120upx 24upx 0;
.m-ticket {
margin-bottom: 20upx;

Loading…
Cancel
Save