From b72fc1b10b08cf2fea1626d32e1ca2cccabe2edd Mon Sep 17 00:00:00 2001
From: liuwh <hugeinfo123>
Date: Tue, 31 Mar 2020 23:49:35 +0800
Subject: [PATCH] bug修复

---
 SunshineLnsMinApp/app.js |   68 +++++++++++++++++++++++-----------
 1 files changed, 46 insertions(+), 22 deletions(-)

diff --git a/SunshineLnsMinApp/app.js b/SunshineLnsMinApp/app.js
index ec79139..5ba6922 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://hugeinfo.com.cn/nsjc-charge',
-  //url: 'http://192.168.0.31:8085/nsjc-charge',
-    //imgUrl: 'https://hugeinfo.com.cn/nsjc-charge',
-     url: 'https://xnwj.gznsjc.gov.cn/nsjc-charge',
-    imgUrl: 'https://xnwj.gznsjc.gov.cn/nsjc-charge'
+    url: 'https://nsjcy.hugeinfo.com.cn/nsjc-charge',
+    // url: 'http://1p885086k1.iok.la/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'
   },
   // 过滤数组
   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,12 @@
     })
   },
   //上传文件
-  upload: function(these, path, associateTypeId, way, id) {
+  upload: function (these, path, associateTypeId, way, id) {
+    console.log(these)
+    console.log(path)
+    console.log(associateTypeId)
+    console.log(way)
+    console.log(id)
     var status = these.data['status'];
     var batch;
     if (status == 4) {
@@ -99,6 +105,7 @@
     } else {
       batch = 0
     }
+    console.log(batch)
     wx.showToast({
       icon: "loading",
       title: "正在上传"
@@ -115,10 +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,
@@ -129,7 +141,7 @@
           },
         })
       },
-      complete: function() {
+      complete: function () {
         wx.hideToast(); //隐藏Toast
       }
     })
@@ -137,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;
@@ -150,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
         }
       })
@@ -169,7 +181,7 @@
   },
 
   // 预览图片
-  previewImage: function(e) {
+  previewImage: function (e) {
     wx.previewImage({
       current: e.currentTarget.dataset.src, // 当前显示图片的http链接
       urls: [e.currentTarget.dataset.src] // 需要预览的图片http链接列表
@@ -177,7 +189,7 @@
   },
 
   //转换时间戳
-  formatDate: function(ts) {
+  formatDate: function (ts) {
     var now = new Date(ts);
     var year = now.getFullYear();
     var month = now.getMonth() + 1;
@@ -188,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 = '';;
@@ -221,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