|
@@ -1,4 +1,4 @@
|
|
|
-import { payDetail } from "./service";
|
|
|
+import { payDetail, percent2percent25 } from "./service";
|
|
|
import { tradePay } from "../../utils/tradePay";
|
|
|
import history from "../../utils/history";
|
|
|
import { getYbParams } from "../hospital-payment-detail-yibao/service";
|
|
@@ -113,20 +113,10 @@ Component(
|
|
|
this.subscribe = ref;
|
|
|
},
|
|
|
|
|
|
- // 如果路由参数中包含%,则decode时会报错;需要先把 % 替换成 %25
|
|
|
- percent2percent25(URI) {
|
|
|
- if (URI.indexOf("%") > -1) {
|
|
|
- return URI.replace(/%/g, "%25");
|
|
|
- } else {
|
|
|
- return URI;
|
|
|
- }
|
|
|
- },
|
|
|
-
|
|
|
payDetail(send) {
|
|
|
const { orderItems } = send;
|
|
|
- console.log("orderItems", orderItems);
|
|
|
const status0OrderItems = JSON.parse(
|
|
|
- decodeURIComponent(this.percent2percent25(orderItems) || "")
|
|
|
+ decodeURIComponent(percent2percent25(orderItems) || "")
|
|
|
);
|
|
|
const newSend = Object.assign({}, send);
|
|
|
delete newSend["orderItems"];
|
|
@@ -307,6 +297,7 @@ Component(
|
|
|
|
|
|
async onYbPay() {
|
|
|
const query = this.$page.data.query;
|
|
|
+ console.log("query ==>", query);
|
|
|
await getSubscribeAuth();
|
|
|
my.getAuthCode({
|
|
|
scopes: ["nhsamp", "auth_user"], // 主动授权:auth_user,静默授权:auth_base。或者其它scopes
|
|
@@ -314,7 +305,10 @@ Component(
|
|
|
if (res.authCode) {
|
|
|
history.push({
|
|
|
title: "确认支付",
|
|
|
- query: Object.assign(query, { authCode: res.authCode }),
|
|
|
+ query: Object.assign(query, {
|
|
|
+ authCode: res.authCode,
|
|
|
+ orderItems: percent2percent25(query.orderItems),
|
|
|
+ }),
|
|
|
pageType: "hospital-payment-detail-yibao",
|
|
|
});
|
|
|
}
|