Browse Source

调整样式与优化

bayi 2 years ago
parent
commit
1f2c06dc94

+ 12 - 1
mixins/reachBottom.js

@@ -2,6 +2,7 @@ module.exports = Behavior({
   data: {
     loading: false, // 加载状态标志位
     list: [],
+    nullList: false,
     grade: '',
     pageNo: 1,
     totalSize: 0,
@@ -19,7 +20,8 @@ module.exports = Behavior({
       }
       // 加载状态,用于页面中控制加载动画的显示
       this.setData({
-        loading: true
+        loading: true,
+        nullList: false
       })
       let {
         list,
@@ -33,6 +35,15 @@ module.exports = Behavior({
         });
       })
       list = [...this.data.list, ...list]
+      if (list.length == 0) {
+        this.setData({
+          nullList: true
+        })
+      } else {
+        this.setData({
+          nullList: false
+        })
+      }
       this.setData({
         pageNo: ++this.data.pageNo,
         list,

+ 3 - 1
pages/childClassify/index.json

@@ -1,3 +1,5 @@
 {
-  "usingComponents": {}
+  "usingComponents": {
+    "emptyBg": "/components/empty/index"
+  }
 }

+ 3 - 0
pages/childClassify/index.less

@@ -165,4 +165,7 @@
       }
     }
   }
+}
+.empty{
+  margin-top: 300rpx;
 }

+ 3 - 2
pages/childClassify/index.wxml

@@ -14,8 +14,8 @@
     </view>
   </view>
   <!-- 内容区域 -->
-  <scroll-view class="worksList" style="{{childType?'padding-top:10rpx':''}}" scroll-y="true" enhanced
-    show-scrollbar="{{false}}" scroll-top="{{scrollTop}}" bindscrolltolower='loadMore'>
+  <scroll-view wx:if="{{list.length>0}}" class="worksList" style="{{childType?'padding-top:10rpx':''}}" scroll-y="true"
+    enhanced show-scrollbar="{{false}}" scroll-top="{{scrollTop}}" bindscrolltolower='loadMore'>
     <view class="worksBox" wx:for="{{list}}" wx:key="id">
       <view class="left">
         <image src="{{item.coverImg}}" class="cover" wx:if="{{item.resourcesType==0}}" />
@@ -41,4 +41,5 @@
       <view class="goRead" data-id="{{item.id}}" bindtap="goRead">去朗读</view>
     </view>
   </scroll-view>
+  <emptyBg wx:if="{{type=='search'&&list.length==0}}" message="没有找到想要的内容~"></emptyBg>
 </view>

+ 3 - 0
pages/childClassify/index.wxss

@@ -144,3 +144,6 @@
   box-shadow: 0 4rpx 10rpx 0 rgba(50, 197, 255, 0.46);
   border-radius: 50rpx;
 }
+.empty {
+  margin-top: 300rpx;
+}

+ 5 - 0
pages/ranking/index.js

@@ -53,6 +53,11 @@ Page({
       url: `/pages/rankIntro/index?title=榜单说明&img=${this.data.explain}`,
     })
   },
+  jumpIndex() {
+    wx.switchTab({
+      url: '/pages/index/index',
+    })
+  },
   jumpUserInfo({
     currentTarget
   }) {

+ 3 - 0
pages/ranking/index.wxml

@@ -58,5 +58,8 @@
     <button class="resetBtn rigth" open-type="share" wx:if="{{rankingType!=4}}">
       <image src="/static/forward.png" class="share" />呼朋唤友来加热
     </button>
+    <button class="resetBtn rigth" wx:else bindtap="jumpIndex">
+      我要冲榜
+    </button>
   </view>
 </view>

+ 5 - 4
pages/reading/index.js

@@ -129,6 +129,7 @@ Page({
   },
   // 开始录制
   setCountDown() {
+    console.log('11111');
     let child = this.selectComponent('#readingTips').data
     // 判断是否有权限朗读 不是vip并且没有朗读机会
     const isVip = child.vipTime ? true : false
@@ -139,10 +140,10 @@ Page({
       this.finishRecord()
       return
     }
-    if (this.data.readingReset) {
-      this.clearReset()
-      this.getHeight()
-    }
+    /*    if (this.data.readingReset) {
+         this.clearReset()
+         this.getHeight()
+       } */
     this.setData({
       'countDown.state': true
     })

+ 352 - 340
pages/reading/index.less

@@ -1,375 +1,387 @@
 .readingBox {
+  position: relative;
+  height: 100vh;
+  width: 100vw;
+  display: flex;
+  flex-direction: column;
+  background-color: white;
+
+  .poster {
+    top: 0px;
+    left: 0px;
+    position: absolute;
+    width: 100%;
+    height: 422rpx;
+    z-index: 10;
+  }
+
+  #myVideo {
+    width: 100%;
+    height: 422rpx;
+  }
+
+  .audio {
     position: relative;
-    height: 100vh;
-    width: 100vw;
-    display: flex;
-    flex-direction: column;
-    background-color: white;
+    width: 100%;
+    height: 422rpx;
+
+    .mask {
+      position: absolute;
+      width: 100%;
+      height: 100%;
+      left: 0px;
+      top: 0px;
+      background-color: rgba(0, 0, 0, 0.5);
+    }
 
-    .poster {
-        top: 0px;
-        left: 0px;
+    .audioBg {
+      width: 100%;
+      height: 100%;
+      filter: blur(12px);
+    }
+
+    .audioPlay {
+      position: absolute;
+      left: 0;
+      top: 0;
+      right: 0;
+      bottom: 0;
+      margin: auto;
+      border-radius: 20rpx;
+      background-size: cover;
+      background-color: rgba(0, 0, 0, 0.3);
+      display: flex;
+      align-items: center;
+      justify-content: center;
+
+      .audioPlayBg {
+        width: 200rpx;
+        height: 200rpx;
+      }
+
+      .audioPlayZhen {
         position: absolute;
-        width: 100%;
-        height: 422rpx;
-        z-index: 10;
+        right: 270rpx;
+        top: 118rpx;
+        width: 42rpx;
+        height: 50rpx;
+      }
+
+      .cover {
+        position: absolute;
+        width: 180rpx;
+        height: 180rpx;
+        border-radius: 50%;
+      }
+
+      .circle {
+        animation: identifier 12s infinite linear;
+      }
     }
+  }
+
+  .contentBox {
+    flex: 1;
+    width: 100%;
+    overflow: hidden;
+    position: relative;
 
-    #myVideo {
-        width: 100%;
-        height: 422rpx;
+    .articleMask {
+      position: absolute;
+      top: 0rpx;
+      width: 100%;
+      height: 80rpx;
+      z-index: 10;
+      background: linear-gradient(to bottom, rgb(255, 255, 255), rgba(255, 255, 255, 0.4))
     }
 
-    .audio {
-        position: relative;
-        width: 100%;
-        height: 422rpx;
-
-        .mask {
-            position: absolute;
-            width: 100%;
-            height: 100%;
-            left: 0px;
-            top: 0px;
-            background-color: rgba(0, 0, 0, 0.5);
-        }
+    .content {
+      width: 100%;
+      height: 100%;
+      padding: 0rpx 30rpx;
+      padding-bottom: calc(170rpx + env(safe-area-inset-bottom));
+      text-align: center;
+      box-sizing: border-box;
+
+      .row {
+        padding: 18rpx 0rpx;
+        font-size: 40rpx;
+      }
+
+      .currentRow {
+        font-weight: bold;
+        color: #019e45;
+      }
+
+      .article {
+        height: 2000rpx;
+        background-color: red;
+      }
+    }
+  }
 
-        .audioBg {
-            width: 100%;
-            height: 100%;
-            filter: blur(12px);
-        }
+  .controller {
+    width: 100%;
+    height: 110rpx;
+    position: absolute;
+    bottom: 0px;
+    left: 0px;
+    display: flex;
+    align-items: center;
+    flex-direction: column;
+    padding-bottom: env(safe-area-inset-bottom);
+    box-shadow: rgba(14, 30, 37, 0.12) 0px 2rpx 4rpx 0px, rgba(14, 30, 37, 0.32) 0px 2rpx 16rpx 0px;
+    background-color: white;
+    z-index: 10;
+
+    .readingNow {
+      position: absolute;
+      top: -62rpx;
+      border-radius: 50%;
+      width: 114rpx;
+      height: 114rpx;
+      padding: 26rpx;
+      box-sizing: border-box;
+      box-shadow: #4EC4FF 0px 0rpx 14rpx;
+      background-color: #4EC4FF;
+    }
 
-        .audioPlay {
-            position: absolute;
-            left: 0;
-            top: 0;
-            right: 0;
-            bottom: 0;
-            margin: auto;
-            border-radius: 20rpx;
-            background-size: cover;
-            background-color: rgba(0, 0, 0, 0.3);
-            display: flex;
-            align-items: center;
-            justify-content: center;
-
-            .audioPlayBg {
-                width: 200rpx;
-                height: 200rpx;
-            }
-
-            .audioPlayZhen {
-                position: absolute;
-                right: 270rpx;
-                top: 118rpx;
-                width: 42rpx;
-                height: 50rpx;
-            }
-
-            .cover {
-                position: absolute;
-                width: 180rpx;
-                height: 180rpx;
-                border-radius: 50%;
-            }
-
-            .circle {
-                animation: identifier 12s infinite linear;
-            }
-        }
+    .playImg {
+      position: absolute;
+      top: -62rpx;
+      border-radius: 50%;
+      width: 114rpx;
+      height: 114rpx;
+      box-shadow: #4EC4FF 0px 0rpx 14rpx;
+      background-color: #4EC4FF;
     }
 
-    .contentBox {
-        flex: 1;
-        width: 100%;
-        overflow: hidden;
-        position: relative;
-
-        .articleMask {
-            position: absolute;
-            top: 0rpx;
-            width: 100%;
-            height: 80rpx;
-            z-index: 10;
-            background: linear-gradient(to bottom, rgb(255, 255, 255), rgba(255, 255, 255, 0.4))
-        }
+    .text {
+      position: absolute;
+      top: 60rpx;
+      font-size: 28rpx;
+    }
 
-        .content {
-            width: 100%;
-            height: 100%;
-            padding: 0rpx 30rpx;
-            padding-bottom: calc(170rpx + env(safe-area-inset-bottom));
-            text-align: center;
-            box-sizing: border-box;
-
-            .row {
-                padding: 18rpx 0rpx;
-                font-size: 40rpx;
-            }
-
-            .currentRow {
-                font-weight: bold;
-                color: #019e45;
-            }
-
-            .article {
-                height: 2000rpx;
-                background-color: red;
-            }
-        }
+    .btnPosition {
+      position: absolute;
+      right: 30rpx;
+      top: 20rpx;
     }
+  }
+
+  .playImgBg {
+    position: absolute;
+    width: 134rpx;
+    height: 124rpx;
+    z-index: 1;
+    left: -1rpx;
+    right: 0px;
+    margin: auto;
+    bottom: calc(56rpx + env(safe-area-inset-bottom));
+    background-color: white;
+    box-shadow: rgba(14, 30, 37, 0.12) 0px 2rpx 4rpx 0px, rgba(14, 30, 37, 0.32) 0px 2rpx 16rpx 0px;
+    border-radius: 50%;
+  }
 
-    .controller {
-        width: 100%;
-        height: 110rpx;
-        position: absolute;
-        bottom: 0px;
-        left: 0px;
-        display: flex;
-        align-items: center;
-        flex-direction: column;
-        padding-bottom: env(safe-area-inset-bottom);
-        box-shadow: rgba(14, 30, 37, 0.12) 0px 2rpx 4rpx 0px, rgba(14, 30, 37, 0.32) 0px 2rpx 16rpx 0px;
-        background-color: white;
-        z-index: 10;
-
-        .playImg {
-            position: absolute;
-            top: -62rpx;
-            border-radius: 50%;
-            width: 114rpx;
-            height: 114rpx;
-            box-shadow: #4EC4FF 0px 0rpx 14rpx;
-            background-color: #4EC4FF;
-        }
+  .countDownBox {
+    position: fixed;
+    width: 100%;
+    height: 100%;
+    background-color: rgba(255, 255, 255, 0);
+    z-index: 999;
+
+    .countDown {
+      position: absolute;
+      left: 0rpx;
+      right: 0rpx;
+      top: 30%;
+      margin: auto;
+      width: 293rpx;
+      height: 293rpx;
+      border-radius: 30rpx;
+      color: white;
+      background-color: rgba(0, 0, 0, 0.8);
+      text-align: center;
+      padding: 30rpx 0rpx;
+      box-sizing: border-box;
+
+      .number {
+        font-size: 124rpx;
+        margin-bottom: 6rpx;
+      }
+    }
+  }
 
-        .text {
-            position: absolute;
-            top: 60rpx;
-            font-size: 28rpx;
-        }
 
-        .btnPosition {
-            position: absolute;
-            right: 30rpx;
-            top: 20rpx;
-        }
+  .uploadBox {
+    position: fixed;
+    top: 0px;
+    left: 0px;
+    width: 100%;
+    height: 100%;
+    background-color: rgba(255, 255, 255, 0);
+    z-index: 999;
+
+    .upload {
+      position: absolute;
+      left: 0rpx;
+      right: 0rpx;
+      top: 30%;
+      margin: auto;
+      width: 293rpx;
+      height: 293rpx;
+      border-radius: 30rpx;
+      color: white;
+      background-color: rgba(0, 0, 0, 0.8);
+      text-align: center;
+      padding: 0rpx 38rpx;
+      box-sizing: border-box;
+      font-size: 30rpx;
+      z-index: 998;
+
+      .speed {
+        margin-top: 70rpx;
+      }
+
+      .speedProgress {
+        border-radius: 50rpx;
+        overflow: hidden;
+        margin: 18rpx 0rpx 60rpx;
+      }
     }
+  }
+}
+
+.scoreBoxC {
+  flex: 1;
+  width: 100%;
+  overflow: auto;
+  position: relative;
+  padding-bottom: calc(170rpx + env(safe-area-inset-bottom));
+
+  .scoreBox {
+    width: 610rpx;
+    margin: 80rpx auto 0rpx;
+
+    .lightBox {
+      position: relative;
+      height: 180rpx;
 
-    .playImgBg {
+      .light {
         position: absolute;
-        width: 134rpx;
-        height: 124rpx;
-        z-index: 1;
-        left: -1rpx;
+        width: 360rpx;
+        height: 180rpx;
+        left: 0px;
         right: 0px;
         margin: auto;
-        bottom: calc(56rpx + env(safe-area-inset-bottom));
-        background-color: white;
-        box-shadow: rgba(14, 30, 37, 0.12) 0px 2rpx 4rpx 0px, rgba(14, 30, 37, 0.32) 0px 2rpx 16rpx 0px;
-        border-radius: 50%;
-    }
+      }
 
-    .countDownBox {
-        position: fixed;
-        width: 100%;
-        height: 100%;
-        background-color: rgba(255, 255, 255, 0);
-        z-index: 999;
-
-        .countDown {
-            position: absolute;
-            left: 0rpx;
-            right: 0rpx;
-            top: 30%;
-            margin: auto;
-            width: 293rpx;
-            height: 293rpx;
-            border-radius: 30rpx;
-            color: white;
-            background-color: rgba(0, 0, 0, 0.8);
-            text-align: center;
-            padding: 30rpx 0rpx;
-            box-sizing: border-box;
-
-            .number {
-                font-size: 124rpx;
-                margin-bottom: 6rpx;
-            }
-        }
+      .stars {
+        position: absolute;
+        width: 62rpx;
+        height: 62rpx;
+      }
+
+      .stars-1 {
+        top: 64rpx;
+        left: 132rpx;
+      }
+
+      .stars-2 {
+        top: 25rpx;
+        left: 198rpx;
+      }
+
+      .stars-3 {
+        top: 6rpx;
+        left: 276rpx;
+      }
+
+      .stars-4 {
+        top: 25rpx;
+        right: 198rpx;
+      }
+
+      .stars-5 {
+        top: 62rpx;
+        right: 132rpx;
+      }
     }
 
+    .score {
+      position: relative;
+      width: 100%;
+      box-sizing: border-box;
+      padding: 70rpx 40rpx 32rpx;
+      border-radius: 18rpx;
+      background-color: white;
+      box-shadow: rgba(255, 255, 255, 0.15) 0px 6px 12px -2px, rgba(255, 255, 255, 0.1) 0px 3px 7px -3px;
 
-    .uploadBox {
-        position: fixed;
-        top: 0px;
+      .avatarBox {
+        position: absolute;
+        top: -72rpx;
         left: 0px;
-        width: 100%;
-        height: 100%;
-        background-color: rgba(255, 255, 255, 0);
-        z-index: 999;
-
-        .upload {
-            position: absolute;
-            left: 0rpx;
-            right: 0rpx;
-            top: 30%;
-            margin: auto;
-            width: 293rpx;
-            height: 293rpx;
-            border-radius: 30rpx;
-            color: white;
-            background-color: rgba(0, 0, 0, 0.8);
-            text-align: center;
-            padding: 0rpx 38rpx;
-            box-sizing: border-box;
-            font-size: 30rpx;
-            z-index: 998;
-
-            .speed {
-                margin-top: 70rpx;
-            }
-
-            .speedProgress {
-                border-radius: 50rpx;
-                overflow: hidden;
-                margin: 18rpx 0rpx 60rpx;
-            }
+        right: 0px;
+        margin: 0 auto;
+        width: 100rpx;
+        height: 100rpx;
+        padding: 16rpx;
+        border-radius: 50%;
+        background-color: white;
+        font-size: 0px;
+
+        .avatar {
+          width: 100%;
+          height: 100%;
+          border-radius: 50%;
         }
-    }
-}
+      }
 
-.scoreBoxC {
-    flex: 1;
-    width: 100%;
-    overflow: auto;
-    position: relative;
-    padding-bottom: calc(170rpx + env(safe-area-inset-bottom));
-
-    .scoreBox {
-        width: 610rpx;
-        margin: 80rpx auto 0rpx;
-
-        .lightBox {
-            position: relative;
-            height: 180rpx;
-
-            .light {
-                position: absolute;
-                width: 360rpx;
-                height: 180rpx;
-                left: 0px;
-                right: 0px;
-                margin: auto;
-            }
-
-            .stars {
-                position: absolute;
-                width: 62rpx;
-                height: 62rpx;
-            }
-
-            .stars-1 {
-                top: 64rpx;
-                left: 132rpx;
-            }
-
-            .stars-2 {
-                top: 25rpx;
-                left: 198rpx;
-            }
-
-            .stars-3 {
-                top: 6rpx;
-                left: 276rpx;
-            }
-
-            .stars-4 {
-                top: 25rpx;
-                right: 198rpx;
-            }
-
-            .stars-5 {
-                top: 62rpx;
-                right: 132rpx;
-            }
+      .nickName {
+        font-size: 36rpx;
+        text-align: center;
+      }
+
+      .totalScore {
+        display: flex;
+        align-items: center;
+        justify-content: center;
+        margin-top: 26rpx;
+        font-size: 42rpx;
+
+        .num {
+          color: #58C5FF;
+          font-size: 42rpx;
         }
+      }
+
+      .progressBox {
+        margin-top: 50rpx;
+
+        .row {
+          display: flex;
+          align-items: center;
+          justify-content: space-between;
+          margin-bottom: 42rpx;
+
+          .name {
+            font-size: 32rpx;
+            width: 96rpx;
+          }
+
+          .progress {
+            width: 306rpx;
+            border-radius: 20rpx;
+            overflow: hidden;
+          }
 
-        .score {
-            position: relative;
-            width: 100%;
-            box-sizing: border-box;
-            padding: 70rpx 40rpx 32rpx;
-            border-radius: 18rpx;
-            background-color: white;
-            box-shadow: rgba(255, 255, 255, 0.15) 0px 6px 12px -2px, rgba(255, 255, 255, 0.1) 0px 3px 7px -3px;
-
-            .avatarBox {
-                position: absolute;
-                top: -72rpx;
-                left: 0px;
-                right: 0px;
-                margin: 0 auto;
-                width: 100rpx;
-                height: 100rpx;
-                padding: 16rpx;
-                border-radius: 50%;
-                background-color: white;
-                font-size: 0px;
-
-                .avatar {
-                    width: 100%;
-                    height: 100%;
-                    border-radius: 50%;
-                }
-            }
-
-            .nickName {
-                font-size: 36rpx;
-                text-align: center;
-            }
-
-            .totalScore {
-                display: flex;
-                align-items: center;
-                justify-content: center;
-                margin-top: 26rpx;
-                font-size: 42rpx;
-
-                .num {
-                    color: #58C5FF;
-                    font-size: 42rpx;
-                }
-            }
-
-            .progressBox {
-                margin-top: 50rpx;
-
-                .row {
-                    display: flex;
-                    align-items: center;
-                    justify-content: space-between;
-                    margin-bottom: 42rpx;
-
-                    .name {
-                        font-size: 32rpx;
-                        width: 96rpx;
-                    }
-
-                    .progress {
-                        width: 306rpx;
-                        border-radius: 20rpx;
-                        overflow: hidden;
-                    }
-
-                    .scoreInfo {
-                        font-size: 27rpx;
-                        color: #666666;
-                    }
-                }
-            }
+          .scoreInfo {
+            font-size: 27rpx;
+            color: #666666;
+          }
         }
+      }
     }
+  }
 
 }

+ 2 - 1
pages/reading/index.wxml

@@ -83,7 +83,8 @@
     </view>
   </view>
   <view class="controller">
-    <image src="{{state?'/static/readingNow.gif':'/static/work.png'}}" class="playImg" bindtap="setCountDown" />
+    <image wx:if="{{state}}" src="/static/readingNow.gif" class="readingNow" bindtap="setCountDown" />
+    <image wx:else src="/static/work.png" class="playImg" bindtap="setCountDown" />
     <view class="text">
       {{state?'完成录制':readingReset?'点击重录':readingType=='public'||readingType=='readMatch'?'开始朗读':'开始挑战'}}</view>
     <uploadFile wx:if="{{readingReset}}" class="btnPosition" />

+ 11 - 0
pages/reading/index.wxss

@@ -118,6 +118,17 @@
   background-color: white;
   z-index: 10;
 }
+.readingBox .controller .readingNow {
+  position: absolute;
+  top: -62rpx;
+  border-radius: 50%;
+  width: 114rpx;
+  height: 114rpx;
+  padding: 26rpx;
+  box-sizing: border-box;
+  box-shadow: #4EC4FF 0px 0rpx 14rpx;
+  background-color: #4EC4FF;
+}
 .readingBox .controller .playImg {
   position: absolute;
   top: -62rpx;

+ 1 - 1
pages/works/index.wxml

@@ -10,6 +10,6 @@
   <!-- 优秀作品展播及官方推荐列表组件 -->
   <worksList id="worksList" videoType="{{currentType=='1'?'pk':'my'}}" worksList="{{list}}" tabBarPadding='true'
     autoPlay='{{false}}' />
-  <emptyBg wx:if="{{list.length==0}}" message="{{currentType=='1'?'您还没有关注的用户哦':'您还没有作品哦,赶快去发表吧'}}"></emptyBg>
+  <emptyBg wx:if="{{nullList}}" message="{{currentType=='1'?'您还没有关注的用户哦':'您还没有作品哦,赶快去发表吧'}}"></emptyBg>
 </view>
 <canvas id='share' type="2d"> </canvas>

BIN
static/readingNow.gif


+ 35 - 36
utils/request.js

@@ -2,9 +2,9 @@ let baseUrl = null
 let oldUrl = null
 
 const {
-    miniProgram: {
-        envVersion
-    }
+  miniProgram: {
+    envVersion
+  }
 } = wx.getAccountInfoSync();
 // if (envVersion == 'develop') {
 baseUrl = 'https://reader-api.efunbox.cn/wx'
@@ -13,42 +13,41 @@ oldUrl = 'https://reader-api.efunbox.cn'
 //   baseUrl = 'https://reader-api.ai160.com/wx'
 //   oldUrl = 'https://reader-api.ai160.com'
 // }
-
 function request(url, method, data, oldBaseUrl = false) {
-    let header = {
-        'uid': wx.getStorageSync('uid') || ''
-    }
+  let header = {
+    'uid': wx.getStorageSync('uid') || ''
+  }
 
-    return new Promise((reslove, reject) => {
-        wx.request({
-            url: oldBaseUrl ? oldUrl + url : baseUrl + url,
-            method: method,
-            data: data,
-            header: header,
-            success: (result) => {
-                let {
-                    data: {
-                        code,
-                        data = {},
-                        message
-                    }
-                } = result
-                if (code == '200') {
-                    reslove(data)
-                } else if (code == '1102' || code == '1204') {
-                    wx.clearStorage()
-                } else {
-                    console.log(message);
-                    // reject(message)
-                }
-            },
-            fail: (res) => {
-                console.error(res)
-                reject(res)
-            },
-        })
+  return new Promise((reslove, reject) => {
+    wx.request({
+      url: oldBaseUrl ? oldUrl + url : baseUrl + url,
+      method: method,
+      data: data,
+      header: header,
+      success: (result) => {
+        let {
+          data: {
+            code,
+            data = {},
+            message
+          }
+        } = result
+        if (code == '200') {
+          reslove(data)
+        } else if (code == '1102' || code == '1204') {
+          wx.clearStorage()
+        } else {
+          console.log(message);
+          // reject(message)
+        }
+      },
+      fail: (res) => {
+        console.error(res)
+        reject(res)
+      },
     })
+  })
 }
 module.exports = {
-    request,
+  request,
 }