Browse Source

Signed-off-by: yukangzhe <382985154@qq.com>

yukangzhe 3 years ago
parent
commit
cdfc76cc0d

+ 1 - 1
pages/Components/classList/classList.js

@@ -102,7 +102,7 @@ Component({
       let action = e.currentTarget.dataset.action
       if (action == '1' || action == '3' || action == '4') {
         item.curDate = item.beginTime.substring(0, 10)
-        wx.navigateTo({
+        wx.navigateTo({ 
           url: e.currentTarget.dataset.url + '?data=' + JSON.stringify({ source: item, action: (action ? action : 0), dayScope: 14 }),
         })
       } else if (action == '2') {

+ 1 - 1
pages/Components/classList/classList.wxml

@@ -27,7 +27,7 @@
             <span wx:if="{{item.status == 5}}">补课</span>
           </view>
           <view class="class-btn-box" wx:if="{{showBtn}}">
-            <view class="add-btn class-btn" bindtap="toPages" data-url="/pages/targetList/targetList" data-id="{{item.id}}" data-action="{{action}}">申请{{actionName}}课</view>
+            <view class="add-btn class-btn" bindtap="toPages" data-url="/pages/targetList/targetList" data-id="{{item.id}}" data-action="{{action}}">申请{{actionName}}课</view> 
           </view>
           <view class="class-btn-box" wx:if="{{item.leaveFlag}}">
             <view class="add-btn class-btn" bindtap="toPages" data-url="/pages/leaveDetail/leaveDetail" data-id="{{item.id}}" data-action="{{action}}">请假</view>

+ 2 - 0
pages/doTask/doTask.js

@@ -549,6 +549,7 @@ Page({
     let images = [];
     if (this.data.imgList.length > 0) {
       this.data.imgList.forEach(r => {
+        console.log(r.url)
         let fid = r.url.substring(r.url.lastIndexOf('/') + 1)
         if (r.delete == 1) {
           dlist.push({
@@ -566,6 +567,7 @@ Page({
     let records = [];
     if (this.data.audioList.length > 0) {
       this.data.audioList.forEach(r => {
+        console.log(r.url,2)
         let fid = r.url.substring(r.url.lastIndexOf('/') + 1)
         if (r.delete == 1) {
           dlist.push({

+ 2 - 2
pages/doTask/doTask.wxml

@@ -25,7 +25,7 @@
       </view>
       <view class="upload-btn" bindtap="uploadTap">
         <view style="margin-top:30rpx">
-          <image src="/images/addFile.png"></image>
+          <image src="/images/addfile.png"></image>
           <view>添加图片</view>
         </view>
       </view>
@@ -43,7 +43,7 @@
       </view>
       <view class="upload-btn" bindtap="upLoadVideo">
         <view style="margin-top:30rpx">
-          <image src="/images/addFile.png"></image>
+          <image src="/images/addfile.png"></image>
           <view>添加视频</view>
         </view>
       </view>

+ 2 - 0
pages/doTask/doTask.wxss

@@ -102,6 +102,8 @@
 .upload-btn image{
   height: 40rpx;
   width: 40rpx;
+  position: relative;
+  z-index: 99;
 }
 
 .upload-btn{

+ 14 - 0
pages/leave/leave.js

@@ -108,6 +108,9 @@ Page({
    * 生命周期函数--监听页面显示
    */
   onShow: function () {
+    let pages = getCurrentPages();
+    let currPage = pages[pages.length - 1];
+  //当前页的options,啥意思呢,就是你可能某个函数需要刷新,但是他的参数正好是传过来的参数
     let date = this.data.bd
     if (date) {
       let t = this;
@@ -167,6 +170,17 @@ Page({
       o.et = o.endTime.substring(0, 5);
       o.leaveFlag = this.canLeave(o)
     })
+
+    if(this.data.newItem){
+      for(var i in list){
+        if(list[i].id == this.data.newItem.id){
+          list[i].leaveFlag = false
+          this.data.newItem = null
+          break;
+        }
+      }
+    }
+
     this.setData({
       'date': v,
       'week': week,

+ 10 - 4
pages/leaveDetail/leaveDetail.js

@@ -126,8 +126,6 @@ Page({
         }
       })
     });
-
-
   },
   doRealSave: function () {
     const that = this
@@ -164,7 +162,7 @@ Page({
         })
         return
       }
-
+      const that = this
       wx.showModal({
         title: '请假申请成功',
         content: '需要立即预约补课吗?',
@@ -173,11 +171,19 @@ Page({
         confirmText: "预约补课",
         success: function (res) {
           if (res.cancel) {
+             //获取页面栈
+             let pages = getCurrentPages();
+             //获取所需页面
+             let prevPage = pages[pages.length -2];//上一页
+             that.data.item.leaveFlag = false
+             prevPage.setData({
+               newItem: that.data.item
+             });
             setTimeout(() => {
               wx.navigateBack({
                 delta: 1, // 返回上一级页面。
                 success: function () {
-                  console.log('成功!')
+                  // console.log('成功!')
                 }
               })
             }, 1000)

+ 8 - 0
pages/targetList/targetList.js

@@ -251,6 +251,14 @@ Page({
               confirmText: "确定", //默认是“确定”
               // confirmColor: 'skyblue', //确定文字的颜色
               success() {
+                 //获取页面栈
+                let pages = getCurrentPages();
+                //获取所需页面
+                let prevPage = pages[pages.length -2];//上一页
+                that.data.item.leaveFlag = false
+                prevPage.setData({
+                  newItem: that.data.item
+                });
                 wx.navigateBack({
                   delta: 1,
                 })

+ 11 - 0
pages/theClasses/theClasses.js

@@ -173,6 +173,17 @@ Page({
           }
         }
       })
+
+      if(this.data.newItem){
+        for(var i in list){
+          if(list[i].id == this.data.newItem.id){
+            list[i].transferFlag = false
+            this.data.newItem = null
+            break;
+          }
+        }
+      }
+
       this.setData({ 'date': v, 'week': week, 'dateList': [{ items: list, date: v, week: week }] });
     }).catch(e => { });
   },