Commit ed162585 by 姜雷

添加获取服务类型时状态字段

parent 1fd5fe7c
...@@ -3,16 +3,24 @@ import store from './store'; ...@@ -3,16 +3,24 @@ import store from './store';
export default { export default {
props: { props: {
// null所有/1自助/2三方 // 服务类型:null所有/1自助/2三方
ServiceType: { ServiceType: {
type: Number, type: Number,
default: null, default: null,
}, },
// 服务状态:null所有/1开启/0关闭
ServiceState: {
type: Number,
default: null,
},
}, },
created() { created() {
store.install(this.$store); store.install(this.$store);
if (!this.serviceTypeLists[this.ServiceType].length) { if (!this.serviceTypeLists[this.ServiceType].length) {
this.fetchServiceTypeList(this.ServiceType); this.fetchServiceTypeList({
serviceType: this.ServiceType,
state: this.ServiceState,
});
} }
}, },
computed: { computed: {
......
...@@ -21,11 +21,11 @@ const getters = { ...@@ -21,11 +21,11 @@ const getters = {
}; };
const actions = { const actions = {
fetchServiceTypeList({ state, commit }, serviceType) { fetchServiceTypeList({ state, commit }, { serviceType, state }) {
if (state.fetching[serviceType]) return; if (state.fetching[serviceType]) return;
commit(FETCH_STATE, { value: true, index: serviceType }); commit(FETCH_STATE, { value: true, index: serviceType });
return fetchServiceList({ return fetchServiceList({
params: { serviceType }, params: { serviceType, state },
}).then(res => { }).then(res => {
const { selfService } = res; const { selfService } = res;
commit(SERVICE_TYPE_LIST, { list: selfService, index: serviceType }); commit(SERVICE_TYPE_LIST, { list: selfService, index: serviceType });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment