|
@@ -25,16 +25,16 @@ Component({
|
|
* 组件的方法列表
|
|
* 组件的方法列表
|
|
*/
|
|
*/
|
|
methods: {
|
|
methods: {
|
|
- navigate: function(e) {
|
|
|
|
|
|
+ navigate: function (e) {
|
|
wx.navigateTo({
|
|
wx.navigateTo({
|
|
url: e.currentTarget.dataset.url,
|
|
url: e.currentTarget.dataset.url,
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- doAction: function(e) {
|
|
|
|
|
|
+ doAction: function (e) {
|
|
var type = e.currentTarget.dataset.type
|
|
var type = e.currentTarget.dataset.type
|
|
- if(type == 'edit' || type == 'detail') {
|
|
|
|
|
|
+ if (type == 'edit' || type == 'detail') {
|
|
this.navigate(e)
|
|
this.navigate(e)
|
|
- } else if(type == 'confirm') {
|
|
|
|
|
|
+ } else if (type == 'confirm') {
|
|
var that = this
|
|
var that = this
|
|
var order = e.currentTarget.dataset.order
|
|
var order = e.currentTarget.dataset.order
|
|
Dialog.confirm({
|
|
Dialog.confirm({
|
|
@@ -43,8 +43,10 @@ Component({
|
|
})
|
|
})
|
|
.then(() => {
|
|
.then(() => {
|
|
that.submitCheck(order)
|
|
that.submitCheck(order)
|
|
|
|
+ }).catch(() => {
|
|
|
|
+ Dialog.close()
|
|
})
|
|
})
|
|
- } else if(type == 'delete') {
|
|
|
|
|
|
+ } else if (type == 'delete') {
|
|
var that = this
|
|
var that = this
|
|
var order = e.currentTarget.dataset.order
|
|
var order = e.currentTarget.dataset.order
|
|
Dialog.confirm({
|
|
Dialog.confirm({
|
|
@@ -53,6 +55,8 @@ Component({
|
|
})
|
|
})
|
|
.then(() => {
|
|
.then(() => {
|
|
that.delete(order)
|
|
that.delete(order)
|
|
|
|
+ }).catch(() => {
|
|
|
|
+ Dialog.close()
|
|
})
|
|
})
|
|
}
|
|
}
|
|
},
|
|
},
|
|
@@ -66,6 +70,7 @@ Component({
|
|
success: function (res) {
|
|
success: function (res) {
|
|
if (res.code == 0) {
|
|
if (res.code == 0) {
|
|
that.triggerEvent("update")
|
|
that.triggerEvent("update")
|
|
|
|
+ Dialog.close()
|
|
}
|
|
}
|
|
}
|
|
}
|
|
})
|
|
})
|
|
@@ -82,6 +87,7 @@ Component({
|
|
success: function (res) {
|
|
success: function (res) {
|
|
if (res.code == 0) {
|
|
if (res.code == 0) {
|
|
that.triggerEvent("update")
|
|
that.triggerEvent("update")
|
|
|
|
+ Dialog.close()
|
|
}
|
|
}
|
|
}
|
|
}
|
|
})
|
|
})
|