@uxda/appkit 4.2.46 → 4.2.48
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/appkit.css +9 -9
- package/dist/index.js +208 -104
- package/package.json +3 -1
- package/src/Appkit.ts +1 -0
- package/src/balance/api/index.ts +2 -2
- package/src/balance/components/AccountView.vue +34 -29
- package/src/components/bt-cropper/index.vue +2 -2
- package/src/index.ts +3 -1
- package/src/notice/api/index.ts +2 -2
- package/src/notice/components/NoticeBanner.vue +14 -22
- package/src/notice/components/NoticeEntry.vue +2 -2
- package/src/notice/components/NoticeList.vue +6 -2
- package/src/notice/components/useCommonList.ts +5 -5
- package/src/payment/api/endpoints.ts +17 -22
- package/src/payment/api/index.ts +2 -2
- package/src/payment/components/RechargeView.vue +39 -19
- package/src/payment/components/TradeView.vue +3 -3
- package/src/payment/services/request-payment.ts +34 -4
- package/src/payment/types.ts +8 -7
- package/src/register/components/SelfRegistration.vue +2 -2
- package/src/shared/components/AppDrawer.vue +9 -10
- package/src/shared/components/OcrBusinessLicense.vue +6 -6
- package/src/shared/components/OcrIcon.vue +7 -7
- package/src/shared/index.ts +5 -1
- package/src/shared/weixin/index.ts +9 -1
- package/src/shared/weixin/jssdk.ts +91 -0
- package/src/user/api/index.ts +3 -3
- package/src/user/components/UserAuth.vue +26 -63
- package/src/user/components/UserBinding.vue +41 -70
- package/src/user/components/UserBindingSuccess.vue +2 -2
- package/src/user/components/UserFeedback.vue +40 -43
- package/src/user/components/UserInfo.vue +56 -181
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uxda/appkit",
|
|
3
|
-
"version": "4.2.
|
|
3
|
+
"version": "4.2.48",
|
|
4
4
|
"description": "小程序应用开发包",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.ts",
|
|
@@ -34,6 +34,8 @@
|
|
|
34
34
|
"@tarojs/shared": "^4.0.0",
|
|
35
35
|
"@tarojs/taro": "^4.0.0",
|
|
36
36
|
"@types/wechat-miniprogram": "^3.4.7",
|
|
37
|
+
"@uxda/appkit": "^4.2.47",
|
|
38
|
+
"@uxda/nutshell": "^1.6.50",
|
|
37
39
|
"dayjs": "^1.11.10",
|
|
38
40
|
"lodash-es": "^4.17.21",
|
|
39
41
|
"validator": "^13.12.0",
|
package/src/Appkit.ts
CHANGED
package/src/balance/api/index.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import Taro, { request as TaroRequest } from '@tarojs/taro'
|
|
1
|
+
import Taro, { request as TaroRequest, showToast } from '@tarojs/taro'
|
|
2
2
|
import { HttpRequestConfig, PagingData, PagingParams, ResponseRaw, createHttp } from '../../shared'
|
|
3
3
|
import { translates, transforms } from './endpoints'
|
|
4
4
|
import { useAppKitOptions } from '../../Appkit'
|
|
@@ -32,7 +32,7 @@ const vendor = {
|
|
|
32
32
|
data: data.result as T,
|
|
33
33
|
})
|
|
34
34
|
} else if (data.code !== '401') {
|
|
35
|
-
|
|
35
|
+
showToast({
|
|
36
36
|
title: data.msg,
|
|
37
37
|
icon: 'none',
|
|
38
38
|
})
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="account-view">
|
|
3
3
|
<div class="scroll-content">
|
|
4
|
-
<page-header title="我的账户" :class="{ 'with-background': scrolled > 0 }"
|
|
4
|
+
<page-header :title="Taro.getEnv() !== 'WEB' ? '我的账户' : ''" :class="{ 'with-background': scrolled > 0 }"
|
|
5
|
+
@close="onPageHeaderClose" />
|
|
5
6
|
<div class="row jusify-right">
|
|
6
7
|
<div class="small-bean-button" @click="onSecondBalanceButtonClick">
|
|
7
|
-
<label>收支明细</label>
|
|
8
|
+
<label class="label">收支明细</label>
|
|
8
9
|
</div>
|
|
9
10
|
</div>
|
|
10
11
|
<div class="balance">
|
|
@@ -98,7 +99,7 @@
|
|
|
98
99
|
</div>
|
|
99
100
|
</div>
|
|
100
101
|
<div class="operation-list">
|
|
101
|
-
<
|
|
102
|
+
<ScrollView class="operation-scroll" :scroll-y="true" @scroll="onScroll" :lower-threshold="100"
|
|
102
103
|
@scrolltolower="onReachBottom">
|
|
103
104
|
<div class="box" v-if="consumptionGroups.length > 0">
|
|
104
105
|
<div class="box-detail" v-for="(item, index) in consumptionGroups" :key="index">
|
|
@@ -126,14 +127,14 @@
|
|
|
126
127
|
<div class="box-not-text" v-if="reachedLastPage">没有更多了</div>
|
|
127
128
|
</div>
|
|
128
129
|
<empty-view v-else></empty-view>
|
|
129
|
-
</
|
|
130
|
+
</ScrollView>
|
|
130
131
|
</div>
|
|
131
132
|
</div>
|
|
132
133
|
</app-drawer>
|
|
133
134
|
</template>
|
|
134
135
|
|
|
135
136
|
<script lang="ts" setup>
|
|
136
|
-
import Taro, { useDidShow } from '@tarojs/taro'
|
|
137
|
+
import Taro, { useDidShow, showLoading, hideLoading } from '@tarojs/taro'
|
|
137
138
|
import { computed, onMounted, reactive, ref, watch } from 'vue'
|
|
138
139
|
import { endpoints, useHttp } from '../api'
|
|
139
140
|
import { 账户流水筛选项, Balance, ConsumptionGroup, 账户流水 } from '../types'
|
|
@@ -146,8 +147,7 @@ import EmptyView from '../../shared/components/EmptyView.vue'
|
|
|
146
147
|
import Tip from './Tip.vue'
|
|
147
148
|
import groupBy from 'lodash-es/groupBy'
|
|
148
149
|
import { useAmount } from '../../shared/composables/useAmount'
|
|
149
|
-
|
|
150
|
-
const refreshing = ref(false)
|
|
150
|
+
import { ScrollView } from '@tarojs/components'
|
|
151
151
|
|
|
152
152
|
type AccountViewProps = {
|
|
153
153
|
app: string
|
|
@@ -156,6 +156,7 @@ const props = withDefaults(defineProps<AccountViewProps>(), {
|
|
|
156
156
|
app: '',
|
|
157
157
|
})
|
|
158
158
|
|
|
159
|
+
const refreshing = ref(false)
|
|
159
160
|
const { formatAmount } = useAmount()
|
|
160
161
|
const emit = defineEmits(['recharge', 'trade'])
|
|
161
162
|
|
|
@@ -212,9 +213,11 @@ const balance = ref<Balance>({
|
|
|
212
213
|
})
|
|
213
214
|
|
|
214
215
|
useDidShow(() => {
|
|
215
|
-
Taro.
|
|
216
|
-
|
|
217
|
-
|
|
216
|
+
if (Taro.getEnv() !== 'WEB') {
|
|
217
|
+
Taro.setNavigationBarTitle({
|
|
218
|
+
title: '我的账户',
|
|
219
|
+
})
|
|
220
|
+
}
|
|
218
221
|
loadBalance()
|
|
219
222
|
})
|
|
220
223
|
|
|
@@ -251,7 +254,7 @@ async function loadConsumptions(append: boolean = false) {
|
|
|
251
254
|
consumptionGroups.value = []
|
|
252
255
|
}
|
|
253
256
|
const $http = useHttp()
|
|
254
|
-
|
|
257
|
+
showLoading({
|
|
255
258
|
title: `加载中...`,
|
|
256
259
|
mask: true,
|
|
257
260
|
})
|
|
@@ -269,7 +272,7 @@ async function loadConsumptions(append: boolean = false) {
|
|
|
269
272
|
reachedLastPage.value = false
|
|
270
273
|
}
|
|
271
274
|
}).finally(() => {
|
|
272
|
-
|
|
275
|
+
hideLoading()
|
|
273
276
|
})
|
|
274
277
|
}
|
|
275
278
|
|
|
@@ -372,14 +375,16 @@ function onSecondBalanceButtonClick() {
|
|
|
372
375
|
}
|
|
373
376
|
|
|
374
377
|
watch(secondBalanceOpen, () => {
|
|
375
|
-
Taro.
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
378
|
+
if (Taro.getEnv() !== 'WEB') {
|
|
379
|
+
Taro.setNavigationBarColor({
|
|
380
|
+
frontColor: secondBalanceOpen.value ? '#000000' : '#ffffff',
|
|
381
|
+
backgroundColor: '#ffffff',
|
|
382
|
+
animation: {
|
|
383
|
+
duration: 400,
|
|
384
|
+
timingFunc: 'easeIn',
|
|
385
|
+
},
|
|
386
|
+
})
|
|
387
|
+
}
|
|
383
388
|
})
|
|
384
389
|
|
|
385
390
|
function onDateReset() {
|
|
@@ -456,7 +461,7 @@ onMounted(() => {
|
|
|
456
461
|
color: #353535;
|
|
457
462
|
font-size: 12px;
|
|
458
463
|
|
|
459
|
-
label {
|
|
464
|
+
.label {
|
|
460
465
|
background-image: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTEwIDZMMTYgMTJMMTAgMThWNloiIGZpbGw9IiMzNTM1MzUiIHN0cm9rZT0iIzM1MzUzNSIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWpvaW49InJvdW5kIi8+Cjwvc3ZnPgo=');
|
|
461
466
|
padding-right: 18px;
|
|
462
467
|
background-repeat: no-repeat;
|
|
@@ -734,23 +739,23 @@ onMounted(() => {
|
|
|
734
739
|
align-items: center;
|
|
735
740
|
|
|
736
741
|
.item-title-button {
|
|
737
|
-
padding: 0
|
|
738
|
-
height:
|
|
739
|
-
line-height:
|
|
742
|
+
padding: 0 14px;
|
|
743
|
+
height: 27px;
|
|
744
|
+
line-height: 27px;
|
|
740
745
|
background: -webkit-linear-gradient(262.82deg, #353535 10.04%, #433f46 90.21%);
|
|
741
746
|
background: linear-gradient(187.18deg, #353535 10.04%, #433f46 90.21%);
|
|
742
|
-
border-radius:
|
|
747
|
+
border-radius: 14px;
|
|
743
748
|
color: #e7caad;
|
|
744
|
-
font-size:
|
|
749
|
+
font-size: 12px;
|
|
745
750
|
font-weight: 400;
|
|
746
|
-
margin-left:
|
|
751
|
+
margin-left: 20px;
|
|
747
752
|
display: flex;
|
|
748
753
|
align-items: center;
|
|
749
754
|
|
|
750
755
|
.button-icon {
|
|
751
756
|
display: block;
|
|
752
|
-
width:
|
|
753
|
-
height:
|
|
757
|
+
width: 12px;
|
|
758
|
+
height: 12px;
|
|
754
759
|
font-size: 0;
|
|
755
760
|
margin-left: 4px;
|
|
756
761
|
}
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
/**
|
|
56
56
|
* better-cropper 图片裁切插件
|
|
57
57
|
*/
|
|
58
|
-
import Taro, { getSystemInfoSync } from '@tarojs/taro'
|
|
58
|
+
import Taro, { getSystemInfoSync, showToast } from '@tarojs/taro'
|
|
59
59
|
import calcImageSize from './utils/calcImageSize.js'
|
|
60
60
|
import calcImagePosition from './utils/calcImagePosition.js'
|
|
61
61
|
import calcCropper from './utils/calcCropper.js'
|
|
@@ -269,7 +269,7 @@ export default {
|
|
|
269
269
|
fail: (err) => {
|
|
270
270
|
console.error(err)
|
|
271
271
|
this.imageInfo = ''
|
|
272
|
-
|
|
272
|
+
showToast({
|
|
273
273
|
title: '下载图片失败',
|
|
274
274
|
icon: 'none',
|
|
275
275
|
})
|
package/src/index.ts
CHANGED
|
@@ -1,6 +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 { services as jssdkServices } from './shared'
|
|
4
5
|
import // Grid,
|
|
5
6
|
// GridItem,
|
|
6
7
|
// Button,
|
|
@@ -37,7 +38,7 @@ const appComponents = {
|
|
|
37
38
|
...paymentComponents,
|
|
38
39
|
}
|
|
39
40
|
|
|
40
|
-
const services = [...paymentServices]
|
|
41
|
+
const services = [...paymentServices, ...jssdkServices]
|
|
41
42
|
|
|
42
43
|
const $app: DollarApp = {
|
|
43
44
|
setToken: (token: () => string) => {
|
|
@@ -50,6 +51,7 @@ const $app: DollarApp = {
|
|
|
50
51
|
},
|
|
51
52
|
requestPayment: (options: PaymentParams) => {},
|
|
52
53
|
invokeRecharge: (options: RechargeParams) => {},
|
|
54
|
+
getSdkConfig: (appCode: string) => {},
|
|
53
55
|
}
|
|
54
56
|
|
|
55
57
|
services.forEach((service) => {
|
package/src/notice/api/index.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import Taro, { request as TaroRequest } from '@tarojs/taro'
|
|
1
|
+
import Taro, { request as TaroRequest, showToast } from '@tarojs/taro'
|
|
2
2
|
import { HttpRequestConfig, PagingData, PagingParams, ResponseRaw, createHttp } from '../../shared'
|
|
3
3
|
import { translates, transforms } from './endpoints'
|
|
4
4
|
import { useAppKitOptions } from '../../Appkit'
|
|
@@ -32,7 +32,7 @@ const vendor = {
|
|
|
32
32
|
data: data.result as T,
|
|
33
33
|
})
|
|
34
34
|
} else if (data.code !== '401') {
|
|
35
|
-
|
|
35
|
+
showToast({
|
|
36
36
|
title: data.msg,
|
|
37
37
|
icon: 'none',
|
|
38
38
|
})
|
|
@@ -1,24 +1,9 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div
|
|
3
|
-
|
|
4
|
-
:class="{
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
@touchstart="onTouchStart"
|
|
8
|
-
@touchend="onTouchEnd"
|
|
9
|
-
>
|
|
10
|
-
<DdNoticeBar
|
|
11
|
-
:class="{ show: key === activeKey }"
|
|
12
|
-
v-for="(item, key) in bannerMessages"
|
|
13
|
-
:key="key"
|
|
14
|
-
:showClose="item.noticeType === 0"
|
|
15
|
-
@close="onClose(item, key)"
|
|
16
|
-
>
|
|
17
|
-
<img
|
|
18
|
-
class="notice-banner-icon"
|
|
19
|
-
src="https://cdn.ddjf.com/static/images/customer-center/notice-icon.png"
|
|
20
|
-
alt=""
|
|
21
|
-
/>
|
|
2
|
+
<div class="notice-banner" :class="{ fixed: fixed }" :style="topStype" v-if="bannerMessages.length"
|
|
3
|
+
@touchstart="onTouchStart" @touchend="onTouchEnd">
|
|
4
|
+
<DdNoticeBar :class="{ show: key === activeKey }" v-for="(item, key) in bannerMessages" :key="key"
|
|
5
|
+
:showClose="item.noticeType === 0" @close="onClose(item, key)">
|
|
6
|
+
<img class="notice-banner-icon" src="https://cdn.ddjf.com/static/images/customer-center/notice-icon.png" alt="" />
|
|
22
7
|
<div class="notice-banner-text">
|
|
23
8
|
{{ item.context }}
|
|
24
9
|
</div>
|
|
@@ -38,7 +23,7 @@ import { useHttp } from '../api'
|
|
|
38
23
|
import { useAppKitOptions } from '../../Appkit'
|
|
39
24
|
import DdNoticeBar from '../../components/dd-notice-bar/index.vue'
|
|
40
25
|
import NoticePopup from './NoticePopup.vue'
|
|
41
|
-
import Taro from '@tarojs/taro'
|
|
26
|
+
import Taro, { showToast } from '@tarojs/taro'
|
|
42
27
|
import { useNotice } from './useNotice'
|
|
43
28
|
import debounce from 'lodash-es/debounce'
|
|
44
29
|
import { useSafeArea } from '../../shared/composables'
|
|
@@ -144,7 +129,7 @@ const onClose = debounce((item: any, index: number) => {
|
|
|
144
129
|
receiveId: item.id,
|
|
145
130
|
})
|
|
146
131
|
.then(() => {
|
|
147
|
-
|
|
132
|
+
showToast({
|
|
148
133
|
title: '消息已关闭',
|
|
149
134
|
icon: 'none',
|
|
150
135
|
})
|
|
@@ -190,6 +175,7 @@ const emits = defineEmits(['detail', 'close', 'view', 'popup'])
|
|
|
190
175
|
background: #e6f2ff;
|
|
191
176
|
height: 30px;
|
|
192
177
|
margin-bottom: 8px;
|
|
178
|
+
|
|
193
179
|
&.fixed {
|
|
194
180
|
position: fixed;
|
|
195
181
|
z-index: 10;
|
|
@@ -206,19 +192,23 @@ const emits = defineEmits(['detail', 'close', 'view', 'popup'])
|
|
|
206
192
|
min-height: auto;
|
|
207
193
|
transition: all 0.2s;
|
|
208
194
|
opacity: 0;
|
|
195
|
+
|
|
209
196
|
&.show {
|
|
210
197
|
height: 30px;
|
|
211
198
|
opacity: 1;
|
|
212
199
|
}
|
|
213
200
|
}
|
|
201
|
+
|
|
214
202
|
&-icon {
|
|
215
203
|
width: 22px;
|
|
216
204
|
height: 22px;
|
|
217
205
|
margin-right: 8px;
|
|
218
206
|
}
|
|
207
|
+
|
|
219
208
|
.dd-notice-bar__close-img {
|
|
220
209
|
display: none;
|
|
221
210
|
}
|
|
211
|
+
|
|
222
212
|
.dd-notice-bar__close {
|
|
223
213
|
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20' fill='none'%3E %3Cpath d='M3.3335 3.33331L16.6668 16.6666' stroke='%23353535' stroke-width='1.66667' stroke-linecap='round' stroke-linejoin='round'/%3E %3Cpath d='M3.3335 16.6666L16.6668 3.33331' stroke='%23353535' stroke-width='1.66667' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
|
|
224
214
|
background-position: center;
|
|
@@ -226,6 +216,7 @@ const emits = defineEmits(['detail', 'close', 'view', 'popup'])
|
|
|
226
216
|
background-size: 12px 12px;
|
|
227
217
|
opacity: 0.6;
|
|
228
218
|
}
|
|
219
|
+
|
|
229
220
|
&-text {
|
|
230
221
|
flex: 1;
|
|
231
222
|
overflow: hidden;
|
|
@@ -235,6 +226,7 @@ const emits = defineEmits(['detail', 'close', 'view', 'popup'])
|
|
|
235
226
|
-webkit-box-orient: vertical;
|
|
236
227
|
text-align: left;
|
|
237
228
|
}
|
|
229
|
+
|
|
238
230
|
&-btn {
|
|
239
231
|
color: var(--app-primary-color, #017fff);
|
|
240
232
|
padding-left: 6px;
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
import { ref } from 'vue'
|
|
15
15
|
import { useHttp } from '../api'
|
|
16
16
|
import { useAppKitOptions } from '../../Appkit'
|
|
17
|
-
import Taro, { useDidShow } from '@tarojs/taro'
|
|
17
|
+
import Taro, { useDidShow, showToast } from '@tarojs/taro'
|
|
18
18
|
import debounce from 'lodash-es/debounce'
|
|
19
19
|
|
|
20
20
|
const props = withDefaults(
|
|
@@ -30,7 +30,7 @@ const props = withDefaults(
|
|
|
30
30
|
|
|
31
31
|
const init = debounce(() => {
|
|
32
32
|
if (!props.app) {
|
|
33
|
-
return
|
|
33
|
+
return showToast({
|
|
34
34
|
title: 'NoticeEntry组件缺少appcode',
|
|
35
35
|
icon: 'none',
|
|
36
36
|
})
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
|
|
73
73
|
<script lang="ts" setup>
|
|
74
74
|
import { onMounted, ref } from 'vue'
|
|
75
|
-
import Taro from '@tarojs/taro'
|
|
75
|
+
import Taro, { showToast } from '@tarojs/taro'
|
|
76
76
|
import DdSearch from '../../components/dd-search/index.vue'
|
|
77
77
|
import dayjs from 'dayjs'
|
|
78
78
|
import { useNotice } from './useNotice'
|
|
@@ -109,7 +109,7 @@ const { list, init, runNext, runRefresh, isLast } = useCommonList<
|
|
|
109
109
|
|
|
110
110
|
onMounted(async () => {
|
|
111
111
|
if (!props.app) {
|
|
112
|
-
return
|
|
112
|
+
return showToast({
|
|
113
113
|
title: 'NoticeList组件缺少appcode',
|
|
114
114
|
icon: 'none',
|
|
115
115
|
})
|
|
@@ -152,6 +152,10 @@ async function notifyRead(notice: any, index) {
|
|
|
152
152
|
list.value[index].isRead = '1'
|
|
153
153
|
}
|
|
154
154
|
}
|
|
155
|
+
showToast({
|
|
156
|
+
title: '消息已读',
|
|
157
|
+
icon: 'none',
|
|
158
|
+
})
|
|
155
159
|
}
|
|
156
160
|
|
|
157
161
|
// 点击搜索
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import Taro from '@tarojs/taro'
|
|
1
|
+
import Taro, { showLoading, hideLoading } from '@tarojs/taro'
|
|
2
2
|
import { Ref, ref, unref } from 'vue'
|
|
3
3
|
import { useHttp } from '../api'
|
|
4
4
|
|
|
@@ -17,7 +17,7 @@ interface QueryLimit {
|
|
|
17
17
|
export function useCommonList<R, Q extends QueryLimit>(
|
|
18
18
|
api: string,
|
|
19
19
|
query: Ref<Q>,
|
|
20
|
-
|
|
20
|
+
loading = true,
|
|
21
21
|
method = 'GET'
|
|
22
22
|
) {
|
|
23
23
|
const isLast = ref(false)
|
|
@@ -28,7 +28,7 @@ export function useCommonList<R, Q extends QueryLimit>(
|
|
|
28
28
|
|
|
29
29
|
async function fetchData(loading) {
|
|
30
30
|
loading &&
|
|
31
|
-
|
|
31
|
+
showLoading({
|
|
32
32
|
title: '加载中...',
|
|
33
33
|
})
|
|
34
34
|
isLoading.value = true
|
|
@@ -39,7 +39,7 @@ export function useCommonList<R, Q extends QueryLimit>(
|
|
|
39
39
|
})
|
|
40
40
|
|
|
41
41
|
isLoading.value = false
|
|
42
|
-
loading &&
|
|
42
|
+
loading && hideLoading()
|
|
43
43
|
if (res) {
|
|
44
44
|
const pages = Math.ceil(res.total / res.pageSize)
|
|
45
45
|
isLast.value = res.pageNum >= pages
|
|
@@ -69,7 +69,7 @@ export function useCommonList<R, Q extends QueryLimit>(
|
|
|
69
69
|
async function init(pageNum?: number) {
|
|
70
70
|
query.value.pageNum = pageNum || 1
|
|
71
71
|
isLast.value = false
|
|
72
|
-
const data = await fetchData(
|
|
72
|
+
const data = await fetchData(loading)
|
|
73
73
|
list.value = data || []
|
|
74
74
|
firstLoading.value = false
|
|
75
75
|
}
|
|
@@ -12,12 +12,13 @@ const endpointsList: HttpEndpoints = {
|
|
|
12
12
|
translate: (data: any) => ({
|
|
13
13
|
appCode: data.app,
|
|
14
14
|
// caseCode: 'recharge', // 这个参数可以不要
|
|
15
|
-
tenantId: data.tenant
|
|
15
|
+
tenantId: data.tenant,
|
|
16
16
|
}),
|
|
17
|
-
transform: (data: any) =>
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
17
|
+
transform: (data: any) =>
|
|
18
|
+
data.amountList.map((d: any) => ({
|
|
19
|
+
token: d.desc,
|
|
20
|
+
amount: d.amount,
|
|
21
|
+
})),
|
|
21
22
|
},
|
|
22
23
|
/**
|
|
23
24
|
* 查询支付参数包
|
|
@@ -37,22 +38,21 @@ const endpointsList: HttpEndpoints = {
|
|
|
37
38
|
translate: (params: PaymentParams) => ({
|
|
38
39
|
amount: params.amount,
|
|
39
40
|
appCode: params.app,
|
|
40
|
-
// caseCode: data.stage, 这个参数可以不传
|
|
41
41
|
tenantId: params.tenant,
|
|
42
|
-
// transFlowNo: '4343244', 这个参数可以不传
|
|
43
42
|
certificateNo: params.user,
|
|
43
|
+
accountAuthFlag: params.accountAuthFlag || null,
|
|
44
|
+
channelCode: params.channelCode || null,
|
|
44
45
|
}),
|
|
45
46
|
transform: (data: any) => {
|
|
46
47
|
let json = null
|
|
47
48
|
try {
|
|
48
49
|
json = JSON.parse(data.prePayStr)
|
|
49
|
-
} catch (e) {
|
|
50
|
-
}
|
|
50
|
+
} catch (e) {}
|
|
51
51
|
return {
|
|
52
52
|
json, // 拉起微信支付用的JSON串
|
|
53
|
-
paymentId: data.payId // 查询用支付ID
|
|
53
|
+
paymentId: data.payId, // 查询用支付ID
|
|
54
54
|
}
|
|
55
|
-
}
|
|
55
|
+
},
|
|
56
56
|
},
|
|
57
57
|
获取权益微信支付: {
|
|
58
58
|
path: '/payment/outer/payment/valueExchangePay',
|
|
@@ -67,23 +67,22 @@ const endpointsList: HttpEndpoints = {
|
|
|
67
67
|
let json = null
|
|
68
68
|
try {
|
|
69
69
|
json = JSON.parse(data.prePayStr)
|
|
70
|
-
} catch (e) {
|
|
71
|
-
}
|
|
70
|
+
} catch (e) {}
|
|
72
71
|
return {
|
|
73
72
|
json, // 拉起微信支付用的JSON串
|
|
74
|
-
paymentId: data.payId // 查询用支付ID
|
|
73
|
+
paymentId: data.payId, // 查询用支付ID
|
|
75
74
|
}
|
|
76
|
-
}
|
|
75
|
+
},
|
|
77
76
|
},
|
|
78
77
|
获取增值权益类目: {
|
|
79
78
|
path: '/payment/paymentCaseConfig/getBalanceAndRiskQueryPriceConfig',
|
|
80
|
-
transform: (data: any) => data
|
|
79
|
+
transform: (data: any) => data,
|
|
81
80
|
},
|
|
82
81
|
} as const
|
|
83
82
|
|
|
84
83
|
const keys = Object.keys(endpointsList as any)
|
|
85
84
|
|
|
86
|
-
type Keys = typeof keys[number]
|
|
85
|
+
type Keys = (typeof keys)[number]
|
|
87
86
|
|
|
88
87
|
const endpoints: Record<Keys, string> = Object.fromEntries(
|
|
89
88
|
Object.entries(endpointsList).map(([name, def]) => [name, def.path])
|
|
@@ -97,8 +96,4 @@ const transforms = Object.fromEntries(
|
|
|
97
96
|
Object.entries(endpointsList).map(([, def]) => [def.path, def.transform])
|
|
98
97
|
)
|
|
99
98
|
|
|
100
|
-
export {
|
|
101
|
-
endpoints,
|
|
102
|
-
translates,
|
|
103
|
-
transforms,
|
|
104
|
-
}
|
|
99
|
+
export { endpoints, translates, transforms }
|
package/src/payment/api/index.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import Taro, { request as TaroRequest } from '@tarojs/taro'
|
|
1
|
+
import Taro, { request as TaroRequest, showToast } from '@tarojs/taro'
|
|
2
2
|
import { HttpRequestConfig, ResponseRaw, createHttp } from '../../shared'
|
|
3
3
|
import { translates, transforms } from './endpoints'
|
|
4
4
|
import { useAppKitOptions } from '../../Appkit'
|
|
@@ -32,7 +32,7 @@ const vendor = {
|
|
|
32
32
|
data: data.result as T,
|
|
33
33
|
})
|
|
34
34
|
} else if (data.code !== '401') {
|
|
35
|
-
|
|
35
|
+
showToast({
|
|
36
36
|
title: data.msg,
|
|
37
37
|
icon: 'none',
|
|
38
38
|
})
|
|
@@ -18,8 +18,9 @@
|
|
|
18
18
|
import { onMounted, reactive, ref } from 'vue'
|
|
19
19
|
import AmountPicker from './AmountPicker.vue'
|
|
20
20
|
import { useHttp, endpoints } from '../api'
|
|
21
|
-
import { requestPayment } from '../services'
|
|
22
|
-
import Taro from '@tarojs/taro'
|
|
21
|
+
import { requestBrandWCPay, requestPayment } from '../services'
|
|
22
|
+
import Taro, { showToast } from '@tarojs/taro'
|
|
23
|
+
import { getSdkConfig } from '../../shared'
|
|
23
24
|
|
|
24
25
|
// 充值用户界面
|
|
25
26
|
// 配置了必须的属性后
|
|
@@ -67,7 +68,13 @@ const onAmountSelect = (selected: number) => {
|
|
|
67
68
|
state.selected = selected
|
|
68
69
|
}
|
|
69
70
|
|
|
70
|
-
|
|
71
|
+
// const 公众号配置 = ref<any>()
|
|
72
|
+
|
|
73
|
+
onMounted(async () => {
|
|
74
|
+
// if (Taro.getEnv() === 'WEB') {
|
|
75
|
+
// 公众号配置.value = await getSdkConfig('loankitMp')
|
|
76
|
+
// }
|
|
77
|
+
|
|
71
78
|
const $http = useHttp({ Appcode: props.app !== 'cloudkitPro' ? props.app : '', Tenant: props.tenant })
|
|
72
79
|
|
|
73
80
|
$http.get<any[]>(endpoints.获取充值金额列表, {
|
|
@@ -80,28 +87,41 @@ onMounted(() => {
|
|
|
80
87
|
|
|
81
88
|
const onPayClick = () => {
|
|
82
89
|
if (!state.agreed) {
|
|
83
|
-
|
|
90
|
+
showToast({
|
|
84
91
|
title: '请勾选《大道云平台云豆充值协议》',
|
|
85
92
|
icon: 'none',
|
|
86
93
|
})
|
|
87
94
|
return false
|
|
88
95
|
}
|
|
89
96
|
state.buttonLoading = true
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
97
|
+
|
|
98
|
+
if (Taro.getEnv() === 'WEB') {
|
|
99
|
+
requestBrandWCPay({
|
|
100
|
+
amount: amounts.value[state.selected].amount,
|
|
101
|
+
app: 'loankitMp',
|
|
102
|
+
tenant: props.tenant,
|
|
103
|
+
accountAuthFlag: false,
|
|
104
|
+
channelCode: 'centergzh',
|
|
105
|
+
}).then(result => {
|
|
106
|
+
console.log(result), 'result'
|
|
107
|
+
})
|
|
108
|
+
} else {
|
|
109
|
+
wx.login({
|
|
110
|
+
success({ code }: { code: string }) {
|
|
111
|
+
requestPayment({
|
|
112
|
+
amount: amounts.value[state.selected].amount,
|
|
113
|
+
app: props.app,
|
|
114
|
+
tenant: props.tenant,
|
|
115
|
+
user: code
|
|
116
|
+
}).then(result => {
|
|
117
|
+
state.buttonLoading = false
|
|
118
|
+
if (result) {
|
|
119
|
+
emit('complete', true)
|
|
120
|
+
}
|
|
121
|
+
})
|
|
122
|
+
}
|
|
123
|
+
})
|
|
124
|
+
}
|
|
105
125
|
}
|
|
106
126
|
</script>
|
|
107
127
|
|
|
@@ -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 { requestPaymentByBean } from '../services'
|
|
54
|
-
import Taro from '@tarojs/taro'
|
|
54
|
+
import Taro, { showToast } from '@tarojs/taro'
|
|
55
55
|
import { useAmount } from '../../shared/composables/useAmount'
|
|
56
56
|
|
|
57
57
|
// 充值用户界面
|
|
@@ -132,7 +132,7 @@ async function beanPay() {
|
|
|
132
132
|
showDialog.value = false
|
|
133
133
|
emit('complete', { result: response, type: 'bean' })
|
|
134
134
|
} else {
|
|
135
|
-
|
|
135
|
+
showToast({
|
|
136
136
|
title: response.message,
|
|
137
137
|
icon: 'none',
|
|
138
138
|
})
|
|
@@ -150,7 +150,7 @@ const onPayClick = () => {
|
|
|
150
150
|
|
|
151
151
|
// 微信支付
|
|
152
152
|
if (!selectBean.value && !state.agreed) {
|
|
153
|
-
|
|
153
|
+
showToast({
|
|
154
154
|
title: '请勾选《大道云平台云豆充值协议》',
|
|
155
155
|
icon: 'none',
|
|
156
156
|
})
|