machinecat520 2 anos atrás
pai
commit
f3c1dfa835

+ 1 - 2
app.json

@@ -2,11 +2,10 @@
 {
 {
     "pages": [
     "pages": [
         "pages/stuNeed/stuNeed",
         "pages/stuNeed/stuNeed",
+        "pages/teachAuthentication/teachAuthentication",
         "pages/stuDetail/stuDetail",
         "pages/stuDetail/stuDetail",
         "pages/coursePublish/coursePublish",
         "pages/coursePublish/coursePublish",
-        "pages/teachAuthentication/teachAuthentication",
         "pages/stuList/stuList",
         "pages/stuList/stuList",
-        "pages/test/test",
         "pages/myInfo/myInfo",
         "pages/myInfo/myInfo",
         "pages/teacherList/teacherList",
         "pages/teacherList/teacherList",
         "pages/teachDetail/teachDetail",
         "pages/teachDetail/teachDetail",

+ 88 - 1
pages/stuNeed/stuNeed.js

@@ -5,7 +5,12 @@ Page({
      * 页面的初始数据
      * 页面的初始数据
      */
      */
     data: {
     data: {
-        chosedCourse:'',
+        stuName:'',     //学生姓名
+        stuPhoneNum:'',     //学生电话号码
+        stuWeChatNum:'',     //学生微信号码
+        chosedCourse:'',    //课程类别
+        showCourseTitle:false,    //课程类别是否展示
+        // 课程类别
         courseList:[
         courseList:[
             {
             {
                 name:"小学",
                 name:"小学",
@@ -60,6 +65,7 @@ Page({
                 choesd:false
                 choesd:false
             }
             }
         ],
         ],
+        // 课程细分
         courseDetail:[
         courseDetail:[
             [
             [
                 {
                 {
@@ -166,6 +172,7 @@ Page({
                 }
                 }
             ]
             ]
         ],
         ],
+        // 辅导方式
         position_type:[
         position_type:[
             {
             {
                 opType:'老师上门',
                 opType:'老师上门',
@@ -195,6 +202,86 @@ Page({
         
         
     },
     },
 
 
+    // 获取学生姓名
+    getStuName(e){
+        // console.log(e.detail.value)
+        this.setData({
+            stuName: e.detail.value
+        })
+        // console.log(this.data.stuName)
+    },
+
+    // 获取学生手机号码
+    getStuPhone(e){
+        this.setData({
+            stuPhoneNum:e.detail.value
+        })
+    },
+
+    //获取学生微信号码
+    getStuWeChat(e){
+        this.setData({
+            stuWeChatNum:e.detail.value
+        })
+    },
+    // 课程类别
+    // 选择课程类别(大类)
+    chooseCourseTitle(){
+        this.setData({
+            showCourseTitle:true
+        })
+    },
+    // 定义退出下拉选区的方法
+    hiddenCourseTitle(){
+        this.setData({
+            showCourseTitle:false
+        })
+    },
+    // 从下拉区选择内容
+    onChooseCourseTitle(e){
+        let index = e.currentTarget.dataset.index
+        let courseList = this.data.courseList
+        for(let i = 0;i < courseList.length;i++){
+            if(i == index){
+                courseList[i].chosed = !courseList[i].chosed
+            }else{
+                courseList[i].chosed = false
+            }
+        }
+        this.setData({
+            courseList
+        })
+    },
+    // 确定按钮的点击事件
+    confirmCourseTitle(){
+        let courseList = this.data.courseList
+        let index
+        for(let i = 0;i < courseList.length;i++){
+            if(courseList[i].chosed){
+                index = i
+            }
+        }
+        let chosedCourse = courseList[index]?.name || ''
+        this.setData({
+            chosedCourse
+        })
+        this.hiddenCourseTitle()
+    },
+    
+
+
+    // 提交
+    toSubmit(){
+        wx.setStorageSync('student', {
+            stuName: this.data.stuName,
+            stuPhoneNum: this.data.stuPhoneNum,
+            stuWeChatNum: this.data.stuWeChatNum
+        })
+        wx.showToast({
+            title: '提交成功',
+        })
+    },
+
     /**
     /**
      * 生命周期函数--监听页面初次渲染完成
      * 生命周期函数--监听页面初次渲染完成
      */
      */

+ 24 - 7
pages/stuNeed/stuNeed.wxml

@@ -4,23 +4,23 @@
         <!-- 学生姓名 -->
         <!-- 学生姓名 -->
         <view class="stuInfo">
         <view class="stuInfo">
             <view class="stuInfo-title">姓<text decode="true">&emsp;&emsp;</text>名*:</view>
             <view class="stuInfo-title">姓<text decode="true">&emsp;&emsp;</text>名*:</view>
-            <input class="stuInput" type="text" placeholder="您的姓名" />
+            <input class="stuInput" type="text" placeholder="您的姓名" bindinput="getStuName" />
         </view>
         </view>
         <!-- 学生手机号 -->
         <!-- 学生手机号 -->
         <view class="stuInfo">
         <view class="stuInfo">
             <view class="stuInfo-title">手机号码*:</view>
             <view class="stuInfo-title">手机号码*:</view>
-            <input class="stuInput" type="number" placeholder="手机号码" />
+            <input class="stuInput" type="number" placeholder="手机号码" bindinput="getStuPhone" />
         </view>
         </view>
         <!-- 学生微信号 -->
         <!-- 学生微信号 -->
         <view class="stuInfo">
         <view class="stuInfo">
             <view class="stuInfo-title">微<text decode="true">&ensp;</text>信<text decode="true">&ensp;</text>号*:</view>
             <view class="stuInfo-title">微<text decode="true">&ensp;</text>信<text decode="true">&ensp;</text>号*:</view>
-            <input class="stuInput" type="text" placeholder="微信号(不便接听电话时微信沟通)" />
+            <input class="stuInput" type="text" placeholder="微信号(不便接听电话时微信沟通)" bindinput="getStuWeChat" />
         </view>
         </view>
         <!-- 课程大类 -->
         <!-- 课程大类 -->
         <view class="stuInfo">
         <view class="stuInfo">
             <view>课程类别*:</view>
             <view>课程类别*:</view>
-            <view class="stuCourse-wrapper">
-                <view class="stuCourse">{{chosedCourse || '请选择课程'}}</view>
+            <view class="stuCourse-wrapper" bindtap="chooseCourseTitle">
+                <view class="stuCourse">{{chosedCourse || '请选择课程类别'}}</view>
                 <view class="iconfont icon-xiangxia"></view>
                 <view class="iconfont icon-xiangxia"></view>
             </view>
             </view>
         </view>
         </view>
@@ -139,7 +139,24 @@
     </view>
     </view>
 
 
     <!-- 提交按钮 -->
     <!-- 提交按钮 -->
-    <button class="submitBtn" type="primary">提交</button>
+    <button class="submitBtn" type="primary" bindtap="toSubmit">提交</button>
 </view>
 </view>
 <!-- 底部空白区域,为了增加间隔效果,避免提交按钮完全贴着底边 -->
 <!-- 底部空白区域,为了增加间隔效果,避免提交按钮完全贴着底边 -->
-<view class="blank"></view>
+<view class="blank"></view>
+
+<!-- 课程类别(大类) -->
+<view wx:if="{{showCourseTitle}}">
+    <!-- 空白区(背景) -->
+    <view class="mask" bindtap="hiddenCourseTitle"></view>
+    <!-- 内容区 -->
+    <view class="courseTitle-wrapper">
+        <view class="courseTitle-head">
+            <view bindtap="hiddenEdu" bindtap="hiddenCourseTitle">取消</view>
+            <view bindtap="confirmEdu" bindtap="confirmCourseTitle">确定</view>
+        </view>
+        <view class="courseTitle-content" wx:for="{{courseList}}" wx:key="key" bindtap="onChooseCourseTitle" data-index="{{index}}">
+            <view style="position: absolute;left: 40rpx;">{{item.name}}</view>
+            <image style="position: absolute;right: 40rpx;" src="{{item.chosed?'/images/selected.png':'/images/selectNull.png'}}"></image>
+        </view>
+    </view>
+</view>

+ 45 - 0
pages/stuNeed/stuNeed.wxss

@@ -124,4 +124,49 @@
 /* 底部空白区域 */
 /* 底部空白区域 */
 .blank{
 .blank{
     height: 50rpx;
     height: 50rpx;
+}
+
+/* 课程类别下拉内容 */
+/* 空白区(背景) */
+.mask{
+    z-index: 2;
+    background-color: rgba(0,0,0,.3);
+    position: fixed;
+    top: 0;
+    left: 0;
+    right: 0;
+    bottom: 0;
+}
+/* 内容区 */
+.courseTitle-wrapper{
+    z-index: 3;
+    width: 100%;
+    /* height: 500rpx; */
+    background-color: #fff;
+    position: fixed;
+    bottom: 0;
+}
+/*下拉选项内容区标题部分  */
+.courseTitle-head{
+    background-color: rgb(230,230, 230);
+    display: flex;
+    height: 80rpx;
+    line-height: 80rpx;
+    align-content: center;
+    justify-content: space-between;
+    padding-right: 40rpx;
+    padding-left: 40rpx;
+}
+/* 下拉选项内容区 */
+.courseTitle-content{
+    width: 100%;
+    height: 80rpx;
+    display: flex;
+    align-items: center;
+    justify-content: space-around;
+    border-bottom: 1rpx solid gray;
+}
+.courseTitle-content image{
+    width: 50rpx;
+    height: 50rpx;
 }
 }

+ 121 - 27
pages/teachAuthentication/teachAuthentication.js

@@ -5,22 +5,27 @@ Page({
      * 页面的初始数据
      * 页面的初始数据
      */
      */
     data: {
     data: {
-        phoneNum: '',
-        weChatNum: '',
-        englishName: '',
-        nameFirst: '',
-        nameLast: '',
-        idNum: '',
-        sex: '',
-        chosedTeachAttr: '',
-        showIdAttr: false,
-        shcool: '',
-        major: '',
-        chosedEducation: '',
-        showEdu: false,
-        province: '',
-        city: '',
-        county: '',
+        phoneNum: '', //电话号码
+        weChatNum: '', //微信号码
+        englishName: '', //英文名称
+        nameFirst: '', //老师的姓
+        nameLast: '', //老师的名字
+        idNum: '', //身份证号
+        sex: '', //性别,根据输入的身份证号自动判断
+        idImgFontPath: '', //身份证正面照片的地址
+        idImgBackPath: '', //身份证背面照片的地址
+        diplomaPath:'',     //毕业证书照片的地址
+        stuCardPath:'',     //学生证照片的地址
+        headImgPath:'',     //头像照片的地址
+        chosedTeachAttr: '', //老师的身份
+        showIdAttr: false, //老师的身份选项是否展示
+        shcool: '', //毕业后就读的学校
+        major: '', //所学专业
+        chosedEducation: '', //学历
+        showEdu: false, //学历的选项是否展示
+        province: '', //籍贯的省份
+        city: '', //籍贯的城市
+        county: '', //籍贯的区县
         // 老师身份列表
         // 老师身份列表
         attributeList: [{
         attributeList: [{
                 'attr': '专职老师',
                 'attr': '专职老师',
@@ -134,6 +139,95 @@ Page({
         // console.log(this.data.sex)
         // console.log(this.data.sex)
     },
     },
 
 
+    // 选择身份证的正面照片
+    chooseIdFront() {
+        let that = this
+        wx.chooseMedia({
+            count: 1,
+            mediaType: ['image'],
+            sourceType: ['album', 'camera'],
+            sizeType:['compressed'],
+            success(res) {
+                //   console.log(res.tempFiles[0].tempFilePath)
+                  console.log(res.tempFiles[0].size)
+                that.setData({
+                    idImgFontPath: res.tempFiles[0].tempFilePath
+                })
+            }
+        })
+    },
+
+    // 选择身份证的背面照片
+    chooseIdBack() {
+        let that = this
+        wx.chooseMedia({
+            count: 1,
+            mediaType: ['image'],
+            sourceType: ['album', 'camera'],
+            // sizeType:['compressed'],
+            success(res) {
+                //   console.log(res.tempFiles[0].tempFilePath)
+                  console.log(res.tempFiles[0].size)
+                that.setData({
+                    idImgBackPath: res.tempFiles[0].tempFilePath
+                })
+            }
+        })
+    },
+
+    // 选择毕业证
+    chooseDiploma(){
+        let that = this
+        wx.chooseMedia({
+            count: 1,
+            mediaType: ['image'],
+            sourceType: ['album', 'camera'],
+            // sizeType:['compressed'],
+            success(res) {
+                //   console.log(res.tempFiles[0].tempFilePath)
+                  console.log(res.tempFiles[0].size)
+                that.setData({
+                    diplomaPath: res.tempFiles[0].tempFilePath
+                })
+            }
+        })
+    },
+
+    // 选择学生证
+    chooseStuCard(){
+        let that = this
+        wx.chooseMedia({
+            count: 1,
+            mediaType: ['image'],
+            sourceType: ['album', 'camera'],
+            // sizeType:['compressed'],
+            success(res) {
+                //   console.log(res.tempFiles[0].tempFilePath)
+                  console.log(res.tempFiles[0].size)
+                that.setData({
+                    stuCardPath: res.tempFiles[0].tempFilePath
+                })
+            }
+        })
+    },
+    // 选择头像
+    chooseHeadImg(){
+        let that = this
+        wx.chooseMedia({
+            count: 1,
+            mediaType: ['image'],
+            sourceType: ['album', 'camera'],
+            // sizeType:['compressed'],
+            success(res) {
+                //   console.log(res.tempFiles[0].tempFilePath)
+                  console.log(res.tempFiles[0].size)
+                that.setData({
+                    headImgPath: res.tempFiles[0].tempFilePath
+                })
+            }
+        })
+    },
+
     // 选择老师身份属性
     // 选择老师身份属性
     chooseTeachAttr() {
     chooseTeachAttr() {
         this.setData({
         this.setData({
@@ -316,7 +410,7 @@ Page({
         }
         }
         // 判断身份是否为空
         // 判断身份是否为空
         let chosedTeachAttr = this.data.chosedTeachAttr
         let chosedTeachAttr = this.data.chosedTeachAttr
-        if(!chosedTeachAttr){
+        if (!chosedTeachAttr) {
             wx.showToast({
             wx.showToast({
                 title: '您还未选择身份',
                 title: '您还未选择身份',
                 icon: 'none'
                 icon: 'none'
@@ -325,7 +419,7 @@ Page({
         }
         }
         // 判断学校是否为空
         // 判断学校是否为空
         let school = this.data.school
         let school = this.data.school
-        if(!school){
+        if (!school) {
             wx.showToast({
             wx.showToast({
                 title: '学校不能为空',
                 title: '学校不能为空',
                 icon: 'none'
                 icon: 'none'
@@ -334,7 +428,7 @@ Page({
         }
         }
         // 判断专业是否为空
         // 判断专业是否为空
         let major = this.data.major
         let major = this.data.major
-        if(!major){
+        if (!major) {
             wx.showToast({
             wx.showToast({
                 title: '专业不能为空',
                 title: '专业不能为空',
                 icon: 'none'
                 icon: 'none'
@@ -344,15 +438,15 @@ Page({
         // 判断学历
         // 判断学历
         let chosedEducation = this.data.chosedEducation
         let chosedEducation = this.data.chosedEducation
         // 学历不能为空
         // 学历不能为空
-        if(!chosedEducation){
+        if (!chosedEducation) {
             wx.showToast({
             wx.showToast({
                 title: '您还未选择学历',
                 title: '您还未选择学历',
                 icon: 'none'
                 icon: 'none'
             })
             })
             return
             return
         }
         }
-        if(chosedTeachAttr == '专职老师'){
-            if(chosedEducation == '博士在读' || chosedEducation == '硕士在读' || chosedEducation == '本科在读' || chosedEducation == '专科在读'){
+        if (chosedTeachAttr == '专职老师') {
+            if (chosedEducation == '博士在读' || chosedEducation == '硕士在读' || chosedEducation == '本科在读' || chosedEducation == '专科在读') {
                 wx.showToast({
                 wx.showToast({
                     title: '学历与身份不符',
                     title: '学历与身份不符',
                     icon: 'none'
                     icon: 'none'
@@ -360,8 +454,8 @@ Page({
                 return
                 return
             }
             }
         }
         }
-        if(chosedTeachAttr == '在校大学生'){
-            if(chosedEducation == '博士毕业' || chosedEducation == '硕士毕业' || chosedEducation == '本科毕业' || chosedEducation == '专科毕业'){
+        if (chosedTeachAttr == '在校大学生') {
+            if (chosedEducation == '博士毕业' || chosedEducation == '硕士毕业' || chosedEducation == '本科毕业' || chosedEducation == '专科毕业') {
                 wx.showToast({
                 wx.showToast({
                     title: '学历与身份不符',
                     title: '学历与身份不符',
                     icon: 'none'
                     icon: 'none'
@@ -372,7 +466,7 @@ Page({
         // 判断籍贯是否为空
         // 判断籍贯是否为空
         // 判断省份是否为空
         // 判断省份是否为空
         let province = this.data.province
         let province = this.data.province
-        if(!province){
+        if (!province) {
             wx.showToast({
             wx.showToast({
                 title: '省份不能为空',
                 title: '省份不能为空',
                 icon: 'none'
                 icon: 'none'
@@ -381,7 +475,7 @@ Page({
         }
         }
         // 判断地市是否为空
         // 判断地市是否为空
         let city = this.data.city
         let city = this.data.city
-        if(!city){
+        if (!city) {
             wx.showToast({
             wx.showToast({
                 title: '地市不能为空',
                 title: '地市不能为空',
                 icon: 'none'
                 icon: 'none'
@@ -390,7 +484,7 @@ Page({
         }
         }
         // 判断区县是否为空
         // 判断区县是否为空
         let county = this.data.county
         let county = this.data.county
-        if(!county){
+        if (!county) {
             wx.showToast({
             wx.showToast({
                 title: '区县不能为空',
                 title: '区县不能为空',
                 icon: 'none'
                 icon: 'none'

+ 10 - 5
pages/teachAuthentication/teachAuthentication.wxml

@@ -40,11 +40,13 @@
         <text class="explain">说明:需要能看清楚证件号码、日期及头像,否则审核不通过</text>
         <text class="explain">说明:需要能看清楚证件号码、日期及头像,否则审核不通过</text>
         <view class="idImagUp">
         <view class="idImagUp">
             <view class="idImag">
             <view class="idImag">
-                <text class="iconfont icon-tupian"></text>
+                <text wx:if="{{!idImgFontPath}}" class="idImgContainer iconfont icon-tupian" bindtap="chooseIdFront"></text>
+                <image wx:else src="{{idImgFontPath}}" class="idImgContainer" bindtap="chooseIdFront"></image>
                 <text>身份证正面</text>
                 <text>身份证正面</text>
             </view>
             </view>
             <view class="idImag">
             <view class="idImag">
-                <text class="iconfont icon-tupian"></text>
+                <text wx:if="{{!idImgBackPath}}" class="idImgContainer iconfont icon-tupian" bindtap="chooseIdBack"></text>
+                <image wx:else src="{{idImgBackPath}}" class="idImgContainer" bindtap="chooseIdBack"></image>
                 <text>身份证背面</text>
                 <text>身份证背面</text>
             </view>
             </view>
         </view>
         </view>
@@ -53,19 +55,22 @@
     <view class="myCard">
     <view class="myCard">
         <text>毕业证*:</text>
         <text>毕业证*:</text>
         <text class="explain">需要能看清楚证书编号</text>
         <text class="explain">需要能看清楚证书编号</text>
-        <text class="iconfont icon-tupian"></text>
+        <text wx:if="{{!diplomaPath}}" class="ImgContainer iconfont icon-tupian" bindtap="chooseDiploma"></text>
+        <image wx:else src="{{diplomaPath}}" class="ImgContainer" bindtap="chooseDiploma"></image>
     </view>
     </view>
     <!-- 学生证照片上传 -->
     <!-- 学生证照片上传 -->
     <view class="myCard">
     <view class="myCard">
         <text>学生证*:</text>
         <text>学生证*:</text>
         <text class="explain">需要能看清头像</text>
         <text class="explain">需要能看清头像</text>
-        <text class="iconfont icon-tupian"></text>
+        <text wx:if="{{!stuCardPath}}" class="ImgContainer iconfont icon-tupian" bindtap="chooseStuCard"></text>
+        <image wx:else src="{{stuCardPath}}" class="ImgContainer" bindtap="chooseStuCard"></image>
     </view>
     </view>
     <!-- 头像照片上传 -->
     <!-- 头像照片上传 -->
     <view class="myHead">
     <view class="myHead">
         <text>头像:</text>
         <text>头像:</text>
         <text class="explain">(说明:只能上传证件照,上传其他照片审核不予通过)</text>
         <text class="explain">(说明:只能上传证件照,上传其他照片审核不予通过)</text>
-        <text class="iconfont icon-tupian"></text>
+        <text wx:if="{{!headImgPath}}" class="ImgContainer iconfont icon-tupian" bindtap="chooseHeadImg"></text>
+        <image wx:else src="{{headImgPath}}"  class="ImgContainer" bindtap="chooseHeadImg"></image>
     </view>
     </view>
     <!-- 老师的身份 -->
     <!-- 老师的身份 -->
     <view class="idAttribute">
     <view class="idAttribute">

+ 14 - 5
pages/teachAuthentication/teachAuthentication.wxss

@@ -66,16 +66,23 @@
     width: 45%;
     width: 45%;
     
     
 }
 }
+.idImgContainer{
+    height: 200rpx;
+    width: 100%;
+    border: 1rpx solid gray;
+}
 .idImag .iconfont{
 .idImag .iconfont{
     display: block;
     display: block;
-    height: 200rpx;
-    border: 1rpx solid red;
+    /* height: 200rpx; */
+    /* border: 1rpx solid red; */
     line-height: 200rpx;
     line-height: 200rpx;
     font-size: 100rpx;
     font-size: 100rpx;
     color: gray;
     color: gray;
     margin-bottom: 20rpx;
     margin-bottom: 20rpx;
 }
 }
+
 .idImag text{
 .idImag text{
+    margin-top: 10rpx;
     text-align: center;
     text-align: center;
 }
 }
 
 
@@ -87,12 +94,14 @@
     flex-direction: column;
     flex-direction: column;
 
 
 }
 }
+.ImgContainer{
+    width: 50%;
+    height: 200rpx;
+    border: 1rpx solid gray;
+}
 .myCard .iconfont,
 .myCard .iconfont,
 .myHead .iconfont{
 .myHead .iconfont{
     display: block;
     display: block;
-    width: 50%;
-    height: 200rpx;
-    border: 1rpx solid red;
     line-height: 200rpx;
     line-height: 200rpx;
     font-size: 100rpx;
     font-size: 100rpx;
     color: gray;
     color: gray;