d7962027 by lttnew

上传图片

1 parent b6754440
......@@ -276,7 +276,7 @@ export function uploadImgCorpPhoto(tempFilePath) {
title: '加载中'
});
return uni.uploadFile({
url: config.baseUrl_api + '/upload/uploadImgToLocalServerCaiJian',
url: config.baseUrl_api + '/fileServer/uploadImgToMinioCaiJian',
header: {
'Authorization': uni.getStorageSync('token'),
},
......@@ -479,7 +479,7 @@ export function uploadFile(e) {
title: '加载中'
});
return uni.uploadFile({
url: config.baseUrl_api + '/upload/uploadFileToLocalServer',
url: config.baseUrl_api + '/fileServer/uploadFile',
filePath: fileUrl,
name: 'file',
header: {
......@@ -487,6 +487,16 @@ export function uploadFile(e) {
}
}).then(res => {
let data = JSON.parse(res.data);
if (res.statusCode && (res.statusCode < 200 || res.statusCode >= 300)) {
throw new Error(data.msg || '上传失败')
}
if (data.code && data.code !== 200) {
throw new Error(data.msg || '上传失败')
}
if (data.data) {
data.message = data.msg
data.msg = data.data
}
return data
}).finally(() => {
uni.hideLoading();
......@@ -498,7 +508,7 @@ export function uploadFileList(path) {
title: '加载中'
});
return uni.uploadFile({
url: config.baseUrl_api + '/upload/uploadFileToLocalServer',
url: config.baseUrl_api + '/fileServer/uploadFile',
filePath: path,
name: 'file',
header: {
......@@ -506,7 +516,13 @@ export function uploadFileList(path) {
}
}).then(res => {
let data = JSON.parse(res.data);
return data.msg
if (res.statusCode && (res.statusCode < 200 || res.statusCode >= 300)) {
throw new Error(data.msg || '上传失败')
}
if (data.code && data.code !== 200) {
throw new Error(data.msg || '上传失败')
}
return data.data || data.msg
}).finally(() => {
uni.hideLoading();
});
......
import CryptoJS from 'crypto-js'
import config from '@/config.js'
export function szToHz(num) {
const hzArr = ['〇', '一', '二', '三', '四', '五', '六', '七', '八', '九', '十']
return hzArr[parseInt(num)]
......@@ -38,4 +39,316 @@ export function AESDecrypt(str) {
} catch (e) {
return aesStr
}
}
\ No newline at end of file
}
export function isDaoGuanRole() {
const app = getApp()
const deptType = app.globalData?.deptType
const userType = app.globalData?.userType
return deptType == null || deptType == 6 || deptType == '6' || userType == '4'
}
export function reLaunchHomeByRole() {
uni.reLaunch({
url: isDaoGuanRole() ? '/pages/index/daoGuanPerson' : '/pages/index/home'
})
}
export function fillImgUrl(url, prefix) {
if (!url) return ''
const trimmedUrl = String(url).trim()
if (!trimmedUrl) return ''
if (trimmedUrl === 'null' || trimmedUrl === 'undefined') return ''
if (trimmedUrl.startsWith('msr:')) {
return `${trimBaseUrl(config.baseUrl_api)}/fileServer/download?file=${encodeURIComponent(trimmedUrl)}&downFlag=0`
}
if (/^(data:|https?:\/\/)/.test(trimmedUrl)) {
return trimmedUrl
}
const baseUrl = prefix
? `${trimBaseUrl(config.baseUrl_api)}/${String(prefix).replace(/^\/+|\/+$/g, '')}`
: trimBaseUrl(config.baseUrl_api)
const path = trimmedUrl.startsWith('/') ? trimmedUrl : `/${trimmedUrl}`
return baseUrl + path
}
export function isImageUrl(url) {
const value = String(url || '').trim()
if (!value) return false
const decodedValue = safeDecodeURIComponent(value)
return /\.(png|jpe?g|gif|webp|bmp|svg)(\?.*)?$/i.test(decodedValue) ||
/[?&]file=[^&]*\.(png|jpe?g|gif|webp|bmp|svg)(&|$)/i.test(decodedValue)
}
export function getMemberPhotoValue(item = {}) {
return [item.photo, item.perPhoto, item.photo2, item.perPhoto2].find(isValidUrlValue) || ''
}
export function fillMemberPhoto(item = {}, fallback = '') {
const photo = getMemberPhotoValue(item)
return photo ? fillImgUrl(photo) : fallback
}
export async function previewAttachment(file, options = {}) {
const item = normalizeAttachment(file)
const rawUrl = item.rawUrl || item.url
const previewUrl = getAttachmentPreviewUrl(rawUrl, 0)
if (!previewUrl) {
uni.showToast({
title: '暂无可预览附件',
icon: 'none'
})
return
}
if (isAttachmentImage(item) || isImageUrl(rawUrl) || isImageUrl(previewUrl)) {
const errorMsg = await checkAttachmentError(previewUrl)
if (errorMsg) {
uni.showToast({
title: errorMsg,
icon: 'none'
})
return
}
uni.previewImage({
urls: [previewUrl],
current: previewUrl,
fail: () => {
uni.showToast({
title: '图片预览失败',
icon: 'none'
})
}
})
return
}
if (getAttachmentExt(item) === 'zip') {
uni.showToast({
title: '压缩包暂不支持在线预览',
icon: 'none'
})
return
}
openDocumentAttachment(item, getAttachmentPreviewUrl(rawUrl, 0), false, options)
}
export function normalizeAttachment(file) {
if (Array.isArray(file)) return normalizeAttachment(file[0])
if (typeof file === 'string') {
const parsed = parseAttachmentJson(file)
if (parsed !== file) return normalizeAttachment(parsed)
return {
rawUrl: file,
url: file,
name: ''
}
}
if (file && typeof file === 'object') {
const rawUrl = file.rawUrl || file.url || file.fileUrl || file.path || ''
return {
...file,
rawUrl,
url: rawUrl
}
}
return {}
}
export function parseAttachmentJson(value) {
if (!value || typeof value !== 'string') return value
try {
return JSON.parse(value)
} catch (e) {
return value
}
}
export function getAttachmentPreviewUrl(url, downFlag = 0) {
if (!url) return ''
const value = String(url).trim()
if (!value || value === 'null' || value === 'undefined') return ''
if (value.startsWith('msr:')) {
return `${trimBaseUrl(config.baseUrl_api)}/fileServer/download?file=${encodeURIComponent(value)}&downFlag=${downFlag}`
}
return fillImgUrl(value)
}
function openDocumentAttachment(item, url, retried = false, options = {}) {
if (!url) {
uni.showToast({
title: '文件下载失败',
icon: 'none'
})
return
}
uni.showLoading({
title: '打开中',
mask: true
})
uni.downloadFile({
url,
header: {
Authorization: uni.getStorageSync('token')
},
success: res => {
if (res.statusCode && res.statusCode !== 200) {
if ((res.statusCode === 301 || res.statusCode === 302) && !retried) {
const redirectUrl = getRedirectUrl(res.header)
uni.hideLoading()
if (redirectUrl) {
openDocumentAttachment(item, redirectUrl, true, options)
} else {
uni.showToast({
title: '文件下载失败',
icon: 'none'
})
}
return
}
showAttachmentFailToast(url, '文件下载失败')
return
}
uni.openDocument({
filePath: res.tempFilePath,
fileType: getDocumentFileType(item),
showMenu: true,
fail: () => {
uni.showToast({
title: '文件暂不支持预览',
icon: 'none'
})
}
})
},
fail: () => {
showAttachmentFailToast(url, '文件下载失败')
},
complete: () => {
uni.hideLoading()
}
})
}
function openAttachmentWebView(url, title = '附件预览') {
if (!url) {
uni.showToast({
title: '文件下载失败',
icon: 'none'
})
return
}
uni.navigateTo({
url: `/pages/webview/webview?title=${encodeURIComponent(title)}&url=${encodeURIComponent(url)}`,
fail: () => {
uni.showToast({
title: '附件预览失败',
icon: 'none'
})
}
})
}
function getAttachmentExt(file) {
const name = `${file?.extname || file?.name || file?.rawUrl || file?.url || file || ''}`
const fileParam = getQueryParam(name, 'file')
const cleanName = safeDecodeURIComponent(fileParam || name).split('?')[0].split('#')[0]
const fileName = cleanName.split('/').pop() || cleanName
const ext = fileName.includes('.') ? fileName.split('.').pop() : fileName
return ext.toLowerCase()
}
function checkAttachmentError(url) {
if (!isFileDownloadUrl(url)) return Promise.resolve('')
return new Promise(resolve => {
uni.request({
url,
method: 'GET',
header: {
Authorization: uni.getStorageSync('token') || ''
},
success: res => {
const data = parseAttachmentResponse(res.data)
if (res.statusCode >= 400 || (data && data.code && data.code !== 200)) {
resolve(getAttachmentErrorMsg(data))
return
}
resolve('')
},
fail: () => resolve('')
})
})
}
async function showAttachmentFailToast(url, fallback) {
const errorMsg = await checkAttachmentError(url)
uni.showToast({
title: errorMsg || fallback,
icon: 'none'
})
}
function parseAttachmentResponse(data) {
if (!data) return null
if (typeof data === 'object') return data
if (typeof data === 'string') {
try {
return JSON.parse(data)
} catch (e) {
return null
}
}
return null
}
function getAttachmentErrorMsg(data) {
const msg = data?.msg || data?.message || ''
if (!msg) return '附件预览失败'
if (msg.includes('Hostname') || msg.includes('certificate')) {
return '附件服务证书异常,请稍后再试'
}
return msg.length > 40 ? msg.slice(0, 40) : msg
}
function isAttachmentImage(file) {
return ['png', 'jpg', 'jpeg', 'gif', 'bmp', 'webp', 'svg'].includes(getAttachmentExt(file))
}
function getDocumentFileType(file) {
const ext = getAttachmentExt(file)
const types = ['doc', 'docx', 'xls', 'xlsx', 'ppt', 'pptx', 'pdf']
return types.includes(ext) ? ext : undefined
}
function getRedirectUrl(header = {}) {
const location = header.Location || header.location
if (!location) return ''
if (/^https?:\/\//.test(location)) return location
return `${trimBaseUrl(config.baseUrl_api)}/${String(location).replace(/^\/+/, '')}`
}
function isFileDownloadUrl(url) {
const value = String(url || '')
return value.includes('/fileServer/download') || value.startsWith('fileServer/download')
}
function getQueryParam(url, key) {
const match = String(url || '').match(new RegExp(`[?&]${key}=([^&#]+)`))
return match ? safeDecodeURIComponent(match[1]) : ''
}
function isValidUrlValue(value) {
if (value === undefined || value === null) return false
const url = String(value).trim()
return url !== '' && url !== 'null' && url !== 'undefined'
}
function trimBaseUrl(url) {
return String(url || '').replace(/\/+$/, '')
}
function safeDecodeURIComponent(value) {
try {
return decodeURIComponent(value)
} catch (e) {
return value
}
}
......
......@@ -7,7 +7,8 @@
// const baseUrl_api = "https://ztx.itechtop.cn:8443/stage-api";
// const baseUrl_api = 'http://192.168.1.132:8787'
// const baseUrl_api = 'https://tkcn.19wk.cn:8443/stage-api'
const baseUrl_api = 'https://tk001.wxjylt.com/stage-api'
const baseUrl_api = 'https://tk001.wxjylt.com/stage-api' //测试环境
// const baseUrl_api = 'https://system.taekwondo.org.cn/stage-api' //会员生产
// const baseUrl_api = 'https://system.taekwondo.org.cn/stage-api'
export default {
baseUrl_api
......
......@@ -64,10 +64,10 @@
</view>
<view v-if="deptType == 1" @click.stop="viewSettleFile(item.doc)">
缴费状态
<view>
<text v-if="item.doc?.settleFlag==0" class="text-warning">已结算</text>
<text v-if="item.doc?.settleFlag==1&&item.doc.payFlag==0" class="text-success">已上传</text>
<text v-if="item.doc?.settleFlag==1&&item.doc.payFlag==1" class="text-danger">未上传</text>
<view>
<text v-if="item.doc?.settleFlag==0" class="text-warning">已结算</text>
<text v-if="item.doc?.settleFlag==1&&item.doc.payFlag==0" class="text-success">已上传</text>
<text v-if="item.doc?.settleFlag==1&&item.doc.payFlag==1" class="text-danger">未上传</text>
</view>
</view>
</view>
......@@ -111,6 +111,7 @@
<script setup>
import * as api from '@/common/api.js'
import config from '@/config.js'
import { fillImgUrl } from '@/common/utils.js'
import {
onMounted,
ref
......@@ -157,7 +158,7 @@
function getList() {
uni.showLoading({
title: '加载中',
title: '加载中',
mask: true
})
if (deptType.value == 2 || deptType.value == 3) {
......@@ -173,9 +174,9 @@
uni.hideLoading()
list.value = res.rows
list.value.forEach(item => {
item.content = JSON.parse(item.content)
if(item.doc){
item.doc = JSON.parse(item.doc)
item.content = JSON.parse(item.content)
if(item.doc){
item.doc = JSON.parse(item.doc)
}
totalCost.value = totalCost.value + (item.content.allFee * 1)
})
......@@ -224,12 +225,12 @@
recordIds: []
}
obj.recordIds.push(recordId)
console.log(obj)
uni.showLoading({
title: '加载中',
mask: true
console.log(obj)
uni.showLoading({
title: '加载中',
mask: true
})
api.groupAudit(obj).then((res) => {
api.groupAudit(obj).then((res) => {
uni.hideLoading()
uni.showToast({
title: '操作成功',
......@@ -298,80 +299,76 @@
uni.navigateTo({
url: `/group/groupInfo?memId=${row.content?.memId}`
})
}
function viewSettleFile(doc){
let url
if(doc.payEvidence){
url = JSON.parse(doc.payEvidence)[0].url || null
console.log(url)
if(url){showImg(url)}
}
}
function showImg(n) {
var str = ''
if(n.indexOf('http')==-1){
str = config.baseUrl_api + n
} else {
str = n
}
if (n.indexOf('png') > -1 || n.indexOf('jpg') > -1 || n.indexOf(
'jpeg') > -1) {
uni.previewImage({
urls: [str],
success: function(res) {
console.log('success', res)
},
fail: function(res) {
console.log('fail', res)
},
complete: function(res) {
console.log('complete', res)
}
})
} else {
goWebView(str)
}
}
function goWebView(url) {
url = url.replace("http://", "https://")
uni.showLoading({
title: '下载中'
});
uni.downloadFile({
url: url,
success: function(res) {
uni.hideLoading();
var filePath = res.tempFilePath;
uni.showLoading({
title: '正在打开'
});
uni.openDocument({
filePath: filePath,
showMenu: true,
success: function(res) {
uni.hideLoading();
},
fail: function(err) {
uni.hideLoading();
uni.showToast({
title: err,
icon: 'none',
duration: 2000
});
}
});
},
fail: function(error) {
uni.hideLoading();
uni.showToast({
title: `下载失败`,
icon: 'none',
duration: 2000
});
}
});
}
function viewSettleFile(doc){
let url
if(doc.payEvidence){
url = JSON.parse(doc.payEvidence)[0].url || null
console.log(url)
if(url){showImg(url)}
}
}
function showImg(n) {
var str = ''
str = fillImgUrl(n)
if (n.indexOf('png') > -1 || n.indexOf('jpg') > -1 || n.indexOf(
'jpeg') > -1) {
uni.previewImage({
urls: [str],
success: function(res) {
console.log('success', res)
},
fail: function(res) {
console.log('fail', res)
},
complete: function(res) {
console.log('complete', res)
}
})
} else {
goWebView(str)
}
}
function goWebView(url) {
url = url.replace("http://", "https://")
uni.showLoading({
title: '下载中'
});
uni.downloadFile({
url: url,
success: function(res) {
uni.hideLoading();
var filePath = res.tempFilePath;
uni.showLoading({
title: '正在打开'
});
uni.openDocument({
filePath: filePath,
showMenu: true,
success: function(res) {
uni.hideLoading();
},
fail: function(err) {
uni.hideLoading();
uni.showToast({
title: err,
icon: 'none',
duration: 2000
});
}
});
},
fail: function(error) {
uni.hideLoading();
uni.showToast({
title: `下载失败`,
icon: 'none',
duration: 2000
});
}
});
}
</script>
......
......@@ -2,18 +2,18 @@
<view>
<uni-collapse>
<uni-collapse-item :title="n.newName" v-for="n in list" :key="n.id" open>
<view class="collapseBody">
<view>
<label>会员编号:</label>
<text>{{n.memCode}}</text>
<view class="collapseBody">
<view>
<label>会员编号:</label>
<text>{{n.memCode}}</text>
</view>
<view>
<label>团体会员名称:</label>
<view>
{{n.oldName}}
<text class="text-primary" v-if="n.oldName!=n.newName">变更为 </text>
<text class="text-danger" v-if="n.oldName!=n.newName">{{ n.newName }}</text>
<label>团体会员名称:</label>
<view>
{{n.oldName}}
<text class="text-primary" v-if="n.oldName!=n.newName">变更为 </text>
<text class="text-danger" v-if="n.oldName!=n.newName">{{ n.newName }}</text>
</view>
</view>
......@@ -39,7 +39,7 @@
onLoad
} from '@dcloudio/uni-app'
import * as api from '@/common/api.js'
import config from '@/config.js'
import { parseAttachmentJson, previewAttachment } from '@/common/utils.js'
const queryParams = ref({})
const total = ref(0)
const list = ref([])
......@@ -60,7 +60,7 @@
api.getChangeGroupByRangeId(queryParams.value).then(res => {
list.value = res.rows
list.value.forEach(item => {
item.fileUrl = JSON.parse(item.fileUrl)
item.fileUrl = parseAttachmentJson(item.fileUrl)
})
total.value = res.total
uni.hideLoading()
......@@ -68,64 +68,7 @@
}
function showImg(n) {
var str = config.baseUrl_api + n.fileUrl[0]?.url
if (n.fileUrl[0]?.url.indexOf('png') > -1 || n.fileUrl[0]?.url.indexOf('jpg') > -1 || n.fileUrl[0]?.url.indexOf(
'jpeg') > -1) {
uni.previewImage({
urls: [str],
success: function(res) {
console.log('success', res)
},
fail: function(res) {
console.log('fail', res)
},
complete: function(res) {
console.log('complete', res)
}
})
} else {
goWebView(str)
}
}
function goWebView(url) {
url = url.replace("http://", "https://")
uni.showLoading({
title: '下载中'
});
uni.downloadFile({
url: url,
success: function(res) {
uni.hideLoading();
var filePath = res.tempFilePath;
uni.showLoading({
title: '正在打开'
});
uni.openDocument({
filePath: filePath,
showMenu: true,
success: function(res) {
uni.hideLoading();
},
fail: function(err) {
uni.hideLoading();
uni.showToast({
title: err,
icon: 'none',
duration: 2000
});
}
});
},
fail: function(error) {
uni.hideLoading();
uni.showToast({
title: `下载失败`,
icon: 'none',
duration: 2000
});
}
});
previewAttachment(n.fileUrl, { title: '查看附件' })
}
</script>
<style scoped lang="scss">
......@@ -153,7 +96,7 @@
color: #999;
display: inline-block;
text-align: right;flex:0 0 auto;
}
}
view{flex:1 1 auto;}
}
}
......@@ -162,4 +105,4 @@
background: #fff;
padding: 30rpx;
}
</style>
\ No newline at end of file
</style>
......
<template>
<view>
<z-paging ref="paging" v-model="list" @query="getQuery" emptyViewImg="/static/nodata.png">
<view>
<z-paging ref="paging" v-model="list" @query="getQuery" emptyViewImg="/static/nodata.png">
<!-- 机构会员 -->
<view class="searchbar" :slot="top">
<uni-easyinput placeholderStyle="font-size:30rpx" :input-border="false" prefixIcon="search"
v-model="queryParams.name" placeholder="搜索会员名称" @blur="getList" @clear="getList">
</uni-easyinput>
<!-- 机构会员 -->
<view class="searchbar" :slot="top">
<uni-easyinput placeholderStyle="font-size:30rpx" :input-border="false" prefixIcon="search"
v-model="queryParams.name" placeholder="搜索会员名称" @blur="getList" @clear="getList">
</uni-easyinput>
</view>
<view class="wBox">
<!-- 成员 -->
<view class="userlist">
<view class="item" v-for="(n,index) in list" :key="index" @click="goDetail(n)">
<view class="photobox">
<image class="photo" v-if="n.photo" :src="n.photo" mode='aspectFill'></image>
<view class="photobox">
<image class="photo" v-if="n.photo" :src="n.photo" mode='aspectFill'></image>
<view class="colorful" v-else>{{n.name?.slice(0,1)}}</view>
</view>
......@@ -30,13 +30,14 @@
</view>
</view>
</z-paging>
</z-paging>
</view>
</template>
<script setup>
import * as api from '@/common/api.js'
import config from '@/config.js'
import { fillImgUrl } from '@/common/utils.js'
import {
ref,
getCurrentInstance
......@@ -47,8 +48,8 @@
const {
proxy
} = getCurrentInstance()
const app = getApp();
const app = getApp();
const paging = ref(null)
const queryParams = ref({
sonDeptId: 1,
......@@ -65,39 +66,35 @@
queryParams.value.sonDeptId = option.deptId
getList()
})
function getQuery(pageNum,pageSize) {
queryParams.value.pageNum = pageNum
queryParams.value.pageSize = pageSize
api.selectPageList(queryParams.value).then(res => {
paging.value.complete(res.rows)
list.value = res.rows
for(var l of list.value){
if(l.photo&&l.photo.indexOf('http')==-1){
l.photo = config.baseUrl_api + l.photo
}
}
function getQuery(pageNum,pageSize) {
queryParams.value.pageNum = pageNum
queryParams.value.pageSize = pageSize
api.selectPageList(queryParams.value).then(res => {
paging.value.complete(res.rows)
list.value = res.rows
for(var l of list.value){
l.photo = fillImgUrl(l.photo)
}
})
}
function getList() {
uni.showLoading({
title:"加载中"
function getList() {
uni.showLoading({
title:"加载中"
})
api.selectPageList(queryParams.value).then(res => {
api.selectPageList(queryParams.value).then(res => {
uni.hideLoading()
paging.value.complete(res.rows);
list.value = res.rows
for(var l of list.value){
if(l.photo&&l.photo.indexOf('http')==-1){
l.photo = config.baseUrl_api + l.photo
}
paging.value.complete(res.rows);
list.value = res.rows
for(var l of list.value){
l.photo = fillImgUrl(l.photo)
}
total.value = res.total
})
}
function goDetail(n){
uni.navigateTo({
url: `/personalVip/detail?perId=${n.perId}`
})
}
function goDetail(n){
uni.navigateTo({
url: `/personalVip/detail?perId=${n.perId}`
})
}
</script>
......@@ -107,21 +104,21 @@
right: 20rpx;
font-size: 26rpx;
color: #999;
}
.searchbar {
display: flex;
align-items: center;
padding: 25rpx;
box-sizing: border-box;
:deep(.uni-easyinput .uni-easyinput__content) {
border-radius: 35rpx;
border: none;
height: 70rpx;
}
:deep(.uni-easyinput__content-input) {
font-size: 26rpx;
}
}
.searchbar {
display: flex;
align-items: center;
padding: 25rpx;
box-sizing: border-box;
:deep(.uni-easyinput .uni-easyinput__content) {
border-radius: 35rpx;
border: none;
height: 70rpx;
}
:deep(.uni-easyinput__content-input) {
font-size: 26rpx;
}
}
</style>
\ No newline at end of file
......
......@@ -61,7 +61,7 @@
</view>
</view>
<view class="nodata" v-if="list.length==0">
<image mode="aspectFit" src="/static/nodata.png"></image>
<image mode="aspectFit" :src="config.baseUrl_api + '/fs/static/nodata.png'"></image>
<text>暂无数据</text>
</view>
......@@ -90,8 +90,9 @@
</template>
<script setup>
import * as api from '@/common/api.js'
import config from '@/config.js'
import * as api from '@/common/api.js'
import config from '@/config.js'
import { previewAttachment } from '@/common/utils.js'
import {
onMounted,
ref
......@@ -212,71 +213,12 @@ function goDetail(item) {
});
}
function downloadOrder(item) {
//下载凭证
showImg(item.payEvidence[0]?.url)
}
function showImg(url) {
var str = config.baseUrl_api + url
if (url.indexOf('png') > -1 || url.indexOf('jpg') > -1 || url.indexOf('jpeg') > -1) {
uni.previewImage({
urls: [str],
success: function(res) {
console.log('success', res)
},
fail: function(res) {
console.log('fail', res)
},
complete: function(res) {
console.log('complete', res)
}
})
} else {
goWebView(str)
}
}
function goWebView(url) {
url = url.replace("http://", "https://")
uni.showLoading({
title: '下载中'
});
uni.downloadFile({
url: url,
success: function(res) {
uni.hideLoading();
var filePath = res.tempFilePath;
uni.showLoading({
title: '正在打开'
});
uni.openDocument({
filePath: filePath,
showMenu: true,
success: function(res) {
uni.hideLoading();
},
fail: function(err) {
uni.hideLoading();
uni.showToast({
title: err,
icon: 'none',
duration: 2000
});
}
});
},
fail: function(error) {
uni.hideLoading();
uni.showToast({
title: `下载失败`,
icon: 'none',
duration: 2000
});
}
});
}
</script>
function downloadOrder(item) {
//下载凭证
previewAttachment(item.payEvidence?.[0] || item.payEvidence, { title: '查看凭证' })
}
</script>
<style scoped lang="scss">
.appList .appItem .func button[disabled]{
......@@ -293,3 +235,4 @@ function goWebView(url) {
}
}
</style>
......
......@@ -21,7 +21,7 @@
v-model="form.belongProvinceId" :localdata="regionsList">
</uni-data-select>
</template>
</uni-list-item>
</uni-list-item>
<uni-list-item title="社会信用代码" :rightText="form.creditCode" />
<uni-list-item v-if="isR" title="联系人" :rightText="form.certSiteContact" />
<uni-list-item v-else title="联系人" :rightText="form.siteContact" />
......@@ -101,8 +101,8 @@
<script setup>
import * as api from '@/common/api.js'
import config from '@/config.js'
import _ from 'underscore'
import { fillImgUrl, previewAttachment } from '@/common/utils.js'
import {
onMounted,
ref
......@@ -134,7 +134,7 @@
function getForm(memId){
if(memId){
api.getGroupMemberInfoById(memId).then(res => {
form.value = res.data
form.value = res.data
init()
})
......@@ -153,6 +153,11 @@
}catch(e){
form.value.businessLicenseArr=[{url:form.value.businessLicense,name:'营业执照'}]
}
form.value.businessLicenseArr = form.value.businessLicenseArr.map(item => ({
...item,
rawUrl: item.url,
url: fillImgUrl(item.url)
}))
console.log('营业执照',form.value.businessLicenseArr)
}
if (form.value.certBusinessLicense) {
......@@ -162,19 +167,18 @@
}catch(e){
form.value.businessLicenseArrR=[{url:form.value.certBusinessLicense,name:'营业执照'}]
}
form.value.businessLicenseArrR = form.value.businessLicenseArrR.map(item => ({
...item,
rawUrl: item.url,
url: fillImgUrl(item.url)
}))
console.log('营业执照',form.value.businessLicenseArrR)
}
if (form.value.certLegalIdcPhoto && form.value.certLegalIdcPhoto!=null) {
form.value.legalIdcPhotoArr = []
var arr = form.value.certLegalIdcPhoto?.split(',') || []
if (arr.length > 0) {
arr = _.map(arr, (p) => {
if(p.indexOf('http')==-1){
console.log(p)
p = config.baseUrl_api + p
}
return p
})
arr = _.map(arr, (p) => fillImgUrl(p))
form.value.legalIdcPhotoArr = arr
}
}
......@@ -182,13 +186,7 @@
form.value.legalIdcPhotoArrR = []
var arr = form.value.legalIdcPhoto?.split(',') || []
if (arr.length > 0) {
arr = _.map(arr, (p) => {
if(p.indexOf('http')==-1){
console.log(p)
p = config.baseUrl_api + p
}
return p
})
arr = _.map(arr, (p) => fillImgUrl(p))
form.value.legalIdcPhotoArrR = arr
}
}
......@@ -197,12 +195,7 @@
form.value.picturesArr = []
var arr = form.value.certPictures.split(',') || []
if (arr.length > 0) {
arr = _.map(arr, (p) => {
if(p.indexOf('http')==-1){
p = config.baseUrl_api + p
}
return p
})
arr = _.map(arr, (p) => fillImgUrl(p))
form.value.picturesArr = arr
}
console.log(form.value.picturesArr)
......@@ -211,12 +204,7 @@
form.value.picturesArrR = []
var arr = form.value.pictures.split(',') || []
if (arr.length > 0) {
arr = _.map(arr, (p) => {
if(p.indexOf('http')==-1){
p = config.baseUrl_api + p
}
return p
})
arr = _.map(arr, (p) => fillImgUrl(p))
form.value.picturesArrR = arr
}
console.log(form.value.picturesArrR)
......@@ -248,70 +236,7 @@
}
function download(url) {
console.log(url)
if (url.indexOf('.png') > -1 || url.indexOf('.jpg') > -1) {
if(url.indexOf('http')>-1){
uni.previewImage({
urls: [url],
success: function(res) {
console.log(res,[url],'111')
}
})
} else {
uni.previewImage({
urls: [config.baseUrl_api + url],
success: function(res) {
console.log(url,'222')
}
})
}
} else {
if(url.indexOf('http')>-1){
goWebView(url)
} else {
goWebView(config.baseUrl_api + url)
}
}
}
function goWebView(url) {
url = url.replace("http://", "https://")
uni.showLoading({
title: '下载中'
});
uni.downloadFile({
url: url,
success: function(res) {
uni.hideLoading();
var filePath = res.tempFilePath;
uni.showLoading({
title: '正在打开'
});
uni.openDocument({
filePath: filePath,
showMenu: true,
success: function(res) {
uni.hideLoading();
},
fail: function(err) {
uni.hideLoading();
uni.showToast({
title: err,
icon: 'none',
duration: 2000
});
}
});
},
fail: function(error) {
uni.hideLoading();
uni.showToast({
title:`下载失败`,
icon: 'none',
duration: 2000
});
}
});
previewAttachment(url, { title: '查看附件' })
}
</script>
......@@ -388,4 +313,4 @@
bottom: 4rpx;
right: 8rpx;}
}
</style>
\ No newline at end of file
</style>
......
......@@ -173,6 +173,7 @@
onShow
} from '@dcloudio/uni-app';
import config from '@/config.js'
import { fillImgUrl } from '@/common/utils.js'
import dayjs from 'dayjs'
import _ from 'underscore'
const app = getApp();
......@@ -422,9 +423,7 @@
studentList.value = response.rows
for (var s of studentList.value) {
s.checked = false
if (s.photo && s.photo.indexOf('http') == -1) {
s.photo = config.baseUrl_api + s.photo
}
s.photo = fillImgUrl(s.photo)
}
uni.hideLoading()
......@@ -485,9 +484,7 @@
if (!d.isPass) {
d.isPass = '1'
}
if (d.photo && d.photo.indexOf('http') == -1) {
d.photo = config.baseUrl_api + d.photo
}
d.photo = fillImgUrl(d.photo)
})
infoList.value = res.rows
......
......@@ -112,8 +112,8 @@
infoList.value.push(item)
})
console.log(infoList.value)
form.value.totalNum = Math.floor(_.sumBy(infoList.value, (o) => parseFloat(o.totalNum || 0)))
form.value.totalAmount = Math.floor(_.sumBy(infoList.value, (o) => parseFloat(o.totalAmount || 0)))
form.value.totalNum = Math.floor(infoList.value.reduce((sum, o) => sum + parseFloat(o.totalNum || 0), 0))
form.value.totalAmount = Math.floor(infoList.value.reduce((sum, o) => sum + parseFloat(o.totalAmount || 0), 0))
uni.hideLoading()
......
......@@ -115,6 +115,7 @@
<script setup>
import * as api from '@/common/api.js'
import config from '@/config.js'
import { fillImgUrl, previewAttachment } from '@/common/utils.js'
import * as loginServer from '@/common/login.js';
import _ from 'underscore'
......@@ -203,9 +204,17 @@
if (form.value.businessLicense) {
form.value.businessLicenseArr = []
try{
form.value.businessLicenseArr = JSON.parse(form.value.businessLicense) || []
const parsed = JSON.parse(form.value.businessLicense) || []
form.value.businessLicenseArr = parsed.map(item => ({
...item,
name: item.name || '营业执照',
url: fillImgUrl(item.url || item.rawUrl || form.value.businessLicense)
}))
}catch(e){
form.value.businessLicenseArr=[{url:form.value.businessLicense,name:'营业执照'}]
form.value.businessLicenseArr=[{
url: fillImgUrl(form.value.businessLicense),
name: '营业执照'
}]
}
console.log('营业执照',form.value.businessLicenseArr)
}
......@@ -213,13 +222,7 @@
form.value.legalIdcPhotoArr = []
var arr = form.value.certLegalIdcPhoto?.split(',') || []
if (arr.length > 0) {
arr = _.map(arr, (p) => {
if(p.indexOf('http')==-1){
console.log(p)
p = config.baseUrl_api + p
}
return p
})
arr = _.map(arr, (p) => fillImgUrl(p))
form.value.legalIdcPhotoArr = arr
}
console.log('法人身份证',form.value.legalIdcPhotoArr)
......@@ -228,12 +231,7 @@
form.value.picturesArr = []
var arr = form.value.certPictures.split(',') || []
if (arr.length > 0) {
arr = _.map(arr, (p) => {
if(p.indexOf('http')==-1){
p = config.baseUrl_api + p
}
return p
})
arr = _.map(arr, (p) => fillImgUrl(p))
form.value.picturesArr = arr
}
console.log(form.value.picturesArr)
......@@ -258,29 +256,7 @@
}
function download(url) {
console.log(url)
if (url.indexOf('.png') > -1 || url.indexOf('.jpg') > -1) {
if(url.indexOf('http')>-1){
uni.previewImage({
urls: [url],
success: function(res) {
}
})
} else {
uni.previewImage({
urls: [config.baseUrl_api + url],
success: function(res) {
}
})
}
} else {
if(url.indexOf('http')>-1){
goWebView(url)
} else {
goWebView(config.baseUrl_api + url)
}
}
previewAttachment(url, { title: '查看营业执照' })
}
function goWebView(url) {
......
<template>
<view class="page">
<view class="bgbg">
<view class="flex">
<view class="imgbox">
<image v-if="state.user.avatar" :src="state.user.avatar"/>
<image v-else src="@/static/nodata.png"/>
</view>
<view class="flex">
<view class="imgbox">
<image v-if="state.user.avatar" :src="state.user.avatar"/>
<image v-else src="@/static/nodata.png"/>
</view>
<text class="name">{{ state.user.userName }}</text>
</view>
</view>
<view class="rMainBox">
<uni-list :border="false" class="myList">
<uni-list-item thumb="/static/user_icon01.png" title="团体信息" showArrow clickable @click="goPath('/myCenter/teamInfo')">
</uni-list-item>
<uni-list-item thumb="/static/user_icon02.png" title="会员认证" showArrow clickable @click="goPath('/myCenter/auth')">
</uni-list-item>
<!-- <uni-list-item thumb="/static/user_icon03.png" v-show="userType==2" title="账户信息" showArrow clickable>
</uni-list-item> -->
<uni-list-item thumb="/static/user_icon03.png" title="账号安全" showArrow clickable @click="goPath('/myCenter/safe')">
</uni-list-item>
</uni-list>
</view>
<view class="fixedBottom" style="background: transparent;box-shadow: none;">
<button @click="loginOut" class="btn btn-red" style="border-radius: 50px;">退出登录</button>
</view>
<view class="rMainBox">
<uni-list :border="false" class="myList">
<uni-list-item thumb="/static/user_icon01.png" title="团体信息" showArrow clickable @click="goPath('/myCenter/teamInfo')">
</uni-list-item>
<uni-list-item thumb="/static/user_icon02.png" title="会员认证" showArrow clickable @click="goPath('/myCenter/auth')">
</uni-list-item>
<!-- <uni-list-item thumb="/static/user_icon03.png" v-show="userType==2" title="账户信息" showArrow clickable>
</uni-list-item> -->
<uni-list-item thumb="/static/user_icon03.png" title="账号安全" showArrow clickable @click="goPath('/myCenter/safe')">
</uni-list-item>
</uni-list>
</view>
<view class="fixedBottom" style="background: transparent;box-shadow: none;">
<button @click="loginOut" class="btn btn-red" style="border-radius: 50px;">退出登录</button>
</view>
</view>
</template>
......@@ -37,6 +37,7 @@
import * as api from '@/common/api.js';
import * as loginServer from '@/common/login.js';
import config from '@/config.js'
import { fillImgUrl } from '@/common/utils.js'
import {
onLoad,
onShow,
......@@ -60,11 +61,11 @@ let proId;
const svId = ref(null);
const numData = ref({});
const messageList = ref([])
const state = reactive({
user: {},
roleGroup: {},
postGroup: {}
const messageList = ref([])
const state = reactive({
user: {},
roleGroup: {},
postGroup: {}
})
onShow(() => {
if (app.globalData.isLogin) {
......@@ -80,12 +81,12 @@ onLoad(option => {
proId = decodeURIComponent(option.scene);
} else {
proId = option.proId;
}
}
if(uni.showShareMenu){
uni.showShareMenu({
withShareTicket: true,
menus: ['shareAppMessage', 'shareTimeline']
});
});
}
});
......@@ -104,21 +105,19 @@ function loginOut() {
}
})
}
function getUser() {
api.getUserProfile().then((response) => {
state.user = response.data.user
if(state.user.avatar&&state.user.avatar.indexOf('http')==-1){
state.user.avatar = config.baseUrl_api+state.user.avatar
}
state.roleGroup = response.data.roleGroup
state.postGroup = response.data.postGroup
uni.hideLoading();
})
function getUser() {
api.getUserProfile().then((response) => {
state.user = response.data.user
state.user.avatar = fillImgUrl(state.user.avatar)
state.roleGroup = response.data.roleGroup
state.postGroup = response.data.postGroup
uni.hideLoading();
})
}
function init() {
uni.showLoading({
title: '加载中'
});
});
getUser()
loginServer.getMyOwnMemberInfo().then(res => {
userType.value = app.globalData.userType
......@@ -126,31 +125,31 @@ function init() {
uni.hideLoading();
})
}
function goPath(url){
uni.navigateTo({
url:url
})
function goPath(url){
uni.navigateTo({
url:url
})
}
</script>
<style scope lang="scss">
<style scope lang="scss">
.uni-list:after{display: none;}
.page {
width: 100vw;
overflow: hidden;
}
.bgbg{
.flex{align-items: center;}
height: 280rpx;padding:30rpx;
.name{margin-left: 20rpx;
font-size: 36rpx;}
.imgbox{width: 120rpx;
height: 120rpx;overflow: hidden;
// background: #C7C7CD;
// border: 4rpx solid #FFFFFF;
border-radius: 50%;
image{height: 120rpx;width: 120rpx;object-fit: cover;}
}
.bgbg{
.flex{align-items: center;}
height: 280rpx;padding:30rpx;
.name{margin-left: 20rpx;
font-size: 36rpx;}
.imgbox{width: 120rpx;
height: 120rpx;overflow: hidden;
// background: #C7C7CD;
// border: 4rpx solid #FFFFFF;
border-radius: 50%;
image{height: 120rpx;width: 120rpx;object-fit: cover;}
}
}
.loginOutIcon {
position: relative;
......@@ -219,11 +218,11 @@ function goPath(url){
margin: 30rpx 0 20rpx;
padding: 0 20rpx 0;
}
}
.rMainBox {position: relative;top:-120rpx;
box-sizing: border-box;padding: 20rpx 20rpx;
background-color: #fff;
border-radius: 15rpx;
margin: 25rpx;overflow: hidden;
}
.rMainBox {position: relative;top:-120rpx;
box-sizing: border-box;padding: 20rpx 20rpx;
background-color: #fff;
border-radius: 15rpx;
margin: 25rpx;overflow: hidden;
}
</style>
\ No newline at end of file
......
......@@ -103,6 +103,7 @@
onShow
} from '@dcloudio/uni-app';
import config from '@/config.js'
import { fillImgUrl } from '@/common/utils.js'
const app = getApp();
const form = ref({
type: '1',
......@@ -242,12 +243,8 @@
if(form.value.legalIdcPhoto){
legalIdcPhoto1.value = form.value.legalIdcPhoto.split(',')?.[0] || ''
legalIdcPhoto2.value = form.value.legalIdcPhoto.split(',')?.[1] || ''
if(legalIdcPhoto1.value.indexOf('http')==-1){
legalIdcPhoto1.value = config.baseUrl_api + legalIdcPhoto1.value
}
if(legalIdcPhoto2.value.indexOf('http')==-1){
legalIdcPhoto2.value = config.baseUrl_api + legalIdcPhoto2.value
}
legalIdcPhoto1.value = fillImgUrl(legalIdcPhoto1.value)
legalIdcPhoto2.value = fillImgUrl(legalIdcPhoto2.value)
imgfront.value = {
url: legalIdcPhoto1.value,
name: '身份证正面',
......@@ -265,9 +262,7 @@
var arr = form.value.pictures.split(',') || []
if (arr.length > 0) {
arr = _.map(arr, (p) => {
if(p.indexOf('http')==-1){
p = config.baseUrl_api + p
}
p = fillImgUrl(p)
var obj = {
url: p,
name: '图片',
......@@ -482,10 +477,17 @@
return
}
uni.showLoading({
title: '加载中'
title: '上传中'
})
api.uploadImg(e).then(data => {
legalIdcPhoto1.value = data.msg
uploadMinioImage(imgUrl).then(url => {
legalIdcPhoto1.value = url
uni.hideLoading()
}).catch(err => {
uni.hideLoading()
uni.showToast({
title: '上传失败',
icon: 'none'
})
})
}
......@@ -496,10 +498,17 @@
return
}
uni.showLoading({
title: '加载中'
title: '上传中'
})
api.uploadImg(e).then(data => {
legalIdcPhoto2.value = data.msg
uploadMinioImage(imgUrl).then(url => {
legalIdcPhoto2.value = url
uni.hideLoading()
}).catch(err => {
uni.hideLoading()
uni.showToast({
title: '上传失败',
icon: 'none'
})
})
}
......@@ -521,19 +530,31 @@
if (!file) {
return
}
api.uploadFile(e).then(data => {
const filePath = file.url || file.path || e.tempFilePaths?.[0]
uni.showLoading({
title: '上传中'
})
uploadMinioImage(filePath).then(url => {
selectFileValue = {
url: data.msg,
url: url,
name: file.name,
extname: file.extname
}
form.value.businessLicense = JSON.stringify([selectFileValue])
console.log(selectFileValue,form.value.businessLicense)
uni.hideLoading()
}).catch(err => {
uni.hideLoading()
uni.showToast({
title: '上传失败',
icon: 'none'
})
})
}
function delSupplementFile() {
selectFileValue = {}
form.value.businessLicense = ''
}
function upPicArr(e) {
......@@ -543,20 +564,58 @@
return
}
uni.showLoading({
title: '加载中'
title: '上传中'
})
api.uploadImg(e).then(data => {
picArr.value.push(data.msg)
// form.value.pictures
console.log(picArr.value)
Promise.all(tempFilePaths.slice(0, 3).map(path => uploadMinioImage(path))).then(urls => {
picArr.value.push(...urls.filter(Boolean))
form.value.pictures = picArr.value.join(',')
uni.hideLoading()
}).catch(err => {
uni.hideLoading()
uni.showToast({
title: '上传失败',
icon: 'none'
})
})
}
function delpicArr(e) {
picArr.value.splice(e.index, 1)
form.value.pictures = picArr.value.join(',')
console.log(picArr.value, picArrR.value)
}
function uploadMinioImage(filePath) {
return new Promise((resolve, reject) => {
if (!filePath) return reject(new Error('请选择图片'))
uni.uploadFile({
url: config.baseUrl_api + '/fileServer/uploadImg',
filePath,
name: 'image',
header: {
'Authorization': uni.getStorageSync('token')
},
success: (res) => {
try {
const data = JSON.parse(res.data || '{}')
const url = getUploadUrl(data)
if (!url) return reject(new Error('上传返回数据异常'))
resolve(url)
} catch (e) {
reject(e)
}
},
fail: reject
})
})
}
function getUploadUrl(res) {
const data = res?.data
if (typeof data === 'string') return data
return data?.ms || data?.url || data?.fang || res?.msg || ''
}
function bindChange(e) {
console.log(e)
......
<template>
<view class="mainbox">
<view class="mainbox">
<view class="title">{{form.name}}</view>
<view class="infos">
<text>{{ form.source }}</text>
......@@ -10,17 +10,18 @@
<view v-html="form.content"></view>
<view v-if="attachmentMp4.length>0">
<video v-for="(f,index) in attachmentMp4" :key="index" controls :src="config.baseUrl_api + f.url"></video>
<video v-for="(f,index) in attachmentMp4" :key="index" controls
:src="fillImgUrl(f.url)"></video>
</view>
<view v-if="attachmentFile.length>0" class="mt20">
<!-- 附件-->
<view class="fwb mt20">附件下载:</view>
<view v-for="(f,index) in attachmentFile" :key="index" class="text-primary underLine"
@click="downLoad(f.url)">
{{ index + 1 }}{{ f.name }}
</view>
</view>
<view v-if="attachmentFile.length>0" class="mt20">
<!-- 附件-->
<view class="fwb mt20">附件下载:</view>
<view v-for="(f,index) in attachmentFile" :key="index" class="text-primary underLine"
@click="downLoad(f.url)">
{{ index + 1 }}{{ f.name }}
</view>
</view>
<view>
<text v-if=" form.author">发布人:{{ form.author }}</text>
</view>
......@@ -37,10 +38,10 @@
onLoad
} from '@dcloudio/uni-app';
import _ from 'underscore'
import config from '@/config.js'
import { fillImgUrl, previewAttachment } from '@/common/utils.js'
const form = ref({})
const attachmentFile = ref([])
const attachmentMp4 = ref([])
const attachmentFile = ref([])
const attachmentMp4 = ref([])
onLoad((option) => {
getData(option.noteId)
......@@ -54,82 +55,19 @@ const attachmentMp4 = ref([])
.replace(/<img([\s\w"-=\/\.:;]+)((?:(style="[^"]+")))/ig, '<img$1')
.replace(/<img([\s\w"-=\/\.:;]+)((?:(alt="[^"]+")))/ig, '<img$1')
.replace(/<img([\s\w"-=\/\.:;]+)/ig, '<img style="width: 100%;" $1');
if (form.value.attacthJson) {
const attachment = JSON.parse(form.value.attacthJson)
attachmentFile.value = _.filter(attachment, (a) => a.url.toLowerCase().indexOf('.mp4') === -1) || []
attachmentMp4.value = _.filter(attachment, (a) => a.url.toLowerCase().indexOf('.mp4') !== -1) || []
const attachment = JSON.parse(form.value.attacthJson)
attachmentFile.value = _.filter(attachment, (a) => a.url.toLowerCase().indexOf('.mp4') === -1) ||
[]
attachmentMp4.value = _.filter(attachment, (a) => a.url.toLowerCase().indexOf('.mp4') !== -1) || []
}
})
}
function downLoad(url){
console.log(url)
var str = config.baseUrl_api + url
if (url.indexOf('png') > -1 ||url.indexOf('jpg') > -1 ||url.indexOf('jpeg') > -1) {
uni.previewImage({
urls: [str],
success: function(res) {
console.log('success', res)
},
fail: function(res) {
console.log('fail', res)
},
complete: function(res) {
console.log('complete', res)
}
})
} else {
goWebView(str)
}
}
function goWebView(url) {
url = url.replace("http://", "https://")
uni.showLoading({
title: '下载中'
});
uni.downloadFile({
url: url,
success: function(res) {
console.log('111')
uni.hideLoading();
var filePath = res.tempFilePath;
uni.showLoading({
title: '正在打开'
});
uni.openDocument({
filePath: filePath,
showMenu: true,
success: function(res) {
console.log('222')
uni.hideLoading();
},
fail: function(err) {
console.log(err.errMsg)
uni.hideLoading();
let msg
if(err.errMsg.indexOf('not supported')>-1){
msg = '不支持该文件类型'
} else {
msg = err.errMsg
}
uni.showToast({
title: msg,
icon: 'none',
duration: 2000
});
}
});
},
fail: function(error) {
uni.hideLoading();
uni.showToast({
title: `下载失败`,
icon: 'none',
duration: 2000
});
}
});
function downLoad(url) {
previewAttachment(url, { title: '附件预览' })
}
</script>
......@@ -146,13 +84,13 @@ const attachmentMp4 = ref([])
color: #29343C;
margin-bottom: 34rpx;
}
.infos {
border-bottom: 1px solid #DCDCDC;
padding-bottom: 40rpx;
overflow: hidden;
}
.infos>text {
margin-right: 18rpx;
color: #7B7F83;
......@@ -167,27 +105,29 @@ const attachmentMp4 = ref([])
word-wrap: break-word !important;
white-space: normal !important;
}
.content rich-text {
word-wrap: break-word !important;
white-space: normal !important;
}
.content span,
.content p {
word-wrap: break-word !important;
white-space: normal !important;
}
.content rich-text img{max-width: 100%;}
.content rich-text img {
max-width: 100%;
}
image {
max-width: 100%;
}
audio {
width: 100%;
}
video {
width: 100%;
}
......
......@@ -25,7 +25,7 @@
</view>
<view class="ddd" v-if="userType=='2'||userType=='1'">
<text class="lab">总金额:</text>
<text class="text-danger">¥{{(form.totalAmount*1).toFixed(2) }}</text>
<text class="text-danger">¥{{ form.totalAmount? (form.totalAmount*1).toFixed(2) : '0' }}</text>
</view>
</view>
<view class="wBox">
......
......@@ -64,7 +64,7 @@
<uni-forms-item label="头像" required>
<uni-file-picker v-model="photoArr" @delete="delPhoto" return-type="object" limit="1"
@select="upPhoto" :del-ico="false" :image-styles="imageStylesTx"></uni-file-picker>
<image mode="aspectFill" v-if="baseFormData.photo2" style="height:200rpx;width:200rpx;" :src="config.baseUrl_api + baseFormData.photo2"/>
<!-- <image mode="aspectFill" v-if="baseFormData.photo2" style="height:200rpx;width:200rpx;" :src="fillImgUrl(baseFormData.photo2)"/> -->
</uni-forms-item>
</view>
......@@ -130,6 +130,7 @@
} from '@dcloudio/uni-app'
import config from '@/config.js'
import * as aes2 from '@/common/utils.js'
import { fillImgUrl, fillMemberPhoto } from '@/common/utils.js'
const current = ref(0)
const popup = ref(null)
const infoConfirm = ref(null)
......@@ -301,7 +302,7 @@
baseFormData.value.photo = data.data.fang;
baseFormData.value.photo2 = data.data.yuan;
photoArr.value = {
url: config.baseUrl_api+baseFormData.value.photo,
url: fillImgUrl(baseFormData.value.photo),
name: '头像',
extname: 'jpg'
}
......@@ -358,26 +359,17 @@
baseFormData.value.phone = res.data.phone
baseFormData.value.cityId = res.data.cityId
baseFormData.value.address = res.data.address
if (res.data.photo) {
console.log(res.data.photo)
if (res.data.photo.indexOf('http') == -1) {
baseFormData.value.photo = res.data.photo
let obj = {
url: config.baseUrl_api + res.data.photo,
name: '头像',
extname: 'jpg'
}
photoArr.value = obj
} else {
baseFormData.value.photo = res.data.photo
let obj = {
url: res.data.photo,
name: '头像',
extname: 'jpg'
}
photoArr.value = obj
const photoUrl = fillMemberPhoto(res.data)
if (photoUrl) {
console.log(res.data.photo || res.data.perPhoto)
baseFormData.value.photo = res.data.photo || res.data.perPhoto || ''
baseFormData.value.photo2 = res.data.photo2 || res.data.perPhoto2 || ''
let obj = {
url: photoUrl,
name: '头像',
extname: 'jpg'
}
photoArr.value = obj
}
// baseFormData.value.name = res.data.name
baseFormData.value.perId = res.data.perId
......
......@@ -61,11 +61,12 @@
onLoad,
onShow
} from '@dcloudio/uni-app'
import {
szToHz
} from '@/common/utils.js'
import {
parseAttachmentJson,
previewAttachment,
szToHz
} from '@/common/utils.js'
import * as api from '@/common/api.js'
import config from '../config';
const inputstyle = ref({
borderColor: '#fff',
fontSize: '30rpx'
......@@ -242,75 +243,20 @@ import config from '../config';
api.getLevelChangeAddList(queryParams.value).then(Response => {
list.value = Response.rows
for (var item of list.value) {
item.examPersonData = JSON.parse(item.examPersonData)
if (item.fileUrl) {
item.fileUrl = JSON.parse(item.fileUrl)
}
}
item.examPersonData = JSON.parse(item.examPersonData)
if (item.fileUrl) {
item.fileUrl = parseAttachmentJson(item.fileUrl)
}
}
total.value = Response.total
uni.hideLoading()
})
}
function showImg(n) {
var str= config.baseUrl_api + n.fileUrl[0]?.url
if(n.fileUrl[0]?.url.indexOf('png')>-1||n.fileUrl[0]?.url.indexOf('jpg')>-1||n.fileUrl[0]?.url.indexOf('jpeg')>-1){
uni.previewImage({
urls: [str],
success: function(res) {
console.log('success', res)
},
fail: function(res) {
console.log('fail', res)
},
complete: function(res) {
console.log('complete', res)
}
})
}else{
goWebView(str)
}
previewAttachment(n.fileUrl, { title: '查看附件' })
}
function goWebView(url){
url = url.replace("http://", "https://")
uni.showLoading({
title: '下载中'
});
uni.downloadFile({
url: url,
success: function(res) {
uni.hideLoading();
var filePath = res.tempFilePath;
uni.showLoading({
title: '正在打开'
});
uni.openDocument({
filePath: filePath,
showMenu: true,
success: function(res) {
uni.hideLoading();
},
fail: function(err) {
uni.hideLoading();
uni.showToast({
title: err,
icon: 'none',
duration: 2000
});
}
});
},
fail: function(error) {
uni.hideLoading();
uni.showToast({
title: `下载失败`,
icon: 'none',
duration: 2000
});
}
});
}
</script>
</script>
<style scoped lang="scss">
.wBox {
......@@ -406,4 +352,4 @@ import config from '../config';
:deep(.file-picker__progress) {
opacity: 0;
}
</style>
\ No newline at end of file
</style>
......
......@@ -74,7 +74,7 @@
onLoad
} from '@dcloudio/uni-app'
import * as api from '@/common/api.js'
import config from '@/config.js'
import { parseAttachmentJson, previewAttachment } from '@/common/utils.js'
const queryParams = ref({})
const total = ref(0)
const list = ref([])
......@@ -120,7 +120,7 @@
api.addInfoModeList(queryParams.value).then(res => {
list.value = res.rows
list.value.forEach(item => {
item.fileUrl = JSON.parse(item.fileUrl)
item.fileUrl = parseAttachmentJson(item.fileUrl)
})
total.value = res.total
uni.hideLoading()
......@@ -150,67 +150,10 @@
})
}
function showImg(n) {
var str = config.baseUrl_api + n.fileUrl[0]?.url
if (n.fileUrl[0]?.url.indexOf('png') > -1 || n.fileUrl[0]?.url.indexOf('jpg') > -1 || n.fileUrl[0]?.url.indexOf(
'jpeg') > -1) {
uni.previewImage({
urls: [str],
success: function(res) {
console.log('success', res)
},
fail: function(res) {
console.log('fail', res)
},
complete: function(res) {
console.log('complete', res)
}
})
} else {
goWebView(str)
}
}
function goWebView(url) {
url = url.replace("http://", "https://")
uni.showLoading({
title: '下载中'
});
uni.downloadFile({
url: url,
success: function(res) {
uni.hideLoading();
var filePath = res.tempFilePath;
uni.showLoading({
title: '正在打开'
});
uni.openDocument({
filePath: filePath,
showMenu: true,
success: function(res) {
uni.hideLoading();
},
fail: function(err) {
uni.hideLoading();
uni.showToast({
title: err,
icon: 'none',
duration: 2000
});
}
});
},
fail: function(error) {
uni.hideLoading();
uni.showToast({
title: `下载失败`,
icon: 'none',
duration: 2000
});
}
});
}
</script>
function showImg(n) {
previewAttachment(n.fileUrl, { title: '查看附件' })
}
</script>
<style scoped lang="scss">
.flexbox {
padding: 30rpx 30rpx 0
......@@ -244,4 +187,4 @@
background: #fff;
padding: 30rpx;
}
</style>
\ No newline at end of file
</style>
......
......@@ -26,9 +26,9 @@
<!-- 会员证 -->
<view style="margin: 30rpx 0 0;" v-if="form.certStage!=0&&form.idcType!=3&&form.certStage!=2&&form.certStage!=1">
<view class="zhengBox">
<view class="zhengBox">
<image v-if="form.certStage == 4" style="width: 600rpx; height: 380rpx;position: relative" :src="config.baseUrl_api+'/fs/static/icon/memberCardU.png'" :fit="fit" />
<image v-else style="width: 600rpx; height: 380rpx;position: relative" :src="config.baseUrl_api+'/fs/static/icon/memberCard.png'" :fit="fit" />
<image v-else style="width: 600rpx; height: 380rpx;position: relative" :src="config.baseUrl_api+'/fs/static/icon/memberCard.png'" :fit="fit" />
<view class="zhengbody" @contextmenu.prevent="youji">
<image mode="aspectFill" :src="(form.photo)" class="head"/>
<view class="memberNumber">{{ form.perCode }}</view>
......@@ -65,6 +65,7 @@
<script setup>
import * as api from '@/common/api.js'
import config from '@/config.js'
import { fillImgUrl } from '@/common/utils.js'
import {
onLoad,
onShow
......@@ -99,7 +100,7 @@
value: '6'
}
])
const form = ref({})
const form = ref({})
const urlHref = ref()
onLoad((option) => {
console.log(option)
......@@ -111,9 +112,7 @@
if (form.value.cityId) {
getRegionsList(form.value.cityId)
}
if (form.value.photo && form.value.photo.indexOf('http') == -1) {
form.value.photo = config.baseUrl_api + form.value.photo
}
form.value.photo = fillImgUrl(form.value.photo)
})
})
......@@ -129,15 +128,15 @@
}
}
})
}
function fileData(time) {
if (!time) return
const data = new Date(time.replace(/-/g, '/'))
const year = data.getFullYear()
const month = data.getMonth() + 1
const dates = data.getDate()
return year + '年' + month + '月' + dates + '日'
}
}
function fileData(time) {
if (!time) return
const data = new Date(time.replace(/-/g, '/'))
const year = data.getFullYear()
const month = data.getMonth() + 1
const dates = data.getDate()
return year + '年' + month + '月' + dates + '日'
}
</script>
......@@ -215,63 +214,63 @@
color: #fff;
text-align: center;
border-radius: 50%;
}
.zhengBox{
position: relative;width: 600rpx; height: 380rpx;margin:0 auto 30rpx;
.zhengbody{
.head{width: 114rpx;height: 114rpx;border-radius: 50%;position: absolute;left: 65rpx;top: 132rpx;}
.birthday{
position: absolute; top: 158rpx;left: 434rpx;
font-size: 16rpx;
color: #9f6a44;
}
.memberNumber{
position: absolute;top: 182rpx;left: 290rpx;
font-size: 19rpx;
color: #9f6a44;
font-weight: 600;
letter-spacing: 1px;
}
.phone{
position: absolute; top: 292rpx;left: 340rpx;
font-size: 16rpx;
color: #bc9060;
}
.service{
position: absolute;
top: 313rpx;
left: 340rpx;
font-size: 16rpx;
color: #bc9060;
}
.validity{
position: absolute;
top: 336rpx;
left: 340rpx;
font-size: 16rpx;
color: #bc9060;
}
.nameC{
position: absolute;
top: 146rpx;
left: 240rpx;
color: #9f6a44;
font-weight: 600;
line-height: 1;
}
.content{
width: 120rpx;
box-sizing: border-box;
display: flex;
align-items: center;
//white-space: nowrap;
overflow: hidden;
overflow-x: auto;
transform-origin: 0 55%;
white-space: nowrap;
}
}
}
.zhengBox{
position: relative;width: 600rpx; height: 380rpx;margin:0 auto 30rpx;
.zhengbody{
.head{width: 114rpx;height: 114rpx;border-radius: 50%;position: absolute;left: 65rpx;top: 132rpx;}
.birthday{
position: absolute; top: 158rpx;left: 434rpx;
font-size: 16rpx;
color: #9f6a44;
}
.memberNumber{
position: absolute;top: 182rpx;left: 290rpx;
font-size: 19rpx;
color: #9f6a44;
font-weight: 600;
letter-spacing: 1px;
}
.phone{
position: absolute; top: 292rpx;left: 340rpx;
font-size: 16rpx;
color: #bc9060;
}
.service{
position: absolute;
top: 313rpx;
left: 340rpx;
font-size: 16rpx;
color: #bc9060;
}
.validity{
position: absolute;
top: 336rpx;
left: 340rpx;
font-size: 16rpx;
color: #bc9060;
}
.nameC{
position: absolute;
top: 146rpx;
left: 240rpx;
color: #9f6a44;
font-weight: 600;
line-height: 1;
}
.content{
width: 120rpx;
box-sizing: border-box;
display: flex;
align-items: center;
//white-space: nowrap;
overflow: hidden;
overflow-x: auto;
transform-origin: 0 55%;
white-space: nowrap;
}
}
}
</style>
\ No newline at end of file
......
......@@ -52,7 +52,7 @@
</view>
</view>
<view class="nodata" v-if="list.length==0">
<image mode="aspectFit" src="/static/nodata.png"></image>
<image mode="aspectFit" :src="config.baseUrl_api + '/fs/static/nodata.png'"></image>
<text>暂无数据</text>
</view>
......@@ -83,6 +83,7 @@
<script setup>
import * as api from '@/common/api.js'
import config from '@/config.js'
import { parseAttachmentJson, previewAttachment } from '@/common/utils.js'
import {
onMounted,
ref
......@@ -127,67 +128,8 @@ function handleUpdate(item) {
}
function downloadOrder(item) {
//下载凭证
var arr = JSON.parse(item.payEvidence) || []
showImg(arr[0]?.url)
}
function showImg(url) {
var str = config.baseUrl_api + url
if (url.indexOf('png') > -1 || url.indexOf('jpg') > -1 || url.indexOf('jpeg') > -1) {
uni.previewImage({
urls: [str],
success: function(res) {
console.log('success', res)
},
fail: function(res) {
console.log('fail', res)
},
complete: function(res) {
console.log('complete', res)
}
})
} else {
goWebView(str)
}
}
function goWebView(url) {
url = url.replace("http://", "https://")
uni.showLoading({
title: '下载中'
});
uni.downloadFile({
url: url,
success: function(res) {
uni.hideLoading();
var filePath = res.tempFilePath;
uni.showLoading({
title: '正在打开'
});
uni.openDocument({
filePath: filePath,
showMenu: true,
success: function(res) {
uni.hideLoading();
},
fail: function(err) {
uni.hideLoading();
uni.showToast({
title: err,
icon: 'none',
duration: 2000
});
}
});
},
fail: function(error) {
uni.hideLoading();
uni.showToast({
title: `下载失败`,
icon: 'none',
duration: 2000
});
}
});
const arr = parseAttachmentJson(item.payEvidence) || []
previewAttachment(arr[0] || arr, { title: '查看凭证' })
}
let selectFileValue = {}
......
<template>
<template>
<view>
<z-paging ref="paging" v-show="total>0" v-model="list" @query="getQuery" emptyViewImg="/static/nodata.png">
<view class="searchbar" :slot="top">
<uni-easyinput placeholderStyle="font-size:30rpx" :input-border="false" prefixIcon="search"
v-model="query.name" @blur="getList" @clear="getList" placeholder="搜索姓名">
</uni-easyinput>
<z-paging ref="paging" v-show="total>0" v-model="list" @query="getQuery" emptyViewImg="/static/nodata.png">
<view class="searchbar" :slot="top">
<uni-easyinput placeholderStyle="font-size:30rpx" :input-border="false" prefixIcon="search"
v-model="query.name" @blur="getList" @clear="getList" placeholder="搜索姓名">
</uni-easyinput>
</view>
<view class="pdbox">
......@@ -55,7 +55,7 @@
</template>
</uni-swipe-action-item>
</uni-swipe-action>
</view>
</view>
</view>
</z-paging>
......@@ -63,39 +63,40 @@
<!-- <image mode="aspectFit" src="/static/nodata.png"></image> -->
<button class="btn-red" v-if="userType=='4'" @click="goVipList">+ 添加会员</button>
<!-- <text v-else>暂无数据</text> -->
</view>
</view>
</template>
<script setup>
import * as api from '@/common/api.js'
import config from '@/config.js'
import {
onMounted,
ref
} from 'vue'
import {
onLoad,onShow
} from '@dcloudio/uni-app'
const query = ref({
pageNum: 1,
pageSize: 20,
showMyPersonFlag: null,
multiDeptFlag: 1,
perType: 1,
checkPaymentCommit: 1
</view>
</view>
</template>
<script setup>
import * as api from '@/common/api.js'
import { fillImgUrl, previewAttachment } from '@/common/utils.js'
import config from '@/config.js'
import {
onMounted,
ref
} from 'vue'
import {
onLoad,onShow
} from '@dcloudio/uni-app'
const query = ref({
pageNum: 1,
pageSize: 20,
showMyPersonFlag: null,
multiDeptFlag: 1,
perType: 1,
checkPaymentCommit: 1
})
const paging = ref(null)
const userType = ref('')
const list = ref([])
const total = ref(0)
const app = getApp();
onLoad(() => {
userType.value = app.globalData.userType
})
onShow(() => {
getList()
})
const paging = ref(null)
const userType = ref('')
const list = ref([])
const total = ref(0)
const app = getApp();
onLoad(() => {
userType.value = app.globalData.userType
})
onShow(() => {
getList()
})
function getQuery(pageNum,pageSize){
query.value.pageNum = pageNum
query.value.pageSize = pageSize
......@@ -106,106 +107,102 @@
}
api.selectPageList(query.value).then(res => {
for (var l of res.rows) {
if (l.photo && l.photo.indexOf('http') == -1) {
l.photo = config.baseUrl_api + l.photo
}
l.photo = fillImgUrl(l.photo)
}
list.value = res.rows
paging.value.complete(res.rows)
total.value = res.total
})
}
function getList() {
uni.showLoading({
title: '加载中'
})
if (app.globalData.userType == '4') {
// 道馆
query.value.multiDeptFlag = null
query.value.showMyPersonFlag = 1
}
api.selectPageList(query.value).then(res => {
for (var l of res.rows) {
if (l.photo && l.photo.indexOf('http') == -1) {
l.photo = config.baseUrl_api + l.photo
}
}
function getList() {
uni.showLoading({
title: '加载中'
})
if (app.globalData.userType == '4') {
// 道馆
query.value.multiDeptFlag = null
query.value.showMyPersonFlag = 1
}
api.selectPageList(query.value).then(res => {
for (var l of res.rows) {
l.photo = fillImgUrl(l.photo)
}
list.value = res.rows
paging.value.complete(res.rows)
total.value = res.total
uni.hideLoading()
})
}
function handleDelete(item) {
uni.showModal({
content: `是否确认删除${item.name}`,
success: function(res) {
if (res.confirm) {
api.delInfo(item.perId).then(response => {
uni.showToast({
title: '删除成功',
icon: 'none'
})
getList()
})
}
}
})
}
function handleUpdate(n) {
uni.navigateTo({
url: `/personalVip/editVip?perId=${n.perId}&perType=${n.perType}`
})
}
function handleInfo(n) {
uni.navigateTo({
url: `/personalVip/detail?perId=${n.perId}`
})
}
function goVipList() {
let path = '/personalVip/addVip';
uni.navigateTo({
url: path
});
}
</script>
paging.value.complete(res.rows)
total.value = res.total
uni.hideLoading()
})
}
function handleDelete(item) {
uni.showModal({
content: `是否确认删除${item.name}`,
success: function(res) {
if (res.confirm) {
api.delInfo(item.perId).then(response => {
uni.showToast({
title: '删除成功',
icon: 'none'
})
getList()
})
}
}
})
}
function handleUpdate(n) {
uni.navigateTo({
url: `/personalVip/editVip?perId=${n.perId}&perType=${n.perType}`
})
}
function handleInfo(n) {
uni.navigateTo({
url: `/personalVip/detail?perId=${n.perId}`
})
}
function goVipList() {
let path = '/personalVip/addVip';
uni.navigateTo({
url: path
});
}
</script>
<style scoped lang="scss">
.personitem{margin: 0 0 30rpx;}
.searchbar {
display: flex;
align-items: center;
padding: 25rpx;
box-sizing: border-box;
.invertedbtn-red {
margin-left: 15rpx;
font-size: 30rpx;
padding: 16rpx 20rpx;
box-sizing: border-box;
border-radius: 50rpx;
background-color: #fff;
}
:deep(.uni-easyinput .uni-easyinput__content) {
border-radius: 35rpx;
border: none;
height: 70rpx;
}
:deep(.uni-easyinput__content-input) {
font-size: 26rpx;
}
}
.content-box {
.personitem{margin: 0 0 30rpx;}
.searchbar {
display: flex;
align-items: center;
padding: 25rpx;
box-sizing: border-box;
.invertedbtn-red {
margin-left: 15rpx;
font-size: 30rpx;
padding: 16rpx 20rpx;
box-sizing: border-box;
border-radius: 50rpx;
background-color: #fff;
}
:deep(.uni-easyinput .uni-easyinput__content) {
border-radius: 35rpx;
border: none;
height: 70rpx;
}
:deep(.uni-easyinput__content-input) {
font-size: 26rpx;
}
}
.content-box {
background: #fff;
.photobox{margin-right: 20rpx;
}
}
}
.pdbox{padding: 0 20rpx;}
.pdbox{padding: 0 20rpx;}
</style>
\ No newline at end of file
......
......@@ -2,7 +2,7 @@
<view>
<uni-collapse>
<uni-collapse-item :title="n.personInfo?.name" open v-for="n in list" :key="n.id">
<view class="collapseBody">
<view class="collapseBody">
<!-- n.oldIdcCode -->
<view>
<label>姓名:</label>
......@@ -19,16 +19,16 @@
<view style="display: flex;">
<label>有效期:</label>
<view>
<view v-if="n.personInfo?.valiDateTime">
<view v-if="n.personInfo?.valiDateTime">
<text v-if="n.personInfo?.beginTime">{{n.personInfo?.beginTime?.slice(0,10)}}</text>
<text v-if="n.personInfo?.beginTime"></text>
<text v-if="n.personInfo?.beginTime"></text>
<text>{{n.personInfo?.valiDateTime?.slice(0,10)}}</text>
</view>
<view class="text-danger" v-if="n.oldPersonInfo?.valiDateTime">
<text v-if="n.oldPersonInfo?.beginTime">{{ n.oldPersonInfo?.beginTime?.slice(0,10)}}</text>
<text v-if="n.oldPersonInfo?.beginTime"></text>
<view class="text-danger" v-if="n.oldPersonInfo?.valiDateTime">
<text v-if="n.oldPersonInfo?.beginTime">{{ n.oldPersonInfo?.beginTime?.slice(0,10)}}</text>
<text v-if="n.oldPersonInfo?.beginTime"></text>
<text v-if="n.oldPersonInfo?.valiDateTime">{{n.oldPersonInfo?.valiDateTime?.slice(0,10)}}</text>
</view>
</view>
<view class="text-danger" v-else>--</view>
</view>
</view>
......@@ -102,7 +102,7 @@
<uni-td>{{szToHz(tr.level)}}</uni-td>
<uni-td>{{tr.certCode}}</uni-td>
</uni-tr>
</uni-table>
</uni-table>
</view>
<text v-else class="text-danger">无段位记录</text>
</view>
......@@ -128,10 +128,11 @@
onLoad
} from '@dcloudio/uni-app'
import * as api from '@/common/api.js'
import {
szToHz
} from '@/common/utils.js'
import config from '@/config.js'
import {
parseAttachmentJson,
previewAttachment,
szToHz
} from '@/common/utils.js'
const queryParams = ref({})
const total = ref(0)
const list = ref([])
......@@ -150,10 +151,10 @@
title: '加载中'
})
api.infoMergeList(queryParams.value).then(res => {
list.value = res.rows
list.value.forEach(item => {
item.fileUrl = JSON.parse(item.fileUrl)
})
list.value = res.rows
list.value.forEach(item => {
item.fileUrl = parseAttachmentJson(item.fileUrl)
})
total.value = res.total
uni.hideLoading()
})
......@@ -182,67 +183,10 @@
})
}
function showImg(n) {
var str = config.baseUrl_api + n.fileUrl[0]?.url
if (n.fileUrl[0]?.url.indexOf('png') > -1 || n.fileUrl[0]?.url.indexOf('jpg') > -1 || n.fileUrl[0]?.url.indexOf(
'jpeg') > -1) {
uni.previewImage({
urls: [str],
success: function(res) {
console.log('success', res)
},
fail: function(res) {
console.log('fail', res)
},
complete: function(res) {
console.log('complete', res)
}
})
} else {
goWebView(str)
}
}
function goWebView(url) {
url = url.replace("http://", "https://")
uni.showLoading({
title: '下载中'
});
uni.downloadFile({
url: url,
success: function(res) {
uni.hideLoading();
var filePath = res.tempFilePath;
uni.showLoading({
title: '正在打开'
});
uni.openDocument({
filePath: filePath,
showMenu: true,
success: function(res) {
uni.hideLoading();
},
fail: function(err) {
uni.hideLoading();
uni.showToast({
title: err,
icon: 'none',
duration: 2000
});
}
});
},
fail: function(error) {
uni.hideLoading();
uni.showToast({
title: `下载失败`,
icon: 'none',
duration: 2000
});
}
});
}
</script>
function showImg(n) {
previewAttachment(n.fileUrl, { title: '查看附件' })
}
</script>
<style scoped lang="scss">
.flexbox {
padding: 30rpx 30rpx 0
......@@ -277,4 +221,4 @@
background: #fff;
padding: 30rpx;
}
</style>
\ No newline at end of file
</style>
......
......@@ -82,6 +82,7 @@
<script setup>
import * as api from '@/common/api.js'
import config from '@/config.js'
import { fillImgUrl, previewAttachment } from '@/common/utils.js'
import {
onMounted,
ref
......@@ -193,50 +194,50 @@ function circulation(id) {
api.queryProcess(id).then(res=>{
if (res.data.url) {
uni.hideLoading()
goWebView(config.baseUrl_api + res.data.url)
previewAttachment(res.data.url, { title: '查看附件' })
} else {
circulation(id)
}
})
}
function goWebView(url) {
url = url.replace("http://", "https://")
uni.showLoading({
title: '下载中'
});
uni.downloadFile({
url: url,
success: function(res) {
uni.hideLoading();
var filePath = res.tempFilePath;
uni.showLoading({
title: '正在打开'
});
uni.openDocument({
filePath: filePath,
showMenu: true,
success: function(res) {
uni.hideLoading();
},
fail: function(err) {
uni.hideLoading();
uni.showToast({
title: err,
icon: 'none',
duration: 2000
});
}
});
},
fail: function(error) {
uni.hideLoading();
uni.showToast({
title: `下载失败`,
icon: 'none',
duration: 2000
});
}
});
function goWebView(url) {
url = url.replace("http://", "https://")
uni.showLoading({
title: '下载中'
});
uni.downloadFile({
url: url,
success: function(res) {
uni.hideLoading();
var filePath = res.tempFilePath;
uni.showLoading({
title: '正在打开'
});
uni.openDocument({
filePath: filePath,
showMenu: true,
success: function(res) {
uni.hideLoading();
},
fail: function(err) {
uni.hideLoading();
uni.showToast({
title: err,
icon: 'none',
duration: 2000
});
}
});
},
fail: function(error) {
uni.hideLoading();
uni.showToast({
title: `下载失败`,
icon: 'none',
duration: 2000
});
}
});
}
function handleBack(row){
......@@ -269,11 +270,7 @@ function viewSettleFile(item){
}
function showImg(n) {
var str = ''
if(n.indexOf('http')==-1){
str = config.baseUrl_api + n
} else {
str = n
}
str = fillImgUrl(n)
if (n.indexOf('png') > -1 || n.indexOf('jpg') > -1 || n.indexOf(
'jpeg') > -1) {
......
......@@ -25,7 +25,7 @@
<view class="stepItem" v-for="(n,index) in feelList" :key="index">
<view class="time">{{n.auditTime||'待审批'}}</view>
<view class="content">
<view class="status">
<view class="status">
<text v-if="n.auditResult==0" class="text-primary"> 审核中</text>
<text v-if="n.auditResult==1" class="text-success">审核通过</text>
<text v-if="n.auditResult==2" class="text-danger"> 审核拒绝</text>
......@@ -45,6 +45,7 @@
<script setup>
import * as api from '@/common/api.js'
import config from '@/config.js'
import { fillImgUrl } from '@/common/utils.js'
import {
onMounted,
ref
......@@ -74,9 +75,7 @@
api.addSelectPageList(queryParams.value).then(res => {
list.value = res.pageData.rows
for (var l of list.value) {
if (l.photo && l.photo.indexOf('http') == -1) {
l.photo = config.baseUrl_api + l.photo
}
l.photo = fillImgUrl(l.photo)
}
})
}
......
......@@ -110,8 +110,8 @@
item.recordId = r.recordId
infoList.value.push(item)
})
form.value.totalNum = Math.floor(_.sumBy(infoList.value, (o) => parseFloat(o.totalNum || 0)))
form.value.totalAmount = Math.floor(_.sumBy(infoList.value, (o) => parseFloat(o.totalAmount || 0)))
form.value.totalNum = Math.floor(infoList.value.reduce((sum, o) => sum + parseFloat(o.totalNum || 0), 0))
form.value.totalAmount = Math.floor(infoList.value.reduce((sum, o) => sum + parseFloat(o.totalAmount || 0), 0))
uni.hideLoading()
......
......@@ -9,16 +9,16 @@
<view class="tt">会员列表<text class="text-danger">(列表只显示不在缴费中的个人会员)</text></view>
<!-- <uni-indexed-list :options="list" :showSelect="true" @click="bindClick"></uni-indexed-list> -->
<view class="userlist">
<view class="item" v-for="(n,index) in list" :key="index">
<view @click="checkThis(n)">
<image class="icon" v-if="n.checked" :src="config.baseUrl_api+'/fs/static/member/dx_dwn.png'" />
<image class="icon" v-else :src="config.baseUrl_api+'/fs/static/member/dx.png'" />
<view class="item" v-for="(n,index) in list" :key="index">
<view @click="checkThis(n)">
<image class="icon" v-if="n.checked" :src="config.baseUrl_api+'/fs/static/member/dx_dwn.png'" />
<image class="icon" v-else :src="config.baseUrl_api+'/fs/static/member/dx.png'" />
</view>
<view class="photobox">
<image class="photo" v-if="n.photo" :src="n.photo" mode='aspectFill'></image>
<view class="colorful" v-else>{{n.name.slice(0,1)}}</view>
</view>
<view @click="handleInfo(n)">
<view @click="handleInfo(n)">
<view class="name">{{n.name}}</view>
<view class="date" v-if="n.validityDate">到期时间:{{n.validityDate?.slice(0,10)}}</view>
<view class="date" v-else>注册时间:{{n.createTime?.slice(0,10)}}</view>
......@@ -40,10 +40,10 @@
过期
</text>
</view>
</view>
<view class="nodata" v-if="list.length==0">
<image mode="aspectFit" src="/static/nodata.png"></image>
<text>暂无数据</text>
</view>
<view class="nodata" v-if="list.length==0">
<image mode="aspectFit" src="/static/nodata.png"></image>
<text>暂无数据</text>
</view>
</view>
......@@ -58,8 +58,9 @@
</template>
<script setup>
import * as api from '@/common/api.js'
import * as api from '@/common/api.js'
import config from '@/config.js'
import { fillImgUrl } from '@/common/utils.js'
import {
ref,
getCurrentInstance
......@@ -72,26 +73,24 @@
} = getCurrentInstance()
const app = getApp();
const queryParams = ref({
showMyPersonFlag: 1,
checkPaymentCommit: 1,
showMyPersonFlag: 1,
checkPaymentCommit: 1,
fromChoose: 1
})
const list = ref([])
const total = ref(0)
const userType = ref('')
onLoad((option) => {
userType.value = app.globalData.userType
userType.value = app.globalData.userType
queryParams.value.paymentRangeId = option.rangeId
getList()
})
function getList() {
api.selectPageList(queryParams.value).then(res => {
list.value = res.rows
for(var l of list.value){
if(l.photo&&l.photo.indexOf('http')==-1){
l.photo = config.baseUrl_api + l.photo
}
list.value = res.rows
for(var l of list.value){
l.photo = fillImgUrl(l.photo)
}
total.value = res.total
})
......@@ -106,33 +105,33 @@
function goAddRenew() {
uni.navigateBack()
}
function checkThis(n){
if(n.checked){
n.checked = false
}else{
n.checked = true
}
}
function handleImport(){
var arr=[]
for(var n of list.value){
if(n.checked){
arr.push(n.perId)
}
}
if(arr.length==0){
uni.showToast({
title:"请选择会员",
icon:"none"
})
return
}
api.addPersonPaymentGroup({ rangeId: queryParams.value.paymentRangeId, personIdArray: arr.join(',') }).then(res=>{
let path = `/personalVip/renew?rangeId=${res.data.rangeId}`
uni.redirectTo({
url: path
});
})
function checkThis(n){
if(n.checked){
n.checked = false
}else{
n.checked = true
}
}
function handleImport(){
var arr=[]
for(var n of list.value){
if(n.checked){
arr.push(n.perId)
}
}
if(arr.length==0){
uni.showToast({
title:"请选择会员",
icon:"none"
})
return
}
api.addPersonPaymentGroup({ rangeId: queryParams.value.paymentRangeId, personIdArray: arr.join(',') }).then(res=>{
let path = `/personalVip/renew?rangeId=${res.data.rangeId}`
uni.redirectTo({
url: path
});
})
}
</script>
......@@ -145,7 +144,7 @@
.tt {
font-size: 30rpx;
margin: 0 0 30rpx;
color: #4C5359;
color: #4C5359;
text{font-size: 26rpx;margin-left: 10px;}
}
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!