...
|
...
|
@@ -11,10 +11,10 @@ |
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import { orderActionsMap } from "../../../../constants/order-constants";
|
|
|
import { createNamespacedHelpers } from "vuex";
|
|
|
import { orderActionsMap } from '../../../../constants/order-constants';
|
|
|
import { createNamespacedHelpers } from 'vuex';
|
|
|
|
|
|
const { mapActions } = createNamespacedHelpers("order/orderList");
|
|
|
const { mapActions } = createNamespacedHelpers('order/orderList');
|
|
|
|
|
|
export default {
|
|
|
props: {
|
...
|
...
|
@@ -29,36 +29,41 @@ export default { |
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
...mapActions(["deleteOrder"]),
|
|
|
...mapActions(['deleteOrder']),
|
|
|
onAction(action) {
|
|
|
const { owner } = this.$route.params;
|
|
|
|
|
|
switch (action.name) {
|
|
|
case orderActionsMap.DEL_ORDER.name:
|
|
|
case orderActionsMap.DEL_ORDER.name: {
|
|
|
this.$createDialog({
|
|
|
type: "confirm",
|
|
|
content: "确认删除订单?",
|
|
|
onConfirm: async () => {
|
|
|
type: 'confirm',
|
|
|
content: '确认删除订单?',
|
|
|
onConfirm: async() => {
|
|
|
const isOk = await this.deleteOrder({
|
|
|
orderCode: this.order.code,
|
|
|
owner
|
|
|
});
|
|
|
const txt = isOk ? "删除成功" : "删除失败";
|
|
|
this.$createToast({ txt, type: "txt" }).show();
|
|
|
const txt = isOk ? '删除成功' : '删除失败';
|
|
|
|
|
|
this.$createToast({ txt, type: 'txt' }).show();
|
|
|
}
|
|
|
}).show();
|
|
|
break;
|
|
|
case orderActionsMap.BUY_AGAIN.name:
|
|
|
console.log("------------------", this.$router.push);
|
|
|
}
|
|
|
case orderActionsMap.BUY_AGAIN.name: {
|
|
|
console.log('------------------', this.$router.push);
|
|
|
break;
|
|
|
case orderActionsMap.SOLD_AGAIN.name:
|
|
|
}
|
|
|
case orderActionsMap.SOLD_AGAIN.name: {
|
|
|
const { productId, storageId } = this.order.goodsInfo;
|
|
|
|
|
|
this.$router.push({
|
|
|
path: "/xianyu/order/sellconfirm.html",
|
|
|
path: '/xianyu/order/sellconfirm.html',
|
|
|
query: { productId, storageId }
|
|
|
});
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
createDialog(options) {
|
|
|
const {
|
...
|
...
|
@@ -72,44 +77,45 @@ export default { |
|
|
this.$createDialog(config, createElement => {
|
|
|
return [
|
|
|
createElement(
|
|
|
"a",
|
|
|
'a',
|
|
|
{
|
|
|
class: {
|
|
|
"cube-dialog-btn border-top-1px action-confirm": true
|
|
|
'cube-dialog-btn border-top-1px action-confirm': true
|
|
|
},
|
|
|
slot: "btns",
|
|
|
slot: 'btns',
|
|
|
on: {
|
|
|
click: () => {
|
|
|
console.log("--------btn------");
|
|
|
console.log('--------btn------');
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
confirmBtn.text
|
|
|
),
|
|
|
createElement(
|
|
|
"a",
|
|
|
'a',
|
|
|
{
|
|
|
class: {
|
|
|
"cube-dialog-btn border-top-1px action-cancel": true
|
|
|
'cube-dialog-btn border-top-1px action-cancel': true
|
|
|
},
|
|
|
slot: "btns"
|
|
|
slot: 'btns'
|
|
|
},
|
|
|
cancelBtn.text
|
|
|
),
|
|
|
createElement(
|
|
|
"p",
|
|
|
'p',
|
|
|
{
|
|
|
class: {
|
|
|
"action-dialog-content": true
|
|
|
'action-dialog-content': true
|
|
|
},
|
|
|
slot: "content"
|
|
|
slot: 'content'
|
|
|
},
|
|
|
content
|
|
|
)
|
|
|
];
|
|
|
}).show();
|
|
|
},
|
|
|
onActionConfirm() {}
|
|
|
onActionConfirm() {
|
|
|
}
|
|
|
}
|
|
|
};
|
|
|
</script>
|
...
|
...
|
|