Explorar o código

'完成我发出的要求和收到的邀请详情页'

machinecat520 %!s(int64=2) %!d(string=hai) anos
pai
achega
3a75bd3c66

+ 6 - 4
app.json

@@ -1,15 +1,17 @@
 
 {
     "pages": [
+        "pages/receivedInvitation/receivedInvitation",
+        "pages/sendInvitation/sendInvitation",
+        "pages/myInfo/myInfo",
         "pages/stuList/stuList",
+        "pages/teachAuthentication/teachAuthentication",
+        "pages/stuCollectionTeach/stuCollectionTeach",
+        "pages/coursePublish/coursePublish",
         "pages/teacherList/teacherList",
-        "pages/myInfo/myInfo",
         "pages/stuNeed/stuNeed",
-        "pages/coursePublish/coursePublish",
-        "pages/teachAuthentication/teachAuthentication",
         "pages/stuDetail/stuDetail",
         "pages/teachDetail/teachDetail",
-        "pages/stuCollectionTeach/stuCollectionTeach",
         "pages/teachCollectionStu/teachCollectionStu",
         "pages/login/login",
         "pages/index/index"

+ 12 - 12
pages/myInfo/myInfo.js

@@ -22,18 +22,18 @@ Page({
         })
     },
 
-    //跳转到我的预约
-    myAppointment(){
-        wx.redirectTo({
-          url: '/pages/index/index',
-        })
-    },
-
-    //跳转到我被预约
-    appointment(){
-        wx.redirectTo({
-          url: '/pages/index/index',
-        })
+    //跳转到我发出的邀请详情
+    sendInvitation(){
+       wx.navigateTo({
+         url: '/pages/sendInvitation/sendInvitation',
+       })
+    },
+
+    //跳转到我收到的邀请详情
+    receivedInvitation(){
+        wx.navigateTo({
+            url: '/pages/receivedInvitation/receivedInvitation',
+          })
     },
 
     //跳转到我的课程

+ 2 - 2
pages/myInfo/myInfo.wxml

@@ -9,8 +9,8 @@
         <text class="top-text" bindtap="exitLogin">退出账号</text>
     </view>
     <view class="infoList">
-        <text class="infoList-text" bindtap="myAppointment">我的邀请</text>
-        <text class="infoList-text" bindtap="appointment">我被邀请</text>
+        <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>

+ 121 - 0
pages/receivedInvitation/receivedInvitation.js

@@ -0,0 +1,121 @@
+// pages/receivedInvitation/receivedInvitation.js
+Page({
+
+    /**
+     * 页面的初始数据
+     */
+    data: {
+        oprerateState:'待定',   //我方操作状态
+        needState:'',   //需求号状态
+        courseState:'', //课程号状态
+        needColor:'',   //需求号链接的颜色
+        courseColor:''  //课程号链接的颜色
+    },
+
+    // 跳转到需求详情
+    toNeedDetail() {
+        let needState = this.data.needState
+        if(!needState){
+            wx.navigateTo({
+                url: '/pages/stuNeed/stuNeed',
+            })
+        }else if(needState == '已锁'){
+            wx.showModal({
+              title:'提示',
+              content:'需求已锁定,不能操作'
+            })
+        }else if(needState == '下架'){
+            wx.showModal({
+                title:'提示',
+                content:'需求已下架,不能操作'
+              })
+        }
+    },
+
+    // 跳转到课程详情
+    toCourseDetail() {
+        let courseState = this.data.courseState
+        if(!courseState){
+            wx.navigateTo({
+                url: '/pages/stuNeed/stuNeed',
+            })
+        }else if(courseState == '已锁'){
+            wx.showModal({
+                title:'提示',
+                content:'课程已锁定,不能操作'
+              })
+        }else if(courseState == '下架'){
+            wx.showModal({
+                title:'提示',
+                content:'课程已下架,不能操作'
+              })
+        }
+    },
+
+    /**
+     * 生命周期函数--监听页面加载
+     */
+    onLoad(options) {
+        // 加载页面时根据状态重置需求号链接的颜色
+        if(this.data.needState){
+            this.setData({
+                needColor:'#808080'
+            })
+        }
+        // 加载页面时根据状态重置课程号链接的颜色
+        if(this.data.courseState){
+            this.setData({
+                courseColor:'#808080'
+            })
+        }
+    },
+
+    /**
+     * 生命周期函数--监听页面初次渲染完成
+     */
+    onReady() {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面显示
+     */
+    onShow() {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面隐藏
+     */
+    onHide() {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面卸载
+     */
+    onUnload() {
+
+    },
+
+    /**
+     * 页面相关事件处理函数--监听用户下拉动作
+     */
+    onPullDownRefresh() {
+
+    },
+
+    /**
+     * 页面上拉触底事件的处理函数
+     */
+    onReachBottom() {
+
+    },
+
+    /**
+     * 用户点击右上角分享
+     */
+    onShareAppMessage() {
+
+    }
+})

+ 4 - 0
pages/receivedInvitation/receivedInvitation.json

@@ -0,0 +1,4 @@
+{
+    "usingComponents": {},
+    "navigationBarTitleText": "我收到的邀请详情"
+}

+ 58 - 0
pages/receivedInvitation/receivedInvitation.wxml

@@ -0,0 +1,58 @@
+<!--pages/receivedInvitation/receivedInvitation.wxml-->
+
+<view class="wrapper">
+    <!-- 上方邀请号和照片 -->
+    <view class="above">
+        <view>
+            <view class="aboveTitle">
+                <text>邀请号:</text>
+                <text>XXXXXX</text>
+            </view>
+            <view class="aboveTitle">
+                <text>对方:</text>
+                <text>XXXXXX</text>
+            </view>
+        </view>
+        <!-- 头像 -->
+        <image class="headerPortrait" mode="widthFix" src="../../images/zly.jpeg"></image>
+    </view>
+     <!-- 中间详细信息 -->
+     <view>
+        <view class="midTitle">
+            <text>对方ID:</text>
+            <text>xxxxxxx</text>
+        </view>
+        <view class="midTitle">
+            <text>需求号:</text>
+            <text class="toLink" bindtap="toNeedDetail" style="color: {{needColor}};">xxxxxx</text>
+            <text class="needState">{{needState}}</text>
+        </view>
+        <view class="midTitle">
+            <text>课程号:</text>
+            <text class="toLink" bindtap="toCourseDetail" style="color: {{courseColor}};">xxxxxx</text>
+            <text class="needState">{{courseState}}</text>
+        </view>
+        <view class="midTitle">
+            <text>需求金额:</text>
+            <text>xxxxxx</text>
+        </view>
+        <view class="midTitle">
+            <text>邀请内容:</text>
+            <text>xxxxxx</text>
+        </view>
+    </view>
+    <view class="bottomWrapper">
+        <view class="bottomTitle">
+            <text>邀请日期:</text>
+            <text>2022-12-12</text>
+        </view>
+        <view class="bottomTitle">
+            <text>我方操作状态:</text>
+            <text class="operateState">{{oprerateState}}</text>
+        </view>
+    </view>
+    <view class="operation" wx:if="{{oprerateState == '待定' && !needState && !courseState}}">
+        <view class="operationBtn">拒绝</view>
+        <view class="operationBtn">同意</view>
+    </view>
+</view>

+ 71 - 0
pages/receivedInvitation/receivedInvitation.wxss

@@ -0,0 +1,71 @@
+/* pages/receivedInvitation/receivedInvitation.wxss */
+
+/* 设置背景 */
+.wrapper{
+    width: 100%;
+    height: 100%;
+    background-color: #FFF2CC;
+    padding: 20rpx;
+}
+
+/* 上方邀请号和照片 */
+.above{
+    display: flex;
+    width: 95%;
+    justify-content: space-between;
+}
+
+/* 上方、中间左侧文字 */
+.aboveTitle,
+.midTitle,
+.bottomTitle{
+    padding-bottom: 20rpx;
+}
+
+/* 头像 */
+.headerPortrait{
+    width: 200rpx;
+}
+
+/* 设置链接样式 */
+.toLink{
+    color: skyblue;
+    text-decoration: underline;
+}
+
+/* 需求号和课程号状态 */
+.needState{
+    padding-left: 30rpx;
+    color: red;
+    font-weight: bold;
+}
+
+/* 设置操作状态字体 */
+.operateState{
+    font-weight: bold;
+    color: red;
+}
+
+.bottomWrapper{
+    margin-top: 140rpx;
+}
+
+/* 底部按钮 */
+.operation{
+    display: flex;
+    justify-content: space-around;
+    margin-top: 120rpx;
+}
+
+/* 按钮 */
+.operationBtn{
+    width: 160rpx;
+    height: 60rpx;
+    line-height: 60rpx;
+    text-align: center;
+    border: 1rpx solid #5B9BD5;
+    border-radius: 30rpx;
+    font-size: 40rpx;
+    background-color: #5B9BD5;
+    color: white;
+}

+ 80 - 0
pages/sendInvitation/sendInvitation.js

@@ -0,0 +1,80 @@
+// pages/sendInvitation/sendInvitation.js
+Page({
+
+    /**
+     * 页面的初始数据
+     */
+    data: {
+
+    },
+
+    // 跳转到需求详情
+    toNeedDetail(){
+        wx.navigateTo({
+          url: '/pages/stuNeed/stuNeed',
+        })
+    },
+
+    // 跳转到课程详情
+    toCourseDetail(){
+        wx.navigateTo({
+            url: '/pages/stuNeed/stuNeed',
+          })
+    },
+
+    /**
+     * 生命周期函数--监听页面加载
+     */
+    onLoad(options) {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面初次渲染完成
+     */
+    onReady() {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面显示
+     */
+    onShow() {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面隐藏
+     */
+    onHide() {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面卸载
+     */
+    onUnload() {
+
+    },
+
+    /**
+     * 页面相关事件处理函数--监听用户下拉动作
+     */
+    onPullDownRefresh() {
+
+    },
+
+    /**
+     * 页面上拉触底事件的处理函数
+     */
+    onReachBottom() {
+
+    },
+
+    /**
+     * 用户点击右上角分享
+     */
+    onShareAppMessage() {
+
+    }
+})

+ 4 - 0
pages/sendInvitation/sendInvitation.json

@@ -0,0 +1,4 @@
+{
+    "usingComponents": {},
+    "navigationBarTitleText": "我发出的邀请详情"
+}

+ 56 - 0
pages/sendInvitation/sendInvitation.wxml

@@ -0,0 +1,56 @@
+<!--pages/sendInvitation/sendInvitation.wxml-->
+
+<view class="wrapper">
+    <!-- 上方邀请号和照片 -->
+    <view class="above">
+        <view>
+            <view class="aboveTitle">
+                <text>邀请号:</text>
+                <text>XXXXXX</text>
+            </view>
+            <view class="aboveTitle">
+                <text>对方:</text>
+                <text>XXXXXX</text>
+            </view>
+        </view>
+        <!-- 头像 -->
+        <image class="headerPortrait" mode="widthFix" src="../../images/zly.jpeg"></image>
+    </view>
+    <!-- 中间详细信息 -->
+    <view>
+        <view class="midTitle">
+            <text>对方ID:</text>
+            <text>xxxxxxx</text>
+        </view>
+        <view class="midTitle">
+            <text>需求号:</text>
+            <text class="toLink" bindtap="toNeedDetail">xxxxxx</text>
+        </view>
+        <view class="midTitle">
+            <text>课程号:</text>
+            <text class="toLink" bindtap="toCourseDetail">xxxxxx</text>
+        </view>
+        <view class="midTitle">
+            <text>需求金额:</text>
+            <text>xxxxxx</text>
+        </view>
+        <view class="midTitle">
+            <text>邀请内容:</text>
+            <text>xxxxxx</text>
+        </view>
+    </view>
+    <view class="bottomWrapper">
+        <view class="bottomTitle">
+            <text>邀请日期:</text>
+            <text>2022-12-12</text>
+        </view>
+        <view class="bottomTitle">
+            <text>对方阅读状态:</text>
+            <text class="operateState">未读</text>
+        </view>
+        <view class="bottomTitle">
+            <text>对方操作状态:</text>
+            <text class="operateState">未读</text>
+        </view>
+    </view>
+</view>

+ 44 - 0
pages/sendInvitation/sendInvitation.wxss

@@ -0,0 +1,44 @@
+/* pages/sendInvitation/sendInvitation.wxss */
+
+/* 设置背景 */
+.wrapper{
+    width: 100%;
+    height: 100%;
+    background-color: #FFF2CC;
+    padding: 20rpx;
+}
+
+/* 上方邀请号和照片 */
+.above{
+    display: flex;
+    width: 95%;
+    justify-content: space-between;
+}
+
+/* 上方、中间左侧文字 */
+.aboveTitle,
+.midTitle,
+.bottomTitle{
+    padding-bottom: 20rpx;
+}
+
+/* 头像 */
+.headerPortrait{
+    width: 200rpx;
+}
+
+.bottomWrapper{
+    margin-top: 160rpx;
+}
+
+/* 设置链接样式 */
+.toLink{
+    color: skyblue;
+    text-decoration: underline;
+}
+
+/* 设置操作状态字体 */
+.operateState{
+    font-weight: bold;
+    color: red;
+}