1、增加‘‘设置——家长二维码’’功能

2、修复图片上传组件在app端删除图片问题
unocss
chris 6 months ago
parent 2d417b1472
commit 7db8a995b2

@ -1,9 +1,9 @@
<template>
<view class="ch-image-uploader">
<ch-flex class="img-list" justify="center" items="center" @click.native="handleSelect">
<block v-for="item in imageList" key="item.name">
<block v-for="item in imageList" key="item.path">
<view class="img-item" data-type="img">
<uni-icons type="clear" class="del-btn" size="50" v-if="showClose" data-type="delete" @click="delImg(item.name)"></uni-icons>
<uni-icons type="clear" class="del-btn" size="50" v-if="showClose" data-type="delete" @click="delImg(item.path)"></uni-icons>
<image :src="item.path" mode="aspectFit"></image>
</view>
</block>
@ -78,6 +78,7 @@ function handleSelect (e) {
extension: props.extList,
sourceType: props.sourceType,
success: (res) => {
console.log(res)
if (props.limit > 1) {
const newImageList = filterImage(res.tempFiles)
imageList.value = [...imageList.value, ...newImageList]
@ -122,8 +123,9 @@ function upload () {
})
}
function delImg (delName) {
imageList.value = imageList.value.filter(item => item.name !== delName)
function delImg (path) {
imageList.value = imageList.value.filter(item => item.path !== path)
emit('update:modelValue', imageList.value)
}
// image
@ -141,7 +143,7 @@ function formatImageFiles (fileList) {
//
function filterImage (images) {
return images.filter(item => {
const result = imageList.value.find(img => img.name === item.name );
const result = imageList.value.find(img => img.path === item.path );
return !result;
})
}

@ -8,7 +8,12 @@
<text v-else>{{ appInfo.appWgtVersion }}</text>
</template>
</uni-list-item>
<uni-list-item title="家长二维码" show-arrow="true" clickable @click="checkQrcode">
</uni-list-item>
</uni-list>
<uni-popup ref="qrcodePopupRef" type="dialog">
<image :src="userInfo.qrcode" mode="aspectFit"></image>
</uni-popup>
</view>
</template>
@ -16,16 +21,19 @@
import checkUpdate from '@/uni_modules/uni-upgrade-center-app/utils/check-update';
import { reactive, ref, toRefs } from 'vue';
import { useSystemStore } from '@/store/system.js';
import { useUserStore } from '@/store/user.js';
const sysStore = useSystemStore();
console.log(sysStore)
const userStore = useUserStore();
const qrcodePopupRef = ref(null)
const data = reactive({
hadUpdate: false,
appInfo: sysStore.appInfo
appInfo: sysStore.appInfo,
userInfo: userStore.userInfo
})
const { hadUpdate, appInfo } = toRefs(data);
const { hadUpdate, appInfo, userInfo } = toRefs(data);
//
function checkAppUpdate () {
@ -35,13 +43,17 @@ function checkAppUpdate () {
})
checkUpdate().then(res => {
console.log('检查更新结果:', res)
}).catch(error => {
}).catch(error => {
console.log("检查更新错误:", error)
}).finally(() => {
uni.hideLoading()
})
// #endif
}
function checkQrcode () {
qrcodePopupRef.value.open('center')
}
</script>
<style lang="scss">

Loading…
Cancel
Save