import { netStaffDefaultReviewer } from '@/api/index.js'
export const commonF = {
	onShow() {
		this.remindPeople = []
		this.getDefaultRemind()
	},
	//监听  页面 卸载
	onUnload() {
		uni.removeStorageSync('remindlist')
	},
	methods:{
		//获取  需要默认提醒的人
		getDefaultRemind() {
			netStaffDefaultReviewer({type:this.remindType}).then(res=>{
				res = res.data
				res.forEach((ele,index) => {
					ele.isDel = false
				})
				this.remindPeople = this.$deWeight([...res,...uni.getStorageSync('remindlist')])
			})
		},
		//删除 提醒人
		delRemind(index) {
			this.remindPeople.splice(index, 1)
			uni.setStorageSync('remindlist', this.remindPeople)
		},
	}
}