mirror of
https://gitee.com/beijing_hongye_huicheng/lilishop-ui.git
synced 2025-12-18 17:05:54 +08:00
v4.2.5
This commit is contained in:
@@ -4,19 +4,60 @@
|
||||
<div class="query-wrapper">
|
||||
<div class="query-item">
|
||||
<div>搜索范围</div>
|
||||
<Input placeholder="商品名称" @on-clear="goodsData=[]; goodsParams.goodsName=''; goodsParams.pageNumber = 1; getQueryGoodsList()" @on-enter="()=>{goodsData=[];goodsParams.pageNumber =1; getQueryGoodsList();}" icon="ios-search" clearable
|
||||
style="width: 150px" v-model="goodsParams.goodsName" />
|
||||
<Input
|
||||
placeholder="商品名称"
|
||||
@on-clear="
|
||||
goodsData = [];
|
||||
goodsParams.goodsName = '';
|
||||
goodsParams.pageNumber = 1;
|
||||
getQueryGoodsList();
|
||||
"
|
||||
@on-enter="
|
||||
() => {
|
||||
goodsData = [];
|
||||
goodsParams.pageNumber = 1;
|
||||
getQueryGoodsList();
|
||||
}
|
||||
"
|
||||
icon="ios-search"
|
||||
clearable
|
||||
style="width: 150px"
|
||||
v-model="goodsParams.goodsName"
|
||||
/>
|
||||
</div>
|
||||
<div class="query-item">
|
||||
<Cascader v-model="category" placeholder="请选择商品分类" style="width: 250px" :data="skuList"></Cascader>
|
||||
<Cascader
|
||||
v-model="category"
|
||||
placeholder="请选择商品分类"
|
||||
style="width: 250px"
|
||||
:data="skuList"
|
||||
></Cascader>
|
||||
</div>
|
||||
<div class="query-item">
|
||||
<Button type="primary" @click="goodsData=[]; getQueryGoodsList();" icon="ios-search">搜索</Button>
|
||||
<Button
|
||||
type="primary"
|
||||
@click="
|
||||
goodsData = [];
|
||||
getQueryGoodsList();
|
||||
"
|
||||
icon="ios-search"
|
||||
>搜索</Button
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
<div style="positon:retavle;">
|
||||
<Scroll class="wap-content-list" :on-reach-bottom="handleReachBottom" :distance-to-edge="[3,3]">
|
||||
<div class="wap-content-item" :class="{ active: item.selected }" @click="checkedGoods(item, index)" v-for="(item, index) in goodsData" :key="index">
|
||||
<div>
|
||||
<Scroll
|
||||
class="wap-content-list"
|
||||
:on-reach-bottom="handleReachBottom"
|
||||
:distance-to-edge="[3, 3]"
|
||||
>
|
||||
<div
|
||||
class="wap-content-item"
|
||||
:class="{ active: item.selected }"
|
||||
@click="checkedGoods(item, index)"
|
||||
v-for="(item, index) in goodsData"
|
||||
:key="index"
|
||||
>
|
||||
<div>
|
||||
<img :src="item.thumbnail" alt="" />
|
||||
</div>
|
||||
@@ -33,7 +74,6 @@
|
||||
|
||||
<div v-if="empty" class="empty">暂无商品信息</div>
|
||||
</Scroll>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -45,8 +85,9 @@ export default {
|
||||
return {
|
||||
type: "multiple", //单选或者多选 single multiple
|
||||
skuList: [], // 商品sku列表
|
||||
total: 0, // 商品总数
|
||||
goodsParams: { // 商品请求参数
|
||||
total: 0, // 商品总数
|
||||
goodsParams: {
|
||||
// 商品请求参数
|
||||
pageNumber: 1,
|
||||
pageSize: 18,
|
||||
order: "desc",
|
||||
@@ -66,10 +107,10 @@ export default {
|
||||
props: {
|
||||
selectedWay: {
|
||||
type: Array,
|
||||
default: function(){
|
||||
return new Array()
|
||||
}
|
||||
}
|
||||
default: function () {
|
||||
return new Array();
|
||||
},
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
category(val) {
|
||||
@@ -80,7 +121,7 @@ export default {
|
||||
this.$emit("selected", this.selectedWay);
|
||||
},
|
||||
deep: true,
|
||||
immediate: true
|
||||
immediate: true,
|
||||
},
|
||||
"goodsParams.categoryPath": {
|
||||
handler: function () {
|
||||
@@ -114,22 +155,21 @@ export default {
|
||||
},
|
||||
// 获取列表方法
|
||||
initGoods(res) {
|
||||
if (res.result.records.length !=0) {
|
||||
if (res.result.records.length != 0) {
|
||||
res.result.records.forEach((item) => {
|
||||
item.selected = false;
|
||||
item.___type = "goods"; //设置为goods让pc wap知道标识
|
||||
this.selectedWay.forEach(e => {
|
||||
this.selectedWay.forEach((e) => {
|
||||
if (e.id && e.id === item.id) {
|
||||
item.selected = true
|
||||
item.selected = true;
|
||||
}
|
||||
})
|
||||
});
|
||||
});
|
||||
/**
|
||||
* 解决数据请求中,滚动栏会一直上下跳动
|
||||
*/
|
||||
this.total = res.result.total;
|
||||
this.goodsData.push(...res.result.records);
|
||||
|
||||
} else {
|
||||
this.empty = true;
|
||||
}
|
||||
@@ -140,12 +180,12 @@ export default {
|
||||
// 商品
|
||||
this.initGoods(res);
|
||||
});
|
||||
if (localStorage.getItem('category')) {
|
||||
this.deepGroup(JSON.parse(localStorage.getItem('category')))
|
||||
if (localStorage.getItem("category")) {
|
||||
this.deepGroup(JSON.parse(localStorage.getItem("category")));
|
||||
} else {
|
||||
setTimeout(() => {
|
||||
this.deepGroup(JSON.parse(localStorage.getItem('category')))
|
||||
},3000)
|
||||
this.deepGroup(JSON.parse(localStorage.getItem("category")));
|
||||
}, 3000);
|
||||
}
|
||||
},
|
||||
|
||||
@@ -205,9 +245,9 @@ export default {
|
||||
this.selectedWay.push(val);
|
||||
} else {
|
||||
val.selected = false;
|
||||
for (let i = 0; i<this.selectedWay.length; i++ ) {
|
||||
if (this.selectedWay[i].id===val.id) {
|
||||
this.selectedWay.splice(i,1)
|
||||
for (let i = 0; i < this.selectedWay.length; i++) {
|
||||
if (this.selectedWay[i].id === val.id) {
|
||||
this.selectedWay.splice(i, 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,25 @@
|
||||
<template>
|
||||
<Modal :styles="{ top: '120px' }" width="1160" :z-index="10000" @on-cancel="clickClose" @on-ok="clickOK" v-model="flag" :mask-closable="false" scrollable>
|
||||
<template v-if="flag">
|
||||
<goodsDialog @selected="(val) => {goodsData = val;}"
|
||||
v-if="goodsFlag" ref="goodsDialog" :selectedWay='goodsData'/>
|
||||
<linkDialog @selectedLink="(val) => { linkData = val; }" v-else class="linkDialog" />
|
||||
<goodsDialog
|
||||
@selected="
|
||||
(val) => {
|
||||
goodsData = val;
|
||||
}
|
||||
"
|
||||
v-if="goodsFlag"
|
||||
ref="goodsDialog"
|
||||
:selectedWay="goodsData"
|
||||
/>
|
||||
<linkDialog
|
||||
@selectedLink="
|
||||
(val) => {
|
||||
linkData = val;
|
||||
}
|
||||
"
|
||||
v-else
|
||||
class="linkDialog"
|
||||
/>
|
||||
</template>
|
||||
</Modal>
|
||||
</template>
|
||||
@@ -13,7 +29,7 @@ import linkDialog from "./link-dialog";
|
||||
export default {
|
||||
components: {
|
||||
goodsDialog,
|
||||
linkDialog
|
||||
linkDialog,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@@ -56,12 +72,11 @@ export default {
|
||||
if (type == "goods") {
|
||||
this.goodsFlag = true;
|
||||
if (mutiple) {
|
||||
this.singleGoods()
|
||||
this.singleGoods();
|
||||
}
|
||||
} else {
|
||||
this.goodsFlag = false;
|
||||
}
|
||||
|
||||
},
|
||||
// 关闭组件
|
||||
close() {
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
"
|
||||
/>
|
||||
</TabPane>
|
||||
<!-- </template> -->
|
||||
</Tabs>
|
||||
</div>
|
||||
</template>
|
||||
@@ -27,7 +28,7 @@ import goodsDialog from "./goods-dialog";
|
||||
import templateWay from "./template/index";
|
||||
export default {
|
||||
components: {
|
||||
goodsDialog,
|
||||
goodsDialog
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@@ -43,8 +44,8 @@ export default {
|
||||
handler(val) {
|
||||
this.$emit("selectedLink", val[0]); //因为是单选,所以直接返回第一个
|
||||
},
|
||||
deep: true,
|
||||
},
|
||||
deep: true
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
@@ -57,7 +58,18 @@ export default {
|
||||
}
|
||||
});
|
||||
},
|
||||
methods: {},
|
||||
methods: {
|
||||
// isVisible(item) {
|
||||
// const type = this.$route.query.pagetype;
|
||||
// if (type == "INDEX" && [ "discover"].includes(item.name)) {
|
||||
// return false;
|
||||
// }else if(type == "DISCOVER" && item.name == 'special'){
|
||||
// return false;
|
||||
// }else{
|
||||
// return true
|
||||
// }
|
||||
// },
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style scoped lang="scss">
|
||||
|
||||
@@ -36,7 +36,6 @@ import { getHomeList } from "@/api/other.js";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
||||
loading: true, //表格请求数据为true
|
||||
promotionList: "", // 活动列表
|
||||
selectedIndex: 0, //左侧菜单选择
|
||||
|
||||
@@ -34,5 +34,10 @@ export default [
|
||||
title: "其他",
|
||||
url: "3",
|
||||
name: "other"
|
||||
}
|
||||
},
|
||||
{
|
||||
title: "专题",
|
||||
url: "4",
|
||||
name: "special"
|
||||
},
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user