yukangzhe 3 years ago
parent
commit
55907e09b3

+ 1 - 1
pages/Components/selectDate/selectDate.wxss

@@ -4,7 +4,7 @@
   background: #005033;
   color: #FFF;
   text-align: center;
-  font-size: 36rpx;
+  font-size: 32rpx;
   position: fixed;
   width: 750rpx;
   z-index: 3;

+ 1 - 1
pages/addClass/addClass.wxss

@@ -13,7 +13,7 @@ page{
   color: #FFF;
   background: #005033;
   text-align: center;
-  font-size: 36rpx;
+  font-size: 32rpx;
 }
 
 .loading {

+ 1 - 1
pages/classOrder/classOrder.wxml

@@ -5,7 +5,7 @@
         <view class="order-type">{{item.orderType == 2 ? '练琴卡' : (item.kindId == 1 ?'1v1' : '集体')}}</view>
         <view class="order-name">{{item.classesName}}
                 <block wx:if="{{item.refundStatus == 4}}">[已退款]</block>
-        </view>
+        </view> 
         <view class="order-nums" wx:if="{{item.orderType == 1}}">× {{item.nums}}次 ({{item.classesTimes}}课时)</view>
         <view class="order-nums" wx:if="{{item.orderType == 2}}">× {{item.nums}}(天)</view>
         <view class="order-addr">{{item.address}}</view>

+ 22 - 2
pages/doTask/doTask.js

@@ -29,6 +29,13 @@ Page({
 
   getRecord: function () {
     const that = this
+    if(that.data.audioList.length>=6){
+      wx.showToast({
+        title: '最多上传6段录音',
+        icon: 'none'
+      })
+      return
+    }
     if (that.data.talkFlag) {
       recordManager.stop()
       recordManager.onStop((res) => {  //监听录音停止的事件
@@ -152,7 +159,13 @@ Page({
 
   uploadTap: function () {
     const that = this
-
+    if(that.data.imgList.length>=6){
+      wx.showToast({
+        title: '最多上传6张图片',
+        icon: 'none'
+      })
+      return
+    }
     wx.chooseImage({
       count: 6,
       sourceType: ['album', 'camera'],
@@ -219,6 +232,13 @@ Page({
 
   upLoadVideo: function () {
     const that = this
+    if(that.data.videoList.length>=6){
+      wx.showToast({
+        title: '最多上传6部视频',
+        icon: 'none'
+      })
+      return
+    }
     wx.chooseVideo({
       camera: ['album'],
       success(res) {
@@ -452,7 +472,7 @@ Page({
    * 生命周期函数--监听页面卸载
    */
   onUnload: function () {
-
+    audioContext.stop()
   },
 
   /**

+ 2 - 1
pages/doTask/doTask.wxss

@@ -210,8 +210,9 @@
   background: #cc6031;
   border-radius: 50rpx;
   font-size: 36rpx;
-  position: fixed;
+  position: relative;
   bottom: 40rpx;
   left: 50%;
   margin-left: -200rpx;
+  margin-top: 60rpx;
 }

+ 1 - 1
pages/editMyself/editMyself.wxml

@@ -1,7 +1,7 @@
 <view class="container">
   <view class="edit-box">
     <view class="title">头像</view>
-    <view class="headImg" bindtap="changeHead">
+    <view class="headImg">
       <image src="{{src}}"></image>
     </view>
     <view class="title">姓名</view>

+ 2 - 2
pages/evaluation/evaluation.wxss

@@ -18,7 +18,7 @@ page{
  width: 646rpx;
  background: #FFF;
  margin: 20rpx auto 40rpx;
- border-left: 4rpx solid #cc6031;
+ border-left: 4rpx solid #005033;
  border-radius: 15rpx;
  display: flex;
  flex-wrap: wrap;
@@ -27,7 +27,7 @@ page{
 }
 .flag{
   color: #FFF;
-  background: #cc6031;
+  background: #005033;
   line-height: 30rpx;
   height: 30rpx;
   margin-top: 20rpx;

+ 29 - 24
pages/evaluationDetail/evaluationDetail.js

@@ -2,6 +2,8 @@
 const app = getApp()
 const util = require("../../utils/util")
 const urlDef = require("../../utils/urls")
+
+const audioContext = wx.createInnerAudioContext() //音频播放对象
 Page({
 
   /**
@@ -63,34 +65,38 @@ Page({
 
   showImg: function (e) {
     // var list = e.currentTarget.dataset.url
+    const index = e.currentTarget.dataset.index
     wx.previewImage({
+      current: this.data.imgList[index],
       urls: this.data.imgList,
     })
   },
 
-  audioShow: function (e) {
-    if (this.data.audioPause == 0 && this.data.curAudioIndex != e.currentTarget.dataset.index) {//播放语音,切换
-      this.setData({
-        curAudio: ""
-      })
-      this.setData({
-        curAudioIndex: e.currentTarget.dataset.index,
-        curAudio: e.currentTarget.dataset.url,
-      })
-      this.audioContext.play()
-      this.setData({
-        audioPause: 0
-      })
-    } else if (this.data.audioPause == 1 && this.data.curAudioIndex == e.currentTarget.dataset.index) {//暂停后恢复播放
-      this.audioContext.play()
+  showAudio: function (e) {
+    const index = e.currentTarget.dataset.index
+    if (this.data.curAudioIndex != index) {
       this.setData({
-        audioPause: 0
+        curAudioIndex: index,
       })
-    } else if (this.data.audioPause == 0 && this.data.curAudioIndex == e.currentTarget.dataset.index) {//暂停播放
-      this.audioContext.pause()
-      this.setData({
-        audioPause: 1
+      audioContext.src = this.data.item.records[index].url
+      audioContext.play()
+      audioContext.onEnded((res) => {
+        this.setData({
+          curAudioIndex: '-1',
+        })
       })
+    } else {
+      if (this.data.audioPause) {
+        audioContext.play()
+        this.setData({
+          audioPause: false
+        })
+      } else {
+        audioContext.pause()
+        this.setData({
+          audioPause: true
+        })
+      }
     }
   },
 
@@ -113,7 +119,6 @@ Page({
    * 生命周期函数--监听页面加载
    */
   onLoad: function (options) {
-    this.audioContext = wx.createAudioContext('audio-play')
     this.videoContext = wx.createVideoContext('play-video');// 	创建 video 上下文 VideoContext 对象。
     const urls = urlDef.urls;
     let it = JSON.parse(options.item)
@@ -137,8 +142,8 @@ Page({
     }
 
     let stu = wx.getStorageSync('student')
-    util.apiPost(urls.query_student_star + '&q.orgId=' + stu.orgId + '&q.studentId='
-      + stu.studentId + '&q.headId=' + it.id).then((st) => {
+    util.apiPost(urls.query_student_star + '&q.orgId=' + stu.orgId + '&q.classesId='  + it.classesId + '&q.studentId=' 
+      + stu.studentId + '&q.headId=' + it.headId).then((st) => {
         it.stars = st;
         this.reloadItems(it)
       }, e => {
@@ -196,7 +201,7 @@ Page({
    * 生命周期函数--监听页面卸载
    */
   onUnload: function () {
-
+    audioContext.stop()
   },
 
   /**

+ 3 - 4
pages/evaluationDetail/evaluationDetail.wxml

@@ -17,7 +17,7 @@
     <view class="teacher-name">张老师</view>
   </view>
   <view class="stars">
-      <rating wx:for="{{item.stars}}" wx:for-item="star" score="{{star.evaluateStar}}" title="{{star.detailName}}"/>
+      <rating wx:for="{{item.stars}}" wx:key="index" wx:for-item="star" score="{{star.evaluateStar}}" title="{{star.detailName}}"/>
     </view>
   <view class="class-desc">
     点评内容:{{item.evaluateContent}}
@@ -28,7 +28,7 @@
   <view class="img-content">
     <view class="title">图片</view>
     <view class="img-box">
-      <image src="{{item.url}}" wx:for="{{item.images}}" wx:key="index" bindtap="showImg" data-url="{{item.url}}"></image>
+      <image src="{{item.url}}" wx:for="{{item.images}}" wx:key="index" bindtap="showImg" data-index="{{index}}" data-url="{{item.url}}"></image>
     </view>
   </view>
 
@@ -47,11 +47,10 @@
   <view class="audio-content">
     <view class="title">语音</view>
     <view class="audio-list">
-      <image bindtap="audioShow" src="{{index == curAudioIndex ? '/images/cur-audio.png' : '/images/audio.png'}}"
+      <image bindtap="showAudio" src="{{index == curAudioIndex ? '/images/cur-audio.png' : '/images/audio.png'}}"
         class="{{index == curAudioIndex ? 'curAudioStyle' : ''}}" wx:for="{{item.records}}" wx:key="index"
         data-index="{{index}}" data-url="{{item}}"></image>
     </view>
-    <audio id="audio-play" bindpause="bindpause" bindended="bindended" src="{{curAudio}}"></audio>
   </view>
   <!-- end -->
 

+ 4 - 4
pages/evaluationDetail/evaluationDetail.wxss

@@ -8,9 +8,9 @@
   line-height: 60rpx;
   width: 750rpx;
   color: #FFF;
-  background: #cc6031;
+  background: #005033;
   text-align: center;
-  font-size: 36rpx;
+  font-size: 32rpx;
 }
 .class-title{
   display: flex;
@@ -21,7 +21,7 @@
     width: 700rpx;
 }
 .class-type{
-  background: #cc6031;
+  background: #005033;
     color: #FFF;
     height: 30rpx;
     line-height: 30rpx;
@@ -51,7 +51,7 @@
 }
 .contact-teacher{
   margin-left: auto;
-  color: #cc6031;
+  color: #005033;
 }
 .class-desc{
   padding: 15rpx 25rpx;

+ 25 - 23
pages/growUp/growUp.js

@@ -2,6 +2,8 @@
 const app = getApp()
 const util = require("../../utils/util")
 const urlDef = require("../../utils/urls")
+
+const audioContext = wx.createInnerAudioContext() //音频播放对象
 Page({
 
   /**
@@ -62,30 +64,31 @@ Page({
       current: e.currentTarget.dataset.url
     })
   },
-  audioShow: function (e) {
-    if (this.data.audioPause == 0 && this.data.curAudioIndex != e.currentTarget.dataset.index) {//播放语音,切换
-      this.setData({
-        curAudio: ""
-      })
-      this.setData({
-        curAudioIndex: e.currentTarget.dataset.index,
-        curAudio: e.currentTarget.dataset.url,
-
-      })
-      this.audioContext.play()
-      this.setData({
-        audioPause: 0
-      })
-    } else if (this.data.audioPause == 1 && this.data.curAudioIndex == e.currentTarget.dataset.index) {//暂停后恢复播放
-      this.audioContext.play()
+  showAudio: function (e) {
+    const url = e.currentTarget.dataset.url
+    if (this.data.curAudioIndex != url) {
       this.setData({
-        audioPause: 0
+        curAudioIndex: url,
       })
-    } else if (this.data.audioPause == 0 && this.data.curAudioIndex == e.currentTarget.dataset.index) {//暂停播放
-      this.audioContext.pause()
-      this.setData({
-        audioPause: 1
+      audioContext.src = url
+      audioContext.play()
+      audioContext.onEnded((res) => {
+        this.setData({
+          curAudioIndex: '-1',
+        })
       })
+    } else {
+      if (this.data.audioPause) {
+        audioContext.play()
+        this.setData({
+          audioPause: false
+        })
+      } else {
+        audioContext.pause()
+        this.setData({
+          audioPause: true
+        })
+      }
     }
   },
 
@@ -114,7 +117,6 @@ Page({
       sid = stu.studentId
       oid = stu.orgId
     }
-    this.audioContext = wx.createAudioContext('audio-play')
     this.videoContext = wx.createVideoContext('play-video');// 	创建 video 上下文 VideoContext 对象。
     this.setData({ studentId: sid, orgId: oid })
     this.queryList()
@@ -145,7 +147,7 @@ Page({
    * 生命周期函数--监听页面卸载
    */
   onUnload: function () {
-
+    audioContext.stop()
   },
 
   /**

+ 1 - 2
pages/growUp/growUp.wxml

@@ -28,9 +28,8 @@
 
             <view class="title">语音</view>
             <view class="audio-list">
-              <image  wx:for="{{item.records}}"  bindtap="audioShow" src="{{index == curAudioIndex ? '/images/cur-audio.png' : '/images/audio.png'}}" class="{{index == curAudioIndex ? 'curAudioStyle' : ''}}" wx:key="index" data-index="{{index}}" data-url="{{item.url}}"></image>
+              <image  wx:for="{{item.records}}"  bindtap="showAudio" src="{{item.url == curAudioIndex ? '/images/cur-audio.png' : '/images/audio.png'}}" class="{{item.url == curAudioIndex ? 'curAudioStyle' : ''}}" wx:key="index" data-index="{{index}}" data-url="{{item.url}}"></image>
             </view>
-            <audio id="audio-play" bindpause="bindpause" bindended="bindended" src="{{curAudio}}"></audio>
            </view>
           <view class="grow-desc">来自课后点评</view>
         </view>

+ 1 - 1
pages/growUp/growUp.wxss

@@ -115,7 +115,7 @@
 }
 
 .curAudioStyle {
-  box-shadow: 0 0 20rpx #005033 !important;
+  box-shadow: 0 0 20rpx #cc6031 !important;
   border: none;
 }
 

+ 1 - 0
pages/index/index.wxss

@@ -32,6 +32,7 @@
   line-height: 60rpx;
   text-align: center;
   width: 350rpx;
+  font-size: 28rpx;
 }
 
 .stuHead {

+ 1 - 1
pages/myself/myself.js

@@ -18,7 +18,7 @@ Page({
 
   callPhone(){
     wx.makePhoneCall({
-      phoneNumber: '13222222222',
+      phoneNumber: '4006991077',
       fail(res){
         console.log('取消拨打')
       }

+ 8 - 2
pages/orderClassDetail/orderClassDetail.js

@@ -12,7 +12,8 @@ Page({
     cid: null,
     order: {},
     items: [],
-    images: []
+    images: [],
+    item: null
 
   },
 
@@ -45,13 +46,18 @@ Page({
     }
     util.apiPost(urls.get_order, params).then(rs => {
       if (rs != null) {
+        rs[0].payDate = this.renderTime(rs[0].payDate)
         this.setData({ items: rs, order: rs[0] })
-
         this.queryContract()
       }
     })
   },
 
+  renderTime:function(date) {
+    var dateee = new Date(date).toJSON();
+    return new Date(+new Date(dateee) + 8 * 3600 * 1000).toISOString().replace(/T/g, ' ').replace(/\.[\d]{3}Z/, '') 
+  },
+
   /**
    * 生命周期函数--监听页面初次渲染完成
    */

+ 9 - 9
pages/orderClassDetail/orderClassDetail.wxml

@@ -1,25 +1,25 @@
 <view class="container">
   <view class="detail-title">
-    <view class="order-name">小象钢琴</view>
-    <view class="order-money">¥ 5500.00</view>
+    <view class="order-name">{{order.classesName}}</view>
+    <view class="order-money">¥ {{order.classesTotalAmount}}</view>
   </view>
   <view class="class-detail">
     <view class="class-title">校区名称:</view>
-    <view class="class-name detail">智慧汉阳校区</view>
+    <view class="class-name detail">{{order.orgName}}</view>
     <view class="class-title">课程类型:</view>
-    <view class="class-type detail">一对一</view>
+    <view class="class-type detail">{{order.classesKind}}</view>
     <view class="class-title">课程次数:</view>
-    <view class="class-nums detail">48次(48课时)</view>
+    <view class="class-nums detail">{{order.classesTimes}}次({{order.classesTimes}}课时)</view>
     <view class="class-title">课程有效期:</view>
-    <view class="class-valid detail">2021-02-10 至 2021-03-01</view>
+    <view class="class-valid detail">{{order.beginDate}} 至 {{order.endDate}}</view>
   </view>
   <view class="order-detail">
     <view class="order-title">订单号:</view>
-    <view class="order-num detail">1512323523ADXZ123</view>
+    <view class="order-num detail">{{order.orderNum}}</view>
     <view class="order-title">下单时间:</view>
-    <view class="order-payTime detail">2021-02-21 19:21</view>
+    <view class="order-payTime detail">{{order.payDate}}</view>
     <view class="order-title">支付方式:</view>
-    <view class="order-payType detail">现金</view>
+    <view class="order-payType detail">{{order.payTypes}}</view>
     <view class="order-title">我的合同:</view>
     <view class="order-contract detail" bindtap="showImg">查看合同</view>
   </view>

+ 7 - 1
pages/quan/quan.wxml

@@ -42,12 +42,18 @@
             </view>
             <view class="oilline linwidth227 lineBt"></view>
 
-            <view class="moveCm btnbx" wx:if="status == '0'"> 
+            <view class="moveCm btnbx" wx:if="{{status == '0' && item.flag == 0}}"> 
               <view class="btnw btnBgActive" bindtap="submitCilck" data-index="{{index}}">
                 <view class="btnn">立即领取</view>
               </view>
             </view>
 
+            <view class="btnbx" wx:if="{{status == '0' && item.flag!= 0}}"> 
+              <view class="btnw btnBgActive">
+                <view class="btnn-ed">已领取</view>
+              </view>
+            </view>
+
             <view class="moveCm-ed btnbx-ed"  wx:elif="status != '0'">
               <view class="btnw btnBgGray">
                 <view wx:if="{{item.couponStatus == 1}}" class="btnn-ed">可使用</view>

+ 1 - 1
pages/student/student.wxml

@@ -76,7 +76,7 @@
   </view>
   <image class="bgImg step-three" mode="widthFix"
     src="https://app.schoolwisdoms.com/static/app/student/imgs/invitation-c3.png"></image>
-  <view class="total-view" wx:for="{{invitations}}">
+  <view class="total-view" wx:for="{{invitations}}" wx:key="index">
     <view>{{item.name}}</view>
     <view>{{item.subDate}}</view>
     <view>{{item.statusText}}</view>

+ 5 - 1
pages/task/task.js

@@ -30,8 +30,12 @@ Page({
   },
 
   doTask: function (e) {
+    let type =0
+    if(this.data.doName != '做作业'){
+      type = 1
+    }
     wx.navigateTo({
-      url: '/pages/taskDetail/taskDetail?id=' + e.currentTarget.dataset.id,
+      url: '/pages/taskDetail/taskDetail?id=' + e.currentTarget.dataset.id+"&type=" + type,
     })
   },
 

+ 3 - 3
pages/taskDetail/taskDetail.js

@@ -3,7 +3,7 @@ const app = getApp()
 const util = require("../../utils/util")
 const urlDef = require("../../utils/urls")
 
-// const recordManager = wx.getRecorderManager() //录音对象
+const recordManager = wx.getRecorderManager() //录音对象
 const audioContext = wx.createInnerAudioContext() //音频播放对象
 Page({
 
@@ -85,7 +85,7 @@ Page({
       this.setData({
         curAudioIndex: index,
       })
-      audioContext.src = this.data.audioList[index]
+      audioContext.src = this.data.entity.records[index].url
       audioContext.play()
       audioContext.onEnded((res) => {
         this.setData({
@@ -164,7 +164,7 @@ Page({
    * 生命周期函数--监听页面卸载
    */
   onUnload: function () {
-
+    audioContext.stop()
   },
 
   /**

+ 3 - 5
pages/taskDetail/taskDetail.wxml

@@ -8,7 +8,7 @@
 
   <view class="task-teacher">
     <view class="taskImg">
-      <image src="{{teacherFace}}"></image>
+      <image src="/images/head.png"></image>
     </view>
     <view class="teacher-name">授课教师: {{entity.teacherName}}</view>
   </view>
@@ -34,10 +34,8 @@
 
     <view class="title">语音</view>
     <view class="audio-list">
-      <image bindtap="audioShow" src="{{index == curAudioIndex ? '/images/cur-audio.png' : '/images/audio.png'}}" class="{{index == curAudioIndex ? 'curAudioStyle' : ''}}" wx:for="{{entity.records}}"  wx:key="index" data-index="{{index}}" data-url="{{item.url}}"></image>
+      <image bindtap="showAudio" src="{{index == curAudioIndex ? '/images/cur-audio.png' : '/images/audio.png'}}" class="{{index == curAudioIndex ? 'curAudioStyle' : ''}}" wx:for="{{entity.records}}"  wx:key="index" data-index="{{index}}" data-url="{{item.url}}"></image>
     </view>
-    <audio id="audio-play" bindpause="bindpause" bindended="bindended" src="{{curAudio}}"></audio>
-
   </view>
   <!-- end -->
 
@@ -105,7 +103,7 @@
  </view>
   <!-- end -->
 
-  <view class="toTask" bindtap="toTask">
+  <view wx:if="{{doTaskFlag}}" class="toTask" bindtap="toTask">
     做作业
   </view>
 

+ 1 - 1
pages/theClasses/theClasses.wxss

@@ -14,6 +14,6 @@ page{
   color: #FFF;
   background: #005033;
   text-align: center;
-  font-size: 36rpx;
+  font-size: 32rpx;
 }