Browse Source

minsudingdan page

邹能昇 4 months ago
parent
commit
6ab8afedb5

+ 2 - 1
app.json

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

+ 4 - 0
nova-tourism/components/homestay/index.less

@@ -150,6 +150,10 @@
                     -webkit-line-clamp: 2; /* 限制显示的行数,这里设置为3行 */
                     text-overflow: ellipsis; /* 超出部分显示省略号 */
                 }
+                .miaosu2{
+                    width: 100%;
+                    height: 80rpx;
+                }
                 .bottom{
                     width: 100%;
                     height: 80rpx;

+ 1 - 1
nova-tourism/components/homestay/index.wxml

@@ -44,7 +44,7 @@
                     <view class="miaosu" wx:if="{{item.desc}}" data-id="{{item.objectId}}" data-url="../../pages/homestay/homestay-detail/index" bindtap="gourl">
                         {{item.desc}}
                     </view>
-
+                    <view class="miaosu2" wx:if="{{!item.desc}}"></view>
                     <view class="bottom">
                         <view class="qian" data-id="{{item.objectId}}" data-url="../../pages/homestay/homestay-detail/index" bindtap="gourl">

File diff suppressed because it is too large
+ 0 - 0
nova-tourism/components/homestay/index.wxss


+ 7 - 0
nova-tourism/components/my/index.js

@@ -80,5 +80,12 @@ Component({
                 });
             }
         },
+        goorder(e){
+            const url = e.currentTarget.dataset.url;
+            const active = e.currentTarget.dataset.active;
+            wx.navigateTo({
+                url: `${url}?active=`+active,
+            });
+        }
     }
 })

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

@@ -25,15 +25,15 @@
     <view class="myorderbox">
         <view class="my-name">我的订单</view>
         <view class="or-box">
-            <view class="myorder">
+            <view class="myorder" bindtap="goorder" data-url="../../pages/my/my-order/index" data-active="0" >
                 <image src="https://file-cloud.fmode.cn/EbxZUK5lBI/20241122/43b1ee050235369.png"></image>
                 <view class="or-tex">处理中</view>
             </view>
-            <view class="myorder">
+            <view class="myorder" bindtap="goorder" data-url="../../pages/my/my-order/index" data-active="1">
                 <image src="https://file-cloud.fmode.cn/EbxZUK5lBI/20241122/3f134m050312537.png"></image>
                 <view class="or-tex">进行中</view>
             </view>
-            <view class="myorder">
+            <view class="myorder" bindtap="goorder" data-url="../../pages/my/my-order/index" data-active="2">
                 <image src="https://file-cloud.fmode.cn/EbxZUK5lBI/20241122/n35s1s050408606.png"></image>
                 <view class="or-tex">已完成</view>
             </view>

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

@@ -0,0 +1,170 @@
+// nova-tourism/pages/my/my-order/index.js
+let Parse = getApp().Parse;
+const company = getApp().globalData.company
+Page({
+
+    /**
+     * 页面的初始数据
+     */
+    data: {
+        statusBarHeight: 0,
+        screenHeight: 0,
+        customHeight: 0,
+        bottomNavHeight: 0,
+        contentHeight: 0,
+
+        active:0,
+
+        option: [
+            { text: '民宿订单', value: '民宿' },
+            { text: '物品订单', value: '物品' },
+          ],
+          value:'民宿',
+          roomList:[],
+    },
+
+    /**
+     * 生命周期函数--监听页面加载
+     */
+    onLoad: function (options) {
+        this.setData({
+            active:Number(options.active)
+        })
+
+        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
+        });
+        this.getRoomOrder()
+    },
+    //改变民宿或物品
+    change(e){
+        console.log(this.data.value);
+        this.setData({
+            active:0
+        })
+        if(this.data.value=='民宿'){
+            this.getRoomOrder()
+        }else{
+
+        }
+    },
+    //改变订单状态
+    onChange(event){
+        let active = event.detail.name;
+        this.setData({
+          active: active
+        });
+        if(this.data.value=='民宿'){
+            this.getRoomOrder()
+        }else{
+
+        }
+        console.log(this.data.active,this.data.value);
+    },
+    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}日离店`;
+    },
+    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');
+        if (this.data.active == 0) {
+          Order.equalTo('status', 100);
+        }
+        if (this.data.active == 1) {
+          Order.equalTo('status', 200);
+        }
+        if (this.data.active == 2) {
+          console.log(this.data.active);
+          Order.equalTo('status', 800);
+        }
+        let room = await Order.find();
+        let roomList = room.map(item => {
+            let roomItme = item.toJSON();
+            let startTime = roomItme.startTime
+            let endTime = roomItme.endTime
+            roomItme.tiem = this.formatDate2(startTime,endTime)
+            return roomItme
+        });
+        this.setData({
+            roomList
+        })
+        console.log(this.data.roomList);
+    },
+
+    /**
+     * 生命周期函数--监听页面初次渲染完成
+     */
+    onReady: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面显示
+     */
+    onShow: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面隐藏
+     */
+    onHide: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面卸载
+     */
+    onUnload: function () {
+
+    },
+
+    /**
+     * 页面相关事件处理函数--监听用户下拉动作
+     */
+    onPullDownRefresh: function () {
+
+    },
+
+    /**
+     * 页面上拉触底事件的处理函数
+     */
+    onReachBottom: function () {
+
+    },
+
+    /**
+     * 用户点击右上角分享
+     */
+    onShareAppMessage: function () {
+
+    }
+})

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

@@ -0,0 +1,9 @@
+{
+  "usingComponents": {
+    "van-tab": "@vant/weapp/tab/index",
+    "van-tabs": "@vant/weapp/tabs/index",
+    "van-divider": "@vant/weapp/divider/index",
+    "van-dropdown-menu": "@vant/weapp/dropdown-menu/index",
+    "van-dropdown-item": "@vant/weapp/dropdown-item/index"
+  }
+}

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

@@ -0,0 +1,200 @@
+/* nova-tourism/pages/my/my-order/index.wxss */
+.all{
+    width: 100vw;
+    background-color: #F4F4F4;
+    overflow-y: scroll;
+    padding-bottom: 20rpx;
+    .tabbos{
+        width: 100%;
+        background-color: white;
+        .tabs{
+            width: 50%;
+            margin-left: auto;
+        }
+        .a{
+            box-shadow:none;
+        }
+    }
+
+    .cardbox{
+        width: 100%;
+        height: auto;
+        padding-left: 30rpx;
+        padding-right: 30rpx;
+        padding-top: 20rpx;
+        padding-bottom: 10rpx;
+        margin-top: 20rpx;
+        background-color: white;
+        .title{
+            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;
+                }
+            }
+        }
+        .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;
+        background-color: white;
+        margin-top: 20rpx;
+        .wangbox{
+            width: 100%;
+            display: flex;
+            justify-content: center;
+            align-items: center;
+            flex-direction: column;
+            margin-top: 40rpx;
+            margin-bottom: 20rpx;
+            .wang{
+                width: 200rpx;
+                height: 60rpx;
+                font-size: 32rpx;
+                color: #67806A;
+                background-image: url(https://file-cloud.fmode.cn/EbxZUK5lBI/20241126/dm1jj2032446503.png?imageView2/1/w/200/h/200);
+                background-position: center; /* 背景图片居中 */
+                // background-size: cover; /* 背景图片覆盖整个元素 */
+                background-repeat: no-repeat; /* 不重复背景图片 */
+                display: flex;
+                justify-content: center;
+                align-items: center;
+            }
+            .wang2{
+                font-size: 28rpx;
+                color: #969696;
+            }
+        }
+        .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;
+                    }
+                }
+            }
+        }
+    }
+}

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

@@ -0,0 +1,181 @@
+<!--nova-tourism/pages/my/my-order/index.wxml-->
+<nav type="back" background-color="#ffffff" frontColor="#000000" title="我的订单" />
+<view class="all" style="height: {{contentHeight}}rpx;">
+    <view class="tabbos">
+        <view class="tabs">
+            <van-dropdown-menu active-color='#B2CEB9'>
+                <van-dropdown-item bind:change='change' model:value="{{ value }}" options="{{ option }}" />
+            </van-dropdown-menu>
+        </view>
+    </view>
+
+    <van-tabs active="{{ active }}" color='#B2CEB9' bind:change="onChange" title-inactive-color='#969696' title-active-color='#B2CEB9'>
+        <van-tab title="处理中">
+            <block wx:if="{{value=='民宿'}}" wx:for="{{roomList}}">
+                <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>
+                        <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">2024年11月11入住-2024年11月11入住</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 class="sumbit">订单详细</view>
+                    </view>
+                </view>
+            </block>
+            <block wx:if="{{value=='物品'}}" wx:for="{{3}}">
+                <view class="cardbox">
+                    <view class="title">望仙礼遇</view>
+                    <view class="roombox">
+                        <image src="https://file-cloud.fmode.cn//tmp/mqHkA2qV3Q8nca3dc59bad49de6e5ae57afa81d78ae8.jpeg?imageView2/1/w/200/h/200"></image>
+                        <view class="room">
+                            <view class="room-name">房间描述房间描述</view>
+                            <view class="room-text2">紫色经典款</view>
+                        </view>
+                    </view>
+                    <van-divider customStyle="margin: 20rpx;border-color:'#B1B1B1' " />
+                    <view class="pricebox">
+                        <view class="ciri">望仙次日达</view>
+                        <view class="price">实付款¥19999.99</view>
+                    </view>
+                    <view class="sumbitbox">
+                        <view class="sumbit">订单详细</view>
+                    </view>
+                </view>
+            </block>
+
+        </van-tab>
+
+        <van-tab title="进行中">
+
+            <block wx:if="{{value=='民宿'}}" wx:for="{{roomList}}">
+                <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>
+                        <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">2024年11月11入住-2024年11月11入住</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 class="sumbit">变更订单</view>
+                    </view>
+                </view>
+            </block>
+            <block wx:if="{{value=='物品'}}" wx:for="{{3}}">
+                <view class="cardbox">
+                    <view class="title">望仙礼遇</view>
+                    <view class="roombox">
+                        <image src="https://file-cloud.fmode.cn//tmp/mqHkA2qV3Q8nca3dc59bad49de6e5ae57afa81d78ae8.jpeg?imageView2/1/w/200/h/200"></image>
+                        <view class="room">
+                            <view class="room-name">房间描述房间描述</view>
+                            <view class="room-text2">紫色经典款</view>
+                        </view>
+                    </view>
+                    <van-divider customStyle="margin: 20rpx;border-color:'#B1B1B1' " />
+                    <view class="pricebox">
+                        <view class="ciri">望仙次日达</view>
+                        <view class="price">实付款¥19999.99</view>
+                    </view>
+                    <view class="sumbitbox">
+                        <view class="sumbit">查看物流</view>
+                    </view>
+                </view>
+            </block>
+
+        </van-tab>
+
+        <van-tab title="已完成">
+
+            <block wx:if="{{value=='民宿'}}" wx:for="{{roomList}}">
+                <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>
+                        <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">2024年11月11入住-2024年11月11入住</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 class="sumbit">订单详细</view>
+                    </view>
+                </view>
+            </block>
+            <block wx:if="{{value=='物品'}}" wx:for="{{3}}">
+                <view class="cardbox">
+                    <view class="title">望仙礼遇</view>
+                    <view class="roombox">
+                        <image src="https://file-cloud.fmode.cn//tmp/mqHkA2qV3Q8nca3dc59bad49de6e5ae57afa81d78ae8.jpeg?imageView2/1/w/200/h/200"></image>
+                        <view class="room">
+                            <view class="room-name">房间描述房间描述</view>
+                            <view class="room-text2">紫色经典款</view>
+                        </view>
+                    </view>
+                    <van-divider customStyle="margin: 20rpx;border-color:'#B1B1B1' " />
+                    <view class="pricebox">
+                        <view class="ciri">望仙次日达</view>
+                        <view class="price">实付款¥19999.99</view>
+                    </view>
+                    <view class="sumbitbox">
+                        <view class="sumbit">订单详细</view>
+                    </view>
+                </view>
+            </block>
+
+        </van-tab>
+    </van-tabs>
+    <!-- 望仙礼遇 -->
+    <view class="box">
+        <view class="wangbox">
+            <view class="wang">望仙礼遇</view>
+        </view>
+        <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/index.wxss


+ 6 - 0
project.private.config.json

@@ -51,6 +51,12 @@
                     "pathName": "nova-tourism/pages/my/merchant/merchant-home/index",
                     "query": "",
                     "scene": null
+                },
+                {
+                    "name": "我的订单",
+                    "pathName": "nova-tourism/pages/my/my-order/index",
+                    "query": "active=0",
+                    "scene": null
                 }
             ]
         }

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