| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179 |
- <template>
- <view class="container" :style="containerStyle">
- <view class="tabs">
- <u-navbar :is-back="false" title="订单中心"></u-navbar>
- <scroll-view scroll-x class="bg-white nav">
- <view class="flex text-center">
- <view class="cu-item flex-sub" :class="index==current?'text-base cur text-xl text-bold ':'text-lg'"
- v-for="(item,index) in tabs" :key="index" @tap="tabChange(index)">
- {{item.name}}
- <text class="cuIcon-filter" v-if="index==current&& !$util.objectKeyIsEmpty (form)"></text>
- </view>
- </view>
- </scroll-view>
- </view>
- <view style="height: 100%;">
- <swiper style="height: 100%;" :current="current" @change="swiperChange" @animationfinish="animationfinish">
- <swiper-item v-for="(item,index) in tabs" :key="index">
- <scroll-view scroll-y style="height: 100%;">
- <item ref="mescrollItem" :i="index" :item="item" :type="current"></item>
- </scroll-view>
- </swiper-item>
- </swiper>
- <view class="u-tabbar">
- <u-tabbar :height="tabbar.height" @change="tabbarChange" v-model="tabbarCurr"
- :icon-size="tabbar.iconSize" :active-color="tabbar.activeColor"
- :mid-button-size="tabbar.MinButtonSize" :list="tabbar.list" :mid-button="false">
- </u-tabbar>
- </view>
- </view>
- <u-popup v-model="searchShow" mode="bottom" :closeable="true">
- <view class="padding-30">
- <u-form :model="form" ref="uForm" label-width="170">
- <u-form-item label="取货号码">
- <u-input v-model="form.verifyNum" />
- </u-form-item>
- <u-form-item label="下单日期">
- <u-input disabled type="select" :select-open="timeShow" v-model="form.orderDate"
- @click="timeShow=true" />
- </u-form-item>
- </u-form>
- <view class="center margin-50" >
- <view @click="reset" class="cu-btn radius line-gray" style="width: 45%;height: 70rpx;margin-right: 20rpx;">
- 重置
- </view>
- <view @click="search" class="cu-btn radius bg-base" style="width: 45%;height: 70rpx;margin-left: 20rpx;">
- 搜索
- </view>
- </view>
- </view>
- </u-popup>
- <u-picker mode="time" v-model="timeShow" :params="timeParams" @confirm="confirm" confirm-color="#EF9944"></u-picker>
- </view>
- </template>
- <script>
- import item from "./comps/item.vue"
- import {
- tabbar
- } from "../../assert/js/tarbar.js"
- export default {
- components: {
- item
- },
- data() {
- return {
- containerStyle: '',
- timeParams: {
- year: true,
- month: true,
- day: true,
- hour: false,
- minute: false,
- second: false
- },
- timeShow: false,
- searchShow: false,
- form:{
- verifyNum:'',
- orderDate:''
- },
- //tabbar
- tabbarCurr: 2,
- tabbar: tabbar,
- current: 0,
- swiperCurrent: 0,
- tabs: [{
- name: '待确认',
- value: '制作中'
- },
- {
- name: '已完成',
- value: '已完成'
- }
- ],
- }
- },
- onLoad() {
- },
- onReady() {
- this.getElInfo()
- },
- methods: {
- search(){
- this.$refs.mescrollItem[this.current].search(this.form)
- this.searchShow=false
- },
- confirm(e){
- this.form.orderDate=e.year+'-'+e.month +'-'+ e.day
- },
- reset(){
- this.form={
- verifyNum:'',
- orderDate:''
- }
- this.search()
- },
- async getElInfo() {
- let rectInfo = await this.$u.getRect('.u-tabbar');
- this.containerStyle = `height: calc(100vh - ${rectInfo.height}px)`
- },
- tabbarChange(index) {
- if (index == 0) {
- uni.redirectTo({
- url: "/pagesGoods/pages/menu/menu"
- })
- } else if (index == 1) {
- this.searchShow = !this.searchShow
- } else if (index == 2) {
- uni.redirectTo({
- url: "/pagesGoods/pages/my-shop/my-shop"
- })
- }
- },
- tabChange(index) {
- this.current = index
- },
- swiperChange(e) {
- uni.pageScrollTo({
- scrollTop: 0,
- duration: 0
- });
- this.current = e.detail.current
- },
- animationfinish({
- detail: {
- current
- }
- }) {
- this.swiperCurrent = current;
- this.current = current;
- },
- }
- }
- </script>
- <style lang="scss" scoped>
- .text-xl {
- font-size: 34rpx;
- }
- .container {
- height: calc(100vh - 180rpx);
- background-color: #F6F6F6;
- padding: 242rpx 0rpx 0rpx;
- .tabs {
- position: fixed;
- top: -10rpx;
- left: 0;
- width: 100%;
- background-color: #FFFFFF;
- box-sizing: border-box;
- z-index: 3;
- }
- }
- </style>
|