merge
This commit is contained in:
@@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Web唐明明
|
* Web唐明明
|
||||||
* 匆匆数载恍如梦,岁月迢迢华发增。
|
* 匆匆数载恍如梦,岁月迢迢华发增。
|
||||||
@@ -6,7 +5,9 @@
|
|||||||
* moduleName: 订单
|
* moduleName: 订单
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { request } from '../index'
|
import {
|
||||||
|
request
|
||||||
|
} from '../index'
|
||||||
|
|
||||||
// 创建,确认订单
|
// 创建,确认订单
|
||||||
const buy = (data, method) => {
|
const buy = (data, method) => {
|
||||||
@@ -29,7 +30,16 @@ const wxPay = (data) => {
|
|||||||
return request({
|
return request({
|
||||||
url: 'mall/pay/' + data.order_no + '/wechat',
|
url: 'mall/pay/' + data.order_no + '/wechat',
|
||||||
data: data,
|
data: data,
|
||||||
method:'get'
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
//支付宝支付
|
||||||
|
const aliPay = (data) => {
|
||||||
|
return request({
|
||||||
|
url: 'mall/pay/' + data.order_no + '/alipay',
|
||||||
|
data: data,
|
||||||
|
method: 'get'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -43,5 +53,6 @@ export {
|
|||||||
buy,
|
buy,
|
||||||
eb,
|
eb,
|
||||||
wxPay,
|
wxPay,
|
||||||
|
aliPay,
|
||||||
ebPay
|
ebPay
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -48,6 +48,17 @@
|
|||||||
<u-icon v-if="selectTypeId!== '2'" name="checkmark-circle" color="#f7f7f7" size="50"></u-icon>
|
<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>
|
<u-icon v-else name="checkmark-circle-fill" color="#8b64fd" size="50"></u-icon>
|
||||||
</view>
|
</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-select-item" @click="selectPay('1')">
|
||||||
<view class="pay-left">
|
<view class="pay-left">
|
||||||
<u-icon class="wx-icon" name="integral-fill" color="#fff" size="40"></u-icon>
|
<u-icon class="wx-icon" name="integral-fill" color="#fff" size="40"></u-icon>
|
||||||
@@ -98,6 +109,7 @@
|
|||||||
} from '@/apis/interfaces/goods'
|
} from '@/apis/interfaces/goods'
|
||||||
import {
|
import {
|
||||||
wxPay,
|
wxPay,
|
||||||
|
aliPay,
|
||||||
ebPay
|
ebPay
|
||||||
} from '@/apis/interfaces/order'
|
} from '@/apis/interfaces/order'
|
||||||
export default {
|
export default {
|
||||||
@@ -177,6 +189,12 @@
|
|||||||
order_no: this.order_no,
|
order_no: this.order_no,
|
||||||
type: 'app'
|
type: 'app'
|
||||||
}
|
}
|
||||||
|
} else if (this.selectTypeId === '3') {
|
||||||
|
apiUrl = aliPay
|
||||||
|
data = {
|
||||||
|
order_no: this.order_no,
|
||||||
|
type: 'app'
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
apiUrl = ebPay
|
apiUrl = ebPay
|
||||||
data = {
|
data = {
|
||||||
@@ -184,6 +202,9 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
apiUrl(data).then(res => {
|
apiUrl(data).then(res => {
|
||||||
|
console.log(res)
|
||||||
|
debugger;
|
||||||
|
// 微信支付
|
||||||
if (this.selectTypeId === '2') {
|
if (this.selectTypeId === '2') {
|
||||||
if (typeof res === 'string') {
|
if (typeof res === 'string') {
|
||||||
let payInfo = JSON.parse(res)
|
let payInfo = JSON.parse(res)
|
||||||
@@ -234,6 +255,56 @@
|
|||||||
}, 3000);
|
}, 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 => {
|
}).catch(err => {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: err.message,
|
title: err.message,
|
||||||
@@ -276,6 +347,8 @@
|
|||||||
}
|
}
|
||||||
} else if (id === '2') {
|
} else if (id === '2') {
|
||||||
this.selectTypeId = id
|
this.selectTypeId = id
|
||||||
|
} else if (id === '3') {
|
||||||
|
this.selectTypeId = id
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="PayStatus">
|
<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="payTitle">{{success?'支付成功':'支付失败'}}</view>
|
||||||
<view class="payDes">{{success?'您已支付完成,订单稍后配送':'吼吼,您的支付未完成'}}</view>
|
<view class="payDes">{{success?'您已支付完成,订单稍后配送':'吼吼,您的支付未完成'}}</view>
|
||||||
<view class="payBackCheck">
|
<view class="payBackCheck">
|
||||||
@@ -14,31 +15,31 @@
|
|||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
success:false,// 支付失败false 支付成功true
|
success: false, // 支付失败false 支付成功true
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
onLoad(e) {
|
onLoad(e) {
|
||||||
if(e.success === 'true'){
|
if (e.success === 'true') {
|
||||||
uni.setNavigationBarTitle({
|
uni.setNavigationBarTitle({
|
||||||
title:'支付成功'
|
title: '支付成功'
|
||||||
})
|
})
|
||||||
this.success=true
|
this.success = true
|
||||||
}else{
|
} else {
|
||||||
uni.setNavigationBarTitle({
|
uni.setNavigationBarTitle({
|
||||||
title:'支付失败'
|
title: '支付失败'
|
||||||
})
|
})
|
||||||
this.success=false
|
this.success = false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
check() {
|
check() {
|
||||||
uni.reLaunch({
|
uni.reLaunch({
|
||||||
url:'/pages/property/order/numberWeight'
|
url: '/pages/property/order/numberWeight'
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
back() {
|
back() {
|
||||||
uni.reLaunch({
|
uni.reLaunch({
|
||||||
url:'/pages/equity/index'
|
url: '/pages/equity/index'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
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