|
@@ -39,49 +39,61 @@
|
|
<image class="empty-container-image" src="https://img.caimei365.com/group1/M00/03/71/Cmis2F3wna6AY2ZjAABpmnBICH4247.png"></image>
|
|
<image class="empty-container-image" src="https://img.caimei365.com/group1/M00/03/71/Cmis2F3wna6AY2ZjAABpmnBICH4247.png"></image>
|
|
<text class="error-text">{{emptyText}}</text>
|
|
<text class="error-text">{{emptyText}}</text>
|
|
</view>
|
|
</view>
|
|
- <view class="container-list" :style="{'height':scrollHeight+'px'}" v-if="listData.length > 0">
|
|
|
|
- <view v-for="(item,index) in listData" :key="index" :id="item.id" class="all-type-list-content commodity-list" @click.stop="navToDetailPage(item.productID)">
|
|
|
|
- <image mode='widthFix' :src="item.mainImage" class="list-img" alt="list-img"></image>
|
|
|
|
- <view class="list-details-info">
|
|
|
|
- <text class="list-details-title">{{item.name}}</text>
|
|
|
|
- <text class="list-details-specs">规格:{{item.unit}}</text>
|
|
|
|
- <view class="list-details-specs" v-if="item.productCode!=''&&item.productCode!=null">商品编码:{{item.productCode}}</view>
|
|
|
|
- <view class="list-details-price">
|
|
|
|
- <template v-if="userIdentity == 3">
|
|
|
|
- <view class="floor-item-act" v-if="item.actStatus==1">
|
|
|
|
- <view class="floor-tags" v-if="PromotionsFormat(item.promotions)">
|
|
|
|
- {{item.promotions.name}}<text v-if="item.price1TextFlag != '1' && item.supplierId === shopId">:¥{{ item.price | NumFormat }}</text>
|
|
|
|
|
|
+ <template v-else>
|
|
|
|
+ <view class="container-list" :style="{'height':scrollHeight+'px'}">
|
|
|
|
+ <view v-for="(item,index) in listData" :key="index" :id="item.id" class="all-type-list-content commodity-list" @click.stop="navToDetailPage(item.productID)">
|
|
|
|
+ <image mode='widthFix' :src="item.mainImage" class="list-img" alt="list-img"></image>
|
|
|
|
+ <view class="list-details-info">
|
|
|
|
+ <text class="list-details-title">{{item.name}}</text>
|
|
|
|
+ <text class="list-details-specs">规格:{{item.unit}}</text>
|
|
|
|
+ <view class="list-details-specs" v-if="item.productCode!=''&&item.productCode!=null">商品编码:{{item.productCode}}</view>
|
|
|
|
+ <view class="list-details-price">
|
|
|
|
+ <template v-if="userIdentity == 3">
|
|
|
|
+ <view class="floor-item-act" v-if="item.actStatus==1">
|
|
|
|
+ <view class="floor-tags" v-if="PromotionsFormat(item.promotions)">
|
|
|
|
+ {{item.promotions.name}}<text v-if="item.price1TextFlag != '1' && item.supplierId === shopId">:¥{{ item.price | NumFormat }}</text>
|
|
|
|
+ </view>
|
|
|
|
+ <view class="floor-tags" v-else>{{item.promotions.name}}</view>
|
|
</view>
|
|
</view>
|
|
- <view class="floor-tags" v-else>{{item.promotions.name}}</view>
|
|
|
|
- </view>
|
|
|
|
- <view class="floor-item-act" v-if="item.actStatus ==0 && item.ladderPriceFlag==1">
|
|
|
|
- <view class="floor-tags">阶梯价格</view>
|
|
|
|
- </view>
|
|
|
|
- </template>
|
|
|
|
- <template v-else>
|
|
|
|
- <view class="floor-item-act" v-if="item.actStatus==1">
|
|
|
|
- <view class="floor-tags" v-if="PromotionsFormat(item.promotions)">
|
|
|
|
- {{item.promotions.name}}<text v-if="hasLogin && item.price1TextFlag != '1'">:¥{{ item.price | NumFormat }}</text>
|
|
|
|
|
|
+ <view class="floor-item-act" v-if="item.actStatus ==0 && item.ladderPriceFlag==1">
|
|
|
|
+ <view class="floor-tags">阶梯价格</view>
|
|
</view>
|
|
</view>
|
|
- <view class="floor-tags" v-else>{{item.promotions.name}}</view>
|
|
|
|
- </view>
|
|
|
|
- <view class="floor-item-act" v-if="item.actStatus ==0 && item.ladderPriceFlag==1">
|
|
|
|
- <view class="floor-tags">阶梯价格</view>
|
|
|
|
- </view>
|
|
|
|
- </template>
|
|
|
|
- <view v-if="hasLogin" class="list-price">
|
|
|
|
- <view v-if="userIdentity == 1">
|
|
|
|
- <text class="price-larger" :class="PromotionsFormat(item.promotions) ? 'none' : ''">
|
|
|
|
- ¥{{ (PromotionsFormat(item.promotions) ? item.price1 : item.retailPrice) | NumFormat }}
|
|
|
|
- </text>
|
|
|
|
- </view>
|
|
|
|
- <view v-if="userIdentity == 4">
|
|
|
|
- <view class="price-larger" v-if="item.price1TextFlag == '1'">
|
|
|
|
- <text class="txt">¥未公开价格</text>
|
|
|
|
|
|
+ </template>
|
|
|
|
+ <template v-else>
|
|
|
|
+ <view class="floor-item-act" v-if="item.actStatus==1">
|
|
|
|
+ <view class="floor-tags" v-if="PromotionsFormat(item.promotions)">
|
|
|
|
+ {{item.promotions.name}}<text v-if="hasLogin && item.price1TextFlag != '1'">:¥{{ item.price | NumFormat }}</text>
|
|
|
|
+ </view>
|
|
|
|
+ <view class="floor-tags" v-else>{{item.promotions.name}}</view>
|
|
|
|
+ </view>
|
|
|
|
+ <view class="floor-item-act" v-if="item.actStatus ==0 && item.ladderPriceFlag==1">
|
|
|
|
+ <view class="floor-tags">阶梯价格</view>
|
|
|
|
+ </view>
|
|
|
|
+ </template>
|
|
|
|
+ <view v-if="hasLogin" class="list-price">
|
|
|
|
+ <view v-if="userIdentity == 1">
|
|
|
|
+ <text class="price-larger" :class="PromotionsFormat(item.promotions) ? 'none' : ''">
|
|
|
|
+ ¥{{ (PromotionsFormat(item.promotions) ? item.price1 : item.retailPrice) | NumFormat }}
|
|
|
|
+ </text>
|
|
|
|
+ </view>
|
|
|
|
+ <view v-if="userIdentity == 4">
|
|
|
|
+ <view class="price-larger" v-if="item.price1TextFlag == '1'">
|
|
|
|
+ <text class="txt">¥未公开价格</text>
|
|
|
|
+ </view>
|
|
|
|
+ <view v-else>
|
|
|
|
+ <view class="price-larger" v-if="item.price1TextFlag == '2'">
|
|
|
|
+ <text class="txt">¥价格仅会员可见</text>
|
|
|
|
+ </view>
|
|
|
|
+ <template v-else>
|
|
|
|
+ <text class="price-larger" :class="PromotionsFormat(item.promotions) ? 'none' : ''">
|
|
|
|
+ ¥{{ (PromotionsFormat(item.promotions) ? item.price1 : item.retailPrice) | NumFormat }}
|
|
|
|
+ </text>
|
|
|
|
+ </template>
|
|
|
|
+ </view>
|
|
</view>
|
|
</view>
|
|
- <view v-else>
|
|
|
|
- <view class="price-larger" v-if="item.price1TextFlag == '2'">
|
|
|
|
- <text class="txt">¥价格仅会员可见</text>
|
|
|
|
|
|
+ <view v-if="userIdentity == 2">
|
|
|
|
+ <view class="price-larger" v-if="item.price1TextFlag == '1'">
|
|
|
|
+ <text class="txt">¥未公开价格</text>
|
|
</view>
|
|
</view>
|
|
<template v-else>
|
|
<template v-else>
|
|
<text class="price-larger" :class="PromotionsFormat(item.promotions) ? 'none' : ''">
|
|
<text class="price-larger" :class="PromotionsFormat(item.promotions) ? 'none' : ''">
|
|
@@ -89,30 +101,20 @@
|
|
</text>
|
|
</text>
|
|
</template>
|
|
</template>
|
|
</view>
|
|
</view>
|
|
|
|
+ </view>
|
|
|
|
+ <view v-else class="list-login-now">
|
|
|
|
+ <text class="p-no">¥</text>
|
|
|
|
+ <uni-stars :stars="parseInt(item.price1Grade)" :font-size='36' :width-info="180"></uni-stars>
|
|
</view>
|
|
</view>
|
|
- <view v-if="userIdentity == 2">
|
|
|
|
- <view class="price-larger" v-if="item.price1TextFlag == '1'">
|
|
|
|
- <text class="txt">¥未公开价格</text>
|
|
|
|
- </view>
|
|
|
|
- <template v-else>
|
|
|
|
- <text class="price-larger" :class="PromotionsFormat(item.promotions) ? 'none' : ''">
|
|
|
|
- ¥{{ (PromotionsFormat(item.promotions) ? item.price1 : item.retailPrice) | NumFormat }}
|
|
|
|
- </text>
|
|
|
|
- </template>
|
|
|
|
- </view>
|
|
|
|
- </view>
|
|
|
|
- <view v-else class="list-login-now">
|
|
|
|
- <text class="p-no">¥</text>
|
|
|
|
- <uni-stars :stars="parseInt(item.price1Grade)" :font-size='36' :width-info="180"></uni-stars>
|
|
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
- </view>
|
|
|
|
- <!--加载loadding-->
|
|
|
|
- <tui-loadmore :visible="loadding" :index="3" type="black"></tui-loadmore>
|
|
|
|
- <tui-nomore :visible="!pullUpOn" bgcolor="#F7F7F7" :text='nomoreText'></tui-nomore>
|
|
|
|
- <!--加载loadding-->
|
|
|
|
|
|
+ <!--加载loadding-->
|
|
|
|
+ <tui-loadmore :visible="loadding" :index="3" type="black"></tui-loadmore>
|
|
|
|
+ <tui-nomore :visible="!pullUpOn" bgcolor="#F7F7F7" :text='nomoreText'></tui-nomore>
|
|
|
|
+ <!--加载loadding-->
|
|
|
|
+ </template>
|
|
</template>
|
|
</template>
|
|
<!--右抽屉-->
|
|
<!--右抽屉-->
|
|
<tui-drawer mode="right" :visible="rightDrawer" @close="closeDrawer">
|
|
<tui-drawer mode="right" :visible="rightDrawer" @close="closeDrawer">
|
|
@@ -170,7 +172,7 @@
|
|
loadding: false,
|
|
loadding: false,
|
|
pullUpOn: true,
|
|
pullUpOn: true,
|
|
pullFlag: true,
|
|
pullFlag: true,
|
|
- hasNextPage: false,
|
|
|
|
|
|
+ totalPage: 0,
|
|
nomoreText: '上拉显示更多',
|
|
nomoreText: '上拉显示更多',
|
|
rightDrawer: false,
|
|
rightDrawer: false,
|
|
setNavigationBarTitle:'',
|
|
setNavigationBarTitle:'',
|
|
@@ -192,69 +194,83 @@
|
|
methods:{
|
|
methods:{
|
|
initOption(option) {
|
|
initOption(option) {
|
|
this.listQuery.id = option.id;
|
|
this.listQuery.id = option.id;
|
|
- this.listQuery.idType = Number(option.classType);
|
|
|
|
|
|
+ this.listQuery.idType = this.classifyType = Number(option.classType);
|
|
this.setNavigationBarTitle = option.title
|
|
this.setNavigationBarTitle = option.title
|
|
uni.setNavigationBarTitle({title:option.title});
|
|
uni.setNavigationBarTitle({title:option.title});
|
|
this.$api.getComStorage('userInfo').then((resolve) =>{
|
|
this.$api.getComStorage('userInfo').then((resolve) =>{
|
|
- this.userID = resolve.userID ? resolve.userID :0;
|
|
|
|
|
|
+ this.userID = resolve.userID ? resolve.userID : 0
|
|
this.userIdentity = resolve.userIdentity
|
|
this.userIdentity = resolve.userIdentity
|
|
this.isRequest = true
|
|
this.isRequest = true
|
|
this.GetProductListInfo()
|
|
this.GetProductListInfo()
|
|
|
|
+ this.GetProductOneClassly()
|
|
}).catch(error =>{
|
|
}).catch(error =>{
|
|
this.GetProductListInfo()
|
|
this.GetProductListInfo()
|
|
|
|
+ this.GetProductOneClassly()
|
|
})
|
|
})
|
|
console.log(this.classifyID)
|
|
console.log(this.classifyID)
|
|
},
|
|
},
|
|
- InfoSecondClassly(){//根据一级分类ID 查询二三级分类
|
|
|
|
-
|
|
|
|
|
|
+ GetProductOneClassly(){//根据分类ID 查询二三级分类
|
|
|
|
+ this.CommonService.GetProductOneClassly({typeId:this.listQuery.id,idType:this.classifyType,source :'crm'}).then(response =>{
|
|
|
|
+ console.log(response.data)
|
|
|
|
+ }).catch(error =>{
|
|
|
|
+ this.$util.msg(error.msg,2000)
|
|
|
|
+ })
|
|
},
|
|
},
|
|
GetProductListInfo(){//查询分类商品列表
|
|
GetProductListInfo(){//查询分类商品列表
|
|
- this.listQuery.pageNum = 1
|
|
|
|
this.ProductService.GetSearchProductTypeData(this.listQuery).then(response =>{
|
|
this.ProductService.GetSearchProductTypeData(this.listQuery).then(response =>{
|
|
- let data = response.data.productPage
|
|
|
|
- this.hasNextPage = data.hasNextPage
|
|
|
|
- if(data.results && data.results.length > 0){
|
|
|
|
- this.isEmpty = false;
|
|
|
|
- this.dataList = data.results;
|
|
|
|
- if(this.hasNextPage){
|
|
|
|
|
|
+ const resData = JSON.parse(response.data);
|
|
|
|
+ const resList = resData.items;
|
|
|
|
+ if(resList && resList.length > 0){
|
|
|
|
+ this.showEmpty = false
|
|
|
|
+ this.totalPage = resData.total;
|
|
|
|
+ this.listData = [...resList];
|
|
|
|
+ this.GetProductPrice()
|
|
|
|
+ this.showSkeleton = false
|
|
|
|
+ // 防上拉暴滑
|
|
|
|
+ this.pullFlag = false;
|
|
|
|
+ setTimeout(()=>{ this.pullFlag = true; },500)
|
|
|
|
+ // 底部提示文案
|
|
|
|
+ if(this.totalPage>this.listData.length) {
|
|
this.pullUpOn = false
|
|
this.pullUpOn = false
|
|
this.nomoreText = '上拉显示更多'
|
|
this.nomoreText = '上拉显示更多'
|
|
- }else{
|
|
|
|
- if(this.dataList.length < 5){
|
|
|
|
- this.pullUpOn = true
|
|
|
|
- }else{
|
|
|
|
- this.pullUpOn = false
|
|
|
|
- this.nomoreText = '已至底部'
|
|
|
|
- }
|
|
|
|
|
|
+ } else {
|
|
|
|
+ this.pullUpOn = false
|
|
|
|
+ this.loadding = false
|
|
|
|
+ this.nomoreText = '已至底部'
|
|
}
|
|
}
|
|
- }else{
|
|
|
|
- this.dataList = []
|
|
|
|
- this.isEmpty = true
|
|
|
|
- this.pullUpOn = true
|
|
|
|
|
|
+ } else {
|
|
|
|
+ this.showEmpty = true;
|
|
}
|
|
}
|
|
}).catch(error =>{
|
|
}).catch(error =>{
|
|
this.$util.msg(error.msg,2000);
|
|
this.$util.msg(error.msg,2000);
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- GetOnReachBottomData(index){//上拉加载
|
|
|
|
|
|
+ GetOnReachBottomData(){//上拉加载
|
|
this.listQuery.pageNum += 1
|
|
this.listQuery.pageNum += 1
|
|
- this.ProductService.GetProductListByTypeID(this.listQuery).then(response =>{
|
|
|
|
- let data = response.data.productPage
|
|
|
|
- this.hasNextPage = data.hasNextPage;
|
|
|
|
- this.dataList = this.dataList.concat(data.results)
|
|
|
|
- this.pullFlag = false;// 防上拉暴滑
|
|
|
|
- setTimeout(()=>{this.pullFlag = true;},500)
|
|
|
|
- if(this.hasNextPage){
|
|
|
|
|
|
+ this.ProductService.GetSearchProductTypeData(this.listQuery).then(response =>{
|
|
|
|
+ const resData = JSON.parse(response.data);
|
|
|
|
+ const resList = resData.items;
|
|
|
|
+ this.totalPage = resData.total;
|
|
|
|
+ this.listData = [...this.listData,...resList];
|
|
|
|
+ this.GetProductPrice()
|
|
|
|
+ this.showSkeleton = false
|
|
|
|
+ // 防上拉暴滑
|
|
|
|
+ this.pullFlag = false;
|
|
|
|
+ setTimeout(()=>{ this.pullFlag = true; },500)
|
|
|
|
+ // 底部提示文案
|
|
|
|
+ if(this.totalPage>this.listData.length) {
|
|
this.pullUpOn = false
|
|
this.pullUpOn = false
|
|
this.nomoreText = '上拉显示更多'
|
|
this.nomoreText = '上拉显示更多'
|
|
- }else{
|
|
|
|
- this.loadding = false
|
|
|
|
|
|
+ } else {
|
|
this.pullUpOn = false
|
|
this.pullUpOn = false
|
|
|
|
+ this.loadding = false
|
|
this.nomoreText = '已至底部'
|
|
this.nomoreText = '已至底部'
|
|
}
|
|
}
|
|
- })
|
|
|
|
|
|
+ }).catch(error =>{
|
|
|
|
+ this.$util.msg(error.msg,2000);
|
|
|
|
+ })
|
|
},
|
|
},
|
|
- getProductPrice(){//获取价格
|
|
|
|
|
|
+ GetProductPrice(){//获取价格
|
|
let productIdArr = [];
|
|
let productIdArr = [];
|
|
this.listData.map(item=>{// 0公开价格 1不公开价格 2仅对会员机构公开
|
|
this.listData.map(item=>{// 0公开价格 1不公开价格 2仅对会员机构公开
|
|
productIdArr.push(item.productID)
|
|
productIdArr.push(item.productID)
|
|
@@ -373,9 +389,17 @@
|
|
onPullDownRefresh() {
|
|
onPullDownRefresh() {
|
|
setTimeout(() => {
|
|
setTimeout(() => {
|
|
this.listQuery.pageNum = 1
|
|
this.listQuery.pageNum = 1
|
|
|
|
+ this.GetProductListInfo()
|
|
uni.stopPullDownRefresh()
|
|
uni.stopPullDownRefresh()
|
|
}, 200)
|
|
}, 200)
|
|
},
|
|
},
|
|
|
|
+ onReachBottom() {
|
|
|
|
+ if(this.totalPage>this.listData.length) {
|
|
|
|
+ this.loadding = true
|
|
|
|
+ this.pullUpOn = true
|
|
|
|
+ this.GetOnReachBottomData()
|
|
|
|
+ }
|
|
|
|
+ },
|
|
onShow() {
|
|
onShow() {
|
|
|
|
|
|
}
|
|
}
|