|
@@ -1,6 +1,6 @@
|
|
|
//index.js
|
|
|
//获取应用实例
|
|
|
-const app = require('../../utils/util.js');
|
|
|
+// const app = require('../../utils/util.js');
|
|
|
Page({
|
|
|
data: {
|
|
|
nameIsTrue: false, //名字是否填写
|
|
@@ -99,7 +99,7 @@ Page({
|
|
|
},
|
|
|
onConfirm(event) {
|
|
|
console.log(event, "0000");
|
|
|
- var timeValue = this.timeFormat(new Date(event.detail), "yyyy-MM-dd");
|
|
|
+ let timeValue = this.timeFormat(new Date(event.detail), "yyyy-MM-dd");
|
|
|
this.setData({
|
|
|
zaizhiTime: timeValue,
|
|
|
postshow :false,
|
|
@@ -108,7 +108,7 @@ Page({
|
|
|
},
|
|
|
onConfirm1(event) {
|
|
|
console.log(event, "0000");
|
|
|
- var timeValue = this.timeFormat(new Date(event.detail), "yyyy-MM-dd");
|
|
|
+ let timeValue = this.timeFormat(new Date(event.detail), "yyyy-MM-dd");
|
|
|
this.setData({
|
|
|
peixunTime: timeValue,
|
|
|
postshow1 :false,
|
|
@@ -116,10 +116,10 @@ Page({
|
|
|
});
|
|
|
},
|
|
|
parameterTap: function (e) { //e是获取e.currentTarget.dataset.id所以是必备的,跟前端的data-id获取的方式差不多
|
|
|
- var that = this
|
|
|
- var this_checked = e.currentTarget.dataset.id
|
|
|
- var parameterList = this.data.parameter //获取Json数组
|
|
|
- for (var i = 0; i < parameterList.length; i++) {
|
|
|
+ let that = this
|
|
|
+ let this_checked = e.currentTarget.dataset.id
|
|
|
+ let parameterList = this.data.parameter //获取Json数组
|
|
|
+ for (let i = 0; i < parameterList.length; i++) {
|
|
|
if (parameterList[i].id == this_checked) {
|
|
|
parameterList[i].checked = true; //当前点击的位置为true即选中
|
|
|
} else {
|
|
@@ -249,7 +249,7 @@ Page({
|
|
|
},
|
|
|
|
|
|
timeFormat(date, fmt) {
|
|
|
- var o = {
|
|
|
+ let o = {
|
|
|
"M+": date.getMonth() + 1, //月份
|
|
|
"d+": date.getDate(), //日
|
|
|
"h+": date.getHours(), //小时
|
|
@@ -260,7 +260,7 @@ Page({
|
|
|
};
|
|
|
if (/(y+)/.test(fmt))
|
|
|
fmt = fmt.replace(RegExp.$1, (date.getFullYear() + "").substr(4 - RegExp.$1.length));
|
|
|
- for (var k in o)
|
|
|
+ for (let k in o)
|
|
|
if (new RegExp("(" + k + ")").test(fmt))
|
|
|
fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
|
|
|
return fmt;
|