diff --git a/config/api.js b/config/api.js index dc052a9..ca5a1a7 100644 --- a/config/api.js +++ b/config/api.js @@ -281,5 +281,10 @@ var api = { const app_config = uni.getStorageSync('app_config'); return app_config.public_url + url; }, + + getOssurl(){ + const app_config = uni.getStorageSync('app_config'); + return app_config.public_url; + }, } module.exports = api; diff --git a/config/unit.js b/config/unit.js index 329d148..3f4e7cf 100644 --- a/config/unit.js +++ b/config/unit.js @@ -4,17 +4,23 @@ var unit ={ getImgInfo:function(filePath){ function getInfo(resolve, reject) { - uni.getImageInfo({ - src: filePath, - success: function (image) { - resolve(image); - }, - fail: (res) => { - reject(res); - }, - }); + + try { + uni.getImageInfo({ + src: filePath, + success: function (image) { + resolve(image); + }, + fail: (res) => { + reject(res); + }, + }); + return new Promise(getInfo); + } catch (error) { + console.log(error) + } } - return new Promise(getInfo); + }, compressImg:function(filePath, config = {}){ diff --git a/pages.json b/pages.json index d19f261..d25e3a2 100644 --- a/pages.json +++ b/pages.json @@ -139,8 +139,25 @@ "navigationBarTitleText" : "上传图片", "navigationStyle": "custom" } + }, + { + "path" : "merge/idcard", + "style" : + { + "navigationBarTitleText" : "二寸证件照", + "navigationStyle": "custom" + } + }, + { + "path" : "merge/success", + "style" : + { + "navigationBarTitleText" : "", + "navigationStyle": "custom" + } } + ] }], "globalStyle": { diff --git a/pagesA/merge/face_1.vue b/pagesA/merge/face_1.vue index a304408..04d9761 100644 --- a/pagesA/merge/face_1.vue +++ b/pagesA/merge/face_1.vue @@ -47,7 +47,7 @@ - 提交制作 0/30 + 提交制作 以下照片不合格,请重新上传 @@ -127,7 +127,7 @@ var _this = this; _this.checkAuth(); this.setSuccessFiles(); - console.log('~~~~~~~~~~~~~~~~~~') + }, methods: { @@ -242,10 +242,18 @@ let filePath = edetail; let _date = new Date(); let ext_name = filePath.substr(filePath.lastIndexOf('.')); + if (ext_name !== 'png' && ext_name !== 'jpg' && ext_name !== 'jpeg') { + _this.$com.showError('请上传 png / jpg / jpeg 格式的图片'); + return false; + } + let address = _date.getFullYear() + '' + (_date.getMonth() + 1) + '' + _date.getDate(); let fileName = address + _date.getTime() + ext_name; const img_info = await unit.getImgInfo(filePath); - + if(typeof(img_info) == 'undefined' || !img_info){ + this.$com.showError('图片格式错误!请重试!'); + return false; + } let { width, height diff --git a/pagesA/merge/idcard.vue b/pagesA/merge/idcard.vue new file mode 100644 index 0000000..222d3eb --- /dev/null +++ b/pagesA/merge/idcard.vue @@ -0,0 +1,195 @@ + + + + + \ No newline at end of file diff --git a/pagesA/merge/success.vue b/pagesA/merge/success.vue new file mode 100644 index 0000000..f9e3c58 --- /dev/null +++ b/pagesA/merge/success.vue @@ -0,0 +1,71 @@ + + + + + \ No newline at end of file diff --git a/pagesA/merge/this.scss b/pagesA/merge/this.scss index 75cc17b..57ea413 100644 --- a/pagesA/merge/this.scss +++ b/pagesA/merge/this.scss @@ -230,4 +230,98 @@ image{ +} + + +// ----------------idcard + +.idcard_1_over{ + overflow: hidden; + width: 100%; + background-color: #F5F6FB; +} +.idcard_1{ + width: 516rpx; + height: 720rpx; + margin: 100rpx auto; + +} + +.idcard_2{ + width: 100%; + background-color: #fff; + border-top-left-radius: 24rpx; + border-top-right-radius: 24rpx; + + + .idcard_2_1{ + overflow: hidden; + margin: 40rpx auto; + margin-left: 20rpx; + } + + .idcard_2_2{ + width: 725rpx; + height: 120rpx; + margin-left: 24rpx; + + .idcard_2_2_1{ + width: 100%; + height: 100%; + white-space: nowrap; + .idcard_2_2_1_one{ + width: 104rpx; + height: 120rpx; + border-radius: 8rpx; + margin-right: 20rpx; + + display: inline-block; + + .idcard_2_2_1_one_1{ + width: 100%; + height: 100%; + border-radius: 8rpx; + image{ + border-radius: 8rpx; + } + } + + .idcard_2_2_1_one_2{ + + margin-top: -120rpx; + margin-left: 0rpx; + width: 100%; + height: 100%; + background: rgba(0, 0, 0, 0.5); + position: relative; + // opacity: 0.5; + display: flex; + justify-content: center; + align-items: center; + border-radius: 8rpx; + .idcard_2_2_1_one_2_1{ + width: 40rpx; + height: 40rpx; + } + } + } + } + } + + .idcard_2_3{ + width: 702rpx; + height: 80rpx; + margin: 30rpx auto; + } + + .idcard_2_4{ + width: 702rpx; + height:30rpx; + display: flex; + justify-content: center; + align-items: center; + font-size: 24rpx; + color: #555555; + margin-left: 24rpx; + } } \ No newline at end of file diff --git a/pagesA/photo/components/photo_header.vue b/pagesA/photo/components/photo_header.vue index 2a0df17..abdce71 100644 --- a/pagesA/photo/components/photo_header.vue +++ b/pagesA/photo/components/photo_header.vue @@ -45,7 +45,9 @@ export default { case 'white': this.thisBack = '#E3E8FE'; break; - + case 'white1': + this.thisBack = '#fff'; + break; default : this.thisBack = 'transparent'; @@ -65,7 +67,9 @@ export default { case 'white': this.thisBack = '#E3E8FE'; break; - + case 'white1': + this.thisBack = '#fff'; + break; default : this.thisBack = 'transparent'; diff --git a/pagesA/photo/face.vue b/pagesA/photo/face.vue index 6b3aee0..a1e9b15 100644 --- a/pagesA/photo/face.vue +++ b/pagesA/photo/face.vue @@ -240,10 +240,17 @@ let filePath = edetail; let _date = new Date(); let ext_name = filePath.substr(filePath.lastIndexOf('.')); + if (ext_name !== 'png' && ext_name !== 'jpg' && ext_name !== 'jpeg') { + _this.$com.showError('请上传 png / jpg / jpeg 格式的图片'); + return false; + } let address = _date.getFullYear() + '' + (_date.getMonth() + 1) + '' + _date.getDate(); let fileName = address + _date.getTime() + ext_name; const img_info = await unit.getImgInfo(filePath); - + if(typeof(img_info) == 'undefined' || !img_info){ + this.$com.showError('图片格式错误!请重试!'); + return false; + } let { width, height diff --git a/static/img/common/idcard_1.png b/static/img/common/idcard_1.png new file mode 100644 index 0000000..aa0d4d4 Binary files /dev/null and b/static/img/common/idcard_1.png differ