邹能昇 3 months ago
parent
commit
512f366765

+ 3 - 3
nova-tourism/components/my/index.js

@@ -88,9 +88,9 @@ Component({
             });
         },
         gorefund(){
-            // wx.navigateTo({
-            //     url: '../../pages/my/my-order/my-refund/index',
-            // });
+            wx.navigateTo({
+                url: '../../pages/my/my-order/my-refund/index',
+            });
         }
     }
 })

+ 1 - 1
nova-tourism/pages/my/merchant/merchant-home/order2-list/index.wxml

@@ -75,7 +75,7 @@
         <!--申请退房 -->
         <view class="submitbox" style="display: flex;" wx:if="{{item.status==102}}">
             <view class="submit"  data-item="{{item}}" bindtap="ONShow3">接受申请</view>
-            <view class="submit" style="margin-left: 15rpx;" data-item="{{item}}" bindtap="ONShow4">拒绝申请</view>
+            <!-- <view class="submit" style="margin-left: 15rpx;" data-item="{{item}}" bindtap="ONShow4">拒绝申请</view> -->
         </view>
         <van-dialog wx:if="{{showid3==item.objectId}}" message='确定接受该订单退房' data-item="{{item}}" show="{{ show3 }}" show-cancel-button bind:cancel="onClose3" bind:confirm="jieshou">
         </van-dialog>

+ 2 - 2
nova-tourism/pages/my/my-order/index.js

@@ -140,13 +140,13 @@ Page({
         Order.equalTo('user', Parse.User.current().id);
         Order.include('shopStore');
         if (this.data.currentTab == 0) {
-            Order.containedIn('status', [100, 102, 104])
+            Order.equalTo('status', 100)
         }
         if (this.data.currentTab == 1) {
             Order.equalTo('status', 200);
         }
         if (this.data.currentTab == 2) {
-            Order.containedIn('status', [800,103]);
+            Order.equalTo('status', 800);
         }
         // 添加排序条件
         Order.descending('updatedAt');

+ 0 - 4
nova-tourism/pages/my/my-order/index.wxml

@@ -25,9 +25,6 @@
             <view class="cardbox">
                 <view class="title">{{item.shopStore.storeName}}
                     <view wx:if="{{item.status==100}}" style="margin-left: auto;">已支付</view>
-                    <view wx:if="{{item.status==102}}" style="margin-left: auto;">申请退房</view>
-                    <view wx:if="{{item.status==104}}" style="margin-left: auto;">申请已驳回</view>
-
                 </view>
                 <view class="roombox">
                     <image src="{{item.room.images[0]}}"></image>
@@ -130,7 +127,6 @@
             <view class="cardbox">
                 <view class="title">{{item.shopStore.storeName}}
                     <view wx:if="{{item.status==800}}" style="margin-left: auto;">已完成</view>
-                    <view wx:if="{{item.status==103}}" style="margin-left: auto;">退房成功</view>
                 </view>
                 <view class="roombox">
                     <image src="{{item.room.images[0]}}"></image>

+ 62 - 0
nova-tourism/pages/my/my-order/my-refund/index.js

@@ -1,4 +1,6 @@
 // nova-tourism/pages/my/my-order/my-refund/index.js
+let Parse = getApp().Parse;
+const company = getApp().globalData.company
 Page({
 
     /**
@@ -10,6 +12,8 @@ Page({
         customHeight: 0,
         bottomNavHeight: 0,
         contentHeight: 0,
+
+        roomList:[]
     },
 
     /**
@@ -31,9 +35,67 @@ Page({
             bottomNavHeight,
             contentHeight
         });
+
+        this.getRoomOrder()
     },
+    gourl2(e) {
+        const url = e.currentTarget.dataset.url;
+        const id = e.currentTarget.dataset.id;
+        console.log('info',id);
+        // 构造要传递的信息
+        const info = {
+            objectId: id,
+            value:'民宿'
+        };
+        
+        // 将信息转为查询字符串
+        const queryString = Object.keys(info)
+            .map(key => `${encodeURIComponent(key)}=${encodeURIComponent(info[key])}`)
+            .join('&');
 
+        // 使用查询字符串跳转
+        wx.navigateTo({
+            url: `${url}?${queryString}`,
+        });
+    },
+    async getRoomOrder() {
+        let Order = new Parse.Query('RoomOrder');
+        Order.equalTo('company', company);
+        Order.include('room');
+        Order.equalTo('user', Parse.User.current().id);
+        Order.include('shopStore');
+        Order.containedIn('status', [102,103,104])
+
+        // 添加排序条件
+        Order.descending('updatedAt');
+        let room = await Order.find();
+        let roomList = room.map(async item => {
+            let roomItme = item.toJSON();
+            roomItme.tiem = await this.formatDate2(roomItme.startTime.iso, roomItme.endTime.iso)
+            return roomItme
+        });
+        let roomList2 = await Promise.all(roomList);
+        this.setData({
+            roomList: roomList2
+        })
+        console.log(this.data.roomList);
+    },
+    formatDate2(date1, date2) {
+        date1 = new Date(date1);
+        date2 = new Date(date2);
 
+        // 获取年份、月份和日期
+        const year1 = date1.getFullYear();
+        const month1 = date1.getMonth() + 1; // 月份从0开始,所以要加1
+        const day1 = date1.getDate();
+
+        const year2 = date2.getFullYear();
+        const month2 = date2.getMonth() + 1; // 月份从0开始,所以要加1
+        const day2 = date2.getDate();
+
+        // 返回格式化的字符串
+        return `${year1}年${month1}月${day1}日入住 - ${year2}年${month2}月${day2}日离店`;
+    },
     /**
      * 生命周期函数--监听页面初次渲染完成
      */

+ 121 - 27
nova-tourism/pages/my/my-order/my-refund/index.less

@@ -15,44 +15,39 @@
     }
     .cardbox{
         width: 100%;
-        height: auto;
+        height: 428rpx;
         padding-left: 30rpx;
         padding-right: 30rpx;
-        padding-top: 20rpx;
+        padding-top: 24rpx;
         padding-bottom: 10rpx;
-        margin-top: 20rpx;
+        margin-top: 26rpx;
         background-color: white;
-        .title2{
+        .title{
             width: 100%;
-            font-size: 30rpx;
+            font-size: 28rpx;
+            font-weight: 400;
             display: flex;
-            .title2-1{
-                font-weight: 600;
-            }
-            .title2-2{
-                margin-left: auto;
-            }
         }
         .roombox{
             width: 100%;
             display: flex;
-            margin-top: 20rpx;
+            margin-top: 24rpx;
             image{
-                width: 170rpx;
-                height: 170rpx;
-                border-radius: 10rpx;
+                width: 150rpx;
+                height: 150rpx;
+                border-radius: 4rpx;
             }
             .room{
                 height: 100%;
-                margin-left: 20rpx;
+                margin-left: 34rpx;
                 .room-name{
                     width: 460rpx;
-                    font-size: 28rpx;
+                    font-size: 24rpx;
                     margin-bottom: 10rpx;
     
                 }
                 .room-tag{
-                    font-size: 26rpx;
+                    font-size: 20rpx;
                     width: 460rpx;
                     height: auto;
                     color: #F37B40;
@@ -61,7 +56,7 @@
                 .room-text{
                     width: 460rpx;
                     height: auto;
-                    font-size: 26rpx;
+                    font-size: 20rpx;
                     color: #737373;
                 }
                 .room-text2{
@@ -79,8 +74,8 @@
             align-items: center;
             .ciri{
                 width: 200rpx;
-                font-size: 30rpx;
-                height: 50rpx;
+                font-size: 28rpx;
+                height: 36rpx;
                 display: flex;
                 justify-content: center;
                 align-items: center;
@@ -90,28 +85,127 @@
             }
             .price{
                 margin-left: auto;
-                font-size: 30rpx;
+                font-size: 28rpx;
             }
         }
         .sumbitbox{
             width: 100%;
             display: flex;
             justify-content: flex-end;
-            margin-top: 20rpx;
+            margin-top: 10rpx;
             .sumbit{
-                width: 164rpx;
-                height: 66rpx;
-                border-radius: 40rpx;
+                width: 168rpx;
+                height: 68rpx;
+                border-radius: 20rpx;
                 border: #F37B40 solid 2rpx;
                 background-color: white;
                 color: #F37B40;
-                font-size: 30rpx;
+                font-size: 28rpx;
                 display: flex;
                 align-items: center;
                 justify-content: center;
             }
         }
     }
+    // .cardbox{
+    //     width: 100%;
+    //     height: auto;
+    //     padding-left: 30rpx;
+    //     padding-right: 30rpx;
+    //     padding-top: 20rpx;
+    //     padding-bottom: 10rpx;
+    //     margin-top: 20rpx;
+    //     background-color: white;
+    //     .title2{
+    //         width: 100%;
+    //         font-size: 30rpx;
+    //         display: flex;
+    //         .title2-1{
+    //             font-weight: 600;
+    //         }
+    //         .title2-2{
+    //             margin-left: auto;
+    //         }
+    //     }
+    //     .roombox{
+    //         width: 100%;
+    //         display: flex;
+    //         margin-top: 20rpx;
+    //         image{
+    //             width: 170rpx;
+    //             height: 170rpx;
+    //             border-radius: 10rpx;
+    //         }
+    //         .room{
+    //             height: 100%;
+    //             margin-left: 20rpx;
+    //             .room-name{
+    //                 width: 460rpx;
+    //                 font-size: 28rpx;
+    //                 margin-bottom: 10rpx;
+    
+    //             }
+    //             .room-tag{
+    //                 font-size: 26rpx;
+    //                 width: 460rpx;
+    //                 height: auto;
+    //                 color: #F37B40;
+    //                 margin-bottom: 10rpx;
+    //             }
+    //             .room-text{
+    //                 width: 460rpx;
+    //                 height: auto;
+    //                 font-size: 26rpx;
+    //                 color: #737373;
+    //             }
+    //             .room-text2{
+    //                 width: 460rpx;
+    //                 height: auto;
+    //                 font-size: 26rpx;
+    //                 margin-top: 100rpx;
+    //                 color: #737373;
+    //             }
+    //         }
+    //     }
+    //     .pricebox{
+    //         width: 100%;
+    //         display: flex;
+    //         align-items: center;
+    //         .ciri{
+    //             width: 200rpx;
+    //             font-size: 30rpx;
+    //             height: 50rpx;
+    //             display: flex;
+    //             justify-content: center;
+    //             align-items: center;
+    //             background-color:#FBF5E1 ;
+    //             color: #F9C28B;
+    //             border-radius: 10rpx;
+    //         }
+    //         .price{
+    //             margin-left: auto;
+    //             font-size: 30rpx;
+    //         }
+    //     }
+    //     .sumbitbox{
+    //         width: 100%;
+    //         display: flex;
+    //         justify-content: flex-end;
+    //         margin-top: 20rpx;
+    //         .sumbit{
+    //             width: 164rpx;
+    //             height: 66rpx;
+    //             border-radius: 40rpx;
+    //             border: #F37B40 solid 2rpx;
+    //             background-color: white;
+    //             color: #F37B40;
+    //             font-size: 30rpx;
+    //             display: flex;
+    //             align-items: center;
+    //             justify-content: center;
+    //         }
+    //     }
+    // }
     .box{
         width: 100%;
         height: auto;

+ 34 - 5
nova-tourism/pages/my/my-order/my-refund/index.wxml

@@ -1,8 +1,37 @@
 <!--nova-tourism/pages/my/my-order/my-refund/index.wxml-->
 <nav type="back" background-color="#ffffff" frontColor="#000000" title="退款/售后" />
 <view class="all" style="height: {{contentHeight}}rpx;">
-    <view class="title">订单已完成</view>
-    <block wx:for="{{3}}">
+    <view class="title">订单退款售后</view>
+    <block  wx:for="{{roomList}}">
+            <view class="cardbox">
+                <view class="title">{{item.shopStore.storeName}}
+                    <view wx:if="{{item.status==102}}" style="margin-left: auto;">申请退房</view>
+                    <view wx:if="{{item.status==103}}" style="margin-left: auto;">退房成功</view>
+                </view>
+                <view class="roombox">
+                    <image src="{{item.room.images[0]}}"></image>
+                    <view class="room">
+                        <view class="room-name">{{item.room.name}}</view>
+                        <view class="room-tag">
+                            <block wx:for="{{item.room.tags}}">
+                                {{item}}
+                            </block>
+                        </view>
+                        <view class="room-text">{{item.tiem}}</view>
+                    </view>
+                </view>
+                <van-divider customStyle="margin: 20rpx;border-color:'#B1B1B1' " />
+                <view class="pricebox">
+                    <view class="price">实付款¥{{item.price}}</view>
+                </view>
+                <view class="sumbitbox">
+                    <!-- <view wx:if="{{item.status==100}}" class="sumbit" bindtap="ONShow" data-item="{{item}}">申请退房</view> -->
+                    <view class="sumbit"  bindtap="gourl2" data-url="../order-detail/index" data-id="{{item.objectId}}">订单详细</view>
+                </view>
+            </view>
+        </block>
+
+    <!-- <block wx:for="{{3}}">
         <view class="cardbox">
             <view class="title2">
                 <view class="title2-1">望仙礼遇</view>
@@ -24,10 +53,10 @@
                 <view class="sumbit" bindtap="gourl" data-url="../my-refund/refund-detail/index">退换</view>
             </view>
         </view>
-    </block>
+    </block> -->
 
     <!-- 望仙礼遇 -->
-    <view class="box">
+    <!-- <view class="box">
         <view class="wang-cardbox">
             <block wx:for="{{4}}">
                 <view class="wang-card" bindtap="gourl2">
@@ -43,5 +72,5 @@
                 </view>
             </block>
         </view>
-    </view>
+    </view> -->
 </view>

File diff suppressed because it is too large
+ 0 - 0
nova-tourism/pages/my/my-order/my-refund/index.wxss


Some files were not shown because too many files changed in this diff