| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392 |
- <template>
- <view class="container">
- <!-- 导航栏图片区域 -->
- <view class="header">
- <img src="../../static/my/headerImg.png" />
- <!-- 标题区域 -->
- <view class="header_title">民宿名称</view>
- <!-- 返回图标区域 -->
- <img class="header_icon" src="../../static/index/left.png" @click="handleBack" />
- </view>
- <!-- 房间信息区域 -->
- <view class="info">
- <view class="info_time">
- {{ info.startTimeMonth }}月{{ info.startTimeMonth }}日
- <text class="gap">星期{{ info.startTimeWeek }}</text>
- <view class="time_line"></view>
- <view class="time_num">{{ info.nightNum }}晚</view>
- <view class="time_line"></view>
- <view class="gap">{{ info.endTimeMonth }}月{{ info.endTimeDay }}日</view>
- <text>星期{{ info.endTimeWeek }}</text>
- </view>
- <view class="info_msg">大床房</view>
- <view class="info_type">
- <view class="type_item">包吃住型</view>
- <view class="type_item">包吃住型</view>
- <view class="type_item">包吃住型</view>
- </view>
- <view class="info_tag">
- <view class="tag_item">16-20㎡</view>
- <view class="tag_item">双人床</view>
- <view class="tag_item">窗户位于走廊/窗户较小</view>
- </view>
- </view>
- <!-- 入住信息区域 -->
- <view class="msg">
- <view class="msg_title">入住信息</view>
- <view class="msg_box">
- <view class="box_key">房间数量</view>
- <view class="box_value">{{ roomCount }}间</view>
- <view class="box_icon">
- <img class="img" src="../../static/index/add.png" @click="handleAdd" />
- <img class="img2" src="../../static/index/minus.png" @click="handleMinus" />
- </view>
- </view>
- <view class="msg_box">
- <view class="box_key">住客姓名</view>
- <view class="box_value">
- <input type="text" placeholder="请输入住客姓名" v-model="clientName" />
- </view>
- <view class="box_icon" @click="handleSelectClient">
- <img class="img2" src="../../static/index/people.png" />
- </view>
- </view>
- <view class="msg_box">
- <view class="box_key">联系电话</view>
- <view class="box_value">
- <input type="number" maxlength="11" placeholder="请输入联系电话" v-model="clientPhone" />
- </view>
- </view>
- <view class="msg_box" @click="handleSelectTime">
- <view class="box_key">预计到店</view>
- <view class="box_value" :class="{ color: !arriveTime }">{{ arriveTime ? arriveTime : '请选择预计到店时间' }}</view>
- <view class="box_icon">
- <img class="img3" src="../../static/index/right2.png" />
- </view>
- </view>
- <uv-datetime-picker
- ref="datetimePicker"
- v-model="timeValue"
- mode="datetime"
- :closeOnClickOverlay="false"
- confirmColor="#096562"
- :formatter="formatter"
- @confirm="confirm"
- ></uv-datetime-picker>
- </view>
- <view class="foot">
- <view class="foot_left">
- <text>¥</text>
- {{ info.price }}
- </view>
- <view class="foot_right" @click="goPagePay">提交订单</view>
- </view>
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- info: {},
- // 预定房间数量
- roomCount: 1,
- // 住客姓名
- clientName: '张三',
- // 联系电话
- clientPhone: '13659865896',
- // 预计到店时间
- arriveTime: '',
- timeValue: Number(new Date())
- }
- },
- onLoad(options) {
- this.info = JSON.parse(options.info)
- // console.log(this.info)
- uni.$on('change', this.change)
- },
- methods: {
- change(e) {
- this.clientName = e.name
- },
- handleSelectClient() {
- uni.navigateTo({
- url: '/pages/common/common?type=1'
- })
- },
- confirm(e) {
- // console.log(e.value)
- let date = new Date(e.value)
- let month = date.getMonth() + 1
- let day = date.getDate()
- let H = date.getHours()
- let M = date.getMinutes()
- this.arriveTime = `${month}月${day}日${H}:${M}分之前`
- },
- formatter(type, value) {
- if (type === 'year') {
- return `${value}年`
- }
- if (type === 'month') {
- return `${value}月`
- }
- if (type === 'day') {
- return `${value}日`
- }
- return value
- },
- handleSelectTime() {
- this.$refs.datetimePicker.open()
- },
- handleAdd() {
- this.roomCount++
- },
- handleMinus() {
- if (this.roomCount > 1) {
- this.roomCount--
- } else {
- uni.showToast({
- title: '至少需要预定1间',
- icon: 'none'
- })
- }
- },
- // 提交订单按钮回调
- goPagePay() {
- let info = JSON.stringify(this.info)
- uni.navigateTo({
- url: `/pages/pay/pay?info=${info}`
- })
- },
- handleBack() {
- uni.navigateBack(1)
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- .container {
- position: relative;
- display: flex;
- flex-direction: column;
- min-height: 100vh;
- background-color: #ebeced;
- .header {
- position: relative;
- height: 125rpx;
- overflow: hidden;
- img {
- width: 100%;
- }
- .header_title {
- position: absolute;
- top: 65rpx;
- left: 308rpx;
- color: #fff;
- font-size: 28rpx;
- }
- .header_icon {
- position: absolute;
- top: 56rpx;
- left: 5rpx;
- width: 47rpx;
- height: 47rpx;
- }
- }
- .info {
- display: flex;
- flex-direction: column;
- box-sizing: border-box;
- padding: 0 30rpx;
- margin: 0 auto;
- margin-top: 18rpx;
- width: 710rpx;
- border-radius: 15rpx;
- background-color: #fff;
- .info_time {
- display: flex;
- align-items: center;
- margin-top: 20rpx;
- font-size: 32rpx;
- font-weight: bold;
- .time_line {
- width: 17rpx;
- height: 1rpx;
- background-color: #096562;
- }
- .time_num {
- box-sizing: border-box;
- padding: 0 15rpx;
- height: 46rpx;
- line-height: 46rpx;
- font-size: 24rpx;
- font-weight: 400;
- border-radius: 66rpx;
- border: 1rpx solid #096562;
- background-color: #f0f2f5;
- }
- .gap {
- margin: 0 10rpx;
- }
- text {
- font-size: 24rpx;
- font-weight: 400;
- }
- }
- .info_msg {
- margin-top: 15rpx;
- font-size: 28rpx;
- font-weight: bold;
- }
- .info_type {
- display: flex;
- flex-wrap: wrap;
- margin-top: 15rpx;
- .type_item {
- box-sizing: border-box;
- padding: 0 15rpx;
- margin-right: 20rpx;
- height: 41rpx;
- line-height: 41rpx;
- font-size: 24rpx;
- color: #fff;
- border-radius: 34rpx;
- background-color: #096562;
- }
- }
- .info_tag {
- display: flex;
- flex-wrap: wrap;
- margin: 18rpx 0 30rpx;
- color: #808080;
- font-size: 24rpx;
- .tag_item {
- margin-right: 20rpx;
- }
- }
- }
- .msg {
- box-sizing: border-box;
- padding-left: 26rpx;
- margin: auto;
- margin-top: 20rpx;
- width: 710rpx;
- border-radius: 15rpx;
- background-color: #fff;
- .msg_title {
- height: 87rpx;
- line-height: 87rpx;
- font-size: 28rpx;
- font-weight: bold;
- border-bottom: 1rpx solid #e6e6e6;
- }
- .msg_box {
- display: flex;
- align-items: center;
- height: 97rpx;
- font-size: 28rpx;
- border-bottom: 1rpx solid #e6e6e6;
- .box_key {
- width: 120rpx;
- color: #808080;
- }
- .box_value {
- margin-left: 30rpx;
- flex: 1;
- input {
- box-sizing: border-box;
- padding-right: 30rpx;
- width: 100%;
- }
- }
- .color {
- color: #808080;
- }
- .box_icon {
- display: flex;
- align-items: center;
- .img {
- width: 47rpx;
- height: 47rpx;
- }
- .img2 {
- margin: 0 30rpx;
- width: 37rpx;
- height: 37rpx;
- }
- .img3 {
- margin: 0 30rpx;
- width: 40rpx;
- height: 40rpx;
- }
- }
- }
- }
- .foot {
- position: absolute;
- left: 0;
- right: 0;
- bottom: 0;
- padding: 0 20rpx;
- display: flex;
- justify-content: space-between;
- align-items: center;
- height: 126rpx;
- background-color: #fff;
- .foot_left {
- margin-top: -10rpx;
- font-size: 40rpx;
- color: #ff5733;
- text {
- font-size: 24rpx;
- }
- }
- .foot_right {
- margin-top: -10rpx;
- display: flex;
- justify-content: center;
- align-items: center;
- width: 238rpx;
- height: 80rpx;
- color: #fff;
- font-size: 32rpx;
- border-radius: 64rpx;
- background-color: #096562;
- }
- }
- }
- </style>
|