Explorar o código

支付宝支付调整

DELL %!s(int64=3) %!d(string=hai) anos
pai
achega
a8a655dc62

+ 16 - 10
src/components/pay-popup/pay-popup.vue

@@ -146,18 +146,24 @@
 							// #endif
 							$http.post('/api/v1/mp/user/ticket/order/pay', data).then(ele => {
 								if (ele.code == 0) {
+									console.log(ele);
 									// #ifdef MP-ALIPAY
-									uni.requestPayment({
-										orderInfo: ele.data.pay_info,
-										success() {
-											uni.showToast({
-												title: '支付成功',
-												icon: 'success',
-												duration: 2000
-											})
-											_this.success(res.data.orderId)
+									my.tradePay({
+										tradeNO: ele.data.pay_info,
+										success:(res) => {
+											if(res.resultCode == '9000'){
+												uni.showToast({
+													title: '支付成功',
+													icon: 'success',
+													duration: 2000
+												})
+												_this.success(res.data.orderId)//跳转抽奖详情页
+											}else {
+												payIng = false
+												_this.close()
+											}
 										},
-										fail() {
+										fail:(res) => {
 											payIng = false
 											_this.close()
 										}

+ 16 - 12
src/packageGoods/order/detail.vue

@@ -208,19 +208,23 @@
 					uni.hideLoading();
 					if (ele.code == 0) {
 						// #ifdef MP-ALIPAY
-						uni.requestPayment({
-							orderInfo: ele.data.pay_info,
-							success() {
-								uni.showToast({
-									title: '支付成功',
-									icon: 'success',
-									duration: 2000
-								})
-								setTimeout(() => {
-									uni.navigateBack({
-										delta: 1
+						my.tradePay({
+							tradeNO: ele.data.pay_info,
+							success(res) {
+								if(res.resultCode == '9000'){
+									uni.showToast({
+										title: '支付成功',
+										icon: 'success',
+										duration: 2000
 									})
-								}, 500)
+									setTimeout(() => {
+										uni.navigateBack({
+											delta: 1
+										})
+									}, 500)
+								}else {
+									payIng = false
+								}
 							},
 							fail() {
 								payIng = false

+ 13 - 9
src/packageGoods/order/index.vue

@@ -193,15 +193,19 @@
 					payIng = true
 					if (ele.code == 0) {
 						// #ifdef MP-ALIPAY
-						uni.requestPayment({
-							orderInfo: ele.data.pay_info,
-							success() {
-								uni.showToast({
-									title: '支付成功',
-									icon: 'success',
-									duration: 2000
-								})
-								_this.pageList()
+						my.tradePay({
+							tradeNO: ele.data.pay_info,
+							success(res) {
+								if(res.resultCode == '9000'){
+									uni.showToast({
+										title: '支付成功',
+										icon: 'success',
+										duration: 2000
+									})
+									_this.pageList()
+								}else {
+									payIng = false
+								}
 							},
 							fail() {
 								payIng = false

+ 22 - 12
src/packageGoods/order/settlement.vue

@@ -201,19 +201,29 @@
 							$http.post('/api/v1/mp/user/deliver/order/pay', data).then(ele => {
 								if (ele.code == 0) {
 									// #ifdef MP-ALIPAY
-									uni.requestPayment({
-										orderInfo: ele.data.pay_info,
-										success() {
-											uni.showToast({
-												title: '支付成功',
-												icon: 'success',
-												duration: 2000
-											})
-											setTimeout(() => {
-												uni.redirectTo({
-													url: `/packageGoods/order/index`
+									my.tradePay({
+										tradeNO: ele.data.pay_info,
+										success(res) {
+											if(res.resultCode == '9000'){
+												uni.showToast({
+													title: '支付成功',
+													icon: 'success',
+													duration: 2000
 												})
-											}, 500)
+												setTimeout(() => {
+													uni.redirectTo({
+														url: `/packageGoods/order/index`
+													})
+												}, 500)
+											}else {
+												payIng = false
+												setTimeout(() => {
+													uni.redirectTo({
+														url: `/packageGoods/order/index`
+													})
+												}, 500)
+											}
+											
 										},
 										fail() {
 											payIng = false

+ 1 - 1
src/pages/index/index.vue

@@ -111,7 +111,7 @@
 							</image>
 						</view>
 						<view class="ticket-btn-center-wrap flex">
-							<!-- <view class="ticket-btn-center-wrap__title">刮开<br />盲票</view> -->
+							<view class="ticket-btn-center-wrap__title">刮开<br />盲票</view>
 						</view>
 					</view>
 					<view class="ticket-btn-right flex" @click="toTicket">