Commit 3fd4a3b1 by liimin

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

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