uni.mixin = {
	// 上拉加载页面
	pull: {
		onLoad() {
		    const initData = this.$options.initData
			if (uni.utils.isFunction(initData)) {
				initData.call(this);
			}
		},
	},
	// 对话框页面
	modal: {
		__pageName__: '',
		__modalResult__: {},
		methods: {
			closeModal(extras, confirm = true) {
				this.__modalResult__ = { extras, confirm }
				uni.pro.navigateBack()
			}
		},
		onLoad() {
			const route = uni.utils.getCurrentRoute()
			this.__pageName__ = uni.url.getPageName(route)
			this.__modalResult__ = {
				confirm: false,
				extras: {}
			}
		},
		onUnload() {
			uni.modal.close(this.__pageName__, this.__modalResult__.extras, this.__modalResult__.confirm);
		}
	}
}