上传图片
Showing
26 changed files
with
1067 additions
and
1203 deletions
| ... | @@ -276,7 +276,7 @@ export function uploadImgCorpPhoto(tempFilePath) { | ... | @@ -276,7 +276,7 @@ export function uploadImgCorpPhoto(tempFilePath) { |
| 276 | title: '加载中' | 276 | title: '加载中' |
| 277 | }); | 277 | }); |
| 278 | return uni.uploadFile({ | 278 | return uni.uploadFile({ |
| 279 | url: config.baseUrl_api + '/upload/uploadImgToLocalServerCaiJian', | 279 | url: config.baseUrl_api + '/fileServer/uploadImgToMinioCaiJian', |
| 280 | header: { | 280 | header: { |
| 281 | 'Authorization': uni.getStorageSync('token'), | 281 | 'Authorization': uni.getStorageSync('token'), |
| 282 | }, | 282 | }, |
| ... | @@ -479,7 +479,7 @@ export function uploadFile(e) { | ... | @@ -479,7 +479,7 @@ export function uploadFile(e) { |
| 479 | title: '加载中' | 479 | title: '加载中' |
| 480 | }); | 480 | }); |
| 481 | return uni.uploadFile({ | 481 | return uni.uploadFile({ |
| 482 | url: config.baseUrl_api + '/upload/uploadFileToLocalServer', | 482 | url: config.baseUrl_api + '/fileServer/uploadFile', |
| 483 | filePath: fileUrl, | 483 | filePath: fileUrl, |
| 484 | name: 'file', | 484 | name: 'file', |
| 485 | header: { | 485 | header: { |
| ... | @@ -487,6 +487,16 @@ export function uploadFile(e) { | ... | @@ -487,6 +487,16 @@ export function uploadFile(e) { |
| 487 | } | 487 | } |
| 488 | }).then(res => { | 488 | }).then(res => { |
| 489 | let data = JSON.parse(res.data); | 489 | let data = JSON.parse(res.data); |
| 490 | if (res.statusCode && (res.statusCode < 200 || res.statusCode >= 300)) { | ||
| 491 | throw new Error(data.msg || '上传失败') | ||
| 492 | } | ||
| 493 | if (data.code && data.code !== 200) { | ||
| 494 | throw new Error(data.msg || '上传失败') | ||
| 495 | } | ||
| 496 | if (data.data) { | ||
| 497 | data.message = data.msg | ||
| 498 | data.msg = data.data | ||
| 499 | } | ||
| 490 | return data | 500 | return data |
| 491 | }).finally(() => { | 501 | }).finally(() => { |
| 492 | uni.hideLoading(); | 502 | uni.hideLoading(); |
| ... | @@ -498,7 +508,7 @@ export function uploadFileList(path) { | ... | @@ -498,7 +508,7 @@ export function uploadFileList(path) { |
| 498 | title: '加载中' | 508 | title: '加载中' |
| 499 | }); | 509 | }); |
| 500 | return uni.uploadFile({ | 510 | return uni.uploadFile({ |
| 501 | url: config.baseUrl_api + '/upload/uploadFileToLocalServer', | 511 | url: config.baseUrl_api + '/fileServer/uploadFile', |
| 502 | filePath: path, | 512 | filePath: path, |
| 503 | name: 'file', | 513 | name: 'file', |
| 504 | header: { | 514 | header: { |
| ... | @@ -506,7 +516,13 @@ export function uploadFileList(path) { | ... | @@ -506,7 +516,13 @@ export function uploadFileList(path) { |
| 506 | } | 516 | } |
| 507 | }).then(res => { | 517 | }).then(res => { |
| 508 | let data = JSON.parse(res.data); | 518 | let data = JSON.parse(res.data); |
| 509 | return data.msg | 519 | if (res.statusCode && (res.statusCode < 200 || res.statusCode >= 300)) { |
| 520 | throw new Error(data.msg || '上传失败') | ||
| 521 | } | ||
| 522 | if (data.code && data.code !== 200) { | ||
| 523 | throw new Error(data.msg || '上传失败') | ||
| 524 | } | ||
| 525 | return data.data || data.msg | ||
| 510 | }).finally(() => { | 526 | }).finally(() => { |
| 511 | uni.hideLoading(); | 527 | uni.hideLoading(); |
| 512 | }); | 528 | }); | ... | ... |
| 1 | import CryptoJS from 'crypto-js' | 1 | import CryptoJS from 'crypto-js' |
| 2 | import config from '@/config.js' | ||
| 2 | export function szToHz(num) { | 3 | export function szToHz(num) { |
| 3 | const hzArr = ['〇', '一', '二', '三', '四', '五', '六', '七', '八', '九', '十'] | 4 | const hzArr = ['〇', '一', '二', '三', '四', '五', '六', '七', '八', '九', '十'] |
| 4 | return hzArr[parseInt(num)] | 5 | return hzArr[parseInt(num)] |
| ... | @@ -38,4 +39,316 @@ export function AESDecrypt(str) { | ... | @@ -38,4 +39,316 @@ export function AESDecrypt(str) { |
| 38 | } catch (e) { | 39 | } catch (e) { |
| 39 | return aesStr | 40 | return aesStr |
| 40 | } | 41 | } |
| 41 | } | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
| 42 | } | ||
| 43 | |||
| 44 | export function isDaoGuanRole() { | ||
| 45 | const app = getApp() | ||
| 46 | const deptType = app.globalData?.deptType | ||
| 47 | const userType = app.globalData?.userType | ||
| 48 | return deptType == null || deptType == 6 || deptType == '6' || userType == '4' | ||
| 49 | } | ||
| 50 | |||
| 51 | export function reLaunchHomeByRole() { | ||
| 52 | uni.reLaunch({ | ||
| 53 | url: isDaoGuanRole() ? '/pages/index/daoGuanPerson' : '/pages/index/home' | ||
| 54 | }) | ||
| 55 | } | ||
| 56 | |||
| 57 | export function fillImgUrl(url, prefix) { | ||
| 58 | if (!url) return '' | ||
| 59 | const trimmedUrl = String(url).trim() | ||
| 60 | if (!trimmedUrl) return '' | ||
| 61 | if (trimmedUrl === 'null' || trimmedUrl === 'undefined') return '' | ||
| 62 | if (trimmedUrl.startsWith('msr:')) { | ||
| 63 | return `${trimBaseUrl(config.baseUrl_api)}/fileServer/download?file=${encodeURIComponent(trimmedUrl)}&downFlag=0` | ||
| 64 | } | ||
| 65 | if (/^(data:|https?:\/\/)/.test(trimmedUrl)) { | ||
| 66 | return trimmedUrl | ||
| 67 | } | ||
| 68 | const baseUrl = prefix | ||
| 69 | ? `${trimBaseUrl(config.baseUrl_api)}/${String(prefix).replace(/^\/+|\/+$/g, '')}` | ||
| 70 | : trimBaseUrl(config.baseUrl_api) | ||
| 71 | const path = trimmedUrl.startsWith('/') ? trimmedUrl : `/${trimmedUrl}` | ||
| 72 | return baseUrl + path | ||
| 73 | } | ||
| 74 | |||
| 75 | export function isImageUrl(url) { | ||
| 76 | const value = String(url || '').trim() | ||
| 77 | if (!value) return false | ||
| 78 | const decodedValue = safeDecodeURIComponent(value) | ||
| 79 | return /\.(png|jpe?g|gif|webp|bmp|svg)(\?.*)?$/i.test(decodedValue) || | ||
| 80 | /[?&]file=[^&]*\.(png|jpe?g|gif|webp|bmp|svg)(&|$)/i.test(decodedValue) | ||
| 81 | } | ||
| 82 | |||
| 83 | export function getMemberPhotoValue(item = {}) { | ||
| 84 | return [item.photo, item.perPhoto, item.photo2, item.perPhoto2].find(isValidUrlValue) || '' | ||
| 85 | } | ||
| 86 | |||
| 87 | export function fillMemberPhoto(item = {}, fallback = '') { | ||
| 88 | const photo = getMemberPhotoValue(item) | ||
| 89 | return photo ? fillImgUrl(photo) : fallback | ||
| 90 | } | ||
| 91 | |||
| 92 | export async function previewAttachment(file, options = {}) { | ||
| 93 | const item = normalizeAttachment(file) | ||
| 94 | const rawUrl = item.rawUrl || item.url | ||
| 95 | const previewUrl = getAttachmentPreviewUrl(rawUrl, 0) | ||
| 96 | if (!previewUrl) { | ||
| 97 | uni.showToast({ | ||
| 98 | title: '暂无可预览附件', | ||
| 99 | icon: 'none' | ||
| 100 | }) | ||
| 101 | return | ||
| 102 | } | ||
| 103 | if (isAttachmentImage(item) || isImageUrl(rawUrl) || isImageUrl(previewUrl)) { | ||
| 104 | const errorMsg = await checkAttachmentError(previewUrl) | ||
| 105 | if (errorMsg) { | ||
| 106 | uni.showToast({ | ||
| 107 | title: errorMsg, | ||
| 108 | icon: 'none' | ||
| 109 | }) | ||
| 110 | return | ||
| 111 | } | ||
| 112 | uni.previewImage({ | ||
| 113 | urls: [previewUrl], | ||
| 114 | current: previewUrl, | ||
| 115 | fail: () => { | ||
| 116 | uni.showToast({ | ||
| 117 | title: '图片预览失败', | ||
| 118 | icon: 'none' | ||
| 119 | }) | ||
| 120 | } | ||
| 121 | }) | ||
| 122 | return | ||
| 123 | } | ||
| 124 | if (getAttachmentExt(item) === 'zip') { | ||
| 125 | uni.showToast({ | ||
| 126 | title: '压缩包暂不支持在线预览', | ||
| 127 | icon: 'none' | ||
| 128 | }) | ||
| 129 | return | ||
| 130 | } | ||
| 131 | openDocumentAttachment(item, getAttachmentPreviewUrl(rawUrl, 0), false, options) | ||
| 132 | } | ||
| 133 | |||
| 134 | export function normalizeAttachment(file) { | ||
| 135 | if (Array.isArray(file)) return normalizeAttachment(file[0]) | ||
| 136 | if (typeof file === 'string') { | ||
| 137 | const parsed = parseAttachmentJson(file) | ||
| 138 | if (parsed !== file) return normalizeAttachment(parsed) | ||
| 139 | return { | ||
| 140 | rawUrl: file, | ||
| 141 | url: file, | ||
| 142 | name: '' | ||
| 143 | } | ||
| 144 | } | ||
| 145 | if (file && typeof file === 'object') { | ||
| 146 | const rawUrl = file.rawUrl || file.url || file.fileUrl || file.path || '' | ||
| 147 | return { | ||
| 148 | ...file, | ||
| 149 | rawUrl, | ||
| 150 | url: rawUrl | ||
| 151 | } | ||
| 152 | } | ||
| 153 | return {} | ||
| 154 | } | ||
| 155 | |||
| 156 | export function parseAttachmentJson(value) { | ||
| 157 | if (!value || typeof value !== 'string') return value | ||
| 158 | try { | ||
| 159 | return JSON.parse(value) | ||
| 160 | } catch (e) { | ||
| 161 | return value | ||
| 162 | } | ||
| 163 | } | ||
| 164 | |||
| 165 | export function getAttachmentPreviewUrl(url, downFlag = 0) { | ||
| 166 | if (!url) return '' | ||
| 167 | const value = String(url).trim() | ||
| 168 | if (!value || value === 'null' || value === 'undefined') return '' | ||
| 169 | if (value.startsWith('msr:')) { | ||
| 170 | return `${trimBaseUrl(config.baseUrl_api)}/fileServer/download?file=${encodeURIComponent(value)}&downFlag=${downFlag}` | ||
| 171 | } | ||
| 172 | return fillImgUrl(value) | ||
| 173 | } | ||
| 174 | |||
| 175 | function openDocumentAttachment(item, url, retried = false, options = {}) { | ||
| 176 | if (!url) { | ||
| 177 | uni.showToast({ | ||
| 178 | title: '文件下载失败', | ||
| 179 | icon: 'none' | ||
| 180 | }) | ||
| 181 | return | ||
| 182 | } | ||
| 183 | uni.showLoading({ | ||
| 184 | title: '打开中', | ||
| 185 | mask: true | ||
| 186 | }) | ||
| 187 | uni.downloadFile({ | ||
| 188 | url, | ||
| 189 | header: { | ||
| 190 | Authorization: uni.getStorageSync('token') | ||
| 191 | }, | ||
| 192 | success: res => { | ||
| 193 | if (res.statusCode && res.statusCode !== 200) { | ||
| 194 | if ((res.statusCode === 301 || res.statusCode === 302) && !retried) { | ||
| 195 | const redirectUrl = getRedirectUrl(res.header) | ||
| 196 | uni.hideLoading() | ||
| 197 | if (redirectUrl) { | ||
| 198 | openDocumentAttachment(item, redirectUrl, true, options) | ||
| 199 | } else { | ||
| 200 | uni.showToast({ | ||
| 201 | title: '文件下载失败', | ||
| 202 | icon: 'none' | ||
| 203 | }) | ||
| 204 | } | ||
| 205 | return | ||
| 206 | } | ||
| 207 | showAttachmentFailToast(url, '文件下载失败') | ||
| 208 | return | ||
| 209 | } | ||
| 210 | uni.openDocument({ | ||
| 211 | filePath: res.tempFilePath, | ||
| 212 | fileType: getDocumentFileType(item), | ||
| 213 | showMenu: true, | ||
| 214 | fail: () => { | ||
| 215 | uni.showToast({ | ||
| 216 | title: '文件暂不支持预览', | ||
| 217 | icon: 'none' | ||
| 218 | }) | ||
| 219 | } | ||
| 220 | }) | ||
| 221 | }, | ||
| 222 | fail: () => { | ||
| 223 | showAttachmentFailToast(url, '文件下载失败') | ||
| 224 | }, | ||
| 225 | complete: () => { | ||
| 226 | uni.hideLoading() | ||
| 227 | } | ||
| 228 | }) | ||
| 229 | } | ||
| 230 | |||
| 231 | function openAttachmentWebView(url, title = '附件预览') { | ||
| 232 | if (!url) { | ||
| 233 | uni.showToast({ | ||
| 234 | title: '文件下载失败', | ||
| 235 | icon: 'none' | ||
| 236 | }) | ||
| 237 | return | ||
| 238 | } | ||
| 239 | uni.navigateTo({ | ||
| 240 | url: `/pages/webview/webview?title=${encodeURIComponent(title)}&url=${encodeURIComponent(url)}`, | ||
| 241 | fail: () => { | ||
| 242 | uni.showToast({ | ||
| 243 | title: '附件预览失败', | ||
| 244 | icon: 'none' | ||
| 245 | }) | ||
| 246 | } | ||
| 247 | }) | ||
| 248 | } | ||
| 249 | |||
| 250 | function getAttachmentExt(file) { | ||
| 251 | const name = `${file?.extname || file?.name || file?.rawUrl || file?.url || file || ''}` | ||
| 252 | const fileParam = getQueryParam(name, 'file') | ||
| 253 | const cleanName = safeDecodeURIComponent(fileParam || name).split('?')[0].split('#')[0] | ||
| 254 | const fileName = cleanName.split('/').pop() || cleanName | ||
| 255 | const ext = fileName.includes('.') ? fileName.split('.').pop() : fileName | ||
| 256 | return ext.toLowerCase() | ||
| 257 | } | ||
| 258 | |||
| 259 | function checkAttachmentError(url) { | ||
| 260 | if (!isFileDownloadUrl(url)) return Promise.resolve('') | ||
| 261 | return new Promise(resolve => { | ||
| 262 | uni.request({ | ||
| 263 | url, | ||
| 264 | method: 'GET', | ||
| 265 | header: { | ||
| 266 | Authorization: uni.getStorageSync('token') || '' | ||
| 267 | }, | ||
| 268 | success: res => { | ||
| 269 | const data = parseAttachmentResponse(res.data) | ||
| 270 | if (res.statusCode >= 400 || (data && data.code && data.code !== 200)) { | ||
| 271 | resolve(getAttachmentErrorMsg(data)) | ||
| 272 | return | ||
| 273 | } | ||
| 274 | resolve('') | ||
| 275 | }, | ||
| 276 | fail: () => resolve('') | ||
| 277 | }) | ||
| 278 | }) | ||
| 279 | } | ||
| 280 | |||
| 281 | async function showAttachmentFailToast(url, fallback) { | ||
| 282 | const errorMsg = await checkAttachmentError(url) | ||
| 283 | uni.showToast({ | ||
| 284 | title: errorMsg || fallback, | ||
| 285 | icon: 'none' | ||
| 286 | }) | ||
| 287 | } | ||
| 288 | |||
| 289 | function parseAttachmentResponse(data) { | ||
| 290 | if (!data) return null | ||
| 291 | if (typeof data === 'object') return data | ||
| 292 | if (typeof data === 'string') { | ||
| 293 | try { | ||
| 294 | return JSON.parse(data) | ||
| 295 | } catch (e) { | ||
| 296 | return null | ||
| 297 | } | ||
| 298 | } | ||
| 299 | return null | ||
| 300 | } | ||
| 301 | |||
| 302 | function getAttachmentErrorMsg(data) { | ||
| 303 | const msg = data?.msg || data?.message || '' | ||
| 304 | if (!msg) return '附件预览失败' | ||
| 305 | if (msg.includes('Hostname') || msg.includes('certificate')) { | ||
| 306 | return '附件服务证书异常,请稍后再试' | ||
| 307 | } | ||
| 308 | return msg.length > 40 ? msg.slice(0, 40) : msg | ||
| 309 | } | ||
| 310 | |||
| 311 | function isAttachmentImage(file) { | ||
| 312 | return ['png', 'jpg', 'jpeg', 'gif', 'bmp', 'webp', 'svg'].includes(getAttachmentExt(file)) | ||
| 313 | } | ||
| 314 | |||
| 315 | function getDocumentFileType(file) { | ||
| 316 | const ext = getAttachmentExt(file) | ||
| 317 | const types = ['doc', 'docx', 'xls', 'xlsx', 'ppt', 'pptx', 'pdf'] | ||
| 318 | return types.includes(ext) ? ext : undefined | ||
| 319 | } | ||
| 320 | |||
| 321 | function getRedirectUrl(header = {}) { | ||
| 322 | const location = header.Location || header.location | ||
| 323 | if (!location) return '' | ||
| 324 | if (/^https?:\/\//.test(location)) return location | ||
| 325 | return `${trimBaseUrl(config.baseUrl_api)}/${String(location).replace(/^\/+/, '')}` | ||
| 326 | } | ||
| 327 | |||
| 328 | function isFileDownloadUrl(url) { | ||
| 329 | const value = String(url || '') | ||
| 330 | return value.includes('/fileServer/download') || value.startsWith('fileServer/download') | ||
| 331 | } | ||
| 332 | |||
| 333 | function getQueryParam(url, key) { | ||
| 334 | const match = String(url || '').match(new RegExp(`[?&]${key}=([^&#]+)`)) | ||
| 335 | return match ? safeDecodeURIComponent(match[1]) : '' | ||
| 336 | } | ||
| 337 | |||
| 338 | function isValidUrlValue(value) { | ||
| 339 | if (value === undefined || value === null) return false | ||
| 340 | const url = String(value).trim() | ||
| 341 | return url !== '' && url !== 'null' && url !== 'undefined' | ||
| 342 | } | ||
| 343 | |||
| 344 | function trimBaseUrl(url) { | ||
| 345 | return String(url || '').replace(/\/+$/, '') | ||
| 346 | } | ||
| 347 | |||
| 348 | function safeDecodeURIComponent(value) { | ||
| 349 | try { | ||
| 350 | return decodeURIComponent(value) | ||
| 351 | } catch (e) { | ||
| 352 | return value | ||
| 353 | } | ||
| 354 | } | ... | ... |
| ... | @@ -7,7 +7,8 @@ | ... | @@ -7,7 +7,8 @@ |
| 7 | // const baseUrl_api = "https://ztx.itechtop.cn:8443/stage-api"; | 7 | // const baseUrl_api = "https://ztx.itechtop.cn:8443/stage-api"; |
| 8 | // const baseUrl_api = 'http://192.168.1.132:8787' | 8 | // const baseUrl_api = 'http://192.168.1.132:8787' |
| 9 | // const baseUrl_api = 'https://tkcn.19wk.cn:8443/stage-api' | 9 | // const baseUrl_api = 'https://tkcn.19wk.cn:8443/stage-api' |
| 10 | const baseUrl_api = 'https://tk001.wxjylt.com/stage-api' | 10 | const baseUrl_api = 'https://tk001.wxjylt.com/stage-api' //测试环境 |
| 11 | // const baseUrl_api = 'https://system.taekwondo.org.cn/stage-api' //会员生产 | ||
| 11 | // const baseUrl_api = 'https://system.taekwondo.org.cn/stage-api' | 12 | // const baseUrl_api = 'https://system.taekwondo.org.cn/stage-api' |
| 12 | export default { | 13 | export default { |
| 13 | baseUrl_api | 14 | baseUrl_api | ... | ... |
| ... | @@ -64,10 +64,10 @@ | ... | @@ -64,10 +64,10 @@ |
| 64 | </view> | 64 | </view> |
| 65 | <view v-if="deptType == 1" @click.stop="viewSettleFile(item.doc)"> | 65 | <view v-if="deptType == 1" @click.stop="viewSettleFile(item.doc)"> |
| 66 | 缴费状态 | 66 | 缴费状态 |
| 67 | <view> | 67 | <view> |
| 68 | <text v-if="item.doc?.settleFlag==0" class="text-warning">已结算</text> | 68 | <text v-if="item.doc?.settleFlag==0" class="text-warning">已结算</text> |
| 69 | <text v-if="item.doc?.settleFlag==1&&item.doc.payFlag==0" class="text-success">已上传</text> | 69 | <text v-if="item.doc?.settleFlag==1&&item.doc.payFlag==0" class="text-success">已上传</text> |
| 70 | <text v-if="item.doc?.settleFlag==1&&item.doc.payFlag==1" class="text-danger">未上传</text> | 70 | <text v-if="item.doc?.settleFlag==1&&item.doc.payFlag==1" class="text-danger">未上传</text> |
| 71 | </view> | 71 | </view> |
| 72 | </view> | 72 | </view> |
| 73 | </view> | 73 | </view> |
| ... | @@ -111,6 +111,7 @@ | ... | @@ -111,6 +111,7 @@ |
| 111 | <script setup> | 111 | <script setup> |
| 112 | import * as api from '@/common/api.js' | 112 | import * as api from '@/common/api.js' |
| 113 | import config from '@/config.js' | 113 | import config from '@/config.js' |
| 114 | import { fillImgUrl } from '@/common/utils.js' | ||
| 114 | import { | 115 | import { |
| 115 | onMounted, | 116 | onMounted, |
| 116 | ref | 117 | ref |
| ... | @@ -157,7 +158,7 @@ | ... | @@ -157,7 +158,7 @@ |
| 157 | 158 | ||
| 158 | function getList() { | 159 | function getList() { |
| 159 | uni.showLoading({ | 160 | uni.showLoading({ |
| 160 | title: '加载中', | 161 | title: '加载中', |
| 161 | mask: true | 162 | mask: true |
| 162 | }) | 163 | }) |
| 163 | if (deptType.value == 2 || deptType.value == 3) { | 164 | if (deptType.value == 2 || deptType.value == 3) { |
| ... | @@ -173,9 +174,9 @@ | ... | @@ -173,9 +174,9 @@ |
| 173 | uni.hideLoading() | 174 | uni.hideLoading() |
| 174 | list.value = res.rows | 175 | list.value = res.rows |
| 175 | list.value.forEach(item => { | 176 | list.value.forEach(item => { |
| 176 | item.content = JSON.parse(item.content) | 177 | item.content = JSON.parse(item.content) |
| 177 | if(item.doc){ | 178 | if(item.doc){ |
| 178 | item.doc = JSON.parse(item.doc) | 179 | item.doc = JSON.parse(item.doc) |
| 179 | } | 180 | } |
| 180 | totalCost.value = totalCost.value + (item.content.allFee * 1) | 181 | totalCost.value = totalCost.value + (item.content.allFee * 1) |
| 181 | }) | 182 | }) |
| ... | @@ -224,12 +225,12 @@ | ... | @@ -224,12 +225,12 @@ |
| 224 | recordIds: [] | 225 | recordIds: [] |
| 225 | } | 226 | } |
| 226 | obj.recordIds.push(recordId) | 227 | obj.recordIds.push(recordId) |
| 227 | console.log(obj) | 228 | console.log(obj) |
| 228 | uni.showLoading({ | 229 | uni.showLoading({ |
| 229 | title: '加载中', | 230 | title: '加载中', |
| 230 | mask: true | 231 | mask: true |
| 231 | }) | 232 | }) |
| 232 | api.groupAudit(obj).then((res) => { | 233 | api.groupAudit(obj).then((res) => { |
| 233 | uni.hideLoading() | 234 | uni.hideLoading() |
| 234 | uni.showToast({ | 235 | uni.showToast({ |
| 235 | title: '操作成功', | 236 | title: '操作成功', |
| ... | @@ -298,80 +299,76 @@ | ... | @@ -298,80 +299,76 @@ |
| 298 | uni.navigateTo({ | 299 | uni.navigateTo({ |
| 299 | url: `/group/groupInfo?memId=${row.content?.memId}` | 300 | url: `/group/groupInfo?memId=${row.content?.memId}` |
| 300 | }) | 301 | }) |
| 301 | } | 302 | } |
| 302 | 303 | ||
| 303 | function viewSettleFile(doc){ | 304 | function viewSettleFile(doc){ |
| 304 | let url | 305 | let url |
| 305 | if(doc.payEvidence){ | 306 | if(doc.payEvidence){ |
| 306 | url = JSON.parse(doc.payEvidence)[0].url || null | 307 | url = JSON.parse(doc.payEvidence)[0].url || null |
| 307 | console.log(url) | 308 | console.log(url) |
| 308 | if(url){showImg(url)} | 309 | if(url){showImg(url)} |
| 309 | } | 310 | } |
| 310 | } | 311 | } |
| 311 | function showImg(n) { | 312 | function showImg(n) { |
| 312 | var str = '' | 313 | var str = '' |
| 313 | if(n.indexOf('http')==-1){ | 314 | str = fillImgUrl(n) |
| 314 | str = config.baseUrl_api + n | 315 | |
| 315 | } else { | 316 | if (n.indexOf('png') > -1 || n.indexOf('jpg') > -1 || n.indexOf( |
| 316 | str = n | 317 | 'jpeg') > -1) { |
| 317 | } | 318 | uni.previewImage({ |
| 318 | 319 | urls: [str], | |
| 319 | if (n.indexOf('png') > -1 || n.indexOf('jpg') > -1 || n.indexOf( | 320 | success: function(res) { |
| 320 | 'jpeg') > -1) { | 321 | console.log('success', res) |
| 321 | uni.previewImage({ | 322 | }, |
| 322 | urls: [str], | 323 | fail: function(res) { |
| 323 | success: function(res) { | 324 | console.log('fail', res) |
| 324 | console.log('success', res) | 325 | }, |
| 325 | }, | 326 | complete: function(res) { |
| 326 | fail: function(res) { | 327 | console.log('complete', res) |
| 327 | console.log('fail', res) | 328 | } |
| 328 | }, | 329 | }) |
| 329 | complete: function(res) { | 330 | } else { |
| 330 | console.log('complete', res) | 331 | goWebView(str) |
| 331 | } | 332 | } |
| 332 | }) | 333 | } |
| 333 | } else { | 334 | function goWebView(url) { |
| 334 | goWebView(str) | 335 | url = url.replace("http://", "https://") |
| 335 | } | 336 | uni.showLoading({ |
| 336 | } | 337 | title: '下载中' |
| 337 | function goWebView(url) { | 338 | }); |
| 338 | url = url.replace("http://", "https://") | 339 | uni.downloadFile({ |
| 339 | uni.showLoading({ | 340 | url: url, |
| 340 | title: '下载中' | 341 | success: function(res) { |
| 341 | }); | 342 | uni.hideLoading(); |
| 342 | uni.downloadFile({ | 343 | var filePath = res.tempFilePath; |
| 343 | url: url, | 344 | uni.showLoading({ |
| 344 | success: function(res) { | 345 | title: '正在打开' |
| 345 | uni.hideLoading(); | 346 | }); |
| 346 | var filePath = res.tempFilePath; | 347 | uni.openDocument({ |
| 347 | uni.showLoading({ | 348 | filePath: filePath, |
| 348 | title: '正在打开' | 349 | showMenu: true, |
| 349 | }); | 350 | success: function(res) { |
| 350 | uni.openDocument({ | 351 | uni.hideLoading(); |
| 351 | filePath: filePath, | 352 | }, |
| 352 | showMenu: true, | 353 | fail: function(err) { |
| 353 | success: function(res) { | 354 | uni.hideLoading(); |
| 354 | uni.hideLoading(); | 355 | uni.showToast({ |
| 355 | }, | 356 | title: err, |
| 356 | fail: function(err) { | 357 | icon: 'none', |
| 357 | uni.hideLoading(); | 358 | duration: 2000 |
| 358 | uni.showToast({ | 359 | }); |
| 359 | title: err, | 360 | } |
| 360 | icon: 'none', | 361 | }); |
| 361 | duration: 2000 | 362 | }, |
| 362 | }); | 363 | fail: function(error) { |
| 363 | } | 364 | uni.hideLoading(); |
| 364 | }); | 365 | uni.showToast({ |
| 365 | }, | 366 | title: `下载失败`, |
| 366 | fail: function(error) { | 367 | icon: 'none', |
| 367 | uni.hideLoading(); | 368 | duration: 2000 |
| 368 | uni.showToast({ | 369 | }); |
| 369 | title: `下载失败`, | 370 | } |
| 370 | icon: 'none', | 371 | }); |
| 371 | duration: 2000 | ||
| 372 | }); | ||
| 373 | } | ||
| 374 | }); | ||
| 375 | } | 372 | } |
| 376 | </script> | 373 | </script> |
| 377 | 374 | ... | ... |
| ... | @@ -2,18 +2,18 @@ | ... | @@ -2,18 +2,18 @@ |
| 2 | <view> | 2 | <view> |
| 3 | <uni-collapse> | 3 | <uni-collapse> |
| 4 | <uni-collapse-item :title="n.newName" v-for="n in list" :key="n.id" open> | 4 | <uni-collapse-item :title="n.newName" v-for="n in list" :key="n.id" open> |
| 5 | <view class="collapseBody"> | 5 | <view class="collapseBody"> |
| 6 | <view> | 6 | <view> |
| 7 | <label>会员编号:</label> | 7 | <label>会员编号:</label> |
| 8 | <text>{{n.memCode}}</text> | 8 | <text>{{n.memCode}}</text> |
| 9 | </view> | 9 | </view> |
| 10 | <view> | 10 | <view> |
| 11 | <label>团体会员名称:</label> | 11 | <label>团体会员名称:</label> |
| 12 | <view> | 12 | <view> |
| 13 | {{n.oldName}} | 13 | {{n.oldName}} |
| 14 | <text class="text-primary" v-if="n.oldName!=n.newName">变更为 </text> | 14 | <text class="text-primary" v-if="n.oldName!=n.newName">变更为 </text> |
| 15 | <text class="text-danger" v-if="n.oldName!=n.newName">{{ n.newName }}</text> | 15 | <text class="text-danger" v-if="n.oldName!=n.newName">{{ n.newName }}</text> |
| 16 | 16 | ||
| 17 | </view> | 17 | </view> |
| 18 | </view> | 18 | </view> |
| 19 | 19 | ||
| ... | @@ -39,7 +39,7 @@ | ... | @@ -39,7 +39,7 @@ |
| 39 | onLoad | 39 | onLoad |
| 40 | } from '@dcloudio/uni-app' | 40 | } from '@dcloudio/uni-app' |
| 41 | import * as api from '@/common/api.js' | 41 | import * as api from '@/common/api.js' |
| 42 | import config from '@/config.js' | 42 | import { parseAttachmentJson, previewAttachment } from '@/common/utils.js' |
| 43 | const queryParams = ref({}) | 43 | const queryParams = ref({}) |
| 44 | const total = ref(0) | 44 | const total = ref(0) |
| 45 | const list = ref([]) | 45 | const list = ref([]) |
| ... | @@ -60,7 +60,7 @@ | ... | @@ -60,7 +60,7 @@ |
| 60 | api.getChangeGroupByRangeId(queryParams.value).then(res => { | 60 | api.getChangeGroupByRangeId(queryParams.value).then(res => { |
| 61 | list.value = res.rows | 61 | list.value = res.rows |
| 62 | list.value.forEach(item => { | 62 | list.value.forEach(item => { |
| 63 | item.fileUrl = JSON.parse(item.fileUrl) | 63 | item.fileUrl = parseAttachmentJson(item.fileUrl) |
| 64 | }) | 64 | }) |
| 65 | total.value = res.total | 65 | total.value = res.total |
| 66 | uni.hideLoading() | 66 | uni.hideLoading() |
| ... | @@ -68,64 +68,7 @@ | ... | @@ -68,64 +68,7 @@ |
| 68 | } | 68 | } |
| 69 | 69 | ||
| 70 | function showImg(n) { | 70 | function showImg(n) { |
| 71 | var str = config.baseUrl_api + n.fileUrl[0]?.url | 71 | previewAttachment(n.fileUrl, { title: '查看附件' }) |
| 72 | if (n.fileUrl[0]?.url.indexOf('png') > -1 || n.fileUrl[0]?.url.indexOf('jpg') > -1 || n.fileUrl[0]?.url.indexOf( | ||
| 73 | 'jpeg') > -1) { | ||
| 74 | uni.previewImage({ | ||
| 75 | urls: [str], | ||
| 76 | success: function(res) { | ||
| 77 | console.log('success', res) | ||
| 78 | }, | ||
| 79 | fail: function(res) { | ||
| 80 | console.log('fail', res) | ||
| 81 | }, | ||
| 82 | complete: function(res) { | ||
| 83 | console.log('complete', res) | ||
| 84 | } | ||
| 85 | }) | ||
| 86 | } else { | ||
| 87 | goWebView(str) | ||
| 88 | } | ||
| 89 | } | ||
| 90 | |||
| 91 | function goWebView(url) { | ||
| 92 | url = url.replace("http://", "https://") | ||
| 93 | uni.showLoading({ | ||
| 94 | title: '下载中' | ||
| 95 | }); | ||
| 96 | uni.downloadFile({ | ||
| 97 | url: url, | ||
| 98 | success: function(res) { | ||
| 99 | uni.hideLoading(); | ||
| 100 | var filePath = res.tempFilePath; | ||
| 101 | uni.showLoading({ | ||
| 102 | title: '正在打开' | ||
| 103 | }); | ||
| 104 | uni.openDocument({ | ||
| 105 | filePath: filePath, | ||
| 106 | showMenu: true, | ||
| 107 | success: function(res) { | ||
| 108 | uni.hideLoading(); | ||
| 109 | }, | ||
| 110 | fail: function(err) { | ||
| 111 | uni.hideLoading(); | ||
| 112 | uni.showToast({ | ||
| 113 | title: err, | ||
| 114 | icon: 'none', | ||
| 115 | duration: 2000 | ||
| 116 | }); | ||
| 117 | } | ||
| 118 | }); | ||
| 119 | }, | ||
| 120 | fail: function(error) { | ||
| 121 | uni.hideLoading(); | ||
| 122 | uni.showToast({ | ||
| 123 | title: `下载失败`, | ||
| 124 | icon: 'none', | ||
| 125 | duration: 2000 | ||
| 126 | }); | ||
| 127 | } | ||
| 128 | }); | ||
| 129 | } | 72 | } |
| 130 | </script> | 73 | </script> |
| 131 | <style scoped lang="scss"> | 74 | <style scoped lang="scss"> |
| ... | @@ -153,7 +96,7 @@ | ... | @@ -153,7 +96,7 @@ |
| 153 | color: #999; | 96 | color: #999; |
| 154 | display: inline-block; | 97 | display: inline-block; |
| 155 | text-align: right;flex:0 0 auto; | 98 | text-align: right;flex:0 0 auto; |
| 156 | } | 99 | } |
| 157 | view{flex:1 1 auto;} | 100 | view{flex:1 1 auto;} |
| 158 | } | 101 | } |
| 159 | } | 102 | } |
| ... | @@ -162,4 +105,4 @@ | ... | @@ -162,4 +105,4 @@ |
| 162 | background: #fff; | 105 | background: #fff; |
| 163 | padding: 30rpx; | 106 | padding: 30rpx; |
| 164 | } | 107 | } |
| 165 | </style> | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
| 108 | </style> | ... | ... |
| 1 | <template> | 1 | <template> |
| 2 | <view> | 2 | <view> |
| 3 | <z-paging ref="paging" v-model="list" @query="getQuery" emptyViewImg="/static/nodata.png"> | 3 | <z-paging ref="paging" v-model="list" @query="getQuery" emptyViewImg="/static/nodata.png"> |
| 4 | 4 | ||
| 5 | <!-- 机构会员 --> | 5 | <!-- 机构会员 --> |
| 6 | <view class="searchbar" :slot="top"> | 6 | <view class="searchbar" :slot="top"> |
| 7 | <uni-easyinput placeholderStyle="font-size:30rpx" :input-border="false" prefixIcon="search" | 7 | <uni-easyinput placeholderStyle="font-size:30rpx" :input-border="false" prefixIcon="search" |
| 8 | v-model="queryParams.name" placeholder="搜索会员名称" @blur="getList" @clear="getList"> | 8 | v-model="queryParams.name" placeholder="搜索会员名称" @blur="getList" @clear="getList"> |
| 9 | </uni-easyinput> | 9 | </uni-easyinput> |
| 10 | </view> | 10 | </view> |
| 11 | <view class="wBox"> | 11 | <view class="wBox"> |
| 12 | <!-- 成员 --> | 12 | <!-- 成员 --> |
| 13 | <view class="userlist"> | 13 | <view class="userlist"> |
| 14 | <view class="item" v-for="(n,index) in list" :key="index" @click="goDetail(n)"> | 14 | <view class="item" v-for="(n,index) in list" :key="index" @click="goDetail(n)"> |
| 15 | <view class="photobox"> | 15 | <view class="photobox"> |
| 16 | <image class="photo" v-if="n.photo" :src="n.photo" mode='aspectFill'></image> | 16 | <image class="photo" v-if="n.photo" :src="n.photo" mode='aspectFill'></image> |
| 17 | 17 | ||
| 18 | <view class="colorful" v-else>{{n.name?.slice(0,1)}}</view> | 18 | <view class="colorful" v-else>{{n.name?.slice(0,1)}}</view> |
| 19 | </view> | 19 | </view> |
| ... | @@ -30,13 +30,14 @@ | ... | @@ -30,13 +30,14 @@ |
| 30 | </view> | 30 | </view> |
| 31 | 31 | ||
| 32 | </view> | 32 | </view> |
| 33 | </z-paging> | 33 | </z-paging> |
| 34 | </view> | 34 | </view> |
| 35 | </template> | 35 | </template> |
| 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 config from '@/config.js' |
| 40 | import { fillImgUrl } from '@/common/utils.js' | ||
| 40 | import { | 41 | import { |
| 41 | ref, | 42 | ref, |
| 42 | getCurrentInstance | 43 | getCurrentInstance |
| ... | @@ -47,8 +48,8 @@ | ... | @@ -47,8 +48,8 @@ |
| 47 | const { | 48 | const { |
| 48 | proxy | 49 | proxy |
| 49 | } = getCurrentInstance() | 50 | } = getCurrentInstance() |
| 50 | const app = getApp(); | 51 | const app = getApp(); |
| 51 | 52 | ||
| 52 | const paging = ref(null) | 53 | const paging = ref(null) |
| 53 | const queryParams = ref({ | 54 | const queryParams = ref({ |
| 54 | sonDeptId: 1, | 55 | sonDeptId: 1, |
| ... | @@ -65,39 +66,35 @@ | ... | @@ -65,39 +66,35 @@ |
| 65 | queryParams.value.sonDeptId = option.deptId | 66 | queryParams.value.sonDeptId = option.deptId |
| 66 | getList() | 67 | getList() |
| 67 | }) | 68 | }) |
| 68 | function getQuery(pageNum,pageSize) { | 69 | function getQuery(pageNum,pageSize) { |
| 69 | queryParams.value.pageNum = pageNum | 70 | queryParams.value.pageNum = pageNum |
| 70 | queryParams.value.pageSize = pageSize | 71 | queryParams.value.pageSize = pageSize |
| 71 | api.selectPageList(queryParams.value).then(res => { | 72 | api.selectPageList(queryParams.value).then(res => { |
| 72 | paging.value.complete(res.rows) | 73 | paging.value.complete(res.rows) |
| 73 | list.value = res.rows | 74 | list.value = res.rows |
| 74 | for(var l of list.value){ | 75 | for(var l of list.value){ |
| 75 | if(l.photo&&l.photo.indexOf('http')==-1){ | 76 | l.photo = fillImgUrl(l.photo) |
| 76 | l.photo = config.baseUrl_api + l.photo | 77 | } |
| 77 | } | ||
| 78 | } | ||
| 79 | }) | 78 | }) |
| 80 | } | 79 | } |
| 81 | function getList() { | 80 | function getList() { |
| 82 | uni.showLoading({ | 81 | uni.showLoading({ |
| 83 | title:"加载中" | 82 | title:"加载中" |
| 84 | }) | 83 | }) |
| 85 | api.selectPageList(queryParams.value).then(res => { | 84 | api.selectPageList(queryParams.value).then(res => { |
| 86 | uni.hideLoading() | 85 | uni.hideLoading() |
| 87 | paging.value.complete(res.rows); | 86 | paging.value.complete(res.rows); |
| 88 | list.value = res.rows | 87 | list.value = res.rows |
| 89 | for(var l of list.value){ | 88 | for(var l of list.value){ |
| 90 | if(l.photo&&l.photo.indexOf('http')==-1){ | 89 | l.photo = fillImgUrl(l.photo) |
| 91 | l.photo = config.baseUrl_api + l.photo | ||
| 92 | } | ||
| 93 | } | 90 | } |
| 94 | total.value = res.total | 91 | total.value = res.total |
| 95 | }) | 92 | }) |
| 96 | } | 93 | } |
| 97 | function goDetail(n){ | 94 | function goDetail(n){ |
| 98 | uni.navigateTo({ | 95 | uni.navigateTo({ |
| 99 | url: `/personalVip/detail?perId=${n.perId}` | 96 | url: `/personalVip/detail?perId=${n.perId}` |
| 100 | }) | 97 | }) |
| 101 | } | 98 | } |
| 102 | </script> | 99 | </script> |
| 103 | 100 | ||
| ... | @@ -107,21 +104,21 @@ | ... | @@ -107,21 +104,21 @@ |
| 107 | right: 20rpx; | 104 | right: 20rpx; |
| 108 | font-size: 26rpx; | 105 | font-size: 26rpx; |
| 109 | color: #999; | 106 | color: #999; |
| 110 | } | 107 | } |
| 111 | .searchbar { | 108 | .searchbar { |
| 112 | display: flex; | 109 | display: flex; |
| 113 | align-items: center; | 110 | align-items: center; |
| 114 | padding: 25rpx; | 111 | padding: 25rpx; |
| 115 | box-sizing: border-box; | 112 | box-sizing: border-box; |
| 116 | 113 | ||
| 117 | :deep(.uni-easyinput .uni-easyinput__content) { | 114 | :deep(.uni-easyinput .uni-easyinput__content) { |
| 118 | border-radius: 35rpx; | 115 | border-radius: 35rpx; |
| 119 | border: none; | 116 | border: none; |
| 120 | height: 70rpx; | 117 | height: 70rpx; |
| 121 | } | 118 | } |
| 122 | 119 | ||
| 123 | :deep(.uni-easyinput__content-input) { | 120 | :deep(.uni-easyinput__content-input) { |
| 124 | font-size: 26rpx; | 121 | font-size: 26rpx; |
| 125 | } | 122 | } |
| 126 | } | 123 | } |
| 127 | </style> | 124 | </style> |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| ... | @@ -61,7 +61,7 @@ | ... | @@ -61,7 +61,7 @@ |
| 61 | </view> | 61 | </view> |
| 62 | </view> | 62 | </view> |
| 63 | <view class="nodata" v-if="list.length==0"> | 63 | <view class="nodata" v-if="list.length==0"> |
| 64 | <image mode="aspectFit" src="/static/nodata.png"></image> | 64 | <image mode="aspectFit" :src="config.baseUrl_api + '/fs/static/nodata.png'"></image> |
| 65 | <text>暂无数据</text> | 65 | <text>暂无数据</text> |
| 66 | </view> | 66 | </view> |
| 67 | 67 | ||
| ... | @@ -90,8 +90,9 @@ | ... | @@ -90,8 +90,9 @@ |
| 90 | </template> | 90 | </template> |
| 91 | 91 | ||
| 92 | <script setup> | 92 | <script setup> |
| 93 | import * as api from '@/common/api.js' | 93 | import * as api from '@/common/api.js' |
| 94 | import config from '@/config.js' | 94 | import config from '@/config.js' |
| 95 | import { previewAttachment } from '@/common/utils.js' | ||
| 95 | import { | 96 | import { |
| 96 | onMounted, | 97 | onMounted, |
| 97 | ref | 98 | ref |
| ... | @@ -212,71 +213,12 @@ function goDetail(item) { | ... | @@ -212,71 +213,12 @@ function goDetail(item) { |
| 212 | }); | 213 | }); |
| 213 | } | 214 | } |
| 214 | 215 | ||
| 215 | function downloadOrder(item) { | 216 | function downloadOrder(item) { |
| 216 | //下载凭证 | 217 | //下载凭证 |
| 217 | showImg(item.payEvidence[0]?.url) | 218 | previewAttachment(item.payEvidence?.[0] || item.payEvidence, { title: '查看凭证' }) |
| 218 | } | 219 | } |
| 219 | function showImg(url) { | 220 | |
| 220 | var str = config.baseUrl_api + url | 221 | </script> |
| 221 | if (url.indexOf('png') > -1 || url.indexOf('jpg') > -1 || url.indexOf('jpeg') > -1) { | ||
| 222 | uni.previewImage({ | ||
| 223 | urls: [str], | ||
| 224 | success: function(res) { | ||
| 225 | console.log('success', res) | ||
| 226 | }, | ||
| 227 | fail: function(res) { | ||
| 228 | console.log('fail', res) | ||
| 229 | }, | ||
| 230 | complete: function(res) { | ||
| 231 | console.log('complete', res) | ||
| 232 | } | ||
| 233 | }) | ||
| 234 | } else { | ||
| 235 | goWebView(str) | ||
| 236 | } | ||
| 237 | } | ||
| 238 | |||
| 239 | function goWebView(url) { | ||
| 240 | url = url.replace("http://", "https://") | ||
| 241 | uni.showLoading({ | ||
| 242 | title: '下载中' | ||
| 243 | }); | ||
| 244 | uni.downloadFile({ | ||
| 245 | url: url, | ||
| 246 | success: function(res) { | ||
| 247 | uni.hideLoading(); | ||
| 248 | var filePath = res.tempFilePath; | ||
| 249 | uni.showLoading({ | ||
| 250 | title: '正在打开' | ||
| 251 | }); | ||
| 252 | uni.openDocument({ | ||
| 253 | filePath: filePath, | ||
| 254 | showMenu: true, | ||
| 255 | success: function(res) { | ||
| 256 | uni.hideLoading(); | ||
| 257 | }, | ||
| 258 | fail: function(err) { | ||
| 259 | uni.hideLoading(); | ||
| 260 | uni.showToast({ | ||
| 261 | title: err, | ||
| 262 | icon: 'none', | ||
| 263 | duration: 2000 | ||
| 264 | }); | ||
| 265 | } | ||
| 266 | }); | ||
| 267 | }, | ||
| 268 | fail: function(error) { | ||
| 269 | uni.hideLoading(); | ||
| 270 | uni.showToast({ | ||
| 271 | title: `下载失败`, | ||
| 272 | icon: 'none', | ||
| 273 | duration: 2000 | ||
| 274 | }); | ||
| 275 | } | ||
| 276 | }); | ||
| 277 | } | ||
| 278 | |||
| 279 | </script> | ||
| 280 | 222 | ||
| 281 | <style scoped lang="scss"> | 223 | <style scoped lang="scss"> |
| 282 | .appList .appItem .func button[disabled]{ | 224 | .appList .appItem .func button[disabled]{ |
| ... | @@ -293,3 +235,4 @@ function goWebView(url) { | ... | @@ -293,3 +235,4 @@ function goWebView(url) { |
| 293 | } | 235 | } |
| 294 | } | 236 | } |
| 295 | </style> | 237 | </style> |
| 238 | ... | ... |
| ... | @@ -21,7 +21,7 @@ | ... | @@ -21,7 +21,7 @@ |
| 21 | v-model="form.belongProvinceId" :localdata="regionsList"> | 21 | v-model="form.belongProvinceId" :localdata="regionsList"> |
| 22 | </uni-data-select> | 22 | </uni-data-select> |
| 23 | </template> | 23 | </template> |
| 24 | </uni-list-item> | 24 | </uni-list-item> |
| 25 | <uni-list-item title="社会信用代码" :rightText="form.creditCode" /> | 25 | <uni-list-item title="社会信用代码" :rightText="form.creditCode" /> |
| 26 | <uni-list-item v-if="isR" title="联系人" :rightText="form.certSiteContact" /> | 26 | <uni-list-item v-if="isR" title="联系人" :rightText="form.certSiteContact" /> |
| 27 | <uni-list-item v-else title="联系人" :rightText="form.siteContact" /> | 27 | <uni-list-item v-else title="联系人" :rightText="form.siteContact" /> |
| ... | @@ -101,8 +101,8 @@ | ... | @@ -101,8 +101,8 @@ |
| 101 | 101 | ||
| 102 | <script setup> | 102 | <script setup> |
| 103 | import * as api from '@/common/api.js' | 103 | import * as api from '@/common/api.js' |
| 104 | import config from '@/config.js' | ||
| 105 | import _ from 'underscore' | 104 | import _ from 'underscore' |
| 105 | import { fillImgUrl, previewAttachment } from '@/common/utils.js' | ||
| 106 | import { | 106 | import { |
| 107 | onMounted, | 107 | onMounted, |
| 108 | ref | 108 | ref |
| ... | @@ -134,7 +134,7 @@ | ... | @@ -134,7 +134,7 @@ |
| 134 | function getForm(memId){ | 134 | function getForm(memId){ |
| 135 | if(memId){ | 135 | if(memId){ |
| 136 | api.getGroupMemberInfoById(memId).then(res => { | 136 | api.getGroupMemberInfoById(memId).then(res => { |
| 137 | form.value = res.data | 137 | form.value = res.data |
| 138 | init() | 138 | init() |
| 139 | }) | 139 | }) |
| 140 | 140 | ||
| ... | @@ -153,6 +153,11 @@ | ... | @@ -153,6 +153,11 @@ |
| 153 | }catch(e){ | 153 | }catch(e){ |
| 154 | form.value.businessLicenseArr=[{url:form.value.businessLicense,name:'营业执照'}] | 154 | form.value.businessLicenseArr=[{url:form.value.businessLicense,name:'营业执照'}] |
| 155 | } | 155 | } |
| 156 | form.value.businessLicenseArr = form.value.businessLicenseArr.map(item => ({ | ||
| 157 | ...item, | ||
| 158 | rawUrl: item.url, | ||
| 159 | url: fillImgUrl(item.url) | ||
| 160 | })) | ||
| 156 | console.log('营业执照',form.value.businessLicenseArr) | 161 | console.log('营业执照',form.value.businessLicenseArr) |
| 157 | } | 162 | } |
| 158 | if (form.value.certBusinessLicense) { | 163 | if (form.value.certBusinessLicense) { |
| ... | @@ -162,19 +167,18 @@ | ... | @@ -162,19 +167,18 @@ |
| 162 | }catch(e){ | 167 | }catch(e){ |
| 163 | form.value.businessLicenseArrR=[{url:form.value.certBusinessLicense,name:'营业执照'}] | 168 | form.value.businessLicenseArrR=[{url:form.value.certBusinessLicense,name:'营业执照'}] |
| 164 | } | 169 | } |
| 170 | form.value.businessLicenseArrR = form.value.businessLicenseArrR.map(item => ({ | ||
| 171 | ...item, | ||
| 172 | rawUrl: item.url, | ||
| 173 | url: fillImgUrl(item.url) | ||
| 174 | })) | ||
| 165 | console.log('营业执照',form.value.businessLicenseArrR) | 175 | console.log('营业执照',form.value.businessLicenseArrR) |
| 166 | } | 176 | } |
| 167 | if (form.value.certLegalIdcPhoto && form.value.certLegalIdcPhoto!=null) { | 177 | if (form.value.certLegalIdcPhoto && form.value.certLegalIdcPhoto!=null) { |
| 168 | form.value.legalIdcPhotoArr = [] | 178 | form.value.legalIdcPhotoArr = [] |
| 169 | var arr = form.value.certLegalIdcPhoto?.split(',') || [] | 179 | var arr = form.value.certLegalIdcPhoto?.split(',') || [] |
| 170 | if (arr.length > 0) { | 180 | if (arr.length > 0) { |
| 171 | arr = _.map(arr, (p) => { | 181 | arr = _.map(arr, (p) => fillImgUrl(p)) |
| 172 | if(p.indexOf('http')==-1){ | ||
| 173 | console.log(p) | ||
| 174 | p = config.baseUrl_api + p | ||
| 175 | } | ||
| 176 | return p | ||
| 177 | }) | ||
| 178 | form.value.legalIdcPhotoArr = arr | 182 | form.value.legalIdcPhotoArr = arr |
| 179 | } | 183 | } |
| 180 | } | 184 | } |
| ... | @@ -182,13 +186,7 @@ | ... | @@ -182,13 +186,7 @@ |
| 182 | form.value.legalIdcPhotoArrR = [] | 186 | form.value.legalIdcPhotoArrR = [] |
| 183 | var arr = form.value.legalIdcPhoto?.split(',') || [] | 187 | var arr = form.value.legalIdcPhoto?.split(',') || [] |
| 184 | if (arr.length > 0) { | 188 | if (arr.length > 0) { |
| 185 | arr = _.map(arr, (p) => { | 189 | arr = _.map(arr, (p) => fillImgUrl(p)) |
| 186 | if(p.indexOf('http')==-1){ | ||
| 187 | console.log(p) | ||
| 188 | p = config.baseUrl_api + p | ||
| 189 | } | ||
| 190 | return p | ||
| 191 | }) | ||
| 192 | form.value.legalIdcPhotoArrR = arr | 190 | form.value.legalIdcPhotoArrR = arr |
| 193 | } | 191 | } |
| 194 | } | 192 | } |
| ... | @@ -197,12 +195,7 @@ | ... | @@ -197,12 +195,7 @@ |
| 197 | form.value.picturesArr = [] | 195 | form.value.picturesArr = [] |
| 198 | var arr = form.value.certPictures.split(',') || [] | 196 | var arr = form.value.certPictures.split(',') || [] |
| 199 | if (arr.length > 0) { | 197 | if (arr.length > 0) { |
| 200 | arr = _.map(arr, (p) => { | 198 | arr = _.map(arr, (p) => fillImgUrl(p)) |
| 201 | if(p.indexOf('http')==-1){ | ||
| 202 | p = config.baseUrl_api + p | ||
| 203 | } | ||
| 204 | return p | ||
| 205 | }) | ||
| 206 | form.value.picturesArr = arr | 199 | form.value.picturesArr = arr |
| 207 | } | 200 | } |
| 208 | console.log(form.value.picturesArr) | 201 | console.log(form.value.picturesArr) |
| ... | @@ -211,12 +204,7 @@ | ... | @@ -211,12 +204,7 @@ |
| 211 | form.value.picturesArrR = [] | 204 | form.value.picturesArrR = [] |
| 212 | var arr = form.value.pictures.split(',') || [] | 205 | var arr = form.value.pictures.split(',') || [] |
| 213 | if (arr.length > 0) { | 206 | if (arr.length > 0) { |
| 214 | arr = _.map(arr, (p) => { | 207 | arr = _.map(arr, (p) => fillImgUrl(p)) |
| 215 | if(p.indexOf('http')==-1){ | ||
| 216 | p = config.baseUrl_api + p | ||
| 217 | } | ||
| 218 | return p | ||
| 219 | }) | ||
| 220 | form.value.picturesArrR = arr | 208 | form.value.picturesArrR = arr |
| 221 | } | 209 | } |
| 222 | console.log(form.value.picturesArrR) | 210 | console.log(form.value.picturesArrR) |
| ... | @@ -248,70 +236,7 @@ | ... | @@ -248,70 +236,7 @@ |
| 248 | } | 236 | } |
| 249 | 237 | ||
| 250 | function download(url) { | 238 | function download(url) { |
| 251 | console.log(url) | 239 | previewAttachment(url, { title: '查看附件' }) |
| 252 | if (url.indexOf('.png') > -1 || url.indexOf('.jpg') > -1) { | ||
| 253 | if(url.indexOf('http')>-1){ | ||
| 254 | uni.previewImage({ | ||
| 255 | urls: [url], | ||
| 256 | success: function(res) { | ||
| 257 | console.log(res,[url],'111') | ||
| 258 | } | ||
| 259 | }) | ||
| 260 | } else { | ||
| 261 | uni.previewImage({ | ||
| 262 | urls: [config.baseUrl_api + url], | ||
| 263 | success: function(res) { | ||
| 264 | console.log(url,'222') | ||
| 265 | } | ||
| 266 | }) | ||
| 267 | } | ||
| 268 | } else { | ||
| 269 | if(url.indexOf('http')>-1){ | ||
| 270 | goWebView(url) | ||
| 271 | } else { | ||
| 272 | goWebView(config.baseUrl_api + url) | ||
| 273 | } | ||
| 274 | } | ||
| 275 | } | ||
| 276 | |||
| 277 | function goWebView(url) { | ||
| 278 | url = url.replace("http://", "https://") | ||
| 279 | uni.showLoading({ | ||
| 280 | title: '下载中' | ||
| 281 | }); | ||
| 282 | uni.downloadFile({ | ||
| 283 | url: url, | ||
| 284 | success: function(res) { | ||
| 285 | uni.hideLoading(); | ||
| 286 | var filePath = res.tempFilePath; | ||
| 287 | uni.showLoading({ | ||
| 288 | title: '正在打开' | ||
| 289 | }); | ||
| 290 | uni.openDocument({ | ||
| 291 | filePath: filePath, | ||
| 292 | showMenu: true, | ||
| 293 | success: function(res) { | ||
| 294 | uni.hideLoading(); | ||
| 295 | }, | ||
| 296 | fail: function(err) { | ||
| 297 | uni.hideLoading(); | ||
| 298 | uni.showToast({ | ||
| 299 | title: err, | ||
| 300 | icon: 'none', | ||
| 301 | duration: 2000 | ||
| 302 | }); | ||
| 303 | } | ||
| 304 | }); | ||
| 305 | }, | ||
| 306 | fail: function(error) { | ||
| 307 | uni.hideLoading(); | ||
| 308 | uni.showToast({ | ||
| 309 | title:`下载失败`, | ||
| 310 | icon: 'none', | ||
| 311 | duration: 2000 | ||
| 312 | }); | ||
| 313 | } | ||
| 314 | }); | ||
| 315 | } | 240 | } |
| 316 | </script> | 241 | </script> |
| 317 | 242 | ||
| ... | @@ -388,4 +313,4 @@ | ... | @@ -388,4 +313,4 @@ |
| 388 | bottom: 4rpx; | 313 | bottom: 4rpx; |
| 389 | right: 8rpx;} | 314 | right: 8rpx;} |
| 390 | } | 315 | } |
| 391 | </style> | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
| 316 | </style> | ... | ... |
| ... | @@ -173,6 +173,7 @@ | ... | @@ -173,6 +173,7 @@ |
| 173 | onShow | 173 | onShow |
| 174 | } from '@dcloudio/uni-app'; | 174 | } from '@dcloudio/uni-app'; |
| 175 | import config from '@/config.js' | 175 | import config from '@/config.js' |
| 176 | import { fillImgUrl } from '@/common/utils.js' | ||
| 176 | import dayjs from 'dayjs' | 177 | import dayjs from 'dayjs' |
| 177 | import _ from 'underscore' | 178 | import _ from 'underscore' |
| 178 | const app = getApp(); | 179 | const app = getApp(); |
| ... | @@ -422,9 +423,7 @@ | ... | @@ -422,9 +423,7 @@ |
| 422 | studentList.value = response.rows | 423 | studentList.value = response.rows |
| 423 | for (var s of studentList.value) { | 424 | for (var s of studentList.value) { |
| 424 | s.checked = false | 425 | s.checked = false |
| 425 | if (s.photo && s.photo.indexOf('http') == -1) { | 426 | s.photo = fillImgUrl(s.photo) |
| 426 | s.photo = config.baseUrl_api + s.photo | ||
| 427 | } | ||
| 428 | 427 | ||
| 429 | } | 428 | } |
| 430 | uni.hideLoading() | 429 | uni.hideLoading() |
| ... | @@ -485,9 +484,7 @@ | ... | @@ -485,9 +484,7 @@ |
| 485 | if (!d.isPass) { | 484 | if (!d.isPass) { |
| 486 | d.isPass = '1' | 485 | d.isPass = '1' |
| 487 | } | 486 | } |
| 488 | if (d.photo && d.photo.indexOf('http') == -1) { | 487 | d.photo = fillImgUrl(d.photo) |
| 489 | d.photo = config.baseUrl_api + d.photo | ||
| 490 | } | ||
| 491 | }) | 488 | }) |
| 492 | 489 | ||
| 493 | infoList.value = res.rows | 490 | infoList.value = res.rows | ... | ... |
| ... | @@ -112,8 +112,8 @@ | ... | @@ -112,8 +112,8 @@ |
| 112 | infoList.value.push(item) | 112 | infoList.value.push(item) |
| 113 | }) | 113 | }) |
| 114 | console.log(infoList.value) | 114 | console.log(infoList.value) |
| 115 | form.value.totalNum = Math.floor(_.sumBy(infoList.value, (o) => parseFloat(o.totalNum || 0))) | 115 | form.value.totalNum = Math.floor(infoList.value.reduce((sum, o) => sum + parseFloat(o.totalNum || 0), 0)) |
| 116 | form.value.totalAmount = Math.floor(_.sumBy(infoList.value, (o) => parseFloat(o.totalAmount || 0))) | 116 | form.value.totalAmount = Math.floor(infoList.value.reduce((sum, o) => sum + parseFloat(o.totalAmount || 0), 0)) |
| 117 | 117 | ||
| 118 | uni.hideLoading() | 118 | uni.hideLoading() |
| 119 | 119 | ... | ... |
| ... | @@ -115,6 +115,7 @@ | ... | @@ -115,6 +115,7 @@ |
| 115 | <script setup> | 115 | <script setup> |
| 116 | import * as api from '@/common/api.js' | 116 | import * as api from '@/common/api.js' |
| 117 | import config from '@/config.js' | 117 | import config from '@/config.js' |
| 118 | import { fillImgUrl, previewAttachment } from '@/common/utils.js' | ||
| 118 | import * as loginServer from '@/common/login.js'; | 119 | import * as loginServer from '@/common/login.js'; |
| 119 | 120 | ||
| 120 | import _ from 'underscore' | 121 | import _ from 'underscore' |
| ... | @@ -203,9 +204,17 @@ | ... | @@ -203,9 +204,17 @@ |
| 203 | if (form.value.businessLicense) { | 204 | if (form.value.businessLicense) { |
| 204 | form.value.businessLicenseArr = [] | 205 | form.value.businessLicenseArr = [] |
| 205 | try{ | 206 | try{ |
| 206 | form.value.businessLicenseArr = JSON.parse(form.value.businessLicense) || [] | 207 | const parsed = JSON.parse(form.value.businessLicense) || [] |
| 208 | form.value.businessLicenseArr = parsed.map(item => ({ | ||
| 209 | ...item, | ||
| 210 | name: item.name || '营业执照', | ||
| 211 | url: fillImgUrl(item.url || item.rawUrl || form.value.businessLicense) | ||
| 212 | })) | ||
| 207 | }catch(e){ | 213 | }catch(e){ |
| 208 | form.value.businessLicenseArr=[{url:form.value.businessLicense,name:'营业执照'}] | 214 | form.value.businessLicenseArr=[{ |
| 215 | url: fillImgUrl(form.value.businessLicense), | ||
| 216 | name: '营业执照' | ||
| 217 | }] | ||
| 209 | } | 218 | } |
| 210 | console.log('营业执照',form.value.businessLicenseArr) | 219 | console.log('营业执照',form.value.businessLicenseArr) |
| 211 | } | 220 | } |
| ... | @@ -213,13 +222,7 @@ | ... | @@ -213,13 +222,7 @@ |
| 213 | form.value.legalIdcPhotoArr = [] | 222 | form.value.legalIdcPhotoArr = [] |
| 214 | var arr = form.value.certLegalIdcPhoto?.split(',') || [] | 223 | var arr = form.value.certLegalIdcPhoto?.split(',') || [] |
| 215 | if (arr.length > 0) { | 224 | if (arr.length > 0) { |
| 216 | arr = _.map(arr, (p) => { | 225 | arr = _.map(arr, (p) => fillImgUrl(p)) |
| 217 | if(p.indexOf('http')==-1){ | ||
| 218 | console.log(p) | ||
| 219 | p = config.baseUrl_api + p | ||
| 220 | } | ||
| 221 | return p | ||
| 222 | }) | ||
| 223 | form.value.legalIdcPhotoArr = arr | 226 | form.value.legalIdcPhotoArr = arr |
| 224 | } | 227 | } |
| 225 | console.log('法人身份证',form.value.legalIdcPhotoArr) | 228 | console.log('法人身份证',form.value.legalIdcPhotoArr) |
| ... | @@ -228,12 +231,7 @@ | ... | @@ -228,12 +231,7 @@ |
| 228 | form.value.picturesArr = [] | 231 | form.value.picturesArr = [] |
| 229 | var arr = form.value.certPictures.split(',') || [] | 232 | var arr = form.value.certPictures.split(',') || [] |
| 230 | if (arr.length > 0) { | 233 | if (arr.length > 0) { |
| 231 | arr = _.map(arr, (p) => { | 234 | arr = _.map(arr, (p) => fillImgUrl(p)) |
| 232 | if(p.indexOf('http')==-1){ | ||
| 233 | p = config.baseUrl_api + p | ||
| 234 | } | ||
| 235 | return p | ||
| 236 | }) | ||
| 237 | form.value.picturesArr = arr | 235 | form.value.picturesArr = arr |
| 238 | } | 236 | } |
| 239 | console.log(form.value.picturesArr) | 237 | console.log(form.value.picturesArr) |
| ... | @@ -258,29 +256,7 @@ | ... | @@ -258,29 +256,7 @@ |
| 258 | } | 256 | } |
| 259 | 257 | ||
| 260 | function download(url) { | 258 | function download(url) { |
| 261 | console.log(url) | 259 | previewAttachment(url, { title: '查看营业执照' }) |
| 262 | if (url.indexOf('.png') > -1 || url.indexOf('.jpg') > -1) { | ||
| 263 | if(url.indexOf('http')>-1){ | ||
| 264 | uni.previewImage({ | ||
| 265 | urls: [url], | ||
| 266 | success: function(res) { | ||
| 267 | |||
| 268 | } | ||
| 269 | }) | ||
| 270 | } else { | ||
| 271 | uni.previewImage({ | ||
| 272 | urls: [config.baseUrl_api + url], | ||
| 273 | success: function(res) { | ||
| 274 | } | ||
| 275 | }) | ||
| 276 | } | ||
| 277 | } else { | ||
| 278 | if(url.indexOf('http')>-1){ | ||
| 279 | goWebView(url) | ||
| 280 | } else { | ||
| 281 | goWebView(config.baseUrl_api + url) | ||
| 282 | } | ||
| 283 | } | ||
| 284 | } | 260 | } |
| 285 | 261 | ||
| 286 | function goWebView(url) { | 262 | function goWebView(url) { | ... | ... |
| 1 | <template> | 1 | <template> |
| 2 | <view class="page"> | 2 | <view class="page"> |
| 3 | <view class="bgbg"> | 3 | <view class="bgbg"> |
| 4 | <view class="flex"> | 4 | <view class="flex"> |
| 5 | <view class="imgbox"> | 5 | <view class="imgbox"> |
| 6 | <image v-if="state.user.avatar" :src="state.user.avatar"/> | 6 | <image v-if="state.user.avatar" :src="state.user.avatar"/> |
| 7 | <image v-else src="@/static/nodata.png"/> | 7 | <image v-else src="@/static/nodata.png"/> |
| 8 | </view> | 8 | </view> |
| 9 | <text class="name">{{ state.user.userName }}</text> | 9 | <text class="name">{{ state.user.userName }}</text> |
| 10 | </view> | 10 | </view> |
| 11 | </view> | 11 | </view> |
| 12 | <view class="rMainBox"> | 12 | <view class="rMainBox"> |
| 13 | <uni-list :border="false" class="myList"> | 13 | <uni-list :border="false" class="myList"> |
| 14 | <uni-list-item thumb="/static/user_icon01.png" title="团体信息" showArrow clickable @click="goPath('/myCenter/teamInfo')"> | 14 | <uni-list-item thumb="/static/user_icon01.png" title="团体信息" showArrow clickable @click="goPath('/myCenter/teamInfo')"> |
| 15 | </uni-list-item> | 15 | </uni-list-item> |
| 16 | 16 | ||
| 17 | <uni-list-item thumb="/static/user_icon02.png" title="会员认证" showArrow clickable @click="goPath('/myCenter/auth')"> | 17 | <uni-list-item thumb="/static/user_icon02.png" title="会员认证" showArrow clickable @click="goPath('/myCenter/auth')"> |
| 18 | </uni-list-item> | 18 | </uni-list-item> |
| 19 | 19 | ||
| 20 | <!-- <uni-list-item thumb="/static/user_icon03.png" v-show="userType==2" title="账户信息" showArrow clickable> | 20 | <!-- <uni-list-item thumb="/static/user_icon03.png" v-show="userType==2" title="账户信息" showArrow clickable> |
| 21 | </uni-list-item> --> | 21 | </uni-list-item> --> |
| 22 | 22 | ||
| 23 | <uni-list-item thumb="/static/user_icon03.png" title="账号安全" showArrow clickable @click="goPath('/myCenter/safe')"> | 23 | <uni-list-item thumb="/static/user_icon03.png" title="账号安全" showArrow clickable @click="goPath('/myCenter/safe')"> |
| 24 | </uni-list-item> | 24 | </uni-list-item> |
| 25 | 25 | ||
| 26 | </uni-list> | 26 | </uni-list> |
| 27 | 27 | ||
| 28 | </view> | 28 | </view> |
| 29 | 29 | ||
| 30 | <view class="fixedBottom" style="background: transparent;box-shadow: none;"> | 30 | <view class="fixedBottom" style="background: transparent;box-shadow: none;"> |
| 31 | <button @click="loginOut" class="btn btn-red" style="border-radius: 50px;">退出登录</button> | 31 | <button @click="loginOut" class="btn btn-red" style="border-radius: 50px;">退出登录</button> |
| 32 | </view> | 32 | </view> |
| 33 | </view> | 33 | </view> |
| 34 | </template> | 34 | </template> |
| ... | @@ -37,6 +37,7 @@ | ... | @@ -37,6 +37,7 @@ |
| 37 | import * as api from '@/common/api.js'; | 37 | import * as api from '@/common/api.js'; |
| 38 | import * as loginServer from '@/common/login.js'; | 38 | import * as loginServer from '@/common/login.js'; |
| 39 | import config from '@/config.js' | 39 | import config from '@/config.js' |
| 40 | import { fillImgUrl } from '@/common/utils.js' | ||
| 40 | import { | 41 | import { |
| 41 | onLoad, | 42 | onLoad, |
| 42 | onShow, | 43 | onShow, |
| ... | @@ -60,11 +61,11 @@ let proId; | ... | @@ -60,11 +61,11 @@ let proId; |
| 60 | const svId = ref(null); | 61 | const svId = ref(null); |
| 61 | const numData = ref({}); | 62 | const numData = ref({}); |
| 62 | 63 | ||
| 63 | const messageList = ref([]) | 64 | const messageList = ref([]) |
| 64 | const state = reactive({ | 65 | const state = reactive({ |
| 65 | user: {}, | 66 | user: {}, |
| 66 | roleGroup: {}, | 67 | roleGroup: {}, |
| 67 | postGroup: {} | 68 | postGroup: {} |
| 68 | }) | 69 | }) |
| 69 | onShow(() => { | 70 | onShow(() => { |
| 70 | if (app.globalData.isLogin) { | 71 | if (app.globalData.isLogin) { |
| ... | @@ -80,12 +81,12 @@ onLoad(option => { | ... | @@ -80,12 +81,12 @@ onLoad(option => { |
| 80 | proId = decodeURIComponent(option.scene); | 81 | proId = decodeURIComponent(option.scene); |
| 81 | } else { | 82 | } else { |
| 82 | proId = option.proId; | 83 | proId = option.proId; |
| 83 | } | 84 | } |
| 84 | if(uni.showShareMenu){ | 85 | if(uni.showShareMenu){ |
| 85 | uni.showShareMenu({ | 86 | uni.showShareMenu({ |
| 86 | withShareTicket: true, | 87 | withShareTicket: true, |
| 87 | menus: ['shareAppMessage', 'shareTimeline'] | 88 | menus: ['shareAppMessage', 'shareTimeline'] |
| 88 | }); | 89 | }); |
| 89 | } | 90 | } |
| 90 | }); | 91 | }); |
| 91 | 92 | ||
| ... | @@ -104,21 +105,19 @@ function loginOut() { | ... | @@ -104,21 +105,19 @@ function loginOut() { |
| 104 | } | 105 | } |
| 105 | }) | 106 | }) |
| 106 | } | 107 | } |
| 107 | function getUser() { | 108 | function getUser() { |
| 108 | api.getUserProfile().then((response) => { | 109 | api.getUserProfile().then((response) => { |
| 109 | state.user = response.data.user | 110 | state.user = response.data.user |
| 110 | if(state.user.avatar&&state.user.avatar.indexOf('http')==-1){ | 111 | state.user.avatar = fillImgUrl(state.user.avatar) |
| 111 | state.user.avatar = config.baseUrl_api+state.user.avatar | 112 | state.roleGroup = response.data.roleGroup |
| 112 | } | 113 | state.postGroup = response.data.postGroup |
| 113 | state.roleGroup = response.data.roleGroup | 114 | uni.hideLoading(); |
| 114 | state.postGroup = response.data.postGroup | 115 | }) |
| 115 | uni.hideLoading(); | ||
| 116 | }) | ||
| 117 | } | 116 | } |
| 118 | function init() { | 117 | function init() { |
| 119 | uni.showLoading({ | 118 | uni.showLoading({ |
| 120 | title: '加载中' | 119 | title: '加载中' |
| 121 | }); | 120 | }); |
| 122 | getUser() | 121 | getUser() |
| 123 | loginServer.getMyOwnMemberInfo().then(res => { | 122 | loginServer.getMyOwnMemberInfo().then(res => { |
| 124 | userType.value = app.globalData.userType | 123 | userType.value = app.globalData.userType |
| ... | @@ -126,31 +125,31 @@ function init() { | ... | @@ -126,31 +125,31 @@ function init() { |
| 126 | uni.hideLoading(); | 125 | uni.hideLoading(); |
| 127 | }) | 126 | }) |
| 128 | } | 127 | } |
| 129 | function goPath(url){ | 128 | function goPath(url){ |
| 130 | uni.navigateTo({ | 129 | uni.navigateTo({ |
| 131 | url:url | 130 | url:url |
| 132 | }) | 131 | }) |
| 133 | } | 132 | } |
| 134 | 133 | ||
| 135 | </script> | 134 | </script> |
| 136 | <style scope lang="scss"> | 135 | <style scope lang="scss"> |
| 137 | .uni-list:after{display: none;} | 136 | .uni-list:after{display: none;} |
| 138 | .page { | 137 | .page { |
| 139 | width: 100vw; | 138 | width: 100vw; |
| 140 | overflow: hidden; | 139 | overflow: hidden; |
| 141 | } | 140 | } |
| 142 | .bgbg{ | 141 | .bgbg{ |
| 143 | .flex{align-items: center;} | 142 | .flex{align-items: center;} |
| 144 | height: 280rpx;padding:30rpx; | 143 | height: 280rpx;padding:30rpx; |
| 145 | .name{margin-left: 20rpx; | 144 | .name{margin-left: 20rpx; |
| 146 | font-size: 36rpx;} | 145 | font-size: 36rpx;} |
| 147 | .imgbox{width: 120rpx; | 146 | .imgbox{width: 120rpx; |
| 148 | height: 120rpx;overflow: hidden; | 147 | height: 120rpx;overflow: hidden; |
| 149 | // background: #C7C7CD; | 148 | // background: #C7C7CD; |
| 150 | // border: 4rpx solid #FFFFFF; | 149 | // border: 4rpx solid #FFFFFF; |
| 151 | border-radius: 50%; | 150 | border-radius: 50%; |
| 152 | image{height: 120rpx;width: 120rpx;object-fit: cover;} | 151 | image{height: 120rpx;width: 120rpx;object-fit: cover;} |
| 153 | } | 152 | } |
| 154 | } | 153 | } |
| 155 | .loginOutIcon { | 154 | .loginOutIcon { |
| 156 | position: relative; | 155 | position: relative; |
| ... | @@ -219,11 +218,11 @@ function goPath(url){ | ... | @@ -219,11 +218,11 @@ function goPath(url){ |
| 219 | margin: 30rpx 0 20rpx; | 218 | margin: 30rpx 0 20rpx; |
| 220 | padding: 0 20rpx 0; | 219 | padding: 0 20rpx 0; |
| 221 | } | 220 | } |
| 222 | } | 221 | } |
| 223 | .rMainBox {position: relative;top:-120rpx; | 222 | .rMainBox {position: relative;top:-120rpx; |
| 224 | box-sizing: border-box;padding: 20rpx 20rpx; | 223 | box-sizing: border-box;padding: 20rpx 20rpx; |
| 225 | background-color: #fff; | 224 | background-color: #fff; |
| 226 | border-radius: 15rpx; | 225 | border-radius: 15rpx; |
| 227 | margin: 25rpx;overflow: hidden; | 226 | margin: 25rpx;overflow: hidden; |
| 228 | } | 227 | } |
| 229 | </style> | 228 | </style> |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| ... | @@ -103,6 +103,7 @@ | ... | @@ -103,6 +103,7 @@ |
| 103 | onShow | 103 | onShow |
| 104 | } from '@dcloudio/uni-app'; | 104 | } from '@dcloudio/uni-app'; |
| 105 | import config from '@/config.js' | 105 | import config from '@/config.js' |
| 106 | import { fillImgUrl } from '@/common/utils.js' | ||
| 106 | const app = getApp(); | 107 | const app = getApp(); |
| 107 | const form = ref({ | 108 | const form = ref({ |
| 108 | type: '1', | 109 | type: '1', |
| ... | @@ -242,12 +243,8 @@ | ... | @@ -242,12 +243,8 @@ |
| 242 | if(form.value.legalIdcPhoto){ | 243 | if(form.value.legalIdcPhoto){ |
| 243 | legalIdcPhoto1.value = form.value.legalIdcPhoto.split(',')?.[0] || '' | 244 | legalIdcPhoto1.value = form.value.legalIdcPhoto.split(',')?.[0] || '' |
| 244 | legalIdcPhoto2.value = form.value.legalIdcPhoto.split(',')?.[1] || '' | 245 | legalIdcPhoto2.value = form.value.legalIdcPhoto.split(',')?.[1] || '' |
| 245 | if(legalIdcPhoto1.value.indexOf('http')==-1){ | 246 | legalIdcPhoto1.value = fillImgUrl(legalIdcPhoto1.value) |
| 246 | legalIdcPhoto1.value = config.baseUrl_api + legalIdcPhoto1.value | 247 | legalIdcPhoto2.value = fillImgUrl(legalIdcPhoto2.value) |
| 247 | } | ||
| 248 | if(legalIdcPhoto2.value.indexOf('http')==-1){ | ||
| 249 | legalIdcPhoto2.value = config.baseUrl_api + legalIdcPhoto2.value | ||
| 250 | } | ||
| 251 | imgfront.value = { | 248 | imgfront.value = { |
| 252 | url: legalIdcPhoto1.value, | 249 | url: legalIdcPhoto1.value, |
| 253 | name: '身份证正面', | 250 | name: '身份证正面', |
| ... | @@ -265,9 +262,7 @@ | ... | @@ -265,9 +262,7 @@ |
| 265 | var arr = form.value.pictures.split(',') || [] | 262 | var arr = form.value.pictures.split(',') || [] |
| 266 | if (arr.length > 0) { | 263 | if (arr.length > 0) { |
| 267 | arr = _.map(arr, (p) => { | 264 | arr = _.map(arr, (p) => { |
| 268 | if(p.indexOf('http')==-1){ | 265 | p = fillImgUrl(p) |
| 269 | p = config.baseUrl_api + p | ||
| 270 | } | ||
| 271 | var obj = { | 266 | var obj = { |
| 272 | url: p, | 267 | url: p, |
| 273 | name: '图片', | 268 | name: '图片', |
| ... | @@ -482,10 +477,17 @@ | ... | @@ -482,10 +477,17 @@ |
| 482 | return | 477 | return |
| 483 | } | 478 | } |
| 484 | uni.showLoading({ | 479 | uni.showLoading({ |
| 485 | title: '加载中' | 480 | title: '上传中' |
| 486 | }) | 481 | }) |
| 487 | api.uploadImg(e).then(data => { | 482 | uploadMinioImage(imgUrl).then(url => { |
| 488 | legalIdcPhoto1.value = data.msg | 483 | legalIdcPhoto1.value = url |
| 484 | uni.hideLoading() | ||
| 485 | }).catch(err => { | ||
| 486 | uni.hideLoading() | ||
| 487 | uni.showToast({ | ||
| 488 | title: '上传失败', | ||
| 489 | icon: 'none' | ||
| 490 | }) | ||
| 489 | }) | 491 | }) |
| 490 | } | 492 | } |
| 491 | 493 | ||
| ... | @@ -496,10 +498,17 @@ | ... | @@ -496,10 +498,17 @@ |
| 496 | return | 498 | return |
| 497 | } | 499 | } |
| 498 | uni.showLoading({ | 500 | uni.showLoading({ |
| 499 | title: '加载中' | 501 | title: '上传中' |
| 500 | }) | 502 | }) |
| 501 | api.uploadImg(e).then(data => { | 503 | uploadMinioImage(imgUrl).then(url => { |
| 502 | legalIdcPhoto2.value = data.msg | 504 | legalIdcPhoto2.value = url |
| 505 | uni.hideLoading() | ||
| 506 | }).catch(err => { | ||
| 507 | uni.hideLoading() | ||
| 508 | uni.showToast({ | ||
| 509 | title: '上传失败', | ||
| 510 | icon: 'none' | ||
| 511 | }) | ||
| 503 | }) | 512 | }) |
| 504 | } | 513 | } |
| 505 | 514 | ||
| ... | @@ -521,19 +530,31 @@ | ... | @@ -521,19 +530,31 @@ |
| 521 | if (!file) { | 530 | if (!file) { |
| 522 | return | 531 | return |
| 523 | } | 532 | } |
| 524 | api.uploadFile(e).then(data => { | 533 | const filePath = file.url || file.path || e.tempFilePaths?.[0] |
| 534 | uni.showLoading({ | ||
| 535 | title: '上传中' | ||
| 536 | }) | ||
| 537 | uploadMinioImage(filePath).then(url => { | ||
| 525 | selectFileValue = { | 538 | selectFileValue = { |
| 526 | url: data.msg, | 539 | url: url, |
| 527 | name: file.name, | 540 | name: file.name, |
| 528 | extname: file.extname | 541 | extname: file.extname |
| 529 | } | 542 | } |
| 530 | form.value.businessLicense = JSON.stringify([selectFileValue]) | 543 | form.value.businessLicense = JSON.stringify([selectFileValue]) |
| 531 | console.log(selectFileValue,form.value.businessLicense) | 544 | console.log(selectFileValue,form.value.businessLicense) |
| 545 | uni.hideLoading() | ||
| 546 | }).catch(err => { | ||
| 547 | uni.hideLoading() | ||
| 548 | uni.showToast({ | ||
| 549 | title: '上传失败', | ||
| 550 | icon: 'none' | ||
| 551 | }) | ||
| 532 | }) | 552 | }) |
| 533 | } | 553 | } |
| 534 | 554 | ||
| 535 | function delSupplementFile() { | 555 | function delSupplementFile() { |
| 536 | selectFileValue = {} | 556 | selectFileValue = {} |
| 557 | form.value.businessLicense = '' | ||
| 537 | } | 558 | } |
| 538 | 559 | ||
| 539 | function upPicArr(e) { | 560 | function upPicArr(e) { |
| ... | @@ -543,20 +564,58 @@ | ... | @@ -543,20 +564,58 @@ |
| 543 | return | 564 | return |
| 544 | } | 565 | } |
| 545 | uni.showLoading({ | 566 | uni.showLoading({ |
| 546 | title: '加载中' | 567 | title: '上传中' |
| 547 | }) | 568 | }) |
| 548 | api.uploadImg(e).then(data => { | 569 | Promise.all(tempFilePaths.slice(0, 3).map(path => uploadMinioImage(path))).then(urls => { |
| 549 | picArr.value.push(data.msg) | 570 | picArr.value.push(...urls.filter(Boolean)) |
| 550 | // form.value.pictures | 571 | form.value.pictures = picArr.value.join(',') |
| 551 | console.log(picArr.value) | 572 | uni.hideLoading() |
| 573 | }).catch(err => { | ||
| 574 | uni.hideLoading() | ||
| 575 | uni.showToast({ | ||
| 576 | title: '上传失败', | ||
| 577 | icon: 'none' | ||
| 578 | }) | ||
| 552 | }) | 579 | }) |
| 553 | } | 580 | } |
| 554 | 581 | ||
| 555 | function delpicArr(e) { | 582 | function delpicArr(e) { |
| 556 | picArr.value.splice(e.index, 1) | 583 | picArr.value.splice(e.index, 1) |
| 584 | form.value.pictures = picArr.value.join(',') | ||
| 557 | console.log(picArr.value, picArrR.value) | 585 | console.log(picArr.value, picArrR.value) |
| 558 | } | 586 | } |
| 559 | 587 | ||
| 588 | function uploadMinioImage(filePath) { | ||
| 589 | return new Promise((resolve, reject) => { | ||
| 590 | if (!filePath) return reject(new Error('请选择图片')) | ||
| 591 | uni.uploadFile({ | ||
| 592 | url: config.baseUrl_api + '/fileServer/uploadImg', | ||
| 593 | filePath, | ||
| 594 | name: 'image', | ||
| 595 | header: { | ||
| 596 | 'Authorization': uni.getStorageSync('token') | ||
| 597 | }, | ||
| 598 | success: (res) => { | ||
| 599 | try { | ||
| 600 | const data = JSON.parse(res.data || '{}') | ||
| 601 | const url = getUploadUrl(data) | ||
| 602 | if (!url) return reject(new Error('上传返回数据异常')) | ||
| 603 | resolve(url) | ||
| 604 | } catch (e) { | ||
| 605 | reject(e) | ||
| 606 | } | ||
| 607 | }, | ||
| 608 | fail: reject | ||
| 609 | }) | ||
| 610 | }) | ||
| 611 | } | ||
| 612 | |||
| 613 | function getUploadUrl(res) { | ||
| 614 | const data = res?.data | ||
| 615 | if (typeof data === 'string') return data | ||
| 616 | return data?.ms || data?.url || data?.fang || res?.msg || '' | ||
| 617 | } | ||
| 618 | |||
| 560 | 619 | ||
| 561 | function bindChange(e) { | 620 | function bindChange(e) { |
| 562 | console.log(e) | 621 | console.log(e) | ... | ... |
| 1 | <template> | 1 | <template> |
| 2 | <view class="mainbox"> | 2 | <view class="mainbox"> |
| 3 | <view class="title">{{form.name}}</view> | 3 | <view class="title">{{form.name}}</view> |
| 4 | <view class="infos"> | 4 | <view class="infos"> |
| 5 | <text>{{ form.source }}</text> | 5 | <text>{{ form.source }}</text> |
| ... | @@ -10,17 +10,18 @@ | ... | @@ -10,17 +10,18 @@ |
| 10 | <view v-html="form.content"></view> | 10 | <view v-html="form.content"></view> |
| 11 | 11 | ||
| 12 | <view v-if="attachmentMp4.length>0"> | 12 | <view v-if="attachmentMp4.length>0"> |
| 13 | <video v-for="(f,index) in attachmentMp4" :key="index" controls :src="config.baseUrl_api + f.url"></video> | 13 | <video v-for="(f,index) in attachmentMp4" :key="index" controls |
| 14 | :src="fillImgUrl(f.url)"></video> | ||
| 15 | </view> | ||
| 16 | <view v-if="attachmentFile.length>0" class="mt20"> | ||
| 17 | <!-- 附件--> | ||
| 18 | <view class="fwb mt20">附件下载:</view> | ||
| 19 | <view v-for="(f,index) in attachmentFile" :key="index" class="text-primary underLine" | ||
| 20 | @click="downLoad(f.url)"> | ||
| 21 | {{ index + 1 }}、{{ f.name }} | ||
| 22 | </view> | ||
| 23 | |||
| 14 | </view> | 24 | </view> |
| 15 | <view v-if="attachmentFile.length>0" class="mt20"> | ||
| 16 | <!-- 附件--> | ||
| 17 | <view class="fwb mt20">附件下载:</view> | ||
| 18 | <view v-for="(f,index) in attachmentFile" :key="index" class="text-primary underLine" | ||
| 19 | @click="downLoad(f.url)"> | ||
| 20 | {{ index + 1 }}、{{ f.name }} | ||
| 21 | </view> | ||
| 22 | |||
| 23 | </view> | ||
| 24 | <view> | 25 | <view> |
| 25 | <text v-if=" form.author">发布人:{{ form.author }}</text> | 26 | <text v-if=" form.author">发布人:{{ form.author }}</text> |
| 26 | </view> | 27 | </view> |
| ... | @@ -37,10 +38,10 @@ | ... | @@ -37,10 +38,10 @@ |
| 37 | onLoad | 38 | onLoad |
| 38 | } from '@dcloudio/uni-app'; | 39 | } from '@dcloudio/uni-app'; |
| 39 | import _ from 'underscore' | 40 | import _ from 'underscore' |
| 40 | import config from '@/config.js' | 41 | import { fillImgUrl, previewAttachment } from '@/common/utils.js' |
| 41 | const form = ref({}) | 42 | const form = ref({}) |
| 42 | const attachmentFile = ref([]) | 43 | const attachmentFile = ref([]) |
| 43 | const attachmentMp4 = ref([]) | 44 | const attachmentMp4 = ref([]) |
| 44 | 45 | ||
| 45 | onLoad((option) => { | 46 | onLoad((option) => { |
| 46 | getData(option.noteId) | 47 | getData(option.noteId) |
| ... | @@ -54,82 +55,19 @@ const attachmentMp4 = ref([]) | ... | @@ -54,82 +55,19 @@ const attachmentMp4 = ref([]) |
| 54 | .replace(/<img([\s\w"-=\/\.:;]+)((?:(style="[^"]+")))/ig, '<img$1') | 55 | .replace(/<img([\s\w"-=\/\.:;]+)((?:(style="[^"]+")))/ig, '<img$1') |
| 55 | .replace(/<img([\s\w"-=\/\.:;]+)((?:(alt="[^"]+")))/ig, '<img$1') | 56 | .replace(/<img([\s\w"-=\/\.:;]+)((?:(alt="[^"]+")))/ig, '<img$1') |
| 56 | .replace(/<img([\s\w"-=\/\.:;]+)/ig, '<img style="width: 100%;" $1'); | 57 | .replace(/<img([\s\w"-=\/\.:;]+)/ig, '<img style="width: 100%;" $1'); |
| 57 | 58 | ||
| 58 | 59 | ||
| 59 | if (form.value.attacthJson) { | 60 | if (form.value.attacthJson) { |
| 60 | const attachment = JSON.parse(form.value.attacthJson) | 61 | const attachment = JSON.parse(form.value.attacthJson) |
| 61 | attachmentFile.value = _.filter(attachment, (a) => a.url.toLowerCase().indexOf('.mp4') === -1) || [] | 62 | attachmentFile.value = _.filter(attachment, (a) => a.url.toLowerCase().indexOf('.mp4') === -1) || |
| 62 | attachmentMp4.value = _.filter(attachment, (a) => a.url.toLowerCase().indexOf('.mp4') !== -1) || [] | 63 | [] |
| 64 | attachmentMp4.value = _.filter(attachment, (a) => a.url.toLowerCase().indexOf('.mp4') !== -1) || [] | ||
| 63 | } | 65 | } |
| 64 | }) | 66 | }) |
| 65 | } | 67 | } |
| 66 | function downLoad(url){ | 68 | |
| 67 | console.log(url) | 69 | function downLoad(url) { |
| 68 | var str = config.baseUrl_api + url | 70 | previewAttachment(url, { title: '附件预览' }) |
| 69 | if (url.indexOf('png') > -1 ||url.indexOf('jpg') > -1 ||url.indexOf('jpeg') > -1) { | ||
| 70 | uni.previewImage({ | ||
| 71 | urls: [str], | ||
| 72 | success: function(res) { | ||
| 73 | console.log('success', res) | ||
| 74 | }, | ||
| 75 | fail: function(res) { | ||
| 76 | console.log('fail', res) | ||
| 77 | }, | ||
| 78 | complete: function(res) { | ||
| 79 | console.log('complete', res) | ||
| 80 | } | ||
| 81 | }) | ||
| 82 | } else { | ||
| 83 | goWebView(str) | ||
| 84 | } | ||
| 85 | } | ||
| 86 | function goWebView(url) { | ||
| 87 | url = url.replace("http://", "https://") | ||
| 88 | uni.showLoading({ | ||
| 89 | title: '下载中' | ||
| 90 | }); | ||
| 91 | uni.downloadFile({ | ||
| 92 | url: url, | ||
| 93 | success: function(res) { | ||
| 94 | console.log('111') | ||
| 95 | uni.hideLoading(); | ||
| 96 | var filePath = res.tempFilePath; | ||
| 97 | uni.showLoading({ | ||
| 98 | title: '正在打开' | ||
| 99 | }); | ||
| 100 | uni.openDocument({ | ||
| 101 | filePath: filePath, | ||
| 102 | showMenu: true, | ||
| 103 | success: function(res) { | ||
| 104 | console.log('222') | ||
| 105 | uni.hideLoading(); | ||
| 106 | }, | ||
| 107 | fail: function(err) { | ||
| 108 | console.log(err.errMsg) | ||
| 109 | uni.hideLoading(); | ||
| 110 | let msg | ||
| 111 | if(err.errMsg.indexOf('not supported')>-1){ | ||
| 112 | msg = '不支持该文件类型' | ||
| 113 | } else { | ||
| 114 | msg = err.errMsg | ||
| 115 | } | ||
| 116 | uni.showToast({ | ||
| 117 | title: msg, | ||
| 118 | icon: 'none', | ||
| 119 | duration: 2000 | ||
| 120 | }); | ||
| 121 | } | ||
| 122 | }); | ||
| 123 | }, | ||
| 124 | fail: function(error) { | ||
| 125 | uni.hideLoading(); | ||
| 126 | uni.showToast({ | ||
| 127 | title: `下载失败`, | ||
| 128 | icon: 'none', | ||
| 129 | duration: 2000 | ||
| 130 | }); | ||
| 131 | } | ||
| 132 | }); | ||
| 133 | } | 71 | } |
| 134 | </script> | 72 | </script> |
| 135 | 73 | ||
| ... | @@ -146,13 +84,13 @@ const attachmentMp4 = ref([]) | ... | @@ -146,13 +84,13 @@ const attachmentMp4 = ref([]) |
| 146 | color: #29343C; | 84 | color: #29343C; |
| 147 | margin-bottom: 34rpx; | 85 | margin-bottom: 34rpx; |
| 148 | } | 86 | } |
| 149 | 87 | ||
| 150 | .infos { | 88 | .infos { |
| 151 | border-bottom: 1px solid #DCDCDC; | 89 | border-bottom: 1px solid #DCDCDC; |
| 152 | padding-bottom: 40rpx; | 90 | padding-bottom: 40rpx; |
| 153 | overflow: hidden; | 91 | overflow: hidden; |
| 154 | } | 92 | } |
| 155 | 93 | ||
| 156 | .infos>text { | 94 | .infos>text { |
| 157 | margin-right: 18rpx; | 95 | margin-right: 18rpx; |
| 158 | color: #7B7F83; | 96 | color: #7B7F83; |
| ... | @@ -167,27 +105,29 @@ const attachmentMp4 = ref([]) | ... | @@ -167,27 +105,29 @@ const attachmentMp4 = ref([]) |
| 167 | word-wrap: break-word !important; | 105 | word-wrap: break-word !important; |
| 168 | white-space: normal !important; | 106 | white-space: normal !important; |
| 169 | } | 107 | } |
| 170 | 108 | ||
| 171 | .content rich-text { | 109 | .content rich-text { |
| 172 | word-wrap: break-word !important; | 110 | word-wrap: break-word !important; |
| 173 | white-space: normal !important; | 111 | white-space: normal !important; |
| 174 | } | 112 | } |
| 175 | 113 | ||
| 176 | .content span, | 114 | .content span, |
| 177 | .content p { | 115 | .content p { |
| 178 | word-wrap: break-word !important; | 116 | word-wrap: break-word !important; |
| 179 | white-space: normal !important; | 117 | white-space: normal !important; |
| 180 | } | 118 | } |
| 181 | .content rich-text img{max-width: 100%;} | 119 | .content rich-text img { |
| 182 | 120 | max-width: 100%; | |
| 121 | } | ||
| 122 | |||
| 183 | image { | 123 | image { |
| 184 | max-width: 100%; | 124 | max-width: 100%; |
| 185 | } | 125 | } |
| 186 | 126 | ||
| 187 | audio { | 127 | audio { |
| 188 | width: 100%; | 128 | width: 100%; |
| 189 | } | 129 | } |
| 190 | 130 | ||
| 191 | video { | 131 | video { |
| 192 | width: 100%; | 132 | width: 100%; |
| 193 | } | 133 | } | ... | ... |
| ... | @@ -25,7 +25,7 @@ | ... | @@ -25,7 +25,7 @@ |
| 25 | </view> | 25 | </view> |
| 26 | <view class="ddd" v-if="userType=='2'||userType=='1'"> | 26 | <view class="ddd" v-if="userType=='2'||userType=='1'"> |
| 27 | <text class="lab">总金额:</text> | 27 | <text class="lab">总金额:</text> |
| 28 | <text class="text-danger">¥{{(form.totalAmount*1).toFixed(2) }}</text> | 28 | <text class="text-danger">¥{{ form.totalAmount? (form.totalAmount*1).toFixed(2) : '0' }}</text> |
| 29 | </view> | 29 | </view> |
| 30 | </view> | 30 | </view> |
| 31 | <view class="wBox"> | 31 | <view class="wBox"> | ... | ... |
| ... | @@ -64,7 +64,7 @@ | ... | @@ -64,7 +64,7 @@ |
| 64 | <uni-forms-item label="头像" required> | 64 | <uni-forms-item label="头像" required> |
| 65 | <uni-file-picker v-model="photoArr" @delete="delPhoto" return-type="object" limit="1" | 65 | <uni-file-picker v-model="photoArr" @delete="delPhoto" return-type="object" limit="1" |
| 66 | @select="upPhoto" :del-ico="false" :image-styles="imageStylesTx"></uni-file-picker> | 66 | @select="upPhoto" :del-ico="false" :image-styles="imageStylesTx"></uni-file-picker> |
| 67 | <image mode="aspectFill" v-if="baseFormData.photo2" style="height:200rpx;width:200rpx;" :src="config.baseUrl_api + baseFormData.photo2"/> | 67 | <!-- <image mode="aspectFill" v-if="baseFormData.photo2" style="height:200rpx;width:200rpx;" :src="fillImgUrl(baseFormData.photo2)"/> --> |
| 68 | </uni-forms-item> | 68 | </uni-forms-item> |
| 69 | </view> | 69 | </view> |
| 70 | 70 | ||
| ... | @@ -130,6 +130,7 @@ | ... | @@ -130,6 +130,7 @@ |
| 130 | } from '@dcloudio/uni-app' | 130 | } from '@dcloudio/uni-app' |
| 131 | import config from '@/config.js' | 131 | import config from '@/config.js' |
| 132 | import * as aes2 from '@/common/utils.js' | 132 | import * as aes2 from '@/common/utils.js' |
| 133 | import { fillImgUrl, fillMemberPhoto } from '@/common/utils.js' | ||
| 133 | const current = ref(0) | 134 | const current = ref(0) |
| 134 | const popup = ref(null) | 135 | const popup = ref(null) |
| 135 | const infoConfirm = ref(null) | 136 | const infoConfirm = ref(null) |
| ... | @@ -301,7 +302,7 @@ | ... | @@ -301,7 +302,7 @@ |
| 301 | baseFormData.value.photo = data.data.fang; | 302 | baseFormData.value.photo = data.data.fang; |
| 302 | baseFormData.value.photo2 = data.data.yuan; | 303 | baseFormData.value.photo2 = data.data.yuan; |
| 303 | photoArr.value = { | 304 | photoArr.value = { |
| 304 | url: config.baseUrl_api+baseFormData.value.photo, | 305 | url: fillImgUrl(baseFormData.value.photo), |
| 305 | name: '头像', | 306 | name: '头像', |
| 306 | extname: 'jpg' | 307 | extname: 'jpg' |
| 307 | } | 308 | } |
| ... | @@ -358,26 +359,17 @@ | ... | @@ -358,26 +359,17 @@ |
| 358 | baseFormData.value.phone = res.data.phone | 359 | baseFormData.value.phone = res.data.phone |
| 359 | baseFormData.value.cityId = res.data.cityId | 360 | baseFormData.value.cityId = res.data.cityId |
| 360 | baseFormData.value.address = res.data.address | 361 | baseFormData.value.address = res.data.address |
| 361 | if (res.data.photo) { | 362 | const photoUrl = fillMemberPhoto(res.data) |
| 362 | console.log(res.data.photo) | 363 | if (photoUrl) { |
| 363 | if (res.data.photo.indexOf('http') == -1) { | 364 | console.log(res.data.photo || res.data.perPhoto) |
| 364 | baseFormData.value.photo = res.data.photo | 365 | baseFormData.value.photo = res.data.photo || res.data.perPhoto || '' |
| 365 | let obj = { | 366 | baseFormData.value.photo2 = res.data.photo2 || res.data.perPhoto2 || '' |
| 366 | url: config.baseUrl_api + res.data.photo, | 367 | let obj = { |
| 367 | name: '头像', | 368 | url: photoUrl, |
| 368 | extname: 'jpg' | 369 | name: '头像', |
| 369 | } | 370 | extname: 'jpg' |
| 370 | photoArr.value = obj | ||
| 371 | } else { | ||
| 372 | baseFormData.value.photo = res.data.photo | ||
| 373 | let obj = { | ||
| 374 | url: res.data.photo, | ||
| 375 | name: '头像', | ||
| 376 | extname: 'jpg' | ||
| 377 | } | ||
| 378 | photoArr.value = obj | ||
| 379 | } | 371 | } |
| 380 | 372 | photoArr.value = obj | |
| 381 | } | 373 | } |
| 382 | // baseFormData.value.name = res.data.name | 374 | // baseFormData.value.name = res.data.name |
| 383 | baseFormData.value.perId = res.data.perId | 375 | baseFormData.value.perId = res.data.perId | ... | ... |
| ... | @@ -61,11 +61,12 @@ | ... | @@ -61,11 +61,12 @@ |
| 61 | onLoad, | 61 | onLoad, |
| 62 | onShow | 62 | onShow |
| 63 | } from '@dcloudio/uni-app' | 63 | } from '@dcloudio/uni-app' |
| 64 | import { | 64 | import { |
| 65 | szToHz | 65 | parseAttachmentJson, |
| 66 | } from '@/common/utils.js' | 66 | previewAttachment, |
| 67 | szToHz | ||
| 68 | } from '@/common/utils.js' | ||
| 67 | import * as api from '@/common/api.js' | 69 | import * as api from '@/common/api.js' |
| 68 | import config from '../config'; | ||
| 69 | const inputstyle = ref({ | 70 | const inputstyle = ref({ |
| 70 | borderColor: '#fff', | 71 | borderColor: '#fff', |
| 71 | fontSize: '30rpx' | 72 | fontSize: '30rpx' |
| ... | @@ -242,75 +243,20 @@ import config from '../config'; | ... | @@ -242,75 +243,20 @@ import config from '../config'; |
| 242 | api.getLevelChangeAddList(queryParams.value).then(Response => { | 243 | api.getLevelChangeAddList(queryParams.value).then(Response => { |
| 243 | list.value = Response.rows | 244 | list.value = Response.rows |
| 244 | for (var item of list.value) { | 245 | for (var item of list.value) { |
| 245 | item.examPersonData = JSON.parse(item.examPersonData) | 246 | item.examPersonData = JSON.parse(item.examPersonData) |
| 246 | if (item.fileUrl) { | 247 | if (item.fileUrl) { |
| 247 | item.fileUrl = JSON.parse(item.fileUrl) | 248 | item.fileUrl = parseAttachmentJson(item.fileUrl) |
| 248 | } | 249 | } |
| 249 | } | 250 | } |
| 250 | total.value = Response.total | 251 | total.value = Response.total |
| 251 | uni.hideLoading() | 252 | uni.hideLoading() |
| 252 | }) | 253 | }) |
| 253 | } | 254 | } |
| 254 | 255 | ||
| 255 | function showImg(n) { | 256 | function showImg(n) { |
| 256 | var str= config.baseUrl_api + n.fileUrl[0]?.url | 257 | previewAttachment(n.fileUrl, { title: '查看附件' }) |
| 257 | if(n.fileUrl[0]?.url.indexOf('png')>-1||n.fileUrl[0]?.url.indexOf('jpg')>-1||n.fileUrl[0]?.url.indexOf('jpeg')>-1){ | ||
| 258 | uni.previewImage({ | ||
| 259 | urls: [str], | ||
| 260 | success: function(res) { | ||
| 261 | console.log('success', res) | ||
| 262 | }, | ||
| 263 | fail: function(res) { | ||
| 264 | console.log('fail', res) | ||
| 265 | }, | ||
| 266 | complete: function(res) { | ||
| 267 | console.log('complete', res) | ||
| 268 | } | ||
| 269 | }) | ||
| 270 | }else{ | ||
| 271 | goWebView(str) | ||
| 272 | } | ||
| 273 | } | 258 | } |
| 274 | function goWebView(url){ | 259 | </script> |
| 275 | url = url.replace("http://", "https://") | ||
| 276 | uni.showLoading({ | ||
| 277 | title: '下载中' | ||
| 278 | }); | ||
| 279 | uni.downloadFile({ | ||
| 280 | url: url, | ||
| 281 | success: function(res) { | ||
| 282 | uni.hideLoading(); | ||
| 283 | var filePath = res.tempFilePath; | ||
| 284 | uni.showLoading({ | ||
| 285 | title: '正在打开' | ||
| 286 | }); | ||
| 287 | uni.openDocument({ | ||
| 288 | filePath: filePath, | ||
| 289 | showMenu: true, | ||
| 290 | success: function(res) { | ||
| 291 | uni.hideLoading(); | ||
| 292 | }, | ||
| 293 | fail: function(err) { | ||
| 294 | uni.hideLoading(); | ||
| 295 | uni.showToast({ | ||
| 296 | title: err, | ||
| 297 | icon: 'none', | ||
| 298 | duration: 2000 | ||
| 299 | }); | ||
| 300 | } | ||
| 301 | }); | ||
| 302 | }, | ||
| 303 | fail: function(error) { | ||
| 304 | uni.hideLoading(); | ||
| 305 | uni.showToast({ | ||
| 306 | title: `下载失败`, | ||
| 307 | icon: 'none', | ||
| 308 | duration: 2000 | ||
| 309 | }); | ||
| 310 | } | ||
| 311 | }); | ||
| 312 | } | ||
| 313 | </script> | ||
| 314 | 260 | ||
| 315 | <style scoped lang="scss"> | 261 | <style scoped lang="scss"> |
| 316 | .wBox { | 262 | .wBox { |
| ... | @@ -406,4 +352,4 @@ import config from '../config'; | ... | @@ -406,4 +352,4 @@ import config from '../config'; |
| 406 | :deep(.file-picker__progress) { | 352 | :deep(.file-picker__progress) { |
| 407 | opacity: 0; | 353 | opacity: 0; |
| 408 | } | 354 | } |
| 409 | </style> | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
| 355 | </style> | ... | ... |
| ... | @@ -74,7 +74,7 @@ | ... | @@ -74,7 +74,7 @@ |
| 74 | onLoad | 74 | onLoad |
| 75 | } from '@dcloudio/uni-app' | 75 | } from '@dcloudio/uni-app' |
| 76 | import * as api from '@/common/api.js' | 76 | import * as api from '@/common/api.js' |
| 77 | import config from '@/config.js' | 77 | import { parseAttachmentJson, previewAttachment } from '@/common/utils.js' |
| 78 | const queryParams = ref({}) | 78 | const queryParams = ref({}) |
| 79 | const total = ref(0) | 79 | const total = ref(0) |
| 80 | const list = ref([]) | 80 | const list = ref([]) |
| ... | @@ -120,7 +120,7 @@ | ... | @@ -120,7 +120,7 @@ |
| 120 | api.addInfoModeList(queryParams.value).then(res => { | 120 | api.addInfoModeList(queryParams.value).then(res => { |
| 121 | list.value = res.rows | 121 | list.value = res.rows |
| 122 | list.value.forEach(item => { | 122 | list.value.forEach(item => { |
| 123 | item.fileUrl = JSON.parse(item.fileUrl) | 123 | item.fileUrl = parseAttachmentJson(item.fileUrl) |
| 124 | }) | 124 | }) |
| 125 | total.value = res.total | 125 | total.value = res.total |
| 126 | uni.hideLoading() | 126 | uni.hideLoading() |
| ... | @@ -150,67 +150,10 @@ | ... | @@ -150,67 +150,10 @@ |
| 150 | }) | 150 | }) |
| 151 | } | 151 | } |
| 152 | 152 | ||
| 153 | function showImg(n) { | 153 | function showImg(n) { |
| 154 | var str = config.baseUrl_api + n.fileUrl[0]?.url | 154 | previewAttachment(n.fileUrl, { title: '查看附件' }) |
| 155 | if (n.fileUrl[0]?.url.indexOf('png') > -1 || n.fileUrl[0]?.url.indexOf('jpg') > -1 || n.fileUrl[0]?.url.indexOf( | 155 | } |
| 156 | 'jpeg') > -1) { | 156 | </script> |
| 157 | uni.previewImage({ | ||
| 158 | urls: [str], | ||
| 159 | success: function(res) { | ||
| 160 | console.log('success', res) | ||
| 161 | }, | ||
| 162 | fail: function(res) { | ||
| 163 | console.log('fail', res) | ||
| 164 | }, | ||
| 165 | complete: function(res) { | ||
| 166 | console.log('complete', res) | ||
| 167 | } | ||
| 168 | }) | ||
| 169 | } else { | ||
| 170 | goWebView(str) | ||
| 171 | } | ||
| 172 | } | ||
| 173 | |||
| 174 | function goWebView(url) { | ||
| 175 | url = url.replace("http://", "https://") | ||
| 176 | uni.showLoading({ | ||
| 177 | title: '下载中' | ||
| 178 | }); | ||
| 179 | uni.downloadFile({ | ||
| 180 | url: url, | ||
| 181 | success: function(res) { | ||
| 182 | uni.hideLoading(); | ||
| 183 | var filePath = res.tempFilePath; | ||
| 184 | uni.showLoading({ | ||
| 185 | title: '正在打开' | ||
| 186 | }); | ||
| 187 | uni.openDocument({ | ||
| 188 | filePath: filePath, | ||
| 189 | showMenu: true, | ||
| 190 | success: function(res) { | ||
| 191 | uni.hideLoading(); | ||
| 192 | }, | ||
| 193 | fail: function(err) { | ||
| 194 | uni.hideLoading(); | ||
| 195 | uni.showToast({ | ||
| 196 | title: err, | ||
| 197 | icon: 'none', | ||
| 198 | duration: 2000 | ||
| 199 | }); | ||
| 200 | } | ||
| 201 | }); | ||
| 202 | }, | ||
| 203 | fail: function(error) { | ||
| 204 | uni.hideLoading(); | ||
| 205 | uni.showToast({ | ||
| 206 | title: `下载失败`, | ||
| 207 | icon: 'none', | ||
| 208 | duration: 2000 | ||
| 209 | }); | ||
| 210 | } | ||
| 211 | }); | ||
| 212 | } | ||
| 213 | </script> | ||
| 214 | <style scoped lang="scss"> | 157 | <style scoped lang="scss"> |
| 215 | .flexbox { | 158 | .flexbox { |
| 216 | padding: 30rpx 30rpx 0 | 159 | padding: 30rpx 30rpx 0 |
| ... | @@ -244,4 +187,4 @@ | ... | @@ -244,4 +187,4 @@ |
| 244 | background: #fff; | 187 | background: #fff; |
| 245 | padding: 30rpx; | 188 | padding: 30rpx; |
| 246 | } | 189 | } |
| 247 | </style> | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
| 190 | </style> | ... | ... |
| ... | @@ -26,9 +26,9 @@ | ... | @@ -26,9 +26,9 @@ |
| 26 | 26 | ||
| 27 | <!-- 会员证 --> | 27 | <!-- 会员证 --> |
| 28 | <view style="margin: 30rpx 0 0;" v-if="form.certStage!=0&&form.idcType!=3&&form.certStage!=2&&form.certStage!=1"> | 28 | <view style="margin: 30rpx 0 0;" v-if="form.certStage!=0&&form.idcType!=3&&form.certStage!=2&&form.certStage!=1"> |
| 29 | <view class="zhengBox"> | 29 | <view class="zhengBox"> |
| 30 | <image v-if="form.certStage == 4" style="width: 600rpx; height: 380rpx;position: relative" :src="config.baseUrl_api+'/fs/static/icon/memberCardU.png'" :fit="fit" /> | 30 | <image v-if="form.certStage == 4" style="width: 600rpx; height: 380rpx;position: relative" :src="config.baseUrl_api+'/fs/static/icon/memberCardU.png'" :fit="fit" /> |
| 31 | <image v-else style="width: 600rpx; height: 380rpx;position: relative" :src="config.baseUrl_api+'/fs/static/icon/memberCard.png'" :fit="fit" /> | 31 | <image v-else style="width: 600rpx; height: 380rpx;position: relative" :src="config.baseUrl_api+'/fs/static/icon/memberCard.png'" :fit="fit" /> |
| 32 | <view class="zhengbody" @contextmenu.prevent="youji"> | 32 | <view class="zhengbody" @contextmenu.prevent="youji"> |
| 33 | <image mode="aspectFill" :src="(form.photo)" class="head"/> | 33 | <image mode="aspectFill" :src="(form.photo)" class="head"/> |
| 34 | <view class="memberNumber">{{ form.perCode }}</view> | 34 | <view class="memberNumber">{{ form.perCode }}</view> |
| ... | @@ -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 { fillImgUrl } from '@/common/utils.js' | ||
| 68 | import { | 69 | import { |
| 69 | onLoad, | 70 | onLoad, |
| 70 | onShow | 71 | onShow |
| ... | @@ -99,7 +100,7 @@ | ... | @@ -99,7 +100,7 @@ |
| 99 | value: '6' | 100 | value: '6' |
| 100 | } | 101 | } |
| 101 | ]) | 102 | ]) |
| 102 | const form = ref({}) | 103 | const form = ref({}) |
| 103 | const urlHref = ref() | 104 | const urlHref = ref() |
| 104 | onLoad((option) => { | 105 | onLoad((option) => { |
| 105 | console.log(option) | 106 | console.log(option) |
| ... | @@ -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 = fillImgUrl(form.value.photo) |
| 115 | form.value.photo = config.baseUrl_api + form.value.photo | ||
| 116 | } | ||
| 117 | }) | 116 | }) |
| 118 | }) | 117 | }) |
| 119 | 118 | ||
| ... | @@ -129,15 +128,15 @@ | ... | @@ -129,15 +128,15 @@ |
| 129 | } | 128 | } |
| 130 | } | 129 | } |
| 131 | }) | 130 | }) |
| 132 | } | 131 | } |
| 133 | function fileData(time) { | 132 | function fileData(time) { |
| 134 | if (!time) return | 133 | if (!time) return |
| 135 | const data = new Date(time.replace(/-/g, '/')) | 134 | const data = new Date(time.replace(/-/g, '/')) |
| 136 | const year = data.getFullYear() | 135 | const year = data.getFullYear() |
| 137 | const month = data.getMonth() + 1 | 136 | const month = data.getMonth() + 1 |
| 138 | const dates = data.getDate() | 137 | const dates = data.getDate() |
| 139 | return year + '年' + month + '月' + dates + '日' | 138 | return year + '年' + month + '月' + dates + '日' |
| 140 | } | 139 | } |
| 141 | 140 | ||
| 142 | </script> | 141 | </script> |
| 143 | 142 | ||
| ... | @@ -215,63 +214,63 @@ | ... | @@ -215,63 +214,63 @@ |
| 215 | color: #fff; | 214 | color: #fff; |
| 216 | text-align: center; | 215 | text-align: center; |
| 217 | border-radius: 50%; | 216 | border-radius: 50%; |
| 218 | } | 217 | } |
| 219 | .zhengBox{ | 218 | .zhengBox{ |
| 220 | position: relative;width: 600rpx; height: 380rpx;margin:0 auto 30rpx; | 219 | position: relative;width: 600rpx; height: 380rpx;margin:0 auto 30rpx; |
| 221 | .zhengbody{ | 220 | .zhengbody{ |
| 222 | .head{width: 114rpx;height: 114rpx;border-radius: 50%;position: absolute;left: 65rpx;top: 132rpx;} | 221 | .head{width: 114rpx;height: 114rpx;border-radius: 50%;position: absolute;left: 65rpx;top: 132rpx;} |
| 223 | .birthday{ | 222 | .birthday{ |
| 224 | position: absolute; top: 158rpx;left: 434rpx; | 223 | position: absolute; top: 158rpx;left: 434rpx; |
| 225 | font-size: 16rpx; | 224 | font-size: 16rpx; |
| 226 | color: #9f6a44; | 225 | color: #9f6a44; |
| 227 | } | 226 | } |
| 228 | .memberNumber{ | 227 | .memberNumber{ |
| 229 | position: absolute;top: 182rpx;left: 290rpx; | 228 | position: absolute;top: 182rpx;left: 290rpx; |
| 230 | font-size: 19rpx; | 229 | font-size: 19rpx; |
| 231 | color: #9f6a44; | 230 | color: #9f6a44; |
| 232 | font-weight: 600; | 231 | font-weight: 600; |
| 233 | letter-spacing: 1px; | 232 | letter-spacing: 1px; |
| 234 | } | 233 | } |
| 235 | .phone{ | 234 | .phone{ |
| 236 | position: absolute; top: 292rpx;left: 340rpx; | 235 | position: absolute; top: 292rpx;left: 340rpx; |
| 237 | font-size: 16rpx; | 236 | font-size: 16rpx; |
| 238 | color: #bc9060; | 237 | color: #bc9060; |
| 239 | } | 238 | } |
| 240 | .service{ | 239 | .service{ |
| 241 | position: absolute; | 240 | position: absolute; |
| 242 | top: 313rpx; | 241 | top: 313rpx; |
| 243 | left: 340rpx; | 242 | left: 340rpx; |
| 244 | font-size: 16rpx; | 243 | font-size: 16rpx; |
| 245 | color: #bc9060; | 244 | color: #bc9060; |
| 246 | 245 | ||
| 247 | } | 246 | } |
| 248 | .validity{ | 247 | .validity{ |
| 249 | position: absolute; | 248 | position: absolute; |
| 250 | top: 336rpx; | 249 | top: 336rpx; |
| 251 | left: 340rpx; | 250 | left: 340rpx; |
| 252 | font-size: 16rpx; | 251 | font-size: 16rpx; |
| 253 | color: #bc9060; | 252 | color: #bc9060; |
| 254 | 253 | ||
| 255 | } | 254 | } |
| 256 | .nameC{ | 255 | .nameC{ |
| 257 | position: absolute; | 256 | position: absolute; |
| 258 | top: 146rpx; | 257 | top: 146rpx; |
| 259 | left: 240rpx; | 258 | left: 240rpx; |
| 260 | color: #9f6a44; | 259 | color: #9f6a44; |
| 261 | font-weight: 600; | 260 | font-weight: 600; |
| 262 | line-height: 1; | 261 | line-height: 1; |
| 263 | } | 262 | } |
| 264 | .content{ | 263 | .content{ |
| 265 | width: 120rpx; | 264 | width: 120rpx; |
| 266 | box-sizing: border-box; | 265 | box-sizing: border-box; |
| 267 | display: flex; | 266 | display: flex; |
| 268 | align-items: center; | 267 | align-items: center; |
| 269 | //white-space: nowrap; | 268 | //white-space: nowrap; |
| 270 | overflow: hidden; | 269 | overflow: hidden; |
| 271 | overflow-x: auto; | 270 | overflow-x: auto; |
| 272 | transform-origin: 0 55%; | 271 | transform-origin: 0 55%; |
| 273 | white-space: nowrap; | 272 | white-space: nowrap; |
| 274 | } | 273 | } |
| 275 | } | 274 | } |
| 276 | } | 275 | } |
| 277 | </style> | 276 | </style> |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| ... | @@ -52,7 +52,7 @@ | ... | @@ -52,7 +52,7 @@ |
| 52 | </view> | 52 | </view> |
| 53 | </view> | 53 | </view> |
| 54 | <view class="nodata" v-if="list.length==0"> | 54 | <view class="nodata" v-if="list.length==0"> |
| 55 | <image mode="aspectFit" src="/static/nodata.png"></image> | 55 | <image mode="aspectFit" :src="config.baseUrl_api + '/fs/static/nodata.png'"></image> |
| 56 | <text>暂无数据</text> | 56 | <text>暂无数据</text> |
| 57 | </view> | 57 | </view> |
| 58 | 58 | ||
| ... | @@ -83,6 +83,7 @@ | ... | @@ -83,6 +83,7 @@ |
| 83 | <script setup> | 83 | <script setup> |
| 84 | import * as api from '@/common/api.js' | 84 | import * as api from '@/common/api.js' |
| 85 | import config from '@/config.js' | 85 | import config from '@/config.js' |
| 86 | import { parseAttachmentJson, previewAttachment } from '@/common/utils.js' | ||
| 86 | import { | 87 | import { |
| 87 | onMounted, | 88 | onMounted, |
| 88 | ref | 89 | ref |
| ... | @@ -127,67 +128,8 @@ function handleUpdate(item) { | ... | @@ -127,67 +128,8 @@ function handleUpdate(item) { |
| 127 | } | 128 | } |
| 128 | function downloadOrder(item) { | 129 | function downloadOrder(item) { |
| 129 | //下载凭证 | 130 | //下载凭证 |
| 130 | var arr = JSON.parse(item.payEvidence) || [] | 131 | const arr = parseAttachmentJson(item.payEvidence) || [] |
| 131 | showImg(arr[0]?.url) | 132 | previewAttachment(arr[0] || arr, { title: '查看凭证' }) |
| 132 | } | ||
| 133 | function showImg(url) { | ||
| 134 | var str = config.baseUrl_api + url | ||
| 135 | if (url.indexOf('png') > -1 || url.indexOf('jpg') > -1 || url.indexOf('jpeg') > -1) { | ||
| 136 | uni.previewImage({ | ||
| 137 | urls: [str], | ||
| 138 | success: function(res) { | ||
| 139 | console.log('success', res) | ||
| 140 | }, | ||
| 141 | fail: function(res) { | ||
| 142 | console.log('fail', res) | ||
| 143 | }, | ||
| 144 | complete: function(res) { | ||
| 145 | console.log('complete', res) | ||
| 146 | } | ||
| 147 | }) | ||
| 148 | } else { | ||
| 149 | goWebView(str) | ||
| 150 | } | ||
| 151 | } | ||
| 152 | |||
| 153 | function goWebView(url) { | ||
| 154 | url = url.replace("http://", "https://") | ||
| 155 | uni.showLoading({ | ||
| 156 | title: '下载中' | ||
| 157 | }); | ||
| 158 | uni.downloadFile({ | ||
| 159 | url: url, | ||
| 160 | success: function(res) { | ||
| 161 | uni.hideLoading(); | ||
| 162 | var filePath = res.tempFilePath; | ||
| 163 | uni.showLoading({ | ||
| 164 | title: '正在打开' | ||
| 165 | }); | ||
| 166 | uni.openDocument({ | ||
| 167 | filePath: filePath, | ||
| 168 | showMenu: true, | ||
| 169 | success: function(res) { | ||
| 170 | uni.hideLoading(); | ||
| 171 | }, | ||
| 172 | fail: function(err) { | ||
| 173 | uni.hideLoading(); | ||
| 174 | uni.showToast({ | ||
| 175 | title: err, | ||
| 176 | icon: 'none', | ||
| 177 | duration: 2000 | ||
| 178 | }); | ||
| 179 | } | ||
| 180 | }); | ||
| 181 | }, | ||
| 182 | fail: function(error) { | ||
| 183 | uni.hideLoading(); | ||
| 184 | uni.showToast({ | ||
| 185 | title: `下载失败`, | ||
| 186 | icon: 'none', | ||
| 187 | duration: 2000 | ||
| 188 | }); | ||
| 189 | } | ||
| 190 | }); | ||
| 191 | } | 133 | } |
| 192 | 134 | ||
| 193 | let selectFileValue = {} | 135 | let selectFileValue = {} | ... | ... |
| 1 | <template> | 1 | <template> |
| 2 | <view> | 2 | <view> |
| 3 | <z-paging ref="paging" v-show="total>0" v-model="list" @query="getQuery" emptyViewImg="/static/nodata.png"> | 3 | <z-paging ref="paging" v-show="total>0" v-model="list" @query="getQuery" emptyViewImg="/static/nodata.png"> |
| 4 | <view class="searchbar" :slot="top"> | 4 | <view class="searchbar" :slot="top"> |
| 5 | <uni-easyinput placeholderStyle="font-size:30rpx" :input-border="false" prefixIcon="search" | 5 | <uni-easyinput placeholderStyle="font-size:30rpx" :input-border="false" prefixIcon="search" |
| 6 | v-model="query.name" @blur="getList" @clear="getList" placeholder="搜索姓名"> | 6 | v-model="query.name" @blur="getList" @clear="getList" placeholder="搜索姓名"> |
| 7 | </uni-easyinput> | 7 | </uni-easyinput> |
| 8 | 8 | ||
| 9 | </view> | 9 | </view> |
| 10 | <view class="pdbox"> | 10 | <view class="pdbox"> |
| 11 | 11 | ||
| ... | @@ -55,7 +55,7 @@ | ... | @@ -55,7 +55,7 @@ |
| 55 | </template> | 55 | </template> |
| 56 | </uni-swipe-action-item> | 56 | </uni-swipe-action-item> |
| 57 | </uni-swipe-action> | 57 | </uni-swipe-action> |
| 58 | </view> | 58 | </view> |
| 59 | 59 | ||
| 60 | </view> | 60 | </view> |
| 61 | </z-paging> | 61 | </z-paging> |
| ... | @@ -63,39 +63,40 @@ | ... | @@ -63,39 +63,40 @@ |
| 63 | <!-- <image mode="aspectFit" src="/static/nodata.png"></image> --> | 63 | <!-- <image mode="aspectFit" src="/static/nodata.png"></image> --> |
| 64 | <button class="btn-red" v-if="userType=='4'" @click="goVipList">+ 添加会员</button> | 64 | <button class="btn-red" v-if="userType=='4'" @click="goVipList">+ 添加会员</button> |
| 65 | <!-- <text v-else>暂无数据</text> --> | 65 | <!-- <text v-else>暂无数据</text> --> |
| 66 | </view> | 66 | </view> |
| 67 | </view> | 67 | </view> |
| 68 | </template> | 68 | </template> |
| 69 | 69 | ||
| 70 | <script setup> | 70 | <script setup> |
| 71 | import * as api from '@/common/api.js' | 71 | import * as api from '@/common/api.js' |
| 72 | import config from '@/config.js' | 72 | import { fillImgUrl, previewAttachment } from '@/common/utils.js' |
| 73 | import { | 73 | import config from '@/config.js' |
| 74 | onMounted, | 74 | import { |
| 75 | ref | 75 | onMounted, |
| 76 | } from 'vue' | 76 | ref |
| 77 | import { | 77 | } from 'vue' |
| 78 | onLoad,onShow | 78 | import { |
| 79 | } from '@dcloudio/uni-app' | 79 | onLoad,onShow |
| 80 | const query = ref({ | 80 | } from '@dcloudio/uni-app' |
| 81 | pageNum: 1, | 81 | const query = ref({ |
| 82 | pageSize: 20, | 82 | pageNum: 1, |
| 83 | showMyPersonFlag: null, | 83 | pageSize: 20, |
| 84 | multiDeptFlag: 1, | 84 | showMyPersonFlag: null, |
| 85 | perType: 1, | 85 | multiDeptFlag: 1, |
| 86 | checkPaymentCommit: 1 | 86 | perType: 1, |
| 87 | checkPaymentCommit: 1 | ||
| 88 | }) | ||
| 89 | const paging = ref(null) | ||
| 90 | const userType = ref('') | ||
| 91 | const list = ref([]) | ||
| 92 | const total = ref(0) | ||
| 93 | const app = getApp(); | ||
| 94 | onLoad(() => { | ||
| 95 | userType.value = app.globalData.userType | ||
| 96 | }) | ||
| 97 | onShow(() => { | ||
| 98 | getList() | ||
| 87 | }) | 99 | }) |
| 88 | const paging = ref(null) | ||
| 89 | const userType = ref('') | ||
| 90 | const list = ref([]) | ||
| 91 | const total = ref(0) | ||
| 92 | const app = getApp(); | ||
| 93 | onLoad(() => { | ||
| 94 | userType.value = app.globalData.userType | ||
| 95 | }) | ||
| 96 | onShow(() => { | ||
| 97 | getList() | ||
| 98 | }) | ||
| 99 | function getQuery(pageNum,pageSize){ | 100 | function getQuery(pageNum,pageSize){ |
| 100 | query.value.pageNum = pageNum | 101 | query.value.pageNum = pageNum |
| 101 | query.value.pageSize = pageSize | 102 | query.value.pageSize = pageSize |
| ... | @@ -106,106 +107,102 @@ | ... | @@ -106,106 +107,102 @@ |
| 106 | } | 107 | } |
| 107 | api.selectPageList(query.value).then(res => { | 108 | api.selectPageList(query.value).then(res => { |
| 108 | for (var l of res.rows) { | 109 | for (var l of res.rows) { |
| 109 | if (l.photo && l.photo.indexOf('http') == -1) { | 110 | l.photo = fillImgUrl(l.photo) |
| 110 | l.photo = config.baseUrl_api + l.photo | ||
| 111 | } | ||
| 112 | } | 111 | } |
| 113 | list.value = res.rows | 112 | list.value = res.rows |
| 114 | paging.value.complete(res.rows) | 113 | paging.value.complete(res.rows) |
| 115 | total.value = res.total | 114 | total.value = res.total |
| 116 | }) | 115 | }) |
| 117 | } | 116 | } |
| 118 | function getList() { | 117 | function getList() { |
| 119 | uni.showLoading({ | 118 | uni.showLoading({ |
| 120 | title: '加载中' | 119 | title: '加载中' |
| 121 | }) | 120 | }) |
| 122 | if (app.globalData.userType == '4') { | 121 | if (app.globalData.userType == '4') { |
| 123 | // 道馆 | 122 | // 道馆 |
| 124 | query.value.multiDeptFlag = null | 123 | query.value.multiDeptFlag = null |
| 125 | query.value.showMyPersonFlag = 1 | 124 | query.value.showMyPersonFlag = 1 |
| 126 | } | 125 | } |
| 127 | api.selectPageList(query.value).then(res => { | 126 | api.selectPageList(query.value).then(res => { |
| 128 | for (var l of res.rows) { | 127 | for (var l of res.rows) { |
| 129 | if (l.photo && l.photo.indexOf('http') == -1) { | 128 | l.photo = fillImgUrl(l.photo) |
| 130 | l.photo = config.baseUrl_api + l.photo | ||
| 131 | } | ||
| 132 | } | 129 | } |
| 133 | list.value = res.rows | 130 | list.value = res.rows |
| 134 | paging.value.complete(res.rows) | 131 | paging.value.complete(res.rows) |
| 135 | total.value = res.total | 132 | total.value = res.total |
| 136 | uni.hideLoading() | 133 | uni.hideLoading() |
| 137 | }) | 134 | }) |
| 138 | } | 135 | } |
| 139 | 136 | ||
| 140 | function handleDelete(item) { | 137 | function handleDelete(item) { |
| 141 | uni.showModal({ | 138 | uni.showModal({ |
| 142 | content: `是否确认删除${item.name}`, | 139 | content: `是否确认删除${item.name}`, |
| 143 | success: function(res) { | 140 | success: function(res) { |
| 144 | if (res.confirm) { | 141 | if (res.confirm) { |
| 145 | api.delInfo(item.perId).then(response => { | 142 | api.delInfo(item.perId).then(response => { |
| 146 | uni.showToast({ | 143 | uni.showToast({ |
| 147 | title: '删除成功', | 144 | title: '删除成功', |
| 148 | icon: 'none' | 145 | icon: 'none' |
| 149 | }) | 146 | }) |
| 150 | getList() | 147 | getList() |
| 151 | }) | 148 | }) |
| 152 | } | 149 | } |
| 153 | } | 150 | } |
| 154 | }) | 151 | }) |
| 155 | } | 152 | } |
| 156 | 153 | ||
| 157 | function handleUpdate(n) { | 154 | function handleUpdate(n) { |
| 158 | uni.navigateTo({ | 155 | uni.navigateTo({ |
| 159 | url: `/personalVip/editVip?perId=${n.perId}&perType=${n.perType}` | 156 | url: `/personalVip/editVip?perId=${n.perId}&perType=${n.perType}` |
| 160 | }) | 157 | }) |
| 161 | } | 158 | } |
| 162 | 159 | ||
| 163 | function handleInfo(n) { | 160 | function handleInfo(n) { |
| 164 | uni.navigateTo({ | 161 | uni.navigateTo({ |
| 165 | url: `/personalVip/detail?perId=${n.perId}` | 162 | url: `/personalVip/detail?perId=${n.perId}` |
| 166 | }) | 163 | }) |
| 167 | } | 164 | } |
| 168 | 165 | ||
| 169 | function goVipList() { | 166 | function goVipList() { |
| 170 | let path = '/personalVip/addVip'; | 167 | let path = '/personalVip/addVip'; |
| 171 | uni.navigateTo({ | 168 | uni.navigateTo({ |
| 172 | url: path | 169 | url: path |
| 173 | }); | 170 | }); |
| 174 | } | 171 | } |
| 175 | </script> | 172 | </script> |
| 176 | 173 | ||
| 177 | <style scoped lang="scss"> | 174 | <style scoped lang="scss"> |
| 178 | .personitem{margin: 0 0 30rpx;} | 175 | .personitem{margin: 0 0 30rpx;} |
| 179 | .searchbar { | 176 | .searchbar { |
| 180 | display: flex; | 177 | display: flex; |
| 181 | align-items: center; | 178 | align-items: center; |
| 182 | padding: 25rpx; | 179 | padding: 25rpx; |
| 183 | box-sizing: border-box; | 180 | box-sizing: border-box; |
| 184 | 181 | ||
| 185 | .invertedbtn-red { | 182 | .invertedbtn-red { |
| 186 | margin-left: 15rpx; | 183 | margin-left: 15rpx; |
| 187 | font-size: 30rpx; | 184 | font-size: 30rpx; |
| 188 | padding: 16rpx 20rpx; | 185 | padding: 16rpx 20rpx; |
| 189 | box-sizing: border-box; | 186 | box-sizing: border-box; |
| 190 | border-radius: 50rpx; | 187 | border-radius: 50rpx; |
| 191 | background-color: #fff; | 188 | background-color: #fff; |
| 192 | } | 189 | } |
| 193 | 190 | ||
| 194 | :deep(.uni-easyinput .uni-easyinput__content) { | 191 | :deep(.uni-easyinput .uni-easyinput__content) { |
| 195 | border-radius: 35rpx; | 192 | border-radius: 35rpx; |
| 196 | border: none; | 193 | border: none; |
| 197 | height: 70rpx; | 194 | height: 70rpx; |
| 198 | } | 195 | } |
| 199 | 196 | ||
| 200 | :deep(.uni-easyinput__content-input) { | 197 | :deep(.uni-easyinput__content-input) { |
| 201 | font-size: 26rpx; | 198 | font-size: 26rpx; |
| 202 | } | 199 | } |
| 203 | } | 200 | } |
| 204 | 201 | ||
| 205 | .content-box { | 202 | .content-box { |
| 206 | background: #fff; | 203 | background: #fff; |
| 207 | .photobox{margin-right: 20rpx; | 204 | .photobox{margin-right: 20rpx; |
| 208 | } | 205 | } |
| 209 | } | 206 | } |
| 210 | .pdbox{padding: 0 20rpx;} | 207 | .pdbox{padding: 0 20rpx;} |
| 211 | </style> | 208 | </style> |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| ... | @@ -2,7 +2,7 @@ | ... | @@ -2,7 +2,7 @@ |
| 2 | <view> | 2 | <view> |
| 3 | <uni-collapse> | 3 | <uni-collapse> |
| 4 | <uni-collapse-item :title="n.personInfo?.name" open v-for="n in list" :key="n.id"> | 4 | <uni-collapse-item :title="n.personInfo?.name" open v-for="n in list" :key="n.id"> |
| 5 | <view class="collapseBody"> | 5 | <view class="collapseBody"> |
| 6 | <!-- n.oldIdcCode --> | 6 | <!-- n.oldIdcCode --> |
| 7 | <view> | 7 | <view> |
| 8 | <label>姓名:</label> | 8 | <label>姓名:</label> |
| ... | @@ -19,16 +19,16 @@ | ... | @@ -19,16 +19,16 @@ |
| 19 | <view style="display: flex;"> | 19 | <view style="display: flex;"> |
| 20 | <label>有效期:</label> | 20 | <label>有效期:</label> |
| 21 | <view> | 21 | <view> |
| 22 | <view v-if="n.personInfo?.valiDateTime"> | 22 | <view v-if="n.personInfo?.valiDateTime"> |
| 23 | <text v-if="n.personInfo?.beginTime">{{n.personInfo?.beginTime?.slice(0,10)}}</text> | 23 | <text v-if="n.personInfo?.beginTime">{{n.personInfo?.beginTime?.slice(0,10)}}</text> |
| 24 | <text v-if="n.personInfo?.beginTime">至</text> | 24 | <text v-if="n.personInfo?.beginTime">至</text> |
| 25 | <text>{{n.personInfo?.valiDateTime?.slice(0,10)}}</text> | 25 | <text>{{n.personInfo?.valiDateTime?.slice(0,10)}}</text> |
| 26 | </view> | 26 | </view> |
| 27 | <view class="text-danger" v-if="n.oldPersonInfo?.valiDateTime"> | 27 | <view class="text-danger" v-if="n.oldPersonInfo?.valiDateTime"> |
| 28 | <text v-if="n.oldPersonInfo?.beginTime">{{ n.oldPersonInfo?.beginTime?.slice(0,10)}}</text> | 28 | <text v-if="n.oldPersonInfo?.beginTime">{{ n.oldPersonInfo?.beginTime?.slice(0,10)}}</text> |
| 29 | <text v-if="n.oldPersonInfo?.beginTime">至</text> | 29 | <text v-if="n.oldPersonInfo?.beginTime">至</text> |
| 30 | <text v-if="n.oldPersonInfo?.valiDateTime">{{n.oldPersonInfo?.valiDateTime?.slice(0,10)}}</text> | 30 | <text v-if="n.oldPersonInfo?.valiDateTime">{{n.oldPersonInfo?.valiDateTime?.slice(0,10)}}</text> |
| 31 | </view> | 31 | </view> |
| 32 | <view class="text-danger" v-else>--</view> | 32 | <view class="text-danger" v-else>--</view> |
| 33 | </view> | 33 | </view> |
| 34 | </view> | 34 | </view> |
| ... | @@ -102,7 +102,7 @@ | ... | @@ -102,7 +102,7 @@ |
| 102 | <uni-td>{{szToHz(tr.level)}}段</uni-td> | 102 | <uni-td>{{szToHz(tr.level)}}段</uni-td> |
| 103 | <uni-td>{{tr.certCode}}</uni-td> | 103 | <uni-td>{{tr.certCode}}</uni-td> |
| 104 | </uni-tr> | 104 | </uni-tr> |
| 105 | </uni-table> | 105 | </uni-table> |
| 106 | </view> | 106 | </view> |
| 107 | <text v-else class="text-danger">无段位记录</text> | 107 | <text v-else class="text-danger">无段位记录</text> |
| 108 | </view> | 108 | </view> |
| ... | @@ -128,10 +128,11 @@ | ... | @@ -128,10 +128,11 @@ |
| 128 | onLoad | 128 | onLoad |
| 129 | } from '@dcloudio/uni-app' | 129 | } from '@dcloudio/uni-app' |
| 130 | import * as api from '@/common/api.js' | 130 | import * as api from '@/common/api.js' |
| 131 | import { | 131 | import { |
| 132 | szToHz | 132 | parseAttachmentJson, |
| 133 | } from '@/common/utils.js' | 133 | previewAttachment, |
| 134 | import config from '@/config.js' | 134 | szToHz |
| 135 | } from '@/common/utils.js' | ||
| 135 | const queryParams = ref({}) | 136 | const queryParams = ref({}) |
| 136 | const total = ref(0) | 137 | const total = ref(0) |
| 137 | const list = ref([]) | 138 | const list = ref([]) |
| ... | @@ -150,10 +151,10 @@ | ... | @@ -150,10 +151,10 @@ |
| 150 | title: '加载中' | 151 | title: '加载中' |
| 151 | }) | 152 | }) |
| 152 | api.infoMergeList(queryParams.value).then(res => { | 153 | api.infoMergeList(queryParams.value).then(res => { |
| 153 | list.value = res.rows | 154 | list.value = res.rows |
| 154 | list.value.forEach(item => { | 155 | list.value.forEach(item => { |
| 155 | item.fileUrl = JSON.parse(item.fileUrl) | 156 | item.fileUrl = parseAttachmentJson(item.fileUrl) |
| 156 | }) | 157 | }) |
| 157 | total.value = res.total | 158 | total.value = res.total |
| 158 | uni.hideLoading() | 159 | uni.hideLoading() |
| 159 | }) | 160 | }) |
| ... | @@ -182,67 +183,10 @@ | ... | @@ -182,67 +183,10 @@ |
| 182 | }) | 183 | }) |
| 183 | } | 184 | } |
| 184 | 185 | ||
| 185 | function showImg(n) { | 186 | function showImg(n) { |
| 186 | var str = config.baseUrl_api + n.fileUrl[0]?.url | 187 | previewAttachment(n.fileUrl, { title: '查看附件' }) |
| 187 | if (n.fileUrl[0]?.url.indexOf('png') > -1 || n.fileUrl[0]?.url.indexOf('jpg') > -1 || n.fileUrl[0]?.url.indexOf( | 188 | } |
| 188 | 'jpeg') > -1) { | 189 | </script> |
| 189 | uni.previewImage({ | ||
| 190 | urls: [str], | ||
| 191 | success: function(res) { | ||
| 192 | console.log('success', res) | ||
| 193 | }, | ||
| 194 | fail: function(res) { | ||
| 195 | console.log('fail', res) | ||
| 196 | }, | ||
| 197 | complete: function(res) { | ||
| 198 | console.log('complete', res) | ||
| 199 | } | ||
| 200 | }) | ||
| 201 | } else { | ||
| 202 | goWebView(str) | ||
| 203 | } | ||
| 204 | } | ||
| 205 | |||
| 206 | function goWebView(url) { | ||
| 207 | url = url.replace("http://", "https://") | ||
| 208 | uni.showLoading({ | ||
| 209 | title: '下载中' | ||
| 210 | }); | ||
| 211 | uni.downloadFile({ | ||
| 212 | url: url, | ||
| 213 | success: function(res) { | ||
| 214 | uni.hideLoading(); | ||
| 215 | var filePath = res.tempFilePath; | ||
| 216 | uni.showLoading({ | ||
| 217 | title: '正在打开' | ||
| 218 | }); | ||
| 219 | uni.openDocument({ | ||
| 220 | filePath: filePath, | ||
| 221 | showMenu: true, | ||
| 222 | success: function(res) { | ||
| 223 | uni.hideLoading(); | ||
| 224 | }, | ||
| 225 | fail: function(err) { | ||
| 226 | uni.hideLoading(); | ||
| 227 | uni.showToast({ | ||
| 228 | title: err, | ||
| 229 | icon: 'none', | ||
| 230 | duration: 2000 | ||
| 231 | }); | ||
| 232 | } | ||
| 233 | }); | ||
| 234 | }, | ||
| 235 | fail: function(error) { | ||
| 236 | uni.hideLoading(); | ||
| 237 | uni.showToast({ | ||
| 238 | title: `下载失败`, | ||
| 239 | icon: 'none', | ||
| 240 | duration: 2000 | ||
| 241 | }); | ||
| 242 | } | ||
| 243 | }); | ||
| 244 | } | ||
| 245 | </script> | ||
| 246 | <style scoped lang="scss"> | 190 | <style scoped lang="scss"> |
| 247 | .flexbox { | 191 | .flexbox { |
| 248 | padding: 30rpx 30rpx 0 | 192 | padding: 30rpx 30rpx 0 |
| ... | @@ -277,4 +221,4 @@ | ... | @@ -277,4 +221,4 @@ |
| 277 | background: #fff; | 221 | background: #fff; |
| 278 | padding: 30rpx; | 222 | padding: 30rpx; |
| 279 | } | 223 | } |
| 280 | </style> | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
| 224 | </style> | ... | ... |
| ... | @@ -82,6 +82,7 @@ | ... | @@ -82,6 +82,7 @@ |
| 82 | <script setup> | 82 | <script setup> |
| 83 | import * as api from '@/common/api.js' | 83 | import * as api from '@/common/api.js' |
| 84 | import config from '@/config.js' | 84 | import config from '@/config.js' |
| 85 | import { fillImgUrl, previewAttachment } from '@/common/utils.js' | ||
| 85 | import { | 86 | import { |
| 86 | onMounted, | 87 | onMounted, |
| 87 | ref | 88 | ref |
| ... | @@ -193,50 +194,50 @@ function circulation(id) { | ... | @@ -193,50 +194,50 @@ function circulation(id) { |
| 193 | api.queryProcess(id).then(res=>{ | 194 | api.queryProcess(id).then(res=>{ |
| 194 | if (res.data.url) { | 195 | if (res.data.url) { |
| 195 | uni.hideLoading() | 196 | uni.hideLoading() |
| 196 | goWebView(config.baseUrl_api + res.data.url) | 197 | previewAttachment(res.data.url, { title: '查看附件' }) |
| 197 | } else { | 198 | } else { |
| 198 | circulation(id) | 199 | circulation(id) |
| 199 | } | 200 | } |
| 200 | }) | 201 | }) |
| 201 | } | 202 | } |
| 202 | function goWebView(url) { | 203 | function goWebView(url) { |
| 203 | url = url.replace("http://", "https://") | 204 | url = url.replace("http://", "https://") |
| 204 | uni.showLoading({ | 205 | uni.showLoading({ |
| 205 | title: '下载中' | 206 | title: '下载中' |
| 206 | }); | 207 | }); |
| 207 | uni.downloadFile({ | 208 | uni.downloadFile({ |
| 208 | url: url, | 209 | url: url, |
| 209 | success: function(res) { | 210 | success: function(res) { |
| 210 | uni.hideLoading(); | 211 | uni.hideLoading(); |
| 211 | var filePath = res.tempFilePath; | 212 | var filePath = res.tempFilePath; |
| 212 | uni.showLoading({ | 213 | uni.showLoading({ |
| 213 | title: '正在打开' | 214 | title: '正在打开' |
| 214 | }); | 215 | }); |
| 215 | uni.openDocument({ | 216 | uni.openDocument({ |
| 216 | filePath: filePath, | 217 | filePath: filePath, |
| 217 | showMenu: true, | 218 | showMenu: true, |
| 218 | success: function(res) { | 219 | success: function(res) { |
| 219 | uni.hideLoading(); | 220 | uni.hideLoading(); |
| 220 | }, | 221 | }, |
| 221 | fail: function(err) { | 222 | fail: function(err) { |
| 222 | uni.hideLoading(); | 223 | uni.hideLoading(); |
| 223 | uni.showToast({ | 224 | uni.showToast({ |
| 224 | title: err, | 225 | title: err, |
| 225 | icon: 'none', | 226 | icon: 'none', |
| 226 | duration: 2000 | 227 | duration: 2000 |
| 227 | }); | 228 | }); |
| 228 | } | 229 | } |
| 229 | }); | 230 | }); |
| 230 | }, | 231 | }, |
| 231 | fail: function(error) { | 232 | fail: function(error) { |
| 232 | uni.hideLoading(); | 233 | uni.hideLoading(); |
| 233 | uni.showToast({ | 234 | uni.showToast({ |
| 234 | title: `下载失败`, | 235 | title: `下载失败`, |
| 235 | icon: 'none', | 236 | icon: 'none', |
| 236 | duration: 2000 | 237 | duration: 2000 |
| 237 | }); | 238 | }); |
| 238 | } | 239 | } |
| 239 | }); | 240 | }); |
| 240 | } | 241 | } |
| 241 | 242 | ||
| 242 | function handleBack(row){ | 243 | function handleBack(row){ |
| ... | @@ -269,11 +270,7 @@ function viewSettleFile(item){ | ... | @@ -269,11 +270,7 @@ function viewSettleFile(item){ |
| 269 | } | 270 | } |
| 270 | function showImg(n) { | 271 | function showImg(n) { |
| 271 | var str = '' | 272 | var str = '' |
| 272 | if(n.indexOf('http')==-1){ | 273 | str = fillImgUrl(n) |
| 273 | str = config.baseUrl_api + n | ||
| 274 | } else { | ||
| 275 | str = n | ||
| 276 | } | ||
| 277 | 274 | ||
| 278 | if (n.indexOf('png') > -1 || n.indexOf('jpg') > -1 || n.indexOf( | 275 | if (n.indexOf('png') > -1 || n.indexOf('jpg') > -1 || n.indexOf( |
| 279 | 'jpeg') > -1) { | 276 | 'jpeg') > -1) { | ... | ... |
| ... | @@ -25,7 +25,7 @@ | ... | @@ -25,7 +25,7 @@ |
| 25 | <view class="stepItem" v-for="(n,index) in feelList" :key="index"> | 25 | <view class="stepItem" v-for="(n,index) in feelList" :key="index"> |
| 26 | <view class="time">{{n.auditTime||'待审批'}}</view> | 26 | <view class="time">{{n.auditTime||'待审批'}}</view> |
| 27 | <view class="content"> | 27 | <view class="content"> |
| 28 | <view class="status"> | 28 | <view class="status"> |
| 29 | <text v-if="n.auditResult==0" class="text-primary"> 审核中</text> | 29 | <text v-if="n.auditResult==0" class="text-primary"> 审核中</text> |
| 30 | <text v-if="n.auditResult==1" class="text-success">审核通过</text> | 30 | <text v-if="n.auditResult==1" class="text-success">审核通过</text> |
| 31 | <text v-if="n.auditResult==2" class="text-danger"> 审核拒绝</text> | 31 | <text v-if="n.auditResult==2" class="text-danger"> 审核拒绝</text> |
| ... | @@ -45,6 +45,7 @@ | ... | @@ -45,6 +45,7 @@ |
| 45 | <script setup> | 45 | <script setup> |
| 46 | import * as api from '@/common/api.js' | 46 | import * as api from '@/common/api.js' |
| 47 | import config from '@/config.js' | 47 | import config from '@/config.js' |
| 48 | import { fillImgUrl } from '@/common/utils.js' | ||
| 48 | import { | 49 | import { |
| 49 | onMounted, | 50 | onMounted, |
| 50 | ref | 51 | ref |
| ... | @@ -74,9 +75,7 @@ | ... | @@ -74,9 +75,7 @@ |
| 74 | api.addSelectPageList(queryParams.value).then(res => { | 75 | api.addSelectPageList(queryParams.value).then(res => { |
| 75 | list.value = res.pageData.rows | 76 | list.value = res.pageData.rows |
| 76 | for (var l of list.value) { | 77 | for (var l of list.value) { |
| 77 | if (l.photo && l.photo.indexOf('http') == -1) { | 78 | l.photo = fillImgUrl(l.photo) |
| 78 | l.photo = config.baseUrl_api + l.photo | ||
| 79 | } | ||
| 80 | } | 79 | } |
| 81 | }) | 80 | }) |
| 82 | } | 81 | } | ... | ... |
| ... | @@ -110,8 +110,8 @@ | ... | @@ -110,8 +110,8 @@ |
| 110 | item.recordId = r.recordId | 110 | item.recordId = r.recordId |
| 111 | infoList.value.push(item) | 111 | infoList.value.push(item) |
| 112 | }) | 112 | }) |
| 113 | form.value.totalNum = Math.floor(_.sumBy(infoList.value, (o) => parseFloat(o.totalNum || 0))) | 113 | form.value.totalNum = Math.floor(infoList.value.reduce((sum, o) => sum + parseFloat(o.totalNum || 0), 0)) |
| 114 | form.value.totalAmount = Math.floor(_.sumBy(infoList.value, (o) => parseFloat(o.totalAmount || 0))) | 114 | form.value.totalAmount = Math.floor(infoList.value.reduce((sum, o) => sum + parseFloat(o.totalAmount || 0), 0)) |
| 115 | 115 | ||
| 116 | uni.hideLoading() | 116 | uni.hideLoading() |
| 117 | 117 | ... | ... |
| ... | @@ -9,16 +9,16 @@ | ... | @@ -9,16 +9,16 @@ |
| 9 | <view class="tt">会员列表<text class="text-danger">(列表只显示不在缴费中的个人会员)</text></view> | 9 | <view class="tt">会员列表<text class="text-danger">(列表只显示不在缴费中的个人会员)</text></view> |
| 10 | <!-- <uni-indexed-list :options="list" :showSelect="true" @click="bindClick"></uni-indexed-list> --> | 10 | <!-- <uni-indexed-list :options="list" :showSelect="true" @click="bindClick"></uni-indexed-list> --> |
| 11 | <view class="userlist"> | 11 | <view class="userlist"> |
| 12 | <view class="item" v-for="(n,index) in list" :key="index"> | 12 | <view class="item" v-for="(n,index) in list" :key="index"> |
| 13 | <view @click="checkThis(n)"> | 13 | <view @click="checkThis(n)"> |
| 14 | <image class="icon" v-if="n.checked" :src="config.baseUrl_api+'/fs/static/member/dx_dwn.png'" /> | 14 | <image class="icon" v-if="n.checked" :src="config.baseUrl_api+'/fs/static/member/dx_dwn.png'" /> |
| 15 | <image class="icon" v-else :src="config.baseUrl_api+'/fs/static/member/dx.png'" /> | 15 | <image class="icon" v-else :src="config.baseUrl_api+'/fs/static/member/dx.png'" /> |
| 16 | </view> | 16 | </view> |
| 17 | <view class="photobox"> | 17 | <view class="photobox"> |
| 18 | <image class="photo" v-if="n.photo" :src="n.photo" mode='aspectFill'></image> | 18 | <image class="photo" v-if="n.photo" :src="n.photo" mode='aspectFill'></image> |
| 19 | <view class="colorful" v-else>{{n.name.slice(0,1)}}</view> | 19 | <view class="colorful" v-else>{{n.name.slice(0,1)}}</view> |
| 20 | </view> | 20 | </view> |
| 21 | <view @click="handleInfo(n)"> | 21 | <view @click="handleInfo(n)"> |
| 22 | <view class="name">{{n.name}}</view> | 22 | <view class="name">{{n.name}}</view> |
| 23 | <view class="date" v-if="n.validityDate">到期时间:{{n.validityDate?.slice(0,10)}}</view> | 23 | <view class="date" v-if="n.validityDate">到期时间:{{n.validityDate?.slice(0,10)}}</view> |
| 24 | <view class="date" v-else>注册时间:{{n.createTime?.slice(0,10)}}</view> | 24 | <view class="date" v-else>注册时间:{{n.createTime?.slice(0,10)}}</view> |
| ... | @@ -40,10 +40,10 @@ | ... | @@ -40,10 +40,10 @@ |
| 40 | 过期 | 40 | 过期 |
| 41 | </text> | 41 | </text> |
| 42 | </view> | 42 | </view> |
| 43 | </view> | 43 | </view> |
| 44 | <view class="nodata" v-if="list.length==0"> | 44 | <view class="nodata" v-if="list.length==0"> |
| 45 | <image mode="aspectFit" src="/static/nodata.png"></image> | 45 | <image mode="aspectFit" src="/static/nodata.png"></image> |
| 46 | <text>暂无数据</text> | 46 | <text>暂无数据</text> |
| 47 | </view> | 47 | </view> |
| 48 | </view> | 48 | </view> |
| 49 | 49 | ||
| ... | @@ -58,8 +58,9 @@ | ... | @@ -58,8 +58,9 @@ |
| 58 | </template> | 58 | </template> |
| 59 | 59 | ||
| 60 | <script setup> | 60 | <script setup> |
| 61 | import * as api from '@/common/api.js' | 61 | import * as api from '@/common/api.js' |
| 62 | import config from '@/config.js' | 62 | import config from '@/config.js' |
| 63 | import { fillImgUrl } from '@/common/utils.js' | ||
| 63 | import { | 64 | import { |
| 64 | ref, | 65 | ref, |
| 65 | getCurrentInstance | 66 | getCurrentInstance |
| ... | @@ -72,26 +73,24 @@ | ... | @@ -72,26 +73,24 @@ |
| 72 | } = getCurrentInstance() | 73 | } = getCurrentInstance() |
| 73 | const app = getApp(); | 74 | const app = getApp(); |
| 74 | const queryParams = ref({ | 75 | const queryParams = ref({ |
| 75 | showMyPersonFlag: 1, | 76 | showMyPersonFlag: 1, |
| 76 | checkPaymentCommit: 1, | 77 | checkPaymentCommit: 1, |
| 77 | fromChoose: 1 | 78 | fromChoose: 1 |
| 78 | }) | 79 | }) |
| 79 | const list = ref([]) | 80 | const list = ref([]) |
| 80 | const total = ref(0) | 81 | const total = ref(0) |
| 81 | const userType = ref('') | 82 | const userType = ref('') |
| 82 | onLoad((option) => { | 83 | onLoad((option) => { |
| 83 | userType.value = app.globalData.userType | 84 | userType.value = app.globalData.userType |
| 84 | queryParams.value.paymentRangeId = option.rangeId | 85 | queryParams.value.paymentRangeId = option.rangeId |
| 85 | getList() | 86 | getList() |
| 86 | }) | 87 | }) |
| 87 | 88 | ||
| 88 | function getList() { | 89 | function getList() { |
| 89 | api.selectPageList(queryParams.value).then(res => { | 90 | api.selectPageList(queryParams.value).then(res => { |
| 90 | list.value = res.rows | 91 | list.value = res.rows |
| 91 | for(var l of list.value){ | 92 | for(var l of list.value){ |
| 92 | if(l.photo&&l.photo.indexOf('http')==-1){ | 93 | l.photo = fillImgUrl(l.photo) |
| 93 | l.photo = config.baseUrl_api + l.photo | ||
| 94 | } | ||
| 95 | } | 94 | } |
| 96 | total.value = res.total | 95 | total.value = res.total |
| 97 | }) | 96 | }) |
| ... | @@ -106,33 +105,33 @@ | ... | @@ -106,33 +105,33 @@ |
| 106 | function goAddRenew() { | 105 | function goAddRenew() { |
| 107 | uni.navigateBack() | 106 | uni.navigateBack() |
| 108 | } | 107 | } |
| 109 | function checkThis(n){ | 108 | function checkThis(n){ |
| 110 | if(n.checked){ | 109 | if(n.checked){ |
| 111 | n.checked = false | 110 | n.checked = false |
| 112 | }else{ | 111 | }else{ |
| 113 | n.checked = true | 112 | n.checked = true |
| 114 | } | 113 | } |
| 115 | } | 114 | } |
| 116 | function handleImport(){ | 115 | function handleImport(){ |
| 117 | var arr=[] | 116 | var arr=[] |
| 118 | for(var n of list.value){ | 117 | for(var n of list.value){ |
| 119 | if(n.checked){ | 118 | if(n.checked){ |
| 120 | arr.push(n.perId) | 119 | arr.push(n.perId) |
| 121 | } | 120 | } |
| 122 | } | 121 | } |
| 123 | if(arr.length==0){ | 122 | if(arr.length==0){ |
| 124 | uni.showToast({ | 123 | uni.showToast({ |
| 125 | title:"请选择会员", | 124 | title:"请选择会员", |
| 126 | icon:"none" | 125 | icon:"none" |
| 127 | }) | 126 | }) |
| 128 | return | 127 | return |
| 129 | } | 128 | } |
| 130 | api.addPersonPaymentGroup({ rangeId: queryParams.value.paymentRangeId, personIdArray: arr.join(',') }).then(res=>{ | 129 | api.addPersonPaymentGroup({ rangeId: queryParams.value.paymentRangeId, personIdArray: arr.join(',') }).then(res=>{ |
| 131 | let path = `/personalVip/renew?rangeId=${res.data.rangeId}` | 130 | let path = `/personalVip/renew?rangeId=${res.data.rangeId}` |
| 132 | uni.redirectTo({ | 131 | uni.redirectTo({ |
| 133 | url: path | 132 | url: path |
| 134 | }); | 133 | }); |
| 135 | }) | 134 | }) |
| 136 | } | 135 | } |
| 137 | </script> | 136 | </script> |
| 138 | 137 | ||
| ... | @@ -145,7 +144,7 @@ | ... | @@ -145,7 +144,7 @@ |
| 145 | .tt { | 144 | .tt { |
| 146 | font-size: 30rpx; | 145 | font-size: 30rpx; |
| 147 | margin: 0 0 30rpx; | 146 | margin: 0 0 30rpx; |
| 148 | color: #4C5359; | 147 | color: #4C5359; |
| 149 | text{font-size: 26rpx;margin-left: 10px;} | 148 | text{font-size: 26rpx;margin-left: 10px;} |
| 150 | } | 149 | } |
| 151 | 150 | ... | ... |
-
Please register or sign in to post a comment