@uxda/appkit 4.2.55 → 4.2.57
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js
CHANGED
|
@@ -1666,6 +1666,33 @@ const requestBrandWCPay = (params, Appcode = "") => {
|
|
|
1666
1666
|
});
|
|
1667
1667
|
});
|
|
1668
1668
|
};
|
|
1669
|
+
const requestBrandWCPayByBean = (params, Appcode = "") => {
|
|
1670
|
+
return new Promise((resolve, reject) => {
|
|
1671
|
+
const $http = useHttp$2({
|
|
1672
|
+
Appcode,
|
|
1673
|
+
Tenant: params.tenant
|
|
1674
|
+
});
|
|
1675
|
+
$http.post(endpoints.\u83B7\u53D6\u6743\u76CA\u5FAE\u4FE1\u652F\u4ED8, {
|
|
1676
|
+
...params
|
|
1677
|
+
}).then((response) => {
|
|
1678
|
+
if (!response.json) {
|
|
1679
|
+
showToast({
|
|
1680
|
+
title: response.message,
|
|
1681
|
+
icon: "none"
|
|
1682
|
+
});
|
|
1683
|
+
resolve(false);
|
|
1684
|
+
} else {
|
|
1685
|
+
requestWxH5Pay(response.json).then((result) => {
|
|
1686
|
+
if (result) {
|
|
1687
|
+
resolve(true);
|
|
1688
|
+
} else {
|
|
1689
|
+
resolve(false);
|
|
1690
|
+
}
|
|
1691
|
+
});
|
|
1692
|
+
}
|
|
1693
|
+
});
|
|
1694
|
+
});
|
|
1695
|
+
};
|
|
1669
1696
|
var requestPayment$1 = {
|
|
1670
1697
|
install($app) {
|
|
1671
1698
|
$app.requestPayment = requestPayment;
|
|
@@ -1735,6 +1762,7 @@ var script$B = /* @__PURE__ */ defineComponent({
|
|
|
1735
1762
|
payFinishJumpUrl: props.payFinishJumpUrl
|
|
1736
1763
|
}).then((result) => {
|
|
1737
1764
|
console.log(result);
|
|
1765
|
+
window.location.href = props.payFinishJumpUrl;
|
|
1738
1766
|
});
|
|
1739
1767
|
} else {
|
|
1740
1768
|
wx.login({
|
|
@@ -2025,7 +2053,8 @@ var script$x = /* @__PURE__ */ defineComponent({
|
|
|
2025
2053
|
props: {
|
|
2026
2054
|
headerApp: { type: String, required: true },
|
|
2027
2055
|
app: { type: String, required: true },
|
|
2028
|
-
tenant: { type: String, required: true }
|
|
2056
|
+
tenant: { type: String, required: true },
|
|
2057
|
+
payFinishJumpUrl: { type: String, required: false }
|
|
2029
2058
|
},
|
|
2030
2059
|
emits: ["complete", "agree"],
|
|
2031
2060
|
setup(__props, { emit: __emit }) {
|
|
@@ -2090,22 +2119,37 @@ var script$x = /* @__PURE__ */ defineComponent({
|
|
|
2090
2119
|
return false;
|
|
2091
2120
|
}
|
|
2092
2121
|
state.buttonLoading = true;
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
|
|
2097
|
-
|
|
2098
|
-
|
|
2099
|
-
|
|
2100
|
-
|
|
2101
|
-
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
|
|
2107
|
-
|
|
2108
|
-
|
|
2122
|
+
if (Taro.getEnv() === "WEB") {
|
|
2123
|
+
requestBrandWCPayByBean({
|
|
2124
|
+
caseConfigId: amounts.value[state.selected].id,
|
|
2125
|
+
amount: amounts.value[state.selected].paymentAmount,
|
|
2126
|
+
app: "loankitMp",
|
|
2127
|
+
tenant: props.tenant,
|
|
2128
|
+
accountAuthFlag: false,
|
|
2129
|
+
channelCode: "centergzh",
|
|
2130
|
+
payFinishJumpUrl: props.payFinishJumpUrl
|
|
2131
|
+
}).then((result) => {
|
|
2132
|
+
console.log(result);
|
|
2133
|
+
window.location.href = props.payFinishJumpUrl;
|
|
2134
|
+
});
|
|
2135
|
+
} else {
|
|
2136
|
+
wx.login({
|
|
2137
|
+
success({ code }) {
|
|
2138
|
+
requestPaymentByBean({
|
|
2139
|
+
caseConfigId: amounts.value[state.selected].id,
|
|
2140
|
+
amount: amounts.value[state.selected].paymentAmount,
|
|
2141
|
+
app: props.app,
|
|
2142
|
+
tenant: props.tenant,
|
|
2143
|
+
user: code
|
|
2144
|
+
}, props.headerApp).then((result) => {
|
|
2145
|
+
state.buttonLoading = false;
|
|
2146
|
+
if (result) {
|
|
2147
|
+
emit("complete", { result: true, type: "wePay" });
|
|
2148
|
+
}
|
|
2149
|
+
});
|
|
2150
|
+
}
|
|
2151
|
+
});
|
|
2152
|
+
}
|
|
2109
2153
|
};
|
|
2110
2154
|
return (_ctx, _cache) => {
|
|
2111
2155
|
const _component_nut_checkbox = Checkbox;
|
package/package.json
CHANGED
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
import { computed, onMounted, reactive, ref } from 'vue'
|
|
51
51
|
import RightsPicker, { Amount } from './RightsPicker.vue'
|
|
52
52
|
import { endpoints, useHttp } from '../api'
|
|
53
|
-
import { requestPaymentByBean } from '../services'
|
|
53
|
+
import { requestBrandWCPayByBean, requestPaymentByBean } from '../services'
|
|
54
54
|
import Taro, { showToast } from '@tarojs/taro'
|
|
55
55
|
import { useAmount } from '../../shared/composables/useAmount'
|
|
56
56
|
|
|
@@ -74,7 +74,11 @@ export interface RechargeViewProps {
|
|
|
74
74
|
/**
|
|
75
75
|
* 租户
|
|
76
76
|
*/
|
|
77
|
-
tenant: string
|
|
77
|
+
tenant: string,
|
|
78
|
+
/**
|
|
79
|
+
* h5支付完成后跳转地址
|
|
80
|
+
*/
|
|
81
|
+
payFinishJumpUrl?: ''
|
|
78
82
|
}
|
|
79
83
|
|
|
80
84
|
const props = defineProps<RechargeViewProps>()
|
|
@@ -157,22 +161,38 @@ const onPayClick = () => {
|
|
|
157
161
|
return false
|
|
158
162
|
}
|
|
159
163
|
state.buttonLoading = true
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
164
|
+
|
|
165
|
+
if (Taro.getEnv() === 'WEB') {
|
|
166
|
+
requestBrandWCPayByBean({
|
|
167
|
+
caseConfigId: amounts.value[state.selected].id,
|
|
168
|
+
amount: amounts.value[state.selected].paymentAmount,
|
|
169
|
+
app: 'loankitMp',
|
|
170
|
+
tenant: props.tenant,
|
|
171
|
+
accountAuthFlag: false,
|
|
172
|
+
channelCode: 'centergzh',
|
|
173
|
+
payFinishJumpUrl: props.payFinishJumpUrl
|
|
174
|
+
}).then(result => {
|
|
175
|
+
console.log(result), 'result'
|
|
176
|
+
window.location.href = props.payFinishJumpUrl as string
|
|
177
|
+
})
|
|
178
|
+
} else {
|
|
179
|
+
wx.login({
|
|
180
|
+
success({ code }: { code: string }) {
|
|
181
|
+
requestPaymentByBean({
|
|
182
|
+
caseConfigId: amounts.value[state.selected].id,
|
|
183
|
+
amount: amounts.value[state.selected].paymentAmount,
|
|
184
|
+
app: props.app,
|
|
185
|
+
tenant: props.tenant,
|
|
186
|
+
user: code,
|
|
187
|
+
}, props.headerApp).then(result => {
|
|
188
|
+
state.buttonLoading = false
|
|
189
|
+
if (result) {
|
|
190
|
+
emit('complete', { result: true, type: 'wePay' })
|
|
191
|
+
}
|
|
192
|
+
})
|
|
193
|
+
}
|
|
194
|
+
})
|
|
195
|
+
}
|
|
176
196
|
}
|
|
177
197
|
</script>
|
|
178
198
|
|
|
@@ -87,10 +87,40 @@ const requestBrandWCPay = (params: PaymentParams, Appcode = '') => {
|
|
|
87
87
|
})
|
|
88
88
|
}
|
|
89
89
|
|
|
90
|
+
const requestBrandWCPayByBean = (params: PaymentParams, Appcode = '') => {
|
|
91
|
+
return new Promise<boolean>((resolve, reject) => {
|
|
92
|
+
const $http = useHttp({
|
|
93
|
+
Appcode: Appcode,
|
|
94
|
+
Tenant: params.tenant,
|
|
95
|
+
})
|
|
96
|
+
$http
|
|
97
|
+
.post(endpoints.获取权益微信支付, {
|
|
98
|
+
...params,
|
|
99
|
+
})
|
|
100
|
+
.then((response: any) => {
|
|
101
|
+
if (!response.json) {
|
|
102
|
+
showToast({
|
|
103
|
+
title: response.message,
|
|
104
|
+
icon: 'none',
|
|
105
|
+
})
|
|
106
|
+
resolve(false)
|
|
107
|
+
} else {
|
|
108
|
+
requestWxH5Pay(response.json).then((result) => {
|
|
109
|
+
if (result) {
|
|
110
|
+
resolve(true)
|
|
111
|
+
} else {
|
|
112
|
+
resolve(false)
|
|
113
|
+
}
|
|
114
|
+
})
|
|
115
|
+
}
|
|
116
|
+
})
|
|
117
|
+
})
|
|
118
|
+
}
|
|
119
|
+
|
|
90
120
|
export default {
|
|
91
121
|
install($app: DollarApp) {
|
|
92
122
|
$app.requestPayment = requestPayment
|
|
93
123
|
},
|
|
94
124
|
}
|
|
95
125
|
|
|
96
|
-
export { requestPayment, requestPaymentByBean, requestBrandWCPay }
|
|
126
|
+
export { requestPayment, requestPaymentByBean, requestBrandWCPay, requestBrandWCPayByBean }
|