Procházet zdrojové kódy

'完成我的页面'

machinecat520 před 2 roky
rodič
revize
4e7d7a2f47
5 změnil soubory, kde provedl 173 přidání a 142 odebrání
  1. 1 1
      app.json
  2. binární
      images/right.png
  3. 9 66
      pages/myInfo/myInfo.js
  4. 78 25
      pages/myInfo/myInfo.wxml
  5. 85 50
      pages/myInfo/myInfo.wxss

+ 1 - 1
app.json

@@ -1,9 +1,9 @@
 
 {
     "pages": [
+        "pages/myInfo/myInfo",
         "pages/receivedInvitation/receivedInvitation",
         "pages/sendInvitation/sendInvitation",
-        "pages/myInfo/myInfo",
         "pages/stuList/stuList",
         "pages/teachAuthentication/teachAuthentication",
         "pages/stuCollectionTeach/stuCollectionTeach",

binární
images/right.png


+ 9 - 66
pages/myInfo/myInfo.js

@@ -15,13 +15,6 @@ Page({
 
     },
 
-    //退出登录
-    exitLogin(){
-        wx.redirectTo({
-          url: '/pages/login/login',
-        })
-    },
-
     //跳转到我发出的邀请详情
     sendInvitation(){
        wx.navigateTo({
@@ -36,77 +29,27 @@ Page({
           })
     },
 
-    //跳转到我的课程
-    myLessons(){
-        wx.redirectTo({
-          url: '/pages/index/index',
-        })
-    },
-
-    //跳转到我的需求
-    myNeed(){
-        wx.redirectTo({
-          url: '/pages/stuNeed/stuNeed',
-        })
-    },
-
-    //跳转到我收藏的老师
-    myTeacher(){
-        wx.redirectTo({
-          url: '/pages/stuCollectionTeach/stuCollectionTeach',
-        })
-    },
-
-    //跳转到我收藏的学生
-    myStudent(){
-        wx.redirectTo({
-          url: '/pages/teachCollectionStu/teachCollectionStu',
-        })
-    },
-
-    //跳转到我的投诉
-    myComplaint(){
-        wx.redirectTo({
-          url: '/pages/index/index',
-        })
-    },
-
-    //跳转到我的建议
-    mySuggest(){
-        wx.redirectTo({
-          url: '/pages/index/index',
-        })
-    },
-
-    //跳转到退款记录
-    refund(){
-        wx.redirectTo({
-          url: '/pages/index/index',
-        })
-    },
-
     //跳转到老师认证
     teacherAuthentication(){
-        wx.redirectTo({
+        wx.navigateTo({       
           url: '/pages/teachAuthentication/teachAuthentication',
         })
     },
 
-    //跳转到删除账号
-    delete(){
-        wx.redirectTo({
-          url: '/pages/index/index',
+    // 跳转到发布新的课程页面
+    toCoursePublish(){
+        wx.navigateTo({
+          url: '/pages/coursePublish/coursePublish',
         })
     },
 
-    //跳转到推荐返现
-    cashBack(){
-        wx.redirectTo({
-          url: '/pages/index/index',
+    //跳转到发布新的需求页面
+    toNeedPublis(){
+        wx.navigateTo({
+          url: '/pages/stuNeed/stuNeed',
         })
     },
 
-
     /**
      * 生命周期函数--监听页面初次渲染完成
      */

+ 78 - 25
pages/myInfo/myInfo.wxml

@@ -1,29 +1,82 @@
 <!--pages/myInfo/myInfo.wxml-->
 
 <view class="wrapper">
-    <view class="top-index">
-        <view class="top-title">
-            <image src="../../images/zly.jpeg"></image>
-            <text class="top-nick">你好</text>
-        </view>
-        <text class="top-text" bindtap="exitLogin">退出账号</text>
-    </view>
-    <view class="infoList">
-        <text class="infoList-text" bindtap="sendInvitation">我发出的邀请</text>
-        <text class="infoList-text" bindtap="receivedInvitation">我收到的邀请</text>
-        <text class="infoList-text" bindtap="myLessons">我的订单</text>
-        <text class="infoList-text" bindtap="myNeed">我的需求</text>
-        <text class="infoList-text" bindtap="myTeacher">我收藏的老师</text>
-        <text class="infoList-text" bindtap="myStudent">我收藏的学生</text>
-        <text class="infoList-text" bindtap="myComplaint">我的投诉</text>
-        <text class="infoList-text" bindtap="mySuggest">我的建议</text>
-        <text class="infoList-text" bindtap="refund">退款记录</text>
-        <text class="infoList-text" bindtap="teacherAuthentication">老师认证</text>
-        <text class="infoList-text" bindtap="delete">删除账号</text>
-    </view>
-    <view class="recommendMoney">
-        <text bindtap="cashBack">推荐返现</text>
-    </view>
-    <button class="suggest" open-type="feedback">反馈建议</button>
-
+    <!-- 上方头像和昵称区域 -->
+    <view class="headWrapper">
+        <image class="headImg" src="../../images/zly.jpeg"></image>
+        <view class="headNick">
+            <view class="userNickName">机器猫</view>
+            <view class="userId">ID:20221222</view>
+        </view>
+        <image class="rightArrow" src="../../images/right.png"></image>
+    </view>
+    <!-- 推荐分享 -->
+    <view class="recommend">
+        <view>推荐分享</view>
+        <image class="rightArrow" src="../../images/right.png"></image>
+    </view>
+    <!-- 订单 -->
+    <view class="orderList">
+        <view>订单</view>
+        <image class="rightArrow" src="../../images/right.png"></image>
+    </view>
+    <!-- 收到和发出的邀请 -->
+    <view class="invitation">
+        <view class="myInvitation" bindtap="sendInvitation">
+            <view>发出的邀请</view>
+            <image class="rightIcon" src="../../images/right.png"></image>
+        </view>
+        <view class="myInvitation" bindtap="receivedInvitation">
+            <view>收到的邀请</view>
+            <image class="rightIcon" src="../../images/right.png"></image>
+        </view>
+    </view>
+    <!-- 收藏的需求和课程 -->
+    <view class="collection">
+        <view class="myCollected">
+            <view>已收藏的需求</view>
+            <image class="rightIcon" src="../../images/right.png"></image>
+        </view>
+        <view class="myCollected">
+            <view>已收藏的课程</view>
+            <image class="rightIcon" src="../../images/right.png"></image>
+        </view>
+    </view>
+    <!-- 教员认证和课程发布 -->
+    <view class="teachCourse">
+        <view class="teachCourseDetail">
+            <view>教员认证</view>
+            <image class="rightArrow" src="../../images/right.png"></image>
+        </view>
+        <view class="teachCourseDetail" bindtap="toCoursePublish">
+            <view>发布新的课程</view>
+            <image class="rightArrow" src="../../images/right.png"></image>
+        </view>
+        <view class="teachCourseDetail">
+            <view>已发布的课程</view>
+            <image class="rightArrow" src="../../images/right.png"></image>
+        </view>
+    </view>
+    <!-- 我的需求 -->
+    <view class="myNeed">
+        <view class="myNeedDetail" bindtap="toNeedPublis">
+            <view>发布新的需求</view>
+            <image class="rightArrow" src="../../images/right.png"></image>
+        </view>
+        <view class="teachCourseDetail">
+            <view>已发布的需求</view>
+            <image class="rightArrow" src="../../images/right.png"></image>
+        </view>
+    </view>
+    <!-- 建议和投诉 -->
+    <view class="suggest">
+        <view class="suggestDetail">
+            <view>我的建议</view>
+            <image class="rightArrow" src="../../images/right.png"></image>
+        </view>
+        <view class="suggestDetail">
+            <view>我的投诉</view>
+            <image class="rightArrow" src="../../images/right.png"></image>
+        </view>
+    </view>
 </view>

+ 85 - 50
pages/myInfo/myInfo.wxss

@@ -1,76 +1,111 @@
 /* pages/myInfo/myInfo.wxss */
+
+/* 设置本页面背景样式 */
 .wrapper {
     position: relative;
+    padding:20rpx;
+    background-color: #E2F0D9;
 }
 
-.top-index {
-    display: flex;
-    height: 100rpx;
-    line-height: 100rpx;
-    background-color: #f8f8f8;
-}
-
-.top-title {
+/* 顶部头像和昵称区域 */
+.headWrapper{
     display: flex;
-    width: 80%;
+    height: 180rpx;
+    background-color: #FFF2CC;
+    border-radius: 20rpx;
+    align-items: center;
 }
 
-.top-index image {
-    width: 100rpx;
-    height: 100rpx;
+/* 头像 */
+.headImg{
+    width: 120rpx;
+    height: 120rpx;
     border-radius: 50%;
+    margin-left: 20rpx;    
 }
 
-.top-nick {
-    height: 100rpx;
-    line-height: 100rpx;
-    padding-left: 20rpx;
+/* 昵称和ID区域 */
+.headNick{
+    margin-left: 40rpx;
 }
 
-.top-text {
-    margin-top: 20rpx;
-    margin-left: 4rpx;
+.userNickName,
+.userId{
     height: 60rpx;
     line-height: 60rpx;
-    border: 1rpx solid rgb(207, 202, 202);
+}
+/* 昵称 */
+.userNickName{
+    font-weight: bold;
+}
+/* ID */
+.userId{
+    color: red;
+}
+
+/* 箭头样式 */
+.rightArrow{
+    position: absolute;
+    height: 40rpx;
+    width: 40rpx;
+    right: 40rpx;
+}
+/* 推荐分享 */
+.recommend,
+.orderList{
+    display: flex;
+    height: 80rpx;
+    line-height: 80rpx;
+    margin-top: 20rpx;
+    padding-left: 20rpx;
+    background-color: #FFF2CC;
     border-radius: 20rpx;
-    padding: 0 6rpx;
-    color: #c0b0b0;
+    align-items: center;
 }
 
-/* 主页容器 */
-.infoList{
-    position: relative;
+/* 邀请和收藏 */
+.invitation,
+.collection{
     display: flex;
-    flex-wrap: wrap;
-    width: 100%;
+    justify-content: space-between;
 }
 
-/* 主页内容区 */
-.infoList-text{
-    width: 47%;
-    height: 100rpx;
-    line-height: 100rpx;
-    text-align: center;
-    background-color: rgb(241, 241, 235);
-    margin: 10rpx 10rpx 0 10rpx;
+.myInvitation,
+.myCollected{
+    width: 45%;
+    display: flex;
+    height: 80rpx;
+    line-height: 80rpx;
+    align-items: center;
+    background-color: #FFF2CC;
+    margin-top: 20rpx;
+    padding-left: 20rpx;
+    border-radius: 20rpx;
+    position: relative;
 }
 
-/* 推荐返现 */
-.recommendMoney{
-    /* position: relative;
-    display: flex; */
-    margin-top: 100rpx;
-    height: 100rpx;
-    line-height: 100rpx;
-    text-align: center;
-    font-size: 40rpx;
-    font-weight: bold;
-    background-color: rgb(241, 241, 235);
-    color: red;
+/* 邀请和收藏的箭头 */
+.rightIcon{
+    height: 40rpx;
+    width: 40rpx;
+    position: absolute;
+    right: 30rpx;
 }
 
-/* 反馈建议 */
+/* 教员认证和课程发布、我的需求、投诉和建议样式 */
+.teachCourse,
+.myNeed,
 .suggest{
-    margin-top: 20rpx;
-}
+    background-color: #FFF2CC;
+    border-radius: 20rpx;
+    margin-top: 20rpx;    
+    padding: 20rpx 0 20rpx 20rpx;
+}
+.teachCourseDetail,
+.myNeedDetail,
+.suggestDetail{
+    display: flex;
+    height: 80rpx;
+    line-height: 80rpx;
+    align-items: center;
+}