import Vue from "vue";
import $ajax from '../../../../util/request'
import store from '../../../../store/store'
import {
	Notify,
	Toast
} from "vant";
Vue.use(Toast, Notify);
const BASE_URL = process.env.API_HOST //'https://lzdz3-isv.isvjcloud.com/api';

export default {
	async activity (param,callback){
		var url = BASE_URL + '/dz/ysl/draw/activity'
		let {
			data
		} = await $ajax.post(url, param)
		callback && callback(data)
	},
	// 中奖名单
	async prizeRecord (callback){
		var url = BASE_URL + '/dz/prize/prizeRecord'
		let {
			data
		} = await $ajax.post(url)
		callback && callback(data)
	},
	//奖品信息接口
	async drawPrize (callback){
		var url = BASE_URL + '/prize/drawPrize'
		let {
			data
		} = await $ajax.post(url)
		callback && callback(data)
	},
	//任务列表
	async taskList (param,callback){
		var url = BASE_URL + '/dz/task/taskList'
		let {
			data
		} = await $ajax.post(url,param)
		callback && callback(data)
	},
	//我的奖品
	async myPrize (callback){
		var url = BASE_URL + '/dz/prize/myPrize'
		let {
			data
		} = await $ajax.get(url)
		callback && callback(data)
	},
	// 商品列表
	async productList (param,callback){
		var url = BASE_URL + '/dz/product/productList'
		let {
			data
		} = await $ajax.post(url,param)
		callback && callback(data)
	},
	// 抽奖
	async draw (param,callback){
		var url = BASE_URL + '/dz/ysl/draw/draw'
		let {
			data
		} = await $ajax.post(url,param)
		callback && callback(data)
	},
	// 做任务
	async task (param,callback){
		console.log(param,'做任务11111111111');
		var url = BASE_URL + '/dz/task/doTask'
		let {
			data
		} = await $ajax.post(url,param)
		callback && callback(data)
	},
	// 保存地址
    async saveAddress (parameter,callback){
		var url = BASE_URL + '/dz/prize/saveAddress'
		let {
			data
		} = await $ajax.post(url,parameter)
		callback && callback(data)
	},
	// 保存日志
	async saveLog(param, callback) {
		var url = BASE_URL + '/dz/eventLog/saveLog'
		let {
			data
		} = await $ajax.post(url, param)
		callback && callback(data)
	},


}
