Kaynağa Gözat

开发tabbar和消息页面样式

bayi 1 yıl önce
ebeveyn
işleme
0430dc98ae

+ 9 - 9
custom-tab-bar/index.js

@@ -25,25 +25,25 @@ Component({
         selectedColor: "#32CA69",
         mask: false,
         listTab: [{
-            "pagePath": "/pages/message/index",
-            "text": "消息",
-            "iconPath": "/static/message.png",
-            "selectedIconPath": "/static/message2.png"
-        }, {
             "pagePath": "/pages/resource/index",
             "text": "资源",
             "iconPath": "/static/activity.png",
             "selectedIconPath": "/static/activity2.png"
         }, {
+            "pagePath": "/pages/works/index",
+            "text": "作品",
+            "iconPath": "/static/zp.png",
+            "selectedIconPath": "/static/zp2.png"
+        }, {
             "pagePath": "/pages/index/index",
             "text": "推荐",
             "iconPath": "/static/tj.png",
             "selectedIconPath": "/static/tj2.png"
         }, {
-            "pagePath": "/pages/works/index",
-            "text": "作品",
-            "iconPath": "/static/zp.png",
-            "selectedIconPath": "/static/zp2.png"
+            "pagePath": "/pages/message/index",
+            "text": "消息",
+            "iconPath": "/static/message.png",
+            "selectedIconPath": "/static/message2.png"
         }, {
             "pagePath": "/pages/my/index",
             "text": "我的",

+ 7 - 6
pages/childClassify/index.js

@@ -64,12 +64,13 @@ Page({
         });
         // 立刻更新
         this.storeBindings.updateStoreBindings();
-        console.log(this.data.userInfo);
-        if (options.grade && !this.data.userInfo.grade) {
-            setUserInfo({
-                grade: options.grade
-            }, 'put')
-        }
+        setTimeout(() => {
+            if (options.grade && !this.data.userInfo.grade) {
+                setUserInfo({
+                    grade: options.grade
+                }, 'put')
+            }
+        }, 1000)
     },
     // 获取分类的内容
     loadMore() {

+ 1 - 1
pages/message/index.js

@@ -44,7 +44,7 @@ Page({
   async onShow() {
     if (typeof this.getTabBar === 'function') {
       this.getTabBar().setData({
-        selected: 0
+        selected: 3
       })
     }
     this.getAuthorityMsg()

+ 11 - 15
pages/message/index.less

@@ -1,28 +1,24 @@
 @import "./index.skeleton.wxss";
 
-page {
-    background-color: white;
-}
-
 .messagePage {
     overflow: hidden;
     border-top-left-radius: 24rpx;
     border-top-right-radius: 24rpx;
-    background-color: white;
+    background-color: #F2F6FC;
 
 
     .input {
         display: flex;
         align-items: center;
         justify-content: space-between;
-        background-color: #F2F6FC;
+        background-color: white;
         font-size: 28rpx;
-        margin: 20rpx 30rpx 10rpx;
-        padding: 20rpx 40rpx;
-        border-radius: 26rpx;
+        margin: 30rpx 30rpx 10rpx;
+        padding: 16rpx 30rpx;
+        border-radius: 50rpx;
 
         .searchBtn {
-            padding: 6rpx 44rpx;
+            padding: 4rpx 44rpx;
             background: #00C657;
             border-radius: 40rpx;
 
@@ -51,18 +47,18 @@ page {
 
                 .avatar {
                     border-radius: 50rpx;
-                    width: 80rpx;
-                    height: 80rpx;
+                    width: 66rpx;
+                    height: 66rpx;
                     margin-right: 14rpx;
                 }
 
                 .name {
-                    font-size: 30rpx;
+                    font-size: 28rpx;
                 }
 
                 .unread {
                     top: -4rpx;
-                    left: 60rpx;
+                    left: 48rpx;
                     position: absolute;
                     width: 32rpx;
                     height: 32rpx;
@@ -78,7 +74,7 @@ page {
 
         .base {
             display: flex;
-            align-items: center;
+            align-items: flex-start;
             justify-content: space-between;
             padding: 20rpx 0rpx 20rpx 20rpx;
             border-bottom: 1rpx solid #D8D8D8;

+ 11 - 14
pages/message/index.wxss

@@ -205,27 +205,24 @@
   overflow: hidden;
   background-color: transparent;
 }
-page {
-  background-color: white;
-}
 .messagePage {
   overflow: hidden;
   border-top-left-radius: 24rpx;
   border-top-right-radius: 24rpx;
-  background-color: white;
+  background-color: #F2F6FC;
 }
 .messagePage .input {
   display: flex;
   align-items: center;
   justify-content: space-between;
-  background-color: #F2F6FC;
+  background-color: white;
   font-size: 28rpx;
-  margin: 20rpx 30rpx 10rpx;
-  padding: 20rpx 40rpx;
-  border-radius: 26rpx;
+  margin: 30rpx 30rpx 10rpx;
+  padding: 16rpx 30rpx;
+  border-radius: 50rpx;
 }
 .messagePage .input .searchBtn {
-  padding: 6rpx 44rpx;
+  padding: 4rpx 44rpx;
   background: #00C657;
   border-radius: 40rpx;
 }
@@ -251,16 +248,16 @@ page {
 }
 .messagePage .messageList .fixed .authority .avatar {
   border-radius: 50rpx;
-  width: 80rpx;
-  height: 80rpx;
+  width: 66rpx;
+  height: 66rpx;
   margin-right: 14rpx;
 }
 .messagePage .messageList .fixed .authority .name {
-  font-size: 30rpx;
+  font-size: 28rpx;
 }
 .messagePage .messageList .fixed .authority .unread {
   top: -4rpx;
-  left: 60rpx;
+  left: 48rpx;
   position: absolute;
   width: 32rpx;
   height: 32rpx;
@@ -273,7 +270,7 @@ page {
 }
 .messagePage .messageList .base {
   display: flex;
-  align-items: center;
+  align-items: flex-start;
   justify-content: space-between;
   padding: 20rpx 0rpx 20rpx 20rpx;
   border-bottom: 1rpx solid #D8D8D8;

+ 1 - 1
pages/resource/index.js

@@ -23,7 +23,7 @@ Page({
     onShow() {
         if (typeof this.getTabBar === 'function') {
             this.getTabBar().setData({
-                selected: 1
+                selected: 0
             })
         }
         this.getLocUserInfo()

+ 1 - 1
pages/works/index.js

@@ -26,7 +26,7 @@ Page({
   onShow() {
     if (typeof this.getTabBar === 'function') {
       this.getTabBar().setData({
-        selected: 3
+        selected: 1
       })
     }
     this.getLocUserInfo()

+ 3 - 3
utils/request.js

@@ -6,13 +6,13 @@ const {
         envVersion
     }
 } = wx.getAccountInfoSync();
-if (envVersion == 'develop') {
+/* if (envVersion == 'develop') {
     baseUrl = 'https://reader-api.efunbox.cn/wx'
     oldUrl = 'https://reader-api.efunbox.cn'
-} else {
+} else { */
     baseUrl = 'https://reader-api.ai160.com/wx'
     oldUrl = 'https://reader-api.ai160.com'
-}
+// }
 
 function request(url, method, data, oldBaseUrl = false, intercept = true) {
     let header = {