From cc499362b6eba119792e113796e4da029a70fc6d Mon Sep 17 00:00:00 2001
From: queenwuli <942534046@qq.com>
Date: Sun, 27 Dec 2020 14:59:26 +0800
Subject: [PATCH] 服务单接口联调

---
 hive-app/pages/workbench/selectProduct/index.vue |   25 ++++++++++++-------------
 1 files changed, 12 insertions(+), 13 deletions(-)

diff --git a/hive-app/pages/workbench/selectProduct/index.vue b/hive-app/pages/workbench/selectProduct/index.vue
index 298d203..25e4263 100644
--- a/hive-app/pages/workbench/selectProduct/index.vue
+++ b/hive-app/pages/workbench/selectProduct/index.vue
@@ -1,10 +1,7 @@
 <template>
 	<!-- 当前客户 -->
 	<view class="container">
-		<!-- #ifndef H5 -->
-		<view class="status_bar"></view>
-		<!-- #endif -->
-		<search-bar placeholder="商品名称、编号、拼音" class="search-bar"></search-bar>
+		<search-bar @confirm="search" placeholder="商品名称、编号、拼音" class="search-bar"></search-bar>
 		<view class="list">
 			<scroll-view class="list-left" scroll-y="true">
 				<view class="list-left-row" 
@@ -16,7 +13,7 @@
 				</view>
 			</scroll-view>
 			<scroll-view class="list-right" scroll-y="true">
-				<navigator url="../productDetail/index" hover-class="none" v-for="item in goodsList">
+				<navigator :url="'../productDetail/index?goodsType='+item.goodsType+'&id='+item.id" hover-class="none" v-for="item in goodsList">
 					<view class="list-right-row">
 						<image class="product-img" :src="item.img?item.img:'../../../static/images/no-img.png'"></image>
 						<view class="flex-1">
@@ -54,12 +51,10 @@
 
 <script>
 	import searchBar from '../../../components/searchBar/index.vue';
-	import uniPopup from '@/components/uni-popup/uni-popup.vue'
 	import shoppingCart from './shoppingCart.vue'
 	export default {
 		components:{
 			searchBar,
-			uniPopup,
 			shoppingCart
 		},
 		data(){
@@ -69,7 +64,8 @@
 				goodsList: [],
 				selectIndex: 0,
 				cateId: null,//当前产品类别id
-				selectItems: []
+				selectItems: [],
+				queryKey: ''
 			}
 		},
 		computed:{
@@ -102,9 +98,6 @@
 		},
 		methods:{
 			openShoppingCart(){
-				if(!this.selectItems.length){
-					return;
-				}
 				this.$refs.shopCart.show()
 			},
 			loadGoodsTypeList(){
@@ -124,7 +117,7 @@
 					cateId: this.cateId,
 					pageNum: 1,
 					pageSize: 100,
-					queryKey: ''
+					queryKey: this.queryKey
 				},'POST').then((res) => {
 					if(res.status == 200){
 						this.goodsList = res.rows.map((item) => {
@@ -132,6 +125,11 @@
 						});
 					}
 				})
+			},
+			// 搜索
+			search(val){
+				this.queryKey = val;
+				this.loadGoodsList();
 			},
 			// 切换商品类型
 			changeGoodsType(id, index){
@@ -166,8 +164,9 @@
 				});
 			},
 			submit(){
+				let str = (encodeURIComponent(JSON.stringify(this.selectItems))).replace(/%/g, '%25');
 				uni.navigateTo({
-					url: '../confirmOrder?id='+this.id+'&list='+encodeURIComponent(JSON.stringify(this.selectItems))
+					url: '../confirmOrder?id='+this.id+'&list='+str
 				});
 			}
 		}

--
Gitblit v1.9.1