order-query.vue 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. <template>
  2. <view class="container">
  3. <!-- 底部扫码输入框 -->
  4. <view class="fixed-bottom pad-20" style="background: #ffffff;">
  5. <u-search placeholder="请输入快递单号/订单编号" :searchIconSize="24" bgColor="#f6f7f6"
  6. @search="orderQuery" v-model="query.search" custom-style="font-size:32rpx"
  7. placeholder-style="font-size:32rpx" :clearabled="true" :focus="false" :showAction="false"
  8. :height="42"></u-search>
  9. <u-icon name="scan" size="34" color="#19be6b" @click="openScan"></u-icon>
  10. </view>
  11. </view>
  12. </template>
  13. <script setup>
  14. import {
  15. reactive,
  16. ref
  17. } from 'vue'
  18. import { onLoad, onShow } from '@dcloudio/uni-app'
  19. const query = reactive({
  20. searchType: 2,
  21. search: ''
  22. })
  23. //订单查询 /app/stock/findOrder
  24. const orderQuery = () => {
  25. if (!query.search) {
  26. uni.$u.toast('请输入快递单号/订单编号')
  27. return
  28. }
  29. uni.navigateTo({
  30. url: `/pages/index/wms/order-query-list?id=${query.search}`
  31. })
  32. }
  33. function openScan() {
  34. uni.scanCode({
  35. success: (res) => {
  36. query.search = res.result
  37. orderQuery()
  38. }
  39. })
  40. }
  41. onLoad(() => {
  42. // #ifdef APP-PLUS
  43. uni.$u.useGlobalEvent((e) => {
  44. if (e.barcode) {
  45. query.search = e.barcode
  46. orderQuery()
  47. }
  48. })
  49. // #endif
  50. })
  51. onShow(() => {
  52. uni.$u.updateActivePageOnShow()
  53. })
  54. </script>
  55. <style lang="scss" scoped>
  56. .header {
  57. display: flex;
  58. justify-content: space-between;
  59. padding: 20rpx 30rpx;
  60. background-color: #ffffff;
  61. }
  62. .status {
  63. color: green;
  64. }
  65. .log-item {
  66. display: flex;
  67. justify-content: space-between;
  68. padding: 20rpx 30rpx;
  69. border-bottom: 1px solid #e0e0e0;
  70. }
  71. </style>