Browse Source

minsudingdanxiangxi page

邹能昇 4 months ago
parent
commit
664fb01e8d

+ 2 - 1
app.json

@@ -30,7 +30,8 @@
                 "pages/my/merchant/room-manage/room-edit/index",
                 "pages/my/merchant/code-verify/index",
                 "pages/homestay/homestay-order2/index",
-                "pages/my/my-order/index"
+                "pages/my/my-order/index",
+                "pages/my/my-order/order-detail/index"
             ]
         },
         {

+ 20 - 1
nova-tourism/pages/my/my-order/index.js

@@ -124,7 +124,26 @@ Page({
         })
         console.log(this.data.roomList);
     },
-
+    gourl(e) {
+        const url = e.currentTarget.dataset.url;
+        const id = e.currentTarget.dataset.id;
+
+        // 构造要传递的信息
+        const info = {
+            objectId: id,
+            value:this.data.value
+        };
+
+        // 将信息转为查询字符串
+        const queryString = Object.keys(info)
+            .map(key => `${encodeURIComponent(key)}=${encodeURIComponent(info[key])}`)
+            .join('&');
+
+        // 使用查询字符串跳转
+        wx.navigateTo({
+            url: `${url}?${queryString}`,
+        });
+    },
     /**
      * 生命周期函数--监听页面初次渲染完成
      */

+ 9 - 9
nova-tourism/pages/my/my-order/index.wxml

@@ -15,7 +15,7 @@
                 <view class="cardbox">
                     <view class="title">{{item.shopStore.storeName}}</view>
                     <view class="roombox">
-                        <image src="https://file-cloud.fmode.cn//tmp/mqHkA2qV3Q8nca3dc59bad49de6e5ae57afa81d78ae8.jpeg?imageView2/1/w/200/h/200"></image>
+                        <image src="{{item.room.images[0]}}"></image>
                         <view class="room">
                             <view class="room-name">{{item.room.name}}</view>
                             <view class="room-tag">
@@ -31,7 +31,7 @@
                         <view class="price">实付款¥{{item.price}}</view>
                     </view>
                     <view class="sumbitbox">
-                        <view class="sumbit">订单详细</view>
+                        <view class="sumbit" bindtap="gourl" data-url="../my-order/order-detail/index" data-id="{{item.objectId}}">订单详细</view>
                     </view>
                 </view>
             </block>
@@ -51,7 +51,7 @@
                         <view class="price">实付款¥19999.99</view>
                     </view>
                     <view class="sumbitbox">
-                        <view class="sumbit">订单详细</view>
+                        <view class="sumbit" bindtap="gourl" data-url="../my-order/order-detail/index" data-id="{{item.objectId}}">订单详细</view>
                     </view>
                 </view>
             </block>
@@ -64,7 +64,7 @@
                 <view class="cardbox">
                     <view class="title">{{item.shopStore.storeName}}</view>
                     <view class="roombox">
-                        <image src="https://file-cloud.fmode.cn//tmp/mqHkA2qV3Q8nca3dc59bad49de6e5ae57afa81d78ae8.jpeg?imageView2/1/w/200/h/200"></image>
+                        <image src="{{item.room.images[0]}}"></image>
                         <view class="room">
                             <view class="room-name">{{item.room.name}}</view>
                             <view class="room-tag">
@@ -80,7 +80,7 @@
                         <view class="price">实付款¥{{item.price}}</view>
                     </view>
                     <view class="sumbitbox">
-                        <view class="sumbit">变更订单</view>
+                        <view class="sumbit" bindtap="gourl" data-url="../my-order/order-detail/index" data-id="{{item.objectId}}">变更订单</view>
                     </view>
                 </view>
             </block>
@@ -100,7 +100,7 @@
                         <view class="price">实付款¥19999.99</view>
                     </view>
                     <view class="sumbitbox">
-                        <view class="sumbit">查看物流</view>
+                        <view class="sumbit" bindtap="gourl" data-url="../my-order/order-detail/index" data-id="{{item.objectId}}">查看物流</view>
                     </view>
                 </view>
             </block>
@@ -113,7 +113,7 @@
                 <view class="cardbox">
                     <view class="title">{{item.shopStore.storeName}}</view>
                     <view class="roombox">
-                        <image src="https://file-cloud.fmode.cn//tmp/mqHkA2qV3Q8nca3dc59bad49de6e5ae57afa81d78ae8.jpeg?imageView2/1/w/200/h/200"></image>
+                        <image src="{{item.room.images[0]}}"></image>
                         <view class="room">
                             <view class="room-name">{{item.room.name}}</view>
                             <view class="room-tag">
@@ -129,7 +129,7 @@
                         <view class="price">实付款¥{{item.price}}</view>
                     </view>
                     <view class="sumbitbox">
-                        <view class="sumbit">订单详细</view>
+                        <view class="sumbit" bindtap="gourl" data-url="../my-order/order-detail/index" data-id="{{item.objectId}}">订单详细</view>
                     </view>
                 </view>
             </block>
@@ -149,7 +149,7 @@
                         <view class="price">实付款¥19999.99</view>
                     </view>
                     <view class="sumbitbox">
-                        <view class="sumbit">订单详细</view>
+                        <view class="sumbit" bindtap="gourl" data-url="../my-order/order-detail/index" data-id="{{item.objectId}}">订单详细</view>
                     </view>
                 </view>
             </block>

+ 182 - 0
nova-tourism/pages/my/my-order/order-detail/index.js

@@ -0,0 +1,182 @@
+// nova-tourism/pages/my/my-order/order-detail/index.js
+let Parse = getApp().Parse;
+const company = getApp().globalData.company
+Page({
+
+    /**
+     * 页面的初始数据
+     */
+    data: {
+        statusBarHeight: 0,
+        screenHeight: 0,
+        customHeight: 0,
+        bottomNavHeight: 0,
+        contentHeight: 0,
+
+        objectId:'',
+        value:'',
+        roomList:{},
+    },
+
+    /**
+     * 生命周期函数--监听页面加载
+     */
+    onLoad: function (options) {
+        const {
+            objectId,
+            value
+        } = options;
+        const Value = decodeURIComponent(value);
+        this.setData({
+            objectId,
+            value:Value
+        })
+        console.log(this.data.value,this.data.objectId);
+
+        const systemInfo = wx.getSystemInfoSync();
+        const statusBarHeight = systemInfo.statusBarHeight || 0;
+        const screenHeight = systemInfo.screenHeight || 0;
+        const custom = wx.getMenuButtonBoundingClientRect();
+        const customHeight = custom.height + 10 + 2 || 0;
+        const bottomNavHeight = systemInfo.screenHeight - systemInfo.safeArea.bottom || 0;
+
+        const contentHeight = (screenHeight - bottomNavHeight - statusBarHeight - customHeight) * 750 / systemInfo.windowWidth;
+        this.setData({
+            statusBarHeight,
+            screenHeight,
+            customHeight,
+            bottomNavHeight,
+            contentHeight
+        });
+        if(this.data.value=='民宿'){
+            this.getRoomOrder()
+        }
+
+    },
+    async getRoomOrder() {
+        let Order = new Parse.Query('RoomOrder');
+        Order.equalTo('company', company);
+        Order.equalTo('objectId', this.data.objectId);
+        Order.include('room');
+        Order.equalTo('user', Parse.User.current().id);
+        Order.include('shopStore');
+        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)
+            roomItme.startTime = await this.formatDate(roomItme.startTime.iso)
+            roomItme.endTime = await this.formatDate(roomItme.endTime.iso)
+            return roomItme
+        });
+        let roomList2 = await Promise.all(roomList);
+        this.setData({
+            roomList: roomList2[0]
+        })
+        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}日离店`;
+    },
+     formatDate(isoString) {
+        const date = new Date(isoString);
+        const year = date.getUTCFullYear();
+        const month = String(date.getUTCMonth() + 1).padStart(2, '0'); // 月份从0开始
+        const day = String(date.getUTCDate()).padStart(2, '0');
+        const hours = String(date.getUTCHours()).padStart(2, '0');
+        const minutes = String(date.getUTCMinutes()).padStart(2, '0');
+        const seconds = String(date.getUTCSeconds()).padStart(2, '0');
+    
+        return `${year}-${month}-${day} 14:00:00`;
+    },
+    //复制
+    copyOrderNum() {
+        const orderNum = this.data.roomList.orderNum; // 获取订单编号
+        if (orderNum) {
+            wx.setClipboardData({
+                data: orderNum,
+                success: () => {
+                    wx.showToast({
+                        title: '复制成功',
+                        icon: 'success',
+                        duration: 2000
+                    });
+                },
+                fail: (err) => {
+                    console.error('复制失败:', err);
+                    wx.showToast({
+                        title: '复制失败',
+                        icon: 'none',
+                        duration: 2000
+                    });
+                }
+            });
+        } else {
+            wx.showToast({
+                title: '没有订单编号',
+                icon: 'none',
+                duration: 2000
+            });
+        }
+    },
+    /**
+     * 生命周期函数--监听页面初次渲染完成
+     */
+    onReady: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面显示
+     */
+    onShow: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面隐藏
+     */
+    onHide: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面卸载
+     */
+    onUnload: function () {
+
+    },
+
+    /**
+     * 页面相关事件处理函数--监听用户下拉动作
+     */
+    onPullDownRefresh: function () {
+
+    },
+
+    /**
+     * 页面上拉触底事件的处理函数
+     */
+    onReachBottom: function () {
+
+    },
+
+    /**
+     * 用户点击右上角分享
+     */
+    onShareAppMessage: function () {
+
+    }
+})

+ 3 - 0
nova-tourism/pages/my/my-order/order-detail/index.json

@@ -0,0 +1,3 @@
+{
+  "usingComponents": {}
+}

+ 199 - 0
nova-tourism/pages/my/my-order/order-detail/index.less

@@ -0,0 +1,199 @@
+/* nova-tourism/pages/my/my-order/order-detail/index.wxss */
+.all{
+    width: 100vw;
+    overflow-y: scroll;
+    background-color: #F4F4F4;
+    padding-bottom: 20rpx;
+    .title{
+        width: 100%;
+        font-size: 36rpx;
+        background-color: white;
+        display: flex;
+        justify-content: center;
+        padding-bottom: 25rpx;
+    }
+    .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;
+            font-weight: 600;
+        }
+        .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;
+                }
+            }
+        }
+        .textbox{
+            width: 100%;
+            height: auto;
+            padding-bottom: 40rpx;
+            margin-top: 20rpx;
+            .text1{
+                width: 100%;
+                font-size: 28rpx;
+                display: flex;
+                color: #323232;
+                margin-bottom: 20rpx;
+                .tex2{
+                    margin-left: auto;
+                    font-size: 30rpx;
+                    font-weight: 600;
+                    color: black;
+                   
+                }
+                .tex3{
+                    margin-left: auto;
+                    font-size: 28rpx;
+                    color: #979797;
+                    display: flex;
+                    .tex3-2{
+                        color: #323232;
+                        margin-left: 10rpx;
+                    }
+                }
+
+            }
+            .text2{
+                width: 100%;
+                font-size: 28rpx;
+                display: flex;
+                color: #323232;
+                margin-bottom: 20rpx;
+                .tex1{
+                    width: 200rpx;
+                }
+                .tex4{
+                    width: 100%;
+                    margin-left: 40rpx;
+                    font-size: 28rpx;
+                    color: #979797;
+                    display: flex;
+                }
+            }
+            .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;
+        background-color: white;
+        margin-top: 20rpx;
+        padding-top: 40rpx;
+        .wang-cardbox{
+            margin-top: 20rpx;
+            width: 100%;
+            background-color: white;
+            overflow-y: hidden;
+            padding-left: 3%;
+            padding-right: 3%;
+            padding-bottom: 40rpx;
+            column-count: 2; /* 设置列数 */
+            column-gap: 20rpx; /* 设置列间距 */
+            .wang-card{
+                break-inside: avoid; /* 防止卡片在列之间断裂 */
+                margin-bottom: 20rpx; /* 设置卡片底部间距 */
+                width: 100%; /* 确保卡片宽度为100% */
+                
+                image{
+                    width: 100%;
+                    height: 275rpx;
+                    border-radius: 15rpx;
+                }
+                .wang-catex{
+                    font-size: 28rpx;
+                }
+                .wang-numbox{
+                    width: 100%;
+                    height: 80rpx;
+                    display: flex;
+                    align-items: center;
+                    .wang-num{
+                        display: flex;
+                        justify-content: flex-end;
+                        align-items: flex-end;
+                        color: #C5262Ced;
+                        font-size: 30rpx;
+                        .wang-num1{
+                            font-size: 32rpx;
+                        }
+                        .wang-num2{
+                            font-size: 36rpx;
+                        }
+                    }
+                    .wang-submit{
+                        width: 100rpx;
+                        height: 50rpx;
+                        font-size: 30rpx;
+                        color: white;
+                        background-color: #F8DA7F;
+                        border-radius: 40rpx;
+                        display: flex;
+                        justify-content: center;
+                        align-items: center;
+                        margin-left: auto;
+                    }
+                }
+            }
+        }
+    }
+}

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

@@ -0,0 +1,146 @@
+<!--nova-tourism/pages/my/my-order/order-detail/index.wxml-->
+<nav type="back" background-color="#ffffff" frontColor="#000000" title="订单详细" />
+<view class="all" style="height: {{contentHeight}}rpx;">
+    <view class="title" wx:if="{{roomList.status==100}}">订单处理中</view>
+    <view class="title" wx:if="{{roomList.status==200}}">订单进行中</view>
+    <view class="title" wx:if="{{roomList.status==800}}">订单已完成</view>
+    <view class="cardbox">
+        <block wx:if="{{value=='民宿'}}">
+            <view class="title2">{{roomList.shopStore.storeName}}</view>
+            <view class="roombox">
+                <image src="{{roomList.room.images[0]}}"></image>
+                <view class="room">
+                    <view class="room-name">{{roomList.room.name}}</view>
+                    <view class="room-tag">
+                        <block wx:for="{{roomList.room.tags}}">
+                            {{item}}
+                        </block>
+                    </view>
+                    <view class="room-text">{{roomList.tiem}}</view>
+                </view>
+            </view>
+
+            <view class="textbox">
+                <view class="text1">
+                    <view class="tex1">实付款</view>
+                    <view class="tex2">¥{{roomList.price}}</view>
+                </view>
+                <view class="text1">
+                    <view class="tex1">订单编号</view>
+                    <view class="tex3">
+                        <view class="tex3-1">{{roomList.orderNum}} |</view>
+                        <view class="tex3-2" bindtap="copyOrderNum">复制</view>
+                    </view>
+                </view>
+                <!-- <view class="text1">
+                    <view class="tex1">付款时间</view>
+                    <view class="tex3">
+                        2024-12-03 12:05:43
+                    </view>
+                </view> -->
+                <view class="text1">
+                    <view class="tex1">入住时间</view>
+                    <view class="tex3">
+                        {{roomList.startTime}}
+                    </view>
+                </view>
+                <view class="text1">
+                    <view class="tex1">离店时间</view>
+                    <view class="tex3">
+                        {{roomList.endTime}}
+                    </view>
+                </view>
+                <view class="text1">
+                    <view class="tex1">申请开票</view>
+                    <view class="tex3">
+                        本订单由商家开具,无法显示开票
+                    </view>
+                </view>
+                <view class="sumbitbox" wx:if="{{roomList.status==200}}">
+                    <view class="sumbit">我要续住</view>
+                </view>
+            </view>
+        </block>
+
+        <block wx:if="{{value=='物品'}}">
+            <view class="title2">{{item.shopStore.storeName}}</view>
+            <view class="roombox">
+                <image src="{{roomList.room.images[0]}}"></image>
+                <view class="room">
+                    <view class="room-name">{{roomList.room.name}}</view>
+                    <view class="room-tag">
+                        <block wx:for="{{roomList.room.tags}}">
+                            {{item}}
+                        </block>
+                    </view>
+                    <view class="room-text">{{roomList.tiem}}</view>
+                </view>
+            </view>
+            <view class="textbox">
+                <view class="text1">
+                    <view class="tex1">实付款</view>
+                    <view class="tex2">¥1999.99</view>
+                </view>
+                <view class="text1">
+                    <view class="tex1">订单编号</view>
+                    <view class="tex3">
+                        <view class="tex3-1">4150502930640735137 |</view>
+                        <view class="tex3-2">复制</view>
+                    </view>
+                </view>
+                <view class="text1">
+                    <view class="tex1">付款时间</view>
+                    <view class="tex3">
+                        2024-12-03 12:05:43
+                    </view>
+                </view>
+                <view class="text1">
+                    <view class="tex1">发货时间</view>
+                    <view class="tex3">
+                        2024-12-03 12:05:43
+                    </view>
+                </view>
+                <view class="text1">
+                    <view class="tex1">物流单号</view>
+                    <view class="tex3">
+                        <view class="tex3-1">4150502930640735137 |</view>
+                        <view class="tex3-2">复制</view>
+                    </view>
+                </view>
+                <view class="text1">
+                    <view class="tex1">申请开票</view>
+                    <view class="tex3">
+                        本订单由商家开具,无法显示开票
+                    </view>
+                </view>
+                <view class="text2">
+                    <view class="tex1">收货地址</view>
+                    <view class="tex4">
+                        发货地址发货地址发货地址发货地址发货地址发货地址
+                    </view>
+                </view>
+
+            </view>
+        </block>
+
+    </view>
+
+    <!-- 望仙礼遇 -->
+    <view class="box">
+        <view class="wang-cardbox">
+            <block wx:for="{{4}}">
+                <view class="wang-card" bindtap="gourl2">
+                    <image src="https://file-cloud.fmode.cn//tmp/srFPqGFAzeT5958c828d985e451ed4c0b452e39ff57a.jpeg"></image>
+                    <view class="wang-catex">粉黛胖挑主人杯(无礼盒)·手做</view>
+                    <view class="wang-numbox">
+                        <view class="wang-num">
+                            <view class="wang-num1">¥</view>
+                            <view class="wang-num2">19900</view>
+                        </view>
+                        <view class="wang-submit">购买</view>
+                    </view>
+                </view>
+            </block>
+        </view>
+    </view>
+</view>

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


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