mirror of
https://gitee.com/huangge1199_admin/vue-pro.git
synced 2024-11-22 23:31:52 +08:00
mall + pay:
1. 调整 cashier 的 channels 的读取实现方式
This commit is contained in:
parent
2485a5ebc9
commit
ca4afc2909
@ -238,7 +238,7 @@ public interface TradeOrderConvert {
|
|||||||
AppTradeOrderDetailRespVO orderVO = convert3(order, orderItems);
|
AppTradeOrderDetailRespVO orderVO = convert3(order, orderItems);
|
||||||
orderVO.setPayExpireTime(addTime(tradeOrderProperties.getExpireTime()));
|
orderVO.setPayExpireTime(addTime(tradeOrderProperties.getExpireTime()));
|
||||||
if (StrUtil.isNotEmpty(order.getPayChannelCode())) {
|
if (StrUtil.isNotEmpty(order.getPayChannelCode())) {
|
||||||
orderVO.setPayChannelName(DictFrameworkUtils.getDictDataLabel(DictTypeConstants.CHANNEL_CODE_TYPE, order.getPayChannelCode()));
|
orderVO.setPayChannelName(DictFrameworkUtils.getDictDataLabel(DictTypeConstants.CHANNEL_CODE, order.getPayChannelCode()));
|
||||||
}
|
}
|
||||||
// 处理商品属性
|
// 处理商品属性
|
||||||
Map<Long, ProductPropertyValueDetailRespDTO> propertyValueDetailMap = convertMap(propertyValueDetails, ProductPropertyValueDetailRespDTO::getValueId);
|
Map<Long, ProductPropertyValueDetailRespDTO> propertyValueDetailMap = convertMap(propertyValueDetails, ProductPropertyValueDetailRespDTO::getValueId);
|
||||||
|
@ -7,7 +7,7 @@ package cn.iocoder.yudao.module.pay.enums;
|
|||||||
*/
|
*/
|
||||||
public interface DictTypeConstants {
|
public interface DictTypeConstants {
|
||||||
|
|
||||||
String CHANNEL_CODE_TYPE = "pay_channel_code_type"; // 支付-渠道名
|
String CHANNEL_CODE = "pay_channel_code"; // 支付-渠道名
|
||||||
|
|
||||||
String ORDER_STATUS = "pay_order_status"; // 支付-订单-订单状态
|
String ORDER_STATUS = "pay_order_status"; // 支付-订单-订单状态
|
||||||
String ORDER_NOTIFY_STATUS = "pay_order_notify_status"; // 支付-订单-订单回调商户状态
|
String ORDER_NOTIFY_STATUS = "pay_order_notify_status"; // 支付-订单-订单回调商户状态
|
||||||
|
@ -54,7 +54,7 @@ export const DICT_TYPE = {
|
|||||||
PAY_CHANNEL_ALIPAY_SIGN_TYPE: 'pay_channel_alipay_sign_type', // 支付渠道支付宝算法类型
|
PAY_CHANNEL_ALIPAY_SIGN_TYPE: 'pay_channel_alipay_sign_type', // 支付渠道支付宝算法类型
|
||||||
PAY_CHANNEL_ALIPAY_MODE: 'pay_channel_alipay_mode', // 支付宝公钥类型
|
PAY_CHANNEL_ALIPAY_MODE: 'pay_channel_alipay_mode', // 支付宝公钥类型
|
||||||
PAY_CHANNEL_ALIPAY_SERVER_TYPE: 'pay_channel_alipay_server_type', // 支付宝网关地址
|
PAY_CHANNEL_ALIPAY_SERVER_TYPE: 'pay_channel_alipay_server_type', // 支付宝网关地址
|
||||||
PAY_CHANNEL_CODE_TYPE: 'pay_channel_code_type', // 支付渠道编码类型
|
PAY_CHANNEL_CODE: 'pay_channel_code', // 支付渠道编码类型
|
||||||
PAY_ORDER_NOTIFY_STATUS: 'pay_order_notify_status', // 商户支付订单回调状态
|
PAY_ORDER_NOTIFY_STATUS: 'pay_order_notify_status', // 商户支付订单回调状态
|
||||||
PAY_ORDER_STATUS: 'pay_order_status', // 商户支付订单状态
|
PAY_ORDER_STATUS: 'pay_order_status', // 商户支付订单状态
|
||||||
PAY_ORDER_REFUND_STATUS: 'pay_order_refund_status', // 商户支付订单退款状态
|
PAY_ORDER_REFUND_STATUS: 'pay_order_refund_status', // 商户支付订单退款状态
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
<el-descriptions-item label="商家备注">{{ order.remark }}</el-descriptions-item>
|
<el-descriptions-item label="商家备注">{{ order.remark }}</el-descriptions-item>
|
||||||
<el-descriptions-item label="支付单号">{{ order.payOrderId }}</el-descriptions-item>
|
<el-descriptions-item label="支付单号">{{ order.payOrderId }}</el-descriptions-item>
|
||||||
<el-descriptions-item label="付款方式">
|
<el-descriptions-item label="付款方式">
|
||||||
<dict-tag :type="DICT_TYPE.PAY_CHANNEL_CODE_TYPE" :value="order.payChannelCode" />
|
<dict-tag :type="DICT_TYPE.PAY_CHANNEL_CODE" :value="order.payChannelCode" />
|
||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
<el-descriptions-item label="买家">{{ order.user.nickname }}</el-descriptions-item> <!-- TODO 芋艿:待实现:跳转会员 -->
|
<el-descriptions-item label="买家">{{ order.user.nickname }}</el-descriptions-item> <!-- TODO 芋艿:待实现:跳转会员 -->
|
||||||
<el-descriptions-item label="收货地址">
|
<el-descriptions-item label="收货地址">
|
||||||
|
@ -42,7 +42,7 @@
|
|||||||
<el-col :span="6" :xs="24">
|
<el-col :span="6" :xs="24">
|
||||||
<el-form-item label="支付方式" prop="payChannelCode">
|
<el-form-item label="支付方式" prop="payChannelCode">
|
||||||
<el-select v-model="queryParams.payChannelCode" clearable style="width: 240px">
|
<el-select v-model="queryParams.payChannelCode" clearable style="width: 240px">
|
||||||
<el-option v-for="dict in this.getDictDatas(DICT_TYPE.PAY_CHANNEL_CODE_TYPE)"
|
<el-option v-for="dict in this.getDictDatas(DICT_TYPE.PAY_CHANNEL_CODE)"
|
||||||
:key="dict.value" :label="dict.label" :value="dict.value"/>
|
:key="dict.value" :label="dict.label" :value="dict.value"/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@ -86,7 +86,7 @@
|
|||||||
<dict-tag :type="DICT_TYPE.TERMINAL" :value="row.terminal" />
|
<dict-tag :type="DICT_TYPE.TERMINAL" :value="row.terminal" />
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="4">支付方式:
|
<el-col :span="4">支付方式:
|
||||||
<dict-tag v-if="row.payChannelCode" :type="DICT_TYPE.PAY_CHANNEL_CODE_TYPE" :value="row.payChannelCode" />
|
<dict-tag v-if="row.payChannelCode" :type="DICT_TYPE.PAY_CHANNEL_CODE" :value="row.payChannelCode" />
|
||||||
<span v-else>未支付</span>
|
<span v-else>未支付</span>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="6" align="right">
|
<el-col :span="6" align="right">
|
||||||
|
@ -18,15 +18,15 @@
|
|||||||
<el-descriptions title="选择支付宝支付">
|
<el-descriptions title="选择支付宝支付">
|
||||||
</el-descriptions>
|
</el-descriptions>
|
||||||
<div class="pay-channel-container">
|
<div class="pay-channel-container">
|
||||||
<div class="box" v-for="channel in aliPayChannels" :key="channel.code" @click="submit(channel.code)">
|
<div class="box" v-for="channel in channels" v-if="channel.code.indexOf('alipay_') === 0" :key="channel.code" @click="submit(channel.code)">
|
||||||
<img :src="icons[channel.code]">
|
<img :src="channel.icon">
|
||||||
<div class="title">{{ channel.name }}</div>
|
<div class="title">{{ channel.name }}</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- 微信支付 -->
|
<!-- 微信支付 -->
|
||||||
<el-descriptions title="选择微信支付" style="margin-top: 20px;" />
|
<el-descriptions title="选择微信支付" style="margin-top: 20px;" />
|
||||||
<div class="pay-channel-container">
|
<div class="pay-channel-container">
|
||||||
<div class="box" v-for="channel in wxPayChannels" :key="channel.code">
|
<div class="box" v-for="channel in channels" v-if="channel.code.indexOf('wx_') === 0" :key="channel.code">
|
||||||
<img :src="icons[channel.code]">
|
<img :src="icons[channel.code]">
|
||||||
<div class="title">{{ channel.name }}</div>
|
<div class="title">{{ channel.name }}</div>
|
||||||
</div>
|
</div>
|
||||||
@ -34,7 +34,8 @@
|
|||||||
<!-- 其它支付 -->
|
<!-- 其它支付 -->
|
||||||
<el-descriptions title="选择其它支付" style="margin-top: 20px;" />
|
<el-descriptions title="选择其它支付" style="margin-top: 20px;" />
|
||||||
<div class="pay-channel-container">
|
<div class="pay-channel-container">
|
||||||
<div class="box" v-for="channel in otherPayChannels" :key="channel.code">
|
<div class="box" v-for="channel in channels" :key="channel.code"
|
||||||
|
v-if="channel.code.indexOf('alipay_') === -1 && channel.code.indexOf('wx_') === -1">
|
||||||
<img :src="icons[channel.code]">
|
<img :src="icons[channel.code]">
|
||||||
<div class="title">{{ channel.name }}</div>
|
<div class="title">{{ channel.name }}</div>
|
||||||
</div>
|
</div>
|
||||||
@ -101,20 +102,43 @@ export default {
|
|||||||
returnUrl: undefined, // 支付完的回调地址
|
returnUrl: undefined, // 支付完的回调地址
|
||||||
loading: false, // 支付信息的 loading
|
loading: false, // 支付信息的 loading
|
||||||
payOrder: {}, // 支付信息
|
payOrder: {}, // 支付信息
|
||||||
aliPayChannels: [], // 阿里支付的渠道
|
channels: [{
|
||||||
wxPayChannels: [], // 微信支付的渠道
|
name: '支付宝 PC 网站支付',
|
||||||
otherPayChannels: [], // 其它的支付渠道
|
icon: require("@/assets/images/pay/icon/alipay_pc.svg"),
|
||||||
icons: {
|
code: "alipay_pc"
|
||||||
alipay_qr: require("@/assets/images/pay/icon/alipay_qr.svg"),
|
}, {
|
||||||
alipay_app: require("@/assets/images/pay/icon/alipay_app.svg"),
|
name: '支付宝 Wap 网站支付',
|
||||||
alipay_wap: require("@/assets/images/pay/icon/alipay_wap.svg"),
|
icon: require("@/assets/images/pay/icon/alipay_wap.svg"),
|
||||||
alipay_pc: require("@/assets/images/pay/icon/alipay_pc.svg"),
|
code: "alipay_wap"
|
||||||
alipay_bar: require("@/assets/images/pay/icon/alipay_bar.svg"),
|
}, {
|
||||||
wx_app: require("@/assets/images/pay/icon/wx_app.svg"),
|
name: '支付宝 App 网站支付',
|
||||||
wx_lite: require("@/assets/images/pay/icon/wx_lite.svg"),
|
icon: require("@/assets/images/pay/icon/alipay_app.svg"),
|
||||||
wx_pub: require("@/assets/images/pay/icon/wx_pub.svg"),
|
code: "alipay_app"
|
||||||
mock: require("@/assets/images/pay/icon/mock.svg"),
|
}, {
|
||||||
},
|
name: '支付宝扫码支付',
|
||||||
|
icon: require("@/assets/images/pay/icon/alipay_app.svg"),
|
||||||
|
code: "alipay_qr"
|
||||||
|
}, {
|
||||||
|
name: '支付宝条码支付',
|
||||||
|
icon: require("@/assets/images/pay/icon/alipay_bar.svg"),
|
||||||
|
code: "alipay_bar"
|
||||||
|
}, {
|
||||||
|
name: '微信公众号支付',
|
||||||
|
icon: require("@/assets/images/pay/icon/wx_pub.svg"),
|
||||||
|
code: "wx_pub"
|
||||||
|
}, {
|
||||||
|
name: '微信小程序支付',
|
||||||
|
icon: require("@/assets/images/pay/icon/wx_lite.svg"),
|
||||||
|
code: "wx_lite"
|
||||||
|
}, {
|
||||||
|
name: '微信 App 支付',
|
||||||
|
icon: require("@/assets/images/pay/icon/wx_lite.svg"),
|
||||||
|
code: "wx_app"
|
||||||
|
}, {
|
||||||
|
name: '模拟支付',
|
||||||
|
icon: require("@/assets/images/pay/icon/mock.svg"),
|
||||||
|
code: "mock"
|
||||||
|
}],
|
||||||
submitLoading: false, // 提交支付的 loading
|
submitLoading: false, // 提交支付的 loading
|
||||||
interval: undefined, // 定时任务,轮询是否完成支付
|
interval: undefined, // 定时任务,轮询是否完成支付
|
||||||
qrCode: { // 展示形式:二维码
|
qrCode: { // 展示形式:二维码
|
||||||
@ -144,26 +168,8 @@ export default {
|
|||||||
this.returnUrl = decodeURIComponent(this.$route.query.returnUrl)
|
this.returnUrl = decodeURIComponent(this.$route.query.returnUrl)
|
||||||
}
|
}
|
||||||
this.getDetail();
|
this.getDetail();
|
||||||
this.initPayChannels();
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
/** 初始化支付渠道 */
|
|
||||||
initPayChannels() {
|
|
||||||
// 微信支付
|
|
||||||
for (const dict of getDictDatas(DICT_TYPE.PAY_CHANNEL_CODE_TYPE)) {
|
|
||||||
const payChannel = {
|
|
||||||
name: dict.label,
|
|
||||||
code: dict.value
|
|
||||||
}
|
|
||||||
if (dict.value.indexOf('wx_') === 0) {
|
|
||||||
this.wxPayChannels.push(payChannel);
|
|
||||||
} else if (dict.value.indexOf('alipay_') === 0) {
|
|
||||||
this.aliPayChannels.push(payChannel);
|
|
||||||
} else {
|
|
||||||
this.otherPayChannels.push(payChannel);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
/** 获得支付信息 */
|
/** 获得支付信息 */
|
||||||
getDetail() {
|
getDetail() {
|
||||||
// 1.1 未传递订单编号
|
// 1.1 未传递订单编号
|
||||||
@ -180,6 +186,7 @@ export default {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// 1.3 订单已支付
|
// 1.3 订单已支付
|
||||||
|
// TODO 芋艿:已支付
|
||||||
if (response.data.status !== PayOrderStatusEnum.WAITING.status) {
|
if (response.data.status !== PayOrderStatusEnum.WAITING.status) {
|
||||||
this.$message.error('支付订单不处于待支付状态,请检查!');
|
this.$message.error('支付订单不处于待支付状态,请检查!');
|
||||||
this.goBackToList();
|
this.goBackToList();
|
||||||
|
@ -285,7 +285,7 @@ export default {
|
|||||||
// 支付应用列表集合
|
// 支付应用列表集合
|
||||||
appList: null,
|
appList: null,
|
||||||
// 支付渠道编码字典数据集合
|
// 支付渠道编码字典数据集合
|
||||||
payChannelCodeDictDatum: getDictDatas(DICT_TYPE.PAY_CHANNEL_CODE_TYPE),
|
payChannelCodeDictDatum: getDictDatas(DICT_TYPE.PAY_CHANNEL_CODE),
|
||||||
// 订单回调商户状态字典数据集合
|
// 订单回调商户状态字典数据集合
|
||||||
payOrderNotifyDictDatum: getDictDatas(DICT_TYPE.PAY_ORDER_NOTIFY_STATUS),
|
payOrderNotifyDictDatum: getDictDatas(DICT_TYPE.PAY_ORDER_NOTIFY_STATUS),
|
||||||
// 订单状态字典数据集合
|
// 订单状态字典数据集合
|
||||||
|
@ -298,7 +298,7 @@ export default {
|
|||||||
// 支付应用列表集合
|
// 支付应用列表集合
|
||||||
appList: null,
|
appList: null,
|
||||||
// 支付渠道编码字典数据集合
|
// 支付渠道编码字典数据集合
|
||||||
payChannelCodeDictDatum: getDictDatas(DICT_TYPE.PAY_CHANNEL_CODE_TYPE),
|
payChannelCodeDictDatum: getDictDatas(DICT_TYPE.PAY_CHANNEL_CODE),
|
||||||
// 订单退款状态字典数据集合
|
// 订单退款状态字典数据集合
|
||||||
payRefundOrderDictDatum: getDictDatas(DICT_TYPE.PAY_REFUND_ORDER_STATUS),
|
payRefundOrderDictDatum: getDictDatas(DICT_TYPE.PAY_REFUND_ORDER_STATUS),
|
||||||
// 退款订单类别字典数据集合
|
// 退款订单类别字典数据集合
|
||||||
|
Loading…
Reference in New Issue
Block a user