shopSum(){
return new Promise(resolve=>{
resolve();
this.$post('ord003', {
"flag":true
}).then(res => {
//请求1
})
})
}
activitySum(){
return new Promise(resolve=>{
resolve();
this.$post('ord003', {
"flag":true
}).then(res => {
//请求2
})
})
}
orderySum(){
return new Promise(resolve=>{
resolve();
this.$post('ord003', {
"flag":true
}).then(res => {
//请求3
})
})
}
shopSum()
.then(activitySum())
.then(orderySum())
这样写他并没有按照顺序 求教
首先shopSum、activitySum、orderySum中都要return一个promise,不知道你里面具体是怎么写的
然后像下面这样写
然后好好去学习一下promise,比较推荐mdn的资料,如果有能力尽量去读英文版的,promise本质上是callback的封装,promise学明白了你的问题自然就解决了
https://developer.mozilla.org...
https://developer.mozilla.org...
像这样改
或是更简单一点