头像
Showing
14 changed files
with
387 additions
and
97 deletions
| ... | @@ -58,6 +58,7 @@ export function fillImgUrl(url, prefix) { | ... | @@ -58,6 +58,7 @@ export function fillImgUrl(url, prefix) { |
| 58 | if (!url) return '' | 58 | if (!url) return '' |
| 59 | const trimmedUrl = String(url).trim() | 59 | const trimmedUrl = String(url).trim() |
| 60 | if (!trimmedUrl) return '' | 60 | if (!trimmedUrl) return '' |
| 61 | if (trimmedUrl === 'null' || trimmedUrl === 'undefined') return '' | ||
| 61 | if (trimmedUrl.startsWith('msr:')) { | 62 | if (trimmedUrl.startsWith('msr:')) { |
| 62 | return `${trimBaseUrl(config.baseUrl_api)}/fileServer/download?file=${encodeURIComponent(trimmedUrl)}&downFlag=0` | 63 | return `${trimBaseUrl(config.baseUrl_api)}/fileServer/download?file=${encodeURIComponent(trimmedUrl)}&downFlag=0` |
| 63 | } | 64 | } |
| ... | @@ -71,6 +72,21 @@ export function fillImgUrl(url, prefix) { | ... | @@ -71,6 +72,21 @@ export function fillImgUrl(url, prefix) { |
| 71 | return baseUrl + path | 72 | return baseUrl + path |
| 72 | } | 73 | } |
| 73 | 74 | ||
| 75 | export function getMemberPhotoValue(item = {}) { | ||
| 76 | return [item.photo, item.perPhoto, item.photo2, item.perPhoto2].find(isValidUrlValue) || '' | ||
| 77 | } | ||
| 78 | |||
| 79 | export function fillMemberPhoto(item = {}, fallback = '') { | ||
| 80 | const photo = getMemberPhotoValue(item) | ||
| 81 | return photo ? fillImgUrl(photo) : fallback | ||
| 82 | } | ||
| 83 | |||
| 84 | function isValidUrlValue(value) { | ||
| 85 | if (value === undefined || value === null) return false | ||
| 86 | const url = String(value).trim() | ||
| 87 | return url !== '' && url !== 'null' && url !== 'undefined' | ||
| 88 | } | ||
| 89 | |||
| 74 | function trimBaseUrl(url) { | 90 | function trimBaseUrl(url) { |
| 75 | return String(url || '').replace(/\/+$/, '') | 91 | return String(url || '').replace(/\/+$/, '') |
| 76 | } | 92 | } | ... | ... |
| 1 | // dev | 1 | // dev |
| 2 | const baseUrl_api = 'http://192.168.1.159:8787' | 2 | // const baseUrl_api = 'http://192.168.1.159:8787' |
| 3 | // const baseUrl_api = 'http://47.98.186.233:8787' | 3 | // const baseUrl_api = 'http://47.98.186.233:8787' |
| 4 | // const baseUrl_api = 'https://tk001.wxjylt.com/stage-api/' | 4 | const baseUrl_api = 'https://tk001.wxjylt.com/stage-api/' |
| 5 | const loginImage_api = 'https://tk001.wxjylt.com/stage-api' | 5 | const loginImage_api = 'https://tk001.wxjylt.com/stage-api' |
| 6 | const payUrl = 'https://wxpay.cmbc.com.cn/mobilePlatform/appserver/lcbpPay.do' | 6 | const payUrl = 'https://wxpay.cmbc.com.cn/mobilePlatform/appserver/lcbpPay.do' |
| 7 | 7 | ... | ... |
| ... | @@ -36,7 +36,7 @@ | ... | @@ -36,7 +36,7 @@ |
| 36 | 36 | ||
| 37 | <script setup> | 37 | <script setup> |
| 38 | import * as api from '@/common/api.js' | 38 | import * as api from '@/common/api.js' |
| 39 | import config from '@/config.js' | 39 | import { fillMemberPhoto } from '@/common/utils.js' |
| 40 | import { | 40 | import { |
| 41 | ref, | 41 | ref, |
| 42 | getCurrentInstance | 42 | getCurrentInstance |
| ... | @@ -69,13 +69,9 @@ | ... | @@ -69,13 +69,9 @@ |
| 69 | queryParams.value.pageNum = pageNum | 69 | queryParams.value.pageNum = pageNum |
| 70 | queryParams.value.pageSize = pageSize | 70 | queryParams.value.pageSize = pageSize |
| 71 | api.selectPageList(queryParams.value).then(res => { | 71 | api.selectPageList(queryParams.value).then(res => { |
| 72 | paging.value.complete(res.rows) | 72 | const rows = formatRows(res.rows || []) |
| 73 | list.value = res.rows | 73 | paging.value.complete(rows) |
| 74 | for(var l of list.value){ | 74 | list.value = rows |
| 75 | if(l.photo&&l.photo.indexOf('http')==-1){ | ||
| 76 | l.photo = config.baseUrl_api + l.photo | ||
| 77 | } | ||
| 78 | } | ||
| 79 | }) | 75 | }) |
| 80 | } | 76 | } |
| 81 | function getList() { | 77 | function getList() { |
| ... | @@ -84,16 +80,18 @@ | ... | @@ -84,16 +80,18 @@ |
| 84 | }) | 80 | }) |
| 85 | api.selectPageList(queryParams.value).then(res => { | 81 | api.selectPageList(queryParams.value).then(res => { |
| 86 | uni.hideLoading() | 82 | uni.hideLoading() |
| 87 | paging.value.complete(res.rows); | 83 | const rows = formatRows(res.rows || []) |
| 88 | list.value = res.rows | 84 | paging.value.complete(rows); |
| 89 | for(var l of list.value){ | 85 | list.value = rows |
| 90 | if(l.photo&&l.photo.indexOf('http')==-1){ | ||
| 91 | l.photo = config.baseUrl_api + l.photo | ||
| 92 | } | ||
| 93 | } | ||
| 94 | total.value = res.total | 86 | total.value = res.total |
| 95 | }) | 87 | }) |
| 96 | } | 88 | } |
| 89 | function formatRows(rows) { | ||
| 90 | return rows.map(item => ({ | ||
| 91 | ...item, | ||
| 92 | photo: fillMemberPhoto(item) | ||
| 93 | })) | ||
| 94 | } | ||
| 97 | function goDetail(n){ | 95 | function goDetail(n){ |
| 98 | uni.navigateTo({ | 96 | uni.navigateTo({ |
| 99 | url: `/personalVip/detail?perId=${n.perId}` | 97 | url: `/personalVip/detail?perId=${n.perId}` | ... | ... |
| ... | @@ -270,6 +270,7 @@ import config from '@/config.js' | ... | @@ -270,6 +270,7 @@ import config from '@/config.js' |
| 270 | import dayjs from 'dayjs' | 270 | import dayjs from 'dayjs' |
| 271 | import _ from 'underscore' | 271 | import _ from 'underscore' |
| 272 | import customModal from '@/components/custom-modal.vue' | 272 | import customModal from '@/components/custom-modal.vue' |
| 273 | import { fillMemberPhoto } from '@/common/utils.js' | ||
| 273 | 274 | ||
| 274 | const app = getApp(); | 275 | const app = getApp(); |
| 275 | const memberInfo = app.globalData.memberInfo | 276 | const memberInfo = app.globalData.memberInfo |
| ... | @@ -728,9 +729,7 @@ function getChosedStudentList() { | ... | @@ -728,9 +729,7 @@ function getChosedStudentList() { |
| 728 | _.each(res.rows, (d) => { | 729 | _.each(res.rows, (d) => { |
| 729 | setDefaultLevel(d) | 730 | setDefaultLevel(d) |
| 730 | d.levelOptions = cloneLevelOptions() | 731 | d.levelOptions = cloneLevelOptions() |
| 731 | if (d.photo && d.photo.indexOf('http') == -1) { | 732 | d.photo = fillMemberPhoto(d) |
| 732 | d.photo = config.baseUrl_api + d.photo | ||
| 733 | } | ||
| 734 | }) | 733 | }) |
| 735 | 734 | ||
| 736 | infoList.value = res.rows | 735 | infoList.value = res.rows | ... | ... |
| ... | @@ -194,7 +194,7 @@ function upApply(id) { | ... | @@ -194,7 +194,7 @@ function upApply(id) { |
| 194 | 194 | ||
| 195 | function goDetail(item) { | 195 | function goDetail(item) { |
| 196 | if (item.status != '0') { | 196 | if (item.status != '0') { |
| 197 | let path = `/level/applyDetail?examId=${item.examId}` | 197 | let path = `/pages/rank/applyDetail?examId=${item.examId}&type=1` |
| 198 | uni.navigateTo({ | 198 | uni.navigateTo({ |
| 199 | url: path | 199 | url: path |
| 200 | }); | 200 | }); | ... | ... |
| 1 | <template> | 1 | <template> |
| 2 | <view class="apply-detail-page"> | 2 | <view class="apply-detail-page"> |
| 3 | <view class="wBox"> | 3 | <view class="wBox base-info-card"> |
| 4 | <view class="tt">考级基本信息</view> | 4 | <view class="tt">考级基本信息</view> |
| 5 | <view class="ddd"> | 5 | <view class="ddd"> |
| 6 | <text class="lab">考级名称:</text>{{ form?.name }} | 6 | <text class="lab">考级名称</text> |
| 7 | <text class="val">{{ form?.name || '--' }}</text> | ||
| 7 | </view> | 8 | </view> |
| 8 | <view class="ddd"> | 9 | <view class="ddd"> |
| 9 | <text class="lab">申请日期:</text>{{form?.applyTime?.slice(0,10)}} | 10 | <text class="lab">申请日期</text> |
| 11 | <text class="val">{{form?.applyTime?.slice(0,10) || '--'}}</text> | ||
| 10 | </view> | 12 | </view> |
| 11 | <view class="ddd"> | 13 | <view class="ddd"> |
| 12 | <text class="lab">申请单位:</text>{{ form?.memberName }} | 14 | <text class="lab">申请单位</text> |
| 15 | <text class="val">{{ form?.memberName || '--' }}</text> | ||
| 13 | </view> | 16 | </view> |
| 14 | <view class="ddd"> | 17 | <view class="ddd"> |
| 15 | <text class="lab">考官:</text>{{form?.examinerNames?.split(',').join('/')}} | 18 | <text class="lab">考官</text> |
| 19 | <text class="val">{{form?.examinerNames?.split(',').join('/') || '--'}}</text> | ||
| 16 | </view> | 20 | </view> |
| 17 | <view class="ddd"> | 21 | <view class="ddd"> |
| 18 | <text class="lab">考试开始时间:</text>{{form?.startTime}} | 22 | <text class="lab">考试开始时间</text> |
| 23 | <text class="val">{{form?.startTime || '--'}}</text> | ||
| 19 | </view> | 24 | </view> |
| 20 | <view class="ddd"> | 25 | <view class="ddd"> |
| 21 | <text class="lab">考试结束时间:</text>{{form?.endTime}} | 26 | <text class="lab">考试结束时间</text> |
| 27 | <text class="val">{{form?.endTime || '--'}}</text> | ||
| 22 | </view> | 28 | </view> |
| 23 | <view class="ddd"> | 29 | <view class="ddd"> |
| 24 | <text class="lab">考级地点:</text>{{form?.address}} | 30 | <text class="lab">考级地点</text> |
| 31 | <text class="val">{{form?.address || '--'}}</text> | ||
| 25 | </view> | 32 | </view> |
| 33 | |||
| 26 | <view class="ddd" v-if="userType=='2'||userType=='1'"> | 34 | <view class="ddd" v-if="userType=='2'||userType=='1'"> |
| 27 | <text class="lab">总金额:</text> | 35 | <text class="lab">总金额</text> |
| 28 | <text class="text-danger">¥{{(form?.totalAmount*1).toFixed(2) }}</text> | 36 | <text class="val text-danger">¥{{(form?.totalAmount*1).toFixed(2) }}</text> |
| 37 | </view> | ||
| 38 | <view class="ddd"> | ||
| 39 | <text class="lab">证书状态</text> | ||
| 40 | <text class="val">{{ certStatusText }}</text> | ||
| 29 | </view> | 41 | </view> |
| 30 | </view> | 42 | </view> |
| 31 | <view class="wBox"> | 43 | <view class="wBox"> |
| ... | @@ -61,10 +73,10 @@ | ... | @@ -61,10 +73,10 @@ |
| 61 | ¥{{ (n.examFee * 1).toFixed(2) }} | 73 | ¥{{ (n.examFee * 1).toFixed(2) }} |
| 62 | </text> | 74 | </text> |
| 63 | </view> | 75 | </view> |
| 64 | <view> | 76 | <view class="pass-block"> |
| 65 | 是否通过 | 77 | <text class="field-label">是否通过</text> |
| 66 | <text v-if="n.isPass=='1'" class="text-success">通过</text> | 78 | <text v-if="n.isPass=='1'" class="pass-tag pass-success">通过</text> |
| 67 | <text v-else class="text-danger">未通过</text> | 79 | <text v-else class="pass-tag pass-danger">未通过</text> |
| 68 | </view> | 80 | </view> |
| 69 | </view> | 81 | </view> |
| 70 | </view> | 82 | </view> |
| ... | @@ -80,35 +92,46 @@ | ... | @@ -80,35 +92,46 @@ |
| 80 | 审核信息 | 92 | 审核信息 |
| 81 | </view> | 93 | </view> |
| 82 | <view> | 94 | <view> |
| 95 | <view v-if="recordList.length === 0" class="empty-text">暂无审核信息</view> | ||
| 83 | <view class="stepItem" v-for="(n,index) in recordList" :key="index"> | 96 | <view class="stepItem" v-for="(n,index) in recordList" :key="index"> |
| 84 | <view class="time">{{n.handleDate||'待审批'}}</view> | 97 | <view class="time">{{n.auditTime || n.handleDate || '待审批'}}</view> |
| 85 | <view class="content"> | 98 | <view class="content"> |
| 86 | <view class="status"> | 99 | <view class="status"> |
| 87 | <text :class="{ | 100 | <text :class="{ |
| 88 | 'text-success':n.auditStatus=='1', | 101 | 'text-success':getAuditResult(n)==='1', |
| 89 | 'text-danger':n.auditStatus=='2', | 102 | 'text-danger':getAuditResult(n)==='0', |
| 90 | 'text-warning':n.auditStatus=='3' | 103 | 'text-warning':getAuditResult(n)==='9' |
| 91 | }">{{ n.auditStatusStr }}</text> | 104 | }">{{ getAuditResultText(n) }}</text> |
| 92 | </view> | 105 | </view> |
| 93 | <!-- <view class="name">第 {{index+1}} 步</view> --> | 106 | <!-- <view class="name">第 {{index+1}} 步</view> --> |
| 94 | <view class="deptName">{{n.deptName}}</view> | 107 | <view class="deptName">{{n.auditDeptName || n.deptName || '--'}}</view> |
| 95 | <view v-if="n.auditStatus==2"> | 108 | <view v-if="n.auditMsg || n.reason"> |
| 96 | 备注:{{n.reason||'/' }} | 109 | 备注:{{n.auditMsg || n.reason || '/' }} |
| 110 | </view> | ||
| 97 | </view> | 111 | </view> |
| 98 | </view> | 112 | </view> |
| 99 | </view> | 113 | </view> |
| 100 | </view> | 114 | </view> |
| 115 | <!-- <view class="wBox"> | ||
| 116 | <view class="tt"> | ||
| 117 | 流程追踪 | ||
| 118 | </view> | ||
| 119 | <view class="cert-status-card" :class="{ active: isExamAuditPassed || hasLogistics, shipped: hasLogistics }"> | ||
| 120 | <view class="cert-info"> | ||
| 121 | <view class="cert-label">证书状态</view> | ||
| 101 | </view> | 122 | </view> |
| 123 | <view class="cert-status-text">{{ certStatusText }}</view> | ||
| 124 | </view> | ||
| 125 | </view> --> | ||
| 102 | 126 | ||
| 103 | </view> | 127 | </view> |
| 104 | </template> | 128 | </template> |
| 105 | 129 | ||
| 106 | <script setup> | 130 | <script setup> |
| 107 | import * as api from '@/common/api.js' | 131 | import * as api from '@/common/api.js' |
| 108 | import config from '@/config.js' | ||
| 109 | import _ from 'underscore' | 132 | import _ from 'underscore' |
| 110 | import { | 133 | import { |
| 111 | onMounted, | 134 | computed, |
| 112 | ref | 135 | ref |
| 113 | } from 'vue' | 136 | } from 'vue' |
| 114 | import { | 137 | import { |
| ... | @@ -122,6 +145,7 @@ | ... | @@ -122,6 +145,7 @@ |
| 122 | const recordList = ref([]) | 145 | const recordList = ref([]) |
| 123 | const list = ref([]) | 146 | const list = ref([]) |
| 124 | const totalStudent = ref(0) | 147 | const totalStudent = ref(0) |
| 148 | const certInfo = ref({}) | ||
| 125 | const studentquery = ref({ | 149 | const studentquery = ref({ |
| 126 | pageNum: 1, | 150 | pageNum: 1, |
| 127 | pageSize: 6 | 151 | pageSize: 6 |
| ... | @@ -160,6 +184,7 @@ | ... | @@ -160,6 +184,7 @@ |
| 160 | userType.value = app.globalData.userType | 184 | userType.value = app.globalData.userType |
| 161 | getRecordList() | 185 | getRecordList() |
| 162 | getTablePersonInfo() | 186 | getTablePersonInfo() |
| 187 | getCertInfo() | ||
| 163 | } | 188 | } |
| 164 | 189 | ||
| 165 | function getForm() { | 190 | function getForm() { |
| ... | @@ -171,11 +196,61 @@ | ... | @@ -171,11 +196,61 @@ |
| 171 | } | 196 | } |
| 172 | 197 | ||
| 173 | function getRecordList() { | 198 | function getRecordList() { |
| 174 | api.getLogs(examId).then(res => { | 199 | api.getLogs(examId, 1).then(res => { |
| 175 | recordList.value = res.data.levelSteps | 200 | recordList.value = normalizeRecordList(res.data) |
| 176 | uni.hideLoading() | 201 | uni.hideLoading() |
| 177 | }) | 202 | }) |
| 178 | } | 203 | } |
| 204 | function normalizeRecordList(data) { | ||
| 205 | if (Array.isArray(data)) return data | ||
| 206 | if (Array.isArray(data?.levelSteps)) return data.levelSteps | ||
| 207 | return [] | ||
| 208 | } | ||
| 209 | function getAuditResult(row = {}) { | ||
| 210 | if (row.auditResult !== undefined && row.auditResult !== null) return String(row.auditResult) | ||
| 211 | if (row.auditStatus !== undefined && row.auditStatus !== null) { | ||
| 212 | const status = String(row.auditStatus) | ||
| 213 | if (status === '1') return '1' | ||
| 214 | if (status === '2') return '0' | ||
| 215 | if (status === '3') return '9' | ||
| 216 | return status | ||
| 217 | } | ||
| 218 | return '' | ||
| 219 | } | ||
| 220 | function getAuditResultText(row = {}) { | ||
| 221 | const result = getAuditResult(row) | ||
| 222 | if (result === '9') return '审核中' | ||
| 223 | if (result === '0') return '审核未通过' | ||
| 224 | if (result === '1') return '审核通过' | ||
| 225 | return row.auditStatusStr || '' | ||
| 226 | } | ||
| 227 | function getCertInfo() { | ||
| 228 | api.paymentList({ | ||
| 229 | examId, | ||
| 230 | type: '1', | ||
| 231 | pageNum: 1, | ||
| 232 | pageSize: 1 | ||
| 233 | }).then(res => { | ||
| 234 | certInfo.value = (res.rows || [])[0] || {} | ||
| 235 | }).catch(() => { | ||
| 236 | certInfo.value = {} | ||
| 237 | }) | ||
| 238 | } | ||
| 239 | const isExamAuditPassed = computed(() => { | ||
| 240 | const status = String(form.value?.status ?? form.value?.auditStatus ?? '') | ||
| 241 | if (status) return status === '2' | ||
| 242 | return recordList.value.some(item => getAuditResult(item) === '1') | ||
| 243 | }) | ||
| 244 | const hasLogistics = computed(() => { | ||
| 245 | return !!(certInfo.value?.postCode || certInfo.value?.postName || String(certInfo.value?.postStatus || '') === '1') | ||
| 246 | }) | ||
| 247 | const certStatusText = computed(() => { | ||
| 248 | // 证书状态优先看物流,其次看考试审核状态。 | ||
| 249 | if (hasLogistics.value) return '邮寄中' | ||
| 250 | if (isExamAuditPassed.value) return '印制中' | ||
| 251 | return '--' | ||
| 252 | }) | ||
| 253 | |||
| 179 | function getTablePersonInfo() { | 254 | function getTablePersonInfo() { |
| 180 | api.getStudentList(studentquery.value).then(res=>{ | 255 | api.getStudentList(studentquery.value).then(res=>{ |
| 181 | list.value = res.rows | 256 | list.value = res.rows |
| ... | @@ -252,4 +327,140 @@ | ... | @@ -252,4 +327,140 @@ |
| 252 | } | 327 | } |
| 253 | } | 328 | } |
| 254 | 329 | ||
| 330 | .base-info-card { | ||
| 331 | .ddd { | ||
| 332 | display: flex; | ||
| 333 | align-items: flex-start; | ||
| 334 | justify-content: space-between; | ||
| 335 | gap: 28rpx; | ||
| 336 | margin: 0 0 14rpx; | ||
| 337 | font-size: 28rpx; | ||
| 338 | line-height: 1.45; | ||
| 339 | } | ||
| 340 | |||
| 341 | .lab { | ||
| 342 | flex: 0 0 180rpx; | ||
| 343 | color: #8A91A0; | ||
| 344 | } | ||
| 345 | |||
| 346 | .val { | ||
| 347 | flex: 1; | ||
| 348 | min-width: 0; | ||
| 349 | color: #1F2937; | ||
| 350 | font-weight: 500; | ||
| 351 | text-align: right; | ||
| 352 | word-break: break-all; | ||
| 353 | } | ||
| 354 | } | ||
| 355 | |||
| 356 | .userlist { | ||
| 357 | .item { | ||
| 358 | border-radius: 14rpx; | ||
| 359 | border: 1rpx solid rgba(196, 18, 27, 0.06); | ||
| 360 | } | ||
| 361 | |||
| 362 | .flexbox { | ||
| 363 | align-items: center; | ||
| 364 | gap: 20rpx; | ||
| 365 | |||
| 366 | > view { | ||
| 367 | min-width: 0; | ||
| 368 | } | ||
| 369 | } | ||
| 370 | } | ||
| 371 | |||
| 372 | .pass-block { | ||
| 373 | flex: 0 0 118rpx; | ||
| 374 | display: flex; | ||
| 375 | flex-direction: column; | ||
| 376 | align-items: center; | ||
| 377 | justify-content: center; | ||
| 378 | text-align: center; | ||
| 379 | } | ||
| 380 | |||
| 381 | .field-label { | ||
| 382 | display: block; | ||
| 383 | margin-bottom: 8rpx; | ||
| 384 | color: #8A91A0; | ||
| 385 | font-size: 22rpx; | ||
| 386 | line-height: 1; | ||
| 387 | } | ||
| 388 | |||
| 389 | .pass-tag { | ||
| 390 | display: inline-flex; | ||
| 391 | align-items: center; | ||
| 392 | justify-content: center; | ||
| 393 | min-width: 78rpx; | ||
| 394 | height: 38rpx; | ||
| 395 | line-height: 34rpx; | ||
| 396 | padding: 0 14rpx; | ||
| 397 | border-radius: 999rpx; | ||
| 398 | font-size: 22rpx; | ||
| 399 | } | ||
| 400 | |||
| 401 | .pass-success { | ||
| 402 | color: #168653; | ||
| 403 | background: linear-gradient(135deg, #e4f8ed 0%, #d2f2df 100%); | ||
| 404 | border: 1rpx solid rgba(50, 177, 108, 0.22); | ||
| 405 | } | ||
| 406 | |||
| 407 | .pass-danger { | ||
| 408 | color: #C4121B; | ||
| 409 | background: linear-gradient(135deg, #fff0f1 0%, #ffe4e6 100%); | ||
| 410 | border: 1rpx solid rgba(196, 18, 27, 0.18); | ||
| 411 | } | ||
| 412 | |||
| 413 | .cert-status-card { | ||
| 414 | display: flex; | ||
| 415 | align-items: center; | ||
| 416 | gap: 18rpx; | ||
| 417 | padding: 22rpx 24rpx; | ||
| 418 | border-radius: 18rpx; | ||
| 419 | background: linear-gradient(135deg, #f7f8fb 0%, #ffffff 100%); | ||
| 420 | border: 1rpx solid #eef0f4; | ||
| 421 | } | ||
| 422 | |||
| 423 | .cert-status-card.active { | ||
| 424 | background: linear-gradient(135deg, #fff4f5 0%, #ffffff 74%); | ||
| 425 | border-color: rgba(196, 18, 27, 0.16); | ||
| 426 | } | ||
| 427 | |||
| 428 | .cert-status-card.shipped { | ||
| 429 | background: linear-gradient(135deg, #f0fff7 0%, #ffffff 74%); | ||
| 430 | border-color: rgba(50, 177, 108, 0.2); | ||
| 431 | } | ||
| 432 | |||
| 433 | .cert-info { | ||
| 434 | flex: 1; | ||
| 435 | min-width: 0; | ||
| 436 | } | ||
| 437 | |||
| 438 | .cert-label { | ||
| 439 | color: #0A1629; | ||
| 440 | font-size: 28rpx; | ||
| 441 | font-weight: 600; | ||
| 442 | } | ||
| 443 | |||
| 444 | .cert-status-text { | ||
| 445 | flex: 0 0 auto; | ||
| 446 | padding: 9rpx 18rpx; | ||
| 447 | border-radius: 999rpx; | ||
| 448 | color: #C4121B; | ||
| 449 | background: rgba(196, 18, 27, 0.08); | ||
| 450 | font-size: 24rpx; | ||
| 451 | font-weight: 700; | ||
| 452 | } | ||
| 453 | |||
| 454 | .cert-status-card.shipped .cert-status-text { | ||
| 455 | color: #168653; | ||
| 456 | background: rgba(50, 177, 108, 0.1); | ||
| 457 | } | ||
| 458 | |||
| 459 | .empty-text { | ||
| 460 | padding: 18rpx 0; | ||
| 461 | color: #999; | ||
| 462 | font-size: 26rpx; | ||
| 463 | text-align: center; | ||
| 464 | } | ||
| 465 | |||
| 255 | </style> | 466 | </style> | ... | ... |
| ... | @@ -94,6 +94,7 @@ | ... | @@ -94,6 +94,7 @@ |
| 94 | <script setup> | 94 | <script setup> |
| 95 | import * as api from '@/common/api.js' | 95 | import * as api from '@/common/api.js' |
| 96 | import config from '@/config.js' | 96 | import config from '@/config.js' |
| 97 | import { fillMemberPhoto } from '@/common/utils.js' | ||
| 97 | import {ref} from 'vue' | 98 | import {ref} from 'vue' |
| 98 | import { onLoad } from '@dcloudio/uni-app' | 99 | import { onLoad } from '@dcloudio/uni-app' |
| 99 | 100 | ||
| ... | @@ -131,9 +132,7 @@ | ... | @@ -131,9 +132,7 @@ |
| 131 | const rows = res.rows || [] | 132 | const rows = res.rows || [] |
| 132 | rows.forEach(item => { | 133 | rows.forEach(item => { |
| 133 | item.checked = selectedList.value.some(s => s.perId === item.perId) | 134 | item.checked = selectedList.value.some(s => s.perId === item.perId) |
| 134 | if (item.photo && item.photo.indexOf('http') == -1) { | 135 | item.photo = fillMemberPhoto(item) |
| 135 | item.photo = config.baseUrl_api + item.photo | ||
| 136 | } | ||
| 137 | }) | 136 | }) |
| 138 | 137 | ||
| 139 | if (isMore) { | 138 | if (isMore) { | ... | ... |
| ... | @@ -3,14 +3,14 @@ | ... | @@ -3,14 +3,14 @@ |
| 3 | 3 | ||
| 4 | 4 | ||
| 5 | <scroll-view class="detail-content" scroll-y> | 5 | <scroll-view class="detail-content" scroll-y> |
| 6 | <!-- 考段基本信息 --> | 6 | <!-- 考试基本信息 --> |
| 7 | <view class="card"> | 7 | <view class="card"> |
| 8 | <view class="card-header"> | 8 | <view class="card-header"> |
| 9 | <view class="header-left">基本信息</view> | 9 | <view class="header-left">基本信息</view> |
| 10 | </view> | 10 | </view> |
| 11 | <view class="card-body"> | 11 | <view class="card-body"> |
| 12 | <view class="info-row"> | 12 | <view class="info-row"> |
| 13 | <text class="label">考试名称</text> | 13 | <text class="label">{{ examNameLabel }}</text> |
| 14 | <text class="value">{{ form.name || '' }}</text> | 14 | <text class="value">{{ form.name || '' }}</text> |
| 15 | </view> | 15 | </view> |
| 16 | <view class="info-row"> | 16 | <view class="info-row"> |
| ... | @@ -35,13 +35,18 @@ | ... | @@ -35,13 +35,18 @@ |
| 35 | <text class="value">{{ parseDateTime(form.endTime) }}</text> | 35 | <text class="value">{{ parseDateTime(form.endTime) }}</text> |
| 36 | </view> | 36 | </view> |
| 37 | <view class="info-row"> | 37 | <view class="info-row"> |
| 38 | <text class="label">考段地点</text> | 38 | <text class="label">{{ examAddressLabel }}</text> |
| 39 | <text class="value">{{ form.address || '--' }}</text> | 39 | <text class="value">{{ form.address || '--' }}</text> |
| 40 | </view> | 40 | </view> |
| 41 | <view class="info-row"> | ||
| 42 | <text class="label">证书状态</text> | ||
| 43 | <text class="value">{{ certStatusText }}</text> | ||
| 44 | </view> | ||
| 41 | <view v-if="userType == '2' || userType == '1'" class="info-row"> | 45 | <view v-if="userType == '2' || userType == '1'" class="info-row"> |
| 42 | <text class="label">总金额</text> | 46 | <text class="label">总金额</text> |
| 43 | <text class="value text-red">¥{{ (Number(form.totalAmount) || 0).toFixed(2) }}</text> | 47 | <text class="value text-red">¥{{ (Number(form.totalAmount) || 0).toFixed(2) }}</text> |
| 44 | </view> | 48 | </view> |
| 49 | |||
| 45 | </view> | 50 | </view> |
| 46 | </view> | 51 | </view> |
| 47 | 52 | ||
| ... | @@ -148,7 +153,7 @@ | ... | @@ -148,7 +153,7 @@ |
| 148 | <script setup> | 153 | <script setup> |
| 149 | import * as api from '@/common/api.js' | 154 | import * as api from '@/common/api.js' |
| 150 | import _ from 'underscore' | 155 | import _ from 'underscore' |
| 151 | import {ref} from 'vue' | 156 | import {computed, ref} from 'vue' |
| 152 | import {onLoad} from '@dcloudio/uni-app' | 157 | import {onLoad} from '@dcloudio/uni-app' |
| 153 | import {szToHz} from '@/common/utils.js' | 158 | import {szToHz} from '@/common/utils.js' |
| 154 | 159 | ||
| ... | @@ -163,6 +168,7 @@ const loading = ref(false) | ... | @@ -163,6 +168,7 @@ const loading = ref(false) |
| 163 | const loadingAudit = ref(false) | 168 | const loadingAudit = ref(false) |
| 164 | const loadingMore = ref(false) | 169 | const loadingMore = ref(false) |
| 165 | const hasMore = ref(false) | 170 | const hasMore = ref(false) |
| 171 | const certInfo = ref({}) | ||
| 166 | 172 | ||
| 167 | const selectForm = ref({ | 173 | const selectForm = ref({ |
| 168 | pageNum: 1, | 174 | pageNum: 1, |
| ... | @@ -191,6 +197,7 @@ function initData() { | ... | @@ -191,6 +197,7 @@ function initData() { |
| 191 | getForm() | 197 | getForm() |
| 192 | getList() | 198 | getList() |
| 193 | getRecordList() | 199 | getRecordList() |
| 200 | getCertInfo() | ||
| 194 | } | 201 | } |
| 195 | 202 | ||
| 196 | function getForm() { | 203 | function getForm() { |
| ... | @@ -220,10 +227,15 @@ function getList() { | ... | @@ -220,10 +227,15 @@ function getList() { |
| 220 | list.value.push(...res.rows) | 227 | list.value.push(...res.rows) |
| 221 | } | 228 | } |
| 222 | hasMore.value = list.value.length < (res.total || 0) | 229 | hasMore.value = list.value.length < (res.total || 0) |
| 223 | calcPersonInfo(res.rows) | 230 | if (isLevelDetail.value) { |
| 231 | getTablePersonInfo() | ||
| 232 | } else { | ||
| 233 | calcPersonInfoByRows(list.value) | ||
| 234 | } | ||
| 224 | } else { | 235 | } else { |
| 225 | list.value = [] | 236 | list.value = [] |
| 226 | hasMore.value = false | 237 | hasMore.value = false |
| 238 | tablePersonInfo.value = {total: 0, levelArr: []} | ||
| 227 | } | 239 | } |
| 228 | }).catch(err => { | 240 | }).catch(err => { |
| 229 | console.error('getList error:', err) | 241 | console.error('getList error:', err) |
| ... | @@ -233,12 +245,37 @@ function getList() { | ... | @@ -233,12 +245,37 @@ function getList() { |
| 233 | }) | 245 | }) |
| 234 | } | 246 | } |
| 235 | 247 | ||
| 236 | function calcPersonInfo(rows) { | 248 | function getTablePersonInfo() { |
| 249 | api.getExamPersonNum({ | ||
| 250 | examId, | ||
| 251 | type: '1' | ||
| 252 | }).then(res => { | ||
| 253 | calcPersonInfo(res.data || {}) | ||
| 254 | }).catch(() => { | ||
| 255 | tablePersonInfo.value = {total: list.value.length, levelArr: []} | ||
| 256 | }) | ||
| 257 | } | ||
| 258 | |||
| 259 | function calcPersonInfo(data) { | ||
| 260 | const levelArr = [] | ||
| 261 | let total = 0 | ||
| 262 | _.each(data, (val, key) => { | ||
| 263 | if (val > 0) { | ||
| 264 | levelArr.push({level: key, num: val}) | ||
| 265 | total += val | ||
| 266 | } | ||
| 267 | }) | ||
| 268 | tablePersonInfo.value = { | ||
| 269 | total: total, | ||
| 270 | levelArr: _.sortBy(levelArr, (l) => l.level) | ||
| 271 | } | ||
| 272 | } | ||
| 273 | |||
| 274 | function calcPersonInfoByRows(rows) { | ||
| 237 | if (!rows || rows.length === 0) { | 275 | if (!rows || rows.length === 0) { |
| 238 | tablePersonInfo.value = {total: 0, levelArr: []} | 276 | tablePersonInfo.value = {total: 0, levelArr: []} |
| 239 | return | 277 | return |
| 240 | } | 278 | } |
| 241 | const total = rows.length | ||
| 242 | const levelArr = [] | 279 | const levelArr = [] |
| 243 | _.each(rows, (d) => { | 280 | _.each(rows, (d) => { |
| 244 | const levelKey = String(d.levelNew || '') | 281 | const levelKey = String(d.levelNew || '') |
| ... | @@ -250,7 +287,7 @@ function calcPersonInfo(rows) { | ... | @@ -250,7 +287,7 @@ function calcPersonInfo(rows) { |
| 250 | } | 287 | } |
| 251 | }) | 288 | }) |
| 252 | tablePersonInfo.value = { | 289 | tablePersonInfo.value = { |
| 253 | total: total, | 290 | total: rows.length, |
| 254 | levelArr: _.sortBy(levelArr, (l) => l.level) | 291 | levelArr: _.sortBy(levelArr, (l) => l.level) |
| 255 | } | 292 | } |
| 256 | } | 293 | } |
| ... | @@ -277,6 +314,40 @@ function getRecordList() { | ... | @@ -277,6 +314,40 @@ function getRecordList() { |
| 277 | }) | 314 | }) |
| 278 | } | 315 | } |
| 279 | 316 | ||
| 317 | function getCertInfo() { | ||
| 318 | api.paymentList({ | ||
| 319 | examId, | ||
| 320 | type: certQueryType.value, | ||
| 321 | pageNum: 1, | ||
| 322 | pageSize: 1 | ||
| 323 | }).then(res => { | ||
| 324 | certInfo.value = (res.rows || [])[0] || {} | ||
| 325 | }).catch(() => { | ||
| 326 | certInfo.value = {} | ||
| 327 | }) | ||
| 328 | } | ||
| 329 | |||
| 330 | const isLevelDetail = computed(() => String(examType.value) === '1') | ||
| 331 | const examNameLabel = computed(() => isLevelDetail.value ? '考级名称' : '考试名称') | ||
| 332 | const examAddressLabel = computed(() => isLevelDetail.value ? '考级地点' : '考段地点') | ||
| 333 | const certQueryType = computed(() => { | ||
| 334 | const map = {'1': '1', '2': '2', '3': '2', '4': '3'} | ||
| 335 | return map[String(examType.value)] || '2' | ||
| 336 | }) | ||
| 337 | const isExamAuditPassed = computed(() => { | ||
| 338 | const status = String(form.value?.status ?? form.value?.auditStatus ?? '') | ||
| 339 | if (status) return status === '2' | ||
| 340 | return recordList.value.some(item => String(item.auditResult) === '1') | ||
| 341 | }) | ||
| 342 | const hasLogistics = computed(() => { | ||
| 343 | return !!(certInfo.value?.postCode || certInfo.value?.postName || String(certInfo.value?.postStatus || '') === '1') | ||
| 344 | }) | ||
| 345 | const certStatusText = computed(() => { | ||
| 346 | if (hasLogistics.value) return '邮寄中' | ||
| 347 | if (isExamAuditPassed.value) return '印制中' | ||
| 348 | return '--' | ||
| 349 | }) | ||
| 350 | |||
| 280 | function loadMore() { | 351 | function loadMore() { |
| 281 | if (hasMore.value && !loadingMore.value) { | 352 | if (hasMore.value && !loadingMore.value) { |
| 282 | loadingMore.value = true | 353 | loadingMore.value = true | ... | ... |
| ... | @@ -71,7 +71,7 @@ | ... | @@ -71,7 +71,7 @@ |
| 71 | <uni-forms-item label="头像" required> | 71 | <uni-forms-item label="头像" required> |
| 72 | <uni-file-picker v-model="photoArr" @delete="delPhoto" return-type="object" limit="1" | 72 | <uni-file-picker v-model="photoArr" @delete="delPhoto" return-type="object" limit="1" |
| 73 | @select="upPhoto" :del-ico="false" :image-styles="imageStylesTx"></uni-file-picker> | 73 | @select="upPhoto" :del-ico="false" :image-styles="imageStylesTx"></uni-file-picker> |
| 74 | <image mode="aspectFill" v-if="baseFormData.photo2" style="height:200rpx;width:200rpx;" :src="config.baseUrl_api + baseFormData.photo2"/> | 74 | <image mode="aspectFill" v-if="baseFormData.photo2" style="height:200rpx;width:200rpx;" :src="aes2.fillImgUrl(baseFormData.photo2)"/> |
| 75 | </uni-forms-item> --> | 75 | </uni-forms-item> --> |
| 76 | </view> | 76 | </view> |
| 77 | </uni-forms> | 77 | </uni-forms> |
| ... | @@ -258,8 +258,8 @@ async function fetchMemberInfo(id) { | ... | @@ -258,8 +258,8 @@ async function fetchMemberInfo(id) { |
| 258 | baseFormData.value.perCode = data.perCode || '' | 258 | baseFormData.value.perCode = data.perCode || '' |
| 259 | baseFormData.value.validityDate = data.validityDate ? data.validityDate.slice(0, 10) : '' | 259 | baseFormData.value.validityDate = data.validityDate ? data.validityDate.slice(0, 10) : '' |
| 260 | // 照片处理 | 260 | // 照片处理 |
| 261 | if (data.photo2) { | 261 | const photoUrl = aes2.fillMemberPhoto(data) |
| 262 | const photoUrl = data.photo2.indexOf('http') === -1 ? config.baseUrl_api + data.photo2 : data.photo2 | 262 | if (photoUrl) { |
| 263 | photoArr.value = { | 263 | photoArr.value = { |
| 264 | url: photoUrl, | 264 | url: photoUrl, |
| 265 | name: '头像', | 265 | name: '头像', |
| ... | @@ -359,7 +359,7 @@ function upPhoto(e) { | ... | @@ -359,7 +359,7 @@ function upPhoto(e) { |
| 359 | baseFormData.value.photo = data.data.fang; | 359 | baseFormData.value.photo = data.data.fang; |
| 360 | baseFormData.value.photo2 = data.data.yuan; | 360 | baseFormData.value.photo2 = data.data.yuan; |
| 361 | photoArr.value = { | 361 | photoArr.value = { |
| 362 | url: config.baseUrl_api + baseFormData.value.photo, | 362 | url: aes2.fillImgUrl(baseFormData.value.photo), |
| 363 | name: '头像', | 363 | name: '头像', |
| 364 | extname: 'jpg' | 364 | extname: 'jpg' |
| 365 | } | 365 | } |
| ... | @@ -418,26 +418,15 @@ function getExtractInfo(obj) { | ... | @@ -418,26 +418,15 @@ function getExtractInfo(obj) { |
| 418 | baseFormData.value.validityDate = res.data.validityDate?.slice(0, 10) //去掉时分秒 | 418 | baseFormData.value.validityDate = res.data.validityDate?.slice(0, 10) //去掉时分秒 |
| 419 | // baseFormData.value.cityId = res.data.cityId | 419 | // baseFormData.value.cityId = res.data.cityId |
| 420 | // baseFormData.value.address = res.data.address | 420 | // baseFormData.value.address = res.data.address |
| 421 | if (res.data.photo) { | 421 | const photoUrl = aes2.fillMemberPhoto(res.data) |
| 422 | console.log(res.data.photo) | 422 | if (photoUrl) { |
| 423 | if (res.data.photo.indexOf('http') == -1) { | 423 | baseFormData.value.photo = res.data.photo || res.data.perPhoto || '' |
| 424 | baseFormData.value.photo = res.data.photo | 424 | baseFormData.value.photo2 = res.data.photo2 || res.data.perPhoto2 || '' |
| 425 | let obj = { | 425 | photoArr.value = { |
| 426 | url: config.baseUrl_api + res.data.photo, | 426 | url: photoUrl, |
| 427 | name: '头像', | ||
| 428 | extname: 'jpg' | ||
| 429 | } | ||
| 430 | photoArr.value = obj | ||
| 431 | } else { | ||
| 432 | baseFormData.value.photo = res.data.photo | ||
| 433 | let obj = { | ||
| 434 | url: res.data.photo, | ||
| 435 | name: '头像', | 427 | name: '头像', |
| 436 | extname: 'jpg' | 428 | extname: 'jpg' |
| 437 | } | 429 | } |
| 438 | photoArr.value = obj | ||
| 439 | } | ||
| 440 | |||
| 441 | } | 430 | } |
| 442 | // baseFormData.value.name = res.data.name | 431 | // baseFormData.value.name = res.data.name |
| 443 | baseFormData.value.perId = res.data.perId | 432 | baseFormData.value.perId = res.data.perId | ... | ... |
| ... | @@ -642,15 +642,23 @@ const downCert = async () => { | ... | @@ -642,15 +642,23 @@ const downCert = async () => { |
| 642 | uni.showToast({title: '请先绑定学员', icon: 'none'}) | 642 | uni.showToast({title: '请先绑定学员', icon: 'none'}) |
| 643 | return | 643 | return |
| 644 | } | 644 | } |
| 645 | const perId = userInfo.value?.perId | 645 | const perId = userInfo.value?.perId || perInfo.value?.perId |
| 646 | if (!perId) return | 646 | if (!perId) return |
| 647 | 647 | ||
| 648 | if (!perInfo.value.perPhoto || !perInfo.value.perPhoto2) { | 648 | uni.showLoading({title: '加载中...', mask: true}) |
| 649 | const [infoErr, infoRes] = await to(getInfo(perId)) | ||
| 650 | const latestPerInfo = infoErr ? perInfo.value : (infoRes?.data || perInfo.value) | ||
| 651 | if (!getAvatarPhoto(latestPerInfo)) { | ||
| 649 | uni.hideLoading() | 652 | uni.hideLoading() |
| 650 | uni.showToast({title: '请先上传头像照片', icon: 'none'}) | 653 | uni.showToast({title: '请先上传头像照片', icon: 'none'}) |
| 651 | return | 654 | return |
| 652 | } | 655 | } |
| 653 | uni.showLoading({title: '加载中...', mask: true}) | 656 | if (!infoErr && infoRes?.data) { |
| 657 | userStore.setPerInfo({ | ||
| 658 | ...perInfo.value, | ||
| 659 | ...infoRes.data | ||
| 660 | }) | ||
| 661 | } | ||
| 654 | const [err, res] = await to(downStuCertSingle(perId)) | 662 | const [err, res] = await to(downStuCertSingle(perId)) |
| 655 | uni.hideLoading() | 663 | uni.hideLoading() |
| 656 | 664 | ... | ... |
| ... | @@ -111,7 +111,7 @@ | ... | @@ -111,7 +111,7 @@ |
| 111 | } from '@dcloudio/uni-app' | 111 | } from '@dcloudio/uni-app' |
| 112 | import config from '@/config.js' | 112 | import config from '@/config.js' |
| 113 | import * as aes2 from '@/common/utils.js' | 113 | import * as aes2 from '@/common/utils.js' |
| 114 | import { fillImgUrl } from '@/common/utils.js' | 114 | import { fillImgUrl, fillMemberPhoto } from '@/common/utils.js' |
| 115 | const current = ref(0) | 115 | const current = ref(0) |
| 116 | const agree = ref(false) | 116 | const agree = ref(false) |
| 117 | const perId = ref() | 117 | const perId = ref() |
| ... | @@ -421,11 +421,13 @@ | ... | @@ -421,11 +421,13 @@ |
| 421 | baseFormData.value.perCode = res.data.perCode ||'' | 421 | baseFormData.value.perCode = res.data.perCode ||'' |
| 422 | baseFormData.value.validityDateRaw = res.data.validityDate || '' | 422 | baseFormData.value.validityDateRaw = res.data.validityDate || '' |
| 423 | baseFormData.value.validityDate = res.data.validityDate?.slice(0,10) //去掉时分秒 | 423 | baseFormData.value.validityDate = res.data.validityDate?.slice(0,10) //去掉时分秒 |
| 424 | if (res.data.photo) { | 424 | const photoUrl = fillMemberPhoto(res.data) |
| 425 | console.log(res.data.photo) | 425 | if (photoUrl) { |
| 426 | baseFormData.value.photo = res.data.photo | 426 | console.log(res.data.photo || res.data.perPhoto) |
| 427 | baseFormData.value.photo = res.data.photo || res.data.perPhoto || '' | ||
| 428 | baseFormData.value.photo2 = res.data.photo2 || res.data.perPhoto2 || '' | ||
| 427 | let obj = { | 429 | let obj = { |
| 428 | url: fillImgUrl(res.data.photo), | 430 | url: photoUrl, |
| 429 | name: '头像', | 431 | name: '头像', |
| 430 | extname: 'jpg' | 432 | extname: 'jpg' |
| 431 | } | 433 | } | ... | ... |
| ... | @@ -65,6 +65,7 @@ | ... | @@ -65,6 +65,7 @@ |
| 65 | <script setup> | 65 | <script setup> |
| 66 | import * as api from '@/common/api.js' | 66 | import * as api from '@/common/api.js' |
| 67 | import config from '@/config.js' | 67 | import config from '@/config.js' |
| 68 | import { fillMemberPhoto } from '@/common/utils.js' | ||
| 68 | import { | 69 | import { |
| 69 | onLoad, | 70 | onLoad, |
| 70 | onShow | 71 | onShow |
| ... | @@ -111,9 +112,7 @@ | ... | @@ -111,9 +112,7 @@ |
| 111 | if (form.value.cityId) { | 112 | if (form.value.cityId) { |
| 112 | getRegionsList(form.value.cityId) | 113 | getRegionsList(form.value.cityId) |
| 113 | } | 114 | } |
| 114 | if (form.value.photo && form.value.photo.indexOf('http') == -1) { | 115 | form.value.photo = fillMemberPhoto(form.value) |
| 115 | form.value.photo = config.baseUrl_api + form.value.photo | ||
| 116 | } | ||
| 117 | }) | 116 | }) |
| 118 | }) | 117 | }) |
| 119 | 118 | ... | ... |
| ... | @@ -56,7 +56,7 @@ | ... | @@ -56,7 +56,7 @@ |
| 56 | 56 | ||
| 57 | <script setup> | 57 | <script setup> |
| 58 | import * as api from '@/common/api.js' | 58 | import * as api from '@/common/api.js' |
| 59 | import { fillImgUrl } from '@/common/utils.js' | 59 | import { fillMemberPhoto } from '@/common/utils.js' |
| 60 | import { | 60 | import { |
| 61 | onMounted, | 61 | onMounted, |
| 62 | ref | 62 | ref |
| ... | @@ -119,7 +119,7 @@ | ... | @@ -119,7 +119,7 @@ |
| 119 | function formatRows(rows) { | 119 | function formatRows(rows) { |
| 120 | return rows.map(item => ({ | 120 | return rows.map(item => ({ |
| 121 | ...item, | 121 | ...item, |
| 122 | photo: fillImgUrl(item.photo) | 122 | photo: fillMemberPhoto(item) |
| 123 | })) | 123 | })) |
| 124 | } | 124 | } |
| 125 | 125 | ... | ... |
| ... | @@ -55,6 +55,7 @@ | ... | @@ -55,6 +55,7 @@ |
| 55 | 55 | ||
| 56 | <script setup> | 56 | <script setup> |
| 57 | import config from '@/config.js' | 57 | import config from '@/config.js' |
| 58 | import { fillMemberPhoto } from '@/common/utils.js' | ||
| 58 | import { | 59 | import { |
| 59 | ref, | 60 | ref, |
| 60 | getCurrentInstance | 61 | getCurrentInstance |
| ... | @@ -92,12 +93,9 @@ | ... | @@ -92,12 +93,9 @@ |
| 92 | 93 | ||
| 93 | async function getList() { | 94 | async function getList() { |
| 94 | const res = await api.selectPageList(queryParams.value) | 95 | const res = await api.selectPageList(queryParams.value) |
| 95 | list.value = res.rows | 96 | list.value = res.rows || [] |
| 96 | // 处理图片路径 | ||
| 97 | for(var l of list.value){ | 97 | for(var l of list.value){ |
| 98 | if(l.photo&&l.photo.indexOf('http')==-1){ | 98 | l.photo = fillMemberPhoto(l) |
| 99 | l.photo = config.baseUrl_api + l.photo | ||
| 100 | } | ||
| 101 | // 初始化选中状态 | 99 | // 初始化选中状态 |
| 102 | l.checked = false | 100 | l.checked = false |
| 103 | } | 101 | } | ... | ... |
-
Please register or sign in to post a comment