|
|
- <template>
- <view class="cart">
- <view class="head-box"></view>
- <Navbar title="我的订单" :bgColor="bgColor" leftIconSize="0px" height="100rpx" :titleStyle="{color:fontColor}" />
- <view class="content contentPosition_">
- <uv-sticky offsetTop="220rpx" :bgColor="bgColor">
- <uv-tabs :scrollable="false" @click="tabs" :list="tabList" lineWidth="40"
- :lineColor="`url(${lineBg}) 100% 100%`"
- :activeStyle="{color: '#FD5C5C', fontWeight: 'bold',transform: 'scale(1.05)'}"
- :inactiveStyle="{color: '#999', transform: 'scale(1)'}"
- itemStyle="padding-left: 15px; padding-right: 15px; height: 44px;"></uv-tabs>
- </uv-sticky>
- <cardList :cardListData="cardListData" @btnClick="btnClick" @toOrderDetails="toOrderDetails" />
- <uv-load-more :status="status" fontSize="24rpx" dashed line />
- </view>
- <tabber select="cart" />
- </view>
- </template>
-
- <script>
- import tabber from '@/components/base/tabbar.vue'
- import cardList from '@/components/cart/CardList.vue'
- import Navbar from '@/pages/components/Navbar.vue'
- import {
- globalMixin
- } from '../mixins/globalMixin';
-
- export default {
- mixins: [globalMixin],
- components: {
- tabber,
- cardList,
- Navbar
- },
- data() {
- return {
- status:"loading",
- params: {
- state: 0,
- pageNo: 1,
- pageSize: 10
- },
- tabList: [{
- id: '',
- name: '全部'
- },
- {
- id: 0,
- name: '未付款'
- },
- {
- id: 1,
- name: '待参加'
- },
- {
- id: 2,
- name: '已完成'
- },
- {
- id: 3,
- name: '已取消'
- },
- ],
- lineBg: require('@/static/image/cart/tabIcon.png'),
- // cardListData: [{
- // imgUrl: 'https://up.zhuoku.org/22/a4/60/50/fc3bd0b4e656911fccdde4383637c1cd.jpg',
- // orderTime: '2024.08.23 12:00',
- // state: 'U',
- // stateText: '待参加',
- // title: '夏日去撒野旅游计划~',
- // time: '2024.10.28 10:00',
- // address: '成都市东丽湖露营地32号',
- // totalPrice: '298.00',
- // btnObj: [{
- // id: '0',
- // btnTitle: '取消活动',
- // color: '#AFAFAF',
- // bgColor: '#34312E'
- // },
- // {
- // id: '1',
- // btnTitle: '活动签到',
- // color: '#FF4546',
- // bgColor: '#492623'
- // }
- // ]
- // },
- // {
- // imgUrl: 'https://up.zhuoku.org/22/a4/60/50/fc3bd0b4e656911fccdde4383637c1cd.jpg',
- // orderTime: '2024.08.23 12:00',
- // state: 'S',
- // stateText: '已完成',
- // title: '夏日去撒野旅游计划~',
- // time: '2024.10.28 10:00',
- // address: '成都市东丽湖露营地32号',
- // totalPrice: '298.00',
- // btnObj: [{
- // id: '2',
- // btnTitle: '活动评价',
- // color: '#FF4546',
- // bgColor: '#492623'
- // },
- // {
- // id: '3',
- // btnTitle: '开具发票',
- // color: '#FFB245',
- // bgColor: '#49361D'
- // }
- // ]
- // },
- // {
- // imgUrl: 'https://up.zhuoku.org/22/a4/60/50/fc3bd0b4e656911fccdde4383637c1cd.jpg',
- // orderTime: '2024.08.23 12:00',
- // state: 'F',
- // stateText: '已完成',
- // title: '夏日去撒野旅游计划~',
- // time: '2024.10.28 10:00',
- // address: '成都市东丽湖露营地32号',
- // totalPrice: '298.00',
- // btnObj: []
- // }
- // ]
- totalPage: 0,
- cardListData: []
- }
- },
- onReachBottom() {
- if (this.params.pageNo >= this.totalPage) return
- this.params.pageNo++
- this.getOrderPageList()
- },
- onLoad() {
- this.getOrderPageList()
- },
- methods: {
- activeList() {
- uni.navigateTo({
- url: '/pages_my/activeList'
- })
- },
- getOrderPageList() {
- this.status = "loading"
- this.$api('orderPageList', this.params, res => {
- if (res.code == 200) {
- this.totalPage = res.result.pages
- this.cardListData = [...this.cardListData, ...res.result.records]
- if(this.params.pageNo >= this.totalPage) {
- this.status = "nomore"
- }else {
- this.status = "loadmore"
- }
- }
- })
- },
- tabs(val) {
- this.params.state = val.id
- this.params.pageNo = 1
- this.cardListData = []
- this.getOrderPageList()
- },
- toOrderDetails(val) {
- uni.navigateTo({
- url: `/pages_order/orderDetails?id=${val.id}`
- })
- },
- btnClick(item,type) {//0取消活动 1活动签到 2评价活动 3开具发票
- if (type == 2) {
- uni.navigateTo({
- url: '/pages_order/orderEvaluation'
- })
- }
- if (type == 3) {
- uni.navigateTo({
- url: '/pages_order/invoiceIssuance'
- })
- }
- }
- }
- }
- </script>
-
- <style scoped lang="scss">
- .content {
- padding-bottom: 200rpx;
- }
- </style>
|