123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396 |
- <template>
- <view class="pages">
- <!-- <TopTabs :list="tabList" @changeTab="changeTab">
- </TopTabs> -->
- <view class="tb">
- <view class="tabs">
- <view v-for="(item,index) in tabList" :key="index" @tap="changeTab1(index)">
- <text :class="index==current?'active':''">{{item.name}}</text>
- </view>
- </view>
- </view>
- <view class="mainContain">
- <view class="card" v-for="item,index in dataList" :key="index">
- <view class="header">
- <span style="font-weight: 700;">订单号:{{item.orderCode}}</span>
- <text v-if='item.orderStatus==-1&&item.status==1' class="orange">待确认</text>
- <text v-else-if='item.status==0&&item.orderStatus==-1' class="red">待支付</text>
- <text v-else-if='item.orderStatus==1&&item.status==1' class="green">已预订</text>
- <text v-else :class="statusClass[item.orderStatus]">{{status[item.orderStatus]}}</text>
- </view>
- <view class="mainContent">
- <image class="image" :src="item.cover" mode="aspectFill"></image>
- <view class="middle">
- <span class="title">{{item.houseBaseName}}-{{item.roomNumber}}</span>
- <span class='info'>
- <span>{{item.guestName}}</span>
- <span>{{item.guestPhone}}</span>
- <span>{{item.arriveDate}}到{{item.leaveDate}} </span>
- </span>
- </view>
- <view class="price">
- ¥{{item.orderAmount}}
- </view>
- </view>
- <!-- <view class="bottom" v-if="item.orderStatus==-1">
- <view class="refuse">
- 拒绝
- </view>
- <view class="btn">
- 确认订单
- </view>
- </view>
- <view class="bottom" v-else-if="item.orderStatus==1">
- <view class="btn">
- 办理入住
- </view>
- </view>
- <view class="bottom" v-else-if="item.orderStatus==2">
- <view class="btn">
- 办理退房
- </view>
- </view> -->
- <view class="bottom" @click="handleDetail(item)">
- <view class="detail">
- 详情
- </view>
- </view>
- <!-- <view class="bottom" @click="handleDetail(item)" v-else-if="item.orderStatus==4">
- <view class="detail">
- 详情
- </view>
- </view> -->
- </view>
- </view>
- </view>
- </template>
- <script>
- import TopTabs from '../../components/TopTabs/topTabs.vue';
- export default {
- components: {
- TopTabs,
- },
- data() {
- return {
- current: 0,
- mysearch: '',
- dataList: [],
- limit: 10,
- page: 1,
- homestayId: this.$store.state.moduleHouse.homestayId,
- statusClass: [
- '',
- 'green',
- 'blue',
- 'grey',
- 'grey',
- ],
- status: [
- '',
- '已预订',
- '已入住',
- '已退房',
- '已取消',
- ],
- // mt: uni.getSystemInfoSync().statusBarHeight + 44,
- tabList: [{
- name: '全部'
- },
- {
- name: '待确认'
- },
- {
- name: '待支付'
- },
- {
- name: '已预订'
- },
- {
- name: '已取消'
- },
- ],
- }
- },
- onLoad(option) {
- if (option.Type) {
- const type = parseInt(option.Type) + 1
- this.changeTab1(type)
- } else {
- this.getOrderList()
- }
- },
- methods: {
- changeTab1(index) {
- this.current = index;
- this.changeTab(index)
- },
- getOrderList(orderStatus) {
- this.$api.get('/merchant/hotel/order/getMerchantOrderPageList', {
- homestayId: '1711268640588517378',
- limit: this.limit,
- page: this.page,
- orderStatus: orderStatus ? orderStatus : ''
- }).then((res => {
- if (res.data.code == 0) {
- this.dataList = res.data.data.list
- this.dataList.forEach((i, index) => {
- this.dataList[index].arriveDate = i.arriveDate.slice(0, 10)
- this.dataList[index].leaveDate = i.leaveDate.slice(0, 10)
- })
- } else {
- uni.showToast({
- title: res.data.msg,
- icon: 'none'
- })
- }
- }))
- },
- getOrderByStatusList() {
- this.$api.get('/merchant/hotel/order/getMerchantOrderPageList', {
- homestayId: this.homestayId,
- limit: this.limit,
- page: this.page,
- status: 0
- }).then((res => {
- if (res.data.code == 0) {
- this.dataList = res.data.data.list
- this.dataList.forEach((i, index) => {
- this.dataList[index].arriveDate = i.arriveDate.slice(0, 10)
- this.dataList[index].leaveDate = i.leaveDate.slice(0, 10)
- })
- } else {
- uni.showToast({
- title: res.data.msg,
- icon: 'none'
- })
- }
- }))
- },
- handleDetail(item) {
- uni.navigateTo({
- url: '/pages/house/orderInfo?orderId='+item.id
- })
- },
- changeTab(index) {
- console.log(index, 'index------');
- this.tabIdx = index;
- switch (index) {
- case 0:
- this.getOrderList()
- break
- case 1:
- this.getOrderList(-1)
- break
- case 2:
- this.getOrderByStatusList()
- break
- case 3:
- this.getOrderList(1)
- break
- case 4:
- this.getOrderList(4)
- break
- }
- },
- }
- }
- </script>
- <style lang="scss" scoped>
- .pages {
- background: #F9FAFC;
- .tb {
- width: 100%;
- top: 0;
- left: 0;
- z-index: 999;
- .searchBoxParent {
- width: 100%;
- background: #fff;
- padding: 20rpx 24rpx 6rpx;
- box-sizing: border-box;
- .searchBox {
- width: 100%;
- background-color: #fff;
- }
- }
- .tabs {
- background: #fff;
- padding: 26rpx 0;
- display: flex;
- align-items: center;
- width: 100%;
- &>view {
- width: 25%;
- font-size: 28rpx;
- font-family: PingFangSC-Regular, PingFang SC;
- font-weight: 400;
- color: black;
- line-height: 40rpx;
- position: relative;
- text-align: center;
- }
- .active {
- font-size: 32rpx;
- font-family: PingFang-SC-Bold, PingFang-SC;
- font-weight: bold;
- color: black;
- line-height: 45rpx;
- }
- .active::after {
- position: absolute;
- content: '';
- width: 50rpx;
- height: 8rpx;
- background: #1372FF;
- bottom: -26rpx;
- left: 60%;
- margin-left: -42rpx;
- }
- }
- }
- .green {}
- .mainContain {
- display: flex;
- flex-direction: column;
- padding: 0 20rpx;
- .card {
- background: #fff;
- border-radius: 16rpx;
- margin: 20rpx 0;
- padding: 20rpx;
- .header {
- display: flex;
- justify-content: space-between;
- border-bottom: 1px #f3f3f3 solid;
- padding: 20rpx;
- .red {
- color: indianred;
- }
- .green {
- color: #39CE77;
- }
- .blue {
- color: #1372FF;
- }
- .grey {
- color: #4C5F76;
- }
- .orange {
- color: #FF9100;
- }
- }
- .mainContent {
- border-bottom: 1px #f3f3f3 solid;
- display: flex;
- padding: 20rpx 0;
- justify-content: space-evenly;
- .image {
- background-repeat: no-repeat;
- background-size: cover;
- width: 198rpx;
- height: 180rpx;
- border-radius: 16rpx;
- }
- .middle {
- color: #777777;
- display: flex;
- flex-direction: column;
- justify-content: space-between;
- margin-left: 25rpx;
- .title {
- font-weight: 700;
- font-size: 32rpx;
- color: black;
- }
- .info {
- color: #777777;
- display: flex;
- flex-direction: column;
- &>span {
- margin-top: 10rpx;
- }
- }
- }
- .price {
- color: red;
- text-align: center;
- height: 100%;
- align-items: center;
- align-self: center;
- font-size: 29rpx;
- font-weight: 700;
- }
- }
- .bottom {
- padding: 30rpx 20rpx;
- display: flex;
- justify-content: flex-end;
- .refuse {
- margin-right: 30rpxs;
- border: 1rpx solid orangered;
- border-radius: 35rpx;
- color: orangered;
- padding: 13rpx 34rpx;
- }
- .btn {
- background: #1372FF;
- border-radius: 35rpx;
- color: white;
- padding: 13rpx 34rpx;
- margin-left: 30rpx;
- }
- .detail {
- border: 1rpx solid darkgrey;
- border-radius: 35rpx;
- color: darkgrey;
- padding: 13rpx 34rpx;
- }
- }
- }
- }
- }
- </style>
|