|
|
@@ -3,8 +3,9 @@
|
|
|
<view class="shop-type_box">
|
|
|
<view v-for="item in categoryData" :key="item.id" :class="[categoryId===item.id?'active':'']" @click="changeCategory(item)" > {{item.categoryName}} </view>
|
|
|
</view>
|
|
|
- <view class="shop-show_box">
|
|
|
- <view v-for="item in goodsInfoList" :key="item.id" class="show-shop_box">
|
|
|
+
|
|
|
+ <scroll-view lower-threshold="20" @scrolltolower="reachBottom" class="shop-show_box" :scroll-y="true">
|
|
|
+ <view v-for="item in list.data" :key="item.id" class="show-shop_box">
|
|
|
<view class="item-detail" @click="popAddModelFn(item)">
|
|
|
<image class="img" :src="item.cover" mode="scaleToFill" ></image>
|
|
|
<view class="shop-info_price">
|
|
|
@@ -15,7 +16,8 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
- </view>
|
|
|
+ </scroll-view>
|
|
|
+
|
|
|
<slot name="footer"></slot>
|
|
|
|
|
|
<!-- 开单选花材输入数量和金额 -->
|
|
|
@@ -30,16 +32,16 @@ import settlePop from './settle-pop.vue'
|
|
|
import { getClass } from '@/api/category/index'
|
|
|
import { getGoodsList } from '@/api/goods/index'
|
|
|
import productMins from "@/mixins/product";
|
|
|
+import list from "@/mixins/list";
|
|
|
import kdSelectNumPrice from '@/components/app-kd-select-num-price.vue'
|
|
|
export default {
|
|
|
name:'rightItemArea',
|
|
|
components:{ settlePop,kdSelectNumPrice },
|
|
|
- mixins: [productMins],
|
|
|
+ mixins: [productMins,list],
|
|
|
data(){
|
|
|
return {
|
|
|
categoryData:[],
|
|
|
categoryId: '',
|
|
|
- goodsInfoList:[],
|
|
|
selectJobType:'bill',
|
|
|
selectJobId:0
|
|
|
}
|
|
|
@@ -72,23 +74,31 @@ export default {
|
|
|
this.categoryData = res.data
|
|
|
this.categoryId = this.categoryData[0].id
|
|
|
this.getGoodsData()
|
|
|
- //this.initStorageData()!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
|
+ //this.initStorageData()!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
getGoodsData(){
|
|
|
- getGoodsList({cId:this.categoryId}).then(res=>{
|
|
|
+ getGoodsList({cId:this.categoryId,page:this.list.page}).then(res=>{
|
|
|
if(res.code == 1){
|
|
|
- this.goodsInfoList = res.data
|
|
|
+ this.completes(res)
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
+ reachBottom(){
|
|
|
+ if (!this.list.finished) {
|
|
|
+ this.getGoodsData()
|
|
|
+ }
|
|
|
+ },
|
|
|
changeCategory(item){
|
|
|
this.$util.hitRemind()
|
|
|
- if(item.id === this.categoryId){
|
|
|
- return false
|
|
|
+ if(this.categoryId != item.id){
|
|
|
+ this.list.data=[]
|
|
|
+ this.list.page = 1
|
|
|
+ this.list.finished = false
|
|
|
}
|
|
|
this.categoryId = item.id
|
|
|
+ this.getGoodsData()
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -101,7 +111,12 @@ export default {
|
|
|
flex-direction: column;
|
|
|
box-sizing: border-box;
|
|
|
& .shop-show_box{
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
& .show-shop_box{
|
|
|
+ width: 82upx;
|
|
|
+ height: 82upx;
|
|
|
+ background:red;
|
|
|
& .item-detail{
|
|
|
position: relative;
|
|
|
margin-right: 9upx;
|