|
@@ -484,23 +484,20 @@
|
|
|
<!--用于图片压缩的canvas画布,不在页面中展示,且id固定不可变 position: absolute; z-index: -1; left: -10000rpx;; top: -10000rpx;-->
|
|
|
<!-- style="width: {{cw}}px; height: {{cw}}px;" -->
|
|
|
<view class="photo_can">
|
|
|
- <canvas
|
|
|
- class="zip_canvas"
|
|
|
- canvas-id="zipCanvas"
|
|
|
- ></canvas>
|
|
|
+ <canvas class="zip_canvas" canvas-id="zipCanvas"></canvas>
|
|
|
</view>
|
|
|
-
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import * as baseUrls from "@/common/request.js";
|
|
|
+import config from "../../common/config";
|
|
|
import { mapGetters, mapActions } from "vuex";
|
|
|
import Handwriting from "@/common/signature.js";
|
|
|
-import getLessLimitSizeImage from '@/common/compressPhoto.js'
|
|
|
+import getLessLimitSizeImage from "@/common/compressPhoto.js";
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
|
+ baseUrls: config.BASE_IMG_URL,
|
|
|
cw: wx.getSystemInfoSync().windowWidth, //画板边长默认是屏幕宽度,正方形画布
|
|
|
list: [
|
|
|
{
|
|
@@ -737,7 +734,7 @@ export default {
|
|
|
this.orderGoodsId = Number(option.orderGoodsId);
|
|
|
this.goodsId = Number(option.id);
|
|
|
this.gradeId = Number(option.gradeId);
|
|
|
-
|
|
|
+
|
|
|
await this.getInfo();
|
|
|
await this.getGoodsDetail();
|
|
|
},
|
|
@@ -758,7 +755,7 @@ export default {
|
|
|
this.listData.forEach((item) => {
|
|
|
if (item.fieldKey == "idcard") {
|
|
|
this.form.idcard = this.userInfo.idCard;
|
|
|
- console.log('监听监听111')
|
|
|
+ console.log("监听监听111");
|
|
|
}
|
|
|
if (item.fieldKey == "telphone") {
|
|
|
this.form.telphone = this.userInfo.telphone;
|
|
@@ -766,7 +763,7 @@ export default {
|
|
|
|
|
|
if (item.fieldKey == "name") {
|
|
|
this.form.name = this.userInfo.realname;
|
|
|
- console.log('监听监听')
|
|
|
+ console.log("监听监听");
|
|
|
}
|
|
|
});
|
|
|
}
|
|
@@ -775,7 +772,7 @@ export default {
|
|
|
methods: {
|
|
|
...mapActions(["getUserInfo"]),
|
|
|
inputName(event) {
|
|
|
- console.log('enevt', event, this.form.name)
|
|
|
+ console.log("enevt", event, this.form.name);
|
|
|
},
|
|
|
clickIndex(inds) {
|
|
|
if (inds === 0) {
|
|
@@ -810,7 +807,6 @@ export default {
|
|
|
);
|
|
|
}
|
|
|
|
|
|
-
|
|
|
if (this.remarkStatus) {
|
|
|
var arsty = {};
|
|
|
for (let k in data) {
|
|
@@ -929,30 +925,36 @@ export default {
|
|
|
if (res.tempFiles[0].size > 2097152) {
|
|
|
// this.$method.showToast("上传图片不得大于2M");
|
|
|
// 需要压缩
|
|
|
- let canvasId = 'zipCanvas'
|
|
|
- let imagePath = res.tempFiles[0].path //原图的路径
|
|
|
- let limitSize = 2048 //大小限制2048kb
|
|
|
- let drawWidth = wx.getSystemInfoSync().windowWidth //初始绘画区域是画布自身的宽度也就是屏幕宽度
|
|
|
- getLessLimitSizeImage(canvasId, imagePath, limitSize, drawWidth, async (resPath)=>{
|
|
|
- //resPath就是压缩后图片的路径
|
|
|
- this.uploadImgsChild(resPath)
|
|
|
- })
|
|
|
+ let canvasId = "zipCanvas";
|
|
|
+ let imagePath = res.tempFiles[0].path; //原图的路径
|
|
|
+ let limitSize = 2048; //大小限制2048kb
|
|
|
+ let drawWidth = wx.getSystemInfoSync().windowWidth; //初始绘画区域是画布自身的宽度也就是屏幕宽度
|
|
|
+ getLessLimitSizeImage(
|
|
|
+ canvasId,
|
|
|
+ imagePath,
|
|
|
+ limitSize,
|
|
|
+ drawWidth,
|
|
|
+ async (resPath) => {
|
|
|
+ //resPath就是压缩后图片的路径
|
|
|
+ this.uploadImgsChild(resPath);
|
|
|
+ }
|
|
|
+ );
|
|
|
return;
|
|
|
} else {
|
|
|
- this.uploadImgsChild(res.tempFiles[0].path)
|
|
|
+ this.uploadImgsChild(res.tempFiles[0].path);
|
|
|
}
|
|
|
},
|
|
|
});
|
|
|
},
|
|
|
uploadImgsChild(path) {
|
|
|
- var type = path.split(".").splice(-1)
|
|
|
+ var type = path.split(".").splice(-1);
|
|
|
if (type[0] != "jpg" && type[0] != "png" && type[0] != "jpeg") {
|
|
|
- this.$method.showToast("请上传图片格式")
|
|
|
- return
|
|
|
+ this.$method.showToast("请上传图片格式");
|
|
|
+ return;
|
|
|
}
|
|
|
- this.$set(this.form, "commitment_seal", path)
|
|
|
+ this.$set(this.form, "commitment_seal", path);
|
|
|
this.$nextTick(() => {
|
|
|
- this.resultForm()
|
|
|
+ this.resultForm();
|
|
|
});
|
|
|
},
|
|
|
uploadFieds() {
|
|
@@ -1133,10 +1135,9 @@ export default {
|
|
|
this.$method.showToast("提交成功");
|
|
|
this.getUserInfo();
|
|
|
setTimeout(() => {
|
|
|
- console.log('延迟')
|
|
|
+ console.log("延迟");
|
|
|
uni.navigateBack();
|
|
|
- }, 1500)
|
|
|
-
|
|
|
+ }, 1500);
|
|
|
} else {
|
|
|
this.$method.showToast(res.data.msg);
|
|
|
this.isUploading = false;
|
|
@@ -1180,9 +1181,9 @@ export default {
|
|
|
this.$method.showToast("提交成功");
|
|
|
this.getUserInfo();
|
|
|
setTimeout(() => {
|
|
|
- console.log('延迟')
|
|
|
+ console.log("延迟");
|
|
|
uni.navigateBack();
|
|
|
- }, 1500)
|
|
|
+ }, 1500);
|
|
|
} else {
|
|
|
this.$method.showToast(res.data.msg);
|
|
|
this.isUploading = false;
|
|
@@ -1276,9 +1277,9 @@ export default {
|
|
|
this.$method.showToast("提交成功");
|
|
|
this.getUserInfo();
|
|
|
setTimeout(() => {
|
|
|
- console.log('延迟')
|
|
|
+ console.log("延迟");
|
|
|
uni.navigateBack();
|
|
|
- }, 1500)
|
|
|
+ }, 1500);
|
|
|
} else {
|
|
|
this.$method.showToast(res.data.msg);
|
|
|
this.isUploading = false;
|
|
@@ -1318,9 +1319,9 @@ export default {
|
|
|
this.$method.showToast("提交成功");
|
|
|
this.getUserInfo();
|
|
|
setTimeout(() => {
|
|
|
- console.log('延迟')
|
|
|
+ console.log("延迟");
|
|
|
uni.navigateBack();
|
|
|
- }, 1500)
|
|
|
+ }, 1500);
|
|
|
} else {
|
|
|
this.$method.showToast(res.data.msg);
|
|
|
this.isUploading = false;
|
|
@@ -1459,17 +1460,31 @@ export default {
|
|
|
) {
|
|
|
if (lists[0].file.size < 2 * 1024 * 1024) {
|
|
|
// 以前的
|
|
|
- this.$set(this.form, "recent_photos", await this.$method.imageInfos(lists[0].url))
|
|
|
+ this.$set(
|
|
|
+ this.form,
|
|
|
+ "recent_photos",
|
|
|
+ await this.$method.imageInfos(lists[0].url)
|
|
|
+ );
|
|
|
} else {
|
|
|
// 需要压缩
|
|
|
- let canvasId = 'zipCanvas'
|
|
|
+ let canvasId = "zipCanvas";
|
|
|
let imagePath = lists[0].url; //原图的路径
|
|
|
let limitSize = 2048; //大小限制2048kb
|
|
|
- let drawWidth = wx.getSystemInfoSync().windowWidth //初始绘画区域是画布自身的宽度也就是屏幕宽度
|
|
|
- getLessLimitSizeImage(canvasId, imagePath, limitSize, drawWidth, async (resPath)=>{
|
|
|
- //resPath就是压缩后图片的路径
|
|
|
- this.$set(this.form, "recent_photos", await this.$method.imageInfos(resPath))
|
|
|
- })
|
|
|
+ let drawWidth = wx.getSystemInfoSync().windowWidth; //初始绘画区域是画布自身的宽度也就是屏幕宽度
|
|
|
+ getLessLimitSizeImage(
|
|
|
+ canvasId,
|
|
|
+ imagePath,
|
|
|
+ limitSize,
|
|
|
+ drawWidth,
|
|
|
+ async (resPath) => {
|
|
|
+ //resPath就是压缩后图片的路径
|
|
|
+ this.$set(
|
|
|
+ this.form,
|
|
|
+ "recent_photos",
|
|
|
+ await this.$method.imageInfos(resPath)
|
|
|
+ );
|
|
|
+ }
|
|
|
+ );
|
|
|
}
|
|
|
}
|
|
|
} else {
|
|
@@ -1490,23 +1505,29 @@ export default {
|
|
|
lists[0].url.indexOf("//temp") !== -1
|
|
|
) {
|
|
|
let url = lists[0].url;
|
|
|
- let size = lists[0].file.size
|
|
|
+ let size = lists[0].file.size;
|
|
|
this.$refs.idcard_face_photo[0].remove(0);
|
|
|
|
|
|
// console.log('url', url, size)
|
|
|
- let titleMsg = '请上传正确清晰的身份证人像面照片'
|
|
|
+ let titleMsg = "请上传正确清晰的身份证人像面照片";
|
|
|
if (size < 2 * 1024 * 1024) {
|
|
|
- this.checkIdCard(1, url, titleMsg, 'idcard_face_photo')
|
|
|
+ this.checkIdCard(1, url, titleMsg, "idcard_face_photo");
|
|
|
} else {
|
|
|
// 需要压缩
|
|
|
- let canvasId = 'zipCanvas'
|
|
|
- let imagePath = url //原图的路径
|
|
|
- let limitSize = 2048 //大小限制2048kb
|
|
|
- let drawWidth = wx.getSystemInfoSync().windowWidth //初始绘画区域是画布自身的宽度也就是屏幕宽度
|
|
|
- getLessLimitSizeImage(canvasId, imagePath, limitSize, drawWidth, async (resPath)=>{
|
|
|
- //resPath就是压缩后图片的路径
|
|
|
- this.checkIdCard(1, resPath, titleMsg, 'idcard_face_photo')
|
|
|
- })
|
|
|
+ let canvasId = "zipCanvas";
|
|
|
+ let imagePath = url; //原图的路径
|
|
|
+ let limitSize = 2048; //大小限制2048kb
|
|
|
+ let drawWidth = wx.getSystemInfoSync().windowWidth; //初始绘画区域是画布自身的宽度也就是屏幕宽度
|
|
|
+ getLessLimitSizeImage(
|
|
|
+ canvasId,
|
|
|
+ imagePath,
|
|
|
+ limitSize,
|
|
|
+ drawWidth,
|
|
|
+ async (resPath) => {
|
|
|
+ //resPath就是压缩后图片的路径
|
|
|
+ this.checkIdCard(1, resPath, titleMsg, "idcard_face_photo");
|
|
|
+ }
|
|
|
+ );
|
|
|
}
|
|
|
|
|
|
// uni.compressImage({
|
|
@@ -1559,22 +1580,28 @@ export default {
|
|
|
) {
|
|
|
console.log("//tem");
|
|
|
let url = lists[0].url;
|
|
|
- let size = lists[0].file.size
|
|
|
+ let size = lists[0].file.size;
|
|
|
this.$refs.idcard_national_photo[0].remove(0);
|
|
|
|
|
|
- let titleMsg = '请上传正确清晰的身份证国徽面照片'
|
|
|
+ let titleMsg = "请上传正确清晰的身份证国徽面照片";
|
|
|
if (size < 2 * 1024 * 1024) {
|
|
|
- this.checkIdCard(2, url, titleMsg, 'idcard_national_photo')
|
|
|
+ this.checkIdCard(2, url, titleMsg, "idcard_national_photo");
|
|
|
} else {
|
|
|
// 需要压缩
|
|
|
- let canvasId = 'zipCanvas'
|
|
|
- let imagePath = url //原图的路径
|
|
|
- let limitSize = 2048 //大小限制2048kb
|
|
|
- let drawWidth = wx.getSystemInfoSync().windowWidth //初始绘画区域是画布自身的宽度也就是屏幕宽度
|
|
|
- getLessLimitSizeImage(canvasId, imagePath, limitSize, drawWidth, async (resPath)=>{
|
|
|
- //resPath就是压缩后图片的路径
|
|
|
- this.checkIdCard(2, resPath, titleMsg, 'idcard_national_photo')
|
|
|
- })
|
|
|
+ let canvasId = "zipCanvas";
|
|
|
+ let imagePath = url; //原图的路径
|
|
|
+ let limitSize = 2048; //大小限制2048kb
|
|
|
+ let drawWidth = wx.getSystemInfoSync().windowWidth; //初始绘画区域是画布自身的宽度也就是屏幕宽度
|
|
|
+ getLessLimitSizeImage(
|
|
|
+ canvasId,
|
|
|
+ imagePath,
|
|
|
+ limitSize,
|
|
|
+ drawWidth,
|
|
|
+ async (resPath) => {
|
|
|
+ //resPath就是压缩后图片的路径
|
|
|
+ this.checkIdCard(2, resPath, titleMsg, "idcard_national_photo");
|
|
|
+ }
|
|
|
+ );
|
|
|
}
|
|
|
}
|
|
|
} else {
|
|
@@ -1661,7 +1688,7 @@ export default {
|
|
|
if (item.fieldKey == "idcard") {
|
|
|
console.log(this.userInfo.idCard, "this.userInfo.idCard");
|
|
|
this.form.idcard = this.userInfo.idCard;
|
|
|
- this.disCard = this.form.idcard ? true : false
|
|
|
+ this.disCard = this.form.idcard ? true : false;
|
|
|
console.log(this.form.idcard);
|
|
|
}
|
|
|
if (item.fieldKey == "telphone") {
|
|
@@ -1673,8 +1700,8 @@ export default {
|
|
|
if (item.fieldKey == "name") {
|
|
|
console.log(this.userInfo.realname, "this.userInfo.realname");
|
|
|
this.form.name = this.userInfo.realname;
|
|
|
- this.disName = this.form.name ? true : false
|
|
|
- console.log('this.disName', this.form.name, this.disName);
|
|
|
+ this.disName = this.form.name ? true : false;
|
|
|
+ console.log("this.disName", this.form.name, this.disName);
|
|
|
}
|
|
|
});
|
|
|
self.isRequired = self.listData.every((ims) => {
|
|
@@ -1724,7 +1751,7 @@ export default {
|
|
|
self.fileList1 = [
|
|
|
{
|
|
|
url:
|
|
|
- baseUrls.BASE_IMG_URL + ajson[k].value,
|
|
|
+ baseUrls + ajson[k].value,
|
|
|
},
|
|
|
];
|
|
|
}
|
|
@@ -1734,7 +1761,7 @@ export default {
|
|
|
self.fileList2 = [
|
|
|
{
|
|
|
url:
|
|
|
- baseUrls.BASE_IMG_URL + ajson[k].value,
|
|
|
+ baseUrls + ajson[k].value,
|
|
|
},
|
|
|
];
|
|
|
}
|
|
@@ -1744,7 +1771,7 @@ export default {
|
|
|
self.fileList3 = [
|
|
|
{
|
|
|
url:
|
|
|
- baseUrls.BASE_IMG_URL + ajson[k].value,
|
|
|
+ baseUrls + ajson[k].value,
|
|
|
},
|
|
|
];
|
|
|
}
|
|
@@ -1819,21 +1846,21 @@ export default {
|
|
|
self.$set(self.form, k, arrays[k].value);
|
|
|
if (arrays[k].value) {
|
|
|
self.fileList1 = [
|
|
|
- { url: baseUrls.BASE_IMG_URL + arrays[k].value },
|
|
|
+ { url: baseUrls + arrays[k].value },
|
|
|
];
|
|
|
}
|
|
|
} else if (k === "idcard_face_photo") {
|
|
|
self.$set(self.form, k, arrays[k].value);
|
|
|
if (arrays[k].value) {
|
|
|
self.fileList2 = [
|
|
|
- { url: baseUrls.BASE_IMG_URL + arrays[k].value },
|
|
|
+ { url: baseUrls + arrays[k].value },
|
|
|
];
|
|
|
}
|
|
|
} else if (k === "idcard_national_photo") {
|
|
|
self.$set(self.form, k, arrays[k].value);
|
|
|
if (arrays[k].value) {
|
|
|
self.fileList3 = [
|
|
|
- { url: baseUrls.BASE_IMG_URL + arrays[k].value },
|
|
|
+ { url: baseUrls + arrays[k].value },
|
|
|
];
|
|
|
}
|
|
|
} else if (k === "name") {
|
|
@@ -1954,7 +1981,7 @@ page {
|
|
|
width: 100%;
|
|
|
height: 100%;
|
|
|
position: absolute;
|
|
|
- z-index: -1;
|
|
|
+ z-index: -1;
|
|
|
left: -10000rpx;
|
|
|
top: -10000rpx;
|
|
|
}
|