queenwuli
2020-12-27 cc499362b6eba119792e113796e4da029a70fc6d
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
            });
         }
      }