|
@@ -66,14 +66,7 @@ declare const wx: any;
|
|
|
|
|
|
|
|
export function insertMoney(amount: number) {
|
|
export function insertMoney(amount: number) {
|
|
|
return userHttp
|
|
return userHttp
|
|
|
- .post<{
|
|
|
|
|
- appId: string;
|
|
|
|
|
- nonceStr: string;
|
|
|
|
|
- package: string;
|
|
|
|
|
- paySign: string;
|
|
|
|
|
- signType: string;
|
|
|
|
|
- timestamp: string;
|
|
|
|
|
- }>("/payment/pay", {
|
|
|
|
|
|
|
+ .post("/payment/wxPay", {
|
|
|
data: {
|
|
data: {
|
|
|
amount: parseInt(`${amount * 100}`),
|
|
amount: parseInt(`${amount * 100}`),
|
|
|
openid: getApp<any>().globalData.user.openid,
|
|
openid: getApp<any>().globalData.user.openid,
|
|
@@ -83,10 +76,10 @@ export function insertMoney(amount: number) {
|
|
|
return new Promise((resolve, reject) => {
|
|
return new Promise((resolve, reject) => {
|
|
|
// #ifdef MP-WEIXIN
|
|
// #ifdef MP-WEIXIN
|
|
|
wx.requestPayment({
|
|
wx.requestPayment({
|
|
|
- timeStamp: res.timestamp,
|
|
|
|
|
|
|
+ timeStamp: `${res.timestamp}`,
|
|
|
nonceStr: res.nonceStr,
|
|
nonceStr: res.nonceStr,
|
|
|
- package: res.package,
|
|
|
|
|
- signType: "MD5",
|
|
|
|
|
|
|
+ package: res.packageVal,
|
|
|
|
|
+ signType: res.signType,
|
|
|
paySign: res.paySign,
|
|
paySign: res.paySign,
|
|
|
success(res: any) {
|
|
success(res: any) {
|
|
|
resolve(res);
|
|
resolve(res);
|