Blame view
src/store/modules/orderRead.js
551 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 23 |
url: orderRead, data: param, success: (res) => { |
607bc3a4d 修改了直接购买的流程,添加弹窗,选... |
24 |
commit("INIT", res.data.data) |
36e559203 逻辑完善 |
25 |
resolve(res.data.data) |
37ccd9675 订单详情页获取数据 |
26 |
} |
36e559203 逻辑完善 |
27 |
})) |
37ccd9675 订单详情页获取数据 |
28 29 |
} } |
9a8f39ae3 订单 |
30 31 32 33 34 |
export default { namespaced: true, state, mutations, |
37ccd9675 订单详情页获取数据 |
35 36 |
actions } |