order.js
779 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import urlAlias from '../url'
import request from '../request'
const { orderBuild } = urlAlias
const state = { list: [], param: {} }
const mutations = {
LIST: (state, list) => {
state.list = list
},
SAVE: (state, param) => {
state.param = param
}
}
const actions = {
build({ commit }, param) {
return new Promise((resolve, reject) => request({
url: orderBuild,
data: param,
success: (res) => {
resolve()
},
fail: () => {
uni.showModal({
content: '订单生成失败',
showCancel: false
})
}
}))
},
saveParams({ commit }, param) {
console.log('save', param)
commit('SAVE', param)
}
}
export default {
namespaced: true,
state,
mutations,
actions
}