Commit 81251142524080c3cd92894e325758b6a541675c

Authored by 前端研发-钱巧玲
1 parent 2513173d

添加数据的时候页面不能滑动

pages/giftpack/buygiftpack/giftpackbuy.js
... ... @@ -71,6 +71,34 @@ Page({
71 71 };
72 72 var data = JSON.stringify(json);
73 73 var url = that.url + "/api/weshop/marketing/buy/receive/gift/record/insert";
  74 + getApp().request.json_post(url, json,
  75 + function(res) {
  76 + if (res.data.code == 0) {
  77 + var order_sn = res.data.data.orderSn;
  78 + res = res.data.data.result;
  79 + var url = "/pages/giftpack/payment/payment?money=" + money + "&order_sn=" + order_sn;
  80 + wx.requestPayment({
  81 + timeStamp: String(res.timeStamp),
  82 + nonceStr: res.nonceStr,
  83 + package: res.packageValue,
  84 + signType: res.signType,
  85 + paySign: res.paySign,
  86 + success: function(res) {
  87 + getApp().goto(url);
  88 + },
  89 + fail: function(res) {
  90 + getApp().my_confirm("取消支付", 0, th);
  91 + }
  92 + });
  93 + } else {
  94 + getApp().my_warnning(res.data.msg, 0, th);
  95 + }
  96 + },
  97 + function(res) {
  98 +
  99 + }
  100 +
  101 + )
74 102 wx.request({
75 103 url: url,
76 104 data: data,
... ... @@ -136,32 +164,27 @@ Page({
136 164 };
137 165 var data = JSON.stringify(json);
138 166 var url = that.url + "/api/weshop/marketing/buy/receive/gift/record/insert";
139   - wx.request({
140   - url: url,
141   - data: data,
142   - method: 'post',
143   - header: {
144   - 'content-type': 'application/json'
145   - }, // 设置请求的 header
146   - success: function(res) {
147   - wx.hideLoading();
  167 + getApp().request.json_post(url, json,
  168 + function(res) {
148 169 if (res.data.code == 0) {
149 170 getApp().my_warnning("兑换成功!", 1, th);
150 171 } else {
151 172 getApp().my_warnning(res.data.msg, 0, th);
152 173 }
  174 + },
  175 + function(res) {
  176 +
153 177 }
154   - })
  178 +
  179 + )
155 180  
156 181 })
157 182  
158 183 },
159 184 getList: function(e) {
160 185 var th = this;
161   - wx.showLoading({
162   - title: '加载中',
163   - });
164 186 getApp().request.get('/api/weshop/marketing/giftbag/page', {
  187 + isShowLoading: true,
165 188 data: {
166 189 storeId: th.data.getStorageID, //商家ID
167 190 userId: th.data.getUserID, //用户ID
... ...
pages/giftpack/giftpacklist/giftpacklist.js
... ... @@ -61,9 +61,7 @@ Page({
61 61 },
62 62 function() {
63 63 my_confirm.open_cancel(0);
64   - wx.showLoading({
65   - title: '加载中',
66   - })
  64 +
67 65 var json = {
68 66 "actId": '', //活动Id
69 67 "actType": '', //活动类型 1:新人礼、2:评价有礼、3:节日营销、4:生日营销
... ... @@ -75,38 +73,37 @@ Page({
75 73 };
76 74 var data = JSON.stringify(json);
77 75 var url = that.url + "/api/weshop/marketing/buy/receive/gift/record/insert";
78   - wx.request({
79   - url: url,
80   - data: data,
81   - method: 'post',
82   - header: {
83   - 'content-type': 'application/json'
84   - }, // 设置请求的 header
85   - success: function(res) {
86   - wx.hideLoading();
87   - if (res.data.code == 0) {
88   - var res = res.data.data;
89   - var order_sn = res.orderSn;
90   - var url = "/pages/giftpack/payment/payment?money=" + money + "&order_sn=" + order_sn;
91   - wx.requestPayment({
92   - timeStamp: String(res.result.timeStamp),
93   - nonceStr: res.result.nonceStr,
94   - package: res.result.packageValue,
95   - signType: res.result.signType,
96   - paySign: res.result.paySign,
97   - success: function(n) {
98   - getApp().goto(url);
99   - },
100   - fail: function(n) {
101   - getApp().my_confirm("取消支付", 0, th);
102   - }
103   - });
104   - } else {
105   - getApp().my_warnning(res.data.msg, 0, th);
106   - }
  76 +
  77 + getApp().request.json_post(url,json,
  78 + function(res){
  79 + if (res.data.code == 0) {
  80 + var res = res.data.data;
  81 + var order_sn = res.orderSn;
  82 + var url = "/pages/giftpack/payment/payment?money=" + money + "&order_sn=" + order_sn;
  83 + wx.requestPayment({
  84 + timeStamp: String(res.result.timeStamp),
  85 + nonceStr: res.result.nonceStr,
  86 + package: res.result.packageValue,
  87 + signType: res.result.signType,
  88 + paySign: res.result.paySign,
  89 + success: function (n) {
  90 + getApp().goto(url);
  91 + },
  92 + fail: function (n) {
  93 + getApp().my_confirm("取消支付", 0, th);
  94 + }
  95 + });
  96 + } else {
  97 + getApp().my_warnning(res.data.msg, 0, th);
107 98 }
108   - })
  99 + },
  100 + function(res){
  101 +
  102 + }
  103 +
  104 + )
109 105  
  106 +
110 107 }
111 108  
112 109  
... ... @@ -128,9 +125,6 @@ Page({
128 125 },
129 126 function() {
130 127 my_confirm.open_cancel(0);
131   - wx.showLoading({
132   - title: '加载中',
133   - })
134 128 var json = {
135 129 "actId": '', //活动Id
136 130 "actType": '', //活动类型 1:新人礼、2:评价有礼、3:节日营销、4:生日营销
... ... @@ -141,23 +135,19 @@ Page({
141 135 };
142 136 var data = JSON.stringify(json);
143 137 var url = that.url + "/api/weshop/marketing/buy/receive/gift/record/insert";
144   - wx.request({
145   - url: url,
146   - data: data,
147   - method: 'post',
148   - header: {
149   - 'content-type': 'application/json'
150   - }, // 设置请求的 header
151   - success: function(res) {
152   - wx.hideLoading();
153   - if (res.data.code == 0) {
154   - getApp().my_warnning("兑换成功!", 1, th);
155   - } else {
156   - getApp().my_warnning(res.data.msg, 0, th);
157   - }
  138 + getApp().request.json_post(url, json,
  139 + function (res) {
  140 + if (res.data.code == 0) {
  141 + getApp().my_warnning("兑换成功!", 1, th);
  142 + } else {
  143 + getApp().my_warnning(res.data.msg, 0, th);
  144 + }
  145 + },
  146 + function (res) {
  147 +
158 148 }
159   - })
160 149  
  150 + )
161 151 })
162 152  
163 153  
... ... @@ -165,9 +155,6 @@ Page({
165 155 GetMyGiftList: function() {
166 156 var _this = this;
167 157 var th = this;
168   - wx.showLoading({
169   - title: '加载中',
170   - })
171 158 getApp().request.get('/api/weshop/marketing/my/giftbag/detail/get', {
172 159 data: {
173 160 "storeId": a.stoid, //商家ID
... ...
pages/giftpack/mygiftpack/mygiftpack.js
... ... @@ -42,10 +42,9 @@ Page({
42 42 },
43 43 getList: function() {
44 44 var th = this;
45   - wx.showLoading({
46   - title: '加载中',
47   - })
  45 +
48 46 getApp().request.get('/api/weshop/marketing/my/giftbag/page', {
  47 + isShowLoading:true,
49 48 data: {
50 49 storeId: th.data.getStorageID, //商家ID
51 50 userId: th.data.getUserID, //用户ID
... ...