Bladeren bron

fixed iOS time display bug

Z1hgq 7 jaren geleden
bovenliggende
commit
65d0f8b4e5

+ 2 - 2
Furniture/app.json

xqd xqd xqd
@@ -1,5 +1,6 @@
 {
   "pages": [
+    "pages/logs/guanggao",
     "page/homePage/homePage",
     "page/user/user",
     "page/lifeCircle/lifeCircle",
@@ -8,7 +9,6 @@
     "page/homePage/detail/conment/conment",
     "page/login/login",
     "pages/index/index",
-    "pages/logs/guanggao",
     "pages/manager/datacount",
     "pages/manager/thedata/shouhou",
     "pages/manager/thedata/pingjia",
@@ -26,7 +26,7 @@
   ],
   "window": {
     "navigationBarTextStyle": "black",
-    "navigationBarTitleText": "天天家居",
+    "navigationBarTitleText": "天天家居",
     "navigationBarBackgroundColor": "#fff",
     "backgroundColor": "#dcdcdc"
   },

+ 16 - 16
Furniture/page/homePage/detail/conment/conment.js

xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd
@@ -27,7 +27,7 @@ Page({
     app.request({
       url: 'https://t6.9026.com/api/furniture/getmorecomments',
       data: {
-        store_id: 1,
+        store_id: app.globalData.store_id,
         id: id
       },
       method: 'get',
@@ -41,8 +41,8 @@ Page({
         })
         var c = that.data.replys
         for (var i = 0; i < c.length; i++) {
-          console.log(c[i].created_at)
-          var d = new Date(c[i].created_at).getTime()
+          console.log(c[i].created_at.replace(/\-/g, "/"))
+          var d = new Date(c[i].created_at.replace(/\-/g, "/")).getTime()
           var n = new Date().getTime()
           var t = n - d
           if (t < 60000) {
@@ -73,7 +73,7 @@ Page({
   comments_time:function(){
     var that = this
     var cc = that.data.comments
-    var d = new Date(cc.created_at).getTime()
+    var d = new Date(cc.created_at.replace(/\-/g, "/")).getTime()
     var n = new Date().getTime()
     var t = n - d
     if (t < 60000) {
@@ -141,7 +141,7 @@ Page({
       app.request({
         url: that.data.next_page_url,
         data: {
-          store_id: 1,
+          store_id: app.globalData.store_id,
           id: that.data.reply_id
         },
         method: 'get',
@@ -155,7 +155,7 @@ Page({
           var c = res.data.data.comments_replys.data
           for (var i = 0; i < c.length; i++) {
             console.log(c[i].created_at)
-            var d = new Date(c[i].created_at).getTime()
+            var d = new Date(c[i].created_at.replace(/\-/g, "/")).getTime()
             var n = new Date().getTime()
             var t = n - d
             if (t < 60000) {
@@ -183,11 +183,11 @@ Page({
         }
       })
     } else {
-      wx.showToast({
-        title: '已经没有更多了',
-        icon: 'none',
-        duration: 1000
-      })
+      // wx.showToast({
+      //   title: '已经没有更多了',
+      //   icon: 'none',
+      //   duration: 1000
+      // })
     }
   },
 
@@ -204,7 +204,7 @@ Page({
       app.request({
         url: 'https://t6.9026.com/api/furniture/add_comments',
         data: {
-          store_id: 1,
+          store_id: app.globalData.store_id,
           news_id: that.data.newsid,
           content: text,
           comments_id: that.data.reply_id
@@ -219,7 +219,7 @@ Page({
             app.request({
               url: 'https://t6.9026.com/api/furniture/getmorecomments',
               data: {
-                store_id: 1,
+                store_id: app.globalData.store_id,
                 id: that.data.reply_id
               },
               method: 'get',
@@ -234,8 +234,8 @@ Page({
                 })
                 var c = that.data.replys
                 for (var i = 0; i < c.length; i++) {
-                  console.log(c[i].created_at)
-                  var d = new Date(c[i].created_at).getTime()
+                  console.log(c[i].created_at.replace(/\-/g, "/"))
+                  var d = new Date(c[i].created_at.replace(/\-/g, "/")).getTime()
                   var n = new Date().getTime()
                   var t = n - d
                   if (t < 60000) {
@@ -296,7 +296,7 @@ Page({
               code: code,
               avatar: tx,
               nickName: nn,
-              store_id: 1
+              store_id: app.globalData.store_id
             },
             success: function(res) {
               console.log(res.data)

+ 26 - 22
Furniture/page/homePage/detail/detail.js

xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd
@@ -30,7 +30,7 @@ Page({
       url:'https://t6.9026.com/api/furniture/news_detail',
       method:'get',
       data:{
-        store_id:1,
+        store_id: app.globalData.store_id,
         newsid:id
       },
       success:function(res){
@@ -42,8 +42,9 @@ Page({
         })
         var c = that.data.comments
         for(var i = 0;i<c.length;i++){
-          console.log(c[i].created_at)
-          var d = new Date(c[i].created_at).getTime()
+          console.log(c[i].created_at.replace(/\-/g, "/"))
+          var k = c[i].created_at.replace(/\-/g, "/")
+          var d = new Date(k).getTime()
           var n = new Date().getTime()
           var t = n - d
           if(t < 60000){
@@ -118,7 +119,7 @@ Page({
         url: that.data.next_page_url,
         method: 'get',
         data: {
-          store_id: 1,
+          store_id: app.globalData.store_id,
           newsid: that.data.news.id
         },
         success: function (res) {
@@ -128,8 +129,9 @@ Page({
           })
           var c = res.data.data.news_comments.data
           for (var i = 0; i < c.length; i++) {
-            console.log(c[i].created_at)
-            var d = new Date(c[i].created_at).getTime()
+            console.log(c[i].created_at.replace(/\-/g, "/"))
+            var k = c[i].created_at.replace(/\-/g, "/")
+            var d = new Date(k).getTime()
             var n = new Date().getTime()
             var t = n - d
             if (t < 60000) {
@@ -157,11 +159,11 @@ Page({
         }
       })
     }else{
-      wx.showToast({
-        title: '已经没有更多了',
-        icon:'none',
-        duration:1000
-      })
+      // wx.showToast({
+      //   title: '已经没有更多了',
+      //   icon:'none',
+      //   duration:1000
+      // })
     }
   },
 
@@ -180,7 +182,7 @@ Page({
       app.request({
         url:'https://t6.9026.com/api/furniture/addtolike',
         data:{
-          store_id:1,
+          store_id: app.globalData.store_id,
           newsid:that.data.news.id,
           like:1
         },
@@ -231,7 +233,7 @@ Page({
         app.request({
           url: 'https://t6.9026.com/api/furniture/add_comments',
           data: {
-            store_id: 1,
+            store_id: app.globalData.store_id,
             news_id: that.data.news.id,
             content: text,
             comment_id: 0
@@ -248,7 +250,7 @@ Page({
                 url: 'https://t6.9026.com/api/furniture/news_detail',
                 method: 'get',
                 data: {
-                  store_id: 1,
+                  store_id: app.globalData.store_id,
                   newsid: that.data.news.id
                 },
                 success: function (res) {
@@ -261,8 +263,9 @@ Page({
                   })
                   var c = that.data.comments
                   for (var i = 0; i < c.length; i++) {
-                    console.log(c[i].created_at)
-                    var d = new Date(c[i].created_at).getTime()
+                    console.log(c[i].created_at.replace(/\-/g, "/"))
+                    var k = c[i].created_at.replace(/\-/g, "/")
+                    var d = new Date(k).getTime()
                     var n = new Date().getTime()
                     var t = n - d
                     if (t < 60000) {
@@ -304,7 +307,7 @@ Page({
         app.request({
           url: 'https://t6.9026.com/api/furniture/add_comments',
           data: {
-            store_id: 1,
+            store_id: app.globalData.store_id,
             news_id: that.data.news.id,
             content: text,
             comments_id: that.data.reply_id
@@ -320,7 +323,7 @@ Page({
                 url: 'https://t6.9026.com/api/furniture/news_detail',
                 method: 'get',
                 data: {
-                  store_id: 1,
+                  store_id: app.globalData.store_id,
                   newsid: that.data.news.id
                 },
                 success: function (res) {
@@ -337,8 +340,9 @@ Page({
                   })
                   var c = that.data.comments
                   for (var i = 0; i < c.length; i++) {
-                    console.log(c[i].created_at)
-                    var d = new Date(c[i].created_at).getTime()
+                    console.log(c[i].created_at.replace(/\-/g, "/"))
+                    var k = c[i].created_at.replace(/\-/g, "/")
+                    var d = new Date(k).getTime()
                     var n = new Date().getTime()
                     var t = n - d
                     if (t < 60000) {
@@ -388,7 +392,7 @@ Page({
   news_time: function () {
     var that = this
     var cc = that.data.news
-    var d = new Date(cc.created_at).getTime()
+    var d = new Date(cc.created_at.replace(/\-/g, "/")).getTime()
     var n = new Date().getTime()
     var t = n - d
     if (t < 60000) {
@@ -441,7 +445,7 @@ Page({
               code: code,
               avatar: tx,
               nickName: nn,
-              store_id: 1
+              store_id: app.globalData.store_id
             },
             success: function (res) {
               console.log(res.data)

+ 19 - 2
Furniture/page/homePage/homePage.js

xqd xqd xqd xqd
@@ -11,6 +11,7 @@ Page({
    * 页面的初始数据
    */
   data: {
+    next_page_url:'',
     is_login: false,
     inputShowed: false,
     inputVal: "",
@@ -66,6 +67,7 @@ Page({
         url: api.news_list,
         success: function(e) {
           that.setData({
+            next_page_url:e.data.next_page_url,
             news: e.data.data,
           })
           console.log(that.data.news)
@@ -164,7 +166,22 @@ Page({
    * 页面上拉触底事件的处理函数
    */
   onReachBottom: function() {
-
+    var that = this
+    if(that.data.next_page_url)
+    {
+      app.request1({
+        url: that.data.next_page_url,
+        success: function (e) {
+          that.setData({
+            next_page_url: e.data.next_page_url,
+            news: [...that.data.news.concat(e.data.data)],
+          })
+          console.log(that.data.news)
+        }
+      })
+    }else{
+      console.log('no more news')
+    }
   },
 
   /**
@@ -275,7 +292,7 @@ Page({
               code: code,
               avatar: tx,
               nickName: nn,
-              store_id: 1
+              store_id: app.globalData.store_id
             },
             success: function(res) {
               console.log(res.data)

+ 1 - 1
Furniture/page/user/user.js

xqd
@@ -105,7 +105,7 @@ Page({
               code: code,
               avatar: tx,
               nickName: nn,
-              store_id: 1
+              store_id: app.globalData.store_id
             },
             success: function(res) {
               console.log(res.data)

+ 10 - 55
Furniture/pages/index/index.js

xqd xqd xqd xqd xqd xqd xqd xqd xqd
@@ -163,7 +163,7 @@ Page({
     app.request({
       url: 'https://t6.9026.com/api/furniture/getattr',
       data: {
-        store_id: 1
+        store_id: app.globalData.store_id
       },
       success: function(res) {
         let goodsinfo = res.data.data
@@ -186,7 +186,7 @@ Page({
         app.request({
           url: 'https://t6.9026.com/api/furniture/getattr',
           data: {
-            store_id: 1,
+            store_id: app.globalData.store_id,
             id: that.data.categorysObj[0].id
           },
           success: function(res) {
@@ -210,7 +210,7 @@ Page({
             app.request({
               url: 'https://t6.9026.com/api/furniture/getattr',
               data: {
-                store_id: 1,
+                store_id: app.globalData.store_id,
                 id: that.data.gtypesObj[0].id
               },
               success: function(res) {
@@ -258,7 +258,7 @@ Page({
       url: 'https://t6.9026.com/api/furniture/createorder',
       method: 'post',
       data: {
-        store_id: 1,
+        store_id: app.globalData.store_id,
         category: that.data.categorys[that.data.categoryIndex],
         type: that.data.gtypes[that.data.gtypeIndex],
         color: that.data.gcolors[that.data.gcolorIndex],
@@ -344,7 +344,7 @@ Page({
               code: code,
               avatar: tx,
               nickName: nn,
-              store_id: 1
+              store_id: app.globalData.store_id
             },
             success: function (res) {
               console.log(res.data)
@@ -408,7 +408,7 @@ Page({
     app.request({
       url: 'https://t6.9026.com/api/furniture/getattr',
       data: {
-        store_id: 1,
+        store_id: app.globalData.store_id,
         id: that.data.categorysObj[that.data.categoryIndex].id
       },
       success: function(res) {
@@ -432,7 +432,7 @@ Page({
         app.request({
           url: 'https://t6.9026.com/api/furniture/getattr',
           data: {
-            store_id: 1,
+            store_id: app.globalData.store_id,
             id: that.data.gtypesObj[0].id
           },
           success: function(res) {
@@ -472,7 +472,7 @@ Page({
     app.request({
       url: 'https://t6.9026.com/api/furniture/getattr',
       data: {
-        store_id: 1,
+        store_id: app.globalData.store_id,
         id: that.data.gtypesObj[that.data.gtypeIndex].id
       },
       success: function(res) {
@@ -533,53 +533,8 @@ Page({
         })
       },
       fail:()=>{
-        console.log('....')
-        wx.login({
-          success: function (res) {
-            let code = res.code
-            console.log(code)
-            wx.getUserInfo({
-              success: function (res) {
-                let tx = res.userInfo.avatarUrl
-                let nn = res.userInfo.nickName
-                app.request({
-                  url: 'https://t6.9026.com/api/furniture/service_login',
-                  method: 'POST',
-                  data: {
-                    code: code,
-                    avatar: tx,
-                    nickName: nn,
-                    store_id: 1
-                  },
-                  success: function (res) {
-                    console.log(res.data)
-                    wx.setStorageSync("token", res.data.data.token)
-                    wx.setStorageSync('key', res.data.data.session_key)
-                    wx.setStorageSync("user", res.data.data.user);
-                    wx.setStorageSync('ma', 0)
-                    wx.setStorageSync('pa', 0)
-                    wx.setStorageSync('us', 0)
-                    // app.request({
-                    //   url: 'https://t6.9026.com/api/furniture/getphonenumber',
-                    //   data: {
-                    //     store_id: '1',
-                    //     session_key: wx.getStorageSync('key'),
-                    //     iv: e.detail.iv,
-                    //     encryptData: e.detail.encryptedData
-                    //   },
-                    //   method: 'POST',
-                    //   success: function (res) {
-                    //     console.log(res.data)
-                    //     that.setData({
-                    //       mobile: res.data.data.decryptedData.phoneNumber
-                    //     })
-                    //   }
-                    // })
-                  }
-                })
-              }
-            })
-          }
+        that.setData({
+          is_login:true
         })
       }
     })

+ 5 - 5
Furniture/pages/infor/infor.js

xqd
@@ -567,11 +567,11 @@ Page({
         })
       }
     } else {
-      wx.showToast({
-        title: '已经没有更多了',
-        icon: 'none',
-        duration: 1000
-      })
+      // wx.showToast({
+      //   title: '已经没有更多了',
+      //   icon: 'none',
+      //   duration: 1000
+      // })
     }
   },
   searchin:function(e){

+ 3 - 3
Furniture/pages/logs/guanggao.js

xqd xqd
@@ -38,7 +38,7 @@ Component({
         url:'https://t6.9026.com/api/furniture/getfurnitureads',
         method:'get',
         data:{
-          store_id:1
+          store_id: app.globalData.store_id
         },
         success:function(res){
           console.log(res.data)
@@ -70,14 +70,14 @@ Component({
       st = setTimeout(function () {
         clearInterval(i)
         wx.reLaunch({
-          url: "../index/index"
+          url: "/page/homePage/homePage"
         });
       }, 3000)
     },
     getin:function(){
       var a = 1;
       wx.switchTab({
-        url: '../index/index?login='+1,
+        url: '/page/homePage/homePage',
       })
     }
   }

+ 1 - 1
Furniture/pages/logs/guanggao.wxml

xqd
@@ -4,6 +4,6 @@
             <image src="{{item}}" style="width:{{windowWidth}}px;height:{{windowHeight}}px"></image>
         </view>
     <view>
-        <button class="join" bindtap='getin'>({{second}}s) 跳过</button>
+        <button class="join" bindtap='getin'>{{second}}s | 跳过</button>
     </view>
 </view>

+ 1 - 1
Furniture/pages/logs/guanggao.wxss

xqd
@@ -9,7 +9,7 @@
     top: 20rpx;
     right: 20rpx;
     text-align: center;
-    background: #777;
+    background:rgba(0, 0, 0, 0.466);
     border-radius: 20rpx;
     color: #fff;
 }

+ 5 - 5
Furniture/pages/make/make.js

xqd
@@ -528,11 +528,11 @@ Page({
       }
 
     } else {
-      wx.showToast({
-        title: '已经没有更多了',
-        icon: 'none',
-        duration: 1000
-      })
+      // wx.showToast({
+      //   title: '已经没有更多了',
+      //   icon: 'none',
+      //   duration: 1000
+      // })
     }
   },
 

+ 5 - 5
Furniture/pages/manager/manage.js

xqd
@@ -757,11 +757,11 @@ Page({
       }
 
     } else {
-      wx.showToast({
-        title: '已经没有更多了',
-        icon: 'none',
-        duration: 1000
-      })
+      // wx.showToast({
+      //   title: '已经没有更多了',
+      //   icon: 'none',
+      //   duration: 1000
+      // })
     }
   },
 

+ 5 - 5
Furniture/pages/packing/packing.js

xqd
@@ -609,11 +609,11 @@ Page({
       }
 
     } else {
-      wx.showToast({
-        title: '已经没有更多了',
-        icon: 'none',
-        duration: 1000
-      })
+      // wx.showToast({
+      //   title: '已经没有更多了',
+      //   icon: 'none',
+      //   duration: 1000
+      // })
     }
   },