zhashaonan 6 年之前
父节点
当前提交
be3a2743b4
共有 5 个文件被更改,包括 26 次插入4 次删除
  1. 3 0
      app.json
  2. 15 1
      config.js
  3. 3 2
      pages/details/details.wxml
  4. 1 1
      pages/details/details.wxss
  5. 4 0
      pages/discover/discover.js

+ 3 - 0
app.json

@@ -55,5 +55,8 @@
         "text": "我"
       }
     ]
+  },
+  "networkTimeout": {
+    "request": 20000
   }
 }

+ 15 - 1
config.js

@@ -21,7 +21,21 @@ function getReq(data, callback, fail) {
       callback(res.data)
     },
     fail() {
-      fail && fail()
+      wx.showModal({
+        confirmText: '重试',
+        content: '网络错误',
+        success: function (res) {
+          if (res.confirm) {
+            wx.reLaunch({
+              url: "/pages/index/index"
+            })
+
+          } else if (res.cancel) {
+            console.log('用户点击取消')
+          }
+        }
+      })
+
     }
   })
 }

+ 3 - 2
pages/details/details.wxml

@@ -11,8 +11,9 @@
     <view class="comment_swiper" wx:if="{{datas.comment.content}}">
       <navigator class="f0" url="/pages/comments/comments?common_id={{datas.comment.common_id}}">
         <image src="{{datas.comment.member_avatar}}"></image>
-        <text class="nickname" decode="{{true}}">&nbsp;&nbsp;{{datas.comment.nickname}}:</text>
-        <text class="comment_content one_line_hidden">{{datas.comment.content}}</text>
+         <text class="comment_content one_line_hidden" decode="{{true}}">&nbsp;&nbsp;{{datas.comment.nickname}}:{{datas.comment.content}}</text> 
+         <!-- <text class="nickname" decode="{{true}}">&nbsp;&nbsp;{{datas.comment.nickname}}:</text>
+        <text class="comment_content one_line_hidden">{{datas.comment.content}}</text>  -->
       </navigator>
     </view>
     <view class="details_collection flex_center">已收藏人数 {{getOneSummary.goods_collect}}</view>

+ 1 - 1
pages/details/details.wxss

@@ -19,7 +19,7 @@
 }
 
 .comment_content {
-  max-width: 220rpx;
+  max-width: 346rpx;
   font-size: 24rpx;
   height: 40rpx;
   line-height: 40rpx;

+ 4 - 0
pages/discover/discover.js

@@ -20,11 +20,15 @@ Page({
   },
 
   getDatas() {
+    wx.showLoading({
+      title: '加载中',
+    })
     var self = this
     getReq({
       act: 'brand',
       op: 'home'
     }, function (res) {
+      wx.hideLoading()
       if (res.code == 200) {
         self.setData({
           special_datas: res.datas