@uxda/appkit 4.2.67 → 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 +11 -1
- package/package.json +1 -1
- package/src/shared/weixin/jssdk.ts +11 -0
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
|
{
|
package/package.json
CHANGED
|
@@ -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',
|