|
@@ -4,7 +4,7 @@
|
|
|
<view class="nav-tab-bar u-f-ajc">
|
|
|
<block v-for="(tab,index) in tabBars" :key='tab.id' :class="{ current: tabIndex === index }">
|
|
|
<view class="tabstyle u-f-ajc" :class="{'addstyle':tabIndex==index}" @tap="changeTab(index)">{{tab.name}}
|
|
|
- <i v-if='(tabIndex==index)' class='nav-tab-line'>√</i>
|
|
|
+ <i v-if='(tabIndex==index)' class='nav-tab-line iconfont icon-gou'></i>
|
|
|
</view>
|
|
|
</block>
|
|
|
</view>
|
|
@@ -39,13 +39,16 @@
|
|
|
<view class="list-details-info">
|
|
|
<text class="list-details-title">{{item.name}}</text>
|
|
|
<text class="list-details-specs">规格:{{item.unit?item.unit:''}}</text>
|
|
|
- <text class="list-details-miniQuantity">起订量:{{item.minBuyNumber}}</text>
|
|
|
+ <text class="list-details-miniQuantity list-details-specs">起订量:{{item.minBuyNumber}}</text>
|
|
|
+ <view class="list-details-specs" v-if="item.productCode!=''&&item.productCode!=null">
|
|
|
+ <view>商品编码:{{item.productCode}}</view>
|
|
|
+ </view>
|
|
|
<view class="list-details-price">
|
|
|
<view class="list-shop">
|
|
|
<view class="list-price" >
|
|
|
<text class="price-view activity" v-if="item.isShowActFlg">活动价</text>
|
|
|
- <text class="price-larger">¥{{item.retailPrice.toFixed(2)}}</text>
|
|
|
- <text class="price-view ladder" v-if="item.ladderPriceFlag == '1'">阶</text>
|
|
|
+ <text class="price-larger" >¥{{item.retailPrice.toFixed(2)}}</text>
|
|
|
+ <text class="price-view ladder" v-if="item.ladderPriceFlag == '1'" @click.stop="alertjieti(item)">阶</text>
|
|
|
</view>
|
|
|
<view class="list-price-none" v-if="item.repurchasePriceState">
|
|
|
<text class="price-none">¥{{item.discountPrice}}</text>
|
|
@@ -66,18 +69,18 @@
|
|
|
<view :class="tabIndex" v-if="tabIndex === 1">
|
|
|
<scroll-view :style="{'height':scrollHeight+'px'}" @scrolltolower="scrolltolower" scroll-y>
|
|
|
<view class="all-zuhe-list" v-for="(item,index) in combinationProduct" :key="index" :id="item.id">
|
|
|
- <view class="zuhe_title" >{{item.name}}</view>
|
|
|
- <view v-for="(pros,proIndex) in item.combinationProductList" :key="proIndex" :id="pros.productID" class="zuhe-list-content commodity-list" @click.stop="navToDetailPage(prop.productID)">
|
|
|
- <view class="list-details-info">
|
|
|
+ <view class="zuhe_title" :class="index==0 ? 'active' : ''">{{item.name}}</view>
|
|
|
+ <view v-for="(pros,proIndex) in item.combinationProductList" :class="index==0 ? 'stylecontent' : ''" :key="proIndex" :id="pros.productID" class="zuhe-list-content commodity-list" >
|
|
|
+ <view class="list-details-info" >
|
|
|
<text class="list-details-title zuhe_list_text">商品编码:{{pros.productCode}}</text>
|
|
|
- <text class="list-details-specs zuhe_list_text">{{pros.name}}</text>
|
|
|
+ <text class="list-details-specs zuhe_list_text" @click.stop="navToDetailPage(pros.productID)">{{pros.name}}</text>
|
|
|
<view class="list-details-price zuhe_list_price">
|
|
|
<view class="list-shop">
|
|
|
<view class="list-price zuhe_list_price" >
|
|
|
<text class="zuhe_price-larger zuhe_list_text" >价格:¥{{pros.retailPrice.toFixed(2)}}</text>
|
|
|
- <text class="price-two zuhe_list_text">
|
|
|
+ <text class="price-two zuhe_list_text" @click.stop="alertjieti(pros)">
|
|
|
总价:<text class="zuhe_list_zj">¥ {{pros.totalPrice.toFixed(2)}}</text>
|
|
|
- <text class="price-view ladder" v-if="pros.ladderPriceFlag == '1'">阶</text>
|
|
|
+ <text class="price-view ladder" v-if="pros.ladderPriceFlag == '1'" >阶</text>
|
|
|
</text>
|
|
|
<text class="price-view activity" v-if="pros.actStatus == '1'">活动价</text>
|
|
|
</view>
|
|
@@ -87,9 +90,9 @@
|
|
|
</view>
|
|
|
<view class="count">
|
|
|
<view class="number-box">
|
|
|
- <view class="iconfont icon-jianhao" @click.stop="changeCountSub(pros)"></view>
|
|
|
- <input class="btn-input" type="number" maxlength='4' v-model="pros.initProductNum" @blur="changeNnmber($event,pros)">
|
|
|
- <view class="iconfont icon-jiahao" @click.stop="changeCountAdd(pros)"></view>
|
|
|
+ <view class="iconfont icon-jianhao" @click.stop="changeCountSub(item,pros)"></view>
|
|
|
+ <input class="btn-input" type="number" maxlength='4' v-model="pros.initProductNum" @blur="changeNnmber($event,item,pros)">
|
|
|
+ <view class="iconfont icon-jiahao" @click.stop="changeCountAdd(item,pros)"></view>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
@@ -98,11 +101,12 @@
|
|
|
</view>
|
|
|
<view class="foot_conten" >
|
|
|
<view class="zuhe_foot-box">
|
|
|
+ <!-- -->
|
|
|
<text>种类:{{item.productKind}}</text>
|
|
|
- <text>总数:{{item.productTotalNum}}</text>
|
|
|
+ <text >总数:{{item.productTotalNum}}</text>
|
|
|
<text>总额:{{item.productTotalAmount}}</text>
|
|
|
</view>
|
|
|
- <button type="default" class="buycart" @click.stop="addCart(item.combinationProductList)">加入购物车</button>
|
|
|
+ <button type="default" class="buycart" @click.stop="operationHanld(item)">加入购物车</button>
|
|
|
</view>
|
|
|
</view>
|
|
|
</scroll-view>
|
|
@@ -163,12 +167,14 @@
|
|
|
cartQuantity: 0,
|
|
|
showRegularBtn: false,
|
|
|
isPrecedence:false,
|
|
|
- ladderPriceList:[],//是否 阶梯
|
|
|
+ ladderPriceList:[],//是否 阶梯,
|
|
|
tabIndex:0,
|
|
|
+ goodsList:[],
|
|
|
tabBars:[
|
|
|
{name:'单一商品',id:'danyi'},
|
|
|
{name:'组合商品',id:'zuhe'}
|
|
|
],
|
|
|
+ isShow: false,
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
@@ -206,7 +212,6 @@
|
|
|
getSellerProduct(params).then(response =>{
|
|
|
this.isShowWrapper = true
|
|
|
const responseData = response.data;
|
|
|
- console.log(responseData)
|
|
|
if(responseData.results && responseData.results.length > 0){
|
|
|
this.hasNextPage = responseData.hasNextPage;
|
|
|
this.isShowEmpty = false;
|
|
@@ -274,19 +279,12 @@
|
|
|
getcombinationProduct(params).then(response =>{
|
|
|
this.isShowWrapper = true
|
|
|
const responseData = response.data;
|
|
|
- // responseData.forEach((item,index){
|
|
|
- // if(item.index!=0){
|
|
|
-
|
|
|
- // }
|
|
|
- // }}
|
|
|
if(responseData.results && responseData.results.length > 0){
|
|
|
this.hasNextPage = responseData.hasNextPage;
|
|
|
this.isShowEmpty = false;
|
|
|
if(loadMore) {
|
|
|
- console.log('1111')
|
|
|
this.combinationProduct = [...this.combinationProduct,...responseData.results];
|
|
|
} else {
|
|
|
- console.log('2222')
|
|
|
this.combinationProduct = [...responseData.results];
|
|
|
|
|
|
this.showSkeleton = false;
|
|
@@ -311,8 +309,7 @@
|
|
|
this.$util.msg(error.msg,2000);
|
|
|
})
|
|
|
},
|
|
|
- changeCountAdd(pros){//商品数量加加
|
|
|
- console.log(pros)
|
|
|
+ changeCountAdd(item,pros){//商品数量加加
|
|
|
if(pros.initProductNum == 0){
|
|
|
pros.initProductNum = pros.minBuyNumber
|
|
|
this.processActivityPrice(pros)
|
|
@@ -320,8 +317,11 @@
|
|
|
pros.initProductNum++
|
|
|
this.processActivityPrice(pros)
|
|
|
}
|
|
|
+ this.totalPeice(item)
|
|
|
+ this.totalCount(item)
|
|
|
+ this.totalKind(item)
|
|
|
},
|
|
|
- changeCountSub(pros){//商品数量减减
|
|
|
+ changeCountSub(item,pros){//商品数量减减
|
|
|
if(pros.initProductNum==0){
|
|
|
this.$util.msg(`采购数量不能小于0`,2000);
|
|
|
return
|
|
@@ -329,8 +329,11 @@
|
|
|
pros.initProductNum--
|
|
|
this.processActivityPrice(pros)
|
|
|
}
|
|
|
+ this.totalPeice(item)
|
|
|
+ this.totalCount(item)
|
|
|
+ this.totalKind(item)
|
|
|
},
|
|
|
- changeNnmber(e,pros){//输入商品数量更新
|
|
|
+ changeNnmber(e,item,pros){//输入商品数量更新
|
|
|
let _value = e.detail.value;
|
|
|
if(!this.$api.isNumber(_value)){
|
|
|
pros.initProductNum = pros.minBuyNumber
|
|
@@ -341,6 +344,42 @@
|
|
|
pros.initProductNum = e.detail.value
|
|
|
this.processActivityPrice(pros)
|
|
|
}
|
|
|
+ this.totalPeice(item)
|
|
|
+ this.totalCount(item)
|
|
|
+ this.totalKind(item)
|
|
|
+ },
|
|
|
+ totalPeice(item){ //计算总价格,每次调用此方法,将初始值为0,遍历价格并累加
|
|
|
+ let prosPrice=0;
|
|
|
+ let productsList =[];
|
|
|
+ productsList=item.combinationProductList;
|
|
|
+ productsList.forEach(pros=>{
|
|
|
+ prosPrice+=pros.retailPrice*pros.initProductNum;
|
|
|
+ item.productTotalAmount = prosPrice;
|
|
|
+ })
|
|
|
+ // console.log(prosPrice)
|
|
|
+ },
|
|
|
+ totalCount(item){//计算总数量
|
|
|
+ let prosAllCount=0
|
|
|
+ let productsList =[];
|
|
|
+ productsList = item.combinationProductList
|
|
|
+ productsList.forEach(pros=>{
|
|
|
+ prosAllCount+=parseInt(pros.initProductNum);
|
|
|
+ item.productTotalNum = prosAllCount
|
|
|
+ })
|
|
|
+ // console.log(prosAllCount)
|
|
|
+ },
|
|
|
+ totalKind(item){
|
|
|
+ let productsList =[];
|
|
|
+ let checkList = [];
|
|
|
+ productsList=item.combinationProductList;
|
|
|
+ productsList.forEach(pros=>{
|
|
|
+ if(pros.initProductNum>0){
|
|
|
+ checkList.push(pros)
|
|
|
+ item.productKind = checkList.length
|
|
|
+ }else{
|
|
|
+ return item.productKind
|
|
|
+ }
|
|
|
+ })
|
|
|
},
|
|
|
processActivityPrice(pros){//单独处理活动价格和阶梯价格
|
|
|
let ladderPriceList = pros.ladderPriceList;
|
|
@@ -358,9 +397,9 @@
|
|
|
operationHanld(prop){
|
|
|
this.$emit('operationConfim',prop);
|
|
|
},
|
|
|
- addCart(prop){
|
|
|
- console.log(prop)
|
|
|
- },
|
|
|
+ alertjieti(pros){
|
|
|
+ this.$emit('alertjietiConfim',pros);
|
|
|
+ },
|
|
|
changeTab(index){
|
|
|
this.tabIndex = index;
|
|
|
if(index == 0){
|
|
@@ -395,6 +434,7 @@
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss">
|
|
|
+
|
|
|
.all-zuhe-list{
|
|
|
background: #FFFFFF;
|
|
|
}
|
|
@@ -433,23 +473,27 @@
|
|
|
.zuhe_title{
|
|
|
background:#FFFFFF;
|
|
|
height: 76rpx;
|
|
|
- color: #E15616;
|
|
|
font-size: 28rpx;
|
|
|
- border-bottom: 4rpx solid #E15616;
|
|
|
+ color: #1675E1;
|
|
|
+ border-bottom: 4rpx solid #1675E1 ;
|
|
|
line-height: 76rpx;
|
|
|
- padding-left: 30rpx;;
|
|
|
+ padding-left: 30rpx;
|
|
|
+ &.active{
|
|
|
+ color: #E15616;
|
|
|
+ border-bottom: 4rpx solid #E15616;
|
|
|
+ }
|
|
|
}
|
|
|
- .nav-tab-line{
|
|
|
+ .icon-gou{
|
|
|
color: #E15616;
|
|
|
position: absolute;
|
|
|
- top: 20rpx;
|
|
|
- right: 4rpx;
|
|
|
+ top: 22rpx;
|
|
|
+ right: 0rpx;
|
|
|
font-weight: bold
|
|
|
- }
|
|
|
+ }
|
|
|
.addstyle{
|
|
|
- background: linear-gradient(-42deg, transparent 28rpx, #E15616 0) top right;
|
|
|
- color: #FFFFFF;
|
|
|
- }
|
|
|
+ background: linear-gradient(-42deg, transparent 28rpx, #E15616 0) top right;
|
|
|
+ color: #FFFFFF;
|
|
|
+ }
|
|
|
.tabstyle{
|
|
|
width: 128rpx;
|
|
|
height: 64rpx;
|
|
@@ -561,7 +605,7 @@
|
|
|
width: 655rpx;
|
|
|
// height: 214rpx;
|
|
|
background: #fff;
|
|
|
- border: 2px solid #FFF0DE;
|
|
|
+ border: 2rpx solid #DEF4FF;
|
|
|
display: flex;
|
|
|
flex-direction: row;
|
|
|
box-sizing: content-box;
|
|
@@ -569,7 +613,11 @@
|
|
|
border-radius: 14rpx;
|
|
|
margin: 10rpx auto;
|
|
|
padding: 20rpx;
|
|
|
+ &.stylecontent{
|
|
|
+ border: 2rpx solid #FFF0DE;
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
.list-details-info {
|
|
|
width: 100%;
|
|
|
flex-direction: column;
|
|
@@ -588,7 +636,7 @@
|
|
|
width: 100%;
|
|
|
display: inline-block;
|
|
|
margin-top: 8rpx;
|
|
|
- color: #999999;
|
|
|
+ color: #666666;
|
|
|
}
|
|
|
.list-details-miniQuantity {
|
|
|
width: 100%;
|
|
@@ -640,7 +688,7 @@
|
|
|
height: auto;
|
|
|
flex: 6;
|
|
|
.list-price {
|
|
|
- width: 100%;
|
|
|
+ // width: 100%;
|
|
|
color: #FF2A2A;
|
|
|
float: left;
|
|
|
line-height:36rpx ;
|
|
@@ -650,6 +698,7 @@
|
|
|
margin-top: 20rpx;
|
|
|
font-size: $font-size-30;
|
|
|
display: inline-block;
|
|
|
+ margin-right: 20rpx;
|
|
|
}
|
|
|
.zuhe_price-larger{
|
|
|
color: #666666;
|