weather.js 941 Bytes
//import shop from '../../api/shop'
//气象预警
// initial state
const state = {
  all: [],
  weather_news:'>预计今天下午出现2-3级,偏南风1'//最新天气信息
}

// getters
const getters = {}

// actions
const actions = {
  // getAllProducts ({ commit }) {
  //   shop.getProducts(products => {
  //     commit('setProducts', products)
  //   })
  // }
  act_set_weather_news ({ commit, state }, products) {
    commit('set_weather_news', products)
  }
}

// mutations
const mutations = {
  // 设置最新天气情况
  set_weather_news(state, resData){
    //debugger;
    state.weather_news = resData;
  }
  // setProducts (state, products) {
  //   state.all = products
  // },
  //
  // decrementProductInventory (state, { id }) {
  //   const product = state.all.find(product => product.id === id)
  //   product.inventory--
  // }
}

export default {
  namespaced: true,
  state,
  getters,
  actions,
  mutations
}