Compare commits
10 Commits
27eede0b22
...
fee62b696d
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fee62b696d | ||
|
|
24ea065feb | ||
|
|
0358c01e0a | ||
|
|
b6d5c1c0f2 | ||
|
|
70c5e362c9 | ||
|
|
0083dbb1cf | ||
|
|
64c69cb26d | ||
|
|
ac269eb996 | ||
|
|
66c3451b8d | ||
|
|
bfb938717c |
@ -10,12 +10,11 @@ VUE_APP_BASE_URL ='https://console.atuchat.com'
|
||||
# VUE_APP_BASE_URL = 'https://console.azizichat.com'
|
||||
|
||||
# oss
|
||||
VUE_APP_OSS_BUCKET = 'tkm-likei'
|
||||
VUE_APP_OSS_URL = 'https://tkm-likei.oss-ap-southeast-1.aliyuncs.com'
|
||||
VUE_APP_OSS_BUCKET = 'asset-global-interaction-1420526837'
|
||||
VUE_APP_OSS_URL = 'https://asset.global-interaction.com'
|
||||
|
||||
# h5
|
||||
VUE_APP_H5_BASE_URL = 'https://h5.azizichat.com'
|
||||
|
||||
# start mock
|
||||
VUE_APP_START_MOCK = false
|
||||
|
||||
|
||||
@ -1,4 +1,6 @@
|
||||
ENV = 'development'
|
||||
NODE_ENV = production
|
||||
|
||||
ENV = 'production'
|
||||
|
||||
VUE_APP_BASE_API = '/console'
|
||||
|
||||
@ -8,12 +10,11 @@ VUE_CLI_BABEL_TRANSPILE_MODULES = true
|
||||
VUE_APP_BASE_URL ='https://console.atuchat.com'
|
||||
|
||||
# oss
|
||||
VUE_APP_OSS_BUCKET = 'tkm-likei'
|
||||
VUE_APP_OSS_URL = 'https://tkm-likei.oss-ap-southeast-1.aliyuncs.com'
|
||||
VUE_APP_OSS_BUCKET = 'asset-global-interaction-1420526837'
|
||||
VUE_APP_OSS_URL = 'https://asset.global-interaction.com'
|
||||
|
||||
# h5
|
||||
VUE_APP_H5_BASE_URL = 'https://h5.azizichat.com'
|
||||
|
||||
# start mock
|
||||
VUE_APP_START_MOCK = false
|
||||
|
||||
|
||||
@ -8,8 +8,8 @@ VUE_APP_BASE_API = '/console'
|
||||
VUE_APP_BASE_URL = 'https://console.azizichat.com'
|
||||
|
||||
# oss
|
||||
VUE_APP_OSS_BUCKET = 'tkm-likei'
|
||||
VUE_APP_OSS_URL = 'https://tkm-likei.oss-ap-southeast-1.aliyuncs.com'
|
||||
VUE_APP_OSS_BUCKET = 'asset-global-interaction-1420526837'
|
||||
VUE_APP_OSS_URL = 'https://asset.global-interaction.com'
|
||||
|
||||
# h5
|
||||
VUE_APP_H5_BASE_URL = 'https://h5.azizichat.com'
|
||||
|
||||
@ -9,8 +9,8 @@ VUE_APP_BASE_API = '/console'
|
||||
VUE_APP_BASE_URL = 'https://console.azizichat.com'
|
||||
|
||||
# oss
|
||||
VUE_APP_OSS_BUCKET = 'tkm-likei'
|
||||
VUE_APP_OSS_URL = 'https://tkm-likei.oss-ap-southeast-1.aliyuncs.com'
|
||||
VUE_APP_OSS_BUCKET = 'asset-global-interaction-1420526837'
|
||||
VUE_APP_OSS_URL = 'https://asset.global-interaction.com'
|
||||
|
||||
# h5
|
||||
VUE_APP_H5_BASE_URL = 'https://h5.azizichat.com'
|
||||
|
||||
@ -16,7 +16,7 @@ export default [
|
||||
'updateUser': '23',
|
||||
'id': '1354012611532255233',
|
||||
'link': 'ddd',
|
||||
'cover': 'http://sugartime-dev.oss-accelerate.aliyuncs.com/manager-e22186b3-e630-4451-8816-daeecf6377b2.jpg',
|
||||
'cover': 'https://asset.global-interaction.com/mock/manager-e22186b3-e630-4451-8816-daeecf6377b2.jpg',
|
||||
'showcase': true,
|
||||
'expiredTime': '2021-01-11 02:03:02',
|
||||
'depict': 'dee'
|
||||
|
||||
@ -17,7 +17,7 @@ export default [
|
||||
'userId': '1351021829418778626',
|
||||
'propsId': '1351727566616408065',
|
||||
'propsCandy': 50.00,
|
||||
'propsPhoto': 'http://sugartime-dev.oss-accelerate.aliyuncs.com/manager-80db3c54-4164-4f9b-a1d3-28ae96525c64.jpg',
|
||||
'propsPhoto': 'https://asset.global-interaction.com/mock/manager-80db3c54-4164-4f9b-a1d3-28ae96525c64.jpg',
|
||||
'propsName': 'yy',
|
||||
'typeName': '头像框',
|
||||
'userBaseInfo': {
|
||||
|
||||
@ -8,7 +8,7 @@
|
||||
"dev": "vue-cli-service serve",
|
||||
"build:dev": "vue-cli-service build --mode development",
|
||||
"build:prod": "vue-cli-service build",
|
||||
"build:atu-prod": "vue-cli-service build --mode prod-atyou",
|
||||
"build:atu-prod": "vue-demi-switch 2 && vue-cli-service build --mode prod-atyou",
|
||||
"build:stage": "vue-cli-service build --mode staging",
|
||||
"preview": "node build/index.js --preview",
|
||||
"lint": "eslint --ext .js,.vue src",
|
||||
@ -18,7 +18,6 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@lucky-canvas/vue": "0.0.5",
|
||||
"ali-oss": "^6.12.0",
|
||||
"axios": "0.18.1",
|
||||
"codemirror": "5.45.0",
|
||||
"current-device": "0.10.2",
|
||||
|
||||
@ -1,5 +1,3 @@
|
||||
|
||||
import OSS from 'ali-oss'
|
||||
import request from '@/utils/request'
|
||||
import { uuid } from '@/utils'
|
||||
|
||||
@ -18,6 +16,9 @@ const getAccessImgUrl = (key) => {
|
||||
if (!key) {
|
||||
return ''
|
||||
}
|
||||
if (/^https?:\/\//i.test(key)) {
|
||||
return key
|
||||
}
|
||||
if (key.startsWith('/')) {
|
||||
return `${process.env.VUE_APP_OSS_URL}${key}`
|
||||
}
|
||||
@ -30,32 +31,22 @@ const getAccessImgUrl = (key) => {
|
||||
*/
|
||||
const simpleUploadFlie = (fileObj, dir) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
const filename = fileObj.customFilename || radmonFilename(fileObj.file.name)
|
||||
const key = `${dir || 'other'}/${filename}`
|
||||
const formData = new FormData()
|
||||
formData.append('file', fileObj.file)
|
||||
formData.append('key', key)
|
||||
request({
|
||||
url: '/ali-yun/oss/sts',
|
||||
method: 'get'
|
||||
url: '/ali-yun/oss/upload',
|
||||
method: 'post',
|
||||
data: formData
|
||||
}).then(res => {
|
||||
const stsResult = res.body
|
||||
if (stsResult) {
|
||||
const client = new OSS({
|
||||
endpoint: 'oss-accelerate.aliyuncs.com',
|
||||
accessKeyId: stsResult['AccessKeyId'],
|
||||
accessKeySecret: stsResult['AccessKeySecret'],
|
||||
stsToken: stsResult['SecurityToken'],
|
||||
bucket: process.env.VUE_APP_OSS_BUCKET
|
||||
})
|
||||
try {
|
||||
const filename = fileObj.customFilename || radmonFilename(fileObj.file.name)
|
||||
client.put(`${dir || 'other'}/${filename}`, fileObj.file).then(ossRes => {
|
||||
resolve(ossRes)
|
||||
}).catch(er => {
|
||||
console.error('error:', er)
|
||||
reject(er)
|
||||
})
|
||||
} catch (er) {
|
||||
console.error('error:', er)
|
||||
reject(er)
|
||||
}
|
||||
}
|
||||
const body = res.body || {}
|
||||
resolve({
|
||||
name: body.name || key,
|
||||
url: body.url || getAccessImgUrl(body.name || key),
|
||||
res: body.res || { status: 200 }
|
||||
})
|
||||
}).catch(er => {
|
||||
console.error(er)
|
||||
reject(er)
|
||||
|
||||
@ -204,6 +204,14 @@ export function updatePayOpenCountryExchangeRate(id, rate) {
|
||||
})
|
||||
}
|
||||
|
||||
// 开通支付国家-同步全部国家汇率
|
||||
export function syncPayOpenCountryExchangeRate() {
|
||||
return request({
|
||||
url: '/sys-pay-open-country/sync-exchange-rate',
|
||||
method: 'post'
|
||||
})
|
||||
}
|
||||
|
||||
// 开通支付国家-修改国家货币
|
||||
export function updatePayOpenCountryCurrent(id, currency) {
|
||||
return request({
|
||||
|
||||
@ -2037,6 +2037,7 @@ export default {
|
||||
type: 'Type',
|
||||
quantity: 'Quantity',
|
||||
balance: 'Balance',
|
||||
amount: 'USDT',
|
||||
origin: 'Source',
|
||||
remark: 'Remark',
|
||||
createdAt: 'Created At'
|
||||
@ -2473,6 +2474,7 @@ export default {
|
||||
form: {
|
||||
gold: 'Gold',
|
||||
amount: 'Amount',
|
||||
deductUsdt: 'USDT',
|
||||
rechargeType: 'Recharge Type',
|
||||
remark: 'Remark',
|
||||
contactInfo: 'Contact Info',
|
||||
@ -2482,6 +2484,7 @@ export default {
|
||||
shipGoldQuantity: 'Please enter shipped gold quantity',
|
||||
deductGoldQuantity: 'Please enter deducted gold quantity',
|
||||
amount: 'Please enter amount',
|
||||
deductUsdt: 'Please enter deducted USDT amount',
|
||||
rechargeType: 'Please select recharge type',
|
||||
remark: 'Please enter remark',
|
||||
contactInfo: 'Please enter contact info',
|
||||
@ -2499,6 +2502,7 @@ export default {
|
||||
validation: {
|
||||
required: 'Required field',
|
||||
requiredNotEmpty: 'Required field cannot be empty',
|
||||
requiredAndNonNegative: 'Required field and cannot be less than 0',
|
||||
requiredAndGreaterThanZero: 'Required field and must be greater than 0'
|
||||
},
|
||||
formEdit: {
|
||||
@ -5797,6 +5801,7 @@ export default {
|
||||
},
|
||||
displayPosition: {
|
||||
ROOM: 'Room',
|
||||
ROOM_LIST: 'Room List Page',
|
||||
EXPLORE_PAGE: 'Explore Page',
|
||||
HOME_ALERT: 'Homepage Popup',
|
||||
WALLET: 'Wallet',
|
||||
|
||||
@ -2036,6 +2036,7 @@ export default {
|
||||
type: '类型',
|
||||
quantity: '数量',
|
||||
balance: '余额',
|
||||
amount: 'USDT',
|
||||
origin: '来源',
|
||||
remark: '备注',
|
||||
createdAt: '创建时间'
|
||||
@ -2472,6 +2473,7 @@ export default {
|
||||
form: {
|
||||
gold: '金币',
|
||||
amount: '金额',
|
||||
deductUsdt: 'USDT',
|
||||
rechargeType: '充值类型',
|
||||
remark: '备注',
|
||||
contactInfo: '联系方式',
|
||||
@ -2481,6 +2483,7 @@ export default {
|
||||
shipGoldQuantity: '请输入发货金币数量',
|
||||
deductGoldQuantity: '请输入扣款金币数量',
|
||||
amount: '请输入金额',
|
||||
deductUsdt: '请输入扣除的USDT金额',
|
||||
rechargeType: '请选择充值类型',
|
||||
remark: '请输入备注',
|
||||
contactInfo: '请输入联系方式',
|
||||
@ -2498,6 +2501,7 @@ export default {
|
||||
validation: {
|
||||
required: '必填字段',
|
||||
requiredNotEmpty: '必填字段不可为空',
|
||||
requiredAndNonNegative: '必填字段,且不能小于0',
|
||||
requiredAndGreaterThanZero: '必填字段,且必须大于0'
|
||||
},
|
||||
formEdit: {
|
||||
@ -5794,6 +5798,7 @@ export default {
|
||||
},
|
||||
displayPosition: {
|
||||
ROOM: '房间内',
|
||||
ROOM_LIST: '房间列表页',
|
||||
EXPLORE_PAGE: '发现页',
|
||||
HOME_ALERT: '首页弹出层',
|
||||
WALLET: '钱包',
|
||||
|
||||
@ -20,11 +20,24 @@
|
||||
<el-form-item v-if="row.selectApp.appCode === 'ASWAT'" :label="$t('pages.payApplication.form.region')">
|
||||
<div class="flex-l">{{ regionName }}</div>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="售卖国家">
|
||||
<el-form-item v-if="!isUpdate" label="支持国家" prop="payCountryIds">
|
||||
<el-select v-model="form.payCountryIds" multiple filterable collapse-tags style="width:100%" placeholder="请选择支持国家" @change="handlePayCountryIdsChange">
|
||||
<el-option
|
||||
v-for="item in countryList"
|
||||
:key="getPayCountryId(item)"
|
||||
:label="getCountryName(item)"
|
||||
:value="getPayCountryId(item)"
|
||||
>
|
||||
<span v-if="getCountryIcon(item)" style="float: left;"> <img :src="getCountryIcon(item)" width="30"></span>
|
||||
<span style="float: left;margin-left:10px">{{ getCountryName(item) }}</span>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item v-else :label="$t('pages.payApplication.form.saleCountry')">
|
||||
<div class="flex-l">
|
||||
<img v-if="row.country.icon" :src="row.country.icon" width="40"> {{ row.country.countryName }}
|
||||
<img v-if="rowCountry.icon" :src="rowCountry.icon" width="40"> {{ rowCountry.countryName || '-' }}
|
||||
</div>
|
||||
</el-form-item> -->
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('pages.payApplication.form.status')" prop="shelf">
|
||||
<el-select
|
||||
v-model="form.shelf"
|
||||
@ -114,6 +127,11 @@ export default {
|
||||
type: Object,
|
||||
require: false,
|
||||
default: () => {}
|
||||
},
|
||||
countryList: {
|
||||
type: Array,
|
||||
require: false,
|
||||
default: () => []
|
||||
}
|
||||
},
|
||||
data() {
|
||||
@ -129,8 +147,9 @@ export default {
|
||||
awardContent: '',
|
||||
amountUsd: '',
|
||||
type: '',
|
||||
payCountryIds: [],
|
||||
regionId: '',
|
||||
shelf: ''
|
||||
shelf: true
|
||||
},
|
||||
regionName: '',
|
||||
activeNames: '',
|
||||
@ -138,13 +157,23 @@ export default {
|
||||
associateLoading: false,
|
||||
supportAmounts: [],
|
||||
computedAmount: '',
|
||||
amountUsd: ''
|
||||
amountUsd: '',
|
||||
lastPayCountryIds: [],
|
||||
syncingPayCountryIds: false
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
isUpdate() {
|
||||
return this.row && this.row.id
|
||||
},
|
||||
rowCountry() {
|
||||
const country = (this.row && this.row.country) || {}
|
||||
return {
|
||||
icon: country.icon || country.nationalFlag || '',
|
||||
currency: country.currency || '',
|
||||
countryName: country.countryName || country.aliasName || country.enName || ''
|
||||
}
|
||||
},
|
||||
shelfStatusOptions() {
|
||||
return this.shelfStatus.map(item => ({
|
||||
...item,
|
||||
@ -157,6 +186,7 @@ export default {
|
||||
]
|
||||
return {
|
||||
applicationId: commonRules,
|
||||
payCountryIds: commonRules,
|
||||
content: commonRules,
|
||||
awardContent: commonRules,
|
||||
type: commonRules,
|
||||
@ -181,6 +211,19 @@ export default {
|
||||
return
|
||||
}
|
||||
this.form = deepClone(newVal)
|
||||
if (!this.form.payCountryIds || this.form.payCountryIds.length === 0) {
|
||||
this.$set(this.form, 'payCountryIds', this.form.payCountryId ? [this.form.payCountryId] : [])
|
||||
}
|
||||
this.syncPayCountryIdsBySameName(this.form.payCountryIds || [])
|
||||
if (!this.form.awardContent && this.form.awardContent !== 0) {
|
||||
this.$set(this.form, 'awardContent', '0')
|
||||
}
|
||||
if (this.form.shelf === '' || this.form.shelf === undefined || this.form.shelf === null) {
|
||||
this.$set(this.form, 'shelf', true)
|
||||
}
|
||||
if (!this.form.type) {
|
||||
this.$set(this.form, 'type', 'GOLD')
|
||||
}
|
||||
this.regionName = newVal.regionName
|
||||
this.loadSupportAmountChannels()
|
||||
},
|
||||
@ -196,6 +239,102 @@ export default {
|
||||
handleClose() {
|
||||
this.$emit('close')
|
||||
},
|
||||
getPayCountryId(item) {
|
||||
return item ? (item.id || item.payCountryId || '') : ''
|
||||
},
|
||||
getCountryBase(item) {
|
||||
return (item && (item.country || item.payCountry || item.countryInfo || item.sysCountryCode)) || {}
|
||||
},
|
||||
getCountryName(item) {
|
||||
if (!item) {
|
||||
return ''
|
||||
}
|
||||
const country = this.getCountryBase(item)
|
||||
return country.aliasName || country.countryName || country.enName || item.payCountryName || item.countryName || item.aliasName || item.enName || ''
|
||||
},
|
||||
getCountryIcon(item) {
|
||||
if (!item) {
|
||||
return ''
|
||||
}
|
||||
const country = this.getCountryBase(item)
|
||||
return country.nationalFlag || country.icon || item.nationalFlag || item.countryNationalFlag || item.payCountryNationalFlag || item.icon || ''
|
||||
},
|
||||
handlePayCountryIdsChange(value) {
|
||||
if (this.syncingPayCountryIds) {
|
||||
return
|
||||
}
|
||||
const currentIds = this.normalizeCountryIds(value)
|
||||
const lastIds = this.normalizeCountryIds(this.lastPayCountryIds)
|
||||
const addedIds = currentIds.filter(id => !lastIds.includes(id))
|
||||
const removedIds = lastIds.filter(id => !currentIds.includes(id))
|
||||
let nextIds = currentIds.slice()
|
||||
addedIds.forEach(id => {
|
||||
nextIds = this.mergeCountryIds(nextIds, this.sameNameCountryIds(id))
|
||||
})
|
||||
removedIds.forEach(id => {
|
||||
const removeIds = this.sameNameCountryIds(id)
|
||||
nextIds = nextIds.filter(nextId => !removeIds.includes(String(nextId)))
|
||||
})
|
||||
this.syncPayCountryIdsBySameName(nextIds)
|
||||
},
|
||||
syncPayCountryIdsBySameName(value) {
|
||||
const normalizedIds = this.normalizeCountryIds(value)
|
||||
const expandedIds = normalizedIds.reduce((result, id) => {
|
||||
return this.mergeCountryIds(result, this.sameNameCountryIds(id))
|
||||
}, normalizedIds.slice())
|
||||
const nextValues = this.countryIdValues(expandedIds)
|
||||
this.lastPayCountryIds = this.normalizeCountryIds(nextValues)
|
||||
if (this.sameCountryIdList(this.normalizeCountryIds(this.form.payCountryIds), this.lastPayCountryIds)) {
|
||||
return
|
||||
}
|
||||
this.syncingPayCountryIds = true
|
||||
this.$set(this.form, 'payCountryIds', nextValues)
|
||||
this.$nextTick(() => {
|
||||
this.syncingPayCountryIds = false
|
||||
})
|
||||
},
|
||||
normalizeCountryIds(value) {
|
||||
return (Array.isArray(value) ? value : []).map(item => String(item)).filter(Boolean)
|
||||
},
|
||||
mergeCountryIds(sourceIds, appendIds) {
|
||||
const result = this.normalizeCountryIds(sourceIds)
|
||||
appendIds.forEach(id => {
|
||||
id = String(id)
|
||||
if (id && !result.includes(id)) {
|
||||
result.push(id)
|
||||
}
|
||||
})
|
||||
return result
|
||||
},
|
||||
sameNameCountryIds(payCountryId) {
|
||||
const selected = this.countryList.find(item => String(this.getPayCountryId(item)) === String(payCountryId))
|
||||
if (!selected) {
|
||||
return [String(payCountryId)]
|
||||
}
|
||||
const selectedName = this.countryNameKey(selected)
|
||||
if (!selectedName) {
|
||||
return [String(payCountryId)]
|
||||
}
|
||||
return this.countryList
|
||||
.filter(item => this.countryNameKey(item) === selectedName)
|
||||
.map(item => String(this.getPayCountryId(item)))
|
||||
.filter(Boolean)
|
||||
},
|
||||
countryNameKey(item) {
|
||||
return String(this.getCountryName(item) || '').trim().toLowerCase()
|
||||
},
|
||||
countryIdValues(countryIds) {
|
||||
const normalizedIds = this.normalizeCountryIds(countryIds)
|
||||
return normalizedIds.map(id => {
|
||||
const option = this.countryList.find(item => String(this.getPayCountryId(item)) === id)
|
||||
return option ? this.getPayCountryId(option) : id
|
||||
})
|
||||
},
|
||||
sameCountryIdList(left, right) {
|
||||
left = this.normalizeCountryIds(left)
|
||||
right = this.normalizeCountryIds(right)
|
||||
return left.length === right.length && left.every((id, index) => id === right[index])
|
||||
},
|
||||
changeAmount(val) {
|
||||
if (!val || !validPositiveNumberPointTwo(val)) {
|
||||
this.supportAmounts = []
|
||||
|
||||
@ -28,7 +28,27 @@
|
||||
</el-option>
|
||||
</el-select>
|
||||
<el-select
|
||||
v-if="selectedApp.appCode === 'ASWAT'"
|
||||
v-model="listQuery.payCountryId"
|
||||
v-loading="loadingCountry"
|
||||
:placeholder="$t('pages.payApplication.placeholder.country')"
|
||||
style="width: 200px"
|
||||
class="filter-item"
|
||||
clearable
|
||||
filterable
|
||||
@change="changeCountry"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in countryList"
|
||||
:key="getPayCountryId(item)"
|
||||
:label="getCountryName(item)"
|
||||
:value="getPayCountryId(item)"
|
||||
>
|
||||
<span v-if="getCountryIcon(item)" style="float: left;"> <img :src="getCountryIcon(item)" width="30"></span>
|
||||
<span style="float: left;margin-left:10px">{{ getCountryName(item) }}</span>
|
||||
</el-option>
|
||||
</el-select>
|
||||
<el-select
|
||||
v-if="isRegionProductApp"
|
||||
v-model="listQuery.regionId"
|
||||
v-loading="loading"
|
||||
:placeholder="$t('pages.payApplication.placeholder.region')"
|
||||
@ -71,11 +91,20 @@
|
||||
>
|
||||
{{ $t('pages.payApplication.action.search') }}
|
||||
</el-button>
|
||||
<el-button
|
||||
class="filter-item"
|
||||
type="warning"
|
||||
icon="el-icon-refresh"
|
||||
:loading="syncRateLoading"
|
||||
@click="syncExchangeRate"
|
||||
>
|
||||
同步全球汇率
|
||||
</el-button>
|
||||
<el-button
|
||||
class="filter-item"
|
||||
type="primary"
|
||||
icon="el-icon-edit"
|
||||
:disabled="!listQuery.regionId"
|
||||
:disabled="isRegionProductApp && !listQuery.regionId"
|
||||
@click="createCommodity"
|
||||
>
|
||||
{{ $t('pages.payApplication.action.add') }}
|
||||
@ -91,6 +120,14 @@
|
||||
>
|
||||
<el-table-column label="ID" prop="id" align="center" />
|
||||
<el-table-column :label="$t('pages.payApplication.table.region')" prop="regionName" align="center" />
|
||||
<el-table-column :label="$t('pages.payApplication.table.country')" align="center" width="180">
|
||||
<template slot-scope="scope">
|
||||
<span v-if="getCommodityCountryIcon(scope.row)" style="display:inline-block;margin-right:6px;vertical-align:middle;">
|
||||
<img :src="getCommodityCountryIcon(scope.row)" width="28">
|
||||
</span>
|
||||
<span>{{ getCommodityCountryName(scope.row) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('pages.payApplication.table.goldAmount')" prop="content" align="center" />
|
||||
<el-table-column :label="$t('pages.payApplication.table.rewardAmount')" prop="awardContent" align="center" />
|
||||
<el-table-column :label="$t('pages.payApplication.table.priceUsd')" prop="amountUsd" align="center" />
|
||||
@ -122,6 +159,7 @@
|
||||
<edit-form
|
||||
v-if="appCommodityEditFormVisible"
|
||||
:row="selectedEditFrom"
|
||||
:country-list="commodityCountryList"
|
||||
@close="appCommodityEditFormVisible=false"
|
||||
@success="editFromSuccess"
|
||||
/>
|
||||
@ -130,7 +168,7 @@
|
||||
<script>
|
||||
import { regionConfigTable } from '@/api/sys'
|
||||
import { productTypeConfs } from '@/constant/type'
|
||||
import { pagePayCommodity, switchShelfCommodity } from '@/api/sys-pay'
|
||||
import { pagePayCommodity, pagePayOpenCounty, listPayOpenCountryByRegionId, switchShelfCommodity, syncPayOpenCountryExchangeRate } from '@/api/sys-pay'
|
||||
import Pagination from '@/components/Pagination'
|
||||
import EditForm from './edit-form'
|
||||
|
||||
@ -157,6 +195,7 @@ export default {
|
||||
selectedApp: {},
|
||||
selectedRegion: '',
|
||||
regions: [],
|
||||
syncRateLoading: false,
|
||||
list: [],
|
||||
total: 0,
|
||||
listQuery: {
|
||||
@ -164,21 +203,31 @@ export default {
|
||||
limit: 30,
|
||||
id: '',
|
||||
applicationId: '',
|
||||
payCountryId: '',
|
||||
shelf: true,
|
||||
type: 'GOLD',
|
||||
regionId: ''
|
||||
},
|
||||
listLoading: false,
|
||||
countryList: [],
|
||||
allCountryList: [],
|
||||
allCountryListLoadingPromise: null,
|
||||
loadingCountry: false,
|
||||
loading: false
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
isRegionProductApp() {
|
||||
return this.selectedApp && this.selectedApp.appCode === 'ASWAT'
|
||||
},
|
||||
shelfStatusOptions() {
|
||||
return this.shelfStatus.map(item => ({
|
||||
...item,
|
||||
label: this.$t(item.labelKey)
|
||||
}))
|
||||
},
|
||||
commodityCountryList() {
|
||||
return this.allCountryList.length > 0 ? this.allCountryList : this.countryList
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
@ -195,6 +244,7 @@ export default {
|
||||
},
|
||||
created() {
|
||||
this.listRegion()
|
||||
this.loadAllCountryList()
|
||||
},
|
||||
methods: {
|
||||
getProductTypeName(item) {
|
||||
@ -214,26 +264,104 @@ export default {
|
||||
},
|
||||
changeApplication(val) {
|
||||
this.selectedApp = this.appInfo.appList.filter(item => item.id === val)[0]
|
||||
this.countryList = []
|
||||
this.selectedCountry = {}
|
||||
this.listQuery.payCountryId = ''
|
||||
this.listRegion()
|
||||
},
|
||||
changeCountry(val) {
|
||||
this.selectedCountry = this.countryList.filter(item => item.id === val)[0]
|
||||
this.selectedCountry = this.getCountryByPayCountryId(val) || {}
|
||||
this.renderData()
|
||||
},
|
||||
loadOpenCountry(regionId) {
|
||||
const that = this
|
||||
that.loadingCountry = true
|
||||
const request = regionId ? that.loadRegionCountryList(regionId) : that.loadAllCountryList(true)
|
||||
request.then(res => {
|
||||
const countryList = that.normalizeList(res)
|
||||
if (countryList.length > 0 || !regionId) {
|
||||
that.loadingCountry = false
|
||||
that.applyCountryList(countryList)
|
||||
return
|
||||
}
|
||||
that.loadAllCountryList(true).then(fallbackList => {
|
||||
that.loadingCountry = false
|
||||
that.applyCountryList(that.normalizeList(fallbackList))
|
||||
}).catch(er => {
|
||||
that.loadingCountry = false
|
||||
console.error(er)
|
||||
})
|
||||
}).catch(er => {
|
||||
console.error(er)
|
||||
that.loadAllCountryList(true).then(fallbackList => {
|
||||
that.loadingCountry = false
|
||||
that.applyCountryList(that.normalizeList(fallbackList))
|
||||
}).catch(fallbackErr => {
|
||||
that.loadingCountry = false
|
||||
console.error(fallbackErr)
|
||||
})
|
||||
})
|
||||
},
|
||||
loadRegionCountryList(regionId) {
|
||||
return listPayOpenCountryByRegionId(regionId).then(res => this.normalizeList(res.body))
|
||||
},
|
||||
loadAllOpenCountry(cursor = 1, limit = 200) {
|
||||
return pagePayOpenCounty({ cursor, limit })
|
||||
},
|
||||
loadAllCountryList(force = false) {
|
||||
if (!force && this.allCountryList.length > 0) {
|
||||
return Promise.resolve(this.allCountryList)
|
||||
}
|
||||
if (!force && this.allCountryListLoadingPromise) {
|
||||
return this.allCountryListLoadingPromise
|
||||
}
|
||||
const limit = 200
|
||||
const loadPage = (cursor, countryList) => {
|
||||
return this.loadAllOpenCountry(cursor, limit).then(res => {
|
||||
const body = res.body || {}
|
||||
const nextCountryList = countryList.concat(this.normalizeList(body))
|
||||
const total = Number(body.total || nextCountryList.length)
|
||||
if (nextCountryList.length < total) {
|
||||
return loadPage(cursor + 1, nextCountryList)
|
||||
}
|
||||
this.allCountryList = nextCountryList
|
||||
return this.allCountryList
|
||||
})
|
||||
}
|
||||
this.allCountryListLoadingPromise = loadPage(1, []).finally(() => {
|
||||
this.allCountryListLoadingPromise = null
|
||||
})
|
||||
return this.allCountryListLoadingPromise
|
||||
},
|
||||
applyCountryList(countryList) {
|
||||
this.countryList = countryList
|
||||
if (this.listQuery.payCountryId && !this.getCountryByPayCountryId(this.listQuery.payCountryId)) {
|
||||
this.listQuery.payCountryId = ''
|
||||
this.selectedCountry = {}
|
||||
}
|
||||
},
|
||||
listRegion() {
|
||||
const that = this
|
||||
that.loading = true
|
||||
regionConfigTable({ 'sysOrigin': that.selectedApp.appCode }).then(res => {
|
||||
that.regions = res.body || []
|
||||
that.selectedRegion = that.regions[0]
|
||||
that.listQuery.regionId = that.selectedRegion.id
|
||||
that.selectedRegion = that.isRegionProductApp ? that.regions[0] : null
|
||||
that.listQuery.regionId = that.selectedRegion ? that.selectedRegion.id : ''
|
||||
that.loading = false
|
||||
that.loadOpenCountry(that.listQuery.regionId)
|
||||
}).catch(er => {
|
||||
that.regions = []
|
||||
that.selectedRegion = null
|
||||
that.listQuery.regionId = ''
|
||||
that.loading = false
|
||||
that.loadOpenCountry()
|
||||
})
|
||||
},
|
||||
changeRegion(val) {
|
||||
this.selectedRegion = this.regions.filter(item => item.id === val)[0]
|
||||
this.listQuery.payCountryId = ''
|
||||
this.selectedCountry = {}
|
||||
this.loadOpenCountry(val)
|
||||
},
|
||||
renderData(isClean) {
|
||||
const that = this
|
||||
@ -252,29 +380,57 @@ export default {
|
||||
handleSearch() {
|
||||
this.renderData(true)
|
||||
},
|
||||
syncExchangeRate() {
|
||||
this.syncRateLoading = true
|
||||
syncPayOpenCountryExchangeRate().then(res => {
|
||||
const count = res.body || 0
|
||||
this.$opsMessage.success(`已同步 ${count} 个国家汇率`)
|
||||
this.syncRateLoading = false
|
||||
this.loadOpenCountry(this.listQuery.regionId)
|
||||
}).catch(er => {
|
||||
this.syncRateLoading = false
|
||||
console.error(er)
|
||||
})
|
||||
},
|
||||
handleClose() {
|
||||
// 去除校验
|
||||
this.$refs.form.clearValidate()
|
||||
this.formVisible = false
|
||||
},
|
||||
createCommodity() {
|
||||
this.selectedEditFrom = {
|
||||
'applicationId': this.listQuery.applicationId,
|
||||
'amountUsd': '',
|
||||
'selectApp': this.selectedApp
|
||||
const openCreateForm = () => {
|
||||
this.selectedEditFrom = {
|
||||
'applicationId': this.listQuery.applicationId,
|
||||
'amountUsd': '',
|
||||
'selectApp': this.selectedApp,
|
||||
'payCountryIds': this.listQuery.payCountryId ? [this.listQuery.payCountryId] : []
|
||||
}
|
||||
if (this.isRegionProductApp && this.selectedRegion) {
|
||||
this.selectedEditFrom.regionId = this.selectedRegion.id
|
||||
this.selectedEditFrom.regionName = this.selectedRegion.regionName
|
||||
}
|
||||
this.appCommodityEditFormVisible = true
|
||||
}
|
||||
if (this.selectedApp.appCode === 'ASWAT') {
|
||||
this.selectedEditFrom.regionId = this.selectedRegion.id
|
||||
this.selectedEditFrom.regionName = this.selectedRegion.regionName
|
||||
if (this.allCountryList.length > 0) {
|
||||
openCreateForm()
|
||||
return
|
||||
}
|
||||
this.appCommodityEditFormVisible = true
|
||||
this.loadingCountry = true
|
||||
this.loadAllCountryList().then(() => {
|
||||
openCreateForm()
|
||||
}).catch(er => {
|
||||
console.error(er)
|
||||
}).finally(() => {
|
||||
this.loadingCountry = false
|
||||
})
|
||||
},
|
||||
clickEditCommodity(row) {
|
||||
const that = this
|
||||
that.appCommodityEditFormVisible = true
|
||||
that.selectedEditFrom = Object.assign({}, row)
|
||||
that.selectedEditFrom.selectApp = this.selectedApp
|
||||
if (this.selectedApp.appCode === 'ASWAT') {
|
||||
that.selectedEditFrom.country = that.getEditFromCountry(row)
|
||||
if (this.isRegionProductApp && this.selectedRegion) {
|
||||
this.selectedEditFrom.regionId = this.selectedRegion.id
|
||||
this.selectedEditFrom.regionName = this.selectedRegion.regionName
|
||||
}
|
||||
@ -282,6 +438,60 @@ export default {
|
||||
editFromSuccess() {
|
||||
this.appCommodityEditFormVisible = false
|
||||
this.renderData()
|
||||
},
|
||||
normalizeList(body) {
|
||||
if (Array.isArray(body)) {
|
||||
return body
|
||||
}
|
||||
if (body && Array.isArray(body.records)) {
|
||||
return body.records
|
||||
}
|
||||
return []
|
||||
},
|
||||
getPayCountryId(item) {
|
||||
return item ? (item.id || item.payCountryId || '') : ''
|
||||
},
|
||||
getCountryBase(item) {
|
||||
return (item && (item.country || item.payCountry || item.countryInfo || item.sysCountryCode)) || {}
|
||||
},
|
||||
getCountryName(item) {
|
||||
if (!item) {
|
||||
return ''
|
||||
}
|
||||
const country = this.getCountryBase(item)
|
||||
return country.aliasName || country.countryName || country.enName || item.payCountryName || item.countryName || item.aliasName || item.enName || ''
|
||||
},
|
||||
getCountryIcon(item) {
|
||||
if (!item) {
|
||||
return ''
|
||||
}
|
||||
const country = this.getCountryBase(item)
|
||||
return country.nationalFlag || country.icon || item.nationalFlag || item.countryNationalFlag || item.payCountryNationalFlag || item.icon || ''
|
||||
},
|
||||
getCountryByPayCountryId(payCountryId) {
|
||||
if (!payCountryId) {
|
||||
return null
|
||||
}
|
||||
return this.countryList.concat(this.allCountryList).find(item => String(this.getPayCountryId(item)) === String(payCountryId))
|
||||
},
|
||||
getCommodityCountrySource(row) {
|
||||
const payCountryId = row && row.payCountryId ? row.payCountryId : this.listQuery.payCountryId
|
||||
return this.getCountryByPayCountryId(payCountryId) || row || this.selectedCountry || {}
|
||||
},
|
||||
getCommodityCountryName(row) {
|
||||
return this.getCountryName(row) || this.getCountryName(this.getCommodityCountrySource(row)) || '-'
|
||||
},
|
||||
getCommodityCountryIcon(row) {
|
||||
return this.getCountryIcon(row) || this.getCountryIcon(this.getCommodityCountrySource(row))
|
||||
},
|
||||
getEditFromCountry(row) {
|
||||
const countrySource = this.getCommodityCountrySource(row)
|
||||
return {
|
||||
'icon': this.getCountryIcon(row) || this.getCountryIcon(countrySource),
|
||||
'currency': (row && row.currency) || countrySource.currency || '',
|
||||
'exchangeRate': (row && (row.usdExchangeRate || row.exchangeRate)) || countrySource.usdExchangeRate || '',
|
||||
'countryName': this.getCountryName(row) || this.getCountryName(countrySource)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -441,6 +441,10 @@ export default {
|
||||
value: "ROOM",
|
||||
label: this.$t("pages.bannerManager.displayPosition.ROOM")
|
||||
},
|
||||
{
|
||||
value: "ROOM_LIST",
|
||||
label: this.$t("pages.bannerManager.displayPosition.ROOM_LIST")
|
||||
},
|
||||
{
|
||||
value: "EXPLORE_PAGE",
|
||||
label: this.$t("pages.bannerManager.displayPosition.EXPLORE_PAGE")
|
||||
|
||||
@ -225,7 +225,7 @@
|
||||
</div>
|
||||
<div class="clearfix">
|
||||
<el-button type="text" @click.native="handleUpdate(item)">{{ $t('pages.teamDiamondPolicy.action.edit') }}</el-button>
|
||||
<el-button v-if="!item.historyRelease" type="text" @click.native="handleDelete(item.id)">{{ $t('pages.teamDiamondPolicy.action.delete') }}</el-button>
|
||||
<el-button type="text" @click.native="handleDelete(item.id)">{{ $t('pages.teamDiamondPolicy.action.delete') }}</el-button>
|
||||
</div>
|
||||
</el-card>
|
||||
</el-row>
|
||||
|
||||
@ -409,10 +409,7 @@
|
||||
<el-button type="text" @click.native="handleUpdate(item)"
|
||||
>{{ $t('pages.teamPolicy.action.edit') }}</el-button
|
||||
>
|
||||
<el-button
|
||||
v-if="!item.historyRelease"
|
||||
type="text"
|
||||
@click.native="handleDelete(item.id)"
|
||||
<el-button type="text" @click.native="handleDelete(item.id)"
|
||||
>{{ $t('pages.teamPolicy.action.delete') }}</el-button
|
||||
>
|
||||
</div>
|
||||
|
||||
@ -138,6 +138,12 @@
|
||||
align="center"
|
||||
min-width="100"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="amount"
|
||||
:label="$t('pages.userFreightInfoList.table.amount')"
|
||||
align="center"
|
||||
min-width="100"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="originName"
|
||||
:label="$t('pages.userFreightInfoList.table.origin')"
|
||||
|
||||
@ -291,8 +291,11 @@
|
||||
:placeholder="type ? $t('pages.userFreight.placeholder.shipGoldQuantity') : $t('pages.userFreight.placeholder.deductGoldQuantity')"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="type == true" :label="$t('pages.userFreight.form.amount')" prop="amount">
|
||||
<el-input v-model.trim="formData.amount" :placeholder="$t('pages.userFreight.placeholder.amount')" />
|
||||
<el-form-item :label="type ? $t('pages.userFreight.form.amount') : $t('pages.userFreight.form.deductUsdt')" prop="amount">
|
||||
<el-input
|
||||
v-model.trim="formData.amount"
|
||||
:placeholder="type ? $t('pages.userFreight.placeholder.amount') : $t('pages.userFreight.placeholder.deductUsdt')"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
v-if="type == true"
|
||||
@ -393,6 +396,31 @@ export default {
|
||||
name: "UserPropsTable",
|
||||
components: { Pagination, FormEdit, RunningWater, SellerInfo },
|
||||
data() {
|
||||
const blank = value => value === undefined || value === null || String(value).trim() === "";
|
||||
const validateEarnPoints = (rule, value, callback) => {
|
||||
if (blank(value)) {
|
||||
callback(new Error(this.$t("pages.userFreight.validation.requiredNotEmpty")));
|
||||
return;
|
||||
}
|
||||
const quantity = Number(value);
|
||||
if (!Number.isFinite(quantity) || quantity < 0 || (this.type && quantity <= 0)) {
|
||||
callback(new Error(this.type ? this.$t("pages.userFreight.validation.requiredAndGreaterThanZero") : this.$t("pages.userFreight.validation.requiredAndNonNegative")));
|
||||
return;
|
||||
}
|
||||
callback();
|
||||
};
|
||||
const validateAmount = (rule, value, callback) => {
|
||||
if (blank(value)) {
|
||||
callback(new Error(this.$t("pages.userFreight.validation.requiredNotEmpty")));
|
||||
return;
|
||||
}
|
||||
const amount = Number(value);
|
||||
if (!Number.isFinite(amount) || amount <= 0) {
|
||||
callback(new Error(this.$t("pages.userFreight.validation.requiredAndGreaterThanZero")));
|
||||
return;
|
||||
}
|
||||
callback();
|
||||
};
|
||||
const commonRules = [
|
||||
{ required: true, message: this.$t("pages.userFreight.validation.required"), trigger: "blur" }
|
||||
];
|
||||
@ -439,12 +467,8 @@ export default {
|
||||
updateLoading: false, //更新提交加载中
|
||||
formRules: {
|
||||
userId: commonRules,
|
||||
earnPoints: {
|
||||
required: true,
|
||||
message: this.$t("pages.userFreight.validation.requiredNotEmpty"),
|
||||
trigger: "blur"
|
||||
},
|
||||
amount: commonRules,
|
||||
earnPoints: [{ validator: validateEarnPoints, trigger: "blur" }],
|
||||
amount: [{ validator: validateAmount, trigger: "blur" }],
|
||||
rechargeType: commonRules,
|
||||
sysOrigin: commonRules,
|
||||
supportedCountries: commonRules,
|
||||
@ -552,6 +576,8 @@ export default {
|
||||
userId: row.userId,
|
||||
earnPoints: "",
|
||||
sysOrigin: row.sysOrigin,
|
||||
amount: "",
|
||||
rechargeType: "",
|
||||
remark: ""
|
||||
};
|
||||
that.goldInputBoxVisible = true;
|
||||
@ -598,7 +624,7 @@ export default {
|
||||
})
|
||||
.catch(er => {
|
||||
that.listLoading = false;
|
||||
that.$opsMessage.success();
|
||||
that.$opsMessage.fail();
|
||||
console.error(er);
|
||||
});
|
||||
return;
|
||||
@ -613,7 +639,7 @@ export default {
|
||||
})
|
||||
.catch(er => {
|
||||
that.listLoading = false;
|
||||
that.$opsMessage.success();
|
||||
that.$opsMessage.fail();
|
||||
console.error(er);
|
||||
});
|
||||
});
|
||||
|
||||
@ -46,6 +46,7 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="balance" :label="$t('pages.userFreight.table.balance')" align="center" />
|
||||
<el-table-column prop="amount" :label="$t('pages.userFreight.form.deductUsdt')" align="center" />
|
||||
<el-table-column prop="originName" :label="$t('pages.userFreight.runningWater.source')" align="center" />
|
||||
<el-table-column prop="remark" :label="$t('pages.userFreight.form.remark')" align="center" min-width="200" />
|
||||
<el-table-column prop="createTime" :label="$t('pages.userFreight.table.createdAt')" align="center" width="200">
|
||||
|
||||
4
项目说明.md
4
项目说明.md
@ -28,7 +28,7 @@
|
||||
| **国际化** | 自研 i18n 插件(基于时区自动检测语言) |
|
||||
| **样式** | SCSS + normalize.css,支持暗色主题切换 |
|
||||
| **富媒体** | Video.js 8、SVGA Player、libpag(PAG 动效) |
|
||||
| **文件存储** | 阿里云 OSS(ali-oss SDK) |
|
||||
| **文件存储** | 腾讯云 COS(通过后端接口上传) |
|
||||
| **WebSocket** | SockJS + StompJS(实时消息) |
|
||||
| **Mock** | Mock.js(开发环境可选启用) |
|
||||
| **代码规范** | ESLint(babel-eslint)+ EditorConfig |
|
||||
@ -222,7 +222,7 @@ meta: {
|
||||
|
||||
## 十、OSS 文件上传
|
||||
|
||||
阿里云 OSS,Bucket 分类:
|
||||
腾讯云 COS,目录分类:
|
||||
|
||||
| Bucket Key | 用途 |
|
||||
|------------|------|
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user