@uxda/appkit 4.2.68 → 4.2.71

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';
@@ -1679,13 +1679,14 @@ const requestBrandWCPay = (params, Appcode = "") => {
1679
1679
  $http.post(endpoints.\u83B7\u53D6\u5FAE\u4FE1\u652F\u4ED8\u53C2\u6570\u5305, {
1680
1680
  ...params
1681
1681
  }).then((response) => {
1682
- console.log(response, "-----response");
1683
1682
  if (!response.json) {
1684
1683
  showToast({
1685
1684
  title: response.message,
1686
1685
  icon: "none"
1687
1686
  });
1688
1687
  resolve(false);
1688
+ } else if (params.fromMini) {
1689
+ resolve(response.json);
1689
1690
  } else {
1690
1691
  requestWxH5Pay(response.json).then((result) => {
1691
1692
  if (result) {
@@ -1713,6 +1714,8 @@ const requestBrandWCPayByBean = (params, Appcode = "") => {
1713
1714
  icon: "none"
1714
1715
  });
1715
1716
  resolve(false);
1717
+ } else if (params.fromMini) {
1718
+ resolve(response.json);
1716
1719
  } else {
1717
1720
  requestWxH5Pay(response.json).then((result) => {
1718
1721
  if (result) {
@@ -1755,6 +1758,7 @@ var script$B = /* @__PURE__ */ defineComponent({
1755
1758
  emits: ["complete", "agree"],
1756
1759
  setup(__props, { emit: __emit }) {
1757
1760
  const props = __props;
1761
+ const { params } = useRouter();
1758
1762
  const emit = __emit;
1759
1763
  const state = reactive({
1760
1764
  agreed: false,
@@ -1804,12 +1808,15 @@ var script$B = /* @__PURE__ */ defineComponent({
1804
1808
  tenant: props.tenant,
1805
1809
  accountAuthFlag: false,
1806
1810
  channelCode: "centergzh",
1807
- payFinishJumpUrl: props.payFinishJumpUrl
1811
+ payFinishJumpUrl: props.payFinishJumpUrl,
1812
+ fromMini: !!params.from
1808
1813
  }).then((result) => {
1809
1814
  console.log(result, "------requestBrandWCPay");
1810
1815
  state.buttonLoading = false;
1811
- if (result) {
1816
+ if (typeof result === "boolean" && result) {
1812
1817
  window.location.href = props.payFinishJumpUrl;
1818
+ } else {
1819
+ emit("complete", result);
1813
1820
  }
1814
1821
  });
1815
1822
  } else {
@@ -2108,6 +2115,7 @@ var script$x = /* @__PURE__ */ defineComponent({
2108
2115
  setup(__props, { emit: __emit }) {
2109
2116
  const props = __props;
2110
2117
  const { formatAmount } = useAmount();
2118
+ const { params } = useRouter();
2111
2119
  const emit = __emit;
2112
2120
  const state = reactive({
2113
2121
  agreed: false,
@@ -2183,12 +2191,15 @@ var script$x = /* @__PURE__ */ defineComponent({
2183
2191
  tenant: props.tenant,
2184
2192
  accountAuthFlag: false,
2185
2193
  channelCode: "centergzh",
2186
- payFinishJumpUrl: props.payFinishJumpUrl
2194
+ payFinishJumpUrl: props.payFinishJumpUrl,
2195
+ fromMini: !!params.from
2187
2196
  }).then((result) => {
2188
2197
  console.log(result, "------requestBrandWCPay");
2189
2198
  state.buttonLoading = false;
2190
- if (result) {
2199
+ if (typeof result === "boolean" && result) {
2191
2200
  window.location.href = props.payFinishJumpUrl;
2201
+ } else {
2202
+ emit("complete", { result, type: "wePay" });
2192
2203
  }
2193
2204
  });
2194
2205
  } 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.71",
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' && result) {
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' && result) {
187
189
  window.location.href = props.payFinishJumpUrl as string
190
+ } else {
191
+ emit('complete', { result, type: 'wePay' })
188
192
  }
189
193
  })
190
194
  } else {
@@ -68,13 +68,14 @@ const requestBrandWCPay = (params: PaymentParams, Appcode = '') => {
68
68
  ...params,
69
69
  })
70
70
  .then((response: any) => {
71
- console.log(response, '-----response')
72
71
  if (!response.json) {
73
72
  showToast({
74
73
  title: response.message,
75
74
  icon: 'none',
76
75
  })
77
76
  resolve(false)
77
+ } else if (params.fromMini) {
78
+ resolve(response.json)
78
79
  } else {
79
80
  requestWxH5Pay(response.json).then((result) => {
80
81
  if (result) {
@@ -105,6 +106,8 @@ const requestBrandWCPayByBean = (params: PaymentParams, Appcode = '') => {
105
106
  icon: 'none',
106
107
  })
107
108
  resolve(false)
109
+ } else if (params.fromMini) {
110
+ resolve(response.json)
108
111
  } else {
109
112
  requestWxH5Pay(response.json).then((result) => {
110
113
  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'>