Authored by lea guo

订单列表操作

... ... @@ -11,7 +11,11 @@
<li v-for="order in orderList" :key="order.orderCode">
<order-list-item :order="order" />
<div class="actions">
<Button v-for="action in order.buttons" :key="action.code">
<Button
v-for="action in order.buttons"
:key="action.code"
@click="onAction"
>
{{ action.text }}
</Button>
</div>
... ... @@ -58,7 +62,8 @@ export default {
...mapActions(["fetchOrderList"]),
fetchMore() {
this.fetchOrderList(this.$route.params);
}
},
onAction() {}
},
watch: {
$route() {
... ...
... ... @@ -65,3 +65,45 @@ export const buyerOrderStatusList = [
text: '待收货',
},
];
// 订单操作
// ts IOrderAction[]
export const orderActions = [
{
code: 'del_order',
name: 'DEL_ORDER',
text: '删除',
},
{ code: 'buy_again', name: 'BUY_AGAIN', text: '再次购买' },
{
code: 'show_detail',
name: 'SHOW_DETAIL',
text: '查看详情',
},
{
code: 'show_express',
name: 'SHOW_EXPRESS',
text: '查看物流',
},
{
code: 'confirm_delivery',
name: 'CONFIRM_DELIVERY',
text: '确认收货',
},
{
code: 'sold_again',
name: 'SOLD_AGAIN',
text: '再次出售',
},
{
code: 'not_sold',
confirmTips: '您确定不卖此商品吗?',
name: 'NOT_SOLD',
text: '不卖了',
},
{
code: 'pay_earnestMoney',
name: 'PAY_EARNESTMONEY',
text: '支付保证金',
},
];
... ...
... ... @@ -44,8 +44,9 @@ module.exports = (req, res, next) => {
};
}
// Todo 删除
req.user.uid = 600043484;
// Todo 删除 600043484
req.user.uid = 600032996;
res.locals.isLogin = Boolean(req.user.uid); // 用户是否登录
if (_.get(req, 'user.appSessionType') === 'miniapp') {
... ...
... ... @@ -26,4 +26,11 @@ declare module 'yoho' {
expressType: number;
state: number;
}
interface IOrderAction {
code: string;
name: string;
confirmTips?: string;
text: string;
}
}
... ...