Пример #1
0
 actExchangeCoupon: function() {
     var that = this;
     Alert.prompt('请输入优惠码', function ( code ) {
       if (code && $.trim( code ).length) {
           that.model.add(code);
       }
     });
 },
Пример #2
0
 success: function( response ) {
     if ( response && response.ret === 0 ) {
         Alert.show('优惠券添加成功!');
         var list = that.get('couponList');
         var currentCoupon = response.content.coupon_info;
         list.unshift( currentCoupon );
         that.set({
             list: list,
             currentCoupon: currentCoupon,
             index: that.get('index') + 1
         });
     } else if ( response && response.ret === 100021 ) {
         Alert.show( response.msg, function() {
             location.reload();
         });
     } else {
         Alert.show( response.msg );
     }
 }
Пример #3
0
 success: function (_, response) {
     if (response && response.ret === 0) {
         var content = response.content;
         that.set( $.extend( chooseData, {
             couponList: couponData.concat( content.coupon_list ),
             total: content.total,
             index: couponDataLen - 1,
             unable_total: content.unable_total
         }));
     } else {
         that.set( $.extend( chooseData, { couponList: [] }) );
         if (response && response.ret === 100021) {
             Alert.show(response.msg, function() {
                 location.reload();
             });
         }
     }
 },
Пример #4
0
 error: function () {
     that.set( $.extend( chooseData, { couponList: [] }));
     Alert.show("网络不太好");
 }
Пример #5
0
 errorHandle: function () {
   var errMsg = this.model.get('errMsg');
   Loading.hide();
   Alert.show( errMsg );
 },