billDetail.vue
5.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
<template>
<view :style="orderType=='all'?'':'height: calc(100vh - 200rpx);overflow: auto;'">
<view class="colorfulBg">
<view class="name">{{form.name}}</view>
<view class="whiteItem" v-if="orderType==0||orderType=='all'">
<view class="pp">报到时间:{{form.reportDate?.substring(0, 10)}}</view>
<view class="pp">培训周期:{{form.trainStart?.substring(0, 10)}} — {{form.trainEnd?.substring(0, 10)}}</view>
<!-- <view class="pp">培训地点:{{form.address}}</view> -->
</view>
<view class="whiteItem" v-if="orderType==1||orderType=='all'">
<view class="pp">入住时间:{{form.trainStart?.substring(0, 10)}} — {{form.trainEnd?.substring(0, 10)}}</view>
<view class="pp">房费:{{form.stayFee}}</view>
</view>
<view class="whiteItem" v-if="orderType==2||orderType=='all'">
<view class="pp">就餐次数:{{form.repastNum}}次</view>
<view class="pp">餐费:{{form.repastFee}}</view>
</view>
</view>
<uni-forms>
<view>
<view class="t"> 培训人员信息 </view>
<view class="whiteItem">
<view class="pp">工号:<text>{{detail.userNo}}</text></view>
<view class="pp">姓名:<text>{{detail.nickName}}</text></view>
<view class="pp">性别:<text>{{detail.sex=='0'?'男':'女'}}</text></view>
<view class="pp">身份证号码:<text>{{detail.card}}</text></view>
<view class="pp">单位名称:<text>{{detail.companyName}}</text></view>
<view class="pp">部门:<text>{{detail.deptName}}</text></view>
<view class="pp">岗位:<text>{{detail.postName}}</text></view>
<view class="pp">联系方式:<text>{{detail.phonenumber}}</text></view>
<view class="pp">备注信息:<text>{{detail.userNo}}</text></view>
</view>
</view>
</uni-forms>
</view>
<view class="bbfix" v-if="orderType!='all'">
<!-- 底部提交 -->
<view class="price">
总价:
<text v-if="orderType==0">¥{{ form.trainFee }}</text>
<text v-if="orderType==1">¥{{ form.stayFee }}</text>
<text v-if="orderType==2">¥{{ form.repastFee }}</text>
</view>
<view class="subBtn" @click="unsubscribe" v-if="status == '1'"> 退订</view>
</view>
<uni-popup ref="tdpopup" background-color="#fff" class="popupMation" type="bottom">
<view class="popup-content">
<view class="centertitle">退订说明</view>
<view>
<view class="pp">
退订联系人:<text>{{info.name}}</text>
</view>
<view class="pp" @click="callphone(info.tel)">
联系电话:<text>{{info.tel}}</text>
</view>
<view class="pp">
邮箱:<text>{{info.email}}</text>
</view>
</view>
</view>
</uni-popup>
</template>
<script setup>
import {reactive,toRefs} from 'vue';
import {onLoad,onShow} from '@dcloudio/uni-app';
import * as api from '@/common/api.js';
import * as hotel from '@/common/hotel.js';
const data = reactive({
form: {
},
status:null,
tdpopup:null,
detail:{},
info:{},
orderType:''
})
const {
form,detail,orderType,info,status,tdpopup
} = toRefs(data);
let trainId = ''
onLoad((options)=>{
trainId = options.trainId
orderType.value = options.orderType
console.log(orderType.value)
status.value = options.status
init()
})
function init(){
getData()
}
function getData(){
// 培训详情
hotel.getTrainDetail(trainId).then(res => {
form.value = res.data
})
// 用户信息
api.checkReport().then((res)=>{
detail.value = res.data
})
}
function unsubscribe(){
hotel.cancelOrder().then(res=>{
info.value = res.data
tdpopup.value.open()
})
}
function callphone(number) {
uni.makePhoneCall({
phoneNumber: number
});
}
</script>
<style lang="scss" scoped>
:deep(.uni-forms-item__inner){padding-bottom: 10rpx;}
:deep(.uni-forms-item__content){line-height: 36px;}
.t{padding: 20rpx;}
.hotel {
}
.whiteItem{ width: 700rpx;
box-sizing: border-box;
margin: 0 auto 26rpx;
padding: 26rpx;
background: #FFFFFF;
box-shadow: 0rpx 0rpx 27rpx 0rpx #DEDEDE;
border-radius: 15rpx;}
.roomType{color: #4C5359;font-size: 28rpx;margin:10rpx 0;}
.roomInfo{color: #4C5359;font-size: 28rpx;}
.tip{font-size: 28rpx;color: #E60012;}
.bbfix {
background: #fff;
height: 150rpx;
display: flex;
position: fixed;
z-index: 89;
width: 100%;
bottom: 0;
align-items: center;
justify-content: space-between;
border-top: 1rpx solid #dcdcdc;
.price {
padding-left: 20rpx;
text {
font-weight: bold;
font-size: 45rpx;
color: #ff8124;
}
}
.subBtn {
font-size: 32rpx;
color: #1EC886;border: 1px solid #1EC886;
background: transparent;
height: 60rpx;margin: 15rpx;
line-height: 60rpx;
padding: 0 30rpx;
}
.subBtn.gray{color: #999;border: 1px solid #999;}
}
.ccitem{display: flex;justify-content: space-between;font-size: 28rpx;
color: #666;margin: 0 0 10rpx;
label{font-size: 32rpx;color: #000;}
text{color: #1EC886;}
}
.colorfulBg{background:#1EC886;padding: 20rpx 10rpx 10rpx;
.whiteItem{border-radius: 0;margin: 0;width: 730rpx;}
.name{color: #fff;margin: 0 0 20rpx;}
}
</style>