更新项目配置和添加小程序模块
- 修改 ArticleController.java - 更新 application.yml 配置 - 更新 frontend/.env.production 环境配置 - 添加 single_uniapp22miao 小程序模块 - 添加 logs 目录
This commit is contained in:
1340
single_uniapp22miao/pages/order/order_confirm/index.vue
Normal file
1340
single_uniapp22miao/pages/order/order_confirm/index.vue
Normal file
File diff suppressed because it is too large
Load Diff
1119
single_uniapp22miao/pages/order/order_details/index.vue
Normal file
1119
single_uniapp22miao/pages/order/order_details/index.vue
Normal file
File diff suppressed because it is too large
Load Diff
302
single_uniapp22miao/pages/order/order_pay_status/index.vue
Normal file
302
single_uniapp22miao/pages/order/order_pay_status/index.vue
Normal file
@@ -0,0 +1,302 @@
|
||||
<template>
|
||||
<view :data-theme="theme">
|
||||
<view class='payment-status'>
|
||||
<!--失败时: 用icon-iconfontguanbi fail替换icon-duihao2 bg-color-->
|
||||
<view class='iconfont icons icon-duihao2 bg_color'
|
||||
v-if="order_pay_info.paid === 1"></view>
|
||||
<view v-if="order_pay_info.paid === 2" class='iconfont icons icon-iconfontguanbi'></view>
|
||||
<!-- 失败时:订单支付失败 -->
|
||||
<view class='status' v-if="order_pay_info.payType != 'offline'">{{status==2 ? '订单取消支付' : errMsg ? '订单支付异常':payResult }}</view>
|
||||
<view class='status' v-else>订单创建成功</view>
|
||||
<view class='wrapper'>
|
||||
<view class='item acea-row row-between-wrapper'>
|
||||
<view>订单编号</view>
|
||||
<view class='itemCom'>{{order_pay_info.orderId}}</view>
|
||||
</view>
|
||||
<view class='item acea-row row-between-wrapper'>
|
||||
<view>下单时间</view>
|
||||
<view class='itemCom'>{{order_pay_info.createTime?order_pay_info.createTime:'-'}}</view>
|
||||
</view>
|
||||
<view class='item acea-row row-between-wrapper'>
|
||||
<view>支付方式</view>
|
||||
<view class='itemCom' v-if="order_pay_info.payType=='weixin'">微信支付</view>
|
||||
<view class='itemCom' v-else-if="order_pay_info.payType=='yue'">余额支付</view>
|
||||
<view class='itemCom' v-else-if="order_pay_info.payType=='offline'">线下支付</view>
|
||||
<view class='itemCom' v-else-if="order_pay_info.payType=='alipay'">支付宝支付</view>
|
||||
</view>
|
||||
<view class='item acea-row row-between-wrapper'>
|
||||
<view>支付金额</view>
|
||||
<view class='itemCom'>{{order_pay_info.payPrice}}</view>
|
||||
</view>
|
||||
<!--失败时加上这个 -->
|
||||
<view class='item acea-row row-between-wrapper'
|
||||
v-if="!order_pay_info.paid && order_pay_info.payType != 'offline'">
|
||||
<view>失败原因</view>
|
||||
<view class='itemCom'>{{status==2 ? '取消支付':msg}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<!--失败时: 重新购买 -->
|
||||
<view @tap="goOrderDetails">
|
||||
<button formType="submit" class='returnBnt bg_color' hover-class='none'>查看订单</button>
|
||||
</view>
|
||||
<button @click="goPink(order_pay_info.pinkId)" class='returnBnt cart_color' formType="submit"
|
||||
hover-class='none'
|
||||
v-if="order_pay_info.pinkId && order_pay_info.paid!=0 && status!=2 && status!=1">邀请好友参团</button>
|
||||
<button @click="goIndex" class='returnBnt cart-color' formType="submit" hover-class='none'
|
||||
v-else>返回首页</button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
getOrderDetail,
|
||||
wechatQueryPayResult
|
||||
} from '@/api/order.js';
|
||||
import {
|
||||
openOrderSubscribe
|
||||
} from '@/utils/SubscribeMessage.js';
|
||||
import {
|
||||
toLogin
|
||||
} from '@/libs/login.js';
|
||||
import {
|
||||
mapGetters
|
||||
} from "vuex";
|
||||
let app = getApp();
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
orderId: '',
|
||||
order_pay_info: {
|
||||
paid: 0,
|
||||
_status: {}
|
||||
},
|
||||
status: 0,
|
||||
msg: '',
|
||||
errMsg: false,
|
||||
payResult: '订单查询中...',
|
||||
theme:app.globalData.theme,
|
||||
};
|
||||
},
|
||||
computed: mapGetters(['isLogin']),
|
||||
watch: {
|
||||
isLogin: {
|
||||
handler: function(newV, oldV) {
|
||||
if (newV) {
|
||||
this.getOrderPayInfo();
|
||||
}
|
||||
},
|
||||
deep: true
|
||||
}
|
||||
},
|
||||
onLoad: function(options) {
|
||||
if (!options.order_id) return this.$util.Tips({
|
||||
title: '缺少参数无法查看订单支付状态'
|
||||
}, {
|
||||
tab: 3,
|
||||
url: 1
|
||||
});
|
||||
this.orderId = options.order_id;
|
||||
this.status = options.status || 0;
|
||||
if (this.isLogin) {
|
||||
this.getOrderPayInfo();
|
||||
} else {
|
||||
toLogin();
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
wechatQueryPay() {
|
||||
wechatQueryPayResult(this.orderId).then(res => {
|
||||
this.payResult = '支付成功';
|
||||
uni.setNavigationBarTitle({
|
||||
title: '支付成功'
|
||||
});
|
||||
this.order_pay_info.paid = 1;
|
||||
uni.hideLoading();
|
||||
})
|
||||
.catch(err => {
|
||||
this.order_pay_info.paid = 2;
|
||||
this.errMsg = true;
|
||||
this.msg = err;
|
||||
uni.hideLoading();
|
||||
this.$util.Tips({
|
||||
title: err
|
||||
});
|
||||
});
|
||||
},
|
||||
onLoadFun: function() {
|
||||
this.getOrderPayInfo();
|
||||
},
|
||||
/**
|
||||
*
|
||||
* 支付完成查询支付状态
|
||||
*
|
||||
*/
|
||||
getOrderPayInfo: function() {
|
||||
let that = this;
|
||||
uni.showLoading({
|
||||
title: '正在加载中'
|
||||
});
|
||||
getOrderDetail(that.orderId).then(res => {
|
||||
that.$set(that, 'order_pay_info', res.data);
|
||||
if (res.data.payType === 'weixin') {
|
||||
setTimeout(()=>{
|
||||
that.wechatQueryPay();
|
||||
},2000);
|
||||
}else {
|
||||
uni.setNavigationBarTitle({
|
||||
title: res.data.paid ? '支付成功' : '未支付'
|
||||
});
|
||||
if(res.data.paid){
|
||||
this.payResult = '支付成功';
|
||||
this.order_pay_info.paid = 1;
|
||||
}else{
|
||||
this.payResult = '支付失败';
|
||||
this.order_pay_info.paid = 2;
|
||||
}
|
||||
uni.hideLoading();
|
||||
}
|
||||
|
||||
}).catch(err => {
|
||||
uni.hideLoading();
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 去首页关闭当前所有页面
|
||||
*/
|
||||
goIndex: function(e) {
|
||||
uni.switchTab({
|
||||
url: '/pages/index/index'
|
||||
});
|
||||
},
|
||||
// 去参团页面;
|
||||
goPink: function(id) {
|
||||
uni.navigateTo({
|
||||
url: '/pages/activity/goods_combination_status/index?id=' + id
|
||||
});
|
||||
},
|
||||
/**
|
||||
*
|
||||
* 去订单详情页面
|
||||
*/
|
||||
goOrderDetails: function(e) {
|
||||
let that = this;
|
||||
// #ifdef MP
|
||||
uni.showLoading({
|
||||
title: '正在加载',
|
||||
})
|
||||
openOrderSubscribe().then(res => {
|
||||
uni.hideLoading();
|
||||
uni.navigateTo({
|
||||
url: '/pages/order/order_details/index?order_id=' + that.orderId
|
||||
});
|
||||
}).catch(() => {
|
||||
uni.hideLoading();
|
||||
});
|
||||
// #endif
|
||||
// #ifndef MP
|
||||
uni.navigateTo({
|
||||
url: '/pages/order/order_details/index?order_id=' + that.orderId
|
||||
})
|
||||
// #endif
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.icon-iconfontguanbi {
|
||||
background-color: #999 !important;
|
||||
text-shadow: none !important;
|
||||
}
|
||||
.bg_color{
|
||||
@include main_bg_color(theme);
|
||||
}
|
||||
.cart_color{
|
||||
@include main_color(theme);
|
||||
@include coupons_border_color(theme);
|
||||
}
|
||||
.payment-status {
|
||||
background-color: #fff;
|
||||
margin: 195rpx 30rpx 0 30rpx;
|
||||
border-radius: 10rpx;
|
||||
padding: 1rpx 0 28rpx 0;
|
||||
}
|
||||
|
||||
.payment-status .icons {
|
||||
font-size: 70rpx;
|
||||
width: 140rpx;
|
||||
height: 140rpx;
|
||||
border-radius: 50%;
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
line-height: 140rpx;
|
||||
text-shadow: 0px 4px 0px rgba(0,0,0,.1);
|
||||
border: 6rpx solid #f5f5f5;
|
||||
margin: -76rpx auto 0 auto;
|
||||
background-color: #999;
|
||||
}
|
||||
|
||||
.payment-status .iconfont {
|
||||
font-size: 70rpx;
|
||||
width: 140rpx;
|
||||
height: 140rpx;
|
||||
border-radius: 50%;
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
line-height: 140rpx;
|
||||
text-shadow: 0px 4px 0px rgba(0,0,0,.1);
|
||||
border: 6rpx solid #f5f5f5;
|
||||
margin: -76rpx auto 0 auto;
|
||||
background-color: #999;
|
||||
}
|
||||
|
||||
.payment-status .iconfont.fail {
|
||||
text-shadow: 0px 4px 0px #7a7a7a;
|
||||
}
|
||||
|
||||
.payment-status .status {
|
||||
font-size: 32rpx;
|
||||
font-weight: bold;
|
||||
text-align: center;
|
||||
margin: 25rpx 0 37rpx 0;
|
||||
}
|
||||
|
||||
.payment-status .wrapper {
|
||||
border: 1rpx solid #eee;
|
||||
margin: 0 30rpx 47rpx 30rpx;
|
||||
padding: 35rpx 0;
|
||||
border-left: 0;
|
||||
border-right: 0;
|
||||
}
|
||||
|
||||
.payment-status .wrapper .item {
|
||||
font-size: 28rpx;
|
||||
color: #282828;
|
||||
}
|
||||
|
||||
.payment-status .wrapper .item~.item {
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
|
||||
.payment-status .wrapper .item .itemCom {
|
||||
color: #666;
|
||||
}
|
||||
|
||||
.payment-status .returnBnt {
|
||||
width: 630rpx;
|
||||
height: 86rpx;
|
||||
border-radius: 50rpx;
|
||||
color: #fff;
|
||||
font-size: 30rpx;
|
||||
text-align: center;
|
||||
line-height: 86rpx;
|
||||
margin: 0 auto 20rpx auto;
|
||||
|
||||
}
|
||||
.cart-color {
|
||||
@include main_color(theme);
|
||||
@include coupons_border_color(theme);
|
||||
}
|
||||
</style>
|
||||
571
single_uniapp22miao/pages/order/order_payment/index.vue
Normal file
571
single_uniapp22miao/pages/order/order_payment/index.vue
Normal file
@@ -0,0 +1,571 @@
|
||||
<template>
|
||||
<view :data-theme="theme">
|
||||
<view class='wrapper'>
|
||||
<view class='item borRadius14'>
|
||||
<view class="title">¥<text>{{payPrice}}</text></view>
|
||||
<view class='list'>
|
||||
<block v-for="(item,index) in cartArr" :key='index'>
|
||||
<view v-if="item.payStatus === 1" class='payItem acea-row row-middle'
|
||||
:class='active==index ?"on":""' @tap='payItem(index,item)'>
|
||||
<view class='name acea-row row-center-wrapper'>
|
||||
<view class='iconfont animated'
|
||||
:class='(item.icon) + " " + (animated==true&&active==index ?"bounceIn":"")'>
|
||||
</view>
|
||||
{{item.name}}
|
||||
</view>
|
||||
<view class="acea-row">
|
||||
<view class='tip'>
|
||||
{{item.title}}
|
||||
<block v-if="item.value === 'yue'">
|
||||
{{item.userBalance}}
|
||||
</block>
|
||||
</view>
|
||||
<view class="radio">
|
||||
<block v-if="active==index">
|
||||
<view class="iconfont icon-xuanzhong1 font-color"></view>
|
||||
</block>
|
||||
<block v-else>
|
||||
<view class="iconfont icon-weixuanzhong"></view>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="isShow" class="titleNo">暂无支付方式!</view>
|
||||
<view class="btn-box">
|
||||
<button class='Bnt bg-color' @tap='toOrderPay' :disabled="isBuy">立即支付</button>
|
||||
</view>
|
||||
<view class="alipaysubmit" v-html="formContent"></view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
// +----------------------------------------------------------------------
|
||||
// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2016~2024 https://www.crmeb.com All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: CRMEB Team <admin@crmeb.com>
|
||||
// +----------------------------------------------------------------------
|
||||
import {openOrderSubscribe} from '@/utils/SubscribeMessage.js';
|
||||
import {
|
||||
orderPay,
|
||||
wechatQueryPayResult
|
||||
} from '@/api/order.js';
|
||||
import {
|
||||
Debounce
|
||||
} from '@/utils/validate.js'
|
||||
import {
|
||||
mapGetters
|
||||
} from "vuex";
|
||||
import store from '@/store'
|
||||
let app = getApp();
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
active: null, //支付方式切换
|
||||
theme: app.globalData.theme,
|
||||
//支付方式
|
||||
//支付方式
|
||||
cartArr: [],
|
||||
payPrice: '',
|
||||
orderNo: '',
|
||||
animated: false,
|
||||
payType: '', //支付方式
|
||||
payChannel: '',
|
||||
formContent: '',
|
||||
isShow: false,
|
||||
userBalance: '', //余额
|
||||
isBuy: false //是否可以点击购买
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters(['productType', 'systemPlatform'])
|
||||
},
|
||||
onLoad(options) {
|
||||
this.payPrice = options.payPrice;
|
||||
this.orderNo = options.orderNo;
|
||||
},
|
||||
mounted() {
|
||||
this.payConfig();
|
||||
},
|
||||
methods: {
|
||||
// 支付配置
|
||||
payConfig() {
|
||||
uni.hideLoading();
|
||||
// 支付方式
|
||||
store.dispatch('getPayConfig').then((res) => {
|
||||
this.cartArr = res.payConfig;
|
||||
this.userBalance = res.userBalance;
|
||||
if (this.cartArr.length) {
|
||||
this.active = 0;
|
||||
this.payType = this.cartArr[0].value;
|
||||
this.isShow = false;
|
||||
} else {
|
||||
this.isShow = true;
|
||||
return this.$util.Tips({
|
||||
title: '暂无支付方式!'
|
||||
})
|
||||
}
|
||||
});
|
||||
},
|
||||
payItem: Debounce(function(e, item) {
|
||||
let that = this;
|
||||
if (item.userBalance) that.userBalance = item.userBalance
|
||||
let active = e;
|
||||
that.active = active;
|
||||
that.animated = true;
|
||||
that.payType = that.cartArr[active].value;
|
||||
setTimeout(function() {
|
||||
that.car();
|
||||
}, 500);
|
||||
}),
|
||||
car: function() {
|
||||
let that = this;
|
||||
that.animated = false;
|
||||
},
|
||||
//选择支付方式的判断,传参
|
||||
getPayCheck() {
|
||||
if (!this.payType) return this.$util.Tips({
|
||||
title: '请选择支付方式'
|
||||
});
|
||||
if (this.payType === 'yue') {
|
||||
this.payChannel = 'yue'
|
||||
} else if (this.payType == 'alipay') {
|
||||
// #ifdef H5
|
||||
this.payChannel = 'alipay';
|
||||
// #endif
|
||||
// #ifdef APP-PLUS
|
||||
this.payChannel = 'appAliPay';
|
||||
// #endif
|
||||
} else {
|
||||
// #ifdef H5
|
||||
this.payChannel = this.$wechat.isWeixin() ? 'public' : 'weixinh5';
|
||||
// #endif
|
||||
// #ifdef APP-PLUS
|
||||
this.payChannel = this.systemPlatform === 'ios' ? 'weixinAppIos' : 'weixinAppAndroid';
|
||||
// #endif
|
||||
// #ifdef MP
|
||||
this.payChannel = "routine";
|
||||
if (this.productType == 'video') {
|
||||
this.payChannel = "video";
|
||||
} else {
|
||||
this.payChannel = "routine";
|
||||
}
|
||||
// #endif
|
||||
}
|
||||
},
|
||||
getOrderPay: function(orderNo, message) {
|
||||
let that = this;
|
||||
let goPages = '/pages/order/order_pay_status/index?order_id=' + orderNo;
|
||||
orderPay({
|
||||
orderNo: orderNo,
|
||||
payChannel: that.payChannel,
|
||||
payType: that.payType,
|
||||
scene: that.productType === 'normal' ? 0 : 1177 //下单时小程序的场景值
|
||||
}).then(res => {
|
||||
let jsConfig = res.data.jsConfig;
|
||||
switch (res.data.payType) {
|
||||
case 'weixin':
|
||||
that.weixinPay(jsConfig, orderNo, goPages);
|
||||
break;
|
||||
case 'yue':
|
||||
return that.$util.Tips({
|
||||
title: message
|
||||
}, {
|
||||
tab: 5,
|
||||
url: goPages + '&status=1'
|
||||
});
|
||||
uni.hideLoading();
|
||||
break;
|
||||
case 'weixinh5':
|
||||
setTimeout(() => {
|
||||
location.href = jsConfig.mwebUrl + '&redirect_url=' +
|
||||
window.location
|
||||
.protocol + '//' + window.location.host + goPages +
|
||||
'&status=1';
|
||||
}, 100)
|
||||
uni.hideLoading();
|
||||
break;
|
||||
case 'alipay':
|
||||
//#ifdef H5
|
||||
if (this.$wechat.isWeixin()) {
|
||||
uni.redirectTo({
|
||||
url: `/pages/users/alipay_invoke/index?id=${orderNo}&type=order`
|
||||
});
|
||||
} else {
|
||||
//h5支付
|
||||
uni.hideLoading();
|
||||
that.formContent = res.data.alipayRequest;
|
||||
uni.setStorage({
|
||||
key: 'orderNo',
|
||||
data: orderNo
|
||||
});
|
||||
that.$nextTick(() => {
|
||||
document.forms['punchout_form'].submit();
|
||||
})
|
||||
}
|
||||
//#endif
|
||||
// #ifdef APP-PLUS
|
||||
let alipayRequest = res.data.alipayRequest;
|
||||
uni.requestPayment({
|
||||
provider: 'alipay',
|
||||
orderInfo: alipayRequest,
|
||||
success: (e) => {
|
||||
uni.showToast({
|
||||
title: "支付成功"
|
||||
})
|
||||
setTimeout(res => {
|
||||
uni.navigateTo({
|
||||
url: '/pages/users/alipay_return/alipay_return?out_trade_no=' +
|
||||
orderNo +
|
||||
'&payChannel=' +
|
||||
'appAlipay'
|
||||
})
|
||||
}, 1000)
|
||||
},
|
||||
fail: (e) => {
|
||||
console.log(e, '失败');
|
||||
uni.showModal({
|
||||
content: "支付失败",
|
||||
showCancel: false,
|
||||
success: function(res) {
|
||||
if (res.confirm) {
|
||||
//点击确认的操作
|
||||
uni.navigateTo({
|
||||
url: '/pages/users/alipay_return/alipay_return?out_trade_no=' +
|
||||
orderNo +
|
||||
'&payChannel=' +
|
||||
'appAlipay'
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
complete: () => {
|
||||
uni.hideLoading();
|
||||
},
|
||||
});
|
||||
// #endif
|
||||
break;
|
||||
}
|
||||
}).catch(err => {
|
||||
uni.hideLoading();
|
||||
return that.$util.Tips({
|
||||
title: err
|
||||
});
|
||||
});
|
||||
},
|
||||
weixinPay(jsConfig, orderNo, goPages) {
|
||||
let that = this;
|
||||
// #ifdef MP
|
||||
if (that.productType === 'video') {
|
||||
uni.requestOrderPayment({
|
||||
timeStamp: jsConfig.timeStamp,
|
||||
nonceStr: jsConfig.nonceStr,
|
||||
package: jsConfig.packages,
|
||||
signType: jsConfig.signType,
|
||||
paySign: jsConfig.paySign,
|
||||
ticket: jsConfig.ticket,
|
||||
success: function(ress) {
|
||||
uni.hideLoading();
|
||||
openOrderSubscribe().then(() => {
|
||||
return that.$util.Tips({
|
||||
title: '支付成功',
|
||||
icon: 'success'
|
||||
}, {
|
||||
tab: 5,
|
||||
url: goPages
|
||||
}, );
|
||||
})
|
||||
},
|
||||
fail: function(e) {
|
||||
console.log(e)
|
||||
uni.hideLoading();
|
||||
return that.$util.Tips({
|
||||
title: '取消支付'
|
||||
}, {
|
||||
tab: 5,
|
||||
url: goPages + '&status=2'
|
||||
});
|
||||
},
|
||||
complete: function(e) {
|
||||
uni.hideLoading();
|
||||
//关闭当前页面跳转至订单状态
|
||||
if (e.errMsg == 'requestPayment:cancel') return that.$util.Tips({
|
||||
title: '取消支付'
|
||||
}, {
|
||||
tab: 5,
|
||||
url: goPages + '&status=2'
|
||||
});
|
||||
},
|
||||
})
|
||||
} else {
|
||||
uni.requestPayment({
|
||||
timeStamp: jsConfig.timeStamp,
|
||||
nonceStr: jsConfig.nonceStr,
|
||||
package: jsConfig.packages,
|
||||
signType: jsConfig.signType,
|
||||
paySign: jsConfig.paySign,
|
||||
//ticket: jsConfig.ticket,
|
||||
success: function(ress) {
|
||||
uni.hideLoading();
|
||||
openOrderSubscribe().then(() => {
|
||||
return that.$util.Tips({
|
||||
title: '支付成功',
|
||||
icon: 'success'
|
||||
}, {
|
||||
tab: 5,
|
||||
url: goPages
|
||||
}, );
|
||||
})
|
||||
},
|
||||
fail: function(e) {
|
||||
console.log(e)
|
||||
uni.hideLoading();
|
||||
return that.$util.Tips({
|
||||
title: '取消支付'
|
||||
}, {
|
||||
tab: 5,
|
||||
url: goPages + '&status=2'
|
||||
});
|
||||
},
|
||||
complete: function(e) {
|
||||
uni.hideLoading();
|
||||
//关闭当前页面跳转至订单状态
|
||||
if (e.errMsg == 'requestPayment:cancel') return that.$util.Tips({
|
||||
title: '取消支付'
|
||||
}, {
|
||||
tab: 5,
|
||||
url: goPages + '&status=2'
|
||||
});
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
// #endif
|
||||
// #ifdef H5
|
||||
let data = {
|
||||
timestamp: jsConfig.timeStamp,
|
||||
nonceStr: jsConfig.nonceStr,
|
||||
package: jsConfig.packages,
|
||||
signType: jsConfig.signType,
|
||||
paySign: jsConfig.paySign
|
||||
};
|
||||
that.$wechat.pay(data).then(res => {
|
||||
if (res.errMsg == 'chooseWXPay:cancel') {
|
||||
uni.hideLoading();
|
||||
return that.$util.Tips({
|
||||
title: '取消支付'
|
||||
}, {
|
||||
tab: 5,
|
||||
url: goPages + '&status=2'
|
||||
});
|
||||
} else {
|
||||
wechatQueryPayResult(orderNo).then(res => {
|
||||
uni.hideLoading();
|
||||
return that.$util.Tips({
|
||||
title: '支付成功',
|
||||
icon: 'success'
|
||||
}, {
|
||||
tab: 5,
|
||||
url: goPages
|
||||
});
|
||||
}).cache(err => {
|
||||
uni.hideLoading();
|
||||
return that.$util.Tips({
|
||||
title: err
|
||||
});
|
||||
})
|
||||
}
|
||||
}).cache(res => {
|
||||
uni.hideLoading();
|
||||
return that.$util.Tips({
|
||||
title: '取消支付'
|
||||
}, {
|
||||
tab: 5,
|
||||
url: goPages + '&status=2'
|
||||
});
|
||||
});
|
||||
// #endif
|
||||
// #ifdef APP-PLUS
|
||||
uni.requestPayment({
|
||||
provider: 'wxpay',
|
||||
orderInfo: {
|
||||
"appid": jsConfig.appId, // 微信开放平台 - 应用 - AppId,注意和微信小程序、公众号 AppId 可能不一致
|
||||
"noncestr": jsConfig.nonceStr, // 随机字符串
|
||||
"package": "Sign=WXPay", // 固定值
|
||||
"partnerid": jsConfig.partnerid, // 微信支付商户号
|
||||
"prepayid": jsConfig.packages, // 统一下单订单号
|
||||
"timestamp": Number(jsConfig.timeStamp), // 时间戳(单位:秒)
|
||||
"sign": this.systemPlatform === 'ios' ? 'MD5' : jsConfig
|
||||
.paySign // 签名,这里用的 MD5 签名
|
||||
}, //微信、支付宝订单数据 【注意微信的订单信息,键值应该全部是小写,不能采用驼峰命名】
|
||||
success: function(res) {
|
||||
wechatQueryPayResult(orderNo).then(res => {
|
||||
uni.hideLoading();
|
||||
let url = '/pages/order/order_pay_status/index?order_id=' + orderNo +
|
||||
'&msg=支付成功';
|
||||
uni.showToast({
|
||||
title: "支付成功"
|
||||
})
|
||||
setTimeout(res => {
|
||||
uni.redirectTo({
|
||||
url: url
|
||||
})
|
||||
}, 2000)
|
||||
}).cache(err => {
|
||||
uni.hideLoading();
|
||||
return that.$util.Tips({
|
||||
title: err
|
||||
});
|
||||
})
|
||||
},
|
||||
fail: function(err) {
|
||||
uni.hideLoading();
|
||||
let url = '/pages/order/order_pay_status/index?order_id=' + orderNo +
|
||||
'&msg=支付失败';
|
||||
uni.showModal({
|
||||
content: "支付失败",
|
||||
showCancel: false,
|
||||
success: function(res) {
|
||||
if (res.confirm) {
|
||||
uni.redirectTo({
|
||||
url: url
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
complete: (err) => {
|
||||
uni.hideLoading();
|
||||
}
|
||||
});
|
||||
// #endif
|
||||
},
|
||||
//立即支付
|
||||
toOrderPay: Debounce(function() {
|
||||
this.getPayCheck();
|
||||
if (Number(this.payPrice) > Number(this.userBalance) && this.payType === 'yue') return this.$util
|
||||
.Tips({
|
||||
title: '余额的金额不够,请切换支付方式'
|
||||
});
|
||||
uni.showLoading({
|
||||
title: '加载中...'
|
||||
});
|
||||
this.isBuy = true;
|
||||
this.getOrderPay(this.orderNo, '支付成功')
|
||||
})
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.titleNo {
|
||||
width: 100%;
|
||||
font-size: 28rpx;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.btn-box {
|
||||
padding: 0 30rpx;
|
||||
position: fixed;
|
||||
bottom: 43rpx;
|
||||
}
|
||||
|
||||
.Bnt {
|
||||
font-size: 30rpx;
|
||||
font-weight: bold;
|
||||
color: #fff;
|
||||
width: 690rpx;
|
||||
height: 86rpx;
|
||||
border-radius: 43rpx;
|
||||
text-align: center;
|
||||
line-height: 86rpx;
|
||||
}
|
||||
|
||||
.wrapper {
|
||||
|
||||
padding: 30rpx;
|
||||
|
||||
.list {
|
||||
margin-top: 50rpx;
|
||||
}
|
||||
|
||||
.item {
|
||||
padding: 50rpx 30rpx;
|
||||
font-size: 30rpx;
|
||||
color: #333333;
|
||||
background-color: #fff;
|
||||
|
||||
.title {
|
||||
text-align: center;
|
||||
@include main_color(theme);
|
||||
font-size: 34rpx;
|
||||
|
||||
text {
|
||||
font-weight: 800;
|
||||
font-size: 50rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.payItem {
|
||||
border-bottom: 1px solid #eee;
|
||||
justify-content: space-between;
|
||||
height: 138rpx;
|
||||
line-height: 138rpx;
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
font-size: 32pxrpx;
|
||||
color: #333333;
|
||||
|
||||
.on {
|
||||
// border-color: #fc5445;
|
||||
@include coupons_border_color(theme);
|
||||
color: $theme-color;
|
||||
}
|
||||
|
||||
.name {
|
||||
|
||||
.iconfont {
|
||||
width: 48rpx;
|
||||
height: 48rpx;
|
||||
border-radius: 50%;
|
||||
text-align: center;
|
||||
line-height: 48rpx;
|
||||
background-color: #fe960f;
|
||||
color: #fff;
|
||||
font-size: 30rpx;
|
||||
margin-right: 28rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.iconfont.icon-weixinzhifu1 {
|
||||
background-color: #41b035;
|
||||
}
|
||||
|
||||
.iconfont.icon-zhifubao {
|
||||
background-color: #00AAEA;
|
||||
}
|
||||
|
||||
.tip {
|
||||
text-align: center;
|
||||
font-size: 26rpx;
|
||||
color: #aaa;
|
||||
margin-right: 20rpx;
|
||||
}
|
||||
|
||||
.radio {
|
||||
.iconfont {
|
||||
font-size: 46rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user