123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258 |
- <!--<template>-->
- <!-- <view class="order-page">-->
- <!-- 1111111111111111111-->
- <!-- <van-tabs v-model="activeTab" title-active-color="#ee0a24" color="#333" swipe-threshold="5" animated sticky offset-top="46" @change="handleTabChange">-->
- <!-- <van-tab title="全部">-->
- <!--<!– <order-list :orders="allOrders" />–>-->
- <!-- </van-tab>-->
- <!-- <van-tab title="待付款">-->
- <!--<!– <order-list :orders="unpaidOrders" />–>-->
- <!-- </van-tab>-->
- <!-- <van-tab title="待送达">-->
- <!--<!– <order-list :orders="unreceivedOrders" />–>-->
- <!-- </van-tab>-->
- <!-- <van-tab title="已送达">-->
- <!--<!– <order-list :orders="refundOrders" />–>-->
- <!-- </van-tab>-->
- <!-- <van-tab title="已完成">-->
- <!--<!– <order-list :orders="completedOrders" />–>-->
- <!-- </van-tab>-->
- <!-- </van-tabs>-->
- <!-- </view>-->
- <!--</template>-->
- <!--<script>-->
- <!--import {mapState,mapMutations,mapGetters,mapActions} from 'vuex'-->
- <!--export default {-->
- <!-- components: {-->
- <!-- OrderList-->
- <!-- },-->
- <!-- data() {-->
- <!-- return {-->
- <!-- activeTab: 0,-->
- <!-- orders: [-->
- <!-- {-->
- <!-- address: {-->
- <!-- address: "江西财经大学枫林园",-->
- <!-- doorNo: "2#524",-->
- <!-- id: 9,-->
- <!-- phone: "12345678910",-->
- <!-- recipientName: "瑶妹",-->
- <!-- userId: 1-->
- <!-- },-->
- <!-- addressId: 9,-->
- <!-- bidPay: 10,-->
- <!-- id: 42,-->
- <!-- orderProductsLists: [],-->
- <!-- orderRemark: "我要大的橘子",-->
- <!-- orderState: "已送达",-->
- <!-- orderTypeId: null,-->
- <!-- originPay: 14.5,-->
- <!-- storeId: 1,-->
- <!-- timeOrder: "2024-05-05 01:48:28",-->
- <!-- timePre: "2024-05-05 01:48:39",-->
- <!-- transCode: "1786815170015203328",-->
- <!-- user: {-->
- <!-- account: null,-->
- <!-- addressIds: null,-->
- <!-- avatar: null,-->
- <!-- id: 1,-->
- <!-- name: "爱喝茶的小淮",-->
- <!-- newPassword: null,-->
- <!-- openid: "1243214213",-->
- <!-- password: null,-->
- <!-- phone: "12345678910",-->
- <!-- role: "USER",-->
- <!-- sex: "男",-->
- <!-- token: null,-->
- <!-- username: "user"-->
- <!-- },-->
- <!-- userId: 1-->
- <!-- }-->
- <!-- ]-->
- <!-- };-->
- <!-- },-->
- <!-- computed: {-->
- <!-- allOrders() {-->
- <!-- return this.orders;-->
- <!-- },-->
- <!-- unpaidOrders() {-->
- <!-- return this.orders.filter(order => order.orderState === "待付款");-->
- <!-- },-->
- <!-- unreceivedOrders() {-->
- <!-- return this.orders.filter(order => order.orderState === "待送达");-->
- <!-- },-->
- <!-- refundOrders() {-->
- <!-- return this.orders.filter(order => order.orderState === "已送达");-->
- <!-- },-->
- <!-- completedOrders() {-->
- <!-- return this.orders.filter(order => order.orderState === "已完成");-->
- <!-- }-->
- <!-- },-->
- <!-- methods: {-->
- <!-- ...mapActions('m_order',['fetchOrder']),-->
- <!-- ...mapGetters('m_order',['getOrder']),-->
- <!-- handleTabChange(index) {-->
- <!-- this.activeTab = index;-->
- <!-- this.fetchOrder();-->
- <!-- //三秒后-->
- <!-- setTimeout(() => {-->
- <!-- this.orders = this.getOrder();-->
- <!-- }, 3000);-->
- <!-- console.log(this.allOrders, 'eeeee')-->
- <!-- }-->
- <!-- }-->
- <!--};-->
- <!--</script>-->
- <!--<style lang="scss">-->
- <!--.order-page {-->
- <!-- padding: 10px;-->
- <!-- background-color: #f5f5f5;-->
- <!-- .van-tabs {-->
- <!-- --van-tabs-bottom-bar-color: #ee0a24;-->
- <!-- }-->
- <!-- .van-tab {-->
- <!-- font-size: 14px;-->
- <!-- }-->
- <!--}-->
- <!--</style>-->
- <template>
- <view>
- <van-tabs :active="active" @change="onChange" swipeable sticky :ellipsis="false">
- <van-tab title="全部">
- <order-list :orders="allOrders"></order-list>
- </van-tab>
- <van-tab title="待付款">
- <order-list :orders="unpaidOrders"></order-list>
- </van-tab>
- <van-tab title="待送达">
- <order-list :orders="unreceivedOrders"></order-list>
- </van-tab>
- <van-tab title="已送达">
- <order-list :orders="refundOrders"></order-list>
- </van-tab>
- <van-tab title="已完成">
- <order-list :orders="completedOrders"></order-list>
- </van-tab>
- </van-tabs>
- </view>
- </template>
- <script>
- import OrderAll from "@/components/orders/order-all/order-all.vue";
- import {mapState,mapMutations,mapGetters,mapActions} from 'vuex'
- export default {
- components: {OrderAll},
- onLoad() {
- this.orders = this.getOrders();
- this.fetchOrder();
- console.log(this.orders,"thid")
- },
- data() {
- return {
- active: this.query.pagetype ? parseInt(this.query.pagetype): 0,
- orders:
- [
- {
- address: {
- address: "江西财经大学枫林园",
- doorNo: "2#524",
- id: 9,
- phone: "12345678910",
- recipientName: "瑶妹",
- userId: 1
- },
- addressId: 9,
- bidPay: 10,
- id: 42,
- orderProductsLists: [
- ],
- orderRemark: "我要大的橘子",
- orderState: "已送达",
- orderTypeId: null,
- originPay: 14.5,
- storeId: 1,
- timeOrder: "2024-05-05 01:48:28",
- timePre: "2024-05-05 01:48:39",
- transCode: "1786815170015203328",
- user:{
- account: null,
- addressIds: null,
- avatar: null,
- id: 1,
- name: "爱喝茶的小淮",
- newPassword: null,
- openid: "1243214213",
- password: null,
- phone: "12345678910",
- role: "USER",
- sex: "男",
- token: null,
- username: "user"
- },
- userId:1
- }
- ]
- };
- },
- props: {
- },
- computed: {
- allOrders() {
- return this.orders;
- },
- unpaidOrders() {
- return this.orders.filter(order => order.orderState === "待付款");
- },
- unreceivedOrders() {
- return this.orders.filter(order => order.orderState === "待送达");
- },
- refundOrders() {
- return this.orders.filter(order => order.orderState === "已送达");
- },
- completedOrders() {
- return this.orders.filter(order => order.orderState === "已完成");
- }
- },
- methods: {
- ...mapActions('m_order',['fetchOrder']),
- ...mapGetters('m_order',['getOrders']),
- onLoad(options) {
- // console.log(options.pagetype,"pagetype")
- this.orders=this.getOrders()
- this.fetchOrder()
- if(options.pagetype){
- this.active = parseInt(options.pagetype)
- }
- },
- onChange(event) {
- console.log(event)
- this.active = event.detail.index
- this.fetchOrder()
- console.log(this.getOrders(),'eeeee')
- this.orders=this.getOrders()
- // console.log(this.query().pagetype,'eeeee')
- },
- query() {
- return this.$route.query
- }
- }
- }
- </script>
- <style lang="scss">
- page { background-color: #8f8f94; }
- </style>
|