import { llgetData, llgetOrder } from '../api/index'
import { Toast } from 'vant'
// 获取流量二次认证sgin
const getllSgin = (fes, sou) => {
	let init = new Promise((resolve, reject) => {
		llgetData({ fes: fes, sou: sou, orderId: "" }).then(res => {
			if (res.code == 10000) {
				resolve(res)
			}
		}).catch(err => {
			reject(err)
		})
	})
	return init

}


const llorder = (param) => {
	Toast.loading({
		type: "loading",
		message: "订购中",
		duration: 0
	})
	let init = new Promise((resolve, reject) => {
		llgetOrder(param).then(res => {
			if (res) {
				resolve(res)
				Toast.clear()
			}
		}).catch(err => {
			reject(err)
		})
	})
	return init

}


export default { getllSgin, llorder }