|
@@ -127,9 +127,9 @@
|
|
|
</view>
|
|
|
</template>
|
|
|
<script>
|
|
|
- import tuiLoadmore from "@/components/tui-components/loadmore/loadmore"
|
|
|
- import tuiNomore from "@/components/tui-components/nomore/nomore"
|
|
|
- import modalLayer from "@/components/modal-layer"
|
|
|
+ import tuiLoadmore from '@/components/tui-components/loadmore/loadmore'
|
|
|
+ import tuiNomore from '@/components/tui-components/nomore/nomore'
|
|
|
+ import modalLayer from '@/components/modal-layer'
|
|
|
import { mapState,mapMutations } from 'vuex'
|
|
|
const defaultListQuery = {
|
|
|
shopId:'',
|
|
@@ -143,7 +143,7 @@
|
|
|
bigTypeId:0,//一级
|
|
|
smallTypeId:0,//二级
|
|
|
tinyTypeId:0//三级
|
|
|
- };
|
|
|
+ }
|
|
|
export default{
|
|
|
components: {
|
|
|
tuiLoadmore,
|
|
@@ -208,23 +208,22 @@
|
|
|
switch(option.listType){
|
|
|
case '0':
|
|
|
this.listQuery.validFlag =''
|
|
|
- break;
|
|
|
+ break
|
|
|
case '1':
|
|
|
this.listQuery.validFlag = 2
|
|
|
- break;
|
|
|
+ break
|
|
|
case '2':
|
|
|
this.listQuery.validFlag = 3
|
|
|
- break;
|
|
|
+ break
|
|
|
}
|
|
|
this.$api.getComStorage('userInfo').then((resolve) =>{
|
|
|
this.listQuery.shopId = this.shopId = resolve.shopId
|
|
|
this.GetProductListInfo()
|
|
|
- this.GetPrimaryClassification(this.listQuery.commodityType)
|
|
|
})
|
|
|
},
|
|
|
filters: {
|
|
|
NumFormat:function(text) {//处理金额
|
|
|
- return Number(text).toFixed(2);
|
|
|
+ return Number(text).toFixed(2)
|
|
|
},
|
|
|
verifyStatusFilter: function(state){
|
|
|
let stateText = '',
|
|
@@ -237,13 +236,13 @@
|
|
|
9:'已隐身',
|
|
|
10:'已冻结',
|
|
|
|
|
|
- };
|
|
|
+ }
|
|
|
Object.keys(stateTextObject).forEach(function(key) {
|
|
|
if(key == state){
|
|
|
stateText = stateTextObject[key]
|
|
|
}
|
|
|
- });
|
|
|
- return stateText;
|
|
|
+ })
|
|
|
+ return stateText
|
|
|
},
|
|
|
},
|
|
|
computed: {
|
|
@@ -258,8 +257,8 @@
|
|
|
this.featuredNum = response.data.featuredNum
|
|
|
this.hasNextPage = data.hasNextPage
|
|
|
if(data.results && data.results.length > 0){
|
|
|
- this.isEmpty = false;
|
|
|
- this.dataList = data.results;
|
|
|
+ this.isEmpty = false
|
|
|
+ this.dataList = data.results
|
|
|
this.handleDataList()
|
|
|
if(this.hasNextPage){
|
|
|
this.pullUpOn = false
|
|
@@ -272,13 +271,14 @@
|
|
|
this.nomoreText = '已至底部'
|
|
|
}
|
|
|
}
|
|
|
+ this.GetPrimaryClassification(this.listQuery.commodityType)
|
|
|
}else{
|
|
|
this.dataList = []
|
|
|
this.isEmpty = true
|
|
|
this.pullUpOn = true
|
|
|
}
|
|
|
}).catch(error =>{
|
|
|
- this.$util.msg(error.msg,2000);
|
|
|
+ this.$util.msg(error.msg,2000)
|
|
|
})
|
|
|
},
|
|
|
GetOnReachBottomData(index){//上拉加载
|
|
@@ -286,11 +286,11 @@
|
|
|
this.ShopService.GetSupplierPyProduct(this.listQuery).then(response =>{
|
|
|
let data = response.data.productPage
|
|
|
this.featuredNum = response.data.featuredNum
|
|
|
- this.hasNextPage = data.hasNextPage;
|
|
|
+ this.hasNextPage = data.hasNextPage
|
|
|
this.dataList = this.dataList.concat(data.results)
|
|
|
this.handleDataList()
|
|
|
- this.pullFlag = false;// 防上拉暴滑
|
|
|
- setTimeout(()=>{this.pullFlag = true;},500)
|
|
|
+ this.pullFlag = false// 防上拉暴滑
|
|
|
+ setTimeout(()=>{this.pullFlag = true},500)
|
|
|
if(this.hasNextPage){
|
|
|
this.pullUpOn = false
|
|
|
this.nomoreText = '上拉显示更多'
|
|
@@ -331,20 +331,20 @@
|
|
|
},
|
|
|
handSearchList(){//搜索
|
|
|
this.GetProductListInfo()
|
|
|
- this.leftDrawer = false;
|
|
|
- this.rightDrawer = false;
|
|
|
+ this.leftDrawer = false
|
|
|
+ this.rightDrawer = false
|
|
|
},
|
|
|
handSearchClear(){//重置搜索条件
|
|
|
this.listQuery = Object.assign({}, defaultListQuery)
|
|
|
this.listQuery.shopId = this.shopId
|
|
|
- this.validFlagText='';
|
|
|
- this.featuredFlagText='';
|
|
|
- this.commodityTypeText='';
|
|
|
- this.firstClassificationText='';
|
|
|
- this.twoClassificationText='';
|
|
|
- this.threeClassificationText='';
|
|
|
- this.classificationTwoList = [];
|
|
|
- this.classificationThreeList = [];
|
|
|
+ this.validFlagText=''
|
|
|
+ this.featuredFlagText=''
|
|
|
+ this.commodityTypeText=''
|
|
|
+ this.firstClassificationText=''
|
|
|
+ this.twoClassificationText=''
|
|
|
+ this.threeClassificationText=''
|
|
|
+ this.classificationTwoList = []
|
|
|
+ this.classificationThreeList = []
|
|
|
},
|
|
|
handlerButton(e,item){//监听侧滑按钮点击事件
|
|
|
if(item.validFlag === 0 || item.validFlag === 3 || item.validFlag === 8 || item.validFlag === 9){
|
|
@@ -359,42 +359,42 @@
|
|
|
switch(e.index){
|
|
|
case 0:
|
|
|
this.$api.navigateTo(`/pages/goods/product?id=${item.productId}`)
|
|
|
- break;
|
|
|
+ break
|
|
|
case 1:
|
|
|
if(item.featuredFlag === 1){
|
|
|
this.handleDeleteShopRemb(item)
|
|
|
}else{
|
|
|
this.handleAddShopRemb(item)
|
|
|
}
|
|
|
- break;
|
|
|
+ break
|
|
|
case 2:
|
|
|
this.handleUnder(item)
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
handleAddShopRemb(item){//添加主页推荐
|
|
|
- let num = 4- this.featuredNum;
|
|
|
+ let num = 4- this.featuredNum
|
|
|
this.OperationType = 'add'
|
|
|
this.handlerProduct = item
|
|
|
- this.modal = true;
|
|
|
- this.contentModalText = `总共能添加4个主推商品,您还能添加${num}个确定将该商品添加为主推商品吗?`;
|
|
|
+ this.modal = true
|
|
|
+ this.contentModalText = `总共能添加4个主推商品,您还能添加${num}个确定将该商品添加为主推商品吗?`
|
|
|
},
|
|
|
handleDeleteShopRemb(item){//删除主页推荐
|
|
|
this.OperationType = 'delete'
|
|
|
this.handlerProduct = item
|
|
|
- this.modal = true;
|
|
|
- this.contentModalText = '是否把该商品从主推商品中删除?';
|
|
|
+ this.modal = true
|
|
|
+ this.contentModalText = '是否把该商品从主推商品中删除?'
|
|
|
},
|
|
|
handleUnder(item){//下架操作
|
|
|
this.OperationType = 'under'
|
|
|
this.handlerProduct = item
|
|
|
- this.modal = true;
|
|
|
- this.contentModalText = '确定下架该商品吗?';
|
|
|
+ this.modal = true
|
|
|
+ this.contentModalText = '确定下架该商品吗?'
|
|
|
},
|
|
|
handleAllUnder(){//批量下架操作
|
|
|
- let checkedArray = [];
|
|
|
- let isValidFlag = false;
|
|
|
- this.productIds = '';
|
|
|
+ let checkedArray = []
|
|
|
+ let isValidFlag = false
|
|
|
+ this.productIds = ''
|
|
|
if(this.isProductChecked){
|
|
|
this.dataList.forEach(el => {
|
|
|
if(el.isChecked) {
|
|
@@ -406,16 +406,16 @@
|
|
|
this.productIds += el.productId+','
|
|
|
}
|
|
|
if(el.validFlag != 2){
|
|
|
- isValidFlag = true;
|
|
|
+ isValidFlag = true
|
|
|
}
|
|
|
})
|
|
|
if(isValidFlag){
|
|
|
this.$util.modal('','部分选中的商品暂未上架,不能进行下架操作','确定','',false,() =>{})
|
|
|
- return;
|
|
|
+ return
|
|
|
}
|
|
|
this.OperationType = 'allunder'
|
|
|
- this.modal = true;
|
|
|
- this.contentModalText = '确定下架选中的商品吗?';
|
|
|
+ this.modal = true
|
|
|
+ this.contentModalText = '确定下架选中的商品吗?'
|
|
|
}
|
|
|
},
|
|
|
handleClick(e) {//弹窗提示用户操作
|
|
@@ -423,23 +423,23 @@
|
|
|
switch(this.OperationType){
|
|
|
case 'delete'://删除主页推荐
|
|
|
this.SupplierDeleteSwitchFeatured(this.handlerProduct)
|
|
|
- break;
|
|
|
+ break
|
|
|
case 'add'://添加主页推荐
|
|
|
this.SupplierAddSwitchFeatured(this.handlerProduct)
|
|
|
- break;
|
|
|
+ break
|
|
|
case 'under'://下架商品
|
|
|
this.SupplierSoldOutProduct(this.handlerProduct)
|
|
|
- break;
|
|
|
+ break
|
|
|
case 'allunder'://批量下架
|
|
|
this.SupplierAllSoldOutProduct(this.productIds)
|
|
|
- break;
|
|
|
+ break
|
|
|
}
|
|
|
}
|
|
|
- this.modal = false;
|
|
|
+ this.modal = false
|
|
|
},
|
|
|
SupplierDeleteSwitchFeatured(item){//操作删除主页推荐
|
|
|
this.ShopService.SupplierSwitchFeaturedyProduct({productId:item.productId,featuredFlag:0}).then(response =>{
|
|
|
- this.$util.msg('删除成功',2000,true,'success');
|
|
|
+ this.$util.msg('删除成功',2000,true,'success')
|
|
|
setTimeout(() => {
|
|
|
this.GetProductListInfo()
|
|
|
},2000)
|
|
@@ -449,7 +449,7 @@
|
|
|
},
|
|
|
SupplierAddSwitchFeatured(item){//操作添加主页推荐
|
|
|
this.ShopService.SupplierSwitchFeaturedyProduct({productId:item.productId,featuredFlag:1}).then(response =>{
|
|
|
- this.$util.msg('添加成功',2000,true,'success');
|
|
|
+ this.$util.msg('添加成功',2000,true,'success')
|
|
|
setTimeout(() => {
|
|
|
this.GetProductListInfo()
|
|
|
},2000)
|
|
@@ -459,7 +459,7 @@
|
|
|
},
|
|
|
SupplierSoldOutProduct(item){//操作下架商品
|
|
|
this.ShopService.SupplierSoldOutProduct({productIds:item.productId}).then(response =>{
|
|
|
- this.$util.msg('下架成功',2000,true,'success');
|
|
|
+ this.$util.msg('下架成功',2000,true,'success')
|
|
|
setTimeout(() => {
|
|
|
this.GetProductListInfo()
|
|
|
},2000)
|
|
@@ -469,8 +469,8 @@
|
|
|
},
|
|
|
SupplierAllSoldOutProduct(ids){//操作批量下架商品
|
|
|
this.ShopService.SupplierSoldOutProduct({productIds:ids}).then(response =>{
|
|
|
- this.$util.msg('下架成功',2000,true,'success');
|
|
|
- this.productIds = '';
|
|
|
+ this.$util.msg('下架成功',2000,true,'success')
|
|
|
+ this.productIds = ''
|
|
|
setTimeout(() => {
|
|
|
this.GetProductListInfo()
|
|
|
},2000)
|
|
@@ -483,22 +483,22 @@
|
|
|
case 0:
|
|
|
this.commodityTypeText = this.statusActions[e.target.value].name
|
|
|
this.listQuery.commodityType = this.commodityTypeActons[e.target.value].value
|
|
|
- break;
|
|
|
+ break
|
|
|
case 1:
|
|
|
this.validFlagText = this.statusActions[e.target.value].name
|
|
|
this.listQuery.validFlag = this.statusActions[e.target.value].value
|
|
|
- break;
|
|
|
+ break
|
|
|
case 2:
|
|
|
this.featuredFlagText = this.recommendActions[e.target.value].name
|
|
|
this.listQuery.featuredFlag = this.recommendActions[e.target.value].value
|
|
|
- break;
|
|
|
+ break
|
|
|
case 3:
|
|
|
this.firstClassificationText = this.classificationFirstList[e.target.value].name
|
|
|
this.listQuery.bigTypeId = this.classificationFirstList[e.target.value].value
|
|
|
this.GetPrimarySecondaryClassification(this.listQuery.bigTypeId)
|
|
|
this.twoClassificationText = ''
|
|
|
this.threeClassificationText=''
|
|
|
- break;
|
|
|
+ break
|
|
|
case 4:
|
|
|
if(this.listQuery.bigTypeId == 0){
|
|
|
this.$util.msg('请先选择一级分类',2000)
|
|
@@ -507,7 +507,7 @@
|
|
|
this.twoClassificationText = this.classificationTwoList[e.target.value].name
|
|
|
this.listQuery.smallTypeId = this.classificationTwoList[e.target.value].value
|
|
|
this.GetPrimaryThreeLevelClassification(this.listQuery.smallTypeId)
|
|
|
- break;
|
|
|
+ break
|
|
|
case 5:
|
|
|
if(this.listQuery.smallTypeId == 0){
|
|
|
this.$util.msg('请先选择二级分类',2000)
|
|
@@ -515,7 +515,7 @@
|
|
|
}
|
|
|
this.threeClassificationText = this.classificationThreeList[e.target.value].name
|
|
|
this.listQuery.tinyTypeId = this.classificationThreeList[e.target.value].value
|
|
|
- break;
|
|
|
+ break
|
|
|
}
|
|
|
},
|
|
|
GetPrimaryClassification(value){//获取筛选条件一级分类
|
|
@@ -554,14 +554,14 @@
|
|
|
})
|
|
|
},
|
|
|
hideMobel(){
|
|
|
- this.modal = false;
|
|
|
+ this.modal = false
|
|
|
},
|
|
|
updateCheckAllBtn() {//勾选单个判断全选
|
|
|
let goodsCheckedLength = 0
|
|
|
this.dataList.forEach(item => {
|
|
|
- if(item.isChecked) { goodsCheckedLength++; }
|
|
|
+ if(item.isChecked) { goodsCheckedLength++ }
|
|
|
})
|
|
|
- this.isAllChecked = goodsCheckedLength === this.dataList.length;
|
|
|
+ this.isAllChecked = goodsCheckedLength === this.dataList.length
|
|
|
if(goodsCheckedLength>0){
|
|
|
this.isProductChecked = true
|
|
|
}else{
|
|
@@ -594,15 +594,15 @@
|
|
|
this.isSuperv = false
|
|
|
},
|
|
|
searchClickFn() {//弹出抽屉
|
|
|
- this.rightDrawer = true;
|
|
|
+ this.rightDrawer = true
|
|
|
},
|
|
|
closeDrawer(e) {//关闭抽屉
|
|
|
- this.leftDrawer = false;
|
|
|
- this.rightDrawer = false;
|
|
|
+ this.leftDrawer = false
|
|
|
+ this.rightDrawer = false
|
|
|
},
|
|
|
orderPriceToFixed (n){
|
|
|
- let price ='';
|
|
|
- price = Number(n).toFixed(2);
|
|
|
+ let price =''
|
|
|
+ price = Number(n).toFixed(2)
|
|
|
return price
|
|
|
},
|
|
|
verifyColorFilter: function(state){
|
|
@@ -614,13 +614,13 @@
|
|
|
3:'#627386',
|
|
|
8:'#FF2A2A',
|
|
|
9:'#f94b4b'
|
|
|
- };
|
|
|
+ }
|
|
|
Object.keys(stateColorObject).forEach(function(key){
|
|
|
if(key == state){
|
|
|
stateColor = stateColorObject[key]
|
|
|
}
|
|
|
- });
|
|
|
- return stateColor;
|
|
|
+ })
|
|
|
+ return stateColor
|
|
|
},
|
|
|
},
|
|
|
onPageScroll(e){//实时获取到滚动的值
|