123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081 |
- import axios from '~/plugins/axios'
- export const actions = {
-
- getUserInfo ({ commit }, params = {}) {
- commit('lotteryInfo/REQUEST_USER_INFO')
- return axios.get('/lottery/userInfo', {params})
- .then(response => {
- commit('lotteryInfo/GET_USER_INFO_SUCCESS', response.data)
- }, err => {
- commit('lotteryInfo/GET_USER_INFO_FAILURE', err)
- })
- },
-
- getNextLevel ({ commit }, params = {}) {
- commit('lotteryInfo/REQUEST_NEXT_LEVEL')
- return axios.get('/lottery/user/activityItems', {params})
- .then(response => {
- commit('lotteryInfo/GET_NEXT_LEVEL_SUCCESS', response.data)
- }, err => {
- commit('lotteryInfo/GET_NEXT_LEVEL_FAILURE', err)
- })
- },
-
- getWinningRecord ({ commit }, params = {}) {
- commit('lotteryInfo/REQUEST_WIN_RECORD')
- return axios.get('/lottery/user/winninghistories', {params})
- .then(response => {
- commit('lotteryInfo/GET_WIN_RECORD_SUCCESS', response.data)
- }, err => {
- commit('lotteryInfo/GET_WIN_RECORD_FAILURE', err)
- })
- },
-
- getOwnWinningRecord ({ commit }, params = {}) {
- commit('lotteryInfo/REQUEST_OWN_WIN_RECORD')
- return axios.get('/lottery/user/winninghistories/one', {params})
- .then(response => {
- commit('lotteryInfo/GET_OWN_WIN_RECORD_SUCCESS', response.data)
- }, err => {
- commit('lotteryInfo/GET_OWN_WIN_RECORD_FAILURE', err)
- })
- },
-
- currentGradePrizes ({ commit }, params = {}) {
- let resItems = []
- commit('lotteryInfo/REQUEST_CURRENT_GRADE_PRIZES')
- return axios.get('/lottery/user/prizes', {params})
- .then(res => {
-
-
-
-
-
-
-
-
-
-
- resItems = res.data
- for (let i = 0; i < resItems.data.length; i++) {
- resItems.data[i].$index = i
- resItems.code = 200
- resItems.success = true
- }
- commit('lotteryInfo/GET_CURRENT_GRADE_PRIZES_SUCCESS', resItems)
- }, err => {
- commit('lotteryInfo/GET_CURRENT_GRADE_PRIZES_FAILURE', err)
- })
- },
-
- getOwnLotteryInfo ({ commit }, params = {}) {
- commit('lotteryInfo/REQUEST_OWN_LOTTERY_INFO')
- return axios.get('/lottery/user/draw', {params})
- .then(response => {
- commit('lotteryInfo/GET_OWN_LOTTERY_INFO_SUCCESS', response.data)
- }, err => {
- commit('lotteryInfo/GET_OWN_LOTTERY_INFO_FAILURE', err)
- })
- }
- }
|