| | |
| | | <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" |
| | |
| | | </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"> |
| | |
| | | |
| | | <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(){ |
| | |
| | | goodsList: [], |
| | | selectIndex: 0, |
| | | cateId: null,//当前产品类别id |
| | | selectItems: [] |
| | | selectItems: [], |
| | | queryKey: '' |
| | | } |
| | | }, |
| | | computed:{ |
| | |
| | | }, |
| | | methods:{ |
| | | openShoppingCart(){ |
| | | if(!this.selectItems.length){ |
| | | return; |
| | | } |
| | | this.$refs.shopCart.show() |
| | | }, |
| | | loadGoodsTypeList(){ |
| | |
| | | cateId: this.cateId, |
| | | pageNum: 1, |
| | | pageSize: 100, |
| | | queryKey: '' |
| | | queryKey: this.queryKey |
| | | },'POST').then((res) => { |
| | | if(res.status == 200){ |
| | | this.goodsList = res.rows.map((item) => { |
| | |
| | | }); |
| | | } |
| | | }) |
| | | }, |
| | | // 搜索 |
| | | search(val){ |
| | | this.queryKey = val; |
| | | this.loadGoodsList(); |
| | | }, |
| | | // 切换商品类型 |
| | | changeGoodsType(id, index){ |
| | |
| | | }); |
| | | }, |
| | | 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 |
| | | }); |
| | | } |
| | | } |