order-query.vue 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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. // #ifdef APP-PLUS
  43. const { unregister } = uni.$u.useEventListener((e) => {
  44. query.search = e.barcode
  45. });
  46. // #endif
  47. onUnmounted(() => {
  48. // #ifdef APP-PLUS
  49. unregister();
  50. // #endif
  51. });
  52. </script>
  53. <style lang="scss" scoped>
  54. .header {
  55. display: flex;
  56. justify-content: space-between;
  57. padding: 20rpx 30rpx;
  58. background-color: #ffffff;
  59. }
  60. .status {
  61. color: green;
  62. }
  63. .log-item {
  64. display: flex;
  65. justify-content: space-between;
  66. padding: 20rpx 30rpx;
  67. border-bottom: 1px solid #e0e0e0;
  68. }
  69. </style>