apply.vue
4.17 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
184
185
<template>
<!-- 报名 -->
<view class="box">
<view class="box1" v-if="reactvt == 0">
<view class="header"><image class="image" mode="aspectFit" :src="userList.picUrl"></image></view>
<view class="body">
<view class="liner">
<view class="liner-left">姓名</view>
<view class="liner-right">{{ userList.realName }}</view>
</view>
<view class="liner">
<view class="liner-left">性别</view>
<view class="liner-right">{{ userList.sex }}</view>
</view>
<view class="liner">
<view class="liner-left">出生日期</view>
<view class="liner-right">{{ birthday }}</view>
</view>
<view class="liner">
<view class="liner-left">证件类型</view>
<view class="liner-right">{{ userList.identify }}</view>
</view>
<view class="liner">
<view class="liner-left">证件号</view>
<view class="liner-right">{{ userList.identifyCode }}</view>
</view>
<view class="liner">
<view class="liner-left">联系方式</view>
<view class="liner-right">{{ userList.phone }}</view>
</view>
</view>
<view class="foot "><view class="button" @click="nextFN(1)">下一步</view></view>
</view>
<trainApply2
v-show="reactvt == 1"
:hotelList="hotelList"
:examProjectsList="examProjectsList"
:trainProjectsList="trainProjectsList"
@nextFN="nextFN"
:id="id"
/>
<trainApply3
v-if="reactvt == 2"
:signId="signId"
:id="id"
:hotelList="hotelList"
:projectIdsArray="projectIdsArray"
:examIdsArry="examIdsArry"
@nextFN="nextFN"
/>
</view>
</template>
<script setup>
import trainApply2 from '@/components/train/train-apply/train-apply.vue';
import trainApply3 from '@/components/train/train-apply-three/train-apply-three.vue';
import { onLoad, onReady, onShareAppMessage, onShareTimeline, onPullDownRefresh } from '@dcloudio/uni-app';
import { ref, getCurrentInstance, reactive, toRefs } from 'vue';
import * as train from '@/common/train.js';
const reactvt = ref(0);
const id = ref();
const trainProjectsList = ref([]);
const examProjectsList = ref([]);
const hotelList = ref();
const birthday = ref();
const projectIdsArray = ref();
const examIdsArry = ref();
const signId = ref();
const data = reactive({
addForm: {},
userList: {}
});
const { addForm, userList } = toRefs(data);
onLoad(option => {
const arr = option.data.split(',');
id.value = arr[0];
initData();
});
// 获取详情数据
async function initData() {
addForm.value.id = id.value;
let res = await train.trainParticulars(addForm.value);
signId.value = res.data.signId;
res.data.examProjectsList.forEach(item => {
if (item.isNecessary == 1) {
item.check = true;
} else {
item.check = false;
}
examProjectsList.value.push(item);
});
res.data.trainProjectsList.forEach(item => {
if (item.isNecessary == 1) {
item.check = true;
} else {
item.check = false;
}
trainProjectsList.value.push(item);
});
hotelList.value = res.data.hotelList;
userList.value = res.data.userList[0];
birthday.value = userList.value.birth.slice(0, 10);
}
// 下一步
const nextFN = (e, val, arr) => {
reactvt.value = e;
projectIdsArray.value = val;
examIdsArry.value = arr;
};
</script>
<style scoped lang="scss">
.box {
position: relative;
min-height: 1442rpx;
}
.box1 {
background-color: #fff;
padding: 30rpx;
}
.header {
text-align: center;
margin-bottom: 30rpx;
.image {
border-radius: 15rpx;
width: 230rpx;
height: 280rpx;
background-color: #eeeeee;
}
}
.body {
.liner {
display: flex;
justify-content: space-between;
border-top: 1rpx solid #e6e6e6;
height: 100rpx;
line-height: 100rpx;
}
.liner-left {
font-size: 30rpx;
font-family: PingFang SC;
font-weight: 400;
color: #4c5359;
}
.liner-right {
font-size: 30rpx;
font-family: PingFang SC;
font-weight: 400;
color: #000000;
}
}
.foot {
background-color: #ffffff;
padding: 20rpx 0;
position: absolute;
left: 0;
bottom: 0;
width: 100%;
.button {
margin: 0 auto;
height: 80rpx;
width: 500rpx;
text-align: center;
font-size: 32rpx;
font-family: PingFang SC;
font-weight: 500;
color: #ffffff;
line-height: 80rpx;
background: linear-gradient(270deg, #54e1b9, #00caa6);
border-radius: 40rpx;
}
}
</style>