邹能昇 преди 3 месеца
родител
ревизия
c7e9e31773
променени са 37 файла, в които са добавени 2015 реда и са изтрити 7 реда
  1. 2 1
      app.json
  2. 103 0
      nova-tourism/components/calendar/index.js
  3. 4 0
      nova-tourism/components/calendar/index.json
  4. 72 0
      nova-tourism/components/calendar/index.wxml
  5. 1 0
      nova-tourism/components/calendar/index.wxss
  6. 39 0
      nova-tourism/components/cell-list/index.js
  7. 6 0
      nova-tourism/components/cell-list/index.json
  8. 67 0
      nova-tourism/components/cell-list/index.less
  9. 15 0
      nova-tourism/components/cell-list/index.wxml
  10. 1 0
      nova-tourism/components/cell-list/index.wxss
  11. 10 2
      nova-tourism/components/homestay/index.js
  12. 46 0
      nova-tourism/components/list-card/index.js
  13. 4 0
      nova-tourism/components/list-card/index.json
  14. 57 0
      nova-tourism/components/list-card/index.less
  15. 16 0
      nova-tourism/components/list-card/index.wxml
  16. 1 0
      nova-tourism/components/list-card/index.wxss
  17. 50 0
      nova-tourism/components/list-item/index.js
  18. 6 0
      nova-tourism/components/list-item/index.json
  19. 14 0
      nova-tourism/components/list-item/index.less
  20. 27 0
      nova-tourism/components/list-item/index.wxml
  21. 1 0
      nova-tourism/components/list-item/index.wxss
  22. 55 0
      nova-tourism/components/modal/index.js
  23. 6 0
      nova-tourism/components/modal/index.json
  24. 58 0
      nova-tourism/components/modal/index.less
  25. 18 0
      nova-tourism/components/modal/index.wxml
  26. 1 0
      nova-tourism/components/modal/index.wxss
  27. 68 3
      nova-tourism/pages/homestay/homestay-detail/index.js
  28. 1 1
      nova-tourism/pages/homestay/homestay-detail/index.wxml
  29. 831 0
      nova-tourism/pages/homestay/homestay-order/index.js
  30. 15 0
      nova-tourism/pages/homestay/homestay-order/index.json
  31. 44 0
      nova-tourism/pages/homestay/homestay-order/index.less
  32. 76 0
      nova-tourism/pages/homestay/homestay-order/index.wxml
  33. 1 0
      nova-tourism/pages/homestay/homestay-order/index.wxss
  34. 14 0
      nova-tourism/service/data.js
  35. 64 0
      nova-tourism/service/date.js
  36. 220 0
      nova-tourism/styles/base.less
  37. 1 0
      nova-tourism/styles/base.wxss

+ 2 - 1
app.json

@@ -10,7 +10,8 @@
                 "pages/index/index",
                 "pages/homestay/homestay-detail/index",
                 "pages/my/my-card/index",
-                "pages/my/my-wallet/index"
+                "pages/my/my-wallet/index",
+                "pages/homestay/homestay-order/index"
             ]
         },
         {

+ 103 - 0
nova-tourism/components/calendar/index.js

@@ -0,0 +1,103 @@
+// nova-tourism/components/calendar/index.js
+Component({
+    /**
+     * 组件的属性列表
+     */
+    properties: {
+        show:{
+            type:Boolean,
+            default: false
+        },
+        title: {
+            type: String,
+            value: '日期选择',
+        },
+        color: String,
+        formatter: null,
+        // defaultDate: {
+        //     type: null,
+        //     observer: function (val) {
+        //       this.setData({ currentDate: val });
+        //       this.scrollIntoView();
+        //     },
+        //   },
+    },
+    created: function () {
+        this.setData({
+          currentDate: this.getInitialDate(this.defaultDate),
+        });
+    },
+    /**
+     * 组件的初始数据
+     */
+    data: {
+        subtitle: '',
+        currentDate: null,
+        scrollIntoView: '',
+        startTime:'',
+        endTime: ''
+    },
+
+    /**
+     * 组件的方法列表
+     */
+    methods: {
+        getInitialDate: function(defaultDate){
+            let now = new Date()
+            let currentYear = now.getFullYear();
+            let currentMonth = now.getMonth()+1;
+            let currentDay = now.getDay();
+            // let months = 
+            if(!defaultDate){
+                
+            }
+        },
+        getInitialDate: function (defaultDate) {
+            var _this = this;
+            if (defaultDate === void 0) {// defaultDate 为undefined
+              defaultDate = null;
+            }
+            let {type,minDate,maxDate} = this.data;
+            var now = utils_1.getToday().getTime();
+            if (type === 'range') {
+              if (!Array.isArray(defaultDate)) {
+                defaultDate = [];
+              }
+              var _b = defaultDate || [],
+                startDay = _b[0],
+                endDay = _b[1];
+              var start = this.limitDateRange(
+                startDay || now,
+                minDate,
+                utils_1.getPrevDay(new Date(maxDate)).getTime()
+              );
+              var end = this.limitDateRange(
+                endDay || now,
+                utils_1.getNextDay(new Date(minDate)).getTime()
+              );
+              return [start, end];
+            }
+            if (type === 'multiple') {
+              if (Array.isArray(defaultDate)) {
+                return defaultDate.map(function (date) {
+                  return _this.limitDateRange(date);
+                });
+              }
+              return [this.limitDateRange(now)];
+            }
+            if (!defaultDate || Array.isArray(defaultDate)) {
+              defaultDate = now;
+            }
+            return this.limitDateRange(defaultDate);
+          },
+        emit: function (date) {
+            var getTime = function (date) {
+              return date instanceof Date ? date.getTime() : date;
+            };
+            this.setData({
+              currentDate: Array.isArray(date) ? date.map(getTime) : getTime(date),
+            });
+            this.$emit('select', utils_1.copyDates(date));
+          },
+    }
+})

+ 4 - 0
nova-tourism/components/calendar/index.json

@@ -0,0 +1,4 @@
+{
+    "component": true,
+    "usingComponents": {}
+}

+ 72 - 0
nova-tourism/components/calendar/index.wxml

@@ -0,0 +1,72 @@
+
+<block wx:if="{{show}}">
+    <view class="nova-calendar">
+        <header
+          title="{{ title }}"
+          showTitle="{{ showTitle }}"
+          subtitle="{{ subtitle }}"
+          showSubtitle="{{ showSubtitle }}"
+          firstDayOfWeek="{{ firstDayOfWeek }}"
+          bind:click-subtitle="onClickSubtitle"
+        >
+          <slot name="title" slot="title"></slot>
+        </header>
+        
+        <scroll-view
+          class="van-calendar__body"
+          scroll-y
+          scroll-into-view="{{ scrollIntoView }}"
+        >
+          <month
+            wx:for="{{ computed.getMonths(minDate, maxDate) }}"
+            wx:key="index"
+            id="month{{ index }}"
+            class="month"
+            data-date="{{ item }}"
+            date="{{ item }}"
+            type="{{ type }}"
+            color="{{ color }}"
+            minDate="{{ minDate }}"
+            maxDate="{{ maxDate }}"
+            showMark="{{ showMark }}"
+            formatter="{{ formatter }}"
+            rowHeight="{{ rowHeight }}"
+            currentDate="{{ currentDate }}"
+            showSubtitle="{{ showSubtitle }}"
+            allowSameDay="{{ allowSameDay }}"
+            showMonthTitle="{{ index !== 0 || !showSubtitle }}"
+            firstDayOfWeek="{{ firstDayOfWeek }}"
+            bind:click="onClickDay"
+          />
+        </scroll-view>
+      
+        <view
+          class="{{ utils.bem('calendar__footer', { safeAreaInsetBottom }) }}"
+        >
+          <slot name="footer"></slot>
+        </view>
+      
+        <view
+          class="{{ utils.bem('calendar__footer', { safeAreaInsetBottom }) }}"
+        >
+          <van-button
+            wx:if="{{ showConfirm }}"
+            round
+            block
+            type="danger"
+            color="{{ color }}"
+            custom-class="van-calendar__confirm"
+            disabled="{{ computed.getButtonDisabled(type, currentDate) }}"
+            nativeType="text"
+            bind:click="onConfirm"
+          >
+            {{
+              computed.getButtonDisabled(type, currentDate)
+                ? confirmDisabledText
+                : confirmText
+            }}
+          </van-button>
+        </view>
+    </view>
+      
+</block>

+ 1 - 0
nova-tourism/components/calendar/index.wxss

@@ -0,0 +1 @@
+.van-calendar{display:flex;flex-direction:column;height:100%;height:var(--calendar-height,100%);background-color:#fff;background-color:var(--calendar-background-color,#fff)}.van-calendar__close-icon{top:11px}.van-calendar__popup--bottom,.van-calendar__popup--top{height:80%;height:var(--calendar-popup-height,80%)}.van-calendar__popup--left,.van-calendar__popup--right{height:100%}.van-calendar__body{flex:1;overflow:auto;-webkit-overflow-scrolling:touch}.van-calendar__footer{flex-shrink:0;padding:0 16px;padding:0 var(--padding-md,16px)}.van-calendar__footer--safe-area-inset-bottom{padding-bottom:env(safe-area-inset-bottom)}.van-calendar__footer+.van-calendar__footer,.van-calendar__footer:empty{display:none}.van-calendar__footer:empty+.van-calendar__footer{display:block!important}.van-calendar__confirm{height:36px!important;height:var(--calendar-confirm-button-height,36px)!important;margin:7px 0!important;margin:var(--calendar-confirm-button-margin,7px 0)!important;line-height:34px!important;line-height:var(--calendar-confirm-button-line-height,34px)!important}

+ 39 - 0
nova-tourism/components/cell-list/index.js

@@ -0,0 +1,39 @@
+// nova-tourism/components/cell-list/index.js
+Component({
+    /**
+     * 组件的属性列表
+     */
+    properties: {
+      detail: {
+        type: Object,
+        default: {}
+      },
+      icon: {
+        type: String,
+        default: ''
+      },
+      iconColor: {
+        type: String,
+        default: ''
+      },
+      arrowText:{
+        type: String,
+        default: ''
+      }
+    },
+  
+    /**
+     * 组件的初始数据
+     */
+    data: {},
+  
+    /**
+     * 组件的方法列表
+     */
+    methods: {
+      arrowtap(){
+        this.triggerEvent('arrowtap')
+      }
+    }
+  })
+  

+ 6 - 0
nova-tourism/components/cell-list/index.json

@@ -0,0 +1,6 @@
+{
+    "component": true,
+    "usingComponents": {
+        "van-icon": "@vant/weapp/icon/index"
+    }
+}

+ 67 - 0
nova-tourism/components/cell-list/index.less

@@ -0,0 +1,67 @@
+@import '../../styles/base.less';
+
+.detail-cell {
+
+}
+.cell-title {
+  flex: 1;
+  margin-bottom: 10rpx;
+}
+.cell-icon {
+  margin-right: 10rpx;
+}
+.cell-end {
+  display: flex;
+  align-items: center;
+  min-width: 100rpx;
+  justify-content: flex-end;
+}
+
+.detail-name {
+  width: 100%;
+  margin: 10rpx 0;
+  font-size: 30rpx;
+  color:#222222; 
+  overflow: hidden; //一定要写
+  text-overflow: ellipsis; //超出省略号
+  display: -webkit-box; //一定要写
+  -webkit-line-clamp: 1; //控制行数
+  -webkit-box-orient: vertical; //一定要写
+}
+
+.detail-describe {
+  width: 100%;
+    margin: 10rpx 0;
+    min-height: 80rpx;
+    overflow: hidden; //一定要写
+    text-overflow: ellipsis; //超出省略号
+    display: -webkit-box; //一定要写
+    -webkit-line-clamp: 2; //控制行数
+    -webkit-box-orient: vertical; //一定要写
+
+}
+.detail-tags {
+  width: 100%;
+  margin:8rpx 0;
+  overflow: hidden; //一定要写
+    text-overflow: ellipsis; //超出省略号
+    display: -webkit-box; //一定要写
+    -webkit-line-clamp: 2; //控制行数
+    -webkit-box-orient: vertical; //一定要写
+}
+
+
+.detail-price-wrapper {
+  display: flex;
+  color: @red;
+  margin-top: 10rpx;
+  .detail-price-text {
+      margin: 0 10rpx 0 0;
+  }
+  .detail-price-num{
+    font-size: 28rpx;
+    font-weight: 600;
+  }
+}
+
+

+ 15 - 0
nova-tourism/components/cell-list/index.wxml

@@ -0,0 +1,15 @@
+<view class="detail-cell-group page-section-spacing">
+    <view class="detail-cell ">
+        <view class="cell-top flex justify-between">
+            <view class="cell-icon "><van-icon name="{{icon}}" color="{{iconColor}}"></van-icon></view>
+            <view class="cell-title text ellipsis-2">{{detail.name || detail.title}}</view>
+            <view class="cell-end" bind:tap="arrowtap" >
+                <text class=" text-small ">{{arrowText}}</text>
+                <van-icon name="arrow" ></van-icon>
+            </view>
+        </view>
+        <view class="cell-bottom">
+            <view class="desc text-small grey">{{detail.desc}}</view>
+        </view>
+    </view>
+</view>

+ 1 - 0
nova-tourism/components/cell-list/index.wxss

@@ -0,0 +1 @@
+.red{color:#F01740}.grey{color:#666666}.black{color:#000000}.title{font-weight:Medium;font-size:36rpx;color:#222222}.text-large{font-size:36rpx}.text{font-size:30rpx}.text-left{text-align:left}.text-center{text-align:center}.text-small{font-size:24rpx}.flex{display:flex}.justify-between{justify-content:space-between}.flex-aligin-center{display:flex;align-items:center}.flex-justify-between{display:flex;justify-content:space-between}.flex-1{flex:1}.flex-grow-1{flex-grow:1}.fixed-bottom{position:fixed;bottom:0;left:0;right:0}.w-100{width:100%}.h-100{height:100%}.page-section{margin:20rpx;border-radius:20rpx;background-color:#ffffff}.page-section-spacing{padding:20rpx}.spacing-small{padding:10rpx}.border-trans{border:1px solid transparent}.ellipsis{width:100%;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical}.ellipsis-2{width:100%;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}.cell-title{flex:1;margin-bottom:10rpx}.cell-icon{margin-right:10rpx}.cell-end{display:flex;align-items:center;min-width:100rpx;justify-content:flex-end}.detail-name{width:100%;margin:10rpx 0;font-size:30rpx;color:#222222;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical}.detail-describe{width:100%;margin:10rpx 0;min-height:80rpx;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}.detail-tags{width:100%;margin:8rpx 0;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}.detail-price-wrapper{display:flex;color:#F01740;margin-top:10rpx}.detail-price-wrapper .detail-price-text{margin:0 10rpx 0 0}.detail-price-wrapper .detail-price-num{font-size:28rpx;font-weight:600}

+ 10 - 2
nova-tourism/components/homestay/index.js

@@ -28,7 +28,9 @@ Component({
         //价格
         price: 211,
         //搜索
-        value: ''
+        value: '',
+        start:'',
+        end:''
     },
     lifetimes: {
         detached: function () {},
@@ -67,8 +69,10 @@ Component({
                 date_end: this.formatDate(tomorrow),
                 date_start1: this.formatDate(today),
                 date_end1: this.formatDate(tomorrow),
+                start:today,
+                end:tomorrow
             });
-            console.log(this.data.date_start, this.data.date_end);
+            console.log(this.data.start, this.data.end);
         },
         // 计算两个日期之间的天数
         calculateDaysBetween(startDate, endDate) {
@@ -101,6 +105,8 @@ Component({
             const daysBetween = this.calculateDaysBetween(start, end); // 计算天数差
             this.setData({
                 show: false,
+                start,
+                end,
                 date_start: `${this.formatDate(start)} `,
                 date_end: `${this.formatDate(end)}`,
                 daysBetween
@@ -130,6 +136,8 @@ Component({
                 date_end: this.data.date_end,
                 daysBetween: this.data.daysBetween,
                 istoday: this.data.istoday,
+                start:this.data.start,
+                end:this.data.end
             };
 
             // 将信息转为查询字符串

+ 46 - 0
nova-tourism/components/list-card/index.js

@@ -0,0 +1,46 @@
+// nova-tourism/components/list-card/index.js
+Component({
+    /**
+     * 组件的属性列表
+     */
+    properties: {
+        info:{
+            type: Object,
+            default: {}
+        },
+        islink:{
+            type:Boolean,
+            default: false
+        },
+        url: {
+            type:String,
+            default:''
+        },
+        linkdesc:{
+            type:String,
+            default:''
+        },
+        activeColor:{
+          type: String,
+          value: ''
+        },
+    },
+
+    /**
+     * 组件的初始数据
+     */
+    data: {
+
+    },
+
+    /**
+     * 组件的方法列表
+     */
+    methods: {
+        navigate(){
+            wx.navigateTo({
+              url: this.data.url,
+            })
+        }
+    }
+})

+ 4 - 0
nova-tourism/components/list-card/index.json

@@ -0,0 +1,4 @@
+{
+    "component": true,
+    "usingComponents": {}
+}

+ 57 - 0
nova-tourism/components/list-card/index.less

@@ -0,0 +1,57 @@
+@red:#F01740;
+@grey: #666666;
+@orange: #FF8936;
+
+.title {
+  font-weight: Medium;
+  font-size: 36rpx; 
+  color: #222222;
+}
+.text-large {
+  font-size: 36rpx; 
+}
+.text {
+  font-size: 30rpx;
+  word-break: keep-all;
+}
+.text-small {
+  font-size: 24rpx;
+  word-break: keep-all;
+}
+.grey {
+  color:#666666;
+}  
+.orange {
+  color:#FF8936;
+}
+
+
+.card {
+  display: flex;
+  // align-items: center;
+  justify-content: space-between;
+  .card-start{
+    width: 100rpx;
+    .start-image-wrapper {
+      width: 80rpx;
+      height: 80rpx;
+    }
+    
+    .start-image {
+      width: 100%;
+      height: 100%;
+      margin: 0 auto;
+      border-radius: 50%;
+    
+    }
+  }
+  .card-end {
+    display: flex;
+    align-items: center;
+    width: 120rpx;
+    text-align: right;
+  }
+  .card-content {
+    flex:1;
+  }
+}

+ 16 - 0
nova-tourism/components/list-card/index.wxml

@@ -0,0 +1,16 @@
+<view class="card">
+    <view class="card-start">
+        <view class="start-image-wrapper">
+            <image class="start-image" src="{{info.cover}}" />
+        </view>
+    </view>
+    <view class="card-content">
+        <view class="card-title text">{{info.storeName}}</view>
+        <view class="card-rate text-small orange" style="color: {{activeColor}};">{{info.score}}分</view>
+        <view class="card-count text-small grey">共{{info.count}}套房源</view>
+    </view>
+    <view class="card-end" bind:tap="navigate" wx:if="islink">
+        <text class=" text-small orange">{{linkdesc}}</text>
+        <van-icon name="arrow" class="orange"></van-icon>
+    </view>
+</view>

+ 1 - 0
nova-tourism/components/list-card/index.wxss

@@ -0,0 +1 @@
+.title{font-weight:Medium;font-size:36rpx;color:#222222}.text-large{font-size:36rpx}.text{font-size:30rpx;word-break:keep-all}.text-small{font-size:24rpx;word-break:keep-all}.grey{color:#666666}.orange{color:#FF8936}.card{display:flex;justify-content:space-between}.card .card-start{width:100rpx}.card .card-start .start-image-wrapper{width:80rpx;height:80rpx}.card .card-start .start-image{width:100%;height:100%;margin:0 auto;border-radius:50%}.card .card-end{display:flex;align-items:center;width:120rpx;text-align:right}.card .card-content{flex:1}

+ 50 - 0
nova-tourism/components/list-item/index.js

@@ -0,0 +1,50 @@
+Component({
+    options:{
+        multipleSlots: true // 在组件定义时的选项中启用多slot支持
+    },
+    /**
+     * 组件的属性列表
+     */
+    properties: {
+        label:{
+            type:String,
+            default: null
+        },
+        content: {
+            type:String,
+            default:null
+        },
+        arrow:{
+            type:String,
+            default:null
+        },   
+        arrowText:{
+            type: String,
+            default: ''
+        },
+        labelClass:{
+            type: String,
+            default: ''
+        },
+        arrowTextClass:{
+            type: String,
+            default: ''
+        }
+    },
+
+    /**
+     * 组件的初始数据
+     */
+    data: {
+
+    },
+
+    /**
+     * 组件的方法列表
+     */
+    methods: {
+        arrowtap(){
+            this.triggerEvent("arrowtap")
+        }
+    }
+})

+ 6 - 0
nova-tourism/components/list-item/index.json

@@ -0,0 +1,6 @@
+{
+    "component": true,
+    "usingComponents": {
+        "van-icon": "@vant/weapp/icon/index"
+    }
+}

+ 14 - 0
nova-tourism/components/list-item/index.less

@@ -0,0 +1,14 @@
+@import '../../styles/base.less'; 
+
+.item-label {
+    min-width: 120rpx;
+    text-align-last: justify;
+}
+.item-content {
+    flex:1;
+    padding: 0 20rpx;
+}
+.item-end {
+    min-width: 100rpx;
+    text-align: right;
+}

+ 27 - 0
nova-tourism/components/list-item/index.wxml

@@ -0,0 +1,27 @@
+<view class="list-item spacing-small flex flex-aligin-center justify-between">
+    <view class="item-label text grey {{labelClass}}">
+        <block wx:if="{{label}}">
+            {{label}}
+        </block>
+        <block wx:else>
+            <slot name="start"></slot>
+        </block>
+    </view>
+    <view class="item-content text" >
+        <block wx:if="{{content}}">
+            {{content}}
+        </block>
+        <block wx:else>
+            <slot name="content"></slot>
+        </block>
+    </view>
+    <view class="item-end {{arrowTextClass}}" >
+        <view bind:tap="arrowtap" wx:if="{{arrow}}">
+            <text class="text-small ">{{arrowText}}</text>
+            <van-icon name="{{arrow}}"></van-icon>
+        </view>
+        <block wx:else>
+            <slot name="end"></slot>
+        </block>
+    </view>
+</view>

+ 1 - 0
nova-tourism/components/list-item/index.wxss

@@ -0,0 +1 @@
+.red{color:#F01740}.grey{color:#666666}.black{color:#000000}.title{font-weight:Medium;font-size:36rpx;color:#222222}.text-large{font-size:36rpx}.text{font-size:30rpx}.text-left{text-align:left}.text-center{text-align:center}.text-small{font-size:24rpx}.flex{display:flex}.justify-between{justify-content:space-between}.flex-aligin-center{display:flex;align-items:center}.flex-justify-between{display:flex;justify-content:space-between}.flex-1{flex:1}.flex-grow-1{flex-grow:1}.fixed-bottom{position:fixed;bottom:0;left:0;right:0}.w-100{width:100%}.h-100{height:100%}.page-section{margin:20rpx;border-radius:20rpx;background-color:#ffffff}.page-section-spacing{padding:20rpx}.spacing-small{padding:10rpx}.border-trans{border:1px solid transparent}.ellipsis{width:100%;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical}.ellipsis-2{width:100%;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}.item-label{min-width:120rpx;text-align-last:justify}.item-content{flex:1;padding:0 20rpx}.item-end{min-width:100rpx;text-align:right}

+ 55 - 0
nova-tourism/components/modal/index.js

@@ -0,0 +1,55 @@
+// nova-tourism/components/modal/index.js
+Component({
+    options:{
+        multipleSlots: true // 在组件定义时的选项中启用多slot支持
+    },
+    /**
+     * 组件的属性列表
+     */
+    properties: {
+        show:{
+            type: Boolean,
+            default: false
+        },
+        closeable:{
+            type: Boolean,
+            default: false
+        },
+        title:{
+            type: String,
+            default: '标题'
+        },
+        width:{
+            type: String,
+            default: '70%'
+        },
+        height:{
+            type: String,
+            default: '70vh'
+        },
+        // content:{
+        //     type: String,
+        //     default: ''
+        // }
+    },
+
+    /**
+     * 组件的初始数据
+     */
+    data: {
+
+    },
+
+    /**
+     * 组件的方法列表
+     */
+    methods: {
+        close(){
+            this.triggerEvent('close')
+        },
+        enter(){
+            this.triggerEvent('enter')
+
+        }
+    }
+})

+ 6 - 0
nova-tourism/components/modal/index.json

@@ -0,0 +1,6 @@
+{
+    "component": true,
+    "usingComponents": {
+        "van-icon": "@vant/weapp/icon/index"
+    }
+}

+ 58 - 0
nova-tourism/components/modal/index.less

@@ -0,0 +1,58 @@
+/* nova-tourism/components/modal/index.wxss */.modal-overlay {
+    position: fixed;
+    top: 0;
+    left: 0;
+    width: 100vw;
+    height: 100vh;
+    background-color: rgba(76, 76, 76,.2);
+    z-index: 99;
+}
+.modal-wrapper {
+    position: fixed;
+    top: 50%;
+    left: 50%;
+    transform: translate(-50%,-50%);
+    display: flex;
+    flex-direction: column;
+    justify-content: space-between;
+    align-items: center;
+    // width: 70%;
+    // height: 70vh;
+    border-radius: 20rpx;
+    background-color: #fff;
+    z-index: 999;
+    .modal-header {
+        padding: 20rpx;
+        // display: flex;
+        // align-items: center;
+        // justify-content: space-between;
+        .modal-title {
+            padding: 20rpx 0;
+            text-align: center;
+        }
+        .modal-close {
+            position: fixed;
+            top: 20rpx;
+            right: 20rpx;
+            padding:20rpx;
+            
+        }
+      
+    }
+    .modal-content {
+        flex:1;
+        width: 100%;
+        padding: 20rpx;
+        overflow: auto;
+    }
+    .modal-footer {
+        width: 100%;
+        .footer-btn {
+            width: 100%;
+            padding: 20rpx;
+            text-align: center;
+            letter-spacing: 6rpx;
+            background-color: #46a9a4;
+        }
+    }
+}

+ 18 - 0
nova-tourism/components/modal/index.wxml

@@ -0,0 +1,18 @@
+
+
+<view class="modal-overlay" wx:if="{{show}}">
+    
+</view>
+<view class="modal-wrapper" wx:if="{{show}}" style="width:{{ width|| '70%'}};height:{{height || '70vh'}}">
+    <view class="modal-header">
+        <view class="modal-title">{{title}}</view>
+        <view class="modal-close" wx:if="{{closeable}}" bind:tap="close"><van-icon name="cross" size="20px"/></view>
+    </view>
+    <view class="modal-content">
+        <slot name="content"></slot>
+    </view>
+    <view class="modal-footer">
+        <!-- <view  class="modal-cancel modal-btn btn "></view> -->
+        <view class="modal-enter footer-btn btn " bind:tap="enter">确认</view>
+    </view>
+</view>

+ 1 - 0
nova-tourism/components/modal/index.wxss

@@ -0,0 +1 @@
+.modal-overlay{position:fixed;top:0;left:0;width:100vw;height:100vh;background-color:rgba(76,76,76,0.2);z-index:99}.modal-wrapper{position:fixed;top:50%;left:50%;transform:translate(-50%, -50%);display:flex;flex-direction:column;justify-content:space-between;align-items:center;border-radius:20rpx;background-color:#fff;z-index:999}.modal-wrapper .modal-header{padding:20rpx}.modal-wrapper .modal-header .modal-title{padding:20rpx 0;text-align:center}.modal-wrapper .modal-header .modal-close{position:fixed;top:20rpx;right:20rpx;padding:20rpx}.modal-wrapper .modal-content{flex:1;width:100%;padding:20rpx;overflow:auto}.modal-wrapper .modal-footer{width:100%}.modal-wrapper .modal-footer .footer-btn{width:100%;padding:20rpx;text-align:center;letter-spacing:6rpx;background-color:#46a9a4}

+ 68 - 3
nova-tourism/pages/homestay/homestay-detail/index.js

@@ -29,6 +29,10 @@ Page({
         longitude: 0,
         latitude: 0,
         markers: [],
+
+        //
+        start:'',
+        end:'',
     },
 
     /**
@@ -68,17 +72,24 @@ Page({
             date_start,
             date_end,
             daysBetween,
-            istoday
+            istoday,
+            start,
+            end,
         } = options;
+        console.log(options);
         // 解码接收到的参数
         const decodedDateStart = decodeURIComponent(date_start);
         const decodedDateEnd = decodeURIComponent(date_end);
+        const Start = decodeURIComponent(start);
+        const End = decodeURIComponent(end);
         this.setData({
             decodedDateStart,
             decodedDateEnd,
             objectId,
             daysBetween,
-            istoday
+            istoday,
+            start:Start,
+            end:End,
         })
         console.log('istoday', this.data.istoday);
         this.gethomestay()
@@ -90,7 +101,7 @@ Page({
     /**
      * 生命周期函数--监听页面初次渲染完成
      */
-    onReady: function() {
+    onReady: function () {
 
     },
 
@@ -285,4 +296,58 @@ Page({
             complete: function () {}
         });
     },
+    //点击预定
+    navigate(e) {
+        const objectId = e.currentTarget.dataset.id;
+        let currentUser = Parse.User.current()
+        currentUser = currentUser.toJSON()
+        console.log(currentUser, currentUser.idcard);
+
+        if (currentUser.idcard) {
+            // 构造要传递的信息
+            const info = {
+                objectId: objectId,
+                date_start: this.data.start,
+                date_end: this.data.end,
+            };
+            // console.log('info',info);
+
+            // 将信息转为查询字符串
+            var queryString = Object.keys(info)
+                .map(key => `${encodeURIComponent(key)}=${encodeURIComponent(info[key])}`)
+                .join('&');
+            console.log(queryString);
+            wx.navigateTo({
+                url: `../homestay-order/index?${queryString}`
+            })
+        } else {
+            wx.showToast({
+                title: '请先进行实名认证',
+                icon: 'none'
+            })
+            //实名
+            // wx.navigateTo({
+            //     url: `/common-page/pages/info/cauth/cauth?themeColor=#FFE300`
+            // })
+
+            // 构造要传递的信息
+            const info = {
+                objectId: objectId,
+                date_start: this.data.start,
+                date_end: this.data.end,
+            };
+            console.log('info',info);
+
+            // 将信息转为查询字符串
+            var queryString = Object.keys(info)
+                .map(key => `${encodeURIComponent(key)}=${encodeURIComponent(info[key])}`)
+                .join('&');
+            console.log(queryString);
+            wx.navigateTo({
+                url: `../homestay-order/index?${queryString}`
+            })
+        }
+
+    },
+
 })

+ 1 - 1
nova-tourism/pages/homestay/homestay-detail/index.wxml

@@ -75,7 +75,7 @@
                     </view>
                     <view class="room-card2">
                         <view class="price">¥{{item.price*daysBetween}}</view>
-                        <view class="submit">订</view>
+                        <view class="submit" data-id="{{item.objectId}}" bindtap="navigate">订</view>
                     </view>
                 </view>
                 <!-- 无房 -->

+ 831 - 0
nova-tourism/pages/homestay/homestay-order/index.js

@@ -0,0 +1,831 @@
+let Parse = getApp().Parse
+const company = getApp().globalData.company
+import dataSource from '../../../service/data';
+import dateServ from '../../../service/date';
+const rechText = require('../../../../utils/rech-text')
+Page({
+
+    /**
+     * 页面的初始数据
+     */
+    data: {
+        roomId: null,
+        room: {},
+        note: {
+            "title": '订房必读',
+            "desc": '为响应《关于南昌市旅游住宿业不主动提供一次性周品的侣仪书》,消费者减少一次性塑料制品使用,南昌市旅游住宿单位不再主动向消费者提供牙刷、牙膏、香皂、浴液、拖鞋、梳子等一次性易耗品和一次性碗、杯、盘、餐具等餐饮用具,如有需要请提前向酒店咨询。',
+            "arrowtext": '查看全部',
+            'detail': `城市通知\t为响应《关于南昌市旅游住宿业不主动提供一次性周品的侣仪书》,消费者减少一次性塑料制品使用,南昌市旅游住宿单位不再主动向消费者提供牙刷、牙膏、香皂、浴液、拖鞋、梳子等一次性易耗品和一次性碗、杯、盘、餐具等餐饮用具,如有需要请提前向酒店咨询。\n\n
+            
+        外宾政策\t商家仅接待大陆客人。
+        预提示:您填写的预订信息和联系方式是商家或供应商提供相关服务所需的必要信息,美团会基于履约必要的范围向商家或供应商提供。
+        如您预订的产品涉及实名制要求(如包含有实名制需求的景区门票产品),需要您填写出行人真实有效的证件信息,用于出游时的身份验证。美团会基于履约必要的范围向供应商提供。
+        订单等商家或供应商确认后才生效,订单确认结果以美团短信或邮件通知为准;请在订单生效后再至商家前台办理入住。
+        业务实际运营和相应责任由门店签约主体公司负责。
+        入住时间:14:00以后;离店时间:12:00以前,如需提前入住或延迟退房请联系商家。
+        宠物携带:允许携带宠物。`
+        },
+        date: '', // 入住时间
+        defaultDate: [], // 日历默认时间
+        startTime: null, // 入住开始时间
+        endTime: null, // 入住结束时间
+        count: 1, // 入住几晚
+        columns: [], // 入住人数可选数组
+        peopleNum: 1, // 入住人数
+        showNote: false,
+        showDate: false,
+        showNumPicker: false,
+        showPayment: false,
+        customers: [], // 住客信息
+        priceInfoArr: [], // 房费详细信息
+        formatter: null, // 日历格式化
+        // checkedFormatter: null,// 日历相关数据处理
+        CountArray: [], // 房型可选日期及已订数量数组 [{date: '',count: 0}]
+        CountObj: [], // 房型可选日期及已订数量对象 {date: count}
+    },
+
+    /**
+     * 生命周期函数--监听页面加载
+     */
+    onLoad: function (options) {
+        const {
+            objectId,
+            date_start,
+            date_end,
+        } = options;
+        const date_start1 = decodeURIComponent(date_start);
+        const date_end1 = decodeURIComponent(date_end);
+        console.log('123',date_start1,date_end1 );
+        this.initData(objectId)
+    },
+    /**
+     * 生命周期函数--监听页面显示
+     */
+    onShow: function () {
+        this.setData({
+            customers: this.data.customers
+        })
+        console.log(this.data.customers);
+    },
+    initData(roomId) {
+        dataSource.getRoomById(roomId).then(room => {
+            room.desc = room.tags.join(" ") // 标签
+            this.data.note.detail = rechText.formatRichText((room.note || '')); // 订房必读
+            let merber = room.merber; // 房间容纳人数
+            let columns = [...new Array(merber + 1).keys()] // 入住人数可选数组
+            columns.shift(0)
+            console.log(columns);
+            // 日期相关数据初始化
+            // let defaultDate = this.initDate()
+            // 订单开始时间结束时间  默认下午两点 方便无房时间对比
+            // let today = new Date();
+            // let tommrrow = dateServ.getStrByTimeIncreaseDay(today,1)
+            // let {startTime,endTime}=this.formatTimeArea(today,tommrrow)
+            // console.log(startTime,endTime);
+            // let priceInfoArr = dateServ.getDayAll(startTime,endTime)// 订单时间跨度数组
+            // priceInfoArr.pop();// 最后一天为退房 不计入
+            // console.log(priceInfoArr);
+            // let count= priceInfoArr.length;
+            this.setData({
+                roomId,
+                room,
+                columns,
+                // date:defaultDate,
+                peopleNum: merber,
+                // priceInfoArr,
+                // count,
+                // startTime,
+                // endTime,
+            })
+
+
+        })
+    },
+    dayAddOne(time) {
+        time = new Date(time)
+        let year = time.getFullYear()
+        let month = time.getMonth() + 1
+        let day = time.getDate()
+        return new Date(`${year}-${month}-${day + 1} 14:00:00`);
+    },
+    formatTimeArea(start, end) {
+        start = new Date(start)
+        end = new Date(end)
+        console.log(start, end);
+        let year = start.getFullYear()
+        let month = start.getMonth() + 1
+        let day = start.getDate()
+        let year2 = end.getFullYear()
+        let month2 = end.getMonth() + 1
+        let day2 = end.getDate()
+        console.log(year, month, day);
+        let obj = {
+            startTime: new Date(`${year}/${month}/${day} 14:00:00`),
+            endTime: new Date(`${year2}/${month2}/${day2} 14:00:00`)
+        }
+        console.log(obj);
+        return obj
+    },
+    // navigate(event){
+    //     console.log(event);
+    //     let type = event.currentTarget.dataset.type;
+    //     switch (type) {
+    //         case 'room':
+    //             wx.navigateTo({
+    //                 url: `/nova-tourism/pages/homestay/room-detail/index?id=${this.data.roomId}`
+    //             })  
+    //             break;
+    //             case 'customer':
+    //                 wx.navigateTo({
+    //                     url: `/nova-tourism/pages/homestay/customer/select-customer/index`
+    //                 })  
+    //                 break;
+    //         default:
+    //             break;
+    //     }
+
+    // },
+    // 显示订房必读
+    showNotePop() {
+        this.setData({
+            showNote: true
+        })
+    },
+    closeModal() {
+        this.setData({
+            showNote: false
+        });
+    },
+
+    // 日期
+    initDate() {
+        let month = new Date().getMonth() + 1;
+        let start = new Date().getDate();
+        let end = new Date().getDate() + 1;
+        return `${month}月${start} 日 - ${month}月${end} 日`;
+    },
+    checkDate() {
+        this.initCalenderData()
+        this.setData({
+            showDate: true
+        })
+    },
+    closeDate() {
+        this.setData({
+            showDate: false
+        })
+    },
+    enterDate(event) {
+        const [start, end] = event.detail;
+        console.log(11111, event.detail)
+        let {
+            startTime,
+            endTime
+        } = this.formatTimeArea(start, end)
+        console.log('开始时间', startTime, '结束时间', endTime);
+        var dataAll = dateServ.getDayAll(startTime, endTime);
+        dataAll.pop(); // 最后一天为退房,不算在内
+        console.log(dataAll);
+        console.log(this.formatDate(startTime), this.formatDate(endTime))
+        let dateStr = this.formatDate(startTime) + '-' + this.formatDate(endTime)
+        console.log(dateStr)
+        this.setData({
+            showDate: false,
+            date: `${this.formatDate(startTime)} - ${this.formatDate(endTime)}`,
+            startTime: new Date(startTime),
+            endTime: new Date(endTime),
+            priceInfoArr: dataAll,
+            count: dataAll.length
+        })
+
+        console.log(this.data.priceInfoArr);
+    },
+    formatDate(date) {
+        date = new Date(date);
+        return `${date.getMonth() + 1}/${date.getDate()}`;
+    },
+
+    /*****
+     * 已知:用户选择房型、时间段,房型的可用数量
+     * 查询:范围内是否有空房
+     * 
+     * 入住时间:当天占用房间
+     * 离店时间:当天房间可用
+     
+     let CountArray = [
+         {日期:20220419,数量:1},
+         {date:20220419,count:1},
+     ]
+
+     function addOrdertoArray(currentDate){
+        let currentIdx = CountArray.findIndex(item=>item.date == currentDate)
+
+        if(currentIdx&&currentIdx>=0){
+            CountArray[currentIdx].count += 1
+        }else{
+            CountArray.push({date:currentDate,count:1})
+        }
+     }
+     function getDateByTime() // 同时获取14点校准时间
+
+
+     RoomOrderList.forEach(order=>{
+         let startDate = getDateByTime(order.get("startTime"));
+         let endDate = getDateByTime(order.get("endTime"));
+         let breakDate = 
+
+         for(currentDate; currentDate + 1day; currentDate=breakDate){
+            addOrdertoArray(currentDate);
+         }
+     })
+     */
+
+
+
+
+    /*** 日期组件初始化
+     * 1、获取日历可选时间区间内 所有已生成订单  生成日期对应订单数量对象 {date:count}
+     * 1、设置默认日期  (组件默认时间为当前时间及后一天 需修改为非无房状态日期)
+     * 2、无房状态显示禁点
+     * 3、已选择开始日期时,日期往后推 无房日期之后均为禁点
+     */
+    async initCalenderData() {
+        // 获取日历可选时间区间内 所有已生成订单
+        console.log(111)
+        let orders = await this.getRoomOrdersByRoomId(this.data.roomId)
+        orders.forEach(order => {
+            let startDate = dateServ.getDateStrByTime(order.get("startTime"));
+            let endDate = dateServ.getDateStrByTime(order.get("endTime"));
+            let breakDate = dateServ.getStrByTimeIncreaseDay(order.get("endTime"), -1);
+            console.log(startDate, endDate, breakDate);
+            // 遍历单个订单下已订时间 将订单覆盖时间推入CountObject
+            let dateArr = dateServ.getDayAll(startDate, breakDate)
+            console.log(dateArr)
+            for (let index = 0; index < dateArr.length; index++) {
+                let datastr = dateArr[index];
+                this.addOrdertoArray(datastr)
+            }
+        })
+        console.log(this.data.CountArray, this.data.CountObj);
+        this.setData({
+            orders,
+            defaultDate: [], // 默认日期
+            CountArray: this.data.CountArray,
+            CountObj: this.data.CountObj
+        })
+        this.checkedFormatter('init')
+
+    },
+    selectDay(date, type) {
+        let day = {
+            date,
+            text: '20',
+            type: '',
+            bottomInfo: undefined
+        }
+        console.log('ddddddd', type);
+        this.formatter(day, type)
+    },
+    getOrderDate(date) {
+        console.log(this.data.CountObj[date], this.data.room.total);
+        if (!this.data.CountObj[date]) {
+            return date
+        }
+        if (this.data.CountObj[date] && this.data.CountObj[date] < this.data.room.total) {
+            return date
+        }
+        if (this.data.CountObj[date] && this.data.CountObj[date] >= this.data.room.total) {
+            return false
+        }
+
+    },
+    addOrdertoArray(currentDate) {
+        // currentDate = new Date(currentDate)
+        let currentIdx = this.data.CountArray.findIndex(item => item.date == currentDate)
+        if (currentIdx && currentIdx >= 0) {
+            this.data.CountArray[currentIdx].count += 1
+        } else {
+            this.data.CountArray.push({
+                date: currentDate,
+                count: 1
+            }) // 日期,已订数量
+        }
+
+        this.data.CountObj[currentDate] ? this.data.CountObj[currentDate] += 1 : this.data.CountObj[currentDate] = 1;
+        console.log(this.data.CountObj)
+    },
+    // 组件日期订单数量达到总数时,type设置为disabled 
+    // 组件默认start为当前日期,end为当前日期后一天  当前日期无房情况下需将最近的非disabled日期设为start
+    // 当start 后一天为 无房日期时,该日期type改为''   ,无房日期 不可为start
+    type: null,
+    start: null,
+    end: null,
+    disabled: null,
+    // start后的第一个无房日期
+    checkedFormatter(type) {
+        if (this.end) {
+            this.disabled = null;
+        }
+        let that = this;
+        this.status = null;
+        let formatter = function (day, type) { //
+            const month = day.date.getMonth() + 1;
+            const date = day.date.getDate();
+            if (month < 7) {
+                if (date == 4 || date == 5 || date == 20 || date == 21 || date == 30) {
+                    // console.log(day,day.date,day.type);
+                }
+                let CountObj = that.data.CountObj
+                let datestr = dateServ.getDateStrByTime(day.date);
+                let endstr = null;
+                let disabledstr = null;
+                let startstr = null;
+                if (that.end) {
+                    endstr = dateServ.getDateStrByTime(that.end);
+                }
+                if (that.disabled) {
+                    disabledstr = dateServ.getDateStrByTime(that.disabled);
+                }
+                if (that.start) {
+                    startstr = dateServ.getDateStrByTime(that.start);
+                }
+
+                // 1、该日期订单数量达到房间总量且非结束日期  显示无房 禁点
+                if (CountObj[datestr] && CountObj[datestr] >= that.data.room.total && endstr != datestr) {
+                    day.bottomInfo = '无房';
+                    day.type = 'disabled';
+                    // that.disabled = day.date;
+                    // 4.1无房后日期禁点1 无离店日期时 入住日期后最近无房日期保存为disabled  
+                    // console.log(startstr, datestr,that.disabled);
+                    if (startstr < datestr && !that.end && (!that.disabled || disabledstr > datestr)) {
+                        // console.log(startstr, datestr,that.disabled);
+                        that.disabled = day.date
+                    }
+                }
+                // 已有end时,记录end 
+                if (day.type == 'end') {
+                    that.end = day.date;
+                    that.disabled = null;
+                }
+                // 4.2无房后日期禁点2  已选入住日期 无离店日期 时,离入住日期最近无房日期后所有日期type 设为 disabled  
+                // console.log(day.config,that.start,that.end,datestr,disabledstr,startstr);
+                if (that.start && !that.end && (datestr > disabledstr) && (startstr < datestr)) {
+                    // console.log(datestr,disabledstr);
+                    day.type = 'disabled'
+                }
+                // 2、设置默认入住日期:无start时,最近一天非disabled日期设为start  设为默认日期
+                if (day.type != 'disabled' && !that.start) { //&& !that.data.defaultDate[0]
+                    day.type = 'start'
+                    that.start = day.date;
+                    // that.data.defaultDate[0] = day.date.getTime()
+                    // console.log(that.data.defaultDate);
+                    // that.setData({
+                    //     defaultDate:that.data.defaultDate
+                    // })
+                }
+                // 已有start时,记录start 原无房日期type为start时,不存
+                if (day.type == 'start') {
+                    console.log(day, 'start');
+                    that.type = 'start';
+                    that.start = day.date;
+                    if (CountObj[datestr] && CountObj[datestr] >= that.data.room.total) {
+                        day.type = 'disabled';
+                        that.start = null;
+
+                    }
+                }
+                // 3.1、有start无end时,后一天如果为disabled,type设为'' 
+                if (that.start && day.type == 'disabled' && month < 6) {
+                    let leavSelect = dateServ.getStrByTimeIncreaseDay(that.start, 1)
+                    // 日历day 时间为00:00:00,需把时间转换为 00:00:00 进行对比
+                    let isSame = dateServ.isSameDay(day.date, leavSelect)
+                    // console.log(startstr,CountObj[startstr] , that.data.room.total , !CountObj[startstr] || CountObj[startstr] <that.data.room.total);
+                    if (isSame && datestr != endstr && (!CountObj[startstr] || CountObj[startstr] < that.data.room.total)) {
+                        // console.log(datestr,endstr);
+                        // console.log('ddddddddddddddddddddd');
+                        // console.log(day,day.date,day.type);
+                        day.type = ''
+                    }
+                }
+                // 3.2、如果离店日期为无房日期,点击该日期 不修改入住和离店日期
+                if (datestr == endstr) {
+                    console.log(datestr, endstr);
+                    if (CountObj[datestr] && CountObj[datestr] >= that.data.room.total) {
+                        day.type == 'end'
+                    }
+                }
+
+
+                if (day.type === 'start') {
+                    day.bottomInfo = '入住';
+                } else if (day.type === 'end') {
+                    day.bottomInfo = '离店';
+                }
+            }
+            return day;
+        }
+        // return formatter()
+        // if(!this.defaultDate){
+        //     this.setData({
+        //         defaultDate:[this.start,this.end]
+        //     })
+        // }
+        this.setData({
+            checkedFormatter: formatter
+        })
+    },
+    unselectDate(event) {
+        console.log(event);
+
+    },
+    selectDate(event) {
+        console.log(event);
+        let dates = event.detail;
+        this.start = dates[0]
+        this.end = dates[1]
+        if (this.end) {
+            this.disabled = null;
+            console.log(this.disabled);
+        }
+        this.checkedFormatter()
+    },
+    formatter(day, type) {
+        const month = day.date.getMonth() + 1;
+        if (month < 6) {
+            console.log(day, type);
+        }
+        let CountObj = this.data.CountObj
+        let datestr = dateServ.getDateStrByTime(day.date);
+        // 该日期已有订单 且数量达到房间总量 显示无房 禁点
+        if (CountObj[datestr] && CountObj[datestr] >= this.data.room.total) {
+            day.bottomInfo = '无房';
+            day.type = 'disabled'
+        }
+        if (day.type === 'start') {
+            day.bottomInfo = '入住';
+        } else if (day.type === 'end') {
+            day.bottomInfo = '离店';
+        }
+        if (type) {
+            day.type = type;
+        }
+        return day;
+    },
+    select: {
+        start: null,
+        end: null
+    },
+    // defaultDate(){
+    //     // 已知: 有订单时间对象数组 this.CountObj this.CountArray   房间数量 this.room.total
+    //     // 求: 最近订单数量小于房间数量时间
+    //      let arr = this.getTimeArr()
+    //      console.log(arr);
+    //      return arr
+    //     // format(day,type){
+    //     //     if(type){
+    //     //         day.type == type
+    //     //     }
+    // },
+    getTimeArr() {
+        let arr = [...new Array(30).keys()] // 日期遍历以30天为周期遍历
+        let date = new Date();
+        for (let i = 0; i < arr.length; i++) {
+            let startstr = new Date(dateServ.getStrByTimeIncreaseDay(date, 0))
+            let start = this.getOrderDate(startstr)
+            date = new Date(dateServ.getStrByTimeIncreaseDay(date, 1))
+            if (start) { // 最近可订的时间  
+                console.log(start);
+                this.selectDay(start, 'start')
+                console.log(start);
+                let end = new Date(dateServ.getStrByTimeIncreaseDay(start, 1))
+                let endstr = dateServ.getStrByTimeIncreaseDay(start, 1)
+                let select = this.getOrderDate(endstr)
+                console.log(select);
+                if (!select) { // 处于禁用状态
+                    this.selectDay(end, 'end')
+                }
+                return [start, end]
+            }
+            if (i + 1 == arr.length) {
+                this.getTimeArr()
+            }
+        }
+    },
+
+    // formatter (day) {
+    //     const month = day.date.getMonth() + 1;
+    //     const date = day.date.getDate();
+    //     // console.log(month,date);
+    //     // if (month === 5) {
+    //     //   if (date === 1) {
+    //     //     day.topInfo = '劳动节';
+    //     //   } else if (date === 4) {
+    //     //     day.topInfo = '五四青年节';
+    //     //   } else if (date === 11) {
+    //     //     day.text = '今天';
+    //     //   }
+    //     // }
+    //     if(month === 4){
+    //         if(date === 18 || date === 19 || date === 20 || date === 21){
+    //             console.log(day);
+    //         }
+    //         if(day.type == 'start'){
+    //             console.log('start');
+    //             this.type = 'start';
+    //             // type = 'start';
+    //         }
+    //         if (day.type === 'start') {
+    //             day.bottomInfo = '入住';
+    //           } else if (day.type === 'end') {
+    //             day.bottomInfo = '离店';
+    //           }
+    //           let CountObj = this.data.CountObj
+    //           let datestr = dateServ.getDateStrByTime(day.date);
+    //           if(CountObj[datestr] && CountObj[datestr]>= this.data.room.total){// 该日期已有订单 且数量达到房间总量 显示无房 禁点
+    //               day.bottomInfo = '无房';
+    //               day.type = 'disabled'
+
+    //           }
+    //           if(date === 18 || date === 19 || date === 20 || date === 21){
+    //             console.log(day);
+    //         }
+
+    //     }
+    //     return day;
+    // },
+    // 入住人数选择
+    checkNum() {
+        this.setData({
+            showNumPicker: true
+        })
+    },
+    numPickerChange(event) {
+        // console.log(event,event.detail);
+        // this.setData({
+        //     peopleNum:event.detail
+        // })
+    },
+    numPickerEnter(event) {
+        const {
+            picker,
+            value,
+            index
+        } = event.detail;
+        console.log(picker, value, index);
+        console.log(`当前值:${value}, 当前索引:${index}`);
+        this.setData({
+            peopleNum: value,
+            showNumPicker: false
+        })
+    },
+
+    numPickerCancel() {
+        console.log('取消');
+        this.setData({
+            showNumPicker: false
+        })
+    },
+    async checkOrderCount() {
+        //   start1  end1   现在选择
+        //   start2  end2     已有订单时间
+        //   start1 < start2              end1 < end2
+        //   start1 > start2              end1 > end2
+        //   start1 = start2              end1 = end2
+        let now = dateServ.changeDateTime(new Date(), '14:00:00')
+        let Order = new Parse.Query("RoomOrder")
+        Order.equalTo("room", this.data.roomId)
+        Order.equalTo("company", company)
+        Order.exists("status")
+        Order.notEqualTo("status", 100)
+        Order.notEqualTo("status", 400)
+        Order.notEqualTo("status", 601)
+        Order.notEqualTo("status", 700)
+        Order.greaterThanOrEqualTo("startTime", this.data.endTime) //20  23    21 22  
+        Order.lessThanOrEqualTo("endTime", this.data.startTime)
+        Order.select("startTime", "endTime")
+        let count = await Order.count()
+        console.log(count);
+        return count
+    },
+    async submit() {
+        if (!this.data.startTime || !this.data.endTime) {
+            wx.showToast({
+                title: '请选择入住时间',
+                icon: 'none',
+            })
+            return
+        }
+        if (this.data.customers.length == 0) {
+            wx.showToast({
+                title: '请选择入住人',
+                icon: 'none',
+            })
+            return
+        }
+        let count = await this.checkOrderCount()
+        if (count >= this.data.room.total) {
+            console.log(count);
+            wx.showToast({
+                title: '当前日期,已无剩余房间,请重新选择',
+                icon: 'none',
+            })
+            return
+        }
+        let tradeNo = this.getTradeNo()
+        let order = await this.setOrder(tradeNo)
+        if (order) {
+            this.setData({
+                activeOrder: order,
+                tradeNo,
+                showPayment: true,
+            })
+        }
+    },
+    async acceptResult(e) {
+        let {
+            activeOrder
+        } = this.data
+        let that = this
+        let {
+            params,
+            no
+        } = e.detail;
+        that.setData({
+            showPayment: false
+        })
+        try {
+            if (params == "ok") {
+                activeOrder.set("status", 100)
+                activeOrder.set("isPay", true)
+                await activeOrder.save()
+                wx.showToast({
+                    title: '支付成功',
+                    icon: 'none',
+                    duration: 1500,
+                    mask: false,
+                });
+                wx.navigateBack({
+                    delta: 1,
+                })
+            } else {
+                wx.showToast({
+                    title: '支付失败,取消订单',
+                    icon: 'none',
+                    duration: 1500,
+                    mask: false,
+                });
+            }
+        } catch (error) {
+            console.log(error)
+            wx.showToast({
+                title: "支付失败",
+                icon: "error",
+                duration: 1500,
+            });
+            wx.hideLoading()
+        }
+    },
+    //生成订单号
+    getTradeNo() {
+        let now = new Date()
+        let tradeNo = "C" +
+            String(now.getFullYear()) +
+            (now.getMonth() + 1) +
+            now.getDate() +
+            now.getHours() +
+            now.getMinutes() +
+            now.getSeconds() +
+            Math.random().toString().slice(-6); //生成六位随机数
+        return tradeNo
+    },
+    //   创建待支付订单
+    async setOrder(tradeNo) {
+        let currentUser = Parse.User.current()
+        let Order = Parse.Object.extend("RoomOrder");
+        let order = new Order()
+        try {
+            order.set("details", this.data.room.details);
+            order.set("user", {
+                __type: 'Pointer',
+                className: '_User',
+                objectId: currentUser.id
+            });
+            order.set("orderNum", tradeNo);
+            order.set("room", {
+                __type: 'Pointer',
+                className: 'ShopRoom',
+                objectId: this.data.roomId
+            });
+            console.log(this.data.startTime, this.data.endTime);
+            order.set("startTime", this.data.startTime);
+            order.set("endTime", this.data.endTime);
+            order.set("price", this.data.count * this.data.room.price);
+            order.set("shopStore", {
+                __type: 'Pointer',
+                className: 'ShopStore',
+                objectId: this.data.room.shop.objectId
+            });
+            order.set("company", {
+                __type: 'Pointer',
+                className: 'Company',
+                objectId: company
+            })
+            order.set("name", this.data.customers[0]['realname']);
+            order.set("mobile", this.data.customers[0]['mobile']);
+            order.set("merber", this.data.peopleNum);
+            order = await order.save()
+        } catch (error) {
+            console.log(error);
+            wx.showToast({
+                title: error.errMsg,
+                icon: 'none'
+            })
+        }
+        return order
+    },
+    /**
+     * 生命周期函数--监听页面初次渲染完成
+     */
+    onReady: function () {
+
+    },
+    async getRoomOrdersByRoomId(roomId) {
+        let time1 = dateServ.changeDateTime(new Date(), '00:00:00');
+        let time2 = this.timeaddsix(dateServ.changeDateTime(new Date(), '23:59:59'));
+        console.log("time1", time1, "time2", time2)
+        let Order = new Parse.Query("RoomOrder")
+        Order.equalTo("room", roomId)
+        Order.equalTo("company", company)
+        Order.exists("status")
+        Order.greaterThanOrEqualTo("startTime", time1)
+        Order.lessThanOrEqualTo("startTime", time2)
+        Order.select("startTime", "endTime")
+        let orders = await Order.find()
+        console.log(orders);
+        return orders
+
+    },
+    timeaddsix(str) {
+        // 创建日期对象,并初始化,完成文本转日期
+        var date = new Date(str);
+        //日期转文本方式一:
+        // str = date.format("yyyy-MM-dd");
+        var year = date.getFullYear(); //年
+        var month = date.getMonth() + 7; //月 +6个月  因为js里month从0开始,所以要加1
+        if (month > 12) {
+            year++;
+            month -= 12;
+        }
+        if (month < 10) {
+            month = "0" + month;
+        }
+        var date2 = new Date(year, month, 0); //新的年月
+        var day1 = date.getDate();
+        var day2 = date2.getDate();
+        if (day1 > day2) { //防止+6月后没有31天
+            day1 = day2;
+        }
+        str = year + '/' +
+            month + '/' +
+            day1;
+        return str
+    },
+
+    /**
+     * 生命周期函数--监听页面隐藏
+     */
+    onHide: function () {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面卸载
+     */
+    onUnload: function () {
+
+    },
+
+    /**
+     * 页面相关事件处理函数--监听用户下拉动作
+     */
+    onPullDownRefresh: function () {
+
+    },
+
+    /**
+     * 页面上拉触底事件的处理函数
+     */
+    onReachBottom: function () {
+
+    },
+
+    /**
+     * 用户点击右上角分享
+     */
+    onShareAppMessage: function () {
+
+    },
+    // getRoom(){
+    //     this.getRoom
+    // }
+})

+ 15 - 0
nova-tourism/pages/homestay/homestay-order/index.json

@@ -0,0 +1,15 @@
+{
+  "usingComponents": {
+    "van-icon": "@vant/weapp/icon/index",
+    "modal": "../../../components/modal/index",
+    "van-divider": "@vant/weapp/divider/index",
+    "cell-list": "../../../components/cell-list/index",
+    "list-item": "../../../components/list-item/index",
+    "list-card": "../../../components/list-card/index",
+    "van-popup": "@vant/weapp/popup/index",
+    "van-button": "@vant/weapp/button/index",
+    "van-calendar": "@vant/weapp/calendar/index",
+    "van-picker": "@vant/weapp/picker/index",
+    "nova-calendar": "../../../components/calendar/index"
+  }
+}

+ 44 - 0
nova-tourism/pages/homestay/homestay-order/index.less

@@ -0,0 +1,44 @@
+@import '../../../styles/base.less';
+
+
+page {
+    background: #f6f6f6;
+}
+
+
+.tags {
+  width: 100%;
+  margin: 8rpx 0;
+  overflow: hidden;
+  text-overflow: ellipsis;
+  display: -webkit-box;
+  -webkit-line-clamp: 2;
+  -webkit-box-orient: vertical;
+} 
+
+.num-picker {
+  position: fixed;
+  bottom: 128rpx;
+  left:0;
+  right: 0;
+}
+
+.footer-bar {
+  position:fixed;
+  bottom: 0;
+  left: 0;
+  right: 0;
+  z-index: 99;
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+  padding: 20rpx;
+  background-color: #ffffff;
+  .price {
+      color:@red;
+      font-weight: 600;
+  }
+  .btn {
+      letter-spacing: 2px;
+  }
+}

+ 76 - 0
nova-tourism/pages/homestay/homestay-order/index.wxml

@@ -0,0 +1,76 @@
+<!--nova-tourism/pages/homestay/homestay-order/index.wxml-->
+<nav type="back" background-color="#46a9a4" title="提交订单" frontColor="#ffffff" />
+
+<view class="page-section">
+	<!-- 房间详情 -->
+	<cell-list detail="{{room}}" arrowText="房间详情" bind:arrowtap="navigate" data-type="room"></cell-list>
+	<van-divider customStyle="margin: 0;" />
+	<!-- 订房必读 -->
+	<cell-list detail="{{note}}" icon="warning" iconColor="#f01740" bind:arrowtap="showNotePop" bind:tap="showNotePop">
+	</cell-list>
+</view>
+<!-- <nova-calendar show="{{ true }}" title="请选择日期" color="#FFE300"></nova-calendar> -->
+<view class="page-section">
+	<view class="card-list page-section-spacing">
+		<view class="text spacing-small">入住信息</view>
+		<van-divider customStyle="margin: 8rpx;" />
+		<list-item label="入住时长" content="{{date}}" arrow="arrow" bind:tap="checkDate"></list-item>
+		<van-divider customStyle="margin: 8rpx;" />
+		<list-item label="入住人数" content="{{peopleNum}}" arrow="arrow-down" bind:tap="checkNum"></list-item>
+		<van-divider customStyle="margin: 8rpx;" />
+		<list-item label="住客信息" arrow="arrow" arrowText="添加/编辑" data-type="customer" bind:arrowtap="navigate">
+			<view slot="content">
+				<view wx:if="{{customers.length > 0}}">
+					<view wx:for="{{customers}}" wx:key="index" wx:for-item="customer"><text
+							class="text">{{customer['realname']}}\t</text></view>
+				</view>
+				<block wx:else>
+					<text class="text-small grey">请添加信息</text>
+				</block>
+			</view>
+		</list-item>
+	</view>
+</view>
+<view class="page-section page-section-spacing">
+	<list-item label="在线支付" content="{{count}}晚">
+		<view slot="end"><text class="text-small">共</text><text class="text red">¥{{count*room.price}}</text></view>
+	</list-item>
+	<van-divider customStyle="margin: 8rpx;" />
+	<list-item label="房费" arrow arrowText="¥{{count*room.price}}"></list-item>
+	<list-item label="{{info}}" labelClass="text-small" arrow arrowText="¥{{room.price}}" arrowTextClass="grey"
+		wx:for="{{priceInfoArr}}" wx:key="index" wx:for-item="info">
+	</list-item>
+</view>
+
+<view class="page-section-spacing" style="padding-bottom: 180rpx;">
+	<!-- <view class="text  spacing-small">退款规则</view>
+  <view class="text-small spacing-small grey "><text>入住前1天12:00前退订,可获100%退款。之后退定将不 予退款。</text></view> -->
+	<view class="text  spacing-small">预订说明</view>
+	<view class="text-small spacing-small grey"><text>订单需等酒店或供应商确认后才生效,订单确认结果以短信或邮件通知为准;请在订单生效后再至酒店前台办理入住。</text></view>
+</view>
+
+<!-- 底部栏 -->
+<view class="footer-bar">
+	<view class="price">¥{{count*room.price}}</view>
+	<van-button color="#46a9a4" round size="normal" class="btn" bind:tap="submit"><text style="color:#ffffff;">立即预订</text>
+	</van-button>
+</view>
+
+<!-- 支付组件 -->
+<payment style="z-index: 99999;" id='payMent' show="{{showPayment}}" tradeNo="{{tradeNo}}" price="{{count*room.price}}"
+	bind:payResult='acceptResult' showType="all" />
+
+<!-- 订房须知 -->
+<modal show="{{showNote}}" closeable title="订房须知" bind:close="closeModal" bind:enter="closeModal">
+	<rich-text slot="content" nodes="{{note.detail}}" style="width: 100%;height: 100%; margin: 0 auto;"></rich-text>
+</modal>
+
+<!-- 日期选择 default-date="{{date}}"-->
+<van-calendar show="{{ showDate }}" bind:close="closeDate" type="range" bind:unselect="unselectDate"
+	bind:confirm="enterDate" color="#46a9a4" formatter="{{ checkedFormatter }}" bind:select="selectDate" title="请选择日期"
+	default-date="{{null}}" max-range="{{ 28 }}" />
+<!-- default-date="{{defaultDate}}" -->
+
+<!-- 人数选择 -->
+<van-picker wx:if="{{ showNumPicker }}" show-toolbar title="入住人数" columns="{{columns}}" bind:change="numPickerChange"
+	bind:cancel="numPickerCancel" bind:confirm="numPickerEnter" class="num-picker" default-index="{{ room.merber }}" />

+ 1 - 0
nova-tourism/pages/homestay/homestay-order/index.wxss

@@ -0,0 +1 @@
+.red{color:#F01740}.grey{color:#666666}.black{color:#000000}.title{font-weight:Medium;font-size:36rpx;color:#222222}.text-large{font-size:36rpx}.text{font-size:30rpx}.text-left{text-align:left}.text-center{text-align:center}.text-small{font-size:24rpx}.flex{display:flex}.justify-between{justify-content:space-between}.flex-aligin-center{display:flex;align-items:center}.flex-justify-between{display:flex;justify-content:space-between}.flex-1{flex:1}.flex-grow-1{flex-grow:1}.fixed-bottom{position:fixed;bottom:0;left:0;right:0}.w-100{width:100%}.h-100{height:100%}.page-section{margin:20rpx;border-radius:20rpx;background-color:#ffffff}.page-section-spacing{padding:20rpx}.spacing-small{padding:10rpx}.border-trans{border:1px solid transparent}.ellipsis{width:100%;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical}.ellipsis-2{width:100%;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}page{background:#f6f6f6}.tags{width:100%;margin:8rpx 0;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}.num-picker{position:fixed;bottom:128rpx;left:0;right:0}.footer-bar{position:fixed;bottom:0;left:0;right:0;z-index:99;display:flex;align-items:center;justify-content:space-between;padding:20rpx;background-color:#ffffff}.footer-bar .price{color:#F01740;font-weight:600}.footer-bar .btn{letter-spacing:2px}

+ 14 - 0
nova-tourism/service/data.js

@@ -0,0 +1,14 @@
+
+let Parse = getApp().Parse
+export default {
+  async  getRoomById(roomId) {
+      let Room = new Parse.Query('ShopRoom')
+      Room.include("shop")
+      let room = await Room.get(roomId)
+      room = room.toJSON()
+      room.rate = room.shop.score
+      room.workingTime = room.shop.workingTime
+      console.log(room)
+      return room
+    }
+}

+ 64 - 0
nova-tourism/service/date.js

@@ -0,0 +1,64 @@
+export default {
+
+    /*** 根据时间返回时间字符串 Input => date  Output => 2022-11-12**/
+    getDateStrByTime(date) {
+        date = new Date(date)
+        let year = date.getFullYear();
+        let month = date.getMonth() + 1 >= 10 ? (date.getMonth() + 1) : ('0' + (date.getMonth() + 1));
+        let day = date.getDate() >= 10 ? date.getDate() : ('0' + date.getDate());
+        return `${year}/${month}/${day}`;
+    },
+    /***根据时间增减天数返回时间字符串 Input => date,count(正负增减)  Output => 2022-11-12**/
+    getStrByTimeIncreaseDay(date, count) {
+        date = new Date(date)
+        date = new Date(date.setDate(date.getDate() + count));
+        return this.getDateStrByTime(date)
+    },
+    /***根据开始时间、结束时间获取该时间段日期字符串数组 Input => date1,date2  Output => ["2022-04-19",2022-04-20"] **/
+    getDayAll(starDay, endDay) {
+        var arr = [];
+        var dates = [];
+        // 设置两个日期UTC时间
+        var db = new Date(starDay);
+        var de = new Date(endDay);
+
+        // 获取两个日期GTM时间
+        var s = db.getTime() - 24 * 60 * 60 * 1000;
+        var d = de.getTime() - 24 * 60 * 60 * 1000;
+
+        // 获取到两个日期之间的每一天的毫秒数
+        for (var i = s; i <= d;) {
+            i = i + 24 * 60 * 60 * 1000;
+            arr.push(parseInt(i))
+        }
+
+        // 获取每一天的时间  YY-MM-DD
+        for (var j in arr) {
+            var time = new Date(arr[j]);
+            var year = time.getFullYear(time);
+            var mouth = (time.getMonth() + 1) >= 10 ? (time.getMonth() + 1) : ('0' + (time.getMonth() + 1));
+            var day = time.getDate() >= 10 ? time.getDate() : ('0' + time.getDate());
+            var YYMMDD = year + '/' + mouth + '/' + day;
+            dates.push(YYMMDD)
+        }
+        return dates
+    },
+    changeDateTime(date, format) {
+        date = new Date(date)
+        let year = date.getFullYear();
+        let month = date.getMonth() + 1 >= 10 ? (date.getMonth() + 1) : ('0' + (date.getMonth() + 1));
+      let day = date.getDate() >= 10 ? date.getDate() : ('0' + date.getDate());
+      let str = year + "/" + month + "/" + day + ' ' + format
+      console.log(str)
+        return new Date(str);
+    },
+    isSameDay(date1, date2) {
+        date1 = new Date(date1)
+        date2 = new Date(date2)
+        if (date1.getFullYear() == date2.getFullYear() && date1.getMonth() == date2.getMonth() && date1.getDate() == date2.getDate()) {
+            return true;
+        }
+        return false;
+    }
+
+}

+ 220 - 0
nova-tourism/styles/base.less

@@ -0,0 +1,220 @@
+@red:#F01740;
+@grey: #666666;
+@orange: #FF8936;
+@yellow: #46a9a4;
+.red {
+  color: #F01740;
+}
+.grey {
+  color: #666666;
+}
+.black {
+  color: #000000;
+
+}
+.title {
+  font-weight: Medium;
+  font-size: 36rpx;
+  color: #222222;
+}
+.text-large {
+  font-size: 36rpx;
+}
+.text {
+  font-size: 30rpx;
+  // word-break: keep-all;
+}
+.text-left {
+  text-align: left;
+}
+.text-center {
+  text-align: center;
+}
+.text-small {
+  font-size: 24rpx;
+  /* word-break: keep-all; */
+}
+
+
+// flex
+.flex {
+  display: flex;
+}
+
+.justify-between {
+  justify-content: space-between;
+}
+
+.flex-aligin-center {
+  display: flex;
+  align-items: center;
+}
+.flex-justify-between {
+  display: flex;
+  justify-content: space-between;
+}
+
+.flex-1 {
+  flex: 1;
+}
+.flex-grow-1 {//例:左边宽度固定,就会自动占满右边剩余的宽度
+  flex-grow: 1;
+}
+
+// fixed
+.fixed-bottom {
+  position: fixed;
+  bottom: 0;
+  left: 0;
+  right: 0;
+}
+
+// width height
+.w-100 {
+  width: 100%;
+}
+.h-100 {
+  height: 100%;
+}
+
+.page-section {
+  margin:20rpx;
+  border-radius: 20rpx;
+  background-color: #ffffff;
+}
+.page-section-spacing {
+  padding:20rpx;
+}
+
+.spacing-small {
+  padding: 10rpx;
+}
+
+
+
+
+.px2rem(@name, @px) {
+  @{name}: @px * @base * 1rem;
+}
+
+
+// .spacing-types (@types){
+//   @{name}: @px * @base * 1rem;
+//   m: margin;
+//   p: padding
+// };
+// .spacing-directions (){
+//   t: top; r: right; b: bottom; l: left;
+// };
+// @spacing-base-size: 1rem;//基础大小
+// .spacing-sizes (){
+//   0: 0;
+//   1: 0.25;
+//   2: 0.5;
+//   3: 1;
+//   4: 1.5;
+//   5: 3
+// }
+
+// each(range(4), {
+//   .col-@{value} {
+//     height: (@value * 50px);
+//   }
+// });
+
+
+// .margin(@size) {
+//   .m-@{size} {
+//       margin: @size + 'px';
+//   }
+// }
+@marginList: 4,6,8,10,20,40,60,80,100;
+.generMargin(@i) when (@i < length(@marginList)+1) { //循环遍历
+  .margin(extract(@marginList, @i)); //extract(数组,编号)   
+  .generMargin(@i+1);
+}
+
+.margin(@size) {
+  .m-@{size} {
+      margin: @size + 'rpx';
+  }
+}  
+// each(.spacing-types(@typeKey, @type), {
+//   //.m-1
+//   each(.spacing-sizes(), .(@sizekey, @size) {
+//     //.m-1 {margin-1: 0.25rem;}
+//     .@{typeKey}-@{sizekey} {
+//       @{type}: @size * @spacing-base-size;
+//     }
+//   })
+//   //.mx-1
+//   each(.spacing-sizes(), .(@sizekey, @size) {
+//     //.mx-1 {margin-left: 0.25rem;margin-right: 0.25rem;}
+//     .@{typeKey}x-@{sizekey} {
+//       @{type}-left: @size * @spacing-base-size;
+//       @{type}-right: @size * @spacing-base-size
+//     }
+//   })
+//   //my-1
+//   each(.spacing-sizes(), .(@sizekey, @size) {
+//     //.my-1 {margin-top: 0.25rem;margin-bottom: 0.25rem;}
+//     .@{typeKey}y-@{sizekey} {
+//       @{type}-top: @size * @spacing-base-size;
+//       @{type}-bottom: @size * @spacing-base-size
+//     }
+//   })
+
+//   //.mt-1 .ml-1
+//   each(.spacing-directions(), .(@directionKey, @direction) {
+//     each(.spacing-sizes(), .(@sizekey, @size) {
+//       .@{typeKey}@{directionKey}-@{sizekey} {
+//         @{type}-@{direction}: @size * @spacing-base-size;
+//       }
+//     })
+//   })
+// });
+
+
+// border
+.border-trans {
+  border: 1px solid transparent;
+}
+
+// ellipsis
+.ellipsis{
+  width: 100%;
+  overflow: hidden;
+  text-overflow: ellipsis;
+  display: -webkit-box;
+  -webkit-line-clamp: 1;
+  -webkit-box-orient: vertical;
+}
+.ellipsis-2{
+  width: 100%;
+  overflow: hidden;
+  text-overflow: ellipsis;
+  display: -webkit-box;
+  -webkit-line-clamp: 2;
+  -webkit-box-orient: vertical;
+}
+
+
+
+// .detail-tags {
+//   width: 100%;
+//   margin: 8rpx 0;
+//   overflow: hidden;
+//   text-overflow: ellipsis;
+//   display: -webkit-box;
+//   -webkit-line-clamp: 2;
+//   -webkit-box-orient: vertical;
+// }
+// .goods-tags {
+//   width: 100%;
+//   margin: 8rpx 0;
+//   overflow: hidden;
+//   text-overflow: ellipsis;
+//   display: -webkit-box;
+//   -webkit-line-clamp: 2;
+//   -webkit-box-orient: vertical;
+// }

+ 1 - 0
nova-tourism/styles/base.wxss

@@ -0,0 +1 @@
+.red{color:#F01740}.grey{color:#666666}.black{color:#000000}.title{font-weight:Medium;font-size:36rpx;color:#222222}.text-large{font-size:36rpx}.text{font-size:30rpx}.text-left{text-align:left}.text-center{text-align:center}.text-small{font-size:24rpx}.flex{display:flex}.justify-between{justify-content:space-between}.flex-aligin-center{display:flex;align-items:center}.flex-justify-between{display:flex;justify-content:space-between}.flex-1{flex:1}.flex-grow-1{flex-grow:1}.fixed-bottom{position:fixed;bottom:0;left:0;right:0}.w-100{width:100%}.h-100{height:100%}.page-section{margin:20rpx;border-radius:20rpx;background-color:#ffffff}.page-section-spacing{padding:20rpx}.spacing-small{padding:10rpx}.border-trans{border:1px solid transparent}.ellipsis{width:100%;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical}.ellipsis-2{width:100%;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}