| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677 |
- import common from '../../utils/util';
- import main from '../../utils/main';
- import constant from '../../utils/constant';
- const app = getApp();
- Page({
- data: {
- MenuArr: constant.arrStudyPlay,
- },
- onLoad: function (options) {
- var that = this;
- that.setData({
- Containnerheight: main.getWindowHeight(),
- CardType:options.CardType,
- MiaoguoCardID:options.ID,
- CardNumberUrgent: app.globalData.TaskToday.CardNumberUrgent,
- });
- if (app.globalData.IsIPhoneX) {
- that.setData({
- IsIPhoneX: "_IsIPhoneX",
- });
- }
- },
- changeCardType:function(e){
- var that = this;
- var cardType=e.currentTarget.dataset.cardtype;
- if (cardType!=that.data.CardType){
- if (cardType == 1 && that.data.CardNumberUrgent>=200){
- wx.showToast({
- title: '紧急练习容量已满',
- })
- }
- else{
- that.setData({
- CardType: cardType,
- });
- }
- }
- },
- close:function(){
- wx.navigateBack({
- delta: 1,
- });
- },
- save:function(){
- var that = this;
- var url = 'UpdateMiaoguoCardType?UserID=' + app.globalData.userInfo.UserID;
- url += "&CardType=" + that.data.CardType;
- url += "&ID=" + that.data.MiaoguoCardID;
- main.getData(url, function (data) {
- var list = app.globalData.CardList;
- for (var i = 0; i < list.length; i++) {
- if (list[i].MiaoguoCardID == that.data.MiaoguoCardID)
- list[i].CardType = that.data.CardType;
- }
- app.globalData.CardList = list;
- if (that.data.CardType==1){
- app.globalData.TaskToday.CardNumberUrgent++;
- }
- app.globalData.IsUpdateStudyPlan = 1;
-
- that.close();
-
- });
-
- },
- onShareAppMessage: function () {
- return {
- title: app.globalData.ShareTitle,
- path: app.globalData.SharePath + '?UserID=' + app.globalData.userInfo.UserID,
- imageUrl: app.globalData.ShareImage,
- }
- },
- })
|