bad-out.vue 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <template>
  2. <view class="container flex-d h100">
  3. <!-- 库位列表 -->
  4. <view class="location-list flex-1">
  5. <view class="no-data flex-c mt-60">请输入快递单号/订单编号</view>
  6. </view>
  7. <!-- 底部搜索框 -->
  8. <view class="pad-20 flex-a" style="background: #ffffff;">
  9. <u-search v-model="searchText" placeholder="请输入库位条码" :show-action="false" :clearabled="true"
  10. @change="onSearch" height="40" @click="searchText = ''">
  11. </u-search>
  12. <u-icon name="scan" size="28" color="#19be6b" @click="openScan"></u-icon>
  13. </view>
  14. </view>
  15. </template>
  16. <script setup>
  17. import { ref, computed, onMounted } from 'vue'
  18. // 搜索文本
  19. const searchText = ref('')
  20. // 搜索处理
  21. const onSearch = () => {
  22. // 实现搜索逻辑
  23. uni.navigateTo({
  24. url: `/pages/index/wms/bad-out-order?searchText=${searchText.value}`
  25. })
  26. }
  27. // 打开扫码
  28. const openScan = () => {
  29. // #ifdef APP-PLUS || MP-WEIXIN
  30. uni.scanCode({
  31. success: (res) => {
  32. searchText.value = res.result
  33. onSearch()
  34. },
  35. fail: (err) => {
  36. uni.showToast({
  37. title: '扫码失败',
  38. icon: 'error'
  39. })
  40. }
  41. })
  42. // #endif
  43. // #ifdef H5
  44. uni.showToast({
  45. title: 'H5环境不支持扫码',
  46. icon: 'none'
  47. })
  48. // #endif
  49. }
  50. </script>