Commit 3fd4a3b1 by liimin

refactor(订单组件): 简化getStatus方法并直接传递order参数

移除冗余的状态解构赋值,直接传递order对象给getOrder函数
1 parent 352023a7
......@@ -9,9 +9,9 @@ Component({
type: Object,
value: {},
observer: function (v) {
v && this.getStatus();
v && this.getStatus(v);
},
}
},
},
/**
......@@ -25,24 +25,11 @@ Component({
* 组件的方法列表
*/
methods: {
getStatus() {
let {
orderStatus,
cancelStatus,
returnStatus,
refundStatus,
returnOrderStatus,
} = this.data.item;
const _order = getOrder({
orderStatus,
cancelStatus,
returnStatus,
refundStatus,
returnOrderStatus,
});
getStatus(order) {
const _order = getOrder(order);
this.setData({
status: _order.text,
});
},
}
},
});
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!