|
@@ -12,42 +12,42 @@
|
|
|
finished-text="没有更多了"
|
|
finished-text="没有更多了"
|
|
|
@load="getOrderList">
|
|
@load="getOrderList">
|
|
|
<van-panel v-for="(el, i) in orderList"
|
|
<van-panel v-for="(el, i) in orderList"
|
|
|
- class="order_list--panel"
|
|
|
|
|
:key="i"
|
|
:key="i"
|
|
|
:title="'订单编号: ' + el.orderSn"
|
|
:title="'订单编号: ' + el.orderSn"
|
|
|
- :status="el.orderStatusText">
|
|
|
|
|
- <div>
|
|
|
|
|
- <van-card v-for="(goods, goodsI) in el.goodsList"
|
|
|
|
|
- class="order_list--van-card"
|
|
|
|
|
- :key="goodsI"
|
|
|
|
|
- :title="goods.goodsName"
|
|
|
|
|
- :num="goods.number"
|
|
|
|
|
- :thumb="goods.picUrl"
|
|
|
|
|
- @click.native="toOrderDetail(el.id)">
|
|
|
|
|
- <div slot="desc">
|
|
|
|
|
- <div class="van-card__desc">
|
|
|
|
|
- <van-tag plain
|
|
|
|
|
- style="margin-right:6px;"
|
|
|
|
|
- v-for="(spec, index) in goods.specifications"
|
|
|
|
|
- :key="index">
|
|
|
|
|
- {{spec}}
|
|
|
|
|
- </van-tag>
|
|
|
|
|
- </div>
|
|
|
|
|
|
|
+ :status="el.orderStatusText"
|
|
|
|
|
+ @click.native="toOrderDetail(el.id)">
|
|
|
|
|
+ <van-card v-for="(goods, goodsI) in el.goodsList"
|
|
|
|
|
+ :key="goodsI"
|
|
|
|
|
+ :title="goods.goodsName"
|
|
|
|
|
+ :num="goods.number"
|
|
|
|
|
+ :thumb="goods.picUrl">
|
|
|
|
|
+ <div slot="desc">
|
|
|
|
|
+ <div class="desc">
|
|
|
|
|
+ <van-tag plain
|
|
|
|
|
+ style="margin-right:6px;"
|
|
|
|
|
+ v-for="(spec, index) in goods.specifications"
|
|
|
|
|
+ :key="index">
|
|
|
|
|
+ {{spec}}
|
|
|
|
|
+ </van-tag>
|
|
|
</div>
|
|
</div>
|
|
|
- </van-card>
|
|
|
|
|
- <div class="order_list--total">合计: {{el.actualPrice * 100 | yuan}}(含运费{{el.post_fee | yuan}})</div>
|
|
|
|
|
- </div>
|
|
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </van-card>
|
|
|
|
|
+ <div class="total">合计: {{el.actualPrice * 100 | yuan}}(含运费{{el.post_fee | yuan}})</div>
|
|
|
|
|
|
|
|
<div slot="footer"
|
|
<div slot="footer"
|
|
|
- class="order_list--footer_btn">
|
|
|
|
|
|
|
+ class="footer_btn">
|
|
|
<van-button size="small"
|
|
<van-button size="small"
|
|
|
- v-if="el.handleOption.cencel"
|
|
|
|
|
|
|
+ v-if="el.handleOption.cancel"
|
|
|
@click="cancelOrder(el.id)">取消订单</van-button>
|
|
@click="cancelOrder(el.id)">取消订单</van-button>
|
|
|
<van-button size="small"
|
|
<van-button size="small"
|
|
|
v-if="el.handleOption.pay"
|
|
v-if="el.handleOption.pay"
|
|
|
type="danger"
|
|
type="danger"
|
|
|
@click="toPay(el.id)">去支付</van-button>
|
|
@click="toPay(el.id)">去支付</van-button>
|
|
|
<van-button size="small"
|
|
<van-button size="small"
|
|
|
|
|
+ v-if="el.handleOption.refund"
|
|
|
|
|
+ type="danger"
|
|
|
|
|
+ @click="refundOrder(el.id)">退款</van-button>
|
|
|
|
|
+ <van-button size="small"
|
|
|
v-if="el.handleOption.confirm"
|
|
v-if="el.handleOption.confirm"
|
|
|
type="danger"
|
|
type="danger"
|
|
|
@click="confirmOrder(el.id)">确认收货</van-button>
|
|
@click="confirmOrder(el.id)">确认收货</van-button>
|
|
@@ -69,8 +69,8 @@
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
-import { orderList } from '@/api/api';
|
|
|
|
|
-
|
|
|
|
|
|
|
+import { orderList, orderDelete, orderConfirm, orderCancel, orderRefund } from '@/api/api';
|
|
|
|
|
+import _ from 'lodash';
|
|
|
import { Tab, Tabs, Panel, Card, List, Tag } from 'vant';
|
|
import { Tab, Tabs, Panel, Card, List, Tag } from 'vant';
|
|
|
|
|
|
|
|
export default {
|
|
export default {
|
|
@@ -115,34 +115,65 @@ export default {
|
|
|
this.finished = res.data.data.page >= res.data.data.pages;
|
|
this.finished = res.data.data.page >= res.data.data.pages;
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
- delOrder(i) {
|
|
|
|
|
- this.$dialog.confirm({ message: '确定要删除该订单吗?' });
|
|
|
|
|
- this.items.splice(i, 1);
|
|
|
|
|
- this.$toast('已删除该订单');
|
|
|
|
|
|
|
+ delOrder(id) {
|
|
|
|
|
+ let that = this;
|
|
|
|
|
+ this.$dialog
|
|
|
|
|
+ .confirm({ message: '确定要删除该订单吗?' })
|
|
|
|
|
+ .then(() => {
|
|
|
|
|
+ orderDelete({ orderId: id }).then(() => {
|
|
|
|
|
+ this.init();
|
|
|
|
|
+ this.$toast('已删除订单');
|
|
|
|
|
+ });
|
|
|
|
|
+ })
|
|
|
|
|
+ .catch(() => {});
|
|
|
},
|
|
},
|
|
|
cancelOrder(id) {
|
|
cancelOrder(id) {
|
|
|
- this.$dialog.confirm({ message: '确定要取消该订单吗?' });
|
|
|
|
|
- this.$toast('已取消该订单');
|
|
|
|
|
|
|
+ this.$dialog
|
|
|
|
|
+ .confirm({ message: '确定要取消该订单吗?' })
|
|
|
|
|
+ .then(() => {
|
|
|
|
|
+ orderDelete({ orderId: id }).then(() => {
|
|
|
|
|
+ this.init();
|
|
|
|
|
+ this.$toast('已取消该订单');
|
|
|
|
|
+ });
|
|
|
|
|
+ })
|
|
|
|
|
+ .catch(() => {});
|
|
|
},
|
|
},
|
|
|
|
|
+ refundOrder(id) {
|
|
|
|
|
+ this.$dialog
|
|
|
|
|
+ .confirm({ message: '确定要申请退款吗?' })
|
|
|
|
|
+ .then(() => {
|
|
|
|
|
+ orderRefund({ orderId: id }).then(() => {
|
|
|
|
|
+ this.init();
|
|
|
|
|
+ this.$toast('已申请订单退款');
|
|
|
|
|
+ });
|
|
|
|
|
+ })
|
|
|
|
|
+ .catch(() => {});
|
|
|
|
|
+ },
|
|
|
confirmOrder(id) {
|
|
confirmOrder(id) {
|
|
|
- this.$dialog.confirm({
|
|
|
|
|
- message: '请确认收到货物, 确认收货后无法撤销!'
|
|
|
|
|
- });
|
|
|
|
|
- this.$toast('已确认收货');
|
|
|
|
|
|
|
+ this.$dialog
|
|
|
|
|
+ .confirm({
|
|
|
|
|
+ message: '请确认收到货物, 确认收货后无法撤销!'
|
|
|
|
|
+ })
|
|
|
|
|
+ .then(() => {
|
|
|
|
|
+ orderConfirm({ orderId: id }).then(() => {
|
|
|
|
|
+ this.init();
|
|
|
|
|
+ this.$toast('已确认收货');
|
|
|
|
|
+ });
|
|
|
|
|
+ })
|
|
|
|
|
+ .catch(() => {});
|
|
|
},
|
|
},
|
|
|
commentOrder(id) {},
|
|
commentOrder(id) {},
|
|
|
toPay(id) {
|
|
toPay(id) {
|
|
|
this.$router.push({ name: 'payment', params: { orderId: id } });
|
|
this.$router.push({ name: 'payment', params: { orderId: id } });
|
|
|
},
|
|
},
|
|
|
- handleTabClick(index) {
|
|
|
|
|
- this.activeIndex = index;
|
|
|
|
|
|
|
+ handleTabClick() {
|
|
|
this.page = 0;
|
|
this.page = 0;
|
|
|
this.orderList = [];
|
|
this.orderList = [];
|
|
|
this.getOrderList();
|
|
this.getOrderList();
|
|
|
},
|
|
},
|
|
|
toOrderDetail(id) {
|
|
toOrderDetail(id) {
|
|
|
this.$router.push({
|
|
this.$router.push({
|
|
|
- name: 'orderDetail',
|
|
|
|
|
|
|
+ path: '/order/order-detail',
|
|
|
query: { orderId: id }
|
|
query: { orderId: id }
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
@@ -160,21 +191,24 @@ export default {
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
<style lang="scss" scoped>
|
|
|
.order_list {
|
|
.order_list {
|
|
|
- padding-bottom: 0;
|
|
|
|
|
- &--footer_btn {
|
|
|
|
|
- text-align: right;
|
|
|
|
|
- }
|
|
|
|
|
- &--panel {
|
|
|
|
|
- margin-bottom: 20px;
|
|
|
|
|
|
|
+ .van-panel {
|
|
|
|
|
+ margin-top: 20px;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- &--van-card {
|
|
|
|
|
|
|
+ .van-card {
|
|
|
background-color: #fff;
|
|
background-color: #fff;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- &--total {
|
|
|
|
|
|
|
+ .total {
|
|
|
text-align: right;
|
|
text-align: right;
|
|
|
padding: 10px;
|
|
padding: 10px;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ .footer_btn {
|
|
|
|
|
+ text-align: right;
|
|
|
|
|
+ .van-button {
|
|
|
|
|
+ margin-left: 10px;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
</style>
|
|
</style>
|