Selaa lähdekoodia

Merge remote-tracking branch 'origin/master'

max 7 kuukautta sitten
vanhempi
sitoutus
d9e4c0e985

+ 16 - 2
src/modules/payment/views/business.vue

@@ -76,6 +76,12 @@ const Upsert = useUpsert({
 			component: { name: 'el-input', props: { clearable: true } },
 			required: true
 		},
+		{
+			label: '城市',
+			prop: 'city',
+			component: { name: 'el-input', props: { clearable: true } },
+			required: true
+		},
 		{
 			label: '地址',
 			prop: 'address_line',
@@ -184,7 +190,15 @@ const Upsert = useUpsert({
 			component: { name: 'el-input', props: { clearable: true } },
 			required: true
 		},
-		{ label: 'ID', prop: 'merchant', hook: 'number', component: { name: 'el-input-number' } }
+		() => ({
+			label: 'ID',
+			prop: 'merchant',
+			hook: 'number',
+			component: { name: 'el-input-number' },
+			hidden(options) {
+				return Upsert.value?.mode === 'add';
+			}
+		})
 	]
 });
 
@@ -192,7 +206,7 @@ const Upsert = useUpsert({
 const Table = useTable({
 	columns: [
 		{ type: 'selection' },
-		{ label: '商户ID', prop: 'mchId', minWidth: 140 },
+		{ label: '商户ID', prop: 'merchantId', minWidth: 140 },
 		{ label: '企业名称', prop: 'name', minWidth: 140 },
 		{ label: '类型', prop: 'type', dict: [], minWidth: 120 },
 		{ label: '国家代码', prop: 'country_code', minWidth: 140 },

+ 18 - 4
src/modules/payment/views/individual.vue

@@ -62,6 +62,12 @@ const Upsert = useUpsert({
 			component: { name: 'el-input', props: { clearable: true } },
 			required: true
 		},
+		{
+			label: '城市',
+			prop: 'city',
+			component: { name: 'el-input', props: { clearable: true } },
+			required: true
+		},
 		{
 			label: '地址',
 			prop: 'address_line',
@@ -129,11 +135,19 @@ const Upsert = useUpsert({
 			},
 			required: true
 		},
-		{ label: 'ID', prop: 'merchant', hook: 'number', component: { name: 'el-input-number' } }
+		() => ({
+			label: 'ID',
+			prop: 'merchant',
+			hook: 'number',
+			component: { name: 'el-input-number' },
+			hidden(options) {
+				return Upsert.value?.mode === 'add';
+			}
+		})
 	],
-	async onOpened(data) {
+	async onOpen() {
 		const typesObj = await service.dict.info.data({
-			types: ['certificate_type'],
+			types: ['certificate_type']
 		});
 		Upsert.value?.setOptions(
 			'certificate_type',
@@ -151,7 +165,7 @@ const Upsert = useUpsert({
 const Table = useTable({
 	columns: [
 		{ type: 'selection' },
-		{ label: '商户ID', prop: 'mch_id', minWidth: 140 },
+		{ label: '商户ID', prop: 'merchantId', minWidth: 140 },
 		{ label: '名字', prop: 'first_name', minWidth: 140 },
 		{ label: '姓氏', prop: 'last_name', minWidth: 140 },
 		{

+ 50 - 4
src/modules/payment/views/merchant.vue

@@ -22,15 +22,29 @@
 			<!-- 分页控件 -->
 			<cl-pagination />
 		</cl-row>
-		<cl-upsert ref="Upsert"> </cl-upsert>
+		<cl-upsert ref="Upsert">
+			<template #slot-secret="{ scope }">
+				<div v-if="scope.apiSecret">
+					{{ scope.apiSecret
+					}}<el-icon style="cursor: pointer" @click="copyToClipboard(scope.apiSecret)"
+						><DocumentCopy
+					/></el-icon>
+				</div>
+				<div v-else>
+					<el-button size="small" :icon="RefreshRight" @click="createSecret(scope)"
+						>重新生成</el-button
+					>
+				</div>
+			</template>
+		</cl-upsert>
 	</cl-crud>
 </template>
 
 <script lang="ts" name="pay-merchant" setup>
 import { useCrud, useTable, useUpsert, useForm } from '@cool-vue/crud';
 import { useCool } from '/@/cool';
-import md5 from 'md5';
-import { ref } from 'vue';
+import { DocumentCopy, RefreshRight } from '@element-plus/icons-vue';
+import { ElMessage } from 'element-plus';
 const { service } = useCool();
 
 // cl-upsert
@@ -105,7 +119,22 @@ const Upsert = useUpsert({
 				]
 			}
 		},
-
+		() => {
+			return {
+				prop: 'apiSecret',
+				label: 'secret',
+				required: true,
+				component: {
+					name: 'slot-secret',
+					props: { disabled: Upsert.value?.mode !== 'add' }
+				},
+				span: 24,
+				hidden(options) {
+					console.log(80, options);
+					return Upsert.value?.mode === 'add';
+				}
+			};
+		},
 		{
 			prop: 'remark',
 			label: '备注',
@@ -145,4 +174,21 @@ const Crud = useCrud(
 		app.refresh();
 	}
 );
+
+const copyToClipboard = async (secret: string) => {
+	try {
+		// 使用 Clipboard API 复制内容
+		await navigator.clipboard.writeText(secret);
+		ElMessage.success('复制成功');
+	} catch (error) {
+		console.error('复制失败', error);
+		ElMessage.error('复制失败');
+	}
+};
+
+const createSecret = async (row: any) => {
+	const params = await service.payment.merchant.secret(row);
+	console.log(191, params);
+	row.apiSecret = params.apiSecret;
+};
 </script>

+ 47 - 39
src/modules/payment/views/wallet.vue

@@ -18,12 +18,8 @@
 			<cl-table ref="Table">
 				<template #slot-btn="{ scope }">
 					<el-button text bg type="success" @click="rechange(scope.row)">充值</el-button>
-					<el-button text bg type="success" @click="showWithdraw(scope.row)"
-						>提现</el-button
-					>
-					<el-button text bg type="success" @click="showTransfer(scope.row)"
-						>划转</el-button
-					>
+					<el-button text bg type="success" @click="showWithdraw(scope.row)">提现</el-button>
+					<el-button text bg type="success" @click="showTransfer(scope.row)">划转</el-button>
 				</template>
 			</cl-table>
 		</cl-row>
@@ -38,34 +34,19 @@
 		<cl-upsert ref="Upsert">
 			<template #slot-currency="{ scope }">
 				<el-select v-model="scope.currency" clearable>
-					<el-option
-						v-for="item in currencyList.filter(
-							item =>
-								channelList
-									.find(v => v.code == scope.channel)
-									?.supportedCurrencies.includes(item.id) || item.type == '2'
-						)"
-						:key="item.id"
-						:label="item.label"
-						:value="item.value"
-					/>
+					<el-option v-for="item in currencyList.filter(
+					item =>
+						channelList
+							.find(v => v.code == scope.channel)
+							?.supportedCurrencies.includes(item.id) || item.type == '2'
+				)" :key="item.id" :label="item.label" :value="item.value" />
 				</el-select>
 			</template>
 		</cl-upsert>
-		<withdraw
-			v-if="WithdrawVisible"
-			:channel="channel"
-			:currency="currency"
-			v-model:show="WithdrawVisible"
-			@refresh="refresh"
-		/>
-		<transfer
-			v-if="TransferVisible"
-			:fromWalletId="fromWalletId"
-			:channel="channel"
-			v-model:show="TransferVisible"
-			@refresh="refresh"
-		/>
+		<withdraw v-if="WithdrawVisible" :channel="channel" :currency="currency" v-model:show="WithdrawVisible"
+			@refresh="refresh" />
+		<transfer v-if="TransferVisible" :fromWalletId="fromWalletId" :channel="channel" v-model:show="TransferVisible"
+			@refresh="refresh" />
 		<cl-dialog title="充值信息" v-model="rechangeVisible">
 			<pre class="json-content">{{ rechangeInfo.config }}</pre>
 		</cl-dialog>
@@ -92,6 +73,7 @@ service.payment.currency.list().then(res => {
 	currencyList.value = res.map(v => ({ label: v.name, value: v.code, id: v.id, type: v.type }));
 });
 const channelList = ref([] as any);
+const getCustomerList = ref([] as any);
 // cl-upsert
 const Upsert = useUpsert({
 	items: [
@@ -106,6 +88,18 @@ const Upsert = useUpsert({
 			prop: 'currency',
 			component: { name: 'slot-currency', props: { clearable: true } },
 			required: true
+		},
+		// {
+		// 	label: '商户',
+		// 	prop: 'merchantId',
+		// 	component: { name: 'el-select', props: { clearable: true } },
+		// 	required: true
+		// },
+		{
+			label: '用户',
+			prop: 'customer_id',
+			component: { name: 'el-select', props: { clearable: true } },
+			required: true
 		}
 	],
 	async onOpen() {
@@ -114,6 +108,12 @@ const Upsert = useUpsert({
 			'channel',
 			channelList.value.map(v => ({ label: v.name, value: v.code }))
 		);
+		// console.log(11300000888, channelList.value);
+		getCustomerList.value = await service.payment.customer.list({ merchantId: 24 });
+		console.log(1130000, getCustomerList.value);
+
+
+		// getCustomerList = await service.payment.customer.list({});
 	}
 });
 
@@ -179,14 +179,22 @@ function refresh(params?: any) {
 </script>
 <style lang="scss" scoped>
 .json-content {
-	white-space: pre-wrap; /* 保留空格和换行 */
-	word-wrap: break-word; /* 允许长单词或 URL 地址换行到下一行 */
-	font-family: monospace; /* 使用等宽字体 */
-	background: #f5f5f5; /* 浅灰色背景 */
+	white-space: pre-wrap;
+	/* 保留空格和换行 */
+	word-wrap: break-word;
+	/* 允许长单词或 URL 地址换行到下一行 */
+	font-family: monospace;
+	/* 使用等宽字体 */
+	background: #f5f5f5;
+	/* 浅灰色背景 */
 	color: #333;
-	padding: 15px; /* 内边距 */
-	border-radius: 4px; /* 圆角 */
-	max-height: 500px; /* 最大高度 */
-	overflow: auto; /* 内容过多时显示滚动条 */
+	padding: 15px;
+	/* 内边距 */
+	border-radius: 4px;
+	/* 圆角 */
+	max-height: 500px;
+	/* 最大高度 */
+	overflow: auto;
+	/* 内容过多时显示滚动条 */
 }
 </style>

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 0 - 151
stats.html


Kaikkia tiedostoja ei voida näyttää, sillä liian monta tiedostoa muuttui tässä diffissä