Browse Source

金币产品与软件产品不能互切

milestone-20260304-钱包体系
ZhangYong 4 weeks ago
parent
commit
7194ddd3df
  1. 16
      src/components/MoneyManage/ProductSelect.vue
  2. 240
      src/views/moneyManage/receiveDetail/receiveService.vue

16
src/components/MoneyManage/ProductSelect.vue

@ -12,7 +12,7 @@
</div>
<div class="menu" v-show="isOpen">
<div class="coinselect" @click="coinhandelMenu" :class="{ 'active': coinisOpen }">
<div class="coinselect" @click="coinhandelMenu" :class="{ 'active': coinisOpen, 'disabled-menu': restrictType === 'software' }">
<div class="cointxt">
{{ t('cash.goldProduct') }}
</div>
@ -26,7 +26,7 @@
<el-radio v-model="selectedValue" :label="t('cash.coinRecharge')" size="large" />
</div>
<div class="product">
<div class="coinselect" @click="producthandelMenu" :class="{ 'active': productisOpen }">
<div class="coinselect" @click="producthandelMenu" :class="{ 'active': productisOpen, 'disabled-menu': restrictType === 'gold' }">
<div class="cointxt">
{{ t('cash.softwareProduct') }}
</div>
@ -154,9 +154,11 @@ const handelMenu = () => {
ifselectAndOpen()
}
const coinhandelMenu = () => {
if (props.restrictType === 'software') return;
coinisOpen.value = !coinisOpen.value
}
const producthandelMenu = () => {
if (props.restrictType === 'gold') return;
productisOpen.value = !productisOpen.value
}
@ -165,6 +167,10 @@ const props = defineProps({
modelValue: {
type: String,
default: ''
},
restrictType: {
type: String,
default: 'all' // 'all', 'gold', 'software'
}
})
@ -513,6 +519,12 @@ defineExpose({ resetSelect });
display: flex;
border-radius: 5px;
&.disabled-menu {
cursor: not-allowed;
opacity: 0.5;
background-color: #f5f7fa;
}
.cointxt {
width: 100px;
height: 100%;

240
src/views/moneyManage/receiveDetail/receiveService.vue

@ -80,9 +80,9 @@
</div>
<div class="table">
<el-table ref="tableRef" :data="tableData" style="width: 80vw;height:64vh;" @sort-change="handleSortChange"
:row-style="{ height: '60px' }" :header-cell-style="{ textAlign: 'center' }"
:cell-style="{ textAlign: 'center' }">
<el-table ref="tableRef" :data="tableData" style="width: 80vw;height:64vh;"
@sort-change="handleSortChange" :row-style="{ height: '60px' }"
:header-cell-style="{ textAlign: 'center' }" :cell-style="{ textAlign: 'center' }">
<el-table-column type="index" :label="t('common_list.id')" width="100px" fixed="left">
<template #default="scope">
<span>{{ scope.$index + 1 + (pageInfo.pageNum - 1) * pageInfo.pageSize }}</span>
@ -129,7 +129,7 @@
<template #default="scope">
<span v-if="scope.row.status == 0">{{ t('common.pendingAudit') }}</span>
<span v-else-if="scope.row.status == 1 || scope.row.status == 4">{{ t('common.passed')
}}</span>
}}</span>
<span v-else-if="scope.row.status == 2">{{ t('common.rejected') }}</span>
<span v-else-if="scope.row.status == 5">{{ t('common.withdrawn') }}</span>
<span v-else-if="scope.row.status == 6">{{ t('common.refunded') }}</span>
@ -213,13 +213,14 @@
</el-form-item>
<el-form-item :label="t('common_add.activity')" required prop="activity">
<el-select v-model="addFormData.activity" :placeholder="t('common_add.activityPlaceholder')"
filterable clearable>
filterable clearable>
<el-option v-for="item in activityList" :key="item.id" :label="item.activityName"
:value="item.id" />
</el-select>
</el-form-item>
<el-form-item :label="t('common_add.productName')" required prop="goodsName" >
<ProductSelect ref="productSelectRef" v-model="addFormData.goodsName" @change="handleProductChange(addFormData.goodsName)"></ProductSelect>
<el-form-item :label="t('common_add.productName')" required prop="goodsName">
<ProductSelect ref="productSelectRef" v-model="addFormData.goodsName" :restrictType="productRestrictType"
@change="handleProductChange(addFormData.goodsName)"></ProductSelect>
</el-form-item>
<el-form-item v-show="!isGold" :label="t('common_add.productNum')" required>
<div style="display: flex;">
@ -229,7 +230,7 @@
:placeholder="t('common_add.numUnit')" @change="handleCurrencyChange" />
</div>
</el-form-item>
<div v-show="isGold" style="display: flex; margin-bottom: 15px;">
<div v-show="isGold" style="display: flex; margin-bottom: 15px;">
<div style=" display: flex; ">
<span style="color: #999999; display: flex; white-space: nowrap;align-items: center;">{{
t('common_add.permanentGold') }}</span>
@ -244,7 +245,7 @@
style="padding-right: 10px; padding-left: 10px; height: 30px; width: 110px;"
v-model="addFormData.freeGold" />
</div>
</div>
</div>
<el-form-item :label="t('common_add.payCurrency')" required prop="paymentCurrency">
<CurrencySelect v-model="addFormData.paymentCurrency" :items="customOptions"
:placeholder="t('common_add.payCurrencyPlaceholder')" @change="handleCurrencyChange" />
@ -258,17 +259,15 @@
</CurrencySelect>
</el-form-item>
<el-form-item :label="t('common_add.receiveArea')" prop="receivedMarket">
<CurrencySelect v-model="addFormData.receivedMarket" :items="MoneyAddressOptions"
:placeholder="t('common_add.receiveAreaPlaceholder')"
:disabled="isGroup"
@change="showWallet(addFormData.receivedMarket)">
</CurrencySelect>
<CurrencySelect v-model="addFormData.receivedMarket" :items="MoneyAddressOptions"
:placeholder="t('common_add.receiveAreaPlaceholder')" :disabled="isGroup"
@change="showWallet(addFormData.receivedMarket)">
</CurrencySelect>
</el-form-item>
<el-form-item :label="t('common_add.receiveWallet')" required prop="receivedWallet" v-show="isGold">
<CurrencySelect v-model="addFormData.receivedWallet" :items="MoneyWalletOptions"
:placeholder="t('common_add.receiveWalletPlaceholder')"
:disabled=" !selectWallet || isGroup "
</CurrencySelect>
:placeholder="t('common_add.receiveWalletPlaceholder')" :disabled="!selectWallet || isGroup"
</CurrencySelect>
</el-form-item>
<el-form-item :label="t('common_add.payTime')" required prop="payTime">
@ -295,7 +294,7 @@
<template #footer>
<span class="dialog-footer">
<el-button style="background-color: #7E91FF;" @click="closeAddForm">{{ t('common.cancel')
}}</el-button>
}}</el-button>
<el-button v-if="addOrEdit == 1" style="background-color: #2741DE; margin-left: 2.5vw;"
type="primary" @click="throttledhandleAddForm" :disabled="ifAddDone">{{ t('common.confirm')
}}</el-button>
@ -350,7 +349,7 @@
<div style="padding-right: 5px; display: flex;">
<span
style="color: #999999; display: flex; white-space: nowrap;align-items: center;width:4vw;">{{
t('common_add.freeGold') }}</span>
t('common_add.freeGold') }}</span>
<el-input style="padding-right: 10px; height: 30px; width: 110px;"
v-model="refundFormData.freeGold" disabled />
</div>
@ -426,8 +425,8 @@
</el-dialog>
<!-- 查看驳回理由 -->
<el-dialog class="reject-dialog" :title="t('common_add.rejectReason')" v-model="rejectReasonVisible" width="50%" top="30vh"
style="min-width: 200px; max-width: 500px;" :before-close="closeRejectForm">
<el-dialog class="reject-dialog" :title="t('common_add.rejectReason')" v-model="rejectReasonVisible" width="50%"
top="30vh" style="min-width: 200px; max-width: 500px;" :before-close="closeRejectForm">
<div class="reject-reason-box">
{{ rejectReason }}
</div>
@ -454,7 +453,7 @@ import _ from 'lodash'
import { isNumber } from 'lodash'
//
import { addFormRule as getAddFormRule } from './utils/recriveFormRules.js'
import { productList, MarketNameForId, CurrencyForId, marketList,statusList, normalizeSubmitterMarket, normalizeGoodsName, normalizePayType ,WalletForId } from './utils/staticData.js'
import { productList, MarketNameForId, CurrencyForId, marketList, statusList, normalizeSubmitterMarket, normalizeGoodsName, normalizePayType, WalletForId } from './utils/staticData.js'
import { selectAllWallets } from '@/api/common/common.js'
//
import { useI18n } from 'vue-i18n'
@ -468,7 +467,7 @@ const adminData = ref({}) // 管理员信息
const tableData = ref([]) //
const tableRef = ref(null)
const scrollTableTop = () => {
tableRef.value?.setScrollTop?.(0)
tableRef.value?.setScrollTop?.(0)
}
const total = ref(0) //
const pageInfo = ref({ pageSize: 10, pageNum: 1 }) //
@ -616,7 +615,7 @@ const handlePagination = (type, val) => {
// ===================== / =====================
const addFormisible = ref(false) //
const addFormData = ref({ name: '', market: '', goodsName: '' , receivedWallet:'' }) //
const addFormData = ref({ name: '', market: '', goodsName: '', receivedWallet: '' }) //
const addFormRef = ref(null) //
const addOrEdit = ref(0) // 1=2=
const isGold = ref(false) //
@ -630,7 +629,7 @@ const ifGold = () => {
addFormData.value.goodNum = 0
} else {
isGold.value = false
console.log('12312312',addFormData.value.goodsName);
console.log('12312312', addFormData.value.goodsName);
numUnitList.value = [t('cash.unit'), t('cash.year'), t('cash.month')]
const selectItems = ref([
t('cash.aiService.aiTracking'),
@ -686,68 +685,68 @@ watch(() => addFormData.value.goodsName, () => {
//
const isGroup = ref(false)
const selectWallet=ref(false)
const selectWallet = ref(false)
const ifGroup = () => {
addFormData.value.receivedMarket=''
addFormData.value.receivedWallet=''
addFormData.value.receivedMarket = ''
addFormData.value.receivedWallet = ''
if (addFormData.value.payType === t('cash.payMethods.stripe') || addFormData.value.payType === t('cash.payMethods.paymentAsia')) {
isGroup.value = true
addFormData.value.receivedMarket = t('cash.markets.HongKong')
addFormData.value.receivedWallet=t('cash.wallet.HongKongWallet')
addFormData.value.receivedWallet = t('cash.wallet.HongKongWallet')
} else if (addFormData.value.payType === t('cash.payMethods.ipay88')) {
isGroup.value = true
addFormData.value.receivedMarket = t('cash.markets.Malaysia')
addFormData.value.receivedWallet=t('cash.wallet.MalaysiaWallet')
addFormData.value.receivedWallet = t('cash.wallet.MalaysiaWallet')
} else if (addFormData.value.payType === t('cash.payMethods.transfer')) {
isGroup.value = true
addFormData.value.receivedMarket = t('cash.markets.Canada')
addFormData.value.receivedWallet=t('cash.wallet.CanadaWallet')
addFormData.value.receivedWallet = t('cash.wallet.CanadaWallet')
} else if (addFormData.value.payType === t('cash.payMethods.grabpay') || addFormData.value.payType === t('cash.payMethods.nets') || addFormData.value.payType === t('cash.payMethods.paypal')) {
isGroup.value = true
addFormData.value.receivedMarket = t('cash.markets.Singapore')
addFormData.value.receivedWallet=t('cash.wallet.SingaporeCMWallet')
}else if (addFormData.value.payType === t('cash.payMethods.paysolution')) {
addFormData.value.receivedWallet = t('cash.wallet.SingaporeCMWallet')
} else if (addFormData.value.payType === t('cash.payMethods.paysolution')) {
isGroup.value = true
addFormData.value.receivedMarket = t('cash.markets.Thailand')
addFormData.value.receivedWallet=t('cash.wallet.ThailandHAWallet')
addFormData.value.receivedWallet = t('cash.wallet.ThailandHAWallet')
} else if (addFormData.value.payType === t('cash.payMethods.stripe2')) {
isGroup.value = true
addFormData.value.receivedMarket = t('cash.markets.Singapore')
addFormData.value.receivedWallet=t('cash.wallet.SingaporeHCWallet')
addFormData.value.receivedWallet = t('cash.wallet.SingaporeHCWallet')
} else {
isGroup.value = false
selectWallet.value = true
}
}
//
const MoneyWalletOptions=ref([])
const showWallet =(receivedMarket)=>{
const MoneyWalletOptions = ref([])
const showWallet = (receivedMarket) => {
console.log('selectedMarket', receivedMarket);
MoneyWalletOptions.value=[]
addFormData.value.receivedWallet=''
if(receivedMarket===t('cash.markets.HongKong')){
selectWallet.value=false
addFormData.value.receivedWallet=t('cash.wallet.HongKongWallet')
}else if(receivedMarket===t('cash.markets.Malaysia')){
selectWallet.value=false
addFormData.value.receivedWallet=t('cash.wallet.MalaysiaWallet')
}else if(receivedMarket===t('cash.markets.Singapore')){
selectWallet.value=true
MoneyWalletOptions.value = []
addFormData.value.receivedWallet = ''
if (receivedMarket === t('cash.markets.HongKong')) {
selectWallet.value = false
addFormData.value.receivedWallet = t('cash.wallet.HongKongWallet')
} else if (receivedMarket === t('cash.markets.Malaysia')) {
selectWallet.value = false
addFormData.value.receivedWallet = t('cash.wallet.MalaysiaWallet')
} else if (receivedMarket === t('cash.markets.Singapore')) {
selectWallet.value = true
MoneyWalletOptions.value.push(t('cash.wallet.SingaporeCMWallet'))
MoneyWalletOptions.value.push(t('cash.wallet.SingaporeHCWallet'))
}else if(receivedMarket===t('cash.markets.Thailand')){
selectWallet.value=true
} else if (receivedMarket === t('cash.markets.Thailand')) {
selectWallet.value = true
MoneyWalletOptions.value.push(t('cash.wallet.ThailandHSWallet'))
MoneyWalletOptions.value.push(t('cash.wallet.ThailandHAWallet'))
}else if(receivedMarket===t('cash.markets.VietnamHCM')){
selectWallet.value=false
addFormData.value.receivedWallet=t('cash.wallet.VietnamHCMWallet')
}else if(receivedMarket===t('cash.markets.Canada') ){
selectWallet.value=false
addFormData.value.receivedWallet=t('cash.wallet.CanadaWallet')
}else if(receivedMarket===t('cash.markets.Beijing')){
selectWallet.value=false
addFormData.value.receivedWallet=t('cash.wallet.BeijingWallet')
} else if (receivedMarket === t('cash.markets.VietnamHCM')) {
selectWallet.value = false
addFormData.value.receivedWallet = t('cash.wallet.VietnamHCMWallet')
} else if (receivedMarket === t('cash.markets.Canada')) {
selectWallet.value = false
addFormData.value.receivedWallet = t('cash.wallet.CanadaWallet')
} else if (receivedMarket === t('cash.markets.Beijing')) {
selectWallet.value = false
addFormData.value.receivedWallet = t('cash.wallet.BeijingWallet')
}
}
@ -810,6 +809,7 @@ const jwcodeSeachMarket = async () => {
}
}
const LastGoodsName = ref('')
// /
const openAddForm = (row) => {
productSelectRef.value?.resetSelect();
@ -820,6 +820,9 @@ const openAddForm = (row) => {
...row,
receivedWallet: walletList.value.find(item => item.id == row.walletId)?.walletName || ''
}
if (row?.goodsName) {
LastGoodsName.value = row?.goodsName
}
console.log('这是编辑数据:', addFormData.value);
showWallet(addFormData.value.receivedMarket)
jwcodeSeachMarket()
@ -886,13 +889,13 @@ const handleAddForm = async () => {
}
}
if ( !isGold.value && addFormData.value.numUnit == '') {
if (!isGold.value && addFormData.value.numUnit == '') {
ElMessage.error(t('elmessage.checkNumUnit'));
return;
}
if (addFormData.value.goodsName == t('cash.coinRecharge')) {
if (addFormData.value.permanentGold == null || addFormData.value.permanentGold == 0) {
ElMessage.error(t('elmessage.checkPermanentGold'));
ElMessage.error(t('elmessage.checkPermanentGold'));
return;
}
}
@ -904,7 +907,7 @@ const handleAddForm = async () => {
ElMessage.error(t('elmessage.checkReceivedWallet'));
return;
}
ifAddDone.value = true
const result = await request({
url: '/cashCollection/add',
@ -920,8 +923,8 @@ const handleAddForm = async () => {
receivedMarket: MarketNameForId(addFormData.value.receivedMarket) || '',
paymentAmount: (addFormData.value.paymentAmount) * 100,
submitterMarket: normalizeSubmitterMarket(adminData.value.markets),
...(isGold. value ? {
walletId:WalletForId(addFormData.value.receivedWallet)
...(isGold.value ? {
walletId: WalletForId(addFormData.value.receivedWallet)
} : {})
}
})
@ -929,7 +932,7 @@ const handleAddForm = async () => {
ElMessage.success(t('elmessage.addSuccess'))
getlist()
closeAddForm()
}else if(result.code == 0){
} else if (result.code == 0) {
ElMessage.error(result.msg);
return;
}
@ -966,7 +969,7 @@ const handleEditForm = async () => {
return;
}
}
if (!isGold.value && addFormData.value.numUnit == '') {
ElMessage.error(t('elmessage.checkNumUnit'));
return;
@ -991,14 +994,14 @@ const handleEditForm = async () => {
paymentCurrency: CurrencyForId(addFormData.value.paymentCurrency) || '',
receivedMarket: MarketNameForId(addFormData.value.receivedMarket) || '',
paymentAmount: (addFormData.value.paymentAmount) * 100,
walletId:WalletForId(addFormData.value.receivedWallet)
walletId: WalletForId(addFormData.value.receivedWallet)
}
})
if (result.code == 200) {
ElMessage.success(t('elmessage.editSuccess'))
getlist()
closeAddForm()
}else if(result.code == 0){
} else if (result.code == 0) {
ElMessage.error(result.msg);
return;
}
@ -1011,51 +1014,64 @@ const handleEditForm = async () => {
//
const customOptions = ref([
t('cash.currency.usd'), // (USD)
t('cash.currency.hkd'), // (HKD)
t('cash.currency.sgd'), // (SGD)
t('cash.currency.myr'), // (MYR)
t('cash.currency.thb'), // (THB)
t('cash.currency.cad'), // (CAD)
t('cash.currency.vnd'), // (VND)
t('cash.currency.krw'), // (KRW)
t('cash.currency.rmb'), // (CNY)
t('cash.currency.usd'), // (USD)
t('cash.currency.hkd'), // (HKD)
t('cash.currency.sgd'), // (SGD)
t('cash.currency.myr'), // (MYR)
t('cash.currency.thb'), // (THB)
t('cash.currency.cad'), // (CAD)
t('cash.currency.vnd'), // (VND)
t('cash.currency.krw'), // (KRW)
t('cash.currency.rmb'), // (CNY)
])
// - 使cash.payMethods
const paytypeOptions = ref([
t('cash.payMethods.stripe'), // Stripe
t('cash.payMethods.paymentAsia'), // PaymentAsia
t('cash.payMethods.stripe2'), // Stripe2
t('cash.payMethods.ipay88'), // Ipay88
t('cash.payMethods.grabpay'), // Grabpay
t('cash.payMethods.nets'), // Nets
t('cash.payMethods.transfer'), // E-Transfer
t('cash.payMethods.paypal'), // PayPal
t('cash.payMethods.paysolution'), // Paysolution
t('cash.payMethods.bankTransfer'),//
t('cash.payMethods.card'), //
t('cash.payMethods.cash'), //
t('cash.payMethods.check'), //
t('cash.payMethods.stripe'), // Stripe
t('cash.payMethods.paymentAsia'), // PaymentAsia
t('cash.payMethods.stripe2'), // Stripe2
t('cash.payMethods.ipay88'), // Ipay88
t('cash.payMethods.grabpay'), // Grabpay
t('cash.payMethods.nets'), // Nets
t('cash.payMethods.transfer'), // E-Transfer
t('cash.payMethods.paypal'), // PayPal
t('cash.payMethods.paysolution'), // Paysolution
t('cash.payMethods.bankTransfer'),//
t('cash.payMethods.card'), //
t('cash.payMethods.cash'), //
t('cash.payMethods.check'), //
])
const MoneyAddressOptions = ref([
t('cash.markets.Malaysia'), // 西
t('cash.markets.HongKong'), //
t('cash.markets.Singapore'), //
t('cash.markets.Thailand'), //
t('cash.markets.VietnamHCM'), // HCM
t('cash.markets.Canada'), //
t('cash.markets.Beijing') //
t('cash.markets.Malaysia'), // 西
t('cash.markets.HongKong'), //
t('cash.markets.Singapore'), //
t('cash.markets.Thailand'), //
t('cash.markets.VietnamHCM'), // HCM
t('cash.markets.Canada'), //
t('cash.markets.Beijing') //
])
const handleCurrencyChange = (option) => {
console.log('选中的币种:', option);
};
//
const productRestrictType = computed(() => {
if (addOrEdit.value == 2) {
if (LastGoodsName.value == t('cash.coinRecharge')) {
return 'gold'
} else if (LastGoodsName.value) {
return 'software'
}
}
return 'all'
})
const handleProductChange = (productName) => {
console.log('LastGoodsName:', LastGoodsName.value);
LastGoodsName.value = productName
console.log('选中的产品名称:', productName);
if (productName && productName == t('cash.coinRecharge')) {
showWallet(addFormData.value.receivedMarket)
showWallet(addFormData.value.receivedMarket)
}
};
@ -1307,19 +1323,19 @@ const getAdminData = async () => {
//
// - 使cash.payMethods
const paytypeList = ref([
t('cash.payMethods.stripe'), // Stripe
t('cash.payMethods.paymentAsia'), // PaymentAsia
t('cash.payMethods.stripe2'), // Stripe2
t('cash.payMethods.ipay88'), // Ipay88
t('cash.payMethods.grabpay'), // Grabpay
t('cash.payMethods.nets'), // Nets
t('cash.payMethods.transfer'), // E-Transfer
t('cash.payMethods.paypal'), // PayPal
t('cash.payMethods.paysolution'), // Paysolution
t('cash.payMethods.bankTransfer'),//
t('cash.payMethods.card'), //
t('cash.payMethods.cash'), //
t('cash.payMethods.check'), //
t('cash.payMethods.stripe'), // Stripe
t('cash.payMethods.paymentAsia'), // PaymentAsia
t('cash.payMethods.stripe2'), // Stripe2
t('cash.payMethods.ipay88'), // Ipay88
t('cash.payMethods.grabpay'), // Grabpay
t('cash.payMethods.nets'), // Nets
t('cash.payMethods.transfer'), // E-Transfer
t('cash.payMethods.paypal'), // PayPal
t('cash.payMethods.paysolution'), // Paysolution
t('cash.payMethods.bankTransfer'),//
t('cash.payMethods.card'), //
t('cash.payMethods.cash'), //
t('cash.payMethods.check'), //
])
const getMarket = async function () {
try {
@ -1357,7 +1373,7 @@ const getWalletList = async () => {
const result = await selectAllWallets()
if (result.code == 200) {
walletList.value = result.data
}
}
} catch (error) {
console.log('钱包列表请求失败', error)
}
@ -1593,6 +1609,7 @@ onMounted(async () => {
:deep(.refundDialog) {
background: #F3FAFE !important;
.left {
width: 50%;
height: 70vh;
@ -1655,6 +1672,7 @@ onMounted(async () => {
:deep(.reject-dialog) {
background-color: #F3FAFE !important;
}
.reject-reason-box {
width: 80%;
padding: 20px;

Loading…
Cancel
Save