Commit 9d087e61415733d127dfbd8e3f3a58c14bc6498f
1 parent
3b3e94a8
订单修改
Showing
3 changed files
with
27 additions
and
18 deletions
packageA/pages/cart2_ser/cart2_ser.js
| @@ -166,13 +166,21 @@ Page({ | @@ -166,13 +166,21 @@ Page({ | ||
| 166 | for (var i = 0; i < carr.length; i++) { | 166 | for (var i = 0; i < carr.length; i++) { |
| 167 | var good = null; | 167 | var good = null; |
| 168 | var item = carr[i]; | 168 | var item = carr[i]; |
| 169 | - await getApp().request.promiseGet("/api/weshop/serviceCard/get/" + oo.stoid + "/" + item.service_id, {}).then( | 169 | + await getApp().request.promiseGet("/api/weshop/serviceCard/get/" + oo.stoid + "/" + item.service_id, {}) |
| 170 | + .then( | ||
| 170 | res => { | 171 | res => { |
| 171 | - good = res.data.data; | 172 | + console.log('+++++++++', res.data.code); |
| 173 | + if(res.data.code == 0) { | ||
| 174 | + good = res.data.data; | ||
| 175 | + item.img_url = oo.imghost + good.imgUrl; | ||
| 176 | + item.erpItemID = good.erpItemID; | ||
| 177 | + } | ||
| 178 | + | ||
| 172 | }) | 179 | }) |
| 173 | - | ||
| 174 | - item.img_url = oo.imghost + good.imgUrl; | ||
| 175 | - item.erpItemID = good.erpItemID; | 180 | + |
| 181 | + // console.log('+++++++++', good); | ||
| 182 | + // item.img_url = oo.imghost + good.imgUrl; | ||
| 183 | + // item.erpItemID = good.erpItemID; | ||
| 176 | 184 | ||
| 177 | /*----接口要弄出来的,先顶着-----*/ | 185 | /*----接口要弄出来的,先顶着-----*/ |
| 178 | var pcid = item.pick_id; | 186 | var pcid = item.pick_id; |
| @@ -542,6 +550,7 @@ Page({ | @@ -542,6 +550,7 @@ Page({ | ||
| 542 | if (res.statusCode == 200) { | 550 | if (res.statusCode == 200) { |
| 543 | var data = res.data; | 551 | var data = res.data; |
| 544 | if (data.code == 0) { | 552 | if (data.code == 0) { |
| 553 | + th.data.order_id = data.data.order_id; | ||
| 545 | // console.log('myyyyyyyyyyyyyyyyyy', data.data); | 554 | // console.log('myyyyyyyyyyyyyyyyyy', data.data); |
| 546 | if (th.data.is_cart) { | 555 | if (th.data.is_cart) { |
| 547 | var list = th.data.cartlist_y; | 556 | var list = th.data.cartlist_y; |
| @@ -563,7 +572,9 @@ Page({ | @@ -563,7 +572,9 @@ Page({ | ||
| 563 | store_id: oo.stoid | 572 | store_id: oo.stoid |
| 564 | }, | 573 | }, |
| 565 | success: function(su) { | 574 | success: function(su) { |
| 575 | + | ||
| 566 | var n = su.data.data; | 576 | var n = su.data.data; |
| 577 | + // console.log('su---->', n); | ||
| 567 | let order_id = data.data.order_id; | 578 | let order_id = data.data.order_id; |
| 568 | th.weixinPay(n, | 579 | th.weixinPay(n, |
| 569 | function() { | 580 | function() { |
| @@ -623,7 +634,7 @@ Page({ | @@ -623,7 +634,7 @@ Page({ | ||
| 623 | console.log(n), getApp().showSuccess("支付成功!"); | 634 | console.log(n), getApp().showSuccess("支付成功!"); |
| 624 | "function" == typeof success && success(); | 635 | "function" == typeof success && success(); |
| 625 | wx.redirectTo({ | 636 | wx.redirectTo({ |
| 626 | - url: "../deposit/deposit" | 637 | + url: "/pages/payment/pay_success/pay_success?card=1&order_id=" + th.data.order_id, |
| 627 | }); | 638 | }); |
| 628 | }, | 639 | }, |
| 629 | fail: function(n) { | 640 | fail: function(n) { |
packageA/pages/details_serviceCard/details_serviceCard.js
| @@ -434,11 +434,11 @@ Page({ | @@ -434,11 +434,11 @@ Page({ | ||
| 434 | var n = res.data.data; | 434 | var n = res.data.data; |
| 435 | self.weixinPay(n, function() { | 435 | self.weixinPay(n, function() { |
| 436 | app.showWarning('支付成功'); | 436 | app.showWarning('支付成功'); |
| 437 | - setTimeout(function() { | ||
| 438 | - wx.reLaunch({ | ||
| 439 | - url: "/pages/payment/pay_success/pay_success?card=1&order_id=" + order_id, | ||
| 440 | - }) | ||
| 441 | - }, 1000) | 437 | + // setTimeout(function() { |
| 438 | + // wx.reLaunch({ | ||
| 439 | + // url: "/pages/payment/pay_success/pay_success?card=1&order_id=" + order_id, | ||
| 440 | + // }) | ||
| 441 | + // }, 1000) | ||
| 442 | }, function() { | 442 | }, function() { |
| 443 | app.showWarning('支付失败'); | 443 | app.showWarning('支付失败'); |
| 444 | // setTimeout(function() { | 444 | // setTimeout(function() { |
| @@ -455,6 +455,7 @@ Page({ | @@ -455,6 +455,7 @@ Page({ | ||
| 455 | //------调起支付框-------- | 455 | //------调起支付框-------- |
| 456 | weixinPay: function(n, success, fail) { | 456 | weixinPay: function(n, success, fail) { |
| 457 | if (!n) return false; | 457 | if (!n) return false; |
| 458 | + let order_id = this.data.details.order_id; | ||
| 458 | wx.requestPayment({ | 459 | wx.requestPayment({ |
| 459 | timeStamp: String(n.timeStamp), | 460 | timeStamp: String(n.timeStamp), |
| 460 | nonceStr: n.nonceStr, | 461 | nonceStr: n.nonceStr, |
| @@ -465,7 +466,7 @@ Page({ | @@ -465,7 +466,7 @@ Page({ | ||
| 465 | console.log(n), getApp().showSuccess("支付成功!"); | 466 | console.log(n), getApp().showSuccess("支付成功!"); |
| 466 | "function" == typeof success && success(); | 467 | "function" == typeof success && success(); |
| 467 | wx.redirectTo({ | 468 | wx.redirectTo({ |
| 468 | - url: "../deposit/deposit" | 469 | + url: "/pages/payment/pay_success/pay_success?card=1&order_id=" + order_id, |
| 469 | }); | 470 | }); |
| 470 | }, | 471 | }, |
| 471 | fail: function(n) { | 472 | fail: function(n) { |
pages/user/order_list/order_list.js
| @@ -2230,11 +2230,7 @@ Page({ | @@ -2230,11 +2230,7 @@ Page({ | ||
| 2230 | var n = res.data.data; | 2230 | var n = res.data.data; |
| 2231 | self.weixinPay(n, function() { | 2231 | self.weixinPay(n, function() { |
| 2232 | app.showWarning('支付成功'); | 2232 | app.showWarning('支付成功'); |
| 2233 | - setTimeout(function() { | ||
| 2234 | - wx.reLaunch({ | ||
| 2235 | - url: "/pages/payment/pay_success/pay_success?card=1&order_id=" + order_id, | ||
| 2236 | - }) | ||
| 2237 | - }, 1000) | 2233 | + |
| 2238 | }, function() { | 2234 | }, function() { |
| 2239 | app.showWarning('支付失败'); | 2235 | app.showWarning('支付失败'); |
| 2240 | // setTimeout(function() { | 2236 | // setTimeout(function() { |
| @@ -2250,6 +2246,7 @@ Page({ | @@ -2250,6 +2246,7 @@ Page({ | ||
| 2250 | //------调起支付框-------- | 2246 | //------调起支付框-------- |
| 2251 | weixinPay: function(n, success, fail) { | 2247 | weixinPay: function(n, success, fail) { |
| 2252 | if (!n) return false; | 2248 | if (!n) return false; |
| 2249 | + let order_id = item.order_id; | ||
| 2253 | wx.requestPayment({ | 2250 | wx.requestPayment({ |
| 2254 | timeStamp: String(n.timeStamp), | 2251 | timeStamp: String(n.timeStamp), |
| 2255 | nonceStr: n.nonceStr, | 2252 | nonceStr: n.nonceStr, |
| @@ -2260,7 +2257,7 @@ Page({ | @@ -2260,7 +2257,7 @@ Page({ | ||
| 2260 | console.log(n), getApp().showSuccess("支付成功!"); | 2257 | console.log(n), getApp().showSuccess("支付成功!"); |
| 2261 | "function" == typeof success && success(); | 2258 | "function" == typeof success && success(); |
| 2262 | wx.redirectTo({ | 2259 | wx.redirectTo({ |
| 2263 | - url: "../deposit/deposit" | 2260 | + url: "/pages/payment/pay_success/pay_success?card=1&order_id=" + order_id, |
| 2264 | }); | 2261 | }); |
| 2265 | }, | 2262 | }, |
| 2266 | fail: function(n) { | 2263 | fail: function(n) { |