From f9e20cc2db353b3e1f4519847c4612e2f738d1a6 Mon Sep 17 00:00:00 2001 From: iceling Date: Tue, 14 Jan 2020 10:30:17 +0800 Subject: [PATCH] 我的礼包添加提示 --- pages/giftpack/buygiftpack/giftpackbuy.js | 17 +++++++++++++---- pages/giftpack/giftpacklist/giftpacklist.js | 16 ++++++++++++++++ pages/giftpack/mygiftpack/mygiftpack.js | 86 +++++--------------------------------------------------------------------------------- 3 files changed, 34 insertions(+), 85 deletions(-) diff --git a/pages/giftpack/buygiftpack/giftpackbuy.js b/pages/giftpack/buygiftpack/giftpackbuy.js index 51ca204..d4f2510 100644 --- a/pages/giftpack/buygiftpack/giftpackbuy.js +++ b/pages/giftpack/buygiftpack/giftpackbuy.js @@ -37,7 +37,7 @@ Page({ th.getList(); }, onShow: function() { - + }, GetBuyPrice: function(e) { @@ -57,6 +57,9 @@ Page({ }, function() { my_confirm.open_cancel(0); + wx.showLoading({ + title: '加载中', + }) var json = { "actId": '', //活动Id "actType": '', //活动类型 1:新人礼、2:评价有礼、3:节日营销、4:生日营销 @@ -76,6 +79,7 @@ Page({ 'content-type': 'application/json' }, // 设置请求的 header success: function(res) { + wx.hideLoading(); if (res.data.code == 0) { var order_sn = res.data.data.orderSn; res = res.data.data.result; @@ -89,7 +93,9 @@ Page({ success: function(res) { getApp().goto(url); }, - fail: function(res) {} + fail: function(res) { + getApp().my_confirm("取消支付", 0, th); + } }); } else { getApp().my_warnning(res.data.msg, 0, th); @@ -99,7 +105,6 @@ Page({ } - ) @@ -118,6 +123,9 @@ Page({ }, function() { my_confirm.open_cancel(0); + wx.showLoading({ + title: '加载中', + }) var json = { "actId": '', //活动Id "actType": '', //活动类型 1:新人礼、2:评价有礼、3:节日营销、4:生日营销 @@ -136,6 +144,7 @@ Page({ 'content-type': 'application/json' }, // 设置请求的 header success: function(res) { + wx.hideLoading(); if (res.data.code == 0) { getApp().my_warnning("兑换成功!", 1, th); } else { @@ -197,7 +206,7 @@ Page({ var th = this; var url = e.currentTarget.dataset.url; getApp().goto(url); - + }, //下拉事件 onReachBottom: function() { diff --git a/pages/giftpack/giftpacklist/giftpacklist.js b/pages/giftpack/giftpacklist/giftpacklist.js index 3ed78b4..a7e6a29 100644 --- a/pages/giftpack/giftpacklist/giftpacklist.js +++ b/pages/giftpack/giftpacklist/giftpacklist.js @@ -61,6 +61,9 @@ Page({ }, function() { my_confirm.open_cancel(0); + wx.showLoading({ + title: '加载中', + }) var json = { "actId": '', //活动Id "actType": '', //活动类型 1:新人礼、2:评价有礼、3:节日营销、4:生日营销 @@ -80,6 +83,7 @@ Page({ 'content-type': 'application/json' }, // 设置请求的 header success: function(res) { + wx.hideLoading(); if (res.data.code == 0) { var res = res.data.data; var order_sn = res.orderSn; @@ -124,6 +128,9 @@ Page({ }, function() { my_confirm.open_cancel(0); + wx.showLoading({ + title: '加载中', + }) var json = { "actId": '', //活动Id "actType": '', //活动类型 1:新人礼、2:评价有礼、3:节日营销、4:生日营销 @@ -142,6 +149,7 @@ Page({ 'content-type': 'application/json' }, // 设置请求的 header success: function(res) { + wx.hideLoading(); if (res.data.code == 0) { getApp().my_warnning("兑换成功!", 1, th); } else { @@ -157,6 +165,9 @@ Page({ GetMyGiftList: function() { var _this = this; var th = this; + wx.showLoading({ + title: '加载中', + }) getApp().request.get('/api/weshop/marketing/my/giftbag/detail/get', { data: { "storeId": a.stoid, //商家ID @@ -164,6 +175,7 @@ Page({ "orderSn": th.data.orderSn }, success: function success(res) { + wx.hideLoading(); if (res.data.code == 0) { th.setData({ giftImage: th.data.iurl + res.data.data.lbUrl, @@ -279,6 +291,9 @@ Page({ //获取核销码 getcode: function() { var th = this; + wx.showLoading({ + title: '加载中', + }) var orderSn = th.data.orderSn; //订单号 var json = { "storeId": a.stoid, @@ -294,6 +309,7 @@ Page({ 'content-type': 'application/json' }, // 设置请求的 header success: function(res) { + wx.hideLoading(); if (res.data.code == 0) { th.setData({ code: res.data.data diff --git a/pages/giftpack/mygiftpack/mygiftpack.js b/pages/giftpack/mygiftpack/mygiftpack.js index e1c5ca3..6dd2691 100644 --- a/pages/giftpack/mygiftpack/mygiftpack.js +++ b/pages/giftpack/mygiftpack/mygiftpack.js @@ -28,8 +28,6 @@ Page({ }, onLoad: function(options) { - // this.getStorageID = options.stoid; - // this.getUserID = options.userid; var th = this; th.setData({ getStorageID: a.stoid, @@ -40,49 +38,15 @@ Page({ th.getList(); }, onShow: function() { - // this.pages = 1; - // this.pageSize = 10; - // this.loadingType = 0; - // this.getList(); - // var th = this; - // th.setData({ - // pages: 1, - // pageSize: 10, - // loadingType: 0 - // }) - // th.getList(); - }, - // methods: { - // BuyGift: function BuyGift() { - // /*销毁跳转*/ - // uni.reLaunch({ - // url: 'pages/giftpack/buygiftpack/giftpackbuy?stoid=' + this.getStorageID + '&userid=' + this.getUserID - // }); - - // }, - // GetGiftPackList: function(getId, ojb) { - // //不销毁调整 - // uni.navigateTo({ - // url: 'pages/giftpack/giftpacklist/giftpacklist?isBuy=0&stoid=' + this.getStorageID + '&userid=' + this.getUserID + '&id=' + - // getId - // }); - // }, + }, getList: function() { var th = this; - // if (th.data.loadingType) { - // return false; - // } - // // that.loadingType = 1; - // th.setData({ - // loadingType: 1 - // }) + wx.showLoading({ + title: '加载中', + }) getApp().request.get('/api/weshop/marketing/my/giftbag/page', { data: { - // "storeId": this.getStorageID, //商家ID - // "userId": this.getUserID, //用户ID - // "page": this.pages, - // "pageSize": this.pageSize storeId: th.data.getStorageID, //商家ID userId: th.data.getUserID, //用户ID page: th.data.curpage, @@ -108,47 +72,7 @@ Page({ is_read: 1 }) } - // if (res.data.code == 0) { - // if (res.data.data.total > 0) { - // // _this.isEmpty = false; - // _this.setData({ - // isEmpty: false - // }) - // } else { - // // _this.isEmpty = true; - // _this.setData({ - // isEmpty: true - // }) - // } - // if (res.data.data.pageData.length == 0) { - // // _this.loadingType = 2; - // _this.setData({ - // loadingType: 2 - // }) - // } else { - // var wareCard = that.wareCard; - // var is_resad = 0; - // // if (_this.wareCard.length < res.data.data.pageData.length) { - // if (wareCard.length < res.data.data.total) { - // for (var i = 0; i < res.data.data.pageData.length; i++) { - // wareCard.push(res.data.data.pageData[i]); - // } - // }else{ - // is_resad=1 - // } - // _this.setData({ - // wareCard: wareCard, - // is_resad: is_resad - // }) - - // // _this.loadingType = 0; - // _this.setData({ - // loadingType: 0 - // }) - // } - // } else { - - // } + } }); -- libgit2 0.21.4