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) => {
|
||||
@@ -26,22 +27,32 @@ const eb = (no) => {
|
||||
|
||||
// 微信支付
|
||||
const wxPay = (data) => {
|
||||
return request({
|
||||
url: 'mall/pay/' + data.order_no + '/wechat',
|
||||
data: data,
|
||||
method:'get'
|
||||
})
|
||||
return request({
|
||||
url: 'mall/pay/' + data.order_no + '/wechat',
|
||||
data: data,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
//支付宝支付
|
||||
const aliPay = (data) => {
|
||||
return request({
|
||||
url: 'mall/pay/' + data.order_no + '/alipay',
|
||||
data: data,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// EB支付
|
||||
const ebPay = (data) => {
|
||||
return request({
|
||||
url: 'mall/pay/' + data.order_no + '/eb'
|
||||
})
|
||||
return request({
|
||||
url: 'mall/pay/' + data.order_no + '/eb'
|
||||
})
|
||||
}
|
||||
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,101 +1,102 @@
|
||||
<template>
|
||||
<view class="PayStatus">
|
||||
<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">
|
||||
<!-- <view class="check" v-if='success' @click="check">查看权证</view> -->
|
||||
<view class="back" @click="back">返回首页</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="PayStatus">
|
||||
<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">
|
||||
<!-- <view class="check" v-if='success' @click="check">查看权证</view> -->
|
||||
<view class="back" @click="back">返回首页</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
success:false,// 支付失败false 支付成功true
|
||||
};
|
||||
},
|
||||
onLoad(e) {
|
||||
if(e.success === 'true'){
|
||||
uni.setNavigationBarTitle({
|
||||
title:'支付成功'
|
||||
})
|
||||
this.success=true
|
||||
}else{
|
||||
uni.setNavigationBarTitle({
|
||||
title:'支付失败'
|
||||
})
|
||||
this.success=false
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
success: false, // 支付失败false 支付成功true
|
||||
};
|
||||
},
|
||||
onLoad(e) {
|
||||
if (e.success === 'true') {
|
||||
uni.setNavigationBarTitle({
|
||||
title: '支付成功'
|
||||
})
|
||||
this.success = true
|
||||
} else {
|
||||
uni.setNavigationBarTitle({
|
||||
title: '支付失败'
|
||||
})
|
||||
this.success = false
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
check() {
|
||||
uni.reLaunch({
|
||||
url: '/pages/property/order/numberWeight'
|
||||
})
|
||||
},
|
||||
back() {
|
||||
uni.reLaunch({
|
||||
url: '/pages/equity/index'
|
||||
})
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
check() {
|
||||
uni.reLaunch({
|
||||
url:'/pages/property/order/numberWeight'
|
||||
})
|
||||
},
|
||||
back() {
|
||||
uni.reLaunch({
|
||||
url:'/pages/equity/index'
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.PayStatus {
|
||||
width: 100%;
|
||||
min-height: 100vh;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: flex-start;
|
||||
box-sizing: border-box;
|
||||
.PayStatus {
|
||||
width: 100%;
|
||||
min-height: 100vh;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: flex-start;
|
||||
box-sizing: border-box;
|
||||
|
||||
.payStatusImg {
|
||||
width: 300rpx;
|
||||
padding: 50rpx 0;
|
||||
margin-top: 100rpx;
|
||||
}
|
||||
.payStatusImg {
|
||||
width: 300rpx;
|
||||
padding: 50rpx 0;
|
||||
margin-top: 100rpx;
|
||||
}
|
||||
|
||||
.payTitle {
|
||||
font-size: 34rpx;
|
||||
font-weight: bold;
|
||||
color: #353535;
|
||||
}
|
||||
.payTitle {
|
||||
font-size: 34rpx;
|
||||
font-weight: bold;
|
||||
color: #353535;
|
||||
}
|
||||
|
||||
.payDes {
|
||||
font-size: 26rpx;
|
||||
color: #666;
|
||||
padding: 20rpx;
|
||||
margin-bottom: 30rpx;
|
||||
}
|
||||
.payDes {
|
||||
font-size: 26rpx;
|
||||
color: #666;
|
||||
padding: 20rpx;
|
||||
margin-bottom: 30rpx;
|
||||
}
|
||||
|
||||
.payBackCheck {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
justify-content: space-around;
|
||||
box-sizing: border-box;
|
||||
font-size: 28rpx;
|
||||
width: 100%;
|
||||
.payBackCheck {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
justify-content: space-around;
|
||||
box-sizing: border-box;
|
||||
font-size: 28rpx;
|
||||
width: 100%;
|
||||
|
||||
.check {
|
||||
border: $main-color solid 1rpx;
|
||||
color: $main-color;
|
||||
padding: 14rpx 50rpx;
|
||||
border-radius: 4rpx;
|
||||
}
|
||||
.check {
|
||||
border: $main-color solid 1rpx;
|
||||
color: $main-color;
|
||||
padding: 14rpx 50rpx;
|
||||
border-radius: 4rpx;
|
||||
}
|
||||
|
||||
.back {
|
||||
background-color: $main-color;
|
||||
color: #fff;
|
||||
padding: 14rpx 50rpx;
|
||||
border-radius: 4rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
.back {
|
||||
background-color: $main-color;
|
||||
color: #fff;
|
||||
padding: 14rpx 50rpx;
|
||||
border-radius: 4rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
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