Przeglądaj źródła

Merge branch 'master' of http://dev.schoolwisdoms.com/xzh/schoolwisdoms-student-mp

yukangzhe 3 lat temu
rodzic
commit
018f354ae0

+ 166 - 94
pages/forBack/forBack.js

@@ -2,48 +2,28 @@
 const app = getApp()
 const util = require("../../utils/util")
 const urlDef = require("../../utils/urls")
-const urls = urlDef.urls;
-
 Page({
 
   /**
    * 页面的初始数据
    */
   data: {
-    radioList: [{
-        name: '学校不满意',
-        type: 'school'
-      },
-      {
-        name: '课程不满意',
-        type: 'school'
-      },
-      {
-        name: '产品建议/功能优化',
-        type: 'select'
-      },
-      {
-        name: '其他问题',
-        type: 'select'
-      },
-    ],
-    curRadioIndex: '0',
-    plateList: [
-      '我的课表',
-      '提交作业',
-      '课堂点评',
-      '成长足迹',
-      '请假',
-      '补课',
-      '加课',
-      '调课',
+    radioList: [
+      { name: '学校不满意', type: 'school', value: '8df20e39d0e94a95bc35f020cc2e4b84' },
+      { name: '课程不满意', type: 'school', value: '00901101530549789799899a113d46e8' },
+      { name: '产品建议/功能优化', type: 'select', value: '325ef70d708a46d094ef3eaefebaf254' },
+      { name: '其他问题', type: 'select', value: 'f9b1ecb1bd1943739082552dc68af535' },
     ],
+    curRadioIndex: '-1',
+    plateList: [],
     plateIndex: 0,
-    radioType: 'school',
-    imgList:[]
+    radioType: '',
+    curStu: null,
+    content: '',
+    imgList: []
   },
 
-  getRadio: function (e) {
+  getRadio:function(e){
     const type = this.data.radioList[e.currentTarget.dataset.index].type
     this.setData({
       curRadioIndex: e.currentTarget.dataset.index,
@@ -51,76 +31,26 @@ Page({
     })
   },
 
-  bindPickerChange: function (e) {
+  bindPickerChange: function(e) {
     this.setData({
       plateIndex: e.detail.value
     })
   },
 
-  uploadTap: function () {
-    const that = this
-    if(that.data.imgList.length>=6){
-      wx.showToast({
-        title: '最多上传6张图片',
-        icon: 'none'
-      })
-      return false
-    }
-    wx.chooseImage({
-      count: 6,
-      sourceType: ['album', 'camera'],
-      success(res) {
-        wx.showLoading({
-          title: '上传中...',
-        })
-        for (var i in res.tempFilePaths) {
-          wx.uploadFile({
-            filePath: res.tempFilePaths[i],
-            name: 'name',
-            url: urls.file_upload,
-            header: util.getHeaders(),
-            success(res) {
-              wx.showToast({
-                title: '上传成功',
-              })
-              const rs = JSON.parse(JSON.parse(JSON.stringify(res.data)))
-              const list = [{
-                url: rs.data[0].url
-              }]
-              that.setData({
-                imgList: that.data.imgList.concat(list)
-              })
-            },
-            fail(res) {
-              wx.showToast({
-                title: '上传失败',
-                icon: none
-              })
-            },
-            complete(res) {
-              wx.hideLoading({
-                success: (res) => {},
-              })
-            }
-          })
-        }
-      }
-    })
-  },
-
-  delImg:function(e){
-    const index = e.currentTarget.dataset.index
-    this.data.imgList.splice(index,1)
-    this.setData({
-      imgList: this.data.imgList
-    })
-  },
-
   /**
    * 生命周期函数--监听页面加载
    */
   onLoad: function (options) {
-
+    let stu = wx.getStorageSync('student');
+    this.setData({ curStu: stu })
+    let urls = urlDef.urls;
+    util.apiPost(urls.get_suggest_moudles).then((rs) => {
+      let list = []
+      rs.forEach(v => {
+        list.push({ id: v.id, name: v.detailName })
+      });
+      this.setData({ plateList: list })
+    });
   },
 
   /**
@@ -170,5 +100,147 @@ Page({
    */
   onShareAppMessage: function () {
 
-  }
+  },
+  doInput: function (e) {
+    this.setData({ content: e.detail.value })
+  },
+  len(s) {
+    return (s == null ? 0 : s.length);
+  },
+  doSave: function () {
+    let urls = urlDef.urls
+    if (this.len(this.data.content) === 0) {
+      wx.showToast({ title: '请输入建议或投诉内容', icon: 'none' });
+      return;
+    }
+    let t = this.data.radioList[this.data.curRadioIndex]
+    let typeId = t ? t.value : '';
+    let moduleId = this.data.plateList[this.data.plateIndex].id
+    if ((typeId !== '8df20e39d0e94a95bc35f020cc2e4b84' && typeId !== '00901101530549789799899a113d46e8')
+      && (this.len(moduleId) === 0)) {
+      wx.showToast({ title: '请选择模块', icon: 'none' });
+      return;
+    }
+
+    let entity = {}
+    entity.studentId = this.data.curStu.studentId
+    entity.submitDate = new Date();
+    entity.status = 1;
+    entity.orgId = this.data.curStu.orgId
+    entity.remarks = this.data.content
+    entity.telephone =  wx.getStorageSync('phone')
+    entity.typeId = typeId
+    entity.moduleId = moduleId
+
+    util.apiPost(urls.suggest_save, entity, 'application/json').then((rs) => {
+      wx.showToast({ title: '提交成功', icon: 'success' });
+      entity.id = rs.id;
+
+      const body = { 'id': rs.id, 'orgId': this.data.curStu.orgId, 'studentId': this.data.curStu.studentId }
+      util.apiPost(urls.suggest_send_message, body, 'application/json').then((rs) => {
+        console.log('发送通知 ' + JSON.stringify(rs));
+      });
+
+
+      // 保存图片
+      let imgs = [];
+      let delList = []
+      this.data.imgList.forEach(r => {
+        if (r.delete && r.delete == 1) {
+          delList.push(r.url.substring(r.url.lastIndexOf('/') + 1))
+        } else {
+          imgs.push({ feedbackId: rs.id, feedbackImageUrl: r.url })
+        }
+      });
+
+      // 删除文件
+      if (delList.length > 0) {
+        const params = { 'keys': delList }
+        util.apiPost(urls.file_delete, params).then((rs) => {
+          console.log('删除文件 ... ');
+        });
+      }
+
+      if (imgs.length > 0) {
+        console.log('保存关联图片 ... ');
+        util.apiPost(urls.suggest_image_save, imgs, 'application/json').then((rs) => {
+
+        })
+      }
+
+
+      setTimeout(() => {
+        wx.navigateBack({
+          delta: 1, // 返回上一级页面。
+          success: function () {
+            console.log('成功!')
+          }
+        })
+      }, 1000)
+    })
+  },
+  uploadTap: function () {
+    const that = this
+    const urls = urlDef.urls;
+    wx.chooseImage({
+      count: 6,
+      sourceType: ['album', 'camera'],
+      success(res) {
+        wx.showLoading({
+          title: '上传中...',
+        })
+        for (var i in res.tempFilePaths) {
+          wx.uploadFile({
+            filePath: res.tempFilePaths[i],
+            name: 'name',
+            url: urls.file_upload,
+            header: util.getHeaders(),
+            success(res) {
+              wx.showToast({
+                title: '上传成功',
+              })
+              const rs = JSON.parse(JSON.parse(JSON.stringify(res.data)))
+              const list = [{ url: rs.data[0].url }]
+              that.setData({
+                imgList: that.data.imgList.concat(list)
+              })
+            },
+            fail(res) {
+              wx.showToast({
+                title: '上传失败',
+                icon: none
+              })
+            },
+            complete(res) {
+              wx.hideLoading({
+                success: (res) => { },
+              })
+            }
+          })
+        }
+      }
+    })
+  },
+  showImg: function (e) {
+    const index = e.currentTarget.dataset.index
+    let images = this.data.imgList;
+    let imgs = []
+    images.map(i => {
+      imgs.push(i.url)
+    })
+    wx.previewImage({
+      current: images[index].url,
+      urls: imgs,
+    })
+  },
+
+  delImg: function (e) {
+    const index = e.currentTarget.dataset.index
+    let images = this.data.imgList;
+    let image = images[index]
+    image.delete = 1
+    this.setData({
+      imgList: images
+    })
+  },
 })

+ 16 - 15
pages/forBack/forBack.wxml

@@ -6,13 +6,13 @@
     </view>
   </view>
   <view class="change-view">
-    <view class="curSchool" wx:if="{{radioType == 'school'}}">当前学校:智慧汉阳校区</view>
+    <view class="curSchool" wx:if="{{radioType == 'school'}}">当前学校:{{curStu.orgName}}</view>
   <view class="picker-view" wx:elif="{{radioType == 'select'}}">
     <view class="section">
       <view class="section__title">请选择板块:</view>
-      <picker bindchange="bindPickerChange" value="{{plateIndex}}" range="{{plateList}}">
+      <picker bindchange="bindPickerChange" value="{{plateIndex}}" range="{{plateList}}" range-key="name">
         <view class="picker">
-          {{plateList[plateIndex]}}
+          {{plateList[plateIndex].name}}
         </view>
       </picker>
     </view>
@@ -21,24 +21,25 @@
   <view class="line"></view>
 
   <view class="title">问题描述</view>
-  <textarea class="textarea" placeholder="请详细描述你遇到的问题与建议..." maxlength="200"></textarea>
+  <textarea class="textarea" placeholder="请详细描述你遇到的问题与建议..." maxlength="200"  value="{{content}}" bindinput="doInput"></textarea>
   <view class="line"></view>
 
   <view class="title">上传图片</view>
   <view class="uploadImg-task-view">
-      <view class="my-img-view" wx:for="{{imgList}}" wx:key="index">
-        <view class="new-task-img">
-          <image src="{{item.url}}"></image>
-        </view>
-        <view class="del-btn" catchtap="delImg" data-index="{{index}}">X</view>
+    <view class="my-img-view" wx:for="{{imgList}}" wx:key="index" data-index="{{index}}" catchtap="showImg" wx:if="{{item.delete != 1}}">
+      <view class="new-task-img">
+        <image src="{{item.url}}"></image>
       </view>
-      <view class="upload-btn" bindtap="uploadTap">
-        <view style="margin-top:30rpx">
-          <image src="/images/addFile.png"></image>
-          <view>添加图片</view>
-        </view>
+      <view class="del-btn" data-index="{{index}}" catchtap="delImg">X</view>
+    </view>
+    <view class="upload-btn" bindtap="uploadTap">
+      <view style="margin-top:30rpx">
+        <image src="/images/addFile.png"></image>
+        <view>添加图片</view>
       </view>
     </view>
+  </view>
+
 
-    <view class="submit-btn">提交</view>
+    <view class="submit-btn" bindtap="doSave">提交</view>
 </view>

+ 1 - 0
pages/index/index.js

@@ -272,6 +272,7 @@ Page({
           student = {
             studentId: u.studentId,
             orgId: u.orgId,
+            orgName: u.orgName,
             name: u.studentName,
             sex: u.sex,
             headImg: headImg

+ 10 - 1
pages/leave/leave.js

@@ -19,12 +19,17 @@ Page({
     leaveTime: 0,
     leaveDay: 0,
     curDate: null,
+    bd: null
   },
 
   /**
    * 生命周期函数--监听页面加载
    */
   onLoad: function (options) {
+    let date = options.beginDate;
+    if (date) {
+      this.setData({ bd: date })
+    }
     const urls = urlDef.urls;
     let stu = wx.getStorageSync('student');
     if (stu) {
@@ -73,7 +78,11 @@ Page({
    * 生命周期函数--监听页面显示
    */
   onShow: function () {
-
+    let date = this.data.bd
+    if (date) {
+      let t = this;
+      setTimeout(() => { t.selectDate(date) }, 500)
+    }
   },
 
   /**

+ 94 - 31
pages/pianoDetail/pianoDetail.js

@@ -1,59 +1,53 @@
 // pages/pianoDetail/pianoDetail.js
 const app = getApp()
 const util = require("../../utils/util")
+const urlDef = require("../../utils/urls")
 Page({
 
   /**
    * 页面的初始数据
    */
   data: {
-    imageUrl: app.globalData.imageUrl,
     num: 1,
-    initMoney:19.90,
-    item:{
-      name: '19.9元特惠练琴卡',
-      money: '19.90',
-      beginDate: '2021-01-01',
-      endDate: '2022-01-01'
-    },
+    initMoney: 19.90,
     id: "",
     payFlag: 1,
-    schoolList:[],
+    schoolList: [],
     moreFlag: 0,
     isBuy: true,
     downLoadShow: false
   },
 
-  getMoreSchool:function(){
-    if(this.data.moreFlag == 0){
+  getMoreSchool: function () {
+    if (this.data.moreFlag == 0) {
       this.setData({
         moreFlag: 1
       })
-    } else{
+    } else {
       this.setData({
         moreFlag: 0
       })
     }
   },
 
-  remNum:function(){
+  remNum: function () {
     var num = this.data.num
-    if(num <= 1){
+    if (num <= 1) {
       return false
     } else {
       num--
       var money = this.data.initMoney
       money = parseFloat(money) * parseFloat(num).toFixed(2)
       this.setData({
-        num : num,
-       'item.money': money.toFixed(2)
+        num: num,
+        'item.money': money.toFixed(2)
       })
     }
   },
 
-  addNum:function(){
+  addNum: function () {
     var num = this.data.num
-    if(num >= 10){
+    if (num >= 10) {
       wx.showToast({
         title: '已达单次购买上限',
         icon: "none"
@@ -64,7 +58,7 @@ Page({
     var money = this.data.initMoney
     money = parseFloat(money) * parseFloat(num).toFixed(2)
     this.setData({
-      num:num,
+      num: num,
       'item.money': money.toFixed(2)
     })
   },
@@ -72,23 +66,28 @@ Page({
   callPhone(e) {
     const index = e.currentTarget.dataset.index
     const phone = this.data.schoolList[index].CONTRACT_TELEPHONE
-   if(phone){
-    wx.makePhoneCall({
-      phoneNumber: phone
-    })
-   } else{
-     wx.showToast({
-       title: '暂无联系电话',
-       icon:"none"
-     })
-   }
+    if (phone) {
+      wx.makePhoneCall({
+        phoneNumber: phone
+      })
+    } else {
+      wx.showToast({
+        title: '暂无联系电话',
+        icon: "none"
+      })
+    }
   },
 
   /**
    * 生命周期函数--监听页面加载
    */
   onLoad: function (options) {
-
+    let urls = urlDef.urls
+    let item = JSON.parse(options.data)
+    if (item.imgUrl == null || item.imgUrl == undefined) {
+      item.imgUrl = urls.oss_file + 'image/0e02f9fc-1d41-4551-a150-b1be8196b49d.jpg'
+    }
+    this.setData({ item: item, initMoney: item.money })
   },
 
   /**
@@ -138,5 +137,69 @@ Page({
    */
   onShareAppMessage: function () {
 
-  }
+  }, 
+  tabBuy: function () {
+    let stu = wx.getStorageSync('student');
+    util.doPost(
+      'buyPianoCard',{
+        id: this.data.item.id,
+        studentId: stu.studentId
+      }).then(res =>{
+        if(res.success == 1){
+          this.payFunction(res.data)
+          wx.showLoading({
+            title: '正在唤醒支付',
+          })
+        }
+      })
+  },
+  payFunction: function (_this) {
+    util.doPost(
+      'payment', {
+        payDesc: _this.cardName,
+        bussType: '15',
+        sourceId: _this.id,
+        amount: _this.payMoney,
+        openId: wx.getStorageSync('openId'),
+        appId: app.globalData.appId
+      }).then(res => {
+        wx.hideLoading({
+          success: (res) => {},
+        })
+      if (res.success > 0) {
+        // 唤醒支付
+        var payData = res.data;
+        var that = this
+        wx.requestPayment({
+          timeStamp: payData.timeStamp,
+          nonceStr: payData.nonceStr,
+          package: payData.package,
+          signType: payData.signType,
+          paySign: payData.paySign,
+          success: function (res) {
+            // wx.redirectTo({
+            //   url: '/pages/payDone/payDone?money=' + that.data.orderInfo.paidAmount + "&type=App",
+            // })
+            console.log('payment success ... ' + JSON.stringify(res));
+          },
+          fail: function (res) {
+            console.log('payment fail ... ' + JSON.stringify(res));
+          },
+          complete: function (res) {
+            that.setData({
+              flag: true
+            })
+           
+            console.log('payment complete ... ' + JSON.stringify(res));
+          }
+        })
+      } else {
+        const tip = res.errMsg
+        wx.showToast({
+          title: tip,
+          icon: 'none'
+        })
+      }
+    })
+  },
 })

+ 3 - 3
pages/pianoDetail/pianoDetail.wxml

@@ -2,7 +2,7 @@
     <navTop title="支付"></navTop>
     <view class="top-view">
       <view class="card-img">
-        <image mode="aspectFill" src="{{item.imgUrl ? item.imgUrl : 'https://file.schoolwisdoms.com/image/0e02f9fc-1d41-4551-a150-b1be8196b49d.jpg'}}"></image>
+        <image mode="aspectFill" src="{{item.imgUrl}}"></image>
       </view>
       <view class="card-msg">
         <view class="title">{{item.name}}</view>
@@ -15,9 +15,9 @@
       <view class="num-view">
         <view class="label num-label">数量</view>
         <view class="edit-num-view">
-          <view class="rem {{num == 1?'rem-false':''}}" bindtap="remNum">一</view>
+          <!-- <view class="rem {{num == 1?'rem-false':''}}" bindtap="remNum">一</view> -->
           <view class="num">{{num}}</view>
-          <view class="add {{num >= 10?'rem-false':''}}" bindtap="addNum">十</view>
+          <!-- <view class="add {{num >= 10?'rem-false':''}}" bindtap="addNum">十</view> -->
         </view>
       </view>
       <view class="total-view">

+ 39 - 9
pages/pianoList/pianoList.js

@@ -1,20 +1,25 @@
 // pages/pianoList/pianoList.js
+const app = getApp()
+const util = require("../../utils/util")
+const urlDef = require("../../utils/urls")
 Page({
 
   /**
    * 页面的初始数据
    */
   data: {
-    list:[
-      {name: '19.9特惠练琴卡',money: '19.90',days: '30'},
-      {name: '19.9特惠练琴卡',money: '19.90',days: '30'},
-      {name: '19.9特惠练琴卡',money: '19.90',days: '30'},
-    ]
+    list: [
+    ],
+    loading: '上拉加载',
+    flag: 0,
+    pageNum: 0,
+    hasNextPage: true,
   },
 
-  getCard:function(e){
+  getCard: function (e) {
+    let item = this.data.list[e.currentTarget.dataset.index]
     wx.navigateTo({
-      url: '/pages/pianoDetail/pianoDetail',
+      url: '/pages/pianoDetail/pianoDetail?data=' + JSON.stringify(item),
     })
   },
 
@@ -22,7 +27,7 @@ Page({
    * 生命周期函数--监听页面加载
    */
   onLoad: function (options) {
-
+    this.queryList();
   },
 
   /**
@@ -57,7 +62,11 @@ Page({
    * 页面相关事件处理函数--监听用户下拉动作
    */
   onPullDownRefresh: function () {
-
+    if (this.data.hasNextPage) {
+      let pn = this.data.pageNum
+      this.setData({ loading: '加载中', 'pageNum': ++pn })
+      this.queryList()
+    }
   },
 
   /**
@@ -72,5 +81,26 @@ Page({
    */
   onShareAppMessage: function () {
 
+  },
+  queryList: function () {
+    const urls = urlDef.urls;
+    let stu = wx.getStorageSync('student');
+    if (stu) {
+      let params = {}
+      params.pageNum = this.data.pageNum
+      util.apiPost(urls.get_piano_card_list, params).then(rs => {
+        let list = rs.list
+        list.map(o => {
+          if (o.imgUrl == null || o.imgUrl == undefined) {
+            o.imgUrl = urls.oss_file + 'image/0e02f9fc-1d41-4551-a150-b1be8196b49d.jpg'
+          }
+        })
+        this.setData({
+          'hasNextPage': rs.hasNextPage,
+          'loading': rs.hasNextPage ? '下拉刷新' : '没有更多数据',
+          'list': this.data.list.concat(list)
+        })
+      })
+    }
   }
 })

+ 78 - 7
pages/quan/quan.js

@@ -1,16 +1,22 @@
 // pages/quan/quan.js
+const app = getApp()
+const util = require("../../utils/util")
+const urlDef = require("../../utils/urls")
 Page({
 
   /**
    * 页面的初始数据
    */
   data: {
-    list:[
-      {},
-      {}
+    status: '0',
+    list: [
     ],
-    switchTitle:[
-      '可使用','已使用'
+    loading: '上拉加载',
+    flag: 0,
+    pageNum: 0,
+    hasNextPage: true,
+    switchTitle: [
+      '可使用', '已使用'
     ]
   },
 
@@ -18,7 +24,7 @@ Page({
    * 生命周期函数--监听页面加载
    */
   onLoad: function (options) {
-
+    this.queryList();
   },
 
   /**
@@ -60,7 +66,11 @@ Page({
    * 页面上拉触底事件的处理函数
    */
   onReachBottom: function () {
-
+    if (this.data.hasNextPage) {
+      let pn = this.data.pageNum
+      this.setData({ loading: '加载中', 'pageNum': ++pn })
+      this.queryList()
+    }
   },
 
   /**
@@ -68,5 +78,66 @@ Page({
    */
   onShareAppMessage: function () {
 
+  },
+  queryList: function () {
+    const urls = urlDef.urls;
+    let stu = wx.getStorageSync('student');
+    if (stu) {
+      let params = { 'q.studentId': stu.studentId, 'q.orgId': stu.orgId }
+      let url = null;
+      if (this.data.status == '0') { // 待领取 + 已领取
+        url = urls.coupon_receive_list;
+      } else if (this.data.status == '2') { // 已经使
+        url = urls.my_coupon;
+        params['q.status'] = '2';
+      }
+      console.log(url)
+      params.pageNum = this.data.pageNum
+      util.apiPost(url, params).then(rs => {
+        let list = rs.list
+        this.setData({
+          'hasNextPage': rs.hasNextPage,
+          'loading': rs.hasNextPage ? '下拉刷新' : '没有更多数据',
+          'list': this.data.list.concat(list)
+        })
+      })
+    }
+  },
+  changeIndex: function (e) {
+    if (e.detail == 0) {
+      this.setData({ status: '0' })
+    } else {
+      this.setData({ status: '2' })
+    }
+    this.setData({
+      list: [],
+      loading: '上拉加载',
+      pageNum: 0
+    })
+    this.queryList()
+  },
+  submitCilck: function (e) {
+    const urls = urlDef.urls;
+    let item = this.data.list[e.currentTarget.dataset.index]
+    if (item.receiveDate) {
+      wx.showToast({ title: '已领取过该优惠券', icon: 'none' });
+      return;
+    }
+    wx.showLoading({
+      title: '正在领取...',
+      mask: true
+    })
+    util.apiPost(urls.coupon_receive + '?publishId=' + item.publishId + '&couponId=' + item.couponId).then((rs) => {
+      wx.hideLoading({})
+      if (rs.message) {
+        wx.showToast({ title: rs.message, icon: 'none' });
+        return;
+      }
+      item.receiveDate = new Date();
+      wx.showToast({ title: '领取成功', icon: 'success' });
+      this.setData({ list: [], pageNum: 0 })
+      this.queryList();
+    })
   }
+
 })

+ 29 - 9
pages/quan/quan.wxml

@@ -1,7 +1,7 @@
 <view class="container">
 
   <!-- 顶部切换标题 -->
-  <switchTab arr="{{switchTitle}}"></switchTab>
+  <switchTab arr="{{switchTitle}}"  bind:changeIndex="changeIndex"></switchTab>
   <!-- end -->
 
 
@@ -13,9 +13,18 @@
           <view class="content">
             <view class="{{index == 0 ? 'couponCount' : 'couponCount-ed'}}">火爆</view>
             <view class="oilline linwidth160 lineBt"></view>
-            <view>
+            <view  wx:if="{{item.couponType == 1}}">
               <text class="moyfh">¥</text>
-              <text class="moneyNum">20</text>
+              <text class="moneyNum">{{item.couponAmount}}</text>
+            </view>
+            <view  wx:if="{{item.couponType == 2}}">
+              <text class="moneyNum">{{item.couponAmount}} 折</text>
+            </view>
+            <view  wx:if="{{item.couponType == 3}}">
+              <text class="moneyNum">{{item.couponAmount}} 课时</text>
+            </view>
+            <view  wx:if="{{item.couponType == 4}}">
+              <text class="moneyNum">{{item.couponAmount}} 个</text>
             </view>
             <view class="oilline  linwidth160 lineBt"></view>
           </view>
@@ -26,13 +35,24 @@
             <view class="oilline linwidth227 lineBt "></view>
             <view class="vnameBx">
               <view class="couponmaes">{{item.itemName}}</view>
-              <view class="couponmaes">20元报名优惠券</view>
+              <view class="couponmaes" wx:if="{{item.couponType == 1}}">抵扣券</view>
+              <view class="couponmaes" wx:if="{{item.couponType == 2}}">折扣券</view>
+              <view class="couponmaes" wx:if="{{item.couponType == 3}}">赠课券</view>
+              <view class="couponmaes" wx:if="{{item.couponType == 4}}">礼品券</view>
             </view>
             <view class="oilline linwidth227 lineBt"></view>
-            <view class="  {{index == 0 ?'moveCm btnbx':'moveCm-ed btnbx-ed'  }}">
-              <view class="btnw {{index == 0?'btnBgActive':'btnBgGray'  }}">
-                <view wx:if="{{index == 0}}" class="btnn" bindtap="submitCilck">立即领取</view>
-                <view wx:if="{{index != 0}}" class="btnn-ed">已使用</view>
+
+            <view class="moveCm btnbx" wx:if="status == '0'">
+              <view class="btnw btnBgActive">
+                <view  class="btnn" bindtap="submitCilck" data-index="{{index}}">立即领取</view>
+              </view>
+            </view>
+
+            <view class="moveCm-ed btnbx-ed"  wx:if="status != '0'">
+              <view class="btnw btnBgGray">
+                <view wx:if="{{item.couponStatus == 1}}" class="btnn-ed">可使用</view>
+                <view wx:if="{{item.couponStatus == 2}}" class="btnn-ed">已使用</view>
+                <view wx:if="{{item.couponStatus == 3}}" class="btnn-ed">已过期</view>
               </view>
             </view>
           </view>
@@ -40,5 +60,5 @@
       </view>
     </view>
   </view>
-
+  <view class="loading">{{loading}}</view> 
 </view>

+ 7 - 0
pages/quan/quan.wxss

@@ -271,4 +271,11 @@
   100% {
     transform: scale(1);
   }
+}
+.loading {
+  height: 200rpx;
+  line-height: 100rpx;
+  background: #f1f1f1;
+  color: #999;
+  text-align: center;
 }

+ 12 - 3
pages/schedule/schedule.js

@@ -15,17 +15,22 @@ Page({
     dateList: [],
     date: null,
     week: 0,
-    weekMap: ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六']
+    weekMap: ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'],
+    bd: null
   },
 
   /**
    * 生命周期函数--监听页面加载
    */
   onLoad: function (options) {
+    let date = options.beginDate;
+    if (date) {
+      this.setData({ bd: date })
+    }
     const urls = urlDef.urls;
     let stu = wx.getStorageSync('student');
     if (stu) {
-      this.setData({'curStu': stu});
+      this.setData({ 'curStu': stu });
       util.apiPost(urls.get_sys_params, { 'q.orgId': stu.orgId, 'q.id': 'f8158acabeeb44ec9ff651aade6b295f' }).then((rs) => {
         if (rs && rs.length > 0) {
           // 将分钟转为毫秒
@@ -56,7 +61,11 @@ Page({
    * 生命周期函数--监听页面显示
    */
   onShow: function () {
-
+    let date = this.data.bd
+    if (date) {
+      let t = this;
+      setTimeout(() => { t.selectDate(date) }, 500)
+    }
   },
 
   /**

+ 10 - 1
pages/theClasses/theClasses.js

@@ -25,6 +25,7 @@ Page({
     transferCount: 2,
     monthCount: 0,
     curDate: null,
+    bd: null
   },
 
   getTip: function () {
@@ -47,6 +48,10 @@ Page({
    * 生命周期函数--监听页面加载
    */
   onLoad: function (options) {
+    let date = options.beginDate;
+    if (date) {
+      this.setData({ bd: date })
+    }
     const urls = urlDef.urls;
     let stu = wx.getStorageSync('student');
     if (stu) {
@@ -86,7 +91,11 @@ Page({
    * 生命周期函数--监听页面显示
    */
   onShow: function () {
-
+    let date = this.data.bd
+    if (date) {
+      let t = this;
+      setTimeout(() => { t.selectDate(date) }, 500)
+    }
   },
 
   /**