From 8b3fbce45058894a76aefbf11b3a199f60d487d6 Mon Sep 17 00:00:00 2001 From: xuxj <hugeinfo123> Date: Sun, 26 Apr 2020 09:40:15 +0800 Subject: [PATCH] bug修改 --- SunshineLnsMinApp/app.js | 61 +++++++++++++++++++----------- 1 files changed, 39 insertions(+), 22 deletions(-) diff --git a/SunshineLnsMinApp/app.js b/SunshineLnsMinApp/app.js index b434732..6fb8d13 100644 --- a/SunshineLnsMinApp/app.js +++ b/SunshineLnsMinApp/app.js @@ -1,7 +1,7 @@ var qcloud = require('./lib/index'); //app.js App({ - onLaunch: function() { + onLaunch: function () { // 展示本地存储能力 var logs = wx.getStorageSync('logs') || [] logs.unshift(Date.now()) @@ -10,16 +10,17 @@ globalData: { userInfo: null, pageData: {}, - // url: 'https://nsjcy.hugeinfo.com.cn/nsjc-charge', - //url: 'http://192.168.0.31:8085/nsjc-charge', - // imgUrl: 'https://nsjcy.hugeinfo.com.cn/nsjc-charge', - url: 'http://nsjc.vaiwan.com/nsjc-charge', - imgUrl: 'http://nsjc.vaiwan.com/nsjc-charge' + //url: 'https://nsjcy.hugeinfo.com.cn/nsjc-charge', + // url: 'http://1p885086k1.iok.la/nsjc-charge', + url: 'http://localhost:6060/nsjc-charge', + imgUrl: 'https://nsjcy.hugeinfo.com.cn/nsjc-charge', + // url: 'http://nsjc.vaiwan.com/nsjc-charge', + // imgUrl: 'http://nsjc.vaiwan.com/nsjc-charge' }, // 过滤数组 where: (collection, source) => { var sourceKeys = Object.keys(source); - return collection.filter(function(obj) { + return collection.filter(function (obj) { for (var i = 0; i < sourceKeys.length; i++) { if (!obj.hasOwnProperty(sourceKeys[i]) || obj[sourceKeys[i]] !== source[sourceKeys[i]]) { return false; @@ -30,7 +31,7 @@ }, //控制是否能够编辑 - judgeDisable: function(status) { + judgeDisable: function (status) { if (status == null || status == 0 || status == 4) { return false; //可以 } else { @@ -39,14 +40,14 @@ }, //提示弹窗 - showModal: function(warn) { + showModal: function (warn) { wx.showModal({ title: '提示', content: warn }) }, //添加图片 - joinPicture: function(e, these, associateTypeId, attId) { + joinPicture: function (e, these, associateTypeId, attId) { var th = this; var index = e.currentTarget.dataset.index; var associateTypeId = e.currentTarget.dataset.associatetypeid || associateTypeId; @@ -74,7 +75,7 @@ }, // 上传视频 - joinVideo: function(e, these, associateTypeId, attId) { + joinVideo: function (e, these, associateTypeId, attId) { var th = this; var index = e.currentTarget.dataset.index; var associateTypeId = e.currentTarget.dataset.associatetypeid || associateTypeId; @@ -91,7 +92,7 @@ }) }, //上传文件 - upload: function(these, path, associateTypeId, way, id) { + upload: function (these, path, associateTypeId, way, id) { console.log(these) console.log(path) console.log(associateTypeId) @@ -121,11 +122,15 @@ associateTypeId: associateTypeId, batch }, - success: function(res) { + success: function (res) { console.log(res) var evalList = these.data.evalList; var evalListType = 'evalList' + associateTypeId; var data = JSON.parse(res.data) + console.log(data) + console.log('path', path) + console.log('evalList', evalList) + console.log('associateTypeId', associateTypeId) these.setData({ evalList: { ...evalList, @@ -136,7 +141,7 @@ }, }) }, - complete: function() { + complete: function () { wx.hideToast(); //隐藏Toast } }) @@ -144,7 +149,7 @@ }, //删除图片 - clearImg: function(e, these) { + clearImg: function (e, these) { var id = e.currentTarget.id; var index = e.currentTarget.dataset.index; var associateTypeId = e.currentTarget.dataset.associatetypeid; @@ -157,12 +162,12 @@ }), wx.request({ url: this.globalData.url + '/api/v1/attachment/delete/' + id, - success: function(res) { + success: function (res) { if (res.data.code == 0) { console.log('删除成功!') } }, - complete: function() { + complete: function () { wx.hideToast(); //隐藏Toast } }) @@ -176,7 +181,7 @@ }, // 预览图片 - previewImage: function(e) { + previewImage: function (e) { wx.previewImage({ current: e.currentTarget.dataset.src, // 当前显示图片的http链接 urls: [e.currentTarget.dataset.src] // 需要预览的图片http链接列表 @@ -184,7 +189,7 @@ }, //转换时间戳 - formatDate: function(ts) { + formatDate: function (ts) { var now = new Date(ts); var year = now.getFullYear(); var month = now.getMonth() + 1; @@ -195,15 +200,27 @@ return year + "-" + month + "-" + date + " " + hour + ":" + minute; }, + //转换时间戳 + formatDateday: function (ts) { + var now = new Date(ts); + var year = now.getFullYear(); + var month = now.getMonth() + 1; + var date = now.getDate(); + var hour = now.getHours() < 10 ? '0' + now.getHours() : now.getHours(); + var minute = now.getMinutes() < 10 ? '0' + now.getMinutes() : now.getMinutes(); + var second = now.getSeconds(); + return year + "-" + month + "-" + date; + }, + // 页面正在开发中 - developIng: function() { + developIng: function () { wx.navigateTo({ url: '../developIng/developIng', }) }, // 判断时间段 - period: function() { + period: function () { var now = new Date(), hour = now.getHours(), word = '';; @@ -228,7 +245,7 @@ }, // 根据身份证获取生日,性别,年龄 - IdCard: function(UUserCard, num) { + IdCard: function (UUserCard, num) { if (num == 1) { //获取出生日期 var birth = UUserCard.substring(6, 10) + "-" + UUserCard.substring(10, 12) + "-" + UUserCard.substring(12, 14); -- Gitblit v1.8.0