order.vue 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  1. <template>
  2. <view class="container" :style="containerStyle">
  3. <view class="tabs">
  4. <u-navbar :is-back="false" title="订单中心"></u-navbar>
  5. <scroll-view scroll-x class="bg-white nav">
  6. <view class="flex text-center">
  7. <view class="cu-item flex-sub" :class="index==current?'text-base cur text-xl text-bold ':'text-lg'"
  8. v-for="(item,index) in tabs" :key="index" @tap="tabChange(index)">
  9. {{item.name}}
  10. <text class="cuIcon-filter" v-if="index==current&& !$util.objectKeyIsEmpty (form)"></text>
  11. </view>
  12. </view>
  13. </scroll-view>
  14. </view>
  15. <view style="height: 100%;">
  16. <swiper style="height: 100%;" :current="current" @change="swiperChange" @animationfinish="animationfinish">
  17. <swiper-item v-for="(item,index) in tabs" :key="index">
  18. <scroll-view scroll-y style="height: 100%;">
  19. <item ref="mescrollItem" :i="index" :item="item" :type="current"></item>
  20. </scroll-view>
  21. </swiper-item>
  22. </swiper>
  23. <view class="u-tabbar">
  24. <u-tabbar :height="tabbar.height" @change="tabbarChange" v-model="tabbarCurr"
  25. :icon-size="tabbar.iconSize" :active-color="tabbar.activeColor"
  26. :mid-button-size="tabbar.MinButtonSize" :list="tabbar.list" :mid-button="false">
  27. </u-tabbar>
  28. </view>
  29. </view>
  30. <u-popup v-model="searchShow" mode="bottom" :closeable="true">
  31. <view class="padding-30">
  32. <u-form :model="form" ref="uForm" label-width="170">
  33. <u-form-item label="取货号码">
  34. <u-input v-model="form.verifyNum" />
  35. </u-form-item>
  36. <u-form-item label="下单日期">
  37. <u-input disabled type="select" :select-open="timeShow" v-model="form.orderDate"
  38. @click="timeShow=true" />
  39. </u-form-item>
  40. </u-form>
  41. <view class="center margin-50" >
  42. <view @click="reset" class="cu-btn radius line-gray" style="width: 45%;height: 70rpx;margin-right: 20rpx;">
  43. 重置
  44. </view>
  45. <view @click="search" class="cu-btn radius bg-base" style="width: 45%;height: 70rpx;margin-left: 20rpx;">
  46. 搜索
  47. </view>
  48. </view>
  49. </view>
  50. </u-popup>
  51. <u-picker mode="time" v-model="timeShow" :params="timeParams" @confirm="confirm" confirm-color="#EF9944"></u-picker>
  52. </view>
  53. </template>
  54. <script>
  55. import item from "./comps/item.vue"
  56. import {
  57. tabbar
  58. } from "../../assert/js/tarbar.js"
  59. export default {
  60. components: {
  61. item
  62. },
  63. data() {
  64. return {
  65. containerStyle: '',
  66. timeParams: {
  67. year: true,
  68. month: true,
  69. day: true,
  70. hour: false,
  71. minute: false,
  72. second: false
  73. },
  74. timeShow: false,
  75. searchShow: false,
  76. form:{
  77. verifyNum:'',
  78. orderDate:''
  79. },
  80. //tabbar
  81. tabbarCurr: 2,
  82. tabbar: tabbar,
  83. current: 0,
  84. swiperCurrent: 0,
  85. tabs: [{
  86. name: '待确认',
  87. value: '制作中'
  88. },
  89. {
  90. name: '已完成',
  91. value: '已完成'
  92. }
  93. ],
  94. }
  95. },
  96. onLoad() {
  97. },
  98. onReady() {
  99. this.getElInfo()
  100. },
  101. methods: {
  102. search(){
  103. this.$refs.mescrollItem[this.current].search(this.form)
  104. this.searchShow=false
  105. },
  106. confirm(e){
  107. this.form.orderDate=e.year+'-'+e.month +'-'+ e.day
  108. },
  109. reset(){
  110. this.form={
  111. verifyNum:'',
  112. orderDate:''
  113. }
  114. this.search()
  115. },
  116. async getElInfo() {
  117. let rectInfo = await this.$u.getRect('.u-tabbar');
  118. this.containerStyle = `height: calc(100vh - ${rectInfo.height}px)`
  119. },
  120. tabbarChange(index) {
  121. if (index == 0) {
  122. uni.redirectTo({
  123. url: "/pagesGoods/pages/menu/menu"
  124. })
  125. } else if (index == 1) {
  126. this.searchShow = !this.searchShow
  127. } else if (index == 2) {
  128. uni.redirectTo({
  129. url: "/pagesGoods/pages/my-shop/my-shop"
  130. })
  131. }
  132. },
  133. tabChange(index) {
  134. this.current = index
  135. },
  136. swiperChange(e) {
  137. uni.pageScrollTo({
  138. scrollTop: 0,
  139. duration: 0
  140. });
  141. this.current = e.detail.current
  142. },
  143. animationfinish({
  144. detail: {
  145. current
  146. }
  147. }) {
  148. this.swiperCurrent = current;
  149. this.current = current;
  150. },
  151. }
  152. }
  153. </script>
  154. <style lang="scss" scoped>
  155. .text-xl {
  156. font-size: 34rpx;
  157. }
  158. .container {
  159. height: calc(100vh - 180rpx);
  160. background-color: #F6F6F6;
  161. padding: 242rpx 0rpx 0rpx;
  162. .tabs {
  163. position: fixed;
  164. top: -10rpx;
  165. left: 0;
  166. width: 100%;
  167. background-color: #FFFFFF;
  168. box-sizing: border-box;
  169. z-index: 3;
  170. }
  171. }
  172. </style>