order-query.vue 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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. onUnmounted
  18. } from 'vue'
  19. import { onLoad, onShow } from '@dcloudio/uni-app'
  20. const query = reactive({
  21. searchType: 2,
  22. search: ''
  23. })
  24. //订单查询 /app/stock/findOrder
  25. const orderQuery = () => {
  26. if (!query.search) {
  27. uni.$u.toast('请输入快递单号/订单编号')
  28. return
  29. }
  30. uni.navigateTo({
  31. url: `/pages/index/wms/order-query-list?id=${query.search}`
  32. })
  33. }
  34. function openScan() {
  35. uni.scanCode({
  36. success: (res) => {
  37. query.search = res.result
  38. orderQuery()
  39. }
  40. })
  41. }
  42. onLoad(() => {
  43. // #ifdef APP-PLUS
  44. uni.$u.useGlobalEvent((e) => {
  45. query.search = e.barcode
  46. })
  47. // #endif
  48. })
  49. onShow(() => {
  50. uni.$u.updateActivePageOnShow()
  51. })
  52. onUnmounted(() => {
  53. uni.$u.cleanupOnPageUnload();
  54. });
  55. </script>
  56. <style lang="scss" scoped>
  57. .header {
  58. display: flex;
  59. justify-content: space-between;
  60. padding: 20rpx 30rpx;
  61. background-color: #ffffff;
  62. }
  63. .status {
  64. color: green;
  65. }
  66. .log-item {
  67. display: flex;
  68. justify-content: space-between;
  69. padding: 20rpx 30rpx;
  70. border-bottom: 1px solid #e0e0e0;
  71. }
  72. </style>