经理赠送vip

This commit is contained in:
zhx 2026-07-05 01:55:38 +08:00
parent cb3fee73ab
commit cb7daa49e1
3 changed files with 13 additions and 5 deletions

View File

@ -1460,13 +1460,14 @@ var default_api = 'https://api.global-interaction.com/';
method: 'GET',
});
},
searchUsers: function (keyword, pageSize, scope) {
searchUsers: function (keyword, pageSize, scope, action) {
return request('/api/v1/manager-center/users/search', {
method: 'GET',
query: {
keyword: keyword,
page_size: pageSize || 20,
scope: scope,
action: action,
},
});
},

View File

@ -523,6 +523,6 @@
<script src="../../common/params.js?v=20260608-manager-real"></script>
<script src="../../common/jsbridge.js"></script>
<script src="../../common/i18n.js?v=20260608"></script>
<script src="./script.js?v=20260704-manager-vip5"></script>
<script src="./script.js?v=20260705-manager-vip-permission"></script>
</body>
</html>

View File

@ -22,6 +22,7 @@
'send-frame': 'canGrantAvatarFrame',
'send-car': 'canGrantVehicle',
'send-badge': 'canGrantBadge',
'send-vip': 'canGrantVip',
'update-user-level': 'canUpdateUserLevel',
'add-bd-leader': 'canAddBdLeader',
'add-admin': 'canAddAdmin',
@ -253,6 +254,12 @@
: raw.can_grant_badge !== undefined
? Boolean(raw.can_grant_badge)
: true,
canGrantVip:
raw.canGrantVip !== undefined
? Boolean(raw.canGrantVip)
: raw.can_grant_vip !== undefined
? Boolean(raw.can_grant_vip)
: true,
canUpdateUserLevel:
raw.canUpdateUserLevel !== undefined
? Boolean(raw.canUpdateUserLevel)
@ -311,11 +318,11 @@
return false;
}
function apiSearchUser(keyword, scope) {
function apiSearchUser(keyword, scope, action) {
if (!api || !api.searchUsers) {
return Promise.reject(new Error('API not available.'));
}
return api.searchUsers(keyword, 20, scope).then(function (data) {
return api.searchUsers(keyword, 20, scope, action).then(function (data) {
var items = (data && data.items) || [];
return items.map(normalizeUser);
});
@ -674,7 +681,7 @@
toast('Enter user ID.');
return;
}
apiSearchUser(value)
apiSearchUser(value, '', grantState.action)
.then(function (items) {
if (!items.length) {
blockState.searchedUser = null;