feat: 订单列表基本功能
This commit is contained in:
@@ -1,10 +1,7 @@
|
||||
export * from './getNavbarHeight'
|
||||
export * from './genderUtils'
|
||||
export * from './locationUtils'
|
||||
export * from './processImage'
|
||||
export * from './timeUtils'
|
||||
export * from './tokenManager'
|
||||
|
||||
export function delay(ms: number) {
|
||||
return new Promise(resolve => setTimeout(resolve, ms))
|
||||
}
|
||||
export * from "./getNavbarHeight";
|
||||
export * from "./genderUtils";
|
||||
export * from "./locationUtils";
|
||||
export * from "./processImage";
|
||||
export * from "./timeUtils";
|
||||
export * from "./tokenManager";
|
||||
export * from "./order.pay";
|
||||
|
||||
20
src/utils/order.pay.ts
Normal file
20
src/utils/order.pay.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
import Taro from "@tarojs/taro";
|
||||
|
||||
export function delay(ms: number) {
|
||||
return new Promise((resolve) => setTimeout(resolve, ms));
|
||||
}
|
||||
|
||||
export async function payOrder(params) {
|
||||
const { timeStamp, nonceStr, package: _package, signType, paySign } = params;
|
||||
return new Promise((resolve, reject) => {
|
||||
Taro.requestPayment({
|
||||
timeStamp,
|
||||
nonceStr,
|
||||
package: _package,
|
||||
signType,
|
||||
paySign,
|
||||
success: resolve,
|
||||
fail: reject.bind(null, new Error("支付失败")),
|
||||
});
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user