Blame view
src/store/modules/orderRead.js
573 Bytes
37ccd9675
|
1 2 |
import urlAlias from '../url' import request from '../request' |
9a8f39ae3
|
3 |
|
37ccd9675
|
4 |
const { |
9a8f39ae3
|
5 |
orderRead |
37ccd9675
|
6 |
} = urlAlias |
9a8f39ae3
|
7 8 |
const state = { |
37ccd9675
|
9 10 |
orderInfo: {} } |
9a8f39ae3
|
11 12 13 |
const mutations = { INIT: (state, orderInfo) => { |
37ccd9675
|
14 15 16 |
state.orderInfo = orderInfo } } |
9a8f39ae3
|
17 18 19 |
const actions = { getOrderInfo({ commit }, param) { |
36e559203
|
20 |
return new Promise ((resolve) => request({ |
37ccd9675
|
21 22 |
url: orderRead, data: param, |
eed6c3ca9
|
23 24 |
success: (res) => { console.log(res) |
607bc3a4d
|
25 |
commit("INIT", res.data.data) |
36e559203
|
26 |
resolve(res.data.data) |
37ccd9675
|
27 |
} |
36e559203
|
28 |
})) |
37ccd9675
|
29 30 |
} } |
9a8f39ae3
|
31 32 33 34 35 |
export default { namespaced: true, state, mutations, |
37ccd9675
|
36 37 |
actions } |