import request from '../utils/request'
import getAPI from '../config/apis'
export default {
    namespaced: true,
      state: {
        detail: {},
      },
      mutations: {
        updateActivityList(state, detail) {
          state.detail = detail;
        },
      },
      actions: {
          
        getActivityList({ commit }, params) {
          return new Promise((resolve, reject) => {
            request({ ...getAPI('homepage.getactivitylist'),params}).then((data) => {
              commit('updateActivityList', data)
              resolve()            
            }).catch(reject)
          });
        },
        // getActivityList (context, payload) { // 获取附近课程
        //     return new Promise((resolve, reject) => {
        //       Ajax(api.homepage.getactivity.url, {
        //         method: api.homepage.getactivity.method,
        //         queryData: { ...payload }
        //       }).then(res => {
        //         context.commit('updateActivityList', res)
        //         resolve(res)
        //       }).catch((err) => {
        //         reject(err)
        //       })
        //     })
        //   },
      }

      
    }