| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544 |
- <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 class="header_type" v-if="info.orderStatus === '1'">待支付</view>
- <view class="header_info" v-if="info.orderStatus === '1'">超时后,订单将会自动取消</view>
- <view class="header_type" v-if="info.orderStatus === '2'">已支付</view>
- <view class="header_info" v-if="info.orderStatus === '2'">订单已支付,请等待商家接单</view>
- <view class="header_type" v-if="info.orderStatus === '3'">待入住</view>
- <view class="header_info" v-if="info.orderStatus === '3'">订单已被商家接单,请前往办理入住</view>
- <view class="header_type" v-if="info.orderStatus === '4'">已入住</view>
- <view class="header_info" v-if="info.orderStatus === '4'">订单已办理入住</view>
- <view class="header_type" v-if="info.orderStatus === '5'">已消费</view>
- <view class="header_info" v-if="info.orderStatus === '5'">您的订单已消费,期待您再次预定哦</view>
- <view class="header_type" v-if="info.orderStatus === '6'">支付超时</view>
- <view class="header_info" v-if="info.orderStatus === '6'">订单已超过可支付时间,请重新下单</view>
- <view class="header_type" v-if="info.orderStatus === '7'">已取消</view>
- <view class="header_info" v-if="info.orderStatus === '7'">订单已取消,请重新下单</view>
- <view class="header_type" v-if="info.orderStatus === '8'">已退单</view>
- <view class="header_info" v-if="info.orderStatus === '8'">订单已被商家退单,请重新下单</view>
- <view class="header_type" v-if="info.orderStatus === '9'">已退款</view>
- <view class="header_info" v-if="info.orderStatus === '9'">订单已被商家退款</view>
- <view class="header_type" v-if="info.orderStatus === '10'">退款中</view>
- <view class="header_info" v-if="info.orderStatus === '10'">正在退款中...</view>
- <view class="header_btn">
- <view class="btn_box" v-if="info.orderStatus === '1'" @click="handlePay">去支付 ¥{{ info.houseTotalPrice }}.00</view>
- <view class="btn_box" v-if="info.orderStatus === '2' || info.orderStatus === '3'" @click="handleCancel">取消订单</view>
- <view class="btn_box" v-if="info.orderStatus * 1 > 3" @click="handleAgain">再次预定</view>
- <view class="btn_box" @click="handleDelete">删除订单</view>
- </view>
- <view class="header_msg" v-if="info.orderStatus === '1'">预定成功后,07月26日12:00前可免费取消</view>
- <view class="header_msg" v-if="info.orderStatus === '3' || info.orderStatus === '6'">办理入住前,您均可取消订单</view>
- <view class="header_msg" v-if="info.orderStatus === '8'">您的订单被商家退款了,请重新预定</view>
- </view>
- <!-- 主体内容区域 -->
- <view class="body">
- <!-- 费用信息区域 -->
- <view class="body_box">
- <view class="box_title">费用信息</view>
- <view class="box_container">
- <view class="container_key">在线支付</view>
- <view class="container_value price">¥{{ info.houseTotalPrice }}</view>
- </view>
- <view class="box_container">
- <view class="container_key">发票报销</view>
- <view class="container_value">如需发票,请先与酒店确认</view>
- </view>
- </view>
- <!-- 民宿信息区域 -->
- <view class="body_box">
- <view class="box_info">
- <img src="../../static/index/banner.png" />
- <view class="info_msg">
- <view class="msg_name">{{ info.hotelName }}</view>
- <view class="msg_address">{{ info.hotelHposition }}</view>
- </view>
- </view>
- <view class="box_btn">
- <view class="btn_item" @click="handleMap">
- <img class="img" src="../../static/my/map.png" />
- 地图/导航
- </view>
- <view class="btn_item" @click="handlePhone(info.hotelPhone)">
- <img class="img2" src="../../static/my/phone.png" />
- 联系商家
- </view>
- </view>
- </view>
- <!-- 房型信息和用户信息区域 -->
- <view class="body_box2">
- <view class="info_time">
- 7月26日
- <text class="gap">今天</text>
- <view class="time_line"></view>
- <view class="time_num">1晚</view>
- <view class="time_line"></view>
- <view class="gap">7月26日</view>
- <text>明天</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 class="info_box">
- <view class="box_key">住客姓名</view>
- <view class="box_value">{{ info.userName }}</view>
- </view>
- <view class="info_box">
- <view class="box_key">联系电话</view>
- <view class="box_value">{{ info.userPhone }}</view>
- </view>
- <view class="info_box">
- <view class="box_key">预计到店</view>
- <view class="box_value">7月26日14:00之前</view>
- </view>
- </view>
- <!-- 订单信息区域 -->
- <view class="body_box">
- <view class="box_title">订单信息</view>
- <view class="box_container">
- <view class="container_key">订单号</view>
- <view class="container_value">2626262626260660606</view>
- <view class="container_copy" @click="handleCopy('2626262626260660606')">复制</view>
- </view>
- <view class="box_container">
- <view class="container_key">下单时间</view>
- <view class="container_value">{{ info.createTime }}</view>
- </view>
- </view>
- </view>
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- // 详细信息
- info: {}
- }
- },
- onLoad(options) {
- console.log(options)
- this.info = JSON.parse(options.info)
- console.log(this.info)
- },
- methods: {
- // 点击复制文字回调
- handleCopy(text) {
- uni.setClipboardData({
- data: text,
- success: () => {}
- })
- },
- handleBack() {
- uni.navigateBack(1)
- },
- // 点击地图/导航文字回调
- handleMap() {
- uni.getSetting({
- success: (res) => {
- if (res.authSetting['scope.userLocation']) {
- let lat = this.info.hotelHpositionWens.split(',')[0] * 1
- let lng = this.info.hotelHpositionWens.split(',')[1] * 1
- uni.openLocation({
- latitude: lat,
- longitude: lng,
- name: this.info.hotelName,
- address: this.info.hotelHposition,
- success: () => {}
- })
- } else {
- uni.showModal({
- content: '当前没有定位权限,是否去设置打开?',
- confirmText: '确认',
- cancelText: '取消',
- success: (res) => {
- if (res.confirm) {
- uni.openSetting({
- success: (res) => {
- this.handleMap()
- }
- })
- } else {
- uni.showToast({
- title: '获取定位权限失败',
- icon: 'none',
- mask: true
- })
- }
- }
- })
- }
- }
- })
- },
- // 点击联系商家文字回调
- handlePhone(phone) {
- uni.makePhoneCall({
- phoneNumber: phone
- })
- },
- // 点击去支付按钮回调
- handlePay() {
- uni.navigateTo({
- url: '/pages/pay/pay'
- })
- },
- // 点击取消订单按钮回调
- handleCancel() {
- uni.showModal({
- title: '提示',
- content: '确定取消该订单吗?',
- success: (res) => {
- if (res.confirm) {
- uni.showToast({
- title: '取消成功',
- icon: 'success'
- })
- setTimeout(() => {
- uni.redirectTo({
- url: '/pages/orderManage/orderManage'
- })
- }, 1500)
- }
- }
- })
- },
- // 点击再次预定按钮回调
- handleAgain() {
- uni.navigateTo({
- url: '/pages/detail/detail'
- })
- },
- // 点击删除订单按钮回调
- handleDelete() {
- uni.showModal({
- title: '提示',
- content: '确定删除该订单吗?',
- success: (res) => {
- if (res.confirm) {
- uni.showToast({
- title: '删除成功',
- icon: 'success'
- })
- setTimeout(() => {
- uni.redirectTo({
- url: '/pages/orderManage/orderManage'
- })
- }, 1500)
- }
- }
- })
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- .container {
- position: relative;
- height: 100vh;
- background-color: #f2f2f2;
- .header {
- height: 480rpx;
- color: #fff;
- img {
- width: 100%;
- }
- .header_title {
- position: absolute;
- top: 65rpx;
- left: 308rpx;
- color: #fff;
- font-size: 28rpx;
- }
- .header_icon {
- position: absolute;
- top: 76rpx;
- left: 10rpx;
- width: 47rpx;
- height: 47rpx;
- }
- .header_type {
- position: absolute;
- top: 162rpx;
- left: 30rpx;
- font-size: 40rpx;
- font-weight: bold;
- }
- .header_info {
- position: absolute;
- top: 235rpx;
- left: 30rpx;
- font-size: 24rpx;
- }
- .header_btn {
- position: absolute;
- top: 290rpx;
- left: 30rpx;
- right: 30rpx;
- display: flex;
- justify-content: space-between;
- .btn_box {
- display: flex;
- justify-content: center;
- align-items: center;
- width: 335rpx;
- height: 72rpx;
- border-radius: 10rpx;
- color: #096562;
- font-size: 28rpx;
- background-color: #fff;
- }
- }
- .header_msg {
- position: absolute;
- top: 378rpx;
- left: 30rpx;
- font-size: 24rpx;
- }
- }
- .body {
- position: absolute;
- top: 430rpx;
- left: 0;
- right: 0;
- box-sizing: border-box;
- padding: 20rpx;
- height: calc(100vh - 430rpx);
- border-radius: 20rpx 20rpx 0 0;
- background-color: #ebeced;
- overflow-y: auto;
- .body_box {
- box-sizing: border-box;
- padding: 0 30rpx;
- margin-bottom: 20rpx;
- display: flex;
- flex-direction: column;
- height: 240rpx;
- border-radius: 14rpx;
- background-color: #fff;
- .box_title {
- line-height: 90rpx;
- font-size: 28rpx;
- font-weight: bold;
- border-bottom: 1rpx solid #e5e5e5;
- }
- .box_container {
- display: flex;
- margin-top: 25rpx;
- font-size: 28rpx;
- .container_key {
- width: 160rpx;
- color: #808080;
- }
- .container_value {
- }
- .container_copy {
- margin-left: auto;
- color: #096562;
- }
- .price {
- color: #ff5733;
- }
- }
- .box_info {
- display: flex;
- margin-top: 20rpx;
- height: 130rpx;
- img {
- width: 100rpx;
- height: 100rpx;
- border-radius: 10rpx;
- }
- .info_msg {
- display: flex;
- flex-direction: column;
- justify-content: space-around;
- margin-top: -10rpx;
- margin-left: 18rpx;
- width: 540rpx;
- .msg_name {
- font-size: 28rpx;
- font-weight: bold;
- }
- .msg_address {
- color: #808080;
- font-size: 24rpx;
- display: -webkit-box;
- -webkit-box-orient: vertical;
- -webkit-line-clamp: 2;
- overflow: hidden;
- }
- }
- }
- .box_btn {
- display: flex;
- justify-content: space-around;
- align-items: center;
- height: 110rpx;
- .btn_item {
- display: flex;
- align-items: center;
- width: 200rpx;
- .img {
- margin-right: 14rpx;
- width: 38rpx;
- height: 38rpx;
- }
- .img2 {
- width: 66rpx;
- height: 66rpx;
- }
- }
- }
- }
- .body_box2 {
- display: flex;
- flex-direction: column;
- box-sizing: border-box;
- padding: 0 30rpx;
- margin-bottom: 20rpx;
- height: 478rpx;
- 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 0;
- box-sizing: border-box;
- padding-bottom: 30rpx;
- color: #808080;
- font-size: 24rpx;
- border-bottom: 1rpx solid #e5e5e5;
- .tag_item {
- margin-right: 20rpx;
- }
- }
- .info_box {
- display: flex;
- margin-top: 23rpx;
- font-size: 28rpx;
- .box_key {
- width: 160rpx;
- color: #808080;
- }
- .box_value {
- }
- }
- }
- }
- }
- </style>
|