123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201 |
- <template>
- <view class="pages roomconfirm">
- <view class="search-wrap wrap">
- <view class="write-radius search-block">
- <input type="text" class="search-input" v-model="searchparams.hotelId" value="" placeholder="酒店ID" />
- <input type="text" class="search-input" v-model="searchparams.search" value="" placeholder="订单编号或消费码关键字" />
- <button type="primary" @click="searchf" class="search-button">搜索</button>
- </view>
- </view>
- <mescroll-body ref="mescrollRef" @init="mescrollInit" @down="downCallback" @up="upCallback" :down="downOption" :up="upOption">
-
- <view v-for="(data,index) in dataList" :key="index">
- <view class="writeoff-item" :data-id="data.id" @click="jumpDetails">
- <view class="writeoff-item-til">{{ data.hotel.title }}</view>
- <view class="writeoff-item-con">
- <view class="writeoff-item-img">
- <image class="image" :src="data.litpic" mode="scaleToFill"></image>
- </view>
- <view class="writeoff-item-info">
- <view class="writeoff-item-name">{{ data.room.title }}</view>
- <view class="writeoff-item-hd">
- <image class="image" src="/static/img/hotelCardIcon.png" mode="widthFix"></image>
- {{data.hd_num}} 张蝴蝶券
- </view>
- <view class="writeoff-item-time">入离日期: {{data.usedate}} - {{data.departdate}}</view>
- </view>
- </view>
- </view>
- </view>
- </mescroll-body>
- </view>
- </template>
- <script>
-
- import MescrollMixin from "@/components/mescroll-uni/mescroll-mixins.js";
-
-
- import MescrollBody from "@/components/mescroll-uni/mescroll-body.vue";
-
- export default {
- mixins: [MescrollMixin],
- components: {
- MescrollBody
- },
- onLoad() {
- },
- onShow() {
- let serf = this;
-
- let loginRes = this.checkLogin('/pages/writeoff/writeoff', '2');
-
- if(!loginRes){return false;}
- serf.params.token=loginRes[0];
- serf.searchparams.token=loginRes[0];
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- },
- data() {
- return {
- params:{
- token:'',
- startTime:'',
- endTime:'',
- search:'',
- hotelId:null,
-
- },
- mescroll: null,
-
- downOption: {
-
- },
-
- upOption: {
- page: {
- size: 10
- },
- noMoreSize: 5,
- empty: {
- tip: '暂无相关数据'
- }
- },
-
- dataList: [],
-
- searchparams:{
- token:'',
- hotelId:'',
- search:'',
- }
- }
- },
- methods: {
-
-
- mescrollInit(mescroll) {
- this.mescroll = mescroll;
- },
-
- downCallback(){
-
- this.mescroll.resetUpScroll();
- },
-
- upCallback(page) {
- let pageNum = page.num;
- let pageSize = page.size;
- this.params = Object.assign(this.params,{page:pageNum,rows:pageSize});
- this.$api.http.post(this.config.apiBaseurl+'hotel/reserve/data',this.params,{
- header: {
- Accept:'application/json',
- Authorization: 'Bearer '+ this.params.token,
- }
- }).then(data => {
- if(data.data.code=='1001'){
- uni.redirectTo({
- url:'/pages/login/login?backpage=/pages/roomconfirm/roomconfirm'+'&backtype='+2,
- });
- };
- console.log(data);
-
- let curPageData = data.data.rows;
- console.log('curPageData',curPageData);
-
- let curPageLen = curPageData.length;
-
-
-
- let totalSize = data.data.total;
-
-
-
-
- if(page.num == 1) this.dataList = [];
- this.dataList = this.dataList.concat(curPageData);
-
-
- this.mescroll.endBySize(curPageLen, totalSize);
- setTimeout(()=>{
- this.mescroll.endSuccess(curPageLen)
- },20)
-
- }).catch(err => {
- this.mescroll.endErr()
- console.log(err)
-
- });
-
- },
-
- jumpDetails(e) {
- let id = e.currentTarget.dataset.id;
- console.log('id',id);
- uni.navigateTo({
- url: '/pages/roomconfirm/roomconfirmitem/roomconfirmitem?id=' + id
- });
- },
-
- searchf(){
-
- this.params = this.searchparams;
- this.mescroll.resetUpScroll();
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- page{background-color: $uni-bg-color-grey;}
- .writeoff-item{margin: 24rpx;padding: 24rpx;border-radius: 24rpx;background-color: #fff;box-shadow: 0px 18px 47px -19px rgba(0, 0, 0, 0.1);}
- .writeoff-item-til{margin-bottom: 15rpx;font-size: 24rpx;}
- .writeoff-item-con{display: flex;align-items: center;}
- .writeoff-item-img{position: relative;margin-right: 24rpx;width: 150rpx;height: 150rpx;border-radius: 14rpx;overflow: hidden;}
- .writeoff-item-img .image{height: 100%;position: absolute;left: 50%;top: 50%;transform: translate(-50%,-50%);}
- .writeoff-item-info{color: #666;}
- .writeoff-item-name{margin-bottom: 4rpx;font-size: 32rpx;font-weight: bold;}
- .writeoff-item-hd{margin-bottom: 4rpx;}
- .writeoff-item-hd .image{width: 27rpx;height: 21rpx;margin-right: 5rpx;}
- .writeoff-item-time{font-size: 24rpx;}
- </style>
|