@uxda/appkit 4.2.66 → 4.2.68
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
|
@@ -4,7 +4,7 @@ import '@nutui/nutui-taro/dist/packages/checkbox/style/css';
|
|
|
4
4
|
import { defineComponent, reactive, createBlock, openBlock, withCtx, createElementBlock, Fragment, renderList, normalizeClass, createElementVNode, toDisplayString, createTextVNode, ref, computed, onUnmounted, createCommentVNode, renderSlot, createVNode, normalizeStyle, unref, isRef, onMounted, createStaticVNode, watch, withDirectives, vShow, useModel, mergeModels, resolveComponent, vModelText, watchPostEffect, withModifiers } from 'vue';
|
|
5
5
|
import '@nutui/nutui-taro/dist/packages/grid/style/css';
|
|
6
6
|
import '@nutui/nutui-taro/dist/packages/griditem/style/css';
|
|
7
|
-
import Taro, { getSystemInfoSync, getMenuButtonBoundingClientRect, uploadFile, request as request$1, showToast, chooseMedia, chooseMessageFile, showLoading, hideLoading, useDidShow,
|
|
7
|
+
import Taro, { showModal, getSystemInfoSync, getMenuButtonBoundingClientRect, uploadFile, request as request$1, showToast, chooseMedia, chooseMessageFile, showLoading, hideLoading, useDidShow, getStorageSync, useRouter } from '@tarojs/taro';
|
|
8
8
|
import '@nutui/nutui-taro/dist/packages/popup/style/css';
|
|
9
9
|
import isMobilePhone from 'validator/es/lib/isMobilePhone';
|
|
10
10
|
import isIdentityCard from 'validator/es/lib/isIdentityCard';
|
|
@@ -114,6 +114,16 @@ const getSdkConfig = (appCode, url) => {
|
|
|
114
114
|
function requestWxH5Pay(options) {
|
|
115
115
|
return new Promise((resolve, reject) => {
|
|
116
116
|
function onBridgeReady() {
|
|
117
|
+
if (typeof WeixinJSBridge === "undefined") {
|
|
118
|
+
showModal({
|
|
119
|
+
title: "\u63D0\u793A",
|
|
120
|
+
content: "\u5F53\u524D\u73AF\u5883\u4E0D\u652F\u6301\u5FAE\u4FE1\u652F\u4ED8\uFF0C\u8BF7\u5728\u5FAE\u4FE1\u5185\u7F6E\u6D4F\u89C8\u5668\u4E2D\u6253\u5F00",
|
|
121
|
+
confirmText: "\u786E\u5B9A",
|
|
122
|
+
success: () => {
|
|
123
|
+
}
|
|
124
|
+
});
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
117
127
|
WeixinJSBridge.invoke(
|
|
118
128
|
"getBrandWCPayRequest",
|
|
119
129
|
{
|
|
@@ -125,6 +135,7 @@ function requestWxH5Pay(options) {
|
|
|
125
135
|
timeStamp: options.timeStamp
|
|
126
136
|
},
|
|
127
137
|
function(res) {
|
|
138
|
+
console.log(res, "-------res");
|
|
128
139
|
if (res.err_msg == "get_brand_wcpay_request:ok") {
|
|
129
140
|
resolve(true);
|
|
130
141
|
} else {
|
|
@@ -168,7 +179,7 @@ function requestPayment$2(json) {
|
|
|
168
179
|
});
|
|
169
180
|
}
|
|
170
181
|
|
|
171
|
-
const
|
|
182
|
+
const jssdkServices = [getSdkConfig$1];
|
|
172
183
|
|
|
173
184
|
function useSafeArea() {
|
|
174
185
|
const systemInfo = getSystemInfoSync(), capsule = Taro.getEnv() === "WEAPP" ? getMenuButtonBoundingClientRect() : { top: 0, height: 0 };
|
|
@@ -1668,6 +1679,7 @@ const requestBrandWCPay = (params, Appcode = "") => {
|
|
|
1668
1679
|
$http.post(endpoints.\u83B7\u53D6\u5FAE\u4FE1\u652F\u4ED8\u53C2\u6570\u5305, {
|
|
1669
1680
|
...params
|
|
1670
1681
|
}).then((response) => {
|
|
1682
|
+
console.log(response, "-----response");
|
|
1671
1683
|
if (!response.json) {
|
|
1672
1684
|
showToast({
|
|
1673
1685
|
title: response.message,
|
|
@@ -8743,7 +8755,7 @@ const nutComponents = [
|
|
|
8743
8755
|
({
|
|
8744
8756
|
...components
|
|
8745
8757
|
});
|
|
8746
|
-
const services = [...services$1, ...
|
|
8758
|
+
const services = [...services$1, ...jssdkServices];
|
|
8747
8759
|
const $app = {
|
|
8748
8760
|
setToken: (token) => {
|
|
8749
8761
|
const appKitOptions = useAppKitOptions();
|
|
@@ -8781,4 +8793,4 @@ const AppKit = {
|
|
|
8781
8793
|
}
|
|
8782
8794
|
};
|
|
8783
8795
|
|
|
8784
|
-
export { script$q as AccountView, script$J as AmountPicker, script$H as AppDrawer, script$G as AppVerify, script$w as BalanceCard, script$p as BalanceReminder, script$o as DateRange, script$E as DeviceVersion, script$m as ListFilter, script$2 as LoginSetting, script$f as NoticeBanner, script$e as NoticeEntry, script$c as NoticeList, script$C as OcrBusinessLicense, script$D as OcrIcon, script$I as PageHeader, script$l as PromoterCard, script$z as RechargeResult, script$B as RechargeView, script$h as SelfRegistration, script$x as TradeView, script$A as UserAgreement, script as UserAuth, script$8 as UserBinding, script$7 as UserBindingSuccess, script$b as UserEntry, script$4 as UserFeedback, script$3 as UserFeedbackEntry, script$5 as UserHeadCrop, script$9 as UserInfo, script$1 as UserResourceEmpty, components, createHttp, AppKit as default, defaultCryptoConfig, generateUniqueId, getSdkConfig, requestPayment$2 as requestPayment, requestWxH5Pay, useAppKit, useCountdown, useCrypto, useEncode, useLogger, useSafeArea, useTabbar, useUpload, useValidator };
|
|
8796
|
+
export { script$q as AccountView, script$J as AmountPicker, script$H as AppDrawer, script$G as AppVerify, script$w as BalanceCard, script$p as BalanceReminder, script$o as DateRange, script$E as DeviceVersion, script$m as ListFilter, script$2 as LoginSetting, script$f as NoticeBanner, script$e as NoticeEntry, script$c as NoticeList, script$C as OcrBusinessLicense, script$D as OcrIcon, script$I as PageHeader, script$l as PromoterCard, script$z as RechargeResult, script$B as RechargeView, script$h as SelfRegistration, script$x as TradeView, script$A as UserAgreement, script as UserAuth, script$8 as UserBinding, script$7 as UserBindingSuccess, script$b as UserEntry, script$4 as UserFeedback, script$3 as UserFeedbackEntry, script$5 as UserHeadCrop, script$9 as UserInfo, script$1 as UserResourceEmpty, components, createHttp, AppKit as default, defaultCryptoConfig, generateUniqueId, getSdkConfig, jssdkServices, requestPayment$2 as requestPayment, requestWxH5Pay, services$1 as services, useAppKit, useCountdown, useCrypto, useEncode, useLogger, useSafeArea, useTabbar, useUpload, useValidator };
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { App } from 'vue'
|
|
2
2
|
import { components as paymentComponents } from './payment/components'
|
|
3
3
|
import { services as paymentServices } from './payment'
|
|
4
|
-
import {
|
|
4
|
+
import { jssdkServices } from './shared'
|
|
5
5
|
import // Grid,
|
|
6
6
|
// GridItem,
|
|
7
7
|
// Button,
|
package/src/shared/index.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Service } from '../../payment/services'
|
|
2
2
|
import getSdkConfig from './jssdk'
|
|
3
3
|
|
|
4
|
-
const
|
|
4
|
+
const jssdkServices: Service[] = [getSdkConfig]
|
|
5
5
|
|
|
6
|
-
export default
|
|
6
|
+
export default jssdkServices
|
|
7
7
|
|
|
8
8
|
export * from './payment'
|
|
9
9
|
export * from './jssdk'
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { DollarApp } from '../../Appkit'
|
|
2
2
|
import { useHttp } from '../../payment/api'
|
|
3
|
+
import { showModal } from '@tarojs/taro'
|
|
3
4
|
|
|
4
5
|
interface JssdkConfig {
|
|
5
6
|
appId: string
|
|
@@ -44,6 +45,16 @@ const getSdkConfig = (appCode?: string, url?: string): Promise<JssdkConfig> => {
|
|
|
44
45
|
function requestWxH5Pay(options: PrePayOptions) {
|
|
45
46
|
return new Promise<boolean>((resolve, reject) => {
|
|
46
47
|
function onBridgeReady() {
|
|
48
|
+
// @ts-ignore
|
|
49
|
+
if (typeof WeixinJSBridge === 'undefined') {
|
|
50
|
+
showModal({
|
|
51
|
+
title: '提示',
|
|
52
|
+
content: '当前环境不支持微信支付,请在微信内置浏览器中打开',
|
|
53
|
+
confirmText: '确定',
|
|
54
|
+
success: () => {},
|
|
55
|
+
})
|
|
56
|
+
return
|
|
57
|
+
}
|
|
47
58
|
// @ts-ignore
|
|
48
59
|
WeixinJSBridge.invoke(
|
|
49
60
|
'getBrandWCPayRequest',
|
|
@@ -56,6 +67,7 @@ function requestWxH5Pay(options: PrePayOptions) {
|
|
|
56
67
|
timeStamp: options.timeStamp,
|
|
57
68
|
},
|
|
58
69
|
function (res) {
|
|
70
|
+
console.log(res, '-------res')
|
|
59
71
|
if (res.err_msg == 'get_brand_wcpay_request:ok') {
|
|
60
72
|
//res.err_msg将在用户支付成功后返回ok,但并不保证它绝对可靠,商户需进一步调用后端查单确认支付结果。
|
|
61
73
|
resolve(true)
|