正在显示
3 个修改的文件
包含
63 行增加
和
24 行删除
| ... | ... | @@ -62,24 +62,49 @@ |
| 62 | 62 | </view> |
| 63 | 63 | </view> |
| 64 | 64 | |
| 65 | - <view v-if="registrationDetail.entryAttachments" class="box"> | |
| 65 | + <view v-if="registrationDetail.entryAttachments && registrationDetail.entryAttachments.length > 0" class="box"> | |
| 66 | 66 | <view class="title">报名材料</view> |
| 67 | - <view class="time"> | |
| 68 | - {{timeFormat(registrationDetail.entryAttachments.createdTime, 'yyyy-mm-dd hh:MM')}} 上传 | |
| 69 | - </view> | |
| 70 | - <view class="marks"> | |
| 71 | - {{registrationDetail.entryAttachments.remarks}} | |
| 67 | + | |
| 68 | + <view v-if="registrationDetail.entryAttachments[0]"> | |
| 69 | + <view class="time"> | |
| 70 | + {{timeFormat(registrationDetail.entryAttachments[0].createdTime, 'yyyy-mm-dd hh:MM')}} 上传 | |
| 71 | + </view> | |
| 72 | + <view class="marks"> | |
| 73 | + {{registrationDetail.entryAttachments[0].remarks || '--'}} | |
| 74 | + </view> | |
| 75 | + <view class="cl"> | |
| 76 | + <view v-if="attachments && attachments.length > 0" class="fj"> | |
| 77 | + <view v-for="(item,index) in attachments " @click="openLink(item)" :key="index"> | |
| 78 | + <view class="fj_item"> | |
| 79 | + <image class="img" src="/static/img/internship/link.png"></image> | |
| 80 | + <text class="look">{{item.filename}}</text> | |
| 81 | + </view> | |
| 82 | + </view> | |
| 83 | + </view> | |
| 84 | + </view> | |
| 72 | 85 | </view> |
| 73 | - <view class="cl"> | |
| 74 | - <view v-if="attachments&&attachments.length>0" class="fj"> | |
| 75 | - <view v-for="(item,index) in attachments " @click="openLink(item)"> | |
| 76 | - <view class="fj_item"> | |
| 77 | - <image class="img" src="/static/img/internship/link.png"></image> | |
| 78 | - <text class="look">{{item.filename}}</text> | |
| 86 | + | |
| 87 | + | |
| 88 | + <view v-if="registrationDetail.entryAttachments[1]"> | |
| 89 | + <view class="time"> | |
| 90 | + {{timeFormat(registrationDetail.entryAttachments[1].createdTime, 'yyyy-mm-dd hh:MM')}} 上传 | |
| 91 | + </view> | |
| 92 | + <view class="marks"> | |
| 93 | + {{registrationDetail.entryAttachments[1].remarks || '--'}} | |
| 94 | + </view> | |
| 95 | + <view class="cl"> | |
| 96 | + <view v-if="attachmentsTwo && attachmentsTwo.length > 0" class="fj"> | |
| 97 | + <view v-for="(item,index) in attachmentsTwo " @click="openLink(item)" :key="index"> | |
| 98 | + <view class="fj_item"> | |
| 99 | + <image class="img" src="/static/img/internship/link.png"></image> | |
| 100 | + <text class="look">{{item.filename}}</text> | |
| 101 | + </view> | |
| 79 | 102 | </view> |
| 80 | 103 | </view> |
| 81 | 104 | </view> |
| 82 | 105 | </view> |
| 106 | + | |
| 107 | + | |
| 83 | 108 | </view> |
| 84 | 109 | |
| 85 | 110 | <view class="box status"> |
| ... | ... | @@ -121,9 +146,13 @@ |
| 121 | 146 | export default { |
| 122 | 147 | data() { |
| 123 | 148 | return { |
| 124 | - registrationDetail: {}, | |
| 149 | + registrationDetail: { | |
| 150 | + entryAttachments: [] | |
| 151 | + }, | |
| 125 | 152 | attachments: [], |
| 153 | + attachmentsTwo: [], | |
| 126 | 154 | attachmentsFile: [], |
| 155 | + attachmentsTwoFile: [], | |
| 127 | 156 | } |
| 128 | 157 | }, |
| 129 | 158 | |
| ... | ... | @@ -133,7 +162,7 @@ |
| 133 | 162 | console.log(data) |
| 134 | 163 | this.registrationDetail = data |
| 135 | 164 | |
| 136 | - this.handleAttachments() | |
| 165 | + this.handleAttachments(data.entryAttachments || []) | |
| 137 | 166 | } |
| 138 | 167 | }) |
| 139 | 168 | |
| ... | ... | @@ -173,17 +202,27 @@ |
| 173 | 202 | }, |
| 174 | 203 | |
| 175 | 204 | methods: { |
| 176 | - handleAttachments() { | |
| 177 | - if (this.registrationDetail.entryAttachments) { | |
| 178 | - if (this.registrationDetail.entryAttachments.attachments) { | |
| 179 | - this.attachments = JSON.parse(this.registrationDetail.entryAttachments.attachments) | |
| 205 | + handleAttachments(data = []) { | |
| 206 | + if (data && data.length > 0) { | |
| 207 | + if (data[0].attachments) { | |
| 208 | + this.attachments = JSON.parse(data[0].attachments) | |
| 180 | 209 | } |
| 181 | - if (this.registrationDetail.entryAttachments.attachmentsFile) { | |
| 182 | - this.attachmentsFile = JSON.parse(this.registrationDetail.entryAttachments.attachmentsFile) | |
| 210 | + if (data[0].attachmentsFile) { | |
| 211 | + this.attachmentsFile = JSON.parse(data[0].attachmentsFile) | |
| 183 | 212 | } |
| 184 | 213 | this.attachments = this.attachments.concat(this.attachmentsFile) |
| 185 | - console.log(this.attachments) | |
| 186 | 214 | } |
| 215 | + | |
| 216 | + if (data && data.length > 1) { | |
| 217 | + if (data[1].attachments) { | |
| 218 | + this.attachmentsTwo = JSON.parse(data[1].attachments) | |
| 219 | + } | |
| 220 | + if (data[1].attachmentsFile) { | |
| 221 | + this.attachmentsTwoFile = JSON.parse(data[1].attachmentsFile) | |
| 222 | + } | |
| 223 | + this.attachmentsTwo = this.attachmentsTwo.concat(this.attachmentsTwoFile) | |
| 224 | + } | |
| 225 | + | |
| 187 | 226 | }, |
| 188 | 227 | |
| 189 | 228 | timeFormat(timestamp, format = 'yyyy-mm-dd') { | ... | ... |
请
注册
或
登录
后发表评论