修改样式 和 优化一些 功能

This commit is contained in:
夜良king
2022-02-16 09:25:01 +08:00
parent aee67ec317
commit c4037a346d
6 changed files with 42 additions and 14 deletions

View File

@@ -256,8 +256,8 @@ export const lowGoods = params => {
};
// 获取商品单位列表
export const getGoodsUnitList = () => {
return getRequest(`/goods/goodsUnit`);
export const getGoodsUnitList = params => {
return getRequest(`/goods/goodsUnit`,params);
};
//根据分类id获取关联品牌
export const getCategoryBrandListDataSeller = (category_id, params) => {

View File

@@ -67,12 +67,14 @@
prop="goodsUnit"
>
<Select v-model="baseInfoForm.goodsUnit" style="width: 100px">
<Scroll :on-reach-bottom="handleReachBottom" >
<Option
v-for="(unit, i) in goodsUnitList"
:key="i"
:value="unit"
>{{ unit }}
v-for="(item, index) in goodsUnitList"
:key="index"
:value="item"
>{{ item }}
</Option>
</Scroll>
</Select>
</FormItem>
<FormItem
@@ -694,6 +696,7 @@ export default {
};
return {
regular,
total:0,
accessToken: "", //令牌token
goodsParams: "",
categoryId: "", // 商品分类第三级id
@@ -778,6 +781,10 @@ export default {
value: [regular.REQUIRED, regular.VARCHAR60],
templateId: [regular.REQUIRED],
},
params:{
pageNumber:1,
pageSize:10
},
skuInfoRules: {},
/** 品牌列表 */
brandList: [],
@@ -956,12 +963,23 @@ export default {
this.brandList = response;
}
);
},
// 页面触底
handleReachBottom(){
setTimeout(() => {
if (this.params.pageNumber * this.params.pageSize <= this.total) {
this.params.pageNumber++;
this.GET_GoodsUnit();
}
}, 1000);
},
// 获取商品单位
GET_GoodsUnit() {
API_GOODS.getGoodsUnitList().then((res) => {
API_GOODS.getGoodsUnitList(this.params).then((res) => {
if (res.success) {
this.goodsUnitList = res.result.records.map((i) => i.name);
console.log(res)
this.goodsUnitList.push(...res.result.records.map((i) => i.name));
this.total = res.result.total;
}
});
},
@@ -1688,3 +1706,9 @@ export default {
width: 100%;
}
</style>
<style>
.ivu-select .ivu-select-dropdown{
overflow: hidden !important;
}
</style>