Commit eebca2b1 by zhangzhen

细节优化

parent ae38097f
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<text class="tips"><text class="text-bold">预定须知:</text> 预定成功后,请按预约时间及时到店消费,若无法及时到店消费,可提前取消订单</text> <text class="tips"><text class="text-bold">预定须知:</text> 预定成功后,请按预约时间及时到店消费,若无法及时到店消费,可提前取消订单</text>
</view> </view>
<view class="part-right"> <view class="part-right">
<text class="text-title text-xl text-bold">{{roomInfo.name||'一帆风顺'}}</text> <text class="text-title text-xl text-bold">{{roomInfo.name||'一帆风顺'}}{{roomInfo.roomType?'【'+roomTypeEnum[roomInfo.roomType]+'】':''}}</text>
<view class="status-icon-box"> <view class="status-icon-box">
<view class="status-box" :class="'status-box-'+roomInfo.status"> <view class="status-box" :class="'status-box-'+roomInfo.status">
<text>{{roomStatusEnum[roomInfo.status]}}</text> <text>{{roomStatusEnum[roomInfo.status]}}</text>
...@@ -438,7 +438,8 @@ ...@@ -438,7 +438,8 @@
}, },
dateObj: {}, dateObj: {},
preOrderNo:'', preOrderNo:'',
roomStatusEnum:{} roomStatusEnum:{},
roomTypeEnum:{}
}; };
}, },
onLoad(option) { onLoad(option) {
...@@ -465,11 +466,13 @@ ...@@ -465,11 +466,13 @@
if (uni.getStorageSync('dicts')) { if (uni.getStorageSync('dicts')) {
dicts = JSON.parse(uni.getStorageSync('dicts')) dicts = JSON.parse(uni.getStorageSync('dicts'))
this.roomStatusEnum = getDictItem(dicts, "store_room_status"); this.roomStatusEnum = getDictItem(dicts, "store_room_status");
this.roomTypeEnum = getDictItem(dicts, "store_room_type");
} else { } else {
dictList().then(res => { dictList().then(res => {
dicts = res.data.data; dicts = res.data.data;
uni.setStorageSync('dicts', JSON.stringify(res.data.data)) uni.setStorageSync('dicts', JSON.stringify(res.data.data))
this.roomStatusEnum = getDictItem(dicts, "store_room_status"); this.roomStatusEnum = getDictItem(dicts, "store_room_status");
this.roomTypeEnum = getDictItem(dicts, "store_room_type");
}) })
} }
}, },
......
...@@ -21,11 +21,11 @@ ...@@ -21,11 +21,11 @@
<view class="flex-row room-image-box"> <view class="flex-row room-image-box">
<view class="img-box"> <view class="img-box">
<image :src="item.roomImages[0]" mode="heightFix"></image> <image :src="hostUrl+item.roomImages[0]" mode="heightFix"></image>
</view> </view>
<view class="flex-col"> <view class="flex-col">
<view class="flex-1 flex-col part-top"> <view class="flex-1 flex-col part-top">
<text class="text-title text-xl text-bold">{{item.roomName}}</text> <text class="text-title text-xl text-bold">{{item.roomName}}{{item.roomType?'【'+roomTypeEnum[item.roomType]+'】':''}}</text>
<text class="text-black margin-top">预约时长:{{Number(item.timeLong)}}小时</text> <text class="text-black margin-top">预约时长:{{Number(item.timeLong)}}小时</text>
</view> </view>
<view class="flex-1 flex-row part-bottom"> <view class="flex-1 flex-row part-bottom">
...@@ -109,7 +109,9 @@ ...@@ -109,7 +109,9 @@
</template> </template>
<script> <script>
import config from "@/config/index.config"
import fTabbar from '@/components/module/f-tabbar/f-tabbar'; import fTabbar from '@/components/module/f-tabbar/f-tabbar';
import {dictList} from "@/api/index.js";
import { import {
orderList orderList
} from "@/api/order.js" } from "@/api/order.js"
...@@ -125,6 +127,7 @@ import NoLogin from "@/components/noLogin/noLogin" ...@@ -125,6 +127,7 @@ import NoLogin from "@/components/noLogin/noLogin"
}, },
data() { data() {
return { return {
hostUrl:config.hostUrl,
status: 'nomore ', status: 'nomore ',
loadingText: '努力加载中', loadingText: '努力加载中',
loadmoreText: '上划加载', loadmoreText: '上划加载',
...@@ -158,7 +161,8 @@ import NoLogin from "@/components/noLogin/noLogin" ...@@ -158,7 +161,8 @@ import NoLogin from "@/components/noLogin/noLogin"
pageSize: 10 pageSize: 10
}, },
loginStatus:true, loginStatus:true,
orderStatusEnum:{} orderStatusEnum:{},
roomTypeEnum:{}
}; };
}, },
onLoad() { onLoad() {
...@@ -180,12 +184,14 @@ import NoLogin from "@/components/noLogin/noLogin" ...@@ -180,12 +184,14 @@ import NoLogin from "@/components/noLogin/noLogin"
if (uni.getStorageSync('dicts')) { if (uni.getStorageSync('dicts')) {
dicts = JSON.parse(uni.getStorageSync('dicts')) dicts = JSON.parse(uni.getStorageSync('dicts'))
this.orderStatusEnum = getDictItem(dicts, "store_order_status"); this.orderStatusEnum = getDictItem(dicts, "store_order_status");
this.roomTypeEnum = getDictItem(dicts, "store_room_type");
this.onLoading() this.onLoading()
} else { } else {
dictList().then(res => { dictList().then(res => {
dicts = res.data.data; dicts = res.data.data;
uni.setStorageSync('dicts', JSON.stringify(res.data.data)) uni.setStorageSync('dicts', JSON.stringify(res.data.data))
this.orderStatusEnum = getDictItem(dicts, "store_order_status"); this.orderStatusEnum = getDictItem(dicts, "store_order_status");
this.roomTypeEnum = getDictItem(dicts, "store_room_type");
this.onLoading() this.onLoading()
}) })
} }
......
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
<view class="flex-1 flex-col"> <view class="flex-1 flex-col">
<view class="info"> <view class="info">
<text class="text-title text-bold">预约包间:</text> <text class="text-title text-bold">预约包间:</text>
<text class="text-title ">{{orderInfo.roomName}}</text> <text class="text-title ">{{orderInfo.roomName}}{{orderInfo.roomType?'【'+roomTypeEnum[orderInfo.roomType]+'】':''}}</text>
</view> </view>
<view class="info"> <view class="info">
<text class="text-title text-bold">下单时间:</text> <text class="text-title text-bold">下单时间:</text>
...@@ -113,6 +113,9 @@ ...@@ -113,6 +113,9 @@
</template> </template>
<script> <script>
import {
getDictItem
} from "@/utils/tools.js"
import fNavbar from '@/components/module/f-navbar/f-navbar'; import fNavbar from '@/components/module/f-navbar/f-navbar';
import {getOrderInfoByNo,orderRefund} from "@/api/order.js" import {getOrderInfoByNo,orderRefund} from "@/api/order.js"
import moment from "@/common/moment_zh_cn.js"; import moment from "@/common/moment_zh_cn.js";
...@@ -128,15 +131,35 @@ ...@@ -128,15 +131,35 @@
orderNo:'', orderNo:'',
orderInfo:{}, orderInfo:{},
assetsPath: config.assetsPath, assetsPath: config.assetsPath,
hostUrl:config.hostUrl hostUrl:config.hostUrl,
orderStatusEnum:{},
roomTypeEnum:{}
}; };
}, },
onLoad(option) { onLoad(option) {
this.orderNo = option.orderNo; this.orderNo = option.orderNo;
this.onGetDicts()
this.onLoading(); this.onLoading();
this.onMessagePush() this.onMessagePush()
}, },
methods:{ methods:{
onGetDicts() {
let dicts = []
if (uni.getStorageSync('dicts')) {
dicts = JSON.parse(uni.getStorageSync('dicts'))
this.orderStatusEnum = getDictItem(dicts, "store_order_status");
this.roomTypeEnum = getDictItem(dicts, "store_room_type");
} else {
dictList().then(res => {
dicts = res.data.data;
uni.setStorageSync('dicts', JSON.stringify(res.data.data))
this.orderStatusEnum = getDictItem(dicts, "store_order_status");
this.roomTypeEnum = getDictItem(dicts, "store_room_type");
})
}
},
onLoading(){ onLoading(){
getOrderInfoByNo(this.orderNo).then(res=>{ getOrderInfoByNo(this.orderNo).then(res=>{
this.orderInfo = { this.orderInfo = {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment