Browse Source

shangjiaduan page

邹能昇 3 months ago
parent
commit
3ab79532fb

+ 2 - 1
app.json

@@ -27,7 +27,8 @@
                 "pages/my/merchant/comments/hotel/index",
                 "pages/my/merchant/comments/hotel/comment-detail/index",
                 "pages/my/merchant/room-manage/index",
-                "pages/my/merchant/room-manage/room-edit/index"
+                "pages/my/merchant/room-manage/room-edit/index",
+                "pages/my/merchant/code-verify/index"
             ]
         },
         {

+ 118 - 0
nova-tourism/pages/my/merchant/code-verify/index.js

@@ -0,0 +1,118 @@
+let Parse = getApp().Parse
+const company = getApp().globalData.company
+let navigationBarHeight = getApp().globalData.statusBarHeight + 44;
+const rechText = require('../../../../../utils/rech-text')
+const dateF = require('../../../../../utils/date')
+const dateServ = require('../../../../../utils/date')
+Page({
+
+    /**
+     * 页面的初始数据
+     */
+    data: {
+        id: "",
+        order: null,
+    },
+    async getRoomOrder() {
+        let id = this.data.id
+        console.log(id, 12222323);
+        let RoomOrder = new Parse.Query('RoomOrder')
+        RoomOrder.include('room')
+        RoomOrder.include('shopStore')
+        let roomOrder = await RoomOrder.get(id)
+        console.log(roomOrder, 666666);
+        let Order = roomOrder.toJSON()
+        Order.createdAt = dateF.formatTime("YYYY-mm-dd HH:MM:SS", Order.createdAt)
+        Order.room.note = rechText.formatRichText(Order.room.note)
+        Order['day'] = parseInt((new Date(Order.endTime.iso).getTime() - new Date(Order.startTime.iso).getTime()) / (1000 * 60 * 60 * 24));
+        Order.startTime = dateServ.formatTime('YYYY-mm-dd', Order.startTime.iso)
+        Order.endTime = dateServ.formatTime('YYYY-mm-dd', Order.endTime.iso)
+        this.setData({
+            order: Order
+        })
+        console.log(this.data.order);
+    },
+    async submit() {
+        try {
+            let id = this.data.id
+            let RoomOrder = new Parse.Query("RoomOrder")
+            let roomOrder = await RoomOrder.get(id)
+            roomOrder.set("status", 400)
+            await roomOrder.save()
+            console.log(res)
+            wx.showToast({
+                title: '核销成功',
+                icon: 'none'
+            })
+        } catch (error) {
+            wx.showToast({
+                title: '核销失败',
+                icon: 'none'
+            })
+        }
+
+        wx.navigateBack({
+            delta: 1,
+
+        });
+
+
+    },
+    /**
+     * 生命周期函数--监听页面加载
+     */
+    onLoad: function(options) {
+        let id = options.id
+        this.setData({ id: id })
+        this.getRoomOrder()
+    },
+
+    /**
+     * 生命周期函数--监听页面初次渲染完成
+     */
+    onReady: function() {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面显示
+     */
+    onShow: function() {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面隐藏
+     */
+    onHide: function() {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面卸载
+     */
+    onUnload: function() {
+
+    },
+
+    /**
+     * 页面相关事件处理函数--监听用户下拉动作
+     */
+    onPullDownRefresh: function() {
+
+    },
+
+    /**
+     * 页面上拉触底事件的处理函数
+     */
+    onReachBottom: function() {
+
+    },
+
+    /**
+     * 用户点击右上角分享
+     */
+    onShareAppMessage: function() {
+
+    }
+})

+ 3 - 0
nova-tourism/pages/my/merchant/code-verify/index.json

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

+ 71 - 0
nova-tourism/pages/my/merchant/code-verify/index.less

@@ -0,0 +1,71 @@
+page {
+    background: #f6f6f6;
+}
+
+.top {
+    display: flex;
+    background: #ffffff;
+    margin: 30rpx;
+    border-radius: 30rpx;
+    padding: 20rpx;
+
+    .top-image {
+        width: 240rpx;
+        height: 180rpx;
+        margin-right: 20rpx;
+    }
+
+    .title {
+        .order-name {
+            overflow: hidden; //一定要写
+            text-overflow: ellipsis; //超出省略号
+            display: -webkit-box; //一定要写
+            -webkit-line-clamp: 1; //控制行数
+            -webkit-box-orient: vertical; //一定要写
+        }
+
+        .order-time {
+            font-size: 26rpx;
+            color: #666666;
+            margin-top: 30rpx;
+        }
+
+        .order-price {
+            color: red;
+            margin-top: 30rpx;
+        }
+    }
+}
+
+.order-prompt {
+    margin: 30rpx;
+    padding: 20rpx;
+    border-radius: 30rpx;
+    background: #ffffff;
+
+    .prompt-title {
+        font-size: 30rpx;
+    }
+
+    .prompt {
+        margin-top: 20rpx;
+    }
+
+    .order-number {
+        margin-top: 20rpx;
+        font-size: 30rpx;
+        color: #666666;
+        display: flex;
+        .number {
+            color: black;
+        }
+    }
+}
+.bommon {
+    position: fixed;
+    bottom: 0;
+    width: 100%;
+    background: #46a9a4;
+    padding: 30rpx 0;
+    text-align: center;
+}

+ 44 - 0
nova-tourism/pages/my/merchant/code-verify/index.wxml

@@ -0,0 +1,44 @@
+<nav type="back" background-color="#46a9a4" title="核销" />
+<block wx:if="{{id}}">
+    <view class="top">
+        <image class="top-image" src="{{order.images[0]}}"></image>
+        <view class="title">
+            <view class="order-name">{{order.name}}</view>
+            <view class="order-time">营业时间:{{order.shopStore.workingTime}}</view>
+            <view class="order-price">¥{{order.price}}</view>
+        </view>
+    </view>
+    <view class="order-prompt">
+        <view class="prompt-title">订房须知</view>
+        <block>
+            <rich-text nodes="{{order.room.note}}" style="width: 100%;height: 100%; margin-right: 0 auto;"></rich-text>
+        </block>
+    </view>
+    <view class="order-prompt">
+        <view class="prompt-title">订单信息</view>
+        <view class="order-number">
+            订单编号:
+            <view class="number">{{order.orderNum}}</view>
+        </view>
+        <view class="order-number">
+            下单时间:
+            <view class="number">{{order.createdAt}}</view>
+        </view>
+        <view class="order-number">
+            入住时间:
+            <view class="number">{{order.startTime}}——{{order.endTime}}</view>
+        </view>
+        <view class="order-number">
+            数量:
+            <view class="number">{{order.day}}</view>
+        </view>
+        <view class="order-number">
+            总价:
+            <view class="number">¥{{order.price}}</view>
+        </view>
+    </view>
+</block>
+<block wx:if="{{!id}}">
+    <van-empty description="暂无" />
+</block>
+<view class="bommon" bindtap="submit">确认核销</view>

+ 1 - 0
nova-tourism/pages/my/merchant/code-verify/index.wxss

@@ -0,0 +1 @@
+page{background:#f6f6f6}.top{display:flex;background:#ffffff;margin:30rpx;border-radius:30rpx;padding:20rpx}.top .top-image{width:240rpx;height:180rpx;margin-right:20rpx}.top .title .order-name{overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical}.top .title .order-time{font-size:26rpx;color:#666666;margin-top:30rpx}.top .title .order-price{color:red;margin-top:30rpx}.order-prompt{margin:30rpx;padding:20rpx;border-radius:30rpx;background:#ffffff}.order-prompt .prompt-title{font-size:30rpx}.order-prompt .prompt{margin-top:20rpx}.order-prompt .order-number{margin-top:20rpx;font-size:30rpx;color:#666666;display:flex}.order-prompt .order-number .number{color:black}.bommon{position:fixed;bottom:0;width:100%;background:#46a9a4;padding:30rpx 0;text-align:center}

+ 16 - 15
nova-tourism/pages/my/merchant/merchant-home/index.js

@@ -147,13 +147,14 @@ Page({
     //         url: '../merchant-home/order3-list/index?storeId=' + storeId
     //     });
     // },
-    goods() {
-        let id = this.data.store.objectId
-        wx.navigateTo({
-            url: '/nova-tourism/pages/my/merchant/merchant-home/goods/index?id=' + id
-        });
 
-    },
+    // goods() {
+    //     let id = this.data.store.objectId
+    //     wx.navigateTo({
+    //         url: '/nova-tourism/pages/my/merchant/merchant-home/goods/index?id=' + id
+    //     });
+
+    // },
 
     logout() {
         wx.showModal({
@@ -164,7 +165,7 @@ Page({
                     wx.removeStorageSync('merchant')
                     wx.removeStorageSync('store')
                     wx.navigateTo({
-                        url: '/nova-tourism/pages/index/index'
+                        url: '../../../../pages/index/index'
                     })
                 } else {
 
@@ -193,14 +194,14 @@ Page({
         });
 
     },
-    category() {
-        let id = this.data.store.objectId
-        let type = this.data.store.type
-        wx.navigateTo({
-            url: `/nova-tourism/pages/my/merchant/merchant-home/category/index?id=${id}&&type=${type}`
-        });
+    // category() {
+    //     let id = this.data.store.objectId
+    //     let type = this.data.store.type
+    //     wx.navigateTo({
+    //         url: `/nova-tourism/pages/my/merchant/merchant-home/category/index?id=${id}&&type=${type}`
+    //     });
 
-    },
+    // },
     roommanage() {
         wx.navigateTo({
             url: '../room-manage/index'
@@ -250,7 +251,7 @@ Page({
                 switch (that.data.store.type) {
                     case 'stay':
                         wx.navigateTo({
-                            url: `/nova-tourism/pages/my/merchant/code-verify/index?id=${code1}`
+                            url: `../code-verify/index?id=${code1}`
                         });
                         break;
                     case 'catering':

+ 2 - 2
nova-tourism/pages/my/merchant/merchant-home/index.wxml

@@ -130,13 +130,13 @@
         </block>
         <block wx:if="{{store.type=='shop'}}">
             <!-- <view class="box-title">商品管理</view> -->
-            <view class="box-title" bindtap="goods">
+            <!-- <view class="box-title" bindtap="goods">
                 <view class="box-details">
                     <van-icon name="https://file-cloud.fmode.cn/sHNeVwSaAg/20230705/l1hdoe112459997.png" size="20"/>
                     <view class="name">商品管理</view>
                 </view>
                 <van-icon name="arrow" />
-            </view>
+            </view> -->
             <!-- <view class="box-title" bindtap="category">
                 <view class="box-details">
                     <van-icon name="gift-o" />