From fa651cdfda83fa5ccf98819059ea4b00f4c6af8a Mon Sep 17 00:00:00 2001
From: "SD-20230427NBFT\\Administrator" <609306725@qq.com>
Date: Wed, 31 Jul 2024 14:00:19 +0800
Subject: [PATCH 1/4] 111
---
pages.json | 9 ++
pagesA/merge/face_1.vue | 2 +-
pagesA/merge/idcard.vue | 162 +++++++++++++++++++++++
pagesA/merge/this.scss | 71 ++++++++++
pagesA/photo/components/photo_header.vue | 8 +-
static/img/common/idcard_1.png | Bin 0 -> 1588 bytes
6 files changed, 249 insertions(+), 3 deletions(-)
create mode 100644 pagesA/merge/idcard.vue
create mode 100644 static/img/common/idcard_1.png
diff --git a/pages.json b/pages.json
index d19f261..d2e9b1e 100644
--- a/pages.json
+++ b/pages.json
@@ -139,8 +139,17 @@
"navigationBarTitleText" : "上传图片",
"navigationStyle": "custom"
}
+ },
+ {
+ "path" : "merge/idcard",
+ "style" :
+ {
+ "navigationBarTitleText" : "二寸证件照",
+ "navigationStyle": "custom"
+ }
}
+
]
}],
"globalStyle": {
diff --git a/pagesA/merge/face_1.vue b/pagesA/merge/face_1.vue
index a304408..5278ae8 100644
--- a/pagesA/merge/face_1.vue
+++ b/pagesA/merge/face_1.vue
@@ -47,7 +47,7 @@
- 提交制作 0/30
+ 提交制作
以下照片不合格,请重新上传
diff --git a/pagesA/merge/idcard.vue b/pagesA/merge/idcard.vue
new file mode 100644
index 0000000..b41287a
--- /dev/null
+++ b/pagesA/merge/idcard.vue
@@ -0,0 +1,162 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pagesA/merge/this.scss b/pagesA/merge/this.scss
index 75cc17b..e57b2b5 100644
--- a/pagesA/merge/this.scss
+++ b/pagesA/merge/this.scss
@@ -230,4 +230,75 @@ image{
+}
+
+
+// ----------------idcard
+.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;
+ }
+ }
+ }
+ }
+ }
}
\ 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/static/img/common/idcard_1.png b/static/img/common/idcard_1.png
new file mode 100644
index 0000000000000000000000000000000000000000..aa0d4d49ea3232a90af9a979b61d4875865ac000
GIT binary patch
literal 1588
zcmV-42Fv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1.vue | 7 +++++--
3 files changed, 26 insertions(+), 12 deletions(-)
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/pagesA/merge/face_1.vue b/pagesA/merge/face_1.vue
index 5278ae8..ac876d3 100644
--- a/pagesA/merge/face_1.vue
+++ b/pagesA/merge/face_1.vue
@@ -127,7 +127,7 @@
var _this = this;
_this.checkAuth();
this.setSuccessFiles();
- console.log('~~~~~~~~~~~~~~~~~~')
+
},
methods: {
@@ -245,7 +245,10 @@
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
From f205ae98e265b07bd12f47e8f562247f2fc7dc25 Mon Sep 17 00:00:00 2001
From: "SD-20230427NBFT\\Administrator" <609306725@qq.com>
Date: Wed, 31 Jul 2024 15:54:52 +0800
Subject: [PATCH 3/4] no message
---
pagesA/merge/face_1.vue | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/pagesA/merge/face_1.vue b/pagesA/merge/face_1.vue
index ac876d3..04d9761 100644
--- a/pagesA/merge/face_1.vue
+++ b/pagesA/merge/face_1.vue
@@ -242,6 +242,11 @@
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);
From 91b8b511ff60837f58f2ca9b79905854b3453dc8 Mon Sep 17 00:00:00 2001
From: "SD-20230427NBFT\\Administrator" <609306725@qq.com>
Date: Wed, 31 Jul 2024 16:26:14 +0800
Subject: [PATCH 4/4] 111
---
pages.json | 8 ++
pagesA/merge/idcard.vue | 177 +++++++++++++++++++++++----------------
pagesA/merge/success.vue | 71 ++++++++++++++++
pagesA/merge/this.scss | 23 +++++
pagesA/photo/face.vue | 9 +-
5 files changed, 215 insertions(+), 73 deletions(-)
create mode 100644 pagesA/merge/success.vue
diff --git a/pages.json b/pages.json
index d2e9b1e..d25e3a2 100644
--- a/pages.json
+++ b/pages.json
@@ -147,6 +147,14 @@
"navigationBarTitleText" : "二寸证件照",
"navigationStyle": "custom"
}
+ },
+ {
+ "path" : "merge/success",
+ "style" :
+ {
+ "navigationBarTitleText" : "",
+ "navigationStyle": "custom"
+ }
}
diff --git a/pagesA/merge/idcard.vue b/pagesA/merge/idcard.vue
index b41287a..222d3eb 100644
--- a/pagesA/merge/idcard.vue
+++ b/pagesA/merge/idcard.vue
@@ -3,13 +3,17 @@
-
-
+
+
+
+
+
-
-
+
-
-
+
+
-
+
+
-
+
-
-
+
+
+
+
+
+ 保存
+
+ 剩余生成次数
+ 0 / 30 张
@@ -45,7 +56,35 @@
+
+
+
+ 请选择保存格式
+
+
+
+ PNG格式
+
+
+
+
+ JPG格式
+
+
+
+
+
+
+ 取消
+
+
+ 确认
+
+
+
+
+
@@ -62,66 +101,22 @@
navbar_title: '二寸证件照',
theme: "white1",
margin_top: 10,
- selectedImg:'',
- selectedIndex:0,
+ selectedImg: '',
+ selectedIndex: 0,
+ this_tab: 0,
+ root_path: '',
+ show_2: false,
+
list1: [{
- id: 1,
+ id: 2,
name: '女装'
},
{
- id: 2,
+ id: 1,
name: '男装'
},
],
- tem_list: [{
- id: 1,
- url: '/static/img/index/banner.png'
- },
- {
- id: 2,
- url: 'https://img14.360buyimg.com/jdcms/s460x460_jfs/t1/234494/2/24198/178409/66a8aad1F59feafc5/41e6871120f47687.jpg'
- },
- {
- id: 3,
- url: '/static/img/index/banner.png'
- },
- {
- id: 4,
- url: 'https://img14.360buyimg.com/jdcms/s460x460_jfs/t1/234494/2/24198/178409/66a8aad1F59feafc5/41e6871120f47687.jpg'
- },
- {
- id: 5,
- url: '/static/img/index/banner.png'
- },
- {
- id: 6,
- url: 'https://img14.360buyimg.com/jdcms/s460x460_jfs/t1/234494/2/24198/178409/66a8aad1F59feafc5/41e6871120f47687.jpg'
- },
- {
- id: 7,
- url: '/static/img/index/banner.png'
- },
- {
- id: 8,
- url: 'https://img14.360buyimg.com/jdcms/s460x460_jfs/t1/234494/2/24198/178409/66a8aad1F59feafc5/41e6871120f47687.jpg'
- },
- {
- id: 9,
- url: '/static/img/index/banner.png'
- },
- {
- id: 10,
- url: 'https://img14.360buyimg.com/jdcms/s460x460_jfs/t1/234494/2/24198/178409/66a8aad1F59feafc5/41e6871120f47687.jpg'
- },
- {
- id: 11,
- url: '/static/img/index/banner.png'
- },
- {
- id: 12,
- url: 'https://img14.360buyimg.com/jdcms/s460x460_jfs/t1/234494/2/24198/178409/66a8aad1F59feafc5/41e6871120f47687.jpg'
- },
- ]
+ tem_list: []
}
},
@@ -130,10 +125,13 @@
},
onLoad() {
+ this.changeTab();
+ this.root_path = this.$api.getOssurl();
+
},
onShow() {
-
+
},
@@ -142,14 +140,49 @@
getNavHeight(e) {
this.margin_top += e;
},
- selectThis(index){
- this.selectedImg = this.tem_list[index].url;
+ selectThis(index) {
+ this.selectedImg = this.$api.getOssurl() + this.tem_list[index].image;
+
this.selectedIndex = index;
- }
+ },
+ changeTab(e) {
+
+ if (typeof(e) != 'undefined' && e.index) {
+ this.this_tab = e.index;
+ } else {
+ this.this_tab = 0;
+ }
+
+ let data = {};
+ data.template_type = this.list1[this.this_tab].id;
+ let _this = this;
+ this.$api.get('/api/specs/template_list', data, function(res) {
+ if (res.length > 0) {
+ _this.tem_list = res;
+ _this.selectThis(0)
+ } else {
+ _this.tem_list = [];
+ }
+ });
+
+ },
+
+ saveBtn() {
+ this.show_2 = true;
+ },
+ goUrl(url){
+ this.show_2 = false;
+ uni.navigateTo({
+ url:url
+ })
+ }
+
+
+ },
- }
+
}
@@ -157,6 +190,6 @@
@import './this.scss';
.photo_back {
- background-color: #F5F6FB;
+ background-color: #fff;
}
\ 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 e57b2b5..57ea413 100644
--- a/pagesA/merge/this.scss
+++ b/pagesA/merge/this.scss
@@ -234,6 +234,12 @@ image{
// ----------------idcard
+
+.idcard_1_over{
+ overflow: hidden;
+ width: 100%;
+ background-color: #F5F6FB;
+}
.idcard_1{
width: 516rpx;
height: 720rpx;
@@ -301,4 +307,21 @@ image{
}
}
}
+
+ .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/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