货运代理工资
This commit is contained in:
parent
13f8d1446f
commit
39f9e02a96
@ -572,11 +572,29 @@ var default_api = 'https://api.global-interaction.com/';
|
||||
);
|
||||
}
|
||||
|
||||
function aslanUserQuery(displayUserID) {
|
||||
function normalizeCommodityType(value) {
|
||||
var type = String(value || '')
|
||||
.trim()
|
||||
.toUpperCase();
|
||||
return type === 'FREIGHT_GOLD' || type === 'FREIGHT_GOLD_SUPER'
|
||||
? type
|
||||
: 'GOLD';
|
||||
}
|
||||
|
||||
function configuredCommodityType(extra) {
|
||||
return normalizeCommodityType(
|
||||
(extra &&
|
||||
(extra.commodity_type || extra.commodityType || extra.type)) ||
|
||||
(activeAppConfig && activeAppConfig.type) ||
|
||||
'GOLD'
|
||||
);
|
||||
}
|
||||
|
||||
function aslanUserQuery(displayUserID, extra) {
|
||||
var value = String(displayUserID || '').trim();
|
||||
var query = {
|
||||
applicationId: activeAppConfig.application_id,
|
||||
type: activeAppConfig.type || 'GOLD',
|
||||
type: configuredCommodityType(extra),
|
||||
sysOrigin: activeAppConfig.sys_origin || 'ATYOU',
|
||||
};
|
||||
if (value) {
|
||||
@ -588,8 +606,8 @@ var default_api = 'https://api.global-interaction.com/';
|
||||
return query;
|
||||
}
|
||||
|
||||
function configuredWebPayUserQuery(displayUserID) {
|
||||
var query = Object.assign(aslanUserQuery(displayUserID), {
|
||||
function configuredWebPayUserQuery(displayUserID, extra) {
|
||||
var query = Object.assign(aslanUserQuery(displayUserID, extra), {
|
||||
sysOrigin: activeAppConfig.sys_origin || 'LIKEI',
|
||||
});
|
||||
if (isYumiWebPay() && !query.userId && !query.account) {
|
||||
@ -760,6 +778,14 @@ var default_api = 'https://api.global-interaction.com/';
|
||||
return Math.round(normalizeAmountUsd(value) * 100);
|
||||
}
|
||||
|
||||
function booleanValue(value) {
|
||||
if (value === true || value === 1) return true;
|
||||
var text = String(value || '')
|
||||
.trim()
|
||||
.toLowerCase();
|
||||
return text === 'true' || text === '1' || text === 'yes';
|
||||
}
|
||||
|
||||
function mapYumiContext(context) {
|
||||
context = context || {};
|
||||
var profile = context.userProfile || context.user_profile || {};
|
||||
@ -769,6 +795,20 @@ var default_api = 'https://api.global-interaction.com/';
|
||||
var countryCode =
|
||||
normalizeCountryCode(profile.countryCode || profile.country_code) ||
|
||||
countryCodeFromCountry(country);
|
||||
var freightUser = booleanValue(
|
||||
profile.freightUser ||
|
||||
profile.freight_user ||
|
||||
context.freightUser ||
|
||||
context.freight_user
|
||||
);
|
||||
var commodityType = normalizeCommodityType(
|
||||
profile.commodityType ||
|
||||
profile.commodity_type ||
|
||||
context.commodityType ||
|
||||
context.commodity_type ||
|
||||
(freightUser ? 'FREIGHT_GOLD' : 'GOLD')
|
||||
);
|
||||
freightUser = freightUser || commodityType === 'FREIGHT_GOLD';
|
||||
return {
|
||||
auth_mode: 'display_user_id',
|
||||
account: {
|
||||
@ -788,6 +828,11 @@ var default_api = 'https://api.global-interaction.com/';
|
||||
profile.countryName ||
|
||||
profile.country_name ||
|
||||
countryNameFromCountry(country),
|
||||
audience_type: freightUser ? 'coin_seller' : 'ordinary_user',
|
||||
freight_user: freightUser,
|
||||
freightUser: freightUser,
|
||||
commodity_type: commodityType,
|
||||
commodityType: commodityType,
|
||||
},
|
||||
country_list: countryList.map(function (item) {
|
||||
var itemCountry = item.country || {};
|
||||
@ -813,6 +858,10 @@ var default_api = 'https://api.global-interaction.com/';
|
||||
country: itemCountry,
|
||||
};
|
||||
}),
|
||||
commodity_type: commodityType,
|
||||
commodityType: commodityType,
|
||||
freight_user: freightUser,
|
||||
freightUser: freightUser,
|
||||
region_id: context.regionId || context.region_id || '',
|
||||
regionId: context.regionId || context.region_id || '',
|
||||
raw: context,
|
||||
@ -850,6 +899,18 @@ var default_api = 'https://api.global-interaction.com/';
|
||||
award_coin_amount: Number.isFinite(awardContent)
|
||||
? awardContent
|
||||
: 0,
|
||||
commodity_type:
|
||||
item.type ||
|
||||
item.commodityType ||
|
||||
item.commodity_type ||
|
||||
options.type ||
|
||||
'',
|
||||
commodityType:
|
||||
item.type ||
|
||||
item.commodityType ||
|
||||
item.commodity_type ||
|
||||
options.type ||
|
||||
'',
|
||||
amount_usdt: amountUsd,
|
||||
amount_usdt_micro: Math.round(amountUsd * 1000000),
|
||||
amount_minor: decimalToMinor(amountUsd),
|
||||
@ -999,7 +1060,7 @@ var default_api = 'https://api.global-interaction.com/';
|
||||
},
|
||||
options: function (displayUserID, extra) {
|
||||
if (isConfiguredWebPay()) {
|
||||
var query = Object.assign(aslanUserQuery(displayUserID), {
|
||||
var query = Object.assign(aslanUserQuery(displayUserID, extra), {
|
||||
payCountryId:
|
||||
extra && (extra.pay_country_id || extra.payCountryId),
|
||||
countryCode:
|
||||
|
||||
@ -1269,6 +1269,8 @@
|
||||
region_id:
|
||||
context.region_id || context.regionId,
|
||||
user_id: currentAccountUserID(),
|
||||
commodity_type:
|
||||
currentAccountCommodityType(),
|
||||
}
|
||||
);
|
||||
})
|
||||
@ -2166,6 +2168,18 @@
|
||||
);
|
||||
}
|
||||
|
||||
function currentAccountCommodityType() {
|
||||
if (!state.context) return '';
|
||||
return (
|
||||
state.context.commodity_type ||
|
||||
state.context.commodityType ||
|
||||
(state.context.account &&
|
||||
(state.context.account.commodity_type ||
|
||||
state.context.account.commodityType)) ||
|
||||
''
|
||||
);
|
||||
}
|
||||
|
||||
function orderStatusUserID() {
|
||||
return currentAccountUserID() || targetDisplayUserID();
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user