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 openCardStatus(activityId, callback) {
		let param = {
			activityId: activityId,
		}

		var url = BASE_URL + '/dz/lk/draw/openCardStatus'
		let {
			data
		} = await $ajax.post(url, param)
		callback && callback(data)

	},

	async myprize(callback) {
		// console.log("myprize")
		let {
			data
		} = await $ajax.post(BASE_URL + '/my/prize/list', {
			current: 1,
			size: 10000
		})
		if (data.resp_code == 0) {
			callback && callback(data)
		} else {
			Toast(data.resp_msg);
		}
	},

	async draw(callback) {
		// console.log("myprize")
		let {
			data
		} = await $ajax.post(BASE_URL + '/dz/lk/draw/draw', {})
		if (data.resp_code == 0) {
			callback && callback(data)
		} else {
			Toast(data.resp_msg);
		}
	},

	// 保存日志
	async saveLog(param, callback) {
		var url = BASE_URL + '/dz/eventLog/saveLog'
		let {
			data
		} = await $ajax.post(url, param)
		callback && callback(data)
	},


}
