提交 026cf64a 编写于 作者: fxy060608's avatar fxy060608

refactor: popup

上级 65d74e8b
......@@ -45,10 +45,15 @@ export * from './protocols/location/getLocation'
export * from './protocols/route/route'
export * from './protocols/ui/hideLoading'
export * from './protocols/ui/hideToast'
export * from './protocols/ui/loadFontFace'
export * from './protocols/ui/pageScrollTo'
export * from './protocols/ui/navigationBar'
export * from './protocols/ui/popup'
export * from './protocols/ui/pageScrollTo'
export * from './protocols/ui/showActionSheet'
export * from './protocols/ui/showLoading'
export * from './protocols/ui/showModal'
export * from './protocols/ui/showToast'
export * from './protocols/ui/startPullDownRefresh'
export * from './protocols/ui/stopPullDownRefresh'
export * from './protocols/ui/tabBar'
......
export const API_HIDE_LOADING = 'hideLoading'
export type API_TYPE_HIDE_LOADING = typeof uni.hideLoading
export const API_HIDE_TOAST = 'hideToast'
export type API_TYPE_HIDE_TOAST = typeof uni.hideToast
export const API_SHOW_ACTION_SHEET = 'showActionSheet'
export type API_TYPE_SHOW_ACTION_SHEET = typeof uni.showActionSheet
export const ShowActionSheetProtocol: ApiProtocol<API_TYPE_SHOW_ACTION_SHEET> = {
itemList: {
type: Array,
required: true,
},
itemColor: String,
}
export const ShowActionSheetOptions: ApiOptions<API_TYPE_SHOW_ACTION_SHEET> = {
formatArgs: {
itemColor: '#000',
},
}
export const API_SHOW_LOADING = 'showLoading'
export type API_TYPE_SHOW_LOADING = typeof uni.showLoading
export const ShowLoadingProtocol: ApiProtocol<API_TYPE_SHOW_LOADING> = {
title: String,
mask: Boolean,
}
export const ShowLoadingOptions: ApiOptions<API_TYPE_SHOW_LOADING> = {
formatArgs: {
title: '',
mask: false,
},
}
import { hasOwn } from '@vue/shared'
import { useI18n, initI18nShowModalMsgsOnce } from '@dcloudio/uni-core'
import { PRIMARY_COLOR } from '@dcloudio//uni-shared'
import { getRealPath } from '@dcloudio/uni-platform'
import { PRIMARY_COLOR } from '@dcloudio/uni-shared'
import { initI18nShowModalMsgsOnce, useI18n } from '@dcloudio/uni-core'
export const API_SHOW_MODAL = 'showModal'
export type API_TYPE_SHOW_MODAL = typeof uni.showModal
......@@ -40,61 +40,3 @@ export const ShowModalOptions: ApiOptions<API_TYPE_SHOW_MODAL> = {
confirmColor: PRIMARY_COLOR,
},
}
export const API_SHOW_TOAST = 'showToast'
export type API_TYPE_SHOW_TOAST = typeof uni.showToast
export const ShowToastProtocol: ApiProtocol<API_TYPE_SHOW_TOAST> = {
title: String,
icon: String as any,
image: String,
duration: Number,
mask: Boolean,
}
export const ShowToastOptions: ApiOptions<API_TYPE_SHOW_TOAST> = {
formatArgs: {
title: '',
icon(value, params) {
if (['success', 'loading', 'none'].indexOf(value!) === -1) {
params.icon = 'success'
}
},
image(value, params) {
if (value) {
params.image = getRealPath(value)
}
},
duration: 1500,
mask: false,
},
}
export const API_SHOW_LOADING = 'showLoading'
export type API_TYPE_SHOW_LOADING = typeof uni.showLoading
export const ShowLoadingProtocol: ApiProtocol<API_TYPE_SHOW_LOADING> = {
title: String,
mask: Boolean,
}
export const ShowLoadingOptions: ApiOptions<API_TYPE_SHOW_LOADING> = {
formatArgs: {
title: '',
mask: false,
},
}
export const API_SHOW_ACTION_SHEET = 'showActionSheet'
export type API_TYPE_SHOW_ACTION_SHEET = typeof uni.showActionSheet
export const ShowActionSheetProtocol: ApiProtocol<API_TYPE_SHOW_ACTION_SHEET> = {
itemList: {
type: Array,
required: true,
},
itemColor: String,
}
export const ShowActionSheetOptions: ApiOptions<API_TYPE_SHOW_ACTION_SHEET> = {
formatArgs: {
itemColor: '#000',
},
}
export const API_HIDE_TOAST = 'hideToast'
export type API_TYPE_HIDE_TOAST = typeof uni.hideToast
export const API_HIDE_LOADING = 'hideLoading'
export type API_TYPE_HIDE_LOADING = typeof uni.hideLoading
import { getRealPath } from '@dcloudio/uni-platform'
export const API_SHOW_TOAST = 'showToast'
export type API_TYPE_SHOW_TOAST = typeof uni.showToast
export const ShowToastProtocol: ApiProtocol<API_TYPE_SHOW_TOAST> = {
title: String,
icon: String as any,
image: String,
duration: Number,
mask: Boolean,
}
export const ShowToastOptions: ApiOptions<API_TYPE_SHOW_TOAST> = {
formatArgs: {
title: '',
icon(value, params) {
if (['success', 'loading', 'none'].indexOf(value!) === -1) {
params.icon = 'success'
}
},
image(value, params) {
if (value) {
params.image = getRealPath(value)
}
},
duration: 1500,
mask: false,
},
}
import {isFunction, extend, isPlainObject, isString, isArray, hasOwn as hasOwn$1, isObject as isObject$1, capitalize, toRawType, makeMap as makeMap$1, isPromise, invokeArrayFns as invokeArrayFns$1, hyphenate} from "@vue/shared";
import {injectHook, createVNode, inject, provide, reactive, computed, nextTick, getCurrentInstance, onBeforeMount, onMounted, onBeforeActivate, onBeforeDeactivate, openBlock, createBlock, mergeProps, toDisplayString, ref, defineComponent, resolveComponent, toHandlers, renderSlot, watch, onActivated, onBeforeUnmount, withModifiers, withDirectives, vShow, vModelDynamic, createTextVNode, createCommentVNode, Fragment, renderList, vModelText, onDeactivated, onUnmounted, watchEffect, withCtx, KeepAlive, resolveDynamicComponent} from "vue";
import {once, passive, normalizeTarget, invokeArrayFns, NAVBAR_HEIGHT, parseQuery, removeLeadingSlash, getLen, ON_REACH_BOTTOM_DISTANCE, decodedQuery, plusReady, debounce, PRIMARY_COLOR as PRIMARY_COLOR$1, updateElementStyle, addFont, scrollTo} from "@dcloudio/uni-shared";
import {once, passive, normalizeTarget, invokeArrayFns, NAVBAR_HEIGHT, parseQuery, PRIMARY_COLOR, removeLeadingSlash, getLen, ON_REACH_BOTTOM_DISTANCE, decodedQuery, plusReady, debounce, updateElementStyle, addFont, scrollTo} from "@dcloudio/uni-shared";
import {useRoute, createRouter, createWebHistory, createWebHashHistory, useRouter, isNavigationFailure, RouterView} from "vue-router";
function applyOptions(options, instance2, publicThis) {
Object.keys(options).forEach((name) => {
......@@ -2627,6 +2627,8 @@ function createNormalizeUrl(type) {
}
};
}
const API_HIDE_LOADING = "hideLoading";
const API_HIDE_TOAST = "hideToast";
const API_LOAD_FONT_FACE = "loadFontFace";
const LoadFontFaceProtocol = {
family: {
......@@ -2639,20 +2641,6 @@ const LoadFontFaceProtocol = {
},
desc: Object
};
const API_PAGE_SCROLL_TO = "pageScrollTo";
const PageScrollToProtocol = {
scrollTop: Number,
selector: String,
duration: Number
};
const DEFAULT_DURATION = 300;
const PageScrollToOptions = {
formatArgs: {
duration(value, params) {
params.duration = Math.max(0, parseInt(value + "") || DEFAULT_DURATION);
}
}
};
const FRONT_COLORS = ["#ffffff", "#000000"];
const API_SET_NAVIGATION_BAR_COLOR = "setNavigationBarColor";
const SetNavigationBarColorOptions = {
......@@ -2693,7 +2681,44 @@ const SetNavigationBarTitleProtocol = {
};
const API_SHOW_NAVIGATION_BAR_LOADING = "showNavigationBarLoading";
const API_HIDE_NAVIGATION_BAR_LOADING = "hideNavigationBarLoading";
const PRIMARY_COLOR = "#007aff";
const API_PAGE_SCROLL_TO = "pageScrollTo";
const PageScrollToProtocol = {
scrollTop: Number,
selector: String,
duration: Number
};
const DEFAULT_DURATION = 300;
const PageScrollToOptions = {
formatArgs: {
duration(value, params) {
params.duration = Math.max(0, parseInt(value + "") || DEFAULT_DURATION);
}
}
};
const API_SHOW_ACTION_SHEET = "showActionSheet";
const ShowActionSheetProtocol = {
itemList: {
type: Array,
required: true
},
itemColor: String
};
const ShowActionSheetOptions = {
formatArgs: {
itemColor: "#000"
}
};
const API_SHOW_LOADING = "showLoading";
const ShowLoadingProtocol = {
title: String,
mask: Boolean
};
const ShowLoadingOptions = {
formatArgs: {
title: "",
mask: false
}
};
const API_SHOW_MODAL = "showModal";
const ShowModalProtocol = {
title: String,
......@@ -2753,32 +2778,6 @@ const ShowToastOptions = {
mask: false
}
};
const API_SHOW_LOADING = "showLoading";
const ShowLoadingProtocol = {
title: String,
mask: Boolean
};
const ShowLoadingOptions = {
formatArgs: {
title: "",
mask: false
}
};
const API_SHOW_ACTION_SHEET = "showActionSheet";
const ShowActionSheetProtocol = {
itemList: {
type: Array,
required: true
},
itemColor: String
};
const ShowActionSheetOptions = {
formatArgs: {
itemColor: "#000"
}
};
const API_HIDE_TOAST = "hideToast";
const API_HIDE_LOADING = "hideLoading";
const API_START_PULL_DOWN_REFRESH = "startPullDownRefresh";
const API_STOP_PULL_DOWN_REFRESH = "stopPullDownRefresh";
const IndexProtocol = {
......@@ -5981,11 +5980,11 @@ const CANCEL_COLOR = "#f43530";
const ICONS = {
success: {
d: ICON_PATH_SUCCESS,
c: PRIMARY_COLOR$1
c: PRIMARY_COLOR
},
success_no_circle: {
d: ICON_PATH_SUCCESS_NO_CIRCLE,
c: PRIMARY_COLOR$1
c: PRIMARY_COLOR
},
info: {
d: ICON_PATH_INFO,
......@@ -6005,7 +6004,7 @@ const ICONS = {
},
download: {
d: ICON_PATH_DOWNLOAD,
c: PRIMARY_COLOR$1
c: PRIMARY_COLOR
},
search: {
d: ICON_PATH_SEARCH,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册