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