修改扫码搜索

This commit is contained in:
cc_zbp 2023-05-19 10:19:00 +08:00
parent 7287705856
commit b0785d6b9f
3 changed files with 69 additions and 24 deletions

View File

@ -1,13 +1,12 @@
// +----------------------------------------------------------------------
// | CRMEB [ CRMEB赋能开发者助力企业发展 ]
// +----------------------------------------------------------------------
// | Copyright (c) 2016~2021 https://www.crmeb.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed CRMEB并不是自由软件未经许可不能去掉CRMEB相关版权
// +----------------------------------------------------------------------
// | Author: CRMEB Team <admin@crmeb.com>
// +----------------------------------------------------------------------
import request from "@/utils/request.js";
/**
* 商品扫码枪查询商品是否存在
*
*/
export function seachBarCodeAPI(data) {
return request.get("micro/seach_bar_code", data);
}
/**
* 获取里海云仓商品
*

View File

@ -4,8 +4,8 @@
<u-empty :show="jurisdiction" marginTop="260" mode="permission" :text="emptyText"
icon="http://cdn.uviewui.com/uview/empty/permission.png"></u-empty>
<block v-if="isLogin">
<view class="special_work com" v-if="userInfoData.mer_info.type_id === 12">
<!-- <view class="special_work com" v-if="true"> -->
<!-- <view class="special_work com" v-if="userInfoData.mer_info.type_id === 12"> -->
<view class="special_work com" v-if="true">
<view class="title">市级供应链</view>
<view class="content">
<view class="examine" @click="navigator(`/pages/nongKe/supply_chain/goods_list?merid=${mer_id}`)">
@ -38,8 +38,8 @@
</view>
</view>
<view class="business com" v-if="userInfoData.mer_info.type_id === 10">
<!-- <view class="business com" v-if="true"> -->
<!-- <view class="business com" v-if="userInfoData.mer_info.type_id === 10"> -->
<view class="business com" v-if="true">
<view class="special_work com">
<view class="title">我的店铺</view>
<view class="content ">
@ -99,8 +99,8 @@
<!-- <gatherBusiness :userInfoData="userInfoData" /> -->
</view>
<view class="business com" v-if="userInfoData.mer_info.type_id === 11">
<!-- <view class="business com" v-if="true"> -->
<!-- <view class="business com" v-if="userInfoData.mer_info.type_id === 11"> -->
<view class="business com" v-if="true">
<view class="special_work com">
<view class="title">里海云仓</view>
<view class="content ">

View File

@ -32,12 +32,25 @@
</view>
</u-popup>
<u-popup :show="searchGoodsShow" @close="searchGoodsClose" :round="18" mode="center">
<view class="search_goods_box">
<input type="text" v-model="searchGoodsName" class="searchGoods" placeholder="请输入商品名称">
<view class="edit_goods_btn">
<u-button type="error" text="取消" class="edit_btn" @click="searchGoodsShow=false">
</u-button>
<u-button type="primary" text="保存" class="edit_btn" @click="searchGoodsClose">
</u-button>
</view>
</view>
</u-popup>
</view>
</template>
<script>
import { microSeachBarCode, microEadtProduct } from '@/api/store.js'
import { Toast } from '../../../libs/uniApi'
import { seachBarCodeAPI } from '@/api/api.js'
import { Toast } from '@/libs/uniApi'
export default {
data() {
return {
@ -58,7 +71,9 @@
editGoodsPrice: '',
editGoodsStore: '',
editGoodsShow: false, //
mer_id: ''
mer_id: '',
searchGoodsShow: true,
searchGoodsName: ''
}
},
onLoad(e) {
@ -66,6 +81,18 @@
},
onShow() {},
methods: {
openSearch() {
},
async searchGoodsClose() {
const rq = {
mer_id: this.mer_id,
name: this.searchGoodsName
}
const { data } = await seachBarCodeAPI(rq).catch(err => Toast(err))
console.log('data', data);
this.searchGoodsShow = false
},
async editGoodsClose() {
const data = {
price: this.editGoodsPrice,
@ -83,13 +110,9 @@
},
navigato(type) {
if (type === 1) {
uni.navigateTo({
url: `/pages/product/addGoods/index?mer_id=${this.mer_id}`
})
} else {
this.scanCode()
}
type === 1 ? uni.navigateTo({
url: `/pages/product/addGoods/index?mer_id=${this.mer_id}`
}) : this.scanCode();
},
scanCode() {
const self = this
@ -156,6 +179,29 @@
}
}
.search_goods_box {
width: 694.74rpx;
padding: 28.07rpx;
font-size: 31.58rpx;
.searchGoods {
height: 87.72rpx;
border: 1px solid #f5f5f5;
border-radius: 8px;
padding: 12px;
margin: 21.05rpx 0;
}
.edit_goods_btn {
margin-top: 28.07rpx;
display: flex;
justify-content: space-between;
.edit_btn {
width: 210.53rpx;
}
}
}
//
.edit_goods_box {