vue寫一個(gè)審核(通過、拒絕)需求。拒絕需要二次確認(rèn),填寫拒絕理由。類似poromt(),我想把所有邏輯都寫在點(diǎn)擊拒絕時(shí)觸發(fā)的函數(shù)里,因?yàn)榭梢詡魅朦c(diǎn)擊時(shí)所需審核的人id,問題是我著么才能等二次確認(rèn)之后再執(zhí)行之后的代碼呢?好像自己寫的poromt()實(shí)現(xiàn)不了。貼上代碼 //審核團(tuán)隊(duì),拒絕還是通過 chooseTeam(operation, id) { //alert("xxx") var params = { sessionId: this.sessionId, operation: operation, reason: "" }; if (params.operation == 2) { this.showpop = true; //顯示二次確認(rèn)框,輸入理由后點(diǎn)擊確認(rèn)再發(fā)送ajax給后臺(tái) } this.$http("post", "/team/" + id, params).then((res) => { res = res.data; if (res.result == 1 && res.data) { this.getContent(); } }); } , resure(string,callback) { if(string =="yse"){ return true }else if(string=="no"){ return false }
大牛們,幫我整理下邏輯。
紅糖糍粑
2019-03-13 18:15:40