fix:提交修复6个问题
This commit is contained in:
@@ -62,6 +62,17 @@ export enum StoreStatus {
|
||||
CLOSED = 'CLOSED',
|
||||
}
|
||||
|
||||
export enum PartnerStaffRole {
|
||||
PARTNER = 'PARTNER',
|
||||
INTERNAL = 'INTERNAL',
|
||||
PROMOTER = 'PROMOTER',
|
||||
}
|
||||
|
||||
export enum AccountStatus {
|
||||
ACTIVE = 'ACTIVE',
|
||||
DISABLED = 'DISABLED',
|
||||
}
|
||||
|
||||
export enum BenefitCouponStatus {
|
||||
ACTIVE = 'ACTIVE',
|
||||
USED_UP = 'USED_UP',
|
||||
|
||||
@@ -14,3 +14,4 @@ export * from './store-log';
|
||||
export * from './partner-log';
|
||||
export * from './promo';
|
||||
export * from './hq-permissions';
|
||||
export * from './partner';
|
||||
|
||||
@@ -0,0 +1,101 @@
|
||||
import type { AccountStatus, PartnerStaffRole } from './enums';
|
||||
|
||||
export interface PartnerMe {
|
||||
id: string;
|
||||
name: string;
|
||||
phone: string;
|
||||
isPrimary: boolean;
|
||||
companyName?: string;
|
||||
hasWechat?: boolean;
|
||||
staffRole?: PartnerStaffRole;
|
||||
}
|
||||
|
||||
export interface PartnerStaffItem {
|
||||
id: string;
|
||||
name: string;
|
||||
phone: string;
|
||||
staffRole: PartnerStaffRole;
|
||||
status: AccountStatus;
|
||||
lastLoginAt?: string;
|
||||
}
|
||||
|
||||
export interface CreatePartnerStaffRequest {
|
||||
phone: string;
|
||||
name: string;
|
||||
staffRole: PartnerStaffRole;
|
||||
code: string;
|
||||
}
|
||||
|
||||
export interface UpdatePartnerStaffRequest {
|
||||
name?: string;
|
||||
staffRole?: PartnerStaffRole;
|
||||
status?: AccountStatus;
|
||||
}
|
||||
|
||||
export const PARTNER_STAFF_ROLE_LABELS: Record<PartnerStaffRole, string> = {
|
||||
PARTNER: '城市合伙人',
|
||||
INTERNAL: '内部员工',
|
||||
PROMOTER: '推广员',
|
||||
};
|
||||
|
||||
export type PartnerLeaderboardPeriod = 'month' | 'lastMonth' | 'total';
|
||||
|
||||
export interface PartnerLeaderboardEntry {
|
||||
rank: number;
|
||||
accountId: string;
|
||||
name: string;
|
||||
staffRole?: PartnerStaffRole;
|
||||
roleLabel: string;
|
||||
totalStores: number;
|
||||
periodStores: number;
|
||||
isSelf?: boolean;
|
||||
}
|
||||
|
||||
export interface PartnerLeaderboardResponse {
|
||||
period: PartnerLeaderboardPeriod;
|
||||
list: PartnerLeaderboardEntry[];
|
||||
self?: PartnerLeaderboardEntry & { beatPercent?: number };
|
||||
}
|
||||
|
||||
export interface PartnerStorePhoneAvailableResponse {
|
||||
available: boolean;
|
||||
message?: string;
|
||||
}
|
||||
|
||||
export interface PartnerWeeklyReportPeriod {
|
||||
startDate: string;
|
||||
endDate: string;
|
||||
label: string;
|
||||
}
|
||||
|
||||
export interface PartnerWeeklyReportDailyGmv {
|
||||
date: string;
|
||||
weekdayLabel: string;
|
||||
amount: number;
|
||||
}
|
||||
|
||||
export interface PartnerWeeklyReportStoreRank {
|
||||
rank: number;
|
||||
storeId: string;
|
||||
name: string;
|
||||
subtitle?: string;
|
||||
redeemAmount: number;
|
||||
}
|
||||
|
||||
export interface PartnerWeeklyReportResponse {
|
||||
period: PartnerWeeklyReportPeriod;
|
||||
availablePeriods: PartnerWeeklyReportPeriod[];
|
||||
summary: {
|
||||
gmv: number;
|
||||
gmvGrowthPercent: number;
|
||||
activeStoreCount: number;
|
||||
totalStoreCount: number;
|
||||
orderCount: number;
|
||||
newStoreCount: number;
|
||||
newStoreTarget: number;
|
||||
newStoreProgressPercent: number;
|
||||
};
|
||||
dailyGmv: PartnerWeeklyReportDailyGmv[];
|
||||
storeRanking: PartnerWeeklyReportStoreRank[];
|
||||
insight: string;
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
import { getRuntimePlatform } from './env';
|
||||
import { ensureJssdkReady } from './jssdk';
|
||||
import { ensureJssdkReady, normalizeJssdkPageUrl } from './jssdk';
|
||||
import type { WeixinSdkConfig } from './types';
|
||||
|
||||
export type ChooseWechatImageOptions = {
|
||||
@@ -32,7 +32,7 @@ async function reportChooseImageEvent(
|
||||
errMsg: payload.errMsg,
|
||||
sourceType: payload.sourceType,
|
||||
stage: payload.stage,
|
||||
pageUrl: typeof window !== 'undefined' ? window.location.href.split('#')[0] : undefined,
|
||||
pageUrl: typeof window !== 'undefined' ? normalizeJssdkPageUrl(window.location.href) : undefined,
|
||||
}),
|
||||
});
|
||||
} catch {
|
||||
@@ -84,7 +84,7 @@ export async function chooseWechatImages(
|
||||
const sourceType = options.sourceType ?? ['album', 'camera'];
|
||||
|
||||
if (platform === 'wechat-h5') {
|
||||
const pageUrl = typeof window !== 'undefined' ? window.location.href.split('#')[0] : '';
|
||||
const pageUrl = typeof window !== 'undefined' ? normalizeJssdkPageUrl(window.location.href) : '';
|
||||
const sourceTypeKey = sourceType.join(',');
|
||||
try {
|
||||
await ensureJssdkReady({
|
||||
|
||||
Reference in New Issue
Block a user