邹能昇 4 månader sedan
förälder
incheckning
3ba4efc81d

+ 55 - 15
nova-tourism/pages/my/merchant/merchant-home/order2-list/index.js

@@ -11,7 +11,44 @@ Page({
         active: 0,
         list: [],
         price: null,
-        storeId:null
+        storeId: null,
+        show: false,
+        showid:null,
+    },
+   async  getUserInfo(e) {
+        console.log(e.currentTarget.dataset.item.objectId);
+        let objectId = e.currentTarget.dataset.item.objectId
+        let newOrder = new Parse.Query('RoomOrder');
+        newOrder.equalTo('company', company);
+        newOrder.equalTo('objectId', objectId);
+        newOrder.notEqualTo('isDeleted', true);
+        let order = await newOrder.first();
+        console.log(order);
+        order.set('status',200)
+        try{
+            let saveDate = await order.save();
+            console.log('保存成功');
+            this.setData({
+                showid:null
+            })
+            this.getShopOrder()
+        }catch (error) {
+            console.error("保存数据时出现错误:", error);
+        }
+    },
+
+    onClose() {
+        this.setData({
+            show: false,
+        }); // 关闭弹窗并重置标志位
+    },
+    ONShow(e) {
+        const id =e.currentTarget.dataset.item.objectId
+        this.setData({
+            showid:id,
+            show: true,
+        }); // 设置弹窗显示
+        console.log(this.data.showid);
     },
     onChange(event) {
         let active = event.detail.name
@@ -106,7 +143,7 @@ Page({
         ShopOrder.equalTo('company', company);
         ShopOrder.include('room');
         ShopOrder.equalTo('shopStore', this.data.storeId);
-        
+
         if (this.data.active == 1) {
             ShopOrder.equalTo('status', 100);
         }
@@ -117,10 +154,11 @@ Page({
             console.log(this.data.active);
             ShopOrder.equalTo('status', 400);
         }
-    
+
         ShopOrder.include('room');
+        ShopOrder.include('user');
         ShopOrder.exists('status');
-        
+
         ShopOrder.find().then(res => {
             let list = [];
             res.forEach(item => {
@@ -129,12 +167,12 @@ Page({
                 activitys.Time = dateF.formatTime("mm-dd", activitys.endTime.iso);
                 activitys.a = dateF.formatTime("YYYY-mm-dd", activitys.startTime.iso); // 只保留日期部分
                 activitys.e = dateF.formatTime("YYYY-mm-dd", activitys.endTime.iso); // 只保留日期部分
-                
+
                 // 计算天数,只考虑日期部分
                 activitys.day = parseInt((new Date(activitys.e).getTime() - new Date(activitys.a).getTime()) / (1000 * 60 * 60 * 24));
                 list.push(activitys);
             });
-    
+
             this.setData({
                 list
             });
@@ -152,10 +190,12 @@ Page({
     /**
      * 生命周期函数--监听页面加载
      */
-    onLoad: function(options) {
+    onLoad: function (options) {
         let storeId = options.storeId;
         console.log(storeId);
-        this.setData({ storeId: storeId })
+        this.setData({
+            storeId: storeId
+        })
         this.getShopOrder()
 
         // this.getDayAll()
@@ -164,49 +204,49 @@ Page({
     /**
      * 生命周期函数--监听页面初次渲染完成
      */
-    onReady: function() {
+    onReady: function () {
 
     },
 
     /**
      * 生命周期函数--监听页面显示
      */
-    onShow: function() {
+    onShow: function () {
 
     },
 
     /**
      * 生命周期函数--监听页面隐藏
      */
-    onHide: function() {
+    onHide: function () {
 
     },
 
     /**
      * 生命周期函数--监听页面卸载
      */
-    onUnload: function() {
+    onUnload: function () {
 
     },
 
     /**
      * 页面相关事件处理函数--监听用户下拉动作
      */
-    onPullDownRefresh: function() {
+    onPullDownRefresh: function () {
 
     },
 
     /**
      * 页面上拉触底事件的处理函数
      */
-    onReachBottom: function() {
+    onReachBottom: function () {
 
     },
 
     /**
      * 用户点击右上角分享
      */
-    onShareAppMessage: function() {
+    onShareAppMessage: function () {
 
     }
 })

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

@@ -1,3 +1,5 @@
 {
-  "usingComponents": {}
+  "usingComponents": {
+    "van-dialog": "@vant/weapp/dialog/index"
+  }
 }

+ 41 - 0
nova-tourism/pages/my/merchant/merchant-home/order2-list/index.less

@@ -29,6 +29,47 @@ page {
             color: red;
         }
     }
+    .order-number2 {
+        display: flex;
+        justify-content: space-between;
+        margin-bottom: 20rpx;
+        margin-top: 10rpx;
+        .order-title {
+            margin-right: 20rpx;
+        }
+
+        .order-txts {
+            color: #767676;
+        }
+
+        .number {
+            font-size: 30rpx;
+        }
+
+        .state {
+            font-size: 30rpx;
+        }
+    }
+    .submitbox{
+        width: 100%;
+        height: 68rpx;
+        .submit{
+            width: 168rpx;
+            height: 68rpx;
+            margin-left: auto;
+            margin-right: 20rpx;
+            border-radius: 20rpx;
+            display: flex;
+            justify-content: center;
+            align-items: center;
+            font-size: 28rpx;
+            font-weight: 400;
+            border: #F37B40 solid 2rpx;
+            background-color: white;
+            color: #F37B40;
+            z-index: 20;
+        }
+    }
 
     .order-number {
         display: flex;

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

@@ -1,7 +1,7 @@
 <nav type="back" background-color="#46a9a4" title="订单列表" />
-<block wx:for="{{list}}" wx:key="index" >
-    <view class="box" data-item="{{item}}" bindtap="orderdeils" style="color: #382E2E;">
-        <view class="order-number">
+<block wx:for="{{list}}" wx:key="index">
+    <view class="box" style="color: #382E2E;">
+        <view class="order-number" bindtap="orderdeils" data-item="{{item}}">
             <view class="number">订单号:{{item.orderNum}}</view>
             <block wx:if="{{item.status==100}}">
                 <view class="state">已付款</view>
@@ -9,29 +9,29 @@
             <block wx:if="{{item.status==200}}">
                 <view class="state">已入住</view>
             </block>
-            <block wx:if="{{item.status==200}}">
+            <!-- <block wx:if="{{item.status==200}}">
                 <view class="state">续住</view>
-            </block>
+            </block> -->
             <block wx:if="{{item.status==400}}">
                 <view class="state">已退房</view>
             </block>
-             <block wx:if="{{item.status==500}}">
+            <block wx:if="{{item.status==500}}">
                 <view class="state">申请退款</view>
             </block>
-             <block wx:if="{{item.status==601}}">
+            <block wx:if="{{item.status==601}}">
                 <view class="state">退款审核通过</view>
             </block>
-             <block wx:if="{{item.status==602}}">
+            <block wx:if="{{item.status==602}}">
                 <view class="state">退款被驳回</view>
             </block>
-             <block wx:if="{{item.status==00}}">
+            <block wx:if="{{item.status==00}}">
                 <view class="state">退款成功</view>
             </block>
             <block wx:if="{{item.status==800}}">
                 <view class="state">已完成</view>
             </block>
         </view>
-        <view class="order-txt">
+        <view class="order-txt" bindtap="orderdeils" data-item="{{item}}">
             <image class="order-image" src="{{item.shopStore.cover}}" />
             <view class="order-name">
                 <view class="name">{{item.room.name}}</view>
@@ -39,13 +39,23 @@
                 <view class="order-time">{{item.shopStore.address}}</view>
             </view>
         </view>
-        <view class="order-times">
+        <view class="order-number2" bindtap="orderdeils" data-item="{{item}}">
+            <view class="order-title">联系电话:</view>
+            <view class="order-txts">{{item.mobile}} </view>
+        </view>
+        <view class="order-times" bindtap="orderdeils" data-item="{{item}}">
             <view class="order-date">
                 <view class="date">{{item.orderTime}}——{{item.Time}}</view>
                 <view class="sky">{{item.day}}晚</view>
             </view>
             <view class="price">¥{{item.price}}</view>
         </view>
+        <view class="submitbox" wx:if="{{item.status==100}}">
+            <view class="submit" data-item="{{item}}" bindtap="ONShow">确认入住</view>
+        </view>
+        <!-- 确认弹窗 -->
+        <van-dialog wx:if="{{showid==item.objectId}}" message='确定该用户已入住'  data-item="{{item}}"  show="{{ show }}" show-cancel-button  bind:cancel="onClose" bind:confirm="getUserInfo">
+        </van-dialog>
         <!-- <view class="order-order">
                 <view class="service">联系客服</view> 
                 <view class="service"  >联系房东</view>

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 0 - 1
nova-tourism/pages/my/merchant/merchant-home/order2-list/index.wxss


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

@@ -24,6 +24,6 @@
     </view>
     <view class="order-number">
         <view class="order-title">联系电话:</view>
-        <view class="order-txts"bindtap="phone">{{order.user.mobile}}  <van-icon name="phone" /></view>
+        <view class="order-txts"bindtap="phone">{{order.mobile}}  <van-icon name="phone" /></view>
     </view>
 </view>

Vissa filer visades inte eftersom för många filer har ändrats