|
|
import priceChange from './price-change';
|
|
|
import { get } from 'lodash';
|
|
|
import { getImgUrl } from '../../common/utils';
|
|
|
import orderList from './order-list';
|
|
|
import orderConfirm from './order-confirm';
|
|
|
|
|
|
export default function() {
|
|
|
return {
|
...
|
...
|
@@ -9,55 +8,7 @@ export default function() { |
|
|
modules: {
|
|
|
priceChange: priceChange(),
|
|
|
orderList: orderList(),
|
|
|
},
|
|
|
state: {
|
|
|
list: [],
|
|
|
resource: '',
|
|
|
page: 1,
|
|
|
size: 10,
|
|
|
},
|
|
|
mutations: {
|
|
|
addList(state, { list }) {
|
|
|
state.list = state.list.concat(list);
|
|
|
},
|
|
|
addResource(state, { url }) {
|
|
|
state.resource = url;
|
|
|
},
|
|
|
changePage(state, { page }) {
|
|
|
state.page = page;
|
|
|
},
|
|
|
},
|
|
|
actions: {
|
|
|
async fetchList({ commit, state }) {
|
|
|
let page = state.page;
|
|
|
|
|
|
const result = await this.$api.get('/api/union/inviteList', {
|
|
|
page: page,
|
|
|
size: state.size,
|
|
|
});
|
|
|
|
|
|
if (result.code === 200) {
|
|
|
commit('addList', { list: result.data.list });
|
|
|
commit('changePage', { page: ++page });
|
|
|
orderConfirm: orderConfirm()
|
|
|
}
|
|
|
|
|
|
return result.data ? result.data.length : 0;
|
|
|
},
|
|
|
async fetchResource({ commit }) {
|
|
|
const result = await this.$api.get('/api/yoho/resource', {
|
|
|
content_code: 'a51c8222d21b3d88faa4a49c01c9c93e',
|
|
|
});
|
|
|
|
|
|
commit('addResource', {
|
|
|
url: getImgUrl(get(result, 'data[0].data.src') || '', 1000, 1000),
|
|
|
});
|
|
|
},
|
|
|
|
|
|
async fetchUnionStatus() {
|
|
|
const result = await this.$api.get('/api/union/queryUnion');
|
|
|
|
|
|
return result;
|
|
|
},
|
|
|
},
|
|
|
};
|
|
|
} |
...
|
...
|
|