| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889 |
- <template>
- <view class="container flex-d h100" @click="playGlobalSound">
- <!-- 库位列表 -->
- <view class="location-list flex-1">
- <view class="no-data flex-c mt-60">请输入快递单号/订单编号</view>
- </view>
- <!-- 底部搜索框 -->
- <view class="pad-20 flex flex-column" style="background: #ffffff">
- <u-radio-group v-model="searchType" class="mb-20 ml-20">
- <u-radio label="查订单" name="1" label-size="17" />
- <u-radio label="查物流" custom-style="margin-left:20px" name="2" label-size="17" />
- </u-radio-group>
- <view class="flex-a">
- <u-search
- v-model="searchText"
- placeholder="请输入快递单号/订单编号"
- :show-action="false"
- :clearabled="true"
- @search="onSearch"
- height="40"
- >
- </u-search>
- <u-icon name="scan" size="28" color="#19be6b" @click="openScan"></u-icon>
- </view>
- </view>
- </view>
- </template>
- <script setup>
- import { ref, computed, onMounted } from "vue";
- import { onLoad, onShow } from "@dcloudio/uni-app";
- // 搜索文本
- const searchText = ref("");
- const searchType = ref("1");
- // 点击全局音效
- function playGlobalSound(){
- uni.$u.playClickSound()
- }
- // 搜索处理
- const onSearch = () => {
- // 实现搜索逻辑
- uni.navigateTo({
- url: `/pages/index/wms/bad-out-order?searchText=${searchText.value}&searchType=${searchType.value}`,
- });
- };
- // 打开扫码
- const openScan = () => {
- // #ifdef APP-PLUS || MP-WEIXIN
- uni.scanCode({
- success: (res) => {
- searchText.value = res.result;
- onSearch();
- },
- fail: (err) => {
- uni.showToast({
- title: "扫码失败",
- icon: "error",
- });
- },
- });
- // #endif
- // #ifdef H5
- uni.showToast({
- title: "H5环境不支持扫码",
- icon: "none",
- });
- // #endif
- };
- onLoad(() => {
- // #ifdef APP-PLUS
- uni.$u.useGlobalEvent((e) => {
- if (e.barcode) {
- searchText.value = e.barcode
- onSearch()
- }
- })
- // #endif
- })
- onShow(() => {
- uni.$u.updateActivePageOnShow()
- })
- </script>
|