merge
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
|
||||
/**
|
||||
* Web唐明明
|
||||
* 匆匆数载恍如梦,岁月迢迢华发增。
|
||||
@@ -6,7 +5,9 @@
|
||||
* moduleName: 订单
|
||||
*/
|
||||
|
||||
import { request } from '../index'
|
||||
import {
|
||||
request
|
||||
} from '../index'
|
||||
|
||||
// 创建,确认订单
|
||||
const buy = (data, method) => {
|
||||
@@ -33,6 +34,15 @@ const wxPay = (data) => {
|
||||
})
|
||||
}
|
||||
|
||||
//支付宝支付
|
||||
const aliPay = (data) => {
|
||||
return request({
|
||||
url: 'mall/pay/' + data.order_no + '/alipay',
|
||||
data: data,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// EB支付
|
||||
const ebPay = (data) => {
|
||||
return request({
|
||||
@@ -43,5 +53,6 @@ export {
|
||||
buy,
|
||||
eb,
|
||||
wxPay,
|
||||
aliPay,
|
||||
ebPay
|
||||
}
|
||||
|
||||
@@ -48,6 +48,17 @@
|
||||
<u-icon v-if="selectTypeId!== '2'" name="checkmark-circle" color="#f7f7f7" size="50"></u-icon>
|
||||
<u-icon v-else name="checkmark-circle-fill" color="#8b64fd" size="50"></u-icon>
|
||||
</view>
|
||||
<view class="pay-select-item" @click="selectPay('3')">
|
||||
<view class="pay-left">
|
||||
<u-icon class="wx-icon" name="zhifubao" color="#fff" size="40"></u-icon>
|
||||
<view class="pay-wx-title">
|
||||
支付宝支付
|
||||
<span>推荐支付宝用户使用</span>
|
||||
</view>
|
||||
</view>
|
||||
<u-icon v-if="selectTypeId!== '3'" name="checkmark-circle" color="#f7f7f7" size="50"></u-icon>
|
||||
<u-icon v-else name="checkmark-circle-fill" color="#8b64fd" size="50"></u-icon>
|
||||
</view>
|
||||
<!-- <view class="pay-select-item" @click="selectPay('1')">
|
||||
<view class="pay-left">
|
||||
<u-icon class="wx-icon" name="integral-fill" color="#fff" size="40"></u-icon>
|
||||
@@ -98,6 +109,7 @@
|
||||
} from '@/apis/interfaces/goods'
|
||||
import {
|
||||
wxPay,
|
||||
aliPay,
|
||||
ebPay
|
||||
} from '@/apis/interfaces/order'
|
||||
export default {
|
||||
@@ -177,6 +189,12 @@
|
||||
order_no: this.order_no,
|
||||
type: 'app'
|
||||
}
|
||||
} else if (this.selectTypeId === '3') {
|
||||
apiUrl = aliPay
|
||||
data = {
|
||||
order_no: this.order_no,
|
||||
type: 'app'
|
||||
}
|
||||
} else {
|
||||
apiUrl = ebPay
|
||||
data = {
|
||||
@@ -184,6 +202,9 @@
|
||||
}
|
||||
}
|
||||
apiUrl(data).then(res => {
|
||||
console.log(res)
|
||||
debugger;
|
||||
// 微信支付
|
||||
if (this.selectTypeId === '2') {
|
||||
if (typeof res === 'string') {
|
||||
let payInfo = JSON.parse(res)
|
||||
@@ -234,6 +255,56 @@
|
||||
}, 3000);
|
||||
}
|
||||
}
|
||||
// 支付宝支付
|
||||
else if (this.selectTypeId === '3') {
|
||||
if (typeof res === 'string') {
|
||||
uni.requestPayment({
|
||||
provider: "alipay",
|
||||
orderInfo: res,
|
||||
success: res => {
|
||||
uni.showToast({
|
||||
title: '支付成功',
|
||||
duration: 3000,
|
||||
mask: true,
|
||||
icon: 'none'
|
||||
})
|
||||
setTimeout(() => {
|
||||
uni.reLaunch({
|
||||
url: '/pages/goods/payStatus?success=true'
|
||||
})
|
||||
this.canPay = true
|
||||
}, 3000);
|
||||
},
|
||||
fail: (err) => {
|
||||
uni.showToast({
|
||||
title: '支付失败',
|
||||
duration: 3000,
|
||||
mask: true,
|
||||
icon: 'none'
|
||||
})
|
||||
setTimeout(() => {
|
||||
uni.reLaunch({
|
||||
url: '/pages/goods/payStatus?success=false'
|
||||
})
|
||||
this.canPay = true
|
||||
}, 3000);
|
||||
}
|
||||
})
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: '创建订单成功',
|
||||
duration: 3000,
|
||||
mask: true,
|
||||
icon: 'none'
|
||||
})
|
||||
setTimeout(() => {
|
||||
this.canPay = true
|
||||
uni.reLaunch({
|
||||
url: '/pages/goods/payStatus?success=true'
|
||||
})
|
||||
}, 3000);
|
||||
}
|
||||
}
|
||||
}).catch(err => {
|
||||
uni.showToast({
|
||||
title: err.message,
|
||||
@@ -276,6 +347,8 @@
|
||||
}
|
||||
} else if (id === '2') {
|
||||
this.selectTypeId = id
|
||||
} else if (id === '3') {
|
||||
this.selectTypeId = id
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<template>
|
||||
<view class="PayStatus">
|
||||
<image class="payStatusImg" :src="success?'/static/imgs/paySuccess.png':'/static/imgs/payFail.png'" mode="widthFix" />
|
||||
<image class="payStatusImg" :src="success?'/static/imgs/paySuccess.png':'/static/imgs/payFail.png'"
|
||||
mode="widthFix" />
|
||||
<view class="payTitle">{{success?'支付成功':'支付失败'}}</view>
|
||||
<view class="payDes">{{success?'您已支付完成,订单稍后配送':'吼吼,您的支付未完成'}}</view>
|
||||
<view class="payBackCheck">
|
||||
|
||||
115
unpackage/dist/dev/app-plus/app-service.js
vendored
115
unpackage/dist/dev/app-plus/app-service.js
vendored
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user