diff --git a/Learun.Framework.Ultimate V7/LearunApp-2.2.0/components/learun-mpui/learun-ui-mp/upload.vue b/Learun.Framework.Ultimate V7/LearunApp-2.2.0/components/learun-mpui/learun-ui-mp/upload.vue index e23766717..590a06395 100644 --- a/Learun.Framework.Ultimate V7/LearunApp-2.2.0/components/learun-mpui/learun-ui-mp/upload.vue +++ b/Learun.Framework.Ultimate V7/LearunApp-2.2.0/components/learun-mpui/learun-ui-mp/upload.vue @@ -2,7 +2,7 @@ - + @@ -40,44 +40,76 @@ export default { readonly: {}, value: { default: () => [] }, }, + + data(){ + return{ + imgList:[], + } + }, methods: { delImg(index) { - const newList = JSON.parse(JSON.stringify(this.value)); + const newList = JSON.parse(JSON.stringify(this.imgList)); newList.splice(index, 1); + this.imgList = newList + + this.$emit("update:value", newList); this.$emit("input", newList); this.$emit("change"); this.$emit("del"); }, showfile() { - console.log(this.value); return true; }, chooseImg() { uni.chooseImage({ - count: Number(this.number), + count: (Number(this.number) - this.imgList.length), sizeType: ["original", "compressed"], sourceType: ["album", "camera"], - success: ({ tempFilePaths }) => { - const newList = JSON.parse(JSON.stringify(this.value || [])).concat( + success: (res) => { + let {tempFilePaths,tempFiles} = res + if(!this.validate(tempFiles))return + const newList = JSON.parse(JSON.stringify(this.imgList || [])).concat( tempFilePaths ); - //this.$parent.HTTP_UPLOAD(tempFilePaths[0]); - + this.imgList = newList + + this.$emit("update:value", newList); this.$emit("input", newList); this.$emit("change"); this.$emit("add"); }, }); }, + + validate(array){ + let type = array.every(item=>{ + return item.type && item.type.substring(0,6) == "image/" + }) + if(!type){ + this.TOAST('文件类型错误'); + return false + } + let size = array.every(item=>{ + return item.size && item.size <= 2 * 1024 * 1024 + }) + if(!size){ + this.TOAST('文件大小不得超过2M'); + return false + } + return true + }, viewImg(index) { uni.previewImage({ - urls: this.value, - current: this.value[index], + urls: this.imgList, + current: this.imgList[index], }); }, }, + created() { + this.imgList = JSON.parse(JSON.stringify(this.value)) + } }; diff --git a/Learun.Framework.Ultimate V7/LearunApp-2.2.0/config.js b/Learun.Framework.Ultimate V7/LearunApp-2.2.0/config.js index 7163f921a..007172edc 100644 --- a/Learun.Framework.Ultimate V7/LearunApp-2.2.0/config.js +++ b/Learun.Framework.Ultimate V7/LearunApp-2.2.0/config.js @@ -22,11 +22,11 @@ export default { // ], "apiHost": [ // "http://localhost:31173/" - "http://192.168.10.58:8012/" + "http://192.168.10.58:31173/" ], // 开发环境下自动填充登录账号密码,与接口地址一一对应,只在开发环境下显示 "devAccount": [ - { username: "system", password: "www.qj.com" } + { username: "21364200000400266", password: "www.qj.com" } ], //是否分布式部署 指WebApi与Web不在一台服务器 "isDistributed":true, diff --git a/Learun.Framework.Ultimate V7/LearunApp-2.2.0/manifest.json b/Learun.Framework.Ultimate V7/LearunApp-2.2.0/manifest.json index 29bada559..bff0c2bc1 100644 --- a/Learun.Framework.Ultimate V7/LearunApp-2.2.0/manifest.json +++ b/Learun.Framework.Ultimate V7/LearunApp-2.2.0/manifest.json @@ -1,6 +1,6 @@ { "name" : "智慧校园", - "appid" : "__UNI__611EB80", + "appid" : "__UNI__0CE0195", "description" : "智慧校园移动端", "versionName" : "2.1.0", "versionCode" : 20100, diff --git a/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/welcome/list.vue b/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/welcome/list.vue index ee82d7bed..d65988c88 100644 --- a/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/welcome/list.vue +++ b/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/welcome/list.vue @@ -16,18 +16,11 @@ - - 采集照片信息 - - - - - - - - - + 自然信息 @@ -79,6 +72,7 @@ import set from 'lodash/set'; export default { data() { return { + photo:[], imgSrc: '', scheme: { PartyFaceNo: { @@ -120,9 +114,7 @@ export default { StuInfoFreshFamilyEntities:[], StuInfoFreshEmergePeopleEntities: [] }, - StuInfoFreshEntity:{ - - } + StuInfoFreshEntity:{} }; }, methods: { @@ -137,14 +129,13 @@ export default { value: t.partyfaceno })); }), - () => {} ]); _this.LOADING('加载数据…'); _this.HTTP_GET('StuInfoFresh/stuInfoFreshEntity', _this.userInfo.account, '加载数据时出错').then(res => { this.HIDE_LOADING(); - // console.log(res); - _this.StuInfoFreshEntity = _this.COPY(res.StuInfoFreshEntity); + console.log(res,"==="); + _this.StuInfoFreshEntity = _this.COPY(res.StuInfoFreshEntity)||{}; _this.queryData.StuInfoFreshFamilyEntities = _this.COPY(res.StuInfoFreshFamilyList); _this.queryData.StuInfoFreshEmergePeopleEntities = _this.COPY(res.StuInfoFreshEmergePeopleList); _this.queryData.ID = res.StuInfoFreshEntity.ID;