-
+
@@ -315,6 +315,7 @@
this.param.l = urlPath[2] || 1;
this.resultPage = !isEmpty(urlPath[3]);
}
+ console.log(this.param);
if (!(this.param.v && this.param.g)) {
this.error = true;
this.errorMsg = 'Invalid URL';
@@ -367,7 +368,7 @@
if (this.currentCity.cii_sn === city.cii_sn) {
return false;
}
- this.cityListPage = false;
+ // this.cityListPage = false;
this.loading = true;
const _param = {
GRI_SN: this.param.g,
@@ -390,12 +391,18 @@
initSignature() {
var canvas = document.getElementById('signature-pad');
this.signaturePad = new SignaturePad(canvas, {
+ backgroundColor: '#f8f8f8',
penColor: "rgb(50, 50, 50)",
});
+ const ratio = Math.max(window.devicePixelRatio || 1, 1);
+ canvas.width = canvas.offsetWidth * ratio;
+ canvas.height = canvas.offsetHeight * ratio;
+ canvas.getContext("2d").scale(ratio, ratio);
+ this.signaturePad.clear(); // otherwise isEmpty() might return incorrect value
},
clearSignature() {
- // var data = this.signaturePad.toDataURL("image/svg+xml");
- // console.log(data);
+ var data = this.signaturePad.toDataURL("image/svg+xml");
+ console.log(data);
this.signaturePad.clear();
},
getData(param, continually = false) {
diff --git a/utils.js b/utils.js
index a13dd70..04933d9 100644
--- a/utils.js
+++ b/utils.js
@@ -71,22 +71,6 @@ async function postForm(path, data, config) {
return console.log('Request Failed', err);
}
}
-/**
- * 千分位 格式化数字
- */
-const numberFormatter = (number, d = 2, m = 2) => {
- return new Intl.NumberFormat(undefined, {
- minimumFractionDigits: d,
- maximumFractionDigits: m,
- }).format(number);
-};
-
-/**
- * 人民币:元 转换为 万元
- */
-const CNYConvertK = (number, scale = 10) => {
- return numberFormatter((number/(1000*scale)), 0, 0);
-};
function isEmpty(val) {
// return val === undefined || val === null || val === "";
return [Object, Array].includes((val || {}).constructor) && !Object.entries((val || {})).length;
@@ -103,45 +87,3 @@ function groupBy(array, callback) {
return groups;
}, {});
}
-
-var now = new Date(); //当前日期
-var nowDayOfWeek = now.getDay(); //今天本周的第几天
-var nowDay = now.getDate(); //当前日
-var nowMonth = now.getMonth(); //当前月
-var nowYear = now.getYear(); //当前年
-nowYear += nowYear < 2000 ? 1900 : 0; //
-var lastMonthDate = new Date(); //上月日期
-lastMonthDate.setDate(1);
-lastMonthDate.setMonth(lastMonthDate.getMonth() - 1);
-var lastYear = lastMonthDate.getYear();
-var lastMonth = lastMonthDate.getMonth();
-//格式化日期:yyyy-MM-dd
-function formatDate(date) {
- var myyear = date.getFullYear();
- var mymonth = date.getMonth() + 1;
- var myweekday = date.getDate();
- if (mymonth < 10) {
- mymonth = '0' + mymonth;
- }
- if (myweekday < 10) {
- myweekday = '0' + myweekday;
- }
- return myyear + '-' + mymonth + '-' + myweekday;
-}
-//获得某月的天数
-function getMonthDays(myMonth) {
- var monthStartDate = new Date(nowYear, myMonth, 1);
- var monthEndDate = new Date(nowYear, myMonth + 1, 1);
- var days = (monthEndDate - monthStartDate) / (1000 * 60 * 60 * 24);
- return days;
-}
-//获得本月的开始日期
-function getMonthStartDate() {
- var monthStartDate = new Date(nowYear, nowMonth, 1);
- return formatDate(monthStartDate);
-}
-//获得本月的结束日期
-function getMonthEndDate() {
- var monthEndDate = new Date(nowYear, nowMonth, getMonthDays(nowMonth));
- return formatDate(monthEndDate);
-}