@uxda/appkit 4.2.68 → 4.2.69

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, { showModal, getSystemInfoSync, getMenuButtonBoundingClientRect, uploadFile, request as request$1, showToast, chooseMedia, chooseMessageFile, showLoading, hideLoading, useDidShow, getStorageSync, useRouter } from '@tarojs/taro';
7
+ import Taro, { showModal, getSystemInfoSync, getMenuButtonBoundingClientRect, uploadFile, request as request$1, showToast, chooseMedia, chooseMessageFile, showLoading, hideLoading, useRouter, useDidShow, getStorageSync } 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';
@@ -1686,6 +1686,8 @@ const requestBrandWCPay = (params, Appcode = "") => {
1686
1686
  icon: "none"
1687
1687
  });
1688
1688
  resolve(false);
1689
+ } else if (params.fromMini) {
1690
+ resolve(response.json);
1689
1691
  } else {
1690
1692
  requestWxH5Pay(response.json).then((result) => {
1691
1693
  if (result) {
@@ -1713,6 +1715,8 @@ const requestBrandWCPayByBean = (params, Appcode = "") => {
1713
1715
  icon: "none"
1714
1716
  });
1715
1717
  resolve(false);
1718
+ } else if (params.fromMini) {
1719
+ resolve(response.json);
1716
1720
  } else {
1717
1721
  requestWxH5Pay(response.json).then((result) => {
1718
1722
  if (result) {
@@ -1755,6 +1759,7 @@ var script$B = /* @__PURE__ */ defineComponent({
1755
1759
  emits: ["complete", "agree"],
1756
1760
  setup(__props, { emit: __emit }) {
1757
1761
  const props = __props;
1762
+ const { params } = useRouter();
1758
1763
  const emit = __emit;
1759
1764
  const state = reactive({
1760
1765
  agreed: false,
@@ -1804,12 +1809,15 @@ var script$B = /* @__PURE__ */ defineComponent({
1804
1809
  tenant: props.tenant,
1805
1810
  accountAuthFlag: false,
1806
1811
  channelCode: "centergzh",
1807
- payFinishJumpUrl: props.payFinishJumpUrl
1812
+ payFinishJumpUrl: props.payFinishJumpUrl,
1813
+ fromMini: !!params.from
1808
1814
  }).then((result) => {
1809
1815
  console.log(result, "------requestBrandWCPay");
1810
1816
  state.buttonLoading = false;
1811
- if (result) {
1817
+ if (typeof result === "boolean") {
1812
1818
  window.location.href = props.payFinishJumpUrl;
1819
+ } else {
1820
+ emit("complete", result);
1813
1821
  }
1814
1822
  });
1815
1823
  } else {
@@ -2108,6 +2116,7 @@ var script$x = /* @__PURE__ */ defineComponent({
2108
2116
  setup(__props, { emit: __emit }) {
2109
2117
  const props = __props;
2110
2118
  const { formatAmount } = useAmount();
2119
+ const { params } = useRouter();
2111
2120
  const emit = __emit;
2112
2121
  const state = reactive({
2113
2122
  agreed: false,
@@ -2183,12 +2192,15 @@ var script$x = /* @__PURE__ */ defineComponent({
2183
2192
  tenant: props.tenant,
2184
2193
  accountAuthFlag: false,
2185
2194
  channelCode: "centergzh",
2186
- payFinishJumpUrl: props.payFinishJumpUrl
2195
+ payFinishJumpUrl: props.payFinishJumpUrl,
2196
+ fromMini: !!params.from
2187
2197
  }).then((result) => {
2188
2198
  console.log(result, "------requestBrandWCPay");
2189
2199
  state.buttonLoading = false;
2190
- if (result) {
2200
+ if (typeof result === "boolean") {
2191
2201
  window.location.href = props.payFinishJumpUrl;
2202
+ } else {
2203
+ emit("complete", { result, type: "wePay" });
2192
2204
  }
2193
2205
  });
2194
2206
  } else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uxda/appkit",
3
- "version": "4.2.68",
3
+ "version": "4.2.69",
4
4
  "description": "小程序应用开发包",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.ts",
@@ -19,7 +19,7 @@ import { onMounted, reactive, ref } from 'vue'
19
19
  import AmountPicker from './AmountPicker.vue'
20
20
  import { useHttp, endpoints } from '../api'
21
21
  import { requestBrandWCPay, requestPayment } from '../services'
22
- import Taro, { showToast } from '@tarojs/taro'
22
+ import Taro, { showToast, useRouter } from '@tarojs/taro'
23
23
  import { isWechat } from '../../shared/composables/useDeviceEnv'
24
24
 
25
25
  // 充值用户界面
@@ -46,6 +46,7 @@ export interface RechargeViewProps {
46
46
  }
47
47
 
48
48
  const props = defineProps<RechargeViewProps>()
49
+ const { params } = useRouter()
49
50
 
50
51
  const emit = defineEmits<{
51
52
  (event: 'complete', value: boolean): void,
@@ -108,12 +109,15 @@ const onPayClick = () => {
108
109
  tenant: props.tenant,
109
110
  accountAuthFlag: false,
110
111
  channelCode: 'centergzh',
111
- payFinishJumpUrl: props.payFinishJumpUrl
112
+ payFinishJumpUrl: props.payFinishJumpUrl,
113
+ fromMini: !!params.from
112
114
  }).then(result => {
113
115
  console.log(result, '------requestBrandWCPay')
114
116
  state.buttonLoading = false
115
- if (result) {
117
+ if (typeof result === 'boolean') {
116
118
  window.location.href = props.payFinishJumpUrl as string
119
+ } else {
120
+ emit('complete', result)
117
121
  }
118
122
  })
119
123
  } else {
@@ -51,7 +51,7 @@ import { computed, onMounted, reactive, ref } from 'vue'
51
51
  import RightsPicker, { Amount } from './RightsPicker.vue'
52
52
  import { endpoints, useHttp } from '../api'
53
53
  import { requestBrandWCPayByBean, requestPaymentByBean } from '../services'
54
- import Taro, { showToast } from '@tarojs/taro'
54
+ import Taro, { showToast, useRouter } from '@tarojs/taro'
55
55
  import { useAmount } from '../../shared/composables/useAmount'
56
56
  import { isWechat } from '../../shared/composables/useDeviceEnv'
57
57
 
@@ -84,6 +84,7 @@ export interface RechargeViewProps {
84
84
 
85
85
  const props = defineProps<RechargeViewProps>()
86
86
  const { formatAmount } = useAmount()
87
+ const { params } = useRouter()
87
88
 
88
89
  const emit = defineEmits<{
89
90
  (event: 'complete', value: { result: boolean, type: string }): void,
@@ -179,12 +180,15 @@ const onPayClick = () => {
179
180
  tenant: props.tenant,
180
181
  accountAuthFlag: false,
181
182
  channelCode: 'centergzh',
182
- payFinishJumpUrl: props.payFinishJumpUrl
183
+ payFinishJumpUrl: props.payFinishJumpUrl,
184
+ fromMini: !!params.from
183
185
  }).then(result => {
184
186
  console.log(result, '------requestBrandWCPay')
185
187
  state.buttonLoading = false
186
- if (result) {
188
+ if (typeof result === 'boolean') {
187
189
  window.location.href = props.payFinishJumpUrl as string
190
+ } else {
191
+ emit('complete', { result, type: 'wePay' })
188
192
  }
189
193
  })
190
194
  } else {
@@ -75,6 +75,8 @@ const requestBrandWCPay = (params: PaymentParams, Appcode = '') => {
75
75
  icon: 'none',
76
76
  })
77
77
  resolve(false)
78
+ } else if (params.fromMini) {
79
+ resolve(response.json)
78
80
  } else {
79
81
  requestWxH5Pay(response.json).then((result) => {
80
82
  if (result) {
@@ -105,6 +107,8 @@ const requestBrandWCPayByBean = (params: PaymentParams, Appcode = '') => {
105
107
  icon: 'none',
106
108
  })
107
109
  resolve(false)
110
+ } else if (params.fromMini) {
111
+ resolve(response.json)
108
112
  } else {
109
113
  requestWxH5Pay(response.json).then((result) => {
110
114
  if (result) {
@@ -26,6 +26,7 @@ export type PaymentParams = {
26
26
  accountAuthFlag?: boolean
27
27
  channelCode?: string
28
28
  payFinishJumpUrl?: string
29
+ fromMini?: Boolean
29
30
  }
30
31
 
31
32
  export type RechargeParams = Pick<PaymentParams, 'app' | 'tenant'>