Forráskód Böngészése

feat(): 增加新增钱包时获取用户列表接口

zerogo 7 hónapja
szülő
commit
8ca1edfdcb
1 módosított fájl, 47 hozzáadás és 39 törlés
  1. 47 39
      src/modules/payment/views/wallet.vue

+ 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>